@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,5 +1,9 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use
|
|
1
|
+
@use "../../tokens/variables" as *;
|
|
2
|
+
@use "../../tokens/mixins" as *;
|
|
3
|
+
@use "../../recipes/action" as action;
|
|
4
|
+
@use "../../recipes/layout" as layout;
|
|
5
|
+
@use "../../recipes/target" as target;
|
|
6
|
+
@use "../../recipes/typography" as typography;
|
|
3
7
|
|
|
4
8
|
// ============================================
|
|
5
9
|
// Prompt Root
|
|
@@ -16,7 +20,7 @@
|
|
|
16
20
|
// Beam border — rotating conic gradient clipped to a 1px border
|
|
17
21
|
&::before,
|
|
18
22
|
&::after {
|
|
19
|
-
content:
|
|
23
|
+
content: "";
|
|
20
24
|
position: absolute;
|
|
21
25
|
inset: 0;
|
|
22
26
|
border-radius: inherit;
|
|
@@ -72,12 +76,16 @@
|
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
@keyframes beam-rotate {
|
|
75
|
-
from {
|
|
76
|
-
|
|
79
|
+
from {
|
|
80
|
+
--beam-angle: 0deg;
|
|
81
|
+
}
|
|
82
|
+
to {
|
|
83
|
+
--beam-angle: 360deg;
|
|
84
|
+
}
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
@property --beam-angle {
|
|
80
|
-
syntax:
|
|
88
|
+
syntax: "<angle>";
|
|
81
89
|
initial-value: 0deg;
|
|
82
90
|
inherits: false;
|
|
83
91
|
}
|
|
@@ -89,7 +97,7 @@
|
|
|
89
97
|
left: 50%;
|
|
90
98
|
transform: translateX(-50%);
|
|
91
99
|
width: calc(100% - var(--fui-space-8, $fui-space-8));
|
|
92
|
-
max-width:
|
|
100
|
+
max-width: layout.measure("page-narrow");
|
|
93
101
|
z-index: 100;
|
|
94
102
|
box-shadow: var(--fui-shadow-lg, $fui-shadow-lg);
|
|
95
103
|
}
|
|
@@ -104,7 +112,7 @@
|
|
|
104
112
|
margin-left: auto;
|
|
105
113
|
margin-right: auto;
|
|
106
114
|
width: calc(100% - var(--fui-prompt-inset-left, 0px) - var(--fui-space-8, $fui-space-8));
|
|
107
|
-
max-width:
|
|
115
|
+
max-width: layout.measure("page-narrow");
|
|
108
116
|
z-index: 100;
|
|
109
117
|
box-shadow: var(--fui-shadow-lg, $fui-shadow-lg);
|
|
110
118
|
|
|
@@ -140,15 +148,6 @@
|
|
|
140
148
|
--_control-padding: var(--fui-space-2, #{$fui-space-2});
|
|
141
149
|
--_chip-padding: var(--fui-space-1, #{$fui-space-1});
|
|
142
150
|
|
|
143
|
-
// Composer controls are compact, but still need enough visual weight to read
|
|
144
|
-
// as one deliberate toolbar. The xs button token is the dense 32px control
|
|
145
|
-
// height in every density preset; scoping all three inputs to it keeps
|
|
146
|
-
// selects, attach, action and submit controls on one optical grid without a
|
|
147
|
-
// one-off dimension.
|
|
148
|
-
--fui-target-size-min: var(--fui-button-height-xs, #{$fui-button-height-xs});
|
|
149
|
-
--fui-button-height-sm: var(--fui-button-height-xs, #{$fui-button-height-xs});
|
|
150
|
-
--fui-input-height-sm: var(--fui-button-height-xs, #{$fui-button-height-xs});
|
|
151
|
-
|
|
152
151
|
border-color: transparent;
|
|
153
152
|
border-radius: var(--fui-radius-xl, $fui-radius-xl);
|
|
154
153
|
|
|
@@ -284,19 +283,6 @@
|
|
|
284
283
|
}
|
|
285
284
|
}
|
|
286
285
|
|
|
287
|
-
// Round affordances track the scoped target size rather than the 2rem they
|
|
288
|
-
// are given for a form.
|
|
289
|
-
.submit,
|
|
290
|
-
.actionButton {
|
|
291
|
-
width: var(--fui-target-size-min);
|
|
292
|
-
height: var(--fui-target-size-min);
|
|
293
|
-
|
|
294
|
-
svg {
|
|
295
|
-
width: var(--fui-icon-md, $fui-icon-md);
|
|
296
|
-
height: var(--fui-icon-md, $fui-icon-md);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
286
|
// Attach's glyph reaches the leading ink gutter through its own control
|
|
301
287
|
// padding. Give the filled Submit shape the same inset at the trailing edge
|
|
302
288
|
// so the two visible affordances balance across the toolbar.
|
|
@@ -311,7 +297,7 @@
|
|
|
311
297
|
|
|
312
298
|
.textarea {
|
|
313
299
|
@include button-reset;
|
|
314
|
-
@include
|
|
300
|
+
@include typography.role("body-compact");
|
|
315
301
|
|
|
316
302
|
display: block;
|
|
317
303
|
width: 100%;
|
|
@@ -321,7 +307,6 @@
|
|
|
321
307
|
border: none;
|
|
322
308
|
resize: none;
|
|
323
309
|
overflow-y: auto;
|
|
324
|
-
line-height: var(--fui-line-height-normal, $fui-line-height-normal);
|
|
325
310
|
|
|
326
311
|
&::placeholder {
|
|
327
312
|
color: var(--fui-text-tertiary, $fui-text-tertiary);
|
|
@@ -357,20 +342,16 @@
|
|
|
357
342
|
background-color: var(--fui-bg-elevated, $fui-bg-elevated);
|
|
358
343
|
border-radius: var(--fui-radius-lg, $fui-radius-lg) var(--fui-radius-lg, $fui-radius-lg) 0 0;
|
|
359
344
|
padding: var(--fui-space-0-75, $fui-space-0-75) var(--fui-space-0-75, $fui-space-0-75) 0;
|
|
360
|
-
border: 1px solid var(--fui-border, $fui-border);
|
|
345
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-border, $fui-border);
|
|
361
346
|
border-bottom: none;
|
|
362
347
|
}
|
|
363
348
|
|
|
364
349
|
.tabButton {
|
|
365
350
|
@include button-reset;
|
|
351
|
+
@include action.base;
|
|
352
|
+
@include action.size("sm");
|
|
366
353
|
|
|
367
|
-
display: flex;
|
|
368
|
-
align-items: center;
|
|
369
|
-
justify-content: center;
|
|
370
|
-
padding: var(--fui-space-1, $fui-space-1) var(--fui-space-3, $fui-space-3);
|
|
371
354
|
border-radius: var(--fui-radius-md, $fui-radius-md) var(--fui-radius-md, $fui-radius-md) 0 0;
|
|
372
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
373
|
-
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
374
355
|
color: var(--fui-text-tertiary, $fui-text-tertiary);
|
|
375
356
|
transition:
|
|
376
357
|
color var(--fui-transition-fast, $fui-transition-fast),
|
|
@@ -398,7 +379,7 @@
|
|
|
398
379
|
gap: var(--fui-space-2, $fui-space-2);
|
|
399
380
|
padding: var(--fui-space-1, $fui-space-1) var(--fui-space-2, $fui-space-2);
|
|
400
381
|
background-color: var(--fui-bg-secondary, $fui-bg-secondary);
|
|
401
|
-
border-top: 1px solid var(--fui-border, $fui-border);
|
|
382
|
+
border-top: var(--fui-stroke-hairline, 1px) solid var(--fui-border, $fui-border);
|
|
402
383
|
}
|
|
403
384
|
|
|
404
385
|
// ============================================
|
|
@@ -426,16 +407,12 @@
|
|
|
426
407
|
.actionButton {
|
|
427
408
|
@include button-reset;
|
|
428
409
|
@include interactive-base;
|
|
410
|
+
@include action.base;
|
|
411
|
+
@include action.icon-only("md");
|
|
429
412
|
|
|
430
|
-
display: flex;
|
|
431
|
-
align-items: center;
|
|
432
|
-
justify-content: center;
|
|
433
|
-
width: 2rem;
|
|
434
|
-
height: 2rem;
|
|
435
413
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
436
414
|
background-color: var(--fui-bg-tertiary, $fui-bg-tertiary);
|
|
437
415
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
438
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
439
416
|
|
|
440
417
|
&:hover:not(:disabled) {
|
|
441
418
|
background-color: var(--fui-bg-hover, $fui-bg-hover);
|
|
@@ -446,8 +423,7 @@
|
|
|
446
423
|
}
|
|
447
424
|
|
|
448
425
|
svg {
|
|
449
|
-
|
|
450
|
-
height: 1rem;
|
|
426
|
+
@include action.glyph("md");
|
|
451
427
|
}
|
|
452
428
|
}
|
|
453
429
|
|
|
@@ -458,16 +434,13 @@
|
|
|
458
434
|
.modeButton {
|
|
459
435
|
@include button-reset;
|
|
460
436
|
@include interactive-base;
|
|
437
|
+
@include action.base;
|
|
438
|
+
@include action.size("sm");
|
|
439
|
+
@include target.hit-area("compact");
|
|
461
440
|
|
|
462
|
-
display: flex;
|
|
463
|
-
align-items: center;
|
|
464
|
-
gap: var(--fui-space-1, $fui-space-1);
|
|
465
|
-
padding: var(--fui-space-1, $fui-space-1) var(--fui-space-2, $fui-space-2);
|
|
466
441
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
467
442
|
background-color: transparent;
|
|
468
443
|
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
469
|
-
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
470
|
-
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
471
444
|
|
|
472
445
|
&:hover:not(:disabled) {
|
|
473
446
|
background-color: var(--fui-bg-hover, $fui-bg-hover);
|
|
@@ -495,15 +468,11 @@
|
|
|
495
468
|
.attach {
|
|
496
469
|
@include button-reset;
|
|
497
470
|
@include interactive-base;
|
|
471
|
+
@include action.base;
|
|
472
|
+
@include action.icon-only("sm");
|
|
473
|
+
@include target.hit-area("compact");
|
|
498
474
|
|
|
499
|
-
display: flex;
|
|
500
|
-
align-items: center;
|
|
501
|
-
justify-content: center;
|
|
502
475
|
flex-shrink: 0;
|
|
503
|
-
// The target size rather than a spacing step, so it tracks whatever scale
|
|
504
|
-
// the surface around it has established.
|
|
505
|
-
width: var(--fui-target-size-min, $fui-target-size-min);
|
|
506
|
-
height: var(--fui-target-size-min, $fui-target-size-min);
|
|
507
476
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
508
477
|
background-color: transparent;
|
|
509
478
|
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
@@ -523,8 +492,7 @@
|
|
|
523
492
|
}
|
|
524
493
|
|
|
525
494
|
svg {
|
|
526
|
-
|
|
527
|
-
height: var(--fui-icon-sm, $fui-icon-sm);
|
|
495
|
+
@include action.glyph("sm");
|
|
528
496
|
}
|
|
529
497
|
}
|
|
530
498
|
|
|
@@ -547,19 +515,19 @@
|
|
|
547
515
|
// Sized off the same target as everything else in the bar, so a chip and a
|
|
548
516
|
// control are the same height and the card has one horizontal rhythm.
|
|
549
517
|
.attachment {
|
|
550
|
-
--_chip-height:
|
|
518
|
+
--_chip-height: #{action.track("sm")};
|
|
551
519
|
|
|
552
520
|
display: inline-flex;
|
|
553
521
|
align-items: center;
|
|
554
522
|
gap: var(--fui-space-1, $fui-space-1);
|
|
555
523
|
height: var(--_chip-height);
|
|
556
|
-
max-width:
|
|
524
|
+
max-width: layout.measure("composer-item");
|
|
557
525
|
padding-inline: var(--fui-space-1, $fui-space-1);
|
|
558
526
|
// Outlined rather than filled. A chip sits on whatever surface the prompt is
|
|
559
527
|
// using, and on an elevated card the raised fill is the same value as the
|
|
560
528
|
// card itself — so the object would disappear exactly where it is most
|
|
561
529
|
// likely to be used. An edge reads on any of them.
|
|
562
|
-
border: 1px solid var(--fui-border, $fui-border);
|
|
530
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-border, $fui-border);
|
|
563
531
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
564
532
|
background-color: var(--fui-bg-tertiary, $fui-bg-tertiary);
|
|
565
533
|
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
@@ -597,13 +565,11 @@
|
|
|
597
565
|
.attachmentRemove {
|
|
598
566
|
@include button-reset;
|
|
599
567
|
@include interactive-base;
|
|
568
|
+
@include action.base;
|
|
569
|
+
@include action.icon-only("micro");
|
|
570
|
+
@include target.hit-area("compact");
|
|
600
571
|
|
|
601
|
-
display: flex;
|
|
602
|
-
align-items: center;
|
|
603
|
-
justify-content: center;
|
|
604
572
|
flex-shrink: 0;
|
|
605
|
-
width: calc(var(--_chip-height) - var(--fui-space-1, #{$fui-space-1}));
|
|
606
|
-
height: calc(var(--_chip-height) - var(--fui-space-1, #{$fui-space-1}));
|
|
607
573
|
border-radius: var(--fui-radius-sm, $fui-radius-sm);
|
|
608
574
|
background-color: transparent;
|
|
609
575
|
color: var(--fui-text-tertiary, $fui-text-tertiary);
|
|
@@ -614,8 +580,7 @@
|
|
|
614
580
|
}
|
|
615
581
|
|
|
616
582
|
svg {
|
|
617
|
-
|
|
618
|
-
height: var(--fui-icon-xs, $fui-icon-xs);
|
|
583
|
+
@include action.glyph("micro");
|
|
619
584
|
}
|
|
620
585
|
}
|
|
621
586
|
|
|
@@ -634,7 +599,7 @@
|
|
|
634
599
|
// must not push the submit button off the row. Select's ghost trigger already
|
|
635
600
|
// allows shrinking and ellipsises its value; this only caps how far it grows.
|
|
636
601
|
.select {
|
|
637
|
-
max-width:
|
|
602
|
+
max-width: layout.measure("composer-item");
|
|
638
603
|
}
|
|
639
604
|
|
|
640
605
|
// ============================================
|
|
@@ -642,7 +607,9 @@
|
|
|
642
607
|
// ============================================
|
|
643
608
|
|
|
644
609
|
.usage {
|
|
645
|
-
@include
|
|
610
|
+
@include typography.role("caption");
|
|
611
|
+
|
|
612
|
+
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
646
613
|
white-space: nowrap;
|
|
647
614
|
}
|
|
648
615
|
|
|
@@ -653,12 +620,9 @@
|
|
|
653
620
|
.submit {
|
|
654
621
|
@include button-reset;
|
|
655
622
|
@include interactive-base;
|
|
623
|
+
@include action.base;
|
|
624
|
+
@include action.icon-only("md");
|
|
656
625
|
|
|
657
|
-
display: flex;
|
|
658
|
-
align-items: center;
|
|
659
|
-
justify-content: center;
|
|
660
|
-
width: 2rem;
|
|
661
|
-
height: 2rem;
|
|
662
626
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
663
627
|
// A neutral inverse keeps send visibly primary without spending the product
|
|
664
628
|
// accent, which may already encode agent state.
|
|
@@ -679,8 +643,7 @@
|
|
|
679
643
|
}
|
|
680
644
|
|
|
681
645
|
svg {
|
|
682
|
-
|
|
683
|
-
height: 1rem;
|
|
646
|
+
@include action.glyph("md");
|
|
684
647
|
}
|
|
685
648
|
}
|
|
686
649
|
|
|
@@ -437,9 +437,6 @@ function PromptTextarea({
|
|
|
437
437
|
onFiles,
|
|
438
438
|
} = usePromptContext();
|
|
439
439
|
|
|
440
|
-
const lineHeight = 1.5;
|
|
441
|
-
const padding = 12; // top + bottom padding in pixels
|
|
442
|
-
|
|
443
440
|
const adjustHeight = React.useCallback(() => {
|
|
444
441
|
const textarea = textareaRef.current;
|
|
445
442
|
if (!textarea || !autoResize) return;
|
|
@@ -450,8 +447,12 @@ function PromptTextarea({
|
|
|
450
447
|
// Calculate min and max heights based on rows
|
|
451
448
|
const computedStyle = window.getComputedStyle(textarea);
|
|
452
449
|
const fontSize = parseFloat(computedStyle.fontSize);
|
|
453
|
-
const
|
|
454
|
-
const
|
|
450
|
+
const computedLineHeight = parseFloat(computedStyle.lineHeight);
|
|
451
|
+
const lineHeight = Number.isFinite(computedLineHeight) ? computedLineHeight : fontSize * 1.5;
|
|
452
|
+
const paddingBlock =
|
|
453
|
+
parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);
|
|
454
|
+
const minHeight = minRows * lineHeight + paddingBlock;
|
|
455
|
+
const maxHeight = maxRows * lineHeight + paddingBlock;
|
|
455
456
|
|
|
456
457
|
// Set the height, clamped to min/max
|
|
457
458
|
const newHeight = Math.min(Math.max(textarea.scrollHeight, minHeight), maxHeight);
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
@use "../../tokens/variables" as *;
|
|
2
2
|
@use "../../tokens/mixins" as *;
|
|
3
|
+
@use "../../recipes/boolean-range" as boolean;
|
|
4
|
+
@use "../../recipes/field" as field;
|
|
5
|
+
@use "../../recipes/target" as target;
|
|
3
6
|
|
|
4
7
|
// Container wrapper
|
|
5
8
|
.wrapper {
|
|
6
|
-
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: var(--fui-space-1, $fui-space-1);
|
|
9
|
+
@include field.wrapper;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.groupLabel {
|
|
12
|
-
@include label
|
|
13
|
+
@include field.label;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
// Radio group
|
|
16
17
|
.group {
|
|
17
18
|
display: flex;
|
|
18
|
-
gap: var(--fui-space-
|
|
19
|
+
gap: var(--fui-raw-space-12, 12px);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.vertical {
|
|
@@ -29,14 +30,18 @@
|
|
|
29
30
|
|
|
30
31
|
// Individual item wrapper
|
|
31
32
|
.itemWrapper {
|
|
32
|
-
display: inline-flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
gap: var(--fui-space-1, $fui-space-1);
|
|
35
33
|
cursor: pointer;
|
|
36
|
-
font-family: var(--fui-font-sans, $fui-font-sans);
|
|
37
34
|
|
|
38
|
-
&[data-
|
|
39
|
-
|
|
35
|
+
&[data-size="sm"] {
|
|
36
|
+
@include boolean.row("sm");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-size="md"] {
|
|
40
|
+
@include boolean.row("md");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[data-size="lg"] {
|
|
44
|
+
@include boolean.row("lg");
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
&[data-disabled] {
|
|
@@ -48,18 +53,17 @@
|
|
|
48
53
|
// The radio circle
|
|
49
54
|
.radio {
|
|
50
55
|
@include interactive-base;
|
|
56
|
+
@include boolean.mark("md");
|
|
57
|
+
@include target.hit-area("micro");
|
|
51
58
|
|
|
52
|
-
position: relative;
|
|
53
59
|
display: inline-flex;
|
|
54
60
|
align-items: center;
|
|
55
61
|
justify-content: center;
|
|
56
62
|
flex-shrink: 0;
|
|
57
63
|
box-sizing: border-box;
|
|
58
|
-
|
|
59
|
-
height: var(--fui-icon-sm, $fui-icon-sm);
|
|
60
|
-
margin-top: 0;
|
|
64
|
+
margin-block-start: var(--_fui-boolean-mark-offset, 0);
|
|
61
65
|
background-color: var(--fui-field-bg, $fui-bg-elevated);
|
|
62
|
-
border: 1px solid var(--fui-field-border, $fui-border-strong);
|
|
66
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-field-border, $fui-border-strong);
|
|
63
67
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
64
68
|
cursor: inherit;
|
|
65
69
|
|
|
@@ -91,26 +95,16 @@
|
|
|
91
95
|
border-color: var(--fui-color-danger-text, $fui-color-danger-text);
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
&::before {
|
|
95
|
-
content: "";
|
|
96
|
-
position: absolute;
|
|
97
|
-
top: 50%;
|
|
98
|
-
left: 50%;
|
|
99
|
-
width: var(--fui-target-size-min, $fui-target-size-min);
|
|
100
|
-
height: var(--fui-target-size-min, $fui-target-size-min);
|
|
101
|
-
transform: translate(-50%, -50%);
|
|
102
|
-
}
|
|
103
98
|
}
|
|
104
99
|
|
|
105
100
|
// Size variants
|
|
106
101
|
.radioSm {
|
|
107
|
-
|
|
108
|
-
height: var(--fui-icon-xs, $fui-icon-xs);
|
|
102
|
+
@include boolean.mark("sm");
|
|
109
103
|
}
|
|
110
104
|
|
|
111
105
|
.radioLg {
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
@include boolean.mark("lg");
|
|
107
|
+
@include target.hit-area("compact");
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
// The indicator dot - use absolute positioning for perfect centering
|
|
@@ -118,8 +112,8 @@
|
|
|
118
112
|
position: absolute;
|
|
119
113
|
top: 50%;
|
|
120
114
|
left: 50%;
|
|
121
|
-
width:
|
|
122
|
-
height:
|
|
115
|
+
width: var(--fui-raw-space-8, 8px);
|
|
116
|
+
height: var(--fui-raw-space-8, 8px);
|
|
123
117
|
background-color: var(--fui-button-primary-base, $fui-color-accent);
|
|
124
118
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
125
119
|
|
|
@@ -137,48 +131,33 @@
|
|
|
137
131
|
}
|
|
138
132
|
|
|
139
133
|
.radioSm .indicator {
|
|
140
|
-
width:
|
|
141
|
-
height:
|
|
134
|
+
width: var(--fui-raw-space-6, 6px);
|
|
135
|
+
height: var(--fui-raw-space-6, 6px);
|
|
142
136
|
}
|
|
143
137
|
|
|
144
138
|
.radioLg .indicator {
|
|
145
|
-
width:
|
|
146
|
-
height:
|
|
139
|
+
width: var(--fui-raw-space-10, 10px);
|
|
140
|
+
height: var(--fui-raw-space-10, 10px);
|
|
147
141
|
}
|
|
148
142
|
|
|
149
143
|
// Label content
|
|
150
144
|
.content {
|
|
151
|
-
|
|
152
|
-
flex-direction: column;
|
|
153
|
-
gap: var(--fui-space-0-5, $fui-space-0-5);
|
|
145
|
+
min-inline-size: 0;
|
|
154
146
|
}
|
|
155
147
|
|
|
156
148
|
.label {
|
|
157
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
158
|
-
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
159
149
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
160
|
-
line-height: var(--fui-line-height-tight, $fui-line-height-tight);
|
|
161
150
|
user-select: none;
|
|
162
151
|
}
|
|
163
152
|
|
|
164
|
-
.labelSm {
|
|
165
|
-
font-size: var(--fui-font-size-xs, $fui-font-size-xs);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.labelLg {
|
|
169
|
-
font-size: var(--fui-font-size-base, $fui-font-size-base);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
153
|
.helper {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
line-height: var(--fui-line-height-normal, $fui-line-height-normal);
|
|
154
|
+
display: block;
|
|
155
|
+
@include field.helper;
|
|
176
156
|
}
|
|
177
157
|
|
|
178
158
|
// Error message
|
|
179
159
|
.error {
|
|
180
|
-
|
|
181
|
-
color: var(--fui-color-danger-text, $fui-color-danger-text);
|
|
160
|
+
@include field.error;
|
|
182
161
|
}
|
|
183
162
|
|
|
184
163
|
// ============================================
|
|
@@ -192,18 +171,9 @@
|
|
|
192
171
|
// as a deliberate state change rather than a small shift between two grey
|
|
193
172
|
// surfaces. Mirrors the pattern used by the Checkbox card variant.
|
|
194
173
|
.itemWrapperCard {
|
|
195
|
-
display: flex;
|
|
196
|
-
align-items: center;
|
|
197
|
-
gap: var(--fui-space-3, $fui-space-3);
|
|
198
174
|
width: 100%;
|
|
199
|
-
height: var(
|
|
200
|
-
--fui-input-height,
|
|
201
|
-
$fui-input-height
|
|
202
|
-
); // matches Input size="md" so radio cards align with form fields
|
|
203
|
-
box-sizing: border-box;
|
|
204
|
-
padding: 0 var(--fui-space-3, $fui-space-3);
|
|
205
175
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
206
|
-
border: 1px solid var(--fui-border-default, $fui-border-default);
|
|
176
|
+
border: var(--fui-stroke-hairline, 1px) solid var(--fui-border-default, $fui-border-default);
|
|
207
177
|
background: transparent;
|
|
208
178
|
transition:
|
|
209
179
|
background var(--fui-transition-fast, $fui-transition-fast),
|
|
@@ -235,11 +205,21 @@
|
|
|
235
205
|
color-mix(in srgb, var(--fui-button-primary-base, #{$fui-color-accent}) 28%, transparent);
|
|
236
206
|
}
|
|
237
207
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
.label {
|
|
241
|
-
font-size: var(--fui-font-size-sm, $fui-font-size-sm);
|
|
208
|
+
&[data-size="sm"] {
|
|
209
|
+
@include boolean.card("sm");
|
|
242
210
|
}
|
|
211
|
+
|
|
212
|
+
&[data-size="md"] {
|
|
213
|
+
@include boolean.card("md");
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&[data-size="lg"] {
|
|
217
|
+
@include boolean.card("lg");
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.group[data-invalid] .radio {
|
|
222
|
+
border-color: var(--fui-color-danger-text, $fui-color-danger-text);
|
|
243
223
|
}
|
|
244
224
|
|
|
245
225
|
// ============================================
|
|
@@ -248,8 +228,9 @@
|
|
|
248
228
|
|
|
249
229
|
@media (prefers-contrast: more) {
|
|
250
230
|
.radio {
|
|
251
|
-
border-width: 2px;
|
|
252
231
|
border-color: var(--fui-text-primary, $fui-text-primary);
|
|
232
|
+
outline: var(--fui-stroke-hairline, 1px) solid var(--fui-text-primary, $fui-text-primary);
|
|
233
|
+
outline-offset: calc(-1 * var(--fui-stroke-default, 2px));
|
|
253
234
|
|
|
254
235
|
&[data-checked] {
|
|
255
236
|
border-color: var(--fui-button-primary-base, $fui-color-accent);
|
|
@@ -132,14 +132,6 @@ function RadioItem({
|
|
|
132
132
|
.filter(Boolean)
|
|
133
133
|
.join(" ");
|
|
134
134
|
|
|
135
|
-
const labelClasses = [
|
|
136
|
-
styles.label,
|
|
137
|
-
size === "sm" && styles.labelSm,
|
|
138
|
-
size === "lg" && styles.labelLg,
|
|
139
|
-
]
|
|
140
|
-
.filter(Boolean)
|
|
141
|
-
.join(" ");
|
|
142
|
-
|
|
143
135
|
const wrapperClasses = [
|
|
144
136
|
styles.itemWrapper,
|
|
145
137
|
variant === "card" && styles.itemWrapperCard,
|
|
@@ -157,6 +149,7 @@ function RadioItem({
|
|
|
157
149
|
aria-label={ariaLabel}
|
|
158
150
|
aria-labelledby={ariaLabelledBy}
|
|
159
151
|
aria-describedby={ariaDescribedBy}
|
|
152
|
+
data-size={size}
|
|
160
153
|
className={[radioClasses, className].filter(Boolean).join(" ")}
|
|
161
154
|
>
|
|
162
155
|
<BaseRadio.Indicator className={styles.indicator} />
|
|
@@ -169,6 +162,7 @@ function RadioItem({
|
|
|
169
162
|
className={wrapperClasses}
|
|
170
163
|
data-disabled={disabled || undefined}
|
|
171
164
|
data-has-description={resolvedHelperText ? true : undefined}
|
|
165
|
+
data-size={size}
|
|
172
166
|
>
|
|
173
167
|
<BaseRadio.Root
|
|
174
168
|
value={value}
|
|
@@ -176,12 +170,13 @@ function RadioItem({
|
|
|
176
170
|
aria-label={ariaLabel}
|
|
177
171
|
aria-labelledby={mergeAriaIds(ariaLabelledBy, labelId)}
|
|
178
172
|
aria-describedby={mergeAriaIds(ariaDescribedBy, descriptionId)}
|
|
173
|
+
data-size={size}
|
|
179
174
|
className={radioClasses}
|
|
180
175
|
>
|
|
181
176
|
<BaseRadio.Indicator className={styles.indicator} />
|
|
182
177
|
</BaseRadio.Root>
|
|
183
178
|
<div className={[styles.content, contentClassName].filter(Boolean).join(" ")}>
|
|
184
|
-
<span id={labelId} className={
|
|
179
|
+
<span id={labelId} className={styles.label}>
|
|
185
180
|
{label}
|
|
186
181
|
</span>
|
|
187
182
|
{resolvedHelperText && (
|
|
@@ -248,6 +243,7 @@ const RadioGroupRoot = React.forwardRef<HTMLDivElement, RadioGroupProps>(functio
|
|
|
248
243
|
ref={ref}
|
|
249
244
|
{...htmlProps}
|
|
250
245
|
className={[styles.wrapper, wrapperClassName].filter(Boolean).join(" ")}
|
|
246
|
+
data-size={size}
|
|
251
247
|
>
|
|
252
248
|
{label && (
|
|
253
249
|
<span id={labelId} className={styles.groupLabel}>
|
|
@@ -268,6 +264,8 @@ const RadioGroupRoot = React.forwardRef<HTMLDivElement, RadioGroupProps>(functio
|
|
|
268
264
|
aria-label={ariaLabel}
|
|
269
265
|
aria-labelledby={mergeAriaIds(ariaLabelledBy, labelId)}
|
|
270
266
|
aria-describedby={mergeAriaIds(ariaDescribedBy, errorId, helperId)}
|
|
267
|
+
data-size={size}
|
|
268
|
+
data-invalid={hasError || undefined}
|
|
271
269
|
className={groupClasses}
|
|
272
270
|
>
|
|
273
271
|
{children}
|