@dxos/react-ui 0.8.4-main.3f58842 → 0.8.4-main.548089c
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-2COVUP44.mjs → chunk-YG7RAH7A.mjs} +313 -143
- package/dist/lib/browser/chunk-YG7RAH7A.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -1
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +54 -26
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-GHXHND5V.mjs → chunk-FL2ZT5KB.mjs} +313 -143
- package/dist/lib/node-esm/chunk-FL2ZT5KB.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -1
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +54 -26
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- 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 +5 -31
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +5 -11
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -20
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.d.ts +1 -1
- package/dist/types/src/components/Buttons/Button.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +9 -4
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +2 -3
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +6 -15
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +5 -11
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +7 -8
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +7 -19
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +7 -39
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +6 -29
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +17 -0
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +2 -4
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +10 -11
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts +8 -8
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.d.ts +2 -2
- package/dist/types/src/components/Lists/List.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.stories.d.ts +8 -31
- package/dist/types/src/components/Lists/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.d.ts +1 -1
- package/dist/types/src/components/Lists/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts +6 -32
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.d.ts +1 -1
- package/dist/types/src/components/Lists/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +6 -4
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +10 -19
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +6 -7
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +6 -44
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +6 -5
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +6 -41
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +7 -16
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +2 -2
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +6 -34
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +6 -32
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +4 -9
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +2 -8
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +12 -12
- 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/TranslationsProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +6 -44
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +12 -12
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +6 -50
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -4
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +8 -61
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts +2 -2
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +5 -9
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +12 -4
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +5 -11
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/index.d.ts +2 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts +15 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts +3 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/domino.d.ts +18 -0
- package/dist/types/src/util/domino.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts +8 -0
- package/dist/types/src/util/usePx.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +23 -22
- package/src/components/Avatars/Avatar.stories.tsx +19 -10
- package/src/components/Avatars/Avatar.tsx +3 -3
- package/src/components/Avatars/AvatarGroup.stories.tsx +10 -6
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +16 -11
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/Buttons/Button.stories.tsx +8 -9
- package/src/components/Buttons/IconButton.stories.tsx +11 -8
- package/src/components/Buttons/IconButton.tsx +15 -14
- package/src/components/Buttons/Toggle.stories.tsx +10 -7
- package/src/components/Buttons/ToggleGroup.stories.tsx +10 -7
- package/src/components/Buttons/ToggleGroup.tsx +17 -4
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +2 -1
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/Dialogs/AlertDialog.stories.tsx +14 -11
- package/src/components/Dialogs/AlertDialog.tsx +13 -13
- package/src/components/Dialogs/Dialog.stories.tsx +16 -14
- package/src/components/Dialogs/Dialog.tsx +13 -13
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +12 -14
- package/src/components/Input/Input.tsx +16 -16
- package/src/components/Link/Link.stories.tsx +10 -6
- package/src/components/Lists/List.stories.tsx +16 -14
- package/src/components/Lists/List.tsx +16 -12
- package/src/components/Lists/Tree.stories.tsx +11 -8
- package/src/components/Lists/Tree.tsx +4 -3
- package/src/components/Lists/TreeDropIndicator.tsx +1 -1
- package/src/components/Lists/Treegrid.stories.tsx +12 -6
- package/src/components/Lists/Treegrid.tsx +58 -17
- package/src/components/Main/Main.stories.tsx +16 -8
- package/src/components/Main/Main.tsx +43 -28
- package/src/components/Menus/ContextMenu.stories.tsx +11 -8
- package/src/components/Menus/ContextMenu.tsx +1 -0
- package/src/components/Menus/DropdownMenu.stories.tsx +11 -8
- package/src/components/Menus/DropdownMenu.tsx +41 -14
- package/src/components/Message/Message.stories.tsx +11 -7
- package/src/components/Message/Message.tsx +1 -1
- package/src/components/Popover/Popover.stories.tsx +11 -8
- package/src/components/Popover/Popover.tsx +29 -12
- package/src/components/ScrollArea/ScrollArea.stories.tsx +11 -8
- package/src/components/ScrollArea/ScrollArea.tsx +4 -4
- package/src/components/Select/Select.stories.tsx +15 -12
- package/src/components/Select/Select.tsx +6 -5
- package/src/components/Status/Status.stories.tsx +9 -6
- package/src/components/Tag/Tag.stories.tsx +18 -9
- package/src/components/ThemeProvider/ThemeProvider.tsx +3 -2
- package/src/components/ThemeProvider/TranslationsProvider.tsx +3 -3
- package/src/components/Toast/Toast.stories.tsx +11 -8
- package/src/components/Toast/Toast.tsx +9 -9
- package/src/components/Toolbar/Toolbar.stories.tsx +13 -11
- package/src/components/Toolbar/Toolbar.tsx +19 -7
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -11
- package/src/components/Tooltip/Tooltip.tsx +5 -4
- package/src/hooks/useSafeArea.ts +3 -2
- package/src/hooks/useVisualViewport.ts +4 -4
- package/src/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +12 -8
- package/src/playground/Custom.stories.tsx +13 -24
- package/src/playground/Typography.stories.tsx +8 -6
- package/src/testing/decorators/index.ts +2 -1
- package/src/testing/decorators/withLayout.tsx +56 -0
- package/src/testing/decorators/withSurfaceVariantsLayout.tsx +1 -1
- package/src/testing/decorators/withTheme.tsx +31 -0
- package/src/util/domino.ts +53 -0
- package/src/util/index.ts +2 -0
- package/src/util/usePx.ts +61 -0
- package/dist/lib/browser/chunk-2COVUP44.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GHXHND5V.mjs.map +0 -7
- package/src/testing/decorators/withTheme.ts +0 -25
|
@@ -31,7 +31,7 @@ var useIconHref = (icon) => {
|
|
|
31
31
|
|
|
32
32
|
// src/hooks/useSafeArea.ts
|
|
33
33
|
import { useCallback, useState } from "react";
|
|
34
|
-
import {
|
|
34
|
+
import { useViewportResize } from "@dxos/react-hooks";
|
|
35
35
|
var initialSafeArea = {
|
|
36
36
|
top: NaN,
|
|
37
37
|
right: NaN,
|
|
@@ -48,7 +48,7 @@ var useSafeArea = () => {
|
|
|
48
48
|
left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left"))
|
|
49
49
|
});
|
|
50
50
|
}, []);
|
|
51
|
-
|
|
51
|
+
useViewportResize(handleResize);
|
|
52
52
|
return padding;
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -59,7 +59,7 @@ import { useContext as useContext4 } from "react";
|
|
|
59
59
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
60
60
|
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
61
61
|
import i18Next from "i18next";
|
|
62
|
-
import React, {
|
|
62
|
+
import React, { Suspense, createContext, useContext as useContext3, useEffect, useState as useState2 } from "react";
|
|
63
63
|
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
64
64
|
var initialLng = "en-US";
|
|
65
65
|
var initialNs = "dxos-common";
|
|
@@ -130,7 +130,7 @@ var useTranslationsContext = () => useContext4(TranslationsContext);
|
|
|
130
130
|
|
|
131
131
|
// src/hooks/useVisualViewport.ts
|
|
132
132
|
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
133
|
-
import {
|
|
133
|
+
import { useViewportResize as useViewportResize2 } from "@dxos/react-hooks";
|
|
134
134
|
var useVisualViewport = (deps) => {
|
|
135
135
|
const [width, setWidth] = useState3(null);
|
|
136
136
|
const [height, setHeight] = useState3(null);
|
|
@@ -140,7 +140,7 @@ var useVisualViewport = (deps) => {
|
|
|
140
140
|
setHeight(window.visualViewport.height);
|
|
141
141
|
}
|
|
142
142
|
}, []);
|
|
143
|
-
|
|
143
|
+
useViewportResize2(handleResize, deps);
|
|
144
144
|
return {
|
|
145
145
|
width,
|
|
146
146
|
height
|
|
@@ -277,7 +277,7 @@ import React6, { forwardRef as forwardRef5 } from "react";
|
|
|
277
277
|
// src/components/Icon/Icon.tsx
|
|
278
278
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
279
279
|
import React4, { forwardRef as forwardRef3, memo } from "react";
|
|
280
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef3(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
280
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef3(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
|
|
281
281
|
var _effect = _useSignals4();
|
|
282
282
|
try {
|
|
283
283
|
const { tx } = useThemeContext();
|
|
@@ -1107,7 +1107,21 @@ var Tooltip = {
|
|
|
1107
1107
|
};
|
|
1108
1108
|
|
|
1109
1109
|
// src/components/Buttons/IconButton.tsx
|
|
1110
|
-
var
|
|
1110
|
+
var IconButton = /* @__PURE__ */ forwardRef8((props, forwardedRef) => {
|
|
1111
|
+
var _effect = _useSignals9();
|
|
1112
|
+
try {
|
|
1113
|
+
return props.iconOnly ? /* @__PURE__ */ React9.createElement(IconOnlyButton, {
|
|
1114
|
+
...props,
|
|
1115
|
+
ref: forwardedRef
|
|
1116
|
+
}) : /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1117
|
+
...props,
|
|
1118
|
+
ref: forwardedRef
|
|
1119
|
+
});
|
|
1120
|
+
} finally {
|
|
1121
|
+
_effect.f();
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
var IconOnlyButton = /* @__PURE__ */ forwardRef8(({ noTooltip, tooltipSide, ...props }, forwardedRef) => {
|
|
1111
1125
|
var _effect = _useSignals9();
|
|
1112
1126
|
try {
|
|
1113
1127
|
if (noTooltip) {
|
|
@@ -1128,7 +1142,7 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef8(({ noTooltip, tooltipPortal = t
|
|
|
1128
1142
|
_effect.f();
|
|
1129
1143
|
}
|
|
1130
1144
|
});
|
|
1131
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
1145
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size = 5, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
1132
1146
|
var _effect = _useSignals9();
|
|
1133
1147
|
try {
|
|
1134
1148
|
const { tx } = useThemeContext();
|
|
@@ -1138,7 +1152,7 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, la
|
|
|
1138
1152
|
iconOnly
|
|
1139
1153
|
}, classNames),
|
|
1140
1154
|
ref: forwardedRef
|
|
1141
|
-
}, /* @__PURE__ */ React9.createElement(Icon, {
|
|
1155
|
+
}, icon && /* @__PURE__ */ React9.createElement(Icon, {
|
|
1142
1156
|
icon,
|
|
1143
1157
|
size,
|
|
1144
1158
|
classNames: iconClassNames
|
|
@@ -1152,20 +1166,6 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, la
|
|
|
1152
1166
|
_effect.f();
|
|
1153
1167
|
}
|
|
1154
1168
|
});
|
|
1155
|
-
var IconButton = /* @__PURE__ */ forwardRef8((props, forwardedRef) => {
|
|
1156
|
-
var _effect = _useSignals9();
|
|
1157
|
-
try {
|
|
1158
|
-
return props.iconOnly ? /* @__PURE__ */ React9.createElement(IconOnlyButton, {
|
|
1159
|
-
...props,
|
|
1160
|
-
ref: forwardedRef
|
|
1161
|
-
}) : /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1162
|
-
...props,
|
|
1163
|
-
ref: forwardedRef
|
|
1164
|
-
});
|
|
1165
|
-
} finally {
|
|
1166
|
-
_effect.f();
|
|
1167
|
-
}
|
|
1168
|
-
});
|
|
1169
1169
|
|
|
1170
1170
|
// src/components/Buttons/Toggle.tsx
|
|
1171
1171
|
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
@@ -1190,7 +1190,7 @@ var Toggle = /* @__PURE__ */ forwardRef9(({ defaultPressed, pressed, onPressedCh
|
|
|
1190
1190
|
|
|
1191
1191
|
// src/components/Buttons/ToggleGroup.tsx
|
|
1192
1192
|
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
1193
|
-
import {
|
|
1193
|
+
import { ToggleGroupItem as ToggleGroupItemPrimitive, ToggleGroup as ToggleGroupPrimitive } from "@radix-ui/react-toggle-group";
|
|
1194
1194
|
import React11, { forwardRef as forwardRef10 } from "react";
|
|
1195
1195
|
var ToggleGroup = /* @__PURE__ */ forwardRef10(({ classNames, children, ...props }, forwardedRef) => {
|
|
1196
1196
|
var _effect = _useSignals11();
|
|
@@ -1225,6 +1225,26 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef10(({ variant, elevation, densit
|
|
|
1225
1225
|
_effect.f();
|
|
1226
1226
|
}
|
|
1227
1227
|
});
|
|
1228
|
+
var ToggleGroupIconItem = /* @__PURE__ */ forwardRef10(({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {
|
|
1229
|
+
var _effect = _useSignals11();
|
|
1230
|
+
try {
|
|
1231
|
+
return /* @__PURE__ */ React11.createElement(ToggleGroupItemPrimitive, {
|
|
1232
|
+
...props,
|
|
1233
|
+
asChild: true
|
|
1234
|
+
}, /* @__PURE__ */ React11.createElement(IconButton, {
|
|
1235
|
+
variant,
|
|
1236
|
+
elevation,
|
|
1237
|
+
density,
|
|
1238
|
+
classNames,
|
|
1239
|
+
label,
|
|
1240
|
+
icon,
|
|
1241
|
+
size,
|
|
1242
|
+
ref: forwardedRef
|
|
1243
|
+
}));
|
|
1244
|
+
} finally {
|
|
1245
|
+
_effect.f();
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1228
1248
|
|
|
1229
1249
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1230
1250
|
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
@@ -1257,18 +1277,103 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1257
1277
|
// src/components/Clipboard/CopyButton.tsx
|
|
1258
1278
|
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1259
1279
|
import React16 from "react";
|
|
1260
|
-
import { mx as
|
|
1280
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1261
1281
|
|
|
1262
1282
|
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
1263
1283
|
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1264
1284
|
import { createKeyborg } from "keyborg";
|
|
1265
|
-
import React15, { createContext as createContext7, useEffect as
|
|
1285
|
+
import React15, { createContext as createContext7, useEffect as useEffect4, useMemo as useMemo3 } from "react";
|
|
1286
|
+
|
|
1287
|
+
// src/util/domino.ts
|
|
1288
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
1289
|
+
var Domino = class _Domino {
|
|
1290
|
+
static of(tag) {
|
|
1291
|
+
return new _Domino(tag);
|
|
1292
|
+
}
|
|
1293
|
+
_el;
|
|
1294
|
+
constructor(tag) {
|
|
1295
|
+
this._el = document.createElement(tag);
|
|
1296
|
+
}
|
|
1297
|
+
classNames(...classNames) {
|
|
1298
|
+
this._el.className = mx2(classNames);
|
|
1299
|
+
return this;
|
|
1300
|
+
}
|
|
1301
|
+
text(value) {
|
|
1302
|
+
this._el.textContent = value;
|
|
1303
|
+
return this;
|
|
1304
|
+
}
|
|
1305
|
+
data(key, value) {
|
|
1306
|
+
this._el.dataset[key] = value;
|
|
1307
|
+
return this;
|
|
1308
|
+
}
|
|
1309
|
+
attributes(attr) {
|
|
1310
|
+
Object.entries(attr).filter(([_, value]) => value !== void 0).map(([key, value]) => this._el.setAttribute(key, value));
|
|
1311
|
+
return this;
|
|
1312
|
+
}
|
|
1313
|
+
style(styles) {
|
|
1314
|
+
Object.assign(this._el.style, styles);
|
|
1315
|
+
return this;
|
|
1316
|
+
}
|
|
1317
|
+
children(...children) {
|
|
1318
|
+
children.forEach((child) => this._el.appendChild(child.build()));
|
|
1319
|
+
return this;
|
|
1320
|
+
}
|
|
1321
|
+
on(event, handler) {
|
|
1322
|
+
this._el.addEventListener(event, handler);
|
|
1323
|
+
return this;
|
|
1324
|
+
}
|
|
1325
|
+
build() {
|
|
1326
|
+
return this._el;
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1266
1329
|
|
|
1267
1330
|
// src/util/hasIosKeyboard.ts
|
|
1268
1331
|
var hasIosKeyboard = () => {
|
|
1269
1332
|
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
1270
1333
|
};
|
|
1271
1334
|
|
|
1335
|
+
// src/util/usePx.ts
|
|
1336
|
+
import { useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo2, useState as useState6 } from "react";
|
|
1337
|
+
var getDocumentElementFontSize = () => parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
1338
|
+
var usePx = (rem) => {
|
|
1339
|
+
const [fontSize, setFontSize] = useState6(() => {
|
|
1340
|
+
if (typeof document !== "undefined") {
|
|
1341
|
+
return getDocumentElementFontSize();
|
|
1342
|
+
}
|
|
1343
|
+
return 16;
|
|
1344
|
+
});
|
|
1345
|
+
const updateFontSize = useCallback5(() => {
|
|
1346
|
+
setFontSize(getDocumentElementFontSize());
|
|
1347
|
+
}, []);
|
|
1348
|
+
useEffect3(() => {
|
|
1349
|
+
if (typeof document === "undefined") {
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
const resizeObserver = new ResizeObserver(updateFontSize);
|
|
1353
|
+
resizeObserver.observe(document.documentElement);
|
|
1354
|
+
const mediaQueryList = window.matchMedia("all");
|
|
1355
|
+
const handleMediaChange = () => {
|
|
1356
|
+
updateFontSize();
|
|
1357
|
+
};
|
|
1358
|
+
if (mediaQueryList.addEventListener) {
|
|
1359
|
+
mediaQueryList.addEventListener("change", handleMediaChange);
|
|
1360
|
+
} else {
|
|
1361
|
+
mediaQueryList.addListener(handleMediaChange);
|
|
1362
|
+
}
|
|
1363
|
+
return () => {
|
|
1364
|
+
resizeObserver.disconnect();
|
|
1365
|
+
if (mediaQueryList.removeEventListener) {
|
|
1366
|
+
mediaQueryList.removeEventListener("change", handleMediaChange);
|
|
1367
|
+
} else {
|
|
1368
|
+
mediaQueryList.removeListener(handleMediaChange);
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
}, []);
|
|
1372
|
+
return useMemo2(() => rem * fontSize, [
|
|
1373
|
+
fontSize
|
|
1374
|
+
]);
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1272
1377
|
// src/components/DensityProvider/DensityProvider.tsx
|
|
1273
1378
|
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1274
1379
|
import React13, { createContext as createContext5 } from "react";
|
|
@@ -1312,7 +1417,7 @@ var ThemeContext = /* @__PURE__ */ createContext7(void 0);
|
|
|
1312
1417
|
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
1313
1418
|
var _effect = _useSignals15();
|
|
1314
1419
|
try {
|
|
1315
|
-
|
|
1420
|
+
useEffect4(() => {
|
|
1316
1421
|
if (document.defaultView) {
|
|
1317
1422
|
const kb = createKeyborg(document.defaultView);
|
|
1318
1423
|
kb.subscribe(handleInputModalityChange);
|
|
@@ -1320,7 +1425,7 @@ var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx
|
|
|
1320
1425
|
}
|
|
1321
1426
|
}, []);
|
|
1322
1427
|
const safeAreaPadding = useSafeArea();
|
|
1323
|
-
const contextValue =
|
|
1428
|
+
const contextValue = useMemo3(() => ({
|
|
1324
1429
|
tx,
|
|
1325
1430
|
themeMode,
|
|
1326
1431
|
hasIosKeyboard: hasIosKeyboard(),
|
|
@@ -1373,7 +1478,7 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1373
1478
|
"data-testid": "copy-invitation"
|
|
1374
1479
|
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1375
1480
|
role: "none",
|
|
1376
|
-
className:
|
|
1481
|
+
className: mx3("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1377
1482
|
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1378
1483
|
className: "pli-1"
|
|
1379
1484
|
}, t("copy label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
@@ -1381,7 +1486,7 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1381
1486
|
size
|
|
1382
1487
|
})), /* @__PURE__ */ React16.createElement("div", {
|
|
1383
1488
|
role: "none",
|
|
1384
|
-
className:
|
|
1489
|
+
className: mx3("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1385
1490
|
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1386
1491
|
className: "pli-1"
|
|
1387
1492
|
}, t("copy success label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
@@ -1428,7 +1533,7 @@ var Clipboard = {
|
|
|
1428
1533
|
// src/components/Dialogs/Dialog.tsx
|
|
1429
1534
|
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1430
1535
|
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
1431
|
-
import {
|
|
1536
|
+
import { DialogClose as DialogClosePrimitive, DialogContent as DialogContentPrimitive, DialogDescription as DialogDescriptionPrimitive, DialogOverlay as DialogOverlayPrimitive, DialogPortal as DialogPortalPrimitive, Root as DialogRootPrimitive, DialogTitle as DialogTitlePrimitive, DialogTrigger as DialogTriggerPrimitive } from "@radix-ui/react-dialog";
|
|
1432
1537
|
import React17, { forwardRef as forwardRef11 } from "react";
|
|
1433
1538
|
var DialogRoot = (props) => {
|
|
1434
1539
|
var _effect = _useSignals17();
|
|
@@ -1526,7 +1631,7 @@ var Dialog = {
|
|
|
1526
1631
|
|
|
1527
1632
|
// src/components/Dialogs/AlertDialog.tsx
|
|
1528
1633
|
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
1529
|
-
import {
|
|
1634
|
+
import { AlertDialogAction as AlertDialogActionPrimitive, AlertDialogCancel as AlertDialogCancelPrimitive, AlertDialogContent as AlertDialogContentPrimitive, AlertDialogDescription as AlertDialogDescriptionPrimitive, AlertDialogOverlay as AlertDialogOverlayPrimitive, AlertDialogPortal as AlertDialogPortalPrimitive, Root as AlertDialogRootPrimitive, AlertDialogTitle as AlertDialogTitlePrimitive, AlertDialogTrigger as AlertDialogTriggerPrimitive } from "@radix-ui/react-alert-dialog";
|
|
1530
1635
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
1531
1636
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
1532
1637
|
var AlertDialogRoot = (props) => {
|
|
@@ -1628,9 +1733,9 @@ var AlertDialog = {
|
|
|
1628
1733
|
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1629
1734
|
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1630
1735
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1631
|
-
import React19, { forwardRef as forwardRef13, useCallback as
|
|
1632
|
-
import {
|
|
1633
|
-
import { mx as
|
|
1736
|
+
import React19, { forwardRef as forwardRef13, useCallback as useCallback6 } from "react";
|
|
1737
|
+
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";
|
|
1738
|
+
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
1634
1739
|
var Label = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1635
1740
|
var _effect = _useSignals19();
|
|
1636
1741
|
try {
|
|
@@ -1700,7 +1805,7 @@ var PinInput = /* @__PURE__ */ forwardRef13(({ density: propsDensity, elevation:
|
|
|
1700
1805
|
const { tx } = useThemeContext();
|
|
1701
1806
|
const density = useDensityContext(propsDensity);
|
|
1702
1807
|
const elevation = useElevationContext(propsElevation);
|
|
1703
|
-
const segmentClassName =
|
|
1808
|
+
const segmentClassName = useCallback6(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1704
1809
|
variant: "static",
|
|
1705
1810
|
focused,
|
|
1706
1811
|
disabled: props.disabled,
|
|
@@ -1782,7 +1887,7 @@ var TextArea = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density
|
|
|
1782
1887
|
_effect.f();
|
|
1783
1888
|
}
|
|
1784
1889
|
});
|
|
1785
|
-
var Checkbox = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size,
|
|
1890
|
+
var Checkbox = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, classNames, ...props }, forwardedRef) => {
|
|
1786
1891
|
var _effect = _useSignals19();
|
|
1787
1892
|
try {
|
|
1788
1893
|
const [checked, onCheckedChange] = useControllableState2({
|
|
@@ -1828,7 +1933,7 @@ var Switch = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked
|
|
|
1828
1933
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1829
1934
|
return /* @__PURE__ */ React19.createElement("input", {
|
|
1830
1935
|
type: "checkbox",
|
|
1831
|
-
className:
|
|
1936
|
+
className: mx4("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1832
1937
|
checked,
|
|
1833
1938
|
onChange: (event) => {
|
|
1834
1939
|
onCheckedChange(event.target.checked);
|
|
@@ -1863,7 +1968,7 @@ var Input = {
|
|
|
1863
1968
|
import { useSignals as _useSignals21 } from "@preact-signals/safe-react/tracking";
|
|
1864
1969
|
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1865
1970
|
import React21, { forwardRef as forwardRef14 } from "react";
|
|
1866
|
-
import { List as ListPrimitive,
|
|
1971
|
+
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";
|
|
1867
1972
|
|
|
1868
1973
|
// src/components/Lists/ListDropIndicator.tsx
|
|
1869
1974
|
import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
|
|
@@ -1984,7 +2089,6 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, class
|
|
|
1984
2089
|
const { tx } = useThemeContext();
|
|
1985
2090
|
const density = useDensityContext();
|
|
1986
2091
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1987
|
-
const iconName = open ? "ph--caret-down--bold" : "ph--caret-right--bold";
|
|
1988
2092
|
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1989
2093
|
...props,
|
|
1990
2094
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
@@ -1992,7 +2096,8 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, class
|
|
|
1992
2096
|
}, classNames),
|
|
1993
2097
|
ref: forwardedRef
|
|
1994
2098
|
}, children || /* @__PURE__ */ React21.createElement(Icon, {
|
|
1995
|
-
|
|
2099
|
+
size: 3,
|
|
2100
|
+
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
1996
2101
|
classNames: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1997
2102
|
}));
|
|
1998
2103
|
} finally {
|
|
@@ -2137,12 +2242,12 @@ var TreeItem = {
|
|
|
2137
2242
|
|
|
2138
2243
|
// src/components/Lists/Treegrid.tsx
|
|
2139
2244
|
import { useSignals as _useSignals24 } from "@preact-signals/safe-react/tracking";
|
|
2140
|
-
import {
|
|
2245
|
+
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2141
2246
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2142
2247
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
2143
2248
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
2144
2249
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2145
|
-
import React24, { forwardRef as forwardRef16 } from "react";
|
|
2250
|
+
import React24, { forwardRef as forwardRef16, useCallback as useCallback7 } from "react";
|
|
2146
2251
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2147
2252
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2148
2253
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -2153,14 +2258,43 @@ var TreegridRoot = /* @__PURE__ */ forwardRef16(({ asChild, classNames, children
|
|
|
2153
2258
|
try {
|
|
2154
2259
|
const { tx } = useThemeContext();
|
|
2155
2260
|
const Root7 = asChild ? Slot7 : Primitive7.div;
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2261
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
2262
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2263
|
+
switch (event.key) {
|
|
2264
|
+
case "ArrowDown":
|
|
2265
|
+
case "ArrowUp": {
|
|
2266
|
+
const direction = event.key === "ArrowDown" ? "down" : "up";
|
|
2267
|
+
const target = event.target;
|
|
2268
|
+
const ancestorWithArrowKeys = target.closest(`[data-arrow-keys*="${direction}"], [data-arrow-keys="all"]`);
|
|
2269
|
+
if (!ancestorWithArrowKeys) {
|
|
2270
|
+
const currentRow = target.closest('[role="row"]');
|
|
2271
|
+
if (currentRow) {
|
|
2272
|
+
const treegrid = currentRow.closest('[role="treegrid"]');
|
|
2273
|
+
if (treegrid) {
|
|
2274
|
+
const rows = Array.from(treegrid.querySelectorAll('[role="row"]'));
|
|
2275
|
+
const currentIndex = rows.indexOf(currentRow);
|
|
2276
|
+
const nextIndex = direction === "down" ? currentIndex + 1 : currentIndex - 1;
|
|
2277
|
+
const targetRow = rows[nextIndex];
|
|
2278
|
+
if (targetRow) {
|
|
2279
|
+
const firstFocusable = findFirstFocusable(targetRow);
|
|
2280
|
+
if (firstFocusable) {
|
|
2281
|
+
event.preventDefault();
|
|
2282
|
+
firstFocusable.focus();
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
break;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
props.onKeyDown?.(event);
|
|
2292
|
+
}, [
|
|
2293
|
+
findFirstFocusable
|
|
2294
|
+
]);
|
|
2161
2295
|
return /* @__PURE__ */ React24.createElement(Root7, {
|
|
2162
2296
|
role: "treegrid",
|
|
2163
|
-
|
|
2297
|
+
onKeyDown: handleKeyDown,
|
|
2164
2298
|
...props,
|
|
2165
2299
|
className: tx("treegrid.root", "treegrid", {}, classNames),
|
|
2166
2300
|
style: {
|
|
@@ -2185,15 +2319,6 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2185
2319
|
onChange: propsOnOpenChange,
|
|
2186
2320
|
defaultProp: defaultOpen
|
|
2187
2321
|
});
|
|
2188
|
-
const focusableGroupAttrs = useFocusableGroup({
|
|
2189
|
-
tabBehavior: "limited"
|
|
2190
|
-
});
|
|
2191
|
-
const arrowGroupAttrs = useArrowNavigationGroup({
|
|
2192
|
-
axis: "horizontal",
|
|
2193
|
-
tabbable: false,
|
|
2194
|
-
circular: false,
|
|
2195
|
-
memorizeCurrent: false
|
|
2196
|
-
});
|
|
2197
2322
|
return /* @__PURE__ */ React24.createElement(TreegridRowProvider, {
|
|
2198
2323
|
open,
|
|
2199
2324
|
onOpenChange,
|
|
@@ -2208,16 +2333,10 @@ var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, c
|
|
|
2208
2333
|
"aria-expanded": open,
|
|
2209
2334
|
"aria-owns": parentOf
|
|
2210
2335
|
},
|
|
2211
|
-
tabIndex: 0,
|
|
2212
|
-
...focusableGroupAttrs,
|
|
2213
2336
|
...props,
|
|
2214
2337
|
id,
|
|
2215
2338
|
ref: forwardedRef
|
|
2216
|
-
},
|
|
2217
|
-
role: "none",
|
|
2218
|
-
className: "contents",
|
|
2219
|
-
...arrowGroupAttrs
|
|
2220
|
-
}, children)));
|
|
2339
|
+
}, children));
|
|
2221
2340
|
} finally {
|
|
2222
2341
|
_effect.f();
|
|
2223
2342
|
}
|
|
@@ -2250,17 +2369,18 @@ var Treegrid = {
|
|
|
2250
2369
|
|
|
2251
2370
|
// src/components/Main/Main.tsx
|
|
2252
2371
|
import { useSignals as _useSignals25 } from "@preact-signals/safe-react/tracking";
|
|
2372
|
+
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2253
2373
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
2254
|
-
import {
|
|
2374
|
+
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2255
2375
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
2256
2376
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
2257
2377
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2258
|
-
import React25, { forwardRef as forwardRef17, useCallback as
|
|
2378
|
+
import React25, { forwardRef as forwardRef17, useCallback as useCallback9, useEffect as useEffect6, useRef as useRef2, useState as useState8 } from "react";
|
|
2259
2379
|
import { log } from "@dxos/log";
|
|
2260
|
-
import {
|
|
2380
|
+
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2261
2381
|
|
|
2262
2382
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2263
|
-
import { useCallback as
|
|
2383
|
+
import { useCallback as useCallback8, useEffect as useEffect5, useState as useState7 } from "react";
|
|
2264
2384
|
var useSwipeToDismiss = (ref, {
|
|
2265
2385
|
onDismiss,
|
|
2266
2386
|
dismissThreshold = 64,
|
|
@@ -2269,22 +2389,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2269
2389
|
/* side = 'inline-start' */
|
|
2270
2390
|
}) => {
|
|
2271
2391
|
const $root = ref.current;
|
|
2272
|
-
const [motionState, setMotionState] =
|
|
2273
|
-
const [gestureStartX, setGestureStartX] =
|
|
2274
|
-
const setIdle =
|
|
2392
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2393
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2394
|
+
const setIdle = useCallback8(() => {
|
|
2275
2395
|
setMotionState(0);
|
|
2276
2396
|
$root?.style.removeProperty("inset-inline-start");
|
|
2277
2397
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2278
2398
|
}, [
|
|
2279
2399
|
$root
|
|
2280
2400
|
]);
|
|
2281
|
-
const setFollowing =
|
|
2401
|
+
const setFollowing = useCallback8(() => {
|
|
2282
2402
|
setMotionState(2);
|
|
2283
2403
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2284
2404
|
}, [
|
|
2285
2405
|
$root
|
|
2286
2406
|
]);
|
|
2287
|
-
const handlePointerDown =
|
|
2407
|
+
const handlePointerDown = useCallback8(({ screenX }) => {
|
|
2288
2408
|
if (motionState === 0) {
|
|
2289
2409
|
setMotionState(1);
|
|
2290
2410
|
setGestureStartX(screenX);
|
|
@@ -2292,7 +2412,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2292
2412
|
}, [
|
|
2293
2413
|
motionState
|
|
2294
2414
|
]);
|
|
2295
|
-
const handlePointerMove =
|
|
2415
|
+
const handlePointerMove = useCallback8(({ screenX }) => {
|
|
2296
2416
|
if ($root) {
|
|
2297
2417
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2298
2418
|
switch (motionState) {
|
|
@@ -2316,12 +2436,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2316
2436
|
motionState,
|
|
2317
2437
|
gestureStartX
|
|
2318
2438
|
]);
|
|
2319
|
-
const handlePointerUp =
|
|
2439
|
+
const handlePointerUp = useCallback8(() => {
|
|
2320
2440
|
setIdle();
|
|
2321
2441
|
}, [
|
|
2322
2442
|
setIdle
|
|
2323
2443
|
]);
|
|
2324
|
-
|
|
2444
|
+
useEffect5(() => {
|
|
2325
2445
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2326
2446
|
return () => {
|
|
2327
2447
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2330,7 +2450,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2330
2450
|
$root,
|
|
2331
2451
|
handlePointerDown
|
|
2332
2452
|
]);
|
|
2333
|
-
|
|
2453
|
+
useEffect5(() => {
|
|
2334
2454
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2335
2455
|
return () => {
|
|
2336
2456
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2339,7 +2459,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2339
2459
|
$root,
|
|
2340
2460
|
handlePointerMove
|
|
2341
2461
|
]);
|
|
2342
|
-
|
|
2462
|
+
useEffect5(() => {
|
|
2343
2463
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2344
2464
|
return () => {
|
|
2345
2465
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2352,14 +2472,14 @@ var useSwipeToDismiss = (ref, {
|
|
|
2352
2472
|
|
|
2353
2473
|
// src/components/Main/Main.tsx
|
|
2354
2474
|
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
2475
|
+
var MAIN_NAME = "Main";
|
|
2355
2476
|
var MAIN_ROOT_NAME = "MainRoot";
|
|
2356
2477
|
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
2357
2478
|
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
2358
|
-
var MAIN_NAME = "Main";
|
|
2359
2479
|
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
2360
2480
|
var landmarkAttr = "data-main-landmark";
|
|
2361
2481
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2362
|
-
const handleKeyDown =
|
|
2482
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2363
2483
|
const target = event.target;
|
|
2364
2484
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2365
2485
|
event.preventDefault();
|
|
@@ -2373,12 +2493,12 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2373
2493
|
}, [
|
|
2374
2494
|
propsOnKeyDown
|
|
2375
2495
|
]);
|
|
2376
|
-
const focusableGroupAttrs =
|
|
2496
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2377
2497
|
tabBehavior: "limited",
|
|
2378
2498
|
ignoreDefaultKeydown: {
|
|
2379
2499
|
Tab: true
|
|
2380
2500
|
}
|
|
2381
|
-
};
|
|
2501
|
+
});
|
|
2382
2502
|
return {
|
|
2383
2503
|
onKeyDown: handleKeyDown,
|
|
2384
2504
|
[landmarkAttr]: landmark,
|
|
@@ -2389,19 +2509,19 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2389
2509
|
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
2390
2510
|
resizing: false,
|
|
2391
2511
|
navigationSidebarState: "closed",
|
|
2392
|
-
setNavigationSidebarState: (
|
|
2512
|
+
setNavigationSidebarState: (_nextState) => {
|
|
2393
2513
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2394
2514
|
F: __dxlog_file,
|
|
2395
|
-
L:
|
|
2515
|
+
L: 92,
|
|
2396
2516
|
S: void 0,
|
|
2397
2517
|
C: (f, a) => f(...a)
|
|
2398
2518
|
});
|
|
2399
2519
|
},
|
|
2400
2520
|
complementarySidebarState: "closed",
|
|
2401
|
-
setComplementarySidebarState: (
|
|
2521
|
+
setComplementarySidebarState: (_nextState) => {
|
|
2402
2522
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2403
2523
|
F: __dxlog_file,
|
|
2404
|
-
L:
|
|
2524
|
+
L: 97,
|
|
2405
2525
|
S: void 0,
|
|
2406
2526
|
C: (f, a) => f(...a)
|
|
2407
2527
|
});
|
|
@@ -2412,31 +2532,29 @@ var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
|
2412
2532
|
return {
|
|
2413
2533
|
navigationSidebarState,
|
|
2414
2534
|
setNavigationSidebarState,
|
|
2415
|
-
toggleNavigationSidebar:
|
|
2535
|
+
toggleNavigationSidebar: useCallback9(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2416
2536
|
navigationSidebarState,
|
|
2417
2537
|
setNavigationSidebarState
|
|
2418
2538
|
]),
|
|
2419
|
-
openNavigationSidebar:
|
|
2420
|
-
collapseNavigationSidebar:
|
|
2421
|
-
closeNavigationSidebar:
|
|
2539
|
+
openNavigationSidebar: useCallback9(() => setNavigationSidebarState("expanded"), []),
|
|
2540
|
+
collapseNavigationSidebar: useCallback9(() => setNavigationSidebarState("collapsed"), []),
|
|
2541
|
+
closeNavigationSidebar: useCallback9(() => setNavigationSidebarState("closed"), []),
|
|
2422
2542
|
complementarySidebarState,
|
|
2423
2543
|
setComplementarySidebarState,
|
|
2424
|
-
toggleComplementarySidebar:
|
|
2544
|
+
toggleComplementarySidebar: useCallback9(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2425
2545
|
complementarySidebarState,
|
|
2426
2546
|
setComplementarySidebarState
|
|
2427
2547
|
]),
|
|
2428
|
-
openComplementarySidebar:
|
|
2429
|
-
collapseComplementarySidebar:
|
|
2430
|
-
closeComplementarySidebar:
|
|
2548
|
+
openComplementarySidebar: useCallback9(() => setComplementarySidebarState("expanded"), []),
|
|
2549
|
+
collapseComplementarySidebar: useCallback9(() => setComplementarySidebarState("collapsed"), []),
|
|
2550
|
+
closeComplementarySidebar: useCallback9(() => setComplementarySidebarState("closed"), [])
|
|
2431
2551
|
};
|
|
2432
2552
|
};
|
|
2433
2553
|
var resizeDebounce = 3e3;
|
|
2434
2554
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2435
2555
|
var _effect = _useSignals25();
|
|
2436
2556
|
try {
|
|
2437
|
-
const [isLg] = useMediaQuery("lg"
|
|
2438
|
-
ssr: false
|
|
2439
|
-
});
|
|
2557
|
+
const [isLg] = useMediaQuery("lg");
|
|
2440
2558
|
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2441
2559
|
prop: propsNavigationSidebarState,
|
|
2442
2560
|
defaultProp: defaultNavigationSidebarState,
|
|
@@ -2447,9 +2565,9 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2447
2565
|
defaultProp: defaultComplementarySidebarState,
|
|
2448
2566
|
onChange: onComplementarySidebarStateChange
|
|
2449
2567
|
});
|
|
2450
|
-
const [resizing, setResizing] =
|
|
2568
|
+
const [resizing, setResizing] = useState8(false);
|
|
2451
2569
|
const resizeInterval = useRef2(null);
|
|
2452
|
-
const handleResize =
|
|
2570
|
+
const handleResize = useCallback9(() => {
|
|
2453
2571
|
setResizing(true);
|
|
2454
2572
|
if (resizeInterval.current) {
|
|
2455
2573
|
clearTimeout(resizeInterval.current);
|
|
@@ -2459,7 +2577,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2459
2577
|
resizeInterval.current = null;
|
|
2460
2578
|
}, resizeDebounce);
|
|
2461
2579
|
}, []);
|
|
2462
|
-
|
|
2580
|
+
useEffect6(() => {
|
|
2463
2581
|
window.addEventListener("resize", handleResize);
|
|
2464
2582
|
return () => window.removeEventListener("resize", handleResize);
|
|
2465
2583
|
}, [
|
|
@@ -2484,9 +2602,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2484
2602
|
var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2485
2603
|
var _effect = _useSignals25();
|
|
2486
2604
|
try {
|
|
2487
|
-
const [isLg] = useMediaQuery("lg"
|
|
2488
|
-
ssr: false
|
|
2489
|
-
});
|
|
2605
|
+
const [isLg] = useMediaQuery("lg");
|
|
2490
2606
|
const { tx } = useThemeContext();
|
|
2491
2607
|
const { t } = useTranslation();
|
|
2492
2608
|
const ref = useForwardedRef(forwardedRef);
|
|
@@ -2494,9 +2610,12 @@ var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToD
|
|
|
2494
2610
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2495
2611
|
onDismiss: () => onStateChange?.("closed")
|
|
2496
2612
|
});
|
|
2497
|
-
const handleKeyDown =
|
|
2498
|
-
|
|
2499
|
-
|
|
2613
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2614
|
+
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
2615
|
+
if (event.key === "Escape" && focusGroupParent) {
|
|
2616
|
+
event.preventDefault();
|
|
2617
|
+
event.stopPropagation();
|
|
2618
|
+
focusGroupParent.focus();
|
|
2500
2619
|
}
|
|
2501
2620
|
props.onKeyDown?.(event);
|
|
2502
2621
|
}, [
|
|
@@ -2520,9 +2639,9 @@ var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToD
|
|
|
2520
2639
|
"data-state": state,
|
|
2521
2640
|
"data-resizing": resizing ? "true" : "false",
|
|
2522
2641
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2523
|
-
|
|
2642
|
+
onKeyDownCapture: handleKeyDown,
|
|
2524
2643
|
...state === "closed" && {
|
|
2525
|
-
inert:
|
|
2644
|
+
inert: true
|
|
2526
2645
|
},
|
|
2527
2646
|
ref
|
|
2528
2647
|
}, children));
|
|
@@ -2598,9 +2717,7 @@ MainContent.displayName = MAIN_NAME;
|
|
|
2598
2717
|
var MainOverlay = /* @__PURE__ */ forwardRef17(({ classNames, ...props }, forwardedRef) => {
|
|
2599
2718
|
var _effect = _useSignals25();
|
|
2600
2719
|
try {
|
|
2601
|
-
const [isLg] = useMediaQuery("lg"
|
|
2602
|
-
ssr: false
|
|
2603
|
-
});
|
|
2720
|
+
const [isLg] = useMediaQuery("lg");
|
|
2604
2721
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2605
2722
|
const { tx } = useThemeContext();
|
|
2606
2723
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
@@ -2638,7 +2755,7 @@ import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
|
2638
2755
|
import React26, { forwardRef as forwardRef18 } from "react";
|
|
2639
2756
|
|
|
2640
2757
|
// src/hooks/useSafeCollisionPadding.ts
|
|
2641
|
-
import { useMemo as
|
|
2758
|
+
import { useMemo as useMemo4 } from "react";
|
|
2642
2759
|
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
2643
2760
|
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
2644
2761
|
var safePadding = (propsPadding, safePadding2, side) => {
|
|
@@ -2646,7 +2763,7 @@ var safePadding = (propsPadding, safePadding2, side) => {
|
|
|
2646
2763
|
};
|
|
2647
2764
|
var useSafeCollisionPadding = (collisionPadding) => {
|
|
2648
2765
|
const { safeAreaPadding } = useThemeContext();
|
|
2649
|
-
return
|
|
2766
|
+
return useMemo4(() => ({
|
|
2650
2767
|
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
2651
2768
|
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
2652
2769
|
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
@@ -2669,6 +2786,7 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef18(({ classNames, children, c
|
|
|
2669
2786
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2670
2787
|
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Content, {
|
|
2671
2788
|
...props,
|
|
2789
|
+
"data-arrow-keys": "up down",
|
|
2672
2790
|
collisionPadding: safeCollisionPadding,
|
|
2673
2791
|
className: tx("menu.content", "menu", {
|
|
2674
2792
|
elevation
|
|
@@ -2786,7 +2904,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
2786
2904
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
2787
2905
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
2788
2906
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2789
|
-
import React27, {
|
|
2907
|
+
import React27, { forwardRef as forwardRef19, useCallback as useCallback10, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
2790
2908
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
2791
2909
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope3(DROPDOWN_MENU_NAME, [
|
|
2792
2910
|
createMenuScope
|
|
@@ -2811,7 +2929,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
2811
2929
|
contentId: useId3(),
|
|
2812
2930
|
open,
|
|
2813
2931
|
onOpenChange: setOpen,
|
|
2814
|
-
onOpenToggle:
|
|
2932
|
+
onOpenToggle: useCallback10(() => setOpen((prevOpen) => !prevOpen), [
|
|
2815
2933
|
setOpen
|
|
2816
2934
|
]),
|
|
2817
2935
|
modal
|
|
@@ -2848,6 +2966,7 @@ var DropdownMenuTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) =>
|
|
|
2848
2966
|
disabled,
|
|
2849
2967
|
...triggerProps,
|
|
2850
2968
|
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
2969
|
+
"data-arrow-keys": "down",
|
|
2851
2970
|
onPointerDown: composeEventHandlers2(props.onPointerDown, (event) => {
|
|
2852
2971
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
2853
2972
|
context.onOpenToggle();
|
|
@@ -2890,7 +3009,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
2890
3009
|
const { __scopeDropdownMenu, virtualRef } = props;
|
|
2891
3010
|
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
2892
3011
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2893
|
-
|
|
3012
|
+
useEffect7(() => {
|
|
2894
3013
|
if (virtualRef.current) {
|
|
2895
3014
|
context.triggerRef.current = virtualRef.current;
|
|
2896
3015
|
}
|
|
@@ -2937,18 +3056,35 @@ var CONTENT_NAME2 = "DropdownMenuContent";
|
|
|
2937
3056
|
var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2938
3057
|
var _effect = _useSignals27();
|
|
2939
3058
|
try {
|
|
2940
|
-
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
3059
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
2941
3060
|
const { tx } = useThemeContext();
|
|
2942
3061
|
const context = useDropdownMenuContext(CONTENT_NAME2, __scopeDropdownMenu);
|
|
2943
3062
|
const elevation = useElevationContext();
|
|
2944
3063
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2945
3064
|
const hasInteractedOutsideRef = useRef3(false);
|
|
2946
3065
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3066
|
+
const computedCollisionBoundary = useMemo5(() => {
|
|
3067
|
+
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3068
|
+
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3069
|
+
closestBoundary,
|
|
3070
|
+
...collisionBoundary
|
|
3071
|
+
] : collisionBoundary ? [
|
|
3072
|
+
closestBoundary,
|
|
3073
|
+
collisionBoundary
|
|
3074
|
+
] : [
|
|
3075
|
+
closestBoundary
|
|
3076
|
+
] : collisionBoundary;
|
|
3077
|
+
}, [
|
|
3078
|
+
context.open,
|
|
3079
|
+
collisionBoundary,
|
|
3080
|
+
context.triggerRef.current
|
|
3081
|
+
]);
|
|
2947
3082
|
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Content, {
|
|
2948
3083
|
id: context.contentId,
|
|
2949
3084
|
"aria-labelledby": context.triggerId,
|
|
2950
3085
|
...menuScope,
|
|
2951
3086
|
...contentProps,
|
|
3087
|
+
collisionBoundary: computedCollisionBoundary,
|
|
2952
3088
|
collisionPadding: safeCollisionPadding,
|
|
2953
3089
|
ref: forwardedRef,
|
|
2954
3090
|
onCloseAutoFocus: composeEventHandlers2(props.onCloseAutoFocus, (event) => {
|
|
@@ -2966,6 +3102,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) =>
|
|
|
2966
3102
|
hasInteractedOutsideRef.current = true;
|
|
2967
3103
|
}
|
|
2968
3104
|
}),
|
|
3105
|
+
"data-arrow-keys": "up down",
|
|
2969
3106
|
className: tx("menu.content", "menu", {
|
|
2970
3107
|
elevation
|
|
2971
3108
|
}, classNames),
|
|
@@ -3076,11 +3213,13 @@ var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
|
3076
3213
|
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3077
3214
|
var _effect = _useSignals27();
|
|
3078
3215
|
try {
|
|
3079
|
-
const { __scopeDropdownMenu, ...
|
|
3216
|
+
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
3080
3217
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3081
|
-
|
|
3218
|
+
const { tx } = useThemeContext();
|
|
3219
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Item, {
|
|
3082
3220
|
...menuScope,
|
|
3083
|
-
...
|
|
3221
|
+
...itemProps,
|
|
3222
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
3084
3223
|
ref: forwardedRef
|
|
3085
3224
|
});
|
|
3086
3225
|
} finally {
|
|
@@ -3334,7 +3473,7 @@ import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
|
3334
3473
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
3335
3474
|
import { useControllableState as useControllableState6 } from "@radix-ui/react-use-controllable-state";
|
|
3336
3475
|
import { hideOthers } from "aria-hidden";
|
|
3337
|
-
import React29, { forwardRef as forwardRef21,
|
|
3476
|
+
import React29, { forwardRef as forwardRef21, useCallback as useCallback11, useEffect as useEffect8, useMemo as useMemo6, useRef as useRef4, useState as useState9 } from "react";
|
|
3338
3477
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3339
3478
|
var POPOVER_NAME = "Popover";
|
|
3340
3479
|
var [createPopoverContext, createPopoverScope] = createContextScope4(POPOVER_NAME, [
|
|
@@ -3348,7 +3487,7 @@ var PopoverRoot = (props) => {
|
|
|
3348
3487
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3349
3488
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3350
3489
|
const triggerRef = useRef4(null);
|
|
3351
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3490
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
3352
3491
|
const [open = false, setOpen] = useControllableState6({
|
|
3353
3492
|
prop: openProp,
|
|
3354
3493
|
defaultProp: defaultOpen,
|
|
@@ -3360,12 +3499,12 @@ var PopoverRoot = (props) => {
|
|
|
3360
3499
|
triggerRef,
|
|
3361
3500
|
open,
|
|
3362
3501
|
onOpenChange: setOpen,
|
|
3363
|
-
onOpenToggle:
|
|
3502
|
+
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3364
3503
|
setOpen
|
|
3365
3504
|
]),
|
|
3366
3505
|
hasCustomAnchor,
|
|
3367
|
-
onCustomAnchorAdd:
|
|
3368
|
-
onCustomAnchorRemove:
|
|
3506
|
+
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3507
|
+
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3369
3508
|
modal
|
|
3370
3509
|
}, children));
|
|
3371
3510
|
} finally {
|
|
@@ -3381,7 +3520,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
|
3381
3520
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3382
3521
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3383
3522
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3384
|
-
|
|
3523
|
+
useEffect8(() => {
|
|
3385
3524
|
onCustomAnchorAdd();
|
|
3386
3525
|
return () => onCustomAnchorRemove();
|
|
3387
3526
|
}, [
|
|
@@ -3432,7 +3571,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3432
3571
|
const { __scopePopover, virtualRef } = props;
|
|
3433
3572
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3434
3573
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3435
|
-
|
|
3574
|
+
useEffect8(() => {
|
|
3436
3575
|
if (virtualRef.current) {
|
|
3437
3576
|
context.triggerRef.current = virtualRef.current;
|
|
3438
3577
|
}
|
|
@@ -3497,7 +3636,7 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) =>
|
|
|
3497
3636
|
const contentRef = useRef4(null);
|
|
3498
3637
|
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3499
3638
|
const isRightClickOutsideRef = useRef4(false);
|
|
3500
|
-
|
|
3639
|
+
useEffect8(() => {
|
|
3501
3640
|
const content = contentRef.current;
|
|
3502
3641
|
if (content) {
|
|
3503
3642
|
return hideOthers(content);
|
|
@@ -3584,13 +3723,29 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef21((props, forwardedRef)
|
|
|
3584
3723
|
var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3585
3724
|
var _effect = _useSignals29();
|
|
3586
3725
|
try {
|
|
3587
|
-
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, classNames, ...contentProps } = props;
|
|
3726
|
+
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
3588
3727
|
const context = usePopoverContext(CONTENT_NAME3, __scopePopover);
|
|
3589
3728
|
const popperScope = usePopperScope2(__scopePopover);
|
|
3590
3729
|
const { tx } = useThemeContext();
|
|
3591
3730
|
const elevation = useElevationContext();
|
|
3592
3731
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3593
3732
|
useFocusGuards();
|
|
3733
|
+
const computedCollisionBoundary = useMemo6(() => {
|
|
3734
|
+
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3735
|
+
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3736
|
+
closestBoundary,
|
|
3737
|
+
...collisionBoundary
|
|
3738
|
+
] : collisionBoundary ? [
|
|
3739
|
+
closestBoundary,
|
|
3740
|
+
collisionBoundary
|
|
3741
|
+
] : [
|
|
3742
|
+
closestBoundary
|
|
3743
|
+
] : collisionBoundary;
|
|
3744
|
+
}, [
|
|
3745
|
+
context.open,
|
|
3746
|
+
collisionBoundary,
|
|
3747
|
+
context.triggerRef.current
|
|
3748
|
+
]);
|
|
3594
3749
|
return /* @__PURE__ */ React29.createElement(FocusScope, {
|
|
3595
3750
|
asChild: true,
|
|
3596
3751
|
loop: true,
|
|
@@ -3612,13 +3767,14 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
|
3612
3767
|
...popperScope,
|
|
3613
3768
|
...contentProps,
|
|
3614
3769
|
collisionPadding: safeCollisionPadding,
|
|
3770
|
+
collisionBoundary: computedCollisionBoundary,
|
|
3615
3771
|
className: tx("popover.content", "popover", {
|
|
3616
3772
|
elevation
|
|
3617
3773
|
}, classNames),
|
|
3618
3774
|
ref: forwardedRef,
|
|
3619
3775
|
style: {
|
|
3620
3776
|
...contentProps.style,
|
|
3621
|
-
//
|
|
3777
|
+
// Re-namespace exposed content custom properties.
|
|
3622
3778
|
...{
|
|
3623
3779
|
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3624
3780
|
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
@@ -3731,7 +3887,7 @@ var Status = /* @__PURE__ */ forwardRef22(({ classNames, children, progress = 0,
|
|
|
3731
3887
|
|
|
3732
3888
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3733
3889
|
import { useSignals as _useSignals31 } from "@preact-signals/safe-react/tracking";
|
|
3734
|
-
import {
|
|
3890
|
+
import { Corner as ScrollAreaPrimitiveCorner, Root as ScrollAreaPrimitiveRoot, Scrollbar as ScrollAreaPrimitiveScrollbar, Thumb as ScrollAreaPrimitiveThumb, Viewport as ScrollAreaPrimitiveViewport } from "@radix-ui/react-scroll-area";
|
|
3735
3891
|
import React31, { forwardRef as forwardRef23 } from "react";
|
|
3736
3892
|
var ScrollAreaRoot = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3737
3893
|
var _effect = _useSignals31();
|
|
@@ -3819,7 +3975,6 @@ var SelectPortal = SelectPrimitive.Portal;
|
|
|
3819
3975
|
var SelectTriggerButton = /* @__PURE__ */ forwardRef24(({ children, placeholder, ...props }, forwardedRef) => {
|
|
3820
3976
|
var _effect = _useSignals32();
|
|
3821
3977
|
try {
|
|
3822
|
-
const { tx } = useThemeContext();
|
|
3823
3978
|
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Trigger, {
|
|
3824
3979
|
asChild: true,
|
|
3825
3980
|
ref: forwardedRef
|
|
@@ -3830,8 +3985,8 @@ var SelectTriggerButton = /* @__PURE__ */ forwardRef24(({ children, placeholder,
|
|
|
3830
3985
|
}), /* @__PURE__ */ React32.createElement(SelectPrimitive.Icon, {
|
|
3831
3986
|
asChild: true
|
|
3832
3987
|
}, /* @__PURE__ */ React32.createElement(Icon, {
|
|
3833
|
-
|
|
3834
|
-
|
|
3988
|
+
size: 3,
|
|
3989
|
+
icon: "ph--caret-down--bold"
|
|
3835
3990
|
}))));
|
|
3836
3991
|
} finally {
|
|
3837
3992
|
_effect.f();
|
|
@@ -3845,6 +4000,7 @@ var SelectContent = /* @__PURE__ */ forwardRef24(({ classNames, children, collis
|
|
|
3845
4000
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3846
4001
|
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Content, {
|
|
3847
4002
|
...props,
|
|
4003
|
+
"data-arrow-keys": "up down",
|
|
3848
4004
|
collisionPadding: safeCollisionPadding,
|
|
3849
4005
|
className: tx("select.content", "select__content", {
|
|
3850
4006
|
elevation
|
|
@@ -3865,6 +4021,7 @@ var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef24(({ classNames, children
|
|
|
3865
4021
|
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
3866
4022
|
ref: forwardedRef
|
|
3867
4023
|
}, children ?? /* @__PURE__ */ React32.createElement(Icon, {
|
|
4024
|
+
size: 3,
|
|
3868
4025
|
icon: "ph--caret-up--bold"
|
|
3869
4026
|
}));
|
|
3870
4027
|
} finally {
|
|
@@ -3880,13 +4037,14 @@ var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef24(({ classNames, childr
|
|
|
3880
4037
|
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
3881
4038
|
ref: forwardedRef
|
|
3882
4039
|
}, children ?? /* @__PURE__ */ React32.createElement(Icon, {
|
|
4040
|
+
size: 3,
|
|
3883
4041
|
icon: "ph--caret-down--bold"
|
|
3884
4042
|
}));
|
|
3885
4043
|
} finally {
|
|
3886
4044
|
_effect.f();
|
|
3887
4045
|
}
|
|
3888
4046
|
});
|
|
3889
|
-
var SelectViewport2 = /* @__PURE__ */ forwardRef24(({ classNames,
|
|
4047
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
3890
4048
|
var _effect = _useSignals32();
|
|
3891
4049
|
try {
|
|
3892
4050
|
const { tx } = useThemeContext();
|
|
@@ -4041,7 +4199,7 @@ var Tag = /* @__PURE__ */ forwardRef26(({ asChild, palette = "neutral", classNam
|
|
|
4041
4199
|
import { useSignals as _useSignals35 } from "@preact-signals/safe-react/tracking";
|
|
4042
4200
|
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
4043
4201
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
4044
|
-
import {
|
|
4202
|
+
import { ToastAction as ToastActionPrimitive, ToastClose as ToastClosePrimitive, ToastDescription as ToastDescriptionPrimitive, ToastProvider as ToastProviderPrimitive, Root as ToastRootPrimitive, ToastTitle as ToastTitlePrimitive, ToastViewport as ToastViewportPrimitive } from "@radix-ui/react-toast";
|
|
4045
4203
|
import React35, { forwardRef as forwardRef27 } from "react";
|
|
4046
4204
|
var ToastProvider = ToastProviderPrimitive;
|
|
4047
4205
|
var ToastViewport = /* @__PURE__ */ forwardRef27(({ classNames, ...props }, forwardedRef) => {
|
|
@@ -4144,18 +4302,27 @@ var Toast = {
|
|
|
4144
4302
|
// src/components/Toolbar/Toolbar.tsx
|
|
4145
4303
|
import { useSignals as _useSignals36 } from "@preact-signals/safe-react/tracking";
|
|
4146
4304
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
4147
|
-
import React36, { forwardRef as forwardRef28 } from "react";
|
|
4148
|
-
var ToolbarRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, layoutManaged, ...props }, forwardedRef) => {
|
|
4305
|
+
import React36, { Fragment, forwardRef as forwardRef28 } from "react";
|
|
4306
|
+
var ToolbarRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, layoutManaged, textBlockWidth: textBlockWidthParam, disabled, ...props }, forwardedRef) => {
|
|
4149
4307
|
var _effect = _useSignals36();
|
|
4150
4308
|
try {
|
|
4151
4309
|
const { tx } = useThemeContext();
|
|
4310
|
+
const InnerRoot = textBlockWidthParam ? "div" : Fragment;
|
|
4311
|
+
const innerRootProps = textBlockWidthParam ? {
|
|
4312
|
+
role: "none",
|
|
4313
|
+
className: tx("toolbar.inner", "toolbar", {
|
|
4314
|
+
layoutManaged
|
|
4315
|
+
}, classNames)
|
|
4316
|
+
} : {};
|
|
4152
4317
|
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Root, {
|
|
4153
4318
|
...props,
|
|
4319
|
+
"data-arrow-keys": props.orientation === "vertical" ? "up down" : "left right",
|
|
4154
4320
|
className: tx("toolbar.root", "toolbar", {
|
|
4155
|
-
layoutManaged
|
|
4321
|
+
layoutManaged,
|
|
4322
|
+
disabled
|
|
4156
4323
|
}, classNames),
|
|
4157
4324
|
ref: forwardedRef
|
|
4158
|
-
}, children);
|
|
4325
|
+
}, /* @__PURE__ */ React36.createElement(InnerRoot, innerRootProps, children));
|
|
4159
4326
|
} finally {
|
|
4160
4327
|
_effect.f();
|
|
4161
4328
|
}
|
|
@@ -4329,8 +4496,11 @@ export {
|
|
|
4329
4496
|
Toggle,
|
|
4330
4497
|
ToggleGroup,
|
|
4331
4498
|
ToggleGroupItem,
|
|
4499
|
+
ToggleGroupIconItem,
|
|
4332
4500
|
useClipboard,
|
|
4501
|
+
Domino,
|
|
4333
4502
|
hasIosKeyboard,
|
|
4503
|
+
usePx,
|
|
4334
4504
|
DensityContext,
|
|
4335
4505
|
DensityProvider,
|
|
4336
4506
|
ElevationContext,
|
|
@@ -4341,8 +4511,8 @@ export {
|
|
|
4341
4511
|
Dialog,
|
|
4342
4512
|
AlertDialog,
|
|
4343
4513
|
Input,
|
|
4344
|
-
LIST_NAME,
|
|
4345
4514
|
LIST_ITEM_NAME,
|
|
4515
|
+
LIST_NAME,
|
|
4346
4516
|
useListContext,
|
|
4347
4517
|
useListItemContext,
|
|
4348
4518
|
List,
|
|
@@ -4372,4 +4542,4 @@ export {
|
|
|
4372
4542
|
Toast,
|
|
4373
4543
|
Toolbar
|
|
4374
4544
|
};
|
|
4375
|
-
//# sourceMappingURL=chunk-
|
|
4545
|
+
//# sourceMappingURL=chunk-FL2ZT5KB.mjs.map
|