From 502260dcbe457927224afd1af07f15590e7dba34 Mon Sep 17 00:00:00 2001 From: Rohan Chakraborty Date: Mon, 19 Oct 2026 00:28:58 +0530 Subject: [PATCH 1/3] refactor: use one size name per control height --- .agents/skills/add-new-component/SKILL.md | 2 +- apps/www/src/components/dataview-demo.tsx | 6 +-- apps/www/src/components/docs/footer.tsx | 4 +- apps/www/src/components/tag/tag.module.css | 2 +- apps/www/src/components/tag/tag.tsx | 4 +- .../src/content/docs/(overview)/upgrading.mdx | 38 +++++++++++++++++++ .../docs/ai-elements/prompt-input/demo.ts | 4 +- .../src/content/docs/components/badge/demo.ts | 6 +-- .../content/docs/components/badge/index.mdx | 2 +- .../content/docs/components/badge/props.ts | 2 +- .../content/docs/components/button/demo.ts | 6 +-- .../content/docs/components/button/index.mdx | 2 +- .../content/docs/components/button/props.ts | 4 +- .../content/docs/components/checkbox/demo.ts | 8 ++-- .../docs/components/checkbox/index.mdx | 2 +- .../content/docs/components/checkbox/props.ts | 4 +- .../content/docs/components/combobox/demo.ts | 4 +- .../content/docs/components/combobox/props.ts | 4 +- .../content/docs/components/command/props.ts | 4 +- .../docs/components/floating-actions/props.ts | 4 +- .../src/content/docs/components/input/demo.ts | 4 +- .../content/docs/components/input/index.mdx | 2 +- .../content/docs/components/input/props.ts | 4 +- .../src/content/docs/components/radio/demo.ts | 16 ++++---- .../content/docs/components/radio/index.mdx | 2 +- .../content/docs/components/radio/props.ts | 8 ++-- .../content/docs/components/search/demo.ts | 6 +-- .../content/docs/components/search/index.mdx | 2 +- .../content/docs/components/search/props.ts | 4 +- .../content/docs/components/separator/demo.ts | 22 ++++++----- .../docs/components/separator/index.mdx | 10 ++--- .../docs/components/separator/props.ts | 4 +- .../content/docs/components/switch/demo.ts | 8 ++-- .../content/docs/components/switch/index.mdx | 2 +- .../content/docs/components/switch/props.ts | 4 +- .../content/docs/components/textarea/demo.ts | 6 +-- .../docs/components/textarea/index.mdx | 2 +- .../content/docs/components/textarea/props.ts | 4 +- .../components/badge/__tests__/badge.test.tsx | 2 +- .../react/components/badge/badge.module.css | 8 ++-- packages/react/components/badge/badge.tsx | 4 +- .../button/__tests__/button.test.tsx | 6 +-- .../react/components/button/button.module.css | 4 +- packages/react/components/button/button.tsx | 10 ++--- .../checkbox/__tests__/checkbox.test.tsx | 6 +-- .../components/checkbox/checkbox.module.css | 2 +- .../react/components/checkbox/checkbox.tsx | 4 +- .../components/command/command-input.tsx | 2 +- .../data-view/components/timeline.tsx | 4 +- .../components/input/__tests__/input.test.tsx | 4 +- .../react/components/input/input.module.css | 10 ++--- packages/react/components/input/input.tsx | 4 +- .../components/radio/__tests__/radio.test.tsx | 10 ++--- .../react/components/radio/radio.module.css | 6 +-- packages/react/components/radio/radio.tsx | 6 +-- .../separator/__tests__/separator.test.tsx | 14 +++---- .../components/separator/separator.module.css | 28 +++++--------- .../react/components/separator/separator.tsx | 13 +++---- .../switch/__tests__/switch.test.tsx | 10 ++--- .../react/components/switch/switch.module.css | 2 +- packages/react/components/switch/switch.tsx | 4 +- .../text-area/__tests__/text-area.test.tsx | 4 +- .../components/text-area/text-area.module.css | 2 +- .../react/components/text-area/text-area.tsx | 4 +- packages/react/figma/badge.figma.ts | 4 +- packages/react/figma/button.figma.ts | 2 +- packages/react/figma/search.figma.ts | 2 +- packages/react/figma/separator.figma.ts | 4 +- packages/react/figma/toolbar.figma.ts | 2 +- 69 files changed, 221 insertions(+), 188 deletions(-) diff --git a/.agents/skills/add-new-component/SKILL.md b/.agents/skills/add-new-component/SKILL.md index 49dd093e0..0239c4ca4 100644 --- a/.agents/skills/add-new-component/SKILL.md +++ b/.agents/skills/add-new-component/SKILL.md @@ -472,7 +472,7 @@ export const playground = { type: 'playground', controls: { variant: { type: 'select', options: ['solid', 'outline'], defaultValue: 'solid' }, - size: { type: 'select', options: ['small', 'normal'], defaultValue: 'normal' }, + size: { type: 'select', options: ['small', 'medium'], defaultValue: 'medium' }, disabled: { type: 'checkbox', defaultValue: false }, children: { type: 'text', initialValue: 'Click me' } }, diff --git a/apps/www/src/components/dataview-demo.tsx b/apps/www/src/components/dataview-demo.tsx index 473258d9b..db67a1c7b 100644 --- a/apps/www/src/components/dataview-demo.tsx +++ b/apps/www/src/components/dataview-demo.tsx @@ -896,16 +896,16 @@ function TaskCard({ {task.title} - + {task.status} - + {task.team} - + {task.priority} diff --git a/apps/www/src/components/docs/footer.tsx b/apps/www/src/components/docs/footer.tsx index ff3689d83..da95451a2 100644 --- a/apps/www/src/components/docs/footer.tsx +++ b/apps/www/src/components/docs/footer.tsx @@ -16,7 +16,7 @@ export default function DocsFooter({ url }: DocsFooterProps) { - + ` }; export const disabledDemo = { diff --git a/apps/www/src/content/docs/components/button/index.mdx b/apps/www/src/content/docs/components/button/index.mdx index 9728d7560..f783c7523 100644 --- a/apps/www/src/content/docs/components/button/index.mdx +++ b/apps/www/src/content/docs/components/button/index.mdx @@ -45,7 +45,7 @@ Color carries meaning, not decoration. `danger` for destructive actions, `succes ### Size -Two sizes. `normal` is the default and fits most layouts. Use `small` inside toolbars, table rows, and other dense surfaces. +Two sizes. `medium` is the default and fits most layouts. Use `small` inside toolbars, table rows, and other dense surfaces. diff --git a/apps/www/src/content/docs/components/button/props.ts b/apps/www/src/content/docs/components/button/props.ts index f08e8cdf1..8f8d0cfee 100644 --- a/apps/www/src/content/docs/components/button/props.ts +++ b/apps/www/src/content/docs/components/button/props.ts @@ -15,9 +15,9 @@ export type ButtonProps = { /** * Size of the button - * @defaultValue "normal" + * @defaultValue "medium" */ - size?: 'small' | 'normal'; + size?: 'small' | 'medium'; /** * Whether the button is disabled diff --git a/apps/www/src/content/docs/components/checkbox/demo.ts b/apps/www/src/content/docs/components/checkbox/demo.ts index 6d51fb0e1..95eff9215 100644 --- a/apps/www/src/content/docs/components/checkbox/demo.ts +++ b/apps/www/src/content/docs/components/checkbox/demo.ts @@ -29,8 +29,8 @@ export const playground = { }, size: { type: 'select', - options: ['large', 'small'], - defaultValue: 'large' + options: ['medium', 'small'], + defaultValue: 'medium' } }, getCode @@ -62,8 +62,8 @@ export const sizeExamples = { type: 'code', tabs: [ { - name: 'Large (default)', - code: `` + name: 'Medium (default)', + code: `` }, { name: 'Small', diff --git a/apps/www/src/content/docs/components/checkbox/index.mdx b/apps/www/src/content/docs/components/checkbox/index.mdx index b59ebc89d..cfa52c0ed 100644 --- a/apps/www/src/content/docs/components/checkbox/index.mdx +++ b/apps/www/src/content/docs/components/checkbox/index.mdx @@ -36,7 +36,7 @@ A checkbox on its own, then in a group, where a parent can both reflect and driv ### Size variants -Two sizes. `large` is the default; `small` fits table rows and dense lists. +Two sizes. `medium` is the default; `small` fits table rows and dense lists. diff --git a/apps/www/src/content/docs/components/checkbox/props.ts b/apps/www/src/content/docs/components/checkbox/props.ts index 1d40d3887..7c226b34b 100644 --- a/apps/www/src/content/docs/components/checkbox/props.ts +++ b/apps/www/src/content/docs/components/checkbox/props.ts @@ -51,9 +51,9 @@ export interface CheckboxProps { /** * The size of the checkbox. - * @defaultValue 'large' + * @defaultValue 'medium' */ - size?: 'small' | 'large'; + size?: 'small' | 'medium'; /** * Custom render function for the indicator. Receives `(props, state)` where state includes `checked` and `indeterminate`. diff --git a/apps/www/src/content/docs/components/combobox/demo.ts b/apps/www/src/content/docs/components/combobox/demo.ts index 71fb48d4b..ca53e99aa 100644 --- a/apps/www/src/content/docs/components/combobox/demo.ts +++ b/apps/www/src/content/docs/components/combobox/demo.ts @@ -24,8 +24,8 @@ export const playground = { label: { type: 'text', initialValue: 'Fruits' }, size: { type: 'select', - options: ['small', 'large'], - defaultValue: 'large' + options: ['small', 'medium'], + defaultValue: 'medium' }, multiple: { type: 'checkbox', diff --git a/apps/www/src/content/docs/components/combobox/props.ts b/apps/www/src/content/docs/components/combobox/props.ts index 6908fd723..ac4effc40 100644 --- a/apps/www/src/content/docs/components/combobox/props.ts +++ b/apps/www/src/content/docs/components/combobox/props.ts @@ -65,9 +65,9 @@ export interface ComboboxRootProps { export interface ComboboxInputProps { /** * Size variant of the input field. - * @default "large" + * @default "medium" */ - size?: 'small' | 'large'; + size?: 'small' | 'medium'; /** Whether the input is disabled. */ disabled?: boolean; diff --git a/apps/www/src/content/docs/components/command/props.ts b/apps/www/src/content/docs/components/command/props.ts index d98976187..a7fa440ad 100644 --- a/apps/www/src/content/docs/components/command/props.ts +++ b/apps/www/src/content/docs/components/command/props.ts @@ -69,9 +69,9 @@ export interface CommandInputProps { /** * Size variant of the input field. - * @defaultValue "large" + * @defaultValue "medium" */ - size?: 'small' | 'large'; + size?: 'small' | 'medium'; /** Additional CSS class names. */ className?: string; diff --git a/apps/www/src/content/docs/components/floating-actions/props.ts b/apps/www/src/content/docs/components/floating-actions/props.ts index 630583412..b7dcf8ca1 100644 --- a/apps/www/src/content/docs/components/floating-actions/props.ts +++ b/apps/www/src/content/docs/components/floating-actions/props.ts @@ -42,10 +42,10 @@ export interface FloatingActionsSeparatorProps { color?: 'primary' | 'secondary' | 'tertiary'; /** - * Size variant inherited from the underlying `Separator`. + * Variant inherited from the underlying `Separator`. * @defaultValue "full" */ - size?: 'small' | 'half' | 'full'; + variant?: 'full' | 'middle'; /** Additional CSS class names. */ className?: string; diff --git a/apps/www/src/content/docs/components/input/demo.ts b/apps/www/src/content/docs/components/input/demo.ts index 5becc9c14..6a0235c30 100644 --- a/apps/www/src/content/docs/components/input/demo.ts +++ b/apps/www/src/content/docs/components/input/demo.ts @@ -17,8 +17,8 @@ export const playground = { suffix: { type: 'text', initialValue: '' }, size: { type: 'select', - options: ['small', 'large'], - initialValue: 'large' + options: ['small', 'medium'], + defaultValue: 'medium' } }, getCode diff --git a/apps/www/src/content/docs/components/input/index.mdx b/apps/www/src/content/docs/components/input/index.mdx index 2b971dae4..6a0d7412e 100644 --- a/apps/www/src/content/docs/components/input/index.mdx +++ b/apps/www/src/content/docs/components/input/index.mdx @@ -52,7 +52,7 @@ A single-line text input. `placeholder` hints at the expected value; it is not a ### Size -Input comes in two sizes: small (24px) and large (32px). +Input comes in two sizes: `small` (24px) and `medium` (32px). diff --git a/apps/www/src/content/docs/components/input/props.ts b/apps/www/src/content/docs/components/input/props.ts index cd5a5dba4..fb193a46c 100644 --- a/apps/www/src/content/docs/components/input/props.ts +++ b/apps/www/src/content/docs/components/input/props.ts @@ -1,9 +1,9 @@ export interface InputProps { /** * Size variant of the input. - * @defaultValue "large" + * @defaultValue "medium" */ - size?: 'small' | 'large'; + size?: 'small' | 'medium'; /** Whether the input is disabled. When true, chips are also disabled and their dismiss buttons are hidden. */ disabled?: boolean; diff --git a/apps/www/src/content/docs/components/radio/demo.ts b/apps/www/src/content/docs/components/radio/demo.ts index 0a13d3276..221e1d8d6 100644 --- a/apps/www/src/content/docs/components/radio/demo.ts +++ b/apps/www/src/content/docs/components/radio/demo.ts @@ -31,8 +31,8 @@ export const playground = { }, size: { type: 'select', - options: ['large', 'small'], - defaultValue: 'large' + options: ['medium', 'small'], + defaultValue: 'medium' }, disabled: { type: 'checkbox', @@ -72,16 +72,16 @@ export const sizeDemo = { type: 'code', tabs: [ { - name: 'Large (default)', + name: 'Medium (default)', code: ` - + - + - + ` }, @@ -108,8 +108,8 @@ export const sizeDemo = { - - + + ` } diff --git a/apps/www/src/content/docs/components/radio/index.mdx b/apps/www/src/content/docs/components/radio/index.mdx index e4c733d4d..9b0bbe1bb 100644 --- a/apps/www/src/content/docs/components/radio/index.mdx +++ b/apps/www/src/content/docs/components/radio/index.mdx @@ -29,7 +29,7 @@ Radios always live in a group. The group owns the value; the radios are the opti ### Size -Two sizes. `large` is the default; `small` fits dense lists. Set `size` on `Radio.Root` and every item follows. +Two sizes. `medium` is the default; `small` fits dense lists. Set `size` on `Radio.Group` and every item follows. diff --git a/apps/www/src/content/docs/components/radio/props.ts b/apps/www/src/content/docs/components/radio/props.ts index 46ef4fbc3..41ac60933 100644 --- a/apps/www/src/content/docs/components/radio/props.ts +++ b/apps/www/src/content/docs/components/radio/props.ts @@ -19,9 +19,9 @@ export interface RadioGroupProps { /** * The default size applied to all radio items in the group. Can be overridden per item. - * @default "large" + * @default "medium" */ - size?: 'large' | 'small'; + size?: 'medium' | 'small'; /** The name of the radio group when submitted as a form field. */ name?: string; @@ -49,9 +49,9 @@ export interface RadioProps { /** * The size of the radio button. Overrides the `size` set on `Radio.Group`. - * If neither is set, defaults to `"large"` via the group. + * If neither is set, defaults to `"medium"` via the group. */ - size?: 'large' | 'small'; + size?: 'medium' | 'small'; /** The unique identifier for the radio item. */ id?: string; diff --git a/apps/www/src/content/docs/components/search/demo.ts b/apps/www/src/content/docs/components/search/demo.ts index b986557a6..fd1874841 100644 --- a/apps/www/src/content/docs/components/search/demo.ts +++ b/apps/www/src/content/docs/components/search/demo.ts @@ -12,8 +12,8 @@ export const playground = { controls: { size: { type: 'select', - options: ['small', 'large'], - defaultValue: 'large' + options: ['small', 'medium'], + defaultValue: 'medium' }, placeholder: { type: 'text', initialValue: 'Search...' }, disabled: { type: 'checkbox', defaultValue: false }, @@ -26,7 +26,7 @@ export const sizeDemo = { type: 'code', code: ` - + ` }; diff --git a/apps/www/src/content/docs/components/search/index.mdx b/apps/www/src/content/docs/components/search/index.mdx index febe8ef1e..890d7e7aa 100644 --- a/apps/www/src/content/docs/components/search/index.mdx +++ b/apps/www/src/content/docs/components/search/index.mdx @@ -24,7 +24,7 @@ A text input with the search icon already in place. Set its size, whether it can ### Size -Two sizes. `large` is the default; `small` fits a toolbar or a table header. +Two sizes. `medium` is the default; `small` fits a toolbar or a table header. diff --git a/apps/www/src/content/docs/components/search/props.ts b/apps/www/src/content/docs/components/search/props.ts index 91fff7996..b98946f63 100644 --- a/apps/www/src/content/docs/components/search/props.ts +++ b/apps/www/src/content/docs/components/search/props.ts @@ -1,9 +1,9 @@ export interface SearchProps { /** * Size variant of the search input. - * @default large + * @default medium */ - size?: 'small' | 'large'; + size?: 'small' | 'medium'; /** Placeholder text for the input. */ placeholder?: string; diff --git a/apps/www/src/content/docs/components/separator/demo.ts b/apps/www/src/content/docs/components/separator/demo.ts index b946ba95a..664859ad2 100644 --- a/apps/www/src/content/docs/components/separator/demo.ts +++ b/apps/www/src/content/docs/components/separator/demo.ts @@ -10,9 +10,9 @@ export const getCode = (props: ComponentPropsType) => { export const playground = { type: 'playground', controls: { - size: { + variant: { type: 'select', - options: ['small', 'half', 'full'], + options: ['full', 'middle'], defaultValue: 'full' }, color: { @@ -28,13 +28,12 @@ export const playground = { }, getCode }; -export const sizeDemo = { +export const variantDemo = { type: 'code', code: ` - - - + + ` }; @@ -50,8 +49,13 @@ export const colorDemo = { export const orientationDemo = { type: 'code', code: ` - - - + + Above + + + Left + + Right + ` }; diff --git a/apps/www/src/content/docs/components/separator/index.mdx b/apps/www/src/content/docs/components/separator/index.mdx index 2c9dc002c..152a984cd 100644 --- a/apps/www/src/content/docs/components/separator/index.mdx +++ b/apps/www/src/content/docs/components/separator/index.mdx @@ -4,7 +4,7 @@ description: A visual divider that separates content with support for vertical a source: packages/react/components/separator --- -import { playground, sizeDemo, colorDemo, orientationDemo } from "./demo.ts"; +import { playground, variantDemo, colorDemo, orientationDemo } from "./demo.ts"; @@ -20,7 +20,7 @@ import { Separator } from '@raystack/apsara' ## Usage -Which way the line runs, how thick it is, and what color it takes. +Which way the line runs, where its ends sit, and what color it takes. ### Orientation @@ -28,11 +28,11 @@ Which way the line runs, how thick it is, and what color it takes. -### Size +### Variant -`size` sets how far the rule runs across its container: `small` a short accent, `half` halfway, `full` (the default) edge to edge. +`full` (the default) runs the rule edge to edge. `middle` insets both ends from the container edges. - + ### Color diff --git a/apps/www/src/content/docs/components/separator/props.ts b/apps/www/src/content/docs/components/separator/props.ts index 9377a8577..f61e8c724 100644 --- a/apps/www/src/content/docs/components/separator/props.ts +++ b/apps/www/src/content/docs/components/separator/props.ts @@ -1,8 +1,8 @@ export interface SeparatorProps { - /** Defines the length of the separator. + /** Runs the line edge to edge (`full`) or insets both ends (`middle`). * @default "full" */ - size?: 'small' | 'half' | 'full'; + variant?: 'full' | 'middle'; /** Sets the color of the separator. * @default "primary" diff --git a/apps/www/src/content/docs/components/switch/demo.ts b/apps/www/src/content/docs/components/switch/demo.ts index 23db5deaa..d3f7d0947 100644 --- a/apps/www/src/content/docs/components/switch/demo.ts +++ b/apps/www/src/content/docs/components/switch/demo.ts @@ -20,8 +20,8 @@ export const playground = { }, size: { type: 'select', - options: ['large', 'small'], - defaultValue: 'large' + options: ['medium', 'small'], + defaultValue: 'medium' } }, getCode @@ -43,8 +43,8 @@ export const sizeDemo = { type: 'code', code: ` - - + + ` diff --git a/apps/www/src/content/docs/components/switch/index.mdx b/apps/www/src/content/docs/components/switch/index.mdx index f367276f1..ee9eaccbb 100644 --- a/apps/www/src/content/docs/components/switch/index.mdx +++ b/apps/www/src/content/docs/components/switch/index.mdx @@ -24,7 +24,7 @@ A switch is on or off. Set its size and starting position, or own the value your ### Size -Two sizes. `large` is the default; use `small` inside table rows, toolbars, and settings lists where the control sits beside dense text. +Two sizes. `medium` is the default; use `small` inside table rows, toolbars, and settings lists where the control sits beside dense text. diff --git a/apps/www/src/content/docs/components/switch/props.ts b/apps/www/src/content/docs/components/switch/props.ts index baa6000c5..7e8a36ebb 100644 --- a/apps/www/src/content/docs/components/switch/props.ts +++ b/apps/www/src/content/docs/components/switch/props.ts @@ -16,9 +16,9 @@ export interface SwitchProps { /** * The size of the switch. - * @default "large" + * @default "medium" */ - size?: 'large' | 'small'; + size?: 'medium' | 'small'; /** A unique identifier for the switch. */ id?: string; diff --git a/apps/www/src/content/docs/components/textarea/demo.ts b/apps/www/src/content/docs/components/textarea/demo.ts index c0db36fab..3997f28b1 100644 --- a/apps/www/src/content/docs/components/textarea/demo.ts +++ b/apps/www/src/content/docs/components/textarea/demo.ts @@ -16,8 +16,8 @@ export const playground = { }, size: { type: 'select', - options: ['large', 'small'], - defaultValue: 'large' + options: ['medium', 'small'], + defaultValue: 'medium' }, variant: { type: 'select', @@ -87,7 +87,7 @@ export const onValueChangeDemo = { export const sizeDemo = { type: 'code', code: ` -