@dxos/react-ui 0.8.4-main.67995b8 → 0.8.4-main.69d29f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/chunk-CEKVHJ27.mjs +774 -0
- package/dist/lib/browser/chunk-CEKVHJ27.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3069 -59
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +65 -49
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs +776 -0
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3069 -59
- 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 +65 -49
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +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 +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/{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 +40 -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 +11 -12
- 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 +10 -19
- 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 +3 -3
- 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 +10 -8
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +8 -30
- 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 +4 -9
- 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/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 +2 -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 +17 -17
- 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 +5 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/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 +1 -1
- 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/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 +3 -0
- 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 +37 -31
- package/src/components/Avatars/Avatar.stories.tsx +21 -12
- package/src/components/Avatars/Avatar.tsx +4 -4
- package/src/components/Avatars/AvatarGroup.stories.tsx +10 -6
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +17 -12
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/{Buttons → Button}/Button.stories.tsx +8 -9
- package/src/components/{Buttons → Button}/Button.tsx +1 -1
- package/src/components/{Buttons → Button}/IconButton.stories.tsx +11 -8
- package/src/components/{Buttons → Button}/IconButton.tsx +22 -15
- package/src/components/{Buttons → Button}/Toggle.stories.tsx +13 -9
- package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +10 -7
- package/src/components/{Buttons → Button}/ToggleGroup.tsx +17 -4
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +6 -5
- package/src/components/DensityProvider/DensityProvider.tsx +2 -2
- package/src/components/{Dialogs → Dialog}/AlertDialog.stories.tsx +15 -12
- package/src/components/{Dialogs → Dialog}/AlertDialog.tsx +13 -13
- package/src/components/Dialog/Dialog.stories.tsx +97 -0
- package/src/components/{Dialogs → Dialog}/Dialog.tsx +151 -51
- package/src/components/ElevationProvider/ElevationProvider.tsx +2 -2
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +2 -2
- package/src/components/Input/Input.stories.tsx +13 -15
- package/src/components/Input/Input.tsx +28 -19
- package/src/components/Link/Link.stories.tsx +10 -6
- package/src/components/{Lists → List}/List.stories.tsx +32 -26
- package/src/components/{Lists → List}/List.tsx +17 -13
- package/src/components/{Lists → List}/ListDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Tree.stories.tsx +11 -8
- 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 +12 -6
- package/src/components/{Lists → List}/Treegrid.tsx +58 -17
- package/src/components/Main/Main.stories.tsx +17 -9
- package/src/components/Main/Main.tsx +43 -28
- package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +11 -8
- package/src/components/{Menus → Menu}/ContextMenu.tsx +1 -0
- package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +12 -9
- package/src/components/{Menus → Menu}/DropdownMenu.tsx +102 -71
- package/src/components/Message/Message.stories.tsx +12 -8
- package/src/components/Message/Message.tsx +30 -5
- package/src/components/Popover/Popover.stories.tsx +12 -9
- package/src/components/Popover/Popover.tsx +64 -45
- package/src/components/ScrollArea/ScrollArea.stories.tsx +64 -11
- package/src/components/ScrollArea/ScrollArea.tsx +54 -8
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +70 -0
- package/src/components/ScrollContainer/ScrollContainer.tsx +233 -0
- package/src/components/ScrollContainer/index.ts +5 -0
- package/src/components/Select/Select.stories.tsx +15 -12
- package/src/components/Select/Select.tsx +9 -8
- package/src/components/Status/Status.stories.tsx +9 -6
- package/src/components/Tag/Tag.stories.tsx +20 -11
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +3 -4
- package/src/components/ThemeProvider/TranslationsProvider.tsx +3 -18
- package/src/components/ThemeProvider/index.ts +3 -3
- package/src/components/Toast/Toast.stories.tsx +12 -9
- package/src/components/Toast/Toast.tsx +9 -9
- package/src/components/Toolbar/Toolbar.stories.tsx +14 -12
- package/src/components/Toolbar/Toolbar.tsx +37 -10
- package/src/components/Tooltip/Tooltip.stories.tsx +16 -12
- package/src/components/Tooltip/Tooltip.tsx +27 -24
- package/src/components/index.ts +5 -4
- package/src/hooks/useDensityContext.ts +1 -1
- package/src/hooks/useElevationContext.ts +1 -1
- package/src/hooks/useSafeArea.ts +3 -2
- package/src/hooks/useVisualViewport.ts +4 -4
- package/src/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +12 -8
- package/src/playground/Custom.stories.tsx +13 -24
- package/src/playground/Typography.stories.tsx +8 -6
- package/src/testing/decorators/index.ts +2 -1
- package/src/testing/decorators/withLayout.tsx +63 -0
- package/src/testing/decorators/{withSurfaceVariantsLayout.tsx → withLayoutVariants.tsx} +5 -5
- package/src/testing/decorators/withTheme.tsx +32 -0
- package/src/util/index.ts +3 -1
- package/src/util/usePx.ts +61 -0
- package/dist/lib/browser/chunk-2COVUP44.mjs +0 -4373
- package/dist/lib/browser/chunk-2COVUP44.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GHXHND5V.mjs +0 -4375
- package/dist/lib/node-esm/chunk-GHXHND5V.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/Dialogs/Dialog.stories.tsx +0 -65
- package/src/testing/decorators/withTheme.ts +0 -25
- 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
package/package.json
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.69d29f4",
|
|
4
4
|
"description": "Low-level React components for DXOS, applying a theme to a core group of primitives",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": false,
|
|
10
14
|
"type": "module",
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
17
|
+
"source": "./src/index.ts",
|
|
13
18
|
"types": "./dist/types/src/index.d.ts",
|
|
14
19
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
-
"source": "./src/index.ts"
|
|
20
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
17
21
|
},
|
|
18
22
|
"./testing": {
|
|
23
|
+
"source": "./src/testing/index.ts",
|
|
19
24
|
"types": "./dist/types/src/testing/index.d.ts",
|
|
20
25
|
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
21
|
-
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
22
|
-
"source": "./src/testing/index.ts"
|
|
26
|
+
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -35,10 +39,9 @@
|
|
|
35
39
|
"src"
|
|
36
40
|
],
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"@atlaskit/pragmatic-drag-and-drop-hitbox": "
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
42
|
+
"@atlaskit/pragmatic-drag-and-drop-hitbox": "1.1.0",
|
|
43
|
+
"@effect-atom/atom-react": "^0.4.6",
|
|
44
|
+
"@fluentui/react-tabster": "9.26.11",
|
|
42
45
|
"@radix-ui/primitive": "1.1.1",
|
|
43
46
|
"@radix-ui/react-alert-dialog": "1.1.6",
|
|
44
47
|
"@radix-ui/react-avatar": "1.1.3",
|
|
@@ -57,7 +60,7 @@
|
|
|
57
60
|
"@radix-ui/react-portal": "1.1.4",
|
|
58
61
|
"@radix-ui/react-presence": "1.1.2",
|
|
59
62
|
"@radix-ui/react-primitive": "2.0.2",
|
|
60
|
-
"@radix-ui/react-scroll-area": "1.2.
|
|
63
|
+
"@radix-ui/react-scroll-area": "1.2.10",
|
|
61
64
|
"@radix-ui/react-select": "2.1.6",
|
|
62
65
|
"@radix-ui/react-separator": "1.1.2",
|
|
63
66
|
"@radix-ui/react-slot": "1.1.2",
|
|
@@ -75,33 +78,36 @@
|
|
|
75
78
|
"keyborg": "^2.5.0",
|
|
76
79
|
"react-i18next": "^11.18.6",
|
|
77
80
|
"react-remove-scroll": "^2.6.0",
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/react-input": "0.8.4-main.
|
|
85
|
-
"@dxos/
|
|
81
|
+
"@dxos/invariant": "0.8.4-main.69d29f4",
|
|
82
|
+
"@dxos/debug": "0.8.4-main.69d29f4",
|
|
83
|
+
"@dxos/async": "0.8.4-main.69d29f4",
|
|
84
|
+
"@dxos/lit-ui": "0.8.4-main.69d29f4",
|
|
85
|
+
"@dxos/log": "0.8.4-main.69d29f4",
|
|
86
|
+
"@dxos/react-hooks": "0.8.4-main.69d29f4",
|
|
87
|
+
"@dxos/react-input": "0.8.4-main.69d29f4",
|
|
88
|
+
"@dxos/ui-types": "0.8.4-main.69d29f4",
|
|
89
|
+
"@dxos/react-list": "0.8.4-main.69d29f4",
|
|
90
|
+
"@dxos/util": "0.8.4-main.69d29f4"
|
|
86
91
|
},
|
|
87
92
|
"devDependencies": {
|
|
88
93
|
"@dnd-kit/core": "^6.0.5",
|
|
89
94
|
"@dnd-kit/sortable": "^7.0.1",
|
|
90
95
|
"@dnd-kit/utilities": "^3.2.0",
|
|
91
|
-
"@
|
|
92
|
-
"@types/react
|
|
93
|
-
"react": "~
|
|
94
|
-
"react
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"@dxos/
|
|
96
|
+
"@phosphor-icons/react": "2.1.10",
|
|
97
|
+
"@types/react": "~19.2.7",
|
|
98
|
+
"@types/react-dom": "~19.2.3",
|
|
99
|
+
"react": "~19.2.3",
|
|
100
|
+
"react-dom": "~19.2.3",
|
|
101
|
+
"tabster": "^8.5.5",
|
|
102
|
+
"vite": "7.1.9",
|
|
103
|
+
"@dxos/random": "0.8.4-main.69d29f4",
|
|
104
|
+
"@dxos/ui-theme": "0.8.4-main.69d29f4",
|
|
105
|
+
"@dxos/util": "0.8.4-main.69d29f4"
|
|
99
106
|
},
|
|
100
107
|
"peerDependencies": {
|
|
101
|
-
"
|
|
102
|
-
"react": "~
|
|
103
|
-
"
|
|
104
|
-
"@dxos/react-ui-theme": "0.8.4-main.67995b8"
|
|
108
|
+
"react": "~19.2.3",
|
|
109
|
+
"react-dom": "~19.2.3",
|
|
110
|
+
"@dxos/ui-theme": "0.8.4-main.69d29f4"
|
|
105
111
|
},
|
|
106
112
|
"publishConfig": {
|
|
107
113
|
"access": "public"
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta } from '@storybook/react-vite';
|
|
6
6
|
import React, { type PropsWithChildren } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type HuePalette } from '@dxos/
|
|
9
|
-
import { type Size } from '@dxos/
|
|
8
|
+
import { type HuePalette } from '@dxos/ui-theme';
|
|
9
|
+
import { type Size } from '@dxos/ui-types';
|
|
10
10
|
import { hexToFallback } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import { Avatar, type AvatarVariant, type AvatarStatus, type AvatarAnimation } from './Avatar';
|
|
13
12
|
import { withTheme } from '../../testing';
|
|
14
13
|
|
|
15
|
-
type
|
|
14
|
+
import { Avatar, type AvatarAnimation, type AvatarStatus, type AvatarVariant } from './Avatar';
|
|
15
|
+
|
|
16
|
+
type StoryProps = PropsWithChildren<{
|
|
16
17
|
id?: string;
|
|
17
18
|
imgSrc?: string;
|
|
18
19
|
fallbackText?: string;
|
|
@@ -23,9 +24,9 @@ type StoryProps = {
|
|
|
23
24
|
animation?: AvatarAnimation;
|
|
24
25
|
size?: Size;
|
|
25
26
|
hue?: HuePalette;
|
|
26
|
-
}
|
|
27
|
+
}>;
|
|
27
28
|
|
|
28
|
-
const DefaultStory = (props:
|
|
29
|
+
const DefaultStory = (props: StoryProps) => {
|
|
29
30
|
const {
|
|
30
31
|
id = '20970b563fc49b5bb194a6ffdff376031a3a11f9481360c071c3fed87874106b',
|
|
31
32
|
status,
|
|
@@ -55,17 +56,19 @@ const DefaultStory = (props: PropsWithChildren<StoryProps>) => {
|
|
|
55
56
|
);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
const meta = {
|
|
59
60
|
title: 'ui/react-ui-core/Avatar',
|
|
60
|
-
component: Avatar,
|
|
61
|
-
render: DefaultStory,
|
|
61
|
+
component: Avatar.Root,
|
|
62
62
|
decorators: [withTheme],
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
} satisfies Meta<typeof Avatar.Root>;
|
|
64
|
+
|
|
65
|
+
export default meta;
|
|
65
66
|
|
|
66
67
|
const sampleImage =
|
|
67
68
|
'https://png.pngtree.com/thumb_back/fh260/background/20230614/pngtree-the-photo-of-a-woman-with-red-sunglasses-is-surrounded-by-image_2931163.jpg';
|
|
68
69
|
|
|
70
|
+
const brokenImage = 'https://png.pngtree.com/potato_squirrel.png';
|
|
71
|
+
|
|
69
72
|
const row = (size: Size) => (
|
|
70
73
|
<>
|
|
71
74
|
<DefaultStory size={size} status='inactive' description='Offline' />
|
|
@@ -97,6 +100,12 @@ export const Image = () => (
|
|
|
97
100
|
</div>
|
|
98
101
|
);
|
|
99
102
|
|
|
103
|
+
export const BrokenImage = () => (
|
|
104
|
+
<div>
|
|
105
|
+
<DefaultStory variant='circle' imgSrc={brokenImage} />
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
|
|
100
109
|
export const Square = () => (
|
|
101
110
|
<div className='flex flex-row gap-4'>
|
|
102
111
|
<DefaultStory variant='square' status='inactive' description='Offline' />
|
|
@@ -7,17 +7,17 @@ import '@dxos/lit-ui/dx-avatar.pcss';
|
|
|
7
7
|
import { createContext } from '@radix-ui/react-context';
|
|
8
8
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
|
-
import React, { type ComponentProps, type ComponentPropsWithRef,
|
|
10
|
+
import React, { type ComponentProps, type ComponentPropsWithRef, type PropsWithChildren, forwardRef } from 'react';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
|
-
type AvatarVariant,
|
|
14
|
-
type AvatarStatus,
|
|
15
13
|
type AvatarAnimation,
|
|
14
|
+
type AvatarStatus,
|
|
15
|
+
type AvatarVariant,
|
|
16
16
|
type DxAvatar as NaturalDxAvatar,
|
|
17
17
|
} from '@dxos/lit-ui';
|
|
18
18
|
import { DxAvatar } from '@dxos/lit-ui/react';
|
|
19
19
|
import { useId } from '@dxos/react-hooks';
|
|
20
|
-
import { mx } from '@dxos/
|
|
20
|
+
import { mx } from '@dxos/ui-theme';
|
|
21
21
|
|
|
22
22
|
import { useIconHref, useThemeContext } from '../../hooks';
|
|
23
23
|
import { type ThemedClassName } from '../../util';
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { useId } from '@dxos/react-hooks';
|
|
9
9
|
import { toEmoji } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import { Avatar } from './Avatar';
|
|
12
11
|
import { withTheme } from '../../testing';
|
|
13
12
|
|
|
13
|
+
import { Avatar } from './Avatar';
|
|
14
|
+
|
|
14
15
|
const hues = ['lime', 'teal', 'purple', 'pink'];
|
|
15
16
|
|
|
16
17
|
const AvatarItem = ({ n }: { n: number }) => {
|
|
@@ -36,13 +37,16 @@ const DefaultStory = () => {
|
|
|
36
37
|
);
|
|
37
38
|
};
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
const meta = {
|
|
40
41
|
title: 'ui/react-ui-core/AvatarGroup',
|
|
41
42
|
render: DefaultStory,
|
|
42
43
|
decorators: [withTheme],
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof meta>;
|
|
45
49
|
|
|
46
|
-
export const Default = {
|
|
50
|
+
export const Default: Story = {
|
|
47
51
|
args: {},
|
|
48
52
|
};
|
|
@@ -2,17 +2,17 @@
|
|
|
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
|
-
import { Breadcrumb } from './Breadcrumb';
|
|
10
8
|
import { withTheme } from '../../testing';
|
|
11
|
-
import { Button } from '../
|
|
9
|
+
import { Button } from '../Button';
|
|
10
|
+
|
|
11
|
+
import { Breadcrumb, type BreadcrumbRootProps } from './Breadcrumb';
|
|
12
12
|
|
|
13
|
-
const DefaultStory = () => {
|
|
13
|
+
const DefaultStory = (props: BreadcrumbRootProps) => {
|
|
14
14
|
return (
|
|
15
|
-
<Breadcrumb.Root
|
|
15
|
+
<Breadcrumb.Root {...props}>
|
|
16
16
|
<Breadcrumb.List>
|
|
17
17
|
<Breadcrumb.ListItem>
|
|
18
18
|
<Breadcrumb.Link asChild>
|
|
@@ -38,14 +38,19 @@ const DefaultStory = () => {
|
|
|
38
38
|
);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const meta = {
|
|
42
42
|
title: 'ui/react-ui-core/Breadcrumb',
|
|
43
|
-
component: Breadcrumb,
|
|
43
|
+
component: Breadcrumb.Root as any,
|
|
44
44
|
render: DefaultStory,
|
|
45
45
|
decorators: [withTheme],
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
|
|
50
|
+
type Story = StoryObj<typeof meta>;
|
|
48
51
|
|
|
49
|
-
export const Default = {
|
|
50
|
-
args: {
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
'aria-label': 'Breadcrumb',
|
|
55
|
+
},
|
|
51
56
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import React, { type
|
|
7
|
+
import React, { type ComponentPropsWithRef, type ComponentPropsWithoutRef, forwardRef } from 'react';
|
|
8
8
|
|
|
9
9
|
import { useThemeContext } from '../../hooks';
|
|
10
10
|
import { type ThemedClassName } from '../../util';
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { withTheme } from '../../testing';
|
|
9
|
+
import { withLayoutVariants } from '../../testing';
|
|
12
10
|
import { Icon } from '../Icon';
|
|
13
11
|
|
|
12
|
+
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
13
|
+
|
|
14
14
|
const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
15
15
|
return (
|
|
16
16
|
<div>
|
|
@@ -32,13 +32,12 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const meta
|
|
35
|
+
const meta = {
|
|
36
36
|
title: 'ui/react-ui-core/Button',
|
|
37
37
|
component: Button,
|
|
38
38
|
render: DefaultStory,
|
|
39
|
-
decorators: [
|
|
40
|
-
|
|
41
|
-
};
|
|
39
|
+
decorators: [withTheme, withLayoutVariants()],
|
|
40
|
+
} satisfies Meta<typeof Button>;
|
|
42
41
|
|
|
43
42
|
export default meta;
|
|
44
43
|
|
|
@@ -7,7 +7,7 @@ import { Primitive } from '@radix-ui/react-primitive';
|
|
|
7
7
|
import { Slot } from '@radix-ui/react-slot';
|
|
8
8
|
import React, { type ComponentPropsWithRef, forwardRef, memo } from 'react';
|
|
9
9
|
|
|
10
|
-
import { type Density, type Elevation } from '@dxos/
|
|
10
|
+
import { type Density, type Elevation } from '@dxos/ui-types';
|
|
11
11
|
|
|
12
12
|
import { useDensityContext, useElevationContext, useThemeContext } from '../../hooks';
|
|
13
13
|
import { type ThemedClassName } from '../../util';
|
|
@@ -2,14 +2,14 @@
|
|
|
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
|
-
import { IconButton, type IconButtonProps } from './IconButton';
|
|
10
8
|
import { withTheme } from '../../testing';
|
|
11
9
|
import { Tooltip } from '../Tooltip';
|
|
12
10
|
|
|
11
|
+
import { IconButton, type IconButtonProps } from './IconButton';
|
|
12
|
+
|
|
13
13
|
const DefaultStory = (props: IconButtonProps) => {
|
|
14
14
|
return (
|
|
15
15
|
<Tooltip.Provider>
|
|
@@ -23,15 +23,18 @@ const DefaultStory = (props: IconButtonProps) => {
|
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const meta = {
|
|
27
27
|
title: 'ui/react-ui-core/IconButton',
|
|
28
28
|
component: IconButton,
|
|
29
|
-
render: DefaultStory,
|
|
29
|
+
render: DefaultStory as any,
|
|
30
30
|
decorators: [withTheme],
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
} satisfies Meta<typeof IconButton>;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
33
36
|
|
|
34
|
-
export const Default = {
|
|
37
|
+
export const Default: Story = {
|
|
35
38
|
args: {
|
|
36
39
|
label: 'Bold',
|
|
37
40
|
icon: 'ph--text-b--regular',
|
|
@@ -4,28 +4,38 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Button, type ButtonProps } from './Button';
|
|
8
7
|
import { useThemeContext } from '../../hooks';
|
|
9
8
|
import { type ThemedClassName } from '../../util';
|
|
10
9
|
import { Icon, type IconProps } from '../Icon';
|
|
11
10
|
import { Tooltip, type TooltipSide } from '../Tooltip';
|
|
12
11
|
|
|
12
|
+
import { Button, type ButtonProps } from './Button';
|
|
13
|
+
|
|
13
14
|
type IconButtonProps = Omit<ButtonProps, 'children'> &
|
|
14
|
-
Pick<IconProps, 'icon' | 'size'
|
|
15
|
+
Partial<Pick<IconProps, 'icon' | 'size'>> & {
|
|
15
16
|
label: string;
|
|
16
|
-
iconOnly?: boolean;
|
|
17
17
|
noTooltip?: boolean;
|
|
18
18
|
caretDown?: boolean;
|
|
19
|
+
iconOnly?: boolean;
|
|
20
|
+
iconEnd?: boolean;
|
|
19
21
|
iconClassNames?: ThemedClassName<any>['classNames'];
|
|
20
|
-
tooltipPortal?: boolean;
|
|
21
22
|
tooltipSide?: TooltipSide;
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>((props, forwardedRef) =>
|
|
26
|
+
props.iconOnly ? (
|
|
27
|
+
<IconOnlyButton {...props} ref={forwardedRef} />
|
|
28
|
+
) : (
|
|
29
|
+
<LabelledIconButton {...props} ref={forwardedRef} />
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
|
|
24
33
|
const IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
25
|
-
({ noTooltip,
|
|
34
|
+
({ noTooltip, tooltipSide, ...props }, forwardedRef) => {
|
|
26
35
|
if (noTooltip) {
|
|
27
36
|
return <LabelledIconButton {...props} ref={forwardedRef} />;
|
|
28
37
|
}
|
|
38
|
+
|
|
29
39
|
return (
|
|
30
40
|
<Tooltip.Trigger asChild content={props.label} side={tooltipSide}>
|
|
31
41
|
<LabelledIconButton {...props} ref={forwardedRef} />
|
|
@@ -34,27 +44,24 @@ const IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
34
44
|
},
|
|
35
45
|
);
|
|
36
46
|
|
|
47
|
+
// TODO(burdon): Inherit size from container/density.
|
|
37
48
|
const LabelledIconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
38
|
-
(
|
|
49
|
+
(
|
|
50
|
+
{ size = 5, icon, iconOnly, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props },
|
|
51
|
+
forwardedRef,
|
|
52
|
+
) => {
|
|
39
53
|
const { tx } = useThemeContext();
|
|
40
54
|
return (
|
|
41
55
|
<Button {...props} classNames={tx('iconButton.root', 'iconButton', { iconOnly }, classNames)} ref={forwardedRef}>
|
|
42
|
-
<Icon icon={icon} size={size} classNames={iconClassNames} />
|
|
56
|
+
{icon && !iconEnd && <Icon icon={icon} size={size} classNames={iconClassNames} />}
|
|
43
57
|
<span className={iconOnly ? 'sr-only' : undefined}>{label}</span>
|
|
58
|
+
{icon && iconEnd && <Icon icon={icon} size={size} classNames={iconClassNames} />}
|
|
44
59
|
{caretDown && <Icon size={3} icon='ph--caret-down--bold' />}
|
|
45
60
|
</Button>
|
|
46
61
|
);
|
|
47
62
|
},
|
|
48
63
|
);
|
|
49
64
|
|
|
50
|
-
const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>((props, forwardedRef) =>
|
|
51
|
-
props.iconOnly ? (
|
|
52
|
-
<IconOnlyButton {...props} ref={forwardedRef} />
|
|
53
|
-
) : (
|
|
54
|
-
<LabelledIconButton {...props} ref={forwardedRef} />
|
|
55
|
-
),
|
|
56
|
-
);
|
|
57
|
-
|
|
58
65
|
export { IconButton };
|
|
59
66
|
|
|
60
67
|
export type { IconButtonProps };
|
|
@@ -2,17 +2,15 @@
|
|
|
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
|
-
import { Toggle } from './Toggle';
|
|
10
8
|
import { withTheme } from '../../testing';
|
|
11
9
|
import { Icon } from '../Icon';
|
|
12
10
|
|
|
13
|
-
type
|
|
11
|
+
import { Toggle, type ToggleProps } from './Toggle';
|
|
14
12
|
|
|
15
|
-
const DefaultStory = (props:
|
|
13
|
+
const DefaultStory = (props: ToggleProps) => {
|
|
16
14
|
return (
|
|
17
15
|
<Toggle {...props}>
|
|
18
16
|
<Icon icon='ph--text-b--regular' />
|
|
@@ -20,14 +18,20 @@ const DefaultStory = (props: StorybookToggleProps) => {
|
|
|
20
18
|
);
|
|
21
19
|
};
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
const meta = {
|
|
24
22
|
title: 'ui/react-ui-core/Toggle',
|
|
25
23
|
component: Toggle,
|
|
26
24
|
render: DefaultStory,
|
|
27
25
|
decorators: [withTheme],
|
|
28
|
-
parameters: {
|
|
29
|
-
|
|
26
|
+
parameters: {
|
|
27
|
+
layout: 'centered',
|
|
28
|
+
},
|
|
29
|
+
} satisfies Meta<typeof Toggle>;
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
30
34
|
|
|
31
|
-
export const Default = {
|
|
35
|
+
export const Default: Story = {
|
|
32
36
|
args: {},
|
|
33
37
|
};
|
|
@@ -2,14 +2,14 @@
|
|
|
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
|
-
import { ToggleGroup, ToggleGroupItem, type ToggleGroupProps } from './ToggleGroup';
|
|
10
8
|
import { withTheme } from '../../testing';
|
|
11
9
|
import { Icon } from '../Icon';
|
|
12
10
|
|
|
11
|
+
import { ToggleGroup, ToggleGroupItem, type ToggleGroupProps } from './ToggleGroup';
|
|
12
|
+
|
|
13
13
|
// TODO(burdon): Create Radix-style Root, Item, etc?
|
|
14
14
|
const DefaultStory = (props: ToggleGroupProps) => {
|
|
15
15
|
return (
|
|
@@ -24,15 +24,18 @@ const DefaultStory = (props: ToggleGroupProps) => {
|
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
const meta = {
|
|
28
28
|
title: 'ui/react-ui-core/ToggleGroup',
|
|
29
29
|
component: ToggleGroup,
|
|
30
30
|
render: DefaultStory,
|
|
31
31
|
decorators: [withTheme],
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
} satisfies Meta<typeof ToggleGroup>;
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
34
37
|
|
|
35
|
-
export const Default = {
|
|
38
|
+
export const Default: Story = {
|
|
36
39
|
args: {
|
|
37
40
|
type: 'single',
|
|
38
41
|
},
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
ToggleGroupItem as ToggleGroupItemPrimitive,
|
|
7
|
+
type ToggleGroupItemProps as ToggleGroupItemPrimitiveProps,
|
|
8
|
+
type ToggleGroupMultipleProps,
|
|
6
9
|
ToggleGroup as ToggleGroupPrimitive,
|
|
7
10
|
type ToggleGroupSingleProps,
|
|
8
|
-
type ToggleGroupMultipleProps,
|
|
9
|
-
type ToggleGroupItemProps as ToggleGroupItemPrimitiveProps,
|
|
10
|
-
ToggleGroupItem as ToggleGroupItemPrimitive,
|
|
11
11
|
} from '@radix-ui/react-toggle-group';
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
13
|
|
|
14
14
|
import { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps } from './Button';
|
|
15
|
+
import { IconButton, type IconButtonProps } from './IconButton';
|
|
15
16
|
|
|
16
17
|
type ToggleGroupProps = Omit<ToggleGroupSingleProps, 'className'> | Omit<ToggleGroupMultipleProps, 'className'>;
|
|
17
18
|
|
|
@@ -37,5 +38,17 @@ const ToggleGroupItem = forwardRef<HTMLButtonElement, ToggleGroupItemProps>(
|
|
|
37
38
|
},
|
|
38
39
|
);
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
type ToggleGroupIconItemProps = Omit<ToggleGroupItemPrimitiveProps, 'className'> & IconButtonProps;
|
|
42
|
+
|
|
43
|
+
const ToggleGroupIconItem = forwardRef<HTMLButtonElement, ToggleGroupIconItemProps>(
|
|
44
|
+
({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {
|
|
45
|
+
return (
|
|
46
|
+
<ToggleGroupItemPrimitive {...props} asChild>
|
|
47
|
+
<IconButton {...{ variant, elevation, density, classNames, label, icon, size }} ref={forwardedRef} />
|
|
48
|
+
</ToggleGroupItemPrimitive>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export { ToggleGroup, ToggleGroupItem, ToggleGroupIconItem };
|
|
41
54
|
export type { ToggleGroupProps, ToggleGroupItemProps };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
export type ClipboardContextValue = {
|
|
8
8
|
textValue: string;
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { mx } from '@dxos/
|
|
7
|
+
import { mx, osTranslations } from '@dxos/ui-theme';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { Button, type ButtonProps, IconButton } from '../Buttons';
|
|
9
|
+
import { Button, type ButtonProps, IconButton } from '../Button';
|
|
11
10
|
import { Icon, type IconProps } from '../Icon';
|
|
12
11
|
import { useTranslation } from '../ThemeProvider';
|
|
13
12
|
import { type TooltipScopedProps, useTooltipContext } from '../Tooltip';
|
|
14
13
|
|
|
14
|
+
import { useClipboard } from './ClipboardProvider';
|
|
15
|
+
|
|
15
16
|
export type CopyButtonProps = ButtonProps &
|
|
16
17
|
Pick<IconProps, 'size'> & {
|
|
17
18
|
value: string;
|
|
@@ -20,7 +21,7 @@ export type CopyButtonProps = ButtonProps &
|
|
|
20
21
|
const inactiveLabelStyles = 'invisible bs-px -mbe-px overflow-hidden';
|
|
21
22
|
|
|
22
23
|
export const CopyButton = ({ classNames, value, size = 5, ...props }: CopyButtonProps) => {
|
|
23
|
-
const { t } = useTranslation(
|
|
24
|
+
const { t } = useTranslation(osTranslations);
|
|
24
25
|
const { textValue, setTextValue } = useClipboard();
|
|
25
26
|
const isCopied = textValue === value;
|
|
26
27
|
return (
|
|
@@ -54,7 +55,7 @@ export const CopyButtonIconOnly = ({
|
|
|
54
55
|
variant,
|
|
55
56
|
...props
|
|
56
57
|
}: TooltipScopedProps<CopyButtonIconOnlyProps>) => {
|
|
57
|
-
const { t } = useTranslation(
|
|
58
|
+
const { t } = useTranslation(osTranslations);
|
|
58
59
|
const { textValue, setTextValue } = useClipboard();
|
|
59
60
|
const isCopied = textValue === value;
|
|
60
61
|
const label = isCopied ? t('copy success label') : (props.label ?? t('copy label'));
|