@brucesantos/design-space 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,190 +1,209 @@
1
- import { jsxs as c, jsx as a, Fragment as M } from "react/jsx-runtime";
2
- import { useState as x, useEffect as E, useMemo as y, useCallback as C, useContext as ae, createContext as ne, forwardRef as re, useRef as se } from "react";
3
- import { v as oe, P as f, N as Y, s as ie, c as de, g as ce } from "./contrast-BXd_acxo.js";
4
- import { C as lt, S as ut, a as ht, b as mt, d as pt, e as bt, f as ft, h as vt, i as gt, j as wt, p as Nt, r as kt, k as _t, l as yt, m as St } from "./contrast-BXd_acxo.js";
5
- function le(e) {
6
- const t = new Map(e.scenarios.map((u) => [u.id, u])), n = new Map(e.personas.map((u) => [u.id, u])), s = new Map(e.fixtures.map((u) => [u.id, u])), r = new Map((e.rules ?? []).map((u) => [u.id, u])), o = new Map(e.modules.map((u) => [u.id, u])), d = new Map(
7
- e.modules.flatMap((u) => (u.flows ?? []).map((h) => [h.id, h]))
8
- ), l = e.modules.map((u) => ({
9
- module: u,
10
- scenarios: e.scenarios.filter((h) => h.id.split(".")[0] === u.id)
11
- })), m = new Set(l.flatMap((u) => u.scenarios.map((h) => h.id))), i = e.scenarios.filter((u) => !m.has(u.id)), p = (u) => u ? t.get(u) : void 0, g = (u) => u ? n.get(u) : void 0, v = (u) => u ? u.permissions ? u.permissions : g(u.persona)?.permissions ?? [] : [];
1
+ import { jsxs as d, jsx as o, Fragment as A } from "react/jsx-runtime";
2
+ import { useState as T, useEffect as F, useMemo as x, useCallback as D, useContext as ae, createContext as re, useRef as G, forwardRef as se } from "react";
3
+ import { S as ie, v as ce, P as b, N as ee, s as de, c as le, g as ue } from "./contrast-87-ijttm.js";
4
+ import { C as xt, a as Mt, b as _t, d as Ct, e as Tt, f as Lt, h as At, i as Et, j as $t, p as Pt, r as Rt, k as Dt, l as Ft, m as It } from "./contrast-87-ijttm.js";
5
+ function he(e) {
6
+ const t = new Map(e.scenarios.map((l) => [l.id, l])), n = new Map(
7
+ (e.components ?? []).map((l) => [l.id, l])
8
+ ), s = new Map(e.personas.map((l) => [l.id, l])), i = new Map(e.fixtures.map((l) => [l.id, l])), a = new Map((e.rules ?? []).map((l) => [l.id, l])), r = new Map(e.modules.map((l) => [l.id, l])), c = new Map(
9
+ e.modules.flatMap((l) => (l.flows ?? []).map((g) => [g.id, g]))
10
+ ), p = e.modules.map((l) => ({
11
+ module: l,
12
+ scenarios: e.scenarios.filter((g) => g.id.split(".")[0] === l.id)
13
+ })), h = new Set(p.flatMap((l) => l.scenarios.map((g) => g.id))), u = e.scenarios.filter((l) => !h.has(l.id)), m = (l) => l ? t.get(l) : void 0, N = (l) => l ? s.get(l) : void 0, y = (l) => l ? l.permissions ? l.permissions : N(l.persona)?.permissions ?? [] : [];
12
14
  return {
13
15
  product: e,
14
- tree: l,
15
- orphans: i,
16
- issues: oe(e),
17
- scenario: p,
18
- persona: g,
19
- fixture: (u) => u ? s.get(u) : void 0,
20
- rule: (u) => u ? r.get(u) : void 0,
21
- module: (u) => u ? o.get(u) : void 0,
22
- flow: (u) => u ? d.get(u) : void 0,
23
- rulesOf: (u) => (u?.rules ?? []).map((h) => r.get(h)).filter((h) => !!h),
24
- permissionsOf: v,
25
- scenariosForRoute: (u) => {
26
- const h = u.split("?")[0];
27
- return e.scenarios.filter((b) => b.route.split("?")[0] === h);
16
+ tree: p,
17
+ orphans: u,
18
+ issues: ce(e),
19
+ scenario: m,
20
+ component: (l) => l ? n.get(l) : void 0,
21
+ persona: N,
22
+ fixture: (l) => l ? i.get(l) : void 0,
23
+ rule: (l) => l ? a.get(l) : void 0,
24
+ module: (l) => l ? r.get(l) : void 0,
25
+ flow: (l) => l ? c.get(l) : void 0,
26
+ rulesOf: (l) => (l?.rules ?? []).map((g) => a.get(g)).filter((g) => !!g),
27
+ permissionsOf: y,
28
+ scenariosForRoute: (l) => {
29
+ const g = l.split("?")[0];
30
+ return e.scenarios.filter((w) => w.route.split("?")[0] === g);
28
31
  },
29
- search: (u) => {
30
- const h = z(u);
31
- return h ? e.scenarios.filter((b) => {
32
- const w = o.get(b.id.split(".")[0] ?? "")?.name ?? "";
33
- return z(
32
+ search: (l) => {
33
+ const g = Y(l);
34
+ return g ? e.scenarios.filter((w) => {
35
+ const L = r.get(w.id.split(".")[0] ?? "")?.name ?? "";
36
+ return Y(
34
37
  [
35
- b.title,
36
- b.id,
37
- b.intent ?? "",
38
- b.route,
39
- w,
40
- n.get(b.persona)?.name ?? "",
41
- (b.tags ?? []).join(" "),
42
- (b.expected ?? []).join(" ")
38
+ w.title,
39
+ w.id,
40
+ w.intent ?? "",
41
+ w.route,
42
+ L,
43
+ s.get(w.persona)?.name ?? "",
44
+ (w.tags ?? []).join(" "),
45
+ (w.expected ?? []).join(" ")
43
46
  ].join(" ")
44
- ).includes(h);
47
+ ).includes(g);
45
48
  }) : e.scenarios;
46
49
  },
47
- byStatus: (u) => e.scenarios.filter((h) => h.status === u),
50
+ byStatus: (l) => e.scenarios.filter((g) => g.status === l),
48
51
  coverage: () => {
49
- const u = {
50
- proposed: 0,
51
- "in-review": 0,
52
- approved: 0,
53
- "in-implementation": 0,
54
- implemented: 0,
55
- superseded: 0
56
- };
57
- for (const h of e.scenarios) u[h.status] += 1;
58
- return u;
52
+ const l = Object.fromEntries(
53
+ ie.map((g) => [g, 0])
54
+ );
55
+ for (const g of e.scenarios) l[g.status] += 1;
56
+ return l;
59
57
  }
60
58
  };
61
59
  }
62
- function z(e) {
60
+ function Y(e) {
63
61
  return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
64
62
  }
65
- const G = [
63
+ const te = [
66
64
  { id: "fit", label: "Ajustar" },
67
65
  { id: "mobile", label: "Celular", width: 390, height: 844 },
68
66
  { id: "tablet", label: "Tablet", width: 834, height: 1112 },
69
67
  { id: "desktop", label: "Desktop", width: 1440, height: 900 },
70
68
  { id: "custom", label: "Personalizado" }
71
- ], Q = [1, 1.25, 1.5, 2];
72
- function ue(e, t) {
73
- const n = new URLSearchParams(e), s = n.get(f.scenario) ?? void 0, r = t.scenario(s), o = n.get(f.network), d = Number(n.get(f.textScale));
69
+ ], pe = [1, 1.25, 1.5, 2];
70
+ function me(e, t) {
71
+ const n = new URLSearchParams(e), s = n.get(b.component) ?? void 0, i = t.component(s), a = n.get(b.scenario) ?? void 0, r = i ? void 0 : t.scenario(a), c = n.get(b.network), p = Number(n.get(b.textScale));
74
72
  return {
75
73
  scenario: r?.id,
76
- persona: n.get(f.persona) ?? r?.persona,
77
- fixture: n.get(f.fixture) ?? r?.fixture,
78
- network: pe(o) ? o : r?.network ?? "success",
79
- viewport: n.get(f.viewport) ?? "fit",
80
- customWidth: be(n.get(f.customWidth)),
81
- themeMode: n.get(f.themeMode) ?? t.product.theme?.modes?.[0],
82
- locale: n.get(f.locale) ?? t.product.theme?.locales?.[0],
83
- dataSource: n.get(f.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
74
+ component: i?.id,
75
+ persona: n.get(b.persona) ?? r?.persona,
76
+ fixture: n.get(b.fixture) ?? r?.fixture,
77
+ network: ge(c) ? c : r?.network ?? "success",
78
+ viewport: n.get(b.viewport) ?? "fit",
79
+ customWidth: we(n.get(b.customWidth)),
80
+ themeMode: n.get(b.themeMode) ?? t.product.theme?.modes?.[0],
81
+ locale: n.get(b.locale) ?? t.product.theme?.locales?.[0],
82
+ dataSource: n.get(b.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
83
+ chromeTheme: ve(n.get(b.chromeTheme)) ? n.get(b.chromeTheme) : "dark",
84
84
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
85
85
  // de tela, então precisa ser explícito para não sumir sem pedido.
86
- chrome: n.get(f.chrome) !== "0",
87
- keyboardMode: n.get(f.keyboardMode) === "1",
88
- reducedMotion: n.get(f.reducedMotion) === "1",
89
- textScale: Q.includes(d) ? d : 1,
90
- inspector: n.get(f.inspector) !== "0"
86
+ chrome: n.get(b.chrome) !== "0",
87
+ keyboardMode: n.get(b.keyboardMode) === "1",
88
+ reducedMotion: n.get(b.reducedMotion) === "1",
89
+ textScale: pe.includes(p) ? p : 1,
90
+ inspector: n.get(b.inspector) !== "0"
91
91
  };
92
92
  }
93
- function U(e, t) {
93
+ function z(e, t) {
94
94
  const n = new URLSearchParams(), s = t.scenario(e.scenario);
95
- e.scenario && n.set(f.scenario, e.scenario), e.persona && e.persona !== s?.persona && n.set(f.persona, e.persona), e.fixture && e.fixture !== s?.fixture && n.set(f.fixture, e.fixture), e.network !== (s?.network ?? "success") && n.set(f.network, e.network), e.viewport !== "fit" && n.set(f.viewport, e.viewport), e.viewport === "custom" && e.customWidth && n.set(f.customWidth, String(e.customWidth));
96
- const r = t.product.theme?.modes?.[0];
97
- e.themeMode && e.themeMode !== r && n.set(f.themeMode, e.themeMode);
98
- const o = t.product.theme?.locales?.[0];
99
- e.locale && e.locale !== o && n.set(f.locale, e.locale);
100
- const d = t.product.dataSources?.default ?? "fixtures";
101
- e.dataSource && e.dataSource !== d && n.set(f.dataSource, e.dataSource), e.chrome || n.set(f.chrome, "0"), e.keyboardMode && n.set(f.keyboardMode, "1"), e.reducedMotion && n.set(f.reducedMotion, "1"), e.textScale !== 1 && n.set(f.textScale, String(e.textScale)), e.inspector || n.set(f.inspector, "0");
102
- const l = n.toString();
103
- return l ? `?${l}` : "";
95
+ e.component ? n.set(b.component, e.component) : e.scenario && n.set(b.scenario, e.scenario), e.persona && e.persona !== s?.persona && n.set(b.persona, e.persona), e.fixture && e.fixture !== s?.fixture && n.set(b.fixture, e.fixture), e.network !== (s?.network ?? "success") && n.set(b.network, e.network), e.viewport !== "fit" && n.set(b.viewport, e.viewport), e.viewport === "custom" && e.customWidth && n.set(b.customWidth, String(e.customWidth));
96
+ const i = t.product.theme?.modes?.[0];
97
+ e.themeMode && e.themeMode !== i && n.set(b.themeMode, e.themeMode);
98
+ const a = t.product.theme?.locales?.[0];
99
+ e.locale && e.locale !== a && n.set(b.locale, e.locale);
100
+ const r = t.product.dataSources?.default ?? "fixtures";
101
+ e.dataSource && e.dataSource !== r && n.set(b.dataSource, e.dataSource), e.chromeTheme === "light" && n.set(b.chromeTheme, "light"), e.chrome || n.set(b.chrome, "0"), e.keyboardMode && n.set(b.keyboardMode, "1"), e.reducedMotion && n.set(b.reducedMotion, "1"), e.textScale !== 1 && n.set(b.textScale, String(e.textScale)), e.inspector || n.set(b.inspector, "0");
102
+ const c = n.toString();
103
+ return c ? `?${c}` : "";
104
104
  }
105
- function he(e) {
106
- const [t, n] = x(() => K());
107
- E(() => {
108
- const i = () => n(K());
109
- return window.addEventListener("popstate", i), () => window.removeEventListener("popstate", i);
105
+ function fe(e) {
106
+ const [t, n] = T(() => J());
107
+ F(() => {
108
+ const u = () => n(J());
109
+ return window.addEventListener("popstate", u), () => window.removeEventListener("popstate", u);
110
110
  }, []);
111
- const s = y(() => ue(t.search, e), [t.search, e]), r = C((i, p, g = !1) => {
112
- const v = `${i}${p}`;
113
- g ? window.history.replaceState(null, "", v) : window.history.pushState(null, "", v), n({ path: i, search: p });
114
- }, []), o = C(
115
- (i) => {
116
- const p = { ...s, ...i };
117
- r(t.path, U(p, e), !0);
111
+ const s = x(() => me(t.search, e), [t.search, e]), i = D((u, m, N = !1) => {
112
+ const y = `${u}${m}`;
113
+ N ? window.history.replaceState(null, "", y) : window.history.pushState(null, "", y), n({ path: u, search: m });
114
+ }, []), a = D(
115
+ (u) => {
116
+ const m = { ...s, ...u };
117
+ i(t.path, z(m, e), !0);
118
118
  },
119
- [s, t.path, r, e]
120
- ), d = C(
121
- (i, p) => {
122
- const [g, v] = i.split("?"), u = g || "/", h = v ? `?${v}` : t.search;
123
- r(u, h, p?.replace ?? !1);
119
+ [s, t.path, i, e]
120
+ ), r = D(
121
+ (u, m) => {
122
+ const [N, y] = u.split("?"), l = N || "/", g = y ? `?${y}` : t.search;
123
+ i(l, g, m?.replace ?? !1);
124
+ },
125
+ [t.search, i]
126
+ ), c = D(
127
+ (u) => {
128
+ const m = e.scenario(u);
129
+ if (!m) return;
130
+ const N = {
131
+ ...s,
132
+ scenario: m.id,
133
+ component: void 0,
134
+ persona: m.persona,
135
+ fixture: m.fixture,
136
+ network: m.network ?? "success"
137
+ };
138
+ i(m.route, z(N, e), !1);
124
139
  },
125
- [t.search, r]
126
- ), l = C(
127
- (i) => {
128
- const p = e.scenario(i);
129
- if (!p) return;
130
- const g = {
140
+ [s, i, e]
141
+ ), p = D(
142
+ (u) => {
143
+ const m = e.component(u);
144
+ if (!m) return;
145
+ const N = {
131
146
  ...s,
132
- scenario: p.id,
133
- persona: p.persona,
134
- fixture: p.fixture,
135
- network: p.network ?? "success"
147
+ scenario: void 0,
148
+ component: m.id,
149
+ persona: void 0,
150
+ fixture: void 0,
151
+ network: "success"
136
152
  };
137
- r(p.route, U(g, e), !1);
153
+ i("/", z(N, e), !1);
138
154
  },
139
- [s, r, e]
140
- ), m = y(() => me(s), [s]);
141
- return { location: t, controls: s, viewport: m, setControls: o, navigate: d, openScenario: l };
155
+ [s, i, e]
156
+ ), h = x(() => be(s), [s]);
157
+ return { location: t, controls: s, viewport: h, setControls: a, navigate: r, openScenario: c, openComponent: p };
142
158
  }
143
- function me(e) {
144
- const t = G.find((n) => n.id === e.viewport);
159
+ function be(e) {
160
+ const t = te.find((n) => n.id === e.viewport);
145
161
  return e.viewport === "custom" ? { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 } : t ?? { id: "fit", label: "Ajustar" };
146
162
  }
147
- function K() {
163
+ function J() {
148
164
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
149
165
  }
150
- function pe(e) {
151
- return e !== null && Y.includes(e);
166
+ function ge(e) {
167
+ return e !== null && ee.includes(e);
152
168
  }
153
- function be(e) {
169
+ function ve(e) {
170
+ return e === "dark" || e === "light";
171
+ }
172
+ function we(e) {
154
173
  if (!e) return;
155
174
  const t = Number.parseInt(e, 10);
156
175
  return Number.isFinite(t) && t > 0 ? t : void 0;
157
176
  }
158
- function fe(e, t) {
159
- const n = e.split("/").filter(Boolean), s = ge(t).split("/").filter(Boolean), r = {};
160
- for (const [o, d] of n.entries()) {
161
- if (d === "*")
162
- return r["*"] = s.slice(o).join("/"), r;
163
- const l = s[o];
164
- if (l === void 0) return null;
165
- if (d.startsWith(":")) {
166
- r[d.slice(1)] = l;
177
+ function ke(e, t) {
178
+ const n = e.split("/").filter(Boolean), s = Ne(t).split("/").filter(Boolean), i = {};
179
+ for (const [a, r] of n.entries()) {
180
+ if (r === "*")
181
+ return i["*"] = s.slice(a).join("/"), i;
182
+ const c = s[a];
183
+ if (c === void 0) return null;
184
+ if (r.startsWith(":")) {
185
+ i[r.slice(1)] = c;
167
186
  continue;
168
187
  }
169
- if (d !== l) return null;
188
+ if (r !== c) return null;
170
189
  }
171
- return n.length !== s.length ? null : r;
190
+ return n.length !== s.length ? null : i;
172
191
  }
173
- function ve(e, t) {
174
- const n = [...e].sort((s, r) => V(r.path) - V(s.path));
192
+ function ye(e, t) {
193
+ const n = [...e].sort((s, i) => Q(i.path) - Q(s.path));
175
194
  for (const s of n) {
176
- const r = fe(s.path, t);
177
- if (r) return { definition: s, params: r };
195
+ const i = ke(s.path, t);
196
+ if (i) return { definition: s, params: i };
178
197
  }
179
198
  }
180
- function V(e) {
199
+ function Q(e) {
181
200
  const t = e.split("/").filter(Boolean);
182
201
  let n = t.length;
183
202
  for (const s of t)
184
203
  s === "*" ? n -= 2 : s.startsWith(":") ? n += 1 : n += 4;
185
204
  return n;
186
205
  }
187
- function ge(e) {
206
+ function Ne(e) {
188
207
  const t = e.split("?")[0] ?? e;
189
208
  try {
190
209
  return decodeURI(t);
@@ -192,17 +211,17 @@ function ge(e) {
192
211
  return t;
193
212
  }
194
213
  }
195
- const we = 2500;
196
- class Ne extends Error {
214
+ const Se = 2500;
215
+ class xe extends Error {
197
216
  constructor(t) {
198
217
  super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
199
218
  }
200
219
  }
201
- function P(e) {
220
+ function V(e) {
202
221
  if (e)
203
222
  return typeof e.data == "function" ? e.data() : e.data;
204
223
  }
205
- const O = {
224
+ const q = {
206
225
  id: "fixtures",
207
226
  label: "Fixtures",
208
227
  load: async ({ scenario: e, fixture: t, network: n }) => {
@@ -210,66 +229,66 @@ const O = {
210
229
  case "empty":
211
230
  return null;
212
231
  case "error":
213
- throw new Ne(e.id);
232
+ throw new xe(e.id);
214
233
  case "loading":
215
234
  return new Promise(() => {
216
235
  });
217
236
  case "slow":
218
- return await ke(we), P(t);
237
+ return await Me(Se), V(t);
219
238
  default:
220
- return P(t);
239
+ return V(t);
221
240
  }
222
241
  }
223
242
  };
224
- function et(e) {
225
- const { id: t, label: n, baseUrl: s, path: r, init: o, fallbackToFixture: d = !0 } = e;
243
+ function pt(e) {
244
+ const { id: t, label: n, baseUrl: s, path: i, init: a, fallbackToFixture: r = !0 } = e;
226
245
  return {
227
246
  id: t,
228
247
  label: n,
229
- load: async (l) => {
230
- const m = new URL(r ? r(l) : l.scenario.route, s);
248
+ load: async (c) => {
249
+ const p = new URL(i ? i(c) : c.scenario.route, s);
231
250
  try {
232
- const i = await fetch(m, o);
233
- if (!i.ok) throw new Error(`${i.status} ${i.statusText}`);
234
- return await i.json();
235
- } catch (i) {
236
- if (d) return P(l.fixture);
237
- throw new Error(`Adapter "${t}" falhou em ${m.toString()}`, { cause: i });
251
+ const h = await fetch(p, a);
252
+ if (!h.ok) throw new Error(`${h.status} ${h.statusText}`);
253
+ return await h.json();
254
+ } catch (h) {
255
+ if (r) return V(c.fixture);
256
+ throw new Error(`Adapter "${t}" falhou em ${p.toString()}`, { cause: h });
238
257
  }
239
258
  }
240
259
  };
241
260
  }
242
- function ke(e) {
261
+ function Me(e) {
243
262
  return new Promise((t) => setTimeout(t, e));
244
263
  }
245
264
  function _e(e) {
246
- const { scenario: t, fixture: n, network: s, adapter: r } = e, [o, d] = x({
265
+ const { scenario: t, fixture: n, network: s, adapter: i } = e, [a, r] = T({
247
266
  data: void 0,
248
267
  isLoading: !!t,
249
268
  error: void 0
250
269
  });
251
- return E(() => {
270
+ return F(() => {
252
271
  if (!t) {
253
- d({ data: void 0, isLoading: !1, error: void 0 });
272
+ r({ data: void 0, isLoading: !1, error: void 0 });
254
273
  return;
255
274
  }
256
- let l = !0;
257
- d({ data: void 0, isLoading: !0, error: void 0 });
258
- const m = r ?? O;
259
- return Promise.resolve(m.load({ scenario: t, fixture: n, network: s })).then((i) => {
260
- l && d({ data: i, isLoading: !1, error: void 0 });
261
- }).catch((i) => {
262
- l && d({
275
+ let c = !0;
276
+ r({ data: void 0, isLoading: !0, error: void 0 });
277
+ const p = i ?? q;
278
+ return Promise.resolve(p.load({ scenario: t, fixture: n, network: s })).then((h) => {
279
+ c && r({ data: h, isLoading: !1, error: void 0 });
280
+ }).catch((h) => {
281
+ c && r({
263
282
  data: void 0,
264
283
  isLoading: !1,
265
- error: i instanceof Error ? i : new Error(String(i))
284
+ error: h instanceof Error ? h : new Error(String(h))
266
285
  });
267
286
  }), () => {
268
- l = !1;
287
+ c = !1;
269
288
  };
270
- }, [t, n, s, r]), o;
289
+ }, [t, n, s, i]), a;
271
290
  }
272
- const ye = {
291
+ const Ce = {
273
292
  a: "link",
274
293
  article: "article",
275
294
  aside: "complementary",
@@ -303,7 +322,7 @@ const ye = {
303
322
  th: "columnheader",
304
323
  tr: "row",
305
324
  ul: "list"
306
- }, Se = {
325
+ }, Te = {
307
326
  button: "button",
308
327
  checkbox: "checkbox",
309
328
  email: "textbox",
@@ -318,50 +337,50 @@ const ye = {
318
337
  text: "textbox",
319
338
  url: "textbox"
320
339
  };
321
- function xe(e) {
340
+ function Le(e) {
322
341
  if (!e || !(e instanceof HTMLElement)) return;
323
- const { name: t, nameFrom: n } = Ce(e);
342
+ const { name: t, nameFrom: n } = Ee(e);
324
343
  return {
325
- role: Me(e),
344
+ role: Ae(e),
326
345
  name: t,
327
346
  nameFrom: n,
328
- description: Te(e),
329
- states: Ae(e),
330
- selector: $e(e),
347
+ description: $e(e),
348
+ states: Pe(e),
349
+ selector: Fe(e),
331
350
  hiddenFromTabOrder: e.tabIndex < 0,
332
- hiddenFromAssistiveTech: Ee(e)
351
+ hiddenFromAssistiveTech: Re(e)
333
352
  };
334
353
  }
335
- function Me(e) {
354
+ function Ae(e) {
336
355
  const t = e.getAttribute("role");
337
356
  if (t) return t.split(/\s+/)[0] ?? t;
338
357
  const n = e.tagName.toLowerCase();
339
358
  if (n === "input") {
340
359
  const s = e.type.toLowerCase();
341
- return Se[s] ?? "textbox";
360
+ return Te[s] ?? "textbox";
342
361
  }
343
- return n === "a" && !e.hasAttribute("href") ? "generic" : ye[n] ?? "generic";
362
+ return n === "a" && !e.hasAttribute("href") ? "generic" : Ce[n] ?? "generic";
344
363
  }
345
- function Ce(e) {
364
+ function Ee(e) {
346
365
  const t = e.getAttribute("aria-labelledby");
347
366
  if (t) {
348
- const d = t.split(/\s+/).map((l) => e.ownerDocument.getElementById(l)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
349
- if (d) return { name: d, nameFrom: "aria-labelledby" };
367
+ const r = t.split(/\s+/).map((c) => e.ownerDocument.getElementById(c)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
368
+ if (r) return { name: r, nameFrom: "aria-labelledby" };
350
369
  }
351
370
  const n = e.getAttribute("aria-label")?.trim();
352
371
  if (n) return { name: n, nameFrom: "aria-label" };
353
372
  if (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) {
354
- const d = Array.from(e.labels ?? []).map((l) => l.textContent?.trim() ?? "").filter(Boolean);
355
- if (d.length) return { name: d.join(" "), nameFrom: "label" };
373
+ const r = Array.from(e.labels ?? []).map((c) => c.textContent?.trim() ?? "").filter(Boolean);
374
+ if (r.length) return { name: r.join(" "), nameFrom: "label" };
356
375
  }
357
376
  if (e instanceof HTMLImageElement) {
358
- const d = e.getAttribute("alt");
359
- if (d !== null) return { name: d, nameFrom: "alt" };
377
+ const r = e.getAttribute("alt");
378
+ if (r !== null) return { name: r, nameFrom: "alt" };
360
379
  }
361
- const s = e.getAttribute("title")?.trim(), r = Le(e);
362
- return r ? { name: r, nameFrom: "content" } : s ? { name: s, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
380
+ const s = e.getAttribute("title")?.trim(), i = De(e);
381
+ return i ? { name: i, nameFrom: "content" } : s ? { name: s, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
363
382
  }
364
- function Te(e) {
383
+ function $e(e) {
365
384
  const t = e.getAttribute("aria-describedby");
366
385
  if (t) {
367
386
  const n = t.split(/\s+/).map((s) => e.ownerDocument.getElementById(s)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
@@ -369,14 +388,14 @@ function Te(e) {
369
388
  }
370
389
  return e.getAttribute("aria-description")?.trim() || void 0;
371
390
  }
372
- function Ae(e) {
373
- const t = [], n = (s, r = s.replace("aria-", "")) => {
374
- const o = e.getAttribute(s);
375
- o !== null && o !== "false" && t.push(o === "true" || o === "" ? r : `${r}=${o}`);
391
+ function Pe(e) {
392
+ const t = [], n = (s, i = s.replace("aria-", "")) => {
393
+ const a = e.getAttribute(s);
394
+ a !== null && a !== "false" && t.push(a === "true" || a === "" ? i : `${i}=${a}`);
376
395
  };
377
396
  return e.disabled && t.push("disabled"), e.getAttribute("aria-disabled") === "true" && t.push("disabled"), e.required && t.push("required"), e.readOnly && t.push("readonly"), e.checked && t.push("checked"), n("aria-expanded"), n("aria-selected"), n("aria-checked"), n("aria-pressed"), n("aria-current"), n("aria-invalid"), n("aria-busy"), n("aria-live"), n("aria-haspopup"), n("aria-level", "level"), e.ownerDocument.activeElement === e && t.push("focused"), [...new Set(t)];
378
397
  }
379
- function Ee(e) {
398
+ function Re(e) {
380
399
  let t = e;
381
400
  for (; t; ) {
382
401
  if (t.getAttribute("aria-hidden") === "true" || t.hasAttribute("hidden")) return !0;
@@ -384,13 +403,13 @@ function Ee(e) {
384
403
  }
385
404
  return !1;
386
405
  }
387
- function Le(e) {
406
+ function De(e) {
388
407
  const t = e.cloneNode(!0);
389
408
  for (const n of t.querySelectorAll("[aria-hidden='true'],[hidden]"))
390
409
  n.remove();
391
410
  return (t.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 160);
392
411
  }
393
- function $e(e) {
412
+ function Fe(e) {
394
413
  const t = e.tagName.toLowerCase();
395
414
  if (e.id) return `${t}#${e.id}`;
396
415
  const n = e.getAttribute("data-testid");
@@ -398,7 +417,7 @@ function $e(e) {
398
417
  const s = Array.from(e.classList).slice(0, 2);
399
418
  return s.length ? `${t}.${s.join(".")}` : t;
400
419
  }
401
- function Fe(e = document) {
420
+ function Ie(e = document) {
402
421
  const t = [
403
422
  "a[href]",
404
423
  "button",
@@ -415,37 +434,38 @@ function Fe(e = document) {
415
434
  return s.display === "none" || s.visibility === "hidden" ? !1 : n.offsetWidth > 0 || n.offsetHeight > 0 || n === document.activeElement;
416
435
  });
417
436
  }
418
- function Pe(e, t) {
419
- const [n, s] = x(), [r, o] = x([]), d = C(() => {
420
- const l = t.current;
421
- if (!l) {
422
- o([]);
437
+ function Oe(e, t) {
438
+ const [n, s] = T(), [i, a] = T([]), r = D(() => {
439
+ const c = t.current;
440
+ if (!c) {
441
+ a([]);
423
442
  return;
424
443
  }
425
- o(
426
- Fe(l).map((m, i) => ({
427
- index: i + 1,
428
- element: m,
429
- rect: m.getBoundingClientRect(),
430
- forcedOrder: m.tabIndex > 0
444
+ a(
445
+ Ie(c).map((p, h) => ({
446
+ index: h + 1,
447
+ element: p,
448
+ rect: p.getBoundingClientRect(),
449
+ forcedOrder: p.tabIndex > 0
431
450
  }))
432
451
  );
433
452
  }, [t]);
434
- return E(() => {
453
+ return F(() => {
435
454
  if (!e) {
436
- s(void 0), o([]);
455
+ s(void 0), a([]);
437
456
  return;
438
457
  }
439
- const l = () => s(xe(document.activeElement));
440
- document.addEventListener("focusin", l), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), l(), d();
441
- const m = t.current, i = m ? new MutationObserver(() => d()) : void 0;
442
- return i?.observe(m, { childList: !0, subtree: !0, attributes: !0 }), () => {
443
- document.removeEventListener("focusin", l), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), i?.disconnect();
458
+ const c = () => s(Le(document.activeElement));
459
+ document.addEventListener("focusin", c), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), c(), r();
460
+ const p = t.current, h = p ? new MutationObserver(() => r()) : void 0;
461
+ return h?.observe(p, { childList: !0, subtree: !0, attributes: !0 }), () => {
462
+ document.removeEventListener("focusin", c), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), h?.disconnect();
444
463
  };
445
- }, [e, d, t]), { focused: n, tabStops: r, refresh: d };
464
+ }, [e, r, t]), { focused: n, tabStops: i, refresh: r };
446
465
  }
447
- const S = {
466
+ const C = {
448
467
  status: {
468
+ ported: "Portado — não validado",
449
469
  proposed: "Proposta",
450
470
  "in-review": "Em revisão",
451
471
  approved: "Aprovado",
@@ -454,6 +474,7 @@ const S = {
454
474
  superseded: "Superado"
455
475
  },
456
476
  statusMeaning: {
477
+ ported: "Veio do sistema existente, mas não foi validado e não representa compromisso de implementação.",
457
478
  proposed: "Exploração ainda não aprovada.",
458
479
  "in-review": "Aberto para validação de design, negócio ou cliente.",
459
480
  approved: "Referência autorizada, registrada por URL de commit.",
@@ -481,25 +502,40 @@ const S = {
481
502
  custom: "Personalizado"
482
503
  },
483
504
  topbar: {
505
+ homeTitle: (e) => `Ir para a página inicial de ${e}`,
484
506
  toggleNav: "Mostrar ou ocultar a navegação",
485
507
  copyLink: "Copiar link",
486
508
  copied: "Link copiado",
487
509
  copyPrompt: "Copie o link do cenário:",
488
510
  cleanReview: "Revisão limpa",
489
- cleanReviewTitle: "Ocultar o chrome do Design Space para revisão limpa e captura de tela",
511
+ cleanReviewTitle: "Abrir a situação em uma nova aba, sem o chrome do Design Space",
490
512
  panel: "Painel",
513
+ lightMode: "Modo claro",
514
+ darkMode: "Modo escuro",
491
515
  branchTitle: (e) => `Branch: ${e}`,
492
516
  commitTitle: (e) => `Commit: ${e}`,
493
517
  envTitle: (e) => `Ambiente: ${e}`
494
518
  },
495
519
  sidebar: {
496
520
  region: "Cenários do produto",
521
+ flowsTab: "Fluxos",
522
+ componentsTab: "Componentes",
497
523
  searchPlaceholder: "Buscar situação…",
498
524
  searchLabel: "Buscar cenário pelo vocabulário do produto",
525
+ componentSearchPlaceholder: "Buscar componente…",
526
+ componentSearchLabel: "Buscar componente do produto",
527
+ searchShortcut: "⌘K",
499
528
  noMatch: (e) => `Nenhuma situação para "${e}".`,
500
529
  matchCount: (e) => `${e} ${e === 1 ? "situação" : "situações"}.`,
530
+ noComponentMatch: (e) => `Nenhum componente para "${e}".`,
531
+ componentMatchCount: (e) => `${e} ${e === 1 ? "componente" : "componentes"}.`,
501
532
  emptyModule: "Nenhum cenário ainda.",
502
- withoutModule: "Sem módulo"
533
+ emptyComponents: "O produto ainda não registrou componentes.",
534
+ withoutModule: "Sem módulo",
535
+ scope: "Escopo ativo",
536
+ scopeData: "Dados",
537
+ scopePersona: "Persona",
538
+ scopeNetwork: "Rede"
503
539
  },
504
540
  controls: {
505
541
  region: "Controles do cenário",
@@ -527,6 +563,8 @@ const S = {
527
563
  tabDiagnostics: "Diagnóstico",
528
564
  diagnosticsWithErrors: (e) => `Diagnóstico (${e})`,
529
565
  noScenario: "Nenhum cenário ativo. Escolha uma situação na navegação para ver contexto, regras e critérios.",
566
+ componentReference: "Componente",
567
+ componentGroup: "Grupo",
530
568
  situation: "Situação",
531
569
  reproduction: "Reprodução",
532
570
  id: "Id",
@@ -583,246 +621,538 @@ const S = {
583
621
  noRoute: "Nenhuma rota para este endereço",
584
622
  noRouteHint: "não casa com nenhuma rota declarada. Escolha uma situação na navegação."
585
623
  }
624
+ }, mt = {
625
+ status: {
626
+ ported: "Ported — not validated",
627
+ proposed: "Proposed",
628
+ "in-review": "In review",
629
+ approved: "Approved",
630
+ "in-implementation": "In implementation",
631
+ implemented: "Implemented",
632
+ superseded: "Superseded"
633
+ },
634
+ statusMeaning: {
635
+ ported: "Imported from the existing system, but not validated and not an implementation commitment.",
636
+ proposed: "Exploration that has not been approved yet.",
637
+ "in-review": "Open for design, business, or client validation.",
638
+ approved: "Authorized reference, recorded with a commit URL.",
639
+ "in-implementation": "Linked to active engineering work.",
640
+ implemented: "Available in the real product and validated.",
641
+ superseded: "Kept for history or replaced by another decision."
642
+ },
643
+ network: {
644
+ success: "Success",
645
+ loading: "Loading",
646
+ empty: "Empty",
647
+ error: "Error",
648
+ slow: "Slow"
649
+ },
650
+ keyboard: {
651
+ full: "Journey can be completed with keyboard only",
652
+ partial: "Partially operable with keyboard",
653
+ "not-applicable": "Not applicable"
654
+ },
655
+ viewport: {
656
+ fit: "Fit",
657
+ mobile: "Mobile",
658
+ tablet: "Tablet",
659
+ desktop: "Desktop",
660
+ custom: "Custom"
661
+ },
662
+ topbar: {
663
+ homeTitle: (e) => `Go to ${e} home`,
664
+ toggleNav: "Show or hide navigation",
665
+ copyLink: "Copy link",
666
+ copied: "Link copied",
667
+ copyPrompt: "Copy the scenario link:",
668
+ cleanReview: "Clean review",
669
+ cleanReviewTitle: "Open this state in a new tab without the Design Space chrome",
670
+ panel: "Panel",
671
+ lightMode: "Light mode",
672
+ darkMode: "Dark mode",
673
+ branchTitle: (e) => `Branch: ${e}`,
674
+ commitTitle: (e) => `Commit: ${e}`,
675
+ envTitle: (e) => `Environment: ${e}`
676
+ },
677
+ sidebar: {
678
+ region: "Product scenarios",
679
+ flowsTab: "Flows",
680
+ componentsTab: "Components",
681
+ searchPlaceholder: "Search scenarios…",
682
+ searchLabel: "Search scenarios using product language",
683
+ componentSearchPlaceholder: "Search components…",
684
+ componentSearchLabel: "Search product components",
685
+ searchShortcut: "⌘K",
686
+ noMatch: (e) => `No scenarios found for "${e}".`,
687
+ matchCount: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"}.`,
688
+ noComponentMatch: (e) => `No components found for "${e}".`,
689
+ componentMatchCount: (e) => `${e} ${e === 1 ? "component" : "components"}.`,
690
+ emptyModule: "No scenarios yet.",
691
+ emptyComponents: "The product has not registered any components yet.",
692
+ withoutModule: "No module",
693
+ scope: "Active scope",
694
+ scopeData: "Data",
695
+ scopePersona: "Persona",
696
+ scopeNetwork: "Network"
697
+ },
698
+ controls: {
699
+ region: "Scenario controls",
700
+ persona: "Persona",
701
+ fixture: "Data",
702
+ network: "Network",
703
+ viewport: "Viewport",
704
+ customWidth: "Custom width in pixels",
705
+ theme: "Theme",
706
+ locale: "Language",
707
+ dataSource: "Source",
708
+ fixturesOption: "Fixtures",
709
+ a11y: "Accessibility",
710
+ keyboardMode: "Keyboard",
711
+ keyboardModeTitle: "Complete the journey with keyboard only, showing focus and tab order",
712
+ reducedMotion: "Motion",
713
+ reducedMotionTitle: "Reduce motion inside the stage",
714
+ textScale: "Text size",
715
+ none: "—"
716
+ },
717
+ inspector: {
718
+ region: "Context panel",
719
+ tabScenario: "Scenario",
720
+ tabA11y: "Accessibility",
721
+ tabDiagnostics: "Diagnostics",
722
+ diagnosticsWithErrors: (e) => `Diagnostics (${e})`,
723
+ noScenario: "No active scenario. Choose a state in the navigation to see its context, rules, and criteria.",
724
+ componentReference: "Component",
725
+ componentGroup: "Group",
726
+ situation: "State",
727
+ reproduction: "Reproduction",
728
+ id: "ID",
729
+ route: "Route",
730
+ persona: "Persona",
731
+ personaSwapped: "changed",
732
+ data: "Data",
733
+ network: "Network",
734
+ goal: (e) => `Goal: ${e}`,
735
+ permissions: "Effective permissions",
736
+ preconditions: "Preconditions",
737
+ rules: "Rules",
738
+ actions: "Available actions",
739
+ expected: "Acceptance criteria",
740
+ approval: "Approval",
741
+ openApproved: "Open approved version",
742
+ engineering: "Engineering",
743
+ a11yContract: "Scenario contract",
744
+ keyboard: "Keyboard",
745
+ contrast: "Contrast",
746
+ contrastTarget: (e) => `WCAG 2.2 ${e}`,
747
+ announces: "Must be announced:",
748
+ focusedElement: "Focused element",
749
+ keyboardModeOff: "Turn on keyboard mode in the controls to inspect the accessibility tree.",
750
+ pressTab: (e) => `Press Tab inside the stage. ${e} tab ${e === 1 ? "stop was" : "stops were"} found.`,
751
+ role: "Role",
752
+ name: "Name",
753
+ noAccessibleName: "no accessible name",
754
+ nameFrom: "Name source",
755
+ description: "Description",
756
+ selector: "Selector",
757
+ focusableButHidden: "This element is focusable but hidden from assistive technology. A screen reader receives focus without receiving content.",
758
+ tabStopsInStage: (e) => `${e} tab ${e === 1 ? "stop" : "stops"} in the stage.`,
759
+ tokenContrast: "Token contrast",
760
+ noContrastPairs: "The product has not declared contrast pairs in theme.contrastPairs. Contrast belongs to a pair of colors; declaring pairs here validates them once, at the source.",
761
+ pair: "Pair",
762
+ ratio: "Ratio",
763
+ pairsFailing: (e) => `${e} ${e === 1 ? "pair is" : "pairs are"} below the target. The product token test fails the build for this.`,
764
+ automatedIsFloor: "Automated checks are a floor, not a ceiling. Confusing reading order, technically present but meaningless labels, and journeys that cannot be completed with a screen reader can still pass automated tools.",
765
+ coverage: "Coverage by status",
766
+ scenariosRegistered: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"} registered.`,
767
+ scenarioContract: "Scenario contract",
768
+ noIssues: "No issues found."
769
+ },
770
+ home: {
771
+ lead: (e) => `Executable specification: each state below opens from a link with its own persona, data, and rules. ${e} ${e === 1 ? "state registered" : "states registered"}.`,
772
+ withoutModule: "No module",
773
+ withoutModuleHint: "The ID prefix does not match a registered module, so these states do not appear in module navigation.",
774
+ emptyModule: "No states have been registered in this module yet.",
775
+ keyboardBadge: "keyboard"
776
+ },
777
+ shell: {
778
+ restoreChrome: "Show controls",
779
+ noRoute: "No route for this address",
780
+ noRouteHint: "does not match any declared route. Choose a state from the navigation."
781
+ }
586
782
  };
587
- function Oe(e) {
588
- if (!e) return S;
589
- const t = { ...S };
590
- for (const n of Object.keys(S)) {
783
+ function Be(e) {
784
+ if (!e) return C;
785
+ const t = { ...C };
786
+ for (const n of Object.keys(C)) {
591
787
  const s = e[n];
592
- s && (t[n] = { ...S[n], ...s });
788
+ s && (t[n] = { ...C[n], ...s });
593
789
  }
594
790
  return t;
595
791
  }
596
- const J = ne(S);
597
- function N() {
598
- return ae(J);
792
+ const oe = re(C);
793
+ function M() {
794
+ return ae(oe);
599
795
  }
600
- const tt = S.status, at = S.statusMeaning, nt = S.network, rt = S.keyboard;
601
- function Re({ registry: e, activeScenario: t, onOpenScenario: n }) {
602
- const s = N(), [r, o] = x(""), [d, l] = x(/* @__PURE__ */ new Set()), m = y(() => {
603
- if (r.trim())
604
- return new Set(e.search(r).map((h) => h.id));
605
- }, [r, e]), i = (h) => l((b) => {
606
- const w = new Set(b);
607
- return w.has(h) ? w.delete(h) : w.add(h), w;
608
- }), p = (h) => m ? h.filter((b) => m.has(b.id)) : h, g = e.tree.map((h) => ({ ...h, scenarios: p(h.scenarios) })).filter((h) => m ? h.scenarios.length > 0 : !0), v = p(e.orphans), u = g.reduce((h, b) => h + b.scenarios.length, 0) + v.length;
609
- return /* @__PURE__ */ c("nav", { className: "ds-chrome ds-sidebar", "aria-label": s.sidebar.region, children: [
610
- /* @__PURE__ */ a("div", { className: "ds-sidebar__search", children: /* @__PURE__ */ a(
611
- "input",
612
- {
613
- className: "ds-input ds-input--search",
614
- type: "search",
615
- value: r,
616
- placeholder: s.sidebar.searchPlaceholder,
617
- "aria-label": s.sidebar.searchLabel,
618
- onChange: (h) => o(h.target.value)
619
- }
620
- ) }),
621
- /* @__PURE__ */ c("div", { className: "ds-sidebar__tree", children: [
622
- r.trim() !== "" && /* @__PURE__ */ a("p", { className: "ds-sidebar__empty", role: "status", children: u === 0 ? s.sidebar.noMatch(r) : s.sidebar.matchCount(u) }),
623
- g.map((h) => {
624
- const b = !d.has(h.module.id) || !!m;
625
- return /* @__PURE__ */ c("section", { className: "ds-module", children: [
626
- /* @__PURE__ */ c(
627
- "button",
628
- {
629
- type: "button",
630
- className: "ds-module__header",
631
- "aria-expanded": b,
632
- onClick: () => i(h.module.id),
633
- children: [
634
- /* @__PURE__ */ a("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
635
- /* @__PURE__ */ a("span", { children: h.module.name }),
636
- /* @__PURE__ */ a("span", { className: "ds-module__count", children: h.scenarios.length })
637
- ]
638
- }
639
- ),
640
- b && /* @__PURE__ */ c("ul", { className: "ds-module__scenarios", children: [
641
- h.scenarios.map((w) => /* @__PURE__ */ a(
642
- q,
643
- {
644
- scenario: w,
645
- isActive: w.id === t,
646
- onOpen: n
647
- },
648
- w.id
649
- )),
650
- h.scenarios.length === 0 && /* @__PURE__ */ a("li", { className: "ds-sidebar__empty", children: s.sidebar.emptyModule })
651
- ] })
652
- ] }, h.module.id);
653
- }),
654
- v.length > 0 && /* @__PURE__ */ c("section", { className: "ds-module", children: [
655
- /* @__PURE__ */ c("div", { className: "ds-module__header", "aria-hidden": "true", children: [
656
- /* @__PURE__ */ a("span", { className: "ds-module__chevron", children: "▶" }),
657
- /* @__PURE__ */ a("span", { children: s.sidebar.withoutModule }),
658
- /* @__PURE__ */ a("span", { className: "ds-module__count", children: v.length })
659
- ] }),
660
- /* @__PURE__ */ a("ul", { className: "ds-module__scenarios", children: v.map((h) => /* @__PURE__ */ a(
661
- q,
662
- {
663
- scenario: h,
664
- isActive: h.id === t,
665
- onOpen: n
796
+ const ft = C.status, bt = C.statusMeaning, gt = C.network, vt = C.keyboard;
797
+ function We({
798
+ registry: e,
799
+ activeScenario: t,
800
+ activeComponent: n,
801
+ controls: s,
802
+ onOpenScenario: i,
803
+ onOpenComponent: a
804
+ }) {
805
+ const r = M(), [c, p] = T(n ? "components" : "flows"), [h, u] = T(""), [m, N] = T(/* @__PURE__ */ new Set()), y = G(null), l = G(/* @__PURE__ */ new Map());
806
+ F(() => {
807
+ n ? p("components") : t && p("flows");
808
+ }, [n, t]), F(() => {
809
+ const f = (v) => {
810
+ Ke(v) && (v.preventDefault(), y.current?.focus(), y.current?.select());
811
+ };
812
+ return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
813
+ }, []);
814
+ const g = x(() => {
815
+ if (h.trim())
816
+ return new Set(e.search(h).map((f) => f.id));
817
+ }, [h, e]), w = x(() => {
818
+ const f = Z(h);
819
+ return (e.product.components ?? []).filter(
820
+ (v) => Z([v.name, v.id, v.group, v.description].join(" ")).includes(
821
+ f
822
+ )
823
+ );
824
+ }, [h, e.product.components]), L = (f) => g ? f.filter((v) => g.has(v.id)) : f, E = e.tree.map((f) => ({ ...f, scenarios: L(f.scenarios) })).filter((f) => g ? f.scenarios.length > 0 : !0), $ = L(e.orphans), I = E.reduce((f, v) => f + v.scenarios.length, 0) + $.length, O = He(w), P = c === "flows" ? [...E.flatMap((f) => f.scenarios), ...$].map((f) => f.id) : w.map((f) => f.id), B = (f, v) => {
825
+ if (P.length === 0) return;
826
+ const k = ze(P, f, v);
827
+ k && l.current.get(k)?.focus();
828
+ }, K = (f) => {
829
+ f.key === "ArrowDown" ? (f.preventDefault(), B(void 0, 1)) : f.key === "Escape" && u("");
830
+ }, R = (f, v) => {
831
+ v.key !== "ArrowDown" && v.key !== "ArrowUp" || (v.preventDefault(), B(f, v.key === "ArrowDown" ? 1 : -1));
832
+ }, W = (f, v) => {
833
+ v ? l.current.set(f, v) : l.current.delete(f);
834
+ }, j = (f) => N((v) => {
835
+ const k = new Set(v);
836
+ return k.has(f) ? k.delete(f) : k.add(f), k;
837
+ });
838
+ return /* @__PURE__ */ d("nav", { className: "ds-chrome ds-sidebar", "aria-label": r.sidebar.region, children: [
839
+ /* @__PURE__ */ d("div", { className: "ds-sidebar__tabs", role: "tablist", children: [
840
+ /* @__PURE__ */ o(
841
+ "button",
842
+ {
843
+ type: "button",
844
+ role: "tab",
845
+ "aria-selected": c === "flows",
846
+ onClick: () => {
847
+ p("flows"), u("");
848
+ },
849
+ children: r.sidebar.flowsTab
850
+ }
851
+ ),
852
+ /* @__PURE__ */ o(
853
+ "button",
854
+ {
855
+ type: "button",
856
+ role: "tab",
857
+ "aria-selected": c === "components",
858
+ onClick: () => {
859
+ p("components"), u("");
666
860
  },
667
- h.id
668
- )) })
861
+ children: r.sidebar.componentsTab
862
+ }
863
+ )
864
+ ] }),
865
+ /* @__PURE__ */ d("div", { className: "ds-sidebar__search", children: [
866
+ /* @__PURE__ */ o(
867
+ "input",
868
+ {
869
+ ref: y,
870
+ className: "ds-input ds-input--search",
871
+ type: "search",
872
+ value: h,
873
+ placeholder: c === "flows" ? r.sidebar.searchPlaceholder : r.sidebar.componentSearchPlaceholder,
874
+ "aria-label": c === "flows" ? r.sidebar.searchLabel : r.sidebar.componentSearchLabel,
875
+ onChange: (f) => u(f.target.value),
876
+ onKeyDown: K
877
+ }
878
+ ),
879
+ /* @__PURE__ */ o("kbd", { children: r.sidebar.searchShortcut })
880
+ ] }),
881
+ /* @__PURE__ */ d("div", { className: "ds-sidebar__tree", role: "tabpanel", children: [
882
+ h.trim() !== "" && /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", role: "status", children: c === "flows" ? I === 0 ? r.sidebar.noMatch(h) : r.sidebar.matchCount(I) : w.length === 0 ? r.sidebar.noComponentMatch(h) : r.sidebar.componentMatchCount(w.length) }),
883
+ c === "flows" ? /* @__PURE__ */ o(
884
+ je,
885
+ {
886
+ nodes: E,
887
+ orphans: $,
888
+ matches: g,
889
+ collapsed: m,
890
+ activeScenario: t?.id,
891
+ emptyModuleLabel: r.sidebar.emptyModule,
892
+ withoutModuleLabel: r.sidebar.withoutModule,
893
+ onToggle: j,
894
+ onOpen: i,
895
+ onKeyDown: R,
896
+ setItemRef: W
897
+ }
898
+ ) : O.length === 0 && !h ? /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", children: r.sidebar.emptyComponents }) : O.map(([f, v]) => /* @__PURE__ */ d("section", { className: "ds-component-group", children: [
899
+ /* @__PURE__ */ o("h2", { children: f }),
900
+ /* @__PURE__ */ o("ul", { children: v.map((k) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d(
901
+ "button",
902
+ {
903
+ ref: (S) => W(k.id, S),
904
+ type: "button",
905
+ className: "ds-component-item",
906
+ "aria-current": k.id === n,
907
+ onClick: () => a(k.id),
908
+ onKeyDown: (S) => R(k.id, S),
909
+ children: [
910
+ /* @__PURE__ */ o("span", { children: k.name }),
911
+ k.description && /* @__PURE__ */ o("small", { children: k.description })
912
+ ]
913
+ }
914
+ ) }, k.id)) })
915
+ ] }, f))
916
+ ] }),
917
+ c === "flows" && t && /* @__PURE__ */ d("aside", { className: "ds-sidebar__scope", "aria-label": r.sidebar.scope, children: [
918
+ /* @__PURE__ */ o("h2", { children: r.sidebar.scope }),
919
+ /* @__PURE__ */ d("dl", { children: [
920
+ /* @__PURE__ */ o("dt", { children: r.sidebar.scopeData }),
921
+ /* @__PURE__ */ o("dd", { children: e.fixture(s.fixture ?? t.fixture)?.label ?? r.controls.none }),
922
+ /* @__PURE__ */ o("dt", { children: r.sidebar.scopePersona }),
923
+ /* @__PURE__ */ o("dd", { children: e.persona(s.persona ?? t.persona)?.name ?? r.controls.none }),
924
+ /* @__PURE__ */ o("dt", { children: r.sidebar.scopeNetwork }),
925
+ /* @__PURE__ */ o("dd", { children: r.network[s.network] })
669
926
  ] })
670
927
  ] })
671
928
  ] });
672
929
  }
673
- function q({
674
- scenario: e,
675
- isActive: t,
676
- onOpen: n
677
- }) {
678
- const s = N().status[e.status];
679
- return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c(
930
+ function je(e) {
931
+ return /* @__PURE__ */ d(A, { children: [
932
+ e.nodes.map((t) => {
933
+ const n = !e.collapsed.has(t.module.id) || !!e.matches;
934
+ return /* @__PURE__ */ d("section", { className: "ds-module", children: [
935
+ /* @__PURE__ */ d(
936
+ "button",
937
+ {
938
+ type: "button",
939
+ className: "ds-module__header",
940
+ "aria-expanded": n,
941
+ onClick: () => e.onToggle(t.module.id),
942
+ children: [
943
+ /* @__PURE__ */ o("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
944
+ /* @__PURE__ */ o("span", { children: t.module.name }),
945
+ /* @__PURE__ */ o("span", { className: "ds-module__count", children: t.scenarios.length })
946
+ ]
947
+ }
948
+ ),
949
+ n && /* @__PURE__ */ d("ul", { className: "ds-module__scenarios", children: [
950
+ t.scenarios.map((s) => /* @__PURE__ */ o(X, { scenario: s, ...e }, s.id)),
951
+ t.scenarios.length === 0 && /* @__PURE__ */ o("li", { className: "ds-sidebar__empty", children: e.emptyModuleLabel })
952
+ ] })
953
+ ] }, t.module.id);
954
+ }),
955
+ e.orphans.length > 0 && /* @__PURE__ */ d("section", { className: "ds-module", children: [
956
+ /* @__PURE__ */ d("div", { className: "ds-module__header", "aria-hidden": "true", children: [
957
+ /* @__PURE__ */ o("span", { className: "ds-module__chevron", children: "▶" }),
958
+ /* @__PURE__ */ o("span", { children: e.withoutModuleLabel }),
959
+ /* @__PURE__ */ o("span", { className: "ds-module__count", children: e.orphans.length })
960
+ ] }),
961
+ /* @__PURE__ */ o("ul", { className: "ds-module__scenarios", children: e.orphans.map((t) => /* @__PURE__ */ o(X, { scenario: t, ...e }, t.id)) })
962
+ ] })
963
+ ] });
964
+ }
965
+ function X({ scenario: e, activeScenario: t, onOpen: n, onKeyDown: s, setItemRef: i }) {
966
+ const a = M().status[e.status];
967
+ return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d(
680
968
  "button",
681
969
  {
970
+ ref: (r) => i(e.id, r),
682
971
  type: "button",
683
972
  className: "ds-scenario",
684
- "aria-current": t,
973
+ "aria-current": e.id === t,
685
974
  onClick: () => n(e.id),
975
+ onKeyDown: (r) => s(e.id, r),
686
976
  children: [
687
- /* @__PURE__ */ a(
688
- "span",
689
- {
690
- className: "ds-status-dot",
691
- "data-status": e.status,
692
- title: s
693
- }
694
- ),
695
- /* @__PURE__ */ a("span", { className: "ds-scenario__title", children: e.title }),
696
- /* @__PURE__ */ a("span", { className: "ds-visually-hidden", children: s })
977
+ /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": e.status, title: a }),
978
+ /* @__PURE__ */ o("span", { className: "ds-scenario__title", children: e.title }),
979
+ /* @__PURE__ */ o("span", { className: "ds-visually-hidden", children: a })
697
980
  ]
698
981
  }
699
982
  ) });
700
983
  }
701
- function Ie({
984
+ function He(e) {
985
+ const t = /* @__PURE__ */ new Map();
986
+ for (const n of e) {
987
+ const s = n.group ?? "Componentes";
988
+ t.set(s, [...t.get(s) ?? [], n]);
989
+ }
990
+ return [...t.entries()];
991
+ }
992
+ function Z(e) {
993
+ return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
994
+ }
995
+ function Ke(e) {
996
+ const t = e.key.toLowerCase();
997
+ return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (t === "k" || t === "f");
998
+ }
999
+ function ze(e, t, n) {
1000
+ if (e.length === 0) return;
1001
+ const s = t ? e.indexOf(t) : -1, i = Math.max(0, Math.min(e.length - 1, s + n));
1002
+ return e[i];
1003
+ }
1004
+ function Ue({
702
1005
  product: e,
703
1006
  scenario: t,
704
1007
  deploy: n,
705
1008
  inspectorOpen: s,
706
- sidebarOpen: r,
707
- onToggleInspector: o,
708
- onToggleSidebar: d,
709
- onHideChrome: l
1009
+ chromeTheme: i,
1010
+ onToggleInspector: a,
1011
+ onToggleChromeTheme: r
710
1012
  }) {
711
- const m = N().topbar, [i, p] = x(!1), g = async () => {
712
- const v = t ? ie(t, { origin: n.origin }) : `${n.origin}${window.location.pathname}${window.location.search}`;
1013
+ const c = M().topbar, [p, h] = T(!1), u = async () => {
1014
+ const y = t ? de(t, {
1015
+ origin: n.origin,
1016
+ overrides: i === "light" ? { chromeTheme: i } : void 0
1017
+ }) : `${n.origin}${window.location.pathname}${window.location.search}`;
713
1018
  try {
714
- await navigator.clipboard.writeText(v);
1019
+ await navigator.clipboard.writeText(y);
715
1020
  } catch {
716
- window.prompt(m.copyPrompt, v);
1021
+ window.prompt(c.copyPrompt, y);
717
1022
  }
718
- p(!0), window.setTimeout(() => p(!1), 1600);
719
- };
720
- return /* @__PURE__ */ c("header", { className: "ds-chrome ds-topbar", children: [
721
- /* @__PURE__ */ a(
1023
+ h(!0), window.setTimeout(() => h(!1), 1600);
1024
+ }, m = Ge(
1025
+ typeof window > "u" ? `${n.origin}/` : window.location.href
1026
+ ), N = Ve(n.origin, i);
1027
+ return /* @__PURE__ */ d("header", { className: "ds-chrome ds-topbar", children: [
1028
+ /* @__PURE__ */ d("div", { className: "ds-topbar__product", children: [
1029
+ /* @__PURE__ */ o(
1030
+ "a",
1031
+ {
1032
+ className: "ds-topbar__home",
1033
+ href: N,
1034
+ "aria-label": c.homeTitle(e.name),
1035
+ title: c.homeTitle(e.name),
1036
+ children: e.name
1037
+ }
1038
+ ),
1039
+ e.tagline && /* @__PURE__ */ o("span", { className: "ds-topbar__tagline", children: e.tagline })
1040
+ ] }),
1041
+ /* @__PURE__ */ o("div", { className: "ds-topbar__spacer" }),
1042
+ /* @__PURE__ */ d("div", { className: "ds-topbar__meta", children: [
1043
+ n.branch && /* @__PURE__ */ o("code", { title: c.branchTitle(n.branch), children: n.branch.length > 28 ? `${n.branch.slice(0, 27)}…` : n.branch }),
1044
+ n.commit && /* @__PURE__ */ o("code", { title: c.commitTitle(n.commit), children: n.shortCommit }),
1045
+ /* @__PURE__ */ o("code", { title: c.envTitle(n.env), children: n.env })
1046
+ ] }),
1047
+ /* @__PURE__ */ o(
722
1048
  "button",
723
1049
  {
724
1050
  type: "button",
725
- className: "ds-btn ds-btn--ghost",
726
- "aria-pressed": r,
727
- onClick: d,
728
- title: m.toggleNav,
729
- children: "☰"
1051
+ className: "ds-btn ds-btn--icon",
1052
+ "aria-pressed": i === "light",
1053
+ "aria-label": i === "dark" ? c.lightMode : c.darkMode,
1054
+ title: i === "dark" ? c.lightMode : c.darkMode,
1055
+ onClick: r,
1056
+ children: /* @__PURE__ */ o(qe, { theme: i })
730
1057
  }
731
1058
  ),
732
- /* @__PURE__ */ c("div", { className: "ds-topbar__product", children: [
733
- /* @__PURE__ */ a("span", { children: e.name }),
734
- e.tagline && /* @__PURE__ */ a("span", { className: "ds-topbar__tagline", children: e.tagline })
735
- ] }),
736
- /* @__PURE__ */ a("div", { className: "ds-topbar__spacer" }),
737
- /* @__PURE__ */ c("div", { className: "ds-topbar__meta", children: [
738
- n.branch && /* @__PURE__ */ a("code", { title: m.branchTitle(n.branch), children: n.branch.length > 28 ? `${n.branch.slice(0, 27)}…` : n.branch }),
739
- n.commit && /* @__PURE__ */ a("code", { title: m.commitTitle(n.commit), children: n.shortCommit }),
740
- /* @__PURE__ */ a("code", { title: m.envTitle(n.env), children: n.env })
741
- ] }),
742
- /* @__PURE__ */ a("button", { type: "button", className: "ds-btn", onClick: g, children: i ? m.copied : m.copyLink }),
743
- /* @__PURE__ */ a(
744
- "button",
1059
+ /* @__PURE__ */ o("button", { type: "button", className: "ds-btn", onClick: u, children: p ? c.copied : c.copyLink }),
1060
+ /* @__PURE__ */ o(
1061
+ "a",
745
1062
  {
746
- type: "button",
747
1063
  className: "ds-btn",
748
- onClick: l,
749
- title: m.cleanReviewTitle,
750
- children: m.cleanReview
1064
+ href: m,
1065
+ target: "_blank",
1066
+ rel: "noreferrer",
1067
+ title: c.cleanReviewTitle,
1068
+ children: c.cleanReview
751
1069
  }
752
1070
  ),
753
- /* @__PURE__ */ a(
1071
+ /* @__PURE__ */ o(
754
1072
  "button",
755
1073
  {
756
1074
  type: "button",
757
1075
  className: "ds-btn",
758
1076
  "aria-pressed": s,
759
- onClick: o,
760
- children: m.panel
1077
+ onClick: a,
1078
+ children: c.panel
761
1079
  }
762
1080
  )
763
1081
  ] });
764
1082
  }
765
- function De({ registry: e, controls: t, onChange: n }) {
766
- const s = N(), r = s.controls, { product: o } = e, d = o.dataSources?.adapters ?? [], l = o.theme?.modes ?? [], m = o.theme?.locales ?? [];
767
- return /* @__PURE__ */ c("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": r.region, children: [
768
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
769
- /* @__PURE__ */ a("label", { htmlFor: "ds-persona", children: r.persona }),
770
- /* @__PURE__ */ c(
1083
+ function Ge(e) {
1084
+ const t = new URL(e);
1085
+ return t.searchParams.set(b.chrome, "0"), t.toString();
1086
+ }
1087
+ function Ve(e, t) {
1088
+ const n = new URL("/", e);
1089
+ return t === "light" && n.searchParams.set(b.chromeTheme, t), n.toString();
1090
+ }
1091
+ function qe({ theme: e }) {
1092
+ const t = {
1093
+ width: 15,
1094
+ height: 15,
1095
+ viewBox: "0 0 24 24",
1096
+ fill: "none",
1097
+ stroke: "currentColor",
1098
+ strokeWidth: 2,
1099
+ strokeLinecap: "round",
1100
+ strokeLinejoin: "round",
1101
+ "aria-hidden": !0
1102
+ };
1103
+ return e === "dark" ? /* @__PURE__ */ d("svg", { ...t, children: [
1104
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "4" }),
1105
+ /* @__PURE__ */ o("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.42" })
1106
+ ] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
1107
+ }
1108
+ function Ye({ registry: e, controls: t, scenarioActive: n, onChange: s }) {
1109
+ const i = M(), a = i.controls, { product: r } = e, c = r.dataSources?.adapters ?? [], p = r.theme?.modes ?? [], h = r.theme?.locales ?? [];
1110
+ return /* @__PURE__ */ d("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": a.region, children: [
1111
+ n && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1112
+ /* @__PURE__ */ o("label", { htmlFor: "ds-persona", children: a.persona }),
1113
+ /* @__PURE__ */ d(
771
1114
  "select",
772
1115
  {
773
1116
  id: "ds-persona",
774
1117
  className: "ds-select",
775
1118
  value: t.persona ?? "",
776
- onChange: (i) => n({ persona: i.target.value || void 0 }),
1119
+ onChange: (u) => s({ persona: u.target.value || void 0 }),
777
1120
  children: [
778
- /* @__PURE__ */ a("option", { value: "", children: r.none }),
779
- o.personas.map((i) => /* @__PURE__ */ a("option", { value: i.id, children: i.name }, i.id))
1121
+ /* @__PURE__ */ o("option", { value: "", children: a.none }),
1122
+ r.personas.map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.name }, u.id))
780
1123
  ]
781
1124
  }
782
1125
  )
783
1126
  ] }),
784
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
785
- /* @__PURE__ */ a("label", { htmlFor: "ds-fixture", children: r.fixture }),
786
- /* @__PURE__ */ c(
787
- "select",
788
- {
789
- id: "ds-fixture",
790
- className: "ds-select",
791
- value: t.fixture ?? "",
792
- onChange: (i) => n({ fixture: i.target.value || void 0 }),
793
- children: [
794
- /* @__PURE__ */ a("option", { value: "", children: r.none }),
795
- o.fixtures.map((i) => /* @__PURE__ */ a("option", { value: i.id, children: i.label }, i.id))
796
- ]
797
- }
798
- )
799
- ] }),
800
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
801
- /* @__PURE__ */ a("span", { className: "ds-field__label", id: "ds-network-label", children: r.network }),
802
- /* @__PURE__ */ a("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: Y.map((i) => /* @__PURE__ */ a(
1127
+ n && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1128
+ /* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-network-label", children: a.network }),
1129
+ /* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: ee.map((u) => /* @__PURE__ */ o(
803
1130
  "button",
804
1131
  {
805
1132
  type: "button",
806
- "aria-pressed": t.network === i,
807
- onClick: () => n({ network: i }),
808
- children: s.network[i]
1133
+ "aria-pressed": t.network === u,
1134
+ onClick: () => s({ network: u }),
1135
+ children: i.network[u]
809
1136
  },
810
- i
1137
+ u
811
1138
  )) })
812
1139
  ] }),
813
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
814
- /* @__PURE__ */ a("span", { className: "ds-field__label", id: "ds-viewport-label", children: r.viewport }),
815
- /* @__PURE__ */ a("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: G.map((i) => /* @__PURE__ */ a(
1140
+ /* @__PURE__ */ d("div", { className: "ds-field", children: [
1141
+ /* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-viewport-label", children: a.viewport }),
1142
+ /* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: te.map((u) => /* @__PURE__ */ o(
816
1143
  "button",
817
1144
  {
818
1145
  type: "button",
819
- "aria-pressed": t.viewport === i.id,
820
- onClick: () => n({ viewport: i.id }),
821
- children: s.viewport[i.id] ?? i.label
1146
+ className: "ds-icon-button",
1147
+ "aria-pressed": t.viewport === u.id,
1148
+ "aria-label": i.viewport[u.id] ?? u.label,
1149
+ title: i.viewport[u.id] ?? u.label,
1150
+ onClick: () => s({ viewport: u.id }),
1151
+ children: /* @__PURE__ */ o(Je, { id: u.id })
822
1152
  },
823
- i.id
1153
+ u.id
824
1154
  )) }),
825
- t.viewport === "custom" && /* @__PURE__ */ a(
1155
+ t.viewport === "custom" && /* @__PURE__ */ o(
826
1156
  "input",
827
1157
  {
828
1158
  className: "ds-input",
@@ -831,128 +1161,117 @@ function De({ registry: e, controls: t, onChange: n }) {
831
1161
  max: 3840,
832
1162
  step: 10,
833
1163
  style: { width: 88 },
834
- "aria-label": r.customWidth,
1164
+ "aria-label": a.customWidth,
835
1165
  value: t.customWidth ?? 1024,
836
- onChange: (i) => n({ customWidth: Number(i.target.value) || void 0 })
1166
+ onChange: (u) => s({ customWidth: Number(u.target.value) || void 0 })
837
1167
  }
838
1168
  )
839
1169
  ] }),
840
- l.length > 1 && /* @__PURE__ */ c("div", { className: "ds-field", children: [
841
- /* @__PURE__ */ a("label", { htmlFor: "ds-theme", children: r.theme }),
842
- /* @__PURE__ */ a(
1170
+ p.length > 1 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1171
+ /* @__PURE__ */ o("label", { htmlFor: "ds-theme", children: a.theme }),
1172
+ /* @__PURE__ */ o(
843
1173
  "select",
844
1174
  {
845
1175
  id: "ds-theme",
846
1176
  className: "ds-select",
847
- value: t.themeMode ?? l[0],
848
- onChange: (i) => n({ themeMode: i.target.value }),
849
- children: l.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
1177
+ value: t.themeMode ?? p[0],
1178
+ onChange: (u) => s({ themeMode: u.target.value }),
1179
+ children: p.map((u) => /* @__PURE__ */ o("option", { value: u, children: u }, u))
850
1180
  }
851
1181
  )
852
1182
  ] }),
853
- m.length > 1 && /* @__PURE__ */ c("div", { className: "ds-field", children: [
854
- /* @__PURE__ */ a("label", { htmlFor: "ds-locale", children: r.locale }),
855
- /* @__PURE__ */ a(
1183
+ h.length > 1 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1184
+ /* @__PURE__ */ o("label", { htmlFor: "ds-locale", children: a.locale }),
1185
+ /* @__PURE__ */ o(
856
1186
  "select",
857
1187
  {
858
1188
  id: "ds-locale",
859
1189
  className: "ds-select",
860
- value: t.locale ?? m[0],
861
- onChange: (i) => n({ locale: i.target.value }),
862
- children: m.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
1190
+ value: t.locale ?? h[0],
1191
+ onChange: (u) => s({ locale: u.target.value }),
1192
+ children: h.map((u) => /* @__PURE__ */ o("option", { value: u, children: u }, u))
863
1193
  }
864
1194
  )
865
1195
  ] }),
866
- d.length > 0 && /* @__PURE__ */ c("div", { className: "ds-field", children: [
867
- /* @__PURE__ */ a("label", { htmlFor: "ds-source", children: r.dataSource }),
868
- /* @__PURE__ */ c(
1196
+ c.length > 0 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
1197
+ /* @__PURE__ */ o("label", { htmlFor: "ds-source", children: a.dataSource }),
1198
+ /* @__PURE__ */ d(
869
1199
  "select",
870
1200
  {
871
1201
  id: "ds-source",
872
1202
  className: "ds-select",
873
1203
  value: t.dataSource ?? "fixtures",
874
- onChange: (i) => n({ dataSource: i.target.value }),
1204
+ onChange: (u) => s({ dataSource: u.target.value }),
875
1205
  children: [
876
- /* @__PURE__ */ a("option", { value: "fixtures", children: r.fixturesOption }),
877
- d.filter((i) => i.id !== "fixtures").map((i) => /* @__PURE__ */ a("option", { value: i.id, children: i.label }, i.id))
1206
+ /* @__PURE__ */ o("option", { value: "fixtures", children: a.fixturesOption }),
1207
+ c.filter((u) => u.id !== "fixtures").map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.label }, u.id))
878
1208
  ]
879
1209
  }
880
1210
  )
881
- ] }),
882
- /* @__PURE__ */ c("div", { className: "ds-field", children: [
883
- /* @__PURE__ */ a("span", { className: "ds-field__label", children: r.a11y }),
884
- /* @__PURE__ */ a(
885
- "button",
886
- {
887
- type: "button",
888
- className: "ds-btn",
889
- "aria-pressed": t.keyboardMode,
890
- onClick: () => n({ keyboardMode: !t.keyboardMode }),
891
- title: r.keyboardModeTitle,
892
- children: r.keyboardMode
893
- }
894
- ),
895
- /* @__PURE__ */ a(
896
- "button",
897
- {
898
- type: "button",
899
- className: "ds-btn",
900
- "aria-pressed": t.reducedMotion,
901
- onClick: () => n({ reducedMotion: !t.reducedMotion }),
902
- title: r.reducedMotionTitle,
903
- children: r.reducedMotion
904
- }
905
- ),
906
- /* @__PURE__ */ a("div", { className: "ds-segmented", role: "group", "aria-label": r.textScale, children: Q.map((i) => /* @__PURE__ */ a(
907
- "button",
908
- {
909
- type: "button",
910
- "aria-pressed": t.textScale === i,
911
- onClick: () => n({ textScale: i }),
912
- children: i === 1 ? "100%" : `${i * 100}%`
913
- },
914
- i
915
- )) })
916
1211
  ] })
917
1212
  ] });
918
1213
  }
919
- function Be({
1214
+ function Je({ id: e }) {
1215
+ const t = {
1216
+ width: 16,
1217
+ height: 16,
1218
+ viewBox: "0 0 24 24",
1219
+ fill: "none",
1220
+ stroke: "currentColor",
1221
+ strokeWidth: 2,
1222
+ strokeLinecap: "round",
1223
+ strokeLinejoin: "round",
1224
+ "aria-hidden": !0
1225
+ };
1226
+ return e === "fit" ? /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3" }) }) : e === "mobile" ? /* @__PURE__ */ d("svg", { ...t, children: [
1227
+ /* @__PURE__ */ o("rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }),
1228
+ /* @__PURE__ */ o("path", { d: "M12 18h.01" })
1229
+ ] }) : e === "tablet" ? /* @__PURE__ */ d("svg", { ...t, children: [
1230
+ /* @__PURE__ */ o("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2" }),
1231
+ /* @__PURE__ */ o("path", { d: "M12 18h.01" })
1232
+ ] }) : e === "desktop" ? /* @__PURE__ */ d("svg", { ...t, children: [
1233
+ /* @__PURE__ */ o("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1234
+ /* @__PURE__ */ o("path", { d: "M8 21h8M12 17v4" })
1235
+ ] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) });
1236
+ }
1237
+ function Qe({
920
1238
  registry: e,
921
1239
  scenario: t,
922
- controls: n,
923
- focusedNode: s,
924
- tabStopCount: r
1240
+ component: n,
1241
+ controls: s,
1242
+ focusedNode: i,
1243
+ tabStopCount: a
925
1244
  }) {
926
- const o = N().inspector, [d, l] = x("scenario"), m = e.issues.filter((i) => i.level === "error").length;
927
- return /* @__PURE__ */ c("aside", { className: "ds-chrome ds-inspector", "aria-label": o.region, children: [
928
- /* @__PURE__ */ c("div", { className: "ds-inspector__tabs", role: "tablist", children: [
929
- /* @__PURE__ */ a(F, { id: "scenario", current: d, onSelect: l, children: o.tabScenario }),
930
- /* @__PURE__ */ a(F, { id: "a11y", current: d, onSelect: l, children: o.tabA11y }),
931
- /* @__PURE__ */ a(F, { id: "diagnostics", current: d, onSelect: l, children: m > 0 ? o.diagnosticsWithErrors(m) : o.tabDiagnostics })
1245
+ const r = M().inspector, [c, p] = T("scenario"), h = e.issues.filter((u) => u.level === "error").length;
1246
+ return /* @__PURE__ */ d("aside", { className: "ds-chrome ds-inspector", "aria-label": r.region, children: [
1247
+ /* @__PURE__ */ d("div", { className: "ds-inspector__tabs", role: "tablist", children: [
1248
+ /* @__PURE__ */ o(U, { id: "scenario", current: c, onSelect: p, children: n ? r.componentReference : r.tabScenario }),
1249
+ /* @__PURE__ */ o(U, { id: "a11y", current: c, onSelect: p, children: r.tabA11y }),
1250
+ /* @__PURE__ */ o(U, { id: "diagnostics", current: c, onSelect: p, children: h > 0 ? r.diagnosticsWithErrors(h) : r.tabDiagnostics })
932
1251
  ] }),
933
- /* @__PURE__ */ c("div", { className: "ds-inspector__body", role: "tabpanel", children: [
934
- d === "scenario" && /* @__PURE__ */ a(We, { registry: e, scenario: t, controls: n }),
935
- d === "a11y" && /* @__PURE__ */ a(
936
- je,
1252
+ /* @__PURE__ */ d("div", { className: "ds-inspector__body", role: "tabpanel", children: [
1253
+ c === "scenario" && /* @__PURE__ */ o(Xe, { registry: e, scenario: t, component: n, controls: s }),
1254
+ c === "a11y" && /* @__PURE__ */ o(
1255
+ Ze,
937
1256
  {
938
1257
  registry: e,
939
1258
  scenario: t,
940
- focusedNode: s,
941
- keyboardMode: n.keyboardMode,
942
- tabStopCount: r
1259
+ focusedNode: i,
1260
+ keyboardMode: s.keyboardMode,
1261
+ tabStopCount: a
943
1262
  }
944
1263
  ),
945
- d === "diagnostics" && /* @__PURE__ */ a(He, { registry: e })
1264
+ c === "diagnostics" && /* @__PURE__ */ o(et, { registry: e })
946
1265
  ] })
947
1266
  ] });
948
1267
  }
949
- function F({
1268
+ function U({
950
1269
  id: e,
951
1270
  current: t,
952
1271
  onSelect: n,
953
1272
  children: s
954
1273
  }) {
955
- return /* @__PURE__ */ a(
1274
+ return /* @__PURE__ */ o(
956
1275
  "button",
957
1276
  {
958
1277
  type: "button",
@@ -963,204 +1282,225 @@ function F({
963
1282
  }
964
1283
  );
965
1284
  }
966
- function We({
1285
+ function Xe({
967
1286
  registry: e,
968
1287
  scenario: t,
969
- controls: n
1288
+ component: n,
1289
+ controls: s
970
1290
  }) {
971
- const s = N(), r = s.inspector;
1291
+ const i = M(), a = i.inspector;
972
1292
  if (!t)
973
- return /* @__PURE__ */ a("p", { className: "ds-block", children: r.noScenario });
974
- const o = e.persona(n.persona ?? t.persona), d = n.persona ? e.persona(n.persona)?.permissions ?? [] : e.permissionsOf(t), l = e.rulesOf(t), m = e.fixture(n.fixture ?? t.fixture), i = !!(n.persona && n.persona !== t.persona);
975
- return /* @__PURE__ */ c(M, { children: [
976
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
977
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.situation }),
978
- /* @__PURE__ */ a("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: t.title }),
979
- t.intent && /* @__PURE__ */ a("p", { children: t.intent }),
980
- /* @__PURE__ */ c("div", { className: "ds-chips", children: [
981
- /* @__PURE__ */ a("span", { className: "ds-chip", "data-tone": ze(t.status), children: s.status[t.status] }),
982
- (t.tags ?? []).map((p) => /* @__PURE__ */ a("span", { className: "ds-chip", children: p }, p))
1293
+ return n ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1294
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.componentReference }),
1295
+ /* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 15, fontWeight: 600 }, children: n.name }),
1296
+ n.description && /* @__PURE__ */ o("p", { children: n.description }),
1297
+ /* @__PURE__ */ d("dl", { className: "ds-kv", style: { marginTop: 14 }, children: [
1298
+ /* @__PURE__ */ o("dt", { children: a.id }),
1299
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.id }),
1300
+ n.group && /* @__PURE__ */ d(A, { children: [
1301
+ /* @__PURE__ */ o("dt", { children: a.componentGroup }),
1302
+ /* @__PURE__ */ o("dd", { children: n.group })
1303
+ ] })
1304
+ ] })
1305
+ ] }) : /* @__PURE__ */ o("p", { className: "ds-block", children: a.noScenario });
1306
+ const r = e.persona(s.persona ?? t.persona), c = s.persona ? e.persona(s.persona)?.permissions ?? [] : e.permissionsOf(t), p = e.rulesOf(t), h = e.fixture(s.fixture ?? t.fixture), u = !!(s.persona && s.persona !== t.persona);
1307
+ return /* @__PURE__ */ d(A, { children: [
1308
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1309
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.situation }),
1310
+ /* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: t.title }),
1311
+ t.intent && /* @__PURE__ */ o("p", { children: t.intent }),
1312
+ /* @__PURE__ */ d("div", { className: "ds-chips", children: [
1313
+ /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": ot(t.status), children: i.status[t.status] }),
1314
+ (t.tags ?? []).map((m) => /* @__PURE__ */ o("span", { className: "ds-chip", children: m }, m))
983
1315
  ] }),
984
- /* @__PURE__ */ a("p", { style: { marginTop: 6 }, children: s.statusMeaning[t.status] })
1316
+ /* @__PURE__ */ o("p", { style: { marginTop: 6 }, children: i.statusMeaning[t.status] })
985
1317
  ] }),
986
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
987
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.reproduction }),
988
- /* @__PURE__ */ c("dl", { className: "ds-kv", children: [
989
- /* @__PURE__ */ a("dt", { children: r.id }),
990
- /* @__PURE__ */ a("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.id }),
991
- /* @__PURE__ */ a("dt", { children: r.route }),
992
- /* @__PURE__ */ a("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.route }),
993
- /* @__PURE__ */ a("dt", { children: r.persona }),
994
- /* @__PURE__ */ c("dd", { children: [
995
- o?.name ?? "—",
996
- i && /* @__PURE__ */ a("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: r.personaSwapped })
1318
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1319
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.reproduction }),
1320
+ /* @__PURE__ */ d("dl", { className: "ds-kv", children: [
1321
+ /* @__PURE__ */ o("dt", { children: a.id }),
1322
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.id }),
1323
+ /* @__PURE__ */ o("dt", { children: a.route }),
1324
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.route }),
1325
+ /* @__PURE__ */ o("dt", { children: a.persona }),
1326
+ /* @__PURE__ */ d("dd", { children: [
1327
+ r?.name ?? "—",
1328
+ u && /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: a.personaSwapped })
997
1329
  ] }),
998
- /* @__PURE__ */ a("dt", { children: r.data }),
999
- /* @__PURE__ */ a("dd", { children: m?.label ?? "—" }),
1000
- /* @__PURE__ */ a("dt", { children: r.network }),
1001
- /* @__PURE__ */ a("dd", { children: s.network[n.network] })
1330
+ /* @__PURE__ */ o("dt", { children: a.data }),
1331
+ /* @__PURE__ */ o("dd", { children: h?.label ?? "—" }),
1332
+ /* @__PURE__ */ o("dt", { children: a.network }),
1333
+ /* @__PURE__ */ o("dd", { children: i.network[s.network] })
1002
1334
  ] }),
1003
- o?.goal && /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: r.goal(o.goal) })
1335
+ r?.goal && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: a.goal(r.goal) })
1004
1336
  ] }),
1005
- d.length > 0 && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1006
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.permissions }),
1007
- /* @__PURE__ */ a("div", { className: "ds-chips", children: d.map((p) => /* @__PURE__ */ a("span", { className: "ds-chip", children: p }, p)) })
1337
+ c.length > 0 && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1338
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.permissions }),
1339
+ /* @__PURE__ */ o("div", { className: "ds-chips", children: c.map((m) => /* @__PURE__ */ o("span", { className: "ds-chip", children: m }, m)) })
1008
1340
  ] }),
1009
- t.preconditions?.length ? /* @__PURE__ */ c("div", { className: "ds-block", children: [
1010
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.preconditions }),
1011
- /* @__PURE__ */ a("ul", { className: "ds-list", children: t.preconditions.map((p) => /* @__PURE__ */ a("li", { children: p }, p)) })
1341
+ t.preconditions?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1342
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.preconditions }),
1343
+ /* @__PURE__ */ o("ul", { className: "ds-list", children: t.preconditions.map((m) => /* @__PURE__ */ o("li", { children: m }, m)) })
1012
1344
  ] }) : null,
1013
- l.length > 0 && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1014
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.rules }),
1015
- l.map((p) => /* @__PURE__ */ c("div", { className: "ds-rule", children: [
1016
- /* @__PURE__ */ a("span", { className: "ds-rule__id", children: p.id }),
1017
- /* @__PURE__ */ a("span", { className: "ds-rule__statement", children: p.statement }),
1018
- p.rationale && /* @__PURE__ */ a("p", { className: "ds-rule__rationale", children: p.rationale })
1019
- ] }, p.id))
1345
+ p.length > 0 && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1346
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.rules }),
1347
+ p.map((m) => /* @__PURE__ */ d("div", { className: "ds-rule", children: [
1348
+ /* @__PURE__ */ o("span", { className: "ds-rule__id", children: m.id }),
1349
+ /* @__PURE__ */ o("span", { className: "ds-rule__statement", children: m.statement }),
1350
+ m.rationale && /* @__PURE__ */ o("p", { className: "ds-rule__rationale", children: m.rationale })
1351
+ ] }, m.id))
1020
1352
  ] }),
1021
- t.actions?.length ? /* @__PURE__ */ c("div", { className: "ds-block", children: [
1022
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.actions }),
1023
- /* @__PURE__ */ a("ul", { className: "ds-list", children: t.actions.map((p) => /* @__PURE__ */ a("li", { children: p }, p)) })
1353
+ t.actions?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1354
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.actions }),
1355
+ /* @__PURE__ */ o("ul", { className: "ds-list", children: t.actions.map((m) => /* @__PURE__ */ o("li", { children: m }, m)) })
1024
1356
  ] }) : null,
1025
- t.expected?.length ? /* @__PURE__ */ c("div", { className: "ds-block", children: [
1026
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.expected }),
1027
- /* @__PURE__ */ a("ul", { className: "ds-list", children: t.expected.map((p) => /* @__PURE__ */ a("li", { children: p }, p)) })
1357
+ t.expected?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
1358
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.expected }),
1359
+ /* @__PURE__ */ o("ul", { className: "ds-list", children: t.expected.map((m) => /* @__PURE__ */ o("li", { children: m }, m)) })
1028
1360
  ] }) : null,
1029
- t.approvedAt && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1030
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.approval }),
1031
- /* @__PURE__ */ c("p", { children: [
1361
+ t.approvedAt && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1362
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.approval }),
1363
+ /* @__PURE__ */ d("p", { children: [
1032
1364
  t.approvedAt.date,
1033
1365
  " · ",
1034
- /* @__PURE__ */ a("code", { children: t.approvedAt.commit.slice(0, 7) })
1366
+ /* @__PURE__ */ o("code", { children: t.approvedAt.commit.slice(0, 7) })
1035
1367
  ] }),
1036
- /* @__PURE__ */ a("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children: r.openApproved })
1368
+ /* @__PURE__ */ o("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children: a.openApproved })
1037
1369
  ] }),
1038
- t.ticket && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1039
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: r.engineering }),
1040
- /* @__PURE__ */ a("p", { children: t.ticket })
1370
+ t.ticket && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1371
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: a.engineering }),
1372
+ /* @__PURE__ */ o("p", { children: t.ticket })
1041
1373
  ] })
1042
1374
  ] });
1043
1375
  }
1044
- function je({
1376
+ function Ze({
1045
1377
  registry: e,
1046
1378
  scenario: t,
1047
1379
  focusedNode: n,
1048
1380
  keyboardMode: s,
1049
- tabStopCount: r
1381
+ tabStopCount: i
1050
1382
  }) {
1051
- const o = N(), d = o.inspector, l = de(e.product.theme?.contrastPairs), m = l.filter((i) => i.passes !== !0);
1052
- return /* @__PURE__ */ c(M, { children: [
1053
- t && /* @__PURE__ */ c("div", { className: "ds-block", children: [
1054
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: d.a11yContract }),
1055
- /* @__PURE__ */ c("dl", { className: "ds-kv", children: [
1056
- /* @__PURE__ */ a("dt", { children: d.keyboard }),
1057
- /* @__PURE__ */ a("dd", { children: o.keyboard[t.a11y.keyboard] }),
1058
- /* @__PURE__ */ a("dt", { children: d.contrast }),
1059
- /* @__PURE__ */ a("dd", { children: d.contrastTarget(t.a11y.contrast) })
1383
+ const a = M(), r = a.inspector, c = le(e.product.theme?.contrastPairs), p = c.filter((h) => h.passes !== !0);
1384
+ return /* @__PURE__ */ d(A, { children: [
1385
+ t && /* @__PURE__ */ d("div", { className: "ds-block", children: [
1386
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.a11yContract }),
1387
+ /* @__PURE__ */ d("dl", { className: "ds-kv", children: [
1388
+ /* @__PURE__ */ o("dt", { children: r.keyboard }),
1389
+ /* @__PURE__ */ o("dd", { children: a.keyboard[t.a11y.keyboard] }),
1390
+ /* @__PURE__ */ o("dt", { children: r.contrast }),
1391
+ /* @__PURE__ */ o("dd", { children: r.contrastTarget(t.a11y.contrast) })
1060
1392
  ] }),
1061
- t.a11y.announces?.length ? /* @__PURE__ */ c(M, { children: [
1062
- /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: d.announces }),
1063
- /* @__PURE__ */ a("div", { className: "ds-chips", children: t.a11y.announces.map((i) => /* @__PURE__ */ a("span", { className: "ds-chip", children: i }, i)) })
1393
+ t.a11y.announces?.length ? /* @__PURE__ */ d(A, { children: [
1394
+ /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: r.announces }),
1395
+ /* @__PURE__ */ o("div", { className: "ds-chips", children: t.a11y.announces.map((h) => /* @__PURE__ */ o("span", { className: "ds-chip", children: h }, h)) })
1064
1396
  ] }) : null,
1065
- t.a11y.notes && /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: t.a11y.notes })
1397
+ t.a11y.notes && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: t.a11y.notes })
1066
1398
  ] }),
1067
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1068
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: d.focusedElement }),
1069
- s ? n ? /* @__PURE__ */ c(M, { children: [
1070
- /* @__PURE__ */ c("dl", { className: "ds-kv", children: [
1071
- /* @__PURE__ */ a("dt", { children: d.role }),
1072
- /* @__PURE__ */ a("dd", { children: n.role }),
1073
- /* @__PURE__ */ a("dt", { children: d.name }),
1074
- /* @__PURE__ */ a("dd", { children: n.name ? n.name : /* @__PURE__ */ a("span", { style: { color: "var(--ds-err)" }, children: d.noAccessibleName }) }),
1075
- /* @__PURE__ */ a("dt", { children: d.nameFrom }),
1076
- /* @__PURE__ */ a("dd", { children: n.nameFrom }),
1077
- n.description ? /* @__PURE__ */ c(M, { children: [
1078
- /* @__PURE__ */ a("dt", { children: d.description }),
1079
- /* @__PURE__ */ a("dd", { children: n.description })
1399
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1400
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.focusedElement }),
1401
+ s ? n ? /* @__PURE__ */ d(A, { children: [
1402
+ /* @__PURE__ */ d("dl", { className: "ds-kv", children: [
1403
+ /* @__PURE__ */ o("dt", { children: r.role }),
1404
+ /* @__PURE__ */ o("dd", { children: n.role }),
1405
+ /* @__PURE__ */ o("dt", { children: r.name }),
1406
+ /* @__PURE__ */ o("dd", { children: n.name ? n.name : /* @__PURE__ */ o("span", { style: { color: "var(--ds-err)" }, children: r.noAccessibleName }) }),
1407
+ /* @__PURE__ */ o("dt", { children: r.nameFrom }),
1408
+ /* @__PURE__ */ o("dd", { children: n.nameFrom }),
1409
+ n.description ? /* @__PURE__ */ d(A, { children: [
1410
+ /* @__PURE__ */ o("dt", { children: r.description }),
1411
+ /* @__PURE__ */ o("dd", { children: n.description })
1080
1412
  ] }) : null,
1081
- /* @__PURE__ */ a("dt", { children: d.selector }),
1082
- /* @__PURE__ */ a("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.selector })
1413
+ /* @__PURE__ */ o("dt", { children: r.selector }),
1414
+ /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.selector })
1083
1415
  ] }),
1084
- n.states.length > 0 && /* @__PURE__ */ a("div", { className: "ds-chips", style: { marginTop: 8 }, children: n.states.map((i) => /* @__PURE__ */ a("span", { className: "ds-chip", children: i }, i)) }),
1085
- n.hiddenFromAssistiveTech && /* @__PURE__ */ a("p", { className: "ds-note", style: { marginTop: 8 }, children: d.focusableButHidden }),
1086
- /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: d.tabStopsInStage(r) })
1087
- ] }) : /* @__PURE__ */ a("p", { children: d.pressTab(r) }) : /* @__PURE__ */ a("p", { children: d.keyboardModeOff })
1416
+ n.states.length > 0 && /* @__PURE__ */ o("div", { className: "ds-chips", style: { marginTop: 8 }, children: n.states.map((h) => /* @__PURE__ */ o("span", { className: "ds-chip", children: h }, h)) }),
1417
+ n.hiddenFromAssistiveTech && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: r.focusableButHidden }),
1418
+ /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: r.tabStopsInStage(i) })
1419
+ ] }) : /* @__PURE__ */ o("p", { children: r.pressTab(i) }) : /* @__PURE__ */ o("p", { children: r.keyboardModeOff })
1088
1420
  ] }),
1089
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1090
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: d.tokenContrast }),
1091
- l.length === 0 ? /* @__PURE__ */ a("p", { children: d.noContrastPairs }) : /* @__PURE__ */ c("table", { className: "ds-contrast", children: [
1092
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ c("tr", { children: [
1093
- /* @__PURE__ */ a("th", { scope: "col", children: d.pair }),
1094
- /* @__PURE__ */ a("th", { scope: "col", children: d.ratio })
1421
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1422
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.tokenContrast }),
1423
+ c.length === 0 ? /* @__PURE__ */ o("p", { children: r.noContrastPairs }) : /* @__PURE__ */ d("table", { className: "ds-contrast", children: [
1424
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ d("tr", { children: [
1425
+ /* @__PURE__ */ o("th", { scope: "col", children: r.pair }),
1426
+ /* @__PURE__ */ o("th", { scope: "col", children: r.ratio })
1095
1427
  ] }) }),
1096
- /* @__PURE__ */ a("tbody", { children: l.map((i) => /* @__PURE__ */ c("tr", { children: [
1097
- /* @__PURE__ */ c("td", { children: [
1098
- /* @__PURE__ */ a(
1428
+ /* @__PURE__ */ o("tbody", { children: c.map((h) => /* @__PURE__ */ d("tr", { children: [
1429
+ /* @__PURE__ */ d("td", { children: [
1430
+ /* @__PURE__ */ o(
1099
1431
  "span",
1100
1432
  {
1101
1433
  className: "ds-swatch",
1102
- style: { background: i.pair.background },
1434
+ style: { background: h.pair.background },
1103
1435
  "aria-hidden": "true"
1104
1436
  }
1105
1437
  ),
1106
- /* @__PURE__ */ a(
1438
+ /* @__PURE__ */ o(
1107
1439
  "span",
1108
1440
  {
1109
1441
  className: "ds-swatch",
1110
- style: { background: i.pair.foreground },
1442
+ style: { background: h.pair.foreground },
1111
1443
  "aria-hidden": "true"
1112
1444
  }
1113
1445
  ),
1114
- i.pair.name
1446
+ h.pair.name
1115
1447
  ] }),
1116
- /* @__PURE__ */ a(
1448
+ /* @__PURE__ */ o(
1117
1449
  "td",
1118
1450
  {
1119
1451
  style: {
1120
- color: i.passes === !0 ? "var(--ds-ok)" : i.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1452
+ color: h.passes === !0 ? "var(--ds-ok)" : h.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1121
1453
  },
1122
- children: i.label
1454
+ children: h.label
1123
1455
  }
1124
1456
  )
1125
- ] }, i.pair.name)) })
1457
+ ] }, h.pair.name)) })
1126
1458
  ] }),
1127
- m.length > 0 && /* @__PURE__ */ a("p", { className: "ds-note", style: { marginTop: 8 }, children: d.pairsFailing(m.length) })
1459
+ p.length > 0 && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: r.pairsFailing(p.length) })
1128
1460
  ] }),
1129
- /* @__PURE__ */ a("p", { className: "ds-note", children: d.automatedIsFloor })
1461
+ /* @__PURE__ */ o("p", { className: "ds-note", children: r.automatedIsFloor })
1130
1462
  ] });
1131
1463
  }
1132
- function He({ registry: e }) {
1133
- const t = N(), n = t.inspector, s = e.coverage(), { issues: r } = e;
1134
- return /* @__PURE__ */ c(M, { children: [
1135
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1136
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: n.coverage }),
1137
- /* @__PURE__ */ a("dl", { className: "ds-kv", children: Object.entries(s).filter(([, o]) => o > 0).map(([o, d]) => /* @__PURE__ */ c("div", { style: { display: "contents" }, children: [
1138
- /* @__PURE__ */ a("dt", { children: t.status[o] }),
1139
- /* @__PURE__ */ a("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: d })
1140
- ] }, o)) }),
1141
- /* @__PURE__ */ a("p", { style: { marginTop: 8 }, children: n.scenariosRegistered(e.product.scenarios.length) })
1464
+ function et({ registry: e }) {
1465
+ const t = M(), n = t.inspector, s = e.coverage(), { issues: i } = e;
1466
+ return /* @__PURE__ */ d(A, { children: [
1467
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1468
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.coverage }),
1469
+ /* @__PURE__ */ o("dl", { className: "ds-kv", children: Object.entries(s).filter(([, a]) => a > 0).map(([a, r]) => /* @__PURE__ */ d("div", { style: { display: "contents" }, children: [
1470
+ /* @__PURE__ */ o("dt", { children: t.status[a] }),
1471
+ /* @__PURE__ */ o("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: r })
1472
+ ] }, a)) }),
1473
+ /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: n.scenariosRegistered(e.product.scenarios.length) })
1142
1474
  ] }),
1143
- /* @__PURE__ */ c("div", { className: "ds-block", children: [
1144
- /* @__PURE__ */ a("h2", { className: "ds-block__title", children: n.scenarioContract }),
1145
- r.length === 0 ? /* @__PURE__ */ a("p", { children: n.noIssues }) : r.map((o, d) => /* @__PURE__ */ c("div", { className: "ds-issue", "data-level": o.level, children: [
1146
- /* @__PURE__ */ a("span", { className: "ds-issue__where", children: o.where }),
1147
- o.message
1148
- ] }, `${o.where}-${d}`))
1475
+ /* @__PURE__ */ d("div", { className: "ds-block", children: [
1476
+ /* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.scenarioContract }),
1477
+ i.length === 0 ? /* @__PURE__ */ o("p", { children: n.noIssues }) : i.map((a, r) => /* @__PURE__ */ d("div", { className: "ds-issue", "data-level": a.level, children: [
1478
+ /* @__PURE__ */ o("span", { className: "ds-issue__where", children: a.where }),
1479
+ a.message
1480
+ ] }, `${a.where}-${r}`))
1149
1481
  ] })
1150
1482
  ] });
1151
1483
  }
1152
- function ze(e) {
1153
- if (e === "approved" || e === "implemented") return "ok";
1154
- if (e === "in-review" || e === "proposed") return "warn";
1484
+ const tt = {
1485
+ ported: void 0,
1486
+ proposed: "warn",
1487
+ "in-review": "warn",
1488
+ approved: "ok",
1489
+ "in-implementation": void 0,
1490
+ implemented: "ok",
1491
+ superseded: void 0
1492
+ };
1493
+ function ot(e) {
1494
+ return tt[e];
1155
1495
  }
1156
- const Ue = re(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMode: r, children: o }, d) {
1157
- return /* @__PURE__ */ a("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ a(
1496
+ const nt = se(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMode: i, children: a }, r) {
1497
+ return /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
1158
1498
  "div",
1159
1499
  {
1160
- ref: d,
1500
+ ref: r,
1161
1501
  className: "ds-stage",
1162
1502
  "data-viewport": t.id,
1163
- "data-keyboard-mode": r,
1503
+ "data-keyboard-mode": i,
1164
1504
  "data-reduced-motion": s,
1165
1505
  style: {
1166
1506
  width: t.width ? `${t.width}px` : "100%",
@@ -1170,12 +1510,12 @@ const Ue = re(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMo
1170
1510
  // texto grande e só dar zoom na captura de tela.
1171
1511
  fontSize: n === 1 ? void 0 : `${n * 100}%`
1172
1512
  },
1173
- children: o
1513
+ children: a
1174
1514
  }
1175
1515
  ) });
1176
1516
  });
1177
- function Ke({ stops: e }) {
1178
- return e.length === 0 ? null : /* @__PURE__ */ a("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((t) => /* @__PURE__ */ a(
1517
+ function at({ stops: e }) {
1518
+ return e.length === 0 ? null : /* @__PURE__ */ o("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((t) => /* @__PURE__ */ o(
1179
1519
  "span",
1180
1520
  {
1181
1521
  className: "ds-taborder__badge",
@@ -1186,40 +1526,40 @@ function Ke({ stops: e }) {
1186
1526
  `${t.index}-${t.rect.top}-${t.rect.left}`
1187
1527
  )) });
1188
1528
  }
1189
- function Ve({ title: e, children: t }) {
1190
- return /* @__PURE__ */ c("div", { className: "ds-chrome ds-stage-empty", children: [
1191
- /* @__PURE__ */ a("h2", { children: e }),
1529
+ function rt({ title: e, children: t }) {
1530
+ return /* @__PURE__ */ d("div", { className: "ds-chrome ds-stage-empty", children: [
1531
+ /* @__PURE__ */ o("h2", { children: e }),
1192
1532
  t
1193
1533
  ] });
1194
1534
  }
1195
- function qe({ registry: e, onOpenScenario: t }) {
1196
- const n = N(), { product: s } = e, r = e.coverage(), o = s.scenarios.length;
1197
- return /* @__PURE__ */ c("div", { className: "ds-chrome ds-home", children: [
1198
- /* @__PURE__ */ c("header", { className: "ds-home__header", children: [
1199
- /* @__PURE__ */ a("h1", { children: s.name }),
1200
- s.tagline && /* @__PURE__ */ a("p", { className: "ds-home__tagline", children: s.tagline }),
1201
- /* @__PURE__ */ a("p", { className: "ds-home__lead", children: n.home.lead(o) }),
1202
- /* @__PURE__ */ a("div", { className: "ds-chips", children: Object.entries(r).filter(([, d]) => d > 0).map(([d, l]) => /* @__PURE__ */ c("span", { className: "ds-chip", children: [
1203
- n.status[d],
1535
+ function st({ registry: e, onOpenScenario: t }) {
1536
+ const n = M(), { product: s } = e, i = e.coverage(), a = s.scenarios.length;
1537
+ return /* @__PURE__ */ d("div", { className: "ds-chrome ds-home", children: [
1538
+ /* @__PURE__ */ d("header", { className: "ds-home__header", children: [
1539
+ /* @__PURE__ */ o("h1", { children: s.name }),
1540
+ s.tagline && /* @__PURE__ */ o("p", { className: "ds-home__tagline", children: s.tagline }),
1541
+ /* @__PURE__ */ o("p", { className: "ds-home__lead", children: n.home.lead(a) }),
1542
+ /* @__PURE__ */ o("div", { className: "ds-chips", children: Object.entries(i).filter(([, r]) => r > 0).map(([r, c]) => /* @__PURE__ */ d("span", { className: "ds-chip", children: [
1543
+ n.status[r],
1204
1544
  ": ",
1205
- l
1206
- ] }, d)) })
1545
+ c
1546
+ ] }, r)) })
1207
1547
  ] }),
1208
- e.tree.map(({ module: d, scenarios: l }) => /* @__PURE__ */ a(
1209
- Ye,
1548
+ e.tree.map(({ module: r, scenarios: c }) => /* @__PURE__ */ o(
1549
+ it,
1210
1550
  {
1211
- module: d,
1212
- scenarios: l,
1551
+ module: r,
1552
+ scenarios: c,
1213
1553
  registry: e,
1214
1554
  onOpenScenario: t
1215
1555
  },
1216
- d.id
1556
+ r.id
1217
1557
  )),
1218
- e.orphans.length > 0 && /* @__PURE__ */ c("section", { className: "ds-home__module", children: [
1219
- /* @__PURE__ */ a("h2", { children: n.home.withoutModule }),
1220
- /* @__PURE__ */ a("p", { className: "ds-home__hint", children: n.home.withoutModuleHint }),
1221
- /* @__PURE__ */ a(
1222
- X,
1558
+ e.orphans.length > 0 && /* @__PURE__ */ d("section", { className: "ds-home__module", children: [
1559
+ /* @__PURE__ */ o("h2", { children: n.home.withoutModule }),
1560
+ /* @__PURE__ */ o("p", { className: "ds-home__hint", children: n.home.withoutModuleHint }),
1561
+ /* @__PURE__ */ o(
1562
+ ne,
1223
1563
  {
1224
1564
  scenarios: e.orphans,
1225
1565
  registry: e,
@@ -1229,85 +1569,82 @@ function qe({ registry: e, onOpenScenario: t }) {
1229
1569
  ] })
1230
1570
  ] });
1231
1571
  }
1232
- function Ye({
1572
+ function it({
1233
1573
  module: e,
1234
1574
  scenarios: t,
1235
1575
  registry: n,
1236
1576
  onOpenScenario: s
1237
1577
  }) {
1238
- return /* @__PURE__ */ c("section", { className: "ds-home__module", children: [
1239
- /* @__PURE__ */ a("h2", { children: e.name }),
1240
- e.description && /* @__PURE__ */ a("p", { className: "ds-home__hint", children: e.description }),
1241
- (e.flows ?? []).map((r) => /* @__PURE__ */ a(Ge, { flow: r, registry: n, onOpenScenario: s }, r.id)),
1242
- /* @__PURE__ */ a(X, { scenarios: t, registry: n, onOpenScenario: s })
1578
+ return /* @__PURE__ */ d("section", { className: "ds-home__module", children: [
1579
+ /* @__PURE__ */ o("h2", { children: e.name }),
1580
+ e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
1581
+ (e.flows ?? []).map((i) => /* @__PURE__ */ o(ct, { flow: i, registry: n, onOpenScenario: s }, i.id)),
1582
+ /* @__PURE__ */ o(ne, { scenarios: t, registry: n, onOpenScenario: s })
1243
1583
  ] });
1244
1584
  }
1245
- function Ge({
1585
+ function ct({
1246
1586
  flow: e,
1247
1587
  registry: t,
1248
1588
  onOpenScenario: n
1249
1589
  }) {
1250
- return /* @__PURE__ */ c("div", { className: "ds-flow", children: [
1251
- /* @__PURE__ */ a("h3", { children: e.title }),
1252
- e.description && /* @__PURE__ */ a("p", { className: "ds-home__hint", children: e.description }),
1253
- /* @__PURE__ */ a("ol", { className: "ds-flow__steps", children: e.steps.map((s, r) => {
1254
- const o = t.scenario(s.scenario), d = Object.entries(s.branches ?? {});
1255
- return /* @__PURE__ */ c("li", { children: [
1256
- /* @__PURE__ */ a("button", { type: "button", className: "ds-flow__step", onClick: () => n(s.scenario), children: s.label ?? o?.title ?? s.scenario }),
1257
- s.decision && /* @__PURE__ */ a("p", { className: "ds-flow__decision", children: s.decision }),
1258
- d.length > 0 && /* @__PURE__ */ a("ul", { className: "ds-flow__branches", children: d.map(([l, m]) => /* @__PURE__ */ c("li", { children: [
1259
- /* @__PURE__ */ a("span", { className: "ds-flow__branch-label", children: l }),
1260
- /* @__PURE__ */ a(
1590
+ return /* @__PURE__ */ d("div", { className: "ds-flow", children: [
1591
+ /* @__PURE__ */ o("h3", { children: e.title }),
1592
+ e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
1593
+ /* @__PURE__ */ o("ol", { className: "ds-flow__steps", children: e.steps.map((s, i) => {
1594
+ const a = t.scenario(s.scenario), r = Object.entries(s.branches ?? {});
1595
+ return /* @__PURE__ */ d("li", { children: [
1596
+ /* @__PURE__ */ o("button", { type: "button", className: "ds-flow__step", onClick: () => n(s.scenario), children: s.label ?? a?.title ?? s.scenario }),
1597
+ s.decision && /* @__PURE__ */ o("p", { className: "ds-flow__decision", children: s.decision }),
1598
+ r.length > 0 && /* @__PURE__ */ o("ul", { className: "ds-flow__branches", children: r.map(([c, p]) => /* @__PURE__ */ d("li", { children: [
1599
+ /* @__PURE__ */ o("span", { className: "ds-flow__branch-label", children: c }),
1600
+ /* @__PURE__ */ o(
1261
1601
  "button",
1262
1602
  {
1263
1603
  type: "button",
1264
1604
  className: "ds-flow__step",
1265
- onClick: () => n(m),
1266
- children: t.scenario(m)?.title ?? m
1605
+ onClick: () => n(p),
1606
+ children: t.scenario(p)?.title ?? p
1267
1607
  }
1268
1608
  )
1269
- ] }, l)) })
1270
- ] }, `${s.scenario}-${r}`);
1609
+ ] }, c)) })
1610
+ ] }, `${s.scenario}-${i}`);
1271
1611
  }) })
1272
1612
  ] });
1273
1613
  }
1274
- function X({
1614
+ function ne({
1275
1615
  scenarios: e,
1276
1616
  registry: t,
1277
1617
  onOpenScenario: n
1278
1618
  }) {
1279
- const s = N();
1280
- return e.length === 0 ? /* @__PURE__ */ a("p", { className: "ds-home__hint", children: s.home.emptyModule }) : /* @__PURE__ */ a("ul", { className: "ds-home__grid", children: e.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c("button", { type: "button", className: "ds-home__card", onClick: () => n(r.id), children: [
1281
- /* @__PURE__ */ c("span", { className: "ds-home__card-head", children: [
1282
- /* @__PURE__ */ a("span", { className: "ds-status-dot", "data-status": r.status }),
1283
- /* @__PURE__ */ a("span", { className: "ds-home__card-title", children: r.title })
1619
+ const s = M();
1620
+ return e.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-home__hint", children: s.home.emptyModule }) : /* @__PURE__ */ o("ul", { className: "ds-home__grid", children: e.map((i) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d("button", { type: "button", className: "ds-home__card", onClick: () => n(i.id), children: [
1621
+ /* @__PURE__ */ d("span", { className: "ds-home__card-head", children: [
1622
+ /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": i.status }),
1623
+ /* @__PURE__ */ o("span", { className: "ds-home__card-title", children: i.title })
1284
1624
  ] }),
1285
- r.intent && /* @__PURE__ */ a("span", { className: "ds-home__card-intent", children: r.intent }),
1286
- /* @__PURE__ */ c("span", { className: "ds-home__card-meta", children: [
1287
- t.persona(r.persona)?.name ?? r.persona,
1625
+ i.intent && /* @__PURE__ */ o("span", { className: "ds-home__card-intent", children: i.intent }),
1626
+ /* @__PURE__ */ d("span", { className: "ds-home__card-meta", children: [
1627
+ t.persona(i.persona)?.name ?? i.persona,
1288
1628
  " · ",
1289
- s.status[r.status],
1290
- r.a11y.keyboard === "full" ? ` · ${s.home.keyboardBadge}` : ""
1629
+ s.status[i.status],
1630
+ i.a11y.keyboard === "full" ? ` · ${s.home.keyboardBadge}` : ""
1291
1631
  ] })
1292
- ] }) }, r.id)) });
1632
+ ] }) }, i.id)) });
1293
1633
  }
1294
- function st({ product: e }) {
1295
- const t = y(() => le(e), [e]), n = y(() => Oe(e.theme?.labels), [e.theme?.labels]), s = y(() => ce(e.deploy), [e.deploy]), { location: r, controls: o, viewport: d, setControls: l, navigate: m, openScenario: i } = he(t), [p, g] = x(!0), v = se(null), { focused: u, tabStops: h } = Pe(o.keyboardMode, v), b = t.scenario(o.scenario), w = t.persona(o.persona ?? b?.persona), T = t.fixture(o.fixture ?? b?.fixture), Z = y(() => {
1296
- const k = o.dataSource ?? "fixtures";
1297
- return k === "fixtures" ? O : e.dataSources?.adapters?.find((_) => _.id === k) ?? O;
1298
- }, [o.dataSource, e.dataSources?.adapters]), { data: R, isLoading: I, error: D } = _e({ scenario: b, fixture: T, network: o.network, adapter: Z });
1299
- E(() => {
1300
- const k = (_) => {
1634
+ function wt({ product: e }) {
1635
+ const t = x(() => he(e), [e]), n = x(() => Be(e.theme?.labels), [e.theme?.labels]), s = x(() => ue(e.deploy), [e.deploy]), { location: i, controls: a, viewport: r, setControls: c, navigate: p, openScenario: h, openComponent: u } = fe(t), m = G(null), { focused: N, tabStops: y } = Oe(a.keyboardMode, m), l = t.scenario(a.scenario), g = t.component(a.component), w = t.persona(a.persona ?? l?.persona), L = t.fixture(a.fixture ?? l?.fixture), E = x(() => {
1636
+ const S = a.dataSource ?? "fixtures";
1637
+ return S === "fixtures" ? q : e.dataSources?.adapters?.find((_) => _.id === S) ?? q;
1638
+ }, [a.dataSource, e.dataSources?.adapters]), { data: $, isLoading: I, error: O } = _e({ scenario: l, fixture: L, network: a.network, adapter: E });
1639
+ F(() => {
1640
+ const S = (_) => {
1301
1641
  if (!(!_.shiftKey || _.metaKey || _.ctrlKey || _.altKey || _.target?.matches("input, textarea, select, [contenteditable='true']"))) {
1302
1642
  switch (_.key) {
1303
- case "C":
1304
- l({ chrome: !o.chrome });
1305
- break;
1306
1643
  case "K":
1307
- l({ keyboardMode: !o.keyboardMode });
1644
+ c({ keyboardMode: !a.keyboardMode });
1308
1645
  break;
1309
1646
  case "P":
1310
- l({ inspector: !o.inspector });
1647
+ c({ inspector: !a.inspector });
1311
1648
  break;
1312
1649
  default:
1313
1650
  return;
@@ -1315,116 +1652,127 @@ function st({ product: e }) {
1315
1652
  _.preventDefault();
1316
1653
  }
1317
1654
  };
1318
- return window.addEventListener("keydown", k), () => window.removeEventListener("keydown", k);
1319
- }, [o.chrome, o.keyboardMode, o.inspector, l]);
1320
- const L = y(() => o.persona && o.persona !== b?.persona ? t.persona(o.persona)?.permissions ?? [] : t.permissionsOf(b), [o.persona, t, b]), B = y(
1655
+ return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
1656
+ }, [a.keyboardMode, a.inspector, c]);
1657
+ const P = x(() => a.persona && a.persona !== l?.persona ? t.persona(a.persona)?.permissions ?? [] : t.permissionsOf(l), [a.persona, t, l]), B = x(
1321
1658
  () => ({
1322
- scenario: b,
1659
+ scenario: l,
1323
1660
  persona: w,
1324
- permissions: L,
1325
- can: (k) => L.includes(k),
1326
- data: R,
1327
- fixture: T,
1328
- network: o.network,
1661
+ permissions: P,
1662
+ can: (S) => P.includes(S),
1663
+ data: $,
1664
+ fixture: L,
1665
+ network: a.network,
1329
1666
  isLoading: I,
1330
- error: D,
1331
- rules: t.rulesOf(b),
1332
- viewport: d,
1333
- themeMode: o.themeMode,
1334
- locale: o.locale,
1667
+ error: O,
1668
+ rules: t.rulesOf(l),
1669
+ viewport: r,
1670
+ themeMode: a.themeMode,
1671
+ locale: a.locale,
1335
1672
  a11y: {
1336
- keyboardMode: o.keyboardMode,
1337
- reducedMotion: o.reducedMotion,
1338
- textScale: o.textScale
1673
+ keyboardMode: a.keyboardMode,
1674
+ reducedMotion: a.reducedMotion,
1675
+ textScale: a.textScale
1339
1676
  },
1340
- navigate: m,
1341
- openScenario: i
1677
+ navigate: p,
1678
+ openScenario: h
1342
1679
  }),
1343
1680
  [
1344
- b,
1681
+ l,
1345
1682
  w,
1683
+ P,
1684
+ $,
1346
1685
  L,
1347
- R,
1348
- T,
1349
- o.network,
1350
- o.themeMode,
1351
- o.locale,
1352
- o.keyboardMode,
1353
- o.reducedMotion,
1354
- o.textScale,
1686
+ a.network,
1687
+ a.themeMode,
1688
+ a.locale,
1689
+ a.keyboardMode,
1690
+ a.reducedMotion,
1691
+ a.textScale,
1355
1692
  I,
1356
- D,
1693
+ O,
1357
1694
  t,
1358
- d,
1359
- m,
1360
- i
1695
+ r,
1696
+ p,
1697
+ h
1361
1698
  ]
1362
- ), ee = !b && r.path === "/", $ = ve(e.routes, r.path), W = e.wrapper, j = e.notFound, H = $ ? /* @__PURE__ */ a($.definition.screen, { params: $.params, context: B }) : j ? /* @__PURE__ */ a(j, { path: r.path }) : /* @__PURE__ */ a(Ve, { title: n.shell.noRoute, children: /* @__PURE__ */ c("p", { children: [
1363
- /* @__PURE__ */ a("code", { children: r.path }),
1699
+ ), K = !l && !g && i.path === "/", R = ye(e.routes, i.path), W = e.wrapper, j = e.notFound, f = g?.preview, v = f ? /* @__PURE__ */ o(f, {}) : R ? /* @__PURE__ */ o(R.definition.screen, { params: R.params, context: B }) : j ? /* @__PURE__ */ o(j, { path: i.path }) : /* @__PURE__ */ o(rt, { title: n.shell.noRoute, children: /* @__PURE__ */ d("p", { children: [
1700
+ /* @__PURE__ */ o("code", { children: i.path }),
1364
1701
  " ",
1365
1702
  n.shell.noRouteHint
1366
- ] }) }), te = W ? /* @__PURE__ */ a(W, { context: B, children: H }) : H;
1367
- return /* @__PURE__ */ a(J.Provider, { value: n, children: /* @__PURE__ */ c(
1703
+ ] }) }), k = W ? /* @__PURE__ */ o(W, { context: B, children: v }) : v;
1704
+ return /* @__PURE__ */ o(oe.Provider, { value: n, children: /* @__PURE__ */ d(
1368
1705
  "div",
1369
1706
  {
1370
1707
  className: "ds-root",
1371
- "data-chrome": o.chrome ? "visible" : "hidden",
1372
- "data-inspector": o.inspector ? "open" : "closed",
1373
- "data-sidebar": p ? "open" : "closed",
1374
- "data-viewport": d.id,
1708
+ "data-chrome": a.chrome ? "visible" : "hidden",
1709
+ "data-appearance": a.chromeTheme ?? "dark",
1710
+ "data-inspector": a.inspector ? "open" : "closed",
1711
+ "data-viewport": r.id,
1375
1712
  children: [
1376
- o.chrome && /* @__PURE__ */ a(
1377
- Ie,
1713
+ a.chrome && /* @__PURE__ */ o(
1714
+ Ue,
1378
1715
  {
1379
1716
  product: e,
1380
- scenario: b,
1717
+ scenario: l,
1381
1718
  deploy: s,
1382
- inspectorOpen: o.inspector,
1383
- sidebarOpen: p,
1384
- onToggleInspector: () => l({ inspector: !o.inspector }),
1385
- onToggleSidebar: () => g((k) => !k),
1386
- onHideChrome: () => l({ chrome: !1 })
1719
+ inspectorOpen: a.inspector,
1720
+ chromeTheme: a.chromeTheme ?? "dark",
1721
+ onToggleInspector: () => c({ inspector: !a.inspector }),
1722
+ onToggleChromeTheme: () => c({ chromeTheme: a.chromeTheme === "light" ? "dark" : "light" })
1387
1723
  }
1388
1724
  ),
1389
- o.chrome && /* @__PURE__ */ a(
1390
- Re,
1725
+ a.chrome && /* @__PURE__ */ o(
1726
+ We,
1391
1727
  {
1392
1728
  registry: t,
1393
- activeScenario: o.scenario,
1394
- onOpenScenario: i
1729
+ activeScenario: l,
1730
+ activeComponent: a.component,
1731
+ controls: a,
1732
+ onOpenScenario: h,
1733
+ onOpenComponent: u
1395
1734
  }
1396
1735
  ),
1397
- /* @__PURE__ */ c("div", { className: "ds-stage-area", children: [
1398
- ee ? /* @__PURE__ */ a("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ a(qe, { registry: t, onOpenScenario: i }) }) : /* @__PURE__ */ a(
1399
- Ue,
1736
+ /* @__PURE__ */ d("div", { className: "ds-stage-area", children: [
1737
+ K ? /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(st, { registry: t, onOpenScenario: h }) }) : /* @__PURE__ */ o(
1738
+ nt,
1400
1739
  {
1401
- ref: v,
1402
- viewport: d,
1403
- textScale: o.textScale,
1404
- reducedMotion: o.reducedMotion,
1405
- keyboardMode: o.keyboardMode,
1406
- children: te
1740
+ ref: m,
1741
+ viewport: r,
1742
+ textScale: a.textScale,
1743
+ reducedMotion: a.reducedMotion,
1744
+ keyboardMode: a.keyboardMode,
1745
+ children: k
1407
1746
  }
1408
1747
  ),
1409
- o.chrome && /* @__PURE__ */ a(De, { registry: t, controls: o, onChange: l })
1748
+ a.chrome && /* @__PURE__ */ o(
1749
+ Ye,
1750
+ {
1751
+ registry: t,
1752
+ controls: a,
1753
+ scenarioActive: !!l,
1754
+ onChange: c
1755
+ }
1756
+ )
1410
1757
  ] }),
1411
- o.chrome && /* @__PURE__ */ a(
1412
- Be,
1758
+ a.chrome && /* @__PURE__ */ o(
1759
+ Qe,
1413
1760
  {
1414
1761
  registry: t,
1415
- scenario: b,
1416
- controls: o,
1417
- focusedNode: u,
1418
- tabStopCount: h.length
1762
+ scenario: l,
1763
+ component: g,
1764
+ controls: a,
1765
+ focusedNode: N,
1766
+ tabStopCount: y.length
1419
1767
  }
1420
1768
  ),
1421
- o.keyboardMode && /* @__PURE__ */ a(Ke, { stops: h }),
1422
- !o.chrome && /* @__PURE__ */ a(
1769
+ a.keyboardMode && /* @__PURE__ */ o(at, { stops: y }),
1770
+ !a.chrome && /* @__PURE__ */ o(
1423
1771
  "button",
1424
1772
  {
1425
1773
  type: "button",
1426
1774
  className: "ds-chrome ds-restore",
1427
- onClick: () => l({ chrome: !0 }),
1775
+ onClick: () => c({ chrome: !0 }),
1428
1776
  children: n.shell.restoreChrome
1429
1777
  }
1430
1778
  )
@@ -1432,75 +1780,76 @@ function st({ product: e }) {
1432
1780
  }
1433
1781
  ) });
1434
1782
  }
1435
- function A(e) {
1783
+ function H(e) {
1436
1784
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
1437
1785
  }
1438
- function ot(e, t) {
1439
- const n = A(e), s = A(t);
1440
- let r = s.getFullYear() - n.getFullYear();
1441
- const o = s.getMonth() - n.getMonth();
1442
- return (o < 0 || o === 0 && s.getDate() < n.getDate()) && (r -= 1), r;
1786
+ function kt(e, t) {
1787
+ const n = H(e), s = H(t);
1788
+ let i = s.getFullYear() - n.getFullYear();
1789
+ const a = s.getMonth() - n.getMonth();
1790
+ return (a < 0 || a === 0 && s.getDate() < n.getDate()) && (i -= 1), i;
1443
1791
  }
1444
- function it(e, t) {
1445
- const n = A(e), s = A(t);
1792
+ function yt(e, t) {
1793
+ const n = H(e), s = H(t);
1446
1794
  return Math.floor((s.getTime() - n.getTime()) / 864e5);
1447
1795
  }
1448
1796
  export {
1449
- lt as CONTRAST_THRESHOLDS,
1450
- S as DEFAULT_LABELS,
1451
- st as DesignSpace,
1452
- qe as Home,
1453
- rt as KEYBOARD_LABELS,
1454
- nt as NETWORK_LABELS,
1455
- Y as NETWORK_STATES,
1456
- f as PARAM,
1457
- ut as SCENARIO_STATUSES,
1458
- we as SLOW_NETWORK_DELAY_MS,
1459
- tt as STATUS_LABELS,
1460
- at as STATUS_MEANING,
1461
- Ne as SimulatedNetworkError,
1462
- Ue as Stage,
1463
- Ve as StageEmpty,
1464
- Q as TEXT_SCALES,
1465
- Ke as TabOrderOverlay,
1466
- G as VIEWPORTS,
1467
- ot as ageInYears,
1468
- ht as applyOverrides,
1469
- mt as assertContrastPairs,
1470
- pt as checkContrastPair,
1471
- de as checkContrastPairs,
1472
- bt as commitUrl,
1473
- Me as computeRole,
1474
- ft as contrastRatio,
1475
- et as createHttpAdapter,
1476
- le as createRegistry,
1477
- it as daysBetween,
1478
- xe as describeElement,
1479
- O as fixtureAdapter,
1480
- vt as flatten,
1481
- gt as formatIssues,
1482
- ce as getDeployContext,
1483
- wt as hasErrors,
1484
- fe as matchPath,
1485
- Nt as parseColor,
1486
- ue as parseControls,
1487
- A as parseIsoDate,
1488
- kt as readCssVariable,
1489
- _t as relativeLuminance,
1490
- P as resolveFixture,
1491
- Oe as resolveLabels,
1492
- ve as resolveRoute,
1493
- me as resolveViewport,
1494
- ie as scenarioUrl,
1495
- U as serializeControls,
1496
- yt as serializeValue,
1497
- $e as shortSelector,
1498
- Fe as tabbableElements,
1499
- he as useDesignSpaceState,
1500
- Pe as useKeyboardMode,
1501
- N as useLabels,
1797
+ xt as CONTRAST_THRESHOLDS,
1798
+ C as DEFAULT_LABELS,
1799
+ wt as DesignSpace,
1800
+ mt as EN_US_LABELS,
1801
+ st as Home,
1802
+ vt as KEYBOARD_LABELS,
1803
+ gt as NETWORK_LABELS,
1804
+ ee as NETWORK_STATES,
1805
+ b as PARAM,
1806
+ ie as SCENARIO_STATUSES,
1807
+ Se as SLOW_NETWORK_DELAY_MS,
1808
+ ft as STATUS_LABELS,
1809
+ bt as STATUS_MEANING,
1810
+ xe as SimulatedNetworkError,
1811
+ nt as Stage,
1812
+ rt as StageEmpty,
1813
+ pe as TEXT_SCALES,
1814
+ at as TabOrderOverlay,
1815
+ te as VIEWPORTS,
1816
+ kt as ageInYears,
1817
+ Mt as applyOverrides,
1818
+ _t as assertContrastPairs,
1819
+ Ct as checkContrastPair,
1820
+ le as checkContrastPairs,
1821
+ Tt as commitUrl,
1822
+ Ae as computeRole,
1823
+ Lt as contrastRatio,
1824
+ pt as createHttpAdapter,
1825
+ he as createRegistry,
1826
+ yt as daysBetween,
1827
+ Le as describeElement,
1828
+ q as fixtureAdapter,
1829
+ At as flatten,
1830
+ Et as formatIssues,
1831
+ ue as getDeployContext,
1832
+ $t as hasErrors,
1833
+ ke as matchPath,
1834
+ Pt as parseColor,
1835
+ me as parseControls,
1836
+ H as parseIsoDate,
1837
+ Rt as readCssVariable,
1838
+ Dt as relativeLuminance,
1839
+ V as resolveFixture,
1840
+ Be as resolveLabels,
1841
+ ye as resolveRoute,
1842
+ be as resolveViewport,
1843
+ de as scenarioUrl,
1844
+ z as serializeControls,
1845
+ Ft as serializeValue,
1846
+ Fe as shortSelector,
1847
+ Ie as tabbableElements,
1848
+ fe as useDesignSpaceState,
1849
+ Oe as useKeyboardMode,
1850
+ M as useLabels,
1502
1851
  _e as useScenarioData,
1503
- oe as validateProduct,
1504
- St as validateScenario
1852
+ ce as validateProduct,
1853
+ It as validateScenario
1505
1854
  };
1506
1855
  //# sourceMappingURL=index.js.map