tguikit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,918 @@
1
+ "use client";
2
+ import { clsx as e } from "clsx";
3
+ import { cva as t } from "class-variance-authority";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import { Children as i, Fragment as a, createContext as o, isValidElement as s, useCallback as c, useContext as l, useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as m } from "react";
6
+ //#region src/shared/lib/cn.ts
7
+ function h(...t) {
8
+ return e(t);
9
+ }
10
+ var g = {
11
+ typography: "_typography_1uxpm_1",
12
+ "weight-1": "_weight-1_1uxpm_6",
13
+ "weight-2": "_weight-2_1uxpm_10",
14
+ "weight-3": "_weight-3_1uxpm_14",
15
+ caps: "_caps_1uxpm_18"
16
+ }, _ = t(g.typography, {
17
+ variants: {
18
+ weight: {
19
+ 1: g["weight-1"],
20
+ 2: g["weight-2"],
21
+ 3: g["weight-3"]
22
+ },
23
+ caps: { true: g.caps }
24
+ },
25
+ defaultVariants: { weight: "3" }
26
+ });
27
+ //#endregion
28
+ //#region src/components/Typography/Typography.tsx
29
+ function v({ ref: e, weight: t, caps: r, Component: i = "span", className: a, ...o }) {
30
+ return /* @__PURE__ */ n(i, {
31
+ ref: e,
32
+ className: h(_({
33
+ weight: t,
34
+ caps: r
35
+ }), a),
36
+ ...o
37
+ });
38
+ }
39
+ v.displayName = "Typography";
40
+ //#endregion
41
+ //#region src/components/Subheadline/Subheadline.module.css
42
+ var y = {
43
+ "level-1": "_level-1_1azf3_1",
44
+ "level-2": "_level-2_1azf3_6"
45
+ }, b = t("", {
46
+ variants: { level: {
47
+ 1: y["level-1"],
48
+ 2: y["level-2"]
49
+ } },
50
+ defaultVariants: { level: "1" }
51
+ });
52
+ //#endregion
53
+ //#region src/components/Subheadline/Subheadline.tsx
54
+ function x({ ref: e, level: t, Component: r = "h6", className: i, ...a }) {
55
+ return /* @__PURE__ */ n(v, {
56
+ ref: e,
57
+ Component: r,
58
+ className: h(b({ level: t }), i),
59
+ ...a
60
+ });
61
+ }
62
+ x.displayName = "Subheadline";
63
+ //#endregion
64
+ //#region src/components/TguiProvider/context.ts
65
+ var S = o(null);
66
+ S.displayName = "TguiContext";
67
+ //#endregion
68
+ //#region src/components/TguiProvider/useTgui.ts
69
+ function C() {
70
+ let e = l(S);
71
+ if (e === null) throw Error("useTgui must be used within a <TguiProvider>.");
72
+ return e;
73
+ }
74
+ var ee = {
75
+ ripple: "_ripple_1cc3x_1",
76
+ wave: "_wave_1cc3x_9",
77
+ "wave-rise": "_wave-rise_1cc3x_1"
78
+ };
79
+ //#endregion
80
+ //#region src/components/Tappable/Ripple.tsx
81
+ function te({ waves: e, onWaveEnd: t }) {
82
+ return /* @__PURE__ */ n("span", {
83
+ "aria-hidden": !0,
84
+ className: ee.ripple,
85
+ children: e.map((e) => /* @__PURE__ */ n("span", {
86
+ className: ee.wave,
87
+ style: {
88
+ top: e.y,
89
+ left: e.x
90
+ },
91
+ onAnimationEnd: () => t(e.id)
92
+ }, e.id))
93
+ });
94
+ }
95
+ var w = {
96
+ tappable: "_tappable_10au7_1",
97
+ "tappable--ios": "_tappable--ios_10au7_17",
98
+ "tappable--opacity": "_tappable--opacity_10au7_18"
99
+ }, ne = 70, re = 600;
100
+ function ie() {
101
+ let [e, t] = p([]), n = f(0), r = f(/* @__PURE__ */ new Map()), i = f(/* @__PURE__ */ new Set());
102
+ u(() => {
103
+ let e = r.current, t = i.current;
104
+ return () => {
105
+ for (let t of e.values()) clearTimeout(t);
106
+ for (let e of t) clearTimeout(e);
107
+ };
108
+ }, []);
109
+ let a = c((e) => {
110
+ t((t) => t.filter((t) => t.id !== e));
111
+ }, []);
112
+ return {
113
+ waves: e,
114
+ onPointerDown: c((e) => {
115
+ let { top: o, left: s } = e.currentTarget.getBoundingClientRect(), c = e.clientX - s, l = e.clientY - o, { pointerId: u } = e, d = setTimeout(() => {
116
+ r.current.delete(u);
117
+ let e = n.current++;
118
+ t((t) => [...t, {
119
+ id: e,
120
+ x: c,
121
+ y: l
122
+ }]);
123
+ let o = setTimeout(() => {
124
+ i.current.delete(o), a(e);
125
+ }, re);
126
+ i.current.add(o);
127
+ }, ne);
128
+ r.current.set(u, d);
129
+ }, [a]),
130
+ onPointerCancel: c((e) => {
131
+ let t = r.current.get(e.pointerId);
132
+ t && (clearTimeout(t), r.current.delete(e.pointerId));
133
+ }, []),
134
+ removeWave: a
135
+ };
136
+ }
137
+ //#endregion
138
+ //#region src/components/Tappable/Tappable.tsx
139
+ function T({ ref: e, Component: t = "div", interactiveAnimation: i = "background", className: a, children: o, onPointerDown: s, onPointerCancel: c, ...l }) {
140
+ let { platform: u } = C(), d = ie(), f = !!l.disabled, p = !!l.readOnly, m = u === "base" && i === "background" && !p && !f && (t !== "div" && t !== "span" || l.onClick != null);
141
+ return /* @__PURE__ */ r(t, {
142
+ ref: e,
143
+ className: h(w.tappable, u === "ios" && w["tappable--ios"], i === "opacity" && w["tappable--opacity"], a),
144
+ "data-readonly": p || void 0,
145
+ "data-disabled": f || void 0,
146
+ "aria-disabled": f || void 0,
147
+ onPointerDown: (e) => {
148
+ m && d.onPointerDown(e), s?.(e);
149
+ },
150
+ onPointerCancel: (e) => {
151
+ m && d.onPointerCancel(e), c?.(e);
152
+ },
153
+ ...l,
154
+ children: [m && /* @__PURE__ */ n(te, {
155
+ waves: d.waves,
156
+ onWaveEnd: d.removeWave
157
+ }), o]
158
+ });
159
+ }
160
+ T.displayName = "Tappable";
161
+ var ae = { text: "_text_5v0x0_1" };
162
+ //#endregion
163
+ //#region src/components/Text/Text.tsx
164
+ function E({ ref: e, className: t, Component: r = "span", ...i }) {
165
+ return /* @__PURE__ */ n(v, {
166
+ ref: e,
167
+ Component: r,
168
+ className: h(ae.text, t),
169
+ ...i
170
+ });
171
+ }
172
+ E.displayName = "Text";
173
+ //#endregion
174
+ //#region src/shared/lib/telegram.ts
175
+ function D() {
176
+ if (!(typeof window > "u")) return window.Telegram?.WebApp;
177
+ }
178
+ //#endregion
179
+ //#region src/shared/lib/appearance.ts
180
+ var O = "(prefers-color-scheme: dark)";
181
+ function oe() {
182
+ return typeof window < "u" && typeof window.matchMedia == "function";
183
+ }
184
+ function se() {
185
+ let e = D();
186
+ return e ? e.colorScheme === "dark" ? "dark" : "light" : oe() && window.matchMedia(O).matches ? "dark" : "light";
187
+ }
188
+ function ce(e) {
189
+ let t = D();
190
+ if (t) return t.onEvent("themeChanged", e), () => t.offEvent("themeChanged", e);
191
+ if (!oe()) return () => {};
192
+ let n = window.matchMedia(O);
193
+ return n.addEventListener("change", e), () => n.removeEventListener("change", e);
194
+ }
195
+ //#endregion
196
+ //#region src/shared/lib/platform.ts
197
+ var le = /* @__PURE__ */ new Set(["ios", "macos"]);
198
+ function ue() {
199
+ let e = D();
200
+ if (e) return le.has(e.platform) ? "ios" : "base";
201
+ if (typeof navigator > "u") return "base";
202
+ let t = navigator.userAgent, n = t.includes("Macintosh") && navigator.maxTouchPoints > 1;
203
+ return /iphone|ipad|ipod/i.test(t) || n ? "ios" : "base";
204
+ }
205
+ var k = {
206
+ wrapper: "_wrapper_1jphr_1",
207
+ "wrapper--ios": "_wrapper--ios_1jphr_89",
208
+ "wrapper--dark": "_wrapper--dark_1jphr_102"
209
+ }, de = () => "light";
210
+ function fe({ ref: e, platform: t, appearance: r, portalContainer: i, className: a, children: o, ...s }) {
211
+ let l = d(() => t ?? ue(), [t]), u = m(ce, se, de), f = r ?? u, [g, _] = p(null), v = c((t) => {
212
+ _(t), typeof e == "function" ? e(t) : e && (e.current = t);
213
+ }, [e]), y = d(() => ({
214
+ platform: l,
215
+ appearance: f,
216
+ portalContainer: i ?? g
217
+ }), [
218
+ l,
219
+ f,
220
+ i,
221
+ g
222
+ ]);
223
+ return /* @__PURE__ */ n("div", {
224
+ ref: v,
225
+ className: h(k.wrapper, l === "ios" && k["wrapper--ios"], f === "dark" && k["wrapper--dark"], a),
226
+ ...s,
227
+ children: /* @__PURE__ */ n(S.Provider, {
228
+ value: y,
229
+ children: o
230
+ })
231
+ });
232
+ }
233
+ fe.displayName = "TguiProvider";
234
+ var A = {
235
+ button: "_button_17mwm_1",
236
+ stretched: "_stretched_17mwm_13",
237
+ before: "_before_17mwm_33",
238
+ after: "_after_17mwm_34",
239
+ content: "_content_17mwm_40",
240
+ label: "_label_17mwm_49",
241
+ loading: "_loading_17mwm_60",
242
+ spinner: "_spinner_17mwm_70",
243
+ "button-spinner": "_button-spinner_17mwm_1",
244
+ "size-s": "_size-s_17mwm_93",
245
+ "size-m": "_size-m_17mwm_101",
246
+ "size-l": "_size-l_17mwm_108",
247
+ ios: "_ios_17mwm_114",
248
+ "mode-filled": "_mode-filled_17mwm_122",
249
+ "mode-bezeled": "_mode-bezeled_17mwm_129",
250
+ "mode-plain": "_mode-plain_17mwm_136",
251
+ "mode-gray": "_mode-gray_17mwm_143",
252
+ "mode-outline": "_mode-outline_17mwm_150",
253
+ "mode-white": "_mode-white_17mwm_158"
254
+ }, pe = t(A.button, {
255
+ variants: {
256
+ mode: {
257
+ filled: A["mode-filled"],
258
+ bezeled: A["mode-bezeled"],
259
+ plain: A["mode-plain"],
260
+ gray: A["mode-gray"],
261
+ outline: A["mode-outline"],
262
+ white: A["mode-white"]
263
+ },
264
+ size: {
265
+ s: A["size-s"],
266
+ m: A["size-m"],
267
+ l: A["size-l"]
268
+ },
269
+ stretched: { true: A.stretched },
270
+ platform: {
271
+ ios: A.ios,
272
+ base: null
273
+ }
274
+ },
275
+ defaultVariants: {
276
+ mode: "filled",
277
+ size: "m"
278
+ }
279
+ });
280
+ //#endregion
281
+ //#region src/components/Button/Button.tsx
282
+ function me({ size: e, children: t }) {
283
+ let r = {
284
+ weight: "2",
285
+ className: A.content
286
+ }, i = /* @__PURE__ */ n("span", {
287
+ className: A.label,
288
+ children: t
289
+ });
290
+ return e === "l" ? /* @__PURE__ */ n(E, {
291
+ ...r,
292
+ children: i
293
+ }) : /* @__PURE__ */ n(x, {
294
+ level: "2",
295
+ ...r,
296
+ children: i
297
+ });
298
+ }
299
+ function he({ ref: e, Component: t = "button", mode: i = "filled", size: a = "m", stretched: o = !1, loading: s = !1, type: c, before: l, after: u, children: d, className: f, ...p }) {
300
+ let { platform: m } = C();
301
+ return /* @__PURE__ */ r(T, {
302
+ ref: e,
303
+ Component: t,
304
+ type: t === "button" ? c ?? "button" : c,
305
+ "aria-busy": s || void 0,
306
+ className: h(pe({
307
+ mode: i,
308
+ size: a,
309
+ stretched: o,
310
+ platform: m
311
+ }), s && A.loading, f),
312
+ ...p,
313
+ children: [
314
+ s ? /* @__PURE__ */ n("span", {
315
+ className: A.spinner,
316
+ "aria-hidden": !0
317
+ }) : null,
318
+ l ? /* @__PURE__ */ n("span", {
319
+ className: A.before,
320
+ children: l
321
+ }) : null,
322
+ /* @__PURE__ */ n(me, {
323
+ size: a,
324
+ children: d
325
+ }),
326
+ u ? /* @__PURE__ */ n("span", {
327
+ className: A.after,
328
+ children: u
329
+ }) : null
330
+ ]
331
+ });
332
+ }
333
+ he.displayName = "Button";
334
+ //#endregion
335
+ //#region src/components/Caption/Caption.module.css
336
+ var ge = {
337
+ "level-1": "_level-1_1fkm7_1",
338
+ "level-2": "_level-2_1fkm7_6"
339
+ }, _e = t("", {
340
+ variants: { level: {
341
+ 1: ge["level-1"],
342
+ 2: ge["level-2"]
343
+ } },
344
+ defaultVariants: { level: "1" }
345
+ });
346
+ //#endregion
347
+ //#region src/components/Caption/Caption.tsx
348
+ function j({ ref: e, level: t, Component: r = "span", className: i, ...a }) {
349
+ return /* @__PURE__ */ n(v, {
350
+ ref: e,
351
+ Component: r,
352
+ className: h(_e({ level: t }), i),
353
+ ...a
354
+ });
355
+ }
356
+ j.displayName = "Caption";
357
+ //#endregion
358
+ //#region src/components/Card/Card.context.ts
359
+ var M = o({ type: "plain" }), N = {
360
+ card: "_card_tdyqh_1",
361
+ cardAmbient: "_cardAmbient_tdyqh_17",
362
+ cell: "_cell_tdyqh_21",
363
+ cellAmbient: "_cellAmbient_tdyqh_26",
364
+ cellHeader: "_cellHeader_tdyqh_43",
365
+ cellSubtitle: "_cellSubtitle_tdyqh_47"
366
+ }, P = {
367
+ cell: "_cell_1w7p5_1",
368
+ before: "_before_1w7p5_10",
369
+ after: "_after_1w7p5_11",
370
+ middle: "_middle_1w7p5_17",
371
+ title: "_title_1w7p5_29",
372
+ multiline: "_multiline_1w7p5_35",
373
+ head: "_head_1w7p5_40",
374
+ subhead: "_subhead_1w7p5_46",
375
+ hint: "_hint_1w7p5_50",
376
+ subtitle: "_subtitle_1w7p5_51",
377
+ description: "_description_1w7p5_52",
378
+ hovered: "_hovered_1w7p5_56",
379
+ ios: "_ios_1w7p5_60",
380
+ interactive: "_interactive_1w7p5_67"
381
+ }, ve = t(P.cell, { variants: {
382
+ platform: {
383
+ ios: P.ios,
384
+ base: null
385
+ },
386
+ hovered: { true: P.hovered },
387
+ interactive: { true: P.interactive },
388
+ multiline: { true: P.multiline }
389
+ } });
390
+ //#endregion
391
+ //#region src/components/Cell/Cell.tsx
392
+ function ye({ ios: e, children: t }) {
393
+ return e ? /* @__PURE__ */ n(E, {
394
+ className: P.head,
395
+ children: t
396
+ }) : /* @__PURE__ */ n(x, {
397
+ level: "1",
398
+ className: P.head,
399
+ children: t
400
+ });
401
+ }
402
+ function be({ ios: e, children: t }) {
403
+ return e ? /* @__PURE__ */ n(j, {
404
+ className: P.description,
405
+ children: t
406
+ }) : /* @__PURE__ */ n(x, {
407
+ level: "2",
408
+ className: P.description,
409
+ children: t
410
+ });
411
+ }
412
+ function F({ ref: e, Component: t = "div", subhead: i, children: a, hint: o, titleBadge: s, subtitle: c, description: l, before: u, after: d, hovered: f, multiline: p, className: m, ...g }) {
413
+ let { platform: _ } = C(), v = _ === "ios", y = a != null || o != null || s != null, b = g.onClick != null || g.href != null || t === "a" || t === "button" || t === "label";
414
+ return /* @__PURE__ */ r(T, {
415
+ ref: e,
416
+ Component: t,
417
+ className: h(ve({
418
+ platform: _,
419
+ hovered: f,
420
+ multiline: p,
421
+ interactive: b
422
+ }), m),
423
+ ...g,
424
+ children: [
425
+ u == null ? null : /* @__PURE__ */ n("div", {
426
+ className: P.before,
427
+ children: u
428
+ }),
429
+ /* @__PURE__ */ r("div", {
430
+ className: P.middle,
431
+ children: [
432
+ i == null ? null : /* @__PURE__ */ n(x, {
433
+ level: "2",
434
+ className: P.subhead,
435
+ children: i
436
+ }),
437
+ y ? /* @__PURE__ */ r(ye, {
438
+ ios: v,
439
+ children: [
440
+ a == null ? null : /* @__PURE__ */ n("span", {
441
+ className: P.title,
442
+ children: a
443
+ }),
444
+ o == null ? null : /* @__PURE__ */ n("span", {
445
+ className: P.hint,
446
+ children: o
447
+ }),
448
+ s
449
+ ]
450
+ }) : null,
451
+ c == null ? null : /* @__PURE__ */ n(x, {
452
+ level: "2",
453
+ className: P.subtitle,
454
+ children: c
455
+ }),
456
+ l == null ? null : /* @__PURE__ */ n(be, {
457
+ ios: v,
458
+ children: l
459
+ })
460
+ ]
461
+ }),
462
+ d == null ? null : /* @__PURE__ */ n("div", {
463
+ className: P.after,
464
+ children: d
465
+ })
466
+ ]
467
+ });
468
+ }
469
+ F.displayName = "Cell";
470
+ //#endregion
471
+ //#region src/components/Card/CardCell.tsx
472
+ function I({ ref: e, children: t, subtitle: r, className: i, ...a }) {
473
+ let { type: o } = l(M), s = o === "ambient";
474
+ return /* @__PURE__ */ n(F, {
475
+ ref: e,
476
+ className: h(N.cell, s && N.cellAmbient, i),
477
+ subtitle: r == null ? void 0 : /* @__PURE__ */ n("span", {
478
+ className: N.cellSubtitle,
479
+ children: r
480
+ }),
481
+ ...a,
482
+ children: t == null ? null : /* @__PURE__ */ n("span", {
483
+ className: N.cellHeader,
484
+ children: t
485
+ })
486
+ });
487
+ }
488
+ I.displayName = "CardCell";
489
+ //#endregion
490
+ //#region src/components/Card/Card.tsx
491
+ function L({ ref: e, type: t = "plain", className: r, children: i, ...a }) {
492
+ let o = d(() => ({ type: t }), [t]);
493
+ return /* @__PURE__ */ n(M.Provider, {
494
+ value: o,
495
+ children: /* @__PURE__ */ n("article", {
496
+ ref: e,
497
+ className: h(N.card, t === "ambient" && N.cardAmbient, r),
498
+ ...a,
499
+ children: i
500
+ })
501
+ });
502
+ }
503
+ L.displayName = "Card", L.Cell = I;
504
+ var R = {
505
+ checkbox: "_checkbox_3wbt9_1",
506
+ input: "_input_3wbt9_12",
507
+ box: "_box_3wbt9_22"
508
+ };
509
+ //#endregion
510
+ //#region src/components/Checkbox/Checkbox.tsx
511
+ function xe({ ref: e, indeterminate: t = !1, disabled: i, className: a, style: o, ...s }) {
512
+ let c = f(null);
513
+ return u(() => {
514
+ c.current && (c.current.indeterminate = t);
515
+ }, [t]), /* @__PURE__ */ r("span", {
516
+ className: h(R.checkbox, a),
517
+ style: o,
518
+ "data-disabled": i || void 0,
519
+ children: [/* @__PURE__ */ n("input", {
520
+ ref: (t) => {
521
+ c.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
522
+ },
523
+ type: "checkbox",
524
+ className: R.input,
525
+ disabled: i,
526
+ ...s
527
+ }), /* @__PURE__ */ n("span", {
528
+ className: R.box,
529
+ "aria-hidden": !0
530
+ })]
531
+ });
532
+ }
533
+ xe.displayName = "Checkbox";
534
+ var Se = { divider: "_divider_fq1ux_1" };
535
+ //#endregion
536
+ //#region src/components/Divider/Divider.tsx
537
+ function z({ ref: e, className: t, ...r }) {
538
+ return /* @__PURE__ */ n("hr", {
539
+ ref: e,
540
+ className: h(Se.divider, t),
541
+ ...r
542
+ });
543
+ }
544
+ z.displayName = "Divider";
545
+ var Ce = { headline: "_headline_17ihj_1" };
546
+ //#endregion
547
+ //#region src/components/Headline/Headline.tsx
548
+ function we({ ref: e, weight: t = "2", className: r, Component: i = "h5", ...a }) {
549
+ return /* @__PURE__ */ n(v, {
550
+ ref: e,
551
+ weight: t,
552
+ Component: i,
553
+ className: h(Ce.headline, r),
554
+ ...a
555
+ });
556
+ }
557
+ we.displayName = "Headline";
558
+ var B = {
559
+ base: "_base_ja3pv_1",
560
+ body: "_body_ja3pv_7",
561
+ ios: "_ios_ja3pv_23",
562
+ before: "_before_ja3pv_29",
563
+ after: "_after_ja3pv_30",
564
+ field: "_field_ja3pv_35",
565
+ header: "_header_ja3pv_56",
566
+ focused: "_focused_ja3pv_70",
567
+ error: "_error_ja3pv_78",
568
+ disabled: "_disabled_ja3pv_90"
569
+ };
570
+ //#endregion
571
+ //#region src/components/Input/Input.tsx
572
+ function Te({ ref: e, type: t = "text", header: i, before: a, after: o, status: s, disabled: c, className: l, onFocus: u, onBlur: d, ...f }) {
573
+ let { platform: m } = C(), g = m === "ios", [_, v] = p(!1), y = s ?? (_ ? "focused" : "default"), b = g ? E : x;
574
+ return /* @__PURE__ */ r("div", {
575
+ className: h(g ? B.ios : B.base, y === "error" && B.error, y === "focused" && B.focused, c && B.disabled, l),
576
+ "aria-disabled": c || void 0,
577
+ children: [/* @__PURE__ */ r("label", {
578
+ className: B.body,
579
+ children: [
580
+ a == null ? null : /* @__PURE__ */ n("span", {
581
+ className: B.before,
582
+ children: a
583
+ }),
584
+ /* @__PURE__ */ n(b, {
585
+ ref: e,
586
+ Component: "input",
587
+ className: B.field,
588
+ type: t,
589
+ disabled: c,
590
+ onFocus: (e) => {
591
+ c || v(!0), u?.(e);
592
+ },
593
+ onBlur: (e) => {
594
+ v(!1), d?.(e);
595
+ },
596
+ ...f
597
+ }),
598
+ o == null ? null : /* @__PURE__ */ n("span", {
599
+ className: B.after,
600
+ children: o
601
+ })
602
+ ]
603
+ }), i != null && !g ? /* @__PURE__ */ n("span", {
604
+ className: B.header,
605
+ children: i
606
+ }) : null]
607
+ });
608
+ }
609
+ Te.displayName = "Input";
610
+ //#endregion
611
+ //#region src/components/LargeTitle/LargeTitle.module.css
612
+ var Ee = { "large-title": "_large-title_15hug_1" };
613
+ //#endregion
614
+ //#region src/components/LargeTitle/LargeTitle.tsx
615
+ function De({ ref: e, weight: t = "1", className: r, Component: i = "h1", ...a }) {
616
+ return /* @__PURE__ */ n(v, {
617
+ ref: e,
618
+ weight: t,
619
+ Component: i,
620
+ className: h(Ee["large-title"], r),
621
+ ...a
622
+ });
623
+ }
624
+ De.displayName = "LargeTitle";
625
+ var Oe = {
626
+ list: "_list_1rhgw_1",
627
+ ios: "_ios_1rhgw_5"
628
+ };
629
+ //#endregion
630
+ //#region src/components/List/List.tsx
631
+ function ke({ ref: e, Component: t = "div", className: r, children: i, ...a }) {
632
+ let { platform: o } = C();
633
+ return /* @__PURE__ */ n(t, {
634
+ ref: e,
635
+ className: h(Oe.list, o === "ios" && Oe.ios, r),
636
+ ...a,
637
+ children: i
638
+ });
639
+ }
640
+ ke.displayName = "List";
641
+ //#endregion
642
+ //#region src/components/Title/Title.module.css
643
+ var V = {
644
+ "level-1": "_level-1_rosk9_1",
645
+ "level-2": "_level-2_rosk9_6",
646
+ "level-3": "_level-3_rosk9_11"
647
+ }, Ae = {
648
+ 1: {
649
+ tag: "h2",
650
+ className: V["level-1"]
651
+ },
652
+ 2: {
653
+ tag: "h3",
654
+ className: V["level-2"]
655
+ },
656
+ 3: {
657
+ tag: "h4",
658
+ className: V["level-3"]
659
+ }
660
+ };
661
+ //#endregion
662
+ //#region src/components/Title/Title.tsx
663
+ function H({ ref: e, level: t = "2", Component: r, className: i, ...a }) {
664
+ let { tag: o, className: s } = Ae[t];
665
+ return /* @__PURE__ */ n(v, {
666
+ ref: e,
667
+ Component: r ?? o,
668
+ className: h(s, i),
669
+ ...a
670
+ });
671
+ }
672
+ H.displayName = "Title";
673
+ var U = {
674
+ placeholder: "_placeholder_4t5fq_1",
675
+ fields: "_fields_4t5fq_13",
676
+ description: "_description_4t5fq_19"
677
+ };
678
+ //#endregion
679
+ //#region src/components/Placeholder/Placeholder.tsx
680
+ function je({ ref: e, children: t, header: i, description: a, action: o, className: s, ...c }) {
681
+ return /* @__PURE__ */ r("section", {
682
+ ref: e,
683
+ className: h(U.placeholder, s),
684
+ ...c,
685
+ children: [
686
+ t,
687
+ i != null || a != null ? /* @__PURE__ */ r("dl", {
688
+ className: U.fields,
689
+ children: [i == null ? null : /* @__PURE__ */ n(H, {
690
+ Component: "dt",
691
+ level: "3",
692
+ weight: "2",
693
+ children: i
694
+ }), a == null ? null : /* @__PURE__ */ n(E, {
695
+ Component: "dd",
696
+ className: U.description,
697
+ children: a
698
+ })]
699
+ }) : null,
700
+ o
701
+ ]
702
+ });
703
+ }
704
+ je.displayName = "Placeholder";
705
+ var W = {
706
+ body: "_body_1o4ef_1",
707
+ sectionBase: "_sectionBase_1o4ef_6",
708
+ bodyWithHeader: "_bodyWithHeader_1o4ef_6",
709
+ sectionIos: "_sectionIos_1o4ef_11",
710
+ header: "_header_1o4ef_28",
711
+ headerLarge: "_headerLarge_1o4ef_33",
712
+ headerIos: "_headerIos_1o4ef_38",
713
+ footer: "_footer_1o4ef_48",
714
+ footerIos: "_footerIos_1o4ef_52",
715
+ footerCentered: "_footerCentered_1o4ef_56",
716
+ footerText: "_footerText_1o4ef_65"
717
+ };
718
+ //#endregion
719
+ //#region src/components/Section/SectionFooter.tsx
720
+ function Me({ ios: e, children: t }) {
721
+ return e ? /* @__PURE__ */ n(j, {
722
+ className: W.footerText,
723
+ children: t
724
+ }) : /* @__PURE__ */ n(x, {
725
+ level: "2",
726
+ className: W.footerText,
727
+ children: t
728
+ });
729
+ }
730
+ function G({ ref: e, centered: t = !1, className: r, children: i, ...a }) {
731
+ let { platform: o } = C(), s = o === "ios";
732
+ return /* @__PURE__ */ n("footer", {
733
+ ref: e,
734
+ className: h(W.footer, s && W.footerIos, t && W.footerCentered, r),
735
+ ...a,
736
+ children: /* @__PURE__ */ n(Me, {
737
+ ios: s,
738
+ children: i
739
+ })
740
+ });
741
+ }
742
+ G.displayName = "SectionFooter";
743
+ //#endregion
744
+ //#region src/components/Section/SectionHeader.tsx
745
+ function Ne({ ios: e, large: t, children: r }) {
746
+ return t ? e ? /* @__PURE__ */ n(x, {
747
+ Component: "h2",
748
+ level: "1",
749
+ weight: "2",
750
+ children: r
751
+ }) : /* @__PURE__ */ n(E, {
752
+ Component: "h2",
753
+ weight: "2",
754
+ children: r
755
+ }) : e ? /* @__PURE__ */ n(j, {
756
+ Component: "h2",
757
+ caps: !0,
758
+ children: r
759
+ }) : /* @__PURE__ */ n(x, {
760
+ Component: "h2",
761
+ level: "2",
762
+ weight: "2",
763
+ children: r
764
+ });
765
+ }
766
+ function K({ ref: e, large: t = !1, className: r, children: i, ...a }) {
767
+ let { platform: o } = C(), s = o === "ios";
768
+ return /* @__PURE__ */ n("header", {
769
+ ref: e,
770
+ className: h(W.header, s && W.headerIos, t && W.headerLarge, r),
771
+ ...a,
772
+ children: /* @__PURE__ */ n(Ne, {
773
+ ios: s,
774
+ large: t,
775
+ children: i
776
+ })
777
+ });
778
+ }
779
+ K.displayName = "SectionHeader";
780
+ //#endregion
781
+ //#region src/components/Section/Section.tsx
782
+ var q = (e) => typeof e == "string" || typeof e == "number";
783
+ function J({ ref: e, header: t, footer: o, className: c, children: l, ...u }) {
784
+ let { platform: d } = C(), f = i.toArray(l);
785
+ return /* @__PURE__ */ r("section", {
786
+ ref: e,
787
+ className: h(d === "ios" ? W.sectionIos : W.sectionBase, c),
788
+ ...u,
789
+ children: [/* @__PURE__ */ r("div", {
790
+ className: W.bodyWithHeader,
791
+ children: [q(t) ? /* @__PURE__ */ n(K, { children: t }) : t, /* @__PURE__ */ n("div", {
792
+ className: W.body,
793
+ children: f.map((e, t) => /* @__PURE__ */ r(a, { children: [e, t < f.length - 1 ? /* @__PURE__ */ n(z, {}) : null] }, s(e) ? e.key : t))
794
+ })]
795
+ }), q(o) ? /* @__PURE__ */ n(G, { children: o }) : o]
796
+ });
797
+ }
798
+ J.displayName = "Section", J.Header = K, J.Footer = G;
799
+ var Y = {
800
+ base: "_base_9dgop_1",
801
+ row: "_row_9dgop_7",
802
+ ios: "_ios_9dgop_14",
803
+ select: "_select_9dgop_19",
804
+ chevron: "_chevron_9dgop_33",
805
+ header: "_header_9dgop_45",
806
+ focused: "_focused_9dgop_59",
807
+ error: "_error_9dgop_67",
808
+ disabled: "_disabled_9dgop_79"
809
+ };
810
+ //#endregion
811
+ //#region src/components/Select/Select.tsx
812
+ function Pe({ ref: e, header: t, status: i, disabled: a, className: o, onFocus: s, onBlur: c, children: l, ...u }) {
813
+ let { platform: d } = C(), f = d === "ios", [m, g] = p(!1), _ = i ?? (m ? "focused" : "default"), v = f ? E : x;
814
+ return /* @__PURE__ */ r("div", {
815
+ className: h(f ? Y.ios : Y.base, _ === "error" && Y.error, _ === "focused" && Y.focused, a && Y.disabled, o),
816
+ "aria-disabled": a || void 0,
817
+ children: [/* @__PURE__ */ r("div", {
818
+ className: Y.row,
819
+ children: [/* @__PURE__ */ n(v, {
820
+ ref: e,
821
+ Component: "select",
822
+ className: Y.select,
823
+ disabled: a,
824
+ onFocus: (e) => {
825
+ a || g(!0), s?.(e);
826
+ },
827
+ onBlur: (e) => {
828
+ g(!1), c?.(e);
829
+ },
830
+ ...u,
831
+ children: l
832
+ }), /* @__PURE__ */ n("span", {
833
+ "aria-hidden": !0,
834
+ className: Y.chevron
835
+ })]
836
+ }), t != null && !f ? /* @__PURE__ */ n("span", {
837
+ className: Y.header,
838
+ children: t
839
+ }) : null]
840
+ });
841
+ }
842
+ Pe.displayName = "Select";
843
+ var X = {
844
+ switch: "_switch_s4zd1_1",
845
+ input: "_input_s4zd1_18",
846
+ control: "_control_s4zd1_28",
847
+ base: "_base_s4zd1_35",
848
+ ios: "_ios_s4zd1_55"
849
+ };
850
+ //#endregion
851
+ //#region src/components/Switch/Switch.tsx
852
+ function Fe({ ref: e, disabled: t, className: i, style: a, ...o }) {
853
+ let { platform: s } = C();
854
+ return /* @__PURE__ */ r("label", {
855
+ className: h(X.switch, s === "ios" ? X.ios : X.base, i),
856
+ style: a,
857
+ "data-disabled": t || void 0,
858
+ children: [/* @__PURE__ */ n("input", {
859
+ ref: e,
860
+ type: "checkbox",
861
+ className: X.input,
862
+ disabled: t,
863
+ ...o
864
+ }), /* @__PURE__ */ n("span", {
865
+ "aria-hidden": !0,
866
+ className: X.control
867
+ })]
868
+ });
869
+ }
870
+ Fe.displayName = "Switch";
871
+ var Z = {
872
+ bar: "_bar_y3gvr_1",
873
+ barIos: "_barIos_y3gvr_10",
874
+ item: "_item_y3gvr_15",
875
+ itemIos: "_itemIos_y3gvr_34",
876
+ itemSelected: "_itemSelected_y3gvr_39",
877
+ icon: "_icon_y3gvr_43",
878
+ text: "_text_y3gvr_64"
879
+ };
880
+ //#endregion
881
+ //#region src/components/TabBar/TabBarItem.tsx
882
+ function Q({ ref: e, selected: t, text: i, children: a, className: o, ...s }) {
883
+ let { platform: c } = C(), l = c === "ios";
884
+ return /* @__PURE__ */ r(T, {
885
+ ref: e,
886
+ Component: "button",
887
+ interactiveAnimation: "opacity",
888
+ "aria-current": t ? "page" : void 0,
889
+ className: h(Z.item, l && Z.itemIos, t && Z.itemSelected, o),
890
+ ...s,
891
+ children: [a == null ? null : /* @__PURE__ */ n("span", {
892
+ className: Z.icon,
893
+ children: a
894
+ }), i == null ? null : /* @__PURE__ */ n(j, {
895
+ className: Z.text,
896
+ weight: "2",
897
+ level: l ? "2" : "1",
898
+ children: i
899
+ })]
900
+ });
901
+ }
902
+ Q.displayName = "TabBarItem";
903
+ //#endregion
904
+ //#region src/components/TabBar/TabBar.tsx
905
+ function $({ ref: e, className: t, children: r, ...i }) {
906
+ let { platform: a } = C();
907
+ return /* @__PURE__ */ n("nav", {
908
+ ref: e,
909
+ className: h(Z.bar, a === "ios" && Z.barIos, t),
910
+ ...i,
911
+ children: r
912
+ });
913
+ }
914
+ $.displayName = "TabBar", $.Item = Q;
915
+ //#endregion
916
+ export { he as Button, j as Caption, L as Card, I as CardCell, F as Cell, xe as Checkbox, z as Divider, we as Headline, Te as Input, De as LargeTitle, ke as List, je as Placeholder, J as Section, G as SectionFooter, K as SectionHeader, Pe as Select, x as Subheadline, Fe as Switch, $ as TabBar, Q as TabBarItem, T as Tappable, E as Text, fe as TguiProvider, H as Title, v as Typography, C as useTgui };
917
+
918
+ //# sourceMappingURL=index.js.map