@brucesantos/design-space 0.6.0 → 0.9.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +264 -0
  2. package/README.md +249 -122
  3. package/dist/adapters/useScenarioData.d.ts +2 -0
  4. package/dist/controls/params.d.ts +13 -5
  5. package/dist/controls/state.d.ts +44 -11
  6. package/dist/deploy/index.d.ts +4 -4
  7. package/dist/design-space.css +1 -1
  8. package/dist/frame/index.d.ts +93 -0
  9. package/dist/handoff/index.d.ts +3 -2
  10. package/dist/index-DxIx4GAk.js +439 -0
  11. package/dist/index-DxIx4GAk.js.map +1 -0
  12. package/dist/index.d.ts +7 -10
  13. package/dist/index.js +2107 -1993
  14. package/dist/index.js.map +1 -1
  15. package/dist/registry/index.d.ts +115 -27
  16. package/dist/shell/Canvas.d.ts +19 -0
  17. package/dist/shell/FrameView.d.ts +9 -0
  18. package/dist/shell/Panel.d.ts +38 -0
  19. package/dist/shell/Resizer.d.ts +14 -0
  20. package/dist/shell/Sidebar.d.ts +15 -7
  21. package/dist/shell/Stage.d.ts +0 -20
  22. package/dist/shell/Topbar.d.ts +20 -12
  23. package/dist/shell/icons.d.ts +9 -0
  24. package/dist/shell/labels.d.ts +85 -119
  25. package/dist/shell/prMarkdown.d.ts +43 -0
  26. package/dist/shell/storage.d.ts +14 -0
  27. package/dist/testing/index.d.ts +9 -11
  28. package/dist/testing.js +20 -31
  29. package/dist/testing.js.map +1 -1
  30. package/dist/types/index.d.ts +115 -119
  31. package/dist/version.d.ts +2 -0
  32. package/package.json +3 -3
  33. package/dist/a11y/accessible-tree.d.ts +0 -37
  34. package/dist/a11y/contrast.d.ts +0 -62
  35. package/dist/a11y/useKeyboardMode.d.ts +0 -23
  36. package/dist/contrast-B8xa1UIu.js +0 -389
  37. package/dist/contrast-B8xa1UIu.js.map +0 -1
  38. package/dist/shell/Controls.d.ts +0 -11
  39. package/dist/shell/Home.d.ts +0 -12
  40. package/dist/shell/Inspector.d.ts +0 -13
package/dist/index.js CHANGED
@@ -1,518 +1,485 @@
1
- import { jsxs as l, jsx as t, Fragment as A } from "react/jsx-runtime";
2
- import { useState as F, useEffect as D, useMemo as T, useCallback as R, useContext as Ne, createContext as Se, useRef as re, forwardRef as xe } from "react";
3
- import { S as be, h as ee, v as ye, a as te, p as _e, P as w, b as oe, N as ve, s as Me, c as Ce, g as Te, d as Ae, r as Pe } from "./contrast-B8xa1UIu.js";
4
- import { C as It, H as Bt, e as Ht, f as Wt, i as zt, j as Ut, k as jt, l as Kt, m as Vt, n as qt, o as Gt, q as Yt, t as Jt, u as Qt, w as Xt, x as Zt, y as eo, z as to } from "./contrast-B8xa1UIu.js";
5
- function Le(e) {
6
- const o = new Map(e.scenarios.map((s) => [s.id, s])), a = new Map(
7
- (e.components ?? []).map((s) => [s.id, s])
8
- ), i = new Map(e.personas.map((s) => [s.id, s])), d = new Map(e.fixtures.map((s) => [s.id, s])), r = new Map((e.rules ?? []).map((s) => [s.id, s])), n = new Map(e.modules.map((s) => [s.id, s])), c = new Map(
9
- e.modules.flatMap((s) => (s.flows ?? []).map((m) => [m.id, m]))
10
- ), h = e.modules.map((s) => ({
11
- module: s,
12
- scenarios: e.scenarios.filter((m) => m.id.split(".")[0] === s.id)
13
- })), u = new Set(h.flatMap((s) => s.scenarios.map((m) => m.id))), g = e.scenarios.filter((s) => !u.has(s.id)), f = (s) => s ? o.get(s) : void 0, p = (s) => s ? i.get(s) : void 0, b = (s, m) => {
14
- if (!(!s || !m))
15
- return a.get(s)?.fixtures?.find((k) => k.id === m);
16
- }, S = (s = {}) => e.scenarios.filter(
17
- (m) => te(s.handoff, m.id) && (s.includePorted || (s.view === "ported" ? m.status === "ported" : m.status !== "ported") || s.view === void 0 && m.id === s.activeScenario)
18
- ), _ = (s) => s ? s.permissions ? s.permissions : p(s.persona)?.permissions ?? [] : [];
1
+ import { jsx as n, jsxs as b, Fragment as G } from "react/jsx-runtime";
2
+ import { useState as D, useRef as q, useEffect as V, useMemo as A, useCallback as B, useContext as it, createContext as ct, useLayoutEffect as Ke } from "react";
3
+ import { r as Se, h as oe, v as lt, a as we, b as Ve, p as dt, P as _, c as Ue, C as Ie, d as Me, e as ae, t as de, f as Ne, g as ut, N as We, i as He, s as he, j as xe, k as ht, l as _e, F as pt, m as mt, n as ft, o as wt } from "./index-DxIx4GAk.js";
4
+ import { q as wn, H as gn, u as vn, w as bn, x as kn, y as Cn, z as Sn, A as Nn, B as xn, D as yn } from "./index-DxIx4GAk.js";
5
+ function gt(e) {
6
+ const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((a) => [a.id, a])), l = new Map(o.map((a) => [a.id, a])), c = new Map((e.personas ?? []).map((a) => [a.id, a])), i = new Map((e.fixtures ?? []).map((a) => [a.id, a])), h = new Map((e.rules ?? []).map((a) => [a.id, a])), m = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
7
+ for (const a of t) {
8
+ const g = Se(s, a.route ?? "");
9
+ if (!g) continue;
10
+ const S = g.definition.path;
11
+ d.set(a.id, S);
12
+ const R = m.get(S) ?? [];
13
+ R.push(a), m.set(S, R);
14
+ }
15
+ const u = /* @__PURE__ */ new Set(), f = [];
16
+ for (const a of s) {
17
+ if (u.has(a.path)) continue;
18
+ u.add(a.path);
19
+ const g = m.get(a.path) ?? [];
20
+ f.push({
21
+ id: a.path,
22
+ name: a.name?.trim() || g[0]?.title || a.path,
23
+ description: a.description,
24
+ route: a,
25
+ href: kt(a.path),
26
+ variations: g,
27
+ group: a.group?.trim() || void 0,
28
+ controls: Array.isArray(a.controls) ? a.controls : []
29
+ });
30
+ }
31
+ const v = new Map(f.map((a) => [a.id, a])), k = (a) => a ? r.get(a) : void 0, C = (a) => a ? c.get(a) : void 0, N = (a, g) => {
32
+ if (!(!a || !g))
33
+ return l.get(a)?.fixtures?.find((S) => S.id === g);
34
+ }, w = (a = {}) => t.filter((g) => oe(a.handoff, g.id)), x = (a) => {
35
+ const g = Se(s, a);
36
+ return g ? v.get(g.definition.path) : void 0;
37
+ }, $ = (a = {}) => {
38
+ const { handoff: g } = a;
39
+ return g ? f.map((S) => ({
40
+ ...S,
41
+ variations: S.variations.filter((R) => oe(g, R.id))
42
+ })).filter(
43
+ (S) => S.variations.length > 0 || (g.routes ?? []).length > 0 && Ve(g, S.href)
44
+ ) : f;
45
+ }, y = (a) => a ? a.permissions ? a.permissions : C(a.persona)?.permissions ?? [] : [], L = (a = {}) => Be($(a)), p = (a, g) => {
46
+ const S = new Set(a?.route.components ?? []), R = g ? [g] : a?.variations ?? [];
47
+ for (const M of R)
48
+ for (const W of M.components ?? []) S.add(W);
49
+ return [...S];
50
+ }, E = (a) => o.filter((g) => we(a, g.id));
19
51
  return {
20
52
  product: e,
21
- tree: h,
22
- orphans: g,
23
- issues: ye(e),
24
- scenario: f,
25
- component: (s) => s ? a.get(s) : void 0,
26
- componentFixture: b,
27
- resolveComponentFixture: (s, m) => {
28
- const k = s ? a.get(s) : void 0, M = b(s, m), y = b(s, k?.defaultFixture) ?? k?.fixtures?.[0];
53
+ screens: f,
54
+ issues: lt(e),
55
+ scenario: k,
56
+ component: (a) => a ? l.get(a) : void 0,
57
+ componentFixture: N,
58
+ resolveComponentFixture: (a, g) => {
59
+ const S = a ? l.get(a) : void 0, R = N(a, g), M = N(a, S?.defaultFixture) ?? S?.fixtures?.[0];
29
60
  return {
30
- fixture: M ?? y,
31
- requestedId: m,
32
- didFallback: !!(m && !M)
61
+ fixture: R ?? M,
62
+ requestedId: g,
63
+ didFallback: !!(g && !R)
33
64
  };
34
65
  },
35
- persona: p,
36
- fixture: (s) => s ? d.get(s) : void 0,
37
- rule: (s) => s ? r.get(s) : void 0,
38
- module: (s) => s ? n.get(s) : void 0,
39
- flow: (s) => s ? c.get(s) : void 0,
40
- rulesOf: (s) => (s?.rules ?? []).map((m) => r.get(m)).filter((m) => !!m),
41
- permissionsOf: _,
42
- scenariosForRoute: (s, m) => {
43
- const k = s.split("?")[0];
44
- return S(m).filter((M) => M.route.split("?")[0] === k);
66
+ persona: C,
67
+ fixture: (a) => a ? i.get(a) : void 0,
68
+ rule: (a) => a ? h.get(a) : void 0,
69
+ screen: (a) => a ? v.get(a) : void 0,
70
+ screenForPath: x,
71
+ screenOf: (a) => {
72
+ const g = a ? d.get(a.id) : void 0;
73
+ return g ? v.get(g) : void 0;
45
74
  },
46
- activeScenarios: S,
47
- treeFor: (s) => {
48
- const m = new Set(S(s).map((k) => k.id));
49
- return h.map((k) => ({
50
- ...k,
51
- scenarios: k.scenarios.filter((M) => m.has(M.id))
52
- }));
75
+ screensFor: $,
76
+ flows: L,
77
+ flowOf: (a, g) => {
78
+ if (a)
79
+ return L(g).find((S) => S.name === a.group);
53
80
  },
54
- orphansFor: (s) => {
55
- const m = new Set(S(s).map((k) => k.id));
56
- return g.filter((k) => m.has(k.id));
81
+ controlsOf: (a) => (a?.controls ?? []).flatMap((g) => g.controls ?? []),
82
+ resolveControls: (a, g = {}) => vt(a?.controls ?? [], g),
83
+ rulesOf: (a) => (a?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
84
+ permissionsOf: y,
85
+ scenariosForRoute: (a, g) => {
86
+ const S = x(a);
87
+ return S ? S.variations.filter((R) => oe(g?.handoff, R.id)) : [];
57
88
  },
58
- search: (s, m) => {
59
- const k = pe(s), M = S(m);
60
- return k ? M.filter((y) => {
61
- const E = n.get(y.id.split(".")[0] ?? "")?.name ?? "";
62
- return pe(
89
+ activeScenarios: w,
90
+ search: (a, g) => {
91
+ const S = X(a), R = w(g);
92
+ return S ? R.filter(
93
+ (M) => X(
63
94
  [
64
- y.title,
65
- y.id,
66
- y.intent ?? "",
67
- y.route,
68
- E,
69
- i.get(y.persona)?.name ?? "",
70
- (y.tags ?? []).join(" "),
71
- (y.expected ?? []).join(" ")
95
+ M.title,
96
+ M.id,
97
+ M.intent ?? "",
98
+ M.route,
99
+ C(M.persona)?.name ?? "",
100
+ (M.tags ?? []).join(" "),
101
+ (M.expected ?? []).join(" ")
72
102
  ].join(" ")
73
- ).includes(k);
74
- }) : M;
103
+ ).includes(S)
104
+ ) : R;
75
105
  },
76
- byStatus: (s, m) => S({ ...m, includePorted: !0 }).filter((k) => k.status === s),
77
- componentsFor: (s) => (e.components ?? []).filter(
78
- (m) => ee(s, m.id)
79
- ),
80
- coverage: (s) => {
81
- const m = Object.fromEntries(
82
- be.map((k) => [k, 0])
83
- );
84
- for (const k of S(s)) m[k.status] += 1;
85
- return m;
86
- }
106
+ searchScreens: (a, g) => {
107
+ const S = X(a), R = $(g);
108
+ return S ? R.filter(
109
+ (M) => X(
110
+ [
111
+ M.name,
112
+ M.description ?? "",
113
+ M.id,
114
+ M.group ?? "",
115
+ ...M.variations.flatMap((W) => [
116
+ W.title,
117
+ W.id,
118
+ (W.tags ?? []).join(" ")
119
+ ])
120
+ ].join(" ")
121
+ ).includes(S)
122
+ ) : R;
123
+ },
124
+ searchComponents: (a, g) => {
125
+ const S = X(a), R = E(g);
126
+ return S ? R.filter(
127
+ (M) => X(
128
+ [
129
+ M.name,
130
+ M.description ?? "",
131
+ M.group ?? "",
132
+ M.id,
133
+ M.source ?? ""
134
+ ].join(" ")
135
+ ).includes(S)
136
+ ) : R;
137
+ },
138
+ componentsFor: E,
139
+ componentsOfScreen: (a, g) => p(a, g).map((S) => l.get(S)).filter((S) => !!S),
140
+ usagesOf: (a, g) => a ? $(g).filter(
141
+ (S) => S.route.components?.includes(a) || S.variations.some((R) => R.components?.includes(a))
142
+ ) : []
87
143
  };
88
144
  }
89
- function pe(e) {
90
- return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
145
+ function X(e) {
146
+ return e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
147
+ }
148
+ function Be(e) {
149
+ const t = [], s = /* @__PURE__ */ new Map();
150
+ for (const r of e) {
151
+ if (!r.group) {
152
+ t.push(r);
153
+ continue;
154
+ }
155
+ const l = s.get(r.group) ?? [];
156
+ l.push(r), s.set(r.group, l);
157
+ }
158
+ const o = [...s].map(([r, l]) => ({ name: r, screens: l }));
159
+ return t.length > 0 ? [{ name: void 0, screens: t }, ...o] : o;
160
+ }
161
+ function ge(e) {
162
+ const t = e.options ?? [];
163
+ return e.default !== void 0 && t.some((s) => s.value === e.default) ? e.default : t[0]?.value ?? "";
91
164
  }
92
- const ge = [
165
+ function vt(e, t = {}) {
166
+ const s = {}, o = [], r = /* @__PURE__ */ new Set(), l = t.requested ?? {};
167
+ for (const c of e)
168
+ for (const i of c.controls ?? []) {
169
+ if (r.has(i.id)) continue;
170
+ r.add(i.id);
171
+ const h = (f) => f !== void 0 && (i.options ?? []).some((v) => v.value === f);
172
+ let m = ge(i);
173
+ const d = t.scenario?.controls?.[i.id];
174
+ h(d) && (m = d);
175
+ const u = l[i.id];
176
+ u !== void 0 && (h(u) ? m = u : o.push({ id: i.id, value: u, reason: "invalid-value", fallback: m })), s[i.id] = m;
177
+ }
178
+ for (const [c, i] of Object.entries(l))
179
+ r.has(c) || o.push({ id: c, value: i, reason: "unknown-control" });
180
+ return { values: s, invalid: o };
181
+ }
182
+ function bt(e, t) {
183
+ return e ? Object.entries(e.controls ?? {}).every(([s, o]) => t?.[s] === o) : !1;
184
+ }
185
+ function kt(e) {
186
+ const t = e.split("/").filter(Boolean);
187
+ return t[t.length - 1] === "*" && t.pop(), `/${t.join("/")}`;
188
+ }
189
+ const Ct = [
190
+ { id: "mobile", label: "Celular", width: 375, height: 812 },
191
+ { id: "tablet", label: "Tablet", width: 768, height: 1024 },
192
+ { id: "desktop", label: "Desktop", width: 1280, height: 800 },
93
193
  { id: "fit", label: "Ajustar" },
94
- { id: "mobile", label: "Celular", width: 390, height: 844 },
95
- { id: "tablet", label: "Tablet", width: 834, height: 1112 },
96
- { id: "desktop", label: "Desktop", width: 1440, height: 900 },
97
194
  { id: "custom", label: "Personalizado" }
98
- ], Fe = [1, 1.25, 1.5, 2];
99
- function $e(e, o) {
100
- const a = new URLSearchParams(e), i = _e(a), d = a.get(w.component) ?? void 0, r = ee(i, d) ? o.component(d) : void 0, n = a.get(w.scenario) ?? void 0, c = r || !te(i, n) ? void 0 : o.scenario(n), h = a.get(w.fixture) ?? void 0, u = r ? h ?? o.componentFixture(r.id, r.defaultFixture)?.id ?? r.fixtures?.[0]?.id : void 0, g = a.get(w.network), f = Number(a.get(w.textScale)), p = a.get(w.view), b = c?.status === "ported" || p === "ported" || a.get(w.showPorted) === "1" ? "ported" : "active";
195
+ ], Le = 25, Te = 150, pe = 100;
196
+ function je(e, t, s) {
197
+ const o = s !== void 0 ? e.screenForPath(s) : e.screenOf(t), r = t && o && e.screenOf(t)?.id === o.id ? t : void 0;
198
+ return { screen: o, scenario: r };
199
+ }
200
+ function St(e, t, s) {
201
+ const o = new URLSearchParams(e), r = dt(o), l = o.get(_.component) ?? void 0, c = we(r, l) ? t.component(l) : void 0, i = o.get(_.scenario) ?? void 0, h = c || !oe(r, i) ? void 0 : t.scenario(i), m = o.get(_.fixture) ?? void 0, d = c ? m ?? t.componentFixture(c.id, c.defaultFixture)?.id ?? c.fixtures?.[0]?.id : void 0, u = o.get(_.network), f = c ? void 0 : je(t, h, s), v = f?.screen && f.screen.controls.length > 0 ? t.resolveControls(f.screen, {
202
+ scenario: f.scenario,
203
+ requested: Ue(o)
204
+ }).values : void 0;
101
205
  return {
102
- scenario: c?.id,
103
- handoff: i,
104
- view: b,
105
- showPorted: b === "ported",
106
- component: r?.id,
107
- persona: a.get(w.persona) ?? c?.persona,
108
- fixture: r ? u : h ?? c?.fixture,
109
- network: De(g) ? g : c?.network ?? "success",
110
- viewport: a.get(w.viewport) ?? "fit",
111
- customWidth: Ie(a.get(w.customWidth)),
112
- themeMode: a.get(w.themeMode) ?? o.product.theme?.modes?.[0],
113
- locale: a.get(w.locale) ?? o.product.theme?.locales?.[0],
114
- dataSource: a.get(w.dataSource) ?? o.product.dataSources?.default ?? "fixtures",
115
- chromeTheme: Oe(a.get(w.chromeTheme)) ? a.get(w.chromeTheme) : "dark",
206
+ scenario: h?.id,
207
+ handoff: r,
208
+ component: c?.id,
209
+ persona: o.get(_.persona) ?? h?.persona,
210
+ fixture: c ? d : m ?? h?.fixture,
211
+ network: xt(u) ? u : h?.network ?? "success",
212
+ viewport: o.get(_.viewport) ?? "fit",
213
+ customWidth: Mt(o.get(_.customWidth)),
214
+ themeMode: o.get(_.themeMode) ?? t.product.theme?.modes?.[0],
215
+ locale: o.get(_.locale) ?? t.product.theme?.locales?.[0],
216
+ dataSource: o.get(_.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
217
+ // Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
218
+ // última escolha da pessoa e, na falta dela, pelo sistema.
219
+ chromeTheme: yt(o.get(_.chromeTheme)) ? o.get(_.chromeTheme) : void 0,
116
220
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
117
221
  // de tela, então precisa ser explícito para não sumir sem pedido.
118
- chrome: a.get(w.chrome) !== "0",
119
- keyboardMode: a.get(w.keyboardMode) === "1",
120
- reducedMotion: a.get(w.reducedMotion) === "1",
121
- textScale: Fe.includes(f) ? f : 1,
122
- inspector: a.get(w.inspector) !== "0"
222
+ chrome: o.get(_.chrome) !== "0",
223
+ inspector: o.get(_.inspector) !== "0",
224
+ panelTab: $t(o.get(_.panelTab)) ? o.get(_.panelTab) : "variations",
225
+ zoom: qe(o.get(_.zoom)),
226
+ rotated: o.get(_.rotated) === "1",
227
+ screenControls: v
123
228
  };
124
229
  }
125
- function X(e, o) {
126
- const a = new URLSearchParams(), i = o.scenario(e.scenario);
127
- e.component ? a.set(w.component, e.component) : e.scenario && a.set(w.scenario, e.scenario), ce(e) === "ported" && a.set(w.view, "ported"), e.persona && e.persona !== i?.persona && a.set(w.persona, e.persona), e.component && e.fixture ? a.set(w.fixture, e.fixture) : e.fixture && e.fixture !== i?.fixture && a.set(w.fixture, e.fixture), e.network !== (i?.network ?? "success") && a.set(w.network, e.network), e.viewport !== "fit" && a.set(w.viewport, e.viewport), e.viewport === "custom" && e.customWidth && a.set(w.customWidth, String(e.customWidth));
128
- const d = o.product.theme?.modes?.[0];
129
- e.themeMode && e.themeMode !== d && a.set(w.themeMode, e.themeMode);
130
- const r = o.product.theme?.locales?.[0];
131
- e.locale && e.locale !== r && a.set(w.locale, e.locale);
132
- const n = o.product.dataSources?.default ?? "fixtures";
133
- e.dataSource && e.dataSource !== n && a.set(w.dataSource, e.dataSource), e.chromeTheme === "light" && a.set(w.chromeTheme, "light"), e.chrome || a.set(w.chrome, "0"), e.keyboardMode && a.set(w.keyboardMode, "1"), e.reducedMotion && a.set(w.reducedMotion, "1"), e.textScale !== 1 && a.set(w.textScale, String(e.textScale)), e.inspector || a.set(w.inspector, "0"), oe(a, e.handoff);
134
- const c = a.toString();
135
- return c ? `?${c}` : "";
136
- }
137
- function Ee(e) {
138
- const [o, a] = F(() => ue());
139
- D(() => {
140
- const f = () => a(ue());
141
- return window.addEventListener("popstate", f), () => window.removeEventListener("popstate", f);
142
- }, []);
143
- const i = T(() => $e(o.search, e), [o.search, e]), d = R((f, p, b = !1) => {
144
- const S = `${f}${p}`;
145
- b ? window.history.replaceState(null, "", S) : window.history.pushState(null, "", S), a({ path: f, search: p });
146
- }, []), r = R(
147
- (f) => {
148
- const p = f.view ?? (f.showPorted === void 0 ? void 0 : f.showPorted ? "ported" : "active"), b = {
149
- ...i,
150
- ...f,
151
- ...p ? { view: p, showPorted: p === "ported" } : {}
152
- };
153
- d(o.path, X(b, e), !0);
230
+ function se(e, t, s) {
231
+ const o = new URLSearchParams(), r = t.scenario(e.scenario);
232
+ if (e.component ? o.set(_.component, e.component) : e.scenario && o.set(_.scenario, e.scenario), e.persona && e.persona !== r?.persona && o.set(_.persona, e.persona), e.component && e.fixture ? o.set(_.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && o.set(_.fixture, e.fixture), e.network !== (r?.network ?? "success") && o.set(_.network, e.network), e.screenControls && !e.component) {
233
+ const d = je(t, r, s), u = d.screen ? t.resolveControls(d.screen, { scenario: d.scenario }).values : {}, f = d.screen ? t.controlsOf(d.screen).map((v) => v.id) : Object.keys(e.screenControls);
234
+ for (const v of f) {
235
+ const k = e.screenControls[v];
236
+ k !== void 0 && k !== u[v] && o.set(`${Ie}${v}`, k);
237
+ }
238
+ }
239
+ e.viewport !== "fit" && o.set(_.viewport, e.viewport), e.viewport === "custom" && e.customWidth && o.set(_.customWidth, String(e.customWidth));
240
+ const l = t.product.theme?.modes?.[0];
241
+ e.themeMode && e.themeMode !== l && o.set(_.themeMode, e.themeMode);
242
+ const c = t.product.theme?.locales?.[0];
243
+ e.locale && e.locale !== c && o.set(_.locale, e.locale);
244
+ const i = t.product.dataSources?.default ?? "fixtures";
245
+ e.dataSource && e.dataSource !== i && o.set(_.dataSource, e.dataSource), e.chromeTheme && o.set(_.chromeTheme, e.chromeTheme), e.chrome || o.set(_.chrome, "0"), e.inspector || o.set(_.inspector, "0"), e.panelTab === "info" && o.set(_.panelTab, "info");
246
+ const h = qe(e.zoom === void 0 ? null : String(e.zoom));
247
+ h !== pe && o.set(_.zoom, String(h)), e.rotated && o.set(_.rotated, "1"), Me(o, e.handoff);
248
+ const m = o.toString();
249
+ return m ? `?${m}` : "";
250
+ }
251
+ function Ge(e, t = {}) {
252
+ const s = !!t.frame, [o, r] = D(() => ve()), l = q(o);
253
+ l.current = o, V(() => {
254
+ const C = () => r(ve());
255
+ return window.addEventListener("popstate", C), () => window.removeEventListener("popstate", C);
256
+ }, []), V(() => {
257
+ if (!s || window.parent === window) return;
258
+ const C = window.location.origin, N = (x) => {
259
+ const $ = He(x, { origin: C, source: window.parent });
260
+ if ($?.type !== "location") return;
261
+ const { path: y, search: L } = Ne($.url);
262
+ window.history.replaceState(null, "", de(y, L)), r({ path: y, search: L });
263
+ };
264
+ window.addEventListener("message", N);
265
+ const w = ve();
266
+ return ae(
267
+ window.parent,
268
+ { ds: 1, type: "ready", url: de(w.path, w.search) },
269
+ C
270
+ ), () => window.removeEventListener("message", N);
271
+ }, [s]);
272
+ const c = A(
273
+ () => St(o.search, e, o.path),
274
+ [o.path, o.search, e]
275
+ ), i = B(
276
+ (C, N, w = !1) => {
277
+ if (s) {
278
+ const $ = de(C, N), y = Ne($);
279
+ window.history.replaceState(null, "", $), r(y), ae(
280
+ window.parent === window ? void 0 : window.parent,
281
+ { ds: 1, type: "navigate", url: $, replace: w },
282
+ window.location.origin
283
+ );
284
+ return;
285
+ }
286
+ const x = `${C}${N}`;
287
+ w ? window.history.replaceState(null, "", x) : window.history.pushState(null, "", x), r({ path: C, search: N });
154
288
  },
155
- [i, o.path, d, e]
156
- ), n = R(
157
- (f) => {
158
- const p = e.scenario(i.scenario), b = !p || (f === "ported" ? p.status === "ported" : p.status !== "ported"), S = {
159
- ...i,
160
- view: f,
161
- showPorted: f === "ported",
162
- ...b ? {} : {
163
- scenario: void 0,
164
- persona: void 0,
165
- fixture: void 0,
166
- network: "success"
167
- }
168
- };
169
- d(b ? o.path : "/", X(S, e), !1);
289
+ [s]
290
+ ), h = B(
291
+ (C) => {
292
+ const N = { ...c, ...C };
293
+ i(o.path, se(N, e, o.path), !0);
170
294
  },
171
- [i, o.path, d, e]
172
- ), c = R(
173
- (f, p) => {
174
- const [b, S] = f.split("?"), _ = b || "/", s = new URLSearchParams(S ?? o.search);
175
- i.handoff && oe(s, i.handoff);
176
- const m = s.toString(), k = m ? `?${m}` : "";
177
- d(_, k, p?.replace ?? !1);
295
+ [c, o.path, i, e]
296
+ ), m = B(
297
+ (C, N) => {
298
+ const [w, x] = C.split("?"), $ = w || "/", y = new URLSearchParams(x ?? o.search);
299
+ x === void 0 && e.screenForPath($)?.id !== e.screenForPath(o.path)?.id && ut(y), c.handoff && Me(y, c.handoff);
300
+ const L = y.toString(), p = L ? `?${L}` : "";
301
+ i($, p, N?.replace ?? !1);
178
302
  },
179
- [i.handoff, o.search, d]
180
- ), h = R(
181
- (f) => {
182
- const p = e.scenario(f);
183
- if (!p || !te(i.handoff, f)) return;
184
- const b = {
185
- ...i,
186
- scenario: p.id,
187
- view: p.status === "ported" ? "ported" : "active",
188
- showPorted: p.status === "ported",
303
+ [c.handoff, o.path, o.search, i, e]
304
+ ), d = B(
305
+ (C) => {
306
+ const N = e.scenario(C);
307
+ if (!N || !oe(c.handoff, C)) return;
308
+ const w = {
309
+ ...c,
310
+ scenario: N.id,
189
311
  component: void 0,
190
- persona: p.persona,
191
- fixture: p.fixture,
192
- network: p.network ?? "success"
312
+ persona: N.persona,
313
+ fixture: N.fixture,
314
+ network: N.network ?? "success",
315
+ // Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
316
+ screenControls: void 0
317
+ };
318
+ i(N.route, se(w, e, N.route), !1);
319
+ },
320
+ [c, i, e]
321
+ ), u = B(
322
+ (C, N) => {
323
+ const w = e.component(C);
324
+ if (!w || !we(c.handoff, C)) return;
325
+ const x = {
326
+ ...c,
327
+ scenario: void 0,
328
+ component: w.id,
329
+ persona: void 0,
330
+ fixture: void 0,
331
+ network: "success",
332
+ screenControls: void 0
193
333
  };
194
- d(p.route, X(b, e), !1);
334
+ x.fixture = e.componentFixture(w.id, w.defaultFixture)?.id ?? w.fixtures?.[0]?.id, i("/", se(x, e), N?.replace ?? !1);
195
335
  },
196
- [i, d, e]
197
- ), u = R(
198
- (f) => {
199
- const p = e.component(f);
200
- if (!p || !ee(i.handoff, f)) return;
201
- const b = {
202
- ...i,
336
+ [c, i, e]
337
+ ), f = B(
338
+ (C, N) => {
339
+ const w = e.screensFor({ handoff: c.handoff }).find((y) => y.id === C);
340
+ if (!w) return;
341
+ const x = w.variations[0];
342
+ if (x) {
343
+ const y = {
344
+ ...c,
345
+ scenario: x.id,
346
+ component: void 0,
347
+ persona: x.persona,
348
+ fixture: x.fixture,
349
+ network: x.network ?? "success",
350
+ screenControls: void 0
351
+ };
352
+ i(x.route, se(y, e, x.route), N?.replace ?? !1);
353
+ return;
354
+ }
355
+ const $ = {
356
+ ...c,
203
357
  scenario: void 0,
204
- component: p.id,
358
+ component: void 0,
205
359
  persona: void 0,
206
360
  fixture: void 0,
207
- network: "success"
361
+ network: "success",
362
+ screenControls: void 0
208
363
  };
209
- b.fixture = e.componentFixture(p.id, p.defaultFixture)?.id ?? p.fixtures?.[0]?.id, d("/", X(b, e), !1);
364
+ i(w.href, se($, e, w.href), N?.replace ?? !1);
210
365
  },
211
- [i, d, e]
212
- ), g = T(() => Re(i), [i]);
366
+ [c, i, e]
367
+ ), v = B(
368
+ (C, N, w) => i(C || "/", N, w?.replace ?? !1),
369
+ [i]
370
+ ), k = A(() => Nt(c), [c]);
213
371
  return {
214
372
  location: o,
215
- controls: i,
216
- viewport: g,
217
- setControls: r,
218
- setScenarioView: n,
219
- navigate: c,
220
- openScenario: h,
221
- openComponent: u
373
+ controls: c,
374
+ viewport: k,
375
+ setControls: h,
376
+ navigate: m,
377
+ openScenario: d,
378
+ openComponent: u,
379
+ openScreen: f,
380
+ go: v
222
381
  };
223
382
  }
224
- function ce(e) {
225
- return e.view ?? (e.showPorted ? "ported" : "active");
383
+ function Nt(e) {
384
+ if (e.viewport === "custom")
385
+ return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
386
+ const t = Ct.find((s) => s.id === e.viewport) ?? {
387
+ id: "fit",
388
+ label: "Ajustar"
389
+ };
390
+ return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
226
391
  }
227
- function Re(e) {
228
- const o = ge.find((a) => a.id === e.viewport);
229
- return e.viewport === "custom" ? { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 } : o ?? { id: "fit", label: "Ajustar" };
392
+ function qe(e) {
393
+ if (e === null) return pe;
394
+ const t = Number.parseInt(e, 10);
395
+ return Number.isFinite(t) ? Math.min(Te, Math.max(Le, t)) : pe;
230
396
  }
231
- function ue() {
397
+ function ve() {
232
398
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
233
399
  }
234
- function De(e) {
235
- return e !== null && ve.includes(e);
400
+ function xt(e) {
401
+ return e !== null && We.includes(e);
236
402
  }
237
- function Oe(e) {
403
+ function yt(e) {
238
404
  return e === "dark" || e === "light";
239
405
  }
240
- function Ie(e) {
241
- if (!e) return;
242
- const o = Number.parseInt(e, 10);
243
- return Number.isFinite(o) && o > 0 ? o : void 0;
244
- }
245
- const Be = 2500;
246
- class He extends Error {
247
- constructor(o) {
248
- super(`Falha de rede simulada no cenário "${o}".`), this.name = "SimulatedNetworkError";
249
- }
406
+ function $t(e) {
407
+ return e === "variations" || e === "info";
250
408
  }
251
- function se(e) {
252
- if (e)
253
- return typeof e.data == "function" ? e.data() : e.data;
409
+ function Mt(e) {
410
+ if (!e) return;
411
+ const t = Number.parseInt(e, 10);
412
+ return Number.isFinite(t) && t > 0 ? t : void 0;
254
413
  }
255
- const ie = {
256
- id: "fixtures",
257
- label: "Fixtures",
258
- load: async ({ scenario: e, fixture: o, network: a }) => {
259
- switch (a) {
260
- case "empty":
261
- return null;
262
- case "error":
263
- throw new He(e.id);
264
- case "loading":
265
- return new Promise(() => {
266
- });
267
- case "slow":
268
- return await We(Be), se(o);
269
- default:
270
- return se(o);
271
- }
272
- }
414
+ const Lt = "@brucesantos/design-space", Re = "0.9.0", Tt = {
415
+ mobile: /* @__PURE__ */ b(G, { children: [
416
+ /* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
417
+ /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
418
+ ] }),
419
+ tablet: /* @__PURE__ */ b(G, { children: [
420
+ /* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
421
+ /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
422
+ ] }),
423
+ desktop: /* @__PURE__ */ b(G, { children: [
424
+ /* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
425
+ /* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
426
+ ] }),
427
+ fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
428
+ rotate: /* @__PURE__ */ b(G, { children: [
429
+ /* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
430
+ /* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
431
+ ] }),
432
+ minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
433
+ plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
434
+ link: /* @__PURE__ */ b(G, { children: [
435
+ /* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
436
+ /* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
437
+ ] }),
438
+ check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
439
+ fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
440
+ sun: /* @__PURE__ */ b(G, { children: [
441
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
442
+ /* @__PURE__ */ n("path", { d: "M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" })
443
+ ] }),
444
+ moon: /* @__PURE__ */ n("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
445
+ panel: /* @__PURE__ */ b(G, { children: [
446
+ /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
447
+ /* @__PURE__ */ n("path", { d: "M15 4v16" })
448
+ ] }),
449
+ alert: /* @__PURE__ */ b(G, { children: [
450
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
451
+ /* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
452
+ ] }),
453
+ chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
454
+ search: /* @__PURE__ */ b(G, { children: [
455
+ /* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
456
+ /* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
457
+ ] }),
458
+ copy: /* @__PURE__ */ b(G, { children: [
459
+ /* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
460
+ /* @__PURE__ */ n("path", { d: "M15.5 8.5V5.5a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3" })
461
+ ] })
273
462
  };
274
- function Ct(e) {
275
- const { id: o, label: a, baseUrl: i, path: d, init: r, fallbackToFixture: n = !0 } = e;
276
- return {
277
- id: o,
278
- label: a,
279
- load: async (c) => {
280
- const h = new URL(d ? d(c) : c.scenario.route, i);
281
- try {
282
- const u = await fetch(h, r);
283
- if (!u.ok) throw new Error(`${u.status} ${u.statusText}`);
284
- return await u.json();
285
- } catch (u) {
286
- if (n) return se(c.fixture);
287
- throw new Error(`Adapter "${o}" falhou em ${h.toString()}`, { cause: u });
288
- }
289
- }
290
- };
291
- }
292
- function We(e) {
293
- return new Promise((o) => setTimeout(o, e));
294
- }
295
- function ze(e) {
296
- const { scenario: o, fixture: a, network: i, adapter: d } = e, [r, n] = F({
297
- data: void 0,
298
- isLoading: !!o,
299
- error: void 0
300
- });
301
- return D(() => {
302
- if (!o) {
303
- n({ data: void 0, isLoading: !1, error: void 0 });
304
- return;
463
+ function I({ name: e, size: t = 16 }) {
464
+ return /* @__PURE__ */ n(
465
+ "svg",
466
+ {
467
+ className: "ds-icon",
468
+ width: t,
469
+ height: t,
470
+ viewBox: "0 0 24 24",
471
+ fill: "none",
472
+ stroke: "currentColor",
473
+ strokeWidth: 1.75,
474
+ strokeLinecap: "round",
475
+ strokeLinejoin: "round",
476
+ "aria-hidden": "true",
477
+ focusable: "false",
478
+ children: Tt[e]
305
479
  }
306
- let c = !0;
307
- n({ data: void 0, isLoading: !0, error: void 0 });
308
- const h = d ?? ie;
309
- return Promise.resolve(h.load({ scenario: o, fixture: a, network: i })).then((u) => {
310
- c && n({ data: u, isLoading: !1, error: void 0 });
311
- }).catch((u) => {
312
- c && n({
313
- data: void 0,
314
- isLoading: !1,
315
- error: u instanceof Error ? u : new Error(String(u))
316
- });
317
- }), () => {
318
- c = !1;
319
- };
320
- }, [o, a, i, d]), r;
321
- }
322
- const Ue = {
323
- a: "link",
324
- article: "article",
325
- aside: "complementary",
326
- button: "button",
327
- dialog: "dialog",
328
- fieldset: "group",
329
- footer: "contentinfo",
330
- form: "form",
331
- h1: "heading",
332
- h2: "heading",
333
- h3: "heading",
334
- h4: "heading",
335
- h5: "heading",
336
- h6: "heading",
337
- header: "banner",
338
- hr: "separator",
339
- img: "img",
340
- li: "listitem",
341
- main: "main",
342
- nav: "navigation",
343
- ol: "list",
344
- option: "option",
345
- output: "status",
346
- progress: "progressbar",
347
- section: "region",
348
- select: "combobox",
349
- table: "table",
350
- tbody: "rowgroup",
351
- td: "cell",
352
- textarea: "textbox",
353
- th: "columnheader",
354
- tr: "row",
355
- ul: "list"
356
- }, je = {
357
- button: "button",
358
- checkbox: "checkbox",
359
- email: "textbox",
360
- image: "button",
361
- number: "spinbutton",
362
- radio: "radio",
363
- range: "slider",
364
- reset: "button",
365
- search: "searchbox",
366
- submit: "button",
367
- tel: "textbox",
368
- text: "textbox",
369
- url: "textbox"
370
- };
371
- function Ke(e) {
372
- if (!e || !(e instanceof HTMLElement)) return;
373
- const { name: o, nameFrom: a } = qe(e);
374
- return {
375
- role: Ve(e),
376
- name: o,
377
- nameFrom: a,
378
- description: Ge(e),
379
- states: Ye(e),
380
- selector: Xe(e),
381
- hiddenFromTabOrder: e.tabIndex < 0,
382
- hiddenFromAssistiveTech: Je(e)
383
- };
384
- }
385
- function Ve(e) {
386
- const o = e.getAttribute("role");
387
- if (o) return o.split(/\s+/)[0] ?? o;
388
- const a = e.tagName.toLowerCase();
389
- if (a === "input") {
390
- const i = e.type.toLowerCase();
391
- return je[i] ?? "textbox";
392
- }
393
- return a === "a" && !e.hasAttribute("href") ? "generic" : Ue[a] ?? "generic";
394
- }
395
- function qe(e) {
396
- const o = e.getAttribute("aria-labelledby");
397
- if (o) {
398
- const n = o.split(/\s+/).map((c) => e.ownerDocument.getElementById(c)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
399
- if (n) return { name: n, nameFrom: "aria-labelledby" };
400
- }
401
- const a = e.getAttribute("aria-label")?.trim();
402
- if (a) return { name: a, nameFrom: "aria-label" };
403
- if (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) {
404
- const n = Array.from(e.labels ?? []).map((c) => c.textContent?.trim() ?? "").filter(Boolean);
405
- if (n.length) return { name: n.join(" "), nameFrom: "label" };
406
- }
407
- if (e instanceof HTMLImageElement) {
408
- const n = e.getAttribute("alt");
409
- if (n !== null) return { name: n, nameFrom: "alt" };
410
- }
411
- const i = e.getAttribute("title")?.trim(), d = Qe(e);
412
- return d ? { name: d, nameFrom: "content" } : i ? { name: i, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
413
- }
414
- function Ge(e) {
415
- const o = e.getAttribute("aria-describedby");
416
- if (o) {
417
- const a = o.split(/\s+/).map((i) => e.ownerDocument.getElementById(i)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
418
- if (a) return a;
419
- }
420
- return e.getAttribute("aria-description")?.trim() || void 0;
421
- }
422
- function Ye(e) {
423
- const o = [], a = (i, d = i.replace("aria-", "")) => {
424
- const r = e.getAttribute(i);
425
- r !== null && r !== "false" && o.push(r === "true" || r === "" ? d : `${d}=${r}`);
426
- };
427
- return e.disabled && o.push("disabled"), e.getAttribute("aria-disabled") === "true" && o.push("disabled"), e.required && o.push("required"), e.readOnly && o.push("readonly"), e.checked && o.push("checked"), a("aria-expanded"), a("aria-selected"), a("aria-checked"), a("aria-pressed"), a("aria-current"), a("aria-invalid"), a("aria-busy"), a("aria-live"), a("aria-haspopup"), a("aria-level", "level"), e.ownerDocument.activeElement === e && o.push("focused"), [...new Set(o)];
428
- }
429
- function Je(e) {
430
- let o = e;
431
- for (; o; ) {
432
- if (o.getAttribute("aria-hidden") === "true" || o.hasAttribute("hidden")) return !0;
433
- o = o.parentElement;
434
- }
435
- return !1;
436
- }
437
- function Qe(e) {
438
- const o = e.cloneNode(!0);
439
- for (const a of o.querySelectorAll("[aria-hidden='true'],[hidden]"))
440
- a.remove();
441
- return (o.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 160);
442
- }
443
- function Xe(e) {
444
- const o = e.tagName.toLowerCase();
445
- if (e.id) return `${o}#${e.id}`;
446
- const a = e.getAttribute("data-testid");
447
- if (a) return `${o}[data-testid="${a}"]`;
448
- const i = Array.from(e.classList).slice(0, 2);
449
- return i.length ? `${o}.${i.join(".")}` : o;
450
- }
451
- function Ze(e = document) {
452
- const o = [
453
- "a[href]",
454
- "button",
455
- "input",
456
- "select",
457
- "textarea",
458
- "summary",
459
- "[tabindex]",
460
- "[contenteditable='true']"
461
- ].join(",");
462
- return Array.from(e.querySelectorAll(o)).filter((a) => {
463
- if (a.tabIndex < 0 || a.disabled || a.getAttribute("aria-hidden") === "true") return !1;
464
- const i = window.getComputedStyle(a);
465
- return i.display === "none" || i.visibility === "hidden" ? !1 : a.offsetWidth > 0 || a.offsetHeight > 0 || a === document.activeElement;
466
- });
480
+ );
467
481
  }
468
- function et(e, o) {
469
- const [a, i] = F(), [d, r] = F([]), n = R(() => {
470
- const c = o.current;
471
- if (!c) {
472
- r([]);
473
- return;
474
- }
475
- r(
476
- Ze(c).map((h, u) => ({
477
- index: u + 1,
478
- element: h,
479
- rect: h.getBoundingClientRect(),
480
- forcedOrder: h.tabIndex > 0
481
- }))
482
- );
483
- }, [o]);
484
- return D(() => {
485
- if (!e) {
486
- i(void 0), r([]);
487
- return;
488
- }
489
- const c = () => i(Ke(document.activeElement));
490
- document.addEventListener("focusin", c), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), c(), n();
491
- const h = o.current, u = h ? new MutationObserver(() => n()) : void 0;
492
- return u?.observe(h, { childList: !0, subtree: !0, attributes: !0 }), () => {
493
- document.removeEventListener("focusin", c), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0), u?.disconnect();
494
- };
495
- }, [e, n, o]), { focused: a, tabStops: d, refresh: n };
496
- }
497
- const L = {
498
- status: {
499
- ported: "Portado — não validado",
500
- proposed: "Proposta",
501
- "in-review": "Em revisão",
502
- approved: "Aprovado",
503
- "in-implementation": "Em implementação",
504
- implemented: "Implementado",
505
- superseded: "Superado"
506
- },
507
- statusMeaning: {
508
- ported: "Veio do sistema existente, mas não foi validado e não representa compromisso de implementação.",
509
- proposed: "Exploração ainda não aprovada.",
510
- "in-review": "Aberto para validação de design, negócio ou cliente.",
511
- approved: "Referência autorizada, registrada por URL de commit.",
512
- "in-implementation": "Ligado a um trabalho ativo de engenharia.",
513
- implemented: "Disponível no produto real e validado.",
514
- superseded: "Mantido para histórico ou substituído por outra decisão."
515
- },
482
+ const ne = {
516
483
  network: {
517
484
  success: "Sucesso",
518
485
  loading: "Carregando",
@@ -520,11 +487,6 @@ const L = {
520
487
  error: "Erro",
521
488
  slow: "Lento"
522
489
  },
523
- keyboard: {
524
- full: "Jornada completável só por teclado",
525
- partial: "Parcialmente operável por teclado",
526
- "not-applicable": "Não se aplica"
527
- },
528
490
  viewport: {
529
491
  fit: "Ajustar",
530
492
  mobile: "Celular",
@@ -533,174 +495,131 @@ const L = {
533
495
  custom: "Personalizado"
534
496
  },
535
497
  topbar: {
536
- homeTitle: (e) => `Ir para a página inicial de ${e}`,
537
- toggleNav: "Mostrar ou ocultar a navegação",
498
+ region: "Barra do Design Space",
499
+ viewportGroup: "Viewport",
500
+ rotate: "Girar",
501
+ zoomOut: "Diminuir zoom",
502
+ zoomIn: "Aumentar zoom",
503
+ zoomReset: "Voltar o zoom para 100%",
504
+ zoomValue: (e) => `${e}%`,
538
505
  copyLink: "Copiar link",
539
506
  copied: "Link copiado",
540
- copyPrompt: "Copie o link do cenário:",
541
- cleanReview: "Revisão limpa",
542
- cleanReviewTitle: "Abrir a situação em uma nova aba, sem o chrome do Design Space",
543
- panel: "Painel",
544
- lightMode: "Modo claro",
545
- darkMode: "Modo escuro",
507
+ copyPrompt: "Copie o link:",
508
+ cleanReview: "Revisão limpa (Shift+C)",
509
+ lightMode: "Tema claro",
510
+ darkMode: "Tema escuro",
511
+ engineVersion: (e) => `Design Space ${e}`,
512
+ diagnostics: (e, t) => `Diagnóstico: ${e} ${e === 1 ? "erro" : "erros"}, ${t} ${t === 1 ? "aviso" : "avisos"}`,
546
513
  branchTitle: (e) => `Branch: ${e}`,
547
514
  commitTitle: (e) => `Commit: ${e}`,
548
515
  envTitle: (e) => `Ambiente: ${e}`
549
516
  },
550
517
  sidebar: {
551
- region: "Cenários do produto",
552
- flowsTab: "Fluxos",
518
+ region: "Navegação",
519
+ tabs: "Telas e componentes",
520
+ screensTab: "Telas",
553
521
  componentsTab: "Componentes",
554
- searchPlaceholder: "Buscar situação…",
555
- searchLabel: "Buscar cenário pelo vocabulário do produto",
556
- componentSearchPlaceholder: "Buscar componente…",
557
- componentSearchLabel: "Buscar componente do produto",
522
+ searchPlaceholder: "Buscar",
523
+ searchLabel: "Buscar telas e componentes",
558
524
  searchShortcut: "⌘K",
559
- noMatch: (e) => `Nenhuma situação para "${e}".`,
560
- matchCount: (e) => `${e} ${e === 1 ? "situação" : "situações"}.`,
561
- noComponentMatch: (e) => `Nenhum componente para "${e}".`,
562
- componentMatchCount: (e) => `${e} ${e === 1 ? "componente" : "componentes"}.`,
563
- activeWork: "Trabalho ativo",
564
- portedReferences: (e) => `Referências portadas · ${e}`,
565
- viewPorted: (e) => `Ver ${e} ${e === 1 ? "referência portada" : "referências portadas"}`,
566
- backToActive: "Voltar ao trabalho ativo",
567
- currentView: (e) => `Visão atual: ${e}`,
568
- noActiveWork: "Não há cenários no trabalho ativo.",
569
- noPortedReferences: "Não há referências portadas.",
570
- showPorted: "Mostrar portados",
571
- activePorted: "Aberto por link direto; oculto do trabalho ativo",
572
- emptyModule: "Nenhum cenário ainda.",
525
+ noMatch: (e) => `Nada encontrado para "${e}".`,
526
+ emptyScreens: "Nenhuma tela neste branch. Telas de feature entram por PR, enquanto estão em desenho.",
573
527
  emptyComponents: "O produto ainda não registrou componentes.",
574
- withoutModule: "Sem módulo",
575
- scope: "Escopo ativo",
576
- scopeData: "Dados",
577
- scopePersona: "Persona",
578
- scopeNetwork: "Rede"
528
+ ungrouped: "Outros",
529
+ toggleGroup: (e) => `Mostrar ou ocultar ${e}`,
530
+ resize: "Redimensionar a navegação"
579
531
  },
580
- controls: {
581
- region: "Controles do cenário",
532
+ panel: {
533
+ region: "Painel",
534
+ searchPlaceholder: "Filtrar",
535
+ searchLabel: "Filtrar variações e informações",
536
+ searchShortcut: "⌘F",
537
+ noMatch: (e) => `Nada neste painel para "${e}".`,
538
+ tabs: "Variações e informações",
539
+ variationsTab: "Variações",
540
+ infoTab: "Informações",
541
+ resize: "Redimensionar o painel",
542
+ variationsList: "Variações da tela",
543
+ defaultVariation: "Padrão",
544
+ defaultVariationHint: "A tela sem cenário declarado, sem fixture.",
545
+ noVariations: "Esta tela não tem variações.",
546
+ noComponentVariations: "Este componente não declara variações de dados.",
547
+ nothingSelected: "Escolha uma tela ou um componente na navegação.",
582
548
  persona: "Persona",
583
- fixture: "Dados",
584
- componentFixture: "Dados do componente",
585
- network: "Rede",
586
- viewport: "Viewport",
587
- customWidth: "Largura personalizada em pixels",
549
+ network: "Estado de rede",
588
550
  theme: "Tema",
589
551
  locale: "Idioma",
590
- dataSource: "Fonte",
552
+ dataSource: "Fonte de dados",
591
553
  fixturesOption: "Fixtures",
592
- a11y: "Acessibilidade",
593
- keyboardMode: "Teclado",
594
- keyboardModeTitle: "Percorrer a jornada só por teclado, com foco visível e ordem de tabulação evidenciada",
595
- reducedMotion: "Movimento",
596
- reducedMotionTitle: "Reduzir movimento dentro do palco",
597
- textScale: "Ampliação de texto",
598
- none: "—"
554
+ none: "—",
555
+ fixtureFallback: (e, t) => `A variação \`${e}\` não existe neste componente. Exibindo \`${t}\`.`,
556
+ context: "Contexto",
557
+ shortcuts: "Atalhos",
558
+ toggleGroup: (e) => `Mostrar ou ocultar ${e}`,
559
+ openComponent: (e) => `Abrir ${e} no catálogo`
599
560
  },
600
- inspector: {
601
- region: "Painel de contexto",
602
- tabScenario: "Cenário",
603
- tabA11y: "Acessibilidade",
604
- tabDiagnostics: "Diagnóstico",
605
- diagnosticsWithErrors: (e) => `Diagnóstico (${e})`,
606
- noScenario: "Nenhum cenário ativo. Escolha uma situação na navegação para ver contexto, regras e critérios.",
607
- componentReference: "Componente",
608
- componentGroup: "Grupo",
609
- componentFixture: "Fixture ativa",
610
- componentFixtureDescription: "Descrição da fixture",
611
- componentFixtureFallback: (e, o) => `A fixture \`${e}\` não existe neste componente. Exibindo \`${o}\` como fallback.`,
612
- taskScope: "Dados desta tarefa",
613
- taskScopeDescription: "Contrato e estado autorizados para a situação ativa.",
614
- inheritedScope: "Contexto herdado do produto e da persona",
615
- inheritedScopeDescription: "Informações compartilhadas que ajudam a interpretar a tarefa, mas não pertencem só a ela.",
616
- screenScope: "Inspeção da tela atual",
617
- screenScopeDescription: "Leitura ao vivo do que está renderizado no palco agora.",
618
- productScope: "Verificações gerais do produto",
619
- productScopeDescription: "Resultados compartilhados por todo o catálogo, não só por esta tarefa.",
620
- situation: "Situação",
621
- reproduction: "Reprodução",
561
+ info: {
562
+ screen: "Tela",
563
+ variation: "Variação",
564
+ component: "Componente",
565
+ name: "Nome",
622
566
  id: "Id",
567
+ group: "Grupo",
568
+ description: "Descrição",
569
+ source: "Origem",
570
+ usedIn: "Usado em",
571
+ notUsed: "Nenhuma tela declara este componente.",
623
572
  route: "Rota",
624
573
  persona: "Persona",
625
- personaSwapped: "trocada",
626
- data: "Dados",
627
- network: "Rede",
628
- goal: (e) => `Objetivo: ${e}`,
629
- permissions: "Permissões efetivas",
574
+ permissions: "Permissões",
575
+ intent: "Intenção",
630
576
  preconditions: "Pré-condições",
577
+ actions: "Ações",
578
+ expected: "Comportamento esperado",
631
579
  rules: "Regras",
632
- actions: "Ações disponíveis",
633
- expected: "Critérios de aceite",
634
- approval: "Aprovação",
635
- approvalPendingStatus: "Aprovado — registro pendente",
636
- approvalPendingMeaning: "O status foi marcado como aprovado, mas ainda não há URL de commit que registre a versão autorizada.",
637
- approvalMissing: "A aprovação ainda não está completamente registrada. Preencha approvedAt com a URL imutável do commit aprovado.",
638
- openApproved: "Abrir a versão aprovada",
639
- engineering: "Engenharia",
640
- a11yContract: "Contrato do cenário",
641
- keyboard: "Teclado",
642
- contrast: "Contraste",
643
- contrastTarget: (e) => `WCAG 2.2 ${e}`,
644
- announces: "Precisa ser anunciado:",
645
- focusedElement: "Elemento em foco",
646
- keyboardModeOff: "Ligue o modo teclado na barra de controles para inspecionar a árvore acessível.",
647
- pressTab: (e) => `Pressione Tab dentro do palco. ${e} paradas de tabulação foram encontradas.`,
648
- role: "Papel",
649
- name: "Nome",
650
- noAccessibleName: "sem nome acessível",
651
- nameFrom: "Nome vem de",
652
- description: "Descrição",
653
- selector: "Seletor",
654
- focusableButHidden: "Este elemento é focável mas está escondido de tecnologia assistiva. Um leitor de tela recebe foco sem receber conteúdo.",
655
- tabStopsInStage: (e) => `${e} paradas de tabulação no palco.`,
656
- tokenContrast: "Contraste dos tokens",
657
- noContrastPairs: "O produto não declarou pares de contraste em theme.contrastPairs. Contraste é propriedade de par de cores: declarar aqui valida na origem, uma vez.",
658
- pair: "Par",
659
- ratio: "Razão",
660
- pairsFailing: (e) => `${e} ${e === 1 ? "par" : "pares"} fora do alvo. O teste de tokens do produto falha o build por isso.`,
661
- automatedIsFloor: "Verificação automática é piso, não teto. Ordem de leitura confusa, rótulo tecnicamente presente mas sem sentido e fluxo impossível de completar com leitor de tela passam no axe.",
662
- coverage: "Cobertura por status",
663
- scenariosRegistered: (e) => `${e} cenários registrados.`,
664
- scenarioContract: "Contrato de cenário",
580
+ components: "Componentes usados",
581
+ ticket: "Ticket",
582
+ flow: "Fluxo",
583
+ controls: "Controles",
584
+ copyForPr: "Copiar para o PR",
585
+ copiedForPr: "Copiado",
586
+ copyPrompt: "Copie o texto para o PR:"
587
+ },
588
+ diagnostics: {
589
+ title: "Diagnóstico",
665
590
  noIssues: "Nenhum problema encontrado.",
666
- diagnosticsProductNotice: "Este diagnóstico avalia o catálogo inteiro do produto, inclusive itens fora da tarefa e do handoff ativos."
591
+ error: "Erro",
592
+ warning: "Aviso",
593
+ close: "Fechar diagnóstico",
594
+ invalidControl: (e, t, s) => `O controle \`${e}\` não tem a opção \`${t}\`. Exibindo \`${s}\`.`,
595
+ unknownControl: (e, t) => `A tela não tem o controle \`${e}\` (pedido \`${t}\` na URL). O parâmetro foi ignorado.`
667
596
  },
668
- home: {
669
- lead: (e) => `Especificação executável: cada situação abaixo abre por link, com persona, dados e regras próprios. ${e} ${e === 1 ? "situação registrada" : "situações registradas"}.`,
670
- statusLegend: "Legenda dos status",
671
- withoutModule: "Sem módulo",
672
- withoutModuleHint: "O prefixo do id não corresponde a nenhum módulo registrado, então estas situações não aparecem na navegação por módulo.",
673
- emptyModule: "Nenhuma situação registrada neste módulo ainda.",
674
- keyboardBadge: "teclado",
675
- noActiveWork: "Não há cenários no trabalho ativo.",
676
- noPortedReferences: "Não há referências portadas nesta coleção."
597
+ pr: {
598
+ variations: "Variações",
599
+ components: "Componentes",
600
+ component: "Componente",
601
+ source: "Origem",
602
+ expected: "Comportamento esperado",
603
+ commit: (e) => `Commit \`${e}\``,
604
+ immutableLink: "link deste deployment",
605
+ noExpected: "Sem comportamento esperado declarado.",
606
+ empty: "—",
607
+ open: "Abrir a tela",
608
+ controls: "Controles",
609
+ shortcuts: "Atalhos",
610
+ defaultOption: "padrão"
677
611
  },
678
612
  shell: {
679
- restoreChrome: "Mostrar controles",
613
+ restoreChrome: "Mostrar o chrome (Shift+C)",
614
+ frameTitle: (e) => `Pré-visualização de ${e}`,
680
615
  noRoute: "Nenhuma rota para este endereço",
681
- noRouteHint: "não casa com nenhuma rota declarada. Escolha uma situação na navegação.",
616
+ noRouteHint: "não casa com nenhuma rota declarada. Escolha uma tela na navegação.",
682
617
  outsideHandoff: "Fora do escopo deste handoff",
683
- outsideHandoffHint: "Este link permite revisar somente os cenários, rotas e componentes listados no handoff. Escolha um item disponível na navegação."
618
+ outsideHandoffHint: "Este link permite revisar somente os cenários, rotas e componentes listados no handoff. Escolha um item disponível na navegação.",
619
+ empty: "Nada para mostrar ainda",
620
+ emptyHint: "O produto ainda não registrou telas nem componentes."
684
621
  }
685
- }, Tt = {
686
- status: {
687
- ported: "Ported — not validated",
688
- proposed: "Proposed",
689
- "in-review": "In review",
690
- approved: "Approved",
691
- "in-implementation": "In implementation",
692
- implemented: "Implemented",
693
- superseded: "Superseded"
694
- },
695
- statusMeaning: {
696
- ported: "Imported from the existing system, but not validated and not an implementation commitment.",
697
- proposed: "Exploration that has not been approved yet.",
698
- "in-review": "Open for design, business, or client validation.",
699
- approved: "Authorized reference, recorded with a commit URL.",
700
- "in-implementation": "Linked to active engineering work.",
701
- implemented: "Available in the real product and validated.",
702
- superseded: "Kept for history or replaced by another decision."
703
- },
622
+ }, cn = {
704
623
  network: {
705
624
  success: "Success",
706
625
  loading: "Loading",
@@ -708,11 +627,6 @@ const L = {
708
627
  error: "Error",
709
628
  slow: "Slow"
710
629
  },
711
- keyboard: {
712
- full: "Journey can be completed with keyboard only",
713
- partial: "Partially operable with keyboard",
714
- "not-applicable": "Not applicable"
715
- },
716
630
  viewport: {
717
631
  fit: "Fit",
718
632
  mobile: "Mobile",
@@ -721,1576 +635,1776 @@ const L = {
721
635
  custom: "Custom"
722
636
  },
723
637
  topbar: {
724
- homeTitle: (e) => `Go to ${e} home`,
725
- toggleNav: "Show or hide navigation",
638
+ region: "Design Space bar",
639
+ viewportGroup: "Viewport",
640
+ rotate: "Rotate",
641
+ zoomOut: "Zoom out",
642
+ zoomIn: "Zoom in",
643
+ zoomReset: "Reset zoom to 100%",
644
+ zoomValue: (e) => `${e}%`,
726
645
  copyLink: "Copy link",
727
646
  copied: "Link copied",
728
- copyPrompt: "Copy the scenario link:",
729
- cleanReview: "Clean review",
730
- cleanReviewTitle: "Open this state in a new tab without the Design Space chrome",
731
- panel: "Panel",
732
- lightMode: "Light mode",
733
- darkMode: "Dark mode",
647
+ copyPrompt: "Copy the link:",
648
+ cleanReview: "Clean review (Shift+C)",
649
+ lightMode: "Light theme",
650
+ darkMode: "Dark theme",
651
+ engineVersion: (e) => `Design Space ${e}`,
652
+ diagnostics: (e, t) => `Diagnostics: ${e} ${e === 1 ? "error" : "errors"}, ${t} ${t === 1 ? "warning" : "warnings"}`,
734
653
  branchTitle: (e) => `Branch: ${e}`,
735
654
  commitTitle: (e) => `Commit: ${e}`,
736
655
  envTitle: (e) => `Environment: ${e}`
737
656
  },
738
657
  sidebar: {
739
- region: "Product scenarios",
740
- flowsTab: "Flows",
658
+ region: "Navigation",
659
+ tabs: "Screens and components",
660
+ screensTab: "Screens",
741
661
  componentsTab: "Components",
742
- searchPlaceholder: "Search scenarios…",
743
- searchLabel: "Search scenarios using product language",
744
- componentSearchPlaceholder: "Search components…",
745
- componentSearchLabel: "Search product components",
662
+ searchPlaceholder: "Search",
663
+ searchLabel: "Search screens and components",
746
664
  searchShortcut: "⌘K",
747
- noMatch: (e) => `No scenarios found for "${e}".`,
748
- matchCount: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"}.`,
749
- noComponentMatch: (e) => `No components found for "${e}".`,
750
- componentMatchCount: (e) => `${e} ${e === 1 ? "component" : "components"}.`,
751
- activeWork: "Active work",
752
- portedReferences: (e) => `Ported references · ${e}`,
753
- viewPorted: (e) => `View ${e} ported ${e === 1 ? "reference" : "references"}`,
754
- backToActive: "Back to active work",
755
- currentView: (e) => `Current view: ${e}`,
756
- noActiveWork: "There are no scenarios in active work.",
757
- noPortedReferences: "There are no ported references.",
758
- showPorted: "Show ported",
759
- activePorted: "Opened by direct link; hidden from active work",
760
- emptyModule: "No scenarios yet.",
665
+ noMatch: (e) => `Nothing found for "${e}".`,
666
+ emptyScreens: "No screens on this branch. Feature screens come in through a pull request while they are being designed.",
761
667
  emptyComponents: "The product has not registered any components yet.",
762
- withoutModule: "No module",
763
- scope: "Active scope",
764
- scopeData: "Data",
765
- scopePersona: "Persona",
766
- scopeNetwork: "Network"
668
+ ungrouped: "Other",
669
+ toggleGroup: (e) => `Show or hide ${e}`,
670
+ resize: "Resize navigation"
767
671
  },
768
- controls: {
769
- region: "Scenario controls",
672
+ panel: {
673
+ region: "Panel",
674
+ searchPlaceholder: "Filter",
675
+ searchLabel: "Filter variations and details",
676
+ searchShortcut: "⌘F",
677
+ noMatch: (e) => `Nothing in this panel for "${e}".`,
678
+ tabs: "Variations and information",
679
+ variationsTab: "Variations",
680
+ infoTab: "Information",
681
+ resize: "Resize panel",
682
+ variationsList: "Screen variations",
683
+ defaultVariation: "Default",
684
+ defaultVariationHint: "The screen without a declared scenario or fixture.",
685
+ noVariations: "This screen has no variations.",
686
+ noComponentVariations: "This component does not declare data variations.",
687
+ nothingSelected: "Choose a screen or a component in the navigation.",
770
688
  persona: "Persona",
771
- fixture: "Data",
772
- componentFixture: "Component data",
773
- network: "Network",
774
- viewport: "Viewport",
775
- customWidth: "Custom width in pixels",
689
+ network: "Network state",
776
690
  theme: "Theme",
777
691
  locale: "Language",
778
- dataSource: "Source",
692
+ dataSource: "Data source",
779
693
  fixturesOption: "Fixtures",
780
- a11y: "Accessibility",
781
- keyboardMode: "Keyboard",
782
- keyboardModeTitle: "Complete the journey with keyboard only, showing focus and tab order",
783
- reducedMotion: "Motion",
784
- reducedMotionTitle: "Reduce motion inside the stage",
785
- textScale: "Text size",
786
- none: "—"
694
+ none: "—",
695
+ fixtureFallback: (e, t) => `Variation \`${e}\` does not exist for this component. Showing \`${t}\`.`,
696
+ context: "Context",
697
+ shortcuts: "Shortcuts",
698
+ toggleGroup: (e) => `Show or hide ${e}`,
699
+ openComponent: (e) => `Open ${e} in the catalog`
787
700
  },
788
- inspector: {
789
- region: "Context panel",
790
- tabScenario: "Scenario",
791
- tabA11y: "Accessibility",
792
- tabDiagnostics: "Diagnostics",
793
- diagnosticsWithErrors: (e) => `Diagnostics (${e})`,
794
- noScenario: "No active scenario. Choose a state in the navigation to see its context, rules, and criteria.",
795
- componentReference: "Component",
796
- componentGroup: "Group",
797
- componentFixture: "Active fixture",
798
- componentFixtureDescription: "Fixture description",
799
- componentFixtureFallback: (e, o) => `Fixture \`${e}\` does not exist for this component. Showing \`${o}\` as fallback.`,
800
- taskScope: "This task",
801
- taskScopeDescription: "The contract and authorized state for the active scenario.",
802
- inheritedScope: "Inherited product and persona context",
803
- inheritedScopeDescription: "Shared information that helps interpret the task but does not belong only to it.",
804
- screenScope: "Current screen inspection",
805
- screenScopeDescription: "A live reading of what is rendered in the stage now.",
806
- productScope: "Product-wide checks",
807
- productScopeDescription: "Results shared across the catalog, not only this task.",
808
- situation: "State",
809
- reproduction: "Reproduction",
701
+ info: {
702
+ screen: "Screen",
703
+ variation: "Variation",
704
+ component: "Component",
705
+ name: "Name",
810
706
  id: "ID",
707
+ group: "Group",
708
+ description: "Description",
709
+ source: "Source",
710
+ usedIn: "Used in",
711
+ notUsed: "No screen declares this component.",
811
712
  route: "Route",
812
713
  persona: "Persona",
813
- personaSwapped: "changed",
814
- data: "Data",
815
- network: "Network",
816
- goal: (e) => `Goal: ${e}`,
817
- permissions: "Effective permissions",
714
+ permissions: "Permissions",
715
+ intent: "Intent",
818
716
  preconditions: "Preconditions",
717
+ actions: "Actions",
718
+ expected: "Expected behavior",
819
719
  rules: "Rules",
820
- actions: "Available actions",
821
- expected: "Acceptance criteria",
822
- approval: "Approval",
823
- approvalPendingStatus: "Approved — record pending",
824
- approvalPendingMeaning: "The status is approved, but there is no commit URL recording the authorized version yet.",
825
- approvalMissing: "Approval is not fully recorded yet. Fill approvedAt with the immutable URL of the approved commit.",
826
- openApproved: "Open approved version",
827
- engineering: "Engineering",
828
- a11yContract: "Scenario contract",
829
- keyboard: "Keyboard",
830
- contrast: "Contrast",
831
- contrastTarget: (e) => `WCAG 2.2 ${e}`,
832
- announces: "Must be announced:",
833
- focusedElement: "Focused element",
834
- keyboardModeOff: "Turn on keyboard mode in the controls to inspect the accessibility tree.",
835
- pressTab: (e) => `Press Tab inside the stage. ${e} tab ${e === 1 ? "stop was" : "stops were"} found.`,
836
- role: "Role",
837
- name: "Name",
838
- noAccessibleName: "no accessible name",
839
- nameFrom: "Name source",
840
- description: "Description",
841
- selector: "Selector",
842
- focusableButHidden: "This element is focusable but hidden from assistive technology. A screen reader receives focus without receiving content.",
843
- tabStopsInStage: (e) => `${e} tab ${e === 1 ? "stop" : "stops"} in the stage.`,
844
- tokenContrast: "Token contrast",
845
- 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.",
846
- pair: "Pair",
847
- ratio: "Ratio",
848
- pairsFailing: (e) => `${e} ${e === 1 ? "pair is" : "pairs are"} below the target. The product token test fails the build for this.`,
849
- 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.",
850
- coverage: "Coverage by status",
851
- scenariosRegistered: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"} registered.`,
852
- scenarioContract: "Scenario contract",
720
+ components: "Components used",
721
+ ticket: "Ticket",
722
+ flow: "Flow",
723
+ controls: "Controls",
724
+ copyForPr: "Copy for PR",
725
+ copiedForPr: "Copied",
726
+ copyPrompt: "Copy the text for the PR:"
727
+ },
728
+ diagnostics: {
729
+ title: "Diagnostics",
853
730
  noIssues: "No issues found.",
854
- diagnosticsProductNotice: "These diagnostics evaluate the entire product catalog, including items outside the active task and handoff."
731
+ error: "Error",
732
+ warning: "Warning",
733
+ close: "Close diagnostics",
734
+ invalidControl: (e, t, s) => `Control \`${e}\` has no option \`${t}\`. Showing \`${s}\`.`,
735
+ unknownControl: (e, t) => `This screen has no control \`${e}\` (\`${t}\` requested in the URL). The parameter was ignored.`
855
736
  },
856
- home: {
857
- 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"}.`,
858
- statusLegend: "Status legend",
859
- withoutModule: "No module",
860
- withoutModuleHint: "The ID prefix does not match a registered module, so these states do not appear in module navigation.",
861
- emptyModule: "No states have been registered in this module yet.",
862
- keyboardBadge: "keyboard",
863
- noActiveWork: "There are no scenarios in active work.",
864
- noPortedReferences: "There are no ported references in this collection."
737
+ pr: {
738
+ variations: "Variations",
739
+ components: "Components",
740
+ component: "Component",
741
+ source: "Source",
742
+ expected: "Expected behavior",
743
+ commit: (e) => `Commit \`${e}\``,
744
+ immutableLink: "this deployment",
745
+ noExpected: "No expected behavior declared.",
746
+ empty: "—",
747
+ open: "Open the screen",
748
+ controls: "Controls",
749
+ shortcuts: "Shortcuts",
750
+ defaultOption: "default"
865
751
  },
866
752
  shell: {
867
- restoreChrome: "Show controls",
753
+ restoreChrome: "Show chrome (Shift+C)",
754
+ frameTitle: (e) => `${e} preview`,
868
755
  noRoute: "No route for this address",
869
- noRouteHint: "does not match any declared route. Choose a state from the navigation.",
756
+ noRouteHint: "does not match any declared route. Choose a screen from the navigation.",
870
757
  outsideHandoff: "Outside this handoff scope",
871
- outsideHandoffHint: "This link only allows review of the scenarios, routes, and components listed in the handoff. Choose an available item from the navigation."
758
+ outsideHandoffHint: "This link only allows review of the scenarios, routes, and components listed in the handoff. Choose an available item from the navigation.",
759
+ empty: "Nothing to show yet",
760
+ emptyHint: "The product has not registered any screens or components yet."
872
761
  }
873
762
  };
874
- function tt(e) {
875
- if (!e) return L;
876
- const o = { ...L };
877
- for (const a of Object.keys(L)) {
878
- const i = e[a];
879
- i && (o[a] = { ...L[a], ...i });
763
+ function Et(e) {
764
+ if (!e) return ne;
765
+ const t = { ...ne };
766
+ for (const s of Object.keys(ne)) {
767
+ const o = e[s];
768
+ o && (t[s] = { ...ne[s], ...o });
880
769
  }
881
- return o;
770
+ return t;
882
771
  }
883
- const we = Se(L);
884
- function P() {
885
- return Ne(we);
772
+ const Ze = ct(ne);
773
+ function Q() {
774
+ return it(Ze);
886
775
  }
887
- const At = L.status, Pt = L.statusMeaning, Lt = L.network, Ft = L.keyboard;
888
- function ot({
889
- registry: e,
890
- activeScenario: o,
891
- activeComponent: a,
892
- controls: i,
893
- onOpenScenario: d,
894
- onOpenComponent: r,
895
- onViewChange: n
776
+ const ln = ne.network, _t = [
777
+ { id: "mobile", icon: "mobile" },
778
+ { id: "tablet", icon: "tablet" },
779
+ { id: "desktop", icon: "desktop" },
780
+ { id: "fit", icon: "fit" }
781
+ ], Pe = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
782
+ function Fe(e, t) {
783
+ return t > 0 ? Pe.find((s) => s > e) ?? Te : [...Pe].reverse().find((s) => s < e) ?? Le;
784
+ }
785
+ function Rt({
786
+ productName: e,
787
+ viewportId: t,
788
+ viewport: s,
789
+ zoom: o,
790
+ rotated: r,
791
+ theme: l,
792
+ issues: c,
793
+ linkUrl: i,
794
+ onViewport: h,
795
+ onRotate: m,
796
+ onZoom: d,
797
+ onCleanReview: u,
798
+ onToggleTheme: f
896
799
  }) {
897
- const c = P(), [h, u] = F(a ? "components" : "flows"), [g, f] = F(""), [p, b] = F(/* @__PURE__ */ new Set()), S = re(null), _ = re(/* @__PURE__ */ new Map()), s = ce(i), m = i.handoff, k = e.byStatus("ported", { handoff: m }).length, M = e.activeScenarios({ view: s, handoff: m }).length, y = s === "ported" ? c.sidebar.portedReferences(k) : c.sidebar.activeWork;
898
- D(() => {
899
- a ? u("components") : o && u("flows");
900
- }, [a, o]), D(() => {
901
- const v = (x) => {
902
- rt(x) && (x.preventDefault(), S.current?.focus(), S.current?.select());
903
- };
904
- return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
905
- }, []);
906
- const E = T(() => {
907
- if (g.trim())
908
- return new Set(
909
- e.search(g, { view: s, handoff: m }).map((v) => v.id)
910
- );
911
- }, [m, g, e, s]), $ = T(() => {
912
- const v = me(g);
913
- return e.componentsFor(m).filter(
914
- (x) => me([x.name, x.id, x.group, x.description].join(" ")).includes(
915
- v
800
+ const v = Q(), k = v.topbar, [C, N] = D(!1), w = (t === "mobile" || t === "tablet") && !!(s.width && s.height), x = async () => {
801
+ try {
802
+ await navigator.clipboard.writeText(i);
803
+ } catch {
804
+ window.prompt(k.copyPrompt, i);
805
+ }
806
+ N(!0), window.setTimeout(() => N(!1), 1600);
807
+ };
808
+ return /* @__PURE__ */ b("header", { className: "ds-topbar", "aria-label": k.region, children: [
809
+ /* @__PURE__ */ b("div", { className: "ds-topbar__product", children: [
810
+ /* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
811
+ /* @__PURE__ */ n(
812
+ "a",
813
+ {
814
+ className: "ds-topbar__version",
815
+ href: `https://www.npmjs.com/package/${Lt}/v/${Re}`,
816
+ target: "_blank",
817
+ rel: "noreferrer",
818
+ children: k.engineVersion(Re)
819
+ }
916
820
  )
917
- );
918
- }, [m, g, e]), O = (v) => E ? v.filter((x) => E.has(x.id)) : v, G = {
919
- view: s,
920
- handoff: m
921
- }, I = e.treeFor(G).map((v) => ({ ...v, scenarios: O(v.scenarios) })).filter((v) => v.scenarios.length > 0), B = O(e.orphansFor(G)), U = I.reduce((v, x) => v + x.scenarios.length, 0) + B.length, H = nt($), j = h === "flows" ? [...I.flatMap((v) => v.scenarios), ...B].map((v) => v.id) : $.map((v) => v.id), Y = (v, x) => {
922
- if (j.length === 0) return;
923
- const N = st(j, v, x);
924
- N && _.current.get(N)?.focus();
925
- }, K = (v) => {
926
- v.key === "ArrowDown" ? (v.preventDefault(), Y(void 0, 1)) : v.key === "Escape" && f("");
927
- }, V = (v, x) => {
928
- x.key !== "ArrowDown" && x.key !== "ArrowUp" || (x.preventDefault(), Y(v, x.key === "ArrowDown" ? 1 : -1));
929
- }, q = (v, x) => {
930
- x ? _.current.set(v, x) : _.current.delete(v);
931
- }, J = (v) => b((x) => {
932
- const N = new Set(x);
933
- return N.has(v) ? N.delete(v) : N.add(v), N;
934
- });
935
- return /* @__PURE__ */ l("nav", { className: "ds-chrome ds-sidebar", "aria-label": c.sidebar.region, children: [
936
- /* @__PURE__ */ l("div", { className: "ds-sidebar__tabs", role: "tablist", children: [
937
- /* @__PURE__ */ t(
821
+ ] }),
822
+ /* @__PURE__ */ b("div", { className: "ds-topbar__view", children: [
823
+ /* @__PURE__ */ b("div", { className: "ds-group", role: "group", "aria-label": k.viewportGroup, children: [
824
+ _t.map(($) => {
825
+ const y = v.viewport[$.id] ?? $.id;
826
+ return /* @__PURE__ */ n(
827
+ "button",
828
+ {
829
+ type: "button",
830
+ className: "ds-btn ds-btn--icon",
831
+ "aria-pressed": t === $.id,
832
+ "aria-label": y,
833
+ title: y,
834
+ onClick: () => h($.id),
835
+ children: /* @__PURE__ */ n(I, { name: $.icon })
836
+ },
837
+ $.id
838
+ );
839
+ }),
840
+ /* @__PURE__ */ n(
841
+ "button",
842
+ {
843
+ type: "button",
844
+ className: "ds-btn ds-btn--icon",
845
+ "aria-pressed": r,
846
+ "aria-label": k.rotate,
847
+ title: k.rotate,
848
+ disabled: !w,
849
+ onClick: m,
850
+ children: /* @__PURE__ */ n(I, { name: "rotate" })
851
+ }
852
+ )
853
+ ] }),
854
+ /* @__PURE__ */ b("div", { className: "ds-group", role: "group", children: [
855
+ /* @__PURE__ */ n(
856
+ "button",
857
+ {
858
+ type: "button",
859
+ className: "ds-btn ds-btn--icon",
860
+ "aria-label": k.zoomOut,
861
+ title: k.zoomOut,
862
+ disabled: o <= Le,
863
+ onClick: () => d(Fe(o, -1)),
864
+ children: /* @__PURE__ */ n(I, { name: "minus" })
865
+ }
866
+ ),
867
+ /* @__PURE__ */ n(
868
+ "button",
869
+ {
870
+ type: "button",
871
+ className: "ds-btn ds-btn--zoom",
872
+ "aria-label": k.zoomReset,
873
+ title: k.zoomReset,
874
+ onClick: () => d(pe),
875
+ children: k.zoomValue(o)
876
+ }
877
+ ),
878
+ /* @__PURE__ */ n(
879
+ "button",
880
+ {
881
+ type: "button",
882
+ className: "ds-btn ds-btn--icon",
883
+ "aria-label": k.zoomIn,
884
+ title: k.zoomIn,
885
+ disabled: o >= Te,
886
+ onClick: () => d(Fe(o, 1)),
887
+ children: /* @__PURE__ */ n(I, { name: "plus" })
888
+ }
889
+ )
890
+ ] }),
891
+ /* @__PURE__ */ n(
938
892
  "button",
939
893
  {
940
894
  type: "button",
941
- role: "tab",
942
- "aria-selected": h === "flows",
943
- onClick: () => {
944
- u("flows"), f("");
945
- },
946
- children: c.sidebar.flowsTab
895
+ className: "ds-btn ds-btn--icon",
896
+ "aria-label": k.cleanReview,
897
+ title: k.cleanReview,
898
+ onClick: u,
899
+ children: /* @__PURE__ */ n(I, { name: "fullscreen" })
947
900
  }
948
- ),
949
- /* @__PURE__ */ t(
901
+ )
902
+ ] }),
903
+ /* @__PURE__ */ b("div", { className: "ds-topbar__tools", children: [
904
+ /* @__PURE__ */ n(
950
905
  "button",
951
906
  {
952
907
  type: "button",
953
- role: "tab",
954
- "aria-selected": h === "components",
955
- onClick: () => {
956
- u("components"), f("");
957
- },
958
- children: c.sidebar.componentsTab
908
+ className: "ds-btn ds-btn--icon",
909
+ "aria-label": C ? k.copied : k.copyLink,
910
+ title: C ? k.copied : k.copyLink,
911
+ onClick: x,
912
+ children: /* @__PURE__ */ n(I, { name: C ? "check" : "link" })
959
913
  }
960
- )
961
- ] }),
962
- /* @__PURE__ */ l("div", { className: "ds-sidebar__search", children: [
963
- /* @__PURE__ */ t(
964
- "input",
914
+ ),
915
+ /* @__PURE__ */ n(
916
+ "button",
965
917
  {
966
- ref: S,
967
- className: "ds-input ds-input--search",
968
- type: "search",
969
- value: g,
970
- placeholder: h === "flows" ? c.sidebar.searchPlaceholder : c.sidebar.componentSearchPlaceholder,
971
- "aria-label": h === "flows" ? c.sidebar.searchLabel : c.sidebar.componentSearchLabel,
972
- onChange: (v) => f(v.target.value),
973
- onKeyDown: K
918
+ type: "button",
919
+ className: "ds-btn ds-btn--icon",
920
+ "aria-label": l === "dark" ? k.lightMode : k.darkMode,
921
+ title: l === "dark" ? k.lightMode : k.darkMode,
922
+ onClick: f,
923
+ children: /* @__PURE__ */ n(I, { name: l === "dark" ? "sun" : "moon" })
974
924
  }
975
925
  ),
976
- /* @__PURE__ */ t("kbd", { children: c.sidebar.searchShortcut })
977
- ] }),
978
- /* @__PURE__ */ l(
979
- "div",
926
+ c.length > 0 && /* @__PURE__ */ n(Pt, { issues: c })
927
+ ] })
928
+ ] });
929
+ }
930
+ function Pt({ issues: e }) {
931
+ const t = Q(), [s, o] = D(!1), r = q(null), l = e.filter((h) => h.level === "error").length, c = e.length - l, i = t.topbar.diagnostics(l, c);
932
+ return V(() => {
933
+ if (!s) return;
934
+ const h = (d) => {
935
+ r.current?.contains(d.target) || o(!1);
936
+ }, m = (d) => {
937
+ d.key === "Escape" && o(!1);
938
+ };
939
+ return window.addEventListener("pointerdown", h), window.addEventListener("keydown", m), () => {
940
+ window.removeEventListener("pointerdown", h), window.removeEventListener("keydown", m);
941
+ };
942
+ }, [s]), /* @__PURE__ */ b("div", { className: "ds-diagnostics", ref: r, children: [
943
+ /* @__PURE__ */ b(
944
+ "button",
980
945
  {
981
- className: "ds-sidebar__tree",
982
- role: "tabpanel",
983
- "aria-label": h === "flows" ? c.sidebar.currentView(y) : void 0,
946
+ type: "button",
947
+ className: "ds-btn ds-diagnostics__trigger",
948
+ "data-level": l > 0 ? "error" : "warning",
949
+ "aria-expanded": s,
950
+ "aria-label": i,
951
+ title: i,
952
+ onClick: () => o((h) => !h),
984
953
  children: [
985
- h === "flows" && /* @__PURE__ */ l("header", { className: "ds-sidebar__view-header", children: [
986
- /* @__PURE__ */ t("h2", { children: y }),
987
- s === "ported" && /* @__PURE__ */ t(
988
- "button",
989
- {
990
- type: "button",
991
- className: "ds-text-action",
992
- onClick: () => n("active"),
993
- children: c.sidebar.backToActive
994
- }
995
- )
996
- ] }),
997
- g.trim() !== "" && /* @__PURE__ */ t("p", { className: "ds-sidebar__empty", role: "status", children: h === "flows" ? U === 0 ? c.sidebar.noMatch(g) : c.sidebar.matchCount(U) : $.length === 0 ? c.sidebar.noComponentMatch(g) : c.sidebar.componentMatchCount($.length) }),
998
- h === "flows" && g.trim() === "" && M === 0 ? /* @__PURE__ */ l("div", { className: "ds-sidebar__view-empty", children: [
999
- /* @__PURE__ */ t("p", { children: s === "ported" ? c.sidebar.noPortedReferences : c.sidebar.noActiveWork }),
1000
- s === "active" && k > 0 && /* @__PURE__ */ t(
1001
- "button",
1002
- {
1003
- type: "button",
1004
- className: "ds-text-action",
1005
- onClick: () => n("ported"),
1006
- children: c.sidebar.viewPorted(k)
1007
- }
1008
- )
1009
- ] }) : h === "flows" ? /* @__PURE__ */ t(
1010
- at,
1011
- {
1012
- nodes: I,
1013
- orphans: B,
1014
- matches: E,
1015
- collapsed: p,
1016
- activeScenario: o?.id,
1017
- withoutModuleLabel: c.sidebar.withoutModule,
1018
- onToggle: J,
1019
- onOpen: d,
1020
- onKeyDown: V,
1021
- setItemRef: q
1022
- }
1023
- ) : H.length === 0 && !g ? /* @__PURE__ */ t("p", { className: "ds-sidebar__empty", children: c.sidebar.emptyComponents }) : H.map(([v, x]) => /* @__PURE__ */ l("section", { className: "ds-component-group", children: [
1024
- /* @__PURE__ */ t("h2", { children: v }),
1025
- /* @__PURE__ */ t("ul", { children: x.map((N) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
1026
- "button",
1027
- {
1028
- ref: (C) => q(N.id, C),
1029
- type: "button",
1030
- className: "ds-component-item",
1031
- "aria-current": N.id === a,
1032
- onClick: () => r(N.id),
1033
- onKeyDown: (C) => V(N.id, C),
1034
- children: [
1035
- /* @__PURE__ */ t("span", { children: N.name }),
1036
- N.description && /* @__PURE__ */ t("small", { children: N.description })
1037
- ]
1038
- }
1039
- ) }, N.id)) })
1040
- ] }, v))
954
+ /* @__PURE__ */ n(I, { name: "alert" }),
955
+ /* @__PURE__ */ n("span", { children: l > 0 ? l : c })
1041
956
  ]
1042
957
  }
1043
958
  ),
1044
- h === "flows" && s === "active" && M > 0 && k > 0 && /* @__PURE__ */ t("div", { className: "ds-sidebar__view-footer", children: /* @__PURE__ */ t(
1045
- "button",
1046
- {
1047
- type: "button",
1048
- className: "ds-text-action",
1049
- onClick: () => n("ported"),
1050
- children: c.sidebar.viewPorted(k)
1051
- }
1052
- ) }),
1053
- h === "flows" && o && /* @__PURE__ */ l("aside", { className: "ds-sidebar__scope", "aria-label": c.sidebar.scope, children: [
1054
- /* @__PURE__ */ t("h2", { children: c.sidebar.scope }),
1055
- /* @__PURE__ */ l("dl", { children: [
1056
- /* @__PURE__ */ t("dt", { children: c.sidebar.scopeData }),
1057
- /* @__PURE__ */ t("dd", { children: e.fixture(i.fixture ?? o.fixture)?.label ?? c.controls.none }),
1058
- /* @__PURE__ */ t("dt", { children: c.sidebar.scopePersona }),
1059
- /* @__PURE__ */ t("dd", { children: e.persona(i.persona ?? o.persona)?.name ?? c.controls.none }),
1060
- /* @__PURE__ */ t("dt", { children: c.sidebar.scopeNetwork }),
1061
- /* @__PURE__ */ t("dd", { children: c.network[i.network] })
1062
- ] })
959
+ s && /* @__PURE__ */ b("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
960
+ /* @__PURE__ */ b("div", { className: "ds-diagnostics__head", children: [
961
+ /* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
962
+ /* @__PURE__ */ n("span", { className: "ds-muted", children: i })
963
+ ] }),
964
+ /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((h, m) => /* @__PURE__ */ b("li", { className: "ds-diagnostics__item", "data-level": h.level, children: [
965
+ /* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: h.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
966
+ /* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: h.where }),
967
+ /* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: h.message })
968
+ ] }, `${h.where}-${m}`)) })
1063
969
  ] })
1064
970
  ] });
1065
971
  }
1066
- function at(e) {
1067
- return /* @__PURE__ */ l(A, { children: [
1068
- e.nodes.map((o) => {
1069
- const a = !e.collapsed.has(o.module.id) || !!e.matches;
1070
- return /* @__PURE__ */ l("section", { className: "ds-module", children: [
1071
- /* @__PURE__ */ l(
972
+ const Ft = 16;
973
+ function Ye({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: l }) {
974
+ const c = q(void 0), i = e === "left" ? 1 : -1, h = (f) => {
975
+ if (f.button === 0) {
976
+ f.preventDefault(), c.current = { x: f.clientX, width: s };
977
+ try {
978
+ f.currentTarget.setPointerCapture(f.pointerId);
979
+ } catch {
980
+ }
981
+ r?.();
982
+ }
983
+ }, m = (f) => {
984
+ c.current && o(c.current.width + (f.clientX - c.current.x) * i);
985
+ }, d = () => {
986
+ c.current && (c.current = void 0, l?.());
987
+ };
988
+ return /* @__PURE__ */ n(
989
+ "div",
990
+ {
991
+ className: "ds-resizer",
992
+ "data-side": e,
993
+ role: "separator",
994
+ "aria-orientation": "vertical",
995
+ "aria-label": t,
996
+ "aria-valuenow": s,
997
+ tabIndex: 0,
998
+ onPointerDown: h,
999
+ onPointerMove: m,
1000
+ onPointerUp: d,
1001
+ onPointerCancel: d,
1002
+ onLostPointerCapture: d,
1003
+ onKeyDown: (f) => {
1004
+ if (f.key !== "ArrowLeft" && f.key !== "ArrowRight") return;
1005
+ f.preventDefault();
1006
+ const v = f.key === "ArrowRight" ? 1 : -1;
1007
+ o(s + v * i * Ft);
1008
+ }
1009
+ }
1010
+ );
1011
+ }
1012
+ function Ot({
1013
+ registry: e,
1014
+ handoff: t,
1015
+ activeScreen: s,
1016
+ activeComponent: o,
1017
+ onOpenScreen: r,
1018
+ onOpenComponent: l,
1019
+ width: c,
1020
+ onResize: i,
1021
+ onResizeStart: h,
1022
+ onResizeEnd: m
1023
+ }) {
1024
+ const u = Q().sidebar, [f, v] = D(""), [k, C] = D(() => /* @__PURE__ */ new Set()), N = q(null), w = e.screensFor({ handoff: t }), x = e.componentsFor(t), $ = w.length > 0, y = x.length > 0, [L, p] = D(
1025
+ () => o || !$ ? "components" : "screens"
1026
+ );
1027
+ V(() => {
1028
+ o && y ? p("components") : s && $ && p("screens");
1029
+ }, [o, s, y, $]);
1030
+ const E = L;
1031
+ V(() => {
1032
+ const F = (K) => {
1033
+ Dt(K) && (K.preventDefault(), N.current?.focus(), N.current?.select());
1034
+ };
1035
+ return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
1036
+ }, []);
1037
+ const a = A(
1038
+ () => e.searchScreens(f, { handoff: t }),
1039
+ [t, f, e]
1040
+ ), g = A(
1041
+ () => e.searchComponents(f, t),
1042
+ [t, f, e]
1043
+ ), S = A(() => At(g, u.ungrouped), [g, u.ungrouped]), R = A(() => Be(a), [a]), M = f.trim().length > 0, W = (F) => C((K) => {
1044
+ const T = new Set(K);
1045
+ return T.has(F) ? T.delete(F) : T.add(F), T;
1046
+ });
1047
+ return /* @__PURE__ */ b("nav", { className: "ds-sidebar", "aria-label": u.region, style: { width: c }, children: [
1048
+ /* @__PURE__ */ b("div", { className: "ds-search", children: [
1049
+ /* @__PURE__ */ n(I, { name: "search", size: 14 }),
1050
+ /* @__PURE__ */ n(
1051
+ "input",
1052
+ {
1053
+ ref: N,
1054
+ className: "ds-input ds-search__input",
1055
+ type: "search",
1056
+ value: f,
1057
+ placeholder: u.searchPlaceholder,
1058
+ "aria-label": u.searchLabel,
1059
+ onChange: (F) => v(F.target.value),
1060
+ onKeyDown: (F) => {
1061
+ F.key === "Escape" && v("");
1062
+ }
1063
+ }
1064
+ ),
1065
+ /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: u.searchShortcut })
1066
+ ] }),
1067
+ /* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": u.tabs, children: [
1068
+ /* @__PURE__ */ n(
1069
+ Oe,
1070
+ {
1071
+ selected: E === "screens",
1072
+ label: u.screensTab,
1073
+ count: M ? a.length : void 0,
1074
+ onSelect: () => p("screens")
1075
+ }
1076
+ ),
1077
+ /* @__PURE__ */ n(
1078
+ Oe,
1079
+ {
1080
+ selected: E === "components",
1081
+ label: u.componentsTab,
1082
+ count: M ? g.length : void 0,
1083
+ onSelect: () => p("components")
1084
+ }
1085
+ )
1086
+ ] }),
1087
+ /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: E === "screens" ? $ ? a.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(f) }) : R.map((F) => {
1088
+ const K = /* @__PURE__ */ n("ul", { className: "ds-items", children: F.screens.map((z) => /* @__PURE__ */ n(
1089
+ zt,
1090
+ {
1091
+ screen: z,
1092
+ active: z.id === s && !o,
1093
+ onOpen: r
1094
+ },
1095
+ z.id
1096
+ )) });
1097
+ if (F.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: K }, "");
1098
+ const T = `screens:${F.name}`, O = k.has(T) && !M;
1099
+ return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
1100
+ /* @__PURE__ */ b(
1072
1101
  "button",
1073
1102
  {
1074
1103
  type: "button",
1075
- className: "ds-module__header",
1076
- "aria-expanded": a,
1077
- onClick: () => e.onToggle(o.module.id),
1104
+ className: "ds-group-section__head",
1105
+ "aria-expanded": !O,
1106
+ "aria-label": u.toggleGroup(F.name),
1107
+ onClick: () => W(T),
1078
1108
  children: [
1079
- /* @__PURE__ */ t("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
1080
- /* @__PURE__ */ t("span", { children: o.module.name }),
1081
- /* @__PURE__ */ t("span", { className: "ds-module__count", children: o.scenarios.length })
1109
+ /* @__PURE__ */ n(I, { name: "chevron", size: 12 }),
1110
+ /* @__PURE__ */ n("span", { children: F.name }),
1111
+ /* @__PURE__ */ n("span", { className: "ds-count", children: F.screens.length })
1082
1112
  ]
1083
1113
  }
1084
1114
  ),
1085
- a && /* @__PURE__ */ t("ul", { className: "ds-module__scenarios", children: o.scenarios.map((i) => /* @__PURE__ */ t(he, { scenario: i, ...e }, i.id)) })
1086
- ] }, o.module.id);
1087
- }),
1088
- e.orphans.length > 0 && /* @__PURE__ */ l("section", { className: "ds-module", children: [
1089
- /* @__PURE__ */ l("div", { className: "ds-module__header", "aria-hidden": "true", children: [
1090
- /* @__PURE__ */ t("span", { className: "ds-module__chevron", children: "▶" }),
1091
- /* @__PURE__ */ t("span", { children: e.withoutModuleLabel }),
1092
- /* @__PURE__ */ t("span", { className: "ds-module__count", children: e.orphans.length })
1093
- ] }),
1094
- /* @__PURE__ */ t("ul", { className: "ds-module__scenarios", children: e.orphans.map((o) => /* @__PURE__ */ t(he, { scenario: o, ...e }, o.id)) })
1095
- ] })
1115
+ !O && K
1116
+ ] }, T);
1117
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyScreens }) : y ? g.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(f) }) : S.map(({ group: F, items: K }) => {
1118
+ const T = k.has(F) && !M;
1119
+ return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
1120
+ /* @__PURE__ */ b(
1121
+ "button",
1122
+ {
1123
+ type: "button",
1124
+ className: "ds-group-section__head",
1125
+ "aria-expanded": !T,
1126
+ "aria-label": u.toggleGroup(F),
1127
+ onClick: () => W(F),
1128
+ children: [
1129
+ /* @__PURE__ */ n(I, { name: "chevron", size: 12 }),
1130
+ /* @__PURE__ */ n("span", { children: F }),
1131
+ /* @__PURE__ */ n("span", { className: "ds-count", children: K.length })
1132
+ ]
1133
+ }
1134
+ ),
1135
+ !T && /* @__PURE__ */ n("ul", { className: "ds-items", children: K.map((O) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1136
+ "button",
1137
+ {
1138
+ type: "button",
1139
+ className: "ds-item",
1140
+ "aria-current": O.id === o ? "true" : void 0,
1141
+ onClick: () => l(O.id),
1142
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: O.name })
1143
+ }
1144
+ ) }, O.id)) })
1145
+ ] }, F);
1146
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyComponents }) }),
1147
+ /* @__PURE__ */ n(
1148
+ Ye,
1149
+ {
1150
+ side: "left",
1151
+ label: u.resize,
1152
+ value: c,
1153
+ onChange: i,
1154
+ onStart: h,
1155
+ onEnd: m
1156
+ }
1157
+ )
1096
1158
  ] });
1097
1159
  }
1098
- function he({
1099
- scenario: e,
1100
- activeScenario: o,
1101
- onOpen: a,
1102
- onKeyDown: i,
1103
- setItemRef: d
1160
+ function Oe({
1161
+ selected: e,
1162
+ label: t,
1163
+ count: s,
1164
+ onSelect: o
1104
1165
  }) {
1105
- const r = P(), n = e.status === "approved" && !e.approvedAt, c = n ? r.inspector.approvalPendingStatus : r.status[e.status];
1106
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
1166
+ return /* @__PURE__ */ b(
1107
1167
  "button",
1108
1168
  {
1109
- ref: (h) => d(e.id, h),
1110
1169
  type: "button",
1111
- className: "ds-scenario",
1112
- "aria-current": e.id === o,
1113
- onClick: () => a(e.id),
1114
- onKeyDown: (h) => i(e.id, h),
1170
+ role: "tab",
1171
+ className: "ds-tab",
1172
+ "aria-selected": e,
1173
+ tabIndex: e ? 0 : -1,
1174
+ onClick: o,
1115
1175
  children: [
1116
- /* @__PURE__ */ t(
1117
- "span",
1118
- {
1119
- className: "ds-status-dot",
1120
- "data-status": e.status,
1121
- "data-approval": n ? "incomplete" : void 0,
1122
- title: c
1123
- }
1124
- ),
1125
- /* @__PURE__ */ t("span", { className: "ds-scenario__title", children: e.title }),
1126
- /* @__PURE__ */ t("span", { className: "ds-visually-hidden", children: c })
1176
+ /* @__PURE__ */ n("span", { children: t }),
1177
+ s !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: s })
1178
+ ]
1179
+ }
1180
+ );
1181
+ }
1182
+ function zt({
1183
+ screen: e,
1184
+ active: t,
1185
+ onOpen: s
1186
+ }) {
1187
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b(
1188
+ "button",
1189
+ {
1190
+ type: "button",
1191
+ className: "ds-item",
1192
+ "aria-current": t ? "true" : void 0,
1193
+ onClick: () => s(e.id),
1194
+ children: [
1195
+ /* @__PURE__ */ n("span", { className: "ds-item__title", children: e.name }),
1196
+ e.variations.length > 1 && /* @__PURE__ */ n("span", { className: "ds-count", children: e.variations.length })
1127
1197
  ]
1128
1198
  }
1129
1199
  ) });
1130
1200
  }
1131
- function nt(e) {
1132
- const o = /* @__PURE__ */ new Map();
1133
- for (const a of e) {
1134
- const i = a.group ?? "Componentes";
1135
- o.set(i, [...o.get(i) ?? [], a]);
1201
+ function At(e, t) {
1202
+ const s = /* @__PURE__ */ new Map();
1203
+ for (const o of e) {
1204
+ const r = o.group?.trim() || t, l = s.get(r) ?? [];
1205
+ l.push(o), s.set(r, l);
1136
1206
  }
1137
- return [...o.entries()];
1207
+ return [...s].map(([o, r]) => ({ group: o, items: r }));
1138
1208
  }
1139
- function me(e) {
1140
- return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
1141
- }
1142
- function rt(e) {
1143
- const o = e.key.toLowerCase();
1144
- return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (o === "k" || o === "f");
1145
- }
1146
- function st(e, o, a) {
1147
- if (e.length === 0) return;
1148
- const i = o ? e.indexOf(o) : -1, d = Math.max(0, Math.min(e.length - 1, i + a));
1149
- return e[d];
1150
- }
1151
- function it({
1152
- product: e,
1153
- scenario: o,
1154
- deploy: a,
1155
- inspectorOpen: i,
1156
- chromeTheme: d,
1157
- view: r,
1158
- handoff: n,
1159
- onToggleInspector: c,
1160
- onToggleChromeTheme: h
1209
+ function Dt(e) {
1210
+ return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
1211
+ }
1212
+ function Kt({
1213
+ screen: e,
1214
+ variations: t,
1215
+ components: s,
1216
+ deploy: o,
1217
+ labels: r,
1218
+ overrides: l
1161
1219
  }) {
1162
- const u = P().topbar, [g, f] = F(!1), p = async () => {
1163
- const _ = o ? Me(o, {
1164
- origin: a.origin,
1165
- overrides: {
1166
- ...d === "light" ? { chromeTheme: d } : {},
1167
- ...r === "ported" ? { view: r } : {},
1168
- ...n ? { handoff: n } : {}
1169
- }
1170
- }) : `${a.origin}${window.location.pathname}${window.location.search}`;
1171
- try {
1172
- await navigator.clipboard.writeText(_);
1173
- } catch {
1174
- window.prompt(u.copyPrompt, _);
1220
+ const c = r.pr, i = [`## ${e.name}`, ""];
1221
+ e.description && i.push(e.description, ""), i.push(`\`${e.route.path}\``, "");
1222
+ const h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? c.commit(o.shortCommit) : void 0;
1223
+ if (i.push(`### ${c.variations}`, ""), t.length === 0) {
1224
+ const d = new URL(e.href, o.origin);
1225
+ xe(d.searchParams, l), i.push(`- [${r.panel.defaultVariation}](${d.toString()})`);
1226
+ }
1227
+ for (const d of t) {
1228
+ const u = he(d, { origin: o.origin, overrides: l });
1229
+ let f = `- [${Xe(d.title)}](${u})`;
1230
+ if (h) {
1231
+ const v = he(d, { origin: h, overrides: l });
1232
+ f += ` · [${m ?? c.immutableLink}](${v})`;
1233
+ } else m && (f += ` · ${m}`);
1234
+ i.push(f);
1235
+ }
1236
+ if (i.push(""), s.length > 0) {
1237
+ i.push(`### ${c.components}`, ""), i.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1238
+ for (const d of s) {
1239
+ const u = d.source ? `\`${me(d.source)}\`` : c.empty;
1240
+ i.push(`| ${me(d.name)} (\`${d.id}\`) | ${u} |`);
1175
1241
  }
1176
- f(!0), window.setTimeout(() => f(!1), 1600);
1177
- }, b = ct(
1178
- typeof window > "u" ? `${a.origin}/` : window.location.href
1179
- ), S = dt(a.origin, d, r, n);
1180
- return /* @__PURE__ */ l("header", { className: "ds-chrome ds-topbar", children: [
1181
- /* @__PURE__ */ l("div", { className: "ds-topbar__product", children: [
1182
- /* @__PURE__ */ t(
1183
- "a",
1184
- {
1185
- className: "ds-topbar__home",
1186
- href: S,
1187
- "aria-label": u.homeTitle(e.name),
1188
- title: u.homeTitle(e.name),
1189
- children: e.name
1242
+ i.push("");
1243
+ }
1244
+ i.push(`### ${c.expected}`, ""), t.length === 0 && i.push(`**${r.panel.defaultVariation}**`, "", c.noExpected, "");
1245
+ for (const d of t) {
1246
+ if (i.push(`**${d.title}**`, ""), d.expected?.length)
1247
+ for (const u of d.expected) i.push(`- ${u}`);
1248
+ else
1249
+ i.push(c.noExpected);
1250
+ i.push("");
1251
+ }
1252
+ return `${i.join(`
1253
+ `).trimEnd()}
1254
+ `;
1255
+ }
1256
+ function me(e) {
1257
+ return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
1258
+ }
1259
+ function Xe(e) {
1260
+ return e.replace(/([[\]])/g, "\\$1");
1261
+ }
1262
+ function Vt({
1263
+ flow: e,
1264
+ registry: t,
1265
+ open: s,
1266
+ deploy: o,
1267
+ labels: r,
1268
+ overrides: l
1269
+ }) {
1270
+ const c = r.pr, i = [`## ${e.name}`, ""], h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? c.commit(o.shortCommit) : void 0, d = (u, f) => {
1271
+ if (s && s.screen.id === u.id) {
1272
+ const C = new URL(s.location.path || "/", f), N = new URLSearchParams(s.location.search);
1273
+ for (const w of ht) N.delete(w);
1274
+ for (const [w, x] of N) C.searchParams.append(w, x);
1275
+ return xe(C.searchParams, l), C.toString();
1276
+ }
1277
+ const v = u.variations[0];
1278
+ if (v) return he(v, { origin: f, overrides: l });
1279
+ const k = new URL(u.href, f);
1280
+ return xe(k.searchParams, l), k.toString();
1281
+ };
1282
+ for (const u of e.screens) {
1283
+ i.push(`### ${u.name}`, ""), u.description && i.push(u.description, "");
1284
+ let f = `\`${u.route.path}\` · [${c.open}](${d(u, o.origin)})`;
1285
+ if (h ? f += ` · [${m ?? c.immutableLink}](${d(u, h)})` : m && (f += ` · ${m}`), i.push(f, ""), u.controls.length > 0) {
1286
+ i.push(`**${c.controls}**`, "");
1287
+ for (const w of u.controls) {
1288
+ i.push(`- ${ce(w.title)} (\`${w.id}\`)`);
1289
+ for (const x of w.controls) {
1290
+ const $ = ge(x), y = x.options.map(
1291
+ (L) => L.value === $ ? `${ce(L.label)} (\`${L.value}\`, ${c.defaultOption})` : `${ce(L.label)} (\`${L.value}\`)`
1292
+ ).join(" · ");
1293
+ i.push(` - ${ce(x.label)} (\`c.${x.id}\`): ${y}`);
1190
1294
  }
1191
- ),
1192
- e.tagline && /* @__PURE__ */ t("span", { className: "ds-topbar__tagline", children: e.tagline })
1193
- ] }),
1194
- /* @__PURE__ */ t("div", { className: "ds-topbar__spacer" }),
1195
- /* @__PURE__ */ l("div", { className: "ds-topbar__meta", children: [
1196
- a.branch && /* @__PURE__ */ t("code", { title: u.branchTitle(a.branch), children: a.branch.length > 28 ? `${a.branch.slice(0, 27)}…` : a.branch }),
1197
- a.commit && /* @__PURE__ */ t("code", { title: u.commitTitle(a.commit), children: a.shortCommit }),
1198
- /* @__PURE__ */ t("code", { title: u.envTitle(a.env), children: a.env })
1199
- ] }),
1200
- /* @__PURE__ */ t(
1201
- "button",
1202
- {
1203
- type: "button",
1204
- className: "ds-btn ds-btn--icon",
1205
- "aria-pressed": d === "light",
1206
- "aria-label": d === "dark" ? u.lightMode : u.darkMode,
1207
- title: d === "dark" ? u.lightMode : u.darkMode,
1208
- onClick: h,
1209
- children: /* @__PURE__ */ t(lt, { theme: d })
1210
- }
1211
- ),
1212
- /* @__PURE__ */ t("button", { type: "button", className: "ds-btn", onClick: p, children: g ? u.copied : u.copyLink }),
1213
- /* @__PURE__ */ t(
1214
- "a",
1215
- {
1216
- className: "ds-btn",
1217
- href: b,
1218
- target: "_blank",
1219
- rel: "noreferrer",
1220
- title: u.cleanReviewTitle,
1221
- children: u.cleanReview
1222
1295
  }
1223
- ),
1224
- /* @__PURE__ */ t(
1225
- "button",
1226
- {
1227
- type: "button",
1228
- className: "ds-btn",
1229
- "aria-pressed": i,
1230
- onClick: c,
1231
- children: u.panel
1296
+ i.push("");
1297
+ }
1298
+ if (u.variations.length > 0) {
1299
+ i.push(`**${c.shortcuts}**`, "");
1300
+ for (const w of u.variations)
1301
+ i.push(
1302
+ `- [${Xe(w.title)}](${he(w, { origin: o.origin, overrides: l })})`
1303
+ );
1304
+ i.push("");
1305
+ }
1306
+ i.push(`**${c.expected}**`, "");
1307
+ const v = s?.screen.id === u.id ? s.variation : void 0, k = v?.expected?.length ? v.expected : u.route.expected, C = u.variations.filter(
1308
+ (w) => w.expected?.length && w.id !== v?.id
1309
+ );
1310
+ if (!k?.length && C.length === 0 && i.push(c.noExpected, ""), k?.length) {
1311
+ for (const w of k) i.push(`- ${w}`);
1312
+ i.push("");
1313
+ }
1314
+ for (const w of C) {
1315
+ i.push(`*${w.title}*`, "");
1316
+ for (const x of w.expected ?? []) i.push(`- ${x}`);
1317
+ i.push("");
1318
+ }
1319
+ const N = t.componentsOfScreen(u);
1320
+ if (N.length > 0) {
1321
+ i.push(`**${c.components}**`, ""), i.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1322
+ for (const w of N) {
1323
+ const x = w.source ? `\`${me(w.source)}\`` : c.empty;
1324
+ i.push(`| ${me(w.name)} (\`${w.id}\`) | ${x} |`);
1232
1325
  }
1233
- )
1234
- ] });
1326
+ i.push("");
1327
+ }
1328
+ }
1329
+ return `${i.join(`
1330
+ `).trimEnd()}
1331
+ `;
1235
1332
  }
1236
- function ct(e) {
1237
- const o = new URL(e);
1238
- return o.searchParams.set(w.chrome, "0"), o.toString();
1239
- }
1240
- function dt(e, o, a = "active", i) {
1241
- const d = new URL("/", e);
1242
- return o === "light" && d.searchParams.set(w.chromeTheme, o), a === "ported" && d.searchParams.set(w.view, "ported"), oe(d.searchParams, i), d.toString();
1243
- }
1244
- function lt({ theme: e }) {
1245
- const o = {
1246
- width: 15,
1247
- height: 15,
1248
- viewBox: "0 0 24 24",
1249
- fill: "none",
1250
- stroke: "currentColor",
1251
- strokeWidth: 2,
1252
- strokeLinecap: "round",
1253
- strokeLinejoin: "round",
1254
- "aria-hidden": !0
1255
- };
1256
- return e === "dark" ? /* @__PURE__ */ l("svg", { ...o, children: [
1257
- /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "4" }),
1258
- /* @__PURE__ */ t("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" })
1259
- ] }) : /* @__PURE__ */ t("svg", { ...o, children: /* @__PURE__ */ t("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
1333
+ function ce(e) {
1334
+ return e.replace(/([*_[\]`])/g, "\\$1");
1260
1335
  }
1261
- function pt({
1262
- registry: e,
1263
- controls: o,
1264
- scenarioActive: a,
1265
- component: i,
1266
- componentFixture: d,
1267
- onChange: r
1268
- }) {
1269
- const n = P(), c = n.controls, { product: h } = e, u = h.dataSources?.adapters ?? [], g = h.theme?.modes ?? [], f = h.theme?.locales ?? [];
1270
- return /* @__PURE__ */ l("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": c.region, children: [
1271
- i?.fixtures?.length ? /* @__PURE__ */ l("div", { className: "ds-field", children: [
1272
- /* @__PURE__ */ t("label", { htmlFor: "ds-component-fixture", children: c.componentFixture }),
1273
- /* @__PURE__ */ t(
1274
- "select",
1275
- {
1276
- id: "ds-component-fixture",
1277
- className: "ds-select",
1278
- value: d?.fixture?.id ?? "",
1279
- onChange: (p) => r({ fixture: p.target.value || void 0 }),
1280
- children: i.fixtures.map((p) => /* @__PURE__ */ t("option", { value: p.id, children: p.label }, p.id))
1281
- }
1282
- )
1283
- ] }) : null,
1284
- a && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1285
- /* @__PURE__ */ t("label", { htmlFor: "ds-persona", children: c.persona }),
1286
- /* @__PURE__ */ l(
1287
- "select",
1336
+ function Ut(e) {
1337
+ const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: l, onResizeEnd: c } = e, i = Q().panel, [h, m] = D(""), d = q(null), u = q(null), [f, v] = D(!1), [k, C] = D(() => /* @__PURE__ */ new Set()), N = (x) => C(($) => {
1338
+ const y = new Set($);
1339
+ return y.has(x) ? y.delete(x) : y.add(x), y;
1340
+ }), w = h.trim().length > 0;
1341
+ return V(() => {
1342
+ const x = ($) => {
1343
+ jt($) && ($.preventDefault(), d.current?.focus(), d.current?.select());
1344
+ };
1345
+ return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1346
+ }, []), Ke(() => {
1347
+ v(Gt(u.current, h));
1348
+ }), /* @__PURE__ */ b("aside", { className: "ds-panel", "aria-label": i.region, style: { width: o }, children: [
1349
+ /* @__PURE__ */ n(
1350
+ Ye,
1351
+ {
1352
+ side: "right",
1353
+ label: i.resize,
1354
+ value: o,
1355
+ onChange: r,
1356
+ onStart: l,
1357
+ onEnd: c
1358
+ }
1359
+ ),
1360
+ /* @__PURE__ */ b("div", { className: "ds-search", children: [
1361
+ /* @__PURE__ */ n(I, { name: "search", size: 14 }),
1362
+ /* @__PURE__ */ n(
1363
+ "input",
1288
1364
  {
1289
- id: "ds-persona",
1290
- className: "ds-select",
1291
- value: o.persona ?? "",
1292
- onChange: (p) => r({ persona: p.target.value || void 0 }),
1293
- children: [
1294
- /* @__PURE__ */ t("option", { value: "", children: c.none }),
1295
- h.personas.map((p) => /* @__PURE__ */ t("option", { value: p.id, children: p.name }, p.id))
1296
- ]
1365
+ ref: d,
1366
+ className: "ds-input ds-search__input",
1367
+ type: "search",
1368
+ value: h,
1369
+ placeholder: i.searchPlaceholder,
1370
+ "aria-label": i.searchLabel,
1371
+ onChange: (x) => m(x.target.value),
1372
+ onKeyDown: (x) => {
1373
+ x.key === "Escape" && m("");
1374
+ }
1297
1375
  }
1298
- )
1376
+ ),
1377
+ /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: i.searchShortcut })
1299
1378
  ] }),
1300
- a && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1301
- /* @__PURE__ */ t("span", { className: "ds-field__label", id: "ds-network-label", children: c.network }),
1302
- /* @__PURE__ */ t("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: ve.map((p) => /* @__PURE__ */ t(
1379
+ /* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": i.tabs, children: [
1380
+ /* @__PURE__ */ n(
1303
1381
  "button",
1304
1382
  {
1305
1383
  type: "button",
1306
- "aria-pressed": o.network === p,
1307
- onClick: () => r({ network: p }),
1308
- children: n.network[p]
1309
- },
1310
- p
1311
- )) })
1312
- ] }),
1313
- /* @__PURE__ */ l("div", { className: "ds-field", children: [
1314
- /* @__PURE__ */ t("span", { className: "ds-field__label", id: "ds-viewport-label", children: c.viewport }),
1315
- /* @__PURE__ */ t("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: ge.map((p) => /* @__PURE__ */ t(
1384
+ role: "tab",
1385
+ className: "ds-tab",
1386
+ "aria-selected": t === "variations",
1387
+ tabIndex: t === "variations" ? 0 : -1,
1388
+ onClick: () => s("variations"),
1389
+ children: i.variationsTab
1390
+ }
1391
+ ),
1392
+ /* @__PURE__ */ n(
1316
1393
  "button",
1317
1394
  {
1318
1395
  type: "button",
1319
- className: "ds-icon-button",
1320
- "aria-pressed": o.viewport === p.id,
1321
- "aria-label": n.viewport[p.id] ?? p.label,
1322
- title: n.viewport[p.id] ?? p.label,
1323
- onClick: () => r({ viewport: p.id }),
1324
- children: /* @__PURE__ */ t(ut, { id: p.id })
1325
- },
1326
- p.id
1327
- )) }),
1328
- o.viewport === "custom" && /* @__PURE__ */ t(
1329
- "input",
1330
- {
1331
- className: "ds-input",
1332
- type: "number",
1333
- min: 240,
1334
- max: 3840,
1335
- step: 10,
1336
- style: { width: 88 },
1337
- "aria-label": c.customWidth,
1338
- value: o.customWidth ?? 1024,
1339
- onChange: (p) => r({ customWidth: Number(p.target.value) || void 0 })
1396
+ role: "tab",
1397
+ className: "ds-tab",
1398
+ "aria-selected": t === "info",
1399
+ tabIndex: t === "info" ? 0 : -1,
1400
+ onClick: () => s("info"),
1401
+ children: i.infoTab
1340
1402
  }
1341
1403
  )
1342
1404
  ] }),
1343
- g.length > 1 && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1344
- /* @__PURE__ */ t("label", { htmlFor: "ds-theme", children: c.theme }),
1345
- /* @__PURE__ */ t(
1405
+ /* @__PURE__ */ b("div", { className: "ds-panel__body", role: "tabpanel", ref: u, children: [
1406
+ t === "variations" ? /* @__PURE__ */ n(It, { ...e, collapsed: k, onToggle: N, filtering: w }) : /* @__PURE__ */ n(Bt, { ...e }),
1407
+ f && /* @__PURE__ */ n("p", { className: "ds-empty", children: i.noMatch(h) })
1408
+ ] })
1409
+ ] });
1410
+ }
1411
+ function It({
1412
+ registry: e,
1413
+ controls: t,
1414
+ screen: s,
1415
+ variation: o,
1416
+ component: r,
1417
+ componentFixture: l,
1418
+ onOpenScenario: c,
1419
+ onOpenComponent: i,
1420
+ onChange: h,
1421
+ collapsed: m,
1422
+ onToggle: d,
1423
+ filtering: u
1424
+ }) {
1425
+ const f = Q(), v = f.panel;
1426
+ if (r) {
1427
+ const p = r.fixtures ?? [];
1428
+ return p.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: v.noComponentVariations }) : /* @__PURE__ */ b(G, { children: [
1429
+ l.didFallback && l.requestedId && l.fixture && /* @__PURE__ */ n("p", { className: "ds-notice", children: v.fixtureFallback(l.requestedId, l.fixture.id) }),
1430
+ /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": v.variationsList, children: p.map((E) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ b(
1431
+ "button",
1432
+ {
1433
+ type: "button",
1434
+ className: "ds-item ds-item--stacked",
1435
+ "aria-current": l.fixture?.id === E.id ? "true" : void 0,
1436
+ onClick: () => h({ fixture: E.id }),
1437
+ children: [
1438
+ /* @__PURE__ */ n("span", { className: "ds-item__title", children: E.label }),
1439
+ E.description && /* @__PURE__ */ n("span", { className: "ds-item__hint", children: E.description })
1440
+ ]
1441
+ }
1442
+ ) }, E.id)) })
1443
+ ] });
1444
+ }
1445
+ if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: v.nothingSelected });
1446
+ const k = s.variations, C = e.product, N = C.theme?.modes ?? [], w = C.theme?.locales ?? [], x = C.dataSources?.adapters ?? [], $ = t.screenControls ?? {}, y = o && bt(o, $) ? o : void 0, L = (p, E) => h({ screenControls: { ...$, [p]: E } });
1447
+ return /* @__PURE__ */ b(G, { children: [
1448
+ /* @__PURE__ */ n(be, { id: "context", title: v.context, collapsed: m, onToggle: d, filtering: u, children: /* @__PURE__ */ b("div", { className: "ds-fields ds-fields--flush", children: [
1449
+ /* @__PURE__ */ n(te, { label: v.persona, children: /* @__PURE__ */ b(
1346
1450
  "select",
1347
1451
  {
1348
- id: "ds-theme",
1349
1452
  className: "ds-select",
1350
- value: o.themeMode ?? g[0],
1351
- onChange: (p) => r({ themeMode: p.target.value }),
1352
- children: g.map((p) => /* @__PURE__ */ t("option", { value: p, children: p }, p))
1453
+ value: t.persona ?? "",
1454
+ onChange: (p) => h({ persona: p.target.value || void 0 }),
1455
+ children: [
1456
+ /* @__PURE__ */ n("option", { value: "", children: v.none }),
1457
+ C.personas.map((p) => /* @__PURE__ */ n("option", { value: p.id, children: p.name }, p.id))
1458
+ ]
1353
1459
  }
1354
- )
1355
- ] }),
1356
- f.length > 1 && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1357
- /* @__PURE__ */ t("label", { htmlFor: "ds-locale", children: c.locale }),
1358
- /* @__PURE__ */ t(
1460
+ ) }),
1461
+ /* @__PURE__ */ n(te, { label: v.network, children: /* @__PURE__ */ n(
1359
1462
  "select",
1360
1463
  {
1361
- id: "ds-locale",
1362
1464
  className: "ds-select",
1363
- value: o.locale ?? f[0],
1364
- onChange: (p) => r({ locale: p.target.value }),
1365
- children: f.map((p) => /* @__PURE__ */ t("option", { value: p, children: p }, p))
1465
+ value: t.network,
1466
+ onChange: (p) => h({ network: p.target.value }),
1467
+ children: We.map((p) => /* @__PURE__ */ n("option", { value: p, children: f.network[p] }, p))
1366
1468
  }
1367
- )
1368
- ] }),
1369
- a && u.length > 0 && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1370
- /* @__PURE__ */ t("label", { htmlFor: "ds-source", children: c.dataSource }),
1371
- /* @__PURE__ */ l(
1469
+ ) }),
1470
+ N.length > 1 && /* @__PURE__ */ n(te, { label: v.theme, children: /* @__PURE__ */ n(
1372
1471
  "select",
1373
1472
  {
1374
- id: "ds-source",
1375
1473
  className: "ds-select",
1376
- value: o.dataSource ?? "fixtures",
1377
- onChange: (p) => r({ dataSource: p.target.value }),
1378
- children: [
1379
- /* @__PURE__ */ t("option", { value: "fixtures", children: c.fixturesOption }),
1380
- u.filter((p) => p.id !== "fixtures").map((p) => /* @__PURE__ */ t("option", { value: p.id, children: p.label }, p.id))
1381
- ]
1474
+ value: t.themeMode ?? N[0],
1475
+ onChange: (p) => h({ themeMode: p.target.value }),
1476
+ children: N.map((p) => /* @__PURE__ */ n("option", { value: p, children: p }, p))
1382
1477
  }
1383
- )
1384
- ] })
1385
- ] });
1386
- }
1387
- function ut({ id: e }) {
1388
- const o = {
1389
- width: 16,
1390
- height: 16,
1391
- viewBox: "0 0 24 24",
1392
- fill: "none",
1393
- stroke: "currentColor",
1394
- strokeWidth: 2,
1395
- strokeLinecap: "round",
1396
- strokeLinejoin: "round",
1397
- "aria-hidden": !0
1398
- };
1399
- return e === "fit" ? /* @__PURE__ */ t("svg", { ...o, children: /* @__PURE__ */ t("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__ */ l("svg", { ...o, children: [
1400
- /* @__PURE__ */ t("rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }),
1401
- /* @__PURE__ */ t("path", { d: "M12 18h.01" })
1402
- ] }) : e === "tablet" ? /* @__PURE__ */ l("svg", { ...o, children: [
1403
- /* @__PURE__ */ t("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2" }),
1404
- /* @__PURE__ */ t("path", { d: "M12 18h.01" })
1405
- ] }) : e === "desktop" ? /* @__PURE__ */ l("svg", { ...o, children: [
1406
- /* @__PURE__ */ t("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1407
- /* @__PURE__ */ t("path", { d: "M8 21h8M12 17v4" })
1408
- ] }) : /* @__PURE__ */ t("svg", { ...o, children: /* @__PURE__ */ t("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) });
1409
- }
1410
- function ht({
1411
- registry: e,
1412
- scenario: o,
1413
- component: a,
1414
- componentFixture: i,
1415
- controls: d,
1416
- focusedNode: r,
1417
- tabStopCount: n
1418
- }) {
1419
- const c = P().inspector, [h, u] = F("scenario"), g = e.issues.filter((f) => f.level === "error").length;
1420
- return /* @__PURE__ */ l("aside", { className: "ds-chrome ds-inspector", "aria-label": c.region, children: [
1421
- /* @__PURE__ */ l("div", { className: "ds-inspector__tabs", role: "tablist", children: [
1422
- /* @__PURE__ */ t(ne, { id: "scenario", current: h, onSelect: u, children: a ? c.componentReference : c.tabScenario }),
1423
- /* @__PURE__ */ t(ne, { id: "a11y", current: h, onSelect: u, children: c.tabA11y }),
1424
- /* @__PURE__ */ t(ne, { id: "diagnostics", current: h, onSelect: u, children: g > 0 ? c.diagnosticsWithErrors(g) : c.tabDiagnostics })
1425
- ] }),
1426
- /* @__PURE__ */ l("div", { className: "ds-inspector__body", role: "tabpanel", children: [
1427
- h === "scenario" && /* @__PURE__ */ t(
1428
- mt,
1478
+ ) }),
1479
+ w.length > 1 && /* @__PURE__ */ n(te, { label: v.locale, children: /* @__PURE__ */ n(
1480
+ "select",
1429
1481
  {
1430
- registry: e,
1431
- scenario: o,
1432
- component: a,
1433
- componentFixture: i,
1434
- controls: d
1482
+ className: "ds-select",
1483
+ value: t.locale ?? w[0],
1484
+ onChange: (p) => h({ locale: p.target.value }),
1485
+ children: w.map((p) => /* @__PURE__ */ n("option", { value: p, children: p }, p))
1435
1486
  }
1436
- ),
1437
- h === "a11y" && /* @__PURE__ */ t(
1438
- ft,
1487
+ ) }),
1488
+ x.length > 0 && /* @__PURE__ */ n(te, { label: v.dataSource, children: /* @__PURE__ */ b(
1489
+ "select",
1439
1490
  {
1440
- registry: e,
1441
- scenario: o,
1442
- focusedNode: r,
1443
- keyboardMode: d.keyboardMode,
1444
- tabStopCount: n
1491
+ className: "ds-select",
1492
+ value: t.dataSource ?? "fixtures",
1493
+ onChange: (p) => h({ dataSource: p.target.value }),
1494
+ children: [
1495
+ /* @__PURE__ */ n("option", { value: "fixtures", children: v.fixturesOption }),
1496
+ x.map((p) => /* @__PURE__ */ n("option", { value: p.id, children: p.label }, p.id))
1497
+ ]
1445
1498
  }
1446
- ),
1447
- h === "diagnostics" && /* @__PURE__ */ t(bt, { registry: e })
1448
- ] })
1449
- ] });
1450
- }
1451
- function ne({
1452
- id: e,
1453
- current: o,
1454
- onSelect: a,
1455
- children: i
1456
- }) {
1457
- return /* @__PURE__ */ t(
1458
- "button",
1459
- {
1460
- type: "button",
1461
- role: "tab",
1462
- "aria-selected": o === e,
1463
- onClick: () => a(e),
1464
- children: i
1465
- }
1466
- );
1467
- }
1468
- function mt({
1469
- registry: e,
1470
- scenario: o,
1471
- component: a,
1472
- componentFixture: i,
1473
- controls: d
1474
- }) {
1475
- const r = P(), n = r.inspector;
1476
- if (!o)
1477
- return a ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1478
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.componentReference }),
1479
- /* @__PURE__ */ t("p", { style: { color: "var(--ds-fg)", fontSize: 15, fontWeight: 600 }, children: a.name }),
1480
- a.description && /* @__PURE__ */ t("p", { children: a.description }),
1481
- /* @__PURE__ */ l("dl", { className: "ds-kv", style: { marginTop: 14 }, children: [
1482
- /* @__PURE__ */ t("dt", { children: n.id }),
1483
- /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: a.id }),
1484
- a.group && /* @__PURE__ */ l(A, { children: [
1485
- /* @__PURE__ */ t("dt", { children: n.componentGroup }),
1486
- /* @__PURE__ */ t("dd", { children: a.group })
1487
- ] }),
1488
- i?.fixture && /* @__PURE__ */ l(A, { children: [
1489
- /* @__PURE__ */ t("dt", { children: n.componentFixture }),
1490
- /* @__PURE__ */ l("dd", { children: [
1491
- i.fixture.label,
1492
- " ",
1493
- /* @__PURE__ */ t("code", { children: i.fixture.id })
1494
- ] }),
1495
- i.fixture.description && /* @__PURE__ */ l(A, { children: [
1496
- /* @__PURE__ */ t("dt", { children: n.componentFixtureDescription }),
1497
- /* @__PURE__ */ t("dd", { children: i.fixture.description })
1498
- ] })
1499
- ] })
1500
- ] }),
1501
- i?.didFallback && i.fixture && /* @__PURE__ */ t("p", { className: "ds-note", "data-tone": "warn", children: n.componentFixtureFallback(
1502
- i.requestedId ?? "",
1503
- i.fixture.id
1504
1499
  ) })
1505
- ] }) : /* @__PURE__ */ t("p", { className: "ds-block", children: n.noScenario });
1506
- const c = e.persona(d.persona ?? o.persona), h = d.persona ? e.persona(d.persona)?.permissions ?? [] : e.permissionsOf(o), u = e.rulesOf(o), g = e.fixture(d.fixture ?? o.fixture), f = !!(d.persona && d.persona !== o.persona), p = o.status !== "approved" || !!o.approvedAt;
1507
- return /* @__PURE__ */ l(A, { children: [
1508
- /* @__PURE__ */ l(
1509
- z,
1510
- {
1511
- scope: "task",
1512
- title: n.taskScope,
1513
- description: n.taskScopeDescription,
1514
- children: [
1515
- /* @__PURE__ */ l("div", { className: "ds-block", children: [
1516
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.situation }),
1517
- /* @__PURE__ */ t("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: o.title }),
1518
- o.intent && /* @__PURE__ */ t("p", { children: o.intent }),
1519
- /* @__PURE__ */ l("div", { className: "ds-chips", children: [
1520
- /* @__PURE__ */ t("span", { className: "ds-chip", "data-tone": gt(o), children: p ? r.status[o.status] : n.approvalPendingStatus }),
1521
- (o.tags ?? []).map((b) => /* @__PURE__ */ t("span", { className: "ds-chip", children: b }, b))
1500
+ ] }) }),
1501
+ s.controls.map((p) => {
1502
+ const E = e.component(p.component);
1503
+ return /* @__PURE__ */ b(
1504
+ be,
1505
+ {
1506
+ id: `group:${p.id}`,
1507
+ title: p.title,
1508
+ count: p.controls.length,
1509
+ collapsed: m,
1510
+ onToggle: d,
1511
+ filtering: u,
1512
+ children: [
1513
+ (p.note || E) && /* @__PURE__ */ b("div", { className: "ds-group-section__note", "data-ds-filter": !0, children: [
1514
+ p.note && /* @__PURE__ */ n("span", { children: p.note }),
1515
+ E && /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => i(E.id), children: v.openComponent(E.name) })
1522
1516
  ] }),
1523
- /* @__PURE__ */ t("p", { style: { marginTop: 6 }, children: p ? r.statusMeaning[o.status] : n.approvalPendingMeaning })
1524
- ] }),
1525
- /* @__PURE__ */ l("div", { className: "ds-block", children: [
1526
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.reproduction }),
1527
- /* @__PURE__ */ l("dl", { className: "ds-kv", children: [
1528
- /* @__PURE__ */ t("dt", { children: n.id }),
1529
- /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: o.id }),
1530
- /* @__PURE__ */ t("dt", { children: n.route }),
1531
- /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: o.route }),
1532
- /* @__PURE__ */ t("dt", { children: n.data }),
1533
- /* @__PURE__ */ t("dd", { children: g?.label ?? "—" }),
1534
- /* @__PURE__ */ t("dt", { children: n.network }),
1535
- /* @__PURE__ */ t("dd", { children: r.network[d.network] })
1536
- ] })
1537
- ] }),
1538
- o.preconditions?.length ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1539
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.preconditions }),
1540
- /* @__PURE__ */ t("ul", { className: "ds-list", children: o.preconditions.map((b) => /* @__PURE__ */ t("li", { children: b }, b)) })
1541
- ] }) : null,
1542
- u.length > 0 && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1543
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.rules }),
1544
- u.map((b) => /* @__PURE__ */ l("div", { className: "ds-rule", children: [
1545
- /* @__PURE__ */ t("span", { className: "ds-rule__id", children: b.id }),
1546
- /* @__PURE__ */ t("span", { className: "ds-rule__statement", children: b.statement }),
1547
- b.rationale && /* @__PURE__ */ t("p", { className: "ds-rule__rationale", children: b.rationale })
1548
- ] }, b.id))
1549
- ] }),
1550
- o.actions?.length ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1551
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.actions }),
1552
- /* @__PURE__ */ t("ul", { className: "ds-list", children: o.actions.map((b) => /* @__PURE__ */ t("li", { children: b }, b)) })
1553
- ] }) : null,
1554
- o.expected?.length ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1555
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.expected }),
1556
- /* @__PURE__ */ t("ul", { className: "ds-list", children: o.expected.map((b) => /* @__PURE__ */ t("li", { children: b }, b)) })
1557
- ] }) : null,
1558
- (o.status === "approved" || o.approvedAt) && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1559
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.approval }),
1560
- o.approvedAt ? /* @__PURE__ */ l(A, { children: [
1561
- /* @__PURE__ */ l("p", { children: [
1562
- o.approvedAt.date,
1563
- " · ",
1564
- /* @__PURE__ */ t("code", { children: o.approvedAt.commit.slice(0, 7) })
1565
- ] }),
1566
- /* @__PURE__ */ t("a", { href: o.approvedAt.url, target: "_blank", rel: "noreferrer", children: n.openApproved })
1567
- ] }) : /* @__PURE__ */ t("p", { className: "ds-note", "data-tone": "warn", role: "alert", children: n.approvalMissing })
1568
- ] }),
1569
- o.ticket && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1570
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.engineering }),
1571
- /* @__PURE__ */ t("p", { children: o.ticket })
1572
- ] })
1573
- ]
1574
- }
1575
- ),
1576
- /* @__PURE__ */ l(
1577
- z,
1517
+ /* @__PURE__ */ n("div", { className: "ds-fields ds-fields--flush", children: p.controls.map((a) => /* @__PURE__ */ n(
1518
+ Ht,
1519
+ {
1520
+ control: a,
1521
+ value: $[a.id] ?? ge(a),
1522
+ onChange: (g) => L(a.id, g)
1523
+ },
1524
+ a.id
1525
+ )) })
1526
+ ]
1527
+ },
1528
+ p.id
1529
+ );
1530
+ }),
1531
+ (k.length > 0 || s.controls.length === 0) && /* @__PURE__ */ n(
1532
+ be,
1578
1533
  {
1579
- scope: "inherited",
1580
- title: n.inheritedScope,
1581
- description: n.inheritedScopeDescription,
1582
- children: [
1583
- /* @__PURE__ */ l("div", { className: "ds-block", children: [
1584
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.persona }),
1585
- /* @__PURE__ */ l("p", { style: { color: "var(--ds-fg)", fontWeight: 600 }, children: [
1586
- c?.name ?? "—",
1587
- f && /* @__PURE__ */ t("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: n.personaSwapped })
1588
- ] }),
1589
- c?.goal && /* @__PURE__ */ t("p", { children: n.goal(c.goal) })
1590
- ] }),
1591
- h.length > 0 && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1592
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.permissions }),
1593
- /* @__PURE__ */ t("div", { className: "ds-chips", children: h.map((b) => /* @__PURE__ */ t("span", { className: "ds-chip", children: b }, b)) })
1594
- ] })
1595
- ]
1534
+ id: "shortcuts",
1535
+ title: v.shortcuts,
1536
+ count: k.length || void 0,
1537
+ collapsed: m,
1538
+ onToggle: d,
1539
+ filtering: u,
1540
+ children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": v.variationsList, children: k.length === 0 ? /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b("div", { className: "ds-item ds-item--stacked", "aria-current": "true", children: [
1541
+ /* @__PURE__ */ n("span", { className: "ds-item__title", children: v.defaultVariation }),
1542
+ /* @__PURE__ */ n("span", { className: "ds-item__hint", children: v.defaultVariationHint })
1543
+ ] }) }) : k.map((p) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1544
+ "button",
1545
+ {
1546
+ type: "button",
1547
+ className: "ds-item",
1548
+ title: p.intent,
1549
+ "aria-current": y?.id === p.id ? "true" : void 0,
1550
+ onClick: () => c(p.id),
1551
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: p.title })
1552
+ }
1553
+ ) }, p.id)) })
1596
1554
  }
1597
1555
  )
1598
1556
  ] });
1599
1557
  }
1600
- function ft({
1601
- registry: e,
1602
- scenario: o,
1603
- focusedNode: a,
1604
- keyboardMode: i,
1605
- tabStopCount: d
1558
+ function be({
1559
+ id: e,
1560
+ title: t,
1561
+ count: s,
1562
+ collapsed: o,
1563
+ onToggle: r,
1564
+ filtering: l,
1565
+ children: c
1606
1566
  }) {
1607
- const r = P(), n = r.inspector, c = Ce(e.product.theme?.contrastPairs), h = c.filter((u) => u.passes !== !0);
1608
- return /* @__PURE__ */ l(A, { children: [
1609
- o && /* @__PURE__ */ t(
1610
- z,
1611
- {
1612
- scope: "task",
1613
- title: n.taskScope,
1614
- description: n.taskScopeDescription,
1615
- children: /* @__PURE__ */ l("div", { className: "ds-block", children: [
1616
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.a11yContract }),
1617
- /* @__PURE__ */ l("dl", { className: "ds-kv", children: [
1618
- /* @__PURE__ */ t("dt", { children: n.keyboard }),
1619
- /* @__PURE__ */ t("dd", { children: r.keyboard[o.a11y.keyboard] }),
1620
- /* @__PURE__ */ t("dt", { children: n.contrast }),
1621
- /* @__PURE__ */ t("dd", { children: n.contrastTarget(o.a11y.contrast) })
1622
- ] }),
1623
- o.a11y.announces?.length ? /* @__PURE__ */ l(A, { children: [
1624
- /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: n.announces }),
1625
- /* @__PURE__ */ t("div", { className: "ds-chips", children: o.a11y.announces.map((u) => /* @__PURE__ */ t("span", { className: "ds-chip", children: u }, u)) })
1626
- ] }) : null,
1627
- o.a11y.notes && /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: o.a11y.notes })
1628
- ] })
1629
- }
1630
- ),
1631
- /* @__PURE__ */ t(
1632
- z,
1633
- {
1634
- scope: "screen",
1635
- title: n.screenScope,
1636
- description: n.screenScopeDescription,
1637
- children: /* @__PURE__ */ l("div", { className: "ds-block", children: [
1638
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.focusedElement }),
1639
- i ? a ? /* @__PURE__ */ l(A, { children: [
1640
- /* @__PURE__ */ l("dl", { className: "ds-kv", children: [
1641
- /* @__PURE__ */ t("dt", { children: n.role }),
1642
- /* @__PURE__ */ t("dd", { children: a.role }),
1643
- /* @__PURE__ */ t("dt", { children: n.name }),
1644
- /* @__PURE__ */ t("dd", { children: a.name ? a.name : /* @__PURE__ */ t("span", { style: { color: "var(--ds-err)" }, children: n.noAccessibleName }) }),
1645
- /* @__PURE__ */ t("dt", { children: n.nameFrom }),
1646
- /* @__PURE__ */ t("dd", { children: a.nameFrom }),
1647
- a.description ? /* @__PURE__ */ l(A, { children: [
1648
- /* @__PURE__ */ t("dt", { children: n.description }),
1649
- /* @__PURE__ */ t("dd", { children: a.description })
1650
- ] }) : null,
1651
- /* @__PURE__ */ t("dt", { children: n.selector }),
1652
- /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: a.selector })
1653
- ] }),
1654
- a.states.length > 0 && /* @__PURE__ */ t("div", { className: "ds-chips", style: { marginTop: 8 }, children: a.states.map((u) => /* @__PURE__ */ t("span", { className: "ds-chip", children: u }, u)) }),
1655
- a.hiddenFromAssistiveTech && /* @__PURE__ */ t("p", { className: "ds-note", style: { marginTop: 8 }, children: n.focusableButHidden }),
1656
- /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: n.tabStopsInStage(d) })
1657
- ] }) : /* @__PURE__ */ t("p", { children: n.pressTab(d) }) : /* @__PURE__ */ t("p", { children: n.keyboardModeOff })
1658
- ] })
1659
- }
1660
- ),
1661
- /* @__PURE__ */ l(
1662
- z,
1567
+ const i = Q().panel, h = o.has(e) && !l;
1568
+ return /* @__PURE__ */ b("section", { className: "ds-group-section", "data-ds-filter-group": !0, children: [
1569
+ /* @__PURE__ */ b(
1570
+ "button",
1663
1571
  {
1664
- scope: "product",
1665
- title: n.productScope,
1666
- description: n.productScopeDescription,
1572
+ type: "button",
1573
+ className: "ds-group-section__head",
1574
+ "aria-expanded": !h,
1575
+ "aria-label": i.toggleGroup(t),
1576
+ onClick: () => r(e),
1667
1577
  children: [
1668
- /* @__PURE__ */ l("div", { className: "ds-block", children: [
1669
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.tokenContrast }),
1670
- c.length === 0 ? /* @__PURE__ */ t("p", { children: n.noContrastPairs }) : /* @__PURE__ */ l("table", { className: "ds-contrast", children: [
1671
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { children: [
1672
- /* @__PURE__ */ t("th", { scope: "col", children: n.pair }),
1673
- /* @__PURE__ */ t("th", { scope: "col", children: n.ratio })
1674
- ] }) }),
1675
- /* @__PURE__ */ t("tbody", { children: c.map((u) => /* @__PURE__ */ l("tr", { children: [
1676
- /* @__PURE__ */ l("td", { children: [
1677
- /* @__PURE__ */ t(
1678
- "span",
1679
- {
1680
- className: "ds-swatch",
1681
- style: { background: u.pair.background },
1682
- "aria-hidden": "true"
1683
- }
1684
- ),
1685
- /* @__PURE__ */ t(
1686
- "span",
1687
- {
1688
- className: "ds-swatch",
1689
- style: { background: u.pair.foreground },
1690
- "aria-hidden": "true"
1691
- }
1692
- ),
1693
- u.pair.name
1694
- ] }),
1695
- /* @__PURE__ */ t(
1696
- "td",
1697
- {
1698
- style: {
1699
- color: u.passes === !0 ? "var(--ds-ok)" : u.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1700
- },
1701
- children: u.label
1702
- }
1703
- )
1704
- ] }, u.pair.name)) })
1705
- ] }),
1706
- h.length > 0 && /* @__PURE__ */ t("p", { className: "ds-note", style: { marginTop: 8 }, children: n.pairsFailing(h.length) })
1707
- ] }),
1708
- /* @__PURE__ */ t("p", { className: "ds-note", children: n.automatedIsFloor })
1578
+ /* @__PURE__ */ n(I, { name: "chevron", size: 12 }),
1579
+ /* @__PURE__ */ n("span", { "data-ds-filter-title": !0, children: t }),
1580
+ s !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: s })
1709
1581
  ]
1710
1582
  }
1711
- )
1583
+ ),
1584
+ !h && c
1712
1585
  ] });
1713
1586
  }
1714
- function bt({ registry: e }) {
1715
- const o = P(), a = o.inspector, i = e.coverage({ includePorted: !0 }), { issues: d } = e;
1716
- return /* @__PURE__ */ t(A, { children: /* @__PURE__ */ l(
1717
- z,
1718
- {
1719
- scope: "product",
1720
- title: a.productScope,
1721
- description: a.diagnosticsProductNotice,
1722
- children: [
1723
- /* @__PURE__ */ l("div", { className: "ds-block", children: [
1724
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: a.coverage }),
1725
- /* @__PURE__ */ t("dl", { className: "ds-kv", children: Object.entries(i).filter(([, r]) => r > 0).map(([r, n]) => /* @__PURE__ */ l("div", { style: { display: "contents" }, children: [
1726
- /* @__PURE__ */ t("dt", { children: o.status[r] }),
1727
- /* @__PURE__ */ t("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: n })
1728
- ] }, r)) }),
1729
- /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: a.scenariosRegistered(e.product.scenarios.length) })
1730
- ] }),
1731
- /* @__PURE__ */ l("div", { className: "ds-block", children: [
1732
- /* @__PURE__ */ t("h2", { className: "ds-block__title", children: a.scenarioContract }),
1733
- d.length === 0 ? /* @__PURE__ */ t("p", { children: a.noIssues }) : d.map((r, n) => /* @__PURE__ */ l("div", { className: "ds-issue", "data-level": r.level, children: [
1734
- /* @__PURE__ */ t("span", { className: "ds-issue__where", children: r.where }),
1735
- r.message
1736
- ] }, `${r.where}-${n}`))
1737
- ] })
1738
- ]
1739
- }
1740
- ) });
1587
+ function Wt(e) {
1588
+ const t = e.options ?? [], s = t.reduce((o, r) => o + r.label.length, 0);
1589
+ return t.length > 0 && t.length <= 4 && s <= 24;
1741
1590
  }
1742
- const vt = {
1743
- ported: void 0,
1744
- proposed: "warn",
1745
- "in-review": "warn",
1746
- approved: "ok",
1747
- "in-implementation": void 0,
1748
- implemented: "ok",
1749
- superseded: void 0
1750
- };
1751
- function gt(e) {
1752
- return e.status === "approved" && !e.approvedAt ? "warn" : vt[e.status];
1753
- }
1754
- function z({
1755
- scope: e,
1756
- title: o,
1757
- description: a,
1758
- children: i
1591
+ function Ht({
1592
+ control: e,
1593
+ value: t,
1594
+ onChange: s
1759
1595
  }) {
1760
- return /* @__PURE__ */ l("section", { className: "ds-scope-group", "data-scope": e, children: [
1761
- /* @__PURE__ */ l("header", { className: "ds-scope-group__header", children: [
1762
- /* @__PURE__ */ t("h2", { children: o }),
1763
- /* @__PURE__ */ t("p", { children: a })
1764
- ] }),
1765
- i
1766
- ] });
1767
- }
1768
- const wt = xe(function({ viewport: o, textScale: a, reducedMotion: i, keyboardMode: d, children: r }, n) {
1769
- return /* @__PURE__ */ t("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ t(
1770
- "div",
1771
- {
1772
- ref: n,
1773
- className: "ds-stage",
1774
- "data-viewport": o.id,
1775
- "data-keyboard-mode": d,
1776
- "data-reduced-motion": i,
1777
- style: {
1778
- width: o.width ? `${o.width}px` : "100%",
1779
- minHeight: o.height ? `${o.height}px` : void 0,
1780
- // A ampliação é aplicada no `font-size` do contêiner, não com
1781
- // `transform: scale`. É a diferença entre testar se o layout aguenta
1782
- // texto grande e só dar zoom na captura de tela.
1783
- fontSize: a === 1 ? void 0 : `${a * 100}%`
1596
+ const o = e.options ?? [];
1597
+ return Wt(e) ? /* @__PURE__ */ b("div", { className: "ds-field", "data-ds-filter": !0, children: [
1598
+ /* @__PURE__ */ n("span", { className: "ds-field__label", id: `ds-control-${e.id}`, children: e.label }),
1599
+ /* @__PURE__ */ n("div", { className: "ds-tabs ds-tabs--segmented", role: "radiogroup", "aria-labelledby": `ds-control-${e.id}`, children: o.map((r) => /* @__PURE__ */ n(
1600
+ "button",
1601
+ {
1602
+ type: "button",
1603
+ role: "radio",
1604
+ className: "ds-tab",
1605
+ "aria-checked": r.value === t,
1606
+ tabIndex: r.value === t ? 0 : -1,
1607
+ onClick: () => s(r.value),
1608
+ children: r.label
1784
1609
  },
1785
- children: r
1786
- }
1787
- ) });
1788
- });
1789
- function kt({ stops: e }) {
1790
- return e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((o) => /* @__PURE__ */ t(
1791
- "span",
1792
- {
1793
- className: "ds-taborder__badge",
1794
- "data-forced": o.forcedOrder,
1795
- style: { top: o.rect.top, left: o.rect.left },
1796
- children: o.index
1797
- },
1798
- `${o.index}-${o.rect.top}-${o.rect.left}`
1799
- )) });
1610
+ r.value
1611
+ )) }),
1612
+ e.description && /* @__PURE__ */ n("span", { className: "ds-field__hint", children: e.description })
1613
+ ] }) : /* @__PURE__ */ n(te, { label: e.label, hint: e.description, children: /* @__PURE__ */ n("select", { className: "ds-select", value: t, onChange: (r) => s(r.target.value), children: o.map((r) => /* @__PURE__ */ n("option", { value: r.value, children: r.label }, r.value)) }) });
1800
1614
  }
1801
- function fe({ title: e, children: o }) {
1802
- return /* @__PURE__ */ l("div", { className: "ds-chrome ds-stage-empty", children: [
1803
- /* @__PURE__ */ t("h2", { children: e }),
1804
- o
1615
+ function te({ label: e, hint: t, children: s }) {
1616
+ return /* @__PURE__ */ b("label", { className: "ds-field", "data-ds-filter": !0, children: [
1617
+ /* @__PURE__ */ n("span", { className: "ds-field__label", children: e }),
1618
+ s,
1619
+ t && /* @__PURE__ */ n("span", { className: "ds-field__hint", children: t })
1805
1620
  ] });
1806
1621
  }
1807
- function Nt({
1622
+ function Bt({
1808
1623
  registry: e,
1809
- onOpenScenario: o,
1810
- view: a,
1811
- onViewChange: i,
1812
- handoff: d,
1813
- showPorted: r = !1
1624
+ controls: t,
1625
+ deploy: s,
1626
+ location: o,
1627
+ screen: r,
1628
+ variation: l,
1629
+ component: c,
1630
+ onOpenScenario: i,
1631
+ onOpenComponent: h
1814
1632
  }) {
1815
- const n = P(), { product: c } = e, h = a ?? (r ? "ported" : "active"), u = { view: h, handoff: d }, g = e.coverage(u), f = e.activeScenarios(u).length, p = e.treeFor(u).filter((s) => s.scenarios.length > 0), b = e.orphansFor(u), S = e.byStatus("ported", { handoff: d }).length, _ = h === "ported" ? n.sidebar.portedReferences(S) : n.sidebar.activeWork;
1816
- return /* @__PURE__ */ l("div", { className: "ds-chrome ds-home", children: [
1817
- /* @__PURE__ */ l("header", { className: "ds-home__header", children: [
1818
- /* @__PURE__ */ t("p", { className: "ds-home__view", "aria-live": "polite", children: _ }),
1819
- /* @__PURE__ */ t("h1", { children: c.name }),
1820
- c.tagline && /* @__PURE__ */ t("p", { className: "ds-home__tagline", children: c.tagline }),
1821
- /* @__PURE__ */ t("p", { className: "ds-home__lead", children: n.home.lead(f) }),
1822
- /* @__PURE__ */ t("div", { className: "ds-chips", children: Object.entries(g).filter(([, s]) => s > 0).map(([s, m]) => /* @__PURE__ */ l("span", { className: "ds-chip", children: [
1823
- n.status[s],
1824
- ": ",
1825
- m
1826
- ] }, s)) }),
1827
- f > 0 && h === "active" && S > 0 && /* @__PURE__ */ t(
1828
- "button",
1829
- {
1830
- type: "button",
1831
- className: "ds-text-action ds-home__view-action",
1832
- onClick: () => i?.("ported"),
1833
- children: n.sidebar.viewPorted(S)
1834
- }
1835
- ),
1836
- h === "ported" && /* @__PURE__ */ t(
1837
- "button",
1838
- {
1839
- type: "button",
1840
- className: "ds-text-action ds-home__view-action",
1841
- onClick: () => i?.("active"),
1842
- children: n.sidebar.backToActive
1843
- }
1844
- )
1845
- ] }),
1846
- /* @__PURE__ */ l("section", { className: "ds-home__legend", "aria-labelledby": "ds-status-legend-title", children: [
1847
- /* @__PURE__ */ t("h2", { id: "ds-status-legend-title", children: n.home.statusLegend }),
1848
- /* @__PURE__ */ t("ul", { children: be.map((s) => /* @__PURE__ */ l("li", { children: [
1849
- /* @__PURE__ */ t("span", { className: "ds-status-dot", "data-status": s, "aria-hidden": "true" }),
1850
- /* @__PURE__ */ l("span", { children: [
1851
- /* @__PURE__ */ t("strong", { children: n.status[s] }),
1852
- /* @__PURE__ */ t("small", { children: n.statusMeaning[s] })
1853
- ] })
1854
- ] }, s)) })
1633
+ const m = Q(), d = m.info, [u, f] = D(!1);
1634
+ if (c) {
1635
+ const y = e.usagesOf(c.id, { handoff: t.handoff });
1636
+ return /* @__PURE__ */ b("div", { className: "ds-info", children: [
1637
+ /* @__PURE__ */ b(ee, { title: d.component, children: [
1638
+ /* @__PURE__ */ n(U, { term: d.name, children: c.name }),
1639
+ /* @__PURE__ */ n(U, { term: d.id, children: /* @__PURE__ */ n("code", { children: c.id }) }),
1640
+ c.group && /* @__PURE__ */ n(U, { term: d.group, children: c.group }),
1641
+ c.description && /* @__PURE__ */ n(U, { term: d.description, children: c.description }),
1642
+ c.source && /* @__PURE__ */ n(U, { term: d.source, children: /* @__PURE__ */ n("code", { children: c.source }) })
1643
+ ] }),
1644
+ /* @__PURE__ */ n(ee, { title: d.usedIn, children: y.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: d.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: y.map((L) => {
1645
+ const p = L.variations.find((E) => E.components?.includes(c.id)) ?? L.variations[0];
1646
+ return /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
1647
+ /* @__PURE__ */ n(
1648
+ "button",
1649
+ {
1650
+ type: "button",
1651
+ className: "ds-link",
1652
+ onClick: () => p && i(p.id),
1653
+ children: L.name
1654
+ }
1655
+ ),
1656
+ /* @__PURE__ */ n("code", { className: "ds-muted", children: L.id })
1657
+ ] }, L.id);
1658
+ }) }) })
1659
+ ] });
1660
+ }
1661
+ if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children: m.panel.nothingSelected });
1662
+ const v = l ? e.componentsOfScreen(r, l) : e.componentsOfScreen(r), k = e.persona(t.persona ?? l?.persona), C = e.rulesOf(l), N = t.screenControls ?? {}, w = l?.expected?.length ? l.expected : r.route.expected, x = t.handoff ? { handoff: t.handoff } : void 0, $ = async () => {
1663
+ const y = r.group ? e.flowOf(r, { handoff: t.handoff }) : void 0, L = y?.name ? Vt({
1664
+ flow: { name: y.name, screens: y.screens },
1665
+ registry: e,
1666
+ open: { screen: r, location: o, variation: l },
1667
+ deploy: s,
1668
+ labels: m,
1669
+ overrides: x
1670
+ }) : Kt({
1671
+ screen: r,
1672
+ variations: r.variations,
1673
+ components: e.componentsOfScreen(r),
1674
+ deploy: s,
1675
+ labels: m,
1676
+ overrides: x
1677
+ });
1678
+ try {
1679
+ await navigator.clipboard.writeText(L);
1680
+ } catch {
1681
+ window.prompt(d.copyPrompt, L);
1682
+ }
1683
+ f(!0), window.setTimeout(() => f(!1), 1600);
1684
+ };
1685
+ return /* @__PURE__ */ b("div", { className: "ds-info", children: [
1686
+ /* @__PURE__ */ b(ee, { title: d.screen, children: [
1687
+ /* @__PURE__ */ n(U, { term: d.name, children: r.name }),
1688
+ /* @__PURE__ */ n(U, { term: d.route, children: /* @__PURE__ */ n("code", { children: r.route.path }) }),
1689
+ r.group && /* @__PURE__ */ n(U, { term: d.flow, children: r.group }),
1690
+ r.description && /* @__PURE__ */ n(U, { term: d.description, children: r.description }),
1691
+ /* @__PURE__ */ n(le, { term: d.expected, items: w })
1855
1692
  ] }),
1856
- f === 0 && /* @__PURE__ */ l("section", { className: "ds-home__empty", "aria-label": n.sidebar.currentView(_), children: [
1857
- /* @__PURE__ */ t("p", { children: h === "ported" ? n.home.noPortedReferences : n.home.noActiveWork }),
1858
- h === "active" && S > 0 && /* @__PURE__ */ t(
1859
- "button",
1860
- {
1861
- type: "button",
1862
- className: "ds-text-action",
1863
- onClick: () => i?.("ported"),
1864
- children: n.sidebar.viewPorted(S)
1865
- }
1866
- )
1693
+ r.controls.length > 0 && /* @__PURE__ */ n(ee, { title: d.controls, children: r.controls.flatMap(
1694
+ (y) => y.controls.map((L) => {
1695
+ const p = N[L.id] ?? ge(L), E = L.options.find((a) => a.value === p);
1696
+ return /* @__PURE__ */ b(U, { term: L.label, children: [
1697
+ E?.label ?? p,
1698
+ " ",
1699
+ /* @__PURE__ */ n("code", { children: `c.${L.id}=${p}` })
1700
+ ] }, `${y.id}/${L.id}`);
1701
+ })
1702
+ ) }),
1703
+ l && /* @__PURE__ */ b(ee, { title: d.variation, children: [
1704
+ /* @__PURE__ */ n(U, { term: d.name, children: l.title }),
1705
+ /* @__PURE__ */ n(U, { term: d.id, children: /* @__PURE__ */ n("code", { children: l.id }) }),
1706
+ k && /* @__PURE__ */ n(U, { term: d.persona, children: k.name }),
1707
+ l.intent && /* @__PURE__ */ n(U, { term: d.intent, children: l.intent }),
1708
+ /* @__PURE__ */ n(le, { term: d.preconditions, items: l.preconditions }),
1709
+ /* @__PURE__ */ n(le, { term: d.actions, items: l.actions }),
1710
+ /* @__PURE__ */ n(le, { term: d.rules, items: C.map((y) => y.statement) }),
1711
+ l.ticket && /* @__PURE__ */ n(U, { term: d.ticket, children: /* @__PURE__ */ n("code", { children: l.ticket }) })
1867
1712
  ] }),
1868
- p.map(({ module: s, scenarios: m }) => /* @__PURE__ */ t(
1869
- St,
1870
- {
1871
- module: s,
1872
- scenarios: m,
1873
- registry: e,
1874
- view: h,
1875
- handoff: d,
1876
- onOpenScenario: o
1877
- },
1878
- s.id
1879
- )),
1880
- b.length > 0 && /* @__PURE__ */ l("section", { className: "ds-home__module", children: [
1881
- /* @__PURE__ */ t("h2", { children: n.home.withoutModule }),
1882
- /* @__PURE__ */ t("p", { className: "ds-home__hint", children: n.home.withoutModuleHint }),
1883
- /* @__PURE__ */ t(
1884
- ke,
1885
- {
1886
- scenarios: b,
1887
- registry: e,
1888
- onOpenScenario: o
1889
- }
1890
- )
1713
+ v.length > 0 && /* @__PURE__ */ n(ee, { title: d.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: v.map((y) => /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
1714
+ /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => h(y.id), children: y.name }),
1715
+ y.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: y.source })
1716
+ ] }, y.id)) }) }),
1717
+ /* @__PURE__ */ b("button", { type: "button", className: "ds-btn ds-btn--block", onClick: $, children: [
1718
+ /* @__PURE__ */ n(I, { name: u ? "check" : "copy", size: 14 }),
1719
+ /* @__PURE__ */ n("span", { children: u ? d.copiedForPr : d.copyForPr })
1891
1720
  ] })
1892
1721
  ] });
1893
1722
  }
1894
- function St({
1895
- module: e,
1896
- scenarios: o,
1897
- registry: a,
1898
- view: i,
1899
- handoff: d,
1900
- onOpenScenario: r
1901
- }) {
1902
- return /* @__PURE__ */ l("section", { className: "ds-home__module", children: [
1903
- /* @__PURE__ */ t("h2", { children: e.name }),
1904
- e.description && /* @__PURE__ */ t("p", { className: "ds-home__hint", children: e.description }),
1905
- (e.flows ?? []).map((n) => /* @__PURE__ */ t(
1906
- xt,
1907
- {
1908
- flow: n,
1909
- registry: a,
1910
- view: i,
1911
- handoff: d,
1912
- onOpenScenario: r
1913
- },
1914
- n.id
1915
- )),
1916
- /* @__PURE__ */ t(ke, { scenarios: o, registry: a, onOpenScenario: r })
1723
+ function ee({ title: e, children: t }) {
1724
+ return /* @__PURE__ */ b("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1725
+ /* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
1726
+ /* @__PURE__ */ n("div", { className: "ds-defs", children: t })
1917
1727
  ] });
1918
1728
  }
1919
- function xt({
1920
- flow: e,
1921
- registry: o,
1922
- view: a,
1923
- handoff: i,
1924
- onOpenScenario: d
1925
- }) {
1926
- const r = e.steps.filter((n) => {
1927
- const c = o.scenario(n.scenario);
1928
- return c && (!i || i.scenarios?.includes(c.id)) && (a === "ported" ? c.status === "ported" : c.status !== "ported");
1929
- });
1930
- return r.length === 0 ? null : /* @__PURE__ */ l("div", { className: "ds-flow", children: [
1931
- /* @__PURE__ */ t("h3", { children: e.title }),
1932
- e.description && /* @__PURE__ */ t("p", { className: "ds-home__hint", children: e.description }),
1933
- /* @__PURE__ */ t("ol", { className: "ds-flow__steps", children: r.map((n, c) => {
1934
- const h = o.scenario(n.scenario), u = Object.entries(n.branches ?? {}).filter(([, g]) => {
1935
- const f = o.scenario(g);
1936
- return f && (!i || i.scenarios?.includes(f.id)) && (a === "ported" ? f.status === "ported" : f.status !== "ported");
1937
- });
1938
- return /* @__PURE__ */ l("li", { children: [
1939
- /* @__PURE__ */ t("button", { type: "button", className: "ds-flow__step", onClick: () => d(n.scenario), children: n.label ?? h?.title ?? n.scenario }),
1940
- n.decision && /* @__PURE__ */ t("p", { className: "ds-flow__decision", children: n.decision }),
1941
- u.length > 0 && /* @__PURE__ */ t("ul", { className: "ds-flow__branches", children: u.map(([g, f]) => /* @__PURE__ */ l("li", { children: [
1942
- /* @__PURE__ */ t("span", { className: "ds-flow__branch-label", children: g }),
1943
- /* @__PURE__ */ t(
1944
- "button",
1945
- {
1946
- type: "button",
1947
- className: "ds-flow__step",
1948
- onClick: () => d(f),
1949
- children: o.scenario(f)?.title ?? f
1950
- }
1951
- )
1952
- ] }, g)) })
1953
- ] }, `${n.scenario}-${c}`);
1954
- }) })
1729
+ function U({ term: e, children: t }) {
1730
+ return /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1731
+ /* @__PURE__ */ n("dt", { children: e }),
1732
+ /* @__PURE__ */ n("dd", { children: t })
1955
1733
  ] });
1956
1734
  }
1957
- function ke({
1958
- scenarios: e,
1959
- registry: o,
1960
- onOpenScenario: a
1735
+ function le({ term: e, items: t }) {
1736
+ return t?.length ? /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1737
+ /* @__PURE__ */ n("dt", { children: e }),
1738
+ /* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((s) => /* @__PURE__ */ n("li", { children: s }, s)) }) })
1739
+ ] }) : null;
1740
+ }
1741
+ function jt(e) {
1742
+ return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
1743
+ }
1744
+ function Gt(e, t) {
1745
+ if (!e) return !1;
1746
+ const s = X(t), o = [...e.querySelectorAll("[data-ds-filter]")];
1747
+ for (const r of o)
1748
+ r.hidden = s.length > 0 && !X(r.textContent ?? "").includes(s);
1749
+ for (const r of e.querySelectorAll("[data-ds-filter-group]")) {
1750
+ const l = [...r.querySelectorAll("[data-ds-filter]")], c = X(
1751
+ r.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
1752
+ );
1753
+ if (s.length > 0 && c.includes(s)) {
1754
+ r.hidden = !1;
1755
+ for (const i of l) i.hidden = !1;
1756
+ continue;
1757
+ }
1758
+ r.hidden = s.length > 0 && l.every((i) => i.hidden);
1759
+ }
1760
+ return s.length > 0 && o.length > 0 && o.every((r) => r.hidden);
1761
+ }
1762
+ const qt = 24;
1763
+ function Zt({
1764
+ location: e,
1765
+ viewport: t,
1766
+ zoom: s,
1767
+ title: o,
1768
+ resizing: r,
1769
+ onFrameNavigate: l,
1770
+ onShortcut: c,
1771
+ onEffectiveZoom: i
1961
1772
  }) {
1962
- const i = P();
1963
- return /* @__PURE__ */ t("ul", { className: "ds-home__grid", children: e.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("button", { type: "button", className: "ds-home__card", onClick: () => a(d.id), children: [
1964
- /* @__PURE__ */ l("span", { className: "ds-home__card-head", children: [
1965
- /* @__PURE__ */ t(
1966
- "span",
1773
+ const h = q(null), m = q(null), d = Yt(h), u = de(e.path, e.search), [f] = D(u), v = q(u), k = q(u), C = typeof window > "u" ? "" : window.location.origin, N = B(
1774
+ (S) => {
1775
+ k.current = S;
1776
+ const R = m.current?.contentWindow;
1777
+ try {
1778
+ R?.location.replace(new URL(S, C).toString());
1779
+ } catch {
1780
+ m.current && (m.current.src = S);
1781
+ }
1782
+ },
1783
+ [C]
1784
+ );
1785
+ V(() => {
1786
+ if (u === v.current) return;
1787
+ const S = v.current;
1788
+ v.current = u, _e(S) !== _e(u) ? N(u) : ae(m.current?.contentWindow, { ds: 1, type: "location", url: u }, C);
1789
+ }, [u, N, C]), V(() => {
1790
+ const S = (R) => {
1791
+ const M = He(R, {
1792
+ origin: C,
1793
+ source: m.current?.contentWindow
1794
+ });
1795
+ if (M)
1796
+ switch (M.type) {
1797
+ case "ready": {
1798
+ if (M.url === v.current) return;
1799
+ if (M.url === k.current) {
1800
+ ae(
1801
+ m.current?.contentWindow,
1802
+ { ds: 1, type: "location", url: v.current },
1803
+ C
1804
+ );
1805
+ return;
1806
+ }
1807
+ v.current = M.url, k.current = M.url, l(M.url, !0);
1808
+ return;
1809
+ }
1810
+ case "navigate":
1811
+ v.current = M.url, l(M.url, M.replace);
1812
+ return;
1813
+ case "shortcut":
1814
+ c(M.key);
1815
+ return;
1816
+ default:
1817
+ return;
1818
+ }
1819
+ };
1820
+ return window.addEventListener("message", S), () => window.removeEventListener("message", S);
1821
+ }, [l, c, C]);
1822
+ const w = !!t.width, x = w ? qt : 0, $ = Math.max(0, d.width - x * 2), y = Math.max(0, d.height - x * 2), L = !t.width || $ === 0 || t.width <= $, p = s === 100 && !L ? Math.max(10, Math.floor($ / t.width * 100)) : s, E = p / 100;
1823
+ V(() => {
1824
+ i?.(p);
1825
+ }, [p, i]);
1826
+ const a = t.width ?? $ / E, g = t.height ?? y / E;
1827
+ return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: h, "data-fit": w ? void 0 : "true", children: /* @__PURE__ */ n(
1828
+ "div",
1829
+ {
1830
+ className: "ds-canvas__box",
1831
+ style: { width: Math.floor(a * E), height: Math.floor(g * E) },
1832
+ children: /* @__PURE__ */ n(
1833
+ "iframe",
1967
1834
  {
1968
- className: "ds-status-dot",
1969
- "data-status": d.status,
1970
- "data-approval": d.status === "approved" && !d.approvedAt ? "incomplete" : void 0
1835
+ ref: m,
1836
+ [pt]: "",
1837
+ className: "ds-frame",
1838
+ src: f,
1839
+ title: o,
1840
+ style: {
1841
+ width: Math.floor(a),
1842
+ height: Math.floor(g),
1843
+ transform: E === 1 ? void 0 : `scale(${E})`,
1844
+ pointerEvents: r ? "none" : void 0
1845
+ }
1971
1846
  }
1972
- ),
1973
- /* @__PURE__ */ t("span", { className: "ds-home__card-title", children: d.title })
1974
- ] }),
1975
- d.intent && /* @__PURE__ */ t("span", { className: "ds-home__card-intent", children: d.intent }),
1976
- /* @__PURE__ */ l("span", { className: "ds-home__card-meta", children: [
1977
- o.persona(d.persona)?.name ?? d.persona,
1978
- " · ",
1979
- d.status === "approved" && !d.approvedAt ? i.inspector.approvalPendingStatus : i.status[d.status],
1980
- d.a11y.keyboard === "full" ? ` · ${i.home.keyboardBadge}` : ""
1981
- ] })
1982
- ] }) }, d.id)) });
1983
- }
1984
- function $t({ product: e }) {
1985
- const o = T(() => Le(e), [e]), a = T(() => tt(e.theme?.labels), [e.theme?.labels]), i = T(() => Te(e.deploy), [e.deploy]), {
1986
- location: d,
1987
- controls: r,
1988
- viewport: n,
1989
- setControls: c,
1990
- setScenarioView: h,
1991
- navigate: u,
1992
- openScenario: g,
1993
- openComponent: f
1994
- } = Ee(o), p = ce(r), b = re(null), { focused: S, tabStops: _ } = et(r.keyboardMode, b);
1995
- D(() => {
1996
- const N = b.current;
1997
- if (!N || !r.handoff) return;
1998
- const C = () => {
1999
- for (const de of N.querySelectorAll("a[href]")) {
2000
- const Q = de.getAttribute("href");
2001
- if (!Q || Q.startsWith("#")) continue;
2002
- let W;
1847
+ )
1848
+ }
1849
+ ) });
1850
+ }
1851
+ function Yt(e) {
1852
+ const [t, s] = D({ width: 0, height: 0 });
1853
+ return Ke(() => {
1854
+ const o = e.current;
1855
+ if (!o) return;
1856
+ const r = () => {
1857
+ const c = o.clientWidth, i = o.clientHeight;
1858
+ s(
1859
+ (h) => h.width === c && h.height === i ? h : { width: c, height: i }
1860
+ );
1861
+ };
1862
+ if (r(), typeof ResizeObserver > "u")
1863
+ return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
1864
+ const l = new ResizeObserver(r);
1865
+ return l.observe(o), () => l.disconnect();
1866
+ }, [e]), t;
1867
+ }
1868
+ const Qe = 2500;
1869
+ class Je extends Error {
1870
+ constructor(t) {
1871
+ super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
1872
+ }
1873
+ }
1874
+ function ye(e) {
1875
+ if (e)
1876
+ return typeof e.data == "function" ? e.data() : e.data;
1877
+ }
1878
+ const $e = {
1879
+ id: "fixtures",
1880
+ label: "Fixtures",
1881
+ load: async ({ scenario: e, fixture: t, network: s }) => {
1882
+ switch (s) {
1883
+ case "empty":
1884
+ return null;
1885
+ case "error":
1886
+ throw new Je(e.id);
1887
+ case "loading":
1888
+ return new Promise(() => {
1889
+ });
1890
+ case "slow":
1891
+ return await Xt(Qe), ye(t);
1892
+ default:
1893
+ return ye(t);
1894
+ }
1895
+ }
1896
+ };
1897
+ function dn(e) {
1898
+ const { id: t, label: s, baseUrl: o, path: r, init: l, fallbackToFixture: c = !0 } = e;
1899
+ return {
1900
+ id: t,
1901
+ label: s,
1902
+ load: async (i) => {
1903
+ const h = new URL(r ? r(i) : i.scenario.route, o);
1904
+ try {
1905
+ const m = await fetch(h, l);
1906
+ if (!m.ok) throw new Error(`${m.status} ${m.statusText}`);
1907
+ return await m.json();
1908
+ } catch (m) {
1909
+ if (c) return ye(i.fixture);
1910
+ throw new Error(`Adapter "${t}" falhou em ${h.toString()}`, { cause: m });
1911
+ }
1912
+ }
1913
+ };
1914
+ }
1915
+ function Xt(e) {
1916
+ return new Promise((t) => setTimeout(t, e));
1917
+ }
1918
+ function Qt(e) {
1919
+ const { scenario: t, fixture: s, network: o, adapter: r } = e, [l, c] = D({
1920
+ data: void 0,
1921
+ isLoading: !!t || o === "loading" || o === "slow",
1922
+ error: void 0
1923
+ });
1924
+ return V(() => {
1925
+ if (!t)
1926
+ switch (o) {
1927
+ case "loading":
1928
+ c({ data: void 0, isLoading: !0, error: void 0 });
1929
+ return;
1930
+ case "empty":
1931
+ c({ data: null, isLoading: !1, error: void 0 });
1932
+ return;
1933
+ case "error":
1934
+ c({
1935
+ data: void 0,
1936
+ isLoading: !1,
1937
+ error: new Je(e.screen ?? "—")
1938
+ });
1939
+ return;
1940
+ case "slow": {
1941
+ c({ data: void 0, isLoading: !0, error: void 0 });
1942
+ const m = setTimeout(
1943
+ () => c({ data: void 0, isLoading: !1, error: void 0 }),
1944
+ Qe
1945
+ );
1946
+ return () => clearTimeout(m);
1947
+ }
1948
+ default:
1949
+ c({ data: void 0, isLoading: !1, error: void 0 });
1950
+ return;
1951
+ }
1952
+ let i = !0;
1953
+ c({ data: void 0, isLoading: !0, error: void 0 });
1954
+ const h = r ?? $e;
1955
+ return Promise.resolve(h.load({ scenario: t, fixture: s, network: o })).then((m) => {
1956
+ i && c({ data: m, isLoading: !1, error: void 0 });
1957
+ }).catch((m) => {
1958
+ i && c({
1959
+ data: void 0,
1960
+ isLoading: !1,
1961
+ error: m instanceof Error ? m : new Error(String(m))
1962
+ });
1963
+ }), () => {
1964
+ i = !1;
1965
+ };
1966
+ }, [t, s, o, r, e.screen]), l;
1967
+ }
1968
+ function ze({ title: e, children: t }) {
1969
+ return /* @__PURE__ */ b("div", { className: "ds-stage-empty", children: [
1970
+ /* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
1971
+ t
1972
+ ] });
1973
+ }
1974
+ function Jt({ product: e, registry: t }) {
1975
+ const s = Q(), { location: o, controls: r, viewport: l, navigate: c, openScenario: i, setControls: h } = Ge(
1976
+ t,
1977
+ { frame: !0 }
1978
+ ), m = q(null);
1979
+ V(() => {
1980
+ const T = (O) => {
1981
+ if (O.defaultPrevented || O.button !== 0 || O.metaKey || O.ctrlKey || O.shiftKey || O.altKey) return;
1982
+ const z = O.target?.closest?.("a[href]");
1983
+ if (!(z instanceof HTMLAnchorElement) || z.target && z.target !== "_self" || z.hasAttribute("download")) return;
1984
+ const j = z.getAttribute("href") ?? "";
1985
+ if (j.startsWith("#")) return;
1986
+ let H;
1987
+ try {
1988
+ H = new URL(j, window.location.href);
1989
+ } catch {
1990
+ return;
1991
+ }
1992
+ H.origin === window.location.origin && (O.preventDefault(), c(`${H.pathname}${H.search}`));
1993
+ };
1994
+ return document.addEventListener("click", T), () => document.removeEventListener("click", T);
1995
+ }, [c]), V(() => {
1996
+ const T = (O) => {
1997
+ if (window.parent === window) return;
1998
+ const z = en(O);
1999
+ if (!z) return;
2000
+ const j = O.target;
2001
+ z === "C" && j?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (O.preventDefault(), ae(window.parent, { ds: 1, type: "shortcut", key: z }, window.location.origin));
2002
+ };
2003
+ return window.addEventListener("keydown", T), () => window.removeEventListener("keydown", T);
2004
+ }, []), V(() => {
2005
+ const T = m.current;
2006
+ if (!T || !r.handoff) return;
2007
+ const O = () => {
2008
+ for (const j of T.querySelectorAll("a[href]")) {
2009
+ const H = j.getAttribute("href");
2010
+ if (!H || H.startsWith("#")) continue;
2011
+ let J;
2003
2012
  try {
2004
- W = new URL(Q, window.location.href);
2013
+ J = new URL(H, window.location.href);
2005
2014
  } catch {
2006
2015
  continue;
2007
2016
  }
2008
- if (W.origin !== window.location.origin) continue;
2009
- oe(W.searchParams, r.handoff);
2010
- const le = `${W.pathname}${W.search}${W.hash}`;
2011
- Q !== le && de.setAttribute("href", le);
2017
+ if (J.origin !== window.location.origin) continue;
2018
+ Me(J.searchParams, r.handoff);
2019
+ const ie = `${J.pathname}${J.search}${J.hash}`;
2020
+ H !== ie && j.setAttribute("href", ie);
2012
2021
  }
2013
2022
  };
2014
- C();
2015
- const ae = new MutationObserver(C);
2016
- return ae.observe(N, {
2017
- subtree: !0,
2018
- childList: !0,
2019
- attributes: !0,
2020
- attributeFilter: ["href"]
2021
- }), () => ae.disconnect();
2023
+ O();
2024
+ const z = new MutationObserver(O);
2025
+ return z.observe(T, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => z.disconnect();
2022
2026
  }, [r.handoff]);
2023
- const s = o.scenario(r.scenario), m = o.component(r.component), k = T(() => {
2024
- const N = new URLSearchParams(d.search);
2027
+ const d = t.scenario(r.scenario), u = t.component(r.component), f = A(() => {
2028
+ const T = new URLSearchParams(o.search);
2025
2029
  return {
2026
- scenario: N.get(w.scenario) ?? void 0,
2027
- component: N.get(w.component) ?? void 0
2030
+ scenario: T.get(_.scenario) ?? void 0,
2031
+ component: T.get(_.component) ?? void 0
2028
2032
  };
2029
- }, [d.search]), M = !!(r.handoff && (k.scenario && !te(r.handoff, k.scenario) || k.component && !ee(r.handoff, k.component) || !k.component && !Ae(
2030
- r.handoff,
2031
- d.path,
2032
- e.scenarios
2033
- ))), y = T(
2034
- () => o.resolveComponentFixture(m?.id, m ? r.fixture : void 0),
2035
- [m, r.fixture, o]
2036
- ), E = T(() => {
2037
- const N = y.fixture?.data;
2038
- return typeof N == "function" ? N() : N;
2039
- }, [y.fixture]), $ = o.persona(r.persona ?? s?.persona), O = o.fixture(r.fixture ?? s?.fixture), G = T(() => {
2040
- const N = r.dataSource ?? "fixtures";
2041
- return N === "fixtures" ? ie : e.dataSources?.adapters?.find((C) => C.id === N) ?? ie;
2042
- }, [r.dataSource, e.dataSources?.adapters]), { data: I, isLoading: B, error: U } = ze({ scenario: s, fixture: O, network: r.network, adapter: G });
2043
- D(() => {
2044
- const N = (C) => {
2045
- if (!(!C.shiftKey || C.metaKey || C.ctrlKey || C.altKey || C.target?.matches("input, textarea, select, [contenteditable='true']"))) {
2046
- switch (C.key) {
2047
- case "K":
2048
- c({ keyboardMode: !r.keyboardMode });
2049
- break;
2050
- case "P":
2051
- c({ inspector: !r.inspector });
2052
- break;
2053
- default:
2054
- return;
2055
- }
2056
- C.preventDefault();
2057
- }
2058
- };
2059
- return window.addEventListener("keydown", N), () => window.removeEventListener("keydown", N);
2060
- }, [r.keyboardMode, r.inspector, c]);
2061
- const H = T(() => r.persona && r.persona !== s?.persona ? o.persona(r.persona)?.permissions ?? [] : o.permissionsOf(s), [r.persona, o, s]), j = T(
2033
+ }, [o.search]), v = !!(r.handoff && (f.scenario && !oe(r.handoff, f.scenario) || f.component && !we(r.handoff, f.component) || !f.component && !Ve(r.handoff, o.path, e.scenarios))), k = A(
2034
+ () => t.resolveComponentFixture(u?.id, u ? r.fixture : void 0),
2035
+ [u, r.fixture, t]
2036
+ ), C = A(() => {
2037
+ const T = k.fixture?.data;
2038
+ return typeof T == "function" ? T() : T;
2039
+ }, [k.fixture]), N = t.persona(r.persona ?? d?.persona), w = t.fixture(r.fixture ?? d?.fixture), x = A(() => {
2040
+ const T = r.dataSource ?? "fixtures";
2041
+ return T === "fixtures" ? $e : e.dataSources?.adapters?.find((O) => O.id === T) ?? $e;
2042
+ }, [r.dataSource, e.dataSources?.adapters]), { data: $, isLoading: y, error: L } = Qt({
2043
+ scenario: d,
2044
+ fixture: w,
2045
+ network: r.network,
2046
+ adapter: x,
2047
+ screen: o.path
2048
+ }), p = A(() => r.persona && r.persona !== d?.persona ? t.persona(r.persona)?.permissions ?? [] : t.permissionsOf(d), [r.persona, t, d]), E = r.screenControls, a = A(() => E ?? {}, [E]), g = B(
2049
+ (T, O) => {
2050
+ a[T] !== O && h({ screenControls: { ...a, [T]: O } });
2051
+ },
2052
+ [h, a]
2053
+ ), S = A(
2062
2054
  () => ({
2063
- scenario: s,
2064
- persona: $,
2065
- permissions: H,
2066
- can: (N) => H.includes(N),
2067
- data: I,
2068
- fixture: O,
2055
+ scenario: d,
2056
+ persona: N,
2057
+ permissions: p,
2058
+ can: (T) => p.includes(T),
2059
+ data: $,
2060
+ fixture: w,
2069
2061
  network: r.network,
2070
- isLoading: B,
2071
- error: U,
2072
- rules: o.rulesOf(s),
2073
- viewport: n,
2062
+ isLoading: y,
2063
+ error: L,
2064
+ rules: t.rulesOf(d),
2065
+ viewport: l,
2074
2066
  themeMode: r.themeMode,
2075
2067
  locale: r.locale,
2076
- a11y: {
2077
- keyboardMode: r.keyboardMode,
2078
- reducedMotion: r.reducedMotion,
2079
- textScale: r.textScale
2080
- },
2081
- navigate: u,
2082
- openScenario: g
2068
+ navigate: (T) => c(T),
2069
+ openScenario: i,
2070
+ controls: a,
2071
+ setControl: g
2083
2072
  }),
2084
2073
  [
2085
- s,
2074
+ d,
2075
+ N,
2076
+ p,
2086
2077
  $,
2087
- H,
2088
- I,
2089
- O,
2078
+ w,
2090
2079
  r.network,
2091
2080
  r.themeMode,
2092
2081
  r.locale,
2093
- r.keyboardMode,
2094
- r.reducedMotion,
2095
- r.textScale,
2096
- B,
2097
- U,
2098
- o,
2099
- n,
2100
- u,
2082
+ y,
2083
+ L,
2084
+ t,
2085
+ l,
2086
+ c,
2087
+ i,
2088
+ a,
2101
2089
  g
2102
2090
  ]
2103
- ), Y = !M && !s && !m && d.path === "/", K = Pe(e.routes, d.path), V = e.wrapper, q = e.notFound, J = m?.preview, v = M ? /* @__PURE__ */ t(fe, { title: a.shell.outsideHandoff, children: /* @__PURE__ */ t("p", { children: a.shell.outsideHandoffHint }) }) : J ? /* @__PURE__ */ t(
2104
- J,
2091
+ ), R = Se(e.routes ?? [], o.path), M = e.wrapper, W = e.notFound, F = u?.preview, K = v ? /* @__PURE__ */ n(ze, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : F ? /* @__PURE__ */ n(
2092
+ F,
2105
2093
  {
2106
- fixture: y.fixture,
2107
- data: E,
2108
- viewport: n,
2094
+ fixture: k.fixture,
2095
+ data: C,
2096
+ viewport: l,
2109
2097
  themeMode: r.themeMode ?? "default",
2110
- locale: r.locale ?? "default",
2111
- a11y: {
2112
- keyboardMode: r.keyboardMode,
2113
- reducedMotion: r.reducedMotion,
2114
- textScale: r.textScale
2115
- }
2098
+ locale: r.locale ?? "default"
2116
2099
  }
2117
- ) : K ? /* @__PURE__ */ t(K.definition.screen, { params: K.params, context: j }) : q ? /* @__PURE__ */ t(q, { path: d.path }) : /* @__PURE__ */ t(fe, { title: a.shell.noRoute, children: /* @__PURE__ */ l("p", { children: [
2118
- /* @__PURE__ */ t("code", { children: d.path }),
2100
+ ) : R ? /* @__PURE__ */ n(R.definition.screen, { params: R.params, context: S }) : W ? /* @__PURE__ */ n(W, { path: o.path }) : /* @__PURE__ */ n(ze, { title: s.shell.noRoute, children: /* @__PURE__ */ b("p", { children: [
2101
+ /* @__PURE__ */ n("code", { children: o.path }),
2119
2102
  " ",
2120
- a.shell.noRouteHint
2121
- ] }) }), x = V && !M ? /* @__PURE__ */ t(V, { context: j, children: v }) : v;
2122
- return /* @__PURE__ */ t(we.Provider, { value: a, children: /* @__PURE__ */ l(
2103
+ s.shell.noRouteHint
2104
+ ] }) });
2105
+ return (
2106
+ // `display: contents` deixa o layout do produto como se este nó não
2107
+ // existisse: ele só serve de raiz para observar os links.
2108
+ /* @__PURE__ */ n("div", { ref: m, style: { display: "contents" }, children: M && !v ? /* @__PURE__ */ n(M, { context: S, children: K }) : K })
2109
+ );
2110
+ }
2111
+ function en(e) {
2112
+ if (!e.altKey) {
2113
+ if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
2114
+ if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
2115
+ const t = e.key.toLowerCase();
2116
+ if (t === "k") return "K";
2117
+ if (t === "f") return "F";
2118
+ }
2119
+ }
2120
+ }
2121
+ const ue = {
2122
+ leftWidth: "ds:left-width",
2123
+ rightWidth: "ds:right-width",
2124
+ appearance: "ds:appearance"
2125
+ };
2126
+ function et(e) {
2127
+ try {
2128
+ return window.localStorage.getItem(e) ?? void 0;
2129
+ } catch {
2130
+ return;
2131
+ }
2132
+ }
2133
+ function tt(e, t) {
2134
+ try {
2135
+ window.localStorage.setItem(e, t);
2136
+ } catch {
2137
+ }
2138
+ }
2139
+ function Ae(e, t, s) {
2140
+ return Math.round(Math.min(s, Math.max(t, e)));
2141
+ }
2142
+ function De(e, t, s, o) {
2143
+ const [r, l] = D(() => {
2144
+ const i = Number.parseInt(et(e) ?? "", 10);
2145
+ return Number.isFinite(i) ? Ae(i, s, o) : t;
2146
+ }), c = B(
2147
+ (i) => {
2148
+ const h = Ae(i, s, o);
2149
+ l(h), tt(e, String(h));
2150
+ },
2151
+ [e, o, s]
2152
+ );
2153
+ return [r, c];
2154
+ }
2155
+ function tn() {
2156
+ const e = "(prefers-color-scheme: dark)", t = () => {
2157
+ try {
2158
+ return window.matchMedia(e).matches ? "dark" : "light";
2159
+ } catch {
2160
+ return "light";
2161
+ }
2162
+ }, [s, o] = D(t);
2163
+ return V(() => {
2164
+ let r;
2165
+ try {
2166
+ r = window.matchMedia(e);
2167
+ } catch {
2168
+ return;
2169
+ }
2170
+ const l = () => o(r?.matches ? "dark" : "light");
2171
+ return r.addEventListener?.("change", l), () => r?.removeEventListener?.("change", l);
2172
+ }, []), s;
2173
+ }
2174
+ function nn() {
2175
+ const e = et(ue.appearance);
2176
+ return e === "dark" || e === "light" ? e : void 0;
2177
+ }
2178
+ function un({ product: e }) {
2179
+ const t = A(() => gt(e), [e]), s = A(() => Et(e.theme?.labels), [e.theme?.labels]), [o] = D(() => mt());
2180
+ return /* @__PURE__ */ n(Ze.Provider, { value: s, children: o ? /* @__PURE__ */ n(Jt, { product: e, registry: t }) : /* @__PURE__ */ n(on, { product: e, registry: t }) });
2181
+ }
2182
+ const ke = { initial: 290, min: 200, max: 480 }, Ce = { initial: 320, min: 260, max: 560 };
2183
+ function on({ product: e, registry: t }) {
2184
+ const s = Q(), o = A(() => ft(e.deploy), [e.deploy]), { location: r, controls: l, viewport: c, setControls: i, openScenario: h, openComponent: m, openScreen: d, go: u } = Ge(t), f = q(r);
2185
+ f.current = r;
2186
+ const v = tn(), [k, C] = D(() => nn()), N = l.chromeTheme ?? k ?? v, [w, x] = De(
2187
+ ue.leftWidth,
2188
+ ke.initial,
2189
+ ke.min,
2190
+ ke.max
2191
+ ), [$, y] = De(
2192
+ ue.rightWidth,
2193
+ Ce.initial,
2194
+ Ce.min,
2195
+ Ce.max
2196
+ ), [L, p] = D(!1), E = l.handoff, a = t.component(l.component), g = t.scenario(l.scenario), S = a ? void 0 : t.screensFor({ handoff: E }).find((P) => P.id === t.screenForPath(r.path)?.id), R = S && g && S.variations.some((P) => P.id === g.id) ? g : void 0, M = A(
2197
+ () => t.resolveComponentFixture(a?.id, a ? l.fixture : void 0),
2198
+ [a, l.fixture, t]
2199
+ ), W = A(() => {
2200
+ if (!S || S.controls.length === 0) return t.issues;
2201
+ const { invalid: P } = t.resolveControls(S, {
2202
+ scenario: R,
2203
+ requested: Ue(r.search)
2204
+ });
2205
+ return P.length === 0 ? t.issues : [...P.map((Y) => ({
2206
+ level: "warning",
2207
+ where: `url:${Ie}${Y.id}`,
2208
+ message: Y.reason === "invalid-value" ? s.diagnostics.invalidControl(Y.id, Y.value, Y.fallback ?? "") : s.diagnostics.unknownControl(Y.id, Y.value)
2209
+ })), ...t.issues];
2210
+ }, [s, r.search, t, S, R]), F = t.screensFor({ handoff: E })[0], K = t.componentsFor(E)[0], T = !F && !K, O = A(() => {
2211
+ const P = new URLSearchParams(r.search);
2212
+ return P.has(_.scenario) || P.has(_.component);
2213
+ }, [r.search]), z = r.path === "/" && !O && !t.screenForPath("/") && !T;
2214
+ V(() => {
2215
+ z && (F ? d(F.id, { replace: !0 }) : K && m(K.id, { replace: !0 }));
2216
+ }, [K, F, m, d, z]);
2217
+ const j = B(
2218
+ () => i({ chrome: !l.chrome }),
2219
+ [l.chrome, i]
2220
+ ), H = B(
2221
+ (P) => {
2222
+ if (P === "C") {
2223
+ j();
2224
+ return;
2225
+ }
2226
+ window.dispatchEvent(new KeyboardEvent("keydown", { key: P.toLowerCase(), metaKey: !0 }));
2227
+ },
2228
+ [j]
2229
+ );
2230
+ V(() => {
2231
+ const P = (Z) => {
2232
+ !Z.shiftKey || Z.metaKey || Z.ctrlKey || Z.altKey || Z.key !== "C" || Z.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (Z.preventDefault(), H(Z.key));
2233
+ };
2234
+ return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
2235
+ }, [H]);
2236
+ const J = B(
2237
+ (P, Z) => {
2238
+ const { path: Y, search: at } = Ne(P);
2239
+ u(Y, wt(at, f.current.search), { replace: Z });
2240
+ },
2241
+ [u]
2242
+ ), ie = () => {
2243
+ const P = N === "dark" ? "light" : "dark";
2244
+ tt(ue.appearance, P), C(P), i({ chromeTheme: P });
2245
+ }, re = (P) => i(P), nt = `${o.origin}${r.path}${r.search}`, ot = l.panelTab ?? "variations", Ee = l.zoom ?? 100, [rt, st] = D(Ee);
2246
+ return /* @__PURE__ */ b(
2123
2247
  "div",
2124
2248
  {
2125
2249
  className: "ds-root",
2126
- "data-chrome": r.chrome ? "visible" : "hidden",
2127
- "data-appearance": r.chromeTheme ?? "dark",
2128
- "data-inspector": r.inspector ? "open" : "closed",
2129
- "data-viewport": n.id,
2250
+ "data-appearance": N,
2251
+ "data-chrome": l.chrome ? "visible" : "hidden",
2252
+ "data-resizing": L ? "true" : void 0,
2253
+ "data-viewport": c.id,
2130
2254
  children: [
2131
- r.chrome && /* @__PURE__ */ t(
2132
- it,
2255
+ l.chrome && /* @__PURE__ */ n(
2256
+ Rt,
2133
2257
  {
2134
- product: e,
2135
- scenario: s,
2136
- deploy: i,
2137
- inspectorOpen: r.inspector,
2138
- chromeTheme: r.chromeTheme ?? "dark",
2139
- view: p,
2140
- handoff: r.handoff,
2141
- onToggleInspector: () => c({ inspector: !r.inspector }),
2142
- onToggleChromeTheme: () => c({ chromeTheme: r.chromeTheme === "light" ? "dark" : "light" })
2258
+ productName: e.name,
2259
+ deploy: o,
2260
+ viewportId: l.viewport,
2261
+ viewport: c,
2262
+ zoom: rt,
2263
+ rotated: !!l.rotated,
2264
+ theme: N,
2265
+ issues: W,
2266
+ linkUrl: nt,
2267
+ onViewport: (P) => re({ viewport: P }),
2268
+ onRotate: () => re({ rotated: !l.rotated }),
2269
+ onZoom: (P) => re({ zoom: P }),
2270
+ onCleanReview: j,
2271
+ onToggleTheme: ie
2143
2272
  }
2144
2273
  ),
2145
- r.chrome && /* @__PURE__ */ t(
2146
- ot,
2147
- {
2148
- registry: o,
2149
- activeScenario: s,
2150
- activeComponent: r.component,
2151
- controls: r,
2152
- onOpenScenario: g,
2153
- onOpenComponent: f,
2154
- onViewChange: h
2155
- }
2156
- ),
2157
- /* @__PURE__ */ l("div", { className: "ds-stage-area", children: [
2158
- Y ? /* @__PURE__ */ t("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ t(
2159
- Nt,
2274
+ /* @__PURE__ */ b("div", { className: "ds-body", children: [
2275
+ l.chrome && /* @__PURE__ */ n(
2276
+ Ot,
2160
2277
  {
2161
- registry: o,
2162
- view: p,
2163
- handoff: r.handoff,
2164
- onViewChange: h,
2165
- onOpenScenario: g
2278
+ registry: t,
2279
+ handoff: E,
2280
+ activeScreen: S?.id,
2281
+ activeComponent: a?.id,
2282
+ onOpenScreen: (P) => d(P),
2283
+ onOpenComponent: (P) => m(P),
2284
+ width: w,
2285
+ onResize: x,
2286
+ onResizeStart: () => p(!0),
2287
+ onResizeEnd: () => p(!1)
2166
2288
  }
2167
- ) }) : /* @__PURE__ */ t(
2168
- wt,
2289
+ ),
2290
+ /* @__PURE__ */ n("main", { className: "ds-main", children: T ? /* @__PURE__ */ b("div", { className: "ds-chrome-empty", children: [
2291
+ /* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: s.shell.empty }),
2292
+ /* @__PURE__ */ n("p", { className: "ds-muted", children: s.shell.emptyHint })
2293
+ ] }) : z ? null : /* @__PURE__ */ n(
2294
+ Zt,
2169
2295
  {
2170
- ref: b,
2171
- viewport: n,
2172
- textScale: r.textScale,
2173
- reducedMotion: r.reducedMotion,
2174
- keyboardMode: r.keyboardMode,
2175
- children: x
2296
+ location: r,
2297
+ viewport: c,
2298
+ zoom: Ee,
2299
+ onEffectiveZoom: st,
2300
+ title: s.shell.frameTitle(e.name),
2301
+ resizing: L,
2302
+ onFrameNavigate: J,
2303
+ onShortcut: H
2176
2304
  }
2177
- ),
2178
- r.chrome && /* @__PURE__ */ t(
2179
- pt,
2305
+ ) }),
2306
+ l.chrome && /* @__PURE__ */ n(
2307
+ Ut,
2180
2308
  {
2181
- registry: o,
2182
- controls: r,
2183
- scenarioActive: !!s,
2184
- component: m,
2185
- componentFixture: y,
2186
- onChange: c
2309
+ registry: t,
2310
+ controls: l,
2311
+ deploy: o,
2312
+ location: r,
2313
+ screen: S,
2314
+ variation: R,
2315
+ component: a,
2316
+ componentFixture: M,
2317
+ tab: ot,
2318
+ onTab: (P) => re({ panelTab: P }),
2319
+ onOpenScenario: h,
2320
+ onOpenComponent: (P) => m(P),
2321
+ onChange: re,
2322
+ width: $,
2323
+ onResize: y,
2324
+ onResizeStart: () => p(!0),
2325
+ onResizeEnd: () => p(!1)
2187
2326
  }
2188
2327
  )
2189
2328
  ] }),
2190
- r.chrome && /* @__PURE__ */ t(
2191
- ht,
2192
- {
2193
- registry: o,
2194
- scenario: s,
2195
- component: m,
2196
- componentFixture: y,
2197
- controls: r,
2198
- focusedNode: S,
2199
- tabStopCount: _.length
2200
- }
2201
- ),
2202
- r.keyboardMode && /* @__PURE__ */ t(kt, { stops: _ }),
2203
- !r.chrome && /* @__PURE__ */ t(
2329
+ !l.chrome && /* @__PURE__ */ n(
2204
2330
  "button",
2205
2331
  {
2206
2332
  type: "button",
2207
- className: "ds-chrome ds-restore",
2208
- onClick: () => c({ chrome: !0 }),
2209
- children: a.shell.restoreChrome
2333
+ className: "ds-restore",
2334
+ "aria-label": s.shell.restoreChrome,
2335
+ title: s.shell.restoreChrome,
2336
+ onClick: j,
2337
+ children: /* @__PURE__ */ n("span", { className: "ds-restore__dot", "aria-hidden": "true" })
2210
2338
  }
2211
2339
  )
2212
2340
  ]
2213
2341
  }
2214
- ) });
2342
+ );
2215
2343
  }
2216
- function Z(e) {
2344
+ function fe(e) {
2217
2345
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
2218
2346
  }
2219
- function Et(e, o) {
2220
- const a = Z(e), i = Z(o);
2221
- let d = i.getFullYear() - a.getFullYear();
2222
- const r = i.getMonth() - a.getMonth();
2223
- return (r < 0 || r === 0 && i.getDate() < a.getDate()) && (d -= 1), d;
2347
+ function hn(e, t) {
2348
+ const s = fe(e), o = fe(t);
2349
+ let r = o.getFullYear() - s.getFullYear();
2350
+ const l = o.getMonth() - s.getMonth();
2351
+ return (l < 0 || l === 0 && o.getDate() < s.getDate()) && (r -= 1), r;
2224
2352
  }
2225
- function Rt(e, o) {
2226
- const a = Z(e), i = Z(o);
2227
- return Math.floor((i.getTime() - a.getTime()) / 864e5);
2353
+ function pn(e, t) {
2354
+ const s = fe(e), o = fe(t);
2355
+ return Math.floor((o.getTime() - s.getTime()) / 864e5);
2228
2356
  }
2229
2357
  export {
2230
- It as CONTRAST_THRESHOLDS,
2231
- L as DEFAULT_LABELS,
2232
- $t as DesignSpace,
2233
- Tt as EN_US_LABELS,
2234
- Bt as HANDOFF_PARAM,
2235
- Nt as Home,
2236
- Ft as KEYBOARD_LABELS,
2237
- Lt as NETWORK_LABELS,
2238
- ve as NETWORK_STATES,
2239
- w as PARAM,
2240
- be as SCENARIO_STATUSES,
2241
- Be as SLOW_NETWORK_DELAY_MS,
2242
- At as STATUS_LABELS,
2243
- Pt as STATUS_MEANING,
2244
- He as SimulatedNetworkError,
2245
- wt as Stage,
2246
- fe as StageEmpty,
2247
- Fe as TEXT_SCALES,
2248
- kt as TabOrderOverlay,
2249
- ge as VIEWPORTS,
2250
- Et as ageInYears,
2251
- oe as applyHandoffScope,
2252
- Ht as applyOverrides,
2253
- Wt as assertContrastPairs,
2254
- zt as checkContrastPair,
2255
- Ce as checkContrastPairs,
2256
- Ut as commitUrl,
2257
- jt as componentUrl,
2258
- Ve as computeRole,
2259
- Kt as contrastRatio,
2260
- Ct as createHttpAdapter,
2261
- Le as createRegistry,
2262
- Rt as daysBetween,
2263
- Ke as describeElement,
2264
- ie as fixtureAdapter,
2265
- Vt as flatten,
2266
- qt as formatIssues,
2267
- Te as getDeployContext,
2268
- ee as handoffAllowsComponent,
2269
- Ae as handoffAllowsPath,
2270
- te as handoffAllowsScenario,
2271
- Gt as hasErrors,
2272
- Yt as matchPath,
2273
- Jt as normalizeHandoffScope,
2274
- Qt as parseColor,
2275
- $e as parseControls,
2276
- _e as parseHandoffScope,
2277
- Z as parseIsoDate,
2278
- Xt as readCssVariable,
2279
- Zt as relativeLuminance,
2280
- se as resolveFixture,
2281
- tt as resolveLabels,
2282
- Pe as resolveRoute,
2283
- Re as resolveViewport,
2284
- Me as scenarioUrl,
2285
- X as serializeControls,
2286
- eo as serializeValue,
2287
- Xe as shortSelector,
2288
- Ze as tabbableElements,
2289
- Ee as useDesignSpaceState,
2290
- et as useKeyboardMode,
2291
- P as useLabels,
2292
- ze as useScenarioData,
2293
- ye as validateProduct,
2294
- to as validateScenario
2358
+ Ie as CONTROL_PARAM_PREFIX,
2359
+ ne as DEFAULT_LABELS,
2360
+ un as DesignSpace,
2361
+ cn as EN_US_LABELS,
2362
+ pt as FRAME_ATTRIBUTE,
2363
+ wn as FRAME_PARAM,
2364
+ gn as HANDOFF_PARAM,
2365
+ ln as NETWORK_LABELS,
2366
+ We as NETWORK_STATES,
2367
+ _ as PARAM,
2368
+ Qe as SLOW_NETWORK_DELAY_MS,
2369
+ Je as SimulatedNetworkError,
2370
+ ze as StageEmpty,
2371
+ Ct as VIEWPORTS,
2372
+ pe as ZOOM_DEFAULT,
2373
+ Te as ZOOM_MAX,
2374
+ Le as ZOOM_MIN,
2375
+ hn as ageInYears,
2376
+ Me as applyHandoffScope,
2377
+ xe as applyOverrides,
2378
+ qe as clampZoom,
2379
+ vn as commitUrl,
2380
+ bn as componentUrl,
2381
+ dn as createHttpAdapter,
2382
+ gt as createRegistry,
2383
+ pn as daysBetween,
2384
+ $e as fixtureAdapter,
2385
+ kn as formatIssues,
2386
+ ft as getDeployContext,
2387
+ we as handoffAllowsComponent,
2388
+ Ve as handoffAllowsPath,
2389
+ oe as handoffAllowsScenario,
2390
+ Cn as hasErrors,
2391
+ Sn as matchPath,
2392
+ Nn as normalizeHandoffScope,
2393
+ X as normalizeSearch,
2394
+ St as parseControls,
2395
+ dt as parseHandoffScope,
2396
+ fe as parseIsoDate,
2397
+ ye as resolveFixture,
2398
+ Et as resolveLabels,
2399
+ Se as resolveRoute,
2400
+ Nt as resolveViewport,
2401
+ he as scenarioUrl,
2402
+ se as serializeControls,
2403
+ xn as serializeValue,
2404
+ Ge as useDesignSpaceState,
2405
+ Q as useLabels,
2406
+ Qt as useScenarioData,
2407
+ lt as validateProduct,
2408
+ yn as validateScenario
2295
2409
  };
2296
2410
  //# sourceMappingURL=index.js.map