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