@leabankab/component-library 8.5.0 → 8.6.1
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/CHANGELOG.md +13 -0
- package/dist/component-library.es.js +21 -21
- package/dist/component-library.es.js.map +1 -1
- package/dist/component-library.umd.js +2 -2
- package/dist/component-library.umd.js.map +1 -1
- package/dist/cookie-consent-react.cjs +1 -1
- package/dist/cookie-consent-react.cjs.map +1 -1
- package/dist/cookie-consent-react.mjs +9 -9
- package/dist/cookie-consent-react.mjs.map +1 -1
- package/dist/cookie-consent.css +1 -1
- package/dist/dev-panel/dev-panel.d.ts +16 -1
- package/dist/dev-panel/use-dev-panel-labels.d.ts +1 -1
- package/dist/dev-panel.cjs +2 -2
- package/dist/dev-panel.cjs.map +1 -1
- package/dist/dev-panel.css +1 -1
- package/dist/dev-panel.mjs +365 -338
- package/dist/dev-panel.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/package.json +1 -1
package/dist/dev-panel.mjs
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Braces as e, Check as t, ChevronRight as n, Copy as r, EyeOff as i, Minus as a, Pencil as o,
|
|
3
|
-
import { Fragment as f, createContext as p, useCallback as m, useContext as h, useEffect as g, useId as _, useLayoutEffect as v, useMemo as
|
|
4
|
-
import { Button as x, IconButton as S, Text as C, createTranslation as
|
|
5
|
-
import { Fragment as
|
|
2
|
+
import { Braces as e, Check as t, ChevronRight as n, Copy as r, EyeOff as i, Minus as a, Pencil as o, Pin as s, Plus as c, RotateCcw as l, Undo2 as u, Upload as d, X as ee } from "lucide-react";
|
|
3
|
+
import { Fragment as f, createContext as p, useCallback as m, useContext as h, useEffect as g, useId as _, useLayoutEffect as v, useMemo as te, useRef as y, useState as b } from "react";
|
|
4
|
+
import { Button as x, IconButton as S, Text as C, createTranslation as w } from "./component-library.es.js";
|
|
5
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
6
6
|
import { createPortal as ne } from "react-dom";
|
|
7
7
|
import './dev-panel.css';//#region \0rolldown/runtime.js
|
|
8
|
-
var
|
|
8
|
+
var O = Object.defineProperty, re = (e, t) => {
|
|
9
9
|
let n = {};
|
|
10
|
-
for (var r in e)
|
|
10
|
+
for (var r in e) O(n, r, {
|
|
11
11
|
get: e[r],
|
|
12
12
|
enumerable: !0
|
|
13
13
|
});
|
|
14
|
-
return t ||
|
|
14
|
+
return t || O(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
15
15
|
}, k = {
|
|
16
|
-
Badge: "
|
|
17
|
-
SectionLabel: "
|
|
18
|
-
SectionMeta: "
|
|
19
|
-
FlowLabel: "
|
|
20
|
-
CountryCode: "
|
|
21
|
-
StepLabel: "
|
|
22
|
-
PayloadCode: "
|
|
23
|
-
PayloadEditor: "
|
|
24
|
-
PayloadError: "
|
|
25
|
-
DevPanel: "
|
|
26
|
-
Body: "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
16
|
+
Badge: "_Badge_1wbg7_23",
|
|
17
|
+
SectionLabel: "_SectionLabel_1wbg7_24",
|
|
18
|
+
SectionMeta: "_SectionMeta_1wbg7_25",
|
|
19
|
+
FlowLabel: "_FlowLabel_1wbg7_26",
|
|
20
|
+
CountryCode: "_CountryCode_1wbg7_27",
|
|
21
|
+
StepLabel: "_StepLabel_1wbg7_28",
|
|
22
|
+
PayloadCode: "_PayloadCode_1wbg7_29",
|
|
23
|
+
PayloadEditor: "_PayloadEditor_1wbg7_30",
|
|
24
|
+
PayloadError: "_PayloadError_1wbg7_31",
|
|
25
|
+
DevPanel: "_DevPanel_1wbg7_40",
|
|
26
|
+
Body: "_Body_1wbg7_77",
|
|
27
|
+
PinButton: "_PinButton_1wbg7_107",
|
|
28
|
+
Header: "_Header_1wbg7_113",
|
|
29
|
+
HeaderTitle: "_HeaderTitle_1wbg7_125",
|
|
30
|
+
HeaderActions: "_HeaderActions_1wbg7_135",
|
|
31
|
+
HeaderDot: "_HeaderDot_1wbg7_142",
|
|
32
|
+
Handle: "_Handle_1wbg7_172",
|
|
33
|
+
HideButton: "_HideButton_1wbg7_251",
|
|
34
|
+
Section: "_Section_1wbg7_24",
|
|
35
|
+
SectionHeaderRow: "_SectionHeaderRow_1wbg7_275",
|
|
36
|
+
Flow: "_Flow_1wbg7_26",
|
|
37
|
+
FlowText: "_FlowText_1wbg7_317",
|
|
38
|
+
FlowSeparator: "_FlowSeparator_1wbg7_342",
|
|
39
|
+
SegmentedGroup: "_SegmentedGroup_1wbg7_355",
|
|
40
|
+
SegmentedOption: "_SegmentedOption_1wbg7_376",
|
|
41
|
+
ChipGroup: "_ChipGroup_1wbg7_428",
|
|
42
|
+
Chip: "_Chip_1wbg7_428",
|
|
43
|
+
ChipDot: "_ChipDot_1wbg7_467",
|
|
44
|
+
StepGrid: "_StepGrid_1wbg7_491",
|
|
45
|
+
StepButton: "_StepButton_1wbg7_497",
|
|
46
|
+
StepCircle: "_StepCircle_1wbg7_521",
|
|
47
|
+
StepFlagDot: "_StepFlagDot_1wbg7_563",
|
|
48
|
+
StepStateName: "_StepStateName_1wbg7_594",
|
|
49
|
+
StatusGrid: "_StatusGrid_1wbg7_603",
|
|
50
|
+
StatusCard: "_StatusCard_1wbg7_610",
|
|
51
|
+
StatusDot: "_StatusDot_1wbg7_669",
|
|
52
|
+
PayloadToggle: "_PayloadToggle_1wbg7_681",
|
|
53
|
+
PayloadToggleLabel: "_PayloadToggleLabel_1wbg7_701",
|
|
54
|
+
PayloadChevron: "_PayloadChevron_1wbg7_708",
|
|
55
|
+
PayloadPanel: "_PayloadPanel_1wbg7_732",
|
|
56
|
+
Payload: "_Payload_1wbg7_29",
|
|
57
|
+
PayloadHeader: "_PayloadHeader_1wbg7_765",
|
|
58
|
+
PayloadActions: "_PayloadActions_1wbg7_839",
|
|
59
|
+
Flyout: "_Flyout_1wbg7_851",
|
|
60
|
+
Token: "_Token_1wbg7_862",
|
|
61
|
+
FlyoutTitle: "_FlyoutTitle_1wbg7_910",
|
|
62
|
+
FlyoutFooter: "_FlyoutFooter_1wbg7_924",
|
|
63
|
+
FlyoutCopyButton: "_FlyoutCopyButton_1wbg7_931",
|
|
64
|
+
Footer: "_Footer_1wbg7_971",
|
|
65
|
+
OnDark: "_OnDark_1wbg7_999",
|
|
66
|
+
VisuallyHidden: "_VisuallyHidden_1wbg7_1010"
|
|
67
|
+
}, ie = w({
|
|
67
68
|
copy: {
|
|
68
69
|
no: "Kopier",
|
|
69
70
|
se: "Kopiera",
|
|
@@ -142,6 +143,12 @@ var D = Object.defineProperty, O = (e, t) => {
|
|
|
142
143
|
fi: "Näytä",
|
|
143
144
|
es: "Mostrar"
|
|
144
145
|
},
|
|
146
|
+
pin: {
|
|
147
|
+
no: "Fest",
|
|
148
|
+
se: "Fäst",
|
|
149
|
+
fi: "Kiinnitä",
|
|
150
|
+
es: "Fijar"
|
|
151
|
+
},
|
|
145
152
|
step: {
|
|
146
153
|
no: "Steg",
|
|
147
154
|
se: "Steg",
|
|
@@ -172,166 +179,186 @@ var D = Object.defineProperty, O = (e, t) => {
|
|
|
172
179
|
fi: "vaatii huomiota",
|
|
173
180
|
es: "requiere atención"
|
|
174
181
|
}
|
|
175
|
-
}),
|
|
176
|
-
function
|
|
177
|
-
return h(
|
|
182
|
+
}), ae = (...e) => e.filter(Boolean).join(" "), oe = p(void 0);
|
|
183
|
+
function A() {
|
|
184
|
+
return h(oe);
|
|
178
185
|
}
|
|
179
|
-
var
|
|
180
|
-
function
|
|
186
|
+
var se = p(null), j = "(max-width: 599.95px)", M = () => typeof navigator < "u" && /mac|iphone|ipad/i.test(navigator.platform || navigator.userAgent);
|
|
187
|
+
function ce(e, t) {
|
|
181
188
|
let n = t.split("+").map((e) => e.trim().toLowerCase()), r = n.pop();
|
|
182
189
|
if (!r) return !1;
|
|
183
190
|
let i = n.includes("mod"), a = {
|
|
184
|
-
ctrl: n.includes("ctrl") || i && !
|
|
185
|
-
meta: n.includes("meta") || i &&
|
|
191
|
+
ctrl: n.includes("ctrl") || i && !M(),
|
|
192
|
+
meta: n.includes("meta") || i && M(),
|
|
186
193
|
alt: n.includes("alt"),
|
|
187
194
|
shift: n.includes("shift")
|
|
188
195
|
};
|
|
189
196
|
return e.ctrlKey !== a.ctrl || e.metaKey !== a.meta || e.altKey !== a.alt || e.shiftKey !== a.shift ? !1 : e.key.toLowerCase() === r || e.code.toLowerCase() === `key${r}` || e.code.toLowerCase() === `digit${r}`;
|
|
190
197
|
}
|
|
191
|
-
function
|
|
192
|
-
let
|
|
193
|
-
let e = !
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
|
|
198
|
+
function N({ title: e = "Dev controls", badge: t, showStatusDot: n = !0, minimisable: r = !0, minimised: o, defaultMinimised: l, onMinimisedChange: u, minimiseLabel: d, expandLabel: ee, hidden: f, defaultHidden: p, onHiddenChange: m, hideable: h = f !== void 0 || p !== void 0, shortcut: v = "Mod+Shift+D", handle: te, hideLabel: x, position: C, pinned: w, defaultPinned: T, onPinnedChange: ne, pinnable: O = w !== void 0 || T !== void 0, pinLabel: re, children: oe, className: A, style: M }) {
|
|
199
|
+
let N = ie(), P = o !== void 0, [ue, F] = b(l ?? !1), I = P ? o : ue, [L, de] = b(p ?? !1), R = h && (f ?? L), [z, B] = b(T ?? !1), V = w ?? z, H = O && C !== void 0, U = y(null), W = y(null), G = y(null), K = y(null), q = () => {
|
|
200
|
+
let e = !I;
|
|
201
|
+
P || F(e), u?.(e);
|
|
202
|
+
}, J = () => {
|
|
203
|
+
let e = !V;
|
|
204
|
+
w === void 0 && B(e), ne?.(e);
|
|
205
|
+
}, Y = (e) => {
|
|
206
|
+
f === void 0 && de(e), m?.(e);
|
|
197
207
|
};
|
|
198
208
|
g(() => {
|
|
199
|
-
h && !
|
|
209
|
+
h && !P && l === void 0 && typeof window < "u" && window.matchMedia?.(j).matches && F(!0);
|
|
200
210
|
}, []), g(() => {
|
|
201
|
-
let e =
|
|
202
|
-
|
|
211
|
+
let e = K.current;
|
|
212
|
+
K.current = null, e === "handle" && W.current?.focus(), e === "panel" && G.current?.focus();
|
|
203
213
|
});
|
|
204
|
-
let
|
|
205
|
-
isHidden:
|
|
206
|
-
setHiddenState:
|
|
214
|
+
let fe = y({
|
|
215
|
+
isHidden: R,
|
|
216
|
+
setHiddenState: Y
|
|
207
217
|
});
|
|
208
|
-
|
|
209
|
-
isHidden:
|
|
210
|
-
setHiddenState:
|
|
218
|
+
fe.current = {
|
|
219
|
+
isHidden: R,
|
|
220
|
+
setHiddenState: Y
|
|
211
221
|
}, g(() => {
|
|
212
222
|
if (!h || v === !1) return;
|
|
213
223
|
let e = (e) => {
|
|
214
|
-
if (e.repeat || !
|
|
224
|
+
if (e.repeat || !ce(e, v)) return;
|
|
215
225
|
e.preventDefault();
|
|
216
|
-
let { isHidden: t, setHiddenState: n } =
|
|
217
|
-
!t &&
|
|
226
|
+
let { isHidden: t, setHiddenState: n } = fe.current, r = document.activeElement;
|
|
227
|
+
!t && U.current?.contains(r) && (K.current = "handle"), t && r != null && r === W.current && (K.current = "panel"), n(!t);
|
|
218
228
|
};
|
|
219
229
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
220
230
|
}, [h, v]);
|
|
221
|
-
let
|
|
222
|
-
return
|
|
231
|
+
let pe = _(), X = C === void 0 ? void 0 : C.endsWith("left") ? "left" : "right";
|
|
232
|
+
return R ? /* @__PURE__ */ E(se.Provider, {
|
|
223
233
|
value: {
|
|
224
234
|
show: () => {
|
|
225
|
-
|
|
235
|
+
K.current = "panel", Y(!1);
|
|
226
236
|
},
|
|
227
237
|
title: e,
|
|
228
|
-
handleRef:
|
|
229
|
-
side:
|
|
238
|
+
handleRef: W,
|
|
239
|
+
side: X
|
|
230
240
|
},
|
|
231
|
-
children:
|
|
232
|
-
}) : /* @__PURE__ */
|
|
233
|
-
ref:
|
|
241
|
+
children: te ?? /* @__PURE__ */ E(le, {})
|
|
242
|
+
}) : /* @__PURE__ */ D("div", {
|
|
243
|
+
ref: U,
|
|
234
244
|
"data-dev-panel-root": "",
|
|
235
245
|
"data-position": C,
|
|
236
246
|
"data-hideable": h ? "" : void 0,
|
|
237
|
-
"data-minimised":
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
247
|
+
"data-minimised": I ? "" : void 0,
|
|
248
|
+
"data-pinned": H && V && !I ? "" : void 0,
|
|
249
|
+
className: ae(k.DevPanel, A),
|
|
250
|
+
style: M,
|
|
251
|
+
children: [/* @__PURE__ */ D("div", {
|
|
241
252
|
className: k.Header,
|
|
242
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ D("span", {
|
|
243
254
|
className: k.HeaderTitle,
|
|
244
255
|
children: [
|
|
245
|
-
n && /* @__PURE__ */
|
|
256
|
+
n && /* @__PURE__ */ E("span", {
|
|
246
257
|
className: k.HeaderDot,
|
|
247
258
|
"aria-hidden": !0
|
|
248
259
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
t != null && /* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ E("span", { children: e }),
|
|
261
|
+
t != null && /* @__PURE__ */ E("span", {
|
|
251
262
|
className: k.Badge,
|
|
252
263
|
children: t
|
|
253
264
|
})
|
|
254
265
|
]
|
|
255
|
-
}), /* @__PURE__ */
|
|
266
|
+
}), /* @__PURE__ */ D("span", {
|
|
256
267
|
className: k.HeaderActions,
|
|
257
|
-
children: [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
})
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
size:
|
|
281
|
-
|
|
268
|
+
children: [
|
|
269
|
+
H && !I && /* @__PURE__ */ E(S, {
|
|
270
|
+
className: k.PinButton,
|
|
271
|
+
"aria-label": re ?? N.pin,
|
|
272
|
+
"aria-pressed": V,
|
|
273
|
+
onClick: J,
|
|
274
|
+
variant: V ? "solid" : "outline",
|
|
275
|
+
color: "secondary",
|
|
276
|
+
size: "sm",
|
|
277
|
+
children: /* @__PURE__ */ E(s, {
|
|
278
|
+
size: 18,
|
|
279
|
+
"aria-hidden": !0
|
|
280
|
+
})
|
|
281
|
+
}),
|
|
282
|
+
h && /* @__PURE__ */ E(S, {
|
|
283
|
+
ref: G,
|
|
284
|
+
className: k.HideButton,
|
|
285
|
+
"aria-label": x ?? N.hide,
|
|
286
|
+
onClick: () => {
|
|
287
|
+
K.current = "handle", Y(!0);
|
|
288
|
+
},
|
|
289
|
+
variant: "outline",
|
|
290
|
+
color: "secondary",
|
|
291
|
+
size: "sm",
|
|
292
|
+
children: /* @__PURE__ */ E(i, {
|
|
293
|
+
size: 18,
|
|
294
|
+
"aria-hidden": !0
|
|
295
|
+
})
|
|
296
|
+
}),
|
|
297
|
+
r && /* @__PURE__ */ E(S, {
|
|
298
|
+
"aria-label": I ? ee ?? N.expand : d ?? N.minimise,
|
|
299
|
+
"aria-expanded": !I,
|
|
300
|
+
"aria-controls": pe,
|
|
301
|
+
onClick: q,
|
|
302
|
+
variant: "outline",
|
|
303
|
+
color: "secondary",
|
|
304
|
+
size: "sm",
|
|
305
|
+
children: E(I ? c : a, {
|
|
306
|
+
size: 18,
|
|
307
|
+
"aria-hidden": !0
|
|
308
|
+
})
|
|
282
309
|
})
|
|
283
|
-
|
|
310
|
+
]
|
|
284
311
|
})]
|
|
285
|
-
}), !
|
|
286
|
-
id:
|
|
312
|
+
}), !I && /* @__PURE__ */ E("div", {
|
|
313
|
+
id: pe,
|
|
287
314
|
className: k.Body,
|
|
288
|
-
children:
|
|
315
|
+
children: oe
|
|
289
316
|
})]
|
|
290
317
|
});
|
|
291
318
|
}
|
|
292
|
-
function
|
|
319
|
+
function P({ label: e, meta: t, children: n, className: r, style: i }) {
|
|
293
320
|
let a = _();
|
|
294
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ D("section", {
|
|
295
322
|
"aria-labelledby": a,
|
|
296
|
-
className:
|
|
323
|
+
className: ae(k.Section, r),
|
|
297
324
|
style: i,
|
|
298
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ D("div", {
|
|
299
326
|
className: k.SectionHeaderRow,
|
|
300
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ E("span", {
|
|
301
328
|
id: a,
|
|
302
329
|
className: k.SectionLabel,
|
|
303
330
|
children: e
|
|
304
|
-
}), t != null && /* @__PURE__ */
|
|
331
|
+
}), t != null && /* @__PURE__ */ E("span", {
|
|
305
332
|
className: k.SectionMeta,
|
|
306
333
|
children: t
|
|
307
334
|
})]
|
|
308
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ E(oe.Provider, {
|
|
309
336
|
value: a,
|
|
310
337
|
children: n
|
|
311
338
|
})]
|
|
312
339
|
});
|
|
313
340
|
}
|
|
314
|
-
function
|
|
315
|
-
let i =
|
|
341
|
+
function le({ side: e, label: t, className: n, style: r }) {
|
|
342
|
+
let i = ie(), a = h(se);
|
|
316
343
|
if (!a) return null;
|
|
317
344
|
let o = t ?? a.title, s = e ?? a.side ?? "right";
|
|
318
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ D("button", {
|
|
319
346
|
ref: a.handleRef,
|
|
320
347
|
type: "button",
|
|
321
|
-
className:
|
|
348
|
+
className: ae(k.Handle, n),
|
|
322
349
|
style: r,
|
|
323
350
|
"data-side": s,
|
|
324
351
|
"aria-label": typeof o == "string" ? `${i.show} ${o}` : void 0,
|
|
325
352
|
onClick: a.show,
|
|
326
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ E("span", {
|
|
327
354
|
className: k.HeaderDot,
|
|
328
355
|
"aria-hidden": !0
|
|
329
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ E("span", { children: o })]
|
|
330
357
|
});
|
|
331
358
|
}
|
|
332
359
|
//#endregion
|
|
333
360
|
//#region src/dev-panel/use-roving-radio.ts
|
|
334
|
-
function
|
|
361
|
+
function ue({ values: e, selected: t, onSelect: n, isDisabled: r }) {
|
|
335
362
|
let i = y([]), a = m((t) => r?.(e[t], t) ?? !1, [r, e]), o = e.findIndex((e) => e === t), s = e.findIndex((e, t) => !a(t)), c = o >= 0 && !a(o) ? o : s, l = m((t) => {
|
|
336
363
|
i.current[t]?.focus(), n(e[t]);
|
|
337
364
|
}, [n, e]), u = m((t, n) => {
|
|
@@ -388,49 +415,49 @@ function I({ values: e, selected: t, onSelect: n, isDisabled: r }) {
|
|
|
388
415
|
}
|
|
389
416
|
//#endregion
|
|
390
417
|
//#region src/dev-panel/segmented-control.tsx
|
|
391
|
-
function
|
|
392
|
-
let o =
|
|
418
|
+
function F({ value: e, onChange: t, options: n, variant: r = "pill", "aria-label": i, "aria-labelledby": a }) {
|
|
419
|
+
let o = A(), s = a ?? (i ? void 0 : o), { getItemProps: c } = ue({
|
|
393
420
|
values: n.map((e) => e.value),
|
|
394
421
|
selected: e,
|
|
395
422
|
onSelect: t,
|
|
396
423
|
isDisabled: (e, t) => n[t]?.disabled ?? !1
|
|
397
424
|
}), l = r === "chip";
|
|
398
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ E("div", {
|
|
399
426
|
role: "radiogroup",
|
|
400
427
|
"aria-label": i,
|
|
401
428
|
"aria-labelledby": s,
|
|
402
429
|
className: l ? k.ChipGroup : k.SegmentedGroup,
|
|
403
430
|
children: n.map((e, t) => {
|
|
404
431
|
let { onKeyDown: n, ...r } = c(t);
|
|
405
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ D("button", {
|
|
406
433
|
type: "button",
|
|
407
434
|
"data-disabled": e.disabled ? "" : void 0,
|
|
408
435
|
onKeyDown: n,
|
|
409
436
|
...r,
|
|
410
437
|
className: l ? k.Chip : k.SegmentedOption,
|
|
411
|
-
children: [l ? /* @__PURE__ */
|
|
438
|
+
children: [l ? /* @__PURE__ */ E("span", {
|
|
412
439
|
className: k.ChipDot,
|
|
413
440
|
"aria-hidden": !0
|
|
414
|
-
}) : e.icon, /* @__PURE__ */
|
|
441
|
+
}) : e.icon, /* @__PURE__ */ E("span", { children: e.label })]
|
|
415
442
|
}, e.value);
|
|
416
443
|
})
|
|
417
444
|
});
|
|
418
445
|
}
|
|
419
446
|
//#endregion
|
|
420
447
|
//#region src/dev-panel/dev-panel-country.tsx
|
|
421
|
-
function
|
|
448
|
+
function I({ value: e, onChange: t, options: n, label: r = "Country" }) {
|
|
422
449
|
let i = n.map((e) => ({
|
|
423
450
|
value: e.value,
|
|
424
451
|
disabled: e.disabled,
|
|
425
452
|
label: e.label,
|
|
426
|
-
icon: e.code == null ? void 0 : /* @__PURE__ */
|
|
453
|
+
icon: e.code == null ? void 0 : /* @__PURE__ */ E("span", {
|
|
427
454
|
className: k.CountryCode,
|
|
428
455
|
children: e.code
|
|
429
456
|
})
|
|
430
457
|
}));
|
|
431
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ E(P, {
|
|
432
459
|
label: r,
|
|
433
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ E(F, {
|
|
434
461
|
value: e,
|
|
435
462
|
onChange: t,
|
|
436
463
|
options: i
|
|
@@ -439,15 +466,15 @@ function R({ value: e, onChange: t, options: n, label: r = "Country" }) {
|
|
|
439
466
|
}
|
|
440
467
|
//#endregion
|
|
441
468
|
//#region src/dev-panel/dev-panel-variant.tsx
|
|
442
|
-
function
|
|
469
|
+
function L({ value: e, onChange: t, options: n, label: r = "Variant" }) {
|
|
443
470
|
let i = n.map((e) => ({
|
|
444
471
|
value: e.value,
|
|
445
472
|
label: e.label,
|
|
446
473
|
disabled: e.disabled
|
|
447
474
|
}));
|
|
448
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ E(P, {
|
|
449
476
|
label: r,
|
|
450
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ E(F, {
|
|
451
478
|
value: e,
|
|
452
479
|
onChange: t,
|
|
453
480
|
options: i
|
|
@@ -456,15 +483,15 @@ function z({ value: e, onChange: t, options: n, label: r = "Variant" }) {
|
|
|
456
483
|
}
|
|
457
484
|
//#endregion
|
|
458
485
|
//#region src/dev-panel/dev-panel-step-state.tsx
|
|
459
|
-
function
|
|
486
|
+
function de({ value: e, onChange: t, options: n, label: r = "Step state", stepLabel: i, variationsLabel: a = "Variations for" }) {
|
|
460
487
|
let o = n.map((e) => ({
|
|
461
488
|
value: e.value,
|
|
462
489
|
label: e.label,
|
|
463
490
|
disabled: e.disabled
|
|
464
491
|
}));
|
|
465
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ D(P, {
|
|
466
493
|
label: r,
|
|
467
|
-
children: [i != null && /* @__PURE__ */
|
|
494
|
+
children: [i != null && /* @__PURE__ */ D(C, {
|
|
468
495
|
textStyle: "body-sm",
|
|
469
496
|
style: {
|
|
470
497
|
color: "var(--lea-color-neutral-600)",
|
|
@@ -473,12 +500,12 @@ function B({ value: e, onChange: t, options: n, label: r = "Step state", stepLab
|
|
|
473
500
|
children: [
|
|
474
501
|
a,
|
|
475
502
|
" ",
|
|
476
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ E("span", {
|
|
477
504
|
className: k.StepStateName,
|
|
478
505
|
children: i
|
|
479
506
|
})
|
|
480
507
|
]
|
|
481
|
-
}), /* @__PURE__ */
|
|
508
|
+
}), /* @__PURE__ */ E(F, {
|
|
482
509
|
value: e,
|
|
483
510
|
onChange: t,
|
|
484
511
|
options: o,
|
|
@@ -488,19 +515,19 @@ function B({ value: e, onChange: t, options: n, label: r = "Step state", stepLab
|
|
|
488
515
|
}
|
|
489
516
|
//#endregion
|
|
490
517
|
//#region src/dev-panel/dev-panel-steps.tsx
|
|
491
|
-
var
|
|
518
|
+
var R = (e, t) => {
|
|
492
519
|
switch (e) {
|
|
493
520
|
case "complete": return t.statusCompleted;
|
|
494
521
|
case "current": return t.statusCurrent;
|
|
495
522
|
default: return t.statusUpcoming;
|
|
496
523
|
}
|
|
497
524
|
};
|
|
498
|
-
function
|
|
499
|
-
let o =
|
|
500
|
-
return /* @__PURE__ */
|
|
525
|
+
function z({ steps: e, currentStep: t, onStepSelect: n, label: r = "Jump to step", showCount: i = !0, columns: a = 4 }) {
|
|
526
|
+
let o = ie(), s = e.length, c = i && t != null ? `${t} / ${s}` : void 0;
|
|
527
|
+
return /* @__PURE__ */ E(P, {
|
|
501
528
|
label: r,
|
|
502
529
|
meta: c,
|
|
503
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ E(B, {
|
|
504
531
|
steps: e,
|
|
505
532
|
currentStep: t,
|
|
506
533
|
onStepSelect: n,
|
|
@@ -509,16 +536,16 @@ function H({ steps: e, currentStep: t, onStepSelect: n, label: r = "Jump to step
|
|
|
509
536
|
})
|
|
510
537
|
});
|
|
511
538
|
}
|
|
512
|
-
function
|
|
513
|
-
let o =
|
|
514
|
-
return /* @__PURE__ */
|
|
539
|
+
function B({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
|
|
540
|
+
let o = A();
|
|
541
|
+
return /* @__PURE__ */ E("div", {
|
|
515
542
|
role: "group",
|
|
516
543
|
"aria-labelledby": o,
|
|
517
544
|
className: k.StepGrid,
|
|
518
545
|
style: { "--_columns": i },
|
|
519
546
|
children: e.map((e, i) => {
|
|
520
547
|
let o = i + 1, s = e.status ?? (n == null ? "upcoming" : o < n ? "complete" : o === n ? "current" : "upcoming"), c = s === "current", l = s === "complete";
|
|
521
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ D("button", {
|
|
522
549
|
type: "button",
|
|
523
550
|
"aria-current": c ? "step" : void 0,
|
|
524
551
|
"data-state": s,
|
|
@@ -527,31 +554,31 @@ function U({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
|
|
|
527
554
|
onClick: () => r?.(o, e),
|
|
528
555
|
className: k.StepButton,
|
|
529
556
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ D("span", {
|
|
531
558
|
className: k.StepCircle,
|
|
532
559
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ E("span", {
|
|
534
561
|
className: k.VisuallyHidden,
|
|
535
562
|
children: l ? `${a.step} ${o}` : `${a.step} `
|
|
536
563
|
}),
|
|
537
|
-
l ? /* @__PURE__ */
|
|
564
|
+
l ? /* @__PURE__ */ E(t, {
|
|
538
565
|
size: 18,
|
|
539
566
|
"aria-hidden": !0
|
|
540
567
|
}) : o,
|
|
541
|
-
e.flagged && /* @__PURE__ */
|
|
568
|
+
e.flagged && /* @__PURE__ */ E("span", {
|
|
542
569
|
className: k.StepFlagDot,
|
|
543
570
|
"aria-hidden": !0
|
|
544
571
|
})
|
|
545
572
|
]
|
|
546
573
|
}),
|
|
547
574
|
" ",
|
|
548
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ E("span", {
|
|
549
576
|
className: k.StepLabel,
|
|
550
577
|
children: e.label
|
|
551
578
|
}),
|
|
552
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ E("span", {
|
|
553
580
|
className: k.VisuallyHidden,
|
|
554
|
-
children: `(${
|
|
581
|
+
children: `(${R(s, a)}${e.flagged ? `, ${a.needsAttention}` : ""})`
|
|
555
582
|
})
|
|
556
583
|
]
|
|
557
584
|
}, o);
|
|
@@ -560,47 +587,47 @@ function U({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
|
|
|
560
587
|
}
|
|
561
588
|
//#endregion
|
|
562
589
|
//#region src/dev-panel/dev-panel-status.tsx
|
|
563
|
-
function
|
|
564
|
-
return /* @__PURE__ */
|
|
590
|
+
function V({ value: e, onChange: t, options: n, label: r = "Application status" }) {
|
|
591
|
+
return /* @__PURE__ */ E(P, {
|
|
565
592
|
label: r,
|
|
566
|
-
children: /* @__PURE__ */
|
|
593
|
+
children: /* @__PURE__ */ E(H, {
|
|
567
594
|
value: e,
|
|
568
595
|
onChange: t,
|
|
569
596
|
options: n
|
|
570
597
|
})
|
|
571
598
|
});
|
|
572
599
|
}
|
|
573
|
-
function
|
|
574
|
-
let r =
|
|
600
|
+
function H({ value: e, onChange: t, options: n }) {
|
|
601
|
+
let r = A(), { getItemProps: i } = ue({
|
|
575
602
|
values: n.map((e) => e.value),
|
|
576
603
|
selected: e,
|
|
577
604
|
onSelect: t,
|
|
578
605
|
isDisabled: (e, t) => n[t]?.disabled ?? !1
|
|
579
606
|
});
|
|
580
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ E("div", {
|
|
581
608
|
role: "radiogroup",
|
|
582
609
|
"aria-labelledby": r,
|
|
583
610
|
className: k.StatusGrid,
|
|
584
611
|
children: n.map((e, t) => {
|
|
585
612
|
let { onKeyDown: n, ...r } = i(t);
|
|
586
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ D("button", {
|
|
587
614
|
type: "button",
|
|
588
615
|
"data-color": e.color ?? "neutral",
|
|
589
616
|
"data-disabled": e.disabled ? "" : void 0,
|
|
590
617
|
onKeyDown: n,
|
|
591
618
|
...r,
|
|
592
619
|
className: k.StatusCard,
|
|
593
|
-
children: [/* @__PURE__ */
|
|
620
|
+
children: [/* @__PURE__ */ E("span", {
|
|
594
621
|
className: k.StatusDot,
|
|
595
622
|
"aria-hidden": !0
|
|
596
|
-
}), /* @__PURE__ */
|
|
623
|
+
}), /* @__PURE__ */ E("span", { children: e.label })]
|
|
597
624
|
}, e.value);
|
|
598
625
|
})
|
|
599
626
|
});
|
|
600
627
|
}
|
|
601
628
|
//#endregion
|
|
602
629
|
//#region src/dev-panel/use-copy.ts
|
|
603
|
-
function
|
|
630
|
+
function U() {
|
|
604
631
|
let [e, t] = b(!1), n = y(void 0), r = m(async (e) => {
|
|
605
632
|
try {
|
|
606
633
|
await navigator.clipboard?.writeText(e);
|
|
@@ -614,41 +641,41 @@ function ce() {
|
|
|
614
641
|
}
|
|
615
642
|
//#endregion
|
|
616
643
|
//#region src/dev-panel/dev-panel-flow.tsx
|
|
617
|
-
var
|
|
618
|
-
function
|
|
619
|
-
let u =
|
|
644
|
+
var W = (e) => typeof e == "string" || typeof e == "number" ? String(e) : null;
|
|
645
|
+
function G({ flowId: e, process: n, variant: i, label: a = "Flow", showCopy: o = !0, copyValue: s, copyLabel: c, onCopy: l }) {
|
|
646
|
+
let u = ie(), { copied: d, copy: ee } = U(), p = [
|
|
620
647
|
e,
|
|
621
648
|
n,
|
|
622
649
|
i
|
|
623
|
-
].filter((e) => e != null),
|
|
624
|
-
return /* @__PURE__ */
|
|
650
|
+
].filter((e) => e != null), m = p.map(W).filter((e) => e != null).join(" · "), h = s ?? m;
|
|
651
|
+
return /* @__PURE__ */ D("div", {
|
|
625
652
|
className: k.Flow,
|
|
626
653
|
children: [
|
|
627
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ D("div", {
|
|
628
655
|
className: k.FlowText,
|
|
629
|
-
children: [/* @__PURE__ */
|
|
656
|
+
children: [/* @__PURE__ */ E("span", {
|
|
630
657
|
className: k.FlowLabel,
|
|
631
658
|
children: a
|
|
632
|
-
}), /* @__PURE__ */
|
|
659
|
+
}), /* @__PURE__ */ E("span", { children: p.map((e, t) => /* @__PURE__ */ D(f, { children: [t > 0 && /* @__PURE__ */ E("span", {
|
|
633
660
|
"aria-hidden": !0,
|
|
634
661
|
className: k.FlowSeparator,
|
|
635
662
|
children: "·"
|
|
636
663
|
}), e] }, t)) })]
|
|
637
664
|
}),
|
|
638
|
-
o && /* @__PURE__ */
|
|
665
|
+
o && /* @__PURE__ */ E(S, {
|
|
639
666
|
"aria-label": c ?? u.copy,
|
|
640
667
|
onClick: async () => {
|
|
641
|
-
await
|
|
668
|
+
await ee(h), l?.();
|
|
642
669
|
},
|
|
643
670
|
variant: "outline",
|
|
644
671
|
color: "secondary",
|
|
645
672
|
size: "sm",
|
|
646
|
-
children:
|
|
673
|
+
children: E(d ? t : r, {
|
|
647
674
|
size: 16,
|
|
648
675
|
"aria-hidden": !0
|
|
649
676
|
})
|
|
650
677
|
}),
|
|
651
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ E("span", {
|
|
652
679
|
role: "status",
|
|
653
680
|
"aria-live": "polite",
|
|
654
681
|
className: k.VisuallyHidden,
|
|
@@ -659,18 +686,18 @@ function le({ flowId: e, process: n, variant: i, label: a = "Flow", showCopy: o
|
|
|
659
686
|
}
|
|
660
687
|
//#endregion
|
|
661
688
|
//#region src/dev-panel/json-highlight.tsx
|
|
662
|
-
var
|
|
663
|
-
function
|
|
689
|
+
var K = /"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\b(?:true|false|null)\b/g, q = (e) => e === " " || e === " " || e === "\n" || e === "\r";
|
|
690
|
+
function J(e, t, n) {
|
|
664
691
|
if (e[0] === "\"") {
|
|
665
692
|
let e = n;
|
|
666
|
-
for (; e < t.length &&
|
|
693
|
+
for (; e < t.length && q(t[e]);) e += 1;
|
|
667
694
|
return t[e] === ":" ? "key" : "string";
|
|
668
695
|
}
|
|
669
696
|
return e === "true" || e === "false" ? "boolean" : e === "null" ? "null" : "number";
|
|
670
697
|
}
|
|
671
|
-
function
|
|
698
|
+
function Y(e) {
|
|
672
699
|
let t = [], n = 0;
|
|
673
|
-
for (let r of e.matchAll(
|
|
700
|
+
for (let r of e.matchAll(K)) {
|
|
674
701
|
let i = r.index ?? 0;
|
|
675
702
|
i > n && t.push({
|
|
676
703
|
type: "punctuation",
|
|
@@ -678,7 +705,7 @@ function J(e) {
|
|
|
678
705
|
});
|
|
679
706
|
let a = r[0];
|
|
680
707
|
t.push({
|
|
681
|
-
type:
|
|
708
|
+
type: J(a, e, i + a.length),
|
|
682
709
|
value: a
|
|
683
710
|
}), n = i + a.length;
|
|
684
711
|
}
|
|
@@ -698,8 +725,8 @@ function fe(e) {
|
|
|
698
725
|
}
|
|
699
726
|
}
|
|
700
727
|
function pe({ code: e }) {
|
|
701
|
-
let t =
|
|
702
|
-
return /* @__PURE__ */ T
|
|
728
|
+
let t = te(() => Y(e), [e]);
|
|
729
|
+
return /* @__PURE__ */ E(T, { children: t.map((e, t) => /* @__PURE__ */ E("span", {
|
|
703
730
|
className: k.Token,
|
|
704
731
|
"data-token": e.type,
|
|
705
732
|
children: e.value
|
|
@@ -707,7 +734,7 @@ function pe({ code: e }) {
|
|
|
707
734
|
}
|
|
708
735
|
//#endregion
|
|
709
736
|
//#region src/dev-panel/dev-panel-payload.tsx
|
|
710
|
-
var
|
|
737
|
+
var X = {
|
|
711
738
|
"--button-fg": "var(--lea-palette-text-contrast)",
|
|
712
739
|
"--button-border": "var(--lea-palette-border-contrast)",
|
|
713
740
|
"--button-tint": "var(--lea-color-neutral-800)"
|
|
@@ -718,40 +745,40 @@ var Y = {
|
|
|
718
745
|
} catch {
|
|
719
746
|
return String(e);
|
|
720
747
|
}
|
|
721
|
-
}, he = typeof window < "u" ? v : g,
|
|
722
|
-
function
|
|
723
|
-
let
|
|
724
|
-
g(() =>
|
|
725
|
-
let
|
|
726
|
-
|
|
727
|
-
}, [
|
|
748
|
+
}, he = typeof window < "u" ? v : g, Z = 12, ge = 420, _e = 280;
|
|
749
|
+
function Q({ value: i, label: a = "Payload preview", title: s, placement: c = "inline", badge: l, open: d, defaultOpen: f = !1, onOpenChange: p, copyLabel: h, copyJsonLabel: v, closeLabel: te, highlight: C = !0, onApply: w, onReset: O, editLabel: re, applyLabel: ae, cancelLabel: oe, resetLabel: A, invalidJsonLabel: se }) {
|
|
750
|
+
let j = ie(), { copied: M, copy: ce } = U(), N = d !== void 0, [P, le] = b(f), ue = c === "panel", F = ue || (N ? d : P), I = _(), L = _(), de = _(), R = c === "side", [z, B] = b(null), [V, H] = b(null), W = z !== null, G = y(null), K = y(null), q = y(null), J = y(null), Y = y(null), [Q, ve] = b(null), [ye, be] = b(null);
|
|
751
|
+
g(() => be(document.body), []);
|
|
752
|
+
let xe = m((e) => {
|
|
753
|
+
N || le(e), p?.(e);
|
|
754
|
+
}, [N, p]), $ = me(i), Se = C && fe(i) ? /* @__PURE__ */ E(pe, { code: $ }) : $;
|
|
728
755
|
g(() => {
|
|
729
756
|
let e = q.current;
|
|
730
|
-
q.current = null, e === "editor" &&
|
|
757
|
+
q.current = null, e === "editor" && K.current?.focus(), e === "edit" && G.current?.focus();
|
|
731
758
|
}), g(() => {
|
|
732
|
-
|
|
733
|
-
}, [
|
|
759
|
+
F || (B(null), H(null));
|
|
760
|
+
}, [F]);
|
|
734
761
|
let Ce = () => {
|
|
735
|
-
q.current = "editor",
|
|
762
|
+
q.current = "editor", B($), H(null);
|
|
736
763
|
}, we = () => {
|
|
737
|
-
q.current = "edit",
|
|
764
|
+
q.current = "edit", B(null), H(null);
|
|
738
765
|
}, Te = () => {
|
|
739
|
-
if (
|
|
766
|
+
if (z === null) return;
|
|
740
767
|
let e;
|
|
741
768
|
try {
|
|
742
|
-
e = JSON.parse(
|
|
769
|
+
e = JSON.parse(z);
|
|
743
770
|
} catch (e) {
|
|
744
|
-
|
|
771
|
+
H(e instanceof Error ? e.message : String(e));
|
|
745
772
|
return;
|
|
746
773
|
}
|
|
747
|
-
we(),
|
|
774
|
+
we(), w?.(e);
|
|
748
775
|
}, Ee = m(() => {
|
|
749
776
|
let e = J.current?.closest("[data-dev-panel-root]") ?? J.current;
|
|
750
777
|
if (!e) return;
|
|
751
|
-
let t = e.getBoundingClientRect(), n = Math.min(ge, Math.max(_e, t.width)), r = t.left - n -
|
|
752
|
-
r <
|
|
753
|
-
let i = Math.min(t.height, window.innerHeight - 24), a = Math.min(Math.max(
|
|
754
|
-
|
|
778
|
+
let t = e.getBoundingClientRect(), n = Math.min(ge, Math.max(_e, t.width)), r = t.left - n - Z;
|
|
779
|
+
r < Z && (r = Math.min(t.right + Z, window.innerWidth - n - Z));
|
|
780
|
+
let i = Math.min(t.height, window.innerHeight - 24), a = Math.min(Math.max(Z, t.top), window.innerHeight - Z - i);
|
|
781
|
+
ve({
|
|
755
782
|
top: a,
|
|
756
783
|
left: r,
|
|
757
784
|
width: n,
|
|
@@ -759,25 +786,25 @@ function ve({ value: i, label: a = "Payload preview", title: s, placement: c = "
|
|
|
759
786
|
});
|
|
760
787
|
}, []);
|
|
761
788
|
he(() => {
|
|
762
|
-
if (!
|
|
789
|
+
if (!R || !F) return;
|
|
763
790
|
Ee();
|
|
764
791
|
let e = () => Ee();
|
|
765
792
|
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
766
793
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
767
794
|
};
|
|
768
795
|
}, [
|
|
769
|
-
H,
|
|
770
796
|
R,
|
|
797
|
+
F,
|
|
771
798
|
Ee
|
|
772
799
|
]);
|
|
773
|
-
let De =
|
|
800
|
+
let De = Q !== null;
|
|
774
801
|
g(() => {
|
|
775
|
-
if (!
|
|
776
|
-
let e =
|
|
802
|
+
if (!R || !F || !ye || !De) return;
|
|
803
|
+
let e = Y.current, t = J.current, n = () => Array.from(e?.querySelectorAll("button, [href], input, textarea, select, [tabindex]:not([tabindex=\"-1\"])") ?? []).filter((e) => !e.hasAttribute("disabled"));
|
|
777
804
|
(n()[0] ?? e)?.focus();
|
|
778
805
|
let r = (t) => {
|
|
779
806
|
if (t.key === "Escape") {
|
|
780
|
-
t.stopPropagation(),
|
|
807
|
+
t.stopPropagation(), xe(!1);
|
|
781
808
|
return;
|
|
782
809
|
}
|
|
783
810
|
if (t.key !== "Tab") return;
|
|
@@ -790,176 +817,176 @@ function ve({ value: i, label: a = "Payload preview", title: s, placement: c = "
|
|
|
790
817
|
t.shiftKey && (o === i || o === e) ? (t.preventDefault(), a.focus()) : !t.shiftKey && o === a && (t.preventDefault(), i.focus());
|
|
791
818
|
}, i = (n) => {
|
|
792
819
|
let r = n.target;
|
|
793
|
-
e?.contains(r) || t?.contains(r) ||
|
|
820
|
+
e?.contains(r) || t?.contains(r) || xe(!1);
|
|
794
821
|
};
|
|
795
822
|
return document.addEventListener("keydown", r, !0), document.addEventListener("pointerdown", i, !0), () => {
|
|
796
823
|
document.removeEventListener("keydown", r, !0), document.removeEventListener("pointerdown", i, !0), t?.focus();
|
|
797
824
|
};
|
|
798
825
|
}, [
|
|
799
|
-
H,
|
|
800
826
|
R,
|
|
801
|
-
|
|
827
|
+
F,
|
|
828
|
+
ye,
|
|
802
829
|
De,
|
|
803
|
-
|
|
830
|
+
xe
|
|
804
831
|
]);
|
|
805
|
-
let Oe =
|
|
806
|
-
"aria-label":
|
|
807
|
-
onClick: () =>
|
|
832
|
+
let Oe = z ?? $, ke = /* @__PURE__ */ E(S, {
|
|
833
|
+
"aria-label": h ?? j.copy,
|
|
834
|
+
onClick: () => ce(Oe),
|
|
808
835
|
variant: "outline",
|
|
809
836
|
color: "secondary",
|
|
810
837
|
size: "sm",
|
|
811
838
|
className: k.OnDark,
|
|
812
|
-
style:
|
|
813
|
-
children:
|
|
839
|
+
style: X,
|
|
840
|
+
children: E(M ? t : r, {
|
|
814
841
|
size: 16,
|
|
815
842
|
"aria-hidden": !0
|
|
816
843
|
})
|
|
817
|
-
}), Ae = !
|
|
818
|
-
"aria-label":
|
|
844
|
+
}), Ae = !W && /* @__PURE__ */ D(T, { children: [O && /* @__PURE__ */ E(S, {
|
|
845
|
+
"aria-label": A ?? j.reset,
|
|
819
846
|
onClick: O,
|
|
820
847
|
variant: "outline",
|
|
821
848
|
color: "secondary",
|
|
822
849
|
size: "sm",
|
|
823
850
|
className: k.OnDark,
|
|
824
|
-
style:
|
|
825
|
-
children: /* @__PURE__ */
|
|
851
|
+
style: X,
|
|
852
|
+
children: /* @__PURE__ */ E(u, {
|
|
826
853
|
size: 16,
|
|
827
854
|
"aria-hidden": !0
|
|
828
855
|
})
|
|
829
|
-
}),
|
|
830
|
-
ref:
|
|
831
|
-
"aria-label": re ??
|
|
856
|
+
}), w && /* @__PURE__ */ E(S, {
|
|
857
|
+
ref: G,
|
|
858
|
+
"aria-label": re ?? j.edit,
|
|
832
859
|
onClick: Ce,
|
|
833
860
|
variant: "outline",
|
|
834
861
|
color: "secondary",
|
|
835
862
|
size: "sm",
|
|
836
863
|
className: k.OnDark,
|
|
837
|
-
style:
|
|
838
|
-
children: /* @__PURE__ */
|
|
864
|
+
style: X,
|
|
865
|
+
children: /* @__PURE__ */ E(o, {
|
|
839
866
|
size: 16,
|
|
840
867
|
"aria-hidden": !0
|
|
841
868
|
})
|
|
842
|
-
})] }), je =
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
ref:
|
|
845
|
-
value:
|
|
869
|
+
})] }), je = W ? /* @__PURE__ */ D(T, { children: [
|
|
870
|
+
/* @__PURE__ */ E("textarea", {
|
|
871
|
+
ref: K,
|
|
872
|
+
value: z,
|
|
846
873
|
onChange: (e) => {
|
|
847
|
-
|
|
874
|
+
B(e.target.value), H(null);
|
|
848
875
|
},
|
|
849
|
-
"aria-labelledby":
|
|
850
|
-
"aria-invalid":
|
|
851
|
-
"aria-describedby":
|
|
876
|
+
"aria-labelledby": L,
|
|
877
|
+
"aria-invalid": V !== null || void 0,
|
|
878
|
+
"aria-describedby": V === null ? void 0 : de,
|
|
852
879
|
spellCheck: !1,
|
|
853
880
|
autoCapitalize: "off",
|
|
854
881
|
autoComplete: "off",
|
|
855
882
|
className: k.PayloadEditor
|
|
856
883
|
}),
|
|
857
|
-
|
|
858
|
-
id:
|
|
884
|
+
V !== null && /* @__PURE__ */ E("p", {
|
|
885
|
+
id: de,
|
|
859
886
|
role: "alert",
|
|
860
887
|
className: k.PayloadError,
|
|
861
|
-
children: `${
|
|
888
|
+
children: `${se ?? j.invalidJson}: ${V}`
|
|
862
889
|
}),
|
|
863
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ D("div", {
|
|
864
891
|
className: k.PayloadActions,
|
|
865
|
-
children: [/* @__PURE__ */
|
|
892
|
+
children: [/* @__PURE__ */ E(x, {
|
|
866
893
|
onClick: we,
|
|
867
894
|
variant: "outline",
|
|
868
895
|
color: "secondary",
|
|
869
896
|
size: "sm",
|
|
870
897
|
className: k.OnDark,
|
|
871
|
-
style:
|
|
872
|
-
children:
|
|
873
|
-
}), /* @__PURE__ */
|
|
898
|
+
style: X,
|
|
899
|
+
children: oe ?? j.cancel
|
|
900
|
+
}), /* @__PURE__ */ E(x, {
|
|
874
901
|
onClick: Te,
|
|
875
902
|
variant: "solid",
|
|
876
903
|
size: "sm",
|
|
877
|
-
children:
|
|
904
|
+
children: ae ?? j.apply
|
|
878
905
|
})]
|
|
879
906
|
})
|
|
880
|
-
] }) : /* @__PURE__ */
|
|
907
|
+
] }) : /* @__PURE__ */ E("pre", {
|
|
881
908
|
tabIndex: 0,
|
|
882
909
|
className: k.PayloadCode,
|
|
883
910
|
children: Se
|
|
884
911
|
});
|
|
885
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ D("div", {
|
|
886
913
|
className: k.Payload,
|
|
887
914
|
"data-placement": c,
|
|
888
915
|
children: [
|
|
889
|
-
!
|
|
916
|
+
!ue && /* @__PURE__ */ D("button", {
|
|
890
917
|
ref: J,
|
|
891
918
|
type: "button",
|
|
892
|
-
"aria-expanded":
|
|
893
|
-
"aria-controls":
|
|
919
|
+
"aria-expanded": F,
|
|
920
|
+
"aria-controls": I,
|
|
894
921
|
"data-placement": c,
|
|
895
|
-
onClick: () =>
|
|
922
|
+
onClick: () => xe(!F),
|
|
896
923
|
className: k.PayloadToggle,
|
|
897
|
-
children: [/* @__PURE__ */
|
|
924
|
+
children: [/* @__PURE__ */ D("span", {
|
|
898
925
|
className: k.PayloadToggleLabel,
|
|
899
|
-
children: [/* @__PURE__ */
|
|
926
|
+
children: [/* @__PURE__ */ E(e, {
|
|
900
927
|
size: 16,
|
|
901
928
|
"aria-hidden": !0
|
|
902
929
|
}), a]
|
|
903
|
-
}), /* @__PURE__ */
|
|
930
|
+
}), /* @__PURE__ */ E("span", {
|
|
904
931
|
className: k.PayloadChevron,
|
|
905
|
-
children: /* @__PURE__ */
|
|
932
|
+
children: /* @__PURE__ */ E(n, {
|
|
906
933
|
size: 16,
|
|
907
934
|
"aria-hidden": !0
|
|
908
935
|
})
|
|
909
936
|
})]
|
|
910
937
|
}),
|
|
911
|
-
!
|
|
912
|
-
id:
|
|
938
|
+
!R && F && /* @__PURE__ */ D("div", {
|
|
939
|
+
id: I,
|
|
913
940
|
className: k.PayloadPanel,
|
|
914
941
|
"data-placement": c,
|
|
915
|
-
children: [/* @__PURE__ */
|
|
942
|
+
children: [/* @__PURE__ */ D("div", {
|
|
916
943
|
className: k.PayloadHeader,
|
|
917
|
-
children: [/* @__PURE__ */
|
|
918
|
-
id:
|
|
944
|
+
children: [/* @__PURE__ */ E("span", {
|
|
945
|
+
id: L,
|
|
919
946
|
children: s ?? a
|
|
920
|
-
}), /* @__PURE__ */
|
|
947
|
+
}), /* @__PURE__ */ D("span", {
|
|
921
948
|
className: k.HeaderActions,
|
|
922
949
|
children: [Ae, ke]
|
|
923
950
|
})]
|
|
924
951
|
}), je]
|
|
925
952
|
}),
|
|
926
|
-
|
|
927
|
-
ref:
|
|
928
|
-
id:
|
|
953
|
+
R && F && ye && ne(/* @__PURE__ */ D("div", {
|
|
954
|
+
ref: Y,
|
|
955
|
+
id: I,
|
|
929
956
|
role: "dialog",
|
|
930
|
-
"aria-labelledby":
|
|
957
|
+
"aria-labelledby": L,
|
|
931
958
|
tabIndex: -1,
|
|
932
959
|
className: k.Flyout,
|
|
933
|
-
style:
|
|
934
|
-
top:
|
|
935
|
-
left:
|
|
936
|
-
width:
|
|
937
|
-
height:
|
|
960
|
+
style: Q ? {
|
|
961
|
+
top: Q.top,
|
|
962
|
+
left: Q.left,
|
|
963
|
+
width: Q.width,
|
|
964
|
+
height: Q.height
|
|
938
965
|
} : { visibility: "hidden" },
|
|
939
966
|
children: [
|
|
940
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ D("div", {
|
|
941
968
|
className: k.PayloadHeader,
|
|
942
|
-
children: [/* @__PURE__ */
|
|
969
|
+
children: [/* @__PURE__ */ D("span", {
|
|
943
970
|
className: k.FlyoutTitle,
|
|
944
|
-
children: [/* @__PURE__ */
|
|
945
|
-
id:
|
|
971
|
+
children: [/* @__PURE__ */ E("span", {
|
|
972
|
+
id: L,
|
|
946
973
|
children: s ?? a
|
|
947
|
-
}),
|
|
974
|
+
}), l != null && /* @__PURE__ */ E("span", {
|
|
948
975
|
className: k.Badge,
|
|
949
976
|
"data-on-dark": "",
|
|
950
|
-
children:
|
|
977
|
+
children: l
|
|
951
978
|
})]
|
|
952
|
-
}), /* @__PURE__ */
|
|
979
|
+
}), /* @__PURE__ */ D("span", {
|
|
953
980
|
className: k.HeaderActions,
|
|
954
|
-
children: [Ae, /* @__PURE__ */
|
|
955
|
-
"aria-label":
|
|
956
|
-
onClick: () =>
|
|
981
|
+
children: [Ae, /* @__PURE__ */ E(S, {
|
|
982
|
+
"aria-label": te ?? j.close,
|
|
983
|
+
onClick: () => xe(!1),
|
|
957
984
|
variant: "outline",
|
|
958
985
|
color: "secondary",
|
|
959
986
|
size: "sm",
|
|
960
987
|
className: k.OnDark,
|
|
961
|
-
style:
|
|
962
|
-
children: /* @__PURE__ */
|
|
988
|
+
style: X,
|
|
989
|
+
children: /* @__PURE__ */ E(ee, {
|
|
963
990
|
size: 16,
|
|
964
991
|
"aria-hidden": !0
|
|
965
992
|
})
|
|
@@ -967,81 +994,81 @@ function ve({ value: i, label: a = "Payload preview", title: s, placement: c = "
|
|
|
967
994
|
})]
|
|
968
995
|
}),
|
|
969
996
|
je,
|
|
970
|
-
!
|
|
997
|
+
!W && /* @__PURE__ */ E("div", {
|
|
971
998
|
className: k.FlyoutFooter,
|
|
972
|
-
children: /* @__PURE__ */
|
|
999
|
+
children: /* @__PURE__ */ D("button", {
|
|
973
1000
|
type: "button",
|
|
974
|
-
onClick: () =>
|
|
1001
|
+
onClick: () => ce($),
|
|
975
1002
|
className: k.FlyoutCopyButton,
|
|
976
|
-
children: [
|
|
1003
|
+
children: [E(M ? t : r, {
|
|
977
1004
|
size: 16,
|
|
978
1005
|
"aria-hidden": !0
|
|
979
|
-
}),
|
|
1006
|
+
}), M ? j.copied : v ?? j.copyJson]
|
|
980
1007
|
})
|
|
981
1008
|
})
|
|
982
1009
|
]
|
|
983
|
-
}),
|
|
984
|
-
/* @__PURE__ */
|
|
1010
|
+
}), ye),
|
|
1011
|
+
/* @__PURE__ */ E("span", {
|
|
985
1012
|
role: "status",
|
|
986
1013
|
"aria-live": "polite",
|
|
987
1014
|
className: k.VisuallyHidden,
|
|
988
|
-
children:
|
|
1015
|
+
children: M ? j.copied : ""
|
|
989
1016
|
})
|
|
990
1017
|
]
|
|
991
1018
|
});
|
|
992
1019
|
}
|
|
993
1020
|
//#endregion
|
|
994
1021
|
//#region src/dev-panel/dev-panel-footer.tsx
|
|
995
|
-
function
|
|
996
|
-
let { copy:
|
|
997
|
-
return /* @__PURE__ */
|
|
1022
|
+
function ve({ onReseed: e, reseedLabel: t = "Reseed", onCopyUrl: r, url: i, copyUrlLabel: a = "Copy URL", onConsole: o, consoleLabel: s = "Console", children: c }) {
|
|
1023
|
+
let { copy: u } = U();
|
|
1024
|
+
return /* @__PURE__ */ D("div", {
|
|
998
1025
|
className: k.Footer,
|
|
999
1026
|
children: [
|
|
1000
|
-
e && /* @__PURE__ */
|
|
1027
|
+
e && /* @__PURE__ */ E(x, {
|
|
1001
1028
|
variant: "outline",
|
|
1002
1029
|
color: "secondary",
|
|
1003
1030
|
size: "sm",
|
|
1004
|
-
startIcon: /* @__PURE__ */
|
|
1031
|
+
startIcon: /* @__PURE__ */ E(l, { "aria-hidden": !0 }),
|
|
1005
1032
|
onClick: e,
|
|
1006
1033
|
children: t
|
|
1007
1034
|
}),
|
|
1008
|
-
r && /* @__PURE__ */
|
|
1035
|
+
r && /* @__PURE__ */ E(x, {
|
|
1009
1036
|
variant: "outline",
|
|
1010
1037
|
color: "secondary",
|
|
1011
1038
|
size: "sm",
|
|
1012
|
-
startIcon: /* @__PURE__ */
|
|
1039
|
+
startIcon: /* @__PURE__ */ E(d, { "aria-hidden": !0 }),
|
|
1013
1040
|
onClick: async () => {
|
|
1014
|
-
i != null && await
|
|
1041
|
+
i != null && await u(i), r?.();
|
|
1015
1042
|
},
|
|
1016
1043
|
children: a
|
|
1017
1044
|
}),
|
|
1018
|
-
o && /* @__PURE__ */
|
|
1045
|
+
o && /* @__PURE__ */ E(x, {
|
|
1019
1046
|
variant: "solid",
|
|
1020
1047
|
size: "sm",
|
|
1021
|
-
endIcon: /* @__PURE__ */
|
|
1048
|
+
endIcon: /* @__PURE__ */ E(n, { "aria-hidden": !0 }),
|
|
1022
1049
|
onClick: o,
|
|
1023
1050
|
style: { marginInlineStart: "auto" },
|
|
1024
1051
|
children: s
|
|
1025
1052
|
}),
|
|
1026
|
-
|
|
1053
|
+
c
|
|
1027
1054
|
]
|
|
1028
1055
|
});
|
|
1029
1056
|
}
|
|
1030
1057
|
//#endregion
|
|
1031
1058
|
//#region src/dev-panel/parts.ts
|
|
1032
|
-
var ye = /* @__PURE__ */
|
|
1033
|
-
Country: () =>
|
|
1034
|
-
Flow: () =>
|
|
1035
|
-
Footer: () =>
|
|
1036
|
-
Handle: () =>
|
|
1037
|
-
Payload: () =>
|
|
1038
|
-
Root: () =>
|
|
1039
|
-
Section: () =>
|
|
1040
|
-
Status: () =>
|
|
1041
|
-
StepState: () =>
|
|
1042
|
-
Steps: () =>
|
|
1043
|
-
Variant: () =>
|
|
1044
|
-
useSectionLabelId: () =>
|
|
1059
|
+
var ye = /* @__PURE__ */ re({
|
|
1060
|
+
Country: () => I,
|
|
1061
|
+
Flow: () => G,
|
|
1062
|
+
Footer: () => ve,
|
|
1063
|
+
Handle: () => le,
|
|
1064
|
+
Payload: () => Q,
|
|
1065
|
+
Root: () => N,
|
|
1066
|
+
Section: () => P,
|
|
1067
|
+
Status: () => V,
|
|
1068
|
+
StepState: () => de,
|
|
1069
|
+
Steps: () => z,
|
|
1070
|
+
Variant: () => L,
|
|
1071
|
+
useSectionLabelId: () => A
|
|
1045
1072
|
});
|
|
1046
1073
|
//#endregion
|
|
1047
1074
|
export { ye as DevPanel };
|