@leabankab/component-library 8.3.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.
@@ -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, 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";
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 D } from "react-dom";
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 D = Object.defineProperty, O = (e, t) => {
9
9
  let n = {};
10
- for (var r in e) O(n, r, {
10
+ for (var r in e) D(n, r, {
11
11
  get: e[r],
12
12
  enumerable: !0
13
13
  });
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({
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
- }), M = (...e) => e.filter(Boolean).join(" "), N = d(void 0);
142
- function P() {
143
- return p(N);
175
+ }), re = (...e) => e.filter(Boolean).join(" "), j = p(void 0);
176
+ function M() {
177
+ return h(j);
144
178
  }
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) {
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 && !L(),
151
- meta: n.includes("meta") || i && L(),
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 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);
161
- }, Y = (e) => {
162
- f === void 0 && H(e), g?.(e);
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
- 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();
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 X = v({
171
- isHidden: U,
172
- setHiddenState: Y
204
+ let U = y({
205
+ isHidden: I,
206
+ setHiddenState: H
173
207
  });
174
- X.current = {
175
- isHidden: U,
176
- setHiddenState: Y
177
- }, m(() => {
178
- if (!_ || b === !1) return;
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 || !R(e, b)) return;
214
+ if (e.repeat || !P(e, v)) return;
181
215
  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);
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
- }, [_, b]);
187
- let Z = h();
188
- return U ? /* @__PURE__ */ T(F.Provider, {
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
- q.current = "panel", Y(!1);
225
+ B.current = "panel", H(!1);
192
226
  },
193
227
  title: e,
194
- handleRef: G
228
+ handleRef: R,
229
+ side: G
195
230
  },
196
- children: S ?? /* @__PURE__ */ T(V, {})
231
+ children: ee ?? /* @__PURE__ */ T(se, {})
197
232
  }) : /* @__PURE__ */ E("div", {
198
- ref: W,
233
+ ref: L,
199
234
  "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,
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: A.HeaderTitle,
243
+ className: k.HeaderTitle,
208
244
  children: [
209
245
  n && /* @__PURE__ */ T("span", {
210
- className: A.HeaderDot,
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: A.Badge,
251
+ className: k.Badge,
216
252
  children: t
217
253
  })
218
254
  ]
219
255
  }), /* @__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,
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
- q.current = "handle", Y(!0);
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(x, {
236
- "aria-label": z ? d ?? k.expand : u ?? k.minimise,
237
- "aria-expanded": !z,
238
- "aria-controls": Z,
239
- onClick: J,
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(z ? o : a, {
279
+ children: T(N ? s : a, {
244
280
  size: 18,
245
281
  "aria-hidden": !0
246
282
  })
247
283
  })]
248
284
  })]
249
- }), !z && /* @__PURE__ */ T("div", {
250
- id: Z,
251
- className: A.Body,
252
- children: w
285
+ }), !N && /* @__PURE__ */ T("div", {
286
+ id: W,
287
+ className: k.Body,
288
+ children: te
253
289
  })]
254
290
  });
255
291
  }
256
- function B({ label: e, meta: t, children: n, className: r, style: i }) {
257
- let a = h();
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: M(A.Section, r),
296
+ className: re(k.Section, r),
261
297
  style: i,
262
298
  children: [/* @__PURE__ */ E("div", {
263
- className: A.SectionHeaderRow,
299
+ className: k.SectionHeaderRow,
264
300
  children: [/* @__PURE__ */ T("span", {
265
301
  id: a,
266
- className: A.SectionLabel,
302
+ className: k.SectionLabel,
267
303
  children: e
268
304
  }), t != null && /* @__PURE__ */ T("span", {
269
- className: A.SectionMeta,
305
+ className: k.SectionMeta,
270
306
  children: t
271
307
  })]
272
- }), /* @__PURE__ */ T(N.Provider, {
308
+ }), /* @__PURE__ */ T(j.Provider, {
273
309
  value: a,
274
310
  children: n
275
311
  })]
276
312
  });
277
313
  }
278
- function V({ side: e = "right", label: t, className: n, style: r }) {
279
- let i = j(), a = p(F);
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: M(A.Handle, n),
321
+ className: re(k.Handle, n),
286
322
  style: r,
287
- "data-side": e,
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: A.HeaderDot,
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 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) => {
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 = f((t, n) => {
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: f((r) => {
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 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({
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 ? A.ChipGroup : A.SegmentedGroup,
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 ? A.Chip : A.SegmentedOption,
410
+ className: l ? k.Chip : k.SegmentedOption,
375
411
  children: [l ? /* @__PURE__ */ T("span", {
376
- className: A.ChipDot,
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 W({ value: e, onChange: t, options: n, label: r = "Country" }) {
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: A.CountryCode,
427
+ className: k.CountryCode,
392
428
  children: e.code
393
429
  })
394
430
  }));
395
- return /* @__PURE__ */ T(B, {
431
+ return /* @__PURE__ */ T(F, {
396
432
  label: r,
397
- children: /* @__PURE__ */ T(U, {
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 G({ value: e, onChange: t, options: n, label: r = "Variant" }) {
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(B, {
448
+ return /* @__PURE__ */ T(F, {
413
449
  label: r,
414
- children: /* @__PURE__ */ T(U, {
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 K({ value: e, onChange: t, options: n, label: r = "Step state", stepLabel: i, variationsLabel: a = "Variations for" }) {
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(B, {
465
+ return /* @__PURE__ */ E(F, {
430
466
  label: r,
431
- children: [i != null && /* @__PURE__ */ E(S, {
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: A.StepStateName,
477
+ className: k.StepStateName,
442
478
  children: i
443
479
  })
444
480
  ]
445
- }), /* @__PURE__ */ T(U, {
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 q = (e, t) => {
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 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, {
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(Y, {
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 Y({ steps: e, currentStep: n, onStepSelect: r, columns: i, t: a }) {
477
- let o = P();
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: A.StepGrid,
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: A.StepButton,
528
+ className: k.StepButton,
493
529
  children: [
494
530
  /* @__PURE__ */ E("span", {
495
- className: A.StepCircle,
531
+ className: k.StepCircle,
496
532
  children: [
497
533
  /* @__PURE__ */ T("span", {
498
- className: A.VisuallyHidden,
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: A.StepFlagDot,
542
+ className: k.StepFlagDot,
507
543
  "aria-hidden": !0
508
544
  })
509
545
  ]
510
546
  }),
511
547
  " ",
512
548
  /* @__PURE__ */ T("span", {
513
- className: A.StepLabel,
549
+ className: k.StepLabel,
514
550
  children: e.label
515
551
  }),
516
552
  /* @__PURE__ */ T("span", {
517
- className: A.VisuallyHidden,
518
- children: `(${q(s, a)}${e.flagged ? `, ${a.needsAttention}` : ""})`
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 X({ value: e, onChange: t, options: n, label: r = "Application status" }) {
528
- return /* @__PURE__ */ T(B, {
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(Z, {
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 Z({ value: e, onChange: t, options: n }) {
538
- let r = P(), { getItemProps: i } = H({
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: A.StatusGrid,
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: A.StatusCard,
592
+ className: k.StatusCard,
557
593
  children: [/* @__PURE__ */ T("span", {
558
- className: A.StatusDot,
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 Q() {
568
- let [e, t] = y(!1), n = v(void 0), r = f(async (e) => {
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 m(() => () => clearTimeout(n.current), []), {
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 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 = [
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(ee).filter((e) => e != null).join(" · "), g = s ?? h;
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: A.Flow,
625
+ className: k.Flow,
590
626
  children: [
591
627
  /* @__PURE__ */ E("div", {
592
- className: A.FlowText,
628
+ className: k.FlowText,
593
629
  children: [/* @__PURE__ */ T("span", {
594
- className: A.FlowLabel,
630
+ className: k.FlowLabel,
595
631
  children: a
596
- }), /* @__PURE__ */ T("span", { children: m.map((e, t) => /* @__PURE__ */ E(u, { children: [t > 0 && /* @__PURE__ */ T("span", {
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: A.FlowSeparator,
634
+ className: k.FlowSeparator,
599
635
  children: "·"
600
636
  }), e] }, t)) })]
601
637
  }),
602
- o && /* @__PURE__ */ T(x, {
603
- "aria-label": c ?? d.copy,
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(f ? t : r, {
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: A.VisuallyHidden,
619
- children: f ? d.copied : ""
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 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) {
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 && re(t[e]);) e += 1;
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 ae(e) {
671
+ function J(e) {
636
672
  let t = [], n = 0;
637
- for (let r of e.matchAll(ne)) {
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: ie(a, e, i + a.length),
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 oe(e) {
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 se({ code: e }) {
665
- let t = _(() => ae(e), [e]);
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: A.Token,
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 ce = {
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
- }, le = (e) => {
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
- }, 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;
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(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({
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
- ue(() => {
705
- if (!L || !P) return;
706
- q();
707
- let e = () => q();
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
- L,
713
- P,
714
- q
769
+ H,
770
+ R,
771
+ Ee
715
772
  ]);
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"));
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(), W(!1);
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) || W(!1);
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
- J,
746
- W
800
+ R,
801
+ be,
802
+ De,
803
+ Q
747
804
  ]);
748
- let Y = /* @__PURE__ */ T(x, {
749
- "aria-label": g ?? C.copy,
750
- onClick: () => O(G),
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: A.OnDark,
755
- style: ce,
756
- children: T(w ? t : r, {
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
- 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
- })]
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
- !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
- })]
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
- 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,
812
- 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
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
- }), /* @__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
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
- }), H),
855
- /* @__PURE__ */ T("span", {
856
- role: "status",
857
- "aria-live": "polite",
858
- className: A.VisuallyHidden,
859
- children: w ? C.copied : ""
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 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();
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: A.Footer,
998
+ className: k.Footer,
869
999
  children: [
870
- e && /* @__PURE__ */ T(b, {
1000
+ e && /* @__PURE__ */ T(x, {
871
1001
  variant: "outline",
872
1002
  color: "secondary",
873
1003
  size: "sm",
874
- startIcon: /* @__PURE__ */ T(s, { "aria-hidden": !0 }),
1004
+ startIcon: /* @__PURE__ */ T(c, { "aria-hidden": !0 }),
875
1005
  onClick: e,
876
1006
  children: t
877
1007
  }),
878
- r && /* @__PURE__ */ T(b, {
1008
+ r && /* @__PURE__ */ T(x, {
879
1009
  variant: "outline",
880
1010
  color: "secondary",
881
1011
  size: "sm",
882
- startIcon: /* @__PURE__ */ T(c, { "aria-hidden": !0 }),
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(b, {
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: l
1024
+ children: s
895
1025
  }),
896
- u
1026
+ l
897
1027
  ]
898
1028
  });
899
1029
  }
900
1030
  //#endregion
901
1031
  //#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
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 { he as DevPanel };
1047
+ export { ye as DevPanel };
918
1048
 
919
1049
  //# sourceMappingURL=dev-panel.mjs.map