@selectwin/kit 0.1.262 → 0.1.263

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 (62) hide show
  1. package/README.md +65 -0
  2. package/dist/SelectActionMenu.d.ts +7 -1
  3. package/dist/SelectActionMenu.js +14 -13
  4. package/dist/SelectBlockBuilder.d.ts +63 -0
  5. package/dist/SelectBlockBuilder.js +370 -0
  6. package/dist/SelectCalendar.d.ts +68 -4
  7. package/dist/SelectCalendar.js +449 -279
  8. package/dist/SelectChannelPreview.d.ts +34 -5
  9. package/dist/SelectChannelPreview.js +167 -73
  10. package/dist/SelectChartCard.d.ts +13 -0
  11. package/dist/SelectChartCard.js +50 -30
  12. package/dist/SelectCombobox.d.ts +5 -0
  13. package/dist/SelectCombobox.js +77 -61
  14. package/dist/SelectConversationContext.d.ts +30 -0
  15. package/dist/SelectConversationContext.js +141 -0
  16. package/dist/SelectDatePicker.d.ts +4 -0
  17. package/dist/SelectDatePicker.js +78 -62
  18. package/dist/SelectDateRangeField.d.ts +6 -1
  19. package/dist/SelectDateRangeField.js +9 -8
  20. package/dist/SelectField.d.ts +7 -3
  21. package/dist/SelectField.js +71 -70
  22. package/dist/SelectFilterBar.d.ts +9 -0
  23. package/dist/SelectFilterBar.js +301 -179
  24. package/dist/SelectFunnel.d.ts +12 -2
  25. package/dist/SelectFunnel.js +193 -63
  26. package/dist/SelectHorizontalBar.d.ts +11 -1
  27. package/dist/SelectHorizontalBar.js +86 -35
  28. package/dist/SelectHtmlFrame.d.ts +3 -1
  29. package/dist/SelectHtmlFrame.js +4 -4
  30. package/dist/SelectLocale.d.ts +146 -0
  31. package/dist/SelectLocale.js +363 -31
  32. package/dist/SelectMail.d.ts +80 -4
  33. package/dist/SelectMail.js +433 -300
  34. package/dist/SelectMailEditor.d.ts +35 -1
  35. package/dist/SelectMailEditor.js +347 -163
  36. package/dist/SelectNumberedList.d.ts +20 -2
  37. package/dist/SelectNumberedList.js +75 -17
  38. package/dist/SelectProgressBar.d.ts +22 -5
  39. package/dist/SelectProgressBar.js +70 -40
  40. package/dist/SelectRecordCard.d.ts +13 -4
  41. package/dist/SelectRecordCard.js +30 -8
  42. package/dist/SelectRuleBuilder.d.ts +52 -0
  43. package/dist/SelectRuleBuilder.js +157 -0
  44. package/dist/SelectSearchPreview.d.ts +35 -0
  45. package/dist/SelectSearchPreview.js +69 -0
  46. package/dist/SelectSegmented.d.ts +2 -0
  47. package/dist/SelectSegmented.js +1 -1
  48. package/dist/SelectSortable.d.ts +5 -1
  49. package/dist/SelectSparkBars.d.ts +5 -1
  50. package/dist/SelectSparkBars.js +65 -57
  51. package/dist/SelectSteps.d.ts +6 -0
  52. package/dist/SelectSteps.js +43 -10
  53. package/dist/SelectTabs.d.ts +16 -4
  54. package/dist/SelectTabs.js +95 -60
  55. package/dist/SelectTextarea.d.ts +1 -1
  56. package/dist/SelectVoiceNote.d.ts +6 -1
  57. package/dist/SelectVoiceNote.js +118 -106
  58. package/dist/chartUtils.d.ts +10 -0
  59. package/dist/index.d.ts +18 -2
  60. package/dist/index.js +153 -149
  61. package/dist/style.css +1 -1
  62. package/package.json +1 -1
@@ -6,8 +6,18 @@ type SelectFunnelOwnProps = {
6
6
  palette?: 'ramp' | 'mono';
7
7
  /** Texto da conversão de uma etapa sobre a anterior (padrão "56%"); no `shape="funnel"`, sobre a primeira. */
8
8
  convLabel?: (pct: number, index: number) => ReactNode;
9
- /** 0.1.235: `funnel` = os trapézios que afinam etapa a etapa. Padrão `bars`, as barras horizontais. */
10
- shape?: 'bars' | 'funnel';
9
+ /**
10
+ * 0.1.235: `funnel` = os trapézios que afinam etapa a etapa. Padrão `bars`, as barras horizontais. 0.1.263: `table` = o
11
+ * funil em tabela (Etapa, Chegaram, Da anterior, Do início).
12
+ */
13
+ shape?: 'bars' | 'funnel' | 'table';
14
+ /**
15
+ * 0.1.263, no `shape="table"`: a porcentagem escrita (padrão: uma casa sempre, na língua do kit — "78,8%", "88,0%" —, e o
16
+ * zero e o todo sem ela, "0%" e "100%", como na prancha).
17
+ */
18
+ pctFormat?: (pct: number) => string;
19
+ /** 0.1.263, no `shape="table"`: o nome da tabela para o leitor de tela. */
20
+ label?: string;
11
21
  };
12
22
  /**
13
23
  * O trapézio de uma etapa com os cantos arredondados: em cima a largura dela, embaixo a da seguinte (em % da maior). Cada
@@ -1,108 +1,238 @@
1
1
  /* empty css */
2
- import { chartColor as e, formatCompact as t } from "./chartUtils.js";
3
- import { forwardRef as n } from "react";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { LockIcon as e } from "./icons.js";
3
+ import { selectIntlLocale as t, useSelectLocale as n, useSelectMessages as r } from "./SelectLocale.js";
4
+ import { chartColor as i, formatCompact as a } from "./chartUtils.js";
5
+ import { forwardRef as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
7
  //#region src/SelectFunnel.tsx
6
- var a = 160, o = 52, s = 6;
7
- function c(e, t) {
8
- let n = a * e / 100, r = a * t / 100, i = [
9
- [(a - n) / 2, 0],
10
- [(a + n) / 2, 0],
11
- [(a + r) / 2, o],
12
- [(a - r) / 2, o]
13
- ], c = (e) => e.toFixed(1), l = "";
8
+ var l = 160, u = 52, d = 6;
9
+ function f(e, t) {
10
+ let n = l * e / 100, r = l * t / 100, i = [
11
+ [(l - n) / 2, 0],
12
+ [(l + n) / 2, 0],
13
+ [(l + r) / 2, u],
14
+ [(l - r) / 2, u]
15
+ ], a = (e) => e.toFixed(1), o = "";
14
16
  return i.forEach((e, t) => {
15
- let n = i[(t + 3) % 4], r = i[(t + 1) % 4], a = Math.hypot(n[0] - e[0], n[1] - e[1]) || 1, o = Math.hypot(r[0] - e[0], r[1] - e[1]) || 1, u = Math.min(s, a / 2, o / 2), d = [e[0] + (n[0] - e[0]) / a * u, e[1] + (n[1] - e[1]) / a * u], f = [e[0] + (r[0] - e[0]) / o * u, e[1] + (r[1] - e[1]) / o * u];
16
- l += `${t === 0 ? "M" : "L"}${c(d[0])} ${c(d[1])} Q${c(e[0])} ${c(e[1])} ${c(f[0])} ${c(f[1])} `;
17
- }), l + "Z";
17
+ let n = i[(t + 3) % 4], r = i[(t + 1) % 4], s = Math.hypot(n[0] - e[0], n[1] - e[1]) || 1, c = Math.hypot(r[0] - e[0], r[1] - e[1]) || 1, l = Math.min(d, s / 2, c / 2), u = [e[0] + (n[0] - e[0]) / s * l, e[1] + (n[1] - e[1]) / s * l], f = [e[0] + (r[0] - e[0]) / c * l, e[1] + (r[1] - e[1]) / c * l];
18
+ o += `${t === 0 ? "M" : "L"}${a(u[0])} ${a(u[1])} Q${a(e[0])} ${a(e[1])} ${a(f[0])} ${a(f[1])} `;
19
+ }), o + "Z";
18
20
  }
19
- var l = n(function({ stages: n, format: s = t, palette: l = "ramp", convLabel: u, shape: d = "bars", className: f, ...p }, m) {
20
- let h = Math.max(1, ...n.map((e) => e.value));
21
- if (d === "funnel") {
22
- var g;
23
- let e = ((g = n[0]) == null ? void 0 : g.value) || 1, t = (e) => Math.max(3, e / h * 100);
24
- return /* @__PURE__ */ r("div", {
25
- ref: m,
26
- ...p,
27
- className: `select-funnel select-funnel--shape${f ? " " + f : ""}`,
28
- children: n.map((l, d) => {
29
- let f = d === n.length - 1, p = f ? l : n[d + 1], m = l.value / e * 100, h = l.color ?? (f ? "var(--select-chart-paid)" : "color-mix(in srgb, var(--select-chart-neutral) 40%, transparent)");
30
- return /* @__PURE__ */ i("div", {
31
- className: `select-funnel__step${f ? " select-funnel__step--last" : ""}`,
32
- children: [/* @__PURE__ */ r("svg", {
21
+ var p = o(function({ stages: e, format: t = a, palette: n = "ramp", convLabel: r, shape: o = "bars", pctFormat: d, label: p, className: h, ...g }, _) {
22
+ let v = Math.max(1, ...e.map((e) => e.value));
23
+ if (o === "table") return /* @__PURE__ */ s(m, {
24
+ ref: _,
25
+ ...g,
26
+ stages: e,
27
+ max: v,
28
+ format: t,
29
+ pctFormat: d,
30
+ label: p,
31
+ className: h
32
+ });
33
+ if (o === "funnel") {
34
+ var y;
35
+ let n = ((y = e[0]) == null ? void 0 : y.value) || 1, i = (e) => Math.max(3, e / v * 100);
36
+ return /* @__PURE__ */ s("div", {
37
+ ref: _,
38
+ ...g,
39
+ className: `select-funnel select-funnel--shape${h ? " " + h : ""}`,
40
+ children: e.map((a, o) => {
41
+ let d = o === e.length - 1, p = d ? a : e[o + 1], m = a.value / n * 100, h = a.color ?? (d ? "var(--select-chart-paid)" : "color-mix(in srgb, var(--select-chart-neutral) 40%, transparent)");
42
+ return /* @__PURE__ */ c("div", {
43
+ className: `select-funnel__step${d ? " select-funnel__step--last" : ""}`,
44
+ children: [/* @__PURE__ */ s("svg", {
33
45
  className: "select-funnel__shape",
34
- viewBox: `0 0 ${a} ${o}`,
46
+ viewBox: `0 0 ${l} ${u}`,
35
47
  "aria-hidden": "true",
36
- children: /* @__PURE__ */ r("path", {
37
- d: c(t(l.value), t(p.value)),
48
+ children: /* @__PURE__ */ s("path", {
49
+ d: f(i(a.value), i(p.value)),
38
50
  style: { fill: h }
39
51
  })
40
- }), /* @__PURE__ */ i("div", {
52
+ }), /* @__PURE__ */ c("div", {
41
53
  className: "select-funnel__steptext",
42
54
  children: [
43
- /* @__PURE__ */ r("span", {
55
+ /* @__PURE__ */ s("span", {
44
56
  className: "select-funnel__label",
45
- children: l.label
57
+ children: a.label
46
58
  }),
47
- /* @__PURE__ */ i("span", {
59
+ /* @__PURE__ */ c("span", {
48
60
  className: "select-funnel__nums",
49
- children: [/* @__PURE__ */ r("span", {
61
+ children: [/* @__PURE__ */ s("span", {
50
62
  className: "select-funnel__value",
51
- children: s(l.value)
52
- }), d > 0 && /* @__PURE__ */ i("span", {
53
- className: `select-funnel__conv${l.flag ? " is-flagged" : ""}`,
54
- children: [l.flag ? "▼ " : "", u ? u(m, d) : `${m.toFixed(1).replace(".", ",")}%`]
63
+ children: t(a.value)
64
+ }), o > 0 && /* @__PURE__ */ c("span", {
65
+ className: `select-funnel__conv${a.flag ? " is-flagged" : ""}`,
66
+ children: [a.flag ? "▼ " : "", r ? r(m, o) : `${m.toFixed(1).replace(".", ",")}%`]
55
67
  })]
56
68
  }),
57
- l.note != null && /* @__PURE__ */ r("span", {
69
+ a.note != null && /* @__PURE__ */ s("span", {
58
70
  className: "select-funnel__note",
59
- children: l.note
71
+ children: a.note
60
72
  })
61
73
  ]
62
74
  })]
63
- }, d);
75
+ }, o);
64
76
  })
65
77
  });
66
78
  }
67
- return /* @__PURE__ */ r("div", {
68
- ref: m,
69
- ...p,
70
- className: `select-funnel select-funnel--${l}${f ? " " + f : ""}`,
71
- children: n.map((t, a) => {
72
- let o = a > 0 ? n[a - 1].value || 1 : t.value || 1, c = a > 0 ? t.value / o * 100 : 100, d = l === "mono", f = t.color ?? (d ? a === n.length - 1 ? "var(--select-chart-paid)" : "var(--select-chart-1)" : e(a));
73
- return /* @__PURE__ */ i("div", {
79
+ return /* @__PURE__ */ s("div", {
80
+ ref: _,
81
+ ...g,
82
+ className: `select-funnel select-funnel--${n}${h ? " " + h : ""}`,
83
+ children: e.map((a, o) => {
84
+ let l = o > 0 ? e[o - 1].value || 1 : a.value || 1, u = o > 0 ? a.value / l * 100 : 100, d = n === "mono", f = a.color ?? (d ? o === e.length - 1 ? "var(--select-chart-paid)" : "var(--select-chart-1)" : i(o));
85
+ return /* @__PURE__ */ c("div", {
74
86
  className: "select-funnel__row",
75
87
  children: [
76
- /* @__PURE__ */ r("div", {
88
+ /* @__PURE__ */ s("div", {
77
89
  className: "select-funnel__label",
78
- children: t.label
90
+ children: a.label
79
91
  }),
80
- /* @__PURE__ */ r("div", {
92
+ /* @__PURE__ */ s("div", {
81
93
  className: "select-funnel__track",
82
- children: /* @__PURE__ */ r("div", {
94
+ children: /* @__PURE__ */ s("div", {
83
95
  className: "select-funnel__bar",
84
96
  style: {
85
- width: `${t.value / h * 100}%`,
97
+ width: `${a.value / v * 100}%`,
86
98
  background: d ? f : `linear-gradient(90deg, ${f}, color-mix(in srgb, ${f} 50%, transparent))`
87
99
  }
88
100
  })
89
101
  }),
90
- /* @__PURE__ */ i("div", {
102
+ /* @__PURE__ */ c("div", {
91
103
  className: "select-funnel__meta",
92
- children: [/* @__PURE__ */ r("span", {
104
+ children: [/* @__PURE__ */ s("span", {
93
105
  className: "select-funnel__value",
94
- children: s(t.value)
95
- }), a > 0 && /* @__PURE__ */ i("span", {
96
- className: `select-funnel__conv${t.flag ? " is-flagged" : ""}`,
97
- children: [t.flag ? "▼ " : "", u ? u(c, a) : `${c.toFixed(0)}%`]
106
+ children: t(a.value)
107
+ }), o > 0 && /* @__PURE__ */ c("span", {
108
+ className: `select-funnel__conv${a.flag ? " is-flagged" : ""}`,
109
+ children: [a.flag ? "▼ " : "", r ? r(u, o) : `${u.toFixed(0)}%`]
98
110
  })]
99
111
  })
100
112
  ]
101
- }, a);
113
+ }, o);
114
+ })
115
+ });
116
+ }), m = o(function({ stages: i, max: a, format: o, pctFormat: l, label: u, className: d, ...f }, p) {
117
+ var m;
118
+ let h = r(), g = n(), _ = l ?? ((e) => {
119
+ let n = e === 0 || e === 100;
120
+ return `${e.toLocaleString(t(g), {
121
+ minimumFractionDigits: +!n,
122
+ maximumFractionDigits: +!n
123
+ })}%`;
124
+ }), v = ((m = i[0]) == null ? void 0 : m.value) || 0;
125
+ return /* @__PURE__ */ s("div", {
126
+ ref: p,
127
+ ...f,
128
+ className: `select-funnel select-funnel--table${d ? " " + d : ""}`,
129
+ children: /* @__PURE__ */ c("table", {
130
+ className: "select-funnel__table",
131
+ role: "table",
132
+ "aria-label": u,
133
+ children: [
134
+ /* @__PURE__ */ c("colgroup", { children: [
135
+ /* @__PURE__ */ s("col", { className: "select-funnel__colstage" }),
136
+ /* @__PURE__ */ s("col", {}),
137
+ /* @__PURE__ */ s("col", { className: "select-funnel__colprev" }),
138
+ /* @__PURE__ */ s("col", { className: "select-funnel__colstart" })
139
+ ] }),
140
+ /* @__PURE__ */ s("thead", {
141
+ role: "rowgroup",
142
+ children: /* @__PURE__ */ c("tr", {
143
+ role: "row",
144
+ children: [
145
+ /* @__PURE__ */ s("th", {
146
+ role: "columnheader",
147
+ scope: "col",
148
+ children: h.funnel.stage
149
+ }),
150
+ /* @__PURE__ */ s("th", {
151
+ role: "columnheader",
152
+ scope: "col",
153
+ className: "select-funnel__thbar",
154
+ children: h.funnel.reached
155
+ }),
156
+ /* @__PURE__ */ s("th", {
157
+ role: "columnheader",
158
+ scope: "col",
159
+ className: "select-funnel__thnum",
160
+ children: h.funnel.fromPrevious
161
+ }),
162
+ /* @__PURE__ */ s("th", {
163
+ role: "columnheader",
164
+ scope: "col",
165
+ className: "select-funnel__thnum",
166
+ children: h.funnel.fromStart
167
+ })
168
+ ]
169
+ })
170
+ }),
171
+ /* @__PURE__ */ s("tbody", {
172
+ role: "rowgroup",
173
+ children: i.map((t, n) => {
174
+ let r = n > 0 ? i[n - 1].value : 0, l = Math.max(0, Math.min(100, t.value / a * 100)), u = t.lockedLabel ?? h.lock.label, d = {
175
+ "--select-funnel-w": `${l}%`,
176
+ ...t.color ? { "--select-funnel-bar": t.color } : {}
177
+ };
178
+ return /* @__PURE__ */ c("tr", {
179
+ role: "row",
180
+ className: t.locked ? "is-locked" : void 0,
181
+ children: [
182
+ /* @__PURE__ */ c("th", {
183
+ role: "rowheader",
184
+ scope: "row",
185
+ className: "select-funnel__tstage",
186
+ children: [
187
+ t.locked ? /* @__PURE__ */ s("span", {
188
+ className: "select-funnel__lock",
189
+ title: u,
190
+ children: /* @__PURE__ */ s(e, {})
191
+ }) : null,
192
+ /* @__PURE__ */ s("span", {
193
+ className: "select-funnel__stagename",
194
+ children: t.label
195
+ }),
196
+ t.locked ? /* @__PURE__ */ s("span", {
197
+ className: "select-visually-hidden",
198
+ children: ` (${u})`
199
+ }) : null
200
+ ]
201
+ }),
202
+ /* @__PURE__ */ s("td", {
203
+ role: "cell",
204
+ className: "select-funnel__reached",
205
+ "data-label": h.funnel.reached,
206
+ children: /* @__PURE__ */ s("span", {
207
+ className: "select-funnel__tbarcell",
208
+ children: /* @__PURE__ */ s("span", {
209
+ className: "select-funnel__tbar",
210
+ style: d,
211
+ children: o(t.value)
212
+ })
213
+ })
214
+ }),
215
+ /* @__PURE__ */ s("td", {
216
+ role: "cell",
217
+ className: "select-funnel__num select-funnel__num--prev",
218
+ "data-label": h.funnel.fromPrevious,
219
+ children: n === 0 || r <= 0 ? "—" : _(t.value / r * 100)
220
+ }),
221
+ /* @__PURE__ */ s("td", {
222
+ role: "cell",
223
+ className: "select-funnel__num select-funnel__num--start",
224
+ "data-label": h.funnel.fromStart,
225
+ children: v > 0 ? _(t.value / v * 100) : "—"
226
+ })
227
+ ]
228
+ }, n);
229
+ })
230
+ })
231
+ ]
102
232
  })
103
233
  });
104
234
  });
105
235
  //#endregion
106
- export { l as SelectFunnel, c as funnelStagePath };
236
+ export { p as SelectFunnel, f as funnelStagePath };
107
237
 
108
238
  //# sourceMappingURL=SelectFunnel.js.map
@@ -23,7 +23,17 @@ type SelectHorizontalBarOwnProps = {
23
23
  * "everyone watched it all".
24
24
  */
25
25
  max?: number;
26
+ /**
27
+ * 0.1.263: as séries de cada categoria — duas (ou mais) barras por linha, com o nome e a cor de cada uma (padrão: o
28
+ * primário e o acento claro). Os valores vêm em `datum.values`, na mesma ordem.
29
+ */
30
+ series?: SelectHorizontalBarSeries[];
26
31
  };
32
+ /** 0.1.263: uma série das barras por linha (`SelectHorizontalBar series`). */
33
+ export interface SelectHorizontalBarSeries {
34
+ label: string;
35
+ color?: string;
36
+ }
27
37
  export type SelectHorizontalBarProps = SelectHorizontalBarOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectHorizontalBarOwnProps>;
28
- export declare function SelectHorizontalBar({ data, height, color, format, formatValue, distributed, labelWidth, max: fixedMax, className, ...rest }: SelectHorizontalBarProps): import("react").JSX.Element;
38
+ export declare function SelectHorizontalBar(props: SelectHorizontalBarProps): import("react").JSX.Element;
29
39
  export {};
@@ -4,22 +4,28 @@ import { ChartTooltip as a, useChartTooltip as o } from "./chartTip.js";
4
4
  import { useId as s } from "react";
5
5
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  //#region src/SelectHorizontalBar.tsx
7
- var u = 6.1, d = 12, f = 56, p = .4;
8
- function m({ data: m, height: h, color: g, format: _ = t, formatValue: v, distributed: y = !0, labelWidth: b, max: x, className: S, ...C }) {
9
- let w = h ?? m.length * 36 + 6 + 26, { ref: T, width: E } = i(w), D = o(), O = s(), k = x && x > 0 ? x : n(Math.max(0, ...m.map((e) => e.value))), A = m.reduce((e, t) => Math.max(e, t.label.length), 0), j = Math.min(Math.max(f, A * u + d), Math.max(f, E * p)), M = b ?? j, N = Math.max(3, Math.floor((M - d) / u)), P = (e) => e.length <= N ? e : `${e.slice(0, N - 1).trimEnd()}…`, F = Math.max(0, E - M - 28), I = w - 6 - 26, L = m.length ? I / m.length : 0, R = Math.min(L * .62, 22), z = (e) => M + e / k * F, B = (t, n) => t.color ?? (y ? e(n) : g ?? e(0));
7
+ var u = 6.1, d = 12, f = 56, p = .4, m = ["var(--select-primary)", "color-mix(in srgb, var(--select-accent) 70%, var(--select-surface))"];
8
+ function h(e) {
9
+ return e.series && e.series.length > 0 ? /* @__PURE__ */ c(_, {
10
+ ...e,
11
+ series: e.series
12
+ }) : /* @__PURE__ */ c(g, { ...e });
13
+ }
14
+ function g({ data: m, height: h, color: g, format: _ = t, formatValue: v, distributed: y = !0, labelWidth: b, max: x, series: S, className: C, ...w }) {
15
+ let T = h ?? m.length * 36 + 6 + 26, { ref: E, width: D } = i(T), O = o(), k = s(), A = x && x > 0 ? x : n(Math.max(0, ...m.map((e) => e.value))), j = m.reduce((e, t) => Math.max(e, t.label.length), 0), M = Math.min(Math.max(f, j * u + d), Math.max(f, D * p)), N = b ?? M, P = Math.max(3, Math.floor((N - d) / u)), F = (e) => e.length <= P ? e : `${e.slice(0, P - 1).trimEnd()}…`, I = Math.max(0, D - N - 28), L = T - 6 - 26, R = m.length ? L / m.length : 0, z = Math.min(R * .62, 22), B = (e) => N + e / A * I, V = (t, n) => t.color ?? (y ? e(n) : g ?? e(0));
10
16
  return /* @__PURE__ */ l("div", {
11
- ...C,
12
- className: `select-chart-wrap${S ? " " + S : ""}`,
13
- ref: T,
14
- children: [E > 0 && /* @__PURE__ */ l("svg", {
15
- width: E,
16
- height: w,
17
+ ...w,
18
+ className: `select-chart-wrap${C ? " " + C : ""}`,
19
+ ref: E,
20
+ children: [D > 0 && /* @__PURE__ */ l("svg", {
21
+ width: D,
22
+ height: T,
17
23
  className: "select-chart",
18
24
  children: [
19
25
  /* @__PURE__ */ c("defs", { children: m.map((e, t) => {
20
- let n = B(e, t);
26
+ let n = V(e, t);
21
27
  return /* @__PURE__ */ l("linearGradient", {
22
- id: `${O}-h${t}`,
28
+ id: `${k}-h${t}`,
23
29
  x1: "0",
24
30
  y1: "0",
25
31
  x2: "1",
@@ -35,66 +41,111 @@ function m({ data: m, height: h, color: g, format: _ = t, formatValue: v, distri
35
41
  })]
36
42
  }, t);
37
43
  }) }),
38
- r(k).map((e, t) => /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("line", {
39
- x1: z(e),
40
- x2: z(e),
44
+ r(A).map((e, t) => /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("line", {
45
+ x1: B(e),
46
+ x2: B(e),
41
47
  y1: 6,
42
- y2: 6 + I,
48
+ y2: 6 + L,
43
49
  className: t === 0 ? "select-chart__axis" : "select-chart__grid"
44
50
  }), /* @__PURE__ */ c("text", {
45
- x: z(e),
46
- y: w - 26 + 16,
51
+ x: B(e),
52
+ y: T - 26 + 16,
47
53
  className: "select-chart__xlabel",
48
54
  textAnchor: "middle",
49
55
  children: _(e)
50
56
  })] }, t)),
51
57
  m.map((e, t) => {
52
- let n = 6 + L * t + L / 2, r = Math.min(F, e.value / k * F), i = B(e, t);
58
+ let n = 6 + R * t + R / 2, r = Math.min(I, e.value / A * I), i = V(e, t);
53
59
  return /* @__PURE__ */ l("g", { children: [
54
60
  /* @__PURE__ */ c("rect", {
55
- x: M,
56
- y: n - R / 2,
57
- width: F,
58
- height: R,
61
+ x: N,
62
+ y: n - z / 2,
63
+ width: I,
64
+ height: z,
59
65
  rx: 5,
60
66
  className: "select-chart__track-bar"
61
67
  }),
62
68
  /* @__PURE__ */ c("rect", {
63
- x: M,
64
- y: n - R / 2,
69
+ x: N,
70
+ y: n - z / 2,
65
71
  width: Math.max(0, r),
66
- height: R,
72
+ height: z,
67
73
  rx: 5,
68
- fill: `url(#${O}-h${t})`,
74
+ fill: `url(#${k}-h${t})`,
69
75
  className: "select-chart__hbar",
70
76
  style: { animationDelay: `${t * 40}ms` },
71
- onMouseEnter: () => D.show({
72
- x: M + r,
73
- y: n - R / 2,
74
- place: n - R / 2 < 50 ? "bottom" : "top",
77
+ onMouseEnter: () => O.show({
78
+ x: N + r,
79
+ y: n - z / 2,
80
+ place: n - z / 2 < 50 ? "bottom" : "top",
75
81
  rows: [{
76
82
  label: e.label,
77
83
  value: (v ?? _)(e.value),
78
84
  color: i
79
85
  }]
80
86
  }),
81
- onMouseLeave: D.hide
87
+ onMouseLeave: O.hide
82
88
  }),
83
89
  /* @__PURE__ */ l("text", {
84
- x: M - d / 2,
90
+ x: N - d / 2,
85
91
  y: n,
86
92
  className: "select-chart__ylabel",
87
93
  dominantBaseline: "middle",
88
94
  textAnchor: "end",
89
- children: [/* @__PURE__ */ c("title", { children: e.label }), P(e.label)]
95
+ children: [/* @__PURE__ */ c("title", { children: e.label }), F(e.label)]
90
96
  })
91
97
  ] }, t);
92
98
  })
93
99
  ]
94
- }), /* @__PURE__ */ c(a, { tip: D.tip })]
100
+ }), /* @__PURE__ */ c(a, { tip: O.tip })]
101
+ });
102
+ }
103
+ function _({ data: e, series: n, format: r = t, formatValue: i, max: a, className: o, height: s, color: u, distributed: d, labelWidth: f, ...p }) {
104
+ let h = e.flatMap((e) => (e.values ?? []).filter((e) => Number.isFinite(e))), g = a && a > 0 ? a : Math.max(1, ...h), _ = i ?? r;
105
+ return /* @__PURE__ */ c("div", {
106
+ ...p,
107
+ className: `select-hbars${o ? " " + o : ""}`,
108
+ children: e.map((e, t) => /* @__PURE__ */ l("div", {
109
+ className: "select-hbars__group",
110
+ role: "group",
111
+ "aria-label": e.label,
112
+ children: [/* @__PURE__ */ l("div", {
113
+ className: "select-hbars__head",
114
+ children: [/* @__PURE__ */ c("span", {
115
+ className: "select-hbars__label",
116
+ children: e.label
117
+ }), e.note == null ? null : /* @__PURE__ */ c("span", {
118
+ className: "select-hbars__note",
119
+ children: e.note
120
+ })]
121
+ }), n.map((t, n) => {
122
+ var r;
123
+ let i = ((r = e.values) == null ? void 0 : r[n]) ?? 0, a = {
124
+ "--select-hbars-w": `${+Math.max(0, Math.min(100, i / g * 100)).toFixed(3)}%`,
125
+ "--select-hbars-color": t.color ?? m[n % m.length]
126
+ };
127
+ return /* @__PURE__ */ l("div", {
128
+ className: `select-hbars__row${n === 0 ? " select-hbars__row--lead" : ""}`,
129
+ children: [/* @__PURE__ */ c("span", {
130
+ className: "select-hbars__track",
131
+ "aria-hidden": "true",
132
+ children: /* @__PURE__ */ c("span", {
133
+ className: "select-hbars__bar",
134
+ style: a
135
+ })
136
+ }), /* @__PURE__ */ l("span", {
137
+ className: "select-hbars__value",
138
+ children: [/* @__PURE__ */ c("span", {
139
+ className: "select-visually-hidden",
140
+ children: `${t.label}: `
141
+ }), _(i)]
142
+ })]
143
+ }, n);
144
+ })]
145
+ }, t))
95
146
  });
96
147
  }
97
148
  //#endregion
98
- export { m as SelectHorizontalBar };
149
+ export { h as SelectHorizontalBar };
99
150
 
100
151
  //# sourceMappingURL=SelectHorizontalBar.js.map
@@ -7,8 +7,10 @@ export interface SelectHtmlFrameProps {
7
7
  height?: string;
8
8
  /** Os links do documento abrem em outra aba. Nunca libera script nem a origem. */
9
9
  allowLinks?: boolean;
10
+ /** 0.1.263: `dark` — o quadro de um leitor de e-mail no escuro (sem o clarão branco ao carregar). Padrão `light`. */
11
+ scheme?: 'light' | 'dark';
10
12
  className?: string;
11
13
  }
12
14
  /** Só a própria origem (um caminho que não é `//host`) ou `https:`. */
13
15
  export declare function frameSrcAllowed(src: string): boolean;
14
- export declare function SelectHtmlFrame({ src, title, height, allowLinks, className }: SelectHtmlFrameProps): import("react").JSX.Element;
16
+ export declare function SelectHtmlFrame({ src, title, height, allowLinks, scheme, className }: SelectHtmlFrameProps): import("react").JSX.Element;
@@ -10,11 +10,11 @@ function t(e) {
10
10
  return !1;
11
11
  }
12
12
  }
13
- function n({ src: n, title: r, height: i = "28rem", allowLinks: a = !1, className: o }) {
14
- let s = t(n);
13
+ function n({ src: n, title: r, height: i = "28rem", allowLinks: a = !1, scheme: o = "light", className: s }) {
14
+ let c = t(n);
15
15
  return /* @__PURE__ */ e("div", {
16
- className: `select-htmlframe${o ? " " + o : ""}`,
17
- children: s ? /* @__PURE__ */ e("iframe", {
16
+ className: `select-htmlframe${o === "dark" ? " select-htmlframe--dark" : ""}${s ? " " + s : ""}`,
17
+ children: c ? /* @__PURE__ */ e("iframe", {
18
18
  className: "select-htmlframe__frame",
19
19
  title: r,
20
20
  src: n,