@selectwin/kit 0.1.100 → 0.1.101

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.
@@ -6,7 +6,8 @@ export type SelectRetryStatusProps = {
6
6
  nextAttemptAt?: number | null;
7
7
  /** Length of the current wait in ms — where the bar started from. */
8
8
  waitMs?: number;
9
- /** Attempts already made; shown as a quiet caption when > 0. */
9
+ /** Attempts already made — the quiet caption under the bar. The caption line is ALWAYS there
10
+ * (its text changes per phase) so the box keeps its height and a centered modal doesn't hop. */
10
11
  attempt?: number;
11
12
  /** In-flight indicator (phase `trying`); defaults to the kit ring. */
12
13
  mark?: ReactNode;
@@ -16,6 +17,10 @@ export type SelectRetryStatusProps = {
16
17
  tryingLabel?: ReactNode;
17
18
  doneLabel?: ReactNode;
18
19
  attemptLabel?: (attempt: number) => ReactNode;
20
+ /** Caption before any attempt was made. */
21
+ firstLabel?: ReactNode;
22
+ /** Caption once it worked. */
23
+ doneCaption?: ReactNode;
19
24
  className?: string;
20
25
  };
21
- export declare function SelectRetryStatus({ phase, nextAttemptAt, waitMs, attempt, mark, action, waitingLabel, tryingLabel, doneLabel, attemptLabel, className, }: SelectRetryStatusProps): import("react").JSX.Element;
26
+ export declare function SelectRetryStatus({ phase, nextAttemptAt, waitMs, attempt, mark, action, waitingLabel, tryingLabel, doneLabel, attemptLabel, firstLabel, doneCaption, className, }: SelectRetryStatusProps): import("react").JSX.Element;
package/dist/index.js CHANGED
@@ -5006,23 +5006,23 @@ function Xr(e) {
5006
5006
  function Zr({ phase: e, nextAttemptAt: t, waitMs: n, attempt: r = 0, mark: i, action: a, waitingLabel: s = (e) => /* @__PURE__ */ h(p, { children: ["Nova tentativa em ", /* @__PURE__ */ h("span", {
5007
5007
  className: "select-retry__num",
5008
5008
  children: [e, "s"]
5009
- })] }), tryingLabel: c = "Reconectando…", doneLabel: l = "Conexão restabelecida", attemptLabel: u = (e) => e === 1 ? "1 tentativa sem resposta" : `${e} tentativas sem resposta`, className: f }) {
5010
- let [g, _] = d(() => Xr(t));
5009
+ })] }), tryingLabel: c = "Reconectando…", doneLabel: l = "Conexão restabelecida", attemptLabel: u = (e) => e === 1 ? "1 tentativa sem resposta" : `${e} tentativas sem resposta`, firstLabel: f = "Primeira tentativa a caminho", doneCaption: g = "Atualizando seus dados", className: _ }) {
5010
+ let [v, y] = d(() => Xr(t));
5011
5011
  o(() => {
5012
- if (_(Xr(t)), e !== "waiting" || !t) return;
5013
- let n = setInterval(() => _(Xr(t)), 250);
5012
+ if (y(Xr(t)), e !== "waiting" || !t) return;
5013
+ let n = setInterval(() => y(Xr(t)), 250);
5014
5014
  return () => clearInterval(n);
5015
5015
  }, [e, t]);
5016
- let v;
5016
+ let b;
5017
5017
  if (e === "waiting" && t && n) {
5018
5018
  let e = Math.max(0, t - Date.now());
5019
- v = {
5019
+ b = {
5020
5020
  "--select-retry-from": String(Math.min(1, e / n)),
5021
5021
  animationDuration: `${e}ms`
5022
5022
  };
5023
5023
  }
5024
5024
  return /* @__PURE__ */ h("div", {
5025
- className: `select-retry select-retry--${e}${f ? " " + f : ""}`,
5025
+ className: `select-retry select-retry--${e}${_ ? " " + _ : ""}`,
5026
5026
  children: [
5027
5027
  /* @__PURE__ */ h("div", {
5028
5028
  className: "select-retry__line",
@@ -5048,7 +5048,7 @@ function Zr({ phase: e, nextAttemptAt: t, waitMs: n, attempt: r = 0, mark: i, ac
5048
5048
  }),
5049
5049
  /* @__PURE__ */ m("span", {
5050
5050
  className: "select-retry__label",
5051
- children: e === "waiting" ? s(g) : e === "trying" ? c : l
5051
+ children: e === "waiting" ? s(v) : e === "trying" ? c : l
5052
5052
  }),
5053
5053
  e === "waiting" && a != null && /* @__PURE__ */ m("span", {
5054
5054
  className: "select-retry__action",
@@ -5061,12 +5061,12 @@ function Zr({ phase: e, nextAttemptAt: t, waitMs: n, attempt: r = 0, mark: i, ac
5061
5061
  "aria-hidden": "true",
5062
5062
  children: /* @__PURE__ */ m("div", {
5063
5063
  className: "select-retry__fill",
5064
- style: v
5064
+ style: b
5065
5065
  }, t ?? e)
5066
5066
  }),
5067
- r > 0 && e !== "done" && /* @__PURE__ */ m("p", {
5067
+ /* @__PURE__ */ m("p", {
5068
5068
  className: "select-retry__caption",
5069
- children: u(r)
5069
+ children: e === "done" ? g : r > 0 ? u(r) : f
5070
5070
  })
5071
5071
  ]
5072
5072
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selectwin/kit",
3
- "version": "0.1.100",
3
+ "version": "0.1.101",
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": {