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