@dimasbaguspm/versaur 0.0.20 → 0.0.22
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/README.md +22 -6
- package/dist/js/bottom-sheet-CCDa5VGo.js +573 -0
- package/dist/js/{bottom-sheet-input-C7cYfBaK.js → bottom-sheet-input-nVi11sIJ.js} +2 -2
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-DH7v2xvp.js → image-rectangle-C6cgL8R9.js} +329 -284
- package/dist/js/index.js +30 -29
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/overlays/index.js +1 -1
- package/dist/js/primitive/index.js +12 -11
- package/dist/js/providers/index.js +1 -1
- package/dist/js/{side-bar-CHhcp0yS.js → side-bar-li3CbgUw.js} +75 -59
- package/dist/js/{use-snackbars-oPoF7J5t.js → use-snackbars-B0MaRlg1.js} +1 -1
- package/dist/types/layouts/app-bar/app-bar.atoms.d.ts +2 -2
- package/dist/types/layouts/app-bar/app-bar.d.ts +2 -2
- package/dist/types/layouts/app-bar/types.d.ts +3 -2
- package/dist/types/primitive/icon/types.d.ts +1 -1
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/no-results/index.d.ts +2 -0
- package/dist/types/primitive/no-results/no-results.d.ts +15 -0
- package/dist/types/primitive/no-results/types.d.ts +30 -0
- package/dist/utils/enforce-subpath-import.js +3 -1
- package/package.json +1 -1
- package/dist/js/bottom-sheet-DbtyWwsy.js +0 -493
|
@@ -147,18 +147,18 @@ const alertVariants = cva(
|
|
|
147
147
|
color: t = "neutral",
|
|
148
148
|
icon: r,
|
|
149
149
|
className: s,
|
|
150
|
-
children:
|
|
151
|
-
...
|
|
150
|
+
children: n,
|
|
151
|
+
...o
|
|
152
152
|
}, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
153
153
|
"div",
|
|
154
154
|
{
|
|
155
155
|
ref: i,
|
|
156
156
|
role: "alert",
|
|
157
157
|
className: cn(alertVariants({ variant: e, color: t }), s),
|
|
158
|
-
...
|
|
158
|
+
...o,
|
|
159
159
|
children: [
|
|
160
160
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, { children: r }),
|
|
161
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children:
|
|
161
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: n })
|
|
162
162
|
]
|
|
163
163
|
}
|
|
164
164
|
)
|
|
@@ -227,15 +227,15 @@ const alertVariants = cva(
|
|
|
227
227
|
className: t,
|
|
228
228
|
color: r = "primary",
|
|
229
229
|
fontSize: s = "base",
|
|
230
|
-
fontWeight:
|
|
231
|
-
quiet:
|
|
230
|
+
fontWeight: n = "medium",
|
|
231
|
+
quiet: o = !1,
|
|
232
232
|
...i
|
|
233
233
|
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
234
234
|
"a",
|
|
235
235
|
{
|
|
236
236
|
ref: a,
|
|
237
237
|
className: cn(
|
|
238
|
-
anchorVariants({ color: r, fontSize: s, fontWeight:
|
|
238
|
+
anchorVariants({ color: r, fontSize: s, fontWeight: n, quiet: o }),
|
|
239
239
|
t
|
|
240
240
|
),
|
|
241
241
|
...i,
|
|
@@ -286,38 +286,38 @@ const alertVariants = cva(
|
|
|
286
286
|
size: t = "md",
|
|
287
287
|
shape: r = "circle",
|
|
288
288
|
className: s,
|
|
289
|
-
children:
|
|
290
|
-
...
|
|
289
|
+
children: n,
|
|
290
|
+
...o
|
|
291
291
|
}, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
292
292
|
"div",
|
|
293
293
|
{
|
|
294
294
|
ref: i,
|
|
295
295
|
className: cn(avatarVariants({ variant: e, size: t, shape: r }), s),
|
|
296
|
-
...
|
|
297
|
-
children:
|
|
296
|
+
...o,
|
|
297
|
+
children: n
|
|
298
298
|
}
|
|
299
299
|
)
|
|
300
300
|
), AvatarImage = forwardRef(
|
|
301
|
-
({ src: e, alt: t, className: r, onError: s, ...
|
|
301
|
+
({ src: e, alt: t, className: r, onError: s, ...n }, o) => {
|
|
302
302
|
const [i, a] = useState(!1);
|
|
303
303
|
useEffect(() => {
|
|
304
304
|
a(!1);
|
|
305
305
|
}, [e]);
|
|
306
|
-
const
|
|
307
|
-
(
|
|
308
|
-
a(!0), s?.(
|
|
306
|
+
const c = useCallback(
|
|
307
|
+
(u) => {
|
|
308
|
+
a(!0), s?.(u);
|
|
309
309
|
},
|
|
310
310
|
[s]
|
|
311
311
|
);
|
|
312
312
|
return i ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
313
313
|
"img",
|
|
314
314
|
{
|
|
315
|
-
ref:
|
|
315
|
+
ref: o,
|
|
316
316
|
src: e,
|
|
317
317
|
alt: t,
|
|
318
318
|
className: cn(avatarImageVariants(), r),
|
|
319
|
-
onError:
|
|
320
|
-
...
|
|
319
|
+
onError: c,
|
|
320
|
+
...n
|
|
321
321
|
}
|
|
322
322
|
);
|
|
323
323
|
}
|
|
@@ -485,37 +485,37 @@ const alertVariants = cva(
|
|
|
485
485
|
shape: t = "square",
|
|
486
486
|
color: r = "primary",
|
|
487
487
|
size: s = "md",
|
|
488
|
-
iconLeft:
|
|
489
|
-
iconRight:
|
|
488
|
+
iconLeft: n,
|
|
489
|
+
iconRight: o,
|
|
490
490
|
className: i,
|
|
491
491
|
children: a,
|
|
492
|
-
...
|
|
493
|
-
},
|
|
494
|
-
const
|
|
492
|
+
...c
|
|
493
|
+
}, u) => {
|
|
494
|
+
const d = !(a != null && a !== "") && !!(n || o);
|
|
495
495
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
496
496
|
"span",
|
|
497
497
|
{
|
|
498
|
-
ref:
|
|
498
|
+
ref: u,
|
|
499
499
|
className: cn(
|
|
500
500
|
badgeVariants({
|
|
501
501
|
variant: e,
|
|
502
502
|
color: r,
|
|
503
503
|
shape: t,
|
|
504
504
|
size: s,
|
|
505
|
-
iconOnly:
|
|
505
|
+
iconOnly: d
|
|
506
506
|
}),
|
|
507
507
|
i
|
|
508
508
|
),
|
|
509
|
-
...
|
|
510
|
-
children:
|
|
509
|
+
...c,
|
|
510
|
+
children: d ? (
|
|
511
511
|
// Icon-only mode: display only the icon
|
|
512
|
-
|
|
512
|
+
n || o
|
|
513
513
|
) : (
|
|
514
514
|
// Normal mode: display icon(s) and text
|
|
515
515
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
516
|
-
|
|
516
|
+
n,
|
|
517
517
|
a,
|
|
518
|
-
|
|
518
|
+
o
|
|
519
519
|
] })
|
|
520
520
|
)
|
|
521
521
|
}
|
|
@@ -538,13 +538,13 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
538
538
|
}
|
|
539
539
|
}), BrandLogo = forwardRef(
|
|
540
540
|
({ shape: e = "square", size: t, ...r }, s) => {
|
|
541
|
-
const
|
|
541
|
+
const o = {
|
|
542
542
|
square: SvgSpenicleSquare,
|
|
543
543
|
rounded: SvgSpenicleRounded,
|
|
544
544
|
circle: SvgSpenicleCircle
|
|
545
545
|
}[e] || SvgSpenicleSquare;
|
|
546
546
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
547
|
-
|
|
547
|
+
o,
|
|
548
548
|
{
|
|
549
549
|
ref: s,
|
|
550
550
|
...r,
|
|
@@ -553,10 +553,10 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
553
553
|
);
|
|
554
554
|
}
|
|
555
555
|
), Brand = forwardRef(
|
|
556
|
-
({ name: e = "spenicle", size: t = "md", shape: r, ...s },
|
|
556
|
+
({ name: e = "spenicle", size: t = "md", shape: r, ...s }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
557
557
|
"span",
|
|
558
558
|
{
|
|
559
|
-
ref:
|
|
559
|
+
ref: n,
|
|
560
560
|
className: cn("inline-flex items-center gap-2"),
|
|
561
561
|
...s,
|
|
562
562
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrandLogo, { shape: r, size: t, "aria-hidden": "true" })
|
|
@@ -568,35 +568,35 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
568
568
|
variants: {
|
|
569
569
|
variant: {
|
|
570
570
|
// Core variants using Versaur color system
|
|
571
|
-
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-
|
|
572
|
-
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-
|
|
573
|
-
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-
|
|
574
|
-
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-
|
|
575
|
-
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-
|
|
571
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
572
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
573
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
574
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
575
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
576
576
|
// Outline variants
|
|
577
|
-
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-
|
|
578
|
-
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-
|
|
579
|
-
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-
|
|
580
|
-
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-
|
|
581
|
-
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-
|
|
577
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
578
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
579
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
580
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
581
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
582
582
|
// Ghost variants (subtle)
|
|
583
|
-
"primary-ghost": "text-primary bg-white hover:bg-primary
|
|
584
|
-
"secondary-ghost": "text-secondary bg-white hover:bg-secondary
|
|
585
|
-
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary
|
|
586
|
-
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/
|
|
583
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
584
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
585
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
586
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
587
587
|
// Semantic variants
|
|
588
|
-
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-
|
|
589
|
-
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-
|
|
590
|
-
"success-ghost": "text-success bg-white hover:bg-success
|
|
591
|
-
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-
|
|
592
|
-
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-
|
|
593
|
-
"info-ghost": "text-info bg-white hover:bg-info
|
|
594
|
-
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-
|
|
595
|
-
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-
|
|
596
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning
|
|
597
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-
|
|
598
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-
|
|
599
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger
|
|
588
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
589
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
590
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
591
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
592
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
593
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
594
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
595
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
596
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
597
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
598
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
599
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
600
600
|
// Utility variants
|
|
601
601
|
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
602
602
|
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
@@ -617,20 +617,20 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
617
617
|
className: t,
|
|
618
618
|
variant: r = "primary",
|
|
619
619
|
size: s = "md",
|
|
620
|
-
disabled:
|
|
621
|
-
type:
|
|
620
|
+
disabled: n = !1,
|
|
621
|
+
type: o = "button",
|
|
622
622
|
children: i,
|
|
623
623
|
...a
|
|
624
|
-
},
|
|
624
|
+
}, c) {
|
|
625
625
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
626
626
|
"button",
|
|
627
627
|
{
|
|
628
|
-
ref:
|
|
629
|
-
type:
|
|
628
|
+
ref: c,
|
|
629
|
+
type: o,
|
|
630
630
|
className: cn(buttonVariants({ variant: r, size: s }), t),
|
|
631
|
-
disabled:
|
|
632
|
-
"aria-disabled":
|
|
633
|
-
inert:
|
|
631
|
+
disabled: n,
|
|
632
|
+
"aria-disabled": n,
|
|
633
|
+
inert: n ? !0 : void 0,
|
|
634
634
|
...a,
|
|
635
635
|
children: i
|
|
636
636
|
}
|
|
@@ -662,34 +662,34 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
662
662
|
{
|
|
663
663
|
variants: {
|
|
664
664
|
variant: {
|
|
665
|
-
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-
|
|
666
|
-
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-
|
|
667
|
-
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-
|
|
668
|
-
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-
|
|
669
|
-
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-
|
|
670
|
-
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-
|
|
671
|
-
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-
|
|
672
|
-
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-
|
|
673
|
-
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-
|
|
674
|
-
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-
|
|
675
|
-
"primary-ghost": "text-primary bg-white hover:bg-primary
|
|
676
|
-
"secondary-ghost": "text-secondary bg-white hover:bg-secondary
|
|
677
|
-
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary
|
|
678
|
-
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/
|
|
679
|
-
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-
|
|
680
|
-
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-
|
|
681
|
-
"success-ghost": "text-success bg-white hover:bg-success
|
|
682
|
-
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-
|
|
683
|
-
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-
|
|
684
|
-
"info-ghost": "text-info bg-white hover:bg-info
|
|
685
|
-
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-
|
|
686
|
-
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-
|
|
687
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning
|
|
688
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-
|
|
689
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-
|
|
690
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger
|
|
691
|
-
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white",
|
|
692
|
-
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white"
|
|
665
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
666
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
667
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
668
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
669
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
670
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
671
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
672
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
673
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
674
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
675
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
676
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
677
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
678
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
679
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
680
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
681
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
682
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
683
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
684
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
685
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
686
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
687
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
688
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
689
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
690
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
691
|
+
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
692
|
+
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
693
693
|
},
|
|
694
694
|
size: {
|
|
695
695
|
sm: "h-12 w-12 min-w-12 min-h-12 text-base",
|
|
@@ -704,53 +704,53 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
704
704
|
}
|
|
705
705
|
);
|
|
706
706
|
function useFloatingPosition(e, t = "1rem") {
|
|
707
|
-
const r = useRef(null), [s,
|
|
708
|
-
const
|
|
709
|
-
if (!
|
|
710
|
-
const b =
|
|
711
|
-
let
|
|
712
|
-
b ? (
|
|
707
|
+
const r = useRef(null), [s, n] = useState({}), [o, i] = useState("fixed bottom-4 right-4"), a = useCallback(() => {
|
|
708
|
+
const u = r.current;
|
|
709
|
+
if (!u) return;
|
|
710
|
+
const b = u.getBoundingClientRect().height > window.innerHeight;
|
|
711
|
+
let d = {}, p = "";
|
|
712
|
+
b ? (d = {
|
|
713
713
|
position: "fixed",
|
|
714
714
|
bottom: t,
|
|
715
715
|
zIndex: 50,
|
|
716
|
-
transform: `translateY(${
|
|
717
|
-
}, p = `fixed bottom-4 ${e}-4`) : (
|
|
716
|
+
transform: `translateY(${u.scrollTop}px)`
|
|
717
|
+
}, p = `fixed bottom-4 ${e}-4`) : (d = {
|
|
718
718
|
position: "fixed",
|
|
719
719
|
bottom: t,
|
|
720
720
|
zIndex: 50
|
|
721
|
-
}, p = `fixed bottom-4 ${e}-4`),
|
|
721
|
+
}, p = `fixed bottom-4 ${e}-4`), n(d), i(p);
|
|
722
722
|
}, [e, t]);
|
|
723
723
|
return useEffect(() => {
|
|
724
724
|
a();
|
|
725
|
-
const
|
|
726
|
-
return
|
|
727
|
-
|
|
725
|
+
const u = r.current;
|
|
726
|
+
return u && u.addEventListener("scroll", a), window.addEventListener("resize", a), () => {
|
|
727
|
+
u && u.removeEventListener("scroll", a), window.removeEventListener("resize", a);
|
|
728
728
|
};
|
|
729
729
|
}, [a]), useEffect(() => {
|
|
730
730
|
r.current && a();
|
|
731
731
|
}, [e, t, a]), [useCallback(
|
|
732
|
-
(
|
|
733
|
-
r.current =
|
|
732
|
+
(u) => {
|
|
733
|
+
r.current = u, u && a();
|
|
734
734
|
},
|
|
735
735
|
[a]
|
|
736
|
-
), s,
|
|
736
|
+
), s, o];
|
|
737
737
|
}
|
|
738
738
|
const ButtonFloat = forwardRef(
|
|
739
739
|
function({
|
|
740
740
|
className: t,
|
|
741
741
|
variant: r = "primary",
|
|
742
742
|
size: s = "md",
|
|
743
|
-
side:
|
|
744
|
-
offset:
|
|
743
|
+
side: n = "right",
|
|
744
|
+
offset: o = "1rem",
|
|
745
745
|
...i
|
|
746
746
|
}, a) {
|
|
747
|
-
const [
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
), [b,
|
|
747
|
+
const [c, u, m] = useFloatingPosition(
|
|
748
|
+
n,
|
|
749
|
+
o
|
|
750
|
+
), [b, d] = useState(!1);
|
|
751
751
|
return useEffect(() => {
|
|
752
|
-
|
|
753
|
-
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
752
|
+
d(!0);
|
|
753
|
+
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: c, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
754
754
|
"button",
|
|
755
755
|
{
|
|
756
756
|
ref: a,
|
|
@@ -761,7 +761,7 @@ const ButtonFloat = forwardRef(
|
|
|
761
761
|
b && "animate-fab-in",
|
|
762
762
|
t
|
|
763
763
|
),
|
|
764
|
-
style:
|
|
764
|
+
style: u,
|
|
765
765
|
...i
|
|
766
766
|
}
|
|
767
767
|
) });
|
|
@@ -807,37 +807,32 @@ const buttonIconVariants = cva(
|
|
|
807
807
|
{
|
|
808
808
|
variants: {
|
|
809
809
|
variant: {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
"
|
|
818
|
-
"
|
|
819
|
-
"
|
|
820
|
-
"ghost
|
|
821
|
-
"
|
|
822
|
-
|
|
823
|
-
"
|
|
824
|
-
|
|
825
|
-
"
|
|
826
|
-
"
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
"
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
"
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
"
|
|
836
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning-light focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
837
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
838
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white transition-all",
|
|
839
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger-light focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
840
|
-
// Utility variants
|
|
810
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
811
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
812
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
813
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
814
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
815
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
816
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
817
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
818
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
819
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
820
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
821
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
822
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
823
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
824
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
825
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
826
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
827
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
828
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
829
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
830
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
831
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
832
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
833
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
834
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
835
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
841
836
|
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
842
837
|
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
843
838
|
},
|
|
@@ -879,6 +874,9 @@ const buttonIconVariants = cva(
|
|
|
879
874
|
info: "text-info",
|
|
880
875
|
warning: "text-warning",
|
|
881
876
|
danger: "text-danger",
|
|
877
|
+
gray: "text-gray-500",
|
|
878
|
+
black: "text-black",
|
|
879
|
+
white: "text-white",
|
|
882
880
|
inherit: ""
|
|
883
881
|
}
|
|
884
882
|
},
|
|
@@ -886,13 +884,13 @@ const buttonIconVariants = cva(
|
|
|
886
884
|
size: "md",
|
|
887
885
|
color: "primary"
|
|
888
886
|
}
|
|
889
|
-
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className:
|
|
887
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: n, ...o }, i) {
|
|
890
888
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
891
889
|
t,
|
|
892
890
|
{
|
|
893
891
|
ref: i,
|
|
894
|
-
className: iconVariants({ color: r, size: s, className:
|
|
895
|
-
...
|
|
892
|
+
className: iconVariants({ color: r, size: s, className: n }),
|
|
893
|
+
...o
|
|
896
894
|
}
|
|
897
895
|
);
|
|
898
896
|
}), ButtonIcon = React__default.forwardRef(
|
|
@@ -900,30 +898,30 @@ const buttonIconVariants = cva(
|
|
|
900
898
|
className: t,
|
|
901
899
|
variant: r = "primary",
|
|
902
900
|
size: s = "md",
|
|
903
|
-
shape:
|
|
904
|
-
disabled:
|
|
901
|
+
shape: n = "rounded",
|
|
902
|
+
disabled: o = !1,
|
|
905
903
|
as: i,
|
|
906
904
|
"aria-label": a,
|
|
907
|
-
...
|
|
908
|
-
},
|
|
905
|
+
...c
|
|
906
|
+
}, u) {
|
|
909
907
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
910
908
|
"button",
|
|
911
909
|
{
|
|
912
|
-
ref:
|
|
910
|
+
ref: u,
|
|
913
911
|
type: "button",
|
|
914
912
|
className: cn(
|
|
915
913
|
buttonIconVariants({
|
|
916
914
|
variant: r,
|
|
917
915
|
size: s,
|
|
918
|
-
shape:
|
|
916
|
+
shape: n
|
|
919
917
|
}),
|
|
920
918
|
t
|
|
921
919
|
),
|
|
922
|
-
disabled:
|
|
923
|
-
"aria-disabled":
|
|
920
|
+
disabled: o,
|
|
921
|
+
"aria-disabled": o,
|
|
924
922
|
"aria-label": a,
|
|
925
|
-
inert:
|
|
926
|
-
...
|
|
923
|
+
inert: o ? !0 : void 0,
|
|
924
|
+
...c,
|
|
927
925
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
928
926
|
Icon,
|
|
929
927
|
{
|
|
@@ -1051,9 +1049,9 @@ const BUTTONS = [
|
|
|
1051
1049
|
onChange: t,
|
|
1052
1050
|
disabled: r,
|
|
1053
1051
|
className: s,
|
|
1054
|
-
"aria-label":
|
|
1055
|
-
},
|
|
1056
|
-
const { input: i, inputRef: a, handleButton:
|
|
1052
|
+
"aria-label": n
|
|
1053
|
+
}, o) => {
|
|
1054
|
+
const { input: i, inputRef: a, handleButton: c, handleInput: u } = useCalculator({
|
|
1057
1055
|
initialValue: e,
|
|
1058
1056
|
disabled: r,
|
|
1059
1057
|
onChange: t
|
|
@@ -1061,9 +1059,9 @@ const BUTTONS = [
|
|
|
1061
1059
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1062
1060
|
"div",
|
|
1063
1061
|
{
|
|
1064
|
-
ref:
|
|
1062
|
+
ref: o,
|
|
1065
1063
|
className: cn(calculatorRootVariants({ disabled: r }), s),
|
|
1066
|
-
"aria-label":
|
|
1064
|
+
"aria-label": n || "Calculator",
|
|
1067
1065
|
role: "region",
|
|
1068
1066
|
children: [
|
|
1069
1067
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1072,33 +1070,33 @@ const BUTTONS = [
|
|
|
1072
1070
|
ref: a,
|
|
1073
1071
|
className: "w-full mb-3 px-3 py-2 rounded border border-[var(--color-neutral)] bg-[var(--color-neutral-soft)] text-right text-xl font-mono focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",
|
|
1074
1072
|
value: i,
|
|
1075
|
-
onChange:
|
|
1073
|
+
onChange: u,
|
|
1076
1074
|
disabled: r,
|
|
1077
1075
|
inputMode: "decimal",
|
|
1078
1076
|
"aria-label": "Calculator input"
|
|
1079
1077
|
}
|
|
1080
1078
|
),
|
|
1081
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((m, b) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: m.map((
|
|
1079
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((m, b) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: m.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1082
1080
|
ButtonIcon,
|
|
1083
1081
|
{
|
|
1084
1082
|
as: X,
|
|
1085
1083
|
variant: "danger-ghost",
|
|
1086
1084
|
"aria-label": "Backspace",
|
|
1087
1085
|
size: "md",
|
|
1088
|
-
onClick: () =>
|
|
1086
|
+
onClick: () => c("⌫"),
|
|
1089
1087
|
disabled: r
|
|
1090
1088
|
},
|
|
1091
1089
|
"backspace"
|
|
1092
1090
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1093
1091
|
CalculatorButton,
|
|
1094
1092
|
{
|
|
1095
|
-
variant:
|
|
1096
|
-
onClick: () =>
|
|
1093
|
+
variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
|
|
1094
|
+
onClick: () => c(d),
|
|
1097
1095
|
disabled: r,
|
|
1098
|
-
"aria-label":
|
|
1099
|
-
children:
|
|
1096
|
+
"aria-label": d,
|
|
1097
|
+
children: d
|
|
1100
1098
|
},
|
|
1101
|
-
|
|
1099
|
+
d
|
|
1102
1100
|
)) }, b)) })
|
|
1103
1101
|
]
|
|
1104
1102
|
}
|
|
@@ -1149,9 +1147,9 @@ const CalendarHeader = () => {
|
|
|
1149
1147
|
] })
|
|
1150
1148
|
] });
|
|
1151
1149
|
}, CalendarWeekdays = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 px-4 text-ghost-500 mb-3", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((e) => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "xs", color: "ghost", align: "center", children: e }, e)) }), CalendarDaysSingle = () => {
|
|
1152
|
-
const e = useCalendarContext(), { year: t, month: r, value: s, onChange:
|
|
1153
|
-
for (let
|
|
1154
|
-
const x = p -
|
|
1150
|
+
const e = useCalendarContext(), { year: t, month: r, value: s, onChange: n, setMonth: o, setYear: i } = e, a = (g, x) => new Date(g, x + 1, 0).getDate(), u = ((g, x) => new Date(g, x, 1).getDay())(t, r), m = a(t, r), b = r - 1 < 0 ? 11 : r - 1, d = r === 0 ? t - 1 : t, p = a(t, b), y = r === 11 ? 0 : r + 1, f = r === 11 ? t + 1 : t, v = [];
|
|
1151
|
+
for (let g = 0; g < u; g++) {
|
|
1152
|
+
const x = p - u + g + 1;
|
|
1155
1153
|
v.push(
|
|
1156
1154
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1157
1155
|
ButtonIcon,
|
|
@@ -1161,15 +1159,15 @@ const CalendarHeader = () => {
|
|
|
1161
1159
|
"aria-label": "Previous month day",
|
|
1162
1160
|
variant: "ghost",
|
|
1163
1161
|
onClick: () => {
|
|
1164
|
-
|
|
1162
|
+
n?.(new Date(d, b, x)), o(b), i(d);
|
|
1165
1163
|
}
|
|
1166
1164
|
},
|
|
1167
|
-
"prev-" +
|
|
1165
|
+
"prev-" + g
|
|
1168
1166
|
)
|
|
1169
1167
|
);
|
|
1170
1168
|
}
|
|
1171
|
-
for (let
|
|
1172
|
-
const x = s instanceof Date && s.getFullYear() === t && s.getMonth() === r && s.getDate() ===
|
|
1169
|
+
for (let g = 1; g <= m; g++) {
|
|
1170
|
+
const x = s instanceof Date && s.getFullYear() === t && s.getMonth() === r && s.getDate() === g;
|
|
1173
1171
|
v.push(
|
|
1174
1172
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1175
1173
|
ButtonIcon,
|
|
@@ -1181,52 +1179,52 @@ const CalendarHeader = () => {
|
|
|
1181
1179
|
fontSize: "sm",
|
|
1182
1180
|
color: x ? "inherit" : "ghost",
|
|
1183
1181
|
className: x ? "bg-primary text-white rounded-full" : "",
|
|
1184
|
-
children:
|
|
1182
|
+
children: g
|
|
1185
1183
|
}
|
|
1186
1184
|
),
|
|
1187
1185
|
variant: x ? "primary" : "ghost",
|
|
1188
1186
|
size: "sm",
|
|
1189
|
-
"aria-label": `Select ${t}-${r + 1}-${
|
|
1187
|
+
"aria-label": `Select ${t}-${r + 1}-${g}`,
|
|
1190
1188
|
"aria-current": x ? "date" : void 0,
|
|
1191
1189
|
onClick: () => {
|
|
1192
|
-
|
|
1190
|
+
n?.(new Date(t, r, g));
|
|
1193
1191
|
}
|
|
1194
1192
|
},
|
|
1195
|
-
|
|
1193
|
+
g
|
|
1196
1194
|
)
|
|
1197
1195
|
);
|
|
1198
1196
|
}
|
|
1199
|
-
const w =
|
|
1200
|
-
for (let
|
|
1197
|
+
const w = u + m;
|
|
1198
|
+
for (let g = 0; g < (w % 7 === 0 ? 0 : 7 - w % 7); g++)
|
|
1201
1199
|
v.push(
|
|
1202
1200
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1203
1201
|
ButtonIcon,
|
|
1204
1202
|
{
|
|
1205
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1203
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: g + 1 }),
|
|
1206
1204
|
size: "sm",
|
|
1207
1205
|
"aria-label": "Next month day",
|
|
1208
1206
|
variant: "ghost",
|
|
1209
1207
|
onClick: () => {
|
|
1210
|
-
|
|
1208
|
+
n?.(new Date(f, y, g + 1)), o(y), i(f);
|
|
1211
1209
|
}
|
|
1212
1210
|
},
|
|
1213
|
-
"next-" +
|
|
1211
|
+
"next-" + g
|
|
1214
1212
|
)
|
|
1215
1213
|
);
|
|
1216
1214
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
|
|
1217
1215
|
}, CalendarDaysRange = () => {
|
|
1218
|
-
const { year: e, month: t, value: r, onChange: s, setMonth:
|
|
1216
|
+
const { year: e, month: t, value: r, onChange: s, setMonth: n, setYear: o } = useCalendarContext(), i = (l, h) => new Date(l, h + 1, 0).getDate(), c = ((l, h) => new Date(l, h, 1).getDay())(e, t), u = i(e, t), m = t - 1 < 0 ? 11 : t - 1, b = t === 0 ? e - 1 : e, d = i(e, m), p = t === 11 ? 0 : t + 1, y = t === 11 ? e + 1 : e, f = [], v = () => {
|
|
1219
1217
|
if (!Array.isArray(r)) return [null, null];
|
|
1220
1218
|
const [l, h] = r;
|
|
1221
1219
|
return !l && !h ? [null, null] : l && h ? l <= h ? [l, h] : [h, l] : [l, h];
|
|
1222
|
-
}, [w,
|
|
1223
|
-
if (!w || !
|
|
1220
|
+
}, [w, g] = v(), x = (l) => {
|
|
1221
|
+
if (!w || !g) return !1;
|
|
1224
1222
|
const h = new Date(e, t, l);
|
|
1225
|
-
return h >= w && h <=
|
|
1226
|
-
},
|
|
1227
|
-
for (let l = 0; l <
|
|
1228
|
-
const h =
|
|
1229
|
-
|
|
1223
|
+
return h >= w && h <= g;
|
|
1224
|
+
}, I = (l) => w ? w.getFullYear() === e && w.getMonth() === t && w.getDate() === l : !1, S = (l) => g ? g.getFullYear() === e && g.getMonth() === t && g.getDate() === l : !1;
|
|
1225
|
+
for (let l = 0; l < c; l++) {
|
|
1226
|
+
const h = d - c + l + 1;
|
|
1227
|
+
f.push(
|
|
1230
1228
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1231
1229
|
ButtonIcon,
|
|
1232
1230
|
{
|
|
@@ -1235,16 +1233,16 @@ const CalendarHeader = () => {
|
|
|
1235
1233
|
"aria-label": "Previous month day",
|
|
1236
1234
|
variant: "ghost",
|
|
1237
1235
|
onClick: () => {
|
|
1238
|
-
s?.([null, null]),
|
|
1236
|
+
s?.([null, null]), n(m), o(b);
|
|
1239
1237
|
}
|
|
1240
1238
|
},
|
|
1241
1239
|
"prev-" + l
|
|
1242
1240
|
)
|
|
1243
1241
|
);
|
|
1244
1242
|
}
|
|
1245
|
-
for (let l = 1; l <=
|
|
1246
|
-
const h = x(l), E =
|
|
1247
|
-
|
|
1243
|
+
for (let l = 1; l <= u; l++) {
|
|
1244
|
+
const h = x(l), E = I(l), C = S(l);
|
|
1245
|
+
f.push(
|
|
1248
1246
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1249
1247
|
ButtonIcon,
|
|
1250
1248
|
{
|
|
@@ -1279,9 +1277,9 @@ const CalendarHeader = () => {
|
|
|
1279
1277
|
)
|
|
1280
1278
|
);
|
|
1281
1279
|
}
|
|
1282
|
-
const
|
|
1283
|
-
for (let l = 0; l < (
|
|
1284
|
-
|
|
1280
|
+
const N = c + u;
|
|
1281
|
+
for (let l = 0; l < (N % 7 === 0 ? 0 : 7 - N % 7); l++)
|
|
1282
|
+
f.push(
|
|
1285
1283
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1286
1284
|
ButtonIcon,
|
|
1287
1285
|
{
|
|
@@ -1290,13 +1288,13 @@ const CalendarHeader = () => {
|
|
|
1290
1288
|
"aria-label": "Next month day",
|
|
1291
1289
|
variant: "ghost",
|
|
1292
1290
|
onClick: () => {
|
|
1293
|
-
s?.([null, null]),
|
|
1291
|
+
s?.([null, null]), n(p), o(y);
|
|
1294
1292
|
}
|
|
1295
1293
|
},
|
|
1296
1294
|
"next-" + l
|
|
1297
1295
|
)
|
|
1298
1296
|
);
|
|
1299
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children:
|
|
1297
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: f });
|
|
1300
1298
|
}, CalendarDays = () => {
|
|
1301
1299
|
const { type: e } = useCalendarContext();
|
|
1302
1300
|
return e === "range" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDaysRange, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDaysSingle, {});
|
|
@@ -1306,34 +1304,34 @@ function useCalendar({
|
|
|
1306
1304
|
type: t,
|
|
1307
1305
|
onChange: r,
|
|
1308
1306
|
initialYear: s,
|
|
1309
|
-
initialMonth:
|
|
1307
|
+
initialMonth: n
|
|
1310
1308
|
}) {
|
|
1311
|
-
const [
|
|
1309
|
+
const [o, i] = useState(n), [a, c] = useState(s), [u, m] = useState([
|
|
1312
1310
|
null,
|
|
1313
1311
|
null
|
|
1314
1312
|
]);
|
|
1315
1313
|
let b = e;
|
|
1316
|
-
t === "range" && !e && (b =
|
|
1317
|
-
const
|
|
1318
|
-
const
|
|
1319
|
-
i(
|
|
1320
|
-
}, [
|
|
1321
|
-
const
|
|
1322
|
-
i(
|
|
1323
|
-
}, [
|
|
1324
|
-
(
|
|
1325
|
-
t === "single" ? r?.(
|
|
1314
|
+
t === "range" && !e && (b = u);
|
|
1315
|
+
const d = useCallback(() => {
|
|
1316
|
+
const f = o === 0 ? 11 : o - 1, v = o === 0 ? a - 1 : a;
|
|
1317
|
+
i(f), c(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1318
|
+
}, [o, a, t, r]), p = useCallback(() => {
|
|
1319
|
+
const f = o === 11 ? 0 : o + 1, v = o === 11 ? a + 1 : a;
|
|
1320
|
+
i(f), c(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1321
|
+
}, [o, a, t, r]), y = useCallback(
|
|
1322
|
+
(f) => {
|
|
1323
|
+
t === "single" ? r?.(f) : t === "range" && (m(f), r?.(f));
|
|
1326
1324
|
},
|
|
1327
1325
|
[t, r]
|
|
1328
1326
|
);
|
|
1329
1327
|
return {
|
|
1330
1328
|
year: a,
|
|
1331
|
-
month:
|
|
1329
|
+
month: o,
|
|
1332
1330
|
value: b,
|
|
1333
1331
|
setMonth: i,
|
|
1334
|
-
setYear:
|
|
1332
|
+
setYear: c,
|
|
1335
1333
|
onChange: y,
|
|
1336
|
-
handlePrevMonth:
|
|
1334
|
+
handlePrevMonth: d,
|
|
1337
1335
|
handleNextMonth: p
|
|
1338
1336
|
};
|
|
1339
1337
|
}
|
|
@@ -1342,14 +1340,14 @@ const CalendarRoot = ({
|
|
|
1342
1340
|
onChange: t,
|
|
1343
1341
|
className: r,
|
|
1344
1342
|
type: s = "single",
|
|
1345
|
-
...
|
|
1343
|
+
...n
|
|
1346
1344
|
}) => {
|
|
1347
|
-
const
|
|
1345
|
+
const o = /* @__PURE__ */ new Date(), i = useCalendar({
|
|
1348
1346
|
value: e,
|
|
1349
1347
|
onChange: t,
|
|
1350
1348
|
type: s,
|
|
1351
|
-
initialYear:
|
|
1352
|
-
initialMonth:
|
|
1349
|
+
initialYear: o.getFullYear(),
|
|
1350
|
+
initialMonth: o.getMonth()
|
|
1353
1351
|
});
|
|
1354
1352
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1355
1353
|
CalendarContext.Provider,
|
|
@@ -1363,14 +1361,60 @@ const CalendarRoot = ({
|
|
|
1363
1361
|
setYear: i.setYear,
|
|
1364
1362
|
onChange: i.onChange
|
|
1365
1363
|
},
|
|
1366
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...
|
|
1364
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...n, children: [
|
|
1367
1365
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarHeader, {}),
|
|
1368
1366
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarWeekdays, {}),
|
|
1369
1367
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDays, {})
|
|
1370
1368
|
] })
|
|
1371
1369
|
}
|
|
1372
1370
|
);
|
|
1373
|
-
}, Calendar = Object.assign(CalendarRoot, {}),
|
|
1371
|
+
}, Calendar = Object.assign(CalendarRoot, {}), noResultsVariants = cva(
|
|
1372
|
+
"flex flex-col items-center justify-center text-center border border-border rounded-lg bg-background",
|
|
1373
|
+
{
|
|
1374
|
+
variants: {
|
|
1375
|
+
spacing: {
|
|
1376
|
+
sm: "py-8",
|
|
1377
|
+
md: "py-12",
|
|
1378
|
+
lg: "py-16"
|
|
1379
|
+
},
|
|
1380
|
+
hasGrayBackground: {
|
|
1381
|
+
true: "bg-neutral-soft",
|
|
1382
|
+
false: ""
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
defaultVariants: {
|
|
1386
|
+
spacing: "md",
|
|
1387
|
+
hasGrayBackground: !1
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
), noResultsHeaderVariants = cva(
|
|
1391
|
+
"flex flex-row items-center gap-3 mb-2"
|
|
1392
|
+
), noResultsTitleVariants = cva(
|
|
1393
|
+
"text-lg font-semibold text-foreground"
|
|
1394
|
+
), noResultsSubtitleVariants = cva(
|
|
1395
|
+
"text-foreground-light mb-6 max-w-md"
|
|
1396
|
+
), NoResults = React__default.forwardRef(
|
|
1397
|
+
function e({ icon: t, title: r, subtitle: s, action: n, className: o, hasGrayBackground: i, ...a }, c) {
|
|
1398
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1399
|
+
"section",
|
|
1400
|
+
{
|
|
1401
|
+
ref: c,
|
|
1402
|
+
className: cn(noResultsVariants({ hasGrayBackground: i }), o),
|
|
1403
|
+
role: "status",
|
|
1404
|
+
"aria-label": "No results found",
|
|
1405
|
+
...a,
|
|
1406
|
+
children: [
|
|
1407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: noResultsHeaderVariants(), children: [
|
|
1408
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: t, size: "lg", color: "ghost", "aria-hidden": "true" }),
|
|
1409
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h2", className: noResultsTitleVariants(), children: r })
|
|
1410
|
+
] }),
|
|
1411
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", className: noResultsSubtitleVariants(), children: s }),
|
|
1412
|
+
n && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "group", "aria-label": "Available actions", children: n })
|
|
1413
|
+
]
|
|
1414
|
+
}
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
), TableContext = createContext(null), TableProvider = TableContext.Provider;
|
|
1374
1418
|
function useTableContext() {
|
|
1375
1419
|
const e = useContext(TableContext);
|
|
1376
1420
|
if (!e)
|
|
@@ -1441,7 +1485,7 @@ const getTableColumnClass = (e) => {
|
|
|
1441
1485
|
}
|
|
1442
1486
|
}, TableHeader = forwardRef(
|
|
1443
1487
|
({ children: e, className: t, ...r }, s) => {
|
|
1444
|
-
const { columns:
|
|
1488
|
+
const { columns: n } = useTableContext();
|
|
1445
1489
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1446
1490
|
"div",
|
|
1447
1491
|
{
|
|
@@ -1453,7 +1497,7 @@ const getTableColumnClass = (e) => {
|
|
|
1453
1497
|
"div",
|
|
1454
1498
|
{
|
|
1455
1499
|
role: "row",
|
|
1456
|
-
className: cn("grid gap-4", getTableColumnClass(
|
|
1500
|
+
className: cn("grid gap-4", getTableColumnClass(n)),
|
|
1457
1501
|
children: e
|
|
1458
1502
|
}
|
|
1459
1503
|
)
|
|
@@ -1464,7 +1508,7 @@ const getTableColumnClass = (e) => {
|
|
|
1464
1508
|
({ children: e, className: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "rowgroup", ref: s, className: cn(t), ...r, children: e })
|
|
1465
1509
|
), TableFooter = forwardRef(
|
|
1466
1510
|
({ children: e, className: t, ...r }, s) => {
|
|
1467
|
-
const { columns:
|
|
1511
|
+
const { columns: n } = useTableContext();
|
|
1468
1512
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1469
1513
|
"div",
|
|
1470
1514
|
{
|
|
@@ -1476,7 +1520,7 @@ const getTableColumnClass = (e) => {
|
|
|
1476
1520
|
"div",
|
|
1477
1521
|
{
|
|
1478
1522
|
role: "row",
|
|
1479
|
-
className: cn("grid gap-4", getTableColumnClass(
|
|
1523
|
+
className: cn("grid gap-4", getTableColumnClass(n)),
|
|
1480
1524
|
children: e
|
|
1481
1525
|
}
|
|
1482
1526
|
)
|
|
@@ -1485,14 +1529,14 @@ const getTableColumnClass = (e) => {
|
|
|
1485
1529
|
}
|
|
1486
1530
|
), TableRow = forwardRef(
|
|
1487
1531
|
({ children: e, className: t, ...r }, s) => {
|
|
1488
|
-
const { columns:
|
|
1532
|
+
const { columns: n } = useTableContext();
|
|
1489
1533
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1490
1534
|
"div",
|
|
1491
1535
|
{
|
|
1492
1536
|
role: "row",
|
|
1493
1537
|
className: cn(
|
|
1494
1538
|
"grid gap-4",
|
|
1495
|
-
getTableColumnClass(
|
|
1539
|
+
getTableColumnClass(n),
|
|
1496
1540
|
"border-b border-border last:border-0",
|
|
1497
1541
|
t
|
|
1498
1542
|
),
|
|
@@ -1503,10 +1547,10 @@ const getTableColumnClass = (e) => {
|
|
|
1503
1547
|
);
|
|
1504
1548
|
}
|
|
1505
1549
|
), TableColumn = forwardRef(
|
|
1506
|
-
({ as: e = "td", span: t, align: r = "left", children: s, className:
|
|
1550
|
+
({ as: e = "td", span: t, align: r = "left", children: s, className: n, ...o }, i) => {
|
|
1507
1551
|
const a = e === "th" ? "columnheader" : "cell";
|
|
1508
|
-
let
|
|
1509
|
-
return r === "center" ?
|
|
1552
|
+
let c = "text-left";
|
|
1553
|
+
return r === "center" ? c = "text-center" : r === "right" && (c = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1510
1554
|
"div",
|
|
1511
1555
|
{
|
|
1512
1556
|
ref: i,
|
|
@@ -1515,11 +1559,11 @@ const getTableColumnClass = (e) => {
|
|
|
1515
1559
|
"px-4 py-2",
|
|
1516
1560
|
"[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
|
|
1517
1561
|
getRowSpanClass(t),
|
|
1518
|
-
|
|
1562
|
+
c,
|
|
1519
1563
|
"truncate overflow-hidden whitespace-nowrap",
|
|
1520
|
-
|
|
1564
|
+
n
|
|
1521
1565
|
),
|
|
1522
|
-
...
|
|
1566
|
+
...o,
|
|
1523
1567
|
children: s
|
|
1524
1568
|
}
|
|
1525
1569
|
);
|
|
@@ -1551,10 +1595,10 @@ const getTableColumnClass = (e) => {
|
|
|
1551
1595
|
}
|
|
1552
1596
|
)
|
|
1553
1597
|
), TableRoot = forwardRef(
|
|
1554
|
-
({ children: e, className: t, columns: r = 12, ...s },
|
|
1598
|
+
({ children: e, className: t, columns: r = 12, ...s }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(TableProvider, { value: { columns: r }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1555
1599
|
"div",
|
|
1556
1600
|
{
|
|
1557
|
-
ref:
|
|
1601
|
+
ref: n,
|
|
1558
1602
|
role: "table",
|
|
1559
1603
|
className: cn(
|
|
1560
1604
|
// Versaur design system: border, background, shadow, rounded, spacing
|
|
@@ -1611,12 +1655,12 @@ const getTableColumnClass = (e) => {
|
|
|
1611
1655
|
}
|
|
1612
1656
|
}
|
|
1613
1657
|
), Tile = forwardRef(
|
|
1614
|
-
({ variant: e = "white", size: t = "md", shape: r = "rounded", className: s, ...
|
|
1658
|
+
({ variant: e = "white", size: t = "md", shape: r = "rounded", className: s, ...n }, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1615
1659
|
"div",
|
|
1616
1660
|
{
|
|
1617
|
-
ref:
|
|
1661
|
+
ref: o,
|
|
1618
1662
|
className: cn(tileVariants({ variant: e, size: t, shape: r }), s),
|
|
1619
|
-
...
|
|
1663
|
+
...n
|
|
1620
1664
|
}
|
|
1621
1665
|
)
|
|
1622
1666
|
);
|
|
@@ -1650,19 +1694,19 @@ function getColSpan(e = 4) {
|
|
|
1650
1694
|
return "col-span-4";
|
|
1651
1695
|
}
|
|
1652
1696
|
}
|
|
1653
|
-
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...
|
|
1697
|
+
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...n }, o) {
|
|
1654
1698
|
const i = getColSpan(s);
|
|
1655
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
1699
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: o, className: cn(i, r), ...n, children: t });
|
|
1656
1700
|
}), DescriptionListTerm = forwardRef(function e({ children: t, ...r }, s) {
|
|
1657
1701
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { ref: s, ...r, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", fontWeight: "medium", color: "gray", children: t }) });
|
|
1658
|
-
}), DescriptionListDetails = forwardRef(function e({ children: t, color: r = "black", ...s },
|
|
1659
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { ref:
|
|
1702
|
+
}), DescriptionListDetails = forwardRef(function e({ children: t, color: r = "black", ...s }, n) {
|
|
1703
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { ref: n, ...s, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "base", fontWeight: "medium", color: r, children: t }) });
|
|
1660
1704
|
}), DescriptionListRoot = forwardRef(
|
|
1661
|
-
function e({ children: t, className: r, ...s },
|
|
1705
|
+
function e({ children: t, className: r, ...s }, n) {
|
|
1662
1706
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1663
1707
|
"dl",
|
|
1664
1708
|
{
|
|
1665
|
-
ref:
|
|
1709
|
+
ref: n,
|
|
1666
1710
|
className: cn("grid grid-cols-12 gap-y-4", r),
|
|
1667
1711
|
...s,
|
|
1668
1712
|
children: t
|
|
@@ -1675,20 +1719,20 @@ const DescriptionListItem = forwardRef(function e({ children: t, className: r, s
|
|
|
1675
1719
|
Details: DescriptionListDetails
|
|
1676
1720
|
});
|
|
1677
1721
|
function useImage({ src: e }) {
|
|
1678
|
-
const [t, r] = useState(!1), [s,
|
|
1722
|
+
const [t, r] = useState(!1), [s, n] = useState(!1), o = useRef(!1), i = () => {
|
|
1679
1723
|
r(!0);
|
|
1680
1724
|
}, a = () => {
|
|
1681
|
-
|
|
1725
|
+
n(!0);
|
|
1682
1726
|
};
|
|
1683
1727
|
return useEffect(() => {
|
|
1684
1728
|
if (!e) return;
|
|
1685
|
-
const
|
|
1686
|
-
return
|
|
1687
|
-
|
|
1688
|
-
},
|
|
1689
|
-
|
|
1729
|
+
const c = new Image();
|
|
1730
|
+
return c.src = e, c.onload = () => {
|
|
1731
|
+
o.current || r(!0);
|
|
1732
|
+
}, c.onerror = () => {
|
|
1733
|
+
o.current || n(!0);
|
|
1690
1734
|
}, () => {
|
|
1691
|
-
|
|
1735
|
+
o.current = !0;
|
|
1692
1736
|
};
|
|
1693
1737
|
}, [e]), {
|
|
1694
1738
|
loaded: t,
|
|
@@ -1755,13 +1799,13 @@ function BaseImageSkeleton({
|
|
|
1755
1799
|
shape: t,
|
|
1756
1800
|
size: r,
|
|
1757
1801
|
height: s,
|
|
1758
|
-
width:
|
|
1802
|
+
width: n
|
|
1759
1803
|
}) {
|
|
1760
1804
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1761
1805
|
Skeleton,
|
|
1762
1806
|
{
|
|
1763
1807
|
className: cn(imageAtomVariants({ shape: t, size: r }), e),
|
|
1764
|
-
style: { height: s, width:
|
|
1808
|
+
style: { height: s, width: n }
|
|
1765
1809
|
}
|
|
1766
1810
|
);
|
|
1767
1811
|
}
|
|
@@ -1770,15 +1814,15 @@ function BaseImageFallback({
|
|
|
1770
1814
|
width: t,
|
|
1771
1815
|
height: r,
|
|
1772
1816
|
className: s,
|
|
1773
|
-
style:
|
|
1774
|
-
shape:
|
|
1817
|
+
style: n,
|
|
1818
|
+
shape: o,
|
|
1775
1819
|
size: i
|
|
1776
1820
|
}) {
|
|
1777
1821
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1778
1822
|
"div",
|
|
1779
1823
|
{
|
|
1780
|
-
className: imageAtomVariants({ shape:
|
|
1781
|
-
style: { width: t, height: r, ...
|
|
1824
|
+
className: imageAtomVariants({ shape: o, size: i, className: s }),
|
|
1825
|
+
style: { width: t, height: r, ...n },
|
|
1782
1826
|
"aria-label": e,
|
|
1783
1827
|
role: "img",
|
|
1784
1828
|
children: [
|
|
@@ -1801,52 +1845,52 @@ const BaseImage = forwardRef(
|
|
|
1801
1845
|
alt: t,
|
|
1802
1846
|
onLoad: r,
|
|
1803
1847
|
onError: s,
|
|
1804
|
-
width:
|
|
1805
|
-
height:
|
|
1848
|
+
width: n,
|
|
1849
|
+
height: o,
|
|
1806
1850
|
loading: i = "lazy",
|
|
1807
1851
|
position: a = "cover",
|
|
1808
|
-
size:
|
|
1809
|
-
shape:
|
|
1852
|
+
size: c = "auto",
|
|
1853
|
+
shape: u,
|
|
1810
1854
|
className: m,
|
|
1811
1855
|
...b
|
|
1812
|
-
},
|
|
1813
|
-
const { loaded: p, errored: y, handleLoad:
|
|
1856
|
+
}, d) => {
|
|
1857
|
+
const { loaded: p, errored: y, handleLoad: f, handleError: v } = useImage({
|
|
1814
1858
|
src: e
|
|
1815
|
-
}), w = typeof
|
|
1859
|
+
}), w = typeof n == "number" ? n : Number(n), g = typeof o == "number" ? o : Number(o);
|
|
1816
1860
|
return !p && !y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1817
1861
|
BaseImageSkeleton,
|
|
1818
1862
|
{
|
|
1819
|
-
shape:
|
|
1863
|
+
shape: u,
|
|
1820
1864
|
width: w,
|
|
1821
|
-
height:
|
|
1865
|
+
height: g
|
|
1822
1866
|
}
|
|
1823
1867
|
) : y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1824
1868
|
BaseImageFallback,
|
|
1825
1869
|
{
|
|
1826
|
-
shape:
|
|
1870
|
+
shape: u,
|
|
1827
1871
|
alt: t,
|
|
1828
1872
|
width: w,
|
|
1829
|
-
height:
|
|
1873
|
+
height: g
|
|
1830
1874
|
}
|
|
1831
1875
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1832
1876
|
"img",
|
|
1833
1877
|
{
|
|
1834
|
-
ref:
|
|
1878
|
+
ref: d,
|
|
1835
1879
|
src: e,
|
|
1836
1880
|
alt: t,
|
|
1837
1881
|
width: w,
|
|
1838
|
-
height:
|
|
1882
|
+
height: g,
|
|
1839
1883
|
loading: i,
|
|
1840
1884
|
className: cn(
|
|
1841
1885
|
imageVariants({
|
|
1842
1886
|
position: a,
|
|
1843
|
-
size:
|
|
1844
|
-
shape:
|
|
1887
|
+
size: c,
|
|
1888
|
+
shape: u
|
|
1845
1889
|
}),
|
|
1846
1890
|
m
|
|
1847
1891
|
),
|
|
1848
1892
|
onLoad: (x) => {
|
|
1849
|
-
|
|
1893
|
+
f(), r?.(x);
|
|
1850
1894
|
},
|
|
1851
1895
|
onError: (x) => {
|
|
1852
1896
|
v(), s?.(x);
|
|
@@ -1862,6 +1906,7 @@ export {
|
|
|
1862
1906
|
Calculator as C,
|
|
1863
1907
|
DescriptionList as D,
|
|
1864
1908
|
Icon as I,
|
|
1909
|
+
NoResults as N,
|
|
1865
1910
|
Table as T,
|
|
1866
1911
|
Anchor as a,
|
|
1867
1912
|
Avatar as b,
|