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