@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.
@@ -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, Plus as o, RotateCcw as s, Upload as c, X as l } from "lucide-react";
3
- import { Fragment as u, createContext as d, useCallback as f, useContext as p, useEffect as m, useId as h, useLayoutEffect as g, useMemo as _, useRef as v, useState as y } from "react";
4
- import { Button as b, IconButton as x, Text as S, createTranslation as C } from "./component-library.es.js";
5
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
6
- import { createPortal as D } from "react-dom";
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, k = (e, t) => {
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
- }, A = {
16
- Badge: "_Badge_1xkno_23",
17
- SectionLabel: "_SectionLabel_1xkno_24",
18
- SectionMeta: "_SectionMeta_1xkno_25",
19
- FlowLabel: "_FlowLabel_1xkno_26",
20
- CountryCode: "_CountryCode_1xkno_27",
21
- StepLabel: "_StepLabel_1xkno_28",
22
- PayloadCode: "_PayloadCode_1xkno_29",
23
- DevPanel: "_DevPanel_1xkno_38",
24
- Header: "_Header_1xkno_53",
25
- HeaderTitle: "_HeaderTitle_1xkno_65",
26
- HeaderActions: "_HeaderActions_1xkno_75",
27
- HeaderDot: "_HeaderDot_1xkno_82",
28
- Handle: "_Handle_1xkno_112",
29
- HideButton: "_HideButton_1xkno_191",
30
- Body: "_Body_1xkno_197",
31
- Section: "_Section_1xkno_24",
32
- SectionHeaderRow: "_SectionHeaderRow_1xkno_215",
33
- Flow: "_Flow_1xkno_26",
34
- FlowText: "_FlowText_1xkno_257",
35
- FlowSeparator: "_FlowSeparator_1xkno_282",
36
- SegmentedGroup: "_SegmentedGroup_1xkno_295",
37
- SegmentedOption: "_SegmentedOption_1xkno_316",
38
- ChipGroup: "_ChipGroup_1xkno_368",
39
- Chip: "_Chip_1xkno_368",
40
- ChipDot: "_ChipDot_1xkno_407",
41
- StepGrid: "_StepGrid_1xkno_431",
42
- StepButton: "_StepButton_1xkno_437",
43
- StepCircle: "_StepCircle_1xkno_461",
44
- StepFlagDot: "_StepFlagDot_1xkno_503",
45
- StepStateName: "_StepStateName_1xkno_534",
46
- StatusGrid: "_StatusGrid_1xkno_543",
47
- StatusCard: "_StatusCard_1xkno_550",
48
- StatusDot: "_StatusDot_1xkno_609",
49
- PayloadToggle: "_PayloadToggle_1xkno_621",
50
- PayloadToggleLabel: "_PayloadToggleLabel_1xkno_641",
51
- PayloadChevron: "_PayloadChevron_1xkno_648",
52
- PayloadPanel: "_PayloadPanel_1xkno_672",
53
- PayloadHeader: "_PayloadHeader_1xkno_680",
54
- Token: "_Token_1xkno_715",
55
- Flyout: "_Flyout_1xkno_749",
56
- FlyoutTitle: "_FlyoutTitle_1xkno_763",
57
- FlyoutFooter: "_FlyoutFooter_1xkno_777",
58
- FlyoutCopyButton: "_FlyoutCopyButton_1xkno_784",
59
- Footer: "_Footer_1xkno_824",
60
- OnDark: "_OnDark_1xkno_852",
61
- VisuallyHidden: "_VisuallyHidden_1xkno_863"
62
- }, j = C({
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
- }), M = (...e) => e.filter(Boolean).join(" "), N = d(void 0);
142
- function P() {
143
- return p(N);
182
+ }), ae = (...e) => e.filter(Boolean).join(" "), oe = p(void 0);
183
+ function A() {
184
+ return h(oe);
144
185
  }
145
- var F = d(null), I = "(max-width: 599.95px)", L = () => typeof navigator < "u" && /mac|iphone|ipad/i.test(navigator.platform || navigator.userAgent);
146
- function R(e, t) {
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 && !L(),
151
- meta: n.includes("meta") || i && L(),
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 z({ title: e = "Dev controls", badge: t, showStatusDot: n = !0, minimisable: r = !0, minimised: s, defaultMinimised: c, onMinimisedChange: l, minimiseLabel: u, expandLabel: d, hidden: f, defaultHidden: p, onHiddenChange: g, hideable: _ = f !== void 0 || p !== void 0, shortcut: b = "Mod+Shift+D", handle: S, hideLabel: C, children: w, className: D, style: O }) {
158
- let k = j(), N = s !== void 0, [P, L] = y(c ?? !1), z = N ? s : P, [B, H] = y(p ?? !1), U = _ && (f ?? B), W = v(null), G = v(null), K = v(null), q = v(null), J = () => {
159
- let e = !z;
160
- N || L(e), l?.(e);
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 && H(e), g?.(e);
206
+ f === void 0 && de(e), m?.(e);
163
207
  };
164
- m(() => {
165
- _ && !N && c === void 0 && typeof window < "u" && window.matchMedia?.(I).matches && L(!0);
166
- }, []), m(() => {
167
- let e = q.current;
168
- q.current = null, e === "handle" && G.current?.focus(), e === "panel" && K.current?.focus();
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 X = v({
171
- isHidden: U,
214
+ let fe = y({
215
+ isHidden: R,
172
216
  setHiddenState: Y
173
217
  });
174
- X.current = {
175
- isHidden: U,
218
+ fe.current = {
219
+ isHidden: R,
176
220
  setHiddenState: Y
177
- }, m(() => {
178
- if (!_ || b === !1) return;
221
+ }, g(() => {
222
+ if (!h || v === !1) return;
179
223
  let e = (e) => {
180
- if (e.repeat || !R(e, b)) return;
224
+ if (e.repeat || !ce(e, v)) return;
181
225
  e.preventDefault();
182
- let { isHidden: t, setHiddenState: n } = X.current, r = document.activeElement;
183
- !t && W.current?.contains(r) && (q.current = "handle"), t && r != null && r === G.current && (q.current = "panel"), n(!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
- }, [_, b]);
187
- let Z = h();
188
- return U ? /* @__PURE__ */ T(F.Provider, {
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
- q.current = "panel", Y(!1);
235
+ K.current = "panel", Y(!1);
192
236
  },
193
237
  title: e,
194
- handleRef: G
238
+ handleRef: W,
239
+ side: X
195
240
  },
196
- children: S ?? /* @__PURE__ */ T(V, {})
197
- }) : /* @__PURE__ */ E("div", {
198
- ref: W,
241
+ children: te ?? /* @__PURE__ */ E(le, {})
242
+ }) : /* @__PURE__ */ D("div", {
243
+ ref: U,
199
244
  "data-dev-panel-root": "",
200
- "data-hideable": _ ? "" : void 0,
201
- "data-minimised": z ? "" : void 0,
202
- className: M(A.DevPanel, D),
203
- style: O,
204
- children: [/* @__PURE__ */ E("header", {
205
- className: A.Header,
206
- children: [/* @__PURE__ */ E("span", {
207
- className: A.HeaderTitle,
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__ */ T("span", {
210
- className: A.HeaderDot,
256
+ n && /* @__PURE__ */ E("span", {
257
+ className: k.HeaderDot,
211
258
  "aria-hidden": !0
212
259
  }),
213
- /* @__PURE__ */ T("span", { children: e }),
214
- t != null && /* @__PURE__ */ T("span", {
215
- className: A.Badge,
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__ */ E("span", {
220
- className: A.HeaderActions,
221
- children: [_ && /* @__PURE__ */ T(x, {
222
- ref: K,
223
- className: A.HideButton,
224
- "aria-label": C ?? k.hide,
225
- onClick: () => {
226
- q.current = "handle", Y(!0);
227
- },
228
- variant: "outline",
229
- color: "secondary",
230
- size: "sm",
231
- children: /* @__PURE__ */ T(i, {
232
- size: 18,
233
- "aria-hidden": !0
234
- })
235
- }), r && /* @__PURE__ */ T(x, {
236
- "aria-label": z ? d ?? k.expand : u ?? k.minimise,
237
- "aria-expanded": !z,
238
- "aria-controls": Z,
239
- onClick: J,
240
- variant: "outline",
241
- color: "secondary",
242
- size: "sm",
243
- children: T(z ? o : a, {
244
- size: 18,
245
- "aria-hidden": !0
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
- }), !z && /* @__PURE__ */ T("div", {
250
- id: Z,
251
- className: A.Body,
252
- children: w
312
+ }), !I && /* @__PURE__ */ E("div", {
313
+ id: pe,
314
+ className: k.Body,
315
+ children: oe
253
316
  })]
254
317
  });
255
318
  }
256
- function B({ label: e, meta: t, children: n, className: r, style: i }) {
257
- let a = h();
258
- return /* @__PURE__ */ E("section", {
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: M(A.Section, r),
323
+ className: ae(k.Section, r),
261
324
  style: i,
262
- children: [/* @__PURE__ */ E("div", {
263
- className: A.SectionHeaderRow,
264
- children: [/* @__PURE__ */ T("span", {
325
+ children: [/* @__PURE__ */ D("div", {
326
+ className: k.SectionHeaderRow,
327
+ children: [/* @__PURE__ */ E("span", {
265
328
  id: a,
266
- className: A.SectionLabel,
329
+ className: k.SectionLabel,
267
330
  children: e
268
- }), t != null && /* @__PURE__ */ T("span", {
269
- className: A.SectionMeta,
331
+ }), t != null && /* @__PURE__ */ E("span", {
332
+ className: k.SectionMeta,
270
333
  children: t
271
334
  })]
272
- }), /* @__PURE__ */ T(N.Provider, {
335
+ }), /* @__PURE__ */ E(oe.Provider, {
273
336
  value: a,
274
337
  children: n
275
338
  })]
276
339
  });
277
340
  }
278
- function V({ side: e = "right", label: t, className: n, style: r }) {
279
- let i = j(), a = p(F);
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__ */ E("button", {
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: M(A.Handle, n),
348
+ className: ae(k.Handle, n),
286
349
  style: r,
287
- "data-side": e,
350
+ "data-side": s,
288
351
  "aria-label": typeof o == "string" ? `${i.show} ${o}` : void 0,
289
352
  onClick: a.show,
290
- children: [/* @__PURE__ */ T("span", {
291
- className: A.HeaderDot,
353
+ children: [/* @__PURE__ */ E("span", {
354
+ className: k.HeaderDot,
292
355
  "aria-hidden": !0
293
- }), /* @__PURE__ */ T("span", { children: o })]
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 H({ values: e, selected: t, onSelect: n, isDisabled: r }) {
299
- let i = v([]), a = f((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 = f((t) => {
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 = f((t, n) => {
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: f((r) => {
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 U({ value: e, onChange: t, options: n, variant: r = "pill", "aria-label": i, "aria-labelledby": a }) {
356
- let o = P(), s = a ?? (i ? void 0 : o), { getItemProps: c } = H({
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__ */ T("div", {
425
+ return /* @__PURE__ */ E("div", {
363
426
  role: "radiogroup",
364
427
  "aria-label": i,
365
428
  "aria-labelledby": s,
366
- className: l ? A.ChipGroup : A.SegmentedGroup,
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__ */ E("button", {
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 ? A.Chip : A.SegmentedOption,
375
- children: [l ? /* @__PURE__ */ T("span", {
376
- className: A.ChipDot,
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__ */ T("span", { children: e.label })]
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 W({ value: e, onChange: t, options: n, label: r = "Country" }) {
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__ */ T("span", {
391
- className: A.CountryCode,
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__ */ T(B, {
458
+ return /* @__PURE__ */ E(P, {
396
459
  label: r,
397
- children: /* @__PURE__ */ T(U, {
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 G({ value: e, onChange: t, options: n, label: r = "Variant" }) {
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__ */ T(B, {
475
+ return /* @__PURE__ */ E(P, {
413
476
  label: r,
414
- children: /* @__PURE__ */ T(U, {
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 K({ value: e, onChange: t, options: n, label: r = "Step state", stepLabel: i, variationsLabel: a = "Variations for" }) {
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__ */ E(B, {
492
+ return /* @__PURE__ */ D(P, {
430
493
  label: r,
431
- children: [i != null && /* @__PURE__ */ E(S, {
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__ */ T("span", {
441
- className: A.StepStateName,
503
+ /* @__PURE__ */ E("span", {
504
+ className: k.StepStateName,
442
505
  children: i
443
506
  })
444
507
  ]
445
- }), /* @__PURE__ */ T(U, {
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 q = (e, t) => {
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 J({ steps: e, currentStep: t, onStepSelect: n, label: r = "Jump to step", showCount: i = !0, columns: a = 4 }) {
463
- let o = j(), s = e.length, c = i && t != null ? `${t} / ${s}` : void 0;
464
- return /* @__PURE__ */ T(B, {
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__ */ T(Y, {
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 Y({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
477
- let o = P();
478
- return /* @__PURE__ */ T("div", {
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: A.StepGrid,
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__ */ E("button", {
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: A.StepButton,
555
+ className: k.StepButton,
493
556
  children: [
494
- /* @__PURE__ */ E("span", {
495
- className: A.StepCircle,
557
+ /* @__PURE__ */ D("span", {
558
+ className: k.StepCircle,
496
559
  children: [
497
- /* @__PURE__ */ T("span", {
498
- className: A.VisuallyHidden,
560
+ /* @__PURE__ */ E("span", {
561
+ className: k.VisuallyHidden,
499
562
  children: l ? `${a.step} ${o}` : `${a.step} `
500
563
  }),
501
- l ? /* @__PURE__ */ T(t, {
564
+ l ? /* @__PURE__ */ E(t, {
502
565
  size: 18,
503
566
  "aria-hidden": !0
504
567
  }) : o,
505
- e.flagged && /* @__PURE__ */ T("span", {
506
- className: A.StepFlagDot,
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__ */ T("span", {
513
- className: A.StepLabel,
575
+ /* @__PURE__ */ E("span", {
576
+ className: k.StepLabel,
514
577
  children: e.label
515
578
  }),
516
- /* @__PURE__ */ T("span", {
517
- className: A.VisuallyHidden,
518
- children: `(${q(s, a)}${e.flagged ? `, ${a.needsAttention}` : ""})`
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 X({ value: e, onChange: t, options: n, label: r = "Application status" }) {
528
- return /* @__PURE__ */ T(B, {
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__ */ T(Z, {
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 Z({ value: e, onChange: t, options: n }) {
538
- let r = P(), { getItemProps: i } = H({
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__ */ T("div", {
607
+ return /* @__PURE__ */ E("div", {
545
608
  role: "radiogroup",
546
609
  "aria-labelledby": r,
547
- className: A.StatusGrid,
610
+ className: k.StatusGrid,
548
611
  children: n.map((e, t) => {
549
612
  let { onKeyDown: n, ...r } = i(t);
550
- return /* @__PURE__ */ E("button", {
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: A.StatusCard,
557
- children: [/* @__PURE__ */ T("span", {
558
- className: A.StatusDot,
619
+ className: k.StatusCard,
620
+ children: [/* @__PURE__ */ E("span", {
621
+ className: k.StatusDot,
559
622
  "aria-hidden": !0
560
- }), /* @__PURE__ */ T("span", { children: e.label })]
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 Q() {
568
- let [e, t] = y(!1), n = v(void 0), r = f(async (e) => {
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 m(() => () => clearTimeout(n.current), []), {
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 ee = (e) => typeof e == "string" || typeof e == "number" ? String(e) : null;
582
- function te({ flowId: e, process: n, variant: i, label: a = "Flow", showCopy: o = !0, copyValue: s, copyLabel: c, onCopy: l }) {
583
- let d = j(), { copied: f, copy: p } = Q(), m = [
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), h = m.map(ee).filter((e) => e != null).join(" · "), g = s ?? h;
588
- return /* @__PURE__ */ E("div", {
589
- className: A.Flow,
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__ */ E("div", {
592
- className: A.FlowText,
593
- children: [/* @__PURE__ */ T("span", {
594
- className: A.FlowLabel,
654
+ /* @__PURE__ */ D("div", {
655
+ className: k.FlowText,
656
+ children: [/* @__PURE__ */ E("span", {
657
+ className: k.FlowLabel,
595
658
  children: a
596
- }), /* @__PURE__ */ T("span", { children: m.map((e, t) => /* @__PURE__ */ E(u, { children: [t > 0 && /* @__PURE__ */ T("span", {
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: A.FlowSeparator,
661
+ className: k.FlowSeparator,
599
662
  children: "·"
600
663
  }), e] }, t)) })]
601
664
  }),
602
- o && /* @__PURE__ */ T(x, {
603
- "aria-label": c ?? d.copy,
665
+ o && /* @__PURE__ */ E(S, {
666
+ "aria-label": c ?? u.copy,
604
667
  onClick: async () => {
605
- await p(g), l?.();
668
+ await ee(h), l?.();
606
669
  },
607
670
  variant: "outline",
608
671
  color: "secondary",
609
672
  size: "sm",
610
- children: T(f ? t : r, {
673
+ children: E(d ? t : r, {
611
674
  size: 16,
612
675
  "aria-hidden": !0
613
676
  })
614
677
  }),
615
- /* @__PURE__ */ T("span", {
678
+ /* @__PURE__ */ E("span", {
616
679
  role: "status",
617
680
  "aria-live": "polite",
618
- className: A.VisuallyHidden,
619
- children: f ? d.copied : ""
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 ne = /"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\b(?:true|false|null)\b/g, re = (e) => e === " " || e === " " || e === "\n" || e === "\r";
627
- function ie(e, t, n) {
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 && re(t[e]);) e += 1;
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 ae(e) {
698
+ function Y(e) {
636
699
  let t = [], n = 0;
637
- for (let r of e.matchAll(ne)) {
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: ie(a, e, i + a.length),
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 oe(e) {
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 se({ code: e }) {
665
- let t = _(() => ae(e), [e]);
666
- return /* @__PURE__ */ T(w, { children: t.map((e, t) => /* @__PURE__ */ T("span", {
667
- className: A.Token,
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 ce = {
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
- }, le = (e) => {
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
- }, ue = typeof window < "u" ? g : m, $ = 12, de = 420, fe = 280;
686
- function pe({ value: i, label: a = "Payload preview", title: o, placement: s = "inline", badge: c, open: u, defaultOpen: d = !1, onOpenChange: p, copyLabel: g, copyJsonLabel: _, closeLabel: b, highlight: S = !0 }) {
687
- let C = j(), { copied: w, copy: O } = Q(), k = u !== void 0, [M, N] = y(d), P = k ? u : M, F = h(), I = h(), L = s === "side", R = v(null), z = v(null), [B, V] = y(null), [H, U] = y(null);
688
- m(() => U(document.body), []);
689
- let W = f((e) => {
690
- k || N(e), p?.(e);
691
- }, [k, p]), G = le(i), K = S && oe(i) ? /* @__PURE__ */ T(se, { code: G }) : G, q = f(() => {
692
- let e = R.current?.closest("[data-dev-panel-root]") ?? R.current;
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(de, Math.max(fe, t.width)), r = t.left - n - $;
695
- r < $ && (r = Math.min(t.right + $, window.innerWidth - n - $));
696
- let i = Math.min(t.height, window.innerHeight - 24), a = Math.min(Math.max($, t.top), window.innerHeight - $ - i);
697
- V({
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
- ue(() => {
705
- if (!L || !P) return;
706
- q();
707
- let e = () => q();
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
- L,
713
- P,
714
- q
796
+ R,
797
+ F,
798
+ Ee
715
799
  ]);
716
- let J = B !== null;
717
- m(() => {
718
- if (!L || !P || !H || !J) return;
719
- let e = z.current, t = R.current, n = () => Array.from(e?.querySelectorAll("button, [href], input, textarea, select, [tabindex]:not([tabindex=\"-1\"])") ?? []).filter((e) => !e.hasAttribute("disabled"));
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(), W(!1);
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) || W(!1);
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
- L,
743
- P,
744
- H,
745
- J,
746
- W
826
+ R,
827
+ F,
828
+ ye,
829
+ De,
830
+ xe
747
831
  ]);
748
- let Y = /* @__PURE__ */ T(x, {
749
- "aria-label": g ?? C.copy,
750
- onClick: () => O(G),
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: A.OnDark,
755
- style: ce,
756
- children: T(w ? t : r, {
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
- return /* @__PURE__ */ E("div", { children: [
762
- /* @__PURE__ */ E("button", {
763
- ref: R,
764
- type: "button",
765
- "aria-expanded": P,
766
- "aria-controls": F,
767
- "data-placement": s,
768
- onClick: () => W(!P),
769
- className: A.PayloadToggle,
770
- children: [/* @__PURE__ */ E("span", {
771
- className: A.PayloadToggleLabel,
772
- children: [/* @__PURE__ */ T(e, {
773
- size: 16,
774
- "aria-hidden": !0
775
- }), a]
776
- }), /* @__PURE__ */ T("span", {
777
- className: A.PayloadChevron,
778
- children: /* @__PURE__ */ T(n, {
779
- size: 16,
780
- "aria-hidden": !0
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
- !L && P && /* @__PURE__ */ E("div", {
785
- id: F,
786
- className: A.PayloadPanel,
787
- children: [/* @__PURE__ */ E("div", {
788
- className: A.PayloadHeader,
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
- L && P && H && D(/* @__PURE__ */ E("div", {
797
- ref: z,
798
- id: F,
799
- role: "dialog",
800
- "aria-labelledby": I,
801
- tabIndex: -1,
802
- className: A.Flyout,
803
- style: B ? {
804
- top: B.top,
805
- left: B.left,
806
- width: B.width,
807
- height: B.height
808
- } : { visibility: "hidden" },
809
- children: [
810
- /* @__PURE__ */ E("div", {
811
- className: A.PayloadHeader,
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
- className: A.FlyoutTitle,
814
- children: [/* @__PURE__ */ T("span", {
815
- id: I,
816
- children: o ?? a
817
- }), c != null && /* @__PURE__ */ T("span", {
818
- className: A.Badge,
819
- "data-on-dark": "",
820
- children: c
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
- }), /* @__PURE__ */ T(x, {
823
- "aria-label": b ?? C.close,
824
- onClick: () => W(!1),
825
- variant: "outline",
826
- color: "secondary",
827
- size: "sm",
828
- className: A.OnDark,
829
- style: ce,
830
- children: /* @__PURE__ */ T(l, {
831
- size: 16,
832
- "aria-hidden": !0
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
- }), H),
855
- /* @__PURE__ */ T("span", {
856
- role: "status",
857
- "aria-live": "polite",
858
- className: A.VisuallyHidden,
859
- children: w ? C.copied : ""
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 me({ onReseed: e, reseedLabel: t = "Reseed", onCopyUrl: r, url: i, copyUrlLabel: a = "Copy URL", onConsole: o, consoleLabel: l = "Console", children: u }) {
866
- let { copy: d } = Q();
867
- return /* @__PURE__ */ E("div", {
868
- className: A.Footer,
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__ */ T(b, {
1027
+ e && /* @__PURE__ */ E(x, {
871
1028
  variant: "outline",
872
1029
  color: "secondary",
873
1030
  size: "sm",
874
- startIcon: /* @__PURE__ */ T(s, { "aria-hidden": !0 }),
1031
+ startIcon: /* @__PURE__ */ E(l, { "aria-hidden": !0 }),
875
1032
  onClick: e,
876
1033
  children: t
877
1034
  }),
878
- r && /* @__PURE__ */ T(b, {
1035
+ r && /* @__PURE__ */ E(x, {
879
1036
  variant: "outline",
880
1037
  color: "secondary",
881
1038
  size: "sm",
882
- startIcon: /* @__PURE__ */ T(c, { "aria-hidden": !0 }),
1039
+ startIcon: /* @__PURE__ */ E(d, { "aria-hidden": !0 }),
883
1040
  onClick: async () => {
884
- i != null && await d(i), r?.();
1041
+ i != null && await u(i), r?.();
885
1042
  },
886
1043
  children: a
887
1044
  }),
888
- o && /* @__PURE__ */ T(b, {
1045
+ o && /* @__PURE__ */ E(x, {
889
1046
  variant: "solid",
890
1047
  size: "sm",
891
- endIcon: /* @__PURE__ */ T(n, { "aria-hidden": !0 }),
1048
+ endIcon: /* @__PURE__ */ E(n, { "aria-hidden": !0 }),
892
1049
  onClick: o,
893
1050
  style: { marginInlineStart: "auto" },
894
- children: l
1051
+ children: s
895
1052
  }),
896
- u
1053
+ c
897
1054
  ]
898
1055
  });
899
1056
  }
900
1057
  //#endregion
901
1058
  //#region src/dev-panel/parts.ts
902
- var he = /* @__PURE__ */ k({
903
- Country: () => W,
904
- Flow: () => te,
905
- Footer: () => me,
906
- Handle: () => V,
907
- Payload: () => pe,
908
- Root: () => z,
909
- Section: () => B,
910
- Status: () => X,
911
- StepState: () => K,
912
- Steps: () => J,
913
- Variant: () => G,
914
- useSectionLabelId: () => P
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 { he as DevPanel };
1074
+ export { ye as DevPanel };
918
1075
 
919
1076
  //# sourceMappingURL=dev-panel.mjs.map