@geomak/ui 5.0.2 → 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 +637 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +359 -69
- package/dist/index.d.ts +359 -69
- package/dist/index.js +632 -113
- package/dist/index.js.map +1 -1
- package/dist/styles.css +262 -24
- 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,
|
|
@@ -999,6 +1412,9 @@ function useNotification() {
|
|
|
999
1412
|
};
|
|
1000
1413
|
}
|
|
1001
1414
|
var SIZE_MAP = {
|
|
1415
|
+
// xs is sized to fit beside button text (~14px) — async AutoComplete,
|
|
1416
|
+
// Button loading prop, inline status badges, etc.
|
|
1417
|
+
xs: { outer: "w-3.5 h-3.5", inner: "w-1.5 h-1.5", dot: "w-0.5 h-0.5", stroke: "border-[1.5px]", text: "text-[10px]" },
|
|
1002
1418
|
sm: { outer: "w-8 h-8", inner: "w-4 h-4", dot: "w-1 h-1", stroke: "border-2", text: "text-xs" },
|
|
1003
1419
|
md: { outer: "w-20 h-20", inner: "w-12 h-12", dot: "w-2 h-2", stroke: "border-[3px]", text: "text-2xl" },
|
|
1004
1420
|
lg: { outer: "w-32 h-32", inner: "w-20 h-20", dot: "w-3 h-3", stroke: "border-4", text: "text-4xl" }
|
|
@@ -1134,78 +1550,130 @@ function FadingBase({
|
|
|
1134
1550
|
)
|
|
1135
1551
|
);
|
|
1136
1552
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
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(
|
|
1143
1568
|
"div",
|
|
1144
1569
|
{
|
|
1145
1570
|
role: "option",
|
|
1146
|
-
"aria-selected":
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
onClick: () => onItemClick(item),
|
|
1571
|
+
"aria-selected": isActive,
|
|
1572
|
+
"aria-disabled": isDisabled || void 0,
|
|
1573
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
1574
|
+
onClick: () => !isDisabled && onItemClick(item),
|
|
1150
1575
|
onKeyDown: (e) => {
|
|
1576
|
+
if (isDisabled) return;
|
|
1151
1577
|
if (e.key === "Enter" || e.key === " ") {
|
|
1152
1578
|
e.preventDefault();
|
|
1153
1579
|
onItemClick(item);
|
|
1154
1580
|
}
|
|
1155
1581
|
},
|
|
1156
|
-
|
|
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
|
+
]
|
|
1157
1596
|
},
|
|
1158
1597
|
item.key
|
|
1159
|
-
)
|
|
1160
|
-
)
|
|
1598
|
+
);
|
|
1599
|
+
}) });
|
|
1161
1600
|
}
|
|
1601
|
+
var TOGGLE_POSITION_CLASS = {
|
|
1602
|
+
"top-left": "top-2 left-2",
|
|
1603
|
+
"top-right": "top-2 right-2",
|
|
1604
|
+
"bottom-left": "bottom-2 left-2",
|
|
1605
|
+
"bottom-right": "bottom-2 right-2"
|
|
1606
|
+
};
|
|
1162
1607
|
function ScalableContainer({
|
|
1163
|
-
width,
|
|
1164
|
-
height,
|
|
1608
|
+
width = "100%",
|
|
1609
|
+
height = "auto",
|
|
1165
1610
|
children,
|
|
1166
|
-
assignClassOnClick
|
|
1611
|
+
assignClassOnClick,
|
|
1612
|
+
expandIcon,
|
|
1613
|
+
collapseIcon,
|
|
1614
|
+
togglePosition = "top-right"
|
|
1167
1615
|
}) {
|
|
1168
1616
|
const containerRef = React8.useRef(null);
|
|
1169
1617
|
const [isScaled, setScaled] = React8.useState(false);
|
|
1170
|
-
const
|
|
1171
|
-
const
|
|
1618
|
+
const reduced = framerMotion.useReducedMotion();
|
|
1619
|
+
const onToggle = () => {
|
|
1172
1620
|
const next = !isScaled;
|
|
1173
1621
|
setScaled(next);
|
|
1174
|
-
|
|
1175
|
-
containerRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
1176
|
-
if (assignClassOnClick) {
|
|
1177
|
-
setWrapperClass(next ? assignClassOnClick : "");
|
|
1178
|
-
}
|
|
1179
|
-
}, 200);
|
|
1622
|
+
requestAnimationFrame(() => containerRef.current?.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
1180
1623
|
};
|
|
1624
|
+
const wrapperClass = isScaled ? assignClassOnClick : void 0;
|
|
1181
1625
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1182
|
-
|
|
1626
|
+
framerMotion.motion.div,
|
|
1183
1627
|
{
|
|
1184
1628
|
ref: containerRef,
|
|
1185
|
-
|
|
1629
|
+
layout: true,
|
|
1630
|
+
animate: {
|
|
1186
1631
|
width: isScaled ? "100%" : width,
|
|
1187
1632
|
height: isScaled ? "100%" : height
|
|
1188
1633
|
},
|
|
1189
|
-
|
|
1634
|
+
transition: reduced ? { duration: 0 } : {
|
|
1635
|
+
width: { type: "tween", duration: 0.32, ease: [0.16, 1, 0.3, 1] },
|
|
1636
|
+
height: { type: "tween", duration: 0.32, ease: [0.16, 1, 0.3, 1] },
|
|
1637
|
+
layout: { duration: 0.32, ease: [0.16, 1, 0.3, 1] }
|
|
1638
|
+
},
|
|
1639
|
+
className: [
|
|
1640
|
+
"relative rounded-lg overflow-hidden",
|
|
1641
|
+
// OS-window aesthetic: subtle elevation at rest, lifted shadow
|
|
1642
|
+
// when expanded. No background colour change.
|
|
1643
|
+
isScaled ? "shadow-2xl" : "shadow-md",
|
|
1644
|
+
"transition-shadow duration-300"
|
|
1645
|
+
].join(" "),
|
|
1190
1646
|
children: [
|
|
1191
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1192
|
-
|
|
1647
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip, { placement: "bottom", title: isScaled ? "Collapse" : "Expand", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1648
|
+
"button",
|
|
1193
1649
|
{
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1650
|
+
type: "button",
|
|
1651
|
+
onClick: onToggle,
|
|
1652
|
+
"aria-label": isScaled ? "Collapse container" : "Expand container",
|
|
1653
|
+
"aria-expanded": isScaled,
|
|
1654
|
+
className: [
|
|
1655
|
+
"absolute z-10",
|
|
1656
|
+
TOGGLE_POSITION_CLASS[togglePosition],
|
|
1657
|
+
"w-7 h-7 inline-flex items-center justify-center",
|
|
1658
|
+
"rounded-md bg-surface/80 backdrop-blur-sm border border-border",
|
|
1659
|
+
"text-foreground-secondary hover:text-foreground hover:bg-surface",
|
|
1660
|
+
"shadow-sm transition-colors duration-150",
|
|
1661
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent"
|
|
1662
|
+
].join(" "),
|
|
1663
|
+
children: isScaled ? collapseIcon ?? /* @__PURE__ */ jsxRuntime.jsx(CollapseIcon, {}) : expandIcon ?? /* @__PURE__ */ jsxRuntime.jsx(ExpandIcon, {})
|
|
1202
1664
|
}
|
|
1203
|
-
) })
|
|
1665
|
+
) }),
|
|
1204
1666
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClass, children })
|
|
1205
1667
|
]
|
|
1206
1668
|
}
|
|
1207
1669
|
);
|
|
1208
1670
|
}
|
|
1671
|
+
function CollapseIcon() {
|
|
1672
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 9L4 4M9 9V4M9 9H4M15 9L20 4M15 9V4M15 9H20M9 15L4 20M9 15V20M9 15H4M15 15L20 20M15 15V20M15 15H20" }) });
|
|
1673
|
+
}
|
|
1674
|
+
function ExpandIcon() {
|
|
1675
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 8V4h4M20 8V4h-4M4 16v4h4M20 16v4h-4" }) });
|
|
1676
|
+
}
|
|
1209
1677
|
function GridCard({ item, buttonText = "Open Application", onOpen }) {
|
|
1210
1678
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-[200px] h-[250px] rounded-lg bg-ice dark:bg-independence items-center justify-between p-2 shadow-2xl", children: [
|
|
1211
1679
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-prussian-blue dark:text-white text-lg font-bold text-center h-1/4", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: item.title }) }),
|
|
@@ -1366,49 +1834,6 @@ function CatalogCarousel({ items, buttonText, onOpen }) {
|
|
|
1366
1834
|
function Catalog({ display = "grid", items = [], buttonText, onOpen }) {
|
|
1367
1835
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full", children: display === "grid" ? /* @__PURE__ */ jsxRuntime.jsx(CatalogGrid, { items, buttonText, onOpen }) : /* @__PURE__ */ jsxRuntime.jsx(CatalogCarousel, { items, buttonText, onOpen }) });
|
|
1368
1836
|
}
|
|
1369
|
-
function MenuBarItem({ icon, isActive, title, onClick }) {
|
|
1370
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { title, placement: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1371
|
-
"div",
|
|
1372
|
-
{
|
|
1373
|
-
role: "button",
|
|
1374
|
-
"aria-label": title,
|
|
1375
|
-
"aria-current": isActive ? "page" : void 0,
|
|
1376
|
-
className: `transition duration-300 hover:bg-accent hover:text-accent-fg ${isActive ? "bg-accent text-accent-fg" : "text-foreground-secondary"} rounded-lg p-2 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,
|
|
1377
|
-
onClick,
|
|
1378
|
-
tabIndex: 0,
|
|
1379
|
-
onKeyDown: (e) => {
|
|
1380
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1381
|
-
e.preventDefault();
|
|
1382
|
-
onClick?.();
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
children: icon
|
|
1386
|
-
}
|
|
1387
|
-
) });
|
|
1388
|
-
}
|
|
1389
|
-
function MenuBar({ items }) {
|
|
1390
|
-
return (
|
|
1391
|
-
// `calculated-height` was an orphaned CSS class. Replaced with `h-full`
|
|
1392
|
-
// so the MenuBar fills whatever vertical space its parent gives it.
|
|
1393
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1394
|
-
"nav",
|
|
1395
|
-
{
|
|
1396
|
-
"aria-label": "Main navigation",
|
|
1397
|
-
className: "w-16 h-full bg-surface-raised rounded-tr-lg rounded-br-lg flex flex-col gap-2 items-center p-2 z-50",
|
|
1398
|
-
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1399
|
-
MenuBarItem,
|
|
1400
|
-
{
|
|
1401
|
-
icon: item.icon,
|
|
1402
|
-
title: item.title,
|
|
1403
|
-
isActive: item.isActive,
|
|
1404
|
-
onClick: item.onClick
|
|
1405
|
-
},
|
|
1406
|
-
item.key
|
|
1407
|
-
))
|
|
1408
|
-
}
|
|
1409
|
-
)
|
|
1410
|
-
);
|
|
1411
|
-
}
|
|
1412
1837
|
function ContextMenu({ items, children }) {
|
|
1413
1838
|
return /* @__PURE__ */ jsxRuntime.jsxs(ContextMenuPrimitive__namespace.Root, { children: [
|
|
1414
1839
|
/* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Trigger, { asChild: true, children }),
|
|
@@ -1610,21 +2035,50 @@ function Wizard({
|
|
|
1610
2035
|
const handlePrev = () => {
|
|
1611
2036
|
if (activeIndex > 0) setActiveIndex((i) => i - 1);
|
|
1612
2037
|
};
|
|
2038
|
+
const SPOT_PAD = 6;
|
|
1613
2039
|
const highlightStyle = bbox ? {
|
|
1614
|
-
left: bbox.left -
|
|
1615
|
-
top: bbox.top -
|
|
1616
|
-
width: bbox.width +
|
|
1617
|
-
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
|
|
1618
2058
|
} : { display: "none" };
|
|
1619
2059
|
const tooltipStyle = bbox ? tooltipStyleFor(bbox, step?.placement) : { display: "none" };
|
|
1620
2060
|
const isLast = activeIndex === steps.length - 1;
|
|
1621
2061
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1622
2062
|
children,
|
|
1623
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
|
+
)),
|
|
1624
2077
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1625
2078
|
framerMotion.motion.div,
|
|
1626
2079
|
{
|
|
1627
|
-
className: "fixed
|
|
2080
|
+
className: "fixed z-[7000001] pointer-events-auto",
|
|
2081
|
+
style: highlightStyle,
|
|
1628
2082
|
initial: { opacity: 0 },
|
|
1629
2083
|
animate: { opacity: 1 },
|
|
1630
2084
|
exit: { opacity: 0 },
|
|
@@ -1635,7 +2089,7 @@ function Wizard({
|
|
|
1635
2089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1636
2090
|
framerMotion.motion.div,
|
|
1637
2091
|
{
|
|
1638
|
-
className: "fixed z-[
|
|
2092
|
+
className: "fixed z-[7000002] pointer-events-none rounded-md ring-2 ring-accent",
|
|
1639
2093
|
style: highlightStyle,
|
|
1640
2094
|
initial: { opacity: 0, scale: 1.08 },
|
|
1641
2095
|
animate: { opacity: 1, scale: 1 },
|
|
@@ -1656,7 +2110,7 @@ function Wizard({
|
|
|
1656
2110
|
"aria-modal": "true",
|
|
1657
2111
|
"aria-labelledby": step.title ? tooltipTitleId : void 0,
|
|
1658
2112
|
"aria-describedby": tooltipBodyId,
|
|
1659
|
-
className: "fixed z-[
|
|
2113
|
+
className: "fixed z-[7000003] rounded-lg bg-surface text-foreground border border-border shadow-xl p-4 pointer-events-auto",
|
|
1660
2114
|
style: tooltipStyle,
|
|
1661
2115
|
initial: { opacity: 0, scale: 0.96, y: 6 },
|
|
1662
2116
|
animate: { opacity: 1, scale: 1, y: 0 },
|
|
@@ -1730,7 +2184,7 @@ var SearchInput = React8__default.default.forwardRef(function SearchInput2({
|
|
|
1730
2184
|
style: style ?? {},
|
|
1731
2185
|
children: [
|
|
1732
2186
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium ml-1 max-content text-foreground", htmlFor, children: label }),
|
|
1733
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
2187
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:border-transparent focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
1734
2188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1735
2189
|
"input",
|
|
1736
2190
|
{
|
|
@@ -1777,7 +2231,8 @@ function Dropdown({
|
|
|
1777
2231
|
htmlFor,
|
|
1778
2232
|
items = [],
|
|
1779
2233
|
labelStyle = {},
|
|
1780
|
-
placeholder
|
|
2234
|
+
placeholder,
|
|
2235
|
+
showSelectedCount = false
|
|
1781
2236
|
}) {
|
|
1782
2237
|
const [open, setOpen] = React8.useState(false);
|
|
1783
2238
|
const [selectedItems, setSelectedItems] = React8.useState([]);
|
|
@@ -1840,7 +2295,7 @@ function Dropdown({
|
|
|
1840
2295
|
"aria-invalid": hasError || void 0,
|
|
1841
2296
|
"aria-describedby": hasError ? errorId : void 0,
|
|
1842
2297
|
style,
|
|
1843
|
-
className: `flex items-center justify-between relative h-9 rounded-lg border border-border cursor-pointer select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${hasError ? "border-status-error" : ""}`,
|
|
2298
|
+
className: `flex items-center justify-between relative h-9 rounded-lg border border-border cursor-pointer select-none focus:outline-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${hasError ? "border-status-error" : ""}`,
|
|
1844
2299
|
tabIndex: disabled ? -1 : 0,
|
|
1845
2300
|
onKeyDown: (e) => {
|
|
1846
2301
|
if (disabled) return;
|
|
@@ -1863,7 +2318,7 @@ function Dropdown({
|
|
|
1863
2318
|
},
|
|
1864
2319
|
String(val)
|
|
1865
2320
|
)),
|
|
1866
|
-
value.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(DropdownPill, { value: `+${value.length - 1} more` })
|
|
2321
|
+
showSelectedCount && value.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(DropdownPill, { value: `+${value.length - 1} more` })
|
|
1867
2322
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownPill, { value: innerItems.find((it) => it.key === value)?.label })
|
|
1868
2323
|
}
|
|
1869
2324
|
),
|
|
@@ -2662,10 +3117,13 @@ function ThemeProvider({
|
|
|
2662
3117
|
] });
|
|
2663
3118
|
}
|
|
2664
3119
|
var SHIMMER = [
|
|
2665
|
-
"
|
|
2666
|
-
|
|
2667
|
-
"bg-gradient-to-r",
|
|
2668
|
-
"
|
|
3120
|
+
"relative overflow-hidden rounded-sm bg-surface-raised",
|
|
3121
|
+
'before:absolute before:inset-0 before:content-[""]',
|
|
3122
|
+
"before:bg-gradient-to-r before:from-transparent before:via-white/30 before:to-transparent",
|
|
3123
|
+
"before:animate-[shimmer_1.6s_linear_infinite]",
|
|
3124
|
+
// Respect prefers-reduced-motion — the resting bg-surface-raised is still
|
|
3125
|
+
// a perfectly legible placeholder for users who have animations off.
|
|
3126
|
+
"motion-reduce:before:hidden"
|
|
2669
3127
|
].join(" ");
|
|
2670
3128
|
function SkeletonBox({ width, height = 16, radius, className = "", style }) {
|
|
2671
3129
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2803,7 +3261,7 @@ function TextInput({
|
|
|
2803
3261
|
id: htmlFor,
|
|
2804
3262
|
"aria-invalid": hasError || void 0,
|
|
2805
3263
|
"aria-describedby": hasError ? errorId : void 0,
|
|
2806
|
-
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-60 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus-
|
|
3264
|
+
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-60 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus:border-transparent focus:ring-2 focus:ring-accent transition-colors`,
|
|
2807
3265
|
style: inputStyle ?? {},
|
|
2808
3266
|
placeholder: placeholder ?? ""
|
|
2809
3267
|
}
|
|
@@ -2879,7 +3337,7 @@ function NumberInput({
|
|
|
2879
3337
|
"div",
|
|
2880
3338
|
{
|
|
2881
3339
|
style,
|
|
2882
|
-
className: `flex items-center rounded-lg border overflow-hidden ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
3340
|
+
className: `flex items-center rounded-lg border overflow-hidden ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:border-transparent focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
2883
3341
|
children: [
|
|
2884
3342
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2885
3343
|
"input",
|
|
@@ -2979,7 +3437,7 @@ function Password({
|
|
|
2979
3437
|
id: htmlFor,
|
|
2980
3438
|
"aria-invalid": hasError || void 0,
|
|
2981
3439
|
"aria-describedby": hasError ? errorId : void 0,
|
|
2982
|
-
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-52 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus-
|
|
3440
|
+
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-52 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus:border-transparent focus:ring-2 focus:ring-accent transition-colors`,
|
|
2983
3441
|
style: inputStyle ?? {},
|
|
2984
3442
|
placeholder: placeholder ?? ""
|
|
2985
3443
|
}
|
|
@@ -3146,7 +3604,7 @@ function AutoComplete({
|
|
|
3146
3604
|
children: [
|
|
3147
3605
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium ml-1 max-content text-foreground", children: label }),
|
|
3148
3606
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover__namespace.Root, { open: open && !disabled, onOpenChange: (o) => !disabled && setOpen(o), children: [
|
|
3149
|
-
/* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
3607
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:border-transparent focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
3150
3608
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3151
3609
|
"input",
|
|
3152
3610
|
{
|
|
@@ -3347,7 +3805,7 @@ function TreeSelect({
|
|
|
3347
3805
|
"aria-invalid": hasError || void 0,
|
|
3348
3806
|
"aria-describedby": hasError ? errorId : void 0,
|
|
3349
3807
|
disabled,
|
|
3350
|
-
className: `flex items-center justify-between h-9 rounded-lg border ${hasError ? "border-status-error" : "border-border"} px-3 cursor-pointer select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[240px]" : ""}`,
|
|
3808
|
+
className: `flex items-center justify-between h-9 rounded-lg border ${hasError ? "border-status-error" : "border-border"} px-3 cursor-pointer select-none focus:outline-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[240px]" : ""}`,
|
|
3351
3809
|
children: [
|
|
3352
3810
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm truncate text-left", children: selectedNode ? selectedNode.label : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted", children: placeholder }) }),
|
|
3353
3811
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: `h-4 w-4 flex-shrink-0 transition-transform duration-200 ${open ? "rotate-180" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })
|
|
@@ -3640,12 +4098,14 @@ function DatePicker({
|
|
|
3640
4098
|
const [open, setOpen] = React8.useState(false);
|
|
3641
4099
|
const [viewMonth, setViewMonth] = React8.useState(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
|
|
3642
4100
|
const [focusDate, setFocusDate] = React8.useState(() => value ?? /* @__PURE__ */ new Date());
|
|
4101
|
+
const [view, setView] = React8.useState("days");
|
|
3643
4102
|
const gridRef = React8.useRef(null);
|
|
3644
4103
|
React8.useEffect(() => {
|
|
3645
4104
|
if (!open) return;
|
|
3646
4105
|
const target = value ?? /* @__PURE__ */ new Date();
|
|
3647
4106
|
setViewMonth(startOfMonth(target));
|
|
3648
4107
|
setFocusDate(target);
|
|
4108
|
+
setView("days");
|
|
3649
4109
|
}, [open, value]);
|
|
3650
4110
|
React8.useEffect(() => {
|
|
3651
4111
|
if (!open) return;
|
|
@@ -3734,7 +4194,7 @@ function DatePicker({
|
|
|
3734
4194
|
"aria-describedby": hasError ? errorId : void 0,
|
|
3735
4195
|
"aria-haspopup": "dialog",
|
|
3736
4196
|
"aria-expanded": open,
|
|
3737
|
-
className: `flex items-center justify-between h-9 rounded-lg border px-3 cursor-pointer select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${hasError ? "border-status-error" : "border-border"} ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[200px]" : ""}`,
|
|
4197
|
+
className: `flex items-center justify-between h-9 rounded-lg border px-3 cursor-pointer select-none focus:outline-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-accent ${hasError ? "border-status-error" : "border-border"} ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[200px]" : ""}`,
|
|
3738
4198
|
children: [
|
|
3739
4199
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm truncate ${displayValue ? "" : "text-foreground-muted"}`, children: displayValue || placeholder }),
|
|
3740
4200
|
/* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {})
|
|
@@ -3756,29 +4216,89 @@ function DatePicker({
|
|
|
3756
4216
|
"button",
|
|
3757
4217
|
{
|
|
3758
4218
|
type: "button",
|
|
3759
|
-
onClick: () =>
|
|
3760
|
-
|
|
4219
|
+
onClick: () => {
|
|
4220
|
+
if (view === "days") setViewMonth(addMonths(viewMonth, -1));
|
|
4221
|
+
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
|
|
4222
|
+
else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
|
|
4223
|
+
},
|
|
4224
|
+
"aria-label": view === "days" ? "Previous month" : view === "months" ? "Previous year" : "Previous decade",
|
|
3761
4225
|
className: "w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent transition-colors",
|
|
3762
4226
|
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft, {})
|
|
3763
4227
|
}
|
|
3764
4228
|
),
|
|
3765
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
4229
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4230
|
+
"button",
|
|
4231
|
+
{
|
|
4232
|
+
type: "button",
|
|
4233
|
+
onClick: () => {
|
|
4234
|
+
if (view === "days") setView("months");
|
|
4235
|
+
else if (view === "months") setView("years");
|
|
4236
|
+
},
|
|
4237
|
+
disabled: view === "years",
|
|
4238
|
+
"aria-label": "Change view",
|
|
4239
|
+
className: "text-sm font-semibold select-none rounded-md px-2 py-0.5 hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent transition-colors disabled:cursor-default disabled:hover:bg-transparent",
|
|
4240
|
+
children: [
|
|
4241
|
+
view === "days" && `${MONTH_NAMES[viewMonth.getMonth()]} ${viewMonth.getFullYear()}`,
|
|
4242
|
+
view === "months" && `${viewMonth.getFullYear()}`,
|
|
4243
|
+
view === "years" && (() => {
|
|
4244
|
+
const decadeStart = Math.floor(viewMonth.getFullYear() / 10) * 10;
|
|
4245
|
+
return `${decadeStart} \u2013 ${decadeStart + 11}`;
|
|
4246
|
+
})()
|
|
4247
|
+
]
|
|
4248
|
+
}
|
|
4249
|
+
),
|
|
3770
4250
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3771
4251
|
"button",
|
|
3772
4252
|
{
|
|
3773
4253
|
type: "button",
|
|
3774
|
-
onClick: () =>
|
|
3775
|
-
|
|
4254
|
+
onClick: () => {
|
|
4255
|
+
if (view === "days") setViewMonth(addMonths(viewMonth, 1));
|
|
4256
|
+
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
|
|
4257
|
+
else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
|
|
4258
|
+
},
|
|
4259
|
+
"aria-label": view === "days" ? "Next month" : view === "months" ? "Next year" : "Next decade",
|
|
3776
4260
|
className: "w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent transition-colors",
|
|
3777
4261
|
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight3, {})
|
|
3778
4262
|
}
|
|
3779
4263
|
)
|
|
3780
4264
|
] }),
|
|
3781
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4265
|
+
view === "months" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-1 min-w-[224px]", children: MONTH_NAMES.map((name, idx) => {
|
|
4266
|
+
const isCurrent = value && value.getFullYear() === viewMonth.getFullYear() && value.getMonth() === idx;
|
|
4267
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4268
|
+
"button",
|
|
4269
|
+
{
|
|
4270
|
+
type: "button",
|
|
4271
|
+
onClick: () => {
|
|
4272
|
+
setViewMonth(new Date(viewMonth.getFullYear(), idx, 1));
|
|
4273
|
+
setView("days");
|
|
4274
|
+
},
|
|
4275
|
+
className: `px-2 py-2 rounded-md text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isCurrent ? "bg-accent text-accent-fg" : "text-foreground hover:bg-surface-raised"}`,
|
|
4276
|
+
children: name.slice(0, 3)
|
|
4277
|
+
},
|
|
4278
|
+
name
|
|
4279
|
+
);
|
|
4280
|
+
}) }),
|
|
4281
|
+
view === "years" && (() => {
|
|
4282
|
+
const decadeStart = Math.floor(viewMonth.getFullYear() / 10) * 10;
|
|
4283
|
+
const years = Array.from({ length: 12 }, (_, i) => decadeStart + i);
|
|
4284
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-1 min-w-[224px]", children: years.map((y) => {
|
|
4285
|
+
const isCurrent = value?.getFullYear() === y;
|
|
4286
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4287
|
+
"button",
|
|
4288
|
+
{
|
|
4289
|
+
type: "button",
|
|
4290
|
+
onClick: () => {
|
|
4291
|
+
setViewMonth(new Date(y, viewMonth.getMonth(), 1));
|
|
4292
|
+
setView("months");
|
|
4293
|
+
},
|
|
4294
|
+
className: `px-2 py-2 rounded-md text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isCurrent ? "bg-accent text-accent-fg" : "text-foreground hover:bg-surface-raised"}`,
|
|
4295
|
+
children: y
|
|
4296
|
+
},
|
|
4297
|
+
y
|
|
4298
|
+
);
|
|
4299
|
+
}) });
|
|
4300
|
+
})(),
|
|
4301
|
+
view === "days" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3782
4302
|
"table",
|
|
3783
4303
|
{
|
|
3784
4304
|
ref: gridRef,
|
|
@@ -3878,6 +4398,8 @@ Object.defineProperty(exports, "vars", {
|
|
|
3878
4398
|
});
|
|
3879
4399
|
exports.AppShell = AppShell;
|
|
3880
4400
|
exports.AutoComplete = AutoComplete;
|
|
4401
|
+
exports.Avatar = Avatar;
|
|
4402
|
+
exports.Box = Box;
|
|
3881
4403
|
exports.Button = Button;
|
|
3882
4404
|
exports.Catalog = Catalog;
|
|
3883
4405
|
exports.CatalogCarousel = CatalogCarousel;
|
|
@@ -3886,16 +4408,15 @@ exports.Checkbox = Checkbox;
|
|
|
3886
4408
|
exports.ContextMenu = ContextMenu;
|
|
3887
4409
|
exports.Drawer = Drawer;
|
|
3888
4410
|
exports.Dropdown = Dropdown;
|
|
3889
|
-
exports.DropdownPill = DropdownPill;
|
|
3890
4411
|
exports.FadingBase = FadingBase;
|
|
3891
4412
|
exports.FileInput = FileInput;
|
|
4413
|
+
exports.Flex = Flex;
|
|
4414
|
+
exports.Grid = Grid2;
|
|
3892
4415
|
exports.GridCard = GridCard;
|
|
3893
4416
|
exports.Icon = icons_default;
|
|
3894
4417
|
exports.IconButton = IconButton;
|
|
3895
4418
|
exports.List = List2;
|
|
3896
4419
|
exports.LoadingSpinner = LoadingSpinner;
|
|
3897
|
-
exports.MenuBar = MenuBar;
|
|
3898
|
-
exports.MenuBarItem = MenuBarItem;
|
|
3899
4420
|
exports.Modal = Modal;
|
|
3900
4421
|
exports.NotificationProvider = NotificationProvider;
|
|
3901
4422
|
exports.NumberInput = NumberInput;
|
|
@@ -3922,6 +4443,7 @@ exports.TooltipProvider = TooltipProvider;
|
|
|
3922
4443
|
exports.TopBar = TopBar;
|
|
3923
4444
|
exports.Tree = Tree;
|
|
3924
4445
|
exports.TreeSelect = TreeSelect;
|
|
4446
|
+
exports.Typography = Typography;
|
|
3925
4447
|
exports.Wizard = Wizard;
|
|
3926
4448
|
exports.useNotification = useNotification;
|
|
3927
4449
|
//# sourceMappingURL=index.cjs.map
|