tintora 0.25.0 → 0.27.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 CHANGED
@@ -110,8 +110,85 @@ function g({ name: t, src: n, size: r = "medium", className: i, ...a }) {
110
110
  });
111
111
  }
112
112
  //#endregion
113
+ //#region src/utils/outside.ts
114
+ function _(e, t) {
115
+ if (e.target !== e.currentTarget) return;
116
+ let { left: n, right: r, top: i, bottom: a } = e.currentTarget.getBoundingClientRect();
117
+ (e.clientX < n || e.clientX > r || e.clientY < i || e.clientY > a) && t();
118
+ }
119
+ //#endregion
120
+ //#region src/Drawer/Drawer.tsx
121
+ var v = (e) => typeof e == "number" ? `${e}px` : e;
122
+ function y({ open: t, from: n = "right", width: r, height: i, children: o, onClose: s, className: l, ...u }) {
123
+ let f = c(null);
124
+ a(() => {
125
+ let e = f.current;
126
+ e && (t && !e.open ? (e.showModal(), e.querySelector("[data-autofocus]")?.focus()) : !t && e.open && e.close());
127
+ }, [t]);
128
+ let p = {
129
+ ...u.style,
130
+ ...r !== void 0 && { "--tintora-drawer-width": v(r) },
131
+ ...i !== void 0 && { "--tintora-drawer-height": v(i) }
132
+ };
133
+ return /* @__PURE__ */ e("dialog", {
134
+ ...u,
135
+ ref: f,
136
+ className: d("tintora-drawer", `tintora-drawer--from-${n}`, l),
137
+ onCancel: (e) => {
138
+ e.preventDefault(), s();
139
+ },
140
+ onClick: (e) => _(e, s),
141
+ style: p,
142
+ children: o
143
+ });
144
+ }
145
+ //#endregion
146
+ //#region src/BottomSheet/BottomSheet.tsx
147
+ function b({ title: n, children: r, className: i, ...a }) {
148
+ let s = o();
149
+ return /* @__PURE__ */ t(y, {
150
+ ...a,
151
+ from: "bottom",
152
+ "aria-labelledby": s,
153
+ className: d("tintora-bottom-sheet", i),
154
+ children: [
155
+ /* @__PURE__ */ e("span", {
156
+ className: "tintora-bottom-sheet__grabber",
157
+ "aria-hidden": "true"
158
+ }),
159
+ /* @__PURE__ */ e("div", {
160
+ id: s,
161
+ className: "tintora-bottom-sheet__title",
162
+ children: n
163
+ }),
164
+ r
165
+ ]
166
+ });
167
+ }
168
+ function x({ selected: n = !1, className: r, children: i, ...a }) {
169
+ return /* @__PURE__ */ t("button", {
170
+ type: "button",
171
+ ...a,
172
+ "aria-pressed": n,
173
+ className: d("tintora-bottom-sheet__option", r),
174
+ children: [/* @__PURE__ */ e("span", { children: i }), /* @__PURE__ */ e("svg", {
175
+ className: "tintora-bottom-sheet__check",
176
+ width: "18",
177
+ height: "18",
178
+ viewBox: "0 0 24 24",
179
+ fill: "none",
180
+ stroke: "currentColor",
181
+ strokeWidth: "2.4",
182
+ strokeLinecap: "round",
183
+ strokeLinejoin: "round",
184
+ "aria-hidden": "true",
185
+ children: /* @__PURE__ */ e("path", { d: "M5 12.5l4.5 4.5L19 7.5" })
186
+ })]
187
+ });
188
+ }
189
+ //#endregion
113
190
  //#region src/Spinner/Spinner.tsx
114
- var _ = {
191
+ var S = {
115
192
  small: {
116
193
  width: 16,
117
194
  height: 16,
@@ -128,8 +205,8 @@ var _ = {
128
205
  strokeWidth: 2.4
129
206
  }
130
207
  };
131
- function v({ size: n = "medium", color: r = "accent" }) {
132
- let { width: i, height: a, strokeWidth: o } = _[n];
208
+ function C({ size: n = "medium", color: r = "accent" }) {
209
+ let { width: i, height: a, strokeWidth: o } = S[n];
133
210
  return /* @__PURE__ */ t("svg", {
134
211
  className: "tintora-spinner",
135
212
  width: i,
@@ -155,7 +232,7 @@ function v({ size: n = "medium", color: r = "accent" }) {
155
232
  }
156
233
  //#endregion
157
234
  //#region src/Button/Button.tsx
158
- function y({ children: n, className: r, variant: i, size: a = "medium", leadingIcon: o, trailingIcon: s, type: c = "button", loading: l = !1, disabled: u, ...f }) {
235
+ function w({ children: n, className: r, variant: i, size: a = "medium", leadingIcon: o, trailingIcon: s, type: c = "button", loading: l = !1, disabled: u, ...f }) {
159
236
  return /* @__PURE__ */ t("button", {
160
237
  type: c,
161
238
  className: d("tintora-button", `tintora-button--${i}`, `tintora-button--${a}`, {
@@ -170,7 +247,7 @@ function y({ children: n, className: r, variant: i, size: a = "medium", leadingI
170
247
  l && /* @__PURE__ */ e("span", {
171
248
  className: "tintora-button__icon",
172
249
  "aria-hidden": "true",
173
- children: /* @__PURE__ */ e(v, {
250
+ children: /* @__PURE__ */ e(C, {
174
251
  size: "small",
175
252
  color: "current"
176
253
  })
@@ -191,13 +268,13 @@ function y({ children: n, className: r, variant: i, size: a = "medium", leadingI
191
268
  }
192
269
  //#endregion
193
270
  //#region src/Card/Card.tsx
194
- function b({ as: t = "article", variant: n = "surface", className: r, ...i }) {
271
+ function T({ as: t = "article", variant: n = "surface", className: r, ...i }) {
195
272
  return /* @__PURE__ */ e(t, {
196
273
  ...i,
197
274
  className: d("tintora-card", `tintora-card--${n}`, r)
198
275
  });
199
276
  }
200
- function x({ selected: t = !1, className: n, ...r }) {
277
+ function E({ selected: t = !1, className: n, ...r }) {
201
278
  return /* @__PURE__ */ e("button", {
202
279
  ...r,
203
280
  type: "button",
@@ -207,7 +284,7 @@ function x({ selected: t = !1, className: n, ...r }) {
207
284
  }
208
285
  //#endregion
209
286
  //#region src/hooks/useCheckedState.ts
210
- function S({ checked: e, defaultChecked: t = !1, onCheckedChange: n }) {
287
+ function D({ checked: e, defaultChecked: t = !1, onCheckedChange: n }) {
211
288
  let [r, i] = l(t), a = e !== void 0;
212
289
  return {
213
290
  checked: a ? e : r,
@@ -218,8 +295,8 @@ function S({ checked: e, defaultChecked: t = !1, onCheckedChange: n }) {
218
295
  }
219
296
  //#endregion
220
297
  //#region src/Checkbox/Checkbox.tsx
221
- function C({ checked: n, defaultChecked: r, onCheckedChange: i, indeterminate: a = !1, className: o, ...l }) {
222
- let u = c(null), f = S({
298
+ function O({ checked: n, defaultChecked: r, onCheckedChange: i, indeterminate: a = !1, className: o, ...l }) {
299
+ let u = c(null), f = D({
223
300
  checked: n,
224
301
  defaultChecked: r,
225
302
  onCheckedChange: i
@@ -263,7 +340,7 @@ function C({ checked: n, defaultChecked: r, onCheckedChange: i, indeterminate: a
263
340
  }
264
341
  //#endregion
265
342
  //#region src/Chip/Chip.tsx
266
- function w({ children: t, selected: n, className: r, "aria-pressed": i, ...a }) {
343
+ function k({ children: t, selected: n, className: r, "aria-pressed": i, ...a }) {
267
344
  return /* @__PURE__ */ e("button", {
268
345
  ...a,
269
346
  type: "button",
@@ -274,7 +351,7 @@ function w({ children: t, selected: n, className: r, "aria-pressed": i, ...a })
274
351
  }
275
352
  //#endregion
276
353
  //#region src/Dot/Dot.tsx
277
- function T({ variant: t = "unread", label: n, className: r, ...i }) {
354
+ function A({ variant: t = "unread", label: n, className: r, ...i }) {
278
355
  return /* @__PURE__ */ e("span", {
279
356
  ...i,
280
357
  className: d("tintora-dot", `tintora-dot--${t}`, r),
@@ -284,50 +361,17 @@ function T({ variant: t = "unread", label: n, className: r, ...i }) {
284
361
  });
285
362
  }
286
363
  //#endregion
287
- //#region src/utils/outside.ts
288
- function E(e, t) {
289
- if (e.target !== e.currentTarget) return;
290
- let { left: n, right: r, top: i, bottom: a } = e.currentTarget.getBoundingClientRect();
291
- (e.clientX < n || e.clientX > r || e.clientY < i || e.clientY > a) && t();
292
- }
293
- //#endregion
294
- //#region src/Drawer/Drawer.tsx
295
- var D = (e) => typeof e == "number" ? `${e}px` : e;
296
- function O({ open: t, from: n = "right", width: r, height: i, children: o, onClose: s, className: l, ...u }) {
297
- let f = c(null);
298
- a(() => {
299
- let e = f.current;
300
- e && (t && !e.open ? (e.showModal(), e.querySelector("[data-autofocus]")?.focus()) : !t && e.open && e.close());
301
- }, [t]);
302
- let p = {
303
- ...u.style,
304
- ...r !== void 0 && { "--tintora-drawer-width": D(r) },
305
- ...i !== void 0 && { "--tintora-drawer-height": D(i) }
306
- };
307
- return /* @__PURE__ */ e("dialog", {
308
- ...u,
309
- ref: f,
310
- className: d("tintora-drawer", `tintora-drawer--from-${n}`, l),
311
- onCancel: (e) => {
312
- e.preventDefault(), s();
313
- },
314
- onClick: (e) => E(e, s),
315
- style: p,
316
- children: o
317
- });
318
- }
319
- //#endregion
320
364
  //#region src/IconButton/IconButton.tsx
321
- var k = {
365
+ var j = {
322
366
  round: "secondary",
323
367
  field: "secondary",
324
368
  nav: "ghost"
325
369
  };
326
- function A({ icon: t, variant: n = "round", size: r, selected: i, className: a, ...o }) {
370
+ function M({ icon: t, variant: n = "round", size: r, selected: i, className: a, ...o }) {
327
371
  let s = n === "round" ? r ?? "large" : void 0;
328
- return /* @__PURE__ */ e(y, {
372
+ return /* @__PURE__ */ e(w, {
329
373
  ...o,
330
- variant: k[n],
374
+ variant: j[n],
331
375
  "aria-current": i ? "page" : void 0,
332
376
  className: d("tintora-icon-button", `tintora-icon-button--${n}`, s && `tintora-icon-button--${s}`, a),
333
377
  ...s && { size: s },
@@ -340,7 +384,7 @@ function A({ icon: t, variant: n = "round", size: r, selected: i, className: a,
340
384
  }
341
385
  //#endregion
342
386
  //#region src/Modal/Modal.tsx
343
- var j = () => /* @__PURE__ */ e("svg", {
387
+ var N = () => /* @__PURE__ */ e("svg", {
344
388
  width: "16",
345
389
  height: "16",
346
390
  viewBox: "0 0 24 24",
@@ -350,23 +394,23 @@ var j = () => /* @__PURE__ */ e("svg", {
350
394
  strokeLinecap: "round",
351
395
  children: /* @__PURE__ */ e("path", { d: "M18 6L6 18M6 6l12 12" })
352
396
  });
353
- function M({ open: n, onClose: r, title: i, description: s, icon: l, status: u = "info", actions: f, size: p = "md", align: m = "start", role: h = "dialog", closeButton: g = !0, className: _, children: v, ...y }) {
354
- let b = c(null), x = o(), S = o();
397
+ function P({ open: n, onClose: r, title: i, description: s, icon: l, status: u = "info", actions: f, size: p = "md", align: m = "start", role: h = "dialog", closeButton: g = !0, className: v, children: y, ...b }) {
398
+ let x = c(null), S = o(), C = o();
355
399
  return a(() => {
356
- let e = b.current;
400
+ let e = x.current;
357
401
  e && (n && !e.open ? (e.showModal(), e.querySelector("[data-autofocus]")?.focus()) : !n && e.open && e.close());
358
402
  }, [n]), /* @__PURE__ */ t("dialog", {
359
- ...y,
360
- ref: b,
403
+ ...b,
404
+ ref: x,
361
405
  role: h,
362
- "aria-labelledby": x,
363
- "aria-describedby": s ? S : void 0,
364
- className: d("tintora-modal", `tintora-modal--${p}`, m === "center" && "tintora-modal--center", _),
406
+ "aria-labelledby": S,
407
+ "aria-describedby": s ? C : void 0,
408
+ className: d("tintora-modal", `tintora-modal--${p}`, m === "center" && "tintora-modal--center", v),
365
409
  onCancel: (e) => {
366
410
  e.preventDefault(), r();
367
411
  },
368
412
  onClick: (e) => {
369
- h === "dialog" && E(e, r);
413
+ h === "dialog" && _(e, r);
370
414
  },
371
415
  children: [
372
416
  l && /* @__PURE__ */ e("span", {
@@ -377,23 +421,23 @@ function M({ open: n, onClose: r, title: i, description: s, icon: l, status: u =
377
421
  /* @__PURE__ */ t("div", {
378
422
  className: "tintora-modal__text",
379
423
  children: [/* @__PURE__ */ e("h2", {
380
- id: x,
424
+ id: S,
381
425
  className: "tintora-modal__title",
382
426
  children: i
383
427
  }), s && /* @__PURE__ */ e("p", {
384
- id: S,
428
+ id: C,
385
429
  className: "tintora-modal__description",
386
430
  children: s
387
431
  })]
388
432
  }),
389
- g && /* @__PURE__ */ e(A, {
433
+ g && /* @__PURE__ */ e(M, {
390
434
  className: "tintora-modal__close",
391
435
  size: "medium",
392
436
  "aria-label": "Close",
393
- icon: /* @__PURE__ */ e(j, {}),
437
+ icon: /* @__PURE__ */ e(N, {}),
394
438
  onClick: r
395
439
  }),
396
- v,
440
+ y,
397
441
  f && /* @__PURE__ */ e("div", {
398
442
  className: "tintora-modal__actions",
399
443
  children: f
@@ -403,7 +447,7 @@ function M({ open: n, onClose: r, title: i, description: s, icon: l, status: u =
403
447
  }
404
448
  //#endregion
405
449
  //#region src/hooks/useLatest.ts
406
- function N(e) {
450
+ function F(e) {
407
451
  let t = c(e);
408
452
  return a(() => {
409
453
  t.current = e;
@@ -411,8 +455,8 @@ function N(e) {
411
455
  }
412
456
  //#endregion
413
457
  //#region src/hooks/useEscapeKey.ts
414
- function P(e, t) {
415
- let n = N(t);
458
+ function I(e, t) {
459
+ let n = F(t);
416
460
  a(() => {
417
461
  if (!e) return;
418
462
  let t = (e) => {
@@ -423,8 +467,8 @@ function P(e, t) {
423
467
  }
424
468
  //#endregion
425
469
  //#region src/hooks/useOutsidePress.ts
426
- function F(e, t, n) {
427
- let r = N(n);
470
+ function L(e, t, n) {
471
+ let r = F(n);
428
472
  a(() => {
429
473
  if (!e) return;
430
474
  let n = (e) => {
@@ -439,7 +483,7 @@ function F(e, t, n) {
439
483
  }
440
484
  //#endregion
441
485
  //#region src/hooks/useTopLayerPosition.ts
442
- function I(e, t, n, r) {
486
+ function R(e, t, n, r) {
443
487
  let [i, a] = l(null);
444
488
  return s(() => {
445
489
  let r = t.current;
@@ -462,17 +506,17 @@ function I(e, t, n, r) {
462
506
  }
463
507
  //#endregion
464
508
  //#region src/utils/placement.ts
465
- var L = {
509
+ var z = {
466
510
  gap: 10,
467
511
  margin: 8,
468
512
  arrowInset: 12
469
- }, R = {
513
+ }, B = {
470
514
  top: "bottom",
471
515
  bottom: "top",
472
516
  left: "right",
473
517
  right: "left"
474
- }, z = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n));
475
- function B(e, t, n, r, { gap: i, margin: a }) {
518
+ }, V = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n));
519
+ function H(e, t, n, r, { gap: i, margin: a }) {
476
520
  let o = (t) => {
477
521
  switch (t) {
478
522
  case "top": return e.top;
@@ -481,16 +525,16 @@ function B(e, t, n, r, { gap: i, margin: a }) {
481
525
  case "right": return r.width - e.right;
482
526
  }
483
527
  }, s = (n === "top" || n === "bottom" ? t.height : t.width) + i + a, c = o(n);
484
- return c >= s || o(R[n]) <= c ? n : R[n];
528
+ return c >= s || o(B[n]) <= c ? n : B[n];
485
529
  }
486
- function V(e, t, n, r = {
530
+ function U(e, t, n, r = {
487
531
  width: window.innerWidth,
488
532
  height: window.innerHeight
489
533
  }, i = {}) {
490
534
  let a = {
491
- ...L,
535
+ ...z,
492
536
  ...i
493
- }, { gap: o, margin: s, arrowInset: c } = a, l = B(e, t, n, r, a), u = l === "top" || l === "bottom", d, f;
537
+ }, { gap: o, margin: s, arrowInset: c } = a, l = H(e, t, n, r, a), u = l === "top" || l === "bottom", d, f;
494
538
  switch (l) {
495
539
  case "top":
496
540
  d = e.y - t.height - o, f = e.x + e.width / 2 - t.width / 2;
@@ -503,18 +547,18 @@ function V(e, t, n, r = {
503
547
  break;
504
548
  case "right": d = e.y + e.height / 2 - t.height / 2, f = e.x + e.width + o;
505
549
  }
506
- u ? f = z(f, s, r.width - t.width - s) : d = z(d, s, r.height - t.height - s);
550
+ u ? f = V(f, s, r.width - t.width - s) : d = V(d, s, r.height - t.height - s);
507
551
  let p = u ? e.x + e.width / 2 - f : e.y + e.height / 2 - d, m = u ? t.width : t.height;
508
552
  return {
509
553
  top: d,
510
554
  left: f,
511
555
  placement: l,
512
- arrowOffset: z(p, c, m - c)
556
+ arrowOffset: V(p, c, m - c)
513
557
  };
514
558
  }
515
559
  //#endregion
516
560
  //#region src/Popover/Popover.tsx
517
- var H = [
561
+ var W = [
518
562
  "button:not([disabled])",
519
563
  "[href]",
520
564
  "input:not([disabled])",
@@ -522,14 +566,14 @@ var H = [
522
566
  "textarea:not([disabled])",
523
567
  "[tabindex]:not([tabindex=\"-1\"])"
524
568
  ].join(", ");
525
- function U({ open: r, onOpenChange: i, trigger: l, title: u, children: f, role: p = "dialog", size: m = "md", placement: h = "bottom", className: g }) {
569
+ function G({ open: r, onOpenChange: i, trigger: l, title: u, children: f, role: p = "dialog", size: m = "md", placement: h = "bottom", className: g }) {
526
570
  let _ = o(), v = c(null), y = c(null), b = c(!1), x = () => i(!1);
527
- P(r, x), F(r, v, x);
571
+ I(r, x), L(r, v, x);
528
572
  let S = (e) => {
529
573
  l.props.onClick?.(e), e.defaultPrevented || i(!r);
530
- }, C = I(r, y, () => {
574
+ }, C = R(r, y, () => {
531
575
  let e = y.current, t = v.current?.firstElementChild;
532
- return !e || !t ? null : V(t.getBoundingClientRect(), {
576
+ return !e || !t ? null : U(t.getBoundingClientRect(), {
533
577
  width: e.offsetWidth,
534
578
  height: e.offsetHeight
535
579
  }, h, void 0, { gap: 12 });
@@ -544,7 +588,7 @@ function U({ open: r, onOpenChange: i, trigger: l, title: u, children: f, role:
544
588
  } : { visibility: "hidden" }, T = C !== null;
545
589
  return s(() => {
546
590
  let e = y.current;
547
- r && T && e && (e.querySelector("[data-autofocus]") ?? e.querySelector(H) ?? e).focus();
591
+ r && T && e && (e.querySelector("[data-autofocus]") ?? e.querySelector(W) ?? e).focus();
548
592
  }, [r, T]), a(() => {
549
593
  if (b.current && !r) {
550
594
  let e = document.activeElement;
@@ -574,7 +618,7 @@ function U({ open: r, onOpenChange: i, trigger: l, title: u, children: f, role:
574
618
  }
575
619
  //#endregion
576
620
  //#region src/ProgressBar/ProgressBar.tsx
577
- function W({ title: n, progress: r, indeterminate: i, valueLabel: a, className: s, "aria-label": c }) {
621
+ function K({ title: n, progress: r, indeterminate: i, valueLabel: a, className: s, "aria-label": c }) {
578
622
  let l = o(), u = i ? void 0 : Math.min(100, Math.max(0, Number.isFinite(r) ? r : 0)), f = u === 100, p = a ?? (i ? "Indeterminate" : `${u}%`);
579
623
  return /* @__PURE__ */ t("div", {
580
624
  className: d("tintora-progress-bar", s),
@@ -608,16 +652,16 @@ function W({ title: n, progress: r, indeterminate: i, valueLabel: a, className:
608
652
  }
609
653
  //#endregion
610
654
  //#region src/Radio/RadioContext.ts
611
- var G = r(null);
612
- function K() {
613
- let e = i(G);
655
+ var q = r(null);
656
+ function J() {
657
+ let e = i(q);
614
658
  if (!e) throw Error("Radio must be rendered inside a RadioGroup");
615
659
  return e;
616
660
  }
617
661
  //#endregion
618
662
  //#region src/Radio/Radio.tsx
619
- function q({ value: n, className: r, disabled: i, ...a }) {
620
- let o = K();
663
+ function Y({ value: n, className: r, disabled: i, ...a }) {
664
+ let o = J();
621
665
  return /* @__PURE__ */ t("span", {
622
666
  className: d("tintora-radio", r),
623
667
  children: [/* @__PURE__ */ e("input", {
@@ -637,9 +681,9 @@ function q({ value: n, className: r, disabled: i, ...a }) {
637
681
  }
638
682
  //#endregion
639
683
  //#region src/Radio/RadioGroup.tsx
640
- function J({ value: t, defaultValue: n, onValueChange: r, disabled: i = !1, name: a, className: s, ...c }) {
684
+ function ee({ value: t, defaultValue: n, onValueChange: r, disabled: i = !1, name: a, className: s, ...c }) {
641
685
  let u = o(), [f, p] = l(n ?? null), m = t !== void 0, h = m ? t : f;
642
- return /* @__PURE__ */ e(G.Provider, {
686
+ return /* @__PURE__ */ e(q.Provider, {
643
687
  value: {
644
688
  name: a ?? u,
645
689
  value: h,
@@ -657,7 +701,7 @@ function J({ value: t, defaultValue: n, onValueChange: r, disabled: i = !1, name
657
701
  }
658
702
  //#endregion
659
703
  //#region src/SearchInput/SearchInput.tsx
660
- function Y({ className: n, disabled: r, ...i }) {
704
+ function te({ className: n, disabled: r, ...i }) {
661
705
  return /* @__PURE__ */ t("label", {
662
706
  className: d("tintora-search-input", r && "tintora-search-input--disabled", n),
663
707
  children: [/* @__PURE__ */ t("svg", {
@@ -683,15 +727,15 @@ function Y({ className: n, disabled: r, ...i }) {
683
727
  }
684
728
  //#endregion
685
729
  //#region src/Select/SelectContext.ts
686
- var X = r(null), Z = () => {
730
+ var X = r(null), ne = () => {
687
731
  let e = i(X);
688
732
  if (!e) throw Error("SelectOption must be rendered inside a Select");
689
733
  return e;
690
734
  };
691
735
  //#endregion
692
736
  //#region src/Select/SelectOption.tsx
693
- function ee({ label: t, value: n, disabled: r }) {
694
- let { select: i, activate: a, optionId: o, value: s, activeValue: c } = Z();
737
+ function re({ label: t, value: n, disabled: r }) {
738
+ let { select: i, activate: a, optionId: o, value: s, activeValue: c } = ne();
695
739
  return /* @__PURE__ */ e("div", {
696
740
  id: o(n),
697
741
  role: "option",
@@ -705,13 +749,13 @@ function ee({ label: t, value: n, disabled: r }) {
705
749
  }
706
750
  //#endregion
707
751
  //#region src/Select/Select.tsx
708
- var Q = 4;
709
- function te({ defaultValue: n, options: r, disabled: i, value: s, placeholder: u, onValueChange: f, name: p, className: m, onClick: h, onKeyDown: g, onKeyUp: _, "aria-label": v, ...y }) {
710
- let b = o(), x = c(null), S = c(null), C = c(null), [w, T] = l(n ?? null), [E, D] = l(!1), [O, k] = l(-1), A = s !== void 0, j = A ? s : w, M = r.findIndex((e) => e.value === j), N = (e) => r[e]?.disabled !== !0, P = () => r.findIndex((e, t) => N(t)), L = (e, t) => {
752
+ var Z = 4;
753
+ function ie({ defaultValue: n, options: r, disabled: i, value: s, placeholder: u, onValueChange: f, name: p, className: m, onClick: h, onKeyDown: g, onKeyUp: _, "aria-label": v, ...y }) {
754
+ let b = o(), x = c(null), S = c(null), C = c(null), [w, T] = l(n ?? null), [E, D] = l(!1), [O, k] = l(-1), A = s !== void 0, j = A ? s : w, M = r.findIndex((e) => e.value === j), N = (e) => r[e]?.disabled !== !0, P = () => r.findIndex((e, t) => N(t)), F = (e, t) => {
711
755
  for (let n = e + t; n >= 0 && n < r.length; n += t) if (N(n)) return n;
712
756
  return e;
713
- }, R = () => {
714
- let e = L(r.length, -1);
757
+ }, I = () => {
758
+ let e = F(r.length, -1);
715
759
  return e === r.length ? -1 : e;
716
760
  }, z = (e) => r.findIndex((t) => t.value === e), B = () => {
717
761
  k(M >= 0 && N(M) ? M : P()), D(!0);
@@ -732,27 +776,27 @@ function te({ defaultValue: n, options: r, disabled: i, value: s, placeholder: u
732
776
  return;
733
777
  }
734
778
  let n = {
735
- ArrowDown: () => O < 0 ? P() : L(O, 1),
736
- ArrowUp: () => O < 0 ? P() : L(O, -1),
779
+ ArrowDown: () => O < 0 ? P() : F(O, 1),
780
+ ArrowUp: () => O < 0 ? P() : F(O, -1),
737
781
  Home: P,
738
- End: R
782
+ End: I
739
783
  };
740
784
  t in n ? (e.preventDefault(), k(n[t]())) : t === "Enter" || t === " " ? (e.preventDefault(), O >= 0 ? H(r[O].value) : V()) : t === "Escape" && (e.preventDefault(), V());
741
785
  }, W = (e) => {
742
786
  _?.(e), e.key === " " && e.preventDefault();
743
- }, G = I(E, C, () => {
787
+ }, G = R(E, C, () => {
744
788
  let e = C.current, t = S.current;
745
789
  if (!e || !t) return null;
746
- let n = t.getBoundingClientRect(), r = e.offsetHeight, i = n.bottom + Q + r <= window.innerHeight, a = n.top - Q - r >= 0;
790
+ let n = t.getBoundingClientRect(), r = e.offsetHeight, i = n.bottom + Z + r <= window.innerHeight, a = n.top - Z - r >= 0;
747
791
  return {
748
- top: i || !a ? n.bottom + Q : n.top - Q - r,
792
+ top: i || !a ? n.bottom + Z : n.top - Z - r,
749
793
  left: n.left,
750
794
  minWidth: n.width
751
795
  };
752
796
  }, []), K = (e) => {
753
797
  h?.(e), !e.defaultPrevented && (E ? V() : B());
754
798
  };
755
- F(E, x, V), a(() => {
799
+ L(E, x, V), a(() => {
756
800
  E && O >= 0 && C.current?.children.item(O)?.scrollIntoView?.({ block: "nearest" });
757
801
  }, [E, O]);
758
802
  let q = (e) => `${b}-option-${z(e)}`, J = E ? r[O]?.value ?? null : null, Y = r[M]?.label;
@@ -809,7 +853,7 @@ function te({ defaultValue: n, options: r, disabled: i, value: s, placeholder: u
809
853
  className: "tintora-select__menu",
810
854
  style: G ?? {},
811
855
  onMouseDown: (e) => e.preventDefault(),
812
- children: r.map((t) => /* @__PURE__ */ e(ee, { ...t }, t.value))
856
+ children: r.map((t) => /* @__PURE__ */ e(re, { ...t }, t.value))
813
857
  }),
814
858
  p && /* @__PURE__ */ e("input", {
815
859
  type: "hidden",
@@ -822,8 +866,26 @@ function te({ defaultValue: n, options: r, disabled: i, value: s, placeholder: u
822
866
  });
823
867
  }
824
868
  //#endregion
869
+ //#region src/SettingsRow/SettingsRow.tsx
870
+ function ae({ title: n, description: r, children: i, controlPosition: a = "end", className: o, ...s }) {
871
+ return /* @__PURE__ */ t("div", {
872
+ ...s,
873
+ className: d("tintora-settings-row", `tintora-settings-row--control-${a}`, r && "tintora-settings-row--described", o),
874
+ children: [/* @__PURE__ */ t("div", {
875
+ className: "tintora-settings-row__text",
876
+ children: [/* @__PURE__ */ e("div", {
877
+ className: "tintora-settings-row__title",
878
+ children: n
879
+ }), r && /* @__PURE__ */ e("div", {
880
+ className: "tintora-settings-row__description",
881
+ children: r
882
+ })]
883
+ }), i]
884
+ });
885
+ }
886
+ //#endregion
825
887
  //#region src/Skeleton/Skeleton.tsx
826
- function ne({ width: t, height: n, className: r, style: i, ...a }) {
888
+ function oe({ width: t, height: n, className: r, style: i, ...a }) {
827
889
  let o = {
828
890
  ...t !== void 0 && { width: t },
829
891
  ...n !== void 0 && { height: n }
@@ -840,8 +902,8 @@ function ne({ width: t, height: n, className: r, style: i, ...a }) {
840
902
  }
841
903
  //#endregion
842
904
  //#region src/Switch/Switch.tsx
843
- function re({ checked: n, defaultChecked: r, onCheckedChange: i, className: a, ...o }) {
844
- let s = S({
905
+ function se({ checked: n, defaultChecked: r, onCheckedChange: i, className: a, ...o }) {
906
+ let s = D({
845
907
  checked: n,
846
908
  defaultChecked: r,
847
909
  onCheckedChange: i
@@ -862,8 +924,66 @@ function re({ checked: n, defaultChecked: r, onCheckedChange: i, className: a, .
862
924
  });
863
925
  }
864
926
  //#endregion
927
+ //#region src/Tabs/TabsContext.ts
928
+ var Q = r(null);
929
+ function ce() {
930
+ let e = i(Q);
931
+ if (!e) throw Error("Tab must be rendered inside Tabs");
932
+ return e;
933
+ }
934
+ //#endregion
935
+ //#region src/Tabs/Tab.tsx
936
+ function le({ value: t, className: n, onClick: r, children: i, ...a }) {
937
+ let o = ce(), s = o.value === t, c = (e) => {
938
+ r?.(e), e.defaultPrevented || o.select(t);
939
+ };
940
+ return /* @__PURE__ */ e("button", {
941
+ ...a,
942
+ type: "button",
943
+ role: "tab",
944
+ "aria-selected": s,
945
+ tabIndex: s ? 0 : -1,
946
+ className: d("tintora-tab", n),
947
+ onClick: c,
948
+ children: i
949
+ });
950
+ }
951
+ //#endregion
952
+ //#region src/Tabs/Tabs.tsx
953
+ var ue = [
954
+ "ArrowLeft",
955
+ "ArrowRight",
956
+ "Home",
957
+ "End"
958
+ ];
959
+ function de({ value: t, defaultValue: n, onValueChange: r, variant: i = "segmented", className: a, children: o, onKeyDown: s, ...c }) {
960
+ let [u, f] = l(n), p = t !== void 0, m = p ? t : u, h = (e) => {
961
+ e !== m && (p || f(e), r?.(e));
962
+ }, g = (e) => {
963
+ if (s?.(e), e.defaultPrevented || !ue.includes(e.key)) return;
964
+ let t = Array.from(e.currentTarget.querySelectorAll("[role=\"tab\"]:not(:disabled)")), n = t.indexOf(e.target);
965
+ if (n < 0) return;
966
+ e.preventDefault();
967
+ let r = t.length - 1, i = e.key === "Home" ? 0 : e.key === "End" ? r : (n + (e.key === "ArrowRight" ? 1 : -1) + t.length) % t.length;
968
+ t[i].focus(), t[i].click();
969
+ };
970
+ return /* @__PURE__ */ e(Q.Provider, {
971
+ value: {
972
+ value: m,
973
+ select: h
974
+ },
975
+ children: /* @__PURE__ */ e("div", {
976
+ ...c,
977
+ role: "tablist",
978
+ className: d("tintora-tabs", `tintora-tabs--${i}`, a),
979
+ onKeyDown: g,
980
+ children: o
981
+ })
982
+ });
983
+ }
984
+ //#endregion
865
985
  //#region src/Tag/Tag.tsx
866
- function ie({ children: t, className: n, variant: r = "neutral", size: i = "medium", ...a }) {
986
+ function fe({ children: t, className: n, variant: r = "neutral", size: i = "medium", ...a }) {
867
987
  return /* @__PURE__ */ e("span", {
868
988
  ...a,
869
989
  className: d("tintora-tag", `tintora-tag--${r}`, `tintora-tag--${i}`, n),
@@ -872,7 +992,7 @@ function ie({ children: t, className: n, variant: r = "neutral", size: i = "medi
872
992
  }
873
993
  //#endregion
874
994
  //#region src/TextField/TextField.tsx
875
- function ae({ label: n, hint: r, error: i, id: a, className: s, disabled: c, "aria-describedby": l, "aria-invalid": u, ...f }) {
995
+ function pe({ label: n, hint: r, error: i, id: a, className: s, disabled: c, "aria-describedby": l, "aria-invalid": u, ...f }) {
876
996
  let p = o(), m = a ?? p, h = `${m}-message`, g = i ?? r;
877
997
  return /* @__PURE__ */ t("div", {
878
998
  className: d("tintora-textfield", c && "tintora-textfield--disabled", s),
@@ -900,7 +1020,7 @@ function ae({ label: n, hint: r, error: i, id: a, className: s, disabled: c, "ar
900
1020
  }
901
1021
  //#endregion
902
1022
  //#region src/Toast/ToastIcons.tsx
903
- function oe() {
1023
+ function me() {
904
1024
  return /* @__PURE__ */ e("svg", {
905
1025
  width: "20",
906
1026
  height: "20",
@@ -915,7 +1035,7 @@ function oe() {
915
1035
  children: /* @__PURE__ */ e("path", { d: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM8 12.5l2.7 2.7L16 9.8" })
916
1036
  });
917
1037
  }
918
- function se() {
1038
+ function he() {
919
1039
  return /* @__PURE__ */ e("svg", {
920
1040
  width: "20",
921
1041
  height: "20",
@@ -930,7 +1050,7 @@ function se() {
930
1050
  children: /* @__PURE__ */ e("path", { d: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM15 9l-6 6M9 9l6 6" })
931
1051
  });
932
1052
  }
933
- function ce() {
1053
+ function ge() {
934
1054
  return /* @__PURE__ */ e("svg", {
935
1055
  width: "20",
936
1056
  height: "20",
@@ -945,7 +1065,7 @@ function ce() {
945
1065
  children: /* @__PURE__ */ e("path", { d: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01" })
946
1066
  });
947
1067
  }
948
- function le() {
1068
+ function _e() {
949
1069
  return /* @__PURE__ */ e("svg", {
950
1070
  width: "20",
951
1071
  height: "20",
@@ -960,7 +1080,7 @@ function le() {
960
1080
  children: /* @__PURE__ */ e("path", { d: "M10.3 3.9L1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01" })
961
1081
  });
962
1082
  }
963
- function ue() {
1083
+ function ve() {
964
1084
  return /* @__PURE__ */ e("svg", {
965
1085
  width: "14",
966
1086
  height: "14",
@@ -975,14 +1095,14 @@ function ue() {
975
1095
  }
976
1096
  //#endregion
977
1097
  //#region src/Toast/Toast.tsx
978
- var de = {
979
- success: /* @__PURE__ */ e(oe, {}),
980
- error: /* @__PURE__ */ e(se, {}),
981
- info: /* @__PURE__ */ e(ce, {}),
982
- warning: /* @__PURE__ */ e(le, {})
1098
+ var ye = {
1099
+ success: /* @__PURE__ */ e(me, {}),
1100
+ error: /* @__PURE__ */ e(he, {}),
1101
+ info: /* @__PURE__ */ e(ge, {}),
1102
+ warning: /* @__PURE__ */ e(_e, {})
983
1103
  };
984
- function fe({ status: n, children: r, action: i, onDismiss: o, duration: s = 5e3, timerBar: u = !1, className: f, ...p }) {
985
- let [m, h] = l(!1), [g, _] = l(!1), v = m || g, y = N(o), b = c(s);
1104
+ function be({ status: n, children: r, action: i, onDismiss: o, duration: s = 5e3, timerBar: u = !1, className: f, ...p }) {
1105
+ let [m, h] = l(!1), [g, _] = l(!1), v = m || g, y = F(o), b = c(s);
986
1106
  a(() => {
987
1107
  b.current = s;
988
1108
  }, [s]), a(() => {
@@ -1014,7 +1134,7 @@ function fe({ status: n, children: r, action: i, onDismiss: o, duration: s = 5e3
1014
1134
  p.onBlur?.(e), e.currentTarget.contains(e.relatedTarget) || _(!1);
1015
1135
  },
1016
1136
  children: [
1017
- n && de[n],
1137
+ n && ye[n],
1018
1138
  /* @__PURE__ */ e("span", {
1019
1139
  className: "tintora-toast__message",
1020
1140
  children: r
@@ -1030,7 +1150,7 @@ function fe({ status: n, children: r, action: i, onDismiss: o, duration: s = 5e3
1030
1150
  className: "tintora-toast__close",
1031
1151
  "aria-label": "Dismiss",
1032
1152
  onClick: o,
1033
- children: /* @__PURE__ */ e(ue, {})
1153
+ children: /* @__PURE__ */ e(ve, {})
1034
1154
  }),
1035
1155
  x && /* @__PURE__ */ e("span", {
1036
1156
  className: "tintora-toast__progress",
@@ -1042,14 +1162,14 @@ function fe({ status: n, children: r, action: i, onDismiss: o, duration: s = 5e3
1042
1162
  //#endregion
1043
1163
  //#region src/Toggle/ToggleContext.ts
1044
1164
  var $ = r(null);
1045
- function pe() {
1165
+ function xe() {
1046
1166
  let e = i($);
1047
1167
  if (!e) throw Error("ToggleItem must be rendered inside a Toggle");
1048
1168
  return e;
1049
1169
  }
1050
1170
  //#endregion
1051
1171
  //#region src/Toggle/Toggle.tsx
1052
- function me({ children: n, value: r, defaultValue: i, onValueChange: a, disabled: o = !1, className: u, ...f }) {
1172
+ function Se({ children: n, value: r, defaultValue: i, onValueChange: a, disabled: o = !1, className: u, ...f }) {
1053
1173
  let [p, m] = l(i), h = r !== void 0, g = h ? r : p, _ = n.findIndex((e) => e.props.value === g), v = c(null), [y, b] = l({
1054
1174
  x: 0,
1055
1175
  width: 0
@@ -1099,8 +1219,8 @@ function me({ children: n, value: r, defaultValue: i, onValueChange: a, disabled
1099
1219
  }
1100
1220
  //#endregion
1101
1221
  //#region src/Toggle/ToggleItem.tsx
1102
- function he({ value: t, children: n, className: r, disabled: i, onClick: a, ...o }) {
1103
- let s = pe(), c = (e) => {
1222
+ function Ce({ value: t, children: n, className: r, disabled: i, onClick: a, ...o }) {
1223
+ let s = xe(), c = (e) => {
1104
1224
  a?.(e), e.defaultPrevented || s.select(t);
1105
1225
  };
1106
1226
  return /* @__PURE__ */ e("button", {
@@ -1115,15 +1235,15 @@ function he({ value: t, children: n, className: r, disabled: i, onClick: a, ...o
1115
1235
  }
1116
1236
  //#endregion
1117
1237
  //#region src/Tooltip/Tooltip.tsx
1118
- var ge = 100;
1119
- function _e({ title: r, content: i, shortcut: s, children: u, className: f, placement: p = "top" }) {
1238
+ var we = 100;
1239
+ function Te({ title: r, content: i, shortcut: s, children: u, className: f, placement: p = "top" }) {
1120
1240
  let m = o(), [h, g] = l(!1), _ = c(null), v = c(null), y = c(void 0), b = () => {
1121
1241
  window.clearTimeout(y.current), g(!0);
1122
1242
  }, x = () => {
1123
- window.clearTimeout(y.current), y.current = window.setTimeout(() => g(!1), ge);
1124
- }, S = I(h, v, () => {
1243
+ window.clearTimeout(y.current), y.current = window.setTimeout(() => g(!1), we);
1244
+ }, S = R(h, v, () => {
1125
1245
  let e = v.current, t = _.current?.firstElementChild;
1126
- return !e || !t ? null : V(t.getBoundingClientRect(), {
1246
+ return !e || !t ? null : U(t.getBoundingClientRect(), {
1127
1247
  width: e.offsetWidth,
1128
1248
  height: e.offsetHeight
1129
1249
  }, p);
@@ -1133,7 +1253,7 @@ function _e({ title: r, content: i, shortcut: s, children: u, className: f, plac
1133
1253
  i,
1134
1254
  s
1135
1255
  ]);
1136
- P(h, () => g(!1)), a(() => () => window.clearTimeout(y.current), []);
1256
+ I(h, () => g(!1)), a(() => () => window.clearTimeout(y.current), []);
1137
1257
  let C = S ? {
1138
1258
  top: S.top,
1139
1259
  left: S.left,
@@ -1171,4 +1291,4 @@ function _e({ title: r, content: i, shortcut: s, children: u, className: f, plac
1171
1291
  });
1172
1292
  }
1173
1293
  //#endregion
1174
- export { m as Alert, g as Avatar, y as Button, b as Card, C as Checkbox, w as Chip, T as Dot, O as Drawer, A as IconButton, M as Modal, U as Popover, W as ProgressBar, q as Radio, J as RadioGroup, Y as SearchInput, te as Select, x as SelectableCard, ne as Skeleton, v as Spinner, re as Switch, ie as Tag, ae as TextField, fe as Toast, me as Toggle, he as ToggleItem, _e as Tooltip };
1294
+ export { m as Alert, g as Avatar, b as BottomSheet, x as BottomSheetOption, w as Button, T as Card, O as Checkbox, k as Chip, A as Dot, y as Drawer, M as IconButton, P as Modal, G as Popover, K as ProgressBar, Y as Radio, ee as RadioGroup, te as SearchInput, ie as Select, E as SelectableCard, ae as SettingsRow, oe as Skeleton, C as Spinner, se as Switch, le as Tab, de as Tabs, fe as Tag, pe as TextField, be as Toast, Se as Toggle, Ce as ToggleItem, Te as Tooltip };