@selectwin/kit 0.1.228 → 0.1.230
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/SelectCarousel.d.ts +6 -1
- package/dist/SelectCarousel.js +46 -46
- package/dist/SelectConfirmModal.js +27 -30
- package/dist/SelectDonut.d.ts +14 -1
- package/dist/SelectDonut.js +119 -75
- package/dist/SelectFormModal.d.ts +3 -1
- package/dist/SelectFormModal.js +35 -37
- package/dist/SelectKpiBand.d.ts +2 -0
- package/dist/SelectKpiBand.js +8 -8
- package/dist/SelectLocale.d.ts +4 -0
- package/dist/SelectLocale.js +2 -0
- package/dist/SelectModal.d.ts +14 -1
- package/dist/SelectModal.js +110 -100
- package/dist/SelectSetupGuide.d.ts +5 -0
- package/dist/SelectSetupGuide.js +83 -72
- package/dist/index.d.ts +1 -1
- package/dist/index.js +130 -130
- package/dist/style.css +1 -1
- package/package.json +67 -67
package/dist/SelectLocale.d.ts
CHANGED
|
@@ -81,6 +81,10 @@ export interface SelectKitMessages {
|
|
|
81
81
|
progressLabel: string;
|
|
82
82
|
progress: (done: string, total: string) => string;
|
|
83
83
|
};
|
|
84
|
+
/** 0.1.230: os textos dos gráficos — a linha da dica da rosca (`SelectDonut`). */
|
|
85
|
+
chart: {
|
|
86
|
+
value: string;
|
|
87
|
+
};
|
|
84
88
|
sideNav: {
|
|
85
89
|
pending: (hint: string) => string;
|
|
86
90
|
};
|
package/dist/SelectLocale.js
CHANGED
|
@@ -86,6 +86,7 @@ var r = {
|
|
|
86
86
|
progressLabel: "Progresso",
|
|
87
87
|
progress: (e, t) => `${e} de ${t}`
|
|
88
88
|
},
|
|
89
|
+
chart: { value: "Valor" },
|
|
89
90
|
sideNav: { pending: (e) => `${e} (com pendências)` },
|
|
90
91
|
auth: {
|
|
91
92
|
digit: (e) => `Dígito ${e}`,
|
|
@@ -250,6 +251,7 @@ var r = {
|
|
|
250
251
|
progressLabel: "Progress",
|
|
251
252
|
progress: (e, t) => `${e} of ${t}`
|
|
252
253
|
},
|
|
254
|
+
chart: { value: "Value" },
|
|
253
255
|
sideNav: { pending: (e) => `${e} (pending)` },
|
|
254
256
|
auth: {
|
|
255
257
|
digit: (e) => `Digit ${e}`,
|
package/dist/SelectModal.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* 0.1.229: a fileira de botões do rodapé do modal — ocupa o rodapé e alinha os botões à direita, com o vão do kit. É a
|
|
4
|
+
* que o SelectConfirmModal e o SelectFormModal usam; vai no `footer` do SelectModal quando a tela monta o próprio rodapé.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SelectModalActions({ children, className }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function SelectModal({ open, onClose, eyebrow, title, subtitle, description, badge, children, footer, aside, size, showClose, noise, dividedHeader, backdrop, theme, placement, headerAction, flush, dismissible, }: {
|
|
3
11
|
open: boolean;
|
|
4
12
|
onClose: () => void;
|
|
5
13
|
/** Uma linha de contexto acima do título ("Passo a passo · ponto 1 de 5"). */
|
|
6
14
|
eyebrow?: ReactNode;
|
|
7
15
|
title?: ReactNode;
|
|
8
16
|
subtitle?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* 0.1.230: a descrição do diálogo no COMEÇO do corpo, em texto secundário (o cabeçalho fica só com o título). É o lugar
|
|
19
|
+
* dela no modal novo; o `subtitle` (na cabeça) fica para quem já o usa.
|
|
20
|
+
*/
|
|
21
|
+
description?: ReactNode;
|
|
9
22
|
/** 0.1.184: o selo da situação (`SelectBadge`), na linha do subtítulo, antes dele ("Aberto · Chamado · Estorno"). */
|
|
10
23
|
badge?: ReactNode;
|
|
11
24
|
children?: ReactNode;
|
package/dist/SelectModal.js
CHANGED
|
@@ -2,51 +2,57 @@
|
|
|
2
2
|
import { CloseIcon as e } from "./icons.js";
|
|
3
3
|
import { useSelectMessages as t } from "./SelectLocale.js";
|
|
4
4
|
import { useFocusTrap as n } from "./internal/useFocusTrap.js";
|
|
5
|
-
import { LayerProvider as r, isTopLayer as
|
|
6
|
-
import { FrameBody as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { createPortal as
|
|
5
|
+
import { LayerProvider as r, isTopLayer as ee, openLayer as i, useParentLayer as a } from "./internal/layers.js";
|
|
6
|
+
import { FrameBody as o } from "./internal/frame.js";
|
|
7
|
+
import { useEffect as s, useId as c, useRef as l, useState as u } from "react";
|
|
8
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as m } from "react-dom";
|
|
10
10
|
//#region src/SelectModal.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
var h = 220;
|
|
12
|
+
function g({ children: e, className: t }) {
|
|
13
|
+
return /* @__PURE__ */ f("div", {
|
|
14
|
+
className: `select-modal__actions${t ? " " + t : ""}`,
|
|
15
|
+
children: e
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
}
|
|
18
|
+
function _({ open: g, onClose: _, eyebrow: v, title: y, subtitle: b, description: x, badge: S, children: C, footer: w, aside: T, size: E = "md", showClose: D = !0, noise: O = !0, dividedHeader: k = !1, backdrop: te = "dim", theme: ne = "light", placement: A = "center", headerAction: j, flush: M = !1, dismissible: N = !0 }) {
|
|
19
|
+
let P = t(), [F, I] = u(g), [L, R] = u(!1), z = l(null), B = c(), V = c(), H = c(), [U] = u(() => ({})), W = a(), G = l({
|
|
20
|
+
onClose: _,
|
|
21
|
+
dismissible: N
|
|
22
|
+
});
|
|
23
|
+
G.current = {
|
|
24
|
+
onClose: _,
|
|
25
|
+
dismissible: N
|
|
20
26
|
};
|
|
21
|
-
let [
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
if (!
|
|
27
|
+
let [K] = u(() => g && typeof document < "u" ? document.activeElement : null), q = l(null);
|
|
28
|
+
s(() => {
|
|
29
|
+
if (g) {
|
|
30
|
+
if (!q.current) {
|
|
25
31
|
var e;
|
|
26
|
-
let t = document.activeElement, n = t instanceof HTMLElement && t !== document.body && !((e =
|
|
27
|
-
|
|
32
|
+
let t = document.activeElement, n = t instanceof HTMLElement && t !== document.body && !((e = z.current) != null && e.contains(t));
|
|
33
|
+
q.current = n ? t : K instanceof HTMLElement && K !== document.body ? K : null;
|
|
28
34
|
}
|
|
29
|
-
|
|
30
|
-
} else if (
|
|
35
|
+
I(!0), R(!1);
|
|
36
|
+
} else if (F) {
|
|
31
37
|
var t;
|
|
32
|
-
|
|
33
|
-
let e =
|
|
34
|
-
|
|
38
|
+
R(!0);
|
|
39
|
+
let e = q.current;
|
|
40
|
+
q.current = null;
|
|
35
41
|
let n = document.activeElement;
|
|
36
|
-
e != null && e.isConnected && (!n || n === document.body || (t =
|
|
42
|
+
e != null && e.isConnected && (!n || n === document.body || (t = z.current) != null && t.contains(n)) && e.focus({ preventScroll: !0 });
|
|
37
43
|
let r = setTimeout(() => {
|
|
38
|
-
|
|
39
|
-
},
|
|
44
|
+
I(!1), R(!1);
|
|
45
|
+
}, h);
|
|
40
46
|
return () => clearTimeout(r);
|
|
41
47
|
}
|
|
42
48
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
]),
|
|
47
|
-
if (!
|
|
48
|
-
let e =
|
|
49
|
-
e.key === "Escape" && !e.defaultPrevented &&
|
|
49
|
+
g,
|
|
50
|
+
F,
|
|
51
|
+
K
|
|
52
|
+
]), s(() => {
|
|
53
|
+
if (!F) return;
|
|
54
|
+
let e = i(U, W), t = (e) => {
|
|
55
|
+
e.key === "Escape" && !e.defaultPrevented && ee(U) && G.current.dismissible && G.current.onClose();
|
|
50
56
|
};
|
|
51
57
|
document.addEventListener("keydown", t);
|
|
52
58
|
let n = document.body.style.overflow;
|
|
@@ -54,124 +60,128 @@ function _({ open: _, onClose: v, eyebrow: y, title: b, subtitle: x, badge: S, c
|
|
|
54
60
|
e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
|
|
55
61
|
};
|
|
56
62
|
}, [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
F,
|
|
64
|
+
U,
|
|
65
|
+
W
|
|
60
66
|
]);
|
|
61
|
-
let
|
|
62
|
-
if (
|
|
63
|
-
if (!
|
|
64
|
-
let e =
|
|
67
|
+
let J = F && !L;
|
|
68
|
+
if (s(() => {
|
|
69
|
+
if (!J) return;
|
|
70
|
+
let e = z.current;
|
|
65
71
|
e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
|
|
66
|
-
}, [
|
|
67
|
-
let
|
|
68
|
-
id:
|
|
72
|
+
}, [J]), n(J, z, { initialFocus: !1 }), !F) return null;
|
|
73
|
+
let Y = S ? /* @__PURE__ */ p("p", {
|
|
74
|
+
id: V,
|
|
69
75
|
className: "select-modal__subtitle select-modal__subtitle--badge",
|
|
70
|
-
children: [S,
|
|
71
|
-
}) :
|
|
72
|
-
id:
|
|
76
|
+
children: [S, b ? /* @__PURE__ */ f("span", { children: b }) : null]
|
|
77
|
+
}) : b && /* @__PURE__ */ f("p", {
|
|
78
|
+
id: V,
|
|
73
79
|
className: "select-modal__subtitle",
|
|
80
|
+
children: b
|
|
81
|
+
}), X = x != null && x !== !1 && x !== "", Z = X && /* @__PURE__ */ f("p", {
|
|
82
|
+
id: H,
|
|
83
|
+
className: "select-modal__description",
|
|
74
84
|
children: x
|
|
75
|
-
}),
|
|
85
|
+
}), re = [b || S ? V : null, X ? H : null].filter(Boolean).join(" ") || void 0, Q = D && N && /* @__PURE__ */ f("button", {
|
|
76
86
|
type: "button",
|
|
77
87
|
className: "select-modal__close",
|
|
78
|
-
"aria-label":
|
|
79
|
-
onClick:
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
-
}),
|
|
82
|
-
className: `select select-modal__overlay${
|
|
83
|
-
"data-theme":
|
|
84
|
-
onMouseDown:
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
className: `select-modal select-modal--${E}${
|
|
87
|
-
ref:
|
|
88
|
+
"aria-label": P.common.close,
|
|
89
|
+
onClick: _,
|
|
90
|
+
children: /* @__PURE__ */ f(e, {})
|
|
91
|
+
}), $ = `select-modal__header${k ? " select-modal__header--divided" : ""}`, ie = /* @__PURE__ */ f("div", {
|
|
92
|
+
className: `select select-modal__overlay${A === "side" ? " select-modal__overlay--side" : ""}${O ? " select-modal__overlay--noise" : ""}${te === "blur" ? " select-modal__overlay--blur" : ""}${L ? " select-modal__overlay--closing" : ""}`,
|
|
93
|
+
"data-theme": ne,
|
|
94
|
+
onMouseDown: N ? _ : void 0,
|
|
95
|
+
children: /* @__PURE__ */ f("div", {
|
|
96
|
+
className: `select-modal select-modal--${E}${A === "side" ? " select-modal--side" : ""}${M ? " select-modal--flush" : ""}${T ? " select-modal--split" : ""}${L ? " select-modal--closing" : ""}`,
|
|
97
|
+
ref: z,
|
|
88
98
|
role: "dialog",
|
|
89
99
|
"aria-modal": "true",
|
|
90
|
-
"aria-labelledby":
|
|
91
|
-
"aria-describedby":
|
|
100
|
+
"aria-labelledby": y ? B : void 0,
|
|
101
|
+
"aria-describedby": re,
|
|
92
102
|
tabIndex: -1,
|
|
93
103
|
onMouseDown: (e) => e.stopPropagation(),
|
|
94
|
-
children: T ? /* @__PURE__ */
|
|
104
|
+
children: T ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("aside", {
|
|
95
105
|
className: "select-modal__aside",
|
|
96
106
|
children: T
|
|
97
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ p("div", {
|
|
98
108
|
className: "select-modal__content",
|
|
99
109
|
children: [
|
|
100
|
-
|
|
101
|
-
(
|
|
102
|
-
className:
|
|
110
|
+
Q,
|
|
111
|
+
(v || y || b || S) && /* @__PURE__ */ p("div", {
|
|
112
|
+
className: $,
|
|
103
113
|
children: [
|
|
104
|
-
|
|
114
|
+
v && /* @__PURE__ */ f("span", {
|
|
105
115
|
className: "select-modal__eyebrow",
|
|
106
|
-
children:
|
|
116
|
+
children: v
|
|
107
117
|
}),
|
|
108
|
-
|
|
109
|
-
id:
|
|
118
|
+
y && /* @__PURE__ */ f("h2", {
|
|
119
|
+
id: B,
|
|
110
120
|
className: "select-modal__title",
|
|
111
|
-
children:
|
|
121
|
+
children: y
|
|
112
122
|
}),
|
|
113
|
-
|
|
123
|
+
Y
|
|
114
124
|
]
|
|
115
125
|
}),
|
|
116
126
|
/* @__PURE__ */ p("div", {
|
|
117
127
|
className: "select-modal__body",
|
|
118
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: [Z, /* @__PURE__ */ f(o, { children: C })]
|
|
119
129
|
})
|
|
120
130
|
]
|
|
121
|
-
})] }) : /* @__PURE__ */
|
|
122
|
-
|
|
123
|
-
(
|
|
124
|
-
className: `${
|
|
125
|
-
children: [/* @__PURE__ */
|
|
131
|
+
})] }) : /* @__PURE__ */ p(d, { children: [
|
|
132
|
+
Q,
|
|
133
|
+
(v || y || b || S) && (j ? /* @__PURE__ */ p("div", {
|
|
134
|
+
className: `${$} select-modal__header--action`,
|
|
135
|
+
children: [/* @__PURE__ */ p("div", {
|
|
126
136
|
className: "select-modal__headtext",
|
|
127
137
|
children: [
|
|
128
|
-
|
|
138
|
+
v && /* @__PURE__ */ f("span", {
|
|
129
139
|
className: "select-modal__eyebrow",
|
|
130
|
-
children:
|
|
140
|
+
children: v
|
|
131
141
|
}),
|
|
132
|
-
|
|
133
|
-
id:
|
|
142
|
+
y && /* @__PURE__ */ f("h2", {
|
|
143
|
+
id: B,
|
|
134
144
|
className: "select-modal__title",
|
|
135
|
-
children:
|
|
145
|
+
children: y
|
|
136
146
|
}),
|
|
137
|
-
|
|
147
|
+
Y
|
|
138
148
|
]
|
|
139
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ f("div", {
|
|
140
150
|
className: "select-modal__headaction",
|
|
141
|
-
children:
|
|
151
|
+
children: j
|
|
142
152
|
})]
|
|
143
|
-
}) : /* @__PURE__ */
|
|
144
|
-
className:
|
|
153
|
+
}) : /* @__PURE__ */ p("div", {
|
|
154
|
+
className: $,
|
|
145
155
|
children: [
|
|
146
|
-
|
|
156
|
+
v && /* @__PURE__ */ f("span", {
|
|
147
157
|
className: "select-modal__eyebrow",
|
|
148
|
-
children:
|
|
158
|
+
children: v
|
|
149
159
|
}),
|
|
150
|
-
|
|
151
|
-
id:
|
|
160
|
+
y && /* @__PURE__ */ f("h2", {
|
|
161
|
+
id: B,
|
|
152
162
|
className: "select-modal__title",
|
|
153
|
-
children:
|
|
163
|
+
children: y
|
|
154
164
|
}),
|
|
155
|
-
|
|
165
|
+
Y
|
|
156
166
|
]
|
|
157
167
|
})),
|
|
158
|
-
C && /* @__PURE__ */ p("div", {
|
|
168
|
+
(C || X) && /* @__PURE__ */ p("div", {
|
|
159
169
|
className: "select-modal__body",
|
|
160
|
-
children: /* @__PURE__ */
|
|
170
|
+
children: [Z, /* @__PURE__ */ f(o, { children: C })]
|
|
161
171
|
}),
|
|
162
|
-
w && /* @__PURE__ */
|
|
172
|
+
w && /* @__PURE__ */ f("div", {
|
|
163
173
|
className: "select-modal__footer",
|
|
164
174
|
children: w
|
|
165
175
|
})
|
|
166
176
|
] })
|
|
167
177
|
})
|
|
168
178
|
});
|
|
169
|
-
return
|
|
170
|
-
value:
|
|
171
|
-
children:
|
|
179
|
+
return m(/* @__PURE__ */ f(r, {
|
|
180
|
+
value: U,
|
|
181
|
+
children: ie
|
|
172
182
|
}), document.body);
|
|
173
183
|
}
|
|
174
184
|
//#endregion
|
|
175
|
-
export { _ as SelectModal };
|
|
185
|
+
export { _ as SelectModal, g as SelectModalActions };
|
|
176
186
|
|
|
177
187
|
//# sourceMappingURL=SelectModal.js.map
|
|
@@ -42,6 +42,11 @@ type SelectSetupGuideOwnProps = {
|
|
|
42
42
|
minimized?: boolean;
|
|
43
43
|
/** Cor da barra — `sandbox` quando o guia acompanha o ambiente de teste. */
|
|
44
44
|
tone?: 'default' | 'sandbox';
|
|
45
|
+
/**
|
|
46
|
+
* 0.1.230: `strip` = o guia numa linha — o anel do progresso no começo (no lugar da barra), o título e o texto no meio,
|
|
47
|
+
* as ações no fim. Com `minimized`, só a linha; aberto, as etapas embaixo dela.
|
|
48
|
+
*/
|
|
49
|
+
variant?: 'default' | 'strip';
|
|
45
50
|
};
|
|
46
51
|
export type SelectSetupGuideProps = SelectSetupGuideOwnProps & Omit<ComponentPropsWithoutRef<'section'>, keyof SelectSetupGuideOwnProps>;
|
|
47
52
|
export declare const SelectSetupGuide: import('react').ForwardRefExoticComponent<SelectSetupGuideOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, keyof SelectSetupGuideOwnProps> & import('react').RefAttributes<HTMLElement>>;
|
package/dist/SelectSetupGuide.js
CHANGED
|
@@ -3,20 +3,21 @@ import { safeHref as e } from "./internal/safeHref.js";
|
|
|
3
3
|
import { formatSelectNumber as t, useSelectLocale as n, useSelectMessages as r } from "./SelectLocale.js";
|
|
4
4
|
import { useInsideFrame as i } from "./internal/frame.js";
|
|
5
5
|
import { inertProps as a } from "./internal/inert.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { SelectRing as o } from "./SelectRing.js";
|
|
7
|
+
import { forwardRef as s, useEffect as c, useRef as l, useState as u } from "react";
|
|
8
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
import { Link as m } from "react-router-dom";
|
|
9
10
|
//#region src/SelectSetupGuide.tsx
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
function h({ status: e }) {
|
|
12
|
+
return /* @__PURE__ */ f("span", {
|
|
12
13
|
className: `select-setupguide__icon select-setupguide__icon--${e}`,
|
|
13
14
|
"aria-hidden": "true",
|
|
14
|
-
children: e === "done" && /* @__PURE__ */
|
|
15
|
+
children: e === "done" && /* @__PURE__ */ f("svg", {
|
|
15
16
|
viewBox: "0 0 16 16",
|
|
16
17
|
width: "10",
|
|
17
18
|
height: "10",
|
|
18
19
|
fill: "none",
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ f("path", {
|
|
20
21
|
d: "M3.5 8.5l3 3 6-7",
|
|
21
22
|
stroke: "currentColor",
|
|
22
23
|
strokeWidth: "2",
|
|
@@ -26,7 +27,7 @@ function m({ status: e }) {
|
|
|
26
27
|
})
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
var
|
|
30
|
+
var g = /* @__PURE__ */ f("svg", {
|
|
30
31
|
viewBox: "0 0 20 20",
|
|
31
32
|
width: "16",
|
|
32
33
|
height: "16",
|
|
@@ -36,70 +37,70 @@ var h = /* @__PURE__ */ d("svg", {
|
|
|
36
37
|
strokeLinecap: "round",
|
|
37
38
|
strokeLinejoin: "round",
|
|
38
39
|
"aria-hidden": "true",
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ f("path", { d: "M8 5l5 5-5 5" })
|
|
40
41
|
});
|
|
41
|
-
function
|
|
42
|
-
let i = r().setupGuide, [o, s] =
|
|
43
|
-
return /* @__PURE__ */
|
|
42
|
+
function _({ group: t, justDone: n }) {
|
|
43
|
+
let i = r().setupGuide, [o, s] = u(!!(t.collapsible && t.defaultCollapsed)), c = !t.collapsible || !o;
|
|
44
|
+
return /* @__PURE__ */ p("div", {
|
|
44
45
|
className: `select-setupguide__group${c ? "" : " is-collapsed"}`,
|
|
45
|
-
children: [t.collapsible ? /* @__PURE__ */
|
|
46
|
+
children: [t.collapsible ? /* @__PURE__ */ p("button", {
|
|
46
47
|
type: "button",
|
|
47
48
|
className: "select-setupguide__grouptitle select-setupguide__grouptoggle",
|
|
48
49
|
"aria-expanded": c,
|
|
49
50
|
onClick: () => s((e) => !e),
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
}) : /* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ f("span", { children: t.title }), g]
|
|
52
|
+
}) : /* @__PURE__ */ f("div", {
|
|
52
53
|
className: "select-setupguide__grouptitle",
|
|
53
54
|
children: t.title
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
+
}), /* @__PURE__ */ f("div", {
|
|
55
56
|
className: "select-setupguide__collapse",
|
|
56
57
|
...a(!c),
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ f("ul", {
|
|
58
59
|
className: "select-setupguide__list",
|
|
59
60
|
children: t.steps.map((t) => {
|
|
60
|
-
let r = t.to != null || t.href != null ? e(t.to ?? t.href) : void 0, a = r !== void 0, o = /* @__PURE__ */
|
|
61
|
+
let r = t.to != null || t.href != null ? e(t.to ?? t.href) : void 0, a = r !== void 0, o = /* @__PURE__ */ p(d, { children: [t.title, /* @__PURE__ */ p("span", {
|
|
61
62
|
className: "select-setupguide__sr",
|
|
62
63
|
children: [" — ", i[t.status]]
|
|
63
64
|
})] });
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ p("li", {
|
|
65
66
|
className: `select-setupguide__step is-${t.status}${t.onSelect || a ? " is-link" : ""}${n.has(t.id) ? " is-just-done" : ""}`,
|
|
66
67
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ f(h, { status: t.status }),
|
|
69
|
+
/* @__PURE__ */ p("span", {
|
|
69
70
|
className: "select-setupguide__text",
|
|
70
|
-
children: [a && t.to != null ? /* @__PURE__ */
|
|
71
|
+
children: [a && t.to != null ? /* @__PURE__ */ f(m, {
|
|
71
72
|
to: r,
|
|
72
73
|
className: "select-setupguide__steptitle select-setupguide__go",
|
|
73
74
|
children: o
|
|
74
|
-
}) : a ? /* @__PURE__ */
|
|
75
|
+
}) : a ? /* @__PURE__ */ f("a", {
|
|
75
76
|
href: r,
|
|
76
77
|
className: "select-setupguide__steptitle select-setupguide__go",
|
|
77
78
|
children: o
|
|
78
|
-
}) : t.onSelect ? /* @__PURE__ */
|
|
79
|
+
}) : t.onSelect ? /* @__PURE__ */ p("button", {
|
|
79
80
|
type: "button",
|
|
80
81
|
className: "select-setupguide__steptitle select-setupguide__go",
|
|
81
82
|
onClick: t.onSelect,
|
|
82
|
-
children: [t.title, /* @__PURE__ */
|
|
83
|
+
children: [t.title, /* @__PURE__ */ p("span", {
|
|
83
84
|
className: "select-setupguide__sr",
|
|
84
85
|
children: [" — ", i[t.status]]
|
|
85
86
|
})]
|
|
86
|
-
}) : /* @__PURE__ */
|
|
87
|
+
}) : /* @__PURE__ */ p("span", {
|
|
87
88
|
className: "select-setupguide__steptitle",
|
|
88
|
-
children: [t.title, /* @__PURE__ */
|
|
89
|
+
children: [t.title, /* @__PURE__ */ p("span", {
|
|
89
90
|
className: "select-setupguide__sr",
|
|
90
91
|
children: [" — ", i[t.status]]
|
|
91
92
|
})]
|
|
92
|
-
}), t.description && /* @__PURE__ */
|
|
93
|
+
}), t.description && /* @__PURE__ */ f("span", {
|
|
93
94
|
className: "select-setupguide__stepdesc",
|
|
94
95
|
children: t.description
|
|
95
96
|
})]
|
|
96
97
|
}),
|
|
97
|
-
t.trailing ? /* @__PURE__ */
|
|
98
|
+
t.trailing ? /* @__PURE__ */ f("span", {
|
|
98
99
|
className: "select-setupguide__trailing",
|
|
99
100
|
children: t.trailing
|
|
100
|
-
}) : (t.onSelect || a) && t.status !== "done" ? /* @__PURE__ */
|
|
101
|
+
}) : (t.onSelect || a) && t.status !== "done" ? /* @__PURE__ */ f("span", {
|
|
101
102
|
className: "select-setupguide__chevron",
|
|
102
|
-
children:
|
|
103
|
+
children: g
|
|
103
104
|
}) : null
|
|
104
105
|
]
|
|
105
106
|
}, t.id);
|
|
@@ -108,96 +109,106 @@ function g({ group: t, justDone: n }) {
|
|
|
108
109
|
})]
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
|
-
var
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
}), /* @__PURE__ */
|
|
117
|
-
ref:
|
|
118
|
-
...
|
|
119
|
-
className: `select-setupguide${
|
|
120
|
-
children: [/* @__PURE__ */
|
|
112
|
+
var v = s(function({ title: e, description: s, progress: u, actions: d, next: m, groups: h, minimized: g = !1, tone: v = "default", variant: y = "default", className: b, ...x }, S) {
|
|
113
|
+
let C = r().setupGuide, w = n(), T = u && u.total > 0 ? Math.round(u.done / u.total * 100) : 0, E = y === "strip", D = i(), O = l(null), k = /* @__PURE__ */ new Set(), A = h.flatMap((e) => e.steps);
|
|
114
|
+
if (O.current) for (let e of A) e.status === "done" && O.current.get(e.id) !== "done" && k.add(e.id);
|
|
115
|
+
return c(() => {
|
|
116
|
+
O.current = new Map(A.map((e) => [e.id, e.status]));
|
|
117
|
+
}), /* @__PURE__ */ p("section", {
|
|
118
|
+
ref: S,
|
|
119
|
+
...x,
|
|
120
|
+
className: `select-setupguide${D ? " select-setupguide--nested" : ""}${g ? " is-minimized" : ""}${v === "sandbox" ? " select-setupguide--sandbox" : ""}${E ? " select-setupguide--strip" : ""}${b ? " " + b : ""}`,
|
|
121
|
+
children: [/* @__PURE__ */ p("div", {
|
|
121
122
|
className: "select-setupguide__head",
|
|
122
123
|
children: [
|
|
123
|
-
/* @__PURE__ */ f(
|
|
124
|
+
E && u && /* @__PURE__ */ f(o, {
|
|
125
|
+
className: "select-setupguide__ring",
|
|
126
|
+
value: u.done,
|
|
127
|
+
max: Math.max(u.total, 1),
|
|
128
|
+
size: 40,
|
|
129
|
+
thickness: 4,
|
|
130
|
+
tone: v === "sandbox" ? "brand" : "success",
|
|
131
|
+
label: `${t(u.done, w)}/${t(u.total, w)}`,
|
|
132
|
+
ariaLabel: `${C.progressLabel}: ${typeof u.label == "string" ? u.label : C.progress(t(u.done, w), t(u.total, w))}`
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ p("div", {
|
|
124
135
|
className: "select-setupguide__heading",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
126
137
|
className: "select-setupguide__title",
|
|
127
138
|
children: e
|
|
128
|
-
}),
|
|
139
|
+
}), s && /* @__PURE__ */ f("p", {
|
|
129
140
|
className: "select-setupguide__desc",
|
|
130
|
-
children:
|
|
141
|
+
children: s
|
|
131
142
|
})]
|
|
132
143
|
}),
|
|
133
|
-
|
|
144
|
+
u && !E && /* @__PURE__ */ p("div", {
|
|
134
145
|
className: "select-setupguide__progress",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ f("div", {
|
|
136
147
|
className: "select-setupguide__bar",
|
|
137
148
|
role: "progressbar",
|
|
138
149
|
"aria-valuemin": 0,
|
|
139
|
-
"aria-valuemax":
|
|
140
|
-
"aria-valuenow":
|
|
141
|
-
"aria-label":
|
|
142
|
-
children: /* @__PURE__ */
|
|
150
|
+
"aria-valuemax": u.total,
|
|
151
|
+
"aria-valuenow": u.done,
|
|
152
|
+
"aria-label": C.progressLabel,
|
|
153
|
+
children: /* @__PURE__ */ f("span", {
|
|
143
154
|
className: "select-setupguide__fill",
|
|
144
|
-
style: { width: `${Math.max(
|
|
155
|
+
style: { width: `${Math.max(T, 3)}%` }
|
|
145
156
|
})
|
|
146
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ f("span", {
|
|
147
158
|
className: "select-setupguide__count",
|
|
148
|
-
children:
|
|
159
|
+
children: u.label ?? C.progress(t(u.done, w), t(u.total, w))
|
|
149
160
|
})]
|
|
150
161
|
}),
|
|
151
|
-
|
|
162
|
+
d && /* @__PURE__ */ f("div", {
|
|
152
163
|
className: "select-setupguide__actions",
|
|
153
|
-
children:
|
|
164
|
+
children: d
|
|
154
165
|
})
|
|
155
166
|
]
|
|
156
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ f("div", {
|
|
157
168
|
className: "select-setupguide__fold",
|
|
158
|
-
...a(
|
|
159
|
-
children: /* @__PURE__ */
|
|
169
|
+
...a(g),
|
|
170
|
+
children: /* @__PURE__ */ p("div", {
|
|
160
171
|
className: "select-setupguide__body",
|
|
161
|
-
children: [
|
|
172
|
+
children: [m && /* @__PURE__ */ f("div", {
|
|
162
173
|
className: "select-setupguide__next",
|
|
163
|
-
children:
|
|
164
|
-
}), /* @__PURE__ */
|
|
174
|
+
children: m
|
|
175
|
+
}), /* @__PURE__ */ f("div", {
|
|
165
176
|
className: "select-setupguide__steps",
|
|
166
|
-
children:
|
|
177
|
+
children: h.map((e, t) => /* @__PURE__ */ f(_, {
|
|
167
178
|
group: e,
|
|
168
|
-
justDone:
|
|
179
|
+
justDone: k
|
|
169
180
|
}, t))
|
|
170
181
|
})]
|
|
171
182
|
})
|
|
172
183
|
})]
|
|
173
184
|
});
|
|
174
185
|
});
|
|
175
|
-
function
|
|
176
|
-
return /* @__PURE__ */
|
|
186
|
+
function y({ eyebrow: e, title: t, children: n, actions: r }) {
|
|
187
|
+
return /* @__PURE__ */ p("div", {
|
|
177
188
|
className: "select-setupnext",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ p("div", {
|
|
179
190
|
className: "select-setupnext__text",
|
|
180
191
|
children: [
|
|
181
|
-
e && /* @__PURE__ */
|
|
192
|
+
e && /* @__PURE__ */ f("div", {
|
|
182
193
|
className: "select-setupnext__eyebrow",
|
|
183
194
|
children: e
|
|
184
195
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ f("h3", {
|
|
186
197
|
className: "select-setupnext__title",
|
|
187
198
|
children: t
|
|
188
199
|
}),
|
|
189
|
-
n && /* @__PURE__ */
|
|
200
|
+
n && /* @__PURE__ */ f("div", {
|
|
190
201
|
className: "select-setupnext__body",
|
|
191
202
|
children: n
|
|
192
203
|
})
|
|
193
204
|
]
|
|
194
|
-
}), r && /* @__PURE__ */
|
|
205
|
+
}), r && /* @__PURE__ */ f("div", {
|
|
195
206
|
className: "select-setupnext__actions",
|
|
196
207
|
children: r
|
|
197
208
|
})]
|
|
198
209
|
});
|
|
199
210
|
}
|
|
200
211
|
//#endregion
|
|
201
|
-
export {
|
|
212
|
+
export { v as SelectSetupGuide, y as SelectSetupNext };
|
|
202
213
|
|
|
203
214
|
//# sourceMappingURL=SelectSetupGuide.js.map
|