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