@chenyqthu/tp-mobile-ui-kit 0.2.1 → 0.3.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 +11 -9
- package/dist/assets.js +5 -5
- package/dist/catalog.json +1939 -152
- package/dist/chunks/OmadaAppDemo-BxWPBACn.js +7359 -0
- package/dist/chunks/{TPPrompt-6o6zUNzO.js → TPInfoSheet-DozlNuGj.js} +856 -533
- package/dist/chunks/asset-icons-BLfOEHzP.js +10434 -0
- package/dist/chunks/{asset-illustrations-YHXzEd7z.js → asset-illustrations-CslT-sgf.js} +28 -2051
- package/dist/chunks/{asset-logos-DAyGwOLj.js → asset-logos-B18ywOgH.js} +2 -2
- package/dist/chunks/{asset-motion-D7fWh_JS.js → asset-motion-CxM2f5Ft.js} +307 -70
- package/dist/core.js +3 -3
- package/dist/index.js +7 -7
- package/dist/omada.js +7 -7
- package/dist/standalone.js +2090 -622
- package/dist/style.css +1 -1
- package/dist/types/assets-lib/TPIcon.d.ts +3 -0
- package/dist/types/assets-lib/iconsManifest.d.ts +2 -0
- package/dist/types/assets-lib/motionsManifest.d.ts +1 -1
- package/dist/types/core/components/TPDatePicker.d.ts +1 -1
- package/dist/types/core/components/TPInfoSheet.d.ts +11 -0
- package/dist/types/core/components/TPLoadMore.d.ts +7 -0
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/core/types.d.ts +93 -8
- package/dist/types/omada/blocks/OmadaChartCard.d.ts +53 -0
- package/dist/types/omada/blocks/OmadaClientListBlock.d.ts +34 -0
- package/dist/types/omada/blocks/OmadaDeviceListBlock.d.ts +15 -2
- package/dist/types/omada/blocks/OmadaFormRepeaterBlock.d.ts +48 -0
- package/dist/types/omada/blocks/OmadaPortPanelBlock.d.ts +21 -3
- package/dist/types/omada/blocks/OmadaPortSelectorBlock.d.ts +23 -0
- package/dist/types/omada/blocks/OmadaSidebarDrawer.d.ts +27 -0
- package/dist/types/omada/blocks/OmadaSiteListBlock.d.ts +26 -0
- package/dist/types/omada/blocks/OmadaVoucherPreviewCard.d.ts +21 -0
- package/dist/types/omada/components/OmadaStandardInput.d.ts +3 -2
- package/dist/types/omada/index.d.ts +14 -2
- package/dist/types/omada/pages/OmadaAccessibilitySettingsPage.d.ts +12 -0
- package/dist/types/omada/pages/OmadaAppDemo.d.ts +6 -3
- package/dist/types/omada/pages/OmadaConfigFormPage.d.ts +24 -0
- package/dist/types/omada/pages/OmadaLanSettingsPage.d.ts +25 -0
- package/dist/types/omada/pages/OmadaPortDetailPage.d.ts +16 -0
- package/dist/types/omada/pages/OmadaPrivacyPolicyPage.d.ts +18 -0
- package/dist/types/theme/TPThemeProvider.d.ts +9 -0
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/tokens.d.ts +24 -0
- package/package.json +2 -2
- package/skills/tp-mobile-ui-kit/SKILL.md +17 -14
- package/skills/tp-mobile-ui-kit/references/catalog.json +1939 -152
- package/dist/chunks/OmadaAppDemo-Dwm_iU6O.js +0 -4922
- package/dist/chunks/asset-icons-BIenKvAh.js +0 -7613
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as e, n as t, t as n } from "./asset-icons-BLfOEHzP.js";
|
|
2
|
+
import { t as r } from "./asset-illustrations-CslT-sgf.js";
|
|
3
3
|
import i, { createContext as a, useCallback as o, useContext as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
4
4
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
5
|
// src/core/components/TPPhoneFrame.tsx
|
|
@@ -516,12 +516,12 @@ var k = ({ shape: e = "pill", tint: t = "clear", bezelWidth: n = 14, refraction:
|
|
|
516
516
|
blur: 2
|
|
517
517
|
}), e]
|
|
518
518
|
});
|
|
519
|
-
}, j = ({ title:
|
|
520
|
-
let
|
|
519
|
+
}, j = ({ title: t, subtitle: n, variant: r = "standard", os: i, adaptiveOS: a = !0, left: o, right: s, showBack: c = !1, onBack: l, titleDropdown: u = !1, onTitleClick: d, rightBadge: f, translucent: p = !1, loading: _ = !1, tabs: v, activeTab: y, onTabChange: b, className: x = "", style: S }) => {
|
|
520
|
+
let { os: C } = e(), w = i ?? C, T = a && w === "android" && r === "floating" ? "standard" : r, E = T === "floating", D = T === "large", O = (T === "tabs" || !!v?.length) && !!v?.length, k = c || o != null, j = f != null && f !== "" && (typeof f != "number" || f > 0), M = s != null || j, N = /* @__PURE__ */ g(m, { children: [c ? /* @__PURE__ */ h("button", {
|
|
521
521
|
type: "button",
|
|
522
522
|
className: "tp-header-icon-btn",
|
|
523
523
|
"aria-label": "Back",
|
|
524
|
-
onClick:
|
|
524
|
+
onClick: l,
|
|
525
525
|
children: /* @__PURE__ */ h("svg", {
|
|
526
526
|
width: "20",
|
|
527
527
|
height: "20",
|
|
@@ -536,79 +536,129 @@ var k = ({ shape: e = "pill", tint: t = "clear", bezelWidth: n = 14, refraction:
|
|
|
536
536
|
strokeLinejoin: "round"
|
|
537
537
|
})
|
|
538
538
|
})
|
|
539
|
-
}) : null,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
539
|
+
}) : null, o] }), P = /* @__PURE__ */ g(m, { children: [
|
|
540
|
+
t != null && /* @__PURE__ */ h("span", {
|
|
541
|
+
className: "tp-header-title",
|
|
542
|
+
children: t
|
|
543
|
+
}),
|
|
544
|
+
_ && /* @__PURE__ */ h("span", {
|
|
545
|
+
className: "tp-header-loading",
|
|
546
|
+
"aria-label": "Loading",
|
|
547
|
+
role: "status"
|
|
548
|
+
}),
|
|
549
|
+
u && /* @__PURE__ */ h("span", {
|
|
550
|
+
className: "tp-header-chevron",
|
|
551
|
+
"aria-hidden": "true",
|
|
552
|
+
children: /* @__PURE__ */ h("svg", {
|
|
553
|
+
width: "14",
|
|
554
|
+
height: "14",
|
|
555
|
+
viewBox: "0 0 16 16",
|
|
556
|
+
fill: "none",
|
|
557
|
+
children: /* @__PURE__ */ h("path", {
|
|
558
|
+
d: "M4 6L8 10L12 6",
|
|
559
|
+
stroke: "currentColor",
|
|
560
|
+
strokeWidth: "1.7",
|
|
561
|
+
strokeLinecap: "round",
|
|
562
|
+
strokeLinejoin: "round"
|
|
563
|
+
})
|
|
556
564
|
})
|
|
557
565
|
})
|
|
558
|
-
|
|
566
|
+
] }), F = [
|
|
559
567
|
"tp-header",
|
|
560
|
-
`tp-header--${
|
|
561
|
-
|
|
562
|
-
|
|
568
|
+
`tp-header--${T}`,
|
|
569
|
+
p && !E ? "tp-header--translucent" : "",
|
|
570
|
+
O ? "tp-header--with-tabs" : "",
|
|
571
|
+
x
|
|
563
572
|
].filter(Boolean).join(" ");
|
|
564
573
|
return /* @__PURE__ */ g("header", {
|
|
565
|
-
className:
|
|
566
|
-
"data-variant":
|
|
567
|
-
|
|
574
|
+
className: F,
|
|
575
|
+
"data-variant": T,
|
|
576
|
+
"data-os": w,
|
|
577
|
+
style: S,
|
|
568
578
|
children: [
|
|
569
|
-
/* @__PURE__ */ h("div", {
|
|
570
|
-
className: "tp-header-left",
|
|
571
|
-
children: _ ? p ? /* @__PURE__ */ h(A, { children: b }) : b : null
|
|
572
|
-
}),
|
|
573
579
|
/* @__PURE__ */ g("div", {
|
|
574
|
-
className: "tp-header-
|
|
575
|
-
children: [
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
580
|
+
className: "tp-header-bar",
|
|
581
|
+
children: [
|
|
582
|
+
/* @__PURE__ */ h("div", {
|
|
583
|
+
className: "tp-header-left",
|
|
584
|
+
children: k ? E ? /* @__PURE__ */ h(A, { children: N }) : N : null
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ g("div", {
|
|
587
|
+
className: "tp-header-center",
|
|
588
|
+
children: [!D && (t != null || u || _) ? d || u ? /* @__PURE__ */ h("button", {
|
|
589
|
+
type: "button",
|
|
590
|
+
className: "tp-header-title-btn",
|
|
591
|
+
onClick: d,
|
|
592
|
+
children: P
|
|
593
|
+
}) : /* @__PURE__ */ h("div", {
|
|
594
|
+
className: "tp-header-title-wrap",
|
|
595
|
+
children: P
|
|
596
|
+
}) : null, !D && n != null && /* @__PURE__ */ h("div", {
|
|
597
|
+
className: "tp-header-subtitle",
|
|
598
|
+
children: n
|
|
599
|
+
})]
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ h("div", {
|
|
602
|
+
className: "tp-header-right",
|
|
603
|
+
children: M ? /* @__PURE__ */ g("div", {
|
|
604
|
+
className: "tp-header-right-slot",
|
|
605
|
+
children: [E ? /* @__PURE__ */ h(A, { children: s }) : s, j && /* @__PURE__ */ h("span", {
|
|
606
|
+
className: "tp-header-badge",
|
|
607
|
+
children: f
|
|
608
|
+
})]
|
|
609
|
+
}) : null
|
|
610
|
+
})
|
|
611
|
+
]
|
|
587
612
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
className: "tp-header-
|
|
590
|
-
children:
|
|
591
|
-
className: "tp-header-
|
|
592
|
-
children: [
|
|
593
|
-
className: "tp-header-
|
|
594
|
-
children:
|
|
613
|
+
D && (t !== void 0 || n !== void 0) && /* @__PURE__ */ g("div", {
|
|
614
|
+
className: "tp-header-large-row",
|
|
615
|
+
children: [/* @__PURE__ */ g("div", {
|
|
616
|
+
className: "tp-header-large-title-wrap",
|
|
617
|
+
children: [/* @__PURE__ */ h("h1", {
|
|
618
|
+
className: "tp-header-large-title",
|
|
619
|
+
children: t
|
|
620
|
+
}), _ && /* @__PURE__ */ h("span", {
|
|
621
|
+
className: "tp-header-loading",
|
|
622
|
+
"aria-label": "Loading",
|
|
623
|
+
role: "status"
|
|
595
624
|
})]
|
|
596
|
-
})
|
|
625
|
+
}), n != null && /* @__PURE__ */ h("div", {
|
|
626
|
+
className: "tp-header-large-subtitle",
|
|
627
|
+
children: n
|
|
628
|
+
})]
|
|
629
|
+
}),
|
|
630
|
+
O && v && /* @__PURE__ */ h("div", {
|
|
631
|
+
className: "tp-header-tabs",
|
|
632
|
+
role: "tablist",
|
|
633
|
+
children: v.map((e) => {
|
|
634
|
+
let t = e.key === y;
|
|
635
|
+
return /* @__PURE__ */ g("button", {
|
|
636
|
+
type: "button",
|
|
637
|
+
role: "tab",
|
|
638
|
+
"aria-selected": t,
|
|
639
|
+
className: `tp-header-tab ${t ? "tp-header-tab--active" : ""}`.trim(),
|
|
640
|
+
onClick: () => b?.(e.key),
|
|
641
|
+
children: [/* @__PURE__ */ h("span", { children: e.label }), e.badge !== void 0 && e.badge !== null && e.badge !== "" && /* @__PURE__ */ h("span", {
|
|
642
|
+
className: "tp-header-tab-badge",
|
|
643
|
+
children: e.badge
|
|
644
|
+
})]
|
|
645
|
+
}, e.key);
|
|
646
|
+
})
|
|
597
647
|
})
|
|
598
648
|
]
|
|
599
649
|
});
|
|
600
650
|
};
|
|
601
651
|
// src/core/components/TPTabBar.tsx
|
|
602
|
-
function M(e,
|
|
603
|
-
let
|
|
604
|
-
return typeof
|
|
605
|
-
name:
|
|
606
|
-
size:
|
|
652
|
+
function M(e, r, i) {
|
|
653
|
+
let a = r && e.activeIcon !== void 0 ? e.activeIcon : e.icon;
|
|
654
|
+
return typeof a == "string" ? t(a) ? /* @__PURE__ */ h(n, {
|
|
655
|
+
name: a,
|
|
656
|
+
size: i
|
|
607
657
|
}) : /* @__PURE__ */ h("span", {
|
|
608
658
|
className: "tp-tabbar-icon-fallback",
|
|
609
659
|
"aria-hidden": "true",
|
|
610
|
-
children:
|
|
611
|
-
}) :
|
|
660
|
+
children: a
|
|
661
|
+
}) : a;
|
|
612
662
|
}
|
|
613
663
|
function N(e) {
|
|
614
664
|
return e == null || e === !1 ? null : e === !0 ? /* @__PURE__ */ h("span", {
|
|
@@ -622,66 +672,74 @@ function N(e) {
|
|
|
622
672
|
children: e
|
|
623
673
|
});
|
|
624
674
|
}
|
|
625
|
-
var P = ({ items:
|
|
626
|
-
let s = f(null), c =
|
|
675
|
+
var P = ({ items: t, activeKey: n, onChange: r, variant: i = "floating-pill", os: a, adaptiveOS: o = !0, iconSize: s, extraAction: c, fab: l, className: u = "", style: d }) => {
|
|
676
|
+
let { os: p } = e(), m = a ?? p, _ = o && m === "android" && i === "floating-pill" ? "docked" : i, v = s ?? (_ === "docked" ? 26 : 22), y = f(null), b = c ?? l, x = b != null && _ === "floating-pill", S = _ === "docked" && l != null, C = t.findIndex((e) => e.key === n), w = [
|
|
627
677
|
"tp-tabbar",
|
|
628
|
-
`tp-tabbar--${
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
].filter(Boolean).join(" "),
|
|
632
|
-
width: `calc((100% - 8px - ${(
|
|
633
|
-
transform: `translateX(calc(${
|
|
678
|
+
`tp-tabbar--${_}`,
|
|
679
|
+
x ? "tp-tabbar--has-extra" : "",
|
|
680
|
+
u
|
|
681
|
+
].filter(Boolean).join(" "), T = _ === "floating-pill" && C >= 0 && t.length > 0 ? {
|
|
682
|
+
width: `calc((100% - 8px - ${(t.length - 1) * 4}px) / ${t.length})`,
|
|
683
|
+
transform: `translateX(calc(${C} * (100% + 4px)))`
|
|
634
684
|
} : void 0;
|
|
635
685
|
return /* @__PURE__ */ g("nav", {
|
|
636
|
-
className:
|
|
637
|
-
"data-variant":
|
|
686
|
+
className: w,
|
|
687
|
+
"data-variant": _,
|
|
688
|
+
"data-os": m,
|
|
638
689
|
"aria-label": "Bottom Navigation",
|
|
639
|
-
style:
|
|
640
|
-
children: [
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
690
|
+
style: d,
|
|
691
|
+
children: [
|
|
692
|
+
/* @__PURE__ */ g("div", {
|
|
693
|
+
ref: y,
|
|
694
|
+
className: "tp-tabbar-track",
|
|
695
|
+
role: "tablist",
|
|
696
|
+
children: [
|
|
697
|
+
_ === "floating-pill" && /* @__PURE__ */ h(k, {
|
|
698
|
+
hostRef: y,
|
|
699
|
+
shape: "pill",
|
|
700
|
+
tint: "clear",
|
|
701
|
+
bezelWidth: 16,
|
|
702
|
+
refraction: 1.35,
|
|
703
|
+
dispersion: 1.15,
|
|
704
|
+
blur: 2.2
|
|
705
|
+
}),
|
|
706
|
+
T && /* @__PURE__ */ h("span", {
|
|
707
|
+
className: "tp-tabbar-active-lens",
|
|
708
|
+
"aria-hidden": "true",
|
|
709
|
+
"data-active-index": C,
|
|
710
|
+
style: T
|
|
711
|
+
}),
|
|
712
|
+
t.map((e) => {
|
|
713
|
+
let t = e.key === n;
|
|
714
|
+
return /* @__PURE__ */ g("button", {
|
|
715
|
+
type: "button",
|
|
716
|
+
role: "tab",
|
|
717
|
+
"aria-selected": t,
|
|
718
|
+
className: `tp-tabbar-item ${t ? "tp-tabbar-item--active" : ""}`.trim(),
|
|
719
|
+
onClick: () => r(e.key),
|
|
720
|
+
children: [/* @__PURE__ */ g("span", {
|
|
721
|
+
className: "tp-tabbar-icon-wrap",
|
|
722
|
+
children: [/* @__PURE__ */ h("span", {
|
|
723
|
+
className: "tp-tabbar-icon",
|
|
724
|
+
children: M(e, t, v)
|
|
725
|
+
}), N(e.badge)]
|
|
726
|
+
}), /* @__PURE__ */ h("span", {
|
|
727
|
+
className: "tp-tabbar-label",
|
|
728
|
+
children: e.label
|
|
729
|
+
})]
|
|
730
|
+
}, e.key);
|
|
731
|
+
})
|
|
732
|
+
]
|
|
733
|
+
}),
|
|
734
|
+
x && /* @__PURE__ */ h("div", {
|
|
735
|
+
className: "tp-tabbar-extra",
|
|
736
|
+
children: b
|
|
737
|
+
}),
|
|
738
|
+
S && /* @__PURE__ */ h("div", {
|
|
739
|
+
className: "tp-tabbar-android-fab",
|
|
740
|
+
children: l
|
|
741
|
+
})
|
|
742
|
+
]
|
|
685
743
|
});
|
|
686
744
|
}, F = ({ options: e, value: t, onChange: n, variant: r = "underline", fullWidth: i = !0, className: a = "", style: o }) => {
|
|
687
745
|
let s = [
|
|
@@ -720,89 +778,119 @@ var P = ({ items: e, activeKey: t, onChange: n, variant: r = "floating-pill", ex
|
|
|
720
778
|
}, e.key);
|
|
721
779
|
})
|
|
722
780
|
});
|
|
723
|
-
}, I = ({ total: e, current: t,
|
|
781
|
+
}, I = ({ total: e, current: t, variant: n = "dots", onChange: r, className: i = "", style: a }) => {
|
|
724
782
|
if (e <= 0) return null;
|
|
725
|
-
let
|
|
783
|
+
let o = [
|
|
784
|
+
"tp-page-control",
|
|
785
|
+
`tp-page-control--${n}`,
|
|
786
|
+
i
|
|
787
|
+
].filter(Boolean).join(" ");
|
|
726
788
|
return /* @__PURE__ */ h("div", {
|
|
727
|
-
className:
|
|
789
|
+
className: o,
|
|
728
790
|
role: "navigation",
|
|
729
791
|
"aria-label": "Page indicator",
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
792
|
+
"data-variant": n,
|
|
793
|
+
style: a,
|
|
794
|
+
children: Array.from({ length: e }, (e, i) => {
|
|
795
|
+
let a = n === "process" ? i <= t : i === t, o = i === t, s = [
|
|
796
|
+
n === "process" ? "tp-page-control-bar" : "tp-page-control-dot",
|
|
797
|
+
a ? n === "process" ? "tp-page-control-bar--active" : "tp-page-control-dot--active" : "",
|
|
798
|
+
o && n === "process" ? "tp-page-control-bar--current" : ""
|
|
799
|
+
].filter(Boolean).join(" ");
|
|
800
|
+
return r ? /* @__PURE__ */ h("button", {
|
|
734
801
|
type: "button",
|
|
735
|
-
className:
|
|
736
|
-
"aria-label": `Page ${
|
|
737
|
-
"aria-current":
|
|
738
|
-
"data-active": String(
|
|
739
|
-
onClick: () =>
|
|
740
|
-
},
|
|
741
|
-
className:
|
|
742
|
-
"data-active": String(
|
|
743
|
-
"aria-current":
|
|
744
|
-
},
|
|
802
|
+
className: s,
|
|
803
|
+
"aria-label": `Page ${i + 1}`,
|
|
804
|
+
"aria-current": o ? "page" : void 0,
|
|
805
|
+
"data-active": String(a),
|
|
806
|
+
onClick: () => r(i)
|
|
807
|
+
}, i) : /* @__PURE__ */ h("span", {
|
|
808
|
+
className: s,
|
|
809
|
+
"data-active": String(a),
|
|
810
|
+
"aria-current": o ? "page" : void 0
|
|
811
|
+
}, i);
|
|
745
812
|
})
|
|
746
813
|
});
|
|
747
|
-
}, L = ({ variant: e = "primary", size: t = "lg", block: n = !1, loading: r = !1,
|
|
748
|
-
let
|
|
814
|
+
}, L = ({ variant: e = "primary", size: t = "lg", block: n = !1, loading: r = !1, progress: i, htmlType: a = "button", icon: o, disabled: s = !1, className: c = "", children: l, ...u }) => {
|
|
815
|
+
let d = typeof i == "number" && !Number.isNaN(i) ? Math.max(0, Math.min(100, i)) : void 0, f = [
|
|
749
816
|
"tp-btn",
|
|
750
817
|
`tp-btn--${e}`,
|
|
751
818
|
`tp-btn--${t}`,
|
|
752
819
|
n ? "tp-btn--block" : "",
|
|
753
820
|
r ? "tp-btn--loading" : "",
|
|
754
|
-
|
|
821
|
+
d === void 0 ? "" : "tp-btn--has-progress",
|
|
822
|
+
c
|
|
755
823
|
].filter(Boolean).join(" ");
|
|
756
824
|
return /* @__PURE__ */ g("button", {
|
|
757
|
-
...
|
|
758
|
-
type:
|
|
759
|
-
className:
|
|
760
|
-
disabled:
|
|
825
|
+
...u,
|
|
826
|
+
type: a,
|
|
827
|
+
className: f,
|
|
828
|
+
disabled: s || r,
|
|
761
829
|
"aria-busy": r || void 0,
|
|
762
830
|
"data-variant": e,
|
|
763
831
|
"data-size": t,
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
"
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
832
|
+
"data-progress": d === void 0 ? void 0 : String(d),
|
|
833
|
+
children: [
|
|
834
|
+
d !== void 0 && /* @__PURE__ */ h("span", {
|
|
835
|
+
className: "tp-btn-progress",
|
|
836
|
+
"aria-hidden": "true",
|
|
837
|
+
style: { width: `${d}%` }
|
|
838
|
+
}),
|
|
839
|
+
r ? /* @__PURE__ */ h("span", {
|
|
840
|
+
className: "tp-btn-spinner",
|
|
841
|
+
"aria-hidden": "true"
|
|
842
|
+
}) : o == null ? null : /* @__PURE__ */ h("span", {
|
|
843
|
+
className: "tp-btn-icon",
|
|
844
|
+
"aria-hidden": "true",
|
|
845
|
+
children: o
|
|
846
|
+
}),
|
|
847
|
+
l != null && /* @__PURE__ */ h("span", {
|
|
848
|
+
className: "tp-btn-label",
|
|
849
|
+
children: l
|
|
850
|
+
})
|
|
851
|
+
]
|
|
775
852
|
});
|
|
776
|
-
}, R = ({ layout: e = "single", primaryText: t,
|
|
777
|
-
let
|
|
853
|
+
}, R = ({ layout: e = "single", primaryText: t, primaryVariant: n = "primary", onPrimaryClick: r, primaryLoading: i = !1, primaryDisabled: a = !1, secondaryText: o, onSecondaryClick: s, secondaryVariant: c = "secondary", tertiaryText: l, onTertiaryClick: u, tertiaryVariant: d = "text", tertiaryDisabled: f = !1, note: p, className: _ = "", style: v }) => {
|
|
854
|
+
let y = [
|
|
778
855
|
"tp-fixed-btn-bar",
|
|
779
856
|
`tp-fixed-btn-bar--${e}`,
|
|
780
|
-
|
|
781
|
-
].filter(Boolean).join(" "),
|
|
782
|
-
variant:
|
|
857
|
+
_
|
|
858
|
+
].filter(Boolean).join(" "), b = /* @__PURE__ */ h(L, {
|
|
859
|
+
variant: n,
|
|
783
860
|
size: "lg",
|
|
784
861
|
block: !0,
|
|
785
|
-
loading:
|
|
786
|
-
disabled:
|
|
787
|
-
onClick:
|
|
862
|
+
loading: i,
|
|
863
|
+
disabled: a,
|
|
864
|
+
onClick: r,
|
|
788
865
|
children: t
|
|
789
|
-
}),
|
|
790
|
-
variant:
|
|
866
|
+
}), x = o ? /* @__PURE__ */ h(L, {
|
|
867
|
+
variant: c,
|
|
791
868
|
size: "lg",
|
|
792
869
|
block: !0,
|
|
793
|
-
onClick:
|
|
794
|
-
children:
|
|
870
|
+
onClick: s,
|
|
871
|
+
children: o
|
|
795
872
|
}) : null;
|
|
796
873
|
return /* @__PURE__ */ g("div", {
|
|
797
|
-
className:
|
|
874
|
+
className: y,
|
|
798
875
|
"data-layout": e,
|
|
799
|
-
style:
|
|
800
|
-
children: [
|
|
876
|
+
style: v,
|
|
877
|
+
children: [p != null && /* @__PURE__ */ h("div", {
|
|
801
878
|
className: "tp-fixed-btn-bar-note",
|
|
802
|
-
children:
|
|
879
|
+
children: p
|
|
803
880
|
}), /* @__PURE__ */ h("div", {
|
|
804
881
|
className: "tp-fixed-btn-bar-actions",
|
|
805
|
-
children: e === "dual-horizontal" ? /* @__PURE__ */ g(m, { children: [
|
|
882
|
+
children: e === "dual-horizontal" ? /* @__PURE__ */ g(m, { children: [x, b] }) : e === "triple" ? /* @__PURE__ */ g(m, { children: [
|
|
883
|
+
b,
|
|
884
|
+
x,
|
|
885
|
+
l ? /* @__PURE__ */ h(L, {
|
|
886
|
+
variant: d,
|
|
887
|
+
size: "lg",
|
|
888
|
+
block: !0,
|
|
889
|
+
disabled: f,
|
|
890
|
+
onClick: u,
|
|
891
|
+
children: l
|
|
892
|
+
}) : null
|
|
893
|
+
] }) : /* @__PURE__ */ g(m, { children: [b, e === "dual-vertical" ? x : null] })
|
|
806
894
|
})]
|
|
807
895
|
});
|
|
808
896
|
}, z = ({ checked: e, defaultChecked: t = !1, onChange: n, disabled: r = !1, loading: i = !1, ariaLabel: a, className: o = "", style: s }) => {
|
|
@@ -1050,35 +1138,60 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1050
1138
|
}) : null
|
|
1051
1139
|
})
|
|
1052
1140
|
});
|
|
1053
|
-
}, K = ({ 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,
|
|
1054
|
-
let
|
|
1055
|
-
!d &&
|
|
1056
|
-
},
|
|
1057
|
-
|
|
1058
|
-
},
|
|
1141
|
+
}, K = ({ 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, layout: f = "default", error: p, onClick: _, className: v = "", style: y }) => {
|
|
1142
|
+
let b = f === "form-field", x = !!_ && !d, S = !b && r != null || o != null || a != null || !!c || !!l || s, C = () => {
|
|
1143
|
+
!d && _ && _();
|
|
1144
|
+
}, w = (e) => {
|
|
1145
|
+
x && e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), _?.());
|
|
1146
|
+
}, T = [
|
|
1059
1147
|
"tp-list-item",
|
|
1060
|
-
|
|
1148
|
+
b ? "tp-list-item--form-field" : "",
|
|
1149
|
+
p ? "tp-list-item--error" : "",
|
|
1150
|
+
x ? "tp-list-item--clickable" : "",
|
|
1061
1151
|
u ? "tp-list-item--danger" : "",
|
|
1062
1152
|
d ? "tp-list-item--disabled" : "",
|
|
1063
|
-
|
|
1153
|
+
v
|
|
1064
1154
|
].filter(Boolean).join(" ");
|
|
1065
1155
|
return /* @__PURE__ */ g("div", {
|
|
1066
|
-
className:
|
|
1067
|
-
style:
|
|
1068
|
-
role:
|
|
1069
|
-
tabIndex:
|
|
1156
|
+
className: T,
|
|
1157
|
+
style: y,
|
|
1158
|
+
role: _ ? "button" : void 0,
|
|
1159
|
+
tabIndex: x ? 0 : void 0,
|
|
1070
1160
|
"aria-disabled": d || void 0,
|
|
1161
|
+
"data-layout": f,
|
|
1071
1162
|
"data-checked": c === void 0 ? void 0 : String(!!c),
|
|
1072
|
-
onClick:
|
|
1073
|
-
onKeyDown:
|
|
1163
|
+
onClick: _ ? C : void 0,
|
|
1164
|
+
onKeyDown: _ ? w : void 0,
|
|
1074
1165
|
children: [
|
|
1075
1166
|
i != null && /* @__PURE__ */ h("div", {
|
|
1076
1167
|
className: "tp-list-item-leading",
|
|
1077
1168
|
children: i
|
|
1078
1169
|
}),
|
|
1079
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ h("div", {
|
|
1080
1171
|
className: "tp-list-item-content",
|
|
1081
|
-
children: [
|
|
1172
|
+
children: b ? /* @__PURE__ */ g(m, { children: [
|
|
1173
|
+
/* @__PURE__ */ h("div", {
|
|
1174
|
+
className: "tp-list-item-form-label",
|
|
1175
|
+
children: e
|
|
1176
|
+
}),
|
|
1177
|
+
r != null && /* @__PURE__ */ h("div", {
|
|
1178
|
+
className: "tp-list-item-form-value",
|
|
1179
|
+
children: r
|
|
1180
|
+
}),
|
|
1181
|
+
t != null && /* @__PURE__ */ h("div", {
|
|
1182
|
+
className: "tp-list-item-subtitle",
|
|
1183
|
+
children: t
|
|
1184
|
+
}),
|
|
1185
|
+
n != null && /* @__PURE__ */ h("div", {
|
|
1186
|
+
className: "tp-list-item-description",
|
|
1187
|
+
children: n
|
|
1188
|
+
}),
|
|
1189
|
+
p != null && p !== "" && /* @__PURE__ */ h("div", {
|
|
1190
|
+
className: "tp-list-item-error",
|
|
1191
|
+
role: "alert",
|
|
1192
|
+
children: p
|
|
1193
|
+
})
|
|
1194
|
+
] }) : /* @__PURE__ */ g(m, { children: [
|
|
1082
1195
|
/* @__PURE__ */ h("div", {
|
|
1083
1196
|
className: "tp-list-item-title",
|
|
1084
1197
|
children: e
|
|
@@ -1090,13 +1203,18 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1090
1203
|
n != null && /* @__PURE__ */ h("div", {
|
|
1091
1204
|
className: "tp-list-item-description",
|
|
1092
1205
|
children: n
|
|
1206
|
+
}),
|
|
1207
|
+
p != null && p !== "" && /* @__PURE__ */ h("div", {
|
|
1208
|
+
className: "tp-list-item-error",
|
|
1209
|
+
role: "alert",
|
|
1210
|
+
children: p
|
|
1093
1211
|
})
|
|
1094
|
-
]
|
|
1212
|
+
] })
|
|
1095
1213
|
}),
|
|
1096
|
-
|
|
1214
|
+
S && /* @__PURE__ */ g("div", {
|
|
1097
1215
|
className: "tp-list-item-trailing-group",
|
|
1098
1216
|
children: [
|
|
1099
|
-
r != null && /* @__PURE__ */ h("div", {
|
|
1217
|
+
!b && r != null && /* @__PURE__ */ h("div", {
|
|
1100
1218
|
className: "tp-list-item-value",
|
|
1101
1219
|
children: r
|
|
1102
1220
|
}),
|
|
@@ -1190,7 +1308,7 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1190
1308
|
children: n
|
|
1191
1309
|
})]
|
|
1192
1310
|
});
|
|
1193
|
-
},
|
|
1311
|
+
}, Y = ({ children: e, tone: t = "default", className: n = "", style: r }) => {
|
|
1194
1312
|
let i = [
|
|
1195
1313
|
"tp-section-note",
|
|
1196
1314
|
`tp-section-note--${t}`,
|
|
@@ -1201,7 +1319,7 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1201
1319
|
style: r,
|
|
1202
1320
|
children: e
|
|
1203
1321
|
});
|
|
1204
|
-
},
|
|
1322
|
+
}, ee = {
|
|
1205
1323
|
title1: "h1",
|
|
1206
1324
|
title2: "h2",
|
|
1207
1325
|
title3: "h3",
|
|
@@ -1210,8 +1328,8 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1210
1328
|
subhead: "span",
|
|
1211
1329
|
caption: "span",
|
|
1212
1330
|
footnote: "span"
|
|
1213
|
-
},
|
|
1214
|
-
let s = n ??
|
|
1331
|
+
}, te = ({ variant: e = "body", tone: t = "primary", as: n, weight: r, className: i = "", style: a, children: o }) => {
|
|
1332
|
+
let s = n ?? ee[e], c = [
|
|
1215
1333
|
"tp-text",
|
|
1216
1334
|
`tp-text--${e}`,
|
|
1217
1335
|
`tp-text--tone-${t}`,
|
|
@@ -1223,38 +1341,48 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1223
1341
|
style: a,
|
|
1224
1342
|
children: o
|
|
1225
1343
|
});
|
|
1226
|
-
},
|
|
1227
|
-
let
|
|
1344
|
+
}, ne = ({ children: e, tone: t, selected: n, size: r = "md", shape: i = "pill", appearance: a = "soft", closable: o = !1, onClose: s, onClick: c, className: l = "", style: u }) => {
|
|
1345
|
+
let d = t ?? (n ? "focus" : "neutral"), f = n === !0 ? "tp-tag--selected" : n === !1 ? "tp-tag--unselected" : "", p = [
|
|
1228
1346
|
"tp-tag",
|
|
1229
1347
|
`tp-tag--${r}`,
|
|
1230
|
-
`tp-tag--
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1348
|
+
`tp-tag--shape-${i}`,
|
|
1349
|
+
`tp-tag--appearance-${a}`,
|
|
1350
|
+
`tp-tag--tone-${d}`,
|
|
1351
|
+
f,
|
|
1352
|
+
c ? "tp-tag--clickable" : "",
|
|
1353
|
+
l
|
|
1234
1354
|
].filter(Boolean).join(" ");
|
|
1235
|
-
return
|
|
1355
|
+
return c && !o ? /* @__PURE__ */ h("button", {
|
|
1236
1356
|
type: "button",
|
|
1237
|
-
className:
|
|
1238
|
-
style:
|
|
1357
|
+
className: p,
|
|
1358
|
+
style: u,
|
|
1359
|
+
"data-tone": d,
|
|
1360
|
+
"data-shape": i,
|
|
1361
|
+
"data-appearance": a,
|
|
1362
|
+
"data-size": r,
|
|
1239
1363
|
"aria-pressed": n === void 0 ? void 0 : n,
|
|
1240
|
-
onClick:
|
|
1364
|
+
onClick: c,
|
|
1241
1365
|
children: /* @__PURE__ */ h("span", { children: e })
|
|
1242
1366
|
}) : /* @__PURE__ */ g("span", {
|
|
1243
|
-
className:
|
|
1244
|
-
style:
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
"
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1367
|
+
className: p,
|
|
1368
|
+
style: u,
|
|
1369
|
+
"data-tone": d,
|
|
1370
|
+
"data-shape": i,
|
|
1371
|
+
"data-appearance": a,
|
|
1372
|
+
"data-size": r,
|
|
1373
|
+
role: c ? "button" : void 0,
|
|
1374
|
+
tabIndex: c ? 0 : void 0,
|
|
1375
|
+
"aria-pressed": c && n !== void 0 ? n : void 0,
|
|
1376
|
+
onClick: c,
|
|
1377
|
+
onKeyDown: c ? (e) => {
|
|
1378
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), c());
|
|
1251
1379
|
} : void 0,
|
|
1252
|
-
children: [/* @__PURE__ */ h("span", { children: e }),
|
|
1380
|
+
children: [/* @__PURE__ */ h("span", { children: e }), o ? /* @__PURE__ */ h("button", {
|
|
1253
1381
|
type: "button",
|
|
1254
1382
|
className: "tp-tag-close",
|
|
1255
1383
|
"aria-label": "Remove tag",
|
|
1256
1384
|
onClick: (e) => {
|
|
1257
|
-
e.stopPropagation(),
|
|
1385
|
+
e.stopPropagation(), s?.();
|
|
1258
1386
|
},
|
|
1259
1387
|
children: /* @__PURE__ */ h("svg", {
|
|
1260
1388
|
width: "10",
|
|
@@ -1271,7 +1399,7 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1271
1399
|
})
|
|
1272
1400
|
}) : null]
|
|
1273
1401
|
});
|
|
1274
|
-
},
|
|
1402
|
+
}, re = ({ count: e, dot: t = !1, tone: n = "alert", max: r = 99, showZero: i = !1, children: a, className: o = "", style: s }) => {
|
|
1275
1403
|
let c = null, l = !1;
|
|
1276
1404
|
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));
|
|
1277
1405
|
let u = l ? /* @__PURE__ */ h("span", {
|
|
@@ -1290,26 +1418,27 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1290
1418
|
style: s,
|
|
1291
1419
|
children: [a, u]
|
|
1292
1420
|
}) : u;
|
|
1293
|
-
},
|
|
1294
|
-
let
|
|
1421
|
+
}, ie = ({ illustration: e, theme: t, icon: n, title: i, description: a, actionText: o, onAction: s, compact: c = !1, size: l, className: u = "", style: d }) => {
|
|
1422
|
+
let f = l ? l === "compact" : c, p = [
|
|
1295
1423
|
"tp-empty-state",
|
|
1296
|
-
|
|
1297
|
-
|
|
1424
|
+
f ? "tp-empty-state--compact" : "",
|
|
1425
|
+
u
|
|
1298
1426
|
].filter(Boolean).join(" ");
|
|
1299
1427
|
return /* @__PURE__ */ g("div", {
|
|
1300
|
-
className:
|
|
1301
|
-
|
|
1428
|
+
className: p,
|
|
1429
|
+
"data-size": f ? "compact" : "full",
|
|
1430
|
+
style: d,
|
|
1302
1431
|
children: [
|
|
1303
1432
|
e ? /* @__PURE__ */ h("div", {
|
|
1304
1433
|
className: "tp-empty-state-media",
|
|
1305
|
-
children: /* @__PURE__ */ h(
|
|
1434
|
+
children: /* @__PURE__ */ h(r, {
|
|
1306
1435
|
name: e,
|
|
1307
|
-
theme:
|
|
1308
|
-
width:
|
|
1436
|
+
theme: t,
|
|
1437
|
+
width: f ? 180 : 240
|
|
1309
1438
|
})
|
|
1310
|
-
}) :
|
|
1439
|
+
}) : n ? /* @__PURE__ */ h("div", {
|
|
1311
1440
|
className: "tp-empty-state-icon",
|
|
1312
|
-
children:
|
|
1441
|
+
children: n
|
|
1313
1442
|
}) : null,
|
|
1314
1443
|
/* @__PURE__ */ h("div", {
|
|
1315
1444
|
className: "tp-empty-state-title",
|
|
@@ -1327,89 +1456,89 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1327
1456
|
})
|
|
1328
1457
|
]
|
|
1329
1458
|
});
|
|
1330
|
-
},
|
|
1331
|
-
let
|
|
1332
|
-
|
|
1333
|
-
},
|
|
1334
|
-
|
|
1335
|
-
},
|
|
1459
|
+
}, ae = ({ variant: e = "standard", label: t, value: n, defaultValue: r = "", onChange: i, clearable: a = !1, password: o = !1, multiline: s = !1, rows: c = 3, showCount: u = !1, error: d, helperText: m, prefix: _, suffix: v, containerClassName: y = "", className: b = "", style: x, id: S, type: C = "text", disabled: w = !1, readOnly: T = !1, onFocus: E, onBlur: D, ...O }) => {
|
|
1460
|
+
let k = l(), A = S ?? `tp-input-${k}`, j = `${A}-message`, M = f(null), N = f(null), [P, F] = p(r), [I, L] = p(!1), [R, z] = p(!1), B = n !== void 0, V = B ? n : P, H = !!(d || m), U = (e) => {
|
|
1461
|
+
B || F(e), i?.(e);
|
|
1462
|
+
}, W = () => {
|
|
1463
|
+
U(""), s ? N.current?.focus() : M.current?.focus();
|
|
1464
|
+
}, G = a && V.length > 0 && !w && !T, K = o && !s, q = o ? R ? "text" : "password" : C, J = [
|
|
1336
1465
|
"tp-input-field",
|
|
1337
1466
|
`tp-input-field--${e}`,
|
|
1338
|
-
|
|
1339
|
-
].filter(Boolean).join(" "),
|
|
1467
|
+
y
|
|
1468
|
+
].filter(Boolean).join(" "), Y = [
|
|
1340
1469
|
"tp-input-box",
|
|
1341
1470
|
`tp-input-box--variant-${e}`,
|
|
1342
1471
|
s ? "tp-input-box--multiline" : "",
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1472
|
+
I ? "tp-input-box--focused" : "",
|
|
1473
|
+
d ? "tp-input-box--error" : "",
|
|
1474
|
+
w ? "tp-input-box--disabled" : ""
|
|
1346
1475
|
].filter(Boolean).join(" ");
|
|
1347
1476
|
return /* @__PURE__ */ g("div", {
|
|
1348
|
-
className:
|
|
1477
|
+
className: J,
|
|
1349
1478
|
"data-variant": e,
|
|
1350
1479
|
children: [
|
|
1351
1480
|
e !== "borderless" && t != null && /* @__PURE__ */ h("label", {
|
|
1352
|
-
htmlFor:
|
|
1481
|
+
htmlFor: A,
|
|
1353
1482
|
className: "tp-input-label",
|
|
1354
1483
|
children: t
|
|
1355
1484
|
}),
|
|
1356
1485
|
/* @__PURE__ */ g("div", {
|
|
1357
|
-
className:
|
|
1486
|
+
className: Y,
|
|
1358
1487
|
children: [
|
|
1359
|
-
|
|
1488
|
+
_ != null && /* @__PURE__ */ h("span", {
|
|
1360
1489
|
className: "tp-input-prefix",
|
|
1361
|
-
children:
|
|
1490
|
+
children: _
|
|
1362
1491
|
}),
|
|
1363
1492
|
s ? /* @__PURE__ */ h("textarea", {
|
|
1364
|
-
ref:
|
|
1365
|
-
id:
|
|
1366
|
-
name:
|
|
1493
|
+
ref: N,
|
|
1494
|
+
id: A,
|
|
1495
|
+
name: O.name,
|
|
1367
1496
|
rows: c,
|
|
1368
|
-
placeholder:
|
|
1369
|
-
maxLength:
|
|
1370
|
-
autoFocus:
|
|
1371
|
-
autoComplete:
|
|
1372
|
-
required:
|
|
1373
|
-
disabled:
|
|
1374
|
-
readOnly:
|
|
1375
|
-
value:
|
|
1376
|
-
"aria-label":
|
|
1377
|
-
"aria-invalid":
|
|
1378
|
-
"aria-describedby":
|
|
1379
|
-
className: `tp-input-textarea ${
|
|
1380
|
-
style:
|
|
1381
|
-
onChange: (e) =>
|
|
1497
|
+
placeholder: O.placeholder,
|
|
1498
|
+
maxLength: O.maxLength,
|
|
1499
|
+
autoFocus: O.autoFocus,
|
|
1500
|
+
autoComplete: O.autoComplete,
|
|
1501
|
+
required: O.required,
|
|
1502
|
+
disabled: w,
|
|
1503
|
+
readOnly: T,
|
|
1504
|
+
value: V,
|
|
1505
|
+
"aria-label": O["aria-label"],
|
|
1506
|
+
"aria-invalid": d ? !0 : void 0,
|
|
1507
|
+
"aria-describedby": H ? j : O["aria-describedby"],
|
|
1508
|
+
className: `tp-input-textarea ${b}`.trim(),
|
|
1509
|
+
style: x,
|
|
1510
|
+
onChange: (e) => U(e.target.value),
|
|
1382
1511
|
onFocus: (e) => {
|
|
1383
|
-
|
|
1512
|
+
L(!0), E?.(e);
|
|
1384
1513
|
},
|
|
1385
1514
|
onBlur: (e) => {
|
|
1386
|
-
|
|
1515
|
+
L(!1), D?.(e);
|
|
1387
1516
|
}
|
|
1388
1517
|
}) : /* @__PURE__ */ h("input", {
|
|
1389
|
-
...
|
|
1390
|
-
ref:
|
|
1391
|
-
id:
|
|
1392
|
-
type:
|
|
1393
|
-
disabled:
|
|
1394
|
-
readOnly:
|
|
1395
|
-
value:
|
|
1396
|
-
"aria-invalid":
|
|
1397
|
-
"aria-describedby":
|
|
1398
|
-
className: `tp-input-control ${
|
|
1399
|
-
style:
|
|
1400
|
-
onChange: (e) =>
|
|
1518
|
+
...O,
|
|
1519
|
+
ref: M,
|
|
1520
|
+
id: A,
|
|
1521
|
+
type: q,
|
|
1522
|
+
disabled: w,
|
|
1523
|
+
readOnly: T,
|
|
1524
|
+
value: V,
|
|
1525
|
+
"aria-invalid": d ? !0 : void 0,
|
|
1526
|
+
"aria-describedby": H ? j : O["aria-describedby"],
|
|
1527
|
+
className: `tp-input-control ${b}`.trim(),
|
|
1528
|
+
style: x,
|
|
1529
|
+
onChange: (e) => U(e.target.value),
|
|
1401
1530
|
onFocus: (e) => {
|
|
1402
|
-
|
|
1531
|
+
L(!0), E?.(e);
|
|
1403
1532
|
},
|
|
1404
1533
|
onBlur: (e) => {
|
|
1405
|
-
|
|
1534
|
+
L(!1), D?.(e);
|
|
1406
1535
|
}
|
|
1407
1536
|
}),
|
|
1408
|
-
|
|
1537
|
+
G && /* @__PURE__ */ h("button", {
|
|
1409
1538
|
type: "button",
|
|
1410
1539
|
className: "tp-input-action-btn",
|
|
1411
1540
|
"aria-label": "Clear input",
|
|
1412
|
-
onClick:
|
|
1541
|
+
onClick: W,
|
|
1413
1542
|
children: /* @__PURE__ */ g("svg", {
|
|
1414
1543
|
width: "14",
|
|
1415
1544
|
height: "14",
|
|
@@ -1430,12 +1559,12 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1430
1559
|
})]
|
|
1431
1560
|
})
|
|
1432
1561
|
}),
|
|
1433
|
-
|
|
1562
|
+
K && /* @__PURE__ */ h("button", {
|
|
1434
1563
|
type: "button",
|
|
1435
1564
|
className: "tp-input-action-btn",
|
|
1436
|
-
"aria-label":
|
|
1437
|
-
onClick: () =>
|
|
1438
|
-
children:
|
|
1565
|
+
"aria-label": R ? "Hide password" : "Show password",
|
|
1566
|
+
onClick: () => z((e) => !e),
|
|
1567
|
+
children: R ? /* @__PURE__ */ g("svg", {
|
|
1439
1568
|
width: "18",
|
|
1440
1569
|
height: "18",
|
|
1441
1570
|
viewBox: "0 0 20 20",
|
|
@@ -1466,31 +1595,39 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1466
1595
|
})
|
|
1467
1596
|
})
|
|
1468
1597
|
}),
|
|
1469
|
-
|
|
1598
|
+
v != null && /* @__PURE__ */ h("span", {
|
|
1470
1599
|
className: "tp-input-suffix",
|
|
1471
|
-
children:
|
|
1600
|
+
children: v
|
|
1472
1601
|
})
|
|
1473
1602
|
]
|
|
1474
1603
|
}),
|
|
1475
|
-
u ? /* @__PURE__ */
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1604
|
+
d || m || u ? /* @__PURE__ */ g("div", {
|
|
1605
|
+
className: "tp-input-footer",
|
|
1606
|
+
children: [d ? /* @__PURE__ */ h("div", {
|
|
1607
|
+
id: j,
|
|
1608
|
+
className: "tp-input-error",
|
|
1609
|
+
role: "alert",
|
|
1610
|
+
children: d
|
|
1611
|
+
}) : m ? /* @__PURE__ */ h("div", {
|
|
1612
|
+
id: j,
|
|
1613
|
+
className: "tp-input-helper",
|
|
1614
|
+
children: m
|
|
1615
|
+
}) : /* @__PURE__ */ h("span", {}), u && /* @__PURE__ */ g("span", {
|
|
1616
|
+
className: "tp-input-count",
|
|
1617
|
+
"aria-live": "polite",
|
|
1618
|
+
children: [V.length, O.maxLength === void 0 ? "" : `/${O.maxLength}`]
|
|
1619
|
+
})]
|
|
1484
1620
|
}) : null
|
|
1485
1621
|
]
|
|
1486
1622
|
});
|
|
1487
|
-
},
|
|
1488
|
-
let
|
|
1489
|
-
|
|
1623
|
+
}, oe = ({ value: e, defaultValue: t = "", placeholder: n = "Search", onChange: r, onSearch: i, onCancel: a, showCancel: o = !1, autoFocus: s = !1, shape: c = "auto", className: l = "", style: u }) => {
|
|
1624
|
+
let d = f(null), [m, _] = p(t), v = e !== void 0, y = v ? e : m, b = (e) => {
|
|
1625
|
+
v || _(e), r?.(e);
|
|
1490
1626
|
};
|
|
1491
1627
|
return /* @__PURE__ */ g("div", {
|
|
1492
|
-
className: `tp-search-bar
|
|
1493
|
-
|
|
1628
|
+
className: `tp-search-bar tp-search-bar--shape-${c} ${l}`.trim(),
|
|
1629
|
+
"data-shape": c,
|
|
1630
|
+
style: u,
|
|
1494
1631
|
children: [/* @__PURE__ */ g("div", {
|
|
1495
1632
|
className: "tp-search-field",
|
|
1496
1633
|
children: [
|
|
@@ -1517,24 +1654,24 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1517
1654
|
})
|
|
1518
1655
|
}),
|
|
1519
1656
|
/* @__PURE__ */ h("input", {
|
|
1520
|
-
ref:
|
|
1657
|
+
ref: d,
|
|
1521
1658
|
type: "search",
|
|
1522
1659
|
className: "tp-search-input",
|
|
1523
|
-
value:
|
|
1660
|
+
value: y,
|
|
1524
1661
|
placeholder: n,
|
|
1525
1662
|
"aria-label": n,
|
|
1526
1663
|
autoFocus: s,
|
|
1527
|
-
onChange: (e) =>
|
|
1664
|
+
onChange: (e) => b(e.target.value),
|
|
1528
1665
|
onKeyDown: (e) => {
|
|
1529
|
-
e.key === "Enter" && (e.preventDefault(), i?.(
|
|
1666
|
+
e.key === "Enter" && (e.preventDefault(), i?.(y));
|
|
1530
1667
|
}
|
|
1531
1668
|
}),
|
|
1532
|
-
|
|
1669
|
+
y.length > 0 && /* @__PURE__ */ h("button", {
|
|
1533
1670
|
type: "button",
|
|
1534
1671
|
className: "tp-search-clear",
|
|
1535
1672
|
"aria-label": "Clear search",
|
|
1536
1673
|
onClick: () => {
|
|
1537
|
-
|
|
1674
|
+
b(""), d.current?.focus();
|
|
1538
1675
|
},
|
|
1539
1676
|
children: /* @__PURE__ */ h("svg", {
|
|
1540
1677
|
width: "10",
|
|
@@ -1558,7 +1695,7 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1558
1695
|
children: "Cancel"
|
|
1559
1696
|
})]
|
|
1560
1697
|
});
|
|
1561
|
-
},
|
|
1698
|
+
}, se = ({ column: e, itemHeight: t, visibleItems: n, onChange: r }) => {
|
|
1562
1699
|
let i = f(null), a = Math.max(0, e.options.findIndex((t) => t.value === e.value)), o = Math.floor(n / 2) * t;
|
|
1563
1700
|
c(() => {
|
|
1564
1701
|
let e = i.current;
|
|
@@ -1655,7 +1792,7 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1655
1792
|
})
|
|
1656
1793
|
]
|
|
1657
1794
|
});
|
|
1658
|
-
},
|
|
1795
|
+
}, X = ({ columns: e, onChange: t, itemHeight: n = 40, visibleItems: r = 5, className: i = "", style: a }) => {
|
|
1659
1796
|
let o = Math.floor(r / 2) * n;
|
|
1660
1797
|
return /* @__PURE__ */ g("div", {
|
|
1661
1798
|
className: `tp-wheel-picker ${i}`.trim(),
|
|
@@ -1672,7 +1809,7 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1672
1809
|
"aria-hidden": "true"
|
|
1673
1810
|
}), /* @__PURE__ */ h("div", {
|
|
1674
1811
|
className: "tp-wheel-columns",
|
|
1675
|
-
children: e.map((e) => /* @__PURE__ */ h(
|
|
1812
|
+
children: e.map((e) => /* @__PURE__ */ h(se, {
|
|
1676
1813
|
column: e,
|
|
1677
1814
|
itemHeight: n,
|
|
1678
1815
|
visibleItems: r,
|
|
@@ -1682,16 +1819,26 @@ var U = ({ value: e, defaultValue: t, min: n = 0, max: r = 100, step: i = 1, mar
|
|
|
1682
1819
|
});
|
|
1683
1820
|
};
|
|
1684
1821
|
// src/core/components/TPDatePicker.tsx
|
|
1685
|
-
function
|
|
1822
|
+
function Z(e, t) {
|
|
1686
1823
|
return new Date(e, t, 0).getDate();
|
|
1687
1824
|
}
|
|
1688
|
-
function
|
|
1825
|
+
function Q(e, t, n) {
|
|
1689
1826
|
return Math.min(n, Math.max(t, e));
|
|
1690
1827
|
}
|
|
1691
|
-
|
|
1692
|
-
|
|
1828
|
+
function ce(e) {
|
|
1829
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1830
|
+
}
|
|
1831
|
+
function le(e, t) {
|
|
1832
|
+
if (!e) return t;
|
|
1833
|
+
let n = e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
|
|
1834
|
+
if (!n) return t;
|
|
1835
|
+
let r = new Date(Number(n[1]), Number(n[2]) - 1, Number(n[3]));
|
|
1836
|
+
return Number.isNaN(r.getTime()) ? t : r;
|
|
1837
|
+
}
|
|
1838
|
+
var ue = ({ mode: e = "single", value: t, defaultValue: n, rangeValue: r, defaultRangeValue: i, minYear: a = 1990, maxYear: o = 2040, onChange: s, onConfirm: c, onRangeChange: l, onRangeConfirm: u, onCancel: f, title: m, className: _ = "", style: v }) => {
|
|
1839
|
+
let y = e === "range", [b, x] = p(() => n ?? new Date(2026, 0, 1)), [S, C] = p(() => [i?.[0] ?? "2026-01-01", i?.[1] ?? "2026-01-07"]), [w, T] = p("start"), E = r ? [r[0], r[1]] : S, D = y ? r !== void 0 : t !== void 0, O = y ? le(w === "start" ? E[0] : E[1], new Date(2026, 0, 1)) : D && t ? t : b, k = Q(O.getFullYear(), a, o), A = O.getMonth() + 1, j = Z(k, A), M = Math.min(j, O.getDate()), N = d(() => {
|
|
1693
1840
|
let e = [];
|
|
1694
|
-
for (let t =
|
|
1841
|
+
for (let t = a; t <= o; t++) e.push({
|
|
1695
1842
|
value: String(t),
|
|
1696
1843
|
label: String(t)
|
|
1697
1844
|
});
|
|
@@ -1701,7 +1848,7 @@ var le = ({ value: e, defaultValue: t, minYear: n = 1990, maxYear: r = 2040, onC
|
|
|
1701
1848
|
value: String(n),
|
|
1702
1849
|
label: String(n).padStart(2, "0")
|
|
1703
1850
|
};
|
|
1704
|
-
}),
|
|
1851
|
+
}), n = Array.from({ length: j }, (e, t) => {
|
|
1705
1852
|
let n = t + 1;
|
|
1706
1853
|
return {
|
|
1707
1854
|
value: String(n),
|
|
@@ -1712,65 +1859,114 @@ var le = ({ value: e, defaultValue: t, minYear: n = 1990, maxYear: r = 2040, onC
|
|
|
1712
1859
|
{
|
|
1713
1860
|
key: "year",
|
|
1714
1861
|
options: e,
|
|
1715
|
-
value: String(
|
|
1862
|
+
value: String(k)
|
|
1716
1863
|
},
|
|
1717
1864
|
{
|
|
1718
1865
|
key: "month",
|
|
1719
1866
|
options: t,
|
|
1720
|
-
value: String(
|
|
1867
|
+
value: String(A)
|
|
1721
1868
|
},
|
|
1722
1869
|
{
|
|
1723
1870
|
key: "day",
|
|
1724
|
-
options:
|
|
1725
|
-
value: String(
|
|
1871
|
+
options: n,
|
|
1872
|
+
value: String(M)
|
|
1726
1873
|
}
|
|
1727
1874
|
];
|
|
1728
1875
|
}, [
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
]),
|
|
1736
|
-
let
|
|
1737
|
-
if (Number.isNaN(
|
|
1738
|
-
let
|
|
1739
|
-
e === "year" && (
|
|
1740
|
-
let
|
|
1741
|
-
|
|
1742
|
-
|
|
1876
|
+
a,
|
|
1877
|
+
o,
|
|
1878
|
+
j,
|
|
1879
|
+
k,
|
|
1880
|
+
A,
|
|
1881
|
+
M
|
|
1882
|
+
]), P = (e, t) => {
|
|
1883
|
+
let n = Number(t);
|
|
1884
|
+
if (Number.isNaN(n)) return;
|
|
1885
|
+
let i = k, c = A, u = M;
|
|
1886
|
+
e === "year" && (i = Q(n, a, o)), e === "month" && (c = n), e === "day" && (u = n);
|
|
1887
|
+
let d = Math.min(u, Z(i, c)), f = new Date(i, c - 1, d);
|
|
1888
|
+
if (y) {
|
|
1889
|
+
let e = ce(f), t = w === "start" ? [e, E[1] < e ? e : E[1]] : [E[0] > e ? e : E[0], e];
|
|
1890
|
+
r || C(t), l?.(t);
|
|
1891
|
+
} else D || x(f), s?.(f);
|
|
1892
|
+
}, F = m !== void 0 || f !== void 0 || c !== void 0 || u !== void 0;
|
|
1743
1893
|
return /* @__PURE__ */ g("div", {
|
|
1744
|
-
className: `tp-date-picker ${
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1894
|
+
className: `tp-date-picker ${_}`.trim(),
|
|
1895
|
+
"data-mode": e,
|
|
1896
|
+
style: v,
|
|
1897
|
+
children: [
|
|
1898
|
+
F && /* @__PURE__ */ g("div", {
|
|
1899
|
+
className: "tp-date-picker-header",
|
|
1900
|
+
children: [
|
|
1901
|
+
f ? /* @__PURE__ */ h("button", {
|
|
1902
|
+
type: "button",
|
|
1903
|
+
className: "tp-date-picker-btn",
|
|
1904
|
+
onClick: f,
|
|
1905
|
+
children: "Cancel"
|
|
1906
|
+
}) : /* @__PURE__ */ h("span", {}),
|
|
1907
|
+
m !== void 0 && /* @__PURE__ */ h("div", {
|
|
1908
|
+
className: "tp-date-picker-title",
|
|
1909
|
+
children: m
|
|
1910
|
+
}),
|
|
1911
|
+
c || u ? /* @__PURE__ */ h("button", {
|
|
1912
|
+
type: "button",
|
|
1913
|
+
className: "tp-date-picker-btn tp-date-picker-btn--confirm",
|
|
1914
|
+
onClick: () => {
|
|
1915
|
+
y ? u?.(E) : c?.(new Date(k, A - 1, M));
|
|
1916
|
+
},
|
|
1917
|
+
children: "Confirm"
|
|
1918
|
+
}) : /* @__PURE__ */ h("span", {})
|
|
1919
|
+
]
|
|
1920
|
+
}),
|
|
1921
|
+
y && /* @__PURE__ */ g("div", {
|
|
1922
|
+
className: "tp-date-picker-range-tabs",
|
|
1923
|
+
role: "tablist",
|
|
1924
|
+
"aria-label": "Date range bounds",
|
|
1925
|
+
children: [
|
|
1926
|
+
/* @__PURE__ */ g("button", {
|
|
1927
|
+
type: "button",
|
|
1928
|
+
role: "tab",
|
|
1929
|
+
"aria-selected": w === "start",
|
|
1930
|
+
className: `tp-date-picker-range-tab ${w === "start" ? "tp-date-picker-range-tab--active" : ""}`.trim(),
|
|
1931
|
+
onClick: () => T("start"),
|
|
1932
|
+
children: [/* @__PURE__ */ h("span", {
|
|
1933
|
+
className: "tp-date-picker-range-label",
|
|
1934
|
+
children: "Start"
|
|
1935
|
+
}), /* @__PURE__ */ h("span", {
|
|
1936
|
+
className: "tp-date-picker-range-val",
|
|
1937
|
+
children: E[0]
|
|
1938
|
+
})]
|
|
1939
|
+
}),
|
|
1940
|
+
/* @__PURE__ */ h("span", {
|
|
1941
|
+
className: "tp-date-picker-range-sep",
|
|
1942
|
+
"aria-hidden": "true",
|
|
1943
|
+
children: "→"
|
|
1944
|
+
}),
|
|
1945
|
+
/* @__PURE__ */ g("button", {
|
|
1946
|
+
type: "button",
|
|
1947
|
+
role: "tab",
|
|
1948
|
+
"aria-selected": w === "end",
|
|
1949
|
+
className: `tp-date-picker-range-tab ${w === "end" ? "tp-date-picker-range-tab--active" : ""}`.trim(),
|
|
1950
|
+
onClick: () => T("end"),
|
|
1951
|
+
children: [/* @__PURE__ */ h("span", {
|
|
1952
|
+
className: "tp-date-picker-range-label",
|
|
1953
|
+
children: "End"
|
|
1954
|
+
}), /* @__PURE__ */ h("span", {
|
|
1955
|
+
className: "tp-date-picker-range-val",
|
|
1956
|
+
children: E[1]
|
|
1957
|
+
})]
|
|
1958
|
+
})
|
|
1959
|
+
]
|
|
1960
|
+
}),
|
|
1961
|
+
/* @__PURE__ */ h(X, {
|
|
1962
|
+
columns: N,
|
|
1963
|
+
onChange: P
|
|
1964
|
+
})
|
|
1965
|
+
]
|
|
1770
1966
|
});
|
|
1771
1967
|
};
|
|
1772
1968
|
// src/core/components/TPTimePicker.tsx
|
|
1773
|
-
function
|
|
1969
|
+
function de(e, t) {
|
|
1774
1970
|
let n = e.hour, r = e.period;
|
|
1775
1971
|
return t ? (r ||= n >= 12 ? "PM" : "AM", n === 0 ? n = 12 : n > 12 && (n -= 12), {
|
|
1776
1972
|
hour: Math.min(12, Math.max(1, n)),
|
|
@@ -1781,29 +1977,29 @@ function Q(e, t) {
|
|
|
1781
1977
|
minute: Math.min(59, Math.max(0, e.minute))
|
|
1782
1978
|
};
|
|
1783
1979
|
}
|
|
1784
|
-
var
|
|
1785
|
-
let [
|
|
1980
|
+
var fe = ({ value: e, use12Hour: t = !1, format: n, minuteStep: r = 1, onChange: i, className: a = "", style: o }) => {
|
|
1981
|
+
let s = n ? n === "12h" : t, [c, l] = p(() => de({
|
|
1786
1982
|
hour: 9,
|
|
1787
1983
|
minute: 0,
|
|
1788
1984
|
period: "AM"
|
|
1789
|
-
},
|
|
1985
|
+
}, s)), u = e !== void 0, f = de(u ? e : c, s), m = Math.max(1, r), g = d(() => {
|
|
1790
1986
|
let e = [];
|
|
1791
|
-
for (let t = 0; t < 60; t +=
|
|
1987
|
+
for (let t = 0; t < 60; t += m) e.push({
|
|
1792
1988
|
value: String(t),
|
|
1793
1989
|
label: String(t).padStart(2, "0")
|
|
1794
1990
|
});
|
|
1795
1991
|
return e;
|
|
1796
|
-
}, [
|
|
1797
|
-
let e = Number(
|
|
1798
|
-
for (let n of
|
|
1799
|
-
let r = Number(n.value), i = Math.abs(
|
|
1992
|
+
}, [m]), _ = d(() => {
|
|
1993
|
+
let e = Number(g[0]?.value ?? 0), t = Math.abs(f.minute - e);
|
|
1994
|
+
for (let n of g) {
|
|
1995
|
+
let r = Number(n.value), i = Math.abs(f.minute - r);
|
|
1800
1996
|
i < t && (e = r, t = i);
|
|
1801
1997
|
}
|
|
1802
1998
|
return e;
|
|
1803
|
-
}, [
|
|
1999
|
+
}, [f.minute, g]), v = d(() => {
|
|
1804
2000
|
let e = [{
|
|
1805
2001
|
key: "hour",
|
|
1806
|
-
options:
|
|
2002
|
+
options: s ? Array.from({ length: 12 }, (e, t) => {
|
|
1807
2003
|
let n = t + 1;
|
|
1808
2004
|
return {
|
|
1809
2005
|
value: String(n),
|
|
@@ -1813,13 +2009,13 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1813
2009
|
value: String(t),
|
|
1814
2010
|
label: String(t).padStart(2, "0")
|
|
1815
2011
|
})),
|
|
1816
|
-
value: String(
|
|
2012
|
+
value: String(f.hour)
|
|
1817
2013
|
}, {
|
|
1818
2014
|
key: "minute",
|
|
1819
|
-
options:
|
|
1820
|
-
value: String(
|
|
2015
|
+
options: g,
|
|
2016
|
+
value: String(_)
|
|
1821
2017
|
}];
|
|
1822
|
-
return
|
|
2018
|
+
return s && e.push({
|
|
1823
2019
|
key: "period",
|
|
1824
2020
|
options: [{
|
|
1825
2021
|
value: "AM",
|
|
@@ -1828,31 +2024,32 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1828
2024
|
value: "PM",
|
|
1829
2025
|
label: "PM"
|
|
1830
2026
|
}],
|
|
1831
|
-
value:
|
|
2027
|
+
value: f.period ?? "AM"
|
|
1832
2028
|
}), e;
|
|
1833
2029
|
}, [
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2030
|
+
s,
|
|
2031
|
+
f.hour,
|
|
2032
|
+
f.period,
|
|
2033
|
+
g,
|
|
2034
|
+
_
|
|
1839
2035
|
]);
|
|
1840
2036
|
return /* @__PURE__ */ h("div", {
|
|
1841
|
-
className: `tp-time-picker ${
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
2037
|
+
className: `tp-time-picker ${a}`.trim(),
|
|
2038
|
+
"data-format": s ? "12h" : "24h",
|
|
2039
|
+
style: o,
|
|
2040
|
+
children: /* @__PURE__ */ h(X, {
|
|
2041
|
+
columns: v,
|
|
2042
|
+
onChange: (e, t) => {
|
|
2043
|
+
let n = {
|
|
2044
|
+
hour: f.hour,
|
|
2045
|
+
minute: _,
|
|
2046
|
+
...s ? { period: f.period ?? "AM" } : {}
|
|
1850
2047
|
};
|
|
1851
|
-
e === "hour" ?
|
|
2048
|
+
e === "hour" ? n.hour = Number(t) : e === "minute" ? n.minute = Number(t) : e === "period" && (t === "AM" || t === "PM") && (n.period = t), u || l(n), i?.(n);
|
|
1852
2049
|
}
|
|
1853
2050
|
})
|
|
1854
2051
|
});
|
|
1855
|
-
},
|
|
2052
|
+
}, pe = [
|
|
1856
2053
|
{
|
|
1857
2054
|
key: "sun",
|
|
1858
2055
|
en: "S",
|
|
@@ -1902,12 +2099,12 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1902
2099
|
enTitle: "Saturday",
|
|
1903
2100
|
zhTitle: "周六"
|
|
1904
2101
|
}
|
|
1905
|
-
],
|
|
2102
|
+
], me = ({ value: e, defaultValue: t = [], onChange: n, disabled: r = !1, locale: i = "en", className: a = "", style: o }) => {
|
|
1906
2103
|
let [s, c] = p(t), l = e !== void 0, u = l ? e : s, d = (e) => {
|
|
1907
2104
|
if (r) return;
|
|
1908
2105
|
let t = new Set(u);
|
|
1909
2106
|
t.has(e) ? t.delete(e) : t.add(e);
|
|
1910
|
-
let i =
|
|
2107
|
+
let i = pe.map((e) => e.key).filter((e) => t.has(e));
|
|
1911
2108
|
l || c(i), n?.(i);
|
|
1912
2109
|
}, f = [
|
|
1913
2110
|
"tp-day-switcher",
|
|
@@ -1919,7 +2116,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1919
2116
|
style: o,
|
|
1920
2117
|
role: "group",
|
|
1921
2118
|
"aria-label": "Days of week",
|
|
1922
|
-
children:
|
|
2119
|
+
children: pe.map((e) => {
|
|
1923
2120
|
let t = u.includes(e.key), n = i === "zh" ? e.zh : e.en, a = i === "zh" ? e.zhTitle : e.enTitle;
|
|
1924
2121
|
return /* @__PURE__ */ h("button", {
|
|
1925
2122
|
type: "button",
|
|
@@ -1933,7 +2130,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1933
2130
|
}, e.key);
|
|
1934
2131
|
})
|
|
1935
2132
|
});
|
|
1936
|
-
},
|
|
2133
|
+
}, he = [
|
|
1937
2134
|
"1",
|
|
1938
2135
|
"2",
|
|
1939
2136
|
"3",
|
|
@@ -1943,14 +2140,14 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1943
2140
|
"7",
|
|
1944
2141
|
"8",
|
|
1945
2142
|
"9"
|
|
1946
|
-
],
|
|
2143
|
+
], ge = [
|
|
1947
2144
|
"A",
|
|
1948
2145
|
"B",
|
|
1949
2146
|
"C",
|
|
1950
2147
|
"D",
|
|
1951
2148
|
"E",
|
|
1952
2149
|
"F"
|
|
1953
|
-
],
|
|
2150
|
+
], _e = ({ mode: e = "numeric", onKeyPress: t, onBackspace: n, onDone: r, doneLabel: i = "Done", showDot: a = !1, showDash: o, className: s = "", style: c }) => {
|
|
1954
2151
|
let l = o ?? e === "mac-hex", u = a && l, d = u ? null : a ? "." : l ? "-" : null, f = [
|
|
1955
2152
|
"tp-keyboard",
|
|
1956
2153
|
`tp-keyboard--${e}`,
|
|
@@ -1964,7 +2161,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1964
2161
|
children: [
|
|
1965
2162
|
e === "mac-hex" && /* @__PURE__ */ h("div", {
|
|
1966
2163
|
className: "tp-keyboard-hex-row",
|
|
1967
|
-
children:
|
|
2164
|
+
children: ge.map((e) => /* @__PURE__ */ h("button", {
|
|
1968
2165
|
type: "button",
|
|
1969
2166
|
className: "tp-keyboard-key tp-keyboard-key--hex",
|
|
1970
2167
|
onClick: () => t?.(e),
|
|
@@ -1988,7 +2185,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
1988
2185
|
/* @__PURE__ */ g("div", {
|
|
1989
2186
|
className: "tp-keyboard-grid",
|
|
1990
2187
|
children: [
|
|
1991
|
-
|
|
2188
|
+
he.map((e) => /* @__PURE__ */ h("button", {
|
|
1992
2189
|
type: "button",
|
|
1993
2190
|
className: "tp-keyboard-key",
|
|
1994
2191
|
onClick: () => t?.(e),
|
|
@@ -2043,7 +2240,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2043
2240
|
})
|
|
2044
2241
|
]
|
|
2045
2242
|
});
|
|
2046
|
-
},
|
|
2243
|
+
}, ve = ({ open: t, title: n, message: r, actions: i, os: a, inputPlaceholder: o, defaultInputValue: s = "", onClose: u, children: d }) => {
|
|
2047
2244
|
let f = e(), m = a ?? f.os, _ = l(), v = l(), [y, b] = p(s);
|
|
2048
2245
|
if (c(() => {
|
|
2049
2246
|
t && b(s);
|
|
@@ -2113,7 +2310,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2113
2310
|
})]
|
|
2114
2311
|
})
|
|
2115
2312
|
});
|
|
2116
|
-
},
|
|
2313
|
+
}, ye = () => /* @__PURE__ */ h("svg", {
|
|
2117
2314
|
width: "18",
|
|
2118
2315
|
height: "18",
|
|
2119
2316
|
viewBox: "0 0 24 24",
|
|
@@ -2126,7 +2323,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2126
2323
|
strokeLinecap: "round",
|
|
2127
2324
|
strokeLinejoin: "round"
|
|
2128
2325
|
})
|
|
2129
|
-
}),
|
|
2326
|
+
}), be = ({ open: t, title: n, message: r, options: i, cancelText: a = "Cancel", os: o, onSelect: s, onClose: u }) => {
|
|
2130
2327
|
let d = e(), f = o ?? d.os, p = l();
|
|
2131
2328
|
if (c(() => {
|
|
2132
2329
|
if (!t) return;
|
|
@@ -2194,7 +2391,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2194
2391
|
}),
|
|
2195
2392
|
e.selected && /* @__PURE__ */ h("span", {
|
|
2196
2393
|
className: "tp-actionsheet-option-check",
|
|
2197
|
-
children: /* @__PURE__ */ h(
|
|
2394
|
+
children: /* @__PURE__ */ h(ye, {})
|
|
2198
2395
|
})
|
|
2199
2396
|
]
|
|
2200
2397
|
}, e.key);
|
|
@@ -2219,7 +2416,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2219
2416
|
}))]
|
|
2220
2417
|
})
|
|
2221
2418
|
});
|
|
2222
|
-
},
|
|
2419
|
+
}, xe = () => /* @__PURE__ */ h("svg", {
|
|
2223
2420
|
width: "14",
|
|
2224
2421
|
height: "14",
|
|
2225
2422
|
viewBox: "0 0 16 16",
|
|
@@ -2231,7 +2428,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2231
2428
|
strokeWidth: "1.8",
|
|
2232
2429
|
strokeLinecap: "round"
|
|
2233
2430
|
})
|
|
2234
|
-
}),
|
|
2431
|
+
}), $ = ({ open: e, title: t, subtitle: n, onClose: r, showCloseButton: i, showGrabber: a = !0, footer: o, maxHeight: s = "85%", children: u }) => {
|
|
2235
2432
|
let d = l();
|
|
2236
2433
|
if (c(() => {
|
|
2237
2434
|
if (!e) return;
|
|
@@ -2274,7 +2471,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2274
2471
|
className: "tp-bottomsheet-close",
|
|
2275
2472
|
"aria-label": "Close",
|
|
2276
2473
|
onClick: r,
|
|
2277
|
-
children: /* @__PURE__ */ h(
|
|
2474
|
+
children: /* @__PURE__ */ h(xe, {})
|
|
2278
2475
|
})]
|
|
2279
2476
|
}),
|
|
2280
2477
|
/* @__PURE__ */ h("div", {
|
|
@@ -2288,7 +2485,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2288
2485
|
]
|
|
2289
2486
|
})
|
|
2290
2487
|
});
|
|
2291
|
-
},
|
|
2488
|
+
}, Se = () => /* @__PURE__ */ h("svg", {
|
|
2292
2489
|
width: "14",
|
|
2293
2490
|
height: "14",
|
|
2294
2491
|
viewBox: "0 0 16 16",
|
|
@@ -2300,7 +2497,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2300
2497
|
strokeWidth: "1.8",
|
|
2301
2498
|
strokeLinecap: "round"
|
|
2302
2499
|
})
|
|
2303
|
-
}),
|
|
2500
|
+
}), Ce = ({ open: e, placement: t = "center", title: n, closable: r = !0, maskClosable: i = !0, onClose: a, footer: o, className: s = "", style: u, children: d }) => {
|
|
2304
2501
|
let f = l();
|
|
2305
2502
|
if (c(() => {
|
|
2306
2503
|
if (!e) return;
|
|
@@ -2340,7 +2537,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2340
2537
|
className: "tp-popup-close",
|
|
2341
2538
|
"aria-label": "Close",
|
|
2342
2539
|
onClick: a,
|
|
2343
|
-
children: /* @__PURE__ */ h(
|
|
2540
|
+
children: /* @__PURE__ */ h(Se, {})
|
|
2344
2541
|
})]
|
|
2345
2542
|
}),
|
|
2346
2543
|
/* @__PURE__ */ h("div", {
|
|
@@ -2354,7 +2551,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2354
2551
|
]
|
|
2355
2552
|
})
|
|
2356
2553
|
});
|
|
2357
|
-
},
|
|
2554
|
+
}, we = () => /* @__PURE__ */ h("svg", {
|
|
2358
2555
|
width: "16",
|
|
2359
2556
|
height: "16",
|
|
2360
2557
|
viewBox: "0 0 24 24",
|
|
@@ -2367,7 +2564,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2367
2564
|
strokeLinecap: "round",
|
|
2368
2565
|
strokeLinejoin: "round"
|
|
2369
2566
|
})
|
|
2370
|
-
}),
|
|
2567
|
+
}), Te = ({ open: e, items: t, onSelect: n, onClose: r, align: a = "left", className: o = "", style: s }) => {
|
|
2371
2568
|
let l = f(null);
|
|
2372
2569
|
if (c(() => {
|
|
2373
2570
|
if (!e) return;
|
|
@@ -2428,13 +2625,13 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2428
2625
|
e.selected && /* @__PURE__ */ h("span", {
|
|
2429
2626
|
className: "tp-menu-item-check",
|
|
2430
2627
|
"aria-label": "selected",
|
|
2431
|
-
children: /* @__PURE__ */ h(
|
|
2628
|
+
children: /* @__PURE__ */ h(we, {})
|
|
2432
2629
|
})
|
|
2433
2630
|
]
|
|
2434
2631
|
})] }, e.key);
|
|
2435
2632
|
})
|
|
2436
2633
|
});
|
|
2437
|
-
},
|
|
2634
|
+
}, Ee = ({ type: e }) => {
|
|
2438
2635
|
switch (e) {
|
|
2439
2636
|
case "info": return /* @__PURE__ */ g("svg", {
|
|
2440
2637
|
width: "18",
|
|
@@ -2562,7 +2759,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2562
2759
|
});
|
|
2563
2760
|
default: return null;
|
|
2564
2761
|
}
|
|
2565
|
-
},
|
|
2762
|
+
}, De = ({ open: e = !0, type: t = "default", message: n, duration: r, position: i = "center", onClose: a, className: o = "", style: s }) => {
|
|
2566
2763
|
let l = r ?? (t === "loading" ? 0 : 2500);
|
|
2567
2764
|
if (c(() => {
|
|
2568
2765
|
if (!e || !a || l <= 0) return;
|
|
@@ -2575,7 +2772,7 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2575
2772
|
l,
|
|
2576
2773
|
a
|
|
2577
2774
|
]), !e) return null;
|
|
2578
|
-
let u = /* @__PURE__ */ h(
|
|
2775
|
+
let u = /* @__PURE__ */ h(Ee, { type: t });
|
|
2579
2776
|
return /* @__PURE__ */ h("div", {
|
|
2580
2777
|
className: `tp-toast-container tp-toast-container--${i}`,
|
|
2581
2778
|
children: /* @__PURE__ */ g("div", {
|
|
@@ -2593,10 +2790,10 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2593
2790
|
})]
|
|
2594
2791
|
})
|
|
2595
2792
|
});
|
|
2596
|
-
},
|
|
2793
|
+
}, Oe = a({
|
|
2597
2794
|
show: () => {},
|
|
2598
2795
|
dismiss: () => {}
|
|
2599
|
-
}),
|
|
2796
|
+
}), ke = ({ children: e }) => {
|
|
2600
2797
|
let [t, n] = p(null), r = f(null), i = o(() => {
|
|
2601
2798
|
r.current !== null && (clearTimeout(r.current), r.current = null);
|
|
2602
2799
|
}, []), a = o(() => {
|
|
@@ -2623,9 +2820,9 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2623
2820
|
show: s,
|
|
2624
2821
|
dismiss: a
|
|
2625
2822
|
}), [s, a]);
|
|
2626
|
-
return /* @__PURE__ */ g(
|
|
2823
|
+
return /* @__PURE__ */ g(Oe.Provider, {
|
|
2627
2824
|
value: l,
|
|
2628
|
-
children: [e, t && /* @__PURE__ */ h(
|
|
2825
|
+
children: [e, t && /* @__PURE__ */ h(De, {
|
|
2629
2826
|
open: t.open,
|
|
2630
2827
|
type: t.type,
|
|
2631
2828
|
message: t.message,
|
|
@@ -2636,11 +2833,11 @@ var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, classNa
|
|
|
2636
2833
|
})]
|
|
2637
2834
|
});
|
|
2638
2835
|
};
|
|
2639
|
-
function
|
|
2640
|
-
return s(
|
|
2836
|
+
function Ae() {
|
|
2837
|
+
return s(Oe);
|
|
2641
2838
|
}
|
|
2642
2839
|
// src/core/components/TPLiquidGlass.tsx
|
|
2643
|
-
var
|
|
2840
|
+
var je = ({ shape: e = "pill", tint: t = "clear", interactive: n = !1, refraction: r = 1, dispersion: a = 1, blur: o = 2, optical: s = !0, as: c = "div", ariaLabel: l, disabled: u = !1, onClick: d, className: p = "", style: m, children: g }) => {
|
|
2644
2841
|
let _ = f(null), v = [
|
|
2645
2842
|
"tp-liquid-glass",
|
|
2646
2843
|
`tp-liquid-glass--${e}`,
|
|
@@ -2672,8 +2869,8 @@ var ke = ({ shape: e = "pill", tint: t = "clear", interactive: n = !1, refractio
|
|
|
2672
2869
|
className: "tp-liquid-glass-content",
|
|
2673
2870
|
children: g
|
|
2674
2871
|
}));
|
|
2675
|
-
},
|
|
2676
|
-
function
|
|
2872
|
+
}, Me = i.createContext(!1);
|
|
2873
|
+
function Ne(e) {
|
|
2677
2874
|
return e == null || e === !1 || e === "" || e === 0 ? null : e === !0 ? /* @__PURE__ */ h("span", {
|
|
2678
2875
|
className: "tp-icon-btn-badge tp-icon-btn-badge--dot",
|
|
2679
2876
|
"aria-hidden": "true"
|
|
@@ -2682,13 +2879,13 @@ function je(e) {
|
|
|
2682
2879
|
children: typeof e == "number" && e > 99 ? "99+" : String(e)
|
|
2683
2880
|
});
|
|
2684
2881
|
}
|
|
2685
|
-
var
|
|
2686
|
-
let p = f(null), m = s(
|
|
2882
|
+
var Pe = ({ icon: e, variant: r = "glass", size: i = "md", badge: a, disabled: o = !1, ariaLabel: c, onClick: l, className: u = "", style: d }) => {
|
|
2883
|
+
let p = f(null), m = s(Me), _ = i === "sm" ? 16 : i === "lg" ? 22 : 19, v = typeof e == "string" && t(e) ? /* @__PURE__ */ h(n, {
|
|
2687
2884
|
name: e,
|
|
2688
2885
|
size: _
|
|
2689
2886
|
}) : e, y = [
|
|
2690
2887
|
"tp-icon-btn",
|
|
2691
|
-
`tp-icon-btn--${
|
|
2888
|
+
`tp-icon-btn--${r}`,
|
|
2692
2889
|
`tp-icon-btn--${i}`,
|
|
2693
2890
|
o ? "tp-icon-btn--disabled" : "",
|
|
2694
2891
|
u
|
|
@@ -2697,14 +2894,14 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2697
2894
|
ref: p,
|
|
2698
2895
|
type: "button",
|
|
2699
2896
|
className: y,
|
|
2700
|
-
"data-variant":
|
|
2897
|
+
"data-variant": r,
|
|
2701
2898
|
"data-size": i,
|
|
2702
2899
|
"aria-label": c,
|
|
2703
2900
|
disabled: o,
|
|
2704
2901
|
onClick: l,
|
|
2705
2902
|
style: d,
|
|
2706
2903
|
children: [
|
|
2707
|
-
|
|
2904
|
+
r === "glass" && !m && /* @__PURE__ */ h(k, {
|
|
2708
2905
|
hostRef: p,
|
|
2709
2906
|
shape: "circle",
|
|
2710
2907
|
tint: "clear",
|
|
@@ -2717,12 +2914,12 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2717
2914
|
className: "tp-icon-btn-glyph",
|
|
2718
2915
|
children: v
|
|
2719
2916
|
}),
|
|
2720
|
-
|
|
2917
|
+
Ne(a)
|
|
2721
2918
|
]
|
|
2722
2919
|
});
|
|
2723
|
-
},
|
|
2920
|
+
}, Fe = ({ variant: e = "glass", children: t, className: n = "", style: r }) => {
|
|
2724
2921
|
let i = f(null);
|
|
2725
|
-
return /* @__PURE__ */ h(
|
|
2922
|
+
return /* @__PURE__ */ h(Me.Provider, {
|
|
2726
2923
|
value: !0,
|
|
2727
2924
|
children: /* @__PURE__ */ g("div", {
|
|
2728
2925
|
ref: i,
|
|
@@ -2741,7 +2938,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2741
2938
|
}), t]
|
|
2742
2939
|
})
|
|
2743
2940
|
});
|
|
2744
|
-
},
|
|
2941
|
+
}, Ie = ({ checked: e, defaultChecked: t = !1, indeterminate: n = !1, disabled: r = !1, label: i, description: a, onChange: o, ariaLabel: s, className: c = "", style: u }) => {
|
|
2745
2942
|
let d = l(), f = e !== void 0, [m, _] = p(t), v = f ? e : m, y = () => {
|
|
2746
2943
|
if (r) return;
|
|
2747
2944
|
let e = !v;
|
|
@@ -2808,7 +3005,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2808
3005
|
})
|
|
2809
3006
|
]
|
|
2810
3007
|
});
|
|
2811
|
-
},
|
|
3008
|
+
}, Le = ({ options: e, value: t, defaultValue: n = [], onChange: r, direction: i = "vertical", disabled: a = !1, className: o = "", style: s }) => {
|
|
2812
3009
|
let c = t !== void 0, [l, u] = p([...n]), d = c ? t : l, f = (e, t) => {
|
|
2813
3010
|
let n = t ? d.includes(e) ? [...d] : [...d, e] : d.filter((t) => t !== e);
|
|
2814
3011
|
c || u(n), r?.(n);
|
|
@@ -2817,7 +3014,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2817
3014
|
role: "group",
|
|
2818
3015
|
className: `tp-choice-group tp-choice-group--${i} ${o}`.trim(),
|
|
2819
3016
|
style: s,
|
|
2820
|
-
children: e.map((e) => /* @__PURE__ */ h(
|
|
3017
|
+
children: e.map((e) => /* @__PURE__ */ h(Ie, {
|
|
2821
3018
|
label: e.label,
|
|
2822
3019
|
description: e.description,
|
|
2823
3020
|
disabled: a || e.disabled,
|
|
@@ -2825,7 +3022,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2825
3022
|
onChange: (t) => f(e.value, t)
|
|
2826
3023
|
}, e.value))
|
|
2827
3024
|
});
|
|
2828
|
-
},
|
|
3025
|
+
}, Re = ({ checked: e, defaultChecked: t = !1, disabled: n = !1, label: r, description: i, value: a, name: o, onChange: s, ariaLabel: c, className: u = "", style: d }) => {
|
|
2829
3026
|
let f = l(), m = e !== void 0, [_, v] = p(t), y = m ? e : _, b = () => {
|
|
2830
3027
|
n || (m || v(!0), s?.(!0));
|
|
2831
3028
|
}, x = [
|
|
@@ -2867,7 +3064,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2867
3064
|
})
|
|
2868
3065
|
]
|
|
2869
3066
|
});
|
|
2870
|
-
},
|
|
3067
|
+
}, ze = ({ options: e, value: t, defaultValue: n, onChange: r, direction: i = "vertical", disabled: a = !1, name: o, className: s = "", style: c }) => {
|
|
2871
3068
|
let u = l(), d = o ?? `tp-radio-group-${u}`, f = t !== void 0, [m, g] = p(n ?? e[0]?.value ?? ""), _ = f ? t : m, v = (e) => {
|
|
2872
3069
|
f || g(e), r?.(e);
|
|
2873
3070
|
};
|
|
@@ -2875,7 +3072,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2875
3072
|
role: "radiogroup",
|
|
2876
3073
|
className: `tp-choice-group tp-choice-group--${i} ${s}`.trim(),
|
|
2877
3074
|
style: c,
|
|
2878
|
-
children: e.map((e) => /* @__PURE__ */ h(
|
|
3075
|
+
children: e.map((e) => /* @__PURE__ */ h(Re, {
|
|
2879
3076
|
name: d,
|
|
2880
3077
|
value: e.value,
|
|
2881
3078
|
label: e.label,
|
|
@@ -2885,7 +3082,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2885
3082
|
onChange: () => v(e.value)
|
|
2886
3083
|
}, e.value))
|
|
2887
3084
|
});
|
|
2888
|
-
},
|
|
3085
|
+
}, Be = ({ actions: e, open: t, defaultOpen: n = !1, onOpenChange: r, disabled: i = !1, children: a, className: o = "", style: s }) => {
|
|
2889
3086
|
let c = t !== void 0, [l, u] = p(n), d = c ? t : l, m = Math.max(72, e.length * 76), [_, v] = p(null), y = f(null), b = (e) => {
|
|
2890
3087
|
c || u(e), r?.(e);
|
|
2891
3088
|
}, x = _ === null ? d ? -m : 0 : _;
|
|
@@ -2932,7 +3129,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2932
3129
|
children: a
|
|
2933
3130
|
})]
|
|
2934
3131
|
});
|
|
2935
|
-
},
|
|
3132
|
+
}, Ve = ({ content: e, arrowPosition: t = "bottom-left", contextAdaptive: n = !0, open: r, defaultOpen: i = !0, onOpenChange: a, children: o, className: s = "", style: c }) => {
|
|
2936
3133
|
let l = r !== void 0, [u, d] = p(i), f = l ? r : u, m = () => {
|
|
2937
3134
|
let e = !f;
|
|
2938
3135
|
l || d(e), a?.(e);
|
|
@@ -2965,7 +3162,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
2965
3162
|
})]
|
|
2966
3163
|
})]
|
|
2967
3164
|
});
|
|
2968
|
-
},
|
|
3165
|
+
}, He = ({ status: e }) => {
|
|
2969
3166
|
switch (e) {
|
|
2970
3167
|
case "success": return /* @__PURE__ */ g("svg", {
|
|
2971
3168
|
width: "18",
|
|
@@ -3071,68 +3268,71 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
3071
3268
|
]
|
|
3072
3269
|
});
|
|
3073
3270
|
}
|
|
3074
|
-
},
|
|
3075
|
-
|
|
3076
|
-
"
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3271
|
+
}, Ue = ({ status: e = "default", tone: t, action: n = "none", actionLabel: r = "Details", onAction: i, onClose: a, message: o, className: s = "", style: c }) => {
|
|
3272
|
+
let l = t ?? e;
|
|
3273
|
+
return /* @__PURE__ */ g("div", {
|
|
3274
|
+
role: l === "danger" ? "alert" : "status",
|
|
3275
|
+
"data-status": l,
|
|
3276
|
+
"data-action": n,
|
|
3277
|
+
className: `tp-fixed-toast tp-fixed-toast--${l} ${s}`.trim(),
|
|
3278
|
+
style: c,
|
|
3279
|
+
children: [
|
|
3280
|
+
/* @__PURE__ */ h("span", {
|
|
3281
|
+
className: "tp-fixed-toast-icon",
|
|
3282
|
+
children: /* @__PURE__ */ h(He, { status: l })
|
|
3283
|
+
}),
|
|
3284
|
+
/* @__PURE__ */ h("div", {
|
|
3285
|
+
className: "tp-fixed-toast-message",
|
|
3286
|
+
children: o
|
|
3287
|
+
}),
|
|
3288
|
+
n === "button" && /* @__PURE__ */ h("button", {
|
|
3289
|
+
type: "button",
|
|
3290
|
+
className: "tp-fixed-toast-btn",
|
|
3291
|
+
onClick: i,
|
|
3292
|
+
children: r
|
|
3293
|
+
}),
|
|
3294
|
+
n === "go-to" && /* @__PURE__ */ h("button", {
|
|
3295
|
+
type: "button",
|
|
3296
|
+
className: "tp-fixed-toast-icon-action",
|
|
3297
|
+
"aria-label": r || "Go to",
|
|
3298
|
+
onClick: i,
|
|
3299
|
+
children: /* @__PURE__ */ h("svg", {
|
|
3300
|
+
width: "15",
|
|
3301
|
+
height: "15",
|
|
3302
|
+
viewBox: "0 0 16 16",
|
|
3303
|
+
fill: "none",
|
|
3304
|
+
"aria-hidden": "true",
|
|
3305
|
+
children: /* @__PURE__ */ h("path", {
|
|
3306
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
3307
|
+
stroke: "currentColor",
|
|
3308
|
+
strokeWidth: "1.8",
|
|
3309
|
+
strokeLinecap: "round",
|
|
3310
|
+
strokeLinejoin: "round"
|
|
3311
|
+
})
|
|
3112
3312
|
})
|
|
3113
|
-
})
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3313
|
+
}),
|
|
3314
|
+
n === "close" && /* @__PURE__ */ h("button", {
|
|
3315
|
+
type: "button",
|
|
3316
|
+
className: "tp-fixed-toast-icon-action",
|
|
3317
|
+
"aria-label": "Close",
|
|
3318
|
+
onClick: a,
|
|
3319
|
+
children: /* @__PURE__ */ h("svg", {
|
|
3320
|
+
width: "14",
|
|
3321
|
+
height: "14",
|
|
3322
|
+
viewBox: "0 0 16 16",
|
|
3323
|
+
fill: "none",
|
|
3324
|
+
"aria-hidden": "true",
|
|
3325
|
+
children: /* @__PURE__ */ h("path", {
|
|
3326
|
+
d: "M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",
|
|
3327
|
+
stroke: "currentColor",
|
|
3328
|
+
strokeWidth: "1.7",
|
|
3329
|
+
strokeLinecap: "round"
|
|
3330
|
+
})
|
|
3131
3331
|
})
|
|
3132
3332
|
})
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
}
|
|
3333
|
+
]
|
|
3334
|
+
});
|
|
3335
|
+
}, We = [
|
|
3136
3336
|
"Jan",
|
|
3137
3337
|
"Feb",
|
|
3138
3338
|
"Mar",
|
|
@@ -3145,7 +3345,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
3145
3345
|
"Oct",
|
|
3146
3346
|
"Nov",
|
|
3147
3347
|
"Dec"
|
|
3148
|
-
],
|
|
3348
|
+
], Ge = [
|
|
3149
3349
|
"1月",
|
|
3150
3350
|
"2月",
|
|
3151
3351
|
"3月",
|
|
@@ -3158,11 +3358,11 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
3158
3358
|
"10月",
|
|
3159
3359
|
"11月",
|
|
3160
3360
|
"12月"
|
|
3161
|
-
],
|
|
3361
|
+
], Ke = ({ value: e, defaultValue: t = {
|
|
3162
3362
|
year: 2026,
|
|
3163
3363
|
month: 11
|
|
3164
3364
|
}, minYear: n = 2020, maxYear: r = 2032, locale: i = "en", onChange: a, className: o = "", style: s }) => {
|
|
3165
|
-
let c = e !== void 0, [l, u] = p(t), d = c ? e : l, [f, m] = p(d.year), _ = i === "zh" ?
|
|
3365
|
+
let c = e !== void 0, [l, u] = p(t), d = c ? e : l, [f, m] = p(d.year), _ = i === "zh" ? Ge : We, v = (e) => {
|
|
3166
3366
|
let t = {
|
|
3167
3367
|
year: f,
|
|
3168
3368
|
month: e
|
|
@@ -3239,7 +3439,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
3239
3439
|
})
|
|
3240
3440
|
})]
|
|
3241
3441
|
});
|
|
3242
|
-
},
|
|
3442
|
+
}, qe = [
|
|
3243
3443
|
"Sun",
|
|
3244
3444
|
"Mon",
|
|
3245
3445
|
"Tue",
|
|
@@ -3247,7 +3447,7 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
3247
3447
|
"Thu",
|
|
3248
3448
|
"Fri",
|
|
3249
3449
|
"Sat"
|
|
3250
|
-
],
|
|
3450
|
+
], Je = [
|
|
3251
3451
|
"日",
|
|
3252
3452
|
"一",
|
|
3253
3453
|
"二",
|
|
@@ -3256,19 +3456,19 @@ var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o
|
|
|
3256
3456
|
"五",
|
|
3257
3457
|
"六"
|
|
3258
3458
|
];
|
|
3259
|
-
function
|
|
3459
|
+
function Ye(e) {
|
|
3260
3460
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
3261
3461
|
}
|
|
3262
|
-
var
|
|
3462
|
+
var Xe = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], locale: i = "en", onChange: a, className: o = "", style: s }) => {
|
|
3263
3463
|
let c = d(() => n ?? t ?? e ?? new Date(2026, 10, 23), [
|
|
3264
3464
|
n,
|
|
3265
3465
|
t,
|
|
3266
3466
|
e
|
|
3267
|
-
]), l = e !== void 0, [u, f] = p(() => t ?? c), m =
|
|
3467
|
+
]), l = e !== void 0, [u, f] = p(() => t ?? c), m = Ye(l ? e : u), _ = d(() => {
|
|
3268
3468
|
let e = [];
|
|
3269
3469
|
for (let t = 6; t >= 0; t--) e.push(new Date(c.getFullYear(), c.getMonth(), c.getDate() - t));
|
|
3270
3470
|
return e;
|
|
3271
|
-
}, [c]), v = i === "zh" ?
|
|
3471
|
+
}, [c]), v = i === "zh" ? Je : qe, y = d(() => new Set(r), [r]), b = (e) => {
|
|
3272
3472
|
l || f(e), a?.(e);
|
|
3273
3473
|
};
|
|
3274
3474
|
return /* @__PURE__ */ h("div", {
|
|
@@ -3277,7 +3477,7 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3277
3477
|
"aria-label": "Last 7 Days",
|
|
3278
3478
|
style: s,
|
|
3279
3479
|
children: _.map((e) => {
|
|
3280
|
-
let t =
|
|
3480
|
+
let t = Ye(e), n = t === m, r = y.has(t);
|
|
3281
3481
|
return /* @__PURE__ */ g("button", {
|
|
3282
3482
|
type: "button",
|
|
3283
3483
|
role: "option",
|
|
@@ -3302,7 +3502,7 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3302
3502
|
}, t);
|
|
3303
3503
|
})
|
|
3304
3504
|
});
|
|
3305
|
-
},
|
|
3505
|
+
}, Ze = ({ variant: e = "step", items: t, className: n = "", style: r }) => /* @__PURE__ */ h("ol", {
|
|
3306
3506
|
className: `tp-step-text tp-step-text--${e} ${n}`.trim(),
|
|
3307
3507
|
"data-variant": e,
|
|
3308
3508
|
style: r,
|
|
@@ -3330,7 +3530,7 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3330
3530
|
]
|
|
3331
3531
|
})]
|
|
3332
3532
|
}, t.key ?? n))
|
|
3333
|
-
}),
|
|
3533
|
+
}), Qe = ({ variant: e = "linear", percent: t, tone: n = "focus", size: r = 64, strokeWidth: i = 6, showValue: a = !0, label: o, className: s = "", style: c }) => {
|
|
3334
3534
|
let l = Math.max(0, Math.min(100, Math.round(t)));
|
|
3335
3535
|
if (e === "circular") {
|
|
3336
3536
|
let e = Math.max(8, (r - i) / 2), t = 2 * Math.PI * e, u = t * (1 - l / 100);
|
|
@@ -3405,22 +3605,23 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3405
3605
|
})
|
|
3406
3606
|
})]
|
|
3407
3607
|
});
|
|
3408
|
-
},
|
|
3409
|
-
let s = i ? "tp-skeleton
|
|
3608
|
+
}, $e = ({ variant: e = "text", width: t, height: n, lines: r = 3, animated: i = !0, className: a = "", style: o }) => {
|
|
3609
|
+
let s = i ? "tp-skeleton--animated" : "";
|
|
3410
3610
|
if (e === "card") return /* @__PURE__ */ g("div", {
|
|
3411
|
-
className: `tp-skeleton-card ${a}`.trim(),
|
|
3611
|
+
className: `tp-skeleton-card ${s} ${a}`.trim(),
|
|
3412
3612
|
"aria-busy": "true",
|
|
3613
|
+
"data-animated": String(i),
|
|
3413
3614
|
style: o,
|
|
3414
3615
|
children: [
|
|
3415
3616
|
/* @__PURE__ */ h("div", {
|
|
3416
|
-
className:
|
|
3617
|
+
className: "tp-skeleton-item",
|
|
3417
3618
|
style: {
|
|
3418
3619
|
width: "48%",
|
|
3419
3620
|
height: 18
|
|
3420
3621
|
}
|
|
3421
3622
|
}),
|
|
3422
3623
|
/* @__PURE__ */ h("div", {
|
|
3423
|
-
className:
|
|
3624
|
+
className: "tp-skeleton-item",
|
|
3424
3625
|
style: {
|
|
3425
3626
|
width: "100%",
|
|
3426
3627
|
height: 64,
|
|
@@ -3428,7 +3629,7 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3428
3629
|
}
|
|
3429
3630
|
}),
|
|
3430
3631
|
/* @__PURE__ */ h("div", {
|
|
3431
|
-
className:
|
|
3632
|
+
className: "tp-skeleton-item",
|
|
3432
3633
|
style: {
|
|
3433
3634
|
width: "76%",
|
|
3434
3635
|
height: 12
|
|
@@ -3440,7 +3641,8 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3440
3641
|
let e = t ?? n ?? 40;
|
|
3441
3642
|
return /* @__PURE__ */ h("span", {
|
|
3442
3643
|
"aria-busy": "true",
|
|
3443
|
-
|
|
3644
|
+
"data-animated": String(i),
|
|
3645
|
+
className: `tp-skeleton-item tp-skeleton-item--circle ${s} ${i ? "tp-skeleton-item--animated" : ""} ${a}`.trim(),
|
|
3444
3646
|
style: {
|
|
3445
3647
|
width: e,
|
|
3446
3648
|
height: e,
|
|
@@ -3450,25 +3652,27 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3450
3652
|
}
|
|
3451
3653
|
return e === "rect" ? /* @__PURE__ */ h("div", {
|
|
3452
3654
|
"aria-busy": "true",
|
|
3453
|
-
|
|
3655
|
+
"data-animated": String(i),
|
|
3656
|
+
className: `tp-skeleton-item ${s} ${i ? "tp-skeleton-item--animated" : ""} ${a}`.trim(),
|
|
3454
3657
|
style: {
|
|
3455
3658
|
width: t ?? "100%",
|
|
3456
3659
|
height: n ?? 80,
|
|
3457
3660
|
...o
|
|
3458
3661
|
}
|
|
3459
3662
|
}) : /* @__PURE__ */ h("div", {
|
|
3460
|
-
className: `tp-skeleton-text-group ${a}`.trim(),
|
|
3663
|
+
className: `tp-skeleton-text-group ${s} ${a}`.trim(),
|
|
3461
3664
|
"aria-busy": "true",
|
|
3665
|
+
"data-animated": String(i),
|
|
3462
3666
|
style: o,
|
|
3463
3667
|
children: Array.from({ length: Math.max(1, r) }).map((e, i) => /* @__PURE__ */ h("div", {
|
|
3464
|
-
className:
|
|
3668
|
+
className: "tp-skeleton-item",
|
|
3465
3669
|
style: {
|
|
3466
3670
|
width: i === r - 1 && r > 1 ? "68%" : t ?? "100%",
|
|
3467
3671
|
height: n ?? 13
|
|
3468
3672
|
}
|
|
3469
3673
|
}, i))
|
|
3470
3674
|
});
|
|
3471
|
-
},
|
|
3675
|
+
}, et = ({ steps: e, current: t, direction: n = "horizontal", className: r = "", style: i }) => /* @__PURE__ */ h("ol", {
|
|
3472
3676
|
className: `tp-stepper tp-stepper--${n} ${r}`.trim(),
|
|
3473
3677
|
"data-direction": n,
|
|
3474
3678
|
style: i,
|
|
@@ -3511,7 +3715,7 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3511
3715
|
})]
|
|
3512
3716
|
}, n.key);
|
|
3513
3717
|
})
|
|
3514
|
-
}),
|
|
3718
|
+
}), tt = ({ inset: e = !1, label: t, spacing: n = "md", className: r = "", style: i }) => /* @__PURE__ */ g("div", {
|
|
3515
3719
|
role: "separator",
|
|
3516
3720
|
className: `tp-divider tp-divider--space-${n} ${e ? "tp-divider--inset" : ""} ${t === void 0 ? "" : "tp-divider--with-label"} ${r}`.trim(),
|
|
3517
3721
|
style: i,
|
|
@@ -3525,32 +3729,32 @@ var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], lo
|
|
|
3525
3729
|
]
|
|
3526
3730
|
});
|
|
3527
3731
|
// src/core/components/TPAvatar.tsx
|
|
3528
|
-
function
|
|
3732
|
+
function nt(e) {
|
|
3529
3733
|
if (!e) return "";
|
|
3530
3734
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
3531
3735
|
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : `${t[0][0]}${t[1][0]}`.toUpperCase();
|
|
3532
3736
|
}
|
|
3533
|
-
var
|
|
3534
|
-
let d = a === "sm" ? 16 : a === "lg" ? 24 : 20, f =
|
|
3737
|
+
var rt = ({ src: e, name: r, icon: i, size: a = "md", status: o = "none", shape: s = "circle", alt: c, className: l = "", style: u }) => {
|
|
3738
|
+
let d = a === "sm" ? 16 : a === "lg" ? 24 : 20, f = nt(r) || "?";
|
|
3535
3739
|
return e ? f = /* @__PURE__ */ h("img", {
|
|
3536
3740
|
src: e,
|
|
3537
|
-
alt: c ??
|
|
3741
|
+
alt: c ?? r ?? "Avatar",
|
|
3538
3742
|
className: "tp-avatar-img"
|
|
3539
|
-
}) : i !== void 0 && (f = typeof i == "string" &&
|
|
3743
|
+
}) : i !== void 0 && (f = typeof i == "string" && t(i) ? /* @__PURE__ */ h(n, {
|
|
3540
3744
|
name: i,
|
|
3541
3745
|
size: d
|
|
3542
3746
|
}) : i), /* @__PURE__ */ g("span", {
|
|
3543
3747
|
className: `tp-avatar tp-avatar--${a} tp-avatar--${s} ${l}`.trim(),
|
|
3544
3748
|
"data-size": a,
|
|
3545
3749
|
"data-shape": s,
|
|
3546
|
-
"aria-label": e ? void 0 : c ??
|
|
3750
|
+
"aria-label": e ? void 0 : c ?? r,
|
|
3547
3751
|
style: u,
|
|
3548
3752
|
children: [f, o !== "none" && /* @__PURE__ */ h("span", {
|
|
3549
3753
|
className: `tp-avatar-status tp-avatar-status--${o}`,
|
|
3550
3754
|
"aria-label": `Status: ${o}`
|
|
3551
3755
|
})]
|
|
3552
3756
|
});
|
|
3553
|
-
},
|
|
3757
|
+
}, it = ({ 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 }) => {
|
|
3554
3758
|
let d = Math.max(2, Math.min(8, e)), m = t !== void 0, [_, v] = p(n.slice(0, d)), y = (m ? t : _).slice(0, d), b = f([]), x = Array.from({ length: d }, (e, t) => y[t] ?? ""), S = (e) => {
|
|
3555
3759
|
let t = e.slice(0, d);
|
|
3556
3760
|
m || v(t), o?.(t), t.length === d && s?.(t);
|
|
@@ -3598,7 +3802,7 @@ var tt = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape:
|
|
|
3598
3802
|
children: i
|
|
3599
3803
|
})]
|
|
3600
3804
|
});
|
|
3601
|
-
},
|
|
3805
|
+
}, at = ({ tone: e }) => {
|
|
3602
3806
|
switch (e) {
|
|
3603
3807
|
case "warning": return /* @__PURE__ */ g("svg", {
|
|
3604
3808
|
width: "20",
|
|
@@ -3699,7 +3903,7 @@ var tt = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape:
|
|
|
3699
3903
|
]
|
|
3700
3904
|
});
|
|
3701
3905
|
}
|
|
3702
|
-
},
|
|
3906
|
+
}, ot = () => /* @__PURE__ */ h("svg", {
|
|
3703
3907
|
width: "14",
|
|
3704
3908
|
height: "14",
|
|
3705
3909
|
viewBox: "0 0 16 16",
|
|
@@ -3711,7 +3915,7 @@ var tt = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape:
|
|
|
3711
3915
|
strokeWidth: "1.6",
|
|
3712
3916
|
strokeLinecap: "round"
|
|
3713
3917
|
})
|
|
3714
|
-
}),
|
|
3918
|
+
}), st = ({ tone: e = "info", title: t, actionLabel: n, onAction: r, closable: i, onClose: a, icon: o, className: s = "", style: c }) => {
|
|
3715
3919
|
let l = i ?? !!a;
|
|
3716
3920
|
return /* @__PURE__ */ g("div", {
|
|
3717
3921
|
role: "region",
|
|
@@ -3721,7 +3925,7 @@ var tt = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape:
|
|
|
3721
3925
|
children: [
|
|
3722
3926
|
/* @__PURE__ */ h("span", {
|
|
3723
3927
|
className: "tp-prompt-icon",
|
|
3724
|
-
children: o === void 0 ? /* @__PURE__ */ h(
|
|
3928
|
+
children: o === void 0 ? /* @__PURE__ */ h(at, { tone: e }) : o
|
|
3725
3929
|
}),
|
|
3726
3930
|
/* @__PURE__ */ g("div", {
|
|
3727
3931
|
className: "tp-prompt-content",
|
|
@@ -3740,9 +3944,128 @@ var tt = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape:
|
|
|
3740
3944
|
className: "tp-prompt-close",
|
|
3741
3945
|
"aria-label": "Dismiss",
|
|
3742
3946
|
onClick: a,
|
|
3743
|
-
children: /* @__PURE__ */ h(
|
|
3947
|
+
children: /* @__PURE__ */ h(ot, {})
|
|
3744
3948
|
})
|
|
3745
3949
|
]
|
|
3746
3950
|
});
|
|
3747
|
-
}
|
|
3748
|
-
|
|
3951
|
+
}, ct = ({ status: e = "idle", idleText: t = "Load more", loadingText: n = "Loading...", noMoreText: r = "No more data", errorText: i = "Failed to load. Tap to retry", onLoadMore: a, onRetry: o, className: s = "", style: c }) => {
|
|
3952
|
+
let l = [
|
|
3953
|
+
"tp-load-more",
|
|
3954
|
+
`tp-load-more--${e}`,
|
|
3955
|
+
s
|
|
3956
|
+
].filter(Boolean).join(" ");
|
|
3957
|
+
return /* @__PURE__ */ g("div", {
|
|
3958
|
+
className: l,
|
|
3959
|
+
"data-status": e,
|
|
3960
|
+
style: c,
|
|
3961
|
+
children: [
|
|
3962
|
+
e === "loading" && /* @__PURE__ */ g("span", {
|
|
3963
|
+
className: "tp-load-more-status",
|
|
3964
|
+
role: "status",
|
|
3965
|
+
children: [/* @__PURE__ */ h("span", {
|
|
3966
|
+
className: "tp-load-more-spinner",
|
|
3967
|
+
"aria-hidden": "true"
|
|
3968
|
+
}), /* @__PURE__ */ h("span", { children: n })]
|
|
3969
|
+
}),
|
|
3970
|
+
e === "idle" && /* @__PURE__ */ h("button", {
|
|
3971
|
+
type: "button",
|
|
3972
|
+
className: "tp-load-more-btn",
|
|
3973
|
+
onClick: a,
|
|
3974
|
+
children: t
|
|
3975
|
+
}),
|
|
3976
|
+
e === "error" && /* @__PURE__ */ h("button", {
|
|
3977
|
+
type: "button",
|
|
3978
|
+
className: "tp-load-more-btn tp-load-more-btn--error",
|
|
3979
|
+
onClick: o ?? a,
|
|
3980
|
+
children: i
|
|
3981
|
+
}),
|
|
3982
|
+
e === "no-more" && /* @__PURE__ */ g("span", {
|
|
3983
|
+
className: "tp-load-more-divider",
|
|
3984
|
+
children: [
|
|
3985
|
+
/* @__PURE__ */ h("span", {
|
|
3986
|
+
className: "tp-load-more-line",
|
|
3987
|
+
"aria-hidden": "true"
|
|
3988
|
+
}),
|
|
3989
|
+
/* @__PURE__ */ h("span", {
|
|
3990
|
+
className: "tp-load-more-end-text",
|
|
3991
|
+
children: r
|
|
3992
|
+
}),
|
|
3993
|
+
/* @__PURE__ */ h("span", {
|
|
3994
|
+
className: "tp-load-more-line",
|
|
3995
|
+
"aria-hidden": "true"
|
|
3996
|
+
})
|
|
3997
|
+
]
|
|
3998
|
+
})
|
|
3999
|
+
]
|
|
4000
|
+
});
|
|
4001
|
+
}, lt = ({ open: e, title: t, subtitle: n, description: r, bullets: i, confirmText: a = "Got it", onConfirm: o, onClose: s, children: c, className: l = "", style: u }) => /* @__PURE__ */ h($, {
|
|
4002
|
+
open: e,
|
|
4003
|
+
title: t,
|
|
4004
|
+
subtitle: n,
|
|
4005
|
+
onClose: s,
|
|
4006
|
+
footer: /* @__PURE__ */ h(L, {
|
|
4007
|
+
variant: "primary",
|
|
4008
|
+
size: "lg",
|
|
4009
|
+
block: !0,
|
|
4010
|
+
onClick: () => {
|
|
4011
|
+
o?.(), s();
|
|
4012
|
+
},
|
|
4013
|
+
children: a
|
|
4014
|
+
}),
|
|
4015
|
+
children: /* @__PURE__ */ g("div", {
|
|
4016
|
+
className: `tp-info-sheet ${l}`.trim(),
|
|
4017
|
+
style: u,
|
|
4018
|
+
children: [
|
|
4019
|
+
r != null && /* @__PURE__ */ h("p", {
|
|
4020
|
+
className: "tp-info-sheet-desc",
|
|
4021
|
+
children: r
|
|
4022
|
+
}),
|
|
4023
|
+
i && i.length > 0 && /* @__PURE__ */ h("ul", {
|
|
4024
|
+
className: "tp-info-sheet-bullets",
|
|
4025
|
+
children: i.map((e, t) => /* @__PURE__ */ g("li", {
|
|
4026
|
+
className: "tp-info-sheet-bullet",
|
|
4027
|
+
children: [/* @__PURE__ */ h("span", {
|
|
4028
|
+
className: "tp-info-sheet-dot",
|
|
4029
|
+
"aria-hidden": "true"
|
|
4030
|
+
}), /* @__PURE__ */ h("span", {
|
|
4031
|
+
className: "tp-info-sheet-bullet-text",
|
|
4032
|
+
children: e
|
|
4033
|
+
})]
|
|
4034
|
+
}, t))
|
|
4035
|
+
}),
|
|
4036
|
+
c
|
|
4037
|
+
]
|
|
4038
|
+
})
|
|
4039
|
+
}), ut = ({ open: e, title: t = "Legend", subtitle: n, items: r, columns: i = 1, onClose: a, footer: o, className: s = "", style: c }) => /* @__PURE__ */ h($, {
|
|
4040
|
+
open: e,
|
|
4041
|
+
title: t,
|
|
4042
|
+
subtitle: n,
|
|
4043
|
+
onClose: a,
|
|
4044
|
+
footer: o,
|
|
4045
|
+
children: /* @__PURE__ */ h("div", {
|
|
4046
|
+
className: `tp-legend-sheet tp-legend-sheet--cols-${i} ${s}`.trim(),
|
|
4047
|
+
"data-columns": i,
|
|
4048
|
+
style: c,
|
|
4049
|
+
children: r.map((e) => /* @__PURE__ */ g("div", {
|
|
4050
|
+
className: "tp-legend-sheet-item",
|
|
4051
|
+
children: [/* @__PURE__ */ h("div", {
|
|
4052
|
+
className: "tp-legend-sheet-marker",
|
|
4053
|
+
"aria-hidden": "true",
|
|
4054
|
+
children: e.icon ? e.icon : e.badge ? e.badge : /* @__PURE__ */ h("span", {
|
|
4055
|
+
className: "tp-legend-sheet-swatch",
|
|
4056
|
+
style: e.color ? { backgroundColor: e.color } : void 0
|
|
4057
|
+
})
|
|
4058
|
+
}), /* @__PURE__ */ g("div", {
|
|
4059
|
+
className: "tp-legend-sheet-content",
|
|
4060
|
+
children: [/* @__PURE__ */ h("div", {
|
|
4061
|
+
className: "tp-legend-sheet-label",
|
|
4062
|
+
children: e.label
|
|
4063
|
+
}), e.description !== void 0 && e.description !== null && /* @__PURE__ */ h("div", {
|
|
4064
|
+
className: "tp-legend-sheet-desc",
|
|
4065
|
+
children: e.description
|
|
4066
|
+
})]
|
|
4067
|
+
})]
|
|
4068
|
+
}, e.key))
|
|
4069
|
+
})
|
|
4070
|
+
});
|
|
4071
|
+
export { F as $, be as A, re as B, je as C, Te as D, Ae as E, ue as F, q as G, te as H, X as I, U as J, K, oe as L, _e as M, me as N, Ce as O, fe as P, I as Q, ae as R, Fe as S, ke as T, Y as U, ne as V, J as W, R as X, z as Y, L as Z, Re as _, it as a, y as at, Le as b, et as c, Ze as d, P as et, Xe as f, Be as g, Ve as h, st as i, x as it, ve as j, $ as k, $e as l, Ue as m, ut as n, T as nt, rt as o, Ke as p, W as q, ct as r, w as rt, tt as s, lt as t, j as tt, Qe as u, ze as v, De as w, Pe as x, Ie as y, ie as z };
|