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