@usefragments/ui 1.7.0 → 2.0.1
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 +54 -66
- package/dist/assets/nav-glyph.cjs +139 -0
- package/dist/assets/nav-glyph.d.ts +28 -0
- package/dist/assets/nav-glyph.d.ts.map +1 -0
- package/dist/assets/nav-glyph.js +139 -0
- package/dist/assets/nav-glyph.module.scss.cjs +71 -0
- package/dist/assets/nav-glyph.module.scss.js +71 -0
- package/dist/assets/ui.css +4975 -4959
- package/dist/blocks/components/StatsCard.d.ts +1 -1
- package/dist/blocks/components/StatsCard.d.ts.map +1 -1
- package/dist/codeblock.cjs +23 -16
- package/dist/codeblock.js +16 -9
- package/dist/colorpicker.cjs +1 -0
- package/dist/colorpicker.js +1 -0
- 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 +21 -21
- package/dist/components/Alert/Alert.module.scss.js +21 -21
- package/dist/components/Alert/index.cjs +14 -8
- package/dist/components/Alert/index.d.ts +9 -9
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js +14 -8
- 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 +2 -2
- package/dist/components/AppShell/index.js +2 -2
- package/dist/components/Avatar/Avatar.module.scss.cjs +14 -14
- package/dist/components/Avatar/Avatar.module.scss.js +14 -14
- package/dist/components/Badge/Badge.module.scss.cjs +33 -31
- package/dist/components/Badge/Badge.module.scss.js +33 -31
- package/dist/components/Badge/index.cjs +13 -3
- package/dist/components/Badge/index.d.ts +18 -13
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +13 -3
- 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 +11 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.js +11 -8
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/Button.module.scss.cjs +36 -27
- package/dist/components/Button/Button.module.scss.js +36 -27
- package/dist/components/Button/index.cjs +20 -4
- package/dist/components/Button/index.d.ts +18 -10
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +20 -4
- 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 +27 -34
- package/dist/components/Card/Card.module.scss.js +27 -34
- package/dist/components/Card/index.cjs +13 -8
- package/dist/components/Card/index.d.ts +23 -25
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/index.js +13 -8
- package/dist/components/Chart/Chart.module.scss.cjs +15 -15
- package/dist/components/Chart/Chart.module.scss.js +15 -15
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +11 -11
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
- package/dist/components/Checkbox/index.cjs +2 -2
- package/dist/components/Checkbox/index.d.ts +4 -6
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Chip/Chip.module.scss.cjs +19 -19
- package/dist/components/Chip/Chip.module.scss.js +19 -19
- package/dist/components/Chip/index.cjs +1 -2
- package/dist/components/Chip/index.d.ts +8 -3
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Chip/index.js +1 -2
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +22 -22
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +22 -22
- package/dist/components/CodeBlock/index.d.ts +3 -2
- package/dist/components/CodeBlock/index.d.ts.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.scss.cjs +9 -9
- package/dist/components/Collapsible/Collapsible.module.scss.js +9 -9
- package/dist/components/ColorPicker/ColorPicker.module.scss.cjs +14 -14
- package/dist/components/ColorPicker/ColorPicker.module.scss.js +14 -14
- package/dist/components/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.module.scss.cjs +21 -21
- package/dist/components/Combobox/Combobox.module.scss.js +21 -21
- package/dist/components/Combobox/index.cjs +9 -5
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +9 -5
- package/dist/components/Command/Command.module.scss.cjs +14 -11
- package/dist/components/Command/Command.module.scss.js +14 -11
- package/dist/components/Command/index.cjs +2 -1
- package/dist/components/Command/index.d.ts +6 -1
- package/dist/components/Command/index.d.ts.map +1 -1
- package/dist/components/Command/index.js +2 -1
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/ConversationList/index.cjs +2 -2
- package/dist/components/ConversationList/index.js +2 -2
- package/dist/components/DataTable/DataTable.module.scss.cjs +31 -28
- package/dist/components/DataTable/DataTable.module.scss.js +31 -28
- package/dist/components/DataTable/DataTable.virtual.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/Dialog/index.cjs +2 -2
- package/dist/components/Dialog/index.d.ts +5 -4
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +2 -2
- package/dist/components/Drawer/Drawer.module.scss.cjs +39 -39
- package/dist/components/Drawer/Drawer.module.scss.js +40 -40
- package/dist/components/Drawer/index.cjs +2 -2
- package/dist/components/Drawer/index.d.ts +5 -4
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +11 -11
- package/dist/components/EmptyState/EmptyState.module.scss.js +11 -11
- package/dist/components/EmptyState/index.cjs +9 -4
- package/dist/components/EmptyState/index.d.ts +8 -5
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/index.js +9 -4
- package/dist/components/Field/Field.module.scss.cjs +5 -5
- package/dist/components/Field/Field.module.scss.js +5 -5
- package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
- package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
- package/dist/components/Grid/Grid.module.scss.cjs +54 -54
- package/dist/components/Grid/Grid.module.scss.js +54 -54
- package/dist/components/Header/Header.module.scss.cjs +33 -33
- package/dist/components/Header/Header.module.scss.js +33 -33
- package/dist/components/Icon/Icon.module.scss.cjs +30 -33
- package/dist/components/Icon/Icon.module.scss.js +30 -33
- package/dist/components/Icon/index.cjs +15 -14
- package/dist/components/Icon/index.d.ts +23 -12
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +15 -14
- package/dist/components/IconButton/IconButton.module.scss.cjs +12 -12
- package/dist/components/IconButton/IconButton.module.scss.js +12 -12
- package/dist/components/IconButton/index.d.ts +4 -4
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/Input/Input.module.scss.cjs +15 -21
- package/dist/components/Input/Input.module.scss.js +15 -21
- package/dist/components/Input/index.cjs +2 -14
- package/dist/components/Input/index.d.ts +0 -2
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +2 -14
- package/dist/components/Link/Link.module.scss.cjs +24 -16
- package/dist/components/Link/Link.module.scss.js +24 -16
- package/dist/components/Link/index.cjs +13 -2
- package/dist/components/Link/index.d.ts +10 -3
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +13 -2
- package/dist/components/List/List.module.scss.cjs +23 -19
- package/dist/components/List/List.module.scss.js +23 -19
- package/dist/components/List/index.cjs +7 -7
- package/dist/components/List/index.d.ts +10 -7
- package/dist/components/List/index.d.ts.map +1 -1
- package/dist/components/List/index.js +7 -7
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Loading/Loading.module.scss.cjs +30 -30
- package/dist/components/Loading/Loading.module.scss.js +30 -30
- package/dist/components/Loading/index.cjs +5 -5
- package/dist/components/Loading/index.d.ts +8 -7
- package/dist/components/Loading/index.d.ts.map +1 -1
- package/dist/components/Loading/index.js +5 -5
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/Menu/Menu.module.scss.cjs +14 -14
- package/dist/components/Menu/Menu.module.scss.js +14 -14
- package/dist/components/Message/Message.module.scss.cjs +20 -20
- package/dist/components/Message/Message.module.scss.js +20 -20
- package/dist/components/Message/index.cjs +1 -1
- package/dist/components/Message/index.d.ts +1 -1
- package/dist/components/Message/index.js +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +29 -29
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +29 -29
- package/dist/components/Pagination/Pagination.module.scss.cjs +10 -10
- package/dist/components/Pagination/Pagination.module.scss.js +10 -10
- 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 +28 -25
- package/dist/components/Progress/Progress.module.scss.js +28 -25
- package/dist/components/Progress/index.cjs +21 -12
- package/dist/components/Progress/index.d.ts +10 -6
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +21 -12
- package/dist/components/Prompt/Prompt.module.scss.cjs +30 -30
- package/dist/components/Prompt/Prompt.module.scss.js +30 -30
- package/dist/components/Prompt/index.cjs +7 -7
- package/dist/components/Prompt/index.d.ts +11 -9
- package/dist/components/Prompt/index.d.ts.map +1 -1
- package/dist/components/Prompt/index.js +7 -7
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +20 -17
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +20 -17
- package/dist/components/RadioGroup/index.cjs +10 -5
- package/dist/components/RadioGroup/index.d.ts +11 -7
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +10 -5
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +5 -5
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +5 -5
- 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 +26 -20
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +26 -20
- package/dist/components/Separator/Separator.module.scss.cjs +25 -19
- package/dist/components/Separator/Separator.module.scss.js +25 -19
- package/dist/components/Separator/index.cjs +10 -8
- package/dist/components/Separator/index.d.ts +4 -2
- package/dist/components/Separator/index.d.ts.map +1 -1
- package/dist/components/Separator/index.js +10 -8
- 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 +3 -3
- package/dist/components/Sidebar/index.js +3 -3
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +46 -46
- package/dist/components/Skeleton/Skeleton.module.scss.js +46 -46
- package/dist/components/Skeleton/index.cjs +7 -7
- package/dist/components/Skeleton/index.d.ts +8 -7
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +7 -7
- package/dist/components/Slider/Slider.module.scss.cjs +12 -12
- package/dist/components/Slider/Slider.module.scss.js +12 -12
- package/dist/components/Switch/Switch.module.scss.cjs +9 -9
- package/dist/components/Switch/Switch.module.scss.js +9 -9
- package/dist/components/Table/Table.module.scss.cjs +15 -15
- package/dist/components/Table/Table.module.scss.js +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/TableOfContents/index.cjs +1 -1
- package/dist/components/TableOfContents/index.js +1 -1
- package/dist/components/Tabs/Tabs.module.scss.cjs +18 -18
- package/dist/components/Tabs/Tabs.module.scss.js +18 -18
- package/dist/components/Tabs/index.cjs +5 -6
- package/dist/components/Tabs/index.d.ts +8 -6
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +5 -6
- package/dist/components/Text/Text.module.scss.cjs +105 -105
- package/dist/components/Text/Text.module.scss.js +105 -105
- package/dist/components/Text/index.cjs +5 -9
- package/dist/components/Text/index.d.ts +15 -11
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +5 -9
- package/dist/components/Textarea/Textarea.module.scss.cjs +22 -28
- package/dist/components/Textarea/Textarea.module.scss.js +22 -28
- package/dist/components/Textarea/index.cjs +3 -10
- package/dist/components/Textarea/index.d.ts +0 -2
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +3 -10
- package/dist/components/Theme/index.cjs +20 -4
- package/dist/components/Theme/index.d.ts +6 -12
- package/dist/components/Theme/index.d.ts.map +1 -1
- package/dist/components/Theme/index.js +20 -4
- package/dist/components/ThemeToggle/ThemeButton.cjs +51 -0
- package/dist/components/ThemeToggle/ThemeButton.d.ts +16 -0
- package/dist/components/ThemeToggle/ThemeButton.d.ts.map +1 -0
- package/dist/components/ThemeToggle/ThemeButton.js +34 -0
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.cjs +6 -9
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.js +6 -9
- package/dist/components/ThemeToggle/icons.cjs +48 -0
- package/dist/components/ThemeToggle/icons.d.ts +10 -0
- package/dist/components/ThemeToggle/icons.d.ts.map +1 -0
- package/dist/components/ThemeToggle/icons.js +48 -0
- package/dist/components/ThemeToggle/index.cjs +5 -74
- package/dist/components/ThemeToggle/index.d.ts +5 -8
- package/dist/components/ThemeToggle/index.d.ts.map +1 -1
- package/dist/components/ThemeToggle/index.js +3 -72
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +18 -15
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +18 -15
- package/dist/components/ThinkingIndicator/index.cjs +7 -8
- package/dist/components/ThinkingIndicator/index.d.ts +6 -5
- package/dist/components/ThinkingIndicator/index.d.ts.map +1 -1
- package/dist/components/ThinkingIndicator/index.js +7 -8
- package/dist/components/Toast/Toast.module.scss.cjs +28 -29
- package/dist/components/Toast/Toast.module.scss.js +29 -30
- package/dist/components/Toast/index.cjs +28 -30
- package/dist/components/Toast/index.d.ts +9 -8
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/index.js +28 -30
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +21 -19
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +22 -20
- package/dist/components/ToggleGroup/index.cjs +4 -5
- package/dist/components/ToggleGroup/index.d.ts +7 -6
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.js +4 -5
- 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-virtual.cjs +3 -2
- package/dist/data-table-virtual.js +3 -2
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.js +1 -1
- package/dist/datepicker.cjs +23 -11
- package/dist/datepicker.js +23 -11
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/measurements/generated.cjs +37 -93
- package/dist/measurements/generated.d.ts +37 -92
- package/dist/measurements/generated.d.ts.map +1 -1
- package/dist/measurements/generated.js +37 -93
- package/dist/measurements/index.d.ts +1 -1
- package/dist/measurements/index.d.ts.map +1 -1
- package/dist/utils/seed-derivation.cjs +0 -1
- package/dist/utils/seed-derivation.d.ts +1 -3
- package/dist/utils/seed-derivation.d.ts.map +1 -1
- package/dist/utils/seed-derivation.js +0 -1
- package/dist/utils/theme-presets.cjs +5 -10
- package/dist/utils/theme-presets.d.ts +1 -2
- package/dist/utils/theme-presets.d.ts.map +1 -1
- package/dist/utils/theme-presets.js +5 -10
- package/fragments.json +1 -1
- package/package.json +5 -8
- package/src/assets/nav-glyph.module.scss +166 -0
- package/src/assets/nav-glyph.tsx +188 -0
- package/src/components/Accordion/Accordion.module.scss +5 -3
- package/src/components/Alert/Alert.contract.json +18 -18
- package/src/components/Alert/Alert.module.scss +50 -64
- package/src/components/Alert/index.tsx +24 -17
- package/src/components/AppShell/AppShell.contract.json +7 -7
- package/src/components/AppShell/AppShell.module.scss +49 -17
- package/src/components/AppShell/index.tsx +2 -2
- package/src/components/Avatar/Avatar.module.scss +0 -1
- package/src/components/Badge/Badge.contract.json +58 -22
- package/src/components/Badge/Badge.module.scss +72 -47
- package/src/components/Badge/index.tsx +34 -17
- package/src/components/BentoGrid/BentoGrid.module.scss +4 -8
- package/src/components/Box/Box.module.scss +7 -6
- package/src/components/Breadcrumbs/Breadcrumbs.module.scss +15 -5
- package/src/components/Breadcrumbs/index.tsx +5 -1
- package/src/components/Button/Button.module.scss +261 -186
- package/src/components/Button/index.tsx +41 -28
- package/src/components/ButtonGroup/ButtonGroup.contract.json +5 -5
- package/src/components/ButtonGroup/ButtonGroup.module.scss +8 -6
- package/src/components/Card/Card.consumer-fixture.module.scss +5 -2
- package/src/components/Card/Card.module.scss +73 -133
- package/src/components/Card/index.tsx +41 -36
- package/src/components/Chart/Chart.module.scss +6 -5
- package/src/components/Checkbox/Checkbox.contract.json +4 -3
- package/src/components/Checkbox/Checkbox.module.scss +16 -32
- package/src/components/Checkbox/index.tsx +6 -8
- package/src/components/Chip/Chip.contract.json +10 -10
- package/src/components/Chip/Chip.module.scss +23 -22
- package/src/components/Chip/index.tsx +10 -6
- package/src/components/CodeBlock/CodeBlock.module.scss +47 -70
- package/src/components/CodeBlock/index.tsx +23 -16
- package/src/components/Collapsible/Collapsible.module.scss +1 -7
- package/src/components/ColorPicker/ColorPicker.module.scss +20 -13
- package/src/components/ColorPicker/index.tsx +1 -0
- package/src/components/Combobox/Combobox.module.scss +16 -19
- package/src/components/Combobox/index.tsx +10 -1
- package/src/components/Command/Command.contract.json +7 -1
- package/src/components/Command/Command.module.scss +19 -21
- package/src/components/Command/index.tsx +7 -1
- package/src/components/ComponentDefaults/ComponentDefaults.contract.json +91 -0
- package/src/components/ConversationList/ConversationList.module.scss +2 -3
- package/src/components/ConversationList/index.tsx +2 -2
- package/src/components/DataTable/DataTable.module.scss +12 -9
- package/src/components/DataTable/DataTable.virtual.tsx +3 -2
- package/src/components/DataTable/index.tsx +1 -1
- package/src/components/DatePicker/DatePicker.module.scss +32 -42
- package/src/components/DatePicker/index.tsx +18 -7
- package/src/components/Dialog/Dialog.module.scss +23 -29
- package/src/components/Dialog/index.tsx +7 -5
- package/src/components/Drawer/Drawer.contract.json +6 -6
- package/src/components/Drawer/Drawer.module.scss +123 -64
- package/src/components/Drawer/index.tsx +7 -5
- package/src/components/Editor/Editor.contract.json +1 -1
- package/src/components/Editor/Editor.module.scss +26 -13
- package/src/components/EmptyState/EmptyState.contract.json +6 -6
- package/src/components/EmptyState/EmptyState.module.scss +31 -23
- package/src/components/EmptyState/index.tsx +17 -9
- package/src/components/Field/Field.module.scss +2 -1
- package/src/components/Fieldset/Fieldset.module.scss +5 -4
- package/src/components/Form/Form.contract.json +4 -4
- package/src/components/Grid/Grid.module.scss +2 -2
- package/src/components/Header/Header.contract.json +2 -2
- package/src/components/Header/Header.module.scss +24 -36
- package/src/components/Icon/Icon.contract.json +19 -23
- package/src/components/Icon/Icon.module.scss +13 -12
- package/src/components/Icon/index.tsx +31 -31
- package/src/components/IconButton/IconButton.contract.json +8 -8
- package/src/components/IconButton/IconButton.module.scss +13 -4
- package/src/components/IconButton/index.tsx +4 -4
- package/src/components/Input/Input.contract.json +0 -13
- package/src/components/Input/Input.module.scss +4 -54
- package/src/components/Input/index.tsx +2 -18
- package/src/components/Link/Link.contract.json +19 -11
- package/src/components/Link/Link.module.scss +24 -10
- package/src/components/Link/index.tsx +26 -5
- package/src/components/List/List.contract.json +11 -11
- package/src/components/List/List.module.scss +10 -5
- package/src/components/List/index.tsx +17 -13
- package/src/components/Listbox/Listbox.module.scss +14 -20
- package/src/components/Loading/Loading.contract.json +6 -6
- package/src/components/Loading/Loading.module.scss +29 -26
- package/src/components/Loading/index.tsx +13 -12
- package/src/components/Markdown/Markdown.module.scss +2 -1
- package/src/components/Menu/Menu.contract.json +5 -5
- package/src/components/Menu/Menu.module.scss +11 -10
- package/src/components/Message/Message.contract.json +5 -5
- package/src/components/Message/Message.module.scss +8 -6
- package/src/components/Message/index.tsx +2 -2
- package/src/components/NavigationMenu/NavigationMenu.module.scss +22 -67
- package/src/components/Pagination/Pagination.module.scss +7 -14
- package/src/components/Popover/Popover.contract.json +4 -4
- package/src/components/Popover/Popover.module.scss +24 -23
- package/src/components/Progress/Progress.contract.json +11 -11
- package/src/components/Progress/Progress.module.scss +13 -8
- package/src/components/Progress/index.tsx +34 -16
- package/src/components/Prompt/Prompt.contract.json +12 -12
- package/src/components/Prompt/Prompt.module.scss +40 -47
- package/src/components/Prompt/index.tsx +17 -15
- package/src/components/RadioGroup/RadioGroup.contract.json +6 -4
- package/src/components/RadioGroup/RadioGroup.module.scss +38 -32
- package/src/components/RadioGroup/index.tsx +23 -10
- package/src/components/ScrollArea/ScrollArea.module.scss +30 -33
- package/src/components/Select/Select.module.scss +19 -18
- package/src/components/Select/index.tsx +26 -24
- package/src/components/Separator/Separator.contract.json +10 -10
- package/src/components/Separator/Separator.module.scss +24 -40
- package/src/components/Separator/index.tsx +16 -11
- package/src/components/Sidebar/Sidebar.contract.json +1 -1
- package/src/components/Sidebar/Sidebar.module.scss +92 -95
- package/src/components/Sidebar/index.tsx +3 -3
- package/src/components/Skeleton/Skeleton.contract.json +9 -9
- package/src/components/Skeleton/Skeleton.module.scss +23 -16
- package/src/components/Skeleton/index.tsx +16 -15
- package/src/components/Slider/Slider.module.scss +6 -19
- package/src/components/Stack/Stack.contract.json +1 -1
- package/src/components/Stack/Stack.module.scss +13 -12
- package/src/components/Switch/Switch.module.scss +44 -35
- package/src/components/Table/Table.module.scss +9 -13
- package/src/components/TableOfContents/TableOfContents.module.scss +12 -18
- package/src/components/TableOfContents/index.tsx +1 -1
- package/src/components/Tabs/Tabs.contract.json +14 -14
- package/src/components/Tabs/Tabs.module.scss +27 -31
- package/src/components/Tabs/index.tsx +15 -12
- package/src/components/Text/Text.contract.json +36 -14
- package/src/components/Text/Text.module.scss +19 -20
- package/src/components/Text/index.tsx +23 -21
- package/src/components/Textarea/Textarea.contract.json +0 -13
- package/src/components/Textarea/Textarea.module.scss +24 -52
- package/src/components/Textarea/index.tsx +3 -14
- package/src/components/Theme/Theme.contract.json +9 -8
- package/src/components/Theme/index.tsx +39 -12
- package/src/components/ThemeToggle/ThemeButton.tsx +49 -0
- package/src/components/ThemeToggle/ThemeToggle.module.scss +21 -44
- package/src/components/ThemeToggle/icons.tsx +46 -0
- package/src/components/ThemeToggle/index.tsx +8 -90
- package/src/components/ThinkingIndicator/ThinkingIndicator.contract.json +11 -10
- package/src/components/ThinkingIndicator/ThinkingIndicator.module.scss +9 -7
- package/src/components/ThinkingIndicator/index.tsx +12 -14
- package/src/components/Toast/Toast.contract.json +29 -13
- package/src/components/Toast/Toast.module.scss +49 -104
- package/src/components/Toast/index.tsx +39 -34
- package/src/components/ToggleGroup/ToggleGroup.contract.json +13 -13
- package/src/components/ToggleGroup/ToggleGroup.module.scss +16 -46
- package/src/components/ToggleGroup/index.tsx +11 -11
- package/src/components/Tooltip/Tooltip.contract.json +3 -3
- package/src/components/Tooltip/Tooltip.module.scss +16 -10
- package/src/components/VisuallyHidden/VisuallyHidden.module.scss +4 -14
- package/src/index.ts +14 -10
- package/src/measurements/MeasurementTargets.module.scss +6 -7
- package/src/measurements/generated.ts +38 -96
- package/src/measurements/index.ts +0 -1
- package/src/measurements/measurements.json +37 -116
- package/src/recipes/_action.scss +4 -4
- package/src/recipes/_boolean-range.scss +9 -5
- package/src/recipes/_feedback.scss +17 -16
- package/src/recipes/_field.scss +28 -20
- package/src/recipes/_navigation.scss +84 -29
- package/src/recipes/_overlay.scss +143 -43
- package/src/recipes/_popup.scss +46 -36
- package/src/recipes/_prose.scss +35 -23
- package/src/recipes/_representation.scss +10 -9
- package/src/recipes/_segmented.scss +1 -1
- package/src/recipes/_table-chrome.scss +27 -16
- package/src/recipes/_target.scss +2 -4
- package/src/recipes/_typography.scss +10 -0
- package/src/styles/globals.scss +14 -9
- package/src/tokens/_component-properties.scss +19 -1
- package/src/tokens/_computed.scss +27 -33
- package/src/tokens/_measurements.catalog.generated.css +58 -45
- package/src/tokens/_measurements.generated.scss +107 -250
- package/src/tokens/_mixins.scss +42 -40
- package/src/tokens/_palettes.scss +1 -1
- package/src/tokens/_property-registrations.scss +9 -0
- package/src/tokens/_seeds.scss +1 -12
- package/src/tokens/_variables.scss +71 -59
- package/src/utils/seed-derivation.ts +1 -8
- package/src/utils/theme-presets.ts +5 -12
- package/dist/blocks/AccountSettings.block.d.ts +0 -3
- package/dist/blocks/AccountSettings.block.d.ts.map +0 -1
- package/dist/blocks/ActivityFeedSkeleton.block.d.ts +0 -3
- package/dist/blocks/ActivityFeedSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/BlogEditor.block.d.ts +0 -3
- package/dist/blocks/BlogEditor.block.d.ts.map +0 -1
- package/dist/blocks/ChatInterface.block.d.ts +0 -3
- package/dist/blocks/ChatInterface.block.d.ts.map +0 -1
- package/dist/blocks/ChatMessages.block.d.ts +0 -3
- package/dist/blocks/ChatMessages.block.d.ts.map +0 -1
- package/dist/blocks/CheckoutForm.block.d.ts +0 -3
- package/dist/blocks/CheckoutForm.block.d.ts.map +0 -1
- package/dist/blocks/CommandPalette.block.d.ts +0 -3
- package/dist/blocks/CommandPalette.block.d.ts.map +0 -1
- package/dist/blocks/ContactForm.block.d.ts +0 -3
- package/dist/blocks/ContactForm.block.d.ts.map +0 -1
- package/dist/blocks/DashboardPage.block.d.ts +0 -3
- package/dist/blocks/DashboardPage.block.d.ts.map +0 -1
- package/dist/blocks/DashboardSkeleton.block.d.ts +0 -3
- package/dist/blocks/DashboardSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/DataTable.block.d.ts +0 -3
- package/dist/blocks/DataTable.block.d.ts.map +0 -1
- package/dist/blocks/EmptyState.block.d.ts +0 -3
- package/dist/blocks/EmptyState.block.d.ts.map +0 -1
- package/dist/blocks/FAQSection.block.d.ts +0 -3
- package/dist/blocks/FAQSection.block.d.ts.map +0 -1
- package/dist/blocks/FeatureGrid.block.d.ts +0 -3
- package/dist/blocks/FeatureGrid.block.d.ts.map +0 -1
- package/dist/blocks/HeroSection.block.d.ts +0 -3
- package/dist/blocks/HeroSection.block.d.ts.map +0 -1
- package/dist/blocks/NavigationHeader.block.d.ts +0 -3
- package/dist/blocks/NavigationHeader.block.d.ts.map +0 -1
- package/dist/blocks/PaginatedTable.block.d.ts +0 -3
- package/dist/blocks/PaginatedTable.block.d.ts.map +0 -1
- package/dist/blocks/PricingComparison.block.d.ts +0 -3
- package/dist/blocks/PricingComparison.block.d.ts.map +0 -1
- package/dist/blocks/ProductCard.block.d.ts +0 -3
- package/dist/blocks/ProductCard.block.d.ts.map +0 -1
- package/dist/blocks/RegistrationForm.block.d.ts +0 -3
- package/dist/blocks/RegistrationForm.block.d.ts.map +0 -1
- package/dist/blocks/SettingsDrawer.block.d.ts +0 -3
- package/dist/blocks/SettingsDrawer.block.d.ts.map +0 -1
- package/dist/blocks/SettingsPanel.block.d.ts +0 -3
- package/dist/blocks/SettingsPanel.block.d.ts.map +0 -1
- package/dist/blocks/ShoppingCart.block.d.ts +0 -3
- package/dist/blocks/ShoppingCart.block.d.ts.map +0 -1
- package/dist/blocks/StatsCardSkeleton.block.d.ts +0 -3
- package/dist/blocks/StatsCardSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/TableSkeleton.block.d.ts +0 -3
- package/dist/blocks/TableSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/ThinkingStates.block.d.ts +0 -3
- package/dist/blocks/ThinkingStates.block.d.ts.map +0 -1
- package/dist/components/Toggle/index.d.ts +0 -3
- package/dist/components/Toggle/index.d.ts.map +0 -1
- package/src/components/Toggle/index.ts +0 -7
- package/src/tokens/_density.scss +0 -85
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "../../tokens/variables" as *;
|
|
2
2
|
@use "../../tokens/mixins" as *;
|
|
3
|
+
@use "../../tokens/measurements.generated" as measurements;
|
|
3
4
|
@use "../../recipes/typography";
|
|
4
5
|
|
|
5
6
|
.root {
|
|
@@ -7,12 +8,12 @@
|
|
|
7
8
|
|
|
8
9
|
display: flex;
|
|
9
10
|
flex-direction: column;
|
|
10
|
-
gap: 0;
|
|
11
|
+
gap: var(--fui-raw-space-0, #{measurements.raw-space(0)});
|
|
11
12
|
padding: var(--fui-surface-inset-default, 16px);
|
|
12
|
-
margin: 0;
|
|
13
|
+
margin: var(--fui-raw-space-0, #{measurements.raw-space(0)});
|
|
13
14
|
|
|
14
15
|
&[data-disabled] {
|
|
15
|
-
opacity:
|
|
16
|
+
opacity: var(--fui-opacity-disabled, #{$fui-opacity-disabled});
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
// Legend and description carry their own block margins, so spacing is added
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
@include typography.role("ui-standard");
|
|
28
29
|
|
|
29
30
|
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
30
|
-
padding: 0;
|
|
31
|
+
padding: var(--fui-raw-space-0, #{measurements.raw-space(0)});
|
|
31
32
|
margin-block-end: var(--fui-raw-space-16, 16px);
|
|
32
33
|
|
|
33
34
|
&:has(+ .description) {
|
|
@@ -75,22 +75,22 @@
|
|
|
75
75
|
{
|
|
76
76
|
"name": "Sign up",
|
|
77
77
|
"description": "Paired name fields, then full-width rows and a right-aligned submit.",
|
|
78
|
-
"code": "<Form onSubmit={(e) => { e.preventDefault(); }}>\n <Grid columns={2} gap=\"md\">\n <Field name=\"firstName\">\n <Field.Label>First Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"Jane\" />\n </Field.Control>\n </Field>\n <Field name=\"lastName\">\n <Field.Label>Last Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"Doe\" />\n </Field.Control>\n </Field>\n <Grid.Item colSpan=\"full\">\n <Field name=\"email\">\n <Field.Label>Email</Field.Label>\n <Field.Control>\n <Input type=\"email\" placeholder=\"jane@example.com\" />\n </Field.Control>\n <Field.Error match=\"typeMismatch\">Enter a valid email address</Field.Error>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"password\">\n <Field.Label>Password</Field.Label>\n <Field.Control>\n <Input type=\"password\" placeholder=\"At least 8 characters\" />\n </Field.Control>\n <Field.Description>Must be at least 8 characters</Field.Description>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"terms\">\n <Field.Control>\n <Checkbox label=\"I agree to the terms and conditions\" />\n </Field.Control>\n </Field>\n </Grid.Item>\n </Grid>\n <Form.Actions>\n <Button type=\"submit\" variant=\"
|
|
78
|
+
"code": "<Form onSubmit={(e) => { e.preventDefault(); }}>\n <Grid columns={2} gap=\"md\">\n <Field name=\"firstName\">\n <Field.Label>First Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"Jane\" />\n </Field.Control>\n </Field>\n <Field name=\"lastName\">\n <Field.Label>Last Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"Doe\" />\n </Field.Control>\n </Field>\n <Grid.Item colSpan=\"full\">\n <Field name=\"email\">\n <Field.Label>Email</Field.Label>\n <Field.Control>\n <Input type=\"email\" placeholder=\"jane@example.com\" />\n </Field.Control>\n <Field.Error match=\"typeMismatch\">Enter a valid email address</Field.Error>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"password\">\n <Field.Label>Password</Field.Label>\n <Field.Control>\n <Input type=\"password\" placeholder=\"At least 8 characters\" />\n </Field.Control>\n <Field.Description>Must be at least 8 characters</Field.Description>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"terms\">\n <Field.Control>\n <Checkbox label=\"I agree to the terms and conditions\" />\n </Field.Control>\n </Field>\n </Grid.Item>\n </Grid>\n <Form.Actions>\n <Button type=\"submit\" variant=\"solid\">Create Account</Button>\n </Form.Actions>\n</Form>"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "Profile settings",
|
|
82
82
|
"description": "Fieldsets split a long form into sections the user can scan.",
|
|
83
|
-
"code": "<Form onSubmit={(e) => { e.preventDefault(); }}>\n <Fieldset>\n <Fieldset.Legend>Profile</Fieldset.Legend>\n <Grid columns={2} gap=\"md\">\n <Field name=\"displayName\">\n <Field.Label>Display Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"How others see you\" />\n </Field.Control>\n </Field>\n <Field name=\"timezone\">\n <Field.Label>Timezone</Field.Label>\n <Field.Control>\n <Select placeholder=\"Select timezone\">\n <Select.Trigger />\n <Select.Content>\n <Select.Item value=\"utc\">UTC</Select.Item>\n <Select.Item value=\"est\">Eastern (EST)</Select.Item>\n <Select.Item value=\"pst\">Pacific (PST)</Select.Item>\n <Select.Item value=\"gmt\">GMT</Select.Item>\n </Select.Content>\n </Select>\n </Field.Control>\n </Field>\n <Grid.Item colSpan=\"full\">\n <Field name=\"bio\">\n <Field.Label>Bio</Field.Label>\n <Field.Control>\n <Textarea placeholder=\"Tell us about yourself\" rows={3} maxLength={280} />\n </Field.Control>\n <Field.Description>Max 280 characters</Field.Description>\n </Field>\n </Grid.Item>\n </Grid>\n </Fieldset>\n <Fieldset>\n <Fieldset.Legend>Notifications</Fieldset.Legend>\n <Field name=\"emailNotifs\">\n <Field.Control>\n <Switch label=\"Email notifications\" />\n </Field.Control>\n </Field>\n <Field name=\"marketingEmails\">\n <Field.Control>\n <Switch label=\"Marketing emails\" />\n </Field.Control>\n </Field>\n <Field name=\"frequency\">\n <Field.Label>Digest frequency</Field.Label>\n <Field.Control>\n <RadioGroup name=\"frequency\" orientation=\"vertical\">\n <RadioGroup.Item value=\"daily\" label=\"Daily\" />\n <RadioGroup.Item value=\"weekly\" label=\"Weekly\" />\n <RadioGroup.Item value=\"monthly\" label=\"Monthly\" />\n </RadioGroup>\n </Field.Control>\n </Field>\n </Fieldset>\n <Form.Actions>\n <Button type=\"submit\" variant=\"
|
|
83
|
+
"code": "<Form onSubmit={(e) => { e.preventDefault(); }}>\n <Fieldset>\n <Fieldset.Legend>Profile</Fieldset.Legend>\n <Grid columns={2} gap=\"md\">\n <Field name=\"displayName\">\n <Field.Label>Display Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"How others see you\" />\n </Field.Control>\n </Field>\n <Field name=\"timezone\">\n <Field.Label>Timezone</Field.Label>\n <Field.Control>\n <Select placeholder=\"Select timezone\">\n <Select.Trigger />\n <Select.Content>\n <Select.Item value=\"utc\">UTC</Select.Item>\n <Select.Item value=\"est\">Eastern (EST)</Select.Item>\n <Select.Item value=\"pst\">Pacific (PST)</Select.Item>\n <Select.Item value=\"gmt\">GMT</Select.Item>\n </Select.Content>\n </Select>\n </Field.Control>\n </Field>\n <Grid.Item colSpan=\"full\">\n <Field name=\"bio\">\n <Field.Label>Bio</Field.Label>\n <Field.Control>\n <Textarea placeholder=\"Tell us about yourself\" rows={3} maxLength={280} />\n </Field.Control>\n <Field.Description>Max 280 characters</Field.Description>\n </Field>\n </Grid.Item>\n </Grid>\n </Fieldset>\n <Fieldset>\n <Fieldset.Legend>Notifications</Fieldset.Legend>\n <Field name=\"emailNotifs\">\n <Field.Control>\n <Switch label=\"Email notifications\" />\n </Field.Control>\n </Field>\n <Field name=\"marketingEmails\">\n <Field.Control>\n <Switch label=\"Marketing emails\" />\n </Field.Control>\n </Field>\n <Field name=\"frequency\">\n <Field.Label>Digest frequency</Field.Label>\n <Field.Control>\n <RadioGroup name=\"frequency\" orientation=\"vertical\">\n <RadioGroup.Item value=\"daily\" label=\"Daily\" />\n <RadioGroup.Item value=\"weekly\" label=\"Weekly\" />\n <RadioGroup.Item value=\"monthly\" label=\"Monthly\" />\n </RadioGroup>\n </Field.Control>\n </Field>\n </Fieldset>\n <Form.Actions>\n <Button type=\"submit\" variant=\"solid\">Save Changes</Button>\n </Form.Actions>\n</Form>"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"name": "Contact form",
|
|
87
87
|
"description": "Mixed control types in one submission flow.",
|
|
88
|
-
"code": "<Form onSubmit={(e) => { e.preventDefault(); }}>\n <Grid columns={2} gap=\"md\">\n <Field name=\"name\">\n <Field.Label>Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"Your name\" />\n </Field.Control>\n </Field>\n <Field name=\"email\">\n <Field.Label>Email</Field.Label>\n <Field.Control>\n <Input type=\"email\" placeholder=\"you@example.com\" />\n </Field.Control>\n </Field>\n <Grid.Item colSpan=\"full\">\n <Field name=\"subject\">\n <Field.Label>Subject</Field.Label>\n <Field.Control>\n <Select placeholder=\"What is this about?\">\n <Select.Trigger />\n <Select.Content>\n <Select.Item value=\"general\">General Inquiry</Select.Item>\n <Select.Item value=\"support\">Technical Support</Select.Item>\n <Select.Item value=\"billing\">Billing</Select.Item>\n <Select.Item value=\"feedback\">Feedback</Select.Item>\n </Select.Content>\n </Select>\n </Field.Control>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"message\">\n <Field.Label>Message</Field.Label>\n <Field.Control>\n <Textarea placeholder=\"How can we help?\" rows={5} />\n </Field.Control>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"copy\">\n <Field.Control>\n <Checkbox label=\"Send me a copy\" />\n </Field.Control>\n </Field>\n </Grid.Item>\n </Grid>\n <Form.Actions>\n <Button type=\"submit\" variant=\"
|
|
88
|
+
"code": "<Form onSubmit={(e) => { e.preventDefault(); }}>\n <Grid columns={2} gap=\"md\">\n <Field name=\"name\">\n <Field.Label>Name</Field.Label>\n <Field.Control>\n <Input placeholder=\"Your name\" />\n </Field.Control>\n </Field>\n <Field name=\"email\">\n <Field.Label>Email</Field.Label>\n <Field.Control>\n <Input type=\"email\" placeholder=\"you@example.com\" />\n </Field.Control>\n </Field>\n <Grid.Item colSpan=\"full\">\n <Field name=\"subject\">\n <Field.Label>Subject</Field.Label>\n <Field.Control>\n <Select placeholder=\"What is this about?\">\n <Select.Trigger />\n <Select.Content>\n <Select.Item value=\"general\">General Inquiry</Select.Item>\n <Select.Item value=\"support\">Technical Support</Select.Item>\n <Select.Item value=\"billing\">Billing</Select.Item>\n <Select.Item value=\"feedback\">Feedback</Select.Item>\n </Select.Content>\n </Select>\n </Field.Control>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"message\">\n <Field.Label>Message</Field.Label>\n <Field.Control>\n <Textarea placeholder=\"How can we help?\" rows={5} />\n </Field.Control>\n </Field>\n </Grid.Item>\n <Grid.Item colSpan=\"full\">\n <Field name=\"copy\">\n <Field.Control>\n <Checkbox label=\"Send me a copy\" />\n </Field.Control>\n </Field>\n </Grid.Item>\n </Grid>\n <Form.Actions>\n <Button type=\"submit\" variant=\"solid\">Send Message</Button>\n </Form.Actions>\n</Form>"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"name": "With server errors",
|
|
92
92
|
"description": "Errors from the server land on the fields that caused them.",
|
|
93
|
-
"code": "<Form errors={{ username: 'Username is already taken', email: 'Email is already registered' }}>\n <Grid columns={2} gap=\"md\">\n <Field name=\"username\">\n <Field.Label>Username</Field.Label>\n <Field.Control>\n <Input defaultValue=\"janedoe\" />\n </Field.Control>\n <Field.Error />\n </Field>\n <Field name=\"email\">\n <Field.Label>Email</Field.Label>\n <Field.Control>\n <Input type=\"email\" defaultValue=\"jane@example.com\" />\n </Field.Control>\n <Field.Error />\n </Field>\n </Grid>\n <Form.Actions>\n <Button type=\"submit\" variant=\"
|
|
93
|
+
"code": "<Form errors={{ username: 'Username is already taken', email: 'Email is already registered' }}>\n <Grid columns={2} gap=\"md\">\n <Field name=\"username\">\n <Field.Label>Username</Field.Label>\n <Field.Control>\n <Input defaultValue=\"janedoe\" />\n </Field.Control>\n <Field.Error />\n </Field>\n <Field name=\"email\">\n <Field.Label>Email</Field.Label>\n <Field.Control>\n <Input type=\"email\" defaultValue=\"jane@example.com\" />\n </Field.Control>\n <Field.Error />\n </Field>\n </Grid>\n <Form.Actions>\n <Button type=\"submit\" variant=\"solid\">Submit</Button>\n </Form.Actions>\n</Form>"
|
|
94
94
|
}
|
|
95
95
|
],
|
|
96
96
|
"relations": [
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
.grid {
|
|
9
9
|
display: grid;
|
|
10
10
|
width: 100%;
|
|
11
|
-
gap:
|
|
11
|
+
gap: layout.gap("md");
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// ============================================
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.columnsResponsive {
|
|
76
76
|
--_cols: var(--fui-grid-cols, 1);
|
|
77
77
|
|
|
78
|
-
grid-template-columns: repeat(var(--_cols), 1fr);
|
|
78
|
+
grid-template-columns: repeat(var(--_cols, var(--fui-grid-cols, 1)), 1fr);
|
|
79
79
|
|
|
80
80
|
@include breakpoint-sm {
|
|
81
81
|
--_cols: var(--fui-grid-cols-sm, var(--fui-grid-cols, 1));
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
{
|
|
99
99
|
"name": "For Default Layout",
|
|
100
100
|
"description": "Brand, nav, and actions for AppShell layout=\"default\".",
|
|
101
|
-
"code": "import { Box } from '@/components/Box';\nimport { Button } from '@/components/Button';\nimport { Header } from '@/components/Header';\nimport { ThemeToggle } from '@/components/Theme';\n\n<Box width=\"100%\" border rounded=\"md\" overflow=\"hidden\">\n <Header>\n <Header.SkipLink />\n <Header.Trigger />\n <Header.Brand href=\"/\">MyApp</Header.Brand>\n <Header.Nav>\n <Header.NavItem href=\"/dashboard\" active>Dashboard</Header.NavItem>\n <Header.NavItem href=\"/projects\">Projects</Header.NavItem>\n <Header.NavItem href=\"/settings\">Settings</Header.NavItem>\n </Header.Nav>\n <Header.Spacer />\n <Header.Actions>\n <ThemeToggle size=\"md\" />\n <Button variant=\"
|
|
101
|
+
"code": "import { Box } from '@/components/Box';\nimport { Button } from '@/components/Button';\nimport { Header } from '@/components/Header';\nimport { ThemeToggle } from '@/components/Theme';\n\n<Box width=\"100%\" border rounded=\"md\" overflow=\"hidden\">\n <Header>\n <Header.SkipLink />\n <Header.Trigger />\n <Header.Brand href=\"/\">MyApp</Header.Brand>\n <Header.Nav>\n <Header.NavItem href=\"/dashboard\" active>Dashboard</Header.NavItem>\n <Header.NavItem href=\"/projects\">Projects</Header.NavItem>\n <Header.NavItem href=\"/settings\">Settings</Header.NavItem>\n </Header.Nav>\n <Header.Spacer />\n <Header.Actions>\n <ThemeToggle size=\"md\" />\n <Button variant=\"soft\" size=\"sm\">Sign In</Button>\n </Header.Actions>\n </Header>\n</Box>"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"name": "Marketing Header",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
{
|
|
129
129
|
"name": "With NavigationMenu",
|
|
130
130
|
"description": "Rich dropdown panels with titles and descriptions.",
|
|
131
|
-
"code": "import { Box } from '@/components/Box';\nimport { Button } from '@/components/Button';\nimport { Header } from '@/components/Header';\nimport { NavigationMenu } from '@/components/NavigationMenu';\nimport { Stack } from '@/components/Stack';\nimport { ThemeToggle } from '@/components/Theme';\n\n<Box width=\"100%\" border rounded=\"md\" overflow=\"hidden\">\n <Header>\n <Header.Brand href=\"/\">MyApp</Header.Brand>\n <Header.Nav>\n <NavigationMenu aria-label=\"Site navigation\">\n <NavigationMenu.List>\n <NavigationMenu.Item value=\"products\">\n <NavigationMenu.Trigger>Products</NavigationMenu.Trigger>\n <NavigationMenu.Content>\n <Box padding=\"xs\" style={{ minWidth: '200px' }}>\n <Stack gap=\"none\">\n <NavigationMenu.Link href=\"/analytics\" title=\"Analytics\" description=\"Track your metrics.\" />\n <NavigationMenu.Link href=\"/automation\" title=\"Automation\" description=\"Automate workflows.\" />\n </Stack>\n </Box>\n </NavigationMenu.Content>\n </NavigationMenu.Item>\n <NavigationMenu.Item>\n <NavigationMenu.Link href=\"/pricing\">Pricing</NavigationMenu.Link>\n </NavigationMenu.Item>\n </NavigationMenu.List>\n <NavigationMenu.Viewport />\n </NavigationMenu>\n </Header.Nav>\n <Header.Spacer />\n <Header.Actions>\n <ThemeToggle size=\"md\" />\n <Button variant=\"
|
|
131
|
+
"code": "import { Box } from '@/components/Box';\nimport { Button } from '@/components/Button';\nimport { Header } from '@/components/Header';\nimport { NavigationMenu } from '@/components/NavigationMenu';\nimport { Stack } from '@/components/Stack';\nimport { ThemeToggle } from '@/components/Theme';\n\n<Box width=\"100%\" border rounded=\"md\" overflow=\"hidden\">\n <Header>\n <Header.Brand href=\"/\">MyApp</Header.Brand>\n <Header.Nav>\n <NavigationMenu aria-label=\"Site navigation\">\n <NavigationMenu.List>\n <NavigationMenu.Item value=\"products\">\n <NavigationMenu.Trigger>Products</NavigationMenu.Trigger>\n <NavigationMenu.Content>\n <Box padding=\"xs\" style={{ minWidth: '200px' }}>\n <Stack gap=\"none\">\n <NavigationMenu.Link href=\"/analytics\" title=\"Analytics\" description=\"Track your metrics.\" />\n <NavigationMenu.Link href=\"/automation\" title=\"Automation\" description=\"Automate workflows.\" />\n </Stack>\n </Box>\n </NavigationMenu.Content>\n </NavigationMenu.Item>\n <NavigationMenu.Item>\n <NavigationMenu.Link href=\"/pricing\">Pricing</NavigationMenu.Link>\n </NavigationMenu.Item>\n </NavigationMenu.List>\n <NavigationMenu.Viewport />\n </NavigationMenu>\n </Header.Nav>\n <Header.Spacer />\n <Header.Actions>\n <ThemeToggle size=\"md\" />\n <Button variant=\"solid\" size=\"sm\">Sign Up</Button>\n </Header.Actions>\n </Header>\n</Box>"
|
|
132
132
|
}
|
|
133
133
|
],
|
|
134
134
|
"relations": [
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
@use "../../tokens/variables" as *;
|
|
2
|
+
@use "../../tokens/measurements.generated" as measurements;
|
|
2
3
|
@use "../../tokens/mixins" as *;
|
|
3
4
|
@use "../../recipes/action" as action;
|
|
4
5
|
@use "../../recipes/layout" as layout;
|
|
5
6
|
@use "../../recipes/navigation" as navigation;
|
|
7
|
+
@use "../../recipes/overlay" as overlay;
|
|
6
8
|
@use "../../recipes/popup" as popup;
|
|
7
9
|
|
|
8
10
|
// ============================================
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
.elevatedOnScroll {
|
|
42
|
-
border-bottom: var(--fui-stroke-hairline,
|
|
44
|
+
border-bottom: var(--fui-stroke-hairline, #{$fui-stroke-hairline}) solid transparent;
|
|
43
45
|
transition: border-color var(--fui-transition-fast, $fui-transition-fast);
|
|
44
46
|
}
|
|
45
47
|
|
|
@@ -127,8 +129,8 @@
|
|
|
127
129
|
align-items: center;
|
|
128
130
|
gap: var(--fui-space-1, $fui-space-1);
|
|
129
131
|
list-style: none;
|
|
130
|
-
margin: 0;
|
|
131
|
-
padding: 0;
|
|
132
|
+
margin: var(--fui-raw-space-0, #{measurements.raw-space(0)});
|
|
133
|
+
padding: var(--fui-raw-space-0, #{measurements.raw-space(0)});
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
.navItem {
|
|
@@ -192,7 +194,7 @@
|
|
|
192
194
|
// ============================================
|
|
193
195
|
|
|
194
196
|
.navMenuPositioner {
|
|
195
|
-
z-index:
|
|
197
|
+
z-index: var(--fui-overlay-layer-anchored, #{$fui-overlay-layer-anchored});
|
|
196
198
|
outline: none;
|
|
197
199
|
}
|
|
198
200
|
|
|
@@ -200,7 +202,6 @@
|
|
|
200
202
|
@include popup.container;
|
|
201
203
|
|
|
202
204
|
min-width: layout.measure("field-minimum");
|
|
203
|
-
box-shadow: var(--fui-shadow-md, $fui-shadow-md);
|
|
204
205
|
|
|
205
206
|
opacity: 0;
|
|
206
207
|
transform: scale(0.95);
|
|
@@ -338,24 +339,15 @@
|
|
|
338
339
|
// ============================================
|
|
339
340
|
|
|
340
341
|
.mobileNavBackdrop {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
z-index: 98;
|
|
344
|
-
background: var(--fui-backdrop, $fui-backdrop);
|
|
342
|
+
@include overlay.backdrop;
|
|
343
|
+
|
|
345
344
|
animation: mobileNavFadeIn var(--fui-transition-normal, $fui-transition-normal);
|
|
346
345
|
}
|
|
347
346
|
|
|
347
|
+
// The mobile nav is the Drawer surface: same frame, width, layer and chrome.
|
|
348
348
|
.mobileNavDrawer {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
right: 0;
|
|
352
|
-
bottom: 0;
|
|
353
|
-
z-index: 99;
|
|
354
|
-
width: min(320px, 85vw);
|
|
355
|
-
background-color: var(--fui-bg-primary, $fui-bg-primary);
|
|
356
|
-
border-left: var(--fui-stroke-hairline, 1px) solid var(--fui-border, $fui-border);
|
|
357
|
-
display: flex;
|
|
358
|
-
flex-direction: column;
|
|
349
|
+
@include overlay.side-panel("end");
|
|
350
|
+
|
|
359
351
|
animation: mobileNavSlideIn var(--fui-transition-normal, $fui-transition-normal);
|
|
360
352
|
}
|
|
361
353
|
|
|
@@ -364,7 +356,8 @@
|
|
|
364
356
|
align-items: center;
|
|
365
357
|
justify-content: flex-end;
|
|
366
358
|
padding: var(--fui-space-3, $fui-space-3) var(--fui-space-4, $fui-space-4);
|
|
367
|
-
border-bottom: var(--fui-stroke-hairline,
|
|
359
|
+
border-bottom: var(--fui-stroke-hairline, #{$fui-stroke-hairline}) solid
|
|
360
|
+
var(--fui-border, $fui-border);
|
|
368
361
|
}
|
|
369
362
|
|
|
370
363
|
.mobileNavClose {
|
|
@@ -388,30 +381,23 @@
|
|
|
388
381
|
.mobileNavBody {
|
|
389
382
|
flex: 1;
|
|
390
383
|
overflow-y: auto;
|
|
391
|
-
|
|
384
|
+
// Same gutter as NavigationMenu.drawerBody so both mobile navs inset their
|
|
385
|
+
// rows identically (UIR-D42).
|
|
386
|
+
padding: var(--fui-space-2, $fui-space-2) var(--fui-navigation-gutter, #{navigation.gutter()});
|
|
392
387
|
}
|
|
393
388
|
|
|
394
389
|
.mobileNavLink {
|
|
395
390
|
@include button-reset;
|
|
396
391
|
@include navigation.row;
|
|
392
|
+
@include navigation.link-states;
|
|
397
393
|
|
|
398
394
|
display: flex;
|
|
399
395
|
align-items: center;
|
|
400
396
|
width: 100%;
|
|
401
|
-
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
402
|
-
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
403
|
-
text-decoration: none;
|
|
404
|
-
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
405
|
-
|
|
406
|
-
&:hover {
|
|
407
|
-
background-color: var(--fui-bg-hover, $fui-bg-hover);
|
|
408
|
-
color: var(--fui-text-primary, $fui-text-primary);
|
|
409
|
-
}
|
|
410
397
|
}
|
|
411
398
|
|
|
412
399
|
.mobileNavLinkActive {
|
|
413
|
-
|
|
414
|
-
background-color: var(--fui-control-selected-bg, var(--fui-bg-active, $fui-bg-active));
|
|
400
|
+
@include navigation.link-active;
|
|
415
401
|
}
|
|
416
402
|
|
|
417
403
|
.mobileNavActions {
|
|
@@ -432,7 +418,7 @@
|
|
|
432
418
|
|
|
433
419
|
@keyframes mobileNavSlideIn {
|
|
434
420
|
from {
|
|
435
|
-
transform: translateX(
|
|
421
|
+
transform: translateX(overlay.side-panel-offscreen("end"));
|
|
436
422
|
}
|
|
437
423
|
to {
|
|
438
424
|
transform: translateX(0);
|
|
@@ -456,11 +442,13 @@
|
|
|
456
442
|
position: absolute;
|
|
457
443
|
top: var(--fui-space-2, $fui-space-2);
|
|
458
444
|
left: var(--fui-space-2, $fui-space-2);
|
|
459
|
-
|
|
445
|
+
// Top of the layer scale: a skip link must win over every overlay.
|
|
446
|
+
z-index: var(--fui-overlay-layer-tooltip, #{$fui-overlay-layer-tooltip});
|
|
460
447
|
padding: var(--fui-space-2, $fui-space-2) var(--fui-space-4, $fui-space-4);
|
|
461
448
|
background-color: var(--fui-bg-primary, $fui-bg-primary);
|
|
462
449
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
463
|
-
border: var(--fui-stroke-default,
|
|
450
|
+
border: var(--fui-stroke-default, #{$fui-stroke-default}) solid
|
|
451
|
+
var(--fui-color-accent, $fui-color-accent);
|
|
464
452
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
465
453
|
text-decoration: none;
|
|
466
454
|
font-weight: var(--fui-font-weight-medium, $fui-font-weight-medium);
|
|
@@ -471,7 +459,7 @@
|
|
|
471
459
|
height: auto;
|
|
472
460
|
clip: auto;
|
|
473
461
|
white-space: normal;
|
|
474
|
-
margin: 0;
|
|
462
|
+
margin: var(--fui-raw-space-0, #{measurements.raw-space(0)});
|
|
475
463
|
padding: var(--fui-space-2, $fui-space-2) var(--fui-space-4, $fui-space-4);
|
|
476
464
|
overflow: visible;
|
|
477
465
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Icon",
|
|
4
|
-
"description": "Sizes and
|
|
4
|
+
"description": "Sizes and colours any icon so it lines up with the text beside it.",
|
|
5
5
|
"category": "display",
|
|
6
6
|
"tags": ["icon", "visual", "symbol", "graphic"],
|
|
7
7
|
"status": "stable",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"icon: union (required)",
|
|
13
13
|
"size: xs|sm|md|lg|xl (default: md)",
|
|
14
14
|
"weight: string (default: regular)",
|
|
15
|
-
"
|
|
16
|
-
"color: primary|secondary|tertiary
|
|
15
|
+
"tone: accent|info|success|warning|danger",
|
|
16
|
+
"color: primary|secondary|tertiary",
|
|
17
17
|
"iconProps: object"
|
|
18
18
|
],
|
|
19
19
|
"props": {
|
|
@@ -41,27 +41,17 @@
|
|
|
41
41
|
"required": false,
|
|
42
42
|
"values": ["thin", "light", "regular", "bold", "fill", "duotone"]
|
|
43
43
|
},
|
|
44
|
-
"
|
|
44
|
+
"tone": {
|
|
45
45
|
"type": "enum",
|
|
46
|
-
"description": "Semantic
|
|
47
|
-
"default": "default",
|
|
46
|
+
"description": "Semantic colour. Reserve success, warning and danger for real state; omit to inherit currentColor",
|
|
48
47
|
"required": false,
|
|
49
|
-
"values": [
|
|
50
|
-
"default",
|
|
51
|
-
"primary",
|
|
52
|
-
"secondary",
|
|
53
|
-
"tertiary",
|
|
54
|
-
"accent",
|
|
55
|
-
"success",
|
|
56
|
-
"warning",
|
|
57
|
-
"error"
|
|
58
|
-
]
|
|
48
|
+
"values": ["accent", "info", "success", "warning", "danger"]
|
|
59
49
|
},
|
|
60
50
|
"color": {
|
|
61
51
|
"type": "enum",
|
|
62
|
-
"description": "
|
|
52
|
+
"description": "Text-hierarchy colour, the same axis as Text color. tone wins when both are set",
|
|
63
53
|
"required": false,
|
|
64
|
-
"values": ["primary", "secondary", "tertiary"
|
|
54
|
+
"values": ["primary", "secondary", "tertiary"]
|
|
65
55
|
},
|
|
66
56
|
"iconProps": {
|
|
67
57
|
"type": "object",
|
|
@@ -76,7 +66,7 @@
|
|
|
76
66
|
],
|
|
77
67
|
"whenNot": ["Artwork or illustration (use Image)", "Multi-color or animated graphics"],
|
|
78
68
|
"guidelines": [
|
|
79
|
-
"Reserve success, warning, and
|
|
69
|
+
"Reserve the success, warning, and danger tones for real state",
|
|
80
70
|
"Hold one size per context",
|
|
81
71
|
"Match weight to the text weight beside it",
|
|
82
72
|
"iconProps reaches options the wrapper does not expose"
|
|
@@ -99,9 +89,14 @@
|
|
|
99
89
|
"code": "<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n <Icon icon={Star} size=\"xs\" />\n <Icon icon={Star} size=\"sm\" />\n <Icon icon={Star} size=\"md\" />\n <Icon icon={Star} size=\"lg\" />\n <Icon icon={Star} size=\"xl\" />\n</div>"
|
|
100
90
|
},
|
|
101
91
|
{
|
|
102
|
-
"name": "
|
|
103
|
-
"description": "
|
|
104
|
-
"code": "<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n <Icon icon={Check}
|
|
92
|
+
"name": "Tones",
|
|
93
|
+
"description": "Tone states carry meaning — never use them for decoration.",
|
|
94
|
+
"code": "<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n <Icon icon={Check} tone=\"success\" />\n <Icon icon={Warning} tone=\"warning\" />\n <Icon icon={Warning} tone=\"danger\" />\n <Icon icon={Info} tone=\"accent\" />\n</div>"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "Hierarchy",
|
|
98
|
+
"description": "The text colour ladder, for glyphs that sit beside secondary or tertiary copy.",
|
|
99
|
+
"code": "<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n <Icon icon={Heart} color=\"primary\" />\n <Icon icon={Heart} color=\"secondary\" />\n <Icon icon={Heart} color=\"tertiary\" />\n</div>"
|
|
105
100
|
},
|
|
106
101
|
{
|
|
107
102
|
"name": "Weights",
|
|
@@ -136,7 +131,8 @@
|
|
|
136
131
|
"icon: React component - icon component (required)",
|
|
137
132
|
"size: xs|sm|md|lg|xl - icon size",
|
|
138
133
|
"weight: string - optional style/weight hint for icons that support it",
|
|
139
|
-
"
|
|
134
|
+
"tone: accent|info|success|warning|danger - semantic colour",
|
|
135
|
+
"color: primary|secondary|tertiary - text-hierarchy colour",
|
|
140
136
|
"iconProps: typed from the passed icon component - advanced icon-specific props"
|
|
141
137
|
],
|
|
142
138
|
"a11yRules": ["A11Y_ICON_LABEL", "A11Y_COLOR_CONTRAST"]
|
|
@@ -20,35 +20,36 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Color variants (matching Badge/Alert pattern)
|
|
28
|
-
.primary {
|
|
23
|
+
// Text-hierarchy colour (Text's `color` axis). Absence inherits currentColor.
|
|
24
|
+
.colorPrimary {
|
|
29
25
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
.
|
|
28
|
+
.colorSecondary {
|
|
33
29
|
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
.
|
|
32
|
+
.colorTertiary {
|
|
37
33
|
color: var(--fui-text-tertiary, $fui-text-tertiary);
|
|
38
34
|
}
|
|
39
35
|
|
|
40
|
-
.
|
|
36
|
+
// Tone paints the shared status ramp (same `*-text` stops as Badge and Text).
|
|
37
|
+
.toneAccent {
|
|
41
38
|
color: var(--fui-color-accent, $fui-color-accent);
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
.
|
|
41
|
+
.toneInfo {
|
|
42
|
+
color: var(--fui-color-info-text, $fui-color-info-text);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.toneSuccess {
|
|
45
46
|
color: var(--fui-color-success-text, $fui-color-success-text);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
.
|
|
49
|
+
.toneWarning {
|
|
49
50
|
color: var(--fui-color-warning-text, $fui-color-warning-text);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
.
|
|
53
|
+
.toneDanger {
|
|
53
54
|
color: var(--fui-color-danger-text, $fui-color-danger-text);
|
|
54
55
|
}
|
|
@@ -7,56 +7,56 @@ import styles from "./Icon.module.scss";
|
|
|
7
7
|
type AnyIconComponent = React.ComponentType<any>;
|
|
8
8
|
type IconComponentProps<TIcon extends AnyIconComponent> = React.ComponentPropsWithoutRef<TIcon>;
|
|
9
9
|
|
|
10
|
+
export type IconSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
11
|
+
export type IconTone = "accent" | "info" | "success" | "warning" | "danger";
|
|
12
|
+
export type IconColor = "primary" | "secondary" | "tertiary";
|
|
13
|
+
|
|
10
14
|
export type IconProps<TIcon extends AnyIconComponent = AnyIconComponent> = Omit<
|
|
11
15
|
React.HTMLAttributes<HTMLSpanElement>,
|
|
12
16
|
"color"
|
|
13
17
|
> & {
|
|
14
18
|
/** The icon component to render */
|
|
15
19
|
icon: TIcon;
|
|
16
|
-
/** Size of the icon
|
|
17
|
-
|
|
20
|
+
/** Size of the icon. `xl` is the largest step (24px); the glyph inherits
|
|
21
|
+
* `currentColor` and the surrounding line height.
|
|
22
|
+
* @default "md" */
|
|
23
|
+
size?: IconSize;
|
|
18
24
|
/** Optional style/weight hint forwarded when the icon component supports a `weight` prop */
|
|
19
25
|
weight?: string;
|
|
20
|
-
/** Semantic
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
| "accent"
|
|
27
|
-
| "success"
|
|
28
|
-
| "warning"
|
|
29
|
-
| "error";
|
|
30
|
-
/** @deprecated Use variant instead */
|
|
31
|
-
color?: "primary" | "secondary" | "tertiary" | "accent" | "success" | "warning" | "error";
|
|
26
|
+
/** Semantic colour. Reserve `success`, `warning` and `danger` for real
|
|
27
|
+
* state; `accent` is the brand spend. Omit to inherit `currentColor`. */
|
|
28
|
+
tone?: IconTone;
|
|
29
|
+
/** Text-hierarchy colour, the same axis as Text's `color`. `tone` wins when
|
|
30
|
+
* both are set. Omit to inherit `currentColor`. */
|
|
31
|
+
color?: IconColor;
|
|
32
32
|
/** Additional props forwarded to the underlying icon component (typed from `icon`) */
|
|
33
33
|
iconProps?: Partial<IconComponentProps<TIcon>>;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const iconTargets = MEASUREMENT_PROFILES.targets.icon;
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
const TONE_CLASS: Record<IconTone, string> = {
|
|
39
|
+
accent: styles.toneAccent,
|
|
40
|
+
info: styles.toneInfo,
|
|
41
|
+
success: styles.toneSuccess,
|
|
42
|
+
warning: styles.toneWarning,
|
|
43
|
+
danger: styles.toneDanger,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const COLOR_CLASS: Record<IconColor, string> = {
|
|
47
|
+
primary: styles.colorPrimary,
|
|
48
|
+
secondary: styles.colorSecondary,
|
|
49
|
+
tertiary: styles.colorTertiary,
|
|
50
|
+
};
|
|
38
51
|
|
|
39
52
|
const IconRoot = React.forwardRef<HTMLSpanElement, IconProps>(function Icon(
|
|
40
|
-
{
|
|
41
|
-
icon: IconComponent,
|
|
42
|
-
size = "md",
|
|
43
|
-
weight = "regular",
|
|
44
|
-
variant,
|
|
45
|
-
color,
|
|
46
|
-
iconProps,
|
|
47
|
-
className,
|
|
48
|
-
style,
|
|
49
|
-
...htmlProps
|
|
50
|
-
},
|
|
53
|
+
{ icon: IconComponent, size = "md", weight = "regular", tone, color, iconProps, className, style, ...htmlProps },
|
|
51
54
|
ref
|
|
52
55
|
) {
|
|
53
|
-
// Support deprecated color prop (variant takes precedence)
|
|
54
|
-
const colorVariant = variant || color;
|
|
55
|
-
|
|
56
56
|
const classes = [
|
|
57
57
|
styles.icon,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
styles[size],
|
|
59
|
+
tone ? TONE_CLASS[tone] : color ? COLOR_CLASS[color] : undefined,
|
|
60
60
|
className,
|
|
61
61
|
]
|
|
62
62
|
.filter(Boolean)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"exportName": "IconButton",
|
|
10
10
|
"propsSummary": [
|
|
11
11
|
"children: node (required)",
|
|
12
|
-
"variant: ghost|
|
|
12
|
+
"variant: ghost|soft|outline (default: ghost)",
|
|
13
13
|
"size: sm|md|lg (default: md)",
|
|
14
14
|
"pressed: boolean",
|
|
15
15
|
"aria-label: string",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"description": "Visual treatment for the icon-only action",
|
|
27
27
|
"default": "ghost",
|
|
28
28
|
"required": false,
|
|
29
|
-
"values": ["ghost", "
|
|
29
|
+
"values": ["ghost", "soft", "outline"]
|
|
30
30
|
},
|
|
31
31
|
"size": {
|
|
32
32
|
"type": "enum",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
],
|
|
65
65
|
"guidelines": [
|
|
66
66
|
"aria-label or aria-labelledby is required, every time",
|
|
67
|
-
"ghost for ordinary toolbar actions;
|
|
67
|
+
"ghost for ordinary toolbar actions; outline when it needs separation",
|
|
68
68
|
"pressed only for real toggle state, not selection",
|
|
69
69
|
"Keep icon meaning obvious, or pair it with a Tooltip"
|
|
70
70
|
],
|
|
@@ -83,22 +83,22 @@
|
|
|
83
83
|
{
|
|
84
84
|
"name": "Variants",
|
|
85
85
|
"description": "Rising chrome: transparent, tinted, then bordered.",
|
|
86
|
-
"code": "import { Plus as PlusIcon } from '@phosphor-icons/react';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\">\n <IconButton aria-label=\"Add item\" variant=\"ghost\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"
|
|
86
|
+
"code": "import { Plus as PlusIcon } from '@phosphor-icons/react';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\">\n <IconButton aria-label=\"Add item\" variant=\"ghost\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"soft\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"outline\">\n <PlusIcon aria-hidden />\n </IconButton>\n</Stack>"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"name": "Sizes",
|
|
90
90
|
"description": "sm for table rows, lg for primary chrome.",
|
|
91
|
-
"code": "import { Plus as PlusIcon } from '@phosphor-icons/react';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\">\n <IconButton aria-label=\"Add item\" variant=\"
|
|
91
|
+
"code": "import { Plus as PlusIcon } from '@phosphor-icons/react';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\">\n <IconButton aria-label=\"Add item\" variant=\"outline\" size=\"sm\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"outline\" size=\"md\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"outline\" size=\"lg\">\n <PlusIcon aria-hidden />\n </IconButton>\n</Stack>"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"name": "Pressed state",
|
|
95
95
|
"description": "Toggle that stays on, reported through aria-pressed.",
|
|
96
|
-
"code": "import { PushPin as PinIcon } from '@phosphor-icons/react';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\">\n <IconButton aria-label=\"Pin item\" variant=\"
|
|
96
|
+
"code": "import { PushPin as PinIcon } from '@phosphor-icons/react';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\">\n <IconButton aria-label=\"Pin item\" variant=\"outline\">\n <PinIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Unpin item\" variant=\"outline\" pressed>\n <PinIcon aria-hidden />\n </IconButton>\n</Stack>"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"name": "Disabled",
|
|
100
100
|
"description": "Unavailable action, out of the tab order.",
|
|
101
|
-
"code": "import { Trash as TrashIcon } from '@phosphor-icons/react';\n\n<IconButton aria-label=\"Delete row\" variant=\"
|
|
101
|
+
"code": "import { Trash as TrashIcon } from '@phosphor-icons/react';\n\n<IconButton aria-label=\"Delete row\" variant=\"outline\" disabled>\n <TrashIcon aria-hidden />\n</IconButton>"
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
104
|
"relations": [
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"contract": {
|
|
117
117
|
"propsSummary": [
|
|
118
118
|
"children: ReactNode - icon element (required)",
|
|
119
|
-
"variant: ghost|
|
|
119
|
+
"variant: ghost|soft|outline - visual treatment",
|
|
120
120
|
"size: sm|md|lg - square control size",
|
|
121
121
|
"pressed: boolean - toggle state exposed with aria-pressed",
|
|
122
122
|
"aria-label or aria-labelledby - required accessible name"
|