@usefragments/ui 1.6.0 → 1.7.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 +4 -4
- package/dist/assets/fragments-wordmark.cjs +2 -2
- package/dist/assets/fragments-wordmark.d.ts.map +1 -1
- package/dist/assets/fragments-wordmark.js +2 -2
- package/dist/assets/ui.css +4720 -4159
- package/dist/chart.cjs +24 -6
- package/dist/chart.js +24 -6
- package/dist/codeblock.cjs +55 -29
- package/dist/codeblock.js +55 -29
- package/dist/colorpicker.cjs +3 -1
- package/dist/colorpicker.js +3 -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 +15 -12
- package/dist/components/Alert/Alert.module.scss.js +15 -12
- package/dist/components/Alert/index.cjs +7 -1
- package/dist/components/Alert/index.d.ts +12 -6
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js +7 -1
- package/dist/components/AppShell/AppShell.module.scss.cjs +14 -14
- package/dist/components/AppShell/AppShell.module.scss.js +14 -14
- 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 +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/Box/index.cjs +64 -75
- package/dist/components/Box/index.d.ts +16 -16
- package/dist/components/Box/index.d.ts.map +1 -1
- package/dist/components/Box/index.js +64 -75
- 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/Card/Card.module.scss.cjs +29 -17
- package/dist/components/Card/Card.module.scss.js +30 -18
- package/dist/components/Card/index.cjs +8 -0
- package/dist/components/Card/index.d.ts +12 -2
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/index.js +8 -0
- 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.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +9 -9
- package/dist/components/Checkbox/Checkbox.module.scss.js +9 -9
- package/dist/components/Checkbox/index.cjs +2 -2
- 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 +15 -15
- package/dist/components/Chip/Chip.module.scss.js +15 -15
- package/dist/components/Chip/index.cjs +2 -1
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Chip/index.js +2 -1
- package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +26 -23
- package/dist/components/CodeBlock/CodeBlock.module.scss.js +26 -23
- package/dist/components/CodeBlock/css-variables-theme.cjs +98 -0
- package/dist/components/CodeBlock/css-variables-theme.d.ts +27 -0
- package/dist/components/CodeBlock/css-variables-theme.d.ts.map +1 -0
- package/dist/components/CodeBlock/css-variables-theme.js +98 -0
- package/dist/components/CodeBlock/index.d.ts +17 -3
- 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 +17 -1
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +17 -1
- package/dist/components/Command/Command.module.scss.cjs +11 -11
- package/dist/components/Command/Command.module.scss.js +11 -11
- package/dist/components/Command/index.cjs +26 -15
- package/dist/components/Command/index.d.ts +2 -2
- package/dist/components/Command/index.d.ts.map +1 -1
- package/dist/components/Command/index.js +26 -15
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/DataTable/DataTable.icons.cjs +6 -33
- package/dist/components/DataTable/DataTable.icons.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.icons.js +6 -33
- package/dist/components/DataTable/DataTable.module.scss.cjs +27 -27
- package/dist/components/DataTable/DataTable.module.scss.js +27 -27
- 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/Dialog/index.cjs +11 -14
- package/dist/components/Dialog/index.d.ts +7 -7
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +11 -14
- package/dist/components/Drawer/Drawer.module.scss.cjs +29 -29
- package/dist/components/Drawer/Drawer.module.scss.js +29 -29
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/Editor/index.d.ts +10 -10
- package/dist/components/Editor/index.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.module.scss.cjs +11 -8
- package/dist/components/EmptyState/EmptyState.module.scss.js +11 -8
- package/dist/components/EmptyState/index.cjs +8 -6
- package/dist/components/EmptyState/index.d.ts +9 -4
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/index.js +8 -6
- package/dist/components/Field/Field.module.scss.cjs +5 -5
- package/dist/components/Field/Field.module.scss.js +5 -5
- package/dist/components/Field/index.cjs +9 -1
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js +9 -1
- package/dist/components/Fieldset/Fieldset.module.scss.cjs +3 -3
- package/dist/components/Fieldset/Fieldset.module.scss.js +3 -3
- package/dist/components/Grid/index.cjs +1 -1
- package/dist/components/Grid/index.js +1 -1
- 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 +17 -38
- package/dist/components/Header/index.d.ts +15 -11
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +17 -38
- package/dist/components/Icon/Icon.module.scss.cjs +15 -15
- package/dist/components/Icon/Icon.module.scss.js +15 -15
- package/dist/components/IconButton/IconButton.module.scss.cjs +8 -8
- package/dist/components/IconButton/IconButton.module.scss.js +8 -8
- package/dist/components/IconButton/index.cjs +2 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/IconButton/index.js +2 -1
- package/dist/components/Image/Image.module.scss.cjs +27 -27
- package/dist/components/Image/Image.module.scss.js +27 -27
- package/dist/components/Input/Input.module.scss.cjs +17 -17
- package/dist/components/Input/Input.module.scss.js +17 -17
- package/dist/components/Link/Link.module.scss.cjs +14 -10
- package/dist/components/Link/Link.module.scss.js +14 -10
- package/dist/components/Link/index.d.ts +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/List/List.module.scss.cjs +19 -19
- package/dist/components/List/List.module.scss.js +19 -19
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Loading/Loading.module.scss.cjs +34 -34
- package/dist/components/Loading/Loading.module.scss.js +34 -34
- package/dist/components/Loading/index.cjs +1 -1
- package/dist/components/Loading/index.js +1 -1
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/Markdown/index.d.ts +2 -2
- package/dist/components/Markdown/index.d.ts.map +1 -1
- package/dist/components/Menu/Menu.module.scss.cjs +14 -14
- package/dist/components/Menu/Menu.module.scss.js +14 -14
- package/dist/components/Message/Message.module.scss.cjs +18 -18
- package/dist/components/Message/Message.module.scss.js +18 -18
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +34 -31
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +34 -31
- package/dist/components/NavigationMenu/index.cjs +32 -15
- package/dist/components/NavigationMenu/index.d.ts +12 -6
- package/dist/components/NavigationMenu/index.d.ts.map +1 -1
- package/dist/components/NavigationMenu/index.js +32 -15
- 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 +25 -25
- package/dist/components/Progress/Progress.module.scss.js +25 -25
- package/dist/components/Prompt/Prompt.module.scss.cjs +28 -28
- package/dist/components/Prompt/Prompt.module.scss.js +28 -28
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +15 -15
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +15 -15
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +5 -5
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +5 -5
- package/dist/components/ScrollArea/index.d.ts +4 -4
- package/dist/components/ScrollArea/index.d.ts.map +1 -1
- package/dist/components/ScrollArea/scroll-state.d.ts +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/Separator/Separator.module.scss.cjs +11 -11
- package/dist/components/Separator/Separator.module.scss.js +11 -11
- 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 +12 -35
- package/dist/components/Sidebar/index.d.ts +19 -19
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +12 -35
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +50 -46
- package/dist/components/Skeleton/Skeleton.module.scss.js +50 -46
- 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 -25
- package/dist/components/Stack/Stack.module.scss.js +25 -25
- package/dist/components/Stack/index.cjs +1 -1
- package/dist/components/Stack/index.js +1 -1
- 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 +19 -19
- package/dist/components/Table/Table.module.scss.js +19 -19
- package/dist/components/TableOfContents/TableOfContents.module.scss.cjs +15 -15
- package/dist/components/TableOfContents/TableOfContents.module.scss.js +15 -15
- package/dist/components/TableOfContents/index.cjs +13 -9
- package/dist/components/TableOfContents/index.d.ts +5 -3
- package/dist/components/TableOfContents/index.d.ts.map +1 -1
- package/dist/components/TableOfContents/index.js +13 -9
- 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 +26 -6
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +26 -6
- package/dist/components/Text/Text.module.scss.cjs +87 -75
- package/dist/components/Text/Text.module.scss.js +87 -75
- package/dist/components/Text/index.cjs +49 -41
- package/dist/components/Text/index.d.ts +12 -11
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +49 -41
- package/dist/components/Textarea/Textarea.module.scss.cjs +24 -24
- package/dist/components/Textarea/Textarea.module.scss.js +24 -24
- package/dist/components/Theme/index.cjs +2 -1
- package/dist/components/Theme/index.d.ts.map +1 -1
- package/dist/components/Theme/index.js +2 -1
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.cjs +9 -6
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.js +9 -6
- package/dist/components/ThemeToggle/index.cjs +31 -6
- package/dist/components/ThemeToggle/index.d.ts +7 -2
- package/dist/components/ThemeToggle/index.d.ts.map +1 -1
- package/dist/components/ThemeToggle/index.js +32 -7
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +13 -13
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +13 -13
- package/dist/components/Toast/Toast.module.scss.cjs +20 -20
- package/dist/components/Toast/Toast.module.scss.js +20 -20
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +17 -17
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +17 -17
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/components/Tooltip/index.cjs +24 -40
- package/dist/components/Tooltip/index.d.ts +4 -4
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +24 -40
- package/dist/components/VisuallyHidden/index.d.ts +2 -2
- package/dist/data-table.cjs +2 -1
- package/dist/data-table.js +2 -1
- package/dist/datepicker.cjs +3 -2
- package/dist/datepicker.js +3 -2
- package/dist/editor.cjs +68 -28
- package/dist/editor.js +68 -28
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/markdown.cjs +21 -29
- package/dist/markdown.js +21 -29
- package/dist/measurements/generated.cjs +9 -1
- package/dist/measurements/generated.d.ts +7 -0
- package/dist/measurements/generated.d.ts.map +1 -1
- package/dist/measurements/generated.js +9 -1
- package/dist/utils/a11y.cjs +5 -2
- package/dist/utils/a11y.d.ts +5 -5
- package/dist/utils/a11y.d.ts.map +1 -1
- package/dist/utils/a11y.js +5 -2
- package/dist/utils/canonical-stamp.cjs +2 -8
- package/dist/utils/canonical-stamp.d.ts.map +1 -1
- package/dist/utils/canonical-stamp.js +1 -7
- package/dist/utils/css-warning.cjs +1 -1
- package/dist/utils/css-warning.js +1 -1
- package/dist/utils/env.cjs +17 -0
- package/dist/utils/env.d.ts +3 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +17 -0
- package/dist/utils/keyboard-shortcuts.cjs +3 -10
- package/dist/utils/keyboard-shortcuts.d.ts +4 -4
- package/dist/utils/keyboard-shortcuts.d.ts.map +1 -1
- package/dist/utils/keyboard-shortcuts.js +3 -10
- package/dist/utils/seed-derivation.cjs +10 -6
- package/dist/utils/seed-derivation.d.ts.map +1 -1
- package/dist/utils/seed-derivation.js +10 -6
- package/fragments.json +1 -1
- package/package.json +6 -4
- package/src/assets/fragments-logo.tsx +2 -2
- package/src/assets/fragments-wordmark.tsx +4 -2
- package/src/components/Accordion/Accordion.contract.json +24 -48
- package/src/components/Alert/Alert.contract.json +37 -53
- package/src/components/Alert/Alert.module.scss +24 -0
- package/src/components/Alert/index.tsx +55 -29
- package/src/components/AppShell/AppShell.contract.json +34 -51
- package/src/components/AppShell/AppShell.module.scss +53 -40
- package/src/components/Avatar/Avatar.contract.json +31 -48
- package/src/components/Avatar/Avatar.module.scss +4 -1
- package/src/components/Badge/Badge.contract.json +37 -42
- package/src/components/Badge/Badge.module.scss +9 -2
- package/src/components/BentoGrid/BentoGrid.contract.json +21 -45
- package/src/components/Box/Box.contract.json +40 -148
- package/src/components/Box/index.tsx +92 -99
- package/src/components/Breadcrumbs/Breadcrumbs.contract.json +21 -34
- package/src/components/Breadcrumbs/Breadcrumbs.module.scss +12 -7
- package/src/components/Button/Button.module.scss +8 -7
- package/src/components/ButtonGroup/ButtonGroup.contract.json +32 -47
- package/src/components/Card/Card.module.scss +82 -1
- package/src/components/Card/index.tsx +21 -2
- package/src/components/Chart/Chart.contract.json +21 -29
- package/src/components/Chart/index.tsx +36 -6
- package/src/components/Checkbox/Checkbox.contract.json +24 -24
- package/src/components/Checkbox/Checkbox.module.scss +32 -23
- package/src/components/Checkbox/index.tsx +4 -2
- package/src/components/Chip/Chip.contract.json +33 -40
- package/src/components/Chip/Chip.module.scss +2 -2
- package/src/components/Chip/index.tsx +2 -1
- package/src/components/CodeBlock/CodeBlock.contract.json +46 -76
- package/src/components/CodeBlock/CodeBlock.module.scss +40 -15
- package/src/components/CodeBlock/css-variables-theme.ts +102 -0
- package/src/components/CodeBlock/index.tsx +91 -35
- package/src/components/Collapsible/Collapsible.contract.json +21 -36
- package/src/components/ColorPicker/ColorPicker.contract.json +29 -48
- package/src/components/ColorPicker/ColorPicker.module.scss +15 -12
- package/src/components/ColorPicker/index.tsx +5 -1
- package/src/components/Combobox/Combobox.contract.json +36 -37
- package/src/components/Combobox/Combobox.module.scss +1 -1
- package/src/components/Combobox/index.tsx +31 -5
- package/src/components/Command/Command.contract.json +21 -43
- package/src/components/Command/index.tsx +58 -47
- package/src/components/ConversationList/ConversationList.contract.json +27 -32
- package/src/components/DataTable/DataTable.icons.tsx +4 -21
- package/src/components/DataTable/DataTable.module.scss +12 -8
- package/src/components/DataTable/index.tsx +8 -7
- package/src/components/DatePicker/DatePicker.contract.json +27 -28
- package/src/components/DatePicker/DatePicker.module.scss +12 -5
- package/src/components/DatePicker/index.tsx +5 -2
- package/src/components/Dialog/Dialog.module.scss +3 -3
- package/src/components/Dialog/index.tsx +47 -37
- package/src/components/Drawer/Drawer.contract.json +22 -36
- package/src/components/Editor/Editor.contract.json +31 -48
- package/src/components/Editor/Editor.module.scss +36 -14
- package/src/components/Editor/index.tsx +240 -179
- package/src/components/EmptyState/EmptyState.contract.json +31 -43
- package/src/components/EmptyState/EmptyState.module.scss +8 -0
- package/src/components/EmptyState/index.tsx +48 -23
- package/src/components/Field/Field.contract.json +28 -46
- package/src/components/Field/index.tsx +5 -1
- package/src/components/Fieldset/Fieldset.contract.json +21 -38
- package/src/components/Fieldset/Fieldset.module.scss +10 -3
- package/src/components/Form/Form.contract.json +20 -20
- package/src/components/Grid/Grid.contract.json +28 -64
- package/src/components/Grid/index.tsx +10 -10
- package/src/components/Header/Header.contract.json +31 -67
- package/src/components/Header/Header.module.scss +36 -21
- package/src/components/Header/index.tsx +134 -122
- package/src/components/Icon/Icon.contract.json +22 -62
- package/src/components/IconButton/IconButton.contract.json +34 -18
- package/src/components/IconButton/IconButton.module.scss +6 -7
- package/src/components/IconButton/index.tsx +2 -1
- package/src/components/Image/Image.contract.json +23 -56
- package/src/components/Input/Input.contract.json +26 -32
- package/src/components/Input/Input.module.scss +3 -2
- package/src/components/Link/Link.contract.json +32 -52
- package/src/components/Link/Link.module.scss +23 -6
- package/src/components/Link/index.tsx +1 -1
- package/src/components/List/List.contract.json +23 -52
- package/src/components/List/List.module.scss +1 -1
- package/src/components/Listbox/Listbox.contract.json +21 -37
- package/src/components/Loading/Loading.contract.json +37 -61
- package/src/components/Loading/Loading.module.scss +10 -7
- package/src/components/Loading/index.tsx +2 -2
- package/src/components/Main/Main.contract.json +17 -9
- package/src/components/Markdown/Markdown.contract.json +22 -43
- package/src/components/Markdown/Markdown.module.scss +43 -5
- package/src/components/Markdown/index.tsx +48 -49
- package/src/components/Menu/Menu.contract.json +25 -41
- package/src/components/Menu/Menu.module.scss +23 -8
- package/src/components/Message/Message.contract.json +29 -52
- package/src/components/Message/Message.module.scss +12 -5
- package/src/components/NavigationMenu/NavigationMenu.contract.json +36 -45
- package/src/components/NavigationMenu/NavigationMenu.module.scss +64 -19
- package/src/components/NavigationMenu/index.tsx +105 -81
- package/src/components/Pagination/Pagination.contract.json +22 -40
- package/src/components/Pagination/Pagination.module.scss +2 -2
- package/src/components/Popover/Popover.contract.json +24 -46
- package/src/components/Popover/Popover.module.scss +6 -5
- package/src/components/Progress/Progress.contract.json +32 -28
- package/src/components/Progress/Progress.module.scss +3 -2
- package/src/components/Prompt/Prompt.contract.json +31 -47
- package/src/components/Prompt/Prompt.module.scss +13 -5
- package/src/components/RadioGroup/RadioGroup.contract.json +23 -24
- package/src/components/RadioGroup/RadioGroup.module.scss +13 -14
- package/src/components/ScrollArea/ScrollArea.contract.json +18 -19
- package/src/components/ScrollArea/ScrollArea.module.scss +15 -15
- package/src/components/ScrollArea/index.tsx +16 -16
- package/src/components/ScrollArea/scroll-state.ts +24 -24
- package/src/components/Select/Select.module.scss +2 -2
- package/src/components/Separator/Separator.contract.json +24 -48
- package/src/components/Sidebar/Sidebar.contract.json +35 -67
- package/src/components/Sidebar/Sidebar.module.scss +22 -13
- package/src/components/Sidebar/index.tsx +164 -164
- package/src/components/Skeleton/Skeleton.contract.json +28 -54
- package/src/components/Skeleton/Skeleton.module.scss +27 -10
- package/src/components/Slider/Slider.contract.json +27 -39
- package/src/components/Slider/Slider.module.scss +3 -3
- package/src/components/Stack/Stack.contract.json +29 -56
- package/src/components/Stack/Stack.module.scss +13 -12
- package/src/components/Stack/index.tsx +3 -3
- package/src/components/Switch/Switch.contract.json +33 -46
- package/src/components/Switch/Switch.module.scss +64 -26
- package/src/components/Table/Table.contract.json +28 -46
- package/src/components/Table/Table.module.scss +15 -3
- package/src/components/TableOfContents/TableOfContents.contract.json +34 -21
- package/src/components/TableOfContents/TableOfContents.module.scss +15 -5
- package/src/components/TableOfContents/index.tsx +26 -9
- package/src/components/Tabs/Tabs.contract.json +24 -45
- package/src/components/Tabs/Tabs.module.scss +1 -1
- package/src/components/Tabs/index.tsx +15 -3
- package/src/components/Text/Text.contract.json +30 -72
- package/src/components/Text/Text.module.scss +21 -4
- package/src/components/Text/index.tsx +113 -75
- package/src/components/Textarea/Textarea.contract.json +25 -43
- package/src/components/Textarea/Textarea.module.scss +2 -4
- package/src/components/Theme/Theme.contract.json +32 -51
- package/src/components/Theme/index.tsx +2 -1
- package/src/components/ThemeToggle/ThemeToggle.module.scss +23 -7
- package/src/components/ThemeToggle/index.tsx +43 -7
- package/src/components/ThinkingIndicator/ThinkingIndicator.contract.json +23 -40
- package/src/components/Toast/Toast.contract.json +30 -40
- package/src/components/Toast/Toast.module.scss +1 -1
- package/src/components/ToggleGroup/ToggleGroup.contract.json +29 -30
- package/src/components/ToggleGroup/ToggleGroup.module.scss +38 -5
- package/src/components/Tooltip/Tooltip.contract.json +31 -52
- package/src/components/Tooltip/index.tsx +19 -24
- package/src/components/VisuallyHidden/VisuallyHidden.contract.json +22 -44
- package/src/components/VisuallyHidden/index.tsx +5 -5
- package/src/index.ts +2 -2
- package/src/measurements/generated.ts +9 -2
- package/src/measurements/measurements.json +7 -0
- package/src/recipes/_boolean-range.scss +3 -11
- package/src/recipes/_field.scss +5 -1
- package/src/recipes/_layout.scss +14 -7
- package/src/recipes/_popup.scss +12 -2
- package/src/recipes/_prose.scss +13 -5
- package/src/recipes/_table-chrome.scss +16 -2
- package/src/scss.d.ts +1 -1
- package/src/styles/globals.scss +20 -19
- package/src/tokens/_computed.scss +5 -16
- package/src/tokens/_derive.scss +112 -210
- package/src/tokens/_measurements.catalog.generated.css +6 -1
- package/src/tokens/_measurements.generated.scss +14 -1
- package/src/tokens/_mixins.scss +7 -8
- package/src/tokens/_palettes.scss +39 -167
- package/src/tokens/_seeds.scss +20 -20
- package/src/tokens/_variables.scss +183 -38
- package/src/utils/a11y.tsx +69 -69
- package/src/utils/aria.ts +3 -3
- package/src/utils/canonical-stamp.ts +2 -12
- package/src/utils/css-warning.ts +7 -7
- package/src/utils/env.ts +25 -0
- package/src/utils/keyboard-shortcuts.ts +131 -126
- package/src/utils/seed-derivation.ts +10 -6
- package/src/components/Button/Button.contract.json +0 -218
- package/src/components/Card/Card.contract.json +0 -175
- package/src/components/DataTable/DataTable.contract.json +0 -302
- package/src/components/Dialog/Dialog.contract.json +0 -159
- package/src/components/Select/Select.contract.json +0 -259
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Popover",
|
|
4
|
-
"description": "
|
|
5
|
-
"category": "
|
|
6
|
-
"tags": [
|
|
7
|
-
"popover",
|
|
8
|
-
"overlay",
|
|
9
|
-
"dropdown",
|
|
10
|
-
"floating",
|
|
11
|
-
"contextual"
|
|
12
|
-
],
|
|
4
|
+
"description": "Anchors interactive content to a trigger without blocking the page.",
|
|
5
|
+
"category": "overlays",
|
|
6
|
+
"tags": ["popover", "overlay", "dropdown", "floating", "contextual"],
|
|
13
7
|
"status": "stable",
|
|
14
8
|
"sourcePath": "src/components/Popover/index.tsx",
|
|
15
9
|
"exportName": "Popover",
|
|
@@ -51,24 +45,23 @@
|
|
|
51
45
|
},
|
|
52
46
|
"usage": {
|
|
53
47
|
"when": [
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"Filter panels",
|
|
57
|
-
"
|
|
58
|
-
"Content that needs more space than a tooltip"
|
|
48
|
+
"Editing a value in place",
|
|
49
|
+
"Previews richer than a line of text",
|
|
50
|
+
"Filter and picker panels",
|
|
51
|
+
"Content that outgrows a tooltip"
|
|
59
52
|
],
|
|
60
53
|
"whenNot": [
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
54
|
+
"A short hint (use Tooltip)",
|
|
55
|
+
"A list of actions (use Menu)",
|
|
56
|
+
"Anything that must block the page (use Dialog)",
|
|
57
|
+
"Feedback the user does not act on (use Toast or Alert)"
|
|
65
58
|
],
|
|
66
59
|
"guidelines": [
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
60
|
+
"One job per panel",
|
|
61
|
+
"Always give the user a visible way out",
|
|
62
|
+
"Pick a side that does not cover what the user just clicked",
|
|
63
|
+
"Add the arrow when the trigger is not obvious",
|
|
64
|
+
"asChild on Trigger and Close needs a single element child"
|
|
72
65
|
],
|
|
73
66
|
"accessibility": [
|
|
74
67
|
"Focus is moved to popover content on open",
|
|
@@ -79,27 +72,27 @@
|
|
|
79
72
|
"examples": [
|
|
80
73
|
{
|
|
81
74
|
"name": "Default",
|
|
82
|
-
"description": "
|
|
75
|
+
"description": "Title, body, and a close control.",
|
|
83
76
|
"code": "<Popover>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Open Popover</Button>\n </Popover.Trigger>\n <Popover.Content>\n <Popover.Close />\n <Popover.Title>Popover Title</Popover.Title>\n <Popover.Description>\n This is a popover with some content. It can contain text, forms, or other elements.\n </Popover.Description>\n </Popover.Content>\n</Popover>"
|
|
84
77
|
},
|
|
85
78
|
{
|
|
86
79
|
"name": "With Form",
|
|
87
|
-
"description": "
|
|
80
|
+
"description": "Enough room to edit a value in place.",
|
|
88
81
|
"code": "<Popover>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Edit Name</Button>\n </Popover.Trigger>\n <Popover.Content size=\"sm\">\n <Popover.Close />\n <Popover.Title>Edit Name</Popover.Title>\n <Popover.Body>\n <Input label=\"Display Name\" placeholder=\"Enter name\" />\n </Popover.Body>\n <Popover.Footer>\n <Popover.Close asChild>\n <Button variant=\"secondary\" size=\"sm\">Cancel</Button>\n </Popover.Close>\n <Button variant=\"primary\" size=\"sm\">Save</Button>\n </Popover.Footer>\n </Popover.Content>\n</Popover>"
|
|
89
82
|
},
|
|
90
83
|
{
|
|
91
84
|
"name": "With Arrow",
|
|
92
|
-
"description": "
|
|
85
|
+
"description": "The arrow ties the panel back to its trigger.",
|
|
93
86
|
"code": "<Popover>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Info</Button>\n </Popover.Trigger>\n <Popover.Content arrow>\n <Popover.Title>Quick Tip</Popover.Title>\n <Popover.Description>\n This popover has an arrow pointing to its trigger element.\n </Popover.Description>\n </Popover.Content>\n</Popover>"
|
|
94
87
|
},
|
|
95
88
|
{
|
|
96
89
|
"name": "Positions",
|
|
97
|
-
"description": "
|
|
90
|
+
"description": "Flips to the opposite side when space runs out.",
|
|
98
91
|
"code": "<div style={{ display: 'flex', gap: '16px', padding: '60px' }}>\n <Popover>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Top</Button>\n </Popover.Trigger>\n <Popover.Content side=\"top\" size=\"sm\">\n <Popover.Description>Popover on top</Popover.Description>\n </Popover.Content>\n </Popover>\n <Popover>\n <Popover.Trigger asChild>\n <Button variant=\"secondary\">Bottom</Button>\n </Popover.Trigger>\n <Popover.Content side=\"bottom\" size=\"sm\">\n <Popover.Description>Popover on bottom</Popover.Description>\n </Popover.Content>\n </Popover>\n</div>"
|
|
99
92
|
},
|
|
100
93
|
{
|
|
101
94
|
"name": "Link Trigger",
|
|
102
|
-
"description": "
|
|
95
|
+
"description": "asChild lets a link open it.",
|
|
103
96
|
"code": "<Popover>\n <Popover.Trigger asChild>\n <a href=\"#popover-help\">Open help</a>\n </Popover.Trigger>\n <Popover.Content size=\"sm\">\n <Popover.Description>Popover trigger can be an anchor when using asChild.</Popover.Description>\n </Popover.Content>\n</Popover>"
|
|
104
97
|
}
|
|
105
98
|
],
|
|
@@ -128,27 +121,12 @@
|
|
|
128
121
|
"Popover.Trigger / Popover.Close asChild support non-button children",
|
|
129
122
|
"Popover.Content side: top|bottom|left|right - position"
|
|
130
123
|
],
|
|
131
|
-
"a11yRules": [
|
|
132
|
-
"A11Y_POPOVER_FOCUS",
|
|
133
|
-
"A11Y_POPOVER_ESCAPE",
|
|
134
|
-
"A11Y_TARGET_SIZE_MIN"
|
|
135
|
-
]
|
|
124
|
+
"a11yRules": ["A11Y_POPOVER_FOCUS", "A11Y_POPOVER_ESCAPE", "A11Y_TARGET_SIZE_MIN"]
|
|
136
125
|
},
|
|
137
126
|
"ai": {
|
|
138
127
|
"compositionPattern": "compound",
|
|
139
|
-
"subComponents": [
|
|
140
|
-
|
|
141
|
-
"Content",
|
|
142
|
-
"Close",
|
|
143
|
-
"Title",
|
|
144
|
-
"Description",
|
|
145
|
-
"Body",
|
|
146
|
-
"Footer"
|
|
147
|
-
],
|
|
148
|
-
"requiredChildren": [
|
|
149
|
-
"Trigger",
|
|
150
|
-
"Content"
|
|
151
|
-
],
|
|
128
|
+
"subComponents": ["Trigger", "Content", "Close", "Title", "Description", "Body", "Footer"],
|
|
129
|
+
"requiredChildren": ["Trigger", "Content"],
|
|
152
130
|
"commonPatterns": [
|
|
153
131
|
"<Popover><Popover.Trigger asChild><Button>Open</Button></Popover.Trigger><Popover.Content><Popover.Close /><Popover.Title>{title}</Popover.Title><Popover.Description>{description}</Popover.Description></Popover.Content></Popover>",
|
|
154
132
|
"<Popover><Popover.Trigger asChild><a href=\"#help\">Open help</a></Popover.Trigger><Popover.Content>...</Popover.Content></Popover>"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
position: relative;
|
|
15
15
|
opacity: 0;
|
|
16
|
-
transform: scale(0.95) translateY(
|
|
16
|
+
transform: scale(0.95) translateY(calc(-1 * var(--fui-anim-offset-sm, #{$fui-anim-offset-sm})));
|
|
17
17
|
transform-origin: var(--transform-origin);
|
|
18
18
|
transition:
|
|
19
19
|
opacity var(--fui-transition-fast, $fui-transition-fast),
|
|
@@ -26,21 +26,22 @@
|
|
|
26
26
|
|
|
27
27
|
&[data-starting-style] {
|
|
28
28
|
opacity: 0;
|
|
29
|
-
transform: scale(0.95) translateY(
|
|
29
|
+
transform: scale(0.95) translateY(calc(-1 * var(--fui-anim-offset-sm, #{$fui-anim-offset-sm})));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&[data-ending-style] {
|
|
33
33
|
opacity: 0;
|
|
34
|
-
transform: scale(0.95) translateY($fui-anim-offset-sm);
|
|
34
|
+
transform: scale(0.95) translateY(var(--fui-anim-offset-sm, #{$fui-anim-offset-sm}));
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
&[data-side="top"] {
|
|
38
38
|
&[data-starting-style] {
|
|
39
|
-
transform: scale(0.95) translateY($fui-anim-offset-sm);
|
|
39
|
+
transform: scale(0.95) translateY(var(--fui-anim-offset-sm, #{$fui-anim-offset-sm}));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
&[data-ending-style] {
|
|
43
|
-
transform: scale(0.95)
|
|
43
|
+
transform: scale(0.95)
|
|
44
|
+
translateY(calc(-1 * var(--fui-anim-offset-sm, #{$fui-anim-offset-sm})));
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Progress",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Shows how far along a task is, as a bar or a ring.",
|
|
5
5
|
"category": "feedback",
|
|
6
6
|
"tags": ["progress", "loading", "indicator", "percentage", "status"],
|
|
7
7
|
"status": "stable",
|
|
@@ -70,56 +70,60 @@
|
|
|
70
70
|
},
|
|
71
71
|
"usage": {
|
|
72
72
|
"when": [
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
73
|
+
"Upload and download progress",
|
|
74
|
+
"Percentage of a task finished",
|
|
75
|
+
"How much of a form is filled in",
|
|
76
|
+
"Waits where you know the duration"
|
|
77
77
|
],
|
|
78
78
|
"whenNot": [
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"Status
|
|
79
|
+
"You cannot say how long — use Loading",
|
|
80
|
+
"Discrete steps — use a stepper",
|
|
81
|
+
"Status with no number — use Badge"
|
|
82
82
|
],
|
|
83
83
|
"guidelines": [
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"Determinate values are clamped to the min/max range for display"
|
|
84
|
+
"Pass a value when you know the percentage; pass null when you do not",
|
|
85
|
+
"Add a label whenever the bar alone leaves the purpose unclear",
|
|
86
|
+
"success, warning, and danger carry state, not decoration",
|
|
87
|
+
"variant=\"neutral\" with role=\"meter\" for a magnitude where full is not success",
|
|
88
|
+
"Values outside min and max are clamped before display"
|
|
90
89
|
],
|
|
91
90
|
"accessibility": [
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
91
|
+
"Reports role=\"progressbar\" with aria-valuenow",
|
|
92
|
+
"role=\"meter\" is accepted for scalar readings inside a known range",
|
|
93
|
+
"The label is tied to the bar",
|
|
94
|
+
"Value changes are announced as they happen"
|
|
96
95
|
]
|
|
97
96
|
},
|
|
98
97
|
"examples": [
|
|
99
98
|
{
|
|
100
99
|
"name": "Default",
|
|
101
|
-
"description": "
|
|
102
|
-
"code": "<Progress value={60} label=\"Uploading
|
|
100
|
+
"description": "Determinate bar with its percentage spelled out.",
|
|
101
|
+
"code": "<Progress value={60} label=\"Uploading…\" showValue />"
|
|
103
102
|
},
|
|
104
103
|
{
|
|
105
104
|
"name": "Variants",
|
|
106
|
-
"description": "
|
|
107
|
-
"code": "
|
|
105
|
+
"description": "Colour carries state: normal, done, tight, critical.",
|
|
106
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"column\" gap=\"md\">\n <Progress value={75} variant=\"default\" label=\"Processing\" showValue />\n <Progress value={100} variant=\"success\" label=\"Complete\" showValue />\n <Progress value={80} variant=\"warning\" label=\"Almost full\" showValue />\n <Progress value={95} variant=\"danger\" label=\"Storage critical\" showValue />\n</Stack>"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "Meter",
|
|
110
|
+
"description": "A reading where hitting the top is not a win.",
|
|
111
|
+
"code": "<Progress\n value={42}\n variant=\"neutral\"\n role=\"meter\"\n label=\"Seats used\"\n showValue\n/>"
|
|
108
112
|
},
|
|
109
113
|
{
|
|
110
114
|
"name": "Sizes",
|
|
111
|
-
"description": "
|
|
112
|
-
"code": "
|
|
115
|
+
"description": "Thin for table rows, thick when the bar is the point.",
|
|
116
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"column\" gap=\"md\">\n <Progress value={50} size=\"sm\" label=\"Small\" />\n <Progress value={50} size=\"md\" label=\"Medium\" />\n <Progress value={50} size=\"lg\" label=\"Large\" />\n</Stack>"
|
|
113
117
|
},
|
|
114
118
|
{
|
|
115
119
|
"name": "Indeterminate",
|
|
116
|
-
"description": "
|
|
117
|
-
"code": "<Progress value={null} label=\"Loading
|
|
120
|
+
"description": "value={null} sweeps instead of filling.",
|
|
121
|
+
"code": "<Progress value={null} label=\"Loading…\" />"
|
|
118
122
|
},
|
|
119
123
|
{
|
|
120
124
|
"name": "Circular",
|
|
121
|
-
"description": "
|
|
122
|
-
"code": "
|
|
125
|
+
"description": "Same value in a ring, for tiles and compact chrome.",
|
|
126
|
+
"code": "import { CircularProgress } from '@/components/Progress';\nimport { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"lg\" align=\"center\">\n <CircularProgress value={25} size=\"sm\" />\n <CircularProgress value={50} size=\"md\" showValue />\n <CircularProgress value={75} size=\"lg\" showValue variant=\"success\" />\n <CircularProgress value={null} size=\"md\" />\n</Stack>"
|
|
123
127
|
}
|
|
124
128
|
],
|
|
125
129
|
"relations": [
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
// Indeterminate animation
|
|
91
91
|
.indicatorIndeterminate {
|
|
92
92
|
inline-size: 50%;
|
|
93
|
-
animation: indeterminate
|
|
93
|
+
animation: indeterminate var(--fui-duration-pulse, $fui-duration-pulse) ease-in-out infinite;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
@keyframes indeterminate {
|
|
@@ -147,7 +147,8 @@
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
.circularIndicatorIndeterminate {
|
|
150
|
-
animation: circularIndeterminate
|
|
150
|
+
animation: circularIndeterminate var(--fui-duration-pulse, $fui-duration-pulse) ease-in-out
|
|
151
|
+
infinite;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
@keyframes circularIndeterminate {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Prompt",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Collects multi-line input for AI and chat interfaces.",
|
|
5
5
|
"category": "ai",
|
|
6
|
-
"tags": [
|
|
7
|
-
"prompt",
|
|
8
|
-
"chat",
|
|
9
|
-
"ai",
|
|
10
|
-
"input",
|
|
11
|
-
"textarea",
|
|
12
|
-
"form"
|
|
13
|
-
],
|
|
6
|
+
"tags": ["prompt", "chat", "ai", "input", "textarea", "form"],
|
|
14
7
|
"status": "stable",
|
|
15
8
|
"sourcePath": "src/components/Prompt/index.tsx",
|
|
16
9
|
"exportName": "Prompt",
|
|
@@ -106,11 +99,7 @@
|
|
|
106
99
|
"description": "Visual/positioning variant",
|
|
107
100
|
"default": "default",
|
|
108
101
|
"required": false,
|
|
109
|
-
"values": [
|
|
110
|
-
"default",
|
|
111
|
-
"fixed",
|
|
112
|
-
"sticky"
|
|
113
|
-
]
|
|
102
|
+
"values": ["default", "fixed", "sticky"]
|
|
114
103
|
},
|
|
115
104
|
"onFiles": {
|
|
116
105
|
"type": "function",
|
|
@@ -127,37 +116,30 @@
|
|
|
127
116
|
"description": "How the card is divided up. \"panel\" keeps the toolbar as a filled footer under a rule; \"seamless\" makes the whole card one writing surface with the controls floating on it.",
|
|
128
117
|
"default": "panel",
|
|
129
118
|
"required": false,
|
|
130
|
-
"values": [
|
|
131
|
-
"panel",
|
|
132
|
-
"seamless"
|
|
133
|
-
]
|
|
119
|
+
"values": ["panel", "seamless"]
|
|
134
120
|
}
|
|
135
121
|
},
|
|
136
122
|
"usage": {
|
|
137
123
|
"when": [
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
124
|
+
"Chat and AI assistant interfaces",
|
|
125
|
+
"Multi-line input with a submit action",
|
|
126
|
+
"Toolbars carrying attachments or a model picker"
|
|
141
127
|
],
|
|
142
128
|
"whenNot": [
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"Search-only
|
|
129
|
+
"Single-line text (use Input)",
|
|
130
|
+
"Multi-line with no toolbar (use Textarea)",
|
|
131
|
+
"Search-only fields (use Input with the search variant)"
|
|
146
132
|
],
|
|
147
133
|
"guidelines": [
|
|
148
|
-
"Always
|
|
149
|
-
"
|
|
150
|
-
"Prompt.Textarea forwards native textarea props
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"Prompt.
|
|
157
|
-
"Use Prompt.ModeButton for a setting you toggle and Prompt.Select for one you pick from a list",
|
|
158
|
-
"Wire onFiles once: the attach button, pasting a screenshot and dropping on the card all go through it",
|
|
159
|
-
"Render Prompt.Attachments above Prompt.Textarea — attachments are part of the message, not a setting on it",
|
|
160
|
-
"Consider showing usage/token limits for AI contexts"
|
|
134
|
+
"Always pass an onSubmit handler",
|
|
135
|
+
"Set loading while the request is in flight to block duplicate sends",
|
|
136
|
+
"Prompt.Textarea forwards native textarea props and composes your own handlers",
|
|
137
|
+
"appearance=\"seamless\" floats the controls on the writing surface instead of a footer",
|
|
138
|
+
"Seamless secondary controls stay transparent; only Prompt.Submit keeps a filled shape",
|
|
139
|
+
"Prompt.Submit uses a neutral inverse surface, never semantic brand color",
|
|
140
|
+
"Prompt.ModeButton toggles a setting; Prompt.Select picks one from a list",
|
|
141
|
+
"Wire onFiles once — the attach button, paste, and drop all route through it",
|
|
142
|
+
"Render Prompt.Attachments above Prompt.Textarea; they are part of the message"
|
|
161
143
|
],
|
|
162
144
|
"accessibility": [
|
|
163
145
|
"Enter submits, Shift+Enter for newline",
|
|
@@ -168,32 +150,37 @@
|
|
|
168
150
|
"examples": [
|
|
169
151
|
{
|
|
170
152
|
"name": "Basic",
|
|
171
|
-
"description": "
|
|
153
|
+
"description": "A textarea and a submit button, nothing else.",
|
|
172
154
|
"code": "<Prompt onSubmit={(value) => console.log(value)}>\n <Prompt.Textarea />\n <Prompt.Toolbar>\n <Prompt.Actions />\n <Prompt.Info>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
173
155
|
},
|
|
174
156
|
{
|
|
175
157
|
"name": "With Actions",
|
|
176
|
-
"description": "
|
|
158
|
+
"description": "Attach and mode controls sit to the left of submit.",
|
|
177
159
|
"code": "<Prompt onSubmit={(value) => console.log(value)}>\n <Prompt.Textarea />\n <Prompt.Toolbar>\n <Prompt.Actions>\n <Prompt.ActionButton aria-label=\"Add attachment\">\n +\n </Prompt.ActionButton>\n <Prompt.ModeButton>Auto</Prompt.ModeButton>\n </Prompt.Actions>\n <Prompt.Info>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
178
160
|
},
|
|
179
161
|
{
|
|
180
162
|
"name": "With Usage",
|
|
181
|
-
"description": "
|
|
163
|
+
"description": "A quota readout sits beside the submit button.",
|
|
182
164
|
"code": "<Prompt onSubmit={(value) => console.log(value)}>\n <Prompt.Textarea />\n <Prompt.Toolbar>\n <Prompt.Actions>\n <Prompt.ActionButton aria-label=\"Add attachment\">\n +\n </Prompt.ActionButton>\n <Prompt.ModeButton active>Auto</Prompt.ModeButton>\n </Prompt.Actions>\n <Prompt.Info>\n <Prompt.Usage>52% used</Prompt.Usage>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
183
165
|
},
|
|
184
166
|
{
|
|
185
167
|
"name": "Agent Composer",
|
|
186
|
-
"description": "
|
|
168
|
+
"description": "Controls float on the writing surface instead of a footer.",
|
|
187
169
|
"code": "<Prompt\n appearance=\"seamless\"\n submitOnEnter={false}\n minRows={3}\n onSubmit={(value) => console.log(value)}\n>\n <Prompt.Textarea placeholder=\"What should be true when this is done?\" />\n <Prompt.Toolbar>\n <Prompt.Actions>\n <Prompt.Select\n aria-label=\"Model\"\n defaultValue=\"claude-opus-4-8\"\n options={[{ value: 'claude-opus-4-8', label: 'Opus 4.8' }, { value: 'claude-sonnet-5', label: 'Sonnet 5' }]}\n />\n <Prompt.ModeButton>Plan</Prompt.ModeButton>\n </Prompt.Actions>\n <Prompt.Info>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
188
170
|
},
|
|
171
|
+
{
|
|
172
|
+
"name": "With Attachments",
|
|
173
|
+
"description": "Staged files list above the text they belong to.",
|
|
174
|
+
"code": "<Prompt onSubmit={(value) => console.log(value)}>\n <Prompt.Attachments\n items={[\n { id: '1', name: 'findings-export.csv', size: 20480 },\n { id: '2', name: 'dashboard.png', size: 153600 },\n ]}\n onRemove={(id) => console.log(id)}\n />\n <Prompt.Textarea />\n <Prompt.Toolbar>\n <Prompt.Actions>\n <Prompt.ActionButton aria-label=\"Add attachment\">\n +\n </Prompt.ActionButton>\n </Prompt.Actions>\n <Prompt.Info>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
175
|
+
},
|
|
189
176
|
{
|
|
190
177
|
"name": "Loading State",
|
|
191
|
-
"description": "
|
|
178
|
+
"description": "Input locks and submit spins while the request runs.",
|
|
192
179
|
"code": "<Prompt\n onSubmit={(value) => console.log(value)}\n loading\n defaultValue=\"Tell me about the weather...\"\n>\n <Prompt.Textarea />\n <Prompt.Toolbar>\n <Prompt.Actions>\n <Prompt.ActionButton aria-label=\"Add attachment\">\n +\n </Prompt.ActionButton>\n <Prompt.ModeButton>Auto</Prompt.ModeButton>\n </Prompt.Actions>\n <Prompt.Info>\n <Prompt.Usage>52% used</Prompt.Usage>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
193
180
|
},
|
|
194
181
|
{
|
|
195
182
|
"name": "Disabled",
|
|
196
|
-
"description": "
|
|
183
|
+
"description": "Everything dims and stops responding to input.",
|
|
197
184
|
"code": "<Prompt onSubmit={(value) => console.log(value)} disabled>\n <Prompt.Textarea />\n <Prompt.Toolbar>\n <Prompt.Actions>\n <Prompt.ActionButton aria-label=\"Add attachment\">\n +\n </Prompt.ActionButton>\n </Prompt.Actions>\n <Prompt.Info>\n <Prompt.Submit />\n </Prompt.Info>\n </Prompt.Toolbar>\n</Prompt>"
|
|
198
185
|
}
|
|
199
186
|
],
|
|
@@ -220,10 +207,7 @@
|
|
|
220
207
|
"submitOnEnter: boolean - Enter key behavior (default: true)",
|
|
221
208
|
"Prompt.Textarea accepts native textarea props and optional aria-label override"
|
|
222
209
|
],
|
|
223
|
-
"a11yRules": [
|
|
224
|
-
"A11Y_TEXTAREA_LABEL",
|
|
225
|
-
"A11Y_BUTTON_LABEL"
|
|
226
|
-
]
|
|
210
|
+
"a11yRules": ["A11Y_TEXTAREA_LABEL", "A11Y_BUTTON_LABEL"]
|
|
227
211
|
},
|
|
228
212
|
"ai": {
|
|
229
213
|
"compositionPattern": "compound",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
// Gradient layer (behind everything)
|
|
31
31
|
&::before {
|
|
32
|
-
inset: -1px;
|
|
32
|
+
inset: calc(-1 * var(--fui-stroke-hairline, 1px));
|
|
33
33
|
z-index: 0;
|
|
34
34
|
background: conic-gradient(
|
|
35
35
|
from var(--beam-angle, 0deg) at 50% 50%,
|
|
@@ -42,14 +42,16 @@
|
|
|
42
42
|
transparent 75%,
|
|
43
43
|
transparent 100%
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
// Ambient loop: twice the shimmer beat, kept on the token scale.
|
|
46
|
+
animation: beam-rotate calc(var(--fui-duration-shimmer, #{$fui-duration-shimmer}) * 2) linear
|
|
47
|
+
infinite;
|
|
46
48
|
opacity: 0.6;
|
|
47
49
|
transition: opacity var(--fui-transition-normal, $fui-transition-normal);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
// Mask layer — covers the interior, leaving only the 1px border visible
|
|
51
53
|
&::after {
|
|
52
|
-
inset: 1px;
|
|
54
|
+
inset: var(--fui-stroke-hairline, 1px);
|
|
53
55
|
z-index: 1;
|
|
54
56
|
background: var(--fui-bg-elevated, $fui-bg-elevated);
|
|
55
57
|
}
|
|
@@ -299,6 +301,8 @@
|
|
|
299
301
|
@include button-reset;
|
|
300
302
|
@include typography.role("body-compact");
|
|
301
303
|
|
|
304
|
+
// button-reset marks pressables select-none; typed text must stay selectable.
|
|
305
|
+
user-select: text;
|
|
302
306
|
display: block;
|
|
303
307
|
width: 100%;
|
|
304
308
|
min-height: var(--fui-input-height, $fui-input-height);
|
|
@@ -361,10 +365,14 @@
|
|
|
361
365
|
&:hover {
|
|
362
366
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
363
367
|
}
|
|
368
|
+
|
|
369
|
+
&:focus-visible {
|
|
370
|
+
@include focus-ring;
|
|
371
|
+
}
|
|
364
372
|
}
|
|
365
373
|
|
|
366
374
|
.tabButtonActive {
|
|
367
|
-
background-color: var(--fui-bg
|
|
375
|
+
background-color: var(--fui-control-selected-bg, $fui-bg-active);
|
|
368
376
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
369
377
|
}
|
|
370
378
|
|
|
@@ -454,7 +462,7 @@
|
|
|
454
462
|
|
|
455
463
|
.modeButtonActive {
|
|
456
464
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
457
|
-
background-color: var(--fui-bg
|
|
465
|
+
background-color: var(--fui-control-selected-bg, $fui-bg-active);
|
|
458
466
|
}
|
|
459
467
|
|
|
460
468
|
// ============================================
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "RadioGroup",
|
|
4
|
-
"description": "
|
|
5
|
-
"category": "
|
|
4
|
+
"description": "Selects one option from a mutually exclusive set.",
|
|
5
|
+
"category": "inputs",
|
|
6
6
|
"tags": ["form", "radio", "selection", "options"],
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"sourcePath": "src/components/RadioGroup/index.tsx",
|
|
@@ -115,63 +115,62 @@
|
|
|
115
115
|
},
|
|
116
116
|
"usage": {
|
|
117
117
|
"when": [
|
|
118
|
-
"
|
|
119
|
-
"Options
|
|
120
|
-
"
|
|
121
|
-
"2-5 options available"
|
|
118
|
+
"Exactly one answer out of two to five",
|
|
119
|
+
"Options rule each other out",
|
|
120
|
+
"Every option should be visible without opening anything"
|
|
122
121
|
],
|
|
123
122
|
"whenNot": [
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"Options need
|
|
123
|
+
"Several answers allowed (use a Checkbox group)",
|
|
124
|
+
"Long lists (use Select)",
|
|
125
|
+
"A single on/off (use Switch)",
|
|
126
|
+
"Options need searching (use Combobox)"
|
|
128
127
|
],
|
|
129
128
|
"guidelines": [
|
|
130
|
-
"
|
|
131
|
-
"Order options
|
|
132
|
-
"Keep
|
|
133
|
-
"
|
|
129
|
+
"Pre-select a sensible default whenever one exists",
|
|
130
|
+
"Order options predictably: alphabetical, by frequency, or by cost",
|
|
131
|
+
"Keep labels short",
|
|
132
|
+
"Put the trade-off in each item's helperText"
|
|
134
133
|
],
|
|
135
134
|
"accessibility": [
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
135
|
+
"The group carries its own label",
|
|
136
|
+
"Arrow keys move between options",
|
|
137
|
+
"The selected option reads as checked"
|
|
139
138
|
]
|
|
140
139
|
},
|
|
141
140
|
"examples": [
|
|
142
141
|
{
|
|
143
142
|
"name": "Default",
|
|
144
|
-
"description": "
|
|
143
|
+
"description": "Three options stacked, the first already chosen.",
|
|
145
144
|
"code": "<RadioGroup defaultValue=\"option1\" label=\"Select an option\">\n <RadioGroup.Item value=\"option1\" label=\"Option 1\" />\n <RadioGroup.Item value=\"option2\" label=\"Option 2\" />\n <RadioGroup.Item value=\"option3\" label=\"Option 3\" />\n</RadioGroup>"
|
|
146
145
|
},
|
|
147
146
|
{
|
|
148
147
|
"name": "With Helper Text",
|
|
149
|
-
"description": "
|
|
148
|
+
"description": "Each option carries the trade-off under its label.",
|
|
150
149
|
"code": "<RadioGroup defaultValue=\"standard\" label=\"Shipping Method\">\n <RadioGroup.Item\n value=\"standard\"\n label=\"Standard\"\n helperText=\"5-7 business days\"\n />\n <RadioGroup.Item\n value=\"express\"\n label=\"Express\"\n helperText=\"2-3 business days\"\n />\n <RadioGroup.Item\n value=\"overnight\"\n label=\"Overnight\"\n helperText=\"Next business day\"\n />\n</RadioGroup>"
|
|
151
150
|
},
|
|
152
151
|
{
|
|
153
152
|
"name": "Horizontal",
|
|
154
|
-
"description": "
|
|
153
|
+
"description": "One row — good for short labels like sizes.",
|
|
155
154
|
"code": "<RadioGroup orientation=\"horizontal\" defaultValue=\"small\" label=\"Size\">\n <RadioGroup.Item value=\"small\" label=\"S\" />\n <RadioGroup.Item value=\"medium\" label=\"M\" />\n <RadioGroup.Item value=\"large\" label=\"L\" />\n <RadioGroup.Item value=\"xlarge\" label=\"XL\" />\n</RadioGroup>"
|
|
156
155
|
},
|
|
157
156
|
{
|
|
158
157
|
"name": "With Group Helper Text",
|
|
159
|
-
"description": "
|
|
158
|
+
"description": "One note under the whole group instead of per option.",
|
|
160
159
|
"code": "<RadioGroup defaultValue=\"standard\" label=\"Plan\" helperText=\"You can change your plan at any time\">\n <RadioGroup.Item value=\"free\" label=\"Free\" />\n <RadioGroup.Item value=\"standard\" label=\"Standard\" />\n <RadioGroup.Item value=\"pro\" label=\"Pro\" />\n</RadioGroup>"
|
|
161
160
|
},
|
|
162
161
|
{
|
|
163
162
|
"name": "With Error",
|
|
164
|
-
"description": "
|
|
163
|
+
"description": "Passing a string to error tints the group and prints the reason.",
|
|
165
164
|
"code": "<RadioGroup label=\"Required selection\" error=\"Please select an option\">\n <RadioGroup.Item value=\"a\" label=\"Option A\" />\n <RadioGroup.Item value=\"b\" label=\"Option B\" />\n</RadioGroup>"
|
|
166
165
|
},
|
|
167
166
|
{
|
|
168
167
|
"name": "Disabled",
|
|
169
|
-
"description": "
|
|
168
|
+
"description": "The choice stays visible but nothing can change it.",
|
|
170
169
|
"code": "<RadioGroup disabled defaultValue=\"locked\" label=\"Locked selection\">\n <RadioGroup.Item value=\"locked\" label=\"This is locked\" />\n <RadioGroup.Item value=\"other\" label=\"Cannot select\" />\n</RadioGroup>"
|
|
171
170
|
},
|
|
172
171
|
{
|
|
173
172
|
"name": "Styling Targets",
|
|
174
|
-
"description": "
|
|
173
|
+
"description": "Named class hooks for the wrapper, the group, and each item.",
|
|
175
174
|
"code": "<RadioGroup\n defaultValue=\"a\"\n label=\"Display mode\"\n wrapperClassName=\"demo-radio-wrapper\"\n groupClassName=\"demo-radio-group\"\n>\n <RadioGroup.Item value=\"a\" label=\"Compact\" controlClassName=\"demo-radio-control\" contentClassName=\"demo-radio-content\" />\n <RadioGroup.Item value=\"b\" label=\"Comfortable\" />\n</RadioGroup>"
|
|
176
175
|
}
|
|
177
176
|
],
|