@dxos/react-ui 0.8.1-staging.391c573 → 0.8.1-staging.9eaf14f
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/index.mjs +425 -612
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +115 -301
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +425 -612
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +8 -29
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +5 -11
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +1 -5
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/index.d.ts +0 -1
- package/dist/types/src/components/Avatars/index.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useIconHref.d.ts +2 -0
- package/dist/types/src/hooks/useIconHref.d.ts.map +1 -0
- package/package.json +14 -12
- package/src/components/Avatars/Avatar.stories.tsx +7 -8
- package/src/components/Avatars/Avatar.tsx +30 -229
- package/src/components/Avatars/AvatarGroup.stories.tsx +12 -19
- package/src/components/Avatars/index.ts +0 -1
- package/src/components/Icon/Icon.tsx +4 -6
- package/src/components/Input/Input.tsx +2 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useIconHref.ts +13 -0
- package/dist/types/src/components/Avatars/AvatarGroup.d.ts +0 -21
- package/dist/types/src/components/Avatars/AvatarGroup.d.ts.map +0 -1
- package/src/components/Avatars/AvatarGroup.tsx +0 -112
|
@@ -22,6 +22,19 @@ var useElevationContext = (propsElevation) => {
|
|
|
22
22
|
return propsElevation ?? elevation;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
// packages/ui/react-ui/src/hooks/useThemeContext.ts
|
|
26
|
+
import { useContext as useContext3 } from "react";
|
|
27
|
+
import { raise } from "@dxos/debug";
|
|
28
|
+
var useThemeContext = () => useContext3(ThemeContext) ?? raise(new Error("Missing ThemeContext"));
|
|
29
|
+
|
|
30
|
+
// packages/ui/react-ui/src/hooks/useIconHref.ts
|
|
31
|
+
var ICONS_URL = "/icons.svg";
|
|
32
|
+
var useIconHref = (icon) => {
|
|
33
|
+
const { noCache } = useThemeContext();
|
|
34
|
+
const url = noCache ? `${ICONS_URL}?nocache=${(/* @__PURE__ */ new Date()).getMinutes()}` : ICONS_URL;
|
|
35
|
+
return icon ? `${url}#${icon}` : void 0;
|
|
36
|
+
};
|
|
37
|
+
|
|
25
38
|
// packages/ui/react-ui/src/hooks/useSafeArea.ts
|
|
26
39
|
import { useCallback, useState } from "react";
|
|
27
40
|
import { useResize } from "@dxos/react-hooks";
|
|
@@ -46,12 +59,12 @@ var useSafeArea = () => {
|
|
|
46
59
|
};
|
|
47
60
|
|
|
48
61
|
// packages/ui/react-ui/src/hooks/useTranslationsContext.ts
|
|
49
|
-
import { useContext as
|
|
62
|
+
import { useContext as useContext5 } from "react";
|
|
50
63
|
|
|
51
64
|
// packages/ui/react-ui/src/components/ThemeProvider/TranslationsProvider.tsx
|
|
52
65
|
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
53
66
|
import i18Next from "i18next";
|
|
54
|
-
import React, { useEffect, createContext, useState as useState2, Suspense, useContext as
|
|
67
|
+
import React, { useEffect, createContext, useState as useState2, Suspense, useContext as useContext4 } from "react";
|
|
55
68
|
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
56
69
|
var initialLng = "en-US";
|
|
57
70
|
var initialNs = "dxos-common";
|
|
@@ -79,7 +92,7 @@ var TranslationsContext = /* @__PURE__ */ createContext({
|
|
|
79
92
|
});
|
|
80
93
|
var useTranslation = (...args) => {
|
|
81
94
|
const result = useI18NextTranslation(...args);
|
|
82
|
-
const { dtLocale } =
|
|
95
|
+
const { dtLocale } = useContext4(TranslationsContext);
|
|
83
96
|
return {
|
|
84
97
|
...result,
|
|
85
98
|
dtLocale
|
|
@@ -113,12 +126,7 @@ var TranslationsProvider = ({ fallback, resourceExtensions, children, appNs, dtL
|
|
|
113
126
|
};
|
|
114
127
|
|
|
115
128
|
// packages/ui/react-ui/src/hooks/useTranslationsContext.ts
|
|
116
|
-
var useTranslationsContext = () =>
|
|
117
|
-
|
|
118
|
-
// packages/ui/react-ui/src/hooks/useThemeContext.ts
|
|
119
|
-
import { useContext as useContext5 } from "react";
|
|
120
|
-
import { raise } from "@dxos/debug";
|
|
121
|
-
var useThemeContext = () => useContext5(ThemeContext) ?? raise(new Error("Missing ThemeContext"));
|
|
129
|
+
var useTranslationsContext = () => useContext5(TranslationsContext);
|
|
122
130
|
|
|
123
131
|
// packages/ui/react-ui/src/hooks/useVisualViewport.ts
|
|
124
132
|
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
@@ -166,122 +174,46 @@ var AnchoredOverflow = {
|
|
|
166
174
|
};
|
|
167
175
|
|
|
168
176
|
// packages/ui/react-ui/src/components/Avatars/Avatar.tsx
|
|
169
|
-
import
|
|
177
|
+
import "@dxos/lit-ui/dx-avatar.pcss";
|
|
178
|
+
import { createComponent } from "@lit/react";
|
|
170
179
|
import { createContext as createContext2 } from "@radix-ui/react-context";
|
|
171
180
|
import { Primitive as Primitive2 } from "@radix-ui/react-primitive";
|
|
172
181
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
173
|
-
import
|
|
182
|
+
import React3, { forwardRef as forwardRef2 } from "react";
|
|
183
|
+
import { DxAvatar as NaturalDxAvatar } from "@dxos/lit-ui";
|
|
174
184
|
import { useId } from "@dxos/react-hooks";
|
|
175
|
-
|
|
176
|
-
// packages/ui/react-ui/src/components/Icon/Icon.tsx
|
|
177
|
-
import React3, { forwardRef as forwardRef2, memo } from "react";
|
|
178
|
-
var ICONS_URL = "/icons.svg";
|
|
179
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
180
|
-
const { tx, noCache } = useThemeContext();
|
|
181
|
-
const url = noCache ? `${ICONS_URL}?nocache=${(/* @__PURE__ */ new Date()).getMinutes()}` : ICONS_URL;
|
|
182
|
-
return /* @__PURE__ */ React3.createElement("svg", {
|
|
183
|
-
...props,
|
|
184
|
-
className: tx("icon.root", "icon", {
|
|
185
|
-
size
|
|
186
|
-
}, classNames),
|
|
187
|
-
ref: forwardedRef
|
|
188
|
-
}, /* @__PURE__ */ React3.createElement("use", {
|
|
189
|
-
href: `${url}#${icon}`
|
|
190
|
-
}));
|
|
191
|
-
}));
|
|
192
|
-
|
|
193
|
-
// packages/ui/react-ui/src/components/Avatars/Avatar.tsx
|
|
185
|
+
import { mx } from "@dxos/react-ui-theme";
|
|
194
186
|
var AVATAR_NAME = "Avatar";
|
|
195
187
|
var [AvatarProvider, useAvatarContext] = createContext2(AVATAR_NAME);
|
|
196
|
-
var AvatarRoot = ({
|
|
188
|
+
var AvatarRoot = ({ children, labelId: propsLabelId, descriptionId: propsDescriptionId }) => {
|
|
197
189
|
const labelId = useId("avatar__label", propsLabelId);
|
|
198
190
|
const descriptionId = useId("avatar__description", propsDescriptionId);
|
|
199
|
-
|
|
200
|
-
return /* @__PURE__ */ React4.createElement(AvatarProvider, {
|
|
191
|
+
return /* @__PURE__ */ React3.createElement(AvatarProvider, {
|
|
201
192
|
labelId,
|
|
202
|
-
descriptionId
|
|
203
|
-
maskId,
|
|
204
|
-
size,
|
|
205
|
-
variant,
|
|
206
|
-
status,
|
|
207
|
-
animation,
|
|
208
|
-
inGroup,
|
|
209
|
-
hue
|
|
193
|
+
descriptionId
|
|
210
194
|
}, children);
|
|
211
195
|
};
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const numericSize = size === "px" ? 1 : Number(size);
|
|
217
|
-
const sizePx = numericSize * 4;
|
|
218
|
-
const ringWidth = status ? numericSize > 4 ? 2 : numericSize > 3 ? 1 : 1 : 0;
|
|
219
|
-
const ringGap = status ? numericSize > 12 ? 3 : numericSize > 4 ? 2 : numericSize > 3 ? 1 : 0 : 0;
|
|
220
|
-
const r = sizePx / 2 - ringGap - ringWidth;
|
|
221
|
-
return /* @__PURE__ */ React4.createElement(AvatarRootPrimitive, {
|
|
222
|
-
role: "img",
|
|
223
|
-
...props,
|
|
224
|
-
className: tx("avatar.root", "avatar", {
|
|
225
|
-
size,
|
|
226
|
-
variant,
|
|
227
|
-
inGroup
|
|
228
|
-
}, classNames),
|
|
229
|
-
ref: forwardedRef,
|
|
230
|
-
...!inGroup && {
|
|
231
|
-
"aria-labelledby": labelId,
|
|
232
|
-
"aria-describedby": descriptionId
|
|
233
|
-
}
|
|
234
|
-
}, /* @__PURE__ */ React4.createElement("svg", {
|
|
235
|
-
viewBox: `0 0 ${sizePx} ${sizePx}`,
|
|
236
|
-
width: sizePx,
|
|
237
|
-
height: sizePx,
|
|
238
|
-
className: tx("avatar.frame", "avatar__frame", {
|
|
239
|
-
variant
|
|
240
|
-
})
|
|
241
|
-
}, /* @__PURE__ */ React4.createElement("defs", null, /* @__PURE__ */ React4.createElement("mask", {
|
|
242
|
-
id: maskId
|
|
243
|
-
}, variant === "circle" ? /* @__PURE__ */ React4.createElement("circle", {
|
|
244
|
-
fill: "white",
|
|
245
|
-
cx: "50%",
|
|
246
|
-
cy: "50%",
|
|
247
|
-
r
|
|
248
|
-
}) : /* @__PURE__ */ React4.createElement("rect", {
|
|
249
|
-
fill: "white",
|
|
250
|
-
width: 2 * r,
|
|
251
|
-
height: 2 * r,
|
|
252
|
-
x: ringGap + ringWidth,
|
|
253
|
-
y: ringGap + ringWidth,
|
|
254
|
-
rx
|
|
255
|
-
}))), variant === "circle" ? /* @__PURE__ */ React4.createElement("circle", {
|
|
256
|
-
cx: "50%",
|
|
257
|
-
cy: "50%",
|
|
258
|
-
r,
|
|
259
|
-
fill: hue ? `var(--dx-${hue}Fill)` : "var(--surface-bg)"
|
|
260
|
-
}) : /* @__PURE__ */ React4.createElement("rect", {
|
|
261
|
-
fill: hue ? `var(--dx-${hue}Fill)` : "var(--surface-bg)",
|
|
262
|
-
x: ringGap + ringWidth,
|
|
263
|
-
y: ringGap + ringWidth,
|
|
264
|
-
width: 2 * r,
|
|
265
|
-
height: 2 * r,
|
|
266
|
-
rx
|
|
267
|
-
}), children), /* @__PURE__ */ React4.createElement("span", {
|
|
268
|
-
role: "none",
|
|
269
|
-
className: tx("avatar.ring", "avatar__ring", {
|
|
270
|
-
size,
|
|
271
|
-
variant,
|
|
272
|
-
status,
|
|
273
|
-
animation
|
|
274
|
-
}),
|
|
275
|
-
style: {
|
|
276
|
-
borderWidth: ringWidth + "px"
|
|
277
|
-
}
|
|
278
|
-
}));
|
|
196
|
+
var DxAvatar = createComponent({
|
|
197
|
+
tagName: "dx-avatar",
|
|
198
|
+
elementClass: NaturalDxAvatar,
|
|
199
|
+
react: React3
|
|
279
200
|
});
|
|
280
|
-
var
|
|
201
|
+
var AvatarContent = ({ icon, classNames, ...props }) => {
|
|
202
|
+
const href = useIconHref(icon);
|
|
203
|
+
const { labelId, descriptionId } = useAvatarContext("AvatarContent");
|
|
204
|
+
return /* @__PURE__ */ React3.createElement(DxAvatar, {
|
|
205
|
+
...props,
|
|
206
|
+
icon: href,
|
|
207
|
+
labelId,
|
|
208
|
+
"aria-describedby": descriptionId,
|
|
209
|
+
rootClassName: mx(classNames)
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
var AvatarLabel = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
281
213
|
const Root5 = asChild ? Slot2 : Primitive2.span;
|
|
282
214
|
const { tx } = useThemeContext();
|
|
283
215
|
const { labelId } = useAvatarContext("AvatarLabel");
|
|
284
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ React3.createElement(Root5, {
|
|
285
217
|
...props,
|
|
286
218
|
id: labelId,
|
|
287
219
|
ref: forwardedRef,
|
|
@@ -290,11 +222,11 @@ var AvatarLabel = /* @__PURE__ */ forwardRef3(({ asChild, srOnly, classNames, ..
|
|
|
290
222
|
}, classNames)
|
|
291
223
|
});
|
|
292
224
|
});
|
|
293
|
-
var AvatarDescription = /* @__PURE__ */
|
|
225
|
+
var AvatarDescription = /* @__PURE__ */ forwardRef2(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
294
226
|
const Root5 = asChild ? Slot2 : Primitive2.span;
|
|
295
227
|
const { tx } = useThemeContext();
|
|
296
228
|
const { descriptionId } = useAvatarContext("AvatarDescription");
|
|
297
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ React3.createElement(Root5, {
|
|
298
230
|
...props,
|
|
299
231
|
id: descriptionId,
|
|
300
232
|
ref: forwardedRef,
|
|
@@ -303,162 +235,27 @@ var AvatarDescription = /* @__PURE__ */ forwardRef3(({ asChild, srOnly, classNam
|
|
|
303
235
|
}, classNames)
|
|
304
236
|
});
|
|
305
237
|
});
|
|
306
|
-
var AvatarMaskedImage = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
307
|
-
const { maskId } = useAvatarContext("AvatarFallback");
|
|
308
|
-
return /* @__PURE__ */ React4.createElement("image", {
|
|
309
|
-
width: "100%",
|
|
310
|
-
height: "100%",
|
|
311
|
-
...props,
|
|
312
|
-
mask: `url(#${maskId})`,
|
|
313
|
-
ref: forwardedRef,
|
|
314
|
-
preserveAspectRatio: "xMidYMid slice"
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
var AvatarMaskedText = (props) => {
|
|
318
|
-
const { maskId, size } = useAvatarContext("AvatarFallback");
|
|
319
|
-
const { large } = props;
|
|
320
|
-
const fontScale = (large ? 4 : 3) * (1 / 1.612);
|
|
321
|
-
const { tx } = useThemeContext();
|
|
322
|
-
return /* @__PURE__ */ React4.createElement("text", {
|
|
323
|
-
x: "50%",
|
|
324
|
-
y: "50%",
|
|
325
|
-
className: tx("avatar.fallbackText", "avatar__fallback-text"),
|
|
326
|
-
textAnchor: "middle",
|
|
327
|
-
alignmentBaseline: "central",
|
|
328
|
-
fontSize: size === "px" ? "200%" : size * fontScale,
|
|
329
|
-
mask: `url(#${maskId})`
|
|
330
|
-
}, props.children);
|
|
331
|
-
};
|
|
332
|
-
var AvatarImage = /* @__PURE__ */ forwardRef3(({ onLoadingStatusChange, ...props }, forwardedRef) => {
|
|
333
|
-
const { size } = useAvatarContext("AvatarImage");
|
|
334
|
-
const pxSize = size === "px" ? 1 : size * 4;
|
|
335
|
-
if (pxSize <= 20) {
|
|
336
|
-
return null;
|
|
337
|
-
}
|
|
338
|
-
return /* @__PURE__ */ React4.createElement(AvatarFallbackPrimitive, {
|
|
339
|
-
asChild: true
|
|
340
|
-
}, /* @__PURE__ */ React4.createElement(AvatarMaskedImage, {
|
|
341
|
-
...props,
|
|
342
|
-
ref: forwardedRef
|
|
343
|
-
}));
|
|
344
|
-
});
|
|
345
|
-
var AvatarIcon = /* @__PURE__ */ forwardRef3(({ onLoadingStatusChange, ...props }, forwardedRef) => {
|
|
346
|
-
const { size } = useAvatarContext("AvatarIcon");
|
|
347
|
-
const pxSize = size === "px" ? 1 : size * 4;
|
|
348
|
-
if (pxSize <= 20) {
|
|
349
|
-
return null;
|
|
350
|
-
}
|
|
351
|
-
return /* @__PURE__ */ React4.createElement(AvatarFallbackPrimitive, {
|
|
352
|
-
asChild: true
|
|
353
|
-
}, /* @__PURE__ */ React4.createElement(Icon, {
|
|
354
|
-
...props,
|
|
355
|
-
ref: forwardedRef
|
|
356
|
-
}));
|
|
357
|
-
});
|
|
358
|
-
var AvatarFallback = /* @__PURE__ */ forwardRef3(({ delayMs, text, ...props }, forwardedRef) => {
|
|
359
|
-
const isTextOnly = Boolean(text && /[0-9a-zA-Z]+/.test(text));
|
|
360
|
-
const { size } = useAvatarContext("AvatarFallback");
|
|
361
|
-
const numericSize = size === "px" ? 1 : Number(size);
|
|
362
|
-
return /* @__PURE__ */ React4.createElement(AvatarFallbackPrimitive, {
|
|
363
|
-
delayMs,
|
|
364
|
-
asChild: true
|
|
365
|
-
}, /* @__PURE__ */ React4.createElement(React4.Fragment, null, numericSize >= 6 && /* @__PURE__ */ React4.createElement(AvatarMaskedImage, {
|
|
366
|
-
...props,
|
|
367
|
-
ref: forwardedRef
|
|
368
|
-
}), text && /* @__PURE__ */ React4.createElement(AvatarMaskedText, {
|
|
369
|
-
large: !isTextOnly
|
|
370
|
-
}, text.toLocaleUpperCase())));
|
|
371
|
-
});
|
|
372
238
|
var Avatar = {
|
|
373
239
|
Root: AvatarRoot,
|
|
374
|
-
|
|
375
|
-
Image: AvatarImage,
|
|
376
|
-
Icon: AvatarIcon,
|
|
377
|
-
Fallback: AvatarFallback,
|
|
240
|
+
Content: AvatarContent,
|
|
378
241
|
Label: AvatarLabel,
|
|
379
242
|
Description: AvatarDescription
|
|
380
243
|
};
|
|
381
244
|
|
|
382
|
-
// packages/ui/react-ui/src/components/Avatars/AvatarGroup.tsx
|
|
383
|
-
import React5, { forwardRef as forwardRef4 } from "react";
|
|
384
|
-
import { useId as useId2 } from "@dxos/react-hooks";
|
|
385
|
-
var AvatarGroupRoot = /* @__PURE__ */ forwardRef4(({ labelId: propsLabelId, descriptionId: propsDescriptionId, size, variant, children, classNames }, forwardedRef) => {
|
|
386
|
-
const { tx } = useThemeContext();
|
|
387
|
-
const labelId = useId2("avatar-group__label", propsLabelId);
|
|
388
|
-
const descriptionId = useId2("avatar-group__description", propsDescriptionId);
|
|
389
|
-
return /* @__PURE__ */ React5.createElement(Avatar.Root, {
|
|
390
|
-
labelId,
|
|
391
|
-
descriptionId,
|
|
392
|
-
size,
|
|
393
|
-
variant,
|
|
394
|
-
inGroup: true
|
|
395
|
-
}, /* @__PURE__ */ React5.createElement("div", {
|
|
396
|
-
role: "group",
|
|
397
|
-
className: tx("avatar.group", "avatar-group", {}, classNames),
|
|
398
|
-
"aria-labelledby": labelId,
|
|
399
|
-
"aria-describedby": descriptionId,
|
|
400
|
-
ref: forwardedRef
|
|
401
|
-
}, children));
|
|
402
|
-
});
|
|
403
|
-
var AvatarGroupItemRoot = ({ maskId, size, variant, status, children, ...rest }) => {
|
|
404
|
-
const { labelId, descriptionId, size: contextSize, variant: contextVariant } = useAvatarContext("AvatarGroupItemRoot");
|
|
405
|
-
return /* @__PURE__ */ React5.createElement(Avatar.Root, {
|
|
406
|
-
labelId,
|
|
407
|
-
descriptionId,
|
|
408
|
-
maskId,
|
|
409
|
-
status,
|
|
410
|
-
size: size ?? contextSize,
|
|
411
|
-
variant: variant ?? contextVariant,
|
|
412
|
-
inGroup: true,
|
|
413
|
-
...rest
|
|
414
|
-
}, children);
|
|
415
|
-
};
|
|
416
|
-
var AvatarGroupLabel = /* @__PURE__ */ forwardRef4(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
417
|
-
const { labelId, size } = useAvatarContext("AvatarGroupLabel");
|
|
418
|
-
const { tx } = useThemeContext();
|
|
419
|
-
return /* @__PURE__ */ React5.createElement("span", {
|
|
420
|
-
...props,
|
|
421
|
-
id: labelId,
|
|
422
|
-
className: tx("avatar.groupLabel", "avatar-group__label", {
|
|
423
|
-
srOnly,
|
|
424
|
-
size
|
|
425
|
-
}, classNames)
|
|
426
|
-
}, children);
|
|
427
|
-
});
|
|
428
|
-
var AvatarGroupDescription = /* @__PURE__ */ forwardRef4(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
429
|
-
const { descriptionId } = useAvatarContext("AvatarGroupDescription");
|
|
430
|
-
const { tx } = useThemeContext();
|
|
431
|
-
return /* @__PURE__ */ React5.createElement("span", {
|
|
432
|
-
...props,
|
|
433
|
-
id: descriptionId,
|
|
434
|
-
className: tx("avatar.groupDescription", "avatar-group__description", {
|
|
435
|
-
srOnly
|
|
436
|
-
}, classNames)
|
|
437
|
-
}, children);
|
|
438
|
-
});
|
|
439
|
-
var AvatarGroup = {
|
|
440
|
-
Root: AvatarGroupRoot,
|
|
441
|
-
Label: AvatarGroupLabel,
|
|
442
|
-
Description: AvatarGroupDescription
|
|
443
|
-
};
|
|
444
|
-
var AvatarGroupItem = {
|
|
445
|
-
Root: AvatarGroupItemRoot
|
|
446
|
-
};
|
|
447
|
-
|
|
448
245
|
// packages/ui/react-ui/src/components/Breadcrumb/Breadcrumb.tsx
|
|
449
246
|
import { Dot } from "@phosphor-icons/react";
|
|
450
247
|
import { Primitive as Primitive4 } from "@radix-ui/react-primitive";
|
|
451
248
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
452
|
-
import
|
|
249
|
+
import React5, { forwardRef as forwardRef4 } from "react";
|
|
453
250
|
|
|
454
251
|
// packages/ui/react-ui/src/components/Link/Link.tsx
|
|
455
252
|
import { Primitive as Primitive3 } from "@radix-ui/react-primitive";
|
|
456
253
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
457
|
-
import
|
|
458
|
-
var Link = /* @__PURE__ */
|
|
254
|
+
import React4, { forwardRef as forwardRef3 } from "react";
|
|
255
|
+
var Link = /* @__PURE__ */ forwardRef3(({ asChild, variant, classNames, ...props }, forwardedRef) => {
|
|
459
256
|
const { tx } = useThemeContext();
|
|
460
257
|
const Root5 = asChild ? Slot3 : Primitive3.a;
|
|
461
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ React4.createElement(Root5, {
|
|
462
259
|
...props,
|
|
463
260
|
className: tx("link.root", "link", {
|
|
464
261
|
variant
|
|
@@ -468,47 +265,47 @@ var Link = /* @__PURE__ */ forwardRef5(({ asChild, variant, classNames, ...props
|
|
|
468
265
|
});
|
|
469
266
|
|
|
470
267
|
// packages/ui/react-ui/src/components/Breadcrumb/Breadcrumb.tsx
|
|
471
|
-
var BreadcrumbRoot = /* @__PURE__ */
|
|
268
|
+
var BreadcrumbRoot = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
472
269
|
const { tx } = useThemeContext();
|
|
473
270
|
const Root5 = asChild ? Slot4 : Primitive4.div;
|
|
474
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ React5.createElement(Root5, {
|
|
475
272
|
role: "navigation",
|
|
476
273
|
...props,
|
|
477
274
|
className: tx("breadcrumb.root", "breadcrumb", {}, classNames),
|
|
478
275
|
ref: forwardedRef
|
|
479
276
|
});
|
|
480
277
|
});
|
|
481
|
-
var BreadcrumbList = /* @__PURE__ */
|
|
278
|
+
var BreadcrumbList = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
482
279
|
const { tx } = useThemeContext();
|
|
483
280
|
const Root5 = asChild ? Slot4 : Primitive4.ol;
|
|
484
|
-
return /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ React5.createElement(Root5, {
|
|
485
282
|
role: "list",
|
|
486
283
|
...props,
|
|
487
284
|
className: tx("breadcrumb.list", "breadcrumb__list", {}, classNames),
|
|
488
285
|
ref: forwardedRef
|
|
489
286
|
});
|
|
490
287
|
});
|
|
491
|
-
var BreadcrumbListItem = /* @__PURE__ */
|
|
288
|
+
var BreadcrumbListItem = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
492
289
|
const { tx } = useThemeContext();
|
|
493
290
|
const Root5 = asChild ? Slot4 : Primitive4.li;
|
|
494
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ React5.createElement(Root5, {
|
|
495
292
|
role: "listitem",
|
|
496
293
|
...props,
|
|
497
294
|
className: tx("breadcrumb.listItem", "breadcrumb__list__item", {}, classNames),
|
|
498
295
|
ref: forwardedRef
|
|
499
296
|
});
|
|
500
297
|
});
|
|
501
|
-
var BreadcrumbLink = /* @__PURE__ */
|
|
298
|
+
var BreadcrumbLink = /* @__PURE__ */ forwardRef4(({ asChild, ...props }, forwardedRef) => {
|
|
502
299
|
const Root5 = asChild ? Slot4 : Link;
|
|
503
|
-
return /* @__PURE__ */
|
|
300
|
+
return /* @__PURE__ */ React5.createElement(Root5, {
|
|
504
301
|
...props,
|
|
505
302
|
ref: forwardedRef
|
|
506
303
|
});
|
|
507
304
|
});
|
|
508
|
-
var BreadcrumbCurrent = /* @__PURE__ */
|
|
305
|
+
var BreadcrumbCurrent = /* @__PURE__ */ forwardRef4(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
509
306
|
const { tx } = useThemeContext();
|
|
510
307
|
const Root5 = asChild ? Slot4 : "h1";
|
|
511
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ React5.createElement(Root5, {
|
|
512
309
|
...props,
|
|
513
310
|
"aria-current": "page",
|
|
514
311
|
className: tx("breadcrumb.current", "breadcrumb__item__heading--current", {}, classNames),
|
|
@@ -517,12 +314,12 @@ var BreadcrumbCurrent = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...p
|
|
|
517
314
|
});
|
|
518
315
|
var BreadcrumbSeparator = ({ children, classNames, ...props }) => {
|
|
519
316
|
const { tx } = useThemeContext();
|
|
520
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ React5.createElement(Primitive4.span, {
|
|
521
318
|
role: "separator",
|
|
522
319
|
"aria-hidden": "true",
|
|
523
320
|
...props,
|
|
524
321
|
className: tx("breadcrumb.separator", "breadcrumb__separator", {}, classNames)
|
|
525
|
-
}, children ?? /* @__PURE__ */
|
|
322
|
+
}, children ?? /* @__PURE__ */ React5.createElement(Dot, {
|
|
526
323
|
weight: "bold"
|
|
527
324
|
}));
|
|
528
325
|
};
|
|
@@ -539,19 +336,19 @@ var Breadcrumb = {
|
|
|
539
336
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
540
337
|
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
541
338
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
542
|
-
import
|
|
339
|
+
import React6, { forwardRef as forwardRef5, memo } from "react";
|
|
543
340
|
var BUTTON_GROUP_NAME = "ButtonGroup";
|
|
544
341
|
var BUTTON_NAME = "Button";
|
|
545
342
|
var [ButtonGroupProvider, useButtonGroupContext] = createContext3(BUTTON_GROUP_NAME, {
|
|
546
343
|
inGroup: false
|
|
547
344
|
});
|
|
548
|
-
var Button = /* @__PURE__ */
|
|
345
|
+
var Button = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef5(({ classNames, children, density: propsDensity, elevation: propsElevation, variant = "default", asChild, ...props }, ref) => {
|
|
549
346
|
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
550
347
|
const { tx } = useThemeContext();
|
|
551
348
|
const elevation = useElevationContext(propsElevation);
|
|
552
349
|
const density = useDensityContext(propsDensity);
|
|
553
350
|
const Root5 = asChild ? Slot5 : Primitive5.button;
|
|
554
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ React6.createElement(Root5, {
|
|
555
352
|
ref,
|
|
556
353
|
...props,
|
|
557
354
|
"data-variant": variant,
|
|
@@ -570,29 +367,45 @@ var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef7(({ classNames, ch
|
|
|
570
367
|
}, children);
|
|
571
368
|
}));
|
|
572
369
|
Button.displayName = BUTTON_NAME;
|
|
573
|
-
var ButtonGroup = /* @__PURE__ */
|
|
370
|
+
var ButtonGroup = /* @__PURE__ */ forwardRef5(({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {
|
|
574
371
|
const { tx } = useThemeContext();
|
|
575
372
|
const elevation = useElevationContext(propsElevation);
|
|
576
373
|
const Root5 = asChild ? Slot5 : Primitive5.div;
|
|
577
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ React6.createElement(Root5, {
|
|
578
375
|
role: "none",
|
|
579
376
|
...props,
|
|
580
377
|
className: tx("button.group", "button-group", {
|
|
581
378
|
elevation
|
|
582
379
|
}, classNames),
|
|
583
380
|
ref: forwardedRef
|
|
584
|
-
}, /* @__PURE__ */
|
|
381
|
+
}, /* @__PURE__ */ React6.createElement(ButtonGroupProvider, {
|
|
585
382
|
inGroup: true
|
|
586
383
|
}, children));
|
|
587
384
|
});
|
|
588
385
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
589
386
|
|
|
590
387
|
// packages/ui/react-ui/src/components/Buttons/IconButton.tsx
|
|
591
|
-
import
|
|
388
|
+
import React9, { forwardRef as forwardRef8, useState as useState4 } from "react";
|
|
389
|
+
|
|
390
|
+
// packages/ui/react-ui/src/components/Icon/Icon.tsx
|
|
391
|
+
import React7, { forwardRef as forwardRef6, memo as memo2 } from "react";
|
|
392
|
+
var Icon = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef6(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
393
|
+
const { tx } = useThemeContext();
|
|
394
|
+
const href = useIconHref(icon);
|
|
395
|
+
return /* @__PURE__ */ React7.createElement("svg", {
|
|
396
|
+
...props,
|
|
397
|
+
className: tx("icon.root", "icon", {
|
|
398
|
+
size
|
|
399
|
+
}, classNames),
|
|
400
|
+
ref: forwardedRef
|
|
401
|
+
}, /* @__PURE__ */ React7.createElement("use", {
|
|
402
|
+
href
|
|
403
|
+
}));
|
|
404
|
+
}));
|
|
592
405
|
|
|
593
406
|
// packages/ui/react-ui/src/components/Tooltip/Tooltip.tsx
|
|
594
407
|
import { Provider as TooltipProviderPrimitive, Root as TooltipRootPrimitive, TooltipContent as TooltipContentPrimitive, TooltipTrigger as TooltipTriggerPrimitive, TooltipPortal as TooltipPortalPrimitive, TooltipArrow as TooltipArrowPrimitive } from "@radix-ui/react-tooltip";
|
|
595
|
-
import
|
|
408
|
+
import React8, { forwardRef as forwardRef7 } from "react";
|
|
596
409
|
|
|
597
410
|
// packages/ui/react-ui/src/hooks/useSafeCollisionPadding.ts
|
|
598
411
|
import { useMemo } from "react";
|
|
@@ -619,19 +432,19 @@ var TooltipProvider = TooltipProviderPrimitive;
|
|
|
619
432
|
var TooltipRoot = TooltipRootPrimitive;
|
|
620
433
|
var TooltipPortal = TooltipPortalPrimitive;
|
|
621
434
|
var TooltipTrigger = TooltipTriggerPrimitive;
|
|
622
|
-
var TooltipArrow = /* @__PURE__ */
|
|
435
|
+
var TooltipArrow = /* @__PURE__ */ forwardRef7(({ classNames, ...props }, forwardedRef) => {
|
|
623
436
|
const { tx } = useThemeContext();
|
|
624
|
-
return /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ React8.createElement(TooltipArrowPrimitive, {
|
|
625
438
|
...props,
|
|
626
439
|
className: tx("tooltip.arrow", "tooltip__arrow", {}, classNames),
|
|
627
440
|
ref: forwardedRef
|
|
628
441
|
});
|
|
629
442
|
});
|
|
630
|
-
var TooltipContent = /* @__PURE__ */
|
|
443
|
+
var TooltipContent = /* @__PURE__ */ forwardRef7(({ classNames, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
631
444
|
const { tx } = useThemeContext();
|
|
632
445
|
const elevation = useElevationContext();
|
|
633
446
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
634
|
-
return /* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ React8.createElement(TooltipContentPrimitive, {
|
|
635
448
|
sideOffset: 4,
|
|
636
449
|
...props,
|
|
637
450
|
collisionPadding: safeCollisionPadding,
|
|
@@ -651,23 +464,23 @@ var Tooltip = {
|
|
|
651
464
|
};
|
|
652
465
|
|
|
653
466
|
// packages/ui/react-ui/src/components/Buttons/IconButton.tsx
|
|
654
|
-
var IconOnlyButton = /* @__PURE__ */
|
|
467
|
+
var IconOnlyButton = /* @__PURE__ */ forwardRef8(({ noTooltip, tooltipPortal = true, tooltipZIndex: zIndex, tooltipSide, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
655
468
|
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState4(false);
|
|
656
469
|
if (noTooltip) {
|
|
657
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
658
471
|
...props,
|
|
659
472
|
ref: forwardedRef
|
|
660
473
|
});
|
|
661
474
|
}
|
|
662
|
-
const content = /* @__PURE__ */
|
|
475
|
+
const content = /* @__PURE__ */ React9.createElement(Tooltip.Content, {
|
|
663
476
|
...zIndex && {
|
|
664
477
|
style: {
|
|
665
478
|
zIndex
|
|
666
479
|
}
|
|
667
480
|
},
|
|
668
481
|
side: tooltipSide
|
|
669
|
-
}, props.label, /* @__PURE__ */
|
|
670
|
-
return /* @__PURE__ */
|
|
482
|
+
}, props.label, /* @__PURE__ */ React9.createElement(Tooltip.Arrow, null));
|
|
483
|
+
return /* @__PURE__ */ React9.createElement(Tooltip.Root, {
|
|
671
484
|
open: triggerTooltipOpen,
|
|
672
485
|
onOpenChange: (nextOpen) => {
|
|
673
486
|
if (suppressNextTooltip?.current) {
|
|
@@ -677,48 +490,48 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ noTooltip, tooltipPortal = t
|
|
|
677
490
|
setTriggerTooltipOpen(nextOpen);
|
|
678
491
|
}
|
|
679
492
|
}
|
|
680
|
-
}, /* @__PURE__ */
|
|
493
|
+
}, /* @__PURE__ */ React9.createElement(Tooltip.Trigger, {
|
|
681
494
|
asChild: true
|
|
682
|
-
}, /* @__PURE__ */
|
|
495
|
+
}, /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
683
496
|
...props,
|
|
684
497
|
ref: forwardedRef
|
|
685
|
-
})), tooltipPortal ? /* @__PURE__ */
|
|
498
|
+
})), tooltipPortal ? /* @__PURE__ */ React9.createElement(Tooltip.Portal, null, content) : content);
|
|
686
499
|
});
|
|
687
|
-
var LabelledIconButton = /* @__PURE__ */
|
|
500
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef8(({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
688
501
|
const { tx } = useThemeContext();
|
|
689
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ React9.createElement(Button, {
|
|
690
503
|
...props,
|
|
691
504
|
classNames: tx("iconButton.root", "iconButton", {}, classNames),
|
|
692
505
|
ref: forwardedRef
|
|
693
|
-
}, /* @__PURE__ */
|
|
506
|
+
}, /* @__PURE__ */ React9.createElement(Icon, {
|
|
694
507
|
icon,
|
|
695
508
|
size,
|
|
696
509
|
classNames: iconClassNames
|
|
697
|
-
}), /* @__PURE__ */
|
|
510
|
+
}), /* @__PURE__ */ React9.createElement("span", {
|
|
698
511
|
className: iconOnly ? "sr-only" : void 0
|
|
699
|
-
}, label), caretDown && /* @__PURE__ */
|
|
512
|
+
}, label), caretDown && /* @__PURE__ */ React9.createElement(Icon, {
|
|
700
513
|
size: 3,
|
|
701
514
|
icon: "ph--caret-down--bold"
|
|
702
515
|
}));
|
|
703
516
|
});
|
|
704
|
-
var IconButton = /* @__PURE__ */
|
|
517
|
+
var IconButton = /* @__PURE__ */ forwardRef8((props, forwardedRef) => props.iconOnly ? /* @__PURE__ */ React9.createElement(IconOnlyButton, {
|
|
705
518
|
...props,
|
|
706
519
|
ref: forwardedRef
|
|
707
|
-
}) : /* @__PURE__ */
|
|
520
|
+
}) : /* @__PURE__ */ React9.createElement(LabelledIconButton, {
|
|
708
521
|
...props,
|
|
709
522
|
ref: forwardedRef
|
|
710
523
|
}));
|
|
711
524
|
|
|
712
525
|
// packages/ui/react-ui/src/components/Buttons/Toggle.tsx
|
|
713
526
|
import { Toggle as TogglePrimitive } from "@radix-ui/react-toggle";
|
|
714
|
-
import
|
|
715
|
-
var Toggle = /* @__PURE__ */
|
|
716
|
-
return /* @__PURE__ */
|
|
527
|
+
import React10, { forwardRef as forwardRef9 } from "react";
|
|
528
|
+
var Toggle = /* @__PURE__ */ forwardRef9(({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {
|
|
529
|
+
return /* @__PURE__ */ React10.createElement(TogglePrimitive, {
|
|
717
530
|
defaultPressed,
|
|
718
531
|
pressed,
|
|
719
532
|
onPressedChange,
|
|
720
533
|
asChild: true
|
|
721
|
-
}, /* @__PURE__ */
|
|
534
|
+
}, /* @__PURE__ */ React10.createElement(Button, {
|
|
722
535
|
...props,
|
|
723
536
|
ref: forwardedRef
|
|
724
537
|
}));
|
|
@@ -726,22 +539,22 @@ var Toggle = /* @__PURE__ */ forwardRef10(({ defaultPressed, pressed, onPressedC
|
|
|
726
539
|
|
|
727
540
|
// packages/ui/react-ui/src/components/Buttons/ToggleGroup.tsx
|
|
728
541
|
import { ToggleGroup as ToggleGroupPrimitive, ToggleGroupItem as ToggleGroupItemPrimitive } from "@radix-ui/react-toggle-group";
|
|
729
|
-
import
|
|
730
|
-
var ToggleGroup = /* @__PURE__ */
|
|
731
|
-
return /* @__PURE__ */
|
|
542
|
+
import React11, { forwardRef as forwardRef10 } from "react";
|
|
543
|
+
var ToggleGroup = /* @__PURE__ */ forwardRef10(({ classNames, children, ...props }, forwardedRef) => {
|
|
544
|
+
return /* @__PURE__ */ React11.createElement(ToggleGroupPrimitive, {
|
|
732
545
|
...props,
|
|
733
546
|
asChild: true
|
|
734
|
-
}, /* @__PURE__ */
|
|
547
|
+
}, /* @__PURE__ */ React11.createElement(ButtonGroup, {
|
|
735
548
|
classNames,
|
|
736
549
|
children,
|
|
737
550
|
ref: forwardedRef
|
|
738
551
|
}));
|
|
739
552
|
});
|
|
740
|
-
var ToggleGroupItem = /* @__PURE__ */
|
|
741
|
-
return /* @__PURE__ */
|
|
553
|
+
var ToggleGroupItem = /* @__PURE__ */ forwardRef10(({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {
|
|
554
|
+
return /* @__PURE__ */ React11.createElement(ToggleGroupItemPrimitive, {
|
|
742
555
|
...props,
|
|
743
556
|
asChild: true
|
|
744
|
-
}, /* @__PURE__ */
|
|
557
|
+
}, /* @__PURE__ */ React11.createElement(Button, {
|
|
745
558
|
variant,
|
|
746
559
|
elevation,
|
|
747
560
|
density,
|
|
@@ -752,7 +565,7 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef11(({ variant, elevation, densit
|
|
|
752
565
|
});
|
|
753
566
|
|
|
754
567
|
// packages/ui/react-ui/src/components/Clipboard/ClipboardProvider.tsx
|
|
755
|
-
import
|
|
568
|
+
import React12, { createContext as createContext4, useCallback as useCallback3, useContext as useContext6, useState as useState5 } from "react";
|
|
756
569
|
var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
757
570
|
textValue: "",
|
|
758
571
|
setTextValue: async (_) => {
|
|
@@ -765,7 +578,7 @@ var ClipboardProvider = ({ children }) => {
|
|
|
765
578
|
await navigator.clipboard.writeText(nextValue);
|
|
766
579
|
return setInternalTextValue(nextValue);
|
|
767
580
|
}, []);
|
|
768
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ React12.createElement(ClipboardContext.Provider, {
|
|
769
582
|
value: {
|
|
770
583
|
textValue,
|
|
771
584
|
setTextValue
|
|
@@ -774,12 +587,12 @@ var ClipboardProvider = ({ children }) => {
|
|
|
774
587
|
};
|
|
775
588
|
|
|
776
589
|
// packages/ui/react-ui/src/components/Clipboard/CopyButton.tsx
|
|
777
|
-
import
|
|
778
|
-
import { mx } from "@dxos/react-ui-theme";
|
|
590
|
+
import React16, { useState as useState6 } from "react";
|
|
591
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
779
592
|
|
|
780
593
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
781
594
|
import { createKeyborg } from "keyborg";
|
|
782
|
-
import
|
|
595
|
+
import React15, { createContext as createContext7, useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
783
596
|
|
|
784
597
|
// packages/ui/react-ui/src/util/hasIosKeyboard.ts
|
|
785
598
|
var hasIosKeyboard = () => {
|
|
@@ -787,22 +600,22 @@ var hasIosKeyboard = () => {
|
|
|
787
600
|
};
|
|
788
601
|
|
|
789
602
|
// packages/ui/react-ui/src/components/DensityProvider/DensityProvider.tsx
|
|
790
|
-
import
|
|
603
|
+
import React13, { createContext as createContext5 } from "react";
|
|
791
604
|
var DensityContext = /* @__PURE__ */ createContext5({
|
|
792
605
|
density: "fine"
|
|
793
606
|
});
|
|
794
|
-
var DensityProvider = ({ density, children }) => /* @__PURE__ */
|
|
607
|
+
var DensityProvider = ({ density, children }) => /* @__PURE__ */ React13.createElement(DensityContext.Provider, {
|
|
795
608
|
value: {
|
|
796
609
|
density
|
|
797
610
|
}
|
|
798
611
|
}, children);
|
|
799
612
|
|
|
800
613
|
// packages/ui/react-ui/src/components/ElevationProvider/ElevationProvider.tsx
|
|
801
|
-
import
|
|
614
|
+
import React14, { createContext as createContext6 } from "react";
|
|
802
615
|
var ElevationContext = /* @__PURE__ */ createContext6({
|
|
803
616
|
elevation: "base"
|
|
804
617
|
});
|
|
805
|
-
var ElevationProvider = ({ elevation, children }) => /* @__PURE__ */
|
|
618
|
+
var ElevationProvider = ({ elevation, children }) => /* @__PURE__ */ React14.createElement(ElevationContext.Provider, {
|
|
806
619
|
value: {
|
|
807
620
|
elevation
|
|
808
621
|
}
|
|
@@ -831,15 +644,15 @@ var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx
|
|
|
831
644
|
safeAreaPadding,
|
|
832
645
|
rest
|
|
833
646
|
]);
|
|
834
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ React15.createElement(ThemeContext.Provider, {
|
|
835
648
|
value: contextValue
|
|
836
|
-
}, /* @__PURE__ */
|
|
649
|
+
}, /* @__PURE__ */ React15.createElement(TranslationsProvider, {
|
|
837
650
|
fallback,
|
|
838
651
|
resourceExtensions,
|
|
839
652
|
appNs
|
|
840
|
-
}, /* @__PURE__ */
|
|
653
|
+
}, /* @__PURE__ */ React15.createElement(ElevationProvider, {
|
|
841
654
|
elevation: "base"
|
|
842
|
-
}, /* @__PURE__ */
|
|
655
|
+
}, /* @__PURE__ */ React15.createElement(DensityProvider, {
|
|
843
656
|
density: rootDensity
|
|
844
657
|
}, children))));
|
|
845
658
|
};
|
|
@@ -857,7 +670,7 @@ var CopyButton = ({ value, classNames, iconProps, ...props }) => {
|
|
|
857
670
|
const { t } = useTranslation("os");
|
|
858
671
|
const { textValue, setTextValue } = useClipboard();
|
|
859
672
|
const isCopied = textValue === value;
|
|
860
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ React16.createElement(Button, {
|
|
861
674
|
...props,
|
|
862
675
|
classNames: [
|
|
863
676
|
"inline-flex flex-col justify-center",
|
|
@@ -865,21 +678,21 @@ var CopyButton = ({ value, classNames, iconProps, ...props }) => {
|
|
|
865
678
|
],
|
|
866
679
|
onClick: () => setTextValue(value),
|
|
867
680
|
"data-testid": "copy-invitation"
|
|
868
|
-
}, /* @__PURE__ */
|
|
681
|
+
}, /* @__PURE__ */ React16.createElement("div", {
|
|
869
682
|
role: "none",
|
|
870
|
-
className:
|
|
871
|
-
}, /* @__PURE__ */
|
|
683
|
+
className: mx2("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
684
|
+
}, /* @__PURE__ */ React16.createElement("span", {
|
|
872
685
|
className: "pli-1"
|
|
873
|
-
}, t("copy label")), /* @__PURE__ */
|
|
686
|
+
}, t("copy label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
874
687
|
icon: "ph--copy--regular",
|
|
875
688
|
size: 5,
|
|
876
689
|
...iconProps
|
|
877
|
-
})), /* @__PURE__ */
|
|
690
|
+
})), /* @__PURE__ */ React16.createElement("div", {
|
|
878
691
|
role: "none",
|
|
879
|
-
className:
|
|
880
|
-
}, /* @__PURE__ */
|
|
692
|
+
className: mx2("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
693
|
+
}, /* @__PURE__ */ React16.createElement("span", {
|
|
881
694
|
className: "pli-1"
|
|
882
|
-
}, t("copy success label")), /* @__PURE__ */
|
|
695
|
+
}, t("copy success label")), /* @__PURE__ */ React16.createElement(Icon, {
|
|
883
696
|
icon: "ph--check--regular",
|
|
884
697
|
size: 5,
|
|
885
698
|
...iconProps
|
|
@@ -891,26 +704,26 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
|
|
|
891
704
|
const isCopied = textValue === value;
|
|
892
705
|
const label = isCopied ? t("copy success label") : props.label ?? t("copy label");
|
|
893
706
|
const [open, setOpen] = useState6(false);
|
|
894
|
-
return /* @__PURE__ */
|
|
707
|
+
return /* @__PURE__ */ React16.createElement(Tooltip.Root, {
|
|
895
708
|
delayDuration: 1500,
|
|
896
709
|
open,
|
|
897
710
|
onOpenChange: setOpen
|
|
898
|
-
}, /* @__PURE__ */
|
|
711
|
+
}, /* @__PURE__ */ React16.createElement(Tooltip.Portal, null, /* @__PURE__ */ React16.createElement(Tooltip.Content, {
|
|
899
712
|
side: "bottom",
|
|
900
713
|
sideOffset: 12
|
|
901
|
-
}, /* @__PURE__ */
|
|
714
|
+
}, /* @__PURE__ */ React16.createElement("span", null, label), /* @__PURE__ */ React16.createElement(Tooltip.Arrow, null))), /* @__PURE__ */ React16.createElement(Tooltip.Trigger, {
|
|
902
715
|
"aria-label": label,
|
|
903
716
|
...props,
|
|
904
717
|
onClick: () => setTextValue(value).then(() => setOpen(true)),
|
|
905
718
|
"data-testid": "copy-invitation",
|
|
906
719
|
asChild: true
|
|
907
|
-
}, /* @__PURE__ */
|
|
720
|
+
}, /* @__PURE__ */ React16.createElement(Button, {
|
|
908
721
|
variant,
|
|
909
722
|
classNames: [
|
|
910
723
|
"inline-flex flex-col justify-center",
|
|
911
724
|
classNames
|
|
912
725
|
]
|
|
913
|
-
}, /* @__PURE__ */
|
|
726
|
+
}, /* @__PURE__ */ React16.createElement(Icon, {
|
|
914
727
|
icon: "ph--copy--regular",
|
|
915
728
|
size: 5,
|
|
916
729
|
...iconProps
|
|
@@ -927,15 +740,15 @@ var Clipboard = {
|
|
|
927
740
|
// packages/ui/react-ui/src/components/Dialogs/Dialog.tsx
|
|
928
741
|
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
929
742
|
import { Root as DialogRootPrimitive, DialogTrigger as DialogTriggerPrimitive, DialogPortal as DialogPortalPrimitive, DialogOverlay as DialogOverlayPrimitive, DialogTitle as DialogTitlePrimitive, DialogDescription as DialogDescriptionPrimitive, DialogClose as DialogClosePrimitive, DialogContent as DialogContentPrimitive } from "@radix-ui/react-dialog";
|
|
930
|
-
import
|
|
931
|
-
var DialogRoot = (props) => /* @__PURE__ */
|
|
743
|
+
import React17, { forwardRef as forwardRef11 } from "react";
|
|
744
|
+
var DialogRoot = (props) => /* @__PURE__ */ React17.createElement(ElevationProvider, {
|
|
932
745
|
elevation: "dialog"
|
|
933
|
-
}, /* @__PURE__ */
|
|
746
|
+
}, /* @__PURE__ */ React17.createElement(DialogRootPrimitive, props));
|
|
934
747
|
var DialogTrigger = DialogTriggerPrimitive;
|
|
935
748
|
var DialogPortal = DialogPortalPrimitive;
|
|
936
|
-
var DialogTitle = /* @__PURE__ */
|
|
749
|
+
var DialogTitle = /* @__PURE__ */ forwardRef11(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
937
750
|
const { tx } = useThemeContext();
|
|
938
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ React17.createElement(DialogTitlePrimitive, {
|
|
939
752
|
...props,
|
|
940
753
|
className: tx("dialog.title", "dialog__title", {
|
|
941
754
|
srOnly
|
|
@@ -943,9 +756,9 @@ var DialogTitle = /* @__PURE__ */ forwardRef12(({ classNames, srOnly, ...props }
|
|
|
943
756
|
ref: forwardedRef
|
|
944
757
|
});
|
|
945
758
|
});
|
|
946
|
-
var DialogDescription = /* @__PURE__ */
|
|
759
|
+
var DialogDescription = /* @__PURE__ */ forwardRef11(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
947
760
|
const { tx } = useThemeContext();
|
|
948
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ React17.createElement(DialogDescriptionPrimitive, {
|
|
949
762
|
...props,
|
|
950
763
|
className: tx("dialog.description", "dialog__description", {
|
|
951
764
|
srOnly
|
|
@@ -959,22 +772,22 @@ var DIALOG_CONTENT_NAME = "DialogContent";
|
|
|
959
772
|
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext8(DIALOG_OVERLAY_NAME, {
|
|
960
773
|
inOverlayLayout: false
|
|
961
774
|
});
|
|
962
|
-
var DialogOverlay = /* @__PURE__ */
|
|
775
|
+
var DialogOverlay = /* @__PURE__ */ forwardRef11(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
963
776
|
const { tx } = useThemeContext();
|
|
964
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ React17.createElement(DialogOverlayPrimitive, {
|
|
965
778
|
...props,
|
|
966
779
|
className: tx("dialog.overlay", "dialog__overlay", {}, classNames),
|
|
967
780
|
ref: forwardedRef,
|
|
968
781
|
"data-block-align": blockAlign
|
|
969
|
-
}, /* @__PURE__ */
|
|
782
|
+
}, /* @__PURE__ */ React17.createElement(OverlayLayoutProvider, {
|
|
970
783
|
inOverlayLayout: true
|
|
971
784
|
}, children));
|
|
972
785
|
});
|
|
973
786
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
974
|
-
var DialogContent = /* @__PURE__ */
|
|
787
|
+
var DialogContent = /* @__PURE__ */ forwardRef11(({ classNames, children, inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
975
788
|
const { tx } = useThemeContext();
|
|
976
789
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
977
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ React17.createElement(DialogContentPrimitive, {
|
|
978
791
|
...props,
|
|
979
792
|
className: tx("dialog.content", "dialog", {
|
|
980
793
|
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
@@ -997,17 +810,17 @@ var Dialog = {
|
|
|
997
810
|
// packages/ui/react-ui/src/components/Dialogs/AlertDialog.tsx
|
|
998
811
|
import { Root as AlertDialogRootPrimitive, AlertDialogTrigger as AlertDialogTriggerPrimitive, AlertDialogPortal as AlertDialogPortalPrimitive, AlertDialogOverlay as AlertDialogOverlayPrimitive, AlertDialogTitle as AlertDialogTitlePrimitive, AlertDialogDescription as AlertDialogDescriptionPrimitive, AlertDialogAction as AlertDialogActionPrimitive, AlertDialogCancel as AlertDialogCancelPrimitive, AlertDialogContent as AlertDialogContentPrimitive } from "@radix-ui/react-alert-dialog";
|
|
999
812
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
1000
|
-
import
|
|
1001
|
-
var AlertDialogRoot = (props) => /* @__PURE__ */
|
|
813
|
+
import React18, { forwardRef as forwardRef12 } from "react";
|
|
814
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React18.createElement(ElevationProvider, {
|
|
1002
815
|
elevation: "dialog"
|
|
1003
|
-
}, /* @__PURE__ */
|
|
816
|
+
}, /* @__PURE__ */ React18.createElement(AlertDialogRootPrimitive, props));
|
|
1004
817
|
var AlertDialogTrigger = AlertDialogTriggerPrimitive;
|
|
1005
818
|
var AlertDialogPortal = AlertDialogPortalPrimitive;
|
|
1006
819
|
var AlertDialogCancel = AlertDialogCancelPrimitive;
|
|
1007
820
|
var AlertDialogAction = AlertDialogActionPrimitive;
|
|
1008
|
-
var AlertDialogTitle = /* @__PURE__ */
|
|
821
|
+
var AlertDialogTitle = /* @__PURE__ */ forwardRef12(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1009
822
|
const { tx } = useThemeContext();
|
|
1010
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ React18.createElement(AlertDialogTitlePrimitive, {
|
|
1011
824
|
...props,
|
|
1012
825
|
className: tx("dialog.title", "dialog--alert__title", {
|
|
1013
826
|
srOnly
|
|
@@ -1015,9 +828,9 @@ var AlertDialogTitle = /* @__PURE__ */ forwardRef13(({ classNames, srOnly, ...pr
|
|
|
1015
828
|
ref: forwardedRef
|
|
1016
829
|
});
|
|
1017
830
|
});
|
|
1018
|
-
var AlertDialogDescription = /* @__PURE__ */
|
|
831
|
+
var AlertDialogDescription = /* @__PURE__ */ forwardRef12(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1019
832
|
const { tx } = useThemeContext();
|
|
1020
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ React18.createElement(AlertDialogDescriptionPrimitive, {
|
|
1021
834
|
...props,
|
|
1022
835
|
className: tx("dialog.description", "dialog--alert__description", {
|
|
1023
836
|
srOnly
|
|
@@ -1030,22 +843,22 @@ var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
|
1030
843
|
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext9(ALERT_DIALOG_OVERLAY_NAME, {
|
|
1031
844
|
inOverlayLayout: false
|
|
1032
845
|
});
|
|
1033
|
-
var AlertDialogOverlay = /* @__PURE__ */
|
|
846
|
+
var AlertDialogOverlay = /* @__PURE__ */ forwardRef12(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1034
847
|
const { tx } = useThemeContext();
|
|
1035
|
-
return /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ React18.createElement(AlertDialogOverlayPrimitive, {
|
|
1036
849
|
...props,
|
|
1037
850
|
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"),
|
|
1038
851
|
ref: forwardedRef,
|
|
1039
852
|
"data-block-align": blockAlign
|
|
1040
|
-
}, /* @__PURE__ */
|
|
853
|
+
}, /* @__PURE__ */ React18.createElement(OverlayLayoutProvider2, {
|
|
1041
854
|
inOverlayLayout: true
|
|
1042
855
|
}, children));
|
|
1043
856
|
});
|
|
1044
857
|
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
1045
|
-
var AlertDialogContent = /* @__PURE__ */
|
|
858
|
+
var AlertDialogContent = /* @__PURE__ */ forwardRef12(({ classNames, children, ...props }, forwardedRef) => {
|
|
1046
859
|
const { tx } = useThemeContext();
|
|
1047
860
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
1048
|
-
return /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ React18.createElement(AlertDialogContentPrimitive, {
|
|
1049
862
|
...props,
|
|
1050
863
|
className: tx("dialog.content", "dialog--alert", {
|
|
1051
864
|
inOverlayLayout
|
|
@@ -1070,15 +883,15 @@ var AlertDialog = {
|
|
|
1070
883
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
1071
884
|
import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
|
|
1072
885
|
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1073
|
-
import
|
|
886
|
+
import React19, { forwardRef as forwardRef13 } from "react";
|
|
1074
887
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
1075
888
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1076
889
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1077
|
-
var ContextMenuContent = /* @__PURE__ */
|
|
890
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef13(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
1078
891
|
const { tx } = useThemeContext();
|
|
1079
892
|
const elevation = useElevationContext();
|
|
1080
893
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1081
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Content, {
|
|
1082
895
|
...props,
|
|
1083
896
|
collisionPadding: safeCollisionPadding,
|
|
1084
897
|
className: tx("menu.content", "menu", {
|
|
@@ -1087,18 +900,18 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef14(({ classNames, children, c
|
|
|
1087
900
|
ref: forwardedRef
|
|
1088
901
|
}, children);
|
|
1089
902
|
});
|
|
1090
|
-
var ContextMenuViewport = /* @__PURE__ */
|
|
903
|
+
var ContextMenuViewport = /* @__PURE__ */ forwardRef13(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1091
904
|
const { tx } = useThemeContext();
|
|
1092
905
|
const Root5 = asChild ? Slot6 : Primitive6.div;
|
|
1093
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ React19.createElement(Root5, {
|
|
1094
907
|
...props,
|
|
1095
908
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
1096
909
|
ref: forwardedRef
|
|
1097
910
|
}, children);
|
|
1098
911
|
});
|
|
1099
|
-
var ContextMenuArrow = /* @__PURE__ */
|
|
912
|
+
var ContextMenuArrow = /* @__PURE__ */ forwardRef13(({ classNames, ...props }, forwardedRef) => {
|
|
1100
913
|
const { tx } = useThemeContext();
|
|
1101
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Arrow, {
|
|
1102
915
|
...props,
|
|
1103
916
|
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
1104
917
|
ref: forwardedRef
|
|
@@ -1106,33 +919,33 @@ var ContextMenuArrow = /* @__PURE__ */ forwardRef14(({ classNames, ...props }, f
|
|
|
1106
919
|
});
|
|
1107
920
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
1108
921
|
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
1109
|
-
var ContextMenuItem = /* @__PURE__ */
|
|
922
|
+
var ContextMenuItem = /* @__PURE__ */ forwardRef13(({ classNames, ...props }, forwardedRef) => {
|
|
1110
923
|
const { tx } = useThemeContext();
|
|
1111
|
-
return /* @__PURE__ */
|
|
924
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Item, {
|
|
1112
925
|
...props,
|
|
1113
926
|
className: tx("menu.item", "menu__item", {}, classNames),
|
|
1114
927
|
ref: forwardedRef
|
|
1115
928
|
});
|
|
1116
929
|
});
|
|
1117
|
-
var ContextMenuCheckboxItem = /* @__PURE__ */
|
|
930
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef13(({ classNames, ...props }, forwardedRef) => {
|
|
1118
931
|
const { tx } = useThemeContext();
|
|
1119
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
1120
933
|
...props,
|
|
1121
934
|
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
1122
935
|
ref: forwardedRef
|
|
1123
936
|
});
|
|
1124
937
|
});
|
|
1125
|
-
var ContextMenuSeparator = /* @__PURE__ */
|
|
938
|
+
var ContextMenuSeparator = /* @__PURE__ */ forwardRef13(({ classNames, ...props }, forwardedRef) => {
|
|
1126
939
|
const { tx } = useThemeContext();
|
|
1127
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Separator, {
|
|
1128
941
|
...props,
|
|
1129
942
|
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
1130
943
|
ref: forwardedRef
|
|
1131
944
|
});
|
|
1132
945
|
});
|
|
1133
|
-
var ContextMenuGroupLabel = /* @__PURE__ */
|
|
946
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef13(({ classNames, ...props }, forwardedRef) => {
|
|
1134
947
|
const { tx } = useThemeContext();
|
|
1135
|
-
return /* @__PURE__ */
|
|
948
|
+
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Label, {
|
|
1136
949
|
...props,
|
|
1137
950
|
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
1138
951
|
ref: forwardedRef
|
|
@@ -1157,13 +970,13 @@ var ContextMenu2 = {
|
|
|
1157
970
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
1158
971
|
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
1159
972
|
import { createContextScope } from "@radix-ui/react-context";
|
|
1160
|
-
import { useId as
|
|
973
|
+
import { useId as useId2 } from "@radix-ui/react-id";
|
|
1161
974
|
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
1162
975
|
import { createMenuScope } from "@radix-ui/react-menu";
|
|
1163
976
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
1164
977
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
1165
978
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
1166
|
-
import
|
|
979
|
+
import React20, { useRef, useCallback as useCallback4, forwardRef as forwardRef14, useEffect as useEffect3 } from "react";
|
|
1167
980
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
1168
981
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
1169
982
|
createMenuScope
|
|
@@ -1179,18 +992,18 @@ var DropdownMenuRoot = (props) => {
|
|
|
1179
992
|
defaultProp: defaultOpen,
|
|
1180
993
|
onChange: onOpenChange
|
|
1181
994
|
});
|
|
1182
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ React20.createElement(DropdownMenuProvider, {
|
|
1183
996
|
scope: __scopeDropdownMenu,
|
|
1184
|
-
triggerId:
|
|
997
|
+
triggerId: useId2(),
|
|
1185
998
|
triggerRef,
|
|
1186
|
-
contentId:
|
|
999
|
+
contentId: useId2(),
|
|
1187
1000
|
open,
|
|
1188
1001
|
onOpenChange: setOpen,
|
|
1189
1002
|
onOpenToggle: useCallback4(() => setOpen((prevOpen) => !prevOpen), [
|
|
1190
1003
|
setOpen
|
|
1191
1004
|
]),
|
|
1192
1005
|
modal
|
|
1193
|
-
}, /* @__PURE__ */
|
|
1006
|
+
}, /* @__PURE__ */ React20.createElement(MenuPrimitive.Root, {
|
|
1194
1007
|
...menuScope,
|
|
1195
1008
|
open,
|
|
1196
1009
|
onOpenChange: setOpen,
|
|
@@ -1200,14 +1013,14 @@ var DropdownMenuRoot = (props) => {
|
|
|
1200
1013
|
};
|
|
1201
1014
|
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
1202
1015
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
1203
|
-
var DropdownMenuTrigger = /* @__PURE__ */
|
|
1016
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1204
1017
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
1205
1018
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
1206
1019
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1207
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Anchor, {
|
|
1208
1021
|
asChild: true,
|
|
1209
1022
|
...menuScope
|
|
1210
|
-
}, /* @__PURE__ */
|
|
1023
|
+
}, /* @__PURE__ */ React20.createElement(Primitive7.button, {
|
|
1211
1024
|
type: "button",
|
|
1212
1025
|
id: context.triggerId,
|
|
1213
1026
|
"aria-haspopup": "menu",
|
|
@@ -1260,7 +1073,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
1260
1073
|
context.triggerRef.current = virtualRef.current;
|
|
1261
1074
|
}
|
|
1262
1075
|
});
|
|
1263
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Anchor, {
|
|
1264
1077
|
...menuScope,
|
|
1265
1078
|
virtualRef
|
|
1266
1079
|
});
|
|
@@ -1270,23 +1083,23 @@ var PORTAL_NAME = "DropdownMenuPortal";
|
|
|
1270
1083
|
var DropdownMenuPortal = (props) => {
|
|
1271
1084
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
1272
1085
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1273
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Portal, {
|
|
1274
1087
|
...menuScope,
|
|
1275
1088
|
...portalProps
|
|
1276
1089
|
});
|
|
1277
1090
|
};
|
|
1278
1091
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
1279
|
-
var DropdownMenuViewport = /* @__PURE__ */
|
|
1092
|
+
var DropdownMenuViewport = /* @__PURE__ */ forwardRef14(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1280
1093
|
const { tx } = useThemeContext();
|
|
1281
1094
|
const Root5 = asChild ? Slot7 : Primitive7.div;
|
|
1282
|
-
return /* @__PURE__ */
|
|
1095
|
+
return /* @__PURE__ */ React20.createElement(Root5, {
|
|
1283
1096
|
...props,
|
|
1284
1097
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
1285
1098
|
ref: forwardedRef
|
|
1286
1099
|
}, children);
|
|
1287
1100
|
});
|
|
1288
1101
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
1289
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
1102
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1290
1103
|
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
1291
1104
|
const { tx } = useThemeContext();
|
|
1292
1105
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
@@ -1294,7 +1107,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) =>
|
|
|
1294
1107
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1295
1108
|
const hasInteractedOutsideRef = useRef(false);
|
|
1296
1109
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1297
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Content, {
|
|
1298
1111
|
id: context.contentId,
|
|
1299
1112
|
"aria-labelledby": context.triggerId,
|
|
1300
1113
|
...menuScope,
|
|
@@ -1334,10 +1147,10 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) =>
|
|
|
1334
1147
|
});
|
|
1335
1148
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
1336
1149
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
1337
|
-
var DropdownMenuGroup = /* @__PURE__ */
|
|
1150
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1338
1151
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1339
1152
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1340
|
-
return /* @__PURE__ */
|
|
1153
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Group, {
|
|
1341
1154
|
...menuScope,
|
|
1342
1155
|
...groupProps,
|
|
1343
1156
|
ref: forwardedRef
|
|
@@ -1345,11 +1158,11 @@ var DropdownMenuGroup = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
|
1345
1158
|
});
|
|
1346
1159
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
1347
1160
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
1348
|
-
var DropdownMenuGroupLabel = /* @__PURE__ */
|
|
1161
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1349
1162
|
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1350
1163
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1351
1164
|
const { tx } = useThemeContext();
|
|
1352
|
-
return /* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Label, {
|
|
1353
1166
|
...menuScope,
|
|
1354
1167
|
...labelProps,
|
|
1355
1168
|
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
@@ -1358,11 +1171,11 @@ var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef15((props, forwardedRef)
|
|
|
1358
1171
|
});
|
|
1359
1172
|
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
1360
1173
|
var ITEM_NAME = "DropdownMenuItem";
|
|
1361
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
1174
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1362
1175
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1363
1176
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1364
1177
|
const { tx } = useThemeContext();
|
|
1365
|
-
return /* @__PURE__ */
|
|
1178
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Item, {
|
|
1366
1179
|
...menuScope,
|
|
1367
1180
|
...itemProps,
|
|
1368
1181
|
className: tx("menu.item", "menu__item", {}, classNames),
|
|
@@ -1371,11 +1184,11 @@ var DropdownMenuItem = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
|
1371
1184
|
});
|
|
1372
1185
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
1373
1186
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
1374
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
1187
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1375
1188
|
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1376
1189
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1377
1190
|
const { tx } = useThemeContext();
|
|
1378
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.CheckboxItem, {
|
|
1379
1192
|
...menuScope,
|
|
1380
1193
|
...checkboxItemProps,
|
|
1381
1194
|
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
@@ -1384,10 +1197,10 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef15((props, forwardedRef
|
|
|
1384
1197
|
});
|
|
1385
1198
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
1386
1199
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
1387
|
-
var DropdownMenuRadioGroup = /* @__PURE__ */
|
|
1200
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1388
1201
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1389
1202
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1390
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.RadioGroup, {
|
|
1391
1204
|
...menuScope,
|
|
1392
1205
|
...radioGroupProps,
|
|
1393
1206
|
ref: forwardedRef
|
|
@@ -1395,10 +1208,10 @@ var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef15((props, forwardedRef)
|
|
|
1395
1208
|
});
|
|
1396
1209
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
1397
1210
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
1398
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
1211
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1399
1212
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
1400
1213
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1401
|
-
return /* @__PURE__ */
|
|
1214
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.RadioItem, {
|
|
1402
1215
|
...menuScope,
|
|
1403
1216
|
...radioItemProps,
|
|
1404
1217
|
ref: forwardedRef
|
|
@@ -1406,10 +1219,10 @@ var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef15((props, forwardedRef) =
|
|
|
1406
1219
|
});
|
|
1407
1220
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
1408
1221
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
1409
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */
|
|
1222
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1410
1223
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1411
1224
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1412
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.ItemIndicator, {
|
|
1413
1226
|
...menuScope,
|
|
1414
1227
|
...itemIndicatorProps,
|
|
1415
1228
|
ref: forwardedRef
|
|
@@ -1417,11 +1230,11 @@ var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef15((props, forwardedRe
|
|
|
1417
1230
|
});
|
|
1418
1231
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1419
1232
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
1420
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
1233
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1421
1234
|
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1422
1235
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1423
1236
|
const { tx } = useThemeContext();
|
|
1424
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Separator, {
|
|
1425
1238
|
...menuScope,
|
|
1426
1239
|
...separatorProps,
|
|
1427
1240
|
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
@@ -1430,11 +1243,11 @@ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef15((props, forwardedRef) =
|
|
|
1430
1243
|
});
|
|
1431
1244
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1432
1245
|
var ARROW_NAME = "DropdownMenuArrow";
|
|
1433
|
-
var DropdownMenuArrow = /* @__PURE__ */
|
|
1246
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1434
1247
|
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1435
1248
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1436
1249
|
const { tx } = useThemeContext();
|
|
1437
|
-
return /* @__PURE__ */
|
|
1250
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Arrow, {
|
|
1438
1251
|
...menuScope,
|
|
1439
1252
|
...arrowProps,
|
|
1440
1253
|
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
@@ -1450,17 +1263,17 @@ var DropdownMenuSub = (props) => {
|
|
|
1450
1263
|
defaultProp: defaultOpen,
|
|
1451
1264
|
onChange: onOpenChange
|
|
1452
1265
|
});
|
|
1453
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Sub, {
|
|
1454
1267
|
...menuScope,
|
|
1455
1268
|
open,
|
|
1456
1269
|
onOpenChange: setOpen
|
|
1457
1270
|
}, children);
|
|
1458
1271
|
};
|
|
1459
1272
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1460
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
1273
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1461
1274
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1462
1275
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1463
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.SubTrigger, {
|
|
1464
1277
|
...menuScope,
|
|
1465
1278
|
...subTriggerProps,
|
|
1466
1279
|
ref: forwardedRef
|
|
@@ -1468,10 +1281,10 @@ var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef15((props, forwardedRef)
|
|
|
1468
1281
|
});
|
|
1469
1282
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1470
1283
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1471
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
1284
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1472
1285
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1473
1286
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1474
|
-
return /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ React20.createElement(MenuPrimitive.SubContent, {
|
|
1475
1288
|
...menuScope,
|
|
1476
1289
|
...subContentProps,
|
|
1477
1290
|
ref: forwardedRef,
|
|
@@ -1514,11 +1327,12 @@ var useDropdownMenuMenuScope = useMenuScope;
|
|
|
1514
1327
|
// packages/ui/react-ui/src/components/Input/Input.tsx
|
|
1515
1328
|
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1516
1329
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1517
|
-
import
|
|
1330
|
+
import React21, { forwardRef as forwardRef15, useCallback as useCallback5 } from "react";
|
|
1518
1331
|
import { InputRoot, PinInput as PinInputPrimitive, TextInput as TextInputPrimitive, TextArea as TextAreaPrimitive, useInputContext, INPUT_NAME, Description as DescriptionPrimitive, DescriptionAndValidation as DescriptionAndValidationPrimitive, Label as LabelPrimitive, Validation as ValidationPrimitive } from "@dxos/react-input";
|
|
1519
|
-
|
|
1332
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1333
|
+
var Label3 = /* @__PURE__ */ forwardRef15(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1520
1334
|
const { tx } = useThemeContext();
|
|
1521
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ React21.createElement(LabelPrimitive, {
|
|
1522
1336
|
...props,
|
|
1523
1337
|
className: tx("input.label", "input__label", {
|
|
1524
1338
|
srOnly
|
|
@@ -1526,9 +1340,9 @@ var Label3 = /* @__PURE__ */ forwardRef16(({ srOnly, classNames, children, ...pr
|
|
|
1526
1340
|
ref: forwardedRef
|
|
1527
1341
|
}, children);
|
|
1528
1342
|
});
|
|
1529
|
-
var Description = /* @__PURE__ */
|
|
1343
|
+
var Description = /* @__PURE__ */ forwardRef15(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1530
1344
|
const { tx } = useThemeContext();
|
|
1531
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ React21.createElement(DescriptionPrimitive, {
|
|
1532
1346
|
...props,
|
|
1533
1347
|
className: tx("input.description", "input__description", {
|
|
1534
1348
|
srOnly
|
|
@@ -1536,10 +1350,10 @@ var Description = /* @__PURE__ */ forwardRef16(({ srOnly, classNames, children,
|
|
|
1536
1350
|
ref: forwardedRef
|
|
1537
1351
|
}, children);
|
|
1538
1352
|
});
|
|
1539
|
-
var Validation = /* @__PURE__ */
|
|
1353
|
+
var Validation = /* @__PURE__ */ forwardRef15(({ __inputScope, srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1540
1354
|
const { tx } = useThemeContext();
|
|
1541
1355
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
1542
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ React21.createElement(ValidationPrimitive, {
|
|
1543
1357
|
...props,
|
|
1544
1358
|
className: tx("input.validation", `input__validation-message input__validation-message--${validationValence}`, {
|
|
1545
1359
|
srOnly,
|
|
@@ -1548,9 +1362,9 @@ var Validation = /* @__PURE__ */ forwardRef16(({ __inputScope, srOnly, className
|
|
|
1548
1362
|
ref: forwardedRef
|
|
1549
1363
|
}, children);
|
|
1550
1364
|
});
|
|
1551
|
-
var DescriptionAndValidation = /* @__PURE__ */
|
|
1365
|
+
var DescriptionAndValidation = /* @__PURE__ */ forwardRef15(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1552
1366
|
const { tx } = useThemeContext();
|
|
1553
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ React21.createElement(DescriptionAndValidationPrimitive, {
|
|
1554
1368
|
...props,
|
|
1555
1369
|
className: tx("input.descriptionAndValidation", "input__description-and-validation", {
|
|
1556
1370
|
srOnly
|
|
@@ -1558,7 +1372,7 @@ var DescriptionAndValidation = /* @__PURE__ */ forwardRef16(({ srOnly, className
|
|
|
1558
1372
|
ref: forwardedRef
|
|
1559
1373
|
}, children);
|
|
1560
1374
|
});
|
|
1561
|
-
var PinInput = /* @__PURE__ */
|
|
1375
|
+
var PinInput = /* @__PURE__ */ forwardRef15(({ density: propsDensity, elevation: propsElevation, segmentClassName: propsSegmentClassName, inputClassName, variant, ...props }, forwardedRef) => {
|
|
1562
1376
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1563
1377
|
const { tx } = useThemeContext();
|
|
1564
1378
|
const density = useDensityContext(propsDensity);
|
|
@@ -1577,7 +1391,7 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ density: propsDensity, elevation:
|
|
|
1577
1391
|
propsElevation,
|
|
1578
1392
|
density
|
|
1579
1393
|
]);
|
|
1580
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ React21.createElement(PinInputPrimitive, {
|
|
1581
1395
|
...props,
|
|
1582
1396
|
segmentClassName,
|
|
1583
1397
|
...props.autoFocus && !hasIosKeyboard2 && {
|
|
@@ -1589,14 +1403,14 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ density: propsDensity, elevation:
|
|
|
1589
1403
|
ref: forwardedRef
|
|
1590
1404
|
});
|
|
1591
1405
|
});
|
|
1592
|
-
var TextInput = /* @__PURE__ */
|
|
1406
|
+
var TextInput = /* @__PURE__ */ forwardRef15(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
1593
1407
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1594
1408
|
const themeContextValue = useThemeContext();
|
|
1595
1409
|
const density = useDensityContext(propsDensity);
|
|
1596
1410
|
const elevation = useElevationContext(propsElevation);
|
|
1597
1411
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
1598
1412
|
const { tx } = themeContextValue;
|
|
1599
|
-
return /* @__PURE__ */
|
|
1413
|
+
return /* @__PURE__ */ React21.createElement(TextInputPrimitive, {
|
|
1600
1414
|
...props,
|
|
1601
1415
|
className: tx("input.input", "input", {
|
|
1602
1416
|
variant,
|
|
@@ -1611,13 +1425,13 @@ var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, densit
|
|
|
1611
1425
|
ref: forwardedRef
|
|
1612
1426
|
});
|
|
1613
1427
|
});
|
|
1614
|
-
var TextArea = /* @__PURE__ */
|
|
1428
|
+
var TextArea = /* @__PURE__ */ forwardRef15(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
1615
1429
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
1616
1430
|
const { tx } = useThemeContext();
|
|
1617
1431
|
const density = useDensityContext(propsDensity);
|
|
1618
1432
|
const elevation = useElevationContext(propsElevation);
|
|
1619
1433
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
1620
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ React21.createElement(TextAreaPrimitive, {
|
|
1621
1435
|
...props,
|
|
1622
1436
|
className: tx("input.input", "input--text-area", {
|
|
1623
1437
|
variant,
|
|
@@ -1632,7 +1446,7 @@ var TextArea = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density
|
|
|
1632
1446
|
ref: forwardedRef
|
|
1633
1447
|
});
|
|
1634
1448
|
});
|
|
1635
|
-
var Checkbox = /* @__PURE__ */
|
|
1449
|
+
var Checkbox = /* @__PURE__ */ forwardRef15(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, weight = "bold", classNames, ...props }, forwardedRef) => {
|
|
1636
1450
|
const [checked, onCheckedChange] = useControllableState2({
|
|
1637
1451
|
prop: propsChecked,
|
|
1638
1452
|
defaultProp: propsDefaultChecked,
|
|
@@ -1640,7 +1454,7 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsCheck
|
|
|
1640
1454
|
});
|
|
1641
1455
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1642
1456
|
const { tx } = useThemeContext();
|
|
1643
|
-
return /* @__PURE__ */
|
|
1457
|
+
return /* @__PURE__ */ React21.createElement(CheckboxPrimitive, {
|
|
1644
1458
|
...props,
|
|
1645
1459
|
checked,
|
|
1646
1460
|
onCheckedChange,
|
|
@@ -1654,7 +1468,7 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsCheck
|
|
|
1654
1468
|
size
|
|
1655
1469
|
}, "shrink-0", classNames),
|
|
1656
1470
|
ref: forwardedRef
|
|
1657
|
-
}, /* @__PURE__ */
|
|
1471
|
+
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1658
1472
|
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
1659
1473
|
classNames: tx("input.checkboxIndicator", "input--checkbox__indicator", {
|
|
1660
1474
|
size,
|
|
@@ -1662,16 +1476,16 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsCheck
|
|
|
1662
1476
|
})
|
|
1663
1477
|
}));
|
|
1664
1478
|
});
|
|
1665
|
-
var Switch = /* @__PURE__ */
|
|
1479
|
+
var Switch = /* @__PURE__ */ forwardRef15(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, classNames, ...props }, forwardedRef) => {
|
|
1666
1480
|
const [checked, onCheckedChange] = useControllableState2({
|
|
1667
1481
|
prop: propsChecked,
|
|
1668
1482
|
defaultProp: propsDefaultChecked ?? false,
|
|
1669
1483
|
onChange: propsOnCheckedChange
|
|
1670
1484
|
});
|
|
1671
1485
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1672
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ React21.createElement("input", {
|
|
1673
1487
|
type: "checkbox",
|
|
1674
|
-
className: "dx-checkbox--switch dx-focus-ring",
|
|
1488
|
+
className: mx3("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1675
1489
|
checked,
|
|
1676
1490
|
onChange: (event) => {
|
|
1677
1491
|
onCheckedChange(event.target.checked);
|
|
@@ -1702,11 +1516,11 @@ var Input = {
|
|
|
1702
1516
|
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1703
1517
|
import { CaretDown, CaretRight } from "@phosphor-icons/react";
|
|
1704
1518
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
1705
|
-
import
|
|
1519
|
+
import React23, { forwardRef as forwardRef16 } from "react";
|
|
1706
1520
|
import { List as ListPrimitive, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, ListItemCollapsibleContent, ListItem as ListPrimitiveItem, LIST_NAME, LIST_ITEM_NAME, useListContext, useListItemContext } from "@dxos/react-list";
|
|
1707
1521
|
|
|
1708
1522
|
// packages/ui/react-ui/src/components/Lists/ListDropIndicator.tsx
|
|
1709
|
-
import
|
|
1523
|
+
import React22 from "react";
|
|
1710
1524
|
var edgeToOrientationMap = {
|
|
1711
1525
|
top: "horizontal",
|
|
1712
1526
|
bottom: "horizontal",
|
|
@@ -1728,7 +1542,7 @@ var terminalSize = 8;
|
|
|
1728
1542
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
1729
1543
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1730
1544
|
const orientation = edgeToOrientationMap[edge];
|
|
1731
|
-
return /* @__PURE__ */
|
|
1545
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
1732
1546
|
role: "none",
|
|
1733
1547
|
style: {
|
|
1734
1548
|
"--line-thickness": `${strokeSize}px`,
|
|
@@ -1744,22 +1558,22 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
1744
1558
|
};
|
|
1745
1559
|
|
|
1746
1560
|
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1747
|
-
var List = /* @__PURE__ */
|
|
1561
|
+
var List = /* @__PURE__ */ forwardRef16(({ classNames, children, ...props }, forwardedRef) => {
|
|
1748
1562
|
const { tx } = useThemeContext();
|
|
1749
1563
|
const density = useDensityContext(props.density);
|
|
1750
|
-
return /* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ React23.createElement(DensityProvider, {
|
|
1751
1565
|
density
|
|
1752
|
-
}, /* @__PURE__ */
|
|
1566
|
+
}, /* @__PURE__ */ React23.createElement(ListPrimitive, {
|
|
1753
1567
|
...props,
|
|
1754
1568
|
className: tx("list.root", "list", {}, classNames),
|
|
1755
1569
|
ref: forwardedRef
|
|
1756
1570
|
}, children));
|
|
1757
1571
|
});
|
|
1758
|
-
var ListItemEndcap = /* @__PURE__ */
|
|
1572
|
+
var ListItemEndcap = /* @__PURE__ */ forwardRef16(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
1759
1573
|
const Root5 = asChild ? Slot8 : "div";
|
|
1760
1574
|
const density = useDensityContext();
|
|
1761
1575
|
const { tx } = useThemeContext();
|
|
1762
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ React23.createElement(Root5, {
|
|
1763
1577
|
...!asChild && {
|
|
1764
1578
|
role: "none"
|
|
1765
1579
|
},
|
|
@@ -1773,7 +1587,7 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChi
|
|
|
1773
1587
|
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
1774
1588
|
const density = useDensityContext();
|
|
1775
1589
|
const { tx } = useThemeContext();
|
|
1776
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1777
1591
|
role: "none",
|
|
1778
1592
|
...props,
|
|
1779
1593
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger--mock", {
|
|
@@ -1781,10 +1595,10 @@ var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
|
1781
1595
|
}, classNames)
|
|
1782
1596
|
});
|
|
1783
1597
|
};
|
|
1784
|
-
var ListItemHeading = /* @__PURE__ */
|
|
1598
|
+
var ListItemHeading = /* @__PURE__ */ forwardRef16(({ children, classNames, ...props }, forwardedRef) => {
|
|
1785
1599
|
const { tx } = useThemeContext();
|
|
1786
1600
|
const density = useDensityContext();
|
|
1787
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ React23.createElement(ListPrimitiveItemHeading, {
|
|
1788
1602
|
...props,
|
|
1789
1603
|
className: tx("list.item.heading", "list__listItem__heading", {
|
|
1790
1604
|
density
|
|
@@ -1792,26 +1606,26 @@ var ListItemHeading = /* @__PURE__ */ forwardRef17(({ children, classNames, ...p
|
|
|
1792
1606
|
ref: forwardedRef
|
|
1793
1607
|
}, children);
|
|
1794
1608
|
});
|
|
1795
|
-
var ListItemOpenTrigger = /* @__PURE__ */
|
|
1609
|
+
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef16(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
1796
1610
|
const { tx } = useThemeContext();
|
|
1797
1611
|
const density = useDensityContext();
|
|
1798
1612
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1799
1613
|
const Icon3 = open ? CaretDown : CaretRight;
|
|
1800
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ React23.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1801
1615
|
...props,
|
|
1802
1616
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
1803
1617
|
density
|
|
1804
1618
|
}, classNames),
|
|
1805
1619
|
ref: forwardedRef
|
|
1806
|
-
}, children || /* @__PURE__ */
|
|
1620
|
+
}, children || /* @__PURE__ */ React23.createElement(Icon3, {
|
|
1807
1621
|
weight: "bold",
|
|
1808
1622
|
className: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1809
1623
|
}));
|
|
1810
1624
|
});
|
|
1811
|
-
var ListItemRoot = /* @__PURE__ */
|
|
1625
|
+
var ListItemRoot = /* @__PURE__ */ forwardRef16(({ classNames, children, ...props }, forwardedRef) => {
|
|
1812
1626
|
const { tx } = useThemeContext();
|
|
1813
1627
|
const density = useDensityContext();
|
|
1814
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ React23.createElement(ListPrimitiveItem, {
|
|
1815
1629
|
...props,
|
|
1816
1630
|
className: tx("list.item.root", "list__listItem", {
|
|
1817
1631
|
density,
|
|
@@ -1831,10 +1645,10 @@ var ListItem = {
|
|
|
1831
1645
|
};
|
|
1832
1646
|
|
|
1833
1647
|
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1834
|
-
import
|
|
1648
|
+
import React25, { forwardRef as forwardRef17 } from "react";
|
|
1835
1649
|
|
|
1836
1650
|
// packages/ui/react-ui/src/components/Lists/TreeDropIndicator.tsx
|
|
1837
|
-
import
|
|
1651
|
+
import React24 from "react";
|
|
1838
1652
|
var edgeToOrientationMap2 = {
|
|
1839
1653
|
"reorder-above": "sibling",
|
|
1840
1654
|
"reorder-below": "sibling",
|
|
@@ -1864,7 +1678,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
1864
1678
|
if (isBlocked) {
|
|
1865
1679
|
return null;
|
|
1866
1680
|
}
|
|
1867
|
-
return /* @__PURE__ */
|
|
1681
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1868
1682
|
style: {
|
|
1869
1683
|
"--line-thickness": `${strokeSize2}px`,
|
|
1870
1684
|
"--line-offset": `${lineOffset}`,
|
|
@@ -1879,22 +1693,22 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
1879
1693
|
};
|
|
1880
1694
|
|
|
1881
1695
|
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1882
|
-
var TreeRoot = /* @__PURE__ */
|
|
1883
|
-
return /* @__PURE__ */
|
|
1696
|
+
var TreeRoot = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
1697
|
+
return /* @__PURE__ */ React25.createElement(List, {
|
|
1884
1698
|
...props,
|
|
1885
1699
|
ref: forwardedRef
|
|
1886
1700
|
});
|
|
1887
1701
|
});
|
|
1888
|
-
var TreeBranch = /* @__PURE__ */
|
|
1702
|
+
var TreeBranch = /* @__PURE__ */ forwardRef17(({ __listScope, ...props }, forwardedRef) => {
|
|
1889
1703
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
1890
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ React25.createElement(List, {
|
|
1891
1705
|
...props,
|
|
1892
1706
|
"aria-labelledby": headingId,
|
|
1893
1707
|
ref: forwardedRef
|
|
1894
1708
|
});
|
|
1895
1709
|
});
|
|
1896
|
-
var TreeItemRoot = /* @__PURE__ */
|
|
1897
|
-
return /* @__PURE__ */
|
|
1710
|
+
var TreeItemRoot = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
1711
|
+
return /* @__PURE__ */ React25.createElement(ListItem.Root, {
|
|
1898
1712
|
role: "treeitem",
|
|
1899
1713
|
...props,
|
|
1900
1714
|
ref: forwardedRef
|
|
@@ -1923,13 +1737,13 @@ import { createContextScope as createContextScope2 } from "@radix-ui/react-conte
|
|
|
1923
1737
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
1924
1738
|
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
1925
1739
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
1926
|
-
import
|
|
1740
|
+
import React26, { forwardRef as forwardRef18 } from "react";
|
|
1927
1741
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
1928
1742
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
1929
1743
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
1930
1744
|
var PATH_SEPARATOR = "~";
|
|
1931
1745
|
var PARENT_OF_SEPARATOR = " ";
|
|
1932
|
-
var TreegridRoot = /* @__PURE__ */
|
|
1746
|
+
var TreegridRoot = /* @__PURE__ */ forwardRef18(({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
|
|
1933
1747
|
const { tx } = useThemeContext();
|
|
1934
1748
|
const Root5 = asChild ? Slot9 : Primitive8.div;
|
|
1935
1749
|
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
@@ -1937,7 +1751,7 @@ var TreegridRoot = /* @__PURE__ */ forwardRef19(({ asChild, classNames, children
|
|
|
1937
1751
|
tabbable: false,
|
|
1938
1752
|
circular: true
|
|
1939
1753
|
});
|
|
1940
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ React26.createElement(Root5, {
|
|
1941
1755
|
role: "treegrid",
|
|
1942
1756
|
...arrowNavigationAttrs,
|
|
1943
1757
|
...props,
|
|
@@ -1949,7 +1763,7 @@ var TreegridRoot = /* @__PURE__ */ forwardRef19(({ asChild, classNames, children
|
|
|
1949
1763
|
ref: forwardedRef
|
|
1950
1764
|
}, children);
|
|
1951
1765
|
});
|
|
1952
|
-
var TreegridRow = /* @__PURE__ */
|
|
1766
|
+
var TreegridRow = /* @__PURE__ */ forwardRef18(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
1953
1767
|
const { tx } = useThemeContext();
|
|
1954
1768
|
const Root5 = asChild ? Slot9 : Primitive8.div;
|
|
1955
1769
|
const pathParts = id.split(PATH_SEPARATOR);
|
|
@@ -1968,11 +1782,11 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
1968
1782
|
circular: false,
|
|
1969
1783
|
memorizeCurrent: false
|
|
1970
1784
|
});
|
|
1971
|
-
return /* @__PURE__ */
|
|
1785
|
+
return /* @__PURE__ */ React26.createElement(TreegridRowProvider, {
|
|
1972
1786
|
open,
|
|
1973
1787
|
onOpenChange,
|
|
1974
1788
|
scope: __treegridRowScope
|
|
1975
|
-
}, /* @__PURE__ */
|
|
1789
|
+
}, /* @__PURE__ */ React26.createElement(Root5, {
|
|
1976
1790
|
role: "row",
|
|
1977
1791
|
"aria-level": level,
|
|
1978
1792
|
className: tx("treegrid.row", "treegrid__row", {
|
|
@@ -1987,15 +1801,15 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
1987
1801
|
...props,
|
|
1988
1802
|
id,
|
|
1989
1803
|
ref: forwardedRef
|
|
1990
|
-
}, /* @__PURE__ */
|
|
1804
|
+
}, /* @__PURE__ */ React26.createElement("div", {
|
|
1991
1805
|
role: "none",
|
|
1992
1806
|
className: "contents",
|
|
1993
1807
|
...arrowGroupAttrs
|
|
1994
1808
|
}, children)));
|
|
1995
1809
|
});
|
|
1996
|
-
var TreegridCell = /* @__PURE__ */
|
|
1810
|
+
var TreegridCell = /* @__PURE__ */ forwardRef18(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
1997
1811
|
const { tx } = useThemeContext();
|
|
1998
|
-
return /* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ React26.createElement("div", {
|
|
1999
1813
|
role: "gridcell",
|
|
2000
1814
|
className: tx("treegrid.cell", "treegrid__cell", {
|
|
2001
1815
|
indent
|
|
@@ -2020,7 +1834,7 @@ import { Root as DialogRoot2, DialogContent as DialogContent2, DialogTitle as Di
|
|
|
2020
1834
|
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
2021
1835
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
2022
1836
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2023
|
-
import
|
|
1837
|
+
import React27, { forwardRef as forwardRef19, useCallback as useCallback7, useEffect as useEffect5, useRef as useRef2, useState as useState8 } from "react";
|
|
2024
1838
|
import { log } from "@dxos/log";
|
|
2025
1839
|
import { useMediaQuery, useForwardedRef } from "@dxos/react-hooks";
|
|
2026
1840
|
|
|
@@ -2234,7 +2048,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2234
2048
|
}, [
|
|
2235
2049
|
handleResize
|
|
2236
2050
|
]);
|
|
2237
|
-
return /* @__PURE__ */
|
|
2051
|
+
return /* @__PURE__ */ React27.createElement(MainProvider, {
|
|
2238
2052
|
...props,
|
|
2239
2053
|
navigationSidebarState,
|
|
2240
2054
|
setNavigationSidebarState,
|
|
@@ -2247,7 +2061,7 @@ MainRoot.displayName = MAIN_ROOT_NAME;
|
|
|
2247
2061
|
var handleOpenAutoFocus = (event) => {
|
|
2248
2062
|
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2249
2063
|
};
|
|
2250
|
-
var MainSidebar = /* @__PURE__ */
|
|
2064
|
+
var MainSidebar = /* @__PURE__ */ forwardRef19(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2251
2065
|
const [isLg] = useMediaQuery("lg", {
|
|
2252
2066
|
ssr: false
|
|
2253
2067
|
});
|
|
@@ -2267,13 +2081,13 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2267
2081
|
props.onKeyDown
|
|
2268
2082
|
]);
|
|
2269
2083
|
const Root5 = isLg ? Primitive9.div : DialogContent2;
|
|
2270
|
-
return /* @__PURE__ */
|
|
2084
|
+
return /* @__PURE__ */ React27.createElement(DialogRoot2, {
|
|
2271
2085
|
open: state !== "closed",
|
|
2272
2086
|
"aria-label": toLocalizedString(label, t),
|
|
2273
2087
|
modal: false
|
|
2274
|
-
}, !isLg && /* @__PURE__ */
|
|
2088
|
+
}, !isLg && /* @__PURE__ */ React27.createElement(DialogTitle2, {
|
|
2275
2089
|
className: "sr-only"
|
|
2276
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */
|
|
2090
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React27.createElement(Root5, {
|
|
2277
2091
|
...!isLg && {
|
|
2278
2092
|
forceMount: true,
|
|
2279
2093
|
tabIndex: -1,
|
|
@@ -2291,10 +2105,10 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2291
2105
|
ref
|
|
2292
2106
|
}, children));
|
|
2293
2107
|
});
|
|
2294
|
-
var MainNavigationSidebar = /* @__PURE__ */
|
|
2108
|
+
var MainNavigationSidebar = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2295
2109
|
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2296
2110
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2297
|
-
return /* @__PURE__ */
|
|
2111
|
+
return /* @__PURE__ */ React27.createElement(MainSidebar, {
|
|
2298
2112
|
...mover,
|
|
2299
2113
|
...props,
|
|
2300
2114
|
state: navigationSidebarState,
|
|
@@ -2305,10 +2119,10 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) =
|
|
|
2305
2119
|
});
|
|
2306
2120
|
});
|
|
2307
2121
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2308
|
-
var MainComplementarySidebar = /* @__PURE__ */
|
|
2122
|
+
var MainComplementarySidebar = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2309
2123
|
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2310
2124
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2311
|
-
return /* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ React27.createElement(MainSidebar, {
|
|
2312
2126
|
...mover,
|
|
2313
2127
|
...props,
|
|
2314
2128
|
state: complementarySidebarState,
|
|
@@ -2319,12 +2133,12 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef
|
|
|
2319
2133
|
});
|
|
2320
2134
|
});
|
|
2321
2135
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2322
|
-
var MainContent = /* @__PURE__ */
|
|
2136
|
+
var MainContent = /* @__PURE__ */ forwardRef19(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2323
2137
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2324
2138
|
const { tx } = useThemeContext();
|
|
2325
2139
|
const Root5 = asChild ? Slot10 : role ? "div" : "main";
|
|
2326
2140
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2327
|
-
return /* @__PURE__ */
|
|
2141
|
+
return /* @__PURE__ */ React27.createElement(Root5, {
|
|
2328
2142
|
role,
|
|
2329
2143
|
...handlesFocus && {
|
|
2330
2144
|
...mover
|
|
@@ -2340,13 +2154,13 @@ var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, h
|
|
|
2340
2154
|
}, children);
|
|
2341
2155
|
});
|
|
2342
2156
|
MainContent.displayName = MAIN_NAME;
|
|
2343
|
-
var MainOverlay = /* @__PURE__ */
|
|
2157
|
+
var MainOverlay = /* @__PURE__ */ forwardRef19(({ classNames, ...props }, forwardedRef) => {
|
|
2344
2158
|
const [isLg] = useMediaQuery("lg", {
|
|
2345
2159
|
ssr: false
|
|
2346
2160
|
});
|
|
2347
2161
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2348
2162
|
const { tx } = useThemeContext();
|
|
2349
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ React27.createElement("div", {
|
|
2350
2164
|
onClick: () => {
|
|
2351
2165
|
setNavigationSidebarState("collapsed");
|
|
2352
2166
|
setComplementarySidebarState("collapsed");
|
|
@@ -2374,20 +2188,20 @@ var Main = {
|
|
|
2374
2188
|
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
2375
2189
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
2376
2190
|
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
2377
|
-
import
|
|
2378
|
-
import { useId as
|
|
2191
|
+
import React28, { forwardRef as forwardRef20 } from "react";
|
|
2192
|
+
import { useId as useId3 } from "@dxos/react-hooks";
|
|
2379
2193
|
var MESSAGE_NAME = "Message";
|
|
2380
2194
|
var [MessageProvider, useMessageContext] = createContext11(MESSAGE_NAME);
|
|
2381
|
-
var MessageRoot = /* @__PURE__ */
|
|
2195
|
+
var MessageRoot = /* @__PURE__ */ forwardRef20(({ asChild, valence, elevation: propsElevation, className, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
2382
2196
|
const { tx } = useThemeContext();
|
|
2383
|
-
const titleId =
|
|
2384
|
-
const descriptionId =
|
|
2197
|
+
const titleId = useId3("message__title", propsTitleId);
|
|
2198
|
+
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
2385
2199
|
const elevation = useElevationContext(propsElevation);
|
|
2386
2200
|
const Root5 = asChild ? Slot11 : Primitive10.div;
|
|
2387
|
-
return /* @__PURE__ */
|
|
2201
|
+
return /* @__PURE__ */ React28.createElement(MessageProvider, {
|
|
2388
2202
|
titleId,
|
|
2389
2203
|
descriptionId
|
|
2390
|
-
}, /* @__PURE__ */
|
|
2204
|
+
}, /* @__PURE__ */ React28.createElement(Root5, {
|
|
2391
2205
|
...props,
|
|
2392
2206
|
className: tx("message.root", "message", {
|
|
2393
2207
|
valence,
|
|
@@ -2400,11 +2214,11 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence, elevation: p
|
|
|
2400
2214
|
});
|
|
2401
2215
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
2402
2216
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
2403
|
-
var MessageTitle = /* @__PURE__ */
|
|
2217
|
+
var MessageTitle = /* @__PURE__ */ forwardRef20(({ asChild, className, children, ...props }, forwardedRef) => {
|
|
2404
2218
|
const { tx } = useThemeContext();
|
|
2405
2219
|
const { titleId } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
2406
2220
|
const Root5 = asChild ? Slot11 : Primitive10.h2;
|
|
2407
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ React28.createElement(Root5, {
|
|
2408
2222
|
...props,
|
|
2409
2223
|
className: tx("message.title", "message__title", {}, className),
|
|
2410
2224
|
id: titleId,
|
|
@@ -2413,11 +2227,11 @@ var MessageTitle = /* @__PURE__ */ forwardRef21(({ asChild, className, children,
|
|
|
2413
2227
|
});
|
|
2414
2228
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
2415
2229
|
var MESSAGE_BODY_NAME = "MessageBody";
|
|
2416
|
-
var MessageBody = /* @__PURE__ */
|
|
2230
|
+
var MessageBody = /* @__PURE__ */ forwardRef20(({ asChild, className, children, ...props }, forwardedRef) => {
|
|
2417
2231
|
const { tx } = useThemeContext();
|
|
2418
2232
|
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
2419
2233
|
const Root5 = asChild ? Slot11 : Primitive10.p;
|
|
2420
|
-
return /* @__PURE__ */
|
|
2234
|
+
return /* @__PURE__ */ React28.createElement(Root5, {
|
|
2421
2235
|
...props,
|
|
2422
2236
|
className: tx("message.body", "message__body", {}, className),
|
|
2423
2237
|
id: descriptionId,
|
|
@@ -2438,7 +2252,7 @@ import { createContextScope as createContextScope3 } from "@radix-ui/react-conte
|
|
|
2438
2252
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
2439
2253
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
2440
2254
|
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
2441
|
-
import { useId as
|
|
2255
|
+
import { useId as useId4 } from "@radix-ui/react-id";
|
|
2442
2256
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
2443
2257
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
2444
2258
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
@@ -2447,7 +2261,7 @@ import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
|
2447
2261
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
2448
2262
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2449
2263
|
import { hideOthers } from "aria-hidden";
|
|
2450
|
-
import
|
|
2264
|
+
import React29, { forwardRef as forwardRef21, useRef as useRef3, useCallback as useCallback8, useState as useState9, useEffect as useEffect6 } from "react";
|
|
2451
2265
|
import { RemoveScroll } from "react-remove-scroll";
|
|
2452
2266
|
var POPOVER_NAME = "Popover";
|
|
2453
2267
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -2465,9 +2279,9 @@ var PopoverRoot = (props) => {
|
|
|
2465
2279
|
defaultProp: defaultOpen,
|
|
2466
2280
|
onChange: onOpenChange
|
|
2467
2281
|
});
|
|
2468
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ React29.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React29.createElement(PopoverProvider, {
|
|
2469
2283
|
scope: __scopePopover,
|
|
2470
|
-
contentId:
|
|
2284
|
+
contentId: useId4(),
|
|
2471
2285
|
triggerRef,
|
|
2472
2286
|
open,
|
|
2473
2287
|
onOpenChange: setOpen,
|
|
@@ -2482,7 +2296,7 @@ var PopoverRoot = (props) => {
|
|
|
2482
2296
|
};
|
|
2483
2297
|
PopoverRoot.displayName = POPOVER_NAME;
|
|
2484
2298
|
var ANCHOR_NAME = "PopoverAnchor";
|
|
2485
|
-
var PopoverAnchor = /* @__PURE__ */
|
|
2299
|
+
var PopoverAnchor = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2486
2300
|
const { __scopePopover, ...anchorProps } = props;
|
|
2487
2301
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
2488
2302
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -2494,7 +2308,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2494
2308
|
onCustomAnchorAdd,
|
|
2495
2309
|
onCustomAnchorRemove
|
|
2496
2310
|
]);
|
|
2497
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ React29.createElement(PopperPrimitive.Anchor, {
|
|
2498
2312
|
...popperScope,
|
|
2499
2313
|
...anchorProps,
|
|
2500
2314
|
ref: forwardedRef
|
|
@@ -2502,12 +2316,12 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2502
2316
|
});
|
|
2503
2317
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
2504
2318
|
var TRIGGER_NAME2 = "PopoverTrigger";
|
|
2505
|
-
var PopoverTrigger = /* @__PURE__ */
|
|
2319
|
+
var PopoverTrigger = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2506
2320
|
const { __scopePopover, ...triggerProps } = props;
|
|
2507
2321
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
2508
2322
|
const popperScope = usePopperScope(__scopePopover);
|
|
2509
2323
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
2510
|
-
const trigger = /* @__PURE__ */
|
|
2324
|
+
const trigger = /* @__PURE__ */ React29.createElement(Primitive11.button, {
|
|
2511
2325
|
type: "button",
|
|
2512
2326
|
"aria-haspopup": "dialog",
|
|
2513
2327
|
"aria-expanded": context.open,
|
|
@@ -2517,7 +2331,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2517
2331
|
ref: composedTriggerRef,
|
|
2518
2332
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
2519
2333
|
});
|
|
2520
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
2334
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React29.createElement(PopperPrimitive.Anchor, {
|
|
2521
2335
|
asChild: true,
|
|
2522
2336
|
...popperScope
|
|
2523
2337
|
}, trigger);
|
|
@@ -2533,7 +2347,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
2533
2347
|
context.triggerRef.current = virtualRef.current;
|
|
2534
2348
|
}
|
|
2535
2349
|
});
|
|
2536
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ React29.createElement(PopperPrimitive.Anchor, {
|
|
2537
2351
|
...popperScope,
|
|
2538
2352
|
virtualRef
|
|
2539
2353
|
});
|
|
@@ -2546,34 +2360,34 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
2546
2360
|
var PopoverPortal = (props) => {
|
|
2547
2361
|
const { __scopePopover, forceMount, children, container } = props;
|
|
2548
2362
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
2549
|
-
return /* @__PURE__ */
|
|
2363
|
+
return /* @__PURE__ */ React29.createElement(PortalProvider, {
|
|
2550
2364
|
scope: __scopePopover,
|
|
2551
2365
|
forceMount
|
|
2552
|
-
}, /* @__PURE__ */
|
|
2366
|
+
}, /* @__PURE__ */ React29.createElement(Presence, {
|
|
2553
2367
|
present: forceMount || context.open
|
|
2554
|
-
}, /* @__PURE__ */
|
|
2368
|
+
}, /* @__PURE__ */ React29.createElement(PortalPrimitive, {
|
|
2555
2369
|
asChild: true,
|
|
2556
2370
|
container
|
|
2557
2371
|
}, children)));
|
|
2558
2372
|
};
|
|
2559
2373
|
PopoverPortal.displayName = PORTAL_NAME2;
|
|
2560
2374
|
var CONTENT_NAME2 = "PopoverContent";
|
|
2561
|
-
var PopoverContent = /* @__PURE__ */
|
|
2375
|
+
var PopoverContent = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2562
2376
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
2563
2377
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2564
2378
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2565
|
-
return /* @__PURE__ */
|
|
2379
|
+
return /* @__PURE__ */ React29.createElement(Presence, {
|
|
2566
2380
|
present: forceMount || context.open
|
|
2567
|
-
}, context.modal ? /* @__PURE__ */
|
|
2381
|
+
}, context.modal ? /* @__PURE__ */ React29.createElement(PopoverContentModal, {
|
|
2568
2382
|
...contentProps,
|
|
2569
2383
|
ref: forwardedRef
|
|
2570
|
-
}) : /* @__PURE__ */
|
|
2384
|
+
}) : /* @__PURE__ */ React29.createElement(PopoverContentNonModal, {
|
|
2571
2385
|
...contentProps,
|
|
2572
2386
|
ref: forwardedRef
|
|
2573
2387
|
}));
|
|
2574
2388
|
});
|
|
2575
2389
|
PopoverContent.displayName = CONTENT_NAME2;
|
|
2576
|
-
var PopoverContentModal = /* @__PURE__ */
|
|
2390
|
+
var PopoverContentModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2577
2391
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2578
2392
|
const contentRef = useRef3(null);
|
|
2579
2393
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
@@ -2584,10 +2398,10 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) =>
|
|
|
2584
2398
|
return hideOthers(content);
|
|
2585
2399
|
}
|
|
2586
2400
|
}, []);
|
|
2587
|
-
return /* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ React29.createElement(RemoveScroll, {
|
|
2588
2402
|
as: Slot12,
|
|
2589
2403
|
allowPinchZoom: true
|
|
2590
|
-
}, /* @__PURE__ */
|
|
2404
|
+
}, /* @__PURE__ */ React29.createElement(PopoverContentImpl, {
|
|
2591
2405
|
...props,
|
|
2592
2406
|
ref: composedRefs,
|
|
2593
2407
|
// we make sure we're not trapping once it's been closed
|
|
@@ -2615,11 +2429,11 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) =>
|
|
|
2615
2429
|
})
|
|
2616
2430
|
}));
|
|
2617
2431
|
});
|
|
2618
|
-
var PopoverContentNonModal = /* @__PURE__ */
|
|
2432
|
+
var PopoverContentNonModal = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2619
2433
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2620
2434
|
const hasInteractedOutsideRef = useRef3(false);
|
|
2621
2435
|
const hasPointerDownOutsideRef = useRef3(false);
|
|
2622
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ React29.createElement(PopoverContentImpl, {
|
|
2623
2437
|
...props,
|
|
2624
2438
|
ref: forwardedRef,
|
|
2625
2439
|
trapFocus: false,
|
|
@@ -2654,7 +2468,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef)
|
|
|
2654
2468
|
}
|
|
2655
2469
|
});
|
|
2656
2470
|
});
|
|
2657
|
-
var PopoverContentImpl = /* @__PURE__ */
|
|
2471
|
+
var PopoverContentImpl = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2658
2472
|
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, classNames, ...contentProps } = props;
|
|
2659
2473
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
2660
2474
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -2662,13 +2476,13 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2662
2476
|
const elevation = useElevationContext();
|
|
2663
2477
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2664
2478
|
useFocusGuards();
|
|
2665
|
-
return /* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ React29.createElement(FocusScope, {
|
|
2666
2480
|
asChild: true,
|
|
2667
2481
|
loop: true,
|
|
2668
2482
|
trapped: trapFocus,
|
|
2669
2483
|
onMountAutoFocus: onOpenAutoFocus,
|
|
2670
2484
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
2671
|
-
}, /* @__PURE__ */
|
|
2485
|
+
}, /* @__PURE__ */ React29.createElement(DismissableLayer, {
|
|
2672
2486
|
asChild: true,
|
|
2673
2487
|
disableOutsidePointerEvents,
|
|
2674
2488
|
onInteractOutside,
|
|
@@ -2676,7 +2490,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2676
2490
|
onPointerDownOutside,
|
|
2677
2491
|
onFocusOutside,
|
|
2678
2492
|
onDismiss: () => context.onOpenChange(false)
|
|
2679
|
-
}, /* @__PURE__ */
|
|
2493
|
+
}, /* @__PURE__ */ React29.createElement(PopperPrimitive.Content, {
|
|
2680
2494
|
"data-state": getState(context.open),
|
|
2681
2495
|
role: "dialog",
|
|
2682
2496
|
id: context.contentId,
|
|
@@ -2701,10 +2515,10 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2701
2515
|
})));
|
|
2702
2516
|
});
|
|
2703
2517
|
var CLOSE_NAME = "PopoverClose";
|
|
2704
|
-
var PopoverClose = /* @__PURE__ */
|
|
2518
|
+
var PopoverClose = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2705
2519
|
const { __scopePopover, ...closeProps } = props;
|
|
2706
2520
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
2707
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ React29.createElement(Primitive11.button, {
|
|
2708
2522
|
type: "button",
|
|
2709
2523
|
...closeProps,
|
|
2710
2524
|
ref: forwardedRef,
|
|
@@ -2713,11 +2527,11 @@ var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2713
2527
|
});
|
|
2714
2528
|
PopoverClose.displayName = CLOSE_NAME;
|
|
2715
2529
|
var ARROW_NAME2 = "PopoverArrow";
|
|
2716
|
-
var PopoverArrow = /* @__PURE__ */
|
|
2530
|
+
var PopoverArrow = /* @__PURE__ */ forwardRef21((props, forwardedRef) => {
|
|
2717
2531
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
2718
2532
|
const popperScope = usePopperScope(__scopePopover);
|
|
2719
2533
|
const { tx } = useThemeContext();
|
|
2720
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ React29.createElement(PopperPrimitive.Arrow, {
|
|
2721
2535
|
...popperScope,
|
|
2722
2536
|
...arrowProps,
|
|
2723
2537
|
className: tx("popover.arrow", "popover__arrow", {}, classNames),
|
|
@@ -2725,10 +2539,10 @@ var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2725
2539
|
});
|
|
2726
2540
|
});
|
|
2727
2541
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
2728
|
-
var PopoverViewport = /* @__PURE__ */
|
|
2542
|
+
var PopoverViewport = /* @__PURE__ */ forwardRef21(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
2729
2543
|
const { tx } = useThemeContext();
|
|
2730
2544
|
const Root5 = asChild ? Slot12 : Primitive11.div;
|
|
2731
|
-
return /* @__PURE__ */
|
|
2545
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2732
2546
|
...props,
|
|
2733
2547
|
className: tx("popover.viewport", "popover__viewport", {
|
|
2734
2548
|
constrainInline,
|
|
@@ -2751,10 +2565,10 @@ var Popover = {
|
|
|
2751
2565
|
};
|
|
2752
2566
|
|
|
2753
2567
|
// packages/ui/react-ui/src/components/Status/Status.tsx
|
|
2754
|
-
import
|
|
2755
|
-
var Status = /* @__PURE__ */
|
|
2568
|
+
import React30, { forwardRef as forwardRef22 } from "react";
|
|
2569
|
+
var Status = /* @__PURE__ */ forwardRef22(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
2756
2570
|
const { tx } = useThemeContext();
|
|
2757
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ React30.createElement("span", {
|
|
2758
2572
|
role: "status",
|
|
2759
2573
|
...props,
|
|
2760
2574
|
className: tx("status.root", "status", {
|
|
@@ -2762,7 +2576,7 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
2762
2576
|
variant
|
|
2763
2577
|
}, classNames),
|
|
2764
2578
|
ref: forwardedRef
|
|
2765
|
-
}, /* @__PURE__ */
|
|
2579
|
+
}, /* @__PURE__ */ React30.createElement("span", {
|
|
2766
2580
|
role: "none",
|
|
2767
2581
|
className: tx("status.bar", "status__bar", {
|
|
2768
2582
|
indeterminate,
|
|
@@ -2778,43 +2592,43 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
2778
2592
|
|
|
2779
2593
|
// packages/ui/react-ui/src/components/ScrollArea/ScrollArea.tsx
|
|
2780
2594
|
import { Root as ScrollAreaPrimitiveRoot, Viewport as ScrollAreaPrimitiveViewport, Scrollbar as ScrollAreaPrimitiveScrollbar, Thumb as ScrollAreaPrimitiveThumb, Corner as ScrollAreaPrimitiveCorner } from "@radix-ui/react-scroll-area";
|
|
2781
|
-
import
|
|
2782
|
-
var ScrollAreaRoot = /* @__PURE__ */
|
|
2595
|
+
import React31, { forwardRef as forwardRef23 } from "react";
|
|
2596
|
+
var ScrollAreaRoot = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
2783
2597
|
const { tx } = useThemeContext();
|
|
2784
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveRoot, {
|
|
2785
2599
|
...props,
|
|
2786
2600
|
className: tx("scrollArea.root", "scroll-area", {}, classNames),
|
|
2787
2601
|
ref: forwardedRef
|
|
2788
2602
|
});
|
|
2789
2603
|
});
|
|
2790
|
-
var ScrollAreaViewport = /* @__PURE__ */
|
|
2604
|
+
var ScrollAreaViewport = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
2791
2605
|
const { tx } = useThemeContext();
|
|
2792
|
-
return /* @__PURE__ */
|
|
2606
|
+
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveViewport, {
|
|
2793
2607
|
...props,
|
|
2794
2608
|
className: tx("scrollArea.viewport", "scroll-area", {}, classNames),
|
|
2795
2609
|
ref: forwardedRef
|
|
2796
2610
|
});
|
|
2797
2611
|
});
|
|
2798
|
-
var ScrollAreaScrollbar = /* @__PURE__ */
|
|
2612
|
+
var ScrollAreaScrollbar = /* @__PURE__ */ forwardRef23(({ classNames, variant = "fine", ...props }, forwardedRef) => {
|
|
2799
2613
|
const { tx } = useThemeContext();
|
|
2800
|
-
return /* @__PURE__ */
|
|
2614
|
+
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveScrollbar, {
|
|
2801
2615
|
"data-variant": variant,
|
|
2802
2616
|
...props,
|
|
2803
2617
|
className: tx("scrollArea.scrollbar", "scroll-area__scrollbar", {}, classNames),
|
|
2804
2618
|
ref: forwardedRef
|
|
2805
2619
|
});
|
|
2806
2620
|
});
|
|
2807
|
-
var ScrollAreaThumb = /* @__PURE__ */
|
|
2621
|
+
var ScrollAreaThumb = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
2808
2622
|
const { tx } = useThemeContext();
|
|
2809
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveThumb, {
|
|
2810
2624
|
...props,
|
|
2811
2625
|
className: tx("scrollArea.thumb", "scroll-area__thumb", {}, classNames),
|
|
2812
2626
|
ref: forwardedRef
|
|
2813
2627
|
});
|
|
2814
2628
|
});
|
|
2815
|
-
var ScrollAreaCorner = /* @__PURE__ */
|
|
2629
|
+
var ScrollAreaCorner = /* @__PURE__ */ forwardRef23(({ classNames, ...props }, forwardedRef) => {
|
|
2816
2630
|
const { tx } = useThemeContext();
|
|
2817
|
-
return /* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ React31.createElement(ScrollAreaPrimitiveCorner, {
|
|
2818
2632
|
...props,
|
|
2819
2633
|
className: tx("scrollArea.corner", "scroll-area__corner", {}, classNames),
|
|
2820
2634
|
ref: forwardedRef
|
|
@@ -2831,33 +2645,33 @@ var ScrollArea = {
|
|
|
2831
2645
|
// packages/ui/react-ui/src/components/Select/Select.tsx
|
|
2832
2646
|
import { CaretDown as CaretDown2, CaretUp } from "@phosphor-icons/react";
|
|
2833
2647
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2834
|
-
import
|
|
2648
|
+
import React32, { forwardRef as forwardRef24 } from "react";
|
|
2835
2649
|
var SelectRoot = SelectPrimitive.Root;
|
|
2836
2650
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
2837
2651
|
var SelectValue = SelectPrimitive.Value;
|
|
2838
2652
|
var SelectIcon = SelectPrimitive.Icon;
|
|
2839
2653
|
var SelectPortal = SelectPrimitive.Portal;
|
|
2840
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
2654
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef24(({ children, placeholder, ...props }, forwardedRef) => {
|
|
2841
2655
|
const { tx } = useThemeContext();
|
|
2842
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Trigger, {
|
|
2843
2657
|
asChild: true,
|
|
2844
2658
|
ref: forwardedRef
|
|
2845
|
-
}, /* @__PURE__ */
|
|
2659
|
+
}, /* @__PURE__ */ React32.createElement(Button, props, /* @__PURE__ */ React32.createElement(SelectPrimitive.Value, {
|
|
2846
2660
|
placeholder
|
|
2847
|
-
}, children), /* @__PURE__ */
|
|
2661
|
+
}, children), /* @__PURE__ */ React32.createElement("span", {
|
|
2848
2662
|
className: "w-1 flex-1"
|
|
2849
|
-
}), /* @__PURE__ */
|
|
2663
|
+
}), /* @__PURE__ */ React32.createElement(SelectPrimitive.Icon, {
|
|
2850
2664
|
asChild: true
|
|
2851
|
-
}, /* @__PURE__ */
|
|
2665
|
+
}, /* @__PURE__ */ React32.createElement(CaretDown2, {
|
|
2852
2666
|
className: tx("select.triggerIcon", "select__trigger__icon", {}),
|
|
2853
2667
|
weight: "bold"
|
|
2854
2668
|
}))));
|
|
2855
2669
|
});
|
|
2856
|
-
var SelectContent = /* @__PURE__ */
|
|
2670
|
+
var SelectContent = /* @__PURE__ */ forwardRef24(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
2857
2671
|
const { tx } = useThemeContext();
|
|
2858
2672
|
const elevation = useElevationContext();
|
|
2859
2673
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2860
|
-
return /* @__PURE__ */
|
|
2674
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Content, {
|
|
2861
2675
|
...props,
|
|
2862
2676
|
collisionPadding: safeCollisionPadding,
|
|
2863
2677
|
className: tx("select.content", "select__content", {
|
|
@@ -2867,76 +2681,76 @@ var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collis
|
|
|
2867
2681
|
ref: forwardedRef
|
|
2868
2682
|
}, children);
|
|
2869
2683
|
});
|
|
2870
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
2684
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
2871
2685
|
const { tx } = useThemeContext();
|
|
2872
|
-
return /* @__PURE__ */
|
|
2686
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
2873
2687
|
...props,
|
|
2874
2688
|
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
2875
2689
|
ref: forwardedRef
|
|
2876
|
-
}, children ?? /* @__PURE__ */
|
|
2690
|
+
}, children ?? /* @__PURE__ */ React32.createElement(CaretUp, {
|
|
2877
2691
|
weight: "bold"
|
|
2878
2692
|
}));
|
|
2879
2693
|
});
|
|
2880
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
2694
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
2881
2695
|
const { tx } = useThemeContext();
|
|
2882
|
-
return /* @__PURE__ */
|
|
2696
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
2883
2697
|
...props,
|
|
2884
2698
|
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
2885
2699
|
ref: forwardedRef
|
|
2886
|
-
}, children ?? /* @__PURE__ */
|
|
2700
|
+
}, children ?? /* @__PURE__ */ React32.createElement(CaretDown2, {
|
|
2887
2701
|
weight: "bold"
|
|
2888
2702
|
}));
|
|
2889
2703
|
});
|
|
2890
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
2704
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef24(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
2891
2705
|
const { tx } = useThemeContext();
|
|
2892
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.SelectViewport, {
|
|
2893
2707
|
...props,
|
|
2894
2708
|
className: tx("select.viewport", "select__viewport", {}, classNames),
|
|
2895
2709
|
ref: forwardedRef
|
|
2896
2710
|
}, children);
|
|
2897
2711
|
});
|
|
2898
|
-
var SelectItem = /* @__PURE__ */
|
|
2712
|
+
var SelectItem = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2899
2713
|
const { tx } = useThemeContext();
|
|
2900
|
-
return /* @__PURE__ */
|
|
2714
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Item, {
|
|
2901
2715
|
...props,
|
|
2902
2716
|
className: tx("select.item", "option", {}, classNames),
|
|
2903
2717
|
ref: forwardedRef
|
|
2904
2718
|
});
|
|
2905
2719
|
});
|
|
2906
2720
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
2907
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
2721
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef24(({ classNames, children, ...props }, forwardedRef) => {
|
|
2908
2722
|
const { tx } = useThemeContext();
|
|
2909
|
-
return /* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.ItemIndicator, {
|
|
2910
2724
|
...props,
|
|
2911
2725
|
className: tx("select.itemIndicator", "option__indicator", {}, classNames),
|
|
2912
2726
|
ref: forwardedRef
|
|
2913
2727
|
}, children);
|
|
2914
2728
|
});
|
|
2915
|
-
var SelectOption = /* @__PURE__ */
|
|
2729
|
+
var SelectOption = /* @__PURE__ */ forwardRef24(({ children, classNames, ...props }, forwardedRef) => {
|
|
2916
2730
|
const { tx } = useThemeContext();
|
|
2917
|
-
return /* @__PURE__ */
|
|
2731
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Item, {
|
|
2918
2732
|
...props,
|
|
2919
2733
|
className: tx("select.item", "option", {}, classNames),
|
|
2920
2734
|
ref: forwardedRef
|
|
2921
|
-
}, /* @__PURE__ */
|
|
2735
|
+
}, /* @__PURE__ */ React32.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React32.createElement("span", {
|
|
2922
2736
|
className: "grow w-1"
|
|
2923
|
-
}), /* @__PURE__ */
|
|
2737
|
+
}), /* @__PURE__ */ React32.createElement(Icon, {
|
|
2924
2738
|
icon: "ph--check--regular"
|
|
2925
2739
|
}));
|
|
2926
2740
|
});
|
|
2927
2741
|
var SelectGroup = SelectPrimitive.Group;
|
|
2928
2742
|
var SelectLabel = SelectPrimitive.Label;
|
|
2929
|
-
var SelectSeparator = /* @__PURE__ */
|
|
2743
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2930
2744
|
const { tx } = useThemeContext();
|
|
2931
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Separator, {
|
|
2932
2746
|
...props,
|
|
2933
2747
|
className: tx("select.separator", "select__separator", {}, classNames),
|
|
2934
2748
|
ref: forwardedRef
|
|
2935
2749
|
});
|
|
2936
2750
|
});
|
|
2937
|
-
var SelectArrow = /* @__PURE__ */
|
|
2751
|
+
var SelectArrow = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2938
2752
|
const { tx } = useThemeContext();
|
|
2939
|
-
return /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ React32.createElement(SelectPrimitive.Arrow, {
|
|
2940
2754
|
...props,
|
|
2941
2755
|
className: tx("select.arrow", "select__arrow", {}, classNames),
|
|
2942
2756
|
ref: forwardedRef
|
|
@@ -2965,10 +2779,10 @@ var Select = {
|
|
|
2965
2779
|
|
|
2966
2780
|
// packages/ui/react-ui/src/components/Separator/Separator.tsx
|
|
2967
2781
|
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
2968
|
-
import
|
|
2969
|
-
var Separator4 = /* @__PURE__ */
|
|
2782
|
+
import React33, { forwardRef as forwardRef25 } from "react";
|
|
2783
|
+
var Separator4 = /* @__PURE__ */ forwardRef25(({ classNames, orientation = "horizontal", ...props }, forwardedRef) => {
|
|
2970
2784
|
const { tx } = useThemeContext();
|
|
2971
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ React33.createElement(SeparatorPrimitive, {
|
|
2972
2786
|
orientation,
|
|
2973
2787
|
...props,
|
|
2974
2788
|
className: tx("separator.root", "separator", {
|
|
@@ -2981,11 +2795,11 @@ var Separator4 = /* @__PURE__ */ forwardRef26(({ classNames, orientation = "hori
|
|
|
2981
2795
|
// packages/ui/react-ui/src/components/Tag/Tag.tsx
|
|
2982
2796
|
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
2983
2797
|
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
2984
|
-
import
|
|
2985
|
-
var Tag = /* @__PURE__ */
|
|
2798
|
+
import React34, { forwardRef as forwardRef26 } from "react";
|
|
2799
|
+
var Tag = /* @__PURE__ */ forwardRef26(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
2986
2800
|
const { tx } = useThemeContext();
|
|
2987
2801
|
const Root5 = asChild ? Slot13 : Primitive12.span;
|
|
2988
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ React34.createElement(Root5, {
|
|
2989
2803
|
...props,
|
|
2990
2804
|
className: tx("tag.root", "dx-tag", {
|
|
2991
2805
|
palette
|
|
@@ -2999,56 +2813,56 @@ var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNam
|
|
|
2999
2813
|
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
3000
2814
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
3001
2815
|
import { ToastProvider as ToastProviderPrimitive, ToastViewport as ToastViewportPrimitive, Root as ToastRootPrimitive, ToastTitle as ToastTitlePrimitive, ToastDescription as ToastDescriptionPrimitive, ToastAction as ToastActionPrimitive, ToastClose as ToastClosePrimitive } from "@radix-ui/react-toast";
|
|
3002
|
-
import
|
|
2816
|
+
import React35, { forwardRef as forwardRef27 } from "react";
|
|
3003
2817
|
var ToastProvider = ToastProviderPrimitive;
|
|
3004
|
-
var ToastViewport = /* @__PURE__ */
|
|
2818
|
+
var ToastViewport = /* @__PURE__ */ forwardRef27(({ classNames, ...props }, forwardedRef) => {
|
|
3005
2819
|
const { tx } = useThemeContext();
|
|
3006
|
-
return /* @__PURE__ */
|
|
2820
|
+
return /* @__PURE__ */ React35.createElement(ToastViewportPrimitive, {
|
|
3007
2821
|
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
3008
2822
|
ref: forwardedRef
|
|
3009
2823
|
});
|
|
3010
2824
|
});
|
|
3011
|
-
var ToastRoot = /* @__PURE__ */
|
|
2825
|
+
var ToastRoot = /* @__PURE__ */ forwardRef27(({ classNames, children, ...props }, forwardedRef) => {
|
|
3012
2826
|
const { tx } = useThemeContext();
|
|
3013
|
-
return /* @__PURE__ */
|
|
2827
|
+
return /* @__PURE__ */ React35.createElement(ToastRootPrimitive, {
|
|
3014
2828
|
...props,
|
|
3015
2829
|
className: tx("toast.root", "toast", {}, classNames),
|
|
3016
2830
|
ref: forwardedRef
|
|
3017
|
-
}, /* @__PURE__ */
|
|
2831
|
+
}, /* @__PURE__ */ React35.createElement(ElevationProvider, {
|
|
3018
2832
|
elevation: "toast"
|
|
3019
2833
|
}, children));
|
|
3020
2834
|
});
|
|
3021
|
-
var ToastBody = /* @__PURE__ */
|
|
2835
|
+
var ToastBody = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3022
2836
|
const { tx } = useThemeContext();
|
|
3023
2837
|
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
3024
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ React35.createElement(Root5, {
|
|
3025
2839
|
...props,
|
|
3026
2840
|
className: tx("toast.body", "toast__body", {}, classNames),
|
|
3027
2841
|
ref: forwardedRef
|
|
3028
2842
|
});
|
|
3029
2843
|
});
|
|
3030
|
-
var ToastTitle = /* @__PURE__ */
|
|
2844
|
+
var ToastTitle = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3031
2845
|
const { tx } = useThemeContext();
|
|
3032
2846
|
const Root5 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
3033
|
-
return /* @__PURE__ */
|
|
2847
|
+
return /* @__PURE__ */ React35.createElement(Root5, {
|
|
3034
2848
|
...props,
|
|
3035
2849
|
className: tx("toast.title", "toast__title", {}, classNames),
|
|
3036
2850
|
ref: forwardedRef
|
|
3037
2851
|
});
|
|
3038
2852
|
});
|
|
3039
|
-
var ToastDescription = /* @__PURE__ */
|
|
2853
|
+
var ToastDescription = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3040
2854
|
const { tx } = useThemeContext();
|
|
3041
2855
|
const Root5 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
3042
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ React35.createElement(Root5, {
|
|
3043
2857
|
...props,
|
|
3044
2858
|
className: tx("toast.description", "toast__description", {}, classNames),
|
|
3045
2859
|
ref: forwardedRef
|
|
3046
2860
|
});
|
|
3047
2861
|
});
|
|
3048
|
-
var ToastActions = /* @__PURE__ */
|
|
2862
|
+
var ToastActions = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3049
2863
|
const { tx } = useThemeContext();
|
|
3050
2864
|
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
3051
|
-
return /* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ React35.createElement(Root5, {
|
|
3052
2866
|
...props,
|
|
3053
2867
|
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
3054
2868
|
ref: forwardedRef
|
|
@@ -3070,63 +2884,63 @@ var Toast = {
|
|
|
3070
2884
|
|
|
3071
2885
|
// packages/ui/react-ui/src/components/Toolbar/Toolbar.tsx
|
|
3072
2886
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
3073
|
-
import
|
|
3074
|
-
var ToolbarRoot = /* @__PURE__ */
|
|
2887
|
+
import React36, { forwardRef as forwardRef28 } from "react";
|
|
2888
|
+
var ToolbarRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
3075
2889
|
const { tx } = useThemeContext();
|
|
3076
|
-
return /* @__PURE__ */
|
|
2890
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Root, {
|
|
3077
2891
|
...props,
|
|
3078
2892
|
className: tx("toolbar.root", "toolbar", {}, classNames),
|
|
3079
2893
|
ref: forwardedRef
|
|
3080
2894
|
}, children);
|
|
3081
2895
|
});
|
|
3082
|
-
var ToolbarButton = /* @__PURE__ */
|
|
3083
|
-
return /* @__PURE__ */
|
|
2896
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
2897
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Button, {
|
|
3084
2898
|
asChild: true
|
|
3085
|
-
}, /* @__PURE__ */
|
|
2899
|
+
}, /* @__PURE__ */ React36.createElement(Button, {
|
|
3086
2900
|
...props,
|
|
3087
2901
|
ref: forwardedRef
|
|
3088
2902
|
}));
|
|
3089
2903
|
});
|
|
3090
|
-
var ToolbarIconButton = /* @__PURE__ */
|
|
3091
|
-
return /* @__PURE__ */
|
|
2904
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
2905
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Button, {
|
|
3092
2906
|
asChild: true
|
|
3093
|
-
}, /* @__PURE__ */
|
|
2907
|
+
}, /* @__PURE__ */ React36.createElement(IconButton, {
|
|
3094
2908
|
...props,
|
|
3095
2909
|
ref: forwardedRef
|
|
3096
2910
|
}));
|
|
3097
2911
|
});
|
|
3098
|
-
var ToolbarToggle = /* @__PURE__ */
|
|
3099
|
-
return /* @__PURE__ */
|
|
2912
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
2913
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Button, {
|
|
3100
2914
|
asChild: true
|
|
3101
|
-
}, /* @__PURE__ */
|
|
2915
|
+
}, /* @__PURE__ */ React36.createElement(Toggle, {
|
|
3102
2916
|
...props,
|
|
3103
2917
|
ref: forwardedRef
|
|
3104
2918
|
}));
|
|
3105
2919
|
});
|
|
3106
|
-
var ToolbarLink = /* @__PURE__ */
|
|
3107
|
-
return /* @__PURE__ */
|
|
2920
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
2921
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Link, {
|
|
3108
2922
|
asChild: true
|
|
3109
|
-
}, /* @__PURE__ */
|
|
2923
|
+
}, /* @__PURE__ */ React36.createElement(Link, {
|
|
3110
2924
|
...props,
|
|
3111
2925
|
ref: forwardedRef
|
|
3112
2926
|
}));
|
|
3113
2927
|
});
|
|
3114
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
3115
|
-
return /* @__PURE__ */
|
|
2928
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef28(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
2929
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
3116
2930
|
...props,
|
|
3117
2931
|
asChild: true
|
|
3118
|
-
}, /* @__PURE__ */
|
|
2932
|
+
}, /* @__PURE__ */ React36.createElement(ButtonGroup, {
|
|
3119
2933
|
classNames,
|
|
3120
2934
|
children,
|
|
3121
2935
|
elevation,
|
|
3122
2936
|
ref: forwardedRef
|
|
3123
2937
|
}));
|
|
3124
2938
|
});
|
|
3125
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
3126
|
-
return /* @__PURE__ */
|
|
2939
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef28(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
2940
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
3127
2941
|
...props,
|
|
3128
2942
|
asChild: true
|
|
3129
|
-
}, /* @__PURE__ */
|
|
2943
|
+
}, /* @__PURE__ */ React36.createElement(Button, {
|
|
3130
2944
|
variant,
|
|
3131
2945
|
density,
|
|
3132
2946
|
elevation,
|
|
@@ -3135,11 +2949,11 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef29(({ variant, density, e
|
|
|
3135
2949
|
ref: forwardedRef
|
|
3136
2950
|
}));
|
|
3137
2951
|
});
|
|
3138
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */
|
|
3139
|
-
return /* @__PURE__ */
|
|
2952
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef28(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
2953
|
+
return /* @__PURE__ */ React36.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
3140
2954
|
...props,
|
|
3141
2955
|
asChild: true
|
|
3142
|
-
}, /* @__PURE__ */
|
|
2956
|
+
}, /* @__PURE__ */ React36.createElement(IconButton, {
|
|
3143
2957
|
variant,
|
|
3144
2958
|
density,
|
|
3145
2959
|
elevation,
|
|
@@ -3150,13 +2964,13 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef29(({ variant, densit
|
|
|
3150
2964
|
ref: forwardedRef
|
|
3151
2965
|
}));
|
|
3152
2966
|
});
|
|
3153
|
-
var ToolbarSeparator = /* @__PURE__ */
|
|
3154
|
-
return variant === "line" ? /* @__PURE__ */
|
|
2967
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef28(({ variant = "line", ...props }, forwardedRef) => {
|
|
2968
|
+
return variant === "line" ? /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Separator, {
|
|
3155
2969
|
asChild: true
|
|
3156
|
-
}, /* @__PURE__ */
|
|
2970
|
+
}, /* @__PURE__ */ React36.createElement(Separator4, {
|
|
3157
2971
|
...props,
|
|
3158
2972
|
ref: forwardedRef
|
|
3159
|
-
})) : /* @__PURE__ */
|
|
2973
|
+
})) : /* @__PURE__ */ React36.createElement(ToolbarPrimitive.Separator, {
|
|
3160
2974
|
className: "grow",
|
|
3161
2975
|
ref: forwardedRef
|
|
3162
2976
|
});
|
|
@@ -3176,8 +2990,6 @@ export {
|
|
|
3176
2990
|
AlertDialog,
|
|
3177
2991
|
AnchoredOverflow,
|
|
3178
2992
|
Avatar,
|
|
3179
|
-
AvatarGroup,
|
|
3180
|
-
AvatarGroupItem,
|
|
3181
2993
|
BUTTON_GROUP_NAME,
|
|
3182
2994
|
Breadcrumb,
|
|
3183
2995
|
Button,
|
|
@@ -3231,6 +3043,7 @@ export {
|
|
|
3231
3043
|
useDropdownMenuContext,
|
|
3232
3044
|
useDropdownMenuMenuScope,
|
|
3233
3045
|
useElevationContext,
|
|
3046
|
+
useIconHref,
|
|
3234
3047
|
useLandmarkMover,
|
|
3235
3048
|
useListContext,
|
|
3236
3049
|
useListItemContext,
|