@dxos/react-ui 0.8.4-main.c85a9c8dae → 0.8.4-main.d05539e30a
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/chunk-A5QCIG5R.mjs +24 -0
- package/dist/lib/browser/chunk-A5QCIG5R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2FKSMWNY.mjs → chunk-LY5XDQR5.mjs} +84 -12
- package/dist/lib/browser/chunk-LY5XDQR5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1559 -1062
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +44 -20
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/translations.mjs +9 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZNBLTSHI.mjs → chunk-NGKLIKP3.mjs} +84 -12
- package/dist/lib/node-esm/chunk-NGKLIKP3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCFLA74M.mjs +26 -0
- package/dist/lib/node-esm/chunk-XCFLA74M.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1559 -1062
- 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 +44 -20
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/translations.mjs +10 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.d.ts +2 -2
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts +1 -0
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.stories.d.ts +3 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.d.ts +2 -2
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +6 -6
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +2 -2
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +68 -65
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +2 -2
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -1
- package/dist/types/src/components/Carousel/Carousel.d.ts +106 -0
- package/dist/types/src/components/Carousel/Carousel.d.ts.map +1 -0
- package/dist/types/src/components/Carousel/index.d.ts +2 -0
- package/dist/types/src/components/Carousel/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.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +10 -1
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts +42 -31
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +47 -30
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +3 -2
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts +14 -3
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.d.ts +36 -0
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -0
- package/dist/types/src/components/Focus/Focus.stories.d.ts +9 -0
- package/dist/types/src/components/Focus/Focus.stories.d.ts.map +1 -0
- package/dist/types/src/components/Focus/index.d.ts +2 -0
- package/dist/types/src/components/Focus/index.d.ts.map +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts +4 -0
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +11 -3
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.d.ts +2 -1
- package/dist/types/src/components/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.stories.d.ts +3 -2
- package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +14 -17
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +3 -3
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +5 -3
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +3 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.d.ts +2 -2
- package/dist/types/src/components/List/Tree.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.d.ts +5 -9
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +7 -3
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/useSwipeToDismiss.d.ts.map +1 -1
- package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts +46 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts.map +1 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts +16 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MediaPlayer/index.d.ts +2 -0
- package/dist/types/src/components/MediaPlayer/index.d.ts.map +1 -0
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts +58 -49
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts +14 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +2 -2
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +38 -22
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +12 -11
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +21 -10
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +42 -13
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +5 -6
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +2 -2
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -3
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.d.ts +19 -21
- package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.d.ts +3 -4
- package/dist/types/src/components/Status/Status.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +54 -55
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +16 -16
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +10 -20
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +16 -16
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +6 -5
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/slot.stories.d.ts +1 -0
- package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/virtualizer.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useIconHref.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.d.ts +20 -19
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.stories.d.ts +19 -0
- package/dist/types/src/primitives/Column/Column.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Container/Container.d.ts +7 -0
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts +6 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/index.d.ts +2 -0
- package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts +8 -5
- package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -1
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.d.ts +6 -5
- package/dist/types/src/primitives/Grid/Grid.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.d.ts +23 -22
- package/dist/types/src/primitives/Panel/Panel.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/index.d.ts +1 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -1
- package/dist/types/src/testing/Loading.d.ts +9 -0
- package/dist/types/src/testing/Loading.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -26
- package/src/components/Avatars/Avatar.stories.tsx +2 -3
- package/src/components/Avatars/Avatar.tsx +1 -2
- package/src/components/Avatars/AvatarGroup.stories.tsx +0 -1
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -2
- package/src/components/Button/Button.stories.tsx +0 -1
- package/src/components/Button/Button.tsx +5 -13
- package/src/components/Button/IconButton.stories.tsx +6 -4
- package/src/components/Button/IconButton.tsx +3 -4
- package/src/components/Button/Toggle.stories.tsx +0 -1
- package/src/components/Button/Toggle.tsx +4 -4
- package/src/components/Button/ToggleGroup.stories.tsx +0 -1
- package/src/components/Button/ToggleGroup.tsx +12 -16
- package/src/components/Card/Card.stories.tsx +15 -15
- package/src/components/Card/Card.tsx +294 -132
- package/src/components/Carousel/Carousel.tsx +379 -0
- package/src/components/Carousel/index.ts +5 -0
- package/src/components/Clipboard/CopyButton.tsx +5 -6
- package/src/components/Dialog/AlertDialog.stories.tsx +5 -6
- package/src/components/Dialog/AlertDialog.tsx +67 -126
- package/src/components/Dialog/Dialog.stories.tsx +64 -9
- package/src/components/Dialog/Dialog.tsx +84 -88
- package/src/components/ErrorFallback/ErrorFallback.stories.tsx +3 -8
- package/src/components/ErrorFallback/ErrorStack.tsx +36 -2
- package/src/components/Focus/AUDIT.md +43 -0
- package/src/components/Focus/Focus.stories.tsx +230 -0
- package/src/components/Focus/Focus.tsx +201 -0
- package/src/components/Focus/index.ts +5 -0
- package/src/components/Icon/Icon.stories.tsx +43 -13
- package/src/components/Icon/Icon.tsx +14 -3
- package/src/components/Image/Image.stories.tsx +3 -3
- package/src/components/Image/Image.tsx +31 -8
- package/src/components/Input/Input.stories.tsx +3 -4
- package/src/components/Input/Input.tsx +7 -7
- package/src/components/Link/Link.stories.tsx +0 -1
- package/src/components/Link/Link.tsx +10 -2
- package/src/components/List/List.stories.tsx +3 -4
- package/src/components/List/List.tsx +7 -6
- package/src/components/List/ListDropIndicator.tsx +0 -1
- package/src/components/List/Tree.stories.tsx +2 -3
- package/src/components/List/Tree.tsx +0 -1
- package/src/components/List/TreeDropIndicator.tsx +1 -1
- package/src/components/List/Treegrid.stories.tsx +26 -27
- package/src/components/List/Treegrid.tsx +14 -14
- package/src/components/Main/Main.stories.tsx +0 -1
- package/src/components/Main/Main.tsx +1 -2
- package/src/components/MediaPlayer/MediaPlayer.stories.tsx +50 -0
- package/src/components/MediaPlayer/MediaPlayer.tsx +153 -0
- package/src/components/MediaPlayer/index.ts +5 -0
- package/src/components/Menu/ContextMenu.stories.tsx +0 -1
- package/src/components/Menu/DropdownMenu.stories.tsx +0 -1
- package/src/components/Menu/DropdownMenu.tsx +48 -42
- package/src/components/Message/Message.stories.tsx +7 -8
- package/src/components/Message/Message.tsx +23 -10
- package/src/components/Popover/Popover.stories.tsx +4 -5
- package/src/components/Popover/Popover.tsx +42 -42
- package/src/components/ScrollArea/ScrollArea.stories.tsx +89 -30
- package/src/components/ScrollArea/ScrollArea.tsx +41 -25
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +20 -18
- package/src/components/ScrollContainer/ScrollContainer.tsx +199 -92
- package/src/components/Select/Select.stories.tsx +5 -6
- package/src/components/Separator/Separator.tsx +4 -7
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -1
- package/src/components/Splitter/Splitter.stories.tsx +29 -29
- package/src/components/Splitter/Splitter.tsx +35 -46
- package/src/components/Status/Status.stories.tsx +0 -1
- package/src/components/Status/Status.tsx +8 -5
- package/src/components/Tag/Tag.stories.tsx +0 -1
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +0 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +5 -4
- package/src/components/ThemeProvider/index.ts +1 -1
- package/src/components/Toast/Toast.stories.tsx +0 -1
- package/src/components/Toast/Toast.tsx +16 -31
- package/src/components/Toolbar/Toolbar.stories.tsx +0 -1
- package/src/components/Toolbar/Toolbar.tsx +36 -48
- package/src/components/Tooltip/Tooltip.stories.tsx +7 -8
- package/src/components/Tooltip/Tooltip.tsx +29 -29
- package/src/components/index.ts +3 -0
- package/src/exemplars/generics.stories.tsx +7 -15
- package/src/exemplars/slot.stories.tsx +64 -68
- package/src/exemplars/tabster.stories.tsx +1 -1
- package/src/exemplars/virtualizer.stories.tsx +4 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDensityContext.ts +2 -2
- package/src/playground/Custom.stories.tsx +6 -9
- package/src/primitives/Column/AUDIT.md +148 -0
- package/src/primitives/Column/Column.stories.tsx +128 -19
- package/src/primitives/Column/Column.tsx +89 -80
- package/src/primitives/Container/Container.stories.tsx +29 -0
- package/src/primitives/Container/Container.tsx +19 -0
- package/src/primitives/Container/index.ts +5 -0
- package/src/primitives/Flex/Flex.stories.tsx +0 -1
- package/src/primitives/Flex/Flex.tsx +20 -20
- package/src/primitives/Grid/Grid.stories.tsx +0 -1
- package/src/primitives/Grid/Grid.tsx +23 -36
- package/src/primitives/Panel/Panel.stories.tsx +9 -8
- package/src/primitives/Panel/Panel.tsx +43 -60
- package/src/primitives/index.ts +1 -0
- package/src/testing/Loading.tsx +47 -0
- package/src/testing/decorators/withLayout.tsx +7 -17
- package/src/testing/decorators/withTheme.tsx +10 -7
- package/src/testing/index.ts +2 -0
- package/src/translations.ts +8 -3
- package/src/util/usePx.ts +1 -0
- package/dist/lib/browser/chunk-2FKSMWNY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZNBLTSHI.mjs.map +0 -7
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
DensityProvider,
|
|
5
5
|
ElevationContext,
|
|
6
6
|
ElevationProvider,
|
|
7
|
+
ErrorStack,
|
|
7
8
|
ThemeContext,
|
|
8
9
|
ThemeProvider,
|
|
9
10
|
Tooltip,
|
|
@@ -11,12 +12,16 @@ import {
|
|
|
11
12
|
createTooltipScope,
|
|
12
13
|
hasIosKeyboard,
|
|
13
14
|
initialSafeArea,
|
|
15
|
+
parseCaptureOwnerStack,
|
|
14
16
|
useElevationContext,
|
|
15
17
|
useSafeArea,
|
|
16
18
|
useThemeContext,
|
|
17
19
|
useTooltipContext,
|
|
18
20
|
useTranslation
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NGKLIKP3.mjs";
|
|
22
|
+
import {
|
|
23
|
+
translationKey
|
|
24
|
+
} from "./chunk-XCFLA74M.mjs";
|
|
20
25
|
|
|
21
26
|
// src/index.ts
|
|
22
27
|
import { Trans } from "react-i18next";
|
|
@@ -24,13 +29,13 @@ export * from "@dxos/react-hooks";
|
|
|
24
29
|
export * from "@dxos/ui-types";
|
|
25
30
|
|
|
26
31
|
// src/components/ThemeProvider/index.ts
|
|
27
|
-
import { isLabel, toLocalizedString } from "@dxos/ui-types";
|
|
32
|
+
import { isLabel, toLocalizedString } from "@dxos/ui-types/translations";
|
|
28
33
|
|
|
29
34
|
// src/hooks/useDensityContext.ts
|
|
30
35
|
import { useContext } from "react";
|
|
31
|
-
var useDensityContext = (
|
|
36
|
+
var useDensityContext = (densityProp) => {
|
|
32
37
|
const { density } = useContext(DensityContext);
|
|
33
|
-
return
|
|
38
|
+
return densityProp ?? density;
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
// src/hooks/useIconHref.ts
|
|
@@ -41,6 +46,26 @@ var useIconHref = (icon) => {
|
|
|
41
46
|
return icon ? `${url}#${icon}` : void 0;
|
|
42
47
|
};
|
|
43
48
|
|
|
49
|
+
// src/hooks/useSafeCollisionPadding.ts
|
|
50
|
+
import { useMemo } from "react";
|
|
51
|
+
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
52
|
+
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
53
|
+
var safePadding = (propsPadding, safePadding2, side) => {
|
|
54
|
+
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
55
|
+
};
|
|
56
|
+
var useSafeCollisionPadding = (collisionPadding) => {
|
|
57
|
+
const { safeAreaPadding } = useThemeContext();
|
|
58
|
+
return useMemo(() => ({
|
|
59
|
+
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
60
|
+
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
61
|
+
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
62
|
+
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
63
|
+
}), [
|
|
64
|
+
collisionPadding,
|
|
65
|
+
safeAreaPadding
|
|
66
|
+
]);
|
|
67
|
+
};
|
|
68
|
+
|
|
44
69
|
// src/hooks/useTranslationsContext.ts
|
|
45
70
|
import { useContext as useContext2 } from "react";
|
|
46
71
|
var useTranslationsContext = () => useContext2(TranslationsContext);
|
|
@@ -65,7 +90,7 @@ var useVisualViewport = (deps) => {
|
|
|
65
90
|
};
|
|
66
91
|
|
|
67
92
|
// src/util/usePx.ts
|
|
68
|
-
import { useCallback as useCallback2, useEffect, useMemo, useState as useState2 } from "react";
|
|
93
|
+
import { useCallback as useCallback2, useEffect, useMemo as useMemo2, useState as useState2 } from "react";
|
|
69
94
|
var getDocumentElementFontSize = () => parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
70
95
|
var usePx = (rem) => {
|
|
71
96
|
const [fontSize, setFontSize] = useState2(() => {
|
|
@@ -101,17 +126,17 @@ var usePx = (rem) => {
|
|
|
101
126
|
}
|
|
102
127
|
};
|
|
103
128
|
}, []);
|
|
104
|
-
return
|
|
129
|
+
return useMemo2(() => rem * fontSize, [
|
|
105
130
|
fontSize
|
|
106
131
|
]);
|
|
107
132
|
};
|
|
108
133
|
|
|
109
134
|
// src/components/Avatars/Avatar.tsx
|
|
110
|
-
import "@dxos/lit-ui/dx-avatar.pcss";
|
|
111
135
|
import { createContext } from "@radix-ui/react-context";
|
|
112
136
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
113
137
|
import { Slot } from "@radix-ui/react-slot";
|
|
114
138
|
import React, { forwardRef } from "react";
|
|
139
|
+
import "@dxos/lit-ui/dx-avatar.pcss";
|
|
115
140
|
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
116
141
|
import { useId } from "@dxos/react-hooks";
|
|
117
142
|
import { mx } from "@dxos/ui-theme";
|
|
@@ -176,12 +201,19 @@ import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
|
176
201
|
import React4, { forwardRef as forwardRef4 } from "react";
|
|
177
202
|
|
|
178
203
|
// src/components/Icon/Icon.tsx
|
|
179
|
-
import React2, { forwardRef as forwardRef2, memo } from "react";
|
|
180
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
|
|
204
|
+
import React2, { forwardRef as forwardRef2, memo, useMemo as useMemo3 } from "react";
|
|
205
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ classNames, icon, size, synchronized, style, ...props }, forwardedRef) => {
|
|
181
206
|
const { tx } = useThemeContext();
|
|
207
|
+
const spinDelay = useMemo3(() => synchronized ? `${-(Date.now() % 1e3)}ms` : void 0, [
|
|
208
|
+
synchronized
|
|
209
|
+
]);
|
|
182
210
|
const href = useIconHref(icon);
|
|
183
211
|
return /* @__PURE__ */ React2.createElement("svg", {
|
|
184
212
|
...props,
|
|
213
|
+
style: {
|
|
214
|
+
...style,
|
|
215
|
+
animationDelay: spinDelay
|
|
216
|
+
},
|
|
185
217
|
className: tx("icon.root", {
|
|
186
218
|
size
|
|
187
219
|
}, classNames),
|
|
@@ -195,11 +227,13 @@ var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ icon, classNames,
|
|
|
195
227
|
import { Primitive as Primitive2 } from "@radix-ui/react-primitive";
|
|
196
228
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
197
229
|
import React3, { forwardRef as forwardRef3 } from "react";
|
|
198
|
-
var Link = /* @__PURE__ */ forwardRef3(({ asChild, variant,
|
|
230
|
+
var Link = /* @__PURE__ */ forwardRef3(({ classNames, asChild, variant, target = "_blank", rel = "noreferrer", ...props }, forwardedRef) => {
|
|
199
231
|
const { tx } = useThemeContext();
|
|
200
232
|
const Comp = asChild ? Slot2 : Primitive2.a;
|
|
201
233
|
return /* @__PURE__ */ React3.createElement(Comp, {
|
|
202
234
|
...props,
|
|
235
|
+
target,
|
|
236
|
+
rel,
|
|
203
237
|
className: tx("link.root", {
|
|
204
238
|
variant
|
|
205
239
|
}, classNames),
|
|
@@ -285,11 +319,11 @@ var BUTTON_NAME = "Button";
|
|
|
285
319
|
var [ButtonGroupProvider, useButtonGroupContext] = createContext2(BUTTON_GROUP_NAME, {
|
|
286
320
|
inGroup: false
|
|
287
321
|
});
|
|
288
|
-
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef5(({ classNames, children, density:
|
|
322
|
+
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef5(({ classNames, children, density: densityProp, elevation: elevationProp, variant = "default", asChild, ...props }, ref) => {
|
|
289
323
|
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
290
324
|
const { tx } = useThemeContext();
|
|
291
|
-
const elevation = useElevationContext(
|
|
292
|
-
const density = useDensityContext(
|
|
325
|
+
const elevation = useElevationContext(elevationProp);
|
|
326
|
+
const density = useDensityContext(densityProp);
|
|
293
327
|
const Comp = asChild ? Slot4 : Primitive4.button;
|
|
294
328
|
return /* @__PURE__ */ React5.createElement(Comp, {
|
|
295
329
|
ref,
|
|
@@ -352,12 +386,13 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef6(({ noTooltip, tooltipSide, ...p
|
|
|
352
386
|
ref: forwardedRef
|
|
353
387
|
}));
|
|
354
388
|
});
|
|
355
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size
|
|
389
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, square, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
356
390
|
const { tx } = useThemeContext();
|
|
357
391
|
return /* @__PURE__ */ React6.createElement(Button, {
|
|
358
392
|
...props,
|
|
359
393
|
classNames: tx("iconButton.root", {
|
|
360
|
-
iconOnly
|
|
394
|
+
iconOnly,
|
|
395
|
+
square
|
|
361
396
|
}, classNames),
|
|
362
397
|
ref: forwardedRef
|
|
363
398
|
}, icon && !iconEnd && /* @__PURE__ */ React6.createElement(Icon, {
|
|
@@ -377,10 +412,10 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size = 5, icon, iconOnly
|
|
|
377
412
|
});
|
|
378
413
|
|
|
379
414
|
// src/components/Button/Toggle.tsx
|
|
380
|
-
import
|
|
415
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
381
416
|
import React7, { forwardRef as forwardRef7 } from "react";
|
|
382
417
|
var Toggle = /* @__PURE__ */ forwardRef7(({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {
|
|
383
|
-
return /* @__PURE__ */ React7.createElement(TogglePrimitive, {
|
|
418
|
+
return /* @__PURE__ */ React7.createElement(TogglePrimitive.Root, {
|
|
384
419
|
defaultPressed,
|
|
385
420
|
pressed,
|
|
386
421
|
onPressedChange,
|
|
@@ -392,10 +427,10 @@ var Toggle = /* @__PURE__ */ forwardRef7(({ defaultPressed, pressed, onPressedCh
|
|
|
392
427
|
});
|
|
393
428
|
|
|
394
429
|
// src/components/Button/ToggleGroup.tsx
|
|
395
|
-
import
|
|
430
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
396
431
|
import React8, { forwardRef as forwardRef8 } from "react";
|
|
397
432
|
var ToggleGroup = /* @__PURE__ */ forwardRef8(({ classNames, children, ...props }, forwardedRef) => {
|
|
398
|
-
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive, {
|
|
433
|
+
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive.Root, {
|
|
399
434
|
...props,
|
|
400
435
|
asChild: true
|
|
401
436
|
}, /* @__PURE__ */ React8.createElement(ButtonGroup, {
|
|
@@ -405,7 +440,7 @@ var ToggleGroup = /* @__PURE__ */ forwardRef8(({ classNames, children, ...props
|
|
|
405
440
|
}));
|
|
406
441
|
});
|
|
407
442
|
var ToggleGroupItem = /* @__PURE__ */ forwardRef8(({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {
|
|
408
|
-
return /* @__PURE__ */ React8.createElement(
|
|
443
|
+
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive.Item, {
|
|
409
444
|
...props,
|
|
410
445
|
asChild: true
|
|
411
446
|
}, /* @__PURE__ */ React8.createElement(Button, {
|
|
@@ -418,7 +453,7 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef8(({ variant, elevation, density
|
|
|
418
453
|
}));
|
|
419
454
|
});
|
|
420
455
|
var ToggleGroupIconItem = /* @__PURE__ */ forwardRef8(({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {
|
|
421
|
-
return /* @__PURE__ */ React8.createElement(
|
|
456
|
+
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive.Item, {
|
|
422
457
|
...props,
|
|
423
458
|
asChild: true
|
|
424
459
|
}, /* @__PURE__ */ React8.createElement(IconButton, {
|
|
@@ -434,31 +469,35 @@ var ToggleGroupIconItem = /* @__PURE__ */ forwardRef8(({ variant, label, icon, s
|
|
|
434
469
|
});
|
|
435
470
|
|
|
436
471
|
// src/components/Card/Card.tsx
|
|
437
|
-
import { Primitive as
|
|
438
|
-
import { Slot as
|
|
439
|
-
import
|
|
440
|
-
import {
|
|
472
|
+
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
473
|
+
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
474
|
+
import DOMPurify from "dompurify";
|
|
475
|
+
import React19, { createContext as createContext3, forwardRef as forwardRef13, useContext as useContext3, useMemo as useMemo5 } from "react";
|
|
476
|
+
import { composable as composable3, composableProps as composableProps7, iconSize, mx as mx6, slottable as slottable6 } from "@dxos/ui-theme";
|
|
441
477
|
|
|
442
478
|
// src/primitives/Column/Column.tsx
|
|
443
479
|
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
444
480
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
445
|
-
import React9
|
|
481
|
+
import React9 from "react";
|
|
482
|
+
import { composableProps, slottable } from "@dxos/ui-theme";
|
|
446
483
|
var COLUMN_ROOT_NAME = "Column.Root";
|
|
447
484
|
var gutterSizes = {
|
|
485
|
+
xs: "var(--dx-gutter-xs)",
|
|
448
486
|
sm: "var(--dx-gutter-sm)",
|
|
449
487
|
md: "var(--dx-gutter-md)",
|
|
450
|
-
lg: "var(--dx-gutter-lg)"
|
|
451
|
-
rail: "var(--dx-rail-item)"
|
|
488
|
+
lg: "var(--dx-gutter-lg)"
|
|
452
489
|
};
|
|
453
|
-
var
|
|
490
|
+
var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }, forwardedRef) => {
|
|
491
|
+
const { className, ...rest } = composableProps(props);
|
|
492
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
454
493
|
const { tx } = useThemeContext();
|
|
455
|
-
const Component = asChild ? Slot5 : Primitive5.div;
|
|
456
494
|
const gutterSize = gutterSizes[gutter];
|
|
457
|
-
return /* @__PURE__ */ React9.createElement(
|
|
458
|
-
...
|
|
495
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
496
|
+
...rest,
|
|
459
497
|
role: role ?? "none",
|
|
460
498
|
style: {
|
|
461
499
|
"--gutter": gutterSize,
|
|
500
|
+
"--dx-col": "2 / span 1",
|
|
462
501
|
gridTemplateColumns: [
|
|
463
502
|
gutterSize,
|
|
464
503
|
"minmax(0,1fr)",
|
|
@@ -467,169 +506,179 @@ var Root = /* @__PURE__ */ forwardRef9(({ classNames, className, asChild, role,
|
|
|
467
506
|
},
|
|
468
507
|
className: tx("column.root", {
|
|
469
508
|
gutter
|
|
470
|
-
},
|
|
471
|
-
className,
|
|
472
|
-
classNames
|
|
473
|
-
]),
|
|
509
|
+
}, className),
|
|
474
510
|
ref: forwardedRef
|
|
475
511
|
}, children);
|
|
476
512
|
});
|
|
477
|
-
|
|
513
|
+
ColumnRoot.displayName = COLUMN_ROOT_NAME;
|
|
478
514
|
var COLUMN_ROW_NAME = "Column.Row";
|
|
479
|
-
var
|
|
515
|
+
var ColumnRow = slottable(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
516
|
+
const { className, ...rest } = composableProps(props);
|
|
517
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
480
518
|
const { tx } = useThemeContext();
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
...props,
|
|
484
|
-
className: tx("column.row", {}, [
|
|
485
|
-
className,
|
|
486
|
-
classNames
|
|
487
|
-
]),
|
|
519
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
520
|
+
...rest,
|
|
488
521
|
role: role ?? "none",
|
|
522
|
+
className: tx("column.row", {}, className),
|
|
489
523
|
ref: forwardedRef
|
|
490
524
|
}, children);
|
|
491
525
|
});
|
|
492
|
-
|
|
493
|
-
var
|
|
494
|
-
var
|
|
526
|
+
ColumnRow.displayName = COLUMN_ROW_NAME;
|
|
527
|
+
var COLUMN_BLEED_NAME = "Column.Bleed";
|
|
528
|
+
var ColumnBleed = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
495
529
|
const { tx } = useThemeContext();
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
className: tx("column.segment", {}, [
|
|
502
|
-
className,
|
|
503
|
-
classNames
|
|
504
|
-
]),
|
|
505
|
-
ref: forwardedRef
|
|
506
|
-
}, children);
|
|
507
|
-
}
|
|
508
|
-
return /* @__PURE__ */ React9.createElement(Component, {
|
|
509
|
-
...props,
|
|
510
|
-
className: tx("column.segment", {}, [
|
|
511
|
-
className,
|
|
512
|
-
classNames
|
|
513
|
-
]),
|
|
514
|
-
role,
|
|
530
|
+
const { className, ...rest } = composableProps(props);
|
|
531
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
532
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
533
|
+
...rest,
|
|
534
|
+
className: tx("column.bleed", {}, className),
|
|
515
535
|
ref: forwardedRef
|
|
516
|
-
},
|
|
517
|
-
className: "contents"
|
|
518
|
-
}, children));
|
|
536
|
+
}, children);
|
|
519
537
|
});
|
|
520
|
-
|
|
538
|
+
ColumnBleed.displayName = COLUMN_BLEED_NAME;
|
|
539
|
+
var COLUMN_CENTER_NAME = "Column.Center";
|
|
540
|
+
var ColumnCenter = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
541
|
+
const { tx } = useThemeContext();
|
|
542
|
+
const { className, ...rest } = composableProps(props);
|
|
543
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
544
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
545
|
+
...rest,
|
|
546
|
+
className: tx("column.center", {}, className),
|
|
547
|
+
ref: forwardedRef
|
|
548
|
+
}, children);
|
|
549
|
+
});
|
|
550
|
+
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
521
551
|
var Column = {
|
|
522
|
-
Root,
|
|
523
|
-
Row,
|
|
524
|
-
|
|
552
|
+
Root: ColumnRoot,
|
|
553
|
+
Row: ColumnRow,
|
|
554
|
+
Bleed: ColumnBleed,
|
|
555
|
+
Center: ColumnCenter
|
|
525
556
|
};
|
|
526
557
|
|
|
527
|
-
// src/primitives/
|
|
558
|
+
// src/primitives/Container/Container.tsx
|
|
559
|
+
import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
|
|
560
|
+
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
528
561
|
import React10 from "react";
|
|
529
|
-
import { mx as mx2 } from "@dxos/ui-theme";
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
562
|
+
import { composableProps as composableProps2, mx as mx2, slottable as slottable2 } from "@dxos/ui-theme";
|
|
563
|
+
var Container = slottable2(({ children, asChild, ...props }, forwardedRef) => {
|
|
564
|
+
const { className, ...rest } = composableProps2(props);
|
|
565
|
+
const Comp = asChild ? Slot6 : Primitive6.div;
|
|
566
|
+
return /* @__PURE__ */ React10.createElement(Comp, {
|
|
567
|
+
...rest,
|
|
568
|
+
className: mx2("dx-container", className),
|
|
569
|
+
ref: forwardedRef
|
|
535
570
|
}, children);
|
|
536
|
-
};
|
|
571
|
+
});
|
|
537
572
|
|
|
538
|
-
// src/primitives/
|
|
573
|
+
// src/primitives/Flex/Flex.tsx
|
|
574
|
+
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
575
|
+
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
539
576
|
import React11 from "react";
|
|
540
|
-
import { mx as mx3 } from "@dxos/ui-theme";
|
|
541
|
-
var
|
|
542
|
-
|
|
543
|
-
|
|
577
|
+
import { composableProps as composableProps3, mx as mx3, slottable as slottable3 } from "@dxos/ui-theme";
|
|
578
|
+
var Flex = slottable3(({ children, asChild, column, grow, ...props }, forwardedRef) => {
|
|
579
|
+
const { className, ...rest } = composableProps3(props);
|
|
580
|
+
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
581
|
+
return /* @__PURE__ */ React11.createElement(Comp, {
|
|
582
|
+
ref: forwardedRef,
|
|
583
|
+
...rest,
|
|
584
|
+
className: mx3("flex", column && "flex-col", grow && "flex-1 overflow-hidden", className)
|
|
585
|
+
}, children);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// src/primitives/Grid/Grid.tsx
|
|
589
|
+
import React12 from "react";
|
|
590
|
+
import { composable, composableProps as composableProps4, mx as mx4 } from "@dxos/ui-theme";
|
|
591
|
+
var Grid = composable(({ children, style, role, cols, rows, grow = true, ...props }, forwardedRef) => {
|
|
592
|
+
const { className, ...rest } = composableProps4(props);
|
|
593
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
594
|
+
ref: forwardedRef,
|
|
595
|
+
...rest,
|
|
544
596
|
role: role ?? "none",
|
|
597
|
+
className: mx4("grid overflow-hidden", grow && "dx-container", className),
|
|
545
598
|
style: {
|
|
546
599
|
gridTemplateColumns: cols ? `repeat(${cols}, 1fr)` : void 0,
|
|
547
600
|
gridTemplateRows: rows ? `repeat(${rows}, 1fr)` : void 0,
|
|
548
601
|
...style
|
|
549
|
-
}
|
|
550
|
-
className: mx3("grid overflow-hidden", grow && "dx-container", className, classNames)
|
|
602
|
+
}
|
|
551
603
|
}, children);
|
|
552
|
-
};
|
|
604
|
+
});
|
|
553
605
|
|
|
554
606
|
// src/primitives/Panel/Panel.tsx
|
|
555
|
-
import { Primitive as
|
|
556
|
-
import { Slot as
|
|
557
|
-
import
|
|
607
|
+
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
608
|
+
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
609
|
+
import React13 from "react";
|
|
610
|
+
import { composableProps as composableProps5, slottable as slottable4 } from "@dxos/ui-theme";
|
|
558
611
|
var GRID_TEMPLATE_ROWS = "auto 1fr auto";
|
|
559
612
|
var GRID_TEMPLATE_AREAS = '"toolbar" "content" "statusbar"';
|
|
560
|
-
var
|
|
613
|
+
var PanelRoot = slottable4(({ children, asChild, role, style, ...props }, forwardedRef) => {
|
|
614
|
+
const { className, ...rest } = composableProps5(props);
|
|
615
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
561
616
|
const { tx } = useThemeContext();
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
ref: forwardedRef,
|
|
617
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
618
|
+
...rest,
|
|
565
619
|
role: role ?? "none",
|
|
566
|
-
...props,
|
|
567
620
|
style: {
|
|
568
621
|
gridTemplateRows: GRID_TEMPLATE_ROWS,
|
|
569
622
|
gridTemplateAreas: GRID_TEMPLATE_AREAS,
|
|
570
|
-
...
|
|
623
|
+
...style
|
|
571
624
|
},
|
|
572
|
-
className: tx("panel.root", {},
|
|
573
|
-
|
|
574
|
-
classNames
|
|
575
|
-
])
|
|
625
|
+
className: tx("panel.root", {}, className),
|
|
626
|
+
ref: forwardedRef
|
|
576
627
|
}, children);
|
|
577
628
|
});
|
|
578
|
-
|
|
579
|
-
var
|
|
629
|
+
PanelRoot.displayName = "Panel.Root";
|
|
630
|
+
var PanelToolbar = slottable4(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
631
|
+
const { className, ...rest } = composableProps5(props);
|
|
632
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
580
633
|
const { tx } = useThemeContext();
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
ref: forwardedRef,
|
|
634
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
635
|
+
...rest,
|
|
584
636
|
"data-slot": "toolbar",
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
])
|
|
637
|
+
className: tx("panel.toolbar", {
|
|
638
|
+
size
|
|
639
|
+
}, className),
|
|
640
|
+
ref: forwardedRef
|
|
590
641
|
}, children);
|
|
591
642
|
});
|
|
592
|
-
|
|
593
|
-
var
|
|
643
|
+
PanelToolbar.displayName = "Panel.Toolbar";
|
|
644
|
+
var PanelContent = slottable4(({ children, asChild, ...props }, forwardedRef) => {
|
|
645
|
+
const { className, ...rest } = composableProps5(props);
|
|
646
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
594
647
|
const { tx } = useThemeContext();
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
ref: forwardedRef,
|
|
648
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
649
|
+
...rest,
|
|
598
650
|
"data-slot": "content",
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
className,
|
|
602
|
-
classNames
|
|
603
|
-
])
|
|
651
|
+
className: tx("panel.content", {}, className),
|
|
652
|
+
ref: forwardedRef
|
|
604
653
|
}, children);
|
|
605
654
|
});
|
|
606
|
-
|
|
607
|
-
var
|
|
655
|
+
PanelContent.displayName = "Panel.Content";
|
|
656
|
+
var PanelStatusbar = slottable4(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
657
|
+
const { className, ...rest } = composableProps5(props);
|
|
658
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
608
659
|
const { tx } = useThemeContext();
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
ref: forwardedRef,
|
|
660
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
661
|
+
...rest,
|
|
612
662
|
"data-slot": "statusbar",
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
])
|
|
663
|
+
className: tx("panel.statusbar", {
|
|
664
|
+
size
|
|
665
|
+
}, className),
|
|
666
|
+
ref: forwardedRef
|
|
618
667
|
}, children);
|
|
619
668
|
});
|
|
620
|
-
|
|
669
|
+
PanelStatusbar.displayName = "Panel.Statusbar";
|
|
621
670
|
var Panel = {
|
|
622
|
-
Root:
|
|
623
|
-
Toolbar,
|
|
624
|
-
Content,
|
|
625
|
-
Statusbar
|
|
671
|
+
Root: PanelRoot,
|
|
672
|
+
Toolbar: PanelToolbar,
|
|
673
|
+
Content: PanelContent,
|
|
674
|
+
Statusbar: PanelStatusbar
|
|
626
675
|
};
|
|
627
676
|
|
|
628
677
|
// src/components/Image/Image.tsx
|
|
629
|
-
import
|
|
630
|
-
import { mx as
|
|
678
|
+
import React14, { useCallback as useCallback3, useRef, useState as useState3 } from "react";
|
|
679
|
+
import { mx as mx5 } from "@dxos/ui-theme";
|
|
631
680
|
var cache = /* @__PURE__ */ new Map();
|
|
632
|
-
var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
681
|
+
var Image = ({ classNames, src, alt = "", fit = "contain", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
633
682
|
const [crossOriginState, setCrossOriginState] = useState3(crossOrigin);
|
|
634
683
|
const [dominantColor, setDominantColor] = useState3(void 0);
|
|
635
684
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
@@ -667,31 +716,37 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
667
716
|
contrast,
|
|
668
717
|
src
|
|
669
718
|
]);
|
|
670
|
-
return /* @__PURE__ */
|
|
671
|
-
|
|
719
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
720
|
+
// `isolate` (`isolation: isolate`) creates a new stacking context so
|
|
721
|
+
// the inner <img>'s `z-10` stays scoped to this wrapper. Without it
|
|
722
|
+
// the z-10 leaks into the parent's stacking context and elevates the
|
|
723
|
+
// image above any pseudo-element rings (e.g. Focus.Item's
|
|
724
|
+
// `dx-ring-pseudo` `::after`) painted on ancestors — most visibly,
|
|
725
|
+
// the focus ring on a Card containing a Card.Poster.
|
|
726
|
+
className: mx5(`relative flex w-full justify-center overflow-hidden transition-all duration-700 isolate`, classNames),
|
|
672
727
|
style: {
|
|
673
728
|
backgroundColor: dominantColor
|
|
674
729
|
}
|
|
675
|
-
}, /* @__PURE__ */
|
|
730
|
+
}, /* @__PURE__ */ React14.createElement("canvas", {
|
|
676
731
|
ref: canvasRef,
|
|
677
732
|
style: {
|
|
678
733
|
display: "none"
|
|
679
734
|
},
|
|
680
735
|
"aria-hidden": "true"
|
|
681
|
-
}), /* @__PURE__ */
|
|
736
|
+
}), /* @__PURE__ */ React14.createElement("div", {
|
|
682
737
|
className: "absolute inset-0 pointer-events-none",
|
|
683
738
|
style: {
|
|
684
739
|
background: dominantColor ? `radial-gradient(circle at center, transparent 30%, ${dominantColor} 100%)` : void 0,
|
|
685
740
|
transition: "opacity 0.7s ease-in-out",
|
|
686
741
|
opacity: 0.5
|
|
687
742
|
}
|
|
688
|
-
}), /* @__PURE__ */
|
|
743
|
+
}), /* @__PURE__ */ React14.createElement("img", {
|
|
689
744
|
src,
|
|
690
745
|
alt,
|
|
691
746
|
crossOrigin: crossOriginState,
|
|
692
747
|
onError: handleImageError,
|
|
693
748
|
onLoad: handleImageLoad,
|
|
694
|
-
className: "z-10
|
|
749
|
+
className: mx5("z-10 transition-opacity duration-500", fit === "cover" ? "w-full h-full object-cover" : "object-contain"),
|
|
695
750
|
style: {
|
|
696
751
|
opacity: imageLoaded ? 1 : 0
|
|
697
752
|
}
|
|
@@ -729,7 +784,9 @@ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) =
|
|
|
729
784
|
const green = pixels[i + 1];
|
|
730
785
|
const blue = pixels[i + 2];
|
|
731
786
|
const alpha = pixels[i + 3];
|
|
732
|
-
if (alpha === 0)
|
|
787
|
+
if (alpha === 0) {
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
733
790
|
const max = Math.max(red, green, blue);
|
|
734
791
|
const min = Math.min(red, green, blue);
|
|
735
792
|
const saturation = max === 0 ? 0 : (max - min) / max;
|
|
@@ -757,75 +814,49 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
757
814
|
const edgePixels = sampleSize * 4 - 4;
|
|
758
815
|
for (let x = 0; x < sampleSize; x++) {
|
|
759
816
|
const topIndex = x * 4;
|
|
760
|
-
if (pixels[topIndex + 3] === 0)
|
|
817
|
+
if (pixels[topIndex + 3] === 0) {
|
|
818
|
+
edgeTransparentPixels++;
|
|
819
|
+
}
|
|
761
820
|
const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
|
|
762
|
-
if (pixels[bottomIndex + 3] === 0)
|
|
821
|
+
if (pixels[bottomIndex + 3] === 0) {
|
|
822
|
+
edgeTransparentPixels++;
|
|
823
|
+
}
|
|
763
824
|
}
|
|
764
825
|
for (let y = 1; y < sampleSize - 1; y++) {
|
|
765
826
|
const leftIndex = y * sampleSize * 4;
|
|
766
|
-
if (pixels[leftIndex + 3] === 0)
|
|
827
|
+
if (pixels[leftIndex + 3] === 0) {
|
|
828
|
+
edgeTransparentPixels++;
|
|
829
|
+
}
|
|
767
830
|
const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
|
|
768
|
-
if (pixels[rightIndex + 3] === 0)
|
|
831
|
+
if (pixels[rightIndex + 3] === 0) {
|
|
832
|
+
edgeTransparentPixels++;
|
|
833
|
+
}
|
|
769
834
|
}
|
|
770
835
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
771
836
|
};
|
|
772
837
|
|
|
773
838
|
// src/components/Toolbar/Toolbar.tsx
|
|
774
|
-
import { Primitive as
|
|
775
|
-
import { Slot as
|
|
839
|
+
import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
840
|
+
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
776
841
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
777
|
-
import
|
|
842
|
+
import React18, { forwardRef as forwardRef12 } from "react";
|
|
778
843
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
var translationKey = "@dxos/react-ui";
|
|
782
|
-
var translations = [
|
|
783
|
-
{
|
|
784
|
-
"en-US": {
|
|
785
|
-
[translationKey]: {
|
|
786
|
-
"toolbar menu label": "Action menu",
|
|
787
|
-
"toolbar drag handle label": "Drag to rearrange",
|
|
788
|
-
"toolbar close label": "Close"
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
];
|
|
844
|
+
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
845
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
793
846
|
|
|
794
847
|
// src/components/Menu/ContextMenu.tsx
|
|
795
848
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
796
|
-
import { Primitive as
|
|
797
|
-
import { Slot as
|
|
798
|
-
import
|
|
799
|
-
|
|
800
|
-
// src/hooks/useSafeCollisionPadding.ts
|
|
801
|
-
import { useMemo as useMemo2 } from "react";
|
|
802
|
-
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
803
|
-
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
804
|
-
var safePadding = (propsPadding, safePadding2, side) => {
|
|
805
|
-
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
806
|
-
};
|
|
807
|
-
var useSafeCollisionPadding = (collisionPadding) => {
|
|
808
|
-
const { safeAreaPadding } = useThemeContext();
|
|
809
|
-
return useMemo2(() => ({
|
|
810
|
-
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
811
|
-
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
812
|
-
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
813
|
-
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
814
|
-
}), [
|
|
815
|
-
collisionPadding,
|
|
816
|
-
safeAreaPadding
|
|
817
|
-
]);
|
|
818
|
-
};
|
|
819
|
-
|
|
820
|
-
// src/components/Menu/ContextMenu.tsx
|
|
849
|
+
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
850
|
+
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
851
|
+
import React15, { forwardRef as forwardRef9 } from "react";
|
|
821
852
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
822
853
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
823
854
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
824
|
-
var ContextMenuContent = /* @__PURE__ */
|
|
855
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef9(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
825
856
|
const { tx } = useThemeContext();
|
|
826
857
|
const elevation = useElevationContext();
|
|
827
858
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
828
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Content, {
|
|
829
860
|
...props,
|
|
830
861
|
"data-arrow-keys": "up down",
|
|
831
862
|
collisionPadding: safeCollisionPadding,
|
|
@@ -835,18 +866,18 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef11(({ classNames, children, c
|
|
|
835
866
|
ref: forwardedRef
|
|
836
867
|
}, children);
|
|
837
868
|
});
|
|
838
|
-
var ContextMenuViewport = /* @__PURE__ */
|
|
869
|
+
var ContextMenuViewport = /* @__PURE__ */ forwardRef9(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
839
870
|
const { tx } = useThemeContext();
|
|
840
|
-
const Comp = asChild ?
|
|
841
|
-
return /* @__PURE__ */
|
|
871
|
+
const Comp = asChild ? Slot9 : Primitive9.div;
|
|
872
|
+
return /* @__PURE__ */ React15.createElement(Comp, {
|
|
842
873
|
...props,
|
|
843
874
|
className: tx("menu.viewport", {}, classNames),
|
|
844
875
|
ref: forwardedRef
|
|
845
876
|
}, children);
|
|
846
877
|
});
|
|
847
|
-
var ContextMenuArrow = /* @__PURE__ */
|
|
878
|
+
var ContextMenuArrow = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
848
879
|
const { tx } = useThemeContext();
|
|
849
|
-
return /* @__PURE__ */
|
|
880
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Arrow, {
|
|
850
881
|
...props,
|
|
851
882
|
className: tx("menu.arrow", {}, classNames),
|
|
852
883
|
ref: forwardedRef
|
|
@@ -854,33 +885,33 @@ var ContextMenuArrow = /* @__PURE__ */ forwardRef11(({ classNames, ...props }, f
|
|
|
854
885
|
});
|
|
855
886
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
856
887
|
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
857
|
-
var ContextMenuItem = /* @__PURE__ */
|
|
888
|
+
var ContextMenuItem = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
858
889
|
const { tx } = useThemeContext();
|
|
859
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Item, {
|
|
860
891
|
...props,
|
|
861
892
|
className: tx("menu.item", {}, classNames),
|
|
862
893
|
ref: forwardedRef
|
|
863
894
|
});
|
|
864
895
|
});
|
|
865
|
-
var ContextMenuCheckboxItem = /* @__PURE__ */
|
|
896
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
866
897
|
const { tx } = useThemeContext();
|
|
867
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
868
899
|
...props,
|
|
869
900
|
className: tx("menu.item", {}, classNames),
|
|
870
901
|
ref: forwardedRef
|
|
871
902
|
});
|
|
872
903
|
});
|
|
873
|
-
var ContextMenuSeparator = /* @__PURE__ */
|
|
904
|
+
var ContextMenuSeparator = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
874
905
|
const { tx } = useThemeContext();
|
|
875
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Separator, {
|
|
876
907
|
...props,
|
|
877
908
|
className: tx("menu.separator", {}, classNames),
|
|
878
909
|
ref: forwardedRef
|
|
879
910
|
});
|
|
880
911
|
});
|
|
881
|
-
var ContextMenuGroupLabel = /* @__PURE__ */
|
|
912
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
882
913
|
const { tx } = useThemeContext();
|
|
883
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Label, {
|
|
884
915
|
...props,
|
|
885
916
|
className: tx("menu.groupLabel", {}, classNames),
|
|
886
917
|
ref: forwardedRef
|
|
@@ -908,18 +939,17 @@ import { createContextScope } from "@radix-ui/react-context";
|
|
|
908
939
|
import { useId as useId2 } from "@radix-ui/react-id";
|
|
909
940
|
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
910
941
|
import { createMenuScope } from "@radix-ui/react-menu";
|
|
911
|
-
import { Primitive as
|
|
912
|
-
import { Slot as
|
|
942
|
+
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
943
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
913
944
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
914
|
-
import
|
|
945
|
+
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2 } from "react";
|
|
915
946
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
916
947
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
917
948
|
createMenuScope
|
|
918
949
|
]);
|
|
919
950
|
var useMenuScope = createMenuScope();
|
|
920
951
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
921
|
-
var DropdownMenuRoot = (
|
|
922
|
-
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
952
|
+
var DropdownMenuRoot = ({ __scopeDropdownMenu, children, dir, modal = true, open: openProp, defaultOpen, onOpenChange }) => {
|
|
923
953
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
924
954
|
const triggerRef = useRef2(null);
|
|
925
955
|
const [open = false, setOpen] = useControllableState({
|
|
@@ -927,7 +957,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
927
957
|
defaultProp: defaultOpen,
|
|
928
958
|
onChange: onOpenChange
|
|
929
959
|
});
|
|
930
|
-
return /* @__PURE__ */
|
|
960
|
+
return /* @__PURE__ */ React16.createElement(DropdownMenuProvider, {
|
|
931
961
|
scope: __scopeDropdownMenu,
|
|
932
962
|
triggerId: useId2(),
|
|
933
963
|
triggerRef,
|
|
@@ -938,24 +968,24 @@ var DropdownMenuRoot = (props) => {
|
|
|
938
968
|
setOpen
|
|
939
969
|
]),
|
|
940
970
|
modal
|
|
941
|
-
}, /* @__PURE__ */
|
|
971
|
+
}, /* @__PURE__ */ React16.createElement(MenuPrimitive.Root, {
|
|
942
972
|
...menuScope,
|
|
943
|
-
open,
|
|
944
|
-
onOpenChange: setOpen,
|
|
945
973
|
dir,
|
|
946
|
-
modal
|
|
974
|
+
modal,
|
|
975
|
+
open,
|
|
976
|
+
onOpenChange: setOpen
|
|
947
977
|
}, children));
|
|
948
978
|
};
|
|
949
979
|
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
950
980
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
951
|
-
var DropdownMenuTrigger = /* @__PURE__ */
|
|
981
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
952
982
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
953
983
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
954
984
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
955
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Anchor, {
|
|
956
986
|
asChild: true,
|
|
957
987
|
...menuScope
|
|
958
|
-
}, /* @__PURE__ */
|
|
988
|
+
}, /* @__PURE__ */ React16.createElement(Primitive10.button, {
|
|
959
989
|
type: "button",
|
|
960
990
|
id: context.triggerId,
|
|
961
991
|
"aria-haspopup": "menu",
|
|
@@ -1009,7 +1039,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
1009
1039
|
context.triggerRef.current = virtualRef.current;
|
|
1010
1040
|
}
|
|
1011
1041
|
});
|
|
1012
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Anchor, {
|
|
1013
1043
|
...menuScope,
|
|
1014
1044
|
virtualRef
|
|
1015
1045
|
});
|
|
@@ -1019,23 +1049,23 @@ var PORTAL_NAME = "DropdownMenuPortal";
|
|
|
1019
1049
|
var DropdownMenuPortal = (props) => {
|
|
1020
1050
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
1021
1051
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1022
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Portal, {
|
|
1023
1053
|
...menuScope,
|
|
1024
1054
|
...portalProps
|
|
1025
1055
|
});
|
|
1026
1056
|
};
|
|
1027
1057
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
1028
|
-
var DropdownMenuViewport = /* @__PURE__ */
|
|
1058
|
+
var DropdownMenuViewport = /* @__PURE__ */ forwardRef10(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1029
1059
|
const { tx } = useThemeContext();
|
|
1030
|
-
const Comp = asChild ?
|
|
1031
|
-
return /* @__PURE__ */
|
|
1060
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1061
|
+
return /* @__PURE__ */ React16.createElement(Comp, {
|
|
1032
1062
|
...props,
|
|
1033
1063
|
className: tx("menu.viewport", {}, classNames),
|
|
1034
1064
|
ref: forwardedRef
|
|
1035
1065
|
}, children);
|
|
1036
1066
|
});
|
|
1037
1067
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
1038
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
1068
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1039
1069
|
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
1040
1070
|
const { tx } = useThemeContext();
|
|
1041
1071
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
@@ -1043,7 +1073,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef12((props, forwardedRef) =>
|
|
|
1043
1073
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1044
1074
|
const hasInteractedOutsideRef = useRef2(false);
|
|
1045
1075
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1046
|
-
const computedCollisionBoundary =
|
|
1076
|
+
const computedCollisionBoundary = useMemo4(() => {
|
|
1047
1077
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
1048
1078
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
1049
1079
|
closestBoundary,
|
|
@@ -1059,7 +1089,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef12((props, forwardedRef) =>
|
|
|
1059
1089
|
collisionBoundary,
|
|
1060
1090
|
context.triggerRef.current
|
|
1061
1091
|
]);
|
|
1062
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Content, {
|
|
1063
1093
|
id: context.contentId,
|
|
1064
1094
|
"aria-labelledby": context.triggerId,
|
|
1065
1095
|
...menuScope,
|
|
@@ -1101,10 +1131,10 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef12((props, forwardedRef) =>
|
|
|
1101
1131
|
});
|
|
1102
1132
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
1103
1133
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
1104
|
-
var DropdownMenuGroup = /* @__PURE__ */
|
|
1134
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1105
1135
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1106
1136
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1107
|
-
return /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Group, {
|
|
1108
1138
|
...menuScope,
|
|
1109
1139
|
...groupProps,
|
|
1110
1140
|
ref: forwardedRef
|
|
@@ -1112,11 +1142,11 @@ var DropdownMenuGroup = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
|
1112
1142
|
});
|
|
1113
1143
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
1114
1144
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
1115
|
-
var DropdownMenuGroupLabel = /* @__PURE__ */
|
|
1145
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1116
1146
|
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1117
1147
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1118
1148
|
const { tx } = useThemeContext();
|
|
1119
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Label, {
|
|
1120
1150
|
...menuScope,
|
|
1121
1151
|
...labelProps,
|
|
1122
1152
|
className: tx("menu.groupLabel", {}, classNames),
|
|
@@ -1125,11 +1155,11 @@ var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef12((props, forwardedRef)
|
|
|
1125
1155
|
});
|
|
1126
1156
|
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
1127
1157
|
var ITEM_NAME = "DropdownMenuItem";
|
|
1128
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
1158
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1129
1159
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1130
1160
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1131
1161
|
const { tx } = useThemeContext();
|
|
1132
|
-
return /* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Item, {
|
|
1133
1163
|
...menuScope,
|
|
1134
1164
|
...itemProps,
|
|
1135
1165
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1138,11 +1168,11 @@ var DropdownMenuItem = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
|
1138
1168
|
});
|
|
1139
1169
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
1140
1170
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
1141
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
1171
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1142
1172
|
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1143
1173
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1144
1174
|
const { tx } = useThemeContext();
|
|
1145
|
-
return /* @__PURE__ */
|
|
1175
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.CheckboxItem, {
|
|
1146
1176
|
...menuScope,
|
|
1147
1177
|
...checkboxItemProps,
|
|
1148
1178
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1151,10 +1181,10 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef12((props, forwardedRef
|
|
|
1151
1181
|
});
|
|
1152
1182
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
1153
1183
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
1154
|
-
var DropdownMenuRadioGroup = /* @__PURE__ */
|
|
1184
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1155
1185
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1156
1186
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1157
|
-
return /* @__PURE__ */
|
|
1187
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.RadioGroup, {
|
|
1158
1188
|
...menuScope,
|
|
1159
1189
|
...radioGroupProps,
|
|
1160
1190
|
ref: forwardedRef
|
|
@@ -1162,11 +1192,11 @@ var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef12((props, forwardedRef)
|
|
|
1162
1192
|
});
|
|
1163
1193
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
1164
1194
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
1165
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
1195
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1166
1196
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1167
1197
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1168
1198
|
const { tx } = useThemeContext();
|
|
1169
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Item, {
|
|
1170
1200
|
...menuScope,
|
|
1171
1201
|
...itemProps,
|
|
1172
1202
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1175,10 +1205,10 @@ var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef12((props, forwardedRef) =
|
|
|
1175
1205
|
});
|
|
1176
1206
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
1177
1207
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
1178
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */
|
|
1208
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1179
1209
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1180
1210
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1181
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.ItemIndicator, {
|
|
1182
1212
|
...menuScope,
|
|
1183
1213
|
...itemIndicatorProps,
|
|
1184
1214
|
ref: forwardedRef
|
|
@@ -1186,11 +1216,11 @@ var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef12((props, forwardedRe
|
|
|
1186
1216
|
});
|
|
1187
1217
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1188
1218
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
1189
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
1219
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1190
1220
|
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1191
1221
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1192
1222
|
const { tx } = useThemeContext();
|
|
1193
|
-
return /* @__PURE__ */
|
|
1223
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Separator, {
|
|
1194
1224
|
...menuScope,
|
|
1195
1225
|
...separatorProps,
|
|
1196
1226
|
className: tx("menu.separator", {}, classNames),
|
|
@@ -1199,11 +1229,11 @@ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef12((props, forwardedRef) =
|
|
|
1199
1229
|
});
|
|
1200
1230
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1201
1231
|
var ARROW_NAME = "DropdownMenuArrow";
|
|
1202
|
-
var DropdownMenuArrow = /* @__PURE__ */
|
|
1232
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1203
1233
|
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1204
1234
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1205
1235
|
const { tx } = useThemeContext();
|
|
1206
|
-
return /* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Arrow, {
|
|
1207
1237
|
...menuScope,
|
|
1208
1238
|
...arrowProps,
|
|
1209
1239
|
className: tx("menu.arrow", {}, classNames),
|
|
@@ -1219,17 +1249,17 @@ var DropdownMenuSub = (props) => {
|
|
|
1219
1249
|
defaultProp: defaultOpen,
|
|
1220
1250
|
onChange: onOpenChange
|
|
1221
1251
|
});
|
|
1222
|
-
return /* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Sub, {
|
|
1223
1253
|
...menuScope,
|
|
1224
1254
|
open,
|
|
1225
1255
|
onOpenChange: setOpen
|
|
1226
1256
|
}, children);
|
|
1227
1257
|
};
|
|
1228
1258
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1229
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
1259
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1230
1260
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1231
1261
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1232
|
-
return /* @__PURE__ */
|
|
1262
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.SubTrigger, {
|
|
1233
1263
|
...menuScope,
|
|
1234
1264
|
...subTriggerProps,
|
|
1235
1265
|
ref: forwardedRef
|
|
@@ -1237,10 +1267,10 @@ var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef12((props, forwardedRef)
|
|
|
1237
1267
|
});
|
|
1238
1268
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1239
1269
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1240
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
1270
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1241
1271
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1242
1272
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1243
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.SubContent, {
|
|
1244
1274
|
...menuScope,
|
|
1245
1275
|
...subContentProps,
|
|
1246
1276
|
ref: forwardedRef,
|
|
@@ -1281,13 +1311,13 @@ var DropdownMenu = {
|
|
|
1281
1311
|
var useDropdownMenuMenuScope = useMenuScope;
|
|
1282
1312
|
|
|
1283
1313
|
// src/components/Separator/Separator.tsx
|
|
1284
|
-
import
|
|
1285
|
-
import
|
|
1286
|
-
var Separator3 = /* @__PURE__ */
|
|
1314
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1315
|
+
import React17, { forwardRef as forwardRef11 } from "react";
|
|
1316
|
+
var Separator3 = /* @__PURE__ */ forwardRef11(({ classNames, orientation = "horizontal", subdued, ...props }, forwardedRef) => {
|
|
1287
1317
|
const { tx } = useThemeContext();
|
|
1288
|
-
return /* @__PURE__ */
|
|
1289
|
-
orientation,
|
|
1318
|
+
return /* @__PURE__ */ React17.createElement(SeparatorPrimitive.Root, {
|
|
1290
1319
|
...props,
|
|
1320
|
+
orientation,
|
|
1291
1321
|
className: tx("separator.root", {
|
|
1292
1322
|
orientation,
|
|
1293
1323
|
subdued
|
|
@@ -1297,87 +1327,83 @@ var Separator3 = /* @__PURE__ */ forwardRef13(({ classNames, orientation = "hori
|
|
|
1297
1327
|
});
|
|
1298
1328
|
|
|
1299
1329
|
// src/components/Toolbar/Toolbar.tsx
|
|
1300
|
-
var ToolbarRoot =
|
|
1330
|
+
var ToolbarRoot = composable2(({ children, density, disabled, layoutManaged, orientation, ...props }, forwardedRef) => {
|
|
1331
|
+
const { className, role, ...rest } = composableProps6(props);
|
|
1301
1332
|
const { tx } = useThemeContext();
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
role
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
return /* @__PURE__ */ React17.createElement(ToolbarPrimitive.Root, {
|
|
1310
|
-
...props,
|
|
1311
|
-
"data-arrow-keys": props.orientation === "vertical" ? "up down" : "left right",
|
|
1333
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Root, {
|
|
1334
|
+
...rest,
|
|
1335
|
+
...role !== "none" && {
|
|
1336
|
+
role
|
|
1337
|
+
},
|
|
1338
|
+
orientation,
|
|
1339
|
+
"data-arrow-keys": orientation === "vertical" ? "up down" : "left right",
|
|
1312
1340
|
className: tx("toolbar.root", {
|
|
1313
1341
|
density,
|
|
1314
1342
|
disabled,
|
|
1315
1343
|
layoutManaged
|
|
1316
|
-
},
|
|
1344
|
+
}, className),
|
|
1317
1345
|
ref: forwardedRef
|
|
1318
|
-
},
|
|
1346
|
+
}, children);
|
|
1319
1347
|
});
|
|
1320
|
-
var ToolbarText =
|
|
1348
|
+
var ToolbarText = slottable5(({ children, asChild, ...props }, forwardedRef) => {
|
|
1349
|
+
const { className, ...rest } = composableProps6(props);
|
|
1350
|
+
const Comp = asChild ? Slot11 : Primitive11.div;
|
|
1321
1351
|
const { tx } = useThemeContext();
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
className: tx("toolbar.text", {}, [
|
|
1326
|
-
className,
|
|
1327
|
-
classNames
|
|
1328
|
-
]),
|
|
1352
|
+
return /* @__PURE__ */ React18.createElement(Comp, {
|
|
1353
|
+
...rest,
|
|
1354
|
+
className: tx("toolbar.text", {}, className),
|
|
1329
1355
|
ref: forwardedRef
|
|
1330
1356
|
}, children);
|
|
1331
1357
|
});
|
|
1332
|
-
var ToolbarButton = /* @__PURE__ */
|
|
1333
|
-
return /* @__PURE__ */
|
|
1358
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1359
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1334
1360
|
asChild: true
|
|
1335
|
-
}, /* @__PURE__ */
|
|
1361
|
+
}, /* @__PURE__ */ React18.createElement(Button, {
|
|
1336
1362
|
...props,
|
|
1337
1363
|
ref: forwardedRef
|
|
1338
1364
|
}));
|
|
1339
1365
|
});
|
|
1340
|
-
var ToolbarIconButton = /* @__PURE__ */
|
|
1341
|
-
return /* @__PURE__ */
|
|
1366
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1367
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1342
1368
|
asChild: true
|
|
1343
|
-
}, /* @__PURE__ */
|
|
1369
|
+
}, /* @__PURE__ */ React18.createElement(IconButton, {
|
|
1344
1370
|
...props,
|
|
1345
1371
|
noTooltip: true,
|
|
1346
1372
|
ref: forwardedRef
|
|
1347
1373
|
}));
|
|
1348
1374
|
});
|
|
1349
|
-
var ToolbarToggle = /* @__PURE__ */
|
|
1350
|
-
return /* @__PURE__ */
|
|
1375
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1376
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1351
1377
|
asChild: true
|
|
1352
|
-
}, /* @__PURE__ */
|
|
1378
|
+
}, /* @__PURE__ */ React18.createElement(Toggle, {
|
|
1353
1379
|
...props,
|
|
1354
1380
|
ref: forwardedRef
|
|
1355
1381
|
}));
|
|
1356
1382
|
});
|
|
1357
|
-
var ToolbarLink = /* @__PURE__ */
|
|
1358
|
-
return /* @__PURE__ */
|
|
1383
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1384
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Link, {
|
|
1359
1385
|
asChild: true
|
|
1360
|
-
}, /* @__PURE__ */
|
|
1386
|
+
}, /* @__PURE__ */ React18.createElement(Link, {
|
|
1361
1387
|
...props,
|
|
1362
1388
|
ref: forwardedRef
|
|
1363
1389
|
}));
|
|
1364
1390
|
});
|
|
1365
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
1366
|
-
return /* @__PURE__ */
|
|
1391
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef12(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
1392
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
1367
1393
|
...props,
|
|
1368
1394
|
asChild: true
|
|
1369
|
-
}, /* @__PURE__ */
|
|
1395
|
+
}, /* @__PURE__ */ React18.createElement(ButtonGroup, {
|
|
1370
1396
|
classNames,
|
|
1371
1397
|
children,
|
|
1372
1398
|
elevation,
|
|
1373
1399
|
ref: forwardedRef
|
|
1374
1400
|
}));
|
|
1375
1401
|
});
|
|
1376
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
1377
|
-
return /* @__PURE__ */
|
|
1402
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
1403
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1378
1404
|
...props,
|
|
1379
1405
|
asChild: true
|
|
1380
|
-
}, /* @__PURE__ */
|
|
1406
|
+
}, /* @__PURE__ */ React18.createElement(Button, {
|
|
1381
1407
|
variant,
|
|
1382
1408
|
density,
|
|
1383
1409
|
elevation,
|
|
@@ -1386,11 +1412,11 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef14(({ variant, density, e
|
|
|
1386
1412
|
ref: forwardedRef
|
|
1387
1413
|
}));
|
|
1388
1414
|
});
|
|
1389
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */
|
|
1390
|
-
return /* @__PURE__ */
|
|
1415
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, icon, label, iconOnly, iconClassNames, ...props }, forwardedRef) => {
|
|
1416
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1391
1417
|
...props,
|
|
1392
1418
|
asChild: true
|
|
1393
|
-
}, /* @__PURE__ */
|
|
1419
|
+
}, /* @__PURE__ */ React18.createElement(IconButton, {
|
|
1394
1420
|
variant,
|
|
1395
1421
|
density,
|
|
1396
1422
|
elevation,
|
|
@@ -1398,64 +1424,65 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef14(({ variant, densit
|
|
|
1398
1424
|
icon,
|
|
1399
1425
|
label,
|
|
1400
1426
|
iconOnly,
|
|
1427
|
+
iconClassNames,
|
|
1401
1428
|
ref: forwardedRef
|
|
1402
1429
|
}));
|
|
1403
1430
|
});
|
|
1404
|
-
var ToolbarSeparator = /* @__PURE__ */
|
|
1405
|
-
return variant === "line" ? /* @__PURE__ */
|
|
1431
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef12(({ variant = "gap", ...props }, forwardedRef) => {
|
|
1432
|
+
return variant === "line" ? /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Separator, {
|
|
1406
1433
|
asChild: true
|
|
1407
|
-
}, /* @__PURE__ */
|
|
1434
|
+
}, /* @__PURE__ */ React18.createElement(Separator3, {
|
|
1435
|
+
orientation: "vertical",
|
|
1408
1436
|
...props,
|
|
1409
1437
|
ref: forwardedRef
|
|
1410
|
-
})) : /* @__PURE__ */
|
|
1438
|
+
})) : /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Separator, {
|
|
1411
1439
|
className: "grow",
|
|
1412
1440
|
ref: forwardedRef
|
|
1413
1441
|
});
|
|
1414
1442
|
});
|
|
1415
|
-
var ToolbarDragHandle = /* @__PURE__ */
|
|
1416
|
-
const { t } = useTranslation2(
|
|
1417
|
-
return /* @__PURE__ */
|
|
1443
|
+
var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1444
|
+
const { t } = useTranslation2(translationKey2);
|
|
1445
|
+
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1418
1446
|
"data-testid": testId,
|
|
1447
|
+
tabIndex: -1,
|
|
1419
1448
|
noTooltip: true,
|
|
1420
1449
|
iconOnly: true,
|
|
1421
1450
|
icon: "ph--dots-six-vertical--regular",
|
|
1422
1451
|
variant: "ghost",
|
|
1423
|
-
label: label ?? t("toolbar
|
|
1424
|
-
classNames: "cursor-pointer",
|
|
1425
|
-
size: 5,
|
|
1452
|
+
label: label ?? t("toolbar-drag-handle.label"),
|
|
1453
|
+
classNames: "dx-focus-ring-none cursor-pointer",
|
|
1426
1454
|
disabled: !forwardedRef,
|
|
1427
1455
|
ref: forwardedRef
|
|
1428
1456
|
});
|
|
1429
1457
|
});
|
|
1430
|
-
var ToolbarCloseIconButton = /* @__PURE__ */
|
|
1431
|
-
const { t } = useTranslation2(
|
|
1432
|
-
return /* @__PURE__ */
|
|
1458
|
+
var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, forwardedRef) => {
|
|
1459
|
+
const { t } = useTranslation2(translationKey2);
|
|
1460
|
+
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1433
1461
|
iconOnly: true,
|
|
1434
1462
|
icon: "ph--x--regular",
|
|
1435
1463
|
variant: "ghost",
|
|
1436
|
-
label: label ?? t("toolbar
|
|
1464
|
+
label: label ?? t("toolbar-close.label"),
|
|
1437
1465
|
classNames: "cursor-pointer",
|
|
1438
|
-
size: 5,
|
|
1439
1466
|
onClick,
|
|
1440
1467
|
ref: forwardedRef
|
|
1441
1468
|
});
|
|
1442
1469
|
});
|
|
1443
1470
|
var ToolbarMenu = ({ context, items }) => {
|
|
1444
|
-
const { t } = useTranslation2(
|
|
1445
|
-
return /* @__PURE__ */
|
|
1471
|
+
const { t } = useTranslation2(translationKey2);
|
|
1472
|
+
return /* @__PURE__ */ React18.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Trigger, {
|
|
1446
1473
|
disabled: !items?.length,
|
|
1447
1474
|
asChild: true
|
|
1448
|
-
}, /* @__PURE__ */
|
|
1475
|
+
}, /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1449
1476
|
iconOnly: true,
|
|
1450
1477
|
variant: "ghost",
|
|
1451
1478
|
icon: "ph--dots-three-vertical--regular",
|
|
1452
|
-
label: t("toolbar
|
|
1453
|
-
})), (items?.length ?? 0) > 0 && /* @__PURE__ */
|
|
1479
|
+
label: t("toolbar-menu.label")
|
|
1480
|
+
})), (items?.length ?? 0) > 0 && /* @__PURE__ */ React18.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Viewport, null, items?.map(({ label, onClick: onSelect }, index) => /* @__PURE__ */ React18.createElement(DropdownMenu.Item, {
|
|
1454
1481
|
key: index,
|
|
1455
1482
|
onSelect: () => onSelect(context)
|
|
1456
|
-
}, label))), /* @__PURE__ */
|
|
1483
|
+
}, label))), /* @__PURE__ */ React18.createElement(DropdownMenu.Arrow, null))));
|
|
1457
1484
|
};
|
|
1458
|
-
var
|
|
1485
|
+
var Toolbar = {
|
|
1459
1486
|
Root: ToolbarRoot,
|
|
1460
1487
|
Text: ToolbarText,
|
|
1461
1488
|
Button: ToolbarButton,
|
|
@@ -1473,251 +1500,621 @@ var Toolbar2 = {
|
|
|
1473
1500
|
|
|
1474
1501
|
// src/components/Card/Card.tsx
|
|
1475
1502
|
var CardContext = /* @__PURE__ */ createContext3({});
|
|
1476
|
-
var
|
|
1503
|
+
var CARD_ROOT_NAME = "Card.Root";
|
|
1504
|
+
var CardRoot = composable3(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1505
|
+
const { className, ...rest } = composableProps7(props);
|
|
1477
1506
|
const { tx } = useThemeContext();
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1507
|
+
return /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1508
|
+
asChild: true,
|
|
1509
|
+
gutter: density === "coarse" ? "lg" : "md",
|
|
1510
|
+
classNames: tx("card.root", {
|
|
1511
|
+
border,
|
|
1512
|
+
fullWidth
|
|
1513
|
+
}, className),
|
|
1514
|
+
role: role ?? "group"
|
|
1515
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1516
|
+
...rest,
|
|
1481
1517
|
...id && {
|
|
1482
1518
|
"data-object-id": id
|
|
1483
1519
|
},
|
|
1484
|
-
role: role ?? "group",
|
|
1485
|
-
className: tx("card.root", {
|
|
1486
|
-
border,
|
|
1487
|
-
fullWidth
|
|
1488
|
-
}, [
|
|
1489
|
-
className,
|
|
1490
|
-
classNames
|
|
1491
|
-
]),
|
|
1492
1520
|
ref: forwardedRef
|
|
1493
|
-
}, /* @__PURE__ */ React18.createElement(Column.Root, {
|
|
1494
|
-
gutter: "rail"
|
|
1495
1521
|
}, children));
|
|
1496
1522
|
});
|
|
1497
|
-
|
|
1523
|
+
CardRoot.displayName = CARD_ROOT_NAME;
|
|
1524
|
+
var CARD_TOOLBAR_NAME = "Card.Toolbar";
|
|
1525
|
+
var CardToolbar = composable3(({ children, classNames, ...props }, forwardedRef) => {
|
|
1498
1526
|
const { tx } = useThemeContext();
|
|
1499
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ React19.createElement(Toolbar.Root, {
|
|
1500
1528
|
...props,
|
|
1529
|
+
style: iconSize(5),
|
|
1501
1530
|
classNames: [
|
|
1502
|
-
tx("card.toolbar", {
|
|
1503
|
-
coarse: density !== "fine"
|
|
1504
|
-
}),
|
|
1531
|
+
tx("card.toolbar", {}),
|
|
1505
1532
|
classNames
|
|
1506
1533
|
],
|
|
1507
1534
|
ref: forwardedRef
|
|
1508
1535
|
}, children);
|
|
1509
1536
|
});
|
|
1510
|
-
|
|
1537
|
+
CardToolbar.displayName = CARD_TOOLBAR_NAME;
|
|
1538
|
+
var CARD_DRAG_HANDLE_NAME = "Card.DragHandle";
|
|
1539
|
+
var CardDragHandle = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1540
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1541
|
+
padding: true
|
|
1542
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.DragHandle, {
|
|
1543
|
+
...props,
|
|
1544
|
+
ref: forwardedRef
|
|
1545
|
+
}));
|
|
1546
|
+
});
|
|
1547
|
+
CardDragHandle.displayName = CARD_DRAG_HANDLE_NAME;
|
|
1548
|
+
var CARD_CLOSE_ICON_BUTTON_NAME = "Card.CloseIconButton";
|
|
1549
|
+
var CloseIconButton = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1550
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1551
|
+
padding: true
|
|
1552
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.CloseIconButton, {
|
|
1553
|
+
...props,
|
|
1554
|
+
ref: forwardedRef
|
|
1555
|
+
}));
|
|
1556
|
+
});
|
|
1557
|
+
CloseIconButton.displayName = CARD_CLOSE_ICON_BUTTON_NAME;
|
|
1558
|
+
var CARD_MENU_NAME = "Card.Menu";
|
|
1559
|
+
var CardMenu = ({ context, items, ...props }) => {
|
|
1511
1560
|
const { menuItems } = useContext3(CardContext) ?? {};
|
|
1512
1561
|
const combinedItems = [
|
|
1513
1562
|
...items ?? [],
|
|
1514
1563
|
...menuItems ?? []
|
|
1515
1564
|
];
|
|
1516
|
-
return /* @__PURE__ */
|
|
1565
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1566
|
+
padding: true
|
|
1567
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.Menu, {
|
|
1568
|
+
...props,
|
|
1517
1569
|
context,
|
|
1518
1570
|
items: combinedItems
|
|
1519
|
-
});
|
|
1571
|
+
}));
|
|
1520
1572
|
};
|
|
1521
|
-
|
|
1573
|
+
CardMenu.displayName = CARD_MENU_NAME;
|
|
1574
|
+
var CARD_ICON_NAME = "Card.Icon";
|
|
1575
|
+
var CardIcon = (props) => {
|
|
1576
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, null, /* @__PURE__ */ React19.createElement(Icon, props));
|
|
1577
|
+
};
|
|
1578
|
+
CardIcon.displayName = CARD_ICON_NAME;
|
|
1579
|
+
var CARD_ICON_BLOCK_NAME = "Card.IconBlock";
|
|
1580
|
+
var CardIconBlock = /* @__PURE__ */ forwardRef13(({ classNames, children, padding, ...props }, forwardedRef) => {
|
|
1522
1581
|
const { tx } = useThemeContext();
|
|
1523
|
-
|
|
1524
|
-
return /* @__PURE__ */ React18.createElement(Comp, {
|
|
1582
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1525
1583
|
...props,
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
classNames
|
|
1530
|
-
]),
|
|
1584
|
+
className: tx("card.icon-block", {
|
|
1585
|
+
padding
|
|
1586
|
+
}, classNames),
|
|
1531
1587
|
ref: forwardedRef
|
|
1532
1588
|
}, children);
|
|
1533
1589
|
});
|
|
1534
|
-
|
|
1590
|
+
CardIconBlock.displayName = CARD_ICON_BLOCK_NAME;
|
|
1591
|
+
var CARD_TITLE_NAME = "Card.Title";
|
|
1592
|
+
var CardTitle = slottable6(({ children, asChild, ...props }, forwardedRef) => {
|
|
1535
1593
|
const { tx } = useThemeContext();
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1594
|
+
const { className, ...rest } = composableProps7(props, {
|
|
1595
|
+
role: "heading"
|
|
1596
|
+
});
|
|
1597
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1598
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1599
|
+
...rest,
|
|
1600
|
+
className: tx("card.title", {}, className),
|
|
1540
1601
|
ref: forwardedRef
|
|
1541
1602
|
}, children);
|
|
1542
1603
|
});
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1604
|
+
CardTitle.displayName = CARD_TITLE_NAME;
|
|
1605
|
+
var CARD_CONTENT_NAME = "Card.Content";
|
|
1606
|
+
var CardContent = slottable6(({ children, asChild, ...props }, forwardedRef) => {
|
|
1607
|
+
const { className, ...rest } = composableProps7(props);
|
|
1608
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1609
|
+
const { tx } = useThemeContext();
|
|
1610
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1611
|
+
...rest,
|
|
1612
|
+
className: tx("card.content", {}, className),
|
|
1551
1613
|
ref: forwardedRef
|
|
1552
|
-
},
|
|
1614
|
+
}, children);
|
|
1615
|
+
});
|
|
1616
|
+
CardContent.displayName = CARD_CONTENT_NAME;
|
|
1617
|
+
var CARD_ROW_NAME = "Card.Row";
|
|
1618
|
+
var CardRow = slottable6(({ children, asChild, icon, ...props }, forwardedRef) => {
|
|
1619
|
+
const { className, ...rest } = composableProps7(props);
|
|
1620
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1621
|
+
const { tx } = useThemeContext();
|
|
1622
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1623
|
+
...rest,
|
|
1624
|
+
className: tx("card.row", {}, className),
|
|
1625
|
+
ref: forwardedRef
|
|
1626
|
+
}, icon && /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1553
1627
|
classNames: "text-subdued",
|
|
1554
|
-
icon
|
|
1555
|
-
|
|
1628
|
+
icon,
|
|
1629
|
+
size: 4
|
|
1630
|
+
}) || /* @__PURE__ */ React19.createElement("div", null), children);
|
|
1556
1631
|
});
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1632
|
+
CardRow.displayName = CARD_ROW_NAME;
|
|
1633
|
+
var CARD_SECTION_NAME = "Card.Section";
|
|
1634
|
+
var CardSection = slottable6(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
1635
|
+
const { className, ...rest } = composableProps7(props);
|
|
1636
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1637
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1638
|
+
...rest,
|
|
1561
1639
|
role: role ?? "none",
|
|
1562
|
-
className:
|
|
1640
|
+
className: mx6("col-span-full", className),
|
|
1563
1641
|
ref: forwardedRef
|
|
1564
1642
|
}, children);
|
|
1565
1643
|
});
|
|
1566
|
-
|
|
1644
|
+
CardSection.displayName = CARD_SECTION_NAME;
|
|
1645
|
+
var CARD_HEADING_NAME = "Card.Heading";
|
|
1646
|
+
var CardHeading = slottable6(({ children, asChild, role, variant = "default", ...props }, forwardedRef) => {
|
|
1647
|
+
const { className, ...rest } = composableProps7(props);
|
|
1648
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1567
1649
|
const { tx } = useThemeContext();
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
...props,
|
|
1650
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1651
|
+
...rest,
|
|
1571
1652
|
role: role ?? "heading",
|
|
1572
1653
|
className: tx("card.heading", {
|
|
1573
1654
|
variant
|
|
1574
|
-
},
|
|
1575
|
-
classNames,
|
|
1576
|
-
className
|
|
1577
|
-
]),
|
|
1655
|
+
}, className),
|
|
1578
1656
|
ref: forwardedRef
|
|
1579
1657
|
}, children);
|
|
1580
1658
|
});
|
|
1581
|
-
|
|
1659
|
+
CardHeading.displayName = CARD_HEADING_NAME;
|
|
1660
|
+
var CARD_TEXT_NAME = "Card.Text";
|
|
1661
|
+
var CardText = slottable6(({ children, asChild, role, truncate, variant = "default", ...props }, forwardedRef) => {
|
|
1662
|
+
const { className, ...rest } = composableProps7(props);
|
|
1663
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1582
1664
|
const { tx } = useThemeContext();
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
...props,
|
|
1665
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1666
|
+
...rest,
|
|
1586
1667
|
role: role ?? "none",
|
|
1587
1668
|
className: tx("card.text", {
|
|
1588
1669
|
variant
|
|
1589
|
-
},
|
|
1590
|
-
classNames,
|
|
1591
|
-
className
|
|
1592
|
-
]),
|
|
1670
|
+
}, className),
|
|
1593
1671
|
ref: forwardedRef
|
|
1594
|
-
}, /* @__PURE__ */
|
|
1672
|
+
}, /* @__PURE__ */ React19.createElement("span", {
|
|
1595
1673
|
className: tx("card.text-span", {
|
|
1596
1674
|
variant,
|
|
1597
1675
|
truncate
|
|
1598
1676
|
})
|
|
1599
1677
|
}, children));
|
|
1600
1678
|
});
|
|
1679
|
+
CardText.displayName = CARD_TEXT_NAME;
|
|
1680
|
+
var CARD_HTML_NAME = "Card.Html";
|
|
1681
|
+
var CardHtml = ({ html, variant = "default", ...props }) => {
|
|
1682
|
+
const { tx } = useThemeContext();
|
|
1683
|
+
const sanitized = useMemo5(() => DOMPurify.sanitize(html), [
|
|
1684
|
+
html
|
|
1685
|
+
]);
|
|
1686
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1687
|
+
...props,
|
|
1688
|
+
className: tx("card.text", {
|
|
1689
|
+
variant
|
|
1690
|
+
}),
|
|
1691
|
+
// eslint-disable-next-line react/no-danger
|
|
1692
|
+
dangerouslySetInnerHTML: {
|
|
1693
|
+
__html: sanitized
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
};
|
|
1697
|
+
CardHtml.displayName = CARD_HTML_NAME;
|
|
1698
|
+
var CARD_POSTER_NAME = "Card.Poster";
|
|
1601
1699
|
var CardPoster = (props) => {
|
|
1602
1700
|
const { tx } = useThemeContext();
|
|
1603
1701
|
const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
|
|
1604
1702
|
if (props.image) {
|
|
1605
|
-
return /* @__PURE__ */
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
}, /* @__PURE__ */ React18.createElement(Image, {
|
|
1703
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1704
|
+
className: "col-span-full"
|
|
1705
|
+
}, /* @__PURE__ */ React19.createElement(Image, {
|
|
1609
1706
|
classNames: [
|
|
1610
1707
|
tx("card.poster", {}),
|
|
1611
1708
|
aspect,
|
|
1612
1709
|
props.classNames
|
|
1613
1710
|
],
|
|
1614
1711
|
src: props.image,
|
|
1615
|
-
alt: props.alt
|
|
1712
|
+
alt: props.alt,
|
|
1713
|
+
fit: props.fit
|
|
1616
1714
|
}));
|
|
1617
1715
|
}
|
|
1618
1716
|
if (props.icon) {
|
|
1619
|
-
return /* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1620
1718
|
role: "image",
|
|
1621
1719
|
className: tx("card.poster-icon", {}, [
|
|
1622
1720
|
aspect,
|
|
1623
1721
|
props.classNames
|
|
1624
1722
|
]),
|
|
1625
1723
|
"aria-label": props.alt
|
|
1626
|
-
}, /* @__PURE__ */
|
|
1724
|
+
}, /* @__PURE__ */ React19.createElement(Icon, {
|
|
1627
1725
|
icon: props.icon,
|
|
1628
1726
|
size: 10
|
|
1629
1727
|
}));
|
|
1630
1728
|
}
|
|
1631
1729
|
};
|
|
1730
|
+
CardPoster.displayName = CARD_POSTER_NAME;
|
|
1731
|
+
var CARD_ACTION_NAME = "Card.Action";
|
|
1632
1732
|
var CardAction = ({ icon, actionIcon = "ph--arrow-right--regular", label, onClick }) => {
|
|
1633
1733
|
const { tx } = useThemeContext();
|
|
1634
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ React19.createElement(Button, {
|
|
1635
1735
|
variant: "ghost",
|
|
1636
1736
|
classNames: tx("card.action", {}),
|
|
1637
1737
|
onClick
|
|
1638
|
-
}, icon ? /* @__PURE__ */
|
|
1738
|
+
}, icon ? /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1639
1739
|
classNames: "text-subdued",
|
|
1640
|
-
icon
|
|
1641
|
-
|
|
1740
|
+
icon,
|
|
1741
|
+
size: 4
|
|
1742
|
+
}) : /* @__PURE__ */ React19.createElement("div", null), /* @__PURE__ */ React19.createElement("span", {
|
|
1642
1743
|
className: tx("card.action-label", {}, !actionIcon ? "col-span-2" : void 0)
|
|
1643
|
-
}, label), actionIcon && /* @__PURE__ */
|
|
1644
|
-
icon: actionIcon
|
|
1744
|
+
}, label), actionIcon && /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1745
|
+
icon: actionIcon,
|
|
1746
|
+
size: 4
|
|
1645
1747
|
}));
|
|
1646
1748
|
};
|
|
1749
|
+
CardAction.displayName = CARD_ACTION_NAME;
|
|
1750
|
+
var CARD_LINK_NAME = "Card.Link";
|
|
1647
1751
|
var CardLink = ({ label, href }) => {
|
|
1648
1752
|
const { tx } = useThemeContext();
|
|
1649
|
-
return /* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ React19.createElement("a", {
|
|
1650
1754
|
className: tx("card.link", {}),
|
|
1651
1755
|
"data-variant": "ghost",
|
|
1652
1756
|
href,
|
|
1653
1757
|
target: "_blank",
|
|
1654
1758
|
rel: "noreferrer"
|
|
1655
|
-
}, /* @__PURE__ */
|
|
1759
|
+
}, /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1656
1760
|
classNames: "text-subdued",
|
|
1657
1761
|
icon: "ph--link--regular"
|
|
1658
|
-
}), /* @__PURE__ */
|
|
1762
|
+
}), /* @__PURE__ */ React19.createElement("span", {
|
|
1659
1763
|
className: tx("card.link-label", {})
|
|
1660
|
-
}, label), /* @__PURE__ */
|
|
1764
|
+
}, label), /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1661
1765
|
classNames: "invisible group-hover:visible",
|
|
1662
1766
|
icon: "ph--arrow-square-out--regular"
|
|
1663
1767
|
}));
|
|
1664
1768
|
};
|
|
1665
|
-
|
|
1666
|
-
return /* @__PURE__ */ React18.createElement(CardIconBlock, null, /* @__PURE__ */ React18.createElement(Icon, {
|
|
1667
|
-
...props,
|
|
1668
|
-
size: toolbar ? 5 : 4
|
|
1669
|
-
}));
|
|
1670
|
-
};
|
|
1671
|
-
var CardIconBlock = ({ classNames, children, role, ...props }) => {
|
|
1672
|
-
const { tx } = useThemeContext();
|
|
1673
|
-
return /* @__PURE__ */ React18.createElement("div", {
|
|
1674
|
-
...props,
|
|
1675
|
-
role: role ?? "none",
|
|
1676
|
-
className: tx("card.icon-block", {}, classNames)
|
|
1677
|
-
}, children);
|
|
1678
|
-
};
|
|
1769
|
+
CardLink.displayName = CARD_LINK_NAME;
|
|
1679
1770
|
var Card = {
|
|
1680
1771
|
Root: CardRoot,
|
|
1681
1772
|
// Toolbar
|
|
1682
1773
|
Toolbar: CardToolbar,
|
|
1683
|
-
ToolbarIconButton:
|
|
1684
|
-
ToolbarSeparator:
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
})),
|
|
1690
|
-
CloseIconButton: Toolbar2.CloseIconButton,
|
|
1691
|
-
Title: CardTitle,
|
|
1774
|
+
ToolbarIconButton: Toolbar.IconButton,
|
|
1775
|
+
ToolbarSeparator: Toolbar.Separator,
|
|
1776
|
+
// Toolbar blocks
|
|
1777
|
+
IconBlock: CardIconBlock,
|
|
1778
|
+
DragHandle: CardDragHandle,
|
|
1779
|
+
CloseIconButton,
|
|
1692
1780
|
Menu: CardMenu,
|
|
1693
1781
|
Icon: CardIcon,
|
|
1694
|
-
|
|
1782
|
+
Title: CardTitle,
|
|
1695
1783
|
// Content
|
|
1696
1784
|
Content: CardContent,
|
|
1697
1785
|
Row: CardRow,
|
|
1698
1786
|
Section: CardSection,
|
|
1699
1787
|
Heading: CardHeading,
|
|
1700
1788
|
Text: CardText,
|
|
1789
|
+
Html: CardHtml,
|
|
1701
1790
|
Poster: CardPoster,
|
|
1702
1791
|
Action: CardAction,
|
|
1703
1792
|
Link: CardLink
|
|
1704
1793
|
};
|
|
1705
1794
|
|
|
1795
|
+
// src/components/Carousel/Carousel.tsx
|
|
1796
|
+
import { useArrowNavigationGroup } from "@fluentui/react-tabster";
|
|
1797
|
+
import React21, { createContext as createContext4, useCallback as useCallback5, useContext as useContext4, useEffect as useEffect3, useMemo as useMemo6, useState as useState4 } from "react";
|
|
1798
|
+
import { mx as mx8 } from "@dxos/ui-theme";
|
|
1799
|
+
|
|
1800
|
+
// src/components/MediaPlayer/MediaPlayer.tsx
|
|
1801
|
+
import React20 from "react";
|
|
1802
|
+
import { mx as mx7 } from "@dxos/ui-theme";
|
|
1803
|
+
var VIDEO_EXTENSIONS = [
|
|
1804
|
+
".mp4",
|
|
1805
|
+
".webm",
|
|
1806
|
+
".ogv",
|
|
1807
|
+
".mov",
|
|
1808
|
+
".m4v"
|
|
1809
|
+
];
|
|
1810
|
+
var AUDIO_EXTENSIONS = [
|
|
1811
|
+
".mp3",
|
|
1812
|
+
".wav",
|
|
1813
|
+
".ogg",
|
|
1814
|
+
".m4a",
|
|
1815
|
+
".aac",
|
|
1816
|
+
".flac"
|
|
1817
|
+
];
|
|
1818
|
+
var DEFAULT_IFRAME_SANDBOX = "allow-scripts allow-same-origin allow-presentation";
|
|
1819
|
+
var detectMediaKind = (src) => {
|
|
1820
|
+
const pathname = src.split(/[?#]/, 1)[0];
|
|
1821
|
+
const lower = pathname.toLowerCase();
|
|
1822
|
+
if (VIDEO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {
|
|
1823
|
+
return "video";
|
|
1824
|
+
}
|
|
1825
|
+
if (AUDIO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {
|
|
1826
|
+
return "audio";
|
|
1827
|
+
}
|
|
1828
|
+
return void 0;
|
|
1829
|
+
};
|
|
1830
|
+
var isEmbedUrl = (src) => detectMediaKind(src) !== void 0;
|
|
1831
|
+
var LEGACY_IFRAME_PATH_PATTERN = /\/iframe(?:[/?#]|$)/i;
|
|
1832
|
+
var isLegacyIframeUrl = (src) => {
|
|
1833
|
+
const pathAndQuery = src.split("#", 1)[0];
|
|
1834
|
+
return LEGACY_IFRAME_PATH_PATTERN.test(pathAndQuery);
|
|
1835
|
+
};
|
|
1836
|
+
var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, loop = false, muted = false, alt, crossOrigin = "anonymous", imgClassNames, mediaClassNames }) => {
|
|
1837
|
+
if (isEmbedUrl(src)) {
|
|
1838
|
+
const resolved = kind ?? detectMediaKind(src) ?? "video";
|
|
1839
|
+
if (resolved === "audio") {
|
|
1840
|
+
return /* @__PURE__ */ React20.createElement("audio", {
|
|
1841
|
+
className: mx7("w-full", classNames, mediaClassNames),
|
|
1842
|
+
src,
|
|
1843
|
+
controls,
|
|
1844
|
+
autoPlay,
|
|
1845
|
+
loop,
|
|
1846
|
+
muted,
|
|
1847
|
+
crossOrigin,
|
|
1848
|
+
"aria-label": alt
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
return /* @__PURE__ */ React20.createElement("video", {
|
|
1852
|
+
className: mx7("aspect-video max-w-full max-h-full", classNames, mediaClassNames),
|
|
1853
|
+
src,
|
|
1854
|
+
controls,
|
|
1855
|
+
autoPlay,
|
|
1856
|
+
loop,
|
|
1857
|
+
muted,
|
|
1858
|
+
crossOrigin,
|
|
1859
|
+
"aria-label": alt
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
if (isLegacyIframeUrl(src)) {
|
|
1863
|
+
return /* @__PURE__ */ React20.createElement("iframe", {
|
|
1864
|
+
src,
|
|
1865
|
+
title: alt ?? "Embedded media",
|
|
1866
|
+
loading: "lazy",
|
|
1867
|
+
className: mx7("border-none", classNames, mediaClassNames),
|
|
1868
|
+
sandbox: DEFAULT_IFRAME_SANDBOX,
|
|
1869
|
+
referrerPolicy: "no-referrer",
|
|
1870
|
+
allow: "accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",
|
|
1871
|
+
allowFullScreen: true
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
return /* @__PURE__ */ React20.createElement("img", {
|
|
1875
|
+
src,
|
|
1876
|
+
alt: alt ?? "",
|
|
1877
|
+
loading: "lazy",
|
|
1878
|
+
className: mx7(classNames, imgClassNames),
|
|
1879
|
+
onError: (event) => {
|
|
1880
|
+
event.currentTarget.style.display = "none";
|
|
1881
|
+
}
|
|
1882
|
+
});
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
// src/components/Carousel/Carousel.tsx
|
|
1886
|
+
var CarouselContext = /* @__PURE__ */ createContext4(null);
|
|
1887
|
+
var useCarousel = () => {
|
|
1888
|
+
const context = useContext4(CarouselContext);
|
|
1889
|
+
if (!context) {
|
|
1890
|
+
throw new Error("useCarousel must be used within Carousel.Root");
|
|
1891
|
+
}
|
|
1892
|
+
return context;
|
|
1893
|
+
};
|
|
1894
|
+
var CarouselRoot = ({ classNames, children, count, autorun = false, intervalMs = 5e3, defaultIndex = 0 }) => {
|
|
1895
|
+
const [index, setIndexState] = useState4(defaultIndex);
|
|
1896
|
+
const [autoAdvance, setAutoAdvance] = useState4(autorun);
|
|
1897
|
+
useEffect3(() => {
|
|
1898
|
+
if (index >= count) {
|
|
1899
|
+
setIndexState(0);
|
|
1900
|
+
}
|
|
1901
|
+
}, [
|
|
1902
|
+
count,
|
|
1903
|
+
index
|
|
1904
|
+
]);
|
|
1905
|
+
useEffect3(() => {
|
|
1906
|
+
if (!autoAdvance || count <= 1 || intervalMs <= 0) {
|
|
1907
|
+
return;
|
|
1908
|
+
}
|
|
1909
|
+
const handle = setInterval(() => setIndexState((i) => (i + 1) % count), intervalMs);
|
|
1910
|
+
return () => clearInterval(handle);
|
|
1911
|
+
}, [
|
|
1912
|
+
autoAdvance,
|
|
1913
|
+
count,
|
|
1914
|
+
intervalMs
|
|
1915
|
+
]);
|
|
1916
|
+
const setIndex = useCallback5((next2) => {
|
|
1917
|
+
setAutoAdvance(false);
|
|
1918
|
+
setIndexState(next2);
|
|
1919
|
+
}, []);
|
|
1920
|
+
const next = useCallback5(() => {
|
|
1921
|
+
setAutoAdvance(false);
|
|
1922
|
+
setIndexState((i) => (i + 1) % count);
|
|
1923
|
+
}, [
|
|
1924
|
+
count
|
|
1925
|
+
]);
|
|
1926
|
+
const prev = useCallback5(() => {
|
|
1927
|
+
setAutoAdvance(false);
|
|
1928
|
+
setIndexState((i) => (i - 1 + count) % count);
|
|
1929
|
+
}, [
|
|
1930
|
+
count
|
|
1931
|
+
]);
|
|
1932
|
+
const value = useMemo6(() => ({
|
|
1933
|
+
index,
|
|
1934
|
+
count,
|
|
1935
|
+
setIndex,
|
|
1936
|
+
next,
|
|
1937
|
+
prev
|
|
1938
|
+
}), [
|
|
1939
|
+
index,
|
|
1940
|
+
count,
|
|
1941
|
+
setIndex,
|
|
1942
|
+
next,
|
|
1943
|
+
prev
|
|
1944
|
+
]);
|
|
1945
|
+
if (count === 0) {
|
|
1946
|
+
return null;
|
|
1947
|
+
}
|
|
1948
|
+
return /* @__PURE__ */ React21.createElement(CarouselContext.Provider, {
|
|
1949
|
+
value
|
|
1950
|
+
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1951
|
+
className: mx8("w-full grid grid-cols-[min-content_1fr_min-content] grid-rows-[minmax(0,1fr)_auto] gap-4 items-center", classNames)
|
|
1952
|
+
}, children));
|
|
1953
|
+
};
|
|
1954
|
+
CarouselRoot.displayName = "Carousel.Root";
|
|
1955
|
+
var CarouselViewport = ({ children, classNames }) => {
|
|
1956
|
+
const { t } = useTranslation(translationKey);
|
|
1957
|
+
const { count, next, prev } = useCarousel();
|
|
1958
|
+
const handleKeyDown = useCallback5((event) => {
|
|
1959
|
+
if (count <= 1) {
|
|
1960
|
+
return;
|
|
1961
|
+
}
|
|
1962
|
+
if (event.key === "ArrowLeft") {
|
|
1963
|
+
event.preventDefault();
|
|
1964
|
+
prev();
|
|
1965
|
+
} else if (event.key === "ArrowRight") {
|
|
1966
|
+
event.preventDefault();
|
|
1967
|
+
next();
|
|
1968
|
+
}
|
|
1969
|
+
}, [
|
|
1970
|
+
count,
|
|
1971
|
+
next,
|
|
1972
|
+
prev
|
|
1973
|
+
]);
|
|
1974
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1975
|
+
// TODO(burdon): Move to ui-theme.
|
|
1976
|
+
className: mx8("relative w-full aspect-video overflow-hidden", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", classNames),
|
|
1977
|
+
tabIndex: 0,
|
|
1978
|
+
role: "region",
|
|
1979
|
+
"aria-roledescription": "carousel",
|
|
1980
|
+
"aria-label": t("carousel-viewport.label"),
|
|
1981
|
+
onKeyDown: handleKeyDown
|
|
1982
|
+
}, children);
|
|
1983
|
+
};
|
|
1984
|
+
CarouselViewport.displayName = "Carousel.Viewport";
|
|
1985
|
+
var CarouselSlide = ({ index, classNames, src, kind, alt, imgClassNames, mediaClassNames, controls, autoPlay, loop, muted, crossOrigin }) => {
|
|
1986
|
+
const { index: active } = useCarousel();
|
|
1987
|
+
if (active !== index) {
|
|
1988
|
+
return null;
|
|
1989
|
+
}
|
|
1990
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1991
|
+
className: mx8("absolute inset-0 w-full h-full bg-baseSurface", classNames)
|
|
1992
|
+
}, /* @__PURE__ */ React21.createElement(MediaPlayer, {
|
|
1993
|
+
src,
|
|
1994
|
+
kind,
|
|
1995
|
+
alt,
|
|
1996
|
+
classNames: "w-full h-full",
|
|
1997
|
+
imgClassNames: mx8("object-cover", imgClassNames),
|
|
1998
|
+
mediaClassNames,
|
|
1999
|
+
controls,
|
|
2000
|
+
autoPlay,
|
|
2001
|
+
loop,
|
|
2002
|
+
muted,
|
|
2003
|
+
crossOrigin
|
|
2004
|
+
}));
|
|
2005
|
+
};
|
|
2006
|
+
CarouselSlide.displayName = "Carousel.Slide";
|
|
2007
|
+
var CarouselPrevious = ({ classNames }) => {
|
|
2008
|
+
const { t } = useTranslation(translationKey);
|
|
2009
|
+
const { count, prev } = useCarousel();
|
|
2010
|
+
if (count <= 1) {
|
|
2011
|
+
return /* @__PURE__ */ React21.createElement("div", null);
|
|
2012
|
+
}
|
|
2013
|
+
return /* @__PURE__ */ React21.createElement(IconButton, {
|
|
2014
|
+
classNames: mx8("self-center", classNames),
|
|
2015
|
+
square: true,
|
|
2016
|
+
variant: "ghost",
|
|
2017
|
+
icon: "ph--caret-left--regular",
|
|
2018
|
+
iconOnly: true,
|
|
2019
|
+
label: t("carousel-prev.label"),
|
|
2020
|
+
onClick: prev
|
|
2021
|
+
});
|
|
2022
|
+
};
|
|
2023
|
+
CarouselPrevious.displayName = "Carousel.Previous";
|
|
2024
|
+
var CarouselNext = ({ classNames }) => {
|
|
2025
|
+
const { t } = useTranslation(translationKey);
|
|
2026
|
+
const { count, next } = useCarousel();
|
|
2027
|
+
if (count <= 1) {
|
|
2028
|
+
return /* @__PURE__ */ React21.createElement("div", null);
|
|
2029
|
+
}
|
|
2030
|
+
return /* @__PURE__ */ React21.createElement(IconButton, {
|
|
2031
|
+
classNames: mx8("self-center", classNames),
|
|
2032
|
+
square: true,
|
|
2033
|
+
variant: "ghost",
|
|
2034
|
+
icon: "ph--caret-right--regular",
|
|
2035
|
+
iconOnly: true,
|
|
2036
|
+
label: t("carousel-next.label"),
|
|
2037
|
+
onClick: next
|
|
2038
|
+
});
|
|
2039
|
+
};
|
|
2040
|
+
CarouselNext.displayName = "Carousel.Next";
|
|
2041
|
+
var CarouselIndicators = ({ classNames }) => {
|
|
2042
|
+
const { t } = useTranslation(translationKey);
|
|
2043
|
+
const { count, index, setIndex } = useCarousel();
|
|
2044
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
2045
|
+
axis: "horizontal",
|
|
2046
|
+
memorizeCurrent: true
|
|
2047
|
+
});
|
|
2048
|
+
if (count <= 1) {
|
|
2049
|
+
return null;
|
|
2050
|
+
}
|
|
2051
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
2052
|
+
className: "col-start-2 overflow-hidden"
|
|
2053
|
+
}, /* @__PURE__ */ React21.createElement("div", {
|
|
2054
|
+
...arrowNavigationAttrs,
|
|
2055
|
+
className: mx8("flex items-center justify-center", classNames),
|
|
2056
|
+
role: "tablist",
|
|
2057
|
+
"aria-label": t("carousel-indicators.label")
|
|
2058
|
+
}, Array.from({
|
|
2059
|
+
length: count
|
|
2060
|
+
}).map((_, i) => /* @__PURE__ */ React21.createElement(IconButton, {
|
|
2061
|
+
key: i,
|
|
2062
|
+
role: "tab",
|
|
2063
|
+
"aria-selected": i === index,
|
|
2064
|
+
classNames: i === index ? "text-primary-500" : "text-description",
|
|
2065
|
+
icon: i === index ? "ph--circle--fill" : "ph--circle--regular",
|
|
2066
|
+
iconOnly: true,
|
|
2067
|
+
label: t("carousel-go-to.label", {
|
|
2068
|
+
index: i + 1
|
|
2069
|
+
}),
|
|
2070
|
+
onClick: () => setIndex(i),
|
|
2071
|
+
onFocus: () => setIndex(i),
|
|
2072
|
+
size: 3,
|
|
2073
|
+
variant: "ghost"
|
|
2074
|
+
}))));
|
|
2075
|
+
};
|
|
2076
|
+
CarouselIndicators.displayName = "Carousel.Indicators";
|
|
2077
|
+
var CarouselCaption = ({ children, classNames }) => {
|
|
2078
|
+
const { index } = useCarousel();
|
|
2079
|
+
const content = children(index);
|
|
2080
|
+
if (content == null || content === false || content === "") {
|
|
2081
|
+
return null;
|
|
2082
|
+
}
|
|
2083
|
+
return (
|
|
2084
|
+
// TODO(burdon): Move to ui-theme.
|
|
2085
|
+
/* @__PURE__ */ React21.createElement("div", {
|
|
2086
|
+
className: "col-start-2"
|
|
2087
|
+
}, /* @__PURE__ */ React21.createElement("p", {
|
|
2088
|
+
className: mx8("text-center text-description", classNames)
|
|
2089
|
+
}, content))
|
|
2090
|
+
);
|
|
2091
|
+
};
|
|
2092
|
+
CarouselCaption.displayName = "Carousel.Caption";
|
|
2093
|
+
var Carousel = {
|
|
2094
|
+
Root: CarouselRoot,
|
|
2095
|
+
Viewport: CarouselViewport,
|
|
2096
|
+
Slide: CarouselSlide,
|
|
2097
|
+
Previous: CarouselPrevious,
|
|
2098
|
+
Next: CarouselNext,
|
|
2099
|
+
Indicators: CarouselIndicators,
|
|
2100
|
+
Caption: CarouselCaption
|
|
2101
|
+
};
|
|
2102
|
+
|
|
1706
2103
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1707
|
-
import
|
|
1708
|
-
var ClipboardContext = /* @__PURE__ */
|
|
2104
|
+
import React22, { createContext as createContext5, useCallback as useCallback6, useContext as useContext5, useState as useState5 } from "react";
|
|
2105
|
+
var ClipboardContext = /* @__PURE__ */ createContext5({
|
|
1709
2106
|
textValue: "",
|
|
1710
2107
|
setTextValue: async (_) => {
|
|
1711
2108
|
}
|
|
1712
2109
|
});
|
|
1713
|
-
var useClipboard = () =>
|
|
2110
|
+
var useClipboard = () => useContext5(ClipboardContext);
|
|
1714
2111
|
var ClipboardProvider = ({ children }) => {
|
|
1715
|
-
const [textValue, setInternalTextValue] =
|
|
1716
|
-
const setTextValue =
|
|
2112
|
+
const [textValue, setInternalTextValue] = useState5("");
|
|
2113
|
+
const setTextValue = useCallback6(async (nextValue) => {
|
|
1717
2114
|
await navigator.clipboard.writeText(nextValue);
|
|
1718
2115
|
return setInternalTextValue(nextValue);
|
|
1719
2116
|
}, []);
|
|
1720
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ React22.createElement(ClipboardContext.Provider, {
|
|
1721
2118
|
value: {
|
|
1722
2119
|
textValue,
|
|
1723
2120
|
setTextValue
|
|
@@ -1726,14 +2123,14 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1726
2123
|
};
|
|
1727
2124
|
|
|
1728
2125
|
// src/components/Clipboard/CopyButton.tsx
|
|
1729
|
-
import
|
|
1730
|
-
import { mx as
|
|
2126
|
+
import React23 from "react";
|
|
2127
|
+
import { mx as mx9, osTranslations } from "@dxos/ui-theme";
|
|
1731
2128
|
var inactiveLabelStyles = "invisible h-px -mb-px overflow-hidden";
|
|
1732
2129
|
var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
1733
2130
|
const { t } = useTranslation(osTranslations);
|
|
1734
2131
|
const { textValue, setTextValue } = useClipboard();
|
|
1735
2132
|
const isCopied = textValue === value;
|
|
1736
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ React23.createElement(Button, {
|
|
1737
2134
|
...props,
|
|
1738
2135
|
classNames: [
|
|
1739
2136
|
"inline-flex flex-col justify-center",
|
|
@@ -1741,20 +2138,18 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1741
2138
|
],
|
|
1742
2139
|
onClick: () => setTextValue(value),
|
|
1743
2140
|
"data-testid": "copy-invitation"
|
|
1744
|
-
}, /* @__PURE__ */
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
}, /* @__PURE__ */ React20.createElement("span", {
|
|
2141
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2142
|
+
className: mx9("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
2143
|
+
}, /* @__PURE__ */ React23.createElement("span", {
|
|
1748
2144
|
className: "px-1"
|
|
1749
|
-
}, t("copy
|
|
2145
|
+
}, t("copy.label")), /* @__PURE__ */ React23.createElement(Icon, {
|
|
1750
2146
|
icon: "ph--copy--regular",
|
|
1751
2147
|
size
|
|
1752
|
-
})), /* @__PURE__ */
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
}, /* @__PURE__ */ React20.createElement("span", {
|
|
2148
|
+
})), /* @__PURE__ */ React23.createElement("div", {
|
|
2149
|
+
className: mx9("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
2150
|
+
}, /* @__PURE__ */ React23.createElement("span", {
|
|
1756
2151
|
className: "px-1"
|
|
1757
|
-
}, t("copy
|
|
2152
|
+
}, t("copy-success.label")), /* @__PURE__ */ React23.createElement(Icon, {
|
|
1758
2153
|
icon: "ph--check--regular",
|
|
1759
2154
|
size
|
|
1760
2155
|
})));
|
|
@@ -1763,9 +2158,9 @@ var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ..
|
|
|
1763
2158
|
const { t } = useTranslation(osTranslations);
|
|
1764
2159
|
const { textValue, setTextValue } = useClipboard();
|
|
1765
2160
|
const isCopied = textValue === value;
|
|
1766
|
-
const label = isCopied ? t("copy
|
|
2161
|
+
const label = isCopied ? t("copy-success.label") : props.label ?? t("copy.label");
|
|
1767
2162
|
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1768
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ React23.createElement(IconButton, {
|
|
1769
2164
|
iconOnly: true,
|
|
1770
2165
|
label,
|
|
1771
2166
|
icon: "ph--copy--regular",
|
|
@@ -1788,89 +2183,92 @@ var Clipboard = {
|
|
|
1788
2183
|
};
|
|
1789
2184
|
|
|
1790
2185
|
// src/components/Dialog/Dialog.tsx
|
|
1791
|
-
import { createContext as
|
|
1792
|
-
import
|
|
1793
|
-
import
|
|
2186
|
+
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
2187
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2188
|
+
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
2189
|
+
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
2190
|
+
import React24, { forwardRef as forwardRef14 } from "react";
|
|
1794
2191
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1795
|
-
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
1796
|
-
var DialogRoot = (props) => /* @__PURE__ */
|
|
2192
|
+
import { composableProps as composableProps8, osTranslations as osTranslations2, slottable as slottable7 } from "@dxos/ui-theme";
|
|
2193
|
+
var DialogRoot = (props) => /* @__PURE__ */ React24.createElement(ElevationProvider, {
|
|
1797
2194
|
elevation: "dialog"
|
|
1798
|
-
}, /* @__PURE__ */
|
|
1799
|
-
|
|
1800
|
-
|
|
2195
|
+
}, /* @__PURE__ */ React24.createElement(DialogPrimitive.Root, {
|
|
2196
|
+
// NOTE: Radix warning unless set to undefined.
|
|
2197
|
+
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
2198
|
+
"aria-describedby": void 0,
|
|
2199
|
+
...props
|
|
2200
|
+
}));
|
|
2201
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2202
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
1801
2203
|
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1802
|
-
var [OverlayLayoutProvider, useOverlayLayoutContext] =
|
|
1803
|
-
var DialogOverlay = /* @__PURE__ */
|
|
2204
|
+
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext6(DIALOG_OVERLAY_NAME, {});
|
|
2205
|
+
var DialogOverlay = /* @__PURE__ */ forwardRef14(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1804
2206
|
const { tx } = useThemeContext();
|
|
1805
|
-
return /* @__PURE__ */
|
|
2207
|
+
return /* @__PURE__ */ React24.createElement(DialogPrimitive.Overlay, {
|
|
1806
2208
|
...props,
|
|
1807
2209
|
"data-block-align": blockAlign,
|
|
1808
2210
|
className: tx("dialog.overlay", {}, classNames),
|
|
1809
2211
|
ref: forwardedRef
|
|
1810
|
-
}, /* @__PURE__ */
|
|
2212
|
+
}, /* @__PURE__ */ React24.createElement(OverlayLayoutProvider, {
|
|
1811
2213
|
inOverlayLayout: true
|
|
1812
2214
|
}, children));
|
|
1813
2215
|
});
|
|
1814
2216
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1815
2217
|
var DIALOG_CONTENT_NAME = "DialogContent";
|
|
1816
|
-
var DialogContent = /* @__PURE__ */
|
|
2218
|
+
var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size = "md", inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1817
2219
|
const { tx } = useThemeContext();
|
|
1818
2220
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1819
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ React24.createElement(DialogPrimitive.Content, {
|
|
1820
2222
|
...props,
|
|
1821
2223
|
// NOTE: Radix warning unless set to undefined.
|
|
1822
2224
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1823
2225
|
"aria-describedby": void 0,
|
|
1824
2226
|
className: tx("dialog.content", {
|
|
1825
|
-
|
|
1826
|
-
|
|
2227
|
+
size,
|
|
2228
|
+
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1827
2229
|
}, classNames),
|
|
1828
2230
|
ref: forwardedRef
|
|
1829
|
-
}, /* @__PURE__ */
|
|
2231
|
+
}, /* @__PURE__ */ React24.createElement(Column.Root, {
|
|
2232
|
+
classNames: "dx-expander",
|
|
2233
|
+
gutter: "sm"
|
|
2234
|
+
}, children));
|
|
1830
2235
|
});
|
|
1831
2236
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1832
|
-
var DialogHeader =
|
|
2237
|
+
var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
2238
|
+
const { className, ...rest } = composableProps8(props);
|
|
2239
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1833
2240
|
const { tx } = useThemeContext();
|
|
1834
|
-
return /* @__PURE__ */
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
role: "heading",
|
|
1838
|
-
...props,
|
|
1839
|
-
className: tx("dialog.header", {
|
|
1840
|
-
srOnly
|
|
1841
|
-
}, [
|
|
1842
|
-
classNames
|
|
1843
|
-
]),
|
|
2241
|
+
return /* @__PURE__ */ React24.createElement(Comp, {
|
|
2242
|
+
...rest,
|
|
2243
|
+
className: tx("dialog.header", {}, className),
|
|
1844
2244
|
ref: forwardedRef
|
|
1845
|
-
})
|
|
2245
|
+
}, children);
|
|
1846
2246
|
});
|
|
1847
|
-
var DialogCloseIconButton = /* @__PURE__ */
|
|
2247
|
+
var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, forwardedRef) => {
|
|
1848
2248
|
const { t } = useTranslation3(osTranslations2);
|
|
1849
|
-
return /* @__PURE__ */
|
|
2249
|
+
return /* @__PURE__ */ React24.createElement(IconButton, {
|
|
1850
2250
|
...props,
|
|
1851
|
-
label: label ?? t("close
|
|
2251
|
+
label: label ?? t("close-dialog.label"),
|
|
1852
2252
|
icon: "ph--x--regular",
|
|
1853
2253
|
iconOnly: true,
|
|
1854
2254
|
size: 4,
|
|
1855
|
-
density: "fine",
|
|
1856
2255
|
variant: "ghost",
|
|
1857
2256
|
ref: forwardedRef
|
|
1858
2257
|
});
|
|
1859
2258
|
});
|
|
1860
|
-
var DialogBody =
|
|
2259
|
+
var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
2260
|
+
const { className, ...rest } = composableProps8(props);
|
|
2261
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1861
2262
|
const { tx } = useThemeContext();
|
|
1862
|
-
return /* @__PURE__ */
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
role: "none",
|
|
1866
|
-
...props,
|
|
1867
|
-
className: tx("dialog.body"),
|
|
2263
|
+
return /* @__PURE__ */ React24.createElement(Comp, {
|
|
2264
|
+
...rest,
|
|
2265
|
+
className: tx("dialog.body", {}, className),
|
|
1868
2266
|
ref: forwardedRef
|
|
1869
|
-
}, children)
|
|
2267
|
+
}, children);
|
|
1870
2268
|
});
|
|
1871
|
-
var DialogTitle = /* @__PURE__ */
|
|
2269
|
+
var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1872
2270
|
const { tx } = useThemeContext();
|
|
1873
|
-
return /* @__PURE__ */
|
|
2271
|
+
return /* @__PURE__ */ React24.createElement(DialogPrimitive.Title, {
|
|
1874
2272
|
...props,
|
|
1875
2273
|
className: tx("dialog.title", {
|
|
1876
2274
|
srOnly
|
|
@@ -1878,9 +2276,9 @@ var DialogTitle = /* @__PURE__ */ forwardRef16(({ classNames, srOnly, ...props }
|
|
|
1878
2276
|
ref: forwardedRef
|
|
1879
2277
|
});
|
|
1880
2278
|
});
|
|
1881
|
-
var DialogDescription = /* @__PURE__ */
|
|
2279
|
+
var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1882
2280
|
const { tx } = useThemeContext();
|
|
1883
|
-
return /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ React24.createElement(DialogPrimitive.Description, {
|
|
1884
2282
|
...props,
|
|
1885
2283
|
className: tx("dialog.description", {
|
|
1886
2284
|
srOnly
|
|
@@ -1888,17 +2286,17 @@ var DialogDescription = /* @__PURE__ */ forwardRef16(({ classNames, srOnly, ...p
|
|
|
1888
2286
|
ref: forwardedRef
|
|
1889
2287
|
});
|
|
1890
2288
|
});
|
|
1891
|
-
var DialogActionBar =
|
|
2289
|
+
var DialogActionBar = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
2290
|
+
const { className: classNames, ...rest } = composableProps8(props);
|
|
2291
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1892
2292
|
const { tx } = useThemeContext();
|
|
1893
|
-
return /* @__PURE__ */
|
|
1894
|
-
|
|
1895
|
-
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1896
|
-
...props,
|
|
2293
|
+
return /* @__PURE__ */ React24.createElement(Comp, {
|
|
2294
|
+
...rest,
|
|
1897
2295
|
className: tx("dialog.actionbar", {}, classNames),
|
|
1898
2296
|
ref: forwardedRef
|
|
1899
|
-
}, children)
|
|
2297
|
+
}, children);
|
|
1900
2298
|
});
|
|
1901
|
-
var DialogClose =
|
|
2299
|
+
var DialogClose = DialogPrimitive.Close;
|
|
1902
2300
|
var Dialog = {
|
|
1903
2301
|
Root: DialogRoot,
|
|
1904
2302
|
Trigger: DialogTrigger,
|
|
@@ -1915,109 +2313,86 @@ var Dialog = {
|
|
|
1915
2313
|
};
|
|
1916
2314
|
|
|
1917
2315
|
// src/components/Dialog/AlertDialog.tsx
|
|
1918
|
-
import
|
|
1919
|
-
import { createContext as
|
|
1920
|
-
import
|
|
1921
|
-
var AlertDialogRoot = (props) => /* @__PURE__ */
|
|
1922
|
-
elevation: "dialog"
|
|
1923
|
-
}, /* @__PURE__ */
|
|
1924
|
-
var AlertDialogTrigger =
|
|
1925
|
-
var AlertDialogPortal =
|
|
1926
|
-
var AlertDialogCancel =
|
|
1927
|
-
var AlertDialogAction =
|
|
1928
|
-
var AlertDialogTitle = /* @__PURE__ */ forwardRef17(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1929
|
-
const { tx } = useThemeContext();
|
|
1930
|
-
return /* @__PURE__ */ React22.createElement(AlertDialogTitlePrimitive, {
|
|
1931
|
-
...props,
|
|
1932
|
-
className: tx("dialog.title", {
|
|
1933
|
-
srOnly
|
|
1934
|
-
}, classNames),
|
|
1935
|
-
ref: forwardedRef
|
|
1936
|
-
});
|
|
1937
|
-
});
|
|
1938
|
-
var AlertDialogDescription = /* @__PURE__ */ forwardRef17(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1939
|
-
const { tx } = useThemeContext();
|
|
1940
|
-
return /* @__PURE__ */ React22.createElement(AlertDialogDescriptionPrimitive, {
|
|
1941
|
-
...props,
|
|
1942
|
-
className: tx("dialog.description", {
|
|
1943
|
-
srOnly
|
|
1944
|
-
}, classNames),
|
|
1945
|
-
ref: forwardedRef
|
|
1946
|
-
});
|
|
1947
|
-
});
|
|
2316
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2317
|
+
import { createContext as createContext7 } from "@radix-ui/react-context";
|
|
2318
|
+
import React25, { forwardRef as forwardRef15 } from "react";
|
|
2319
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React25.createElement(ElevationProvider, {
|
|
2320
|
+
elevation: "dialog"
|
|
2321
|
+
}, /* @__PURE__ */ React25.createElement(AlertDialogPrimitive.Root, props));
|
|
2322
|
+
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2323
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2324
|
+
var AlertDialogCancel = AlertDialogPrimitive.Cancel;
|
|
2325
|
+
var AlertDialogAction = AlertDialogPrimitive.Action;
|
|
1948
2326
|
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
1949
2327
|
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
1950
|
-
var
|
|
1951
|
-
var ALERT_DIALOG_ACTIONBAR_NAME = "AlertDialogActionBar";
|
|
1952
|
-
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext6(ALERT_DIALOG_OVERLAY_NAME, {
|
|
2328
|
+
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext7(ALERT_DIALOG_OVERLAY_NAME, {
|
|
1953
2329
|
inOverlayLayout: false
|
|
1954
2330
|
});
|
|
1955
|
-
var AlertDialogOverlay = /* @__PURE__ */
|
|
2331
|
+
var AlertDialogOverlay = /* @__PURE__ */ forwardRef15(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1956
2332
|
const { tx } = useThemeContext();
|
|
1957
|
-
return /* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ React25.createElement(AlertDialogPrimitive.Overlay, {
|
|
1958
2334
|
...props,
|
|
1959
2335
|
"data-block-align": blockAlign,
|
|
1960
|
-
className: tx(
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
classNames,
|
|
1964
|
-
// TODO(burdon): Move to dialog.ts.
|
|
1965
|
-
"data-[h-align=start]:justify-center",
|
|
1966
|
-
"data-[h-align=start]:items-start",
|
|
1967
|
-
"data-[h-align=center]:place-content-center"
|
|
1968
|
-
),
|
|
1969
|
-
ref: forwardedRef
|
|
1970
|
-
}, /* @__PURE__ */ React22.createElement(OverlayLayoutProvider2, {
|
|
2336
|
+
className: tx("dialog.overlay", {}, classNames),
|
|
2337
|
+
ref: forwardedRef
|
|
2338
|
+
}, /* @__PURE__ */ React25.createElement(OverlayLayoutProvider2, {
|
|
1971
2339
|
inOverlayLayout: true
|
|
1972
2340
|
}, children));
|
|
1973
2341
|
});
|
|
1974
2342
|
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
1975
|
-
var AlertDialogContent = /* @__PURE__ */
|
|
2343
|
+
var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, size = "md", ...props }, forwardedRef) => {
|
|
1976
2344
|
const { tx } = useThemeContext();
|
|
1977
2345
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
1978
|
-
return /* @__PURE__ */
|
|
2346
|
+
return /* @__PURE__ */ React25.createElement(AlertDialogPrimitive.Content, {
|
|
1979
2347
|
...props,
|
|
1980
2348
|
className: tx("dialog.content", {
|
|
1981
2349
|
inOverlayLayout,
|
|
1982
2350
|
size
|
|
1983
2351
|
}, classNames),
|
|
2352
|
+
// NOTE: Radix warning unless set to undefined.
|
|
2353
|
+
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
2354
|
+
"aria-describedby": void 0,
|
|
1984
2355
|
ref: forwardedRef
|
|
1985
|
-
}, /* @__PURE__ */
|
|
2356
|
+
}, /* @__PURE__ */ React25.createElement(Column.Root, {
|
|
2357
|
+
classNames: "dx-expander",
|
|
2358
|
+
gutter: "sm"
|
|
2359
|
+
}, children));
|
|
1986
2360
|
});
|
|
1987
2361
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
1988
|
-
var
|
|
2362
|
+
var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1989
2363
|
const { tx } = useThemeContext();
|
|
1990
|
-
return /* @__PURE__ */
|
|
1991
|
-
asChild: true
|
|
1992
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1993
|
-
role: "none",
|
|
2364
|
+
return /* @__PURE__ */ React25.createElement(AlertDialogPrimitive.Title, {
|
|
1994
2365
|
...props,
|
|
1995
|
-
className: tx("dialog.
|
|
2366
|
+
className: tx("dialog.title", {
|
|
2367
|
+
srOnly
|
|
2368
|
+
}, classNames),
|
|
1996
2369
|
ref: forwardedRef
|
|
1997
|
-
}
|
|
2370
|
+
});
|
|
1998
2371
|
});
|
|
1999
|
-
|
|
2000
|
-
var AlertDialogActionBar = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
2372
|
+
var AlertDialogDescription = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2001
2373
|
const { tx } = useThemeContext();
|
|
2002
|
-
return /* @__PURE__ */
|
|
2003
|
-
asChild: true
|
|
2004
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
2374
|
+
return /* @__PURE__ */ React25.createElement(AlertDialogPrimitive.Description, {
|
|
2005
2375
|
...props,
|
|
2006
|
-
className: tx("dialog.
|
|
2376
|
+
className: tx("dialog.description", {
|
|
2377
|
+
srOnly
|
|
2378
|
+
}, classNames),
|
|
2007
2379
|
ref: forwardedRef
|
|
2008
|
-
}
|
|
2380
|
+
});
|
|
2009
2381
|
});
|
|
2010
|
-
AlertDialogActionBar.displayName = ALERT_DIALOG_ACTIONBAR_NAME;
|
|
2011
2382
|
var AlertDialog = {
|
|
2012
2383
|
Root: AlertDialogRoot,
|
|
2013
2384
|
Trigger: AlertDialogTrigger,
|
|
2014
2385
|
Portal: AlertDialogPortal,
|
|
2015
2386
|
Overlay: AlertDialogOverlay,
|
|
2016
2387
|
Content: AlertDialogContent,
|
|
2017
|
-
|
|
2388
|
+
// Shared with Dialog.
|
|
2389
|
+
Header: Dialog.Header,
|
|
2390
|
+
Body: Dialog.Body,
|
|
2018
2391
|
Title: AlertDialogTitle,
|
|
2019
2392
|
Description: AlertDialogDescription,
|
|
2020
|
-
ActionBar:
|
|
2393
|
+
ActionBar: Dialog.ActionBar,
|
|
2394
|
+
CloseIconButton: Dialog.CloseIconButton,
|
|
2395
|
+
// AlertDialog-specific dismissal.
|
|
2021
2396
|
Cancel: AlertDialogCancel,
|
|
2022
2397
|
Action: AlertDialogAction
|
|
2023
2398
|
};
|
|
@@ -2026,103 +2401,52 @@ var AlertDialog = {
|
|
|
2026
2401
|
import { ErrorBoundary } from "@dxos/react-error-boundary";
|
|
2027
2402
|
|
|
2028
2403
|
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2029
|
-
import
|
|
2404
|
+
import React26 from "react";
|
|
2030
2405
|
import { safeStringify } from "@dxos/util";
|
|
2031
|
-
|
|
2032
|
-
// src/components/ErrorFallback/ErrorStack.tsx
|
|
2033
|
-
import ErrorStackParser from "error-stack-parser";
|
|
2034
|
-
import React23 from "react";
|
|
2035
|
-
import { mx as mx7 } from "@dxos/ui-theme";
|
|
2036
|
-
var ErrorStack = ({ error }) => {
|
|
2037
|
-
const frames = ErrorStackParser.parse(error);
|
|
2038
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
2039
|
-
className: "font-mono text-sm"
|
|
2040
|
-
}, frames.map((frame, i) => {
|
|
2041
|
-
const isLast = i === frames.length - 1;
|
|
2042
|
-
const local = frame.fileName ? parseLocalFrame(frame.fileName, frame.lineNumber, frame.columnNumber) : void 0;
|
|
2043
|
-
const name = frame.functionName ?? "<anonymous>";
|
|
2044
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
2045
|
-
key: i,
|
|
2046
|
-
className: mx7("grid grid-cols-[16px_1fr_auto_auto] items-stretch gap-x-2", local && "cursor-pointer hover:bg-hover-surface")
|
|
2047
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2048
|
-
className: "relative"
|
|
2049
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2050
|
-
className: mx7("absolute left-1/2 -translate-x-1/2 w-px bg-neutral-500", isLast ? "top-0 h-1/2" : "inset-y-0")
|
|
2051
|
-
}), /* @__PURE__ */ React23.createElement("div", {
|
|
2052
|
-
className: "absolute top-1/2 -translate-y-1/2 left-1/2 right-0 h-px bg-neutral-500"
|
|
2053
|
-
})), local ? /* @__PURE__ */ React23.createElement("a", {
|
|
2054
|
-
href: local.href,
|
|
2055
|
-
className: "truncate self-center"
|
|
2056
|
-
}, name) : /* @__PURE__ */ React23.createElement("span", {
|
|
2057
|
-
className: "text-subdued truncate self-center"
|
|
2058
|
-
}, name), /* @__PURE__ */ React23.createElement("span", {
|
|
2059
|
-
className: "text-xs text-subdued truncate self-center"
|
|
2060
|
-
}, local?.fileName ?? ""), /* @__PURE__ */ React23.createElement("span", {
|
|
2061
|
-
className: "text-xs text-subdued text-right self-center"
|
|
2062
|
-
}, local ? `${frame.lineNumber}:${frame.columnNumber}` : ""));
|
|
2063
|
-
}));
|
|
2064
|
-
};
|
|
2065
|
-
var parseLocalFrame = (fileUrl, line, col) => {
|
|
2066
|
-
try {
|
|
2067
|
-
const { pathname } = new URL(fileUrl);
|
|
2068
|
-
if (!pathname.startsWith("/@fs/")) {
|
|
2069
|
-
return void 0;
|
|
2070
|
-
}
|
|
2071
|
-
const localPath = pathname.slice(4);
|
|
2072
|
-
return {
|
|
2073
|
-
href: `vscode://file/${localPath}:${line ?? 1}:${col ?? 1}`,
|
|
2074
|
-
fileName: pathname.split("/").pop() ?? localPath
|
|
2075
|
-
};
|
|
2076
|
-
} catch {
|
|
2077
|
-
return void 0;
|
|
2078
|
-
}
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
|
-
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2082
2406
|
var ErrorFallback = ({ children, error, title, data }) => {
|
|
2083
2407
|
const isDev = process.env.NODE_ENV === "development";
|
|
2084
2408
|
const message = error instanceof Error ? error.message : String(error);
|
|
2085
|
-
return /* @__PURE__ */
|
|
2409
|
+
return /* @__PURE__ */ React26.createElement("div", {
|
|
2086
2410
|
role: "alert",
|
|
2087
2411
|
"data-testid": "error-boundary-fallback",
|
|
2088
2412
|
className: "flex flex-col p-4 gap-4 overflow-auto"
|
|
2089
|
-
}, /* @__PURE__ */
|
|
2413
|
+
}, /* @__PURE__ */ React26.createElement("h1", {
|
|
2090
2414
|
className: "text-lg text-info-text"
|
|
2091
|
-
}, title ?? "Runtime Error"), /* @__PURE__ */
|
|
2415
|
+
}, title ?? "Runtime Error"), /* @__PURE__ */ React26.createElement("p", null, message), isDev && error instanceof Error && /* @__PURE__ */ React26.createElement(Section, {
|
|
2092
2416
|
title: "Stack",
|
|
2093
2417
|
onClick: () => {
|
|
2094
2418
|
const text = error instanceof Error ? error.stack ?? error.message : String(error);
|
|
2095
2419
|
void navigator.clipboard.writeText(text);
|
|
2096
2420
|
}
|
|
2097
|
-
}, /* @__PURE__ */
|
|
2421
|
+
}, /* @__PURE__ */ React26.createElement(ErrorStack, {
|
|
2098
2422
|
error
|
|
2099
|
-
})), data && /* @__PURE__ */
|
|
2423
|
+
})), data && /* @__PURE__ */ React26.createElement(Section, {
|
|
2100
2424
|
title: "Data",
|
|
2101
2425
|
onClick: () => {
|
|
2102
2426
|
void navigator.clipboard.writeText(JSON.stringify(data, void 0, 2));
|
|
2103
2427
|
}
|
|
2104
|
-
}, /* @__PURE__ */
|
|
2428
|
+
}, /* @__PURE__ */ React26.createElement("pre", {
|
|
2105
2429
|
className: "overflow-x-auto text-xs"
|
|
2106
2430
|
}, safeStringify(data, void 0, 2))), children);
|
|
2107
2431
|
};
|
|
2108
2432
|
var Section = ({ children, title, onClick }) => {
|
|
2109
|
-
return /* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ React26.createElement("div", {
|
|
2110
2434
|
className: "flex flex-col gap-1"
|
|
2111
|
-
}, onClick && /* @__PURE__ */
|
|
2435
|
+
}, onClick && /* @__PURE__ */ React26.createElement("button", {
|
|
2112
2436
|
type: "button",
|
|
2113
2437
|
onClick,
|
|
2114
2438
|
className: "flex items-center gap-1 text-xs text-subdued hover:text-primary-500 transition-colors",
|
|
2115
2439
|
title: `Copy ${title}`
|
|
2116
|
-
}, /* @__PURE__ */
|
|
2440
|
+
}, /* @__PURE__ */ React26.createElement("h2", {
|
|
2117
2441
|
className: "text-xs uppercase text-subdued"
|
|
2118
2442
|
}, title)), children);
|
|
2119
2443
|
};
|
|
2120
2444
|
|
|
2121
2445
|
// src/components/ErrorFallback/ThrowError.tsx
|
|
2122
|
-
import { useEffect as
|
|
2446
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
2123
2447
|
var ThrowError = ({ delay = 1e3, ...props }) => {
|
|
2124
|
-
const [error, setError] =
|
|
2125
|
-
|
|
2448
|
+
const [error, setError] = useState6();
|
|
2449
|
+
useEffect4(() => {
|
|
2126
2450
|
if (delay < 0) {
|
|
2127
2451
|
return;
|
|
2128
2452
|
}
|
|
@@ -2146,15 +2470,124 @@ var generator = ({ error, delay }) => {
|
|
|
2146
2470
|
return error?.() ?? new Error(`Error generated after ${delay}ms`);
|
|
2147
2471
|
};
|
|
2148
2472
|
|
|
2473
|
+
// src/components/Focus/Focus.tsx
|
|
2474
|
+
import { useArrowNavigationGroup as useArrowNavigationGroup2, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2475
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2476
|
+
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
2477
|
+
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2478
|
+
import React27, { createContext as createContext8, useCallback as useCallback7, useContext as useContext6, useRef as useRef3, useState as useState7 } from "react";
|
|
2479
|
+
import { composableProps as composableProps9, slottable as slottable8 } from "@dxos/ui-theme";
|
|
2480
|
+
var FOCUS_STATE_ATTR = "focus-state";
|
|
2481
|
+
var FocusContext = /* @__PURE__ */ createContext8({});
|
|
2482
|
+
var useFocus = () => useContext6(FocusContext);
|
|
2483
|
+
var Group3 = slottable8(({ children, asChild, orientation = "vertical", border = false, ...props }, forwardedRef) => {
|
|
2484
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2485
|
+
const { tx } = useThemeContext();
|
|
2486
|
+
const rootRef = useRef3(null);
|
|
2487
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2488
|
+
tabBehavior: "limited-trap-focus"
|
|
2489
|
+
});
|
|
2490
|
+
const arrowNavigationAttrs = useArrowNavigationGroup2({
|
|
2491
|
+
axis: orientation,
|
|
2492
|
+
memorizeCurrent: true
|
|
2493
|
+
});
|
|
2494
|
+
const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);
|
|
2495
|
+
const [state, setState] = useState7();
|
|
2496
|
+
const [groupHasFocus, setGroupHasFocus] = useState7(false);
|
|
2497
|
+
const handleFocusIn = useCallback7(() => setGroupHasFocus(true), []);
|
|
2498
|
+
const handleFocusOut = useCallback7((event) => {
|
|
2499
|
+
const related = event.relatedTarget;
|
|
2500
|
+
if (!related || !rootRef.current?.contains(related)) {
|
|
2501
|
+
setGroupHasFocus(false);
|
|
2502
|
+
}
|
|
2503
|
+
}, []);
|
|
2504
|
+
const { className, ...rest } = composableProps9(props);
|
|
2505
|
+
return /* @__PURE__ */ React27.createElement(FocusContext.Provider, {
|
|
2506
|
+
value: {
|
|
2507
|
+
setFocus: setState,
|
|
2508
|
+
groupHasFocus
|
|
2509
|
+
}
|
|
2510
|
+
}, /* @__PURE__ */ React27.createElement(Comp, {
|
|
2511
|
+
...rest,
|
|
2512
|
+
tabIndex: 0,
|
|
2513
|
+
className: tx("focus.group", {
|
|
2514
|
+
border
|
|
2515
|
+
}, className),
|
|
2516
|
+
...tabsterAttrs,
|
|
2517
|
+
...state && {
|
|
2518
|
+
[`data-${FOCUS_STATE_ATTR}`]: state
|
|
2519
|
+
},
|
|
2520
|
+
onBlur: handleFocusOut,
|
|
2521
|
+
onFocus: handleFocusIn,
|
|
2522
|
+
ref: useComposedRefs(rootRef, forwardedRef)
|
|
2523
|
+
}, children));
|
|
2524
|
+
});
|
|
2525
|
+
var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentChange, onClick, onFocus, onBlur, ...props }, forwardedRef) => {
|
|
2526
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2527
|
+
const { tx } = useThemeContext();
|
|
2528
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2529
|
+
ignoreDefaultKeydown: {
|
|
2530
|
+
Enter: true
|
|
2531
|
+
}
|
|
2532
|
+
});
|
|
2533
|
+
const [focused, setFocused] = useState7(false);
|
|
2534
|
+
const handleClick = useCallback7((event) => {
|
|
2535
|
+
onCurrentChange?.();
|
|
2536
|
+
onClick?.(event);
|
|
2537
|
+
}, [
|
|
2538
|
+
onCurrentChange,
|
|
2539
|
+
onClick
|
|
2540
|
+
]);
|
|
2541
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2542
|
+
if (event.key === "Enter") {
|
|
2543
|
+
onCurrentChange?.();
|
|
2544
|
+
}
|
|
2545
|
+
}, [
|
|
2546
|
+
onCurrentChange
|
|
2547
|
+
]);
|
|
2548
|
+
const handleFocus = useCallback7((event) => {
|
|
2549
|
+
setFocused(true);
|
|
2550
|
+
onFocus?.(event);
|
|
2551
|
+
}, [
|
|
2552
|
+
onFocus
|
|
2553
|
+
]);
|
|
2554
|
+
const handleBlur = useCallback7((event) => {
|
|
2555
|
+
setFocused(false);
|
|
2556
|
+
onBlur?.(event);
|
|
2557
|
+
}, [
|
|
2558
|
+
onBlur
|
|
2559
|
+
]);
|
|
2560
|
+
const isCurrent = current ?? focused;
|
|
2561
|
+
const { className, ...rest } = composableProps9(props);
|
|
2562
|
+
return /* @__PURE__ */ React27.createElement(Comp, {
|
|
2563
|
+
...rest,
|
|
2564
|
+
tabIndex: 0,
|
|
2565
|
+
className: tx("focus.item", {
|
|
2566
|
+
border
|
|
2567
|
+
}, className),
|
|
2568
|
+
...focusableGroupAttrs,
|
|
2569
|
+
"aria-current": isCurrent || void 0,
|
|
2570
|
+
onClick: handleClick,
|
|
2571
|
+
onKeyDown: handleKeyDown,
|
|
2572
|
+
onFocus: handleFocus,
|
|
2573
|
+
onBlur: handleBlur,
|
|
2574
|
+
ref: forwardedRef
|
|
2575
|
+
}, children);
|
|
2576
|
+
});
|
|
2577
|
+
var Focus = {
|
|
2578
|
+
Group: Group3,
|
|
2579
|
+
Item: Item4
|
|
2580
|
+
};
|
|
2581
|
+
|
|
2149
2582
|
// src/components/Input/Input.tsx
|
|
2150
|
-
import
|
|
2583
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2151
2584
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
2152
|
-
import
|
|
2585
|
+
import React28, { forwardRef as forwardRef16 } from "react";
|
|
2153
2586
|
import { DescriptionAndValidation as DescriptionAndValidationPrimitive, Description as DescriptionPrimitive, INPUT_NAME, InputRoot, Label as LabelPrimitive, PinInput as PinInputPrimitive, TextArea as TextAreaPrimitive, TextInput as TextInputPrimitive, Validation as ValidationPrimitive, useInputContext } from "@dxos/react-input";
|
|
2154
|
-
import { mx as
|
|
2155
|
-
var Label3 = /* @__PURE__ */
|
|
2587
|
+
import { mx as mx10 } from "@dxos/ui-theme";
|
|
2588
|
+
var Label3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2156
2589
|
const { tx } = useThemeContext();
|
|
2157
|
-
return /* @__PURE__ */
|
|
2590
|
+
return /* @__PURE__ */ React28.createElement(LabelPrimitive, {
|
|
2158
2591
|
...props,
|
|
2159
2592
|
className: tx("input.label", {
|
|
2160
2593
|
srOnly
|
|
@@ -2162,9 +2595,9 @@ var Label3 = /* @__PURE__ */ forwardRef18(({ classNames, children, srOnly, ...pr
|
|
|
2162
2595
|
ref: forwardedRef
|
|
2163
2596
|
}, children);
|
|
2164
2597
|
});
|
|
2165
|
-
var
|
|
2598
|
+
var Description3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2166
2599
|
const { tx } = useThemeContext();
|
|
2167
|
-
return /* @__PURE__ */
|
|
2600
|
+
return /* @__PURE__ */ React28.createElement(DescriptionPrimitive, {
|
|
2168
2601
|
...props,
|
|
2169
2602
|
className: tx("input.description", {
|
|
2170
2603
|
srOnly
|
|
@@ -2172,10 +2605,10 @@ var Description = /* @__PURE__ */ forwardRef18(({ classNames, children, srOnly,
|
|
|
2172
2605
|
ref: forwardedRef
|
|
2173
2606
|
}, children);
|
|
2174
2607
|
});
|
|
2175
|
-
var Validation = /* @__PURE__ */
|
|
2608
|
+
var Validation = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2176
2609
|
const { tx } = useThemeContext();
|
|
2177
2610
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2178
|
-
return /* @__PURE__ */
|
|
2611
|
+
return /* @__PURE__ */ React28.createElement(ValidationPrimitive, {
|
|
2179
2612
|
...props,
|
|
2180
2613
|
className: tx("input.validation", {
|
|
2181
2614
|
srOnly,
|
|
@@ -2184,9 +2617,9 @@ var Validation = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, child
|
|
|
2184
2617
|
ref: forwardedRef
|
|
2185
2618
|
}, children);
|
|
2186
2619
|
});
|
|
2187
|
-
var DescriptionAndValidation = /* @__PURE__ */
|
|
2620
|
+
var DescriptionAndValidation = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2188
2621
|
const { tx } = useThemeContext();
|
|
2189
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ React28.createElement(DescriptionAndValidationPrimitive, {
|
|
2190
2623
|
...props,
|
|
2191
2624
|
className: tx("input.descriptionAndValidation", {
|
|
2192
2625
|
srOnly
|
|
@@ -2194,12 +2627,12 @@ var DescriptionAndValidation = /* @__PURE__ */ forwardRef18(({ classNames, child
|
|
|
2194
2627
|
ref: forwardedRef
|
|
2195
2628
|
}, children);
|
|
2196
2629
|
});
|
|
2197
|
-
var PinInput = /* @__PURE__ */
|
|
2630
|
+
var PinInput = /* @__PURE__ */ forwardRef16(({ classNames, density: propsDensity, elevation: propsElevation, ...props }, forwardedRef) => {
|
|
2198
2631
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2199
2632
|
const { tx } = useThemeContext();
|
|
2200
2633
|
const density = useDensityContext(propsDensity);
|
|
2201
2634
|
const elevation = useElevationContext(propsElevation);
|
|
2202
|
-
return /* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ React28.createElement(PinInputPrimitive, {
|
|
2203
2636
|
...props,
|
|
2204
2637
|
...props.autoFocus && !hasIosKeyboard2 && {
|
|
2205
2638
|
autoFocus: true
|
|
@@ -2215,13 +2648,13 @@ var PinInput = /* @__PURE__ */ forwardRef18(({ classNames, density: propsDensity
|
|
|
2215
2648
|
ref: forwardedRef
|
|
2216
2649
|
});
|
|
2217
2650
|
});
|
|
2218
|
-
var TextInput = /* @__PURE__ */
|
|
2651
|
+
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props }, forwardedRef) => {
|
|
2219
2652
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2220
2653
|
const { tx } = useThemeContext();
|
|
2221
|
-
const density = useDensityContext(
|
|
2222
|
-
const elevation = useElevationContext(
|
|
2654
|
+
const density = useDensityContext(densityProp);
|
|
2655
|
+
const elevation = useElevationContext(elevationProp);
|
|
2223
2656
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2224
|
-
return /* @__PURE__ */
|
|
2657
|
+
return /* @__PURE__ */ React28.createElement(TextInputPrimitive, {
|
|
2225
2658
|
...props,
|
|
2226
2659
|
"data-1p-ignore": noAutoFill,
|
|
2227
2660
|
className: tx("input.input", {
|
|
@@ -2237,13 +2670,13 @@ var TextInput = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, densit
|
|
|
2237
2670
|
ref: forwardedRef
|
|
2238
2671
|
});
|
|
2239
2672
|
});
|
|
2240
|
-
var TextArea = /* @__PURE__ */
|
|
2673
|
+
var TextArea = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
2241
2674
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2242
2675
|
const { tx } = useThemeContext();
|
|
2243
2676
|
const density = useDensityContext(propsDensity);
|
|
2244
2677
|
const elevation = useElevationContext(propsElevation);
|
|
2245
2678
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2246
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ React28.createElement(TextAreaPrimitive, {
|
|
2247
2680
|
...props,
|
|
2248
2681
|
className: tx("input.textArea", {
|
|
2249
2682
|
variant,
|
|
@@ -2258,7 +2691,7 @@ var TextArea = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, density
|
|
|
2258
2691
|
ref: forwardedRef
|
|
2259
2692
|
});
|
|
2260
2693
|
});
|
|
2261
|
-
var Checkbox = /* @__PURE__ */
|
|
2694
|
+
var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, ...props }, forwardedRef) => {
|
|
2262
2695
|
const [checked, onCheckedChange] = useControllableState2({
|
|
2263
2696
|
prop: propsChecked,
|
|
2264
2697
|
defaultProp: propsDefaultChecked,
|
|
@@ -2266,7 +2699,7 @@ var Checkbox = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, checked
|
|
|
2266
2699
|
});
|
|
2267
2700
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2268
2701
|
const { tx } = useThemeContext();
|
|
2269
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ React28.createElement(CheckboxPrimitive.Root, {
|
|
2270
2703
|
...props,
|
|
2271
2704
|
checked,
|
|
2272
2705
|
onCheckedChange,
|
|
@@ -2280,7 +2713,7 @@ var Checkbox = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, checked
|
|
|
2280
2713
|
size
|
|
2281
2714
|
}, "shrink-0", classNames),
|
|
2282
2715
|
ref: forwardedRef
|
|
2283
|
-
}, /* @__PURE__ */
|
|
2716
|
+
}, /* @__PURE__ */ React28.createElement(Icon, {
|
|
2284
2717
|
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
2285
2718
|
classNames: tx("input.checkboxIndicator", {
|
|
2286
2719
|
size,
|
|
@@ -2288,16 +2721,16 @@ var Checkbox = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, checked
|
|
|
2288
2721
|
})
|
|
2289
2722
|
}));
|
|
2290
2723
|
});
|
|
2291
|
-
var Switch = /* @__PURE__ */
|
|
2724
|
+
var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, ...props }, forwardedRef) => {
|
|
2292
2725
|
const [checked, onCheckedChange] = useControllableState2({
|
|
2293
2726
|
prop: propsChecked,
|
|
2294
2727
|
defaultProp: propsDefaultChecked ?? false,
|
|
2295
2728
|
onChange: propsOnCheckedChange
|
|
2296
2729
|
});
|
|
2297
2730
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2298
|
-
return /* @__PURE__ */
|
|
2731
|
+
return /* @__PURE__ */ React28.createElement("input", {
|
|
2299
2732
|
type: "checkbox",
|
|
2300
|
-
className:
|
|
2733
|
+
className: mx10("dx-checkbox--switch dx-focus-ring", classNames),
|
|
2301
2734
|
checked,
|
|
2302
2735
|
onChange: (event) => {
|
|
2303
2736
|
onCheckedChange(event.target.checked);
|
|
@@ -2320,19 +2753,20 @@ var Input = {
|
|
|
2320
2753
|
Checkbox,
|
|
2321
2754
|
Switch,
|
|
2322
2755
|
Label: Label3,
|
|
2323
|
-
Description,
|
|
2756
|
+
Description: Description3,
|
|
2324
2757
|
Validation,
|
|
2325
2758
|
DescriptionAndValidation
|
|
2326
2759
|
};
|
|
2327
2760
|
|
|
2328
2761
|
// src/components/List/List.tsx
|
|
2329
|
-
import { Primitive as
|
|
2330
|
-
import { Slot as
|
|
2331
|
-
import
|
|
2762
|
+
import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
|
|
2763
|
+
import { Slot as Slot15 } from "@radix-ui/react-slot";
|
|
2764
|
+
import React30, { forwardRef as forwardRef17 } from "react";
|
|
2332
2765
|
import { LIST_ITEM_NAME, LIST_NAME, ListItemCollapsibleContent, List as ListPrimitive, ListItem as ListPrimitiveItem, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, useListContext, useListItemContext } from "@dxos/react-list";
|
|
2766
|
+
import { composable as composable4, composableProps as composableProps10 } from "@dxos/ui-theme";
|
|
2333
2767
|
|
|
2334
2768
|
// src/components/List/ListDropIndicator.tsx
|
|
2335
|
-
import
|
|
2769
|
+
import React29 from "react";
|
|
2336
2770
|
var edgeToOrientationMap = {
|
|
2337
2771
|
top: "horizontal",
|
|
2338
2772
|
bottom: "horizontal",
|
|
@@ -2354,8 +2788,7 @@ var terminalSize = 8;
|
|
|
2354
2788
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
2355
2789
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2356
2790
|
const orientation = edgeToOrientationMap[edge];
|
|
2357
|
-
return /* @__PURE__ */
|
|
2358
|
-
role: "none",
|
|
2791
|
+
return /* @__PURE__ */ React29.createElement("div", {
|
|
2359
2792
|
style: {
|
|
2360
2793
|
"--line-thickness": `${strokeSize}px`,
|
|
2361
2794
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -2370,22 +2803,23 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
2370
2803
|
};
|
|
2371
2804
|
|
|
2372
2805
|
// src/components/List/List.tsx
|
|
2373
|
-
var List =
|
|
2806
|
+
var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
2374
2807
|
const { tx } = useThemeContext();
|
|
2375
2808
|
const density = useDensityContext(props.density);
|
|
2376
|
-
|
|
2809
|
+
const { className, ...rest } = composableProps10(props);
|
|
2810
|
+
return /* @__PURE__ */ React30.createElement(DensityProvider, {
|
|
2377
2811
|
density
|
|
2378
|
-
}, /* @__PURE__ */
|
|
2379
|
-
...
|
|
2380
|
-
className: tx("list.root", {},
|
|
2812
|
+
}, /* @__PURE__ */ React30.createElement(ListPrimitive, {
|
|
2813
|
+
...rest,
|
|
2814
|
+
className: tx("list.root", {}, className),
|
|
2381
2815
|
ref: forwardedRef
|
|
2382
2816
|
}, children));
|
|
2383
2817
|
});
|
|
2384
|
-
var ListItemEndcap = /* @__PURE__ */
|
|
2385
|
-
const Comp = asChild ?
|
|
2818
|
+
var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2819
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
2386
2820
|
const density = useDensityContext();
|
|
2387
2821
|
const { tx } = useThemeContext();
|
|
2388
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ React30.createElement(Comp, {
|
|
2389
2823
|
...!asChild && {
|
|
2390
2824
|
role: "none"
|
|
2391
2825
|
},
|
|
@@ -2399,45 +2833,44 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef19(({ children, classNames, asChi
|
|
|
2399
2833
|
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
2400
2834
|
const density = useDensityContext();
|
|
2401
2835
|
const { tx } = useThemeContext();
|
|
2402
|
-
return /* @__PURE__ */
|
|
2403
|
-
role: "none",
|
|
2836
|
+
return /* @__PURE__ */ React30.createElement("div", {
|
|
2404
2837
|
...props,
|
|
2405
2838
|
className: tx("list.item.openTrigger", {
|
|
2406
2839
|
density
|
|
2407
2840
|
}, classNames)
|
|
2408
2841
|
});
|
|
2409
2842
|
};
|
|
2410
|
-
var ListItemHeading = /* @__PURE__ */
|
|
2843
|
+
var ListItemHeading = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
2411
2844
|
const { tx } = useThemeContext();
|
|
2412
2845
|
const density = useDensityContext();
|
|
2413
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React30.createElement(ListPrimitiveItemHeading, {
|
|
2414
2847
|
...props,
|
|
2415
2848
|
className: tx("list.item.heading", {
|
|
2416
2849
|
density
|
|
2417
2850
|
}, classNames),
|
|
2418
2851
|
ref: forwardedRef
|
|
2419
|
-
}, children);
|
|
2852
|
+
}, /* @__PURE__ */ React30.createElement("span", null, children));
|
|
2420
2853
|
});
|
|
2421
|
-
var ListItemOpenTrigger = /* @__PURE__ */
|
|
2854
|
+
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
2422
2855
|
const { tx } = useThemeContext();
|
|
2423
2856
|
const density = useDensityContext();
|
|
2424
2857
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
2425
|
-
return /* @__PURE__ */
|
|
2858
|
+
return /* @__PURE__ */ React30.createElement(ListPrimitiveItemOpenTrigger, {
|
|
2426
2859
|
...props,
|
|
2427
2860
|
className: tx("list.item.openTrigger", {
|
|
2428
2861
|
density
|
|
2429
2862
|
}, classNames),
|
|
2430
2863
|
ref: forwardedRef
|
|
2431
|
-
}, children || /* @__PURE__ */
|
|
2864
|
+
}, children || /* @__PURE__ */ React30.createElement(Icon, {
|
|
2432
2865
|
size: 3,
|
|
2433
2866
|
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
2434
2867
|
classNames: tx("list.item.openTriggerIcon", {})
|
|
2435
2868
|
}));
|
|
2436
2869
|
});
|
|
2437
|
-
var ListItemRoot = /* @__PURE__ */
|
|
2870
|
+
var ListItemRoot = /* @__PURE__ */ forwardRef17(({ classNames, children, ...props }, forwardedRef) => {
|
|
2438
2871
|
const { tx } = useThemeContext();
|
|
2439
2872
|
const density = useDensityContext();
|
|
2440
|
-
return /* @__PURE__ */
|
|
2873
|
+
return /* @__PURE__ */ React30.createElement(ListPrimitiveItem, {
|
|
2441
2874
|
...props,
|
|
2442
2875
|
className: tx("list.item.root", {
|
|
2443
2876
|
density,
|
|
@@ -2457,10 +2890,10 @@ var ListItem = {
|
|
|
2457
2890
|
};
|
|
2458
2891
|
|
|
2459
2892
|
// src/components/List/Tree.tsx
|
|
2460
|
-
import
|
|
2893
|
+
import React32, { forwardRef as forwardRef18 } from "react";
|
|
2461
2894
|
|
|
2462
2895
|
// src/components/List/TreeDropIndicator.tsx
|
|
2463
|
-
import
|
|
2896
|
+
import React31 from "react";
|
|
2464
2897
|
var edgeToOrientationMap2 = {
|
|
2465
2898
|
"reorder-above": "sibling",
|
|
2466
2899
|
"reorder-below": "sibling",
|
|
@@ -2470,7 +2903,7 @@ var edgeToOrientationMap2 = {
|
|
|
2470
2903
|
var orientationStyles2 = {
|
|
2471
2904
|
// TODO(wittjosiah): Stop using left/right here.
|
|
2472
2905
|
sibling: "h-(--line-thickness) left-(--horizontal-indent) right-0 bg-accent-surface before:left-(--negative-terminal-size)",
|
|
2473
|
-
child: "
|
|
2906
|
+
child: "inset-0 border-[length:var(--line-thickness)] before:invisible"
|
|
2474
2907
|
};
|
|
2475
2908
|
var instructionStyles = {
|
|
2476
2909
|
"reorder-above": "top-(--line-offset) before:top-(--offset-terminal)",
|
|
@@ -2490,7 +2923,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2490
2923
|
if (isBlocked) {
|
|
2491
2924
|
return null;
|
|
2492
2925
|
}
|
|
2493
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ React31.createElement("div", {
|
|
2494
2927
|
style: {
|
|
2495
2928
|
"--line-thickness": `${strokeSize2}px`,
|
|
2496
2929
|
"--line-offset": `${lineOffset}`,
|
|
@@ -2505,22 +2938,22 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2505
2938
|
};
|
|
2506
2939
|
|
|
2507
2940
|
// src/components/List/Tree.tsx
|
|
2508
|
-
var TreeRoot = /* @__PURE__ */
|
|
2509
|
-
return /* @__PURE__ */
|
|
2941
|
+
var TreeRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2942
|
+
return /* @__PURE__ */ React32.createElement(List, {
|
|
2510
2943
|
...props,
|
|
2511
2944
|
ref: forwardedRef
|
|
2512
2945
|
});
|
|
2513
2946
|
});
|
|
2514
|
-
var TreeBranch = /* @__PURE__ */
|
|
2947
|
+
var TreeBranch = /* @__PURE__ */ forwardRef18(({ __listScope, ...props }, forwardedRef) => {
|
|
2515
2948
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
2516
|
-
return /* @__PURE__ */
|
|
2949
|
+
return /* @__PURE__ */ React32.createElement(List, {
|
|
2517
2950
|
...props,
|
|
2518
2951
|
"aria-labelledby": headingId,
|
|
2519
2952
|
ref: forwardedRef
|
|
2520
2953
|
});
|
|
2521
2954
|
});
|
|
2522
|
-
var TreeItemRoot = /* @__PURE__ */
|
|
2523
|
-
return /* @__PURE__ */
|
|
2955
|
+
var TreeItemRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2956
|
+
return /* @__PURE__ */ React32.createElement(ListItem.Root, {
|
|
2524
2957
|
role: "treeitem",
|
|
2525
2958
|
...props,
|
|
2526
2959
|
ref: forwardedRef
|
|
@@ -2546,20 +2979,24 @@ var TreeItem = {
|
|
|
2546
2979
|
// src/components/List/Treegrid.tsx
|
|
2547
2980
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2548
2981
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2549
|
-
import { Primitive as
|
|
2550
|
-
import { Slot as
|
|
2982
|
+
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
2983
|
+
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
2551
2984
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2552
|
-
import
|
|
2985
|
+
import React33, { forwardRef as forwardRef19, useCallback as useCallback8 } from "react";
|
|
2986
|
+
import { composable as composable5, composableProps as composableProps11 } from "@dxos/ui-theme";
|
|
2553
2987
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2554
2988
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2555
2989
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
2556
|
-
var
|
|
2557
|
-
var
|
|
2558
|
-
var TreegridRoot =
|
|
2990
|
+
var TREEGRID_PATH_SEPARATOR = "~";
|
|
2991
|
+
var TREEGRID_PARENT_OF_SEPARATOR = " ";
|
|
2992
|
+
var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemplateColumns, onKeyDown: onKeyDownProp, ...props }, forwardedRef) => {
|
|
2559
2993
|
const { tx } = useThemeContext();
|
|
2560
|
-
const
|
|
2994
|
+
const { className, role: _role, ...rest } = composableProps11(props, {
|
|
2995
|
+
classNames
|
|
2996
|
+
});
|
|
2997
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2561
2998
|
const { findFirstFocusable } = useFocusFinders();
|
|
2562
|
-
const handleKeyDown =
|
|
2999
|
+
const handleKeyDown = useCallback8((event) => {
|
|
2563
3000
|
switch (event.key) {
|
|
2564
3001
|
case "ArrowDown":
|
|
2565
3002
|
case "ArrowUp": {
|
|
@@ -2588,14 +3025,15 @@ var TreegridRoot = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children
|
|
|
2588
3025
|
break;
|
|
2589
3026
|
}
|
|
2590
3027
|
}
|
|
2591
|
-
|
|
3028
|
+
onKeyDownProp?.(event);
|
|
2592
3029
|
}, [
|
|
2593
|
-
findFirstFocusable
|
|
3030
|
+
findFirstFocusable,
|
|
3031
|
+
onKeyDownProp
|
|
2594
3032
|
]);
|
|
2595
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ React33.createElement(Comp, {
|
|
2596
3034
|
role: "treegrid",
|
|
2597
|
-
...
|
|
2598
|
-
className: tx("treegrid.root", {},
|
|
3035
|
+
...rest,
|
|
3036
|
+
className: tx("treegrid.root", {}, className),
|
|
2599
3037
|
style: {
|
|
2600
3038
|
...style,
|
|
2601
3039
|
gridTemplateColumns
|
|
@@ -2604,21 +3042,21 @@ var TreegridRoot = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children
|
|
|
2604
3042
|
ref: forwardedRef
|
|
2605
3043
|
}, children);
|
|
2606
3044
|
});
|
|
2607
|
-
var TreegridRow = /* @__PURE__ */
|
|
3045
|
+
var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2608
3046
|
const { tx } = useThemeContext();
|
|
2609
|
-
const Comp = asChild ?
|
|
2610
|
-
const pathParts = id.split(
|
|
3047
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
3048
|
+
const pathParts = id.split(TREEGRID_PATH_SEPARATOR);
|
|
2611
3049
|
const level = pathParts.length - 1;
|
|
2612
3050
|
const [open, onOpenChange] = useControllableState3({
|
|
2613
3051
|
prop: propsOpen,
|
|
2614
3052
|
onChange: propsOnOpenChange,
|
|
2615
3053
|
defaultProp: defaultOpen
|
|
2616
3054
|
});
|
|
2617
|
-
return /* @__PURE__ */
|
|
3055
|
+
return /* @__PURE__ */ React33.createElement(TreegridRowProvider, {
|
|
2618
3056
|
open,
|
|
2619
3057
|
onOpenChange,
|
|
2620
3058
|
scope: __treegridRowScope
|
|
2621
|
-
}, /* @__PURE__ */
|
|
3059
|
+
}, /* @__PURE__ */ React33.createElement(Comp, {
|
|
2622
3060
|
role: "row",
|
|
2623
3061
|
"aria-level": level,
|
|
2624
3062
|
className: tx("treegrid.row", {
|
|
@@ -2633,9 +3071,9 @@ var TreegridRow = /* @__PURE__ */ forwardRef21(({ __treegridRowScope, asChild, c
|
|
|
2633
3071
|
ref: forwardedRef
|
|
2634
3072
|
}, children));
|
|
2635
3073
|
});
|
|
2636
|
-
var TreegridCell = /* @__PURE__ */
|
|
3074
|
+
var TreegridCell = /* @__PURE__ */ forwardRef19(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
2637
3075
|
const { tx } = useThemeContext();
|
|
2638
|
-
return /* @__PURE__ */
|
|
3076
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
2639
3077
|
role: "gridcell",
|
|
2640
3078
|
className: tx("treegrid.cell", {
|
|
2641
3079
|
indent
|
|
@@ -2647,28 +3085,24 @@ var TreegridCell = /* @__PURE__ */ forwardRef21(({ classNames, children, indent,
|
|
|
2647
3085
|
var Treegrid = {
|
|
2648
3086
|
Root: TreegridRoot,
|
|
2649
3087
|
Row: TreegridRow,
|
|
2650
|
-
Cell: TreegridCell
|
|
2651
|
-
PARENT_OF_SEPARATOR,
|
|
2652
|
-
PATH_SEPARATOR,
|
|
2653
|
-
createTreegridRowScope,
|
|
2654
|
-
useTreegridRowContext
|
|
3088
|
+
Cell: TreegridCell
|
|
2655
3089
|
};
|
|
2656
3090
|
|
|
2657
3091
|
// src/components/Main/Main.tsx
|
|
2658
|
-
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2659
|
-
import { createContext as
|
|
3092
|
+
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
3093
|
+
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
2660
3094
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2661
|
-
import { Primitive as
|
|
2662
|
-
import { Slot as
|
|
3095
|
+
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
3096
|
+
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
2663
3097
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2664
|
-
import
|
|
3098
|
+
import React34, { forwardRef as forwardRef20, useCallback as useCallback10, useEffect as useEffect6, useRef as useRef4, useState as useState9 } from "react";
|
|
2665
3099
|
import { addEventListener } from "@dxos/async";
|
|
2666
3100
|
import { log } from "@dxos/log";
|
|
2667
3101
|
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2668
3102
|
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
2669
3103
|
|
|
2670
3104
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2671
|
-
import { useCallback as
|
|
3105
|
+
import { useCallback as useCallback9, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2672
3106
|
var useSwipeToDismiss = (ref, {
|
|
2673
3107
|
onDismiss,
|
|
2674
3108
|
dismissThreshold = 64,
|
|
@@ -2677,22 +3111,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2677
3111
|
/* side = 'inline-start' */
|
|
2678
3112
|
}) => {
|
|
2679
3113
|
const $root = ref.current;
|
|
2680
|
-
const [motionState, setMotionState] =
|
|
2681
|
-
const [gestureStartX, setGestureStartX] =
|
|
2682
|
-
const setIdle =
|
|
3114
|
+
const [motionState, setMotionState] = useState8(0);
|
|
3115
|
+
const [gestureStartX, setGestureStartX] = useState8(0);
|
|
3116
|
+
const setIdle = useCallback9(() => {
|
|
2683
3117
|
setMotionState(0);
|
|
2684
3118
|
$root?.style.removeProperty("inset-inline-start");
|
|
2685
3119
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2686
3120
|
}, [
|
|
2687
3121
|
$root
|
|
2688
3122
|
]);
|
|
2689
|
-
const setFollowing =
|
|
3123
|
+
const setFollowing = useCallback9(() => {
|
|
2690
3124
|
setMotionState(2);
|
|
2691
3125
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2692
3126
|
}, [
|
|
2693
3127
|
$root
|
|
2694
3128
|
]);
|
|
2695
|
-
const handlePointerDown =
|
|
3129
|
+
const handlePointerDown = useCallback9(({ screenX }) => {
|
|
2696
3130
|
if (motionState === 0) {
|
|
2697
3131
|
setMotionState(1);
|
|
2698
3132
|
setGestureStartX(screenX);
|
|
@@ -2700,7 +3134,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2700
3134
|
}, [
|
|
2701
3135
|
motionState
|
|
2702
3136
|
]);
|
|
2703
|
-
const handlePointerMove =
|
|
3137
|
+
const handlePointerMove = useCallback9(({ screenX }) => {
|
|
2704
3138
|
if ($root) {
|
|
2705
3139
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2706
3140
|
switch (motionState) {
|
|
@@ -2724,12 +3158,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2724
3158
|
motionState,
|
|
2725
3159
|
gestureStartX
|
|
2726
3160
|
]);
|
|
2727
|
-
const handlePointerUp =
|
|
3161
|
+
const handlePointerUp = useCallback9(() => {
|
|
2728
3162
|
setIdle();
|
|
2729
3163
|
}, [
|
|
2730
3164
|
setIdle
|
|
2731
3165
|
]);
|
|
2732
|
-
|
|
3166
|
+
useEffect5(() => {
|
|
2733
3167
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2734
3168
|
return () => {
|
|
2735
3169
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2738,7 +3172,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2738
3172
|
$root,
|
|
2739
3173
|
handlePointerDown
|
|
2740
3174
|
]);
|
|
2741
|
-
|
|
3175
|
+
useEffect5(() => {
|
|
2742
3176
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2743
3177
|
return () => {
|
|
2744
3178
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2747,7 +3181,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2747
3181
|
$root,
|
|
2748
3182
|
handlePointerMove
|
|
2749
3183
|
]);
|
|
2750
|
-
|
|
3184
|
+
useEffect5(() => {
|
|
2751
3185
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2752
3186
|
return () => {
|
|
2753
3187
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2770,7 +3204,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2770
3204
|
};
|
|
2771
3205
|
var landmarkAttr = "data-main-landmark";
|
|
2772
3206
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2773
|
-
const handleKeyDown =
|
|
3207
|
+
const handleKeyDown = useCallback10((event) => {
|
|
2774
3208
|
const target = event.target;
|
|
2775
3209
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2776
3210
|
event.preventDefault();
|
|
@@ -2784,7 +3218,7 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2784
3218
|
}, [
|
|
2785
3219
|
propsOnKeyDown
|
|
2786
3220
|
]);
|
|
2787
|
-
const focusableGroupAttrs =
|
|
3221
|
+
const focusableGroupAttrs = useFocusableGroup2({
|
|
2788
3222
|
tabBehavior: "limited",
|
|
2789
3223
|
ignoreDefaultKeydown: {
|
|
2790
3224
|
Tab: true
|
|
@@ -2797,25 +3231,15 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2797
3231
|
...focusableGroupAttrs
|
|
2798
3232
|
};
|
|
2799
3233
|
};
|
|
2800
|
-
var [MainProvider, useMainContext] =
|
|
3234
|
+
var [MainProvider, useMainContext] = createContext9(MAIN_NAME, {
|
|
2801
3235
|
resizing: false,
|
|
2802
3236
|
navigationSidebarState: "closed",
|
|
2803
3237
|
setNavigationSidebarState: (_nextState) => {
|
|
2804
|
-
log.warn("Not initialized", void 0, {
|
|
2805
|
-
F: __dxlog_file,
|
|
2806
|
-
L: 111,
|
|
2807
|
-
S: void 0,
|
|
2808
|
-
C: (f, a) => f(...a)
|
|
2809
|
-
});
|
|
3238
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: void 0 });
|
|
2810
3239
|
},
|
|
2811
3240
|
complementarySidebarState: "closed",
|
|
2812
3241
|
setComplementarySidebarState: (_nextState) => {
|
|
2813
|
-
log.warn("Not initialized", void 0, {
|
|
2814
|
-
F: __dxlog_file,
|
|
2815
|
-
L: 116,
|
|
2816
|
-
S: void 0,
|
|
2817
|
-
C: (f, a) => f(...a)
|
|
2818
|
-
});
|
|
3242
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 71, S: void 0 });
|
|
2819
3243
|
}
|
|
2820
3244
|
});
|
|
2821
3245
|
var useSidebars = (consumerName) => {
|
|
@@ -2823,22 +3247,22 @@ var useSidebars = (consumerName) => {
|
|
|
2823
3247
|
return {
|
|
2824
3248
|
navigationSidebarState,
|
|
2825
3249
|
setNavigationSidebarState,
|
|
2826
|
-
toggleNavigationSidebar:
|
|
3250
|
+
toggleNavigationSidebar: useCallback10(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2827
3251
|
navigationSidebarState,
|
|
2828
3252
|
setNavigationSidebarState
|
|
2829
3253
|
]),
|
|
2830
|
-
openNavigationSidebar:
|
|
2831
|
-
collapseNavigationSidebar:
|
|
2832
|
-
closeNavigationSidebar:
|
|
3254
|
+
openNavigationSidebar: useCallback10(() => setNavigationSidebarState("expanded"), []),
|
|
3255
|
+
collapseNavigationSidebar: useCallback10(() => setNavigationSidebarState("collapsed"), []),
|
|
3256
|
+
closeNavigationSidebar: useCallback10(() => setNavigationSidebarState("closed"), []),
|
|
2833
3257
|
complementarySidebarState,
|
|
2834
3258
|
setComplementarySidebarState,
|
|
2835
|
-
toggleComplementarySidebar:
|
|
3259
|
+
toggleComplementarySidebar: useCallback10(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2836
3260
|
complementarySidebarState,
|
|
2837
3261
|
setComplementarySidebarState
|
|
2838
3262
|
]),
|
|
2839
|
-
openComplementarySidebar:
|
|
2840
|
-
collapseComplementarySidebar:
|
|
2841
|
-
closeComplementarySidebar:
|
|
3263
|
+
openComplementarySidebar: useCallback10(() => setComplementarySidebarState("expanded"), []),
|
|
3264
|
+
collapseComplementarySidebar: useCallback10(() => setComplementarySidebarState("collapsed"), []),
|
|
3265
|
+
closeComplementarySidebar: useCallback10(() => setComplementarySidebarState("closed"), [])
|
|
2842
3266
|
};
|
|
2843
3267
|
};
|
|
2844
3268
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState = "closed", onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState = "closed", onComplementarySidebarStateChange, children, ...props }) => {
|
|
@@ -2853,9 +3277,9 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2853
3277
|
defaultProp: defaultComplementarySidebarState,
|
|
2854
3278
|
onChange: onComplementarySidebarStateChange
|
|
2855
3279
|
});
|
|
2856
|
-
const [resizing, setResizing] =
|
|
2857
|
-
const resizeInterval =
|
|
2858
|
-
|
|
3280
|
+
const [resizing, setResizing] = useState9(false);
|
|
3281
|
+
const resizeInterval = useRef4(null);
|
|
3282
|
+
useEffect6(() => addEventListener(window, "resize", () => {
|
|
2859
3283
|
setResizing(true);
|
|
2860
3284
|
if (resizeInterval.current) {
|
|
2861
3285
|
clearTimeout(resizeInterval.current);
|
|
@@ -2865,7 +3289,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2865
3289
|
resizeInterval.current = null;
|
|
2866
3290
|
}, 3e3);
|
|
2867
3291
|
}), []);
|
|
2868
|
-
return /* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ React34.createElement(MainProvider, {
|
|
2869
3293
|
...props,
|
|
2870
3294
|
navigationSidebarState,
|
|
2871
3295
|
setNavigationSidebarState,
|
|
@@ -2875,11 +3299,11 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2875
3299
|
}, children);
|
|
2876
3300
|
};
|
|
2877
3301
|
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
2878
|
-
var MainOverlay = /* @__PURE__ */
|
|
3302
|
+
var MainOverlay = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwardedRef) => {
|
|
2879
3303
|
const [isLg] = useMediaQuery("lg");
|
|
2880
3304
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_OVERLAY_NAME);
|
|
2881
3305
|
const { tx } = useThemeContext();
|
|
2882
|
-
return /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ React34.createElement("div", {
|
|
2883
3307
|
...props,
|
|
2884
3308
|
onClick: () => {
|
|
2885
3309
|
setNavigationSidebarState("collapsed");
|
|
@@ -2896,16 +3320,16 @@ var MainOverlay = /* @__PURE__ */ forwardRef22(({ classNames, ...props }, forwar
|
|
|
2896
3320
|
});
|
|
2897
3321
|
});
|
|
2898
3322
|
MainOverlay.displayName = MAIN_OVERLAY_NAME;
|
|
2899
|
-
var MainSidebar = /* @__PURE__ */
|
|
3323
|
+
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2900
3324
|
const [isLg] = useMediaQuery("lg");
|
|
2901
3325
|
const { tx } = useThemeContext();
|
|
2902
3326
|
const { t } = useTranslation(osTranslations3);
|
|
2903
3327
|
const ref = useForwardedRef(forwardedRef);
|
|
2904
|
-
const noopRef =
|
|
3328
|
+
const noopRef = useRef4(null);
|
|
2905
3329
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2906
3330
|
onDismiss: () => onStateChange?.("closed")
|
|
2907
3331
|
});
|
|
2908
|
-
const handleKeyDown =
|
|
3332
|
+
const handleKeyDown = useCallback10((event) => {
|
|
2909
3333
|
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
2910
3334
|
if (event.key === "Escape" && focusGroupParent) {
|
|
2911
3335
|
event.preventDefault();
|
|
@@ -2916,14 +3340,14 @@ var MainSidebar = /* @__PURE__ */ forwardRef22(({ classNames, children, swipeToD
|
|
|
2916
3340
|
}, [
|
|
2917
3341
|
props.onKeyDown
|
|
2918
3342
|
]);
|
|
2919
|
-
const
|
|
2920
|
-
return /* @__PURE__ */
|
|
3343
|
+
const Root14 = isLg ? Primitive17.div : DialogContent2;
|
|
3344
|
+
return /* @__PURE__ */ React34.createElement(DialogRoot2, {
|
|
2921
3345
|
open: state !== "closed",
|
|
2922
3346
|
"aria-label": toLocalizedString(label, t),
|
|
2923
3347
|
modal: false
|
|
2924
|
-
}, !isLg && /* @__PURE__ */
|
|
3348
|
+
}, !isLg && /* @__PURE__ */ React34.createElement(DialogTitle2, {
|
|
2925
3349
|
className: "sr-only"
|
|
2926
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */
|
|
3350
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React34.createElement(Root14, {
|
|
2927
3351
|
...!isLg && {
|
|
2928
3352
|
forceMount: true,
|
|
2929
3353
|
tabIndex: -1,
|
|
@@ -2941,10 +3365,10 @@ var MainSidebar = /* @__PURE__ */ forwardRef22(({ classNames, children, swipeToD
|
|
|
2941
3365
|
ref
|
|
2942
3366
|
}, children));
|
|
2943
3367
|
});
|
|
2944
|
-
var MainNavigationSidebar = /* @__PURE__ */
|
|
3368
|
+
var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2945
3369
|
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2946
3370
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2947
|
-
return /* @__PURE__ */
|
|
3371
|
+
return /* @__PURE__ */ React34.createElement(MainSidebar, {
|
|
2948
3372
|
...mover,
|
|
2949
3373
|
...props,
|
|
2950
3374
|
state: navigationSidebarState,
|
|
@@ -2955,10 +3379,10 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef22((props, forwardedRef) =
|
|
|
2955
3379
|
});
|
|
2956
3380
|
});
|
|
2957
3381
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2958
|
-
var MainComplementarySidebar = /* @__PURE__ */
|
|
3382
|
+
var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2959
3383
|
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2960
3384
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2961
|
-
return /* @__PURE__ */
|
|
3385
|
+
return /* @__PURE__ */ React34.createElement(MainSidebar, {
|
|
2962
3386
|
...mover,
|
|
2963
3387
|
...props,
|
|
2964
3388
|
state: complementarySidebarState,
|
|
@@ -2969,17 +3393,17 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef22((props, forwardedRef
|
|
|
2969
3393
|
});
|
|
2970
3394
|
});
|
|
2971
3395
|
MainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;
|
|
2972
|
-
var MainContent = /* @__PURE__ */
|
|
3396
|
+
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2973
3397
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2974
3398
|
const { tx } = useThemeContext();
|
|
2975
|
-
const Comp = asChild ?
|
|
3399
|
+
const Comp = asChild ? Slot17 : role ? Primitive17.div : "main";
|
|
2976
3400
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2977
|
-
return /* @__PURE__ */
|
|
2978
|
-
role,
|
|
3401
|
+
return /* @__PURE__ */ React34.createElement(Comp, {
|
|
2979
3402
|
...handlesFocus && {
|
|
2980
3403
|
...mover
|
|
2981
3404
|
},
|
|
2982
3405
|
...props,
|
|
3406
|
+
role,
|
|
2983
3407
|
"data-sidebar-left-state": navigationSidebarState,
|
|
2984
3408
|
"data-sidebar-right-state": complementarySidebarState,
|
|
2985
3409
|
"data-handles-focus": handlesFocus,
|
|
@@ -3000,11 +3424,13 @@ var Main = {
|
|
|
3000
3424
|
};
|
|
3001
3425
|
|
|
3002
3426
|
// src/components/Message/Message.tsx
|
|
3003
|
-
import { createContext as
|
|
3004
|
-
import { Primitive as
|
|
3005
|
-
import { Slot as
|
|
3006
|
-
import
|
|
3427
|
+
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
3428
|
+
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
3429
|
+
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
3430
|
+
import React35, { forwardRef as forwardRef21 } from "react";
|
|
3431
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
3007
3432
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3433
|
+
import { translationKey as translationKey3 } from "#translations";
|
|
3008
3434
|
var messageIcons = {
|
|
3009
3435
|
success: "ph--check-circle--duotone",
|
|
3010
3436
|
info: "ph--info--duotone",
|
|
@@ -3013,18 +3439,18 @@ var messageIcons = {
|
|
|
3013
3439
|
neutral: "ph--info--duotone"
|
|
3014
3440
|
};
|
|
3015
3441
|
var MESSAGE_NAME = "Message";
|
|
3016
|
-
var [MessageProvider, useMessageContext] =
|
|
3017
|
-
var MessageRoot = /* @__PURE__ */
|
|
3442
|
+
var [MessageProvider, useMessageContext] = createContext10(MESSAGE_NAME);
|
|
3443
|
+
var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral", elevation: propsElevation, classNames, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
3018
3444
|
const { tx } = useThemeContext();
|
|
3019
3445
|
const titleId = useId3("message__title", propsTitleId);
|
|
3020
3446
|
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
3021
3447
|
const elevation = useElevationContext(propsElevation);
|
|
3022
|
-
const Comp = asChild ?
|
|
3023
|
-
return /* @__PURE__ */
|
|
3448
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3449
|
+
return /* @__PURE__ */ React35.createElement(MessageProvider, {
|
|
3024
3450
|
titleId,
|
|
3025
3451
|
descriptionId,
|
|
3026
3452
|
valence
|
|
3027
|
-
}, /* @__PURE__ */
|
|
3453
|
+
}, /* @__PURE__ */ React35.createElement(Comp, {
|
|
3028
3454
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3029
3455
|
...props,
|
|
3030
3456
|
className: tx("message.root", {
|
|
@@ -3038,33 +3464,38 @@ var MessageRoot = /* @__PURE__ */ forwardRef23(({ asChild, valence = "neutral",
|
|
|
3038
3464
|
});
|
|
3039
3465
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3040
3466
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3041
|
-
var MessageTitle = /* @__PURE__ */
|
|
3467
|
+
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3468
|
+
const { t } = useTranslation4(translationKey3);
|
|
3042
3469
|
const { tx } = useThemeContext();
|
|
3043
3470
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3044
|
-
const Comp = asChild ? Slot14 : Primitive14.h2;
|
|
3045
3471
|
const icon = iconProp ?? messageIcons[valence];
|
|
3046
|
-
return /* @__PURE__ */
|
|
3047
|
-
...props,
|
|
3472
|
+
return /* @__PURE__ */ React35.createElement("div", {
|
|
3048
3473
|
className: tx("message.header", {}, classNames),
|
|
3049
3474
|
id: titleId,
|
|
3050
3475
|
ref: forwardedRef
|
|
3051
|
-
},
|
|
3052
|
-
|
|
3053
|
-
icon,
|
|
3054
|
-
classNames: tx("message.icon", {
|
|
3476
|
+
}, icon && /* @__PURE__ */ React35.createElement("div", {
|
|
3477
|
+
className: tx("message.icon", {
|
|
3055
3478
|
valence
|
|
3056
3479
|
})
|
|
3057
|
-
}
|
|
3480
|
+
}, /* @__PURE__ */ React35.createElement(Icon, {
|
|
3481
|
+
icon
|
|
3482
|
+
})), /* @__PURE__ */ React35.createElement("h2", {
|
|
3058
3483
|
className: tx("message.title", {}, classNames)
|
|
3059
|
-
}, children)
|
|
3484
|
+
}, children), onClose && /* @__PURE__ */ React35.createElement(IconButton, {
|
|
3485
|
+
variant: "ghost",
|
|
3486
|
+
icon: "ph--x--regular",
|
|
3487
|
+
iconOnly: true,
|
|
3488
|
+
label: t("toolbar-close.label"),
|
|
3489
|
+
onClick: onClose
|
|
3490
|
+
}));
|
|
3060
3491
|
});
|
|
3061
3492
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3062
3493
|
var MESSAGE_CONTENT_NAME = "MessageContent";
|
|
3063
|
-
var MessageContent = /* @__PURE__ */
|
|
3494
|
+
var MessageContent = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
3064
3495
|
const { tx } = useThemeContext();
|
|
3065
3496
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
3066
|
-
const Comp = asChild ?
|
|
3067
|
-
return /* @__PURE__ */
|
|
3497
|
+
const Comp = asChild ? Slot18 : Primitive18.p;
|
|
3498
|
+
return /* @__PURE__ */ React35.createElement(Comp, {
|
|
3068
3499
|
...props,
|
|
3069
3500
|
className: tx("message.content", {}, classNames),
|
|
3070
3501
|
id: descriptionId,
|
|
@@ -3081,7 +3512,7 @@ var Callout = Message;
|
|
|
3081
3512
|
|
|
3082
3513
|
// src/components/Popover/Popover.tsx
|
|
3083
3514
|
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
3084
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
3515
|
+
import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
|
|
3085
3516
|
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
3086
3517
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
3087
3518
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
@@ -3091,11 +3522,11 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
3091
3522
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
3092
3523
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
3093
3524
|
import { Presence } from "@radix-ui/react-presence";
|
|
3094
|
-
import { Primitive as
|
|
3095
|
-
import { Slot as
|
|
3525
|
+
import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
3526
|
+
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3096
3527
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3097
3528
|
import { hideOthers } from "aria-hidden";
|
|
3098
|
-
import
|
|
3529
|
+
import React36, { forwardRef as forwardRef22, useCallback as useCallback11, useEffect as useEffect7, useMemo as useMemo7, useRef as useRef5, useState as useState10 } from "react";
|
|
3099
3530
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3100
3531
|
var POPOVER_NAME = "Popover";
|
|
3101
3532
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -3106,43 +3537,43 @@ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
|
3106
3537
|
var PopoverRoot = (props) => {
|
|
3107
3538
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3108
3539
|
const popperScope = usePopperScope(__scopePopover);
|
|
3109
|
-
const triggerRef =
|
|
3110
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3540
|
+
const triggerRef = useRef5(null);
|
|
3541
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState10(false);
|
|
3111
3542
|
const [open = false, setOpen] = useControllableState5({
|
|
3112
3543
|
prop: openProp,
|
|
3113
3544
|
defaultProp: defaultOpen,
|
|
3114
3545
|
onChange: onOpenChange
|
|
3115
3546
|
});
|
|
3116
|
-
return /* @__PURE__ */
|
|
3547
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React36.createElement(PopoverProvider, {
|
|
3117
3548
|
scope: __scopePopover,
|
|
3118
3549
|
contentId: useId4(),
|
|
3119
3550
|
triggerRef,
|
|
3120
3551
|
open,
|
|
3121
3552
|
onOpenChange: setOpen,
|
|
3122
|
-
onOpenToggle:
|
|
3553
|
+
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3123
3554
|
setOpen
|
|
3124
3555
|
]),
|
|
3125
3556
|
hasCustomAnchor,
|
|
3126
|
-
onCustomAnchorAdd:
|
|
3127
|
-
onCustomAnchorRemove:
|
|
3557
|
+
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3558
|
+
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3128
3559
|
modal
|
|
3129
3560
|
}, children));
|
|
3130
3561
|
};
|
|
3131
3562
|
PopoverRoot.displayName = POPOVER_NAME;
|
|
3132
3563
|
var ANCHOR_NAME = "PopoverAnchor";
|
|
3133
|
-
var PopoverAnchor = /* @__PURE__ */
|
|
3564
|
+
var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3134
3565
|
const { __scopePopover, ...anchorProps } = props;
|
|
3135
3566
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3136
3567
|
const popperScope = usePopperScope(__scopePopover);
|
|
3137
3568
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3138
|
-
|
|
3569
|
+
useEffect7(() => {
|
|
3139
3570
|
onCustomAnchorAdd();
|
|
3140
3571
|
return () => onCustomAnchorRemove();
|
|
3141
3572
|
}, [
|
|
3142
3573
|
onCustomAnchorAdd,
|
|
3143
3574
|
onCustomAnchorRemove
|
|
3144
3575
|
]);
|
|
3145
|
-
return /* @__PURE__ */
|
|
3576
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3146
3577
|
...popperScope,
|
|
3147
3578
|
...anchorProps,
|
|
3148
3579
|
ref: forwardedRef
|
|
@@ -3150,13 +3581,13 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3150
3581
|
});
|
|
3151
3582
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
3152
3583
|
var TRIGGER_NAME2 = "PopoverTrigger";
|
|
3153
|
-
var PopoverTrigger = /* @__PURE__ */
|
|
3584
|
+
var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3154
3585
|
const { __scopePopover, asChild, ...triggerProps } = props;
|
|
3155
3586
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
3156
3587
|
const popperScope = usePopperScope(__scopePopover);
|
|
3157
|
-
const composedTriggerRef =
|
|
3158
|
-
const Comp = asChild ?
|
|
3159
|
-
const trigger = /* @__PURE__ */
|
|
3588
|
+
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3589
|
+
const Comp = asChild ? Slot19 : Primitive19.button;
|
|
3590
|
+
const trigger = /* @__PURE__ */ React36.createElement(Comp, {
|
|
3160
3591
|
type: "button",
|
|
3161
3592
|
"aria-haspopup": "dialog",
|
|
3162
3593
|
"aria-expanded": context.open,
|
|
@@ -3166,7 +3597,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3166
3597
|
ref: composedTriggerRef,
|
|
3167
3598
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
3168
3599
|
});
|
|
3169
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
3600
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3170
3601
|
asChild: true,
|
|
3171
3602
|
...popperScope
|
|
3172
3603
|
}, trigger);
|
|
@@ -3177,12 +3608,12 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3177
3608
|
const { __scopePopover, virtualRef } = props;
|
|
3178
3609
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3179
3610
|
const popperScope = usePopperScope(__scopePopover);
|
|
3180
|
-
|
|
3611
|
+
useEffect7(() => {
|
|
3181
3612
|
if (virtualRef.current) {
|
|
3182
3613
|
context.triggerRef.current = virtualRef.current;
|
|
3183
3614
|
}
|
|
3184
3615
|
});
|
|
3185
|
-
return /* @__PURE__ */
|
|
3616
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3186
3617
|
...popperScope,
|
|
3187
3618
|
virtualRef
|
|
3188
3619
|
});
|
|
@@ -3195,48 +3626,48 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
3195
3626
|
var PopoverPortal = (props) => {
|
|
3196
3627
|
const { __scopePopover, forceMount, children, container } = props;
|
|
3197
3628
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
3198
|
-
return /* @__PURE__ */
|
|
3629
|
+
return /* @__PURE__ */ React36.createElement(PortalProvider, {
|
|
3199
3630
|
scope: __scopePopover,
|
|
3200
3631
|
forceMount
|
|
3201
|
-
}, /* @__PURE__ */
|
|
3632
|
+
}, /* @__PURE__ */ React36.createElement(Presence, {
|
|
3202
3633
|
present: forceMount || context.open
|
|
3203
|
-
}, /* @__PURE__ */
|
|
3634
|
+
}, /* @__PURE__ */ React36.createElement(PortalPrimitive, {
|
|
3204
3635
|
asChild: true,
|
|
3205
3636
|
container
|
|
3206
3637
|
}, children)));
|
|
3207
3638
|
};
|
|
3208
3639
|
PopoverPortal.displayName = PORTAL_NAME2;
|
|
3209
3640
|
var CONTENT_NAME2 = "PopoverContent";
|
|
3210
|
-
var PopoverContent = /* @__PURE__ */
|
|
3641
|
+
var PopoverContent = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3211
3642
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
3212
3643
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3213
3644
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3214
|
-
return /* @__PURE__ */
|
|
3645
|
+
return /* @__PURE__ */ React36.createElement(Presence, {
|
|
3215
3646
|
present: forceMount || context.open
|
|
3216
|
-
}, context.modal ? /* @__PURE__ */
|
|
3647
|
+
}, context.modal ? /* @__PURE__ */ React36.createElement(PopoverContentModal, {
|
|
3217
3648
|
...contentProps,
|
|
3218
3649
|
ref: forwardedRef
|
|
3219
|
-
}) : /* @__PURE__ */
|
|
3650
|
+
}) : /* @__PURE__ */ React36.createElement(PopoverContentNonModal, {
|
|
3220
3651
|
...contentProps,
|
|
3221
3652
|
ref: forwardedRef
|
|
3222
3653
|
}));
|
|
3223
3654
|
});
|
|
3224
3655
|
PopoverContent.displayName = CONTENT_NAME2;
|
|
3225
|
-
var PopoverContentModal = /* @__PURE__ */
|
|
3656
|
+
var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3226
3657
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3227
|
-
const contentRef =
|
|
3228
|
-
const composedRefs =
|
|
3229
|
-
const isRightClickOutsideRef =
|
|
3230
|
-
|
|
3658
|
+
const contentRef = useRef5(null);
|
|
3659
|
+
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3660
|
+
const isRightClickOutsideRef = useRef5(false);
|
|
3661
|
+
useEffect7(() => {
|
|
3231
3662
|
const content = contentRef.current;
|
|
3232
3663
|
if (content) {
|
|
3233
3664
|
return hideOthers(content);
|
|
3234
3665
|
}
|
|
3235
3666
|
}, []);
|
|
3236
|
-
return /* @__PURE__ */
|
|
3237
|
-
as:
|
|
3667
|
+
return /* @__PURE__ */ React36.createElement(RemoveScroll, {
|
|
3668
|
+
as: Slot19,
|
|
3238
3669
|
allowPinchZoom: true
|
|
3239
|
-
}, /* @__PURE__ */
|
|
3670
|
+
}, /* @__PURE__ */ React36.createElement(PopoverContentImpl, {
|
|
3240
3671
|
...props,
|
|
3241
3672
|
ref: composedRefs,
|
|
3242
3673
|
// Make sure we're not trapping once it's been closed (closed !== unmounted when animating out).
|
|
@@ -3263,11 +3694,11 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef24((props, forwardedRef) =>
|
|
|
3263
3694
|
})
|
|
3264
3695
|
}));
|
|
3265
3696
|
});
|
|
3266
|
-
var PopoverContentNonModal = /* @__PURE__ */
|
|
3697
|
+
var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3267
3698
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3268
|
-
const hasInteractedOutsideRef =
|
|
3269
|
-
const hasPointerDownOutsideRef =
|
|
3270
|
-
return /* @__PURE__ */
|
|
3699
|
+
const hasInteractedOutsideRef = useRef5(false);
|
|
3700
|
+
const hasPointerDownOutsideRef = useRef5(false);
|
|
3701
|
+
return /* @__PURE__ */ React36.createElement(PopoverContentImpl, {
|
|
3271
3702
|
...props,
|
|
3272
3703
|
ref: forwardedRef,
|
|
3273
3704
|
trapFocus: false,
|
|
@@ -3302,7 +3733,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef24((props, forwardedRef)
|
|
|
3302
3733
|
}
|
|
3303
3734
|
});
|
|
3304
3735
|
});
|
|
3305
|
-
var PopoverContentImpl = /* @__PURE__ */
|
|
3736
|
+
var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3306
3737
|
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
3307
3738
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
3308
3739
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -3310,7 +3741,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3310
3741
|
const elevation = useElevationContext();
|
|
3311
3742
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3312
3743
|
useFocusGuards();
|
|
3313
|
-
const computedCollisionBoundary =
|
|
3744
|
+
const computedCollisionBoundary = useMemo7(() => {
|
|
3314
3745
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3315
3746
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3316
3747
|
closestBoundary,
|
|
@@ -3326,13 +3757,13 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3326
3757
|
collisionBoundary,
|
|
3327
3758
|
context.triggerRef.current
|
|
3328
3759
|
]);
|
|
3329
|
-
return /* @__PURE__ */
|
|
3760
|
+
return /* @__PURE__ */ React36.createElement(FocusScope, {
|
|
3330
3761
|
asChild: true,
|
|
3331
3762
|
loop: true,
|
|
3332
3763
|
trapped: trapFocus,
|
|
3333
3764
|
onMountAutoFocus: onOpenAutoFocus,
|
|
3334
3765
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
3335
|
-
}, /* @__PURE__ */
|
|
3766
|
+
}, /* @__PURE__ */ React36.createElement(DismissableLayer, {
|
|
3336
3767
|
asChild: true,
|
|
3337
3768
|
disableOutsidePointerEvents,
|
|
3338
3769
|
onInteractOutside,
|
|
@@ -3340,7 +3771,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3340
3771
|
onPointerDownOutside,
|
|
3341
3772
|
onFocusOutside,
|
|
3342
3773
|
onDismiss: () => context.onOpenChange(false)
|
|
3343
|
-
}, /* @__PURE__ */
|
|
3774
|
+
}, /* @__PURE__ */ React36.createElement(PopperPrimitive.Content, {
|
|
3344
3775
|
"data-state": getState(context.open),
|
|
3345
3776
|
role: "dialog",
|
|
3346
3777
|
id: context.contentId,
|
|
@@ -3366,10 +3797,10 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3366
3797
|
})));
|
|
3367
3798
|
});
|
|
3368
3799
|
var CLOSE_NAME = "PopoverClose";
|
|
3369
|
-
var PopoverClose = /* @__PURE__ */
|
|
3800
|
+
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3370
3801
|
const { __scopePopover, ...closeProps } = props;
|
|
3371
3802
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3372
|
-
return /* @__PURE__ */
|
|
3803
|
+
return /* @__PURE__ */ React36.createElement(Primitive19.button, {
|
|
3373
3804
|
type: "button",
|
|
3374
3805
|
...closeProps,
|
|
3375
3806
|
ref: forwardedRef,
|
|
@@ -3378,11 +3809,11 @@ var PopoverClose = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3378
3809
|
});
|
|
3379
3810
|
PopoverClose.displayName = CLOSE_NAME;
|
|
3380
3811
|
var ARROW_NAME2 = "PopoverArrow";
|
|
3381
|
-
var PopoverArrow = /* @__PURE__ */
|
|
3812
|
+
var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3382
3813
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3383
3814
|
const popperScope = usePopperScope(__scopePopover);
|
|
3384
3815
|
const { tx } = useThemeContext();
|
|
3385
|
-
return /* @__PURE__ */
|
|
3816
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Arrow, {
|
|
3386
3817
|
...popperScope,
|
|
3387
3818
|
...arrowProps,
|
|
3388
3819
|
className: tx("popover.arrow", {}, classNames),
|
|
@@ -3390,10 +3821,10 @@ var PopoverArrow = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3390
3821
|
});
|
|
3391
3822
|
});
|
|
3392
3823
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
3393
|
-
var PopoverViewport = /* @__PURE__ */
|
|
3824
|
+
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3394
3825
|
const { tx } = useThemeContext();
|
|
3395
|
-
const Comp = asChild ?
|
|
3396
|
-
return /* @__PURE__ */
|
|
3826
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
3827
|
+
return /* @__PURE__ */ React36.createElement(Comp, {
|
|
3397
3828
|
...props,
|
|
3398
3829
|
className: tx("popover.viewport", {
|
|
3399
3830
|
constrainInline,
|
|
@@ -3416,10 +3847,10 @@ var Popover = {
|
|
|
3416
3847
|
};
|
|
3417
3848
|
|
|
3418
3849
|
// src/components/Status/Status.tsx
|
|
3419
|
-
import
|
|
3420
|
-
var Status = /* @__PURE__ */
|
|
3850
|
+
import React37, { forwardRef as forwardRef23 } from "react";
|
|
3851
|
+
var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3421
3852
|
const { tx } = useThemeContext();
|
|
3422
|
-
return /* @__PURE__ */
|
|
3853
|
+
return /* @__PURE__ */ React37.createElement("span", {
|
|
3423
3854
|
role: "status",
|
|
3424
3855
|
...props,
|
|
3425
3856
|
className: tx("status.root", {
|
|
@@ -3427,7 +3858,7 @@ var Status = /* @__PURE__ */ forwardRef25(({ classNames, children, progress = 0,
|
|
|
3427
3858
|
variant
|
|
3428
3859
|
}, classNames),
|
|
3429
3860
|
ref: forwardedRef
|
|
3430
|
-
}, /* @__PURE__ */
|
|
3861
|
+
}, /* @__PURE__ */ React37.createElement("span", {
|
|
3431
3862
|
role: "none",
|
|
3432
3863
|
className: tx("status.bar", {
|
|
3433
3864
|
indeterminate,
|
|
@@ -3442,41 +3873,56 @@ var Status = /* @__PURE__ */ forwardRef25(({ classNames, children, progress = 0,
|
|
|
3442
3873
|
});
|
|
3443
3874
|
|
|
3444
3875
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3445
|
-
import { createContext as
|
|
3446
|
-
import { Primitive as
|
|
3447
|
-
import { Slot as
|
|
3448
|
-
import
|
|
3876
|
+
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
3877
|
+
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
3878
|
+
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
3879
|
+
import React38, { useMemo as useMemo8 } from "react";
|
|
3880
|
+
import { composableProps as composableProps12, scrollbar, slottable as slottable9 } from "@dxos/ui-theme";
|
|
3449
3881
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3450
|
-
var [ScrollAreaProvider, useScrollAreaContext] =
|
|
3882
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createContext11(SCROLLAREA_NAME);
|
|
3451
3883
|
var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
3452
|
-
var ScrollAreaRoot =
|
|
3884
|
+
var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
3453
3885
|
const { tx } = useThemeContext();
|
|
3454
|
-
const
|
|
3455
|
-
const
|
|
3886
|
+
const { className, ...rest } = composableProps12(props);
|
|
3887
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3888
|
+
const options = useMemo8(() => ({
|
|
3456
3889
|
orientation,
|
|
3457
3890
|
autoHide,
|
|
3458
|
-
|
|
3891
|
+
centered,
|
|
3459
3892
|
padding,
|
|
3460
3893
|
thin,
|
|
3461
3894
|
snap
|
|
3462
|
-
}
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3895
|
+
}), [
|
|
3896
|
+
orientation,
|
|
3897
|
+
autoHide,
|
|
3898
|
+
centered,
|
|
3899
|
+
padding,
|
|
3900
|
+
thin,
|
|
3901
|
+
snap
|
|
3902
|
+
]);
|
|
3903
|
+
return /* @__PURE__ */ React38.createElement(ScrollAreaProvider, options, /* @__PURE__ */ React38.createElement(Comp, {
|
|
3904
|
+
...rest,
|
|
3905
|
+
className: tx("scrollArea.root", options, className),
|
|
3469
3906
|
ref: forwardedRef
|
|
3470
3907
|
}, children));
|
|
3471
3908
|
});
|
|
3472
3909
|
ScrollAreaRoot.displayName = SCROLLAREA_ROOT_NAME;
|
|
3473
3910
|
var SCROLLAREA_VIEWPORT_NAME = "ScrollArea.Viewport";
|
|
3474
|
-
var ScrollAreaViewport =
|
|
3911
|
+
var ScrollAreaViewport = slottable9(({ children, asChild, ...props }, forwardedRef) => {
|
|
3475
3912
|
const { tx } = useThemeContext();
|
|
3476
3913
|
const options = useScrollAreaContext(SCROLLAREA_VIEWPORT_NAME);
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3914
|
+
const density = options.thin ? scrollbar.thin : scrollbar.coarse;
|
|
3915
|
+
const { className, ...rest } = composableProps12(props);
|
|
3916
|
+
const { style, ...restWithoutStyle } = rest;
|
|
3917
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3918
|
+
return /* @__PURE__ */ React38.createElement(Comp, {
|
|
3919
|
+
...restWithoutStyle,
|
|
3920
|
+
style: {
|
|
3921
|
+
"--scroll-width": `${density.size}px`,
|
|
3922
|
+
"--scroll-padding": `${density.padding}px`,
|
|
3923
|
+
...style
|
|
3924
|
+
},
|
|
3925
|
+
className: tx("scrollArea.viewport", options, className),
|
|
3480
3926
|
ref: forwardedRef
|
|
3481
3927
|
}, children);
|
|
3482
3928
|
});
|
|
@@ -3487,180 +3933,221 @@ var ScrollArea = {
|
|
|
3487
3933
|
};
|
|
3488
3934
|
|
|
3489
3935
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3490
|
-
import { createContext as
|
|
3491
|
-
import
|
|
3936
|
+
import { createContext as createContext12 } from "@radix-ui/react-context";
|
|
3937
|
+
import React39, { forwardRef as forwardRef24, useCallback as useCallback12, useEffect as useEffect8, useImperativeHandle, useMemo as useMemo9, useRef as useRef6, useState as useState11 } from "react";
|
|
3492
3938
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3493
3939
|
import { invariant } from "@dxos/invariant";
|
|
3494
|
-
import {
|
|
3495
|
-
import {
|
|
3940
|
+
import { useMergeRefs } from "@dxos/react-hooks";
|
|
3941
|
+
import { composable as composable6, composableProps as composableProps13, slottable as slottable10 } from "@dxos/ui-theme";
|
|
3942
|
+
import { mx as mx11 } from "@dxos/ui-theme";
|
|
3496
3943
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3497
3944
|
var isBottom = (el) => {
|
|
3498
3945
|
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3499
3946
|
};
|
|
3500
|
-
var [ScrollContainerProvider, useScrollContainerContext] =
|
|
3501
|
-
var
|
|
3502
|
-
const scrollerRef =
|
|
3503
|
-
const autoScrollRef =
|
|
3504
|
-
const [
|
|
3505
|
-
const [
|
|
3506
|
-
const timeoutRef =
|
|
3507
|
-
const scrollToBottom =
|
|
3947
|
+
var [ScrollContainerProvider, useScrollContainerContext] = createContext12("ScrollContainer");
|
|
3948
|
+
var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorProp = "smooth" }, forwardedRef) => {
|
|
3949
|
+
const scrollerRef = useRef6(null);
|
|
3950
|
+
const autoScrollRef = useRef6(false);
|
|
3951
|
+
const [pinned, setPinned] = useState11(pin);
|
|
3952
|
+
const [overflow, setOverflow] = useState11(false);
|
|
3953
|
+
const timeoutRef = useRef6(void 0);
|
|
3954
|
+
const scrollToBottom = useCallback12((behavior = behaviorProp) => {
|
|
3508
3955
|
if (scrollerRef.current) {
|
|
3509
|
-
autoScrollRef.current = true;
|
|
3510
|
-
scrollerRef.current.classList.add("scrollbar-none");
|
|
3511
|
-
scrollerRef.current.scrollTo({
|
|
3512
|
-
top: scrollerRef.current.scrollHeight,
|
|
3513
|
-
behavior
|
|
3514
|
-
});
|
|
3515
|
-
clearTimeout(timeoutRef.current);
|
|
3516
3956
|
if (behavior !== "instant") {
|
|
3957
|
+
autoScrollRef.current = true;
|
|
3958
|
+
scrollerRef.current.classList.add("scrollbar-none");
|
|
3959
|
+
clearTimeout(timeoutRef.current);
|
|
3517
3960
|
timeoutRef.current = setTimeout(() => {
|
|
3518
3961
|
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
3519
3962
|
autoScrollRef.current = false;
|
|
3520
3963
|
}, 500);
|
|
3521
3964
|
}
|
|
3965
|
+
scrollerRef.current.scrollTo({
|
|
3966
|
+
top: scrollerRef.current.scrollHeight,
|
|
3967
|
+
behavior
|
|
3968
|
+
});
|
|
3522
3969
|
setPinned(true);
|
|
3523
3970
|
}
|
|
3524
|
-
}, [
|
|
3525
|
-
|
|
3526
|
-
|
|
3971
|
+
}, [
|
|
3972
|
+
behaviorProp
|
|
3973
|
+
]);
|
|
3974
|
+
const controller = useMemo9(() => ({
|
|
3975
|
+
get viewport() {
|
|
3976
|
+
return scrollerRef.current;
|
|
3977
|
+
},
|
|
3527
3978
|
scrollToTop: () => {
|
|
3528
|
-
invariant(scrollerRef.current, void 0, {
|
|
3529
|
-
F: __dxlog_file2,
|
|
3530
|
-
L: 95,
|
|
3531
|
-
S: void 0,
|
|
3532
|
-
A: [
|
|
3533
|
-
"scrollerRef.current",
|
|
3534
|
-
""
|
|
3535
|
-
]
|
|
3536
|
-
});
|
|
3979
|
+
invariant(scrollerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: void 0, A: ["scrollerRef.current", ""] });
|
|
3537
3980
|
scrollerRef.current.scrollTo({
|
|
3538
3981
|
top: 0,
|
|
3539
3982
|
behavior: "smooth"
|
|
3540
3983
|
});
|
|
3541
3984
|
setPinned(false);
|
|
3542
3985
|
},
|
|
3543
|
-
scrollToBottom: () => {
|
|
3544
|
-
scrollToBottom(
|
|
3986
|
+
scrollToBottom: (behavior = "smooth") => {
|
|
3987
|
+
scrollToBottom(behavior);
|
|
3545
3988
|
}
|
|
3546
3989
|
}), [
|
|
3547
|
-
scrollToBottom
|
|
3548
|
-
scrollerRef.current
|
|
3990
|
+
scrollToBottom
|
|
3549
3991
|
]);
|
|
3550
3992
|
useImperativeHandle(forwardedRef, () => controller, [
|
|
3551
3993
|
controller
|
|
3552
3994
|
]);
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
return;
|
|
3556
|
-
}
|
|
3557
|
-
return combine(
|
|
3558
|
-
// Check if user scrolls.
|
|
3559
|
-
addEventListener2(scrollerRef.current, "wheel", () => {
|
|
3560
|
-
setPinned(isBottom(scrollerRef.current));
|
|
3561
|
-
}),
|
|
3562
|
-
// Check if scrolls.
|
|
3563
|
-
addEventListener2(scrollerRef.current, "scroll", () => {
|
|
3564
|
-
setOverflow((scrollerRef.current?.scrollTop ?? 0) > 0);
|
|
3565
|
-
})
|
|
3566
|
-
);
|
|
3995
|
+
const setViewport = useCallback12((el) => {
|
|
3996
|
+
scrollerRef.current = el;
|
|
3567
3997
|
}, []);
|
|
3568
|
-
return /* @__PURE__ */
|
|
3998
|
+
return /* @__PURE__ */ React39.createElement(ScrollContainerProvider, {
|
|
3569
3999
|
pinned,
|
|
4000
|
+
overflow,
|
|
3570
4001
|
controller,
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
},
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
},
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
});
|
|
3590
|
-
Root6.displayName = "ScrollContainer.Root";
|
|
4002
|
+
setViewport,
|
|
4003
|
+
setPinned,
|
|
4004
|
+
setOverflow
|
|
4005
|
+
}, children);
|
|
4006
|
+
});
|
|
4007
|
+
Root10.displayName = "ScrollContainer.Root";
|
|
4008
|
+
var Content6 = composable6(({ children, thin, padding, centered, ...props }, forwardedRef) => {
|
|
4009
|
+
return /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
4010
|
+
...composableProps13(props, {
|
|
4011
|
+
classNames: "relative"
|
|
4012
|
+
}),
|
|
4013
|
+
thin,
|
|
4014
|
+
padding,
|
|
4015
|
+
centered,
|
|
4016
|
+
ref: forwardedRef
|
|
4017
|
+
}, children);
|
|
4018
|
+
});
|
|
4019
|
+
Content6.displayName = "ScrollContainer.Content";
|
|
3591
4020
|
var VIEWPORT_NAME = "ScrollContainer.Viewport";
|
|
3592
|
-
var Viewport =
|
|
3593
|
-
const
|
|
3594
|
-
const
|
|
3595
|
-
|
|
3596
|
-
|
|
4021
|
+
var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
4022
|
+
const scrollerRef = useRef6(null);
|
|
4023
|
+
const mergedRef = useMergeRefs([
|
|
4024
|
+
forwardedRef,
|
|
4025
|
+
scrollerRef
|
|
4026
|
+
]);
|
|
4027
|
+
const { setViewport, setPinned, setOverflow } = useScrollContainerContext(VIEWPORT_NAME);
|
|
4028
|
+
useEffect8(() => {
|
|
4029
|
+
const el = scrollerRef.current;
|
|
4030
|
+
if (!el) {
|
|
3597
4031
|
return;
|
|
3598
4032
|
}
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
resizeObserver.observe(contentRef.current);
|
|
3602
|
-
return () => resizeObserver.disconnect();
|
|
4033
|
+
setViewport(el);
|
|
4034
|
+
return combine(addEventListener2(el, "wheel", () => setPinned(isBottom(el))), addEventListener2(el, "scroll", () => setOverflow((el.scrollTop ?? 0) > 0)), () => setViewport(null));
|
|
3603
4035
|
}, [
|
|
3604
|
-
|
|
3605
|
-
|
|
4036
|
+
setViewport,
|
|
4037
|
+
setPinned,
|
|
4038
|
+
setOverflow
|
|
3606
4039
|
]);
|
|
3607
|
-
return /* @__PURE__ */
|
|
3608
|
-
|
|
3609
|
-
...props,
|
|
3610
|
-
ref:
|
|
3611
|
-
}, children)
|
|
4040
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
4041
|
+
asChild,
|
|
4042
|
+
...composableProps13(props),
|
|
4043
|
+
ref: mergedRef
|
|
4044
|
+
}, children), /* @__PURE__ */ React39.createElement(PinEffect, {
|
|
4045
|
+
scrollerRef
|
|
4046
|
+
}));
|
|
3612
4047
|
});
|
|
3613
4048
|
Viewport.displayName = VIEWPORT_NAME;
|
|
4049
|
+
var PIN_EFFECT_NAME = "ScrollContainer.PinEffect";
|
|
4050
|
+
var PinEffect = ({ scrollerRef }) => {
|
|
4051
|
+
const { pinned, controller } = useScrollContainerContext(PIN_EFFECT_NAME);
|
|
4052
|
+
useEffect8(() => {
|
|
4053
|
+
const viewport = scrollerRef.current;
|
|
4054
|
+
if (!pinned || !viewport) {
|
|
4055
|
+
return;
|
|
4056
|
+
}
|
|
4057
|
+
controller?.scrollToBottom("instant");
|
|
4058
|
+
const resizeObserver = new ResizeObserver(() => controller?.scrollToBottom("smooth"));
|
|
4059
|
+
Array.from(viewport.children).forEach((child) => {
|
|
4060
|
+
resizeObserver.observe(child);
|
|
4061
|
+
});
|
|
4062
|
+
const mutationObserver = new MutationObserver((mutations) => {
|
|
4063
|
+
mutations.forEach((mutation) => {
|
|
4064
|
+
mutation.addedNodes.forEach((node) => {
|
|
4065
|
+
if (node instanceof Element) {
|
|
4066
|
+
resizeObserver.observe(node);
|
|
4067
|
+
}
|
|
4068
|
+
});
|
|
4069
|
+
});
|
|
4070
|
+
controller?.scrollToBottom("smooth");
|
|
4071
|
+
});
|
|
4072
|
+
mutationObserver.observe(viewport, {
|
|
4073
|
+
childList: true
|
|
4074
|
+
});
|
|
4075
|
+
return () => {
|
|
4076
|
+
resizeObserver.disconnect();
|
|
4077
|
+
mutationObserver.disconnect();
|
|
4078
|
+
};
|
|
4079
|
+
}, [
|
|
4080
|
+
pinned,
|
|
4081
|
+
controller,
|
|
4082
|
+
scrollerRef
|
|
4083
|
+
]);
|
|
4084
|
+
return null;
|
|
4085
|
+
};
|
|
4086
|
+
var FADE_NAME = "ScrollContainer.Fade";
|
|
4087
|
+
var Fade = () => {
|
|
4088
|
+
const { overflow } = useScrollContainerContext(FADE_NAME);
|
|
4089
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
4090
|
+
"data-visible": overflow,
|
|
4091
|
+
className: mx11(
|
|
4092
|
+
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
4093
|
+
"z-10 absolute top-0 inset-x-0 h-24 w-full",
|
|
4094
|
+
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
4095
|
+
"bg-gradient-to-b from-(--color-base-surface) to-transparent pointer-events-none"
|
|
4096
|
+
)
|
|
4097
|
+
});
|
|
4098
|
+
};
|
|
4099
|
+
Fade.displayName = FADE_NAME;
|
|
3614
4100
|
var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
3615
4101
|
var ScrollDownButton = ({ classNames }) => {
|
|
3616
|
-
const { pinned,
|
|
3617
|
-
return /* @__PURE__ */
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
}, /* @__PURE__ */ React36.createElement(IconButton, {
|
|
4102
|
+
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
4103
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
4104
|
+
className: mx11("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
4105
|
+
}, /* @__PURE__ */ React39.createElement(IconButton, {
|
|
3621
4106
|
variant: "primary",
|
|
3622
4107
|
icon: "ph--arrow-down--regular",
|
|
3623
4108
|
iconOnly: true,
|
|
3624
4109
|
size: 4,
|
|
3625
4110
|
label: "Scroll down",
|
|
3626
|
-
onClick: () => scrollToBottom()
|
|
4111
|
+
onClick: () => controller?.scrollToBottom()
|
|
3627
4112
|
}));
|
|
3628
4113
|
};
|
|
3629
4114
|
ScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
3630
4115
|
var ScrollContainer = {
|
|
3631
|
-
Root:
|
|
4116
|
+
Root: Root10,
|
|
4117
|
+
Content: Content6,
|
|
3632
4118
|
Viewport,
|
|
4119
|
+
Fade,
|
|
3633
4120
|
ScrollDownButton
|
|
3634
4121
|
};
|
|
3635
4122
|
|
|
3636
4123
|
// src/components/Select/Select.tsx
|
|
3637
4124
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3638
|
-
import
|
|
4125
|
+
import React40, { forwardRef as forwardRef25 } from "react";
|
|
3639
4126
|
var SelectRoot = SelectPrimitive.Root;
|
|
3640
4127
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3641
4128
|
var SelectValue = SelectPrimitive.Value;
|
|
3642
4129
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3643
4130
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3644
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
3645
|
-
return /* @__PURE__ */
|
|
4131
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
4132
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Trigger, {
|
|
3646
4133
|
asChild: true,
|
|
3647
4134
|
ref: forwardedRef
|
|
3648
|
-
}, /* @__PURE__ */
|
|
4135
|
+
}, /* @__PURE__ */ React40.createElement(Button, props, /* @__PURE__ */ React40.createElement(SelectPrimitive.Value, {
|
|
3649
4136
|
placeholder
|
|
3650
|
-
}, children), /* @__PURE__ */
|
|
4137
|
+
}, children), /* @__PURE__ */ React40.createElement("span", {
|
|
3651
4138
|
className: "w-1 flex-1"
|
|
3652
|
-
}), /* @__PURE__ */
|
|
4139
|
+
}), /* @__PURE__ */ React40.createElement(SelectPrimitive.Icon, {
|
|
3653
4140
|
asChild: true
|
|
3654
|
-
}, /* @__PURE__ */
|
|
4141
|
+
}, /* @__PURE__ */ React40.createElement(Icon, {
|
|
3655
4142
|
size: 3,
|
|
3656
4143
|
icon: "ph--caret-down--bold"
|
|
3657
4144
|
}))));
|
|
3658
4145
|
});
|
|
3659
|
-
var SelectContent = /* @__PURE__ */
|
|
4146
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
3660
4147
|
const { tx } = useThemeContext();
|
|
3661
4148
|
const elevation = useElevationContext();
|
|
3662
4149
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3663
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Content, {
|
|
3664
4151
|
...props,
|
|
3665
4152
|
"data-arrow-keys": "up down",
|
|
3666
4153
|
collisionPadding: safeCollisionPadding,
|
|
@@ -3671,78 +4158,78 @@ var SelectContent = /* @__PURE__ */ forwardRef28(({ classNames, children, collis
|
|
|
3671
4158
|
ref: forwardedRef
|
|
3672
4159
|
}, children);
|
|
3673
4160
|
});
|
|
3674
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
4161
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3675
4162
|
const { tx } = useThemeContext();
|
|
3676
|
-
return /* @__PURE__ */
|
|
4163
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3677
4164
|
...props,
|
|
3678
4165
|
className: tx("select.scrollButton", {}, classNames),
|
|
3679
4166
|
ref: forwardedRef
|
|
3680
|
-
}, children ?? /* @__PURE__ */
|
|
4167
|
+
}, children ?? /* @__PURE__ */ React40.createElement(Icon, {
|
|
3681
4168
|
size: 3,
|
|
3682
4169
|
icon: "ph--caret-up--bold"
|
|
3683
4170
|
}));
|
|
3684
4171
|
});
|
|
3685
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
4172
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3686
4173
|
const { tx } = useThemeContext();
|
|
3687
|
-
return /* @__PURE__ */
|
|
4174
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3688
4175
|
...props,
|
|
3689
4176
|
className: tx("select.scrollButton", {}, classNames),
|
|
3690
4177
|
ref: forwardedRef
|
|
3691
|
-
}, children ?? /* @__PURE__ */
|
|
4178
|
+
}, children ?? /* @__PURE__ */ React40.createElement(Icon, {
|
|
3692
4179
|
size: 3,
|
|
3693
4180
|
icon: "ph--caret-down--bold"
|
|
3694
4181
|
}));
|
|
3695
4182
|
});
|
|
3696
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
4183
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3697
4184
|
const { tx } = useThemeContext();
|
|
3698
|
-
return /* @__PURE__ */
|
|
4185
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectViewport, {
|
|
3699
4186
|
...props,
|
|
3700
4187
|
className: tx("select.viewport", {}, classNames),
|
|
3701
4188
|
ref: forwardedRef
|
|
3702
4189
|
}, children);
|
|
3703
4190
|
});
|
|
3704
|
-
var SelectItem = /* @__PURE__ */
|
|
4191
|
+
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3705
4192
|
const { tx } = useThemeContext();
|
|
3706
|
-
return /* @__PURE__ */
|
|
4193
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Item, {
|
|
3707
4194
|
...props,
|
|
3708
4195
|
className: tx("select.item", {}, classNames),
|
|
3709
4196
|
ref: forwardedRef
|
|
3710
4197
|
});
|
|
3711
4198
|
});
|
|
3712
4199
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3713
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
4200
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3714
4201
|
const { tx } = useThemeContext();
|
|
3715
|
-
return /* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.ItemIndicator, {
|
|
3716
4203
|
...props,
|
|
3717
4204
|
className: tx("select.itemIndicator", {}, classNames),
|
|
3718
4205
|
ref: forwardedRef
|
|
3719
4206
|
}, children);
|
|
3720
4207
|
});
|
|
3721
|
-
var SelectOption = /* @__PURE__ */
|
|
4208
|
+
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
3722
4209
|
const { tx } = useThemeContext();
|
|
3723
|
-
return /* @__PURE__ */
|
|
4210
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Item, {
|
|
3724
4211
|
...props,
|
|
3725
4212
|
className: tx("select.item", {}, classNames),
|
|
3726
4213
|
ref: forwardedRef
|
|
3727
|
-
}, /* @__PURE__ */
|
|
4214
|
+
}, /* @__PURE__ */ React40.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React40.createElement("span", {
|
|
3728
4215
|
className: "grow w-1"
|
|
3729
|
-
}), /* @__PURE__ */
|
|
4216
|
+
}), /* @__PURE__ */ React40.createElement(Icon, {
|
|
3730
4217
|
icon: "ph--check--regular"
|
|
3731
4218
|
}));
|
|
3732
4219
|
});
|
|
3733
4220
|
var SelectGroup = SelectPrimitive.Group;
|
|
3734
4221
|
var SelectLabel = SelectPrimitive.Label;
|
|
3735
|
-
var SelectSeparator = /* @__PURE__ */
|
|
4222
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3736
4223
|
const { tx } = useThemeContext();
|
|
3737
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Separator, {
|
|
3738
4225
|
...props,
|
|
3739
4226
|
className: tx("select.separator", {}, classNames),
|
|
3740
4227
|
ref: forwardedRef
|
|
3741
4228
|
});
|
|
3742
4229
|
});
|
|
3743
|
-
var SelectArrow = /* @__PURE__ */
|
|
4230
|
+
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3744
4231
|
const { tx } = useThemeContext();
|
|
3745
|
-
return /* @__PURE__ */
|
|
4232
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Arrow, {
|
|
3746
4233
|
...props,
|
|
3747
4234
|
className: tx("select.arrow", {}, classNames),
|
|
3748
4235
|
ref: forwardedRef
|
|
@@ -3770,10 +4257,10 @@ var Select = {
|
|
|
3770
4257
|
};
|
|
3771
4258
|
|
|
3772
4259
|
// src/components/Skeleton/Skeleton.tsx
|
|
3773
|
-
import
|
|
3774
|
-
var Skeleton = /* @__PURE__ */
|
|
4260
|
+
import React41, { forwardRef as forwardRef26 } from "react";
|
|
4261
|
+
var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default", ...props }, forwardedRef) => {
|
|
3775
4262
|
const { tx } = useThemeContext();
|
|
3776
|
-
return /* @__PURE__ */
|
|
4263
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
|
3777
4264
|
...props,
|
|
3778
4265
|
className: tx("skeleton.root", {
|
|
3779
4266
|
variant
|
|
@@ -3784,50 +4271,47 @@ var Skeleton = /* @__PURE__ */ forwardRef29(({ classNames, variant = "default",
|
|
|
3784
4271
|
|
|
3785
4272
|
// src/components/Splitter/Splitter.tsx
|
|
3786
4273
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
3787
|
-
import { Primitive as
|
|
3788
|
-
import { Slot as
|
|
3789
|
-
import
|
|
4274
|
+
import { Primitive as Primitive21 } from "@radix-ui/react-primitive";
|
|
4275
|
+
import { Slot as Slot21 } from "@radix-ui/react-slot";
|
|
4276
|
+
import React42 from "react";
|
|
4277
|
+
import { composableProps as composableProps14, slottable as slottable11 } from "@dxos/ui-theme";
|
|
3790
4278
|
var SPLITTER_NAME = "Splitter";
|
|
3791
4279
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
3792
4280
|
var [SplitterProvider, useSplitterContext] = createSplitterContext(SPLITTER_NAME);
|
|
3793
4281
|
var ROOT_NAME = "Splitter.Root";
|
|
3794
|
-
var
|
|
4282
|
+
var Root12 = slottable11(({ asChild, mode = "top", ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {
|
|
3795
4283
|
const { tx } = useThemeContext();
|
|
3796
|
-
const
|
|
3797
|
-
|
|
4284
|
+
const { __scopeSplitter, ...rest } = props;
|
|
4285
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
4286
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
4287
|
+
return /* @__PURE__ */ React42.createElement(SplitterProvider, {
|
|
3798
4288
|
scope: __scopeSplitter,
|
|
3799
4289
|
mode,
|
|
3800
4290
|
ratio,
|
|
3801
4291
|
transition
|
|
3802
|
-
}, /* @__PURE__ */
|
|
3803
|
-
|
|
3804
|
-
...rootProps,
|
|
4292
|
+
}, /* @__PURE__ */ React42.createElement(Comp, {
|
|
4293
|
+
...restProps,
|
|
3805
4294
|
ref: forwardedRef,
|
|
3806
|
-
className: tx("splitter.root", {},
|
|
3807
|
-
className,
|
|
3808
|
-
classNames
|
|
3809
|
-
])
|
|
4295
|
+
className: tx("splitter.root", {}, className)
|
|
3810
4296
|
}, children));
|
|
3811
4297
|
});
|
|
3812
|
-
|
|
4298
|
+
Root12.displayName = ROOT_NAME;
|
|
3813
4299
|
var PANEL_NAME = "Splitter.Panel";
|
|
3814
|
-
var Panel2 =
|
|
3815
|
-
const {
|
|
3816
|
-
const {
|
|
3817
|
-
const Comp = asChild ?
|
|
3818
|
-
const
|
|
3819
|
-
const
|
|
3820
|
-
const
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
4300
|
+
var Panel2 = slottable11(({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
4301
|
+
const { tx } = useThemeContext();
|
|
4302
|
+
const { __scopeSplitter, ...rest } = props;
|
|
4303
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
4304
|
+
const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
4305
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
4306
|
+
const isTopPanel = position === "top";
|
|
4307
|
+
const topOffset = isTopPanel ? "0%" : mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%`;
|
|
4308
|
+
const height = isTopPanel ? mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%` : mode === "bottom" ? "100%" : mode === "top" ? "0%" : `${(1 - ratio) * 100}%`;
|
|
4309
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4310
|
+
...restProps,
|
|
3824
4311
|
ref: forwardedRef,
|
|
3825
|
-
className: tx("splitter.panel", {},
|
|
3826
|
-
className,
|
|
3827
|
-
classNames
|
|
3828
|
-
]),
|
|
4312
|
+
className: tx("splitter.panel", {}, className),
|
|
3829
4313
|
style: {
|
|
3830
|
-
top,
|
|
4314
|
+
top: topOffset,
|
|
3831
4315
|
height,
|
|
3832
4316
|
transition: `top ${transition}ms, height ${transition}ms ease-out`,
|
|
3833
4317
|
...style
|
|
@@ -3836,18 +4320,18 @@ var Panel2 = /* @__PURE__ */ forwardRef30(({ __scopeSplitter, classNames, classN
|
|
|
3836
4320
|
});
|
|
3837
4321
|
Panel2.displayName = PANEL_NAME;
|
|
3838
4322
|
var Splitter = {
|
|
3839
|
-
Root:
|
|
4323
|
+
Root: Root12,
|
|
3840
4324
|
Panel: Panel2
|
|
3841
4325
|
};
|
|
3842
4326
|
|
|
3843
4327
|
// src/components/Tag/Tag.tsx
|
|
3844
|
-
import { Primitive as
|
|
3845
|
-
import { Slot as
|
|
3846
|
-
import
|
|
3847
|
-
var Tag = /* @__PURE__ */
|
|
4328
|
+
import { Primitive as Primitive22 } from "@radix-ui/react-primitive";
|
|
4329
|
+
import { Slot as Slot22 } from "@radix-ui/react-slot";
|
|
4330
|
+
import React43, { forwardRef as forwardRef27 } from "react";
|
|
4331
|
+
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
3848
4332
|
const { tx } = useThemeContext();
|
|
3849
|
-
const Comp = asChild ?
|
|
3850
|
-
return /* @__PURE__ */
|
|
4333
|
+
const Comp = asChild ? Slot22 : Primitive22.span;
|
|
4334
|
+
return /* @__PURE__ */ React43.createElement(Comp, {
|
|
3851
4335
|
...props,
|
|
3852
4336
|
className: tx("tag.root", {
|
|
3853
4337
|
palette
|
|
@@ -3858,66 +4342,67 @@ var Tag = /* @__PURE__ */ forwardRef31(({ asChild, palette = "neutral", classNam
|
|
|
3858
4342
|
});
|
|
3859
4343
|
|
|
3860
4344
|
// src/components/Toast/Toast.tsx
|
|
3861
|
-
import { Primitive as
|
|
3862
|
-
import { Slot as
|
|
3863
|
-
import
|
|
3864
|
-
import
|
|
3865
|
-
var ToastProvider =
|
|
3866
|
-
var ToastViewport = /* @__PURE__ */
|
|
4345
|
+
import { Primitive as Primitive23 } from "@radix-ui/react-primitive";
|
|
4346
|
+
import { Slot as Slot23 } from "@radix-ui/react-slot";
|
|
4347
|
+
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
4348
|
+
import React44, { forwardRef as forwardRef28 } from "react";
|
|
4349
|
+
var ToastProvider = ToastPrimitive.Provider;
|
|
4350
|
+
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
3867
4351
|
const { tx } = useThemeContext();
|
|
3868
|
-
return /* @__PURE__ */
|
|
4352
|
+
return /* @__PURE__ */ React44.createElement(ToastPrimitive.Viewport, {
|
|
4353
|
+
...props,
|
|
3869
4354
|
className: tx("toast.viewport", {}, classNames),
|
|
3870
4355
|
ref: forwardedRef
|
|
3871
4356
|
});
|
|
3872
4357
|
});
|
|
3873
|
-
var ToastRoot = /* @__PURE__ */
|
|
4358
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
3874
4359
|
const { tx } = useThemeContext();
|
|
3875
|
-
return /* @__PURE__ */
|
|
4360
|
+
return /* @__PURE__ */ React44.createElement(ToastPrimitive.Root, {
|
|
3876
4361
|
...props,
|
|
3877
4362
|
className: tx("toast.root", {}, classNames),
|
|
3878
4363
|
ref: forwardedRef
|
|
3879
|
-
}, /* @__PURE__ */
|
|
4364
|
+
}, /* @__PURE__ */ React44.createElement(ElevationProvider, {
|
|
3880
4365
|
elevation: "toast"
|
|
3881
4366
|
}, children));
|
|
3882
4367
|
});
|
|
3883
|
-
var ToastBody = /* @__PURE__ */
|
|
4368
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3884
4369
|
const { tx } = useThemeContext();
|
|
3885
|
-
const Comp = asChild ?
|
|
3886
|
-
return /* @__PURE__ */
|
|
4370
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4371
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
3887
4372
|
...props,
|
|
3888
4373
|
className: tx("toast.body", {}, classNames),
|
|
3889
4374
|
ref: forwardedRef
|
|
3890
4375
|
});
|
|
3891
4376
|
});
|
|
3892
|
-
var ToastTitle = /* @__PURE__ */
|
|
4377
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3893
4378
|
const { tx } = useThemeContext();
|
|
3894
|
-
const Comp = asChild ?
|
|
3895
|
-
return /* @__PURE__ */
|
|
4379
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Title;
|
|
4380
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
3896
4381
|
...props,
|
|
3897
4382
|
className: tx("toast.title", {}, classNames),
|
|
3898
4383
|
ref: forwardedRef
|
|
3899
4384
|
});
|
|
3900
4385
|
});
|
|
3901
|
-
var ToastDescription = /* @__PURE__ */
|
|
4386
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3902
4387
|
const { tx } = useThemeContext();
|
|
3903
|
-
const Comp = asChild ?
|
|
3904
|
-
return /* @__PURE__ */
|
|
4388
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Description;
|
|
4389
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
3905
4390
|
...props,
|
|
3906
4391
|
className: tx("toast.description", {}, classNames),
|
|
3907
4392
|
ref: forwardedRef
|
|
3908
4393
|
});
|
|
3909
4394
|
});
|
|
3910
|
-
var ToastActions = /* @__PURE__ */
|
|
4395
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3911
4396
|
const { tx } = useThemeContext();
|
|
3912
|
-
const Comp = asChild ?
|
|
3913
|
-
return /* @__PURE__ */
|
|
4397
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4398
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
3914
4399
|
...props,
|
|
3915
4400
|
className: tx("toast.actions", {}, classNames),
|
|
3916
4401
|
ref: forwardedRef
|
|
3917
4402
|
});
|
|
3918
4403
|
});
|
|
3919
|
-
var ToastAction =
|
|
3920
|
-
var ToastClose =
|
|
4404
|
+
var ToastAction = ToastPrimitive.Action;
|
|
4405
|
+
var ToastClose = ToastPrimitive.Close;
|
|
3921
4406
|
var Toast = {
|
|
3922
4407
|
Provider: ToastProvider,
|
|
3923
4408
|
Viewport: ToastViewport,
|
|
@@ -3938,8 +4423,10 @@ export {
|
|
|
3938
4423
|
ButtonGroup,
|
|
3939
4424
|
Callout,
|
|
3940
4425
|
Card,
|
|
4426
|
+
Carousel,
|
|
3941
4427
|
Clipboard,
|
|
3942
4428
|
Column,
|
|
4429
|
+
Container,
|
|
3943
4430
|
ContextMenu2 as ContextMenu,
|
|
3944
4431
|
DensityContext,
|
|
3945
4432
|
DensityProvider,
|
|
@@ -3951,6 +4438,7 @@ export {
|
|
|
3951
4438
|
ErrorFallback,
|
|
3952
4439
|
ErrorStack,
|
|
3953
4440
|
Flex,
|
|
4441
|
+
Focus,
|
|
3954
4442
|
Grid,
|
|
3955
4443
|
Icon,
|
|
3956
4444
|
IconButton,
|
|
@@ -3962,6 +4450,7 @@ export {
|
|
|
3962
4450
|
List,
|
|
3963
4451
|
ListItem,
|
|
3964
4452
|
Main,
|
|
4453
|
+
MediaPlayer,
|
|
3965
4454
|
Message,
|
|
3966
4455
|
Panel,
|
|
3967
4456
|
Popover,
|
|
@@ -3972,6 +4461,8 @@ export {
|
|
|
3972
4461
|
Skeleton,
|
|
3973
4462
|
Splitter,
|
|
3974
4463
|
Status,
|
|
4464
|
+
TREEGRID_PARENT_OF_SEPARATOR,
|
|
4465
|
+
TREEGRID_PATH_SEPARATOR,
|
|
3975
4466
|
Tag,
|
|
3976
4467
|
ThemeContext,
|
|
3977
4468
|
ThemeProvider,
|
|
@@ -3981,7 +4472,7 @@ export {
|
|
|
3981
4472
|
ToggleGroup,
|
|
3982
4473
|
ToggleGroupIconItem,
|
|
3983
4474
|
ToggleGroupItem,
|
|
3984
|
-
|
|
4475
|
+
Toolbar,
|
|
3985
4476
|
Tooltip,
|
|
3986
4477
|
Trans,
|
|
3987
4478
|
Tree,
|
|
@@ -3991,18 +4482,23 @@ export {
|
|
|
3991
4482
|
createPopoverScope,
|
|
3992
4483
|
createSplitterScope,
|
|
3993
4484
|
createTooltipScope,
|
|
4485
|
+
detectMediaKind,
|
|
3994
4486
|
hasIosKeyboard,
|
|
3995
4487
|
initialSafeArea,
|
|
4488
|
+
isEmbedUrl,
|
|
3996
4489
|
isLabel,
|
|
3997
4490
|
messageIcons,
|
|
4491
|
+
parseCaptureOwnerStack,
|
|
3998
4492
|
toLocalizedString,
|
|
3999
4493
|
useAvatarContext,
|
|
4000
4494
|
useButtonGroupContext,
|
|
4495
|
+
useCarousel,
|
|
4001
4496
|
useClipboard,
|
|
4002
4497
|
useDensityContext,
|
|
4003
4498
|
useDropdownMenuContext,
|
|
4004
4499
|
useDropdownMenuMenuScope,
|
|
4005
4500
|
useElevationContext,
|
|
4501
|
+
useFocus,
|
|
4006
4502
|
useIconHref,
|
|
4007
4503
|
useLandmarkMover,
|
|
4008
4504
|
useListContext,
|
|
@@ -4010,6 +4506,7 @@ export {
|
|
|
4010
4506
|
useMainContext,
|
|
4011
4507
|
usePx,
|
|
4012
4508
|
useSafeArea,
|
|
4509
|
+
useSafeCollisionPadding,
|
|
4013
4510
|
useScrollContainerContext,
|
|
4014
4511
|
useSidebars,
|
|
4015
4512
|
useThemeContext,
|