@selectwin/kit 0.1.256 → 0.1.258

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +57 -0
  2. package/dist/SelectActionList.d.ts +5 -0
  3. package/dist/SelectActionList.js +55 -39
  4. package/dist/SelectAppFrame.d.ts +8 -2
  5. package/dist/SelectAppFrame.js +124 -119
  6. package/dist/SelectAvatarGroup.d.ts +31 -0
  7. package/dist/SelectAvatarGroup.js +39 -0
  8. package/dist/SelectBadge.d.ts +1 -1
  9. package/dist/SelectChannelPreview.d.ts +15 -5
  10. package/dist/SelectChannelPreview.js +94 -54
  11. package/dist/SelectConversationNote.d.ts +37 -0
  12. package/dist/SelectConversationNote.js +93 -0
  13. package/dist/SelectFieldset.d.ts +14 -0
  14. package/dist/SelectFieldset.js +27 -0
  15. package/dist/SelectFilterBar.d.ts +6 -1
  16. package/dist/SelectFilterBar.js +153 -123
  17. package/dist/SelectImageUploadField.d.ts +5 -3
  18. package/dist/SelectImageUploadField.js +26 -26
  19. package/dist/SelectKanban.d.ts +13 -1
  20. package/dist/SelectKanban.js +72 -50
  21. package/dist/SelectLocale.d.ts +40 -0
  22. package/dist/SelectLocale.js +560 -511
  23. package/dist/SelectMail.d.ts +17 -2
  24. package/dist/SelectMail.js +9 -6
  25. package/dist/SelectModal.d.ts +10 -4
  26. package/dist/SelectModal.js +158 -137
  27. package/dist/SelectSegmented.d.ts +7 -0
  28. package/dist/SelectSegmented.js +51 -43
  29. package/dist/SelectSideNav.d.ts +2 -1
  30. package/dist/SelectSideNav.js +156 -135
  31. package/dist/SelectSortable.d.ts +47 -1
  32. package/dist/SelectSortable.js +138 -19
  33. package/dist/SelectSteps.d.ts +3 -0
  34. package/dist/SelectSteps.js +42 -31
  35. package/dist/SelectTimeline.d.ts +4 -0
  36. package/dist/SelectTimeline.js +20 -9
  37. package/dist/SelectTriggerMenu.d.ts +77 -0
  38. package/dist/SelectTriggerMenu.js +98 -0
  39. package/dist/index.d.ts +11 -0
  40. package/dist/index.js +186 -182
  41. package/dist/internal/navCount.d.ts +21 -0
  42. package/dist/internal/navCount.js +27 -0
  43. package/dist/style.css +1 -1
  44. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { KeyboardEvent, ReactNode, Ref, SyntheticEvent } from 'react';
2
2
  import { attachmentExt } from './internal/fileKind';
3
3
  export interface SelectMailAddress {
4
4
  name: string | null;
@@ -241,7 +241,7 @@ export declare function SelectMailComposerInput({ value, onChange, placeholder,
241
241
  maxLength?: number;
242
242
  }): import("react").JSX.Element;
243
243
  /** O corpo: texto, sem moldura, que cresce até um teto e rola. */
244
- export declare function SelectMailComposerBody({ value, onChange, placeholder, rows, 'aria-label': ariaLabel, maxLength, onEnter, id, }: {
244
+ export declare function SelectMailComposerBody({ value, onChange, placeholder, rows, 'aria-label': ariaLabel, maxLength, onEnter, id, textareaRef, onKeyDown, onSelect, fieldProps, }: {
245
245
  value: string;
246
246
  onChange: (value: string) => void;
247
247
  placeholder?: string;
@@ -254,6 +254,21 @@ export declare function SelectMailComposerBody({ value, onChange, placeholder, r
254
254
  */
255
255
  onEnter?: () => void;
256
256
  id?: string;
257
+ /** 0.1.257: a caixa de texto, para quem precisa do cursor (a lista do "/" e da "@", o `SelectTriggerMenu`). */
258
+ textareaRef?: Ref<HTMLTextAreaElement>;
259
+ /**
260
+ * 0.1.257: as teclas de quem usa, ANTES do Enter de enviar: a tecla em que ele chama `preventDefault` é dele (com a
261
+ * lista aberta, o Enter escolhe a opção e não envia).
262
+ */
263
+ onKeyDown?: (event: KeyboardEvent<HTMLTextAreaElement>) => void;
264
+ /** 0.1.257: o cursor mudou de lugar (o clique, as setas): quem acompanha o gatilho relê. */
265
+ onSelect?: (event: SyntheticEvent<HTMLTextAreaElement>) => void;
266
+ /** 0.1.257: as props da caixa que abre uma lista (`selectTriggerFieldProps`). */
267
+ fieldProps?: {
268
+ 'aria-autocomplete'?: 'list';
269
+ 'aria-controls'?: string;
270
+ 'aria-activedescendant'?: string;
271
+ };
257
272
  }): import("react").JSX.Element;
258
273
  /** O clipe do rodapé (0.1.149): abre o seletor de arquivos do sistema. Escolher o mesmo arquivo de novo também vale. */
259
274
  export declare function SelectMailAttachButton({ onFiles, accept, multiple, disabled, label, }: {
@@ -583,19 +583,22 @@ function K({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength:
583
583
  maxLength: i
584
584
  });
585
585
  }
586
- function q({ value: e, onChange: t, placeholder: n, rows: r = 6, "aria-label": i, maxLength: a, onEnter: o, id: s }) {
587
- let c = h().inbox;
586
+ function q({ value: e, onChange: t, placeholder: n, rows: r = 6, "aria-label": i, maxLength: a, onEnter: o, id: s, textareaRef: c, onKeyDown: l, onSelect: u, fieldProps: d }) {
587
+ let f = h().inbox;
588
588
  return /* @__PURE__ */ w("textarea", {
589
+ ...d,
590
+ ref: c,
589
591
  id: s,
590
592
  className: "select-mailcomposer__body",
591
593
  value: e,
592
594
  onChange: (e) => t(e.target.value),
593
- onKeyDown: o ? (e) => {
594
- e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), o());
595
- } : void 0,
595
+ onKeyDown: (e) => {
596
+ l == null || l(e), !e.defaultPrevented && o && e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), o());
597
+ },
598
+ onSelect: u,
596
599
  placeholder: n,
597
600
  rows: r,
598
- "aria-label": i ?? c.message,
601
+ "aria-label": i ?? f.message,
599
602
  maxLength: a
600
603
  });
601
604
  }
@@ -20,8 +20,9 @@ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, d
20
20
  subtitle?: ReactNode;
21
21
  /**
22
22
  * 0.1.230: a descrição do diálogo no COMEÇO do corpo, em texto secundário (o cabeçalho fica só com o título). É o lugar
23
- * dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa. Na folha ela não vale: lá a linha de apoio é o
24
- * `badge` + `subtitle`, e a explicação vai no `help`.
23
+ * dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa. Na folha lateral ela não vale: lá a linha de
24
+ * apoio é o `badge` + `subtitle`, e a explicação vai no `help`. Na folha de baixo (`sheet`, 0.1.258), ela abre o corpo,
25
+ * como no centro, também no celular.
25
26
  */
26
27
  description?: ReactNode;
27
28
  /** 0.1.184: o selo da situação (`SelectBadge`), na linha do subtítulo, antes dele ("Aberto · Chamado · Estorno"). */
@@ -49,8 +50,13 @@ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, d
49
50
  * `<html>`, lido ao abrir (antes o padrão era `light`, também num app escuro).
50
51
  */
51
52
  theme?: 'light' | 'dark';
52
- /** `side` = folha lateral à direita, na altura inteira (o detalhe de uma linha da lista). */
53
- placement?: 'center' | 'side';
53
+ /**
54
+ * `side` = folha lateral à direita, na altura inteira (o detalhe de uma linha da lista).
55
+ * `sheet` (0.1.258) = o diálogo de formulário que o dedo preenche: no computador, o modal do centro (igual ao `center`);
56
+ * no celular (até 40rem, o corte do CSS do kit), a folha de baixo — a alça, o título e o ✕, a `description`, o corpo
57
+ * que rola e o pé fixo com os botões dividindo a largura. Com `aside`, segue o modal da conta.
58
+ */
59
+ placement?: 'center' | 'side' | 'sheet';
54
60
  /**
55
61
  * 0.1.181: um controle na LINHA do título, à direita (a busca do modal de Apps do painel). Numa tela
56
62
  * estreita ele desce para baixo do título, na largura toda. Só no layout padrão (sem `aside`). Na folha (0.1.246) ele
@@ -9,13 +9,14 @@ import { LayerProvider as re, isTopLayer as ie, openLayer as ae, useParentLayer
9
9
  import { detectSelectTheme as se } from "./detectSelectTheme.js";
10
10
  import { sheetBands as ce } from "./internal/sheetBands.js";
11
11
  import { FrameBody as i } from "./internal/frame.js";
12
- import { HeadingScope as le } from "./internal/headingLevel.js";
13
- import { isDevBuild as ue } from "./internal/dev.js";
12
+ import { SelectScrollArea as le } from "./SelectScrollArea.js";
13
+ import { HeadingScope as ue } from "./internal/headingLevel.js";
14
+ import { isDevBuild as de } from "./internal/dev.js";
14
15
  import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
15
16
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
16
- import { createPortal as de } from "react-dom";
17
+ import { createPortal as fe } from "react-dom";
17
18
  //#region src/SelectModal.tsx
18
- var fe = 220, f = "(max-width: 40rem)", pe = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, me = 64, he = 120;
19
+ var pe = 220, f = "(max-width: 40rem)", me = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, he = 64, ge = 120;
19
20
  function p({ children: e, className: t, destructive: n }) {
20
21
  return /* @__PURE__ */ d("div", {
21
22
  className: `select-modal__actions${t ? " " + t : ""}`,
@@ -25,45 +26,45 @@ function p({ children: e, className: t, destructive: n }) {
25
26
  }), e]
26
27
  });
27
28
  }
28
- function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help: ge, children: y, footer: _e, aside: b, size: ve = "md", showClose: ye = !0, noise: be = !0, dividedHeader: xe = !1, backdrop: Se = "dim", theme: Ce, placement: x = "center", headerAction: S, menu: C, onBack: w, backLabel: we, loading: Te = !1, error: T, onRetry: E, flush: Ee = !1, dismissible: D = !0 }) {
29
- let O = r(), [k, De] = c(f), [A, j] = c(!1), M = s(null), N = s(null), P = s(null), F = o(), I = o(), Oe = o(), [L] = c(() => ({})), ke = oe(), R = s({
29
+ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help: _e, children: y, footer: ve, aside: b, size: ye = "md", showClose: be = !0, noise: xe = !0, dividedHeader: Se = !1, backdrop: Ce = "dim", theme: we, placement: x = "center", headerAction: S, menu: C, onBack: w, backLabel: Te, loading: Ee = !1, error: T, onRetry: De, flush: Oe = !1, dismissible: E = !0 }) {
30
+ let D = r(), [O, ke] = c(f), [k, A] = c(!1), j = s(null), M = s(null), N = s(null), P = o(), F = o(), Ae = o(), [I] = c(() => ({})), je = oe(), L = s({
30
31
  onClose: p,
31
- dismissible: D
32
+ dismissible: E
32
33
  });
33
- R.current = {
34
+ L.current = {
34
35
  onClose: p,
35
- dismissible: D
36
+ dismissible: E
36
37
  };
37
- let [z] = c(() => f && typeof document < "u" ? document.activeElement : null), B = s(null), [Ae, je] = c(() => f && typeof document < "u" ? se(z) : "light"), V = x === "side" && !b, H = Te ? "loading" : T != null && T !== !1 && T !== "" ? "error" : "ready", U = V && w != null;
38
+ let [R] = c(() => f && typeof document < "u" ? document.activeElement : null), z = s(null), [Me, Ne] = c(() => f && typeof document < "u" ? se(R) : "light"), B = x === "side" && !b, V = x === "sheet" && !b, H = Ee ? "loading" : T != null && T !== !1 && T !== "" ? "error" : "ready", U = B && w != null;
38
39
  a(() => {
39
40
  if (f) {
40
41
  var e;
41
- if (!B.current) {
42
+ if (!z.current) {
42
43
  var t;
43
- let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t = M.current) != null && t.contains(e));
44
- B.current = n ? e : z instanceof HTMLElement && z !== document.body ? z : null, je(se(B.current));
44
+ let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t = j.current) != null && t.contains(e));
45
+ z.current = n ? e : R instanceof HTMLElement && R !== document.body ? R : null, Ne(se(z.current));
45
46
  }
46
- (e = M.current) == null || e.style.removeProperty("transform"), De(!0), j(!1);
47
- } else if (k) {
47
+ (e = j.current) == null || e.style.removeProperty("transform"), ke(!0), A(!1);
48
+ } else if (O) {
48
49
  var n;
49
- j(!0);
50
- let e = B.current;
51
- B.current = null;
50
+ A(!0);
51
+ let e = z.current;
52
+ z.current = null;
52
53
  let t = document.activeElement;
53
- e != null && e.isConnected && (!t || t === document.body || (n = M.current) != null && n.contains(t)) && e.focus({ preventScroll: !0 });
54
+ e != null && e.isConnected && (!t || t === document.body || (n = j.current) != null && n.contains(t)) && e.focus({ preventScroll: !0 });
54
55
  let r = setTimeout(() => {
55
- De(!1), j(!1);
56
- }, fe);
56
+ ke(!1), A(!1);
57
+ }, pe);
57
58
  return () => clearTimeout(r);
58
59
  }
59
60
  }, [
60
61
  f,
61
- k,
62
- z
62
+ O,
63
+ R
63
64
  ]), a(() => {
64
- if (!k) return;
65
- let e = ae(L, ke), t = (e) => {
66
- e.key === "Escape" && !e.defaultPrevented && ie(L) && R.current.dismissible && R.current.onClose();
65
+ if (!O) return;
66
+ let e = ae(I, je), t = (e) => {
67
+ e.key === "Escape" && !e.defaultPrevented && ie(I) && L.current.dismissible && L.current.onClose();
67
68
  };
68
69
  document.addEventListener("keydown", t);
69
70
  let n = document.body.style.overflow;
@@ -71,31 +72,31 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
71
72
  e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
72
73
  };
73
74
  }, [
74
- k,
75
- L,
76
- ke
75
+ O,
76
+ I,
77
+ je
77
78
  ]);
78
- let W = k && !A;
79
+ let W = O && !k;
79
80
  a(() => {
80
81
  if (!W) return;
81
- let e = M.current;
82
+ let e = j.current;
82
83
  e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
83
- }, [W]), ne(W, M, { initialFocus: !1 });
84
- let Me = s(U);
84
+ }, [W]), ne(W, j, { initialFocus: !1 });
85
+ let Pe = s(U);
85
86
  a(() => {
86
- if (Me.current === U) return;
87
- Me.current = U, N.current && (N.current.scrollTop = 0);
88
- let e = M.current, t = document.activeElement;
87
+ if (Pe.current === U) return;
88
+ Pe.current = U, M.current && (M.current.scrollTop = 0);
89
+ let e = j.current, t = document.activeElement;
89
90
  e && (!t || t === document.body || !e.contains(t)) && e.focus({ preventScroll: !0 });
90
91
  }, [U]);
91
- let Ne = s(!1);
92
+ let Fe = s(!1);
92
93
  a(() => {
93
- if (!V || Ne.current || !P.current || !ue()) return;
94
- let e = P.current.querySelectorAll(".select-btn--primary").length;
95
- e > 1 && (Ne.current = !0, console.warn(`[SelectModal] A folha tem ${e} botões primários no pé: no máximo um, na ponta direita (o secundário à esquerda dele).`));
94
+ if (!B || Fe.current || !N.current || !de()) return;
95
+ let e = N.current.querySelectorAll(".select-btn--primary").length;
96
+ e > 1 && (Fe.current = !0, console.warn(`[SelectModal] A folha tem ${e} botões primários no pé: no máximo um, na ponta direita (o secundário à esquerda dele).`));
96
97
  });
97
- let G = s(null), Pe = (e) => {
98
- if (D && e.button === 0 && pe() && !e.target.closest("button, a, input, select, textarea, [role=\"button\"], .select-modal__headaction")) {
98
+ let G = s(null), Ie = (e) => {
99
+ if (E && e.button === 0 && me() && !e.target.closest("button, a, input, select, textarea, [role=\"button\"], .select-modal__headaction")) {
99
100
  G.current = {
100
101
  id: e.pointerId,
101
102
  y: e.clientY,
@@ -106,57 +107,57 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
106
107
  (t = (n = e.currentTarget).setPointerCapture) == null || t.call(n, e.pointerId);
107
108
  } catch {}
108
109
  }
109
- }, Fe = (e) => {
110
- let t = G.current, n = M.current;
110
+ }, Le = (e) => {
111
+ let t = G.current, n = j.current;
111
112
  t && e.pointerId === t.id && n && (t.dy = Math.max(0, e.clientY - t.y), n.dataset.dragging = "", t.dy > 0 ? n.style.transform = `translateY(${t.dy}px)` : n.style.removeProperty("transform"));
112
- }, Ie = (e) => {
113
+ }, K = (e) => {
113
114
  let t = G.current;
114
115
  if (!t || e.pointerId !== t.id) return;
115
116
  G.current = null;
116
- let n = M.current;
117
+ let n = j.current;
117
118
  if (!n) return;
118
119
  delete n.dataset.dragging;
119
- let r = Math.max(me, Math.min(he, n.offsetHeight * .25));
120
- e.type === "pointerup" && t.dy > r && R.current.dismissible ? R.current.onClose() : n.style.removeProperty("transform");
120
+ let r = Math.max(he, Math.min(ge, n.offsetHeight * .25));
121
+ e.type === "pointerup" && t.dy > r && L.current.dismissible ? L.current.onClose() : n.style.removeProperty("transform");
121
122
  };
122
- if (!k) return null;
123
- let K = h && (ge == null ? /* @__PURE__ */ u("h2", {
124
- id: F,
123
+ if (!O) return null;
124
+ let q = h && (_e == null ? /* @__PURE__ */ u("h2", {
125
+ id: P,
125
126
  className: "select-modal__title",
126
127
  children: h
127
128
  }) : /* @__PURE__ */ d("div", {
128
129
  className: "select-modal__titlerow",
129
130
  children: [/* @__PURE__ */ u("h2", {
130
- id: F,
131
+ id: P,
131
132
  className: "select-modal__title",
132
133
  children: h
133
- }), /* @__PURE__ */ u(ee, { content: ge })]
134
- })), q = v ? /* @__PURE__ */ d("p", {
135
- id: I,
134
+ }), /* @__PURE__ */ u(ee, { content: _e })]
135
+ })), J = v ? /* @__PURE__ */ d("p", {
136
+ id: F,
136
137
  className: "select-modal__subtitle select-modal__subtitle--badge",
137
138
  children: [v, g ? /* @__PURE__ */ u("span", { children: g }) : null]
138
139
  }) : g && /* @__PURE__ */ u("p", {
139
- id: I,
140
+ id: F,
140
141
  className: "select-modal__subtitle",
141
142
  children: g
142
- }), J = _ != null && _ !== !1 && _ !== "", Y = J && /* @__PURE__ */ u("p", {
143
- id: Oe,
143
+ }), Y = _ != null && _ !== !1 && _ !== "", X = Y && /* @__PURE__ */ u("p", {
144
+ id: Ae,
144
145
  className: "select-modal__description",
145
146
  children: _
146
- }), Le = [g || v ? I : null, J ? Oe : null].filter(Boolean).join(" ") || void 0, X = ye && D && /* @__PURE__ */ u("button", {
147
+ }), Re = [g || v ? F : null, Y ? Ae : null].filter(Boolean).join(" ") || void 0, Z = be && E && /* @__PURE__ */ u("button", {
147
148
  type: "button",
148
- className: `select-modal__close${V ? " select-modal__tool" : ""}`,
149
- "aria-label": O.common.close,
149
+ className: `select-modal__close${B ? " select-modal__tool" : ""}`,
150
+ "aria-label": D.common.close,
150
151
  onClick: p,
151
152
  children: /* @__PURE__ */ u(n, {})
152
- }), Z = `select-modal__header${xe ? " select-modal__header--divided" : ""}`, Re = (e) => [
153
+ }), Q = `select-modal__header${Se ? " select-modal__header--divided" : ""}`, ze = (e) => [
153
154
  0,
154
155
  1,
155
156
  2
156
157
  ].map((t) => /* @__PURE__ */ d("span", {
157
158
  className: "select-modal__skelrow",
158
159
  children: [/* @__PURE__ */ u("span", { className: `select-skeleton${e ? " select-modal__skeldot" : ""}` }), /* @__PURE__ */ u("span", { className: "select-skeleton" })]
159
- }, t)), Q = H === "loading" ? [/* @__PURE__ */ d("div", {
160
+ }, t)), $ = H === "loading" ? [/* @__PURE__ */ d("div", {
160
161
  className: "select-modal__skel",
161
162
  children: [
162
163
  /* @__PURE__ */ u("span", {
@@ -166,12 +167,12 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
166
167
  /* @__PURE__ */ u("span", {
167
168
  className: "select-modal__skelrows",
168
169
  "aria-hidden": "true",
169
- children: Re(!1)
170
+ children: ze(!1)
170
171
  }),
171
172
  /* @__PURE__ */ u("span", {
172
173
  className: "select-visually-hidden",
173
174
  role: "status",
174
- children: O.common.loading
175
+ children: D.common.loading
175
176
  })
176
177
  ]
177
178
  }, "skel-facts"), /* @__PURE__ */ d("div", {
@@ -179,47 +180,47 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
179
180
  "aria-hidden": "true",
180
181
  children: [/* @__PURE__ */ u("span", { className: "select-skeleton select-modal__skelhead" }), /* @__PURE__ */ u("span", {
181
182
  className: "select-modal__skelrows",
182
- children: Re(!0)
183
+ children: ze(!0)
183
184
  })]
184
185
  }, "skel-steps")] : H === "error" ? [/* @__PURE__ */ u(te, {
185
186
  tone: "critical",
186
- action: E ? /* @__PURE__ */ u(e, {
187
+ action: De ? /* @__PURE__ */ u(e, {
187
188
  variant: "secondary",
188
189
  size: "sm",
189
190
  inline: !0,
190
- onClick: E,
191
- children: O.modal.retry
191
+ onClick: De,
192
+ children: D.modal.retry
192
193
  }) : void 0,
193
- children: T === !0 ? O.modal.loadFailed : T
194
- }, "error")] : null, ze = !!y || J || H !== "ready", Be = !!_e && H === "ready", Ve = V && !Ee ? Q ? Q.map((e, t) => ({
194
+ children: T === !0 ? D.modal.loadFailed : T
195
+ }, "error")] : null, Be = !!y || Y || H !== "ready", Ve = !!ve && H === "ready", He = B && !Oe ? $ ? $.map((e, t) => ({
195
196
  key: `state-${t}`,
196
197
  node: e
197
- })) : ce(y) : null, He = ze && /* @__PURE__ */ u("div", {
198
+ })) : ce(y) : null, Ue = He ? /* @__PURE__ */ d(l, { children: [X && /* @__PURE__ */ u("div", {
199
+ className: "select-modal__band",
200
+ children: X
201
+ }), /* @__PURE__ */ u(i, { children: He.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
202
+ className: "select-modal__band",
203
+ children: t
204
+ }, e)) })] }) : /* @__PURE__ */ d(l, { children: [X, /* @__PURE__ */ u(i, { children: $ ?? y })] }), We = Be && u(V ? le : "div", {
198
205
  className: "select-modal__body",
199
- ref: N,
200
- children: Ve ? /* @__PURE__ */ d(l, { children: [Y && /* @__PURE__ */ u("div", {
201
- className: "select-modal__band",
202
- children: Y
203
- }), /* @__PURE__ */ u(i, { children: Ve.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
204
- className: "select-modal__band",
205
- children: t
206
- }, e)) })] }) : /* @__PURE__ */ d(l, { children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })] })
207
- }), Ue = Be && /* @__PURE__ */ u("div", {
206
+ ref: M,
207
+ children: Ue
208
+ }), Ge = Ve && /* @__PURE__ */ u("div", {
208
209
  className: "select-modal__footer",
209
- ref: P,
210
- children: _e
211
- }), $ = V && C != null && C !== !1 && H === "ready" ? /* @__PURE__ */ u("span", {
210
+ ref: N,
211
+ children: ve
212
+ }), Ke = B && C != null && C !== !1 && H === "ready" ? /* @__PURE__ */ u("span", {
212
213
  className: "select-modal__menu",
213
214
  children: C
214
- }) : null, We = q || (H === "loading" ? /* @__PURE__ */ u("span", {
215
+ }) : null, qe = J || (H === "loading" ? /* @__PURE__ */ u("span", {
215
216
  className: "select-skeleton select-modal__subskel",
216
217
  "aria-hidden": "true"
217
- }) : null), Ge = /* @__PURE__ */ d("div", {
218
+ }) : null), Je = /* @__PURE__ */ d("div", {
218
219
  className: "select-modal__header select-modal__header--sheet",
219
- onPointerDown: Pe,
220
- onPointerMove: Fe,
221
- onPointerUp: Ie,
222
- onPointerCancel: Ie,
220
+ onPointerDown: Ie,
221
+ onPointerMove: Le,
222
+ onPointerUp: K,
223
+ onPointerCancel: K,
223
224
  children: [
224
225
  /* @__PURE__ */ u("span", {
225
226
  className: "select-modal__grip",
@@ -231,7 +232,7 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
231
232
  w && /* @__PURE__ */ u("button", {
232
233
  type: "button",
233
234
  className: "select-modal__tool select-modal__back",
234
- "aria-label": we ?? O.common.back,
235
+ "aria-label": Te ?? D.common.back,
235
236
  onClick: w,
236
237
  children: /* @__PURE__ */ u(t, {})
237
238
  }),
@@ -242,13 +243,13 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
242
243
  className: "select-modal__eyebrow",
243
244
  children: m
244
245
  }),
245
- K,
246
- We
246
+ q,
247
+ qe
247
248
  ]
248
249
  }),
249
- ($ || X) && /* @__PURE__ */ d("div", {
250
+ (Ke || Z) && /* @__PURE__ */ d("div", {
250
251
  className: "select-modal__tools",
251
- children: [$, X]
252
+ children: [Ke, Z]
252
253
  })
253
254
  ]
254
255
  }),
@@ -257,17 +258,29 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
257
258
  children: S
258
259
  })
259
260
  ]
260
- }), Ke = /* @__PURE__ */ u("div", {
261
- className: `select select-modal__overlay${x === "side" ? " select-modal__overlay--side" : ""}${be ? " select-modal__overlay--noise" : ""}${Se === "blur" ? " select-modal__overlay--blur" : ""}${A ? " select-modal__overlay--closing" : ""}`,
262
- "data-theme": Ce ?? Ae,
263
- onMouseDown: D ? p : void 0,
261
+ }), Ye = V ? /* @__PURE__ */ u("span", {
262
+ className: "select-modal__grip",
263
+ "aria-hidden": "true"
264
+ }) : null, Xe = V ? {
265
+ onPointerDown: Ie,
266
+ onPointerMove: Le,
267
+ onPointerUp: K,
268
+ onPointerCancel: K
269
+ } : null, Ze = V && !(m || h || g || v) ? /* @__PURE__ */ u("div", {
270
+ className: `${Q} select-modal__header--grip`,
271
+ ...Xe,
272
+ children: Ye
273
+ }) : null, Qe = /* @__PURE__ */ u("div", {
274
+ className: `select select-modal__overlay${x === "side" ? " select-modal__overlay--side" : ""}${V ? " select-modal__overlay--sheet" : ""}${xe ? " select-modal__overlay--noise" : ""}${Ce === "blur" ? " select-modal__overlay--blur" : ""}${k ? " select-modal__overlay--closing" : ""}`,
275
+ "data-theme": we ?? Me,
276
+ onMouseDown: E ? p : void 0,
264
277
  children: /* @__PURE__ */ u("div", {
265
- className: `select-modal select-modal--${ve}${x === "side" ? " select-modal--side" : ""}${Ee ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${A ? " select-modal--closing" : ""}`,
266
- ref: M,
278
+ className: `select-modal select-modal--${ye}${x === "side" ? " select-modal--side" : ""}${V ? " select-modal--sheet" : ""}${Oe ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${k ? " select-modal--closing" : ""}`,
279
+ ref: j,
267
280
  role: "dialog",
268
281
  "aria-modal": "true",
269
- "aria-labelledby": h ? F : void 0,
270
- "aria-describedby": Le,
282
+ "aria-labelledby": h ? P : void 0,
283
+ "aria-describedby": Re,
271
284
  "aria-busy": H === "loading" || void 0,
272
285
  tabIndex: -1,
273
286
  onMouseDown: (e) => e.stopPropagation(),
@@ -277,66 +290,74 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
277
290
  }), /* @__PURE__ */ d("div", {
278
291
  className: "select-modal__content",
279
292
  children: [
280
- X,
293
+ Z,
281
294
  (m || h || g || v) && /* @__PURE__ */ d("div", {
282
- className: Z,
295
+ className: Q,
283
296
  children: [
284
297
  m && /* @__PURE__ */ u("span", {
285
298
  className: "select-modal__eyebrow",
286
299
  children: m
287
300
  }),
288
- K,
289
- q
301
+ q,
302
+ J
290
303
  ]
291
304
  }),
292
305
  /* @__PURE__ */ d("div", {
293
306
  className: "select-modal__body",
294
- children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })]
307
+ children: [X, /* @__PURE__ */ u(i, { children: $ ?? y })]
295
308
  })
296
309
  ]
297
- })] }) : V ? /* @__PURE__ */ d(l, { children: [
298
- Ge,
299
- He,
300
- Ue
310
+ })] }) : B ? /* @__PURE__ */ d(l, { children: [
311
+ Je,
312
+ We,
313
+ Ge
301
314
  ] }) : /* @__PURE__ */ d(l, { children: [
302
- X,
315
+ Z,
303
316
  (m || h || g || v) && (S ? /* @__PURE__ */ d("div", {
304
- className: `${Z} select-modal__header--action`,
305
- children: [/* @__PURE__ */ d("div", {
306
- className: "select-modal__headtext",
307
- children: [
308
- m && /* @__PURE__ */ u("span", {
309
- className: "select-modal__eyebrow",
310
- children: m
311
- }),
312
- K,
313
- q
314
- ]
315
- }), /* @__PURE__ */ u("div", {
316
- className: "select-modal__headaction",
317
- children: S
318
- })]
317
+ className: `${Q} select-modal__header--action`,
318
+ ...Xe,
319
+ children: [
320
+ Ye,
321
+ /* @__PURE__ */ d("div", {
322
+ className: "select-modal__headtext",
323
+ children: [
324
+ m && /* @__PURE__ */ u("span", {
325
+ className: "select-modal__eyebrow",
326
+ children: m
327
+ }),
328
+ q,
329
+ J
330
+ ]
331
+ }),
332
+ /* @__PURE__ */ u("div", {
333
+ className: "select-modal__headaction",
334
+ children: S
335
+ })
336
+ ]
319
337
  }) : /* @__PURE__ */ d("div", {
320
- className: Z,
338
+ className: Q,
339
+ ...Xe,
321
340
  children: [
341
+ Ye,
322
342
  m && /* @__PURE__ */ u("span", {
323
343
  className: "select-modal__eyebrow",
324
344
  children: m
325
345
  }),
326
- K,
327
- q
346
+ q,
347
+ J
328
348
  ]
329
349
  })),
330
- He,
331
- Ue
350
+ Ze,
351
+ We,
352
+ Ge
332
353
  ] })
333
354
  })
334
355
  });
335
- return de(/* @__PURE__ */ u(re, {
336
- value: L,
337
- children: /* @__PURE__ */ u(le, {
356
+ return fe(/* @__PURE__ */ u(re, {
357
+ value: I,
358
+ children: /* @__PURE__ */ u(ue, {
338
359
  level: h ? 3 : 2,
339
- children: Ke
360
+ children: Qe
340
361
  })
341
362
  }), document.body);
342
363
  }
@@ -2,6 +2,8 @@ import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
2
  export interface SegmentedOption {
3
3
  value: string;
4
4
  label: ReactNode;
5
+ /** 0.1.258: o ícone antes do rótulo (fora da leitura: o rótulo diz a opção). */
6
+ icon?: ReactNode;
5
7
  /** Nome acessível quando o `label` é só um ícone — vira `aria-label` + `title`.
6
8
  * Sem ele um segmento icon-only não tem nome nenhum para leitor de tela. */
7
9
  title?: string;
@@ -29,6 +31,11 @@ type SelectSegmentedOwnProps = {
29
31
  semantics?: 'tabs' | 'radio';
30
32
  /** `sm` (0.1.209): o tier pequeno (28px) fora de um `.select-dense` — a linha de um menu, o cabeçalho de um cartão. */
31
33
  size?: 'md' | 'sm';
34
+ /**
35
+ * 0.1.258: `track` (o padrão) é a trilha com a pílula que desliza; `chips`, as fichas soltas com ícone e rótulo, que
36
+ * quebram a linha — e, sem `semantics`, a escolha única de um grupo de rádio.
37
+ */
38
+ variant?: 'track' | 'chips';
32
39
  };
33
40
  export type SelectSegmentedProps = SelectSegmentedOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSegmentedOwnProps>;
34
41
  export declare const SelectSegmented: import('react').ForwardRefExoticComponent<SelectSegmentedOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectSegmentedOwnProps> & import('react').RefAttributes<HTMLDivElement>>;