@selectwin/kit 0.1.247 → 0.1.249

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.
@@ -6,14 +6,16 @@ import { SelectInfoTip as ee } from "./SelectInfoTip.js";
6
6
  import { SelectAlert as te } from "./SelectAlert.js";
7
7
  import { useFocusTrap as ne } from "./internal/useFocusTrap.js";
8
8
  import { LayerProvider as re, isTopLayer as ie, openLayer as ae, useParentLayer as oe } from "./internal/layers.js";
9
- import { sheetBands as se } from "./internal/sheetBands.js";
9
+ import { detectSelectTheme as se } from "./detectSelectTheme.js";
10
+ import { sheetBands as ce } from "./internal/sheetBands.js";
10
11
  import { FrameBody as i } from "./internal/frame.js";
11
- import { isDevBuild as ce } from "./internal/dev.js";
12
+ import { HeadingScope as le } from "./internal/headingLevel.js";
13
+ import { isDevBuild as ue } from "./internal/dev.js";
12
14
  import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
13
15
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
14
- import { createPortal as le } from "react-dom";
16
+ import { createPortal as de } from "react-dom";
15
17
  //#region src/SelectModal.tsx
16
- var ue = 220, f = "(max-width: 40rem)", de = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, fe = 64, pe = 120;
18
+ var fe = 220, f = "(max-width: 40rem)", pe = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, me = 64, he = 120;
17
19
  function p({ children: e, className: t, destructive: n }) {
18
20
  return /* @__PURE__ */ d("div", {
19
21
  className: `select-modal__actions${t ? " " + t : ""}`,
@@ -23,26 +25,26 @@ function p({ children: e, className: t, destructive: n }) {
23
25
  }), e]
24
26
  });
25
27
  }
26
- function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help: me, children: y, footer: he, aside: b, size: ge = "md", showClose: _e = !0, noise: ve = !0, dividedHeader: ye = !1, backdrop: be = "dim", theme: xe = "light", placement: x = "center", headerAction: S, menu: C, onBack: w, backLabel: Se, loading: Ce = !1, error: T, onRetry: we, flush: Te = !1, dismissible: E = !0 }) {
27
- let D = r(), [O, k] = c(f), [A, j] = c(!1), M = s(null), N = s(null), P = s(null), F = o(), I = o(), Ee = o(), [L] = c(() => ({})), De = oe(), R = s({
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({
28
30
  onClose: p,
29
- dismissible: E
31
+ dismissible: D
30
32
  });
31
33
  R.current = {
32
34
  onClose: p,
33
- dismissible: E
35
+ dismissible: D
34
36
  };
35
- let [z] = c(() => f && typeof document < "u" ? document.activeElement : null), B = s(null), V = x === "side" && !b, H = Ce ? "loading" : T != null && T !== !1 && T !== "" ? "error" : "ready", U = V && w != null;
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;
36
38
  a(() => {
37
39
  if (f) {
38
40
  var e;
39
41
  if (!B.current) {
40
42
  var t;
41
43
  let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t = M.current) != null && t.contains(e));
42
- B.current = n ? e : z instanceof HTMLElement && z !== document.body ? z : null;
44
+ B.current = n ? e : z instanceof HTMLElement && z !== document.body ? z : null, je(se(B.current));
43
45
  }
44
- (e = M.current) == null || e.style.removeProperty("transform"), k(!0), j(!1);
45
- } else if (O) {
46
+ (e = M.current) == null || e.style.removeProperty("transform"), De(!0), j(!1);
47
+ } else if (k) {
46
48
  var n;
47
49
  j(!0);
48
50
  let e = B.current;
@@ -50,17 +52,17 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
50
52
  let t = document.activeElement;
51
53
  e != null && e.isConnected && (!t || t === document.body || (n = M.current) != null && n.contains(t)) && e.focus({ preventScroll: !0 });
52
54
  let r = setTimeout(() => {
53
- k(!1), j(!1);
54
- }, ue);
55
+ De(!1), j(!1);
56
+ }, fe);
55
57
  return () => clearTimeout(r);
56
58
  }
57
59
  }, [
58
60
  f,
59
- O,
61
+ k,
60
62
  z
61
63
  ]), a(() => {
62
- if (!O) return;
63
- let e = ae(L, De), t = (e) => {
64
+ if (!k) return;
65
+ let e = ae(L, ke), t = (e) => {
64
66
  e.key === "Escape" && !e.defaultPrevented && ie(L) && R.current.dismissible && R.current.onClose();
65
67
  };
66
68
  document.addEventListener("keydown", t);
@@ -69,31 +71,31 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
69
71
  e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
70
72
  };
71
73
  }, [
72
- O,
74
+ k,
73
75
  L,
74
- De
76
+ ke
75
77
  ]);
76
- let W = O && !A;
78
+ let W = k && !A;
77
79
  a(() => {
78
80
  if (!W) return;
79
81
  let e = M.current;
80
82
  e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
81
83
  }, [W]), ne(W, M, { initialFocus: !1 });
82
- let Oe = s(U);
84
+ let Me = s(U);
83
85
  a(() => {
84
- if (Oe.current === U) return;
85
- Oe.current = U, N.current && (N.current.scrollTop = 0);
86
+ if (Me.current === U) return;
87
+ Me.current = U, N.current && (N.current.scrollTop = 0);
86
88
  let e = M.current, t = document.activeElement;
87
89
  e && (!t || t === document.body || !e.contains(t)) && e.focus({ preventScroll: !0 });
88
90
  }, [U]);
89
- let ke = s(!1);
91
+ let Ne = s(!1);
90
92
  a(() => {
91
- if (!V || ke.current || !P.current || !ce()) return;
93
+ if (!V || Ne.current || !P.current || !ue()) return;
92
94
  let e = P.current.querySelectorAll(".select-btn--primary").length;
93
- e > 1 && (ke.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).`));
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
96
  });
95
- let G = s(null), Ae = (e) => {
96
- if (E && e.button === 0 && de() && !e.target.closest("button, a, input, select, textarea, [role=\"button\"], .select-modal__headaction")) {
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")) {
97
99
  G.current = {
98
100
  id: e.pointerId,
99
101
  y: e.clientY,
@@ -104,21 +106,21 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
104
106
  (t = (n = e.currentTarget).setPointerCapture) == null || t.call(n, e.pointerId);
105
107
  } catch {}
106
108
  }
107
- }, je = (e) => {
109
+ }, Fe = (e) => {
108
110
  let t = G.current, n = M.current;
109
111
  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"));
110
- }, Me = (e) => {
112
+ }, Ie = (e) => {
111
113
  let t = G.current;
112
114
  if (!t || e.pointerId !== t.id) return;
113
115
  G.current = null;
114
116
  let n = M.current;
115
117
  if (!n) return;
116
118
  delete n.dataset.dragging;
117
- let r = Math.max(fe, Math.min(pe, n.offsetHeight * .25));
119
+ let r = Math.max(me, Math.min(he, n.offsetHeight * .25));
118
120
  e.type === "pointerup" && t.dy > r && R.current.dismissible ? R.current.onClose() : n.style.removeProperty("transform");
119
121
  };
120
- if (!O) return null;
121
- let K = h && (me == null ? /* @__PURE__ */ u("h2", {
122
+ if (!k) return null;
123
+ let K = h && (ge == null ? /* @__PURE__ */ u("h2", {
122
124
  id: F,
123
125
  className: "select-modal__title",
124
126
  children: h
@@ -128,7 +130,7 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
128
130
  id: F,
129
131
  className: "select-modal__title",
130
132
  children: h
131
- }), /* @__PURE__ */ u(ee, { content: me })]
133
+ }), /* @__PURE__ */ u(ee, { content: ge })]
132
134
  })), q = v ? /* @__PURE__ */ d("p", {
133
135
  id: I,
134
136
  className: "select-modal__subtitle select-modal__subtitle--badge",
@@ -138,16 +140,16 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
138
140
  className: "select-modal__subtitle",
139
141
  children: g
140
142
  }), J = _ != null && _ !== !1 && _ !== "", Y = J && /* @__PURE__ */ u("p", {
141
- id: Ee,
143
+ id: Oe,
142
144
  className: "select-modal__description",
143
145
  children: _
144
- }), Ne = [g || v ? I : null, J ? Ee : null].filter(Boolean).join(" ") || void 0, X = _e && E && /* @__PURE__ */ u("button", {
146
+ }), Le = [g || v ? I : null, J ? Oe : null].filter(Boolean).join(" ") || void 0, X = ye && D && /* @__PURE__ */ u("button", {
145
147
  type: "button",
146
148
  className: `select-modal__close${V ? " select-modal__tool" : ""}`,
147
- "aria-label": D.common.close,
149
+ "aria-label": O.common.close,
148
150
  onClick: p,
149
151
  children: /* @__PURE__ */ u(n, {})
150
- }), Z = `select-modal__header${ye ? " select-modal__header--divided" : ""}`, Pe = (e) => [
152
+ }), Z = `select-modal__header${xe ? " select-modal__header--divided" : ""}`, Re = (e) => [
151
153
  0,
152
154
  1,
153
155
  2
@@ -164,12 +166,12 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
164
166
  /* @__PURE__ */ u("span", {
165
167
  className: "select-modal__skelrows",
166
168
  "aria-hidden": "true",
167
- children: Pe(!1)
169
+ children: Re(!1)
168
170
  }),
169
171
  /* @__PURE__ */ u("span", {
170
172
  className: "select-visually-hidden",
171
173
  role: "status",
172
- children: D.common.loading
174
+ children: O.common.loading
173
175
  })
174
176
  ]
175
177
  }, "skel-facts"), /* @__PURE__ */ d("div", {
@@ -177,47 +179,47 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
177
179
  "aria-hidden": "true",
178
180
  children: [/* @__PURE__ */ u("span", { className: "select-skeleton select-modal__skelhead" }), /* @__PURE__ */ u("span", {
179
181
  className: "select-modal__skelrows",
180
- children: Pe(!0)
182
+ children: Re(!0)
181
183
  })]
182
184
  }, "skel-steps")] : H === "error" ? [/* @__PURE__ */ u(te, {
183
185
  tone: "critical",
184
- action: we ? /* @__PURE__ */ u(e, {
186
+ action: E ? /* @__PURE__ */ u(e, {
185
187
  variant: "secondary",
186
188
  size: "sm",
187
189
  inline: !0,
188
- onClick: we,
189
- children: D.modal.retry
190
+ onClick: E,
191
+ children: O.modal.retry
190
192
  }) : void 0,
191
- children: T === !0 ? D.modal.loadFailed : T
192
- }, "error")] : null, Fe = !!y || J || H !== "ready", Ie = !!he && H === "ready", Le = V && !Te ? Q ? Q.map((e, t) => ({
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) => ({
193
195
  key: `state-${t}`,
194
196
  node: e
195
- })) : se(y) : null, Re = Fe && /* @__PURE__ */ u("div", {
197
+ })) : ce(y) : null, He = ze && /* @__PURE__ */ u("div", {
196
198
  className: "select-modal__body",
197
199
  ref: N,
198
- children: Le ? /* @__PURE__ */ d(l, { children: [Y && /* @__PURE__ */ u("div", {
200
+ children: Ve ? /* @__PURE__ */ d(l, { children: [Y && /* @__PURE__ */ u("div", {
199
201
  className: "select-modal__band",
200
202
  children: Y
201
- }), /* @__PURE__ */ u(i, { children: Le.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
203
+ }), /* @__PURE__ */ u(i, { children: Ve.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
202
204
  className: "select-modal__band",
203
205
  children: t
204
206
  }, e)) })] }) : /* @__PURE__ */ d(l, { children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })] })
205
- }), ze = Ie && /* @__PURE__ */ u("div", {
207
+ }), Ue = Be && /* @__PURE__ */ u("div", {
206
208
  className: "select-modal__footer",
207
209
  ref: P,
208
- children: he
210
+ children: _e
209
211
  }), $ = V && C != null && C !== !1 && H === "ready" ? /* @__PURE__ */ u("span", {
210
212
  className: "select-modal__menu",
211
213
  children: C
212
- }) : null, Be = q || (H === "loading" ? /* @__PURE__ */ u("span", {
214
+ }) : null, We = q || (H === "loading" ? /* @__PURE__ */ u("span", {
213
215
  className: "select-skeleton select-modal__subskel",
214
216
  "aria-hidden": "true"
215
- }) : null), Ve = /* @__PURE__ */ d("div", {
217
+ }) : null), Ge = /* @__PURE__ */ d("div", {
216
218
  className: "select-modal__header select-modal__header--sheet",
217
- onPointerDown: Ae,
218
- onPointerMove: je,
219
- onPointerUp: Me,
220
- onPointerCancel: Me,
219
+ onPointerDown: Pe,
220
+ onPointerMove: Fe,
221
+ onPointerUp: Ie,
222
+ onPointerCancel: Ie,
221
223
  children: [
222
224
  /* @__PURE__ */ u("span", {
223
225
  className: "select-modal__grip",
@@ -229,7 +231,7 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
229
231
  w && /* @__PURE__ */ u("button", {
230
232
  type: "button",
231
233
  className: "select-modal__tool select-modal__back",
232
- "aria-label": Se ?? D.common.back,
234
+ "aria-label": we ?? O.common.back,
233
235
  onClick: w,
234
236
  children: /* @__PURE__ */ u(t, {})
235
237
  }),
@@ -241,7 +243,7 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
241
243
  children: m
242
244
  }),
243
245
  K,
244
- Be
246
+ We
245
247
  ]
246
248
  }),
247
249
  ($ || X) && /* @__PURE__ */ d("div", {
@@ -255,17 +257,17 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
255
257
  children: S
256
258
  })
257
259
  ]
258
- }), He = /* @__PURE__ */ u("div", {
259
- className: `select select-modal__overlay${x === "side" ? " select-modal__overlay--side" : ""}${ve ? " select-modal__overlay--noise" : ""}${be === "blur" ? " select-modal__overlay--blur" : ""}${A ? " select-modal__overlay--closing" : ""}`,
260
- "data-theme": xe,
261
- onMouseDown: E ? p : void 0,
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,
262
264
  children: /* @__PURE__ */ u("div", {
263
- className: `select-modal select-modal--${ge}${x === "side" ? " select-modal--side" : ""}${Te ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${A ? " select-modal--closing" : ""}`,
265
+ className: `select-modal select-modal--${ve}${x === "side" ? " select-modal--side" : ""}${Ee ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${A ? " select-modal--closing" : ""}`,
264
266
  ref: M,
265
267
  role: "dialog",
266
268
  "aria-modal": "true",
267
269
  "aria-labelledby": h ? F : void 0,
268
- "aria-describedby": Ne,
270
+ "aria-describedby": Le,
269
271
  "aria-busy": H === "loading" || void 0,
270
272
  tabIndex: -1,
271
273
  onMouseDown: (e) => e.stopPropagation(),
@@ -293,9 +295,9 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
293
295
  })
294
296
  ]
295
297
  })] }) : V ? /* @__PURE__ */ d(l, { children: [
296
- Ve,
297
- Re,
298
- ze
298
+ Ge,
299
+ He,
300
+ Ue
299
301
  ] }) : /* @__PURE__ */ d(l, { children: [
300
302
  X,
301
303
  (m || h || g || v) && (S ? /* @__PURE__ */ d("div", {
@@ -325,14 +327,17 @@ function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description
325
327
  q
326
328
  ]
327
329
  })),
328
- Re,
329
- ze
330
+ He,
331
+ Ue
330
332
  ] })
331
333
  })
332
334
  });
333
- return le(/* @__PURE__ */ u(re, {
335
+ return de(/* @__PURE__ */ u(re, {
334
336
  value: L,
335
- children: He
337
+ children: /* @__PURE__ */ u(le, {
338
+ level: h ? 3 : 2,
339
+ children: Ke
340
+ })
336
341
  }), document.body);
337
342
  }
338
343
  //#endregion
@@ -21,6 +21,8 @@ export type SelectRetryStatusProps = {
21
21
  firstLabel?: ReactNode;
22
22
  /** Caption once it worked. */
23
23
  doneCaption?: ReactNode;
24
+ /** 0.1.249: uma linha só — o anel (esperando e tentando) ou o visto, a frase e a ação; sem a barra e a legenda. */
25
+ compact?: boolean;
24
26
  className?: string;
25
27
  };
26
- export declare function SelectRetryStatus({ phase, nextAttemptAt, waitMs, attempt, mark, action, waitingLabel, tryingLabel, doneLabel, attemptLabel, firstLabel, doneCaption, className, }: SelectRetryStatusProps): import("react").JSX.Element;
28
+ export declare function SelectRetryStatus({ phase, nextAttemptAt, waitMs, attempt, mark, action, compact, waitingLabel, tryingLabel, doneLabel, attemptLabel, firstLabel, doneCaption, className, }: SelectRetryStatusProps): import("react").JSX.Element;
@@ -5,72 +5,71 @@ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  function o(e) {
6
6
  return e ? Math.max(0, Math.ceil((e - Date.now()) / 1e3)) : 0;
7
7
  }
8
- function s({ phase: s, nextAttemptAt: c, waitMs: l, attempt: u = 0, mark: d, action: f, waitingLabel: p = (e) => /* @__PURE__ */ a(r, { children: ["Nova tentativa em ", /* @__PURE__ */ a("span", {
8
+ function s({ phase: s, nextAttemptAt: c, waitMs: l, attempt: u = 0, mark: d, action: f, compact: p = !1, waitingLabel: m = p ? (e) => /* @__PURE__ */ a(r, { children: ["Tentando de novo em ", /* @__PURE__ */ a("span", {
9
+ className: "select-retry__num",
10
+ children: [e, " s"]
11
+ })] }) : (e) => /* @__PURE__ */ a(r, { children: ["Nova tentativa em ", /* @__PURE__ */ a("span", {
9
12
  className: "select-retry__num",
10
13
  children: [e, "s"]
11
- })] }), tryingLabel: m = "Reconectando…", doneLabel: h = "Conexão restabelecida", attemptLabel: g = (e) => e === 1 ? "1 tentativa sem resposta" : `${e} tentativas sem resposta`, firstLabel: _ = "Primeira tentativa a caminho", doneCaption: v = "Atualizando seus dados", className: y }) {
12
- let [b, x] = n(() => o(c));
14
+ })] }), tryingLabel: h = p ? "Tentando conectar…" : "Reconectando…", doneLabel: g = "Conexão restabelecida", attemptLabel: _ = (e) => e === 1 ? "1 tentativa sem resposta" : `${e} tentativas sem resposta`, firstLabel: v = "Primeira tentativa a caminho", doneCaption: y = "Atualizando seus dados", className: b }) {
15
+ let [x, S] = n(() => o(c));
13
16
  t(() => {
14
- if (x(o(c)), s !== "waiting" || !c) return;
15
- let e = setInterval(() => x(o(c)), 250);
17
+ if (S(o(c)), s !== "waiting" || !c) return;
18
+ let e = setInterval(() => S(o(c)), 250);
16
19
  return () => clearInterval(e);
17
20
  }, [s, c]);
18
- let S;
21
+ let C;
19
22
  if (s === "waiting" && c && l) {
20
23
  let e = Math.max(0, c - Date.now());
21
- S = {
24
+ C = {
22
25
  "--select-retry-from": String(Math.min(1, e / l)),
23
26
  animationDuration: `${e}ms`
24
27
  };
25
28
  }
26
29
  return /* @__PURE__ */ a("div", {
27
- className: `select-retry select-retry--${s}${y ? " " + y : ""}`,
28
- children: [
29
- /* @__PURE__ */ a("div", {
30
- className: "select-retry__line",
31
- role: "status",
32
- "aria-live": "polite",
33
- children: [
34
- s === "waiting" && /* @__PURE__ */ i("span", {
35
- className: "select-retry__dot",
36
- "aria-hidden": "true"
37
- }),
38
- s === "trying" && (d == null ? /* @__PURE__ */ i("span", {
39
- className: "select-retry__spinner",
40
- "aria-hidden": "true"
41
- }) : /* @__PURE__ */ i("span", {
42
- className: "select-retry__mark",
43
- "aria-hidden": "true",
44
- children: d
45
- })),
46
- s === "done" && /* @__PURE__ */ i("span", {
47
- className: "select-retry__check",
48
- "aria-hidden": "true",
49
- children: /* @__PURE__ */ i(e, {})
50
- }),
51
- /* @__PURE__ */ i("span", {
52
- className: "select-retry__label",
53
- children: s === "waiting" ? p(b) : s === "trying" ? m : h
54
- }),
55
- s === "waiting" && f != null && /* @__PURE__ */ i("span", {
56
- className: "select-retry__action",
57
- children: f
58
- })
59
- ]
60
- }),
61
- /* @__PURE__ */ i("div", {
62
- className: "select-retry__track",
63
- "aria-hidden": "true",
64
- children: /* @__PURE__ */ i("div", {
65
- className: "select-retry__fill",
66
- style: S
67
- }, c ?? s)
68
- }),
69
- /* @__PURE__ */ i("p", {
70
- className: "select-retry__caption",
71
- children: s === "done" ? v : u > 0 ? g(u) : _
72
- })
73
- ]
30
+ className: `select-retry select-retry--${s}${p ? " select-retry--compact" : ""}${b ? " " + b : ""}`,
31
+ children: [/* @__PURE__ */ a("div", {
32
+ className: "select-retry__line",
33
+ role: "status",
34
+ "aria-live": "polite",
35
+ children: [
36
+ s === "waiting" && !p && /* @__PURE__ */ i("span", {
37
+ className: "select-retry__dot",
38
+ "aria-hidden": "true"
39
+ }),
40
+ (s === "trying" || p && s === "waiting") && (d == null ? /* @__PURE__ */ i("span", {
41
+ className: "select-retry__spinner",
42
+ "aria-hidden": "true"
43
+ }) : /* @__PURE__ */ i("span", {
44
+ className: "select-retry__mark",
45
+ "aria-hidden": "true",
46
+ children: d
47
+ })),
48
+ s === "done" && /* @__PURE__ */ i("span", {
49
+ className: "select-retry__check",
50
+ "aria-hidden": "true",
51
+ children: /* @__PURE__ */ i(e, {})
52
+ }),
53
+ /* @__PURE__ */ i("span", {
54
+ className: "select-retry__label",
55
+ children: s === "waiting" ? m(x) : s === "trying" ? h : g
56
+ }),
57
+ s === "waiting" && f != null && /* @__PURE__ */ i("span", {
58
+ className: "select-retry__action",
59
+ children: f
60
+ })
61
+ ]
62
+ }), p ? null : /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("div", {
63
+ className: "select-retry__track",
64
+ "aria-hidden": "true",
65
+ children: /* @__PURE__ */ i("div", {
66
+ className: "select-retry__fill",
67
+ style: C
68
+ }, c ?? s)
69
+ }), /* @__PURE__ */ i("p", {
70
+ className: "select-retry__caption",
71
+ children: s === "done" ? y : u > 0 ? _(u) : v
72
+ })] })]
74
73
  });
75
74
  }
76
75
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
+ import { SelectHeadingLevel } from './internal/headingLevel';
2
3
  type SelectSectionOwnProps = {
3
4
  title?: ReactNode;
4
5
  /** Ajuda contextual: vira o "!" ao lado do título (SelectInfoTip). IGNORADA quando
@@ -36,6 +37,12 @@ type SelectSectionOwnProps = {
36
37
  * a tabela com o cabeçalho na moldura e as linhas na caixa branca dela. Sem tabela no corpo, a caixa branca volta.
37
38
  */
38
39
  list?: boolean;
40
+ /**
41
+ * O nível do título (`2` = `<h2>`, até `6`). Sem ele, o kit conta: `<h2>` na página, um nível abaixo no corpo de outra
42
+ * seção ou de um modal com título. Passe quando a página tem uma hierarquia própria (o herói de um site com o `<h1>`
43
+ * dele já conta, mas uma faixa titulada à mão no meio, não).
44
+ */
45
+ headingLevel?: SelectHeadingLevel;
39
46
  children: ReactNode;
40
47
  };
41
48
  export type SelectSectionProps = SelectSectionOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSectionOwnProps>;