@chenyqthu/tp-mobile-ui-kit 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/catalog.json +1339 -71
- package/dist/chunks/{OmadaAppDemo-BP4a4ch_.js → OmadaAppDemo-Dwm_iU6O.js} +2050 -1239
- package/dist/chunks/TPPrompt-6o6zUNzO.js +3748 -0
- package/dist/core.js +2 -2
- package/dist/index.js +7 -7
- package/dist/omada.js +7 -7
- package/dist/standalone.js +341 -341
- package/dist/style.css +1 -1
- package/dist/types/core/components/TPAvatar.d.ts +7 -0
- package/dist/types/core/components/TPCheckbox.d.ts +11 -0
- package/dist/types/core/components/TPDivider.d.ts +7 -0
- package/dist/types/core/components/TPFixedToast.d.ts +7 -0
- package/dist/types/core/components/TPIconButton.d.ts +11 -0
- package/dist/types/core/components/TPLast7DaysPicker.d.ts +7 -0
- package/dist/types/core/components/TPLiquidGlass.d.ts +9 -0
- package/dist/types/core/components/TPLiquidGlassBackdrop.d.ts +32 -0
- package/dist/types/core/components/TPMonthPicker.d.ts +7 -0
- package/dist/types/core/components/TPPinInput.d.ts +7 -0
- package/dist/types/core/components/TPProgress.d.ts +7 -0
- package/dist/types/core/components/TPRadio.d.ts +11 -0
- package/dist/types/core/components/TPSkeleton.d.ts +7 -0
- package/dist/types/core/components/TPStepText.d.ts +7 -0
- package/dist/types/core/components/TPStepper.d.ts +7 -0
- package/dist/types/core/components/TPSwipeRow.d.ts +8 -0
- package/dist/types/core/components/TPTooltip.d.ts +7 -0
- package/dist/types/core/index.d.ts +17 -0
- package/dist/types/core/types.d.ts +236 -0
- package/dist/types/core/utils/liquidGlassEngine.d.ts +37 -0
- package/dist/types/omada/blocks/OmadaFirmwareUpdateBlock.d.ts +23 -0
- package/dist/types/omada/blocks/OmadaPortPanelBlock.d.ts +31 -0
- package/dist/types/omada/blocks/OmadaScheduleBlock.d.ts +33 -0
- package/dist/types/omada/blocks/OmadaTopologyBlock.d.ts +26 -0
- package/dist/types/omada/index.d.ts +4 -0
- package/dist/types/omada/pages/OmadaAppDemo.d.ts +1 -1
- package/dist/types/omada/pages/OmadaSiteSettingsPage.d.ts +4 -2
- package/package.json +2 -2
- package/skills/tp-mobile-ui-kit/SKILL.md +5 -4
- package/skills/tp-mobile-ui-kit/references/catalog.json +1339 -71
- package/dist/chunks/TPPrompt-Csg5YasJ.js +0 -2460
|
@@ -0,0 +1,3748 @@
|
|
|
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, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
4
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
// src/core/components/TPPhoneFrame.tsx
|
|
6
|
+
var _ = {
|
|
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 v(e, t) {
|
|
29
|
+
return e || (t === "base" ? "iphone14" : "iphone16pro");
|
|
30
|
+
}
|
|
31
|
+
var y = ({ 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: m = "", style: y, children: b }) => {
|
|
32
|
+
let x = e(), S = a ?? x.screenSize, C = v(t, S), w = _[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
|
+
m
|
|
39
|
+
].filter(Boolean).join(" ");
|
|
40
|
+
return /* @__PURE__ */ h("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__ */ g("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__ */ h("div", {
|
|
65
|
+
className: "tp-phone-dynamic-island",
|
|
66
|
+
"data-testid": "tp-phone-dynamic-island",
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
children: /* @__PURE__ */ h("span", { className: "tp-phone-dynamic-island-lens" })
|
|
69
|
+
}),
|
|
70
|
+
k && /* @__PURE__ */ h("div", {
|
|
71
|
+
className: `tp-phone-statusbar ${M ? "tp-phone-statusbar--overlay" : ""}`.trim(),
|
|
72
|
+
children: d
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ g("div", {
|
|
75
|
+
className: "tp-phone-stage",
|
|
76
|
+
children: [/* @__PURE__ */ h("div", {
|
|
77
|
+
className: "tp-phone-body",
|
|
78
|
+
children: b
|
|
79
|
+
}), p != null && /* @__PURE__ */ h("div", {
|
|
80
|
+
className: `tp-phone-floating-action ${N ? "tp-phone-floating-action--above-overlay" : ""}`.trim(),
|
|
81
|
+
children: p
|
|
82
|
+
})]
|
|
83
|
+
}),
|
|
84
|
+
A || O ? /* @__PURE__ */ g("div", {
|
|
85
|
+
className: `tp-phone-bottom ${N ? "tp-phone-bottom--overlay" : ""}`.trim(),
|
|
86
|
+
children: [A && /* @__PURE__ */ h("div", {
|
|
87
|
+
className: "tp-phone-bottombar",
|
|
88
|
+
children: f
|
|
89
|
+
}), O && /* @__PURE__ */ h("div", {
|
|
90
|
+
className: "tp-phone-home-indicator",
|
|
91
|
+
"data-testid": "tp-phone-home-indicator",
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
children: /* @__PURE__ */ h("span", { className: "tp-phone-home-indicator-pill" })
|
|
94
|
+
})]
|
|
95
|
+
}) : null
|
|
96
|
+
]
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}, b = [
|
|
100
|
+
4,
|
|
101
|
+
6,
|
|
102
|
+
8,
|
|
103
|
+
10
|
|
104
|
+
], x = ({ 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, m = Math.max(0, Math.min(100, Math.round(o))), _ = m <= 20, v = m / 100 * 18, y = [
|
|
106
|
+
"tp-statusbar",
|
|
107
|
+
`tp-statusbar--${p}`,
|
|
108
|
+
l ? "tp-statusbar--transparent" : "",
|
|
109
|
+
u
|
|
110
|
+
].filter(Boolean).join(" ");
|
|
111
|
+
return /* @__PURE__ */ g("div", {
|
|
112
|
+
className: y,
|
|
113
|
+
"data-os": p,
|
|
114
|
+
"data-signal": i,
|
|
115
|
+
"data-wifi": a,
|
|
116
|
+
"data-battery": m,
|
|
117
|
+
style: d,
|
|
118
|
+
children: [/* @__PURE__ */ g("div", {
|
|
119
|
+
className: "tp-statusbar-left",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ h("span", {
|
|
122
|
+
className: "tp-statusbar-time",
|
|
123
|
+
children: t
|
|
124
|
+
}),
|
|
125
|
+
r && /* @__PURE__ */ h("span", {
|
|
126
|
+
className: "tp-statusbar-carrier",
|
|
127
|
+
children: r
|
|
128
|
+
}),
|
|
129
|
+
c && /* @__PURE__ */ h("span", {
|
|
130
|
+
className: "tp-statusbar-meta-icon",
|
|
131
|
+
"aria-label": "Location active",
|
|
132
|
+
children: /* @__PURE__ */ h("svg", {
|
|
133
|
+
width: "11",
|
|
134
|
+
height: "11",
|
|
135
|
+
viewBox: "0 0 12 12",
|
|
136
|
+
fill: "none",
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
children: /* @__PURE__ */ h("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__ */ h("span", {
|
|
145
|
+
className: "tp-statusbar-meta-icon",
|
|
146
|
+
"aria-label": "Muted",
|
|
147
|
+
children: /* @__PURE__ */ h("svg", {
|
|
148
|
+
width: "12",
|
|
149
|
+
height: "12",
|
|
150
|
+
viewBox: "0 0 14 14",
|
|
151
|
+
fill: "none",
|
|
152
|
+
"aria-hidden": "true",
|
|
153
|
+
children: /* @__PURE__ */ h("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__ */ g("div", {
|
|
164
|
+
className: "tp-statusbar-right",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ h("span", {
|
|
167
|
+
className: "tp-statusbar-signal",
|
|
168
|
+
"aria-label": `Cellular signal ${i} of 4`,
|
|
169
|
+
children: /* @__PURE__ */ h("svg", {
|
|
170
|
+
width: "18",
|
|
171
|
+
height: "12",
|
|
172
|
+
viewBox: "0 0 18 12",
|
|
173
|
+
fill: "none",
|
|
174
|
+
"aria-hidden": "true",
|
|
175
|
+
children: b.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__ */ g("g", {
|
|
178
|
+
opacity: r ? 1 : .28,
|
|
179
|
+
children: [/* @__PURE__ */ h("rect", {
|
|
180
|
+
x: a,
|
|
181
|
+
y: s,
|
|
182
|
+
width: "3",
|
|
183
|
+
height: o,
|
|
184
|
+
rx: "1",
|
|
185
|
+
fill: "currentColor"
|
|
186
|
+
}), p === "ios" && /* @__PURE__ */ h("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__ */ h("span", {
|
|
199
|
+
className: "tp-statusbar-wifi",
|
|
200
|
+
"aria-label": `Wi-Fi signal ${a} of 3`,
|
|
201
|
+
children: /* @__PURE__ */ g("svg", {
|
|
202
|
+
width: "16",
|
|
203
|
+
height: "12",
|
|
204
|
+
viewBox: "0 0 16 12",
|
|
205
|
+
fill: "none",
|
|
206
|
+
"aria-hidden": "true",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ h("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__ */ h("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__ */ h("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__ */ h("circle", {
|
|
230
|
+
cx: "8",
|
|
231
|
+
cy: "10.7",
|
|
232
|
+
r: "1.1",
|
|
233
|
+
fill: "currentColor"
|
|
234
|
+
})
|
|
235
|
+
]
|
|
236
|
+
})
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ g("span", {
|
|
239
|
+
className: "tp-statusbar-battery",
|
|
240
|
+
"aria-label": `Battery ${m}%`,
|
|
241
|
+
children: [p === "android" && /* @__PURE__ */ g("span", {
|
|
242
|
+
className: "tp-statusbar-battery-text",
|
|
243
|
+
children: [m, "%"]
|
|
244
|
+
}), /* @__PURE__ */ g("svg", {
|
|
245
|
+
width: "26",
|
|
246
|
+
height: "12",
|
|
247
|
+
viewBox: "0 0 26 12",
|
|
248
|
+
fill: "none",
|
|
249
|
+
"aria-hidden": "true",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ h("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__ */ h("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__ */ h("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
|
+
}, S = /* @__PURE__ */ new Map(), C = 64;
|
|
281
|
+
function w() {
|
|
282
|
+
if (typeof window > "u" || typeof navigator > "u") return !1;
|
|
283
|
+
let e = navigator.userAgent || "";
|
|
284
|
+
return /(Chrome|Chromium|Edg|OPR)\//.test(e) && !/(Firefox|CriOS|EdgiOS|FxiOS)/.test(e);
|
|
285
|
+
}
|
|
286
|
+
function T(e) {
|
|
287
|
+
let t = Math.max(2, Math.round(e.width)), n = Math.max(2, Math.round(e.height)), r = Math.max(1, Math.min(e.radius, t / 2, n / 2)), i = Math.max(2, Math.min(e.bezelWidth, Math.min(t, n) * .44)), a = e.glassThickness ?? Math.max(8, i * .9), o = e.refractiveIndex ?? 1.5, s = t * n, c = new Float32Array(s), l = new Float32Array(s), u = t / 2, d = n / 2, f = u - r, p = d - r, m = 0;
|
|
288
|
+
for (let e = 0; e < n; e += 1) {
|
|
289
|
+
let n = e + .5 - d, s = Math.abs(n) - p;
|
|
290
|
+
for (let d = 0; d < t; d += 1) {
|
|
291
|
+
let p = d + .5 - u, h = Math.abs(p) - f, g = -(Math.hypot(Math.max(h, 0), Math.max(s, 0)) + Math.min(Math.max(h, s), 0) - r);
|
|
292
|
+
if (g <= 0 || g >= i) continue;
|
|
293
|
+
let _ = 0, v = 0;
|
|
294
|
+
if (h > 0 && s > 0) {
|
|
295
|
+
let e = Math.hypot(h, s) || 1;
|
|
296
|
+
_ = h / e * (p >= 0 ? 1 : -1), v = s / e * (n >= 0 ? 1 : -1);
|
|
297
|
+
} else h >= s ? _ = p >= 0 ? 1 : -1 : v = n >= 0 ? 1 : -1;
|
|
298
|
+
let y = 1 - Math.max(.02, Math.min(1, g / i)), b = y * y * y * y, x = Math.max(1e-4, 1 - b), S = x ** .25, C = y ** 3 / x ** .75, w = Math.atan(C), T = Math.min(.999, Math.sin(w) / o), E = Math.asin(T), D = (a + i * S) * Math.tan(w - E);
|
|
299
|
+
D > m && (m = D);
|
|
300
|
+
let O = e * t + d;
|
|
301
|
+
c[O] = -_ * D, l[O] = -v * D;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
let h = new Uint8ClampedArray(s * 4), g = m > 1e-6 ? m : 1;
|
|
305
|
+
for (let e = 0; e < s; e += 1) {
|
|
306
|
+
let t = e * 4;
|
|
307
|
+
h[t] = Math.max(0, Math.min(255, Math.round(128 + c[e] / g * 127))), h[t + 1] = Math.max(0, Math.min(255, Math.round(128 + l[e] / g * 127))), h[t + 2] = 128, h[t + 3] = 255;
|
|
308
|
+
}
|
|
309
|
+
return {
|
|
310
|
+
data: h,
|
|
311
|
+
width: t,
|
|
312
|
+
height: n,
|
|
313
|
+
maxScale: Math.min(m, i * 1.25)
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
function E(e, t = 16) {
|
|
317
|
+
return Math.max(t, Math.round(e / 2) * 2);
|
|
318
|
+
}
|
|
319
|
+
function D(e) {
|
|
320
|
+
if (typeof document > "u") return null;
|
|
321
|
+
let t = E(e.width, 16), n = E(e.height, 16), r = E(Math.min(e.radius, t / 2, n / 2), 2), i = E(Math.min(e.bezelWidth, Math.min(t, n) * .44), 4), a = e.glassThickness ?? Math.max(8, i * .9), o = e.refractiveIndex ?? 1.5, s = `${t}x${n}:${r}:${i}:${a.toFixed(1)}:${o.toFixed(2)}`, c = S.get(s);
|
|
322
|
+
if (c) return c;
|
|
323
|
+
let l = document.createElement("canvas");
|
|
324
|
+
l.width = t, l.height = n;
|
|
325
|
+
let u = l.getContext("2d");
|
|
326
|
+
if (!u) return null;
|
|
327
|
+
let d = T({
|
|
328
|
+
width: t,
|
|
329
|
+
height: n,
|
|
330
|
+
radius: r,
|
|
331
|
+
bezelWidth: i,
|
|
332
|
+
glassThickness: a,
|
|
333
|
+
refractiveIndex: o
|
|
334
|
+
}), f = typeof ImageData < "u" ? new ImageData(new Uint8ClampedArray(d.data), t, n) : u.createImageData(t, n);
|
|
335
|
+
typeof ImageData > "u" && f.data.set(d.data), u.putImageData(f, 0, 0);
|
|
336
|
+
let p = {
|
|
337
|
+
url: l.toDataURL("image/png"),
|
|
338
|
+
width: d.width,
|
|
339
|
+
height: d.height,
|
|
340
|
+
maxScale: d.maxScale
|
|
341
|
+
};
|
|
342
|
+
if (S.size >= C) {
|
|
343
|
+
let e = S.keys().next().value;
|
|
344
|
+
e !== void 0 && S.delete(e);
|
|
345
|
+
}
|
|
346
|
+
return S.set(s, p), p;
|
|
347
|
+
}
|
|
348
|
+
// src/core/components/TPLiquidGlassBackdrop.tsx
|
|
349
|
+
function O(e, t) {
|
|
350
|
+
let n = `tp-lg-${l().replace(/[^a-zA-Z0-9_-]/g, "")}`, r = t.shape ?? "pill", i = t.bezelWidth ?? 14, a = t.optical ?? !0, [o, s] = p({
|
|
351
|
+
width: 0,
|
|
352
|
+
height: 0
|
|
353
|
+
}), [c, d] = p(!1);
|
|
354
|
+
u(() => {
|
|
355
|
+
d(w());
|
|
356
|
+
let t = e.current;
|
|
357
|
+
if (!t) return;
|
|
358
|
+
let n = () => {
|
|
359
|
+
let e = t.getBoundingClientRect(), n = Math.round(e.width), r = Math.round(e.height);
|
|
360
|
+
n > 0 && r > 0 && s((e) => Math.abs(e.width - n) <= 1 && Math.abs(e.height - r) <= 1 ? e : {
|
|
361
|
+
width: n,
|
|
362
|
+
height: r
|
|
363
|
+
});
|
|
364
|
+
};
|
|
365
|
+
if (n(), typeof ResizeObserver > "u") return;
|
|
366
|
+
let r = new ResizeObserver(n);
|
|
367
|
+
return r.observe(t), () => r.disconnect();
|
|
368
|
+
}, [e]);
|
|
369
|
+
let f = a && c, m = null;
|
|
370
|
+
if (f && o.width > 0 && o.height > 0) {
|
|
371
|
+
let e = Math.min(o.width, o.height), t = r === "rounded" ? Math.min(20, e / 2) : e / 2;
|
|
372
|
+
m = D({
|
|
373
|
+
width: o.width,
|
|
374
|
+
height: o.height,
|
|
375
|
+
radius: t,
|
|
376
|
+
bezelWidth: i
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
filterId: n,
|
|
381
|
+
asset: m,
|
|
382
|
+
size: o,
|
|
383
|
+
opticalEnabled: f
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
var k = ({ shape: e = "pill", tint: t = "clear", bezelWidth: n = 14, refraction: r = 1, dispersion: i = 1, blur: a = 1.5, saturation: o = 1.5, optical: s = !0 }) => {
|
|
387
|
+
let c = f(null), { filterId: l, asset: u, size: d, opticalEnabled: p } = O(c, {
|
|
388
|
+
shape: e,
|
|
389
|
+
bezelWidth: n,
|
|
390
|
+
optical: s
|
|
391
|
+
}), _ = !!(p && u && u.maxScale > 0 && d.width > 0), v = Math.max(0, Math.min(2, i)), y = u ? u.maxScale * Math.max(0, r) : 0, b = y * (1 + .14 * v), x = y * (1 - .14 * v);
|
|
392
|
+
return /* @__PURE__ */ g(m, { children: [_ && u && /* @__PURE__ */ h("svg", {
|
|
393
|
+
className: "tp-lg-svg-defs",
|
|
394
|
+
width: "0",
|
|
395
|
+
height: "0",
|
|
396
|
+
"aria-hidden": "true",
|
|
397
|
+
children: /* @__PURE__ */ h("defs", { children: /* @__PURE__ */ g("filter", {
|
|
398
|
+
id: l,
|
|
399
|
+
x: "0%",
|
|
400
|
+
y: "0%",
|
|
401
|
+
width: "100%",
|
|
402
|
+
height: "100%",
|
|
403
|
+
colorInterpolationFilters: "sRGB",
|
|
404
|
+
children: [
|
|
405
|
+
/* @__PURE__ */ h("feGaussianBlur", {
|
|
406
|
+
in: "SourceGraphic",
|
|
407
|
+
stdDeviation: a,
|
|
408
|
+
edgeMode: "duplicate",
|
|
409
|
+
result: "softened"
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ h("feImage", {
|
|
412
|
+
href: u.url,
|
|
413
|
+
x: "0",
|
|
414
|
+
y: "0",
|
|
415
|
+
width: d.width,
|
|
416
|
+
height: d.height,
|
|
417
|
+
preserveAspectRatio: "none",
|
|
418
|
+
result: "dispMap"
|
|
419
|
+
}),
|
|
420
|
+
v > 0 ? /* @__PURE__ */ g(m, { children: [
|
|
421
|
+
/* @__PURE__ */ h("feDisplacementMap", {
|
|
422
|
+
in: "softened",
|
|
423
|
+
in2: "dispMap",
|
|
424
|
+
scale: b,
|
|
425
|
+
xChannelSelector: "R",
|
|
426
|
+
yChannelSelector: "G",
|
|
427
|
+
result: "dispR"
|
|
428
|
+
}),
|
|
429
|
+
/* @__PURE__ */ h("feColorMatrix", {
|
|
430
|
+
in: "dispR",
|
|
431
|
+
type: "matrix",
|
|
432
|
+
values: "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0",
|
|
433
|
+
result: "chanR"
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ h("feDisplacementMap", {
|
|
436
|
+
in: "softened",
|
|
437
|
+
in2: "dispMap",
|
|
438
|
+
scale: y,
|
|
439
|
+
xChannelSelector: "R",
|
|
440
|
+
yChannelSelector: "G",
|
|
441
|
+
result: "dispG"
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ h("feColorMatrix", {
|
|
444
|
+
in: "dispG",
|
|
445
|
+
type: "matrix",
|
|
446
|
+
values: "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0",
|
|
447
|
+
result: "chanG"
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ h("feDisplacementMap", {
|
|
450
|
+
in: "softened",
|
|
451
|
+
in2: "dispMap",
|
|
452
|
+
scale: x,
|
|
453
|
+
xChannelSelector: "R",
|
|
454
|
+
yChannelSelector: "G",
|
|
455
|
+
result: "dispB"
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ h("feColorMatrix", {
|
|
458
|
+
in: "dispB",
|
|
459
|
+
type: "matrix",
|
|
460
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0",
|
|
461
|
+
result: "chanB"
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ h("feBlend", {
|
|
464
|
+
in: "chanR",
|
|
465
|
+
in2: "chanG",
|
|
466
|
+
mode: "screen",
|
|
467
|
+
result: "rg"
|
|
468
|
+
}),
|
|
469
|
+
/* @__PURE__ */ h("feBlend", {
|
|
470
|
+
in: "rg",
|
|
471
|
+
in2: "chanB",
|
|
472
|
+
mode: "screen",
|
|
473
|
+
result: "rgbDispersed"
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ h("feColorMatrix", {
|
|
476
|
+
in: "rgbDispersed",
|
|
477
|
+
type: "saturate",
|
|
478
|
+
values: String(o)
|
|
479
|
+
})
|
|
480
|
+
] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("feDisplacementMap", {
|
|
481
|
+
in: "softened",
|
|
482
|
+
in2: "dispMap",
|
|
483
|
+
scale: y,
|
|
484
|
+
xChannelSelector: "R",
|
|
485
|
+
yChannelSelector: "G",
|
|
486
|
+
result: "refracted"
|
|
487
|
+
}), /* @__PURE__ */ h("feColorMatrix", {
|
|
488
|
+
in: "refracted",
|
|
489
|
+
type: "saturate",
|
|
490
|
+
values: String(o)
|
|
491
|
+
})] })
|
|
492
|
+
]
|
|
493
|
+
}) })
|
|
494
|
+
}), /* @__PURE__ */ h("span", {
|
|
495
|
+
ref: c,
|
|
496
|
+
className: `tp-lg-backdrop tp-lg-backdrop--tint-${t}`,
|
|
497
|
+
"aria-hidden": "true",
|
|
498
|
+
"data-optical": _ ? "svg-snell" : "css-fallback",
|
|
499
|
+
style: _ ? {
|
|
500
|
+
backdropFilter: `url(#${l})`,
|
|
501
|
+
WebkitBackdropFilter: `url(#${l})`
|
|
502
|
+
} : void 0
|
|
503
|
+
})] });
|
|
504
|
+
}, A = ({ children: e }) => {
|
|
505
|
+
let t = f(null);
|
|
506
|
+
return /* @__PURE__ */ g("div", {
|
|
507
|
+
ref: t,
|
|
508
|
+
className: "tp-header-well",
|
|
509
|
+
children: [/* @__PURE__ */ h(k, {
|
|
510
|
+
hostRef: t,
|
|
511
|
+
shape: "pill",
|
|
512
|
+
tint: "clear",
|
|
513
|
+
bezelWidth: 12,
|
|
514
|
+
refraction: 1.05,
|
|
515
|
+
dispersion: .9,
|
|
516
|
+
blur: 2
|
|
517
|
+
}), e]
|
|
518
|
+
});
|
|
519
|
+
}, j = ({ 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 }) => {
|
|
520
|
+
let p = n === "floating", _ = a || r != null, v = l != null && l !== "" && (typeof l != "number" || l > 0), y = i != null || v, b = /* @__PURE__ */ g(m, { children: [a ? /* @__PURE__ */ h("button", {
|
|
521
|
+
type: "button",
|
|
522
|
+
className: "tp-header-icon-btn",
|
|
523
|
+
"aria-label": "Back",
|
|
524
|
+
onClick: o,
|
|
525
|
+
children: /* @__PURE__ */ h("svg", {
|
|
526
|
+
width: "20",
|
|
527
|
+
height: "20",
|
|
528
|
+
viewBox: "0 0 24 24",
|
|
529
|
+
fill: "none",
|
|
530
|
+
"aria-hidden": "true",
|
|
531
|
+
children: /* @__PURE__ */ h("path", {
|
|
532
|
+
d: "M15.5 19L8.5 12L15.5 5",
|
|
533
|
+
stroke: "currentColor",
|
|
534
|
+
strokeWidth: "1.8",
|
|
535
|
+
strokeLinecap: "round",
|
|
536
|
+
strokeLinejoin: "round"
|
|
537
|
+
})
|
|
538
|
+
})
|
|
539
|
+
}) : null, r] }), x = /* @__PURE__ */ g(m, { children: [e != null && /* @__PURE__ */ h("span", {
|
|
540
|
+
className: "tp-header-title",
|
|
541
|
+
children: e
|
|
542
|
+
}), s && /* @__PURE__ */ h("span", {
|
|
543
|
+
className: "tp-header-chevron",
|
|
544
|
+
"aria-hidden": "true",
|
|
545
|
+
children: /* @__PURE__ */ h("svg", {
|
|
546
|
+
width: "14",
|
|
547
|
+
height: "14",
|
|
548
|
+
viewBox: "0 0 16 16",
|
|
549
|
+
fill: "none",
|
|
550
|
+
children: /* @__PURE__ */ h("path", {
|
|
551
|
+
d: "M4 6L8 10L12 6",
|
|
552
|
+
stroke: "currentColor",
|
|
553
|
+
strokeWidth: "1.7",
|
|
554
|
+
strokeLinecap: "round",
|
|
555
|
+
strokeLinejoin: "round"
|
|
556
|
+
})
|
|
557
|
+
})
|
|
558
|
+
})] }), S = [
|
|
559
|
+
"tp-header",
|
|
560
|
+
`tp-header--${n}`,
|
|
561
|
+
u ? "tp-header--translucent" : "",
|
|
562
|
+
d
|
|
563
|
+
].filter(Boolean).join(" ");
|
|
564
|
+
return /* @__PURE__ */ g("header", {
|
|
565
|
+
className: S,
|
|
566
|
+
"data-variant": n,
|
|
567
|
+
style: f,
|
|
568
|
+
children: [
|
|
569
|
+
/* @__PURE__ */ h("div", {
|
|
570
|
+
className: "tp-header-left",
|
|
571
|
+
children: _ ? p ? /* @__PURE__ */ h(A, { children: b }) : b : null
|
|
572
|
+
}),
|
|
573
|
+
/* @__PURE__ */ g("div", {
|
|
574
|
+
className: "tp-header-center",
|
|
575
|
+
children: [e != null || s ? c || s ? /* @__PURE__ */ h("button", {
|
|
576
|
+
type: "button",
|
|
577
|
+
className: "tp-header-title-btn",
|
|
578
|
+
onClick: c,
|
|
579
|
+
children: x
|
|
580
|
+
}) : /* @__PURE__ */ h("div", {
|
|
581
|
+
className: "tp-header-title-wrap",
|
|
582
|
+
children: x
|
|
583
|
+
}) : null, t != null && /* @__PURE__ */ h("div", {
|
|
584
|
+
className: "tp-header-subtitle",
|
|
585
|
+
children: t
|
|
586
|
+
})]
|
|
587
|
+
}),
|
|
588
|
+
/* @__PURE__ */ h("div", {
|
|
589
|
+
className: "tp-header-right",
|
|
590
|
+
children: y ? /* @__PURE__ */ g("div", {
|
|
591
|
+
className: "tp-header-right-slot",
|
|
592
|
+
children: [p ? /* @__PURE__ */ h(A, { children: i }) : i, v && /* @__PURE__ */ h("span", {
|
|
593
|
+
className: "tp-header-badge",
|
|
594
|
+
children: l
|
|
595
|
+
})]
|
|
596
|
+
}) : null
|
|
597
|
+
})
|
|
598
|
+
]
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
// src/core/components/TPTabBar.tsx
|
|
602
|
+
function M(e, t) {
|
|
603
|
+
let i = t && e.activeIcon !== void 0 ? e.activeIcon : e.icon;
|
|
604
|
+
return typeof i == "string" ? n(i) ? /* @__PURE__ */ h(r, {
|
|
605
|
+
name: i,
|
|
606
|
+
size: 22
|
|
607
|
+
}) : /* @__PURE__ */ h("span", {
|
|
608
|
+
className: "tp-tabbar-icon-fallback",
|
|
609
|
+
"aria-hidden": "true",
|
|
610
|
+
children: i
|
|
611
|
+
}) : i;
|
|
612
|
+
}
|
|
613
|
+
function N(e) {
|
|
614
|
+
return e == null || e === !1 ? null : e === !0 ? /* @__PURE__ */ h("span", {
|
|
615
|
+
className: "tp-tabbar-badge tp-tabbar-badge--dot",
|
|
616
|
+
"aria-label": "Notification"
|
|
617
|
+
}) : typeof e == "number" ? e <= 0 ? null : /* @__PURE__ */ h("span", {
|
|
618
|
+
className: "tp-tabbar-badge",
|
|
619
|
+
children: e > 99 ? "99+" : String(e)
|
|
620
|
+
}) : e === "" ? null : /* @__PURE__ */ h("span", {
|
|
621
|
+
className: "tp-tabbar-badge",
|
|
622
|
+
children: e
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
var P = ({ items: e, activeKey: t, onChange: n, variant: r = "floating-pill", extraAction: i, className: a = "", style: o }) => {
|
|
626
|
+
let s = f(null), c = i != null && r === "floating-pill", l = e.findIndex((e) => e.key === t), u = [
|
|
627
|
+
"tp-tabbar",
|
|
628
|
+
`tp-tabbar--${r}`,
|
|
629
|
+
c ? "tp-tabbar--has-extra" : "",
|
|
630
|
+
a
|
|
631
|
+
].filter(Boolean).join(" "), d = r === "floating-pill" && l >= 0 && e.length > 0 ? {
|
|
632
|
+
width: `calc((100% - 8px - ${(e.length - 1) * 4}px) / ${e.length})`,
|
|
633
|
+
transform: `translateX(calc(${l} * (100% + 4px)))`
|
|
634
|
+
} : void 0;
|
|
635
|
+
return /* @__PURE__ */ g("nav", {
|
|
636
|
+
className: u,
|
|
637
|
+
"data-variant": r,
|
|
638
|
+
"aria-label": "Bottom Navigation",
|
|
639
|
+
style: o,
|
|
640
|
+
children: [/* @__PURE__ */ g("div", {
|
|
641
|
+
ref: s,
|
|
642
|
+
className: "tp-tabbar-track",
|
|
643
|
+
role: "tablist",
|
|
644
|
+
children: [
|
|
645
|
+
r === "floating-pill" && /* @__PURE__ */ h(k, {
|
|
646
|
+
hostRef: s,
|
|
647
|
+
shape: "pill",
|
|
648
|
+
tint: "clear",
|
|
649
|
+
bezelWidth: 16,
|
|
650
|
+
refraction: 1.35,
|
|
651
|
+
dispersion: 1.15,
|
|
652
|
+
blur: 2.2
|
|
653
|
+
}),
|
|
654
|
+
d && /* @__PURE__ */ h("span", {
|
|
655
|
+
className: "tp-tabbar-active-lens",
|
|
656
|
+
"aria-hidden": "true",
|
|
657
|
+
"data-active-index": l,
|
|
658
|
+
style: d
|
|
659
|
+
}),
|
|
660
|
+
e.map((e) => {
|
|
661
|
+
let r = e.key === t;
|
|
662
|
+
return /* @__PURE__ */ g("button", {
|
|
663
|
+
type: "button",
|
|
664
|
+
role: "tab",
|
|
665
|
+
"aria-selected": r,
|
|
666
|
+
className: `tp-tabbar-item ${r ? "tp-tabbar-item--active" : ""}`.trim(),
|
|
667
|
+
onClick: () => n(e.key),
|
|
668
|
+
children: [/* @__PURE__ */ g("span", {
|
|
669
|
+
className: "tp-tabbar-icon-wrap",
|
|
670
|
+
children: [/* @__PURE__ */ h("span", {
|
|
671
|
+
className: "tp-tabbar-icon",
|
|
672
|
+
children: M(e, r)
|
|
673
|
+
}), N(e.badge)]
|
|
674
|
+
}), /* @__PURE__ */ h("span", {
|
|
675
|
+
className: "tp-tabbar-label",
|
|
676
|
+
children: e.label
|
|
677
|
+
})]
|
|
678
|
+
}, e.key);
|
|
679
|
+
})
|
|
680
|
+
]
|
|
681
|
+
}), c && /* @__PURE__ */ h("div", {
|
|
682
|
+
className: "tp-tabbar-extra",
|
|
683
|
+
children: i
|
|
684
|
+
})]
|
|
685
|
+
});
|
|
686
|
+
}, F = ({ options: e, value: t, onChange: n, variant: r = "underline", fullWidth: i = !0, className: a = "", style: o }) => {
|
|
687
|
+
let s = [
|
|
688
|
+
"tp-segment",
|
|
689
|
+
`tp-segment--${r}`,
|
|
690
|
+
i ? "tp-segment--full" : "",
|
|
691
|
+
a
|
|
692
|
+
].filter(Boolean).join(" ");
|
|
693
|
+
return /* @__PURE__ */ h("div", {
|
|
694
|
+
className: s,
|
|
695
|
+
role: "tablist",
|
|
696
|
+
"data-variant": r,
|
|
697
|
+
style: o,
|
|
698
|
+
children: e.map((e) => {
|
|
699
|
+
let r = e.key === t, i = [
|
|
700
|
+
"tp-segment-item",
|
|
701
|
+
r ? "tp-segment-item--active" : "",
|
|
702
|
+
e.disabled ? "tp-segment-item--disabled" : ""
|
|
703
|
+
].filter(Boolean).join(" ");
|
|
704
|
+
return /* @__PURE__ */ g("button", {
|
|
705
|
+
type: "button",
|
|
706
|
+
role: "tab",
|
|
707
|
+
"aria-selected": r,
|
|
708
|
+
disabled: e.disabled,
|
|
709
|
+
className: i,
|
|
710
|
+
onClick: () => {
|
|
711
|
+
e.disabled || n(e.key);
|
|
712
|
+
},
|
|
713
|
+
children: [/* @__PURE__ */ h("span", {
|
|
714
|
+
className: "tp-segment-label",
|
|
715
|
+
children: e.label
|
|
716
|
+
}), e.badge !== void 0 && e.badge !== null && e.badge !== "" && /* @__PURE__ */ h("span", {
|
|
717
|
+
className: "tp-segment-badge",
|
|
718
|
+
children: e.badge
|
|
719
|
+
})]
|
|
720
|
+
}, e.key);
|
|
721
|
+
})
|
|
722
|
+
});
|
|
723
|
+
}, I = ({ total: e, current: t, onChange: n, className: r = "", style: i }) => {
|
|
724
|
+
if (e <= 0) return null;
|
|
725
|
+
let a = ["tp-page-control", r].filter(Boolean).join(" ");
|
|
726
|
+
return /* @__PURE__ */ h("div", {
|
|
727
|
+
className: a,
|
|
728
|
+
role: "navigation",
|
|
729
|
+
"aria-label": "Page indicator",
|
|
730
|
+
style: i,
|
|
731
|
+
children: Array.from({ length: e }, (e, r) => {
|
|
732
|
+
let i = r === t, a = ["tp-page-control-dot", i ? "tp-page-control-dot--active" : ""].filter(Boolean).join(" ");
|
|
733
|
+
return n ? /* @__PURE__ */ h("button", {
|
|
734
|
+
type: "button",
|
|
735
|
+
className: a,
|
|
736
|
+
"aria-label": `Page ${r + 1}`,
|
|
737
|
+
"aria-current": i ? "page" : void 0,
|
|
738
|
+
"data-active": String(i),
|
|
739
|
+
onClick: () => n(r)
|
|
740
|
+
}, r) : /* @__PURE__ */ h("span", {
|
|
741
|
+
className: a,
|
|
742
|
+
"data-active": String(i),
|
|
743
|
+
"aria-current": i ? "page" : void 0
|
|
744
|
+
}, r);
|
|
745
|
+
})
|
|
746
|
+
});
|
|
747
|
+
}, L = ({ 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 }) => {
|
|
748
|
+
let u = [
|
|
749
|
+
"tp-btn",
|
|
750
|
+
`tp-btn--${e}`,
|
|
751
|
+
`tp-btn--${t}`,
|
|
752
|
+
n ? "tp-btn--block" : "",
|
|
753
|
+
r ? "tp-btn--loading" : "",
|
|
754
|
+
s
|
|
755
|
+
].filter(Boolean).join(" ");
|
|
756
|
+
return /* @__PURE__ */ g("button", {
|
|
757
|
+
...l,
|
|
758
|
+
type: i,
|
|
759
|
+
className: u,
|
|
760
|
+
disabled: o || r,
|
|
761
|
+
"aria-busy": r || void 0,
|
|
762
|
+
"data-variant": e,
|
|
763
|
+
"data-size": t,
|
|
764
|
+
children: [r ? /* @__PURE__ */ h("span", {
|
|
765
|
+
className: "tp-btn-spinner",
|
|
766
|
+
"aria-hidden": "true"
|
|
767
|
+
}) : a == null ? null : /* @__PURE__ */ h("span", {
|
|
768
|
+
className: "tp-btn-icon",
|
|
769
|
+
"aria-hidden": "true",
|
|
770
|
+
children: a
|
|
771
|
+
}), c != null && /* @__PURE__ */ h("span", {
|
|
772
|
+
className: "tp-btn-label",
|
|
773
|
+
children: c
|
|
774
|
+
})]
|
|
775
|
+
});
|
|
776
|
+
}, R = ({ 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 }) => {
|
|
777
|
+
let d = [
|
|
778
|
+
"tp-fixed-btn-bar",
|
|
779
|
+
`tp-fixed-btn-bar--${e}`,
|
|
780
|
+
l
|
|
781
|
+
].filter(Boolean).join(" "), f = /* @__PURE__ */ h(L, {
|
|
782
|
+
variant: "primary",
|
|
783
|
+
size: "lg",
|
|
784
|
+
block: !0,
|
|
785
|
+
loading: r,
|
|
786
|
+
disabled: i,
|
|
787
|
+
onClick: n,
|
|
788
|
+
children: t
|
|
789
|
+
}), p = a ? /* @__PURE__ */ h(L, {
|
|
790
|
+
variant: s,
|
|
791
|
+
size: "lg",
|
|
792
|
+
block: !0,
|
|
793
|
+
onClick: o,
|
|
794
|
+
children: a
|
|
795
|
+
}) : null;
|
|
796
|
+
return /* @__PURE__ */ g("div", {
|
|
797
|
+
className: d,
|
|
798
|
+
"data-layout": e,
|
|
799
|
+
style: u,
|
|
800
|
+
children: [c != null && /* @__PURE__ */ h("div", {
|
|
801
|
+
className: "tp-fixed-btn-bar-note",
|
|
802
|
+
children: c
|
|
803
|
+
}), /* @__PURE__ */ h("div", {
|
|
804
|
+
className: "tp-fixed-btn-bar-actions",
|
|
805
|
+
children: e === "dual-horizontal" ? /* @__PURE__ */ g(m, { children: [p, f] }) : /* @__PURE__ */ g(m, { children: [f, e === "dual-vertical" ? p : null] })
|
|
806
|
+
})]
|
|
807
|
+
});
|
|
808
|
+
}, z = ({ checked: e, defaultChecked: t = !1, onChange: n, disabled: r = !1, loading: i = !1, ariaLabel: a, className: o = "", style: s }) => {
|
|
809
|
+
let [c, l] = p(t), u = e !== void 0, d = u ? e : c, f = r || i, m = () => {
|
|
810
|
+
if (f) return;
|
|
811
|
+
let e = !d;
|
|
812
|
+
u || l(e), n?.(e);
|
|
813
|
+
}, g = [
|
|
814
|
+
"tp-switch",
|
|
815
|
+
d ? "tp-switch--checked" : "",
|
|
816
|
+
r ? "tp-switch--disabled" : "",
|
|
817
|
+
i ? "tp-switch--loading" : "",
|
|
818
|
+
o
|
|
819
|
+
].filter(Boolean).join(" ");
|
|
820
|
+
return /* @__PURE__ */ h("button", {
|
|
821
|
+
type: "button",
|
|
822
|
+
role: "switch",
|
|
823
|
+
"aria-checked": d,
|
|
824
|
+
"aria-label": a,
|
|
825
|
+
"aria-busy": i || void 0,
|
|
826
|
+
disabled: f,
|
|
827
|
+
className: g,
|
|
828
|
+
style: s,
|
|
829
|
+
onClick: m,
|
|
830
|
+
children: /* @__PURE__ */ h("span", {
|
|
831
|
+
className: "tp-switch-thumb",
|
|
832
|
+
"aria-hidden": "true",
|
|
833
|
+
children: i && /* @__PURE__ */ h("span", { className: "tp-switch-spinner" })
|
|
834
|
+
})
|
|
835
|
+
});
|
|
836
|
+
};
|
|
837
|
+
// src/core/components/TPSlider.tsx
|
|
838
|
+
function B(e, t, n) {
|
|
839
|
+
return Number.isNaN(e) ? t : Math.min(n, Math.max(t, e));
|
|
840
|
+
}
|
|
841
|
+
function V(e, t, n) {
|
|
842
|
+
return n <= t ? 0 : (B(e, t, n) - t) / (n - t) * 100;
|
|
843
|
+
}
|
|
844
|
+
function H(e, t, n) {
|
|
845
|
+
let r = B(e?.[0] ?? t, t, n), i = B(e?.[1] ?? n, t, n);
|
|
846
|
+
return r <= i ? [r, i] : [i, r];
|
|
847
|
+
}
|
|
848
|
+
var U = ({ 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: d, onRangeChange: _, onRangeAfterChange: v, onChange: y, onAfterChange: b, ariaLabel: x, className: S = "", style: C }) => {
|
|
849
|
+
let w = e !== void 0, [T, E] = p(() => B(t ?? n, n, r)), D = B(w ? e : T, n, r), O = f(D);
|
|
850
|
+
O.current = D;
|
|
851
|
+
let k = u !== void 0, [A, j] = p(() => H(d ?? [n, Math.round(n + (r - n) * .6)], n, r)), M = H(k ? u : A, n, r), N = f(M);
|
|
852
|
+
N.current = M;
|
|
853
|
+
let P = V(D, n, r), F = V(M[0], n, r), I = V(M[1], n, r), L = (e, t = !1) => {
|
|
854
|
+
let i = B(e, n, r);
|
|
855
|
+
O.current = i, w || E(i), y?.(i), t && b?.(i);
|
|
856
|
+
}, R = (e, t = !1) => {
|
|
857
|
+
let i = H(e, n, r);
|
|
858
|
+
N.current = i, k || j(i), _?.(i), t && v?.(i);
|
|
859
|
+
}, z = (e) => {
|
|
860
|
+
c || L(Number(e.target.value), !1);
|
|
861
|
+
}, U = () => {
|
|
862
|
+
c || (l ? v?.(N.current) : b?.(O.current));
|
|
863
|
+
}, W = !!a?.some((e) => e.label !== void 0), G = [
|
|
864
|
+
"tp-slider",
|
|
865
|
+
l ? "tp-slider--range" : "",
|
|
866
|
+
c ? "tp-slider--disabled" : "",
|
|
867
|
+
S
|
|
868
|
+
].filter(Boolean).join(" ");
|
|
869
|
+
return /* @__PURE__ */ g("div", {
|
|
870
|
+
className: G,
|
|
871
|
+
style: C,
|
|
872
|
+
children: [
|
|
873
|
+
o && /* @__PURE__ */ h("div", {
|
|
874
|
+
className: "tp-slider-header",
|
|
875
|
+
children: /* @__PURE__ */ h("span", {
|
|
876
|
+
className: "tp-slider-value",
|
|
877
|
+
children: l ? `${M[0]}${s} – ${M[1]}${s}` : `${D}${s}`
|
|
878
|
+
})
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ g("div", {
|
|
881
|
+
className: "tp-slider-control",
|
|
882
|
+
children: [/* @__PURE__ */ g("div", {
|
|
883
|
+
className: "tp-slider-track",
|
|
884
|
+
"aria-hidden": "true",
|
|
885
|
+
children: [/* @__PURE__ */ h("div", {
|
|
886
|
+
className: "tp-slider-fill",
|
|
887
|
+
style: l ? {
|
|
888
|
+
left: `${F}%`,
|
|
889
|
+
width: `${Math.max(0, I - F)}%`
|
|
890
|
+
} : {
|
|
891
|
+
left: 0,
|
|
892
|
+
width: `${P}%`
|
|
893
|
+
}
|
|
894
|
+
}), a && a.length > 0 && /* @__PURE__ */ h("div", {
|
|
895
|
+
className: "tp-slider-ticks",
|
|
896
|
+
children: a.map((e) => {
|
|
897
|
+
let t = V(e.value, n, r), i = l ? e.value >= M[0] && e.value <= M[1] : e.value <= D;
|
|
898
|
+
return /* @__PURE__ */ h("span", {
|
|
899
|
+
className: `tp-slider-tick ${i ? "tp-slider-tick--active" : ""}`.trim(),
|
|
900
|
+
style: { left: `${t}%` }
|
|
901
|
+
}, e.value);
|
|
902
|
+
})
|
|
903
|
+
})]
|
|
904
|
+
}), l ? /* @__PURE__ */ g(m, { children: [
|
|
905
|
+
/* @__PURE__ */ h("div", {
|
|
906
|
+
className: "tp-slider-thumb",
|
|
907
|
+
style: { left: `${F}%` },
|
|
908
|
+
"aria-hidden": "true"
|
|
909
|
+
}),
|
|
910
|
+
/* @__PURE__ */ h("div", {
|
|
911
|
+
className: "tp-slider-thumb tp-slider-thumb--secondary",
|
|
912
|
+
style: { left: `${I}%` },
|
|
913
|
+
"aria-hidden": "true"
|
|
914
|
+
}),
|
|
915
|
+
/* @__PURE__ */ h("input", {
|
|
916
|
+
type: "range",
|
|
917
|
+
className: "tp-slider-input tp-slider-input--range",
|
|
918
|
+
min: n,
|
|
919
|
+
max: r,
|
|
920
|
+
step: i,
|
|
921
|
+
value: M[0],
|
|
922
|
+
disabled: c,
|
|
923
|
+
"aria-label": x ? `${x} minimum` : "Minimum value",
|
|
924
|
+
onChange: (e) => {
|
|
925
|
+
if (c) return;
|
|
926
|
+
let t = Math.min(Number(e.target.value), M[1]);
|
|
927
|
+
R([t, M[1]], !1);
|
|
928
|
+
},
|
|
929
|
+
onPointerUp: U,
|
|
930
|
+
onMouseUp: U,
|
|
931
|
+
onTouchEnd: U,
|
|
932
|
+
onKeyUp: U
|
|
933
|
+
}),
|
|
934
|
+
/* @__PURE__ */ h("input", {
|
|
935
|
+
type: "range",
|
|
936
|
+
className: "tp-slider-input tp-slider-input--range tp-slider-input--secondary",
|
|
937
|
+
min: n,
|
|
938
|
+
max: r,
|
|
939
|
+
step: i,
|
|
940
|
+
value: M[1],
|
|
941
|
+
disabled: c,
|
|
942
|
+
"aria-label": x ? `${x} maximum` : "Maximum value",
|
|
943
|
+
onChange: (e) => {
|
|
944
|
+
if (c) return;
|
|
945
|
+
let t = Math.max(Number(e.target.value), M[0]);
|
|
946
|
+
R([M[0], t], !1);
|
|
947
|
+
},
|
|
948
|
+
onPointerUp: U,
|
|
949
|
+
onMouseUp: U,
|
|
950
|
+
onTouchEnd: U,
|
|
951
|
+
onKeyUp: U
|
|
952
|
+
})
|
|
953
|
+
] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
954
|
+
className: "tp-slider-thumb",
|
|
955
|
+
style: { left: `${P}%` },
|
|
956
|
+
"aria-hidden": "true"
|
|
957
|
+
}), /* @__PURE__ */ h("input", {
|
|
958
|
+
type: "range",
|
|
959
|
+
className: "tp-slider-input",
|
|
960
|
+
min: n,
|
|
961
|
+
max: r,
|
|
962
|
+
step: i,
|
|
963
|
+
value: D,
|
|
964
|
+
disabled: c,
|
|
965
|
+
"aria-label": x,
|
|
966
|
+
onChange: z,
|
|
967
|
+
onPointerUp: U,
|
|
968
|
+
onMouseUp: U,
|
|
969
|
+
onTouchEnd: U,
|
|
970
|
+
onKeyUp: U
|
|
971
|
+
})] })]
|
|
972
|
+
}),
|
|
973
|
+
W && a && /* @__PURE__ */ h("div", {
|
|
974
|
+
className: "tp-slider-marks",
|
|
975
|
+
children: a.map((e) => {
|
|
976
|
+
if (e.label === void 0) return null;
|
|
977
|
+
let t = V(e.value, n, r), i = l ? e.value === M[0] || e.value === M[1] : e.value === D;
|
|
978
|
+
return /* @__PURE__ */ h("div", {
|
|
979
|
+
className: [
|
|
980
|
+
"tp-slider-mark",
|
|
981
|
+
t <= 2 ? "tp-slider-mark--start" : t >= 98 ? "tp-slider-mark--end" : "",
|
|
982
|
+
i ? "tp-slider-mark--active" : ""
|
|
983
|
+
].filter(Boolean).join(" "),
|
|
984
|
+
style: { left: `${t}%` },
|
|
985
|
+
children: /* @__PURE__ */ h("button", {
|
|
986
|
+
type: "button",
|
|
987
|
+
className: "tp-slider-mark-btn",
|
|
988
|
+
disabled: c,
|
|
989
|
+
onClick: () => {
|
|
990
|
+
c || (l ? Math.abs(e.value - M[0]) <= Math.abs(e.value - M[1]) ? R([e.value, M[1]], !0) : R([M[0], e.value], !0) : L(e.value, !0));
|
|
991
|
+
},
|
|
992
|
+
children: e.label
|
|
993
|
+
})
|
|
994
|
+
}, e.value);
|
|
995
|
+
})
|
|
996
|
+
})
|
|
997
|
+
]
|
|
998
|
+
});
|
|
999
|
+
}, W = ({ title: e, extra: t, radius: n = "theme", padding: r = "none", divided: i = !1, className: a = "", style: o, children: s }) => {
|
|
1000
|
+
let c = [
|
|
1001
|
+
"tp-list-card",
|
|
1002
|
+
`tp-list-card--radius-${n}`,
|
|
1003
|
+
`tp-list-card--pad-${r}`,
|
|
1004
|
+
i ? "tp-list-card--divided" : "",
|
|
1005
|
+
a
|
|
1006
|
+
].filter(Boolean).join(" ");
|
|
1007
|
+
return /* @__PURE__ */ g("div", {
|
|
1008
|
+
className: c,
|
|
1009
|
+
style: o,
|
|
1010
|
+
children: [(e !== void 0 || t !== void 0) && /* @__PURE__ */ g("div", {
|
|
1011
|
+
className: "tp-list-card-header",
|
|
1012
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1013
|
+
className: "tp-list-card-title",
|
|
1014
|
+
children: e
|
|
1015
|
+
}), t !== void 0 && /* @__PURE__ */ h("div", {
|
|
1016
|
+
className: "tp-list-card-extra",
|
|
1017
|
+
children: t
|
|
1018
|
+
})]
|
|
1019
|
+
}), /* @__PURE__ */ h("div", {
|
|
1020
|
+
className: "tp-list-card-body",
|
|
1021
|
+
children: s
|
|
1022
|
+
})]
|
|
1023
|
+
});
|
|
1024
|
+
}, G = ({ checked: e, defaultChecked: t = !1, onChange: n, disabled: r = !1, loading: i = !1, ariaLabel: a, className: o = "", style: s, fallbackLabel: c }) => {
|
|
1025
|
+
let [l, u] = p(t), d = e !== void 0, f = d ? e : l, m = r || i, g = (e) => {
|
|
1026
|
+
if (e.stopPropagation(), m) return;
|
|
1027
|
+
let t = !f;
|
|
1028
|
+
d || u(t), n?.(t);
|
|
1029
|
+
}, _ = [
|
|
1030
|
+
"tp-switch",
|
|
1031
|
+
f ? "tp-switch--checked" : "",
|
|
1032
|
+
m ? "tp-switch--disabled" : "",
|
|
1033
|
+
i ? "tp-switch--loading" : "",
|
|
1034
|
+
o
|
|
1035
|
+
].filter(Boolean).join(" ");
|
|
1036
|
+
return /* @__PURE__ */ h("button", {
|
|
1037
|
+
type: "button",
|
|
1038
|
+
role: "switch",
|
|
1039
|
+
"aria-checked": f,
|
|
1040
|
+
"aria-label": a ?? c ?? "Toggle",
|
|
1041
|
+
disabled: m,
|
|
1042
|
+
className: _,
|
|
1043
|
+
style: s,
|
|
1044
|
+
onClick: g,
|
|
1045
|
+
children: /* @__PURE__ */ h("span", {
|
|
1046
|
+
className: "tp-switch-thumb",
|
|
1047
|
+
children: i ? /* @__PURE__ */ h("span", {
|
|
1048
|
+
className: "tp-switch-spinner",
|
|
1049
|
+
"aria-hidden": "true"
|
|
1050
|
+
}) : null
|
|
1051
|
+
})
|
|
1052
|
+
});
|
|
1053
|
+
}, K = ({ title: e, subtitle: t, description: n, value: r, leading: i, trailing: a, badge: o, arrow: s = !1, checked: c, switchProps: l, danger: u = !1, disabled: d = !1, onClick: f, className: p = "", style: m }) => {
|
|
1054
|
+
let _ = !!f && !d, v = r != null || o != null || a != null || !!c || !!l || s, y = () => {
|
|
1055
|
+
!d && f && f();
|
|
1056
|
+
}, b = (e) => {
|
|
1057
|
+
_ && e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f?.());
|
|
1058
|
+
}, x = [
|
|
1059
|
+
"tp-list-item",
|
|
1060
|
+
_ ? "tp-list-item--clickable" : "",
|
|
1061
|
+
u ? "tp-list-item--danger" : "",
|
|
1062
|
+
d ? "tp-list-item--disabled" : "",
|
|
1063
|
+
p
|
|
1064
|
+
].filter(Boolean).join(" ");
|
|
1065
|
+
return /* @__PURE__ */ g("div", {
|
|
1066
|
+
className: x,
|
|
1067
|
+
style: m,
|
|
1068
|
+
role: f ? "button" : void 0,
|
|
1069
|
+
tabIndex: _ ? 0 : void 0,
|
|
1070
|
+
"aria-disabled": d || void 0,
|
|
1071
|
+
"data-checked": c === void 0 ? void 0 : String(!!c),
|
|
1072
|
+
onClick: f ? y : void 0,
|
|
1073
|
+
onKeyDown: f ? b : void 0,
|
|
1074
|
+
children: [
|
|
1075
|
+
i != null && /* @__PURE__ */ h("div", {
|
|
1076
|
+
className: "tp-list-item-leading",
|
|
1077
|
+
children: i
|
|
1078
|
+
}),
|
|
1079
|
+
/* @__PURE__ */ g("div", {
|
|
1080
|
+
className: "tp-list-item-content",
|
|
1081
|
+
children: [
|
|
1082
|
+
/* @__PURE__ */ h("div", {
|
|
1083
|
+
className: "tp-list-item-title",
|
|
1084
|
+
children: e
|
|
1085
|
+
}),
|
|
1086
|
+
t != null && /* @__PURE__ */ h("div", {
|
|
1087
|
+
className: "tp-list-item-subtitle",
|
|
1088
|
+
children: t
|
|
1089
|
+
}),
|
|
1090
|
+
n != null && /* @__PURE__ */ h("div", {
|
|
1091
|
+
className: "tp-list-item-description",
|
|
1092
|
+
children: n
|
|
1093
|
+
})
|
|
1094
|
+
]
|
|
1095
|
+
}),
|
|
1096
|
+
v && /* @__PURE__ */ g("div", {
|
|
1097
|
+
className: "tp-list-item-trailing-group",
|
|
1098
|
+
children: [
|
|
1099
|
+
r != null && /* @__PURE__ */ h("div", {
|
|
1100
|
+
className: "tp-list-item-value",
|
|
1101
|
+
children: r
|
|
1102
|
+
}),
|
|
1103
|
+
o != null && /* @__PURE__ */ h("span", {
|
|
1104
|
+
className: "tp-list-item-badge",
|
|
1105
|
+
children: o
|
|
1106
|
+
}),
|
|
1107
|
+
a != null && /* @__PURE__ */ h("div", {
|
|
1108
|
+
className: "tp-list-item-trailing",
|
|
1109
|
+
children: a
|
|
1110
|
+
}),
|
|
1111
|
+
c && /* @__PURE__ */ h("span", {
|
|
1112
|
+
className: "tp-list-item-check",
|
|
1113
|
+
"aria-hidden": "true",
|
|
1114
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1115
|
+
width: "18",
|
|
1116
|
+
height: "18",
|
|
1117
|
+
viewBox: "0 0 18 18",
|
|
1118
|
+
fill: "none",
|
|
1119
|
+
children: /* @__PURE__ */ h("path", {
|
|
1120
|
+
d: "M4 9.2L7.4 12.6L14 5.5",
|
|
1121
|
+
stroke: "currentColor",
|
|
1122
|
+
strokeWidth: "2",
|
|
1123
|
+
strokeLinecap: "round",
|
|
1124
|
+
strokeLinejoin: "round"
|
|
1125
|
+
})
|
|
1126
|
+
})
|
|
1127
|
+
}),
|
|
1128
|
+
l && /* @__PURE__ */ h(G, {
|
|
1129
|
+
...l,
|
|
1130
|
+
disabled: d || l.disabled,
|
|
1131
|
+
fallbackLabel: typeof e == "string" ? e : void 0
|
|
1132
|
+
}),
|
|
1133
|
+
s && /* @__PURE__ */ h("span", {
|
|
1134
|
+
className: "tp-list-item-arrow",
|
|
1135
|
+
"aria-hidden": "true",
|
|
1136
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1137
|
+
width: "16",
|
|
1138
|
+
height: "16",
|
|
1139
|
+
viewBox: "0 0 16 16",
|
|
1140
|
+
fill: "none",
|
|
1141
|
+
children: /* @__PURE__ */ h("path", {
|
|
1142
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
1143
|
+
stroke: "currentColor",
|
|
1144
|
+
strokeWidth: "1.75",
|
|
1145
|
+
strokeLinecap: "round",
|
|
1146
|
+
strokeLinejoin: "round"
|
|
1147
|
+
})
|
|
1148
|
+
})
|
|
1149
|
+
})
|
|
1150
|
+
]
|
|
1151
|
+
})
|
|
1152
|
+
]
|
|
1153
|
+
});
|
|
1154
|
+
}, q = ({ children: e, tone: t = "focus", align: n = "center", disabled: r = !1, onClick: i, className: a = "", style: o }) => {
|
|
1155
|
+
let s = [
|
|
1156
|
+
"tp-list-button",
|
|
1157
|
+
`tp-list-button--tone-${t}`,
|
|
1158
|
+
`tp-list-button--align-${n}`,
|
|
1159
|
+
r ? "tp-list-button--disabled" : "",
|
|
1160
|
+
a
|
|
1161
|
+
].filter(Boolean).join(" ");
|
|
1162
|
+
return /* @__PURE__ */ h("button", {
|
|
1163
|
+
type: "button",
|
|
1164
|
+
className: s,
|
|
1165
|
+
style: o,
|
|
1166
|
+
disabled: r,
|
|
1167
|
+
onClick: r ? void 0 : i,
|
|
1168
|
+
children: e
|
|
1169
|
+
});
|
|
1170
|
+
}, J = ({ title: e, count: t, action: n, className: r = "", style: i }) => {
|
|
1171
|
+
let a = ["tp-section-header", r].filter(Boolean).join(" ");
|
|
1172
|
+
return /* @__PURE__ */ g("div", {
|
|
1173
|
+
className: a,
|
|
1174
|
+
style: i,
|
|
1175
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1176
|
+
className: "tp-section-header-left",
|
|
1177
|
+
children: [/* @__PURE__ */ h("span", {
|
|
1178
|
+
className: "tp-section-header-title",
|
|
1179
|
+
children: e
|
|
1180
|
+
}), t != null && /* @__PURE__ */ g("span", {
|
|
1181
|
+
className: "tp-section-header-count",
|
|
1182
|
+
children: [
|
|
1183
|
+
" (",
|
|
1184
|
+
t,
|
|
1185
|
+
")"
|
|
1186
|
+
]
|
|
1187
|
+
})]
|
|
1188
|
+
}), n != null && /* @__PURE__ */ h("div", {
|
|
1189
|
+
className: "tp-section-header-action",
|
|
1190
|
+
children: n
|
|
1191
|
+
})]
|
|
1192
|
+
});
|
|
1193
|
+
}, ee = ({ children: e, tone: t = "default", className: n = "", style: r }) => {
|
|
1194
|
+
let i = [
|
|
1195
|
+
"tp-section-note",
|
|
1196
|
+
`tp-section-note--${t}`,
|
|
1197
|
+
n
|
|
1198
|
+
].filter(Boolean).join(" ");
|
|
1199
|
+
return /* @__PURE__ */ h("div", {
|
|
1200
|
+
className: i,
|
|
1201
|
+
style: r,
|
|
1202
|
+
children: e
|
|
1203
|
+
});
|
|
1204
|
+
}, te = {
|
|
1205
|
+
title1: "h1",
|
|
1206
|
+
title2: "h2",
|
|
1207
|
+
title3: "h3",
|
|
1208
|
+
title4: "h4",
|
|
1209
|
+
body: "span",
|
|
1210
|
+
subhead: "span",
|
|
1211
|
+
caption: "span",
|
|
1212
|
+
footnote: "span"
|
|
1213
|
+
}, ne = ({ variant: e = "body", tone: t = "primary", as: n, weight: r, className: i = "", style: a, children: o }) => {
|
|
1214
|
+
let s = n ?? te[e], c = [
|
|
1215
|
+
"tp-text",
|
|
1216
|
+
`tp-text--${e}`,
|
|
1217
|
+
`tp-text--tone-${t}`,
|
|
1218
|
+
r ? `tp-text--weight-${r}` : "",
|
|
1219
|
+
i
|
|
1220
|
+
].filter(Boolean).join(" ");
|
|
1221
|
+
return /* @__PURE__ */ h(s, {
|
|
1222
|
+
className: c,
|
|
1223
|
+
style: a,
|
|
1224
|
+
children: o
|
|
1225
|
+
});
|
|
1226
|
+
}, re = ({ children: e, tone: t, selected: n, size: r = "md", closable: i = !1, onClose: a, onClick: o, className: s = "", style: c }) => {
|
|
1227
|
+
let l = t ?? (n ? "focus" : "neutral"), u = n === !0 ? "tp-tag--selected" : n === !1 ? "tp-tag--unselected" : "", d = [
|
|
1228
|
+
"tp-tag",
|
|
1229
|
+
`tp-tag--${r}`,
|
|
1230
|
+
`tp-tag--tone-${l}`,
|
|
1231
|
+
u,
|
|
1232
|
+
o ? "tp-tag--clickable" : "",
|
|
1233
|
+
s
|
|
1234
|
+
].filter(Boolean).join(" ");
|
|
1235
|
+
return o && !i ? /* @__PURE__ */ h("button", {
|
|
1236
|
+
type: "button",
|
|
1237
|
+
className: d,
|
|
1238
|
+
style: c,
|
|
1239
|
+
"aria-pressed": n === void 0 ? void 0 : n,
|
|
1240
|
+
onClick: o,
|
|
1241
|
+
children: /* @__PURE__ */ h("span", { children: e })
|
|
1242
|
+
}) : /* @__PURE__ */ g("span", {
|
|
1243
|
+
className: d,
|
|
1244
|
+
style: c,
|
|
1245
|
+
role: o ? "button" : void 0,
|
|
1246
|
+
tabIndex: o ? 0 : void 0,
|
|
1247
|
+
"aria-pressed": o && n !== void 0 ? n : void 0,
|
|
1248
|
+
onClick: o,
|
|
1249
|
+
onKeyDown: o ? (e) => {
|
|
1250
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
|
|
1251
|
+
} : void 0,
|
|
1252
|
+
children: [/* @__PURE__ */ h("span", { children: e }), i ? /* @__PURE__ */ h("button", {
|
|
1253
|
+
type: "button",
|
|
1254
|
+
className: "tp-tag-close",
|
|
1255
|
+
"aria-label": "Remove tag",
|
|
1256
|
+
onClick: (e) => {
|
|
1257
|
+
e.stopPropagation(), a?.();
|
|
1258
|
+
},
|
|
1259
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1260
|
+
width: "10",
|
|
1261
|
+
height: "10",
|
|
1262
|
+
viewBox: "0 0 10 10",
|
|
1263
|
+
fill: "none",
|
|
1264
|
+
"aria-hidden": "true",
|
|
1265
|
+
children: /* @__PURE__ */ h("path", {
|
|
1266
|
+
d: "M2.2 2.2L7.8 7.8M7.8 2.2L2.2 7.8",
|
|
1267
|
+
stroke: "currentColor",
|
|
1268
|
+
strokeWidth: "1.5",
|
|
1269
|
+
strokeLinecap: "round"
|
|
1270
|
+
})
|
|
1271
|
+
})
|
|
1272
|
+
}) : null]
|
|
1273
|
+
});
|
|
1274
|
+
}, ie = ({ count: e, dot: t = !1, tone: n = "alert", max: r = 99, showZero: i = !1, children: a, className: o = "", style: s }) => {
|
|
1275
|
+
let c = null, l = !1;
|
|
1276
|
+
t ? l = !0 : e != null && (typeof e == "number" ? (e > 0 || e === 0 && i) && (l = !0, c = e > r ? `${r}+` : String(e)) : e !== "" && (e !== "0" || i) && (l = !0, c = e));
|
|
1277
|
+
let u = l ? /* @__PURE__ */ h("span", {
|
|
1278
|
+
className: [
|
|
1279
|
+
"tp-badge",
|
|
1280
|
+
t ? "tp-badge--dot" : "",
|
|
1281
|
+
a ? "tp-badge--floating" : "",
|
|
1282
|
+
`tp-badge--tone-${n}`,
|
|
1283
|
+
a ? "" : o
|
|
1284
|
+
].filter(Boolean).join(" "),
|
|
1285
|
+
style: a ? void 0 : s,
|
|
1286
|
+
children: t ? null : c
|
|
1287
|
+
}) : null;
|
|
1288
|
+
return a ? /* @__PURE__ */ g("span", {
|
|
1289
|
+
className: `tp-badge-wrapper ${o}`.trim(),
|
|
1290
|
+
style: s,
|
|
1291
|
+
children: [a, u]
|
|
1292
|
+
}) : u;
|
|
1293
|
+
}, ae = ({ illustration: e, theme: n, icon: r, title: i, description: a, actionText: o, onAction: s, compact: c = !1, className: l = "", style: u }) => {
|
|
1294
|
+
let d = [
|
|
1295
|
+
"tp-empty-state",
|
|
1296
|
+
c ? "tp-empty-state--compact" : "",
|
|
1297
|
+
l
|
|
1298
|
+
].filter(Boolean).join(" ");
|
|
1299
|
+
return /* @__PURE__ */ g("div", {
|
|
1300
|
+
className: d,
|
|
1301
|
+
style: u,
|
|
1302
|
+
children: [
|
|
1303
|
+
e ? /* @__PURE__ */ h("div", {
|
|
1304
|
+
className: "tp-empty-state-media",
|
|
1305
|
+
children: /* @__PURE__ */ h(t, {
|
|
1306
|
+
name: e,
|
|
1307
|
+
theme: n,
|
|
1308
|
+
width: c ? 180 : 240
|
|
1309
|
+
})
|
|
1310
|
+
}) : r ? /* @__PURE__ */ h("div", {
|
|
1311
|
+
className: "tp-empty-state-icon",
|
|
1312
|
+
children: r
|
|
1313
|
+
}) : null,
|
|
1314
|
+
/* @__PURE__ */ h("div", {
|
|
1315
|
+
className: "tp-empty-state-title",
|
|
1316
|
+
children: i
|
|
1317
|
+
}),
|
|
1318
|
+
a != null && /* @__PURE__ */ h("div", {
|
|
1319
|
+
className: "tp-empty-state-description",
|
|
1320
|
+
children: a
|
|
1321
|
+
}),
|
|
1322
|
+
o && /* @__PURE__ */ h("button", {
|
|
1323
|
+
type: "button",
|
|
1324
|
+
className: "tp-empty-state-action",
|
|
1325
|
+
onClick: s,
|
|
1326
|
+
children: o
|
|
1327
|
+
})
|
|
1328
|
+
]
|
|
1329
|
+
});
|
|
1330
|
+
}, oe = ({ 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: d, prefix: m, suffix: _, containerClassName: v = "", className: y = "", style: b, id: x, type: S = "text", disabled: C = !1, readOnly: w = !1, onFocus: T, onBlur: E, ...D }) => {
|
|
1331
|
+
let O = l(), k = x ?? `tp-input-${O}`, A = `${k}-message`, j = f(null), M = f(null), [N, P] = p(r), [F, I] = p(!1), [L, R] = p(!1), z = n !== void 0, B = z ? n : N, V = !!(u || d), H = (e) => {
|
|
1332
|
+
z || P(e), i?.(e);
|
|
1333
|
+
}, U = () => {
|
|
1334
|
+
H(""), s ? M.current?.focus() : j.current?.focus();
|
|
1335
|
+
}, W = a && B.length > 0 && !C && !w, G = o && !s, K = o ? L ? "text" : "password" : S, q = [
|
|
1336
|
+
"tp-input-field",
|
|
1337
|
+
`tp-input-field--${e}`,
|
|
1338
|
+
v
|
|
1339
|
+
].filter(Boolean).join(" "), J = [
|
|
1340
|
+
"tp-input-box",
|
|
1341
|
+
`tp-input-box--variant-${e}`,
|
|
1342
|
+
s ? "tp-input-box--multiline" : "",
|
|
1343
|
+
F ? "tp-input-box--focused" : "",
|
|
1344
|
+
u ? "tp-input-box--error" : "",
|
|
1345
|
+
C ? "tp-input-box--disabled" : ""
|
|
1346
|
+
].filter(Boolean).join(" ");
|
|
1347
|
+
return /* @__PURE__ */ g("div", {
|
|
1348
|
+
className: q,
|
|
1349
|
+
"data-variant": e,
|
|
1350
|
+
children: [
|
|
1351
|
+
e !== "borderless" && t != null && /* @__PURE__ */ h("label", {
|
|
1352
|
+
htmlFor: k,
|
|
1353
|
+
className: "tp-input-label",
|
|
1354
|
+
children: t
|
|
1355
|
+
}),
|
|
1356
|
+
/* @__PURE__ */ g("div", {
|
|
1357
|
+
className: J,
|
|
1358
|
+
children: [
|
|
1359
|
+
m != null && /* @__PURE__ */ h("span", {
|
|
1360
|
+
className: "tp-input-prefix",
|
|
1361
|
+
children: m
|
|
1362
|
+
}),
|
|
1363
|
+
s ? /* @__PURE__ */ h("textarea", {
|
|
1364
|
+
ref: M,
|
|
1365
|
+
id: k,
|
|
1366
|
+
name: D.name,
|
|
1367
|
+
rows: c,
|
|
1368
|
+
placeholder: D.placeholder,
|
|
1369
|
+
maxLength: D.maxLength,
|
|
1370
|
+
autoFocus: D.autoFocus,
|
|
1371
|
+
autoComplete: D.autoComplete,
|
|
1372
|
+
required: D.required,
|
|
1373
|
+
disabled: C,
|
|
1374
|
+
readOnly: w,
|
|
1375
|
+
value: B,
|
|
1376
|
+
"aria-label": D["aria-label"],
|
|
1377
|
+
"aria-invalid": u ? !0 : void 0,
|
|
1378
|
+
"aria-describedby": V ? A : D["aria-describedby"],
|
|
1379
|
+
className: `tp-input-textarea ${y}`.trim(),
|
|
1380
|
+
style: b,
|
|
1381
|
+
onChange: (e) => H(e.target.value),
|
|
1382
|
+
onFocus: (e) => {
|
|
1383
|
+
I(!0), T?.(e);
|
|
1384
|
+
},
|
|
1385
|
+
onBlur: (e) => {
|
|
1386
|
+
I(!1), E?.(e);
|
|
1387
|
+
}
|
|
1388
|
+
}) : /* @__PURE__ */ h("input", {
|
|
1389
|
+
...D,
|
|
1390
|
+
ref: j,
|
|
1391
|
+
id: k,
|
|
1392
|
+
type: K,
|
|
1393
|
+
disabled: C,
|
|
1394
|
+
readOnly: w,
|
|
1395
|
+
value: B,
|
|
1396
|
+
"aria-invalid": u ? !0 : void 0,
|
|
1397
|
+
"aria-describedby": V ? A : D["aria-describedby"],
|
|
1398
|
+
className: `tp-input-control ${y}`.trim(),
|
|
1399
|
+
style: b,
|
|
1400
|
+
onChange: (e) => H(e.target.value),
|
|
1401
|
+
onFocus: (e) => {
|
|
1402
|
+
I(!0), T?.(e);
|
|
1403
|
+
},
|
|
1404
|
+
onBlur: (e) => {
|
|
1405
|
+
I(!1), E?.(e);
|
|
1406
|
+
}
|
|
1407
|
+
}),
|
|
1408
|
+
W && /* @__PURE__ */ h("button", {
|
|
1409
|
+
type: "button",
|
|
1410
|
+
className: "tp-input-action-btn",
|
|
1411
|
+
"aria-label": "Clear input",
|
|
1412
|
+
onClick: U,
|
|
1413
|
+
children: /* @__PURE__ */ g("svg", {
|
|
1414
|
+
width: "14",
|
|
1415
|
+
height: "14",
|
|
1416
|
+
viewBox: "0 0 14 14",
|
|
1417
|
+
fill: "none",
|
|
1418
|
+
"aria-hidden": "true",
|
|
1419
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
1420
|
+
cx: "7",
|
|
1421
|
+
cy: "7",
|
|
1422
|
+
r: "6",
|
|
1423
|
+
fill: "currentColor",
|
|
1424
|
+
fillOpacity: "0.2"
|
|
1425
|
+
}), /* @__PURE__ */ h("path", {
|
|
1426
|
+
d: "M4.8 4.8L9.2 9.2M9.2 4.8L4.8 9.2",
|
|
1427
|
+
stroke: "currentColor",
|
|
1428
|
+
strokeWidth: "1.4",
|
|
1429
|
+
strokeLinecap: "round"
|
|
1430
|
+
})]
|
|
1431
|
+
})
|
|
1432
|
+
}),
|
|
1433
|
+
G && /* @__PURE__ */ h("button", {
|
|
1434
|
+
type: "button",
|
|
1435
|
+
className: "tp-input-action-btn",
|
|
1436
|
+
"aria-label": L ? "Hide password" : "Show password",
|
|
1437
|
+
onClick: () => R((e) => !e),
|
|
1438
|
+
children: L ? /* @__PURE__ */ g("svg", {
|
|
1439
|
+
width: "18",
|
|
1440
|
+
height: "18",
|
|
1441
|
+
viewBox: "0 0 20 20",
|
|
1442
|
+
fill: "none",
|
|
1443
|
+
"aria-hidden": "true",
|
|
1444
|
+
children: [/* @__PURE__ */ h("path", {
|
|
1445
|
+
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",
|
|
1446
|
+
stroke: "currentColor",
|
|
1447
|
+
strokeWidth: "1.5"
|
|
1448
|
+
}), /* @__PURE__ */ h("circle", {
|
|
1449
|
+
cx: "10",
|
|
1450
|
+
cy: "10",
|
|
1451
|
+
r: "2.5",
|
|
1452
|
+
stroke: "currentColor",
|
|
1453
|
+
strokeWidth: "1.5"
|
|
1454
|
+
})]
|
|
1455
|
+
}) : /* @__PURE__ */ h("svg", {
|
|
1456
|
+
width: "18",
|
|
1457
|
+
height: "18",
|
|
1458
|
+
viewBox: "0 0 20 20",
|
|
1459
|
+
fill: "none",
|
|
1460
|
+
"aria-hidden": "true",
|
|
1461
|
+
children: /* @__PURE__ */ h("path", {
|
|
1462
|
+
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",
|
|
1463
|
+
stroke: "currentColor",
|
|
1464
|
+
strokeWidth: "1.5",
|
|
1465
|
+
strokeLinecap: "round"
|
|
1466
|
+
})
|
|
1467
|
+
})
|
|
1468
|
+
}),
|
|
1469
|
+
_ != null && /* @__PURE__ */ h("span", {
|
|
1470
|
+
className: "tp-input-suffix",
|
|
1471
|
+
children: _
|
|
1472
|
+
})
|
|
1473
|
+
]
|
|
1474
|
+
}),
|
|
1475
|
+
u ? /* @__PURE__ */ h("div", {
|
|
1476
|
+
id: A,
|
|
1477
|
+
className: "tp-input-error",
|
|
1478
|
+
role: "alert",
|
|
1479
|
+
children: u
|
|
1480
|
+
}) : d ? /* @__PURE__ */ h("div", {
|
|
1481
|
+
id: A,
|
|
1482
|
+
className: "tp-input-helper",
|
|
1483
|
+
children: d
|
|
1484
|
+
}) : null
|
|
1485
|
+
]
|
|
1486
|
+
});
|
|
1487
|
+
}, se = ({ value: e, defaultValue: t = "", placeholder: n = "Search", onChange: r, onSearch: i, onCancel: a, showCancel: o = !1, autoFocus: s = !1, className: c = "", style: l }) => {
|
|
1488
|
+
let u = f(null), [d, m] = p(t), _ = e !== void 0, v = _ ? e : d, y = (e) => {
|
|
1489
|
+
_ || m(e), r?.(e);
|
|
1490
|
+
};
|
|
1491
|
+
return /* @__PURE__ */ g("div", {
|
|
1492
|
+
className: `tp-search-bar ${c}`.trim(),
|
|
1493
|
+
style: l,
|
|
1494
|
+
children: [/* @__PURE__ */ g("div", {
|
|
1495
|
+
className: "tp-search-field",
|
|
1496
|
+
children: [
|
|
1497
|
+
/* @__PURE__ */ h("span", {
|
|
1498
|
+
className: "tp-search-icon",
|
|
1499
|
+
"aria-hidden": "true",
|
|
1500
|
+
children: /* @__PURE__ */ g("svg", {
|
|
1501
|
+
width: "16",
|
|
1502
|
+
height: "16",
|
|
1503
|
+
viewBox: "0 0 16 16",
|
|
1504
|
+
fill: "none",
|
|
1505
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
1506
|
+
cx: "7",
|
|
1507
|
+
cy: "7",
|
|
1508
|
+
r: "4.8",
|
|
1509
|
+
stroke: "currentColor",
|
|
1510
|
+
strokeWidth: "1.6"
|
|
1511
|
+
}), /* @__PURE__ */ h("path", {
|
|
1512
|
+
d: "M10.6 10.6L14 14",
|
|
1513
|
+
stroke: "currentColor",
|
|
1514
|
+
strokeWidth: "1.6",
|
|
1515
|
+
strokeLinecap: "round"
|
|
1516
|
+
})]
|
|
1517
|
+
})
|
|
1518
|
+
}),
|
|
1519
|
+
/* @__PURE__ */ h("input", {
|
|
1520
|
+
ref: u,
|
|
1521
|
+
type: "search",
|
|
1522
|
+
className: "tp-search-input",
|
|
1523
|
+
value: v,
|
|
1524
|
+
placeholder: n,
|
|
1525
|
+
"aria-label": n,
|
|
1526
|
+
autoFocus: s,
|
|
1527
|
+
onChange: (e) => y(e.target.value),
|
|
1528
|
+
onKeyDown: (e) => {
|
|
1529
|
+
e.key === "Enter" && (e.preventDefault(), i?.(v));
|
|
1530
|
+
}
|
|
1531
|
+
}),
|
|
1532
|
+
v.length > 0 && /* @__PURE__ */ h("button", {
|
|
1533
|
+
type: "button",
|
|
1534
|
+
className: "tp-search-clear",
|
|
1535
|
+
"aria-label": "Clear search",
|
|
1536
|
+
onClick: () => {
|
|
1537
|
+
y(""), u.current?.focus();
|
|
1538
|
+
},
|
|
1539
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1540
|
+
width: "10",
|
|
1541
|
+
height: "10",
|
|
1542
|
+
viewBox: "0 0 10 10",
|
|
1543
|
+
fill: "none",
|
|
1544
|
+
"aria-hidden": "true",
|
|
1545
|
+
children: /* @__PURE__ */ h("path", {
|
|
1546
|
+
d: "M2.5 2.5L7.5 7.5M7.5 2.5L2.5 7.5",
|
|
1547
|
+
stroke: "currentColor",
|
|
1548
|
+
strokeWidth: "1.5",
|
|
1549
|
+
strokeLinecap: "round"
|
|
1550
|
+
})
|
|
1551
|
+
})
|
|
1552
|
+
})
|
|
1553
|
+
]
|
|
1554
|
+
}), o && /* @__PURE__ */ h("button", {
|
|
1555
|
+
type: "button",
|
|
1556
|
+
className: "tp-search-cancel",
|
|
1557
|
+
onClick: a,
|
|
1558
|
+
children: "Cancel"
|
|
1559
|
+
})]
|
|
1560
|
+
});
|
|
1561
|
+
}, ce = ({ column: e, itemHeight: t, visibleItems: n, onChange: r }) => {
|
|
1562
|
+
let i = f(null), a = Math.max(0, e.options.findIndex((t) => t.value === e.value)), o = Math.floor(n / 2) * t;
|
|
1563
|
+
c(() => {
|
|
1564
|
+
let e = i.current;
|
|
1565
|
+
if (!e) return;
|
|
1566
|
+
let n = a * t;
|
|
1567
|
+
typeof e.scrollTo == "function" ? e.scrollTo({
|
|
1568
|
+
top: n,
|
|
1569
|
+
behavior: "smooth"
|
|
1570
|
+
}) : e.scrollTop = n;
|
|
1571
|
+
}, [a, t]);
|
|
1572
|
+
let s = (t) => {
|
|
1573
|
+
let n = Math.min(e.options.length - 1, Math.max(0, a + t)), i = e.options[n];
|
|
1574
|
+
i && i.value !== e.value && r(e.key, i.value);
|
|
1575
|
+
};
|
|
1576
|
+
return /* @__PURE__ */ g("div", {
|
|
1577
|
+
className: "tp-wheel-column-wrap",
|
|
1578
|
+
children: [
|
|
1579
|
+
/* @__PURE__ */ h("button", {
|
|
1580
|
+
type: "button",
|
|
1581
|
+
className: "tp-wheel-step tp-wheel-step--up",
|
|
1582
|
+
"aria-label": `Previous ${e.key}`,
|
|
1583
|
+
disabled: a <= 0,
|
|
1584
|
+
onClick: () => s(-1),
|
|
1585
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1586
|
+
width: "12",
|
|
1587
|
+
height: "12",
|
|
1588
|
+
viewBox: "0 0 12 12",
|
|
1589
|
+
fill: "none",
|
|
1590
|
+
"aria-hidden": "true",
|
|
1591
|
+
children: /* @__PURE__ */ h("path", {
|
|
1592
|
+
d: "M3 7.5L6 4.5L9 7.5",
|
|
1593
|
+
stroke: "currentColor",
|
|
1594
|
+
strokeWidth: "1.5",
|
|
1595
|
+
strokeLinecap: "round",
|
|
1596
|
+
strokeLinejoin: "round"
|
|
1597
|
+
})
|
|
1598
|
+
})
|
|
1599
|
+
}),
|
|
1600
|
+
/* @__PURE__ */ g("div", {
|
|
1601
|
+
ref: i,
|
|
1602
|
+
role: "listbox",
|
|
1603
|
+
"aria-label": e.key,
|
|
1604
|
+
tabIndex: 0,
|
|
1605
|
+
className: "tp-wheel-column",
|
|
1606
|
+
style: { height: n * t },
|
|
1607
|
+
onKeyDown: (t) => {
|
|
1608
|
+
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));
|
|
1609
|
+
},
|
|
1610
|
+
children: [
|
|
1611
|
+
/* @__PURE__ */ h("div", {
|
|
1612
|
+
className: "tp-wheel-spacer",
|
|
1613
|
+
style: { height: o }
|
|
1614
|
+
}),
|
|
1615
|
+
e.options.map((n) => {
|
|
1616
|
+
let i = n.value === e.value;
|
|
1617
|
+
return /* @__PURE__ */ h("button", {
|
|
1618
|
+
type: "button",
|
|
1619
|
+
role: "option",
|
|
1620
|
+
"aria-selected": i,
|
|
1621
|
+
className: `tp-wheel-item ${i ? "tp-wheel-item--selected" : ""}`.trim(),
|
|
1622
|
+
style: { height: t },
|
|
1623
|
+
onClick: () => {
|
|
1624
|
+
n.value !== e.value && r(e.key, n.value);
|
|
1625
|
+
},
|
|
1626
|
+
children: n.label
|
|
1627
|
+
}, n.value);
|
|
1628
|
+
}),
|
|
1629
|
+
/* @__PURE__ */ h("div", {
|
|
1630
|
+
className: "tp-wheel-spacer",
|
|
1631
|
+
style: { height: o }
|
|
1632
|
+
})
|
|
1633
|
+
]
|
|
1634
|
+
}),
|
|
1635
|
+
/* @__PURE__ */ h("button", {
|
|
1636
|
+
type: "button",
|
|
1637
|
+
className: "tp-wheel-step tp-wheel-step--down",
|
|
1638
|
+
"aria-label": `Next ${e.key}`,
|
|
1639
|
+
disabled: a >= e.options.length - 1,
|
|
1640
|
+
onClick: () => s(1),
|
|
1641
|
+
children: /* @__PURE__ */ h("svg", {
|
|
1642
|
+
width: "12",
|
|
1643
|
+
height: "12",
|
|
1644
|
+
viewBox: "0 0 12 12",
|
|
1645
|
+
fill: "none",
|
|
1646
|
+
"aria-hidden": "true",
|
|
1647
|
+
children: /* @__PURE__ */ h("path", {
|
|
1648
|
+
d: "M3 4.5L6 7.5L9 4.5",
|
|
1649
|
+
stroke: "currentColor",
|
|
1650
|
+
strokeWidth: "1.5",
|
|
1651
|
+
strokeLinecap: "round",
|
|
1652
|
+
strokeLinejoin: "round"
|
|
1653
|
+
})
|
|
1654
|
+
})
|
|
1655
|
+
})
|
|
1656
|
+
]
|
|
1657
|
+
});
|
|
1658
|
+
}, Y = ({ columns: e, onChange: t, itemHeight: n = 40, visibleItems: r = 5, className: i = "", style: a }) => {
|
|
1659
|
+
let o = Math.floor(r / 2) * n;
|
|
1660
|
+
return /* @__PURE__ */ g("div", {
|
|
1661
|
+
className: `tp-wheel-picker ${i}`.trim(),
|
|
1662
|
+
style: {
|
|
1663
|
+
height: r * n,
|
|
1664
|
+
...a
|
|
1665
|
+
},
|
|
1666
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1667
|
+
className: "tp-wheel-highlight",
|
|
1668
|
+
style: {
|
|
1669
|
+
top: o,
|
|
1670
|
+
height: n
|
|
1671
|
+
},
|
|
1672
|
+
"aria-hidden": "true"
|
|
1673
|
+
}), /* @__PURE__ */ h("div", {
|
|
1674
|
+
className: "tp-wheel-columns",
|
|
1675
|
+
children: e.map((e) => /* @__PURE__ */ h(ce, {
|
|
1676
|
+
column: e,
|
|
1677
|
+
itemHeight: n,
|
|
1678
|
+
visibleItems: r,
|
|
1679
|
+
onChange: t
|
|
1680
|
+
}, e.key))
|
|
1681
|
+
})]
|
|
1682
|
+
});
|
|
1683
|
+
};
|
|
1684
|
+
// src/core/components/TPDatePicker.tsx
|
|
1685
|
+
function X(e, t) {
|
|
1686
|
+
return new Date(e, t, 0).getDate();
|
|
1687
|
+
}
|
|
1688
|
+
function Z(e, t, n) {
|
|
1689
|
+
return Math.min(n, Math.max(t, e));
|
|
1690
|
+
}
|
|
1691
|
+
var le = ({ value: e, defaultValue: t, minYear: n = 1990, maxYear: r = 2040, onChange: i, onConfirm: a, onCancel: o, title: s, className: c = "", style: l }) => {
|
|
1692
|
+
let [u, f] = p(() => t ?? new Date(2026, 0, 1)), m = e !== void 0, _ = m ? e : u, v = Z(_.getFullYear(), n, r), y = _.getMonth() + 1, b = X(v, y), x = Math.min(b, _.getDate()), S = d(() => {
|
|
1693
|
+
let e = [];
|
|
1694
|
+
for (let t = n; t <= r; t++) e.push({
|
|
1695
|
+
value: String(t),
|
|
1696
|
+
label: String(t)
|
|
1697
|
+
});
|
|
1698
|
+
let t = Array.from({ length: 12 }, (e, t) => {
|
|
1699
|
+
let n = t + 1;
|
|
1700
|
+
return {
|
|
1701
|
+
value: String(n),
|
|
1702
|
+
label: String(n).padStart(2, "0")
|
|
1703
|
+
};
|
|
1704
|
+
}), i = Array.from({ length: b }, (e, t) => {
|
|
1705
|
+
let n = t + 1;
|
|
1706
|
+
return {
|
|
1707
|
+
value: String(n),
|
|
1708
|
+
label: String(n).padStart(2, "0")
|
|
1709
|
+
};
|
|
1710
|
+
});
|
|
1711
|
+
return [
|
|
1712
|
+
{
|
|
1713
|
+
key: "year",
|
|
1714
|
+
options: e,
|
|
1715
|
+
value: String(v)
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
key: "month",
|
|
1719
|
+
options: t,
|
|
1720
|
+
value: String(y)
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
key: "day",
|
|
1724
|
+
options: i,
|
|
1725
|
+
value: String(x)
|
|
1726
|
+
}
|
|
1727
|
+
];
|
|
1728
|
+
}, [
|
|
1729
|
+
n,
|
|
1730
|
+
r,
|
|
1731
|
+
b,
|
|
1732
|
+
v,
|
|
1733
|
+
y,
|
|
1734
|
+
x
|
|
1735
|
+
]), C = (e, t) => {
|
|
1736
|
+
let a = Number(t);
|
|
1737
|
+
if (Number.isNaN(a)) return;
|
|
1738
|
+
let o = v, s = y, c = x;
|
|
1739
|
+
e === "year" && (o = Z(a, n, r)), e === "month" && (s = a), e === "day" && (c = a);
|
|
1740
|
+
let l = Math.min(c, X(o, s)), u = new Date(o, s - 1, l);
|
|
1741
|
+
m || f(u), i?.(u);
|
|
1742
|
+
}, w = s !== void 0 || o !== void 0 || a !== void 0;
|
|
1743
|
+
return /* @__PURE__ */ g("div", {
|
|
1744
|
+
className: `tp-date-picker ${c}`.trim(),
|
|
1745
|
+
style: l,
|
|
1746
|
+
children: [w && /* @__PURE__ */ g("div", {
|
|
1747
|
+
className: "tp-date-picker-header",
|
|
1748
|
+
children: [
|
|
1749
|
+
o ? /* @__PURE__ */ h("button", {
|
|
1750
|
+
type: "button",
|
|
1751
|
+
className: "tp-date-picker-btn",
|
|
1752
|
+
onClick: o,
|
|
1753
|
+
children: "Cancel"
|
|
1754
|
+
}) : /* @__PURE__ */ h("span", {}),
|
|
1755
|
+
s !== void 0 && /* @__PURE__ */ h("div", {
|
|
1756
|
+
className: "tp-date-picker-title",
|
|
1757
|
+
children: s
|
|
1758
|
+
}),
|
|
1759
|
+
a ? /* @__PURE__ */ h("button", {
|
|
1760
|
+
type: "button",
|
|
1761
|
+
className: "tp-date-picker-btn tp-date-picker-btn--confirm",
|
|
1762
|
+
onClick: () => a(new Date(v, y - 1, x)),
|
|
1763
|
+
children: "Confirm"
|
|
1764
|
+
}) : /* @__PURE__ */ h("span", {})
|
|
1765
|
+
]
|
|
1766
|
+
}), /* @__PURE__ */ h(Y, {
|
|
1767
|
+
columns: S,
|
|
1768
|
+
onChange: C
|
|
1769
|
+
})]
|
|
1770
|
+
});
|
|
1771
|
+
};
|
|
1772
|
+
// src/core/components/TPTimePicker.tsx
|
|
1773
|
+
function Q(e, t) {
|
|
1774
|
+
let n = e.hour, r = e.period;
|
|
1775
|
+
return t ? (r ||= n >= 12 ? "PM" : "AM", n === 0 ? n = 12 : n > 12 && (n -= 12), {
|
|
1776
|
+
hour: Math.min(12, Math.max(1, n)),
|
|
1777
|
+
minute: Math.min(59, Math.max(0, e.minute)),
|
|
1778
|
+
period: r
|
|
1779
|
+
}) : {
|
|
1780
|
+
hour: Math.min(23, Math.max(0, n)),
|
|
1781
|
+
minute: Math.min(59, Math.max(0, e.minute))
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
var ue = ({ value: e, use12Hour: t = !1, minuteStep: n = 1, onChange: r, className: i = "", style: a }) => {
|
|
1785
|
+
let [o, s] = p(() => Q({
|
|
1786
|
+
hour: 9,
|
|
1787
|
+
minute: 0,
|
|
1788
|
+
period: "AM"
|
|
1789
|
+
}, t)), c = e !== void 0, l = Q(c ? e : o, t), u = Math.max(1, n), f = d(() => {
|
|
1790
|
+
let e = [];
|
|
1791
|
+
for (let t = 0; t < 60; t += u) e.push({
|
|
1792
|
+
value: String(t),
|
|
1793
|
+
label: String(t).padStart(2, "0")
|
|
1794
|
+
});
|
|
1795
|
+
return e;
|
|
1796
|
+
}, [u]), m = d(() => {
|
|
1797
|
+
let e = Number(f[0]?.value ?? 0), t = Math.abs(l.minute - e);
|
|
1798
|
+
for (let n of f) {
|
|
1799
|
+
let r = Number(n.value), i = Math.abs(l.minute - r);
|
|
1800
|
+
i < t && (e = r, t = i);
|
|
1801
|
+
}
|
|
1802
|
+
return e;
|
|
1803
|
+
}, [l.minute, f]), g = d(() => {
|
|
1804
|
+
let e = [{
|
|
1805
|
+
key: "hour",
|
|
1806
|
+
options: t ? Array.from({ length: 12 }, (e, t) => {
|
|
1807
|
+
let n = t + 1;
|
|
1808
|
+
return {
|
|
1809
|
+
value: String(n),
|
|
1810
|
+
label: String(n).padStart(2, "0")
|
|
1811
|
+
};
|
|
1812
|
+
}) : Array.from({ length: 24 }, (e, t) => ({
|
|
1813
|
+
value: String(t),
|
|
1814
|
+
label: String(t).padStart(2, "0")
|
|
1815
|
+
})),
|
|
1816
|
+
value: String(l.hour)
|
|
1817
|
+
}, {
|
|
1818
|
+
key: "minute",
|
|
1819
|
+
options: f,
|
|
1820
|
+
value: String(m)
|
|
1821
|
+
}];
|
|
1822
|
+
return t && e.push({
|
|
1823
|
+
key: "period",
|
|
1824
|
+
options: [{
|
|
1825
|
+
value: "AM",
|
|
1826
|
+
label: "AM"
|
|
1827
|
+
}, {
|
|
1828
|
+
value: "PM",
|
|
1829
|
+
label: "PM"
|
|
1830
|
+
}],
|
|
1831
|
+
value: l.period ?? "AM"
|
|
1832
|
+
}), e;
|
|
1833
|
+
}, [
|
|
1834
|
+
t,
|
|
1835
|
+
l.hour,
|
|
1836
|
+
l.period,
|
|
1837
|
+
f,
|
|
1838
|
+
m
|
|
1839
|
+
]);
|
|
1840
|
+
return /* @__PURE__ */ h("div", {
|
|
1841
|
+
className: `tp-time-picker ${i}`.trim(),
|
|
1842
|
+
style: a,
|
|
1843
|
+
children: /* @__PURE__ */ h(Y, {
|
|
1844
|
+
columns: g,
|
|
1845
|
+
onChange: (e, n) => {
|
|
1846
|
+
let i = {
|
|
1847
|
+
hour: l.hour,
|
|
1848
|
+
minute: m,
|
|
1849
|
+
...t ? { period: l.period ?? "AM" } : {}
|
|
1850
|
+
};
|
|
1851
|
+
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);
|
|
1852
|
+
}
|
|
1853
|
+
})
|
|
1854
|
+
});
|
|
1855
|
+
}, $ = [
|
|
1856
|
+
{
|
|
1857
|
+
key: "sun",
|
|
1858
|
+
en: "S",
|
|
1859
|
+
zh: "日",
|
|
1860
|
+
enTitle: "Sunday",
|
|
1861
|
+
zhTitle: "周日"
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
key: "mon",
|
|
1865
|
+
en: "M",
|
|
1866
|
+
zh: "一",
|
|
1867
|
+
enTitle: "Monday",
|
|
1868
|
+
zhTitle: "周一"
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
key: "tue",
|
|
1872
|
+
en: "T",
|
|
1873
|
+
zh: "二",
|
|
1874
|
+
enTitle: "Tuesday",
|
|
1875
|
+
zhTitle: "周二"
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
key: "wed",
|
|
1879
|
+
en: "W",
|
|
1880
|
+
zh: "三",
|
|
1881
|
+
enTitle: "Wednesday",
|
|
1882
|
+
zhTitle: "周三"
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
key: "thu",
|
|
1886
|
+
en: "T",
|
|
1887
|
+
zh: "四",
|
|
1888
|
+
enTitle: "Thursday",
|
|
1889
|
+
zhTitle: "周四"
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
key: "fri",
|
|
1893
|
+
en: "F",
|
|
1894
|
+
zh: "五",
|
|
1895
|
+
enTitle: "Friday",
|
|
1896
|
+
zhTitle: "周五"
|
|
1897
|
+
},
|
|
1898
|
+
{
|
|
1899
|
+
key: "sat",
|
|
1900
|
+
en: "S",
|
|
1901
|
+
zh: "六",
|
|
1902
|
+
enTitle: "Saturday",
|
|
1903
|
+
zhTitle: "周六"
|
|
1904
|
+
}
|
|
1905
|
+
], de = ({ value: e, defaultValue: t = [], onChange: n, disabled: r = !1, locale: i = "en", className: a = "", style: o }) => {
|
|
1906
|
+
let [s, c] = p(t), l = e !== void 0, u = l ? e : s, d = (e) => {
|
|
1907
|
+
if (r) return;
|
|
1908
|
+
let t = new Set(u);
|
|
1909
|
+
t.has(e) ? t.delete(e) : t.add(e);
|
|
1910
|
+
let i = $.map((e) => e.key).filter((e) => t.has(e));
|
|
1911
|
+
l || c(i), n?.(i);
|
|
1912
|
+
}, f = [
|
|
1913
|
+
"tp-day-switcher",
|
|
1914
|
+
r ? "tp-day-switcher--disabled" : "",
|
|
1915
|
+
a
|
|
1916
|
+
].filter(Boolean).join(" ");
|
|
1917
|
+
return /* @__PURE__ */ h("div", {
|
|
1918
|
+
className: f,
|
|
1919
|
+
style: o,
|
|
1920
|
+
role: "group",
|
|
1921
|
+
"aria-label": "Days of week",
|
|
1922
|
+
children: $.map((e) => {
|
|
1923
|
+
let t = u.includes(e.key), n = i === "zh" ? e.zh : e.en, a = i === "zh" ? e.zhTitle : e.enTitle;
|
|
1924
|
+
return /* @__PURE__ */ h("button", {
|
|
1925
|
+
type: "button",
|
|
1926
|
+
"data-day": e.key,
|
|
1927
|
+
title: a,
|
|
1928
|
+
disabled: r,
|
|
1929
|
+
"aria-pressed": t,
|
|
1930
|
+
className: `tp-day-switcher-btn ${t ? "tp-day-switcher-btn--selected" : ""}`.trim(),
|
|
1931
|
+
onClick: () => d(e.key),
|
|
1932
|
+
children: n
|
|
1933
|
+
}, e.key);
|
|
1934
|
+
})
|
|
1935
|
+
});
|
|
1936
|
+
}, fe = [
|
|
1937
|
+
"1",
|
|
1938
|
+
"2",
|
|
1939
|
+
"3",
|
|
1940
|
+
"4",
|
|
1941
|
+
"5",
|
|
1942
|
+
"6",
|
|
1943
|
+
"7",
|
|
1944
|
+
"8",
|
|
1945
|
+
"9"
|
|
1946
|
+
], pe = [
|
|
1947
|
+
"A",
|
|
1948
|
+
"B",
|
|
1949
|
+
"C",
|
|
1950
|
+
"D",
|
|
1951
|
+
"E",
|
|
1952
|
+
"F"
|
|
1953
|
+
], me = ({ mode: e = "numeric", onKeyPress: t, onBackspace: n, onDone: r, doneLabel: i = "Done", showDot: a = !1, showDash: o, className: s = "", style: c }) => {
|
|
1954
|
+
let l = o ?? e === "mac-hex", u = a && l, d = u ? null : a ? "." : l ? "-" : null, f = [
|
|
1955
|
+
"tp-keyboard",
|
|
1956
|
+
`tp-keyboard--${e}`,
|
|
1957
|
+
s
|
|
1958
|
+
].filter(Boolean).join(" ");
|
|
1959
|
+
return /* @__PURE__ */ g("div", {
|
|
1960
|
+
className: f,
|
|
1961
|
+
style: c,
|
|
1962
|
+
role: "group",
|
|
1963
|
+
"aria-label": "Keypad",
|
|
1964
|
+
children: [
|
|
1965
|
+
e === "mac-hex" && /* @__PURE__ */ h("div", {
|
|
1966
|
+
className: "tp-keyboard-hex-row",
|
|
1967
|
+
children: pe.map((e) => /* @__PURE__ */ h("button", {
|
|
1968
|
+
type: "button",
|
|
1969
|
+
className: "tp-keyboard-key tp-keyboard-key--hex",
|
|
1970
|
+
onClick: () => t?.(e),
|
|
1971
|
+
children: e
|
|
1972
|
+
}, e))
|
|
1973
|
+
}),
|
|
1974
|
+
u && /* @__PURE__ */ g("div", {
|
|
1975
|
+
className: "tp-keyboard-aux-row",
|
|
1976
|
+
children: [/* @__PURE__ */ h("button", {
|
|
1977
|
+
type: "button",
|
|
1978
|
+
className: "tp-keyboard-key tp-keyboard-key--action",
|
|
1979
|
+
onClick: () => t?.("."),
|
|
1980
|
+
children: "."
|
|
1981
|
+
}), /* @__PURE__ */ h("button", {
|
|
1982
|
+
type: "button",
|
|
1983
|
+
className: "tp-keyboard-key tp-keyboard-key--action",
|
|
1984
|
+
onClick: () => t?.("-"),
|
|
1985
|
+
children: "-"
|
|
1986
|
+
})]
|
|
1987
|
+
}),
|
|
1988
|
+
/* @__PURE__ */ g("div", {
|
|
1989
|
+
className: "tp-keyboard-grid",
|
|
1990
|
+
children: [
|
|
1991
|
+
fe.map((e) => /* @__PURE__ */ h("button", {
|
|
1992
|
+
type: "button",
|
|
1993
|
+
className: "tp-keyboard-key",
|
|
1994
|
+
onClick: () => t?.(e),
|
|
1995
|
+
children: e
|
|
1996
|
+
}, e)),
|
|
1997
|
+
d ? /* @__PURE__ */ h("button", {
|
|
1998
|
+
type: "button",
|
|
1999
|
+
className: "tp-keyboard-key tp-keyboard-key--action",
|
|
2000
|
+
onClick: () => t?.(d),
|
|
2001
|
+
children: d
|
|
2002
|
+
}) : /* @__PURE__ */ h("div", {
|
|
2003
|
+
className: "tp-keyboard-spacer",
|
|
2004
|
+
"aria-hidden": "true"
|
|
2005
|
+
}),
|
|
2006
|
+
/* @__PURE__ */ h("button", {
|
|
2007
|
+
type: "button",
|
|
2008
|
+
className: "tp-keyboard-key",
|
|
2009
|
+
onClick: () => t?.("0"),
|
|
2010
|
+
children: "0"
|
|
2011
|
+
}),
|
|
2012
|
+
/* @__PURE__ */ h("button", {
|
|
2013
|
+
type: "button",
|
|
2014
|
+
className: "tp-keyboard-key tp-keyboard-key--action",
|
|
2015
|
+
"aria-label": "Backspace",
|
|
2016
|
+
onClick: n,
|
|
2017
|
+
children: /* @__PURE__ */ g("svg", {
|
|
2018
|
+
width: "22",
|
|
2019
|
+
height: "18",
|
|
2020
|
+
viewBox: "0 0 22 18",
|
|
2021
|
+
fill: "none",
|
|
2022
|
+
"aria-hidden": "true",
|
|
2023
|
+
children: [/* @__PURE__ */ h("path", {
|
|
2024
|
+
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",
|
|
2025
|
+
stroke: "currentColor",
|
|
2026
|
+
strokeWidth: "1.5",
|
|
2027
|
+
strokeLinejoin: "round"
|
|
2028
|
+
}), /* @__PURE__ */ h("path", {
|
|
2029
|
+
d: "M11 6.3L16 11.3M16 6.3L11 11.3",
|
|
2030
|
+
stroke: "currentColor",
|
|
2031
|
+
strokeWidth: "1.5",
|
|
2032
|
+
strokeLinecap: "round"
|
|
2033
|
+
})]
|
|
2034
|
+
})
|
|
2035
|
+
})
|
|
2036
|
+
]
|
|
2037
|
+
}),
|
|
2038
|
+
/* @__PURE__ */ h("button", {
|
|
2039
|
+
type: "button",
|
|
2040
|
+
className: "tp-keyboard-key tp-keyboard-key--done",
|
|
2041
|
+
onClick: r,
|
|
2042
|
+
children: i
|
|
2043
|
+
})
|
|
2044
|
+
]
|
|
2045
|
+
});
|
|
2046
|
+
}, he = ({ open: t, title: n, message: r, actions: i, os: a, inputPlaceholder: o, defaultInputValue: s = "", onClose: u, children: d }) => {
|
|
2047
|
+
let f = e(), m = a ?? f.os, _ = l(), v = l(), [y, b] = p(s);
|
|
2048
|
+
if (c(() => {
|
|
2049
|
+
t && b(s);
|
|
2050
|
+
}, [t, s]), c(() => {
|
|
2051
|
+
if (!t || !u) return;
|
|
2052
|
+
let e = (e) => {
|
|
2053
|
+
e.key === "Escape" && u();
|
|
2054
|
+
};
|
|
2055
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2056
|
+
}, [t, u]), !t) return null;
|
|
2057
|
+
let x = o !== void 0, S = (e) => {
|
|
2058
|
+
x ? e.onClick?.(y) : e.onClick?.(), u?.();
|
|
2059
|
+
}, C = m === "ios" ? i.length === 2 ? "tp-alert-actions--row" : "tp-alert-actions--col" : "";
|
|
2060
|
+
return /* @__PURE__ */ h("div", {
|
|
2061
|
+
className: "tp-overlay tp-alert-backdrop",
|
|
2062
|
+
"data-tp-os": m,
|
|
2063
|
+
onClick: () => u?.(),
|
|
2064
|
+
children: /* @__PURE__ */ g("div", {
|
|
2065
|
+
role: "alertdialog",
|
|
2066
|
+
"aria-modal": "true",
|
|
2067
|
+
"aria-labelledby": n ? _ : void 0,
|
|
2068
|
+
"aria-describedby": r ? v : void 0,
|
|
2069
|
+
"data-os": m,
|
|
2070
|
+
className: `tp-alert tp-alert--${m}`,
|
|
2071
|
+
onClick: (e) => e.stopPropagation(),
|
|
2072
|
+
children: [/* @__PURE__ */ g("div", {
|
|
2073
|
+
className: "tp-alert-content",
|
|
2074
|
+
children: [
|
|
2075
|
+
n !== void 0 && /* @__PURE__ */ h("div", {
|
|
2076
|
+
id: _,
|
|
2077
|
+
className: "tp-alert-title",
|
|
2078
|
+
children: n
|
|
2079
|
+
}),
|
|
2080
|
+
r !== void 0 && /* @__PURE__ */ h("div", {
|
|
2081
|
+
id: v,
|
|
2082
|
+
className: "tp-alert-message",
|
|
2083
|
+
children: r
|
|
2084
|
+
}),
|
|
2085
|
+
d !== void 0 && /* @__PURE__ */ h("div", {
|
|
2086
|
+
className: "tp-alert-body",
|
|
2087
|
+
children: d
|
|
2088
|
+
}),
|
|
2089
|
+
x && /* @__PURE__ */ h("div", {
|
|
2090
|
+
className: "tp-alert-input-wrap",
|
|
2091
|
+
children: /* @__PURE__ */ h("input", {
|
|
2092
|
+
type: "text",
|
|
2093
|
+
className: "tp-alert-input",
|
|
2094
|
+
placeholder: o,
|
|
2095
|
+
value: y,
|
|
2096
|
+
onChange: (e) => b(e.target.value),
|
|
2097
|
+
autoFocus: !0
|
|
2098
|
+
})
|
|
2099
|
+
})
|
|
2100
|
+
]
|
|
2101
|
+
}), /* @__PURE__ */ h("div", {
|
|
2102
|
+
className: `tp-alert-actions tp-alert-actions--${m} ${C}`.trim(),
|
|
2103
|
+
children: i.map((e, t) => {
|
|
2104
|
+
let n = e.role ?? "default";
|
|
2105
|
+
return /* @__PURE__ */ h("button", {
|
|
2106
|
+
type: "button",
|
|
2107
|
+
"data-role": n,
|
|
2108
|
+
className: `tp-alert-action tp-alert-action--${n}`,
|
|
2109
|
+
onClick: () => S(e),
|
|
2110
|
+
children: e.label
|
|
2111
|
+
}, `${e.label}-${t}`);
|
|
2112
|
+
})
|
|
2113
|
+
})]
|
|
2114
|
+
})
|
|
2115
|
+
});
|
|
2116
|
+
}, ge = () => /* @__PURE__ */ h("svg", {
|
|
2117
|
+
width: "18",
|
|
2118
|
+
height: "18",
|
|
2119
|
+
viewBox: "0 0 24 24",
|
|
2120
|
+
fill: "none",
|
|
2121
|
+
"aria-hidden": "true",
|
|
2122
|
+
children: /* @__PURE__ */ h("path", {
|
|
2123
|
+
d: "M5 12.5L9.8 17L19 7.5",
|
|
2124
|
+
stroke: "currentColor",
|
|
2125
|
+
strokeWidth: "2.2",
|
|
2126
|
+
strokeLinecap: "round",
|
|
2127
|
+
strokeLinejoin: "round"
|
|
2128
|
+
})
|
|
2129
|
+
}), _e = ({ open: t, title: n, message: r, options: i, cancelText: a = "Cancel", os: o, onSelect: s, onClose: u }) => {
|
|
2130
|
+
let d = e(), f = o ?? d.os, p = l();
|
|
2131
|
+
if (c(() => {
|
|
2132
|
+
if (!t) return;
|
|
2133
|
+
let e = (e) => {
|
|
2134
|
+
e.key === "Escape" && u();
|
|
2135
|
+
};
|
|
2136
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2137
|
+
}, [t, u]), !t) return null;
|
|
2138
|
+
let m = i.some((e) => e.icon !== void 0 || e.description !== void 0 || e.selected !== void 0), _ = (e) => {
|
|
2139
|
+
e.disabled || (s(e), u());
|
|
2140
|
+
};
|
|
2141
|
+
return /* @__PURE__ */ h("div", {
|
|
2142
|
+
className: "tp-overlay tp-actionsheet-backdrop",
|
|
2143
|
+
"data-tp-os": f,
|
|
2144
|
+
onClick: u,
|
|
2145
|
+
children: /* @__PURE__ */ g("div", {
|
|
2146
|
+
role: "dialog",
|
|
2147
|
+
"aria-modal": "true",
|
|
2148
|
+
"aria-labelledby": n ? p : void 0,
|
|
2149
|
+
"data-os": f,
|
|
2150
|
+
className: `tp-actionsheet tp-actionsheet--${f}`,
|
|
2151
|
+
onClick: (e) => e.stopPropagation(),
|
|
2152
|
+
children: [/* @__PURE__ */ g("div", {
|
|
2153
|
+
className: "tp-actionsheet-group",
|
|
2154
|
+
children: [(n !== void 0 || r !== void 0) && /* @__PURE__ */ g("div", {
|
|
2155
|
+
className: "tp-actionsheet-header",
|
|
2156
|
+
children: [n !== void 0 && /* @__PURE__ */ h("div", {
|
|
2157
|
+
id: p,
|
|
2158
|
+
className: "tp-actionsheet-title",
|
|
2159
|
+
children: n
|
|
2160
|
+
}), r !== void 0 && /* @__PURE__ */ h("div", {
|
|
2161
|
+
className: "tp-actionsheet-message",
|
|
2162
|
+
children: r
|
|
2163
|
+
})]
|
|
2164
|
+
}), /* @__PURE__ */ h("div", {
|
|
2165
|
+
className: "tp-actionsheet-options",
|
|
2166
|
+
children: i.map((e) => {
|
|
2167
|
+
let t = [
|
|
2168
|
+
"tp-actionsheet-option",
|
|
2169
|
+
m ? "tp-actionsheet-option--rich" : "",
|
|
2170
|
+
e.destructive ? "tp-actionsheet-option--destructive" : "",
|
|
2171
|
+
e.disabled ? "tp-actionsheet-option--disabled" : "",
|
|
2172
|
+
e.selected ? "tp-actionsheet-option--selected" : ""
|
|
2173
|
+
].filter(Boolean).join(" ");
|
|
2174
|
+
return /* @__PURE__ */ g("button", {
|
|
2175
|
+
type: "button",
|
|
2176
|
+
className: t,
|
|
2177
|
+
disabled: e.disabled,
|
|
2178
|
+
"aria-disabled": e.disabled || void 0,
|
|
2179
|
+
onClick: () => _(e),
|
|
2180
|
+
children: [
|
|
2181
|
+
e.icon !== void 0 && /* @__PURE__ */ h("span", {
|
|
2182
|
+
className: "tp-actionsheet-option-icon",
|
|
2183
|
+
children: e.icon
|
|
2184
|
+
}),
|
|
2185
|
+
/* @__PURE__ */ g("span", {
|
|
2186
|
+
className: "tp-actionsheet-option-text",
|
|
2187
|
+
children: [/* @__PURE__ */ h("span", {
|
|
2188
|
+
className: "tp-actionsheet-option-label",
|
|
2189
|
+
children: e.label
|
|
2190
|
+
}), e.description !== void 0 && /* @__PURE__ */ h("span", {
|
|
2191
|
+
className: "tp-actionsheet-option-desc",
|
|
2192
|
+
children: e.description
|
|
2193
|
+
})]
|
|
2194
|
+
}),
|
|
2195
|
+
e.selected && /* @__PURE__ */ h("span", {
|
|
2196
|
+
className: "tp-actionsheet-option-check",
|
|
2197
|
+
children: /* @__PURE__ */ h(ge, {})
|
|
2198
|
+
})
|
|
2199
|
+
]
|
|
2200
|
+
}, e.key);
|
|
2201
|
+
})
|
|
2202
|
+
})]
|
|
2203
|
+
}), a !== "" && (f === "ios" ? /* @__PURE__ */ h("div", {
|
|
2204
|
+
className: "tp-actionsheet-cancel-card",
|
|
2205
|
+
children: /* @__PURE__ */ h("button", {
|
|
2206
|
+
type: "button",
|
|
2207
|
+
className: "tp-actionsheet-cancel",
|
|
2208
|
+
onClick: u,
|
|
2209
|
+
children: a
|
|
2210
|
+
})
|
|
2211
|
+
}) : /* @__PURE__ */ h("div", {
|
|
2212
|
+
className: "tp-actionsheet-cancel-row",
|
|
2213
|
+
children: /* @__PURE__ */ h("button", {
|
|
2214
|
+
type: "button",
|
|
2215
|
+
className: "tp-actionsheet-cancel",
|
|
2216
|
+
onClick: u,
|
|
2217
|
+
children: a
|
|
2218
|
+
})
|
|
2219
|
+
}))]
|
|
2220
|
+
})
|
|
2221
|
+
});
|
|
2222
|
+
}, ve = () => /* @__PURE__ */ h("svg", {
|
|
2223
|
+
width: "14",
|
|
2224
|
+
height: "14",
|
|
2225
|
+
viewBox: "0 0 16 16",
|
|
2226
|
+
fill: "none",
|
|
2227
|
+
"aria-hidden": "true",
|
|
2228
|
+
children: /* @__PURE__ */ h("path", {
|
|
2229
|
+
d: "M4 4L12 12M12 4L4 12",
|
|
2230
|
+
stroke: "currentColor",
|
|
2231
|
+
strokeWidth: "1.8",
|
|
2232
|
+
strokeLinecap: "round"
|
|
2233
|
+
})
|
|
2234
|
+
}), ye = ({ open: e, title: t, subtitle: n, onClose: r, showCloseButton: i, showGrabber: a = !0, footer: o, maxHeight: s = "85%", children: u }) => {
|
|
2235
|
+
let d = l();
|
|
2236
|
+
if (c(() => {
|
|
2237
|
+
if (!e) return;
|
|
2238
|
+
let t = (e) => {
|
|
2239
|
+
e.key === "Escape" && r();
|
|
2240
|
+
};
|
|
2241
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
2242
|
+
}, [e, r]), !e) return null;
|
|
2243
|
+
let f = t !== void 0 || n !== void 0, p = i ?? f, m = f || p, _ = typeof s == "number" ? `${s}px` : s;
|
|
2244
|
+
return /* @__PURE__ */ h("div", {
|
|
2245
|
+
className: "tp-overlay tp-bottomsheet-backdrop",
|
|
2246
|
+
onClick: r,
|
|
2247
|
+
children: /* @__PURE__ */ g("div", {
|
|
2248
|
+
role: "dialog",
|
|
2249
|
+
"aria-modal": "true",
|
|
2250
|
+
"aria-labelledby": t ? d : void 0,
|
|
2251
|
+
className: "tp-bottomsheet",
|
|
2252
|
+
style: { maxHeight: _ },
|
|
2253
|
+
onClick: (e) => e.stopPropagation(),
|
|
2254
|
+
children: [
|
|
2255
|
+
a && /* @__PURE__ */ h("div", {
|
|
2256
|
+
className: "tp-bottomsheet-grabber-wrap",
|
|
2257
|
+
"aria-hidden": "true",
|
|
2258
|
+
children: /* @__PURE__ */ h("span", { className: "tp-bottomsheet-grabber" })
|
|
2259
|
+
}),
|
|
2260
|
+
m && /* @__PURE__ */ g("div", {
|
|
2261
|
+
className: "tp-bottomsheet-header",
|
|
2262
|
+
children: [/* @__PURE__ */ g("div", {
|
|
2263
|
+
className: "tp-bottomsheet-heading",
|
|
2264
|
+
children: [t !== void 0 && /* @__PURE__ */ h("div", {
|
|
2265
|
+
id: d,
|
|
2266
|
+
className: "tp-bottomsheet-title",
|
|
2267
|
+
children: t
|
|
2268
|
+
}), n !== void 0 && /* @__PURE__ */ h("div", {
|
|
2269
|
+
className: "tp-bottomsheet-subtitle",
|
|
2270
|
+
children: n
|
|
2271
|
+
})]
|
|
2272
|
+
}), p && /* @__PURE__ */ h("button", {
|
|
2273
|
+
type: "button",
|
|
2274
|
+
className: "tp-bottomsheet-close",
|
|
2275
|
+
"aria-label": "Close",
|
|
2276
|
+
onClick: r,
|
|
2277
|
+
children: /* @__PURE__ */ h(ve, {})
|
|
2278
|
+
})]
|
|
2279
|
+
}),
|
|
2280
|
+
/* @__PURE__ */ h("div", {
|
|
2281
|
+
className: "tp-bottomsheet-body",
|
|
2282
|
+
children: u
|
|
2283
|
+
}),
|
|
2284
|
+
o !== void 0 && /* @__PURE__ */ h("div", {
|
|
2285
|
+
className: "tp-bottomsheet-footer",
|
|
2286
|
+
children: o
|
|
2287
|
+
})
|
|
2288
|
+
]
|
|
2289
|
+
})
|
|
2290
|
+
});
|
|
2291
|
+
}, be = () => /* @__PURE__ */ h("svg", {
|
|
2292
|
+
width: "14",
|
|
2293
|
+
height: "14",
|
|
2294
|
+
viewBox: "0 0 16 16",
|
|
2295
|
+
fill: "none",
|
|
2296
|
+
"aria-hidden": "true",
|
|
2297
|
+
children: /* @__PURE__ */ h("path", {
|
|
2298
|
+
d: "M4 4L12 12M12 4L4 12",
|
|
2299
|
+
stroke: "currentColor",
|
|
2300
|
+
strokeWidth: "1.8",
|
|
2301
|
+
strokeLinecap: "round"
|
|
2302
|
+
})
|
|
2303
|
+
}), xe = ({ open: e, placement: t = "center", title: n, closable: r = !0, maskClosable: i = !0, onClose: a, footer: o, className: s = "", style: u, children: d }) => {
|
|
2304
|
+
let f = l();
|
|
2305
|
+
if (c(() => {
|
|
2306
|
+
if (!e) return;
|
|
2307
|
+
let t = (e) => {
|
|
2308
|
+
e.key === "Escape" && (i || r) && a();
|
|
2309
|
+
};
|
|
2310
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
2311
|
+
}, [
|
|
2312
|
+
e,
|
|
2313
|
+
i,
|
|
2314
|
+
r,
|
|
2315
|
+
a
|
|
2316
|
+
]), !e) return null;
|
|
2317
|
+
let p = n !== void 0 || r;
|
|
2318
|
+
return /* @__PURE__ */ h("div", {
|
|
2319
|
+
className: `tp-overlay tp-popup-backdrop--${t}`,
|
|
2320
|
+
onClick: () => {
|
|
2321
|
+
i && a();
|
|
2322
|
+
},
|
|
2323
|
+
children: /* @__PURE__ */ g("div", {
|
|
2324
|
+
role: "dialog",
|
|
2325
|
+
"aria-modal": "true",
|
|
2326
|
+
"aria-labelledby": n ? f : void 0,
|
|
2327
|
+
"data-placement": t,
|
|
2328
|
+
className: `tp-popup tp-popup--${t} ${s}`.trim(),
|
|
2329
|
+
style: u,
|
|
2330
|
+
onClick: (e) => e.stopPropagation(),
|
|
2331
|
+
children: [
|
|
2332
|
+
p && /* @__PURE__ */ g("div", {
|
|
2333
|
+
className: "tp-popup-header",
|
|
2334
|
+
children: [n === void 0 ? /* @__PURE__ */ h("span", {}) : /* @__PURE__ */ h("div", {
|
|
2335
|
+
id: f,
|
|
2336
|
+
className: "tp-popup-title",
|
|
2337
|
+
children: n
|
|
2338
|
+
}), r && /* @__PURE__ */ h("button", {
|
|
2339
|
+
type: "button",
|
|
2340
|
+
className: "tp-popup-close",
|
|
2341
|
+
"aria-label": "Close",
|
|
2342
|
+
onClick: a,
|
|
2343
|
+
children: /* @__PURE__ */ h(be, {})
|
|
2344
|
+
})]
|
|
2345
|
+
}),
|
|
2346
|
+
/* @__PURE__ */ h("div", {
|
|
2347
|
+
className: "tp-popup-body",
|
|
2348
|
+
children: d
|
|
2349
|
+
}),
|
|
2350
|
+
o !== void 0 && /* @__PURE__ */ h("div", {
|
|
2351
|
+
className: "tp-popup-footer",
|
|
2352
|
+
children: o
|
|
2353
|
+
})
|
|
2354
|
+
]
|
|
2355
|
+
})
|
|
2356
|
+
});
|
|
2357
|
+
}, Se = () => /* @__PURE__ */ h("svg", {
|
|
2358
|
+
width: "16",
|
|
2359
|
+
height: "16",
|
|
2360
|
+
viewBox: "0 0 24 24",
|
|
2361
|
+
fill: "none",
|
|
2362
|
+
"aria-hidden": "true",
|
|
2363
|
+
children: /* @__PURE__ */ h("path", {
|
|
2364
|
+
d: "M5 12.5L9.8 17L19 7.5",
|
|
2365
|
+
stroke: "currentColor",
|
|
2366
|
+
strokeWidth: "2.2",
|
|
2367
|
+
strokeLinecap: "round",
|
|
2368
|
+
strokeLinejoin: "round"
|
|
2369
|
+
})
|
|
2370
|
+
}), Ce = ({ open: e, items: t, onSelect: n, onClose: r, align: a = "left", className: o = "", style: s }) => {
|
|
2371
|
+
let l = f(null);
|
|
2372
|
+
if (c(() => {
|
|
2373
|
+
if (!e) return;
|
|
2374
|
+
let t = !1, n = (e) => {
|
|
2375
|
+
e.key === "Escape" && r();
|
|
2376
|
+
}, i = (e) => {
|
|
2377
|
+
let n = e.target;
|
|
2378
|
+
l.current && n && !l.current.contains(n) && (t = !0, r());
|
|
2379
|
+
}, a = (e) => {
|
|
2380
|
+
if (t) {
|
|
2381
|
+
t = !1;
|
|
2382
|
+
return;
|
|
2383
|
+
}
|
|
2384
|
+
let n = e.target;
|
|
2385
|
+
l.current && n && !l.current.contains(n) && r();
|
|
2386
|
+
};
|
|
2387
|
+
return document.addEventListener("keydown", n), document.addEventListener("mousedown", i), document.addEventListener("click", a), () => {
|
|
2388
|
+
document.removeEventListener("keydown", n), document.removeEventListener("mousedown", i), document.removeEventListener("click", a);
|
|
2389
|
+
};
|
|
2390
|
+
}, [e, r]), !e) return null;
|
|
2391
|
+
let u = (e) => {
|
|
2392
|
+
e.disabled || (n(e), r());
|
|
2393
|
+
};
|
|
2394
|
+
return /* @__PURE__ */ h("div", {
|
|
2395
|
+
ref: l,
|
|
2396
|
+
role: "menu",
|
|
2397
|
+
"data-align": a,
|
|
2398
|
+
className: `tp-menu tp-menu--align-${a} ${o}`.trim(),
|
|
2399
|
+
style: s,
|
|
2400
|
+
onClick: (e) => e.stopPropagation(),
|
|
2401
|
+
children: t.map((e) => {
|
|
2402
|
+
let t = [
|
|
2403
|
+
"tp-menu-item",
|
|
2404
|
+
e.selected ? "tp-menu-item--selected" : "",
|
|
2405
|
+
e.danger ? "tp-menu-item--danger" : "",
|
|
2406
|
+
e.disabled ? "tp-menu-item--disabled" : ""
|
|
2407
|
+
].filter(Boolean).join(" ");
|
|
2408
|
+
return /* @__PURE__ */ g(i.Fragment, { children: [e.dividerBefore && /* @__PURE__ */ h("div", {
|
|
2409
|
+
className: "tp-menu-divider",
|
|
2410
|
+
role: "separator"
|
|
2411
|
+
}), /* @__PURE__ */ g("button", {
|
|
2412
|
+
type: "button",
|
|
2413
|
+
role: "menuitem",
|
|
2414
|
+
"data-selected": e.selected ? "true" : void 0,
|
|
2415
|
+
className: t,
|
|
2416
|
+
disabled: e.disabled,
|
|
2417
|
+
"aria-disabled": e.disabled || void 0,
|
|
2418
|
+
onClick: () => u(e),
|
|
2419
|
+
children: [
|
|
2420
|
+
e.icon !== void 0 && /* @__PURE__ */ h("span", {
|
|
2421
|
+
className: "tp-menu-item-icon",
|
|
2422
|
+
children: e.icon
|
|
2423
|
+
}),
|
|
2424
|
+
/* @__PURE__ */ h("span", {
|
|
2425
|
+
className: "tp-menu-item-label",
|
|
2426
|
+
children: e.label
|
|
2427
|
+
}),
|
|
2428
|
+
e.selected && /* @__PURE__ */ h("span", {
|
|
2429
|
+
className: "tp-menu-item-check",
|
|
2430
|
+
"aria-label": "selected",
|
|
2431
|
+
children: /* @__PURE__ */ h(Se, {})
|
|
2432
|
+
})
|
|
2433
|
+
]
|
|
2434
|
+
})] }, e.key);
|
|
2435
|
+
})
|
|
2436
|
+
});
|
|
2437
|
+
}, we = ({ type: e }) => {
|
|
2438
|
+
switch (e) {
|
|
2439
|
+
case "info": return /* @__PURE__ */ g("svg", {
|
|
2440
|
+
width: "18",
|
|
2441
|
+
height: "18",
|
|
2442
|
+
viewBox: "0 0 24 24",
|
|
2443
|
+
fill: "none",
|
|
2444
|
+
"aria-hidden": "true",
|
|
2445
|
+
children: [
|
|
2446
|
+
/* @__PURE__ */ h("circle", {
|
|
2447
|
+
cx: "12",
|
|
2448
|
+
cy: "12",
|
|
2449
|
+
r: "9.5",
|
|
2450
|
+
stroke: "currentColor",
|
|
2451
|
+
strokeWidth: "1.6"
|
|
2452
|
+
}),
|
|
2453
|
+
/* @__PURE__ */ h("rect", {
|
|
2454
|
+
x: "11.2",
|
|
2455
|
+
y: "7.8",
|
|
2456
|
+
width: "1.6",
|
|
2457
|
+
height: "1.6",
|
|
2458
|
+
rx: "0.4",
|
|
2459
|
+
fill: "currentColor"
|
|
2460
|
+
}),
|
|
2461
|
+
/* @__PURE__ */ h("rect", {
|
|
2462
|
+
x: "11.2",
|
|
2463
|
+
y: "10.8",
|
|
2464
|
+
width: "1.6",
|
|
2465
|
+
height: "5.8",
|
|
2466
|
+
rx: "0.4",
|
|
2467
|
+
fill: "currentColor"
|
|
2468
|
+
})
|
|
2469
|
+
]
|
|
2470
|
+
});
|
|
2471
|
+
case "success": return /* @__PURE__ */ g("svg", {
|
|
2472
|
+
width: "18",
|
|
2473
|
+
height: "18",
|
|
2474
|
+
viewBox: "0 0 24 24",
|
|
2475
|
+
fill: "none",
|
|
2476
|
+
"aria-hidden": "true",
|
|
2477
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
2478
|
+
cx: "12",
|
|
2479
|
+
cy: "12",
|
|
2480
|
+
r: "9.5",
|
|
2481
|
+
stroke: "currentColor",
|
|
2482
|
+
strokeWidth: "1.6"
|
|
2483
|
+
}), /* @__PURE__ */ h("path", {
|
|
2484
|
+
d: "M8 12.2L10.8 15L16 9.5",
|
|
2485
|
+
stroke: "currentColor",
|
|
2486
|
+
strokeWidth: "1.8",
|
|
2487
|
+
strokeLinecap: "round",
|
|
2488
|
+
strokeLinejoin: "round"
|
|
2489
|
+
})]
|
|
2490
|
+
});
|
|
2491
|
+
case "warning": return /* @__PURE__ */ g("svg", {
|
|
2492
|
+
width: "18",
|
|
2493
|
+
height: "18",
|
|
2494
|
+
viewBox: "0 0 24 24",
|
|
2495
|
+
fill: "none",
|
|
2496
|
+
"aria-hidden": "true",
|
|
2497
|
+
children: [
|
|
2498
|
+
/* @__PURE__ */ h("circle", {
|
|
2499
|
+
cx: "12",
|
|
2500
|
+
cy: "12",
|
|
2501
|
+
r: "9.5",
|
|
2502
|
+
stroke: "currentColor",
|
|
2503
|
+
strokeWidth: "1.6"
|
|
2504
|
+
}),
|
|
2505
|
+
/* @__PURE__ */ h("rect", {
|
|
2506
|
+
x: "11.2",
|
|
2507
|
+
y: "7.5",
|
|
2508
|
+
width: "1.6",
|
|
2509
|
+
height: "5.8",
|
|
2510
|
+
rx: "0.4",
|
|
2511
|
+
fill: "currentColor"
|
|
2512
|
+
}),
|
|
2513
|
+
/* @__PURE__ */ h("rect", {
|
|
2514
|
+
x: "11.2",
|
|
2515
|
+
y: "14.8",
|
|
2516
|
+
width: "1.6",
|
|
2517
|
+
height: "1.6",
|
|
2518
|
+
rx: "0.4",
|
|
2519
|
+
fill: "currentColor"
|
|
2520
|
+
})
|
|
2521
|
+
]
|
|
2522
|
+
});
|
|
2523
|
+
case "error": return /* @__PURE__ */ g("svg", {
|
|
2524
|
+
width: "18",
|
|
2525
|
+
height: "18",
|
|
2526
|
+
viewBox: "0 0 24 24",
|
|
2527
|
+
fill: "none",
|
|
2528
|
+
"aria-hidden": "true",
|
|
2529
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
2530
|
+
cx: "12",
|
|
2531
|
+
cy: "12",
|
|
2532
|
+
r: "9.5",
|
|
2533
|
+
stroke: "currentColor",
|
|
2534
|
+
strokeWidth: "1.6"
|
|
2535
|
+
}), /* @__PURE__ */ h("path", {
|
|
2536
|
+
d: "M9 9L15 15M15 9L9 15",
|
|
2537
|
+
stroke: "currentColor",
|
|
2538
|
+
strokeWidth: "1.8",
|
|
2539
|
+
strokeLinecap: "round"
|
|
2540
|
+
})]
|
|
2541
|
+
});
|
|
2542
|
+
case "loading": return /* @__PURE__ */ g("svg", {
|
|
2543
|
+
width: "18",
|
|
2544
|
+
height: "18",
|
|
2545
|
+
viewBox: "0 0 24 24",
|
|
2546
|
+
fill: "none",
|
|
2547
|
+
className: "tp-toast-spinner",
|
|
2548
|
+
"aria-hidden": "true",
|
|
2549
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
2550
|
+
cx: "12",
|
|
2551
|
+
cy: "12",
|
|
2552
|
+
r: "9",
|
|
2553
|
+
stroke: "currentColor",
|
|
2554
|
+
strokeOpacity: "0.28",
|
|
2555
|
+
strokeWidth: "2.2"
|
|
2556
|
+
}), /* @__PURE__ */ h("path", {
|
|
2557
|
+
d: "M12 3A9 9 0 0 1 21 12",
|
|
2558
|
+
stroke: "currentColor",
|
|
2559
|
+
strokeWidth: "2.2",
|
|
2560
|
+
strokeLinecap: "round"
|
|
2561
|
+
})]
|
|
2562
|
+
});
|
|
2563
|
+
default: return null;
|
|
2564
|
+
}
|
|
2565
|
+
}, Te = ({ open: e = !0, type: t = "default", message: n, duration: r, position: i = "center", onClose: a, className: o = "", style: s }) => {
|
|
2566
|
+
let l = r ?? (t === "loading" ? 0 : 2500);
|
|
2567
|
+
if (c(() => {
|
|
2568
|
+
if (!e || !a || l <= 0) return;
|
|
2569
|
+
let t = setTimeout(() => {
|
|
2570
|
+
a();
|
|
2571
|
+
}, l);
|
|
2572
|
+
return () => clearTimeout(t);
|
|
2573
|
+
}, [
|
|
2574
|
+
e,
|
|
2575
|
+
l,
|
|
2576
|
+
a
|
|
2577
|
+
]), !e) return null;
|
|
2578
|
+
let u = /* @__PURE__ */ h(we, { type: t });
|
|
2579
|
+
return /* @__PURE__ */ h("div", {
|
|
2580
|
+
className: `tp-toast-container tp-toast-container--${i}`,
|
|
2581
|
+
children: /* @__PURE__ */ g("div", {
|
|
2582
|
+
role: t === "error" ? "alert" : "status",
|
|
2583
|
+
"aria-live": t === "error" ? "assertive" : "polite",
|
|
2584
|
+
"data-type": t,
|
|
2585
|
+
className: `tp-toast tp-toast--${t} ${o}`.trim(),
|
|
2586
|
+
style: s,
|
|
2587
|
+
children: [t !== "default" && /* @__PURE__ */ h("span", {
|
|
2588
|
+
className: "tp-toast-icon",
|
|
2589
|
+
children: u
|
|
2590
|
+
}), /* @__PURE__ */ h("span", {
|
|
2591
|
+
className: "tp-toast-message",
|
|
2592
|
+
children: n
|
|
2593
|
+
})]
|
|
2594
|
+
})
|
|
2595
|
+
});
|
|
2596
|
+
}, Ee = a({
|
|
2597
|
+
show: () => {},
|
|
2598
|
+
dismiss: () => {}
|
|
2599
|
+
}), De = ({ children: e }) => {
|
|
2600
|
+
let [t, n] = p(null), r = f(null), i = o(() => {
|
|
2601
|
+
r.current !== null && (clearTimeout(r.current), r.current = null);
|
|
2602
|
+
}, []), a = o(() => {
|
|
2603
|
+
i(), n((e) => e ? {
|
|
2604
|
+
...e,
|
|
2605
|
+
open: !1
|
|
2606
|
+
} : null);
|
|
2607
|
+
}, [i]), s = o((e) => {
|
|
2608
|
+
i();
|
|
2609
|
+
let t = typeof e == "string" ? { message: e } : e, a = t.type ?? "default", o = t.duration ?? (a === "loading" ? 0 : 2500);
|
|
2610
|
+
n({
|
|
2611
|
+
...t,
|
|
2612
|
+
type: a,
|
|
2613
|
+
open: !0
|
|
2614
|
+
}), o > 0 && (r.current = setTimeout(() => {
|
|
2615
|
+
r.current = null, n((e) => e ? {
|
|
2616
|
+
...e,
|
|
2617
|
+
open: !1
|
|
2618
|
+
} : null), t.onClose?.();
|
|
2619
|
+
}, o));
|
|
2620
|
+
}, [i]);
|
|
2621
|
+
c(() => () => i(), [i]);
|
|
2622
|
+
let l = d(() => ({
|
|
2623
|
+
show: s,
|
|
2624
|
+
dismiss: a
|
|
2625
|
+
}), [s, a]);
|
|
2626
|
+
return /* @__PURE__ */ g(Ee.Provider, {
|
|
2627
|
+
value: l,
|
|
2628
|
+
children: [e, t && /* @__PURE__ */ h(Te, {
|
|
2629
|
+
open: t.open,
|
|
2630
|
+
type: t.type,
|
|
2631
|
+
message: t.message,
|
|
2632
|
+
duration: 0,
|
|
2633
|
+
position: t.position,
|
|
2634
|
+
className: t.className,
|
|
2635
|
+
style: t.style
|
|
2636
|
+
})]
|
|
2637
|
+
});
|
|
2638
|
+
};
|
|
2639
|
+
function Oe() {
|
|
2640
|
+
return s(Ee);
|
|
2641
|
+
}
|
|
2642
|
+
// src/core/components/TPLiquidGlass.tsx
|
|
2643
|
+
var ke = ({ shape: e = "pill", tint: t = "clear", interactive: n = !1, refraction: r = 1, dispersion: a = 1, blur: o = 2, optical: s = !0, as: c = "div", ariaLabel: l, disabled: u = !1, onClick: d, className: p = "", style: m, children: g }) => {
|
|
2644
|
+
let _ = f(null), v = [
|
|
2645
|
+
"tp-liquid-glass",
|
|
2646
|
+
`tp-liquid-glass--${e}`,
|
|
2647
|
+
`tp-liquid-glass--tint-${t}`,
|
|
2648
|
+
n ? "tp-liquid-glass--interactive" : "",
|
|
2649
|
+
u ? "tp-liquid-glass--disabled" : "",
|
|
2650
|
+
p
|
|
2651
|
+
].filter(Boolean).join(" ");
|
|
2652
|
+
return i.createElement(c, {
|
|
2653
|
+
ref: _,
|
|
2654
|
+
type: c === "button" ? "button" : void 0,
|
|
2655
|
+
disabled: c === "button" ? u : void 0,
|
|
2656
|
+
"aria-label": l,
|
|
2657
|
+
"aria-disabled": c !== "button" && u ? !0 : void 0,
|
|
2658
|
+
"data-shape": e,
|
|
2659
|
+
"data-tint": t,
|
|
2660
|
+
className: v,
|
|
2661
|
+
style: m,
|
|
2662
|
+
onClick: u ? void 0 : d
|
|
2663
|
+
}, /* @__PURE__ */ h(k, {
|
|
2664
|
+
hostRef: _,
|
|
2665
|
+
shape: e,
|
|
2666
|
+
tint: t,
|
|
2667
|
+
refraction: r,
|
|
2668
|
+
dispersion: a,
|
|
2669
|
+
blur: o,
|
|
2670
|
+
optical: s
|
|
2671
|
+
}), /* @__PURE__ */ h("span", {
|
|
2672
|
+
className: "tp-liquid-glass-content",
|
|
2673
|
+
children: g
|
|
2674
|
+
}));
|
|
2675
|
+
}, Ae = i.createContext(!1);
|
|
2676
|
+
function je(e) {
|
|
2677
|
+
return e == null || e === !1 || e === "" || e === 0 ? null : e === !0 ? /* @__PURE__ */ h("span", {
|
|
2678
|
+
className: "tp-icon-btn-badge tp-icon-btn-badge--dot",
|
|
2679
|
+
"aria-hidden": "true"
|
|
2680
|
+
}) : /* @__PURE__ */ h("span", {
|
|
2681
|
+
className: "tp-icon-btn-badge",
|
|
2682
|
+
children: typeof e == "number" && e > 99 ? "99+" : String(e)
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
var Me = ({ icon: e, variant: t = "glass", size: i = "md", badge: a, disabled: o = !1, ariaLabel: c, onClick: l, className: u = "", style: d }) => {
|
|
2686
|
+
let p = f(null), m = s(Ae), _ = i === "sm" ? 16 : i === "lg" ? 22 : 19, v = typeof e == "string" && n(e) ? /* @__PURE__ */ h(r, {
|
|
2687
|
+
name: e,
|
|
2688
|
+
size: _
|
|
2689
|
+
}) : e, y = [
|
|
2690
|
+
"tp-icon-btn",
|
|
2691
|
+
`tp-icon-btn--${t}`,
|
|
2692
|
+
`tp-icon-btn--${i}`,
|
|
2693
|
+
o ? "tp-icon-btn--disabled" : "",
|
|
2694
|
+
u
|
|
2695
|
+
].filter(Boolean).join(" ");
|
|
2696
|
+
return /* @__PURE__ */ g("button", {
|
|
2697
|
+
ref: p,
|
|
2698
|
+
type: "button",
|
|
2699
|
+
className: y,
|
|
2700
|
+
"data-variant": t,
|
|
2701
|
+
"data-size": i,
|
|
2702
|
+
"aria-label": c,
|
|
2703
|
+
disabled: o,
|
|
2704
|
+
onClick: l,
|
|
2705
|
+
style: d,
|
|
2706
|
+
children: [
|
|
2707
|
+
t === "glass" && !m && /* @__PURE__ */ h(k, {
|
|
2708
|
+
hostRef: p,
|
|
2709
|
+
shape: "circle",
|
|
2710
|
+
tint: "clear",
|
|
2711
|
+
bezelWidth: 12,
|
|
2712
|
+
refraction: 1.05,
|
|
2713
|
+
dispersion: .9,
|
|
2714
|
+
blur: 2
|
|
2715
|
+
}),
|
|
2716
|
+
/* @__PURE__ */ h("span", {
|
|
2717
|
+
className: "tp-icon-btn-glyph",
|
|
2718
|
+
children: v
|
|
2719
|
+
}),
|
|
2720
|
+
je(a)
|
|
2721
|
+
]
|
|
2722
|
+
});
|
|
2723
|
+
}, Ne = ({ variant: e = "glass", children: t, className: n = "", style: r }) => {
|
|
2724
|
+
let i = f(null);
|
|
2725
|
+
return /* @__PURE__ */ h(Ae.Provider, {
|
|
2726
|
+
value: !0,
|
|
2727
|
+
children: /* @__PURE__ */ g("div", {
|
|
2728
|
+
ref: i,
|
|
2729
|
+
className: `tp-icon-btn-group tp-icon-btn-group--${e} ${n}`.trim(),
|
|
2730
|
+
"data-variant": e,
|
|
2731
|
+
role: "group",
|
|
2732
|
+
style: r,
|
|
2733
|
+
children: [e === "glass" && /* @__PURE__ */ h(k, {
|
|
2734
|
+
hostRef: i,
|
|
2735
|
+
shape: "pill",
|
|
2736
|
+
tint: "clear",
|
|
2737
|
+
bezelWidth: 12,
|
|
2738
|
+
refraction: 1.05,
|
|
2739
|
+
dispersion: .9,
|
|
2740
|
+
blur: 2
|
|
2741
|
+
}), t]
|
|
2742
|
+
})
|
|
2743
|
+
});
|
|
2744
|
+
}, Pe = ({ checked: e, defaultChecked: t = !1, indeterminate: n = !1, disabled: r = !1, label: i, description: a, onChange: o, ariaLabel: s, className: c = "", style: u }) => {
|
|
2745
|
+
let d = l(), f = e !== void 0, [m, _] = p(t), v = f ? e : m, y = () => {
|
|
2746
|
+
if (r) return;
|
|
2747
|
+
let e = !v;
|
|
2748
|
+
f || _(e), o?.(e);
|
|
2749
|
+
}, b = [
|
|
2750
|
+
"tp-check-row",
|
|
2751
|
+
v ? "tp-check-row--checked" : "",
|
|
2752
|
+
n ? "tp-check-row--indeterminate" : "",
|
|
2753
|
+
r ? "tp-check-row--disabled" : "",
|
|
2754
|
+
c
|
|
2755
|
+
].filter(Boolean).join(" ");
|
|
2756
|
+
return /* @__PURE__ */ g("label", {
|
|
2757
|
+
htmlFor: d,
|
|
2758
|
+
className: b,
|
|
2759
|
+
style: u,
|
|
2760
|
+
children: [
|
|
2761
|
+
/* @__PURE__ */ h("input", {
|
|
2762
|
+
id: d,
|
|
2763
|
+
type: "checkbox",
|
|
2764
|
+
className: "tp-check-native",
|
|
2765
|
+
checked: v,
|
|
2766
|
+
disabled: r,
|
|
2767
|
+
"aria-label": s,
|
|
2768
|
+
"aria-checked": n ? "mixed" : v,
|
|
2769
|
+
onChange: y
|
|
2770
|
+
}),
|
|
2771
|
+
/* @__PURE__ */ h("span", {
|
|
2772
|
+
className: `tp-checkbox-box ${v || n ? "tp-checkbox-box--active" : ""}`.trim(),
|
|
2773
|
+
"aria-hidden": "true",
|
|
2774
|
+
children: n ? /* @__PURE__ */ h("svg", {
|
|
2775
|
+
width: "12",
|
|
2776
|
+
height: "12",
|
|
2777
|
+
viewBox: "0 0 12 12",
|
|
2778
|
+
fill: "none",
|
|
2779
|
+
children: /* @__PURE__ */ h("path", {
|
|
2780
|
+
d: "M2.5 6H9.5",
|
|
2781
|
+
stroke: "currentColor",
|
|
2782
|
+
strokeWidth: "1.9",
|
|
2783
|
+
strokeLinecap: "round"
|
|
2784
|
+
})
|
|
2785
|
+
}) : v ? /* @__PURE__ */ h("svg", {
|
|
2786
|
+
width: "12",
|
|
2787
|
+
height: "12",
|
|
2788
|
+
viewBox: "0 0 12 12",
|
|
2789
|
+
fill: "none",
|
|
2790
|
+
children: /* @__PURE__ */ h("path", {
|
|
2791
|
+
d: "M2.5 6.2L5 8.7L9.5 3.6",
|
|
2792
|
+
stroke: "currentColor",
|
|
2793
|
+
strokeWidth: "1.9",
|
|
2794
|
+
strokeLinecap: "round",
|
|
2795
|
+
strokeLinejoin: "round"
|
|
2796
|
+
})
|
|
2797
|
+
}) : null
|
|
2798
|
+
}),
|
|
2799
|
+
(i !== void 0 || a !== void 0) && /* @__PURE__ */ g("span", {
|
|
2800
|
+
className: "tp-check-texts",
|
|
2801
|
+
children: [i !== void 0 && /* @__PURE__ */ h("span", {
|
|
2802
|
+
className: "tp-check-label",
|
|
2803
|
+
children: i
|
|
2804
|
+
}), a !== void 0 && /* @__PURE__ */ h("span", {
|
|
2805
|
+
className: "tp-check-desc",
|
|
2806
|
+
children: a
|
|
2807
|
+
})]
|
|
2808
|
+
})
|
|
2809
|
+
]
|
|
2810
|
+
});
|
|
2811
|
+
}, Fe = ({ options: e, value: t, defaultValue: n = [], onChange: r, direction: i = "vertical", disabled: a = !1, className: o = "", style: s }) => {
|
|
2812
|
+
let c = t !== void 0, [l, u] = p([...n]), d = c ? t : l, f = (e, t) => {
|
|
2813
|
+
let n = t ? d.includes(e) ? [...d] : [...d, e] : d.filter((t) => t !== e);
|
|
2814
|
+
c || u(n), r?.(n);
|
|
2815
|
+
};
|
|
2816
|
+
return /* @__PURE__ */ h("div", {
|
|
2817
|
+
role: "group",
|
|
2818
|
+
className: `tp-choice-group tp-choice-group--${i} ${o}`.trim(),
|
|
2819
|
+
style: s,
|
|
2820
|
+
children: e.map((e) => /* @__PURE__ */ h(Pe, {
|
|
2821
|
+
label: e.label,
|
|
2822
|
+
description: e.description,
|
|
2823
|
+
disabled: a || e.disabled,
|
|
2824
|
+
checked: d.includes(e.value),
|
|
2825
|
+
onChange: (t) => f(e.value, t)
|
|
2826
|
+
}, e.value))
|
|
2827
|
+
});
|
|
2828
|
+
}, Ie = ({ checked: e, defaultChecked: t = !1, disabled: n = !1, label: r, description: i, value: a, name: o, onChange: s, ariaLabel: c, className: u = "", style: d }) => {
|
|
2829
|
+
let f = l(), m = e !== void 0, [_, v] = p(t), y = m ? e : _, b = () => {
|
|
2830
|
+
n || (m || v(!0), s?.(!0));
|
|
2831
|
+
}, x = [
|
|
2832
|
+
"tp-check-row",
|
|
2833
|
+
y ? "tp-check-row--checked" : "",
|
|
2834
|
+
n ? "tp-check-row--disabled" : "",
|
|
2835
|
+
u
|
|
2836
|
+
].filter(Boolean).join(" ");
|
|
2837
|
+
return /* @__PURE__ */ g("label", {
|
|
2838
|
+
htmlFor: f,
|
|
2839
|
+
className: x,
|
|
2840
|
+
style: d,
|
|
2841
|
+
children: [
|
|
2842
|
+
/* @__PURE__ */ h("input", {
|
|
2843
|
+
id: f,
|
|
2844
|
+
type: "radio",
|
|
2845
|
+
name: o,
|
|
2846
|
+
value: a,
|
|
2847
|
+
className: "tp-check-native",
|
|
2848
|
+
checked: y,
|
|
2849
|
+
disabled: n,
|
|
2850
|
+
"aria-label": c,
|
|
2851
|
+
onChange: b
|
|
2852
|
+
}),
|
|
2853
|
+
/* @__PURE__ */ h("span", {
|
|
2854
|
+
className: `tp-radio-ring ${y ? "tp-radio-ring--active" : ""}`.trim(),
|
|
2855
|
+
"aria-hidden": "true",
|
|
2856
|
+
children: y && /* @__PURE__ */ h("span", { className: "tp-radio-dot" })
|
|
2857
|
+
}),
|
|
2858
|
+
(r !== void 0 || i !== void 0) && /* @__PURE__ */ g("span", {
|
|
2859
|
+
className: "tp-check-texts",
|
|
2860
|
+
children: [r !== void 0 && /* @__PURE__ */ h("span", {
|
|
2861
|
+
className: "tp-check-label",
|
|
2862
|
+
children: r
|
|
2863
|
+
}), i !== void 0 && /* @__PURE__ */ h("span", {
|
|
2864
|
+
className: "tp-check-desc",
|
|
2865
|
+
children: i
|
|
2866
|
+
})]
|
|
2867
|
+
})
|
|
2868
|
+
]
|
|
2869
|
+
});
|
|
2870
|
+
}, Le = ({ options: e, value: t, defaultValue: n, onChange: r, direction: i = "vertical", disabled: a = !1, name: o, className: s = "", style: c }) => {
|
|
2871
|
+
let u = l(), d = o ?? `tp-radio-group-${u}`, f = t !== void 0, [m, g] = p(n ?? e[0]?.value ?? ""), _ = f ? t : m, v = (e) => {
|
|
2872
|
+
f || g(e), r?.(e);
|
|
2873
|
+
};
|
|
2874
|
+
return /* @__PURE__ */ h("div", {
|
|
2875
|
+
role: "radiogroup",
|
|
2876
|
+
className: `tp-choice-group tp-choice-group--${i} ${s}`.trim(),
|
|
2877
|
+
style: c,
|
|
2878
|
+
children: e.map((e) => /* @__PURE__ */ h(Ie, {
|
|
2879
|
+
name: d,
|
|
2880
|
+
value: e.value,
|
|
2881
|
+
label: e.label,
|
|
2882
|
+
description: e.description,
|
|
2883
|
+
disabled: a || e.disabled,
|
|
2884
|
+
checked: _ === e.value,
|
|
2885
|
+
onChange: () => v(e.value)
|
|
2886
|
+
}, e.value))
|
|
2887
|
+
});
|
|
2888
|
+
}, Re = ({ actions: e, open: t, defaultOpen: n = !1, onOpenChange: r, disabled: i = !1, children: a, className: o = "", style: s }) => {
|
|
2889
|
+
let c = t !== void 0, [l, u] = p(n), d = c ? t : l, m = Math.max(72, e.length * 76), [_, v] = p(null), y = f(null), b = (e) => {
|
|
2890
|
+
c || u(e), r?.(e);
|
|
2891
|
+
}, x = _ === null ? d ? -m : 0 : _;
|
|
2892
|
+
return /* @__PURE__ */ g("div", {
|
|
2893
|
+
className: `tp-swipe-row ${d ? "tp-swipe-row--open" : ""} ${i ? "tp-swipe-row--disabled" : ""} ${o}`.trim(),
|
|
2894
|
+
"data-open": String(d),
|
|
2895
|
+
style: s,
|
|
2896
|
+
children: [/* @__PURE__ */ h("div", {
|
|
2897
|
+
className: "tp-swipe-actions",
|
|
2898
|
+
style: { width: `${m}px` },
|
|
2899
|
+
"aria-hidden": !d,
|
|
2900
|
+
children: e.map((e) => /* @__PURE__ */ h("button", {
|
|
2901
|
+
type: "button",
|
|
2902
|
+
disabled: i,
|
|
2903
|
+
tabIndex: d ? 0 : -1,
|
|
2904
|
+
className: `tp-swipe-action tp-swipe-action--${e.tone ?? "neutral"}`,
|
|
2905
|
+
onClick: () => {
|
|
2906
|
+
i || (e.onClick?.(), b(!1));
|
|
2907
|
+
},
|
|
2908
|
+
children: e.label
|
|
2909
|
+
}, e.key))
|
|
2910
|
+
}), /* @__PURE__ */ h("div", {
|
|
2911
|
+
className: "tp-swipe-content",
|
|
2912
|
+
style: { transform: `translateX(${x}px)` },
|
|
2913
|
+
onPointerDown: (e) => {
|
|
2914
|
+
i || (y.current = e.clientX);
|
|
2915
|
+
},
|
|
2916
|
+
onPointerMove: (e) => {
|
|
2917
|
+
if (i || y.current === null) return;
|
|
2918
|
+
let t = d ? -m : 0, n = e.clientX - y.current;
|
|
2919
|
+
if (Math.abs(n) > 6) {
|
|
2920
|
+
let e = Math.max(-m, Math.min(0, t + n));
|
|
2921
|
+
v(e);
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2924
|
+
onPointerUp: (e) => {
|
|
2925
|
+
if (i || y.current === null) return;
|
|
2926
|
+
let t = e.clientX - y.current;
|
|
2927
|
+
y.current = null, v(null), t < -28 ? b(!0) : t > 24 && b(!1);
|
|
2928
|
+
},
|
|
2929
|
+
onPointerCancel: () => {
|
|
2930
|
+
y.current = null, v(null);
|
|
2931
|
+
},
|
|
2932
|
+
children: a
|
|
2933
|
+
})]
|
|
2934
|
+
});
|
|
2935
|
+
}, ze = ({ content: e, arrowPosition: t = "bottom-left", contextAdaptive: n = !0, open: r, defaultOpen: i = !0, onOpenChange: a, children: o, className: s = "", style: c }) => {
|
|
2936
|
+
let l = r !== void 0, [u, d] = p(i), f = l ? r : u, m = () => {
|
|
2937
|
+
let e = !f;
|
|
2938
|
+
l || d(e), a?.(e);
|
|
2939
|
+
};
|
|
2940
|
+
return /* @__PURE__ */ g("div", {
|
|
2941
|
+
className: `tp-tooltip-wrap ${s}`.trim(),
|
|
2942
|
+
"data-arrow": t,
|
|
2943
|
+
style: c,
|
|
2944
|
+
children: [o !== void 0 && /* @__PURE__ */ h("span", {
|
|
2945
|
+
className: "tp-tooltip-trigger",
|
|
2946
|
+
role: "button",
|
|
2947
|
+
tabIndex: 0,
|
|
2948
|
+
"aria-expanded": f,
|
|
2949
|
+
onClick: m,
|
|
2950
|
+
onKeyDown: (e) => {
|
|
2951
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), m());
|
|
2952
|
+
},
|
|
2953
|
+
children: o
|
|
2954
|
+
}), f && /* @__PURE__ */ g("div", {
|
|
2955
|
+
role: "tooltip",
|
|
2956
|
+
"data-arrow": t,
|
|
2957
|
+
"data-adaptive": String(n),
|
|
2958
|
+
className: `tp-tooltip-bubble tp-tooltip-bubble--${t} ${n ? "tp-tooltip-bubble--adaptive" : ""}`.trim(),
|
|
2959
|
+
children: [/* @__PURE__ */ h("span", {
|
|
2960
|
+
className: "tp-tooltip-content",
|
|
2961
|
+
children: e
|
|
2962
|
+
}), /* @__PURE__ */ h("span", {
|
|
2963
|
+
className: "tp-tooltip-arrow",
|
|
2964
|
+
"aria-hidden": "true"
|
|
2965
|
+
})]
|
|
2966
|
+
})]
|
|
2967
|
+
});
|
|
2968
|
+
}, Be = ({ status: e }) => {
|
|
2969
|
+
switch (e) {
|
|
2970
|
+
case "success": return /* @__PURE__ */ g("svg", {
|
|
2971
|
+
width: "18",
|
|
2972
|
+
height: "18",
|
|
2973
|
+
viewBox: "0 0 24 24",
|
|
2974
|
+
fill: "none",
|
|
2975
|
+
"aria-hidden": "true",
|
|
2976
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
2977
|
+
cx: "12",
|
|
2978
|
+
cy: "12",
|
|
2979
|
+
r: "9.5",
|
|
2980
|
+
stroke: "currentColor",
|
|
2981
|
+
strokeWidth: "1.7"
|
|
2982
|
+
}), /* @__PURE__ */ h("path", {
|
|
2983
|
+
d: "M8.2 12.2L10.8 14.8L15.8 9.4",
|
|
2984
|
+
stroke: "currentColor",
|
|
2985
|
+
strokeWidth: "1.8",
|
|
2986
|
+
strokeLinecap: "round",
|
|
2987
|
+
strokeLinejoin: "round"
|
|
2988
|
+
})]
|
|
2989
|
+
});
|
|
2990
|
+
case "warning": return /* @__PURE__ */ g("svg", {
|
|
2991
|
+
width: "18",
|
|
2992
|
+
height: "18",
|
|
2993
|
+
viewBox: "0 0 24 24",
|
|
2994
|
+
fill: "none",
|
|
2995
|
+
"aria-hidden": "true",
|
|
2996
|
+
children: [
|
|
2997
|
+
/* @__PURE__ */ h("circle", {
|
|
2998
|
+
cx: "12",
|
|
2999
|
+
cy: "12",
|
|
3000
|
+
r: "9.5",
|
|
3001
|
+
stroke: "currentColor",
|
|
3002
|
+
strokeWidth: "1.7"
|
|
3003
|
+
}),
|
|
3004
|
+
/* @__PURE__ */ h("rect", {
|
|
3005
|
+
x: "11.2",
|
|
3006
|
+
y: "7.2",
|
|
3007
|
+
width: "1.6",
|
|
3008
|
+
height: "5.8",
|
|
3009
|
+
rx: "0.4",
|
|
3010
|
+
fill: "currentColor"
|
|
3011
|
+
}),
|
|
3012
|
+
/* @__PURE__ */ h("rect", {
|
|
3013
|
+
x: "11.2",
|
|
3014
|
+
y: "14.6",
|
|
3015
|
+
width: "1.6",
|
|
3016
|
+
height: "1.7",
|
|
3017
|
+
rx: "0.4",
|
|
3018
|
+
fill: "currentColor"
|
|
3019
|
+
})
|
|
3020
|
+
]
|
|
3021
|
+
});
|
|
3022
|
+
case "danger": return /* @__PURE__ */ g("svg", {
|
|
3023
|
+
width: "18",
|
|
3024
|
+
height: "18",
|
|
3025
|
+
viewBox: "0 0 24 24",
|
|
3026
|
+
fill: "none",
|
|
3027
|
+
"aria-hidden": "true",
|
|
3028
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
3029
|
+
cx: "12",
|
|
3030
|
+
cy: "12",
|
|
3031
|
+
r: "9.5",
|
|
3032
|
+
stroke: "currentColor",
|
|
3033
|
+
strokeWidth: "1.7"
|
|
3034
|
+
}), /* @__PURE__ */ h("path", {
|
|
3035
|
+
d: "M9 9L15 15M15 9L9 15",
|
|
3036
|
+
stroke: "currentColor",
|
|
3037
|
+
strokeWidth: "1.8",
|
|
3038
|
+
strokeLinecap: "round"
|
|
3039
|
+
})]
|
|
3040
|
+
});
|
|
3041
|
+
default: return /* @__PURE__ */ g("svg", {
|
|
3042
|
+
width: "18",
|
|
3043
|
+
height: "18",
|
|
3044
|
+
viewBox: "0 0 24 24",
|
|
3045
|
+
fill: "none",
|
|
3046
|
+
"aria-hidden": "true",
|
|
3047
|
+
children: [
|
|
3048
|
+
/* @__PURE__ */ h("circle", {
|
|
3049
|
+
cx: "12",
|
|
3050
|
+
cy: "12",
|
|
3051
|
+
r: "9.5",
|
|
3052
|
+
stroke: "currentColor",
|
|
3053
|
+
strokeWidth: "1.7"
|
|
3054
|
+
}),
|
|
3055
|
+
/* @__PURE__ */ h("rect", {
|
|
3056
|
+
x: "11.2",
|
|
3057
|
+
y: "7.6",
|
|
3058
|
+
width: "1.6",
|
|
3059
|
+
height: "1.6",
|
|
3060
|
+
rx: "0.4",
|
|
3061
|
+
fill: "currentColor"
|
|
3062
|
+
}),
|
|
3063
|
+
/* @__PURE__ */ h("rect", {
|
|
3064
|
+
x: "11.2",
|
|
3065
|
+
y: "10.8",
|
|
3066
|
+
width: "1.6",
|
|
3067
|
+
height: "5.6",
|
|
3068
|
+
rx: "0.4",
|
|
3069
|
+
fill: "currentColor"
|
|
3070
|
+
})
|
|
3071
|
+
]
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
}, Ve = ({ status: e = "default", action: t = "none", actionLabel: n = "Details", onAction: r, onClose: i, message: a, className: o = "", style: s }) => /* @__PURE__ */ g("div", {
|
|
3075
|
+
role: e === "danger" ? "alert" : "status",
|
|
3076
|
+
"data-status": e,
|
|
3077
|
+
"data-action": t,
|
|
3078
|
+
className: `tp-fixed-toast tp-fixed-toast--${e} ${o}`.trim(),
|
|
3079
|
+
style: s,
|
|
3080
|
+
children: [
|
|
3081
|
+
/* @__PURE__ */ h("span", {
|
|
3082
|
+
className: "tp-fixed-toast-icon",
|
|
3083
|
+
children: /* @__PURE__ */ h(Be, { status: e })
|
|
3084
|
+
}),
|
|
3085
|
+
/* @__PURE__ */ h("div", {
|
|
3086
|
+
className: "tp-fixed-toast-message",
|
|
3087
|
+
children: a
|
|
3088
|
+
}),
|
|
3089
|
+
t === "button" && /* @__PURE__ */ h("button", {
|
|
3090
|
+
type: "button",
|
|
3091
|
+
className: "tp-fixed-toast-btn",
|
|
3092
|
+
onClick: r,
|
|
3093
|
+
children: n
|
|
3094
|
+
}),
|
|
3095
|
+
t === "go-to" && /* @__PURE__ */ h("button", {
|
|
3096
|
+
type: "button",
|
|
3097
|
+
className: "tp-fixed-toast-icon-action",
|
|
3098
|
+
"aria-label": n || "Go to",
|
|
3099
|
+
onClick: r,
|
|
3100
|
+
children: /* @__PURE__ */ h("svg", {
|
|
3101
|
+
width: "15",
|
|
3102
|
+
height: "15",
|
|
3103
|
+
viewBox: "0 0 16 16",
|
|
3104
|
+
fill: "none",
|
|
3105
|
+
"aria-hidden": "true",
|
|
3106
|
+
children: /* @__PURE__ */ h("path", {
|
|
3107
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
3108
|
+
stroke: "currentColor",
|
|
3109
|
+
strokeWidth: "1.8",
|
|
3110
|
+
strokeLinecap: "round",
|
|
3111
|
+
strokeLinejoin: "round"
|
|
3112
|
+
})
|
|
3113
|
+
})
|
|
3114
|
+
}),
|
|
3115
|
+
t === "close" && /* @__PURE__ */ h("button", {
|
|
3116
|
+
type: "button",
|
|
3117
|
+
className: "tp-fixed-toast-icon-action",
|
|
3118
|
+
"aria-label": "Close",
|
|
3119
|
+
onClick: i,
|
|
3120
|
+
children: /* @__PURE__ */ h("svg", {
|
|
3121
|
+
width: "14",
|
|
3122
|
+
height: "14",
|
|
3123
|
+
viewBox: "0 0 16 16",
|
|
3124
|
+
fill: "none",
|
|
3125
|
+
"aria-hidden": "true",
|
|
3126
|
+
children: /* @__PURE__ */ h("path", {
|
|
3127
|
+
d: "M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",
|
|
3128
|
+
stroke: "currentColor",
|
|
3129
|
+
strokeWidth: "1.7",
|
|
3130
|
+
strokeLinecap: "round"
|
|
3131
|
+
})
|
|
3132
|
+
})
|
|
3133
|
+
})
|
|
3134
|
+
]
|
|
3135
|
+
}), He = [
|
|
3136
|
+
"Jan",
|
|
3137
|
+
"Feb",
|
|
3138
|
+
"Mar",
|
|
3139
|
+
"Apr",
|
|
3140
|
+
"May",
|
|
3141
|
+
"Jun",
|
|
3142
|
+
"Jul",
|
|
3143
|
+
"Aug",
|
|
3144
|
+
"Sep",
|
|
3145
|
+
"Oct",
|
|
3146
|
+
"Nov",
|
|
3147
|
+
"Dec"
|
|
3148
|
+
], Ue = [
|
|
3149
|
+
"1月",
|
|
3150
|
+
"2月",
|
|
3151
|
+
"3月",
|
|
3152
|
+
"4月",
|
|
3153
|
+
"5月",
|
|
3154
|
+
"6月",
|
|
3155
|
+
"7月",
|
|
3156
|
+
"8月",
|
|
3157
|
+
"9月",
|
|
3158
|
+
"10月",
|
|
3159
|
+
"11月",
|
|
3160
|
+
"12月"
|
|
3161
|
+
], We = ({ value: e, defaultValue: t = {
|
|
3162
|
+
year: 2026,
|
|
3163
|
+
month: 11
|
|
3164
|
+
}, minYear: n = 2020, maxYear: r = 2032, locale: i = "en", onChange: a, className: o = "", style: s }) => {
|
|
3165
|
+
let c = e !== void 0, [l, u] = p(t), d = c ? e : l, [f, m] = p(d.year), _ = i === "zh" ? Ue : He, v = (e) => {
|
|
3166
|
+
let t = {
|
|
3167
|
+
year: f,
|
|
3168
|
+
month: e
|
|
3169
|
+
};
|
|
3170
|
+
c || u(t), a?.(t);
|
|
3171
|
+
};
|
|
3172
|
+
return /* @__PURE__ */ g("div", {
|
|
3173
|
+
className: `tp-month-picker ${o}`.trim(),
|
|
3174
|
+
style: s,
|
|
3175
|
+
children: [/* @__PURE__ */ g("div", {
|
|
3176
|
+
className: "tp-month-picker-header",
|
|
3177
|
+
children: [
|
|
3178
|
+
/* @__PURE__ */ h("button", {
|
|
3179
|
+
type: "button",
|
|
3180
|
+
className: "tp-month-picker-nav",
|
|
3181
|
+
"aria-label": "Previous year",
|
|
3182
|
+
disabled: f <= n,
|
|
3183
|
+
onClick: () => m((e) => Math.max(n, e - 1)),
|
|
3184
|
+
children: /* @__PURE__ */ h("svg", {
|
|
3185
|
+
width: "16",
|
|
3186
|
+
height: "16",
|
|
3187
|
+
viewBox: "0 0 16 16",
|
|
3188
|
+
fill: "none",
|
|
3189
|
+
"aria-hidden": "true",
|
|
3190
|
+
children: /* @__PURE__ */ h("path", {
|
|
3191
|
+
d: "M10 3.5L5.5 8L10 12.5",
|
|
3192
|
+
stroke: "currentColor",
|
|
3193
|
+
strokeWidth: "1.7",
|
|
3194
|
+
strokeLinecap: "round",
|
|
3195
|
+
strokeLinejoin: "round"
|
|
3196
|
+
})
|
|
3197
|
+
})
|
|
3198
|
+
}),
|
|
3199
|
+
/* @__PURE__ */ h("span", {
|
|
3200
|
+
className: "tp-month-picker-year",
|
|
3201
|
+
children: i === "zh" ? `${f}年` : f
|
|
3202
|
+
}),
|
|
3203
|
+
/* @__PURE__ */ h("button", {
|
|
3204
|
+
type: "button",
|
|
3205
|
+
className: "tp-month-picker-nav",
|
|
3206
|
+
"aria-label": "Next year",
|
|
3207
|
+
disabled: f >= r,
|
|
3208
|
+
onClick: () => m((e) => Math.min(r, e + 1)),
|
|
3209
|
+
children: /* @__PURE__ */ h("svg", {
|
|
3210
|
+
width: "16",
|
|
3211
|
+
height: "16",
|
|
3212
|
+
viewBox: "0 0 16 16",
|
|
3213
|
+
fill: "none",
|
|
3214
|
+
"aria-hidden": "true",
|
|
3215
|
+
children: /* @__PURE__ */ h("path", {
|
|
3216
|
+
d: "M6 3.5L10.5 8L6 12.5",
|
|
3217
|
+
stroke: "currentColor",
|
|
3218
|
+
strokeWidth: "1.7",
|
|
3219
|
+
strokeLinecap: "round",
|
|
3220
|
+
strokeLinejoin: "round"
|
|
3221
|
+
})
|
|
3222
|
+
})
|
|
3223
|
+
})
|
|
3224
|
+
]
|
|
3225
|
+
}), /* @__PURE__ */ h("div", {
|
|
3226
|
+
className: "tp-month-picker-grid",
|
|
3227
|
+
role: "listbox",
|
|
3228
|
+
"aria-label": "Month",
|
|
3229
|
+
children: _.map((e, t) => {
|
|
3230
|
+
let n = t + 1, r = d.year === f && d.month === n;
|
|
3231
|
+
return /* @__PURE__ */ h("button", {
|
|
3232
|
+
type: "button",
|
|
3233
|
+
role: "option",
|
|
3234
|
+
"aria-selected": r,
|
|
3235
|
+
className: `tp-month-picker-cell ${r ? "tp-month-picker-cell--selected" : ""}`.trim(),
|
|
3236
|
+
onClick: () => v(n),
|
|
3237
|
+
children: e
|
|
3238
|
+
}, n);
|
|
3239
|
+
})
|
|
3240
|
+
})]
|
|
3241
|
+
});
|
|
3242
|
+
}, Ge = [
|
|
3243
|
+
"Sun",
|
|
3244
|
+
"Mon",
|
|
3245
|
+
"Tue",
|
|
3246
|
+
"Wed",
|
|
3247
|
+
"Thu",
|
|
3248
|
+
"Fri",
|
|
3249
|
+
"Sat"
|
|
3250
|
+
], Ke = [
|
|
3251
|
+
"日",
|
|
3252
|
+
"一",
|
|
3253
|
+
"二",
|
|
3254
|
+
"三",
|
|
3255
|
+
"四",
|
|
3256
|
+
"五",
|
|
3257
|
+
"六"
|
|
3258
|
+
];
|
|
3259
|
+
function qe(e) {
|
|
3260
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
3261
|
+
}
|
|
3262
|
+
var Je = ({ value: e, defaultValue: t, referenceDate: n, markedDates: r = [], locale: i = "en", onChange: a, className: o = "", style: s }) => {
|
|
3263
|
+
let c = d(() => n ?? t ?? e ?? new Date(2026, 10, 23), [
|
|
3264
|
+
n,
|
|
3265
|
+
t,
|
|
3266
|
+
e
|
|
3267
|
+
]), l = e !== void 0, [u, f] = p(() => t ?? c), m = qe(l ? e : u), _ = d(() => {
|
|
3268
|
+
let e = [];
|
|
3269
|
+
for (let t = 6; t >= 0; t--) e.push(new Date(c.getFullYear(), c.getMonth(), c.getDate() - t));
|
|
3270
|
+
return e;
|
|
3271
|
+
}, [c]), v = i === "zh" ? Ke : Ge, y = d(() => new Set(r), [r]), b = (e) => {
|
|
3272
|
+
l || f(e), a?.(e);
|
|
3273
|
+
};
|
|
3274
|
+
return /* @__PURE__ */ h("div", {
|
|
3275
|
+
className: `tp-last7-picker ${o}`.trim(),
|
|
3276
|
+
role: "listbox",
|
|
3277
|
+
"aria-label": "Last 7 Days",
|
|
3278
|
+
style: s,
|
|
3279
|
+
children: _.map((e) => {
|
|
3280
|
+
let t = qe(e), n = t === m, r = y.has(t);
|
|
3281
|
+
return /* @__PURE__ */ g("button", {
|
|
3282
|
+
type: "button",
|
|
3283
|
+
role: "option",
|
|
3284
|
+
"aria-selected": n,
|
|
3285
|
+
"aria-label": t,
|
|
3286
|
+
className: `tp-last7-day ${n ? "tp-last7-day--selected" : ""}`.trim(),
|
|
3287
|
+
onClick: () => b(e),
|
|
3288
|
+
children: [
|
|
3289
|
+
/* @__PURE__ */ h("span", {
|
|
3290
|
+
className: "tp-last7-weekday",
|
|
3291
|
+
children: v[e.getDay()]
|
|
3292
|
+
}),
|
|
3293
|
+
/* @__PURE__ */ h("span", {
|
|
3294
|
+
className: "tp-last7-num",
|
|
3295
|
+
children: e.getDate()
|
|
3296
|
+
}),
|
|
3297
|
+
/* @__PURE__ */ h("span", {
|
|
3298
|
+
className: `tp-last7-dot ${r ? "tp-last7-dot--visible" : ""}`.trim(),
|
|
3299
|
+
"aria-hidden": "true"
|
|
3300
|
+
})
|
|
3301
|
+
]
|
|
3302
|
+
}, t);
|
|
3303
|
+
})
|
|
3304
|
+
});
|
|
3305
|
+
}, Ye = ({ variant: e = "step", items: t, className: n = "", style: r }) => /* @__PURE__ */ h("ol", {
|
|
3306
|
+
className: `tp-step-text tp-step-text--${e} ${n}`.trim(),
|
|
3307
|
+
"data-variant": e,
|
|
3308
|
+
style: r,
|
|
3309
|
+
children: t.map((t, n) => /* @__PURE__ */ g("li", {
|
|
3310
|
+
className: "tp-step-text-item",
|
|
3311
|
+
children: [/* @__PURE__ */ h("span", {
|
|
3312
|
+
className: "tp-step-text-marker",
|
|
3313
|
+
"aria-hidden": "true",
|
|
3314
|
+
children: e === "bullet" ? "•" : e === "numbered" ? `${n + 1}.` : n + 1
|
|
3315
|
+
}), /* @__PURE__ */ g("div", {
|
|
3316
|
+
className: "tp-step-text-body",
|
|
3317
|
+
children: [
|
|
3318
|
+
t.title !== void 0 && /* @__PURE__ */ h("div", {
|
|
3319
|
+
className: "tp-step-text-title",
|
|
3320
|
+
children: t.title
|
|
3321
|
+
}),
|
|
3322
|
+
/* @__PURE__ */ h("div", {
|
|
3323
|
+
className: "tp-step-text-content",
|
|
3324
|
+
children: t.text
|
|
3325
|
+
}),
|
|
3326
|
+
t.note !== void 0 && /* @__PURE__ */ h("div", {
|
|
3327
|
+
className: "tp-step-text-note",
|
|
3328
|
+
children: t.note
|
|
3329
|
+
})
|
|
3330
|
+
]
|
|
3331
|
+
})]
|
|
3332
|
+
}, t.key ?? n))
|
|
3333
|
+
}), Xe = ({ variant: e = "linear", percent: t, tone: n = "focus", size: r = 64, strokeWidth: i = 6, showValue: a = !0, label: o, className: s = "", style: c }) => {
|
|
3334
|
+
let l = Math.max(0, Math.min(100, Math.round(t)));
|
|
3335
|
+
if (e === "circular") {
|
|
3336
|
+
let e = Math.max(8, (r - i) / 2), t = 2 * Math.PI * e, u = t * (1 - l / 100);
|
|
3337
|
+
return /* @__PURE__ */ g("div", {
|
|
3338
|
+
className: `tp-progress tp-progress--circular tp-progress--tone-${n} ${s}`.trim(),
|
|
3339
|
+
role: "progressbar",
|
|
3340
|
+
"aria-valuenow": l,
|
|
3341
|
+
"aria-valuemin": 0,
|
|
3342
|
+
"aria-valuemax": 100,
|
|
3343
|
+
style: c,
|
|
3344
|
+
children: [/* @__PURE__ */ g("div", {
|
|
3345
|
+
className: "tp-progress-ring-wrap",
|
|
3346
|
+
style: {
|
|
3347
|
+
width: r,
|
|
3348
|
+
height: r
|
|
3349
|
+
},
|
|
3350
|
+
children: [/* @__PURE__ */ g("svg", {
|
|
3351
|
+
width: r,
|
|
3352
|
+
height: r,
|
|
3353
|
+
viewBox: `0 0 ${r} ${r}`,
|
|
3354
|
+
"aria-hidden": "true",
|
|
3355
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
3356
|
+
cx: r / 2,
|
|
3357
|
+
cy: r / 2,
|
|
3358
|
+
r: e,
|
|
3359
|
+
fill: "none",
|
|
3360
|
+
stroke: "var(--tp-divider)",
|
|
3361
|
+
strokeWidth: i
|
|
3362
|
+
}), /* @__PURE__ */ h("circle", {
|
|
3363
|
+
cx: r / 2,
|
|
3364
|
+
cy: r / 2,
|
|
3365
|
+
r: e,
|
|
3366
|
+
fill: "none",
|
|
3367
|
+
className: "tp-progress-ring-stroke",
|
|
3368
|
+
strokeWidth: i,
|
|
3369
|
+
strokeLinecap: "round",
|
|
3370
|
+
strokeDasharray: t,
|
|
3371
|
+
strokeDashoffset: u,
|
|
3372
|
+
transform: `rotate(-90 ${r / 2} ${r / 2})`
|
|
3373
|
+
})]
|
|
3374
|
+
}), a && /* @__PURE__ */ g("span", {
|
|
3375
|
+
className: "tp-progress-ring-val",
|
|
3376
|
+
children: [l, "%"]
|
|
3377
|
+
})]
|
|
3378
|
+
}), o !== void 0 && /* @__PURE__ */ h("div", {
|
|
3379
|
+
className: "tp-progress-label",
|
|
3380
|
+
children: o
|
|
3381
|
+
})]
|
|
3382
|
+
});
|
|
3383
|
+
}
|
|
3384
|
+
return /* @__PURE__ */ g("div", {
|
|
3385
|
+
className: `tp-progress tp-progress--linear tp-progress--tone-${n} ${s}`.trim(),
|
|
3386
|
+
role: "progressbar",
|
|
3387
|
+
"aria-valuenow": l,
|
|
3388
|
+
"aria-valuemin": 0,
|
|
3389
|
+
"aria-valuemax": 100,
|
|
3390
|
+
style: c,
|
|
3391
|
+
children: [(o !== void 0 || a) && /* @__PURE__ */ g("div", {
|
|
3392
|
+
className: "tp-progress-head",
|
|
3393
|
+
children: [/* @__PURE__ */ h("span", {
|
|
3394
|
+
className: "tp-progress-label",
|
|
3395
|
+
children: o
|
|
3396
|
+
}), a && /* @__PURE__ */ g("span", {
|
|
3397
|
+
className: "tp-progress-pct",
|
|
3398
|
+
children: [l, "%"]
|
|
3399
|
+
})]
|
|
3400
|
+
}), /* @__PURE__ */ h("div", {
|
|
3401
|
+
className: "tp-progress-track",
|
|
3402
|
+
children: /* @__PURE__ */ h("div", {
|
|
3403
|
+
className: "tp-progress-fill",
|
|
3404
|
+
style: { width: `${l}%` }
|
|
3405
|
+
})
|
|
3406
|
+
})]
|
|
3407
|
+
});
|
|
3408
|
+
}, Ze = ({ variant: e = "text", width: t, height: n, lines: r = 3, animated: i = !0, className: a = "", style: o }) => {
|
|
3409
|
+
let s = i ? "tp-skeleton-item--animated" : "";
|
|
3410
|
+
if (e === "card") return /* @__PURE__ */ g("div", {
|
|
3411
|
+
className: `tp-skeleton-card ${a}`.trim(),
|
|
3412
|
+
"aria-busy": "true",
|
|
3413
|
+
style: o,
|
|
3414
|
+
children: [
|
|
3415
|
+
/* @__PURE__ */ h("div", {
|
|
3416
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3417
|
+
style: {
|
|
3418
|
+
width: "48%",
|
|
3419
|
+
height: 18
|
|
3420
|
+
}
|
|
3421
|
+
}),
|
|
3422
|
+
/* @__PURE__ */ h("div", {
|
|
3423
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3424
|
+
style: {
|
|
3425
|
+
width: "100%",
|
|
3426
|
+
height: 64,
|
|
3427
|
+
borderRadius: 10
|
|
3428
|
+
}
|
|
3429
|
+
}),
|
|
3430
|
+
/* @__PURE__ */ h("div", {
|
|
3431
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3432
|
+
style: {
|
|
3433
|
+
width: "76%",
|
|
3434
|
+
height: 12
|
|
3435
|
+
}
|
|
3436
|
+
})
|
|
3437
|
+
]
|
|
3438
|
+
});
|
|
3439
|
+
if (e === "circle") {
|
|
3440
|
+
let e = t ?? n ?? 40;
|
|
3441
|
+
return /* @__PURE__ */ h("span", {
|
|
3442
|
+
"aria-busy": "true",
|
|
3443
|
+
className: `tp-skeleton-item tp-skeleton-item--circle ${s} ${a}`.trim(),
|
|
3444
|
+
style: {
|
|
3445
|
+
width: e,
|
|
3446
|
+
height: e,
|
|
3447
|
+
...o
|
|
3448
|
+
}
|
|
3449
|
+
});
|
|
3450
|
+
}
|
|
3451
|
+
return e === "rect" ? /* @__PURE__ */ h("div", {
|
|
3452
|
+
"aria-busy": "true",
|
|
3453
|
+
className: `tp-skeleton-item ${s} ${a}`.trim(),
|
|
3454
|
+
style: {
|
|
3455
|
+
width: t ?? "100%",
|
|
3456
|
+
height: n ?? 80,
|
|
3457
|
+
...o
|
|
3458
|
+
}
|
|
3459
|
+
}) : /* @__PURE__ */ h("div", {
|
|
3460
|
+
className: `tp-skeleton-text-group ${a}`.trim(),
|
|
3461
|
+
"aria-busy": "true",
|
|
3462
|
+
style: o,
|
|
3463
|
+
children: Array.from({ length: Math.max(1, r) }).map((e, i) => /* @__PURE__ */ h("div", {
|
|
3464
|
+
className: `tp-skeleton-item ${s}`.trim(),
|
|
3465
|
+
style: {
|
|
3466
|
+
width: i === r - 1 && r > 1 ? "68%" : t ?? "100%",
|
|
3467
|
+
height: n ?? 13
|
|
3468
|
+
}
|
|
3469
|
+
}, i))
|
|
3470
|
+
});
|
|
3471
|
+
}, Qe = ({ steps: e, current: t, direction: n = "horizontal", className: r = "", style: i }) => /* @__PURE__ */ h("ol", {
|
|
3472
|
+
className: `tp-stepper tp-stepper--${n} ${r}`.trim(),
|
|
3473
|
+
"data-direction": n,
|
|
3474
|
+
style: i,
|
|
3475
|
+
children: e.map((n, r) => {
|
|
3476
|
+
let i = r < t ? "done" : r === t ? "active" : "pending";
|
|
3477
|
+
return /* @__PURE__ */ g("li", {
|
|
3478
|
+
className: `tp-stepper-item tp-stepper-item--${i}`,
|
|
3479
|
+
"aria-current": i === "active" ? "step" : void 0,
|
|
3480
|
+
children: [/* @__PURE__ */ g("div", {
|
|
3481
|
+
className: "tp-stepper-node-row",
|
|
3482
|
+
children: [/* @__PURE__ */ h("span", {
|
|
3483
|
+
className: "tp-stepper-circle",
|
|
3484
|
+
children: i === "done" ? /* @__PURE__ */ h("svg", {
|
|
3485
|
+
width: "12",
|
|
3486
|
+
height: "12",
|
|
3487
|
+
viewBox: "0 0 12 12",
|
|
3488
|
+
fill: "none",
|
|
3489
|
+
"aria-hidden": "true",
|
|
3490
|
+
children: /* @__PURE__ */ h("path", {
|
|
3491
|
+
d: "M2.5 6.2L5 8.7L9.5 3.6",
|
|
3492
|
+
stroke: "currentColor",
|
|
3493
|
+
strokeWidth: "1.9",
|
|
3494
|
+
strokeLinecap: "round",
|
|
3495
|
+
strokeLinejoin: "round"
|
|
3496
|
+
})
|
|
3497
|
+
}) : r + 1
|
|
3498
|
+
}), r < e.length - 1 && /* @__PURE__ */ h("span", {
|
|
3499
|
+
className: "tp-stepper-line",
|
|
3500
|
+
"aria-hidden": "true"
|
|
3501
|
+
})]
|
|
3502
|
+
}), /* @__PURE__ */ g("div", {
|
|
3503
|
+
className: "tp-stepper-meta",
|
|
3504
|
+
children: [/* @__PURE__ */ h("div", {
|
|
3505
|
+
className: "tp-stepper-title",
|
|
3506
|
+
children: n.title
|
|
3507
|
+
}), n.description !== void 0 && /* @__PURE__ */ h("div", {
|
|
3508
|
+
className: "tp-stepper-desc",
|
|
3509
|
+
children: n.description
|
|
3510
|
+
})]
|
|
3511
|
+
})]
|
|
3512
|
+
}, n.key);
|
|
3513
|
+
})
|
|
3514
|
+
}), $e = ({ inset: e = !1, label: t, spacing: n = "md", className: r = "", style: i }) => /* @__PURE__ */ g("div", {
|
|
3515
|
+
role: "separator",
|
|
3516
|
+
className: `tp-divider tp-divider--space-${n} ${e ? "tp-divider--inset" : ""} ${t === void 0 ? "" : "tp-divider--with-label"} ${r}`.trim(),
|
|
3517
|
+
style: i,
|
|
3518
|
+
children: [
|
|
3519
|
+
/* @__PURE__ */ h("span", { className: "tp-divider-line" }),
|
|
3520
|
+
t !== void 0 && /* @__PURE__ */ h("span", {
|
|
3521
|
+
className: "tp-divider-label",
|
|
3522
|
+
children: t
|
|
3523
|
+
}),
|
|
3524
|
+
t !== void 0 && /* @__PURE__ */ h("span", { className: "tp-divider-line" })
|
|
3525
|
+
]
|
|
3526
|
+
});
|
|
3527
|
+
// src/core/components/TPAvatar.tsx
|
|
3528
|
+
function et(e) {
|
|
3529
|
+
if (!e) return "";
|
|
3530
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
3531
|
+
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : `${t[0][0]}${t[1][0]}`.toUpperCase();
|
|
3532
|
+
}
|
|
3533
|
+
var tt = ({ src: e, name: t, icon: i, size: a = "md", status: o = "none", shape: s = "circle", alt: c, className: l = "", style: u }) => {
|
|
3534
|
+
let d = a === "sm" ? 16 : a === "lg" ? 24 : 20, f = et(t) || "?";
|
|
3535
|
+
return e ? f = /* @__PURE__ */ h("img", {
|
|
3536
|
+
src: e,
|
|
3537
|
+
alt: c ?? t ?? "Avatar",
|
|
3538
|
+
className: "tp-avatar-img"
|
|
3539
|
+
}) : i !== void 0 && (f = typeof i == "string" && n(i) ? /* @__PURE__ */ h(r, {
|
|
3540
|
+
name: i,
|
|
3541
|
+
size: d
|
|
3542
|
+
}) : i), /* @__PURE__ */ g("span", {
|
|
3543
|
+
className: `tp-avatar tp-avatar--${a} tp-avatar--${s} ${l}`.trim(),
|
|
3544
|
+
"data-size": a,
|
|
3545
|
+
"data-shape": s,
|
|
3546
|
+
"aria-label": e ? void 0 : c ?? t,
|
|
3547
|
+
style: u,
|
|
3548
|
+
children: [f, o !== "none" && /* @__PURE__ */ h("span", {
|
|
3549
|
+
className: `tp-avatar-status tp-avatar-status--${o}`,
|
|
3550
|
+
"aria-label": `Status: ${o}`
|
|
3551
|
+
})]
|
|
3552
|
+
});
|
|
3553
|
+
}, nt = ({ length: e = 6, value: t, defaultValue: n = "", masked: r = !1, error: i, disabled: a = !1, onChange: o, onComplete: s, ariaLabel: c = "Verification code", className: l = "", style: u }) => {
|
|
3554
|
+
let d = Math.max(2, Math.min(8, e)), m = t !== void 0, [_, v] = p(n.slice(0, d)), y = (m ? t : _).slice(0, d), b = f([]), x = Array.from({ length: d }, (e, t) => y[t] ?? ""), S = (e) => {
|
|
3555
|
+
let t = e.slice(0, d);
|
|
3556
|
+
m || v(t), o?.(t), t.length === d && s?.(t);
|
|
3557
|
+
};
|
|
3558
|
+
return /* @__PURE__ */ g("div", {
|
|
3559
|
+
className: `tp-pin-wrap ${i ? "tp-pin-wrap--error" : ""} ${l}`.trim(),
|
|
3560
|
+
style: u,
|
|
3561
|
+
children: [/* @__PURE__ */ h("div", {
|
|
3562
|
+
className: "tp-pin-cells",
|
|
3563
|
+
role: "group",
|
|
3564
|
+
"aria-label": c,
|
|
3565
|
+
children: x.map((e, t) => /* @__PURE__ */ h("input", {
|
|
3566
|
+
ref: (e) => {
|
|
3567
|
+
b.current[t] = e;
|
|
3568
|
+
},
|
|
3569
|
+
type: r ? "password" : "text",
|
|
3570
|
+
inputMode: "numeric",
|
|
3571
|
+
maxLength: 1,
|
|
3572
|
+
disabled: a,
|
|
3573
|
+
"aria-label": `${c} digit ${t + 1}`,
|
|
3574
|
+
className: `tp-pin-cell ${e ? "tp-pin-cell--filled" : ""} ${i ? "tp-pin-cell--error" : ""}`.trim(),
|
|
3575
|
+
value: e,
|
|
3576
|
+
onChange: (e) => {
|
|
3577
|
+
if (a) return;
|
|
3578
|
+
let n = e.target.value.replace(/\s+/g, "");
|
|
3579
|
+
if (n.length > 1) {
|
|
3580
|
+
let e = (y.slice(0, t) + n).slice(0, d);
|
|
3581
|
+
S(e), b.current[Math.min(d - 1, t + n.length)]?.focus();
|
|
3582
|
+
return;
|
|
3583
|
+
}
|
|
3584
|
+
let r = [...x];
|
|
3585
|
+
r[t] = n, S(r.join("")), n && t < d - 1 && b.current[t + 1]?.focus();
|
|
3586
|
+
},
|
|
3587
|
+
onKeyDown: (e) => {
|
|
3588
|
+
e.key === "Backspace" && !x[t] && t > 0 && b.current[t - 1]?.focus();
|
|
3589
|
+
},
|
|
3590
|
+
onPaste: (e) => {
|
|
3591
|
+
let t = e.clipboardData.getData("text").replace(/\s+/g, "");
|
|
3592
|
+
t && (e.preventDefault(), S(t), b.current[Math.min(d - 1, t.length)]?.focus());
|
|
3593
|
+
}
|
|
3594
|
+
}, t))
|
|
3595
|
+
}), i && /* @__PURE__ */ h("div", {
|
|
3596
|
+
className: "tp-pin-error",
|
|
3597
|
+
role: "alert",
|
|
3598
|
+
children: i
|
|
3599
|
+
})]
|
|
3600
|
+
});
|
|
3601
|
+
}, rt = ({ tone: e }) => {
|
|
3602
|
+
switch (e) {
|
|
3603
|
+
case "warning": return /* @__PURE__ */ g("svg", {
|
|
3604
|
+
width: "20",
|
|
3605
|
+
height: "20",
|
|
3606
|
+
viewBox: "0 0 24 24",
|
|
3607
|
+
fill: "none",
|
|
3608
|
+
"aria-hidden": "true",
|
|
3609
|
+
children: [
|
|
3610
|
+
/* @__PURE__ */ h("circle", {
|
|
3611
|
+
cx: "12",
|
|
3612
|
+
cy: "12",
|
|
3613
|
+
r: "9.5",
|
|
3614
|
+
stroke: "currentColor",
|
|
3615
|
+
strokeWidth: "1.5"
|
|
3616
|
+
}),
|
|
3617
|
+
/* @__PURE__ */ h("rect", {
|
|
3618
|
+
x: "11.25",
|
|
3619
|
+
y: "7.2",
|
|
3620
|
+
width: "1.5",
|
|
3621
|
+
height: "6",
|
|
3622
|
+
rx: "0.4",
|
|
3623
|
+
fill: "currentColor"
|
|
3624
|
+
}),
|
|
3625
|
+
/* @__PURE__ */ h("rect", {
|
|
3626
|
+
x: "11.25",
|
|
3627
|
+
y: "14.8",
|
|
3628
|
+
width: "1.5",
|
|
3629
|
+
height: "1.6",
|
|
3630
|
+
rx: "0.4",
|
|
3631
|
+
fill: "currentColor"
|
|
3632
|
+
})
|
|
3633
|
+
]
|
|
3634
|
+
});
|
|
3635
|
+
case "alert": return /* @__PURE__ */ g("svg", {
|
|
3636
|
+
width: "20",
|
|
3637
|
+
height: "20",
|
|
3638
|
+
viewBox: "0 0 24 24",
|
|
3639
|
+
fill: "none",
|
|
3640
|
+
"aria-hidden": "true",
|
|
3641
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
3642
|
+
cx: "12",
|
|
3643
|
+
cy: "12",
|
|
3644
|
+
r: "9.5",
|
|
3645
|
+
stroke: "currentColor",
|
|
3646
|
+
strokeWidth: "1.5"
|
|
3647
|
+
}), /* @__PURE__ */ h("path", {
|
|
3648
|
+
d: "M9.2 9.2L14.8 14.8M14.8 9.2L9.2 14.8",
|
|
3649
|
+
stroke: "currentColor",
|
|
3650
|
+
strokeWidth: "1.6",
|
|
3651
|
+
strokeLinecap: "round"
|
|
3652
|
+
})]
|
|
3653
|
+
});
|
|
3654
|
+
case "focus": return /* @__PURE__ */ g("svg", {
|
|
3655
|
+
width: "20",
|
|
3656
|
+
height: "20",
|
|
3657
|
+
viewBox: "0 0 24 24",
|
|
3658
|
+
fill: "none",
|
|
3659
|
+
"aria-hidden": "true",
|
|
3660
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
3661
|
+
cx: "12",
|
|
3662
|
+
cy: "12",
|
|
3663
|
+
r: "9.5",
|
|
3664
|
+
stroke: "currentColor",
|
|
3665
|
+
strokeWidth: "1.5"
|
|
3666
|
+
}), /* @__PURE__ */ h("path", {
|
|
3667
|
+
d: "M8.5 12.2L11 14.7L15.8 9.6",
|
|
3668
|
+
stroke: "currentColor",
|
|
3669
|
+
strokeWidth: "1.7",
|
|
3670
|
+
strokeLinecap: "round",
|
|
3671
|
+
strokeLinejoin: "round"
|
|
3672
|
+
})]
|
|
3673
|
+
});
|
|
3674
|
+
default: return /* @__PURE__ */ g("svg", {
|
|
3675
|
+
width: "20",
|
|
3676
|
+
height: "20",
|
|
3677
|
+
viewBox: "0 0 24 24",
|
|
3678
|
+
fill: "none",
|
|
3679
|
+
"aria-hidden": "true",
|
|
3680
|
+
children: [
|
|
3681
|
+
/* @__PURE__ */ h("circle", {
|
|
3682
|
+
cx: "12",
|
|
3683
|
+
cy: "12",
|
|
3684
|
+
r: "9.5",
|
|
3685
|
+
stroke: "currentColor",
|
|
3686
|
+
strokeWidth: "1.4"
|
|
3687
|
+
}),
|
|
3688
|
+
/* @__PURE__ */ h("rect", {
|
|
3689
|
+
x: "11.2",
|
|
3690
|
+
y: "8",
|
|
3691
|
+
width: "1.5",
|
|
3692
|
+
height: "1.5",
|
|
3693
|
+
fill: "currentColor"
|
|
3694
|
+
}),
|
|
3695
|
+
/* @__PURE__ */ h("path", {
|
|
3696
|
+
d: "M11.2 11H12.7V16.5H11.2V11Z",
|
|
3697
|
+
fill: "currentColor"
|
|
3698
|
+
})
|
|
3699
|
+
]
|
|
3700
|
+
});
|
|
3701
|
+
}
|
|
3702
|
+
}, it = () => /* @__PURE__ */ h("svg", {
|
|
3703
|
+
width: "14",
|
|
3704
|
+
height: "14",
|
|
3705
|
+
viewBox: "0 0 16 16",
|
|
3706
|
+
fill: "none",
|
|
3707
|
+
"aria-hidden": "true",
|
|
3708
|
+
children: /* @__PURE__ */ h("path", {
|
|
3709
|
+
d: "M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",
|
|
3710
|
+
stroke: "currentColor",
|
|
3711
|
+
strokeWidth: "1.6",
|
|
3712
|
+
strokeLinecap: "round"
|
|
3713
|
+
})
|
|
3714
|
+
}), at = ({ tone: e = "info", title: t, actionLabel: n, onAction: r, closable: i, onClose: a, icon: o, className: s = "", style: c }) => {
|
|
3715
|
+
let l = i ?? !!a;
|
|
3716
|
+
return /* @__PURE__ */ g("div", {
|
|
3717
|
+
role: "region",
|
|
3718
|
+
"data-tone": e,
|
|
3719
|
+
className: `tp-prompt tp-prompt--${e} ${s}`.trim(),
|
|
3720
|
+
style: c,
|
|
3721
|
+
children: [
|
|
3722
|
+
/* @__PURE__ */ h("span", {
|
|
3723
|
+
className: "tp-prompt-icon",
|
|
3724
|
+
children: o === void 0 ? /* @__PURE__ */ h(rt, { tone: e }) : o
|
|
3725
|
+
}),
|
|
3726
|
+
/* @__PURE__ */ g("div", {
|
|
3727
|
+
className: "tp-prompt-content",
|
|
3728
|
+
children: [/* @__PURE__ */ h("div", {
|
|
3729
|
+
className: "tp-prompt-title",
|
|
3730
|
+
children: t
|
|
3731
|
+
}), n !== void 0 && /* @__PURE__ */ h("button", {
|
|
3732
|
+
type: "button",
|
|
3733
|
+
className: "tp-prompt-action",
|
|
3734
|
+
onClick: r,
|
|
3735
|
+
children: n
|
|
3736
|
+
})]
|
|
3737
|
+
}),
|
|
3738
|
+
l && /* @__PURE__ */ h("button", {
|
|
3739
|
+
type: "button",
|
|
3740
|
+
className: "tp-prompt-close",
|
|
3741
|
+
"aria-label": "Dismiss",
|
|
3742
|
+
onClick: a,
|
|
3743
|
+
children: /* @__PURE__ */ h(it, {})
|
|
3744
|
+
})
|
|
3745
|
+
]
|
|
3746
|
+
});
|
|
3747
|
+
};
|
|
3748
|
+
export { T as $, de as A, ee as B, Oe as C, _e as D, ye as E, oe as F, U as G, q as H, ae as I, L as J, z as K, ie as L, le as M, Y as N, he as O, se as P, j as Q, re as R, De as S, xe as T, K as U, J as V, W, F as X, I as Y, P as Z, Fe as _, Qe as a, ke as b, Ye as c, Ve as d, w as et, ze as f, Pe as g, Le as h, $e as i, ue as j, me as k, Je as l, Ie as m, nt as n, y as nt, Ze as o, Re as p, R as q, tt as r, Xe as s, at as t, x as tt, We as u, Me as v, Ce as w, Te as x, Ne as y, ne as z };
|