@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.cjs
CHANGED
|
@@ -4,6 +4,7 @@ var chunk255PCZIW_cjs = require('./chunk-255PCZIW.cjs');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var React8 = require('react');
|
|
6
6
|
var reactDom = require('react-dom');
|
|
7
|
+
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
7
8
|
var Dialog = require('@radix-ui/react-dialog');
|
|
8
9
|
var framerMotion = require('framer-motion');
|
|
9
10
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
@@ -36,6 +37,7 @@ function _interopNamespace(e) {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
var React8__default = /*#__PURE__*/_interopDefault(React8);
|
|
40
|
+
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
39
41
|
var Dialog__namespace = /*#__PURE__*/_interopNamespace(Dialog);
|
|
40
42
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
41
43
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
@@ -217,6 +219,417 @@ function Portal({ children, target }) {
|
|
|
217
219
|
}, [target]);
|
|
218
220
|
return resolved ? reactDom.createPortal(children, resolved) : null;
|
|
219
221
|
}
|
|
222
|
+
var SPACING_MAP = {
|
|
223
|
+
"none": "0",
|
|
224
|
+
"xs": "1",
|
|
225
|
+
"sm": "2",
|
|
226
|
+
"md": "4",
|
|
227
|
+
"lg": "6",
|
|
228
|
+
"xl": "8",
|
|
229
|
+
"2xl": "12"
|
|
230
|
+
};
|
|
231
|
+
var padding = (s, axis = "p") => s == null ? "" : `${axis}-${SPACING_MAP[s]}`;
|
|
232
|
+
var margin = (s, axis = "m") => s == null ? "" : `${axis}-${SPACING_MAP[s]}`;
|
|
233
|
+
var BG_MAP = {
|
|
234
|
+
"none": "",
|
|
235
|
+
"background": "bg-background",
|
|
236
|
+
"surface": "bg-surface",
|
|
237
|
+
"surface-raised": "bg-surface-raised",
|
|
238
|
+
"accent": "bg-accent text-accent-fg"
|
|
239
|
+
};
|
|
240
|
+
var BORDER_MAP = {
|
|
241
|
+
"none": "",
|
|
242
|
+
"border": "border border-border",
|
|
243
|
+
"border-strong": "border border-border-strong",
|
|
244
|
+
"accent": "border border-accent",
|
|
245
|
+
"status-error": "border border-status-error"
|
|
246
|
+
};
|
|
247
|
+
var RADIUS_MAP = {
|
|
248
|
+
"none": "rounded-none",
|
|
249
|
+
"sm": "rounded-sm",
|
|
250
|
+
"md": "rounded-md",
|
|
251
|
+
"lg": "rounded-lg",
|
|
252
|
+
"xl": "rounded-xl",
|
|
253
|
+
"2xl": "rounded-2xl",
|
|
254
|
+
"full": "rounded-full"
|
|
255
|
+
};
|
|
256
|
+
var SHADOW_MAP = {
|
|
257
|
+
"none": "",
|
|
258
|
+
"sm": "shadow-sm",
|
|
259
|
+
"md": "shadow-md",
|
|
260
|
+
"lg": "shadow-lg",
|
|
261
|
+
"xl": "shadow-xl"
|
|
262
|
+
};
|
|
263
|
+
function Box({
|
|
264
|
+
as,
|
|
265
|
+
p,
|
|
266
|
+
px: px2,
|
|
267
|
+
py,
|
|
268
|
+
pt,
|
|
269
|
+
pr,
|
|
270
|
+
pb,
|
|
271
|
+
pl,
|
|
272
|
+
m,
|
|
273
|
+
mx,
|
|
274
|
+
my,
|
|
275
|
+
mt,
|
|
276
|
+
mr,
|
|
277
|
+
mb,
|
|
278
|
+
ml,
|
|
279
|
+
background = "none",
|
|
280
|
+
border = "none",
|
|
281
|
+
radius,
|
|
282
|
+
shadow = "none",
|
|
283
|
+
width,
|
|
284
|
+
height,
|
|
285
|
+
onClick,
|
|
286
|
+
className = "",
|
|
287
|
+
style,
|
|
288
|
+
children
|
|
289
|
+
}) {
|
|
290
|
+
const Element = as ?? "div";
|
|
291
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
+
Element,
|
|
293
|
+
{
|
|
294
|
+
onClick,
|
|
295
|
+
className: [
|
|
296
|
+
padding(p, "p"),
|
|
297
|
+
padding(px2, "px"),
|
|
298
|
+
padding(py, "py"),
|
|
299
|
+
padding(pt, "pt"),
|
|
300
|
+
padding(pr, "pr"),
|
|
301
|
+
padding(pb, "pb"),
|
|
302
|
+
padding(pl, "pl"),
|
|
303
|
+
margin(m, "m"),
|
|
304
|
+
margin(mx, "mx"),
|
|
305
|
+
margin(my, "my"),
|
|
306
|
+
margin(mt, "mt"),
|
|
307
|
+
margin(mr, "mr"),
|
|
308
|
+
margin(mb, "mb"),
|
|
309
|
+
margin(ml, "ml"),
|
|
310
|
+
BG_MAP[background],
|
|
311
|
+
BORDER_MAP[border],
|
|
312
|
+
radius ? RADIUS_MAP[radius] : "",
|
|
313
|
+
SHADOW_MAP[shadow],
|
|
314
|
+
className
|
|
315
|
+
].filter(Boolean).join(" "),
|
|
316
|
+
style: {
|
|
317
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
318
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
319
|
+
...style
|
|
320
|
+
},
|
|
321
|
+
children
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
var GAP_MAP = {
|
|
326
|
+
"none": "gap-0",
|
|
327
|
+
"xs": "gap-1",
|
|
328
|
+
"sm": "gap-2",
|
|
329
|
+
"md": "gap-4",
|
|
330
|
+
"lg": "gap-6",
|
|
331
|
+
"xl": "gap-8",
|
|
332
|
+
"2xl": "gap-12"
|
|
333
|
+
};
|
|
334
|
+
var DIRECTION_CLASS = {
|
|
335
|
+
"row": "flex-row",
|
|
336
|
+
"row-reverse": "flex-row-reverse",
|
|
337
|
+
"col": "flex-col",
|
|
338
|
+
"col-reverse": "flex-col-reverse"
|
|
339
|
+
};
|
|
340
|
+
var ALIGN_CLASS = {
|
|
341
|
+
start: "items-start",
|
|
342
|
+
center: "items-center",
|
|
343
|
+
end: "items-end",
|
|
344
|
+
stretch: "items-stretch",
|
|
345
|
+
baseline: "items-baseline"
|
|
346
|
+
};
|
|
347
|
+
var JUSTIFY_CLASS = {
|
|
348
|
+
start: "justify-start",
|
|
349
|
+
center: "justify-center",
|
|
350
|
+
end: "justify-end",
|
|
351
|
+
between: "justify-between",
|
|
352
|
+
around: "justify-around",
|
|
353
|
+
evenly: "justify-evenly"
|
|
354
|
+
};
|
|
355
|
+
var WRAP_CLASS = {
|
|
356
|
+
"nowrap": "flex-nowrap",
|
|
357
|
+
"wrap": "flex-wrap",
|
|
358
|
+
"wrap-reverse": "flex-wrap-reverse"
|
|
359
|
+
};
|
|
360
|
+
function Flex({
|
|
361
|
+
direction = "row",
|
|
362
|
+
align,
|
|
363
|
+
justify,
|
|
364
|
+
wrap,
|
|
365
|
+
gap,
|
|
366
|
+
inline,
|
|
367
|
+
className = "",
|
|
368
|
+
...boxProps
|
|
369
|
+
}) {
|
|
370
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
371
|
+
Box,
|
|
372
|
+
{
|
|
373
|
+
...boxProps,
|
|
374
|
+
className: [
|
|
375
|
+
inline ? "inline-flex" : "flex",
|
|
376
|
+
DIRECTION_CLASS[direction],
|
|
377
|
+
align ? ALIGN_CLASS[align] : "",
|
|
378
|
+
justify ? JUSTIFY_CLASS[justify] : "",
|
|
379
|
+
wrap ? WRAP_CLASS[wrap] : "",
|
|
380
|
+
gap ? GAP_MAP[gap] : "",
|
|
381
|
+
className
|
|
382
|
+
].filter(Boolean).join(" ")
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
var GAP_MAP2 = {
|
|
387
|
+
"none": "gap-0",
|
|
388
|
+
"xs": "gap-1",
|
|
389
|
+
"sm": "gap-2",
|
|
390
|
+
"md": "gap-4",
|
|
391
|
+
"lg": "gap-6",
|
|
392
|
+
"xl": "gap-8",
|
|
393
|
+
"2xl": "gap-12"
|
|
394
|
+
};
|
|
395
|
+
var COL_MAP = {
|
|
396
|
+
1: "grid-cols-1",
|
|
397
|
+
2: "grid-cols-2",
|
|
398
|
+
3: "grid-cols-3",
|
|
399
|
+
4: "grid-cols-4",
|
|
400
|
+
5: "grid-cols-5",
|
|
401
|
+
6: "grid-cols-6",
|
|
402
|
+
7: "grid-cols-7",
|
|
403
|
+
8: "grid-cols-8",
|
|
404
|
+
9: "grid-cols-9",
|
|
405
|
+
10: "grid-cols-10",
|
|
406
|
+
11: "grid-cols-11",
|
|
407
|
+
12: "grid-cols-12"
|
|
408
|
+
};
|
|
409
|
+
var ROW_MAP = {
|
|
410
|
+
1: "grid-rows-1",
|
|
411
|
+
2: "grid-rows-2",
|
|
412
|
+
3: "grid-rows-3",
|
|
413
|
+
4: "grid-rows-4",
|
|
414
|
+
5: "grid-rows-5",
|
|
415
|
+
6: "grid-rows-6"
|
|
416
|
+
};
|
|
417
|
+
var ALIGN_CLASS2 = {
|
|
418
|
+
start: "items-start",
|
|
419
|
+
center: "items-center",
|
|
420
|
+
end: "items-end",
|
|
421
|
+
stretch: "items-stretch"
|
|
422
|
+
};
|
|
423
|
+
var JUSTIFY_CLASS2 = {
|
|
424
|
+
start: "justify-items-start",
|
|
425
|
+
center: "justify-items-center",
|
|
426
|
+
end: "justify-items-end",
|
|
427
|
+
stretch: "justify-items-stretch"
|
|
428
|
+
};
|
|
429
|
+
function Grid2({
|
|
430
|
+
cols,
|
|
431
|
+
rows,
|
|
432
|
+
gap,
|
|
433
|
+
gapX,
|
|
434
|
+
gapY,
|
|
435
|
+
align,
|
|
436
|
+
justify,
|
|
437
|
+
className = "",
|
|
438
|
+
style,
|
|
439
|
+
...boxProps
|
|
440
|
+
}) {
|
|
441
|
+
const colClass = typeof cols === "number" ? COL_MAP[cols] ?? "" : "";
|
|
442
|
+
const rowClass = typeof rows === "number" ? ROW_MAP[rows] ?? "" : "";
|
|
443
|
+
const inlineCols = typeof cols === "string" ? cols : void 0;
|
|
444
|
+
const inlineRows = typeof rows === "string" ? rows : void 0;
|
|
445
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
446
|
+
Box,
|
|
447
|
+
{
|
|
448
|
+
...boxProps,
|
|
449
|
+
className: [
|
|
450
|
+
"grid",
|
|
451
|
+
colClass,
|
|
452
|
+
rowClass,
|
|
453
|
+
gap ? GAP_MAP2[gap] : "",
|
|
454
|
+
gapX ? GAP_MAP2[gapX].replace("gap-", "gap-x-") : "",
|
|
455
|
+
gapY ? GAP_MAP2[gapY].replace("gap-", "gap-y-") : "",
|
|
456
|
+
align ? ALIGN_CLASS2[align] : "",
|
|
457
|
+
justify ? JUSTIFY_CLASS2[justify] : "",
|
|
458
|
+
className
|
|
459
|
+
].filter(Boolean).join(" "),
|
|
460
|
+
style: {
|
|
461
|
+
gridTemplateColumns: inlineCols,
|
|
462
|
+
gridTemplateRows: inlineRows,
|
|
463
|
+
...style
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
var SIZE_PX = {
|
|
469
|
+
xs: 20,
|
|
470
|
+
sm: 28,
|
|
471
|
+
md: 36,
|
|
472
|
+
lg: 48,
|
|
473
|
+
xl: 64
|
|
474
|
+
};
|
|
475
|
+
var TEXT_CLASS = {
|
|
476
|
+
xs: "text-[10px]",
|
|
477
|
+
sm: "text-xs",
|
|
478
|
+
md: "text-sm",
|
|
479
|
+
lg: "text-base",
|
|
480
|
+
xl: "text-lg"
|
|
481
|
+
};
|
|
482
|
+
var STATUS_CLASS = {
|
|
483
|
+
online: "bg-status-success",
|
|
484
|
+
offline: "bg-foreground-muted",
|
|
485
|
+
away: "bg-status-warning",
|
|
486
|
+
busy: "bg-status-error"
|
|
487
|
+
};
|
|
488
|
+
function Avatar({
|
|
489
|
+
src,
|
|
490
|
+
alt,
|
|
491
|
+
fallback,
|
|
492
|
+
size = "md",
|
|
493
|
+
shape = "circle",
|
|
494
|
+
status,
|
|
495
|
+
className = ""
|
|
496
|
+
}) {
|
|
497
|
+
const px2 = SIZE_PX[size];
|
|
498
|
+
const initialsFallback = (() => {
|
|
499
|
+
if (fallback) return fallback;
|
|
500
|
+
if (alt) {
|
|
501
|
+
const parts = alt.trim().split(/\s+/).slice(0, 2);
|
|
502
|
+
const initials = parts.map((p) => p[0]?.toUpperCase() ?? "").join("");
|
|
503
|
+
if (initials) return initials;
|
|
504
|
+
}
|
|
505
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PersonSilhouette, {});
|
|
506
|
+
})();
|
|
507
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
508
|
+
"span",
|
|
509
|
+
{
|
|
510
|
+
className: `relative inline-block flex-shrink-0 ${className}`,
|
|
511
|
+
style: { width: px2, height: px2 },
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
514
|
+
AvatarPrimitive__namespace.Root,
|
|
515
|
+
{
|
|
516
|
+
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"}`,
|
|
517
|
+
children: [
|
|
518
|
+
src && /* @__PURE__ */ jsxRuntime.jsx(
|
|
519
|
+
AvatarPrimitive__namespace.Image,
|
|
520
|
+
{
|
|
521
|
+
src,
|
|
522
|
+
alt: alt ?? "",
|
|
523
|
+
className: "h-full w-full object-cover"
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
527
|
+
AvatarPrimitive__namespace.Fallback,
|
|
528
|
+
{
|
|
529
|
+
delayMs: src ? 300 : 0,
|
|
530
|
+
className: `flex h-full w-full items-center justify-center font-semibold ${TEXT_CLASS[size]}`,
|
|
531
|
+
children: initialsFallback
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(
|
|
538
|
+
"span",
|
|
539
|
+
{
|
|
540
|
+
className: `absolute bottom-0 right-0 block rounded-full ring-2 ring-background ${STATUS_CLASS[status]}`,
|
|
541
|
+
style: {
|
|
542
|
+
width: Math.max(6, Math.round(px2 / 4)),
|
|
543
|
+
height: Math.max(6, Math.round(px2 / 4))
|
|
544
|
+
},
|
|
545
|
+
"aria-label": `Status: ${status}`,
|
|
546
|
+
role: "status"
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
]
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
function PersonSilhouette() {
|
|
554
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "w-[60%] h-[60%]", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 12a4 4 0 100-8 4 4 0 000 8zM4 20a8 8 0 1116 0H4z" }) });
|
|
555
|
+
}
|
|
556
|
+
var VARIANT_CLASS = {
|
|
557
|
+
display: "text-3xl font-bold leading-tight tracking-tight",
|
|
558
|
+
h1: "text-2xl font-bold leading-tight tracking-tight",
|
|
559
|
+
h2: "text-xl font-semibold leading-snug tracking-tight",
|
|
560
|
+
h3: "text-lg font-semibold leading-snug",
|
|
561
|
+
h4: "text-base font-semibold leading-snug",
|
|
562
|
+
subtitle: "text-sm font-medium leading-snug",
|
|
563
|
+
body: "text-sm leading-normal",
|
|
564
|
+
caption: "text-xs leading-normal",
|
|
565
|
+
overline: "text-[10px] font-semibold leading-normal uppercase tracking-wider",
|
|
566
|
+
code: "text-xs leading-normal font-mono bg-surface-raised text-foreground rounded px-1 py-0.5"
|
|
567
|
+
};
|
|
568
|
+
var DEFAULT_ELEMENT = {
|
|
569
|
+
display: "h1",
|
|
570
|
+
h1: "h1",
|
|
571
|
+
h2: "h2",
|
|
572
|
+
h3: "h3",
|
|
573
|
+
h4: "h4",
|
|
574
|
+
subtitle: "p",
|
|
575
|
+
body: "p",
|
|
576
|
+
caption: "span",
|
|
577
|
+
overline: "span",
|
|
578
|
+
code: "code"
|
|
579
|
+
};
|
|
580
|
+
var COLOR_CLASS = {
|
|
581
|
+
"foreground": "text-foreground",
|
|
582
|
+
"foreground-secondary": "text-foreground-secondary",
|
|
583
|
+
"foreground-muted": "text-foreground-muted",
|
|
584
|
+
"accent": "text-accent",
|
|
585
|
+
"status-error": "text-status-error",
|
|
586
|
+
"status-warning": "text-status-warning",
|
|
587
|
+
"status-success": "text-status-success",
|
|
588
|
+
"status-info": "text-status-info",
|
|
589
|
+
"inherit": ""
|
|
590
|
+
};
|
|
591
|
+
var WEIGHT_CLASS = {
|
|
592
|
+
normal: "font-normal",
|
|
593
|
+
medium: "font-medium",
|
|
594
|
+
semibold: "font-semibold",
|
|
595
|
+
bold: "font-bold"
|
|
596
|
+
};
|
|
597
|
+
var ALIGN_CLASS3 = {
|
|
598
|
+
left: "text-left",
|
|
599
|
+
center: "text-center",
|
|
600
|
+
right: "text-right",
|
|
601
|
+
justify: "text-justify"
|
|
602
|
+
};
|
|
603
|
+
function Typography({
|
|
604
|
+
variant = "body",
|
|
605
|
+
as,
|
|
606
|
+
color = "inherit",
|
|
607
|
+
weight,
|
|
608
|
+
align,
|
|
609
|
+
truncate,
|
|
610
|
+
muted,
|
|
611
|
+
className = "",
|
|
612
|
+
style,
|
|
613
|
+
children
|
|
614
|
+
}) {
|
|
615
|
+
const Element = as ?? DEFAULT_ELEMENT[variant];
|
|
616
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
617
|
+
Element,
|
|
618
|
+
{
|
|
619
|
+
className: [
|
|
620
|
+
VARIANT_CLASS[variant],
|
|
621
|
+
COLOR_CLASS[color],
|
|
622
|
+
weight ? WEIGHT_CLASS[weight] : "",
|
|
623
|
+
align ? ALIGN_CLASS3[align] : "",
|
|
624
|
+
truncate ? "truncate" : "",
|
|
625
|
+
muted ? "opacity-60" : "",
|
|
626
|
+
className
|
|
627
|
+
].filter(Boolean).join(" "),
|
|
628
|
+
style,
|
|
629
|
+
children
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
}
|
|
220
633
|
function IconButton({
|
|
221
634
|
icon,
|
|
222
635
|
onClick,
|
|
@@ -1137,30 +1550,53 @@ function FadingBase({
|
|
|
1137
1550
|
)
|
|
1138
1551
|
);
|
|
1139
1552
|
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1553
|
+
var DENSITY_PADDING = {
|
|
1554
|
+
"compact": "py-1.5 px-2",
|
|
1555
|
+
"comfortable": "py-2.5 px-3",
|
|
1556
|
+
"spacious": "py-3.5 px-4"
|
|
1557
|
+
};
|
|
1558
|
+
function List2({
|
|
1559
|
+
items,
|
|
1560
|
+
onItemClick,
|
|
1561
|
+
activeKey,
|
|
1562
|
+
density = "comfortable"
|
|
1563
|
+
}) {
|
|
1564
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "listbox", className: "flex flex-col", children: items.map((item) => {
|
|
1565
|
+
const isActive = activeKey === item.key;
|
|
1566
|
+
const isDisabled = !!item.disabled;
|
|
1567
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1146
1568
|
"div",
|
|
1147
1569
|
{
|
|
1148
1570
|
role: "option",
|
|
1149
|
-
"aria-selected":
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
onClick: () => onItemClick(item),
|
|
1571
|
+
"aria-selected": isActive,
|
|
1572
|
+
"aria-disabled": isDisabled || void 0,
|
|
1573
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
1574
|
+
onClick: () => !isDisabled && onItemClick(item),
|
|
1153
1575
|
onKeyDown: (e) => {
|
|
1576
|
+
if (isDisabled) return;
|
|
1154
1577
|
if (e.key === "Enter" || e.key === " ") {
|
|
1155
1578
|
e.preventDefault();
|
|
1156
1579
|
onItemClick(item);
|
|
1157
1580
|
}
|
|
1158
1581
|
},
|
|
1159
|
-
|
|
1582
|
+
className: [
|
|
1583
|
+
"flex items-center gap-3 cursor-pointer border-b border-border transition-colors duration-150",
|
|
1584
|
+
DENSITY_PADDING[density],
|
|
1585
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset",
|
|
1586
|
+
isDisabled ? "opacity-50 cursor-not-allowed" : isActive ? "bg-surface-raised text-foreground" : "text-foreground-secondary hover:bg-surface-raised hover:text-foreground"
|
|
1587
|
+
].join(" "),
|
|
1588
|
+
children: [
|
|
1589
|
+
item.avatar && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: item.avatar }),
|
|
1590
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1591
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-foreground truncate", children: item.label }),
|
|
1592
|
+
item.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-foreground-secondary mt-0.5 truncate", children: item.description })
|
|
1593
|
+
] }),
|
|
1594
|
+
item.trailing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-foreground-muted", children: item.trailing })
|
|
1595
|
+
]
|
|
1160
1596
|
},
|
|
1161
1597
|
item.key
|
|
1162
|
-
)
|
|
1163
|
-
)
|
|
1598
|
+
);
|
|
1599
|
+
}) });
|
|
1164
1600
|
}
|
|
1165
1601
|
var TOGGLE_POSITION_CLASS = {
|
|
1166
1602
|
"top-left": "top-2 left-2",
|
|
@@ -1599,21 +2035,50 @@ function Wizard({
|
|
|
1599
2035
|
const handlePrev = () => {
|
|
1600
2036
|
if (activeIndex > 0) setActiveIndex((i) => i - 1);
|
|
1601
2037
|
};
|
|
2038
|
+
const SPOT_PAD = 6;
|
|
1602
2039
|
const highlightStyle = bbox ? {
|
|
1603
|
-
left: bbox.left -
|
|
1604
|
-
top: bbox.top -
|
|
1605
|
-
width: bbox.width +
|
|
1606
|
-
height: bbox.height +
|
|
2040
|
+
left: bbox.left - SPOT_PAD,
|
|
2041
|
+
top: bbox.top - SPOT_PAD,
|
|
2042
|
+
width: bbox.width + SPOT_PAD * 2,
|
|
2043
|
+
height: bbox.height + SPOT_PAD * 2
|
|
2044
|
+
} : { display: "none" };
|
|
2045
|
+
const backdropTop = bbox ? { left: 0, top: 0, right: 0, height: Math.max(0, bbox.top - SPOT_PAD) } : { display: "none" };
|
|
2046
|
+
const backdropBottom = bbox ? { left: 0, top: bbox.bottom + SPOT_PAD, right: 0, bottom: 0 } : { display: "none" };
|
|
2047
|
+
const backdropLeft = bbox ? {
|
|
2048
|
+
left: 0,
|
|
2049
|
+
top: bbox.top - SPOT_PAD,
|
|
2050
|
+
width: Math.max(0, bbox.left - SPOT_PAD),
|
|
2051
|
+
height: bbox.height + SPOT_PAD * 2
|
|
2052
|
+
} : { display: "none" };
|
|
2053
|
+
const backdropRight = bbox ? {
|
|
2054
|
+
left: bbox.right + SPOT_PAD,
|
|
2055
|
+
top: bbox.top - SPOT_PAD,
|
|
2056
|
+
right: 0,
|
|
2057
|
+
height: bbox.height + SPOT_PAD * 2
|
|
1607
2058
|
} : { display: "none" };
|
|
1608
2059
|
const tooltipStyle = bbox ? tooltipStyleFor(bbox, step?.placement) : { display: "none" };
|
|
1609
2060
|
const isLast = activeIndex === steps.length - 1;
|
|
1610
2061
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1611
2062
|
children,
|
|
1612
2063
|
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: open && step && /* @__PURE__ */ jsxRuntime.jsxs(Portal, { children: [
|
|
2064
|
+
["top", "bottom", "left", "right"].map((side) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2065
|
+
framerMotion.motion.div,
|
|
2066
|
+
{
|
|
2067
|
+
className: "fixed z-[7000000] bg-foreground/40 backdrop-blur-[2px] pointer-events-auto",
|
|
2068
|
+
style: side === "top" ? backdropTop : side === "bottom" ? backdropBottom : side === "left" ? backdropLeft : backdropRight,
|
|
2069
|
+
initial: { opacity: 0 },
|
|
2070
|
+
animate: { opacity: 1 },
|
|
2071
|
+
exit: { opacity: 0 },
|
|
2072
|
+
transition: { duration: reduced ? 0 : 0.18, ease: "easeOut" },
|
|
2073
|
+
"aria-hidden": "true"
|
|
2074
|
+
},
|
|
2075
|
+
side
|
|
2076
|
+
)),
|
|
1613
2077
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1614
2078
|
framerMotion.motion.div,
|
|
1615
2079
|
{
|
|
1616
|
-
className: "fixed
|
|
2080
|
+
className: "fixed z-[7000001] pointer-events-auto",
|
|
2081
|
+
style: highlightStyle,
|
|
1617
2082
|
initial: { opacity: 0 },
|
|
1618
2083
|
animate: { opacity: 1 },
|
|
1619
2084
|
exit: { opacity: 0 },
|
|
@@ -1624,7 +2089,7 @@ function Wizard({
|
|
|
1624
2089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1625
2090
|
framerMotion.motion.div,
|
|
1626
2091
|
{
|
|
1627
|
-
className: "fixed z-[
|
|
2092
|
+
className: "fixed z-[7000002] pointer-events-none rounded-md ring-2 ring-accent",
|
|
1628
2093
|
style: highlightStyle,
|
|
1629
2094
|
initial: { opacity: 0, scale: 1.08 },
|
|
1630
2095
|
animate: { opacity: 1, scale: 1 },
|
|
@@ -1645,7 +2110,7 @@ function Wizard({
|
|
|
1645
2110
|
"aria-modal": "true",
|
|
1646
2111
|
"aria-labelledby": step.title ? tooltipTitleId : void 0,
|
|
1647
2112
|
"aria-describedby": tooltipBodyId,
|
|
1648
|
-
className: "fixed z-[
|
|
2113
|
+
className: "fixed z-[7000003] rounded-lg bg-surface text-foreground border border-border shadow-xl p-4 pointer-events-auto",
|
|
1649
2114
|
style: tooltipStyle,
|
|
1650
2115
|
initial: { opacity: 0, scale: 0.96, y: 6 },
|
|
1651
2116
|
animate: { opacity: 1, scale: 1, y: 0 },
|
|
@@ -3933,6 +4398,8 @@ Object.defineProperty(exports, "vars", {
|
|
|
3933
4398
|
});
|
|
3934
4399
|
exports.AppShell = AppShell;
|
|
3935
4400
|
exports.AutoComplete = AutoComplete;
|
|
4401
|
+
exports.Avatar = Avatar;
|
|
4402
|
+
exports.Box = Box;
|
|
3936
4403
|
exports.Button = Button;
|
|
3937
4404
|
exports.Catalog = Catalog;
|
|
3938
4405
|
exports.CatalogCarousel = CatalogCarousel;
|
|
@@ -3943,6 +4410,8 @@ exports.Drawer = Drawer;
|
|
|
3943
4410
|
exports.Dropdown = Dropdown;
|
|
3944
4411
|
exports.FadingBase = FadingBase;
|
|
3945
4412
|
exports.FileInput = FileInput;
|
|
4413
|
+
exports.Flex = Flex;
|
|
4414
|
+
exports.Grid = Grid2;
|
|
3946
4415
|
exports.GridCard = GridCard;
|
|
3947
4416
|
exports.Icon = icons_default;
|
|
3948
4417
|
exports.IconButton = IconButton;
|
|
@@ -3974,6 +4443,7 @@ exports.TooltipProvider = TooltipProvider;
|
|
|
3974
4443
|
exports.TopBar = TopBar;
|
|
3975
4444
|
exports.Tree = Tree;
|
|
3976
4445
|
exports.TreeSelect = TreeSelect;
|
|
4446
|
+
exports.Typography = Typography;
|
|
3977
4447
|
exports.Wizard = Wizard;
|
|
3978
4448
|
exports.useNotification = useNotification;
|
|
3979
4449
|
//# sourceMappingURL=index.cjs.map
|