@usefragments/ui 1.1.1 → 1.3.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 (148) 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/DataTable/index.d.ts.map +1 -1
  12. package/dist/components/Main/Main.module.scss.cjs +26 -0
  13. package/dist/components/Main/Main.module.scss.js +26 -0
  14. package/dist/components/Main/index.cjs +128 -0
  15. package/dist/components/Main/index.d.ts +22 -0
  16. package/dist/components/Main/index.d.ts.map +1 -0
  17. package/dist/components/Main/index.js +111 -0
  18. package/dist/components/Table/Table.module.scss.cjs +19 -19
  19. package/dist/components/Table/Table.module.scss.js +19 -19
  20. package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
  21. package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
  22. package/dist/components/TableOfContents/index.cjs +22 -42
  23. package/dist/components/TableOfContents/index.d.ts +3 -3
  24. package/dist/components/TableOfContents/index.d.ts.map +1 -1
  25. package/dist/components/TableOfContents/index.js +22 -42
  26. package/dist/{components/DataTable/DataTable.virtual.cjs → data-table-virtual.cjs} +1 -1
  27. package/dist/{components/DataTable/DataTable.virtual.js → data-table-virtual.js} +1 -1
  28. package/dist/data-table.cjs +27 -9
  29. package/dist/data-table.js +19 -1
  30. package/dist/index.cjs +87 -88
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +2 -3
  34. package/fragments.json +1 -1
  35. package/package.json +57 -2
  36. package/src/components/Checkbox/Checkbox.contract.json +5 -24
  37. package/src/components/Checkbox/Checkbox.module.scss +4 -2
  38. package/src/components/Chip/Chip.contract.json +11 -28
  39. package/src/components/Chip/Chip.module.scss +21 -45
  40. package/src/components/Combobox/Combobox.contract.json +6 -24
  41. package/src/components/Combobox/index.tsx +132 -6
  42. package/src/components/DataTable/DataTable.module.scss +31 -8
  43. package/src/components/DataTable/index.tsx +44 -16
  44. package/src/components/Main/Main.contract.json +79 -0
  45. package/src/components/Main/Main.module.scss +31 -0
  46. package/src/components/Main/index.tsx +124 -0
  47. package/src/components/Table/Table.module.scss +22 -5
  48. package/src/components/TableOfContents/TableOfContents.contract.json +6 -16
  49. package/src/components/TableOfContents/TableOfContents.module.scss +10 -13
  50. package/src/components/TableOfContents/index.tsx +27 -38
  51. package/src/index.ts +11 -9
  52. package/src/styles/styles.d.ts +8 -0
  53. package/src/tokens/_component-properties.scss +1 -0
  54. package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts +0 -33
  55. package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts.map +0 -1
  56. package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts +0 -11
  57. package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts.map +0 -1
  58. package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts +0 -5
  59. package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts.map +0 -1
  60. package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts +0 -4
  61. package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts.map +0 -1
  62. package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts +0 -3
  63. package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts.map +0 -1
  64. package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts +0 -86
  65. package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts.map +0 -1
  66. package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts +0 -2
  67. package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts.map +0 -1
  68. package/src/components/Accordion/Accordion.stories.tsx +0 -106
  69. package/src/components/Alert/Alert.stories.tsx +0 -119
  70. package/src/components/AppShell/AppShell.stories.tsx +0 -156
  71. package/src/components/Avatar/Avatar.stories.tsx +0 -74
  72. package/src/components/Badge/Badge.stories.tsx +0 -92
  73. package/src/components/BentoGrid/BentoGrid.stories.tsx +0 -98
  74. package/src/components/Box/Box.stories.tsx +0 -150
  75. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -87
  76. package/src/components/Button/Button.stories.tsx +0 -103
  77. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -97
  78. package/src/components/Card/Card.stories.tsx +0 -144
  79. package/src/components/Chart/Chart.stories.tsx +0 -119
  80. package/src/components/Checkbox/Checkbox.stories.tsx +0 -68
  81. package/src/components/Chip/Chip.stories.tsx +0 -70
  82. package/src/components/Cloud/CloudGovernanceShell.module.scss +0 -88
  83. package/src/components/Cloud/CloudGovernanceShell.stories.tsx +0 -446
  84. package/src/components/Cloud/ControlSizing.module.scss +0 -49
  85. package/src/components/Cloud/ControlSizing.stories.tsx +0 -238
  86. package/src/components/Cloud/DashboardLayoutPrototypes.module.scss +0 -462
  87. package/src/components/Cloud/DashboardLayoutPrototypes.shared.tsx +0 -375
  88. package/src/components/Cloud/DashboardLayoutPrototypes.shell.tsx +0 -147
  89. package/src/components/Cloud/DashboardLayoutPrototypes.stories.tsx +0 -328
  90. package/src/components/Cloud/PullRequestsPrototypes.content.tsx +0 -283
  91. package/src/components/Cloud/PullRequestsPrototypes.detail-panels.tsx +0 -381
  92. package/src/components/Cloud/PullRequestsPrototypes.detail.tsx +0 -204
  93. package/src/components/Cloud/PullRequestsPrototypes.id-data.ts +0 -395
  94. package/src/components/Cloud/PullRequestsPrototypes.id-page.tsx +0 -349
  95. package/src/components/Cloud/PullRequestsPrototypes.stories.tsx +0 -81
  96. package/src/components/CodeBlock/CodeBlock.stories.tsx +0 -147
  97. package/src/components/Collapsible/Collapsible.stories.tsx +0 -94
  98. package/src/components/ColorPicker/ColorPicker.stories.tsx +0 -74
  99. package/src/components/Combobox/Combobox.stories.tsx +0 -133
  100. package/src/components/Command/Command.stories.tsx +0 -102
  101. package/src/components/ConversationList/ConversationList.stories.tsx +0 -93
  102. package/src/components/DataTable/DataTable.stories.tsx +0 -129
  103. package/src/components/DatePicker/DatePicker.stories.tsx +0 -129
  104. package/src/components/Dialog/Dialog.stories.tsx +0 -154
  105. package/src/components/Drawer/Drawer.stories.tsx +0 -144
  106. package/src/components/Editor/Editor.stories.tsx +0 -99
  107. package/src/components/EmptyState/EmptyState.stories.tsx +0 -97
  108. package/src/components/Field/Field.stories.tsx +0 -109
  109. package/src/components/Fieldset/Fieldset.stories.tsx +0 -116
  110. package/src/components/Form/Form.stories.tsx +0 -142
  111. package/src/components/Grid/Grid.stories.tsx +0 -125
  112. package/src/components/Header/Header.stories.tsx +0 -133
  113. package/src/components/Icon/Icon.stories.tsx +0 -80
  114. package/src/components/IconButton/IconButton.stories.tsx +0 -78
  115. package/src/components/Image/Image.stories.tsx +0 -109
  116. package/src/components/Input/Input.stories.tsx +0 -104
  117. package/src/components/Link/Link.stories.tsx +0 -67
  118. package/src/components/List/List.stories.tsx +0 -95
  119. package/src/components/Listbox/Listbox.stories.tsx +0 -81
  120. package/src/components/Loading/Loading.stories.tsx +0 -69
  121. package/src/components/Markdown/Markdown.stories.tsx +0 -75
  122. package/src/components/Menu/Menu.stories.tsx +0 -113
  123. package/src/components/Message/Message.stories.tsx +0 -85
  124. package/src/components/NavigationMenu/NavigationMenu.stories.tsx +0 -161
  125. package/src/components/Pagination/Pagination.stories.tsx +0 -81
  126. package/src/components/Popover/Popover.stories.tsx +0 -152
  127. package/src/components/Progress/Progress.stories.tsx +0 -64
  128. package/src/components/Prompt/Prompt.stories.tsx +0 -93
  129. package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -107
  130. package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -97
  131. package/src/components/Select/Select.stories.tsx +0 -127
  132. package/src/components/Separator/Separator.stories.tsx +0 -84
  133. package/src/components/Sidebar/Sidebar.stories.tsx +0 -122
  134. package/src/components/Skeleton/Skeleton.stories.tsx +0 -80
  135. package/src/components/Slider/Slider.stories.tsx +0 -73
  136. package/src/components/Stack/Stack.stories.tsx +0 -73
  137. package/src/components/Switch/Switch.stories.tsx +0 -59
  138. package/src/components/Table/Table.stories.tsx +0 -219
  139. package/src/components/TableOfContents/TableOfContents.stories.tsx +0 -120
  140. package/src/components/Tabs/Tabs.stories.tsx +0 -136
  141. package/src/components/Text/Text.stories.tsx +0 -133
  142. package/src/components/Textarea/Textarea.stories.tsx +0 -107
  143. package/src/components/Theme/Theme.stories.tsx +0 -95
  144. package/src/components/ThinkingIndicator/ThinkingIndicator.stories.tsx +0 -85
  145. package/src/components/Toast/Toast.stories.tsx +0 -91
  146. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -114
  147. package/src/components/Tooltip/Tooltip.stories.tsx +0 -95
  148. package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -78
@@ -1,114 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { ToggleGroup } from '.';
3
-
4
- /**
5
- * ToggleGroup is the canonical segmented single-select control. Use it to switch
6
- * between mutually exclusive views or modes (grid/list, day/week/month) with a
7
- * small set of options — agents should compose `ToggleGroup.Item` children
8
- * rather than building a custom segmented control.
9
- */
10
- const meta = {
11
- title: 'Forms/ToggleGroup',
12
- component: ToggleGroup,
13
- tags: ['autodocs', 'canonical'],
14
- parameters: {
15
- docs: {
16
- description: {
17
- component:
18
- 'A group of toggle buttons where only one can be selected at a time. Prefer this over a hand-rolled segmented control for switching views or modes.',
19
- },
20
- },
21
- },
22
- argTypes: {
23
- variant: {
24
- control: 'select',
25
- options: ['default', 'pills', 'outline', 'outlined'],
26
- description: 'Visual style',
27
- },
28
- size: {
29
- control: 'select',
30
- options: ['sm', 'md', 'lg'],
31
- description: 'Size variant',
32
- },
33
- gap: {
34
- control: 'select',
35
- options: ['sm', 'none', 'xs'],
36
- description: 'Gap between items (pills/outline variants)',
37
- },
38
- selectionMode: {
39
- control: 'select',
40
- options: ['single'],
41
- description: 'Selection behavior',
42
- },
43
- },
44
- args: {
45
- variant: 'default',
46
- size: 'md',
47
- defaultValue: 'center',
48
- children: (
49
- <>
50
- <ToggleGroup.Item value="left">Left</ToggleGroup.Item>
51
- <ToggleGroup.Item value="center">Center</ToggleGroup.Item>
52
- <ToggleGroup.Item value="right">Right</ToggleGroup.Item>
53
- </>
54
- ),
55
- },
56
- } satisfies Meta<typeof ToggleGroup>;
57
-
58
- export default meta;
59
-
60
- type Story = StoryObj<typeof meta>;
61
-
62
- export const Default: Story = {
63
- render: (args) => (
64
- <ToggleGroup {...args} defaultValue="center">
65
- <ToggleGroup.Item value="left">Left</ToggleGroup.Item>
66
- <ToggleGroup.Item value="center">Center</ToggleGroup.Item>
67
- <ToggleGroup.Item value="right">Right</ToggleGroup.Item>
68
- </ToggleGroup>
69
- ),
70
- };
71
-
72
- export const PillsVariant: Story = {
73
- args: { variant: 'pills' },
74
- render: (args) => (
75
- <ToggleGroup {...args} defaultValue="all">
76
- <ToggleGroup.Item value="all">All</ToggleGroup.Item>
77
- <ToggleGroup.Item value="active">Active</ToggleGroup.Item>
78
- <ToggleGroup.Item value="completed">Completed</ToggleGroup.Item>
79
- </ToggleGroup>
80
- ),
81
- };
82
-
83
- export const OutlineVariant: Story = {
84
- args: { variant: 'outlined' },
85
- render: (args) => (
86
- <ToggleGroup {...args} defaultValue="week">
87
- <ToggleGroup.Item value="day">Day</ToggleGroup.Item>
88
- <ToggleGroup.Item value="week">Week</ToggleGroup.Item>
89
- <ToggleGroup.Item value="month">Month</ToggleGroup.Item>
90
- </ToggleGroup>
91
- ),
92
- };
93
-
94
- export const Small: Story = {
95
- args: { size: 'sm' },
96
- render: (args) => (
97
- <ToggleGroup {...args} defaultValue="grid">
98
- <ToggleGroup.Item value="grid">Grid</ToggleGroup.Item>
99
- <ToggleGroup.Item value="list">List</ToggleGroup.Item>
100
- </ToggleGroup>
101
- ),
102
- };
103
-
104
- export const WithDisabledItem: Story = {
105
- render: (args) => (
106
- <ToggleGroup {...args} defaultValue="basic">
107
- <ToggleGroup.Item value="basic">Basic</ToggleGroup.Item>
108
- <ToggleGroup.Item value="pro">Pro</ToggleGroup.Item>
109
- <ToggleGroup.Item value="enterprise" disabled>
110
- Enterprise
111
- </ToggleGroup.Item>
112
- </ToggleGroup>
113
- ),
114
- };
@@ -1,95 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Tooltip } from '.';
3
- import { Button } from '../Button';
4
-
5
- /**
6
- * Tooltip is the canonical contextual-hint primitive. Wrap a focusable trigger
7
- * to surface brief help on hover or focus — explaining icon-only buttons,
8
- * truncated text, or shortcuts. Agents should reuse it rather than building a
9
- * positioned hover popup; use Popover for interactive or longer content.
10
- */
11
- const meta = {
12
- title: 'Feedback/Tooltip',
13
- component: Tooltip,
14
- tags: ['autodocs', 'canonical'],
15
- parameters: {
16
- docs: {
17
- description: {
18
- component:
19
- 'Contextual help text that appears on hover or focus. Prefer this over a hand-rolled hover popup; use Popover for interactive content.',
20
- },
21
- },
22
- },
23
- argTypes: {
24
- side: {
25
- control: 'select',
26
- options: ['top', 'bottom', 'left', 'right'],
27
- description: 'Which side to show the tooltip',
28
- },
29
- align: {
30
- control: 'select',
31
- options: ['start', 'center', 'end'],
32
- description: 'Alignment along the side',
33
- },
34
- sideOffset: { control: 'number', description: 'Distance from trigger in pixels' },
35
- arrow: { control: 'boolean', description: 'Show arrow pointing to trigger' },
36
- disabled: { control: 'boolean', description: 'Disable the tooltip' },
37
- },
38
- args: {
39
- content: 'Save your changes',
40
- side: 'top',
41
- align: 'center',
42
- arrow: true,
43
- children: <Button>Save</Button>,
44
- },
45
- } satisfies Meta<typeof Tooltip>;
46
-
47
- export default meta;
48
-
49
- type Story = StoryObj<typeof meta>;
50
-
51
- export const Default: Story = {
52
- args: { content: 'Save your changes' },
53
- render: (args) => (
54
- <Tooltip {...args}>
55
- <Button>Save</Button>
56
- </Tooltip>
57
- ),
58
- };
59
-
60
- export const Positions: Story = {
61
- render: () => (
62
- <div style={{ display: 'flex', gap: '16px', padding: '40px' }}>
63
- <Tooltip content="Top tooltip" side="top">
64
- <Button variant="secondary">Top</Button>
65
- </Tooltip>
66
- <Tooltip content="Bottom tooltip" side="bottom">
67
- <Button variant="secondary">Bottom</Button>
68
- </Tooltip>
69
- <Tooltip content="Left tooltip" side="left">
70
- <Button variant="secondary">Left</Button>
71
- </Tooltip>
72
- <Tooltip content="Right tooltip" side="right">
73
- <Button variant="secondary">Right</Button>
74
- </Tooltip>
75
- </div>
76
- ),
77
- };
78
-
79
- export const WithShortcut: Story = {
80
- args: { content: 'Undo (Ctrl+Z)' },
81
- render: (args) => (
82
- <Tooltip {...args}>
83
- <Button variant="ghost">Undo</Button>
84
- </Tooltip>
85
- ),
86
- };
87
-
88
- export const NoArrow: Story = {
89
- args: { content: 'Clean tooltip', arrow: false },
90
- render: (args) => (
91
- <Tooltip {...args}>
92
- <Button variant="secondary">Hover me</Button>
93
- </Tooltip>
94
- ),
95
- };
@@ -1,78 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { VisuallyHidden } from '.';
3
-
4
- /**
5
- * VisuallyHidden is the canonical screen-reader-only primitive. It hides content
6
- * visually while keeping it in the accessibility tree — essential for labeling
7
- * icon-only buttons and adding supplementary context. Agents should reuse it
8
- * rather than hand-rolling `sr-only` CSS.
9
- */
10
- const meta = {
11
- title: 'Navigation/VisuallyHidden',
12
- component: VisuallyHidden,
13
- tags: ['autodocs', 'canonical'],
14
- parameters: {
15
- docs: {
16
- description: {
17
- component:
18
- 'Hides content visually while keeping it accessible to screen readers. Prefer this over hand-rolled sr-only CSS for icon labels and supplementary text.',
19
- },
20
- },
21
- },
22
- argTypes: {
23
- as: {
24
- control: 'select',
25
- options: ['span', 'div'],
26
- description: 'HTML element to render',
27
- },
28
- },
29
- args: {
30
- children: 'Search',
31
- as: 'span',
32
- },
33
- } satisfies Meta<typeof VisuallyHidden>;
34
-
35
- export default meta;
36
-
37
- type Story = StoryObj<typeof meta>;
38
-
39
- export const Default: Story = {
40
- args: { children: 'Search' },
41
- };
42
-
43
- export const IconButtonLabel: Story = {
44
- render: () => (
45
- <button
46
- type="button"
47
- style={{
48
- display: 'inline-flex',
49
- alignItems: 'center',
50
- justifyContent: 'center',
51
- width: '40px',
52
- height: '40px',
53
- border: '1px solid var(--fui-border-default)',
54
- borderRadius: '8px',
55
- background: 'var(--fui-color-surface-primary)',
56
- cursor: 'pointer',
57
- }}
58
- >
59
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
60
- <path d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
61
- </svg>
62
- <VisuallyHidden>Search</VisuallyHidden>
63
- </button>
64
- ),
65
- };
66
-
67
- export const SupplementaryText: Story = {
68
- render: () => (
69
- <a href="#" style={{ color: 'var(--fui-color-accent)' }}>
70
- Read more
71
- <VisuallyHidden> about our accessibility features</VisuallyHidden>
72
- </a>
73
- ),
74
- };
75
-
76
- export const AsDiv: Story = {
77
- args: { as: 'div', children: 'Skip to main content' },
78
- };