@chenyqthu/tp-mobile-ui-kit 0.0.0-stage → 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.
Files changed (113) hide show
  1. package/README.md +214 -2
  2. package/dist/assets.js +5 -0
  3. package/dist/catalog.json +12355 -0
  4. package/dist/chunks/OmadaAppDemo-BO8a6A-m.js +4910 -0
  5. package/dist/chunks/TPPrompt-DLd32rsN.js +3456 -0
  6. package/dist/chunks/asset-icons-BIenKvAh.js +7613 -0
  7. package/dist/chunks/asset-illustrations-YHXzEd7z.js +3086 -0
  8. package/dist/chunks/asset-logos-DAyGwOLj.js +59 -0
  9. package/dist/chunks/asset-motion-D7fWh_JS.js +376 -0
  10. package/dist/core.js +3 -0
  11. package/dist/index.js +7 -0
  12. package/dist/libpag.wasm +0 -0
  13. package/dist/omada.js +7 -0
  14. package/dist/standalone.js +3438 -0
  15. package/dist/style.css +2 -0
  16. package/dist/types/assets-lib/TPBrandLogo.d.ts +15 -0
  17. package/dist/types/assets-lib/TPIcon.d.ts +19 -0
  18. package/dist/types/assets-lib/TPIllustration.d.ts +17 -0
  19. package/dist/types/assets-lib/TPMotion.d.ts +25 -0
  20. package/dist/types/assets-lib/assetsManifest.d.ts +22 -0
  21. package/dist/types/assets-lib/iconsManifest.d.ts +14 -0
  22. package/dist/types/assets-lib/index.d.ts +8 -0
  23. package/dist/types/assets-lib/motionsManifest.d.ts +12 -0
  24. package/dist/types/assets-lib/runtimeUrl.d.ts +4 -0
  25. package/dist/types/core/components/TPActionSheet.d.ts +4 -0
  26. package/dist/types/core/components/TPAlert.d.ts +4 -0
  27. package/dist/types/core/components/TPAvatar.d.ts +7 -0
  28. package/dist/types/core/components/TPBadge.d.ts +7 -0
  29. package/dist/types/core/components/TPBottomSheet.d.ts +4 -0
  30. package/dist/types/core/components/TPButton.d.ts +4 -0
  31. package/dist/types/core/components/TPCheckbox.d.ts +11 -0
  32. package/dist/types/core/components/TPDatePicker.d.ts +7 -0
  33. package/dist/types/core/components/TPDaySwitcher.d.ts +7 -0
  34. package/dist/types/core/components/TPDivider.d.ts +7 -0
  35. package/dist/types/core/components/TPEmptyState.d.ts +7 -0
  36. package/dist/types/core/components/TPFixedButtonBar.d.ts +4 -0
  37. package/dist/types/core/components/TPFixedToast.d.ts +7 -0
  38. package/dist/types/core/components/TPHeader.d.ts +4 -0
  39. package/dist/types/core/components/TPIconButton.d.ts +11 -0
  40. package/dist/types/core/components/TPInput.d.ts +8 -0
  41. package/dist/types/core/components/TPKeyboard.d.ts +7 -0
  42. package/dist/types/core/components/TPLast7DaysPicker.d.ts +7 -0
  43. package/dist/types/core/components/TPLiquidGlass.d.ts +8 -0
  44. package/dist/types/core/components/TPListButton.d.ts +7 -0
  45. package/dist/types/core/components/TPListCard.d.ts +7 -0
  46. package/dist/types/core/components/TPListItem.d.ts +7 -0
  47. package/dist/types/core/components/TPMenu.d.ts +4 -0
  48. package/dist/types/core/components/TPMonthPicker.d.ts +7 -0
  49. package/dist/types/core/components/TPPageControl.d.ts +4 -0
  50. package/dist/types/core/components/TPPhoneFrame.d.ts +4 -0
  51. package/dist/types/core/components/TPPinInput.d.ts +7 -0
  52. package/dist/types/core/components/TPPopup.d.ts +4 -0
  53. package/dist/types/core/components/TPProgress.d.ts +7 -0
  54. package/dist/types/core/components/TPPrompt.d.ts +4 -0
  55. package/dist/types/core/components/TPRadio.d.ts +11 -0
  56. package/dist/types/core/components/TPSearchBar.d.ts +7 -0
  57. package/dist/types/core/components/TPSectionHeader.d.ts +7 -0
  58. package/dist/types/core/components/TPSectionNote.d.ts +7 -0
  59. package/dist/types/core/components/TPSegment.d.ts +4 -0
  60. package/dist/types/core/components/TPSkeleton.d.ts +7 -0
  61. package/dist/types/core/components/TPSlider.d.ts +4 -0
  62. package/dist/types/core/components/TPStatusBar.d.ts +4 -0
  63. package/dist/types/core/components/TPStepText.d.ts +7 -0
  64. package/dist/types/core/components/TPStepper.d.ts +7 -0
  65. package/dist/types/core/components/TPSwipeRow.d.ts +8 -0
  66. package/dist/types/core/components/TPSwitch.d.ts +4 -0
  67. package/dist/types/core/components/TPTabBar.d.ts +4 -0
  68. package/dist/types/core/components/TPTag.d.ts +7 -0
  69. package/dist/types/core/components/TPText.d.ts +7 -0
  70. package/dist/types/core/components/TPTimePicker.d.ts +7 -0
  71. package/dist/types/core/components/TPToast.d.ts +13 -0
  72. package/dist/types/core/components/TPTooltip.d.ts +7 -0
  73. package/dist/types/core/components/TPWheelPicker.d.ts +7 -0
  74. package/dist/types/core/index.d.ts +50 -0
  75. package/dist/types/core/types.d.ts +646 -0
  76. package/dist/types/lib/assets.d.ts +1 -0
  77. package/dist/types/lib/core.d.ts +2 -0
  78. package/dist/types/lib/index.d.ts +4 -0
  79. package/dist/types/lib/omada.d.ts +4 -0
  80. package/dist/types/lib/standalone.d.ts +8 -0
  81. package/dist/types/omada/blocks/OmadaDeviceListBlock.d.ts +42 -0
  82. package/dist/types/omada/blocks/OmadaFirmwareUpdateBlock.d.ts +23 -0
  83. package/dist/types/omada/blocks/OmadaIncidentsBlock.d.ts +26 -0
  84. package/dist/types/omada/blocks/OmadaPortPanelBlock.d.ts +31 -0
  85. package/dist/types/omada/blocks/OmadaScheduleBlock.d.ts +33 -0
  86. package/dist/types/omada/blocks/OmadaTopologyBlock.d.ts +26 -0
  87. package/dist/types/omada/blocks/OmadaWirelessNetworkBlock.d.ts +25 -0
  88. package/dist/types/omada/components/OmadaStandardInput.d.ts +23 -0
  89. package/dist/types/omada/index.d.ts +18 -0
  90. package/dist/types/omada/pages/OmadaAppDemo.d.ts +18 -0
  91. package/dist/types/omada/pages/OmadaControllerListPage.d.ts +26 -0
  92. package/dist/types/omada/pages/OmadaDeviceDetailPage.d.ts +15 -0
  93. package/dist/types/omada/pages/OmadaHealthDetailPage.d.ts +17 -0
  94. package/dist/types/omada/pages/OmadaLaunchLoadingPage.d.ts +24 -0
  95. package/dist/types/omada/pages/OmadaSiteClientsPage.d.ts +34 -0
  96. package/dist/types/omada/pages/OmadaSiteDashboardPage.d.ts +28 -0
  97. package/dist/types/omada/pages/OmadaSiteDevicesPage.d.ts +18 -0
  98. package/dist/types/omada/pages/OmadaSiteInsightsPage.d.ts +17 -0
  99. package/dist/types/omada/pages/OmadaSiteSettingsPage.d.ts +22 -0
  100. package/dist/types/theme/TPThemeProvider.d.ts +33 -0
  101. package/dist/types/theme/index.d.ts +2 -0
  102. package/dist/types/theme/tokens.d.ts +80 -0
  103. package/package.json +88 -4
  104. package/skills/tp-mobile-ui-kit/SKILL.md +226 -0
  105. package/skills/tp-mobile-ui-kit/references/catalog.json +12355 -0
  106. package/skills/tp-mobile-ui-kit/scripts/query-catalog.mjs +289 -0
  107. package/skills/tp-mobile-ui-kit/scripts/verify-demo.mjs +193 -0
  108. package/skills/tp-mobile-ui-kit/templates/multi-brand.html +319 -0
  109. package/skills/tp-mobile-ui-kit/templates/multi-brand.tsx +337 -0
  110. package/skills/tp-mobile-ui-kit/templates/omada-dashboard.html +138 -0
  111. package/skills/tp-mobile-ui-kit/templates/omada-dashboard.tsx +119 -0
  112. package/skills/tp-mobile-ui-kit/templates/omada-device-detail.html +158 -0
  113. package/skills/tp-mobile-ui-kit/templates/omada-device-detail.tsx +135 -0
@@ -0,0 +1,3456 @@
1
+ import { s as e, t } from "./asset-illustrations-YHXzEd7z.js";
2
+ import { n, t as r } from "./asset-icons-BIenKvAh.js";
3
+ import i, { createContext as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
4
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
5
+ // src/core/components/TPPhoneFrame.tsx
6
+ var g = {
7
+ iphone16pro: {
8
+ width: 393,
9
+ height: 852,
10
+ isIOS: !0
11
+ },
12
+ iphone14: {
13
+ width: 375,
14
+ height: 812,
15
+ isIOS: !0
16
+ },
17
+ android: {
18
+ width: 360,
19
+ height: 800,
20
+ isIOS: !1
21
+ },
22
+ compact: {
23
+ width: 360,
24
+ height: 720,
25
+ isIOS: !1
26
+ }
27
+ };
28
+ function _(e, t) {
29
+ return e || (t === "base" ? "iphone14" : "iphone16pro");
30
+ }
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
+ "tp-phone-frame",
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
39
+ ].filter(Boolean).join(" ");
40
+ return /* @__PURE__ */ m("div", {
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,
49
+ style: {
50
+ ...o ? void 0 : {
51
+ width: `${T}px`,
52
+ height: `${E}px`
53
+ },
54
+ ...y
55
+ },
56
+ children: /* @__PURE__ */ h("div", {
57
+ className: "tp-phone-screen",
58
+ style: {
59
+ width: `${T}px`,
60
+ height: `${E}px`,
61
+ "--tp-phone-top-inset": P
62
+ },
63
+ children: [
64
+ D && /* @__PURE__ */ m("div", {
65
+ className: "tp-phone-dynamic-island",
66
+ "data-testid": "tp-phone-dynamic-island",
67
+ "aria-hidden": "true",
68
+ children: /* @__PURE__ */ m("span", { className: "tp-phone-dynamic-island-lens" })
69
+ }),
70
+ k && /* @__PURE__ */ m("div", {
71
+ className: `tp-phone-statusbar ${M ? "tp-phone-statusbar--overlay" : ""}`.trim(),
72
+ children: d
73
+ }),
74
+ /* @__PURE__ */ h("div", {
75
+ className: "tp-phone-stage",
76
+ children: [/* @__PURE__ */ m("div", {
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(),
81
+ children: p
82
+ })]
83
+ }),
84
+ A || O ? /* @__PURE__ */ h("div", {
85
+ className: `tp-phone-bottom ${N ? "tp-phone-bottom--overlay" : ""}`.trim(),
86
+ children: [A && /* @__PURE__ */ m("div", {
87
+ className: "tp-phone-bottombar",
88
+ children: f
89
+ }), O && /* @__PURE__ */ m("div", {
90
+ className: "tp-phone-home-indicator",
91
+ "data-testid": "tp-phone-home-indicator",
92
+ "aria-hidden": "true",
93
+ children: /* @__PURE__ */ m("span", { className: "tp-phone-home-indicator-pill" })
94
+ })]
95
+ }) : null
96
+ ]
97
+ })
98
+ });
99
+ }, y = [
100
+ 4,
101
+ 6,
102
+ 8,
103
+ 10
104
+ ], b = ({ time: t = "10:51", os: n, carrier: r, signalStrength: i = 4, wifiStrength: a = 3, battery: o = 100, muted: s = !1, locationActive: c = !1, transparent: l = !1, className: u = "", style: d }) => {
105
+ let f = e(), p = n ?? f.os, g = Math.max(0, Math.min(100, Math.round(o))), _ = g <= 20, v = g / 100 * 18, b = [
106
+ "tp-statusbar",
107
+ `tp-statusbar--${p}`,
108
+ l ? "tp-statusbar--transparent" : "",
109
+ u
110
+ ].filter(Boolean).join(" ");
111
+ return /* @__PURE__ */ h("div", {
112
+ className: b,
113
+ "data-os": p,
114
+ "data-signal": i,
115
+ "data-wifi": a,
116
+ "data-battery": g,
117
+ style: d,
118
+ children: [/* @__PURE__ */ h("div", {
119
+ className: "tp-statusbar-left",
120
+ children: [
121
+ /* @__PURE__ */ m("span", {
122
+ className: "tp-statusbar-time",
123
+ children: t
124
+ }),
125
+ r && /* @__PURE__ */ m("span", {
126
+ className: "tp-statusbar-carrier",
127
+ children: r
128
+ }),
129
+ c && /* @__PURE__ */ m("span", {
130
+ className: "tp-statusbar-meta-icon",
131
+ "aria-label": "Location active",
132
+ children: /* @__PURE__ */ m("svg", {
133
+ width: "11",
134
+ height: "11",
135
+ viewBox: "0 0 12 12",
136
+ fill: "none",
137
+ "aria-hidden": "true",
138
+ children: /* @__PURE__ */ m("path", {
139
+ d: "M10.8 1.2L1.3 5.2L5.5 6.5L6.8 10.7L10.8 1.2Z",
140
+ fill: "currentColor"
141
+ })
142
+ })
143
+ }),
144
+ s && /* @__PURE__ */ m("span", {
145
+ className: "tp-statusbar-meta-icon",
146
+ "aria-label": "Muted",
147
+ children: /* @__PURE__ */ m("svg", {
148
+ width: "12",
149
+ height: "12",
150
+ viewBox: "0 0 14 14",
151
+ fill: "none",
152
+ "aria-hidden": "true",
153
+ children: /* @__PURE__ */ m("path", {
154
+ d: "M9.6 8.3V5.8C9.6 4.2 8.5 3 7 3C6.4 3 5.9 3.2 5.5 3.5M4.4 5.8V8.3L3.2 9.8H10.1M6 11.1C6.2 11.6 6.6 11.8 7 11.8C7.4 11.8 7.8 11.6 8 11.1M2.2 2.2L11.8 11.8",
155
+ stroke: "currentColor",
156
+ strokeWidth: "1.2",
157
+ strokeLinecap: "round",
158
+ strokeLinejoin: "round"
159
+ })
160
+ })
161
+ })
162
+ ]
163
+ }), /* @__PURE__ */ h("div", {
164
+ className: "tp-statusbar-right",
165
+ children: [
166
+ /* @__PURE__ */ m("span", {
167
+ className: "tp-statusbar-signal",
168
+ "aria-label": `Cellular signal ${i} of 4`,
169
+ children: /* @__PURE__ */ m("svg", {
170
+ width: "18",
171
+ height: "12",
172
+ viewBox: "0 0 18 12",
173
+ fill: "none",
174
+ "aria-hidden": "true",
175
+ children: y.map((e, t) => {
176
+ let n = t + 1, r = n <= i, a = t * 4.5, o = p === "ios" ? Math.max(2, e - 2) : e, s = p === "ios" ? 9 - o : 11 - o;
177
+ return /* @__PURE__ */ h("g", {
178
+ opacity: r ? 1 : .28,
179
+ children: [/* @__PURE__ */ m("rect", {
180
+ x: a,
181
+ y: s,
182
+ width: "3",
183
+ height: o,
184
+ rx: "1",
185
+ fill: "currentColor"
186
+ }), p === "ios" && /* @__PURE__ */ m("rect", {
187
+ x: a,
188
+ y: "10",
189
+ width: "3",
190
+ height: "1.6",
191
+ rx: "0.8",
192
+ fill: "currentColor"
193
+ })]
194
+ }, n);
195
+ })
196
+ })
197
+ }),
198
+ /* @__PURE__ */ m("span", {
199
+ className: "tp-statusbar-wifi",
200
+ "aria-label": `Wi-Fi signal ${a} of 3`,
201
+ children: /* @__PURE__ */ h("svg", {
202
+ width: "16",
203
+ height: "12",
204
+ viewBox: "0 0 16 12",
205
+ fill: "none",
206
+ "aria-hidden": "true",
207
+ children: [
208
+ /* @__PURE__ */ m("path", {
209
+ d: "M1.4 3.8C5.1 0.6 10.9 0.6 14.6 3.8",
210
+ stroke: "currentColor",
211
+ strokeWidth: "1.5",
212
+ strokeLinecap: "round",
213
+ opacity: a >= 3 ? 1 : .28
214
+ }),
215
+ /* @__PURE__ */ m("path", {
216
+ d: "M3.7 6.3C6.1 4.2 9.9 4.2 12.3 6.3",
217
+ stroke: "currentColor",
218
+ strokeWidth: "1.5",
219
+ strokeLinecap: "round",
220
+ opacity: a >= 2 ? 1 : .28
221
+ }),
222
+ /* @__PURE__ */ m("path", {
223
+ d: "M6.1 8.8C7.2 7.8 8.8 7.8 9.9 8.8",
224
+ stroke: "currentColor",
225
+ strokeWidth: "1.5",
226
+ strokeLinecap: "round",
227
+ opacity: a >= 1 ? 1 : .28
228
+ }),
229
+ /* @__PURE__ */ m("circle", {
230
+ cx: "8",
231
+ cy: "10.7",
232
+ r: "1.1",
233
+ fill: "currentColor"
234
+ })
235
+ ]
236
+ })
237
+ }),
238
+ /* @__PURE__ */ h("span", {
239
+ className: "tp-statusbar-battery",
240
+ "aria-label": `Battery ${g}%`,
241
+ children: [p === "android" && /* @__PURE__ */ h("span", {
242
+ className: "tp-statusbar-battery-text",
243
+ children: [g, "%"]
244
+ }), /* @__PURE__ */ h("svg", {
245
+ width: "26",
246
+ height: "12",
247
+ viewBox: "0 0 26 12",
248
+ fill: "none",
249
+ "aria-hidden": "true",
250
+ children: [
251
+ /* @__PURE__ */ m("rect", {
252
+ x: "0.75",
253
+ y: "0.75",
254
+ width: "21.5",
255
+ height: "10.5",
256
+ rx: "2.8",
257
+ stroke: "currentColor",
258
+ strokeOpacity: "0.45",
259
+ strokeWidth: "1.2"
260
+ }),
261
+ /* @__PURE__ */ m("rect", {
262
+ x: "2.2",
263
+ y: "2.2",
264
+ width: Math.max(0, v),
265
+ height: "7.6",
266
+ rx: "1.6",
267
+ fill: _ ? "var(--tp-color-alert, #EE385C)" : "currentColor"
268
+ }),
269
+ /* @__PURE__ */ m("path", {
270
+ d: "M23.5 4.2V7.8C24.3 7.5 24.8 6.8 24.8 6C24.8 5.2 24.3 4.5 23.5 4.2Z",
271
+ fill: "currentColor",
272
+ fillOpacity: "0.5"
273
+ })
274
+ ]
275
+ })]
276
+ })
277
+ ]
278
+ })]
279
+ });
280
+ }, x = ({ title: e, subtitle: t, variant: n = "standard", left: r, right: i, showBack: a = !1, onBack: o, titleDropdown: s = !1, onTitleClick: c, rightBadge: l, translucent: u = !1, className: d = "", style: f }) => {
281
+ let g = n === "floating", _ = a || r != null, v = l != null && l !== "" && (typeof l != "number" || l > 0), y = i != null || v, b = /* @__PURE__ */ h(p, { children: [a ? /* @__PURE__ */ m("button", {
282
+ type: "button",
283
+ className: "tp-header-icon-btn",
284
+ "aria-label": "Back",
285
+ onClick: o,
286
+ children: /* @__PURE__ */ m("svg", {
287
+ width: "20",
288
+ height: "20",
289
+ viewBox: "0 0 24 24",
290
+ fill: "none",
291
+ "aria-hidden": "true",
292
+ children: /* @__PURE__ */ m("path", {
293
+ d: "M15.5 19L8.5 12L15.5 5",
294
+ stroke: "currentColor",
295
+ strokeWidth: "1.8",
296
+ strokeLinecap: "round",
297
+ strokeLinejoin: "round"
298
+ })
299
+ })
300
+ }) : null, r] }), x = /* @__PURE__ */ h(p, { children: [e != null && /* @__PURE__ */ m("span", {
301
+ className: "tp-header-title",
302
+ children: e
303
+ }), s && /* @__PURE__ */ m("span", {
304
+ className: "tp-header-chevron",
305
+ "aria-hidden": "true",
306
+ children: /* @__PURE__ */ m("svg", {
307
+ width: "14",
308
+ height: "14",
309
+ viewBox: "0 0 16 16",
310
+ fill: "none",
311
+ children: /* @__PURE__ */ m("path", {
312
+ d: "M4 6L8 10L12 6",
313
+ stroke: "currentColor",
314
+ strokeWidth: "1.7",
315
+ strokeLinecap: "round",
316
+ strokeLinejoin: "round"
317
+ })
318
+ })
319
+ })] }), S = [
320
+ "tp-header",
321
+ `tp-header--${n}`,
322
+ u ? "tp-header--translucent" : "",
323
+ d
324
+ ].filter(Boolean).join(" ");
325
+ return /* @__PURE__ */ h("header", {
326
+ className: S,
327
+ "data-variant": n,
328
+ style: f,
329
+ children: [
330
+ /* @__PURE__ */ m("div", {
331
+ className: "tp-header-left",
332
+ children: _ ? g ? /* @__PURE__ */ m("div", {
333
+ className: "tp-header-well",
334
+ children: b
335
+ }) : b : null
336
+ }),
337
+ /* @__PURE__ */ h("div", {
338
+ className: "tp-header-center",
339
+ children: [e != null || s ? c || s ? /* @__PURE__ */ m("button", {
340
+ type: "button",
341
+ className: "tp-header-title-btn",
342
+ onClick: c,
343
+ children: x
344
+ }) : /* @__PURE__ */ m("div", {
345
+ className: "tp-header-title-wrap",
346
+ children: x
347
+ }) : null, t != null && /* @__PURE__ */ m("div", {
348
+ className: "tp-header-subtitle",
349
+ children: t
350
+ })]
351
+ }),
352
+ /* @__PURE__ */ m("div", {
353
+ className: "tp-header-right",
354
+ children: y ? /* @__PURE__ */ h("div", {
355
+ className: "tp-header-right-slot",
356
+ children: [g ? /* @__PURE__ */ m("div", {
357
+ className: "tp-header-well",
358
+ children: i
359
+ }) : i, v && /* @__PURE__ */ m("span", {
360
+ className: "tp-header-badge",
361
+ children: l
362
+ })]
363
+ }) : null
364
+ })
365
+ ]
366
+ });
367
+ };
368
+ // src/core/components/TPTabBar.tsx
369
+ function S(e, t) {
370
+ let i = t && e.activeIcon !== void 0 ? e.activeIcon : e.icon;
371
+ return typeof i == "string" ? n(i) ? /* @__PURE__ */ m(r, {
372
+ name: i,
373
+ size: 22
374
+ }) : /* @__PURE__ */ m("span", {
375
+ className: "tp-tabbar-icon-fallback",
376
+ "aria-hidden": "true",
377
+ children: i
378
+ }) : i;
379
+ }
380
+ function C(e) {
381
+ return e == null || e === !1 ? null : e === !0 ? /* @__PURE__ */ m("span", {
382
+ className: "tp-tabbar-badge tp-tabbar-badge--dot",
383
+ "aria-label": "Notification"
384
+ }) : typeof e == "number" ? e <= 0 ? null : /* @__PURE__ */ m("span", {
385
+ className: "tp-tabbar-badge",
386
+ children: e > 99 ? "99+" : String(e)
387
+ }) : e === "" ? null : /* @__PURE__ */ m("span", {
388
+ className: "tp-tabbar-badge",
389
+ children: e
390
+ });
391
+ }
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 = [
394
+ "tp-tabbar",
395
+ `tp-tabbar--${r}`,
396
+ s ? "tp-tabbar--has-extra" : "",
397
+ a
398
+ ].filter(Boolean).join(" ");
399
+ return /* @__PURE__ */ h("nav", {
400
+ className: c,
401
+ "data-variant": r,
402
+ "aria-label": "Bottom Navigation",
403
+ style: o,
404
+ children: [/* @__PURE__ */ m("div", {
405
+ className: "tp-tabbar-track",
406
+ role: "tablist",
407
+ children: e.map((e) => {
408
+ let r = e.key === t;
409
+ return /* @__PURE__ */ h("button", {
410
+ type: "button",
411
+ role: "tab",
412
+ "aria-selected": r,
413
+ className: `tp-tabbar-item ${r ? "tp-tabbar-item--active" : ""}`.trim(),
414
+ onClick: () => n(e.key),
415
+ children: [/* @__PURE__ */ h("span", {
416
+ className: "tp-tabbar-icon-wrap",
417
+ children: [/* @__PURE__ */ m("span", {
418
+ className: "tp-tabbar-icon",
419
+ children: S(e, r)
420
+ }), C(e.badge)]
421
+ }), /* @__PURE__ */ m("span", {
422
+ className: "tp-tabbar-label",
423
+ children: e.label
424
+ })]
425
+ }, e.key);
426
+ })
427
+ }), s && /* @__PURE__ */ m("div", {
428
+ className: "tp-tabbar-extra",
429
+ children: i
430
+ })]
431
+ });
432
+ }, T = ({ options: e, value: t, onChange: n, variant: r = "underline", fullWidth: i = !0, className: a = "", style: o }) => {
433
+ let s = [
434
+ "tp-segment",
435
+ `tp-segment--${r}`,
436
+ i ? "tp-segment--full" : "",
437
+ a
438
+ ].filter(Boolean).join(" ");
439
+ return /* @__PURE__ */ m("div", {
440
+ className: s,
441
+ role: "tablist",
442
+ "data-variant": r,
443
+ style: o,
444
+ children: e.map((e) => {
445
+ let r = e.key === t, i = [
446
+ "tp-segment-item",
447
+ r ? "tp-segment-item--active" : "",
448
+ e.disabled ? "tp-segment-item--disabled" : ""
449
+ ].filter(Boolean).join(" ");
450
+ return /* @__PURE__ */ h("button", {
451
+ type: "button",
452
+ role: "tab",
453
+ "aria-selected": r,
454
+ disabled: e.disabled,
455
+ className: i,
456
+ onClick: () => {
457
+ e.disabled || n(e.key);
458
+ },
459
+ children: [/* @__PURE__ */ m("span", {
460
+ className: "tp-segment-label",
461
+ children: e.label
462
+ }), e.badge !== void 0 && e.badge !== null && e.badge !== "" && /* @__PURE__ */ m("span", {
463
+ className: "tp-segment-badge",
464
+ children: e.badge
465
+ })]
466
+ }, e.key);
467
+ })
468
+ });
469
+ }, E = ({ total: e, current: t, onChange: n, className: r = "", style: i }) => {
470
+ if (e <= 0) return null;
471
+ let a = ["tp-page-control", r].filter(Boolean).join(" ");
472
+ return /* @__PURE__ */ m("div", {
473
+ className: a,
474
+ role: "navigation",
475
+ "aria-label": "Page indicator",
476
+ style: i,
477
+ children: Array.from({ length: e }, (e, r) => {
478
+ let i = r === t, a = ["tp-page-control-dot", i ? "tp-page-control-dot--active" : ""].filter(Boolean).join(" ");
479
+ return n ? /* @__PURE__ */ m("button", {
480
+ type: "button",
481
+ className: a,
482
+ "aria-label": `Page ${r + 1}`,
483
+ "aria-current": i ? "page" : void 0,
484
+ "data-active": String(i),
485
+ onClick: () => n(r)
486
+ }, r) : /* @__PURE__ */ m("span", {
487
+ className: a,
488
+ "data-active": String(i),
489
+ "aria-current": i ? "page" : void 0
490
+ }, r);
491
+ })
492
+ });
493
+ }, D = ({ variant: e = "primary", size: t = "lg", block: n = !1, loading: r = !1, htmlType: i = "button", icon: a, disabled: o = !1, className: s = "", children: c, ...l }) => {
494
+ let u = [
495
+ "tp-btn",
496
+ `tp-btn--${e}`,
497
+ `tp-btn--${t}`,
498
+ n ? "tp-btn--block" : "",
499
+ r ? "tp-btn--loading" : "",
500
+ s
501
+ ].filter(Boolean).join(" ");
502
+ return /* @__PURE__ */ h("button", {
503
+ ...l,
504
+ type: i,
505
+ className: u,
506
+ disabled: o || r,
507
+ "aria-busy": r || void 0,
508
+ "data-variant": e,
509
+ "data-size": t,
510
+ children: [r ? /* @__PURE__ */ m("span", {
511
+ className: "tp-btn-spinner",
512
+ "aria-hidden": "true"
513
+ }) : a == null ? null : /* @__PURE__ */ m("span", {
514
+ className: "tp-btn-icon",
515
+ "aria-hidden": "true",
516
+ children: a
517
+ }), c != null && /* @__PURE__ */ m("span", {
518
+ className: "tp-btn-label",
519
+ children: c
520
+ })]
521
+ });
522
+ }, O = ({ layout: e = "single", primaryText: t, onPrimaryClick: n, primaryLoading: r = !1, primaryDisabled: i = !1, secondaryText: a, onSecondaryClick: o, secondaryVariant: s = "secondary", note: c, className: l = "", style: u }) => {
523
+ let d = [
524
+ "tp-fixed-btn-bar",
525
+ `tp-fixed-btn-bar--${e}`,
526
+ l
527
+ ].filter(Boolean).join(" "), f = /* @__PURE__ */ m(D, {
528
+ variant: "primary",
529
+ size: "lg",
530
+ block: !0,
531
+ loading: r,
532
+ disabled: i,
533
+ onClick: n,
534
+ children: t
535
+ }), g = a ? /* @__PURE__ */ m(D, {
536
+ variant: s,
537
+ size: "lg",
538
+ block: !0,
539
+ onClick: o,
540
+ children: a
541
+ }) : null;
542
+ return /* @__PURE__ */ h("div", {
543
+ className: d,
544
+ "data-layout": e,
545
+ style: u,
546
+ children: [c != null && /* @__PURE__ */ m("div", {
547
+ className: "tp-fixed-btn-bar-note",
548
+ children: c
549
+ }), /* @__PURE__ */ m("div", {
550
+ className: "tp-fixed-btn-bar-actions",
551
+ children: e === "dual-horizontal" ? /* @__PURE__ */ h(p, { children: [g, f] }) : /* @__PURE__ */ h(p, { children: [f, e === "dual-vertical" ? g : null] })
552
+ })]
553
+ });
554
+ }, k = ({ checked: e, defaultChecked: t = !1, onChange: n, disabled: r = !1, loading: i = !1, ariaLabel: a, className: o = "", style: s }) => {
555
+ let [c, l] = f(t), u = e !== void 0, d = u ? e : c, p = r || i, h = () => {
556
+ if (p) return;
557
+ let e = !d;
558
+ u || l(e), n?.(e);
559
+ }, g = [
560
+ "tp-switch",
561
+ d ? "tp-switch--checked" : "",
562
+ r ? "tp-switch--disabled" : "",
563
+ i ? "tp-switch--loading" : "",
564
+ o
565
+ ].filter(Boolean).join(" ");
566
+ return /* @__PURE__ */ m("button", {
567
+ type: "button",
568
+ role: "switch",
569
+ "aria-checked": d,
570
+ "aria-label": a,
571
+ "aria-busy": i || void 0,
572
+ disabled: p,
573
+ className: g,
574
+ style: s,
575
+ onClick: h,
576
+ children: /* @__PURE__ */ m("span", {
577
+ className: "tp-switch-thumb",
578
+ "aria-hidden": "true",
579
+ children: i && /* @__PURE__ */ m("span", { className: "tp-switch-spinner" })
580
+ })
581
+ });
582
+ };
583
+ // src/core/components/TPSlider.tsx
584
+ function A(e, t, n) {
585
+ return Number.isNaN(e) ? t : Math.min(n, Math.max(t, e));
586
+ }
587
+ function j(e, t, n) {
588
+ return n <= t ? 0 : (A(e, t, n) - t) / (n - t) * 100;
589
+ }
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) => {
600
+ let i = A(e, n, r);
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 = [
610
+ "tp-slider",
611
+ l ? "tp-slider--range" : "",
612
+ c ? "tp-slider--disabled" : "",
613
+ S
614
+ ].filter(Boolean).join(" ");
615
+ return /* @__PURE__ */ h("div", {
616
+ className: G,
617
+ style: C,
618
+ children: [
619
+ o && /* @__PURE__ */ m("div", {
620
+ className: "tp-slider-header",
621
+ children: /* @__PURE__ */ m("span", {
622
+ className: "tp-slider-value",
623
+ children: l ? `${F[0]}${s} – ${F[1]}${s}` : `${D}${s}`
624
+ })
625
+ }),
626
+ /* @__PURE__ */ h("div", {
627
+ className: "tp-slider-control",
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: [
651
+ /* @__PURE__ */ m("div", {
652
+ className: "tp-slider-thumb",
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}%` },
659
+ "aria-hidden": "true"
660
+ }),
661
+ /* @__PURE__ */ m("input", {
662
+ type: "range",
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",
683
+ min: n,
684
+ max: r,
685
+ step: i,
686
+ value: F[1],
687
+ disabled: c,
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
698
+ })
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
+ })] })]
718
+ }),
719
+ W && a && /* @__PURE__ */ m("div", {
720
+ className: "tp-slider-marks",
721
+ children: a.map((e) => {
722
+ if (e.label === void 0) return null;
723
+ let t = j(e.value, n, r), i = l ? e.value === F[0] || e.value === F[1] : e.value === D;
724
+ return /* @__PURE__ */ m("div", {
725
+ className: [
726
+ "tp-slider-mark",
727
+ t <= 2 ? "tp-slider-mark--start" : t >= 98 ? "tp-slider-mark--end" : "",
728
+ i ? "tp-slider-mark--active" : ""
729
+ ].filter(Boolean).join(" "),
730
+ style: { left: `${t}%` },
731
+ children: /* @__PURE__ */ m("button", {
732
+ type: "button",
733
+ className: "tp-slider-mark-btn",
734
+ disabled: c,
735
+ onClick: () => {
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));
737
+ },
738
+ children: e.label
739
+ })
740
+ }, e.value);
741
+ })
742
+ })
743
+ ]
744
+ });
745
+ }, P = ({ title: e, extra: t, radius: n = "theme", padding: r = "none", divided: i = !1, className: a = "", style: o, children: s }) => {
746
+ let c = [
747
+ "tp-list-card",
748
+ `tp-list-card--radius-${n}`,
749
+ `tp-list-card--pad-${r}`,
750
+ i ? "tp-list-card--divided" : "",
751
+ a
752
+ ].filter(Boolean).join(" ");
753
+ return /* @__PURE__ */ h("div", {
754
+ className: c,
755
+ style: o,
756
+ children: [(e !== void 0 || t !== void 0) && /* @__PURE__ */ h("div", {
757
+ className: "tp-list-card-header",
758
+ children: [/* @__PURE__ */ m("div", {
759
+ className: "tp-list-card-title",
760
+ children: e
761
+ }), t !== void 0 && /* @__PURE__ */ m("div", {
762
+ className: "tp-list-card-extra",
763
+ children: t
764
+ })]
765
+ }), /* @__PURE__ */ m("div", {
766
+ className: "tp-list-card-body",
767
+ children: s
768
+ })]
769
+ });
770
+ }, F = ({ checked: e, defaultChecked: t = !1, onChange: n, disabled: r = !1, loading: i = !1, ariaLabel: a, className: o = "", style: s, fallbackLabel: c }) => {
771
+ let [l, u] = f(t), d = e !== void 0, p = d ? e : l, h = r || i, g = (e) => {
772
+ if (e.stopPropagation(), h) return;
773
+ let t = !p;
774
+ d || u(t), n?.(t);
775
+ }, _ = [
776
+ "tp-switch",
777
+ p ? "tp-switch--checked" : "",
778
+ h ? "tp-switch--disabled" : "",
779
+ i ? "tp-switch--loading" : "",
780
+ o
781
+ ].filter(Boolean).join(" ");
782
+ return /* @__PURE__ */ m("button", {
783
+ type: "button",
784
+ role: "switch",
785
+ "aria-checked": p,
786
+ "aria-label": a ?? c ?? "Toggle",
787
+ disabled: h,
788
+ className: _,
789
+ style: s,
790
+ onClick: g,
791
+ children: /* @__PURE__ */ m("span", {
792
+ className: "tp-switch-thumb",
793
+ children: i ? /* @__PURE__ */ m("span", {
794
+ className: "tp-switch-spinner",
795
+ "aria-hidden": "true"
796
+ }) : null
797
+ })
798
+ });
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 }) => {
800
+ let _ = !!f && !d, v = r != null || o != null || a != null || !!c || !!l || s, y = () => {
801
+ !d && f && f();
802
+ }, b = (e) => {
803
+ _ && e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f?.());
804
+ }, x = [
805
+ "tp-list-item",
806
+ _ ? "tp-list-item--clickable" : "",
807
+ u ? "tp-list-item--danger" : "",
808
+ d ? "tp-list-item--disabled" : "",
809
+ p
810
+ ].filter(Boolean).join(" ");
811
+ return /* @__PURE__ */ h("div", {
812
+ className: x,
813
+ style: g,
814
+ role: f ? "button" : void 0,
815
+ tabIndex: _ ? 0 : void 0,
816
+ "aria-disabled": d || void 0,
817
+ "data-checked": c === void 0 ? void 0 : String(!!c),
818
+ onClick: f ? y : void 0,
819
+ onKeyDown: f ? b : void 0,
820
+ children: [
821
+ i != null && /* @__PURE__ */ m("div", {
822
+ className: "tp-list-item-leading",
823
+ children: i
824
+ }),
825
+ /* @__PURE__ */ h("div", {
826
+ className: "tp-list-item-content",
827
+ children: [
828
+ /* @__PURE__ */ m("div", {
829
+ className: "tp-list-item-title",
830
+ children: e
831
+ }),
832
+ t != null && /* @__PURE__ */ m("div", {
833
+ className: "tp-list-item-subtitle",
834
+ children: t
835
+ }),
836
+ n != null && /* @__PURE__ */ m("div", {
837
+ className: "tp-list-item-description",
838
+ children: n
839
+ })
840
+ ]
841
+ }),
842
+ v && /* @__PURE__ */ h("div", {
843
+ className: "tp-list-item-trailing-group",
844
+ children: [
845
+ r != null && /* @__PURE__ */ m("div", {
846
+ className: "tp-list-item-value",
847
+ children: r
848
+ }),
849
+ o != null && /* @__PURE__ */ m("span", {
850
+ className: "tp-list-item-badge",
851
+ children: o
852
+ }),
853
+ a != null && /* @__PURE__ */ m("div", {
854
+ className: "tp-list-item-trailing",
855
+ children: a
856
+ }),
857
+ c && /* @__PURE__ */ m("span", {
858
+ className: "tp-list-item-check",
859
+ "aria-hidden": "true",
860
+ children: /* @__PURE__ */ m("svg", {
861
+ width: "18",
862
+ height: "18",
863
+ viewBox: "0 0 18 18",
864
+ fill: "none",
865
+ children: /* @__PURE__ */ m("path", {
866
+ d: "M4 9.2L7.4 12.6L14 5.5",
867
+ stroke: "currentColor",
868
+ strokeWidth: "2",
869
+ strokeLinecap: "round",
870
+ strokeLinejoin: "round"
871
+ })
872
+ })
873
+ }),
874
+ l && /* @__PURE__ */ m(F, {
875
+ ...l,
876
+ disabled: d || l.disabled,
877
+ fallbackLabel: typeof e == "string" ? e : void 0
878
+ }),
879
+ s && /* @__PURE__ */ m("span", {
880
+ className: "tp-list-item-arrow",
881
+ "aria-hidden": "true",
882
+ children: /* @__PURE__ */ m("svg", {
883
+ width: "16",
884
+ height: "16",
885
+ viewBox: "0 0 16 16",
886
+ fill: "none",
887
+ children: /* @__PURE__ */ m("path", {
888
+ d: "M6 3.5L10.5 8L6 12.5",
889
+ stroke: "currentColor",
890
+ strokeWidth: "1.75",
891
+ strokeLinecap: "round",
892
+ strokeLinejoin: "round"
893
+ })
894
+ })
895
+ })
896
+ ]
897
+ })
898
+ ]
899
+ });
900
+ }, L = ({ children: e, tone: t = "focus", align: n = "center", disabled: r = !1, onClick: i, className: a = "", style: o }) => {
901
+ let s = [
902
+ "tp-list-button",
903
+ `tp-list-button--tone-${t}`,
904
+ `tp-list-button--align-${n}`,
905
+ r ? "tp-list-button--disabled" : "",
906
+ a
907
+ ].filter(Boolean).join(" ");
908
+ return /* @__PURE__ */ m("button", {
909
+ type: "button",
910
+ className: s,
911
+ style: o,
912
+ disabled: r,
913
+ onClick: r ? void 0 : i,
914
+ children: e
915
+ });
916
+ }, R = ({ title: e, count: t, action: n, className: r = "", style: i }) => {
917
+ let a = ["tp-section-header", r].filter(Boolean).join(" ");
918
+ return /* @__PURE__ */ h("div", {
919
+ className: a,
920
+ style: i,
921
+ children: [/* @__PURE__ */ h("div", {
922
+ className: "tp-section-header-left",
923
+ children: [/* @__PURE__ */ m("span", {
924
+ className: "tp-section-header-title",
925
+ children: e
926
+ }), t != null && /* @__PURE__ */ h("span", {
927
+ className: "tp-section-header-count",
928
+ children: [
929
+ " (",
930
+ t,
931
+ ")"
932
+ ]
933
+ })]
934
+ }), n != null && /* @__PURE__ */ m("div", {
935
+ className: "tp-section-header-action",
936
+ children: n
937
+ })]
938
+ });
939
+ }, z = ({ children: e, tone: t = "default", className: n = "", style: r }) => {
940
+ let i = [
941
+ "tp-section-note",
942
+ `tp-section-note--${t}`,
943
+ n
944
+ ].filter(Boolean).join(" ");
945
+ return /* @__PURE__ */ m("div", {
946
+ className: i,
947
+ style: r,
948
+ children: e
949
+ });
950
+ }, B = {
951
+ title1: "h1",
952
+ title2: "h2",
953
+ title3: "h3",
954
+ title4: "h4",
955
+ body: "span",
956
+ subhead: "span",
957
+ caption: "span",
958
+ footnote: "span"
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 = [
961
+ "tp-text",
962
+ `tp-text--${e}`,
963
+ `tp-text--tone-${t}`,
964
+ r ? `tp-text--weight-${r}` : "",
965
+ i
966
+ ].filter(Boolean).join(" ");
967
+ return /* @__PURE__ */ m(s, {
968
+ className: c,
969
+ style: a,
970
+ children: o
971
+ });
972
+ }, H = ({ children: e, tone: t, selected: n, size: r = "md", closable: i = !1, onClose: a, onClick: o, className: s = "", style: c }) => {
973
+ let l = t ?? (n ? "focus" : "neutral"), u = n === !0 ? "tp-tag--selected" : n === !1 ? "tp-tag--unselected" : "", d = [
974
+ "tp-tag",
975
+ `tp-tag--${r}`,
976
+ `tp-tag--tone-${l}`,
977
+ u,
978
+ o ? "tp-tag--clickable" : "",
979
+ s
980
+ ].filter(Boolean).join(" ");
981
+ return o && !i ? /* @__PURE__ */ m("button", {
982
+ type: "button",
983
+ className: d,
984
+ style: c,
985
+ "aria-pressed": n === void 0 ? void 0 : n,
986
+ onClick: o,
987
+ children: /* @__PURE__ */ m("span", { children: e })
988
+ }) : /* @__PURE__ */ h("span", {
989
+ className: d,
990
+ style: c,
991
+ role: o ? "button" : void 0,
992
+ tabIndex: o ? 0 : void 0,
993
+ "aria-pressed": o && n !== void 0 ? n : void 0,
994
+ onClick: o,
995
+ onKeyDown: o ? (e) => {
996
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
997
+ } : void 0,
998
+ children: [/* @__PURE__ */ m("span", { children: e }), i ? /* @__PURE__ */ m("button", {
999
+ type: "button",
1000
+ className: "tp-tag-close",
1001
+ "aria-label": "Remove tag",
1002
+ onClick: (e) => {
1003
+ e.stopPropagation(), a?.();
1004
+ },
1005
+ children: /* @__PURE__ */ m("svg", {
1006
+ width: "10",
1007
+ height: "10",
1008
+ viewBox: "0 0 10 10",
1009
+ fill: "none",
1010
+ "aria-hidden": "true",
1011
+ children: /* @__PURE__ */ m("path", {
1012
+ d: "M2.2 2.2L7.8 7.8M7.8 2.2L2.2 7.8",
1013
+ stroke: "currentColor",
1014
+ strokeWidth: "1.5",
1015
+ strokeLinecap: "round"
1016
+ })
1017
+ })
1018
+ }) : null]
1019
+ });
1020
+ }, U = ({ count: e, dot: t = !1, tone: n = "alert", max: r = 99, showZero: i = !1, children: a, className: o = "", style: s }) => {
1021
+ let c = null, l = !1;
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));
1023
+ let u = l ? /* @__PURE__ */ m("span", {
1024
+ className: [
1025
+ "tp-badge",
1026
+ t ? "tp-badge--dot" : "",
1027
+ a ? "tp-badge--floating" : "",
1028
+ `tp-badge--tone-${n}`,
1029
+ a ? "" : o
1030
+ ].filter(Boolean).join(" "),
1031
+ style: a ? void 0 : s,
1032
+ children: t ? null : c
1033
+ }) : null;
1034
+ return a ? /* @__PURE__ */ h("span", {
1035
+ className: `tp-badge-wrapper ${o}`.trim(),
1036
+ style: s,
1037
+ children: [a, u]
1038
+ }) : u;
1039
+ }, W = ({ illustration: e, theme: n, icon: r, title: i, description: a, actionText: o, onAction: s, compact: c = !1, className: l = "", style: u }) => {
1040
+ let d = [
1041
+ "tp-empty-state",
1042
+ c ? "tp-empty-state--compact" : "",
1043
+ l
1044
+ ].filter(Boolean).join(" ");
1045
+ return /* @__PURE__ */ h("div", {
1046
+ className: d,
1047
+ style: u,
1048
+ children: [
1049
+ e ? /* @__PURE__ */ m("div", {
1050
+ className: "tp-empty-state-media",
1051
+ children: /* @__PURE__ */ m(t, {
1052
+ name: e,
1053
+ theme: n,
1054
+ width: c ? 180 : 240
1055
+ })
1056
+ }) : r ? /* @__PURE__ */ m("div", {
1057
+ className: "tp-empty-state-icon",
1058
+ children: r
1059
+ }) : null,
1060
+ /* @__PURE__ */ m("div", {
1061
+ className: "tp-empty-state-title",
1062
+ children: i
1063
+ }),
1064
+ a != null && /* @__PURE__ */ m("div", {
1065
+ className: "tp-empty-state-description",
1066
+ children: a
1067
+ }),
1068
+ o && /* @__PURE__ */ m("button", {
1069
+ type: "button",
1070
+ className: "tp-empty-state-action",
1071
+ onClick: s,
1072
+ children: o
1073
+ })
1074
+ ]
1075
+ });
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 = [
1086
+ "tp-input-box",
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" : ""
1092
+ ].filter(Boolean).join(" ");
1093
+ return /* @__PURE__ */ h("div", {
1094
+ className: K,
1095
+ "data-variant": e,
1096
+ children: [
1097
+ e !== "borderless" && t != null && /* @__PURE__ */ m("label", {
1098
+ htmlFor: k,
1099
+ className: "tp-input-label",
1100
+ children: t
1101
+ }),
1102
+ /* @__PURE__ */ h("div", {
1103
+ className: q,
1104
+ children: [
1105
+ g != null && /* @__PURE__ */ m("span", {
1106
+ className: "tp-input-prefix",
1107
+ children: g
1108
+ }),
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),
1128
+ onFocus: (e) => {
1129
+ I(!0), T?.(e);
1130
+ },
1131
+ onBlur: (e) => {
1132
+ I(!1), E?.(e);
1133
+ }
1134
+ }) : /* @__PURE__ */ m("input", {
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),
1147
+ onFocus: (e) => {
1148
+ I(!0), T?.(e);
1149
+ },
1150
+ onBlur: (e) => {
1151
+ I(!1), E?.(e);
1152
+ }
1153
+ }),
1154
+ W && /* @__PURE__ */ m("button", {
1155
+ type: "button",
1156
+ className: "tp-input-action-btn",
1157
+ "aria-label": "Clear input",
1158
+ onClick: U,
1159
+ children: /* @__PURE__ */ h("svg", {
1160
+ width: "14",
1161
+ height: "14",
1162
+ viewBox: "0 0 14 14",
1163
+ fill: "none",
1164
+ "aria-hidden": "true",
1165
+ children: [/* @__PURE__ */ m("circle", {
1166
+ cx: "7",
1167
+ cy: "7",
1168
+ r: "6",
1169
+ fill: "currentColor",
1170
+ fillOpacity: "0.2"
1171
+ }), /* @__PURE__ */ m("path", {
1172
+ d: "M4.8 4.8L9.2 9.2M9.2 4.8L4.8 9.2",
1173
+ stroke: "currentColor",
1174
+ strokeWidth: "1.4",
1175
+ strokeLinecap: "round"
1176
+ })]
1177
+ })
1178
+ }),
1179
+ G && /* @__PURE__ */ m("button", {
1180
+ type: "button",
1181
+ className: "tp-input-action-btn",
1182
+ "aria-label": L ? "Hide password" : "Show password",
1183
+ onClick: () => R((e) => !e),
1184
+ children: L ? /* @__PURE__ */ h("svg", {
1185
+ width: "18",
1186
+ height: "18",
1187
+ viewBox: "0 0 20 20",
1188
+ fill: "none",
1189
+ "aria-hidden": "true",
1190
+ children: [/* @__PURE__ */ m("path", {
1191
+ d: "M2.5 10C4.2 6.8 6.9 5 10 5C13.1 5 15.8 6.8 17.5 10C15.8 13.2 13.1 15 10 15C6.9 15 4.2 13.2 2.5 10Z",
1192
+ stroke: "currentColor",
1193
+ strokeWidth: "1.5"
1194
+ }), /* @__PURE__ */ m("circle", {
1195
+ cx: "10",
1196
+ cy: "10",
1197
+ r: "2.5",
1198
+ stroke: "currentColor",
1199
+ strokeWidth: "1.5"
1200
+ })]
1201
+ }) : /* @__PURE__ */ m("svg", {
1202
+ width: "18",
1203
+ height: "18",
1204
+ viewBox: "0 0 20 20",
1205
+ fill: "none",
1206
+ "aria-hidden": "true",
1207
+ children: /* @__PURE__ */ m("path", {
1208
+ d: "M3 3L17 17M8.3 8.4A2.5 2.5 0 0 0 11.6 11.7M5.7 6.3C4.3 7.3 3.2 8.5 2.5 10C4.2 13.2 6.9 15 10 15C11.4 15 12.7 14.6 13.8 13.9M9.5 5C9.7 5 9.8 5 10 5C13.1 5 15.8 6.8 17.5 10C16.9 11.1 16.2 12.1 15.3 12.9",
1209
+ stroke: "currentColor",
1210
+ strokeWidth: "1.5",
1211
+ strokeLinecap: "round"
1212
+ })
1213
+ })
1214
+ }),
1215
+ _ != null && /* @__PURE__ */ m("span", {
1216
+ className: "tp-input-suffix",
1217
+ children: _
1218
+ })
1219
+ ]
1220
+ }),
1221
+ u ? /* @__PURE__ */ m("div", {
1222
+ id: A,
1223
+ className: "tp-input-error",
1224
+ role: "alert",
1225
+ children: u
1226
+ }) : p ? /* @__PURE__ */ m("div", {
1227
+ id: A,
1228
+ className: "tp-input-helper",
1229
+ children: p
1230
+ }) : null
1231
+ ]
1232
+ });
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 }) => {
1234
+ let u = d(null), [p, g] = f(t), _ = e !== void 0, v = _ ? e : p, y = (e) => {
1235
+ _ || g(e), r?.(e);
1236
+ };
1237
+ return /* @__PURE__ */ h("div", {
1238
+ className: `tp-search-bar ${c}`.trim(),
1239
+ style: l,
1240
+ children: [/* @__PURE__ */ h("div", {
1241
+ className: "tp-search-field",
1242
+ children: [
1243
+ /* @__PURE__ */ m("span", {
1244
+ className: "tp-search-icon",
1245
+ "aria-hidden": "true",
1246
+ children: /* @__PURE__ */ h("svg", {
1247
+ width: "16",
1248
+ height: "16",
1249
+ viewBox: "0 0 16 16",
1250
+ fill: "none",
1251
+ children: [/* @__PURE__ */ m("circle", {
1252
+ cx: "7",
1253
+ cy: "7",
1254
+ r: "4.8",
1255
+ stroke: "currentColor",
1256
+ strokeWidth: "1.6"
1257
+ }), /* @__PURE__ */ m("path", {
1258
+ d: "M10.6 10.6L14 14",
1259
+ stroke: "currentColor",
1260
+ strokeWidth: "1.6",
1261
+ strokeLinecap: "round"
1262
+ })]
1263
+ })
1264
+ }),
1265
+ /* @__PURE__ */ m("input", {
1266
+ ref: u,
1267
+ type: "search",
1268
+ className: "tp-search-input",
1269
+ value: v,
1270
+ placeholder: n,
1271
+ "aria-label": n,
1272
+ autoFocus: s,
1273
+ onChange: (e) => y(e.target.value),
1274
+ onKeyDown: (e) => {
1275
+ e.key === "Enter" && (e.preventDefault(), i?.(v));
1276
+ }
1277
+ }),
1278
+ v.length > 0 && /* @__PURE__ */ m("button", {
1279
+ type: "button",
1280
+ className: "tp-search-clear",
1281
+ "aria-label": "Clear search",
1282
+ onClick: () => {
1283
+ y(""), u.current?.focus();
1284
+ },
1285
+ children: /* @__PURE__ */ m("svg", {
1286
+ width: "10",
1287
+ height: "10",
1288
+ viewBox: "0 0 10 10",
1289
+ fill: "none",
1290
+ "aria-hidden": "true",
1291
+ children: /* @__PURE__ */ m("path", {
1292
+ d: "M2.5 2.5L7.5 7.5M7.5 2.5L2.5 7.5",
1293
+ stroke: "currentColor",
1294
+ strokeWidth: "1.5",
1295
+ strokeLinecap: "round"
1296
+ })
1297
+ })
1298
+ })
1299
+ ]
1300
+ }), o && /* @__PURE__ */ m("button", {
1301
+ type: "button",
1302
+ className: "tp-search-cancel",
1303
+ onClick: a,
1304
+ children: "Cancel"
1305
+ })]
1306
+ });
1307
+ }, K = ({ column: e, itemHeight: t, visibleItems: n, onChange: r }) => {
1308
+ let i = d(null), a = Math.max(0, e.options.findIndex((t) => t.value === e.value)), o = Math.floor(n / 2) * t;
1309
+ c(() => {
1310
+ let e = i.current;
1311
+ if (!e) return;
1312
+ let n = a * t;
1313
+ typeof e.scrollTo == "function" ? e.scrollTo({
1314
+ top: n,
1315
+ behavior: "smooth"
1316
+ }) : e.scrollTop = n;
1317
+ }, [a, t]);
1318
+ let s = (t) => {
1319
+ let n = Math.min(e.options.length - 1, Math.max(0, a + t)), i = e.options[n];
1320
+ i && i.value !== e.value && r(e.key, i.value);
1321
+ };
1322
+ return /* @__PURE__ */ h("div", {
1323
+ className: "tp-wheel-column-wrap",
1324
+ children: [
1325
+ /* @__PURE__ */ m("button", {
1326
+ type: "button",
1327
+ className: "tp-wheel-step tp-wheel-step--up",
1328
+ "aria-label": `Previous ${e.key}`,
1329
+ disabled: a <= 0,
1330
+ onClick: () => s(-1),
1331
+ children: /* @__PURE__ */ m("svg", {
1332
+ width: "12",
1333
+ height: "12",
1334
+ viewBox: "0 0 12 12",
1335
+ fill: "none",
1336
+ "aria-hidden": "true",
1337
+ children: /* @__PURE__ */ m("path", {
1338
+ d: "M3 7.5L6 4.5L9 7.5",
1339
+ stroke: "currentColor",
1340
+ strokeWidth: "1.5",
1341
+ strokeLinecap: "round",
1342
+ strokeLinejoin: "round"
1343
+ })
1344
+ })
1345
+ }),
1346
+ /* @__PURE__ */ h("div", {
1347
+ ref: i,
1348
+ role: "listbox",
1349
+ "aria-label": e.key,
1350
+ tabIndex: 0,
1351
+ className: "tp-wheel-column",
1352
+ style: { height: n * t },
1353
+ onKeyDown: (t) => {
1354
+ t.key === "ArrowUp" ? (t.preventDefault(), s(-1)) : t.key === "ArrowDown" ? (t.preventDefault(), s(1)) : t.key === "Home" && e.options.length > 0 ? (t.preventDefault(), r(e.key, e.options[0].value)) : t.key === "End" && e.options.length > 0 && (t.preventDefault(), r(e.key, e.options[e.options.length - 1].value));
1355
+ },
1356
+ children: [
1357
+ /* @__PURE__ */ m("div", {
1358
+ className: "tp-wheel-spacer",
1359
+ style: { height: o }
1360
+ }),
1361
+ e.options.map((n) => {
1362
+ let i = n.value === e.value;
1363
+ return /* @__PURE__ */ m("button", {
1364
+ type: "button",
1365
+ role: "option",
1366
+ "aria-selected": i,
1367
+ className: `tp-wheel-item ${i ? "tp-wheel-item--selected" : ""}`.trim(),
1368
+ style: { height: t },
1369
+ onClick: () => {
1370
+ n.value !== e.value && r(e.key, n.value);
1371
+ },
1372
+ children: n.label
1373
+ }, n.value);
1374
+ }),
1375
+ /* @__PURE__ */ m("div", {
1376
+ className: "tp-wheel-spacer",
1377
+ style: { height: o }
1378
+ })
1379
+ ]
1380
+ }),
1381
+ /* @__PURE__ */ m("button", {
1382
+ type: "button",
1383
+ className: "tp-wheel-step tp-wheel-step--down",
1384
+ "aria-label": `Next ${e.key}`,
1385
+ disabled: a >= e.options.length - 1,
1386
+ onClick: () => s(1),
1387
+ children: /* @__PURE__ */ m("svg", {
1388
+ width: "12",
1389
+ height: "12",
1390
+ viewBox: "0 0 12 12",
1391
+ fill: "none",
1392
+ "aria-hidden": "true",
1393
+ children: /* @__PURE__ */ m("path", {
1394
+ d: "M3 4.5L6 7.5L9 4.5",
1395
+ stroke: "currentColor",
1396
+ strokeWidth: "1.5",
1397
+ strokeLinecap: "round",
1398
+ strokeLinejoin: "round"
1399
+ })
1400
+ })
1401
+ })
1402
+ ]
1403
+ });
1404
+ }, q = ({ columns: e, onChange: t, itemHeight: n = 40, visibleItems: r = 5, className: i = "", style: a }) => {
1405
+ let o = Math.floor(r / 2) * n;
1406
+ return /* @__PURE__ */ h("div", {
1407
+ className: `tp-wheel-picker ${i}`.trim(),
1408
+ style: {
1409
+ height: r * n,
1410
+ ...a
1411
+ },
1412
+ children: [/* @__PURE__ */ m("div", {
1413
+ className: "tp-wheel-highlight",
1414
+ style: {
1415
+ top: o,
1416
+ height: n
1417
+ },
1418
+ "aria-hidden": "true"
1419
+ }), /* @__PURE__ */ m("div", {
1420
+ className: "tp-wheel-columns",
1421
+ children: e.map((e) => /* @__PURE__ */ m(K, {
1422
+ column: e,
1423
+ itemHeight: n,
1424
+ visibleItems: r,
1425
+ onChange: t
1426
+ }, e.key))
1427
+ })]
1428
+ });
1429
+ };
1430
+ // src/core/components/TPDatePicker.tsx
1431
+ function J(e, t) {
1432
+ return new Date(e, t, 0).getDate();
1433
+ }
1434
+ function Y(e, t, n) {
1435
+ return Math.min(n, Math.max(t, e));
1436
+ }
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 }) => {
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(() => {
1439
+ let e = [];
1440
+ for (let t = n; t <= r; t++) e.push({
1441
+ value: String(t),
1442
+ label: String(t)
1443
+ });
1444
+ let t = Array.from({ length: 12 }, (e, t) => {
1445
+ let n = t + 1;
1446
+ return {
1447
+ value: String(n),
1448
+ label: String(n).padStart(2, "0")
1449
+ };
1450
+ }), i = Array.from({ length: b }, (e, t) => {
1451
+ let n = t + 1;
1452
+ return {
1453
+ value: String(n),
1454
+ label: String(n).padStart(2, "0")
1455
+ };
1456
+ });
1457
+ return [
1458
+ {
1459
+ key: "year",
1460
+ options: e,
1461
+ value: String(v)
1462
+ },
1463
+ {
1464
+ key: "month",
1465
+ options: t,
1466
+ value: String(y)
1467
+ },
1468
+ {
1469
+ key: "day",
1470
+ options: i,
1471
+ value: String(x)
1472
+ }
1473
+ ];
1474
+ }, [
1475
+ n,
1476
+ r,
1477
+ b,
1478
+ v,
1479
+ y,
1480
+ x
1481
+ ]), C = (e, t) => {
1482
+ let a = Number(t);
1483
+ if (Number.isNaN(a)) return;
1484
+ let o = v, s = y, c = x;
1485
+ e === "year" && (o = Y(a, n, r)), e === "month" && (s = a), e === "day" && (c = a);
1486
+ let l = Math.min(c, J(o, s)), u = new Date(o, s - 1, l);
1487
+ g || p(u), i?.(u);
1488
+ }, w = s !== void 0 || o !== void 0 || a !== void 0;
1489
+ return /* @__PURE__ */ h("div", {
1490
+ className: `tp-date-picker ${c}`.trim(),
1491
+ style: l,
1492
+ children: [w && /* @__PURE__ */ h("div", {
1493
+ className: "tp-date-picker-header",
1494
+ children: [
1495
+ o ? /* @__PURE__ */ m("button", {
1496
+ type: "button",
1497
+ className: "tp-date-picker-btn",
1498
+ onClick: o,
1499
+ children: "Cancel"
1500
+ }) : /* @__PURE__ */ m("span", {}),
1501
+ s !== void 0 && /* @__PURE__ */ m("div", {
1502
+ className: "tp-date-picker-title",
1503
+ children: s
1504
+ }),
1505
+ a ? /* @__PURE__ */ m("button", {
1506
+ type: "button",
1507
+ className: "tp-date-picker-btn tp-date-picker-btn--confirm",
1508
+ onClick: () => a(new Date(v, y - 1, x)),
1509
+ children: "Confirm"
1510
+ }) : /* @__PURE__ */ m("span", {})
1511
+ ]
1512
+ }), /* @__PURE__ */ m(q, {
1513
+ columns: S,
1514
+ onChange: C
1515
+ })]
1516
+ });
1517
+ };
1518
+ // src/core/components/TPTimePicker.tsx
1519
+ function X(e, t) {
1520
+ let n = e.hour, r = e.period;
1521
+ return t ? (r ||= n >= 12 ? "PM" : "AM", n === 0 ? n = 12 : n > 12 && (n -= 12), {
1522
+ hour: Math.min(12, Math.max(1, n)),
1523
+ minute: Math.min(59, Math.max(0, e.minute)),
1524
+ period: r
1525
+ }) : {
1526
+ hour: Math.min(23, Math.max(0, n)),
1527
+ minute: Math.min(59, Math.max(0, e.minute))
1528
+ };
1529
+ }
1530
+ var ne = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, className: i = "", style: a }) => {
1531
+ let [o, s] = f(() => X({
1532
+ hour: 9,
1533
+ minute: 0,
1534
+ period: "AM"
1535
+ }, t)), c = e !== void 0, l = X(c ? e : o, t), d = Math.max(1, n), p = u(() => {
1536
+ let e = [];
1537
+ for (let t = 0; t < 60; t += d) e.push({
1538
+ value: String(t),
1539
+ label: String(t).padStart(2, "0")
1540
+ });
1541
+ return e;
1542
+ }, [d]), h = u(() => {
1543
+ let e = Number(p[0]?.value ?? 0), t = Math.abs(l.minute - e);
1544
+ for (let n of p) {
1545
+ let r = Number(n.value), i = Math.abs(l.minute - r);
1546
+ i < t && (e = r, t = i);
1547
+ }
1548
+ return e;
1549
+ }, [l.minute, p]), g = u(() => {
1550
+ let e = [{
1551
+ key: "hour",
1552
+ options: t ? Array.from({ length: 12 }, (e, t) => {
1553
+ let n = t + 1;
1554
+ return {
1555
+ value: String(n),
1556
+ label: String(n).padStart(2, "0")
1557
+ };
1558
+ }) : Array.from({ length: 24 }, (e, t) => ({
1559
+ value: String(t),
1560
+ label: String(t).padStart(2, "0")
1561
+ })),
1562
+ value: String(l.hour)
1563
+ }, {
1564
+ key: "minute",
1565
+ options: p,
1566
+ value: String(h)
1567
+ }];
1568
+ return t && e.push({
1569
+ key: "period",
1570
+ options: [{
1571
+ value: "AM",
1572
+ label: "AM"
1573
+ }, {
1574
+ value: "PM",
1575
+ label: "PM"
1576
+ }],
1577
+ value: l.period ?? "AM"
1578
+ }), e;
1579
+ }, [
1580
+ t,
1581
+ l.hour,
1582
+ l.period,
1583
+ p,
1584
+ h
1585
+ ]);
1586
+ return /* @__PURE__ */ m("div", {
1587
+ className: `tp-time-picker ${i}`.trim(),
1588
+ style: a,
1589
+ children: /* @__PURE__ */ m(q, {
1590
+ columns: g,
1591
+ onChange: (e, n) => {
1592
+ let i = {
1593
+ hour: l.hour,
1594
+ minute: h,
1595
+ ...t ? { period: l.period ?? "AM" } : {}
1596
+ };
1597
+ e === "hour" ? i.hour = Number(n) : e === "minute" ? i.minute = Number(n) : e === "period" && (n === "AM" || n === "PM") && (i.period = n), c || s(i), r?.(i);
1598
+ }
1599
+ })
1600
+ });
1601
+ }, Z = [
1602
+ {
1603
+ key: "sun",
1604
+ en: "S",
1605
+ zh: "日",
1606
+ enTitle: "Sunday",
1607
+ zhTitle: "周日"
1608
+ },
1609
+ {
1610
+ key: "mon",
1611
+ en: "M",
1612
+ zh: "一",
1613
+ enTitle: "Monday",
1614
+ zhTitle: "周一"
1615
+ },
1616
+ {
1617
+ key: "tue",
1618
+ en: "T",
1619
+ zh: "二",
1620
+ enTitle: "Tuesday",
1621
+ zhTitle: "周二"
1622
+ },
1623
+ {
1624
+ key: "wed",
1625
+ en: "W",
1626
+ zh: "三",
1627
+ enTitle: "Wednesday",
1628
+ zhTitle: "周三"
1629
+ },
1630
+ {
1631
+ key: "thu",
1632
+ en: "T",
1633
+ zh: "四",
1634
+ enTitle: "Thursday",
1635
+ zhTitle: "周四"
1636
+ },
1637
+ {
1638
+ key: "fri",
1639
+ en: "F",
1640
+ zh: "五",
1641
+ enTitle: "Friday",
1642
+ zhTitle: "周五"
1643
+ },
1644
+ {
1645
+ key: "sat",
1646
+ en: "S",
1647
+ zh: "六",
1648
+ enTitle: "Saturday",
1649
+ zhTitle: "周六"
1650
+ }
1651
+ ], re = ({ value: e, defaultValue: t = [], onChange: n, disabled: r = !1, locale: i = "en", className: a = "", style: o }) => {
1652
+ let [s, c] = f(t), l = e !== void 0, u = l ? e : s, d = (e) => {
1653
+ if (r) return;
1654
+ let t = new Set(u);
1655
+ t.has(e) ? t.delete(e) : t.add(e);
1656
+ let i = Z.map((e) => e.key).filter((e) => t.has(e));
1657
+ l || c(i), n?.(i);
1658
+ }, p = [
1659
+ "tp-day-switcher",
1660
+ r ? "tp-day-switcher--disabled" : "",
1661
+ a
1662
+ ].filter(Boolean).join(" ");
1663
+ return /* @__PURE__ */ m("div", {
1664
+ className: p,
1665
+ style: o,
1666
+ role: "group",
1667
+ "aria-label": "Days of week",
1668
+ children: Z.map((e) => {
1669
+ let t = u.includes(e.key), n = i === "zh" ? e.zh : e.en, a = i === "zh" ? e.zhTitle : e.enTitle;
1670
+ return /* @__PURE__ */ m("button", {
1671
+ type: "button",
1672
+ "data-day": e.key,
1673
+ title: a,
1674
+ disabled: r,
1675
+ "aria-pressed": t,
1676
+ className: `tp-day-switcher-btn ${t ? "tp-day-switcher-btn--selected" : ""}`.trim(),
1677
+ onClick: () => d(e.key),
1678
+ children: n
1679
+ }, e.key);
1680
+ })
1681
+ });
1682
+ }, ie = [
1683
+ "1",
1684
+ "2",
1685
+ "3",
1686
+ "4",
1687
+ "5",
1688
+ "6",
1689
+ "7",
1690
+ "8",
1691
+ "9"
1692
+ ], ae = [
1693
+ "A",
1694
+ "B",
1695
+ "C",
1696
+ "D",
1697
+ "E",
1698
+ "F"
1699
+ ], oe = ({ mode: e = "numeric", onKeyPress: t, onBackspace: n, onDone: r, doneLabel: i = "Done", showDot: a = !1, showDash: o, className: s = "", style: c }) => {
1700
+ let l = o ?? e === "mac-hex", u = a && l, d = u ? null : a ? "." : l ? "-" : null, f = [
1701
+ "tp-keyboard",
1702
+ `tp-keyboard--${e}`,
1703
+ s
1704
+ ].filter(Boolean).join(" ");
1705
+ return /* @__PURE__ */ h("div", {
1706
+ className: f,
1707
+ style: c,
1708
+ role: "group",
1709
+ "aria-label": "Keypad",
1710
+ children: [
1711
+ e === "mac-hex" && /* @__PURE__ */ m("div", {
1712
+ className: "tp-keyboard-hex-row",
1713
+ children: ae.map((e) => /* @__PURE__ */ m("button", {
1714
+ type: "button",
1715
+ className: "tp-keyboard-key tp-keyboard-key--hex",
1716
+ onClick: () => t?.(e),
1717
+ children: e
1718
+ }, e))
1719
+ }),
1720
+ u && /* @__PURE__ */ h("div", {
1721
+ className: "tp-keyboard-aux-row",
1722
+ children: [/* @__PURE__ */ m("button", {
1723
+ type: "button",
1724
+ className: "tp-keyboard-key tp-keyboard-key--action",
1725
+ onClick: () => t?.("."),
1726
+ children: "."
1727
+ }), /* @__PURE__ */ m("button", {
1728
+ type: "button",
1729
+ className: "tp-keyboard-key tp-keyboard-key--action",
1730
+ onClick: () => t?.("-"),
1731
+ children: "-"
1732
+ })]
1733
+ }),
1734
+ /* @__PURE__ */ h("div", {
1735
+ className: "tp-keyboard-grid",
1736
+ children: [
1737
+ ie.map((e) => /* @__PURE__ */ m("button", {
1738
+ type: "button",
1739
+ className: "tp-keyboard-key",
1740
+ onClick: () => t?.(e),
1741
+ children: e
1742
+ }, e)),
1743
+ d ? /* @__PURE__ */ m("button", {
1744
+ type: "button",
1745
+ className: "tp-keyboard-key tp-keyboard-key--action",
1746
+ onClick: () => t?.(d),
1747
+ children: d
1748
+ }) : /* @__PURE__ */ m("div", {
1749
+ className: "tp-keyboard-spacer",
1750
+ "aria-hidden": "true"
1751
+ }),
1752
+ /* @__PURE__ */ m("button", {
1753
+ type: "button",
1754
+ className: "tp-keyboard-key",
1755
+ onClick: () => t?.("0"),
1756
+ children: "0"
1757
+ }),
1758
+ /* @__PURE__ */ m("button", {
1759
+ type: "button",
1760
+ className: "tp-keyboard-key tp-keyboard-key--action",
1761
+ "aria-label": "Backspace",
1762
+ onClick: n,
1763
+ children: /* @__PURE__ */ h("svg", {
1764
+ width: "22",
1765
+ height: "18",
1766
+ viewBox: "0 0 22 18",
1767
+ fill: "none",
1768
+ "aria-hidden": "true",
1769
+ children: [/* @__PURE__ */ m("path", {
1770
+ d: "M8.2 2H19C19.8 2 20.5 2.7 20.5 3.5V14.5C20.5 15.3 19.8 16 19 16H8.2C7.7 16 7.2 15.8 6.9 15.4L2.1 9.6C1.8 9.3 1.8 8.7 2.1 8.4L6.9 2.6C7.2 2.2 7.7 2 8.2 2Z",
1771
+ stroke: "currentColor",
1772
+ strokeWidth: "1.5",
1773
+ strokeLinejoin: "round"
1774
+ }), /* @__PURE__ */ m("path", {
1775
+ d: "M11 6.3L16 11.3M16 6.3L11 11.3",
1776
+ stroke: "currentColor",
1777
+ strokeWidth: "1.5",
1778
+ strokeLinecap: "round"
1779
+ })]
1780
+ })
1781
+ })
1782
+ ]
1783
+ }),
1784
+ /* @__PURE__ */ m("button", {
1785
+ type: "button",
1786
+ className: "tp-keyboard-key tp-keyboard-key--done",
1787
+ onClick: r,
1788
+ children: i
1789
+ })
1790
+ ]
1791
+ });
1792
+ }, se = ({ open: t, title: n, message: r, actions: i, os: a, inputPlaceholder: o, defaultInputValue: s = "", onClose: u, children: d }) => {
1793
+ let p = e(), g = a ?? p.os, _ = l(), v = l(), [y, b] = f(s);
1794
+ if (c(() => {
1795
+ t && b(s);
1796
+ }, [t, s]), c(() => {
1797
+ if (!t || !u) return;
1798
+ let e = (e) => {
1799
+ e.key === "Escape" && u();
1800
+ };
1801
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1802
+ }, [t, u]), !t) return null;
1803
+ let x = o !== void 0, S = (e) => {
1804
+ x ? e.onClick?.(y) : e.onClick?.(), u?.();
1805
+ }, C = g === "ios" ? i.length === 2 ? "tp-alert-actions--row" : "tp-alert-actions--col" : "";
1806
+ return /* @__PURE__ */ m("div", {
1807
+ className: "tp-overlay tp-alert-backdrop",
1808
+ "data-tp-os": g,
1809
+ onClick: () => u?.(),
1810
+ children: /* @__PURE__ */ h("div", {
1811
+ role: "alertdialog",
1812
+ "aria-modal": "true",
1813
+ "aria-labelledby": n ? _ : void 0,
1814
+ "aria-describedby": r ? v : void 0,
1815
+ "data-os": g,
1816
+ className: `tp-alert tp-alert--${g}`,
1817
+ onClick: (e) => e.stopPropagation(),
1818
+ children: [/* @__PURE__ */ h("div", {
1819
+ className: "tp-alert-content",
1820
+ children: [
1821
+ n !== void 0 && /* @__PURE__ */ m("div", {
1822
+ id: _,
1823
+ className: "tp-alert-title",
1824
+ children: n
1825
+ }),
1826
+ r !== void 0 && /* @__PURE__ */ m("div", {
1827
+ id: v,
1828
+ className: "tp-alert-message",
1829
+ children: r
1830
+ }),
1831
+ d !== void 0 && /* @__PURE__ */ m("div", {
1832
+ className: "tp-alert-body",
1833
+ children: d
1834
+ }),
1835
+ x && /* @__PURE__ */ m("div", {
1836
+ className: "tp-alert-input-wrap",
1837
+ children: /* @__PURE__ */ m("input", {
1838
+ type: "text",
1839
+ className: "tp-alert-input",
1840
+ placeholder: o,
1841
+ value: y,
1842
+ onChange: (e) => b(e.target.value),
1843
+ autoFocus: !0
1844
+ })
1845
+ })
1846
+ ]
1847
+ }), /* @__PURE__ */ m("div", {
1848
+ className: `tp-alert-actions tp-alert-actions--${g} ${C}`.trim(),
1849
+ children: i.map((e, t) => {
1850
+ let n = e.role ?? "default";
1851
+ return /* @__PURE__ */ m("button", {
1852
+ type: "button",
1853
+ "data-role": n,
1854
+ className: `tp-alert-action tp-alert-action--${n}`,
1855
+ onClick: () => S(e),
1856
+ children: e.label
1857
+ }, `${e.label}-${t}`);
1858
+ })
1859
+ })]
1860
+ })
1861
+ });
1862
+ }, ce = () => /* @__PURE__ */ m("svg", {
1863
+ width: "18",
1864
+ height: "18",
1865
+ viewBox: "0 0 24 24",
1866
+ fill: "none",
1867
+ "aria-hidden": "true",
1868
+ children: /* @__PURE__ */ m("path", {
1869
+ d: "M5 12.5L9.8 17L19 7.5",
1870
+ stroke: "currentColor",
1871
+ strokeWidth: "2.2",
1872
+ strokeLinecap: "round",
1873
+ strokeLinejoin: "round"
1874
+ })
1875
+ }), le = ({ open: t, title: n, message: r, options: i, cancelText: a = "Cancel", os: o, onSelect: s, onClose: u }) => {
1876
+ let d = e(), f = o ?? d.os, p = l();
1877
+ if (c(() => {
1878
+ if (!t) return;
1879
+ let e = (e) => {
1880
+ e.key === "Escape" && u();
1881
+ };
1882
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1883
+ }, [t, u]), !t) return null;
1884
+ let g = i.some((e) => e.icon !== void 0 || e.description !== void 0 || e.selected !== void 0), _ = (e) => {
1885
+ e.disabled || (s(e), u());
1886
+ };
1887
+ return /* @__PURE__ */ m("div", {
1888
+ className: "tp-overlay tp-actionsheet-backdrop",
1889
+ "data-tp-os": f,
1890
+ onClick: u,
1891
+ children: /* @__PURE__ */ h("div", {
1892
+ role: "dialog",
1893
+ "aria-modal": "true",
1894
+ "aria-labelledby": n ? p : void 0,
1895
+ "data-os": f,
1896
+ className: `tp-actionsheet tp-actionsheet--${f}`,
1897
+ onClick: (e) => e.stopPropagation(),
1898
+ children: [/* @__PURE__ */ h("div", {
1899
+ className: "tp-actionsheet-group",
1900
+ children: [(n !== void 0 || r !== void 0) && /* @__PURE__ */ h("div", {
1901
+ className: "tp-actionsheet-header",
1902
+ children: [n !== void 0 && /* @__PURE__ */ m("div", {
1903
+ id: p,
1904
+ className: "tp-actionsheet-title",
1905
+ children: n
1906
+ }), r !== void 0 && /* @__PURE__ */ m("div", {
1907
+ className: "tp-actionsheet-message",
1908
+ children: r
1909
+ })]
1910
+ }), /* @__PURE__ */ m("div", {
1911
+ className: "tp-actionsheet-options",
1912
+ children: i.map((e) => {
1913
+ let t = [
1914
+ "tp-actionsheet-option",
1915
+ g ? "tp-actionsheet-option--rich" : "",
1916
+ e.destructive ? "tp-actionsheet-option--destructive" : "",
1917
+ e.disabled ? "tp-actionsheet-option--disabled" : "",
1918
+ e.selected ? "tp-actionsheet-option--selected" : ""
1919
+ ].filter(Boolean).join(" ");
1920
+ return /* @__PURE__ */ h("button", {
1921
+ type: "button",
1922
+ className: t,
1923
+ disabled: e.disabled,
1924
+ "aria-disabled": e.disabled || void 0,
1925
+ onClick: () => _(e),
1926
+ children: [
1927
+ e.icon !== void 0 && /* @__PURE__ */ m("span", {
1928
+ className: "tp-actionsheet-option-icon",
1929
+ children: e.icon
1930
+ }),
1931
+ /* @__PURE__ */ h("span", {
1932
+ className: "tp-actionsheet-option-text",
1933
+ children: [/* @__PURE__ */ m("span", {
1934
+ className: "tp-actionsheet-option-label",
1935
+ children: e.label
1936
+ }), e.description !== void 0 && /* @__PURE__ */ m("span", {
1937
+ className: "tp-actionsheet-option-desc",
1938
+ children: e.description
1939
+ })]
1940
+ }),
1941
+ e.selected && /* @__PURE__ */ m("span", {
1942
+ className: "tp-actionsheet-option-check",
1943
+ children: /* @__PURE__ */ m(ce, {})
1944
+ })
1945
+ ]
1946
+ }, e.key);
1947
+ })
1948
+ })]
1949
+ }), a !== "" && (f === "ios" ? /* @__PURE__ */ m("div", {
1950
+ className: "tp-actionsheet-cancel-card",
1951
+ children: /* @__PURE__ */ m("button", {
1952
+ type: "button",
1953
+ className: "tp-actionsheet-cancel",
1954
+ onClick: u,
1955
+ children: a
1956
+ })
1957
+ }) : /* @__PURE__ */ m("div", {
1958
+ className: "tp-actionsheet-cancel-row",
1959
+ children: /* @__PURE__ */ m("button", {
1960
+ type: "button",
1961
+ className: "tp-actionsheet-cancel",
1962
+ onClick: u,
1963
+ children: a
1964
+ })
1965
+ }))]
1966
+ })
1967
+ });
1968
+ }, ue = () => /* @__PURE__ */ m("svg", {
1969
+ width: "14",
1970
+ height: "14",
1971
+ viewBox: "0 0 16 16",
1972
+ fill: "none",
1973
+ "aria-hidden": "true",
1974
+ children: /* @__PURE__ */ m("path", {
1975
+ d: "M4 4L12 12M12 4L4 12",
1976
+ stroke: "currentColor",
1977
+ strokeWidth: "1.8",
1978
+ strokeLinecap: "round"
1979
+ })
1980
+ }), de = ({ open: e, title: t, subtitle: n, onClose: r, showCloseButton: i, showGrabber: a = !0, footer: o, maxHeight: s = "85%", children: u }) => {
1981
+ let d = l();
1982
+ if (c(() => {
1983
+ if (!e) return;
1984
+ let t = (e) => {
1985
+ e.key === "Escape" && r();
1986
+ };
1987
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
1988
+ }, [e, r]), !e) return null;
1989
+ let f = t !== void 0 || n !== void 0, p = i ?? f, g = f || p, _ = typeof s == "number" ? `${s}px` : s;
1990
+ return /* @__PURE__ */ m("div", {
1991
+ className: "tp-overlay tp-bottomsheet-backdrop",
1992
+ onClick: r,
1993
+ children: /* @__PURE__ */ h("div", {
1994
+ role: "dialog",
1995
+ "aria-modal": "true",
1996
+ "aria-labelledby": t ? d : void 0,
1997
+ className: "tp-bottomsheet",
1998
+ style: { maxHeight: _ },
1999
+ onClick: (e) => e.stopPropagation(),
2000
+ children: [
2001
+ a && /* @__PURE__ */ m("div", {
2002
+ className: "tp-bottomsheet-grabber-wrap",
2003
+ "aria-hidden": "true",
2004
+ children: /* @__PURE__ */ m("span", { className: "tp-bottomsheet-grabber" })
2005
+ }),
2006
+ g && /* @__PURE__ */ h("div", {
2007
+ className: "tp-bottomsheet-header",
2008
+ children: [/* @__PURE__ */ h("div", {
2009
+ className: "tp-bottomsheet-heading",
2010
+ children: [t !== void 0 && /* @__PURE__ */ m("div", {
2011
+ id: d,
2012
+ className: "tp-bottomsheet-title",
2013
+ children: t
2014
+ }), n !== void 0 && /* @__PURE__ */ m("div", {
2015
+ className: "tp-bottomsheet-subtitle",
2016
+ children: n
2017
+ })]
2018
+ }), p && /* @__PURE__ */ m("button", {
2019
+ type: "button",
2020
+ className: "tp-bottomsheet-close",
2021
+ "aria-label": "Close",
2022
+ onClick: r,
2023
+ children: /* @__PURE__ */ m(ue, {})
2024
+ })]
2025
+ }),
2026
+ /* @__PURE__ */ m("div", {
2027
+ className: "tp-bottomsheet-body",
2028
+ children: u
2029
+ }),
2030
+ o !== void 0 && /* @__PURE__ */ m("div", {
2031
+ className: "tp-bottomsheet-footer",
2032
+ children: o
2033
+ })
2034
+ ]
2035
+ })
2036
+ });
2037
+ }, fe = () => /* @__PURE__ */ m("svg", {
2038
+ width: "14",
2039
+ height: "14",
2040
+ viewBox: "0 0 16 16",
2041
+ fill: "none",
2042
+ "aria-hidden": "true",
2043
+ children: /* @__PURE__ */ m("path", {
2044
+ d: "M4 4L12 12M12 4L4 12",
2045
+ stroke: "currentColor",
2046
+ strokeWidth: "1.8",
2047
+ strokeLinecap: "round"
2048
+ })
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 }) => {
2050
+ let f = l();
2051
+ if (c(() => {
2052
+ if (!e) return;
2053
+ let t = (e) => {
2054
+ e.key === "Escape" && (i || r) && a();
2055
+ };
2056
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
2057
+ }, [
2058
+ e,
2059
+ i,
2060
+ r,
2061
+ a
2062
+ ]), !e) return null;
2063
+ let p = n !== void 0 || r;
2064
+ return /* @__PURE__ */ m("div", {
2065
+ className: `tp-overlay tp-popup-backdrop--${t}`,
2066
+ onClick: () => {
2067
+ i && a();
2068
+ },
2069
+ children: /* @__PURE__ */ h("div", {
2070
+ role: "dialog",
2071
+ "aria-modal": "true",
2072
+ "aria-labelledby": n ? f : void 0,
2073
+ "data-placement": t,
2074
+ className: `tp-popup tp-popup--${t} ${s}`.trim(),
2075
+ style: u,
2076
+ onClick: (e) => e.stopPropagation(),
2077
+ children: [
2078
+ p && /* @__PURE__ */ h("div", {
2079
+ className: "tp-popup-header",
2080
+ children: [n === void 0 ? /* @__PURE__ */ m("span", {}) : /* @__PURE__ */ m("div", {
2081
+ id: f,
2082
+ className: "tp-popup-title",
2083
+ children: n
2084
+ }), r && /* @__PURE__ */ m("button", {
2085
+ type: "button",
2086
+ className: "tp-popup-close",
2087
+ "aria-label": "Close",
2088
+ onClick: a,
2089
+ children: /* @__PURE__ */ m(fe, {})
2090
+ })]
2091
+ }),
2092
+ /* @__PURE__ */ m("div", {
2093
+ className: "tp-popup-body",
2094
+ children: d
2095
+ }),
2096
+ o !== void 0 && /* @__PURE__ */ m("div", {
2097
+ className: "tp-popup-footer",
2098
+ children: o
2099
+ })
2100
+ ]
2101
+ })
2102
+ });
2103
+ }, me = () => /* @__PURE__ */ m("svg", {
2104
+ width: "16",
2105
+ height: "16",
2106
+ viewBox: "0 0 24 24",
2107
+ fill: "none",
2108
+ "aria-hidden": "true",
2109
+ children: /* @__PURE__ */ m("path", {
2110
+ d: "M5 12.5L9.8 17L19 7.5",
2111
+ stroke: "currentColor",
2112
+ strokeWidth: "2.2",
2113
+ strokeLinecap: "round",
2114
+ strokeLinejoin: "round"
2115
+ })
2116
+ }), he = ({ open: e, items: t, onSelect: n, onClose: r, align: a = "left", className: o = "", style: s }) => {
2117
+ let l = d(null);
2118
+ if (c(() => {
2119
+ if (!e) return;
2120
+ let t = !1, n = (e) => {
2121
+ e.key === "Escape" && r();
2122
+ }, i = (e) => {
2123
+ let n = e.target;
2124
+ l.current && n && !l.current.contains(n) && (t = !0, r());
2125
+ }, a = (e) => {
2126
+ if (t) {
2127
+ t = !1;
2128
+ return;
2129
+ }
2130
+ let n = e.target;
2131
+ l.current && n && !l.current.contains(n) && r();
2132
+ };
2133
+ return document.addEventListener("keydown", n), document.addEventListener("mousedown", i), document.addEventListener("click", a), () => {
2134
+ document.removeEventListener("keydown", n), document.removeEventListener("mousedown", i), document.removeEventListener("click", a);
2135
+ };
2136
+ }, [e, r]), !e) return null;
2137
+ let u = (e) => {
2138
+ e.disabled || (n(e), r());
2139
+ };
2140
+ return /* @__PURE__ */ m("div", {
2141
+ ref: l,
2142
+ role: "menu",
2143
+ "data-align": a,
2144
+ className: `tp-menu tp-menu--align-${a} ${o}`.trim(),
2145
+ style: s,
2146
+ onClick: (e) => e.stopPropagation(),
2147
+ children: t.map((e) => {
2148
+ let t = [
2149
+ "tp-menu-item",
2150
+ e.selected ? "tp-menu-item--selected" : "",
2151
+ e.danger ? "tp-menu-item--danger" : "",
2152
+ e.disabled ? "tp-menu-item--disabled" : ""
2153
+ ].filter(Boolean).join(" ");
2154
+ return /* @__PURE__ */ h(i.Fragment, { children: [e.dividerBefore && /* @__PURE__ */ m("div", {
2155
+ className: "tp-menu-divider",
2156
+ role: "separator"
2157
+ }), /* @__PURE__ */ h("button", {
2158
+ type: "button",
2159
+ role: "menuitem",
2160
+ "data-selected": e.selected ? "true" : void 0,
2161
+ className: t,
2162
+ disabled: e.disabled,
2163
+ "aria-disabled": e.disabled || void 0,
2164
+ onClick: () => u(e),
2165
+ children: [
2166
+ e.icon !== void 0 && /* @__PURE__ */ m("span", {
2167
+ className: "tp-menu-item-icon",
2168
+ children: e.icon
2169
+ }),
2170
+ /* @__PURE__ */ m("span", {
2171
+ className: "tp-menu-item-label",
2172
+ children: e.label
2173
+ }),
2174
+ e.selected && /* @__PURE__ */ m("span", {
2175
+ className: "tp-menu-item-check",
2176
+ "aria-label": "selected",
2177
+ children: /* @__PURE__ */ m(me, {})
2178
+ })
2179
+ ]
2180
+ })] }, e.key);
2181
+ })
2182
+ });
2183
+ }, ge = ({ type: e }) => {
2184
+ switch (e) {
2185
+ case "info": return /* @__PURE__ */ h("svg", {
2186
+ width: "18",
2187
+ height: "18",
2188
+ viewBox: "0 0 24 24",
2189
+ fill: "none",
2190
+ "aria-hidden": "true",
2191
+ children: [
2192
+ /* @__PURE__ */ m("circle", {
2193
+ cx: "12",
2194
+ cy: "12",
2195
+ r: "9.5",
2196
+ stroke: "currentColor",
2197
+ strokeWidth: "1.6"
2198
+ }),
2199
+ /* @__PURE__ */ m("rect", {
2200
+ x: "11.2",
2201
+ y: "7.8",
2202
+ width: "1.6",
2203
+ height: "1.6",
2204
+ rx: "0.4",
2205
+ fill: "currentColor"
2206
+ }),
2207
+ /* @__PURE__ */ m("rect", {
2208
+ x: "11.2",
2209
+ y: "10.8",
2210
+ width: "1.6",
2211
+ height: "5.8",
2212
+ rx: "0.4",
2213
+ fill: "currentColor"
2214
+ })
2215
+ ]
2216
+ });
2217
+ case "success": return /* @__PURE__ */ h("svg", {
2218
+ width: "18",
2219
+ height: "18",
2220
+ viewBox: "0 0 24 24",
2221
+ fill: "none",
2222
+ "aria-hidden": "true",
2223
+ children: [/* @__PURE__ */ m("circle", {
2224
+ cx: "12",
2225
+ cy: "12",
2226
+ r: "9.5",
2227
+ stroke: "currentColor",
2228
+ strokeWidth: "1.6"
2229
+ }), /* @__PURE__ */ m("path", {
2230
+ d: "M8 12.2L10.8 15L16 9.5",
2231
+ stroke: "currentColor",
2232
+ strokeWidth: "1.8",
2233
+ strokeLinecap: "round",
2234
+ strokeLinejoin: "round"
2235
+ })]
2236
+ });
2237
+ case "warning": return /* @__PURE__ */ h("svg", {
2238
+ width: "18",
2239
+ height: "18",
2240
+ viewBox: "0 0 24 24",
2241
+ fill: "none",
2242
+ "aria-hidden": "true",
2243
+ children: [
2244
+ /* @__PURE__ */ m("circle", {
2245
+ cx: "12",
2246
+ cy: "12",
2247
+ r: "9.5",
2248
+ stroke: "currentColor",
2249
+ strokeWidth: "1.6"
2250
+ }),
2251
+ /* @__PURE__ */ m("rect", {
2252
+ x: "11.2",
2253
+ y: "7.5",
2254
+ width: "1.6",
2255
+ height: "5.8",
2256
+ rx: "0.4",
2257
+ fill: "currentColor"
2258
+ }),
2259
+ /* @__PURE__ */ m("rect", {
2260
+ x: "11.2",
2261
+ y: "14.8",
2262
+ width: "1.6",
2263
+ height: "1.6",
2264
+ rx: "0.4",
2265
+ fill: "currentColor"
2266
+ })
2267
+ ]
2268
+ });
2269
+ case "error": return /* @__PURE__ */ h("svg", {
2270
+ width: "18",
2271
+ height: "18",
2272
+ viewBox: "0 0 24 24",
2273
+ fill: "none",
2274
+ "aria-hidden": "true",
2275
+ children: [/* @__PURE__ */ m("circle", {
2276
+ cx: "12",
2277
+ cy: "12",
2278
+ r: "9.5",
2279
+ stroke: "currentColor",
2280
+ strokeWidth: "1.6"
2281
+ }), /* @__PURE__ */ m("path", {
2282
+ d: "M9 9L15 15M15 9L9 15",
2283
+ stroke: "currentColor",
2284
+ strokeWidth: "1.8",
2285
+ strokeLinecap: "round"
2286
+ })]
2287
+ });
2288
+ case "loading": return /* @__PURE__ */ h("svg", {
2289
+ width: "18",
2290
+ height: "18",
2291
+ viewBox: "0 0 24 24",
2292
+ fill: "none",
2293
+ className: "tp-toast-spinner",
2294
+ "aria-hidden": "true",
2295
+ children: [/* @__PURE__ */ m("circle", {
2296
+ cx: "12",
2297
+ cy: "12",
2298
+ r: "9",
2299
+ stroke: "currentColor",
2300
+ strokeOpacity: "0.28",
2301
+ strokeWidth: "2.2"
2302
+ }), /* @__PURE__ */ m("path", {
2303
+ d: "M12 3A9 9 0 0 1 21 12",
2304
+ stroke: "currentColor",
2305
+ strokeWidth: "2.2",
2306
+ strokeLinecap: "round"
2307
+ })]
2308
+ });
2309
+ default: return null;
2310
+ }
2311
+ }, Q = ({ open: e = !0, type: t = "default", message: n, duration: r, position: i = "center", onClose: a, className: o = "", style: s }) => {
2312
+ let l = r ?? (t === "loading" ? 0 : 2500);
2313
+ if (c(() => {
2314
+ if (!e || !a || l <= 0) return;
2315
+ let t = setTimeout(() => {
2316
+ a();
2317
+ }, l);
2318
+ return () => clearTimeout(t);
2319
+ }, [
2320
+ e,
2321
+ l,
2322
+ a
2323
+ ]), !e) return null;
2324
+ let u = /* @__PURE__ */ m(ge, { type: t });
2325
+ return /* @__PURE__ */ m("div", {
2326
+ className: `tp-toast-container tp-toast-container--${i}`,
2327
+ children: /* @__PURE__ */ h("div", {
2328
+ role: t === "error" ? "alert" : "status",
2329
+ "aria-live": t === "error" ? "assertive" : "polite",
2330
+ "data-type": t,
2331
+ className: `tp-toast tp-toast--${t} ${o}`.trim(),
2332
+ style: s,
2333
+ children: [t !== "default" && /* @__PURE__ */ m("span", {
2334
+ className: "tp-toast-icon",
2335
+ children: u
2336
+ }), /* @__PURE__ */ m("span", {
2337
+ className: "tp-toast-message",
2338
+ children: n
2339
+ })]
2340
+ })
2341
+ });
2342
+ }, $ = a({
2343
+ show: () => {},
2344
+ dismiss: () => {}
2345
+ }), _e = ({ children: e }) => {
2346
+ let [t, n] = f(null), r = d(null), i = o(() => {
2347
+ r.current !== null && (clearTimeout(r.current), r.current = null);
2348
+ }, []), a = o(() => {
2349
+ i(), n((e) => e ? {
2350
+ ...e,
2351
+ open: !1
2352
+ } : null);
2353
+ }, [i]), s = o((e) => {
2354
+ i();
2355
+ let t = typeof e == "string" ? { message: e } : e, a = t.type ?? "default", o = t.duration ?? (a === "loading" ? 0 : 2500);
2356
+ n({
2357
+ ...t,
2358
+ type: a,
2359
+ open: !0
2360
+ }), o > 0 && (r.current = setTimeout(() => {
2361
+ r.current = null, n((e) => e ? {
2362
+ ...e,
2363
+ open: !1
2364
+ } : null), t.onClose?.();
2365
+ }, o));
2366
+ }, [i]);
2367
+ c(() => () => i(), [i]);
2368
+ let l = u(() => ({
2369
+ show: s,
2370
+ dismiss: a
2371
+ }), [s, a]);
2372
+ return /* @__PURE__ */ h($.Provider, {
2373
+ value: l,
2374
+ children: [e, t && /* @__PURE__ */ m(Q, {
2375
+ open: t.open,
2376
+ type: t.type,
2377
+ message: t.message,
2378
+ duration: 0,
2379
+ position: t.position,
2380
+ className: t.className,
2381
+ style: t.style
2382
+ })]
2383
+ });
2384
+ };
2385
+ function ve() {
2386
+ return s($);
2387
+ }
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 }) => {
3310
+ switch (e) {
3311
+ case "warning": return /* @__PURE__ */ h("svg", {
3312
+ width: "20",
3313
+ height: "20",
3314
+ viewBox: "0 0 24 24",
3315
+ fill: "none",
3316
+ "aria-hidden": "true",
3317
+ children: [
3318
+ /* @__PURE__ */ m("circle", {
3319
+ cx: "12",
3320
+ cy: "12",
3321
+ r: "9.5",
3322
+ stroke: "currentColor",
3323
+ strokeWidth: "1.5"
3324
+ }),
3325
+ /* @__PURE__ */ m("rect", {
3326
+ x: "11.25",
3327
+ y: "7.2",
3328
+ width: "1.5",
3329
+ height: "6",
3330
+ rx: "0.4",
3331
+ fill: "currentColor"
3332
+ }),
3333
+ /* @__PURE__ */ m("rect", {
3334
+ x: "11.25",
3335
+ y: "14.8",
3336
+ width: "1.5",
3337
+ height: "1.6",
3338
+ rx: "0.4",
3339
+ fill: "currentColor"
3340
+ })
3341
+ ]
3342
+ });
3343
+ case "alert": return /* @__PURE__ */ h("svg", {
3344
+ width: "20",
3345
+ height: "20",
3346
+ viewBox: "0 0 24 24",
3347
+ fill: "none",
3348
+ "aria-hidden": "true",
3349
+ children: [/* @__PURE__ */ m("circle", {
3350
+ cx: "12",
3351
+ cy: "12",
3352
+ r: "9.5",
3353
+ stroke: "currentColor",
3354
+ strokeWidth: "1.5"
3355
+ }), /* @__PURE__ */ m("path", {
3356
+ d: "M9.2 9.2L14.8 14.8M14.8 9.2L9.2 14.8",
3357
+ stroke: "currentColor",
3358
+ strokeWidth: "1.6",
3359
+ strokeLinecap: "round"
3360
+ })]
3361
+ });
3362
+ case "focus": return /* @__PURE__ */ h("svg", {
3363
+ width: "20",
3364
+ height: "20",
3365
+ viewBox: "0 0 24 24",
3366
+ fill: "none",
3367
+ "aria-hidden": "true",
3368
+ children: [/* @__PURE__ */ m("circle", {
3369
+ cx: "12",
3370
+ cy: "12",
3371
+ r: "9.5",
3372
+ stroke: "currentColor",
3373
+ strokeWidth: "1.5"
3374
+ }), /* @__PURE__ */ m("path", {
3375
+ d: "M8.5 12.2L11 14.7L15.8 9.6",
3376
+ stroke: "currentColor",
3377
+ strokeWidth: "1.7",
3378
+ strokeLinecap: "round",
3379
+ strokeLinejoin: "round"
3380
+ })]
3381
+ });
3382
+ default: return /* @__PURE__ */ h("svg", {
3383
+ width: "20",
3384
+ height: "20",
3385
+ viewBox: "0 0 24 24",
3386
+ fill: "none",
3387
+ "aria-hidden": "true",
3388
+ children: [
3389
+ /* @__PURE__ */ m("circle", {
3390
+ cx: "12",
3391
+ cy: "12",
3392
+ r: "9.5",
3393
+ stroke: "currentColor",
3394
+ strokeWidth: "1.4"
3395
+ }),
3396
+ /* @__PURE__ */ m("rect", {
3397
+ x: "11.2",
3398
+ y: "8",
3399
+ width: "1.5",
3400
+ height: "1.5",
3401
+ fill: "currentColor"
3402
+ }),
3403
+ /* @__PURE__ */ m("path", {
3404
+ d: "M11.2 11H12.7V16.5H11.2V11Z",
3405
+ fill: "currentColor"
3406
+ })
3407
+ ]
3408
+ });
3409
+ }
3410
+ }, qe = () => /* @__PURE__ */ m("svg", {
3411
+ width: "14",
3412
+ height: "14",
3413
+ viewBox: "0 0 16 16",
3414
+ fill: "none",
3415
+ "aria-hidden": "true",
3416
+ children: /* @__PURE__ */ m("path", {
3417
+ d: "M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",
3418
+ stroke: "currentColor",
3419
+ strokeWidth: "1.6",
3420
+ strokeLinecap: "round"
3421
+ })
3422
+ }), Je = ({ tone: e = "info", title: t, actionLabel: n, onAction: r, closable: i, onClose: a, icon: o, className: s = "", style: c }) => {
3423
+ let l = i ?? !!a;
3424
+ return /* @__PURE__ */ h("div", {
3425
+ role: "region",
3426
+ "data-tone": e,
3427
+ className: `tp-prompt tp-prompt--${e} ${s}`.trim(),
3428
+ style: c,
3429
+ children: [
3430
+ /* @__PURE__ */ m("span", {
3431
+ className: "tp-prompt-icon",
3432
+ children: o === void 0 ? /* @__PURE__ */ m(Ke, { tone: e }) : o
3433
+ }),
3434
+ /* @__PURE__ */ h("div", {
3435
+ className: "tp-prompt-content",
3436
+ children: [/* @__PURE__ */ m("div", {
3437
+ className: "tp-prompt-title",
3438
+ children: t
3439
+ }), n !== void 0 && /* @__PURE__ */ m("button", {
3440
+ type: "button",
3441
+ className: "tp-prompt-action",
3442
+ onClick: r,
3443
+ children: n
3444
+ })]
3445
+ }),
3446
+ l && /* @__PURE__ */ m("button", {
3447
+ type: "button",
3448
+ className: "tp-prompt-close",
3449
+ "aria-label": "Dismiss",
3450
+ onClick: a,
3451
+ children: /* @__PURE__ */ m(qe, {})
3452
+ })
3453
+ ]
3454
+ });
3455
+ };
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 };