@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,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Icon",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Sizes and colors any icon so it lines up with the text beside it.",
|
|
5
5
|
"category": "display",
|
|
6
|
-
"tags": [
|
|
7
|
-
"icon",
|
|
8
|
-
"visual",
|
|
9
|
-
"symbol",
|
|
10
|
-
"graphic"
|
|
11
|
-
],
|
|
6
|
+
"tags": ["icon", "visual", "symbol", "graphic"],
|
|
12
7
|
"status": "stable",
|
|
13
8
|
"sourcePath": "src/components/Icon/index.tsx",
|
|
14
9
|
"exportName": "Icon",
|
|
@@ -37,27 +32,14 @@
|
|
|
37
32
|
"description": "Icon size",
|
|
38
33
|
"default": "md",
|
|
39
34
|
"required": false,
|
|
40
|
-
"values": [
|
|
41
|
-
"xs",
|
|
42
|
-
"sm",
|
|
43
|
-
"md",
|
|
44
|
-
"lg",
|
|
45
|
-
"xl"
|
|
46
|
-
]
|
|
35
|
+
"values": ["xs", "sm", "md", "lg", "xl"]
|
|
47
36
|
},
|
|
48
37
|
"weight": {
|
|
49
38
|
"type": "string",
|
|
50
39
|
"description": "Optional icon style/weight hint (forwarded when supported by the icon component)",
|
|
51
40
|
"default": "regular",
|
|
52
41
|
"required": false,
|
|
53
|
-
"values": [
|
|
54
|
-
"thin",
|
|
55
|
-
"light",
|
|
56
|
-
"regular",
|
|
57
|
-
"bold",
|
|
58
|
-
"fill",
|
|
59
|
-
"duotone"
|
|
60
|
-
]
|
|
42
|
+
"values": ["thin", "light", "regular", "bold", "fill", "duotone"]
|
|
61
43
|
},
|
|
62
44
|
"variant": {
|
|
63
45
|
"type": "enum",
|
|
@@ -79,15 +61,7 @@
|
|
|
79
61
|
"type": "enum",
|
|
80
62
|
"description": "Deprecated alias for variant",
|
|
81
63
|
"required": false,
|
|
82
|
-
"values": [
|
|
83
|
-
"primary",
|
|
84
|
-
"secondary",
|
|
85
|
-
"tertiary",
|
|
86
|
-
"accent",
|
|
87
|
-
"success",
|
|
88
|
-
"warning",
|
|
89
|
-
"error"
|
|
90
|
-
]
|
|
64
|
+
"values": ["primary", "secondary", "tertiary", "accent", "success", "warning", "error"]
|
|
91
65
|
},
|
|
92
66
|
"iconProps": {
|
|
93
67
|
"type": "object",
|
|
@@ -97,55 +71,46 @@
|
|
|
97
71
|
},
|
|
98
72
|
"usage": {
|
|
99
73
|
"when": [
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"Adding visual hierarchy to feature lists",
|
|
103
|
-
"Decorating cards or stats with relevant symbols"
|
|
104
|
-
],
|
|
105
|
-
"whenNot": [
|
|
106
|
-
"Large decorative illustrations (use Image or custom SVG)",
|
|
107
|
-
"Logo display (use dedicated Logo component)",
|
|
108
|
-
"Complex graphics with multiple colors",
|
|
109
|
-
"Animated icons (use custom implementation)"
|
|
74
|
+
"A symbol sits beside text, inside a button, or leads a list item",
|
|
75
|
+
"State needs a glanceable marker"
|
|
110
76
|
],
|
|
77
|
+
"whenNot": ["Artwork or illustration (use Image)", "Multi-color or animated graphics"],
|
|
111
78
|
"guidelines": [
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"Match
|
|
115
|
-
"
|
|
116
|
-
"Use iconProps for package-specific icon options not exposed directly on the wrapper"
|
|
79
|
+
"Reserve success, warning, and error colors for real state",
|
|
80
|
+
"Hold one size per context",
|
|
81
|
+
"Match weight to the text weight beside it",
|
|
82
|
+
"iconProps reaches options the wrapper does not expose"
|
|
117
83
|
],
|
|
118
84
|
"accessibility": [
|
|
119
|
-
"Icons are
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"Consider using VisuallyHidden for icon-only buttons"
|
|
85
|
+
"Icons ship aria-hidden — they are decoration until you label them",
|
|
86
|
+
"An icon-only button needs VisuallyHidden text",
|
|
87
|
+
"Color alone never carries the message"
|
|
123
88
|
]
|
|
124
89
|
},
|
|
125
90
|
"examples": [
|
|
126
91
|
{
|
|
127
92
|
"name": "Default",
|
|
128
|
-
"description": "
|
|
93
|
+
"description": "Inherits the size and color of its surroundings.",
|
|
129
94
|
"code": "<Icon icon={Heart} />"
|
|
130
95
|
},
|
|
131
96
|
{
|
|
132
97
|
"name": "Sizes",
|
|
133
|
-
"description": "
|
|
98
|
+
"description": "Steps tuned to the type scale, so icons never float off the baseline.",
|
|
134
99
|
"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>"
|
|
135
100
|
},
|
|
136
101
|
{
|
|
137
102
|
"name": "Semantic Colors",
|
|
138
|
-
"description": "
|
|
103
|
+
"description": "Color states carry meaning — never use them for decoration.",
|
|
139
104
|
"code": "<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n <Icon icon={Check} variant=\"success\" />\n <Icon icon={Warning} variant=\"warning\" />\n <Icon icon={Warning} variant=\"error\" />\n <Icon icon={Info} variant=\"accent\" />\n</div>"
|
|
140
105
|
},
|
|
141
106
|
{
|
|
142
107
|
"name": "Weights",
|
|
143
|
-
"description": "
|
|
108
|
+
"description": "Match the stroke to the text weight next to it.",
|
|
144
109
|
"code": "<div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n <Icon icon={Heart} weight=\"thin\" />\n <Icon icon={Heart} weight=\"light\" />\n <Icon icon={Heart} weight=\"regular\" />\n <Icon icon={Heart} weight=\"bold\" />\n <Icon icon={Heart} weight=\"fill\" />\n <Icon icon={Heart} weight=\"duotone\" />\n</div>"
|
|
145
110
|
},
|
|
146
111
|
{
|
|
147
112
|
"name": "Advanced Icon Props",
|
|
148
|
-
"description": "
|
|
113
|
+
"description": "iconProps passes anything the underlying icon package supports.",
|
|
149
114
|
"code": "<Icon icon={Heart} iconProps={{ mirrored: true }} />"
|
|
150
115
|
}
|
|
151
116
|
],
|
|
@@ -174,16 +139,11 @@
|
|
|
174
139
|
"variant: default|primary|secondary|tertiary|accent|success|warning|error - color",
|
|
175
140
|
"iconProps: typed from the passed icon component - advanced icon-specific props"
|
|
176
141
|
],
|
|
177
|
-
"a11yRules": [
|
|
178
|
-
"A11Y_ICON_LABEL",
|
|
179
|
-
"A11Y_COLOR_CONTRAST"
|
|
180
|
-
]
|
|
142
|
+
"a11yRules": ["A11Y_ICON_LABEL", "A11Y_COLOR_CONTRAST"]
|
|
181
143
|
},
|
|
182
144
|
"ai": {
|
|
183
145
|
"compositionPattern": "compound",
|
|
184
|
-
"subComponents": [
|
|
185
|
-
"Root"
|
|
186
|
-
]
|
|
146
|
+
"subComponents": ["Root"]
|
|
187
147
|
},
|
|
188
148
|
"provenance": {
|
|
189
149
|
"source": "migrated",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "IconButton",
|
|
4
|
-
"description": "
|
|
5
|
-
"category": "
|
|
4
|
+
"description": "Runs an action from an icon alone, for toolbars and table rows.",
|
|
5
|
+
"category": "actions",
|
|
6
6
|
"tags": ["action", "button", "icon", "toolbar", "interactive"],
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"sourcePath": "src/components/IconButton/index.tsx",
|
|
@@ -53,36 +53,52 @@
|
|
|
53
53
|
},
|
|
54
54
|
"usage": {
|
|
55
55
|
"when": [
|
|
56
|
-
"
|
|
57
|
-
"Row actions
|
|
58
|
-
"Toggle
|
|
56
|
+
"Toolbars and top bars where text buttons crowd",
|
|
57
|
+
"Row actions too narrow for a label",
|
|
58
|
+
"Toggle actions that show a pressed state"
|
|
59
59
|
],
|
|
60
60
|
"whenNot": [
|
|
61
|
-
"The action needs a visible
|
|
62
|
-
"
|
|
63
|
-
"The icon is decorative
|
|
61
|
+
"The action needs a visible label — use Button",
|
|
62
|
+
"It flips a persistent setting — use Switch",
|
|
63
|
+
"The icon is decorative — use Icon"
|
|
64
64
|
],
|
|
65
65
|
"guidelines": [
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
66
|
+
"aria-label or aria-labelledby is required, every time",
|
|
67
|
+
"ghost for ordinary toolbar actions; outlined when it needs separation",
|
|
68
|
+
"pressed only for real toggle state, not selection",
|
|
69
|
+
"Keep icon meaning obvious, or pair it with a Tooltip"
|
|
69
70
|
],
|
|
70
71
|
"accessibility": [
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
72
|
+
"Name the action, not the icon: \"Delete row\", not \"Trash\"",
|
|
73
|
+
"Pressed state is exposed via aria-pressed",
|
|
74
|
+
"Hit target stays at least 24px even at size=\"sm\""
|
|
74
75
|
]
|
|
75
76
|
},
|
|
76
77
|
"examples": [
|
|
77
78
|
{
|
|
78
79
|
"name": "Toolbar action",
|
|
79
|
-
"description": "
|
|
80
|
-
"code": "<IconButton aria-label=\"Add item\">\n <PlusIcon aria-hidden />\n</IconButton>"
|
|
80
|
+
"description": "Icon carries the action; the label lives in aria-label.",
|
|
81
|
+
"code": "import { Plus as PlusIcon } from '@phosphor-icons/react';\n\n<IconButton aria-label=\"Add item\">\n <PlusIcon aria-hidden />\n</IconButton>"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "Variants",
|
|
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=\"subtle\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"outlined\">\n <PlusIcon aria-hidden />\n </IconButton>\n</Stack>"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "Sizes",
|
|
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=\"outlined\" size=\"sm\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"outlined\" size=\"md\">\n <PlusIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Add item\" variant=\"outlined\" size=\"lg\">\n <PlusIcon aria-hidden />\n </IconButton>\n</Stack>"
|
|
81
92
|
},
|
|
82
93
|
{
|
|
83
94
|
"name": "Pressed state",
|
|
84
|
-
"description": "
|
|
85
|
-
"code": "import { PushPin as PinIcon } from '@phosphor-icons/react';\n\n<IconButton aria-label=\"Pin item\"
|
|
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=\"outlined\">\n <PinIcon aria-hidden />\n </IconButton>\n <IconButton aria-label=\"Unpin item\" variant=\"outlined\" pressed>\n <PinIcon aria-hidden />\n </IconButton>\n</Stack>"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "Disabled",
|
|
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=\"outlined\" disabled>\n <TrashIcon aria-hidden />\n</IconButton>"
|
|
86
102
|
}
|
|
87
103
|
],
|
|
88
104
|
"relations": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use
|
|
3
|
-
@use
|
|
4
|
-
@use
|
|
1
|
+
@use "../../tokens/variables" as *;
|
|
2
|
+
@use "../../tokens/mixins" as *;
|
|
3
|
+
@use "../../recipes/action";
|
|
4
|
+
@use "../../recipes/target";
|
|
5
5
|
|
|
6
6
|
.iconButton {
|
|
7
7
|
@include button-reset;
|
|
@@ -84,9 +84,8 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
// Pressed
|
|
88
|
-
// while idle so the "on" state reads clearly.
|
|
87
|
+
// Pressed is a persistent toggle selection, not the pointer-down state.
|
|
89
88
|
.pressed {
|
|
90
|
-
background-color: var(--fui-bg
|
|
89
|
+
background-color: var(--fui-control-selected-bg, $fui-bg-active);
|
|
91
90
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
92
91
|
}
|
|
@@ -4,6 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { Button as BaseButton } from "@base-ui/react/button";
|
|
5
5
|
import { useResolvedControlSize } from "../ComponentDefaults";
|
|
6
6
|
import styles from "./IconButton.module.scss";
|
|
7
|
+
import { isProductionBuild } from "../../utils/env";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Compact square button for icon-only affordances — topbar actions, row
|
|
@@ -56,7 +57,7 @@ const IconButtonRoot = React.forwardRef<HTMLButtonElement, IconButtonProps>(func
|
|
|
56
57
|
},
|
|
57
58
|
ref
|
|
58
59
|
) {
|
|
59
|
-
if (
|
|
60
|
+
if (!isProductionBuild() && !ariaLabel && !ariaLabelledBy) {
|
|
60
61
|
console.warn(
|
|
61
62
|
"[IconButton] Icon-only buttons need an accessible name. Provide `aria-label` or `aria-labelledby`."
|
|
62
63
|
);
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Image",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Renders a picture at a fixed shape with a built-in fallback when loading fails.",
|
|
5
5
|
"category": "display",
|
|
6
|
-
"tags": [
|
|
7
|
-
"image",
|
|
8
|
-
"media",
|
|
9
|
-
"photo",
|
|
10
|
-
"picture",
|
|
11
|
-
"visual"
|
|
12
|
-
],
|
|
6
|
+
"tags": ["image", "media", "photo", "picture", "visual"],
|
|
13
7
|
"status": "stable",
|
|
14
8
|
"sourcePath": "src/components/Image/index.tsx",
|
|
15
9
|
"exportName": "Image",
|
|
@@ -44,25 +38,14 @@
|
|
|
44
38
|
"description": "Aspect ratio of the image container",
|
|
45
39
|
"default": "auto",
|
|
46
40
|
"required": false,
|
|
47
|
-
"values": [
|
|
48
|
-
"1:1",
|
|
49
|
-
"4:3",
|
|
50
|
-
"16:9",
|
|
51
|
-
"21:9",
|
|
52
|
-
"auto"
|
|
53
|
-
]
|
|
41
|
+
"values": ["1:1", "4:3", "16:9", "21:9", "auto"]
|
|
54
42
|
},
|
|
55
43
|
"objectFit": {
|
|
56
44
|
"type": "enum",
|
|
57
45
|
"description": "How the image fits within its container",
|
|
58
46
|
"default": "cover",
|
|
59
47
|
"required": false,
|
|
60
|
-
"values": [
|
|
61
|
-
"cover",
|
|
62
|
-
"contain",
|
|
63
|
-
"fill",
|
|
64
|
-
"none"
|
|
65
|
-
]
|
|
48
|
+
"values": ["cover", "contain", "fill", "none"]
|
|
66
49
|
},
|
|
67
50
|
"width": {
|
|
68
51
|
"type": "union",
|
|
@@ -79,13 +62,7 @@
|
|
|
79
62
|
"description": "Border radius",
|
|
80
63
|
"default": "none",
|
|
81
64
|
"required": false,
|
|
82
|
-
"values": [
|
|
83
|
-
"none",
|
|
84
|
-
"sm",
|
|
85
|
-
"md",
|
|
86
|
-
"lg",
|
|
87
|
-
"full"
|
|
88
|
-
]
|
|
65
|
+
"values": ["none", "sm", "md", "lg", "full"]
|
|
89
66
|
},
|
|
90
67
|
"fallback": {
|
|
91
68
|
"type": "node",
|
|
@@ -120,50 +97,45 @@
|
|
|
120
97
|
},
|
|
121
98
|
"usage": {
|
|
122
99
|
"when": [
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"User-uploaded content that may fail to load",
|
|
126
|
-
"Thumbnails in lists or galleries"
|
|
100
|
+
"Product shots, thumbnails, and hero art",
|
|
101
|
+
"Uploads you do not control and cannot trust to load"
|
|
127
102
|
],
|
|
128
103
|
"whenNot": [
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"SVG illustrations (use inline SVG or Image component)"
|
|
104
|
+
"A person (use Avatar)",
|
|
105
|
+
"A symbol (use Icon)",
|
|
106
|
+
"Pure decoration behind content (use a CSS background)"
|
|
133
107
|
],
|
|
134
108
|
"guidelines": [
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"Use imgProps / onImageLoad / onImageError when you need lower-level img control"
|
|
109
|
+
"Set aspectRatio so a grid holds its shape before the file arrives",
|
|
110
|
+
"objectFit=\"contain\" for logos, \"cover\" for photography",
|
|
111
|
+
"Always give fallback something to say",
|
|
112
|
+
"imgProps, onImageLoad, and onImageError expose the raw img when you need it"
|
|
140
113
|
],
|
|
141
114
|
"accessibility": [
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"Ensure sufficient contrast between image and surrounding content"
|
|
115
|
+
"alt is required — describe what the picture shows",
|
|
116
|
+
"Decoration takes alt=\"\"",
|
|
117
|
+
"Words baked into an image must be repeated in alt"
|
|
146
118
|
]
|
|
147
119
|
},
|
|
148
120
|
"examples": [
|
|
149
121
|
{
|
|
150
122
|
"name": "Default",
|
|
151
|
-
"description": "
|
|
123
|
+
"description": "src plus alt — the shape follows the file.",
|
|
152
124
|
"code": "<Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=400&h=300&fit=crop\"\n alt=\"Code on a screen\"\n width={300}\n/>"
|
|
153
125
|
},
|
|
154
126
|
{
|
|
155
127
|
"name": "Aspect Ratios",
|
|
156
|
-
"description": "
|
|
128
|
+
"description": "Lock the frame so a grid stays even whatever the file is.",
|
|
157
129
|
"code": "<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>\n <Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=200&h=200&fit=crop\"\n alt=\"Square image\"\n aspectRatio=\"1:1\"\n width={100}\n />\n <Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=200&h=150&fit=crop\"\n alt=\"4:3 image\"\n aspectRatio=\"4:3\"\n width={120}\n />\n <Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=320&h=180&fit=crop\"\n alt=\"16:9 image\"\n aspectRatio=\"16:9\"\n width={160}\n />\n</div>"
|
|
158
130
|
},
|
|
159
131
|
{
|
|
160
132
|
"name": "Rounded Corners",
|
|
161
|
-
"description": "
|
|
133
|
+
"description": "Rounding softens the frame; match it to the surface it sits on.",
|
|
162
134
|
"code": "<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>\n <Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=100&h=100&fit=crop\"\n alt=\"No rounding\"\n rounded=\"none\"\n width={80}\n height={80}\n />\n <Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=100&h=100&fit=crop\"\n alt=\"Medium rounding\"\n rounded=\"md\"\n width={80}\n height={80}\n />\n <Image\n src=\"https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=100&h=100&fit=crop\"\n alt=\"Full rounding\"\n rounded=\"full\"\n width={80}\n height={80}\n />\n</div>"
|
|
163
135
|
},
|
|
164
136
|
{
|
|
165
137
|
"name": "With Fallback",
|
|
166
|
-
"description": "
|
|
138
|
+
"description": "A dead URL shows this instead of a broken-image glyph.",
|
|
167
139
|
"code": "<Image\n src=\"https://invalid-url.example/image.jpg\"\n alt=\"Image that will fail\"\n width={200}\n height={150}\n rounded=\"md\"\n fallback={\n <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%', background: 'var(--fui-color-surface-secondary)' }}>\n <span style={{ color: 'var(--fui-color-text-tertiary)' }}>No image</span>\n </div>\n }\n/>"
|
|
168
140
|
}
|
|
169
141
|
],
|
|
@@ -189,16 +161,11 @@
|
|
|
189
161
|
"fallback: ReactNode - loading/error content",
|
|
190
162
|
"imgProps/onImageLoad/onImageError - low-level img customization and events"
|
|
191
163
|
],
|
|
192
|
-
"a11yRules": [
|
|
193
|
-
"A11Y_IMG_ALT",
|
|
194
|
-
"A11Y_IMG_DECORATIVE"
|
|
195
|
-
]
|
|
164
|
+
"a11yRules": ["A11Y_IMG_ALT", "A11Y_IMG_DECORATIVE"]
|
|
196
165
|
},
|
|
197
166
|
"ai": {
|
|
198
167
|
"compositionPattern": "compound",
|
|
199
|
-
"subComponents": [
|
|
200
|
-
"Root"
|
|
201
|
-
]
|
|
168
|
+
"subComponents": ["Root"]
|
|
202
169
|
},
|
|
203
170
|
"provenance": {
|
|
204
171
|
"source": "migrated",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Input",
|
|
4
|
-
"description": "
|
|
5
|
-
"category": "
|
|
4
|
+
"description": "Collects a single line of user-entered text.",
|
|
5
|
+
"category": "inputs",
|
|
6
6
|
"tags": ["form", "input", "text"],
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"sourcePath": "src/components/Input/index.tsx",
|
|
@@ -181,10 +181,9 @@
|
|
|
181
181
|
},
|
|
182
182
|
"usage": {
|
|
183
183
|
"when": [
|
|
184
|
-
"
|
|
185
|
-
"Email, password, phone number, or URL input",
|
|
184
|
+
"Single-line answers: name, email, password, phone, URL",
|
|
186
185
|
"Search fields",
|
|
187
|
-
"Short form
|
|
186
|
+
"Short free-form values a list cannot cover"
|
|
188
187
|
],
|
|
189
188
|
"whenNot": [
|
|
190
189
|
"Multi-line text (use Textarea)",
|
|
@@ -193,83 +192,78 @@
|
|
|
193
192
|
"Date/time input (use DatePicker)"
|
|
194
193
|
],
|
|
195
194
|
"guidelines": [
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"Use the shortcut prop for
|
|
201
|
-
"
|
|
195
|
+
"Give every field a label",
|
|
196
|
+
"Match type to the data — it drives validation and mobile keyboards",
|
|
197
|
+
"Placeholder shows format; it never replaces the label",
|
|
198
|
+
"Pair error with helperText so the reason is announced",
|
|
199
|
+
"Use the shortcut prop for kbd hints instead of custom markup",
|
|
200
|
+
"shortcut is display-only; shortcutBehavior=\"focus-input\" adds the global hotkey"
|
|
202
201
|
],
|
|
203
202
|
"accessibility": [
|
|
204
|
-
"
|
|
205
|
-
"Error
|
|
206
|
-
"Required fields
|
|
203
|
+
"Label is programmatically tied to the input",
|
|
204
|
+
"Error text is announced to screen readers",
|
|
205
|
+
"Required fields are marked"
|
|
207
206
|
]
|
|
208
207
|
},
|
|
209
208
|
"examples": [
|
|
210
209
|
{
|
|
211
210
|
"name": "Default",
|
|
212
|
-
"description": "
|
|
211
|
+
"description": "Label plus a placeholder that hints the format.",
|
|
213
212
|
"code": "<Input label=\"Name\" placeholder=\"Enter your name\" />"
|
|
214
213
|
},
|
|
215
214
|
{
|
|
216
215
|
"name": "With Value",
|
|
217
|
-
"description": "
|
|
216
|
+
"description": "Starts with a value already in the field.",
|
|
218
217
|
"code": "<Input label=\"Email\" type=\"email\" value=\"user@example.com\" />"
|
|
219
218
|
},
|
|
220
219
|
{
|
|
221
220
|
"name": "With Helper",
|
|
222
|
-
"description": "
|
|
221
|
+
"description": "Supporting text sits under the field.",
|
|
223
222
|
"code": "<Input\n label=\"Password\"\n type=\"password\"\n placeholder=\"Create a password\"\n helperText=\"Must be at least 8 characters\"\n/>"
|
|
224
223
|
},
|
|
225
224
|
{
|
|
226
225
|
"name": "Error State",
|
|
227
|
-
"description": "
|
|
226
|
+
"description": "Red border, and helperText becomes the reason.",
|
|
228
227
|
"code": "<Input\n label=\"Email\"\n type=\"email\"\n value=\"invalid-email\"\n error\n helperText=\"Please enter a valid email address\"\n/>"
|
|
229
228
|
},
|
|
230
229
|
{
|
|
231
230
|
"name": "Disabled",
|
|
232
|
-
"description": "
|
|
233
|
-
"code": "<Input label=\"Username\" value=\"
|
|
231
|
+
"description": "Dimmed, unfocusable, still shows its value.",
|
|
232
|
+
"code": "<Input label=\"Username\" value=\"ada.lovelace\" disabled />"
|
|
234
233
|
},
|
|
235
234
|
{
|
|
236
235
|
"name": "Required",
|
|
237
|
-
"description": "
|
|
236
|
+
"description": "Asterisk marks the field as mandatory.",
|
|
238
237
|
"code": "<Input\n label=\"Email\"\n type=\"email\"\n placeholder=\"user@example.com\"\n required\n/>"
|
|
239
238
|
},
|
|
240
239
|
{
|
|
241
240
|
"name": "Sizes",
|
|
242
|
-
"description": "
|
|
241
|
+
"description": "Three heights: sm, md, lg.",
|
|
243
242
|
"code": "<div style={{ display: 'flex', flexDirection: 'column', gap: '12px', maxWidth: '300px' }}>\n <Input label=\"Small\" size=\"sm\" placeholder=\"Small input\" />\n <Input label=\"Medium\" size=\"md\" placeholder=\"Medium input\" />\n <Input label=\"Large\" size=\"lg\" placeholder=\"Large input\" />\n</div>"
|
|
244
243
|
},
|
|
245
244
|
{
|
|
246
245
|
"name": "Bare Input (Field Composition)",
|
|
247
|
-
"description": "
|
|
246
|
+
"description": "Drops the built-in label wrapper so Field owns the layout.",
|
|
248
247
|
"code": "<Input\n withFieldWrapper={false}\n aria-label=\"Search\"\n placeholder=\"Search...\"\n rootProps={{ 'data-demo': 'bare-input-wrapper' }}\n/>"
|
|
249
248
|
},
|
|
250
|
-
{
|
|
251
|
-
"name": "Shortcut Focus Hotkey",
|
|
252
|
-
"description": "Display shortcut hint and opt into focus behavior",
|
|
253
|
-
"code": "<Input\n label=\"Command Palette\"\n placeholder=\"Search commands\"\n shortcut=\"⌘K\"\n shortcutBehavior=\"focus-input\"\n/>"
|
|
254
|
-
},
|
|
255
249
|
{
|
|
256
250
|
"name": "Search With Shortcut",
|
|
257
|
-
"description": "
|
|
251
|
+
"description": "Leading icon and a ⌘K hint that focuses the field.",
|
|
258
252
|
"code": "<Input\n aria-label=\"Search findings\"\n placeholder=\"Search findings...\"\n shortcut=\"⌘K\"\n shortcutBehavior=\"focus-input\"\n startAdornment={<MagnifyingGlass aria-hidden=\"true\" />}\n withFieldWrapper={false}\n/>"
|
|
259
253
|
},
|
|
260
254
|
{
|
|
261
255
|
"name": "Success State",
|
|
262
|
-
"description": "
|
|
256
|
+
"description": "Green border confirms the value passed validation.",
|
|
263
257
|
"code": "<Input\n label=\"Email\"\n type=\"email\"\n value=\"user@example.com\"\n success\n helperText=\"Email verified\"\n/>"
|
|
264
258
|
},
|
|
265
259
|
{
|
|
266
260
|
"name": "With Start Adornment",
|
|
267
|
-
"description": "
|
|
261
|
+
"description": "Prefix sits inside the field, before the text.",
|
|
268
262
|
"code": "<Input\n label=\"Price\"\n placeholder=\"0.00\"\n startAdornment={<span>$</span>}\n/>"
|
|
269
263
|
},
|
|
270
264
|
{
|
|
271
265
|
"name": "With End Adornment",
|
|
272
|
-
"description": "
|
|
266
|
+
"description": "Suffix sits inside the field, after the text.",
|
|
273
267
|
"code": "<Input\n label=\"Weight\"\n placeholder=\"0\"\n endAdornment={<span>kg</span>}\n/>"
|
|
274
268
|
}
|
|
275
269
|
],
|
|
@@ -200,7 +200,8 @@
|
|
|
200
200
|
font-variant-numeric: tabular-nums;
|
|
201
201
|
color: var(--fui-kbd-color, var(--fui-text-tertiary, #{$fui-text-tertiary}));
|
|
202
202
|
background: var(--fui-kbd-bg, var(--fui-bg-elevated, #{$fui-bg-elevated}));
|
|
203
|
-
border: var(--fui-stroke-hairline, 1px) solid
|
|
203
|
+
border: var(--fui-stroke-hairline, 1px) solid
|
|
204
|
+
var(--fui-kbd-border, var(--fui-border, #{$fui-border}));
|
|
204
205
|
border-radius: var(--fui-kbd-radius, var(--fui-radius-sm, #{$fui-radius-sm}));
|
|
205
206
|
box-shadow: var(--fui-kbd-shadow, none);
|
|
206
207
|
pointer-events: none;
|
|
@@ -214,7 +215,7 @@
|
|
|
214
215
|
|
|
215
216
|
@media (prefers-contrast: more) {
|
|
216
217
|
.input {
|
|
217
|
-
border-width: 2px;
|
|
218
|
+
border-width: var(--fui-stroke-default, 2px);
|
|
218
219
|
border-color: var(--fui-text-primary, $fui-text-primary);
|
|
219
220
|
|
|
220
221
|
&:focus-visible {
|