@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,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&apos;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&apos;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
- };