@usefragments/ui 1.0.2 → 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.
- package/README.md +16 -16
- package/dist/assets/fragments-wordmark.cjs +30 -0
- package/dist/assets/fragments-wordmark.d.ts +13 -0
- package/dist/assets/fragments-wordmark.d.ts.map +1 -0
- package/dist/assets/fragments-wordmark.js +30 -0
- package/dist/assets/ui.css +3234 -3116
- package/dist/components/Accordion/Accordion.module.scss.cjs +8 -8
- package/dist/components/Accordion/Accordion.module.scss.js +8 -8
- package/dist/components/Accordion/index.cjs +22 -10
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +22 -10
- package/dist/components/Alert/Alert.module.scss.cjs +13 -13
- package/dist/components/Alert/Alert.module.scss.js +13 -13
- package/dist/components/AppShell/AppShell.module.scss.cjs +22 -10
- package/dist/components/AppShell/AppShell.module.scss.js +22 -10
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/Avatar.module.scss.cjs +13 -13
- package/dist/components/Avatar/Avatar.module.scss.js +13 -13
- package/dist/components/Badge/Badge.module.scss.cjs +16 -16
- package/dist/components/Badge/Badge.module.scss.js +16 -16
- package/dist/components/BentoGrid/BentoGrid.module.scss.cjs +14 -14
- package/dist/components/BentoGrid/BentoGrid.module.scss.js +14 -14
- package/dist/components/Box/Box.module.scss.cjs +152 -152
- package/dist/components/Box/Box.module.scss.js +152 -152
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs +8 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.js +8 -8
- package/dist/components/Button/Button.module.scss.cjs +13 -13
- package/dist/components/Button/Button.module.scss.js +13 -13
- package/dist/components/Card/Card.module.scss.cjs +17 -17
- package/dist/components/Card/Card.module.scss.js +17 -17
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Chart/Chart.module.scss.cjs +15 -15
- package/dist/components/Chart/Chart.module.scss.js +15 -15
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +11 -11
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
- package/dist/components/Chip/Chip.module.scss.cjs +15 -15
- package/dist/components/Chip/Chip.module.scss.js +15 -15
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +21 -21
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +21 -21
- package/dist/components/Collapsible/Collapsible.module.scss.cjs +10 -10
- package/dist/components/Collapsible/Collapsible.module.scss.js +10 -10
- package/dist/components/ColorPicker/ColorPicker.module.scss.cjs +14 -14
- package/dist/components/ColorPicker/ColorPicker.module.scss.js +14 -14
- package/dist/components/Combobox/Combobox.module.scss.cjs +23 -23
- package/dist/components/Combobox/Combobox.module.scss.js +23 -23
- package/dist/components/Combobox/index.cjs +106 -9
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +106 -9
- package/dist/components/Command/Command.module.scss.cjs +11 -11
- package/dist/components/Command/Command.module.scss.js +11 -11
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/DataTable/DataTable.module.scss.cjs +37 -34
- package/dist/components/DataTable/DataTable.module.scss.js +37 -34
- package/dist/components/DataTable/index.d.ts +3 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.module.scss.cjs +33 -33
- package/dist/components/DatePicker/DatePicker.module.scss.js +33 -33
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.module.scss.cjs +14 -14
- package/dist/components/Dialog/Dialog.module.scss.js +14 -14
- package/dist/components/Drawer/Drawer.module.scss.cjs +28 -28
- package/dist/components/Drawer/Drawer.module.scss.js +28 -28
- package/dist/components/Drawer/index.cjs +20 -3
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +20 -3
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +8 -8
- package/dist/components/EmptyState/EmptyState.module.scss.js +8 -8
- package/dist/components/Field/Field.module.scss.cjs +4 -4
- package/dist/components/Field/Field.module.scss.js +4 -4
- package/dist/components/Field/index.cjs +10 -9
- package/dist/components/Field/index.d.ts +7 -7
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +10 -9
- package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
- package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
- package/dist/components/Header/Header.module.scss.cjs +44 -29
- package/dist/components/Header/Header.module.scss.js +44 -29
- package/dist/components/Header/index.cjs +56 -3
- package/dist/components/Header/index.d.ts +25 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -3
- package/dist/components/Icon/Icon.module.scss.cjs +8 -8
- package/dist/components/Icon/Icon.module.scss.js +8 -8
- package/dist/components/IconButton/IconButton.module.scss.cjs +8 -8
- package/dist/components/IconButton/IconButton.module.scss.js +8 -8
- package/dist/components/Image/Image.module.scss.cjs +27 -27
- package/dist/components/Image/Image.module.scss.js +27 -27
- package/dist/components/Input/Input.module.scss.cjs +19 -19
- package/dist/components/Input/Input.module.scss.js +19 -19
- package/dist/components/Link/Link.module.scss.cjs +10 -10
- package/dist/components/Link/Link.module.scss.js +10 -10
- package/dist/components/List/List.module.scss.cjs +19 -19
- package/dist/components/List/List.module.scss.js +19 -19
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Loading/Loading.module.scss.cjs +30 -30
- package/dist/components/Loading/Loading.module.scss.js +30 -30
- package/dist/components/Main/Main.module.scss.cjs +26 -0
- package/dist/components/Main/Main.module.scss.js +26 -0
- package/dist/components/Main/index.cjs +128 -0
- package/dist/components/Main/index.d.ts +22 -0
- package/dist/components/Main/index.d.ts.map +1 -0
- package/dist/components/Main/index.js +111 -0
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/Menu/Menu.module.scss.cjs +14 -14
- package/dist/components/Menu/Menu.module.scss.js +14 -14
- package/dist/components/Message/Message.module.scss.cjs +18 -18
- package/dist/components/Message/Message.module.scss.js +18 -18
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +28 -28
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +28 -28
- package/dist/components/Pagination/Pagination.module.scss.cjs +7 -7
- package/dist/components/Pagination/Pagination.module.scss.js +7 -7
- package/dist/components/Popover/Popover.module.scss.cjs +10 -10
- package/dist/components/Popover/Popover.module.scss.js +10 -10
- package/dist/components/Popover/index.cjs +27 -2
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +27 -2
- package/dist/components/Progress/Progress.module.scss.cjs +25 -25
- package/dist/components/Progress/Progress.module.scss.js +25 -25
- package/dist/components/Prompt/Prompt.module.scss.cjs +18 -18
- package/dist/components/Prompt/Prompt.module.scss.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +17 -17
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +17 -17
- package/dist/components/RadioGroup/index.cjs +2 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +10 -10
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +10 -10
- package/dist/components/Select/Select.module.scss.cjs +17 -17
- package/dist/components/Select/Select.module.scss.js +17 -17
- package/dist/components/Separator/Separator.module.scss.cjs +10 -10
- package/dist/components/Separator/Separator.module.scss.js +10 -10
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +42 -42
- package/dist/components/Sidebar/Sidebar.module.scss.js +42 -42
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +38 -38
- package/dist/components/Skeleton/Skeleton.module.scss.js +38 -38
- package/dist/components/Slider/Slider.module.scss.cjs +12 -12
- package/dist/components/Slider/Slider.module.scss.js +12 -12
- package/dist/components/Table/Table.module.scss.cjs +19 -19
- package/dist/components/Table/Table.module.scss.js +19 -19
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/TableOfContents/index.cjs +22 -42
- package/dist/components/TableOfContents/index.d.ts +3 -3
- package/dist/components/TableOfContents/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.js +22 -42
- package/dist/components/Tabs/Tabs.module.scss.cjs +12 -12
- package/dist/components/Tabs/Tabs.module.scss.js +12 -12
- package/dist/components/Text/Text.module.scss.cjs +51 -51
- package/dist/components/Text/Text.module.scss.js +51 -51
- package/dist/components/Textarea/Textarea.module.scss.cjs +23 -23
- package/dist/components/Textarea/Textarea.module.scss.js +23 -23
- package/dist/components/Theme/ThemeToggle.module.scss.cjs +6 -6
- package/dist/components/Theme/ThemeToggle.module.scss.js +6 -6
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +13 -13
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +13 -13
- package/dist/components/Toast/Toast.module.scss.cjs +21 -21
- package/dist/components/Toast/Toast.module.scss.js +21 -21
- package/dist/components/Toggle/Toggle.module.scss.cjs +13 -13
- package/dist/components/Toggle/Toggle.module.scss.js +13 -13
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +17 -17
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +17 -17
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/data-table.cjs +58 -41
- package/dist/data-table.js +59 -41
- package/dist/datepicker.cjs +32 -72
- package/dist/datepicker.js +32 -72
- package/dist/index.cjs +89 -85
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/fragments.json +1 -1
- package/package.json +9 -8
- package/src/assets/fragments-wordmark.tsx +47 -0
- package/src/components/Accordion/index.tsx +13 -3
- package/src/components/Alert/Alert.module.scss +15 -2
- package/src/components/AppShell/AppShell.module.scss +73 -15
- package/src/components/AppShell/index.tsx +1 -1
- package/src/components/Button/Button.module.scss +19 -20
- package/src/components/Card/Card.module.scss +3 -3
- package/src/components/Card/index.tsx +3 -3
- package/src/components/Checkbox/Checkbox.contract.json +5 -24
- package/src/components/Checkbox/Checkbox.module.scss +4 -2
- package/src/components/Chip/Chip.contract.json +11 -28
- package/src/components/Chip/Chip.module.scss +21 -45
- package/src/components/CodeBlock/CodeBlock.module.scss +2 -7
- package/src/components/Combobox/Combobox.contract.json +6 -24
- package/src/components/Combobox/Combobox.module.scss +3 -2
- package/src/components/Combobox/index.tsx +132 -6
- package/src/components/DataTable/DataTable.contract.json +16 -23
- package/src/components/DataTable/DataTable.module.scss +31 -8
- package/src/components/DataTable/index.tsx +25 -4
- package/src/components/DatePicker/index.tsx +32 -84
- package/src/components/Drawer/index.tsx +38 -12
- package/src/components/Field/index.tsx +35 -35
- package/src/components/Header/Header.contract.json +41 -1
- package/src/components/Header/Header.module.scss +40 -0
- package/src/components/Header/index.tsx +88 -2
- package/src/components/IconButton/IconButton.contract.json +120 -0
- package/src/components/Listbox/Listbox.module.scss +5 -4
- package/src/components/Main/Main.contract.json +79 -0
- package/src/components/Main/Main.module.scss +31 -0
- package/src/components/Main/index.tsx +124 -0
- package/src/components/Menu/Menu.module.scss +8 -10
- package/src/components/Popover/index.tsx +34 -2
- package/src/components/RadioGroup/RadioGroup.contract.json +13 -27
- package/src/components/RadioGroup/index.tsx +4 -0
- package/src/components/Select/Select.module.scss +13 -12
- package/src/components/Table/Table.module.scss +22 -5
- package/src/components/TableOfContents/TableOfContents.contract.json +6 -16
- package/src/components/TableOfContents/TableOfContents.module.scss +20 -14
- package/src/components/TableOfContents/index.tsx +27 -38
- package/src/components/Toast/Toast.module.scss +15 -2
- package/src/components/ToggleGroup/ToggleGroup.module.scss +4 -1
- package/src/index.ts +4 -0
- package/src/styles/globals.scss +13 -10
- package/src/tokens/_component-properties.scss +26 -0
- package/src/tokens/_computed.scss +22 -4
- package/src/tokens/_derive.scss +55 -6
- package/src/tokens/_palettes.scss +24 -0
- package/src/tokens/_seeds.scss +20 -12
- package/src/tokens/_variables.scss +110 -63
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts +0 -33
- package/dist/components/Cloud/DashboardLayoutPrototypes.shared.d.ts.map +0 -1
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts +0 -11
- package/dist/components/Cloud/DashboardLayoutPrototypes.shell.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts +0 -5
- package/dist/components/Cloud/PullRequestsPrototypes.content.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts +0 -4
- package/dist/components/Cloud/PullRequestsPrototypes.detail-panels.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts +0 -3
- package/dist/components/Cloud/PullRequestsPrototypes.detail.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts +0 -86
- package/dist/components/Cloud/PullRequestsPrototypes.id-data.d.ts.map +0 -1
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts +0 -2
- package/dist/components/Cloud/PullRequestsPrototypes.id-page.d.ts.map +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +0 -106
- package/src/components/Alert/Alert.stories.tsx +0 -119
- package/src/components/AppShell/AppShell.stories.tsx +0 -156
- package/src/components/Avatar/Avatar.stories.tsx +0 -74
- package/src/components/Badge/Badge.stories.tsx +0 -92
- package/src/components/BentoGrid/BentoGrid.stories.tsx +0 -98
- package/src/components/Box/Box.stories.tsx +0 -150
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -87
- package/src/components/Button/Button.stories.tsx +0 -103
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -97
- package/src/components/Card/Card.stories.tsx +0 -144
- package/src/components/Chart/Chart.stories.tsx +0 -119
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -68
- package/src/components/Chip/Chip.stories.tsx +0 -70
- package/src/components/Cloud/CloudGovernanceShell.module.scss +0 -88
- package/src/components/Cloud/CloudGovernanceShell.stories.tsx +0 -446
- package/src/components/Cloud/ControlSizing.module.scss +0 -49
- package/src/components/Cloud/ControlSizing.stories.tsx +0 -238
- package/src/components/Cloud/DashboardLayoutPrototypes.module.scss +0 -462
- package/src/components/Cloud/DashboardLayoutPrototypes.shared.tsx +0 -375
- package/src/components/Cloud/DashboardLayoutPrototypes.shell.tsx +0 -147
- package/src/components/Cloud/DashboardLayoutPrototypes.stories.tsx +0 -328
- package/src/components/Cloud/PullRequestsPrototypes.content.tsx +0 -283
- package/src/components/Cloud/PullRequestsPrototypes.detail-panels.tsx +0 -381
- package/src/components/Cloud/PullRequestsPrototypes.detail.tsx +0 -204
- package/src/components/Cloud/PullRequestsPrototypes.id-data.ts +0 -395
- package/src/components/Cloud/PullRequestsPrototypes.id-page.tsx +0 -349
- package/src/components/Cloud/PullRequestsPrototypes.stories.tsx +0 -81
- package/src/components/CodeBlock/CodeBlock.stories.tsx +0 -147
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -94
- package/src/components/ColorPicker/ColorPicker.stories.tsx +0 -74
- package/src/components/Combobox/Combobox.stories.tsx +0 -133
- package/src/components/Command/Command.stories.tsx +0 -102
- package/src/components/ConversationList/ConversationList.stories.tsx +0 -93
- package/src/components/DataTable/DataTable.stories.tsx +0 -129
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -129
- package/src/components/Dialog/Dialog.stories.tsx +0 -154
- package/src/components/Drawer/Drawer.stories.tsx +0 -144
- package/src/components/Editor/Editor.stories.tsx +0 -99
- package/src/components/EmptyState/EmptyState.stories.tsx +0 -97
- package/src/components/Field/Field.stories.tsx +0 -109
- package/src/components/Fieldset/Fieldset.stories.tsx +0 -116
- package/src/components/Form/Form.stories.tsx +0 -142
- package/src/components/Grid/Grid.stories.tsx +0 -125
- package/src/components/Header/Header.stories.tsx +0 -133
- package/src/components/Icon/Icon.stories.tsx +0 -80
- package/src/components/IconButton/IconButton.stories.tsx +0 -78
- package/src/components/Image/Image.stories.tsx +0 -109
- package/src/components/Input/Input.stories.tsx +0 -104
- package/src/components/Link/Link.stories.tsx +0 -67
- package/src/components/List/List.stories.tsx +0 -95
- package/src/components/Listbox/Listbox.stories.tsx +0 -81
- package/src/components/Loading/Loading.stories.tsx +0 -69
- package/src/components/Markdown/Markdown.stories.tsx +0 -75
- package/src/components/Menu/Menu.stories.tsx +0 -113
- package/src/components/Message/Message.stories.tsx +0 -85
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +0 -161
- package/src/components/Pagination/Pagination.stories.tsx +0 -81
- package/src/components/Popover/Popover.stories.tsx +0 -152
- package/src/components/Progress/Progress.stories.tsx +0 -64
- package/src/components/Prompt/Prompt.stories.tsx +0 -93
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -107
- package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -97
- package/src/components/Select/Select.stories.tsx +0 -127
- package/src/components/Separator/Separator.stories.tsx +0 -84
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -122
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -80
- package/src/components/Slider/Slider.stories.tsx +0 -73
- package/src/components/Stack/Stack.stories.tsx +0 -73
- package/src/components/Switch/Switch.stories.tsx +0 -59
- package/src/components/Table/Table.stories.tsx +0 -219
- package/src/components/TableOfContents/TableOfContents.stories.tsx +0 -120
- package/src/components/Tabs/Tabs.stories.tsx +0 -136
- package/src/components/Text/Text.stories.tsx +0 -133
- package/src/components/Textarea/Textarea.stories.tsx +0 -107
- package/src/components/Theme/Theme.stories.tsx +0 -95
- package/src/components/ThinkingIndicator/ThinkingIndicator.stories.tsx +0 -85
- package/src/components/Toast/Toast.stories.tsx +0 -91
- package/src/components/ToggleGroup/ToggleGroup.stories.tsx +0 -114
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -95
- package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +0 -78
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
"name": "RadioGroup",
|
|
4
4
|
"description": "Single selection from a list of mutually exclusive options",
|
|
5
5
|
"category": "forms",
|
|
6
|
-
"tags": [
|
|
7
|
-
"form",
|
|
8
|
-
"radio",
|
|
9
|
-
"selection",
|
|
10
|
-
"options"
|
|
11
|
-
],
|
|
6
|
+
"tags": ["form", "radio", "selection", "options"],
|
|
12
7
|
"status": "stable",
|
|
13
8
|
"sourcePath": "src/components/RadioGroup/index.tsx",
|
|
14
9
|
"exportName": "RadioGroup",
|
|
@@ -26,6 +21,7 @@
|
|
|
26
21
|
"size: sm|md|lg (default: md)",
|
|
27
22
|
"wrapperClassName: string",
|
|
28
23
|
"groupClassName: string",
|
|
24
|
+
"groupId: string",
|
|
29
25
|
"children: node (required)"
|
|
30
26
|
],
|
|
31
27
|
"props": {
|
|
@@ -54,10 +50,7 @@
|
|
|
54
50
|
"description": "Layout orientation",
|
|
55
51
|
"default": "vertical",
|
|
56
52
|
"required": false,
|
|
57
|
-
"values": [
|
|
58
|
-
"horizontal",
|
|
59
|
-
"vertical"
|
|
60
|
-
]
|
|
53
|
+
"values": ["horizontal", "vertical"]
|
|
61
54
|
},
|
|
62
55
|
"disabled": {
|
|
63
56
|
"type": "boolean",
|
|
@@ -90,21 +83,14 @@
|
|
|
90
83
|
"description": "Size variant",
|
|
91
84
|
"default": "md",
|
|
92
85
|
"required": false,
|
|
93
|
-
"values": [
|
|
94
|
-
"sm",
|
|
95
|
-
"md",
|
|
96
|
-
"lg"
|
|
97
|
-
]
|
|
86
|
+
"values": ["sm", "md", "lg"]
|
|
98
87
|
},
|
|
99
88
|
"variant": {
|
|
100
89
|
"type": "enum",
|
|
101
90
|
"description": "Visual variant. 'default' is the inline radio, 'card' renders each item as a full-width clickable card with the radio tucked inside.",
|
|
102
91
|
"default": "default",
|
|
103
92
|
"required": false,
|
|
104
|
-
"values": [
|
|
105
|
-
"default",
|
|
106
|
-
"card"
|
|
107
|
-
]
|
|
93
|
+
"values": ["default", "card"]
|
|
108
94
|
},
|
|
109
95
|
"wrapperClassName": {
|
|
110
96
|
"type": "string",
|
|
@@ -116,6 +102,11 @@
|
|
|
116
102
|
"description": "Class name for the inner radio group element",
|
|
117
103
|
"required": false
|
|
118
104
|
},
|
|
105
|
+
"groupId": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "ID for the inner element with role=radiogroup; the inherited id remains on the outer field wrapper",
|
|
108
|
+
"required": false
|
|
109
|
+
},
|
|
119
110
|
"children": {
|
|
120
111
|
"type": "node",
|
|
121
112
|
"description": "RadioGroup.Item elements",
|
|
@@ -213,19 +204,14 @@
|
|
|
213
204
|
"error: boolean | string - error styling and message",
|
|
214
205
|
"disabled: boolean - disable all options",
|
|
215
206
|
"wrapperClassName/groupClassName - explicit styling targets for wrapper and group",
|
|
207
|
+
"groupId: string - ID forwarded to the inner radiogroup while id remains on the wrapper",
|
|
216
208
|
"RadioGroup.Item supports helperText (preferred) and description (legacy alias) plus controlClassName/contentClassName for item-level styling"
|
|
217
209
|
],
|
|
218
|
-
"a11yRules": [
|
|
219
|
-
"A11Y_RADIO_GROUP",
|
|
220
|
-
"A11Y_LABEL_REQUIRED",
|
|
221
|
-
"A11Y_TARGET_SIZE_MIN"
|
|
222
|
-
]
|
|
210
|
+
"a11yRules": ["A11Y_RADIO_GROUP", "A11Y_LABEL_REQUIRED", "A11Y_TARGET_SIZE_MIN"]
|
|
223
211
|
},
|
|
224
212
|
"ai": {
|
|
225
213
|
"compositionPattern": "compound",
|
|
226
|
-
"subComponents": [
|
|
227
|
-
"Item"
|
|
228
|
-
]
|
|
214
|
+
"subComponents": ["Item"]
|
|
229
215
|
},
|
|
230
216
|
"provenance": {
|
|
231
217
|
"source": "migrated",
|
|
@@ -61,6 +61,8 @@ export interface RadioGroupProps extends Omit<
|
|
|
61
61
|
wrapperClassName?: string;
|
|
62
62
|
/** Class applied to the inner radio group container */
|
|
63
63
|
groupClassName?: string;
|
|
64
|
+
/** ID applied to the inner element with `role="radiogroup"`. The inherited `id` remains on the outer field wrapper for compatibility. */
|
|
65
|
+
groupId?: string;
|
|
64
66
|
/** Children (Radio.Item components) */
|
|
65
67
|
children: React.ReactNode;
|
|
66
68
|
}
|
|
@@ -216,6 +218,7 @@ const RadioGroupRoot = React.forwardRef<HTMLDivElement, RadioGroupProps>(functio
|
|
|
216
218
|
variant = "default",
|
|
217
219
|
wrapperClassName,
|
|
218
220
|
groupClassName,
|
|
221
|
+
groupId,
|
|
219
222
|
children,
|
|
220
223
|
className,
|
|
221
224
|
"aria-label": ariaLabel,
|
|
@@ -252,6 +255,7 @@ const RadioGroupRoot = React.forwardRef<HTMLDivElement, RadioGroupProps>(functio
|
|
|
252
255
|
</span>
|
|
253
256
|
)}
|
|
254
257
|
<BaseRadioGroup
|
|
258
|
+
id={groupId}
|
|
255
259
|
value={value}
|
|
256
260
|
defaultValue={defaultValue}
|
|
257
261
|
onValueChange={handleValueChange}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use
|
|
1
|
+
@use "../../tokens/variables" as *;
|
|
2
|
+
@use "../../tokens/mixins" as *;
|
|
3
3
|
|
|
4
4
|
// Form field wrapper (label + helper + error)
|
|
5
5
|
@include form-field-wrapper;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@include interactive-base;
|
|
11
11
|
@include text-base;
|
|
12
12
|
@include field-shell;
|
|
13
|
-
@include control-size(
|
|
13
|
+
@include control-size("md", "input");
|
|
14
14
|
|
|
15
15
|
display: inline-flex;
|
|
16
16
|
align-items: center;
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
|
|
28
28
|
// Trigger size variants
|
|
29
29
|
.triggerSm {
|
|
30
|
-
@include control-size(
|
|
30
|
+
@include control-size("sm", "input");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.triggerLg {
|
|
34
|
-
@include control-size(
|
|
34
|
+
@include control-size("lg", "input");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Value display
|
|
@@ -86,17 +86,18 @@
|
|
|
86
86
|
border-color: var(--fui-form-group-border, $fui-border);
|
|
87
87
|
|
|
88
88
|
// Item height derived from text-base font + vertical padding
|
|
89
|
-
--
|
|
90
|
-
var(--fui-font-size-sm, #{$fui-font-size-sm}) *
|
|
91
|
-
|
|
89
|
+
--_select-item-h: calc(
|
|
90
|
+
var(--fui-font-size-sm, #{$fui-font-size-sm}) *
|
|
91
|
+
var(--fui-line-height-normal, #{$fui-line-height-normal}) +
|
|
92
|
+
var(--fui-space-2, #{$fui-space-2}) * 2
|
|
92
93
|
);
|
|
93
94
|
|
|
94
95
|
min-width: var(--anchor-width);
|
|
95
96
|
// Show N items + half-peek scroll hint (default 4.5 items)
|
|
96
97
|
// !important needed to override Base UI's inline max-height: 100%
|
|
97
98
|
max-height: calc(
|
|
98
|
-
var(--
|
|
99
|
-
|
|
99
|
+
var(--_select-item-h) * var(--fui-select-max-items, 4.5) + var(--fui-space-1, #{$fui-space-1}) *
|
|
100
|
+
2
|
|
100
101
|
) !important;
|
|
101
102
|
overflow-y: auto !important;
|
|
102
103
|
|
|
@@ -214,12 +215,12 @@
|
|
|
214
215
|
background-color: var(--fui-bg-elevated, $fui-bg-elevated);
|
|
215
216
|
border: 1px solid var(--fui-border, $fui-border);
|
|
216
217
|
|
|
217
|
-
&[data-side=
|
|
218
|
+
&[data-side="top"] {
|
|
218
219
|
border-top: none;
|
|
219
220
|
border-left: none;
|
|
220
221
|
}
|
|
221
222
|
|
|
222
|
-
&[data-side=
|
|
223
|
+
&[data-side="bottom"] {
|
|
223
224
|
border-bottom: none;
|
|
224
225
|
border-right: none;
|
|
225
226
|
}
|
|
@@ -108,14 +108,24 @@
|
|
|
108
108
|
|
|
109
109
|
// Body
|
|
110
110
|
.tbody {
|
|
111
|
+
.td {
|
|
112
|
+
padding-top: var(--fui-space-2, $fui-space-2);
|
|
113
|
+
padding-bottom: var(--fui-space-2, $fui-space-2);
|
|
114
|
+
}
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
.row {
|
|
114
|
-
--fui-table-row-base-bg: var(
|
|
118
|
+
--fui-table-row-base-bg: var(
|
|
119
|
+
--fui-table-bg,
|
|
120
|
+
var(--fui-main-bg, var(--fui-bg-primary, #{$fui-bg-primary}))
|
|
121
|
+
);
|
|
115
122
|
--fui-table-row-bg: var(--fui-table-row-base-bg);
|
|
116
123
|
|
|
117
124
|
border-bottom: 1px solid var(--fui-table-border, var(--fui-border, #{$fui-border}));
|
|
118
|
-
background-color: var(
|
|
125
|
+
background-color: var(
|
|
126
|
+
--fui-table-row-bg,
|
|
127
|
+
var(--fui-table-row-base-bg, var(--fui-bg-primary, #{$fui-bg-primary}))
|
|
128
|
+
);
|
|
119
129
|
transition: background-color var(--fui-transition-fast, $fui-transition-fast);
|
|
120
130
|
|
|
121
131
|
&:last-child {
|
|
@@ -128,11 +138,18 @@
|
|
|
128
138
|
}
|
|
129
139
|
|
|
130
140
|
.selected {
|
|
131
|
-
--fui-table-row-bg: var(
|
|
132
|
-
|
|
141
|
+
--fui-table-row-bg: var(
|
|
142
|
+
--fui-table-row-selected-bg,
|
|
143
|
+
color-mix(in srgb, var(--fui-text-primary, #{$fui-text-primary}) 8%, transparent)
|
|
144
|
+
);
|
|
145
|
+
box-shadow: inset 1px 0 0
|
|
146
|
+
var(--fui-table-row-selected-border, var(--fui-border-strong, #{$fui-border-strong}));
|
|
133
147
|
|
|
134
148
|
&:hover {
|
|
135
|
-
--fui-table-row-bg: var(
|
|
149
|
+
--fui-table-row-bg: var(
|
|
150
|
+
--fui-table-row-selected-bg,
|
|
151
|
+
color-mix(in srgb, var(--fui-text-primary, #{$fui-text-primary}) 10%, transparent)
|
|
152
|
+
);
|
|
136
153
|
}
|
|
137
154
|
}
|
|
138
155
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "TableOfContents",
|
|
4
|
-
"description": "Sticky sidebar navigation for long-form content or filterable lists. Renders
|
|
4
|
+
"description": "Sticky sidebar navigation for long-form content or filterable lists. Renders a quiet, flush index with nested indentation and an ink-weight active state.",
|
|
5
5
|
"category": "navigation",
|
|
6
6
|
"tags": [
|
|
7
7
|
"toc",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"name": "Nested Groups",
|
|
87
|
-
"description": "Filterable list grouped by category
|
|
87
|
+
"description": "Filterable list grouped by category with clear nested indentation",
|
|
88
88
|
"code": "<TableOfContents title=\"Components\">\n <TableOfContents.Item id=\"all\" active>All</TableOfContents.Item>\n <TableOfContents.Group label=\"Primitives\" trailing={<span>3</span>}>\n <TableOfContents.Item id=\"button\">Button</TableOfContents.Item>\n <TableOfContents.Item id=\"card\">Card</TableOfContents.Item>\n <TableOfContents.Item id=\"input\">Input</TableOfContents.Item>\n </TableOfContents.Group>\n <TableOfContents.Group label=\"Custom\" defaultOpen={false}>\n <TableOfContents.Item id=\"features\">Features</TableOfContents.Item>\n <TableOfContents.Item id=\"plans\">Plans</TableOfContents.Item>\n </TableOfContents.Group>\n</TableOfContents>"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"hideTitle: boolean - hide the title",
|
|
127
127
|
"label: string - aria-label for nav landmark",
|
|
128
128
|
"TableOfContents.Item id: string - heading ID to link to",
|
|
129
|
-
"TableOfContents.Item active: boolean - highlight
|
|
129
|
+
"TableOfContents.Item active: boolean - highlight the current item with ink and weight",
|
|
130
130
|
"TableOfContents.Item indent: boolean - legacy depth=1 indent for flat lists; prefer Group for new code",
|
|
131
131
|
"TableOfContents.Item leading/trailing: node - optional adornments before/after the label",
|
|
132
132
|
"TableOfContents.Group label: node - header text for the group",
|
|
@@ -135,22 +135,12 @@
|
|
|
135
135
|
"TableOfContents.Group trailing/leading: node - optional adornments on the group header row",
|
|
136
136
|
"Forwards standard nav/anchor DOM props; TableOfContents.Item onClick can prevent default smooth scroll"
|
|
137
137
|
],
|
|
138
|
-
"a11yRules": [
|
|
139
|
-
"A11Y_NAV_LANDMARK",
|
|
140
|
-
"A11Y_ARIA_CURRENT",
|
|
141
|
-
"A11Y_ARIA_EXPANDED"
|
|
142
|
-
]
|
|
138
|
+
"a11yRules": ["A11Y_NAV_LANDMARK", "A11Y_ARIA_CURRENT", "A11Y_ARIA_EXPANDED"]
|
|
143
139
|
},
|
|
144
140
|
"ai": {
|
|
145
141
|
"compositionPattern": "compound",
|
|
146
|
-
"subComponents": [
|
|
147
|
-
|
|
148
|
-
"Group"
|
|
149
|
-
],
|
|
150
|
-
"requiredChildren": [
|
|
151
|
-
"Item",
|
|
152
|
-
"Group"
|
|
153
|
-
],
|
|
142
|
+
"subComponents": ["Item", "Group"],
|
|
143
|
+
"requiredChildren": ["Item", "Group"],
|
|
154
144
|
"commonPatterns": [
|
|
155
145
|
"<TableOfContents>{headings.map(h => <TableOfContents.Item key={h.id} id={h.id} active={activeId === h.id} indent={h.level === 3}>{h.text}</TableOfContents.Item>)}</TableOfContents>",
|
|
156
146
|
"<TableOfContents>{groups.map(g => <TableOfContents.Group key={g.label} label={g.label} trailing={g.count}>{g.items.map(i => <TableOfContents.Item key={i.id} id={i.id} active={activeId === i.id}>{i.label}</TableOfContents.Item>)}</TableOfContents.Group>)}</TableOfContents>"
|
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
@use "../../tokens/mixins" as *;
|
|
3
3
|
|
|
4
4
|
// ============================================
|
|
5
|
-
//
|
|
5
|
+
// Dormant single-rail geometry
|
|
6
6
|
// ============================================
|
|
7
7
|
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// at depth-1 → depth-0 transitions a closing elbow is drawn via `::after`
|
|
12
|
-
// on the depth-0 item. Active items paint their rail in accent; the curves
|
|
13
|
-
// into and out of an active depth-1 also flip to accent so the section
|
|
14
|
-
// reads as one continuous coloured snake.
|
|
8
|
+
// The public default is the quiet, flush index disabled below. These values
|
|
9
|
+
// retain the existing optional rail geometry without making its inset part of
|
|
10
|
+
// the default list contract.
|
|
15
11
|
|
|
16
12
|
$rail-x-0: 7px;
|
|
17
13
|
$rail-indent: 14px;
|
|
18
14
|
$rail-x-1: 21px; // = $rail-x-0 + $rail-indent
|
|
19
|
-
$rail-pad: 18px; // <ul> padding
|
|
15
|
+
$rail-pad: 18px; // optional rail inset; never default <ul> padding
|
|
20
16
|
$rail-curve: 14px;
|
|
21
17
|
$rail-thickness: 1px;
|
|
22
18
|
$rail-active-thickness: 1px;
|
|
@@ -44,11 +40,13 @@ $rail-from-item-1: $rail-x-1 - $rail-pad; // 3px
|
|
|
44
40
|
padding: 0 var(--fui-space-2, $fui-space-2);
|
|
45
41
|
}
|
|
46
42
|
|
|
43
|
+
// Plain index (the design-system default, see below) draws no rail, so the
|
|
44
|
+
// list is flush — its links/group headers share the same inline inset as
|
|
45
|
+
// .title. A future rail variant must reinstate its own $rail-pad inset.
|
|
47
46
|
.list {
|
|
48
47
|
list-style: none;
|
|
49
48
|
margin: 0;
|
|
50
49
|
padding: 0;
|
|
51
|
-
padding-left: $rail-pad;
|
|
52
50
|
position: relative;
|
|
53
51
|
display: flex;
|
|
54
52
|
flex-direction: column;
|
|
@@ -176,6 +174,15 @@ $rail-from-item-1: $rail-x-1 - $rail-pad; // 3px
|
|
|
176
174
|
// Item link
|
|
177
175
|
// ============================================
|
|
178
176
|
|
|
177
|
+
// ── Plain index (design-system default) ──────────────────────────────────────
|
|
178
|
+
// The "on this page" index reads as a quiet list — the active row is signalled
|
|
179
|
+
// by ink + medium weight (see .active), not a coloured rail. Drop the per-row
|
|
180
|
+
// rail and elbow pseudo-elements the snake geometry above would otherwise draw.
|
|
181
|
+
.root [data-depth]::before,
|
|
182
|
+
.root [data-depth]::after {
|
|
183
|
+
content: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
179
186
|
.link {
|
|
180
187
|
display: flex;
|
|
181
188
|
align-items: center;
|
|
@@ -201,9 +208,8 @@ $rail-from-item-1: $rail-x-1 - $rail-pad; // 3px
|
|
|
201
208
|
}
|
|
202
209
|
}
|
|
203
210
|
|
|
204
|
-
// Depth-1
|
|
205
|
-
//
|
|
206
|
-
// paint over the line. Reduced padding-left keeps the text in the same x-position.
|
|
211
|
+
// Depth-1 links carry the hierarchy indent while the top-level index remains
|
|
212
|
+
// flush with the title and group headers.
|
|
207
213
|
[data-depth="1"] .link {
|
|
208
214
|
margin-left: var(--fui-space-2, $fui-space-2);
|
|
209
215
|
padding-left: $rail-indent;
|
|
@@ -231,7 +237,7 @@ $rail-from-item-1: $rail-x-1 - $rail-pad; // 3px
|
|
|
231
237
|
}
|
|
232
238
|
|
|
233
239
|
.active {
|
|
234
|
-
color: var(--fui-
|
|
240
|
+
color: var(--fui-text-primary, $fui-text-primary);
|
|
235
241
|
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
236
242
|
}
|
|
237
243
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import styles from
|
|
5
|
-
import { Text } from
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import styles from "./TableOfContents.module.scss";
|
|
5
|
+
import { Text } from "../Text";
|
|
6
6
|
|
|
7
7
|
// ============================================
|
|
8
8
|
// Types
|
|
@@ -18,7 +18,10 @@ export interface TableOfContentsProps extends React.HTMLAttributes<HTMLElement>
|
|
|
18
18
|
hideTitle?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export interface TableOfContentsItemProps extends Omit<
|
|
21
|
+
export interface TableOfContentsItemProps extends Omit<
|
|
22
|
+
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
23
|
+
"children"
|
|
24
|
+
> {
|
|
22
25
|
children: React.ReactNode;
|
|
23
26
|
/** The heading ID to link to */
|
|
24
27
|
id: string;
|
|
@@ -89,14 +92,14 @@ function ChevronIcon() {
|
|
|
89
92
|
|
|
90
93
|
function TableOfContentsRoot({
|
|
91
94
|
children,
|
|
92
|
-
label =
|
|
93
|
-
title =
|
|
95
|
+
label = "Table of contents",
|
|
96
|
+
title = "On This Page",
|
|
94
97
|
hideTitle = false,
|
|
95
98
|
className,
|
|
96
|
-
|
|
99
|
+
"aria-label": ariaLabel,
|
|
97
100
|
...htmlProps
|
|
98
101
|
}: TableOfContentsProps) {
|
|
99
|
-
const classes = [styles.root, className].filter(Boolean).join(
|
|
102
|
+
const classes = [styles.root, className].filter(Boolean).join(" ");
|
|
100
103
|
|
|
101
104
|
return (
|
|
102
105
|
<nav {...htmlProps} aria-label={ariaLabel ?? label} className={classes}>
|
|
@@ -127,11 +130,7 @@ function TableOfContentsItem({
|
|
|
127
130
|
const { depth } = React.useContext(TocContext);
|
|
128
131
|
const effectiveDepth = depth > 0 ? depth : indent ? 1 : 0;
|
|
129
132
|
|
|
130
|
-
const linkClasses = [
|
|
131
|
-
styles.link,
|
|
132
|
-
active && styles.active,
|
|
133
|
-
className,
|
|
134
|
-
].filter(Boolean).join(' ');
|
|
133
|
+
const linkClasses = [styles.link, active && styles.active, className].filter(Boolean).join(" ");
|
|
135
134
|
|
|
136
135
|
const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
|
137
136
|
onClick?.(e);
|
|
@@ -140,23 +139,19 @@ function TableOfContentsItem({
|
|
|
140
139
|
e.preventDefault();
|
|
141
140
|
const el = document.getElementById(id);
|
|
142
141
|
if (el) {
|
|
143
|
-
el.scrollIntoView({ behavior:
|
|
144
|
-
window.history.replaceState(null,
|
|
142
|
+
el.scrollIntoView({ behavior: "smooth" });
|
|
143
|
+
window.history.replaceState(null, "", `#${id}`);
|
|
145
144
|
}
|
|
146
145
|
};
|
|
147
146
|
|
|
148
147
|
return (
|
|
149
|
-
<li
|
|
150
|
-
className={styles.item}
|
|
151
|
-
data-depth={effectiveDepth}
|
|
152
|
-
data-active={active || undefined}
|
|
153
|
-
>
|
|
148
|
+
<li className={styles.item} data-depth={effectiveDepth} data-active={active || undefined}>
|
|
154
149
|
<a
|
|
155
150
|
{...htmlProps}
|
|
156
151
|
href={`#${id}`}
|
|
157
152
|
className={linkClasses}
|
|
158
153
|
onClick={handleClick}
|
|
159
|
-
aria-current={active ?
|
|
154
|
+
aria-current={active ? "location" : undefined}
|
|
160
155
|
>
|
|
161
156
|
{leading != null && <span className={styles.leading}>{leading}</span>}
|
|
162
157
|
<span className={styles.linkLabel}>{children}</span>
|
|
@@ -169,7 +164,7 @@ function TableOfContentsItem({
|
|
|
169
164
|
function useControlledOpen(
|
|
170
165
|
controlled: boolean | undefined,
|
|
171
166
|
defaultValue: boolean,
|
|
172
|
-
onChange: ((open: boolean) => void) | undefined
|
|
167
|
+
onChange: ((open: boolean) => void) | undefined
|
|
173
168
|
): [boolean, (next: boolean) => void] {
|
|
174
169
|
const [internal, setInternal] = React.useState(defaultValue);
|
|
175
170
|
const isControlled = controlled !== undefined;
|
|
@@ -179,14 +174,14 @@ function useControlledOpen(
|
|
|
179
174
|
if (!isControlled) setInternal(next);
|
|
180
175
|
onChange?.(next);
|
|
181
176
|
},
|
|
182
|
-
[isControlled, onChange]
|
|
177
|
+
[isControlled, onChange]
|
|
183
178
|
);
|
|
184
179
|
return [value, setValue];
|
|
185
180
|
}
|
|
186
181
|
|
|
187
|
-
// Group renders a Fragment
|
|
188
|
-
// siblings in the parent <ul
|
|
189
|
-
//
|
|
182
|
+
// Group renders a Fragment so its header <li> and children remain direct
|
|
183
|
+
// siblings in the parent <ul>. This preserves list semantics and depth-based
|
|
184
|
+
// indentation without adding a nested list inset.
|
|
190
185
|
function TableOfContentsGroup({
|
|
191
186
|
children,
|
|
192
187
|
label,
|
|
@@ -209,7 +204,9 @@ function TableOfContentsGroup({
|
|
|
209
204
|
styles.groupHeader,
|
|
210
205
|
isToggleable && styles.groupHeaderInteractive,
|
|
211
206
|
active && styles.groupHeaderActive,
|
|
212
|
-
]
|
|
207
|
+
]
|
|
208
|
+
.filter(Boolean)
|
|
209
|
+
.join(" ");
|
|
213
210
|
|
|
214
211
|
const headerContent = (
|
|
215
212
|
<>
|
|
@@ -226,11 +223,7 @@ function TableOfContentsGroup({
|
|
|
226
223
|
|
|
227
224
|
return (
|
|
228
225
|
<>
|
|
229
|
-
<li
|
|
230
|
-
className={styles.groupHeaderRow}
|
|
231
|
-
data-depth={depth}
|
|
232
|
-
data-active={active || undefined}
|
|
233
|
-
>
|
|
226
|
+
<li className={styles.groupHeaderRow} data-depth={depth} data-active={active || undefined}>
|
|
234
227
|
{isToggleable ? (
|
|
235
228
|
<button
|
|
236
229
|
type="button"
|
|
@@ -244,11 +237,7 @@ function TableOfContentsGroup({
|
|
|
244
237
|
<div className={headerClasses}>{headerContent}</div>
|
|
245
238
|
)}
|
|
246
239
|
</li>
|
|
247
|
-
{isOpen &&
|
|
248
|
-
<TocContext.Provider value={{ depth: depth + 1 }}>
|
|
249
|
-
{children}
|
|
250
|
-
</TocContext.Provider>
|
|
251
|
-
)}
|
|
240
|
+
{isOpen && <TocContext.Provider value={{ depth: depth + 1 }}>{children}</TocContext.Provider>}
|
|
252
241
|
</>
|
|
253
242
|
);
|
|
254
243
|
}
|
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
|
|
64
64
|
.toast {
|
|
65
65
|
display: flex;
|
|
66
|
-
|
|
66
|
+
// Single-line toasts (title only) read best vertically centered; toasts
|
|
67
|
+
// with a description are multi-line and top-align — see `:has(.description)`.
|
|
68
|
+
align-items: center;
|
|
67
69
|
gap: var(--fui-space-1, $fui-space-1);
|
|
68
70
|
padding: var(--fui-space-2, $fui-space-2) var(--fui-space-3, $fui-space-3);
|
|
69
71
|
background-color: var(--fui-bg-elevated, $fui-bg-elevated);
|
|
@@ -76,6 +78,12 @@
|
|
|
76
78
|
animation: toastEnter var(--fui-transition-normal, $fui-transition-normal);
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
// With a description the toast is multi-line: top-align icon/close to the
|
|
82
|
+
// first line rather than the block centre.
|
|
83
|
+
.toast:has(.description) {
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
}
|
|
86
|
+
|
|
79
87
|
@keyframes toastEnter {
|
|
80
88
|
from {
|
|
81
89
|
opacity: 0;
|
|
@@ -177,7 +185,6 @@
|
|
|
177
185
|
flex-shrink: 0;
|
|
178
186
|
width: 1.25rem;
|
|
179
187
|
height: 1.25rem;
|
|
180
|
-
margin-top: 1px;
|
|
181
188
|
|
|
182
189
|
svg {
|
|
183
190
|
width: 100%;
|
|
@@ -185,6 +192,12 @@
|
|
|
185
192
|
}
|
|
186
193
|
}
|
|
187
194
|
|
|
195
|
+
// Nudge the icon to meet the first line only in multi-line toasts; centered
|
|
196
|
+
// single-line toasts need no offset.
|
|
197
|
+
.toast:has(.description) .icon {
|
|
198
|
+
margin-top: 1px;
|
|
199
|
+
}
|
|
200
|
+
|
|
188
201
|
.content {
|
|
189
202
|
flex: 1;
|
|
190
203
|
min-width: 0;
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
.item {
|
|
38
38
|
background-color: transparent;
|
|
39
39
|
border: 1px solid transparent;
|
|
40
|
-
|
|
40
|
+
// Match the container's radius (form-group-surface = --fui-radius-lg),
|
|
41
|
+
// less its 1px inset border, so the selected fill nests inside the
|
|
42
|
+
// container corners instead of poking past them.
|
|
43
|
+
border-radius: calc(var(--fui-radius-lg, #{$fui-radius-lg}) - 1px);
|
|
41
44
|
|
|
42
45
|
&.selected {
|
|
43
46
|
background-color: var(--fui-toggle-group-selected-bg, var(--fui-bg-hover, #{$fui-bg-hover}));
|
package/src/index.ts
CHANGED
|
@@ -389,6 +389,9 @@ export {
|
|
|
389
389
|
type ResponsiveGap,
|
|
390
390
|
} from "./components/Stack";
|
|
391
391
|
|
|
392
|
+
// Main
|
|
393
|
+
export { Main, type MainProps, type MainRegionProps, type MainMeasure } from "./components/Main";
|
|
394
|
+
|
|
392
395
|
// Text
|
|
393
396
|
export { Text, type TextProps } from "./components/Text";
|
|
394
397
|
|
|
@@ -579,6 +582,7 @@ export {
|
|
|
579
582
|
|
|
580
583
|
// Assets
|
|
581
584
|
export { FragmentsLogo, fragmentsLogoSvg, type FragmentsLogoProps } from "./assets/fragments-logo";
|
|
585
|
+
export { FragmentsWordmark, type FragmentsWordmarkProps } from "./assets/fragments-wordmark";
|
|
582
586
|
|
|
583
587
|
// NavigationMenu
|
|
584
588
|
export {
|
package/src/styles/globals.scss
CHANGED
|
@@ -24,14 +24,17 @@
|
|
|
24
24
|
// Consumers set these via @use ... with().
|
|
25
25
|
// Values are forwarded to the seed/token chain below.
|
|
26
26
|
|
|
27
|
-
$fui-brand: #
|
|
28
|
-
$fui-neutral: "
|
|
27
|
+
$fui-brand: #006b57 !default;
|
|
28
|
+
$fui-neutral: "carbon" !default;
|
|
29
29
|
$fui-density: "default" !default;
|
|
30
30
|
$fui-radius-style: "default" !default;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
$fui-
|
|
31
|
+
// Status seeds tuned to sit in one family with the sage brand (see
|
|
32
|
+
// tokens/_seeds.scss): danger is sage's warm complement, warning its
|
|
33
|
+
// split-complement, info a cool teal-adjacent slate — all muted to match.
|
|
34
|
+
$fui-danger: #d97066 !default;
|
|
35
|
+
$fui-success: #7fc9b3 !default;
|
|
36
|
+
$fui-warning: #e0aa5c !default;
|
|
37
|
+
$fui-info: #7fa6c4 !default;
|
|
35
38
|
|
|
36
39
|
// Configure seeds BEFORE loading variables.
|
|
37
40
|
// Sass module singleton: once configured here, every subsequent
|
|
@@ -137,7 +140,7 @@ $fui-info: #3b82f6 !default;
|
|
|
137
140
|
::selection {
|
|
138
141
|
background-color: var(
|
|
139
142
|
--fui-selection-bg,
|
|
140
|
-
color-mix(in srgb, var(--fui-
|
|
143
|
+
color-mix(in srgb, var(--fui-color-accent, #7fc9b3) 18%, transparent)
|
|
141
144
|
);
|
|
142
145
|
color: var(--fui-selection-color, var(--fui-text-primary, #171717));
|
|
143
146
|
}
|
|
@@ -197,11 +200,11 @@ $fui-info: #3b82f6 !default;
|
|
|
197
200
|
}
|
|
198
201
|
|
|
199
202
|
:where(:focus-visible) {
|
|
200
|
-
outline: 1px solid color-mix(in srgb, var(--fui-focus-ring-color, #
|
|
203
|
+
outline: 1px solid color-mix(in srgb, var(--fui-focus-ring-color, #006b57) 24%, transparent);
|
|
201
204
|
outline-offset: var(--fui-focus-ring-offset, 2px);
|
|
202
205
|
box-shadow:
|
|
203
206
|
0 0 0 calc(var(--fui-focus-ring-width, 2px) + 1px)
|
|
204
|
-
color-mix(in srgb, var(--fui-focus-ring-color, #
|
|
205
|
-
0 10px 24px -16px color-mix(in srgb, var(--fui-focus-ring-color, #
|
|
207
|
+
color-mix(in srgb, var(--fui-focus-ring-color, #006b57) 10%, transparent),
|
|
208
|
+
0 10px 24px -16px color-mix(in srgb, var(--fui-focus-ring-color, #006b57) 18%, transparent);
|
|
206
209
|
}
|
|
207
210
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Component-scoped custom-property contract.
|
|
2
|
+
//
|
|
3
|
+
// These properties are authored on component instances from public props or
|
|
4
|
+
// measured Base UI state. The mixin is intentionally not emitted at :root:
|
|
5
|
+
// doing so would override each component's fallback/inheritance behavior.
|
|
6
|
+
// Governance reads this file as the explicit vocabulary for dynamic values.
|
|
7
|
+
@mixin fui-component-property-contract {
|
|
8
|
+
--fui-checkbox-radius: 0.25rem;
|
|
9
|
+
--fui-grid-min-child-width: 16rem;
|
|
10
|
+
--fui-line-clamp: 2;
|
|
11
|
+
--fui-navmenu-viewport-height: 0px;
|
|
12
|
+
--fui-navmenu-viewport-left: 0px;
|
|
13
|
+
--fui-navmenu-viewport-width: 0px;
|
|
14
|
+
--fui-prompt-inset-left: 0px;
|
|
15
|
+
--fui-select-max-items: 4.5;
|
|
16
|
+
--fui-stack-direction: column;
|
|
17
|
+
--fui-stack-direction-sm: var(--fui-stack-direction);
|
|
18
|
+
--fui-stack-direction-md: var(--fui-stack-direction-sm);
|
|
19
|
+
--fui-stack-direction-lg: var(--fui-stack-direction-md);
|
|
20
|
+
--fui-stack-direction-xl: var(--fui-stack-direction-lg);
|
|
21
|
+
--fui-stack-gap: 0;
|
|
22
|
+
--fui-stack-gap-sm: var(--fui-stack-gap);
|
|
23
|
+
--fui-stack-gap-md: var(--fui-stack-gap-sm);
|
|
24
|
+
--fui-stack-gap-lg: var(--fui-stack-gap-md);
|
|
25
|
+
--fui-stack-gap-xl: var(--fui-stack-gap-lg);
|
|
26
|
+
}
|