@dxos/react-ui 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51
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-6DTBPJE4.mjs +774 -0
- package/dist/lib/browser/chunk-6DTBPJE4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3200 -64
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +37 -48
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-JKHQSGNU.mjs +776 -0
- package/dist/lib/node-esm/chunk-JKHQSGNU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3200 -64
- 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 +37 -48
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts +7 -0
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/{Buttons → Button}/Button.d.ts +1 -1
- package/dist/types/src/components/Button/Button.d.ts.map +1 -0
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/IconButton.d.ts +2 -2
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts +16 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/ToggleGroup.d.ts +4 -4
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/ToggleGroup.stories.d.ts +4 -4
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/Dialog.d.ts +46 -0
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/types/src/components/{Dialogs → Dialog}/Dialog.stories.d.ts +7 -5
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +17 -0
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +5 -2
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +2 -2
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Lists → List}/List.d.ts +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -0
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -0
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/index.d.ts.map +1 -0
- package/dist/types/src/components/Main/Main.d.ts +16 -17
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Menus → Menu}/ContextMenu.d.ts +6 -6
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Menus → Menu}/DropdownMenu.d.ts +3 -4
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/Menu/index.d.ts.map +1 -0
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +25 -26
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +46 -8
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +39 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +19 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts +2 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/Select/Select.d.ts +10 -10
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +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 +26 -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/Tag/Tag.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +2 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -8
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +2 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +14 -11
- 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.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +17 -0
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/slot.stories.d.ts +14 -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/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- 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/Container/Container.d.ts +23 -0
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts +11 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Layout.d.ts +18 -0
- package/dist/types/src/primitives/Container/Layout.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Layout.stories.d.ts +10 -0
- package/dist/types/src/primitives/Container/Layout.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/index.d.ts +3 -0
- package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts +8 -0
- package/dist/types/src/primitives/Flex/Flex.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/index.d.ts +3 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/index.d.ts +1 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts +3 -3
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts +12 -0
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -0
- 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/util/index.d.ts +1 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -30
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +10 -12
- package/src/components/Avatars/Avatar.stories.tsx +4 -4
- package/src/components/Avatars/Avatar.tsx +3 -10
- package/src/components/Avatars/AvatarGroup.stories.tsx +2 -2
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +3 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +5 -31
- package/src/components/{Buttons → Button}/Button.stories.tsx +3 -3
- package/src/components/{Buttons → Button}/Button.tsx +2 -8
- package/src/components/{Buttons → Button}/IconButton.stories.tsx +2 -2
- package/src/components/{Buttons → Button}/IconButton.tsx +20 -14
- package/src/components/{Buttons → Button}/Toggle.stories.tsx +7 -6
- package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +2 -2
- package/src/components/Clipboard/CopyButton.tsx +4 -4
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/{Dialogs → Dialog}/AlertDialog.stories.tsx +3 -3
- package/src/components/{Dialogs → Dialog}/AlertDialog.tsx +3 -8
- package/src/components/Dialog/Dialog.stories.tsx +101 -0
- package/src/components/{Dialogs → Dialog}/Dialog.tsx +171 -46
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +3 -3
- package/src/components/Input/Input.stories.tsx +12 -11
- package/src/components/Input/Input.tsx +23 -29
- package/src/components/Link/Link.stories.tsx +2 -2
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/{Lists → List}/List.stories.tsx +19 -15
- package/src/components/{Lists → List}/List.tsx +8 -14
- package/src/components/{Lists → List}/ListDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Tree.stories.tsx +2 -2
- package/src/components/{Lists → List}/Treegrid.stories.tsx +2 -2
- package/src/components/{Lists → List}/Treegrid.tsx +4 -9
- package/src/components/Main/Main.stories.tsx +41 -20
- package/src/components/Main/Main.tsx +139 -82
- package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +2 -2
- package/src/components/{Menus → Menu}/ContextMenu.tsx +7 -31
- package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +3 -3
- package/src/components/{Menus → Menu}/DropdownMenu.tsx +87 -66
- package/src/components/Message/Message.stories.tsx +3 -3
- package/src/components/Message/Message.tsx +34 -23
- package/src/components/Popover/Popover.stories.tsx +3 -3
- package/src/components/Popover/Popover.tsx +55 -36
- package/src/components/ScrollArea/ScrollArea.stories.tsx +166 -40
- package/src/components/ScrollArea/ScrollArea.tsx +80 -82
- package/src/components/ScrollArea/index.ts +1 -1
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +70 -0
- package/src/components/ScrollContainer/ScrollContainer.tsx +238 -0
- package/src/components/ScrollContainer/index.ts +5 -0
- package/src/components/Select/Select.stories.tsx +3 -3
- package/src/components/Select/Select.tsx +13 -29
- package/src/components/Separator/Separator.tsx +1 -1
- package/src/components/Skeleton/Skeleton.stories.tsx +52 -0
- package/src/components/Skeleton/Skeleton.tsx +26 -0
- package/src/components/Skeleton/index.ts +5 -0
- package/src/components/Splitter/Splitter.stories.tsx +73 -0
- package/src/components/Splitter/Splitter.tsx +123 -0
- package/src/components/Splitter/index.ts +5 -0
- package/src/components/Status/Status.stories.tsx +2 -2
- package/src/components/Status/Status.tsx +2 -2
- package/src/components/Tag/Tag.stories.tsx +4 -4
- package/src/components/Tag/Tag.tsx +2 -7
- package/src/components/ThemeProvider/ThemeProvider.tsx +3 -4
- package/src/components/ThemeProvider/TranslationsProvider.tsx +1 -16
- package/src/components/ThemeProvider/index.ts +3 -3
- package/src/components/Toast/Toast.stories.tsx +3 -3
- package/src/components/Toast/Toast.tsx +6 -10
- package/src/components/Toolbar/Toolbar.stories.tsx +4 -6
- package/src/components/Toolbar/Toolbar.tsx +32 -12
- package/src/components/Tooltip/Tooltip.stories.tsx +3 -3
- package/src/components/Tooltip/Tooltip.tsx +24 -22
- package/src/components/index.ts +7 -4
- package/src/exemplars/generics.stories.tsx +44 -0
- package/src/exemplars/slot.stories.tsx +108 -0
- package/src/exemplars/tabster.stories.tsx +127 -0
- package/src/hooks/useDensityContext.ts +1 -1
- package/src/hooks/useElevationContext.ts +1 -1
- package/src/index.ts +2 -1
- package/src/playground/Controls.stories.tsx +3 -4
- package/src/playground/Custom.stories.tsx +8 -10
- package/src/playground/Typography.stories.tsx +2 -2
- package/src/primitives/Container/Container.stories.tsx +67 -0
- package/src/primitives/Container/Container.tsx +79 -0
- package/src/primitives/Container/Layout.stories.tsx +57 -0
- package/src/primitives/Container/Layout.tsx +61 -0
- package/src/primitives/Container/index.ts +6 -0
- package/src/primitives/Flex/Flex.tsx +26 -0
- package/src/primitives/Flex/index.ts +5 -0
- package/src/primitives/index.ts +6 -0
- package/src/testing/decorators/index.ts +1 -1
- package/src/testing/decorators/withLayout.tsx +22 -15
- package/src/testing/decorators/{withSurfaceVariantsLayout.tsx → withLayoutVariants.tsx} +5 -5
- package/src/testing/decorators/withTheme.tsx +21 -18
- package/src/util/index.ts +2 -2
- package/dist/lib/browser/chunk-KX5JDELJ.mjs +0 -4521
- package/dist/lib/browser/chunk-KX5JDELJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3HDQYL5S.mjs +0 -4523
- package/dist/lib/node-esm/chunk-3HDQYL5S.mjs.map +0 -7
- package/dist/types/src/components/Buttons/Button.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +0 -13
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/index.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +0 -31
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/index.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Treegrid.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/index.d.ts.map +0 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/index.d.ts.map +0 -1
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts +0 -12
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +0 -1
- package/dist/types/src/util/ThemedClassName.d.ts +0 -5
- package/dist/types/src/util/ThemedClassName.d.ts.map +0 -1
- package/dist/types/src/util/domino.d.ts +0 -18
- package/dist/types/src/util/domino.d.ts.map +0 -1
- package/src/components/Dialogs/Dialog.stories.tsx +0 -67
- package/src/util/ThemedClassName.ts +0 -7
- package/src/util/domino.ts +0 -53
- /package/dist/types/src/components/{Buttons → Button}/Button.stories.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/IconButton.stories.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/Toggle.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/index.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/AlertDialog.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/AlertDialog.stories.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/index.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/List.stories.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/ListDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Tree.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Tree.stories.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/TreeDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Treegrid.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Treegrid.stories.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/index.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/ContextMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/DropdownMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/index.d.ts +0 -0
- /package/src/components/{Buttons → Button}/Toggle.tsx +0 -0
- /package/src/components/{Buttons → Button}/ToggleGroup.tsx +0 -0
- /package/src/components/{Buttons → Button}/index.ts +0 -0
- /package/src/components/{Dialogs → Dialog}/index.ts +0 -0
- /package/src/components/{Lists → List}/Tree.tsx +0 -0
- /package/src/components/{Lists → List}/TreeDropIndicator.tsx +0 -0
- /package/src/components/{Lists → List}/index.ts +0 -0
- /package/src/components/{Menus → Menu}/index.ts +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContextScope } from '@radix-ui/react-context';
|
|
6
|
+
import React, { type ComponentPropsWithoutRef, forwardRef } from 'react';
|
|
7
|
+
|
|
8
|
+
import { mx } from '@dxos/ui-theme';
|
|
9
|
+
|
|
10
|
+
import { type ThemedClassName } from '../../util';
|
|
11
|
+
|
|
12
|
+
type ScopedProps<P> = P & { __scopeSplitter?: any };
|
|
13
|
+
|
|
14
|
+
// TODO(burdon): Generalize styles.
|
|
15
|
+
// TODO(burdon): Enalbe resize.
|
|
16
|
+
// TODO(burdon): Generalize horizontal/vertical and change to start/end.
|
|
17
|
+
type Mode = 'upper' | 'lower' | 'both';
|
|
18
|
+
|
|
19
|
+
type SplitterContextValue = {
|
|
20
|
+
mode: Mode;
|
|
21
|
+
ratio: number;
|
|
22
|
+
transition: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const SPLITTER_NAME = 'Splitter';
|
|
26
|
+
|
|
27
|
+
const [createSplitterContext, createSplitterScope] = createContextScope(SPLITTER_NAME);
|
|
28
|
+
|
|
29
|
+
const [SplitterProvider, useSplitterContext] = createSplitterContext<SplitterContextValue>(SPLITTER_NAME);
|
|
30
|
+
|
|
31
|
+
//
|
|
32
|
+
// Root
|
|
33
|
+
//
|
|
34
|
+
|
|
35
|
+
const ROOT_NAME = 'Splitter.Root';
|
|
36
|
+
|
|
37
|
+
type RootProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & Partial<SplitterContextValue>;
|
|
38
|
+
|
|
39
|
+
const Root = forwardRef<HTMLDivElement, ScopedProps<RootProps>>(
|
|
40
|
+
(
|
|
41
|
+
{ __scopeSplitter, classNames, mode = 'upper', ratio = 0.5, transition = 250, children, ...rootProps },
|
|
42
|
+
forwardedRef,
|
|
43
|
+
) => {
|
|
44
|
+
return (
|
|
45
|
+
<SplitterProvider scope={__scopeSplitter} mode={mode} ratio={ratio} transition={transition}>
|
|
46
|
+
<div
|
|
47
|
+
role='none'
|
|
48
|
+
{...rootProps}
|
|
49
|
+
ref={forwardedRef}
|
|
50
|
+
className={mx('relative bs-full overflow-hidden', classNames)}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</div>
|
|
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
|
+
interface PanelProps extends ThemedClassName<ComponentPropsWithoutRef<'div'>> {
|
|
68
|
+
position: 'upper' | 'lower';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const Panel = forwardRef<HTMLDivElement, ScopedProps<PanelProps>>(
|
|
72
|
+
({ __scopeSplitter, classNames, children, position, style, ...panelProps }, forwardedRef) => {
|
|
73
|
+
const context = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
74
|
+
const { mode, ratio, transition } = context;
|
|
75
|
+
|
|
76
|
+
// Calculate position and height based on mode and ratio.
|
|
77
|
+
const isUpper = position === 'upper';
|
|
78
|
+
const top = isUpper ? '0%' : mode === 'upper' ? '100%' : mode === 'lower' ? '0%' : `${ratio * 100}%`;
|
|
79
|
+
|
|
80
|
+
const height = isUpper
|
|
81
|
+
? mode === 'upper'
|
|
82
|
+
? '100%'
|
|
83
|
+
: mode === 'lower'
|
|
84
|
+
? '0%'
|
|
85
|
+
: `${ratio * 100}%`
|
|
86
|
+
: mode === 'lower'
|
|
87
|
+
? '100%'
|
|
88
|
+
: mode === 'upper'
|
|
89
|
+
? '0%'
|
|
90
|
+
: `${(1 - ratio) * 100}%`;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
{...panelProps}
|
|
95
|
+
ref={forwardedRef}
|
|
96
|
+
className={mx('absolute inset-inline-0 flex flex-col overflow-hidden', classNames)}
|
|
97
|
+
style={{
|
|
98
|
+
top,
|
|
99
|
+
height,
|
|
100
|
+
transition: `top ${transition}ms, height ${transition}ms ease-out`,
|
|
101
|
+
...style,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
{children}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
Panel.displayName = PANEL_NAME;
|
|
111
|
+
|
|
112
|
+
//
|
|
113
|
+
// Splitter
|
|
114
|
+
//
|
|
115
|
+
|
|
116
|
+
const Splitter = {
|
|
117
|
+
Root,
|
|
118
|
+
Panel,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export { Splitter, createSplitterScope };
|
|
122
|
+
|
|
123
|
+
export type { Mode as SplitterMode, RootProps as SplitterRootProps, PanelProps as SplitterPanelProps };
|
|
@@ -10,9 +10,9 @@ import { withTheme } from '../../testing';
|
|
|
10
10
|
import { Status } from './Status';
|
|
11
11
|
|
|
12
12
|
const meta = {
|
|
13
|
-
title: 'ui/react-ui-core/Status',
|
|
13
|
+
title: 'ui/react-ui-core/components/Status',
|
|
14
14
|
component: Status,
|
|
15
|
-
decorators: [withTheme],
|
|
15
|
+
decorators: [withTheme()],
|
|
16
16
|
} satisfies Meta<typeof Status>;
|
|
17
17
|
|
|
18
18
|
export default meta;
|
|
@@ -20,12 +20,12 @@ const Status = forwardRef<HTMLSpanElement, StatusProps>(
|
|
|
20
20
|
<span
|
|
21
21
|
role='status'
|
|
22
22
|
{...props}
|
|
23
|
-
className={tx('status.root',
|
|
23
|
+
className={tx('status.root', { indeterminate, variant }, classNames)}
|
|
24
24
|
ref={forwardedRef}
|
|
25
25
|
>
|
|
26
26
|
<span
|
|
27
27
|
role='none'
|
|
28
|
-
className={tx('status.bar',
|
|
28
|
+
className={tx('status.bar', { indeterminate, variant }, classNames)}
|
|
29
29
|
{...(!indeterminate && { style: { width: `${Math.round(progress * 100)}%` } })}
|
|
30
30
|
/>
|
|
31
31
|
{children}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { hues } from '@dxos/
|
|
9
|
-
import { type ChromaticPalette, type MessageValence } from '@dxos/
|
|
8
|
+
import { hues } from '@dxos/ui-theme';
|
|
9
|
+
import { type ChromaticPalette, type MessageValence } from '@dxos/ui-types';
|
|
10
10
|
|
|
11
11
|
import { withTheme } from '../../testing';
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ import { Tag } from './Tag';
|
|
|
15
15
|
const palettes = ['neutral', 'success', 'info', 'warning', 'error', ...hues] as (ChromaticPalette | MessageValence)[];
|
|
16
16
|
|
|
17
17
|
const meta = {
|
|
18
|
-
title: 'ui/react-ui-core/Tag',
|
|
18
|
+
title: 'ui/react-ui-core/components/Tag',
|
|
19
19
|
component: Tag,
|
|
20
20
|
render: () => (
|
|
21
21
|
<div role='grid' className='grid grid-cols-5 gap-2 max-is-screen-md'>
|
|
@@ -26,7 +26,7 @@ const meta = {
|
|
|
26
26
|
))}
|
|
27
27
|
</div>
|
|
28
28
|
),
|
|
29
|
-
decorators: [withTheme],
|
|
29
|
+
decorators: [withTheme()],
|
|
30
30
|
parameters: {
|
|
31
31
|
chromatic: {
|
|
32
32
|
disableSnapshot: false,
|
|
@@ -6,7 +6,7 @@ import { Primitive } from '@radix-ui/react-primitive';
|
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
7
|
import React, { type ComponentPropsWithRef, forwardRef } from 'react';
|
|
8
8
|
|
|
9
|
-
import { type ChromaticPalette, type MessageValence, type NeutralPalette } from '@dxos/
|
|
9
|
+
import { type ChromaticPalette, type MessageValence, type NeutralPalette } from '@dxos/ui-types';
|
|
10
10
|
|
|
11
11
|
import { useThemeContext } from '../../hooks';
|
|
12
12
|
import { type ThemedClassName } from '../../util';
|
|
@@ -21,12 +21,7 @@ export const Tag = forwardRef<HTMLSpanElement, TagProps>(
|
|
|
21
21
|
const { tx } = useThemeContext();
|
|
22
22
|
const Root = asChild ? Slot : Primitive.span;
|
|
23
23
|
return (
|
|
24
|
-
<Root
|
|
25
|
-
{...props}
|
|
26
|
-
className={tx('tag.root', 'dx-tag', { palette }, classNames)}
|
|
27
|
-
data-hue={palette}
|
|
28
|
-
ref={forwardedRef}
|
|
29
|
-
/>
|
|
24
|
+
<Root {...props} className={tx('tag.root', { palette }, classNames)} data-hue={palette} ref={forwardedRef} />
|
|
30
25
|
);
|
|
31
26
|
},
|
|
32
27
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { createKeyborg } from 'keyborg';
|
|
6
6
|
import React, { type PropsWithChildren, createContext, useEffect, useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Density, type Elevation, type ThemeFunction } from '@dxos/
|
|
8
|
+
import { type Density, type Elevation, type ThemeFunction, type ThemeMode } from '@dxos/ui-types';
|
|
9
9
|
|
|
10
10
|
import { type SafeAreaPadding, useSafeArea } from '../../hooks';
|
|
11
11
|
import { hasIosKeyboard } from '../../util';
|
|
@@ -14,14 +14,13 @@ import { ElevationProvider } from '../ElevationProvider';
|
|
|
14
14
|
|
|
15
15
|
import { TranslationsProvider, type TranslationsProviderProps } from './TranslationsProvider';
|
|
16
16
|
|
|
17
|
-
export type ThemeMode = 'dark' | 'light';
|
|
18
|
-
|
|
19
17
|
export type ThemeContextValue = {
|
|
20
18
|
tx: ThemeFunction<any>;
|
|
21
19
|
themeMode: ThemeMode;
|
|
22
20
|
hasIosKeyboard: boolean;
|
|
23
21
|
safeAreaPadding?: SafeAreaPadding;
|
|
24
22
|
noCache?: boolean;
|
|
23
|
+
platform?: 'mobile' | 'desktop';
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
/**
|
|
@@ -41,7 +40,7 @@ export const ThemeProvider = ({
|
|
|
41
40
|
fallback = null,
|
|
42
41
|
resourceExtensions,
|
|
43
42
|
appNs,
|
|
44
|
-
tx = (_path,
|
|
43
|
+
tx = (_path, _styleProps, ..._options) => undefined,
|
|
45
44
|
themeMode = 'dark',
|
|
46
45
|
rootDensity = 'fine',
|
|
47
46
|
...rest
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Locale, enUS as dtLocaleEnUs } from 'date-fns/locale';
|
|
6
|
-
import i18Next, { type Resource
|
|
6
|
+
import i18Next, { type Resource } from 'i18next';
|
|
7
7
|
import React, { type ReactNode, Suspense, createContext, useContext, useEffect, useState } from 'react';
|
|
8
8
|
import { initReactI18next, useTranslation as useI18NextTranslation } from 'react-i18next';
|
|
9
9
|
|
|
@@ -11,21 +11,6 @@ const initialLng = 'en-US';
|
|
|
11
11
|
const initialNs = 'dxos-common';
|
|
12
12
|
const initialDtLocale = dtLocaleEnUs;
|
|
13
13
|
|
|
14
|
-
// TODO(thure): `Parameters<TFunction>` causes typechecking issues because `TFunction` has so many signatures.
|
|
15
|
-
export type Label = string | [string, { ns: string; count?: number; defaultValue?: string }];
|
|
16
|
-
|
|
17
|
-
export const isLabel = (o: any): o is Label =>
|
|
18
|
-
typeof o === 'string' ||
|
|
19
|
-
(Array.isArray(o) &&
|
|
20
|
-
o.length === 2 &&
|
|
21
|
-
typeof o[0] === 'string' &&
|
|
22
|
-
!!o[1] &&
|
|
23
|
-
typeof o[1] === 'object' &&
|
|
24
|
-
'ns' in o[1] &&
|
|
25
|
-
typeof o[1].ns === 'string');
|
|
26
|
-
|
|
27
|
-
export const toLocalizedString = (label: Label, t: TFunction) => (Array.isArray(label) ? t(...label) : label);
|
|
28
|
-
|
|
29
14
|
export const resources = {
|
|
30
15
|
[initialLng]: {
|
|
31
16
|
[initialNs]: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
export { type Label, isLabel, toLocalizedString, useTranslation } from './TranslationsProvider';
|
|
5
|
+
export { type Label, isLabel, toLocalizedString } from '@dxos/ui-types';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
export * from './ThemeProvider';
|
|
8
|
+
export { useTranslation } from './TranslationsProvider';
|
|
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { type ReactNode, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { withTheme } from '../../testing';
|
|
9
|
-
import { Button } from '../
|
|
9
|
+
import { Button } from '../Button';
|
|
10
10
|
|
|
11
11
|
import { Toast } from './Toast';
|
|
12
12
|
|
|
@@ -45,10 +45,10 @@ const DefaultStory = ({ title, description, actionTriggers, openTrigger, closeTr
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const meta = {
|
|
48
|
-
title: 'ui/react-ui-core/Toast',
|
|
48
|
+
title: 'ui/react-ui-core/components/Toast',
|
|
49
49
|
component: Toast as any,
|
|
50
50
|
render: DefaultStory,
|
|
51
|
-
decorators: [withTheme],
|
|
51
|
+
decorators: [withTheme()],
|
|
52
52
|
} satisfies Meta<typeof DefaultStory>;
|
|
53
53
|
|
|
54
54
|
export default meta;
|
|
@@ -34,9 +34,7 @@ type ToastViewportProps = ThemedClassName<ToastViewportPrimitiveProps>;
|
|
|
34
34
|
|
|
35
35
|
const ToastViewport = forwardRef<HTMLOListElement, ToastViewportProps>(({ classNames, ...props }, forwardedRef) => {
|
|
36
36
|
const { tx } = useThemeContext();
|
|
37
|
-
return (
|
|
38
|
-
<ToastViewportPrimitive className={tx('toast.viewport', 'toast-viewport', {}, classNames)} ref={forwardedRef} />
|
|
39
|
-
);
|
|
37
|
+
return <ToastViewportPrimitive className={tx('toast.viewport', {}, classNames)} ref={forwardedRef} />;
|
|
40
38
|
});
|
|
41
39
|
|
|
42
40
|
type ToastRootProps = ThemedClassName<ToastRootPrimitiveProps>;
|
|
@@ -44,7 +42,7 @@ type ToastRootProps = ThemedClassName<ToastRootPrimitiveProps>;
|
|
|
44
42
|
const ToastRoot = forwardRef<HTMLLIElement, ToastRootProps>(({ classNames, children, ...props }, forwardedRef) => {
|
|
45
43
|
const { tx } = useThemeContext();
|
|
46
44
|
return (
|
|
47
|
-
<ToastRootPrimitive {...props} className={tx('toast.root',
|
|
45
|
+
<ToastRootPrimitive {...props} className={tx('toast.root', {}, classNames)} ref={forwardedRef}>
|
|
48
46
|
<ElevationProvider elevation='toast'>{children}</ElevationProvider>
|
|
49
47
|
</ToastRootPrimitive>
|
|
50
48
|
);
|
|
@@ -55,7 +53,7 @@ type ToastBodyProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div
|
|
|
55
53
|
const ToastBody = forwardRef<HTMLDivElement, ToastBodyProps>(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
56
54
|
const { tx } = useThemeContext();
|
|
57
55
|
const Root = asChild ? Slot : Primitive.div;
|
|
58
|
-
return <Root {...props} className={tx('toast.body',
|
|
56
|
+
return <Root {...props} className={tx('toast.body', {}, classNames)} ref={forwardedRef} />;
|
|
59
57
|
});
|
|
60
58
|
|
|
61
59
|
type ToastTitleProps = ThemedClassName<ToastTitlePrimitiveProps>;
|
|
@@ -64,7 +62,7 @@ const ToastTitle = forwardRef<HTMLHeadingElement, ToastTitleProps>(
|
|
|
64
62
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
65
63
|
const { tx } = useThemeContext();
|
|
66
64
|
const Root = asChild ? Slot : ToastTitlePrimitive;
|
|
67
|
-
return <Root {...props} className={tx('toast.title',
|
|
65
|
+
return <Root {...props} className={tx('toast.title', {}, classNames)} ref={forwardedRef} />;
|
|
68
66
|
},
|
|
69
67
|
);
|
|
70
68
|
|
|
@@ -74,9 +72,7 @@ const ToastDescription = forwardRef<HTMLParagraphElement, ToastDescriptionProps>
|
|
|
74
72
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
75
73
|
const { tx } = useThemeContext();
|
|
76
74
|
const Root = asChild ? Slot : ToastDescriptionPrimitive;
|
|
77
|
-
return (
|
|
78
|
-
<Root {...props} className={tx('toast.description', 'toast__description', {}, classNames)} ref={forwardedRef} />
|
|
79
|
-
);
|
|
75
|
+
return <Root {...props} className={tx('toast.description', {}, classNames)} ref={forwardedRef} />;
|
|
80
76
|
},
|
|
81
77
|
);
|
|
82
78
|
|
|
@@ -86,7 +82,7 @@ const ToastActions = forwardRef<HTMLDivElement, ToastActionsProps>(
|
|
|
86
82
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
87
83
|
const { tx } = useThemeContext();
|
|
88
84
|
const Root = asChild ? Slot : Primitive.div;
|
|
89
|
-
return <Root {...props} className={tx('toast.actions',
|
|
85
|
+
return <Root {...props} className={tx('toast.actions', {}, classNames)} ref={forwardedRef} />;
|
|
90
86
|
},
|
|
91
87
|
);
|
|
92
88
|
|
|
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { withTheme } from '../../testing';
|
|
9
|
-
import { Toggle } from '../
|
|
9
|
+
import { Toggle } from '../Button';
|
|
10
10
|
import { Icon } from '../Icon';
|
|
11
11
|
import { Select } from '../Select';
|
|
12
12
|
|
|
@@ -63,18 +63,16 @@ const DefaultStory = (props: StorybookToolbarProps) => {
|
|
|
63
63
|
</Toolbar.Button>
|
|
64
64
|
<Toolbar.Separator />
|
|
65
65
|
<Toolbar.Button>Test</Toolbar.Button>
|
|
66
|
-
<Toolbar.
|
|
67
|
-
<Icon icon='ph--arrow-clockwise--regular' />
|
|
68
|
-
</Toolbar.Button>
|
|
66
|
+
<Toolbar.IconButton icon='ph--arrow-clockwise--regular' label='Refresh' iconOnly />
|
|
69
67
|
</Toolbar.Root>
|
|
70
68
|
);
|
|
71
69
|
};
|
|
72
70
|
|
|
73
71
|
const meta = {
|
|
74
|
-
title: 'ui/react-ui-core/Toolbar',
|
|
72
|
+
title: 'ui/react-ui-core/components/Toolbar',
|
|
75
73
|
component: Toolbar as any,
|
|
76
74
|
render: DefaultStory,
|
|
77
|
-
decorators: [withTheme],
|
|
75
|
+
decorators: [withTheme()],
|
|
78
76
|
} satisfies Meta<typeof DefaultStory>;
|
|
79
77
|
|
|
80
78
|
export default meta;
|
|
@@ -6,6 +6,8 @@ import type { ToggleGroupItemProps as ToggleGroupItemPrimitiveProps } from '@rad
|
|
|
6
6
|
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
7
7
|
import React, { Fragment, forwardRef } from 'react';
|
|
8
8
|
|
|
9
|
+
import { type ToolbarStyleProps } from '@dxos/ui-theme';
|
|
10
|
+
|
|
9
11
|
import { useThemeContext } from '../../hooks';
|
|
10
12
|
import { type ThemedClassName } from '../../util';
|
|
11
13
|
import {
|
|
@@ -18,30 +20,37 @@ import {
|
|
|
18
20
|
Toggle,
|
|
19
21
|
type ToggleGroupItemProps,
|
|
20
22
|
type ToggleProps,
|
|
21
|
-
} from '../
|
|
23
|
+
} from '../Button';
|
|
22
24
|
import { Link, type LinkProps } from '../Link';
|
|
23
25
|
import { Separator, type SeparatorProps } from '../Separator';
|
|
24
26
|
|
|
25
27
|
type ToolbarRootProps = ThemedClassName<
|
|
26
|
-
ToolbarPrimitive.ToolbarProps &
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
ToolbarPrimitive.ToolbarProps &
|
|
29
|
+
ToolbarStyleProps & {
|
|
30
|
+
textBlockWidth?: boolean;
|
|
31
|
+
}
|
|
30
32
|
>;
|
|
31
33
|
|
|
34
|
+
// TODO(burdon): Implement asChild property.
|
|
32
35
|
const ToolbarRoot = forwardRef<HTMLDivElement, ToolbarRootProps>(
|
|
33
|
-
(
|
|
36
|
+
(
|
|
37
|
+
{ classNames, children, density, disabled, layoutManaged, textBlockWidth: textBlockWidthProp, ...props },
|
|
38
|
+
forwardedRef,
|
|
39
|
+
) => {
|
|
34
40
|
const { tx } = useThemeContext();
|
|
35
|
-
const InnerRoot =
|
|
36
|
-
const innerRootProps =
|
|
37
|
-
? {
|
|
41
|
+
const InnerRoot = textBlockWidthProp ? 'div' : Fragment;
|
|
42
|
+
const innerRootProps = textBlockWidthProp
|
|
43
|
+
? {
|
|
44
|
+
role: 'none',
|
|
45
|
+
className: tx('toolbar.inner', { layoutManaged }, classNames),
|
|
46
|
+
}
|
|
38
47
|
: {};
|
|
39
48
|
|
|
40
49
|
return (
|
|
41
50
|
<ToolbarPrimitive.Root
|
|
42
51
|
{...props}
|
|
43
52
|
data-arrow-keys={props.orientation === 'vertical' ? 'up down' : 'left right'}
|
|
44
|
-
className={tx('toolbar.root',
|
|
53
|
+
className={tx('toolbar.root', { density, disabled, layoutManaged }, classNames)}
|
|
45
54
|
ref={forwardedRef}
|
|
46
55
|
>
|
|
47
56
|
<InnerRoot {...innerRootProps}>{children}</InnerRoot>
|
|
@@ -65,7 +74,7 @@ type ToolbarIconButtonProps = IconButtonProps;
|
|
|
65
74
|
const ToolbarIconButton = forwardRef<HTMLButtonElement, ToolbarIconButtonProps>((props, forwardedRef) => {
|
|
66
75
|
return (
|
|
67
76
|
<ToolbarPrimitive.Button asChild>
|
|
68
|
-
<IconButton {...props} ref={forwardedRef} />
|
|
77
|
+
<IconButton {...props} noTooltip ref={forwardedRef} />
|
|
69
78
|
</ToolbarPrimitive.Button>
|
|
70
79
|
);
|
|
71
80
|
});
|
|
@@ -124,7 +133,18 @@ const ToolbarToggleGroupIconItem = forwardRef<HTMLButtonElement, ToolbarToggleGr
|
|
|
124
133
|
({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
125
134
|
return (
|
|
126
135
|
<ToolbarPrimitive.ToolbarToggleItem {...props} asChild>
|
|
127
|
-
<IconButton
|
|
136
|
+
<IconButton
|
|
137
|
+
{...{
|
|
138
|
+
variant,
|
|
139
|
+
density,
|
|
140
|
+
elevation,
|
|
141
|
+
classNames,
|
|
142
|
+
icon,
|
|
143
|
+
label,
|
|
144
|
+
iconOnly,
|
|
145
|
+
}}
|
|
146
|
+
ref={forwardedRef}
|
|
147
|
+
/>
|
|
128
148
|
</ToolbarPrimitive.ToolbarToggleItem>
|
|
129
149
|
);
|
|
130
150
|
},
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import { faker } from '@dxos/random';
|
|
9
9
|
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
|
-
import { Button } from '../
|
|
11
|
+
import { Button } from '../Button';
|
|
12
12
|
|
|
13
13
|
import { Tooltip } from './Tooltip';
|
|
14
14
|
|
|
@@ -30,10 +30,10 @@ const DefaultStory = ({ tooltips, defaultOpen }: StoryProps) => (
|
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
const meta = {
|
|
33
|
-
title: 'ui/react-ui-core/Tooltip',
|
|
33
|
+
title: 'ui/react-ui-core/components/Tooltip',
|
|
34
34
|
component: Tooltip as any,
|
|
35
35
|
render: DefaultStory,
|
|
36
|
-
decorators: [withTheme],
|
|
36
|
+
decorators: [withTheme()],
|
|
37
37
|
} satisfies Meta<typeof DefaultStory>;
|
|
38
38
|
|
|
39
39
|
export default meta;
|
|
@@ -41,9 +41,9 @@ type TooltipScopedProps<P = {}> = P & { __scopeTooltip?: Scope };
|
|
|
41
41
|
const [createTooltipContext, createTooltipScope] = createContextScope('Tooltip', [createPopperScope]);
|
|
42
42
|
const usePopperScope = createPopperScope();
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
//
|
|
45
|
+
// Tooltip
|
|
46
|
+
//
|
|
47
47
|
|
|
48
48
|
const DEFAULT_DELAY_DURATION = 700;
|
|
49
49
|
const TOOLTIP_OPEN = 'tooltip.open';
|
|
@@ -215,9 +215,9 @@ const TooltipProvider: FC<TooltipProviderProps> = (props: TooltipScopedProps<Too
|
|
|
215
215
|
isPointerInTransitRef.current = inTransit;
|
|
216
216
|
}, [])}
|
|
217
217
|
>
|
|
218
|
-
<TooltipContent side={side} className={tx('tooltip.content',
|
|
218
|
+
<TooltipContent side={side} className={tx('tooltip.content', { elevation })}>
|
|
219
219
|
{content}
|
|
220
|
-
<TooltipArrow className={tx('tooltip.arrow'
|
|
220
|
+
<TooltipArrow className={tx('tooltip.arrow')} />
|
|
221
221
|
</TooltipContent>
|
|
222
222
|
<TooltipVirtualTrigger virtualRef={triggerRef as RefObject<HTMLButtonElement>} />
|
|
223
223
|
{children}
|
|
@@ -228,9 +228,9 @@ const TooltipProvider: FC<TooltipProviderProps> = (props: TooltipScopedProps<Too
|
|
|
228
228
|
|
|
229
229
|
TooltipProvider.displayName = TOOLTIP_NAME;
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
//
|
|
232
|
+
// TooltipVirtualTrigger
|
|
233
|
+
//
|
|
234
234
|
|
|
235
235
|
const TooltipVirtualTrigger = ({
|
|
236
236
|
virtualRef,
|
|
@@ -240,9 +240,9 @@ const TooltipVirtualTrigger = ({
|
|
|
240
240
|
return <PopperPrimitive.Anchor asChild {...popperScope} virtualRef={virtualRef} />;
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
//
|
|
244
|
+
// TooltipTrigger
|
|
245
|
+
//
|
|
246
246
|
|
|
247
247
|
const TRIGGER_NAME = 'TooltipTrigger';
|
|
248
248
|
|
|
@@ -322,9 +322,9 @@ const TooltipTrigger = forwardRef<TooltipTriggerElement, TooltipTriggerProps>(
|
|
|
322
322
|
|
|
323
323
|
TooltipTrigger.displayName = TRIGGER_NAME;
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
//
|
|
326
|
+
// TooltipPortal
|
|
327
|
+
//
|
|
328
328
|
|
|
329
329
|
const PORTAL_NAME = 'TooltipPortal';
|
|
330
330
|
|
|
@@ -363,9 +363,9 @@ const TooltipPortal: FC<TooltipPortalProps> = (props: TooltipScopedProps<Tooltip
|
|
|
363
363
|
|
|
364
364
|
TooltipPortal.displayName = PORTAL_NAME;
|
|
365
365
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
//
|
|
367
|
+
// TooltipContent
|
|
368
|
+
//
|
|
369
369
|
|
|
370
370
|
const CONTENT_NAME = 'TooltipContent';
|
|
371
371
|
|
|
@@ -574,9 +574,9 @@ const TooltipContentImpl = forwardRef<TooltipContentImplElement, TooltipContentI
|
|
|
574
574
|
|
|
575
575
|
TooltipContent.displayName = CONTENT_NAME;
|
|
576
576
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
577
|
+
//
|
|
578
|
+
// TooltipArrow
|
|
579
|
+
//
|
|
580
580
|
|
|
581
581
|
const ARROW_NAME = 'TooltipArrow';
|
|
582
582
|
|
|
@@ -599,8 +599,6 @@ const TooltipArrow = forwardRef<TooltipArrowElement, TooltipArrowProps>(
|
|
|
599
599
|
|
|
600
600
|
TooltipArrow.displayName = ARROW_NAME;
|
|
601
601
|
|
|
602
|
-
/* ----------------------------------------------------------------------------------------------- */
|
|
603
|
-
|
|
604
602
|
type TooltipSide = NonNullable<TooltipContentProps['side']>;
|
|
605
603
|
|
|
606
604
|
const getExitSideFromRect = (point: Point, rect: DOMRect): TooltipSide => {
|
|
@@ -755,6 +753,10 @@ const getHullPresorted = <P extends Point>(points: Readonly<Array<P>>): Array<P>
|
|
|
755
753
|
}
|
|
756
754
|
};
|
|
757
755
|
|
|
756
|
+
//
|
|
757
|
+
// Tooltip
|
|
758
|
+
//
|
|
759
|
+
|
|
758
760
|
export const Tooltip = {
|
|
759
761
|
Provider: TooltipProvider,
|
|
760
762
|
Trigger: TooltipTrigger,
|
package/src/components/index.ts
CHANGED
|
@@ -5,21 +5,24 @@
|
|
|
5
5
|
export * from './AnchoredOverflow';
|
|
6
6
|
export * from './Avatars';
|
|
7
7
|
export * from './Breadcrumb';
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './Button';
|
|
9
9
|
export * from './Clipboard';
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './Dialog';
|
|
11
11
|
export * from './Icon';
|
|
12
12
|
export * from './Input';
|
|
13
13
|
export * from './Link';
|
|
14
|
-
export * from './
|
|
14
|
+
export * from './List';
|
|
15
15
|
export * from './Main';
|
|
16
|
-
export * from './
|
|
16
|
+
export * from './Menu';
|
|
17
17
|
export * from './Message';
|
|
18
18
|
export * from './Popover';
|
|
19
19
|
export * from './Status';
|
|
20
20
|
export * from './ScrollArea';
|
|
21
|
+
export * from './ScrollContainer';
|
|
21
22
|
export * from './Select';
|
|
22
23
|
export * from './Separator';
|
|
24
|
+
export * from './Skeleton';
|
|
25
|
+
export * from './Splitter';
|
|
23
26
|
export * from './Tag';
|
|
24
27
|
export * from './Toast';
|
|
25
28
|
export * from './Toolbar';
|