@dxos/react-ui 0.8.4-main.66e292d → 0.8.4-main.69d29f4
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-CEKVHJ27.mjs +774 -0
- package/dist/lib/browser/chunk-CEKVHJ27.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3065 -66
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +31 -43
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs +776 -0
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3065 -66
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +31 -43
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/components/Button/Button.d.ts +1 -1
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts +2 -1
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +4 -4
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +4 -4
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +18 -9
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +7 -5
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts +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/Input/Input.d.ts +5 -2
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Menus → Menu}/ContextMenu.d.ts +6 -6
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Menus → Menu}/DropdownMenu.d.ts +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/Menu/index.d.ts.map +1 -0
- 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 +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +9 -7
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +4 -0
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +4 -2
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +2 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts +9 -9
- package/dist/types/src/components/Separator/Separator.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -8
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +2 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +10 -10
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts +1 -1
- package/dist/types/src/hooks/useElevationContext.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/testing/decorators/withLayout.d.ts +3 -3
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -26
- package/src/components/Avatars/Avatar.stories.tsx +2 -2
- package/src/components/Avatars/Avatar.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Button/IconButton.tsx +8 -3
- package/src/components/Clipboard/CopyButton.tsx +3 -3
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/Dialog/Dialog.stories.tsx +47 -17
- package/src/components/Dialog/Dialog.tsx +140 -40
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Icon/Icon.stories.tsx +1 -1
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +2 -2
- package/src/components/Input/Input.tsx +13 -4
- package/src/components/List/List.stories.tsx +16 -12
- package/src/components/List/List.tsx +1 -1
- package/src/components/{Menus → Menu}/DropdownMenu.tsx +57 -55
- package/src/components/Message/Message.stories.tsx +1 -1
- package/src/components/Message/Message.tsx +30 -5
- package/src/components/Popover/Popover.tsx +35 -33
- package/src/components/ScrollArea/ScrollArea.stories.tsx +53 -3
- package/src/components/ScrollArea/ScrollArea.tsx +50 -4
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +2 -1
- package/src/components/ScrollContainer/ScrollContainer.tsx +90 -88
- package/src/components/Tag/Tag.stories.tsx +2 -2
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +1 -3
- package/src/components/ThemeProvider/TranslationsProvider.tsx +1 -16
- package/src/components/ThemeProvider/index.ts +3 -3
- package/src/components/Toolbar/Toolbar.tsx +23 -8
- package/src/components/Tooltip/Tooltip.tsx +22 -20
- package/src/components/index.ts +1 -1
- package/src/hooks/useDensityContext.ts +1 -1
- package/src/hooks/useElevationContext.ts +1 -1
- package/src/index.ts +1 -1
- package/src/testing/decorators/withLayout.tsx +22 -15
- package/src/testing/decorators/withLayoutVariants.tsx +3 -3
- package/src/testing/decorators/withTheme.tsx +3 -2
- package/src/util/index.ts +2 -2
- package/dist/lib/browser/chunk-N5GDJTT2.mjs +0 -4707
- package/dist/lib/browser/chunk-N5GDJTT2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SP7VQH72.mjs +0 -4709
- package/dist/lib/node-esm/chunk-SP7VQH72.mjs.map +0 -7
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/index.d.ts.map +0 -1
- package/dist/types/src/util/ThemedClassName.d.ts +0 -5
- package/dist/types/src/util/ThemedClassName.d.ts.map +0 -1
- package/dist/types/src/util/domino.d.ts +0 -18
- package/dist/types/src/util/domino.d.ts.map +0 -1
- package/src/util/ThemedClassName.ts +0 -7
- package/src/util/domino.ts +0 -53
- /package/dist/types/src/components/{Menus → Menu}/ContextMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/DropdownMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/index.d.ts +0 -0
- /package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +0 -0
- /package/src/components/{Menus → Menu}/ContextMenu.tsx +0 -0
- /package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +0 -0
- /package/src/components/{Menus → Menu}/index.ts +0 -0
|
@@ -1,4709 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/hooks/useDensityContext.ts
|
|
4
|
-
import { useContext as useContext6 } from "react";
|
|
5
|
-
|
|
6
|
-
// src/components/AnchoredOverflow/AnchoredOverflow.tsx
|
|
7
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
8
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
9
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
10
|
-
import React2, { forwardRef } from "react";
|
|
11
|
-
|
|
12
|
-
// src/hooks/useElevationContext.ts
|
|
13
|
-
import { useContext } from "react";
|
|
14
|
-
var useElevationContext = (propsElevation) => {
|
|
15
|
-
const { elevation } = useContext(ElevationContext);
|
|
16
|
-
return propsElevation ?? elevation;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// src/hooks/useThemeContext.ts
|
|
20
|
-
import { useContext as useContext2 } from "react";
|
|
21
|
-
import { raise } from "@dxos/debug";
|
|
22
|
-
var useThemeContext = () => useContext2(ThemeContext) ?? raise(new Error("Missing ThemeContext"));
|
|
23
|
-
|
|
24
|
-
// src/hooks/useIconHref.ts
|
|
25
|
-
var ICONS_URL = "/icons.svg";
|
|
26
|
-
var useIconHref = (icon) => {
|
|
27
|
-
const { noCache } = useThemeContext();
|
|
28
|
-
const url = noCache ? `${ICONS_URL}?nocache=${(/* @__PURE__ */ new Date()).getMinutes()}` : ICONS_URL;
|
|
29
|
-
return icon ? `${url}#${icon}` : void 0;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// src/hooks/useSafeArea.ts
|
|
33
|
-
import { useCallback, useState } from "react";
|
|
34
|
-
import { useViewportResize } from "@dxos/react-hooks";
|
|
35
|
-
var initialSafeArea = {
|
|
36
|
-
top: NaN,
|
|
37
|
-
right: NaN,
|
|
38
|
-
bottom: NaN,
|
|
39
|
-
left: NaN
|
|
40
|
-
};
|
|
41
|
-
var useSafeArea = () => {
|
|
42
|
-
const [padding, setPadding] = useState(initialSafeArea);
|
|
43
|
-
const handleResize = useCallback(() => {
|
|
44
|
-
setPadding({
|
|
45
|
-
top: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-top")),
|
|
46
|
-
right: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-right")),
|
|
47
|
-
bottom: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-bottom")),
|
|
48
|
-
left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left"))
|
|
49
|
-
});
|
|
50
|
-
}, []);
|
|
51
|
-
useViewportResize(handleResize);
|
|
52
|
-
return padding;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// src/hooks/useTranslationsContext.ts
|
|
56
|
-
import { useContext as useContext4 } from "react";
|
|
57
|
-
|
|
58
|
-
// src/components/ThemeProvider/TranslationsProvider.tsx
|
|
59
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
60
|
-
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
61
|
-
import i18Next from "i18next";
|
|
62
|
-
import React, { Suspense, createContext, useContext as useContext3, useEffect, useState as useState2 } from "react";
|
|
63
|
-
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
64
|
-
var initialLng = "en-US";
|
|
65
|
-
var initialNs = "dxos-common";
|
|
66
|
-
var initialDtLocale = dtLocaleEnUs;
|
|
67
|
-
var isLabel = (o) => typeof o === "string" || Array.isArray(o) && o.length === 2 && typeof o[0] === "string" && !!o[1] && typeof o[1] === "object" && "ns" in o[1] && typeof o[1].ns === "string";
|
|
68
|
-
var toLocalizedString = (label, t) => Array.isArray(label) ? t(...label) : label;
|
|
69
|
-
var resources = {
|
|
70
|
-
[initialLng]: {
|
|
71
|
-
[initialNs]: {
|
|
72
|
-
"loading translations": "Loading translations\u2026"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
void i18Next.use(initReactI18next).init({
|
|
77
|
-
resources,
|
|
78
|
-
lng: initialLng,
|
|
79
|
-
defaultNS: initialNs,
|
|
80
|
-
interpolation: {
|
|
81
|
-
escapeValue: false
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
var TranslationsContext = /* @__PURE__ */ createContext({
|
|
85
|
-
appNs: initialNs,
|
|
86
|
-
dtLocale: initialDtLocale
|
|
87
|
-
});
|
|
88
|
-
var useTranslation = (...args) => {
|
|
89
|
-
const result = useI18NextTranslation(...args);
|
|
90
|
-
const { dtLocale } = useContext3(TranslationsContext);
|
|
91
|
-
return {
|
|
92
|
-
...result,
|
|
93
|
-
dtLocale
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
var TranslationsProvider = ({ fallback, resourceExtensions, children, appNs, dtLocale }) => {
|
|
97
|
-
var _effect = _useSignals();
|
|
98
|
-
try {
|
|
99
|
-
const [loaded, setLoaded] = useState2(false);
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
setLoaded(false);
|
|
102
|
-
if (resourceExtensions && resourceExtensions.length) {
|
|
103
|
-
resourceExtensions.forEach((resource) => {
|
|
104
|
-
Object.keys(resource).forEach((language) => {
|
|
105
|
-
Object.keys(resource[language]).forEach((ns) => {
|
|
106
|
-
i18Next.addResourceBundle(language, ns, resource[language][ns]);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
setLoaded(true);
|
|
112
|
-
}, [
|
|
113
|
-
resourceExtensions
|
|
114
|
-
]);
|
|
115
|
-
return /* @__PURE__ */ React.createElement(TranslationsContext.Provider, {
|
|
116
|
-
value: {
|
|
117
|
-
appNs: appNs ?? initialNs,
|
|
118
|
-
dtLocale: dtLocale ?? initialDtLocale
|
|
119
|
-
}
|
|
120
|
-
}, /* @__PURE__ */ React.createElement(Suspense, {
|
|
121
|
-
fallback
|
|
122
|
-
}, loaded ? children : fallback));
|
|
123
|
-
} finally {
|
|
124
|
-
_effect.f();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
// src/hooks/useTranslationsContext.ts
|
|
129
|
-
var useTranslationsContext = () => useContext4(TranslationsContext);
|
|
130
|
-
|
|
131
|
-
// src/hooks/useVisualViewport.ts
|
|
132
|
-
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
133
|
-
import { useViewportResize as useViewportResize2 } from "@dxos/react-hooks";
|
|
134
|
-
var useVisualViewport = (deps) => {
|
|
135
|
-
const [width, setWidth] = useState3(null);
|
|
136
|
-
const [height, setHeight] = useState3(null);
|
|
137
|
-
const handleResize = useCallback2(() => {
|
|
138
|
-
if (window.visualViewport) {
|
|
139
|
-
setWidth(window.visualViewport.width);
|
|
140
|
-
setHeight(window.visualViewport.height);
|
|
141
|
-
}
|
|
142
|
-
}, []);
|
|
143
|
-
useViewportResize2(handleResize, deps);
|
|
144
|
-
return {
|
|
145
|
-
width,
|
|
146
|
-
height
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
// src/components/AnchoredOverflow/AnchoredOverflow.tsx
|
|
151
|
-
var AnchoredOverflowRoot = /* @__PURE__ */ forwardRef(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
152
|
-
var _effect = _useSignals2();
|
|
153
|
-
try {
|
|
154
|
-
const { tx } = useThemeContext();
|
|
155
|
-
const Root8 = asChild ? Slot : Primitive.div;
|
|
156
|
-
return /* @__PURE__ */ React2.createElement(Root8, {
|
|
157
|
-
role: "none",
|
|
158
|
-
...props,
|
|
159
|
-
className: tx("anchoredOverflow.root", "overflow-anchored", {}, classNames),
|
|
160
|
-
ref: forwardedRef
|
|
161
|
-
}, children);
|
|
162
|
-
} finally {
|
|
163
|
-
_effect.f();
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
var AnchoredOverflowAnchor = /* @__PURE__ */ forwardRef(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
167
|
-
var _effect = _useSignals2();
|
|
168
|
-
try {
|
|
169
|
-
const { tx } = useThemeContext();
|
|
170
|
-
const Root8 = asChild ? Slot : Primitive.div;
|
|
171
|
-
return /* @__PURE__ */ React2.createElement(Root8, {
|
|
172
|
-
role: "none",
|
|
173
|
-
...props,
|
|
174
|
-
className: tx("anchoredOverflow.anchor", "overflow-anchor", {}, classNames),
|
|
175
|
-
ref: forwardedRef
|
|
176
|
-
}, children);
|
|
177
|
-
} finally {
|
|
178
|
-
_effect.f();
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
var AnchoredOverflow = {
|
|
182
|
-
Root: AnchoredOverflowRoot,
|
|
183
|
-
Anchor: AnchoredOverflowAnchor
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
// src/components/Avatars/Avatar.tsx
|
|
187
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
188
|
-
import "@dxos/lit-ui/dx-avatar.pcss";
|
|
189
|
-
import { createContext as createContext2 } from "@radix-ui/react-context";
|
|
190
|
-
import { Primitive as Primitive2 } from "@radix-ui/react-primitive";
|
|
191
|
-
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
192
|
-
import React3, { forwardRef as forwardRef2 } from "react";
|
|
193
|
-
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
194
|
-
import { useId } from "@dxos/react-hooks";
|
|
195
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
196
|
-
var AVATAR_NAME = "Avatar";
|
|
197
|
-
var [AvatarProvider, useAvatarContext] = createContext2(AVATAR_NAME);
|
|
198
|
-
var AvatarRoot = ({ children, labelId: propsLabelId, descriptionId: propsDescriptionId }) => {
|
|
199
|
-
var _effect = _useSignals3();
|
|
200
|
-
try {
|
|
201
|
-
const labelId = useId("avatar__label", propsLabelId);
|
|
202
|
-
const descriptionId = useId("avatar__description", propsDescriptionId);
|
|
203
|
-
return /* @__PURE__ */ React3.createElement(AvatarProvider, {
|
|
204
|
-
labelId,
|
|
205
|
-
descriptionId
|
|
206
|
-
}, children);
|
|
207
|
-
} finally {
|
|
208
|
-
_effect.f();
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
var AvatarContent = /* @__PURE__ */ forwardRef2(({ icon, classNames, ...props }, forwardedRef) => {
|
|
212
|
-
var _effect = _useSignals3();
|
|
213
|
-
try {
|
|
214
|
-
const href = useIconHref(icon);
|
|
215
|
-
const { labelId, descriptionId } = useAvatarContext("AvatarContent");
|
|
216
|
-
return /* @__PURE__ */ React3.createElement(DxAvatar, {
|
|
217
|
-
...props,
|
|
218
|
-
icon: href,
|
|
219
|
-
"aria-labelledby": labelId,
|
|
220
|
-
"aria-describedby": descriptionId,
|
|
221
|
-
rootClassName: mx(classNames),
|
|
222
|
-
ref: forwardedRef
|
|
223
|
-
});
|
|
224
|
-
} finally {
|
|
225
|
-
_effect.f();
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
var AvatarLabel = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
229
|
-
var _effect = _useSignals3();
|
|
230
|
-
try {
|
|
231
|
-
const Root8 = asChild ? Slot2 : Primitive2.span;
|
|
232
|
-
const { tx } = useThemeContext();
|
|
233
|
-
const { labelId } = useAvatarContext("AvatarLabel");
|
|
234
|
-
return /* @__PURE__ */ React3.createElement(Root8, {
|
|
235
|
-
...props,
|
|
236
|
-
id: labelId,
|
|
237
|
-
ref: forwardedRef,
|
|
238
|
-
className: tx("avatar.label", "avatar__label", {
|
|
239
|
-
srOnly
|
|
240
|
-
}, classNames)
|
|
241
|
-
});
|
|
242
|
-
} finally {
|
|
243
|
-
_effect.f();
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
var AvatarDescription = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
247
|
-
var _effect = _useSignals3();
|
|
248
|
-
try {
|
|
249
|
-
const Root8 = asChild ? Slot2 : Primitive2.span;
|
|
250
|
-
const { tx } = useThemeContext();
|
|
251
|
-
const { descriptionId } = useAvatarContext("AvatarDescription");
|
|
252
|
-
return /* @__PURE__ */ React3.createElement(Root8, {
|
|
253
|
-
...props,
|
|
254
|
-
id: descriptionId,
|
|
255
|
-
ref: forwardedRef,
|
|
256
|
-
className: tx("avatar.description", "avatar__description", {
|
|
257
|
-
srOnly
|
|
258
|
-
}, classNames)
|
|
259
|
-
});
|
|
260
|
-
} finally {
|
|
261
|
-
_effect.f();
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
var Avatar = {
|
|
265
|
-
Root: AvatarRoot,
|
|
266
|
-
Content: AvatarContent,
|
|
267
|
-
Label: AvatarLabel,
|
|
268
|
-
Description: AvatarDescription
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
272
|
-
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
273
|
-
import { Primitive as Primitive4 } from "@radix-ui/react-primitive";
|
|
274
|
-
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
275
|
-
import React6, { forwardRef as forwardRef5 } from "react";
|
|
276
|
-
|
|
277
|
-
// src/components/Icon/Icon.tsx
|
|
278
|
-
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
279
|
-
import React4, { forwardRef as forwardRef3, memo } from "react";
|
|
280
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef3(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
|
|
281
|
-
var _effect = _useSignals4();
|
|
282
|
-
try {
|
|
283
|
-
const { tx } = useThemeContext();
|
|
284
|
-
const href = useIconHref(icon);
|
|
285
|
-
return /* @__PURE__ */ React4.createElement("svg", {
|
|
286
|
-
...props,
|
|
287
|
-
className: tx("icon.root", "icon", {
|
|
288
|
-
size
|
|
289
|
-
}, classNames),
|
|
290
|
-
ref: forwardedRef
|
|
291
|
-
}, /* @__PURE__ */ React4.createElement("use", {
|
|
292
|
-
href
|
|
293
|
-
}));
|
|
294
|
-
} finally {
|
|
295
|
-
_effect.f();
|
|
296
|
-
}
|
|
297
|
-
}));
|
|
298
|
-
|
|
299
|
-
// src/components/Link/Link.tsx
|
|
300
|
-
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
301
|
-
import { Primitive as Primitive3 } from "@radix-ui/react-primitive";
|
|
302
|
-
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
303
|
-
import React5, { forwardRef as forwardRef4 } from "react";
|
|
304
|
-
var Link = /* @__PURE__ */ forwardRef4(({ asChild, variant, classNames, ...props }, forwardedRef) => {
|
|
305
|
-
var _effect = _useSignals5();
|
|
306
|
-
try {
|
|
307
|
-
const { tx } = useThemeContext();
|
|
308
|
-
const Root8 = asChild ? Slot3 : Primitive3.a;
|
|
309
|
-
return /* @__PURE__ */ React5.createElement(Root8, {
|
|
310
|
-
...props,
|
|
311
|
-
className: tx("link.root", "link", {
|
|
312
|
-
variant
|
|
313
|
-
}, classNames),
|
|
314
|
-
ref: forwardedRef
|
|
315
|
-
});
|
|
316
|
-
} finally {
|
|
317
|
-
_effect.f();
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
322
|
-
var BreadcrumbRoot = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
323
|
-
var _effect = _useSignals6();
|
|
324
|
-
try {
|
|
325
|
-
const { tx } = useThemeContext();
|
|
326
|
-
const Root8 = asChild ? Slot4 : Primitive4.div;
|
|
327
|
-
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
328
|
-
role: "navigation",
|
|
329
|
-
...props,
|
|
330
|
-
className: tx("breadcrumb.root", "breadcrumb", {}, classNames),
|
|
331
|
-
ref: forwardedRef
|
|
332
|
-
});
|
|
333
|
-
} finally {
|
|
334
|
-
_effect.f();
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
var BreadcrumbList = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
338
|
-
var _effect = _useSignals6();
|
|
339
|
-
try {
|
|
340
|
-
const { tx } = useThemeContext();
|
|
341
|
-
const Root8 = asChild ? Slot4 : Primitive4.ol;
|
|
342
|
-
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
343
|
-
role: "list",
|
|
344
|
-
...props,
|
|
345
|
-
className: tx("breadcrumb.list", "breadcrumb__list", {}, classNames),
|
|
346
|
-
ref: forwardedRef
|
|
347
|
-
});
|
|
348
|
-
} finally {
|
|
349
|
-
_effect.f();
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
var BreadcrumbListItem = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
353
|
-
var _effect = _useSignals6();
|
|
354
|
-
try {
|
|
355
|
-
const { tx } = useThemeContext();
|
|
356
|
-
const Root8 = asChild ? Slot4 : Primitive4.li;
|
|
357
|
-
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
358
|
-
role: "listitem",
|
|
359
|
-
...props,
|
|
360
|
-
className: tx("breadcrumb.listItem", "breadcrumb__list__item", {}, classNames),
|
|
361
|
-
ref: forwardedRef
|
|
362
|
-
});
|
|
363
|
-
} finally {
|
|
364
|
-
_effect.f();
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
var BreadcrumbLink = /* @__PURE__ */ forwardRef5(({ asChild, ...props }, forwardedRef) => {
|
|
368
|
-
var _effect = _useSignals6();
|
|
369
|
-
try {
|
|
370
|
-
const Root8 = asChild ? Slot4 : Link;
|
|
371
|
-
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
372
|
-
...props,
|
|
373
|
-
ref: forwardedRef
|
|
374
|
-
});
|
|
375
|
-
} finally {
|
|
376
|
-
_effect.f();
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
var BreadcrumbCurrent = /* @__PURE__ */ forwardRef5(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
380
|
-
var _effect = _useSignals6();
|
|
381
|
-
try {
|
|
382
|
-
const { tx } = useThemeContext();
|
|
383
|
-
const Root8 = asChild ? Slot4 : "h1";
|
|
384
|
-
return /* @__PURE__ */ React6.createElement(Root8, {
|
|
385
|
-
...props,
|
|
386
|
-
"aria-current": "page",
|
|
387
|
-
className: tx("breadcrumb.current", "breadcrumb__item__heading--current", {}, classNames),
|
|
388
|
-
ref: forwardedRef
|
|
389
|
-
});
|
|
390
|
-
} finally {
|
|
391
|
-
_effect.f();
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
var BreadcrumbSeparator = ({ children, classNames, ...props }) => {
|
|
395
|
-
var _effect = _useSignals6();
|
|
396
|
-
try {
|
|
397
|
-
const { tx } = useThemeContext();
|
|
398
|
-
return /* @__PURE__ */ React6.createElement(Primitive4.span, {
|
|
399
|
-
role: "separator",
|
|
400
|
-
"aria-hidden": "true",
|
|
401
|
-
...props,
|
|
402
|
-
className: tx("breadcrumb.separator", "breadcrumb__separator", {}, classNames)
|
|
403
|
-
}, children ?? /* @__PURE__ */ React6.createElement(Icon, {
|
|
404
|
-
icon: "ph--dot--bold"
|
|
405
|
-
}));
|
|
406
|
-
} finally {
|
|
407
|
-
_effect.f();
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
var Breadcrumb = {
|
|
411
|
-
Root: BreadcrumbRoot,
|
|
412
|
-
List: BreadcrumbList,
|
|
413
|
-
ListItem: BreadcrumbListItem,
|
|
414
|
-
Link: BreadcrumbLink,
|
|
415
|
-
Current: BreadcrumbCurrent,
|
|
416
|
-
Separator: BreadcrumbSeparator
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
// src/components/Button/Button.tsx
|
|
420
|
-
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
421
|
-
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
422
|
-
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
423
|
-
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
424
|
-
import React7, { forwardRef as forwardRef6, memo as memo2 } from "react";
|
|
425
|
-
var BUTTON_GROUP_NAME = "ButtonGroup";
|
|
426
|
-
var BUTTON_NAME = "Button";
|
|
427
|
-
var [ButtonGroupProvider, useButtonGroupContext] = createContext3(BUTTON_GROUP_NAME, {
|
|
428
|
-
inGroup: false
|
|
429
|
-
});
|
|
430
|
-
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef6(({ classNames, children, density: propsDensity, elevation: propsElevation, variant = "default", asChild, ...props }, ref) => {
|
|
431
|
-
var _effect = _useSignals7();
|
|
432
|
-
try {
|
|
433
|
-
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
434
|
-
const { tx } = useThemeContext();
|
|
435
|
-
const elevation = useElevationContext(propsElevation);
|
|
436
|
-
const density = useDensityContext(propsDensity);
|
|
437
|
-
const Root8 = asChild ? Slot5 : Primitive5.button;
|
|
438
|
-
return /* @__PURE__ */ React7.createElement(Root8, {
|
|
439
|
-
ref,
|
|
440
|
-
...props,
|
|
441
|
-
"data-variant": variant,
|
|
442
|
-
"data-density": density,
|
|
443
|
-
"data-props": inGroup ? "grouped" : "",
|
|
444
|
-
className: tx("button.root", "button", {
|
|
445
|
-
variant,
|
|
446
|
-
inGroup,
|
|
447
|
-
disabled: props.disabled,
|
|
448
|
-
density,
|
|
449
|
-
elevation
|
|
450
|
-
}, classNames),
|
|
451
|
-
...props.disabled && {
|
|
452
|
-
disabled: true
|
|
453
|
-
}
|
|
454
|
-
}, children);
|
|
455
|
-
} finally {
|
|
456
|
-
_effect.f();
|
|
457
|
-
}
|
|
458
|
-
}));
|
|
459
|
-
Button.displayName = BUTTON_NAME;
|
|
460
|
-
var ButtonGroup = /* @__PURE__ */ forwardRef6(({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {
|
|
461
|
-
var _effect = _useSignals7();
|
|
462
|
-
try {
|
|
463
|
-
const { tx } = useThemeContext();
|
|
464
|
-
const elevation = useElevationContext(propsElevation);
|
|
465
|
-
const Root8 = asChild ? Slot5 : Primitive5.div;
|
|
466
|
-
return /* @__PURE__ */ React7.createElement(Root8, {
|
|
467
|
-
role: "none",
|
|
468
|
-
...props,
|
|
469
|
-
className: tx("button.group", "button-group", {
|
|
470
|
-
elevation
|
|
471
|
-
}, classNames),
|
|
472
|
-
ref: forwardedRef
|
|
473
|
-
}, /* @__PURE__ */ React7.createElement(ButtonGroupProvider, {
|
|
474
|
-
inGroup: true
|
|
475
|
-
}, children));
|
|
476
|
-
} finally {
|
|
477
|
-
_effect.f();
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
481
|
-
|
|
482
|
-
// src/components/Button/IconButton.tsx
|
|
483
|
-
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
484
|
-
import React9, { forwardRef as forwardRef8 } from "react";
|
|
485
|
-
|
|
486
|
-
// src/components/Tooltip/Tooltip.tsx
|
|
487
|
-
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
488
|
-
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
489
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
490
|
-
import { createContextScope } from "@radix-ui/react-context";
|
|
491
|
-
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
492
|
-
import { useId as useId2 } from "@radix-ui/react-id";
|
|
493
|
-
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
494
|
-
import { createPopperScope } from "@radix-ui/react-popper";
|
|
495
|
-
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
496
|
-
import { Presence } from "@radix-ui/react-presence";
|
|
497
|
-
import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
|
|
498
|
-
import { Slottable } from "@radix-ui/react-slot";
|
|
499
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
500
|
-
import * as VisuallyHiddenPrimitive from "@radix-ui/react-visually-hidden";
|
|
501
|
-
import React8, { forwardRef as forwardRef7, useCallback as useCallback3, useEffect as useEffect2, useMemo, useRef, useState as useState4 } from "react";
|
|
502
|
-
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
503
|
-
createPopperScope
|
|
504
|
-
]);
|
|
505
|
-
var usePopperScope = createPopperScope();
|
|
506
|
-
var DEFAULT_DELAY_DURATION = 700;
|
|
507
|
-
var TOOLTIP_OPEN = "tooltip.open";
|
|
508
|
-
var TOOLTIP_NAME = "Tooltip";
|
|
509
|
-
var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
|
|
510
|
-
var TooltipProvider = (props) => {
|
|
511
|
-
var _effect = _useSignals8();
|
|
512
|
-
try {
|
|
513
|
-
const { __scopeTooltip, children, open: openProp, defaultOpen = false, onOpenChange, disableHoverableContent = false, delayDuration = DEFAULT_DELAY_DURATION, skipDelayDuration = 300 } = props;
|
|
514
|
-
const isOpenDelayedRef = useRef(true);
|
|
515
|
-
const isPointerInTransitRef = useRef(false);
|
|
516
|
-
const skipDelayTimerRef = useRef(0);
|
|
517
|
-
useEffect2(() => {
|
|
518
|
-
const skipDelayTimer = skipDelayTimerRef.current;
|
|
519
|
-
return () => window.clearTimeout(skipDelayTimer);
|
|
520
|
-
}, []);
|
|
521
|
-
const popperScope = usePopperScope(__scopeTooltip);
|
|
522
|
-
const [trigger, setTrigger] = useState4(null);
|
|
523
|
-
const [content, setContent] = useState4("");
|
|
524
|
-
const [side, setSide] = useState4(void 0);
|
|
525
|
-
const triggerRef = useRef(trigger);
|
|
526
|
-
const handleTriggerChange = useCallback3((nextTrigger) => {
|
|
527
|
-
setTrigger(nextTrigger);
|
|
528
|
-
triggerRef.current = nextTrigger;
|
|
529
|
-
setContent(nextTrigger?.getAttribute("data-tooltip-content") ?? "");
|
|
530
|
-
setSide(nextTrigger?.getAttribute("data-tooltip-side") ?? void 0);
|
|
531
|
-
}, []);
|
|
532
|
-
const contentId = useId2();
|
|
533
|
-
const openTimerRef = useRef(0);
|
|
534
|
-
const wasOpenDelayedRef = useRef(false);
|
|
535
|
-
const handleOpenChange = useCallback3((open2) => {
|
|
536
|
-
if (open2) {
|
|
537
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
538
|
-
isOpenDelayedRef.current = false;
|
|
539
|
-
document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
|
|
540
|
-
} else {
|
|
541
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
542
|
-
skipDelayTimerRef.current = window.setTimeout(() => isOpenDelayedRef.current = true, skipDelayDuration);
|
|
543
|
-
}
|
|
544
|
-
onOpenChange?.(open2);
|
|
545
|
-
}, [
|
|
546
|
-
skipDelayDuration,
|
|
547
|
-
onOpenChange
|
|
548
|
-
]);
|
|
549
|
-
const [open = false, setOpen] = useControllableState({
|
|
550
|
-
prop: openProp,
|
|
551
|
-
defaultProp: defaultOpen,
|
|
552
|
-
onChange: handleOpenChange
|
|
553
|
-
});
|
|
554
|
-
const stateAttribute = useMemo(() => {
|
|
555
|
-
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
556
|
-
}, [
|
|
557
|
-
open
|
|
558
|
-
]);
|
|
559
|
-
const handleOpen = useCallback3(() => {
|
|
560
|
-
window.clearTimeout(openTimerRef.current);
|
|
561
|
-
openTimerRef.current = 0;
|
|
562
|
-
wasOpenDelayedRef.current = false;
|
|
563
|
-
setOpen(true);
|
|
564
|
-
}, [
|
|
565
|
-
setOpen
|
|
566
|
-
]);
|
|
567
|
-
const handleClose = useCallback3(() => {
|
|
568
|
-
window.clearTimeout(openTimerRef.current);
|
|
569
|
-
openTimerRef.current = 0;
|
|
570
|
-
setOpen(false);
|
|
571
|
-
}, [
|
|
572
|
-
setOpen
|
|
573
|
-
]);
|
|
574
|
-
const handleDelayedOpen = useCallback3(() => {
|
|
575
|
-
window.clearTimeout(openTimerRef.current);
|
|
576
|
-
openTimerRef.current = window.setTimeout(() => {
|
|
577
|
-
wasOpenDelayedRef.current = true;
|
|
578
|
-
setOpen(true);
|
|
579
|
-
openTimerRef.current = 0;
|
|
580
|
-
}, delayDuration);
|
|
581
|
-
}, [
|
|
582
|
-
delayDuration,
|
|
583
|
-
setOpen
|
|
584
|
-
]);
|
|
585
|
-
useEffect2(() => {
|
|
586
|
-
return () => {
|
|
587
|
-
if (openTimerRef.current) {
|
|
588
|
-
window.clearTimeout(openTimerRef.current);
|
|
589
|
-
openTimerRef.current = 0;
|
|
590
|
-
}
|
|
591
|
-
};
|
|
592
|
-
}, []);
|
|
593
|
-
const { tx } = useThemeContext();
|
|
594
|
-
const elevation = useElevationContext();
|
|
595
|
-
return /* @__PURE__ */ React8.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React8.createElement(TooltipContextProvider, {
|
|
596
|
-
scope: __scopeTooltip,
|
|
597
|
-
contentId,
|
|
598
|
-
open,
|
|
599
|
-
stateAttribute,
|
|
600
|
-
trigger,
|
|
601
|
-
onTriggerChange: handleTriggerChange,
|
|
602
|
-
onTriggerEnter: useCallback3(() => {
|
|
603
|
-
if (isOpenDelayedRef.current) {
|
|
604
|
-
handleDelayedOpen();
|
|
605
|
-
} else {
|
|
606
|
-
handleOpen();
|
|
607
|
-
}
|
|
608
|
-
}, [
|
|
609
|
-
isOpenDelayedRef,
|
|
610
|
-
handleDelayedOpen,
|
|
611
|
-
handleOpen
|
|
612
|
-
]),
|
|
613
|
-
onTriggerLeave: useCallback3(() => {
|
|
614
|
-
if (disableHoverableContent) {
|
|
615
|
-
handleClose();
|
|
616
|
-
} else {
|
|
617
|
-
window.clearTimeout(openTimerRef.current);
|
|
618
|
-
openTimerRef.current = 0;
|
|
619
|
-
}
|
|
620
|
-
}, [
|
|
621
|
-
handleClose,
|
|
622
|
-
disableHoverableContent
|
|
623
|
-
]),
|
|
624
|
-
onOpen: handleOpen,
|
|
625
|
-
onClose: handleClose,
|
|
626
|
-
disableHoverableContent,
|
|
627
|
-
isPointerInTransitRef,
|
|
628
|
-
onPointerInTransitChange: useCallback3((inTransit) => {
|
|
629
|
-
isPointerInTransitRef.current = inTransit;
|
|
630
|
-
}, [])
|
|
631
|
-
}, /* @__PURE__ */ React8.createElement(TooltipContent, {
|
|
632
|
-
side,
|
|
633
|
-
className: tx("tooltip.content", "tooltip", {
|
|
634
|
-
elevation
|
|
635
|
-
})
|
|
636
|
-
}, content, /* @__PURE__ */ React8.createElement(TooltipArrow, {
|
|
637
|
-
className: tx("tooltip.arrow", "tooltip__arrow")
|
|
638
|
-
})), /* @__PURE__ */ React8.createElement(TooltipVirtualTrigger, {
|
|
639
|
-
virtualRef: triggerRef
|
|
640
|
-
}), children));
|
|
641
|
-
} finally {
|
|
642
|
-
_effect.f();
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
|
-
TooltipProvider.displayName = TOOLTIP_NAME;
|
|
646
|
-
var TooltipVirtualTrigger = ({ virtualRef, __scopeTooltip }) => {
|
|
647
|
-
var _effect = _useSignals8();
|
|
648
|
-
try {
|
|
649
|
-
const popperScope = usePopperScope(__scopeTooltip);
|
|
650
|
-
return /* @__PURE__ */ React8.createElement(PopperPrimitive.Anchor, {
|
|
651
|
-
asChild: true,
|
|
652
|
-
...popperScope,
|
|
653
|
-
virtualRef
|
|
654
|
-
});
|
|
655
|
-
} finally {
|
|
656
|
-
_effect.f();
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
var TRIGGER_NAME = "TooltipTrigger";
|
|
660
|
-
var TooltipTrigger = /* @__PURE__ */ forwardRef7((props, forwardedRef) => {
|
|
661
|
-
var _effect = _useSignals8();
|
|
662
|
-
try {
|
|
663
|
-
const {
|
|
664
|
-
__scopeTooltip,
|
|
665
|
-
onInteract,
|
|
666
|
-
// TODO(thure): Pass `delayDuration` into the context.
|
|
667
|
-
delayDuration: _delayDuration,
|
|
668
|
-
side,
|
|
669
|
-
content,
|
|
670
|
-
...triggerProps
|
|
671
|
-
} = props;
|
|
672
|
-
const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);
|
|
673
|
-
const ref = useRef(null);
|
|
674
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
675
|
-
const isPointerDownRef = useRef(false);
|
|
676
|
-
const hasPointerMoveOpenedRef = useRef(false);
|
|
677
|
-
const handlePointerUp = useCallback3(() => isPointerDownRef.current = false, []);
|
|
678
|
-
useEffect2(() => {
|
|
679
|
-
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
680
|
-
}, [
|
|
681
|
-
handlePointerUp
|
|
682
|
-
]);
|
|
683
|
-
return /* @__PURE__ */ React8.createElement(Primitive6.button, {
|
|
684
|
-
// We purposefully avoid adding `type=button` here because tooltip triggers are also
|
|
685
|
-
// commonly anchors and the anchor `type` attribute signifies MIME type.
|
|
686
|
-
"aria-describedby": context.open ? context.contentId : void 0,
|
|
687
|
-
"data-state": context.stateAttribute,
|
|
688
|
-
"data-tooltip-content": content,
|
|
689
|
-
"data-tooltip-side": side,
|
|
690
|
-
...triggerProps,
|
|
691
|
-
ref: composedRefs,
|
|
692
|
-
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
|
|
693
|
-
if (event.pointerType === "touch") {
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
if (!hasPointerMoveOpenedRef.current && !context.isPointerInTransitRef.current) {
|
|
697
|
-
onInteract?.(event);
|
|
698
|
-
if (event.defaultPrevented) {
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
context.onTriggerChange(ref.current);
|
|
702
|
-
context.onTriggerEnter();
|
|
703
|
-
hasPointerMoveOpenedRef.current = true;
|
|
704
|
-
}
|
|
705
|
-
}),
|
|
706
|
-
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {
|
|
707
|
-
context.onTriggerLeave();
|
|
708
|
-
hasPointerMoveOpenedRef.current = false;
|
|
709
|
-
}),
|
|
710
|
-
onPointerDown: composeEventHandlers(props.onPointerDown, () => {
|
|
711
|
-
if (context.open) {
|
|
712
|
-
context.onClose();
|
|
713
|
-
}
|
|
714
|
-
isPointerDownRef.current = true;
|
|
715
|
-
document.addEventListener("pointerup", handlePointerUp, {
|
|
716
|
-
once: true
|
|
717
|
-
});
|
|
718
|
-
}),
|
|
719
|
-
onFocus: props.onFocus,
|
|
720
|
-
onBlur: composeEventHandlers(props.onBlur, context.onClose),
|
|
721
|
-
onClick: composeEventHandlers(props.onClick, context.onClose)
|
|
722
|
-
});
|
|
723
|
-
} finally {
|
|
724
|
-
_effect.f();
|
|
725
|
-
}
|
|
726
|
-
});
|
|
727
|
-
TooltipTrigger.displayName = TRIGGER_NAME;
|
|
728
|
-
var PORTAL_NAME = "TooltipPortal";
|
|
729
|
-
var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
|
730
|
-
forceMount: void 0
|
|
731
|
-
});
|
|
732
|
-
var TooltipPortal = (props) => {
|
|
733
|
-
var _effect = _useSignals8();
|
|
734
|
-
try {
|
|
735
|
-
const { __scopeTooltip, forceMount, children, container } = props;
|
|
736
|
-
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
|
737
|
-
return /* @__PURE__ */ React8.createElement(PortalProvider, {
|
|
738
|
-
scope: __scopeTooltip,
|
|
739
|
-
forceMount
|
|
740
|
-
}, /* @__PURE__ */ React8.createElement(Presence, {
|
|
741
|
-
present: forceMount || context.open
|
|
742
|
-
}, /* @__PURE__ */ React8.createElement(PortalPrimitive, {
|
|
743
|
-
asChild: true,
|
|
744
|
-
container
|
|
745
|
-
}, children)));
|
|
746
|
-
} finally {
|
|
747
|
-
_effect.f();
|
|
748
|
-
}
|
|
749
|
-
};
|
|
750
|
-
TooltipPortal.displayName = PORTAL_NAME;
|
|
751
|
-
var CONTENT_NAME = "TooltipContent";
|
|
752
|
-
var TooltipContent = /* @__PURE__ */ forwardRef7((props, forwardedRef) => {
|
|
753
|
-
var _effect = _useSignals8();
|
|
754
|
-
try {
|
|
755
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
|
756
|
-
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
757
|
-
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
758
|
-
return /* @__PURE__ */ React8.createElement(Presence, {
|
|
759
|
-
present: forceMount || context.open
|
|
760
|
-
}, context.disableHoverableContent ? /* @__PURE__ */ React8.createElement(TooltipContentImpl, {
|
|
761
|
-
side,
|
|
762
|
-
...contentProps,
|
|
763
|
-
ref: forwardedRef
|
|
764
|
-
}) : /* @__PURE__ */ React8.createElement(TooltipContentHoverable, {
|
|
765
|
-
side,
|
|
766
|
-
...contentProps,
|
|
767
|
-
ref: forwardedRef
|
|
768
|
-
}));
|
|
769
|
-
} finally {
|
|
770
|
-
_effect.f();
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
var TooltipContentHoverable = /* @__PURE__ */ forwardRef7((props, forwardedRef) => {
|
|
774
|
-
var _effect = _useSignals8();
|
|
775
|
-
try {
|
|
776
|
-
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
777
|
-
const ref = useRef(null);
|
|
778
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
779
|
-
const [pointerGraceArea, setPointerGraceArea] = useState4(null);
|
|
780
|
-
const { trigger, onClose } = context;
|
|
781
|
-
const content = ref.current;
|
|
782
|
-
const { onPointerInTransitChange } = context;
|
|
783
|
-
const handleRemoveGraceArea = useCallback3(() => {
|
|
784
|
-
setPointerGraceArea(null);
|
|
785
|
-
onPointerInTransitChange(false);
|
|
786
|
-
}, [
|
|
787
|
-
onPointerInTransitChange
|
|
788
|
-
]);
|
|
789
|
-
const handleCreateGraceArea = useCallback3((event, hoverTarget) => {
|
|
790
|
-
const currentTarget = event.currentTarget;
|
|
791
|
-
const exitPoint = {
|
|
792
|
-
x: event.clientX,
|
|
793
|
-
y: event.clientY
|
|
794
|
-
};
|
|
795
|
-
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
796
|
-
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
|
797
|
-
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
|
798
|
-
const graceArea = getHull([
|
|
799
|
-
...paddedExitPoints,
|
|
800
|
-
...hoverTargetPoints
|
|
801
|
-
]);
|
|
802
|
-
setPointerGraceArea(graceArea);
|
|
803
|
-
onPointerInTransitChange(true);
|
|
804
|
-
}, [
|
|
805
|
-
onPointerInTransitChange
|
|
806
|
-
]);
|
|
807
|
-
useEffect2(() => {
|
|
808
|
-
return () => handleRemoveGraceArea();
|
|
809
|
-
}, [
|
|
810
|
-
handleRemoveGraceArea
|
|
811
|
-
]);
|
|
812
|
-
useEffect2(() => {
|
|
813
|
-
if (trigger && content) {
|
|
814
|
-
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
815
|
-
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
816
|
-
trigger.addEventListener("pointerleave", handleTriggerLeave);
|
|
817
|
-
content.addEventListener("pointerleave", handleContentLeave);
|
|
818
|
-
return () => {
|
|
819
|
-
trigger.removeEventListener("pointerleave", handleTriggerLeave);
|
|
820
|
-
content.removeEventListener("pointerleave", handleContentLeave);
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
}, [
|
|
824
|
-
trigger,
|
|
825
|
-
content,
|
|
826
|
-
handleCreateGraceArea,
|
|
827
|
-
handleRemoveGraceArea
|
|
828
|
-
]);
|
|
829
|
-
useEffect2(() => {
|
|
830
|
-
if (pointerGraceArea) {
|
|
831
|
-
const handleTrackPointerGrace = (event) => {
|
|
832
|
-
const target = event.target;
|
|
833
|
-
const pointerPosition = {
|
|
834
|
-
x: event.clientX,
|
|
835
|
-
y: event.clientY
|
|
836
|
-
};
|
|
837
|
-
const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);
|
|
838
|
-
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
|
|
839
|
-
if (hasEnteredTarget) {
|
|
840
|
-
handleRemoveGraceArea();
|
|
841
|
-
} else if (isPointerOutsideGraceArea) {
|
|
842
|
-
handleRemoveGraceArea();
|
|
843
|
-
onClose();
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
document.addEventListener("pointermove", handleTrackPointerGrace);
|
|
847
|
-
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
848
|
-
}
|
|
849
|
-
}, [
|
|
850
|
-
trigger,
|
|
851
|
-
content,
|
|
852
|
-
pointerGraceArea,
|
|
853
|
-
onClose,
|
|
854
|
-
handleRemoveGraceArea
|
|
855
|
-
]);
|
|
856
|
-
return /* @__PURE__ */ React8.createElement(TooltipContentImpl, {
|
|
857
|
-
...props,
|
|
858
|
-
ref: composedRefs
|
|
859
|
-
});
|
|
860
|
-
} finally {
|
|
861
|
-
_effect.f();
|
|
862
|
-
}
|
|
863
|
-
});
|
|
864
|
-
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, {
|
|
865
|
-
isInside: false
|
|
866
|
-
});
|
|
867
|
-
var TooltipContentImpl = /* @__PURE__ */ forwardRef7((props, forwardedRef) => {
|
|
868
|
-
var _effect = _useSignals8();
|
|
869
|
-
try {
|
|
870
|
-
const { __scopeTooltip, children, "aria-label": ariaLabel, onEscapeKeyDown, onPointerDownOutside, ...contentProps } = props;
|
|
871
|
-
const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);
|
|
872
|
-
const popperScope = usePopperScope(__scopeTooltip);
|
|
873
|
-
const { onClose } = context;
|
|
874
|
-
useEffect2(() => {
|
|
875
|
-
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
876
|
-
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
877
|
-
}, [
|
|
878
|
-
onClose
|
|
879
|
-
]);
|
|
880
|
-
useEffect2(() => {
|
|
881
|
-
if (context.trigger) {
|
|
882
|
-
const handleScroll = (event) => {
|
|
883
|
-
const target = event.target;
|
|
884
|
-
if (target?.contains(context.trigger)) {
|
|
885
|
-
onClose();
|
|
886
|
-
}
|
|
887
|
-
};
|
|
888
|
-
window.addEventListener("scroll", handleScroll, {
|
|
889
|
-
capture: true
|
|
890
|
-
});
|
|
891
|
-
return () => window.removeEventListener("scroll", handleScroll, {
|
|
892
|
-
capture: true
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
}, [
|
|
896
|
-
context.trigger,
|
|
897
|
-
onClose
|
|
898
|
-
]);
|
|
899
|
-
return /* @__PURE__ */ React8.createElement(DismissableLayer, {
|
|
900
|
-
asChild: true,
|
|
901
|
-
disableOutsidePointerEvents: false,
|
|
902
|
-
onEscapeKeyDown,
|
|
903
|
-
onPointerDownOutside,
|
|
904
|
-
onFocusOutside: (event) => event.preventDefault(),
|
|
905
|
-
onDismiss: onClose
|
|
906
|
-
}, /* @__PURE__ */ React8.createElement(PopperPrimitive.Content, {
|
|
907
|
-
"data-state": context.stateAttribute,
|
|
908
|
-
...popperScope,
|
|
909
|
-
...contentProps,
|
|
910
|
-
ref: forwardedRef,
|
|
911
|
-
style: {
|
|
912
|
-
...contentProps.style,
|
|
913
|
-
// re-namespace exposed content custom properties
|
|
914
|
-
...{
|
|
915
|
-
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
916
|
-
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
917
|
-
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
918
|
-
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
919
|
-
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
}, /* @__PURE__ */ React8.createElement(Slottable, null, children), /* @__PURE__ */ React8.createElement(VisuallyHiddenContentContextProvider, {
|
|
923
|
-
scope: __scopeTooltip,
|
|
924
|
-
isInside: true
|
|
925
|
-
}, /* @__PURE__ */ React8.createElement(VisuallyHiddenPrimitive.Root, {
|
|
926
|
-
id: context.contentId,
|
|
927
|
-
role: "tooltip"
|
|
928
|
-
}, ariaLabel || children))));
|
|
929
|
-
} finally {
|
|
930
|
-
_effect.f();
|
|
931
|
-
}
|
|
932
|
-
});
|
|
933
|
-
TooltipContent.displayName = CONTENT_NAME;
|
|
934
|
-
var ARROW_NAME = "TooltipArrow";
|
|
935
|
-
var TooltipArrow = /* @__PURE__ */ forwardRef7((props, forwardedRef) => {
|
|
936
|
-
var _effect = _useSignals8();
|
|
937
|
-
try {
|
|
938
|
-
const { __scopeTooltip, ...arrowProps } = props;
|
|
939
|
-
const popperScope = usePopperScope(__scopeTooltip);
|
|
940
|
-
const visuallyHiddenContentContext = useVisuallyHiddenContentContext(ARROW_NAME, __scopeTooltip);
|
|
941
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ React8.createElement(PopperPrimitive.Arrow, {
|
|
942
|
-
...popperScope,
|
|
943
|
-
...arrowProps,
|
|
944
|
-
ref: forwardedRef
|
|
945
|
-
});
|
|
946
|
-
} finally {
|
|
947
|
-
_effect.f();
|
|
948
|
-
}
|
|
949
|
-
});
|
|
950
|
-
TooltipArrow.displayName = ARROW_NAME;
|
|
951
|
-
var getExitSideFromRect = (point, rect) => {
|
|
952
|
-
const top = Math.abs(rect.top - point.y);
|
|
953
|
-
const bottom = Math.abs(rect.bottom - point.y);
|
|
954
|
-
const right = Math.abs(rect.right - point.x);
|
|
955
|
-
const left = Math.abs(rect.left - point.x);
|
|
956
|
-
switch (Math.min(top, bottom, right, left)) {
|
|
957
|
-
case left:
|
|
958
|
-
return "left";
|
|
959
|
-
case right:
|
|
960
|
-
return "right";
|
|
961
|
-
case top:
|
|
962
|
-
return "top";
|
|
963
|
-
case bottom:
|
|
964
|
-
return "bottom";
|
|
965
|
-
default:
|
|
966
|
-
throw new Error("unreachable");
|
|
967
|
-
}
|
|
968
|
-
};
|
|
969
|
-
var getPaddedExitPoints = (exitPoint, exitSide, padding = 5) => {
|
|
970
|
-
const paddedExitPoints = [];
|
|
971
|
-
switch (exitSide) {
|
|
972
|
-
case "top":
|
|
973
|
-
paddedExitPoints.push({
|
|
974
|
-
x: exitPoint.x - padding,
|
|
975
|
-
y: exitPoint.y + padding
|
|
976
|
-
}, {
|
|
977
|
-
x: exitPoint.x + padding,
|
|
978
|
-
y: exitPoint.y + padding
|
|
979
|
-
});
|
|
980
|
-
break;
|
|
981
|
-
case "bottom":
|
|
982
|
-
paddedExitPoints.push({
|
|
983
|
-
x: exitPoint.x - padding,
|
|
984
|
-
y: exitPoint.y - padding
|
|
985
|
-
}, {
|
|
986
|
-
x: exitPoint.x + padding,
|
|
987
|
-
y: exitPoint.y - padding
|
|
988
|
-
});
|
|
989
|
-
break;
|
|
990
|
-
case "left":
|
|
991
|
-
paddedExitPoints.push({
|
|
992
|
-
x: exitPoint.x + padding,
|
|
993
|
-
y: exitPoint.y - padding
|
|
994
|
-
}, {
|
|
995
|
-
x: exitPoint.x + padding,
|
|
996
|
-
y: exitPoint.y + padding
|
|
997
|
-
});
|
|
998
|
-
break;
|
|
999
|
-
case "right":
|
|
1000
|
-
paddedExitPoints.push({
|
|
1001
|
-
x: exitPoint.x - padding,
|
|
1002
|
-
y: exitPoint.y - padding
|
|
1003
|
-
}, {
|
|
1004
|
-
x: exitPoint.x - padding,
|
|
1005
|
-
y: exitPoint.y + padding
|
|
1006
|
-
});
|
|
1007
|
-
break;
|
|
1008
|
-
}
|
|
1009
|
-
return paddedExitPoints;
|
|
1010
|
-
};
|
|
1011
|
-
var getPointsFromRect = (rect) => {
|
|
1012
|
-
const { top, right, bottom, left } = rect;
|
|
1013
|
-
return [
|
|
1014
|
-
{
|
|
1015
|
-
x: left,
|
|
1016
|
-
y: top
|
|
1017
|
-
},
|
|
1018
|
-
{
|
|
1019
|
-
x: right,
|
|
1020
|
-
y: top
|
|
1021
|
-
},
|
|
1022
|
-
{
|
|
1023
|
-
x: right,
|
|
1024
|
-
y: bottom
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
x: left,
|
|
1028
|
-
y: bottom
|
|
1029
|
-
}
|
|
1030
|
-
];
|
|
1031
|
-
};
|
|
1032
|
-
var isPointInPolygon = (point, polygon) => {
|
|
1033
|
-
const { x, y } = point;
|
|
1034
|
-
let inside = false;
|
|
1035
|
-
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
1036
|
-
const xi = polygon[i].x;
|
|
1037
|
-
const yi = polygon[i].y;
|
|
1038
|
-
const xj = polygon[j].x;
|
|
1039
|
-
const yj = polygon[j].y;
|
|
1040
|
-
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
1041
|
-
if (intersect) {
|
|
1042
|
-
inside = !inside;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
return inside;
|
|
1046
|
-
};
|
|
1047
|
-
var getHull = (points) => {
|
|
1048
|
-
const newPoints = points.slice();
|
|
1049
|
-
newPoints.sort((a, b) => {
|
|
1050
|
-
if (a.x < b.x) {
|
|
1051
|
-
return -1;
|
|
1052
|
-
} else if (a.x > b.x) {
|
|
1053
|
-
return 1;
|
|
1054
|
-
} else if (a.y < b.y) {
|
|
1055
|
-
return -1;
|
|
1056
|
-
} else if (a.y > b.y) {
|
|
1057
|
-
return 1;
|
|
1058
|
-
} else {
|
|
1059
|
-
return 0;
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
return getHullPresorted(newPoints);
|
|
1063
|
-
};
|
|
1064
|
-
var getHullPresorted = (points) => {
|
|
1065
|
-
if (points.length <= 1) {
|
|
1066
|
-
return points.slice();
|
|
1067
|
-
}
|
|
1068
|
-
const upperHull = [];
|
|
1069
|
-
for (let i = 0; i < points.length; i++) {
|
|
1070
|
-
const p = points[i];
|
|
1071
|
-
while (upperHull.length >= 2) {
|
|
1072
|
-
const q = upperHull[upperHull.length - 1];
|
|
1073
|
-
const r = upperHull[upperHull.length - 2];
|
|
1074
|
-
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) {
|
|
1075
|
-
upperHull.pop();
|
|
1076
|
-
} else {
|
|
1077
|
-
break;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
upperHull.push(p);
|
|
1081
|
-
}
|
|
1082
|
-
upperHull.pop();
|
|
1083
|
-
const lowerHull = [];
|
|
1084
|
-
for (let i = points.length - 1; i >= 0; i--) {
|
|
1085
|
-
const p = points[i];
|
|
1086
|
-
while (lowerHull.length >= 2) {
|
|
1087
|
-
const q = lowerHull[lowerHull.length - 1];
|
|
1088
|
-
const r = lowerHull[lowerHull.length - 2];
|
|
1089
|
-
if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) {
|
|
1090
|
-
lowerHull.pop();
|
|
1091
|
-
} else {
|
|
1092
|
-
break;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
lowerHull.push(p);
|
|
1096
|
-
}
|
|
1097
|
-
lowerHull.pop();
|
|
1098
|
-
if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {
|
|
1099
|
-
return upperHull;
|
|
1100
|
-
} else {
|
|
1101
|
-
return upperHull.concat(lowerHull);
|
|
1102
|
-
}
|
|
1103
|
-
};
|
|
1104
|
-
var Tooltip = {
|
|
1105
|
-
Provider: TooltipProvider,
|
|
1106
|
-
Trigger: TooltipTrigger
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
// src/components/Button/IconButton.tsx
|
|
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) => {
|
|
1125
|
-
var _effect = _useSignals9();
|
|
1126
|
-
try {
|
|
1127
|
-
if (noTooltip) {
|
|
1128
|
-
return /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1129
|
-
...props,
|
|
1130
|
-
ref: forwardedRef
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
return /* @__PURE__ */ React9.createElement(Tooltip.Trigger, {
|
|
1134
|
-
asChild: true,
|
|
1135
|
-
content: props.label,
|
|
1136
|
-
side: tooltipSide
|
|
1137
|
-
}, /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
1138
|
-
...props,
|
|
1139
|
-
ref: forwardedRef
|
|
1140
|
-
}));
|
|
1141
|
-
} finally {
|
|
1142
|
-
_effect.f();
|
|
1143
|
-
}
|
|
1144
|
-
});
|
|
1145
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size = 5, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
1146
|
-
var _effect = _useSignals9();
|
|
1147
|
-
try {
|
|
1148
|
-
const { tx } = useThemeContext();
|
|
1149
|
-
return /* @__PURE__ */ React9.createElement(Button, {
|
|
1150
|
-
...props,
|
|
1151
|
-
classNames: tx("iconButton.root", "iconButton", {
|
|
1152
|
-
iconOnly
|
|
1153
|
-
}, classNames),
|
|
1154
|
-
ref: forwardedRef
|
|
1155
|
-
}, icon && /* @__PURE__ */ React9.createElement(Icon, {
|
|
1156
|
-
icon,
|
|
1157
|
-
size,
|
|
1158
|
-
classNames: iconClassNames
|
|
1159
|
-
}), /* @__PURE__ */ React9.createElement("span", {
|
|
1160
|
-
className: iconOnly ? "sr-only" : void 0
|
|
1161
|
-
}, label), caretDown && /* @__PURE__ */ React9.createElement(Icon, {
|
|
1162
|
-
size: 3,
|
|
1163
|
-
icon: "ph--caret-down--bold"
|
|
1164
|
-
}));
|
|
1165
|
-
} finally {
|
|
1166
|
-
_effect.f();
|
|
1167
|
-
}
|
|
1168
|
-
});
|
|
1169
|
-
|
|
1170
|
-
// src/components/Button/Toggle.tsx
|
|
1171
|
-
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
1172
|
-
import { Toggle as TogglePrimitive } from "@radix-ui/react-toggle";
|
|
1173
|
-
import React10, { forwardRef as forwardRef9 } from "react";
|
|
1174
|
-
var Toggle = /* @__PURE__ */ forwardRef9(({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {
|
|
1175
|
-
var _effect = _useSignals10();
|
|
1176
|
-
try {
|
|
1177
|
-
return /* @__PURE__ */ React10.createElement(TogglePrimitive, {
|
|
1178
|
-
defaultPressed,
|
|
1179
|
-
pressed,
|
|
1180
|
-
onPressedChange,
|
|
1181
|
-
asChild: true
|
|
1182
|
-
}, /* @__PURE__ */ React10.createElement(Button, {
|
|
1183
|
-
...props,
|
|
1184
|
-
ref: forwardedRef
|
|
1185
|
-
}));
|
|
1186
|
-
} finally {
|
|
1187
|
-
_effect.f();
|
|
1188
|
-
}
|
|
1189
|
-
});
|
|
1190
|
-
|
|
1191
|
-
// src/components/Button/ToggleGroup.tsx
|
|
1192
|
-
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
1193
|
-
import { ToggleGroupItem as ToggleGroupItemPrimitive, ToggleGroup as ToggleGroupPrimitive } from "@radix-ui/react-toggle-group";
|
|
1194
|
-
import React11, { forwardRef as forwardRef10 } from "react";
|
|
1195
|
-
var ToggleGroup = /* @__PURE__ */ forwardRef10(({ classNames, children, ...props }, forwardedRef) => {
|
|
1196
|
-
var _effect = _useSignals11();
|
|
1197
|
-
try {
|
|
1198
|
-
return /* @__PURE__ */ React11.createElement(ToggleGroupPrimitive, {
|
|
1199
|
-
...props,
|
|
1200
|
-
asChild: true
|
|
1201
|
-
}, /* @__PURE__ */ React11.createElement(ButtonGroup, {
|
|
1202
|
-
classNames,
|
|
1203
|
-
children,
|
|
1204
|
-
ref: forwardedRef
|
|
1205
|
-
}));
|
|
1206
|
-
} finally {
|
|
1207
|
-
_effect.f();
|
|
1208
|
-
}
|
|
1209
|
-
});
|
|
1210
|
-
var ToggleGroupItem = /* @__PURE__ */ forwardRef10(({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {
|
|
1211
|
-
var _effect = _useSignals11();
|
|
1212
|
-
try {
|
|
1213
|
-
return /* @__PURE__ */ React11.createElement(ToggleGroupItemPrimitive, {
|
|
1214
|
-
...props,
|
|
1215
|
-
asChild: true
|
|
1216
|
-
}, /* @__PURE__ */ React11.createElement(Button, {
|
|
1217
|
-
variant,
|
|
1218
|
-
elevation,
|
|
1219
|
-
density,
|
|
1220
|
-
classNames,
|
|
1221
|
-
children,
|
|
1222
|
-
ref: forwardedRef
|
|
1223
|
-
}));
|
|
1224
|
-
} finally {
|
|
1225
|
-
_effect.f();
|
|
1226
|
-
}
|
|
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
|
-
});
|
|
1248
|
-
|
|
1249
|
-
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1250
|
-
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
1251
|
-
import React12, { createContext as createContext4, useCallback as useCallback4, useContext as useContext5, useState as useState5 } from "react";
|
|
1252
|
-
var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
1253
|
-
textValue: "",
|
|
1254
|
-
setTextValue: async (_) => {
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
var useClipboard = () => useContext5(ClipboardContext);
|
|
1258
|
-
var ClipboardProvider = ({ children }) => {
|
|
1259
|
-
var _effect = _useSignals12();
|
|
1260
|
-
try {
|
|
1261
|
-
const [textValue, setInternalTextValue] = useState5("");
|
|
1262
|
-
const setTextValue = useCallback4(async (nextValue) => {
|
|
1263
|
-
await navigator.clipboard.writeText(nextValue);
|
|
1264
|
-
return setInternalTextValue(nextValue);
|
|
1265
|
-
}, []);
|
|
1266
|
-
return /* @__PURE__ */ React12.createElement(ClipboardContext.Provider, {
|
|
1267
|
-
value: {
|
|
1268
|
-
textValue,
|
|
1269
|
-
setTextValue
|
|
1270
|
-
}
|
|
1271
|
-
}, children);
|
|
1272
|
-
} finally {
|
|
1273
|
-
_effect.f();
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
|
|
1277
|
-
// src/components/Clipboard/CopyButton.tsx
|
|
1278
|
-
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1279
|
-
import React16 from "react";
|
|
1280
|
-
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1281
|
-
|
|
1282
|
-
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
1283
|
-
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1284
|
-
import { createKeyborg } from "keyborg";
|
|
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
|
-
};
|
|
1329
|
-
|
|
1330
|
-
// src/util/hasIosKeyboard.ts
|
|
1331
|
-
var hasIosKeyboard = () => {
|
|
1332
|
-
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
1333
|
-
};
|
|
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
|
-
|
|
1377
|
-
// src/components/DensityProvider/DensityProvider.tsx
|
|
1378
|
-
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1379
|
-
import React13, { createContext as createContext5 } from "react";
|
|
1380
|
-
var DensityContext = /* @__PURE__ */ createContext5({
|
|
1381
|
-
density: "fine"
|
|
1382
|
-
});
|
|
1383
|
-
var DensityProvider = ({ density, children }) => {
|
|
1384
|
-
var _effect = _useSignals13();
|
|
1385
|
-
try {
|
|
1386
|
-
return /* @__PURE__ */ React13.createElement(DensityContext.Provider, {
|
|
1387
|
-
value: {
|
|
1388
|
-
density
|
|
1389
|
-
}
|
|
1390
|
-
}, children);
|
|
1391
|
-
} finally {
|
|
1392
|
-
_effect.f();
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
|
|
1396
|
-
// src/components/ElevationProvider/ElevationProvider.tsx
|
|
1397
|
-
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
1398
|
-
import React14, { createContext as createContext6 } from "react";
|
|
1399
|
-
var ElevationContext = /* @__PURE__ */ createContext6({
|
|
1400
|
-
elevation: "base"
|
|
1401
|
-
});
|
|
1402
|
-
var ElevationProvider = ({ elevation, children }) => {
|
|
1403
|
-
var _effect = _useSignals14();
|
|
1404
|
-
try {
|
|
1405
|
-
return /* @__PURE__ */ React14.createElement(ElevationContext.Provider, {
|
|
1406
|
-
value: {
|
|
1407
|
-
elevation
|
|
1408
|
-
}
|
|
1409
|
-
}, children);
|
|
1410
|
-
} finally {
|
|
1411
|
-
_effect.f();
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
|
|
1415
|
-
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
1416
|
-
var ThemeContext = /* @__PURE__ */ createContext7(void 0);
|
|
1417
|
-
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
1418
|
-
var _effect = _useSignals15();
|
|
1419
|
-
try {
|
|
1420
|
-
useEffect4(() => {
|
|
1421
|
-
if (document.defaultView) {
|
|
1422
|
-
const kb = createKeyborg(document.defaultView);
|
|
1423
|
-
kb.subscribe(handleInputModalityChange);
|
|
1424
|
-
return () => kb.unsubscribe(handleInputModalityChange);
|
|
1425
|
-
}
|
|
1426
|
-
}, []);
|
|
1427
|
-
const safeAreaPadding = useSafeArea();
|
|
1428
|
-
const contextValue = useMemo3(() => ({
|
|
1429
|
-
tx,
|
|
1430
|
-
themeMode,
|
|
1431
|
-
hasIosKeyboard: hasIosKeyboard(),
|
|
1432
|
-
safeAreaPadding,
|
|
1433
|
-
...rest
|
|
1434
|
-
}), [
|
|
1435
|
-
tx,
|
|
1436
|
-
themeMode,
|
|
1437
|
-
safeAreaPadding,
|
|
1438
|
-
rest
|
|
1439
|
-
]);
|
|
1440
|
-
return /* @__PURE__ */ React15.createElement(ThemeContext.Provider, {
|
|
1441
|
-
value: contextValue
|
|
1442
|
-
}, /* @__PURE__ */ React15.createElement(TranslationsProvider, {
|
|
1443
|
-
fallback,
|
|
1444
|
-
resourceExtensions,
|
|
1445
|
-
appNs
|
|
1446
|
-
}, /* @__PURE__ */ React15.createElement(ElevationProvider, {
|
|
1447
|
-
elevation: "base"
|
|
1448
|
-
}, /* @__PURE__ */ React15.createElement(DensityProvider, {
|
|
1449
|
-
density: rootDensity
|
|
1450
|
-
}, children))));
|
|
1451
|
-
} finally {
|
|
1452
|
-
_effect.f();
|
|
1453
|
-
}
|
|
1454
|
-
};
|
|
1455
|
-
var handleInputModalityChange = (isUsingKeyboard) => {
|
|
1456
|
-
if (isUsingKeyboard) {
|
|
1457
|
-
document.body.setAttribute("data-is-keyboard", "true");
|
|
1458
|
-
} else {
|
|
1459
|
-
document.body.removeAttribute("data-is-keyboard");
|
|
1460
|
-
}
|
|
1461
|
-
};
|
|
1462
|
-
|
|
1463
|
-
// src/components/Clipboard/CopyButton.tsx
|
|
1464
|
-
var inactiveLabelStyles = "invisible bs-px -mbe-px overflow-hidden";
|
|
1465
|
-
var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
1466
|
-
var _effect = _useSignals16();
|
|
1467
|
-
try {
|
|
1468
|
-
const { t } = useTranslation("os");
|
|
1469
|
-
const { textValue, setTextValue } = useClipboard();
|
|
1470
|
-
const isCopied = textValue === value;
|
|
1471
|
-
return /* @__PURE__ */ React16.createElement(Button, {
|
|
1472
|
-
...props,
|
|
1473
|
-
classNames: [
|
|
1474
|
-
"inline-flex flex-col justify-center",
|
|
1475
|
-
classNames
|
|
1476
|
-
],
|
|
1477
|
-
onClick: () => setTextValue(value),
|
|
1478
|
-
"data-testid": "copy-invitation"
|
|
1479
|
-
}, /* @__PURE__ */ React16.createElement("div", {
|
|
1480
|
-
role: "none",
|
|
1481
|
-
className: mx3("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1482
|
-
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1483
|
-
className: "pli-1"
|
|
1484
|
-
}, t("copy label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
1485
|
-
icon: "ph--copy--regular",
|
|
1486
|
-
size
|
|
1487
|
-
})), /* @__PURE__ */ React16.createElement("div", {
|
|
1488
|
-
role: "none",
|
|
1489
|
-
className: mx3("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1490
|
-
}, /* @__PURE__ */ React16.createElement("span", {
|
|
1491
|
-
className: "pli-1"
|
|
1492
|
-
}, t("copy success label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
1493
|
-
icon: "ph--check--regular",
|
|
1494
|
-
size
|
|
1495
|
-
})));
|
|
1496
|
-
} finally {
|
|
1497
|
-
_effect.f();
|
|
1498
|
-
}
|
|
1499
|
-
};
|
|
1500
|
-
var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ...props }) => {
|
|
1501
|
-
var _effect = _useSignals16();
|
|
1502
|
-
try {
|
|
1503
|
-
const { t } = useTranslation("os");
|
|
1504
|
-
const { textValue, setTextValue } = useClipboard();
|
|
1505
|
-
const isCopied = textValue === value;
|
|
1506
|
-
const label = isCopied ? t("copy success label") : props.label ?? t("copy label");
|
|
1507
|
-
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1508
|
-
return /* @__PURE__ */ React16.createElement(IconButton, {
|
|
1509
|
-
iconOnly: true,
|
|
1510
|
-
label,
|
|
1511
|
-
icon: "ph--copy--regular",
|
|
1512
|
-
size,
|
|
1513
|
-
variant,
|
|
1514
|
-
classNames: [
|
|
1515
|
-
"inline-flex flex-col justify-center",
|
|
1516
|
-
classNames
|
|
1517
|
-
],
|
|
1518
|
-
onClick: () => setTextValue(value).then(onOpen),
|
|
1519
|
-
"data-testid": "copy-invitation"
|
|
1520
|
-
});
|
|
1521
|
-
} finally {
|
|
1522
|
-
_effect.f();
|
|
1523
|
-
}
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
// src/components/Clipboard/index.ts
|
|
1527
|
-
var Clipboard = {
|
|
1528
|
-
Button: CopyButton,
|
|
1529
|
-
IconButton: CopyButtonIconOnly,
|
|
1530
|
-
Provider: ClipboardProvider
|
|
1531
|
-
};
|
|
1532
|
-
|
|
1533
|
-
// src/components/Dialog/Dialog.tsx
|
|
1534
|
-
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1535
|
-
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
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";
|
|
1537
|
-
import React17, { forwardRef as forwardRef11 } from "react";
|
|
1538
|
-
var DialogRoot = (props) => {
|
|
1539
|
-
var _effect = _useSignals17();
|
|
1540
|
-
try {
|
|
1541
|
-
return /* @__PURE__ */ React17.createElement(ElevationProvider, {
|
|
1542
|
-
elevation: "dialog"
|
|
1543
|
-
}, /* @__PURE__ */ React17.createElement(DialogRootPrimitive, props));
|
|
1544
|
-
} finally {
|
|
1545
|
-
_effect.f();
|
|
1546
|
-
}
|
|
1547
|
-
};
|
|
1548
|
-
var DialogTrigger = DialogTriggerPrimitive;
|
|
1549
|
-
var DialogPortal = DialogPortalPrimitive;
|
|
1550
|
-
var DialogTitle = /* @__PURE__ */ forwardRef11(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1551
|
-
var _effect = _useSignals17();
|
|
1552
|
-
try {
|
|
1553
|
-
const { tx } = useThemeContext();
|
|
1554
|
-
return /* @__PURE__ */ React17.createElement(DialogTitlePrimitive, {
|
|
1555
|
-
...props,
|
|
1556
|
-
className: tx("dialog.title", "dialog__title", {
|
|
1557
|
-
srOnly
|
|
1558
|
-
}, classNames),
|
|
1559
|
-
ref: forwardedRef
|
|
1560
|
-
});
|
|
1561
|
-
} finally {
|
|
1562
|
-
_effect.f();
|
|
1563
|
-
}
|
|
1564
|
-
});
|
|
1565
|
-
var DialogDescription = /* @__PURE__ */ forwardRef11(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1566
|
-
var _effect = _useSignals17();
|
|
1567
|
-
try {
|
|
1568
|
-
const { tx } = useThemeContext();
|
|
1569
|
-
return /* @__PURE__ */ React17.createElement(DialogDescriptionPrimitive, {
|
|
1570
|
-
...props,
|
|
1571
|
-
className: tx("dialog.description", "dialog__description", {
|
|
1572
|
-
srOnly
|
|
1573
|
-
}, classNames),
|
|
1574
|
-
ref: forwardedRef
|
|
1575
|
-
});
|
|
1576
|
-
} finally {
|
|
1577
|
-
_effect.f();
|
|
1578
|
-
}
|
|
1579
|
-
});
|
|
1580
|
-
var DialogClose = DialogClosePrimitive;
|
|
1581
|
-
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1582
|
-
var DIALOG_CONTENT_NAME = "DialogContent";
|
|
1583
|
-
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext8(DIALOG_OVERLAY_NAME, {});
|
|
1584
|
-
var DialogOverlay = /* @__PURE__ */ forwardRef11(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1585
|
-
var _effect = _useSignals17();
|
|
1586
|
-
try {
|
|
1587
|
-
const { tx } = useThemeContext();
|
|
1588
|
-
return /* @__PURE__ */ React17.createElement(DialogOverlayPrimitive, {
|
|
1589
|
-
...props,
|
|
1590
|
-
className: tx("dialog.overlay", "dialog__overlay", {}, classNames),
|
|
1591
|
-
ref: forwardedRef,
|
|
1592
|
-
"data-block-align": blockAlign
|
|
1593
|
-
}, /* @__PURE__ */ React17.createElement(OverlayLayoutProvider, {
|
|
1594
|
-
inOverlayLayout: true
|
|
1595
|
-
}, children));
|
|
1596
|
-
} finally {
|
|
1597
|
-
_effect.f();
|
|
1598
|
-
}
|
|
1599
|
-
});
|
|
1600
|
-
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1601
|
-
var DialogContent = /* @__PURE__ */ forwardRef11(({ classNames, children, inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1602
|
-
var _effect = _useSignals17();
|
|
1603
|
-
try {
|
|
1604
|
-
const { tx } = useThemeContext();
|
|
1605
|
-
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1606
|
-
return /* @__PURE__ */ React17.createElement(DialogContentPrimitive, {
|
|
1607
|
-
// NOTE: Radix warning unless set to undefined.
|
|
1608
|
-
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1609
|
-
"aria-describedby": void 0,
|
|
1610
|
-
...props,
|
|
1611
|
-
className: tx("dialog.content", "dialog", {
|
|
1612
|
-
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1613
|
-
}, classNames),
|
|
1614
|
-
ref: forwardedRef
|
|
1615
|
-
}, children);
|
|
1616
|
-
} finally {
|
|
1617
|
-
_effect.f();
|
|
1618
|
-
}
|
|
1619
|
-
});
|
|
1620
|
-
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1621
|
-
var Dialog = {
|
|
1622
|
-
Root: DialogRoot,
|
|
1623
|
-
Trigger: DialogTrigger,
|
|
1624
|
-
Portal: DialogPortal,
|
|
1625
|
-
Overlay: DialogOverlay,
|
|
1626
|
-
Content: DialogContent,
|
|
1627
|
-
Title: DialogTitle,
|
|
1628
|
-
Description: DialogDescription,
|
|
1629
|
-
Close: DialogClose
|
|
1630
|
-
};
|
|
1631
|
-
|
|
1632
|
-
// src/components/Dialog/AlertDialog.tsx
|
|
1633
|
-
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
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";
|
|
1635
|
-
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
1636
|
-
import React18, { forwardRef as forwardRef12 } from "react";
|
|
1637
|
-
var AlertDialogRoot = (props) => {
|
|
1638
|
-
var _effect = _useSignals18();
|
|
1639
|
-
try {
|
|
1640
|
-
return /* @__PURE__ */ React18.createElement(ElevationProvider, {
|
|
1641
|
-
elevation: "dialog"
|
|
1642
|
-
}, /* @__PURE__ */ React18.createElement(AlertDialogRootPrimitive, props));
|
|
1643
|
-
} finally {
|
|
1644
|
-
_effect.f();
|
|
1645
|
-
}
|
|
1646
|
-
};
|
|
1647
|
-
var AlertDialogTrigger = AlertDialogTriggerPrimitive;
|
|
1648
|
-
var AlertDialogPortal = AlertDialogPortalPrimitive;
|
|
1649
|
-
var AlertDialogCancel = AlertDialogCancelPrimitive;
|
|
1650
|
-
var AlertDialogAction = AlertDialogActionPrimitive;
|
|
1651
|
-
var AlertDialogTitle = /* @__PURE__ */ forwardRef12(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1652
|
-
var _effect = _useSignals18();
|
|
1653
|
-
try {
|
|
1654
|
-
const { tx } = useThemeContext();
|
|
1655
|
-
return /* @__PURE__ */ React18.createElement(AlertDialogTitlePrimitive, {
|
|
1656
|
-
...props,
|
|
1657
|
-
className: tx("dialog.title", "dialog--alert__title", {
|
|
1658
|
-
srOnly
|
|
1659
|
-
}, classNames),
|
|
1660
|
-
ref: forwardedRef
|
|
1661
|
-
});
|
|
1662
|
-
} finally {
|
|
1663
|
-
_effect.f();
|
|
1664
|
-
}
|
|
1665
|
-
});
|
|
1666
|
-
var AlertDialogDescription = /* @__PURE__ */ forwardRef12(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1667
|
-
var _effect = _useSignals18();
|
|
1668
|
-
try {
|
|
1669
|
-
const { tx } = useThemeContext();
|
|
1670
|
-
return /* @__PURE__ */ React18.createElement(AlertDialogDescriptionPrimitive, {
|
|
1671
|
-
...props,
|
|
1672
|
-
className: tx("dialog.description", "dialog--alert__description", {
|
|
1673
|
-
srOnly
|
|
1674
|
-
}, classNames),
|
|
1675
|
-
ref: forwardedRef
|
|
1676
|
-
});
|
|
1677
|
-
} finally {
|
|
1678
|
-
_effect.f();
|
|
1679
|
-
}
|
|
1680
|
-
});
|
|
1681
|
-
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
1682
|
-
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
1683
|
-
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext9(ALERT_DIALOG_OVERLAY_NAME, {
|
|
1684
|
-
inOverlayLayout: false
|
|
1685
|
-
});
|
|
1686
|
-
var AlertDialogOverlay = /* @__PURE__ */ forwardRef12(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1687
|
-
var _effect = _useSignals18();
|
|
1688
|
-
try {
|
|
1689
|
-
const { tx } = useThemeContext();
|
|
1690
|
-
return /* @__PURE__ */ React18.createElement(AlertDialogOverlayPrimitive, {
|
|
1691
|
-
...props,
|
|
1692
|
-
className: tx("dialog.overlay", "dialog--alert__overlay", {}, classNames, "data-[block-align=start]:justify-center", "data-[block-align=start]:items-start", "data-[block-align=center]:place-content-center"),
|
|
1693
|
-
ref: forwardedRef,
|
|
1694
|
-
"data-block-align": blockAlign
|
|
1695
|
-
}, /* @__PURE__ */ React18.createElement(OverlayLayoutProvider2, {
|
|
1696
|
-
inOverlayLayout: true
|
|
1697
|
-
}, children));
|
|
1698
|
-
} finally {
|
|
1699
|
-
_effect.f();
|
|
1700
|
-
}
|
|
1701
|
-
});
|
|
1702
|
-
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
1703
|
-
var AlertDialogContent = /* @__PURE__ */ forwardRef12(({ classNames, children, ...props }, forwardedRef) => {
|
|
1704
|
-
var _effect = _useSignals18();
|
|
1705
|
-
try {
|
|
1706
|
-
const { tx } = useThemeContext();
|
|
1707
|
-
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
1708
|
-
return /* @__PURE__ */ React18.createElement(AlertDialogContentPrimitive, {
|
|
1709
|
-
...props,
|
|
1710
|
-
className: tx("dialog.content", "dialog--alert", {
|
|
1711
|
-
inOverlayLayout
|
|
1712
|
-
}, classNames),
|
|
1713
|
-
ref: forwardedRef
|
|
1714
|
-
}, children);
|
|
1715
|
-
} finally {
|
|
1716
|
-
_effect.f();
|
|
1717
|
-
}
|
|
1718
|
-
});
|
|
1719
|
-
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
1720
|
-
var AlertDialog = {
|
|
1721
|
-
Root: AlertDialogRoot,
|
|
1722
|
-
Trigger: AlertDialogTrigger,
|
|
1723
|
-
Portal: AlertDialogPortal,
|
|
1724
|
-
Overlay: AlertDialogOverlay,
|
|
1725
|
-
Content: AlertDialogContent,
|
|
1726
|
-
Title: AlertDialogTitle,
|
|
1727
|
-
Description: AlertDialogDescription,
|
|
1728
|
-
Cancel: AlertDialogCancel,
|
|
1729
|
-
Action: AlertDialogAction
|
|
1730
|
-
};
|
|
1731
|
-
|
|
1732
|
-
// src/components/Input/Input.tsx
|
|
1733
|
-
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1734
|
-
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1735
|
-
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
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";
|
|
1739
|
-
var Label = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1740
|
-
var _effect = _useSignals19();
|
|
1741
|
-
try {
|
|
1742
|
-
const { tx } = useThemeContext();
|
|
1743
|
-
return /* @__PURE__ */ React19.createElement(LabelPrimitive, {
|
|
1744
|
-
...props,
|
|
1745
|
-
className: tx("input.label", "input__label", {
|
|
1746
|
-
srOnly
|
|
1747
|
-
}, classNames),
|
|
1748
|
-
ref: forwardedRef
|
|
1749
|
-
}, children);
|
|
1750
|
-
} finally {
|
|
1751
|
-
_effect.f();
|
|
1752
|
-
}
|
|
1753
|
-
});
|
|
1754
|
-
var Description = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1755
|
-
var _effect = _useSignals19();
|
|
1756
|
-
try {
|
|
1757
|
-
const { tx } = useThemeContext();
|
|
1758
|
-
return /* @__PURE__ */ React19.createElement(DescriptionPrimitive, {
|
|
1759
|
-
...props,
|
|
1760
|
-
className: tx("input.description", "input__description", {
|
|
1761
|
-
srOnly
|
|
1762
|
-
}, classNames),
|
|
1763
|
-
ref: forwardedRef
|
|
1764
|
-
}, children);
|
|
1765
|
-
} finally {
|
|
1766
|
-
_effect.f();
|
|
1767
|
-
}
|
|
1768
|
-
});
|
|
1769
|
-
var Validation = /* @__PURE__ */ forwardRef13(({ __inputScope, srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1770
|
-
var _effect = _useSignals19();
|
|
1771
|
-
try {
|
|
1772
|
-
const { tx } = useThemeContext();
|
|
1773
|
-
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
1774
|
-
return /* @__PURE__ */ React19.createElement(ValidationPrimitive, {
|
|
1775
|
-
...props,
|
|
1776
|
-
className: tx("input.validation", `input__validation-message input__validation-message--${validationValence}`, {
|
|
1777
|
-
srOnly,
|
|
1778
|
-
validationValence
|
|
1779
|
-
}, classNames),
|
|
1780
|
-
ref: forwardedRef
|
|
1781
|
-
}, children);
|
|
1782
|
-
} finally {
|
|
1783
|
-
_effect.f();
|
|
1784
|
-
}
|
|
1785
|
-
});
|
|
1786
|
-
var DescriptionAndValidation = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1787
|
-
var _effect = _useSignals19();
|
|
1788
|
-
try {
|
|
1789
|
-
const { tx } = useThemeContext();
|
|
1790
|
-
return /* @__PURE__ */ React19.createElement(DescriptionAndValidationPrimitive, {
|
|
1791
|
-
...props,
|
|
1792
|
-
className: tx("input.descriptionAndValidation", "input__description-and-validation", {
|
|
1793
|
-
srOnly
|
|
1794
|
-
}, classNames),
|
|
1795
|
-
ref: forwardedRef
|
|
1796
|
-
}, children);
|
|
1797
|
-
} finally {
|
|
1798
|
-
_effect.f();
|
|
1799
|
-
}
|
|
1800
|
-
});
|
|
1801
|
-
var PinInput = /* @__PURE__ */ forwardRef13(({ density: propsDensity, elevation: propsElevation, segmentClassName: propsSegmentClassName, inputClassName, variant, ...props }, forwardedRef) => {
|
|
1802
|
-
var _effect = _useSignals19();
|
|
1803
|
-
try {
|
|
1804
|
-
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1805
|
-
const { tx } = useThemeContext();
|
|
1806
|
-
const density = useDensityContext(propsDensity);
|
|
1807
|
-
const elevation = useElevationContext(propsElevation);
|
|
1808
|
-
const segmentClassName = useCallback6(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1809
|
-
variant: "static",
|
|
1810
|
-
focused,
|
|
1811
|
-
disabled: props.disabled,
|
|
1812
|
-
density,
|
|
1813
|
-
elevation,
|
|
1814
|
-
validationValence
|
|
1815
|
-
}, propsSegmentClassName), [
|
|
1816
|
-
tx,
|
|
1817
|
-
props.disabled,
|
|
1818
|
-
elevation,
|
|
1819
|
-
propsElevation,
|
|
1820
|
-
density
|
|
1821
|
-
]);
|
|
1822
|
-
return /* @__PURE__ */ React19.createElement(PinInputPrimitive, {
|
|
1823
|
-
...props,
|
|
1824
|
-
segmentClassName,
|
|
1825
|
-
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1826
|
-
autoFocus: true
|
|
1827
|
-
},
|
|
1828
|
-
inputClassName: tx("input.inputWithSegments", "input input--pin", {
|
|
1829
|
-
disabled: props.disabled
|
|
1830
|
-
}, inputClassName),
|
|
1831
|
-
ref: forwardedRef
|
|
1832
|
-
});
|
|
1833
|
-
} finally {
|
|
1834
|
-
_effect.f();
|
|
1835
|
-
}
|
|
1836
|
-
});
|
|
1837
|
-
var TextInput = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
1838
|
-
var _effect = _useSignals19();
|
|
1839
|
-
try {
|
|
1840
|
-
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1841
|
-
const themeContextValue = useThemeContext();
|
|
1842
|
-
const density = useDensityContext(propsDensity);
|
|
1843
|
-
const elevation = useElevationContext(propsElevation);
|
|
1844
|
-
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
1845
|
-
const { tx } = themeContextValue;
|
|
1846
|
-
return /* @__PURE__ */ React19.createElement(TextInputPrimitive, {
|
|
1847
|
-
...props,
|
|
1848
|
-
className: tx("input.input", "input", {
|
|
1849
|
-
variant,
|
|
1850
|
-
disabled: props.disabled,
|
|
1851
|
-
density,
|
|
1852
|
-
elevation,
|
|
1853
|
-
validationValence
|
|
1854
|
-
}, classNames),
|
|
1855
|
-
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1856
|
-
autoFocus: true
|
|
1857
|
-
},
|
|
1858
|
-
ref: forwardedRef
|
|
1859
|
-
});
|
|
1860
|
-
} finally {
|
|
1861
|
-
_effect.f();
|
|
1862
|
-
}
|
|
1863
|
-
});
|
|
1864
|
-
var TextArea = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
1865
|
-
var _effect = _useSignals19();
|
|
1866
|
-
try {
|
|
1867
|
-
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1868
|
-
const { tx } = useThemeContext();
|
|
1869
|
-
const density = useDensityContext(propsDensity);
|
|
1870
|
-
const elevation = useElevationContext(propsElevation);
|
|
1871
|
-
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
1872
|
-
return /* @__PURE__ */ React19.createElement(TextAreaPrimitive, {
|
|
1873
|
-
...props,
|
|
1874
|
-
className: tx("input.input", "input--text-area", {
|
|
1875
|
-
variant,
|
|
1876
|
-
disabled: props.disabled,
|
|
1877
|
-
density,
|
|
1878
|
-
elevation,
|
|
1879
|
-
validationValence
|
|
1880
|
-
}, "-mbe-labelSpacingBlock", classNames),
|
|
1881
|
-
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1882
|
-
autoFocus: true
|
|
1883
|
-
},
|
|
1884
|
-
ref: forwardedRef
|
|
1885
|
-
});
|
|
1886
|
-
} finally {
|
|
1887
|
-
_effect.f();
|
|
1888
|
-
}
|
|
1889
|
-
});
|
|
1890
|
-
var Checkbox = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, classNames, ...props }, forwardedRef) => {
|
|
1891
|
-
var _effect = _useSignals19();
|
|
1892
|
-
try {
|
|
1893
|
-
const [checked, onCheckedChange] = useControllableState2({
|
|
1894
|
-
prop: propsChecked,
|
|
1895
|
-
defaultProp: propsDefaultChecked,
|
|
1896
|
-
onChange: propsOnCheckedChange
|
|
1897
|
-
});
|
|
1898
|
-
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1899
|
-
const { tx } = useThemeContext();
|
|
1900
|
-
return /* @__PURE__ */ React19.createElement(CheckboxPrimitive, {
|
|
1901
|
-
...props,
|
|
1902
|
-
checked,
|
|
1903
|
-
onCheckedChange,
|
|
1904
|
-
id,
|
|
1905
|
-
"aria-describedby": descriptionId,
|
|
1906
|
-
...validationValence === "error" && {
|
|
1907
|
-
"aria-invalid": "true",
|
|
1908
|
-
"aria-errormessage": errorMessageId
|
|
1909
|
-
},
|
|
1910
|
-
className: tx("input.checkbox", "input--checkbox", {
|
|
1911
|
-
size
|
|
1912
|
-
}, "shrink-0", classNames),
|
|
1913
|
-
ref: forwardedRef
|
|
1914
|
-
}, /* @__PURE__ */ React19.createElement(Icon, {
|
|
1915
|
-
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
1916
|
-
classNames: tx("input.checkboxIndicator", "input--checkbox__indicator", {
|
|
1917
|
-
size,
|
|
1918
|
-
checked
|
|
1919
|
-
})
|
|
1920
|
-
}));
|
|
1921
|
-
} finally {
|
|
1922
|
-
_effect.f();
|
|
1923
|
-
}
|
|
1924
|
-
});
|
|
1925
|
-
var Switch = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, classNames, ...props }, forwardedRef) => {
|
|
1926
|
-
var _effect = _useSignals19();
|
|
1927
|
-
try {
|
|
1928
|
-
const [checked, onCheckedChange] = useControllableState2({
|
|
1929
|
-
prop: propsChecked,
|
|
1930
|
-
defaultProp: propsDefaultChecked ?? false,
|
|
1931
|
-
onChange: propsOnCheckedChange
|
|
1932
|
-
});
|
|
1933
|
-
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1934
|
-
return /* @__PURE__ */ React19.createElement("input", {
|
|
1935
|
-
type: "checkbox",
|
|
1936
|
-
className: mx4("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1937
|
-
checked,
|
|
1938
|
-
onChange: (event) => {
|
|
1939
|
-
onCheckedChange(event.target.checked);
|
|
1940
|
-
},
|
|
1941
|
-
id,
|
|
1942
|
-
"aria-describedby": descriptionId,
|
|
1943
|
-
...props,
|
|
1944
|
-
...validationValence === "error" && {
|
|
1945
|
-
"aria-invalid": "true",
|
|
1946
|
-
"aria-errormessage": errorMessageId
|
|
1947
|
-
},
|
|
1948
|
-
ref: forwardedRef
|
|
1949
|
-
});
|
|
1950
|
-
} finally {
|
|
1951
|
-
_effect.f();
|
|
1952
|
-
}
|
|
1953
|
-
});
|
|
1954
|
-
var Input = {
|
|
1955
|
-
Root: InputRoot,
|
|
1956
|
-
PinInput,
|
|
1957
|
-
TextInput,
|
|
1958
|
-
TextArea,
|
|
1959
|
-
Checkbox,
|
|
1960
|
-
Switch,
|
|
1961
|
-
Label,
|
|
1962
|
-
Description,
|
|
1963
|
-
Validation,
|
|
1964
|
-
DescriptionAndValidation
|
|
1965
|
-
};
|
|
1966
|
-
|
|
1967
|
-
// src/components/List/List.tsx
|
|
1968
|
-
import { useSignals as _useSignals21 } from "@preact-signals/safe-react/tracking";
|
|
1969
|
-
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1970
|
-
import React21, { forwardRef as forwardRef14 } from "react";
|
|
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";
|
|
1972
|
-
|
|
1973
|
-
// src/components/List/ListDropIndicator.tsx
|
|
1974
|
-
import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
|
|
1975
|
-
import React20 from "react";
|
|
1976
|
-
var edgeToOrientationMap = {
|
|
1977
|
-
top: "horizontal",
|
|
1978
|
-
bottom: "horizontal",
|
|
1979
|
-
left: "vertical",
|
|
1980
|
-
right: "vertical"
|
|
1981
|
-
};
|
|
1982
|
-
var orientationStyles = {
|
|
1983
|
-
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1984
|
-
vertical: "is-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1985
|
-
};
|
|
1986
|
-
var edgeStyles = {
|
|
1987
|
-
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
1988
|
-
right: "right-[--line-offset] before:right-[--offset-terminal]",
|
|
1989
|
-
bottom: "bottom-[--line-offset] before:bottom-[--offset-terminal]",
|
|
1990
|
-
left: "left-[--line-offset] before:left-[--offset-terminal]"
|
|
1991
|
-
};
|
|
1992
|
-
var strokeSize = 2;
|
|
1993
|
-
var terminalSize = 8;
|
|
1994
|
-
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
1995
|
-
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1996
|
-
var _effect = _useSignals20();
|
|
1997
|
-
try {
|
|
1998
|
-
const orientation = edgeToOrientationMap[edge];
|
|
1999
|
-
return /* @__PURE__ */ React20.createElement("div", {
|
|
2000
|
-
role: "none",
|
|
2001
|
-
style: {
|
|
2002
|
-
"--line-thickness": `${strokeSize}px`,
|
|
2003
|
-
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
2004
|
-
"--line-inset": `${lineInset}px`,
|
|
2005
|
-
"--terminal-size": `${terminalSize}px`,
|
|
2006
|
-
"--terminal-radius": `${terminalSize / 2}px`,
|
|
2007
|
-
"--terminal-inset": `${terminalInset}px`,
|
|
2008
|
-
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
2009
|
-
},
|
|
2010
|
-
className: `absolute z-10 pointer-events-none bg-accentSurface before:content-[''] before:w-[--terminal-size] before:h-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`
|
|
2011
|
-
});
|
|
2012
|
-
} finally {
|
|
2013
|
-
_effect.f();
|
|
2014
|
-
}
|
|
2015
|
-
};
|
|
2016
|
-
|
|
2017
|
-
// src/components/List/List.tsx
|
|
2018
|
-
var List = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
2019
|
-
var _effect = _useSignals21();
|
|
2020
|
-
try {
|
|
2021
|
-
const { tx } = useThemeContext();
|
|
2022
|
-
const density = useDensityContext(props.density);
|
|
2023
|
-
return /* @__PURE__ */ React21.createElement(DensityProvider, {
|
|
2024
|
-
density
|
|
2025
|
-
}, /* @__PURE__ */ React21.createElement(ListPrimitive, {
|
|
2026
|
-
...props,
|
|
2027
|
-
className: tx("list.root", "list", {}, classNames),
|
|
2028
|
-
ref: forwardedRef
|
|
2029
|
-
}, children));
|
|
2030
|
-
} finally {
|
|
2031
|
-
_effect.f();
|
|
2032
|
-
}
|
|
2033
|
-
});
|
|
2034
|
-
var ListItemEndcap = /* @__PURE__ */ forwardRef14(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2035
|
-
var _effect = _useSignals21();
|
|
2036
|
-
try {
|
|
2037
|
-
const Root8 = asChild ? Slot6 : "div";
|
|
2038
|
-
const density = useDensityContext();
|
|
2039
|
-
const { tx } = useThemeContext();
|
|
2040
|
-
return /* @__PURE__ */ React21.createElement(Root8, {
|
|
2041
|
-
...!asChild && {
|
|
2042
|
-
role: "none"
|
|
2043
|
-
},
|
|
2044
|
-
...props,
|
|
2045
|
-
className: tx("list.item.endcap", "list__listItem__endcap", {
|
|
2046
|
-
density
|
|
2047
|
-
}, classNames),
|
|
2048
|
-
ref: forwardedRef
|
|
2049
|
-
}, children);
|
|
2050
|
-
} finally {
|
|
2051
|
-
_effect.f();
|
|
2052
|
-
}
|
|
2053
|
-
});
|
|
2054
|
-
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
2055
|
-
var _effect = _useSignals21();
|
|
2056
|
-
try {
|
|
2057
|
-
const density = useDensityContext();
|
|
2058
|
-
const { tx } = useThemeContext();
|
|
2059
|
-
return /* @__PURE__ */ React21.createElement("div", {
|
|
2060
|
-
role: "none",
|
|
2061
|
-
...props,
|
|
2062
|
-
className: tx("list.item.openTrigger", "list__listItem__openTrigger--mock", {
|
|
2063
|
-
density
|
|
2064
|
-
}, classNames)
|
|
2065
|
-
});
|
|
2066
|
-
} finally {
|
|
2067
|
-
_effect.f();
|
|
2068
|
-
}
|
|
2069
|
-
};
|
|
2070
|
-
var ListItemHeading = /* @__PURE__ */ forwardRef14(({ children, classNames, ...props }, forwardedRef) => {
|
|
2071
|
-
var _effect = _useSignals21();
|
|
2072
|
-
try {
|
|
2073
|
-
const { tx } = useThemeContext();
|
|
2074
|
-
const density = useDensityContext();
|
|
2075
|
-
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemHeading, {
|
|
2076
|
-
...props,
|
|
2077
|
-
className: tx("list.item.heading", "list__listItem__heading", {
|
|
2078
|
-
density
|
|
2079
|
-
}, classNames),
|
|
2080
|
-
ref: forwardedRef
|
|
2081
|
-
}, children);
|
|
2082
|
-
} finally {
|
|
2083
|
-
_effect.f();
|
|
2084
|
-
}
|
|
2085
|
-
});
|
|
2086
|
-
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
2087
|
-
var _effect = _useSignals21();
|
|
2088
|
-
try {
|
|
2089
|
-
const { tx } = useThemeContext();
|
|
2090
|
-
const density = useDensityContext();
|
|
2091
|
-
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
2092
|
-
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemOpenTrigger, {
|
|
2093
|
-
...props,
|
|
2094
|
-
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
2095
|
-
density
|
|
2096
|
-
}, classNames),
|
|
2097
|
-
ref: forwardedRef
|
|
2098
|
-
}, children || /* @__PURE__ */ React21.createElement(Icon, {
|
|
2099
|
-
size: 3,
|
|
2100
|
-
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
2101
|
-
classNames: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
2102
|
-
}));
|
|
2103
|
-
} finally {
|
|
2104
|
-
_effect.f();
|
|
2105
|
-
}
|
|
2106
|
-
});
|
|
2107
|
-
var ListItemRoot = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
2108
|
-
var _effect = _useSignals21();
|
|
2109
|
-
try {
|
|
2110
|
-
const { tx } = useThemeContext();
|
|
2111
|
-
const density = useDensityContext();
|
|
2112
|
-
return /* @__PURE__ */ React21.createElement(ListPrimitiveItem, {
|
|
2113
|
-
...props,
|
|
2114
|
-
className: tx("list.item.root", "list__listItem", {
|
|
2115
|
-
density,
|
|
2116
|
-
collapsible: props.collapsible
|
|
2117
|
-
}, classNames),
|
|
2118
|
-
ref: forwardedRef
|
|
2119
|
-
}, children);
|
|
2120
|
-
} finally {
|
|
2121
|
-
_effect.f();
|
|
2122
|
-
}
|
|
2123
|
-
});
|
|
2124
|
-
var ListItem = {
|
|
2125
|
-
Root: ListItemRoot,
|
|
2126
|
-
Endcap: ListItemEndcap,
|
|
2127
|
-
Heading: ListItemHeading,
|
|
2128
|
-
OpenTrigger: ListItemOpenTrigger,
|
|
2129
|
-
CollapsibleContent: ListItemCollapsibleContent,
|
|
2130
|
-
MockOpenTrigger: MockListItemOpenTrigger,
|
|
2131
|
-
DropIndicator: ListDropIndicator
|
|
2132
|
-
};
|
|
2133
|
-
|
|
2134
|
-
// src/components/List/Tree.tsx
|
|
2135
|
-
import { useSignals as _useSignals23 } from "@preact-signals/safe-react/tracking";
|
|
2136
|
-
import React23, { forwardRef as forwardRef15 } from "react";
|
|
2137
|
-
|
|
2138
|
-
// src/components/List/TreeDropIndicator.tsx
|
|
2139
|
-
import { useSignals as _useSignals22 } from "@preact-signals/safe-react/tracking";
|
|
2140
|
-
import React22 from "react";
|
|
2141
|
-
var edgeToOrientationMap2 = {
|
|
2142
|
-
"reorder-above": "sibling",
|
|
2143
|
-
"reorder-below": "sibling",
|
|
2144
|
-
"make-child": "child",
|
|
2145
|
-
reparent: "child"
|
|
2146
|
-
};
|
|
2147
|
-
var orientationStyles2 = {
|
|
2148
|
-
// TODO(wittjosiah): Stop using left/right here.
|
|
2149
|
-
sibling: "bs-[--line-thickness] left-[--horizontal-indent] right-0 bg-accentSurface before:left-[--negative-terminal-size]",
|
|
2150
|
-
child: "is-full block-start-0 block-end-0 border-[length:--line-thickness] before:invisible"
|
|
2151
|
-
};
|
|
2152
|
-
var instructionStyles = {
|
|
2153
|
-
"reorder-above": "block-start-[--line-offset] before:block-start-[--offset-terminal]",
|
|
2154
|
-
"reorder-below": "block-end-[--line-offset] before:block-end-[--offset-terminal]",
|
|
2155
|
-
"make-child": "border-accentSurface",
|
|
2156
|
-
// TODO(wittjosiah): This is not occurring in the current implementation.
|
|
2157
|
-
reparent: ""
|
|
2158
|
-
};
|
|
2159
|
-
var strokeSize2 = 2;
|
|
2160
|
-
var terminalSize2 = 8;
|
|
2161
|
-
var offsetToAlignTerminalWithLine2 = (strokeSize2 - terminalSize2) / 2;
|
|
2162
|
-
var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
2163
|
-
var _effect = _useSignals22();
|
|
2164
|
-
try {
|
|
2165
|
-
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize2}px))`;
|
|
2166
|
-
const isBlocked = instruction.type === "instruction-blocked";
|
|
2167
|
-
const desiredInstruction = isBlocked ? instruction.desired : instruction;
|
|
2168
|
-
const orientation = edgeToOrientationMap2[desiredInstruction.type];
|
|
2169
|
-
if (isBlocked) {
|
|
2170
|
-
return null;
|
|
2171
|
-
}
|
|
2172
|
-
return /* @__PURE__ */ React22.createElement("div", {
|
|
2173
|
-
style: {
|
|
2174
|
-
"--line-thickness": `${strokeSize2}px`,
|
|
2175
|
-
"--line-offset": `${lineOffset}`,
|
|
2176
|
-
"--terminal-size": `${terminalSize2}px`,
|
|
2177
|
-
"--terminal-radius": `${terminalSize2 / 2}px`,
|
|
2178
|
-
"--negative-terminal-size": `-${terminalSize2}px`,
|
|
2179
|
-
"--offset-terminal": `${offsetToAlignTerminalWithLine2}px`,
|
|
2180
|
-
"--horizontal-indent": `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`
|
|
2181
|
-
},
|
|
2182
|
-
className: `absolute z-10 pointer-events-none before:is-[--terminal-size] before:bs-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles2[orientation]} ${instructionStyles[desiredInstruction.type]}`
|
|
2183
|
-
});
|
|
2184
|
-
} finally {
|
|
2185
|
-
_effect.f();
|
|
2186
|
-
}
|
|
2187
|
-
};
|
|
2188
|
-
|
|
2189
|
-
// src/components/List/Tree.tsx
|
|
2190
|
-
var TreeRoot = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
2191
|
-
var _effect = _useSignals23();
|
|
2192
|
-
try {
|
|
2193
|
-
return /* @__PURE__ */ React23.createElement(List, {
|
|
2194
|
-
...props,
|
|
2195
|
-
ref: forwardedRef
|
|
2196
|
-
});
|
|
2197
|
-
} finally {
|
|
2198
|
-
_effect.f();
|
|
2199
|
-
}
|
|
2200
|
-
});
|
|
2201
|
-
var TreeBranch = /* @__PURE__ */ forwardRef15(({ __listScope, ...props }, forwardedRef) => {
|
|
2202
|
-
var _effect = _useSignals23();
|
|
2203
|
-
try {
|
|
2204
|
-
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
2205
|
-
return /* @__PURE__ */ React23.createElement(List, {
|
|
2206
|
-
...props,
|
|
2207
|
-
"aria-labelledby": headingId,
|
|
2208
|
-
ref: forwardedRef
|
|
2209
|
-
});
|
|
2210
|
-
} finally {
|
|
2211
|
-
_effect.f();
|
|
2212
|
-
}
|
|
2213
|
-
});
|
|
2214
|
-
var TreeItemRoot = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
2215
|
-
var _effect = _useSignals23();
|
|
2216
|
-
try {
|
|
2217
|
-
return /* @__PURE__ */ React23.createElement(ListItem.Root, {
|
|
2218
|
-
role: "treeitem",
|
|
2219
|
-
...props,
|
|
2220
|
-
ref: forwardedRef
|
|
2221
|
-
});
|
|
2222
|
-
} finally {
|
|
2223
|
-
_effect.f();
|
|
2224
|
-
}
|
|
2225
|
-
});
|
|
2226
|
-
var TreeItemHeading = ListItem.Heading;
|
|
2227
|
-
var TreeItemOpenTrigger = ListItem.OpenTrigger;
|
|
2228
|
-
var MockTreeItemOpenTrigger = ListItem.MockOpenTrigger;
|
|
2229
|
-
var TreeItemBody = ListItem.CollapsibleContent;
|
|
2230
|
-
var Tree = {
|
|
2231
|
-
Root: TreeRoot,
|
|
2232
|
-
Branch: TreeBranch
|
|
2233
|
-
};
|
|
2234
|
-
var TreeItem = {
|
|
2235
|
-
Root: TreeItemRoot,
|
|
2236
|
-
Heading: TreeItemHeading,
|
|
2237
|
-
Body: TreeItemBody,
|
|
2238
|
-
OpenTrigger: TreeItemOpenTrigger,
|
|
2239
|
-
MockOpenTrigger: MockTreeItemOpenTrigger,
|
|
2240
|
-
DropIndicator: TreeDropIndicator
|
|
2241
|
-
};
|
|
2242
|
-
|
|
2243
|
-
// src/components/List/Treegrid.tsx
|
|
2244
|
-
import { useSignals as _useSignals24 } from "@preact-signals/safe-react/tracking";
|
|
2245
|
-
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2246
|
-
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2247
|
-
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
2248
|
-
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
2249
|
-
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2250
|
-
import React24, { forwardRef as forwardRef16, useCallback as useCallback7 } from "react";
|
|
2251
|
-
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2252
|
-
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2253
|
-
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
2254
|
-
var PATH_SEPARATOR = "~";
|
|
2255
|
-
var PARENT_OF_SEPARATOR = " ";
|
|
2256
|
-
var TreegridRoot = /* @__PURE__ */ forwardRef16(({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
|
|
2257
|
-
var _effect = _useSignals24();
|
|
2258
|
-
try {
|
|
2259
|
-
const { tx } = useThemeContext();
|
|
2260
|
-
const Root8 = asChild ? Slot7 : Primitive7.div;
|
|
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
|
-
]);
|
|
2295
|
-
return /* @__PURE__ */ React24.createElement(Root8, {
|
|
2296
|
-
role: "treegrid",
|
|
2297
|
-
onKeyDown: handleKeyDown,
|
|
2298
|
-
...props,
|
|
2299
|
-
className: tx("treegrid.root", "treegrid", {}, classNames),
|
|
2300
|
-
style: {
|
|
2301
|
-
...style,
|
|
2302
|
-
gridTemplateColumns
|
|
2303
|
-
},
|
|
2304
|
-
ref: forwardedRef
|
|
2305
|
-
}, children);
|
|
2306
|
-
} finally {
|
|
2307
|
-
_effect.f();
|
|
2308
|
-
}
|
|
2309
|
-
});
|
|
2310
|
-
var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2311
|
-
var _effect = _useSignals24();
|
|
2312
|
-
try {
|
|
2313
|
-
const { tx } = useThemeContext();
|
|
2314
|
-
const Root8 = asChild ? Slot7 : Primitive7.div;
|
|
2315
|
-
const pathParts = id.split(PATH_SEPARATOR);
|
|
2316
|
-
const level = pathParts.length - 1;
|
|
2317
|
-
const [open, onOpenChange] = useControllableState3({
|
|
2318
|
-
prop: propsOpen,
|
|
2319
|
-
onChange: propsOnOpenChange,
|
|
2320
|
-
defaultProp: defaultOpen
|
|
2321
|
-
});
|
|
2322
|
-
return /* @__PURE__ */ React24.createElement(TreegridRowProvider, {
|
|
2323
|
-
open,
|
|
2324
|
-
onOpenChange,
|
|
2325
|
-
scope: __treegridRowScope
|
|
2326
|
-
}, /* @__PURE__ */ React24.createElement(Root8, {
|
|
2327
|
-
role: "row",
|
|
2328
|
-
"aria-level": level,
|
|
2329
|
-
className: tx("treegrid.row", "treegrid__row", {
|
|
2330
|
-
level
|
|
2331
|
-
}, classNames),
|
|
2332
|
-
...parentOf && {
|
|
2333
|
-
"aria-expanded": open,
|
|
2334
|
-
"aria-owns": parentOf
|
|
2335
|
-
},
|
|
2336
|
-
...props,
|
|
2337
|
-
id,
|
|
2338
|
-
ref: forwardedRef
|
|
2339
|
-
}, children));
|
|
2340
|
-
} finally {
|
|
2341
|
-
_effect.f();
|
|
2342
|
-
}
|
|
2343
|
-
});
|
|
2344
|
-
var TreegridCell = /* @__PURE__ */ forwardRef16(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
2345
|
-
var _effect = _useSignals24();
|
|
2346
|
-
try {
|
|
2347
|
-
const { tx } = useThemeContext();
|
|
2348
|
-
return /* @__PURE__ */ React24.createElement("div", {
|
|
2349
|
-
role: "gridcell",
|
|
2350
|
-
className: tx("treegrid.cell", "treegrid__cell", {
|
|
2351
|
-
indent
|
|
2352
|
-
}, classNames),
|
|
2353
|
-
...props,
|
|
2354
|
-
ref: forwardedRef
|
|
2355
|
-
}, children);
|
|
2356
|
-
} finally {
|
|
2357
|
-
_effect.f();
|
|
2358
|
-
}
|
|
2359
|
-
});
|
|
2360
|
-
var Treegrid = {
|
|
2361
|
-
Root: TreegridRoot,
|
|
2362
|
-
Row: TreegridRow,
|
|
2363
|
-
Cell: TreegridCell,
|
|
2364
|
-
PARENT_OF_SEPARATOR,
|
|
2365
|
-
PATH_SEPARATOR,
|
|
2366
|
-
createTreegridRowScope,
|
|
2367
|
-
useTreegridRowContext
|
|
2368
|
-
};
|
|
2369
|
-
|
|
2370
|
-
// src/components/Main/Main.tsx
|
|
2371
|
-
import { useSignals as _useSignals25 } from "@preact-signals/safe-react/tracking";
|
|
2372
|
-
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2373
|
-
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
2374
|
-
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2375
|
-
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
2376
|
-
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
2377
|
-
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2378
|
-
import React25, { forwardRef as forwardRef17, useCallback as useCallback9, useEffect as useEffect6, useRef as useRef2, useState as useState8 } from "react";
|
|
2379
|
-
import { log } from "@dxos/log";
|
|
2380
|
-
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2381
|
-
|
|
2382
|
-
// src/components/Main/useSwipeToDismiss.ts
|
|
2383
|
-
import { useCallback as useCallback8, useEffect as useEffect5, useState as useState7 } from "react";
|
|
2384
|
-
var useSwipeToDismiss = (ref, {
|
|
2385
|
-
onDismiss,
|
|
2386
|
-
dismissThreshold = 64,
|
|
2387
|
-
debounceThreshold = 8,
|
|
2388
|
-
offset = 0
|
|
2389
|
-
/* side = 'inline-start' */
|
|
2390
|
-
}) => {
|
|
2391
|
-
const $root = ref.current;
|
|
2392
|
-
const [motionState, setMotionState] = useState7(0);
|
|
2393
|
-
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2394
|
-
const setIdle = useCallback8(() => {
|
|
2395
|
-
setMotionState(0);
|
|
2396
|
-
$root?.style.removeProperty("inset-inline-start");
|
|
2397
|
-
$root?.style.setProperty("transition-duration", "200ms");
|
|
2398
|
-
}, [
|
|
2399
|
-
$root
|
|
2400
|
-
]);
|
|
2401
|
-
const setFollowing = useCallback8(() => {
|
|
2402
|
-
setMotionState(2);
|
|
2403
|
-
$root?.style.setProperty("transition-duration", "0ms");
|
|
2404
|
-
}, [
|
|
2405
|
-
$root
|
|
2406
|
-
]);
|
|
2407
|
-
const handlePointerDown = useCallback8(({ screenX }) => {
|
|
2408
|
-
if (motionState === 0) {
|
|
2409
|
-
setMotionState(1);
|
|
2410
|
-
setGestureStartX(screenX);
|
|
2411
|
-
}
|
|
2412
|
-
}, [
|
|
2413
|
-
motionState
|
|
2414
|
-
]);
|
|
2415
|
-
const handlePointerMove = useCallback8(({ screenX }) => {
|
|
2416
|
-
if ($root) {
|
|
2417
|
-
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2418
|
-
switch (motionState) {
|
|
2419
|
-
case 2:
|
|
2420
|
-
if (Math.abs(delta) > dismissThreshold) {
|
|
2421
|
-
setIdle();
|
|
2422
|
-
onDismiss?.();
|
|
2423
|
-
} else {
|
|
2424
|
-
$root.style.setProperty("inset-inline-start", `${offset + delta}px`);
|
|
2425
|
-
}
|
|
2426
|
-
break;
|
|
2427
|
-
case 1:
|
|
2428
|
-
if (Math.abs(delta) > debounceThreshold) {
|
|
2429
|
-
setFollowing();
|
|
2430
|
-
}
|
|
2431
|
-
break;
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
}, [
|
|
2435
|
-
$root,
|
|
2436
|
-
motionState,
|
|
2437
|
-
gestureStartX
|
|
2438
|
-
]);
|
|
2439
|
-
const handlePointerUp = useCallback8(() => {
|
|
2440
|
-
setIdle();
|
|
2441
|
-
}, [
|
|
2442
|
-
setIdle
|
|
2443
|
-
]);
|
|
2444
|
-
useEffect5(() => {
|
|
2445
|
-
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2446
|
-
return () => {
|
|
2447
|
-
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
2448
|
-
};
|
|
2449
|
-
}, [
|
|
2450
|
-
$root,
|
|
2451
|
-
handlePointerDown
|
|
2452
|
-
]);
|
|
2453
|
-
useEffect5(() => {
|
|
2454
|
-
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2455
|
-
return () => {
|
|
2456
|
-
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
2457
|
-
};
|
|
2458
|
-
}, [
|
|
2459
|
-
$root,
|
|
2460
|
-
handlePointerMove
|
|
2461
|
-
]);
|
|
2462
|
-
useEffect5(() => {
|
|
2463
|
-
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2464
|
-
return () => {
|
|
2465
|
-
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
2466
|
-
};
|
|
2467
|
-
}, [
|
|
2468
|
-
$root,
|
|
2469
|
-
handlePointerUp
|
|
2470
|
-
]);
|
|
2471
|
-
};
|
|
2472
|
-
|
|
2473
|
-
// src/components/Main/Main.tsx
|
|
2474
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
2475
|
-
var MAIN_NAME = "Main";
|
|
2476
|
-
var MAIN_ROOT_NAME = "MainRoot";
|
|
2477
|
-
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
2478
|
-
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
2479
|
-
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
2480
|
-
var landmarkAttr = "data-main-landmark";
|
|
2481
|
-
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2482
|
-
const handleKeyDown = useCallback9((event) => {
|
|
2483
|
-
const target = event.target;
|
|
2484
|
-
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2485
|
-
event.preventDefault();
|
|
2486
|
-
const landmarks = Array.from(document.querySelectorAll(`[${landmarkAttr}]:not([inert])`)).map((el) => el.hasAttribute(landmarkAttr) ? parseInt(el.getAttribute(landmarkAttr)) : NaN).sort();
|
|
2487
|
-
const l = landmarks.length;
|
|
2488
|
-
const cursor = landmarks.indexOf(parseInt(target.getAttribute(landmarkAttr)));
|
|
2489
|
-
const nextLandmark = landmarks[(cursor + l + (event.getModifierState("Shift") ? -1 : 1)) % l];
|
|
2490
|
-
document.querySelector(`[${landmarkAttr}="${nextLandmark}"]`)?.focus();
|
|
2491
|
-
}
|
|
2492
|
-
propsOnKeyDown?.(event);
|
|
2493
|
-
}, [
|
|
2494
|
-
propsOnKeyDown
|
|
2495
|
-
]);
|
|
2496
|
-
const focusableGroupAttrs = useFocusableGroup({
|
|
2497
|
-
tabBehavior: "limited",
|
|
2498
|
-
ignoreDefaultKeydown: {
|
|
2499
|
-
Tab: true
|
|
2500
|
-
}
|
|
2501
|
-
});
|
|
2502
|
-
return {
|
|
2503
|
-
onKeyDown: handleKeyDown,
|
|
2504
|
-
[landmarkAttr]: landmark,
|
|
2505
|
-
tabIndex: 0,
|
|
2506
|
-
...focusableGroupAttrs
|
|
2507
|
-
};
|
|
2508
|
-
};
|
|
2509
|
-
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
2510
|
-
resizing: false,
|
|
2511
|
-
navigationSidebarState: "closed",
|
|
2512
|
-
setNavigationSidebarState: (_nextState) => {
|
|
2513
|
-
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2514
|
-
F: __dxlog_file,
|
|
2515
|
-
L: 92,
|
|
2516
|
-
S: void 0,
|
|
2517
|
-
C: (f, a) => f(...a)
|
|
2518
|
-
});
|
|
2519
|
-
},
|
|
2520
|
-
complementarySidebarState: "closed",
|
|
2521
|
-
setComplementarySidebarState: (_nextState) => {
|
|
2522
|
-
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2523
|
-
F: __dxlog_file,
|
|
2524
|
-
L: 97,
|
|
2525
|
-
S: void 0,
|
|
2526
|
-
C: (f, a) => f(...a)
|
|
2527
|
-
});
|
|
2528
|
-
}
|
|
2529
|
-
});
|
|
2530
|
-
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
2531
|
-
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
2532
|
-
return {
|
|
2533
|
-
navigationSidebarState,
|
|
2534
|
-
setNavigationSidebarState,
|
|
2535
|
-
toggleNavigationSidebar: useCallback9(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2536
|
-
navigationSidebarState,
|
|
2537
|
-
setNavigationSidebarState
|
|
2538
|
-
]),
|
|
2539
|
-
openNavigationSidebar: useCallback9(() => setNavigationSidebarState("expanded"), []),
|
|
2540
|
-
collapseNavigationSidebar: useCallback9(() => setNavigationSidebarState("collapsed"), []),
|
|
2541
|
-
closeNavigationSidebar: useCallback9(() => setNavigationSidebarState("closed"), []),
|
|
2542
|
-
complementarySidebarState,
|
|
2543
|
-
setComplementarySidebarState,
|
|
2544
|
-
toggleComplementarySidebar: useCallback9(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2545
|
-
complementarySidebarState,
|
|
2546
|
-
setComplementarySidebarState
|
|
2547
|
-
]),
|
|
2548
|
-
openComplementarySidebar: useCallback9(() => setComplementarySidebarState("expanded"), []),
|
|
2549
|
-
collapseComplementarySidebar: useCallback9(() => setComplementarySidebarState("collapsed"), []),
|
|
2550
|
-
closeComplementarySidebar: useCallback9(() => setComplementarySidebarState("closed"), [])
|
|
2551
|
-
};
|
|
2552
|
-
};
|
|
2553
|
-
var resizeDebounce = 3e3;
|
|
2554
|
-
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2555
|
-
var _effect = _useSignals25();
|
|
2556
|
-
try {
|
|
2557
|
-
const [isLg] = useMediaQuery("lg");
|
|
2558
|
-
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2559
|
-
prop: propsNavigationSidebarState,
|
|
2560
|
-
defaultProp: defaultNavigationSidebarState,
|
|
2561
|
-
onChange: onNavigationSidebarStateChange
|
|
2562
|
-
});
|
|
2563
|
-
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = useControllableState4({
|
|
2564
|
-
prop: propsComplementarySidebarState,
|
|
2565
|
-
defaultProp: defaultComplementarySidebarState,
|
|
2566
|
-
onChange: onComplementarySidebarStateChange
|
|
2567
|
-
});
|
|
2568
|
-
const [resizing, setResizing] = useState8(false);
|
|
2569
|
-
const resizeInterval = useRef2(null);
|
|
2570
|
-
const handleResize = useCallback9(() => {
|
|
2571
|
-
setResizing(true);
|
|
2572
|
-
if (resizeInterval.current) {
|
|
2573
|
-
clearTimeout(resizeInterval.current);
|
|
2574
|
-
}
|
|
2575
|
-
resizeInterval.current = setTimeout(() => {
|
|
2576
|
-
setResizing(false);
|
|
2577
|
-
resizeInterval.current = null;
|
|
2578
|
-
}, resizeDebounce);
|
|
2579
|
-
}, []);
|
|
2580
|
-
useEffect6(() => {
|
|
2581
|
-
window.addEventListener("resize", handleResize);
|
|
2582
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
2583
|
-
}, [
|
|
2584
|
-
handleResize
|
|
2585
|
-
]);
|
|
2586
|
-
return /* @__PURE__ */ React25.createElement(MainProvider, {
|
|
2587
|
-
...props,
|
|
2588
|
-
navigationSidebarState,
|
|
2589
|
-
setNavigationSidebarState,
|
|
2590
|
-
complementarySidebarState,
|
|
2591
|
-
setComplementarySidebarState,
|
|
2592
|
-
resizing
|
|
2593
|
-
}, children);
|
|
2594
|
-
} finally {
|
|
2595
|
-
_effect.f();
|
|
2596
|
-
}
|
|
2597
|
-
};
|
|
2598
|
-
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
2599
|
-
var handleOpenAutoFocus = (event) => {
|
|
2600
|
-
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2601
|
-
};
|
|
2602
|
-
var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2603
|
-
var _effect = _useSignals25();
|
|
2604
|
-
try {
|
|
2605
|
-
const [isLg] = useMediaQuery("lg");
|
|
2606
|
-
const { tx } = useThemeContext();
|
|
2607
|
-
const { t } = useTranslation();
|
|
2608
|
-
const ref = useForwardedRef(forwardedRef);
|
|
2609
|
-
const noopRef = useRef2(null);
|
|
2610
|
-
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2611
|
-
onDismiss: () => onStateChange?.("closed")
|
|
2612
|
-
});
|
|
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();
|
|
2619
|
-
}
|
|
2620
|
-
props.onKeyDown?.(event);
|
|
2621
|
-
}, [
|
|
2622
|
-
props.onKeyDown
|
|
2623
|
-
]);
|
|
2624
|
-
const Root8 = isLg ? Primitive8.div : DialogContent2;
|
|
2625
|
-
return /* @__PURE__ */ React25.createElement(DialogRoot2, {
|
|
2626
|
-
open: state !== "closed",
|
|
2627
|
-
"aria-label": toLocalizedString(label, t),
|
|
2628
|
-
modal: false
|
|
2629
|
-
}, !isLg && /* @__PURE__ */ React25.createElement(DialogTitle2, {
|
|
2630
|
-
className: "sr-only"
|
|
2631
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */ React25.createElement(Root8, {
|
|
2632
|
-
...!isLg && {
|
|
2633
|
-
forceMount: true,
|
|
2634
|
-
tabIndex: -1,
|
|
2635
|
-
onOpenAutoFocus: onOpenAutoFocus ?? handleOpenAutoFocus
|
|
2636
|
-
},
|
|
2637
|
-
...props,
|
|
2638
|
-
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2639
|
-
"data-state": state,
|
|
2640
|
-
"data-resizing": resizing ? "true" : "false",
|
|
2641
|
-
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2642
|
-
onKeyDownCapture: handleKeyDown,
|
|
2643
|
-
...state === "closed" && {
|
|
2644
|
-
inert: true
|
|
2645
|
-
},
|
|
2646
|
-
ref
|
|
2647
|
-
}, children));
|
|
2648
|
-
} finally {
|
|
2649
|
-
_effect.f();
|
|
2650
|
-
}
|
|
2651
|
-
});
|
|
2652
|
-
var MainNavigationSidebar = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
2653
|
-
var _effect = _useSignals25();
|
|
2654
|
-
try {
|
|
2655
|
-
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2656
|
-
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2657
|
-
return /* @__PURE__ */ React25.createElement(MainSidebar, {
|
|
2658
|
-
...mover,
|
|
2659
|
-
...props,
|
|
2660
|
-
state: navigationSidebarState,
|
|
2661
|
-
onStateChange: setNavigationSidebarState,
|
|
2662
|
-
resizing,
|
|
2663
|
-
side: "inline-start",
|
|
2664
|
-
ref: forwardedRef
|
|
2665
|
-
});
|
|
2666
|
-
} finally {
|
|
2667
|
-
_effect.f();
|
|
2668
|
-
}
|
|
2669
|
-
});
|
|
2670
|
-
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2671
|
-
var MainComplementarySidebar = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
2672
|
-
var _effect = _useSignals25();
|
|
2673
|
-
try {
|
|
2674
|
-
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2675
|
-
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2676
|
-
return /* @__PURE__ */ React25.createElement(MainSidebar, {
|
|
2677
|
-
...mover,
|
|
2678
|
-
...props,
|
|
2679
|
-
state: complementarySidebarState,
|
|
2680
|
-
onStateChange: setComplementarySidebarState,
|
|
2681
|
-
resizing,
|
|
2682
|
-
side: "inline-end",
|
|
2683
|
-
ref: forwardedRef
|
|
2684
|
-
});
|
|
2685
|
-
} finally {
|
|
2686
|
-
_effect.f();
|
|
2687
|
-
}
|
|
2688
|
-
});
|
|
2689
|
-
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2690
|
-
var MainContent = /* @__PURE__ */ forwardRef17(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2691
|
-
var _effect = _useSignals25();
|
|
2692
|
-
try {
|
|
2693
|
-
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2694
|
-
const { tx } = useThemeContext();
|
|
2695
|
-
const Root8 = asChild ? Slot8 : role ? "div" : "main";
|
|
2696
|
-
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2697
|
-
return /* @__PURE__ */ React25.createElement(Root8, {
|
|
2698
|
-
role,
|
|
2699
|
-
...handlesFocus && {
|
|
2700
|
-
...mover
|
|
2701
|
-
},
|
|
2702
|
-
...props,
|
|
2703
|
-
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2704
|
-
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2705
|
-
"data-handles-focus": handlesFocus,
|
|
2706
|
-
className: tx("main.content", "main", {
|
|
2707
|
-
bounce,
|
|
2708
|
-
handlesFocus
|
|
2709
|
-
}, classNames),
|
|
2710
|
-
ref: forwardedRef
|
|
2711
|
-
}, children);
|
|
2712
|
-
} finally {
|
|
2713
|
-
_effect.f();
|
|
2714
|
-
}
|
|
2715
|
-
});
|
|
2716
|
-
MainContent.displayName = MAIN_NAME;
|
|
2717
|
-
var MainOverlay = /* @__PURE__ */ forwardRef17(({ classNames, ...props }, forwardedRef) => {
|
|
2718
|
-
var _effect = _useSignals25();
|
|
2719
|
-
try {
|
|
2720
|
-
const [isLg] = useMediaQuery("lg");
|
|
2721
|
-
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2722
|
-
const { tx } = useThemeContext();
|
|
2723
|
-
return /* @__PURE__ */ React25.createElement("div", {
|
|
2724
|
-
onClick: () => {
|
|
2725
|
-
setNavigationSidebarState("collapsed");
|
|
2726
|
-
setComplementarySidebarState("collapsed");
|
|
2727
|
-
},
|
|
2728
|
-
...props,
|
|
2729
|
-
className: tx("main.overlay", "main__overlay", {
|
|
2730
|
-
isLg,
|
|
2731
|
-
inlineStartSidebarOpen: navigationSidebarState,
|
|
2732
|
-
inlineEndSidebarOpen: complementarySidebarState
|
|
2733
|
-
}, classNames),
|
|
2734
|
-
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2735
|
-
"aria-hidden": "true",
|
|
2736
|
-
ref: forwardedRef
|
|
2737
|
-
});
|
|
2738
|
-
} finally {
|
|
2739
|
-
_effect.f();
|
|
2740
|
-
}
|
|
2741
|
-
});
|
|
2742
|
-
var Main = {
|
|
2743
|
-
Root: MainRoot,
|
|
2744
|
-
Content: MainContent,
|
|
2745
|
-
Overlay: MainOverlay,
|
|
2746
|
-
NavigationSidebar: MainNavigationSidebar,
|
|
2747
|
-
ComplementarySidebar: MainComplementarySidebar
|
|
2748
|
-
};
|
|
2749
|
-
|
|
2750
|
-
// src/components/Menus/ContextMenu.tsx
|
|
2751
|
-
import { useSignals as _useSignals26 } from "@preact-signals/safe-react/tracking";
|
|
2752
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
2753
|
-
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
2754
|
-
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
2755
|
-
import React26, { forwardRef as forwardRef18 } from "react";
|
|
2756
|
-
|
|
2757
|
-
// src/hooks/useSafeCollisionPadding.ts
|
|
2758
|
-
import { useMemo as useMemo4 } from "react";
|
|
2759
|
-
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
2760
|
-
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
2761
|
-
var safePadding = (propsPadding, safePadding2, side) => {
|
|
2762
|
-
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
2763
|
-
};
|
|
2764
|
-
var useSafeCollisionPadding = (collisionPadding) => {
|
|
2765
|
-
const { safeAreaPadding } = useThemeContext();
|
|
2766
|
-
return useMemo4(() => ({
|
|
2767
|
-
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
2768
|
-
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
2769
|
-
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
2770
|
-
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
2771
|
-
}), [
|
|
2772
|
-
collisionPadding,
|
|
2773
|
-
safeAreaPadding
|
|
2774
|
-
]);
|
|
2775
|
-
};
|
|
2776
|
-
|
|
2777
|
-
// src/components/Menus/ContextMenu.tsx
|
|
2778
|
-
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
2779
|
-
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
2780
|
-
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
2781
|
-
var ContextMenuContent = /* @__PURE__ */ forwardRef18(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
2782
|
-
var _effect = _useSignals26();
|
|
2783
|
-
try {
|
|
2784
|
-
const { tx } = useThemeContext();
|
|
2785
|
-
const elevation = useElevationContext();
|
|
2786
|
-
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2787
|
-
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Content, {
|
|
2788
|
-
...props,
|
|
2789
|
-
"data-arrow-keys": "up down",
|
|
2790
|
-
collisionPadding: safeCollisionPadding,
|
|
2791
|
-
className: tx("menu.content", "menu", {
|
|
2792
|
-
elevation
|
|
2793
|
-
}, classNames),
|
|
2794
|
-
ref: forwardedRef
|
|
2795
|
-
}, children);
|
|
2796
|
-
} finally {
|
|
2797
|
-
_effect.f();
|
|
2798
|
-
}
|
|
2799
|
-
});
|
|
2800
|
-
var ContextMenuViewport = /* @__PURE__ */ forwardRef18(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
2801
|
-
var _effect = _useSignals26();
|
|
2802
|
-
try {
|
|
2803
|
-
const { tx } = useThemeContext();
|
|
2804
|
-
const Root8 = asChild ? Slot9 : Primitive9.div;
|
|
2805
|
-
return /* @__PURE__ */ React26.createElement(Root8, {
|
|
2806
|
-
...props,
|
|
2807
|
-
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
2808
|
-
ref: forwardedRef
|
|
2809
|
-
}, children);
|
|
2810
|
-
} finally {
|
|
2811
|
-
_effect.f();
|
|
2812
|
-
}
|
|
2813
|
-
});
|
|
2814
|
-
var ContextMenuArrow = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
2815
|
-
var _effect = _useSignals26();
|
|
2816
|
-
try {
|
|
2817
|
-
const { tx } = useThemeContext();
|
|
2818
|
-
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Arrow, {
|
|
2819
|
-
...props,
|
|
2820
|
-
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
2821
|
-
ref: forwardedRef
|
|
2822
|
-
});
|
|
2823
|
-
} finally {
|
|
2824
|
-
_effect.f();
|
|
2825
|
-
}
|
|
2826
|
-
});
|
|
2827
|
-
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
2828
|
-
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
2829
|
-
var ContextMenuItem = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
2830
|
-
var _effect = _useSignals26();
|
|
2831
|
-
try {
|
|
2832
|
-
const { tx } = useThemeContext();
|
|
2833
|
-
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Item, {
|
|
2834
|
-
...props,
|
|
2835
|
-
className: tx("menu.item", "menu__item", {}, classNames),
|
|
2836
|
-
ref: forwardedRef
|
|
2837
|
-
});
|
|
2838
|
-
} finally {
|
|
2839
|
-
_effect.f();
|
|
2840
|
-
}
|
|
2841
|
-
});
|
|
2842
|
-
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
2843
|
-
var _effect = _useSignals26();
|
|
2844
|
-
try {
|
|
2845
|
-
const { tx } = useThemeContext();
|
|
2846
|
-
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
2847
|
-
...props,
|
|
2848
|
-
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
2849
|
-
ref: forwardedRef
|
|
2850
|
-
});
|
|
2851
|
-
} finally {
|
|
2852
|
-
_effect.f();
|
|
2853
|
-
}
|
|
2854
|
-
});
|
|
2855
|
-
var ContextMenuSeparator = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
2856
|
-
var _effect = _useSignals26();
|
|
2857
|
-
try {
|
|
2858
|
-
const { tx } = useThemeContext();
|
|
2859
|
-
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Separator, {
|
|
2860
|
-
...props,
|
|
2861
|
-
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
2862
|
-
ref: forwardedRef
|
|
2863
|
-
});
|
|
2864
|
-
} finally {
|
|
2865
|
-
_effect.f();
|
|
2866
|
-
}
|
|
2867
|
-
});
|
|
2868
|
-
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
2869
|
-
var _effect = _useSignals26();
|
|
2870
|
-
try {
|
|
2871
|
-
const { tx } = useThemeContext();
|
|
2872
|
-
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Label, {
|
|
2873
|
-
...props,
|
|
2874
|
-
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
2875
|
-
ref: forwardedRef
|
|
2876
|
-
});
|
|
2877
|
-
} finally {
|
|
2878
|
-
_effect.f();
|
|
2879
|
-
}
|
|
2880
|
-
});
|
|
2881
|
-
var ContextMenu2 = {
|
|
2882
|
-
Root: ContextMenuRoot,
|
|
2883
|
-
Trigger: ContextMenuTrigger,
|
|
2884
|
-
Portal: ContextMenuPortal,
|
|
2885
|
-
Content: ContextMenuContent,
|
|
2886
|
-
Viewport: ContextMenuViewport,
|
|
2887
|
-
Arrow: ContextMenuArrow,
|
|
2888
|
-
Group: ContextMenuGroup,
|
|
2889
|
-
Item: ContextMenuItem,
|
|
2890
|
-
CheckboxItem: ContextMenuCheckboxItem,
|
|
2891
|
-
ItemIndicator: ContextMenuItemIndicator,
|
|
2892
|
-
Separator: ContextMenuSeparator,
|
|
2893
|
-
GroupLabel: ContextMenuGroupLabel
|
|
2894
|
-
};
|
|
2895
|
-
|
|
2896
|
-
// src/components/Menus/DropdownMenu.tsx
|
|
2897
|
-
import { useSignals as _useSignals27 } from "@preact-signals/safe-react/tracking";
|
|
2898
|
-
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
2899
|
-
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
2900
|
-
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
2901
|
-
import { useId as useId3 } from "@radix-ui/react-id";
|
|
2902
|
-
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
2903
|
-
import { createMenuScope } from "@radix-ui/react-menu";
|
|
2904
|
-
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
2905
|
-
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
2906
|
-
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2907
|
-
import React27, { forwardRef as forwardRef19, useCallback as useCallback10, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
2908
|
-
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
2909
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope3(DROPDOWN_MENU_NAME, [
|
|
2910
|
-
createMenuScope
|
|
2911
|
-
]);
|
|
2912
|
-
var useMenuScope = createMenuScope();
|
|
2913
|
-
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
2914
|
-
var DropdownMenuRoot = (props) => {
|
|
2915
|
-
var _effect = _useSignals27();
|
|
2916
|
-
try {
|
|
2917
|
-
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
2918
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2919
|
-
const triggerRef = useRef3(null);
|
|
2920
|
-
const [open = false, setOpen] = useControllableState5({
|
|
2921
|
-
prop: openProp,
|
|
2922
|
-
defaultProp: defaultOpen,
|
|
2923
|
-
onChange: onOpenChange
|
|
2924
|
-
});
|
|
2925
|
-
return /* @__PURE__ */ React27.createElement(DropdownMenuProvider, {
|
|
2926
|
-
scope: __scopeDropdownMenu,
|
|
2927
|
-
triggerId: useId3(),
|
|
2928
|
-
triggerRef,
|
|
2929
|
-
contentId: useId3(),
|
|
2930
|
-
open,
|
|
2931
|
-
onOpenChange: setOpen,
|
|
2932
|
-
onOpenToggle: useCallback10(() => setOpen((prevOpen) => !prevOpen), [
|
|
2933
|
-
setOpen
|
|
2934
|
-
]),
|
|
2935
|
-
modal
|
|
2936
|
-
}, /* @__PURE__ */ React27.createElement(MenuPrimitive.Root, {
|
|
2937
|
-
...menuScope,
|
|
2938
|
-
open,
|
|
2939
|
-
onOpenChange: setOpen,
|
|
2940
|
-
dir,
|
|
2941
|
-
modal
|
|
2942
|
-
}, children));
|
|
2943
|
-
} finally {
|
|
2944
|
-
_effect.f();
|
|
2945
|
-
}
|
|
2946
|
-
};
|
|
2947
|
-
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
2948
|
-
var TRIGGER_NAME2 = "DropdownMenuTrigger";
|
|
2949
|
-
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2950
|
-
var _effect = _useSignals27();
|
|
2951
|
-
try {
|
|
2952
|
-
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
2953
|
-
const context = useDropdownMenuContext(TRIGGER_NAME2, __scopeDropdownMenu);
|
|
2954
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2955
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Anchor, {
|
|
2956
|
-
asChild: true,
|
|
2957
|
-
...menuScope
|
|
2958
|
-
}, /* @__PURE__ */ React27.createElement(Primitive10.button, {
|
|
2959
|
-
type: "button",
|
|
2960
|
-
id: context.triggerId,
|
|
2961
|
-
"aria-haspopup": "menu",
|
|
2962
|
-
"aria-expanded": context.open,
|
|
2963
|
-
"aria-controls": context.open ? context.contentId : void 0,
|
|
2964
|
-
"data-state": context.open ? "open" : "closed",
|
|
2965
|
-
"data-disabled": disabled ? "" : void 0,
|
|
2966
|
-
disabled,
|
|
2967
|
-
...triggerProps,
|
|
2968
|
-
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
2969
|
-
"data-arrow-keys": "down",
|
|
2970
|
-
onPointerDown: composeEventHandlers2(props.onPointerDown, (event) => {
|
|
2971
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
2972
|
-
context.onOpenToggle();
|
|
2973
|
-
if (!context.open) {
|
|
2974
|
-
event.preventDefault();
|
|
2975
|
-
}
|
|
2976
|
-
}
|
|
2977
|
-
}),
|
|
2978
|
-
onKeyDown: composeEventHandlers2(props.onKeyDown, (event) => {
|
|
2979
|
-
if (disabled) {
|
|
2980
|
-
return;
|
|
2981
|
-
}
|
|
2982
|
-
if ([
|
|
2983
|
-
"Enter",
|
|
2984
|
-
" "
|
|
2985
|
-
].includes(event.key)) {
|
|
2986
|
-
context.onOpenToggle();
|
|
2987
|
-
}
|
|
2988
|
-
if (event.key === "ArrowDown") {
|
|
2989
|
-
context.onOpenChange(true);
|
|
2990
|
-
}
|
|
2991
|
-
if ([
|
|
2992
|
-
"Enter",
|
|
2993
|
-
" ",
|
|
2994
|
-
"ArrowDown"
|
|
2995
|
-
].includes(event.key)) {
|
|
2996
|
-
event.preventDefault();
|
|
2997
|
-
}
|
|
2998
|
-
})
|
|
2999
|
-
}));
|
|
3000
|
-
} finally {
|
|
3001
|
-
_effect.f();
|
|
3002
|
-
}
|
|
3003
|
-
});
|
|
3004
|
-
DropdownMenuTrigger.displayName = TRIGGER_NAME2;
|
|
3005
|
-
var VIRTUAL_TRIGGER_NAME = "DropdownMenuVirtualTrigger";
|
|
3006
|
-
var DropdownMenuVirtualTrigger = (props) => {
|
|
3007
|
-
var _effect = _useSignals27();
|
|
3008
|
-
try {
|
|
3009
|
-
const { __scopeDropdownMenu, virtualRef } = props;
|
|
3010
|
-
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
3011
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3012
|
-
useEffect7(() => {
|
|
3013
|
-
if (virtualRef.current) {
|
|
3014
|
-
context.triggerRef.current = virtualRef.current;
|
|
3015
|
-
}
|
|
3016
|
-
});
|
|
3017
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Anchor, {
|
|
3018
|
-
...menuScope,
|
|
3019
|
-
virtualRef
|
|
3020
|
-
});
|
|
3021
|
-
} finally {
|
|
3022
|
-
_effect.f();
|
|
3023
|
-
}
|
|
3024
|
-
};
|
|
3025
|
-
DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
|
|
3026
|
-
var PORTAL_NAME2 = "DropdownMenuPortal";
|
|
3027
|
-
var DropdownMenuPortal = (props) => {
|
|
3028
|
-
var _effect = _useSignals27();
|
|
3029
|
-
try {
|
|
3030
|
-
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
3031
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3032
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Portal, {
|
|
3033
|
-
...menuScope,
|
|
3034
|
-
...portalProps
|
|
3035
|
-
});
|
|
3036
|
-
} finally {
|
|
3037
|
-
_effect.f();
|
|
3038
|
-
}
|
|
3039
|
-
};
|
|
3040
|
-
DropdownMenuPortal.displayName = PORTAL_NAME2;
|
|
3041
|
-
var DropdownMenuViewport = /* @__PURE__ */ forwardRef19(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
3042
|
-
var _effect = _useSignals27();
|
|
3043
|
-
try {
|
|
3044
|
-
const { tx } = useThemeContext();
|
|
3045
|
-
const Root8 = asChild ? Slot10 : Primitive10.div;
|
|
3046
|
-
return /* @__PURE__ */ React27.createElement(Root8, {
|
|
3047
|
-
...props,
|
|
3048
|
-
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
3049
|
-
ref: forwardedRef
|
|
3050
|
-
}, children);
|
|
3051
|
-
} finally {
|
|
3052
|
-
_effect.f();
|
|
3053
|
-
}
|
|
3054
|
-
});
|
|
3055
|
-
var CONTENT_NAME2 = "DropdownMenuContent";
|
|
3056
|
-
var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3057
|
-
var _effect = _useSignals27();
|
|
3058
|
-
try {
|
|
3059
|
-
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
3060
|
-
const { tx } = useThemeContext();
|
|
3061
|
-
const context = useDropdownMenuContext(CONTENT_NAME2, __scopeDropdownMenu);
|
|
3062
|
-
const elevation = useElevationContext();
|
|
3063
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3064
|
-
const hasInteractedOutsideRef = useRef3(false);
|
|
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
|
-
]);
|
|
3082
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Content, {
|
|
3083
|
-
id: context.contentId,
|
|
3084
|
-
"aria-labelledby": context.triggerId,
|
|
3085
|
-
...menuScope,
|
|
3086
|
-
...contentProps,
|
|
3087
|
-
collisionBoundary: computedCollisionBoundary,
|
|
3088
|
-
collisionPadding: safeCollisionPadding,
|
|
3089
|
-
ref: forwardedRef,
|
|
3090
|
-
onCloseAutoFocus: composeEventHandlers2(props.onCloseAutoFocus, (event) => {
|
|
3091
|
-
if (!hasInteractedOutsideRef.current) {
|
|
3092
|
-
context.triggerRef.current?.focus();
|
|
3093
|
-
}
|
|
3094
|
-
hasInteractedOutsideRef.current = false;
|
|
3095
|
-
event.preventDefault();
|
|
3096
|
-
}),
|
|
3097
|
-
onInteractOutside: composeEventHandlers2(props.onInteractOutside, (event) => {
|
|
3098
|
-
const originalEvent = event.detail.originalEvent;
|
|
3099
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
3100
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
3101
|
-
if (!context.modal || isRightClick) {
|
|
3102
|
-
hasInteractedOutsideRef.current = true;
|
|
3103
|
-
}
|
|
3104
|
-
}),
|
|
3105
|
-
"data-arrow-keys": "up down",
|
|
3106
|
-
className: tx("menu.content", "menu", {
|
|
3107
|
-
elevation
|
|
3108
|
-
}, classNames),
|
|
3109
|
-
style: {
|
|
3110
|
-
...props.style,
|
|
3111
|
-
// re-namespace exposed content custom properties
|
|
3112
|
-
...{
|
|
3113
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3114
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
3115
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
3116
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3117
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3118
|
-
}
|
|
3119
|
-
}
|
|
3120
|
-
});
|
|
3121
|
-
} finally {
|
|
3122
|
-
_effect.f();
|
|
3123
|
-
}
|
|
3124
|
-
});
|
|
3125
|
-
DropdownMenuContent.displayName = CONTENT_NAME2;
|
|
3126
|
-
var GROUP_NAME = "DropdownMenuGroup";
|
|
3127
|
-
var DropdownMenuGroup = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3128
|
-
var _effect = _useSignals27();
|
|
3129
|
-
try {
|
|
3130
|
-
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
3131
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3132
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Group, {
|
|
3133
|
-
...menuScope,
|
|
3134
|
-
...groupProps,
|
|
3135
|
-
ref: forwardedRef
|
|
3136
|
-
});
|
|
3137
|
-
} finally {
|
|
3138
|
-
_effect.f();
|
|
3139
|
-
}
|
|
3140
|
-
});
|
|
3141
|
-
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
3142
|
-
var LABEL_NAME = "DropdownMenuLabel";
|
|
3143
|
-
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3144
|
-
var _effect = _useSignals27();
|
|
3145
|
-
try {
|
|
3146
|
-
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
3147
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3148
|
-
const { tx } = useThemeContext();
|
|
3149
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Label, {
|
|
3150
|
-
...menuScope,
|
|
3151
|
-
...labelProps,
|
|
3152
|
-
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
3153
|
-
ref: forwardedRef
|
|
3154
|
-
});
|
|
3155
|
-
} finally {
|
|
3156
|
-
_effect.f();
|
|
3157
|
-
}
|
|
3158
|
-
});
|
|
3159
|
-
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
3160
|
-
var ITEM_NAME = "DropdownMenuItem";
|
|
3161
|
-
var DropdownMenuItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3162
|
-
var _effect = _useSignals27();
|
|
3163
|
-
try {
|
|
3164
|
-
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
3165
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3166
|
-
const { tx } = useThemeContext();
|
|
3167
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Item, {
|
|
3168
|
-
...menuScope,
|
|
3169
|
-
...itemProps,
|
|
3170
|
-
className: tx("menu.item", "menu__item", {}, classNames),
|
|
3171
|
-
ref: forwardedRef
|
|
3172
|
-
});
|
|
3173
|
-
} finally {
|
|
3174
|
-
_effect.f();
|
|
3175
|
-
}
|
|
3176
|
-
});
|
|
3177
|
-
DropdownMenuItem.displayName = ITEM_NAME;
|
|
3178
|
-
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
3179
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3180
|
-
var _effect = _useSignals27();
|
|
3181
|
-
try {
|
|
3182
|
-
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
3183
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3184
|
-
const { tx } = useThemeContext();
|
|
3185
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.CheckboxItem, {
|
|
3186
|
-
...menuScope,
|
|
3187
|
-
...checkboxItemProps,
|
|
3188
|
-
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
3189
|
-
ref: forwardedRef
|
|
3190
|
-
});
|
|
3191
|
-
} finally {
|
|
3192
|
-
_effect.f();
|
|
3193
|
-
}
|
|
3194
|
-
});
|
|
3195
|
-
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
3196
|
-
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
3197
|
-
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3198
|
-
var _effect = _useSignals27();
|
|
3199
|
-
try {
|
|
3200
|
-
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
3201
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3202
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.RadioGroup, {
|
|
3203
|
-
...menuScope,
|
|
3204
|
-
...radioGroupProps,
|
|
3205
|
-
ref: forwardedRef
|
|
3206
|
-
});
|
|
3207
|
-
} finally {
|
|
3208
|
-
_effect.f();
|
|
3209
|
-
}
|
|
3210
|
-
});
|
|
3211
|
-
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
3212
|
-
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
3213
|
-
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3214
|
-
var _effect = _useSignals27();
|
|
3215
|
-
try {
|
|
3216
|
-
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
3217
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3218
|
-
const { tx } = useThemeContext();
|
|
3219
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Item, {
|
|
3220
|
-
...menuScope,
|
|
3221
|
-
...itemProps,
|
|
3222
|
-
className: tx("menu.item", "menu__item", {}, classNames),
|
|
3223
|
-
ref: forwardedRef
|
|
3224
|
-
});
|
|
3225
|
-
} finally {
|
|
3226
|
-
_effect.f();
|
|
3227
|
-
}
|
|
3228
|
-
});
|
|
3229
|
-
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
3230
|
-
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
3231
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3232
|
-
var _effect = _useSignals27();
|
|
3233
|
-
try {
|
|
3234
|
-
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
3235
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3236
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.ItemIndicator, {
|
|
3237
|
-
...menuScope,
|
|
3238
|
-
...itemIndicatorProps,
|
|
3239
|
-
ref: forwardedRef
|
|
3240
|
-
});
|
|
3241
|
-
} finally {
|
|
3242
|
-
_effect.f();
|
|
3243
|
-
}
|
|
3244
|
-
});
|
|
3245
|
-
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
3246
|
-
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
3247
|
-
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3248
|
-
var _effect = _useSignals27();
|
|
3249
|
-
try {
|
|
3250
|
-
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
3251
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3252
|
-
const { tx } = useThemeContext();
|
|
3253
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Separator, {
|
|
3254
|
-
...menuScope,
|
|
3255
|
-
...separatorProps,
|
|
3256
|
-
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
3257
|
-
ref: forwardedRef
|
|
3258
|
-
});
|
|
3259
|
-
} finally {
|
|
3260
|
-
_effect.f();
|
|
3261
|
-
}
|
|
3262
|
-
});
|
|
3263
|
-
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
3264
|
-
var ARROW_NAME2 = "DropdownMenuArrow";
|
|
3265
|
-
var DropdownMenuArrow = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3266
|
-
var _effect = _useSignals27();
|
|
3267
|
-
try {
|
|
3268
|
-
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
3269
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3270
|
-
const { tx } = useThemeContext();
|
|
3271
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Arrow, {
|
|
3272
|
-
...menuScope,
|
|
3273
|
-
...arrowProps,
|
|
3274
|
-
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
3275
|
-
ref: forwardedRef
|
|
3276
|
-
});
|
|
3277
|
-
} finally {
|
|
3278
|
-
_effect.f();
|
|
3279
|
-
}
|
|
3280
|
-
});
|
|
3281
|
-
DropdownMenuArrow.displayName = ARROW_NAME2;
|
|
3282
|
-
var DropdownMenuSub = (props) => {
|
|
3283
|
-
var _effect = _useSignals27();
|
|
3284
|
-
try {
|
|
3285
|
-
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
3286
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3287
|
-
const [open = false, setOpen] = useControllableState5({
|
|
3288
|
-
prop: openProp,
|
|
3289
|
-
defaultProp: defaultOpen,
|
|
3290
|
-
onChange: onOpenChange
|
|
3291
|
-
});
|
|
3292
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Sub, {
|
|
3293
|
-
...menuScope,
|
|
3294
|
-
open,
|
|
3295
|
-
onOpenChange: setOpen
|
|
3296
|
-
}, children);
|
|
3297
|
-
} finally {
|
|
3298
|
-
_effect.f();
|
|
3299
|
-
}
|
|
3300
|
-
};
|
|
3301
|
-
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
3302
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3303
|
-
var _effect = _useSignals27();
|
|
3304
|
-
try {
|
|
3305
|
-
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
3306
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3307
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.SubTrigger, {
|
|
3308
|
-
...menuScope,
|
|
3309
|
-
...subTriggerProps,
|
|
3310
|
-
ref: forwardedRef
|
|
3311
|
-
});
|
|
3312
|
-
} finally {
|
|
3313
|
-
_effect.f();
|
|
3314
|
-
}
|
|
3315
|
-
});
|
|
3316
|
-
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
3317
|
-
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
3318
|
-
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
3319
|
-
var _effect = _useSignals27();
|
|
3320
|
-
try {
|
|
3321
|
-
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
3322
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
3323
|
-
return /* @__PURE__ */ React27.createElement(MenuPrimitive.SubContent, {
|
|
3324
|
-
...menuScope,
|
|
3325
|
-
...subContentProps,
|
|
3326
|
-
ref: forwardedRef,
|
|
3327
|
-
style: {
|
|
3328
|
-
...props.style,
|
|
3329
|
-
// re-namespace exposed content custom properties
|
|
3330
|
-
...{
|
|
3331
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3332
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
3333
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
3334
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3335
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3336
|
-
}
|
|
3337
|
-
}
|
|
3338
|
-
});
|
|
3339
|
-
} finally {
|
|
3340
|
-
_effect.f();
|
|
3341
|
-
}
|
|
3342
|
-
});
|
|
3343
|
-
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
3344
|
-
var DropdownMenu = {
|
|
3345
|
-
Root: DropdownMenuRoot,
|
|
3346
|
-
Trigger: DropdownMenuTrigger,
|
|
3347
|
-
VirtualTrigger: DropdownMenuVirtualTrigger,
|
|
3348
|
-
Portal: DropdownMenuPortal,
|
|
3349
|
-
Content: DropdownMenuContent,
|
|
3350
|
-
Viewport: DropdownMenuViewport,
|
|
3351
|
-
Group: DropdownMenuGroup,
|
|
3352
|
-
GroupLabel: DropdownMenuGroupLabel,
|
|
3353
|
-
Item: DropdownMenuItem,
|
|
3354
|
-
CheckboxItem: DropdownMenuCheckboxItem,
|
|
3355
|
-
RadioGroup: DropdownMenuRadioGroup,
|
|
3356
|
-
RadioItem: DropdownMenuRadioItem,
|
|
3357
|
-
ItemIndicator: DropdownMenuItemIndicator,
|
|
3358
|
-
Separator: DropdownMenuSeparator,
|
|
3359
|
-
Arrow: DropdownMenuArrow,
|
|
3360
|
-
Sub: DropdownMenuSub,
|
|
3361
|
-
SubTrigger: DropdownMenuSubTrigger,
|
|
3362
|
-
SubContent: DropdownMenuSubContent
|
|
3363
|
-
};
|
|
3364
|
-
var useDropdownMenuMenuScope = useMenuScope;
|
|
3365
|
-
|
|
3366
|
-
// src/components/Message/Message.tsx
|
|
3367
|
-
import { useSignals as _useSignals28 } from "@preact-signals/safe-react/tracking";
|
|
3368
|
-
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
3369
|
-
import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
3370
|
-
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
3371
|
-
import React28, { forwardRef as forwardRef20 } from "react";
|
|
3372
|
-
import { useId as useId4 } from "@dxos/react-hooks";
|
|
3373
|
-
var messageIcons = {
|
|
3374
|
-
success: "ph--check-circle--duotone",
|
|
3375
|
-
info: "ph--info--duotone",
|
|
3376
|
-
warning: "ph--warning--duotone",
|
|
3377
|
-
error: "ph--warning-circle--duotone",
|
|
3378
|
-
neutral: "ph--info--duotone"
|
|
3379
|
-
};
|
|
3380
|
-
var MESSAGE_NAME = "Message";
|
|
3381
|
-
var [MessageProvider, useMessageContext] = createContext11(MESSAGE_NAME);
|
|
3382
|
-
var MessageRoot = /* @__PURE__ */ forwardRef20(({ asChild, valence = "neutral", elevation: propsElevation, classNames, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
3383
|
-
var _effect = _useSignals28();
|
|
3384
|
-
try {
|
|
3385
|
-
const { tx } = useThemeContext();
|
|
3386
|
-
const titleId = useId4("message__title", propsTitleId);
|
|
3387
|
-
const descriptionId = useId4("message__description", propsDescriptionId);
|
|
3388
|
-
const elevation = useElevationContext(propsElevation);
|
|
3389
|
-
const Root8 = asChild ? Slot11 : Primitive11.div;
|
|
3390
|
-
return /* @__PURE__ */ React28.createElement(MessageProvider, {
|
|
3391
|
-
titleId,
|
|
3392
|
-
descriptionId,
|
|
3393
|
-
valence
|
|
3394
|
-
}, /* @__PURE__ */ React28.createElement(Root8, {
|
|
3395
|
-
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3396
|
-
...props,
|
|
3397
|
-
className: tx("message.root", "message", {
|
|
3398
|
-
valence,
|
|
3399
|
-
elevation
|
|
3400
|
-
}, classNames),
|
|
3401
|
-
"aria-labelledby": titleId,
|
|
3402
|
-
"aria-describedby": descriptionId,
|
|
3403
|
-
ref: forwardedRef
|
|
3404
|
-
}, children));
|
|
3405
|
-
} finally {
|
|
3406
|
-
_effect.f();
|
|
3407
|
-
}
|
|
3408
|
-
});
|
|
3409
|
-
MessageRoot.displayName = MESSAGE_NAME;
|
|
3410
|
-
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3411
|
-
var MessageTitle = /* @__PURE__ */ forwardRef20(({ asChild, classNames, children, icon, ...props }, forwardedRef) => {
|
|
3412
|
-
var _effect = _useSignals28();
|
|
3413
|
-
try {
|
|
3414
|
-
const { tx } = useThemeContext();
|
|
3415
|
-
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3416
|
-
const Root8 = asChild ? Slot11 : Primitive11.h2;
|
|
3417
|
-
return /* @__PURE__ */ React28.createElement(Root8, {
|
|
3418
|
-
...props,
|
|
3419
|
-
className: tx("message.title", "message__title", {}, classNames),
|
|
3420
|
-
id: titleId,
|
|
3421
|
-
ref: forwardedRef
|
|
3422
|
-
}, !icon && valence === "neutral" ? null : /* @__PURE__ */ React28.createElement(Icon, {
|
|
3423
|
-
size: 5,
|
|
3424
|
-
icon: icon ?? messageIcons[valence],
|
|
3425
|
-
classNames: tx("message.icon", "message__icon", {
|
|
3426
|
-
valence
|
|
3427
|
-
})
|
|
3428
|
-
}), /* @__PURE__ */ React28.createElement("span", null, children));
|
|
3429
|
-
} finally {
|
|
3430
|
-
_effect.f();
|
|
3431
|
-
}
|
|
3432
|
-
});
|
|
3433
|
-
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3434
|
-
var MESSAGE_BODY_NAME = "MessageContent";
|
|
3435
|
-
var MessageContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
3436
|
-
var _effect = _useSignals28();
|
|
3437
|
-
try {
|
|
3438
|
-
const { tx } = useThemeContext();
|
|
3439
|
-
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
3440
|
-
const Root8 = asChild ? Slot11 : Primitive11.p;
|
|
3441
|
-
return /* @__PURE__ */ React28.createElement(Root8, {
|
|
3442
|
-
...props,
|
|
3443
|
-
className: tx("message.content", "message__content", {}, classNames),
|
|
3444
|
-
id: descriptionId,
|
|
3445
|
-
ref: forwardedRef
|
|
3446
|
-
}, children);
|
|
3447
|
-
} finally {
|
|
3448
|
-
_effect.f();
|
|
3449
|
-
}
|
|
3450
|
-
});
|
|
3451
|
-
MessageContent.displayName = MESSAGE_BODY_NAME;
|
|
3452
|
-
var Message = {
|
|
3453
|
-
Root: MessageRoot,
|
|
3454
|
-
Title: MessageTitle,
|
|
3455
|
-
Content: MessageContent
|
|
3456
|
-
};
|
|
3457
|
-
var Callout = Message;
|
|
3458
|
-
|
|
3459
|
-
// src/components/Popover/Popover.tsx
|
|
3460
|
-
import { useSignals as _useSignals29 } from "@preact-signals/safe-react/tracking";
|
|
3461
|
-
import { composeEventHandlers as composeEventHandlers3 } from "@radix-ui/primitive";
|
|
3462
|
-
import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
|
|
3463
|
-
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
3464
|
-
import { DismissableLayer as DismissableLayer2 } from "@radix-ui/react-dismissable-layer";
|
|
3465
|
-
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
3466
|
-
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
3467
|
-
import { useId as useId5 } from "@radix-ui/react-id";
|
|
3468
|
-
import * as PopperPrimitive2 from "@radix-ui/react-popper";
|
|
3469
|
-
import { createPopperScope as createPopperScope2 } from "@radix-ui/react-popper";
|
|
3470
|
-
import { Portal as PortalPrimitive2 } from "@radix-ui/react-portal";
|
|
3471
|
-
import { Presence as Presence2 } from "@radix-ui/react-presence";
|
|
3472
|
-
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
3473
|
-
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
3474
|
-
import { useControllableState as useControllableState6 } from "@radix-ui/react-use-controllable-state";
|
|
3475
|
-
import { hideOthers } from "aria-hidden";
|
|
3476
|
-
import React29, { forwardRef as forwardRef21, useCallback as useCallback11, useEffect as useEffect8, useMemo as useMemo6, useRef as useRef4, useState as useState9 } from "react";
|
|
3477
|
-
import { RemoveScroll } from "react-remove-scroll";
|
|
3478
|
-
var POPOVER_NAME = "Popover";
|
|
3479
|
-
var [createPopoverContext, createPopoverScope] = createContextScope4(POPOVER_NAME, [
|
|
3480
|
-
createPopperScope2
|
|
3481
|
-
]);
|
|
3482
|
-
var usePopperScope2 = createPopperScope2();
|
|
3483
|
-
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
3484
|
-
var PopoverRoot = (props) => {
|
|
3485
|
-
var _effect = _useSignals29();
|
|
3486
|
-
try {
|
|
3487
|
-
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3488
|
-
const popperScope = usePopperScope2(__scopePopover);
|
|
3489
|
-
const triggerRef = useRef4(null);
|
|
3490
|
-
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
3491
|
-
const [open = false, setOpen] = useControllableState6({
|
|
3492
|
-
prop: openProp,
|
|
3493
|
-
defaultProp: defaultOpen,
|
|
3494
|
-
onChange: onOpenChange
|
|
3495
|
-
});
|
|
3496
|
-
return /* @__PURE__ */ React29.createElement(PopperPrimitive2.Root, popperScope, /* @__PURE__ */ React29.createElement(PopoverProvider, {
|
|
3497
|
-
scope: __scopePopover,
|
|
3498
|
-
contentId: useId5(),
|
|
3499
|
-
triggerRef,
|
|
3500
|
-
open,
|
|
3501
|
-
onOpenChange: setOpen,
|
|
3502
|
-
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3503
|
-
setOpen
|
|
3504
|
-
]),
|
|
3505
|
-
hasCustomAnchor,
|
|
3506
|
-
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3507
|
-
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3508
|
-
modal
|
|
3509
|
-
}, children));
|
|
3510
|
-
} finally {
|
|
3511
|
-
_effect.f();
|
|
3512
|
-
}
|
|
3513
|
-
};
|
|
3514
|
-
PopoverRoot.displayName = POPOVER_NAME;
|
|
3515
|
-
var ANCHOR_NAME = "PopoverAnchor";
|
|
3516
|
-
var PopoverAnchor = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3517
|
-
var _effect = _useSignals29();
|
|
3518
|
-
try {
|
|
3519
|
-
const { __scopePopover, ...anchorProps } = props;
|
|
3520
|
-
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3521
|
-
const popperScope = usePopperScope2(__scopePopover);
|
|
3522
|
-
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3523
|
-
useEffect8(() => {
|
|
3524
|
-
onCustomAnchorAdd();
|
|
3525
|
-
return () => onCustomAnchorRemove();
|
|
3526
|
-
}, [
|
|
3527
|
-
onCustomAnchorAdd,
|
|
3528
|
-
onCustomAnchorRemove
|
|
3529
|
-
]);
|
|
3530
|
-
return /* @__PURE__ */ React29.createElement(PopperPrimitive2.Anchor, {
|
|
3531
|
-
...popperScope,
|
|
3532
|
-
...anchorProps,
|
|
3533
|
-
ref: forwardedRef
|
|
3534
|
-
});
|
|
3535
|
-
} finally {
|
|
3536
|
-
_effect.f();
|
|
3537
|
-
}
|
|
3538
|
-
});
|
|
3539
|
-
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
3540
|
-
var TRIGGER_NAME3 = "PopoverTrigger";
|
|
3541
|
-
var PopoverTrigger = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3542
|
-
var _effect = _useSignals29();
|
|
3543
|
-
try {
|
|
3544
|
-
const { __scopePopover, ...triggerProps } = props;
|
|
3545
|
-
const context = usePopoverContext(TRIGGER_NAME3, __scopePopover);
|
|
3546
|
-
const popperScope = usePopperScope2(__scopePopover);
|
|
3547
|
-
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3548
|
-
const trigger = /* @__PURE__ */ React29.createElement(Primitive12.button, {
|
|
3549
|
-
type: "button",
|
|
3550
|
-
"aria-haspopup": "dialog",
|
|
3551
|
-
"aria-expanded": context.open,
|
|
3552
|
-
"aria-controls": context.contentId,
|
|
3553
|
-
"data-state": getState(context.open),
|
|
3554
|
-
...triggerProps,
|
|
3555
|
-
ref: composedTriggerRef,
|
|
3556
|
-
onClick: composeEventHandlers3(props.onClick, context.onOpenToggle)
|
|
3557
|
-
});
|
|
3558
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React29.createElement(PopperPrimitive2.Anchor, {
|
|
3559
|
-
asChild: true,
|
|
3560
|
-
...popperScope
|
|
3561
|
-
}, trigger);
|
|
3562
|
-
} finally {
|
|
3563
|
-
_effect.f();
|
|
3564
|
-
}
|
|
3565
|
-
});
|
|
3566
|
-
PopoverTrigger.displayName = TRIGGER_NAME3;
|
|
3567
|
-
var VIRTUAL_TRIGGER_NAME2 = "PopoverVirtualTrigger";
|
|
3568
|
-
var PopoverVirtualTrigger = (props) => {
|
|
3569
|
-
var _effect = _useSignals29();
|
|
3570
|
-
try {
|
|
3571
|
-
const { __scopePopover, virtualRef } = props;
|
|
3572
|
-
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3573
|
-
const popperScope = usePopperScope2(__scopePopover);
|
|
3574
|
-
useEffect8(() => {
|
|
3575
|
-
if (virtualRef.current) {
|
|
3576
|
-
context.triggerRef.current = virtualRef.current;
|
|
3577
|
-
}
|
|
3578
|
-
});
|
|
3579
|
-
return /* @__PURE__ */ React29.createElement(PopperPrimitive2.Anchor, {
|
|
3580
|
-
...popperScope,
|
|
3581
|
-
virtualRef
|
|
3582
|
-
});
|
|
3583
|
-
} finally {
|
|
3584
|
-
_effect.f();
|
|
3585
|
-
}
|
|
3586
|
-
};
|
|
3587
|
-
PopoverVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME2;
|
|
3588
|
-
var PORTAL_NAME3 = "PopoverPortal";
|
|
3589
|
-
var [PortalProvider2, usePortalContext2] = createPopoverContext(PORTAL_NAME3, {
|
|
3590
|
-
forceMount: void 0
|
|
3591
|
-
});
|
|
3592
|
-
var PopoverPortal = (props) => {
|
|
3593
|
-
var _effect = _useSignals29();
|
|
3594
|
-
try {
|
|
3595
|
-
const { __scopePopover, forceMount, children, container } = props;
|
|
3596
|
-
const context = usePopoverContext(PORTAL_NAME3, __scopePopover);
|
|
3597
|
-
return /* @__PURE__ */ React29.createElement(PortalProvider2, {
|
|
3598
|
-
scope: __scopePopover,
|
|
3599
|
-
forceMount
|
|
3600
|
-
}, /* @__PURE__ */ React29.createElement(Presence2, {
|
|
3601
|
-
present: forceMount || context.open
|
|
3602
|
-
}, /* @__PURE__ */ React29.createElement(PortalPrimitive2, {
|
|
3603
|
-
asChild: true,
|
|
3604
|
-
container
|
|
3605
|
-
}, children)));
|
|
3606
|
-
} finally {
|
|
3607
|
-
_effect.f();
|
|
3608
|
-
}
|
|
3609
|
-
};
|
|
3610
|
-
PopoverPortal.displayName = PORTAL_NAME3;
|
|
3611
|
-
var CONTENT_NAME3 = "PopoverContent";
|
|
3612
|
-
var PopoverContent = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3613
|
-
var _effect = _useSignals29();
|
|
3614
|
-
try {
|
|
3615
|
-
const portalContext = usePortalContext2(CONTENT_NAME3, props.__scopePopover);
|
|
3616
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3617
|
-
const context = usePopoverContext(CONTENT_NAME3, props.__scopePopover);
|
|
3618
|
-
return /* @__PURE__ */ React29.createElement(Presence2, {
|
|
3619
|
-
present: forceMount || context.open
|
|
3620
|
-
}, context.modal ? /* @__PURE__ */ React29.createElement(PopoverContentModal, {
|
|
3621
|
-
...contentProps,
|
|
3622
|
-
ref: forwardedRef
|
|
3623
|
-
}) : /* @__PURE__ */ React29.createElement(PopoverContentNonModal, {
|
|
3624
|
-
...contentProps,
|
|
3625
|
-
ref: forwardedRef
|
|
3626
|
-
}));
|
|
3627
|
-
} finally {
|
|
3628
|
-
_effect.f();
|
|
3629
|
-
}
|
|
3630
|
-
});
|
|
3631
|
-
PopoverContent.displayName = CONTENT_NAME3;
|
|
3632
|
-
var PopoverContentModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3633
|
-
var _effect = _useSignals29();
|
|
3634
|
-
try {
|
|
3635
|
-
const context = usePopoverContext(CONTENT_NAME3, props.__scopePopover);
|
|
3636
|
-
const contentRef = useRef4(null);
|
|
3637
|
-
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3638
|
-
const isRightClickOutsideRef = useRef4(false);
|
|
3639
|
-
useEffect8(() => {
|
|
3640
|
-
const content = contentRef.current;
|
|
3641
|
-
if (content) {
|
|
3642
|
-
return hideOthers(content);
|
|
3643
|
-
}
|
|
3644
|
-
}, []);
|
|
3645
|
-
return /* @__PURE__ */ React29.createElement(RemoveScroll, {
|
|
3646
|
-
as: Slot12,
|
|
3647
|
-
allowPinchZoom: true
|
|
3648
|
-
}, /* @__PURE__ */ React29.createElement(PopoverContentImpl, {
|
|
3649
|
-
...props,
|
|
3650
|
-
ref: composedRefs,
|
|
3651
|
-
// we make sure we're not trapping once it's been closed
|
|
3652
|
-
// (closed !== unmounted when animating out)
|
|
3653
|
-
trapFocus: context.open,
|
|
3654
|
-
disableOutsidePointerEvents: true,
|
|
3655
|
-
onCloseAutoFocus: composeEventHandlers3(props.onCloseAutoFocus, (event) => {
|
|
3656
|
-
event.preventDefault();
|
|
3657
|
-
if (!isRightClickOutsideRef.current) {
|
|
3658
|
-
context.triggerRef.current?.focus();
|
|
3659
|
-
}
|
|
3660
|
-
}),
|
|
3661
|
-
onPointerDownOutside: composeEventHandlers3(props.onPointerDownOutside, (event) => {
|
|
3662
|
-
const originalEvent = event.detail.originalEvent;
|
|
3663
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
3664
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
3665
|
-
isRightClickOutsideRef.current = isRightClick;
|
|
3666
|
-
}, {
|
|
3667
|
-
checkForDefaultPrevented: false
|
|
3668
|
-
}),
|
|
3669
|
-
// When focus is trapped, a `focusout` event may still happen.
|
|
3670
|
-
// We make sure we don't trigger our `onDismiss` in such case.
|
|
3671
|
-
onFocusOutside: composeEventHandlers3(props.onFocusOutside, (event) => event.preventDefault(), {
|
|
3672
|
-
checkForDefaultPrevented: false
|
|
3673
|
-
})
|
|
3674
|
-
}));
|
|
3675
|
-
} finally {
|
|
3676
|
-
_effect.f();
|
|
3677
|
-
}
|
|
3678
|
-
});
|
|
3679
|
-
var PopoverContentNonModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3680
|
-
var _effect = _useSignals29();
|
|
3681
|
-
try {
|
|
3682
|
-
const context = usePopoverContext(CONTENT_NAME3, props.__scopePopover);
|
|
3683
|
-
const hasInteractedOutsideRef = useRef4(false);
|
|
3684
|
-
const hasPointerDownOutsideRef = useRef4(false);
|
|
3685
|
-
return /* @__PURE__ */ React29.createElement(PopoverContentImpl, {
|
|
3686
|
-
...props,
|
|
3687
|
-
ref: forwardedRef,
|
|
3688
|
-
trapFocus: false,
|
|
3689
|
-
disableOutsidePointerEvents: false,
|
|
3690
|
-
onCloseAutoFocus: (event) => {
|
|
3691
|
-
props.onCloseAutoFocus?.(event);
|
|
3692
|
-
if (!event.defaultPrevented) {
|
|
3693
|
-
if (!hasInteractedOutsideRef.current) {
|
|
3694
|
-
context.triggerRef.current?.focus();
|
|
3695
|
-
}
|
|
3696
|
-
event.preventDefault();
|
|
3697
|
-
}
|
|
3698
|
-
hasInteractedOutsideRef.current = false;
|
|
3699
|
-
hasPointerDownOutsideRef.current = false;
|
|
3700
|
-
},
|
|
3701
|
-
onInteractOutside: (event) => {
|
|
3702
|
-
props.onInteractOutside?.(event);
|
|
3703
|
-
if (!event.defaultPrevented) {
|
|
3704
|
-
hasInteractedOutsideRef.current = true;
|
|
3705
|
-
if (event.detail.originalEvent.type === "pointerdown") {
|
|
3706
|
-
hasPointerDownOutsideRef.current = true;
|
|
3707
|
-
}
|
|
3708
|
-
}
|
|
3709
|
-
const target = event.target;
|
|
3710
|
-
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
3711
|
-
if (targetIsTrigger) {
|
|
3712
|
-
event.preventDefault();
|
|
3713
|
-
}
|
|
3714
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
3715
|
-
event.preventDefault();
|
|
3716
|
-
}
|
|
3717
|
-
}
|
|
3718
|
-
});
|
|
3719
|
-
} finally {
|
|
3720
|
-
_effect.f();
|
|
3721
|
-
}
|
|
3722
|
-
});
|
|
3723
|
-
var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3724
|
-
var _effect = _useSignals29();
|
|
3725
|
-
try {
|
|
3726
|
-
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
3727
|
-
const context = usePopoverContext(CONTENT_NAME3, __scopePopover);
|
|
3728
|
-
const popperScope = usePopperScope2(__scopePopover);
|
|
3729
|
-
const { tx } = useThemeContext();
|
|
3730
|
-
const elevation = useElevationContext();
|
|
3731
|
-
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
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
|
-
]);
|
|
3749
|
-
return /* @__PURE__ */ React29.createElement(FocusScope, {
|
|
3750
|
-
asChild: true,
|
|
3751
|
-
loop: true,
|
|
3752
|
-
trapped: trapFocus,
|
|
3753
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
3754
|
-
onUnmountAutoFocus: onCloseAutoFocus
|
|
3755
|
-
}, /* @__PURE__ */ React29.createElement(DismissableLayer2, {
|
|
3756
|
-
asChild: true,
|
|
3757
|
-
disableOutsidePointerEvents,
|
|
3758
|
-
onInteractOutside,
|
|
3759
|
-
onEscapeKeyDown,
|
|
3760
|
-
onPointerDownOutside,
|
|
3761
|
-
onFocusOutside,
|
|
3762
|
-
onDismiss: () => context.onOpenChange(false)
|
|
3763
|
-
}, /* @__PURE__ */ React29.createElement(PopperPrimitive2.Content, {
|
|
3764
|
-
"data-state": getState(context.open),
|
|
3765
|
-
role: "dialog",
|
|
3766
|
-
id: context.contentId,
|
|
3767
|
-
...popperScope,
|
|
3768
|
-
...contentProps,
|
|
3769
|
-
collisionPadding: safeCollisionPadding,
|
|
3770
|
-
collisionBoundary: computedCollisionBoundary,
|
|
3771
|
-
className: tx("popover.content", "popover", {
|
|
3772
|
-
elevation
|
|
3773
|
-
}, classNames),
|
|
3774
|
-
ref: forwardedRef,
|
|
3775
|
-
style: {
|
|
3776
|
-
...contentProps.style,
|
|
3777
|
-
// Re-namespace exposed content custom properties.
|
|
3778
|
-
...{
|
|
3779
|
-
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3780
|
-
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
3781
|
-
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
3782
|
-
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3783
|
-
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3784
|
-
}
|
|
3785
|
-
}
|
|
3786
|
-
})));
|
|
3787
|
-
} finally {
|
|
3788
|
-
_effect.f();
|
|
3789
|
-
}
|
|
3790
|
-
});
|
|
3791
|
-
var CLOSE_NAME = "PopoverClose";
|
|
3792
|
-
var PopoverClose = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3793
|
-
var _effect = _useSignals29();
|
|
3794
|
-
try {
|
|
3795
|
-
const { __scopePopover, ...closeProps } = props;
|
|
3796
|
-
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3797
|
-
return /* @__PURE__ */ React29.createElement(Primitive12.button, {
|
|
3798
|
-
type: "button",
|
|
3799
|
-
...closeProps,
|
|
3800
|
-
ref: forwardedRef,
|
|
3801
|
-
onClick: composeEventHandlers3(props.onClick, () => context.onOpenChange(false))
|
|
3802
|
-
});
|
|
3803
|
-
} finally {
|
|
3804
|
-
_effect.f();
|
|
3805
|
-
}
|
|
3806
|
-
});
|
|
3807
|
-
PopoverClose.displayName = CLOSE_NAME;
|
|
3808
|
-
var ARROW_NAME3 = "PopoverArrow";
|
|
3809
|
-
var PopoverArrow = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
3810
|
-
var _effect = _useSignals29();
|
|
3811
|
-
try {
|
|
3812
|
-
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3813
|
-
const popperScope = usePopperScope2(__scopePopover);
|
|
3814
|
-
const { tx } = useThemeContext();
|
|
3815
|
-
return /* @__PURE__ */ React29.createElement(PopperPrimitive2.Arrow, {
|
|
3816
|
-
...popperScope,
|
|
3817
|
-
...arrowProps,
|
|
3818
|
-
className: tx("popover.arrow", "popover__arrow", {}, classNames),
|
|
3819
|
-
ref: forwardedRef
|
|
3820
|
-
});
|
|
3821
|
-
} finally {
|
|
3822
|
-
_effect.f();
|
|
3823
|
-
}
|
|
3824
|
-
});
|
|
3825
|
-
PopoverArrow.displayName = ARROW_NAME3;
|
|
3826
|
-
var PopoverViewport = /* @__PURE__ */ forwardRef21(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3827
|
-
var _effect = _useSignals29();
|
|
3828
|
-
try {
|
|
3829
|
-
const { tx } = useThemeContext();
|
|
3830
|
-
const Root8 = asChild ? Slot12 : Primitive12.div;
|
|
3831
|
-
return /* @__PURE__ */ React29.createElement(Root8, {
|
|
3832
|
-
...props,
|
|
3833
|
-
className: tx("popover.viewport", "popover__viewport", {
|
|
3834
|
-
constrainInline,
|
|
3835
|
-
constrainBlock
|
|
3836
|
-
}, classNames),
|
|
3837
|
-
ref: forwardedRef
|
|
3838
|
-
}, children);
|
|
3839
|
-
} finally {
|
|
3840
|
-
_effect.f();
|
|
3841
|
-
}
|
|
3842
|
-
});
|
|
3843
|
-
var getState = (open) => open ? "open" : "closed";
|
|
3844
|
-
var Popover = {
|
|
3845
|
-
Root: PopoverRoot,
|
|
3846
|
-
Anchor: PopoverAnchor,
|
|
3847
|
-
Trigger: PopoverTrigger,
|
|
3848
|
-
VirtualTrigger: PopoverVirtualTrigger,
|
|
3849
|
-
Portal: PopoverPortal,
|
|
3850
|
-
Content: PopoverContent,
|
|
3851
|
-
Close: PopoverClose,
|
|
3852
|
-
Arrow: PopoverArrow,
|
|
3853
|
-
Viewport: PopoverViewport
|
|
3854
|
-
};
|
|
3855
|
-
|
|
3856
|
-
// src/components/Status/Status.tsx
|
|
3857
|
-
import { useSignals as _useSignals30 } from "@preact-signals/safe-react/tracking";
|
|
3858
|
-
import React30, { forwardRef as forwardRef22 } from "react";
|
|
3859
|
-
var Status = /* @__PURE__ */ forwardRef22(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3860
|
-
var _effect = _useSignals30();
|
|
3861
|
-
try {
|
|
3862
|
-
const { tx } = useThemeContext();
|
|
3863
|
-
return /* @__PURE__ */ React30.createElement("span", {
|
|
3864
|
-
role: "status",
|
|
3865
|
-
...props,
|
|
3866
|
-
className: tx("status.root", "status", {
|
|
3867
|
-
indeterminate,
|
|
3868
|
-
variant
|
|
3869
|
-
}, classNames),
|
|
3870
|
-
ref: forwardedRef
|
|
3871
|
-
}, /* @__PURE__ */ React30.createElement("span", {
|
|
3872
|
-
role: "none",
|
|
3873
|
-
className: tx("status.bar", "status__bar", {
|
|
3874
|
-
indeterminate,
|
|
3875
|
-
variant
|
|
3876
|
-
}, classNames),
|
|
3877
|
-
...!indeterminate && {
|
|
3878
|
-
style: {
|
|
3879
|
-
width: `${Math.round(progress * 100)}%`
|
|
3880
|
-
}
|
|
3881
|
-
}
|
|
3882
|
-
}), children);
|
|
3883
|
-
} finally {
|
|
3884
|
-
_effect.f();
|
|
3885
|
-
}
|
|
3886
|
-
});
|
|
3887
|
-
|
|
3888
|
-
// src/components/ScrollArea/ScrollArea.tsx
|
|
3889
|
-
import { useSignals as _useSignals31 } from "@preact-signals/safe-react/tracking";
|
|
3890
|
-
import { Corner as ScrollAreaPrimitiveCorner, Root as ScrollAreaPrimitiveRoot, Scrollbar as ScrollAreaPrimitiveScrollbar, Thumb as ScrollAreaPrimitiveThumb, Viewport as ScrollAreaPrimitiveViewport } from "@radix-ui/react-scroll-area";
|
|
3891
|
-
import React31, { forwardRef as forwardRef23 } from "react";
|
|
3892
|
-
var ScrollAreaRoot = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3893
|
-
var _effect = _useSignals31();
|
|
3894
|
-
try {
|
|
3895
|
-
const { tx } = useThemeContext();
|
|
3896
|
-
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveRoot, {
|
|
3897
|
-
...props,
|
|
3898
|
-
className: tx("scrollArea.root", "scroll-area", {}, classNames),
|
|
3899
|
-
ref: forwardedRef
|
|
3900
|
-
});
|
|
3901
|
-
} finally {
|
|
3902
|
-
_effect.f();
|
|
3903
|
-
}
|
|
3904
|
-
});
|
|
3905
|
-
var ScrollAreaViewport = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3906
|
-
var _effect = _useSignals31();
|
|
3907
|
-
try {
|
|
3908
|
-
const { tx } = useThemeContext();
|
|
3909
|
-
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveViewport, {
|
|
3910
|
-
...props,
|
|
3911
|
-
className: tx("scrollArea.viewport", "scroll-area", {}, classNames),
|
|
3912
|
-
ref: forwardedRef
|
|
3913
|
-
});
|
|
3914
|
-
} finally {
|
|
3915
|
-
_effect.f();
|
|
3916
|
-
}
|
|
3917
|
-
});
|
|
3918
|
-
var ScrollAreaScrollbar = /* @__PURE__ */ forwardRef23(({ classNames, variant = "fine", ...props }, forwardedRef) => {
|
|
3919
|
-
var _effect = _useSignals31();
|
|
3920
|
-
try {
|
|
3921
|
-
const { tx } = useThemeContext();
|
|
3922
|
-
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveScrollbar, {
|
|
3923
|
-
"data-variant": variant,
|
|
3924
|
-
...props,
|
|
3925
|
-
className: tx("scrollArea.scrollbar", "scroll-area__scrollbar", {}, classNames),
|
|
3926
|
-
ref: forwardedRef
|
|
3927
|
-
});
|
|
3928
|
-
} finally {
|
|
3929
|
-
_effect.f();
|
|
3930
|
-
}
|
|
3931
|
-
});
|
|
3932
|
-
var ScrollAreaThumb = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3933
|
-
var _effect = _useSignals31();
|
|
3934
|
-
try {
|
|
3935
|
-
const { tx } = useThemeContext();
|
|
3936
|
-
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveThumb, {
|
|
3937
|
-
...props,
|
|
3938
|
-
className: tx("scrollArea.thumb", "scroll-area__thumb", {}, classNames),
|
|
3939
|
-
ref: forwardedRef
|
|
3940
|
-
});
|
|
3941
|
-
} finally {
|
|
3942
|
-
_effect.f();
|
|
3943
|
-
}
|
|
3944
|
-
});
|
|
3945
|
-
var ScrollAreaCorner = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
3946
|
-
var _effect = _useSignals31();
|
|
3947
|
-
try {
|
|
3948
|
-
const { tx } = useThemeContext();
|
|
3949
|
-
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveCorner, {
|
|
3950
|
-
...props,
|
|
3951
|
-
className: tx("scrollArea.corner", "scroll-area__corner", {}, classNames),
|
|
3952
|
-
ref: forwardedRef
|
|
3953
|
-
});
|
|
3954
|
-
} finally {
|
|
3955
|
-
_effect.f();
|
|
3956
|
-
}
|
|
3957
|
-
});
|
|
3958
|
-
var ScrollArea = {
|
|
3959
|
-
Root: ScrollAreaRoot,
|
|
3960
|
-
Viewport: ScrollAreaViewport,
|
|
3961
|
-
Scrollbar: ScrollAreaScrollbar,
|
|
3962
|
-
Thumb: ScrollAreaThumb,
|
|
3963
|
-
Corner: ScrollAreaCorner
|
|
3964
|
-
};
|
|
3965
|
-
|
|
3966
|
-
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3967
|
-
import { useSignals as _useSignals32 } from "@preact-signals/safe-react/tracking";
|
|
3968
|
-
import { useState as useState10 } from "@preact-signals/safe-react/react";
|
|
3969
|
-
import { createContext as createContext12 } from "@radix-ui/react-context";
|
|
3970
|
-
import React32, { forwardRef as forwardRef24, useCallback as useCallback12, useEffect as useEffect9, useImperativeHandle, useMemo as useMemo7, useRef as useRef5 } from "react";
|
|
3971
|
-
import { addEventListener, combine } from "@dxos/async";
|
|
3972
|
-
import { invariant } from "@dxos/invariant";
|
|
3973
|
-
import { useForwardedRef as useForwardedRef2 } from "@dxos/react-hooks";
|
|
3974
|
-
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
3975
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3976
|
-
var isBottom = (el) => {
|
|
3977
|
-
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3978
|
-
};
|
|
3979
|
-
var [ScrollContainerProvider, useScrollContainerContext] = createContext12("ScrollContainer");
|
|
3980
|
-
var Root5 = /* @__PURE__ */ forwardRef24(({ children, classNames, pin, fade }, forwardedRef) => {
|
|
3981
|
-
var _effect = _useSignals32();
|
|
3982
|
-
try {
|
|
3983
|
-
const scrollerRef = useRef5(null);
|
|
3984
|
-
const autoScrollRef = useRef5(false);
|
|
3985
|
-
const [overflow, setOverflow] = useState10(false);
|
|
3986
|
-
const [pinned, setPinned] = useState10(pin);
|
|
3987
|
-
const timeoutRef = useRef5(void 0);
|
|
3988
|
-
const scrollToBottom = useCallback12((behavior = "instant") => {
|
|
3989
|
-
if (scrollerRef.current) {
|
|
3990
|
-
autoScrollRef.current = true;
|
|
3991
|
-
scrollerRef.current.classList.add("scrollbar-none");
|
|
3992
|
-
scrollerRef.current.scrollTo({
|
|
3993
|
-
top: scrollerRef.current.scrollHeight,
|
|
3994
|
-
behavior
|
|
3995
|
-
});
|
|
3996
|
-
clearTimeout(timeoutRef.current);
|
|
3997
|
-
if (behavior !== "instant") {
|
|
3998
|
-
timeoutRef.current = setTimeout(() => {
|
|
3999
|
-
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
4000
|
-
autoScrollRef.current = false;
|
|
4001
|
-
}, 500);
|
|
4002
|
-
}
|
|
4003
|
-
setPinned(true);
|
|
4004
|
-
}
|
|
4005
|
-
}, []);
|
|
4006
|
-
const controller = useMemo7(() => ({
|
|
4007
|
-
viewport: scrollerRef.current,
|
|
4008
|
-
scrollToTop: () => {
|
|
4009
|
-
invariant(scrollerRef.current, void 0, {
|
|
4010
|
-
F: __dxlog_file2,
|
|
4011
|
-
L: 92,
|
|
4012
|
-
S: void 0,
|
|
4013
|
-
A: [
|
|
4014
|
-
"scrollerRef.current",
|
|
4015
|
-
""
|
|
4016
|
-
]
|
|
4017
|
-
});
|
|
4018
|
-
scrollerRef.current.scrollTo({
|
|
4019
|
-
top: 0,
|
|
4020
|
-
behavior: "smooth"
|
|
4021
|
-
});
|
|
4022
|
-
setPinned(false);
|
|
4023
|
-
},
|
|
4024
|
-
scrollToBottom: () => {
|
|
4025
|
-
scrollToBottom("smooth");
|
|
4026
|
-
}
|
|
4027
|
-
}), [
|
|
4028
|
-
scrollToBottom,
|
|
4029
|
-
scrollerRef.current
|
|
4030
|
-
]);
|
|
4031
|
-
useImperativeHandle(forwardedRef, () => controller, [
|
|
4032
|
-
controller
|
|
4033
|
-
]);
|
|
4034
|
-
useEffect9(() => {
|
|
4035
|
-
if (!scrollerRef.current) {
|
|
4036
|
-
return;
|
|
4037
|
-
}
|
|
4038
|
-
return combine(
|
|
4039
|
-
// Check if user scrolls.
|
|
4040
|
-
addEventListener(scrollerRef.current, "wheel", () => {
|
|
4041
|
-
setPinned(isBottom(scrollerRef.current));
|
|
4042
|
-
}),
|
|
4043
|
-
// Check if scrolls.
|
|
4044
|
-
addEventListener(scrollerRef.current, "scroll", () => {
|
|
4045
|
-
setOverflow((scrollerRef.current?.scrollTop ?? 0) > 0);
|
|
4046
|
-
})
|
|
4047
|
-
);
|
|
4048
|
-
}, []);
|
|
4049
|
-
return /* @__PURE__ */ React32.createElement(ScrollContainerProvider, {
|
|
4050
|
-
pinned,
|
|
4051
|
-
controller,
|
|
4052
|
-
scrollToBottom
|
|
4053
|
-
}, /* @__PURE__ */ React32.createElement("div", {
|
|
4054
|
-
className: "relative grid flex-1 min-bs-0 overflow-hidden"
|
|
4055
|
-
}, fade && /* @__PURE__ */ React32.createElement("div", {
|
|
4056
|
-
role: "none",
|
|
4057
|
-
"data-visible": overflow,
|
|
4058
|
-
className: mx5(
|
|
4059
|
-
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
4060
|
-
"z-10 absolute block-start-0 inset-inline-0 bs-24 is-full",
|
|
4061
|
-
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
4062
|
-
"bg-gradient-to-b from-[--surface-bg] to-transparent pointer-events-none"
|
|
4063
|
-
)
|
|
4064
|
-
}), /* @__PURE__ */ React32.createElement("div", {
|
|
4065
|
-
className: mx5("flex flex-col min-bs-0 overflow-y-auto scrollbar-thin", classNames),
|
|
4066
|
-
ref: scrollerRef
|
|
4067
|
-
}, children)));
|
|
4068
|
-
} finally {
|
|
4069
|
-
_effect.f();
|
|
4070
|
-
}
|
|
4071
|
-
});
|
|
4072
|
-
Root5.displayName = "ScrollContainer.Root";
|
|
4073
|
-
var Viewport = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
4074
|
-
var _effect = _useSignals32();
|
|
4075
|
-
try {
|
|
4076
|
-
const contentRef = useForwardedRef2(forwardedRef);
|
|
4077
|
-
const { pinned, scrollToBottom } = useScrollContainerContext(Viewport.displayName);
|
|
4078
|
-
useEffect9(() => {
|
|
4079
|
-
if (!pinned || !contentRef.current) {
|
|
4080
|
-
return;
|
|
4081
|
-
}
|
|
4082
|
-
const resizeObserver = new ResizeObserver(() => scrollToBottom());
|
|
4083
|
-
scrollToBottom("instant");
|
|
4084
|
-
resizeObserver.observe(contentRef.current);
|
|
4085
|
-
return () => {
|
|
4086
|
-
resizeObserver.disconnect();
|
|
4087
|
-
};
|
|
4088
|
-
}, [
|
|
4089
|
-
pinned,
|
|
4090
|
-
scrollToBottom
|
|
4091
|
-
]);
|
|
4092
|
-
return /* @__PURE__ */ React32.createElement("div", {
|
|
4093
|
-
className: mx5("is-full", classNames),
|
|
4094
|
-
...props,
|
|
4095
|
-
ref: contentRef
|
|
4096
|
-
}, children);
|
|
4097
|
-
} finally {
|
|
4098
|
-
_effect.f();
|
|
4099
|
-
}
|
|
4100
|
-
});
|
|
4101
|
-
Viewport.displayName = "ScrollContainer.Viewport";
|
|
4102
|
-
var ScrollDownButton = ({ classNames }) => {
|
|
4103
|
-
var _effect = _useSignals32();
|
|
4104
|
-
try {
|
|
4105
|
-
const { pinned, scrollToBottom } = useScrollContainerContext(ScrollDownButton.displayName);
|
|
4106
|
-
return /* @__PURE__ */ React32.createElement("div", {
|
|
4107
|
-
role: "none",
|
|
4108
|
-
className: mx5("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
4109
|
-
}, /* @__PURE__ */ React32.createElement(IconButton, {
|
|
4110
|
-
variant: "primary",
|
|
4111
|
-
icon: "ph--arrow-down--regular",
|
|
4112
|
-
iconOnly: true,
|
|
4113
|
-
size: 4,
|
|
4114
|
-
label: "Scroll down",
|
|
4115
|
-
onClick: () => scrollToBottom()
|
|
4116
|
-
}));
|
|
4117
|
-
} finally {
|
|
4118
|
-
_effect.f();
|
|
4119
|
-
}
|
|
4120
|
-
};
|
|
4121
|
-
ScrollDownButton.displayName = "ScrollContainer.ScrollDownButton";
|
|
4122
|
-
var ScrollContainer = {
|
|
4123
|
-
Root: Root5,
|
|
4124
|
-
Viewport,
|
|
4125
|
-
ScrollDownButton
|
|
4126
|
-
};
|
|
4127
|
-
|
|
4128
|
-
// src/components/Select/Select.tsx
|
|
4129
|
-
import { useSignals as _useSignals33 } from "@preact-signals/safe-react/tracking";
|
|
4130
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4131
|
-
import React33, { forwardRef as forwardRef25 } from "react";
|
|
4132
|
-
var SelectRoot = SelectPrimitive.Root;
|
|
4133
|
-
var SelectTrigger = SelectPrimitive.Trigger;
|
|
4134
|
-
var SelectValue = SelectPrimitive.Value;
|
|
4135
|
-
var SelectIcon = SelectPrimitive.Icon;
|
|
4136
|
-
var SelectPortal = SelectPrimitive.Portal;
|
|
4137
|
-
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
4138
|
-
var _effect = _useSignals33();
|
|
4139
|
-
try {
|
|
4140
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Trigger, {
|
|
4141
|
-
asChild: true,
|
|
4142
|
-
ref: forwardedRef
|
|
4143
|
-
}, /* @__PURE__ */ React33.createElement(Button, props, /* @__PURE__ */ React33.createElement(SelectPrimitive.Value, {
|
|
4144
|
-
placeholder
|
|
4145
|
-
}, children), /* @__PURE__ */ React33.createElement("span", {
|
|
4146
|
-
className: "is-1 flex-1"
|
|
4147
|
-
}), /* @__PURE__ */ React33.createElement(SelectPrimitive.Icon, {
|
|
4148
|
-
asChild: true
|
|
4149
|
-
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
4150
|
-
size: 3,
|
|
4151
|
-
icon: "ph--caret-down--bold"
|
|
4152
|
-
}))));
|
|
4153
|
-
} finally {
|
|
4154
|
-
_effect.f();
|
|
4155
|
-
}
|
|
4156
|
-
});
|
|
4157
|
-
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
4158
|
-
var _effect = _useSignals33();
|
|
4159
|
-
try {
|
|
4160
|
-
const { tx } = useThemeContext();
|
|
4161
|
-
const elevation = useElevationContext();
|
|
4162
|
-
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
4163
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Content, {
|
|
4164
|
-
...props,
|
|
4165
|
-
"data-arrow-keys": "up down",
|
|
4166
|
-
collisionPadding: safeCollisionPadding,
|
|
4167
|
-
className: tx("select.content", "select__content", {
|
|
4168
|
-
elevation
|
|
4169
|
-
}, classNames),
|
|
4170
|
-
position: "popper",
|
|
4171
|
-
ref: forwardedRef
|
|
4172
|
-
}, children);
|
|
4173
|
-
} finally {
|
|
4174
|
-
_effect.f();
|
|
4175
|
-
}
|
|
4176
|
-
});
|
|
4177
|
-
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4178
|
-
var _effect = _useSignals33();
|
|
4179
|
-
try {
|
|
4180
|
-
const { tx } = useThemeContext();
|
|
4181
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
4182
|
-
...props,
|
|
4183
|
-
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
4184
|
-
ref: forwardedRef
|
|
4185
|
-
}, children ?? /* @__PURE__ */ React33.createElement(Icon, {
|
|
4186
|
-
size: 3,
|
|
4187
|
-
icon: "ph--caret-up--bold"
|
|
4188
|
-
}));
|
|
4189
|
-
} finally {
|
|
4190
|
-
_effect.f();
|
|
4191
|
-
}
|
|
4192
|
-
});
|
|
4193
|
-
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4194
|
-
var _effect = _useSignals33();
|
|
4195
|
-
try {
|
|
4196
|
-
const { tx } = useThemeContext();
|
|
4197
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
4198
|
-
...props,
|
|
4199
|
-
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
4200
|
-
ref: forwardedRef
|
|
4201
|
-
}, children ?? /* @__PURE__ */ React33.createElement(Icon, {
|
|
4202
|
-
size: 3,
|
|
4203
|
-
icon: "ph--caret-down--bold"
|
|
4204
|
-
}));
|
|
4205
|
-
} finally {
|
|
4206
|
-
_effect.f();
|
|
4207
|
-
}
|
|
4208
|
-
});
|
|
4209
|
-
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4210
|
-
var _effect = _useSignals33();
|
|
4211
|
-
try {
|
|
4212
|
-
const { tx } = useThemeContext();
|
|
4213
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectViewport, {
|
|
4214
|
-
...props,
|
|
4215
|
-
className: tx("select.viewport", "select__viewport", {}, classNames),
|
|
4216
|
-
ref: forwardedRef
|
|
4217
|
-
}, children);
|
|
4218
|
-
} finally {
|
|
4219
|
-
_effect.f();
|
|
4220
|
-
}
|
|
4221
|
-
});
|
|
4222
|
-
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4223
|
-
var _effect = _useSignals33();
|
|
4224
|
-
try {
|
|
4225
|
-
const { tx } = useThemeContext();
|
|
4226
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
4227
|
-
...props,
|
|
4228
|
-
className: tx("select.item", "option", {}, classNames),
|
|
4229
|
-
ref: forwardedRef
|
|
4230
|
-
});
|
|
4231
|
-
} finally {
|
|
4232
|
-
_effect.f();
|
|
4233
|
-
}
|
|
4234
|
-
});
|
|
4235
|
-
var SelectItemText = SelectPrimitive.ItemText;
|
|
4236
|
-
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
4237
|
-
var _effect = _useSignals33();
|
|
4238
|
-
try {
|
|
4239
|
-
const { tx } = useThemeContext();
|
|
4240
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemIndicator, {
|
|
4241
|
-
...props,
|
|
4242
|
-
className: tx("select.itemIndicator", "option__indicator", {}, classNames),
|
|
4243
|
-
ref: forwardedRef
|
|
4244
|
-
}, children);
|
|
4245
|
-
} finally {
|
|
4246
|
-
_effect.f();
|
|
4247
|
-
}
|
|
4248
|
-
});
|
|
4249
|
-
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
4250
|
-
var _effect = _useSignals33();
|
|
4251
|
-
try {
|
|
4252
|
-
const { tx } = useThemeContext();
|
|
4253
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
4254
|
-
...props,
|
|
4255
|
-
className: tx("select.item", "option", {}, classNames),
|
|
4256
|
-
ref: forwardedRef
|
|
4257
|
-
}, /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React33.createElement("span", {
|
|
4258
|
-
className: "grow is-1"
|
|
4259
|
-
}), /* @__PURE__ */ React33.createElement(Icon, {
|
|
4260
|
-
icon: "ph--check--regular"
|
|
4261
|
-
}));
|
|
4262
|
-
} finally {
|
|
4263
|
-
_effect.f();
|
|
4264
|
-
}
|
|
4265
|
-
});
|
|
4266
|
-
var SelectGroup = SelectPrimitive.Group;
|
|
4267
|
-
var SelectLabel = SelectPrimitive.Label;
|
|
4268
|
-
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4269
|
-
var _effect = _useSignals33();
|
|
4270
|
-
try {
|
|
4271
|
-
const { tx } = useThemeContext();
|
|
4272
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Separator, {
|
|
4273
|
-
...props,
|
|
4274
|
-
className: tx("select.separator", "select__separator", {}, classNames),
|
|
4275
|
-
ref: forwardedRef
|
|
4276
|
-
});
|
|
4277
|
-
} finally {
|
|
4278
|
-
_effect.f();
|
|
4279
|
-
}
|
|
4280
|
-
});
|
|
4281
|
-
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
4282
|
-
var _effect = _useSignals33();
|
|
4283
|
-
try {
|
|
4284
|
-
const { tx } = useThemeContext();
|
|
4285
|
-
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Arrow, {
|
|
4286
|
-
...props,
|
|
4287
|
-
className: tx("select.arrow", "select__arrow", {}, classNames),
|
|
4288
|
-
ref: forwardedRef
|
|
4289
|
-
});
|
|
4290
|
-
} finally {
|
|
4291
|
-
_effect.f();
|
|
4292
|
-
}
|
|
4293
|
-
});
|
|
4294
|
-
var Select = {
|
|
4295
|
-
Root: SelectRoot,
|
|
4296
|
-
Trigger: SelectTrigger,
|
|
4297
|
-
TriggerButton: SelectTriggerButton,
|
|
4298
|
-
Value: SelectValue,
|
|
4299
|
-
Icon: SelectIcon,
|
|
4300
|
-
Portal: SelectPortal,
|
|
4301
|
-
Content: SelectContent,
|
|
4302
|
-
ScrollUpButton: SelectScrollUpButton2,
|
|
4303
|
-
ScrollDownButton: SelectScrollDownButton2,
|
|
4304
|
-
Viewport: SelectViewport2,
|
|
4305
|
-
Item: SelectItem,
|
|
4306
|
-
ItemText: SelectItemText,
|
|
4307
|
-
ItemIndicator: SelectItemIndicator,
|
|
4308
|
-
Option: SelectOption,
|
|
4309
|
-
Group: SelectGroup,
|
|
4310
|
-
Label: SelectLabel,
|
|
4311
|
-
Separator: SelectSeparator,
|
|
4312
|
-
Arrow: SelectArrow
|
|
4313
|
-
};
|
|
4314
|
-
|
|
4315
|
-
// src/components/Separator/Separator.tsx
|
|
4316
|
-
import { useSignals as _useSignals34 } from "@preact-signals/safe-react/tracking";
|
|
4317
|
-
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
4318
|
-
import React34, { forwardRef as forwardRef26 } from "react";
|
|
4319
|
-
var Separator4 = /* @__PURE__ */ forwardRef26(({ classNames, orientation = "horizontal", subdued, ...props }, forwardedRef) => {
|
|
4320
|
-
var _effect = _useSignals34();
|
|
4321
|
-
try {
|
|
4322
|
-
const { tx } = useThemeContext();
|
|
4323
|
-
return /* @__PURE__ */ React34.createElement(SeparatorPrimitive, {
|
|
4324
|
-
orientation,
|
|
4325
|
-
...props,
|
|
4326
|
-
className: tx("separator.root", "separator", {
|
|
4327
|
-
orientation,
|
|
4328
|
-
subdued
|
|
4329
|
-
}, classNames),
|
|
4330
|
-
ref: forwardedRef
|
|
4331
|
-
});
|
|
4332
|
-
} finally {
|
|
4333
|
-
_effect.f();
|
|
4334
|
-
}
|
|
4335
|
-
});
|
|
4336
|
-
|
|
4337
|
-
// src/components/Tag/Tag.tsx
|
|
4338
|
-
import { useSignals as _useSignals35 } from "@preact-signals/safe-react/tracking";
|
|
4339
|
-
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
4340
|
-
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
4341
|
-
import React35, { forwardRef as forwardRef27 } from "react";
|
|
4342
|
-
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
4343
|
-
var _effect = _useSignals35();
|
|
4344
|
-
try {
|
|
4345
|
-
const { tx } = useThemeContext();
|
|
4346
|
-
const Root8 = asChild ? Slot13 : Primitive13.span;
|
|
4347
|
-
return /* @__PURE__ */ React35.createElement(Root8, {
|
|
4348
|
-
...props,
|
|
4349
|
-
className: tx("tag.root", "dx-tag", {
|
|
4350
|
-
palette
|
|
4351
|
-
}, classNames),
|
|
4352
|
-
"data-hue": palette,
|
|
4353
|
-
ref: forwardedRef
|
|
4354
|
-
});
|
|
4355
|
-
} finally {
|
|
4356
|
-
_effect.f();
|
|
4357
|
-
}
|
|
4358
|
-
});
|
|
4359
|
-
|
|
4360
|
-
// src/components/Toast/Toast.tsx
|
|
4361
|
-
import { useSignals as _useSignals36 } from "@preact-signals/safe-react/tracking";
|
|
4362
|
-
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
4363
|
-
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
4364
|
-
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";
|
|
4365
|
-
import React36, { forwardRef as forwardRef28 } from "react";
|
|
4366
|
-
var ToastProvider = ToastProviderPrimitive;
|
|
4367
|
-
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
4368
|
-
var _effect = _useSignals36();
|
|
4369
|
-
try {
|
|
4370
|
-
const { tx } = useThemeContext();
|
|
4371
|
-
return /* @__PURE__ */ React36.createElement(ToastViewportPrimitive, {
|
|
4372
|
-
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
4373
|
-
ref: forwardedRef
|
|
4374
|
-
});
|
|
4375
|
-
} finally {
|
|
4376
|
-
_effect.f();
|
|
4377
|
-
}
|
|
4378
|
-
});
|
|
4379
|
-
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
4380
|
-
var _effect = _useSignals36();
|
|
4381
|
-
try {
|
|
4382
|
-
const { tx } = useThemeContext();
|
|
4383
|
-
return /* @__PURE__ */ React36.createElement(ToastRootPrimitive, {
|
|
4384
|
-
...props,
|
|
4385
|
-
className: tx("toast.root", "toast", {}, classNames),
|
|
4386
|
-
ref: forwardedRef
|
|
4387
|
-
}, /* @__PURE__ */ React36.createElement(ElevationProvider, {
|
|
4388
|
-
elevation: "toast"
|
|
4389
|
-
}, children));
|
|
4390
|
-
} finally {
|
|
4391
|
-
_effect.f();
|
|
4392
|
-
}
|
|
4393
|
-
});
|
|
4394
|
-
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4395
|
-
var _effect = _useSignals36();
|
|
4396
|
-
try {
|
|
4397
|
-
const { tx } = useThemeContext();
|
|
4398
|
-
const Root8 = asChild ? Slot14 : Primitive14.div;
|
|
4399
|
-
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4400
|
-
...props,
|
|
4401
|
-
className: tx("toast.body", "toast__body", {}, classNames),
|
|
4402
|
-
ref: forwardedRef
|
|
4403
|
-
});
|
|
4404
|
-
} finally {
|
|
4405
|
-
_effect.f();
|
|
4406
|
-
}
|
|
4407
|
-
});
|
|
4408
|
-
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4409
|
-
var _effect = _useSignals36();
|
|
4410
|
-
try {
|
|
4411
|
-
const { tx } = useThemeContext();
|
|
4412
|
-
const Root8 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
4413
|
-
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4414
|
-
...props,
|
|
4415
|
-
className: tx("toast.title", "toast__title", {}, classNames),
|
|
4416
|
-
ref: forwardedRef
|
|
4417
|
-
});
|
|
4418
|
-
} finally {
|
|
4419
|
-
_effect.f();
|
|
4420
|
-
}
|
|
4421
|
-
});
|
|
4422
|
-
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4423
|
-
var _effect = _useSignals36();
|
|
4424
|
-
try {
|
|
4425
|
-
const { tx } = useThemeContext();
|
|
4426
|
-
const Root8 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
4427
|
-
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4428
|
-
...props,
|
|
4429
|
-
className: tx("toast.description", "toast__description", {}, classNames),
|
|
4430
|
-
ref: forwardedRef
|
|
4431
|
-
});
|
|
4432
|
-
} finally {
|
|
4433
|
-
_effect.f();
|
|
4434
|
-
}
|
|
4435
|
-
});
|
|
4436
|
-
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4437
|
-
var _effect = _useSignals36();
|
|
4438
|
-
try {
|
|
4439
|
-
const { tx } = useThemeContext();
|
|
4440
|
-
const Root8 = asChild ? Slot14 : Primitive14.div;
|
|
4441
|
-
return /* @__PURE__ */ React36.createElement(Root8, {
|
|
4442
|
-
...props,
|
|
4443
|
-
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
4444
|
-
ref: forwardedRef
|
|
4445
|
-
});
|
|
4446
|
-
} finally {
|
|
4447
|
-
_effect.f();
|
|
4448
|
-
}
|
|
4449
|
-
});
|
|
4450
|
-
var ToastAction = ToastActionPrimitive;
|
|
4451
|
-
var ToastClose = ToastClosePrimitive;
|
|
4452
|
-
var Toast = {
|
|
4453
|
-
Provider: ToastProvider,
|
|
4454
|
-
Viewport: ToastViewport,
|
|
4455
|
-
Root: ToastRoot,
|
|
4456
|
-
Body: ToastBody,
|
|
4457
|
-
Title: ToastTitle,
|
|
4458
|
-
Description: ToastDescription,
|
|
4459
|
-
Actions: ToastActions,
|
|
4460
|
-
Action: ToastAction,
|
|
4461
|
-
Close: ToastClose
|
|
4462
|
-
};
|
|
4463
|
-
|
|
4464
|
-
// src/components/Toolbar/Toolbar.tsx
|
|
4465
|
-
import { useSignals as _useSignals37 } from "@preact-signals/safe-react/tracking";
|
|
4466
|
-
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
4467
|
-
import React37, { Fragment, forwardRef as forwardRef29 } from "react";
|
|
4468
|
-
var ToolbarRoot = /* @__PURE__ */ forwardRef29(({ classNames, children, layoutManaged, textBlockWidth: textBlockWidthParam, disabled, ...props }, forwardedRef) => {
|
|
4469
|
-
var _effect = _useSignals37();
|
|
4470
|
-
try {
|
|
4471
|
-
const { tx } = useThemeContext();
|
|
4472
|
-
const InnerRoot = textBlockWidthParam ? "div" : Fragment;
|
|
4473
|
-
const innerRootProps = textBlockWidthParam ? {
|
|
4474
|
-
role: "none",
|
|
4475
|
-
className: tx("toolbar.inner", "toolbar", {
|
|
4476
|
-
layoutManaged
|
|
4477
|
-
}, classNames)
|
|
4478
|
-
} : {};
|
|
4479
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Root, {
|
|
4480
|
-
...props,
|
|
4481
|
-
"data-arrow-keys": props.orientation === "vertical" ? "up down" : "left right",
|
|
4482
|
-
className: tx("toolbar.root", "toolbar", {
|
|
4483
|
-
layoutManaged,
|
|
4484
|
-
disabled
|
|
4485
|
-
}, classNames),
|
|
4486
|
-
ref: forwardedRef
|
|
4487
|
-
}, /* @__PURE__ */ React37.createElement(InnerRoot, innerRootProps, children));
|
|
4488
|
-
} finally {
|
|
4489
|
-
_effect.f();
|
|
4490
|
-
}
|
|
4491
|
-
});
|
|
4492
|
-
var ToolbarButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4493
|
-
var _effect = _useSignals37();
|
|
4494
|
-
try {
|
|
4495
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4496
|
-
asChild: true
|
|
4497
|
-
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
4498
|
-
...props,
|
|
4499
|
-
ref: forwardedRef
|
|
4500
|
-
}));
|
|
4501
|
-
} finally {
|
|
4502
|
-
_effect.f();
|
|
4503
|
-
}
|
|
4504
|
-
});
|
|
4505
|
-
var ToolbarIconButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4506
|
-
var _effect = _useSignals37();
|
|
4507
|
-
try {
|
|
4508
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4509
|
-
asChild: true
|
|
4510
|
-
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
4511
|
-
...props,
|
|
4512
|
-
ref: forwardedRef
|
|
4513
|
-
}));
|
|
4514
|
-
} finally {
|
|
4515
|
-
_effect.f();
|
|
4516
|
-
}
|
|
4517
|
-
});
|
|
4518
|
-
var ToolbarToggle = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4519
|
-
var _effect = _useSignals37();
|
|
4520
|
-
try {
|
|
4521
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
4522
|
-
asChild: true
|
|
4523
|
-
}, /* @__PURE__ */ React37.createElement(Toggle, {
|
|
4524
|
-
...props,
|
|
4525
|
-
ref: forwardedRef
|
|
4526
|
-
}));
|
|
4527
|
-
} finally {
|
|
4528
|
-
_effect.f();
|
|
4529
|
-
}
|
|
4530
|
-
});
|
|
4531
|
-
var ToolbarLink = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
4532
|
-
var _effect = _useSignals37();
|
|
4533
|
-
try {
|
|
4534
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Link, {
|
|
4535
|
-
asChild: true
|
|
4536
|
-
}, /* @__PURE__ */ React37.createElement(Link, {
|
|
4537
|
-
...props,
|
|
4538
|
-
ref: forwardedRef
|
|
4539
|
-
}));
|
|
4540
|
-
} finally {
|
|
4541
|
-
_effect.f();
|
|
4542
|
-
}
|
|
4543
|
-
});
|
|
4544
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef29(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
4545
|
-
var _effect = _useSignals37();
|
|
4546
|
-
try {
|
|
4547
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
4548
|
-
...props,
|
|
4549
|
-
asChild: true
|
|
4550
|
-
}, /* @__PURE__ */ React37.createElement(ButtonGroup, {
|
|
4551
|
-
classNames,
|
|
4552
|
-
children,
|
|
4553
|
-
elevation,
|
|
4554
|
-
ref: forwardedRef
|
|
4555
|
-
}));
|
|
4556
|
-
} finally {
|
|
4557
|
-
_effect.f();
|
|
4558
|
-
}
|
|
4559
|
-
});
|
|
4560
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
4561
|
-
var _effect = _useSignals37();
|
|
4562
|
-
try {
|
|
4563
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4564
|
-
...props,
|
|
4565
|
-
asChild: true
|
|
4566
|
-
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
4567
|
-
variant,
|
|
4568
|
-
density,
|
|
4569
|
-
elevation,
|
|
4570
|
-
classNames,
|
|
4571
|
-
children,
|
|
4572
|
-
ref: forwardedRef
|
|
4573
|
-
}));
|
|
4574
|
-
} finally {
|
|
4575
|
-
_effect.f();
|
|
4576
|
-
}
|
|
4577
|
-
});
|
|
4578
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
4579
|
-
var _effect = _useSignals37();
|
|
4580
|
-
try {
|
|
4581
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
4582
|
-
...props,
|
|
4583
|
-
asChild: true
|
|
4584
|
-
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
4585
|
-
variant,
|
|
4586
|
-
density,
|
|
4587
|
-
elevation,
|
|
4588
|
-
classNames,
|
|
4589
|
-
icon,
|
|
4590
|
-
label,
|
|
4591
|
-
iconOnly,
|
|
4592
|
-
ref: forwardedRef
|
|
4593
|
-
}));
|
|
4594
|
-
} finally {
|
|
4595
|
-
_effect.f();
|
|
4596
|
-
}
|
|
4597
|
-
});
|
|
4598
|
-
var ToolbarSeparator = /* @__PURE__ */ forwardRef29(({ variant = "line", ...props }, forwardedRef) => {
|
|
4599
|
-
var _effect = _useSignals37();
|
|
4600
|
-
try {
|
|
4601
|
-
return variant === "line" ? /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
4602
|
-
asChild: true
|
|
4603
|
-
}, /* @__PURE__ */ React37.createElement(Separator4, {
|
|
4604
|
-
...props,
|
|
4605
|
-
ref: forwardedRef
|
|
4606
|
-
})) : /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
4607
|
-
className: "grow",
|
|
4608
|
-
ref: forwardedRef
|
|
4609
|
-
});
|
|
4610
|
-
} finally {
|
|
4611
|
-
_effect.f();
|
|
4612
|
-
}
|
|
4613
|
-
});
|
|
4614
|
-
var Toolbar = {
|
|
4615
|
-
Root: ToolbarRoot,
|
|
4616
|
-
Button: ToolbarButton,
|
|
4617
|
-
IconButton: ToolbarIconButton,
|
|
4618
|
-
Link: ToolbarLink,
|
|
4619
|
-
Toggle: ToolbarToggle,
|
|
4620
|
-
ToggleGroup: ToolbarToggleGroup2,
|
|
4621
|
-
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
4622
|
-
ToggleGroupIconItem: ToolbarToggleGroupIconItem,
|
|
4623
|
-
Separator: ToolbarSeparator
|
|
4624
|
-
};
|
|
4625
|
-
|
|
4626
|
-
// src/hooks/useDensityContext.ts
|
|
4627
|
-
var useDensityContext = (propsDensity) => {
|
|
4628
|
-
const { density } = useContext6(DensityContext);
|
|
4629
|
-
return propsDensity ?? density;
|
|
4630
|
-
};
|
|
4631
|
-
|
|
4632
|
-
export {
|
|
4633
|
-
useDensityContext,
|
|
4634
|
-
useElevationContext,
|
|
4635
|
-
useThemeContext,
|
|
4636
|
-
useIconHref,
|
|
4637
|
-
initialSafeArea,
|
|
4638
|
-
useSafeArea,
|
|
4639
|
-
isLabel,
|
|
4640
|
-
toLocalizedString,
|
|
4641
|
-
useTranslation,
|
|
4642
|
-
useTranslationsContext,
|
|
4643
|
-
useVisualViewport,
|
|
4644
|
-
AnchoredOverflow,
|
|
4645
|
-
useAvatarContext,
|
|
4646
|
-
Avatar,
|
|
4647
|
-
Icon,
|
|
4648
|
-
Link,
|
|
4649
|
-
Breadcrumb,
|
|
4650
|
-
BUTTON_GROUP_NAME,
|
|
4651
|
-
useButtonGroupContext,
|
|
4652
|
-
Button,
|
|
4653
|
-
ButtonGroup,
|
|
4654
|
-
createTooltipScope,
|
|
4655
|
-
useTooltipContext,
|
|
4656
|
-
Tooltip,
|
|
4657
|
-
IconButton,
|
|
4658
|
-
Toggle,
|
|
4659
|
-
ToggleGroup,
|
|
4660
|
-
ToggleGroupItem,
|
|
4661
|
-
ToggleGroupIconItem,
|
|
4662
|
-
useClipboard,
|
|
4663
|
-
Domino,
|
|
4664
|
-
hasIosKeyboard,
|
|
4665
|
-
usePx,
|
|
4666
|
-
DensityContext,
|
|
4667
|
-
DensityProvider,
|
|
4668
|
-
ElevationContext,
|
|
4669
|
-
ElevationProvider,
|
|
4670
|
-
ThemeContext,
|
|
4671
|
-
ThemeProvider,
|
|
4672
|
-
Clipboard,
|
|
4673
|
-
Dialog,
|
|
4674
|
-
AlertDialog,
|
|
4675
|
-
Input,
|
|
4676
|
-
LIST_ITEM_NAME,
|
|
4677
|
-
LIST_NAME,
|
|
4678
|
-
useListContext,
|
|
4679
|
-
useListItemContext,
|
|
4680
|
-
List,
|
|
4681
|
-
ListItem,
|
|
4682
|
-
Tree,
|
|
4683
|
-
TreeItem,
|
|
4684
|
-
Treegrid,
|
|
4685
|
-
useLandmarkMover,
|
|
4686
|
-
useMainContext,
|
|
4687
|
-
useSidebars,
|
|
4688
|
-
Main,
|
|
4689
|
-
ContextMenu2 as ContextMenu,
|
|
4690
|
-
createDropdownMenuScope,
|
|
4691
|
-
useDropdownMenuContext,
|
|
4692
|
-
DropdownMenu,
|
|
4693
|
-
useDropdownMenuMenuScope,
|
|
4694
|
-
messageIcons,
|
|
4695
|
-
Message,
|
|
4696
|
-
Callout,
|
|
4697
|
-
createPopoverScope,
|
|
4698
|
-
Popover,
|
|
4699
|
-
Status,
|
|
4700
|
-
ScrollArea,
|
|
4701
|
-
useScrollContainerContext,
|
|
4702
|
-
ScrollContainer,
|
|
4703
|
-
Select,
|
|
4704
|
-
Separator4 as Separator,
|
|
4705
|
-
Tag,
|
|
4706
|
-
Toast,
|
|
4707
|
-
Toolbar
|
|
4708
|
-
};
|
|
4709
|
-
//# sourceMappingURL=chunk-SP7VQH72.mjs.map
|