@leabankab/component-library 8.4.0 → 8.6.0
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 +17 -0
- package/dist/dev-panel/dev-panel-payload.d.ts +30 -6
- package/dist/dev-panel/dev-panel.d.ts +37 -6
- package/dist/dev-panel/parts.d.ts +1 -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 +566 -409
- package/dist/dev-panel.mjs.map +1 -1
- package/package.json +1 -1
package/dist/dev-panel.mjs
CHANGED
|
@@ -1,65 +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,
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { createPortal 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
|
+
import { createPortal as ne } from "react-dom";
|
|
7
7
|
import './dev-panel.css';//#region \0rolldown/runtime.js
|
|
8
|
-
var O = Object.defineProperty,
|
|
8
|
+
var O = Object.defineProperty, re = (e, t) => {
|
|
9
9
|
let n = {};
|
|
10
10
|
for (var r in e) O(n, r, {
|
|
11
11
|
get: e[r],
|
|
12
12
|
enumerable: !0
|
|
13
13
|
});
|
|
14
14
|
return t || O(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
15
|
-
},
|
|
16
|
-
Badge: "
|
|
17
|
-
SectionLabel: "
|
|
18
|
-
SectionMeta: "
|
|
19
|
-
FlowLabel: "
|
|
20
|
-
CountryCode: "
|
|
21
|
-
StepLabel: "
|
|
22
|
-
PayloadCode: "
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
15
|
+
}, k = {
|
|
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({
|
|
63
68
|
copy: {
|
|
64
69
|
no: "Kopier",
|
|
65
70
|
se: "Kopiera",
|
|
@@ -84,6 +89,36 @@ var O = Object.defineProperty, k = (e, t) => {
|
|
|
84
89
|
fi: "Sulje",
|
|
85
90
|
es: "Cerrar"
|
|
86
91
|
},
|
|
92
|
+
edit: {
|
|
93
|
+
no: "Rediger",
|
|
94
|
+
se: "Redigera",
|
|
95
|
+
fi: "Muokkaa",
|
|
96
|
+
es: "Editar"
|
|
97
|
+
},
|
|
98
|
+
apply: {
|
|
99
|
+
no: "Bruk",
|
|
100
|
+
se: "Tillämpa",
|
|
101
|
+
fi: "Käytä",
|
|
102
|
+
es: "Aplicar"
|
|
103
|
+
},
|
|
104
|
+
cancel: {
|
|
105
|
+
no: "Avbryt",
|
|
106
|
+
se: "Avbryt",
|
|
107
|
+
fi: "Peruuta",
|
|
108
|
+
es: "Cancelar"
|
|
109
|
+
},
|
|
110
|
+
reset: {
|
|
111
|
+
no: "Tilbakestill",
|
|
112
|
+
se: "Återställ",
|
|
113
|
+
fi: "Palauta",
|
|
114
|
+
es: "Restablecer"
|
|
115
|
+
},
|
|
116
|
+
invalidJson: {
|
|
117
|
+
no: "Ugyldig JSON",
|
|
118
|
+
se: "Ogiltig JSON",
|
|
119
|
+
fi: "Virheellinen JSON",
|
|
120
|
+
es: "JSON no válido"
|
|
121
|
+
},
|
|
87
122
|
minimise: {
|
|
88
123
|
no: "Minimer",
|
|
89
124
|
se: "Minimera",
|
|
@@ -108,6 +143,12 @@ var O = Object.defineProperty, k = (e, t) => {
|
|
|
108
143
|
fi: "Näytä",
|
|
109
144
|
es: "Mostrar"
|
|
110
145
|
},
|
|
146
|
+
pin: {
|
|
147
|
+
no: "Fest",
|
|
148
|
+
se: "Fäst",
|
|
149
|
+
fi: "Kiinnitä",
|
|
150
|
+
es: "Fijar"
|
|
151
|
+
},
|
|
111
152
|
step: {
|
|
112
153
|
no: "Steg",
|
|
113
154
|
se: "Steg",
|
|
@@ -138,167 +179,189 @@ var O = Object.defineProperty, k = (e, t) => {
|
|
|
138
179
|
fi: "vaatii huomiota",
|
|
139
180
|
es: "requiere atención"
|
|
140
181
|
}
|
|
141
|
-
}),
|
|
142
|
-
function
|
|
143
|
-
return
|
|
182
|
+
}), ae = (...e) => e.filter(Boolean).join(" "), oe = p(void 0);
|
|
183
|
+
function A() {
|
|
184
|
+
return h(oe);
|
|
144
185
|
}
|
|
145
|
-
var
|
|
146
|
-
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) {
|
|
147
188
|
let n = t.split("+").map((e) => e.trim().toLowerCase()), r = n.pop();
|
|
148
189
|
if (!r) return !1;
|
|
149
190
|
let i = n.includes("mod"), a = {
|
|
150
|
-
ctrl: n.includes("ctrl") || i && !
|
|
151
|
-
meta: n.includes("meta") || i &&
|
|
191
|
+
ctrl: n.includes("ctrl") || i && !M(),
|
|
192
|
+
meta: n.includes("meta") || i && M(),
|
|
152
193
|
alt: n.includes("alt"),
|
|
153
194
|
shift: n.includes("shift")
|
|
154
195
|
};
|
|
155
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}`;
|
|
156
197
|
}
|
|
157
|
-
function
|
|
158
|
-
let
|
|
159
|
-
let e = !
|
|
160
|
-
|
|
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);
|
|
161
205
|
}, Y = (e) => {
|
|
162
|
-
f === void 0 &&
|
|
206
|
+
f === void 0 && de(e), m?.(e);
|
|
163
207
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}, []),
|
|
167
|
-
let e =
|
|
168
|
-
|
|
208
|
+
g(() => {
|
|
209
|
+
h && !P && l === void 0 && typeof window < "u" && window.matchMedia?.(j).matches && F(!0);
|
|
210
|
+
}, []), g(() => {
|
|
211
|
+
let e = K.current;
|
|
212
|
+
K.current = null, e === "handle" && W.current?.focus(), e === "panel" && G.current?.focus();
|
|
169
213
|
});
|
|
170
|
-
let
|
|
171
|
-
isHidden:
|
|
214
|
+
let fe = y({
|
|
215
|
+
isHidden: R,
|
|
172
216
|
setHiddenState: Y
|
|
173
217
|
});
|
|
174
|
-
|
|
175
|
-
isHidden:
|
|
218
|
+
fe.current = {
|
|
219
|
+
isHidden: R,
|
|
176
220
|
setHiddenState: Y
|
|
177
|
-
},
|
|
178
|
-
if (!
|
|
221
|
+
}, g(() => {
|
|
222
|
+
if (!h || v === !1) return;
|
|
179
223
|
let e = (e) => {
|
|
180
|
-
if (e.repeat || !
|
|
224
|
+
if (e.repeat || !ce(e, v)) return;
|
|
181
225
|
e.preventDefault();
|
|
182
|
-
let { isHidden: t, setHiddenState: n } =
|
|
183
|
-
!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);
|
|
184
228
|
};
|
|
185
229
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
186
|
-
}, [
|
|
187
|
-
let
|
|
188
|
-
return
|
|
230
|
+
}, [h, v]);
|
|
231
|
+
let pe = _(), X = C === void 0 ? void 0 : C.endsWith("left") ? "left" : "right";
|
|
232
|
+
return R ? /* @__PURE__ */ E(se.Provider, {
|
|
189
233
|
value: {
|
|
190
234
|
show: () => {
|
|
191
|
-
|
|
235
|
+
K.current = "panel", Y(!1);
|
|
192
236
|
},
|
|
193
237
|
title: e,
|
|
194
|
-
handleRef:
|
|
238
|
+
handleRef: W,
|
|
239
|
+
side: X
|
|
195
240
|
},
|
|
196
|
-
children:
|
|
197
|
-
}) : /* @__PURE__ */
|
|
198
|
-
ref:
|
|
241
|
+
children: te ?? /* @__PURE__ */ E(le, {})
|
|
242
|
+
}) : /* @__PURE__ */ D("div", {
|
|
243
|
+
ref: U,
|
|
199
244
|
"data-dev-panel-root": "",
|
|
200
|
-
"data-
|
|
201
|
-
"data-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
245
|
+
"data-position": C,
|
|
246
|
+
"data-hideable": h ? "" : void 0,
|
|
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", {
|
|
252
|
+
className: k.Header,
|
|
253
|
+
children: [/* @__PURE__ */ D("span", {
|
|
254
|
+
className: k.HeaderTitle,
|
|
208
255
|
children: [
|
|
209
|
-
n && /* @__PURE__ */
|
|
210
|
-
className:
|
|
256
|
+
n && /* @__PURE__ */ E("span", {
|
|
257
|
+
className: k.HeaderDot,
|
|
211
258
|
"aria-hidden": !0
|
|
212
259
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
t != null && /* @__PURE__ */
|
|
215
|
-
className:
|
|
260
|
+
/* @__PURE__ */ E("span", { children: e }),
|
|
261
|
+
t != null && /* @__PURE__ */ E("span", {
|
|
262
|
+
className: k.Badge,
|
|
216
263
|
children: t
|
|
217
264
|
})
|
|
218
265
|
]
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
-
className:
|
|
221
|
-
children: [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
size:
|
|
245
|
-
|
|
266
|
+
}), /* @__PURE__ */ D("span", {
|
|
267
|
+
className: k.HeaderActions,
|
|
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
|
+
})
|
|
246
309
|
})
|
|
247
|
-
|
|
310
|
+
]
|
|
248
311
|
})]
|
|
249
|
-
}), !
|
|
250
|
-
id:
|
|
251
|
-
className:
|
|
252
|
-
children:
|
|
312
|
+
}), !I && /* @__PURE__ */ E("div", {
|
|
313
|
+
id: pe,
|
|
314
|
+
className: k.Body,
|
|
315
|
+
children: oe
|
|
253
316
|
})]
|
|
254
317
|
});
|
|
255
318
|
}
|
|
256
|
-
function
|
|
257
|
-
let a =
|
|
258
|
-
return /* @__PURE__ */
|
|
319
|
+
function P({ label: e, meta: t, children: n, className: r, style: i }) {
|
|
320
|
+
let a = _();
|
|
321
|
+
return /* @__PURE__ */ D("section", {
|
|
259
322
|
"aria-labelledby": a,
|
|
260
|
-
className:
|
|
323
|
+
className: ae(k.Section, r),
|
|
261
324
|
style: i,
|
|
262
|
-
children: [/* @__PURE__ */
|
|
263
|
-
className:
|
|
264
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ D("div", {
|
|
326
|
+
className: k.SectionHeaderRow,
|
|
327
|
+
children: [/* @__PURE__ */ E("span", {
|
|
265
328
|
id: a,
|
|
266
|
-
className:
|
|
329
|
+
className: k.SectionLabel,
|
|
267
330
|
children: e
|
|
268
|
-
}), t != null && /* @__PURE__ */
|
|
269
|
-
className:
|
|
331
|
+
}), t != null && /* @__PURE__ */ E("span", {
|
|
332
|
+
className: k.SectionMeta,
|
|
270
333
|
children: t
|
|
271
334
|
})]
|
|
272
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ E(oe.Provider, {
|
|
273
336
|
value: a,
|
|
274
337
|
children: n
|
|
275
338
|
})]
|
|
276
339
|
});
|
|
277
340
|
}
|
|
278
|
-
function
|
|
279
|
-
let i =
|
|
341
|
+
function le({ side: e, label: t, className: n, style: r }) {
|
|
342
|
+
let i = ie(), a = h(se);
|
|
280
343
|
if (!a) return null;
|
|
281
|
-
let o = t ?? a.title;
|
|
282
|
-
return /* @__PURE__ */
|
|
344
|
+
let o = t ?? a.title, s = e ?? a.side ?? "right";
|
|
345
|
+
return /* @__PURE__ */ D("button", {
|
|
283
346
|
ref: a.handleRef,
|
|
284
347
|
type: "button",
|
|
285
|
-
className:
|
|
348
|
+
className: ae(k.Handle, n),
|
|
286
349
|
style: r,
|
|
287
|
-
"data-side":
|
|
350
|
+
"data-side": s,
|
|
288
351
|
"aria-label": typeof o == "string" ? `${i.show} ${o}` : void 0,
|
|
289
352
|
onClick: a.show,
|
|
290
|
-
children: [/* @__PURE__ */
|
|
291
|
-
className:
|
|
353
|
+
children: [/* @__PURE__ */ E("span", {
|
|
354
|
+
className: k.HeaderDot,
|
|
292
355
|
"aria-hidden": !0
|
|
293
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ E("span", { children: o })]
|
|
294
357
|
});
|
|
295
358
|
}
|
|
296
359
|
//#endregion
|
|
297
360
|
//#region src/dev-panel/use-roving-radio.ts
|
|
298
|
-
function
|
|
299
|
-
let i =
|
|
361
|
+
function ue({ values: e, selected: t, onSelect: n, isDisabled: r }) {
|
|
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) => {
|
|
300
363
|
i.current[t]?.focus(), n(e[t]);
|
|
301
|
-
}, [n, e]), u =
|
|
364
|
+
}, [n, e]), u = m((t, n) => {
|
|
302
365
|
let r = e.length;
|
|
303
366
|
for (let e = 1; e <= r; e += 1) {
|
|
304
367
|
let i = (t + n * e + r * e) % r;
|
|
@@ -306,7 +369,7 @@ function H({ values: e, selected: t, onSelect: n, isDisabled: r }) {
|
|
|
306
369
|
}
|
|
307
370
|
return t;
|
|
308
371
|
}, [a, e.length]);
|
|
309
|
-
return { getItemProps:
|
|
372
|
+
return { getItemProps: m((r) => {
|
|
310
373
|
let o = e[r], s = a(r);
|
|
311
374
|
return {
|
|
312
375
|
ref: (e) => {
|
|
@@ -352,49 +415,49 @@ function H({ values: e, selected: t, onSelect: n, isDisabled: r }) {
|
|
|
352
415
|
}
|
|
353
416
|
//#endregion
|
|
354
417
|
//#region src/dev-panel/segmented-control.tsx
|
|
355
|
-
function
|
|
356
|
-
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({
|
|
357
420
|
values: n.map((e) => e.value),
|
|
358
421
|
selected: e,
|
|
359
422
|
onSelect: t,
|
|
360
423
|
isDisabled: (e, t) => n[t]?.disabled ?? !1
|
|
361
424
|
}), l = r === "chip";
|
|
362
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ E("div", {
|
|
363
426
|
role: "radiogroup",
|
|
364
427
|
"aria-label": i,
|
|
365
428
|
"aria-labelledby": s,
|
|
366
|
-
className: l ?
|
|
429
|
+
className: l ? k.ChipGroup : k.SegmentedGroup,
|
|
367
430
|
children: n.map((e, t) => {
|
|
368
431
|
let { onKeyDown: n, ...r } = c(t);
|
|
369
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ D("button", {
|
|
370
433
|
type: "button",
|
|
371
434
|
"data-disabled": e.disabled ? "" : void 0,
|
|
372
435
|
onKeyDown: n,
|
|
373
436
|
...r,
|
|
374
|
-
className: l ?
|
|
375
|
-
children: [l ? /* @__PURE__ */
|
|
376
|
-
className:
|
|
437
|
+
className: l ? k.Chip : k.SegmentedOption,
|
|
438
|
+
children: [l ? /* @__PURE__ */ E("span", {
|
|
439
|
+
className: k.ChipDot,
|
|
377
440
|
"aria-hidden": !0
|
|
378
|
-
}) : e.icon, /* @__PURE__ */
|
|
441
|
+
}) : e.icon, /* @__PURE__ */ E("span", { children: e.label })]
|
|
379
442
|
}, e.value);
|
|
380
443
|
})
|
|
381
444
|
});
|
|
382
445
|
}
|
|
383
446
|
//#endregion
|
|
384
447
|
//#region src/dev-panel/dev-panel-country.tsx
|
|
385
|
-
function
|
|
448
|
+
function I({ value: e, onChange: t, options: n, label: r = "Country" }) {
|
|
386
449
|
let i = n.map((e) => ({
|
|
387
450
|
value: e.value,
|
|
388
451
|
disabled: e.disabled,
|
|
389
452
|
label: e.label,
|
|
390
|
-
icon: e.code == null ? void 0 : /* @__PURE__ */
|
|
391
|
-
className:
|
|
453
|
+
icon: e.code == null ? void 0 : /* @__PURE__ */ E("span", {
|
|
454
|
+
className: k.CountryCode,
|
|
392
455
|
children: e.code
|
|
393
456
|
})
|
|
394
457
|
}));
|
|
395
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ E(P, {
|
|
396
459
|
label: r,
|
|
397
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ E(F, {
|
|
398
461
|
value: e,
|
|
399
462
|
onChange: t,
|
|
400
463
|
options: i
|
|
@@ -403,15 +466,15 @@ function W({ value: e, onChange: t, options: n, label: r = "Country" }) {
|
|
|
403
466
|
}
|
|
404
467
|
//#endregion
|
|
405
468
|
//#region src/dev-panel/dev-panel-variant.tsx
|
|
406
|
-
function
|
|
469
|
+
function L({ value: e, onChange: t, options: n, label: r = "Variant" }) {
|
|
407
470
|
let i = n.map((e) => ({
|
|
408
471
|
value: e.value,
|
|
409
472
|
label: e.label,
|
|
410
473
|
disabled: e.disabled
|
|
411
474
|
}));
|
|
412
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ E(P, {
|
|
413
476
|
label: r,
|
|
414
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ E(F, {
|
|
415
478
|
value: e,
|
|
416
479
|
onChange: t,
|
|
417
480
|
options: i
|
|
@@ -420,15 +483,15 @@ function G({ value: e, onChange: t, options: n, label: r = "Variant" }) {
|
|
|
420
483
|
}
|
|
421
484
|
//#endregion
|
|
422
485
|
//#region src/dev-panel/dev-panel-step-state.tsx
|
|
423
|
-
function
|
|
486
|
+
function de({ value: e, onChange: t, options: n, label: r = "Step state", stepLabel: i, variationsLabel: a = "Variations for" }) {
|
|
424
487
|
let o = n.map((e) => ({
|
|
425
488
|
value: e.value,
|
|
426
489
|
label: e.label,
|
|
427
490
|
disabled: e.disabled
|
|
428
491
|
}));
|
|
429
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ D(P, {
|
|
430
493
|
label: r,
|
|
431
|
-
children: [i != null && /* @__PURE__ */
|
|
494
|
+
children: [i != null && /* @__PURE__ */ D(C, {
|
|
432
495
|
textStyle: "body-sm",
|
|
433
496
|
style: {
|
|
434
497
|
color: "var(--lea-color-neutral-600)",
|
|
@@ -437,12 +500,12 @@ function K({ value: e, onChange: t, options: n, label: r = "Step state", stepLab
|
|
|
437
500
|
children: [
|
|
438
501
|
a,
|
|
439
502
|
" ",
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
className:
|
|
503
|
+
/* @__PURE__ */ E("span", {
|
|
504
|
+
className: k.StepStateName,
|
|
442
505
|
children: i
|
|
443
506
|
})
|
|
444
507
|
]
|
|
445
|
-
}), /* @__PURE__ */
|
|
508
|
+
}), /* @__PURE__ */ E(F, {
|
|
446
509
|
value: e,
|
|
447
510
|
onChange: t,
|
|
448
511
|
options: o,
|
|
@@ -452,19 +515,19 @@ function K({ value: e, onChange: t, options: n, label: r = "Step state", stepLab
|
|
|
452
515
|
}
|
|
453
516
|
//#endregion
|
|
454
517
|
//#region src/dev-panel/dev-panel-steps.tsx
|
|
455
|
-
var
|
|
518
|
+
var R = (e, t) => {
|
|
456
519
|
switch (e) {
|
|
457
520
|
case "complete": return t.statusCompleted;
|
|
458
521
|
case "current": return t.statusCurrent;
|
|
459
522
|
default: return t.statusUpcoming;
|
|
460
523
|
}
|
|
461
524
|
};
|
|
462
|
-
function
|
|
463
|
-
let o =
|
|
464
|
-
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, {
|
|
465
528
|
label: r,
|
|
466
529
|
meta: c,
|
|
467
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ E(B, {
|
|
468
531
|
steps: e,
|
|
469
532
|
currentStep: t,
|
|
470
533
|
onStepSelect: n,
|
|
@@ -473,49 +536,49 @@ function J({ steps: e, currentStep: t, onStepSelect: n, label: r = "Jump to step
|
|
|
473
536
|
})
|
|
474
537
|
});
|
|
475
538
|
}
|
|
476
|
-
function
|
|
477
|
-
let o =
|
|
478
|
-
return /* @__PURE__ */
|
|
539
|
+
function B({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
|
|
540
|
+
let o = A();
|
|
541
|
+
return /* @__PURE__ */ E("div", {
|
|
479
542
|
role: "group",
|
|
480
543
|
"aria-labelledby": o,
|
|
481
|
-
className:
|
|
544
|
+
className: k.StepGrid,
|
|
482
545
|
style: { "--_columns": i },
|
|
483
546
|
children: e.map((e, i) => {
|
|
484
547
|
let o = i + 1, s = e.status ?? (n == null ? "upcoming" : o < n ? "complete" : o === n ? "current" : "upcoming"), c = s === "current", l = s === "complete";
|
|
485
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ D("button", {
|
|
486
549
|
type: "button",
|
|
487
550
|
"aria-current": c ? "step" : void 0,
|
|
488
551
|
"data-state": s,
|
|
489
552
|
"data-disabled": e.disabled ? "" : void 0,
|
|
490
553
|
disabled: e.disabled,
|
|
491
554
|
onClick: () => r?.(o, e),
|
|
492
|
-
className:
|
|
555
|
+
className: k.StepButton,
|
|
493
556
|
children: [
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
className:
|
|
557
|
+
/* @__PURE__ */ D("span", {
|
|
558
|
+
className: k.StepCircle,
|
|
496
559
|
children: [
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
className:
|
|
560
|
+
/* @__PURE__ */ E("span", {
|
|
561
|
+
className: k.VisuallyHidden,
|
|
499
562
|
children: l ? `${a.step} ${o}` : `${a.step} `
|
|
500
563
|
}),
|
|
501
|
-
l ? /* @__PURE__ */
|
|
564
|
+
l ? /* @__PURE__ */ E(t, {
|
|
502
565
|
size: 18,
|
|
503
566
|
"aria-hidden": !0
|
|
504
567
|
}) : o,
|
|
505
|
-
e.flagged && /* @__PURE__ */
|
|
506
|
-
className:
|
|
568
|
+
e.flagged && /* @__PURE__ */ E("span", {
|
|
569
|
+
className: k.StepFlagDot,
|
|
507
570
|
"aria-hidden": !0
|
|
508
571
|
})
|
|
509
572
|
]
|
|
510
573
|
}),
|
|
511
574
|
" ",
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
className:
|
|
575
|
+
/* @__PURE__ */ E("span", {
|
|
576
|
+
className: k.StepLabel,
|
|
514
577
|
children: e.label
|
|
515
578
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
className:
|
|
518
|
-
children: `(${
|
|
579
|
+
/* @__PURE__ */ E("span", {
|
|
580
|
+
className: k.VisuallyHidden,
|
|
581
|
+
children: `(${R(s, a)}${e.flagged ? `, ${a.needsAttention}` : ""})`
|
|
519
582
|
})
|
|
520
583
|
]
|
|
521
584
|
}, o);
|
|
@@ -524,117 +587,117 @@ function Y({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
|
|
|
524
587
|
}
|
|
525
588
|
//#endregion
|
|
526
589
|
//#region src/dev-panel/dev-panel-status.tsx
|
|
527
|
-
function
|
|
528
|
-
return /* @__PURE__ */
|
|
590
|
+
function V({ value: e, onChange: t, options: n, label: r = "Application status" }) {
|
|
591
|
+
return /* @__PURE__ */ E(P, {
|
|
529
592
|
label: r,
|
|
530
|
-
children: /* @__PURE__ */
|
|
593
|
+
children: /* @__PURE__ */ E(H, {
|
|
531
594
|
value: e,
|
|
532
595
|
onChange: t,
|
|
533
596
|
options: n
|
|
534
597
|
})
|
|
535
598
|
});
|
|
536
599
|
}
|
|
537
|
-
function
|
|
538
|
-
let r =
|
|
600
|
+
function H({ value: e, onChange: t, options: n }) {
|
|
601
|
+
let r = A(), { getItemProps: i } = ue({
|
|
539
602
|
values: n.map((e) => e.value),
|
|
540
603
|
selected: e,
|
|
541
604
|
onSelect: t,
|
|
542
605
|
isDisabled: (e, t) => n[t]?.disabled ?? !1
|
|
543
606
|
});
|
|
544
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ E("div", {
|
|
545
608
|
role: "radiogroup",
|
|
546
609
|
"aria-labelledby": r,
|
|
547
|
-
className:
|
|
610
|
+
className: k.StatusGrid,
|
|
548
611
|
children: n.map((e, t) => {
|
|
549
612
|
let { onKeyDown: n, ...r } = i(t);
|
|
550
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ D("button", {
|
|
551
614
|
type: "button",
|
|
552
615
|
"data-color": e.color ?? "neutral",
|
|
553
616
|
"data-disabled": e.disabled ? "" : void 0,
|
|
554
617
|
onKeyDown: n,
|
|
555
618
|
...r,
|
|
556
|
-
className:
|
|
557
|
-
children: [/* @__PURE__ */
|
|
558
|
-
className:
|
|
619
|
+
className: k.StatusCard,
|
|
620
|
+
children: [/* @__PURE__ */ E("span", {
|
|
621
|
+
className: k.StatusDot,
|
|
559
622
|
"aria-hidden": !0
|
|
560
|
-
}), /* @__PURE__ */
|
|
623
|
+
}), /* @__PURE__ */ E("span", { children: e.label })]
|
|
561
624
|
}, e.value);
|
|
562
625
|
})
|
|
563
626
|
});
|
|
564
627
|
}
|
|
565
628
|
//#endregion
|
|
566
629
|
//#region src/dev-panel/use-copy.ts
|
|
567
|
-
function
|
|
568
|
-
let [e, t] =
|
|
630
|
+
function U() {
|
|
631
|
+
let [e, t] = b(!1), n = y(void 0), r = m(async (e) => {
|
|
569
632
|
try {
|
|
570
633
|
await navigator.clipboard?.writeText(e);
|
|
571
634
|
} catch {}
|
|
572
635
|
t(!0), clearTimeout(n.current), n.current = setTimeout(() => t(!1), 2e3);
|
|
573
636
|
}, []);
|
|
574
|
-
return
|
|
637
|
+
return g(() => () => clearTimeout(n.current), []), {
|
|
575
638
|
copied: e,
|
|
576
639
|
copy: r
|
|
577
640
|
};
|
|
578
641
|
}
|
|
579
642
|
//#endregion
|
|
580
643
|
//#region src/dev-panel/dev-panel-flow.tsx
|
|
581
|
-
var
|
|
582
|
-
function
|
|
583
|
-
let
|
|
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 = [
|
|
584
647
|
e,
|
|
585
648
|
n,
|
|
586
649
|
i
|
|
587
|
-
].filter((e) => e != null),
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
className:
|
|
650
|
+
].filter((e) => e != null), m = p.map(W).filter((e) => e != null).join(" · "), h = s ?? m;
|
|
651
|
+
return /* @__PURE__ */ D("div", {
|
|
652
|
+
className: k.Flow,
|
|
590
653
|
children: [
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
className:
|
|
593
|
-
children: [/* @__PURE__ */
|
|
594
|
-
className:
|
|
654
|
+
/* @__PURE__ */ D("div", {
|
|
655
|
+
className: k.FlowText,
|
|
656
|
+
children: [/* @__PURE__ */ E("span", {
|
|
657
|
+
className: k.FlowLabel,
|
|
595
658
|
children: a
|
|
596
|
-
}), /* @__PURE__ */
|
|
659
|
+
}), /* @__PURE__ */ E("span", { children: p.map((e, t) => /* @__PURE__ */ D(f, { children: [t > 0 && /* @__PURE__ */ E("span", {
|
|
597
660
|
"aria-hidden": !0,
|
|
598
|
-
className:
|
|
661
|
+
className: k.FlowSeparator,
|
|
599
662
|
children: "·"
|
|
600
663
|
}), e] }, t)) })]
|
|
601
664
|
}),
|
|
602
|
-
o && /* @__PURE__ */
|
|
603
|
-
"aria-label": c ??
|
|
665
|
+
o && /* @__PURE__ */ E(S, {
|
|
666
|
+
"aria-label": c ?? u.copy,
|
|
604
667
|
onClick: async () => {
|
|
605
|
-
await
|
|
668
|
+
await ee(h), l?.();
|
|
606
669
|
},
|
|
607
670
|
variant: "outline",
|
|
608
671
|
color: "secondary",
|
|
609
672
|
size: "sm",
|
|
610
|
-
children:
|
|
673
|
+
children: E(d ? t : r, {
|
|
611
674
|
size: 16,
|
|
612
675
|
"aria-hidden": !0
|
|
613
676
|
})
|
|
614
677
|
}),
|
|
615
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ E("span", {
|
|
616
679
|
role: "status",
|
|
617
680
|
"aria-live": "polite",
|
|
618
|
-
className:
|
|
619
|
-
children:
|
|
681
|
+
className: k.VisuallyHidden,
|
|
682
|
+
children: d ? u.copied : ""
|
|
620
683
|
})
|
|
621
684
|
]
|
|
622
685
|
});
|
|
623
686
|
}
|
|
624
687
|
//#endregion
|
|
625
688
|
//#region src/dev-panel/json-highlight.tsx
|
|
626
|
-
var
|
|
627
|
-
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) {
|
|
628
691
|
if (e[0] === "\"") {
|
|
629
692
|
let e = n;
|
|
630
|
-
for (; e < t.length &&
|
|
693
|
+
for (; e < t.length && q(t[e]);) e += 1;
|
|
631
694
|
return t[e] === ":" ? "key" : "string";
|
|
632
695
|
}
|
|
633
696
|
return e === "true" || e === "false" ? "boolean" : e === "null" ? "null" : "number";
|
|
634
697
|
}
|
|
635
|
-
function
|
|
698
|
+
function Y(e) {
|
|
636
699
|
let t = [], n = 0;
|
|
637
|
-
for (let r of e.matchAll(
|
|
700
|
+
for (let r of e.matchAll(K)) {
|
|
638
701
|
let i = r.index ?? 0;
|
|
639
702
|
i > n && t.push({
|
|
640
703
|
type: "punctuation",
|
|
@@ -642,7 +705,7 @@ function ae(e) {
|
|
|
642
705
|
});
|
|
643
706
|
let a = r[0];
|
|
644
707
|
t.push({
|
|
645
|
-
type:
|
|
708
|
+
type: J(a, e, i + a.length),
|
|
646
709
|
value: a
|
|
647
710
|
}), n = i + a.length;
|
|
648
711
|
}
|
|
@@ -651,7 +714,7 @@ function ae(e) {
|
|
|
651
714
|
value: e.slice(n)
|
|
652
715
|
}), t;
|
|
653
716
|
}
|
|
654
|
-
function
|
|
717
|
+
function fe(e) {
|
|
655
718
|
if (typeof e != "string") return e != null;
|
|
656
719
|
let t = e.trim();
|
|
657
720
|
if (!t) return !1;
|
|
@@ -661,66 +724,87 @@ function oe(e) {
|
|
|
661
724
|
return !1;
|
|
662
725
|
}
|
|
663
726
|
}
|
|
664
|
-
function
|
|
665
|
-
let t =
|
|
666
|
-
return /* @__PURE__ */ T
|
|
667
|
-
className:
|
|
727
|
+
function pe({ code: e }) {
|
|
728
|
+
let t = te(() => Y(e), [e]);
|
|
729
|
+
return /* @__PURE__ */ E(T, { children: t.map((e, t) => /* @__PURE__ */ E("span", {
|
|
730
|
+
className: k.Token,
|
|
668
731
|
"data-token": e.type,
|
|
669
732
|
children: e.value
|
|
670
733
|
}, t)) });
|
|
671
734
|
}
|
|
672
735
|
//#endregion
|
|
673
736
|
//#region src/dev-panel/dev-panel-payload.tsx
|
|
674
|
-
var
|
|
737
|
+
var X = {
|
|
675
738
|
"--button-fg": "var(--lea-palette-text-contrast)",
|
|
676
739
|
"--button-border": "var(--lea-palette-border-contrast)",
|
|
677
740
|
"--button-tint": "var(--lea-color-neutral-800)"
|
|
678
|
-
},
|
|
741
|
+
}, me = (e) => {
|
|
679
742
|
if (typeof e == "string") return e;
|
|
680
743
|
try {
|
|
681
744
|
return JSON.stringify(e, null, 2);
|
|
682
745
|
} catch {
|
|
683
746
|
return String(e);
|
|
684
747
|
}
|
|
685
|
-
},
|
|
686
|
-
function
|
|
687
|
-
let
|
|
688
|
-
|
|
689
|
-
let
|
|
690
|
-
|
|
691
|
-
}, [
|
|
692
|
-
|
|
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: $ }) : $;
|
|
755
|
+
g(() => {
|
|
756
|
+
let e = q.current;
|
|
757
|
+
q.current = null, e === "editor" && K.current?.focus(), e === "edit" && G.current?.focus();
|
|
758
|
+
}), g(() => {
|
|
759
|
+
F || (B(null), H(null));
|
|
760
|
+
}, [F]);
|
|
761
|
+
let Ce = () => {
|
|
762
|
+
q.current = "editor", B($), H(null);
|
|
763
|
+
}, we = () => {
|
|
764
|
+
q.current = "edit", B(null), H(null);
|
|
765
|
+
}, Te = () => {
|
|
766
|
+
if (z === null) return;
|
|
767
|
+
let e;
|
|
768
|
+
try {
|
|
769
|
+
e = JSON.parse(z);
|
|
770
|
+
} catch (e) {
|
|
771
|
+
H(e instanceof Error ? e.message : String(e));
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
we(), w?.(e);
|
|
775
|
+
}, Ee = m(() => {
|
|
776
|
+
let e = J.current?.closest("[data-dev-panel-root]") ?? J.current;
|
|
693
777
|
if (!e) return;
|
|
694
|
-
let t = e.getBoundingClientRect(), n = Math.min(
|
|
695
|
-
r <
|
|
696
|
-
let i = Math.min(t.height, window.innerHeight - 24), a = Math.min(Math.max(
|
|
697
|
-
|
|
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({
|
|
698
782
|
top: a,
|
|
699
783
|
left: r,
|
|
700
784
|
width: n,
|
|
701
785
|
height: i
|
|
702
786
|
});
|
|
703
787
|
}, []);
|
|
704
|
-
|
|
705
|
-
if (!
|
|
706
|
-
|
|
707
|
-
let e = () =>
|
|
788
|
+
he(() => {
|
|
789
|
+
if (!R || !F) return;
|
|
790
|
+
Ee();
|
|
791
|
+
let e = () => Ee();
|
|
708
792
|
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
709
793
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
710
794
|
};
|
|
711
795
|
}, [
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
796
|
+
R,
|
|
797
|
+
F,
|
|
798
|
+
Ee
|
|
715
799
|
]);
|
|
716
|
-
let
|
|
717
|
-
|
|
718
|
-
if (!
|
|
719
|
-
let e =
|
|
800
|
+
let De = Q !== null;
|
|
801
|
+
g(() => {
|
|
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"));
|
|
720
804
|
(n()[0] ?? e)?.focus();
|
|
721
805
|
let r = (t) => {
|
|
722
806
|
if (t.key === "Escape") {
|
|
723
|
-
t.stopPropagation(),
|
|
807
|
+
t.stopPropagation(), xe(!1);
|
|
724
808
|
return;
|
|
725
809
|
}
|
|
726
810
|
if (t.key !== "Tab") return;
|
|
@@ -733,187 +817,260 @@ function pe({ value: i, label: a = "Payload preview", title: o, placement: s = "
|
|
|
733
817
|
t.shiftKey && (o === i || o === e) ? (t.preventDefault(), a.focus()) : !t.shiftKey && o === a && (t.preventDefault(), i.focus());
|
|
734
818
|
}, i = (n) => {
|
|
735
819
|
let r = n.target;
|
|
736
|
-
e?.contains(r) || t?.contains(r) ||
|
|
820
|
+
e?.contains(r) || t?.contains(r) || xe(!1);
|
|
737
821
|
};
|
|
738
822
|
return document.addEventListener("keydown", r, !0), document.addEventListener("pointerdown", i, !0), () => {
|
|
739
823
|
document.removeEventListener("keydown", r, !0), document.removeEventListener("pointerdown", i, !0), t?.focus();
|
|
740
824
|
};
|
|
741
825
|
}, [
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
826
|
+
R,
|
|
827
|
+
F,
|
|
828
|
+
ye,
|
|
829
|
+
De,
|
|
830
|
+
xe
|
|
747
831
|
]);
|
|
748
|
-
let
|
|
749
|
-
"aria-label":
|
|
750
|
-
onClick: () =>
|
|
832
|
+
let Oe = z ?? $, ke = /* @__PURE__ */ E(S, {
|
|
833
|
+
"aria-label": h ?? j.copy,
|
|
834
|
+
onClick: () => ce(Oe),
|
|
751
835
|
variant: "outline",
|
|
752
836
|
color: "secondary",
|
|
753
837
|
size: "sm",
|
|
754
|
-
className:
|
|
755
|
-
style:
|
|
756
|
-
children:
|
|
838
|
+
className: k.OnDark,
|
|
839
|
+
style: X,
|
|
840
|
+
children: E(M ? t : r, {
|
|
757
841
|
size: 16,
|
|
758
842
|
"aria-hidden": !0
|
|
759
843
|
})
|
|
760
|
-
})
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
844
|
+
}), Ae = !W && /* @__PURE__ */ D(T, { children: [O && /* @__PURE__ */ E(S, {
|
|
845
|
+
"aria-label": A ?? j.reset,
|
|
846
|
+
onClick: O,
|
|
847
|
+
variant: "outline",
|
|
848
|
+
color: "secondary",
|
|
849
|
+
size: "sm",
|
|
850
|
+
className: k.OnDark,
|
|
851
|
+
style: X,
|
|
852
|
+
children: /* @__PURE__ */ E(u, {
|
|
853
|
+
size: 16,
|
|
854
|
+
"aria-hidden": !0
|
|
855
|
+
})
|
|
856
|
+
}), w && /* @__PURE__ */ E(S, {
|
|
857
|
+
ref: G,
|
|
858
|
+
"aria-label": re ?? j.edit,
|
|
859
|
+
onClick: Ce,
|
|
860
|
+
variant: "outline",
|
|
861
|
+
color: "secondary",
|
|
862
|
+
size: "sm",
|
|
863
|
+
className: k.OnDark,
|
|
864
|
+
style: X,
|
|
865
|
+
children: /* @__PURE__ */ E(o, {
|
|
866
|
+
size: 16,
|
|
867
|
+
"aria-hidden": !0
|
|
868
|
+
})
|
|
869
|
+
})] }), je = W ? /* @__PURE__ */ D(T, { children: [
|
|
870
|
+
/* @__PURE__ */ E("textarea", {
|
|
871
|
+
ref: K,
|
|
872
|
+
value: z,
|
|
873
|
+
onChange: (e) => {
|
|
874
|
+
B(e.target.value), H(null);
|
|
875
|
+
},
|
|
876
|
+
"aria-labelledby": L,
|
|
877
|
+
"aria-invalid": V !== null || void 0,
|
|
878
|
+
"aria-describedby": V === null ? void 0 : de,
|
|
879
|
+
spellCheck: !1,
|
|
880
|
+
autoCapitalize: "off",
|
|
881
|
+
autoComplete: "off",
|
|
882
|
+
className: k.PayloadEditor
|
|
783
883
|
}),
|
|
784
|
-
|
|
785
|
-
id:
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
children: [/* @__PURE__ */ T("span", { children: o ?? a }), Y]
|
|
790
|
-
}), /* @__PURE__ */ T("pre", {
|
|
791
|
-
tabIndex: 0,
|
|
792
|
-
className: A.PayloadCode,
|
|
793
|
-
children: K
|
|
794
|
-
})]
|
|
884
|
+
V !== null && /* @__PURE__ */ E("p", {
|
|
885
|
+
id: de,
|
|
886
|
+
role: "alert",
|
|
887
|
+
className: k.PayloadError,
|
|
888
|
+
children: `${se ?? j.invalidJson}: ${V}`
|
|
795
889
|
}),
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
890
|
+
/* @__PURE__ */ D("div", {
|
|
891
|
+
className: k.PayloadActions,
|
|
892
|
+
children: [/* @__PURE__ */ E(x, {
|
|
893
|
+
onClick: we,
|
|
894
|
+
variant: "outline",
|
|
895
|
+
color: "secondary",
|
|
896
|
+
size: "sm",
|
|
897
|
+
className: k.OnDark,
|
|
898
|
+
style: X,
|
|
899
|
+
children: oe ?? j.cancel
|
|
900
|
+
}), /* @__PURE__ */ E(x, {
|
|
901
|
+
onClick: Te,
|
|
902
|
+
variant: "solid",
|
|
903
|
+
size: "sm",
|
|
904
|
+
children: ae ?? j.apply
|
|
905
|
+
})]
|
|
906
|
+
})
|
|
907
|
+
] }) : /* @__PURE__ */ E("pre", {
|
|
908
|
+
tabIndex: 0,
|
|
909
|
+
className: k.PayloadCode,
|
|
910
|
+
children: Se
|
|
911
|
+
});
|
|
912
|
+
return /* @__PURE__ */ D("div", {
|
|
913
|
+
className: k.Payload,
|
|
914
|
+
"data-placement": c,
|
|
915
|
+
children: [
|
|
916
|
+
!ue && /* @__PURE__ */ D("button", {
|
|
917
|
+
ref: J,
|
|
918
|
+
type: "button",
|
|
919
|
+
"aria-expanded": F,
|
|
920
|
+
"aria-controls": I,
|
|
921
|
+
"data-placement": c,
|
|
922
|
+
onClick: () => xe(!F),
|
|
923
|
+
className: k.PayloadToggle,
|
|
924
|
+
children: [/* @__PURE__ */ D("span", {
|
|
925
|
+
className: k.PayloadToggleLabel,
|
|
926
|
+
children: [/* @__PURE__ */ E(e, {
|
|
927
|
+
size: 16,
|
|
928
|
+
"aria-hidden": !0
|
|
929
|
+
}), a]
|
|
930
|
+
}), /* @__PURE__ */ E("span", {
|
|
931
|
+
className: k.PayloadChevron,
|
|
932
|
+
children: /* @__PURE__ */ E(n, {
|
|
933
|
+
size: 16,
|
|
934
|
+
"aria-hidden": !0
|
|
935
|
+
})
|
|
936
|
+
})]
|
|
937
|
+
}),
|
|
938
|
+
!R && F && /* @__PURE__ */ D("div", {
|
|
939
|
+
id: I,
|
|
940
|
+
className: k.PayloadPanel,
|
|
941
|
+
"data-placement": c,
|
|
942
|
+
children: [/* @__PURE__ */ D("div", {
|
|
943
|
+
className: k.PayloadHeader,
|
|
812
944
|
children: [/* @__PURE__ */ E("span", {
|
|
813
|
-
|
|
814
|
-
children:
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
945
|
+
id: L,
|
|
946
|
+
children: s ?? a
|
|
947
|
+
}), /* @__PURE__ */ D("span", {
|
|
948
|
+
className: k.HeaderActions,
|
|
949
|
+
children: [Ae, ke]
|
|
950
|
+
})]
|
|
951
|
+
}), je]
|
|
952
|
+
}),
|
|
953
|
+
R && F && ye && ne(/* @__PURE__ */ D("div", {
|
|
954
|
+
ref: Y,
|
|
955
|
+
id: I,
|
|
956
|
+
role: "dialog",
|
|
957
|
+
"aria-labelledby": L,
|
|
958
|
+
tabIndex: -1,
|
|
959
|
+
className: k.Flyout,
|
|
960
|
+
style: Q ? {
|
|
961
|
+
top: Q.top,
|
|
962
|
+
left: Q.left,
|
|
963
|
+
width: Q.width,
|
|
964
|
+
height: Q.height
|
|
965
|
+
} : { visibility: "hidden" },
|
|
966
|
+
children: [
|
|
967
|
+
/* @__PURE__ */ D("div", {
|
|
968
|
+
className: k.PayloadHeader,
|
|
969
|
+
children: [/* @__PURE__ */ D("span", {
|
|
970
|
+
className: k.FlyoutTitle,
|
|
971
|
+
children: [/* @__PURE__ */ E("span", {
|
|
972
|
+
id: L,
|
|
973
|
+
children: s ?? a
|
|
974
|
+
}), l != null && /* @__PURE__ */ E("span", {
|
|
975
|
+
className: k.Badge,
|
|
976
|
+
"data-on-dark": "",
|
|
977
|
+
children: l
|
|
978
|
+
})]
|
|
979
|
+
}), /* @__PURE__ */ D("span", {
|
|
980
|
+
className: k.HeaderActions,
|
|
981
|
+
children: [Ae, /* @__PURE__ */ E(S, {
|
|
982
|
+
"aria-label": te ?? j.close,
|
|
983
|
+
onClick: () => xe(!1),
|
|
984
|
+
variant: "outline",
|
|
985
|
+
color: "secondary",
|
|
986
|
+
size: "sm",
|
|
987
|
+
className: k.OnDark,
|
|
988
|
+
style: X,
|
|
989
|
+
children: /* @__PURE__ */ E(ee, {
|
|
990
|
+
size: 16,
|
|
991
|
+
"aria-hidden": !0
|
|
992
|
+
})
|
|
993
|
+
})]
|
|
821
994
|
})]
|
|
822
|
-
}),
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
995
|
+
}),
|
|
996
|
+
je,
|
|
997
|
+
!W && /* @__PURE__ */ E("div", {
|
|
998
|
+
className: k.FlyoutFooter,
|
|
999
|
+
children: /* @__PURE__ */ D("button", {
|
|
1000
|
+
type: "button",
|
|
1001
|
+
onClick: () => ce($),
|
|
1002
|
+
className: k.FlyoutCopyButton,
|
|
1003
|
+
children: [E(M ? t : r, {
|
|
1004
|
+
size: 16,
|
|
1005
|
+
"aria-hidden": !0
|
|
1006
|
+
}), M ? j.copied : v ?? j.copyJson]
|
|
833
1007
|
})
|
|
834
|
-
})]
|
|
835
|
-
}),
|
|
836
|
-
/* @__PURE__ */ T("pre", {
|
|
837
|
-
tabIndex: 0,
|
|
838
|
-
className: A.PayloadCode,
|
|
839
|
-
children: K
|
|
840
|
-
}),
|
|
841
|
-
/* @__PURE__ */ T("div", {
|
|
842
|
-
className: A.FlyoutFooter,
|
|
843
|
-
children: /* @__PURE__ */ E("button", {
|
|
844
|
-
type: "button",
|
|
845
|
-
onClick: () => O(G),
|
|
846
|
-
className: A.FlyoutCopyButton,
|
|
847
|
-
children: [T(w ? t : r, {
|
|
848
|
-
size: 16,
|
|
849
|
-
"aria-hidden": !0
|
|
850
|
-
}), w ? C.copied : _ ?? C.copyJson]
|
|
851
1008
|
})
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1009
|
+
]
|
|
1010
|
+
}), ye),
|
|
1011
|
+
/* @__PURE__ */ E("span", {
|
|
1012
|
+
role: "status",
|
|
1013
|
+
"aria-live": "polite",
|
|
1014
|
+
className: k.VisuallyHidden,
|
|
1015
|
+
children: M ? j.copied : ""
|
|
1016
|
+
})
|
|
1017
|
+
]
|
|
1018
|
+
});
|
|
862
1019
|
}
|
|
863
1020
|
//#endregion
|
|
864
1021
|
//#region src/dev-panel/dev-panel-footer.tsx
|
|
865
|
-
function
|
|
866
|
-
let { copy:
|
|
867
|
-
return /* @__PURE__ */
|
|
868
|
-
className:
|
|
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", {
|
|
1025
|
+
className: k.Footer,
|
|
869
1026
|
children: [
|
|
870
|
-
e && /* @__PURE__ */
|
|
1027
|
+
e && /* @__PURE__ */ E(x, {
|
|
871
1028
|
variant: "outline",
|
|
872
1029
|
color: "secondary",
|
|
873
1030
|
size: "sm",
|
|
874
|
-
startIcon: /* @__PURE__ */
|
|
1031
|
+
startIcon: /* @__PURE__ */ E(l, { "aria-hidden": !0 }),
|
|
875
1032
|
onClick: e,
|
|
876
1033
|
children: t
|
|
877
1034
|
}),
|
|
878
|
-
r && /* @__PURE__ */
|
|
1035
|
+
r && /* @__PURE__ */ E(x, {
|
|
879
1036
|
variant: "outline",
|
|
880
1037
|
color: "secondary",
|
|
881
1038
|
size: "sm",
|
|
882
|
-
startIcon: /* @__PURE__ */
|
|
1039
|
+
startIcon: /* @__PURE__ */ E(d, { "aria-hidden": !0 }),
|
|
883
1040
|
onClick: async () => {
|
|
884
|
-
i != null && await
|
|
1041
|
+
i != null && await u(i), r?.();
|
|
885
1042
|
},
|
|
886
1043
|
children: a
|
|
887
1044
|
}),
|
|
888
|
-
o && /* @__PURE__ */
|
|
1045
|
+
o && /* @__PURE__ */ E(x, {
|
|
889
1046
|
variant: "solid",
|
|
890
1047
|
size: "sm",
|
|
891
|
-
endIcon: /* @__PURE__ */
|
|
1048
|
+
endIcon: /* @__PURE__ */ E(n, { "aria-hidden": !0 }),
|
|
892
1049
|
onClick: o,
|
|
893
1050
|
style: { marginInlineStart: "auto" },
|
|
894
|
-
children:
|
|
1051
|
+
children: s
|
|
895
1052
|
}),
|
|
896
|
-
|
|
1053
|
+
c
|
|
897
1054
|
]
|
|
898
1055
|
});
|
|
899
1056
|
}
|
|
900
1057
|
//#endregion
|
|
901
1058
|
//#region src/dev-panel/parts.ts
|
|
902
|
-
var
|
|
903
|
-
Country: () =>
|
|
904
|
-
Flow: () =>
|
|
905
|
-
Footer: () =>
|
|
906
|
-
Handle: () =>
|
|
907
|
-
Payload: () =>
|
|
908
|
-
Root: () =>
|
|
909
|
-
Section: () =>
|
|
910
|
-
Status: () =>
|
|
911
|
-
StepState: () =>
|
|
912
|
-
Steps: () =>
|
|
913
|
-
Variant: () =>
|
|
914
|
-
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
|
|
915
1072
|
});
|
|
916
1073
|
//#endregion
|
|
917
|
-
export {
|
|
1074
|
+
export { ye as DevPanel };
|
|
918
1075
|
|
|
919
1076
|
//# sourceMappingURL=dev-panel.mjs.map
|