@usefragments/ui 1.5.3 → 1.6.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 +1 -1
- package/dist/assets/ui.css +8808 -5810
- package/dist/chart.cjs +7 -20
- package/dist/chart.js +7 -20
- package/dist/colorpicker.cjs +2 -1
- package/dist/colorpicker.js +2 -1
- package/dist/components/Accordion/Accordion.module.scss.cjs +8 -8
- package/dist/components/Accordion/Accordion.module.scss.js +8 -8
- package/dist/components/Alert/Alert.module.scss.cjs +12 -12
- package/dist/components/Alert/Alert.module.scss.js +12 -12
- package/dist/components/AppShell/AppShell.module.scss.cjs +14 -14
- package/dist/components/AppShell/AppShell.module.scss.js +14 -14
- package/dist/components/AppShell/index.cjs +5 -3
- package/dist/components/AppShell/index.d.ts +4 -2
- package/dist/components/AppShell/index.d.ts.map +1 -1
- package/dist/components/AppShell/index.js +5 -3
- package/dist/components/Avatar/Avatar.module.scss.cjs +17 -14
- package/dist/components/Avatar/Avatar.module.scss.js +17 -14
- package/dist/components/Avatar/index.cjs +100 -118
- package/dist/components/Avatar/index.d.ts +7 -5
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.js +100 -118
- package/dist/components/Badge/Badge.module.scss.cjs +19 -19
- package/dist/components/Badge/Badge.module.scss.js +19 -19
- 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 +14 -14
- package/dist/components/Button/Button.module.scss.js +14 -14
- package/dist/components/ButtonGroup/ButtonGroup.module.scss.cjs +15 -15
- package/dist/components/ButtonGroup/ButtonGroup.module.scss.js +15 -15
- package/dist/components/Card/Card.module.scss.cjs +18 -18
- package/dist/components/Card/Card.module.scss.js +18 -18
- package/dist/components/Chart/Chart.module.scss.cjs +15 -15
- package/dist/components/Chart/Chart.module.scss.js +15 -15
- package/dist/components/Chart/index.d.ts +7 -7
- package/dist/components/Chart/index.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +9 -15
- package/dist/components/Checkbox/Checkbox.module.scss.js +9 -15
- package/dist/components/Checkbox/index.cjs +4 -6
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +4 -6
- package/dist/components/Chip/Chip.module.scss.cjs +15 -15
- package/dist/components/Chip/Chip.module.scss.js +15 -15
- package/dist/components/Chip/index.cjs +4 -5
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Chip/index.js +2 -3
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +22 -22
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +22 -22
- package/dist/components/Collapsible/Collapsible.module.scss.cjs +9 -12
- package/dist/components/Collapsible/Collapsible.module.scss.js +9 -12
- package/dist/components/Collapsible/index.cjs +3 -2
- package/dist/components/Collapsible/index.d.ts +3 -3
- package/dist/components/Collapsible/index.d.ts.map +1 -1
- package/dist/components/Collapsible/index.js +3 -2
- package/dist/components/ColorPicker/ColorPicker.module.scss.cjs +16 -16
- package/dist/components/ColorPicker/ColorPicker.module.scss.js +16 -16
- package/dist/components/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.module.scss.cjs +21 -27
- package/dist/components/Combobox/Combobox.module.scss.js +21 -27
- package/dist/components/Combobox/index.cjs +4 -4
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +4 -4
- 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 +11 -14
- package/dist/components/ConversationList/ConversationList.module.scss.js +11 -14
- package/dist/components/ConversationList/index.cjs +40 -44
- package/dist/components/ConversationList/index.d.ts +3 -3
- package/dist/components/ConversationList/index.d.ts.map +1 -1
- package/dist/components/ConversationList/index.js +40 -44
- package/dist/components/DataTable/DataTable.module.scss.cjs +32 -56
- package/dist/components/DataTable/DataTable.module.scss.js +32 -56
- package/dist/components/DataTable/index.d.ts +5 -4
- 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.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 +31 -28
- package/dist/components/Drawer/Drawer.module.scss.js +31 -28
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Editor/Editor.module.scss.cjs +23 -23
- package/dist/components/Editor/Editor.module.scss.js +23 -23
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +12 -12
- package/dist/components/EmptyState/EmptyState.module.scss.js +12 -12
- package/dist/components/Field/Field.module.scss.cjs +8 -5
- package/dist/components/Field/Field.module.scss.js +8 -5
- package/dist/components/Field/index.cjs +10 -1
- package/dist/components/Field/index.d.ts +9 -2
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +10 -1
- package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
- package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
- package/dist/components/Form/Form.module.scss.cjs +5 -2
- package/dist/components/Form/Form.module.scss.js +5 -2
- package/dist/components/Form/index.cjs +6 -1
- package/dist/components/Form/index.d.ts +8 -3
- package/dist/components/Form/index.d.ts.map +1 -1
- package/dist/components/Form/index.js +6 -1
- package/dist/components/Grid/Grid.module.scss.cjs +54 -72
- package/dist/components/Grid/Grid.module.scss.js +54 -72
- package/dist/components/Grid/index.cjs +57 -77
- package/dist/components/Grid/index.d.ts +11 -11
- package/dist/components/Grid/index.d.ts.map +1 -1
- package/dist/components/Grid/index.js +57 -77
- package/dist/components/Header/Header.module.scss.cjs +33 -33
- package/dist/components/Header/Header.module.scss.js +33 -33
- package/dist/components/Header/index.cjs +2 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +2 -1
- package/dist/components/Icon/Icon.module.scss.cjs +29 -8
- package/dist/components/Icon/Icon.module.scss.js +30 -9
- package/dist/components/Icon/index.cjs +30 -48
- package/dist/components/Icon/index.d.ts +6 -6
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +30 -48
- package/dist/components/IconButton/IconButton.module.scss.cjs +8 -8
- package/dist/components/IconButton/IconButton.module.scss.js +8 -8
- package/dist/components/Input/Input.module.scss.cjs +19 -25
- package/dist/components/Input/Input.module.scss.js +19 -25
- package/dist/components/Input/index.cjs +1 -2
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +1 -2
- 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/List/index.cjs +4 -7
- package/dist/components/List/index.d.ts.map +1 -1
- package/dist/components/List/index.js +4 -7
- package/dist/components/Listbox/Listbox.module.scss.cjs +9 -9
- package/dist/components/Listbox/Listbox.module.scss.js +9 -9
- package/dist/components/Loading/Loading.module.scss.cjs +30 -30
- package/dist/components/Loading/Loading.module.scss.js +30 -30
- package/dist/components/Loading/index.cjs +39 -67
- package/dist/components/Loading/index.d.ts +6 -6
- package/dist/components/Loading/index.d.ts.map +1 -1
- package/dist/components/Loading/index.js +39 -67
- package/dist/components/Main/Main.module.scss.cjs +7 -7
- package/dist/components/Main/Main.module.scss.js +7 -7
- 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 +16 -16
- package/dist/components/Menu/Menu.module.scss.js +16 -16
- package/dist/components/Menu/index.cjs +19 -61
- package/dist/components/Menu/index.d.ts +10 -10
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +19 -61
- package/dist/components/Message/Message.module.scss.cjs +18 -21
- package/dist/components/Message/Message.module.scss.js +18 -21
- package/dist/components/Message/index.cjs +15 -2
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +15 -2
- 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 +18 -9
- package/dist/components/Pagination/Pagination.module.scss.js +19 -10
- package/dist/components/Pagination/index.cjs +5 -2
- package/dist/components/Pagination/index.d.ts +3 -1
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +5 -2
- package/dist/components/Popover/Popover.module.scss.cjs +10 -10
- package/dist/components/Popover/Popover.module.scss.js +10 -10
- package/dist/components/Progress/Progress.module.scss.cjs +29 -32
- package/dist/components/Progress/Progress.module.scss.js +29 -32
- package/dist/components/Progress/geometry.cjs +30 -0
- package/dist/components/Progress/geometry.d.ts +8 -0
- package/dist/components/Progress/geometry.d.ts.map +1 -0
- package/dist/components/Progress/geometry.js +30 -0
- package/dist/components/Progress/index.cjs +40 -29
- package/dist/components/Progress/index.d.ts +4 -3
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +40 -29
- package/dist/components/Prompt/Prompt.module.scss.cjs +29 -29
- package/dist/components/Prompt/Prompt.module.scss.js +29 -29
- package/dist/components/Prompt/index.cjs +5 -4
- package/dist/components/Prompt/index.d.ts.map +1 -1
- package/dist/components/Prompt/index.js +5 -4
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +15 -21
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +15 -21
- package/dist/components/RadioGroup/index.cjs +7 -6
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +7 -6
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +7 -22
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +7 -22
- package/dist/components/ScrollArea/index.cjs +66 -42
- package/dist/components/ScrollArea/index.d.ts +3 -2
- package/dist/components/ScrollArea/index.d.ts.map +1 -1
- package/dist/components/ScrollArea/index.js +66 -42
- package/dist/components/ScrollArea/scroll-state.cjs +58 -0
- package/dist/components/ScrollArea/scroll-state.d.ts +16 -0
- package/dist/components/ScrollArea/scroll-state.d.ts.map +1 -0
- package/dist/components/ScrollArea/scroll-state.js +58 -0
- package/dist/components/Select/Select.module.scss.cjs +21 -21
- package/dist/components/Select/Select.module.scss.js +21 -21
- package/dist/components/Select/index.cjs +3 -2
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +3 -2
- package/dist/components/Separator/Separator.module.scss.cjs +13 -10
- package/dist/components/Separator/Separator.module.scss.js +13 -10
- package/dist/components/Separator/index.cjs +37 -38
- package/dist/components/Separator/index.d.ts +4 -4
- package/dist/components/Separator/index.d.ts.map +1 -1
- package/dist/components/Separator/index.js +37 -38
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +43 -43
- package/dist/components/Sidebar/Sidebar.module.scss.js +43 -43
- package/dist/components/Sidebar/index.cjs +5 -3
- package/dist/components/Sidebar/index.d.ts +6 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +5 -3
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +50 -38
- package/dist/components/Skeleton/Skeleton.module.scss.js +50 -38
- package/dist/components/Skeleton/index.cjs +41 -55
- package/dist/components/Skeleton/index.d.ts +7 -7
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +41 -55
- package/dist/components/Slider/Slider.module.scss.cjs +12 -12
- package/dist/components/Slider/Slider.module.scss.js +12 -12
- package/dist/components/Stack/Stack.module.scss.cjs +25 -45
- package/dist/components/Stack/Stack.module.scss.js +25 -45
- package/dist/components/Stack/index.cjs +106 -101
- package/dist/components/Stack/index.d.ts +7 -7
- package/dist/components/Stack/index.d.ts.map +1 -1
- package/dist/components/Stack/index.js +106 -101
- package/dist/components/Switch/Switch.module.scss.cjs +32 -0
- package/dist/components/Switch/Switch.module.scss.js +32 -0
- package/dist/components/{Toggle → Switch}/index.cjs +9 -14
- package/dist/components/Switch/index.d.ts +37 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/{Toggle → Switch}/index.js +5 -10
- package/dist/components/Table/Table.module.scss.cjs +18 -27
- package/dist/components/Table/Table.module.scss.js +18 -27
- package/dist/components/Table/index.d.ts +6 -5
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/Tabs/Tabs.module.scss.cjs +12 -12
- package/dist/components/Tabs/Tabs.module.scss.js +12 -12
- package/dist/components/Tabs/index.cjs +2 -2
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Text/Text.module.scss.cjs +93 -57
- package/dist/components/Text/Text.module.scss.js +93 -57
- package/dist/components/Text/index.cjs +14 -6
- package/dist/components/Text/index.d.ts +25 -15
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +14 -6
- package/dist/components/Textarea/Textarea.module.scss.cjs +26 -23
- package/dist/components/Textarea/Textarea.module.scss.js +26 -23
- package/dist/components/Textarea/index.cjs +5 -10
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +5 -10
- package/dist/components/Theme/context.cjs +39 -0
- package/dist/components/Theme/context.d.ts +21 -0
- package/dist/components/Theme/context.d.ts.map +1 -0
- package/dist/components/Theme/context.js +22 -0
- package/dist/components/Theme/index.cjs +14 -209
- package/dist/components/Theme/index.d.ts +4 -37
- package/dist/components/Theme/index.d.ts.map +1 -1
- package/dist/components/Theme/index.js +9 -204
- package/dist/components/{Theme → ThemeToggle}/ThemeToggle.module.scss.cjs +6 -6
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.js +23 -0
- package/dist/components/ThemeToggle/index.cjs +115 -0
- package/dist/components/ThemeToggle/index.d.ts +21 -0
- package/dist/components/ThemeToggle/index.d.ts.map +1 -0
- package/dist/components/ThemeToggle/index.js +115 -0
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +13 -13
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +13 -13
- package/dist/components/ThinkingIndicator/index.cjs +34 -41
- package/dist/components/ThinkingIndicator/index.d.ts +4 -4
- package/dist/components/ThinkingIndicator/index.d.ts.map +1 -1
- package/dist/components/ThinkingIndicator/index.js +34 -41
- package/dist/components/Toast/Toast.module.scss.cjs +20 -20
- package/dist/components/Toast/Toast.module.scss.js +20 -20
- package/dist/components/Toggle/index.d.ts +2 -42
- package/dist/components/Toggle/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +20 -20
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +20 -20
- package/dist/components/ToggleGroup/index.cjs +3 -2
- package/dist/components/ToggleGroup/index.d.ts +2 -1
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.js +3 -2
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/components/VisuallyHidden/VisuallyHidden.module.scss.cjs +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.module.scss.js +1 -1
- package/dist/data-table.cjs +12 -9
- package/dist/data-table.js +12 -9
- package/dist/datepicker.cjs +2 -1
- package/dist/datepicker.js +2 -1
- package/dist/index.cjs +100 -98
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/markdown.cjs +1 -1
- package/dist/markdown.js +2 -2
- package/dist/measurements/generated.cjs +296 -0
- package/dist/measurements/generated.d.ts +261 -0
- package/dist/measurements/generated.d.ts.map +1 -0
- package/dist/measurements/generated.js +296 -0
- package/dist/measurements/index.d.ts +2 -0
- package/dist/measurements/index.d.ts.map +1 -0
- package/dist/measurements.cjs +6 -0
- package/dist/measurements.js +6 -0
- package/dist/recipes/popup.cjs +14 -0
- package/dist/recipes/popup.d.ts +4 -0
- package/dist/recipes/popup.d.ts.map +1 -0
- package/dist/recipes/popup.js +14 -0
- package/dist/recipes/table-chrome.cjs +18 -0
- package/dist/recipes/table-chrome.d.ts +10 -0
- package/dist/recipes/table-chrome.d.ts.map +1 -0
- package/dist/recipes/table-chrome.js +18 -0
- package/dist/table.cjs +5 -2
- package/dist/table.js +5 -2
- package/dist/utils/layout-spacing.cjs +27 -0
- package/dist/utils/layout-spacing.d.ts +5 -0
- package/dist/utils/layout-spacing.d.ts.map +1 -0
- package/dist/utils/layout-spacing.js +27 -0
- package/dist/utils/seed-derivation.cjs +4 -42
- package/dist/utils/seed-derivation.d.ts +4 -3
- package/dist/utils/seed-derivation.d.ts.map +1 -1
- package/dist/utils/seed-derivation.js +4 -42
- package/dist/utils/theme-presets.cjs +1 -0
- package/dist/utils/theme-presets.d.ts +3 -2
- package/dist/utils/theme-presets.d.ts.map +1 -1
- package/dist/utils/theme-presets.js +1 -0
- package/fragments.json +1 -1
- package/package.json +23 -4
- package/src/components/Accordion/Accordion.module.scss +31 -52
- package/src/components/Alert/Alert.module.scss +28 -44
- package/src/components/AppShell/AppShell.module.scss +6 -3
- package/src/components/AppShell/index.tsx +8 -4
- package/src/components/Avatar/Avatar.module.scss +22 -60
- package/src/components/Avatar/index.tsx +152 -146
- package/src/components/Badge/Badge.module.scss +51 -46
- package/src/components/BentoGrid/BentoGrid.module.scss +11 -32
- package/src/components/Box/Box.module.scss +253 -81
- package/src/components/Breadcrumbs/Breadcrumbs.module.scss +10 -11
- package/src/components/Button/Button.module.scss +52 -57
- package/src/components/ButtonGroup/ButtonGroup.module.scss +5 -5
- package/src/components/Card/Card.consumer-fixture.module.scss +8 -0
- package/src/components/Card/Card.module.scss +211 -175
- package/src/components/Chart/Chart.module.scss +28 -29
- package/src/components/Chart/index.tsx +40 -53
- package/src/components/Checkbox/Checkbox.module.scss +43 -64
- package/src/components/Checkbox/index.tsx +4 -9
- package/src/components/Chip/Chip.contract.json +4 -3
- package/src/components/Chip/Chip.module.scss +23 -34
- package/src/components/Chip/index.tsx +3 -4
- package/src/components/CodeBlock/CodeBlock.module.scss +102 -215
- package/src/components/Collapsible/Collapsible.module.scss +29 -63
- package/src/components/Collapsible/index.tsx +22 -26
- package/src/components/ColorPicker/ColorPicker.module.scss +42 -24
- package/src/components/ColorPicker/index.tsx +2 -1
- package/src/components/Combobox/Combobox.module.scss +60 -73
- package/src/components/Combobox/index.tsx +7 -5
- package/src/components/Command/Command.module.scss +47 -77
- package/src/components/ConversationList/ConversationList.module.scss +20 -78
- package/src/components/ConversationList/index.tsx +55 -59
- package/src/components/DataTable/DataTable.module.scss +76 -216
- package/src/components/DataTable/index.tsx +20 -25
- package/src/components/DatePicker/DatePicker.module.scss +54 -33
- package/src/components/DatePicker/index.tsx +2 -1
- package/src/components/Dialog/Dialog.module.scss +42 -66
- package/src/components/Drawer/Drawer.module.scss +93 -99
- package/src/components/Drawer/index.tsx +1 -1
- package/src/components/Editor/Editor.module.scss +115 -220
- package/src/components/EmptyState/EmptyState.module.scss +38 -85
- package/src/components/Field/Field.contract.json +2 -1
- package/src/components/Field/Field.module.scss +9 -11
- package/src/components/Field/index.tsx +27 -1
- package/src/components/Fieldset/Fieldset.module.scss +14 -6
- package/src/components/Form/Form.contract.json +10 -23
- package/src/components/Form/Form.module.scss +9 -4
- package/src/components/Form/index.tsx +22 -7
- package/src/components/Grid/Grid.module.scss +159 -63
- package/src/components/Grid/index.tsx +107 -126
- package/src/components/Header/Header.module.scss +25 -32
- package/src/components/Header/index.tsx +2 -1
- package/src/components/Icon/Icon.module.scss +16 -0
- package/src/components/Icon/index.tsx +74 -86
- package/src/components/IconButton/IconButton.module.scss +11 -21
- package/src/components/Input/Input.module.scss +67 -55
- package/src/components/Input/index.tsx +1 -2
- package/src/components/Link/Link.module.scss +8 -9
- package/src/components/List/List.module.scss +16 -21
- package/src/components/List/index.tsx +4 -10
- package/src/components/Listbox/Listbox.module.scss +26 -54
- package/src/components/Loading/Loading.module.scss +23 -33
- package/src/components/Loading/index.tsx +68 -97
- package/src/components/Main/Main.module.scss +3 -5
- package/src/components/Markdown/Markdown.module.scss +36 -184
- package/src/components/Markdown/index.tsx +2 -2
- package/src/components/Menu/Menu.module.scss +48 -133
- package/src/components/Menu/index.tsx +57 -89
- package/src/components/Message/Message.module.scss +52 -142
- package/src/components/Message/index.tsx +16 -6
- package/src/components/NavigationMenu/NavigationMenu.module.scss +59 -52
- package/src/components/Pagination/Pagination.module.scss +32 -25
- package/src/components/Pagination/index.tsx +7 -2
- package/src/components/Popover/Popover.module.scss +37 -73
- package/src/components/Progress/Progress.module.scss +61 -41
- package/src/components/Progress/geometry.ts +41 -0
- package/src/components/Progress/index.tsx +44 -30
- package/src/components/Prompt/Prompt.module.scss +45 -82
- package/src/components/Prompt/index.tsx +6 -5
- package/src/components/RadioGroup/RadioGroup.module.scss +50 -69
- package/src/components/RadioGroup/index.tsx +7 -9
- package/src/components/ScrollArea/ScrollArea.contract.json +8 -24
- package/src/components/ScrollArea/ScrollArea.module.scss +122 -96
- package/src/components/ScrollArea/index.tsx +78 -60
- package/src/components/ScrollArea/scroll-state.ts +87 -0
- package/src/components/Select/Select.module.scss +53 -41
- package/src/components/Select/index.tsx +6 -2
- package/src/components/Separator/Separator.module.scss +29 -19
- package/src/components/Separator/index.tsx +55 -51
- package/src/components/Sidebar/Sidebar.contract.json +12 -0
- package/src/components/Sidebar/Sidebar.module.scss +101 -99
- package/src/components/Sidebar/index.tsx +10 -3
- package/src/components/Skeleton/Skeleton.module.scss +26 -26
- package/src/components/Skeleton/index.tsx +65 -72
- package/src/components/Slider/Slider.module.scss +31 -25
- package/src/components/Stack/Stack.module.scss +101 -30
- package/src/components/Stack/index.tsx +157 -127
- package/src/components/{Toggle/Toggle.contract.json → Switch/Switch.contract.json} +1 -1
- package/src/components/{Toggle/Toggle.module.scss → Switch/Switch.module.scss} +55 -82
- package/src/components/{Toggle → Switch}/index.tsx +5 -21
- package/src/components/Table/Table.module.scss +38 -129
- package/src/components/Table/index.tsx +13 -6
- package/src/components/TableOfContents/TableOfContents.module.scss +20 -177
- package/src/components/Tabs/Tabs.module.scss +27 -22
- package/src/components/Tabs/index.tsx +2 -2
- package/src/components/Text/Text.module.scss +22 -3
- package/src/components/Text/index.tsx +56 -21
- package/src/components/Textarea/Textarea.module.scss +59 -39
- package/src/components/Textarea/index.tsx +5 -12
- package/src/components/Theme/context.ts +42 -0
- package/src/components/Theme/index.tsx +14 -309
- package/src/components/ThemeToggle/ThemeToggle.module.scss +73 -0
- package/src/components/ThemeToggle/index.tsx +144 -0
- package/src/components/ThinkingIndicator/ThinkingIndicator.module.scss +24 -19
- package/src/components/ThinkingIndicator/index.tsx +44 -54
- package/src/components/Toast/Toast.contract.json +5 -21
- package/src/components/Toast/Toast.module.scss +61 -138
- package/src/components/Toggle/index.ts +7 -0
- package/src/components/ToggleGroup/ToggleGroup.contract.json +12 -39
- package/src/components/ToggleGroup/ToggleGroup.module.scss +132 -88
- package/src/components/ToggleGroup/index.tsx +5 -3
- package/src/components/Tooltip/Tooltip.module.scss +23 -39
- package/src/components/VisuallyHidden/VisuallyHidden.module.scss +3 -0
- package/src/index.ts +2 -1
- package/src/measurements/MeasurementTargets.module.scss +229 -0
- package/src/measurements/generated.ts +317 -0
- package/src/measurements/index.ts +8 -0
- package/src/measurements/measurements.json +361 -0
- package/src/recipes/_action.scss +138 -0
- package/src/recipes/_boolean-range.scss +124 -0
- package/src/recipes/_feedback.scss +171 -0
- package/src/recipes/_field.scss +98 -0
- package/src/recipes/_layout.scss +67 -0
- package/src/recipes/_navigation.scss +110 -0
- package/src/recipes/_overlay.scss +191 -0
- package/src/recipes/_popup.scss +92 -0
- package/src/recipes/_prose.scss +174 -0
- package/src/recipes/_representation.scss +193 -0
- package/src/recipes/_segmented.scss +26 -0
- package/src/recipes/_surface.scss +13 -0
- package/src/recipes/_table-chrome.scss +105 -0
- package/src/recipes/_target.scss +31 -0
- package/src/recipes/_typography.scss +38 -0
- package/src/recipes/popup.ts +12 -0
- package/src/recipes/table-chrome.ts +30 -0
- package/src/styles/globals.scss +2 -2
- package/src/tokens/_component-properties.scss +2 -2
- package/src/tokens/_computed.scss +9 -9
- package/src/tokens/_density.scss +41 -132
- package/src/tokens/_measurements.catalog.generated.css +91 -0
- package/src/tokens/_measurements.generated.scss +604 -0
- package/src/tokens/_mixins.scss +0 -276
- package/src/tokens/_property-registrations.scss +96 -92
- package/src/tokens/_radius.scss +16 -70
- package/src/tokens/_seeds.scss +8 -7
- package/src/tokens/_variables.scss +163 -148
- package/src/utils/layout-spacing.ts +31 -0
- package/src/utils/seed-derivation.ts +134 -172
- package/src/utils/theme-presets.ts +58 -30
- package/dist/components/Theme/ThemeToggle.module.scss.js +0 -23
- package/dist/components/Toggle/Toggle.module.scss.cjs +0 -44
- package/dist/components/Toggle/Toggle.module.scss.js +0 -44
- package/src/components/Switch/index.ts +0 -3
- package/src/components/Theme/ThemeToggle.module.scss +0 -91
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { mergeAriaIds } from
|
|
5
|
-
import styles from
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { mergeAriaIds } from "../../utils/aria";
|
|
5
|
+
import styles from "./Chart.module.scss";
|
|
6
6
|
|
|
7
7
|
// ============================================
|
|
8
8
|
// Types (self-owned — no external dependency for types)
|
|
@@ -36,10 +36,10 @@ export interface ChartTooltipContentProps {
|
|
|
36
36
|
payload?: Record<string, unknown>;
|
|
37
37
|
}[];
|
|
38
38
|
label?: string;
|
|
39
|
-
indicator?:
|
|
39
|
+
indicator?: "dot" | "line" | "dashed";
|
|
40
40
|
hideLabel?: boolean;
|
|
41
41
|
hideIndicator?: boolean;
|
|
42
|
-
labelFormatter?: (label: string, payload: ChartTooltipContentProps[
|
|
42
|
+
labelFormatter?: (label: string, payload: ChartTooltipContentProps["payload"]) => React.ReactNode;
|
|
43
43
|
valueFormatter?: (value: number | string) => string;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -69,15 +69,15 @@ function loadChartDeps(): Promise<void> {
|
|
|
69
69
|
if (!_chartLoadPromise) {
|
|
70
70
|
_chartLoadPromise = (async () => {
|
|
71
71
|
try {
|
|
72
|
-
const rc = await import(
|
|
72
|
+
const rc = await import("recharts");
|
|
73
73
|
_RechartsTooltip = rc.Tooltip as unknown as React.ComponentType<Record<string, unknown>>;
|
|
74
74
|
_RechartsLegend = rc.Legend as unknown as React.ComponentType<Record<string, unknown>>;
|
|
75
75
|
} catch {
|
|
76
76
|
_chartFailed = true;
|
|
77
|
-
if (process.env.NODE_ENV ===
|
|
77
|
+
if (process.env.NODE_ENV === "development") {
|
|
78
78
|
console.warn(
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
"[@usefragments/ui] Chart: recharts is not installed. " +
|
|
80
|
+
"Install it with: npm install recharts"
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -102,7 +102,6 @@ function useChartDeps(): boolean {
|
|
|
102
102
|
return _RechartsTooltip !== null;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
106
105
|
// ============================================
|
|
107
106
|
// Context
|
|
108
107
|
// ============================================
|
|
@@ -112,7 +111,7 @@ const ChartConfigContext = React.createContext<ChartConfig | null>(null);
|
|
|
112
111
|
export function useChartConfig() {
|
|
113
112
|
const ctx = React.useContext(ChartConfigContext);
|
|
114
113
|
if (!ctx) {
|
|
115
|
-
throw new Error(
|
|
114
|
+
throw new Error("useChartConfig must be used within a <ChartContainer>");
|
|
116
115
|
}
|
|
117
116
|
return ctx;
|
|
118
117
|
}
|
|
@@ -128,8 +127,8 @@ export function ChartContainer({
|
|
|
128
127
|
style,
|
|
129
128
|
summary,
|
|
130
129
|
dataTable,
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
"aria-label": ariaLabel,
|
|
131
|
+
"aria-describedby": ariaDescribedBy,
|
|
133
132
|
...htmlProps
|
|
134
133
|
}: ChartContainerProps) {
|
|
135
134
|
const chartId = React.useId();
|
|
@@ -145,17 +144,17 @@ export function ChartContainer({
|
|
|
145
144
|
return vars;
|
|
146
145
|
}, [config]);
|
|
147
146
|
|
|
148
|
-
const rootClasses = [styles.container, className].filter(Boolean).join(
|
|
147
|
+
const rootClasses = [styles.container, className].filter(Boolean).join(" ");
|
|
149
148
|
|
|
150
149
|
// Inject sizing props into the chart child (recharts API).
|
|
151
150
|
// Only pass `responsive` for custom component types to avoid leaking the
|
|
152
151
|
// prop to intrinsic DOM nodes in test/demo usage.
|
|
153
152
|
const chartChildProps: Record<string, unknown> = {
|
|
154
|
-
width:
|
|
155
|
-
height:
|
|
153
|
+
width: "100%",
|
|
154
|
+
height: "100%",
|
|
156
155
|
};
|
|
157
156
|
|
|
158
|
-
if (typeof children.type !==
|
|
157
|
+
if (typeof children.type !== "string") {
|
|
159
158
|
chartChildProps.responsive = true;
|
|
160
159
|
}
|
|
161
160
|
|
|
@@ -171,12 +170,8 @@ export function ChartContainer({
|
|
|
171
170
|
className={rootClasses}
|
|
172
171
|
style={{ ...cssVars, ...style }}
|
|
173
172
|
role="img"
|
|
174
|
-
aria-label={ariaLabel ||
|
|
175
|
-
aria-describedby={mergeAriaIds(
|
|
176
|
-
ariaDescribedBy,
|
|
177
|
-
summaryId,
|
|
178
|
-
dataTableId
|
|
179
|
-
)}
|
|
173
|
+
aria-label={ariaLabel || "Chart"}
|
|
174
|
+
aria-describedby={mergeAriaIds(ariaDescribedBy, summaryId, dataTableId)}
|
|
180
175
|
>
|
|
181
176
|
{chartChild}
|
|
182
177
|
{summaryId && (
|
|
@@ -202,7 +197,7 @@ export function ChartTooltipContent({
|
|
|
202
197
|
active,
|
|
203
198
|
payload,
|
|
204
199
|
label,
|
|
205
|
-
indicator =
|
|
200
|
+
indicator = "dot",
|
|
206
201
|
hideLabel = false,
|
|
207
202
|
hideIndicator = false,
|
|
208
203
|
labelFormatter,
|
|
@@ -212,15 +207,11 @@ export function ChartTooltipContent({
|
|
|
212
207
|
|
|
213
208
|
if (!active || !payload?.length) return null;
|
|
214
209
|
|
|
215
|
-
const formattedLabel = labelFormatter
|
|
216
|
-
? labelFormatter(String(label), payload)
|
|
217
|
-
: label;
|
|
210
|
+
const formattedLabel = labelFormatter ? labelFormatter(String(label), payload) : label;
|
|
218
211
|
|
|
219
212
|
return (
|
|
220
213
|
<div className={styles.tooltip}>
|
|
221
|
-
{!hideLabel && formattedLabel &&
|
|
222
|
-
<div className={styles.tooltipLabel}>{formattedLabel}</div>
|
|
223
|
-
)}
|
|
214
|
+
{!hideLabel && formattedLabel && <div className={styles.tooltipLabel}>{formattedLabel}</div>}
|
|
224
215
|
<div className={styles.tooltipItems}>
|
|
225
216
|
{payload.map((entry, i) => {
|
|
226
217
|
const key = String(entry.dataKey ?? entry.name ?? i);
|
|
@@ -229,20 +220,25 @@ export function ChartTooltipContent({
|
|
|
229
220
|
const color = entry.color ?? configEntry?.color;
|
|
230
221
|
const displayValue = valueFormatter
|
|
231
222
|
? valueFormatter(entry.value ?? 0)
|
|
232
|
-
: String(entry.value ??
|
|
223
|
+
: String(entry.value ?? "");
|
|
233
224
|
|
|
234
225
|
const indicatorClass = [
|
|
235
226
|
styles.tooltipIndicator,
|
|
236
|
-
indicator ===
|
|
237
|
-
indicator ===
|
|
238
|
-
]
|
|
227
|
+
indicator === "line" && styles.tooltipIndicatorLine,
|
|
228
|
+
indicator === "dashed" && styles.tooltipIndicatorDashed,
|
|
229
|
+
]
|
|
230
|
+
.filter(Boolean)
|
|
231
|
+
.join(" ");
|
|
239
232
|
|
|
240
233
|
return (
|
|
241
234
|
<div key={key} className={styles.tooltipItem}>
|
|
242
235
|
{!hideIndicator && (
|
|
243
236
|
<span
|
|
244
237
|
className={indicatorClass}
|
|
245
|
-
style={{
|
|
238
|
+
style={{
|
|
239
|
+
backgroundColor: indicator === "dashed" ? undefined : color,
|
|
240
|
+
borderColor: color,
|
|
241
|
+
}}
|
|
246
242
|
/>
|
|
247
243
|
)}
|
|
248
244
|
<span className={styles.tooltipItemLabel}>{displayLabel}</span>
|
|
@@ -260,11 +256,11 @@ export function ChartTooltipContent({
|
|
|
260
256
|
// ============================================
|
|
261
257
|
|
|
262
258
|
type ChartTooltipProps = {
|
|
263
|
-
indicator?:
|
|
259
|
+
indicator?: "dot" | "line" | "dashed";
|
|
264
260
|
hideLabel?: boolean;
|
|
265
261
|
hideIndicator?: boolean;
|
|
266
|
-
labelFormatter?: ChartTooltipContentProps[
|
|
267
|
-
valueFormatter?: ChartTooltipContentProps[
|
|
262
|
+
labelFormatter?: ChartTooltipContentProps["labelFormatter"];
|
|
263
|
+
valueFormatter?: ChartTooltipContentProps["valueFormatter"];
|
|
268
264
|
content?: React.ReactNode | ((tooltipProps: Record<string, unknown>) => React.ReactNode);
|
|
269
265
|
[key: string]: unknown;
|
|
270
266
|
};
|
|
@@ -281,7 +277,6 @@ export function ChartTooltip({
|
|
|
281
277
|
const chartReady = useChartDeps();
|
|
282
278
|
|
|
283
279
|
const defaultContent = React.useCallback(
|
|
284
|
-
|
|
285
280
|
(tooltipProps: Record<string, unknown>) => (
|
|
286
281
|
<ChartTooltipContent
|
|
287
282
|
{...(tooltipProps as ChartTooltipContentProps)}
|
|
@@ -292,7 +287,7 @@ export function ChartTooltip({
|
|
|
292
287
|
valueFormatter={valueFormatter}
|
|
293
288
|
/>
|
|
294
289
|
),
|
|
295
|
-
[indicator, hideLabel, hideIndicator, labelFormatter, valueFormatter]
|
|
290
|
+
[indicator, hideLabel, hideIndicator, labelFormatter, valueFormatter]
|
|
296
291
|
);
|
|
297
292
|
|
|
298
293
|
// Nothing until recharts resolves; nothing at all if it is not installed.
|
|
@@ -304,7 +299,7 @@ export function ChartTooltip({
|
|
|
304
299
|
|
|
305
300
|
return (
|
|
306
301
|
<RechartsTooltipComponent
|
|
307
|
-
cursor={{ stroke:
|
|
302
|
+
cursor={{ stroke: "var(--fui-border)" }}
|
|
308
303
|
content={content ?? defaultContent}
|
|
309
304
|
{...props}
|
|
310
305
|
/>
|
|
@@ -323,17 +318,14 @@ export function ChartLegendContent({ payload }: ChartLegendContentProps) {
|
|
|
323
318
|
return (
|
|
324
319
|
<div className={styles.legend}>
|
|
325
320
|
{payload.map((entry) => {
|
|
326
|
-
const key = String(entry.dataKey ?? entry.value ??
|
|
321
|
+
const key = String(entry.dataKey ?? entry.value ?? "");
|
|
327
322
|
const configEntry = config?.[key];
|
|
328
323
|
const label = configEntry?.label ?? entry.value ?? key;
|
|
329
324
|
const color = entry.color ?? configEntry?.color;
|
|
330
325
|
|
|
331
326
|
return (
|
|
332
327
|
<div key={key} className={styles.legendItem}>
|
|
333
|
-
<span
|
|
334
|
-
className={styles.legendDot}
|
|
335
|
-
style={{ backgroundColor: color }}
|
|
336
|
-
/>
|
|
328
|
+
<span className={styles.legendDot} style={{ backgroundColor: color }} />
|
|
337
329
|
<span className={styles.legendLabel}>{label}</span>
|
|
338
330
|
</div>
|
|
339
331
|
);
|
|
@@ -363,12 +355,7 @@ export function ChartLegend({ content, ...props }: ChartLegendProps) {
|
|
|
363
355
|
|
|
364
356
|
const RechartsLegendComponent = _RechartsLegend;
|
|
365
357
|
|
|
366
|
-
return
|
|
367
|
-
<RechartsLegendComponent
|
|
368
|
-
content={content ?? defaultContent}
|
|
369
|
-
{...props}
|
|
370
|
-
/>
|
|
371
|
-
);
|
|
358
|
+
return <RechartsLegendComponent content={content ?? defaultContent} {...props} />;
|
|
372
359
|
}
|
|
373
360
|
|
|
374
361
|
export const Chart = Object.assign(ChartContainer, {
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
@use "../../tokens/variables" as *;
|
|
2
2
|
@use "../../tokens/mixins" as *;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
@use "../../recipes/boolean-range" as boolean;
|
|
4
|
+
@use "../../recipes/field" as field;
|
|
5
|
+
@use "../../recipes/target" as target;
|
|
5
6
|
|
|
6
7
|
// Wrapper for checkbox + label
|
|
7
8
|
.wrapper {
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
gap: var(--fui-space-2, $fui-space-2);
|
|
11
9
|
cursor: pointer;
|
|
12
|
-
font-family: var(--fui-font-sans, $fui-font-sans);
|
|
13
10
|
|
|
14
|
-
&[data-
|
|
15
|
-
|
|
11
|
+
&[data-size="sm"] {
|
|
12
|
+
@include boolean.row("sm");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&[data-size="md"] {
|
|
16
|
+
@include boolean.row("md");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[data-size="lg"] {
|
|
20
|
+
@include boolean.row("lg");
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
&[data-disabled] {
|
|
@@ -24,19 +29,18 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
24
29
|
// The checkbox box itself
|
|
25
30
|
.checkbox {
|
|
26
31
|
@include interactive-base;
|
|
32
|
+
@include boolean.mark("md");
|
|
33
|
+
@include target.hit-area("micro");
|
|
27
34
|
|
|
28
|
-
position: relative;
|
|
29
35
|
display: inline-flex;
|
|
30
36
|
align-items: center;
|
|
31
37
|
justify-content: center;
|
|
32
38
|
flex-shrink: 0;
|
|
33
39
|
box-sizing: border-box;
|
|
34
|
-
|
|
35
|
-
height: var(--fui-icon-sm, $fui-icon-sm);
|
|
36
|
-
margin-top: 0;
|
|
40
|
+
margin-block-start: var(--_fui-boolean-mark-offset, 0);
|
|
37
41
|
background-color: var(--fui-field-bg, $fui-bg-elevated);
|
|
38
|
-
border: 1px solid var(--fui-field-border, $fui-border-strong);
|
|
39
|
-
border-radius: var(--fui-checkbox-radius, $fui-
|
|
42
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-field-border, $fui-border-strong);
|
|
43
|
+
border-radius: var(--fui-checkbox-radius, var(--fui-radius-sm, #{$fui-radius-sm}));
|
|
40
44
|
cursor: inherit;
|
|
41
45
|
|
|
42
46
|
&:hover:not([data-disabled]) {
|
|
@@ -74,22 +78,11 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
74
78
|
color-mix(in srgb, var(--fui-color-danger-text, #{$fui-color-danger-text}) 35%, transparent);
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
&::before {
|
|
78
|
-
content: "";
|
|
79
|
-
position: absolute;
|
|
80
|
-
top: 50%;
|
|
81
|
-
left: 50%;
|
|
82
|
-
width: var(--fui-target-size-min, $fui-target-size-min);
|
|
83
|
-
height: var(--fui-target-size-min, $fui-target-size-min);
|
|
84
|
-
transform: translate(-50%, -50%);
|
|
85
|
-
}
|
|
86
81
|
}
|
|
87
82
|
|
|
88
83
|
// Size variants
|
|
89
84
|
.sm {
|
|
90
|
-
|
|
91
|
-
height: var(--fui-icon-xs, $fui-icon-xs);
|
|
92
|
-
border-radius: var(--fui-checkbox-radius, $fui-checkbox-radius);
|
|
85
|
+
@include boolean.mark("sm");
|
|
93
86
|
}
|
|
94
87
|
|
|
95
88
|
.md {
|
|
@@ -97,8 +90,8 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
97
90
|
}
|
|
98
91
|
|
|
99
92
|
.lg {
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
@include boolean.mark("lg");
|
|
94
|
+
@include target.hit-area("compact");
|
|
102
95
|
}
|
|
103
96
|
|
|
104
97
|
// Indicator (checkmark or dash)
|
|
@@ -109,8 +102,8 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
109
102
|
color: var(--fui-button-primary-color, #fff);
|
|
110
103
|
|
|
111
104
|
svg {
|
|
112
|
-
width:
|
|
113
|
-
height:
|
|
105
|
+
width: var(--fui-icon-xs, $fui-icon-xs);
|
|
106
|
+
height: var(--fui-icon-xs, $fui-icon-xs);
|
|
114
107
|
}
|
|
115
108
|
|
|
116
109
|
// Animation
|
|
@@ -134,42 +127,28 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
134
127
|
|
|
135
128
|
// Size variant indicators
|
|
136
129
|
.sm .indicator svg {
|
|
137
|
-
width:
|
|
138
|
-
height:
|
|
130
|
+
width: var(--fui-icon-xs, $fui-icon-xs);
|
|
131
|
+
height: var(--fui-icon-xs, $fui-icon-xs);
|
|
139
132
|
}
|
|
140
133
|
|
|
141
134
|
.lg .indicator svg {
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
135
|
+
width: var(--fui-icon-md, $fui-icon-md);
|
|
136
|
+
height: var(--fui-icon-md, $fui-icon-md);
|
|
144
137
|
}
|
|
145
138
|
|
|
146
139
|
// Label content
|
|
147
140
|
.content {
|
|
148
|
-
|
|
149
|
-
flex-direction: column;
|
|
150
|
-
gap: var(--fui-space-0-5, $fui-space-0-5);
|
|
141
|
+
min-inline-size: 0;
|
|
151
142
|
}
|
|
152
143
|
|
|
153
144
|
.label {
|
|
154
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
155
|
-
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
156
145
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
157
|
-
line-height: var(--fui-line-height-tight, $fui-line-height-tight);
|
|
158
146
|
user-select: none;
|
|
159
147
|
}
|
|
160
148
|
|
|
161
|
-
.labelSm {
|
|
162
|
-
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.labelLg {
|
|
166
|
-
font-size: var(--fui-font-size-base, $fui-font-size-base);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
149
|
.helper {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
line-height: var(--fui-line-height-normal, $fui-line-height-normal);
|
|
150
|
+
display: block;
|
|
151
|
+
@include field.helper;
|
|
173
152
|
}
|
|
174
153
|
|
|
175
154
|
// ============================================
|
|
@@ -178,18 +157,9 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
178
157
|
// styling reacts to the same control state the rest of the component uses.
|
|
179
158
|
// ============================================
|
|
180
159
|
.wrapperCard {
|
|
181
|
-
display: flex;
|
|
182
|
-
align-items: center;
|
|
183
|
-
gap: var(--fui-space-3, $fui-space-3);
|
|
184
160
|
width: 100%;
|
|
185
|
-
height: var(
|
|
186
|
-
--fui-input-height,
|
|
187
|
-
$fui-input-height
|
|
188
|
-
); // matches Input size="md" so checkbox cards align with form fields
|
|
189
|
-
box-sizing: border-box;
|
|
190
|
-
padding: 0 var(--fui-space-3, $fui-space-3);
|
|
191
161
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
192
|
-
border: 1px solid var(--fui-border-default, $fui-border-default);
|
|
162
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-border-default, $fui-border-default);
|
|
193
163
|
background: transparent;
|
|
194
164
|
transition:
|
|
195
165
|
background var(--fui-transition-fast, $fui-transition-fast),
|
|
@@ -222,8 +192,16 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
222
192
|
color-mix(in srgb, var(--fui-button-primary-base, #{$fui-color-accent}) 28%, transparent);
|
|
223
193
|
}
|
|
224
194
|
|
|
225
|
-
|
|
226
|
-
|
|
195
|
+
&[data-size="sm"] {
|
|
196
|
+
@include boolean.card("sm");
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&[data-size="md"] {
|
|
200
|
+
@include boolean.card("md");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&[data-size="lg"] {
|
|
204
|
+
@include boolean.card("lg");
|
|
227
205
|
}
|
|
228
206
|
}
|
|
229
207
|
|
|
@@ -233,8 +211,9 @@ $fui-checkbox-radius: 0.25rem !default;
|
|
|
233
211
|
|
|
234
212
|
@media (prefers-contrast: more) {
|
|
235
213
|
.checkbox {
|
|
236
|
-
border-width: 2px;
|
|
237
214
|
border-color: var(--fui-text-primary, $fui-text-primary);
|
|
215
|
+
outline: var(--fui-stroke-hairline, 1px) solid var(--fui-text-primary, $fui-text-primary);
|
|
216
|
+
outline-offset: calc(-1 * var(--fui-stroke-default, 2px));
|
|
238
217
|
|
|
239
218
|
&[data-checked],
|
|
240
219
|
&[data-indeterminate] {
|
|
@@ -167,14 +167,6 @@ const CheckboxRoot = React.forwardRef<HTMLButtonElement, CheckboxProps>(function
|
|
|
167
167
|
.filter(Boolean)
|
|
168
168
|
.join(" ");
|
|
169
169
|
|
|
170
|
-
const labelClasses = [
|
|
171
|
-
styles.label,
|
|
172
|
-
size === "sm" && styles.labelSm,
|
|
173
|
-
size === "lg" && styles.labelLg,
|
|
174
|
-
]
|
|
175
|
-
.filter(Boolean)
|
|
176
|
-
.join(" ");
|
|
177
|
-
|
|
178
170
|
const wrapperClasses = [styles.wrapper, variant === "card" && styles.wrapperCard, className]
|
|
179
171
|
.filter(Boolean)
|
|
180
172
|
.join(" ");
|
|
@@ -204,6 +196,7 @@ const CheckboxRoot = React.forwardRef<HTMLButtonElement, CheckboxProps>(function
|
|
|
204
196
|
aria-label={ariaLabel}
|
|
205
197
|
aria-labelledby={ariaLabelledBy}
|
|
206
198
|
aria-describedby={ariaDescribedBy}
|
|
199
|
+
data-size={size}
|
|
207
200
|
className={[checkboxClasses, className].filter(Boolean).join(" ")}
|
|
208
201
|
>
|
|
209
202
|
<BaseCheckbox.Indicator className={styles.indicator} keepMounted>
|
|
@@ -219,6 +212,7 @@ const CheckboxRoot = React.forwardRef<HTMLButtonElement, CheckboxProps>(function
|
|
|
219
212
|
className={wrapperClasses}
|
|
220
213
|
data-disabled={disabled || undefined}
|
|
221
214
|
data-has-description={resolvedHelperText ? true : undefined}
|
|
215
|
+
data-size={size}
|
|
222
216
|
>
|
|
223
217
|
<BaseCheckbox.Root
|
|
224
218
|
ref={ref}
|
|
@@ -239,6 +233,7 @@ const CheckboxRoot = React.forwardRef<HTMLButtonElement, CheckboxProps>(function
|
|
|
239
233
|
aria-label={ariaLabel}
|
|
240
234
|
aria-labelledby={mergeAriaIds(ariaLabelledBy, labelId)}
|
|
241
235
|
aria-describedby={mergeAriaIds(ariaDescribedBy, descriptionId)}
|
|
236
|
+
data-size={size}
|
|
242
237
|
className={checkboxClasses}
|
|
243
238
|
>
|
|
244
239
|
<BaseCheckbox.Indicator className={styles.indicator} keepMounted>
|
|
@@ -246,7 +241,7 @@ const CheckboxRoot = React.forwardRef<HTMLButtonElement, CheckboxProps>(function
|
|
|
246
241
|
</BaseCheckbox.Indicator>
|
|
247
242
|
</BaseCheckbox.Root>
|
|
248
243
|
<div className={[styles.content, contentClassName].filter(Boolean).join(" ")}>
|
|
249
|
-
<span id={labelId} className={
|
|
244
|
+
<span id={labelId} className={styles.label}>
|
|
250
245
|
{label}
|
|
251
246
|
</span>
|
|
252
247
|
{resolvedHelperText && (
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"propsSummary": [
|
|
11
11
|
"children: node (required)",
|
|
12
12
|
"variant: filled|outlined|outline|soft (default: filled)",
|
|
13
|
-
"size: xs|sm|md|lg (default:
|
|
13
|
+
"size: xs|sm|md|lg (default: xs)",
|
|
14
14
|
"selected: boolean (default: false)",
|
|
15
15
|
"icon: node",
|
|
16
16
|
"avatar: node",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"size": {
|
|
36
36
|
"type": "enum",
|
|
37
37
|
"description": "Chip size",
|
|
38
|
-
"default": "
|
|
38
|
+
"default": "xs",
|
|
39
39
|
"required": false,
|
|
40
40
|
"values": ["xs", "sm", "md", "lg"]
|
|
41
41
|
},
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"guidelines": [
|
|
94
94
|
"Keep chip labels short (1-3 words)",
|
|
95
95
|
"Use Chip.Group for multi-select sets with shared state",
|
|
96
|
+
"Keep the default micro size for filters and tags; opt into a larger size only when the surrounding control track requires it",
|
|
96
97
|
"Use onRemove only when users should be able to dismiss the chip",
|
|
97
98
|
"Pair avatar chips with user-related selections (assignees, reviewers)",
|
|
98
99
|
"Provide an explicit value on Chip when using non-string/custom JSX children inside Chip.Group"
|
|
@@ -172,7 +173,7 @@
|
|
|
172
173
|
"propsSummary": [
|
|
173
174
|
"children: ReactNode - chip label (required)",
|
|
174
175
|
"variant: filled|outlined|outline|soft - visual style",
|
|
175
|
-
"size: sm|md - chip size",
|
|
176
|
+
"size: xs|sm|md|lg - chip size (xs by default)",
|
|
176
177
|
"selected: boolean - selection state",
|
|
177
178
|
"icon/avatar: ReactNode - leading visual",
|
|
178
179
|
"onRemove: () => void - makes chip removable",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@use "../../tokens/variables" as *;
|
|
2
2
|
@use "../../tokens/mixins" as *;
|
|
3
|
+
@use "../../recipes/action";
|
|
4
|
+
@use "../../recipes/layout";
|
|
3
5
|
|
|
4
6
|
@mixin selected-surface {
|
|
5
7
|
background-color: var(--fui-field-selection-bg, $fui-bg-hover);
|
|
@@ -18,14 +20,9 @@
|
|
|
18
20
|
.chip {
|
|
19
21
|
@include button-reset;
|
|
20
22
|
@include interactive-base;
|
|
23
|
+
@include action.base;
|
|
21
24
|
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
gap: var(--fui-space-1, $fui-space-1);
|
|
25
25
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
26
|
-
font-family: var(--fui-font-sans, $fui-font-sans);
|
|
27
|
-
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
28
|
-
line-height: 1;
|
|
29
26
|
white-space: nowrap;
|
|
30
27
|
user-select: none;
|
|
31
28
|
}
|
|
@@ -37,28 +34,19 @@
|
|
|
37
34
|
|
|
38
35
|
// Sizes
|
|
39
36
|
.xs {
|
|
40
|
-
|
|
41
|
-
padding: 0 var(--fui-space-1, $fui-space-1);
|
|
42
|
-
font-size: var(--fui-font-size-2xs, $fui-font-size-2xs);
|
|
43
|
-
gap: var(--fui-space-0-5, $fui-space-0-5);
|
|
37
|
+
@include action.size("micro");
|
|
44
38
|
}
|
|
45
39
|
|
|
46
40
|
.sm {
|
|
47
|
-
|
|
48
|
-
padding: 0 var(--fui-space-2, $fui-space-2);
|
|
49
|
-
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
41
|
+
@include action.size("sm");
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
.md {
|
|
53
|
-
|
|
54
|
-
padding: 0 var(--fui-space-3, $fui-space-3);
|
|
55
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
45
|
+
@include action.size("md");
|
|
56
46
|
}
|
|
57
47
|
|
|
58
48
|
.lg {
|
|
59
|
-
|
|
60
|
-
padding: 0 var(--fui-space-4, $fui-space-4);
|
|
61
|
-
font-size: var(--fui-font-size-base, $fui-font-size-base);
|
|
49
|
+
@include action.size("lg");
|
|
62
50
|
}
|
|
63
51
|
|
|
64
52
|
// Variants
|
|
@@ -82,7 +70,7 @@
|
|
|
82
70
|
.outlined {
|
|
83
71
|
background-color: transparent;
|
|
84
72
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
85
|
-
border: 1px solid var(--fui-border, $fui-border);
|
|
73
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-border, $fui-border);
|
|
86
74
|
|
|
87
75
|
&:hover:not(:disabled) {
|
|
88
76
|
background-color: var(--fui-bg-hover, $fui-bg-hover);
|
|
@@ -120,7 +108,6 @@
|
|
|
120
108
|
.avatar {
|
|
121
109
|
display: flex;
|
|
122
110
|
align-items: center;
|
|
123
|
-
margin-left: calc(-1 * var(--fui-space-1, $fui-space-1));
|
|
124
111
|
|
|
125
112
|
img {
|
|
126
113
|
width: var(--fui-icon-md, $fui-icon-md);
|
|
@@ -159,29 +146,31 @@
|
|
|
159
146
|
.remove {
|
|
160
147
|
@include button-reset;
|
|
161
148
|
@include interactive-base;
|
|
149
|
+
@include action.base;
|
|
162
150
|
|
|
163
|
-
display: flex;
|
|
164
|
-
align-items: center;
|
|
165
|
-
justify-content: center;
|
|
166
|
-
padding: 0 var(--fui-space-1, $fui-space-1);
|
|
167
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
168
151
|
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
169
|
-
line-height: 1;
|
|
170
152
|
border-top-right-radius: var(--fui-radius-full, $fui-radius-full);
|
|
171
153
|
border-bottom-right-radius: var(--fui-radius-full, $fui-radius-full);
|
|
172
154
|
border-top-left-radius: 0;
|
|
173
155
|
border-bottom-left-radius: 0;
|
|
174
156
|
background-color: transparent;
|
|
175
|
-
border: 1px solid transparent;
|
|
157
|
+
border: var(--fui-stroke-hairline, 1px) solid transparent;
|
|
176
158
|
border-left-color: var(--fui-border, $fui-border);
|
|
177
159
|
|
|
178
|
-
.xs & {
|
|
179
|
-
|
|
180
|
-
padding: 0 var(--fui-space-0-5, $fui-space-0-5);
|
|
160
|
+
.removableChip[data-size="xs"] & {
|
|
161
|
+
@include action.icon-only("micro");
|
|
181
162
|
}
|
|
182
163
|
|
|
183
|
-
.sm & {
|
|
184
|
-
|
|
164
|
+
.removableChip[data-size="sm"] & {
|
|
165
|
+
@include action.icon-only("sm");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.removableChip[data-size="md"] & {
|
|
169
|
+
@include action.icon-only("md");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.removableChip[data-size="lg"] & {
|
|
173
|
+
@include action.icon-only("lg");
|
|
185
174
|
}
|
|
186
175
|
|
|
187
176
|
&:hover:not(:disabled) {
|
|
@@ -237,5 +226,5 @@
|
|
|
237
226
|
.group {
|
|
238
227
|
display: flex;
|
|
239
228
|
flex-wrap: wrap;
|
|
240
|
-
gap:
|
|
229
|
+
gap: layout.gap("sm");
|
|
241
230
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { useResolvedControlSize } from "../ComponentDefaults";
|
|
5
4
|
import styles from "./Chip.module.scss";
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -15,7 +14,7 @@ export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonEle
|
|
|
15
14
|
* @see https://usefragments.com/components/chip#variants */
|
|
16
15
|
variant?: "filled" | "outlined" | "outline" | "soft";
|
|
17
16
|
/** Chip size.
|
|
18
|
-
* @default "
|
|
17
|
+
* @default "xs" */
|
|
19
18
|
size?: "xs" | "sm" | "md" | "lg";
|
|
20
19
|
/** Whether the chip is selected */
|
|
21
20
|
selected?: boolean;
|
|
@@ -59,7 +58,7 @@ const ChipBase = React.forwardRef<HTMLButtonElement, ChipProps>(function Chip(
|
|
|
59
58
|
},
|
|
60
59
|
ref
|
|
61
60
|
) {
|
|
62
|
-
const size =
|
|
61
|
+
const size = sizeProp ?? "xs";
|
|
63
62
|
// Resolve alias: "outline" → "outlined"
|
|
64
63
|
const variant = variantProp === "outline" ? "outlined" : variantProp;
|
|
65
64
|
|
|
@@ -110,7 +109,7 @@ const ChipBase = React.forwardRef<HTMLButtonElement, ChipProps>(function Chip(
|
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
return (
|
|
113
|
-
<span className={styles.removableChip} data-disabled={disabled || undefined}>
|
|
112
|
+
<span className={styles.removableChip} data-disabled={disabled || undefined} data-size={size}>
|
|
114
113
|
{chipButton}
|
|
115
114
|
<button
|
|
116
115
|
type="button"
|