@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,116 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Fieldset } from '.';
|
|
3
|
-
import { Field } from '../Field';
|
|
4
|
-
import { Input } from '../Input';
|
|
5
|
-
import { Grid } from '../Grid';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Fieldset groups related form fields with an accessible legend. It is a
|
|
9
|
-
* compound component: compose Fieldset.Legend and Fieldset.Description inside
|
|
10
|
-
* the root, alongside the grouped Field components.
|
|
11
|
-
*/
|
|
12
|
-
const meta = {
|
|
13
|
-
title: 'Forms/Fieldset',
|
|
14
|
-
component: Fieldset,
|
|
15
|
-
tags: ['autodocs'],
|
|
16
|
-
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
description: {
|
|
19
|
-
component:
|
|
20
|
-
'Groups related form fields with an accessible legend.',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
argTypes: {
|
|
25
|
-
disabled: {
|
|
26
|
-
control: 'boolean',
|
|
27
|
-
description: 'Disables all fields within the fieldset',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
args: {
|
|
31
|
-
children: (
|
|
32
|
-
<>
|
|
33
|
-
<Fieldset.Legend>Personal Information</Fieldset.Legend>
|
|
34
|
-
<Field name="firstName">
|
|
35
|
-
<Field.Label>First Name</Field.Label>
|
|
36
|
-
<Field.Control>
|
|
37
|
-
<Input placeholder="Jane" />
|
|
38
|
-
</Field.Control>
|
|
39
|
-
</Field>
|
|
40
|
-
</>
|
|
41
|
-
),
|
|
42
|
-
},
|
|
43
|
-
} satisfies Meta<typeof Fieldset>;
|
|
44
|
-
|
|
45
|
-
export default meta;
|
|
46
|
-
|
|
47
|
-
type Story = StoryObj<typeof meta>;
|
|
48
|
-
|
|
49
|
-
export const TwoColumnLayout: Story = {
|
|
50
|
-
render: () => (
|
|
51
|
-
<Fieldset>
|
|
52
|
-
<Fieldset.Legend>Personal Information</Fieldset.Legend>
|
|
53
|
-
<Grid columns={2} gap="md">
|
|
54
|
-
<Field name="firstName">
|
|
55
|
-
<Field.Label>First Name</Field.Label>
|
|
56
|
-
<Field.Control>
|
|
57
|
-
<Input placeholder="Jane" />
|
|
58
|
-
</Field.Control>
|
|
59
|
-
</Field>
|
|
60
|
-
<Field name="lastName">
|
|
61
|
-
<Field.Label>Last Name</Field.Label>
|
|
62
|
-
<Field.Control>
|
|
63
|
-
<Input placeholder="Doe" />
|
|
64
|
-
</Field.Control>
|
|
65
|
-
</Field>
|
|
66
|
-
<Grid.Item colSpan="full">
|
|
67
|
-
<Field name="email">
|
|
68
|
-
<Field.Label>Email</Field.Label>
|
|
69
|
-
<Field.Control>
|
|
70
|
-
<Input type="email" placeholder="jane@example.com" />
|
|
71
|
-
</Field.Control>
|
|
72
|
-
</Field>
|
|
73
|
-
</Grid.Item>
|
|
74
|
-
</Grid>
|
|
75
|
-
</Fieldset>
|
|
76
|
-
),
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const WithDescription: Story = {
|
|
80
|
-
render: () => (
|
|
81
|
-
<Fieldset>
|
|
82
|
-
<Fieldset.Legend>Account Details</Fieldset.Legend>
|
|
83
|
-
<Fieldset.Description>
|
|
84
|
-
Choose how others will see you on the platform.
|
|
85
|
-
</Fieldset.Description>
|
|
86
|
-
<Field name="displayName">
|
|
87
|
-
<Field.Label>Display Name</Field.Label>
|
|
88
|
-
<Field.Control>
|
|
89
|
-
<Input placeholder="How others see you" />
|
|
90
|
-
</Field.Control>
|
|
91
|
-
</Field>
|
|
92
|
-
</Fieldset>
|
|
93
|
-
),
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const Disabled: Story = {
|
|
97
|
-
render: () => (
|
|
98
|
-
<Fieldset disabled>
|
|
99
|
-
<Fieldset.Legend>Locked Section</Fieldset.Legend>
|
|
100
|
-
<Grid columns={2} gap="md">
|
|
101
|
-
<Field name="lockedFirst">
|
|
102
|
-
<Field.Label>First Name</Field.Label>
|
|
103
|
-
<Field.Control>
|
|
104
|
-
<Input defaultValue="Jane" />
|
|
105
|
-
</Field.Control>
|
|
106
|
-
</Field>
|
|
107
|
-
<Field name="lockedLast">
|
|
108
|
-
<Field.Label>Last Name</Field.Label>
|
|
109
|
-
<Field.Control>
|
|
110
|
-
<Input defaultValue="Doe" />
|
|
111
|
-
</Field.Control>
|
|
112
|
-
</Field>
|
|
113
|
-
</Grid>
|
|
114
|
-
</Fieldset>
|
|
115
|
-
),
|
|
116
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Form } from '.';
|
|
3
|
-
import { Field } from '../Field';
|
|
4
|
-
import { Input } from '../Input';
|
|
5
|
-
import { Grid } from '../Grid';
|
|
6
|
-
import { Button } from '../Button';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Form is a wrapper that handles server-side error distribution to Field
|
|
10
|
-
* components by field name. It pairs with Field and Fieldset for complete form
|
|
11
|
-
* validation, and renders a semantic form element.
|
|
12
|
-
*/
|
|
13
|
-
const meta = {
|
|
14
|
-
title: 'Forms/Form',
|
|
15
|
-
component: Form,
|
|
16
|
-
tags: ['autodocs'],
|
|
17
|
-
parameters: {
|
|
18
|
-
docs: {
|
|
19
|
-
description: {
|
|
20
|
-
component:
|
|
21
|
-
'Form wrapper that distributes server-side errors to Field components.',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
argTypes: {
|
|
26
|
-
validationMode: {
|
|
27
|
-
control: 'select',
|
|
28
|
-
options: ['onSubmit', 'onBlur', 'onChange'],
|
|
29
|
-
description: 'When field validation should run',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
args: {
|
|
33
|
-
children: (
|
|
34
|
-
<Grid columns={1} gap="md">
|
|
35
|
-
<Field name="email">
|
|
36
|
-
<Field.Label>Email</Field.Label>
|
|
37
|
-
<Field.Control>
|
|
38
|
-
<Input type="email" placeholder="jane@example.com" />
|
|
39
|
-
</Field.Control>
|
|
40
|
-
</Field>
|
|
41
|
-
<Button type="submit" variant="primary">
|
|
42
|
-
Submit
|
|
43
|
-
</Button>
|
|
44
|
-
</Grid>
|
|
45
|
-
),
|
|
46
|
-
},
|
|
47
|
-
} satisfies Meta<typeof Form>;
|
|
48
|
-
|
|
49
|
-
export default meta;
|
|
50
|
-
|
|
51
|
-
type Story = StoryObj<typeof meta>;
|
|
52
|
-
|
|
53
|
-
export const SignUp: Story = {
|
|
54
|
-
render: () => (
|
|
55
|
-
<Form onSubmit={(e) => e.preventDefault()}>
|
|
56
|
-
<Grid columns={2} gap="md">
|
|
57
|
-
<Field name="firstName">
|
|
58
|
-
<Field.Label>First Name</Field.Label>
|
|
59
|
-
<Field.Control>
|
|
60
|
-
<Input placeholder="Jane" />
|
|
61
|
-
</Field.Control>
|
|
62
|
-
</Field>
|
|
63
|
-
<Field name="lastName">
|
|
64
|
-
<Field.Label>Last Name</Field.Label>
|
|
65
|
-
<Field.Control>
|
|
66
|
-
<Input placeholder="Doe" />
|
|
67
|
-
</Field.Control>
|
|
68
|
-
</Field>
|
|
69
|
-
<Grid.Item colSpan="full">
|
|
70
|
-
<Field name="email">
|
|
71
|
-
<Field.Label>Email</Field.Label>
|
|
72
|
-
<Field.Control>
|
|
73
|
-
<Input type="email" placeholder="jane@example.com" />
|
|
74
|
-
</Field.Control>
|
|
75
|
-
<Field.Error match="typeMismatch">
|
|
76
|
-
Enter a valid email address
|
|
77
|
-
</Field.Error>
|
|
78
|
-
</Field>
|
|
79
|
-
</Grid.Item>
|
|
80
|
-
<Grid.Item colSpan="full">
|
|
81
|
-
<Button type="submit" variant="primary">
|
|
82
|
-
Create Account
|
|
83
|
-
</Button>
|
|
84
|
-
</Grid.Item>
|
|
85
|
-
</Grid>
|
|
86
|
-
</Form>
|
|
87
|
-
),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const WithServerErrors: Story = {
|
|
91
|
-
render: () => (
|
|
92
|
-
<Form
|
|
93
|
-
errors={{
|
|
94
|
-
username: 'Username is already taken',
|
|
95
|
-
email: 'Email is already registered',
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
<Grid columns={2} gap="md">
|
|
99
|
-
<Field name="username">
|
|
100
|
-
<Field.Label>Username</Field.Label>
|
|
101
|
-
<Field.Control>
|
|
102
|
-
<Input defaultValue="janedoe" />
|
|
103
|
-
</Field.Control>
|
|
104
|
-
<Field.Error match="customError" />
|
|
105
|
-
</Field>
|
|
106
|
-
<Field name="email">
|
|
107
|
-
<Field.Label>Email</Field.Label>
|
|
108
|
-
<Field.Control>
|
|
109
|
-
<Input type="email" defaultValue="jane@example.com" />
|
|
110
|
-
</Field.Control>
|
|
111
|
-
<Field.Error match="customError" />
|
|
112
|
-
</Field>
|
|
113
|
-
<Grid.Item colSpan="full">
|
|
114
|
-
<Button type="submit" variant="primary">
|
|
115
|
-
Submit
|
|
116
|
-
</Button>
|
|
117
|
-
</Grid.Item>
|
|
118
|
-
</Grid>
|
|
119
|
-
</Form>
|
|
120
|
-
),
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const ValidateOnBlur: Story = {
|
|
124
|
-
render: () => (
|
|
125
|
-
<Form validationMode="onBlur" onSubmit={(e) => e.preventDefault()}>
|
|
126
|
-
<Grid columns={1} gap="md">
|
|
127
|
-
<Field name="email">
|
|
128
|
-
<Field.Label>Email</Field.Label>
|
|
129
|
-
<Field.Control>
|
|
130
|
-
<Input type="email" placeholder="you@example.com" />
|
|
131
|
-
</Field.Control>
|
|
132
|
-
<Field.Error match="typeMismatch">
|
|
133
|
-
Enter a valid email address
|
|
134
|
-
</Field.Error>
|
|
135
|
-
</Field>
|
|
136
|
-
<Button type="submit" variant="primary">
|
|
137
|
-
Submit
|
|
138
|
-
</Button>
|
|
139
|
-
</Grid>
|
|
140
|
-
</Form>
|
|
141
|
-
),
|
|
142
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import type { CSSProperties } from 'react';
|
|
3
|
-
import { Grid } from '.';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Grid is a responsive CSS Grid layout for arranging items in columns with
|
|
7
|
-
* consistent spacing. Columns accept a fixed number (1-12), a responsive
|
|
8
|
-
* object, or "auto" for auto-fill. Use Grid.Item with colSpan for asymmetric
|
|
9
|
-
* layouts.
|
|
10
|
-
*/
|
|
11
|
-
const cell: CSSProperties = {
|
|
12
|
-
padding: 'var(--fui-space-2, 0.5rem)',
|
|
13
|
-
background: 'var(--fui-bg-secondary, #f4f4f5)',
|
|
14
|
-
borderRadius: 'var(--fui-radius-sm, 4px)',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const meta = {
|
|
18
|
-
title: 'Layout/Grid',
|
|
19
|
-
component: Grid,
|
|
20
|
-
tags: ['autodocs', 'canonical'],
|
|
21
|
-
parameters: {
|
|
22
|
-
docs: {
|
|
23
|
-
description: {
|
|
24
|
-
component:
|
|
25
|
-
'Responsive grid layout for arranging items in columns with consistent spacing.',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
argTypes: {
|
|
30
|
-
gap: {
|
|
31
|
-
control: 'select',
|
|
32
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
33
|
-
description: 'Gap between grid items',
|
|
34
|
-
},
|
|
35
|
-
alignItems: {
|
|
36
|
-
control: 'select',
|
|
37
|
-
options: ['start', 'center', 'end', 'stretch'],
|
|
38
|
-
description: 'Vertical alignment of items within their cells',
|
|
39
|
-
},
|
|
40
|
-
justifyItems: {
|
|
41
|
-
control: 'select',
|
|
42
|
-
options: ['start', 'center', 'end', 'stretch'],
|
|
43
|
-
description: 'Horizontal alignment of items within their cells',
|
|
44
|
-
},
|
|
45
|
-
padding: {
|
|
46
|
-
control: 'select',
|
|
47
|
-
options: ['none', 'sm', 'md', 'lg'],
|
|
48
|
-
description: 'Internal padding of the grid container',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
args: {
|
|
52
|
-
columns: 3,
|
|
53
|
-
gap: 'md',
|
|
54
|
-
children: (
|
|
55
|
-
<>
|
|
56
|
-
<div style={cell}>Item 1</div>
|
|
57
|
-
<div style={cell}>Item 2</div>
|
|
58
|
-
<div style={cell}>Item 3</div>
|
|
59
|
-
</>
|
|
60
|
-
),
|
|
61
|
-
},
|
|
62
|
-
} satisfies Meta<typeof Grid>;
|
|
63
|
-
|
|
64
|
-
export default meta;
|
|
65
|
-
|
|
66
|
-
type Story = StoryObj<typeof meta>;
|
|
67
|
-
|
|
68
|
-
export const Default: Story = {
|
|
69
|
-
args: {
|
|
70
|
-
columns: 3,
|
|
71
|
-
gap: 'md',
|
|
72
|
-
children: (
|
|
73
|
-
<>
|
|
74
|
-
<div style={cell}>Item 1</div>
|
|
75
|
-
<div style={cell}>Item 2</div>
|
|
76
|
-
<div style={cell}>Item 3</div>
|
|
77
|
-
</>
|
|
78
|
-
),
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const Responsive: Story = {
|
|
83
|
-
args: {
|
|
84
|
-
columns: { base: 1, md: 2, lg: 3 },
|
|
85
|
-
gap: 'md',
|
|
86
|
-
children: (
|
|
87
|
-
<>
|
|
88
|
-
<div style={cell}>Card 1</div>
|
|
89
|
-
<div style={cell}>Card 2</div>
|
|
90
|
-
<div style={cell}>Card 3</div>
|
|
91
|
-
</>
|
|
92
|
-
),
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const AutoFill: Story = {
|
|
97
|
-
args: {
|
|
98
|
-
columns: 'auto',
|
|
99
|
-
minChildWidth: '12rem',
|
|
100
|
-
gap: 'md',
|
|
101
|
-
children: (
|
|
102
|
-
<>
|
|
103
|
-
<div style={cell}>Card 1</div>
|
|
104
|
-
<div style={cell}>Card 2</div>
|
|
105
|
-
<div style={cell}>Card 3</div>
|
|
106
|
-
<div style={cell}>Card 4</div>
|
|
107
|
-
</>
|
|
108
|
-
),
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const WithSpanning: Story = {
|
|
113
|
-
render: () => (
|
|
114
|
-
<Grid columns={4} gap="md">
|
|
115
|
-
<Grid.Item colSpan={2}>
|
|
116
|
-
<div style={cell}>Spans 2 cols</div>
|
|
117
|
-
</Grid.Item>
|
|
118
|
-
<div style={cell}>1 col</div>
|
|
119
|
-
<div style={cell}>1 col</div>
|
|
120
|
-
<Grid.Item colSpan="full">
|
|
121
|
-
<div style={cell}>Full width</div>
|
|
122
|
-
</Grid.Item>
|
|
123
|
-
</Grid>
|
|
124
|
-
),
|
|
125
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Header } from '.';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Header is a composable header with slots for brand, navigation, search, and
|
|
7
|
-
* actions. It is a compound component: compose Header.Brand, Header.Nav,
|
|
8
|
-
* Header.NavItem, Header.Spacer, and Header.Actions inside the root. Designed
|
|
9
|
-
* for use within AppShell with responsive mobile support.
|
|
10
|
-
*/
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Navigation/Header',
|
|
13
|
-
component: Header,
|
|
14
|
-
tags: ['autodocs'],
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component:
|
|
19
|
-
'Composable header with slots for brand, navigation, search, and actions.',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
position: {
|
|
25
|
-
control: 'select',
|
|
26
|
-
options: ['static', 'fixed', 'sticky'],
|
|
27
|
-
description: 'Position behavior (usually controlled by AppShell)',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
args: {
|
|
31
|
-
position: 'static',
|
|
32
|
-
children: (
|
|
33
|
-
<>
|
|
34
|
-
<Header.Brand href="/">MyApp</Header.Brand>
|
|
35
|
-
<Header.Nav>
|
|
36
|
-
<Header.NavItem href="/dashboard" active>
|
|
37
|
-
Dashboard
|
|
38
|
-
</Header.NavItem>
|
|
39
|
-
<Header.NavItem href="/projects">Projects</Header.NavItem>
|
|
40
|
-
</Header.Nav>
|
|
41
|
-
<Header.Spacer />
|
|
42
|
-
<Header.Actions>
|
|
43
|
-
<Button variant="secondary" size="sm">
|
|
44
|
-
Sign In
|
|
45
|
-
</Button>
|
|
46
|
-
</Header.Actions>
|
|
47
|
-
</>
|
|
48
|
-
),
|
|
49
|
-
},
|
|
50
|
-
} satisfies Meta<typeof Header>;
|
|
51
|
-
|
|
52
|
-
export default meta;
|
|
53
|
-
|
|
54
|
-
type Story = StoryObj<typeof meta>;
|
|
55
|
-
|
|
56
|
-
export const Default: Story = {
|
|
57
|
-
render: () => (
|
|
58
|
-
<Header>
|
|
59
|
-
<Header.SkipLink />
|
|
60
|
-
<Header.Brand href="/">MyApp</Header.Brand>
|
|
61
|
-
<Header.Nav>
|
|
62
|
-
<Header.NavItem href="/dashboard" active>
|
|
63
|
-
Dashboard
|
|
64
|
-
</Header.NavItem>
|
|
65
|
-
<Header.NavItem href="/projects">Projects</Header.NavItem>
|
|
66
|
-
<Header.NavItem href="/settings">Settings</Header.NavItem>
|
|
67
|
-
</Header.Nav>
|
|
68
|
-
<Header.Spacer />
|
|
69
|
-
<Header.Actions>
|
|
70
|
-
<Button variant="secondary" size="sm">
|
|
71
|
-
Sign In
|
|
72
|
-
</Button>
|
|
73
|
-
</Header.Actions>
|
|
74
|
-
</Header>
|
|
75
|
-
),
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const WithDropdownNav: Story = {
|
|
79
|
-
render: () => (
|
|
80
|
-
<Header>
|
|
81
|
-
<Header.Brand href="/">MyApp</Header.Brand>
|
|
82
|
-
<Header.Nav>
|
|
83
|
-
<Header.NavItem href="/components" active>
|
|
84
|
-
Components
|
|
85
|
-
</Header.NavItem>
|
|
86
|
-
<Header.NavItem href="/blocks">Blocks</Header.NavItem>
|
|
87
|
-
<Header.NavMenu label="Docs">
|
|
88
|
-
<Header.NavMenuItem href="/getting-started">
|
|
89
|
-
Getting Started
|
|
90
|
-
</Header.NavMenuItem>
|
|
91
|
-
<Header.NavMenuItem href="/cli">CLI Reference</Header.NavMenuItem>
|
|
92
|
-
<Header.NavMenuItem href="/mcp">MCP Tools</Header.NavMenuItem>
|
|
93
|
-
</Header.NavMenu>
|
|
94
|
-
<Header.NavItem href="/blog">Blog</Header.NavItem>
|
|
95
|
-
</Header.Nav>
|
|
96
|
-
<Header.Spacer />
|
|
97
|
-
<Header.Actions>
|
|
98
|
-
<Button variant="primary" size="sm">
|
|
99
|
-
Sign Up
|
|
100
|
-
</Button>
|
|
101
|
-
</Header.Actions>
|
|
102
|
-
</Header>
|
|
103
|
-
),
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export const Minimal: Story = {
|
|
107
|
-
render: () => (
|
|
108
|
-
<Header>
|
|
109
|
-
<Header.Brand href="/">MyApp</Header.Brand>
|
|
110
|
-
<Header.Spacer />
|
|
111
|
-
<Header.Actions>
|
|
112
|
-
<Button variant="secondary" size="sm">
|
|
113
|
-
Account
|
|
114
|
-
</Button>
|
|
115
|
-
</Header.Actions>
|
|
116
|
-
</Header>
|
|
117
|
-
),
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export const Sticky: Story = {
|
|
121
|
-
render: () => (
|
|
122
|
-
<Header position="sticky">
|
|
123
|
-
<Header.Brand href="/">MyApp</Header.Brand>
|
|
124
|
-
<Header.Nav>
|
|
125
|
-
<Header.NavItem href="/" active>
|
|
126
|
-
Home
|
|
127
|
-
</Header.NavItem>
|
|
128
|
-
<Header.NavItem href="/about">About</Header.NavItem>
|
|
129
|
-
</Header.Nav>
|
|
130
|
-
<Header.Spacer />
|
|
131
|
-
</Header>
|
|
132
|
-
),
|
|
133
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Heart, Star, Check, Warning, Info } from '@phosphor-icons/react';
|
|
3
|
-
import { Icon } from '.';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Icon is a wrapper for icon components with consistent sizing and semantic
|
|
7
|
-
* colors. Pass any icon component (Phosphor, Lucide, etc.) via the required
|
|
8
|
-
* `icon` prop. Icons are decorative by default and should be paired with text
|
|
9
|
-
* for meaning.
|
|
10
|
-
*/
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Display/Icon',
|
|
13
|
-
component: Icon,
|
|
14
|
-
tags: ['autodocs', 'canonical'],
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component:
|
|
19
|
-
'Wrapper for icon components with consistent sizing and semantic colors.',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
size: {
|
|
25
|
-
control: 'select',
|
|
26
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
27
|
-
description: 'Icon size',
|
|
28
|
-
},
|
|
29
|
-
weight: {
|
|
30
|
-
control: 'select',
|
|
31
|
-
options: ['thin', 'light', 'regular', 'bold', 'fill', 'duotone'],
|
|
32
|
-
description: 'Optional icon style/weight hint',
|
|
33
|
-
},
|
|
34
|
-
variant: {
|
|
35
|
-
control: 'select',
|
|
36
|
-
options: [
|
|
37
|
-
'default',
|
|
38
|
-
'primary',
|
|
39
|
-
'secondary',
|
|
40
|
-
'tertiary',
|
|
41
|
-
'accent',
|
|
42
|
-
'success',
|
|
43
|
-
'warning',
|
|
44
|
-
'error',
|
|
45
|
-
],
|
|
46
|
-
description: 'Semantic color variant',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
args: {
|
|
50
|
-
icon: Heart,
|
|
51
|
-
size: 'md',
|
|
52
|
-
weight: 'regular',
|
|
53
|
-
variant: 'default',
|
|
54
|
-
},
|
|
55
|
-
} satisfies Meta<typeof Icon>;
|
|
56
|
-
|
|
57
|
-
export default meta;
|
|
58
|
-
|
|
59
|
-
type Story = StoryObj<typeof meta>;
|
|
60
|
-
|
|
61
|
-
export const Default: Story = {
|
|
62
|
-
args: { icon: Heart },
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const Large: Story = {
|
|
66
|
-
args: { icon: Star, size: 'xl' },
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Success: Story = {
|
|
70
|
-
args: { icon: Check, variant: 'success' },
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Warning_: Story = {
|
|
74
|
-
name: 'Warning',
|
|
75
|
-
args: { icon: Warning, variant: 'warning' },
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const Accent: Story = {
|
|
79
|
-
args: { icon: Info, variant: 'accent', weight: 'fill' },
|
|
80
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Gear, Trash, Plus, DotsThree } from '@phosphor-icons/react';
|
|
3
|
-
import { IconButton } from '.';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* IconButton is a compact square button for icon-only affordances such as
|
|
7
|
-
* topbar actions, row controls, and workspace rails. Icon-only buttons need an
|
|
8
|
-
* accessible name, so always provide an aria-label describing the action.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Components/IconButton',
|
|
12
|
-
component: IconButton,
|
|
13
|
-
tags: ['autodocs', 'canonical'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component:
|
|
18
|
-
'Compact square button for icon-only affordances in dense chrome.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
variant: {
|
|
24
|
-
control: 'select',
|
|
25
|
-
options: ['ghost', 'subtle', 'outlined'],
|
|
26
|
-
description: 'Visual style variant',
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
control: 'select',
|
|
30
|
-
options: ['sm', 'md', 'lg'],
|
|
31
|
-
description: 'Button size',
|
|
32
|
-
},
|
|
33
|
-
pressed: {
|
|
34
|
-
control: 'boolean',
|
|
35
|
-
description: 'Mark as pressed for toggle-style affordances',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
args: {
|
|
39
|
-
variant: 'ghost',
|
|
40
|
-
size: 'md',
|
|
41
|
-
'aria-label': 'Settings',
|
|
42
|
-
children: <Gear />,
|
|
43
|
-
},
|
|
44
|
-
} satisfies Meta<typeof IconButton>;
|
|
45
|
-
|
|
46
|
-
export default meta;
|
|
47
|
-
|
|
48
|
-
type Story = StoryObj<typeof meta>;
|
|
49
|
-
|
|
50
|
-
export const Ghost: Story = {
|
|
51
|
-
args: { variant: 'ghost', 'aria-label': 'More options', children: <DotsThree /> },
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Subtle: Story = {
|
|
55
|
-
args: { variant: 'subtle', 'aria-label': 'Add item', children: <Plus /> },
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Outlined: Story = {
|
|
59
|
-
args: { variant: 'outlined', 'aria-label': 'Settings', children: <Gear /> },
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Pressed: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
variant: 'subtle',
|
|
65
|
-
pressed: true,
|
|
66
|
-
'aria-label': 'Toggle setting',
|
|
67
|
-
children: <Gear />,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const Destructive: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
variant: 'outlined',
|
|
74
|
-
size: 'lg',
|
|
75
|
-
'aria-label': 'Delete',
|
|
76
|
-
children: <Trash />,
|
|
77
|
-
},
|
|
78
|
-
};
|