@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,136 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Tabs } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Tabs is the canonical content-switcher primitive. Use it to organize related
|
|
6
|
-
* content into navigable panels — agents should compose
|
|
7
|
-
* `Tabs.List`/`Tabs.Tab`/`Tabs.Panel` rather than hand-rolling a tab control
|
|
8
|
-
* with manual focus management.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Navigation/Tabs',
|
|
12
|
-
component: Tabs,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Organize content into switchable panels following the WAI-ARIA tabs pattern. Prefer this over a hand-rolled tab control.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
variant: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['underline', 'pills'],
|
|
26
|
-
description: 'Default visual style for Tabs.List',
|
|
27
|
-
},
|
|
28
|
-
orientation: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['horizontal', 'vertical'],
|
|
31
|
-
description: 'Tab list orientation',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
args: {
|
|
35
|
-
variant: 'underline',
|
|
36
|
-
orientation: 'horizontal',
|
|
37
|
-
defaultValue: 'overview',
|
|
38
|
-
children: (
|
|
39
|
-
<>
|
|
40
|
-
<Tabs.List>
|
|
41
|
-
<Tabs.Tab value="overview">Overview</Tabs.Tab>
|
|
42
|
-
<Tabs.Tab value="analytics">Analytics</Tabs.Tab>
|
|
43
|
-
</Tabs.List>
|
|
44
|
-
<Tabs.Panel value="overview">
|
|
45
|
-
<p>Overview content goes here.</p>
|
|
46
|
-
</Tabs.Panel>
|
|
47
|
-
<Tabs.Panel value="analytics">
|
|
48
|
-
<p>Analytics content goes here.</p>
|
|
49
|
-
</Tabs.Panel>
|
|
50
|
-
</>
|
|
51
|
-
),
|
|
52
|
-
},
|
|
53
|
-
} satisfies Meta<typeof Tabs>;
|
|
54
|
-
|
|
55
|
-
export default meta;
|
|
56
|
-
|
|
57
|
-
type Story = StoryObj<typeof meta>;
|
|
58
|
-
|
|
59
|
-
export const Underline: Story = {
|
|
60
|
-
render: () => (
|
|
61
|
-
<Tabs defaultValue="overview" variant="underline">
|
|
62
|
-
<Tabs.List>
|
|
63
|
-
<Tabs.Tab value="overview">Overview</Tabs.Tab>
|
|
64
|
-
<Tabs.Tab value="analytics">Analytics</Tabs.Tab>
|
|
65
|
-
<Tabs.Tab value="settings">Settings</Tabs.Tab>
|
|
66
|
-
</Tabs.List>
|
|
67
|
-
<Tabs.Panel value="overview">
|
|
68
|
-
<p>Overview content goes here.</p>
|
|
69
|
-
</Tabs.Panel>
|
|
70
|
-
<Tabs.Panel value="analytics">
|
|
71
|
-
<p>Analytics content goes here.</p>
|
|
72
|
-
</Tabs.Panel>
|
|
73
|
-
<Tabs.Panel value="settings">
|
|
74
|
-
<p>Settings content goes here.</p>
|
|
75
|
-
</Tabs.Panel>
|
|
76
|
-
</Tabs>
|
|
77
|
-
),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Pills: Story = {
|
|
81
|
-
render: () => (
|
|
82
|
-
<Tabs defaultValue="all" variant="pills">
|
|
83
|
-
<Tabs.List>
|
|
84
|
-
<Tabs.Tab value="all">All</Tabs.Tab>
|
|
85
|
-
<Tabs.Tab value="active">Active</Tabs.Tab>
|
|
86
|
-
<Tabs.Tab value="archived">Archived</Tabs.Tab>
|
|
87
|
-
</Tabs.List>
|
|
88
|
-
<Tabs.Panel value="all">
|
|
89
|
-
<p>Showing all items.</p>
|
|
90
|
-
</Tabs.Panel>
|
|
91
|
-
<Tabs.Panel value="active">
|
|
92
|
-
<p>Showing active items only.</p>
|
|
93
|
-
</Tabs.Panel>
|
|
94
|
-
<Tabs.Panel value="archived">
|
|
95
|
-
<p>Showing archived items.</p>
|
|
96
|
-
</Tabs.Panel>
|
|
97
|
-
</Tabs>
|
|
98
|
-
),
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export const WithDisabled: Story = {
|
|
102
|
-
render: () => (
|
|
103
|
-
<Tabs defaultValue="general" variant="underline">
|
|
104
|
-
<Tabs.List>
|
|
105
|
-
<Tabs.Tab value="general">General</Tabs.Tab>
|
|
106
|
-
<Tabs.Tab value="security">Security</Tabs.Tab>
|
|
107
|
-
<Tabs.Tab value="billing" disabled>
|
|
108
|
-
Billing
|
|
109
|
-
</Tabs.Tab>
|
|
110
|
-
</Tabs.List>
|
|
111
|
-
<Tabs.Panel value="general">
|
|
112
|
-
<p>General settings panel.</p>
|
|
113
|
-
</Tabs.Panel>
|
|
114
|
-
<Tabs.Panel value="security">
|
|
115
|
-
<p>Security settings panel.</p>
|
|
116
|
-
</Tabs.Panel>
|
|
117
|
-
</Tabs>
|
|
118
|
-
),
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const ListVariantOverride: Story = {
|
|
122
|
-
render: () => (
|
|
123
|
-
<Tabs defaultValue="overview" variant="pills">
|
|
124
|
-
<Tabs.List variant="underline">
|
|
125
|
-
<Tabs.Tab value="overview">Overview</Tabs.Tab>
|
|
126
|
-
<Tabs.Tab value="activity">Activity</Tabs.Tab>
|
|
127
|
-
</Tabs.List>
|
|
128
|
-
<Tabs.Panel value="overview">
|
|
129
|
-
<p>Root sets pills, but this list overrides to underline.</p>
|
|
130
|
-
</Tabs.Panel>
|
|
131
|
-
<Tabs.Panel value="activity">
|
|
132
|
-
<p>Per-list variant override example.</p>
|
|
133
|
-
</Tabs.Panel>
|
|
134
|
-
</Tabs>
|
|
135
|
-
),
|
|
136
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Text } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Text is the canonical typography primitive. Every heading, paragraph, label,
|
|
6
|
-
* and inline string in the design system routes through it for consistent size,
|
|
7
|
-
* weight, color, and font — agents should reuse it rather than styling raw
|
|
8
|
-
* `<p>`/`<span>`/`<h1>` elements by hand.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Display/Text',
|
|
12
|
-
component: Text,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Typography component for rendering text with consistent styling and semantic elements. Prefer this over raw <p>, <span>, or heading tags.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
as: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: [
|
|
26
|
-
'h1',
|
|
27
|
-
'h2',
|
|
28
|
-
'h3',
|
|
29
|
-
'h4',
|
|
30
|
-
'h5',
|
|
31
|
-
'h6',
|
|
32
|
-
'p',
|
|
33
|
-
'span',
|
|
34
|
-
'label',
|
|
35
|
-
'div',
|
|
36
|
-
'strong',
|
|
37
|
-
'em',
|
|
38
|
-
'small',
|
|
39
|
-
'mark',
|
|
40
|
-
'del',
|
|
41
|
-
'ins',
|
|
42
|
-
'sub',
|
|
43
|
-
'sup',
|
|
44
|
-
'time',
|
|
45
|
-
'address',
|
|
46
|
-
'blockquote',
|
|
47
|
-
'cite',
|
|
48
|
-
'code',
|
|
49
|
-
'abbr',
|
|
50
|
-
],
|
|
51
|
-
description: 'HTML element to render',
|
|
52
|
-
},
|
|
53
|
-
variant: {
|
|
54
|
-
control: 'select',
|
|
55
|
-
options: ['section-label'],
|
|
56
|
-
description: 'Preset text variant',
|
|
57
|
-
},
|
|
58
|
-
size: {
|
|
59
|
-
control: 'select',
|
|
60
|
-
options: ['2xs', 'xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', '4xl'],
|
|
61
|
-
description: 'Font size',
|
|
62
|
-
},
|
|
63
|
-
weight: {
|
|
64
|
-
control: 'select',
|
|
65
|
-
options: ['normal', 'medium', 'semibold', 'bold'],
|
|
66
|
-
description: 'Font weight',
|
|
67
|
-
},
|
|
68
|
-
color: {
|
|
69
|
-
control: 'select',
|
|
70
|
-
options: ['primary', 'secondary', 'tertiary', 'muted'],
|
|
71
|
-
description: 'Text color (muted is an alias for tertiary)',
|
|
72
|
-
},
|
|
73
|
-
font: {
|
|
74
|
-
control: 'select',
|
|
75
|
-
options: ['sans', 'mono'],
|
|
76
|
-
description: 'Font family',
|
|
77
|
-
},
|
|
78
|
-
truncate: { control: 'boolean', description: 'Truncate with ellipsis on overflow' },
|
|
79
|
-
},
|
|
80
|
-
args: {
|
|
81
|
-
children: 'The quick brown fox jumps over the lazy dog',
|
|
82
|
-
size: 'md',
|
|
83
|
-
weight: 'normal',
|
|
84
|
-
color: 'primary',
|
|
85
|
-
},
|
|
86
|
-
} satisfies Meta<typeof Text>;
|
|
87
|
-
|
|
88
|
-
export default meta;
|
|
89
|
-
|
|
90
|
-
type Story = StoryObj<typeof meta>;
|
|
91
|
-
|
|
92
|
-
export const Default: Story = {
|
|
93
|
-
args: { children: 'The quick brown fox jumps over the lazy dog' },
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const Heading: Story = {
|
|
97
|
-
args: { as: 'h1', size: '3xl', weight: 'semibold', children: 'Page title' },
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const Paragraph: Story = {
|
|
101
|
-
args: {
|
|
102
|
-
as: 'p',
|
|
103
|
-
size: 'md',
|
|
104
|
-
color: 'secondary',
|
|
105
|
-
children:
|
|
106
|
-
'This is a paragraph of body text that demonstrates the Text component using a semantic paragraph element.',
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export const SectionLabel: Story = {
|
|
111
|
-
args: { as: 'p', variant: 'section-label', children: 'On This Page' },
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const Bold: Story = {
|
|
115
|
-
args: { weight: 'bold', children: 'Bold weight text' },
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const Secondary: Story = {
|
|
119
|
-
args: { color: 'secondary', children: 'Secondary color text' },
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const Monospace: Story = {
|
|
123
|
-
args: { font: 'mono', size: 'sm', children: 'npm install @usefragments/ui' },
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const Truncated: Story = {
|
|
127
|
-
args: {
|
|
128
|
-
truncate: true,
|
|
129
|
-
style: { display: 'block', maxWidth: '200px' },
|
|
130
|
-
children:
|
|
131
|
-
'This is a very long text that will be truncated with an ellipsis when it overflows the container.',
|
|
132
|
-
},
|
|
133
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Textarea } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Textarea is the canonical multi-line text input. Use it for comments,
|
|
6
|
-
* descriptions, bios, and message composition — agents should reuse it (with
|
|
7
|
-
* its built-in label, helper text, validation states, and character counter)
|
|
8
|
-
* rather than styling a raw `<textarea>`.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Forms/Textarea',
|
|
12
|
-
component: Textarea,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Multi-line text input for longer form content with label, helper text, and validation states. Prefer this over a raw <textarea>.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
size: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['sm', 'md', 'lg'],
|
|
26
|
-
description: 'Size variant',
|
|
27
|
-
},
|
|
28
|
-
resize: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['none', 'vertical', 'horizontal', 'both'],
|
|
31
|
-
description: 'Resize behavior',
|
|
32
|
-
},
|
|
33
|
-
disabled: { control: 'boolean', description: 'Disabled state' },
|
|
34
|
-
error: { control: 'boolean', description: 'Error state' },
|
|
35
|
-
success: { control: 'boolean', description: 'Show success/validated styling' },
|
|
36
|
-
showCharCount: {
|
|
37
|
-
control: 'boolean',
|
|
38
|
-
description: 'Show character counter when maxLength is set',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
args: {
|
|
42
|
-
label: 'Description',
|
|
43
|
-
placeholder: 'Enter a description...',
|
|
44
|
-
size: 'md',
|
|
45
|
-
rows: 3,
|
|
46
|
-
},
|
|
47
|
-
} satisfies Meta<typeof Textarea>;
|
|
48
|
-
|
|
49
|
-
export default meta;
|
|
50
|
-
|
|
51
|
-
type Story = StoryObj<typeof meta>;
|
|
52
|
-
|
|
53
|
-
export const Default: Story = {
|
|
54
|
-
args: { label: 'Description', placeholder: 'Enter a description...' },
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const WithHelperText: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
label: 'Bio',
|
|
60
|
-
placeholder: 'Tell us about yourself...',
|
|
61
|
-
helperText: 'Max 500 characters',
|
|
62
|
-
maxLength: 500,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const ErrorState: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
label: 'Comments',
|
|
69
|
-
placeholder: 'Add your comments...',
|
|
70
|
-
error: true,
|
|
71
|
-
helperText: 'This field is required',
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const SuccessState: Story = {
|
|
76
|
-
args: {
|
|
77
|
-
label: 'Bio',
|
|
78
|
-
defaultValue: 'A short bio about myself.',
|
|
79
|
-
success: true,
|
|
80
|
-
helperText: 'Looks great!',
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const Disabled: Story = {
|
|
85
|
-
args: { label: 'Notes', placeholder: 'Cannot edit...', disabled: true },
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const CustomRows: Story = {
|
|
89
|
-
args: {
|
|
90
|
-
label: 'Long Description',
|
|
91
|
-
placeholder: 'Enter detailed information...',
|
|
92
|
-
rows: 6,
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const WithCharacterCounter: Story = {
|
|
97
|
-
args: {
|
|
98
|
-
label: 'Bio',
|
|
99
|
-
placeholder: 'Tell us about yourself...',
|
|
100
|
-
maxLength: 200,
|
|
101
|
-
showCharCount: true,
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const Large: Story = {
|
|
106
|
-
args: { label: 'Large', size: 'lg', placeholder: 'Large textarea' },
|
|
107
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ThemeProvider, ThemeToggle } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ThemeProvider is the canonical theme-management primitive. Wrap your app with
|
|
6
|
-
* it once at the root to supply light/dark/system mode via CSS custom
|
|
7
|
-
* properties, with localStorage persistence — agents should use it (paired with
|
|
8
|
-
* `useTheme` and `ThemeToggle`) rather than wiring up bespoke theme state.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Navigation/ThemeProvider',
|
|
12
|
-
component: ThemeProvider,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Theme context provider supporting light, dark, and system modes with localStorage persistence. Prefer this over hand-rolled theme state.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
defaultMode: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['light', 'dark', 'system'],
|
|
26
|
-
description: 'Default theme mode for uncontrolled usage',
|
|
27
|
-
},
|
|
28
|
-
mode: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['light', 'dark', 'system'],
|
|
31
|
-
description: 'Controlled theme mode',
|
|
32
|
-
},
|
|
33
|
-
attribute: {
|
|
34
|
-
control: 'select',
|
|
35
|
-
options: ['data-theme', 'class'],
|
|
36
|
-
description: 'How to apply the theme to the DOM',
|
|
37
|
-
},
|
|
38
|
-
storageKey: { control: 'text', description: 'localStorage key for persistence' },
|
|
39
|
-
},
|
|
40
|
-
args: {
|
|
41
|
-
defaultMode: 'system',
|
|
42
|
-
children: (
|
|
43
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
|
|
44
|
-
<ThemeToggle />
|
|
45
|
-
<span>Click to cycle themes</span>
|
|
46
|
-
</div>
|
|
47
|
-
),
|
|
48
|
-
},
|
|
49
|
-
} satisfies Meta<typeof ThemeProvider>;
|
|
50
|
-
|
|
51
|
-
export default meta;
|
|
52
|
-
|
|
53
|
-
type Story = StoryObj<typeof meta>;
|
|
54
|
-
|
|
55
|
-
export const Default: Story = {
|
|
56
|
-
render: (args) => (
|
|
57
|
-
<ThemeProvider {...args}>
|
|
58
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
|
|
59
|
-
<ThemeToggle />
|
|
60
|
-
<span>Click to cycle themes</span>
|
|
61
|
-
</div>
|
|
62
|
-
</ThemeProvider>
|
|
63
|
-
),
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const WithToggle: Story = {
|
|
67
|
-
args: { defaultMode: 'light' },
|
|
68
|
-
render: (args) => (
|
|
69
|
-
<ThemeProvider {...args}>
|
|
70
|
-
<ThemeToggle />
|
|
71
|
-
</ThemeProvider>
|
|
72
|
-
),
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const ToggleSizes: Story = {
|
|
76
|
-
args: { defaultMode: 'light' },
|
|
77
|
-
render: (args) => (
|
|
78
|
-
<ThemeProvider {...args}>
|
|
79
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
|
|
80
|
-
<ThemeToggle size="sm" />
|
|
81
|
-
<ThemeToggle size="md" />
|
|
82
|
-
<ThemeToggle size="lg" />
|
|
83
|
-
</div>
|
|
84
|
-
</ThemeProvider>
|
|
85
|
-
),
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const DarkDefault: Story = {
|
|
89
|
-
args: { defaultMode: 'dark' },
|
|
90
|
-
render: (args) => (
|
|
91
|
-
<ThemeProvider {...args}>
|
|
92
|
-
<ThemeToggle showSystem />
|
|
93
|
-
</ThemeProvider>
|
|
94
|
-
),
|
|
95
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ThinkingIndicator } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ThinkingIndicator is the canonical AI-processing indicator. Use it to show
|
|
6
|
-
* that an assistant is working — animated dots/pulse/spinner, optional elapsed
|
|
7
|
-
* time, and multi-step progress — and prefer it over a generic spinner whenever
|
|
8
|
-
* the wait is driven by an AI request.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Ai/ThinkingIndicator',
|
|
12
|
-
component: ThinkingIndicator,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Animated indicator showing AI is processing, with optional elapsed time and multi-step progress. Prefer this over a generic spinner for AI operations.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
variant: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['dots', 'pulse', 'spinner'],
|
|
26
|
-
description: 'Animation style',
|
|
27
|
-
},
|
|
28
|
-
active: { control: 'boolean', description: 'Whether the indicator is visible' },
|
|
29
|
-
showElapsed: { control: 'boolean', description: 'Show elapsed time' },
|
|
30
|
-
label: { control: 'text', description: 'Status text' },
|
|
31
|
-
},
|
|
32
|
-
args: {
|
|
33
|
-
variant: 'dots',
|
|
34
|
-
label: 'Thinking...',
|
|
35
|
-
active: true,
|
|
36
|
-
},
|
|
37
|
-
} satisfies Meta<typeof ThinkingIndicator>;
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
|
|
41
|
-
type Story = StoryObj<typeof meta>;
|
|
42
|
-
|
|
43
|
-
export const Dots: Story = {
|
|
44
|
-
args: { variant: 'dots', label: 'Thinking...' },
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Pulse: Story = {
|
|
48
|
-
args: { variant: 'pulse', label: 'Processing...' },
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Spinner: Story = {
|
|
52
|
-
args: { variant: 'spinner', label: 'Loading...' },
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const WithElapsedTime: Story = {
|
|
56
|
-
args: { variant: 'dots', label: 'Generating response...', showElapsed: true },
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const CustomLabel: Story = {
|
|
60
|
-
args: { variant: 'dots', label: 'Claude is writing code...' },
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const MultiStepProgress: Story = {
|
|
64
|
-
args: {
|
|
65
|
-
variant: 'spinner',
|
|
66
|
-
label: 'Working...',
|
|
67
|
-
steps: [
|
|
68
|
-
{ id: '1', label: 'Analyzing request', status: 'complete' },
|
|
69
|
-
{ id: '2', label: 'Searching knowledge base', status: 'active' },
|
|
70
|
-
{ id: '3', label: 'Generating response', status: 'pending' },
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const WithErrorStep: Story = {
|
|
76
|
-
args: {
|
|
77
|
-
variant: 'spinner',
|
|
78
|
-
label: 'Retrying...',
|
|
79
|
-
steps: [
|
|
80
|
-
{ id: '1', label: 'Connecting to API', status: 'complete' },
|
|
81
|
-
{ id: '2', label: 'Fetching data', status: 'error' },
|
|
82
|
-
{ id: '3', label: 'Retrying with fallback', status: 'active' },
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Toast } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Toast is the canonical transient-notification primitive. Use it for brief,
|
|
6
|
-
* non-blocking feedback after an action (saved, deleted, failed). In an app,
|
|
7
|
-
* wrap the tree in `Toast.Provider` and dispatch via `useToast()`; agents
|
|
8
|
-
* should reuse this rather than hand-rolling a notification component.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Feedback/Toast',
|
|
12
|
-
component: Toast,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Brief, non-blocking notification messages. Prefer this (via Toast.Provider + useToast) over a hand-rolled notification system.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
variant: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['default', 'success', 'error', 'warning', 'info'],
|
|
26
|
-
description: 'Visual variant indicating message type',
|
|
27
|
-
},
|
|
28
|
-
title: { control: 'text', description: 'Toast title' },
|
|
29
|
-
description: { control: 'text', description: 'Additional message content' },
|
|
30
|
-
duration: {
|
|
31
|
-
control: 'number',
|
|
32
|
-
description: 'Auto-dismiss duration in ms (0 = no auto-dismiss)',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
args: {
|
|
36
|
-
title: 'Notification',
|
|
37
|
-
description: 'This is a toast message.',
|
|
38
|
-
variant: 'default',
|
|
39
|
-
},
|
|
40
|
-
} satisfies Meta<typeof Toast>;
|
|
41
|
-
|
|
42
|
-
export default meta;
|
|
43
|
-
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
export const Default: Story = {
|
|
47
|
-
args: { title: 'Heads up', description: 'Something just happened.', variant: 'default' },
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const Success: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
title: 'Success!',
|
|
53
|
-
description: 'Your changes have been saved.',
|
|
54
|
-
variant: 'success',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Error: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
title: 'Error',
|
|
61
|
-
description: 'Failed to save changes. Please try again.',
|
|
62
|
-
variant: 'error',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Warning: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
title: 'Warning',
|
|
69
|
-
description: 'This action cannot be undone.',
|
|
70
|
-
variant: 'warning',
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const Info: Story = {
|
|
75
|
-
args: {
|
|
76
|
-
title: 'New Update',
|
|
77
|
-
description: 'Version 2.0 is now available.',
|
|
78
|
-
variant: 'info',
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const WithAction: Story = {
|
|
83
|
-
args: {
|
|
84
|
-
title: 'File deleted',
|
|
85
|
-
description: 'The file has been moved to trash.',
|
|
86
|
-
action: {
|
|
87
|
-
label: 'Undo',
|
|
88
|
-
onClick: () => {},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
};
|