@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.
- package/dist/SelectRetryStatus.d.ts +7 -2
- package/dist/index.js +11 -11
- package/package.json +1 -1
|
@@ -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
|
|
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`,
|
|
5010
|
-
let [
|
|
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 (
|
|
5013
|
-
let n = setInterval(() =>
|
|
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
|
|
5016
|
+
let b;
|
|
5017
5017
|
if (e === "waiting" && t && n) {
|
|
5018
5018
|
let e = Math.max(0, t - Date.now());
|
|
5019
|
-
|
|
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}${
|
|
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(
|
|
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:
|
|
5064
|
+
style: b
|
|
5065
5065
|
}, t ?? e)
|
|
5066
5066
|
}),
|
|
5067
|
-
|
|
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