@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,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",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@use "../../recipes/typography" as typography;
|
|
8
8
|
|
|
9
9
|
.container {
|
|
10
|
-
--_fui-code-inline-inset: var(--fui-raw-space-16);
|
|
10
|
+
--_fui-code-inline-inset: var(--fui-raw-space-16, 16px);
|
|
11
11
|
|
|
12
12
|
inline-size: 100%;
|
|
13
13
|
}
|
|
@@ -27,9 +27,24 @@
|
|
|
27
27
|
.wrapper {
|
|
28
28
|
position: relative;
|
|
29
29
|
overflow: hidden;
|
|
30
|
+
// A hairline keeps the block legible on any ground: the light code surface
|
|
31
|
+
// and the sunken app main share the same tone, so fill alone can vanish.
|
|
32
|
+
border: var(--fui-stroke-hairline, $fui-stroke-hairline) solid
|
|
33
|
+
var(--fui-code-border, var(--fui-border, #{$fui-border}));
|
|
30
34
|
border-radius: var(--fui-radius-lg, $fui-radius-lg);
|
|
31
35
|
background-color: var(--fui-code-bg, $fui-code-bg);
|
|
32
36
|
color: var(--fui-code-text, var(--fui-text-primary, #{$fui-text-primary}));
|
|
37
|
+
--shiki-color-text: var(--fui-code-text, var(--fui-text-primary, #{$fui-text-primary}));
|
|
38
|
+
--shiki-color-background: var(--fui-code-bg, #{$fui-code-bg});
|
|
39
|
+
--shiki-token-keyword: var(--fui-code-token-keyword, #{$fui-code-token-keyword});
|
|
40
|
+
--shiki-token-string: var(--fui-code-token-string, #{$fui-code-token-string});
|
|
41
|
+
--shiki-token-string-expression: var(--fui-code-token-string, #{$fui-code-token-string});
|
|
42
|
+
--shiki-token-comment: var(--fui-code-token-comment, #{$fui-code-token-comment});
|
|
43
|
+
--shiki-token-function: var(--fui-code-token-function, #{$fui-code-token-function});
|
|
44
|
+
--shiki-token-constant: var(--fui-code-token-number, #{$fui-code-token-number});
|
|
45
|
+
--shiki-token-parameter: var(--fui-code-token-variable, #{$fui-code-token-variable});
|
|
46
|
+
--shiki-token-punctuation: var(--fui-code-token-punctuation, #{$fui-code-token-punctuation});
|
|
47
|
+
--shiki-token-link: var(--fui-link-ink, #{$fui-link-ink});
|
|
33
48
|
}
|
|
34
49
|
|
|
35
50
|
.header {
|
|
@@ -38,7 +53,7 @@
|
|
|
38
53
|
justify-content: space-between;
|
|
39
54
|
min-block-size: action.track("md");
|
|
40
55
|
padding-inline: layout.gap("lg");
|
|
41
|
-
border-block-end: var(--fui-stroke-hairline) solid
|
|
56
|
+
border-block-end: var(--fui-stroke-hairline, $fui-stroke-hairline) solid
|
|
42
57
|
var(--fui-code-border, var(--fui-border, #{$fui-border}));
|
|
43
58
|
}
|
|
44
59
|
|
|
@@ -94,13 +109,6 @@
|
|
|
94
109
|
.copyOverlay.copied {
|
|
95
110
|
opacity: 1;
|
|
96
111
|
}
|
|
97
|
-
|
|
98
|
-
.codeContainer :global(.shiki),
|
|
99
|
-
.loading pre {
|
|
100
|
-
padding-inline-end: calc(
|
|
101
|
-
var(--_fui-code-inline-inset) + #{action.track("sm")} + var(--fui-raw-space-12)
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
.icon {
|
|
@@ -117,6 +125,18 @@
|
|
|
117
125
|
opacity: 1;
|
|
118
126
|
}
|
|
119
127
|
|
|
128
|
+
// Overlay + persistent copy both sit absolute — reserve trailing space so
|
|
129
|
+
// content-sized blocks don't collide with the control.
|
|
130
|
+
.withCopyOverlay,
|
|
131
|
+
.persistentCopyWrapper {
|
|
132
|
+
.codeContainer :global(.shiki),
|
|
133
|
+
.loading pre {
|
|
134
|
+
padding-inline-end: calc(
|
|
135
|
+
var(--_fui-code-inline-inset) + #{action.track("sm")} + var(--fui-raw-space-12, 12px)
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
120
140
|
.loading pre,
|
|
121
141
|
.codeContainer :global(.shiki) {
|
|
122
142
|
@include prose.code-block("default");
|
|
@@ -152,7 +172,7 @@
|
|
|
152
172
|
&:global(.highlighted) {
|
|
153
173
|
margin-inline: calc(-1 * var(--_fui-code-inline-inset));
|
|
154
174
|
padding-inline: var(--_fui-code-inline-inset);
|
|
155
|
-
border-inline-start: var(--fui-stroke-default) solid
|
|
175
|
+
border-inline-start: var(--fui-stroke-default, $fui-stroke-default) solid
|
|
156
176
|
var(--fui-color-info-text, $fui-color-info-text);
|
|
157
177
|
background-color: var(--fui-code-highlight-bg, var(--fui-bg-hover, #{$fui-bg-hover}));
|
|
158
178
|
}
|
|
@@ -174,7 +194,7 @@
|
|
|
174
194
|
}
|
|
175
195
|
|
|
176
196
|
:global(.shiki)::-webkit-scrollbar {
|
|
177
|
-
block-size: var(--fui-raw-space-4);
|
|
197
|
+
block-size: var(--fui-raw-space-4, 4px);
|
|
178
198
|
}
|
|
179
199
|
|
|
180
200
|
:global(.shiki)::-webkit-scrollbar-thumb {
|
|
@@ -184,7 +204,7 @@
|
|
|
184
204
|
}
|
|
185
205
|
|
|
186
206
|
.withLineNumbers .codeContainer :global(.shiki) {
|
|
187
|
-
padding-inline-start: var(--fui-raw-space-8);
|
|
207
|
+
padding-inline-start: var(--fui-raw-space-8, 8px);
|
|
188
208
|
}
|
|
189
209
|
|
|
190
210
|
.withDiff {
|
|
@@ -220,7 +240,7 @@
|
|
|
220
240
|
}
|
|
221
241
|
|
|
222
242
|
.compact {
|
|
223
|
-
--_fui-code-inline-inset: var(--fui-raw-space-12);
|
|
243
|
+
--_fui-code-inline-inset: var(--fui-raw-space-12, 12px);
|
|
224
244
|
|
|
225
245
|
.wrapper {
|
|
226
246
|
border-radius: var(--fui-radius-md, $fui-radius-md);
|
|
@@ -250,8 +270,9 @@
|
|
|
250
270
|
@include action.size("sm");
|
|
251
271
|
|
|
252
272
|
inline-size: 100%;
|
|
253
|
-
border-block-start:
|
|
254
|
-
|
|
273
|
+
border-block-start: var(--fui-stroke-hairline, $fui-stroke-hairline) solid
|
|
274
|
+
var(--fui-border, $fui-border);
|
|
275
|
+
background: var(--fui-code-bg, $fui-code-bg);
|
|
255
276
|
color: var(--fui-code-text-muted, var(--fui-text-secondary, #{$fui-text-secondary}));
|
|
256
277
|
cursor: pointer;
|
|
257
278
|
|
|
@@ -266,6 +287,10 @@
|
|
|
266
287
|
}
|
|
267
288
|
}
|
|
268
289
|
|
|
290
|
+
.collapseExpand {
|
|
291
|
+
justify-content: flex-end;
|
|
292
|
+
}
|
|
293
|
+
|
|
269
294
|
.tabbedPanel {
|
|
270
295
|
margin-block-start: 0;
|
|
271
296
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shiki theme whose token colors are CSS variables from the kit palette.
|
|
3
|
+
*
|
|
4
|
+
* Bundled shiki themes (including the old `css-variables` theme) were removed
|
|
5
|
+
* from shiki 3; this object is the replacement. `codeToHtml` accepts it as the
|
|
6
|
+
* `theme` option and writes `color: var(--fui-code-token-*)` onto spans.
|
|
7
|
+
*/
|
|
8
|
+
export const FUI_CSS_VARIABLES_THEME = {
|
|
9
|
+
name: "css-variables",
|
|
10
|
+
type: "dark" as const,
|
|
11
|
+
colors: {
|
|
12
|
+
"editor.foreground": "var(--fui-code-text)",
|
|
13
|
+
"editor.background": "var(--fui-code-bg)",
|
|
14
|
+
},
|
|
15
|
+
tokenColors: [
|
|
16
|
+
{ settings: { foreground: "var(--fui-code-text)" } },
|
|
17
|
+
{
|
|
18
|
+
scope: [
|
|
19
|
+
"comment",
|
|
20
|
+
"punctuation.definition.comment",
|
|
21
|
+
"string.comment",
|
|
22
|
+
"string.quoted.docstring.multi",
|
|
23
|
+
],
|
|
24
|
+
settings: { foreground: "var(--fui-code-token-comment)" },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
scope: [
|
|
28
|
+
"keyword",
|
|
29
|
+
"keyword.control",
|
|
30
|
+
"keyword.other",
|
|
31
|
+
"storage",
|
|
32
|
+
"storage.type",
|
|
33
|
+
"storage.modifier",
|
|
34
|
+
"storage.control.clojure",
|
|
35
|
+
],
|
|
36
|
+
settings: { foreground: "var(--fui-code-token-keyword)" },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
scope: [
|
|
40
|
+
"string",
|
|
41
|
+
"string.quoted",
|
|
42
|
+
"string.template",
|
|
43
|
+
"string.interpolated",
|
|
44
|
+
"string.regexp",
|
|
45
|
+
"string.unquoted.plain.out.yaml",
|
|
46
|
+
"markup.inline",
|
|
47
|
+
],
|
|
48
|
+
settings: { foreground: "var(--fui-code-token-string)" },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
scope: [
|
|
52
|
+
"constant.numeric",
|
|
53
|
+
"constant.language",
|
|
54
|
+
"constant.other",
|
|
55
|
+
"constant.character.format.placeholder",
|
|
56
|
+
"constant.other.placeholder",
|
|
57
|
+
],
|
|
58
|
+
settings: { foreground: "var(--fui-code-token-number)" },
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
scope: [
|
|
62
|
+
"entity.name.function",
|
|
63
|
+
"support.function",
|
|
64
|
+
"meta.function-call",
|
|
65
|
+
"meta.instance.constructor",
|
|
66
|
+
"entity.other.attribute-name",
|
|
67
|
+
"entity.name.tag",
|
|
68
|
+
"support.class.component",
|
|
69
|
+
"meta.tag",
|
|
70
|
+
],
|
|
71
|
+
settings: { foreground: "var(--fui-code-token-function)" },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
scope: [
|
|
75
|
+
"punctuation",
|
|
76
|
+
"punctuation.separator",
|
|
77
|
+
"punctuation.definition.arguments",
|
|
78
|
+
"punctuation.definition.dict",
|
|
79
|
+
"punctuation.definition.string",
|
|
80
|
+
"punctuation.definition.template-expression",
|
|
81
|
+
"meta.brace",
|
|
82
|
+
"keyword.operator",
|
|
83
|
+
"keyword.operator.accessor",
|
|
84
|
+
],
|
|
85
|
+
settings: { foreground: "var(--fui-code-token-punctuation)" },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
scope: [
|
|
89
|
+
"variable",
|
|
90
|
+
"variable.other",
|
|
91
|
+
"variable.parameter",
|
|
92
|
+
"variable.language",
|
|
93
|
+
"entity.name",
|
|
94
|
+
"support.variable",
|
|
95
|
+
"support.type",
|
|
96
|
+
"meta.property-name",
|
|
97
|
+
"meta.property-value",
|
|
98
|
+
],
|
|
99
|
+
settings: { foreground: "var(--fui-code-token-variable)" },
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
};
|