@vokality/design-system 0.0.0-stage → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -0
- package/README.md +134 -2
- package/dist/charts/chart.d.ts +52 -0
- package/dist/charts/chart.js +108 -0
- package/dist/components/Accordion/Accordion.d.ts +15 -0
- package/dist/components/Accordion/Accordion.js +16 -0
- package/dist/components/Alert/Alert.d.ts +14 -0
- package/dist/components/Alert/Alert.js +12 -0
- package/dist/components/AppShell/AppShell.d.ts +21 -0
- package/dist/components/AppShell/AppShell.js +48 -0
- package/dist/components/Avatar/Avatar.d.ts +11 -0
- package/dist/components/Avatar/Avatar.js +19 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +11 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +13 -0
- package/dist/components/Badge/Badge.d.ts +9 -0
- package/dist/components/Badge/Badge.js +6 -0
- package/dist/components/BarChart/BarChart.d.ts +7 -0
- package/dist/components/BarChart/BarChart.js +45 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +11 -0
- package/dist/components/Button/Button.d.ts +17 -0
- package/dist/components/Button/Button.js +23 -0
- package/dist/components/Calendar/Calendar.d.ts +21 -0
- package/dist/components/Calendar/Calendar.js +144 -0
- package/dist/components/Card/Card.d.ts +16 -0
- package/dist/components/Card/Card.js +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.js +24 -0
- package/dist/components/Code/Code.d.ts +7 -0
- package/dist/components/Code/Code.js +6 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +10 -0
- package/dist/components/CodeBlock/CodeBlock.js +43 -0
- package/dist/components/Combobox/Combobox.d.ts +23 -0
- package/dist/components/Combobox/Combobox.js +188 -0
- package/dist/components/Combobox/ListPanel.d.ts +16 -0
- package/dist/components/Combobox/ListPanel.js +75 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +23 -0
- package/dist/components/CommandPalette/CommandPalette.js +86 -0
- package/dist/components/Container/Container.d.ts +10 -0
- package/dist/components/Container/Container.js +7 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenu.js +56 -0
- package/dist/components/DatePicker/DatePicker.d.ts +25 -0
- package/dist/components/DatePicker/DatePicker.js +198 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +12 -0
- package/dist/components/DescriptionList/DescriptionList.js +6 -0
- package/dist/components/Dialog/Dialog.d.ts +23 -0
- package/dist/components/Dialog/Dialog.js +53 -0
- package/dist/components/Divider/Divider.d.ts +6 -0
- package/dist/components/Divider/Divider.js +10 -0
- package/dist/components/Drawer/Drawer.d.ts +6 -0
- package/dist/components/Drawer/Drawer.js +6 -0
- package/dist/components/EmptyState/EmptyState.d.ts +11 -0
- package/dist/components/EmptyState/EmptyState.js +10 -0
- package/dist/components/ErrorSummary/ErrorSummary.d.ts +10 -0
- package/dist/components/ErrorSummary/ErrorSummary.js +28 -0
- package/dist/components/FaqList/FaqList.d.ts +10 -0
- package/dist/components/FaqList/FaqList.js +6 -0
- package/dist/components/Field/Field.d.ts +12 -0
- package/dist/components/Field/Field.js +25 -0
- package/dist/components/Figure/Figure.d.ts +11 -0
- package/dist/components/Figure/Figure.js +6 -0
- package/dist/components/FileUpload/FileUpload.d.ts +25 -0
- package/dist/components/FileUpload/FileUpload.js +47 -0
- package/dist/components/Grid/Grid.d.ts +12 -0
- package/dist/components/Grid/Grid.js +10 -0
- package/dist/components/HatchDivider/HatchDivider.d.ts +2 -0
- package/dist/components/HatchDivider/HatchDivider.js +5 -0
- package/dist/components/Heading/Heading.d.ts +12 -0
- package/dist/components/Heading/Heading.js +11 -0
- package/dist/components/Icon/Icon.d.ts +8 -0
- package/dist/components/Icon/Icon.js +17 -0
- package/dist/components/IconButton/IconButton.d.ts +11 -0
- package/dist/components/IconButton/IconButton.js +16 -0
- package/dist/components/Inline/Inline.d.ts +13 -0
- package/dist/components/Inline/Inline.js +8 -0
- package/dist/components/Input/Input.d.ts +10 -0
- package/dist/components/Input/Input.js +25 -0
- package/dist/components/Kbd/Kbd.d.ts +7 -0
- package/dist/components/Kbd/Kbd.js +6 -0
- package/dist/components/LineChart/LineChart.d.ts +7 -0
- package/dist/components/LineChart/LineChart.js +53 -0
- package/dist/components/Link/Link.d.ts +7 -0
- package/dist/components/Link/Link.js +12 -0
- package/dist/components/LinkProvider/LinkProvider.d.ts +22 -0
- package/dist/components/LinkProvider/LinkProvider.js +21 -0
- package/dist/components/List/List.d.ts +24 -0
- package/dist/components/List/List.js +24 -0
- package/dist/components/MediaCard/MediaCard.d.ts +19 -0
- package/dist/components/MediaCard/MediaCard.js +25 -0
- package/dist/components/Menu/Menu.d.ts +14 -0
- package/dist/components/Menu/Menu.js +53 -0
- package/dist/components/Menu/entries.d.ts +40 -0
- package/dist/components/Menu/entries.js +146 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +24 -0
- package/dist/components/MultiSelect/MultiSelect.js +166 -0
- package/dist/components/NavList/NavList.d.ts +19 -0
- package/dist/components/NavList/NavList.js +10 -0
- package/dist/components/NumberInput/NumberInput.d.ts +13 -0
- package/dist/components/NumberInput/NumberInput.js +90 -0
- package/dist/components/OtpInput/OtpInput.d.ts +19 -0
- package/dist/components/OtpInput/OtpInput.js +75 -0
- package/dist/components/PageHeader/PageHeader.d.ts +18 -0
- package/dist/components/PageHeader/PageHeader.js +11 -0
- package/dist/components/Pagination/Pagination.d.ts +15 -0
- package/dist/components/Pagination/Pagination.js +22 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +7 -0
- package/dist/components/PasswordInput/PasswordInput.js +11 -0
- package/dist/components/Popover/Popover.d.ts +18 -0
- package/dist/components/Popover/Popover.js +26 -0
- package/dist/components/Progress/Progress.d.ts +13 -0
- package/dist/components/Progress/Progress.js +24 -0
- package/dist/components/Prose/Prose.d.ts +8 -0
- package/dist/components/Prose/Prose.js +7 -0
- package/dist/components/Quote/Quote.d.ts +10 -0
- package/dist/components/Quote/Quote.js +7 -0
- package/dist/components/Radio/Radio.d.ts +7 -0
- package/dist/components/Radio/Radio.js +9 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +21 -0
- package/dist/components/RadioGroup/RadioGroup.js +41 -0
- package/dist/components/SearchInput/SearchInput.d.ts +10 -0
- package/dist/components/SearchInput/SearchInput.js +39 -0
- package/dist/components/SectionHeader/SectionHeader.d.ts +10 -0
- package/dist/components/SectionHeader/SectionHeader.js +9 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +19 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +21 -0
- package/dist/components/Select/Select.d.ts +26 -0
- package/dist/components/Select/Select.js +262 -0
- package/dist/components/Skeleton/Skeleton.d.ts +8 -0
- package/dist/components/Skeleton/Skeleton.js +13 -0
- package/dist/components/Slider/Slider.d.ts +21 -0
- package/dist/components/Slider/Slider.js +43 -0
- package/dist/components/Sparkline/Sparkline.d.ts +11 -0
- package/dist/components/Sparkline/Sparkline.js +15 -0
- package/dist/components/Spinner/Spinner.d.ts +8 -0
- package/dist/components/Spinner/Spinner.js +8 -0
- package/dist/components/SquareGlyph/SquareGlyph.d.ts +7 -0
- package/dist/components/SquareGlyph/SquareGlyph.js +6 -0
- package/dist/components/Stack/Stack.d.ts +11 -0
- package/dist/components/Stack/Stack.js +8 -0
- package/dist/components/Stat/Stat.d.ts +13 -0
- package/dist/components/Stat/Stat.js +22 -0
- package/dist/components/Steps/Steps.d.ts +13 -0
- package/dist/components/Steps/Steps.js +13 -0
- package/dist/components/Switch/Switch.d.ts +7 -0
- package/dist/components/Switch/Switch.js +16 -0
- package/dist/components/Table/Table.d.ts +48 -0
- package/dist/components/Table/Table.js +144 -0
- package/dist/components/Tabs/Tabs.d.ts +19 -0
- package/dist/components/Tabs/Tabs.js +29 -0
- package/dist/components/Tag/Tag.d.ts +12 -0
- package/dist/components/Tag/Tag.js +8 -0
- package/dist/components/Text/Text.d.ts +10 -0
- package/dist/components/Text/Text.js +7 -0
- package/dist/components/Textarea/Textarea.d.ts +6 -0
- package/dist/components/Textarea/Textarea.js +17 -0
- package/dist/components/ThemeScript/ThemeScript.d.ts +7 -0
- package/dist/components/ThemeScript/ThemeScript.js +9 -0
- package/dist/components/TileGrid/TileGrid.d.ts +13 -0
- package/dist/components/TileGrid/TileGrid.js +8 -0
- package/dist/components/TimePicker/TimePicker.d.ts +28 -0
- package/dist/components/TimePicker/TimePicker.js +192 -0
- package/dist/components/Timeline/Timeline.d.ts +16 -0
- package/dist/components/Timeline/Timeline.js +10 -0
- package/dist/components/Toaster/Toaster.d.ts +50 -0
- package/dist/components/Toaster/Toaster.js +63 -0
- package/dist/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/Tooltip/Tooltip.js +21 -0
- package/dist/components/TreeView/TreeView.d.ts +30 -0
- package/dist/components/TreeView/TreeView.js +127 -0
- package/dist/components.css +1798 -0
- package/dist/fonts/FONT-NOTICES.txt +20 -0
- package/dist/fonts/IBMPlexSans-Latin.woff2 +0 -0
- package/dist/fonts/IBMPlexSans-OFL.txt +93 -0
- package/dist/fonts/Manrope-Latin.woff2 +0 -0
- package/dist/fonts/Manrope-OFL.txt +93 -0
- package/dist/fonts/SpaceGrotesk-Latin.woff2 +0 -0
- package/dist/fonts/SpaceGrotesk-OFL.txt +93 -0
- package/dist/fonts.css +23 -0
- package/dist/hooks/useTheme.d.ts +16 -0
- package/dist/hooks/useTheme.js +82 -0
- package/dist/icons/arrow-down.svg +1 -0
- package/dist/icons/arrow-up-right.svg +1 -0
- package/dist/icons/arrow-up.svg +1 -0
- package/dist/icons/calendar.svg +1 -0
- package/dist/icons/chart.svg +1 -0
- package/dist/icons/check.svg +1 -0
- package/dist/icons/chevron-down.svg +1 -0
- package/dist/icons/chevron-left.svg +1 -0
- package/dist/icons/chevron-right.svg +1 -0
- package/dist/icons/chevrons-up-down.svg +1 -0
- package/dist/icons/circle-alert.svg +1 -0
- package/dist/icons/circle-check.svg +1 -0
- package/dist/icons/clock.svg +1 -0
- package/dist/icons/copy.svg +1 -0
- package/dist/icons/ellipsis.svg +1 -0
- package/dist/icons/file.svg +1 -0
- package/dist/icons/folder.svg +1 -0
- package/dist/icons/home.svg +1 -0
- package/dist/icons/info.svg +1 -0
- package/dist/icons/map-pin.svg +1 -0
- package/dist/icons/menu.svg +1 -0
- package/dist/icons/minus.svg +1 -0
- package/dist/icons/pencil.svg +1 -0
- package/dist/icons/phone.svg +1 -0
- package/dist/icons/plus.svg +1 -0
- package/dist/icons/quote.svg +1 -0
- package/dist/icons/search.svg +1 -0
- package/dist/icons/sidebar.svg +1 -0
- package/dist/icons/trash.svg +1 -0
- package/dist/icons/triangle-alert.svg +1 -0
- package/dist/icons/upload.svg +1 -0
- package/dist/icons/users.svg +1 -0
- package/dist/icons/x.svg +1 -0
- package/dist/index.d.ts +178 -0
- package/dist/index.js +93 -0
- package/dist/internal/CharCount.d.ts +17 -0
- package/dist/internal/CharCount.js +23 -0
- package/dist/internal/choice.d.ts +65 -0
- package/dist/internal/choice.js +111 -0
- package/dist/internal/focusables.d.ts +3 -0
- package/dist/internal/focusables.js +8 -0
- package/dist/internal/options.d.ts +15 -0
- package/dist/internal/options.js +30 -0
- package/dist/internal/status.d.ts +6 -0
- package/dist/internal/status.js +5 -0
- package/dist/internal/useIsoLayoutEffect.d.ts +3 -0
- package/dist/internal/useIsoLayoutEffect.js +4 -0
- package/dist/internal/useScrollActive.d.ts +3 -0
- package/dist/internal/useScrollActive.js +12 -0
- package/dist/internal/useUid.d.ts +2 -0
- package/dist/internal/useUid.js +6 -0
- package/dist/lib/cx.d.ts +2 -0
- package/dist/lib/cx.js +4 -0
- package/dist/lib/dates.d.ts +10 -0
- package/dist/lib/dates.js +107 -0
- package/dist/lib/format.d.ts +15 -0
- package/dist/lib/format.js +50 -0
- package/dist/lib/icons.d.ts +220 -0
- package/dist/lib/icons.js +54 -0
- package/dist/lib/intl.d.ts +4 -0
- package/dist/lib/intl.js +19 -0
- package/dist/lib/math.d.ts +5 -0
- package/dist/lib/math.js +36 -0
- package/dist/lib/omit.d.ts +2 -0
- package/dist/lib/omit.js +10 -0
- package/dist/lib/space.d.ts +4 -0
- package/dist/lib/space.js +9 -0
- package/dist/lib/text.d.ts +8 -0
- package/dist/lib/text.js +12 -0
- package/dist/lib/theme.d.ts +16 -0
- package/dist/lib/theme.js +14 -0
- package/dist/lib/utils.d.ts +17 -0
- package/dist/lib/utils.js +5 -0
- package/dist/tailwind.css +110 -0
- package/dist/tokens.css +316 -0
- package/dist/tokens.dtcg.json +1606 -0
- package/dist/tokens.json +1217 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.js +1 -0
- package/dist/vokality.css +2139 -0
- package/dist/vokality.iife.js +19408 -0
- package/docs/brand.md +163 -0
- package/docs/components/Accordion/README.md +24 -0
- package/docs/components/Alert/README.md +31 -0
- package/docs/components/AppShell/README.md +20 -0
- package/docs/components/Avatar/README.md +17 -0
- package/docs/components/AvatarGroup/README.md +12 -0
- package/docs/components/Badge/README.md +24 -0
- package/docs/components/BarChart/README.md +30 -0
- package/docs/components/Breadcrumbs/README.md +16 -0
- package/docs/components/Button/README.md +43 -0
- package/docs/components/Calendar/README.md +43 -0
- package/docs/components/Card/README.md +16 -0
- package/docs/components/Checkbox/README.md +30 -0
- package/docs/components/Code/README.md +9 -0
- package/docs/components/CodeBlock/README.md +15 -0
- package/docs/components/Combobox/README.md +43 -0
- package/docs/components/CommandPalette/README.md +20 -0
- package/docs/components/Container/README.md +10 -0
- package/docs/components/ContextMenu/README.md +13 -0
- package/docs/components/Dashboard/README.md +12 -0
- package/docs/components/DatePicker/README.md +34 -0
- package/docs/components/DescriptionList/README.md +18 -0
- package/docs/components/Dialog/README.md +28 -0
- package/docs/components/Divider/README.md +15 -0
- package/docs/components/Drawer/README.md +16 -0
- package/docs/components/EmptyState/README.md +17 -0
- package/docs/components/ErrorPage/README.md +11 -0
- package/docs/components/ErrorSummary/README.md +16 -0
- package/docs/components/FaqList/README.md +11 -0
- package/docs/components/Field/README.md +27 -0
- package/docs/components/Figure/README.md +9 -0
- package/docs/components/FileUpload/README.md +20 -0
- package/docs/components/FormPage/README.md +11 -0
- package/docs/components/Grid/README.md +11 -0
- package/docs/components/HatchDivider/README.md +10 -0
- package/docs/components/Heading/README.md +10 -0
- package/docs/components/Icon/README.md +23 -0
- package/docs/components/IconButton/README.md +28 -0
- package/docs/components/Inline/README.md +9 -0
- package/docs/components/Input/README.md +31 -0
- package/docs/components/Kbd/README.md +13 -0
- package/docs/components/LineChart/README.md +27 -0
- package/docs/components/Link/README.md +31 -0
- package/docs/components/List/README.md +21 -0
- package/docs/components/ListDetail/README.md +11 -0
- package/docs/components/MediaCard/README.md +16 -0
- package/docs/components/Menu/README.md +45 -0
- package/docs/components/MultiSelect/README.md +41 -0
- package/docs/components/NavList/README.md +21 -0
- package/docs/components/NumberInput/README.md +19 -0
- package/docs/components/OtpInput/README.md +17 -0
- package/docs/components/PageHeader/README.md +17 -0
- package/docs/components/Pagination/README.md +22 -0
- package/docs/components/PasswordInput/README.md +13 -0
- package/docs/components/Popover/README.md +23 -0
- package/docs/components/Progress/README.md +19 -0
- package/docs/components/Prose/README.md +12 -0
- package/docs/components/Quote/README.md +13 -0
- package/docs/components/Radio/README.md +25 -0
- package/docs/components/RadioGroup/README.md +23 -0
- package/docs/components/SearchInput/README.md +23 -0
- package/docs/components/SectionHeader/README.md +14 -0
- package/docs/components/SegmentedControl/README.md +19 -0
- package/docs/components/Select/README.md +52 -0
- package/docs/components/SettingsPage/README.md +11 -0
- package/docs/components/SignIn/README.md +11 -0
- package/docs/components/Skeleton/README.md +16 -0
- package/docs/components/Slider/README.md +22 -0
- package/docs/components/Sparkline/README.md +13 -0
- package/docs/components/Spinner/README.md +16 -0
- package/docs/components/SquareGlyph/README.md +18 -0
- package/docs/components/Stack/README.md +11 -0
- package/docs/components/Stat/README.md +20 -0
- package/docs/components/Steps/README.md +22 -0
- package/docs/components/Switch/README.md +27 -0
- package/docs/components/Table/README.md +35 -0
- package/docs/components/Tabs/README.md +26 -0
- package/docs/components/Tag/README.md +21 -0
- package/docs/components/Text/README.md +11 -0
- package/docs/components/Textarea/README.md +20 -0
- package/docs/components/ThemeScript/README.md +47 -0
- package/docs/components/TileGrid/README.md +12 -0
- package/docs/components/TimePicker/README.md +19 -0
- package/docs/components/Timeline/README.md +12 -0
- package/docs/components/Toaster/README.md +34 -0
- package/docs/components/Tooltip/README.md +23 -0
- package/docs/components/TreeView/README.md +15 -0
- package/package.json +76 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# NumberInput
|
|
2
|
+
|
|
3
|
+
A field for whole or decimal numbers, with − and + buttons and arrow-key steps. It isn't a native number input, so it looks the same everywhere and never changes value on a scroll wheel.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
The `Input` box with the value in Space Grotesk (tabular), an optional unit, and two 36px step buttons on the right.
|
|
7
|
+
|
|
8
|
+
## Keyboard
|
|
9
|
+
↑ / ↓ step by `step`; PageUp / PageDown step by ten; Home / End jump to `min` / `max`. Typing is free; the value is clamped and rounded to the step when the field loses focus. A comma works as the decimal separator.
|
|
10
|
+
|
|
11
|
+
## Accessibility
|
|
12
|
+
`role="spinbutton"` with `aria-valuenow`, `aria-valuemin` and `aria-valuemax`. The step buttons are mouse and touch helpers (out of the tab order); the keyboard uses the arrow keys.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
- `value` + `onChange(number | null)`, or `defaultValue`. `min`, `max`, `step` (decimals follow the step: 0.5 → one decimal). `prefix` ("$"), `suffix` (a unit such as "hrs"). `decrementLabel`, `incrementLabel`.
|
|
16
|
+
- The ref is the `<input>`.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
- For amounts of money, put the currency in `prefix` and keep the field narrow. For values people don't count, such as phone numbers, use `Input`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# OtpInput
|
|
2
|
+
|
|
3
|
+
Boxes for a one-time code from an authenticator app, a text message or an email.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
`length` (6) square boxes, 44px wide, centered digits in Space Grotesk at 20px, 0.5rem apart.
|
|
7
|
+
|
|
8
|
+
## Behaviour
|
|
9
|
+
- Typing a digit moves to the next box; Backspace in an empty box goes back and clears it; ← → move between boxes.
|
|
10
|
+
- Pasting a code fills every box. The first box has `autoComplete="one-time-code"`, so phones offer the code from a message.
|
|
11
|
+
- `onComplete(code)` fires once all boxes are filled; submit there or enable the button.
|
|
12
|
+
|
|
13
|
+
## Props
|
|
14
|
+
- `length`, `value` + `onChange`, or `defaultValue`, `onComplete`, `numeric` (default true), `name`, `disabled`, `label` (each box is announced "Digit 3 of 6").
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
- Say where the code was sent in the `Field` hint ("Sent to •••• 1803"), and offer a resend link below.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# PageHeader
|
|
2
|
+
|
|
3
|
+
The top of a page inside an app: breadcrumbs, the page title (the page's `h1`), an optional description and the page's main actions.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Breadcrumbs** (optional), above the title.
|
|
7
|
+
2. **Eyebrow** (optional): 12px uppercase `muted-foreground`.
|
|
8
|
+
3. **Title**: Manrope 700, 24–32px, with an optional `Badge`.
|
|
9
|
+
4. **Description**: `text-base`, `muted-foreground`, up to `prose-max`.
|
|
10
|
+
5. **Actions**: buttons aligned to the bottom right; they wrap under the title on narrow screens.
|
|
11
|
+
6. **Divider** (optional): a 1px `border-subtle` rule below.
|
|
12
|
+
|
|
13
|
+
## Props
|
|
14
|
+
- `title`, `description`, `eyebrow`, `breadcrumbs` (items as in `Breadcrumbs`), `actions`, `badge`, `badgeTone`, `divider`, `headingAs`, `children` (rendered below, e.g. `Tabs`).
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
- One page header per page, first in the main area. At most one primary button among its actions.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
Moves through a long list one page at a time, with an optional summary of what's shown.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Summary** (optional): "121–140 of 312" in Space Grotesk `muted-foreground`, on the left.
|
|
7
|
+
2. **Previous / Next**: uppercase 12px labels with chevrons; under 40rem only the chevrons show.
|
|
8
|
+
3. **Pages**: 36px square buttons in Space Grotesk, tabular. The first and last pages always show; `siblings` pages around the current one; `…` marks gaps.
|
|
9
|
+
4. **Current page**: `primary` border on a `primary-tint` fill, `foreground` text.
|
|
10
|
+
|
|
11
|
+
## States
|
|
12
|
+
Hover: `primary-tint` fill. Focus: the 2px `ring`. Previous on the first page and Next on the last are disabled (`muted-subtle`).
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
- `pageCount`, `page` + `onChange`, or `defaultPage`. `siblings` (1), `summary`, `previousLabel`, `nextLabel`, `label`.
|
|
16
|
+
|
|
17
|
+
## Accessibility
|
|
18
|
+
A `nav` named "Pagination"; the current page has `aria-current="page"`; every page button is named "Page N".
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
- Keep pagination below the list it controls, aligned with its edges.
|
|
22
|
+
- For feeds people browse rather than search, a "Load more" button is often better.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# PasswordInput
|
|
2
|
+
|
|
3
|
+
A password field with a Show/Hide button, so people can check what they typed.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
The `Input` box with a suffix button: 11px uppercase "Show" / "Hide" in `muted-foreground`, `primary-tint` on hover. The button sets `aria-pressed`.
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
- Any `Input` prop. `autoComplete` defaults to `current-password`; use `new-password` on sign-up and reset forms. `showLabel`, `hideLabel` for translations.
|
|
10
|
+
- The ref is the `<input>`.
|
|
11
|
+
|
|
12
|
+
## Rules
|
|
13
|
+
- Never block paste. State the rules in the `Field` hint before people type ("At least 12 characters"), not after.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
A small non-modal panel attached to a button, for interactive content that doesn't need a full dialog: filters, quick settings, a short form. Built on Radix Popover.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Trigger**: an outline `Button` with a chevron glyph cell (optional leading `icon`).
|
|
7
|
+
2. **Panel**: `surface-elevated`, 1px `border`, square, 0.75rem padding, at least 16rem wide (`width` to set it), with an optional title in Manrope 600. It sits 4px below the trigger, lined up with its start (or end, `align="end"`) edge, flips above when there is no room below and shrinks to the room it has; it rises 0.5rem as it fades in.
|
|
8
|
+
|
|
9
|
+
## Behaviour
|
|
10
|
+
- Opening moves focus to the first control inside (not when it starts open with `defaultOpen`).
|
|
11
|
+
- Esc closes and returns focus to the trigger. Clicking outside, or moving focus out of it, closes it.
|
|
12
|
+
- The page stays usable behind it; nothing else is blocked.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
- `label`, `title`, `icon`, `variant`, `size`, `align`, `width`, `defaultOpen`.
|
|
16
|
+
- `children`: content, or a function `({ close }) => content` so buttons inside can close it.
|
|
17
|
+
|
|
18
|
+
## Accessibility
|
|
19
|
+
The trigger has `aria-haspopup="dialog"`, `aria-expanded` and `aria-controls`; the panel is `role="dialog"`, labelled by its title (or the trigger's label), rendered in a portal on `document.body` with `data-state` and `data-side`.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
- Use a `Dialog` when the content needs full attention or a decision before continuing.
|
|
23
|
+
- Use a `Tooltip` for plain text with nothing to interact with.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
A bar showing how far a task has got, or that it is still running.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Label row** (optional): label in `foreground` on the left, value in Space Grotesk `muted-foreground` on the right.
|
|
7
|
+
2. **Track**: 6px tall, `card` fill, 1px `border-subtle`, square.
|
|
8
|
+
3. **Fill**: the tone color, width transitions over `--motion-normal`.
|
|
9
|
+
|
|
10
|
+
## Variants
|
|
11
|
+
- **Determinate** (`value` set): fill to `value / max`.
|
|
12
|
+
- **Indeterminate** (no `value`): moving diagonal hatch stripes in the tone color, the system's hatch motif. The stripes stop under reduced motion.
|
|
13
|
+
- **Tone**: `primary` (default), `success`, `warning`, `danger`, for example a quota bar that turns `warning` past 90%.
|
|
14
|
+
|
|
15
|
+
## Props
|
|
16
|
+
- `value`, `max` (100), `label`, `showValue`, `valueText` ("9.2 of 10 GB"), `tone`, `aria-label` when there's no visible label.
|
|
17
|
+
|
|
18
|
+
## Accessibility
|
|
19
|
+
Built on Radix Progress: `role="progressbar"` with `aria-valuenow/min/max` (left out when indeterminate; a value outside 0 to `max` is clamped) and the label wired with `aria-labelledby`. The track carries `data-state` (`loading`, `complete` or `indeterminate`).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Prose
|
|
2
|
+
|
|
3
|
+
Styles long-form HTML (help articles, release notes, rendered Markdown) without a class on every element.
|
|
4
|
+
|
|
5
|
+
## What it styles
|
|
6
|
+
Headings in Manrope 700, paragraphs in `muted-foreground` at 1.7 line height, `strong` and links in `foreground` (links underlined in `primary-line`), list markers in `primary`, blockquotes with a 2px `primary` rule, inline and block code in the mono face on `card`, tables in the `Table` style, rules in `border-subtle`. Width caps at `prose-max` (44rem).
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
- `children` (the HTML, or `dangerouslySetInnerHTML` on your own element inside), `as`, `className`.
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
- Sanitize any HTML you didn't write before rendering it.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Quote
|
|
2
|
+
|
|
3
|
+
A pull quote with a quote mark in the corner and an optional attribution line: avatar, name, divider, role.
|
|
4
|
+
|
|
5
|
+
## What you provide
|
|
6
|
+
- `text`: the quote. `emphasis` (optional): a closing clause, kept in the same weight.
|
|
7
|
+
- `name` and `role` (optional). Without `name` there is no attribution line.
|
|
8
|
+
- `avatar` (optional): a square photo; without it the person's initials sit in a disc.
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
- Text in `quote` style, `muted-foreground`; name in Manrope 600, `foreground`; role in Space Grotesk uppercase, `muted-subtle`.
|
|
12
|
+
- The avatar is the only round shape in the system (`radius-round`).
|
|
13
|
+
- Quote real people, with permission.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
A single option in a set where exactly one can be chosen. Use it through `RadioGroup` unless you need a custom layout.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Box**: 18×18px **square** (the system has no round controls), `card` fill, 1px `muted-subtle` border.
|
|
7
|
+
2. **Dot**: an 8×8px `primary` square, centered when selected. A checkbox shows a check and a radio shows a dot, so the two stay distinct.
|
|
8
|
+
3. **Label** and optional **description**: as for `Checkbox`.
|
|
9
|
+
|
|
10
|
+
## States
|
|
11
|
+
| State | Box | Dot |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Unselected | `card` fill, `muted-subtle` border | none |
|
|
14
|
+
| Hover | border `primary-hover` | |
|
|
15
|
+
| Selected | `primary` border, `card` fill | `primary` square |
|
|
16
|
+
| Focus | 2px `ring` outline, 2px offset | |
|
|
17
|
+
| Disabled | transparent, dashed; label `muted-subtle` | dot `muted-subtle` when selected |
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
- `label`, `description`, `name` (shared across the set), `value`, `checked` or `defaultChecked`, `onChange`, `disabled`.
|
|
21
|
+
- A standalone `Radio` is a native `<input type="radio">` under the drawn box; `RadioGroup` draws the same box on Radix RadioGroup.
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
- Always give a set a visible group label (`RadioGroup` adds the `legend`).
|
|
25
|
+
- Pre-select a sensible default when there is one.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# RadioGroup
|
|
2
|
+
|
|
3
|
+
A labelled set of radio options sharing one name, rendered as a `fieldset` with a `legend`. Built on Radix RadioGroup, with the same box as `Radio`.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Legend**: `card-eyebrow` style in `muted-foreground`, uppercase, 0.6rem above the options.
|
|
7
|
+
2. **Options**: `Radio`s stacked with a 0.6rem gap, or in a wrapping row (`inline`) with 1.5rem between them.
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
- `label` (the legend), `name`, `options` (strings or `{ value, label, description, disabled }`).
|
|
11
|
+
- Controlled with `value` and `onChange`, or uncontrolled with `defaultValue` (`onChange` is called in both cases).
|
|
12
|
+
- `onChange` receives a change event whose `target` reads `value`, `name` and `checked` as a native radio would.
|
|
13
|
+
- `inline` for two to four short options.
|
|
14
|
+
|
|
15
|
+
## Keyboard
|
|
16
|
+
One Tab stop, on the selected option. Arrow keys move to the next or previous enabled option, select it, and wrap.
|
|
17
|
+
|
|
18
|
+
## Accessibility
|
|
19
|
+
The `fieldset` has `role="radiogroup"`, named by the legend; each option is a `button` with `role="radio"` and `aria-checked`, labelled by its text. Inside a `form` a hidden radio per option carries `name`, so the group submits and resets like native radios.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
- Two to five options. More than that, use a `Select`.
|
|
23
|
+
- Order options logically (by size, by frequency), not alphabetically by default.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# SearchInput
|
|
2
|
+
|
|
3
|
+
A text field for searching or filtering a page, with a search icon and a clear button. It doesn't show suggestions; use `Combobox` for that.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Box**: the `Input` box, with 2.25rem left padding for the icon.
|
|
7
|
+
2. **Search icon**: `search`, 16px, `muted-foreground`, 0.75rem from the left.
|
|
8
|
+
3. **Clear button**: a 32px square `x` at the right, shown once there is text. The browser's own clear control is hidden.
|
|
9
|
+
|
|
10
|
+
## States
|
|
11
|
+
Same as `Input` (focus, disabled). The clear button gets a `primary-tint` hover and the `ring` on focus.
|
|
12
|
+
|
|
13
|
+
## Keyboard
|
|
14
|
+
- Esc clears the text.
|
|
15
|
+
- Enter submits when the input sits in a `<form role="search">`.
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
- `value` + `onChange(value, event)`, or `defaultValue`. `onClear`. `placeholder` naming what is searched ("Search projects"). `clearLabel`. Any input attribute.
|
|
19
|
+
- The ref is the `<input>`.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
- Give it an `aria-label` or a visible label that says what it searches.
|
|
23
|
+
- Filter as people type when results are local; on Enter when each search hits the server.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# SectionHeader
|
|
2
|
+
|
|
3
|
+
The header that opens a section: a square glyph, an uppercase Manrope label and an optional lead paragraph.
|
|
4
|
+
|
|
5
|
+
## What you provide
|
|
6
|
+
- `heading`: the section name in sentence case ("Recent activity", "Team").
|
|
7
|
+
- `id`: reuse it in the section's `aria-labelledby`.
|
|
8
|
+
- `lead` (optional): one sentence that frames the section, set in `lead` at up to 44rem.
|
|
9
|
+
- `glyph` (optional): the character in the square, `+` by default. Use a digit when sections are a real sequence.
|
|
10
|
+
- `as` (optional): heading level, `h2` by default.
|
|
11
|
+
|
|
12
|
+
## Rules
|
|
13
|
+
- Label `section-label` in `foreground`; glyph border `glyph-line`, glyph character `primary`.
|
|
14
|
+
- Leaves `clamp(1.5rem, 4vw, 2rem)` before the content that follows.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SegmentedControl
|
|
2
|
+
|
|
3
|
+
A compact set of two to five mutually exclusive options, for switching a view or a period: Week / Month / Quarter, Chart / Table.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
A 1px `border-subtle` outline holding buttons divided by 1px rules, 38px tall (30px at `sm`). Labels are `small` 500 in `muted-foreground`, with optional 16px icons. The selected segment gets `primary-tint`, `foreground` text and a 2px `primary` bar along its bottom edge.
|
|
7
|
+
|
|
8
|
+
## Keyboard
|
|
9
|
+
Arrow keys move the selection (wrapping); one Tab stop for the whole control.
|
|
10
|
+
|
|
11
|
+
## Accessibility
|
|
12
|
+
Built on Radix RadioGroup: `role="radiogroup"` (named by `label`) with `radio` buttons and `aria-checked`; the selected segment has `data-state="checked"`.
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
- `options`: strings or `{ value, label, icon, disabled }`. `value` + `onChange`, or `defaultValue`. `label`, `size`.
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
- The choice applies immediately. For a choice inside a form, use `RadioGroup`.
|
|
19
|
+
- Keep labels to one word where you can.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
A custom drop-down for picking one option from a known list. Trigger and option list are drawn entirely by the system, so it looks the same in every browser and OS. Built on Radix Select (popper position).
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Trigger**: the `Input` box (`card` fill, 1px `input-border`, square, 44px tall) showing the chosen label, or the placeholder in `muted-subtle`.
|
|
7
|
+
2. **Chevron**: `chevron-down` 0.75rem from the right in `muted-foreground`; it turns 180° while the list is open.
|
|
8
|
+
3. **List**: a panel 4px below the trigger (above it when there's no room below), starting at its left edge and at least its width (wider for long labels, up to the room in the window), `surface-elevated` fill, 1px `border`, square, at most 16rem tall (less if the window has less room) and scrolling beyond that with a thin scrollbar. It rises 0.5rem and fades in over `motion-normal` (not under reduced motion) and closes at once. The list is portalled to the end of `<body>` at `z-popover`, so it is never cut off inside a dialog, drawer or scrolling table.
|
|
9
|
+
4. **Option**: 0.6rem 0.75rem padding, `text-base` in `foreground`, an optional `description` line in `muted-foreground`. The chosen option is `primary-hover` with a `check` icon on the right (`primary` would drop to 3.97:1 on the active row).
|
|
10
|
+
|
|
11
|
+
## States
|
|
12
|
+
| Part | State | Treatment |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Trigger | Rest | `card` fill, `input-border` edge |
|
|
15
|
+
| Trigger | Focus | `primary` edge plus the 2px `ring` outline |
|
|
16
|
+
| Trigger | Open | `primary` edge, chevron flipped |
|
|
17
|
+
| Trigger | Invalid | `primary` edge (set by `Field` `error`) |
|
|
18
|
+
| Trigger | Disabled | transparent, dashed edge, `muted-subtle` text; can't be focused or opened |
|
|
19
|
+
| Option | Active (hover or arrow keys) | `primary-tint` fill |
|
|
20
|
+
| Option | Selected | `primary-hover` text and check (4.7:1 on the active row) |
|
|
21
|
+
| Option | Disabled | `muted-subtle` text; skipped by arrow keys and type-to-jump |
|
|
22
|
+
|
|
23
|
+
## Keyboard
|
|
24
|
+
| Key | Closed | Open |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| Enter, Space, ↓ | Opens on the selected option (the first enabled one if none) | Enter and Space choose the active option and close (Space typed within a second of a letter is part of the search) |
|
|
27
|
+
| ↑ | Opens on the selected option (the last one if none) | Moves up (Alt + ↑ chooses and closes) |
|
|
28
|
+
| ↓ | | Moves down |
|
|
29
|
+
| Home, End (PageUp, PageDown) | Opens at the first or last option | Jumps to the first or last option |
|
|
30
|
+
| Typing letters | Opens at the first match (without choosing it) | Jumps to the next match; letters typed within a second search together, a repeated letter cycles |
|
|
31
|
+
| Esc | | Closes without changing the value |
|
|
32
|
+
| Tab | Moves focus on | Chooses the active option, closes, moves focus on |
|
|
33
|
+
|
|
34
|
+
Mouse: press on the trigger to open, click an option to choose it, click outside (or on the trigger) to close. While the list is open the rest of the page doesn't take clicks or scroll, as with a native select.
|
|
35
|
+
|
|
36
|
+
## Accessibility
|
|
37
|
+
Implements the WAI-ARIA *select-only combobox* pattern with Radix Select: the trigger is a `<button>` with `role="combobox"`, `aria-expanded` and (while open) `aria-controls`, and the list has `role="listbox"` with `role="option"` items, each named by its label and described by its `description`. While the list is open, focus moves onto the active option (Radix's model, instead of `aria-activedescendant`) and the rest of the page is hidden from assistive technology; closing returns focus to the trigger at once. Inside a `Field`, the label names the control and clicking the label focuses it without opening it.
|
|
38
|
+
|
|
39
|
+
## Props
|
|
40
|
+
- `options`: strings or `{ value, label, description, disabled }`.
|
|
41
|
+
- `placeholder`: shown until something is chosen. Without it, the first option is chosen up front.
|
|
42
|
+
- `value` + `onChange(value, option)` to control it, or `defaultValue`. `value={null}` clears it to the placeholder. Any option value works, `""` included. `onChange` runs when the value changes (choosing the option that is already chosen doesn't call it); resetting the surrounding form puts an uncontrolled select back to its first value.
|
|
43
|
+
- `name`: adds a hidden input so the value posts with a regular form.
|
|
44
|
+
- `disabled`, `required` (sets `aria-required`; validate in your submit handler and show the message through `Field` `error`), `aria-label` when there is no `Field`.
|
|
45
|
+
- `defaultOpen`: starts open (for documentation and tests).
|
|
46
|
+
- The ref is the trigger `<button>`, so a `Select` can be a `Tooltip` trigger.
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
- Render inside a `Field`.
|
|
50
|
+
- With five or fewer options that people should compare, use a `RadioGroup`.
|
|
51
|
+
- For long lists that need search, use `Combobox`; to pick several, use `MultiSelect`.
|
|
52
|
+
- Never fall back to a native `<select>`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Settings template
|
|
2
|
+
|
|
3
|
+
A settings page inside the app: a page header, tabs for the areas, and sections that pair a title and explanation on the left with fields on the right.
|
|
4
|
+
|
|
5
|
+
## Built from
|
|
6
|
+
`AppShell`, `PageHeader`, `Tabs`, `Grid`, `Field`, `Input`, `Select`, `Switch`, `Divider`, `Button`, `toast()`.
|
|
7
|
+
|
|
8
|
+
## Rules
|
|
9
|
+
- One section per topic, separated by `Divider`. Each section has its own save button, or settings apply immediately with `Switch`es. Don't mix the two in one section.
|
|
10
|
+
- Confirm a save with a toast ("Workspace settings saved"). Show errors next to the field.
|
|
11
|
+
- Destructive settings (delete workspace) go last, in their own section, behind a confirmation `Dialog`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Sign-in template
|
|
2
|
+
|
|
3
|
+
A centered sign-in page: brand, heading, email and password, a primary action, and links for the alternatives.
|
|
4
|
+
|
|
5
|
+
## Built from
|
|
6
|
+
`Container`, `Stack`, `Field`, `Input`, `PasswordInput`, `Checkbox`, `Button`, `Link`, `Divider`, `Alert`.
|
|
7
|
+
|
|
8
|
+
## Rules
|
|
9
|
+
- One column, at most 24rem wide, centered on `background`. The page title is the `h1`.
|
|
10
|
+
- Show sign-in errors as an `Alert` above the form ("That email and password don't match. Try again or reset your password."), never which field was wrong.
|
|
11
|
+
- The primary button fills the column. Secondary routes (single sign-on, create account) sit below a divider.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
Placeholder blocks shown where content is loading, in its final shape, so the layout doesn't jump.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
`card` fill, square, with a faint `foreground` 5% shimmer moving left every 1.4s (still under reduced motion).
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
- `width`, `height` for a single block, or `lines` for a paragraph (the last line is shorter).
|
|
10
|
+
|
|
11
|
+
## Accessibility
|
|
12
|
+
Skeletons are `aria-hidden`. Set `aria-busy="true"` on the region that is loading, and remove it when content arrives.
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
- Match the real layout: avatar blocks where avatars go, a short line for a title.
|
|
16
|
+
- Show skeletons only after about 300ms, so fast loads don't flash.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
Picks a value from a continuous range by dragging or with the keyboard, for settings where the exact number matters less than the position: volume, a threshold, a budget range preview. Built on Radix Slider.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Track**: 4px, `card` with an `input-border` edge, inside a 28px hit area.
|
|
7
|
+
2. **Fill**: `primary` from the minimum to the value.
|
|
8
|
+
3. **Thumb**: an 18px `primary` square with a 2px `background` ring, kept inside the track at both ends.
|
|
9
|
+
4. **Value** (optional, `showValue`): the formatted value to the right, in Space Grotesk.
|
|
10
|
+
5. **Limits** (optional, `showLimits`): minimum and maximum below the track.
|
|
11
|
+
|
|
12
|
+
## Keyboard
|
|
13
|
+
← → (or ↓ ↑) step by `step`, ten steps with Shift; PageUp / PageDown move a tenth of the range; Home / End jump to the ends. Clicking the track jumps there; dragging follows the pointer.
|
|
14
|
+
|
|
15
|
+
## Accessibility
|
|
16
|
+
`role="slider"` with `aria-valuenow`, min and max, and `aria-valuetext` from `valueText` or `format` ("$1,200 per month").
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
- `value` + `onChange`, or `defaultValue`. `min` (0), `max` (100), `step` (1), `format(v)`, `valueText(v)`, `showValue`, `showLimits`, `name` (submitted through a hidden input inside a `form`), `disabled`, `aria-label` or the `Field` label.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
- If people need an exact number, add a `NumberInput` beside it or use one instead.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Sparkline
|
|
2
|
+
|
|
3
|
+
A word-sized trend line beside a number, in a table cell or a `Stat`.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
A 1.5px line scaled to its own minimum and maximum, with a 2.5px dot on the latest value. Default 96×28px, in `chart-1`, or a status tone.
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
- `values` (numbers, oldest first), `width`, `height`, `tone` (`success`, `danger` …), `label` (its accessible description; defaults to the values).
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
- Sparklines show shape, not amounts: always put the number beside them.
|
|
13
|
+
- No axes, no tooltip. When people need values, use `LineChart`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
A small loading indicator for waits under a few seconds: a square whose orange edge steps around its four sides.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
A 16px square (any `size`), 2px `border` edges, one edge in `primary` moving clockwise every 0.2s. Under reduced motion it holds still with the top edge orange.
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
- `size` (px), `label` (default "Loading"), `showLabel` to print the label beside it.
|
|
10
|
+
|
|
11
|
+
## Accessibility
|
|
12
|
+
`role="status"` with the label, visible or hidden, so screen readers hear "Loading".
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
- Inside a busy button, keep the button's width and change its label ("Saving…").
|
|
16
|
+
- For waits longer than a few seconds, or with known length, use `Progress`. For loading content, prefer `Skeleton`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# SquareGlyph
|
|
2
|
+
|
|
3
|
+
A 34px square outline holding one character in Space Grotesk: the Vokality signature mark.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Box**: 2.125rem square, 1px `border`.
|
|
7
|
+
2. **Character**: 17px Space Grotesk 500 (`glyph` style), tabular, `muted-subtle`.
|
|
8
|
+
|
|
9
|
+
## Variants
|
|
10
|
+
- Default: `border` box and `muted-subtle` character.
|
|
11
|
+
- In a section header: `glyph-line` box and `primary` character (use `SectionHeader`).
|
|
12
|
+
|
|
13
|
+
## Motion
|
|
14
|
+
Every 3.4s an orange highlight sweeps round the four sides and the character blinks. Both stop under `prefers-reduced-motion`.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
- One character: `+`, or a digit when the items form a real sequence.
|
|
18
|
+
- Decorative only (`aria-hidden`); never a button or checkbox.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Stack
|
|
2
|
+
|
|
3
|
+
Lays children out vertically with one gap from the spacing scale. Use it instead of margins between siblings.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
- `gap`: a spacing step (`none`, `xs`, `sm`, `md` default, `lg`, `xl`, `2xl`, `3xl`) or any CSS length.
|
|
7
|
+
- `align`: cross-axis alignment (`stretch` by default; `flex-start` to shrink children).
|
|
8
|
+
- `as`: the element (`div` default; `section`, `ul`, `form`).
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
- Gaps between related fields: `md`. Between groups of fields: `xl`. Between page sections: `2xl` or more.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Stat
|
|
2
|
+
|
|
3
|
+
One key number with its label and the change since the last period, for dashboards and summaries.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Label**: 12px uppercase, 0.12em tracking, `muted-foreground`.
|
|
7
|
+
2. **Value**: Space Grotesk 500 at 32px, tabular, `foreground`, with an optional unit in `muted-foreground`.
|
|
8
|
+
3. **Change** (optional): an arrow icon and the figure in `success` or `danger`, then context ("vs August") in `muted-subtle`.
|
|
9
|
+
|
|
10
|
+
## Color logic
|
|
11
|
+
`trend` gives the direction (`up` or `down`). Good is green and bad is red: by default up is good; set `upIsGood={false}` for numbers that should fall (overdue invoices, days to pay). With no `trend`, the change is neutral.
|
|
12
|
+
|
|
13
|
+
## Props
|
|
14
|
+
- `label`, `value`, `unit`, `delta`, `deltaContext`, `trend`, `upIsGood`.
|
|
15
|
+
|
|
16
|
+
## Accessibility
|
|
17
|
+
The arrow is decorative; the hidden words "Up" or "Down" read before the change, so direction never relies on color or icon alone.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
- Lay stats in a row of three to five with equal widths. Format values before passing them in ("$48,210").
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Steps
|
|
2
|
+
|
|
3
|
+
Shows where someone is in a fixed sequence: onboarding, a checkout, a multi-page form.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
Each step has a 28px square marker with the number zero-padded in Space Grotesk, a label, and an optional description in `muted-subtle`. A 1px rule connects the markers. It runs horizontally by default, or vertically with `orientation="vertical"`.
|
|
7
|
+
|
|
8
|
+
## Step states
|
|
9
|
+
| State | Marker | Label | Rule after it |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| Complete | `primary` fill with a `primary-foreground` check | `foreground` | `primary` |
|
|
12
|
+
| Current | `primary` border and number | `foreground`, 600 | `border-subtle` |
|
|
13
|
+
| Upcoming | `border-subtle` border, `muted-subtle` number | `muted-foreground` | `border-subtle` |
|
|
14
|
+
|
|
15
|
+
## Props
|
|
16
|
+
- `steps`: `{ label, description }[]`, `current` (zero-based index), `orientation`, `label`.
|
|
17
|
+
|
|
18
|
+
## Accessibility
|
|
19
|
+
An ordered list named by `label`; the current step has `aria-current="step"`; hidden text marks completed and current steps.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
- Three to six steps with short labels. Steps aren't links unless people can really jump back.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
A square on/off toggle for settings that take effect immediately.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Track**: 36×20px, square, `card` fill, 1px `muted-subtle` border.
|
|
7
|
+
2. **Thumb**: a 14px square, `muted-foreground` when off, sliding 16px right when on.
|
|
8
|
+
3. **Label** and optional **description**: as for `Checkbox`.
|
|
9
|
+
|
|
10
|
+
## States
|
|
11
|
+
| State | Track | Thumb |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Off | `card`, `muted-subtle` border | `muted-foreground`, left |
|
|
14
|
+
| Hover | border `primary-hover` | |
|
|
15
|
+
| On | `primary` fill and border | `primary-foreground`, right |
|
|
16
|
+
| Focus | 2px `ring` outline, 2px offset on the track | |
|
|
17
|
+
| Disabled | transparent, dashed; label `muted-subtle` | |
|
|
18
|
+
| Disabled, on | `muted-subtle` fill and border | `background`, right |
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
- `label`, `description`, `checked` or `defaultChecked`, `onChange`, `disabled`, `name`, `value`, `hideLabel`.
|
|
22
|
+
- Built on Radix Switch: the track is a `button` with `role="switch"` and `aria-checked`; Space or Enter toggles it. Inside a `form` a hidden checkbox carries `name` and `value`.
|
|
23
|
+
- `onChange` receives a change event whose `target` reads `checked`, `value` and `name` as a native checkbox would. The ref (and any `Tooltip` or `Popover` around it) gets the switch.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
- Use a switch only when the change applies without a Save button. Inside a form that is submitted, use `Checkbox`.
|
|
27
|
+
- Label the setting, not the state ("Weekly summary email", not "On").
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
A data table for comparing records: sortable columns, row selection, numeric alignment and an empty state.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Frame**: 1px `border-subtle`, `background` fill, scrolling horizontally when narrow (and vertically with `maxHeight`, keeping the header in place).
|
|
7
|
+
2. **Caption** (optional): Manrope 600 above the header, or visually hidden with `captionHidden`.
|
|
8
|
+
3. **Header**: 11px uppercase, 0.1em tracking, `muted-foreground`, with a 1px `border` rule below. Sortable headers are buttons with a sort icon: `chevrons-up-down` when unsorted, an orange `arrow-up` or `arrow-down` when sorted.
|
|
9
|
+
4. **Rows**: `small` text, 0.75rem 1rem cells (0.45rem 0.75rem when `density="compact"`), 1px `border-subtle` between rows. The first column is the row header.
|
|
10
|
+
5. **Numeric columns** (`numeric`): right-aligned in Space Grotesk with tabular figures.
|
|
11
|
+
6. **Selection column** (`selectable`): a `Checkbox` per row and a select-all box that shows a dash when only some rows are selected.
|
|
12
|
+
|
|
13
|
+
## Row states
|
|
14
|
+
Hover: `card-fill`. Selected: `primary-tint` (`aria-selected="true"`).
|
|
15
|
+
|
|
16
|
+
## Sorting
|
|
17
|
+
Clicking a sortable header cycles ascending → descending → unsorted. Sorting is built in (numbers numerically, text with natural order) unless you pass `manualSort` and sort on the server. Each header carries `aria-sort`.
|
|
18
|
+
|
|
19
|
+
## Loading, details and pages
|
|
20
|
+
- `loading` replaces the rows with `loadingRows` (5) skeleton rows and sets `aria-busy`.
|
|
21
|
+
- `renderExpanded(row)` adds a disclosure button to each row (`aria-expanded`); the details render in a full-width row below on a `card-fill` wash.
|
|
22
|
+
- `pageSize` paginates the rows with a `Pagination` and a "1–20 of 312" summary below (`summaryFormat(from, to, total)` to translate it). For server-side paging, leave it off and render `Pagination` yourself.
|
|
23
|
+
- `nowrap` on a column keeps its cells on one line (dates, IDs); numeric columns never wrap.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
- `columns`: `{ key, header, sortable, numeric, nowrap, align, width, render(row), sortValue(row) }`.
|
|
27
|
+
- `loading`, `loadingRows`, `renderExpanded`, `defaultExpanded`, `expandColumnLabel`, `pageSize`, `summaryFormat`.
|
|
28
|
+
- `rows`, `rowKey` (default `id`), `caption`, `captionHidden`, `density`, `maxHeight`, `emptyText`.
|
|
29
|
+
- `sort` + `onSortChange`, or `defaultSort` (`{ key, direction }`), `manualSort`.
|
|
30
|
+
- `selectable`, `selected` + `onSelectionChange`, or `defaultSelected`, `rowLabel(row)` (each row checkbox's accessible name), `selectAllLabel`.
|
|
31
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
- Use `Badge` tones for status columns, never colored text alone.
|
|
34
|
+
- Put row actions in a `Menu` in the last column (`align: 'end'`); icon buttons in tables shrink to 32px.
|
|
35
|
+
- Pair long tables with `Pagination` below.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
Switch between views of the same subject without leaving the page. Built on Radix Tabs.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Tab list**: a row of tabs over a 1px `border-subtle` rule, 1.75rem apart, scrolling sideways when it overflows.
|
|
7
|
+
2. **Tab**: `nav-link` style (12px, uppercase, 0.12em tracking) in `muted-foreground`, with an optional count in Space Grotesk `muted-subtle`.
|
|
8
|
+
3. **Selected tab**: `foreground`, with a 2px `primary` bar on the rule and its count in `primary`.
|
|
9
|
+
4. **Panel**: the selected tab's content, 1.25rem below.
|
|
10
|
+
|
|
11
|
+
## States
|
|
12
|
+
Hover: `foreground`. Focus: the 2px `ring`, inset. Disabled: `muted-subtle`, skipped by arrows.
|
|
13
|
+
Style state with Radix's attributes on `.vk-tab`: `[data-state=active|inactive]` and `[data-disabled]`.
|
|
14
|
+
|
|
15
|
+
## Keyboard
|
|
16
|
+
Tab lands on the selected tab. ← → move between tabs and select them (wrapping); Home and End (or Page Up and Page Down) jump to the first or last. Tab again moves into the panel.
|
|
17
|
+
|
|
18
|
+
## Accessibility
|
|
19
|
+
WAI-ARIA tabs with automatic activation: `tablist`, `tab` (`aria-selected`, `aria-controls`, roving `tabIndex`) and `tabpanel` (`aria-labelledby`). Every panel stays in the DOM (hidden unless selected) so each `aria-controls` resolves; only the selected one renders its content unless `keepMounted`.
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
- `tabs`: `{ id, label, content, count, disabled }`. `value` + `onChange`, or `defaultValue` (default: the first tab). `onChange(id)` runs when the selection changes. `label` (the list's accessible name). `keepMounted` keeps hidden panels rendered.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
- Two to six tabs with short labels. Tabs never change the URL's page; use links for that.
|
|
26
|
+
- For switching how one thing is displayed (chart or table), use `SegmentedControl`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
A compact chip for a chosen value, a filter or a label. It can carry a remove button.
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
1. **Chip**: `surface-elevated` fill, 1px `border`, square, at least 26px tall, 0.1rem 0.5rem padding.
|
|
7
|
+
2. **Label**: `small` (14px) in `foreground`; long labels truncate with an ellipsis.
|
|
8
|
+
3. **Remove button** (optional): a 20px square with a 12px `x` in `muted-foreground`.
|
|
9
|
+
|
|
10
|
+
## States
|
|
11
|
+
| Part | State | Treatment |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Remove | Hover | `foreground` icon on a `primary-tint` fill |
|
|
14
|
+
| Remove | Focus | 2px `ring` outline |
|
|
15
|
+
|
|
16
|
+
## Props
|
|
17
|
+
- `children`: the label. `onRemove`: shows the remove button and handles it. `removeLabel`: the button's accessible name ("Remove iOS" by default).
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
- Use Tag for values people chose or can remove. For a status, use `Badge`.
|
|
21
|
+
- Keep labels to a word or two.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
Running text in one of the system's text styles and tones.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
- `size`: a type style (`body` default, `body-sm`, `body-lg`, `lead`, `small`, `meta`, `footnote` …).
|
|
7
|
+
- `tone`: `muted` (`muted-foreground`), `subtle` (`muted-subtle`), `primary`, `danger`, `success`; default `foreground`.
|
|
8
|
+
- `as` (`p` default; `span`, `div`, `li`).
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
- Body copy is `foreground` on app screens and `muted-foreground` in long marketing and docs text (use `Prose` there).
|