@selectwin/kit 0.1.111 → 0.1.112

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.
@@ -20,11 +20,17 @@ export declare function SelectMoney({ cents, sensitive, }: {
20
20
  sensitive?: boolean;
21
21
  }): import("react").JSX.Element;
22
22
  type SelectMetricDeltaOwnProps = {
23
- /** Variation as a percentage (e.g. 12.4 or -3.1). null → "—". */
23
+ /** Variation as a percentage (e.g. 12.4 or -3.1), or in percentage POINTS with `unit="points"`. null → "—". */
24
24
  value: number | null | undefined;
25
25
  /** When true a negative delta is the good one (chargeback, recusas) → green. */
26
26
  invert?: boolean;
27
27
  caption?: string;
28
+ /**
29
+ * `percent` (default): relative change — "▲ +12,4%".
30
+ * `points`: difference between two RATES, in percentage points — "▲ +2,3 p.p.". A taxa de
31
+ * aprovação que foi de 80% para 82% subiu 2 p.p., não 2%: com o "%" o lojista lê variação relativa.
32
+ */
33
+ unit?: 'percent' | 'points';
28
34
  };
29
35
  export type SelectMetricDeltaProps = SelectMetricDeltaOwnProps & Omit<ComponentPropsWithoutRef<'span'>, keyof SelectMetricDeltaOwnProps>;
30
36
  export declare const SelectMetricDelta: import('react').ForwardRefExoticComponent<SelectMetricDeltaOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, keyof SelectMetricDeltaOwnProps> & import('react').RefAttributes<HTMLSpanElement>>;
package/dist/index.js CHANGED
@@ -7243,24 +7243,24 @@ var Ya = new Intl.NumberFormat("pt-BR", {
7243
7243
  signDisplay: "exceptZero",
7244
7244
  minimumFractionDigits: 1,
7245
7245
  maximumFractionDigits: 1
7246
- }), Xa = r(function({ value: e, invert: t = !1, caption: n, className: r, ...i }, a) {
7246
+ }), Xa = r(function({ value: e, invert: t = !1, caption: n, unit: r = "percent", className: i, ...a }, o) {
7247
7247
  if (e == null || !Number.isFinite(e)) return /* @__PURE__ */ h("span", {
7248
- ref: a,
7249
- ...i,
7250
- className: `select-delta select-delta--muted${r ? " " + r : ""}`,
7248
+ ref: o,
7249
+ ...a,
7250
+ className: `select-delta select-delta--muted${i ? " " + i : ""}`,
7251
7251
  children: ["—", n ? ` ${n}` : ""]
7252
7252
  });
7253
- let o = e === 0, s = e > 0, c = o ? null : t ? !s : s, l = c == null ? "muted" : c ? "up" : "down", u = o ? "" : s ? "▲" : "▼";
7253
+ let s = e === 0, c = e > 0, l = s ? null : t ? !c : c, u = l == null ? "muted" : l ? "up" : "down", d = s ? "" : c ? "▲" : "▼";
7254
7254
  return /* @__PURE__ */ h("span", {
7255
- ref: a,
7256
- ...i,
7257
- className: `select-delta${r ? " " + r : ""}`,
7255
+ ref: o,
7256
+ ...a,
7257
+ className: `select-delta${i ? " " + i : ""}`,
7258
7258
  children: [/* @__PURE__ */ h("span", {
7259
- className: `select-delta__value select-delta__value--${l}`,
7259
+ className: `select-delta__value select-delta__value--${u}`,
7260
7260
  children: [
7261
- u ? `${u} ` : "",
7261
+ d ? `${d} ` : "",
7262
7262
  Ya.format(e),
7263
- "%"
7263
+ r === "points" ? " p.p." : "%"
7264
7264
  ]
7265
7265
  }), n != null && /* @__PURE__ */ m("span", {
7266
7266
  className: "select-delta__caption",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selectwin/kit",
3
- "version": "0.1.111",
3
+ "version": "0.1.112",
4
4
  "description": "Selectwin design-system kit — primitivos React, charts SVG e tokens (theme-aware, sem dependência de biblioteca de chart).",
5
5
  "type": "module",
6
6
  "repository": {