@dxos/react-ui 0.8.3 → 0.8.4-main.1068cf700f
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 +3203 -61
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +66 -50
- 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 +3203 -61
- 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 +66 -50
- 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 +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +5 -31
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +5 -11
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -20
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Buttons → Button}/Button.d.ts +2 -2
- package/dist/types/src/components/Button/Button.d.ts.map +1 -0
- package/dist/types/src/components/Button/Button.stories.d.ts +17 -0
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/IconButton.d.ts +4 -4
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts +13 -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/Button/ToggleGroup.d.ts +27 -0
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -0
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +27 -0
- 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/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +5 -6
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +2 -3
- package/dist/types/src/components/Clipboard/index.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/{Dialogs → Dialog}/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts +11 -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/Dialog/Dialog.stories.d.ts +27 -0
- 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 +2 -2
- 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 +6 -5
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +12 -13
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts +8 -8
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Lists → List}/List.d.ts +3 -3
- package/dist/types/src/components/List/List.d.ts.map +1 -0
- package/dist/types/src/components/List/List.stories.d.ts +14 -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/{Lists → List}/Tree.d.ts +1 -1
- package/dist/types/src/components/List/Tree.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.stories.d.ts +15 -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/{Lists → List}/Treegrid.d.ts +1 -1
- package/dist/types/src/components/{Lists → List}/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts +12 -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 +17 -27
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +6 -7
- 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 +12 -0
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Menus → Menu}/DropdownMenu.d.ts +8 -8
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts +15 -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 +8 -17
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +4 -4
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +6 -34
- package/dist/types/src/components/Popover/Popover.stories.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 +37 -25
- 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/Select/Select.stories.d.ts +5 -10
- package/dist/types/src/components/Select/Select.stories.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/Status/Status.stories.d.ts +2 -8
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- 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/Tag/Tag.stories.d.ts +12 -12
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +3 -3
- 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 +5 -5
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +6 -44
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +20 -19
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +6 -50
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -4
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +8 -61
- package/dist/types/src/components/Tooltip/Tooltip.stories.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/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts +2 -2
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +5 -9
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +12 -4
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +5 -11
- package/dist/types/src/playground/Typography.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 +2 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts +15 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -0
- 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 +5 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts +8 -0
- package/dist/types/src/util/usePx.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -31
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +10 -12
- package/src/components/Avatars/Avatar.stories.tsx +23 -14
- package/src/components/Avatars/Avatar.tsx +6 -13
- package/src/components/Avatars/AvatarGroup.stories.tsx +12 -8
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +19 -14
- package/src/components/Breadcrumb/Breadcrumb.tsx +8 -34
- package/src/components/{Buttons → Button}/Button.stories.tsx +11 -12
- package/src/components/{Buttons → Button}/Button.tsx +3 -8
- package/src/components/{Buttons → Button}/IconButton.stories.tsx +13 -10
- package/src/components/{Buttons → Button}/IconButton.tsx +23 -16
- package/src/components/Button/Toggle.stories.tsx +37 -0
- package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +15 -12
- package/src/components/{Buttons → Button}/ToggleGroup.tsx +17 -4
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +17 -18
- package/src/components/DensityProvider/DensityProvider.tsx +2 -2
- package/src/components/{Dialogs → Dialog}/AlertDialog.stories.tsx +17 -14
- package/src/components/{Dialogs → Dialog}/AlertDialog.tsx +16 -21
- package/src/components/Dialog/Dialog.stories.tsx +101 -0
- package/src/components/{Dialogs → Dialog}/Dialog.tsx +182 -57
- package/src/components/ElevationProvider/ElevationProvider.tsx +2 -2
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +3 -3
- package/src/components/Input/Input.stories.tsx +22 -23
- package/src/components/Input/Input.tsx +38 -44
- package/src/components/Link/Link.stories.tsx +12 -8
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/{Lists → List}/List.stories.tsx +40 -34
- package/src/components/{Lists → List}/List.tsx +22 -29
- package/src/components/{Lists → List}/ListDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Tree.stories.tsx +13 -10
- package/src/components/{Lists → List}/Tree.tsx +4 -3
- package/src/components/{Lists → List}/TreeDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Treegrid.stories.tsx +14 -8
- package/src/components/{Lists → List}/Treegrid.tsx +61 -25
- package/src/components/Main/Main.stories.tsx +56 -27
- package/src/components/Main/Main.tsx +166 -94
- package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +13 -10
- package/src/components/{Menus → Menu}/ContextMenu.tsx +8 -31
- package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +14 -11
- package/src/components/{Menus → Menu}/DropdownMenu.tsx +109 -78
- package/src/components/Message/Message.stories.tsx +14 -10
- package/src/components/Message/Message.tsx +34 -23
- package/src/components/Popover/Popover.stories.tsx +14 -11
- package/src/components/Popover/Popover.tsx +68 -49
- package/src/components/ScrollArea/ScrollArea.stories.tsx +163 -34
- 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 +15 -12
- package/src/components/Select/Select.tsx +18 -34
- 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 +11 -8
- package/src/components/Status/Status.tsx +2 -2
- package/src/components/Tag/Tag.stories.tsx +21 -12
- package/src/components/Tag/Tag.tsx +2 -7
- package/src/components/ThemeProvider/ThemeProvider.tsx +5 -6
- package/src/components/ThemeProvider/TranslationsProvider.tsx +4 -19
- package/src/components/ThemeProvider/index.ts +3 -1
- package/src/components/Toast/Toast.stories.tsx +14 -11
- package/src/components/Toast/Toast.tsx +15 -19
- package/src/components/Toolbar/Toolbar.stories.tsx +23 -21
- package/src/components/Toolbar/Toolbar.tsx +41 -10
- package/src/components/Tooltip/Tooltip.stories.tsx +18 -14
- package/src/components/Tooltip/Tooltip.tsx +29 -26
- 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/hooks/useSafeArea.ts +3 -2
- package/src/hooks/useSafeCollisionPadding.ts +1 -1
- package/src/hooks/useVisualViewport.ts +4 -4
- package/src/index.ts +3 -2
- package/src/playground/Controls.stories.tsx +20 -18
- package/src/playground/Custom.stories.tsx +15 -26
- package/src/playground/Typography.stories.tsx +10 -8
- 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 +2 -1
- package/src/testing/decorators/withLayout.tsx +63 -0
- package/src/testing/decorators/{withSurfaceVariantsLayout.tsx → withLayoutVariants.tsx} +4 -4
- package/src/testing/decorators/withTheme.tsx +34 -0
- package/src/util/index.ts +3 -1
- package/src/util/usePx.ts +61 -0
- package/README.yml +0 -1
- package/dist/lib/browser/chunk-WXW6KSRL.mjs +0 -4376
- package/dist/lib/browser/chunk-WXW6KSRL.mjs.map +0 -7
- package/dist/lib/node/chunk-3E3QKWX4.cjs +0 -4363
- package/dist/lib/node/chunk-3E3QKWX4.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -175
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/testing/index.cjs +0 -114
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-EQ7EG74H.mjs +0 -4378
- package/dist/lib/node-esm/chunk-EQ7EG74H.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 +0 -12
- 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 +0 -22
- 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 -19
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +0 -28
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +0 -39
- 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 +0 -43
- 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 +0 -48
- 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 +0 -37
- 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 +0 -41
- 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.stories.d.ts +0 -10
- 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 +0 -50
- 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 +0 -50
- 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/src/components/Buttons/Toggle.stories.tsx +0 -33
- package/src/components/Dialogs/Dialog.stories.tsx +0 -65
- package/src/testing/decorators/withTheme.ts +0 -22
- package/src/util/ThemedClassName.ts +0 -7
- /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}/index.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/ListDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/TreeDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/index.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}/index.ts +0 -0
- /package/src/components/{Dialogs → Dialog}/index.ts +0 -0
- /package/src/components/{Lists → List}/index.ts +0 -0
- /package/src/components/{Menus → Menu}/index.ts +0 -0
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { FileTs, FileJs, ArrowClockwise, Bug, TextUnderline, TextB, TextItalic } from '@phosphor-icons/react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import { Input, Select, Toggle, Toolbar } from '../components';
|
|
11
|
-
import {
|
|
8
|
+
import { Icon, Input, Select, Toggle, Toolbar } from '../components';
|
|
9
|
+
import { withLayoutVariants, withTheme } from '../testing';
|
|
12
10
|
|
|
13
11
|
const DefaultStory = () => {
|
|
14
12
|
const [checked, setChecked] = useState<boolean>(false);
|
|
@@ -29,6 +27,7 @@ const DefaultStory = () => {
|
|
|
29
27
|
<Select.Option value={'b'}>B</Select.Option>
|
|
30
28
|
<Select.Option value={'c'}>C</Select.Option>
|
|
31
29
|
</Select.Viewport>
|
|
30
|
+
<Select.Arrow />
|
|
32
31
|
</Select.Content>
|
|
33
32
|
</Select.Portal>
|
|
34
33
|
</Select.Root>
|
|
@@ -37,27 +36,27 @@ const DefaultStory = () => {
|
|
|
37
36
|
{/* TODO(burdon): Icon sizes should adapt to density. */}
|
|
38
37
|
<Toolbar.ToggleGroup type='multiple'>
|
|
39
38
|
<Toolbar.ToggleGroupItem value='a'>
|
|
40
|
-
<
|
|
39
|
+
<Icon icon='ph--text-b--regular' />
|
|
41
40
|
</Toolbar.ToggleGroupItem>
|
|
42
41
|
<Toolbar.ToggleGroupItem value='b'>
|
|
43
|
-
<
|
|
42
|
+
<Icon icon='ph--text-italic--regular' />
|
|
44
43
|
</Toolbar.ToggleGroupItem>
|
|
45
44
|
<Toolbar.ToggleGroupItem value='c'>
|
|
46
|
-
<
|
|
45
|
+
<Icon icon='ph--text-underline--regular' />
|
|
47
46
|
</Toolbar.ToggleGroupItem>
|
|
48
47
|
</Toolbar.ToggleGroup>
|
|
49
48
|
{/* TODO(burdon): Highlight isn't shown. */}
|
|
50
49
|
<Toolbar.ToggleGroup type='single' defaultValue='a'>
|
|
51
50
|
<Toolbar.ToggleGroupItem value='a'>
|
|
52
|
-
<
|
|
51
|
+
<Icon icon='ph--file-ts--regular' />
|
|
53
52
|
</Toolbar.ToggleGroupItem>
|
|
54
53
|
<Toolbar.ToggleGroupItem value='b'>
|
|
55
|
-
<
|
|
54
|
+
<Icon icon='ph--file-js--regular' />
|
|
56
55
|
</Toolbar.ToggleGroupItem>
|
|
57
56
|
</Toolbar.ToggleGroup>
|
|
58
57
|
<Toolbar.Button asChild>
|
|
59
58
|
<Toggle>
|
|
60
|
-
<
|
|
59
|
+
<Icon icon='ph--bug--regular' />
|
|
61
60
|
</Toggle>
|
|
62
61
|
</Toolbar.Button>
|
|
63
62
|
{/* TODO(burdon): Should not be 'is-full' by default. */}
|
|
@@ -71,7 +70,7 @@ const DefaultStory = () => {
|
|
|
71
70
|
</Input.Root>
|
|
72
71
|
<Toolbar.Button>Test</Toolbar.Button>
|
|
73
72
|
<Toolbar.Button>
|
|
74
|
-
<
|
|
73
|
+
<Icon icon='ph--arrow-clockwise--regular' />
|
|
75
74
|
</Toolbar.Button>
|
|
76
75
|
</Toolbar.Root>
|
|
77
76
|
<Input.Root>
|
|
@@ -81,11 +80,14 @@ const DefaultStory = () => {
|
|
|
81
80
|
);
|
|
82
81
|
};
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
title: 'ui/react-ui-core/
|
|
83
|
+
const meta = {
|
|
84
|
+
title: 'ui/react-ui-core/playground/Controls',
|
|
86
85
|
render: DefaultStory,
|
|
87
|
-
decorators: [
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
decorators: [withTheme(), withLayoutVariants()],
|
|
87
|
+
} satisfies Meta<typeof Icon>;
|
|
88
|
+
|
|
89
|
+
export default meta;
|
|
90
|
+
|
|
91
|
+
type Story = StoryObj<typeof meta>;
|
|
90
92
|
|
|
91
|
-
export const Default = {};
|
|
93
|
+
export const Default: Story = {};
|
|
@@ -2,23 +2,12 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import { Button,
|
|
8
|
+
import { Button, type ButtonProps, IconButton, Tooltip } from '../components';
|
|
11
9
|
import { withTheme } from '../testing';
|
|
12
10
|
|
|
13
|
-
// TODO(burdon): Change density to 3 or 4 sizes: (large, medium, small; or 22, 28, 32, 40)
|
|
14
|
-
// TODO(burdon): IconButton should be square if no text.
|
|
15
|
-
// TODO(burdon): IconButton icon should be auto-sized based on density.
|
|
16
|
-
|
|
17
|
-
// TODO(burdon): Remove custom padding from all Buttons.
|
|
18
|
-
|
|
19
|
-
// TODO(burdon): Forms w/ labels.
|
|
20
|
-
// TODO(burdon): Card preview with sections.
|
|
21
|
-
|
|
22
11
|
const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
23
12
|
return (
|
|
24
13
|
<Tooltip.Provider>
|
|
@@ -41,7 +30,7 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
41
30
|
iconOnly
|
|
42
31
|
size={7}
|
|
43
32
|
density='coarse'
|
|
44
|
-
classNames='
|
|
33
|
+
classNames='pli-1.5'
|
|
45
34
|
/>
|
|
46
35
|
</div>
|
|
47
36
|
</div>
|
|
@@ -54,7 +43,7 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
54
43
|
</Button>
|
|
55
44
|
</div>
|
|
56
45
|
<div className='flex justify-center'>
|
|
57
|
-
<IconButton {...args} label='Test' icon='ph--atom--regular'
|
|
46
|
+
<IconButton {...args} label='Test' icon='ph--atom--regular' density='fine' classNames='pli-2' />
|
|
58
47
|
</div>
|
|
59
48
|
<div className='flex justify-center'>
|
|
60
49
|
<IconButton
|
|
@@ -62,9 +51,8 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
62
51
|
label='Test'
|
|
63
52
|
icon='ph--atom--regular'
|
|
64
53
|
iconOnly
|
|
65
|
-
size={5}
|
|
66
54
|
density='fine'
|
|
67
|
-
classNames='
|
|
55
|
+
classNames='plb-1 pli-1.5'
|
|
68
56
|
/>
|
|
69
57
|
</div>
|
|
70
58
|
</div>
|
|
@@ -72,7 +60,7 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
72
60
|
{/* Small */}
|
|
73
61
|
<div className='grid grid-cols-3 gap-4'>
|
|
74
62
|
<div className='flex justify-center'>
|
|
75
|
-
<Button {...args} density='fine' classNames={'!h-[24px] !text-[14px] p-0
|
|
63
|
+
<Button {...args} density='fine' classNames={'!h-[24px] !text-[14px] p-0 pli-1.5 min-bs-0'}>
|
|
76
64
|
{children}
|
|
77
65
|
</Button>
|
|
78
66
|
</div>
|
|
@@ -101,18 +89,17 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
101
89
|
|
|
102
90
|
{/* TODO(burdon): Full variant with max width. */}
|
|
103
91
|
<div className='flex justify-center'>
|
|
104
|
-
<Button classNames='
|
|
92
|
+
<Button classNames='is-full max-is-[15rem] rounded' variant='default'>
|
|
105
93
|
Test
|
|
106
94
|
</Button>
|
|
107
95
|
</div>
|
|
108
96
|
<div className='flex justify-center'>
|
|
109
97
|
{/* TODO(burdon): Option to have button on RHS. Default size for icon should be 5 for this (medium) density. */}
|
|
110
98
|
<IconButton
|
|
111
|
-
classNames='
|
|
99
|
+
classNames='is-full max-is-[15rem] rounded'
|
|
112
100
|
variant='primary'
|
|
113
101
|
icon='ph--arrows-clockwise--regular'
|
|
114
102
|
label='Test'
|
|
115
|
-
size={5}
|
|
116
103
|
/>
|
|
117
104
|
</div>
|
|
118
105
|
</div>
|
|
@@ -120,13 +107,15 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
120
107
|
);
|
|
121
108
|
};
|
|
122
109
|
|
|
123
|
-
const meta
|
|
124
|
-
title: 'ui/react-ui-core/
|
|
110
|
+
const meta = {
|
|
111
|
+
title: 'ui/react-ui-core/playground/Custom',
|
|
125
112
|
component: Button,
|
|
126
113
|
render: DefaultStory,
|
|
127
|
-
decorators: [withTheme],
|
|
128
|
-
parameters: {
|
|
129
|
-
|
|
114
|
+
decorators: [withTheme()],
|
|
115
|
+
parameters: {
|
|
116
|
+
layout: 'centered',
|
|
117
|
+
},
|
|
118
|
+
} satisfies Meta<typeof Button>;
|
|
130
119
|
|
|
131
120
|
export default meta;
|
|
132
121
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
9
8
|
import { withTheme } from '../testing';
|
|
@@ -43,13 +42,16 @@ const DefaultStory = () => {
|
|
|
43
42
|
);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
title: 'ui/react-ui-core/
|
|
45
|
+
const meta = {
|
|
46
|
+
title: 'ui/react-ui-core/playground/Typography',
|
|
48
47
|
render: DefaultStory,
|
|
49
|
-
decorators: [withTheme],
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
decorators: [withTheme()],
|
|
49
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
50
|
+
|
|
51
|
+
export default meta;
|
|
52
|
+
|
|
53
|
+
type Story = StoryObj<typeof meta>;
|
|
52
54
|
|
|
53
|
-
export const Default = {
|
|
55
|
+
export const Default: Story = {
|
|
54
56
|
args: {},
|
|
55
57
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { Input } from '../../components';
|
|
9
|
+
import { withTheme } from '../../testing';
|
|
10
|
+
|
|
11
|
+
import { Container, type ContainerRootProps } from './Container';
|
|
12
|
+
|
|
13
|
+
const DefaultStory = (props: ContainerRootProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className='plb-2 is-[20rem] border border-separator rounded-sm'>
|
|
16
|
+
<Container.Root {...props}>
|
|
17
|
+
<Container.Column>
|
|
18
|
+
<Input.Root>
|
|
19
|
+
<Input.Label>Label</Input.Label>
|
|
20
|
+
<Input.TextInput />
|
|
21
|
+
</Input.Root>
|
|
22
|
+
</Container.Column>
|
|
23
|
+
</Container.Root>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const meta: Meta<typeof Container.Root> = {
|
|
29
|
+
title: 'ui/react-ui-core/primitives/Container',
|
|
30
|
+
component: Container.Root,
|
|
31
|
+
render: DefaultStory,
|
|
32
|
+
decorators: [withTheme()],
|
|
33
|
+
parameters: {
|
|
34
|
+
layout: 'centered',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
// TODO(burdon): Requires container.
|
|
43
|
+
export const Default = () => {
|
|
44
|
+
return (
|
|
45
|
+
<Container.Root>
|
|
46
|
+
<Container.Column>Column</Container.Column>
|
|
47
|
+
</Container.Root>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const SM: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
variant: 'sm',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const MD: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
variant: 'md',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const LG: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
variant: 'lg',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { createContext } from '@radix-ui/react-context';
|
|
6
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
+
import React, { type PropsWithChildren, type Ref, forwardRef } from 'react';
|
|
9
|
+
|
|
10
|
+
import { type ColumnPadding } from '@dxos/ui-theme';
|
|
11
|
+
import { type SlottableProps } from '@dxos/ui-types';
|
|
12
|
+
|
|
13
|
+
import { useThemeContext } from '../../hooks';
|
|
14
|
+
|
|
15
|
+
// TODO(burdon): Replace Form, Container, Card spacing.
|
|
16
|
+
// TODO(burdon): Scrolling (reconcile with Mosaic Viewport).
|
|
17
|
+
// TODO(burdon): Reconcile AnchoredOverflow.
|
|
18
|
+
|
|
19
|
+
//
|
|
20
|
+
// Context
|
|
21
|
+
//
|
|
22
|
+
|
|
23
|
+
type ContainerContext = {
|
|
24
|
+
variant?: ColumnPadding;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const [ContainerProvider, useContext] = createContext<ContainerContext>('Container');
|
|
28
|
+
|
|
29
|
+
//
|
|
30
|
+
// Root
|
|
31
|
+
//
|
|
32
|
+
|
|
33
|
+
type RootProps = PropsWithChildren<Partial<ContainerContext>>;
|
|
34
|
+
|
|
35
|
+
const Root = ({ variant, children }: RootProps) => {
|
|
36
|
+
return <ContainerProvider {...{ variant }}>{children}</ContainerProvider>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//
|
|
40
|
+
// Column
|
|
41
|
+
//
|
|
42
|
+
|
|
43
|
+
const CONTAINER_COLUMN_NAME = 'Container.Column';
|
|
44
|
+
|
|
45
|
+
type ColumnProps = SlottableProps<HTMLDivElement> & { variant?: ColumnPadding };
|
|
46
|
+
|
|
47
|
+
const Column = forwardRef(
|
|
48
|
+
(
|
|
49
|
+
{ classNames, className, asChild, role = 'none', children, variant, ...props }: ColumnProps,
|
|
50
|
+
ref: Ref<HTMLDivElement>,
|
|
51
|
+
) => {
|
|
52
|
+
const { tx } = useThemeContext();
|
|
53
|
+
const Root = asChild ? Slot : Primitive.div;
|
|
54
|
+
const context = useContext(CONTAINER_COLUMN_NAME);
|
|
55
|
+
return (
|
|
56
|
+
<Root
|
|
57
|
+
{...props}
|
|
58
|
+
className={tx('container.column', { variant: variant ?? context.variant }, [className, classNames])}
|
|
59
|
+
role={role}
|
|
60
|
+
ref={ref}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</Root>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
Column.displayName = CONTAINER_COLUMN_NAME;
|
|
69
|
+
|
|
70
|
+
//
|
|
71
|
+
// Container
|
|
72
|
+
//
|
|
73
|
+
|
|
74
|
+
export const Container = {
|
|
75
|
+
Root,
|
|
76
|
+
Column,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type { RootProps as ContainerRootProps, ColumnProps as ContainerColumnProps };
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { Input, ScrollArea, Toolbar } from '../../components';
|
|
9
|
+
import { withLayout, withTheme } from '../../testing';
|
|
10
|
+
|
|
11
|
+
import { Layout } from './Layout';
|
|
12
|
+
|
|
13
|
+
const DefaultStory = ({ count }: { count: number }) => {
|
|
14
|
+
return (
|
|
15
|
+
<Layout.Main toolbar statusbar>
|
|
16
|
+
<Toolbar.Root classNames='gap-2'>
|
|
17
|
+
<Toolbar.IconButton icon='ph--plus--regular' variant='primary' label='Add' />
|
|
18
|
+
<Input.Root>
|
|
19
|
+
<Input.TextInput placeholder='Search' />
|
|
20
|
+
</Input.Root>
|
|
21
|
+
<Toolbar.IconButton icon='ph--dots-three-vertical--regular' iconOnly label='Menu' />
|
|
22
|
+
</Toolbar.Root>
|
|
23
|
+
<ScrollArea.Root thin orientation='vertical'>
|
|
24
|
+
<ScrollArea.Viewport classNames='pli-2 plb-1 gap-1'>
|
|
25
|
+
{Array.from({ length: count }).map((_, index) => (
|
|
26
|
+
<div key={index} role='listitem' className='pli-2 plb-1 border border-separator'>
|
|
27
|
+
{index}
|
|
28
|
+
</div>
|
|
29
|
+
))}
|
|
30
|
+
</ScrollArea.Viewport>
|
|
31
|
+
</ScrollArea.Root>
|
|
32
|
+
<Toolbar.Root classNames='justify-between'>
|
|
33
|
+
<Toolbar.IconButton variant='ghost' icon='ph--house--regular' iconOnly label='Add' size={4} />
|
|
34
|
+
<Toolbar.IconButton variant='ghost' icon='ph--alarm--regular' iconOnly label='Status' size={4} />
|
|
35
|
+
</Toolbar.Root>
|
|
36
|
+
</Layout.Main>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const meta: Meta<typeof DefaultStory> = {
|
|
41
|
+
title: 'ui/react-ui-core/primitives/Layout',
|
|
42
|
+
component: DefaultStory,
|
|
43
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
44
|
+
parameters: {
|
|
45
|
+
layout: 'fullscreen',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default meta;
|
|
50
|
+
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
52
|
+
|
|
53
|
+
export const Default: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
count: 100,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type PropsWithChildren, forwardRef, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { mx } from '@dxos/ui-theme';
|
|
8
|
+
import { type ThemedClassName } from '@dxos/ui-types';
|
|
9
|
+
|
|
10
|
+
//
|
|
11
|
+
// Main
|
|
12
|
+
//
|
|
13
|
+
|
|
14
|
+
type MainProps = ThemedClassName<
|
|
15
|
+
PropsWithChildren<{
|
|
16
|
+
role?: string;
|
|
17
|
+
toolbar?: boolean;
|
|
18
|
+
statusbar?: boolean;
|
|
19
|
+
}>
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
const Main = forwardRef<HTMLDivElement, MainProps>(
|
|
23
|
+
({ classNames, children, role, toolbar, statusbar }, forwardedRef) => {
|
|
24
|
+
const style = useMemo(
|
|
25
|
+
() => ({
|
|
26
|
+
gridTemplateRows: [toolbar && 'var(--toolbar-size)', '1fr', statusbar && 'var(--statusbar-size)']
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.join(' '),
|
|
29
|
+
}),
|
|
30
|
+
[toolbar, statusbar],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
ref={forwardedRef}
|
|
36
|
+
role={role ?? 'none'}
|
|
37
|
+
style={style}
|
|
38
|
+
className={mx(
|
|
39
|
+
'bs-full is-full grid grid-cols-[100%] overflow-hidden',
|
|
40
|
+
toolbar && [
|
|
41
|
+
'[.dx-main-mobile-layout_&>.dx-toolbar]:pli-3 [&>.dx-toolbar]:relative',
|
|
42
|
+
'[&>.dx-toolbar]:border-be [&>.dx-toolbar]:border-subduedSeparator',
|
|
43
|
+
],
|
|
44
|
+
classNames,
|
|
45
|
+
)}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
//
|
|
54
|
+
// Layout
|
|
55
|
+
//
|
|
56
|
+
|
|
57
|
+
export const Layout = {
|
|
58
|
+
Main,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type { MainProps as LayoutMainProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type HTMLAttributes } from 'react';
|
|
6
|
+
|
|
7
|
+
import { mx } from '@dxos/ui-theme';
|
|
8
|
+
import { type ThemedClassName } from '@dxos/ui-types';
|
|
9
|
+
|
|
10
|
+
export type FlexProps = ThemedClassName<
|
|
11
|
+
HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
column?: boolean;
|
|
13
|
+
grow?: boolean;
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export const Flex = ({ children, classNames, role, column, grow }: FlexProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
role={role ?? 'none'}
|
|
21
|
+
className={mx('flex', column && 'flex-col', grow && 'flex-1 overflow-hidden', classNames)}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Decorator } from '@storybook/react';
|
|
6
|
+
import React, { type FC, type PropsWithChildren, memo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type ClassNameValue, type ThemedClassName } from '@dxos/react-ui';
|
|
9
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
export type ContainerProps = ThemedClassName<PropsWithChildren>;
|
|
12
|
+
|
|
13
|
+
export type ContainerType = 'fullscreen' | 'column';
|
|
14
|
+
|
|
15
|
+
export type WithLayoutProps =
|
|
16
|
+
| FC<ContainerProps>
|
|
17
|
+
| {
|
|
18
|
+
classNames?: ClassNameValue;
|
|
19
|
+
layout?: ContainerType;
|
|
20
|
+
scroll?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Adds layout container.
|
|
25
|
+
*/
|
|
26
|
+
export const withLayout =
|
|
27
|
+
(props: WithLayoutProps = {}): Decorator =>
|
|
28
|
+
(Story) => {
|
|
29
|
+
// Prevent re-rendering of the story.
|
|
30
|
+
const MemoizedStory = memo(Story);
|
|
31
|
+
if (typeof props === 'function') {
|
|
32
|
+
const Container = props;
|
|
33
|
+
return (
|
|
34
|
+
<Container>
|
|
35
|
+
<MemoizedStory />
|
|
36
|
+
</Container>
|
|
37
|
+
);
|
|
38
|
+
} else {
|
|
39
|
+
const { layout = 'fullscreen', classNames, scroll } = props;
|
|
40
|
+
const Container = layouts[layout] ?? layouts.fullscreen;
|
|
41
|
+
return (
|
|
42
|
+
<Container classNames={mx(classNames, scroll ? 'overflow-y-auto' : 'overflow-hidden')}>
|
|
43
|
+
<MemoizedStory />
|
|
44
|
+
</Container>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const layouts: Record<ContainerType, FC<ContainerProps>> = {
|
|
50
|
+
fullscreen: ({ children, classNames }: ContainerProps) => (
|
|
51
|
+
<div role='none' className={mx('fixed inset-0 flex overflow-hidden bg-deckSurface', classNames)}>
|
|
52
|
+
{children}
|
|
53
|
+
</div>
|
|
54
|
+
),
|
|
55
|
+
|
|
56
|
+
column: ({ children, classNames }: ContainerProps) => (
|
|
57
|
+
<div role='none' className='fixed inset-0 flex justify-center overflow-hidden bg-deckSurface'>
|
|
58
|
+
<div role='none' className={mx('flex flex-col is-[40rem] bg-baseSurface', classNames)}>
|
|
59
|
+
{children}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type Decorator } from '@storybook/react';
|
|
6
6
|
import React, { type ComponentType, type PropsWithChildren } from 'react';
|
|
7
7
|
|
|
8
|
-
import { mx, surfaceShadow } from '@dxos/
|
|
9
|
-
import { type Density, type Elevation } from '@dxos/
|
|
8
|
+
import { mx, surfaceShadow } from '@dxos/ui-theme';
|
|
9
|
+
import { type Density, type Elevation } from '@dxos/ui-types';
|
|
10
10
|
|
|
11
11
|
type Config = {
|
|
12
12
|
elevations?: { elevation: Elevation; surface?: string }[];
|
|
@@ -23,7 +23,7 @@ const Panel = ({
|
|
|
23
23
|
densities,
|
|
24
24
|
className,
|
|
25
25
|
}: { Story: ComponentType } & Config & { className?: string }) => (
|
|
26
|
-
<div className={mx('flex flex-col
|
|
26
|
+
<div className={mx('flex flex-col bs-full p-4 gap-4', className)}>
|
|
27
27
|
{elevations?.map(({ elevation, surface }) =>
|
|
28
28
|
densities?.map((density) => (
|
|
29
29
|
<Container key={`${elevation}--${density}`} surface={surface} elevation={elevation}>
|
|
@@ -34,7 +34,7 @@ const Panel = ({
|
|
|
34
34
|
</div>
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
export const
|
|
37
|
+
export const withLayoutVariants = ({
|
|
38
38
|
elevations = [
|
|
39
39
|
{ elevation: 'base', surface: 'bg-baseSurface' },
|
|
40
40
|
{ elevation: 'positioned', surface: 'bg-cardSurface' },
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Decorator } from '@storybook/react';
|
|
6
|
+
import React, { memo } from 'react';
|
|
7
|
+
|
|
8
|
+
import { defaultTx } from '@dxos/ui-theme';
|
|
9
|
+
import { type ThemeMode } from '@dxos/ui-types';
|
|
10
|
+
|
|
11
|
+
import { type ThemeContextValue, ThemeProvider, Tooltip } from '../../components';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Adds theme decorator.
|
|
15
|
+
*/
|
|
16
|
+
export const withTheme =
|
|
17
|
+
({ tx = defaultTx, ...props }: Partial<ThemeContextValue> = {}): Decorator =>
|
|
18
|
+
(Story, context) => {
|
|
19
|
+
const {
|
|
20
|
+
globals: { theme },
|
|
21
|
+
parameters: { translations },
|
|
22
|
+
} = context;
|
|
23
|
+
|
|
24
|
+
// Prevent re-rendering of the story.
|
|
25
|
+
const MemoizedStory = memo(Story);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ThemeProvider {...props} tx={tx} themeMode={theme as ThemeMode} resourceExtensions={translations} noCache>
|
|
29
|
+
<Tooltip.Provider>
|
|
30
|
+
<MemoizedStory />
|
|
31
|
+
</Tooltip.Provider>
|
|
32
|
+
</ThemeProvider>
|
|
33
|
+
);
|
|
34
|
+
};
|