@usefragments/ui 1.6.0 → 2.0.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 +54 -66
- 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/nav-glyph.cjs +139 -0
- package/dist/assets/nav-glyph.d.ts +28 -0
- package/dist/assets/nav-glyph.d.ts.map +1 -0
- package/dist/assets/nav-glyph.js +139 -0
- package/dist/assets/nav-glyph.module.scss.cjs +71 -0
- package/dist/assets/nav-glyph.module.scss.js +71 -0
- package/dist/assets/ui.css +6885 -6308
- package/dist/blocks/components/StatsCard.d.ts +1 -1
- package/dist/blocks/components/StatsCard.d.ts.map +1 -1
- package/dist/chart.cjs +24 -6
- package/dist/chart.js +24 -6
- package/dist/codeblock.cjs +76 -43
- package/dist/codeblock.js +71 -38
- package/dist/colorpicker.cjs +4 -1
- package/dist/colorpicker.js +4 -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 +23 -20
- package/dist/components/Alert/Alert.module.scss.js +23 -20
- package/dist/components/Alert/index.cjs +20 -8
- package/dist/components/Alert/index.d.ts +17 -11
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js +20 -8
- package/dist/components/AppShell/AppShell.module.scss.cjs +14 -14
- package/dist/components/AppShell/AppShell.module.scss.js +14 -14
- package/dist/components/AppShell/index.cjs +2 -2
- package/dist/components/AppShell/index.js +2 -2
- package/dist/components/Avatar/Avatar.module.scss.cjs +14 -14
- package/dist/components/Avatar/Avatar.module.scss.js +14 -14
- package/dist/components/Badge/Badge.module.scss.cjs +33 -31
- package/dist/components/Badge/Badge.module.scss.js +33 -31
- package/dist/components/Badge/index.cjs +13 -3
- package/dist/components/Badge/index.d.ts +18 -13
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +13 -3
- package/dist/components/BentoGrid/BentoGrid.module.scss.cjs +14 -14
- package/dist/components/BentoGrid/BentoGrid.module.scss.js +14 -14
- package/dist/components/Box/Box.module.scss.cjs +152 -152
- package/dist/components/Box/Box.module.scss.js +152 -152
- package/dist/components/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 +11 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.js +11 -8
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/Button.module.scss.cjs +36 -27
- package/dist/components/Button/Button.module.scss.js +36 -27
- package/dist/components/Button/index.cjs +20 -4
- package/dist/components/Button/index.d.ts +18 -10
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +20 -4
- package/dist/components/ButtonGroup/ButtonGroup.module.scss.cjs +15 -15
- package/dist/components/ButtonGroup/ButtonGroup.module.scss.js +15 -15
- package/dist/components/Card/Card.module.scss.cjs +31 -26
- package/dist/components/Card/Card.module.scss.js +32 -27
- package/dist/components/Card/index.cjs +16 -3
- package/dist/components/Card/index.d.ts +23 -15
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/index.js +16 -3
- 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 +11 -11
- package/dist/components/Checkbox/Checkbox.module.scss.js +11 -11
- package/dist/components/Checkbox/index.cjs +4 -4
- package/dist/components/Checkbox/index.d.ts +4 -6
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +4 -4
- package/dist/components/Chip/Chip.module.scss.cjs +19 -19
- package/dist/components/Chip/Chip.module.scss.js +19 -19
- package/dist/components/Chip/index.cjs +3 -3
- package/dist/components/Chip/index.d.ts +8 -3
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Chip/index.js +3 -3
- 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 +20 -5
- 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 +26 -6
- package/dist/components/Combobox/index.d.ts.map +1 -1
- package/dist/components/Combobox/index.js +26 -6
- package/dist/components/Command/Command.module.scss.cjs +14 -11
- package/dist/components/Command/Command.module.scss.js +14 -11
- package/dist/components/Command/index.cjs +28 -16
- package/dist/components/Command/index.d.ts +8 -3
- package/dist/components/Command/index.d.ts.map +1 -1
- package/dist/components/Command/index.js +28 -16
- package/dist/components/ConversationList/ConversationList.module.scss.cjs +10 -10
- package/dist/components/ConversationList/ConversationList.module.scss.js +10 -10
- package/dist/components/ConversationList/index.cjs +2 -2
- package/dist/components/ConversationList/index.js +2 -2
- package/dist/components/DataTable/DataTable.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 +31 -28
- package/dist/components/DataTable/DataTable.module.scss.js +31 -28
- package/dist/components/DataTable/DataTable.virtual.d.ts.map +1 -1
- package/dist/components/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 +13 -16
- package/dist/components/Dialog/index.d.ts +11 -10
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +13 -16
- package/dist/components/Drawer/Drawer.module.scss.cjs +39 -39
- package/dist/components/Drawer/Drawer.module.scss.js +40 -40
- package/dist/components/Drawer/index.cjs +2 -2
- package/dist/components/Drawer/index.d.ts +5 -4
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/Editor/Editor.module.scss.cjs +17 -17
- package/dist/components/Editor/Editor.module.scss.js +17 -17
- package/dist/components/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 +13 -6
- package/dist/components/EmptyState/index.d.ts +13 -5
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/index.js +13 -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/Grid.module.scss.cjs +54 -54
- package/dist/components/Grid/Grid.module.scss.js +54 -54
- 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 +30 -33
- package/dist/components/Icon/Icon.module.scss.js +30 -33
- package/dist/components/Icon/index.cjs +15 -14
- package/dist/components/Icon/index.d.ts +23 -12
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +15 -14
- package/dist/components/IconButton/IconButton.module.scss.cjs +12 -12
- package/dist/components/IconButton/IconButton.module.scss.js +12 -12
- package/dist/components/IconButton/index.cjs +2 -1
- package/dist/components/IconButton/index.d.ts +4 -4
- 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 +15 -21
- package/dist/components/Input/Input.module.scss.js +15 -21
- package/dist/components/Input/index.cjs +2 -14
- package/dist/components/Input/index.d.ts +0 -2
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +2 -14
- package/dist/components/Link/Link.module.scss.cjs +26 -14
- package/dist/components/Link/Link.module.scss.js +26 -14
- package/dist/components/Link/index.cjs +13 -2
- package/dist/components/Link/index.d.ts +11 -4
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +13 -2
- package/dist/components/List/List.module.scss.cjs +23 -19
- package/dist/components/List/List.module.scss.js +23 -19
- package/dist/components/List/index.cjs +7 -7
- package/dist/components/List/index.d.ts +10 -7
- package/dist/components/List/index.d.ts.map +1 -1
- package/dist/components/List/index.js +7 -7
- package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
- package/dist/components/Listbox/Listbox.module.scss.js +8 -8
- package/dist/components/Loading/Loading.module.scss.cjs +34 -34
- package/dist/components/Loading/Loading.module.scss.js +34 -34
- package/dist/components/Loading/index.cjs +5 -5
- package/dist/components/Loading/index.d.ts +8 -7
- package/dist/components/Loading/index.d.ts.map +1 -1
- package/dist/components/Loading/index.js +5 -5
- package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
- package/dist/components/Markdown/Markdown.module.scss.js +1 -1
- package/dist/components/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 +20 -20
- package/dist/components/Message/Message.module.scss.js +20 -20
- package/dist/components/Message/index.cjs +1 -1
- package/dist/components/Message/index.d.ts +1 -1
- package/dist/components/Message/index.js +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +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 +28 -25
- package/dist/components/Progress/Progress.module.scss.js +28 -25
- package/dist/components/Progress/index.cjs +21 -12
- package/dist/components/Progress/index.d.ts +10 -6
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +21 -12
- package/dist/components/Prompt/Prompt.module.scss.cjs +30 -30
- package/dist/components/Prompt/Prompt.module.scss.js +30 -30
- package/dist/components/Prompt/index.cjs +7 -7
- package/dist/components/Prompt/index.d.ts +11 -9
- package/dist/components/Prompt/index.d.ts.map +1 -1
- package/dist/components/Prompt/index.js +7 -7
- package/dist/components/RadioGroup/RadioGroup.module.scss.cjs +20 -17
- package/dist/components/RadioGroup/RadioGroup.module.scss.js +20 -17
- package/dist/components/RadioGroup/index.cjs +10 -5
- package/dist/components/RadioGroup/index.d.ts +11 -7
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +10 -5
- package/dist/components/ScrollArea/ScrollArea.module.scss.cjs +5 -5
- package/dist/components/ScrollArea/ScrollArea.module.scss.js +5 -5
- package/dist/components/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/Select/index.cjs +26 -20
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +26 -20
- package/dist/components/Separator/Separator.module.scss.cjs +25 -19
- package/dist/components/Separator/Separator.module.scss.js +25 -19
- package/dist/components/Separator/index.cjs +10 -8
- package/dist/components/Separator/index.d.ts +4 -2
- package/dist/components/Separator/index.d.ts.map +1 -1
- package/dist/components/Separator/index.js +10 -8
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +43 -43
- package/dist/components/Sidebar/Sidebar.module.scss.js +43 -43
- package/dist/components/Sidebar/index.cjs +15 -38
- 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 +15 -38
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +50 -46
- package/dist/components/Skeleton/Skeleton.module.scss.js +50 -46
- package/dist/components/Skeleton/index.cjs +7 -7
- package/dist/components/Skeleton/index.d.ts +8 -7
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +7 -7
- package/dist/components/Slider/Slider.module.scss.cjs +12 -12
- package/dist/components/Slider/Slider.module.scss.js +12 -12
- package/dist/components/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 +14 -10
- 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 +14 -10
- package/dist/components/Tabs/Tabs.module.scss.cjs +18 -18
- package/dist/components/Tabs/Tabs.module.scss.js +18 -18
- package/dist/components/Tabs/index.cjs +30 -11
- package/dist/components/Tabs/index.d.ts +8 -6
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +30 -11
- package/dist/components/Text/Text.module.scss.cjs +109 -97
- package/dist/components/Text/Text.module.scss.js +109 -97
- package/dist/components/Text/index.cjs +45 -41
- package/dist/components/Text/index.d.ts +24 -19
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +45 -41
- package/dist/components/Textarea/Textarea.module.scss.cjs +22 -28
- package/dist/components/Textarea/Textarea.module.scss.js +22 -28
- package/dist/components/Textarea/index.cjs +3 -10
- package/dist/components/Textarea/index.d.ts +0 -2
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +3 -10
- package/dist/components/Theme/index.cjs +22 -5
- package/dist/components/Theme/index.d.ts +6 -12
- package/dist/components/Theme/index.d.ts.map +1 -1
- package/dist/components/Theme/index.js +22 -5
- package/dist/components/ThemeToggle/ThemeButton.cjs +51 -0
- package/dist/components/ThemeToggle/ThemeButton.d.ts +16 -0
- package/dist/components/ThemeToggle/ThemeButton.d.ts.map +1 -0
- package/dist/components/ThemeToggle/ThemeButton.js +34 -0
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.cjs +6 -6
- package/dist/components/ThemeToggle/ThemeToggle.module.scss.js +6 -6
- package/dist/components/ThemeToggle/icons.cjs +48 -0
- package/dist/components/ThemeToggle/icons.d.ts +10 -0
- package/dist/components/ThemeToggle/icons.d.ts.map +1 -0
- package/dist/components/ThemeToggle/icons.js +48 -0
- package/dist/components/ThemeToggle/index.cjs +6 -50
- package/dist/components/ThemeToggle/index.d.ts +5 -3
- package/dist/components/ThemeToggle/index.d.ts.map +1 -1
- package/dist/components/ThemeToggle/index.js +3 -47
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.cjs +18 -15
- package/dist/components/ThinkingIndicator/ThinkingIndicator.module.scss.js +18 -15
- package/dist/components/ThinkingIndicator/index.cjs +7 -8
- package/dist/components/ThinkingIndicator/index.d.ts +6 -5
- package/dist/components/ThinkingIndicator/index.d.ts.map +1 -1
- package/dist/components/ThinkingIndicator/index.js +7 -8
- package/dist/components/Toast/Toast.module.scss.cjs +28 -29
- package/dist/components/Toast/Toast.module.scss.js +29 -30
- package/dist/components/Toast/index.cjs +28 -30
- package/dist/components/Toast/index.d.ts +9 -8
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/index.js +28 -30
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.cjs +21 -19
- package/dist/components/ToggleGroup/ToggleGroup.module.scss.js +22 -20
- package/dist/components/ToggleGroup/index.cjs +4 -5
- package/dist/components/ToggleGroup/index.d.ts +7 -6
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.js +4 -5
- package/dist/components/Tooltip/Tooltip.module.scss.cjs +3 -3
- package/dist/components/Tooltip/Tooltip.module.scss.js +3 -3
- package/dist/components/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/VisuallyHidden.module.scss.cjs +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.module.scss.js +1 -1
- package/dist/components/VisuallyHidden/index.d.ts +2 -2
- package/dist/data-table-virtual.cjs +3 -2
- package/dist/data-table-virtual.js +3 -2
- package/dist/data-table.cjs +3 -2
- package/dist/data-table.js +3 -2
- package/dist/datepicker.cjs +26 -13
- package/dist/datepicker.js +26 -13
- package/dist/editor.cjs +68 -28
- package/dist/editor.js +68 -28
- package/dist/index.cjs +6 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/markdown.cjs +21 -29
- package/dist/markdown.js +21 -29
- package/dist/measurements/generated.cjs +46 -94
- package/dist/measurements/generated.d.ts +44 -92
- package/dist/measurements/generated.d.ts.map +1 -1
- package/dist/measurements/generated.js +46 -94
- package/dist/measurements/index.d.ts +1 -1
- package/dist/measurements/index.d.ts.map +1 -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 -7
- package/dist/utils/seed-derivation.d.ts +1 -3
- package/dist/utils/seed-derivation.d.ts.map +1 -1
- package/dist/utils/seed-derivation.js +10 -7
- package/dist/utils/theme-presets.cjs +5 -10
- package/dist/utils/theme-presets.d.ts +1 -2
- package/dist/utils/theme-presets.d.ts.map +1 -1
- package/dist/utils/theme-presets.js +5 -10
- package/fragments.json +1 -1
- package/package.json +9 -10
- package/src/assets/fragments-logo.tsx +2 -2
- package/src/assets/fragments-wordmark.tsx +4 -2
- package/src/assets/nav-glyph.module.scss +166 -0
- package/src/assets/nav-glyph.tsx +188 -0
- package/src/components/Accordion/Accordion.contract.json +24 -48
- package/src/components/Accordion/Accordion.module.scss +5 -3
- package/src/components/Alert/Alert.contract.json +49 -65
- package/src/components/Alert/Alert.module.scss +57 -47
- package/src/components/Alert/index.tsx +72 -39
- package/src/components/AppShell/AppShell.contract.json +34 -51
- package/src/components/AppShell/AppShell.module.scss +99 -54
- package/src/components/AppShell/index.tsx +2 -2
- package/src/components/Avatar/Avatar.contract.json +31 -48
- package/src/components/Avatar/Avatar.module.scss +4 -2
- package/src/components/Badge/Badge.contract.json +86 -55
- package/src/components/Badge/Badge.module.scss +80 -48
- package/src/components/Badge/index.tsx +34 -17
- package/src/components/BentoGrid/BentoGrid.contract.json +21 -45
- package/src/components/BentoGrid/BentoGrid.module.scss +4 -8
- package/src/components/Box/Box.contract.json +40 -148
- package/src/components/Box/Box.module.scss +7 -6
- package/src/components/Box/index.tsx +92 -99
- package/src/components/Breadcrumbs/Breadcrumbs.contract.json +21 -34
- package/src/components/Breadcrumbs/Breadcrumbs.module.scss +27 -12
- package/src/components/Breadcrumbs/index.tsx +5 -1
- package/src/components/Button/Button.module.scss +261 -185
- package/src/components/Button/index.tsx +41 -28
- package/src/components/ButtonGroup/ButtonGroup.contract.json +34 -49
- package/src/components/ButtonGroup/ButtonGroup.module.scss +8 -6
- package/src/components/Card/Card.consumer-fixture.module.scss +5 -2
- package/src/components/Card/Card.module.scss +97 -76
- package/src/components/Card/index.tsx +44 -20
- package/src/components/Chart/Chart.contract.json +21 -29
- package/src/components/Chart/Chart.module.scss +6 -5
- package/src/components/Chart/index.tsx +36 -6
- package/src/components/Checkbox/Checkbox.contract.json +28 -27
- package/src/components/Checkbox/Checkbox.module.scss +47 -54
- package/src/components/Checkbox/index.tsx +10 -10
- package/src/components/Chip/Chip.contract.json +38 -45
- package/src/components/Chip/Chip.module.scss +24 -23
- package/src/components/Chip/index.tsx +12 -7
- package/src/components/CodeBlock/CodeBlock.contract.json +46 -76
- package/src/components/CodeBlock/CodeBlock.module.scss +75 -73
- package/src/components/CodeBlock/css-variables-theme.ts +102 -0
- package/src/components/CodeBlock/index.tsx +114 -51
- package/src/components/Collapsible/Collapsible.contract.json +21 -36
- package/src/components/Collapsible/Collapsible.module.scss +1 -7
- package/src/components/ColorPicker/ColorPicker.contract.json +29 -48
- package/src/components/ColorPicker/ColorPicker.module.scss +34 -24
- package/src/components/ColorPicker/index.tsx +6 -1
- package/src/components/Combobox/Combobox.contract.json +36 -37
- package/src/components/Combobox/Combobox.module.scss +16 -19
- package/src/components/Combobox/index.tsx +41 -6
- package/src/components/Command/Command.contract.json +28 -44
- package/src/components/Command/Command.module.scss +19 -21
- package/src/components/Command/index.tsx +64 -47
- package/src/components/ComponentDefaults/ComponentDefaults.contract.json +91 -0
- package/src/components/ConversationList/ConversationList.contract.json +27 -32
- package/src/components/ConversationList/ConversationList.module.scss +2 -3
- package/src/components/ConversationList/index.tsx +2 -2
- package/src/components/DataTable/DataTable.icons.tsx +4 -21
- package/src/components/DataTable/DataTable.module.scss +24 -17
- package/src/components/DataTable/DataTable.virtual.tsx +3 -2
- package/src/components/DataTable/index.tsx +9 -8
- package/src/components/DatePicker/DatePicker.contract.json +27 -28
- package/src/components/DatePicker/DatePicker.module.scss +41 -44
- package/src/components/DatePicker/index.tsx +23 -9
- package/src/components/Dialog/Dialog.module.scss +26 -32
- package/src/components/Dialog/index.tsx +51 -39
- package/src/components/Drawer/Drawer.contract.json +28 -42
- package/src/components/Drawer/Drawer.module.scss +123 -64
- package/src/components/Drawer/index.tsx +7 -5
- package/src/components/Editor/Editor.contract.json +32 -49
- package/src/components/Editor/Editor.module.scss +60 -25
- package/src/components/Editor/index.tsx +240 -179
- package/src/components/EmptyState/EmptyState.contract.json +33 -45
- package/src/components/EmptyState/EmptyState.module.scss +37 -21
- package/src/components/EmptyState/index.tsx +56 -23
- package/src/components/Field/Field.contract.json +28 -46
- package/src/components/Field/Field.module.scss +2 -1
- package/src/components/Field/index.tsx +5 -1
- package/src/components/Fieldset/Fieldset.contract.json +21 -38
- package/src/components/Fieldset/Fieldset.module.scss +15 -7
- package/src/components/Form/Form.contract.json +23 -23
- package/src/components/Grid/Grid.contract.json +28 -64
- package/src/components/Grid/Grid.module.scss +2 -2
- package/src/components/Grid/index.tsx +10 -10
- package/src/components/Header/Header.contract.json +31 -67
- package/src/components/Header/Header.module.scss +57 -54
- package/src/components/Header/index.tsx +134 -122
- package/src/components/Icon/Icon.contract.json +37 -81
- package/src/components/Icon/Icon.module.scss +13 -12
- package/src/components/Icon/index.tsx +31 -31
- package/src/components/IconButton/IconButton.contract.json +37 -21
- package/src/components/IconButton/IconButton.module.scss +19 -11
- package/src/components/IconButton/index.tsx +6 -5
- package/src/components/Image/Image.contract.json +23 -56
- package/src/components/Input/Input.contract.json +25 -44
- package/src/components/Input/Input.module.scss +6 -55
- package/src/components/Input/index.tsx +2 -18
- package/src/components/Link/Link.contract.json +46 -58
- package/src/components/Link/Link.module.scss +41 -10
- package/src/components/Link/index.tsx +27 -6
- package/src/components/List/List.contract.json +33 -62
- package/src/components/List/List.module.scss +10 -5
- package/src/components/List/index.tsx +17 -13
- package/src/components/Listbox/Listbox.contract.json +21 -37
- package/src/components/Listbox/Listbox.module.scss +14 -20
- package/src/components/Loading/Loading.contract.json +41 -65
- package/src/components/Loading/Loading.module.scss +37 -31
- package/src/components/Loading/index.tsx +15 -14
- 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 +45 -6
- package/src/components/Markdown/index.tsx +48 -49
- package/src/components/Menu/Menu.contract.json +30 -46
- package/src/components/Menu/Menu.module.scss +32 -16
- package/src/components/Message/Message.contract.json +31 -54
- package/src/components/Message/Message.module.scss +18 -9
- package/src/components/Message/index.tsx +2 -2
- package/src/components/NavigationMenu/NavigationMenu.contract.json +36 -45
- package/src/components/NavigationMenu/NavigationMenu.module.scss +66 -66
- package/src/components/NavigationMenu/index.tsx +105 -81
- package/src/components/Pagination/Pagination.contract.json +22 -40
- package/src/components/Pagination/Pagination.module.scss +9 -16
- package/src/components/Popover/Popover.contract.json +28 -50
- package/src/components/Popover/Popover.module.scss +30 -28
- package/src/components/Progress/Progress.contract.json +39 -35
- package/src/components/Progress/Progress.module.scss +16 -10
- package/src/components/Progress/index.tsx +34 -16
- package/src/components/Prompt/Prompt.contract.json +40 -56
- package/src/components/Prompt/Prompt.module.scss +49 -48
- package/src/components/Prompt/index.tsx +17 -15
- package/src/components/RadioGroup/RadioGroup.contract.json +29 -28
- package/src/components/RadioGroup/RadioGroup.module.scss +50 -45
- package/src/components/RadioGroup/index.tsx +23 -10
- package/src/components/ScrollArea/ScrollArea.contract.json +18 -19
- package/src/components/ScrollArea/ScrollArea.module.scss +45 -48
- package/src/components/ScrollArea/index.tsx +16 -16
- package/src/components/ScrollArea/scroll-state.ts +24 -24
- package/src/components/Select/Select.module.scss +20 -19
- package/src/components/Select/index.tsx +26 -24
- package/src/components/Separator/Separator.contract.json +29 -53
- package/src/components/Separator/Separator.module.scss +24 -40
- package/src/components/Separator/index.tsx +16 -11
- package/src/components/Sidebar/Sidebar.contract.json +35 -67
- package/src/components/Sidebar/Sidebar.module.scss +94 -88
- package/src/components/Sidebar/index.tsx +167 -167
- package/src/components/Skeleton/Skeleton.contract.json +34 -60
- package/src/components/Skeleton/Skeleton.module.scss +50 -26
- package/src/components/Skeleton/index.tsx +16 -15
- package/src/components/Slider/Slider.contract.json +27 -39
- package/src/components/Slider/Slider.module.scss +9 -22
- package/src/components/Stack/Stack.contract.json +30 -57
- package/src/components/Stack/Stack.module.scss +26 -24
- package/src/components/Stack/index.tsx +3 -3
- package/src/components/Switch/Switch.contract.json +33 -46
- package/src/components/Switch/Switch.module.scss +106 -59
- package/src/components/Table/Table.contract.json +28 -46
- package/src/components/Table/Table.module.scss +24 -16
- package/src/components/TableOfContents/TableOfContents.contract.json +34 -21
- package/src/components/TableOfContents/TableOfContents.module.scss +17 -13
- package/src/components/TableOfContents/index.tsx +27 -10
- package/src/components/Tabs/Tabs.contract.json +35 -56
- package/src/components/Tabs/Tabs.module.scss +27 -31
- package/src/components/Tabs/index.tsx +30 -15
- package/src/components/Text/Text.contract.json +52 -72
- package/src/components/Text/Text.module.scss +34 -18
- package/src/components/Text/index.tsx +123 -83
- package/src/components/Textarea/Textarea.contract.json +24 -55
- package/src/components/Textarea/Textarea.module.scss +22 -52
- package/src/components/Textarea/index.tsx +3 -14
- package/src/components/Theme/Theme.contract.json +35 -53
- package/src/components/Theme/index.tsx +41 -13
- package/src/components/ThemeToggle/ThemeButton.tsx +49 -0
- package/src/components/ThemeToggle/ThemeToggle.module.scss +20 -27
- package/src/components/ThemeToggle/icons.tsx +46 -0
- package/src/components/ThemeToggle/index.tsx +9 -55
- package/src/components/ThinkingIndicator/ThinkingIndicator.contract.json +34 -50
- package/src/components/ThinkingIndicator/ThinkingIndicator.module.scss +9 -7
- package/src/components/ThinkingIndicator/index.tsx +12 -14
- package/src/components/Toast/Toast.contract.json +55 -49
- package/src/components/Toast/Toast.module.scss +50 -105
- package/src/components/Toast/index.tsx +39 -34
- package/src/components/ToggleGroup/ToggleGroup.contract.json +39 -40
- package/src/components/ToggleGroup/ToggleGroup.module.scss +30 -27
- package/src/components/ToggleGroup/index.tsx +11 -11
- package/src/components/Tooltip/Tooltip.contract.json +31 -52
- package/src/components/Tooltip/Tooltip.module.scss +16 -10
- package/src/components/Tooltip/index.tsx +19 -24
- package/src/components/VisuallyHidden/VisuallyHidden.contract.json +22 -44
- package/src/components/VisuallyHidden/VisuallyHidden.module.scss +4 -14
- package/src/components/VisuallyHidden/index.tsx +5 -5
- package/src/index.ts +16 -12
- package/src/measurements/MeasurementTargets.module.scss +6 -7
- package/src/measurements/generated.ts +46 -97
- package/src/measurements/index.ts +0 -1
- package/src/measurements/measurements.json +44 -116
- package/src/recipes/_action.scss +4 -4
- package/src/recipes/_boolean-range.scss +12 -16
- package/src/recipes/_feedback.scss +17 -16
- package/src/recipes/_field.scss +28 -16
- package/src/recipes/_layout.scss +14 -7
- package/src/recipes/_navigation.scss +84 -29
- package/src/recipes/_overlay.scss +143 -43
- package/src/recipes/_popup.scss +54 -34
- package/src/recipes/_prose.scss +48 -28
- package/src/recipes/_representation.scss +10 -9
- package/src/recipes/_segmented.scss +1 -1
- package/src/recipes/_table-chrome.scss +42 -17
- package/src/recipes/_target.scss +2 -4
- package/src/recipes/_typography.scss +10 -0
- package/src/scss.d.ts +1 -1
- package/src/styles/globals.scss +31 -25
- package/src/tokens/_component-properties.scss +19 -1
- package/src/tokens/_computed.scss +32 -49
- package/src/tokens/_derive.scss +112 -210
- package/src/tokens/_measurements.catalog.generated.css +62 -44
- package/src/tokens/_measurements.generated.scss +119 -249
- package/src/tokens/_mixins.scss +49 -48
- package/src/tokens/_palettes.scss +39 -167
- package/src/tokens/_property-registrations.scss +9 -0
- package/src/tokens/_seeds.scss +20 -31
- package/src/tokens/_variables.scss +251 -94
- 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 +11 -14
- package/src/utils/theme-presets.ts +5 -12
- package/dist/blocks/AccountSettings.block.d.ts +0 -3
- package/dist/blocks/AccountSettings.block.d.ts.map +0 -1
- package/dist/blocks/ActivityFeedSkeleton.block.d.ts +0 -3
- package/dist/blocks/ActivityFeedSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/BlogEditor.block.d.ts +0 -3
- package/dist/blocks/BlogEditor.block.d.ts.map +0 -1
- package/dist/blocks/ChatInterface.block.d.ts +0 -3
- package/dist/blocks/ChatInterface.block.d.ts.map +0 -1
- package/dist/blocks/ChatMessages.block.d.ts +0 -3
- package/dist/blocks/ChatMessages.block.d.ts.map +0 -1
- package/dist/blocks/CheckoutForm.block.d.ts +0 -3
- package/dist/blocks/CheckoutForm.block.d.ts.map +0 -1
- package/dist/blocks/CommandPalette.block.d.ts +0 -3
- package/dist/blocks/CommandPalette.block.d.ts.map +0 -1
- package/dist/blocks/ContactForm.block.d.ts +0 -3
- package/dist/blocks/ContactForm.block.d.ts.map +0 -1
- package/dist/blocks/DashboardPage.block.d.ts +0 -3
- package/dist/blocks/DashboardPage.block.d.ts.map +0 -1
- package/dist/blocks/DashboardSkeleton.block.d.ts +0 -3
- package/dist/blocks/DashboardSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/DataTable.block.d.ts +0 -3
- package/dist/blocks/DataTable.block.d.ts.map +0 -1
- package/dist/blocks/EmptyState.block.d.ts +0 -3
- package/dist/blocks/EmptyState.block.d.ts.map +0 -1
- package/dist/blocks/FAQSection.block.d.ts +0 -3
- package/dist/blocks/FAQSection.block.d.ts.map +0 -1
- package/dist/blocks/FeatureGrid.block.d.ts +0 -3
- package/dist/blocks/FeatureGrid.block.d.ts.map +0 -1
- package/dist/blocks/HeroSection.block.d.ts +0 -3
- package/dist/blocks/HeroSection.block.d.ts.map +0 -1
- package/dist/blocks/NavigationHeader.block.d.ts +0 -3
- package/dist/blocks/NavigationHeader.block.d.ts.map +0 -1
- package/dist/blocks/PaginatedTable.block.d.ts +0 -3
- package/dist/blocks/PaginatedTable.block.d.ts.map +0 -1
- package/dist/blocks/PricingComparison.block.d.ts +0 -3
- package/dist/blocks/PricingComparison.block.d.ts.map +0 -1
- package/dist/blocks/ProductCard.block.d.ts +0 -3
- package/dist/blocks/ProductCard.block.d.ts.map +0 -1
- package/dist/blocks/RegistrationForm.block.d.ts +0 -3
- package/dist/blocks/RegistrationForm.block.d.ts.map +0 -1
- package/dist/blocks/SettingsDrawer.block.d.ts +0 -3
- package/dist/blocks/SettingsDrawer.block.d.ts.map +0 -1
- package/dist/blocks/SettingsPanel.block.d.ts +0 -3
- package/dist/blocks/SettingsPanel.block.d.ts.map +0 -1
- package/dist/blocks/ShoppingCart.block.d.ts +0 -3
- package/dist/blocks/ShoppingCart.block.d.ts.map +0 -1
- package/dist/blocks/StatsCardSkeleton.block.d.ts +0 -3
- package/dist/blocks/StatsCardSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/TableSkeleton.block.d.ts +0 -3
- package/dist/blocks/TableSkeleton.block.d.ts.map +0 -1
- package/dist/blocks/ThinkingStates.block.d.ts +0 -3
- package/dist/blocks/ThinkingStates.block.d.ts.map +0 -1
- package/dist/components/Toggle/index.d.ts +0 -3
- package/dist/components/Toggle/index.d.ts.map +0 -1
- package/src/components/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
- package/src/components/Toggle/index.ts +0 -7
- package/src/tokens/_density.scss +0 -85
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "Chip",
|
|
4
|
-
"description": "
|
|
5
|
-
"category": "
|
|
4
|
+
"description": "Pill control for filtering, multi-select, and removable tags.",
|
|
5
|
+
"category": "inputs",
|
|
6
6
|
"tags": ["chip", "tag", "filter", "selection", "multi-select", "action"],
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"sourcePath": "src/components/Chip/index.tsx",
|
|
9
9
|
"exportName": "Chip",
|
|
10
10
|
"propsSummary": [
|
|
11
11
|
"children: node (required)",
|
|
12
|
-
"variant:
|
|
12
|
+
"variant: solid|outline|soft (default: solid)",
|
|
13
13
|
"size: xs|sm|md|lg (default: xs)",
|
|
14
14
|
"selected: boolean (default: false)",
|
|
15
15
|
"icon: node",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"variant": {
|
|
29
29
|
"type": "enum",
|
|
30
|
-
"description": "
|
|
31
|
-
"default": "
|
|
30
|
+
"description": "Chrome family. solid is the tinted pill; outline is hairline-bordered; soft is info-tinted for a suggestion",
|
|
31
|
+
"default": "solid",
|
|
32
32
|
"required": false,
|
|
33
|
-
"values": ["
|
|
33
|
+
"values": ["solid", "outline", "soft"]
|
|
34
34
|
},
|
|
35
35
|
"size": {
|
|
36
36
|
"type": "enum",
|
|
@@ -79,77 +79,70 @@
|
|
|
79
79
|
},
|
|
80
80
|
"usage": {
|
|
81
81
|
"when": [
|
|
82
|
-
"Filtering
|
|
83
|
-
"Multi-select
|
|
84
|
-
"
|
|
85
|
-
"Displaying removable user-applied filters"
|
|
82
|
+
"Filtering a list by tag or category",
|
|
83
|
+
"Multi-select from a compact set",
|
|
84
|
+
"Showing filters the user can dismiss"
|
|
86
85
|
],
|
|
87
86
|
"whenNot": [
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
87
|
+
"Read-only status — use Badge",
|
|
88
|
+
"Switching views — use Tabs",
|
|
89
|
+
"On/off state — use Switch",
|
|
90
|
+
"A main call to action — use Button"
|
|
92
91
|
],
|
|
93
92
|
"guidelines": [
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"Keep
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"Provide an explicit value on Chip when using non-string/custom JSX children inside Chip.Group"
|
|
93
|
+
"One to three words per chip",
|
|
94
|
+
"Chip.Group when chips share selection state",
|
|
95
|
+
"Keep xs for filters and tags; size up only to match a taller control track",
|
|
96
|
+
"onRemove only when the chip is genuinely dismissible",
|
|
97
|
+
"Pass an explicit value when children are custom JSX"
|
|
100
98
|
],
|
|
101
99
|
"accessibility": [
|
|
102
|
-
"Chips are buttons
|
|
103
|
-
"
|
|
104
|
-
"Remove buttons
|
|
105
|
-
"Disabled chips are
|
|
100
|
+
"Chips are buttons; selection is reported via aria-pressed",
|
|
101
|
+
"Add role and aria-label to Chip.Group when the set needs a name",
|
|
102
|
+
"Remove buttons carry the chip text in their aria-label",
|
|
103
|
+
"Disabled chips are skipped by keyboard and pointer"
|
|
106
104
|
]
|
|
107
105
|
},
|
|
108
106
|
"examples": [
|
|
109
107
|
{
|
|
110
|
-
"name": "
|
|
111
|
-
"description": "
|
|
112
|
-
"code": "<Chip>
|
|
108
|
+
"name": "Variants",
|
|
109
|
+
"description": "Tinted, hairline, and accent-soft chrome.",
|
|
110
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" wrap>\n <Chip variant=\"solid\">Solid</Chip>\n <Chip variant=\"outline\">Outline</Chip>\n <Chip variant=\"soft\">Soft</Chip>\n</Stack>"
|
|
113
111
|
},
|
|
114
112
|
{
|
|
115
|
-
"name": "
|
|
116
|
-
"description": "
|
|
117
|
-
"code": "
|
|
113
|
+
"name": "Sizes",
|
|
114
|
+
"description": "xs for filter rows; larger sizes match taller field tracks.",
|
|
115
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" align=\"center\" wrap>\n <Chip variant=\"outline\" size=\"xs\">Extra small</Chip>\n <Chip variant=\"outline\" size=\"sm\">Small</Chip>\n <Chip variant=\"outline\" size=\"md\">Medium</Chip>\n <Chip variant=\"outline\" size=\"lg\">Large</Chip>\n</Stack>"
|
|
118
116
|
},
|
|
119
117
|
{
|
|
120
118
|
"name": "Selected",
|
|
121
|
-
"description": "
|
|
122
|
-
"code": "<Stack direction=\"row\" gap=\"sm\" wrap>\n <Chip selected>
|
|
119
|
+
"description": "All three variants share one selection treatment.",
|
|
120
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" wrap>\n <Chip selected>Solid</Chip>\n <Chip variant=\"outline\" selected>Outline</Chip>\n <Chip variant=\"soft\" selected>Soft</Chip>\n</Stack>"
|
|
123
121
|
},
|
|
124
122
|
{
|
|
125
123
|
"name": "With Avatar",
|
|
126
|
-
"description": "
|
|
124
|
+
"description": "Leading face, for people-shaped selections.",
|
|
127
125
|
"code": "<Chip avatar={<img src=\"https://i.pravatar.cc/32?u=chip\" alt=\"\" />}>\n Jane Doe\n</Chip>"
|
|
128
126
|
},
|
|
129
127
|
{
|
|
130
128
|
"name": "With Remove",
|
|
131
|
-
"description": "
|
|
132
|
-
"code": "
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"name": "Selected Removable",
|
|
136
|
-
"description": "Selected removable chips retain the shared selection treatment across variants",
|
|
137
|
-
"code": "<Stack direction=\"row\" gap=\"sm\" wrap>\n <Chip selected onRemove={() => {}}>Filled</Chip>\n <Chip variant=\"outlined\" selected onRemove={() => {}}>Outlined</Chip>\n <Chip variant=\"soft\" selected onRemove={() => {}}>Soft</Chip>\n</Stack>"
|
|
129
|
+
"description": "Trailing dismiss button clears the tag.",
|
|
130
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" wrap>\n <Chip variant=\"outline\" onRemove={() => {}}>React</Chip>\n <Chip variant=\"outline\" selected onRemove={() => {}}>TypeScript</Chip>\n <Chip variant=\"soft\" onRemove={() => {}}>SCSS</Chip>\n</Stack>"
|
|
138
131
|
},
|
|
139
132
|
{
|
|
140
133
|
"name": "Chip Group",
|
|
141
|
-
"description": "
|
|
134
|
+
"description": "Selection state is held by the group, not each chip.",
|
|
142
135
|
"code": "<Chip.Group defaultValue={['react']}>\n <Chip value=\"react\">React</Chip>\n <Chip value=\"vue\">Vue</Chip>\n <Chip value=\"angular\">Angular</Chip>\n <Chip value=\"svelte\">Svelte</Chip>\n</Chip.Group>"
|
|
143
136
|
},
|
|
144
137
|
{
|
|
145
138
|
"name": "Chip Group with Custom Labels",
|
|
146
|
-
"description": "
|
|
139
|
+
"description": "Custom JSX children need an explicit value.",
|
|
147
140
|
"code": "<Chip.Group aria-label=\"Assignees\">\n <Chip value=\"jane\">\n <span>Jane Doe</span>\n </Chip>\n <Chip value=\"sam\">\n <span>Sam Lee</span>\n </Chip>\n</Chip.Group>"
|
|
148
141
|
},
|
|
149
142
|
{
|
|
150
143
|
"name": "Disabled",
|
|
151
|
-
"description": "
|
|
152
|
-
"code": "
|
|
144
|
+
"description": "Dimmed and unreachable, selected or not.",
|
|
145
|
+
"code": "import { Stack } from '@/components/Stack';\n\n<Stack direction=\"row\" gap=\"sm\" wrap>\n <Chip variant=\"outline\" disabled>Disabled</Chip>\n <Chip variant=\"outline\" disabled selected>Disabled selected</Chip>\n</Stack>"
|
|
153
146
|
}
|
|
154
147
|
],
|
|
155
148
|
"relations": [
|
|
@@ -172,7 +165,7 @@
|
|
|
172
165
|
"contract": {
|
|
173
166
|
"propsSummary": [
|
|
174
167
|
"children: ReactNode - chip label (required)",
|
|
175
|
-
"variant:
|
|
168
|
+
"variant: solid|outline|soft - chrome family",
|
|
176
169
|
"size: xs|sm|md|lg - chip size (xs by default)",
|
|
177
170
|
"selected: boolean - selection state",
|
|
178
171
|
"icon/avatar: ReactNode - leading visual",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "../../tokens/variables" as *;
|
|
2
2
|
@use "../../tokens/mixins" as *;
|
|
3
|
+
@use "../../tokens/measurements.generated" as measurements;
|
|
3
4
|
@use "../../recipes/action";
|
|
4
5
|
@use "../../recipes/layout";
|
|
5
6
|
|
|
@@ -13,7 +14,8 @@
|
|
|
13
14
|
|
|
14
15
|
&:active:not(:disabled) {
|
|
15
16
|
background-color: var(--fui-field-selection-bg-hover, $fui-bg-hover);
|
|
16
|
-
box-shadow: inset 0 0 0
|
|
17
|
+
box-shadow: inset 0 0 0 var(--fui-stroke-hairline, #{$fui-stroke-hairline})
|
|
18
|
+
var(--fui-field-selection-border, $fui-border-strong);
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -24,12 +26,11 @@
|
|
|
24
26
|
|
|
25
27
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
26
28
|
white-space: nowrap;
|
|
27
|
-
user-select: none;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.withRemove {
|
|
31
|
-
border-
|
|
32
|
-
border-
|
|
32
|
+
border-start-end-radius: var(--fui-radius-none, #{$fui-radius-none});
|
|
33
|
+
border-end-end-radius: var(--fui-radius-none, #{$fui-radius-none});
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// Sizes
|
|
@@ -49,8 +50,8 @@
|
|
|
49
50
|
@include action.size("lg");
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
// Variants
|
|
53
|
-
.
|
|
53
|
+
// Variants — chrome only
|
|
54
|
+
.solid {
|
|
54
55
|
background-color: var(--fui-bg-tertiary, $fui-bg-tertiary);
|
|
55
56
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
56
57
|
|
|
@@ -67,10 +68,10 @@
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
.
|
|
71
|
+
.outline {
|
|
71
72
|
background-color: transparent;
|
|
72
73
|
color: var(--fui-text-primary, $fui-text-primary);
|
|
73
|
-
border: var(--fui-stroke-hairline,
|
|
74
|
+
border: var(--fui-stroke-hairline, #{$fui-stroke-hairline}) solid var(--fui-border, $fui-border);
|
|
74
75
|
|
|
75
76
|
&:hover:not(:disabled) {
|
|
76
77
|
background-color: var(--fui-bg-hover, $fui-bg-hover);
|
|
@@ -110,23 +111,23 @@
|
|
|
110
111
|
align-items: center;
|
|
111
112
|
|
|
112
113
|
img {
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
inline-size: var(--fui-icon-md, $fui-icon-md);
|
|
115
|
+
block-size: var(--fui-icon-md, $fui-icon-md);
|
|
115
116
|
border-radius: var(--fui-radius-full, $fui-radius-full);
|
|
116
117
|
object-fit: cover;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
.xs & {
|
|
120
121
|
img {
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
inline-size: var(--fui-icon-sm, $fui-icon-sm);
|
|
123
|
+
block-size: var(--fui-icon-sm, $fui-icon-sm);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
.sm & {
|
|
127
128
|
img {
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
inline-size: var(--fui-icon-sm, $fui-icon-sm);
|
|
130
|
+
block-size: var(--fui-icon-sm, $fui-icon-sm);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
}
|
|
@@ -149,13 +150,13 @@
|
|
|
149
150
|
@include action.base;
|
|
150
151
|
|
|
151
152
|
color: var(--fui-text-secondary, $fui-text-secondary);
|
|
152
|
-
border-
|
|
153
|
-
border-
|
|
154
|
-
border-
|
|
155
|
-
border-
|
|
153
|
+
border-start-end-radius: var(--fui-radius-full, $fui-radius-full);
|
|
154
|
+
border-end-end-radius: var(--fui-radius-full, $fui-radius-full);
|
|
155
|
+
border-start-start-radius: var(--fui-radius-none, #{$fui-radius-none});
|
|
156
|
+
border-end-start-radius: var(--fui-radius-none, #{$fui-radius-none});
|
|
156
157
|
background-color: transparent;
|
|
157
|
-
border: var(--fui-stroke-hairline,
|
|
158
|
-
border-
|
|
158
|
+
border: var(--fui-stroke-hairline, #{$fui-stroke-hairline}) solid transparent;
|
|
159
|
+
border-inline-start-color: var(--fui-border, $fui-border);
|
|
159
160
|
|
|
160
161
|
.removableChip[data-size="xs"] & {
|
|
161
162
|
@include action.icon-only("micro");
|
|
@@ -180,7 +181,7 @@
|
|
|
180
181
|
|
|
181
182
|
// Match remove button visuals to chip variant/state so the compound control
|
|
182
183
|
// remains visually coherent across seeds/themes.
|
|
183
|
-
.
|
|
184
|
+
.solid + .remove {
|
|
184
185
|
background-color: var(--fui-bg-tertiary, $fui-bg-tertiary);
|
|
185
186
|
|
|
186
187
|
&:hover:not(:disabled) {
|
|
@@ -192,7 +193,7 @@
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
.
|
|
196
|
+
.outline + .remove {
|
|
196
197
|
background-color: transparent;
|
|
197
198
|
|
|
198
199
|
&:hover:not(:disabled) {
|
|
@@ -219,7 +220,7 @@
|
|
|
219
220
|
|
|
220
221
|
.selected + .remove {
|
|
221
222
|
@include selected-surface;
|
|
222
|
-
border-
|
|
223
|
+
border-inline-start-color: transparent;
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
// Chip.Group
|
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import styles from "./Chip.module.scss";
|
|
5
|
+
import { isProductionBuild } from "../../utils/env";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Chip for selections, filters, and tags. Use with Chip.Group for multi-select.
|
|
8
9
|
* @see https://usefragments.com/components/chip
|
|
9
10
|
*/
|
|
11
|
+
export type ChipVariant = "solid" | "outline" | "soft";
|
|
12
|
+
|
|
10
13
|
export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
11
14
|
children: React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
15
|
+
/** Chrome family.
|
|
16
|
+
*
|
|
17
|
+
* - `solid` (default): tinted pill for filters and tags.
|
|
18
|
+
* - `outline`: hairline-bordered, transparent.
|
|
19
|
+
* - `soft`: info-tinted, for a chip that carries a suggestion.
|
|
20
|
+
* @default "solid"
|
|
14
21
|
* @see https://usefragments.com/components/chip#variants */
|
|
15
|
-
variant?:
|
|
22
|
+
variant?: ChipVariant;
|
|
16
23
|
/** Chip size.
|
|
17
24
|
* @default "xs" */
|
|
18
25
|
size?: "xs" | "sm" | "md" | "lg";
|
|
@@ -44,7 +51,7 @@ export interface ChipGroupProps extends Omit<
|
|
|
44
51
|
const ChipBase = React.forwardRef<HTMLButtonElement, ChipProps>(function Chip(
|
|
45
52
|
{
|
|
46
53
|
children,
|
|
47
|
-
variant
|
|
54
|
+
variant = "solid",
|
|
48
55
|
size: sizeProp,
|
|
49
56
|
selected = false,
|
|
50
57
|
disabled = false,
|
|
@@ -59,8 +66,6 @@ const ChipBase = React.forwardRef<HTMLButtonElement, ChipProps>(function Chip(
|
|
|
59
66
|
ref
|
|
60
67
|
) {
|
|
61
68
|
const size = sizeProp ?? "xs";
|
|
62
|
-
// Resolve alias: "outline" → "outlined"
|
|
63
|
-
const variant = variantProp === "outline" ? "outlined" : variantProp;
|
|
64
69
|
|
|
65
70
|
const classes = [
|
|
66
71
|
styles.chip,
|
|
@@ -165,7 +170,7 @@ function ChipGroupInner(
|
|
|
165
170
|
if (child.props.value != null) return child.props.value;
|
|
166
171
|
if (typeof child.props.children === "string") return child.props.children;
|
|
167
172
|
if (child.key != null) return String(child.key);
|
|
168
|
-
if (
|
|
173
|
+
if (!isProductionBuild()) {
|
|
169
174
|
// Non-string labels need an explicit value to avoid unstable group selection keys.
|
|
170
175
|
console.warn(
|
|
171
176
|
"Chip.Group: Chips with non-string children should provide a `value` prop."
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
3
|
"name": "CodeBlock",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Shows code with syntax colors, a copy button, and diff or collapse when you need them.",
|
|
5
5
|
"category": "display",
|
|
6
|
-
"tags": [
|
|
7
|
-
"code",
|
|
8
|
-
"syntax",
|
|
9
|
-
"highlighting",
|
|
10
|
-
"documentation",
|
|
11
|
-
"developer",
|
|
12
|
-
"diff"
|
|
13
|
-
],
|
|
6
|
+
"tags": ["code", "syntax", "highlighting", "documentation", "developer", "diff"],
|
|
14
7
|
"status": "stable",
|
|
15
8
|
"dependencies": [
|
|
16
9
|
{
|
|
@@ -24,7 +17,7 @@
|
|
|
24
17
|
"propsSummary": [
|
|
25
18
|
"code: string (required)",
|
|
26
19
|
"language: tsx|typescript|ts|javascript|js|jsx|bash|shell|css|scss|sass|json|html|xml|markdown|md|yaml|yml|python|py|ruby|go|rust|java|kotlin|swift|c|cpp|csharp|php|sql|graphql|diff|plaintext|text (default: tsx)",
|
|
27
|
-
"theme: synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default:
|
|
20
|
+
"theme: css-variables|synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default: css-variables)",
|
|
28
21
|
"showCopy: boolean (default: true)",
|
|
29
22
|
"title: string",
|
|
30
23
|
"filename: string",
|
|
@@ -96,10 +89,11 @@
|
|
|
96
89
|
},
|
|
97
90
|
"theme": {
|
|
98
91
|
"type": "enum",
|
|
99
|
-
"description": "Syntax highlighting theme",
|
|
100
|
-
"default": "
|
|
92
|
+
"description": "Syntax highlighting theme. css-variables maps spans onto --fui-code-token-* so both themes stay readable.",
|
|
93
|
+
"default": "css-variables",
|
|
101
94
|
"required": false,
|
|
102
95
|
"values": [
|
|
96
|
+
"css-variables",
|
|
103
97
|
"synthwave-84",
|
|
104
98
|
"github-dark",
|
|
105
99
|
"github-light",
|
|
@@ -190,6 +184,12 @@
|
|
|
190
184
|
"default": "5",
|
|
191
185
|
"required": false
|
|
192
186
|
},
|
|
187
|
+
"collapseAction": {
|
|
188
|
+
"type": "\"lines\" | \"expand\"",
|
|
189
|
+
"description": "Collapse control copy: line-count bar, or a single Expand / Collapse control",
|
|
190
|
+
"default": "lines",
|
|
191
|
+
"required": false
|
|
192
|
+
},
|
|
193
193
|
"compact": {
|
|
194
194
|
"type": "boolean",
|
|
195
195
|
"description": "Compact mode with reduced padding",
|
|
@@ -207,11 +207,7 @@
|
|
|
207
207
|
"description": "Where to place the copy button when not using persistentCopy",
|
|
208
208
|
"default": "auto",
|
|
209
209
|
"required": false,
|
|
210
|
-
"values": [
|
|
211
|
-
"auto",
|
|
212
|
-
"header",
|
|
213
|
-
"overlay"
|
|
214
|
-
]
|
|
210
|
+
"values": ["auto", "header", "overlay"]
|
|
215
211
|
},
|
|
216
212
|
"bg": {
|
|
217
213
|
"type": "string",
|
|
@@ -226,118 +222,97 @@
|
|
|
226
222
|
},
|
|
227
223
|
"usage": {
|
|
228
224
|
"when": [
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"Teaching programming concepts",
|
|
233
|
-
"Showing code diffs or changes",
|
|
234
|
-
"Displaying long code files with collapse functionality"
|
|
225
|
+
"Code examples inside prose or docs",
|
|
226
|
+
"Install and config snippets",
|
|
227
|
+
"Showing what changed, as a diff"
|
|
235
228
|
],
|
|
236
229
|
"whenNot": [
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"Non-code content (use Text or Card)"
|
|
230
|
+
"The user needs to edit it (use an editor)",
|
|
231
|
+
"A couple of words inline (use a code element)"
|
|
240
232
|
],
|
|
241
233
|
"guidelines": [
|
|
242
|
-
"
|
|
243
|
-
"
|
|
244
|
-
"
|
|
245
|
-
"
|
|
246
|
-
"
|
|
247
|
-
"
|
|
248
|
-
"Use addedLines/removedLines for diff highlighting",
|
|
249
|
-
"Set maxHeight for very long code blocks to prevent layout issues",
|
|
250
|
-
"Use collapsible for code samples that users may want to skim",
|
|
251
|
-
"Choose a theme that matches your documentation style",
|
|
252
|
-
"Keep code examples concise and focused",
|
|
253
|
-
"Use CodeBlock.Tabbed for multi-language snippets; tabs support controlled value/onValueChange and explicit tab values"
|
|
234
|
+
"Set language every time — wrong highlighting is worse than none",
|
|
235
|
+
"filename for a real file, title for a label, caption for the aside",
|
|
236
|
+
"Line numbers earn their keep once you need to point at a line",
|
|
237
|
+
"highlightLines for emphasis; addedLines and removedLines for diffs",
|
|
238
|
+
"maxHeight or collapsible keeps a long file from swallowing the page",
|
|
239
|
+
"CodeBlock.Tabbed groups the same snippet across languages"
|
|
254
240
|
],
|
|
255
241
|
"accessibility": [
|
|
256
|
-
"
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"Collapse button has aria-expanded state"
|
|
242
|
+
"Renders as semantic pre and code",
|
|
243
|
+
"The copy button is labelled and keyboard reachable",
|
|
244
|
+
"The collapse toggle reports aria-expanded"
|
|
260
245
|
]
|
|
261
246
|
},
|
|
262
247
|
"examples": [
|
|
263
248
|
{
|
|
264
249
|
"name": "Default",
|
|
265
|
-
"description": "
|
|
250
|
+
"description": "Pass code and language; highlighting and copy come free.",
|
|
266
251
|
"code": "<CodeBlock code={`import { Button } from '@usefragments/ui';\n\nfunction App() {\n return <Button>Click me</Button>;\n}`} language=\"tsx\" />"
|
|
267
252
|
},
|
|
268
253
|
{
|
|
269
254
|
"name": "With Filename",
|
|
270
|
-
"description": "
|
|
255
|
+
"description": "A header bar names the source file and holds the copy button.",
|
|
271
256
|
"code": "<CodeBlock filename=\"app.tsx\" code={`import { Button, Card } from '@usefragments/ui';\n\nfunction App() {\n return (\n <Card>\n <Card.Header>Welcome</Card.Header>\n <Card.Content>\n <Button>Get Started</Button>\n </Card.Content>\n </Card>\n );\n}`} language=\"tsx\" />"
|
|
272
257
|
},
|
|
273
258
|
{
|
|
274
259
|
"name": "With Title",
|
|
275
|
-
"description": "
|
|
260
|
+
"description": "A label above the block, outside the code surface.",
|
|
276
261
|
"code": "<CodeBlock title=\"Installation\" code=\"npm install @usefragments/ui\" language=\"bash\" />"
|
|
277
262
|
},
|
|
278
263
|
{
|
|
279
264
|
"name": "With Caption",
|
|
280
|
-
"description": "
|
|
265
|
+
"description": "A footer line for the aside that does not belong in the code.",
|
|
281
266
|
"code": "<CodeBlock\n code={`const API_URL = process.env.NEXT_PUBLIC_API_URL;`}\n language=\"typescript\"\n caption=\"Environment variables must be prefixed with NEXT_PUBLIC_ to be available in the browser.\"\n/>"
|
|
282
267
|
},
|
|
283
268
|
{
|
|
284
269
|
"name": "With Line Numbers",
|
|
285
|
-
"description": "
|
|
270
|
+
"description": "Turn these on once a snippet is long enough to point at.",
|
|
286
271
|
"code": "<CodeBlock code={`const greeting = \"Hello\";\nconst name = \"World\";\nconsole.log(\\`\\${greeting}, \\${name}!\\`);`} language=\"typescript\" showLineNumbers />"
|
|
287
272
|
},
|
|
288
273
|
{
|
|
289
274
|
"name": "Custom Start Line",
|
|
290
|
-
"description": "
|
|
275
|
+
"description": "Numbering starts where the excerpt actually starts in the file.",
|
|
291
276
|
"code": "<CodeBlock\n code={` return (\n <button onClick={() => setCount(c => c + 1)}>\n Count: {count}\n </button>\n );\n}`}\n language=\"tsx\"\n showLineNumbers\n startLineNumber={15}\n caption=\"Lines 15-20 from Counter.tsx\"\n/>"
|
|
292
277
|
},
|
|
293
278
|
{
|
|
294
279
|
"name": "With Highlighted Lines",
|
|
295
|
-
"description": "
|
|
280
|
+
"description": "Marks the lines the prose is talking about.",
|
|
296
281
|
"code": "<CodeBlock code={`import { useState } from 'react';\n\nfunction Counter() {\n const [count, setCount] = useState(0);\n\n return (\n <button onClick={() => setCount(c => c + 1)}>\n Count: {count}\n </button>\n );\n}`} language=\"tsx\" showLineNumbers highlightLines={[4, '7-9']} />"
|
|
297
282
|
},
|
|
298
283
|
{
|
|
299
284
|
"name": "Diff View",
|
|
300
|
-
"description": "
|
|
285
|
+
"description": "Added and removed lines, side by side with the rest.",
|
|
301
286
|
"code": "<CodeBlock\n code={`import { useState } from 'react';\nimport { useCallback } from 'react';\n\nfunction Counter() {\n const [count, setCount] = useState(0);\n const increment = () => setCount(c => c + 1);\n const increment = useCallback(() => setCount(c => c + 1), []);\n\n return <button onClick={increment}>Count: {count}</button>;\n}`}\n language=\"tsx\"\n showLineNumbers\n removedLines={[6]}\n addedLines={[2, 7]}\n/>"
|
|
302
287
|
},
|
|
303
288
|
{
|
|
304
|
-
"name": "
|
|
305
|
-
"description": "
|
|
289
|
+
"name": "Custom Theme",
|
|
290
|
+
"description": "Any Shiki theme works — pass its name to theme.",
|
|
306
291
|
"code": "<CodeBlock\n code={`async function fetchUser(id: string) {\n const response = await fetch(\\`/api/users/\\${id}\\`);\n return response.json();\n}`}\n language=\"typescript\"\n theme=\"github-dark\"\n/>"
|
|
307
292
|
},
|
|
308
|
-
{
|
|
309
|
-
"name": "GitHub Light Theme",
|
|
310
|
-
"description": "Using the GitHub Light theme for light backgrounds",
|
|
311
|
-
"code": "<CodeBlock\n code={`def fibonacci(n):\n if n <= 1:\n return n\n return fibonacci(n - 1) + fibonacci(n - 2)`}\n language=\"python\"\n theme=\"github-light\"\n/>"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"name": "Dracula Theme",
|
|
315
|
-
"description": "Using the popular Dracula theme",
|
|
316
|
-
"code": "<CodeBlock\n code={`fn main() {\n println!(\"Hello, Rust!\");\n}`}\n language=\"rust\"\n theme=\"dracula\"\n/>"
|
|
317
|
-
},
|
|
318
293
|
{
|
|
319
294
|
"name": "Word Wrap",
|
|
320
|
-
"description": "Long lines
|
|
295
|
+
"description": "Long lines break instead of scrolling sideways.",
|
|
321
296
|
"code": "<CodeBlock\n code={`const longString = \"This is a very long string that would normally cause horizontal scrolling, but with word wrap enabled it will break to the next line instead.\";`}\n language=\"typescript\"\n wordWrap\n/>"
|
|
322
297
|
},
|
|
323
298
|
{
|
|
324
299
|
"name": "Max Height with Scroll",
|
|
325
|
-
"description": "
|
|
300
|
+
"description": "Caps the height so one snippet cannot own the page.",
|
|
326
301
|
"code": "<CodeBlock\n code={`// This code block has a maximum height\nfunction processItems(items: string[]) {\n const results = [];\n for (const item of items) {\n if (item.startsWith('_')) {\n continue;\n }\n const processed = item.trim().toLowerCase();\n if (processed.length > 0) {\n results.push(processed);\n }\n }\n return results;\n}\n\nexport default processItems;`}\n language=\"typescript\"\n maxHeight={150}\n showLineNumbers\n/>"
|
|
327
302
|
},
|
|
328
303
|
{
|
|
329
304
|
"name": "Collapsible",
|
|
330
|
-
"description": "
|
|
305
|
+
"description": "Shows the opening lines and hides the rest behind a toggle.",
|
|
331
306
|
"code": "<CodeBlock\n code={`import React, { useState, useEffect } from 'react';\n\ninterface User {\n id: string;\n name: string;\n email: string;\n avatar?: string;\n}\n\nexport function UserProfile({ userId }: { userId: string }) {\n const [user, setUser] = useState<User | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n async function fetchUser() {\n try {\n setLoading(true);\n const response = await fetch(\\`/api/users/\\${userId}\\`);\n if (!response.ok) throw new Error('Failed to fetch');\n const data = await response.json();\n setUser(data);\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Unknown error');\n } finally {\n setLoading(false);\n }\n }\n fetchUser();\n }, [userId]);\n\n if (loading) return <div>Loading...</div>;\n if (error) return <div>Error: {error}</div>;\n if (!user) return null;\n\n return (\n <div>\n <h1>{user.name}</h1>\n <p>{user.email}</p>\n </div>\n );\n}`}\n language=\"tsx\"\n showLineNumbers\n collapsible\n defaultCollapsed\n collapsedLines={8}\n/>"
|
|
332
307
|
},
|
|
333
308
|
{
|
|
334
309
|
"name": "JSON",
|
|
335
|
-
"description": "
|
|
310
|
+
"description": "Config files highlight the same way source does.",
|
|
336
311
|
"code": "<CodeBlock title=\"package.json\" code={`{\n \"name\": \"my-app\",\n \"dependencies\": {\n \"@usefragments/ui\": \"^0.3.0\"\n }\n}`} language=\"json\" />"
|
|
337
312
|
},
|
|
338
313
|
{
|
|
339
314
|
"name": "Without Copy Button",
|
|
340
|
-
"description": "
|
|
315
|
+
"description": "Drop the copy button when the snippet is not meant to be reused.",
|
|
341
316
|
"code": "<CodeBlock code=\"const simple = true;\" language=\"typescript\" showCopy={false} />"
|
|
342
317
|
}
|
|
343
318
|
],
|
|
@@ -357,7 +332,7 @@
|
|
|
357
332
|
"propsSummary": [
|
|
358
333
|
"code: string - required code content",
|
|
359
334
|
"language: tsx|typescript|javascript|jsx|bash|shell|css|scss|sass|json|html|xml|markdown|md|yaml|yml|python|py|ruby|go|rust|java|kotlin|swift|c|cpp|csharp|php|sql|graphql|diff|plaintext",
|
|
360
|
-
"theme: synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default:
|
|
335
|
+
"theme: css-variables|synthwave-84|github-dark|github-light|one-dark-pro|dracula|nord|monokai|vitesse-dark|vitesse-light|min-dark|min-light (default: css-variables)",
|
|
361
336
|
"showCopy: boolean (default: true)",
|
|
362
337
|
"copyPlacement: auto|header|overlay (default: auto)",
|
|
363
338
|
"title: string - optional external label",
|
|
@@ -373,18 +348,13 @@
|
|
|
373
348
|
"collapsible: boolean (default: false)",
|
|
374
349
|
"defaultCollapsed: boolean (default: false)",
|
|
375
350
|
"collapsedLines: number (default: 5)",
|
|
376
|
-
"CodeBlock.Tabbed: tabs[] plus optional defaultTab/value/onValueChange for multi-language snippets"
|
|
351
|
+
"CodeBlock.Tabbed: tabs[] plus optional defaultTab/value/onValueChange for multi-language snippets; collapsible/defaultCollapsed/collapsedLines forward to every panel"
|
|
377
352
|
],
|
|
378
|
-
"a11yRules": [
|
|
379
|
-
"A11Y_CODE_SEMANTIC",
|
|
380
|
-
"A11Y_BTN_LABEL"
|
|
381
|
-
]
|
|
353
|
+
"a11yRules": ["A11Y_CODE_SEMANTIC", "A11Y_BTN_LABEL"]
|
|
382
354
|
},
|
|
383
355
|
"ai": {
|
|
384
356
|
"compositionPattern": "compound",
|
|
385
|
-
"subComponents": [
|
|
386
|
-
"Tabbed"
|
|
387
|
-
]
|
|
357
|
+
"subComponents": ["Tabbed"]
|
|
388
358
|
},
|
|
389
359
|
"provenance": {
|
|
390
360
|
"source": "migrated",
|