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