@geomak/ui 5.0.3 → 5.1.0
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/index.cjs +490 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +315 -7
- package/dist/index.d.ts +315 -7
- package/dist/index.js +485 -21
- package/dist/index.js.map +1 -1
- package/dist/styles.css +158 -7
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } fr
|
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import React8, { createContext, useState, useEffect, useMemo, useCallback, useContext, useRef, useId, useLayoutEffect } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
6
7
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
7
8
|
import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
|
|
8
9
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -185,6 +186,417 @@ function Portal({ children, target }) {
|
|
|
185
186
|
}, [target]);
|
|
186
187
|
return resolved ? createPortal(children, resolved) : null;
|
|
187
188
|
}
|
|
189
|
+
var SPACING_MAP = {
|
|
190
|
+
"none": "0",
|
|
191
|
+
"xs": "1",
|
|
192
|
+
"sm": "2",
|
|
193
|
+
"md": "4",
|
|
194
|
+
"lg": "6",
|
|
195
|
+
"xl": "8",
|
|
196
|
+
"2xl": "12"
|
|
197
|
+
};
|
|
198
|
+
var padding = (s, axis = "p") => s == null ? "" : `${axis}-${SPACING_MAP[s]}`;
|
|
199
|
+
var margin = (s, axis = "m") => s == null ? "" : `${axis}-${SPACING_MAP[s]}`;
|
|
200
|
+
var BG_MAP = {
|
|
201
|
+
"none": "",
|
|
202
|
+
"background": "bg-background",
|
|
203
|
+
"surface": "bg-surface",
|
|
204
|
+
"surface-raised": "bg-surface-raised",
|
|
205
|
+
"accent": "bg-accent text-accent-fg"
|
|
206
|
+
};
|
|
207
|
+
var BORDER_MAP = {
|
|
208
|
+
"none": "",
|
|
209
|
+
"border": "border border-border",
|
|
210
|
+
"border-strong": "border border-border-strong",
|
|
211
|
+
"accent": "border border-accent",
|
|
212
|
+
"status-error": "border border-status-error"
|
|
213
|
+
};
|
|
214
|
+
var RADIUS_MAP = {
|
|
215
|
+
"none": "rounded-none",
|
|
216
|
+
"sm": "rounded-sm",
|
|
217
|
+
"md": "rounded-md",
|
|
218
|
+
"lg": "rounded-lg",
|
|
219
|
+
"xl": "rounded-xl",
|
|
220
|
+
"2xl": "rounded-2xl",
|
|
221
|
+
"full": "rounded-full"
|
|
222
|
+
};
|
|
223
|
+
var SHADOW_MAP = {
|
|
224
|
+
"none": "",
|
|
225
|
+
"sm": "shadow-sm",
|
|
226
|
+
"md": "shadow-md",
|
|
227
|
+
"lg": "shadow-lg",
|
|
228
|
+
"xl": "shadow-xl"
|
|
229
|
+
};
|
|
230
|
+
function Box({
|
|
231
|
+
as,
|
|
232
|
+
p,
|
|
233
|
+
px: px2,
|
|
234
|
+
py,
|
|
235
|
+
pt,
|
|
236
|
+
pr,
|
|
237
|
+
pb,
|
|
238
|
+
pl,
|
|
239
|
+
m,
|
|
240
|
+
mx,
|
|
241
|
+
my,
|
|
242
|
+
mt,
|
|
243
|
+
mr,
|
|
244
|
+
mb,
|
|
245
|
+
ml,
|
|
246
|
+
background = "none",
|
|
247
|
+
border = "none",
|
|
248
|
+
radius,
|
|
249
|
+
shadow = "none",
|
|
250
|
+
width,
|
|
251
|
+
height,
|
|
252
|
+
onClick,
|
|
253
|
+
className = "",
|
|
254
|
+
style,
|
|
255
|
+
children
|
|
256
|
+
}) {
|
|
257
|
+
const Element = as ?? "div";
|
|
258
|
+
return /* @__PURE__ */ jsx(
|
|
259
|
+
Element,
|
|
260
|
+
{
|
|
261
|
+
onClick,
|
|
262
|
+
className: [
|
|
263
|
+
padding(p, "p"),
|
|
264
|
+
padding(px2, "px"),
|
|
265
|
+
padding(py, "py"),
|
|
266
|
+
padding(pt, "pt"),
|
|
267
|
+
padding(pr, "pr"),
|
|
268
|
+
padding(pb, "pb"),
|
|
269
|
+
padding(pl, "pl"),
|
|
270
|
+
margin(m, "m"),
|
|
271
|
+
margin(mx, "mx"),
|
|
272
|
+
margin(my, "my"),
|
|
273
|
+
margin(mt, "mt"),
|
|
274
|
+
margin(mr, "mr"),
|
|
275
|
+
margin(mb, "mb"),
|
|
276
|
+
margin(ml, "ml"),
|
|
277
|
+
BG_MAP[background],
|
|
278
|
+
BORDER_MAP[border],
|
|
279
|
+
radius ? RADIUS_MAP[radius] : "",
|
|
280
|
+
SHADOW_MAP[shadow],
|
|
281
|
+
className
|
|
282
|
+
].filter(Boolean).join(" "),
|
|
283
|
+
style: {
|
|
284
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
285
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
286
|
+
...style
|
|
287
|
+
},
|
|
288
|
+
children
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
var GAP_MAP = {
|
|
293
|
+
"none": "gap-0",
|
|
294
|
+
"xs": "gap-1",
|
|
295
|
+
"sm": "gap-2",
|
|
296
|
+
"md": "gap-4",
|
|
297
|
+
"lg": "gap-6",
|
|
298
|
+
"xl": "gap-8",
|
|
299
|
+
"2xl": "gap-12"
|
|
300
|
+
};
|
|
301
|
+
var DIRECTION_CLASS = {
|
|
302
|
+
"row": "flex-row",
|
|
303
|
+
"row-reverse": "flex-row-reverse",
|
|
304
|
+
"col": "flex-col",
|
|
305
|
+
"col-reverse": "flex-col-reverse"
|
|
306
|
+
};
|
|
307
|
+
var ALIGN_CLASS = {
|
|
308
|
+
start: "items-start",
|
|
309
|
+
center: "items-center",
|
|
310
|
+
end: "items-end",
|
|
311
|
+
stretch: "items-stretch",
|
|
312
|
+
baseline: "items-baseline"
|
|
313
|
+
};
|
|
314
|
+
var JUSTIFY_CLASS = {
|
|
315
|
+
start: "justify-start",
|
|
316
|
+
center: "justify-center",
|
|
317
|
+
end: "justify-end",
|
|
318
|
+
between: "justify-between",
|
|
319
|
+
around: "justify-around",
|
|
320
|
+
evenly: "justify-evenly"
|
|
321
|
+
};
|
|
322
|
+
var WRAP_CLASS = {
|
|
323
|
+
"nowrap": "flex-nowrap",
|
|
324
|
+
"wrap": "flex-wrap",
|
|
325
|
+
"wrap-reverse": "flex-wrap-reverse"
|
|
326
|
+
};
|
|
327
|
+
function Flex({
|
|
328
|
+
direction = "row",
|
|
329
|
+
align,
|
|
330
|
+
justify,
|
|
331
|
+
wrap,
|
|
332
|
+
gap,
|
|
333
|
+
inline,
|
|
334
|
+
className = "",
|
|
335
|
+
...boxProps
|
|
336
|
+
}) {
|
|
337
|
+
return /* @__PURE__ */ jsx(
|
|
338
|
+
Box,
|
|
339
|
+
{
|
|
340
|
+
...boxProps,
|
|
341
|
+
className: [
|
|
342
|
+
inline ? "inline-flex" : "flex",
|
|
343
|
+
DIRECTION_CLASS[direction],
|
|
344
|
+
align ? ALIGN_CLASS[align] : "",
|
|
345
|
+
justify ? JUSTIFY_CLASS[justify] : "",
|
|
346
|
+
wrap ? WRAP_CLASS[wrap] : "",
|
|
347
|
+
gap ? GAP_MAP[gap] : "",
|
|
348
|
+
className
|
|
349
|
+
].filter(Boolean).join(" ")
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
var GAP_MAP2 = {
|
|
354
|
+
"none": "gap-0",
|
|
355
|
+
"xs": "gap-1",
|
|
356
|
+
"sm": "gap-2",
|
|
357
|
+
"md": "gap-4",
|
|
358
|
+
"lg": "gap-6",
|
|
359
|
+
"xl": "gap-8",
|
|
360
|
+
"2xl": "gap-12"
|
|
361
|
+
};
|
|
362
|
+
var COL_MAP = {
|
|
363
|
+
1: "grid-cols-1",
|
|
364
|
+
2: "grid-cols-2",
|
|
365
|
+
3: "grid-cols-3",
|
|
366
|
+
4: "grid-cols-4",
|
|
367
|
+
5: "grid-cols-5",
|
|
368
|
+
6: "grid-cols-6",
|
|
369
|
+
7: "grid-cols-7",
|
|
370
|
+
8: "grid-cols-8",
|
|
371
|
+
9: "grid-cols-9",
|
|
372
|
+
10: "grid-cols-10",
|
|
373
|
+
11: "grid-cols-11",
|
|
374
|
+
12: "grid-cols-12"
|
|
375
|
+
};
|
|
376
|
+
var ROW_MAP = {
|
|
377
|
+
1: "grid-rows-1",
|
|
378
|
+
2: "grid-rows-2",
|
|
379
|
+
3: "grid-rows-3",
|
|
380
|
+
4: "grid-rows-4",
|
|
381
|
+
5: "grid-rows-5",
|
|
382
|
+
6: "grid-rows-6"
|
|
383
|
+
};
|
|
384
|
+
var ALIGN_CLASS2 = {
|
|
385
|
+
start: "items-start",
|
|
386
|
+
center: "items-center",
|
|
387
|
+
end: "items-end",
|
|
388
|
+
stretch: "items-stretch"
|
|
389
|
+
};
|
|
390
|
+
var JUSTIFY_CLASS2 = {
|
|
391
|
+
start: "justify-items-start",
|
|
392
|
+
center: "justify-items-center",
|
|
393
|
+
end: "justify-items-end",
|
|
394
|
+
stretch: "justify-items-stretch"
|
|
395
|
+
};
|
|
396
|
+
function Grid2({
|
|
397
|
+
cols,
|
|
398
|
+
rows,
|
|
399
|
+
gap,
|
|
400
|
+
gapX,
|
|
401
|
+
gapY,
|
|
402
|
+
align,
|
|
403
|
+
justify,
|
|
404
|
+
className = "",
|
|
405
|
+
style,
|
|
406
|
+
...boxProps
|
|
407
|
+
}) {
|
|
408
|
+
const colClass = typeof cols === "number" ? COL_MAP[cols] ?? "" : "";
|
|
409
|
+
const rowClass = typeof rows === "number" ? ROW_MAP[rows] ?? "" : "";
|
|
410
|
+
const inlineCols = typeof cols === "string" ? cols : void 0;
|
|
411
|
+
const inlineRows = typeof rows === "string" ? rows : void 0;
|
|
412
|
+
return /* @__PURE__ */ jsx(
|
|
413
|
+
Box,
|
|
414
|
+
{
|
|
415
|
+
...boxProps,
|
|
416
|
+
className: [
|
|
417
|
+
"grid",
|
|
418
|
+
colClass,
|
|
419
|
+
rowClass,
|
|
420
|
+
gap ? GAP_MAP2[gap] : "",
|
|
421
|
+
gapX ? GAP_MAP2[gapX].replace("gap-", "gap-x-") : "",
|
|
422
|
+
gapY ? GAP_MAP2[gapY].replace("gap-", "gap-y-") : "",
|
|
423
|
+
align ? ALIGN_CLASS2[align] : "",
|
|
424
|
+
justify ? JUSTIFY_CLASS2[justify] : "",
|
|
425
|
+
className
|
|
426
|
+
].filter(Boolean).join(" "),
|
|
427
|
+
style: {
|
|
428
|
+
gridTemplateColumns: inlineCols,
|
|
429
|
+
gridTemplateRows: inlineRows,
|
|
430
|
+
...style
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
var SIZE_PX = {
|
|
436
|
+
xs: 20,
|
|
437
|
+
sm: 28,
|
|
438
|
+
md: 36,
|
|
439
|
+
lg: 48,
|
|
440
|
+
xl: 64
|
|
441
|
+
};
|
|
442
|
+
var TEXT_CLASS = {
|
|
443
|
+
xs: "text-[10px]",
|
|
444
|
+
sm: "text-xs",
|
|
445
|
+
md: "text-sm",
|
|
446
|
+
lg: "text-base",
|
|
447
|
+
xl: "text-lg"
|
|
448
|
+
};
|
|
449
|
+
var STATUS_CLASS = {
|
|
450
|
+
online: "bg-status-success",
|
|
451
|
+
offline: "bg-foreground-muted",
|
|
452
|
+
away: "bg-status-warning",
|
|
453
|
+
busy: "bg-status-error"
|
|
454
|
+
};
|
|
455
|
+
function Avatar({
|
|
456
|
+
src,
|
|
457
|
+
alt,
|
|
458
|
+
fallback,
|
|
459
|
+
size = "md",
|
|
460
|
+
shape = "circle",
|
|
461
|
+
status,
|
|
462
|
+
className = ""
|
|
463
|
+
}) {
|
|
464
|
+
const px2 = SIZE_PX[size];
|
|
465
|
+
const initialsFallback = (() => {
|
|
466
|
+
if (fallback) return fallback;
|
|
467
|
+
if (alt) {
|
|
468
|
+
const parts = alt.trim().split(/\s+/).slice(0, 2);
|
|
469
|
+
const initials = parts.map((p) => p[0]?.toUpperCase() ?? "").join("");
|
|
470
|
+
if (initials) return initials;
|
|
471
|
+
}
|
|
472
|
+
return /* @__PURE__ */ jsx(PersonSilhouette, {});
|
|
473
|
+
})();
|
|
474
|
+
return /* @__PURE__ */ jsxs(
|
|
475
|
+
"span",
|
|
476
|
+
{
|
|
477
|
+
className: `relative inline-block flex-shrink-0 ${className}`,
|
|
478
|
+
style: { width: px2, height: px2 },
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ jsxs(
|
|
481
|
+
AvatarPrimitive.Root,
|
|
482
|
+
{
|
|
483
|
+
className: `flex w-full h-full items-center justify-center overflow-hidden bg-surface-raised text-foreground-secondary select-none ${shape === "circle" ? "rounded-full" : "rounded-md"}`,
|
|
484
|
+
children: [
|
|
485
|
+
src && /* @__PURE__ */ jsx(
|
|
486
|
+
AvatarPrimitive.Image,
|
|
487
|
+
{
|
|
488
|
+
src,
|
|
489
|
+
alt: alt ?? "",
|
|
490
|
+
className: "h-full w-full object-cover"
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ jsx(
|
|
494
|
+
AvatarPrimitive.Fallback,
|
|
495
|
+
{
|
|
496
|
+
delayMs: src ? 300 : 0,
|
|
497
|
+
className: `flex h-full w-full items-center justify-center font-semibold ${TEXT_CLASS[size]}`,
|
|
498
|
+
children: initialsFallback
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
),
|
|
504
|
+
status && /* @__PURE__ */ jsx(
|
|
505
|
+
"span",
|
|
506
|
+
{
|
|
507
|
+
className: `absolute bottom-0 right-0 block rounded-full ring-2 ring-background ${STATUS_CLASS[status]}`,
|
|
508
|
+
style: {
|
|
509
|
+
width: Math.max(6, Math.round(px2 / 4)),
|
|
510
|
+
height: Math.max(6, Math.round(px2 / 4))
|
|
511
|
+
},
|
|
512
|
+
"aria-label": `Status: ${status}`,
|
|
513
|
+
role: "status"
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
function PersonSilhouette() {
|
|
521
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "w-[60%] h-[60%]", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 12a4 4 0 100-8 4 4 0 000 8zM4 20a8 8 0 1116 0H4z" }) });
|
|
522
|
+
}
|
|
523
|
+
var VARIANT_CLASS = {
|
|
524
|
+
display: "text-3xl font-bold leading-tight tracking-tight",
|
|
525
|
+
h1: "text-2xl font-bold leading-tight tracking-tight",
|
|
526
|
+
h2: "text-xl font-semibold leading-snug tracking-tight",
|
|
527
|
+
h3: "text-lg font-semibold leading-snug",
|
|
528
|
+
h4: "text-base font-semibold leading-snug",
|
|
529
|
+
subtitle: "text-sm font-medium leading-snug",
|
|
530
|
+
body: "text-sm leading-normal",
|
|
531
|
+
caption: "text-xs leading-normal",
|
|
532
|
+
overline: "text-[10px] font-semibold leading-normal uppercase tracking-wider",
|
|
533
|
+
code: "text-xs leading-normal font-mono bg-surface-raised text-foreground rounded px-1 py-0.5"
|
|
534
|
+
};
|
|
535
|
+
var DEFAULT_ELEMENT = {
|
|
536
|
+
display: "h1",
|
|
537
|
+
h1: "h1",
|
|
538
|
+
h2: "h2",
|
|
539
|
+
h3: "h3",
|
|
540
|
+
h4: "h4",
|
|
541
|
+
subtitle: "p",
|
|
542
|
+
body: "p",
|
|
543
|
+
caption: "span",
|
|
544
|
+
overline: "span",
|
|
545
|
+
code: "code"
|
|
546
|
+
};
|
|
547
|
+
var COLOR_CLASS = {
|
|
548
|
+
"foreground": "text-foreground",
|
|
549
|
+
"foreground-secondary": "text-foreground-secondary",
|
|
550
|
+
"foreground-muted": "text-foreground-muted",
|
|
551
|
+
"accent": "text-accent",
|
|
552
|
+
"status-error": "text-status-error",
|
|
553
|
+
"status-warning": "text-status-warning",
|
|
554
|
+
"status-success": "text-status-success",
|
|
555
|
+
"status-info": "text-status-info",
|
|
556
|
+
"inherit": ""
|
|
557
|
+
};
|
|
558
|
+
var WEIGHT_CLASS = {
|
|
559
|
+
normal: "font-normal",
|
|
560
|
+
medium: "font-medium",
|
|
561
|
+
semibold: "font-semibold",
|
|
562
|
+
bold: "font-bold"
|
|
563
|
+
};
|
|
564
|
+
var ALIGN_CLASS3 = {
|
|
565
|
+
left: "text-left",
|
|
566
|
+
center: "text-center",
|
|
567
|
+
right: "text-right",
|
|
568
|
+
justify: "text-justify"
|
|
569
|
+
};
|
|
570
|
+
function Typography({
|
|
571
|
+
variant = "body",
|
|
572
|
+
as,
|
|
573
|
+
color = "inherit",
|
|
574
|
+
weight,
|
|
575
|
+
align,
|
|
576
|
+
truncate,
|
|
577
|
+
muted,
|
|
578
|
+
className = "",
|
|
579
|
+
style,
|
|
580
|
+
children
|
|
581
|
+
}) {
|
|
582
|
+
const Element = as ?? DEFAULT_ELEMENT[variant];
|
|
583
|
+
return /* @__PURE__ */ jsx(
|
|
584
|
+
Element,
|
|
585
|
+
{
|
|
586
|
+
className: [
|
|
587
|
+
VARIANT_CLASS[variant],
|
|
588
|
+
COLOR_CLASS[color],
|
|
589
|
+
weight ? WEIGHT_CLASS[weight] : "",
|
|
590
|
+
align ? ALIGN_CLASS3[align] : "",
|
|
591
|
+
truncate ? "truncate" : "",
|
|
592
|
+
muted ? "opacity-60" : "",
|
|
593
|
+
className
|
|
594
|
+
].filter(Boolean).join(" "),
|
|
595
|
+
style,
|
|
596
|
+
children
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
188
600
|
function IconButton({
|
|
189
601
|
icon,
|
|
190
602
|
onClick,
|
|
@@ -1105,30 +1517,53 @@ function FadingBase({
|
|
|
1105
1517
|
)
|
|
1106
1518
|
);
|
|
1107
1519
|
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1520
|
+
var DENSITY_PADDING = {
|
|
1521
|
+
"compact": "py-1.5 px-2",
|
|
1522
|
+
"comfortable": "py-2.5 px-3",
|
|
1523
|
+
"spacious": "py-3.5 px-4"
|
|
1524
|
+
};
|
|
1525
|
+
function List2({
|
|
1526
|
+
items,
|
|
1527
|
+
onItemClick,
|
|
1528
|
+
activeKey,
|
|
1529
|
+
density = "comfortable"
|
|
1530
|
+
}) {
|
|
1531
|
+
return /* @__PURE__ */ jsx("div", { role: "listbox", className: "flex flex-col", children: items.map((item) => {
|
|
1532
|
+
const isActive = activeKey === item.key;
|
|
1533
|
+
const isDisabled = !!item.disabled;
|
|
1534
|
+
return /* @__PURE__ */ jsxs(
|
|
1114
1535
|
"div",
|
|
1115
1536
|
{
|
|
1116
1537
|
role: "option",
|
|
1117
|
-
"aria-selected":
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
onClick: () => onItemClick(item),
|
|
1538
|
+
"aria-selected": isActive,
|
|
1539
|
+
"aria-disabled": isDisabled || void 0,
|
|
1540
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
1541
|
+
onClick: () => !isDisabled && onItemClick(item),
|
|
1121
1542
|
onKeyDown: (e) => {
|
|
1543
|
+
if (isDisabled) return;
|
|
1122
1544
|
if (e.key === "Enter" || e.key === " ") {
|
|
1123
1545
|
e.preventDefault();
|
|
1124
1546
|
onItemClick(item);
|
|
1125
1547
|
}
|
|
1126
1548
|
},
|
|
1127
|
-
|
|
1549
|
+
className: [
|
|
1550
|
+
"flex items-center gap-3 cursor-pointer border-b border-border transition-colors duration-150",
|
|
1551
|
+
DENSITY_PADDING[density],
|
|
1552
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset",
|
|
1553
|
+
isDisabled ? "opacity-50 cursor-not-allowed" : isActive ? "bg-surface-raised text-foreground" : "text-foreground-secondary hover:bg-surface-raised hover:text-foreground"
|
|
1554
|
+
].join(" "),
|
|
1555
|
+
children: [
|
|
1556
|
+
item.avatar && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: item.avatar }),
|
|
1557
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1558
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-foreground truncate", children: item.label }),
|
|
1559
|
+
item.description && /* @__PURE__ */ jsx("div", { className: "text-xs text-foreground-secondary mt-0.5 truncate", children: item.description })
|
|
1560
|
+
] }),
|
|
1561
|
+
item.trailing && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-foreground-muted", children: item.trailing })
|
|
1562
|
+
]
|
|
1128
1563
|
},
|
|
1129
1564
|
item.key
|
|
1130
|
-
)
|
|
1131
|
-
)
|
|
1565
|
+
);
|
|
1566
|
+
}) });
|
|
1132
1567
|
}
|
|
1133
1568
|
var TOGGLE_POSITION_CLASS = {
|
|
1134
1569
|
"top-left": "top-2 left-2",
|
|
@@ -1567,21 +2002,50 @@ function Wizard({
|
|
|
1567
2002
|
const handlePrev = () => {
|
|
1568
2003
|
if (activeIndex > 0) setActiveIndex((i) => i - 1);
|
|
1569
2004
|
};
|
|
2005
|
+
const SPOT_PAD = 6;
|
|
1570
2006
|
const highlightStyle = bbox ? {
|
|
1571
|
-
left: bbox.left -
|
|
1572
|
-
top: bbox.top -
|
|
1573
|
-
width: bbox.width +
|
|
1574
|
-
height: bbox.height +
|
|
2007
|
+
left: bbox.left - SPOT_PAD,
|
|
2008
|
+
top: bbox.top - SPOT_PAD,
|
|
2009
|
+
width: bbox.width + SPOT_PAD * 2,
|
|
2010
|
+
height: bbox.height + SPOT_PAD * 2
|
|
2011
|
+
} : { display: "none" };
|
|
2012
|
+
const backdropTop = bbox ? { left: 0, top: 0, right: 0, height: Math.max(0, bbox.top - SPOT_PAD) } : { display: "none" };
|
|
2013
|
+
const backdropBottom = bbox ? { left: 0, top: bbox.bottom + SPOT_PAD, right: 0, bottom: 0 } : { display: "none" };
|
|
2014
|
+
const backdropLeft = bbox ? {
|
|
2015
|
+
left: 0,
|
|
2016
|
+
top: bbox.top - SPOT_PAD,
|
|
2017
|
+
width: Math.max(0, bbox.left - SPOT_PAD),
|
|
2018
|
+
height: bbox.height + SPOT_PAD * 2
|
|
2019
|
+
} : { display: "none" };
|
|
2020
|
+
const backdropRight = bbox ? {
|
|
2021
|
+
left: bbox.right + SPOT_PAD,
|
|
2022
|
+
top: bbox.top - SPOT_PAD,
|
|
2023
|
+
right: 0,
|
|
2024
|
+
height: bbox.height + SPOT_PAD * 2
|
|
1575
2025
|
} : { display: "none" };
|
|
1576
2026
|
const tooltipStyle = bbox ? tooltipStyleFor(bbox, step?.placement) : { display: "none" };
|
|
1577
2027
|
const isLast = activeIndex === steps.length - 1;
|
|
1578
2028
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1579
2029
|
children,
|
|
1580
2030
|
/* @__PURE__ */ jsx(AnimatePresence, { children: open && step && /* @__PURE__ */ jsxs(Portal, { children: [
|
|
2031
|
+
["top", "bottom", "left", "right"].map((side) => /* @__PURE__ */ jsx(
|
|
2032
|
+
motion.div,
|
|
2033
|
+
{
|
|
2034
|
+
className: "fixed z-[7000000] bg-foreground/40 backdrop-blur-[2px] pointer-events-auto",
|
|
2035
|
+
style: side === "top" ? backdropTop : side === "bottom" ? backdropBottom : side === "left" ? backdropLeft : backdropRight,
|
|
2036
|
+
initial: { opacity: 0 },
|
|
2037
|
+
animate: { opacity: 1 },
|
|
2038
|
+
exit: { opacity: 0 },
|
|
2039
|
+
transition: { duration: reduced ? 0 : 0.18, ease: "easeOut" },
|
|
2040
|
+
"aria-hidden": "true"
|
|
2041
|
+
},
|
|
2042
|
+
side
|
|
2043
|
+
)),
|
|
1581
2044
|
/* @__PURE__ */ jsx(
|
|
1582
2045
|
motion.div,
|
|
1583
2046
|
{
|
|
1584
|
-
className: "fixed
|
|
2047
|
+
className: "fixed z-[7000001] pointer-events-auto",
|
|
2048
|
+
style: highlightStyle,
|
|
1585
2049
|
initial: { opacity: 0 },
|
|
1586
2050
|
animate: { opacity: 1 },
|
|
1587
2051
|
exit: { opacity: 0 },
|
|
@@ -1592,7 +2056,7 @@ function Wizard({
|
|
|
1592
2056
|
/* @__PURE__ */ jsx(
|
|
1593
2057
|
motion.div,
|
|
1594
2058
|
{
|
|
1595
|
-
className: "fixed z-[
|
|
2059
|
+
className: "fixed z-[7000002] pointer-events-none rounded-md ring-2 ring-accent",
|
|
1596
2060
|
style: highlightStyle,
|
|
1597
2061
|
initial: { opacity: 0, scale: 1.08 },
|
|
1598
2062
|
animate: { opacity: 1, scale: 1 },
|
|
@@ -1613,7 +2077,7 @@ function Wizard({
|
|
|
1613
2077
|
"aria-modal": "true",
|
|
1614
2078
|
"aria-labelledby": step.title ? tooltipTitleId : void 0,
|
|
1615
2079
|
"aria-describedby": tooltipBodyId,
|
|
1616
|
-
className: "fixed z-[
|
|
2080
|
+
className: "fixed z-[7000003] rounded-lg bg-surface text-foreground border border-border shadow-xl p-4 pointer-events-auto",
|
|
1617
2081
|
style: tooltipStyle,
|
|
1618
2082
|
initial: { opacity: 0, scale: 0.96, y: 6 },
|
|
1619
2083
|
animate: { opacity: 1, scale: 1, y: 0 },
|
|
@@ -3883,6 +4347,6 @@ function ChevronRight3() {
|
|
|
3883
4347
|
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
|
|
3884
4348
|
}
|
|
3885
4349
|
|
|
3886
|
-
export { AppShell, AutoComplete, Button, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, FadingBase, FileInput, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, Portal, ScalableContainer, SearchInput_default as SearchInput, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Switch, Table, Tabs, DatePicker as Temporal, TextInput, ThemeProvider, ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Wizard, useNotification };
|
|
4350
|
+
export { AppShell, AutoComplete, Avatar, Box, Button, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ContextMenu, Drawer, Dropdown, FadingBase, FileInput, Flex, Grid2 as Grid, GridCard, icons_default as Icon, IconButton, List2 as List, LoadingSpinner, Modal, NotificationProvider, NumberInput, OpaqueGridCard, Password, Portal, ScalableContainer, SearchInput_default as SearchInput, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Switch, Table, Tabs, DatePicker as Temporal, TextInput, ThemeProvider, ThemeSwitch, ToggleButton, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Wizard, useNotification };
|
|
3887
4351
|
//# sourceMappingURL=index.js.map
|
|
3888
4352
|
//# sourceMappingURL=index.js.map
|