@usefragments/ui 1.0.2 → 1.2.0
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/README.md +16 -16
- package/dist/assets/fragments-wordmark.cjs +30 -0
- package/dist/assets/fragments-wordmark.d.ts +13 -0
- package/dist/assets/fragments-wordmark.d.ts.map +1 -0
- package/dist/assets/fragments-wordmark.js +30 -0
- package/dist/assets/ui.css +3234 -3116
- package/dist/components/Accordion/Accordion.module.scss.cjs +8 -8
- package/dist/components/Accordion/Accordion.module.scss.js +8 -8
- package/dist/components/Accordion/index.cjs +22 -10
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +22 -10
- package/dist/components/Alert/Alert.module.scss.cjs +13 -13
- package/dist/components/Alert/Alert.module.scss.js +13 -13
- package/dist/components/AppShell/AppShell.module.scss.cjs +22 -10
- package/dist/components/AppShell/AppShell.module.scss.js +22 -10
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/Avatar.module.scss.cjs +13 -13
- package/dist/components/Avatar/Avatar.module.scss.js +13 -13
- package/dist/components/Badge/Badge.module.scss.cjs +16 -16
- package/dist/components/Badge/Badge.module.scss.js +16 -16
- package/dist/components/BentoGrid/BentoGrid.module.scss.cjs +14 -14
- package/dist/components/BentoGrid/BentoGrid.module.scss.js +14 -14
- package/dist/components/Box/Box.module.scss.cjs +152 -152
- package/dist/components/Box/Box.module.scss.js +152 -152
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs +8 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.js +8 -8
- package/dist/components/Button/Button.module.scss.cjs +13 -13
- package/dist/components/Button/Button.module.scss.js +13 -13
- package/dist/components/Card/Card.module.scss.cjs +17 -17
- package/dist/components/Card/Card.module.scss.js +17 -17
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Chart/Chart.module.scss.cjs +15 -15
- package/dist/components/Chart/Chart.module.scss.js +15 -15
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +11 -11
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
- package/dist/components/Chip/Chip.module.scss.cjs +15 -15
- package/dist/components/Chip/Chip.module.scss.js +15 -15
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +21 -21
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +21 -21
- package/dist/components/Collapsible/Collapsible.module.scss.cjs +10 -10
- package/dist/components/Collapsible/Collapsible.module.scss.js +10 -10
- package/dist/components/ColorPicker/ColorPicker.module.scss.cjs +14 -14
- package/dist/components/ColorPicker/ColorPicker.module.scss.js +14 -14
- package/dist/components/Combobox/Combobox.module.scss.cjs +23 -23
- package/dist/components/Combobox/Combobox.module.scss.js +23 -23
- package/dist/components/Combobox/index.cjs +106 -9
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +106 -9
- package/dist/components/Command/Command.module.scss.cjs +11 -11
- package/dist/components/Command/Command.module.scss.js +11 -11
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/DataTable/DataTable.module.scss.cjs +37 -34
- package/dist/components/DataTable/DataTable.module.scss.js +37 -34
- package/dist/components/DataTable/index.d.ts +3 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.module.scss.cjs +33 -33
- package/dist/components/DatePicker/DatePicker.module.scss.js +33 -33
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.module.scss.cjs +14 -14
- package/dist/components/Dialog/Dialog.module.scss.js +14 -14
- package/dist/components/Drawer/Drawer.module.scss.cjs +28 -28
- package/dist/components/Drawer/Drawer.module.scss.js +28 -28
- package/dist/components/Drawer/index.cjs +20 -3
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +20 -3
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +8 -8
- package/dist/components/EmptyState/EmptyState.module.scss.js +8 -8
- package/dist/components/Field/Field.module.scss.cjs +4 -4
- package/dist/components/Field/Field.module.scss.js +4 -4
- package/dist/components/Field/index.cjs +10 -9
- package/dist/components/Field/index.d.ts +7 -7
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +10 -9
- package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
- package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
- package/dist/components/Header/Header.module.scss.cjs +44 -29
- package/dist/components/Header/Header.module.scss.js +44 -29
- package/dist/components/Header/index.cjs +56 -3
- package/dist/components/Header/index.d.ts +25 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -3
- package/dist/components/Icon/Icon.module.scss.cjs +8 -8
- package/dist/components/Icon/Icon.module.scss.js +8 -8
- package/dist/components/IconButton/IconButton.module.scss.cjs +8 -8
- package/dist/components/IconButton/IconButton.module.scss.js +8 -8
- package/dist/components/Image/Image.module.scss.cjs +27 -27
- package/dist/components/Image/Image.module.scss.js +27 -27
- package/dist/components/Input/Input.module.scss.cjs +19 -19
- package/dist/components/Input/Input.module.scss.js +19 -19
- package/dist/components/Link/Link.module.scss.cjs +10 -10
- package/dist/components/Link/Link.module.scss.js +10 -10
- package/dist/components/List/List.module.scss.cjs +19 -19
- package/dist/components/List/List.module.scss.js +19 -19
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Loading/Loading.module.scss.cjs +30 -30
- package/dist/components/Loading/Loading.module.scss.js +30 -30
- package/dist/components/Main/Main.module.scss.cjs +26 -0
- package/dist/components/Main/Main.module.scss.js +26 -0
- package/dist/components/Main/index.cjs +128 -0
- package/dist/components/Main/index.d.ts +22 -0
- package/dist/components/Main/index.d.ts.map +1 -0
- package/dist/components/Main/index.js +111 -0
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/Menu/Menu.module.scss.cjs +14 -14
- package/dist/components/Menu/Menu.module.scss.js +14 -14
- package/dist/components/Message/Message.module.scss.cjs +18 -18
- package/dist/components/Message/Message.module.scss.js +18 -18
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +28 -28
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +28 -28
- package/dist/components/Pagination/Pagination.module.scss.cjs +7 -7
- package/dist/components/Pagination/Pagination.module.scss.js +7 -7
- package/dist/components/Popover/Popover.module.scss.cjs +10 -10
- package/dist/components/Popover/Popover.module.scss.js +10 -10
- package/dist/components/Popover/index.cjs +27 -2
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +27 -2
- package/dist/components/Progress/Progress.module.scss.cjs +25 -25
- package/dist/components/Progress/Progress.module.scss.js +25 -25
- package/dist/components/Prompt/Prompt.module.scss.cjs +18 -18
- package/dist/components/Prompt/Prompt.module.scss.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +17 -17
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +17 -17
- package/dist/components/RadioGroup/index.cjs +2 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +10 -10
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +10 -10
- package/dist/components/Select/Select.module.scss.cjs +17 -17
- package/dist/components/Select/Select.module.scss.js +17 -17
- package/dist/components/Separator/Separator.module.scss.cjs +10 -10
- package/dist/components/Separator/Separator.module.scss.js +10 -10
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +42 -42
- package/dist/components/Sidebar/Sidebar.module.scss.js +42 -42
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +38 -38
- package/dist/components/Skeleton/Skeleton.module.scss.js +38 -38
- package/dist/components/Slider/Slider.module.scss.cjs +12 -12
- package/dist/components/Slider/Slider.module.scss.js +12 -12
- package/dist/components/Table/Table.module.scss.cjs +19 -19
- package/dist/components/Table/Table.module.scss.js +19 -19
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/TableOfContents/index.cjs +22 -42
- package/dist/components/TableOfContents/index.d.ts +3 -3
- package/dist/components/TableOfContents/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.js +22 -42
- package/dist/components/Tabs/Tabs.module.scss.cjs +12 -12
- package/dist/components/Tabs/Tabs.module.scss.js +12 -12
- package/dist/components/Text/Text.module.scss.cjs +51 -51
- package/dist/components/Text/Text.module.scss.js +51 -51
- package/dist/components/Textarea/Textarea.module.scss.cjs +23 -23
- package/dist/components/Textarea/Textarea.module.scss.js +23 -23
- package/dist/components/Theme/ThemeToggle.module.scss.cjs +6 -6
- package/dist/components/Theme/ThemeToggle.module.scss.js +6 -6
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +13 -13
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +13 -13
- package/dist/components/Toast/Toast.module.scss.cjs +21 -21
- package/dist/components/Toast/Toast.module.scss.js +21 -21
- package/dist/components/Toggle/Toggle.module.scss.cjs +13 -13
- package/dist/components/Toggle/Toggle.module.scss.js +13 -13
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +17 -17
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +17 -17
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/data-table.cjs +58 -41
- package/dist/data-table.js +59 -41
- package/dist/datepicker.cjs +32 -72
- package/dist/datepicker.js +32 -72
- package/dist/index.cjs +89 -85
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/fragments.json +1 -1
- package/package.json +9 -8
- package/src/assets/fragments-wordmark.tsx +47 -0
- package/src/components/Accordion/index.tsx +13 -3
- package/src/components/Alert/Alert.module.scss +15 -2
- package/src/components/AppShell/AppShell.module.scss +73 -15
- package/src/components/AppShell/index.tsx +1 -1
- package/src/components/Button/Button.module.scss +19 -20
- package/src/components/Card/Card.module.scss +3 -3
- package/src/components/Card/index.tsx +3 -3
- package/src/components/Checkbox/Checkbox.contract.json +5 -24
- package/src/components/Checkbox/Checkbox.module.scss +4 -2
- package/src/components/Chip/Chip.contract.json +11 -28
- package/src/components/Chip/Chip.module.scss +21 -45
- package/src/components/CodeBlock/CodeBlock.module.scss +2 -7
- package/src/components/Combobox/Combobox.contract.json +6 -24
- package/src/components/Combobox/Combobox.module.scss +3 -2
- package/src/components/Combobox/index.tsx +132 -6
- package/src/components/DataTable/DataTable.contract.json +16 -23
- package/src/components/DataTable/DataTable.module.scss +31 -8
- package/src/components/DataTable/index.tsx +25 -4
- package/src/components/DatePicker/index.tsx +32 -84
- package/src/components/Drawer/index.tsx +38 -12
- package/src/components/Field/index.tsx +35 -35
- package/src/components/Header/Header.contract.json +41 -1
- package/src/components/Header/Header.module.scss +40 -0
- package/src/components/Header/index.tsx +88 -2
- package/src/components/IconButton/IconButton.contract.json +120 -0
- package/src/components/Listbox/Listbox.module.scss +5 -4
- package/src/components/Main/Main.contract.json +79 -0
- package/src/components/Main/Main.module.scss +31 -0
- package/src/components/Main/index.tsx +124 -0
- package/src/components/Menu/Menu.module.scss +8 -10
- package/src/components/Popover/index.tsx +34 -2
- package/src/components/RadioGroup/RadioGroup.contract.json +13 -27
- package/src/components/RadioGroup/index.tsx +4 -0
- package/src/components/Select/Select.module.scss +13 -12
- package/src/components/Table/Table.module.scss +22 -5
- package/src/components/TableOfContents/TableOfContents.contract.json +6 -16
- package/src/components/TableOfContents/TableOfContents.module.scss +20 -14
- package/src/components/TableOfContents/index.tsx +27 -38
- package/src/components/Toast/Toast.module.scss +15 -2
- package/src/components/ToggleGroup/ToggleGroup.module.scss +4 -1
- package/src/index.ts +4 -0
- package/src/styles/globals.scss +13 -10
- package/src/tokens/_component-properties.scss +26 -0
- package/src/tokens/_computed.scss +22 -4
- package/src/tokens/_derive.scss +55 -6
- package/src/tokens/_palettes.scss +24 -0
- package/src/tokens/_seeds.scss +20 -12
- package/src/tokens/_variables.scss +110 -63
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts +0 -33
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts.map +0 -1
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts +0 -11
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts +0 -5
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts +0 -4
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts +0 -3
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts +0 -86
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts +0 -2
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts.map +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +0 -106
- package/src/components/Alert/Alert.stories.tsx +0 -119
- package/src/components/AppShell/AppShell.stories.tsx +0 -156
- package/src/components/Avatar/Avatar.stories.tsx +0 -74
- package/src/components/Badge/Badge.stories.tsx +0 -92
- package/src/components/BentoGrid/BentoGrid.stories.tsx +0 -98
- package/src/components/Box/Box.stories.tsx +0 -150
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -87
- package/src/components/Button/Button.stories.tsx +0 -103
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -97
- package/src/components/Card/Card.stories.tsx +0 -144
- package/src/components/Chart/Chart.stories.tsx +0 -119
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -68
- package/src/components/Chip/Chip.stories.tsx +0 -70
- package/src/components/Cloud/CloudGovernanceShell.module.scss +0 -88
- package/src/components/Cloud/CloudGovernanceShell.stories.tsx +0 -446
- package/src/components/Cloud/ControlSizing.module.scss +0 -49
- package/src/components/Cloud/ControlSizing.stories.tsx +0 -238
- package/src/components/Cloud/DashboardLayoutPrototypes.module.scss +0 -462
- package/src/components/Cloud/DashboardLayoutPrototypes.shared.tsx +0 -375
- package/src/components/Cloud/DashboardLayoutPrototypes.shell.tsx +0 -147
- package/src/components/Cloud/DashboardLayoutPrototypes.stories.tsx +0 -328
- package/src/components/Cloud/PullRequestsPrototypes.content.tsx +0 -283
- package/src/components/Cloud/PullRequestsPrototypes.detail-panels.tsx +0 -381
- package/src/components/Cloud/PullRequestsPrototypes.detail.tsx +0 -204
- package/src/components/Cloud/PullRequestsPrototypes.id-data.ts +0 -395
- package/src/components/Cloud/PullRequestsPrototypes.id-page.tsx +0 -349
- package/src/components/Cloud/PullRequestsPrototypes.stories.tsx +0 -81
- package/src/components/CodeBlock/CodeBlock.stories.tsx +0 -147
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -94
- package/src/components/ColorPicker/ColorPicker.stories.tsx +0 -74
- package/src/components/Combobox/Combobox.stories.tsx +0 -133
- package/src/components/Command/Command.stories.tsx +0 -102
- package/src/components/ConversationList/ConversationList.stories.tsx +0 -93
- package/src/components/DataTable/DataTable.stories.tsx +0 -129
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -129
- package/src/components/Dialog/Dialog.stories.tsx +0 -154
- package/src/components/Drawer/Drawer.stories.tsx +0 -144
- package/src/components/Editor/Editor.stories.tsx +0 -99
- package/src/components/EmptyState/EmptyState.stories.tsx +0 -97
- package/src/components/Field/Field.stories.tsx +0 -109
- package/src/components/Fieldset/Fieldset.stories.tsx +0 -116
- package/src/components/Form/Form.stories.tsx +0 -142
- package/src/components/Grid/Grid.stories.tsx +0 -125
- package/src/components/Header/Header.stories.tsx +0 -133
- package/src/components/Icon/Icon.stories.tsx +0 -80
- package/src/components/IconButton/IconButton.stories.tsx +0 -78
- package/src/components/Image/Image.stories.tsx +0 -109
- package/src/components/Input/Input.stories.tsx +0 -104
- package/src/components/Link/Link.stories.tsx +0 -67
- package/src/components/List/List.stories.tsx +0 -95
- package/src/components/Listbox/Listbox.stories.tsx +0 -81
- package/src/components/Loading/Loading.stories.tsx +0 -69
- package/src/components/Markdown/Markdown.stories.tsx +0 -75
- package/src/components/Menu/Menu.stories.tsx +0 -113
- package/src/components/Message/Message.stories.tsx +0 -85
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +0 -161
- package/src/components/Pagination/Pagination.stories.tsx +0 -81
- package/src/components/Popover/Popover.stories.tsx +0 -152
- package/src/components/Progress/Progress.stories.tsx +0 -64
- package/src/components/Prompt/Prompt.stories.tsx +0 -93
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -107
- package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -97
- package/src/components/Select/Select.stories.tsx +0 -127
- package/src/components/Separator/Separator.stories.tsx +0 -84
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -122
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -80
- package/src/components/Slider/Slider.stories.tsx +0 -73
- package/src/components/Stack/Stack.stories.tsx +0 -73
- package/src/components/Switch/Switch.stories.tsx +0 -59
- package/src/components/Table/Table.stories.tsx +0 -219
- package/src/components/TableOfContents/TableOfContents.stories.tsx +0 -120
- package/src/components/Tabs/Tabs.stories.tsx +0 -136
- package/src/components/Text/Text.stories.tsx +0 -133
- package/src/components/Textarea/Textarea.stories.tsx +0 -107
- package/src/components/Theme/Theme.stories.tsx +0 -95
- package/src/components/ThinkingIndicator/ThinkingIndicator.stories.tsx +0 -85
- package/src/components/Toast/Toast.stories.tsx +0 -91
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -114
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -95
- package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -78
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Skeleton } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Skeleton is a placeholder loading state for content. Semantic variants
|
|
6
|
-
* auto-size to common shapes, while width/height allow custom dimensions.
|
|
7
|
-
* Includes Skeleton.Text and Skeleton.Circle subcomponents.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Feedback/Skeleton',
|
|
11
|
-
component: Skeleton,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Placeholder loading state for content.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
variant: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['text', 'heading', 'avatar', 'button', 'input', 'rect'],
|
|
24
|
-
description: 'Semantic variant that auto-sizes',
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
control: 'select',
|
|
28
|
-
options: ['sm', 'md', 'lg'],
|
|
29
|
-
description: 'Size for avatar/button variants',
|
|
30
|
-
},
|
|
31
|
-
radius: {
|
|
32
|
-
control: 'select',
|
|
33
|
-
options: ['sm', 'md', 'lg', 'none', 'full'],
|
|
34
|
-
description: 'Border radius override',
|
|
35
|
-
},
|
|
36
|
-
fill: { control: 'boolean', description: 'Fill parent container' },
|
|
37
|
-
static: { control: 'boolean', description: 'Disable skeleton animation' },
|
|
38
|
-
},
|
|
39
|
-
args: { variant: 'rect', width: 200, height: 20 },
|
|
40
|
-
} satisfies Meta<typeof Skeleton>;
|
|
41
|
-
|
|
42
|
-
export default meta;
|
|
43
|
-
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
export const Default: Story = {
|
|
47
|
-
args: { variant: 'rect', width: 200, height: 20 },
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const Heading: Story = {
|
|
51
|
-
args: { variant: 'heading', width: 200 },
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const TextLines: Story = {
|
|
55
|
-
render: () => <Skeleton.Text lines={3} />,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Avatars: Story = {
|
|
59
|
-
render: () => (
|
|
60
|
-
<div style={{ display: 'flex', gap: 'var(--fui-space-1)', alignItems: 'center' }}>
|
|
61
|
-
<Skeleton.Circle size="sm" />
|
|
62
|
-
<Skeleton.Circle size="md" />
|
|
63
|
-
<Skeleton.Circle size="lg" />
|
|
64
|
-
</div>
|
|
65
|
-
),
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const Card: Story = {
|
|
69
|
-
render: () => (
|
|
70
|
-
<div style={{ width: 300 }}>
|
|
71
|
-
<Skeleton variant="rect" height={120} radius="md" />
|
|
72
|
-
<div style={{ marginTop: 'var(--fui-space-2)' }}>
|
|
73
|
-
<Skeleton variant="heading" width="60%" />
|
|
74
|
-
</div>
|
|
75
|
-
<div style={{ marginTop: 'var(--fui-space-1)' }}>
|
|
76
|
-
<Skeleton.Text lines={2} />
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
),
|
|
80
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Slider } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Slider is a range input control for selecting a numeric value within a
|
|
6
|
-
* defined range. It supports a label, value display, a custom step interval,
|
|
7
|
-
* and a value suffix for units.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Forms/Slider',
|
|
11
|
-
component: Slider,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Range input control for selecting a numeric value within a defined range.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
showValue: { control: 'boolean', description: 'Display current value' },
|
|
22
|
-
showValueOnDrag: {
|
|
23
|
-
control: 'boolean',
|
|
24
|
-
description: 'Show a floating value bubble while dragging',
|
|
25
|
-
},
|
|
26
|
-
error: { control: 'boolean', description: 'Show error styling' },
|
|
27
|
-
disabled: { control: 'boolean', description: 'Disable the slider' },
|
|
28
|
-
},
|
|
29
|
-
args: { label: 'Volume', defaultValue: 50, min: 0, max: 100, step: 1 },
|
|
30
|
-
render: (args) => (
|
|
31
|
-
<div style={{ width: 300 }}>
|
|
32
|
-
<Slider {...args} />
|
|
33
|
-
</div>
|
|
34
|
-
),
|
|
35
|
-
} satisfies Meta<typeof Slider>;
|
|
36
|
-
|
|
37
|
-
export default meta;
|
|
38
|
-
|
|
39
|
-
type Story = StoryObj<typeof meta>;
|
|
40
|
-
|
|
41
|
-
export const Default: Story = {
|
|
42
|
-
args: { label: 'Volume', defaultValue: 50 },
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const WithValue: Story = {
|
|
46
|
-
args: { label: 'Brightness', defaultValue: 75, showValue: true, valueSuffix: '%' },
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const CustomRange: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
label: 'Temperature',
|
|
52
|
-
min: 60,
|
|
53
|
-
max: 80,
|
|
54
|
-
step: 1,
|
|
55
|
-
defaultValue: 72,
|
|
56
|
-
showValue: true,
|
|
57
|
-
valueSuffix: '°F',
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const WithHelperText: Story = {
|
|
62
|
-
args: {
|
|
63
|
-
label: 'Quality',
|
|
64
|
-
defaultValue: 80,
|
|
65
|
-
showValue: true,
|
|
66
|
-
valueSuffix: '%',
|
|
67
|
-
helperText: 'Higher quality increases file size',
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const Disabled: Story = {
|
|
72
|
-
args: { label: 'Locked setting', defaultValue: 30, showValue: true, disabled: true },
|
|
73
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Stack } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Stack is a flexbox layout primitive for arranging children in rows or
|
|
6
|
-
* columns with consistent spacing. Direction and gap accept tokens, numbers,
|
|
7
|
-
* or responsive objects.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Layout/Stack',
|
|
11
|
-
component: Stack,
|
|
12
|
-
tags: ['autodocs', 'canonical'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Flexbox layout component for arranging children in rows or columns.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
align: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['start', 'center', 'end', 'stretch', 'baseline'],
|
|
24
|
-
description: 'Cross-axis alignment',
|
|
25
|
-
},
|
|
26
|
-
justify: {
|
|
27
|
-
control: 'select',
|
|
28
|
-
options: ['start', 'center', 'end', 'between'],
|
|
29
|
-
description: 'Main-axis alignment',
|
|
30
|
-
},
|
|
31
|
-
as: {
|
|
32
|
-
control: 'select',
|
|
33
|
-
options: ['div', 'section', 'nav', 'article', 'aside', 'header', 'footer', 'main', 'ul', 'ol'],
|
|
34
|
-
description: 'HTML element to render',
|
|
35
|
-
},
|
|
36
|
-
wrap: { control: 'boolean', description: 'Allow items to wrap' },
|
|
37
|
-
},
|
|
38
|
-
args: {
|
|
39
|
-
direction: 'column',
|
|
40
|
-
gap: 'md',
|
|
41
|
-
children: (
|
|
42
|
-
<>
|
|
43
|
-
<div style={{ padding: 8, background: 'var(--fui-bg-secondary)' }}>Item 1</div>
|
|
44
|
-
<div style={{ padding: 8, background: 'var(--fui-bg-secondary)' }}>Item 2</div>
|
|
45
|
-
<div style={{ padding: 8, background: 'var(--fui-bg-secondary)' }}>Item 3</div>
|
|
46
|
-
</>
|
|
47
|
-
),
|
|
48
|
-
},
|
|
49
|
-
} satisfies Meta<typeof Stack>;
|
|
50
|
-
|
|
51
|
-
export default meta;
|
|
52
|
-
|
|
53
|
-
type Story = StoryObj<typeof meta>;
|
|
54
|
-
|
|
55
|
-
export const Vertical: Story = {
|
|
56
|
-
args: { direction: 'column', gap: 'sm' },
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const Horizontal: Story = {
|
|
60
|
-
args: { direction: 'row', gap: 'sm' },
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const NumericGap: Story = {
|
|
64
|
-
args: { direction: 'row', gap: 4 },
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const WithSeparator: Story = {
|
|
68
|
-
args: { direction: 'column', gap: 'md', separator: true },
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const SemanticElement: Story = {
|
|
72
|
-
args: { as: 'nav', direction: 'row', gap: 'md' },
|
|
73
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Switch } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Switch is a binary on/off control for settings and preferences. It supports
|
|
6
|
-
* controlled and uncontrolled checked state, an optional label, helper text,
|
|
7
|
-
* and three sizes.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Forms/Switch',
|
|
11
|
-
component: Switch,
|
|
12
|
-
tags: ['autodocs', 'canonical'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Binary on/off switch for settings and preferences.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
size: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['sm', 'md', 'lg'],
|
|
24
|
-
description: 'Size variant',
|
|
25
|
-
},
|
|
26
|
-
disabled: { control: 'boolean', description: 'Disable the switch' },
|
|
27
|
-
readOnly: { control: 'boolean', description: 'Prevent the user from toggling' },
|
|
28
|
-
required: { control: 'boolean', description: 'Mark the switch as required' },
|
|
29
|
-
defaultChecked: { control: 'boolean', description: 'Default checked state (uncontrolled)' },
|
|
30
|
-
},
|
|
31
|
-
args: { label: 'Enable notifications', size: 'md', defaultChecked: false },
|
|
32
|
-
} satisfies Meta<typeof Switch>;
|
|
33
|
-
|
|
34
|
-
export default meta;
|
|
35
|
-
|
|
36
|
-
type Story = StoryObj<typeof meta>;
|
|
37
|
-
|
|
38
|
-
export const Default: Story = {
|
|
39
|
-
args: { label: 'Enable notifications' },
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Checked: Story = {
|
|
43
|
-
args: { label: 'Auto-save', defaultChecked: true },
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const WithHelperText: Story = {
|
|
47
|
-
args: {
|
|
48
|
-
label: 'Marketing emails',
|
|
49
|
-
helperText: 'Receive occasional product updates and offers.',
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Small: Story = {
|
|
54
|
-
args: { label: 'Compact mode', size: 'sm', defaultChecked: true },
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Disabled: Story = {
|
|
58
|
-
args: { label: 'Locked setting', disabled: true, defaultChecked: true },
|
|
59
|
-
};
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Table } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Table is the canonical semantic-HTML table primitive. Reach for it whenever
|
|
6
|
-
* you need to render static tabular data with headers, rows, and footers —
|
|
7
|
-
* agents should compose `Table.Head`/`Table.Body`/`Table.Row` rather than
|
|
8
|
-
* hand-rolling `<table>` markup. For sorting and selection, use DataTable.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Display/Table',
|
|
12
|
-
component: Table,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Semantic HTML table with a compound API. Prefer this over a raw <table>; use DataTable when you need sorting or selection.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
size: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['sm', 'md'],
|
|
26
|
-
description: 'Table density',
|
|
27
|
-
},
|
|
28
|
-
striped: { control: 'boolean', description: 'Show alternating row backgrounds' },
|
|
29
|
-
bordered: { control: 'boolean', description: 'Wrap table in a bordered container' },
|
|
30
|
-
},
|
|
31
|
-
args: {
|
|
32
|
-
size: 'md',
|
|
33
|
-
striped: false,
|
|
34
|
-
bordered: false,
|
|
35
|
-
},
|
|
36
|
-
} satisfies Meta<typeof Table>;
|
|
37
|
-
|
|
38
|
-
export default meta;
|
|
39
|
-
|
|
40
|
-
type Story = StoryObj<typeof meta>;
|
|
41
|
-
|
|
42
|
-
export const Default: Story = {
|
|
43
|
-
render: (args) => (
|
|
44
|
-
<Table {...args} aria-label="Team members">
|
|
45
|
-
<Table.Head>
|
|
46
|
-
<Table.Row>
|
|
47
|
-
<Table.HeaderCell>Name</Table.HeaderCell>
|
|
48
|
-
<Table.HeaderCell>Role</Table.HeaderCell>
|
|
49
|
-
<Table.HeaderCell>Status</Table.HeaderCell>
|
|
50
|
-
</Table.Row>
|
|
51
|
-
</Table.Head>
|
|
52
|
-
<Table.Body>
|
|
53
|
-
<Table.Row>
|
|
54
|
-
<Table.Cell>Alice Johnson</Table.Cell>
|
|
55
|
-
<Table.Cell>Engineer</Table.Cell>
|
|
56
|
-
<Table.Cell>Active</Table.Cell>
|
|
57
|
-
</Table.Row>
|
|
58
|
-
<Table.Row>
|
|
59
|
-
<Table.Cell>Bob Smith</Table.Cell>
|
|
60
|
-
<Table.Cell>Designer</Table.Cell>
|
|
61
|
-
<Table.Cell>Active</Table.Cell>
|
|
62
|
-
</Table.Row>
|
|
63
|
-
<Table.Row>
|
|
64
|
-
<Table.Cell>Carol Williams</Table.Cell>
|
|
65
|
-
<Table.Cell>PM</Table.Cell>
|
|
66
|
-
<Table.Cell>Away</Table.Cell>
|
|
67
|
-
</Table.Row>
|
|
68
|
-
</Table.Body>
|
|
69
|
-
</Table>
|
|
70
|
-
),
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Striped: Story = {
|
|
74
|
-
args: { striped: true },
|
|
75
|
-
render: (args) => (
|
|
76
|
-
<Table {...args} aria-label="Inventory">
|
|
77
|
-
<Table.Head>
|
|
78
|
-
<Table.Row>
|
|
79
|
-
<Table.HeaderCell>Item</Table.HeaderCell>
|
|
80
|
-
<Table.HeaderCell>Category</Table.HeaderCell>
|
|
81
|
-
<Table.HeaderCell>Qty</Table.HeaderCell>
|
|
82
|
-
</Table.Row>
|
|
83
|
-
</Table.Head>
|
|
84
|
-
<Table.Body>
|
|
85
|
-
<Table.Row>
|
|
86
|
-
<Table.Cell>Widget A</Table.Cell>
|
|
87
|
-
<Table.Cell>Hardware</Table.Cell>
|
|
88
|
-
<Table.Cell>120</Table.Cell>
|
|
89
|
-
</Table.Row>
|
|
90
|
-
<Table.Row>
|
|
91
|
-
<Table.Cell>Widget B</Table.Cell>
|
|
92
|
-
<Table.Cell>Software</Table.Cell>
|
|
93
|
-
<Table.Cell>85</Table.Cell>
|
|
94
|
-
</Table.Row>
|
|
95
|
-
<Table.Row>
|
|
96
|
-
<Table.Cell>Widget C</Table.Cell>
|
|
97
|
-
<Table.Cell>Hardware</Table.Cell>
|
|
98
|
-
<Table.Cell>200</Table.Cell>
|
|
99
|
-
</Table.Row>
|
|
100
|
-
</Table.Body>
|
|
101
|
-
</Table>
|
|
102
|
-
),
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const Bordered: Story = {
|
|
106
|
-
args: { bordered: true },
|
|
107
|
-
render: (args) => (
|
|
108
|
-
<Table {...args} aria-label="Pricing">
|
|
109
|
-
<Table.Head>
|
|
110
|
-
<Table.Row>
|
|
111
|
-
<Table.HeaderCell>Plan</Table.HeaderCell>
|
|
112
|
-
<Table.HeaderCell>Price</Table.HeaderCell>
|
|
113
|
-
<Table.HeaderCell>Features</Table.HeaderCell>
|
|
114
|
-
</Table.Row>
|
|
115
|
-
</Table.Head>
|
|
116
|
-
<Table.Body>
|
|
117
|
-
<Table.Row>
|
|
118
|
-
<Table.Cell>Basic</Table.Cell>
|
|
119
|
-
<Table.Cell>$9/mo</Table.Cell>
|
|
120
|
-
<Table.Cell>5 projects</Table.Cell>
|
|
121
|
-
</Table.Row>
|
|
122
|
-
<Table.Row>
|
|
123
|
-
<Table.Cell>Pro</Table.Cell>
|
|
124
|
-
<Table.Cell>$29/mo</Table.Cell>
|
|
125
|
-
<Table.Cell>Unlimited</Table.Cell>
|
|
126
|
-
</Table.Row>
|
|
127
|
-
</Table.Body>
|
|
128
|
-
</Table>
|
|
129
|
-
),
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const Compact: Story = {
|
|
133
|
-
args: { size: 'sm' },
|
|
134
|
-
render: (args) => (
|
|
135
|
-
<Table {...args} aria-label="Shortcuts">
|
|
136
|
-
<Table.Head>
|
|
137
|
-
<Table.Row>
|
|
138
|
-
<Table.HeaderCell>Key</Table.HeaderCell>
|
|
139
|
-
<Table.HeaderCell>Action</Table.HeaderCell>
|
|
140
|
-
</Table.Row>
|
|
141
|
-
</Table.Head>
|
|
142
|
-
<Table.Body>
|
|
143
|
-
<Table.Row>
|
|
144
|
-
<Table.Cell>Ctrl+S</Table.Cell>
|
|
145
|
-
<Table.Cell>Save</Table.Cell>
|
|
146
|
-
</Table.Row>
|
|
147
|
-
<Table.Row>
|
|
148
|
-
<Table.Cell>Ctrl+Z</Table.Cell>
|
|
149
|
-
<Table.Cell>Undo</Table.Cell>
|
|
150
|
-
</Table.Row>
|
|
151
|
-
<Table.Row>
|
|
152
|
-
<Table.Cell>Ctrl+C</Table.Cell>
|
|
153
|
-
<Table.Cell>Copy</Table.Cell>
|
|
154
|
-
</Table.Row>
|
|
155
|
-
</Table.Body>
|
|
156
|
-
</Table>
|
|
157
|
-
),
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const WithCaption: Story = {
|
|
161
|
-
render: (args) => (
|
|
162
|
-
<Table {...args} aria-label="Q1 results">
|
|
163
|
-
<Table.Caption>Quarterly Results (Q1 2026)</Table.Caption>
|
|
164
|
-
<Table.Head>
|
|
165
|
-
<Table.Row>
|
|
166
|
-
<Table.HeaderCell>Metric</Table.HeaderCell>
|
|
167
|
-
<Table.HeaderCell>Value</Table.HeaderCell>
|
|
168
|
-
<Table.HeaderCell>Change</Table.HeaderCell>
|
|
169
|
-
</Table.Row>
|
|
170
|
-
</Table.Head>
|
|
171
|
-
<Table.Body>
|
|
172
|
-
<Table.Row>
|
|
173
|
-
<Table.Cell>Revenue</Table.Cell>
|
|
174
|
-
<Table.Cell>$1.2M</Table.Cell>
|
|
175
|
-
<Table.Cell>+15%</Table.Cell>
|
|
176
|
-
</Table.Row>
|
|
177
|
-
<Table.Row>
|
|
178
|
-
<Table.Cell>Users</Table.Cell>
|
|
179
|
-
<Table.Cell>24,500</Table.Cell>
|
|
180
|
-
<Table.Cell>+8%</Table.Cell>
|
|
181
|
-
</Table.Row>
|
|
182
|
-
</Table.Body>
|
|
183
|
-
</Table>
|
|
184
|
-
),
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export const WithFooter: Story = {
|
|
188
|
-
args: { bordered: true },
|
|
189
|
-
render: (args) => (
|
|
190
|
-
<Table {...args} aria-label="Expenses">
|
|
191
|
-
<Table.Head>
|
|
192
|
-
<Table.Row>
|
|
193
|
-
<Table.HeaderCell>Category</Table.HeaderCell>
|
|
194
|
-
<Table.HeaderCell>Amount</Table.HeaderCell>
|
|
195
|
-
</Table.Row>
|
|
196
|
-
</Table.Head>
|
|
197
|
-
<Table.Body>
|
|
198
|
-
<Table.Row>
|
|
199
|
-
<Table.Cell>Marketing</Table.Cell>
|
|
200
|
-
<Table.Cell>$12,000</Table.Cell>
|
|
201
|
-
</Table.Row>
|
|
202
|
-
<Table.Row>
|
|
203
|
-
<Table.Cell>Engineering</Table.Cell>
|
|
204
|
-
<Table.Cell>$45,000</Table.Cell>
|
|
205
|
-
</Table.Row>
|
|
206
|
-
<Table.Row>
|
|
207
|
-
<Table.Cell>Operations</Table.Cell>
|
|
208
|
-
<Table.Cell>$8,000</Table.Cell>
|
|
209
|
-
</Table.Row>
|
|
210
|
-
</Table.Body>
|
|
211
|
-
<Table.Footer>
|
|
212
|
-
<Table.Row>
|
|
213
|
-
<Table.Cell>Total</Table.Cell>
|
|
214
|
-
<Table.Cell>$65,000</Table.Cell>
|
|
215
|
-
</Table.Row>
|
|
216
|
-
</Table.Footer>
|
|
217
|
-
</Table>
|
|
218
|
-
),
|
|
219
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { TableOfContents } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* TableOfContents is the canonical in-page navigation primitive — a sticky
|
|
6
|
-
* sidebar of heading links with a continuous hierarchy rail and active-segment
|
|
7
|
-
* highlighting. Use it for docs, long-form content, or filterable grouped
|
|
8
|
-
* lists; agents should compose `TableOfContents.Item`/`TableOfContents.Group`
|
|
9
|
-
* rather than hand-rolling a nav landmark.
|
|
10
|
-
*/
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Navigation/TableOfContents',
|
|
13
|
-
component: TableOfContents,
|
|
14
|
-
tags: ['autodocs', 'canonical'],
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component:
|
|
19
|
-
'Sticky sidebar navigation for long-form content or filterable lists. Prefer this over a hand-rolled in-page nav.',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
title: { control: 'text', description: 'Visible title above the list' },
|
|
25
|
-
label: { control: 'text', description: 'Accessible label for the nav landmark' },
|
|
26
|
-
hideTitle: { control: 'boolean', description: 'Hide the visible title' },
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
title: 'On This Page',
|
|
30
|
-
children: (
|
|
31
|
-
<>
|
|
32
|
-
<TableOfContents.Item id="introduction">Introduction</TableOfContents.Item>
|
|
33
|
-
<TableOfContents.Item id="getting-started">Getting Started</TableOfContents.Item>
|
|
34
|
-
<TableOfContents.Item id="api-reference">API Reference</TableOfContents.Item>
|
|
35
|
-
</>
|
|
36
|
-
),
|
|
37
|
-
},
|
|
38
|
-
} satisfies Meta<typeof TableOfContents>;
|
|
39
|
-
|
|
40
|
-
export default meta;
|
|
41
|
-
|
|
42
|
-
type Story = StoryObj<typeof meta>;
|
|
43
|
-
|
|
44
|
-
export const Default: Story = {
|
|
45
|
-
render: (args) => (
|
|
46
|
-
<TableOfContents {...args}>
|
|
47
|
-
<TableOfContents.Item id="introduction">Introduction</TableOfContents.Item>
|
|
48
|
-
<TableOfContents.Item id="getting-started">Getting Started</TableOfContents.Item>
|
|
49
|
-
<TableOfContents.Item id="installation" indent>
|
|
50
|
-
Installation
|
|
51
|
-
</TableOfContents.Item>
|
|
52
|
-
<TableOfContents.Item id="configuration" indent>
|
|
53
|
-
Configuration
|
|
54
|
-
</TableOfContents.Item>
|
|
55
|
-
<TableOfContents.Item id="api-reference">API Reference</TableOfContents.Item>
|
|
56
|
-
<TableOfContents.Item id="examples">Examples</TableOfContents.Item>
|
|
57
|
-
</TableOfContents>
|
|
58
|
-
),
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const NestedGroups: Story = {
|
|
62
|
-
render: () => (
|
|
63
|
-
<TableOfContents title="Components">
|
|
64
|
-
<TableOfContents.Item id="all" active>
|
|
65
|
-
All
|
|
66
|
-
</TableOfContents.Item>
|
|
67
|
-
<TableOfContents.Group label="Primitives" trailing={<span>3</span>}>
|
|
68
|
-
<TableOfContents.Item id="button">Button</TableOfContents.Item>
|
|
69
|
-
<TableOfContents.Item id="card">Card</TableOfContents.Item>
|
|
70
|
-
<TableOfContents.Item id="input">Input</TableOfContents.Item>
|
|
71
|
-
</TableOfContents.Group>
|
|
72
|
-
<TableOfContents.Group label="Custom" defaultOpen={false}>
|
|
73
|
-
<TableOfContents.Item id="features">Features</TableOfContents.Item>
|
|
74
|
-
<TableOfContents.Item id="plans">Plans</TableOfContents.Item>
|
|
75
|
-
</TableOfContents.Group>
|
|
76
|
-
</TableOfContents>
|
|
77
|
-
),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const WithActiveItem: Story = {
|
|
81
|
-
render: () => (
|
|
82
|
-
<TableOfContents>
|
|
83
|
-
<TableOfContents.Item id="overview">Overview</TableOfContents.Item>
|
|
84
|
-
<TableOfContents.Item id="setup" active>
|
|
85
|
-
Setup
|
|
86
|
-
</TableOfContents.Item>
|
|
87
|
-
<TableOfContents.Item id="usage" indent>
|
|
88
|
-
Basic Usage
|
|
89
|
-
</TableOfContents.Item>
|
|
90
|
-
<TableOfContents.Item id="advanced" indent>
|
|
91
|
-
Advanced
|
|
92
|
-
</TableOfContents.Item>
|
|
93
|
-
<TableOfContents.Item id="props">Props</TableOfContents.Item>
|
|
94
|
-
<TableOfContents.Item id="accessibility">Accessibility</TableOfContents.Item>
|
|
95
|
-
</TableOfContents>
|
|
96
|
-
),
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const CustomTitle: Story = {
|
|
100
|
-
render: () => (
|
|
101
|
-
<TableOfContents title="Contents">
|
|
102
|
-
<TableOfContents.Item id="chapter-1">Chapter 1: The Beginning</TableOfContents.Item>
|
|
103
|
-
<TableOfContents.Item id="chapter-2">Chapter 2: The Middle</TableOfContents.Item>
|
|
104
|
-
<TableOfContents.Item id="chapter-3">Chapter 3: The End</TableOfContents.Item>
|
|
105
|
-
</TableOfContents>
|
|
106
|
-
),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const NoTitle: Story = {
|
|
110
|
-
args: { hideTitle: true },
|
|
111
|
-
render: (args) => (
|
|
112
|
-
<TableOfContents {...args}>
|
|
113
|
-
<TableOfContents.Item id="section-a">Section A</TableOfContents.Item>
|
|
114
|
-
<TableOfContents.Item id="section-b" active>
|
|
115
|
-
Section B
|
|
116
|
-
</TableOfContents.Item>
|
|
117
|
-
<TableOfContents.Item id="section-c">Section C</TableOfContents.Item>
|
|
118
|
-
</TableOfContents>
|
|
119
|
-
),
|
|
120
|
-
};
|