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