@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
|
@@ -92,7 +92,7 @@ function ThinkingSteps({ children, className, ...htmlProps }) {
|
|
|
92
92
|
const classes = [ThinkingIndicator_module.default.steps, className].filter(Boolean).join(" ");
|
|
93
93
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...htmlProps, className: classes, children });
|
|
94
94
|
}
|
|
95
|
-
function ThinkingStep({ label, status = "
|
|
95
|
+
function ThinkingStep({ label, status = "idle", className, ...htmlProps }) {
|
|
96
96
|
const classes = [
|
|
97
97
|
ThinkingIndicator_module.default.step,
|
|
98
98
|
ThinkingIndicator_module.default[`step${status.charAt(0).toUpperCase() + status.slice(1)}`],
|
|
@@ -102,18 +102,18 @@ function ThinkingStep({ label, status = "pending", className, ...htmlProps }) {
|
|
|
102
102
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: ThinkingIndicator_module.default.stepIndicator, children: [
|
|
103
103
|
status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, {}),
|
|
104
104
|
status === "error" && /* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, {}),
|
|
105
|
-
status === "
|
|
105
|
+
(status === "pending" || status === "streaming") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
106
|
index.Loading,
|
|
107
107
|
{
|
|
108
108
|
size: "sm",
|
|
109
|
-
|
|
109
|
+
kind: "spinner",
|
|
110
110
|
color: "current",
|
|
111
111
|
label: "",
|
|
112
112
|
role: "presentation",
|
|
113
113
|
"aria-hidden": "true"
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
|
-
status === "
|
|
116
|
+
status === "idle" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ThinkingIndicator_module.default.stepDot })
|
|
117
117
|
] }),
|
|
118
118
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ThinkingIndicator_module.default.stepLabel, children: label })
|
|
119
119
|
] });
|
|
@@ -121,7 +121,7 @@ function ThinkingStep({ label, status = "pending", className, ...htmlProps }) {
|
|
|
121
121
|
function ThinkingIndicatorRoot({
|
|
122
122
|
active = true,
|
|
123
123
|
label = "Thinking...",
|
|
124
|
-
|
|
124
|
+
kind = "dots",
|
|
125
125
|
showElapsed = false,
|
|
126
126
|
steps,
|
|
127
127
|
className,
|
|
@@ -130,18 +130,17 @@ function ThinkingIndicatorRoot({
|
|
|
130
130
|
const elapsedTime = useElapsedTime(active && showElapsed);
|
|
131
131
|
const contextValue = {
|
|
132
132
|
active,
|
|
133
|
-
|
|
133
|
+
kind
|
|
134
134
|
};
|
|
135
135
|
if (!active) return null;
|
|
136
136
|
const classes = [ThinkingIndicator_module.default.thinkingIndicator, className].filter(Boolean).join(" ");
|
|
137
|
-
const loadingVariant = variant === "dots" ? "dots" : variant === "pulse" ? "pulse" : "spinner";
|
|
138
137
|
return /* @__PURE__ */ jsxRuntime.jsx(ThinkingIndicatorContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ...htmlProps, className: classes, role: "status", "aria-label": label, "aria-live": "polite", children: [
|
|
139
138
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ThinkingIndicator_module.default.main, children: [
|
|
140
139
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
141
140
|
index.Loading,
|
|
142
141
|
{
|
|
143
142
|
size: "sm",
|
|
144
|
-
|
|
143
|
+
kind,
|
|
145
144
|
color: "muted",
|
|
146
145
|
label: "",
|
|
147
146
|
role: "presentation",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export type
|
|
3
|
-
|
|
2
|
+
export type ThinkingKind = "dots" | "pulse" | "spinner";
|
|
3
|
+
/** Shared lifecycle axis: `idle` waits, `pending`/`streaming` are in flight. */
|
|
4
|
+
export type StepStatus = "idle" | "pending" | "streaming" | "complete" | "error";
|
|
4
5
|
export interface ThinkingStep {
|
|
5
6
|
id: string;
|
|
6
7
|
label: string;
|
|
@@ -12,7 +13,7 @@ export interface ThinkingIndicatorProps extends React.HTMLAttributes<HTMLDivElem
|
|
|
12
13
|
/** Status text */
|
|
13
14
|
label?: string;
|
|
14
15
|
/** Animation style */
|
|
15
|
-
|
|
16
|
+
kind?: ThinkingKind;
|
|
16
17
|
/** Show elapsed time */
|
|
17
18
|
showElapsed?: boolean;
|
|
18
19
|
/** Multi-step progress */
|
|
@@ -29,12 +30,12 @@ export interface ThinkingStepProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
29
30
|
}
|
|
30
31
|
interface ThinkingIndicatorContextValue {
|
|
31
32
|
active: boolean;
|
|
32
|
-
|
|
33
|
+
kind: ThinkingKind;
|
|
33
34
|
}
|
|
34
35
|
declare function useThinkingIndicatorContext(): ThinkingIndicatorContextValue;
|
|
35
36
|
declare function ThinkingSteps({ children, className, ...htmlProps }: ThinkingStepsProps): import("react/jsx-runtime").JSX.Element;
|
|
36
37
|
declare function ThinkingStep({ label, status, className, ...htmlProps }: ThinkingStepProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
declare function ThinkingIndicatorRoot({ active, label,
|
|
38
|
+
declare function ThinkingIndicatorRoot({ active, label, kind, showElapsed, steps, className, ...htmlProps }: ThinkingIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
38
39
|
export declare const ThinkingIndicator: typeof ThinkingIndicatorRoot & {
|
|
39
40
|
Steps: typeof ThinkingSteps;
|
|
40
41
|
Step: typeof ThinkingStep;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ThinkingIndicator/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ThinkingIndicator/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AACxD,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAEjF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAClF,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,wBAAwB;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC9E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAMD,UAAU,6BAA6B;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,YAAY,CAAC;CACpB;AAID,iBAAS,2BAA2B,kCAQnC;AA6ED,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,EAAE,kBAAkB,2CAQ/E;AAED,iBAAS,YAAY,CAAC,EAAE,KAAK,EAAE,MAAe,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,EAAE,iBAAiB,2CA6B3F;AAMD,iBAAS,qBAAqB,CAAC,EAC7B,MAAa,EACb,KAAqB,EACrB,IAAa,EACb,WAAmB,EACnB,KAAK,EACL,SAAS,EACT,GAAG,SAAS,EACb,EAAE,sBAAsB,kDAsCxB;AAMD,eAAO,MAAM,iBAAiB;;;CAG5B,CAAC;AAEH,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AAE9D,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -73,7 +73,7 @@ function ThinkingSteps({ children, className, ...htmlProps }) {
|
|
|
73
73
|
const classes = [styles.steps, className].filter(Boolean).join(" ");
|
|
74
74
|
return /* @__PURE__ */ jsx("div", { ...htmlProps, className: classes, children });
|
|
75
75
|
}
|
|
76
|
-
function ThinkingStep({ label, status = "
|
|
76
|
+
function ThinkingStep({ label, status = "idle", className, ...htmlProps }) {
|
|
77
77
|
const classes = [
|
|
78
78
|
styles.step,
|
|
79
79
|
styles[`step${status.charAt(0).toUpperCase() + status.slice(1)}`],
|
|
@@ -83,18 +83,18 @@ function ThinkingStep({ label, status = "pending", className, ...htmlProps }) {
|
|
|
83
83
|
/* @__PURE__ */ jsxs("span", { className: styles.stepIndicator, children: [
|
|
84
84
|
status === "complete" && /* @__PURE__ */ jsx(CheckIcon, {}),
|
|
85
85
|
status === "error" && /* @__PURE__ */ jsx(ErrorIcon, {}),
|
|
86
|
-
status === "
|
|
86
|
+
(status === "pending" || status === "streaming") && /* @__PURE__ */ jsx(
|
|
87
87
|
Loading,
|
|
88
88
|
{
|
|
89
89
|
size: "sm",
|
|
90
|
-
|
|
90
|
+
kind: "spinner",
|
|
91
91
|
color: "current",
|
|
92
92
|
label: "",
|
|
93
93
|
role: "presentation",
|
|
94
94
|
"aria-hidden": "true"
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
status === "
|
|
97
|
+
status === "idle" && /* @__PURE__ */ jsx("span", { className: styles.stepDot })
|
|
98
98
|
] }),
|
|
99
99
|
/* @__PURE__ */ jsx("span", { className: styles.stepLabel, children: label })
|
|
100
100
|
] });
|
|
@@ -102,7 +102,7 @@ function ThinkingStep({ label, status = "pending", className, ...htmlProps }) {
|
|
|
102
102
|
function ThinkingIndicatorRoot({
|
|
103
103
|
active = true,
|
|
104
104
|
label = "Thinking...",
|
|
105
|
-
|
|
105
|
+
kind = "dots",
|
|
106
106
|
showElapsed = false,
|
|
107
107
|
steps,
|
|
108
108
|
className,
|
|
@@ -111,18 +111,17 @@ function ThinkingIndicatorRoot({
|
|
|
111
111
|
const elapsedTime = useElapsedTime(active && showElapsed);
|
|
112
112
|
const contextValue = {
|
|
113
113
|
active,
|
|
114
|
-
|
|
114
|
+
kind
|
|
115
115
|
};
|
|
116
116
|
if (!active) return null;
|
|
117
117
|
const classes = [styles.thinkingIndicator, className].filter(Boolean).join(" ");
|
|
118
|
-
const loadingVariant = variant === "dots" ? "dots" : variant === "pulse" ? "pulse" : "spinner";
|
|
119
118
|
return /* @__PURE__ */ jsx(ThinkingIndicatorContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("div", { ...htmlProps, className: classes, role: "status", "aria-label": label, "aria-live": "polite", children: [
|
|
120
119
|
/* @__PURE__ */ jsxs("div", { className: styles.main, children: [
|
|
121
120
|
/* @__PURE__ */ jsx(
|
|
122
121
|
Loading,
|
|
123
122
|
{
|
|
124
123
|
size: "sm",
|
|
125
|
-
|
|
124
|
+
kind,
|
|
126
125
|
color: "muted",
|
|
127
126
|
label: "",
|
|
128
127
|
role: "presentation",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const container = "
|
|
4
|
-
const topleft = "
|
|
5
|
-
const topcenter = "
|
|
6
|
-
const topright = "
|
|
7
|
-
const bottomleft = "
|
|
8
|
-
const bottomcenter = "
|
|
9
|
-
const bottomright = "
|
|
10
|
-
const toast = "
|
|
11
|
-
const toastEnter = "
|
|
12
|
-
const description = "
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const action = "
|
|
21
|
-
const close = "
|
|
3
|
+
const container = "_container_vtzde_1";
|
|
4
|
+
const topleft = "_topleft_vtzde_14";
|
|
5
|
+
const topcenter = "_topcenter_vtzde_19";
|
|
6
|
+
const topright = "_topright_vtzde_25";
|
|
7
|
+
const bottomleft = "_bottomleft_vtzde_30";
|
|
8
|
+
const bottomcenter = "_bottomcenter_vtzde_36";
|
|
9
|
+
const bottomright = "_bottomright_vtzde_43";
|
|
10
|
+
const toast = "_toast_vtzde_49";
|
|
11
|
+
const toastEnter = "_toastEnter_vtzde_1";
|
|
12
|
+
const description = "_description_vtzde_79";
|
|
13
|
+
const toneSuccess = "_toneSuccess_vtzde_93";
|
|
14
|
+
const toneDanger = "_toneDanger_vtzde_100";
|
|
15
|
+
const toneWarning = "_toneWarning_vtzde_107";
|
|
16
|
+
const toneInfo = "_toneInfo_vtzde_114";
|
|
17
|
+
const icon = "_icon_vtzde_121";
|
|
18
|
+
const content = "_content_vtzde_136";
|
|
19
|
+
const title = "_title_vtzde_143";
|
|
20
|
+
const action = "_action_vtzde_162";
|
|
21
|
+
const close = "_close_vtzde_163";
|
|
22
22
|
const styles = {
|
|
23
23
|
container,
|
|
24
24
|
topleft,
|
|
@@ -30,14 +30,13 @@ const styles = {
|
|
|
30
30
|
toast,
|
|
31
31
|
toastEnter,
|
|
32
32
|
description,
|
|
33
|
-
|
|
33
|
+
toneSuccess,
|
|
34
|
+
toneDanger,
|
|
35
|
+
toneWarning,
|
|
36
|
+
toneInfo,
|
|
34
37
|
icon,
|
|
35
|
-
success,
|
|
36
|
-
title,
|
|
37
|
-
error,
|
|
38
|
-
warning,
|
|
39
|
-
info,
|
|
40
38
|
content,
|
|
39
|
+
title,
|
|
41
40
|
action,
|
|
42
41
|
close
|
|
43
42
|
};
|
|
@@ -50,14 +49,14 @@ exports.container = container;
|
|
|
50
49
|
exports.content = content;
|
|
51
50
|
exports.default = styles;
|
|
52
51
|
exports.description = description;
|
|
53
|
-
exports.error = error;
|
|
54
52
|
exports.icon = icon;
|
|
55
|
-
exports.info = info;
|
|
56
|
-
exports.success = success;
|
|
57
53
|
exports.title = title;
|
|
58
54
|
exports.toast = toast;
|
|
59
55
|
exports.toastEnter = toastEnter;
|
|
56
|
+
exports.toneDanger = toneDanger;
|
|
57
|
+
exports.toneInfo = toneInfo;
|
|
58
|
+
exports.toneSuccess = toneSuccess;
|
|
59
|
+
exports.toneWarning = toneWarning;
|
|
60
60
|
exports.topcenter = topcenter;
|
|
61
61
|
exports.topleft = topleft;
|
|
62
62
|
exports.topright = topright;
|
|
63
|
-
exports.warning = warning;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const container = "
|
|
2
|
-
const topleft = "
|
|
3
|
-
const topcenter = "
|
|
4
|
-
const topright = "
|
|
5
|
-
const bottomleft = "
|
|
6
|
-
const bottomcenter = "
|
|
7
|
-
const bottomright = "
|
|
8
|
-
const toast = "
|
|
9
|
-
const toastEnter = "
|
|
10
|
-
const description = "
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const action = "
|
|
19
|
-
const close = "
|
|
1
|
+
const container = "_container_vtzde_1";
|
|
2
|
+
const topleft = "_topleft_vtzde_14";
|
|
3
|
+
const topcenter = "_topcenter_vtzde_19";
|
|
4
|
+
const topright = "_topright_vtzde_25";
|
|
5
|
+
const bottomleft = "_bottomleft_vtzde_30";
|
|
6
|
+
const bottomcenter = "_bottomcenter_vtzde_36";
|
|
7
|
+
const bottomright = "_bottomright_vtzde_43";
|
|
8
|
+
const toast = "_toast_vtzde_49";
|
|
9
|
+
const toastEnter = "_toastEnter_vtzde_1";
|
|
10
|
+
const description = "_description_vtzde_79";
|
|
11
|
+
const toneSuccess = "_toneSuccess_vtzde_93";
|
|
12
|
+
const toneDanger = "_toneDanger_vtzde_100";
|
|
13
|
+
const toneWarning = "_toneWarning_vtzde_107";
|
|
14
|
+
const toneInfo = "_toneInfo_vtzde_114";
|
|
15
|
+
const icon = "_icon_vtzde_121";
|
|
16
|
+
const content = "_content_vtzde_136";
|
|
17
|
+
const title = "_title_vtzde_143";
|
|
18
|
+
const action = "_action_vtzde_162";
|
|
19
|
+
const close = "_close_vtzde_163";
|
|
20
20
|
const styles = {
|
|
21
21
|
container,
|
|
22
22
|
topleft,
|
|
@@ -28,14 +28,13 @@ const styles = {
|
|
|
28
28
|
toast,
|
|
29
29
|
toastEnter,
|
|
30
30
|
description,
|
|
31
|
-
|
|
31
|
+
toneSuccess,
|
|
32
|
+
toneDanger,
|
|
33
|
+
toneWarning,
|
|
34
|
+
toneInfo,
|
|
32
35
|
icon,
|
|
33
|
-
success,
|
|
34
|
-
title,
|
|
35
|
-
error,
|
|
36
|
-
warning,
|
|
37
|
-
info,
|
|
38
36
|
content,
|
|
37
|
+
title,
|
|
39
38
|
action,
|
|
40
39
|
close
|
|
41
40
|
};
|
|
@@ -49,15 +48,15 @@ export {
|
|
|
49
48
|
content,
|
|
50
49
|
styles as default,
|
|
51
50
|
description,
|
|
52
|
-
error,
|
|
53
51
|
icon,
|
|
54
|
-
info,
|
|
55
|
-
success,
|
|
56
52
|
title,
|
|
57
53
|
toast,
|
|
58
54
|
toastEnter,
|
|
55
|
+
toneDanger,
|
|
56
|
+
toneInfo,
|
|
57
|
+
toneSuccess,
|
|
58
|
+
toneWarning,
|
|
59
59
|
topcenter,
|
|
60
60
|
topleft,
|
|
61
|
-
topright
|
|
62
|
-
warning
|
|
61
|
+
topright
|
|
63
62
|
};
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const React = require("react");
|
|
6
|
+
const index = require("../Button/index.cjs");
|
|
7
|
+
const index$1 = require("../IconButton/index.cjs");
|
|
6
8
|
const Toast_module = require("./Toast.module.scss.cjs");
|
|
7
9
|
function _interopNamespaceDefault(e) {
|
|
8
10
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -30,19 +32,19 @@ function useToast() {
|
|
|
30
32
|
const toast = React__namespace.useCallback((options) => {
|
|
31
33
|
return context.addToast(options);
|
|
32
34
|
}, [context]);
|
|
33
|
-
const
|
|
34
|
-
(
|
|
35
|
+
const makeToneHelper = React__namespace.useCallback(
|
|
36
|
+
(tone) => (titleOrOptions, description) => {
|
|
35
37
|
if (typeof titleOrOptions === "string") {
|
|
36
|
-
return context.addToast({ title: titleOrOptions, description,
|
|
38
|
+
return context.addToast({ title: titleOrOptions, description, tone });
|
|
37
39
|
}
|
|
38
|
-
return context.addToast({ ...titleOrOptions,
|
|
40
|
+
return context.addToast({ ...titleOrOptions, tone });
|
|
39
41
|
},
|
|
40
42
|
[context]
|
|
41
43
|
);
|
|
42
|
-
const success = React__namespace.useMemo(() =>
|
|
43
|
-
const error = React__namespace.useMemo(() =>
|
|
44
|
-
const warning = React__namespace.useMemo(() =>
|
|
45
|
-
const info = React__namespace.useMemo(() =>
|
|
44
|
+
const success = React__namespace.useMemo(() => makeToneHelper("success"), [makeToneHelper]);
|
|
45
|
+
const error = React__namespace.useMemo(() => makeToneHelper("danger"), [makeToneHelper]);
|
|
46
|
+
const warning = React__namespace.useMemo(() => makeToneHelper("warning"), [makeToneHelper]);
|
|
47
|
+
const info = React__namespace.useMemo(() => makeToneHelper("info"), [makeToneHelper]);
|
|
46
48
|
return {
|
|
47
49
|
toast,
|
|
48
50
|
success,
|
|
@@ -86,18 +88,25 @@ function CloseIcon() {
|
|
|
86
88
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
87
89
|
] });
|
|
88
90
|
}
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
+
const toneIcons = {
|
|
92
|
+
neutral: null,
|
|
91
93
|
success: SuccessIcon,
|
|
92
|
-
|
|
94
|
+
danger: ErrorIcon,
|
|
93
95
|
warning: WarningIcon,
|
|
94
96
|
info: InfoIcon
|
|
95
97
|
};
|
|
98
|
+
const TONE_CLASS = {
|
|
99
|
+
neutral: void 0,
|
|
100
|
+
success: Toast_module.default.toneSuccess,
|
|
101
|
+
danger: Toast_module.default.toneDanger,
|
|
102
|
+
warning: Toast_module.default.toneWarning,
|
|
103
|
+
info: Toast_module.default.toneInfo
|
|
104
|
+
};
|
|
96
105
|
function ToastItem({
|
|
97
106
|
id,
|
|
98
107
|
title,
|
|
99
108
|
description,
|
|
100
|
-
|
|
109
|
+
tone = "neutral",
|
|
101
110
|
action,
|
|
102
111
|
onDismiss,
|
|
103
112
|
onPause,
|
|
@@ -105,17 +114,13 @@ function ToastItem({
|
|
|
105
114
|
className,
|
|
106
115
|
...htmlProps
|
|
107
116
|
}) {
|
|
108
|
-
const Icon =
|
|
117
|
+
const Icon = toneIcons[tone];
|
|
109
118
|
const uniqueId = React__namespace.useId();
|
|
110
119
|
const toastRef = React__namespace.useRef(null);
|
|
111
120
|
const titleId = title ? `toast-title-${id || uniqueId}` : void 0;
|
|
112
121
|
const descId = description ? `toast-desc-${id || uniqueId}` : void 0;
|
|
113
|
-
const liveRole =
|
|
114
|
-
const toastClasses = [
|
|
115
|
-
Toast_module.default.toast,
|
|
116
|
-
Toast_module.default[variant],
|
|
117
|
-
className
|
|
118
|
-
].filter(Boolean).join(" ");
|
|
122
|
+
const liveRole = tone === "danger" || tone === "warning" ? "alert" : "status";
|
|
123
|
+
const toastClasses = [Toast_module.default.toast, TONE_CLASS[tone], className].filter(Boolean).join(" ");
|
|
119
124
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
120
125
|
"div",
|
|
121
126
|
{
|
|
@@ -150,19 +155,12 @@ function ToastItem({
|
|
|
150
155
|
title && /* @__PURE__ */ jsxRuntime.jsx("div", { id: titleId, className: Toast_module.default.title, children: title }),
|
|
151
156
|
description && /* @__PURE__ */ jsxRuntime.jsx("div", { id: descId, className: Toast_module.default.description, children: description })
|
|
152
157
|
] }),
|
|
153
|
-
action && /* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
-
"button",
|
|
155
|
-
{
|
|
156
|
-
type: "button",
|
|
157
|
-
className: Toast_module.default.action,
|
|
158
|
-
onClick: action.onClick,
|
|
159
|
-
children: action.label
|
|
160
|
-
}
|
|
161
|
-
),
|
|
158
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(index.Button, { variant: "link", size: "sm", className: Toast_module.default.action, onClick: action.onClick, children: action.label }),
|
|
162
159
|
onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
|
|
163
|
-
|
|
160
|
+
index$1.IconButton,
|
|
164
161
|
{
|
|
165
|
-
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
size: "sm",
|
|
166
164
|
className: Toast_module.default.close,
|
|
167
165
|
onClick: onDismiss,
|
|
168
166
|
"aria-label": "Dismiss notification",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
export type
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ToastTone = "neutral" | "success" | "danger" | "warning" | "info";
|
|
3
3
|
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
4
4
|
export interface ToastData {
|
|
5
5
|
id: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
|
-
|
|
8
|
+
/** Colour. `neutral` is the plain notification; the semantic tones paint the shared status ramp. */
|
|
9
|
+
tone?: ToastTone;
|
|
9
10
|
duration?: number;
|
|
10
11
|
action?: {
|
|
11
12
|
label: string;
|
|
@@ -32,14 +33,14 @@ export interface ToastProviderProps {
|
|
|
32
33
|
}
|
|
33
34
|
export declare function useToast(): {
|
|
34
35
|
toast: (options: ToastInput) => string;
|
|
35
|
-
success: (titleOrOptions: string | Omit<ToastInput, "
|
|
36
|
-
error: (titleOrOptions: string | Omit<ToastInput, "
|
|
37
|
-
warning: (titleOrOptions: string | Omit<ToastInput, "
|
|
38
|
-
info: (titleOrOptions: string | Omit<ToastInput, "
|
|
36
|
+
success: (titleOrOptions: string | Omit<ToastInput, "tone">, description?: string) => string;
|
|
37
|
+
error: (titleOrOptions: string | Omit<ToastInput, "tone">, description?: string) => string;
|
|
38
|
+
warning: (titleOrOptions: string | Omit<ToastInput, "tone">, description?: string) => string;
|
|
39
|
+
info: (titleOrOptions: string | Omit<ToastInput, "tone">, description?: string) => string;
|
|
39
40
|
dismiss: (id: string) => void;
|
|
40
41
|
dismissAll: () => void;
|
|
41
42
|
};
|
|
42
|
-
declare function ToastItem({ id, title, description,
|
|
43
|
+
declare function ToastItem({ id, title, description, tone, action, onDismiss, onPause, onResume, className, ...htmlProps }: ToastProps & {
|
|
43
44
|
id?: string;
|
|
44
45
|
onPause?: () => void;
|
|
45
46
|
onResume?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAC9E,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oGAAoG;IACpG,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC;IACvD,sFAAsF;IACtF,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC5G,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAmBD,wBAAgB,QAAQ;qBAMoB,UAAU;8BAM/B,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,MAAM;4BAAvD,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,MAAM;8BAAvD,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,MAAM;2BAAvD,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,MAAM;kBAtB1D,MAAM,KAAK,IAAI;sBACd,IAAI;EA6CxB;AA0ED,iBAAS,SAAS,CAAC,EACjB,EAAE,EACF,KAAK,EACL,WAAW,EACX,IAAgB,EAChB,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,SAAS,EACb,EAAE,UAAU,GAAG;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,2CA+DA;AA6CD,wBAAgB,aAAa,CAAC,EAC5B,QAAyB,EACzB,QAAe,EACf,GAAO,EACP,QAAQ,GACT,EAAE,kBAAkB,2CA8HpB;AAMD,eAAO,MAAM,KAAK;;CAEhB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { Button } from "../Button/index.js";
|
|
5
|
+
import { IconButton } from "../IconButton/index.js";
|
|
4
6
|
import styles from "./Toast.module.scss.js";
|
|
5
7
|
const ToastContext = React.createContext(null);
|
|
6
8
|
function useToast() {
|
|
@@ -11,19 +13,19 @@ function useToast() {
|
|
|
11
13
|
const toast = React.useCallback((options) => {
|
|
12
14
|
return context.addToast(options);
|
|
13
15
|
}, [context]);
|
|
14
|
-
const
|
|
15
|
-
(
|
|
16
|
+
const makeToneHelper = React.useCallback(
|
|
17
|
+
(tone) => (titleOrOptions, description) => {
|
|
16
18
|
if (typeof titleOrOptions === "string") {
|
|
17
|
-
return context.addToast({ title: titleOrOptions, description,
|
|
19
|
+
return context.addToast({ title: titleOrOptions, description, tone });
|
|
18
20
|
}
|
|
19
|
-
return context.addToast({ ...titleOrOptions,
|
|
21
|
+
return context.addToast({ ...titleOrOptions, tone });
|
|
20
22
|
},
|
|
21
23
|
[context]
|
|
22
24
|
);
|
|
23
|
-
const success = React.useMemo(() =>
|
|
24
|
-
const error = React.useMemo(() =>
|
|
25
|
-
const warning = React.useMemo(() =>
|
|
26
|
-
const info = React.useMemo(() =>
|
|
25
|
+
const success = React.useMemo(() => makeToneHelper("success"), [makeToneHelper]);
|
|
26
|
+
const error = React.useMemo(() => makeToneHelper("danger"), [makeToneHelper]);
|
|
27
|
+
const warning = React.useMemo(() => makeToneHelper("warning"), [makeToneHelper]);
|
|
28
|
+
const info = React.useMemo(() => makeToneHelper("info"), [makeToneHelper]);
|
|
27
29
|
return {
|
|
28
30
|
toast,
|
|
29
31
|
success,
|
|
@@ -67,18 +69,25 @@ function CloseIcon() {
|
|
|
67
69
|
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
68
70
|
] });
|
|
69
71
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
+
const toneIcons = {
|
|
73
|
+
neutral: null,
|
|
72
74
|
success: SuccessIcon,
|
|
73
|
-
|
|
75
|
+
danger: ErrorIcon,
|
|
74
76
|
warning: WarningIcon,
|
|
75
77
|
info: InfoIcon
|
|
76
78
|
};
|
|
79
|
+
const TONE_CLASS = {
|
|
80
|
+
neutral: void 0,
|
|
81
|
+
success: styles.toneSuccess,
|
|
82
|
+
danger: styles.toneDanger,
|
|
83
|
+
warning: styles.toneWarning,
|
|
84
|
+
info: styles.toneInfo
|
|
85
|
+
};
|
|
77
86
|
function ToastItem({
|
|
78
87
|
id,
|
|
79
88
|
title,
|
|
80
89
|
description,
|
|
81
|
-
|
|
90
|
+
tone = "neutral",
|
|
82
91
|
action,
|
|
83
92
|
onDismiss,
|
|
84
93
|
onPause,
|
|
@@ -86,17 +95,13 @@ function ToastItem({
|
|
|
86
95
|
className,
|
|
87
96
|
...htmlProps
|
|
88
97
|
}) {
|
|
89
|
-
const Icon =
|
|
98
|
+
const Icon = toneIcons[tone];
|
|
90
99
|
const uniqueId = React.useId();
|
|
91
100
|
const toastRef = React.useRef(null);
|
|
92
101
|
const titleId = title ? `toast-title-${id || uniqueId}` : void 0;
|
|
93
102
|
const descId = description ? `toast-desc-${id || uniqueId}` : void 0;
|
|
94
|
-
const liveRole =
|
|
95
|
-
const toastClasses = [
|
|
96
|
-
styles.toast,
|
|
97
|
-
styles[variant],
|
|
98
|
-
className
|
|
99
|
-
].filter(Boolean).join(" ");
|
|
103
|
+
const liveRole = tone === "danger" || tone === "warning" ? "alert" : "status";
|
|
104
|
+
const toastClasses = [styles.toast, TONE_CLASS[tone], className].filter(Boolean).join(" ");
|
|
100
105
|
return /* @__PURE__ */ jsxs(
|
|
101
106
|
"div",
|
|
102
107
|
{
|
|
@@ -131,19 +136,12 @@ function ToastItem({
|
|
|
131
136
|
title && /* @__PURE__ */ jsx("div", { id: titleId, className: styles.title, children: title }),
|
|
132
137
|
description && /* @__PURE__ */ jsx("div", { id: descId, className: styles.description, children: description })
|
|
133
138
|
] }),
|
|
134
|
-
action && /* @__PURE__ */ jsx(
|
|
135
|
-
"button",
|
|
136
|
-
{
|
|
137
|
-
type: "button",
|
|
138
|
-
className: styles.action,
|
|
139
|
-
onClick: action.onClick,
|
|
140
|
-
children: action.label
|
|
141
|
-
}
|
|
142
|
-
),
|
|
139
|
+
action && /* @__PURE__ */ jsx(Button, { variant: "link", size: "sm", className: styles.action, onClick: action.onClick, children: action.label }),
|
|
143
140
|
onDismiss && /* @__PURE__ */ jsx(
|
|
144
|
-
|
|
141
|
+
IconButton,
|
|
145
142
|
{
|
|
146
|
-
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
size: "sm",
|
|
147
145
|
className: styles.close,
|
|
148
146
|
onClick: onDismiss,
|
|
149
147
|
"aria-label": "Dismiss notification",
|