@usefragments/ui 1.1.1 → 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.
Files changed (141) hide show
  1. package/dist/assets/ui.css +327 -274
  2. package/dist/components/Checkbox/Checkbox.module.scss.cjs +11 -11
  3. package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
  4. package/dist/components/Chip/Chip.module.scss.cjs +15 -15
  5. package/dist/components/Chip/Chip.module.scss.js +15 -15
  6. package/dist/components/Combobox/index.cjs +106 -9
  7. package/dist/components/Combobox/index.d.ts.map +1 -1
  8. package/dist/components/Combobox/index.js +106 -9
  9. package/dist/components/DataTable/DataTable.module.scss.cjs +37 -34
  10. package/dist/components/DataTable/DataTable.module.scss.js +37 -34
  11. package/dist/components/Main/Main.module.scss.cjs +26 -0
  12. package/dist/components/Main/Main.module.scss.js +26 -0
  13. package/dist/components/Main/index.cjs +128 -0
  14. package/dist/components/Main/index.d.ts +22 -0
  15. package/dist/components/Main/index.d.ts.map +1 -0
  16. package/dist/components/Main/index.js +111 -0
  17. package/dist/components/Table/Table.module.scss.cjs +19 -19
  18. package/dist/components/Table/Table.module.scss.js +19 -19
  19. package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
  20. package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
  21. package/dist/components/TableOfContents/index.cjs +22 -42
  22. package/dist/components/TableOfContents/index.d.ts +3 -3
  23. package/dist/components/TableOfContents/index.d.ts.map +1 -1
  24. package/dist/components/TableOfContents/index.js +22 -42
  25. package/dist/index.cjs +87 -85
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -0
  29. package/fragments.json +1 -1
  30. package/package.json +7 -2
  31. package/src/components/Checkbox/Checkbox.contract.json +5 -24
  32. package/src/components/Checkbox/Checkbox.module.scss +4 -2
  33. package/src/components/Chip/Chip.contract.json +11 -28
  34. package/src/components/Chip/Chip.module.scss +21 -45
  35. package/src/components/Combobox/Combobox.contract.json +6 -24
  36. package/src/components/Combobox/index.tsx +132 -6
  37. package/src/components/DataTable/DataTable.module.scss +31 -8
  38. package/src/components/Main/Main.contract.json +79 -0
  39. package/src/components/Main/Main.module.scss +31 -0
  40. package/src/components/Main/index.tsx +124 -0
  41. package/src/components/Table/Table.module.scss +22 -5
  42. package/src/components/TableOfContents/TableOfContents.contract.json +6 -16
  43. package/src/components/TableOfContents/TableOfContents.module.scss +10 -13
  44. package/src/components/TableOfContents/index.tsx +27 -38
  45. package/src/index.ts +3 -0
  46. package/src/tokens/_component-properties.scss +1 -0
  47. package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts +0 -33
  48. package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts.map +0 -1
  49. package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts +0 -11
  50. package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts.map +0 -1
  51. package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts +0 -5
  52. package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts.map +0 -1
  53. package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts +0 -4
  54. package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts.map +0 -1
  55. package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts +0 -3
  56. package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts.map +0 -1
  57. package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts +0 -86
  58. package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts.map +0 -1
  59. package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts +0 -2
  60. package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts.map +0 -1
  61. package/src/components/Accordion/Accordion.stories.tsx +0 -106
  62. package/src/components/Alert/Alert.stories.tsx +0 -119
  63. package/src/components/AppShell/AppShell.stories.tsx +0 -156
  64. package/src/components/Avatar/Avatar.stories.tsx +0 -74
  65. package/src/components/Badge/Badge.stories.tsx +0 -92
  66. package/src/components/BentoGrid/BentoGrid.stories.tsx +0 -98
  67. package/src/components/Box/Box.stories.tsx +0 -150
  68. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -87
  69. package/src/components/Button/Button.stories.tsx +0 -103
  70. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -97
  71. package/src/components/Card/Card.stories.tsx +0 -144
  72. package/src/components/Chart/Chart.stories.tsx +0 -119
  73. package/src/components/Checkbox/Checkbox.stories.tsx +0 -68
  74. package/src/components/Chip/Chip.stories.tsx +0 -70
  75. package/src/components/Cloud/CloudGovernanceShell.module.scss +0 -88
  76. package/src/components/Cloud/CloudGovernanceShell.stories.tsx +0 -446
  77. package/src/components/Cloud/ControlSizing.module.scss +0 -49
  78. package/src/components/Cloud/ControlSizing.stories.tsx +0 -238
  79. package/src/components/Cloud/DashboardLayoutPrototypes.module.scss +0 -462
  80. package/src/components/Cloud/DashboardLayoutPrototypes.shared.tsx +0 -375
  81. package/src/components/Cloud/DashboardLayoutPrototypes.shell.tsx +0 -147
  82. package/src/components/Cloud/DashboardLayoutPrototypes.stories.tsx +0 -328
  83. package/src/components/Cloud/PullRequestsPrototypes.content.tsx +0 -283
  84. package/src/components/Cloud/PullRequestsPrototypes.detail-panels.tsx +0 -381
  85. package/src/components/Cloud/PullRequestsPrototypes.detail.tsx +0 -204
  86. package/src/components/Cloud/PullRequestsPrototypes.id-data.ts +0 -395
  87. package/src/components/Cloud/PullRequestsPrototypes.id-page.tsx +0 -349
  88. package/src/components/Cloud/PullRequestsPrototypes.stories.tsx +0 -81
  89. package/src/components/CodeBlock/CodeBlock.stories.tsx +0 -147
  90. package/src/components/Collapsible/Collapsible.stories.tsx +0 -94
  91. package/src/components/ColorPicker/ColorPicker.stories.tsx +0 -74
  92. package/src/components/Combobox/Combobox.stories.tsx +0 -133
  93. package/src/components/Command/Command.stories.tsx +0 -102
  94. package/src/components/ConversationList/ConversationList.stories.tsx +0 -93
  95. package/src/components/DataTable/DataTable.stories.tsx +0 -129
  96. package/src/components/DatePicker/DatePicker.stories.tsx +0 -129
  97. package/src/components/Dialog/Dialog.stories.tsx +0 -154
  98. package/src/components/Drawer/Drawer.stories.tsx +0 -144
  99. package/src/components/Editor/Editor.stories.tsx +0 -99
  100. package/src/components/EmptyState/EmptyState.stories.tsx +0 -97
  101. package/src/components/Field/Field.stories.tsx +0 -109
  102. package/src/components/Fieldset/Fieldset.stories.tsx +0 -116
  103. package/src/components/Form/Form.stories.tsx +0 -142
  104. package/src/components/Grid/Grid.stories.tsx +0 -125
  105. package/src/components/Header/Header.stories.tsx +0 -133
  106. package/src/components/Icon/Icon.stories.tsx +0 -80
  107. package/src/components/IconButton/IconButton.stories.tsx +0 -78
  108. package/src/components/Image/Image.stories.tsx +0 -109
  109. package/src/components/Input/Input.stories.tsx +0 -104
  110. package/src/components/Link/Link.stories.tsx +0 -67
  111. package/src/components/List/List.stories.tsx +0 -95
  112. package/src/components/Listbox/Listbox.stories.tsx +0 -81
  113. package/src/components/Loading/Loading.stories.tsx +0 -69
  114. package/src/components/Markdown/Markdown.stories.tsx +0 -75
  115. package/src/components/Menu/Menu.stories.tsx +0 -113
  116. package/src/components/Message/Message.stories.tsx +0 -85
  117. package/src/components/NavigationMenu/NavigationMenu.stories.tsx +0 -161
  118. package/src/components/Pagination/Pagination.stories.tsx +0 -81
  119. package/src/components/Popover/Popover.stories.tsx +0 -152
  120. package/src/components/Progress/Progress.stories.tsx +0 -64
  121. package/src/components/Prompt/Prompt.stories.tsx +0 -93
  122. package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -107
  123. package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -97
  124. package/src/components/Select/Select.stories.tsx +0 -127
  125. package/src/components/Separator/Separator.stories.tsx +0 -84
  126. package/src/components/Sidebar/Sidebar.stories.tsx +0 -122
  127. package/src/components/Skeleton/Skeleton.stories.tsx +0 -80
  128. package/src/components/Slider/Slider.stories.tsx +0 -73
  129. package/src/components/Stack/Stack.stories.tsx +0 -73
  130. package/src/components/Switch/Switch.stories.tsx +0 -59
  131. package/src/components/Table/Table.stories.tsx +0 -219
  132. package/src/components/TableOfContents/TableOfContents.stories.tsx +0 -120
  133. package/src/components/Tabs/Tabs.stories.tsx +0 -136
  134. package/src/components/Text/Text.stories.tsx +0 -133
  135. package/src/components/Textarea/Textarea.stories.tsx +0 -107
  136. package/src/components/Theme/Theme.stories.tsx +0 -95
  137. package/src/components/ThinkingIndicator/ThinkingIndicator.stories.tsx +0 -85
  138. package/src/components/Toast/Toast.stories.tsx +0 -91
  139. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -114
  140. package/src/components/Tooltip/Tooltip.stories.tsx +0 -95
  141. package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -78
@@ -1,93 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Prompt } from '.';
3
-
4
- /**
5
- * Prompt is a multi-line input with toolbar for AI and chat interfaces.
6
- * It is a compound component composed from Prompt.Textarea, Prompt.Toolbar,
7
- * Prompt.Actions, Prompt.Info, and Prompt.Submit.
8
- */
9
- const meta = {
10
- title: 'Ai/Prompt',
11
- component: Prompt,
12
- tags: ['autodocs'],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: 'Multi-line input with toolbar for AI and chat interfaces.',
17
- },
18
- },
19
- },
20
- argTypes: {
21
- variant: {
22
- control: 'select',
23
- options: ['default', 'fixed', 'sticky'],
24
- description: 'Visual/positioning variant',
25
- },
26
- disabled: { control: 'boolean', description: 'Disable the entire prompt' },
27
- loading: { control: 'boolean', description: 'Show loading state' },
28
- submitOnEnter: {
29
- control: 'boolean',
30
- description: 'Submit on Enter (Shift+Enter for newline)',
31
- },
32
- autoResize: { control: 'boolean', description: 'Enable auto-resize based on content' },
33
- placeholder: { control: 'text', description: 'Placeholder text for the textarea' },
34
- },
35
- args: {
36
- placeholder: 'Ask, Search or Chat...',
37
- variant: 'default',
38
- children: (
39
- <>
40
- <Prompt.Textarea />
41
- <Prompt.Toolbar>
42
- <Prompt.Actions />
43
- <Prompt.Info>
44
- <Prompt.Submit />
45
- </Prompt.Info>
46
- </Prompt.Toolbar>
47
- </>
48
- ),
49
- },
50
- render: (args) => (
51
- <Prompt {...args} onSubmit={(value) => console.log(value)}>
52
- <Prompt.Textarea />
53
- <Prompt.Toolbar>
54
- <Prompt.Actions />
55
- <Prompt.Info>
56
- <Prompt.Submit />
57
- </Prompt.Info>
58
- </Prompt.Toolbar>
59
- </Prompt>
60
- ),
61
- } satisfies Meta<typeof Prompt>;
62
-
63
- export default meta;
64
-
65
- type Story = StoryObj<typeof meta>;
66
-
67
- export const Basic: Story = {};
68
-
69
- export const WithActions: Story = {
70
- render: (args) => (
71
- <Prompt {...args} onSubmit={(value) => console.log(value)}>
72
- <Prompt.Textarea />
73
- <Prompt.Toolbar>
74
- <Prompt.Actions>
75
- <Prompt.ActionButton aria-label="Add attachment">+</Prompt.ActionButton>
76
- <Prompt.ModeButton active>Auto</Prompt.ModeButton>
77
- </Prompt.Actions>
78
- <Prompt.Info>
79
- <Prompt.Usage>52% used</Prompt.Usage>
80
- <Prompt.Submit />
81
- </Prompt.Info>
82
- </Prompt.Toolbar>
83
- </Prompt>
84
- ),
85
- };
86
-
87
- export const Loading: Story = {
88
- args: { loading: true, defaultValue: 'Tell me about the weather...' },
89
- };
90
-
91
- export const Disabled: Story = {
92
- args: { disabled: true },
93
- };
@@ -1,107 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { RadioGroup } from '.';
3
-
4
- /**
5
- * RadioGroup lets users select one option from a set of mutually exclusive
6
- * choices. It is a compound component: each option is a RadioGroup.Item with
7
- * a value and label.
8
- */
9
- const meta = {
10
- title: 'Forms/RadioGroup',
11
- component: RadioGroup,
12
- tags: ['autodocs'],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: 'Single selection from a list of mutually exclusive options.',
17
- },
18
- },
19
- },
20
- argTypes: {
21
- orientation: {
22
- control: 'select',
23
- options: ['horizontal', 'vertical'],
24
- description: 'Layout orientation',
25
- },
26
- size: {
27
- control: 'select',
28
- options: ['sm', 'md', 'lg'],
29
- description: 'Size variant',
30
- },
31
- variant: {
32
- control: 'select',
33
- options: ['default', 'card'],
34
- description: 'Visual variant',
35
- },
36
- disabled: { control: 'boolean', description: 'Disable all options' },
37
- },
38
- args: {
39
- label: 'Select an option',
40
- defaultValue: 'option1',
41
- size: 'md',
42
- orientation: 'vertical',
43
- children: (
44
- <>
45
- <RadioGroup.Item value="option1" label="Option 1" />
46
- <RadioGroup.Item value="option2" label="Option 2" />
47
- <RadioGroup.Item value="option3" label="Option 3" />
48
- </>
49
- ),
50
- },
51
- render: (args) => (
52
- <RadioGroup {...args}>
53
- <RadioGroup.Item value="option1" label="Option 1" />
54
- <RadioGroup.Item value="option2" label="Option 2" />
55
- <RadioGroup.Item value="option3" label="Option 3" />
56
- </RadioGroup>
57
- ),
58
- } satisfies Meta<typeof RadioGroup>;
59
-
60
- export default meta;
61
-
62
- type Story = StoryObj<typeof meta>;
63
-
64
- export const Default: Story = {};
65
-
66
- export const WithHelperText: Story = {
67
- args: { label: 'Shipping method', defaultValue: 'standard' },
68
- render: (args) => (
69
- <RadioGroup {...args}>
70
- <RadioGroup.Item value="standard" label="Standard" helperText="5-7 business days" />
71
- <RadioGroup.Item value="express" label="Express" helperText="2-3 business days" />
72
- <RadioGroup.Item value="overnight" label="Overnight" helperText="Next business day" />
73
- </RadioGroup>
74
- ),
75
- };
76
-
77
- export const Horizontal: Story = {
78
- args: { label: 'Size', defaultValue: 'medium', orientation: 'horizontal' },
79
- render: (args) => (
80
- <RadioGroup {...args}>
81
- <RadioGroup.Item value="small" label="S" />
82
- <RadioGroup.Item value="medium" label="M" />
83
- <RadioGroup.Item value="large" label="L" />
84
- <RadioGroup.Item value="xlarge" label="XL" />
85
- </RadioGroup>
86
- ),
87
- };
88
-
89
- export const WithError: Story = {
90
- args: { label: 'Required selection', defaultValue: undefined, error: 'Please select an option' },
91
- render: (args) => (
92
- <RadioGroup {...args}>
93
- <RadioGroup.Item value="a" label="Option A" />
94
- <RadioGroup.Item value="b" label="Option B" />
95
- </RadioGroup>
96
- ),
97
- };
98
-
99
- export const Disabled: Story = {
100
- args: { label: 'Locked selection', defaultValue: 'locked', disabled: true },
101
- render: (args) => (
102
- <RadioGroup {...args}>
103
- <RadioGroup.Item value="locked" label="This is locked" />
104
- <RadioGroup.Item value="other" label="Cannot select" />
105
- </RadioGroup>
106
- ),
107
- };
@@ -1,97 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { ScrollArea } from '.';
3
-
4
- /**
5
- * ScrollArea is a styled scrollable container with thin scrollbars and
6
- * optional fade indicators. Use orientation to constrain scroll direction
7
- * and showFades to hint at content beyond the viewport.
8
- */
9
- const meta = {
10
- title: 'Layout/ScrollArea',
11
- component: ScrollArea,
12
- tags: ['autodocs'],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: 'Styled scrollable container with thin scrollbars and optional fade indicators.',
17
- },
18
- },
19
- },
20
- argTypes: {
21
- orientation: {
22
- control: 'select',
23
- options: ['horizontal', 'vertical', 'both'],
24
- description: 'Scroll direction',
25
- },
26
- scrollbarVisibility: {
27
- control: 'select',
28
- options: ['auto', 'always', 'hover'],
29
- description: 'When to show the scrollbar',
30
- },
31
- showFades: {
32
- control: 'boolean',
33
- description: 'Show gradient fade indicators at scroll edges',
34
- },
35
- },
36
- args: {
37
- orientation: 'vertical',
38
- scrollbarVisibility: 'auto',
39
- showFades: false,
40
- children: (
41
- <div style={{ display: 'flex', flexDirection: 'column', gap: 8, padding: 8 }}>
42
- {Array.from({ length: 20 }, (_, i) => (
43
- <div key={i}>Row {i + 1}</div>
44
- ))}
45
- </div>
46
- ),
47
- },
48
- render: (args) => (
49
- <ScrollArea {...args} style={{ height: 160, width: 280 }}>
50
- <div style={{ display: 'flex', flexDirection: 'column', gap: 8, padding: 8 }}>
51
- {Array.from({ length: 20 }, (_, i) => (
52
- <div key={i}>Row {i + 1}</div>
53
- ))}
54
- </div>
55
- </ScrollArea>
56
- ),
57
- } satisfies Meta<typeof ScrollArea>;
58
-
59
- export default meta;
60
-
61
- type Story = StoryObj<typeof meta>;
62
-
63
- export const Vertical: Story = {};
64
-
65
- export const Horizontal: Story = {
66
- args: { orientation: 'horizontal' },
67
- render: (args) => (
68
- <ScrollArea {...args} style={{ width: 280 }}>
69
- <div style={{ display: 'flex', gap: 8, padding: 8 }}>
70
- {Array.from({ length: 20 }, (_, i) => (
71
- <div key={i} style={{ flex: '0 0 auto' }}>
72
- Chip {i + 1}
73
- </div>
74
- ))}
75
- </div>
76
- </ScrollArea>
77
- ),
78
- };
79
-
80
- export const WithFades: Story = {
81
- args: { orientation: 'horizontal', showFades: true },
82
- render: (args) => (
83
- <ScrollArea {...args} style={{ width: 280 }}>
84
- <div style={{ display: 'flex', gap: 8, padding: 8 }}>
85
- {Array.from({ length: 20 }, (_, i) => (
86
- <div key={i} style={{ flex: '0 0 auto' }}>
87
- Item {i + 1}
88
- </div>
89
- ))}
90
- </div>
91
- </ScrollArea>
92
- ),
93
- };
94
-
95
- export const HoverScrollbar: Story = {
96
- args: { scrollbarVisibility: 'hover' },
97
- };
@@ -1,127 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Select } from ".";
3
-
4
- /**
5
- * Select is a dropdown for choosing from a list of options. It is a compound
6
- * component requiring Select.Trigger and Select.Content children, with
7
- * Select.Item entries (optionally organized via Select.Group).
8
- */
9
- const meta = {
10
- title: "Forms/Select",
11
- component: Select,
12
- tags: ["autodocs", "canonical"],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: "Dropdown for choosing from a list of options.",
17
- },
18
- },
19
- },
20
- argTypes: {
21
- size: {
22
- control: "select",
23
- options: ["sm", "md", "lg"],
24
- description: "Size variant",
25
- },
26
- disabled: { control: "boolean", description: "Disable the select" },
27
- required: { control: "boolean", description: "Whether a selection is required" },
28
- placeholder: { control: "text", description: "Placeholder text when no value selected" },
29
- },
30
- args: { placeholder: "Select a fruit", size: "md" },
31
- render: (args) => (
32
- <Select {...args}>
33
- <Select.Trigger />
34
- <Select.Content>
35
- <Select.Item value="apple">Apple</Select.Item>
36
- <Select.Item value="banana">Banana</Select.Item>
37
- <Select.Item value="orange">Orange</Select.Item>
38
- <Select.Item value="grape">Grape</Select.Item>
39
- </Select.Content>
40
- </Select>
41
- ),
42
- } satisfies Meta<typeof Select>;
43
-
44
- export default meta;
45
-
46
- type Story = StoryObj<typeof meta>;
47
-
48
- export const Default: Story = {};
49
-
50
- export const WithGroups: Story = {
51
- args: { placeholder: "Select a country" },
52
- render: (args) => (
53
- <Select {...args}>
54
- <Select.Trigger />
55
- <Select.Content>
56
- <Select.Group>
57
- <Select.GroupLabel>North America</Select.GroupLabel>
58
- <Select.Item value="us">United States</Select.Item>
59
- <Select.Item value="ca">Canada</Select.Item>
60
- </Select.Group>
61
- <Select.Group>
62
- <Select.GroupLabel>Europe</Select.GroupLabel>
63
- <Select.Item value="uk">United Kingdom</Select.Item>
64
- <Select.Item value="de">Germany</Select.Item>
65
- </Select.Group>
66
- </Select.Content>
67
- </Select>
68
- ),
69
- };
70
-
71
- export const WithLabelAndHelper: Story = {
72
- args: {
73
- label: "Timezone",
74
- placeholder: "Select a timezone",
75
- helperText: "Used for reminders and calendar notifications.",
76
- },
77
- render: (args) => (
78
- <Select {...args}>
79
- <Select.Trigger />
80
- <Select.Content>
81
- <Select.Item value="pt">Pacific Time</Select.Item>
82
- <Select.Item value="mt">Mountain Time</Select.Item>
83
- <Select.Item value="ct">Central Time</Select.Item>
84
- <Select.Item value="et">Eastern Time</Select.Item>
85
- </Select.Content>
86
- </Select>
87
- ),
88
- };
89
-
90
- export const OptionsProp: Story = {
91
- args: { placeholder: "Select a team" },
92
- render: (args) => (
93
- <Select
94
- {...args}
95
- options={[
96
- { value: "eng", label: "Engineering" },
97
- { value: "design", label: "Design" },
98
- { value: "pm", label: "Product" },
99
- ]}
100
- />
101
- ),
102
- };
103
-
104
- export const ErrorState: Story = {
105
- args: { label: "Country", placeholder: "Select a country", error: "Please select a country" },
106
- render: (args) => (
107
- <Select {...args}>
108
- <Select.Trigger />
109
- <Select.Content>
110
- <Select.Item value="us">United States</Select.Item>
111
- <Select.Item value="uk">United Kingdom</Select.Item>
112
- </Select.Content>
113
- </Select>
114
- ),
115
- };
116
-
117
- export const Disabled: Story = {
118
- args: { placeholder: "Select an option", disabled: true },
119
- render: (args) => (
120
- <Select {...args}>
121
- <Select.Trigger />
122
- <Select.Content>
123
- <Select.Item value="1">Option 1</Select.Item>
124
- </Select.Content>
125
- </Select>
126
- ),
127
- };
@@ -1,84 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Separator } from '.';
3
-
4
- /**
5
- * Separator is a visual divider between content sections. It supports
6
- * horizontal and vertical orientations, spacing presets, a softer
7
- * appearance, and an optional centered label (horizontal only).
8
- */
9
- const meta = {
10
- title: 'Layout/Separator',
11
- component: Separator,
12
- tags: ['autodocs', 'canonical'],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component: 'Visual divider between content sections.',
17
- },
18
- },
19
- },
20
- argTypes: {
21
- orientation: {
22
- control: 'select',
23
- options: ['horizontal', 'vertical'],
24
- description: 'Direction of the separator',
25
- },
26
- spacing: {
27
- control: 'select',
28
- options: ['none', 'sm', 'md', 'lg'],
29
- description: 'Margin around the separator',
30
- },
31
- soft: { control: 'boolean', description: 'Softer, lighter appearance' },
32
- },
33
- args: { orientation: 'horizontal', spacing: 'md', soft: false },
34
- } satisfies Meta<typeof Separator>;
35
-
36
- export default meta;
37
-
38
- type Story = StoryObj<typeof meta>;
39
-
40
- export const Default: Story = {
41
- args: { spacing: 'md' },
42
- render: (args) => (
43
- <div style={{ width: 300 }}>
44
- <p>Content above</p>
45
- <Separator {...args} />
46
- <p>Content below</p>
47
- </div>
48
- ),
49
- };
50
-
51
- export const WithLabel: Story = {
52
- args: { label: 'Or', spacing: 'md' },
53
- render: (args) => (
54
- <div style={{ width: 300 }}>
55
- <p>First section</p>
56
- <Separator {...args} />
57
- <p>Second section</p>
58
- </div>
59
- ),
60
- };
61
-
62
- export const Soft: Story = {
63
- args: { soft: true, spacing: 'md' },
64
- render: (args) => (
65
- <div style={{ width: 300 }}>
66
- <p>Content above</p>
67
- <Separator {...args} />
68
- <p>Content below</p>
69
- </div>
70
- ),
71
- };
72
-
73
- export const Vertical: Story = {
74
- args: { orientation: 'vertical', spacing: 'none' },
75
- render: (args) => (
76
- <div style={{ display: 'flex', alignItems: 'center', gap: 16, height: 40 }}>
77
- <span>Item 1</span>
78
- <Separator {...args} />
79
- <span>Item 2</span>
80
- <Separator {...args} />
81
- <span>Item 3</span>
82
- </div>
83
- ),
84
- };
@@ -1,122 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Sidebar } from '.';
3
-
4
- /**
5
- * Sidebar is a responsive navigation sidebar with collapsible desktop mode
6
- * and mobile drawer behavior. It is a compound component composed from
7
- * Sidebar.Header, Sidebar.Nav, Sidebar.Section, Sidebar.Item, and more.
8
- */
9
- const meta = {
10
- title: 'Navigation/Sidebar',
11
- component: Sidebar,
12
- tags: ['autodocs'],
13
- parameters: {
14
- docs: {
15
- description: {
16
- component:
17
- 'Responsive navigation sidebar with collapsible desktop mode and mobile drawer behavior.',
18
- },
19
- },
20
- },
21
- argTypes: {
22
- position: {
23
- control: 'select',
24
- options: ['left', 'right'],
25
- description: 'Sidebar position',
26
- },
27
- collapsible: {
28
- control: 'select',
29
- options: ['icon', 'offcanvas', 'none'],
30
- description: 'Collapse behavior mode',
31
- },
32
- defaultCollapsed: { control: 'boolean', description: 'Initial collapsed state' },
33
- },
34
- args: {
35
- position: 'left',
36
- collapsible: 'icon',
37
- defaultCollapsed: false,
38
- children: (
39
- <>
40
- <Sidebar.Header>
41
- <span>Acme App</span>
42
- </Sidebar.Header>
43
- <Sidebar.Nav>
44
- <Sidebar.Section>
45
- <Sidebar.Item active>Dashboard</Sidebar.Item>
46
- <Sidebar.Item>Analytics</Sidebar.Item>
47
- </Sidebar.Section>
48
- </Sidebar.Nav>
49
- <Sidebar.Footer>
50
- <Sidebar.CollapseToggle />
51
- </Sidebar.Footer>
52
- </>
53
- ),
54
- },
55
- render: (args) => (
56
- <Sidebar {...args}>
57
- <Sidebar.Header>
58
- <span>Acme App</span>
59
- </Sidebar.Header>
60
- <Sidebar.Nav>
61
- <Sidebar.Section>
62
- <Sidebar.Item active>Dashboard</Sidebar.Item>
63
- <Sidebar.Item>Analytics</Sidebar.Item>
64
- <Sidebar.Item>Team</Sidebar.Item>
65
- <Sidebar.Item>Projects</Sidebar.Item>
66
- </Sidebar.Section>
67
- <Sidebar.Section label="Settings">
68
- <Sidebar.Item>Preferences</Sidebar.Item>
69
- <Sidebar.Item>Help</Sidebar.Item>
70
- </Sidebar.Section>
71
- </Sidebar.Nav>
72
- <Sidebar.Footer>
73
- <Sidebar.CollapseToggle />
74
- </Sidebar.Footer>
75
- </Sidebar>
76
- ),
77
- } satisfies Meta<typeof Sidebar>;
78
-
79
- export default meta;
80
-
81
- type Story = StoryObj<typeof meta>;
82
-
83
- export const Default: Story = {};
84
-
85
- export const WithBadges: Story = {
86
- render: (args) => (
87
- <Sidebar {...args}>
88
- <Sidebar.Nav>
89
- <Sidebar.Section>
90
- <Sidebar.Item active>Dashboard</Sidebar.Item>
91
- <Sidebar.Item badge="3">Analytics</Sidebar.Item>
92
- <Sidebar.Item badge="12">Team</Sidebar.Item>
93
- <Sidebar.Item>Projects</Sidebar.Item>
94
- </Sidebar.Section>
95
- </Sidebar.Nav>
96
- </Sidebar>
97
- ),
98
- };
99
-
100
- export const WithSubmenu: Story = {
101
- render: (args) => (
102
- <Sidebar {...args}>
103
- <Sidebar.Nav>
104
- <Sidebar.Section>
105
- <Sidebar.Item>Dashboard</Sidebar.Item>
106
- <Sidebar.Item hasSubmenu defaultExpanded>
107
- Projects
108
- </Sidebar.Item>
109
- <Sidebar.Submenu>
110
- <Sidebar.SubItem active>Website Redesign</Sidebar.SubItem>
111
- <Sidebar.SubItem>Mobile App</Sidebar.SubItem>
112
- <Sidebar.SubItem>API Integration</Sidebar.SubItem>
113
- </Sidebar.Submenu>
114
- </Sidebar.Section>
115
- </Sidebar.Nav>
116
- </Sidebar>
117
- ),
118
- };
119
-
120
- export const Collapsed: Story = {
121
- args: { defaultCollapsed: true },
122
- };