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