@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,98 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { BentoGrid } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* BentoGrid is an asymmetric grid layout with responsive column/row spans and
|
|
6
|
-
* built-in surface styling for bento-style feature sections. Compose
|
|
7
|
-
* BentoGrid.Item children, optionally with colSpan and rowSpan.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Layout/BentoGrid',
|
|
11
|
-
component: BentoGrid,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component:
|
|
17
|
-
'Asymmetric grid layout with responsive spans and built-in surface styling.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
columns: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['2', '3', '4'],
|
|
25
|
-
description: 'Number of columns — auto-collapses responsively',
|
|
26
|
-
},
|
|
27
|
-
gap: {
|
|
28
|
-
control: 'select',
|
|
29
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
30
|
-
description: 'Gap between grid items',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
args: {
|
|
34
|
-
columns: 3,
|
|
35
|
-
gap: 'md',
|
|
36
|
-
children: (
|
|
37
|
-
<>
|
|
38
|
-
<BentoGrid.Item>Item 1</BentoGrid.Item>
|
|
39
|
-
<BentoGrid.Item>Item 2</BentoGrid.Item>
|
|
40
|
-
<BentoGrid.Item>Item 3</BentoGrid.Item>
|
|
41
|
-
</>
|
|
42
|
-
),
|
|
43
|
-
},
|
|
44
|
-
} satisfies Meta<typeof BentoGrid>;
|
|
45
|
-
|
|
46
|
-
export default meta;
|
|
47
|
-
|
|
48
|
-
type Story = StoryObj<typeof meta>;
|
|
49
|
-
|
|
50
|
-
export const Default: Story = {
|
|
51
|
-
render: () => (
|
|
52
|
-
<BentoGrid columns={3} gap="md">
|
|
53
|
-
<BentoGrid.Item>Item 1</BentoGrid.Item>
|
|
54
|
-
<BentoGrid.Item>Item 2</BentoGrid.Item>
|
|
55
|
-
<BentoGrid.Item>Item 3</BentoGrid.Item>
|
|
56
|
-
<BentoGrid.Item>Item 4</BentoGrid.Item>
|
|
57
|
-
<BentoGrid.Item>Item 5</BentoGrid.Item>
|
|
58
|
-
<BentoGrid.Item>Item 6</BentoGrid.Item>
|
|
59
|
-
</BentoGrid>
|
|
60
|
-
),
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const HeroLayout: Story = {
|
|
64
|
-
render: () => (
|
|
65
|
-
<BentoGrid columns={3} gap="md">
|
|
66
|
-
<BentoGrid.Item colSpan={{ base: 1, lg: 2 }} rowSpan={{ base: 1, lg: 2 }}>
|
|
67
|
-
Hero content
|
|
68
|
-
</BentoGrid.Item>
|
|
69
|
-
<BentoGrid.Item>Item 2</BentoGrid.Item>
|
|
70
|
-
<BentoGrid.Item>Item 3</BentoGrid.Item>
|
|
71
|
-
<BentoGrid.Item>Item 4</BentoGrid.Item>
|
|
72
|
-
<BentoGrid.Item>Item 5</BentoGrid.Item>
|
|
73
|
-
</BentoGrid>
|
|
74
|
-
),
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const TwoColumn: Story = {
|
|
78
|
-
render: () => (
|
|
79
|
-
<BentoGrid columns={2} gap="md">
|
|
80
|
-
<BentoGrid.Item>Item 1</BentoGrid.Item>
|
|
81
|
-
<BentoGrid.Item>Item 2</BentoGrid.Item>
|
|
82
|
-
<BentoGrid.Item colSpan={2}>Wide item</BentoGrid.Item>
|
|
83
|
-
<BentoGrid.Item>Item 4</BentoGrid.Item>
|
|
84
|
-
<BentoGrid.Item>Item 5</BentoGrid.Item>
|
|
85
|
-
</BentoGrid>
|
|
86
|
-
),
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const FullWidthBanner: Story = {
|
|
90
|
-
render: () => (
|
|
91
|
-
<BentoGrid columns={3} gap="md">
|
|
92
|
-
<BentoGrid.Item>Item 1</BentoGrid.Item>
|
|
93
|
-
<BentoGrid.Item>Item 2</BentoGrid.Item>
|
|
94
|
-
<BentoGrid.Item>Item 3</BentoGrid.Item>
|
|
95
|
-
<BentoGrid.Item colSpan={3}>Full-width banner</BentoGrid.Item>
|
|
96
|
-
</BentoGrid>
|
|
97
|
-
),
|
|
98
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Box } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Box is the primitive layout container for applying spacing, backgrounds, and
|
|
6
|
-
* borders. It renders any semantic element via the `as` prop and is the
|
|
7
|
-
* building block for custom layouts not covered by Stack or Grid.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Layout/Box',
|
|
11
|
-
component: Box,
|
|
12
|
-
tags: ['autodocs', 'canonical'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component:
|
|
17
|
-
'Primitive layout container for applying spacing, backgrounds, and borders.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
as: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['div', 'section', 'article', 'aside', 'main', 'header', 'footer', 'nav', 'span'],
|
|
25
|
-
description: 'HTML element to render',
|
|
26
|
-
},
|
|
27
|
-
padding: {
|
|
28
|
-
control: 'select',
|
|
29
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
30
|
-
description: 'Padding on all sides',
|
|
31
|
-
},
|
|
32
|
-
paddingX: {
|
|
33
|
-
control: 'select',
|
|
34
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
35
|
-
description: 'Horizontal padding',
|
|
36
|
-
},
|
|
37
|
-
paddingY: {
|
|
38
|
-
control: 'select',
|
|
39
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
40
|
-
description: 'Vertical padding',
|
|
41
|
-
},
|
|
42
|
-
margin: {
|
|
43
|
-
control: 'select',
|
|
44
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto'],
|
|
45
|
-
description: 'Margin on all sides',
|
|
46
|
-
},
|
|
47
|
-
marginX: {
|
|
48
|
-
control: 'select',
|
|
49
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto'],
|
|
50
|
-
description: 'Horizontal margin',
|
|
51
|
-
},
|
|
52
|
-
marginY: {
|
|
53
|
-
control: 'select',
|
|
54
|
-
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto'],
|
|
55
|
-
description: 'Vertical margin',
|
|
56
|
-
},
|
|
57
|
-
background: {
|
|
58
|
-
control: 'select',
|
|
59
|
-
options: ['none', 'primary', 'secondary', 'tertiary', 'elevated'],
|
|
60
|
-
description: 'Background color',
|
|
61
|
-
},
|
|
62
|
-
rounded: {
|
|
63
|
-
control: 'select',
|
|
64
|
-
options: ['none', 'sm', 'md', 'lg', 'full'],
|
|
65
|
-
description: 'Border radius',
|
|
66
|
-
},
|
|
67
|
-
borderColor: {
|
|
68
|
-
control: 'select',
|
|
69
|
-
options: ['default', 'strong', 'accent', 'danger'],
|
|
70
|
-
description: 'Border color variant',
|
|
71
|
-
},
|
|
72
|
-
shadow: {
|
|
73
|
-
control: 'select',
|
|
74
|
-
options: ['none', 'sm', 'md', 'lg'],
|
|
75
|
-
description: 'Box shadow',
|
|
76
|
-
},
|
|
77
|
-
overflow: {
|
|
78
|
-
control: 'select',
|
|
79
|
-
options: ['hidden', 'auto', 'scroll', 'visible'],
|
|
80
|
-
description: 'Overflow behavior',
|
|
81
|
-
},
|
|
82
|
-
color: {
|
|
83
|
-
control: 'select',
|
|
84
|
-
options: ['primary', 'secondary', 'tertiary', 'accent', 'inverse'],
|
|
85
|
-
description: 'Text color',
|
|
86
|
-
},
|
|
87
|
-
display: {
|
|
88
|
-
control: 'select',
|
|
89
|
-
options: ['none', 'block', 'inline', 'inline-block', 'flex', 'inline-flex', 'grid'],
|
|
90
|
-
description: 'Display type',
|
|
91
|
-
},
|
|
92
|
-
border: { control: 'boolean', description: 'Show border' },
|
|
93
|
-
borderTop: { control: 'boolean', description: 'Show top border only' },
|
|
94
|
-
borderBottom: { control: 'boolean', description: 'Show bottom border only' },
|
|
95
|
-
borderLeft: { control: 'boolean', description: 'Show left border only' },
|
|
96
|
-
borderRight: { control: 'boolean', description: 'Show right border only' },
|
|
97
|
-
},
|
|
98
|
-
args: {
|
|
99
|
-
padding: 'md',
|
|
100
|
-
background: 'secondary',
|
|
101
|
-
rounded: 'md',
|
|
102
|
-
children: 'Content with padding and background',
|
|
103
|
-
},
|
|
104
|
-
} satisfies Meta<typeof Box>;
|
|
105
|
-
|
|
106
|
-
export default meta;
|
|
107
|
-
|
|
108
|
-
type Story = StoryObj<typeof meta>;
|
|
109
|
-
|
|
110
|
-
export const Default: Story = {
|
|
111
|
-
args: {
|
|
112
|
-
padding: 'md',
|
|
113
|
-
background: 'secondary',
|
|
114
|
-
rounded: 'md',
|
|
115
|
-
children: 'Content with padding and background',
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const Bordered: Story = {
|
|
120
|
-
args: { padding: 'lg', border: true, rounded: 'md', children: 'Bordered content area' },
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const Elevated: Story = {
|
|
124
|
-
args: {
|
|
125
|
-
padding: 'lg',
|
|
126
|
-
rounded: 'md',
|
|
127
|
-
shadow: 'md',
|
|
128
|
-
background: 'primary',
|
|
129
|
-
children: 'Elevated content with shadow',
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const DirectionalPadding: Story = {
|
|
134
|
-
args: {
|
|
135
|
-
paddingX: 'xl',
|
|
136
|
-
paddingY: 'sm',
|
|
137
|
-
background: 'tertiary',
|
|
138
|
-
rounded: 'sm',
|
|
139
|
-
children: 'Wide horizontal padding, short vertical',
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const DirectionalBorders: Story = {
|
|
144
|
-
args: {
|
|
145
|
-
padding: 'md',
|
|
146
|
-
borderTop: true,
|
|
147
|
-
borderBottom: true,
|
|
148
|
-
children: 'Top and bottom borders only',
|
|
149
|
-
},
|
|
150
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Breadcrumbs } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Breadcrumbs show the current page location within a hierarchy and let users
|
|
6
|
-
* navigate back through parent pages. It is a compound component: compose
|
|
7
|
-
* Breadcrumbs.Item children, marking the last one with `current`.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Navigation/Breadcrumbs',
|
|
11
|
-
component: Breadcrumbs,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component:
|
|
17
|
-
'Breadcrumb navigation showing the current page location within a hierarchy.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
maxItems: {
|
|
23
|
-
control: 'number',
|
|
24
|
-
description: 'Maximum visible items before collapsing middle items with ellipsis',
|
|
25
|
-
},
|
|
26
|
-
label: {
|
|
27
|
-
control: 'text',
|
|
28
|
-
description: 'Custom aria-label for the breadcrumb nav landmark',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
args: {
|
|
32
|
-
children: (
|
|
33
|
-
<>
|
|
34
|
-
<Breadcrumbs.Item href="#">Home</Breadcrumbs.Item>
|
|
35
|
-
<Breadcrumbs.Item href="#">Products</Breadcrumbs.Item>
|
|
36
|
-
<Breadcrumbs.Item current>Current Page</Breadcrumbs.Item>
|
|
37
|
-
</>
|
|
38
|
-
),
|
|
39
|
-
},
|
|
40
|
-
} satisfies Meta<typeof Breadcrumbs>;
|
|
41
|
-
|
|
42
|
-
export default meta;
|
|
43
|
-
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
export const Default: Story = {
|
|
47
|
-
render: () => (
|
|
48
|
-
<Breadcrumbs>
|
|
49
|
-
<Breadcrumbs.Item href="#">Home</Breadcrumbs.Item>
|
|
50
|
-
<Breadcrumbs.Item href="#">Products</Breadcrumbs.Item>
|
|
51
|
-
<Breadcrumbs.Item href="#">Category</Breadcrumbs.Item>
|
|
52
|
-
<Breadcrumbs.Item current>Current Page</Breadcrumbs.Item>
|
|
53
|
-
</Breadcrumbs>
|
|
54
|
-
),
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Collapsed: Story = {
|
|
58
|
-
render: () => (
|
|
59
|
-
<Breadcrumbs maxItems={3}>
|
|
60
|
-
<Breadcrumbs.Item href="#">Home</Breadcrumbs.Item>
|
|
61
|
-
<Breadcrumbs.Item href="#">Category</Breadcrumbs.Item>
|
|
62
|
-
<Breadcrumbs.Item href="#">Subcategory</Breadcrumbs.Item>
|
|
63
|
-
<Breadcrumbs.Item href="#">Section</Breadcrumbs.Item>
|
|
64
|
-
<Breadcrumbs.Item current>Current Page</Breadcrumbs.Item>
|
|
65
|
-
</Breadcrumbs>
|
|
66
|
-
),
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const CustomSeparator: Story = {
|
|
70
|
-
render: () => (
|
|
71
|
-
<Breadcrumbs separator=">">
|
|
72
|
-
<Breadcrumbs.Item href="#">Home</Breadcrumbs.Item>
|
|
73
|
-
<Breadcrumbs.Item href="#">Settings</Breadcrumbs.Item>
|
|
74
|
-
<Breadcrumbs.Item current>Profile</Breadcrumbs.Item>
|
|
75
|
-
</Breadcrumbs>
|
|
76
|
-
),
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const CustomLandmarkLabel: Story = {
|
|
80
|
-
render: () => (
|
|
81
|
-
<Breadcrumbs label="Documentation breadcrumbs">
|
|
82
|
-
<Breadcrumbs.Item href="#">Docs</Breadcrumbs.Item>
|
|
83
|
-
<Breadcrumbs.Item href="#">Components</Breadcrumbs.Item>
|
|
84
|
-
<Breadcrumbs.Item current>Breadcrumbs</Breadcrumbs.Item>
|
|
85
|
-
</Breadcrumbs>
|
|
86
|
-
),
|
|
87
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { CaretDown } from "@phosphor-icons/react";
|
|
3
|
-
import { Button } from ".";
|
|
4
|
-
import { ButtonGroup } from "../ButtonGroup";
|
|
5
|
-
import { Stack } from "../Stack";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The Button is the canonical action primitive. Every CTA, form submit, and
|
|
9
|
-
* row action in the design system routes through it — agents should reuse it
|
|
10
|
-
* rather than hand-rolling a styled `<button>`.
|
|
11
|
-
*/
|
|
12
|
-
const meta = {
|
|
13
|
-
title: "Forms/Button",
|
|
14
|
-
component: Button,
|
|
15
|
-
tags: ["autodocs", "canonical"],
|
|
16
|
-
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
description: {
|
|
19
|
-
component:
|
|
20
|
-
"Interactive element for user actions and form submissions. Prefer this over a raw <button>.",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
argTypes: {
|
|
25
|
-
variant: {
|
|
26
|
-
control: "select",
|
|
27
|
-
options: ["primary", "secondary", "ghost", "link", "danger", "outlined", "icon"],
|
|
28
|
-
description: "Visual style variant",
|
|
29
|
-
},
|
|
30
|
-
size: {
|
|
31
|
-
control: "select",
|
|
32
|
-
options: ["xs", "sm", "md", "lg"],
|
|
33
|
-
description: "Button size",
|
|
34
|
-
},
|
|
35
|
-
icon: { control: "boolean", description: "Icon-only square layout" },
|
|
36
|
-
fullWidth: { control: "boolean", description: "Stretch to container width" },
|
|
37
|
-
disabled: { control: "boolean" },
|
|
38
|
-
},
|
|
39
|
-
args: {
|
|
40
|
-
variant: "primary",
|
|
41
|
-
size: "md",
|
|
42
|
-
children: "Save changes",
|
|
43
|
-
},
|
|
44
|
-
} satisfies Meta<typeof Button>;
|
|
45
|
-
|
|
46
|
-
export default meta;
|
|
47
|
-
|
|
48
|
-
type Story = StoryObj<typeof meta>;
|
|
49
|
-
|
|
50
|
-
export const Primary: Story = {
|
|
51
|
-
args: { variant: "primary", children: "Save changes" },
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Secondary: Story = {
|
|
55
|
-
args: { variant: "secondary", children: "Cancel" },
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Ghost: Story = {
|
|
59
|
-
args: { variant: "ghost", children: "Dismiss" },
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Danger: Story = {
|
|
63
|
-
args: { variant: "danger", children: "Delete" },
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Small: Story = {
|
|
67
|
-
args: { size: "sm", children: "Compact" },
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const FullWidth: Story = {
|
|
71
|
-
args: { fullWidth: true, children: "Continue" },
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const Disabled: Story = {
|
|
75
|
-
args: { disabled: true, children: "Unavailable" },
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const ReferenceChrome: Story = {
|
|
79
|
-
render: () => (
|
|
80
|
-
<Stack direction="row" gap="lg" align="center" wrap>
|
|
81
|
-
<ButtonGroup gap="none" role="group" aria-label="RSVP answer">
|
|
82
|
-
<Button variant="primary" size="lg">
|
|
83
|
-
Yes
|
|
84
|
-
</Button>
|
|
85
|
-
<Button variant="primary" size="lg" icon aria-label="More yes options">
|
|
86
|
-
<CaretDown weight="bold" />
|
|
87
|
-
</Button>
|
|
88
|
-
</ButtonGroup>
|
|
89
|
-
|
|
90
|
-
<Button variant="secondary" size="lg">
|
|
91
|
-
No
|
|
92
|
-
</Button>
|
|
93
|
-
|
|
94
|
-
<Button variant="secondary" size="lg">
|
|
95
|
-
Maybe
|
|
96
|
-
</Button>
|
|
97
|
-
|
|
98
|
-
<Button variant="secondary" size="lg">
|
|
99
|
-
Add Note
|
|
100
|
-
</Button>
|
|
101
|
-
</Stack>
|
|
102
|
-
),
|
|
103
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ButtonGroup } from '.';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* ButtonGroup groups related buttons together with consistent spacing and
|
|
7
|
-
* alignment. Use it for action bars, toolbars, and form submit/cancel pairs.
|
|
8
|
-
* It expects Button children.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Forms/ButtonGroup',
|
|
12
|
-
component: ButtonGroup,
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component: 'Groups related buttons together with consistent spacing and alignment.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
gap: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['none', 'xs', 'sm', 'md'],
|
|
25
|
-
description: 'Spacing between buttons',
|
|
26
|
-
},
|
|
27
|
-
align: {
|
|
28
|
-
control: 'select',
|
|
29
|
-
options: ['start', 'center', 'end'],
|
|
30
|
-
description: 'Alignment of buttons',
|
|
31
|
-
},
|
|
32
|
-
wrap: {
|
|
33
|
-
control: 'boolean',
|
|
34
|
-
description: 'Allow buttons to wrap to next line',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
args: {
|
|
38
|
-
gap: 'sm',
|
|
39
|
-
children: (
|
|
40
|
-
<>
|
|
41
|
-
<Button variant="secondary">Cancel</Button>
|
|
42
|
-
<Button variant="primary">Save</Button>
|
|
43
|
-
</>
|
|
44
|
-
),
|
|
45
|
-
},
|
|
46
|
-
} satisfies Meta<typeof ButtonGroup>;
|
|
47
|
-
|
|
48
|
-
export default meta;
|
|
49
|
-
|
|
50
|
-
type Story = StoryObj<typeof meta>;
|
|
51
|
-
|
|
52
|
-
export const Default: Story = {
|
|
53
|
-
render: () => (
|
|
54
|
-
<ButtonGroup>
|
|
55
|
-
<Button variant="secondary">Cancel</Button>
|
|
56
|
-
<Button variant="primary">Save</Button>
|
|
57
|
-
</ButtonGroup>
|
|
58
|
-
),
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const Tight: Story = {
|
|
62
|
-
render: () => (
|
|
63
|
-
<ButtonGroup gap="none">
|
|
64
|
-
<Button variant="secondary" size="sm">
|
|
65
|
-
Bold
|
|
66
|
-
</Button>
|
|
67
|
-
<Button variant="secondary" size="sm">
|
|
68
|
-
Italic
|
|
69
|
-
</Button>
|
|
70
|
-
<Button variant="secondary" size="sm">
|
|
71
|
-
Underline
|
|
72
|
-
</Button>
|
|
73
|
-
</ButtonGroup>
|
|
74
|
-
),
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const AlignedEnd: Story = {
|
|
78
|
-
render: () => (
|
|
79
|
-
<ButtonGroup align="end">
|
|
80
|
-
<Button variant="secondary" size="sm">
|
|
81
|
-
End
|
|
82
|
-
</Button>
|
|
83
|
-
<Button variant="secondary" size="sm">
|
|
84
|
-
Aligned
|
|
85
|
-
</Button>
|
|
86
|
-
</ButtonGroup>
|
|
87
|
-
),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const FormActions: Story = {
|
|
91
|
-
render: () => (
|
|
92
|
-
<ButtonGroup align="end" role="group" aria-label="Form actions">
|
|
93
|
-
<Button variant="ghost">Cancel</Button>
|
|
94
|
-
<Button variant="primary">Submit</Button>
|
|
95
|
-
</ButtonGroup>
|
|
96
|
-
),
|
|
97
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Card } from ".";
|
|
3
|
-
import { Progress } from "../Progress";
|
|
4
|
-
import { Stack } from "../Stack";
|
|
5
|
-
import { Text } from "../Text";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Card is a container for grouping related content into a distinct surface. It
|
|
9
|
-
* is a compound component: compose Card.Header, Card.Title, Card.Description,
|
|
10
|
-
* Card.Body, and Card.Footer inside the root.
|
|
11
|
-
*/
|
|
12
|
-
const meta = {
|
|
13
|
-
title: "Layout/Card",
|
|
14
|
-
component: Card,
|
|
15
|
-
tags: ["autodocs", "canonical"],
|
|
16
|
-
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
description: { component: "Container for grouping related content." },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
variant: {
|
|
23
|
-
control: "select",
|
|
24
|
-
options: ["default", "outlined", "outline", "elevated", "stat", "panel"],
|
|
25
|
-
description: "Visual style of the card surface",
|
|
26
|
-
},
|
|
27
|
-
padding: {
|
|
28
|
-
control: "select",
|
|
29
|
-
options: ["none", "sm", "md", "lg"],
|
|
30
|
-
description: "Internal padding size",
|
|
31
|
-
},
|
|
32
|
-
as: {
|
|
33
|
-
control: "select",
|
|
34
|
-
options: ["article", "div", "section"],
|
|
35
|
-
description: "Semantic HTML element for the card root",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
args: {
|
|
39
|
-
variant: "default",
|
|
40
|
-
padding: "md",
|
|
41
|
-
children: (
|
|
42
|
-
<>
|
|
43
|
-
<Card.Header>
|
|
44
|
-
<Card.Title>Card Title</Card.Title>
|
|
45
|
-
<Card.Description>A brief description</Card.Description>
|
|
46
|
-
</Card.Header>
|
|
47
|
-
<Card.Body>Card content goes here.</Card.Body>
|
|
48
|
-
</>
|
|
49
|
-
),
|
|
50
|
-
},
|
|
51
|
-
} satisfies Meta<typeof Card>;
|
|
52
|
-
|
|
53
|
-
export default meta;
|
|
54
|
-
|
|
55
|
-
type Story = StoryObj<typeof meta>;
|
|
56
|
-
|
|
57
|
-
export const Default: Story = {
|
|
58
|
-
render: () => (
|
|
59
|
-
<Card>
|
|
60
|
-
<Card.Header>
|
|
61
|
-
<Card.Title>Card Title</Card.Title>
|
|
62
|
-
<Card.Description>A brief description</Card.Description>
|
|
63
|
-
</Card.Header>
|
|
64
|
-
<Card.Body>Card content goes here.</Card.Body>
|
|
65
|
-
</Card>
|
|
66
|
-
),
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Outlined: Story = {
|
|
70
|
-
render: () => (
|
|
71
|
-
<Card variant="outlined">
|
|
72
|
-
<Card.Header>
|
|
73
|
-
<Card.Title>Outlined Card</Card.Title>
|
|
74
|
-
</Card.Header>
|
|
75
|
-
<Card.Body>Content with border.</Card.Body>
|
|
76
|
-
</Card>
|
|
77
|
-
),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Elevated: Story = {
|
|
81
|
-
render: () => (
|
|
82
|
-
<Card variant="elevated">
|
|
83
|
-
<Card.Header>
|
|
84
|
-
<Card.Title>Featured Item</Card.Title>
|
|
85
|
-
</Card.Header>
|
|
86
|
-
<Card.Body>Important content.</Card.Body>
|
|
87
|
-
</Card>
|
|
88
|
-
),
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const Stat: Story = {
|
|
92
|
-
render: () => (
|
|
93
|
-
<Card variant="stat" style={{ width: 280 }}>
|
|
94
|
-
<Stack gap="md">
|
|
95
|
-
<Stack gap="xs">
|
|
96
|
-
<Text as="strong" size="2xl" weight="bold" letterSpacing="tighter" tabularNums>
|
|
97
|
-
94%
|
|
98
|
-
</Text>
|
|
99
|
-
<Text as="p" size="sm" color="secondary">
|
|
100
|
-
Component coverage
|
|
101
|
-
</Text>
|
|
102
|
-
</Stack>
|
|
103
|
-
<Progress value={94} variant="success" size="sm" />
|
|
104
|
-
</Stack>
|
|
105
|
-
</Card>
|
|
106
|
-
),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const Panel: Story = {
|
|
110
|
-
render: () => (
|
|
111
|
-
<Card variant="panel" padding="none" style={{ width: 360 }}>
|
|
112
|
-
<Card.Header divided>
|
|
113
|
-
<Card.Title>System states</Card.Title>
|
|
114
|
-
</Card.Header>
|
|
115
|
-
<Card.Body padding="md">
|
|
116
|
-
<Text as="p" size="sm" color="secondary">
|
|
117
|
-
Use panel cards for bordered dashboard regions with their own internal header and body
|
|
118
|
-
rhythm.
|
|
119
|
-
</Text>
|
|
120
|
-
</Card.Body>
|
|
121
|
-
</Card>
|
|
122
|
-
),
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const WithFooter: Story = {
|
|
126
|
-
render: () => (
|
|
127
|
-
<Card>
|
|
128
|
-
<Card.Header>
|
|
129
|
-
<Card.Title>Card with Footer</Card.Title>
|
|
130
|
-
<Card.Description>Complete card layout</Card.Description>
|
|
131
|
-
</Card.Header>
|
|
132
|
-
<Card.Body>Main content area.</Card.Body>
|
|
133
|
-
<Card.Footer>Footer actions go here</Card.Footer>
|
|
134
|
-
</Card>
|
|
135
|
-
),
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const ContentOnly: Story = {
|
|
139
|
-
render: () => (
|
|
140
|
-
<Card>
|
|
141
|
-
<Card.Body>Just content, no header or footer.</Card.Body>
|
|
142
|
-
</Card>
|
|
143
|
-
),
|
|
144
|
-
};
|