@chenyqthu/tp-mobile-ui-kit 0.1.0 → 0.2.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/README.md +5 -5
- package/dist/catalog.json +1302 -72
- package/dist/chunks/{OmadaAppDemo-BP4a4ch_.js → OmadaAppDemo-BO8a6A-m.js} +2005 -1206
- package/dist/chunks/{TPPrompt-Csg5YasJ.js → TPPrompt-DLd32rsN.js} +1191 -195
- package/dist/core.js +2 -2
- package/dist/index.js +7 -7
- package/dist/omada.js +7 -7
- package/dist/standalone.js +341 -341
- package/dist/style.css +1 -1
- package/dist/types/core/components/TPAvatar.d.ts +7 -0
- package/dist/types/core/components/TPCheckbox.d.ts +11 -0
- package/dist/types/core/components/TPDivider.d.ts +7 -0
- package/dist/types/core/components/TPFixedToast.d.ts +7 -0
- package/dist/types/core/components/TPIconButton.d.ts +11 -0
- package/dist/types/core/components/TPLast7DaysPicker.d.ts +7 -0
- package/dist/types/core/components/TPLiquidGlass.d.ts +8 -0
- package/dist/types/core/components/TPMonthPicker.d.ts +7 -0
- package/dist/types/core/components/TPPinInput.d.ts +7 -0
- package/dist/types/core/components/TPProgress.d.ts +7 -0
- package/dist/types/core/components/TPRadio.d.ts +11 -0
- package/dist/types/core/components/TPSkeleton.d.ts +7 -0
- package/dist/types/core/components/TPStepText.d.ts +7 -0
- package/dist/types/core/components/TPStepper.d.ts +7 -0
- package/dist/types/core/components/TPSwipeRow.d.ts +8 -0
- package/dist/types/core/components/TPTooltip.d.ts +7 -0
- package/dist/types/core/index.d.ts +16 -0
- package/dist/types/core/types.d.ts +232 -0
- package/dist/types/omada/blocks/OmadaFirmwareUpdateBlock.d.ts +23 -0
- package/dist/types/omada/blocks/OmadaPortPanelBlock.d.ts +31 -0
- package/dist/types/omada/blocks/OmadaScheduleBlock.d.ts +33 -0
- package/dist/types/omada/blocks/OmadaTopologyBlock.d.ts +26 -0
- package/dist/types/omada/index.d.ts +4 -0
- package/dist/types/omada/pages/OmadaAppDemo.d.ts +1 -1
- package/dist/types/omada/pages/OmadaSiteSettingsPage.d.ts +4 -2
- package/package.json +2 -2
- package/skills/tp-mobile-ui-kit/SKILL.md +5 -4
- package/skills/tp-mobile-ui-kit/references/catalog.json +1302 -72
|
@@ -28,60 +28,65 @@ var g = {
|
|
|
28
28
|
function _(e, t) {
|
|
29
29
|
return e || (t === "base" ? "iphone14" : "iphone16pro");
|
|
30
30
|
}
|
|
31
|
-
var v = ({ device: t, width: n, height: r, screenSize:
|
|
32
|
-
let
|
|
31
|
+
var v = ({ device: t, width: n, height: r, screenSize: a, showFrame: o = !0, showDynamicIsland: s, showHomeIndicator: c, overlayTop: l, overlayBottom: u, statusBar: d, bottomBar: f, floatingAction: p, className: v = "", style: y, children: b }) => {
|
|
32
|
+
let x = e(), S = a ?? x.screenSize, C = _(t, S), w = g[C], T = n ?? w.width, E = r ?? w.height, D = s ?? (o && w.isIOS), O = c ?? o, k = d != null, A = f != null, j = i.isValidElement(f) && f.props?.variant === "docked", M = !!(l && k), N = u === void 0 ? !(!A || j) : u, P = M ? w.isIOS ? "54px" : "36px" : "0px", F = [
|
|
33
33
|
"tp-phone-frame",
|
|
34
|
-
`tp-phone-frame--${
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
`tp-phone-frame--${C}`,
|
|
35
|
+
o ? "tp-phone-frame--framed" : "tp-phone-frame--frameless",
|
|
36
|
+
M ? "tp-phone-frame--overlay-top" : "",
|
|
37
|
+
N ? "tp-phone-frame--overlay-bottom" : "",
|
|
38
|
+
v
|
|
37
39
|
].filter(Boolean).join(" ");
|
|
38
40
|
return /* @__PURE__ */ m("div", {
|
|
39
|
-
className:
|
|
40
|
-
"data-device":
|
|
41
|
-
"data-show-frame": String(
|
|
42
|
-
"data-
|
|
43
|
-
"data-
|
|
44
|
-
"data-
|
|
41
|
+
className: F,
|
|
42
|
+
"data-device": C,
|
|
43
|
+
"data-show-frame": String(o),
|
|
44
|
+
"data-overlay-top": String(M),
|
|
45
|
+
"data-overlay-bottom": String(N),
|
|
46
|
+
"data-tp-screen": S,
|
|
47
|
+
"data-width": T,
|
|
48
|
+
"data-height": E,
|
|
45
49
|
style: {
|
|
46
|
-
...
|
|
47
|
-
width: `${
|
|
48
|
-
height: `${
|
|
50
|
+
...o ? void 0 : {
|
|
51
|
+
width: `${T}px`,
|
|
52
|
+
height: `${E}px`
|
|
49
53
|
},
|
|
50
|
-
...
|
|
54
|
+
...y
|
|
51
55
|
},
|
|
52
56
|
children: /* @__PURE__ */ h("div", {
|
|
53
57
|
className: "tp-phone-screen",
|
|
54
58
|
style: {
|
|
55
|
-
width: `${
|
|
56
|
-
height: `${
|
|
59
|
+
width: `${T}px`,
|
|
60
|
+
height: `${E}px`,
|
|
61
|
+
"--tp-phone-top-inset": P
|
|
57
62
|
},
|
|
58
63
|
children: [
|
|
59
|
-
|
|
64
|
+
D && /* @__PURE__ */ m("div", {
|
|
60
65
|
className: "tp-phone-dynamic-island",
|
|
61
66
|
"data-testid": "tp-phone-dynamic-island",
|
|
62
67
|
"aria-hidden": "true",
|
|
63
68
|
children: /* @__PURE__ */ m("span", { className: "tp-phone-dynamic-island-lens" })
|
|
64
69
|
}),
|
|
65
|
-
|
|
66
|
-
className: "tp-phone-statusbar",
|
|
67
|
-
children:
|
|
70
|
+
k && /* @__PURE__ */ m("div", {
|
|
71
|
+
className: `tp-phone-statusbar ${M ? "tp-phone-statusbar--overlay" : ""}`.trim(),
|
|
72
|
+
children: d
|
|
68
73
|
}),
|
|
69
74
|
/* @__PURE__ */ h("div", {
|
|
70
75
|
className: "tp-phone-stage",
|
|
71
76
|
children: [/* @__PURE__ */ m("div", {
|
|
72
77
|
className: "tp-phone-body",
|
|
78
|
+
children: b
|
|
79
|
+
}), p != null && /* @__PURE__ */ m("div", {
|
|
80
|
+
className: `tp-phone-floating-action ${N ? "tp-phone-floating-action--above-overlay" : ""}`.trim(),
|
|
73
81
|
children: p
|
|
74
|
-
}), u != null && /* @__PURE__ */ m("div", {
|
|
75
|
-
className: "tp-phone-floating-action",
|
|
76
|
-
children: u
|
|
77
82
|
})]
|
|
78
83
|
}),
|
|
79
|
-
|
|
80
|
-
className: "tp-phone-bottom",
|
|
81
|
-
children: [
|
|
84
|
+
A || O ? /* @__PURE__ */ h("div", {
|
|
85
|
+
className: `tp-phone-bottom ${N ? "tp-phone-bottom--overlay" : ""}`.trim(),
|
|
86
|
+
children: [A && /* @__PURE__ */ m("div", {
|
|
82
87
|
className: "tp-phone-bottombar",
|
|
83
|
-
children:
|
|
84
|
-
}),
|
|
88
|
+
children: f
|
|
89
|
+
}), O && /* @__PURE__ */ m("div", {
|
|
85
90
|
className: "tp-phone-home-indicator",
|
|
86
91
|
"data-testid": "tp-phone-home-indicator",
|
|
87
92
|
"aria-hidden": "true",
|
|
@@ -384,18 +389,19 @@ function C(e) {
|
|
|
384
389
|
children: e
|
|
385
390
|
});
|
|
386
391
|
}
|
|
387
|
-
var w = ({ items: e, activeKey: t, onChange: n, variant: r = "floating-pill",
|
|
388
|
-
let
|
|
392
|
+
var w = ({ items: e, activeKey: t, onChange: n, variant: r = "floating-pill", extraAction: i, className: a = "", style: o }) => {
|
|
393
|
+
let s = i != null && r === "floating-pill", c = [
|
|
389
394
|
"tp-tabbar",
|
|
390
395
|
`tp-tabbar--${r}`,
|
|
391
|
-
|
|
396
|
+
s ? "tp-tabbar--has-extra" : "",
|
|
397
|
+
a
|
|
392
398
|
].filter(Boolean).join(" ");
|
|
393
|
-
return /* @__PURE__ */
|
|
394
|
-
className:
|
|
399
|
+
return /* @__PURE__ */ h("nav", {
|
|
400
|
+
className: c,
|
|
395
401
|
"data-variant": r,
|
|
396
402
|
"aria-label": "Bottom Navigation",
|
|
397
|
-
style:
|
|
398
|
-
children: /* @__PURE__ */ m("div", {
|
|
403
|
+
style: o,
|
|
404
|
+
children: [/* @__PURE__ */ m("div", {
|
|
399
405
|
className: "tp-tabbar-track",
|
|
400
406
|
role: "tablist",
|
|
401
407
|
children: e.map((e) => {
|
|
@@ -418,7 +424,10 @@ var w = ({ items: e, activeKey: t, onChange: n, variant: r = "floating-pill", cl
|
|
|
418
424
|
})]
|
|
419
425
|
}, e.key);
|
|
420
426
|
})
|
|
421
|
-
})
|
|
427
|
+
}), s && /* @__PURE__ */ m("div", {
|
|
428
|
+
className: "tp-tabbar-extra",
|
|
429
|
+
children: i
|
|
430
|
+
})]
|
|
422
431
|
});
|
|
423
432
|
}, T = ({ options: e, value: t, onChange: n, variant: r = "underline", fullWidth: i = !0, className: a = "", style: o }) => {
|
|
424
433
|
let s = [
|
|
@@ -578,79 +587,140 @@ function A(e, t, n) {
|
|
|
578
587
|
function j(e, t, n) {
|
|
579
588
|
return n <= t ? 0 : (A(e, t, n) - t) / (n - t) * 100;
|
|
580
589
|
}
|
|
581
|
-
|
|
582
|
-
let
|
|
583
|
-
|
|
584
|
-
|
|
590
|
+
function M(e, t, n) {
|
|
591
|
+
let r = A(e?.[0] ?? t, t, n), i = A(e?.[1] ?? n, t, n);
|
|
592
|
+
return r <= i ? [r, i] : [i, r];
|
|
593
|
+
}
|
|
594
|
+
var N = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, marks: a, showValue: o = !1, unit: s = "", disabled: c = !1, range: l = !1, rangeValue: u, defaultRangeValue: g, onRangeChange: _, onRangeAfterChange: v, onChange: y, onAfterChange: b, ariaLabel: x, className: S = "", style: C }) => {
|
|
595
|
+
let w = e !== void 0, [T, E] = f(() => A(t ?? n, n, r)), D = A(w ? e : T, n, r), O = d(D);
|
|
596
|
+
O.current = D;
|
|
597
|
+
let k = u !== void 0, [N, P] = f(() => M(g ?? [n, Math.round(n + (r - n) * .6)], n, r)), F = M(k ? u : N, n, r), I = d(F);
|
|
598
|
+
I.current = F;
|
|
599
|
+
let L = j(D, n, r), R = j(F[0], n, r), z = j(F[1], n, r), B = (e, t = !1) => {
|
|
585
600
|
let i = A(e, n, r);
|
|
586
|
-
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
601
|
+
O.current = i, w || E(i), y?.(i), t && b?.(i);
|
|
602
|
+
}, V = (e, t = !1) => {
|
|
603
|
+
let i = M(e, n, r);
|
|
604
|
+
I.current = i, k || P(i), _?.(i), t && v?.(i);
|
|
605
|
+
}, H = (e) => {
|
|
606
|
+
c || B(Number(e.target.value), !1);
|
|
607
|
+
}, U = () => {
|
|
608
|
+
c || (l ? v?.(I.current) : b?.(O.current));
|
|
609
|
+
}, W = !!a?.some((e) => e.label !== void 0), G = [
|
|
592
610
|
"tp-slider",
|
|
611
|
+
l ? "tp-slider--range" : "",
|
|
593
612
|
c ? "tp-slider--disabled" : "",
|
|
594
|
-
|
|
613
|
+
S
|
|
595
614
|
].filter(Boolean).join(" ");
|
|
596
615
|
return /* @__PURE__ */ h("div", {
|
|
597
|
-
className:
|
|
598
|
-
style:
|
|
616
|
+
className: G,
|
|
617
|
+
style: C,
|
|
599
618
|
children: [
|
|
600
619
|
o && /* @__PURE__ */ m("div", {
|
|
601
620
|
className: "tp-slider-header",
|
|
602
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ m("span", {
|
|
603
622
|
className: "tp-slider-value",
|
|
604
|
-
children: [
|
|
623
|
+
children: l ? `${F[0]}${s} – ${F[1]}${s}` : `${D}${s}`
|
|
605
624
|
})
|
|
606
625
|
}),
|
|
607
626
|
/* @__PURE__ */ h("div", {
|
|
608
627
|
className: "tp-slider-control",
|
|
609
|
-
children: [
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
628
|
+
children: [/* @__PURE__ */ h("div", {
|
|
629
|
+
className: "tp-slider-track",
|
|
630
|
+
"aria-hidden": "true",
|
|
631
|
+
children: [/* @__PURE__ */ m("div", {
|
|
632
|
+
className: "tp-slider-fill",
|
|
633
|
+
style: l ? {
|
|
634
|
+
left: `${R}%`,
|
|
635
|
+
width: `${Math.max(0, z - R)}%`
|
|
636
|
+
} : {
|
|
637
|
+
left: 0,
|
|
638
|
+
width: `${L}%`
|
|
639
|
+
}
|
|
640
|
+
}), a && a.length > 0 && /* @__PURE__ */ m("div", {
|
|
641
|
+
className: "tp-slider-ticks",
|
|
642
|
+
children: a.map((e) => {
|
|
643
|
+
let t = j(e.value, n, r), i = l ? e.value >= F[0] && e.value <= F[1] : e.value <= D;
|
|
644
|
+
return /* @__PURE__ */ m("span", {
|
|
645
|
+
className: `tp-slider-tick ${i ? "tp-slider-tick--active" : ""}`.trim(),
|
|
646
|
+
style: { left: `${t}%` }
|
|
647
|
+
}, e.value);
|
|
648
|
+
})
|
|
649
|
+
})]
|
|
650
|
+
}), l ? /* @__PURE__ */ h(p, { children: [
|
|
627
651
|
/* @__PURE__ */ m("div", {
|
|
628
652
|
className: "tp-slider-thumb",
|
|
629
|
-
style: { left: `${
|
|
653
|
+
style: { left: `${R}%` },
|
|
654
|
+
"aria-hidden": "true"
|
|
655
|
+
}),
|
|
656
|
+
/* @__PURE__ */ m("div", {
|
|
657
|
+
className: "tp-slider-thumb tp-slider-thumb--secondary",
|
|
658
|
+
style: { left: `${z}%` },
|
|
630
659
|
"aria-hidden": "true"
|
|
631
660
|
}),
|
|
632
661
|
/* @__PURE__ */ m("input", {
|
|
633
662
|
type: "range",
|
|
634
|
-
className: "tp-slider-input",
|
|
663
|
+
className: "tp-slider-input tp-slider-input--range",
|
|
664
|
+
min: n,
|
|
665
|
+
max: r,
|
|
666
|
+
step: i,
|
|
667
|
+
value: F[0],
|
|
668
|
+
disabled: c,
|
|
669
|
+
"aria-label": x ? `${x} minimum` : "Minimum value",
|
|
670
|
+
onChange: (e) => {
|
|
671
|
+
if (c) return;
|
|
672
|
+
let t = Math.min(Number(e.target.value), F[1]);
|
|
673
|
+
V([t, F[1]], !1);
|
|
674
|
+
},
|
|
675
|
+
onPointerUp: U,
|
|
676
|
+
onMouseUp: U,
|
|
677
|
+
onTouchEnd: U,
|
|
678
|
+
onKeyUp: U
|
|
679
|
+
}),
|
|
680
|
+
/* @__PURE__ */ m("input", {
|
|
681
|
+
type: "range",
|
|
682
|
+
className: "tp-slider-input tp-slider-input--range tp-slider-input--secondary",
|
|
635
683
|
min: n,
|
|
636
684
|
max: r,
|
|
637
685
|
step: i,
|
|
638
|
-
value:
|
|
686
|
+
value: F[1],
|
|
639
687
|
disabled: c,
|
|
640
|
-
"aria-label":
|
|
641
|
-
onChange:
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
688
|
+
"aria-label": x ? `${x} maximum` : "Maximum value",
|
|
689
|
+
onChange: (e) => {
|
|
690
|
+
if (c) return;
|
|
691
|
+
let t = Math.max(Number(e.target.value), F[0]);
|
|
692
|
+
V([F[0], t], !1);
|
|
693
|
+
},
|
|
694
|
+
onPointerUp: U,
|
|
695
|
+
onMouseUp: U,
|
|
696
|
+
onTouchEnd: U,
|
|
697
|
+
onKeyUp: U
|
|
646
698
|
})
|
|
647
|
-
]
|
|
699
|
+
] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
700
|
+
className: "tp-slider-thumb",
|
|
701
|
+
style: { left: `${L}%` },
|
|
702
|
+
"aria-hidden": "true"
|
|
703
|
+
}), /* @__PURE__ */ m("input", {
|
|
704
|
+
type: "range",
|
|
705
|
+
className: "tp-slider-input",
|
|
706
|
+
min: n,
|
|
707
|
+
max: r,
|
|
708
|
+
step: i,
|
|
709
|
+
value: D,
|
|
710
|
+
disabled: c,
|
|
711
|
+
"aria-label": x,
|
|
712
|
+
onChange: H,
|
|
713
|
+
onPointerUp: U,
|
|
714
|
+
onMouseUp: U,
|
|
715
|
+
onTouchEnd: U,
|
|
716
|
+
onKeyUp: U
|
|
717
|
+
})] })]
|
|
648
718
|
}),
|
|
649
|
-
|
|
719
|
+
W && a && /* @__PURE__ */ m("div", {
|
|
650
720
|
className: "tp-slider-marks",
|
|
651
721
|
children: a.map((e) => {
|
|
652
722
|
if (e.label === void 0) return null;
|
|
653
|
-
let t = j(e.value, n, r), i = e.value ===
|
|
723
|
+
let t = j(e.value, n, r), i = l ? e.value === F[0] || e.value === F[1] : e.value === D;
|
|
654
724
|
return /* @__PURE__ */ m("div", {
|
|
655
725
|
className: [
|
|
656
726
|
"tp-slider-mark",
|
|
@@ -663,7 +733,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
663
733
|
className: "tp-slider-mark-btn",
|
|
664
734
|
disabled: c,
|
|
665
735
|
onClick: () => {
|
|
666
|
-
c ||
|
|
736
|
+
c || (l ? Math.abs(e.value - F[0]) <= Math.abs(e.value - F[1]) ? V([e.value, F[1]], !0) : V([F[0], e.value], !0) : B(e.value, !0));
|
|
667
737
|
},
|
|
668
738
|
children: e.label
|
|
669
739
|
})
|
|
@@ -672,7 +742,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
672
742
|
})
|
|
673
743
|
]
|
|
674
744
|
});
|
|
675
|
-
},
|
|
745
|
+
}, P = ({ title: e, extra: t, radius: n = "theme", padding: r = "none", divided: i = !1, className: a = "", style: o, children: s }) => {
|
|
676
746
|
let c = [
|
|
677
747
|
"tp-list-card",
|
|
678
748
|
`tp-list-card--radius-${n}`,
|
|
@@ -697,7 +767,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
697
767
|
children: s
|
|
698
768
|
})]
|
|
699
769
|
});
|
|
700
|
-
},
|
|
770
|
+
}, F = ({ checked: e, defaultChecked: t = !1, onChange: n, disabled: r = !1, loading: i = !1, ariaLabel: a, className: o = "", style: s, fallbackLabel: c }) => {
|
|
701
771
|
let [l, u] = f(t), d = e !== void 0, p = d ? e : l, h = r || i, g = (e) => {
|
|
702
772
|
if (e.stopPropagation(), h) return;
|
|
703
773
|
let t = !p;
|
|
@@ -726,7 +796,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
726
796
|
}) : null
|
|
727
797
|
})
|
|
728
798
|
});
|
|
729
|
-
},
|
|
799
|
+
}, I = ({ title: e, subtitle: t, description: n, value: r, leading: i, trailing: a, badge: o, arrow: s = !1, checked: c, switchProps: l, danger: u = !1, disabled: d = !1, onClick: f, className: p = "", style: g }) => {
|
|
730
800
|
let _ = !!f && !d, v = r != null || o != null || a != null || !!c || !!l || s, y = () => {
|
|
731
801
|
!d && f && f();
|
|
732
802
|
}, b = (e) => {
|
|
@@ -801,7 +871,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
801
871
|
})
|
|
802
872
|
})
|
|
803
873
|
}),
|
|
804
|
-
l && /* @__PURE__ */ m(
|
|
874
|
+
l && /* @__PURE__ */ m(F, {
|
|
805
875
|
...l,
|
|
806
876
|
disabled: d || l.disabled,
|
|
807
877
|
fallbackLabel: typeof e == "string" ? e : void 0
|
|
@@ -827,7 +897,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
827
897
|
})
|
|
828
898
|
]
|
|
829
899
|
});
|
|
830
|
-
},
|
|
900
|
+
}, L = ({ children: e, tone: t = "focus", align: n = "center", disabled: r = !1, onClick: i, className: a = "", style: o }) => {
|
|
831
901
|
let s = [
|
|
832
902
|
"tp-list-button",
|
|
833
903
|
`tp-list-button--tone-${t}`,
|
|
@@ -843,7 +913,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
843
913
|
onClick: r ? void 0 : i,
|
|
844
914
|
children: e
|
|
845
915
|
});
|
|
846
|
-
},
|
|
916
|
+
}, R = ({ title: e, count: t, action: n, className: r = "", style: i }) => {
|
|
847
917
|
let a = ["tp-section-header", r].filter(Boolean).join(" ");
|
|
848
918
|
return /* @__PURE__ */ h("div", {
|
|
849
919
|
className: a,
|
|
@@ -866,7 +936,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
866
936
|
children: n
|
|
867
937
|
})]
|
|
868
938
|
});
|
|
869
|
-
},
|
|
939
|
+
}, z = ({ children: e, tone: t = "default", className: n = "", style: r }) => {
|
|
870
940
|
let i = [
|
|
871
941
|
"tp-section-note",
|
|
872
942
|
`tp-section-note--${t}`,
|
|
@@ -877,7 +947,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
877
947
|
style: r,
|
|
878
948
|
children: e
|
|
879
949
|
});
|
|
880
|
-
},
|
|
950
|
+
}, B = {
|
|
881
951
|
title1: "h1",
|
|
882
952
|
title2: "h2",
|
|
883
953
|
title3: "h3",
|
|
@@ -886,8 +956,8 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
886
956
|
subhead: "span",
|
|
887
957
|
caption: "span",
|
|
888
958
|
footnote: "span"
|
|
889
|
-
},
|
|
890
|
-
let s = n ??
|
|
959
|
+
}, V = ({ variant: e = "body", tone: t = "primary", as: n, weight: r, className: i = "", style: a, children: o }) => {
|
|
960
|
+
let s = n ?? B[e], c = [
|
|
891
961
|
"tp-text",
|
|
892
962
|
`tp-text--${e}`,
|
|
893
963
|
`tp-text--tone-${t}`,
|
|
@@ -899,7 +969,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
899
969
|
style: a,
|
|
900
970
|
children: o
|
|
901
971
|
});
|
|
902
|
-
},
|
|
972
|
+
}, H = ({ children: e, tone: t, selected: n, size: r = "md", closable: i = !1, onClose: a, onClick: o, className: s = "", style: c }) => {
|
|
903
973
|
let l = t ?? (n ? "focus" : "neutral"), u = n === !0 ? "tp-tag--selected" : n === !1 ? "tp-tag--unselected" : "", d = [
|
|
904
974
|
"tp-tag",
|
|
905
975
|
`tp-tag--${r}`,
|
|
@@ -947,7 +1017,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
947
1017
|
})
|
|
948
1018
|
}) : null]
|
|
949
1019
|
});
|
|
950
|
-
},
|
|
1020
|
+
}, U = ({ count: e, dot: t = !1, tone: n = "alert", max: r = 99, showZero: i = !1, children: a, className: o = "", style: s }) => {
|
|
951
1021
|
let c = null, l = !1;
|
|
952
1022
|
t ? l = !0 : e != null && (typeof e == "number" ? (e > 0 || e === 0 && i) && (l = !0, c = e > r ? `${r}+` : String(e)) : e !== "" && (e !== "0" || i) && (l = !0, c = e));
|
|
953
1023
|
let u = l ? /* @__PURE__ */ m("span", {
|
|
@@ -966,7 +1036,7 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
966
1036
|
style: s,
|
|
967
1037
|
children: [a, u]
|
|
968
1038
|
}) : u;
|
|
969
|
-
},
|
|
1039
|
+
}, W = ({ illustration: e, theme: n, icon: r, title: i, description: a, actionText: o, onAction: s, compact: c = !1, className: l = "", style: u }) => {
|
|
970
1040
|
let d = [
|
|
971
1041
|
"tp-empty-state",
|
|
972
1042
|
c ? "tp-empty-state--compact" : "",
|
|
@@ -1003,83 +1073,89 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1003
1073
|
})
|
|
1004
1074
|
]
|
|
1005
1075
|
});
|
|
1006
|
-
},
|
|
1007
|
-
let
|
|
1008
|
-
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
},
|
|
1076
|
+
}, G = ({ variant: e = "standard", label: t, value: n, defaultValue: r = "", onChange: i, clearable: a = !1, password: o = !1, multiline: s = !1, rows: c = 3, error: u, helperText: p, prefix: g, suffix: _, containerClassName: v = "", className: y = "", style: b, id: x, type: S = "text", disabled: C = !1, readOnly: w = !1, onFocus: T, onBlur: E, ...D }) => {
|
|
1077
|
+
let O = l(), k = x ?? `tp-input-${O}`, A = `${k}-message`, j = d(null), M = d(null), [N, P] = f(r), [F, I] = f(!1), [L, R] = f(!1), z = n !== void 0, B = z ? n : N, V = !!(u || p), H = (e) => {
|
|
1078
|
+
z || P(e), i?.(e);
|
|
1079
|
+
}, U = () => {
|
|
1080
|
+
H(""), s ? M.current?.focus() : j.current?.focus();
|
|
1081
|
+
}, W = a && B.length > 0 && !C && !w, G = o && !s, ee = o ? L ? "text" : "password" : S, K = [
|
|
1082
|
+
"tp-input-field",
|
|
1083
|
+
`tp-input-field--${e}`,
|
|
1084
|
+
v
|
|
1085
|
+
].filter(Boolean).join(" "), q = [
|
|
1012
1086
|
"tp-input-box",
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1087
|
+
`tp-input-box--variant-${e}`,
|
|
1088
|
+
s ? "tp-input-box--multiline" : "",
|
|
1089
|
+
F ? "tp-input-box--focused" : "",
|
|
1090
|
+
u ? "tp-input-box--error" : "",
|
|
1091
|
+
C ? "tp-input-box--disabled" : ""
|
|
1017
1092
|
].filter(Boolean).join(" ");
|
|
1018
1093
|
return /* @__PURE__ */ h("div", {
|
|
1019
|
-
className:
|
|
1094
|
+
className: K,
|
|
1095
|
+
"data-variant": e,
|
|
1020
1096
|
children: [
|
|
1021
|
-
e != null && /* @__PURE__ */ m("label", {
|
|
1022
|
-
htmlFor:
|
|
1097
|
+
e !== "borderless" && t != null && /* @__PURE__ */ m("label", {
|
|
1098
|
+
htmlFor: k,
|
|
1023
1099
|
className: "tp-input-label",
|
|
1024
|
-
children:
|
|
1100
|
+
children: t
|
|
1025
1101
|
}),
|
|
1026
1102
|
/* @__PURE__ */ h("div", {
|
|
1027
|
-
className:
|
|
1103
|
+
className: q,
|
|
1028
1104
|
children: [
|
|
1029
|
-
|
|
1105
|
+
g != null && /* @__PURE__ */ m("span", {
|
|
1030
1106
|
className: "tp-input-prefix",
|
|
1031
|
-
children:
|
|
1107
|
+
children: g
|
|
1032
1108
|
}),
|
|
1033
|
-
|
|
1034
|
-
ref:
|
|
1035
|
-
id:
|
|
1036
|
-
name:
|
|
1037
|
-
rows:
|
|
1038
|
-
placeholder:
|
|
1039
|
-
maxLength:
|
|
1040
|
-
autoFocus:
|
|
1041
|
-
autoComplete:
|
|
1042
|
-
required:
|
|
1043
|
-
disabled:
|
|
1044
|
-
readOnly:
|
|
1045
|
-
value:
|
|
1046
|
-
"aria-label":
|
|
1047
|
-
"aria-invalid":
|
|
1048
|
-
"aria-describedby":
|
|
1049
|
-
className: `tp-input-textarea ${
|
|
1050
|
-
style:
|
|
1051
|
-
onChange: (e) =>
|
|
1109
|
+
s ? /* @__PURE__ */ m("textarea", {
|
|
1110
|
+
ref: M,
|
|
1111
|
+
id: k,
|
|
1112
|
+
name: D.name,
|
|
1113
|
+
rows: c,
|
|
1114
|
+
placeholder: D.placeholder,
|
|
1115
|
+
maxLength: D.maxLength,
|
|
1116
|
+
autoFocus: D.autoFocus,
|
|
1117
|
+
autoComplete: D.autoComplete,
|
|
1118
|
+
required: D.required,
|
|
1119
|
+
disabled: C,
|
|
1120
|
+
readOnly: w,
|
|
1121
|
+
value: B,
|
|
1122
|
+
"aria-label": D["aria-label"],
|
|
1123
|
+
"aria-invalid": u ? !0 : void 0,
|
|
1124
|
+
"aria-describedby": V ? A : D["aria-describedby"],
|
|
1125
|
+
className: `tp-input-textarea ${y}`.trim(),
|
|
1126
|
+
style: b,
|
|
1127
|
+
onChange: (e) => H(e.target.value),
|
|
1052
1128
|
onFocus: (e) => {
|
|
1053
|
-
|
|
1129
|
+
I(!0), T?.(e);
|
|
1054
1130
|
},
|
|
1055
1131
|
onBlur: (e) => {
|
|
1056
|
-
|
|
1132
|
+
I(!1), E?.(e);
|
|
1057
1133
|
}
|
|
1058
1134
|
}) : /* @__PURE__ */ m("input", {
|
|
1059
|
-
...
|
|
1060
|
-
ref:
|
|
1061
|
-
id:
|
|
1062
|
-
type:
|
|
1063
|
-
disabled:
|
|
1064
|
-
readOnly:
|
|
1065
|
-
value:
|
|
1066
|
-
"aria-invalid":
|
|
1067
|
-
"aria-describedby":
|
|
1068
|
-
className: `tp-input-control ${
|
|
1069
|
-
style:
|
|
1070
|
-
onChange: (e) =>
|
|
1135
|
+
...D,
|
|
1136
|
+
ref: j,
|
|
1137
|
+
id: k,
|
|
1138
|
+
type: ee,
|
|
1139
|
+
disabled: C,
|
|
1140
|
+
readOnly: w,
|
|
1141
|
+
value: B,
|
|
1142
|
+
"aria-invalid": u ? !0 : void 0,
|
|
1143
|
+
"aria-describedby": V ? A : D["aria-describedby"],
|
|
1144
|
+
className: `tp-input-control ${y}`.trim(),
|
|
1145
|
+
style: b,
|
|
1146
|
+
onChange: (e) => H(e.target.value),
|
|
1071
1147
|
onFocus: (e) => {
|
|
1072
|
-
|
|
1148
|
+
I(!0), T?.(e);
|
|
1073
1149
|
},
|
|
1074
1150
|
onBlur: (e) => {
|
|
1075
|
-
|
|
1151
|
+
I(!1), E?.(e);
|
|
1076
1152
|
}
|
|
1077
1153
|
}),
|
|
1078
|
-
|
|
1154
|
+
W && /* @__PURE__ */ m("button", {
|
|
1079
1155
|
type: "button",
|
|
1080
1156
|
className: "tp-input-action-btn",
|
|
1081
1157
|
"aria-label": "Clear input",
|
|
1082
|
-
onClick:
|
|
1158
|
+
onClick: U,
|
|
1083
1159
|
children: /* @__PURE__ */ h("svg", {
|
|
1084
1160
|
width: "14",
|
|
1085
1161
|
height: "14",
|
|
@@ -1100,12 +1176,12 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1100
1176
|
})]
|
|
1101
1177
|
})
|
|
1102
1178
|
}),
|
|
1103
|
-
|
|
1179
|
+
G && /* @__PURE__ */ m("button", {
|
|
1104
1180
|
type: "button",
|
|
1105
1181
|
className: "tp-input-action-btn",
|
|
1106
|
-
"aria-label":
|
|
1107
|
-
onClick: () =>
|
|
1108
|
-
children:
|
|
1182
|
+
"aria-label": L ? "Hide password" : "Show password",
|
|
1183
|
+
onClick: () => R((e) => !e),
|
|
1184
|
+
children: L ? /* @__PURE__ */ h("svg", {
|
|
1109
1185
|
width: "18",
|
|
1110
1186
|
height: "18",
|
|
1111
1187
|
viewBox: "0 0 20 20",
|
|
@@ -1136,25 +1212,25 @@ var M = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1136
1212
|
})
|
|
1137
1213
|
})
|
|
1138
1214
|
}),
|
|
1139
|
-
|
|
1215
|
+
_ != null && /* @__PURE__ */ m("span", {
|
|
1140
1216
|
className: "tp-input-suffix",
|
|
1141
|
-
children:
|
|
1217
|
+
children: _
|
|
1142
1218
|
})
|
|
1143
1219
|
]
|
|
1144
1220
|
}),
|
|
1145
|
-
|
|
1146
|
-
id:
|
|
1221
|
+
u ? /* @__PURE__ */ m("div", {
|
|
1222
|
+
id: A,
|
|
1147
1223
|
className: "tp-input-error",
|
|
1148
1224
|
role: "alert",
|
|
1149
|
-
children: c
|
|
1150
|
-
}) : u ? /* @__PURE__ */ m("div", {
|
|
1151
|
-
id: k,
|
|
1152
|
-
className: "tp-input-helper",
|
|
1153
1225
|
children: u
|
|
1226
|
+
}) : p ? /* @__PURE__ */ m("div", {
|
|
1227
|
+
id: A,
|
|
1228
|
+
className: "tp-input-helper",
|
|
1229
|
+
children: p
|
|
1154
1230
|
}) : null
|
|
1155
1231
|
]
|
|
1156
1232
|
});
|
|
1157
|
-
},
|
|
1233
|
+
}, ee = ({ value: e, defaultValue: t = "", placeholder: n = "Search", onChange: r, onSearch: i, onCancel: a, showCancel: o = !1, autoFocus: s = !1, className: c = "", style: l }) => {
|
|
1158
1234
|
let u = d(null), [p, g] = f(t), _ = e !== void 0, v = _ ? e : p, y = (e) => {
|
|
1159
1235
|
_ || g(e), r?.(e);
|
|
1160
1236
|
};
|
|
@@ -1358,7 +1434,7 @@ function J(e, t) {
|
|
|
1358
1434
|
function Y(e, t, n) {
|
|
1359
1435
|
return Math.min(n, Math.max(t, e));
|
|
1360
1436
|
}
|
|
1361
|
-
var
|
|
1437
|
+
var te = ({ value: e, defaultValue: t, minYear: n = 1990, maxYear: r = 2040, onChange: i, onConfirm: a, onCancel: o, title: s, className: c = "", style: l }) => {
|
|
1362
1438
|
let [d, p] = f(() => t ?? new Date(2026, 0, 1)), g = e !== void 0, _ = g ? e : d, v = Y(_.getFullYear(), n, r), y = _.getMonth() + 1, b = J(v, y), x = Math.min(b, _.getDate()), S = u(() => {
|
|
1363
1439
|
let e = [];
|
|
1364
1440
|
for (let t = n; t <= r; t++) e.push({
|
|
@@ -1451,7 +1527,7 @@ function X(e, t) {
|
|
|
1451
1527
|
minute: Math.min(59, Math.max(0, e.minute))
|
|
1452
1528
|
};
|
|
1453
1529
|
}
|
|
1454
|
-
var
|
|
1530
|
+
var ne = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, className: i = "", style: a }) => {
|
|
1455
1531
|
let [o, s] = f(() => X({
|
|
1456
1532
|
hour: 9,
|
|
1457
1533
|
minute: 0,
|
|
@@ -1572,7 +1648,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1572
1648
|
enTitle: "Saturday",
|
|
1573
1649
|
zhTitle: "周六"
|
|
1574
1650
|
}
|
|
1575
|
-
],
|
|
1651
|
+
], re = ({ value: e, defaultValue: t = [], onChange: n, disabled: r = !1, locale: i = "en", className: a = "", style: o }) => {
|
|
1576
1652
|
let [s, c] = f(t), l = e !== void 0, u = l ? e : s, d = (e) => {
|
|
1577
1653
|
if (r) return;
|
|
1578
1654
|
let t = new Set(u);
|
|
@@ -1603,7 +1679,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1603
1679
|
}, e.key);
|
|
1604
1680
|
})
|
|
1605
1681
|
});
|
|
1606
|
-
},
|
|
1682
|
+
}, ie = [
|
|
1607
1683
|
"1",
|
|
1608
1684
|
"2",
|
|
1609
1685
|
"3",
|
|
@@ -1613,14 +1689,14 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1613
1689
|
"7",
|
|
1614
1690
|
"8",
|
|
1615
1691
|
"9"
|
|
1616
|
-
],
|
|
1692
|
+
], ae = [
|
|
1617
1693
|
"A",
|
|
1618
1694
|
"B",
|
|
1619
1695
|
"C",
|
|
1620
1696
|
"D",
|
|
1621
1697
|
"E",
|
|
1622
1698
|
"F"
|
|
1623
|
-
],
|
|
1699
|
+
], oe = ({ mode: e = "numeric", onKeyPress: t, onBackspace: n, onDone: r, doneLabel: i = "Done", showDot: a = !1, showDash: o, className: s = "", style: c }) => {
|
|
1624
1700
|
let l = o ?? e === "mac-hex", u = a && l, d = u ? null : a ? "." : l ? "-" : null, f = [
|
|
1625
1701
|
"tp-keyboard",
|
|
1626
1702
|
`tp-keyboard--${e}`,
|
|
@@ -1634,7 +1710,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1634
1710
|
children: [
|
|
1635
1711
|
e === "mac-hex" && /* @__PURE__ */ m("div", {
|
|
1636
1712
|
className: "tp-keyboard-hex-row",
|
|
1637
|
-
children:
|
|
1713
|
+
children: ae.map((e) => /* @__PURE__ */ m("button", {
|
|
1638
1714
|
type: "button",
|
|
1639
1715
|
className: "tp-keyboard-key tp-keyboard-key--hex",
|
|
1640
1716
|
onClick: () => t?.(e),
|
|
@@ -1658,7 +1734,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1658
1734
|
/* @__PURE__ */ h("div", {
|
|
1659
1735
|
className: "tp-keyboard-grid",
|
|
1660
1736
|
children: [
|
|
1661
|
-
|
|
1737
|
+
ie.map((e) => /* @__PURE__ */ m("button", {
|
|
1662
1738
|
type: "button",
|
|
1663
1739
|
className: "tp-keyboard-key",
|
|
1664
1740
|
onClick: () => t?.(e),
|
|
@@ -1713,7 +1789,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1713
1789
|
})
|
|
1714
1790
|
]
|
|
1715
1791
|
});
|
|
1716
|
-
},
|
|
1792
|
+
}, se = ({ open: t, title: n, message: r, actions: i, os: a, inputPlaceholder: o, defaultInputValue: s = "", onClose: u, children: d }) => {
|
|
1717
1793
|
let p = e(), g = a ?? p.os, _ = l(), v = l(), [y, b] = f(s);
|
|
1718
1794
|
if (c(() => {
|
|
1719
1795
|
t && b(s);
|
|
@@ -1783,7 +1859,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1783
1859
|
})]
|
|
1784
1860
|
})
|
|
1785
1861
|
});
|
|
1786
|
-
},
|
|
1862
|
+
}, ce = () => /* @__PURE__ */ m("svg", {
|
|
1787
1863
|
width: "18",
|
|
1788
1864
|
height: "18",
|
|
1789
1865
|
viewBox: "0 0 24 24",
|
|
@@ -1796,7 +1872,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1796
1872
|
strokeLinecap: "round",
|
|
1797
1873
|
strokeLinejoin: "round"
|
|
1798
1874
|
})
|
|
1799
|
-
}),
|
|
1875
|
+
}), le = ({ open: t, title: n, message: r, options: i, cancelText: a = "Cancel", os: o, onSelect: s, onClose: u }) => {
|
|
1800
1876
|
let d = e(), f = o ?? d.os, p = l();
|
|
1801
1877
|
if (c(() => {
|
|
1802
1878
|
if (!t) return;
|
|
@@ -1864,7 +1940,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1864
1940
|
}),
|
|
1865
1941
|
e.selected && /* @__PURE__ */ m("span", {
|
|
1866
1942
|
className: "tp-actionsheet-option-check",
|
|
1867
|
-
children: /* @__PURE__ */ m(
|
|
1943
|
+
children: /* @__PURE__ */ m(ce, {})
|
|
1868
1944
|
})
|
|
1869
1945
|
]
|
|
1870
1946
|
}, e.key);
|
|
@@ -1889,7 +1965,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1889
1965
|
}))]
|
|
1890
1966
|
})
|
|
1891
1967
|
});
|
|
1892
|
-
},
|
|
1968
|
+
}, ue = () => /* @__PURE__ */ m("svg", {
|
|
1893
1969
|
width: "14",
|
|
1894
1970
|
height: "14",
|
|
1895
1971
|
viewBox: "0 0 16 16",
|
|
@@ -1901,7 +1977,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1901
1977
|
strokeWidth: "1.8",
|
|
1902
1978
|
strokeLinecap: "round"
|
|
1903
1979
|
})
|
|
1904
|
-
}),
|
|
1980
|
+
}), de = ({ open: e, title: t, subtitle: n, onClose: r, showCloseButton: i, showGrabber: a = !0, footer: o, maxHeight: s = "85%", children: u }) => {
|
|
1905
1981
|
let d = l();
|
|
1906
1982
|
if (c(() => {
|
|
1907
1983
|
if (!e) return;
|
|
@@ -1944,7 +2020,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1944
2020
|
className: "tp-bottomsheet-close",
|
|
1945
2021
|
"aria-label": "Close",
|
|
1946
2022
|
onClick: r,
|
|
1947
|
-
children: /* @__PURE__ */ m(
|
|
2023
|
+
children: /* @__PURE__ */ m(ue, {})
|
|
1948
2024
|
})]
|
|
1949
2025
|
}),
|
|
1950
2026
|
/* @__PURE__ */ m("div", {
|
|
@@ -1958,7 +2034,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1958
2034
|
]
|
|
1959
2035
|
})
|
|
1960
2036
|
});
|
|
1961
|
-
},
|
|
2037
|
+
}, fe = () => /* @__PURE__ */ m("svg", {
|
|
1962
2038
|
width: "14",
|
|
1963
2039
|
height: "14",
|
|
1964
2040
|
viewBox: "0 0 16 16",
|
|
@@ -1970,7 +2046,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1970
2046
|
strokeWidth: "1.8",
|
|
1971
2047
|
strokeLinecap: "round"
|
|
1972
2048
|
})
|
|
1973
|
-
}),
|
|
2049
|
+
}), pe = ({ open: e, placement: t = "center", title: n, closable: r = !0, maskClosable: i = !0, onClose: a, footer: o, className: s = "", style: u, children: d }) => {
|
|
1974
2050
|
let f = l();
|
|
1975
2051
|
if (c(() => {
|
|
1976
2052
|
if (!e) return;
|
|
@@ -2010,7 +2086,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2010
2086
|
className: "tp-popup-close",
|
|
2011
2087
|
"aria-label": "Close",
|
|
2012
2088
|
onClick: a,
|
|
2013
|
-
children: /* @__PURE__ */ m(
|
|
2089
|
+
children: /* @__PURE__ */ m(fe, {})
|
|
2014
2090
|
})]
|
|
2015
2091
|
}),
|
|
2016
2092
|
/* @__PURE__ */ m("div", {
|
|
@@ -2024,7 +2100,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2024
2100
|
]
|
|
2025
2101
|
})
|
|
2026
2102
|
});
|
|
2027
|
-
},
|
|
2103
|
+
}, me = () => /* @__PURE__ */ m("svg", {
|
|
2028
2104
|
width: "16",
|
|
2029
2105
|
height: "16",
|
|
2030
2106
|
viewBox: "0 0 24 24",
|
|
@@ -2037,7 +2113,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2037
2113
|
strokeLinecap: "round",
|
|
2038
2114
|
strokeLinejoin: "round"
|
|
2039
2115
|
})
|
|
2040
|
-
}),
|
|
2116
|
+
}), he = ({ open: e, items: t, onSelect: n, onClose: r, align: a = "left", className: o = "", style: s }) => {
|
|
2041
2117
|
let l = d(null);
|
|
2042
2118
|
if (c(() => {
|
|
2043
2119
|
if (!e) return;
|
|
@@ -2098,13 +2174,13 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2098
2174
|
e.selected && /* @__PURE__ */ m("span", {
|
|
2099
2175
|
className: "tp-menu-item-check",
|
|
2100
2176
|
"aria-label": "selected",
|
|
2101
|
-
children: /* @__PURE__ */ m(
|
|
2177
|
+
children: /* @__PURE__ */ m(me, {})
|
|
2102
2178
|
})
|
|
2103
2179
|
]
|
|
2104
2180
|
})] }, e.key);
|
|
2105
2181
|
})
|
|
2106
2182
|
});
|
|
2107
|
-
},
|
|
2183
|
+
}, ge = ({ type: e }) => {
|
|
2108
2184
|
switch (e) {
|
|
2109
2185
|
case "info": return /* @__PURE__ */ h("svg", {
|
|
2110
2186
|
width: "18",
|
|
@@ -2245,7 +2321,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2245
2321
|
l,
|
|
2246
2322
|
a
|
|
2247
2323
|
]), !e) return null;
|
|
2248
|
-
let u = /* @__PURE__ */ m(
|
|
2324
|
+
let u = /* @__PURE__ */ m(ge, { type: t });
|
|
2249
2325
|
return /* @__PURE__ */ m("div", {
|
|
2250
2326
|
className: `tp-toast-container tp-toast-container--${i}`,
|
|
2251
2327
|
children: /* @__PURE__ */ h("div", {
|
|
@@ -2266,7 +2342,7 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2266
2342
|
}, $ = a({
|
|
2267
2343
|
show: () => {},
|
|
2268
2344
|
dismiss: () => {}
|
|
2269
|
-
}),
|
|
2345
|
+
}), _e = ({ children: e }) => {
|
|
2270
2346
|
let [t, n] = f(null), r = d(null), i = o(() => {
|
|
2271
2347
|
r.current !== null && (clearTimeout(r.current), r.current = null);
|
|
2272
2348
|
}, []), a = o(() => {
|
|
@@ -2306,11 +2382,931 @@ var te = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2306
2382
|
})]
|
|
2307
2383
|
});
|
|
2308
2384
|
};
|
|
2309
|
-
function
|
|
2385
|
+
function ve() {
|
|
2310
2386
|
return s($);
|
|
2311
2387
|
}
|
|
2312
|
-
// src/core/components/
|
|
2313
|
-
var
|
|
2388
|
+
// src/core/components/TPLiquidGlass.tsx
|
|
2389
|
+
var ye = ({ shape: e = "pill", tint: t = "clear", interactive: n = !1, as: r = "div", ariaLabel: i, disabled: a = !1, onClick: o, className: s = "", style: c, children: l }) => {
|
|
2390
|
+
let u = r, d = [
|
|
2391
|
+
"tp-liquid-glass",
|
|
2392
|
+
`tp-liquid-glass--${e}`,
|
|
2393
|
+
`tp-liquid-glass--tint-${t}`,
|
|
2394
|
+
n ? "tp-liquid-glass--interactive" : "",
|
|
2395
|
+
a ? "tp-liquid-glass--disabled" : "",
|
|
2396
|
+
s
|
|
2397
|
+
].filter(Boolean).join(" ");
|
|
2398
|
+
return /* @__PURE__ */ m(u, {
|
|
2399
|
+
type: r === "button" ? "button" : void 0,
|
|
2400
|
+
disabled: r === "button" ? a : void 0,
|
|
2401
|
+
"aria-label": i,
|
|
2402
|
+
"aria-disabled": r !== "button" && a ? !0 : void 0,
|
|
2403
|
+
"data-shape": e,
|
|
2404
|
+
"data-tint": t,
|
|
2405
|
+
className: d,
|
|
2406
|
+
style: c,
|
|
2407
|
+
onClick: a ? void 0 : o,
|
|
2408
|
+
children: l
|
|
2409
|
+
});
|
|
2410
|
+
};
|
|
2411
|
+
// src/core/components/TPIconButton.tsx
|
|
2412
|
+
function be(e) {
|
|
2413
|
+
return e == null || e === !1 || e === "" || e === 0 ? null : e === !0 ? /* @__PURE__ */ m("span", {
|
|
2414
|
+
className: "tp-icon-btn-badge tp-icon-btn-badge--dot",
|
|
2415
|
+
"aria-hidden": "true"
|
|
2416
|
+
}) : /* @__PURE__ */ m("span", {
|
|
2417
|
+
className: "tp-icon-btn-badge",
|
|
2418
|
+
children: typeof e == "number" && e > 99 ? "99+" : String(e)
|
|
2419
|
+
});
|
|
2420
|
+
}
|
|
2421
|
+
var xe = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o = !1, ariaLabel: s, onClick: c, className: l = "", style: u }) => {
|
|
2422
|
+
let d = i === "sm" ? 16 : i === "lg" ? 22 : 19, f = typeof e == "string" && n(e) ? /* @__PURE__ */ m(r, {
|
|
2423
|
+
name: e,
|
|
2424
|
+
size: d
|
|
2425
|
+
}) : e, p = [
|
|
2426
|
+
"tp-icon-btn",
|
|
2427
|
+
`tp-icon-btn--${t}`,
|
|
2428
|
+
`tp-icon-btn--${i}`,
|
|
2429
|
+
o ? "tp-icon-btn--disabled" : "",
|
|
2430
|
+
l
|
|
2431
|
+
].filter(Boolean).join(" ");
|
|
2432
|
+
return /* @__PURE__ */ h("button", {
|
|
2433
|
+
type: "button",
|
|
2434
|
+
className: p,
|
|
2435
|
+
"data-variant": t,
|
|
2436
|
+
"data-size": i,
|
|
2437
|
+
"aria-label": s,
|
|
2438
|
+
disabled: o,
|
|
2439
|
+
onClick: c,
|
|
2440
|
+
style: u,
|
|
2441
|
+
children: [/* @__PURE__ */ m("span", {
|
|
2442
|
+
className: "tp-icon-btn-glyph",
|
|
2443
|
+
children: f
|
|
2444
|
+
}), be(a)]
|
|
2445
|
+
});
|
|
2446
|
+
}, Se = ({ variant: e = "glass", children: t, className: n = "", style: r }) => /* @__PURE__ */ m("div", {
|
|
2447
|
+
className: `tp-icon-btn-group tp-icon-btn-group--${e} ${n}`.trim(),
|
|
2448
|
+
"data-variant": e,
|
|
2449
|
+
role: "group",
|
|
2450
|
+
style: r,
|
|
2451
|
+
children: t
|
|
2452
|
+
}), Ce = ({ checked: e, defaultChecked: t = !1, indeterminate: n = !1, disabled: r = !1, label: i, description: a, onChange: o, ariaLabel: s, className: c = "", style: u }) => {
|
|
2453
|
+
let d = l(), p = e !== void 0, [g, _] = f(t), v = p ? e : g, y = () => {
|
|
2454
|
+
if (r) return;
|
|
2455
|
+
let e = !v;
|
|
2456
|
+
p || _(e), o?.(e);
|
|
2457
|
+
}, b = [
|
|
2458
|
+
"tp-check-row",
|
|
2459
|
+
v ? "tp-check-row--checked" : "",
|
|
2460
|
+
n ? "tp-check-row--indeterminate" : "",
|
|
2461
|
+
r ? "tp-check-row--disabled" : "",
|
|
2462
|
+
c
|
|
2463
|
+
].filter(Boolean).join(" ");
|
|
2464
|
+
return /* @__PURE__ */ h("label", {
|
|
2465
|
+
htmlFor: d,
|
|
2466
|
+
className: b,
|
|
2467
|
+
style: u,
|
|
2468
|
+
children: [
|
|
2469
|
+
/* @__PURE__ */ m("input", {
|
|
2470
|
+
id: d,
|
|
2471
|
+
type: "checkbox",
|
|
2472
|
+
className: "tp-check-native",
|
|
2473
|
+
checked: v,
|
|
2474
|
+
disabled: r,
|
|
2475
|
+
"aria-label": s,
|
|
2476
|
+
"aria-checked": n ? "mixed" : v,
|
|
2477
|
+
onChange: y
|
|
2478
|
+
}),
|
|
2479
|
+
/* @__PURE__ */ m("span", {
|
|
2480
|
+
className: `tp-checkbox-box ${v || n ? "tp-checkbox-box--active" : ""}`.trim(),
|
|
2481
|
+
"aria-hidden": "true",
|
|
2482
|
+
children: n ? /* @__PURE__ */ m("svg", {
|
|
2483
|
+
width: "12",
|
|
2484
|
+
height: "12",
|
|
2485
|
+
viewBox: "0 0 12 12",
|
|
2486
|
+
fill: "none",
|
|
2487
|
+
children: /* @__PURE__ */ m("path", {
|
|
2488
|
+
d: "M2.5 6H9.5",
|
|
2489
|
+
stroke: "currentColor",
|
|
2490
|
+
strokeWidth: "1.9",
|
|
2491
|
+
strokeLinecap: "round"
|
|
2492
|
+
})
|
|
2493
|
+
}) : v ? /* @__PURE__ */ m("svg", {
|
|
2494
|
+
width: "12",
|
|
2495
|
+
height: "12",
|
|
2496
|
+
viewBox: "0 0 12 12",
|
|
2497
|
+
fill: "none",
|
|
2498
|
+
children: /* @__PURE__ */ m("path", {
|
|
2499
|
+
d: "M2.5 6.2L5 8.7L9.5 3.6",
|
|
2500
|
+
stroke: "currentColor",
|
|
2501
|
+
strokeWidth: "1.9",
|
|
2502
|
+
strokeLinecap: "round",
|
|
2503
|
+
strokeLinejoin: "round"
|
|
2504
|
+
})
|
|
2505
|
+
}) : null
|
|
2506
|
+
}),
|
|
2507
|
+
(i !== void 0 || a !== void 0) && /* @__PURE__ */ h("span", {
|
|
2508
|
+
className: "tp-check-texts",
|
|
2509
|
+
children: [i !== void 0 && /* @__PURE__ */ m("span", {
|
|
2510
|
+
className: "tp-check-label",
|
|
2511
|
+
children: i
|
|
2512
|
+
}), a !== void 0 && /* @__PURE__ */ m("span", {
|
|
2513
|
+
className: "tp-check-desc",
|
|
2514
|
+
children: a
|
|
2515
|
+
})]
|
|
2516
|
+
})
|
|
2517
|
+
]
|
|
2518
|
+
});
|
|
2519
|
+
}, we = ({ options: e, value: t, defaultValue: n = [], onChange: r, direction: i = "vertical", disabled: a = !1, className: o = "", style: s }) => {
|
|
2520
|
+
let c = t !== void 0, [l, u] = f([...n]), d = c ? t : l, p = (e, t) => {
|
|
2521
|
+
let n = t ? d.includes(e) ? [...d] : [...d, e] : d.filter((t) => t !== e);
|
|
2522
|
+
c || u(n), r?.(n);
|
|
2523
|
+
};
|
|
2524
|
+
return /* @__PURE__ */ m("div", {
|
|
2525
|
+
role: "group",
|
|
2526
|
+
className: `tp-choice-group tp-choice-group--${i} ${o}`.trim(),
|
|
2527
|
+
style: s,
|
|
2528
|
+
children: e.map((e) => /* @__PURE__ */ m(Ce, {
|
|
2529
|
+
label: e.label,
|
|
2530
|
+
description: e.description,
|
|
2531
|
+
disabled: a || e.disabled,
|
|
2532
|
+
checked: d.includes(e.value),
|
|
2533
|
+
onChange: (t) => p(e.value, t)
|
|
2534
|
+
}, e.value))
|
|
2535
|
+
});
|
|
2536
|
+
}, Te = ({ checked: e, defaultChecked: t = !1, disabled: n = !1, label: r, description: i, value: a, name: o, onChange: s, ariaLabel: c, className: u = "", style: d }) => {
|
|
2537
|
+
let p = l(), g = e !== void 0, [_, v] = f(t), y = g ? e : _, b = () => {
|
|
2538
|
+
n || (g || v(!0), s?.(!0));
|
|
2539
|
+
}, x = [
|
|
2540
|
+
"tp-check-row",
|
|
2541
|
+
y ? "tp-check-row--checked" : "",
|
|
2542
|
+
n ? "tp-check-row--disabled" : "",
|
|
2543
|
+
u
|
|
2544
|
+
].filter(Boolean).join(" ");
|
|
2545
|
+
return /* @__PURE__ */ h("label", {
|
|
2546
|
+
htmlFor: p,
|
|
2547
|
+
className: x,
|
|
2548
|
+
style: d,
|
|
2549
|
+
children: [
|
|
2550
|
+
/* @__PURE__ */ m("input", {
|
|
2551
|
+
id: p,
|
|
2552
|
+
type: "radio",
|
|
2553
|
+
name: o,
|
|
2554
|
+
value: a,
|
|
2555
|
+
className: "tp-check-native",
|
|
2556
|
+
checked: y,
|
|
2557
|
+
disabled: n,
|
|
2558
|
+
"aria-label": c,
|
|
2559
|
+
onChange: b
|
|
2560
|
+
}),
|
|
2561
|
+
/* @__PURE__ */ m("span", {
|
|
2562
|
+
className: `tp-radio-ring ${y ? "tp-radio-ring--active" : ""}`.trim(),
|
|
2563
|
+
"aria-hidden": "true",
|
|
2564
|
+
children: y && /* @__PURE__ */ m("span", { className: "tp-radio-dot" })
|
|
2565
|
+
}),
|
|
2566
|
+
(r !== void 0 || i !== void 0) && /* @__PURE__ */ h("span", {
|
|
2567
|
+
className: "tp-check-texts",
|
|
2568
|
+
children: [r !== void 0 && /* @__PURE__ */ m("span", {
|
|
2569
|
+
className: "tp-check-label",
|
|
2570
|
+
children: r
|
|
2571
|
+
}), i !== void 0 && /* @__PURE__ */ m("span", {
|
|
2572
|
+
className: "tp-check-desc",
|
|
2573
|
+
children: i
|
|
2574
|
+
})]
|
|
2575
|
+
})
|
|
2576
|
+
]
|
|
2577
|
+
});
|
|
2578
|
+
}, Ee = ({ options: e, value: t, defaultValue: n, onChange: r, direction: i = "vertical", disabled: a = !1, name: o, className: s = "", style: c }) => {
|
|
2579
|
+
let u = l(), d = o ?? `tp-radio-group-${u}`, p = t !== void 0, [h, g] = f(n ?? e[0]?.value ?? ""), _ = p ? t : h, v = (e) => {
|
|
2580
|
+
p || g(e), r?.(e);
|
|
2581
|
+
};
|
|
2582
|
+
return /* @__PURE__ */ m("div", {
|
|
2583
|
+
role: "radiogroup",
|
|
2584
|
+
className: `tp-choice-group tp-choice-group--${i} ${s}`.trim(),
|
|
2585
|
+
style: c,
|
|
2586
|
+
children: e.map((e) => /* @__PURE__ */ m(Te, {
|
|
2587
|
+
name: d,
|
|
2588
|
+
value: e.value,
|
|
2589
|
+
label: e.label,
|
|
2590
|
+
description: e.description,
|
|
2591
|
+
disabled: a || e.disabled,
|
|
2592
|
+
checked: _ === e.value,
|
|
2593
|
+
onChange: () => v(e.value)
|
|
2594
|
+
}, e.value))
|
|
2595
|
+
});
|
|
2596
|
+
}, De = ({ actions: e, open: t, defaultOpen: n = !1, onOpenChange: r, disabled: i = !1, children: a, className: o = "", style: s }) => {
|
|
2597
|
+
let c = t !== void 0, [l, u] = f(n), p = c ? t : l, g = Math.max(72, e.length * 76), [_, v] = f(null), y = d(null), b = (e) => {
|
|
2598
|
+
c || u(e), r?.(e);
|
|
2599
|
+
}, x = _ === null ? p ? -g : 0 : _;
|
|
2600
|
+
return /* @__PURE__ */ h("div", {
|
|
2601
|
+
className: `tp-swipe-row ${p ? "tp-swipe-row--open" : ""} ${i ? "tp-swipe-row--disabled" : ""} ${o}`.trim(),
|
|
2602
|
+
"data-open": String(p),
|
|
2603
|
+
style: s,
|
|
2604
|
+
children: [/* @__PURE__ */ m("div", {
|
|
2605
|
+
className: "tp-swipe-actions",
|
|
2606
|
+
style: { width: `${g}px` },
|
|
2607
|
+
"aria-hidden": !p,
|
|
2608
|
+
children: e.map((e) => /* @__PURE__ */ m("button", {
|
|
2609
|
+
type: "button",
|
|
2610
|
+
disabled: i,
|
|
2611
|
+
tabIndex: p ? 0 : -1,
|
|
2612
|
+
className: `tp-swipe-action tp-swipe-action--${e.tone ?? "neutral"}`,
|
|
2613
|
+
onClick: () => {
|
|
2614
|
+
i || (e.onClick?.(), b(!1));
|
|
2615
|
+
},
|
|
2616
|
+
children: e.label
|
|
2617
|
+
}, e.key))
|
|
2618
|
+
}), /* @__PURE__ */ m("div", {
|
|
2619
|
+
className: "tp-swipe-content",
|
|
2620
|
+
style: { transform: `translateX(${x}px)` },
|
|
2621
|
+
onPointerDown: (e) => {
|
|
2622
|
+
i || (y.current = e.clientX);
|
|
2623
|
+
},
|
|
2624
|
+
onPointerMove: (e) => {
|
|
2625
|
+
if (i || y.current === null) return;
|
|
2626
|
+
let t = p ? -g : 0, n = e.clientX - y.current;
|
|
2627
|
+
if (Math.abs(n) > 6) {
|
|
2628
|
+
let e = Math.max(-g, Math.min(0, t + n));
|
|
2629
|
+
v(e);
|
|
2630
|
+
}
|
|
2631
|
+
},
|
|
2632
|
+
onPointerUp: (e) => {
|
|
2633
|
+
if (i || y.current === null) return;
|
|
2634
|
+
let t = e.clientX - y.current;
|
|
2635
|
+
y.current = null, v(null), t < -28 ? b(!0) : t > 24 && b(!1);
|
|
2636
|
+
},
|
|
2637
|
+
onPointerCancel: () => {
|
|
2638
|
+
y.current = null, v(null);
|
|
2639
|
+
},
|
|
2640
|
+
children: a
|
|
2641
|
+
})]
|
|
2642
|
+
});
|
|
2643
|
+
}, Oe = ({ content: e, arrowPosition: t = "bottom-left", contextAdaptive: n = !0, open: r, defaultOpen: i = !0, onOpenChange: a, children: o, className: s = "", style: c }) => {
|
|
2644
|
+
let l = r !== void 0, [u, d] = f(i), p = l ? r : u, g = () => {
|
|
2645
|
+
let e = !p;
|
|
2646
|
+
l || d(e), a?.(e);
|
|
2647
|
+
};
|
|
2648
|
+
return /* @__PURE__ */ h("div", {
|
|
2649
|
+
className: `tp-tooltip-wrap ${s}`.trim(),
|
|
2650
|
+
"data-arrow": t,
|
|
2651
|
+
style: c,
|
|
2652
|
+
children: [o !== void 0 && /* @__PURE__ */ m("span", {
|
|
2653
|
+
className: "tp-tooltip-trigger",
|
|
2654
|
+
role: "button",
|
|
2655
|
+
tabIndex: 0,
|
|
2656
|
+
"aria-expanded": p,
|
|
2657
|
+
onClick: g,
|
|
2658
|
+
onKeyDown: (e) => {
|
|
2659
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g());
|
|
2660
|
+
},
|
|
2661
|
+
children: o
|
|
2662
|
+
}), p && /* @__PURE__ */ h("div", {
|
|
2663
|
+
role: "tooltip",
|
|
2664
|
+
"data-arrow": t,
|
|
2665
|
+
"data-adaptive": String(n),
|
|
2666
|
+
className: `tp-tooltip-bubble tp-tooltip-bubble--${t} ${n ? "tp-tooltip-bubble--adaptive" : ""}`.trim(),
|
|
2667
|
+
children: [/* @__PURE__ */ m("span", {
|
|
2668
|
+
className: "tp-tooltip-content",
|
|
2669
|
+
children: e
|
|
2670
|
+
}), /* @__PURE__ */ m("span", {
|
|
2671
|
+
className: "tp-tooltip-arrow",
|
|
2672
|
+
"aria-hidden": "true"
|
|
2673
|
+
})]
|
|
2674
|
+
})]
|
|
2675
|
+
});
|
|
2676
|
+
}, ke = ({ status: e }) => {
|
|
2677
|
+
switch (e) {
|
|
2678
|
+
case "success": return /* @__PURE__ */ h("svg", {
|
|
2679
|
+
width: "18",
|
|
2680
|
+
height: "18",
|
|
2681
|
+
viewBox: "0 0 24 24",
|
|
2682
|
+
fill: "none",
|
|
2683
|
+
"aria-hidden": "true",
|
|
2684
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
2685
|
+
cx: "12",
|
|
2686
|
+
cy: "12",
|
|
2687
|
+
r: "9.5",
|
|
2688
|
+
stroke: "currentColor",
|
|
2689
|
+
strokeWidth: "1.7"
|
|
2690
|
+
}), /* @__PURE__ */ m("path", {
|
|
2691
|
+
d: "M8.2 12.2L10.8 14.8L15.8 9.4",
|
|
2692
|
+
stroke: "currentColor",
|
|
2693
|
+
strokeWidth: "1.8",
|
|
2694
|
+
strokeLinecap: "round",
|
|
2695
|
+
strokeLinejoin: "round"
|
|
2696
|
+
})]
|
|
2697
|
+
});
|
|
2698
|
+
case "warning": return /* @__PURE__ */ h("svg", {
|
|
2699
|
+
width: "18",
|
|
2700
|
+
height: "18",
|
|
2701
|
+
viewBox: "0 0 24 24",
|
|
2702
|
+
fill: "none",
|
|
2703
|
+
"aria-hidden": "true",
|
|
2704
|
+
children: [
|
|
2705
|
+
/* @__PURE__ */ m("circle", {
|
|
2706
|
+
cx: "12",
|
|
2707
|
+
cy: "12",
|
|
2708
|
+
r: "9.5",
|
|
2709
|
+
stroke: "currentColor",
|
|
2710
|
+
strokeWidth: "1.7"
|
|
2711
|
+
}),
|
|
2712
|
+
/* @__PURE__ */ m("rect", {
|
|
2713
|
+
x: "11.2",
|
|
2714
|
+
y: "7.2",
|
|
2715
|
+
width: "1.6",
|
|
2716
|
+
height: "5.8",
|
|
2717
|
+
rx: "0.4",
|
|
2718
|
+
fill: "currentColor"
|
|
2719
|
+
}),
|
|
2720
|
+
/* @__PURE__ */ m("rect", {
|
|
2721
|
+
x: "11.2",
|
|
2722
|
+
y: "14.6",
|
|
2723
|
+
width: "1.6",
|
|
2724
|
+
height: "1.7",
|
|
2725
|
+
rx: "0.4",
|
|
2726
|
+
fill: "currentColor"
|
|
2727
|
+
})
|
|
2728
|
+
]
|
|
2729
|
+
});
|
|
2730
|
+
case "danger": return /* @__PURE__ */ h("svg", {
|
|
2731
|
+
width: "18",
|
|
2732
|
+
height: "18",
|
|
2733
|
+
viewBox: "0 0 24 24",
|
|
2734
|
+
fill: "none",
|
|
2735
|
+
"aria-hidden": "true",
|
|
2736
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
2737
|
+
cx: "12",
|
|
2738
|
+
cy: "12",
|
|
2739
|
+
r: "9.5",
|
|
2740
|
+
stroke: "currentColor",
|
|
2741
|
+
strokeWidth: "1.7"
|
|
2742
|
+
}), /* @__PURE__ */ m("path", {
|
|
2743
|
+
d: "M9 9L15 15M15 9L9 15",
|
|
2744
|
+
stroke: "currentColor",
|
|
2745
|
+
strokeWidth: "1.8",
|
|
2746
|
+
strokeLinecap: "round"
|
|
2747
|
+
})]
|
|
2748
|
+
});
|
|
2749
|
+
default: return /* @__PURE__ */ h("svg", {
|
|
2750
|
+
width: "18",
|
|
2751
|
+
height: "18",
|
|
2752
|
+
viewBox: "0 0 24 24",
|
|
2753
|
+
fill: "none",
|
|
2754
|
+
"aria-hidden": "true",
|
|
2755
|
+
children: [
|
|
2756
|
+
/* @__PURE__ */ m("circle", {
|
|
2757
|
+
cx: "12",
|
|
2758
|
+
cy: "12",
|
|
2759
|
+
r: "9.5",
|
|
2760
|
+
stroke: "currentColor",
|
|
2761
|
+
strokeWidth: "1.7"
|
|
2762
|
+
}),
|
|
2763
|
+
/* @__PURE__ */ m("rect", {
|
|
2764
|
+
x: "11.2",
|
|
2765
|
+
y: "7.6",
|
|
2766
|
+
width: "1.6",
|
|
2767
|
+
height: "1.6",
|
|
2768
|
+
rx: "0.4",
|
|
2769
|
+
fill: "currentColor"
|
|
2770
|
+
}),
|
|
2771
|
+
/* @__PURE__ */ m("rect", {
|
|
2772
|
+
x: "11.2",
|
|
2773
|
+
y: "10.8",
|
|
2774
|
+
width: "1.6",
|
|
2775
|
+
height: "5.6",
|
|
2776
|
+
rx: "0.4",
|
|
2777
|
+
fill: "currentColor"
|
|
2778
|
+
})
|
|
2779
|
+
]
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
}, Ae = ({ status: e = "default", action: t = "none", actionLabel: n = "Details", onAction: r, onClose: i, message: a, className: o = "", style: s }) => /* @__PURE__ */ h("div", {
|
|
2783
|
+
role: e === "danger" ? "alert" : "status",
|
|
2784
|
+
"data-status": e,
|
|
2785
|
+
"data-action": t,
|
|
2786
|
+
className: `tp-fixed-toast tp-fixed-toast--${e} ${o}`.trim(),
|
|
2787
|
+
style: s,
|
|
2788
|
+
children: [
|
|
2789
|
+
/* @__PURE__ */ m("span", {
|
|
2790
|
+
className: "tp-fixed-toast-icon",
|
|
2791
|
+
children: /* @__PURE__ */ m(ke, { status: e })
|
|
2792
|
+
}),
|
|
2793
|
+
/* @__PURE__ */ m("div", {
|
|
2794
|
+
className: "tp-fixed-toast-message",
|
|
2795
|
+
children: a
|
|
2796
|
+
}),
|
|
2797
|
+
t === "button" && /* @__PURE__ */ m("button", {
|
|
2798
|
+
type: "button",
|
|
2799
|
+
className: "tp-fixed-toast-btn",
|
|
2800
|
+
onClick: r,
|
|
2801
|
+
children: n
|
|
2802
|
+
}),
|
|
2803
|
+
t === "go-to" && /* @__PURE__ */ m("button", {
|
|
2804
|
+
type: "button",
|
|
2805
|
+
className: "tp-fixed-toast-icon-action",
|
|
2806
|
+
"aria-label": n || "Go to",
|
|
2807
|
+
onClick: r,
|
|
2808
|
+
children: /* @__PURE__ */ m("svg", {
|
|
2809
|
+
width: "15",
|
|
2810
|
+
height: "15",
|
|
2811
|
+
viewBox: "0 0 16 16",
|
|
2812
|
+
fill: "none",
|
|
2813
|
+
"aria-hidden": "true",
|
|
2814
|
+
children: /* @__PURE__ */ m("path", {
|
|
2815
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
2816
|
+
stroke: "currentColor",
|
|
2817
|
+
strokeWidth: "1.8",
|
|
2818
|
+
strokeLinecap: "round",
|
|
2819
|
+
strokeLinejoin: "round"
|
|
2820
|
+
})
|
|
2821
|
+
})
|
|
2822
|
+
}),
|
|
2823
|
+
t === "close" && /* @__PURE__ */ m("button", {
|
|
2824
|
+
type: "button",
|
|
2825
|
+
className: "tp-fixed-toast-icon-action",
|
|
2826
|
+
"aria-label": "Close",
|
|
2827
|
+
onClick: i,
|
|
2828
|
+
children: /* @__PURE__ */ m("svg", {
|
|
2829
|
+
width: "14",
|
|
2830
|
+
height: "14",
|
|
2831
|
+
viewBox: "0 0 16 16",
|
|
2832
|
+
fill: "none",
|
|
2833
|
+
"aria-hidden": "true",
|
|
2834
|
+
children: /* @__PURE__ */ m("path", {
|
|
2835
|
+
d: "M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",
|
|
2836
|
+
stroke: "currentColor",
|
|
2837
|
+
strokeWidth: "1.7",
|
|
2838
|
+
strokeLinecap: "round"
|
|
2839
|
+
})
|
|
2840
|
+
})
|
|
2841
|
+
})
|
|
2842
|
+
]
|
|
2843
|
+
}), je = [
|
|
2844
|
+
"Jan",
|
|
2845
|
+
"Feb",
|
|
2846
|
+
"Mar",
|
|
2847
|
+
"Apr",
|
|
2848
|
+
"May",
|
|
2849
|
+
"Jun",
|
|
2850
|
+
"Jul",
|
|
2851
|
+
"Aug",
|
|
2852
|
+
"Sep",
|
|
2853
|
+
"Oct",
|
|
2854
|
+
"Nov",
|
|
2855
|
+
"Dec"
|
|
2856
|
+
], Me = [
|
|
2857
|
+
"1月",
|
|
2858
|
+
"2月",
|
|
2859
|
+
"3月",
|
|
2860
|
+
"4月",
|
|
2861
|
+
"5月",
|
|
2862
|
+
"6月",
|
|
2863
|
+
"7月",
|
|
2864
|
+
"8月",
|
|
2865
|
+
"9月",
|
|
2866
|
+
"10月",
|
|
2867
|
+
"11月",
|
|
2868
|
+
"12月"
|
|
2869
|
+
], Ne = ({ value: e, defaultValue: t = {
|
|
2870
|
+
year: 2026,
|
|
2871
|
+
month: 11
|
|
2872
|
+
}, minYear: n = 2020, maxYear: r = 2032, locale: i = "en", onChange: a, className: o = "", style: s }) => {
|
|
2873
|
+
let c = e !== void 0, [l, u] = f(t), d = c ? e : l, [p, g] = f(d.year), _ = i === "zh" ? Me : je, v = (e) => {
|
|
2874
|
+
let t = {
|
|
2875
|
+
year: p,
|
|
2876
|
+
month: e
|
|
2877
|
+
};
|
|
2878
|
+
c || u(t), a?.(t);
|
|
2879
|
+
};
|
|
2880
|
+
return /* @__PURE__ */ h("div", {
|
|
2881
|
+
className: `tp-month-picker ${o}`.trim(),
|
|
2882
|
+
style: s,
|
|
2883
|
+
children: [/* @__PURE__ */ h("div", {
|
|
2884
|
+
className: "tp-month-picker-header",
|
|
2885
|
+
children: [
|
|
2886
|
+
/* @__PURE__ */ m("button", {
|
|
2887
|
+
type: "button",
|
|
2888
|
+
className: "tp-month-picker-nav",
|
|
2889
|
+
"aria-label": "Previous year",
|
|
2890
|
+
disabled: p <= n,
|
|
2891
|
+
onClick: () => g((e) => Math.max(n, e - 1)),
|
|
2892
|
+
children: /* @__PURE__ */ m("svg", {
|
|
2893
|
+
width: "16",
|
|
2894
|
+
height: "16",
|
|
2895
|
+
viewBox: "0 0 16 16",
|
|
2896
|
+
fill: "none",
|
|
2897
|
+
"aria-hidden": "true",
|
|
2898
|
+
children: /* @__PURE__ */ m("path", {
|
|
2899
|
+
d: "M10 3.5L5.5 8L10 12.5",
|
|
2900
|
+
stroke: "currentColor",
|
|
2901
|
+
strokeWidth: "1.7",
|
|
2902
|
+
strokeLinecap: "round",
|
|
2903
|
+
strokeLinejoin: "round"
|
|
2904
|
+
})
|
|
2905
|
+
})
|
|
2906
|
+
}),
|
|
2907
|
+
/* @__PURE__ */ m("span", {
|
|
2908
|
+
className: "tp-month-picker-year",
|
|
2909
|
+
children: i === "zh" ? `${p}年` : p
|
|
2910
|
+
}),
|
|
2911
|
+
/* @__PURE__ */ m("button", {
|
|
2912
|
+
type: "button",
|
|
2913
|
+
className: "tp-month-picker-nav",
|
|
2914
|
+
"aria-label": "Next year",
|
|
2915
|
+
disabled: p >= r,
|
|
2916
|
+
onClick: () => g((e) => Math.min(r, e + 1)),
|
|
2917
|
+
children: /* @__PURE__ */ m("svg", {
|
|
2918
|
+
width: "16",
|
|
2919
|
+
height: "16",
|
|
2920
|
+
viewBox: "0 0 16 16",
|
|
2921
|
+
fill: "none",
|
|
2922
|
+
"aria-hidden": "true",
|
|
2923
|
+
children: /* @__PURE__ */ m("path", {
|
|
2924
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
2925
|
+
stroke: "currentColor",
|
|
2926
|
+
strokeWidth: "1.7",
|
|
2927
|
+
strokeLinecap: "round",
|
|
2928
|
+
strokeLinejoin: "round"
|
|
2929
|
+
})
|
|
2930
|
+
})
|
|
2931
|
+
})
|
|
2932
|
+
]
|
|
2933
|
+
}), /* @__PURE__ */ m("div", {
|
|
2934
|
+
className: "tp-month-picker-grid",
|
|
2935
|
+
role: "listbox",
|
|
2936
|
+
"aria-label": "Month",
|
|
2937
|
+
children: _.map((e, t) => {
|
|
2938
|
+
let n = t + 1, r = d.year === p && d.month === n;
|
|
2939
|
+
return /* @__PURE__ */ m("button", {
|
|
2940
|
+
type: "button",
|
|
2941
|
+
role: "option",
|
|
2942
|
+
"aria-selected": r,
|
|
2943
|
+
className: `tp-month-picker-cell ${r ? "tp-month-picker-cell--selected" : ""}`.trim(),
|
|
2944
|
+
onClick: () => v(n),
|
|
2945
|
+
children: e
|
|
2946
|
+
}, n);
|
|
2947
|
+
})
|
|
2948
|
+
})]
|
|
2949
|
+
});
|
|
2950
|
+
}, Pe = [
|
|
2951
|
+
"Sun",
|
|
2952
|
+
"Mon",
|
|
2953
|
+
"Tue",
|
|
2954
|
+
"Wed",
|
|
2955
|
+
"Thu",
|
|
2956
|
+
"Fri",
|
|
2957
|
+
"Sat"
|
|
2958
|
+
], Fe = [
|
|
2959
|
+
"日",
|
|
2960
|
+
"一",
|
|
2961
|
+
"二",
|
|
2962
|
+
"三",
|
|
2963
|
+
"四",
|
|
2964
|
+
"五",
|
|
2965
|
+
"六"
|
|
2966
|
+
];
|
|
2967
|
+
function Ie(e) {
|
|
2968
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
2969
|
+
}
|
|
2970
|
+
var Le = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], locale: i = "en", onChange: a, className: o = "", style: s }) => {
|
|
2971
|
+
let c = u(() => n ?? t ?? e ?? new Date(2026, 10, 23), [
|
|
2972
|
+
n,
|
|
2973
|
+
t,
|
|
2974
|
+
e
|
|
2975
|
+
]), l = e !== void 0, [d, p] = f(() => t ?? c), g = Ie(l ? e : d), _ = u(() => {
|
|
2976
|
+
let e = [];
|
|
2977
|
+
for (let t = 6; t >= 0; t--) e.push(new Date(c.getFullYear(), c.getMonth(), c.getDate() - t));
|
|
2978
|
+
return e;
|
|
2979
|
+
}, [c]), v = i === "zh" ? Fe : Pe, y = u(() => new Set(r), [r]), b = (e) => {
|
|
2980
|
+
l || p(e), a?.(e);
|
|
2981
|
+
};
|
|
2982
|
+
return /* @__PURE__ */ m("div", {
|
|
2983
|
+
className: `tp-last7-picker ${o}`.trim(),
|
|
2984
|
+
role: "listbox",
|
|
2985
|
+
"aria-label": "Last 7 Days",
|
|
2986
|
+
style: s,
|
|
2987
|
+
children: _.map((e) => {
|
|
2988
|
+
let t = Ie(e), n = t === g, r = y.has(t);
|
|
2989
|
+
return /* @__PURE__ */ h("button", {
|
|
2990
|
+
type: "button",
|
|
2991
|
+
role: "option",
|
|
2992
|
+
"aria-selected": n,
|
|
2993
|
+
"aria-label": t,
|
|
2994
|
+
className: `tp-last7-day ${n ? "tp-last7-day--selected" : ""}`.trim(),
|
|
2995
|
+
onClick: () => b(e),
|
|
2996
|
+
children: [
|
|
2997
|
+
/* @__PURE__ */ m("span", {
|
|
2998
|
+
className: "tp-last7-weekday",
|
|
2999
|
+
children: v[e.getDay()]
|
|
3000
|
+
}),
|
|
3001
|
+
/* @__PURE__ */ m("span", {
|
|
3002
|
+
className: "tp-last7-num",
|
|
3003
|
+
children: e.getDate()
|
|
3004
|
+
}),
|
|
3005
|
+
/* @__PURE__ */ m("span", {
|
|
3006
|
+
className: `tp-last7-dot ${r ? "tp-last7-dot--visible" : ""}`.trim(),
|
|
3007
|
+
"aria-hidden": "true"
|
|
3008
|
+
})
|
|
3009
|
+
]
|
|
3010
|
+
}, t);
|
|
3011
|
+
})
|
|
3012
|
+
});
|
|
3013
|
+
}, Re = ({ variant: e = "step", items: t, className: n = "", style: r }) => /* @__PURE__ */ m("ol", {
|
|
3014
|
+
className: `tp-step-text tp-step-text--${e} ${n}`.trim(),
|
|
3015
|
+
"data-variant": e,
|
|
3016
|
+
style: r,
|
|
3017
|
+
children: t.map((t, n) => /* @__PURE__ */ h("li", {
|
|
3018
|
+
className: "tp-step-text-item",
|
|
3019
|
+
children: [/* @__PURE__ */ m("span", {
|
|
3020
|
+
className: "tp-step-text-marker",
|
|
3021
|
+
"aria-hidden": "true",
|
|
3022
|
+
children: e === "bullet" ? "•" : e === "numbered" ? `${n + 1}.` : n + 1
|
|
3023
|
+
}), /* @__PURE__ */ h("div", {
|
|
3024
|
+
className: "tp-step-text-body",
|
|
3025
|
+
children: [
|
|
3026
|
+
t.title !== void 0 && /* @__PURE__ */ m("div", {
|
|
3027
|
+
className: "tp-step-text-title",
|
|
3028
|
+
children: t.title
|
|
3029
|
+
}),
|
|
3030
|
+
/* @__PURE__ */ m("div", {
|
|
3031
|
+
className: "tp-step-text-content",
|
|
3032
|
+
children: t.text
|
|
3033
|
+
}),
|
|
3034
|
+
t.note !== void 0 && /* @__PURE__ */ m("div", {
|
|
3035
|
+
className: "tp-step-text-note",
|
|
3036
|
+
children: t.note
|
|
3037
|
+
})
|
|
3038
|
+
]
|
|
3039
|
+
})]
|
|
3040
|
+
}, t.key ?? n))
|
|
3041
|
+
}), ze = ({ variant: e = "linear", percent: t, tone: n = "focus", size: r = 64, strokeWidth: i = 6, showValue: a = !0, label: o, className: s = "", style: c }) => {
|
|
3042
|
+
let l = Math.max(0, Math.min(100, Math.round(t)));
|
|
3043
|
+
if (e === "circular") {
|
|
3044
|
+
let e = Math.max(8, (r - i) / 2), t = 2 * Math.PI * e, u = t * (1 - l / 100);
|
|
3045
|
+
return /* @__PURE__ */ h("div", {
|
|
3046
|
+
className: `tp-progress tp-progress--circular tp-progress--tone-${n} ${s}`.trim(),
|
|
3047
|
+
role: "progressbar",
|
|
3048
|
+
"aria-valuenow": l,
|
|
3049
|
+
"aria-valuemin": 0,
|
|
3050
|
+
"aria-valuemax": 100,
|
|
3051
|
+
style: c,
|
|
3052
|
+
children: [/* @__PURE__ */ h("div", {
|
|
3053
|
+
className: "tp-progress-ring-wrap",
|
|
3054
|
+
style: {
|
|
3055
|
+
width: r,
|
|
3056
|
+
height: r
|
|
3057
|
+
},
|
|
3058
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
3059
|
+
width: r,
|
|
3060
|
+
height: r,
|
|
3061
|
+
viewBox: `0 0 ${r} ${r}`,
|
|
3062
|
+
"aria-hidden": "true",
|
|
3063
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
3064
|
+
cx: r / 2,
|
|
3065
|
+
cy: r / 2,
|
|
3066
|
+
r: e,
|
|
3067
|
+
fill: "none",
|
|
3068
|
+
stroke: "var(--tp-divider)",
|
|
3069
|
+
strokeWidth: i
|
|
3070
|
+
}), /* @__PURE__ */ m("circle", {
|
|
3071
|
+
cx: r / 2,
|
|
3072
|
+
cy: r / 2,
|
|
3073
|
+
r: e,
|
|
3074
|
+
fill: "none",
|
|
3075
|
+
className: "tp-progress-ring-stroke",
|
|
3076
|
+
strokeWidth: i,
|
|
3077
|
+
strokeLinecap: "round",
|
|
3078
|
+
strokeDasharray: t,
|
|
3079
|
+
strokeDashoffset: u,
|
|
3080
|
+
transform: `rotate(-90 ${r / 2} ${r / 2})`
|
|
3081
|
+
})]
|
|
3082
|
+
}), a && /* @__PURE__ */ h("span", {
|
|
3083
|
+
className: "tp-progress-ring-val",
|
|
3084
|
+
children: [l, "%"]
|
|
3085
|
+
})]
|
|
3086
|
+
}), o !== void 0 && /* @__PURE__ */ m("div", {
|
|
3087
|
+
className: "tp-progress-label",
|
|
3088
|
+
children: o
|
|
3089
|
+
})]
|
|
3090
|
+
});
|
|
3091
|
+
}
|
|
3092
|
+
return /* @__PURE__ */ h("div", {
|
|
3093
|
+
className: `tp-progress tp-progress--linear tp-progress--tone-${n} ${s}`.trim(),
|
|
3094
|
+
role: "progressbar",
|
|
3095
|
+
"aria-valuenow": l,
|
|
3096
|
+
"aria-valuemin": 0,
|
|
3097
|
+
"aria-valuemax": 100,
|
|
3098
|
+
style: c,
|
|
3099
|
+
children: [(o !== void 0 || a) && /* @__PURE__ */ h("div", {
|
|
3100
|
+
className: "tp-progress-head",
|
|
3101
|
+
children: [/* @__PURE__ */ m("span", {
|
|
3102
|
+
className: "tp-progress-label",
|
|
3103
|
+
children: o
|
|
3104
|
+
}), a && /* @__PURE__ */ h("span", {
|
|
3105
|
+
className: "tp-progress-pct",
|
|
3106
|
+
children: [l, "%"]
|
|
3107
|
+
})]
|
|
3108
|
+
}), /* @__PURE__ */ m("div", {
|
|
3109
|
+
className: "tp-progress-track",
|
|
3110
|
+
children: /* @__PURE__ */ m("div", {
|
|
3111
|
+
className: "tp-progress-fill",
|
|
3112
|
+
style: { width: `${l}%` }
|
|
3113
|
+
})
|
|
3114
|
+
})]
|
|
3115
|
+
});
|
|
3116
|
+
}, Be = ({ variant: e = "text", width: t, height: n, lines: r = 3, animated: i = !0, className: a = "", style: o }) => {
|
|
3117
|
+
let s = i ? "tp-skeleton-item--animated" : "";
|
|
3118
|
+
if (e === "card") return /* @__PURE__ */ h("div", {
|
|
3119
|
+
className: `tp-skeleton-card ${a}`.trim(),
|
|
3120
|
+
"aria-busy": "true",
|
|
3121
|
+
style: o,
|
|
3122
|
+
children: [
|
|
3123
|
+
/* @__PURE__ */ m("div", {
|
|
3124
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3125
|
+
style: {
|
|
3126
|
+
width: "48%",
|
|
3127
|
+
height: 18
|
|
3128
|
+
}
|
|
3129
|
+
}),
|
|
3130
|
+
/* @__PURE__ */ m("div", {
|
|
3131
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3132
|
+
style: {
|
|
3133
|
+
width: "100%",
|
|
3134
|
+
height: 64,
|
|
3135
|
+
borderRadius: 10
|
|
3136
|
+
}
|
|
3137
|
+
}),
|
|
3138
|
+
/* @__PURE__ */ m("div", {
|
|
3139
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3140
|
+
style: {
|
|
3141
|
+
width: "76%",
|
|
3142
|
+
height: 12
|
|
3143
|
+
}
|
|
3144
|
+
})
|
|
3145
|
+
]
|
|
3146
|
+
});
|
|
3147
|
+
if (e === "circle") {
|
|
3148
|
+
let e = t ?? n ?? 40;
|
|
3149
|
+
return /* @__PURE__ */ m("span", {
|
|
3150
|
+
"aria-busy": "true",
|
|
3151
|
+
className: `tp-skeleton-item tp-skeleton-item--circle ${s} ${a}`.trim(),
|
|
3152
|
+
style: {
|
|
3153
|
+
width: e,
|
|
3154
|
+
height: e,
|
|
3155
|
+
...o
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
return e === "rect" ? /* @__PURE__ */ m("div", {
|
|
3160
|
+
"aria-busy": "true",
|
|
3161
|
+
className: `tp-skeleton-item ${s} ${a}`.trim(),
|
|
3162
|
+
style: {
|
|
3163
|
+
width: t ?? "100%",
|
|
3164
|
+
height: n ?? 80,
|
|
3165
|
+
...o
|
|
3166
|
+
}
|
|
3167
|
+
}) : /* @__PURE__ */ m("div", {
|
|
3168
|
+
className: `tp-skeleton-text-group ${a}`.trim(),
|
|
3169
|
+
"aria-busy": "true",
|
|
3170
|
+
style: o,
|
|
3171
|
+
children: Array.from({ length: Math.max(1, r) }).map((e, i) => /* @__PURE__ */ m("div", {
|
|
3172
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3173
|
+
style: {
|
|
3174
|
+
width: i === r - 1 && r > 1 ? "68%" : t ?? "100%",
|
|
3175
|
+
height: n ?? 13
|
|
3176
|
+
}
|
|
3177
|
+
}, i))
|
|
3178
|
+
});
|
|
3179
|
+
}, Ve = ({ steps: e, current: t, direction: n = "horizontal", className: r = "", style: i }) => /* @__PURE__ */ m("ol", {
|
|
3180
|
+
className: `tp-stepper tp-stepper--${n} ${r}`.trim(),
|
|
3181
|
+
"data-direction": n,
|
|
3182
|
+
style: i,
|
|
3183
|
+
children: e.map((n, r) => {
|
|
3184
|
+
let i = r < t ? "done" : r === t ? "active" : "pending";
|
|
3185
|
+
return /* @__PURE__ */ h("li", {
|
|
3186
|
+
className: `tp-stepper-item tp-stepper-item--${i}`,
|
|
3187
|
+
"aria-current": i === "active" ? "step" : void 0,
|
|
3188
|
+
children: [/* @__PURE__ */ h("div", {
|
|
3189
|
+
className: "tp-stepper-node-row",
|
|
3190
|
+
children: [/* @__PURE__ */ m("span", {
|
|
3191
|
+
className: "tp-stepper-circle",
|
|
3192
|
+
children: i === "done" ? /* @__PURE__ */ m("svg", {
|
|
3193
|
+
width: "12",
|
|
3194
|
+
height: "12",
|
|
3195
|
+
viewBox: "0 0 12 12",
|
|
3196
|
+
fill: "none",
|
|
3197
|
+
"aria-hidden": "true",
|
|
3198
|
+
children: /* @__PURE__ */ m("path", {
|
|
3199
|
+
d: "M2.5 6.2L5 8.7L9.5 3.6",
|
|
3200
|
+
stroke: "currentColor",
|
|
3201
|
+
strokeWidth: "1.9",
|
|
3202
|
+
strokeLinecap: "round",
|
|
3203
|
+
strokeLinejoin: "round"
|
|
3204
|
+
})
|
|
3205
|
+
}) : r + 1
|
|
3206
|
+
}), r < e.length - 1 && /* @__PURE__ */ m("span", {
|
|
3207
|
+
className: "tp-stepper-line",
|
|
3208
|
+
"aria-hidden": "true"
|
|
3209
|
+
})]
|
|
3210
|
+
}), /* @__PURE__ */ h("div", {
|
|
3211
|
+
className: "tp-stepper-meta",
|
|
3212
|
+
children: [/* @__PURE__ */ m("div", {
|
|
3213
|
+
className: "tp-stepper-title",
|
|
3214
|
+
children: n.title
|
|
3215
|
+
}), n.description !== void 0 && /* @__PURE__ */ m("div", {
|
|
3216
|
+
className: "tp-stepper-desc",
|
|
3217
|
+
children: n.description
|
|
3218
|
+
})]
|
|
3219
|
+
})]
|
|
3220
|
+
}, n.key);
|
|
3221
|
+
})
|
|
3222
|
+
}), He = ({ inset: e = !1, label: t, spacing: n = "md", className: r = "", style: i }) => /* @__PURE__ */ h("div", {
|
|
3223
|
+
role: "separator",
|
|
3224
|
+
className: `tp-divider tp-divider--space-${n} ${e ? "tp-divider--inset" : ""} ${t === void 0 ? "" : "tp-divider--with-label"} ${r}`.trim(),
|
|
3225
|
+
style: i,
|
|
3226
|
+
children: [
|
|
3227
|
+
/* @__PURE__ */ m("span", { className: "tp-divider-line" }),
|
|
3228
|
+
t !== void 0 && /* @__PURE__ */ m("span", {
|
|
3229
|
+
className: "tp-divider-label",
|
|
3230
|
+
children: t
|
|
3231
|
+
}),
|
|
3232
|
+
t !== void 0 && /* @__PURE__ */ m("span", { className: "tp-divider-line" })
|
|
3233
|
+
]
|
|
3234
|
+
});
|
|
3235
|
+
// src/core/components/TPAvatar.tsx
|
|
3236
|
+
function Ue(e) {
|
|
3237
|
+
if (!e) return "";
|
|
3238
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
3239
|
+
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : `${t[0][0]}${t[1][0]}`.toUpperCase();
|
|
3240
|
+
}
|
|
3241
|
+
var We = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape: s = "circle", alt: c, className: l = "", style: u }) => {
|
|
3242
|
+
let d = a === "sm" ? 16 : a === "lg" ? 24 : 20, f = Ue(t) || "?";
|
|
3243
|
+
return e ? f = /* @__PURE__ */ m("img", {
|
|
3244
|
+
src: e,
|
|
3245
|
+
alt: c ?? t ?? "Avatar",
|
|
3246
|
+
className: "tp-avatar-img"
|
|
3247
|
+
}) : i !== void 0 && (f = typeof i == "string" && n(i) ? /* @__PURE__ */ m(r, {
|
|
3248
|
+
name: i,
|
|
3249
|
+
size: d
|
|
3250
|
+
}) : i), /* @__PURE__ */ h("span", {
|
|
3251
|
+
className: `tp-avatar tp-avatar--${a} tp-avatar--${s} ${l}`.trim(),
|
|
3252
|
+
"data-size": a,
|
|
3253
|
+
"data-shape": s,
|
|
3254
|
+
"aria-label": e ? void 0 : c ?? t,
|
|
3255
|
+
style: u,
|
|
3256
|
+
children: [f, o !== "none" && /* @__PURE__ */ m("span", {
|
|
3257
|
+
className: `tp-avatar-status tp-avatar-status--${o}`,
|
|
3258
|
+
"aria-label": `Status: ${o}`
|
|
3259
|
+
})]
|
|
3260
|
+
});
|
|
3261
|
+
}, Ge = ({ length: e = 6, value: t, defaultValue: n = "", masked: r = !1, error: i, disabled: a = !1, onChange: o, onComplete: s, ariaLabel: c = "Verification code", className: l = "", style: u }) => {
|
|
3262
|
+
let p = Math.max(2, Math.min(8, e)), g = t !== void 0, [_, v] = f(n.slice(0, p)), y = (g ? t : _).slice(0, p), b = d([]), x = Array.from({ length: p }, (e, t) => y[t] ?? ""), S = (e) => {
|
|
3263
|
+
let t = e.slice(0, p);
|
|
3264
|
+
g || v(t), o?.(t), t.length === p && s?.(t);
|
|
3265
|
+
};
|
|
3266
|
+
return /* @__PURE__ */ h("div", {
|
|
3267
|
+
className: `tp-pin-wrap ${i ? "tp-pin-wrap--error" : ""} ${l}`.trim(),
|
|
3268
|
+
style: u,
|
|
3269
|
+
children: [/* @__PURE__ */ m("div", {
|
|
3270
|
+
className: "tp-pin-cells",
|
|
3271
|
+
role: "group",
|
|
3272
|
+
"aria-label": c,
|
|
3273
|
+
children: x.map((e, t) => /* @__PURE__ */ m("input", {
|
|
3274
|
+
ref: (e) => {
|
|
3275
|
+
b.current[t] = e;
|
|
3276
|
+
},
|
|
3277
|
+
type: r ? "password" : "text",
|
|
3278
|
+
inputMode: "numeric",
|
|
3279
|
+
maxLength: 1,
|
|
3280
|
+
disabled: a,
|
|
3281
|
+
"aria-label": `${c} digit ${t + 1}`,
|
|
3282
|
+
className: `tp-pin-cell ${e ? "tp-pin-cell--filled" : ""} ${i ? "tp-pin-cell--error" : ""}`.trim(),
|
|
3283
|
+
value: e,
|
|
3284
|
+
onChange: (e) => {
|
|
3285
|
+
if (a) return;
|
|
3286
|
+
let n = e.target.value.replace(/\s+/g, "");
|
|
3287
|
+
if (n.length > 1) {
|
|
3288
|
+
let e = (y.slice(0, t) + n).slice(0, p);
|
|
3289
|
+
S(e), b.current[Math.min(p - 1, t + n.length)]?.focus();
|
|
3290
|
+
return;
|
|
3291
|
+
}
|
|
3292
|
+
let r = [...x];
|
|
3293
|
+
r[t] = n, S(r.join("")), n && t < p - 1 && b.current[t + 1]?.focus();
|
|
3294
|
+
},
|
|
3295
|
+
onKeyDown: (e) => {
|
|
3296
|
+
e.key === "Backspace" && !x[t] && t > 0 && b.current[t - 1]?.focus();
|
|
3297
|
+
},
|
|
3298
|
+
onPaste: (e) => {
|
|
3299
|
+
let t = e.clipboardData.getData("text").replace(/\s+/g, "");
|
|
3300
|
+
t && (e.preventDefault(), S(t), b.current[Math.min(p - 1, t.length)]?.focus());
|
|
3301
|
+
}
|
|
3302
|
+
}, t))
|
|
3303
|
+
}), i && /* @__PURE__ */ m("div", {
|
|
3304
|
+
className: "tp-pin-error",
|
|
3305
|
+
role: "alert",
|
|
3306
|
+
children: i
|
|
3307
|
+
})]
|
|
3308
|
+
});
|
|
3309
|
+
}, Ke = ({ tone: e }) => {
|
|
2314
3310
|
switch (e) {
|
|
2315
3311
|
case "warning": return /* @__PURE__ */ h("svg", {
|
|
2316
3312
|
width: "20",
|
|
@@ -2411,7 +3407,7 @@ var ve = ({ tone: e }) => {
|
|
|
2411
3407
|
]
|
|
2412
3408
|
});
|
|
2413
3409
|
}
|
|
2414
|
-
},
|
|
3410
|
+
}, qe = () => /* @__PURE__ */ m("svg", {
|
|
2415
3411
|
width: "14",
|
|
2416
3412
|
height: "14",
|
|
2417
3413
|
viewBox: "0 0 16 16",
|
|
@@ -2423,7 +3419,7 @@ var ve = ({ tone: e }) => {
|
|
|
2423
3419
|
strokeWidth: "1.6",
|
|
2424
3420
|
strokeLinecap: "round"
|
|
2425
3421
|
})
|
|
2426
|
-
}),
|
|
3422
|
+
}), Je = ({ tone: e = "info", title: t, actionLabel: n, onAction: r, closable: i, onClose: a, icon: o, className: s = "", style: c }) => {
|
|
2427
3423
|
let l = i ?? !!a;
|
|
2428
3424
|
return /* @__PURE__ */ h("div", {
|
|
2429
3425
|
role: "region",
|
|
@@ -2433,7 +3429,7 @@ var ve = ({ tone: e }) => {
|
|
|
2433
3429
|
children: [
|
|
2434
3430
|
/* @__PURE__ */ m("span", {
|
|
2435
3431
|
className: "tp-prompt-icon",
|
|
2436
|
-
children: o === void 0 ? /* @__PURE__ */ m(
|
|
3432
|
+
children: o === void 0 ? /* @__PURE__ */ m(Ke, { tone: e }) : o
|
|
2437
3433
|
}),
|
|
2438
3434
|
/* @__PURE__ */ h("div", {
|
|
2439
3435
|
className: "tp-prompt-content",
|
|
@@ -2452,9 +3448,9 @@ var ve = ({ tone: e }) => {
|
|
|
2452
3448
|
className: "tp-prompt-close",
|
|
2453
3449
|
"aria-label": "Dismiss",
|
|
2454
3450
|
onClick: a,
|
|
2455
|
-
children: /* @__PURE__ */ m(
|
|
3451
|
+
children: /* @__PURE__ */ m(qe, {})
|
|
2456
3452
|
})
|
|
2457
3453
|
]
|
|
2458
3454
|
});
|
|
2459
3455
|
};
|
|
2460
|
-
export {
|
|
3456
|
+
export { b as $, re as A, z as B, ve as C, le as D, de as E, G as F, N as G, L as H, W as I, D as J, k as K, U as L, te as M, q as N, se as O, ee as P, x as Q, H as R, _e as S, pe as T, I as U, R as V, P as W, T as X, E as Y, w as Z, we as _, Ve as a, ye as b, Re as c, Ae as d, v as et, Oe as f, Ce as g, Ee as h, He as i, ne as j, oe as k, Le as l, Te as m, Ge as n, Be as o, De as p, O as q, We as r, ze as s, Je as t, Ne as u, xe as v, he as w, Q as x, Se as y, V as z };
|