@selectwin/kit 0.1.228 → 0.1.230

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.
@@ -16,7 +16,12 @@ type SelectCarouselOwnProps = {
16
16
  label?: string;
17
17
  /** De quanto em quanto tempo passa sozinho, em ms (padrão 7000). */
18
18
  interval?: number;
19
+ /**
20
+ * 0.1.230: o carrossel ocupa a largura de quem o contém (a coluna de uma grade), sem o teto de 20rem do destaque do
21
+ * cabeçalho.
22
+ */
23
+ fluid?: boolean;
19
24
  };
20
25
  export type SelectCarouselProps = SelectCarouselOwnProps & Omit<ComponentPropsWithoutRef<'section'>, keyof SelectCarouselOwnProps>;
21
- export declare function SelectCarousel({ slides, label, interval, className, ...rest }: SelectCarouselProps): import("react").JSX.Element | null;
26
+ export declare function SelectCarousel({ slides, label, interval, fluid, className, ...rest }: SelectCarouselProps): import("react").JSX.Element | null;
22
27
  export {};
@@ -7,56 +7,56 @@ import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  import { Link as m } from "react-router-dom";
8
8
  //#region src/SelectCarousel.tsx
9
9
  var h = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
10
- function g({ slides: g, label: _, interval: v = 7e3, className: y, ...b }) {
11
- let x = c().carousel, S = s(), C = g.length, [w, T] = d(0), [E, D] = d(!1), [O, k] = d(() => !h()), [A, j] = d(!1), M = u(null), N = Math.min(w, Math.max(0, C - 1)), P = O && !A && C > 1;
10
+ function g({ slides: g, label: _, interval: v = 7e3, fluid: y = !1, className: b, ...x }) {
11
+ let S = c().carousel, C = s(), w = g.length, [T, E] = d(0), [D, O] = d(!1), [k, A] = d(() => !h()), [j, M] = d(!1), N = u(null), P = Math.min(T, Math.max(0, w - 1)), F = k && !j && w > 1;
12
12
  l(() => {
13
- if (!P) return;
13
+ if (!F) return;
14
14
  let e = window.setTimeout(() => {
15
- D(!1), T((e) => (e + 1) % C);
15
+ O(!1), E((e) => (e + 1) % w);
16
16
  }, v);
17
17
  return () => window.clearTimeout(e);
18
18
  }, [
19
- P,
20
- C,
19
+ F,
21
20
  w,
21
+ T,
22
22
  v
23
23
  ]);
24
- let F = (e) => {
25
- D(e < N), T((e % C + C) % C);
26
- }, I = g[N];
27
- if (!I) return null;
28
- let L = e(I.to ?? I.href), R = L === void 0 ? null : I.to == null ? /* @__PURE__ */ f("a", {
29
- href: L,
24
+ let I = (e) => {
25
+ O(e < P), E((e % w + w) % w);
26
+ }, L = g[P];
27
+ if (!L) return null;
28
+ let R = e(L.to ?? L.href), z = R === void 0 ? null : L.to == null ? /* @__PURE__ */ f("a", {
29
+ href: R,
30
30
  className: "select-carousel__go",
31
- "aria-label": x.open(I.title),
31
+ "aria-label": S.open(L.title),
32
32
  children: /* @__PURE__ */ f(t, {})
33
33
  }) : /* @__PURE__ */ f(m, {
34
- to: L,
34
+ to: R,
35
35
  className: "select-carousel__go",
36
- "aria-label": x.open(I.title),
36
+ "aria-label": S.open(L.title),
37
37
  children: /* @__PURE__ */ f(t, {})
38
38
  });
39
39
  return /* @__PURE__ */ p("section", {
40
- ...b,
41
- className: `select-carousel${y ? " " + y : ""}`,
42
- "aria-roledescription": x.carousel,
43
- "aria-label": _ ?? x.label,
44
- onMouseEnter: () => j(!0),
45
- onMouseLeave: () => j(!1),
46
- onFocus: () => j(!0),
40
+ ...x,
41
+ className: `select-carousel${y ? " select-carousel--fluid" : ""}${b ? " " + b : ""}`,
42
+ "aria-roledescription": S.carousel,
43
+ "aria-label": _ ?? S.label,
44
+ onMouseEnter: () => M(!0),
45
+ onMouseLeave: () => M(!1),
46
+ onFocus: () => M(!0),
47
47
  onBlur: (e) => {
48
- e.currentTarget.contains(e.relatedTarget) || j(!1);
48
+ e.currentTarget.contains(e.relatedTarget) || M(!1);
49
49
  },
50
50
  onKeyDown: (e) => {
51
- C < 2 || e.key !== "ArrowRight" && e.key !== "ArrowLeft" || (e.preventDefault(), F(N + (e.key === "ArrowRight" ? 1 : -1)));
51
+ w < 2 || e.key !== "ArrowRight" && e.key !== "ArrowLeft" || (e.preventDefault(), I(P + (e.key === "ArrowRight" ? 1 : -1)));
52
52
  },
53
53
  onPointerDown: (e) => {
54
- e.pointerType !== "mouse" && (M.current = e.clientX);
54
+ e.pointerType !== "mouse" && (N.current = e.clientX);
55
55
  },
56
56
  onPointerUp: (e) => {
57
- if (M.current === null) return;
58
- let t = e.clientX - M.current;
59
- M.current = null, C > 1 && Math.abs(t) > 40 && F(N + (t < 0 ? 1 : -1));
57
+ if (N.current === null) return;
58
+ let t = e.clientX - N.current;
59
+ N.current = null, w > 1 && Math.abs(t) > 40 && I(P + (t < 0 ? 1 : -1));
60
60
  },
61
61
  children: [
62
62
  /* @__PURE__ */ f("span", {
@@ -71,30 +71,30 @@ function g({ slides: g, label: _, interval: v = 7e3, className: y, ...b }) {
71
71
  className: "select-carousel__card",
72
72
  children: [/* @__PURE__ */ f("div", {
73
73
  className: "select-carousel__slides",
74
- "aria-live": P ? "off" : "polite",
74
+ "aria-live": F ? "off" : "polite",
75
75
  children: /* @__PURE__ */ p("div", {
76
- className: `select-carousel__slide${E ? " is-back" : ""}`,
76
+ className: `select-carousel__slide${D ? " is-back" : ""}`,
77
77
  role: "group",
78
- "aria-roledescription": x.slide,
79
- "aria-label": x.position(o(N + 1, S), o(C, S)),
78
+ "aria-roledescription": S.slide,
79
+ "aria-label": S.position(o(P + 1, C), o(w, C)),
80
80
  children: [/* @__PURE__ */ p("span", {
81
81
  className: "select-carousel__head",
82
- children: [/* @__PURE__ */ f("span", { children: I.title }), R]
82
+ children: [/* @__PURE__ */ f("span", { children: L.title }), z]
83
83
  }), /* @__PURE__ */ f("span", {
84
84
  className: "select-carousel__text",
85
- children: I.text
85
+ children: L.text
86
86
  })]
87
- }, I.key)
88
- }), C > 1 && /* @__PURE__ */ p("div", {
87
+ }, L.key)
88
+ }), w > 1 && /* @__PURE__ */ p("div", {
89
89
  className: "select-carousel__nav",
90
90
  children: [/* @__PURE__ */ f("span", {
91
91
  className: "select-carousel__dots",
92
92
  children: g.map((e, t) => /* @__PURE__ */ f("button", {
93
93
  type: "button",
94
94
  className: "select-carousel__dot",
95
- "aria-label": `${o(t + 1, S)}: ${e.title}`,
96
- "aria-current": t === N ? "true" : void 0,
97
- onClick: () => F(t)
95
+ "aria-label": `${o(t + 1, C)}: ${e.title}`,
96
+ "aria-current": t === P ? "true" : void 0,
97
+ onClick: () => I(t)
98
98
  }, e.key))
99
99
  }), /* @__PURE__ */ p("span", {
100
100
  className: "select-carousel__ctrl",
@@ -102,22 +102,22 @@ function g({ slides: g, label: _, interval: v = 7e3, className: y, ...b }) {
102
102
  /* @__PURE__ */ f("button", {
103
103
  type: "button",
104
104
  className: "select-carousel__btn",
105
- "aria-label": x.previous,
106
- onClick: () => F(N - 1),
105
+ "aria-label": S.previous,
106
+ onClick: () => I(P - 1),
107
107
  children: /* @__PURE__ */ f(n, {})
108
108
  }),
109
109
  /* @__PURE__ */ f("button", {
110
110
  type: "button",
111
111
  className: "select-carousel__btn",
112
- "aria-label": O ? x.pause : x.play,
113
- onClick: () => k((e) => !e),
114
- children: f(O ? i : a, {})
112
+ "aria-label": k ? S.pause : S.play,
113
+ onClick: () => A((e) => !e),
114
+ children: f(k ? i : a, {})
115
115
  }),
116
116
  /* @__PURE__ */ f("button", {
117
117
  type: "button",
118
118
  className: "select-carousel__btn",
119
- "aria-label": x.next,
120
- onClick: () => F(N + 1),
119
+ "aria-label": S.next,
120
+ onClick: () => I(P + 1),
121
121
  children: /* @__PURE__ */ f(r, {})
122
122
  })
123
123
  ]
@@ -1,42 +1,39 @@
1
1
  import { SelectButton as e } from "./SelectButton.js";
2
2
  import { useSelectMessages as t } from "./SelectLocale.js";
3
3
  import { detectSelectTheme as n } from "./detectSelectTheme.js";
4
- import { SelectModal as r } from "./SelectModal.js";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ import { SelectModal as r, SelectModalActions as i } from "./SelectModal.js";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
6
  //#region src/SelectConfirmModal.tsx
7
- function o({ open: o, onClose: s, onConfirm: c, title: l, children: u, confirmLabel: d, cancelLabel: f, destructive: p = !1, loading: m = !1, theme: h }) {
8
- let g = t().common, _ = d ?? g.confirm, v = f ?? g.cancel;
9
- return /* @__PURE__ */ i(r, {
10
- open: o,
11
- onClose: s,
12
- title: l,
7
+ function s({ open: s, onClose: c, onConfirm: l, title: u, children: d, confirmLabel: f, cancelLabel: p, destructive: m = !1, loading: h = !1, theme: g }) {
8
+ let _ = t().common, v = f ?? _.confirm, y = p ?? _.cancel;
9
+ return /* @__PURE__ */ a(r, {
10
+ open: s,
11
+ onClose: c,
12
+ title: u,
13
13
  size: "sm",
14
- theme: h ?? n(),
15
- footer: /* @__PURE__ */ a("div", {
16
- className: "select-modal__actions",
17
- children: [/* @__PURE__ */ i(e, {
18
- variant: "secondary",
19
- size: "sm",
20
- inline: !0,
21
- onClick: s,
22
- disabled: m,
23
- children: v
24
- }), /* @__PURE__ */ i(e, {
25
- variant: p ? "danger" : "primary",
26
- size: "sm",
27
- inline: !0,
28
- loading: m,
29
- onClick: c,
30
- children: _
31
- })]
32
- }),
33
- children: u != null && u !== !1 && /* @__PURE__ */ i("div", {
14
+ theme: g ?? n(),
15
+ footer: /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, {
16
+ variant: "secondary",
17
+ size: "sm",
18
+ inline: !0,
19
+ onClick: c,
20
+ disabled: h,
21
+ children: y
22
+ }), /* @__PURE__ */ a(e, {
23
+ variant: m ? "danger" : "primary",
24
+ size: "sm",
25
+ inline: !0,
26
+ loading: h,
27
+ onClick: l,
28
+ children: v
29
+ })] }),
30
+ children: d != null && d !== !1 && /* @__PURE__ */ a("div", {
34
31
  className: "select-confirm__message",
35
- children: u
32
+ children: d
36
33
  })
37
34
  });
38
35
  }
39
36
  //#endregion
40
- export { o as SelectConfirmModal };
37
+ export { s as SelectConfirmModal };
41
38
 
42
39
  //# sourceMappingURL=SelectConfirmModal.js.map
@@ -1,4 +1,4 @@
1
- import { ReactNode, ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { SelectDonutSegment } from './chartUtils';
3
3
  type SelectDonutOwnProps = {
4
4
  segments: SelectDonutSegment[];
@@ -11,6 +11,19 @@ type SelectDonutOwnProps = {
11
11
  gap?: number;
12
12
  /** Render a full pie (no center hole) instead of a ring. */
13
13
  pie?: boolean;
14
+ /**
15
+ * 0.1.230: o nome do gráfico para quem lê tela ("Como terminaram as 13.262 mensagens"). Com ele, o anel recebe o foco
16
+ * e as setas andam pelas fatias.
17
+ */
18
+ ariaLabel?: string;
19
+ /** 0.1.230: a parte de cada fatia, na legenda e na dica ("96,6%"). */
20
+ percent?: boolean;
21
+ /** 0.1.230: o texto da parte (o valor e o total). Padrão: a porcentagem no idioma do kit, com uma casa. */
22
+ formatShare?: (value: number, total: number) => string;
23
+ /** 0.1.230: o rótulo da linha da dica. Padrão: "Valor" (no idioma do kit). */
24
+ valueLabel?: ReactNode;
25
+ /** 0.1.230: `bottom` = a legenda embaixo da rosca, na largura toda. Padrão: ao lado, e embaixo quando não cabe. */
26
+ legendPosition?: 'auto' | 'bottom';
14
27
  };
15
28
  export type SelectDonutProps = SelectDonutOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectDonutOwnProps>;
16
29
  export declare const SelectDonut: import('react').ForwardRefExoticComponent<SelectDonutOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectDonutOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,103 +1,147 @@
1
1
  /* empty css */
2
- import { chartColor as e, donutSegment as t, formatCompact as n, useMeasuredWidth as r } from "./chartUtils.js";
3
- import { ChartTooltip as i, useChartTooltip as a } from "./chartTip.js";
4
- import { forwardRef as o, useId as s, useRef as c } from "react";
5
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import { selectIntlLocale as e, useSelectLocale as t, useSelectMessages as n } from "./SelectLocale.js";
3
+ import { chartColor as r, donutSegment as i, formatCompact as a, useMeasuredWidth as o } from "./chartUtils.js";
4
+ import { ChartTooltip as s } from "./chartTip.js";
5
+ import { forwardRef as c, useId as l, useRef as u, useState as d } from "react";
6
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
7
  //#region src/SelectDonut.tsx
7
- var d = o(function({ segments: o, size: d = 200, thickness: f = 26, format: p = n, centerLabel: m, legend: h = !0, gap: g = 2, pie: _ = !1, className: v, ...y }, b) {
8
- let x = a(), S = s(), C = c(null), w = r(C, d), T = o.reduce((e, t) => e + t.value, 0) || 1, E = w / 2, D = w / 2, O = w / 2 - 2, k = _ ? 0 : O - f, A = 0;
9
- return /* @__PURE__ */ u("div", {
10
- ref: b,
11
- ...y,
12
- className: `select-donut-wrap${v ? " " + v : ""}`,
8
+ function m(t, n, r) {
9
+ if (n <= 0) return "—";
10
+ let i = t / n * 100, a = (t) => t.toLocaleString(e(r), { maximumFractionDigits: 1 });
11
+ return t > 0 && i < .1 ? `<${a(.1)}%` : `${a(i)}%`;
12
+ }
13
+ var h = c(function({ segments: e, size: c = 200, thickness: h = 26, format: g = a, centerLabel: _, legend: v = !0, gap: y = 2, pie: b = !1, ariaLabel: x, percent: S = !1, formatShare: C, valueLabel: w, legendPosition: T = "auto", className: E, ...D }, O) {
14
+ let k = n(), A = t(), j = l(), M = u(null), [N, P] = d(null), F = o(M, c), I = e.reduce((e, t) => e + t.value, 0), L = I || 1, R = F / 2, z = F / 2, B = F / 2 - 2, V = b ? 0 : B - h, H = (e) => C ? C(e, I) : m(e, I, A), U = 0, W = e.map((e, t) => {
15
+ let n = U / L * 360;
16
+ return U += e.value, {
17
+ ...e,
18
+ index: t,
19
+ color: e.color ?? r(t),
20
+ start: n,
21
+ end: U / L * 360
22
+ };
23
+ }), G = W.filter((e) => e.value > 0), K = x != null && G.length > 0, q = N == null ? void 0 : W[N], J = q && q.value > 0 ? ((e) => {
24
+ let t = ((e.start + e.end) / 2 - 90) * Math.PI / 180, n = R + (B + 6) * Math.cos(t), r = z + (B + 6) * Math.sin(t), i = M.current;
25
+ return {
26
+ x: n + ((i == null ? void 0 : i.offsetLeft) ?? 0),
27
+ y: r + ((i == null ? void 0 : i.offsetTop) ?? 0),
28
+ place: r <= z ? "top" : "bottom",
29
+ title: e.label,
30
+ rows: [{
31
+ label: w ?? k.chart.value,
32
+ value: S ? `${g(e.value)} · ${H(e.value)}` : g(e.value),
33
+ color: e.color
34
+ }]
35
+ };
36
+ })(q) : null, Y = (e) => {
37
+ if (e.key === "Escape") {
38
+ P(null);
39
+ return;
40
+ }
41
+ let t = G.map((e) => e.index), n = N == null ? -1 : t.indexOf(N), r = {
42
+ ArrowRight: n + 1,
43
+ ArrowDown: n + 1,
44
+ ArrowLeft: n - 1,
45
+ ArrowUp: n - 1,
46
+ Home: 0,
47
+ End: t.length - 1
48
+ }[e.key];
49
+ r !== void 0 && (e.preventDefault(), P(t[Math.min(t.length - 1, Math.max(0, r))]));
50
+ };
51
+ return /* @__PURE__ */ p("div", {
52
+ ref: O,
53
+ ...D,
54
+ className: `select-donut-wrap${T === "bottom" ? " select-donut-wrap--bottom" : ""}${E ? " " + E : ""}`,
13
55
  children: [
14
- /* @__PURE__ */ u("div", {
15
- ref: C,
16
- className: "select-donut-ring",
56
+ /* @__PURE__ */ p("div", {
57
+ ref: M,
58
+ className: `select-donut-ring${q ? " has-active" : ""}`,
17
59
  style: {
18
- width: `${d / 16}rem`,
60
+ width: `${c / 16}rem`,
19
61
  aspectRatio: "1"
20
62
  },
21
- children: [/* @__PURE__ */ u("svg", {
22
- width: w,
23
- height: w,
24
- viewBox: `0 0 ${w} ${w}`,
63
+ ...K ? {
64
+ tabIndex: 0,
65
+ role: "img",
66
+ "aria-label": `${x}: ${G.map((e) => `${e.label} ${g(e.value)} (${H(e.value)})`).join(", ")}`,
67
+ onKeyDown: Y,
68
+ onFocus: () => P((e) => e ?? G[0].index),
69
+ onBlur: () => P(null)
70
+ } : {},
71
+ children: [/* @__PURE__ */ p("svg", {
72
+ width: F,
73
+ height: F,
74
+ viewBox: `0 0 ${F} ${F}`,
25
75
  className: "select-chart select-donut",
26
76
  "aria-hidden": "true",
27
- children: [/* @__PURE__ */ l("defs", { children: o.map((t, n) => {
28
- let r = t.color ?? e(n);
29
- return /* @__PURE__ */ u("linearGradient", {
30
- id: `${S}-s${n}`,
31
- gradientUnits: "userSpaceOnUse",
32
- x1: "0",
33
- y1: "0",
34
- x2: "0",
35
- y2: w,
36
- children: [/* @__PURE__ */ l("stop", {
37
- offset: "0%",
38
- stopColor: r,
39
- stopOpacity: 1
40
- }), /* @__PURE__ */ l("stop", {
41
- offset: "100%",
42
- stopColor: r,
43
- stopOpacity: .6
44
- })]
45
- }, n);
46
- }) }), o.map((n, r) => {
47
- let i = A / T * 360;
48
- A += n.value;
49
- let a = A / T * 360, o = n.color ?? e(r), s = a - i > g * 1.5 ? g / 2 : 0, c = i + s, u = Math.max(c + .01, a - s);
50
- return /* @__PURE__ */ l("path", {
51
- d: t(E, D, O, k, c, u),
52
- fill: `url(#${S}-s${r})`,
53
- className: "select-chart__seg",
54
- onMouseEnter: () => {
55
- let e = ((i + a) / 2 - 90) * Math.PI / 180, t = E + (O + 6) * Math.cos(e), r = D + (O + 6) * Math.sin(e);
56
- x.show({
57
- x: t,
58
- y: r,
59
- place: r <= D ? "top" : "bottom",
60
- title: n.label,
61
- rows: [{
62
- label: "Valor",
63
- value: p(n.value),
64
- color: o
65
- }]
66
- });
67
- },
68
- onMouseLeave: x.hide
69
- }, r);
77
+ children: [/* @__PURE__ */ f("defs", { children: W.map((e) => /* @__PURE__ */ p("linearGradient", {
78
+ id: `${j}-s${e.index}`,
79
+ gradientUnits: "userSpaceOnUse",
80
+ x1: "0",
81
+ y1: "0",
82
+ x2: "0",
83
+ y2: F,
84
+ children: [/* @__PURE__ */ f("stop", {
85
+ offset: "0%",
86
+ stopColor: e.color,
87
+ stopOpacity: 1
88
+ }), /* @__PURE__ */ f("stop", {
89
+ offset: "100%",
90
+ stopColor: e.color,
91
+ stopOpacity: .6
92
+ })]
93
+ }, e.index)) }), G.map((e) => {
94
+ let t = e.end - e.start > y * 1.5 ? y / 2 : 0, n = e.start + t, r = Math.max(n + .01, e.end - t);
95
+ return /* @__PURE__ */ f("path", {
96
+ d: i(R, z, B, V, n, r),
97
+ fill: `url(#${j}-s${e.index})`,
98
+ className: `select-chart__seg${N === e.index ? " is-on" : ""}`,
99
+ onMouseEnter: () => P(e.index),
100
+ onMouseLeave: () => P(null),
101
+ onPointerDown: () => P(e.index)
102
+ }, e.index);
70
103
  })]
71
- }), m != null && /* @__PURE__ */ l("div", {
104
+ }), _ != null && /* @__PURE__ */ f("div", {
72
105
  className: "select-donut__center",
73
- children: m
106
+ children: _
74
107
  })]
75
108
  }),
76
- h && /* @__PURE__ */ l("ul", {
109
+ v && /* @__PURE__ */ f("ul", {
77
110
  className: "select-donut__legend",
78
- children: o.map((t, n) => /* @__PURE__ */ u("li", {
79
- className: "select-donut__legitem",
111
+ children: W.map((e) => /* @__PURE__ */ p("li", {
112
+ className: `select-donut__legitem${q && N !== e.index ? " is-dim" : ""}`,
113
+ onMouseEnter: e.value > 0 ? () => P(e.index) : void 0,
114
+ onMouseLeave: e.value > 0 ? () => P(null) : void 0,
80
115
  children: [
81
- /* @__PURE__ */ l("span", {
116
+ /* @__PURE__ */ f("span", {
82
117
  className: "select-donut__dot",
83
- style: { background: t.color ?? e(n) }
118
+ style: { background: e.color }
84
119
  }),
85
- /* @__PURE__ */ l("span", {
120
+ /* @__PURE__ */ f("span", {
86
121
  className: "select-donut__leglabel",
87
- children: t.label
122
+ children: e.label
88
123
  }),
89
- /* @__PURE__ */ l("span", {
124
+ /* @__PURE__ */ f("span", {
90
125
  className: "select-donut__legval",
91
- children: p(t.value)
126
+ children: g(e.value)
127
+ }),
128
+ S && /* @__PURE__ */ f("span", {
129
+ className: "select-donut__legpct",
130
+ children: H(e.value)
92
131
  })
93
132
  ]
94
- }, n))
133
+ }, e.index))
134
+ }),
135
+ K && /* @__PURE__ */ f("span", {
136
+ className: "select-visually-hidden",
137
+ "aria-live": "polite",
138
+ children: q ? `${q.label}: ${g(q.value)} (${H(q.value)})` : ""
95
139
  }),
96
- /* @__PURE__ */ l(i, { tip: x.tip })
140
+ /* @__PURE__ */ f(s, { tip: J })
97
141
  ]
98
142
  });
99
143
  });
100
144
  //#endregion
101
- export { d as SelectDonut };
145
+ export { h as SelectDonut };
102
146
 
103
147
  //# sourceMappingURL=SelectDonut.js.map
@@ -1,10 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- export declare function SelectFormModal({ open, onClose, onSubmit, title, subtitle, children, submitLabel: submitLabelProp, cancelLabel: cancelLabelProp, submitting, submitDisabled, submitVariant, error, size, theme, }: {
2
+ export declare function SelectFormModal({ open, onClose, onSubmit, title, subtitle, description, children, submitLabel: submitLabelProp, cancelLabel: cancelLabelProp, submitting, submitDisabled, submitVariant, error, size, theme, }: {
3
3
  open: boolean;
4
4
  onClose: () => void;
5
5
  onSubmit: () => void;
6
6
  title: ReactNode;
7
7
  subtitle?: ReactNode;
8
+ /** 0.1.230: a descrição no começo do corpo (o lugar dela no modal novo; o `subtitle` fica na cabeça). */
9
+ description?: ReactNode;
8
10
  children: ReactNode;
9
11
  submitLabel?: string;
10
12
  cancelLabel?: string;
@@ -2,52 +2,50 @@ import { SelectButton as e } from "./SelectButton.js";
2
2
  import { useSelectMessages as t } from "./SelectLocale.js";
3
3
  import { SelectAlert as n } from "./SelectAlert.js";
4
4
  import { detectSelectTheme as r } from "./detectSelectTheme.js";
5
- import { SelectModal as i } from "./SelectModal.js";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { SelectModal as i, SelectModalActions as a } from "./SelectModal.js";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
7
  //#region src/SelectFormModal.tsx
8
- function s({ open: s, onClose: c, onSubmit: l, title: u, subtitle: d, children: f, submitLabel: p, cancelLabel: m, submitting: h = !1, submitDisabled: g = !1, submitVariant: _ = "primary", error: v, size: y = "md", theme: b }) {
9
- let x = t().common, S = p ?? x.save, C = m ?? x.cancel;
10
- return /* @__PURE__ */ o(i, {
11
- open: s,
12
- onClose: c,
13
- title: u,
14
- subtitle: d,
15
- size: y,
16
- theme: b ?? r(),
17
- footer: /* @__PURE__ */ o("div", {
18
- className: "select-modal__actions",
19
- children: [/* @__PURE__ */ a(e, {
20
- variant: "secondary",
21
- size: "sm",
22
- inline: !0,
23
- onClick: c,
24
- disabled: h,
25
- children: C
26
- }), /* @__PURE__ */ a(e, {
27
- variant: _,
28
- size: "sm",
29
- inline: !0,
30
- loading: h,
31
- disabled: g,
32
- onClick: () => l(),
33
- children: S
34
- })]
35
- }),
36
- children: [v != null && v !== !1 && /* @__PURE__ */ a("div", {
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
+ return /* @__PURE__ */ s(i, {
11
+ open: c,
12
+ onClose: l,
13
+ title: d,
14
+ subtitle: f,
15
+ description: p,
16
+ size: x,
17
+ theme: S ?? r(),
18
+ footer: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
19
+ variant: "secondary",
20
+ size: "sm",
21
+ inline: !0,
22
+ onClick: l,
23
+ disabled: _,
24
+ children: T
25
+ }), /* @__PURE__ */ o(e, {
26
+ variant: y,
27
+ size: "sm",
28
+ inline: !0,
29
+ loading: _,
30
+ disabled: v,
31
+ onClick: () => u(),
32
+ children: w
33
+ })] }),
34
+ children: [b != null && b !== !1 && /* @__PURE__ */ o("div", {
37
35
  className: "select-formmodal__error",
38
- children: /* @__PURE__ */ a(n, {
36
+ children: /* @__PURE__ */ o(n, {
39
37
  tone: "critical",
40
- children: v
38
+ children: b
41
39
  })
42
- }), /* @__PURE__ */ a("form", {
40
+ }), /* @__PURE__ */ o("form", {
43
41
  onSubmit: (e) => {
44
- e.preventDefault(), l();
42
+ e.preventDefault(), u();
45
43
  },
46
- children: f
44
+ children: m
47
45
  })]
48
46
  });
49
47
  }
50
48
  //#endregion
51
- export { s as SelectFormModal };
49
+ export { c as SelectFormModal };
52
50
 
53
51
  //# sourceMappingURL=SelectFormModal.js.map
@@ -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
  });