@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,113 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Menu } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Dropdown menu for actions and commands. Compose with `Menu.Trigger`,
|
|
6
|
-
* `Menu.Content`, `Menu.Item`, and friends. Supports submenus, check items,
|
|
7
|
-
* radio groups, and keyboard shortcuts.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Feedback/Menu',
|
|
11
|
-
component: Menu,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Dropdown menu for actions and commands with keyboard navigation.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
modal: { control: 'boolean' },
|
|
22
|
-
defaultOpen: { control: 'boolean' },
|
|
23
|
-
},
|
|
24
|
-
args: {
|
|
25
|
-
modal: true,
|
|
26
|
-
children: (
|
|
27
|
-
<>
|
|
28
|
-
<Menu.Trigger>Actions</Menu.Trigger>
|
|
29
|
-
<Menu.Content>
|
|
30
|
-
<Menu.Item onSelect={() => {}}>Edit</Menu.Item>
|
|
31
|
-
<Menu.Item onSelect={() => {}}>Duplicate</Menu.Item>
|
|
32
|
-
</Menu.Content>
|
|
33
|
-
</>
|
|
34
|
-
),
|
|
35
|
-
},
|
|
36
|
-
} satisfies Meta<typeof Menu>;
|
|
37
|
-
|
|
38
|
-
export default meta;
|
|
39
|
-
|
|
40
|
-
type Story = StoryObj<typeof meta>;
|
|
41
|
-
|
|
42
|
-
export const Default: Story = {
|
|
43
|
-
render: (args) => (
|
|
44
|
-
<Menu {...args}>
|
|
45
|
-
<Menu.Trigger>Actions</Menu.Trigger>
|
|
46
|
-
<Menu.Content>
|
|
47
|
-
<Menu.Item onSelect={() => {}}>Edit</Menu.Item>
|
|
48
|
-
<Menu.Item onSelect={() => {}}>Duplicate</Menu.Item>
|
|
49
|
-
<Menu.Separator />
|
|
50
|
-
<Menu.Item danger onSelect={() => {}}>
|
|
51
|
-
Delete
|
|
52
|
-
</Menu.Item>
|
|
53
|
-
</Menu.Content>
|
|
54
|
-
</Menu>
|
|
55
|
-
),
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const WithShortcuts: Story = {
|
|
59
|
-
render: (args) => (
|
|
60
|
-
<Menu {...args}>
|
|
61
|
-
<Menu.Trigger>Edit</Menu.Trigger>
|
|
62
|
-
<Menu.Content>
|
|
63
|
-
<Menu.Item shortcut="Ctrl+Z" onSelect={() => {}}>
|
|
64
|
-
Undo
|
|
65
|
-
</Menu.Item>
|
|
66
|
-
<Menu.Item shortcut="Ctrl+Y" onSelect={() => {}}>
|
|
67
|
-
Redo
|
|
68
|
-
</Menu.Item>
|
|
69
|
-
<Menu.Separator />
|
|
70
|
-
<Menu.Item shortcut="Ctrl+C" onSelect={() => {}}>
|
|
71
|
-
Copy
|
|
72
|
-
</Menu.Item>
|
|
73
|
-
<Menu.Item shortcut="Ctrl+V" onSelect={() => {}}>
|
|
74
|
-
Paste
|
|
75
|
-
</Menu.Item>
|
|
76
|
-
</Menu.Content>
|
|
77
|
-
</Menu>
|
|
78
|
-
),
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const WithGroups: Story = {
|
|
82
|
-
render: (args) => (
|
|
83
|
-
<Menu {...args}>
|
|
84
|
-
<Menu.Trigger>Options</Menu.Trigger>
|
|
85
|
-
<Menu.Content>
|
|
86
|
-
<Menu.Group>
|
|
87
|
-
<Menu.GroupLabel>View</Menu.GroupLabel>
|
|
88
|
-
<Menu.Item onSelect={() => {}}>Zoom In</Menu.Item>
|
|
89
|
-
<Menu.Item onSelect={() => {}}>Zoom Out</Menu.Item>
|
|
90
|
-
</Menu.Group>
|
|
91
|
-
<Menu.Separator />
|
|
92
|
-
<Menu.Group>
|
|
93
|
-
<Menu.GroupLabel>Layout</Menu.GroupLabel>
|
|
94
|
-
<Menu.Item onSelect={() => {}}>Grid View</Menu.Item>
|
|
95
|
-
<Menu.Item onSelect={() => {}}>List View</Menu.Item>
|
|
96
|
-
</Menu.Group>
|
|
97
|
-
</Menu.Content>
|
|
98
|
-
</Menu>
|
|
99
|
-
),
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const WithCheckboxes: Story = {
|
|
103
|
-
render: (args) => (
|
|
104
|
-
<Menu {...args}>
|
|
105
|
-
<Menu.Trigger>Display</Menu.Trigger>
|
|
106
|
-
<Menu.Content>
|
|
107
|
-
<Menu.CheckboxItem defaultChecked>Show Grid</Menu.CheckboxItem>
|
|
108
|
-
<Menu.CheckboxItem defaultChecked>Show Rulers</Menu.CheckboxItem>
|
|
109
|
-
<Menu.CheckboxItem>Show Guides</Menu.CheckboxItem>
|
|
110
|
-
</Menu.Content>
|
|
111
|
-
</Menu>
|
|
112
|
-
),
|
|
113
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Message } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Individual chat message with role-based styling and alignment. Compose with
|
|
6
|
-
* `Message.Content`, `Message.Timestamp`, `Message.Avatar`, and `Message.Actions`.
|
|
7
|
-
*/
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Ai/Message',
|
|
10
|
-
component: Message,
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
parameters: {
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component: 'Chat message display with role-based styling for AI conversation UIs.',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
role: {
|
|
21
|
-
control: 'select',
|
|
22
|
-
options: ['user', 'assistant', 'system'],
|
|
23
|
-
description: 'Message role determines styling and alignment',
|
|
24
|
-
},
|
|
25
|
-
status: {
|
|
26
|
-
control: 'select',
|
|
27
|
-
options: ['sending', 'streaming', 'complete', 'error'],
|
|
28
|
-
description: 'Message state',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
args: {
|
|
32
|
-
role: 'assistant',
|
|
33
|
-
status: 'complete',
|
|
34
|
-
children: <Message.Content>How can I help you today?</Message.Content>,
|
|
35
|
-
},
|
|
36
|
-
} satisfies Meta<typeof Message>;
|
|
37
|
-
|
|
38
|
-
export default meta;
|
|
39
|
-
|
|
40
|
-
type Story = StoryObj<typeof meta>;
|
|
41
|
-
|
|
42
|
-
export const UserMessage: Story = {
|
|
43
|
-
args: {
|
|
44
|
-
role: 'user',
|
|
45
|
-
children: (
|
|
46
|
-
<Message.Content>Hello! Can you help me with a coding question?</Message.Content>
|
|
47
|
-
),
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const AssistantMessage: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
role: 'assistant',
|
|
54
|
-
children: (
|
|
55
|
-
<Message.Content>
|
|
56
|
-
Of course! I'd be happy to help. What would you like to know?
|
|
57
|
-
</Message.Content>
|
|
58
|
-
),
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const SystemMessage: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
role: 'system',
|
|
65
|
-
children: <Message.Content>Conversation started.</Message.Content>,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Streaming: Story = {
|
|
70
|
-
args: {
|
|
71
|
-
role: 'assistant',
|
|
72
|
-
status: 'streaming',
|
|
73
|
-
children: (
|
|
74
|
-
<Message.Content>I'm currently generating a response for you</Message.Content>
|
|
75
|
-
),
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const ErrorState: Story = {
|
|
80
|
-
args: {
|
|
81
|
-
role: 'user',
|
|
82
|
-
status: 'error',
|
|
83
|
-
children: <Message.Content>This message failed to send.</Message.Content>,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { NavigationMenu } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Rich header navigation menu with dropdown content panels, animated viewport
|
|
6
|
-
* transitions, and an automatic mobile drawer. Compose with `NavigationMenu.List`,
|
|
7
|
-
* `NavigationMenu.Item`, `NavigationMenu.Trigger`, `NavigationMenu.Content`,
|
|
8
|
-
* `NavigationMenu.Link`, and `NavigationMenu.Viewport`.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Navigation/NavigationMenu',
|
|
12
|
-
component: NavigationMenu,
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component: 'Header navigation menu with dropdown panels and responsive drawer.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
orientation: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['horizontal', 'vertical'],
|
|
25
|
-
description: 'Menu orientation',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
orientation: 'horizontal',
|
|
30
|
-
children: (
|
|
31
|
-
<>
|
|
32
|
-
<NavigationMenu.List>
|
|
33
|
-
<NavigationMenu.Item>
|
|
34
|
-
<NavigationMenu.Link href="/pricing">Pricing</NavigationMenu.Link>
|
|
35
|
-
</NavigationMenu.Item>
|
|
36
|
-
</NavigationMenu.List>
|
|
37
|
-
<NavigationMenu.Viewport />
|
|
38
|
-
</>
|
|
39
|
-
),
|
|
40
|
-
},
|
|
41
|
-
} satisfies Meta<typeof NavigationMenu>;
|
|
42
|
-
|
|
43
|
-
export default meta;
|
|
44
|
-
|
|
45
|
-
type Story = StoryObj<typeof meta>;
|
|
46
|
-
|
|
47
|
-
export const Default: Story = {
|
|
48
|
-
render: (args) => (
|
|
49
|
-
<NavigationMenu {...args}>
|
|
50
|
-
<NavigationMenu.List>
|
|
51
|
-
<NavigationMenu.Item value="products">
|
|
52
|
-
<NavigationMenu.Trigger>Products</NavigationMenu.Trigger>
|
|
53
|
-
<NavigationMenu.Content>
|
|
54
|
-
<NavigationMenu.Link
|
|
55
|
-
href="/analytics"
|
|
56
|
-
title="Analytics"
|
|
57
|
-
description="Track your metrics and KPIs."
|
|
58
|
-
/>
|
|
59
|
-
<NavigationMenu.Link
|
|
60
|
-
href="/automation"
|
|
61
|
-
title="Automation"
|
|
62
|
-
description="Automate your workflows."
|
|
63
|
-
/>
|
|
64
|
-
</NavigationMenu.Content>
|
|
65
|
-
</NavigationMenu.Item>
|
|
66
|
-
<NavigationMenu.Item value="resources">
|
|
67
|
-
<NavigationMenu.Trigger>Resources</NavigationMenu.Trigger>
|
|
68
|
-
<NavigationMenu.Content>
|
|
69
|
-
<NavigationMenu.Link
|
|
70
|
-
href="/docs"
|
|
71
|
-
title="Documentation"
|
|
72
|
-
description="Comprehensive API reference."
|
|
73
|
-
/>
|
|
74
|
-
<NavigationMenu.Link
|
|
75
|
-
href="/blog"
|
|
76
|
-
title="Blog"
|
|
77
|
-
description="Latest news and updates."
|
|
78
|
-
/>
|
|
79
|
-
</NavigationMenu.Content>
|
|
80
|
-
</NavigationMenu.Item>
|
|
81
|
-
<NavigationMenu.Item>
|
|
82
|
-
<NavigationMenu.Link href="/pricing">Pricing</NavigationMenu.Link>
|
|
83
|
-
</NavigationMenu.Item>
|
|
84
|
-
</NavigationMenu.List>
|
|
85
|
-
<NavigationMenu.Viewport />
|
|
86
|
-
</NavigationMenu>
|
|
87
|
-
),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const WithSimpleLinks: Story = {
|
|
91
|
-
render: (args) => (
|
|
92
|
-
<NavigationMenu {...args}>
|
|
93
|
-
<NavigationMenu.List>
|
|
94
|
-
<NavigationMenu.Item value="company">
|
|
95
|
-
<NavigationMenu.Trigger>Company</NavigationMenu.Trigger>
|
|
96
|
-
<NavigationMenu.Content>
|
|
97
|
-
<div
|
|
98
|
-
style={{
|
|
99
|
-
display: 'flex',
|
|
100
|
-
flexDirection: 'column',
|
|
101
|
-
padding: '4px',
|
|
102
|
-
minWidth: '160px',
|
|
103
|
-
}}
|
|
104
|
-
>
|
|
105
|
-
<NavigationMenu.Link href="/about">About</NavigationMenu.Link>
|
|
106
|
-
<NavigationMenu.Link href="/careers">Careers</NavigationMenu.Link>
|
|
107
|
-
<NavigationMenu.Link href="/contact">Contact</NavigationMenu.Link>
|
|
108
|
-
</div>
|
|
109
|
-
</NavigationMenu.Content>
|
|
110
|
-
</NavigationMenu.Item>
|
|
111
|
-
<NavigationMenu.Item>
|
|
112
|
-
<NavigationMenu.Link href="/blog">Blog</NavigationMenu.Link>
|
|
113
|
-
</NavigationMenu.Item>
|
|
114
|
-
<NavigationMenu.Item>
|
|
115
|
-
<NavigationMenu.Link href="/docs">Docs</NavigationMenu.Link>
|
|
116
|
-
</NavigationMenu.Item>
|
|
117
|
-
</NavigationMenu.List>
|
|
118
|
-
<NavigationMenu.Viewport />
|
|
119
|
-
</NavigationMenu>
|
|
120
|
-
),
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const Vertical: Story = {
|
|
124
|
-
args: { orientation: 'vertical' },
|
|
125
|
-
render: (args) => (
|
|
126
|
-
<NavigationMenu {...args}>
|
|
127
|
-
<NavigationMenu.List>
|
|
128
|
-
<NavigationMenu.Item value="overview">
|
|
129
|
-
<NavigationMenu.Trigger>Overview</NavigationMenu.Trigger>
|
|
130
|
-
<NavigationMenu.Content>
|
|
131
|
-
<div style={{ padding: '8px', minWidth: '200px' }}>
|
|
132
|
-
<NavigationMenu.Link
|
|
133
|
-
href="/intro"
|
|
134
|
-
title="Introduction"
|
|
135
|
-
description="Learn the basics."
|
|
136
|
-
/>
|
|
137
|
-
</div>
|
|
138
|
-
</NavigationMenu.Content>
|
|
139
|
-
</NavigationMenu.Item>
|
|
140
|
-
<NavigationMenu.Item value="guides">
|
|
141
|
-
<NavigationMenu.Trigger>Guides</NavigationMenu.Trigger>
|
|
142
|
-
<NavigationMenu.Content>
|
|
143
|
-
<div style={{ padding: '8px', minWidth: '200px' }}>
|
|
144
|
-
<NavigationMenu.Link
|
|
145
|
-
href="/install"
|
|
146
|
-
title="Installation"
|
|
147
|
-
description="Get started quickly."
|
|
148
|
-
/>
|
|
149
|
-
<NavigationMenu.Link
|
|
150
|
-
href="/config"
|
|
151
|
-
title="Configuration"
|
|
152
|
-
description="Customize your setup."
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
</NavigationMenu.Content>
|
|
156
|
-
</NavigationMenu.Item>
|
|
157
|
-
</NavigationMenu.List>
|
|
158
|
-
<NavigationMenu.Viewport />
|
|
159
|
-
</NavigationMenu>
|
|
160
|
-
),
|
|
161
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Pagination } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Page navigation for paginated data. Compose with `Pagination.Previous`,
|
|
6
|
-
* `Pagination.Items`, and `Pagination.Next`. Supports controlled/uncontrolled
|
|
7
|
-
* state plus edge and sibling count customization.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Navigation/Pagination',
|
|
11
|
-
component: Pagination,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'Page navigation controls for paginated data sets.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
args: {
|
|
21
|
-
totalPages: 10,
|
|
22
|
-
defaultPage: 1,
|
|
23
|
-
edgeCount: 1,
|
|
24
|
-
siblingCount: 1,
|
|
25
|
-
children: (
|
|
26
|
-
<>
|
|
27
|
-
<Pagination.Previous />
|
|
28
|
-
<Pagination.Items />
|
|
29
|
-
<Pagination.Next />
|
|
30
|
-
</>
|
|
31
|
-
),
|
|
32
|
-
},
|
|
33
|
-
} satisfies Meta<typeof Pagination>;
|
|
34
|
-
|
|
35
|
-
export default meta;
|
|
36
|
-
|
|
37
|
-
type Story = StoryObj<typeof meta>;
|
|
38
|
-
|
|
39
|
-
export const Default: Story = {
|
|
40
|
-
args: { totalPages: 10, defaultPage: 1 },
|
|
41
|
-
render: (args) => (
|
|
42
|
-
<Pagination {...args}>
|
|
43
|
-
<Pagination.Previous />
|
|
44
|
-
<Pagination.Items />
|
|
45
|
-
<Pagination.Next />
|
|
46
|
-
</Pagination>
|
|
47
|
-
),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const WithEdgePages: Story = {
|
|
51
|
-
args: { totalPages: 20, defaultPage: 10, edgeCount: 2, siblingCount: 1 },
|
|
52
|
-
render: (args) => (
|
|
53
|
-
<Pagination {...args}>
|
|
54
|
-
<Pagination.Previous />
|
|
55
|
-
<Pagination.Items />
|
|
56
|
-
<Pagination.Next />
|
|
57
|
-
</Pagination>
|
|
58
|
-
),
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const Compact: Story = {
|
|
62
|
-
args: { totalPages: 20, defaultPage: 10, siblingCount: 0 },
|
|
63
|
-
render: (args) => (
|
|
64
|
-
<Pagination {...args}>
|
|
65
|
-
<Pagination.Previous />
|
|
66
|
-
<Pagination.Items />
|
|
67
|
-
<Pagination.Next />
|
|
68
|
-
</Pagination>
|
|
69
|
-
),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const Controlled: Story = {
|
|
73
|
-
args: { totalPages: 5, page: 3 },
|
|
74
|
-
render: (args) => (
|
|
75
|
-
<Pagination {...args}>
|
|
76
|
-
<Pagination.Previous />
|
|
77
|
-
<Pagination.Items />
|
|
78
|
-
<Pagination.Next />
|
|
79
|
-
</Pagination>
|
|
80
|
-
),
|
|
81
|
-
};
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { Popover } from '.';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Rich content overlay anchored to a trigger element. Compose with
|
|
7
|
-
* `Popover.Trigger`, `Popover.Content`, `Popover.Title`, `Popover.Description`,
|
|
8
|
-
* `Popover.Body`, `Popover.Footer`, and `Popover.Close`.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Feedback/Popover',
|
|
12
|
-
component: Popover,
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
parameters: {
|
|
15
|
-
docs: {
|
|
16
|
-
description: {
|
|
17
|
-
component: 'Floating content overlay anchored to a trigger element.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
modal: { control: 'boolean' },
|
|
23
|
-
defaultOpen: { control: 'boolean' },
|
|
24
|
-
},
|
|
25
|
-
args: {
|
|
26
|
-
modal: false,
|
|
27
|
-
children: (
|
|
28
|
-
<>
|
|
29
|
-
<Popover.Trigger>Open Popover</Popover.Trigger>
|
|
30
|
-
<Popover.Content>
|
|
31
|
-
<Popover.Close />
|
|
32
|
-
<Popover.Title>Popover Title</Popover.Title>
|
|
33
|
-
<Popover.Description>
|
|
34
|
-
This is a popover with some content.
|
|
35
|
-
</Popover.Description>
|
|
36
|
-
</Popover.Content>
|
|
37
|
-
</>
|
|
38
|
-
),
|
|
39
|
-
},
|
|
40
|
-
} satisfies Meta<typeof Popover>;
|
|
41
|
-
|
|
42
|
-
export default meta;
|
|
43
|
-
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
export const Default: Story = {
|
|
47
|
-
render: (args) => (
|
|
48
|
-
<Popover {...args}>
|
|
49
|
-
<Popover.Trigger>Open Popover</Popover.Trigger>
|
|
50
|
-
<Popover.Content>
|
|
51
|
-
<Popover.Close />
|
|
52
|
-
<Popover.Title>Popover Title</Popover.Title>
|
|
53
|
-
<Popover.Description>
|
|
54
|
-
This is a popover with some content. It can contain text, forms, or
|
|
55
|
-
other elements.
|
|
56
|
-
</Popover.Description>
|
|
57
|
-
</Popover.Content>
|
|
58
|
-
</Popover>
|
|
59
|
-
),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const WithArrow: Story = {
|
|
63
|
-
render: (args) => (
|
|
64
|
-
<Popover {...args}>
|
|
65
|
-
<Popover.Trigger>Info</Popover.Trigger>
|
|
66
|
-
<Popover.Content arrow>
|
|
67
|
-
<Popover.Title>Quick Tip</Popover.Title>
|
|
68
|
-
<Popover.Description>
|
|
69
|
-
This popover has an arrow pointing to its trigger element.
|
|
70
|
-
</Popover.Description>
|
|
71
|
-
</Popover.Content>
|
|
72
|
-
</Popover>
|
|
73
|
-
),
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const TopSide: Story = {
|
|
77
|
-
render: (args) => (
|
|
78
|
-
<Popover {...args}>
|
|
79
|
-
<Popover.Trigger>Top</Popover.Trigger>
|
|
80
|
-
<Popover.Content side="top" size="sm">
|
|
81
|
-
<Popover.Description>Popover on top</Popover.Description>
|
|
82
|
-
</Popover.Content>
|
|
83
|
-
</Popover>
|
|
84
|
-
),
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const SmallSize: Story = {
|
|
88
|
-
render: (args) => (
|
|
89
|
-
<Popover {...args}>
|
|
90
|
-
<Popover.Trigger>Compact</Popover.Trigger>
|
|
91
|
-
<Popover.Content size="sm">
|
|
92
|
-
<Popover.Description>A small, focused popover.</Popover.Description>
|
|
93
|
-
</Popover.Content>
|
|
94
|
-
</Popover>
|
|
95
|
-
),
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
function VirtualAnchorDemo(args: React.ComponentProps<typeof Popover>) {
|
|
99
|
-
const [anchor, setAnchor] = React.useState<HTMLDivElement | null>(null);
|
|
100
|
-
const [open, setOpen] = React.useState(false);
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<div style={{ paddingTop: 80 }}>
|
|
104
|
-
<div
|
|
105
|
-
ref={setAnchor}
|
|
106
|
-
style={{
|
|
107
|
-
width: 160,
|
|
108
|
-
height: 40,
|
|
109
|
-
display: 'flex',
|
|
110
|
-
alignItems: 'center',
|
|
111
|
-
justifyContent: 'center',
|
|
112
|
-
border: '1px dashed currentColor',
|
|
113
|
-
borderRadius: 8,
|
|
114
|
-
}}
|
|
115
|
-
>
|
|
116
|
-
Anchor element
|
|
117
|
-
</div>
|
|
118
|
-
<Popover {...args} open={open} onOpenChange={setOpen}>
|
|
119
|
-
<Popover.Trigger
|
|
120
|
-
style={{
|
|
121
|
-
position: 'absolute',
|
|
122
|
-
width: 1,
|
|
123
|
-
height: 1,
|
|
124
|
-
overflow: 'hidden',
|
|
125
|
-
clip: 'rect(0 0 0 0)',
|
|
126
|
-
}}
|
|
127
|
-
onClick={() => setOpen(true)}
|
|
128
|
-
>
|
|
129
|
-
Open (off-screen trigger)
|
|
130
|
-
</Popover.Trigger>
|
|
131
|
-
<Popover.Content anchor={anchor} positionMethod="fixed">
|
|
132
|
-
<Popover.Close />
|
|
133
|
-
<Popover.Title>Anchored elsewhere</Popover.Title>
|
|
134
|
-
<Popover.Description>
|
|
135
|
-
This content is positioned against the dashed box above, not the
|
|
136
|
-
(visually hidden) trigger button.
|
|
137
|
-
</Popover.Description>
|
|
138
|
-
</Popover.Content>
|
|
139
|
-
</Popover>
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Positions content against an arbitrary DOM element instead of the
|
|
146
|
-
* trigger, via `anchor` + `positionMethod="fixed"`. Used by Fragments
|
|
147
|
-
* Inspect's element-anchored detail view, where the "anchor" is a node in
|
|
148
|
-
* the host page rather than something rendered by this popover's own tree.
|
|
149
|
-
*/
|
|
150
|
-
export const VirtualAnchor: Story = {
|
|
151
|
-
render: (args) => <VirtualAnchorDemo {...args} />,
|
|
152
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Progress } from '.';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Progress is a visual indicator of task completion or loading state.
|
|
6
|
-
* Determinate values render a filled bar; a null value renders an
|
|
7
|
-
* indeterminate animation. Includes a Circular subcomponent.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Feedback/Progress',
|
|
11
|
-
component: Progress,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component:
|
|
17
|
-
'Visual indicator of task completion or loading state in linear and circular variants.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
size: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: ['sm', 'md', 'lg'],
|
|
25
|
-
description: 'Size of the progress bar',
|
|
26
|
-
},
|
|
27
|
-
variant: {
|
|
28
|
-
control: 'select',
|
|
29
|
-
options: ['default', 'success', 'warning', 'danger'],
|
|
30
|
-
description: 'Color variant',
|
|
31
|
-
},
|
|
32
|
-
showValue: { control: 'boolean', description: 'Show percentage value' },
|
|
33
|
-
},
|
|
34
|
-
args: { value: 60, size: 'md', variant: 'default', label: 'Uploading', showValue: true },
|
|
35
|
-
} satisfies Meta<typeof Progress>;
|
|
36
|
-
|
|
37
|
-
export default meta;
|
|
38
|
-
|
|
39
|
-
type Story = StoryObj<typeof meta>;
|
|
40
|
-
|
|
41
|
-
export const Default: Story = {
|
|
42
|
-
args: { value: 60, label: 'Uploading', showValue: true },
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Success: Story = {
|
|
46
|
-
args: { value: 100, variant: 'success', label: 'Complete', showValue: true },
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const Danger: Story = {
|
|
50
|
-
args: { value: 95, variant: 'danger', label: 'Storage critical', showValue: true },
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Large: Story = {
|
|
54
|
-
args: { value: 40, size: 'lg', label: 'Processing', showValue: true },
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Indeterminate: Story = {
|
|
58
|
-
args: { value: null, label: 'Loading', showValue: false },
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const Circular: Story = {
|
|
62
|
-
args: { value: 75, showValue: true },
|
|
63
|
-
render: (args) => <Progress.Circular {...args} variant="success" />,
|
|
64
|
-
};
|