diff --git a/apps/landing/src/app/(detail)/components/[component]/button/demo/Variants.tsx b/apps/landing/src/app/(detail)/components/[component]/button/demo/1_Variants.tsx similarity index 100% rename from apps/landing/src/app/(detail)/components/[component]/button/demo/Variants.tsx rename to apps/landing/src/app/(detail)/components/[component]/button/demo/1_Variants.tsx diff --git a/apps/landing/src/app/(detail)/components/[component]/button/demo/Icon.tsx b/apps/landing/src/app/(detail)/components/[component]/button/demo/2_Icon.tsx similarity index 100% rename from apps/landing/src/app/(detail)/components/[component]/button/demo/Icon.tsx rename to apps/landing/src/app/(detail)/components/[component]/button/demo/2_Icon.tsx diff --git a/apps/landing/src/app/(detail)/components/[component]/button/demo/Danger.tsx b/apps/landing/src/app/(detail)/components/[component]/button/demo/3_Danger.tsx similarity index 100% rename from apps/landing/src/app/(detail)/components/[component]/button/demo/Danger.tsx rename to apps/landing/src/app/(detail)/components/[component]/button/demo/3_Danger.tsx diff --git a/apps/landing/src/app/(detail)/components/[component]/button/demo/Disabled.tsx b/apps/landing/src/app/(detail)/components/[component]/button/demo/4_Disabled.tsx similarity index 100% rename from apps/landing/src/app/(detail)/components/[component]/button/demo/Disabled.tsx rename to apps/landing/src/app/(detail)/components/[component]/button/demo/4_Disabled.tsx diff --git a/apps/landing/src/app/(detail)/components/[component]/button/demo/Colors.tsx b/apps/landing/src/app/(detail)/components/[component]/button/demo/5_Colors.tsx similarity index 100% rename from apps/landing/src/app/(detail)/components/[component]/button/demo/Colors.tsx rename to apps/landing/src/app/(detail)/components/[component]/button/demo/5_Colors.tsx diff --git a/apps/landing/src/app/(detail)/components/[component]/checkbox/Api.mdx b/apps/landing/src/app/(detail)/components/[component]/checkbox/Api.mdx index e69de29b..9ad52408 100644 --- a/apps/landing/src/app/(detail)/components/[component]/checkbox/Api.mdx +++ b/apps/landing/src/app/(detail)/components/[component]/checkbox/Api.mdx @@ -0,0 +1,46 @@ +import { PropsTable } from '@/components/PropsTable' + +###### API + +`Checkbox` props extends the input HTML attributes (except `type` and `onChange`). + + void`', + default: '`undefined`', + }, + { + property: 'colors', + description: 'Custom color variables for the checkbox', + type: '```{
primary?: string
border?: string
text?: string
inputBg?: string
checkIcon?: string
}```', + default: '`undefined`', + }, + ]} +/> diff --git a/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/1_Default.tsx b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/1_Default.tsx new file mode 100644 index 00000000..a4947e25 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/1_Default.tsx @@ -0,0 +1,9 @@ +import { Checkbox } from '@devup-ui/components' + +/** + * **Default** + * Basic checkbox with a label. Users can click to toggle the checked state. + */ +export default function Default() { + return Agree to terms and conditions +} diff --git a/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/2_Checked.tsx b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/2_Checked.tsx new file mode 100644 index 00000000..cd7f042b --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/2_Checked.tsx @@ -0,0 +1,9 @@ +import { Checkbox } from '@devup-ui/components' + +/** + * **Checked** + * Use `defaultChecked` prop to set the initial checked state for uncontrolled usage, or use `checked` prop for controlled state management. + */ +export default function Checked() { + return Checked by default +} diff --git a/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/3_Disabled.tsx b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/3_Disabled.tsx new file mode 100644 index 00000000..a60cc500 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/3_Disabled.tsx @@ -0,0 +1,17 @@ +import { Checkbox } from '@devup-ui/components' +import { VStack } from '@devup-ui/react' + +/** + * **Disabled** + * Use `disabled` prop to prevent user interaction. The checkbox will have a muted appearance and cannot be toggled. + */ +export default function Disabled() { + return ( + + Disabled unchecked + + Disabled checked + + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/4_Colors.tsx b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/4_Colors.tsx new file mode 100644 index 00000000..d58363d1 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/checkbox/demo/4_Colors.tsx @@ -0,0 +1,22 @@ +import { Checkbox } from '@devup-ui/components' +import { Flex } from '@devup-ui/react' + +/** + * **Colors** + * Pass in an object containing color tokens into `colors` prop. You can customize the checkbox appearance using `primary`, `border`, `text`, `inputBg`, and `checkIcon` color values. + */ +export default function Colors() { + return ( + + + Green + + + Orange + + + Steel Blue + + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/radio/Api.mdx b/apps/landing/src/app/(detail)/components/[component]/radio/Api.mdx index e69de29b..402349c9 100644 --- a/apps/landing/src/app/(detail)/components/[component]/radio/Api.mdx +++ b/apps/landing/src/app/(detail)/components/[component]/radio/Api.mdx @@ -0,0 +1,135 @@ +import { PropsTable } from '@/components/PropsTable' + +###### API + +`Radio` props extends the input HTML attributes (except `type`). + + label?: string
}```', + default: '`undefined`', + }, + { + property: 'styles', + description: 'Custom inline styles for inner elements', + type: '```{
label?: React.CSSProperties
}```', + default: '`undefined`', + }, + { + property: 'colors', + description: 'Custom color variables for the radio', + type: '```{
primary?: string
border?: string
text?: string
bg?: string
hoverBg?: string
hoverBorder?: string
hoverColor?: string
checkedBg?: string
checkedBorder?: string
checkedColor?: string
disabledBg?: string
disabledColor?: string
}```', + default: '`undefined`', + }, + ]} +/> + +###### RadioGroup API + +`RadioGroup` component for managing a group of radio buttons. + + void`', + default: '`undefined`', + }, + { + property: 'disabled', + description: 'Whether all radios in the group are disabled', + type: '`boolean`', + default: '`false`', + }, + { + property: 'direction', + description: 'The layout direction of the radio group', + type: "`'row' | 'column'`", + default: "`'row'`", + }, + { + property: 'variant', + description: 'The visual variant of the radio buttons', + type: "`'default' | 'button'`", + default: "`'default'`", + }, + { + property: 'colors', + description: 'Custom color variables (same as Radio colors)', + type: '`RadioColors`', + default: '`undefined`', + }, + { + property: 'classNames', + description: 'Custom class names for inner elements', + type: '```{
label?: string
container?: string
}```', + default: '`undefined`', + }, + { + property: 'styles', + description: 'Custom inline styles for inner elements', + type: '```{
label?: React.CSSProperties
container?: React.CSSProperties
}```', + default: '`undefined`', + }, + ]} +/> diff --git a/apps/landing/src/app/(detail)/components/[component]/radio/demo/1_Default.tsx b/apps/landing/src/app/(detail)/components/[component]/radio/demo/1_Default.tsx new file mode 100644 index 00000000..43793e54 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/radio/demo/1_Default.tsx @@ -0,0 +1,18 @@ +import { RadioGroup } from '@devup-ui/components' + +/** + * **Default** + * Use `RadioGroup` with an `options` array to create a group of radio buttons. Only one option can be selected at a time. + */ +export default function Default() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/radio/demo/2_Variant.tsx b/apps/landing/src/app/(detail)/components/[component]/radio/demo/2_Variant.tsx new file mode 100644 index 00000000..b590abf2 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/radio/demo/2_Variant.tsx @@ -0,0 +1,19 @@ +import { RadioGroup } from '@devup-ui/components' + +/** + * **Variant** + * Use `variant="button"` to display radio options as a segmented button group. Options are displayed inline with connected borders. + */ +export default function ButtonVariant() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/radio/demo/3_Direction.tsx b/apps/landing/src/app/(detail)/components/[component]/radio/demo/3_Direction.tsx new file mode 100644 index 00000000..8a3dacb1 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/radio/demo/3_Direction.tsx @@ -0,0 +1,19 @@ +import { RadioGroup } from '@devup-ui/components' + +/** + * **Direction** + * Use `direction="column"` to stack radio buttons vertically. Default direction is `"row"` which displays options horizontally. + */ +export default function Column() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/radio/demo/4_Disabled.tsx b/apps/landing/src/app/(detail)/components/[component]/radio/demo/4_Disabled.tsx new file mode 100644 index 00000000..e354b5c4 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/radio/demo/4_Disabled.tsx @@ -0,0 +1,19 @@ +import { RadioGroup } from '@devup-ui/components' + +/** + * **Disabled** + * Use `disabled` prop to prevent user interaction with all radio options. All radios will have a muted appearance and cannot be selected. + */ +export default function Disabled() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/select/Api.mdx b/apps/landing/src/app/(detail)/components/[component]/select/Api.mdx index e69de29b..d8623731 100644 --- a/apps/landing/src/app/(detail)/components/[component]/select/Api.mdx +++ b/apps/landing/src/app/(detail)/components/[component]/select/Api.mdx @@ -0,0 +1,184 @@ +import { PropsTable } from '@/components/PropsTable' + +###### API + +The Select component is a compound component that consists of multiple parts. + +###### Select + +The root component that provides context for the select. + + void`', + default: '`undefined`', + }, + { + property: 'open', + description: 'Whether the select dropdown is open (controlled)', + type: '`boolean`', + default: '`undefined`', + }, + { + property: 'defaultOpen', + description: 'Whether the select dropdown is open by default', + type: '`boolean`', + default: '`false`', + }, + { + property: 'onOpenChange', + description: 'Callback when the open state changes', + type: '`(open: boolean) => void`', + default: '`undefined`', + }, + { + property: 'type', + description: 'The selection mode of the select', + type: "`'default' | 'radio' | 'checkbox'`", + default: "`'default'`", + }, + { + property: 'typography', + description: 'Typography style key from the theme', + type: '`DevupThemeTypographyKeys`', + default: '`undefined`', + }, + { + property: 'options', + description: + 'Shorthand for defining options without using compound components', + type: '```{ label?: string; disabled?: boolean; value: string; showCheck?: boolean; onClick?: (value, e) => void }[]```', + default: '`undefined`', + }, + { + property: 'colors', + description: 'Custom color variables for the select', + type: '```{
primary?: string
border?: string
inputBackground?: string
inputDisabledBackground?: string
inputDisabledText?: string
base10?: string
title?: string
selectDisabled?: string
primaryBg?: string
}```', + default: '`undefined`', + }, + ]} +/> + +###### SelectTrigger + +The button that triggers the dropdown to open/close. + + + +###### SelectContainer + +The dropdown container that holds the options. + + + +###### SelectOption + +An individual option within the select dropdown. + + void`', + default: '`undefined`', + }, + ]} +/> + +###### SelectDivider + +A visual divider between options. diff --git a/apps/landing/src/app/(detail)/components/[component]/select/demo/1_Default.tsx b/apps/landing/src/app/(detail)/components/[component]/select/demo/1_Default.tsx new file mode 100644 index 00000000..adcd7e2f --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/select/demo/1_Default.tsx @@ -0,0 +1,23 @@ +import { + Select, + SelectContainer, + SelectOption, + SelectTrigger, +} from '@devup-ui/components' + +/** + * **Default** + * Compound component with trigger and dropdown. Use `SelectTrigger` to create the button, `SelectContainer` for the dropdown, and `SelectOption` for each option. + */ +export default function Default() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/select/demo/2_Radio.tsx b/apps/landing/src/app/(detail)/components/[component]/select/demo/2_Radio.tsx new file mode 100644 index 00000000..a7e4af88 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/select/demo/2_Radio.tsx @@ -0,0 +1,28 @@ +'use client' + +import { + Select, + SelectContainer, + SelectOption, + SelectTrigger, +} from '@devup-ui/components' +import { useState } from 'react' + +/** + * **Radio Type** + * Use `type="radio"` for single selection mode. The selected option is highlighted with a check icon, and the dropdown closes after selection. + */ +export default function Radio() { + const [value, setValue] = useState('') + + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/select/demo/3_Checkbox.tsx b/apps/landing/src/app/(detail)/components/[component]/select/demo/3_Checkbox.tsx new file mode 100644 index 00000000..5d801786 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/select/demo/3_Checkbox.tsx @@ -0,0 +1,38 @@ +'use client' + +import { + Select, + SelectContainer, + SelectOption, + SelectTrigger, +} from '@devup-ui/components' +import { useState } from 'react' + +/** + * **Checkbox Type** + * Use `type="checkbox"` for multiple selection mode. Users can select multiple options, and use `showConfirmButton` on the container to add a confirm button. + */ +export default function Checkbox() { + const [value, setValue] = useState([]) + + const handleChange = (nextValue: string) => { + if (value.includes(nextValue)) { + setValue(value.filter((v) => v !== nextValue)) + } else { + setValue([...value, nextValue]) + } + } + + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/select/demo/4_Options.tsx b/apps/landing/src/app/(detail)/components/[component]/select/demo/4_Options.tsx new file mode 100644 index 00000000..bee969e9 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/select/demo/4_Options.tsx @@ -0,0 +1,19 @@ +import { Select } from '@devup-ui/components' + +/** + * **Options** + * Use the `options` prop as a shorthand to define options without compound components. Each option can have `label`, `value`, `disabled`, and `onClick` properties. + */ +export default function WithOptions() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/stepper/Api.mdx b/apps/landing/src/app/(detail)/components/[component]/stepper/Api.mdx index e69de29b..ab4c9205 100644 --- a/apps/landing/src/app/(detail)/components/[component]/stepper/Api.mdx +++ b/apps/landing/src/app/(detail)/components/[component]/stepper/Api.mdx @@ -0,0 +1,73 @@ +import { PropsTable } from '@/components/PropsTable' + +###### API + +The Stepper component is a compound component that consists of multiple parts. + +###### Stepper + +The root component that provides context for the stepper. + + void`', + default: '`undefined`', + }, + { + property: 'min', + description: 'The minimum value allowed', + type: '`number`', + default: '`0`', + }, + { + property: 'max', + description: 'The maximum value allowed', + type: '`number`', + default: '`100`', + }, + { + property: 'type', + description: + 'Whether the value is editable via input or displayed as text', + type: "`'input' | 'text'`", + default: "`'input'`", + }, + ]} +/> + +###### StepperContainer + +A flex container that wraps the stepper elements. + +###### StepperDecreaseButton + +Button to decrease the stepper value by 1. Automatically disabled when value reaches min. + +###### StepperIncreaseButton + +Button to increase the stepper value by 1. Automatically disabled when value reaches max. + +###### StepperInput + +Displays the current value. When type is 'input', users can edit the value directly. diff --git a/apps/landing/src/app/(detail)/components/[component]/stepper/demo/1_Default.tsx b/apps/landing/src/app/(detail)/components/[component]/stepper/demo/1_Default.tsx new file mode 100644 index 00000000..4b64d9ba --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/stepper/demo/1_Default.tsx @@ -0,0 +1,23 @@ +import { + Stepper, + StepperContainer, + StepperDecreaseButton, + StepperIncreaseButton, + StepperInput, +} from '@devup-ui/components' + +/** + * **Default** + * Compound component with editable input. Use `StepperContainer` to wrap the buttons and input, and compose with `StepperDecreaseButton`, `StepperInput`, and `StepperIncreaseButton`. + */ +export default function Default() { + return ( + + + + + + + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/stepper/demo/2_Type.tsx b/apps/landing/src/app/(detail)/components/[component]/stepper/demo/2_Type.tsx new file mode 100644 index 00000000..325f8915 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/stepper/demo/2_Type.tsx @@ -0,0 +1,23 @@ +import { + Stepper, + StepperContainer, + StepperDecreaseButton, + StepperIncreaseButton, + StepperInput, +} from '@devup-ui/components' + +/** + * **Type** + * Use `type="text"` to display the value as read-only text instead of an editable input. Users can only change the value using the increase/decrease buttons. + */ +export default function TextType() { + return ( + + + + + + + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/stepper/demo/3_MinMax.tsx b/apps/landing/src/app/(detail)/components/[component]/stepper/demo/3_MinMax.tsx new file mode 100644 index 00000000..4be36b10 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/stepper/demo/3_MinMax.tsx @@ -0,0 +1,23 @@ +import { + Stepper, + StepperContainer, + StepperDecreaseButton, + StepperIncreaseButton, + StepperInput, +} from '@devup-ui/components' + +/** + * **Min & Max** + * Use `min` and `max` props to limit the value range. The decrease button is disabled at min value, and the increase button is disabled at max value. + */ +export default function MinMax() { + return ( + + + + + + + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/textbox/Api.mdx b/apps/landing/src/app/(detail)/components/[component]/textbox/Api.mdx index e69de29b..fb136c57 100644 --- a/apps/landing/src/app/(detail)/components/[component]/textbox/Api.mdx +++ b/apps/landing/src/app/(detail)/components/[component]/textbox/Api.mdx @@ -0,0 +1,70 @@ +import { PropsTable } from '@/components/PropsTable' + +###### API + +`Input` props extends the input HTML attributes (except `type`). + +`", + default: '`undefined`', + }, + { + property: 'typography', + description: 'Typography style key from the theme', + type: '`keyof DevupThemeTypography`', + default: '`undefined`', + }, + { + property: 'error', + description: 'Whether the input is in an error state', + type: '`boolean`', + default: '`false`', + }, + { + property: 'errorMessage', + description: 'Error message to display below the input', + type: '`string`', + default: '`undefined`', + }, + { + property: 'allowClear', + description: 'Whether to show a clear button when input has value', + type: '`boolean`', + default: '`true`', + }, + { + property: 'onClear', + description: 'Callback when the clear button is clicked', + type: '`() => void`', + default: '`undefined`', + }, + { + property: 'icon', + description: 'Icon to display on the left side of the input', + type: '`React.ReactNode`', + default: '`undefined`', + }, + { + property: 'disabled', + description: 'Whether the input is disabled', + type: '`boolean`', + default: '`false`', + }, + { + property: 'classNames', + description: 'Custom class names for inner elements', + type: '```{
container?: string
input?: string
icon?: string
errorMessage?: string
}```', + default: '`undefined`', + }, + { + property: 'colors', + description: 'Custom color variables for the input', + type: '```{
primary?: string
error?: string
text?: string
base?: string
iconBold?: string
border?: string
inputBackground?: string
primaryFocus?: string
negative20?: string
}```', + default: '`undefined`', + }, + ]} +/> diff --git a/apps/landing/src/app/(detail)/components/[component]/textbox/demo/1_Default.tsx b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/1_Default.tsx new file mode 100644 index 00000000..e2c71cb6 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/1_Default.tsx @@ -0,0 +1,9 @@ +import { Input } from '@devup-ui/components' + +/** + * **Default** + * Basic text input with placeholder. Includes a clear button that appears when the input has value. + */ +export default function Default() { + return +} diff --git a/apps/landing/src/app/(detail)/components/[component]/textbox/demo/2_Error.tsx b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/2_Error.tsx new file mode 100644 index 00000000..234dcf8d --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/2_Error.tsx @@ -0,0 +1,15 @@ +import { Input } from '@devup-ui/components' + +/** + * **Error** + * Use `error` prop to display the input in an error state with a red border. Use `errorMessage` prop to show a validation message below the input. + */ +export default function Error() { + return ( + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/textbox/demo/3_Disabled.tsx b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/3_Disabled.tsx new file mode 100644 index 00000000..3debcb0e --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/3_Disabled.tsx @@ -0,0 +1,9 @@ +import { Input } from '@devup-ui/components' + +/** + * **Disabled** + * Use `disabled` prop to prevent user interaction. The input will have a muted appearance and the clear button will be hidden. + */ +export default function Disabled() { + return +} diff --git a/apps/landing/src/app/(detail)/components/[component]/textbox/demo/4_Icon.tsx b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/4_Icon.tsx new file mode 100644 index 00000000..9e8997cc --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/textbox/demo/4_Icon.tsx @@ -0,0 +1,29 @@ +import { Input } from '@devup-ui/components' + +function SearchIcon() { + return ( + + + + ) +} + +/** + * **Icon** + * Pass a React node to the `icon` prop to display an icon on the left side of the input. Useful for search fields or inputs with visual context. + */ +export default function WithIcon() { + return } placeholder="Search..." /> +} diff --git a/apps/landing/src/app/(detail)/components/[component]/toggle/Api.mdx b/apps/landing/src/app/(detail)/components/[component]/toggle/Api.mdx index e69de29b..87d813ee 100644 --- a/apps/landing/src/app/(detail)/components/[component]/toggle/Api.mdx +++ b/apps/landing/src/app/(detail)/components/[component]/toggle/Api.mdx @@ -0,0 +1,70 @@ +import { PropsTable } from '@/components/PropsTable' + +###### API + +`Toggle` component props. + + void`', + default: '`undefined`', + }, + { + property: 'disabled', + description: 'Whether the toggle is disabled', + type: '`boolean`', + default: '`false`', + }, + { + property: 'variant', + description: 'The visual variant of the toggle', + type: "`'default' | 'switch'`", + default: "`'default'`", + }, + { + property: 'className', + description: 'Additional class name for the toggle container', + type: '`string`', + default: '`undefined`', + }, + { + property: 'style', + description: 'Inline styles for the toggle container', + type: '`React.CSSProperties`', + default: '`undefined`', + }, + { + property: 'classNames', + description: 'Custom class names for inner elements', + type: '```{
toggle?: string
}```', + default: '`undefined`', + }, + { + property: 'styles', + description: 'Custom inline styles for inner elements', + type: '```{
toggle?: React.CSSProperties
}```', + default: '`undefined`', + }, + { + property: 'colors', + description: 'Custom color variables for the toggle', + type: '```{
primary?: string
bg?: string
hoverBg?: string
primaryHoverBg?: string
disabledBg?: string
switchHoverOutline?: string
switchShadow?: string
}```', + default: '`undefined`', + }, + ]} +/> diff --git a/apps/landing/src/app/(detail)/components/[component]/toggle/demo/1_Default.tsx b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/1_Default.tsx new file mode 100644 index 00000000..24328a79 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/1_Default.tsx @@ -0,0 +1,9 @@ +import { Toggle } from '@devup-ui/components' + +/** + * **Default** + * Basic toggle switch. Click to toggle between on and off states. Use `value` or `defaultValue` to control the toggle state. + */ +export default function Default() { + return +} diff --git a/apps/landing/src/app/(detail)/components/[component]/toggle/demo/2_Variant.tsx b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/2_Variant.tsx new file mode 100644 index 00000000..fd29a3a2 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/2_Variant.tsx @@ -0,0 +1,9 @@ +import { Toggle } from '@devup-ui/components' + +/** + * **Variant** + * Use `variant="switch"` for an alternative visual style with a smaller track and a floating knob with hover outline effect. + */ +export default function Switch() { + return +} diff --git a/apps/landing/src/app/(detail)/components/[component]/toggle/demo/3_Disabled.tsx b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/3_Disabled.tsx new file mode 100644 index 00000000..20147152 --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/3_Disabled.tsx @@ -0,0 +1,15 @@ +import { Toggle } from '@devup-ui/components' +import { Flex } from '@devup-ui/react' + +/** + * **Disabled** + * Use `disabled` prop to prevent user interaction. The toggle will have a muted appearance and cannot be toggled. + */ +export default function Disabled() { + return ( + + + + + ) +} diff --git a/apps/landing/src/app/(detail)/components/[component]/toggle/demo/4_Colors.tsx b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/4_Colors.tsx new file mode 100644 index 00000000..6596dedf --- /dev/null +++ b/apps/landing/src/app/(detail)/components/[component]/toggle/demo/4_Colors.tsx @@ -0,0 +1,16 @@ +import { Toggle } from '@devup-ui/components' +import { Flex } from '@devup-ui/react' + +/** + * **Colors** + * Pass in an object containing color tokens into `colors` prop. Customize the toggle appearance using `primary`, `bg`, `hoverBg`, `primaryHoverBg`, `disabledBg`, and more. + */ +export default function Colors() { + return ( + + + + + + ) +}