@selectwin/kit 0.1.194 → 0.1.196

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.
package/README.md CHANGED
@@ -28,13 +28,18 @@ import { SelectLocaleProvider } from '@selectwin/kit';
28
28
 
29
29
  A prop de texto do componente (`confirmLabel`, `noun`…) sempre ganha do dicionário.
30
30
 
31
- Tom corporativo (0.1.188; arredondado suave no botão desde a 0.1.192 e em tudo desde a 0.1.193): campo e botão com
32
- 0.75rem (`--select-radius`, `--select-radius-button`), card 1rem, caixa de dentro e menu 0.625rem, item de menu 0.5rem
33
- (`--select-radius-sm`); pílula só em selo. Rótulos de KPI
31
+ Tom corporativo (0.1.188; arredondado suave no botão desde a 0.1.192, em tudo desde a 0.1.193 e bem suave desde a
32
+ 0.1.195): campo e botão com 1rem (`--select-radius`, `--select-radius-button`), card 1.5rem, caixa de dentro e menu
33
+ 1rem, item de menu 0.75rem (`--select-radius-sm`); pílula só em selo. Rótulos de KPI
34
34
  e cabeçalho de tabela em caixa-alta espaçada. Nos gráficos, cor é situação: verde `--select-chart-paid` = pago, dourado
35
35
  `--select-chart-pending` (+ `-edge`) = pendente, `--select-chart-compare` = o período anterior, e os cinzas
36
36
  `--select-chart-ramp-1..4` para categoria. O app que quer o visual antigo sobrescreve esses tokens.
37
37
 
38
+ O card mostra o dado; a explicação vai no tooltip (0.1.196). O "i" `help` está no `SelectSection`, no
39
+ `SelectDataTable`, no `SelectChartCard`, no `SelectKpiCard`, no `SelectListCard`, em cada número do `SelectMiniStats` e
40
+ em cada balde do `SelectBalanceCard`. Na `SelectShareBar`, cada faixa tem o seu tooltip, e a nota da parte vai em
41
+ `tip`; o que o clique faz vai em `selectHint`/`clearHint`, no lugar da linha `hint`.
42
+
38
43
  Peer deps: **react**, **react-dom** (obrigatórios); **gsap** (opcional — só componentes animados),
39
44
  **react-router-dom** (opcional). Tematização = sobrescrever os tokens CSS `--select-*` / `--sw-*`.
40
45
 
@@ -4,8 +4,10 @@ export interface SelectBalanceBucket {
4
4
  cents: number | string | null | undefined;
5
5
  /** Optional icon embedded in the bucket's mini-card. */
6
6
  icon?: ReactNode;
7
- /** One line of context under the amount (hero tiles only) — "Entra no disponível nos próximos dias". */
7
+ /** One line of context under the amount (hero tiles only) — a DADO ("Nada retido agora"), não a definição. */
8
8
  hint?: ReactNode;
9
+ /** O "i" ao lado do rótulo (0.1.196): o que o balde é ("Vira disponível no prazo de cada venda"). */
10
+ help?: ReactNode;
9
11
  }
10
12
  /** One context number on the hero's strip ("Entra nos próximos 7 dias", "Último saque · 23/09"). */
11
13
  export interface SelectBalanceMeta {
@@ -1,6 +1,11 @@
1
1
  import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
2
  type SelectListCardOwnProps = {
3
3
  title?: ReactNode;
4
+ /**
5
+ * O "i" ao lado do título (0.1.196), como o do `SelectSection`: a explicação do card mora aqui, não numa linha do
6
+ * corpo nem na descrição (dono, 03/11/2026 — o card mostra o dado).
7
+ */
8
+ help?: ReactNode;
4
9
  description?: ReactNode;
5
10
  /** Right-aligned action in the header (e.g. an "Add" button). */
6
11
  headerAction?: ReactNode;
@@ -3,8 +3,10 @@ export interface SelectMiniStat {
3
3
  key?: string;
4
4
  label: ReactNode;
5
5
  value: ReactNode;
6
- /** Linha de apoio sob o número ("398 de 1.284", "mediana entre compras"). */
6
+ /** Linha de apoio sob o número — DADO ("398 de 1.284"). A definição do número vai em `help`. */
7
7
  hint?: ReactNode;
8
+ /** O "i" ao lado do rótulo (0.1.196): como o número é contado ("mediana entre compras"). Não vira linha no card. */
9
+ help?: ReactNode;
8
10
  }
9
11
  type SelectMiniStatsOwnProps = {
10
12
  items: SelectMiniStat[];
@@ -10,6 +10,8 @@ export interface SelectShareItem {
10
10
  valueText?: ReactNode;
11
11
  /** Na legenda em fichas: o número em negrito ao lado do rótulo (a contagem). */
12
12
  count?: ReactNode;
13
+ /** A nota da parte, no tooltip da faixa e da ficha (0.1.196): "Inclui 203 Pix vencidos…". Nunca uma linha no card. */
14
+ tip?: ReactNode;
13
15
  }
14
16
  type SelectShareBarOwnProps = {
15
17
  items: SelectShareItem[];
@@ -23,9 +25,13 @@ type SelectShareBarOwnProps = {
23
25
  onSelect?: (key: string) => void;
24
26
  /** A parte escolhida (as outras esmaecem). */
25
27
  selected?: string | null;
26
- /** Linha discreta sob a legenda. */
28
+ /** Linha discreta sob a legenda. Prefira o tooltip: a explicação vai no `tip` da parte e o clique em `selectHint`. */
27
29
  hint?: ReactNode;
30
+ /** Com `onSelect`, a última linha do tooltip de cada faixa e ficha (0.1.196). Padrão: "Clique para filtrar." */
31
+ selectHint?: ReactNode;
32
+ /** A mesma linha na parte escolhida. Padrão: "Clique de novo para ver todas." */
33
+ clearHint?: ReactNode;
28
34
  };
29
35
  export type SelectShareBarProps = SelectShareBarOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectShareBarOwnProps>;
30
- export declare function SelectShareBar({ items, label, aside, legend, size, onSelect, selected, hint, className, ...rest }: SelectShareBarProps): import("react").JSX.Element | null;
36
+ export declare function SelectShareBar({ items, label, aside, legend, size, onSelect, selected, hint, selectHint, clearHint, className, ...rest }: SelectShareBarProps): import("react").JSX.Element | null;
31
37
  export {};
package/dist/index.js CHANGED
@@ -12783,14 +12783,21 @@ var Mu = "allow-scripts allow-same-origin allow-forms", Nu = 390, Pu = 1280, Fu
12783
12783
  children: [
12784
12784
  /* @__PURE__ */ y("div", {
12785
12785
  className: "select-balance-hero__tilehead",
12786
- children: [e.icon && /* @__PURE__ */ v("span", {
12787
- className: "select-balance-hero__tileicon",
12788
- children: e.icon
12789
- }), /* @__PURE__ */ v("span", {
12790
- className: "select-balance-hero__tilelabel",
12791
- title: e.label,
12792
- children: e.label
12793
- })]
12786
+ children: [
12787
+ e.icon && /* @__PURE__ */ v("span", {
12788
+ className: "select-balance-hero__tileicon",
12789
+ children: e.icon
12790
+ }),
12791
+ /* @__PURE__ */ v("span", {
12792
+ className: "select-balance-hero__tilelabel",
12793
+ title: e.label,
12794
+ children: e.label
12795
+ }),
12796
+ e.help != null && /* @__PURE__ */ v(Mn, {
12797
+ content: e.help,
12798
+ label: `Sobre ${e.label}`
12799
+ })
12800
+ ]
12794
12801
  }),
12795
12802
  /* @__PURE__ */ v("span", {
12796
12803
  className: "select-balance-hero__tileamount",
@@ -12844,10 +12851,13 @@ var Mu = "allow-scripts allow-same-origin allow-forms", Nu = 390, Pu = 1280, Fu
12844
12851
  children: e.icon
12845
12852
  }), /* @__PURE__ */ y("span", {
12846
12853
  className: "select-balance__bucketbody",
12847
- children: [/* @__PURE__ */ v("span", {
12854
+ children: [/* @__PURE__ */ y("span", {
12848
12855
  className: "select-balance__bucketlabel",
12849
12856
  title: e.label,
12850
- children: e.label
12857
+ children: [e.label, e.help != null && /* @__PURE__ */ v(Mn, {
12858
+ content: e.help,
12859
+ label: `Sobre ${e.label}`
12860
+ })]
12851
12861
  }), /* @__PURE__ */ v("span", {
12852
12862
  className: "select-balance__bucketamount",
12853
12863
  children: /* @__PURE__ */ v(Gl, { cents: e.cents })
@@ -15073,17 +15083,38 @@ function Yd({ items: e, className: t, ...n }) {
15073
15083
  }
15074
15084
  //#endregion
15075
15085
  //#region src/SelectShareBar.tsx
15076
- function Xd({ items: e, label: t, aside: n, legend: r = "list", size: i = "sm", onSelect: a, selected: o, hint: s, className: c, ...l }) {
15077
- let u = e.map((e, t) => ({
15086
+ function Xd({ items: e, label: t, aside: n, legend: r = "list", size: i = "sm", onSelect: a, selected: o, hint: s, selectHint: c = "Clique para filtrar.", clearHint: l = "Clique de novo para ver todas.", className: u, ...d }) {
15087
+ let f = e.map((e, t) => ({
15078
15088
  ...e,
15079
15089
  key: e.key ?? e.label,
15080
15090
  color: e.color ?? X(t)
15081
- })).filter((e) => e.value > 0), d = u.reduce((e, t) => e + t.value, 0);
15082
- if (d <= 0) return null;
15083
- let f = (e) => Math.round(e / d * 100), p = (e) => o != null && o !== e;
15091
+ })).filter((e) => e.value > 0), p = f.reduce((e, t) => e + t.value, 0);
15092
+ if (p <= 0) return null;
15093
+ let m = (e) => Math.round(e / p * 100), h = (e) => o != null && o !== e, g = (e, t) => {
15094
+ let n = a ? o === e.key ? l : c : null;
15095
+ return !t && e.tip == null && n == null ? null : /* @__PURE__ */ y("span", {
15096
+ className: "select-sharebar__tip",
15097
+ children: [
15098
+ t && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("strong", { children: e.label }), /* @__PURE__ */ y("span", { children: [
15099
+ e.count != null && /* @__PURE__ */ y(_, { children: [e.count, " · "] }),
15100
+ e.valueText != null && /* @__PURE__ */ y(_, { children: [e.valueText, " · "] }),
15101
+ m(e.value),
15102
+ "%"
15103
+ ] })] }),
15104
+ e.tip != null && /* @__PURE__ */ v("span", { children: e.tip }),
15105
+ n != null && /* @__PURE__ */ v("span", {
15106
+ className: "select-sharebar__tipaction",
15107
+ children: n
15108
+ })
15109
+ ]
15110
+ });
15111
+ }, b = (e, t) => e == null ? t : /* @__PURE__ */ v(wn, {
15112
+ content: e,
15113
+ children: t
15114
+ });
15084
15115
  return /* @__PURE__ */ y("div", {
15085
- ...l,
15086
- className: `select-sharebar select-sharebar--${i}${r === "chips" ? " select-sharebar--chips" : ""}${c ? " " + c : ""}`,
15116
+ ...d,
15117
+ className: `select-sharebar select-sharebar--${i}${r === "chips" ? " select-sharebar--chips" : ""}${u ? " " + u : ""}`,
15087
15118
  children: [
15088
15119
  (t != null || n != null) && /* @__PURE__ */ y("div", {
15089
15120
  className: "select-sharebar__head",
@@ -15092,28 +15123,31 @@ function Xd({ items: e, label: t, aside: n, legend: r = "list", size: i = "sm",
15092
15123
  /* @__PURE__ */ v("div", {
15093
15124
  className: "select-sharebar__track",
15094
15125
  role: a ? "group" : "img",
15095
- "aria-label": u.map((e) => `${e.label} ${f(e.value)}%`).join(", "),
15096
- children: u.map((e) => a ? /* @__PURE__ */ v("button", {
15097
- type: "button",
15098
- className: `select-sharebar__seg select-sharebar__seg--btn${p(e.key) ? " is-dim" : ""}`,
15099
- style: {
15100
- width: `${e.value / d * 100}%`,
15101
- background: e.color
15102
- },
15103
- "aria-label": `${e.label}: ${f(e.value)}%`,
15104
- "aria-pressed": o === e.key,
15105
- onClick: () => a(e.key)
15106
- }, e.key) : /* @__PURE__ */ v("span", {
15107
- className: `select-sharebar__seg${p(e.key) ? " is-dim" : ""}`,
15108
- style: {
15109
- width: `${e.value / d * 100}%`,
15110
- background: e.color
15111
- }
15126
+ "aria-label": f.map((e) => `${e.label} ${m(e.value)}%`).join(", "),
15127
+ children: f.map((e) => /* @__PURE__ */ v(wn, {
15128
+ content: g(e, !0),
15129
+ children: a ? /* @__PURE__ */ v("button", {
15130
+ type: "button",
15131
+ className: `select-sharebar__seg select-sharebar__seg--btn${h(e.key) ? " is-dim" : ""}`,
15132
+ style: {
15133
+ width: `${e.value / p * 100}%`,
15134
+ background: e.color
15135
+ },
15136
+ "aria-label": `${e.label}: ${m(e.value)}%`,
15137
+ "aria-pressed": o === e.key,
15138
+ onClick: () => a(e.key)
15139
+ }) : /* @__PURE__ */ v("span", {
15140
+ className: `select-sharebar__seg${h(e.key) ? " is-dim" : ""}`,
15141
+ style: {
15142
+ width: `${e.value / p * 100}%`,
15143
+ background: e.color
15144
+ }
15145
+ })
15112
15146
  }, e.key))
15113
15147
  }),
15114
15148
  r === "chips" ? /* @__PURE__ */ v("ul", {
15115
15149
  className: "select-sharebar__chips",
15116
- children: u.map((e) => {
15150
+ children: f.map((e) => {
15117
15151
  let t = /* @__PURE__ */ y(_, { children: [
15118
15152
  /* @__PURE__ */ v("span", {
15119
15153
  className: "select-sharebar__dot",
@@ -15133,20 +15167,20 @@ function Xd({ items: e, label: t, aside: n, legend: r = "list", size: i = "sm",
15133
15167
  children: e.valueText
15134
15168
  })
15135
15169
  ] });
15136
- return /* @__PURE__ */ v("li", { children: a ? /* @__PURE__ */ v("button", {
15170
+ return /* @__PURE__ */ v("li", { children: b(g(e, !1), a ? /* @__PURE__ */ v("button", {
15137
15171
  type: "button",
15138
- className: `select-sharebar__chip select-sharebar__chip--btn${o === e.key ? " is-selected" : ""}${p(e.key) ? " is-dim" : ""}`,
15172
+ className: `select-sharebar__chip select-sharebar__chip--btn${o === e.key ? " is-selected" : ""}${h(e.key) ? " is-dim" : ""}`,
15139
15173
  "aria-pressed": o === e.key,
15140
15174
  onClick: () => a(e.key),
15141
15175
  children: t
15142
15176
  }) : /* @__PURE__ */ v("span", {
15143
15177
  className: "select-sharebar__chip",
15144
15178
  children: t
15145
- }) }, e.key);
15179
+ })) }, e.key);
15146
15180
  })
15147
15181
  }) : /* @__PURE__ */ v("ul", {
15148
15182
  className: "select-sharebar__legend",
15149
- children: u.map((e) => /* @__PURE__ */ y("li", {
15183
+ children: f.map((e) => /* @__PURE__ */ y("li", {
15150
15184
  className: "select-sharebar__item",
15151
15185
  children: [
15152
15186
  /* @__PURE__ */ v("span", {
@@ -15154,17 +15188,20 @@ function Xd({ items: e, label: t, aside: n, legend: r = "list", size: i = "sm",
15154
15188
  style: { background: e.color },
15155
15189
  "aria-hidden": "true"
15156
15190
  }),
15157
- /* @__PURE__ */ v("span", {
15191
+ b(e.tip == null ? null : /* @__PURE__ */ v("span", {
15192
+ className: "select-sharebar__tip",
15193
+ children: e.tip
15194
+ }), /* @__PURE__ */ v("span", {
15158
15195
  className: "select-sharebar__label",
15159
15196
  children: e.label
15160
- }),
15197
+ })),
15161
15198
  e.valueText != null && /* @__PURE__ */ v("span", {
15162
15199
  className: "select-sharebar__value",
15163
15200
  children: e.valueText
15164
15201
  }),
15165
15202
  /* @__PURE__ */ y("span", {
15166
15203
  className: "select-sharebar__pct",
15167
- children: [f(e.value), "%"]
15204
+ children: [m(e.value), "%"]
15168
15205
  })
15169
15206
  ]
15170
15207
  }, e.key))
@@ -15420,9 +15457,9 @@ var Zd = r(function({ value: e, max: t = 100, size: n = 64, thickness: r, tone:
15420
15457
  children: e.map((e, t) => /* @__PURE__ */ y("div", {
15421
15458
  className: "select-ministats__item",
15422
15459
  children: [
15423
- /* @__PURE__ */ v("dt", {
15424
- className: "select-ministats__label",
15425
- children: e.label
15460
+ /* @__PURE__ */ y("dt", {
15461
+ className: `select-ministats__label${e.help == null ? "" : " select-ministats__label--help"}`,
15462
+ children: [e.label, e.help != null && /* @__PURE__ */ v(Mn, { content: e.help })]
15426
15463
  }),
15427
15464
  /* @__PURE__ */ v("dd", {
15428
15465
  className: "select-ministats__value",
@@ -30466,38 +30503,38 @@ var Vp = r(function({ name: e, price: t, priceSuffix: n, headerAction: r, summar
30466
30503
  })]
30467
30504
  })]
30468
30505
  });
30469
- }), Hp = r(function({ title: e, description: t, headerAction: n, footer: r, dense: i = !1, spread: a = !1, flush: o = !1, children: s, className: c, ...l }, u) {
30506
+ }), Hp = r(function({ title: e, help: t, description: n, headerAction: r, footer: i, dense: a = !1, spread: o = !1, flush: s = !1, children: c, className: l, ...u }, d) {
30470
30507
  return /* @__PURE__ */ y("div", {
30471
- ref: u,
30472
- ...l,
30473
- className: `select-listcard${i ? " select-listcard--dense" : ""}${a ? " select-listcard--spread" : ""}${o ? " select-listcard--flush" : ""}${c ? " " + c : ""}`,
30508
+ ref: d,
30509
+ ...u,
30510
+ className: `select-listcard${a ? " select-listcard--dense" : ""}${o ? " select-listcard--spread" : ""}${s ? " select-listcard--flush" : ""}${l ? " " + l : ""}`,
30474
30511
  children: [
30475
- (e || n) && /* @__PURE__ */ y("div", {
30512
+ (e || r) && /* @__PURE__ */ y("div", {
30476
30513
  className: "select-listcard__head",
30477
30514
  children: [/* @__PURE__ */ y("div", {
30478
30515
  className: "select-listcard__heading",
30479
- children: [e && /* @__PURE__ */ v("h3", {
30480
- className: "select-listcard__title",
30481
- children: e
30482
- }), t && /* @__PURE__ */ v("p", {
30516
+ children: [e && /* @__PURE__ */ y("h3", {
30517
+ className: `select-listcard__title${t == null ? "" : " select-listcard__title--help"}`,
30518
+ children: [e, t != null && /* @__PURE__ */ v(Mn, { content: t })]
30519
+ }), n && /* @__PURE__ */ v("p", {
30483
30520
  className: "select-listcard__desc",
30484
- children: t
30521
+ children: n
30485
30522
  })]
30486
- }), n && /* @__PURE__ */ v("div", {
30523
+ }), r && /* @__PURE__ */ v("div", {
30487
30524
  className: "select-listcard__headeraction",
30488
- children: n
30525
+ children: r
30489
30526
  })]
30490
30527
  }),
30491
30528
  /* @__PURE__ */ v("div", {
30492
30529
  className: "select-listcard__body",
30493
30530
  children: /* @__PURE__ */ v("div", {
30494
30531
  className: "select-listcard__rows",
30495
- children: s
30532
+ children: c
30496
30533
  })
30497
30534
  }),
30498
- r && /* @__PURE__ */ v("div", {
30535
+ i && /* @__PURE__ */ v("div", {
30499
30536
  className: "select-listcard__footer",
30500
- children: r
30537
+ children: i
30501
30538
  })
30502
30539
  ]
30503
30540
  });