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