@selectwin/kit 0.1.245 → 0.1.247
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/SelectDetail.js +20 -18
- package/dist/SelectFlowCanvas.d.ts +16 -1
- package/dist/SelectFlowCanvas.js +11 -5
- package/dist/SelectJsonViewer.js +99 -97
- package/dist/SelectLayout.js +33 -31
- package/dist/SelectListCard.js +30 -28
- package/dist/SelectLocale.d.ts +5 -0
- package/dist/SelectLocale.js +8 -0
- package/dist/SelectModal.d.ts +45 -6
- package/dist/SelectModal.js +281 -127
- package/dist/SelectSection.js +35 -33
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/internal/dev.d.ts +1 -0
- package/dist/internal/dev.js +12 -0
- package/dist/internal/sheetBands.d.ts +11 -0
- package/dist/internal/sheetBands.js +44 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectModal.js
CHANGED
|
@@ -1,58 +1,67 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { SelectButton as e } from "./SelectButton.js";
|
|
3
|
+
import { ArrowLeftIcon as t, CloseIcon as n } from "./icons.js";
|
|
4
|
+
import { useSelectMessages as r } from "./SelectLocale.js";
|
|
5
|
+
import { SelectInfoTip as ee } from "./SelectInfoTip.js";
|
|
6
|
+
import { SelectAlert as te } from "./SelectAlert.js";
|
|
7
|
+
import { useFocusTrap as ne } from "./internal/useFocusTrap.js";
|
|
8
|
+
import { LayerProvider as re, isTopLayer as ie, openLayer as ae, useParentLayer as oe } from "./internal/layers.js";
|
|
9
|
+
import { sheetBands as se } from "./internal/sheetBands.js";
|
|
10
|
+
import { FrameBody as i } from "./internal/frame.js";
|
|
11
|
+
import { isDevBuild as ce } from "./internal/dev.js";
|
|
12
|
+
import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
13
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
14
|
+
import { createPortal as le } from "react-dom";
|
|
10
15
|
//#region src/SelectModal.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */
|
|
16
|
+
var ue = 220, f = "(max-width: 40rem)", de = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, fe = 64, pe = 120;
|
|
17
|
+
function p({ children: e, className: t, destructive: n }) {
|
|
18
|
+
return /* @__PURE__ */ d("div", {
|
|
14
19
|
className: `select-modal__actions${t ? " " + t : ""}`,
|
|
15
|
-
children:
|
|
20
|
+
children: [n != null && n !== !1 && /* @__PURE__ */ u("div", {
|
|
21
|
+
className: "select-modal__destructive",
|
|
22
|
+
children: n
|
|
23
|
+
}), e]
|
|
16
24
|
});
|
|
17
25
|
}
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
onClose:
|
|
21
|
-
dismissible:
|
|
26
|
+
function m({ open: f, onClose: p, eyebrow: m, title: h, subtitle: g, description: _, badge: v, help: me, children: y, footer: he, aside: b, size: ge = "md", showClose: _e = !0, noise: ve = !0, dividedHeader: ye = !1, backdrop: be = "dim", theme: xe = "light", placement: x = "center", headerAction: S, menu: C, onBack: w, backLabel: Se, loading: Ce = !1, error: T, onRetry: we, flush: Te = !1, dismissible: E = !0 }) {
|
|
27
|
+
let D = r(), [O, k] = c(f), [A, j] = c(!1), M = s(null), N = s(null), P = s(null), F = o(), I = o(), Ee = o(), [L] = c(() => ({})), De = oe(), R = s({
|
|
28
|
+
onClose: p,
|
|
29
|
+
dismissible: E
|
|
22
30
|
});
|
|
23
|
-
|
|
24
|
-
onClose:
|
|
25
|
-
dismissible:
|
|
31
|
+
R.current = {
|
|
32
|
+
onClose: p,
|
|
33
|
+
dismissible: E
|
|
26
34
|
};
|
|
27
|
-
let [
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
let [z] = c(() => f && typeof document < "u" ? document.activeElement : null), B = s(null), V = x === "side" && !b, H = Ce ? "loading" : T != null && T !== !1 && T !== "" ? "error" : "ready", U = V && w != null;
|
|
36
|
+
a(() => {
|
|
37
|
+
if (f) {
|
|
38
|
+
var e;
|
|
39
|
+
if (!B.current) {
|
|
40
|
+
var t;
|
|
41
|
+
let e = document.activeElement, n = e instanceof HTMLElement && e !== document.body && !((t = M.current) != null && t.contains(e));
|
|
42
|
+
B.current = n ? e : z instanceof HTMLElement && z !== document.body ? z : null;
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
} else if (
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
let e =
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
e != null && e.isConnected && (!
|
|
44
|
+
(e = M.current) == null || e.style.removeProperty("transform"), k(!0), j(!1);
|
|
45
|
+
} else if (O) {
|
|
46
|
+
var n;
|
|
47
|
+
j(!0);
|
|
48
|
+
let e = B.current;
|
|
49
|
+
B.current = null;
|
|
50
|
+
let t = document.activeElement;
|
|
51
|
+
e != null && e.isConnected && (!t || t === document.body || (n = M.current) != null && n.contains(t)) && e.focus({ preventScroll: !0 });
|
|
43
52
|
let r = setTimeout(() => {
|
|
44
|
-
|
|
45
|
-
},
|
|
53
|
+
k(!1), j(!1);
|
|
54
|
+
}, ue);
|
|
46
55
|
return () => clearTimeout(r);
|
|
47
56
|
}
|
|
48
57
|
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]),
|
|
53
|
-
if (!
|
|
54
|
-
let e =
|
|
55
|
-
e.key === "Escape" && !e.defaultPrevented &&
|
|
58
|
+
f,
|
|
59
|
+
O,
|
|
60
|
+
z
|
|
61
|
+
]), a(() => {
|
|
62
|
+
if (!O) return;
|
|
63
|
+
let e = ae(L, De), t = (e) => {
|
|
64
|
+
e.key === "Escape" && !e.defaultPrevented && ie(L) && R.current.dismissible && R.current.onClose();
|
|
56
65
|
};
|
|
57
66
|
document.addEventListener("keydown", t);
|
|
58
67
|
let n = document.body.style.overflow;
|
|
@@ -60,128 +69,273 @@ function _({ open: g, onClose: _, eyebrow: v, title: y, subtitle: b, description
|
|
|
60
69
|
e(), document.removeEventListener("keydown", t), document.body.style.overflow = n;
|
|
61
70
|
};
|
|
62
71
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
O,
|
|
73
|
+
L,
|
|
74
|
+
De
|
|
66
75
|
]);
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
if (!
|
|
70
|
-
let e =
|
|
76
|
+
let W = O && !A;
|
|
77
|
+
a(() => {
|
|
78
|
+
if (!W) return;
|
|
79
|
+
let e = M.current;
|
|
71
80
|
e && !e.contains(document.activeElement) && (e.querySelector("[data-autofocus]") ?? e).focus({ preventScroll: !0 });
|
|
72
|
-
}, [
|
|
73
|
-
let
|
|
74
|
-
|
|
81
|
+
}, [W]), ne(W, M, { initialFocus: !1 });
|
|
82
|
+
let Oe = s(U);
|
|
83
|
+
a(() => {
|
|
84
|
+
if (Oe.current === U) return;
|
|
85
|
+
Oe.current = U, N.current && (N.current.scrollTop = 0);
|
|
86
|
+
let e = M.current, t = document.activeElement;
|
|
87
|
+
e && (!t || t === document.body || !e.contains(t)) && e.focus({ preventScroll: !0 });
|
|
88
|
+
}, [U]);
|
|
89
|
+
let ke = s(!1);
|
|
90
|
+
a(() => {
|
|
91
|
+
if (!V || ke.current || !P.current || !ce()) return;
|
|
92
|
+
let e = P.current.querySelectorAll(".select-btn--primary").length;
|
|
93
|
+
e > 1 && (ke.current = !0, console.warn(`[SelectModal] A folha tem ${e} botões primários no pé: no máximo um, na ponta direita (o secundário à esquerda dele).`));
|
|
94
|
+
});
|
|
95
|
+
let G = s(null), Ae = (e) => {
|
|
96
|
+
if (E && e.button === 0 && de() && !e.target.closest("button, a, input, select, textarea, [role=\"button\"], .select-modal__headaction")) {
|
|
97
|
+
G.current = {
|
|
98
|
+
id: e.pointerId,
|
|
99
|
+
y: e.clientY,
|
|
100
|
+
dy: 0
|
|
101
|
+
};
|
|
102
|
+
try {
|
|
103
|
+
var t, n;
|
|
104
|
+
(t = (n = e.currentTarget).setPointerCapture) == null || t.call(n, e.pointerId);
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
}, je = (e) => {
|
|
108
|
+
let t = G.current, n = M.current;
|
|
109
|
+
t && e.pointerId === t.id && n && (t.dy = Math.max(0, e.clientY - t.y), n.dataset.dragging = "", t.dy > 0 ? n.style.transform = `translateY(${t.dy}px)` : n.style.removeProperty("transform"));
|
|
110
|
+
}, Me = (e) => {
|
|
111
|
+
let t = G.current;
|
|
112
|
+
if (!t || e.pointerId !== t.id) return;
|
|
113
|
+
G.current = null;
|
|
114
|
+
let n = M.current;
|
|
115
|
+
if (!n) return;
|
|
116
|
+
delete n.dataset.dragging;
|
|
117
|
+
let r = Math.max(fe, Math.min(pe, n.offsetHeight * .25));
|
|
118
|
+
e.type === "pointerup" && t.dy > r && R.current.dismissible ? R.current.onClose() : n.style.removeProperty("transform");
|
|
119
|
+
};
|
|
120
|
+
if (!O) return null;
|
|
121
|
+
let K = h && (me == null ? /* @__PURE__ */ u("h2", {
|
|
122
|
+
id: F,
|
|
123
|
+
className: "select-modal__title",
|
|
124
|
+
children: h
|
|
125
|
+
}) : /* @__PURE__ */ d("div", {
|
|
126
|
+
className: "select-modal__titlerow",
|
|
127
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
128
|
+
id: F,
|
|
129
|
+
className: "select-modal__title",
|
|
130
|
+
children: h
|
|
131
|
+
}), /* @__PURE__ */ u(ee, { content: me })]
|
|
132
|
+
})), q = v ? /* @__PURE__ */ d("p", {
|
|
133
|
+
id: I,
|
|
75
134
|
className: "select-modal__subtitle select-modal__subtitle--badge",
|
|
76
|
-
children: [
|
|
77
|
-
}) :
|
|
78
|
-
id:
|
|
135
|
+
children: [v, g ? /* @__PURE__ */ u("span", { children: g }) : null]
|
|
136
|
+
}) : g && /* @__PURE__ */ u("p", {
|
|
137
|
+
id: I,
|
|
79
138
|
className: "select-modal__subtitle",
|
|
80
|
-
children:
|
|
81
|
-
}),
|
|
82
|
-
id:
|
|
139
|
+
children: g
|
|
140
|
+
}), J = _ != null && _ !== !1 && _ !== "", Y = J && /* @__PURE__ */ u("p", {
|
|
141
|
+
id: Ee,
|
|
83
142
|
className: "select-modal__description",
|
|
84
|
-
children:
|
|
85
|
-
}),
|
|
143
|
+
children: _
|
|
144
|
+
}), Ne = [g || v ? I : null, J ? Ee : null].filter(Boolean).join(" ") || void 0, X = _e && E && /* @__PURE__ */ u("button", {
|
|
86
145
|
type: "button",
|
|
87
|
-
className:
|
|
88
|
-
"aria-label":
|
|
89
|
-
onClick:
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
146
|
+
className: `select-modal__close${V ? " select-modal__tool" : ""}`,
|
|
147
|
+
"aria-label": D.common.close,
|
|
148
|
+
onClick: p,
|
|
149
|
+
children: /* @__PURE__ */ u(n, {})
|
|
150
|
+
}), Z = `select-modal__header${ye ? " select-modal__header--divided" : ""}`, Pe = (e) => [
|
|
151
|
+
0,
|
|
152
|
+
1,
|
|
153
|
+
2
|
|
154
|
+
].map((t) => /* @__PURE__ */ d("span", {
|
|
155
|
+
className: "select-modal__skelrow",
|
|
156
|
+
children: [/* @__PURE__ */ u("span", { className: `select-skeleton${e ? " select-modal__skeldot" : ""}` }), /* @__PURE__ */ u("span", { className: "select-skeleton" })]
|
|
157
|
+
}, t)), Q = H === "loading" ? [/* @__PURE__ */ d("div", {
|
|
158
|
+
className: "select-modal__skel",
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ u("span", {
|
|
161
|
+
className: "select-skeleton select-modal__skelhead",
|
|
162
|
+
"aria-hidden": "true"
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ u("span", {
|
|
165
|
+
className: "select-modal__skelrows",
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
children: Pe(!1)
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ u("span", {
|
|
170
|
+
className: "select-visually-hidden",
|
|
171
|
+
role: "status",
|
|
172
|
+
children: D.common.loading
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
}, "skel-facts"), /* @__PURE__ */ d("div", {
|
|
176
|
+
className: "select-modal__skel select-modal__skel--steps",
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
children: [/* @__PURE__ */ u("span", { className: "select-skeleton select-modal__skelhead" }), /* @__PURE__ */ u("span", {
|
|
179
|
+
className: "select-modal__skelrows",
|
|
180
|
+
children: Pe(!0)
|
|
181
|
+
})]
|
|
182
|
+
}, "skel-steps")] : H === "error" ? [/* @__PURE__ */ u(te, {
|
|
183
|
+
tone: "critical",
|
|
184
|
+
action: we ? /* @__PURE__ */ u(e, {
|
|
185
|
+
variant: "secondary",
|
|
186
|
+
size: "sm",
|
|
187
|
+
inline: !0,
|
|
188
|
+
onClick: we,
|
|
189
|
+
children: D.modal.retry
|
|
190
|
+
}) : void 0,
|
|
191
|
+
children: T === !0 ? D.modal.loadFailed : T
|
|
192
|
+
}, "error")] : null, Fe = !!y || J || H !== "ready", Ie = !!he && H === "ready", Le = V && !Te ? Q ? Q.map((e, t) => ({
|
|
193
|
+
key: `state-${t}`,
|
|
194
|
+
node: e
|
|
195
|
+
})) : se(y) : null, Re = Fe && /* @__PURE__ */ u("div", {
|
|
196
|
+
className: "select-modal__body",
|
|
197
|
+
ref: N,
|
|
198
|
+
children: Le ? /* @__PURE__ */ d(l, { children: [Y && /* @__PURE__ */ u("div", {
|
|
199
|
+
className: "select-modal__band",
|
|
200
|
+
children: Y
|
|
201
|
+
}), /* @__PURE__ */ u(i, { children: Le.map(({ key: e, node: t }) => /* @__PURE__ */ u("div", {
|
|
202
|
+
className: "select-modal__band",
|
|
203
|
+
children: t
|
|
204
|
+
}, e)) })] }) : /* @__PURE__ */ d(l, { children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })] })
|
|
205
|
+
}), ze = Ie && /* @__PURE__ */ u("div", {
|
|
206
|
+
className: "select-modal__footer",
|
|
207
|
+
ref: P,
|
|
208
|
+
children: he
|
|
209
|
+
}), $ = V && C != null && C !== !1 && H === "ready" ? /* @__PURE__ */ u("span", {
|
|
210
|
+
className: "select-modal__menu",
|
|
211
|
+
children: C
|
|
212
|
+
}) : null, Be = q || (H === "loading" ? /* @__PURE__ */ u("span", {
|
|
213
|
+
className: "select-skeleton select-modal__subskel",
|
|
214
|
+
"aria-hidden": "true"
|
|
215
|
+
}) : null), Ve = /* @__PURE__ */ d("div", {
|
|
216
|
+
className: "select-modal__header select-modal__header--sheet",
|
|
217
|
+
onPointerDown: Ae,
|
|
218
|
+
onPointerMove: je,
|
|
219
|
+
onPointerUp: Me,
|
|
220
|
+
onPointerCancel: Me,
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ u("span", {
|
|
223
|
+
className: "select-modal__grip",
|
|
224
|
+
"aria-hidden": "true"
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ d("div", {
|
|
227
|
+
className: "select-modal__sheetrow",
|
|
228
|
+
children: [
|
|
229
|
+
w && /* @__PURE__ */ u("button", {
|
|
230
|
+
type: "button",
|
|
231
|
+
className: "select-modal__tool select-modal__back",
|
|
232
|
+
"aria-label": Se ?? D.common.back,
|
|
233
|
+
onClick: w,
|
|
234
|
+
children: /* @__PURE__ */ u(t, {})
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ d("div", {
|
|
237
|
+
className: "select-modal__headtext",
|
|
238
|
+
children: [
|
|
239
|
+
m && /* @__PURE__ */ u("span", {
|
|
240
|
+
className: "select-modal__eyebrow",
|
|
241
|
+
children: m
|
|
242
|
+
}),
|
|
243
|
+
K,
|
|
244
|
+
Be
|
|
245
|
+
]
|
|
246
|
+
}),
|
|
247
|
+
($ || X) && /* @__PURE__ */ d("div", {
|
|
248
|
+
className: "select-modal__tools",
|
|
249
|
+
children: [$, X]
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
S && /* @__PURE__ */ u("div", {
|
|
254
|
+
className: "select-modal__headaction",
|
|
255
|
+
children: S
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}), He = /* @__PURE__ */ u("div", {
|
|
259
|
+
className: `select select-modal__overlay${x === "side" ? " select-modal__overlay--side" : ""}${ve ? " select-modal__overlay--noise" : ""}${be === "blur" ? " select-modal__overlay--blur" : ""}${A ? " select-modal__overlay--closing" : ""}`,
|
|
260
|
+
"data-theme": xe,
|
|
261
|
+
onMouseDown: E ? p : void 0,
|
|
262
|
+
children: /* @__PURE__ */ u("div", {
|
|
263
|
+
className: `select-modal select-modal--${ge}${x === "side" ? " select-modal--side" : ""}${Te ? " select-modal--flush" : ""}${b ? " select-modal--split" : ""}${A ? " select-modal--closing" : ""}`,
|
|
264
|
+
ref: M,
|
|
98
265
|
role: "dialog",
|
|
99
266
|
"aria-modal": "true",
|
|
100
|
-
"aria-labelledby":
|
|
101
|
-
"aria-describedby":
|
|
267
|
+
"aria-labelledby": h ? F : void 0,
|
|
268
|
+
"aria-describedby": Ne,
|
|
269
|
+
"aria-busy": H === "loading" || void 0,
|
|
102
270
|
tabIndex: -1,
|
|
103
271
|
onMouseDown: (e) => e.stopPropagation(),
|
|
104
|
-
children:
|
|
272
|
+
children: b ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("aside", {
|
|
105
273
|
className: "select-modal__aside",
|
|
106
|
-
children:
|
|
107
|
-
}), /* @__PURE__ */
|
|
274
|
+
children: b
|
|
275
|
+
}), /* @__PURE__ */ d("div", {
|
|
108
276
|
className: "select-modal__content",
|
|
109
277
|
children: [
|
|
110
|
-
|
|
111
|
-
(
|
|
112
|
-
className:
|
|
278
|
+
X,
|
|
279
|
+
(m || h || g || v) && /* @__PURE__ */ d("div", {
|
|
280
|
+
className: Z,
|
|
113
281
|
children: [
|
|
114
|
-
|
|
282
|
+
m && /* @__PURE__ */ u("span", {
|
|
115
283
|
className: "select-modal__eyebrow",
|
|
116
|
-
children:
|
|
117
|
-
}),
|
|
118
|
-
y && /* @__PURE__ */ f("h2", {
|
|
119
|
-
id: B,
|
|
120
|
-
className: "select-modal__title",
|
|
121
|
-
children: y
|
|
284
|
+
children: m
|
|
122
285
|
}),
|
|
123
|
-
|
|
286
|
+
K,
|
|
287
|
+
q
|
|
124
288
|
]
|
|
125
289
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ d("div", {
|
|
127
291
|
className: "select-modal__body",
|
|
128
|
-
children: [
|
|
292
|
+
children: [Y, /* @__PURE__ */ u(i, { children: Q ?? y })]
|
|
129
293
|
})
|
|
130
294
|
]
|
|
131
|
-
})] }) : /* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
295
|
+
})] }) : V ? /* @__PURE__ */ d(l, { children: [
|
|
296
|
+
Ve,
|
|
297
|
+
Re,
|
|
298
|
+
ze
|
|
299
|
+
] }) : /* @__PURE__ */ d(l, { children: [
|
|
300
|
+
X,
|
|
301
|
+
(m || h || g || v) && (S ? /* @__PURE__ */ d("div", {
|
|
302
|
+
className: `${Z} select-modal__header--action`,
|
|
303
|
+
children: [/* @__PURE__ */ d("div", {
|
|
136
304
|
className: "select-modal__headtext",
|
|
137
305
|
children: [
|
|
138
|
-
|
|
306
|
+
m && /* @__PURE__ */ u("span", {
|
|
139
307
|
className: "select-modal__eyebrow",
|
|
140
|
-
children:
|
|
308
|
+
children: m
|
|
141
309
|
}),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
className: "select-modal__title",
|
|
145
|
-
children: y
|
|
146
|
-
}),
|
|
147
|
-
Y
|
|
310
|
+
K,
|
|
311
|
+
q
|
|
148
312
|
]
|
|
149
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ u("div", {
|
|
150
314
|
className: "select-modal__headaction",
|
|
151
|
-
children:
|
|
315
|
+
children: S
|
|
152
316
|
})]
|
|
153
|
-
}) : /* @__PURE__ */
|
|
154
|
-
className:
|
|
317
|
+
}) : /* @__PURE__ */ d("div", {
|
|
318
|
+
className: Z,
|
|
155
319
|
children: [
|
|
156
|
-
|
|
320
|
+
m && /* @__PURE__ */ u("span", {
|
|
157
321
|
className: "select-modal__eyebrow",
|
|
158
|
-
children:
|
|
159
|
-
}),
|
|
160
|
-
y && /* @__PURE__ */ f("h2", {
|
|
161
|
-
id: B,
|
|
162
|
-
className: "select-modal__title",
|
|
163
|
-
children: y
|
|
322
|
+
children: m
|
|
164
323
|
}),
|
|
165
|
-
|
|
324
|
+
K,
|
|
325
|
+
q
|
|
166
326
|
]
|
|
167
327
|
})),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
children: [Z, /* @__PURE__ */ f(o, { children: C })]
|
|
171
|
-
}),
|
|
172
|
-
w && /* @__PURE__ */ f("div", {
|
|
173
|
-
className: "select-modal__footer",
|
|
174
|
-
children: w
|
|
175
|
-
})
|
|
328
|
+
Re,
|
|
329
|
+
ze
|
|
176
330
|
] })
|
|
177
331
|
})
|
|
178
332
|
});
|
|
179
|
-
return
|
|
180
|
-
value:
|
|
181
|
-
children:
|
|
333
|
+
return le(/* @__PURE__ */ u(re, {
|
|
334
|
+
value: L,
|
|
335
|
+
children: He
|
|
182
336
|
}), document.body);
|
|
183
337
|
}
|
|
184
338
|
//#endregion
|
|
185
|
-
export {
|
|
339
|
+
export { m as SelectModal, p as SelectModalActions };
|
|
186
340
|
|
|
187
341
|
//# sourceMappingURL=SelectModal.js.map
|
package/dist/SelectSection.js
CHANGED
|
@@ -1,94 +1,96 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { ChevronDownIcon as e } from "./icons.js";
|
|
3
3
|
import { SelectInfoTip as t } from "./SelectInfoTip.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { registerSheetFrame as n } from "./internal/sheetBands.js";
|
|
5
|
+
import { FrameBody as r, useInsideFrame as i } from "./internal/frame.js";
|
|
6
|
+
import { inertProps as a } from "./internal/inert.js";
|
|
7
|
+
import { forwardRef as o, useId as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
9
|
//#region src/SelectSection.tsx
|
|
9
|
-
var
|
|
10
|
-
let [w, T] =
|
|
10
|
+
var d = o(function({ title: n, help: o, description: d, action: f, collapsible: p = !1, defaultOpen: m = !0, open: h, onOpenChange: g, footer: _, flush: v = !1, list: y = !1, children: b, className: x, ...S }, C) {
|
|
11
|
+
let [w, T] = c(m), E = h ?? w, D = s(), O = () => {
|
|
11
12
|
h === void 0 && T(!E), g == null || g(!E);
|
|
12
|
-
}, k = (
|
|
13
|
-
return p ? /* @__PURE__ */
|
|
13
|
+
}, k = (i() ? " select-section--nested" : "") + (v ? " select-section--flush" : "") + (y ? " select-section--list" : ""), A = y ? "list" : "body";
|
|
14
|
+
return p ? /* @__PURE__ */ u("div", {
|
|
14
15
|
ref: C,
|
|
15
16
|
...S,
|
|
16
17
|
className: `select-section select-section--collapsible${k}${E ? " is-open" : ""}${x ? " " + x : ""}`,
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ u("button", {
|
|
18
19
|
type: "button",
|
|
19
20
|
className: "select-section__head select-section__head--toggle",
|
|
20
21
|
"aria-expanded": E,
|
|
21
22
|
"aria-controls": D,
|
|
22
23
|
onClick: O,
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ u("span", {
|
|
24
25
|
className: "select-section__heading",
|
|
25
|
-
children: [
|
|
26
|
+
children: [n && /* @__PURE__ */ l("span", {
|
|
26
27
|
className: "select-section__title",
|
|
27
|
-
children:
|
|
28
|
-
}), d && /* @__PURE__ */
|
|
28
|
+
children: n
|
|
29
|
+
}), d && /* @__PURE__ */ l("span", {
|
|
29
30
|
className: "select-section__desc",
|
|
30
31
|
children: d
|
|
31
32
|
})]
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
+
}), /* @__PURE__ */ l("span", {
|
|
33
34
|
className: "select-section__chevron",
|
|
34
35
|
"aria-hidden": "true",
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ l(e, {})
|
|
36
37
|
})]
|
|
37
|
-
}), /* @__PURE__ */
|
|
38
|
+
}), /* @__PURE__ */ l("div", {
|
|
38
39
|
id: D,
|
|
39
40
|
className: "select-section__collapse",
|
|
40
41
|
"data-open": E,
|
|
41
|
-
...
|
|
42
|
-
children: /* @__PURE__ */
|
|
42
|
+
...a(!E),
|
|
43
|
+
children: /* @__PURE__ */ u("div", {
|
|
43
44
|
className: "select-section__collapsewrap",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ l("div", {
|
|
45
46
|
className: "select-section__body",
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ l(r, {
|
|
47
48
|
kind: A,
|
|
48
49
|
children: b
|
|
49
50
|
})
|
|
50
|
-
}), _ != null && _ !== "" && /* @__PURE__ */
|
|
51
|
+
}), _ != null && _ !== "" && /* @__PURE__ */ l("div", {
|
|
51
52
|
className: "select-section__foot",
|
|
52
53
|
children: _
|
|
53
54
|
})]
|
|
54
55
|
})
|
|
55
56
|
})]
|
|
56
|
-
}) : /* @__PURE__ */
|
|
57
|
+
}) : /* @__PURE__ */ u("div", {
|
|
57
58
|
ref: C,
|
|
58
59
|
...S,
|
|
59
60
|
className: `select-section${k}${x ? " " + x : ""}`,
|
|
60
61
|
children: [
|
|
61
|
-
(
|
|
62
|
+
(n || d || f) && /* @__PURE__ */ u("div", {
|
|
62
63
|
className: "select-section__head",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ u("div", {
|
|
64
65
|
className: "select-section__heading",
|
|
65
|
-
children: [
|
|
66
|
-
className: `select-section__title${
|
|
67
|
-
children: [
|
|
68
|
-
}), d && /* @__PURE__ */
|
|
66
|
+
children: [n && /* @__PURE__ */ u("h2", {
|
|
67
|
+
className: `select-section__title${o == null ? "" : " select-section__title--help"}`,
|
|
68
|
+
children: [n, o != null && /* @__PURE__ */ l(t, { content: o })]
|
|
69
|
+
}), d && /* @__PURE__ */ l("p", {
|
|
69
70
|
className: "select-section__desc",
|
|
70
71
|
children: d
|
|
71
72
|
})]
|
|
72
|
-
}), f ? /* @__PURE__ */
|
|
73
|
+
}), f ? /* @__PURE__ */ l("div", {
|
|
73
74
|
className: "select-section__action",
|
|
74
75
|
children: f
|
|
75
76
|
}) : null]
|
|
76
77
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ l("div", {
|
|
78
79
|
className: "select-section__body",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ l(r, {
|
|
80
81
|
kind: A,
|
|
81
82
|
children: b
|
|
82
83
|
})
|
|
83
84
|
}),
|
|
84
|
-
_ != null && _ !== "" && /* @__PURE__ */
|
|
85
|
+
_ != null && _ !== "" && /* @__PURE__ */ l("div", {
|
|
85
86
|
className: "select-section__foot",
|
|
86
87
|
children: _
|
|
87
88
|
})
|
|
88
89
|
]
|
|
89
90
|
});
|
|
90
91
|
});
|
|
92
|
+
n(d);
|
|
91
93
|
//#endregion
|
|
92
|
-
export {
|
|
94
|
+
export { d as SelectSection };
|
|
93
95
|
|
|
94
96
|
//# sourceMappingURL=SelectSection.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -266,7 +266,7 @@ export type { SelectQuantityFieldProps } from './SelectQuantityField';
|
|
|
266
266
|
export { SelectRepeatingFieldArray } from './SelectRepeatingFieldArray';
|
|
267
267
|
export { SelectBuilderLayout } from './SelectBuilderLayout';
|
|
268
268
|
export { SelectBuilderWorkspace } from './SelectBuilderWorkspace';
|
|
269
|
-
export { SelectFlowCanvas, SelectFlowNode, SelectFlowLayout } from './SelectFlowCanvas';
|
|
269
|
+
export { SelectFlowCanvas, SelectFlowNode, SelectFlowLayout, SelectFlowInspectorFoot } from './SelectFlowCanvas';
|
|
270
270
|
export { SelectSwitchField } from './SelectSwitchField';
|
|
271
271
|
export { SelectColorField, SELECT_COLOR_PRESETS, normalizeHex, contrastRatio, hexToHsv, hsvToHex } from './SelectColorField';
|
|
272
272
|
export { SelectProgressBar, type SelectProgressBarProps, type SelectProgressTone } from './SelectProgressBar';
|