@dxos/react-ui 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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/dist/lib/browser/{chunk-CEKVHJ27.mjs → chunk-OCVRIJCH.mjs} +184 -110
- package/dist/lib/browser/chunk-OCVRIJCH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3033 -1990
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +73 -37
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-2NHEX4AD.mjs → chunk-QUD5P3RU.mjs} +184 -110
- package/dist/lib/node-esm/chunk-QUD5P3RU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3033 -1990
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +73 -37
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.d.ts +2 -2
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.stories.d.ts +3 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.d.ts +2 -2
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +6 -6
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +118 -0
- package/dist/types/src/components/Card/Card.d.ts.map +1 -0
- package/dist/types/src/components/Card/Card.stories.d.ts +21 -0
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -0
- package/dist/types/src/components/Card/index.d.ts +2 -0
- package/dist/types/src/components/Card/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +10 -1
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts +37 -19
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +44 -22
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +6 -8
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts +11 -0
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts +7 -0
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts +19 -0
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts +9 -0
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/index.d.ts +5 -0
- package/dist/types/src/components/ErrorFallback/index.d.ts.map +1 -0
- package/dist/types/src/components/Focus/Focus.d.ts +36 -0
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -0
- package/dist/types/src/components/Focus/Focus.stories.d.ts +9 -0
- package/dist/types/src/components/Focus/Focus.stories.d.ts.map +1 -0
- package/dist/types/src/components/Focus/index.d.ts +2 -0
- package/dist/types/src/components/Focus/index.d.ts.map +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts +3 -0
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +11 -3
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.d.ts +14 -0
- package/dist/types/src/components/Image/Image.d.ts.map +1 -0
- package/dist/types/src/components/Image/Image.stories.d.ts +33 -0
- package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -0
- package/dist/types/src/components/Image/index.d.ts +2 -0
- package/dist/types/src/components/Image/index.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +4 -7
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +7 -7
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +5 -3
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +3 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.d.ts +5 -9
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +9 -10
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +0 -3
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts +51 -50
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts +14 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +4 -5
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +32 -23
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +26 -28
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +54 -9
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +34 -13
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +9 -5
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +2 -2
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -3
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Skeleton/Skeleton.d.ts +12 -0
- package/dist/types/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts +17 -0
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Skeleton/index.d.ts +2 -0
- package/dist/types/src/components/Skeleton/index.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/Splitter.d.ts +34 -0
- package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts +7 -0
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/index.d.ts +2 -0
- package/dist/types/src/components/Splitter/index.d.ts.map +1 -0
- package/dist/types/src/components/Status/Status.d.ts +3 -4
- package/dist/types/src/components/Status/Status.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +4 -2
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +0 -5
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts +12 -0
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toast/Toast.d.ts +15 -15
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +30 -12
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +9 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +19 -0
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/slot.stories.d.ts +15 -0
- package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/tabster.stories.d.ts +8 -0
- package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/virtualizer.stories.d.ts +11 -0
- package/dist/types/src/exemplars/virtualizer.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.d.ts +35 -0
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -0
- package/dist/types/src/primitives/Column/Column.stories.d.ts +25 -0
- package/dist/types/src/primitives/Column/Column.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Column/index.d.ts +2 -0
- package/dist/types/src/primitives/Column/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.d.ts +7 -0
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts +6 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/index.d.ts +2 -0
- package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts +11 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts +8 -0
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/index.d.ts +2 -0
- package/dist/types/src/primitives/Flex/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Grid/Grid.d.ts +10 -0
- package/dist/types/src/primitives/Grid/Grid.d.ts.map +1 -0
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts +8 -0
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Grid/index.d.ts +2 -0
- package/dist/types/src/primitives/Grid/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Panel/Panel.d.ts +35 -0
- package/dist/types/src/primitives/Panel/Panel.d.ts.map +1 -0
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts +6 -0
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Panel/index.d.ts +2 -0
- package/dist/types/src/primitives/Panel/index.d.ts.map +1 -0
- package/dist/types/src/primitives/index.d.ts +6 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -0
- package/dist/types/src/testing/Loading.d.ts +9 -0
- package/dist/types/src/testing/Loading.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts +3 -2
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +11 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/util/usePx.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -22
- package/src/components/Avatars/Avatar.stories.tsx +7 -9
- package/src/components/Avatars/Avatar.tsx +6 -14
- package/src/components/Avatars/AvatarGroup.stories.tsx +2 -3
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +3 -4
- package/src/components/Breadcrumb/Breadcrumb.tsx +11 -37
- package/src/components/Button/Button.stories.tsx +3 -4
- package/src/components/Button/Button.tsx +11 -25
- package/src/components/Button/IconButton.stories.tsx +8 -6
- package/src/components/Button/IconButton.tsx +2 -4
- package/src/components/Button/Toggle.stories.tsx +2 -3
- package/src/components/Button/Toggle.tsx +4 -4
- package/src/components/Button/ToggleGroup.stories.tsx +2 -3
- package/src/components/Button/ToggleGroup.tsx +12 -16
- package/src/components/Card/Card.stories.tsx +151 -0
- package/src/components/Card/Card.tsx +492 -0
- package/src/components/Card/index.ts +5 -0
- package/src/components/Clipboard/CopyButton.tsx +4 -5
- package/src/components/Dialog/AlertDialog.stories.tsx +16 -17
- package/src/components/Dialog/AlertDialog.tsx +123 -82
- package/src/components/Dialog/Dialog.stories.tsx +100 -20
- package/src/components/Dialog/Dialog.tsx +113 -87
- package/src/components/ErrorFallback/ErrorFallback.stories.tsx +45 -0
- package/src/components/ErrorFallback/ErrorFallback.tsx +70 -0
- package/src/components/ErrorFallback/ErrorStack.tsx +114 -0
- package/src/components/ErrorFallback/ThrowError.tsx +37 -0
- package/src/components/ErrorFallback/index.ts +9 -0
- package/src/components/Focus/AUDIT.md +43 -0
- package/src/components/Focus/Focus.stories.tsx +230 -0
- package/src/components/Focus/Focus.tsx +201 -0
- package/src/components/Focus/index.ts +5 -0
- package/src/components/Icon/Icon.stories.tsx +45 -15
- package/src/components/Icon/Icon.tsx +6 -2
- package/src/components/Image/Image.stories.tsx +86 -0
- package/src/components/Image/Image.tsx +223 -0
- package/src/components/Image/index.ts +5 -0
- package/src/components/Input/Input.stories.tsx +20 -40
- package/src/components/Input/Input.tsx +24 -69
- package/src/components/Link/Link.stories.tsx +2 -3
- package/src/components/Link/Link.tsx +2 -2
- package/src/components/List/List.stories.tsx +15 -23
- package/src/components/List/List.tsx +16 -20
- package/src/components/List/ListDropIndicator.tsx +7 -7
- package/src/components/List/Tree.stories.tsx +5 -6
- package/src/components/List/Tree.tsx +0 -1
- package/src/components/List/TreeDropIndicator.tsx +6 -6
- package/src/components/List/Treegrid.stories.tsx +29 -30
- package/src/components/List/Treegrid.tsx +23 -28
- package/src/components/Main/Main.stories.tsx +41 -24
- package/src/components/Main/Main.tsx +139 -83
- package/src/components/Menu/ContextMenu.stories.tsx +2 -3
- package/src/components/Menu/ContextMenu.tsx +9 -33
- package/src/components/Menu/DropdownMenu.stories.tsx +2 -3
- package/src/components/Menu/DropdownMenu.tsx +58 -52
- package/src/components/Message/Message.stories.tsx +26 -12
- package/src/components/Message/Message.tsx +14 -30
- package/src/components/Popover/Popover.stories.tsx +7 -8
- package/src/components/Popover/Popover.tsx +62 -59
- package/src/components/ScrollArea/ScrollArea.stories.tsx +214 -75
- package/src/components/ScrollArea/ScrollArea.tsx +85 -113
- package/src/components/ScrollArea/index.ts +1 -1
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +47 -26
- package/src/components/ScrollContainer/ScrollContainer.tsx +206 -92
- package/src/components/Select/Select.stories.tsx +7 -8
- package/src/components/Select/Select.tsx +11 -27
- package/src/components/Separator/Separator.tsx +5 -8
- package/src/components/Skeleton/Skeleton.stories.tsx +51 -0
- package/src/components/Skeleton/Skeleton.tsx +26 -0
- package/src/components/Skeleton/index.ts +5 -0
- package/src/components/Splitter/Splitter.stories.tsx +83 -0
- package/src/components/Splitter/Splitter.tsx +127 -0
- package/src/components/Splitter/index.ts +5 -0
- package/src/components/Status/Status.stories.tsx +21 -18
- package/src/components/Status/Status.tsx +10 -7
- package/src/components/Tag/Tag.stories.tsx +4 -10
- package/src/components/Tag/Tag.tsx +2 -7
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +31 -0
- package/src/components/ThemeProvider/ThemeProvider.tsx +9 -7
- package/src/components/Toast/Toast.stories.tsx +2 -3
- package/src/components/Toast/Toast.tsx +22 -41
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -3
- package/src/components/Toolbar/Toolbar.tsx +173 -26
- package/src/components/Tooltip/Tooltip.stories.tsx +20 -19
- package/src/components/Tooltip/Tooltip.tsx +18 -18
- package/src/components/index.ts +10 -5
- package/src/exemplars/generics.stories.tsx +41 -0
- package/src/exemplars/slot.stories.tsx +117 -0
- package/src/exemplars/tabster.stories.tsx +127 -0
- package/src/exemplars/virtualizer.stories.tsx +137 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDensityContext.ts +2 -2
- package/src/index.ts +1 -0
- package/src/playground/Controls.stories.tsx +3 -10
- package/src/playground/Custom.stories.tsx +15 -18
- package/src/playground/Typography.stories.tsx +3 -3
- package/src/primitives/Column/AUDIT.md +354 -0
- package/src/primitives/Column/Column.stories.tsx +183 -0
- package/src/primitives/Column/Column.tsx +169 -0
- package/src/primitives/Column/index.ts +5 -0
- package/src/primitives/Container/Container.stories.tsx +29 -0
- package/src/primitives/Container/Container.tsx +19 -0
- package/src/primitives/Container/index.ts +5 -0
- package/src/primitives/Flex/Flex.stories.tsx +57 -0
- package/src/primitives/Flex/Flex.tsx +27 -0
- package/src/primitives/Flex/index.ts +5 -0
- package/src/primitives/Grid/Grid.stories.tsx +56 -0
- package/src/primitives/Grid/Grid.tsx +30 -0
- package/src/primitives/Grid/index.ts +5 -0
- package/src/primitives/Panel/Panel.stories.tsx +68 -0
- package/src/primitives/Panel/Panel.tsx +120 -0
- package/src/primitives/Panel/index.ts +5 -0
- package/src/primitives/index.ts +9 -0
- package/src/testing/Loading.tsx +47 -0
- package/src/testing/decorators/withLayout.tsx +21 -7
- package/src/testing/decorators/withLayoutVariants.tsx +18 -21
- package/src/testing/decorators/withTheme.tsx +24 -19
- package/src/testing/index.ts +2 -0
- package/src/translations.ts +19 -0
- package/src/util/usePx.ts +1 -0
- package/dist/lib/browser/chunk-CEKVHJ27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs.map +0 -7
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts +0 -15
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +0 -1
- package/dist/types/src/components/AnchoredOverflow/index.d.ts +0 -2
- package/dist/types/src/components/AnchoredOverflow/index.d.ts.map +0 -1
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +0 -59
- package/src/components/AnchoredOverflow/index.ts +0 -5
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { type ComponentPropsWithoutRef, forwardRef, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Panel } from '../../primitives';
|
|
9
|
+
import { withLayout, withTheme } from '../../testing';
|
|
10
|
+
import { ScrollArea } from '../ScrollArea';
|
|
11
|
+
import { Toolbar } from '../Toolbar';
|
|
12
|
+
import { Splitter, type SplitterRootProps } from './Splitter';
|
|
13
|
+
|
|
14
|
+
const PanelContent = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<'div'> & { label: string }>(
|
|
15
|
+
({ label, ...props }, forwardedRef) => (
|
|
16
|
+
<Panel.Root {...props} ref={forwardedRef}>
|
|
17
|
+
<Panel.Toolbar asChild>
|
|
18
|
+
<Toolbar.Root>{label}</Toolbar.Root>
|
|
19
|
+
</Panel.Toolbar>
|
|
20
|
+
<Panel.Content asChild>
|
|
21
|
+
<ScrollArea.Root orientation='vertical'>
|
|
22
|
+
<ScrollArea.Viewport>
|
|
23
|
+
{Array.from({ length: 100 }).map((_, i) => (
|
|
24
|
+
<div key={i} className='p-1'>
|
|
25
|
+
{label}-{i}
|
|
26
|
+
</div>
|
|
27
|
+
))}
|
|
28
|
+
</ScrollArea.Viewport>
|
|
29
|
+
</ScrollArea.Root>
|
|
30
|
+
</Panel.Content>
|
|
31
|
+
</Panel.Root>
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const DefaultStory = (props: SplitterRootProps) => {
|
|
36
|
+
const [mode, setMode] = useState(props.mode ?? 'split');
|
|
37
|
+
const [ratio, setRatio] = useState(props.ratio ?? 0.5);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Panel.Root>
|
|
41
|
+
<Panel.Toolbar asChild>
|
|
42
|
+
<Toolbar.Root>
|
|
43
|
+
<Toolbar.Button onClick={() => setMode('top')}>A</Toolbar.Button>
|
|
44
|
+
<Toolbar.Button onClick={() => setMode('split')}>A+B</Toolbar.Button>
|
|
45
|
+
<Toolbar.Button onClick={() => setMode('bottom')}>B</Toolbar.Button>
|
|
46
|
+
<Toolbar.Separator />
|
|
47
|
+
<Toolbar.Button onClick={() => setRatio((r) => 1 - r)}>Toggle</Toolbar.Button>
|
|
48
|
+
</Toolbar.Root>
|
|
49
|
+
</Panel.Toolbar>
|
|
50
|
+
<Panel.Content asChild>
|
|
51
|
+
<Splitter.Root mode={mode} ratio={ratio}>
|
|
52
|
+
<Splitter.Panel asChild position='top'>
|
|
53
|
+
<PanelContent label='A' />
|
|
54
|
+
</Splitter.Panel>
|
|
55
|
+
<Splitter.Panel asChild position='bottom'>
|
|
56
|
+
<PanelContent label='B' />
|
|
57
|
+
</Splitter.Panel>
|
|
58
|
+
</Splitter.Root>
|
|
59
|
+
</Panel.Content>
|
|
60
|
+
</Panel.Root>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const meta: Meta<SplitterRootProps> = {
|
|
65
|
+
title: 'ui/react-ui-core/components/Splitter',
|
|
66
|
+
component: Splitter.Root,
|
|
67
|
+
render: DefaultStory,
|
|
68
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
69
|
+
parameters: {
|
|
70
|
+
layout: 'fullscreen',
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default meta;
|
|
75
|
+
|
|
76
|
+
type Story = StoryObj<SplitterRootProps>;
|
|
77
|
+
|
|
78
|
+
export const Default: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
mode: 'split',
|
|
81
|
+
ratio: 0.4,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContextScope } from '@radix-ui/react-context';
|
|
6
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
import { composableProps, slottable } from '@dxos/ui-theme';
|
|
11
|
+
|
|
12
|
+
import { useThemeContext } from '../../hooks';
|
|
13
|
+
import { ThemedClassName } from '../../util';
|
|
14
|
+
|
|
15
|
+
type ScopedProps<P> = P & { __scopeSplitter?: any };
|
|
16
|
+
|
|
17
|
+
// TODO(burdon): Generalize horizontal/vertical and change to start/end.
|
|
18
|
+
type Mode = 'top' | 'bottom' | 'split';
|
|
19
|
+
|
|
20
|
+
type SplitterContextValue = {
|
|
21
|
+
mode: Mode;
|
|
22
|
+
ratio?: number;
|
|
23
|
+
transition: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const SPLITTER_NAME = 'Splitter';
|
|
27
|
+
|
|
28
|
+
const [createSplitterContext, createSplitterScope] = createContextScope(SPLITTER_NAME);
|
|
29
|
+
|
|
30
|
+
const [SplitterProvider, useSplitterContext] = createSplitterContext<SplitterContextValue>(SPLITTER_NAME);
|
|
31
|
+
|
|
32
|
+
//
|
|
33
|
+
// Root
|
|
34
|
+
//
|
|
35
|
+
|
|
36
|
+
const ROOT_NAME = 'Splitter.Root';
|
|
37
|
+
|
|
38
|
+
type RootOwnProps = Partial<SplitterContextValue>;
|
|
39
|
+
|
|
40
|
+
type RootProps = RootOwnProps;
|
|
41
|
+
|
|
42
|
+
const Root = slottable<HTMLDivElement, RootOwnProps>(
|
|
43
|
+
({ asChild, mode = 'top', ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {
|
|
44
|
+
const { tx } = useThemeContext();
|
|
45
|
+
const { __scopeSplitter, ...rest } = props as ScopedProps<typeof props>;
|
|
46
|
+
const { className, ...restProps } = composableProps(rest);
|
|
47
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<SplitterProvider scope={__scopeSplitter} mode={mode} ratio={ratio} transition={transition}>
|
|
51
|
+
<Comp {...restProps} ref={forwardedRef} className={tx('splitter.root', {}, className)}>
|
|
52
|
+
{children}
|
|
53
|
+
</Comp>
|
|
54
|
+
</SplitterProvider>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
Root.displayName = ROOT_NAME;
|
|
60
|
+
|
|
61
|
+
//
|
|
62
|
+
// Panel
|
|
63
|
+
//
|
|
64
|
+
|
|
65
|
+
const PANEL_NAME = 'Splitter.Panel';
|
|
66
|
+
|
|
67
|
+
type PanelOwnProps = ThemedClassName<{
|
|
68
|
+
position: 'top' | 'bottom';
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
type PanelProps = PanelOwnProps;
|
|
72
|
+
|
|
73
|
+
const Panel = slottable<HTMLDivElement, PanelOwnProps>(
|
|
74
|
+
({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
75
|
+
const { tx } = useThemeContext();
|
|
76
|
+
const { __scopeSplitter, ...rest } = props as ScopedProps<typeof props>;
|
|
77
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
78
|
+
const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
79
|
+
const { className, ...restProps } = composableProps(rest);
|
|
80
|
+
|
|
81
|
+
// Calculate position and height based on mode and ratio.
|
|
82
|
+
const isTopPanel = position === 'top';
|
|
83
|
+
const topOffset = isTopPanel ? '0%' : mode === 'top' ? '100%' : mode === 'bottom' ? '0%' : `${ratio * 100}%`;
|
|
84
|
+
const height = isTopPanel
|
|
85
|
+
? mode === 'top'
|
|
86
|
+
? '100%'
|
|
87
|
+
: mode === 'bottom'
|
|
88
|
+
? '0%'
|
|
89
|
+
: `${ratio * 100}%`
|
|
90
|
+
: mode === 'bottom'
|
|
91
|
+
? '100%'
|
|
92
|
+
: mode === 'top'
|
|
93
|
+
? '0%'
|
|
94
|
+
: `${(1 - ratio) * 100}%`;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Comp
|
|
98
|
+
{...restProps}
|
|
99
|
+
ref={forwardedRef}
|
|
100
|
+
className={tx('splitter.panel', {}, className)}
|
|
101
|
+
style={{
|
|
102
|
+
top: topOffset,
|
|
103
|
+
height,
|
|
104
|
+
transition: `top ${transition}ms, height ${transition}ms ease-out`,
|
|
105
|
+
...style,
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
{children}
|
|
109
|
+
</Comp>
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
Panel.displayName = PANEL_NAME;
|
|
115
|
+
|
|
116
|
+
//
|
|
117
|
+
// Splitter
|
|
118
|
+
//
|
|
119
|
+
|
|
120
|
+
const Splitter = {
|
|
121
|
+
Root,
|
|
122
|
+
Panel,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export { Splitter, createSplitterScope };
|
|
126
|
+
|
|
127
|
+
export type { Mode as SplitterMode, RootProps as SplitterRootProps, PanelProps as SplitterPanelProps };
|
|
@@ -6,34 +6,37 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { withTheme } from '../../testing';
|
|
9
|
-
|
|
10
9
|
import { Status } from './Status';
|
|
11
10
|
|
|
12
11
|
const meta = {
|
|
13
|
-
title: 'ui/react-ui-core/Status',
|
|
12
|
+
title: 'ui/react-ui-core/components/Status',
|
|
14
13
|
component: Status,
|
|
15
|
-
decorators: [withTheme],
|
|
14
|
+
decorators: [withTheme()],
|
|
16
15
|
} satisfies Meta<typeof Status>;
|
|
17
16
|
|
|
18
17
|
export default meta;
|
|
19
18
|
|
|
20
19
|
type Story = StoryObj<typeof meta>;
|
|
21
20
|
|
|
22
|
-
export const Normal
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
export const Normal: Story = {
|
|
22
|
+
render: (props) => {
|
|
23
|
+
return (
|
|
24
|
+
<div className='m-5 space-b-5'>
|
|
25
|
+
<Status classNames='block' progress={0} {...props} />
|
|
26
|
+
<Status classNames='block' progress={0.3} {...props} />
|
|
27
|
+
<Status classNames='block' progress={0.7} {...props} />
|
|
28
|
+
<Status classNames='block' progress={1} {...props} />
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
export const Indeterminate
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
export const Indeterminate: Story = {
|
|
35
|
+
render: (props) => {
|
|
36
|
+
return (
|
|
37
|
+
<div className='m-5'>
|
|
38
|
+
<Status classNames='block' indeterminate {...props} />
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
39
42
|
};
|
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type ComponentPropsWithRef, forwardRef } from 'react';
|
|
6
6
|
|
|
7
|
+
import { type StatusStyleProps } from '@dxos/ui-theme';
|
|
8
|
+
|
|
7
9
|
import { useThemeContext } from '../../hooks';
|
|
8
10
|
import { type ThemedClassName } from '../../util';
|
|
9
11
|
|
|
10
|
-
type StatusProps = ThemedClassName<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
type StatusProps = ThemedClassName<
|
|
13
|
+
ComponentPropsWithRef<'span'> &
|
|
14
|
+
StatusStyleProps & {
|
|
15
|
+
progress?: number;
|
|
16
|
+
}
|
|
17
|
+
>;
|
|
15
18
|
|
|
16
19
|
const Status = forwardRef<HTMLSpanElement, StatusProps>(
|
|
17
20
|
({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
@@ -20,12 +23,12 @@ const Status = forwardRef<HTMLSpanElement, StatusProps>(
|
|
|
20
23
|
<span
|
|
21
24
|
role='status'
|
|
22
25
|
{...props}
|
|
23
|
-
className={tx('status.root',
|
|
26
|
+
className={tx('status.root', { indeterminate, variant }, classNames)}
|
|
24
27
|
ref={forwardedRef}
|
|
25
28
|
>
|
|
26
29
|
<span
|
|
27
30
|
role='none'
|
|
28
|
-
className={tx('status.bar',
|
|
31
|
+
className={tx('status.bar', { indeterminate, variant }, classNames)}
|
|
29
32
|
{...(!indeterminate && { style: { width: `${Math.round(progress * 100)}%` } })}
|
|
30
33
|
/>
|
|
31
34
|
{children}
|
|
@@ -8,17 +8,16 @@ import React from 'react';
|
|
|
8
8
|
import { hues } from '@dxos/ui-theme';
|
|
9
9
|
import { type ChromaticPalette, type MessageValence } from '@dxos/ui-types';
|
|
10
10
|
|
|
11
|
-
import { withTheme } from '../../testing';
|
|
12
|
-
|
|
11
|
+
import { withLayout, withTheme } from '../../testing';
|
|
13
12
|
import { Tag } from './Tag';
|
|
14
13
|
|
|
15
14
|
const palettes = ['neutral', 'success', 'info', 'warning', 'error', ...hues] as (ChromaticPalette | MessageValence)[];
|
|
16
15
|
|
|
17
16
|
const meta = {
|
|
18
|
-
title: 'ui/react-ui-core/Tag',
|
|
17
|
+
title: 'ui/react-ui-core/components/Tag',
|
|
19
18
|
component: Tag,
|
|
20
19
|
render: () => (
|
|
21
|
-
<div
|
|
20
|
+
<div>
|
|
22
21
|
{palettes.map((palette) => (
|
|
23
22
|
<Tag key={palette} palette={palette}>
|
|
24
23
|
{palette}
|
|
@@ -26,12 +25,7 @@ const meta = {
|
|
|
26
25
|
))}
|
|
27
26
|
</div>
|
|
28
27
|
),
|
|
29
|
-
decorators: [withTheme],
|
|
30
|
-
parameters: {
|
|
31
|
-
chromatic: {
|
|
32
|
-
disableSnapshot: false,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
28
|
+
decorators: [withTheme(), withLayout({ layout: 'default' })],
|
|
35
29
|
} satisfies Meta<typeof Tag>;
|
|
36
30
|
|
|
37
31
|
export default meta;
|
|
@@ -19,14 +19,9 @@ export type TagProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.sp
|
|
|
19
19
|
export const Tag = forwardRef<HTMLSpanElement, TagProps>(
|
|
20
20
|
({ asChild, palette = 'neutral', classNames, ...props }, forwardedRef) => {
|
|
21
21
|
const { tx } = useThemeContext();
|
|
22
|
-
const
|
|
22
|
+
const Comp = asChild ? Slot : Primitive.span;
|
|
23
23
|
return (
|
|
24
|
-
<
|
|
25
|
-
{...props}
|
|
26
|
-
className={tx('tag.root', 'dx-tag', { palette }, classNames)}
|
|
27
|
-
data-hue={palette}
|
|
28
|
-
ref={forwardedRef}
|
|
29
|
-
/>
|
|
24
|
+
<Comp {...props} className={tx('tag.root', { palette }, classNames)} data-hue={palette} ref={forwardedRef} />
|
|
30
25
|
);
|
|
31
26
|
},
|
|
32
27
|
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { useThemeContext } from '../../hooks';
|
|
9
|
+
import { withLayout, withTheme } from '../../testing';
|
|
10
|
+
import { ThemeProvider } from './ThemeProvider';
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'ui/react-ui-core/components/ThemeProvider',
|
|
14
|
+
component: ThemeProvider,
|
|
15
|
+
render: () => {
|
|
16
|
+
const { themeMode, platform } = useThemeContext();
|
|
17
|
+
return (
|
|
18
|
+
<div className='p-4 flex flex-col gap-4'>
|
|
19
|
+
<h1>ThemeProvider</h1>
|
|
20
|
+
<pre className='text-sm text-description'>{JSON.stringify({ themeMode, platform }, null, 2)}</pre>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
decorators: [withTheme(), withLayout()],
|
|
25
|
+
} satisfies Meta<typeof ThemeProvider>;
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {};
|
|
@@ -11,7 +11,6 @@ import { type SafeAreaPadding, useSafeArea } from '../../hooks';
|
|
|
11
11
|
import { hasIosKeyboard } from '../../util';
|
|
12
12
|
import { DensityProvider } from '../DensityProvider';
|
|
13
13
|
import { ElevationProvider } from '../ElevationProvider';
|
|
14
|
-
|
|
15
14
|
import { TranslationsProvider, type TranslationsProviderProps } from './TranslationsProvider';
|
|
16
15
|
|
|
17
16
|
export type ThemeContextValue = {
|
|
@@ -20,6 +19,7 @@ export type ThemeContextValue = {
|
|
|
20
19
|
hasIosKeyboard: boolean;
|
|
21
20
|
safeAreaPadding?: SafeAreaPadding;
|
|
22
21
|
noCache?: boolean;
|
|
22
|
+
platform?: 'mobile' | 'desktop';
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -39,10 +39,11 @@ export const ThemeProvider = ({
|
|
|
39
39
|
fallback = null,
|
|
40
40
|
resourceExtensions,
|
|
41
41
|
appNs,
|
|
42
|
-
tx = (_path,
|
|
42
|
+
tx = (_path, _styleProps, ..._options) => undefined,
|
|
43
43
|
themeMode = 'dark',
|
|
44
44
|
rootDensity = 'fine',
|
|
45
|
-
|
|
45
|
+
noCache,
|
|
46
|
+
platform,
|
|
46
47
|
}: ThemeProviderProps) => {
|
|
47
48
|
useEffect(() => {
|
|
48
49
|
if (document.defaultView) {
|
|
@@ -53,9 +54,10 @@ export const ThemeProvider = ({
|
|
|
53
54
|
}, []);
|
|
54
55
|
|
|
55
56
|
const safeAreaPadding = useSafeArea();
|
|
57
|
+
// Destructure all props explicitly so useMemo deps are stable primitives, not a new `rest` object every render.
|
|
56
58
|
const contextValue = useMemo(
|
|
57
|
-
() => ({ tx, themeMode, hasIosKeyboard: hasIosKeyboard(), safeAreaPadding,
|
|
58
|
-
[tx, themeMode, safeAreaPadding,
|
|
59
|
+
() => ({ tx, themeMode, hasIosKeyboard: hasIosKeyboard(), safeAreaPadding, noCache, platform }),
|
|
60
|
+
[tx, themeMode, safeAreaPadding, noCache, platform],
|
|
59
61
|
);
|
|
60
62
|
|
|
61
63
|
return (
|
|
@@ -77,8 +79,8 @@ export const ThemeProvider = ({
|
|
|
77
79
|
|
|
78
80
|
const handleInputModalityChange = (isUsingKeyboard: boolean) => {
|
|
79
81
|
if (isUsingKeyboard) {
|
|
80
|
-
document.body.setAttribute('data-
|
|
82
|
+
document.body.setAttribute('data-w-keyboard', 'true');
|
|
81
83
|
} else {
|
|
82
|
-
document.body.removeAttribute('data-
|
|
84
|
+
document.body.removeAttribute('data-w-keyboard');
|
|
83
85
|
}
|
|
84
86
|
};
|
|
@@ -7,7 +7,6 @@ import React, { type ReactNode, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { withTheme } from '../../testing';
|
|
9
9
|
import { Button } from '../Button';
|
|
10
|
-
|
|
11
10
|
import { Toast } from './Toast';
|
|
12
11
|
|
|
13
12
|
type ActionTriggerProps = { altText: string; trigger: ReactNode };
|
|
@@ -45,10 +44,10 @@ const DefaultStory = ({ title, description, actionTriggers, openTrigger, closeTr
|
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
const meta = {
|
|
48
|
-
title: 'ui/react-ui-core/Toast',
|
|
47
|
+
title: 'ui/react-ui-core/components/Toast',
|
|
49
48
|
component: Toast as any,
|
|
50
49
|
render: DefaultStory,
|
|
51
|
-
decorators: [withTheme],
|
|
50
|
+
decorators: [withTheme()],
|
|
52
51
|
} satisfies Meta<typeof DefaultStory>;
|
|
53
52
|
|
|
54
53
|
export default meta;
|
|
@@ -4,49 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import
|
|
8
|
-
ToastAction as ToastActionPrimitive,
|
|
9
|
-
type ToastActionProps as ToastActionPrimitiveProps,
|
|
10
|
-
ToastClose as ToastClosePrimitive,
|
|
11
|
-
type ToastCloseProps as ToastClosePrimitiveProps,
|
|
12
|
-
ToastDescription as ToastDescriptionPrimitive,
|
|
13
|
-
type ToastDescriptionProps as ToastDescriptionPrimitiveProps,
|
|
14
|
-
ToastProvider as ToastProviderPrimitive,
|
|
15
|
-
type ToastProviderProps as ToastProviderPrimitiveProps,
|
|
16
|
-
Root as ToastRootPrimitive,
|
|
17
|
-
type ToastProps as ToastRootPrimitiveProps,
|
|
18
|
-
ToastTitle as ToastTitlePrimitive,
|
|
19
|
-
type ToastTitleProps as ToastTitlePrimitiveProps,
|
|
20
|
-
ToastViewport as ToastViewportPrimitive,
|
|
21
|
-
type ToastViewportProps as ToastViewportPrimitiveProps,
|
|
22
|
-
} from '@radix-ui/react-toast';
|
|
7
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
23
8
|
import React, { type ComponentPropsWithRef, type FunctionComponent, forwardRef } from 'react';
|
|
24
9
|
|
|
25
10
|
import { useThemeContext } from '../../hooks';
|
|
26
11
|
import { type ThemedClassName } from '../../util';
|
|
27
12
|
import { ElevationProvider } from '../ElevationProvider';
|
|
28
13
|
|
|
29
|
-
type ToastProviderProps =
|
|
14
|
+
type ToastProviderProps = ToastPrimitive.ToastProviderProps;
|
|
30
15
|
|
|
31
|
-
const ToastProvider: FunctionComponent<ToastProviderProps> =
|
|
16
|
+
const ToastProvider: FunctionComponent<ToastProviderProps> = ToastPrimitive.Provider;
|
|
32
17
|
|
|
33
|
-
type ToastViewportProps = ThemedClassName<
|
|
18
|
+
type ToastViewportProps = ThemedClassName<ToastPrimitive.ToastViewportProps>;
|
|
34
19
|
|
|
35
20
|
const ToastViewport = forwardRef<HTMLOListElement, ToastViewportProps>(({ classNames, ...props }, forwardedRef) => {
|
|
36
21
|
const { tx } = useThemeContext();
|
|
37
|
-
return (
|
|
38
|
-
<ToastViewportPrimitive className={tx('toast.viewport', 'toast-viewport', {}, classNames)} ref={forwardedRef} />
|
|
39
|
-
);
|
|
22
|
+
return <ToastPrimitive.Viewport {...props} className={tx('toast.viewport', {}, classNames)} ref={forwardedRef} />;
|
|
40
23
|
});
|
|
41
24
|
|
|
42
|
-
type ToastRootProps = ThemedClassName<
|
|
25
|
+
type ToastRootProps = ThemedClassName<ToastPrimitive.ToastProps>;
|
|
43
26
|
|
|
44
27
|
const ToastRoot = forwardRef<HTMLLIElement, ToastRootProps>(({ classNames, children, ...props }, forwardedRef) => {
|
|
45
28
|
const { tx } = useThemeContext();
|
|
46
29
|
return (
|
|
47
|
-
<
|
|
30
|
+
<ToastPrimitive.Root {...props} className={tx('toast.root', {}, classNames)} ref={forwardedRef}>
|
|
48
31
|
<ElevationProvider elevation='toast'>{children}</ElevationProvider>
|
|
49
|
-
</
|
|
32
|
+
</ToastPrimitive.Root>
|
|
50
33
|
);
|
|
51
34
|
});
|
|
52
35
|
|
|
@@ -54,29 +37,27 @@ type ToastBodyProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div
|
|
|
54
37
|
|
|
55
38
|
const ToastBody = forwardRef<HTMLDivElement, ToastBodyProps>(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
56
39
|
const { tx } = useThemeContext();
|
|
57
|
-
const
|
|
58
|
-
return <
|
|
40
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
41
|
+
return <Comp {...props} className={tx('toast.body', {}, classNames)} ref={forwardedRef} />;
|
|
59
42
|
});
|
|
60
43
|
|
|
61
|
-
type ToastTitleProps = ThemedClassName<
|
|
44
|
+
type ToastTitleProps = ThemedClassName<ToastPrimitive.ToastTitleProps>;
|
|
62
45
|
|
|
63
46
|
const ToastTitle = forwardRef<HTMLHeadingElement, ToastTitleProps>(
|
|
64
47
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
65
48
|
const { tx } = useThemeContext();
|
|
66
|
-
const
|
|
67
|
-
return <
|
|
49
|
+
const Comp = asChild ? Slot : ToastPrimitive.Title;
|
|
50
|
+
return <Comp {...props} className={tx('toast.title', {}, classNames)} ref={forwardedRef} />;
|
|
68
51
|
},
|
|
69
52
|
);
|
|
70
53
|
|
|
71
|
-
type ToastDescriptionProps = ThemedClassName<
|
|
54
|
+
type ToastDescriptionProps = ThemedClassName<ToastPrimitive.ToastDescriptionProps>;
|
|
72
55
|
|
|
73
56
|
const ToastDescription = forwardRef<HTMLParagraphElement, ToastDescriptionProps>(
|
|
74
57
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
75
58
|
const { tx } = useThemeContext();
|
|
76
|
-
const
|
|
77
|
-
return (
|
|
78
|
-
<Root {...props} className={tx('toast.description', 'toast__description', {}, classNames)} ref={forwardedRef} />
|
|
79
|
-
);
|
|
59
|
+
const Comp = asChild ? Slot : ToastPrimitive.Description;
|
|
60
|
+
return <Comp {...props} className={tx('toast.description', {}, classNames)} ref={forwardedRef} />;
|
|
80
61
|
},
|
|
81
62
|
);
|
|
82
63
|
|
|
@@ -85,18 +66,18 @@ type ToastActionsProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.
|
|
|
85
66
|
const ToastActions = forwardRef<HTMLDivElement, ToastActionsProps>(
|
|
86
67
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
87
68
|
const { tx } = useThemeContext();
|
|
88
|
-
const
|
|
89
|
-
return <
|
|
69
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
70
|
+
return <Comp {...props} className={tx('toast.actions', {}, classNames)} ref={forwardedRef} />;
|
|
90
71
|
},
|
|
91
72
|
);
|
|
92
73
|
|
|
93
|
-
type ToastActionProps =
|
|
74
|
+
type ToastActionProps = ToastPrimitive.ToastActionProps;
|
|
94
75
|
|
|
95
|
-
const ToastAction: FunctionComponent<ToastActionProps> =
|
|
76
|
+
const ToastAction: FunctionComponent<ToastActionProps> = ToastPrimitive.Action;
|
|
96
77
|
|
|
97
|
-
type ToastCloseProps =
|
|
78
|
+
type ToastCloseProps = ToastPrimitive.ToastCloseProps;
|
|
98
79
|
|
|
99
|
-
const ToastClose: FunctionComponent<ToastCloseProps> =
|
|
80
|
+
const ToastClose: FunctionComponent<ToastCloseProps> = ToastPrimitive.Close;
|
|
100
81
|
|
|
101
82
|
export const Toast = {
|
|
102
83
|
Provider: ToastProvider,
|
|
@@ -9,7 +9,6 @@ import { withTheme } from '../../testing';
|
|
|
9
9
|
import { Toggle } from '../Button';
|
|
10
10
|
import { Icon } from '../Icon';
|
|
11
11
|
import { Select } from '../Select';
|
|
12
|
-
|
|
13
12
|
import { Toolbar } from './Toolbar';
|
|
14
13
|
|
|
15
14
|
type StorybookToolbarProps = {};
|
|
@@ -69,10 +68,10 @@ const DefaultStory = (props: StorybookToolbarProps) => {
|
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
const meta = {
|
|
72
|
-
title: 'ui/react-ui-core/Toolbar',
|
|
71
|
+
title: 'ui/react-ui-core/components/Toolbar',
|
|
73
72
|
component: Toolbar as any,
|
|
74
73
|
render: DefaultStory,
|
|
75
|
-
decorators: [withTheme],
|
|
74
|
+
decorators: [withTheme()],
|
|
76
75
|
} satisfies Meta<typeof DefaultStory>;
|
|
77
76
|
|
|
78
77
|
export default meta;
|