@selectwin/kit 0.1.229 → 0.1.231

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.
@@ -5,42 +5,43 @@ import { detectSelectTheme as r } from "./detectSelectTheme.js";
5
5
  import { SelectModal as i, SelectModalActions as a } from "./SelectModal.js";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region src/SelectFormModal.tsx
8
- function c({ open: c, onClose: l, onSubmit: u, title: d, subtitle: f, children: p, submitLabel: m, cancelLabel: h, submitting: g = !1, submitDisabled: _ = !1, submitVariant: v = "primary", error: y, size: b = "md", theme: x }) {
9
- let S = t().common, C = m ?? S.save, w = h ?? S.cancel;
8
+ function c({ open: c, onClose: l, onSubmit: u, title: d, subtitle: f, description: p, children: m, submitLabel: h, cancelLabel: g, submitting: _ = !1, submitDisabled: v = !1, submitVariant: y = "primary", error: b, size: x = "md", theme: S }) {
9
+ let C = t().common, w = h ?? C.save, T = g ?? C.cancel;
10
10
  return /* @__PURE__ */ s(i, {
11
11
  open: c,
12
12
  onClose: l,
13
13
  title: d,
14
14
  subtitle: f,
15
- size: b,
16
- theme: x ?? r(),
15
+ description: p,
16
+ size: x,
17
+ theme: S ?? r(),
17
18
  footer: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
18
19
  variant: "secondary",
19
20
  size: "sm",
20
21
  inline: !0,
21
22
  onClick: l,
22
- disabled: g,
23
- children: w
23
+ disabled: _,
24
+ children: T
24
25
  }), /* @__PURE__ */ o(e, {
25
- variant: v,
26
+ variant: y,
26
27
  size: "sm",
27
28
  inline: !0,
28
- loading: g,
29
- disabled: _,
29
+ loading: _,
30
+ disabled: v,
30
31
  onClick: () => u(),
31
- children: C
32
+ children: w
32
33
  })] }),
33
- children: [y != null && y !== !1 && /* @__PURE__ */ o("div", {
34
+ children: [b != null && b !== !1 && /* @__PURE__ */ o("div", {
34
35
  className: "select-formmodal__error",
35
36
  children: /* @__PURE__ */ o(n, {
36
37
  tone: "critical",
37
- children: y
38
+ children: b
38
39
  })
39
40
  }), /* @__PURE__ */ o("form", {
40
41
  onSubmit: (e) => {
41
42
  e.preventDefault(), u();
42
43
  },
43
- children: p
44
+ children: m
44
45
  })]
45
46
  });
46
47
  }
@@ -3,6 +3,8 @@ type SelectKpiBandOwnProps = {
3
3
  children: ReactNode;
4
4
  /** 0.1.210: `dl` para a faixa de números só de leitura (os `SelectKpiCard` viram `<dt>` e `<dd>`). Padrão `div`. */
5
5
  as?: 'div' | 'dl';
6
+ /** 0.1.230: as colunas da faixa (4 → 4/2/1, 3 → 3/1, 2 → 2/1), sem o buraco da grade. Padrão: quebra sozinha. */
7
+ columns?: 2 | 3 | 4;
6
8
  };
7
9
  export type SelectKpiBandProps = SelectKpiBandOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectKpiBandOwnProps>;
8
10
  export declare const SelectKpiBand: import('react').ForwardRefExoticComponent<SelectKpiBandOwnProps & Omit<Omit<import('react').DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectKpiBandOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
@@ -4,21 +4,21 @@ import { KpiListContext as t } from "./internal/kpiList.js";
4
4
  import { forwardRef as n } from "react";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/SelectKpiBand.tsx
7
- var i = n(function({ children: n, as: i = "div", className: a, ...o }, s) {
8
- let c = `select-kpiband${e() ? " select-kpiband--nested" : ""}${a ? " " + a : ""}`;
7
+ var i = n(function({ children: n, as: i = "div", columns: a, className: o, ...s }, c) {
8
+ let l = e(), u = `select-kpiband${l ? " select-kpiband--nested" : ""}${a && !l ? ` select-kpiband--cols-${a}` : ""}${o ? " " + o : ""}`;
9
9
  return i === "dl" ? /* @__PURE__ */ r(t.Provider, {
10
10
  value: !0,
11
11
  children: /* @__PURE__ */ r("dl", {
12
- ref: s,
13
- ...o,
14
- className: c,
12
+ ref: c,
13
+ ...s,
14
+ className: u,
15
15
  children: n
16
16
  })
17
17
  }) : /* @__PURE__ */ r("div", {
18
- ref: s,
18
+ ref: c,
19
19
  role: "group",
20
- ...o,
21
- className: c,
20
+ ...s,
21
+ className: u,
22
22
  children: n
23
23
  });
24
24
  });
@@ -81,6 +81,10 @@ export interface SelectKitMessages {
81
81
  progressLabel: string;
82
82
  progress: (done: string, total: string) => string;
83
83
  };
84
+ /** 0.1.230: os textos dos gráficos — a linha da dica da rosca (`SelectDonut`). */
85
+ chart: {
86
+ value: string;
87
+ };
84
88
  sideNav: {
85
89
  pending: (hint: string) => string;
86
90
  };
@@ -86,6 +86,7 @@ var r = {
86
86
  progressLabel: "Progresso",
87
87
  progress: (e, t) => `${e} de ${t}`
88
88
  },
89
+ chart: { value: "Valor" },
89
90
  sideNav: { pending: (e) => `${e} (com pendências)` },
90
91
  auth: {
91
92
  digit: (e) => `Dígito ${e}`,
@@ -250,6 +251,7 @@ var r = {
250
251
  progressLabel: "Progress",
251
252
  progress: (e, t) => `${e} of ${t}`
252
253
  },
254
+ chart: { value: "Value" },
253
255
  sideNav: { pending: (e) => `${e} (pending)` },
254
256
  auth: {
255
257
  digit: (e) => `Digit ${e}`,
@@ -7,13 +7,18 @@ export declare function SelectModalActions({ children, className }: {
7
7
  children: ReactNode;
8
8
  className?: string;
9
9
  }): import("react").JSX.Element;
10
- export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, badge, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, placement, headerAction, flush, dismissible, }: {
10
+ export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, description, badge, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, placement, headerAction, flush, dismissible, }: {
11
11
  open: boolean;
12
12
  onClose: () => void;
13
13
  /** Uma linha de contexto acima do título ("Passo a passo · ponto 1 de 5"). */
14
14
  eyebrow?: ReactNode;
15
15
  title?: ReactNode;
16
16
  subtitle?: ReactNode;
17
+ /**
18
+ * 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
19
+ * dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa.
20
+ */
21
+ description?: ReactNode;
17
22
  /** 0.1.184: o selo da situação (`SelectBadge`), na linha do subtítulo, antes dele ("Aberto · Chamado · Estorno"). */
18
23
  badge?: ReactNode;
19
24
  children?: ReactNode;
@@ -2,57 +2,57 @@
2
2
  import { CloseIcon as e } from "./icons.js";
3
3
  import { useSelectMessages as t } from "./SelectLocale.js";
4
4
  import { useFocusTrap as n } from "./internal/useFocusTrap.js";
5
- import { LayerProvider as r, isTopLayer as i, openLayer as a, useParentLayer as o } from "./internal/layers.js";
6
- import { FrameBody as s } from "./internal/frame.js";
7
- import { useEffect as c, useId as l, useRef as u, useState as d } from "react";
8
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
- import { createPortal as h } from "react-dom";
5
+ import { LayerProvider as r, isTopLayer as ee, openLayer as i, useParentLayer as a } from "./internal/layers.js";
6
+ import { FrameBody as o } from "./internal/frame.js";
7
+ import { useEffect as s, useId as c, useRef as l, useState as u } from "react";
8
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { createPortal as m } from "react-dom";
10
10
  //#region src/SelectModal.tsx
11
- var g = 220;
12
- function _({ children: e, className: t }) {
13
- return /* @__PURE__ */ p("div", {
11
+ var h = 220;
12
+ function g({ children: e, className: t }) {
13
+ return /* @__PURE__ */ f("div", {
14
14
  className: `select-modal__actions${t ? " " + t : ""}`,
15
15
  children: e
16
16
  });
17
17
  }
18
- function v({ open: _, onClose: v, eyebrow: y, title: b, subtitle: x, badge: S, children: C, footer: w, aside: T, size: E = "md", showClose: D = !0, noise: O = !0, dividedHeader: k = !1, backdrop: A = "dim", theme: j = "light", placement: M = "center", headerAction: N, flush: P = !1, dismissible: F = !0 }) {
19
- let I = t(), [L, R] = d(_), [z, B] = d(!1), V = u(null), H = l(), U = l(), [W] = d(() => ({})), G = o(), K = u({
20
- onClose: v,
21
- dismissible: F
18
+ function _({ open: g, onClose: _, eyebrow: v, title: y, subtitle: b, description: x, badge: S, children: C, footer: w, aside: T, size: E = "md", showClose: D = !0, noise: O = !0, dividedHeader: k = !1, backdrop: te = "dim", theme: ne = "light", placement: A = "center", headerAction: j, flush: M = !1, dismissible: N = !0 }) {
19
+ let P = t(), [F, I] = u(g), [L, R] = u(!1), z = l(null), B = c(), V = c(), H = c(), [U] = u(() => ({})), W = a(), G = l({
20
+ onClose: _,
21
+ dismissible: N
22
22
  });
23
- K.current = {
24
- onClose: v,
25
- dismissible: F
23
+ G.current = {
24
+ onClose: _,
25
+ dismissible: N
26
26
  };
27
- let [q] = d(() => _ && typeof document < "u" ? document.activeElement : null), J = u(null);
28
- c(() => {
29
- if (_) {
30
- if (!J.current) {
27
+ let [K] = u(() => g && typeof document < "u" ? document.activeElement : null), q = l(null);
28
+ s(() => {
29
+ if (g) {
30
+ if (!q.current) {
31
31
  var e;
32
- let t = document.activeElement, n = t instanceof HTMLElement && t !== document.body && !((e = V.current) != null && e.contains(t));
33
- J.current = n ? t : q instanceof HTMLElement && q !== document.body ? q : null;
32
+ let t = document.activeElement, n = t instanceof HTMLElement && t !== document.body && !((e = z.current) != null && e.contains(t));
33
+ q.current = n ? t : K instanceof HTMLElement && K !== document.body ? K : null;
34
34
  }
35
- R(!0), B(!1);
36
- } else if (L) {
35
+ I(!0), R(!1);
36
+ } else if (F) {
37
37
  var t;
38
- B(!0);
39
- let e = J.current;
40
- J.current = null;
38
+ R(!0);
39
+ let e = q.current;
40
+ q.current = null;
41
41
  let n = document.activeElement;
42
- e != null && e.isConnected && (!n || n === document.body || (t = V.current) != null && t.contains(n)) && e.focus({ preventScroll: !0 });
42
+ e != null && e.isConnected && (!n || n === document.body || (t = z.current) != null && t.contains(n)) && e.focus({ preventScroll: !0 });
43
43
  let r = setTimeout(() => {
44
- R(!1), B(!1);
45
- }, g);
44
+ I(!1), R(!1);
45
+ }, h);
46
46
  return () => clearTimeout(r);
47
47
  }
48
48
  }, [
49
- _,
50
- L,
51
- q
52
- ]), c(() => {
53
- if (!L) return;
54
- let e = a(W, G), t = (e) => {
55
- e.key === "Escape" && !e.defaultPrevented && i(W) && K.current.dismissible && K.current.onClose();
49
+ g,
50
+ F,
51
+ K
52
+ ]), s(() => {
53
+ if (!F) return;
54
+ let e = i(U, W), t = (e) => {
55
+ e.key === "Escape" && !e.defaultPrevented && ee(U) && G.current.dismissible && G.current.onClose();
56
56
  };
57
57
  document.addEventListener("keydown", t);
58
58
  let n = document.body.style.overflow;
@@ -60,124 +60,128 @@ function v({ open: _, onClose: v, eyebrow: y, title: b, subtitle: x, badge: S, c
60
60
  e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
61
61
  };
62
62
  }, [
63
- L,
64
- W,
65
- G
63
+ F,
64
+ U,
65
+ W
66
66
  ]);
67
- let Y = L && !z;
68
- if (c(() => {
69
- if (!Y) return;
70
- let e = V.current;
67
+ let J = F && !L;
68
+ if (s(() => {
69
+ if (!J) return;
70
+ let e = z.current;
71
71
  e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
72
- }, [Y]), n(Y, V, { initialFocus: !1 }), !L) return null;
73
- let X = S ? /* @__PURE__ */ m("p", {
74
- id: U,
72
+ }, [J]), n(J, z, { initialFocus: !1 }), !F) return null;
73
+ let Y = S ? /* @__PURE__ */ p("p", {
74
+ id: V,
75
75
  className: "select-modal__subtitle select-modal__subtitle--badge",
76
- children: [S, x ? /* @__PURE__ */ p("span", { children: x }) : null]
77
- }) : x && /* @__PURE__ */ p("p", {
78
- id: U,
76
+ children: [S, b ? /* @__PURE__ */ f("span", { children: b }) : null]
77
+ }) : b && /* @__PURE__ */ f("p", {
78
+ id: V,
79
79
  className: "select-modal__subtitle",
80
+ children: b
81
+ }), X = x != null && x !== !1 && x !== "", Z = X && /* @__PURE__ */ f("p", {
82
+ id: H,
83
+ className: "select-modal__description",
80
84
  children: x
81
- }), Z = D && F && /* @__PURE__ */ p("button", {
85
+ }), re = [b || S ? V : null, X ? H : null].filter(Boolean).join(" ") || void 0, Q = D && N && /* @__PURE__ */ f("button", {
82
86
  type: "button",
83
87
  className: "select-modal__close",
84
- "aria-label": I.common.close,
85
- onClick: v,
86
- children: /* @__PURE__ */ p(e, {})
87
- }), Q = `select-modal__header${k ? " select-modal__header--divided" : ""}`, $ = /* @__PURE__ */ p("div", {
88
- className: `select select-modal__overlay${M === "side" ? " select-modal__overlay--side" : ""}${O ? " select-modal__overlay--noise" : ""}${A === "blur" ? " select-modal__overlay--blur" : ""}${z ? " select-modal__overlay--closing" : ""}`,
89
- "data-theme": j,
90
- onMouseDown: F ? v : void 0,
91
- children: /* @__PURE__ */ p("div", {
92
- className: `select-modal select-modal--${E}${M === "side" ? " select-modal--side" : ""}${P ? " select-modal--flush" : ""}${T ? " select-modal--split" : ""}${z ? " select-modal--closing" : ""}`,
93
- ref: V,
88
+ "aria-label": P.common.close,
89
+ onClick: _,
90
+ children: /* @__PURE__ */ f(e, {})
91
+ }), $ = `select-modal__header${k ? " select-modal__header--divided" : ""}`, ie = /* @__PURE__ */ f("div", {
92
+ className: `select select-modal__overlay${A === "side" ? " select-modal__overlay--side" : ""}${O ? " select-modal__overlay--noise" : ""}${te === "blur" ? " select-modal__overlay--blur" : ""}${L ? " select-modal__overlay--closing" : ""}`,
93
+ "data-theme": ne,
94
+ onMouseDown: N ? _ : void 0,
95
+ children: /* @__PURE__ */ f("div", {
96
+ className: `select-modal select-modal--${E}${A === "side" ? " select-modal--side" : ""}${M ? " select-modal--flush" : ""}${T ? " select-modal--split" : ""}${L ? " select-modal--closing" : ""}`,
97
+ ref: z,
94
98
  role: "dialog",
95
99
  "aria-modal": "true",
96
- "aria-labelledby": b ? H : void 0,
97
- "aria-describedby": x || S ? U : void 0,
100
+ "aria-labelledby": y ? B : void 0,
101
+ "aria-describedby": re,
98
102
  tabIndex: -1,
99
103
  onMouseDown: (e) => e.stopPropagation(),
100
- children: T ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("aside", {
104
+ children: T ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("aside", {
101
105
  className: "select-modal__aside",
102
106
  children: T
103
- }), /* @__PURE__ */ m("div", {
107
+ }), /* @__PURE__ */ p("div", {
104
108
  className: "select-modal__content",
105
109
  children: [
106
- Z,
107
- (y || b || x || S) && /* @__PURE__ */ m("div", {
108
- className: Q,
110
+ Q,
111
+ (v || y || b || S) && /* @__PURE__ */ p("div", {
112
+ className: $,
109
113
  children: [
110
- y && /* @__PURE__ */ p("span", {
114
+ v && /* @__PURE__ */ f("span", {
111
115
  className: "select-modal__eyebrow",
112
- children: y
116
+ children: v
113
117
  }),
114
- b && /* @__PURE__ */ p("h2", {
115
- id: H,
118
+ y && /* @__PURE__ */ f("h2", {
119
+ id: B,
116
120
  className: "select-modal__title",
117
- children: b
121
+ children: y
118
122
  }),
119
- X
123
+ Y
120
124
  ]
121
125
  }),
122
126
  /* @__PURE__ */ p("div", {
123
127
  className: "select-modal__body",
124
- children: /* @__PURE__ */ p(s, { children: C })
128
+ children: [Z, /* @__PURE__ */ f(o, { children: C })]
125
129
  })
126
130
  ]
127
- })] }) : /* @__PURE__ */ m(f, { children: [
128
- Z,
129
- (y || b || x || S) && (N ? /* @__PURE__ */ m("div", {
130
- className: `${Q} select-modal__header--action`,
131
- children: [/* @__PURE__ */ m("div", {
131
+ })] }) : /* @__PURE__ */ p(d, { children: [
132
+ Q,
133
+ (v || y || b || S) && (j ? /* @__PURE__ */ p("div", {
134
+ className: `${$} select-modal__header--action`,
135
+ children: [/* @__PURE__ */ p("div", {
132
136
  className: "select-modal__headtext",
133
137
  children: [
134
- y && /* @__PURE__ */ p("span", {
138
+ v && /* @__PURE__ */ f("span", {
135
139
  className: "select-modal__eyebrow",
136
- children: y
140
+ children: v
137
141
  }),
138
- b && /* @__PURE__ */ p("h2", {
139
- id: H,
142
+ y && /* @__PURE__ */ f("h2", {
143
+ id: B,
140
144
  className: "select-modal__title",
141
- children: b
145
+ children: y
142
146
  }),
143
- X
147
+ Y
144
148
  ]
145
- }), /* @__PURE__ */ p("div", {
149
+ }), /* @__PURE__ */ f("div", {
146
150
  className: "select-modal__headaction",
147
- children: N
151
+ children: j
148
152
  })]
149
- }) : /* @__PURE__ */ m("div", {
150
- className: Q,
153
+ }) : /* @__PURE__ */ p("div", {
154
+ className: $,
151
155
  children: [
152
- y && /* @__PURE__ */ p("span", {
156
+ v && /* @__PURE__ */ f("span", {
153
157
  className: "select-modal__eyebrow",
154
- children: y
158
+ children: v
155
159
  }),
156
- b && /* @__PURE__ */ p("h2", {
157
- id: H,
160
+ y && /* @__PURE__ */ f("h2", {
161
+ id: B,
158
162
  className: "select-modal__title",
159
- children: b
163
+ children: y
160
164
  }),
161
- X
165
+ Y
162
166
  ]
163
167
  })),
164
- C && /* @__PURE__ */ p("div", {
168
+ (C || X) && /* @__PURE__ */ p("div", {
165
169
  className: "select-modal__body",
166
- children: /* @__PURE__ */ p(s, { children: C })
170
+ children: [Z, /* @__PURE__ */ f(o, { children: C })]
167
171
  }),
168
- w && /* @__PURE__ */ p("div", {
172
+ w && /* @__PURE__ */ f("div", {
169
173
  className: "select-modal__footer",
170
174
  children: w
171
175
  })
172
176
  ] })
173
177
  })
174
178
  });
175
- return h(/* @__PURE__ */ p(r, {
176
- value: W,
177
- children: $
179
+ return m(/* @__PURE__ */ f(r, {
180
+ value: U,
181
+ children: ie
178
182
  }), document.body);
179
183
  }
180
184
  //#endregion
181
- export { v as SelectModal, _ as SelectModalActions };
185
+ export { _ as SelectModal, g as SelectModalActions };
182
186
 
183
187
  //# sourceMappingURL=SelectModal.js.map
@@ -42,6 +42,11 @@ type SelectSetupGuideOwnProps = {
42
42
  minimized?: boolean;
43
43
  /** Cor da barra — `sandbox` quando o guia acompanha o ambiente de teste. */
44
44
  tone?: 'default' | 'sandbox';
45
+ /**
46
+ * 0.1.230: `strip` = o guia numa linha — o anel do progresso no começo (no lugar da barra), o título e o texto no meio,
47
+ * as ações no fim. Com `minimized`, só a linha; aberto, as etapas embaixo dela.
48
+ */
49
+ variant?: 'default' | 'strip';
45
50
  };
46
51
  export type SelectSetupGuideProps = SelectSetupGuideOwnProps & Omit<ComponentPropsWithoutRef<'section'>, keyof SelectSetupGuideOwnProps>;
47
52
  export declare const SelectSetupGuide: import('react').ForwardRefExoticComponent<SelectSetupGuideOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, keyof SelectSetupGuideOwnProps> & import('react').RefAttributes<HTMLElement>>;