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