@brucesantos/design-space 0.3.0 → 0.4.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 +37 -1
- package/README.md +80 -3
- package/dist/contrast-B8I8gWGa.js +288 -0
- package/dist/contrast-B8I8gWGa.js.map +1 -0
- package/dist/controls/params.d.ts +1 -0
- package/dist/deploy/index.d.ts +7 -1
- package/dist/design-space.css +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +800 -626
- package/dist/index.js.map +1 -1
- package/dist/registry/index.d.ts +24 -4
- package/dist/shell/Controls.d.ts +5 -3
- package/dist/shell/Home.d.ts +2 -1
- package/dist/shell/Inspector.d.ts +3 -2
- package/dist/shell/Sidebar.d.ts +2 -1
- package/dist/shell/Topbar.d.ts +3 -2
- package/dist/shell/labels.d.ts +7 -0
- package/dist/testing.js +8 -8
- package/dist/types/index.d.ts +34 -3
- package/package.json +1 -1
- package/dist/contrast-87-ijttm.js +0 -268
- package/dist/contrast-87-ijttm.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,209 +1,237 @@
|
|
|
1
|
-
import { jsxs as d, jsx as o, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { S as
|
|
4
|
-
import { C as
|
|
5
|
-
function
|
|
1
|
+
import { jsxs as d, jsx as o, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useEffect as B, useMemo as T, useCallback as I, useContext as se, createContext as ie, useRef as q, forwardRef as ce } from "react";
|
|
3
|
+
import { S as de, v as le, P as v, N as oe, s as ue, c as he, g as pe } from "./contrast-B8I8gWGa.js";
|
|
4
|
+
import { C as _t, a as Ct, b as Tt, d as Pt, e as At, f as Lt, h as Et, i as Ft, j as $t, k as Dt, p as Rt, r as Ot, l as It, m as Bt, n as Wt } from "./contrast-B8I8gWGa.js";
|
|
5
|
+
function me(e) {
|
|
6
6
|
const t = new Map(e.scenarios.map((l) => [l.id, l])), n = new Map(
|
|
7
7
|
(e.components ?? []).map((l) => [l.id, l])
|
|
8
|
-
),
|
|
8
|
+
), r = 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])), s = new Map(e.modules.map((l) => [l.id, l])), c = new Map(
|
|
9
9
|
e.modules.flatMap((l) => (l.flows ?? []).map((g) => [g.id, g]))
|
|
10
10
|
), p = e.modules.map((l) => ({
|
|
11
11
|
module: l,
|
|
12
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))),
|
|
13
|
+
})), h = new Set(p.flatMap((l) => l.scenarios.map((g) => g.id))), m = e.scenarios.filter((l) => !h.has(l.id)), b = (l) => l ? t.get(l) : void 0, u = (l) => l ? r.get(l) : void 0, S = (l, g) => {
|
|
14
|
+
if (!(!l || !g))
|
|
15
|
+
return n.get(l)?.fixtures?.find((k) => k.id === g);
|
|
16
|
+
}, w = (l = {}) => e.scenarios.filter(
|
|
17
|
+
(g) => l.includePorted || g.status !== "ported" || g.id === l.activeScenario
|
|
18
|
+
), C = (l) => l ? l.permissions ? l.permissions : u(l.persona)?.permissions ?? [] : [];
|
|
14
19
|
return {
|
|
15
20
|
product: e,
|
|
16
21
|
tree: p,
|
|
17
|
-
orphans:
|
|
18
|
-
issues:
|
|
19
|
-
scenario:
|
|
22
|
+
orphans: m,
|
|
23
|
+
issues: le(e),
|
|
24
|
+
scenario: b,
|
|
20
25
|
component: (l) => l ? n.get(l) : void 0,
|
|
21
|
-
|
|
26
|
+
componentFixture: S,
|
|
27
|
+
resolveComponentFixture: (l, g) => {
|
|
28
|
+
const k = l ? n.get(l) : void 0, M = S(l, g), _ = S(l, k?.defaultFixture) ?? k?.fixtures?.[0];
|
|
29
|
+
return {
|
|
30
|
+
fixture: M ?? _,
|
|
31
|
+
requestedId: g,
|
|
32
|
+
didFallback: !!(g && !M)
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
persona: u,
|
|
22
36
|
fixture: (l) => l ? i.get(l) : void 0,
|
|
23
37
|
rule: (l) => l ? a.get(l) : void 0,
|
|
24
|
-
module: (l) => l ?
|
|
38
|
+
module: (l) => l ? s.get(l) : void 0,
|
|
25
39
|
flow: (l) => l ? c.get(l) : void 0,
|
|
26
40
|
rulesOf: (l) => (l?.rules ?? []).map((g) => a.get(g)).filter((g) => !!g),
|
|
27
|
-
permissionsOf:
|
|
28
|
-
scenariosForRoute: (l) => {
|
|
29
|
-
const
|
|
30
|
-
return
|
|
41
|
+
permissionsOf: C,
|
|
42
|
+
scenariosForRoute: (l, g) => {
|
|
43
|
+
const k = l.split("?")[0];
|
|
44
|
+
return w(g).filter((M) => M.route.split("?")[0] === k);
|
|
45
|
+
},
|
|
46
|
+
activeScenarios: w,
|
|
47
|
+
treeFor: (l) => {
|
|
48
|
+
const g = new Set(w(l).map((k) => k.id));
|
|
49
|
+
return p.map((k) => ({
|
|
50
|
+
...k,
|
|
51
|
+
scenarios: k.scenarios.filter((M) => g.has(M.id))
|
|
52
|
+
}));
|
|
31
53
|
},
|
|
32
|
-
|
|
33
|
-
const g =
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
orphansFor: (l) => {
|
|
55
|
+
const g = new Set(w(l).map((k) => k.id));
|
|
56
|
+
return m.filter((k) => g.has(k.id));
|
|
57
|
+
},
|
|
58
|
+
search: (l, g) => {
|
|
59
|
+
const k = Q(l), M = w(g);
|
|
60
|
+
return k ? M.filter((_) => {
|
|
61
|
+
const $ = s.get(_.id.split(".")[0] ?? "")?.name ?? "";
|
|
62
|
+
return Q(
|
|
37
63
|
[
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(
|
|
45
|
-
(
|
|
64
|
+
_.title,
|
|
65
|
+
_.id,
|
|
66
|
+
_.intent ?? "",
|
|
67
|
+
_.route,
|
|
68
|
+
$,
|
|
69
|
+
r.get(_.persona)?.name ?? "",
|
|
70
|
+
(_.tags ?? []).join(" "),
|
|
71
|
+
(_.expected ?? []).join(" ")
|
|
46
72
|
].join(" ")
|
|
47
|
-
).includes(
|
|
48
|
-
}) :
|
|
73
|
+
).includes(k);
|
|
74
|
+
}) : M;
|
|
49
75
|
},
|
|
50
76
|
byStatus: (l) => e.scenarios.filter((g) => g.status === l),
|
|
51
|
-
coverage: () => {
|
|
52
|
-
const
|
|
53
|
-
|
|
77
|
+
coverage: (l) => {
|
|
78
|
+
const g = Object.fromEntries(
|
|
79
|
+
de.map((k) => [k, 0])
|
|
54
80
|
);
|
|
55
|
-
for (const
|
|
56
|
-
return
|
|
81
|
+
for (const k of w(l)) g[k.status] += 1;
|
|
82
|
+
return g;
|
|
57
83
|
}
|
|
58
84
|
};
|
|
59
85
|
}
|
|
60
|
-
function
|
|
86
|
+
function Q(e) {
|
|
61
87
|
return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
|
|
62
88
|
}
|
|
63
|
-
const
|
|
89
|
+
const ne = [
|
|
64
90
|
{ id: "fit", label: "Ajustar" },
|
|
65
91
|
{ id: "mobile", label: "Celular", width: 390, height: 844 },
|
|
66
92
|
{ id: "tablet", label: "Tablet", width: 834, height: 1112 },
|
|
67
93
|
{ id: "desktop", label: "Desktop", width: 1440, height: 900 },
|
|
68
94
|
{ id: "custom", label: "Personalizado" }
|
|
69
|
-
],
|
|
70
|
-
function
|
|
71
|
-
const n = new URLSearchParams(e),
|
|
95
|
+
], fe = [1, 1.25, 1.5, 2];
|
|
96
|
+
function be(e, t) {
|
|
97
|
+
const n = new URLSearchParams(e), r = n.get(v.component) ?? void 0, i = t.component(r), a = n.get(v.scenario) ?? void 0, s = i ? void 0 : t.scenario(a), c = n.get(v.fixture) ?? void 0, p = i ? c ?? t.componentFixture(i.id, i.defaultFixture)?.id ?? i.fixtures?.[0]?.id : void 0, h = n.get(v.network), m = Number(n.get(v.textScale));
|
|
72
98
|
return {
|
|
73
|
-
scenario:
|
|
99
|
+
scenario: s?.id,
|
|
100
|
+
showPorted: n.get(v.showPorted) === "1",
|
|
74
101
|
component: i?.id,
|
|
75
|
-
persona: n.get(
|
|
76
|
-
fixture:
|
|
77
|
-
network:
|
|
78
|
-
viewport: n.get(
|
|
79
|
-
customWidth:
|
|
80
|
-
themeMode: n.get(
|
|
81
|
-
locale: n.get(
|
|
82
|
-
dataSource: n.get(
|
|
83
|
-
chromeTheme:
|
|
102
|
+
persona: n.get(v.persona) ?? s?.persona,
|
|
103
|
+
fixture: i ? p : c ?? s?.fixture,
|
|
104
|
+
network: we(h) ? h : s?.network ?? "success",
|
|
105
|
+
viewport: n.get(v.viewport) ?? "fit",
|
|
106
|
+
customWidth: Ne(n.get(v.customWidth)),
|
|
107
|
+
themeMode: n.get(v.themeMode) ?? t.product.theme?.modes?.[0],
|
|
108
|
+
locale: n.get(v.locale) ?? t.product.theme?.locales?.[0],
|
|
109
|
+
dataSource: n.get(v.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
|
|
110
|
+
chromeTheme: ke(n.get(v.chromeTheme)) ? n.get(v.chromeTheme) : "dark",
|
|
84
111
|
// Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
|
|
85
112
|
// 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(
|
|
113
|
+
chrome: n.get(v.chrome) !== "0",
|
|
114
|
+
keyboardMode: n.get(v.keyboardMode) === "1",
|
|
115
|
+
reducedMotion: n.get(v.reducedMotion) === "1",
|
|
116
|
+
textScale: fe.includes(m) ? m : 1,
|
|
117
|
+
inspector: n.get(v.inspector) !== "0"
|
|
91
118
|
};
|
|
92
119
|
}
|
|
93
|
-
function
|
|
94
|
-
const n = new URLSearchParams(),
|
|
95
|
-
e.component ? n.set(
|
|
120
|
+
function G(e, t) {
|
|
121
|
+
const n = new URLSearchParams(), r = t.scenario(e.scenario);
|
|
122
|
+
e.component ? n.set(v.component, e.component) : e.scenario && n.set(v.scenario, e.scenario), e.showPorted && n.set(v.showPorted, "1"), e.persona && e.persona !== r?.persona && n.set(v.persona, e.persona), e.component && e.fixture ? n.set(v.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && n.set(v.fixture, e.fixture), e.network !== (r?.network ?? "success") && n.set(v.network, e.network), e.viewport !== "fit" && n.set(v.viewport, e.viewport), e.viewport === "custom" && e.customWidth && n.set(v.customWidth, String(e.customWidth));
|
|
96
123
|
const i = t.product.theme?.modes?.[0];
|
|
97
|
-
e.themeMode && e.themeMode !== i && n.set(
|
|
124
|
+
e.themeMode && e.themeMode !== i && n.set(v.themeMode, e.themeMode);
|
|
98
125
|
const a = t.product.theme?.locales?.[0];
|
|
99
|
-
e.locale && e.locale !== a && n.set(
|
|
100
|
-
const
|
|
101
|
-
e.dataSource && e.dataSource !==
|
|
126
|
+
e.locale && e.locale !== a && n.set(v.locale, e.locale);
|
|
127
|
+
const s = t.product.dataSources?.default ?? "fixtures";
|
|
128
|
+
e.dataSource && e.dataSource !== s && n.set(v.dataSource, e.dataSource), e.chromeTheme === "light" && n.set(v.chromeTheme, "light"), e.chrome || n.set(v.chrome, "0"), e.keyboardMode && n.set(v.keyboardMode, "1"), e.reducedMotion && n.set(v.reducedMotion, "1"), e.textScale !== 1 && n.set(v.textScale, String(e.textScale)), e.inspector || n.set(v.inspector, "0");
|
|
102
129
|
const c = n.toString();
|
|
103
130
|
return c ? `?${c}` : "";
|
|
104
131
|
}
|
|
105
|
-
function
|
|
106
|
-
const [t, n] =
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
return window.addEventListener("popstate",
|
|
132
|
+
function ge(e) {
|
|
133
|
+
const [t, n] = F(() => X());
|
|
134
|
+
B(() => {
|
|
135
|
+
const m = () => n(X());
|
|
136
|
+
return window.addEventListener("popstate", m), () => window.removeEventListener("popstate", m);
|
|
110
137
|
}, []);
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
}, []), a =
|
|
115
|
-
(
|
|
116
|
-
const
|
|
117
|
-
i(t.path,
|
|
138
|
+
const r = T(() => be(t.search, e), [t.search, e]), i = I((m, b, u = !1) => {
|
|
139
|
+
const S = `${m}${b}`;
|
|
140
|
+
u ? window.history.replaceState(null, "", S) : window.history.pushState(null, "", S), n({ path: m, search: b });
|
|
141
|
+
}, []), a = I(
|
|
142
|
+
(m) => {
|
|
143
|
+
const b = { ...r, ...m };
|
|
144
|
+
i(t.path, G(b, e), !0);
|
|
118
145
|
},
|
|
119
|
-
[
|
|
120
|
-
),
|
|
121
|
-
(
|
|
122
|
-
const [
|
|
123
|
-
i(
|
|
146
|
+
[r, t.path, i, e]
|
|
147
|
+
), s = I(
|
|
148
|
+
(m, b) => {
|
|
149
|
+
const [u, S] = m.split("?"), w = u || "/", C = S ? `?${S}` : t.search;
|
|
150
|
+
i(w, C, b?.replace ?? !1);
|
|
124
151
|
},
|
|
125
152
|
[t.search, i]
|
|
126
|
-
), c =
|
|
127
|
-
(
|
|
128
|
-
const
|
|
129
|
-
if (!
|
|
130
|
-
const
|
|
131
|
-
...
|
|
132
|
-
scenario:
|
|
153
|
+
), c = I(
|
|
154
|
+
(m) => {
|
|
155
|
+
const b = e.scenario(m);
|
|
156
|
+
if (!b) return;
|
|
157
|
+
const u = {
|
|
158
|
+
...r,
|
|
159
|
+
scenario: b.id,
|
|
160
|
+
showPorted: r.showPorted,
|
|
133
161
|
component: void 0,
|
|
134
|
-
persona:
|
|
135
|
-
fixture:
|
|
136
|
-
network:
|
|
162
|
+
persona: b.persona,
|
|
163
|
+
fixture: b.fixture,
|
|
164
|
+
network: b.network ?? "success"
|
|
137
165
|
};
|
|
138
|
-
i(
|
|
166
|
+
i(b.route, G(u, e), !1);
|
|
139
167
|
},
|
|
140
|
-
[
|
|
141
|
-
), p =
|
|
142
|
-
(
|
|
143
|
-
const
|
|
144
|
-
if (!
|
|
145
|
-
const
|
|
146
|
-
...
|
|
168
|
+
[r, i, e]
|
|
169
|
+
), p = I(
|
|
170
|
+
(m) => {
|
|
171
|
+
const b = e.component(m);
|
|
172
|
+
if (!b) return;
|
|
173
|
+
const u = {
|
|
174
|
+
...r,
|
|
147
175
|
scenario: void 0,
|
|
148
|
-
component:
|
|
176
|
+
component: b.id,
|
|
149
177
|
persona: void 0,
|
|
150
178
|
fixture: void 0,
|
|
151
179
|
network: "success"
|
|
152
180
|
};
|
|
153
|
-
i("/",
|
|
181
|
+
u.fixture = e.componentFixture(b.id, b.defaultFixture)?.id ?? b.fixtures?.[0]?.id, i("/", G(u, e), !1);
|
|
154
182
|
},
|
|
155
|
-
[
|
|
156
|
-
), h =
|
|
157
|
-
return { location: t, controls:
|
|
183
|
+
[r, i, e]
|
|
184
|
+
), h = T(() => ve(r), [r]);
|
|
185
|
+
return { location: t, controls: r, viewport: h, setControls: a, navigate: s, openScenario: c, openComponent: p };
|
|
158
186
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
187
|
+
function ve(e) {
|
|
188
|
+
const t = ne.find((n) => n.id === e.viewport);
|
|
161
189
|
return e.viewport === "custom" ? { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 } : t ?? { id: "fit", label: "Ajustar" };
|
|
162
190
|
}
|
|
163
|
-
function
|
|
191
|
+
function X() {
|
|
164
192
|
return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
|
|
165
193
|
}
|
|
166
|
-
function
|
|
167
|
-
return e !== null &&
|
|
194
|
+
function we(e) {
|
|
195
|
+
return e !== null && oe.includes(e);
|
|
168
196
|
}
|
|
169
|
-
function
|
|
197
|
+
function ke(e) {
|
|
170
198
|
return e === "dark" || e === "light";
|
|
171
199
|
}
|
|
172
|
-
function
|
|
200
|
+
function Ne(e) {
|
|
173
201
|
if (!e) return;
|
|
174
202
|
const t = Number.parseInt(e, 10);
|
|
175
203
|
return Number.isFinite(t) && t > 0 ? t : void 0;
|
|
176
204
|
}
|
|
177
|
-
function
|
|
178
|
-
const n = e.split("/").filter(Boolean),
|
|
179
|
-
for (const [a,
|
|
180
|
-
if (
|
|
181
|
-
return i["*"] =
|
|
182
|
-
const c =
|
|
205
|
+
function ye(e, t) {
|
|
206
|
+
const n = e.split("/").filter(Boolean), r = Se(t).split("/").filter(Boolean), i = {};
|
|
207
|
+
for (const [a, s] of n.entries()) {
|
|
208
|
+
if (s === "*")
|
|
209
|
+
return i["*"] = r.slice(a).join("/"), i;
|
|
210
|
+
const c = r[a];
|
|
183
211
|
if (c === void 0) return null;
|
|
184
|
-
if (
|
|
185
|
-
i[
|
|
212
|
+
if (s.startsWith(":")) {
|
|
213
|
+
i[s.slice(1)] = c;
|
|
186
214
|
continue;
|
|
187
215
|
}
|
|
188
|
-
if (
|
|
216
|
+
if (s !== c) return null;
|
|
189
217
|
}
|
|
190
|
-
return n.length !==
|
|
218
|
+
return n.length !== r.length ? null : i;
|
|
191
219
|
}
|
|
192
|
-
function
|
|
193
|
-
const n = [...e].sort((
|
|
194
|
-
for (const
|
|
195
|
-
const i =
|
|
196
|
-
if (i) return { definition:
|
|
220
|
+
function xe(e, t) {
|
|
221
|
+
const n = [...e].sort((r, i) => Z(i.path) - Z(r.path));
|
|
222
|
+
for (const r of n) {
|
|
223
|
+
const i = ye(r.path, t);
|
|
224
|
+
if (i) return { definition: r, params: i };
|
|
197
225
|
}
|
|
198
226
|
}
|
|
199
|
-
function
|
|
227
|
+
function Z(e) {
|
|
200
228
|
const t = e.split("/").filter(Boolean);
|
|
201
229
|
let n = t.length;
|
|
202
|
-
for (const
|
|
203
|
-
|
|
230
|
+
for (const r of t)
|
|
231
|
+
r === "*" ? n -= 2 : r.startsWith(":") ? n += 1 : n += 4;
|
|
204
232
|
return n;
|
|
205
233
|
}
|
|
206
|
-
function
|
|
234
|
+
function Se(e) {
|
|
207
235
|
const t = e.split("?")[0] ?? e;
|
|
208
236
|
try {
|
|
209
237
|
return decodeURI(t);
|
|
@@ -211,17 +239,17 @@ function Ne(e) {
|
|
|
211
239
|
return t;
|
|
212
240
|
}
|
|
213
241
|
}
|
|
214
|
-
const
|
|
215
|
-
class
|
|
242
|
+
const Me = 2500;
|
|
243
|
+
class _e extends Error {
|
|
216
244
|
constructor(t) {
|
|
217
245
|
super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
|
|
218
246
|
}
|
|
219
247
|
}
|
|
220
|
-
function
|
|
248
|
+
function Y(e) {
|
|
221
249
|
if (e)
|
|
222
250
|
return typeof e.data == "function" ? e.data() : e.data;
|
|
223
251
|
}
|
|
224
|
-
const
|
|
252
|
+
const J = {
|
|
225
253
|
id: "fixtures",
|
|
226
254
|
label: "Fixtures",
|
|
227
255
|
load: async ({ scenario: e, fixture: t, network: n }) => {
|
|
@@ -229,56 +257,56 @@ const q = {
|
|
|
229
257
|
case "empty":
|
|
230
258
|
return null;
|
|
231
259
|
case "error":
|
|
232
|
-
throw new
|
|
260
|
+
throw new _e(e.id);
|
|
233
261
|
case "loading":
|
|
234
262
|
return new Promise(() => {
|
|
235
263
|
});
|
|
236
264
|
case "slow":
|
|
237
|
-
return await Me
|
|
265
|
+
return await Ce(Me), Y(t);
|
|
238
266
|
default:
|
|
239
|
-
return
|
|
267
|
+
return Y(t);
|
|
240
268
|
}
|
|
241
269
|
}
|
|
242
270
|
};
|
|
243
|
-
function
|
|
244
|
-
const { id: t, label: n, baseUrl:
|
|
271
|
+
function ft(e) {
|
|
272
|
+
const { id: t, label: n, baseUrl: r, path: i, init: a, fallbackToFixture: s = !0 } = e;
|
|
245
273
|
return {
|
|
246
274
|
id: t,
|
|
247
275
|
label: n,
|
|
248
276
|
load: async (c) => {
|
|
249
|
-
const p = new URL(i ? i(c) : c.scenario.route,
|
|
277
|
+
const p = new URL(i ? i(c) : c.scenario.route, r);
|
|
250
278
|
try {
|
|
251
279
|
const h = await fetch(p, a);
|
|
252
280
|
if (!h.ok) throw new Error(`${h.status} ${h.statusText}`);
|
|
253
281
|
return await h.json();
|
|
254
282
|
} catch (h) {
|
|
255
|
-
if (
|
|
283
|
+
if (s) return Y(c.fixture);
|
|
256
284
|
throw new Error(`Adapter "${t}" falhou em ${p.toString()}`, { cause: h });
|
|
257
285
|
}
|
|
258
286
|
}
|
|
259
287
|
};
|
|
260
288
|
}
|
|
261
|
-
function
|
|
289
|
+
function Ce(e) {
|
|
262
290
|
return new Promise((t) => setTimeout(t, e));
|
|
263
291
|
}
|
|
264
|
-
function
|
|
265
|
-
const { scenario: t, fixture: n, network:
|
|
292
|
+
function Te(e) {
|
|
293
|
+
const { scenario: t, fixture: n, network: r, adapter: i } = e, [a, s] = F({
|
|
266
294
|
data: void 0,
|
|
267
295
|
isLoading: !!t,
|
|
268
296
|
error: void 0
|
|
269
297
|
});
|
|
270
|
-
return
|
|
298
|
+
return B(() => {
|
|
271
299
|
if (!t) {
|
|
272
|
-
|
|
300
|
+
s({ data: void 0, isLoading: !1, error: void 0 });
|
|
273
301
|
return;
|
|
274
302
|
}
|
|
275
303
|
let c = !0;
|
|
276
|
-
|
|
277
|
-
const p = i ??
|
|
278
|
-
return Promise.resolve(p.load({ scenario: t, fixture: n, network:
|
|
279
|
-
c &&
|
|
304
|
+
s({ data: void 0, isLoading: !0, error: void 0 });
|
|
305
|
+
const p = i ?? J;
|
|
306
|
+
return Promise.resolve(p.load({ scenario: t, fixture: n, network: r })).then((h) => {
|
|
307
|
+
c && s({ data: h, isLoading: !1, error: void 0 });
|
|
280
308
|
}).catch((h) => {
|
|
281
|
-
c &&
|
|
309
|
+
c && s({
|
|
282
310
|
data: void 0,
|
|
283
311
|
isLoading: !1,
|
|
284
312
|
error: h instanceof Error ? h : new Error(String(h))
|
|
@@ -286,9 +314,9 @@ function _e(e) {
|
|
|
286
314
|
}), () => {
|
|
287
315
|
c = !1;
|
|
288
316
|
};
|
|
289
|
-
}, [t, n,
|
|
317
|
+
}, [t, n, r, i]), a;
|
|
290
318
|
}
|
|
291
|
-
const
|
|
319
|
+
const Pe = {
|
|
292
320
|
a: "link",
|
|
293
321
|
article: "article",
|
|
294
322
|
aside: "complementary",
|
|
@@ -322,7 +350,7 @@ const Ce = {
|
|
|
322
350
|
th: "columnheader",
|
|
323
351
|
tr: "row",
|
|
324
352
|
ul: "list"
|
|
325
|
-
},
|
|
353
|
+
}, Ae = {
|
|
326
354
|
button: "button",
|
|
327
355
|
checkbox: "checkbox",
|
|
328
356
|
email: "textbox",
|
|
@@ -339,58 +367,58 @@ const Ce = {
|
|
|
339
367
|
};
|
|
340
368
|
function Le(e) {
|
|
341
369
|
if (!e || !(e instanceof HTMLElement)) return;
|
|
342
|
-
const { name: t, nameFrom: n } =
|
|
370
|
+
const { name: t, nameFrom: n } = Fe(e);
|
|
343
371
|
return {
|
|
344
|
-
role:
|
|
372
|
+
role: Ee(e),
|
|
345
373
|
name: t,
|
|
346
374
|
nameFrom: n,
|
|
347
375
|
description: $e(e),
|
|
348
|
-
states:
|
|
349
|
-
selector:
|
|
376
|
+
states: De(e),
|
|
377
|
+
selector: Ie(e),
|
|
350
378
|
hiddenFromTabOrder: e.tabIndex < 0,
|
|
351
379
|
hiddenFromAssistiveTech: Re(e)
|
|
352
380
|
};
|
|
353
381
|
}
|
|
354
|
-
function
|
|
382
|
+
function Ee(e) {
|
|
355
383
|
const t = e.getAttribute("role");
|
|
356
384
|
if (t) return t.split(/\s+/)[0] ?? t;
|
|
357
385
|
const n = e.tagName.toLowerCase();
|
|
358
386
|
if (n === "input") {
|
|
359
|
-
const
|
|
360
|
-
return
|
|
387
|
+
const r = e.type.toLowerCase();
|
|
388
|
+
return Ae[r] ?? "textbox";
|
|
361
389
|
}
|
|
362
|
-
return n === "a" && !e.hasAttribute("href") ? "generic" :
|
|
390
|
+
return n === "a" && !e.hasAttribute("href") ? "generic" : Pe[n] ?? "generic";
|
|
363
391
|
}
|
|
364
|
-
function
|
|
392
|
+
function Fe(e) {
|
|
365
393
|
const t = e.getAttribute("aria-labelledby");
|
|
366
394
|
if (t) {
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
395
|
+
const s = t.split(/\s+/).map((c) => e.ownerDocument.getElementById(c)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
|
|
396
|
+
if (s) return { name: s, nameFrom: "aria-labelledby" };
|
|
369
397
|
}
|
|
370
398
|
const n = e.getAttribute("aria-label")?.trim();
|
|
371
399
|
if (n) return { name: n, nameFrom: "aria-label" };
|
|
372
400
|
if (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) {
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
401
|
+
const s = Array.from(e.labels ?? []).map((c) => c.textContent?.trim() ?? "").filter(Boolean);
|
|
402
|
+
if (s.length) return { name: s.join(" "), nameFrom: "label" };
|
|
375
403
|
}
|
|
376
404
|
if (e instanceof HTMLImageElement) {
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
405
|
+
const s = e.getAttribute("alt");
|
|
406
|
+
if (s !== null) return { name: s, nameFrom: "alt" };
|
|
379
407
|
}
|
|
380
|
-
const
|
|
381
|
-
return i ? { name: i, nameFrom: "content" } :
|
|
408
|
+
const r = e.getAttribute("title")?.trim(), i = Oe(e);
|
|
409
|
+
return i ? { name: i, nameFrom: "content" } : r ? { name: r, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
|
|
382
410
|
}
|
|
383
411
|
function $e(e) {
|
|
384
412
|
const t = e.getAttribute("aria-describedby");
|
|
385
413
|
if (t) {
|
|
386
|
-
const n = t.split(/\s+/).map((
|
|
414
|
+
const n = t.split(/\s+/).map((r) => e.ownerDocument.getElementById(r)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
|
|
387
415
|
if (n) return n;
|
|
388
416
|
}
|
|
389
417
|
return e.getAttribute("aria-description")?.trim() || void 0;
|
|
390
418
|
}
|
|
391
|
-
function
|
|
392
|
-
const t = [], n = (
|
|
393
|
-
const a = e.getAttribute(
|
|
419
|
+
function De(e) {
|
|
420
|
+
const t = [], n = (r, i = r.replace("aria-", "")) => {
|
|
421
|
+
const a = e.getAttribute(r);
|
|
394
422
|
a !== null && a !== "false" && t.push(a === "true" || a === "" ? i : `${i}=${a}`);
|
|
395
423
|
};
|
|
396
424
|
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)];
|
|
@@ -403,21 +431,21 @@ function Re(e) {
|
|
|
403
431
|
}
|
|
404
432
|
return !1;
|
|
405
433
|
}
|
|
406
|
-
function
|
|
434
|
+
function Oe(e) {
|
|
407
435
|
const t = e.cloneNode(!0);
|
|
408
436
|
for (const n of t.querySelectorAll("[aria-hidden='true'],[hidden]"))
|
|
409
437
|
n.remove();
|
|
410
438
|
return (t.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 160);
|
|
411
439
|
}
|
|
412
|
-
function
|
|
440
|
+
function Ie(e) {
|
|
413
441
|
const t = e.tagName.toLowerCase();
|
|
414
442
|
if (e.id) return `${t}#${e.id}`;
|
|
415
443
|
const n = e.getAttribute("data-testid");
|
|
416
444
|
if (n) return `${t}[data-testid="${n}"]`;
|
|
417
|
-
const
|
|
418
|
-
return
|
|
445
|
+
const r = Array.from(e.classList).slice(0, 2);
|
|
446
|
+
return r.length ? `${t}.${r.join(".")}` : t;
|
|
419
447
|
}
|
|
420
|
-
function
|
|
448
|
+
function Be(e = document) {
|
|
421
449
|
const t = [
|
|
422
450
|
"a[href]",
|
|
423
451
|
"button",
|
|
@@ -430,19 +458,19 @@ function Ie(e = document) {
|
|
|
430
458
|
].join(",");
|
|
431
459
|
return Array.from(e.querySelectorAll(t)).filter((n) => {
|
|
432
460
|
if (n.tabIndex < 0 || n.disabled || n.getAttribute("aria-hidden") === "true") return !1;
|
|
433
|
-
const
|
|
434
|
-
return
|
|
461
|
+
const r = window.getComputedStyle(n);
|
|
462
|
+
return r.display === "none" || r.visibility === "hidden" ? !1 : n.offsetWidth > 0 || n.offsetHeight > 0 || n === document.activeElement;
|
|
435
463
|
});
|
|
436
464
|
}
|
|
437
|
-
function
|
|
438
|
-
const [n,
|
|
465
|
+
function We(e, t) {
|
|
466
|
+
const [n, r] = F(), [i, a] = F([]), s = I(() => {
|
|
439
467
|
const c = t.current;
|
|
440
468
|
if (!c) {
|
|
441
469
|
a([]);
|
|
442
470
|
return;
|
|
443
471
|
}
|
|
444
472
|
a(
|
|
445
|
-
|
|
473
|
+
Be(c).map((p, h) => ({
|
|
446
474
|
index: h + 1,
|
|
447
475
|
element: p,
|
|
448
476
|
rect: p.getBoundingClientRect(),
|
|
@@ -450,20 +478,20 @@ function Oe(e, t) {
|
|
|
450
478
|
}))
|
|
451
479
|
);
|
|
452
480
|
}, [t]);
|
|
453
|
-
return
|
|
481
|
+
return B(() => {
|
|
454
482
|
if (!e) {
|
|
455
|
-
|
|
483
|
+
r(void 0), a([]);
|
|
456
484
|
return;
|
|
457
485
|
}
|
|
458
|
-
const c = () =>
|
|
459
|
-
document.addEventListener("focusin", c), window.addEventListener("resize",
|
|
460
|
-
const p = t.current, h = p ? new MutationObserver(() =>
|
|
486
|
+
const c = () => r(Le(document.activeElement));
|
|
487
|
+
document.addEventListener("focusin", c), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), c(), s();
|
|
488
|
+
const p = t.current, h = p ? new MutationObserver(() => s()) : void 0;
|
|
461
489
|
return h?.observe(p, { childList: !0, subtree: !0, attributes: !0 }), () => {
|
|
462
|
-
document.removeEventListener("focusin", c), window.removeEventListener("resize",
|
|
490
|
+
document.removeEventListener("focusin", c), window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0), h?.disconnect();
|
|
463
491
|
};
|
|
464
|
-
}, [e,
|
|
492
|
+
}, [e, s, t]), { focused: n, tabStops: i, refresh: s };
|
|
465
493
|
}
|
|
466
|
-
const
|
|
494
|
+
const E = {
|
|
467
495
|
status: {
|
|
468
496
|
ported: "Portado — não validado",
|
|
469
497
|
proposed: "Proposta",
|
|
@@ -529,6 +557,8 @@ const C = {
|
|
|
529
557
|
matchCount: (e) => `${e} ${e === 1 ? "situação" : "situações"}.`,
|
|
530
558
|
noComponentMatch: (e) => `Nenhum componente para "${e}".`,
|
|
531
559
|
componentMatchCount: (e) => `${e} ${e === 1 ? "componente" : "componentes"}.`,
|
|
560
|
+
showPorted: "Mostrar portados",
|
|
561
|
+
activePorted: "Aberto por link direto; oculto do trabalho ativo",
|
|
532
562
|
emptyModule: "Nenhum cenário ainda.",
|
|
533
563
|
emptyComponents: "O produto ainda não registrou componentes.",
|
|
534
564
|
withoutModule: "Sem módulo",
|
|
@@ -541,6 +571,7 @@ const C = {
|
|
|
541
571
|
region: "Controles do cenário",
|
|
542
572
|
persona: "Persona",
|
|
543
573
|
fixture: "Dados",
|
|
574
|
+
componentFixture: "Dados do componente",
|
|
544
575
|
network: "Rede",
|
|
545
576
|
viewport: "Viewport",
|
|
546
577
|
customWidth: "Largura personalizada em pixels",
|
|
@@ -565,6 +596,9 @@ const C = {
|
|
|
565
596
|
noScenario: "Nenhum cenário ativo. Escolha uma situação na navegação para ver contexto, regras e critérios.",
|
|
566
597
|
componentReference: "Componente",
|
|
567
598
|
componentGroup: "Grupo",
|
|
599
|
+
componentFixture: "Fixture ativa",
|
|
600
|
+
componentFixtureDescription: "Descrição da fixture",
|
|
601
|
+
componentFixtureFallback: (e, t) => `A fixture \`${e}\` não existe neste componente. Exibindo \`${t}\` como fallback.`,
|
|
568
602
|
situation: "Situação",
|
|
569
603
|
reproduction: "Reprodução",
|
|
570
604
|
id: "Id",
|
|
@@ -614,14 +648,15 @@ const C = {
|
|
|
614
648
|
withoutModule: "Sem módulo",
|
|
615
649
|
withoutModuleHint: "O prefixo do id não corresponde a nenhum módulo registrado, então estas situações não aparecem na navegação por módulo.",
|
|
616
650
|
emptyModule: "Nenhuma situação registrada neste módulo ainda.",
|
|
617
|
-
keyboardBadge: "teclado"
|
|
651
|
+
keyboardBadge: "teclado",
|
|
652
|
+
noActiveWork: "Não há trabalho ativo. As referências portadas continuam registradas e podem ser exibidas com “Mostrar portados”."
|
|
618
653
|
},
|
|
619
654
|
shell: {
|
|
620
655
|
restoreChrome: "Mostrar controles",
|
|
621
656
|
noRoute: "Nenhuma rota para este endereço",
|
|
622
657
|
noRouteHint: "não casa com nenhuma rota declarada. Escolha uma situação na navegação."
|
|
623
658
|
}
|
|
624
|
-
},
|
|
659
|
+
}, bt = {
|
|
625
660
|
status: {
|
|
626
661
|
ported: "Ported — not validated",
|
|
627
662
|
proposed: "Proposed",
|
|
@@ -687,6 +722,8 @@ const C = {
|
|
|
687
722
|
matchCount: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"}.`,
|
|
688
723
|
noComponentMatch: (e) => `No components found for "${e}".`,
|
|
689
724
|
componentMatchCount: (e) => `${e} ${e === 1 ? "component" : "components"}.`,
|
|
725
|
+
showPorted: "Show ported",
|
|
726
|
+
activePorted: "Opened by direct link; hidden from active work",
|
|
690
727
|
emptyModule: "No scenarios yet.",
|
|
691
728
|
emptyComponents: "The product has not registered any components yet.",
|
|
692
729
|
withoutModule: "No module",
|
|
@@ -699,6 +736,7 @@ const C = {
|
|
|
699
736
|
region: "Scenario controls",
|
|
700
737
|
persona: "Persona",
|
|
701
738
|
fixture: "Data",
|
|
739
|
+
componentFixture: "Component data",
|
|
702
740
|
network: "Network",
|
|
703
741
|
viewport: "Viewport",
|
|
704
742
|
customWidth: "Custom width in pixels",
|
|
@@ -723,6 +761,9 @@ const C = {
|
|
|
723
761
|
noScenario: "No active scenario. Choose a state in the navigation to see its context, rules, and criteria.",
|
|
724
762
|
componentReference: "Component",
|
|
725
763
|
componentGroup: "Group",
|
|
764
|
+
componentFixture: "Active fixture",
|
|
765
|
+
componentFixtureDescription: "Fixture description",
|
|
766
|
+
componentFixtureFallback: (e, t) => `Fixture \`${e}\` does not exist for this component. Showing \`${t}\` as fallback.`,
|
|
726
767
|
situation: "State",
|
|
727
768
|
reproduction: "Reproduction",
|
|
728
769
|
id: "ID",
|
|
@@ -772,7 +813,8 @@ const C = {
|
|
|
772
813
|
withoutModule: "No module",
|
|
773
814
|
withoutModuleHint: "The ID prefix does not match a registered module, so these states do not appear in module navigation.",
|
|
774
815
|
emptyModule: "No states have been registered in this module yet.",
|
|
775
|
-
keyboardBadge: "keyboard"
|
|
816
|
+
keyboardBadge: "keyboard",
|
|
817
|
+
noActiveWork: "There is no active work. Ported references remain registered and can be included with “Show ported”."
|
|
776
818
|
},
|
|
777
819
|
shell: {
|
|
778
820
|
restoreChrome: "Show controls",
|
|
@@ -780,73 +822,79 @@ const C = {
|
|
|
780
822
|
noRouteHint: "does not match any declared route. Choose a state from the navigation."
|
|
781
823
|
}
|
|
782
824
|
};
|
|
783
|
-
function
|
|
784
|
-
if (!e) return
|
|
785
|
-
const t = { ...
|
|
786
|
-
for (const n of Object.keys(
|
|
787
|
-
const
|
|
788
|
-
|
|
825
|
+
function je(e) {
|
|
826
|
+
if (!e) return E;
|
|
827
|
+
const t = { ...E };
|
|
828
|
+
for (const n of Object.keys(E)) {
|
|
829
|
+
const r = e[n];
|
|
830
|
+
r && (t[n] = { ...E[n], ...r });
|
|
789
831
|
}
|
|
790
832
|
return t;
|
|
791
833
|
}
|
|
792
|
-
const
|
|
793
|
-
function
|
|
794
|
-
return ae
|
|
834
|
+
const ae = ie(E);
|
|
835
|
+
function A() {
|
|
836
|
+
return se(ae);
|
|
795
837
|
}
|
|
796
|
-
const
|
|
797
|
-
function
|
|
838
|
+
const gt = E.status, vt = E.statusMeaning, wt = E.network, kt = E.keyboard;
|
|
839
|
+
function He({
|
|
798
840
|
registry: e,
|
|
799
841
|
activeScenario: t,
|
|
800
842
|
activeComponent: n,
|
|
801
|
-
controls:
|
|
843
|
+
controls: r,
|
|
802
844
|
onOpenScenario: i,
|
|
803
|
-
onOpenComponent: a
|
|
845
|
+
onOpenComponent: a,
|
|
846
|
+
onShowPortedChange: s
|
|
804
847
|
}) {
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
n ?
|
|
808
|
-
}, [n, t]),
|
|
809
|
-
const f = (
|
|
810
|
-
|
|
848
|
+
const c = A(), [p, h] = F(n ? "components" : "flows"), [m, b] = F(""), [u, S] = F(/* @__PURE__ */ new Set()), w = q(null), C = q(/* @__PURE__ */ new Map());
|
|
849
|
+
B(() => {
|
|
850
|
+
n ? h("components") : t && h("flows");
|
|
851
|
+
}, [n, t]), B(() => {
|
|
852
|
+
const f = (N) => {
|
|
853
|
+
Ue(N) && (N.preventDefault(), w.current?.focus(), w.current?.select());
|
|
811
854
|
};
|
|
812
855
|
return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
|
|
813
856
|
}, []);
|
|
814
|
-
const
|
|
815
|
-
if (
|
|
816
|
-
return new Set(
|
|
817
|
-
|
|
818
|
-
|
|
857
|
+
const l = T(() => {
|
|
858
|
+
if (m.trim())
|
|
859
|
+
return new Set(
|
|
860
|
+
e.search(m, { includePorted: r.showPorted }).map((f) => f.id)
|
|
861
|
+
);
|
|
862
|
+
}, [r.showPorted, m, e]), g = T(() => {
|
|
863
|
+
const f = te(m);
|
|
819
864
|
return (e.product.components ?? []).filter(
|
|
820
|
-
(
|
|
865
|
+
(N) => te([N.name, N.id, N.group, N.description].join(" ")).includes(
|
|
821
866
|
f
|
|
822
867
|
)
|
|
823
868
|
);
|
|
824
|
-
}, [
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
869
|
+
}, [m, e.product.components]), k = (f) => l ? f.filter((N) => l.has(N.id)) : f, M = {
|
|
870
|
+
includePorted: r.showPorted,
|
|
871
|
+
activeScenario: m.trim() ? void 0 : t?.id
|
|
872
|
+
}, _ = e.treeFor(M).map((f) => ({ ...f, scenarios: k(f.scenarios) })).filter((f) => l ? f.scenarios.length > 0 : !0), $ = k(e.orphansFor(M)), D = _.reduce((f, N) => f + N.scenarios.length, 0) + $.length, W = ze(g), R = p === "flows" ? [..._.flatMap((f) => f.scenarios), ...$].map((f) => f.id) : g.map((f) => f.id), j = (f, N) => {
|
|
873
|
+
if (R.length === 0) return;
|
|
874
|
+
const y = Ge(R, f, N);
|
|
875
|
+
y && C.current.get(y)?.focus();
|
|
876
|
+
}, U = (f) => {
|
|
877
|
+
f.key === "ArrowDown" ? (f.preventDefault(), j(void 0, 1)) : f.key === "Escape" && b("");
|
|
878
|
+
}, O = (f, N) => {
|
|
879
|
+
N.key !== "ArrowDown" && N.key !== "ArrowUp" || (N.preventDefault(), j(f, N.key === "ArrowDown" ? 1 : -1));
|
|
880
|
+
}, H = (f, N) => {
|
|
881
|
+
N ? C.current.set(f, N) : C.current.delete(f);
|
|
882
|
+
}, K = (f) => S((N) => {
|
|
883
|
+
const y = new Set(N);
|
|
884
|
+
return y.has(f) ? y.delete(f) : y.add(f), y;
|
|
837
885
|
});
|
|
838
|
-
return /* @__PURE__ */ d("nav", { className: "ds-chrome ds-sidebar", "aria-label":
|
|
886
|
+
return /* @__PURE__ */ d("nav", { className: "ds-chrome ds-sidebar", "aria-label": c.sidebar.region, children: [
|
|
839
887
|
/* @__PURE__ */ d("div", { className: "ds-sidebar__tabs", role: "tablist", children: [
|
|
840
888
|
/* @__PURE__ */ o(
|
|
841
889
|
"button",
|
|
842
890
|
{
|
|
843
891
|
type: "button",
|
|
844
892
|
role: "tab",
|
|
845
|
-
"aria-selected":
|
|
893
|
+
"aria-selected": p === "flows",
|
|
846
894
|
onClick: () => {
|
|
847
|
-
|
|
895
|
+
h("flows"), b("");
|
|
848
896
|
},
|
|
849
|
-
children:
|
|
897
|
+
children: c.sidebar.flowsTab
|
|
850
898
|
}
|
|
851
899
|
),
|
|
852
900
|
/* @__PURE__ */ o(
|
|
@@ -854,11 +902,11 @@ function We({
|
|
|
854
902
|
{
|
|
855
903
|
type: "button",
|
|
856
904
|
role: "tab",
|
|
857
|
-
"aria-selected":
|
|
905
|
+
"aria-selected": p === "components",
|
|
858
906
|
onClick: () => {
|
|
859
|
-
|
|
907
|
+
h("components"), b("");
|
|
860
908
|
},
|
|
861
|
-
children:
|
|
909
|
+
children: c.sidebar.componentsTab
|
|
862
910
|
}
|
|
863
911
|
)
|
|
864
912
|
] }),
|
|
@@ -866,69 +914,82 @@ function We({
|
|
|
866
914
|
/* @__PURE__ */ o(
|
|
867
915
|
"input",
|
|
868
916
|
{
|
|
869
|
-
ref:
|
|
917
|
+
ref: w,
|
|
870
918
|
className: "ds-input ds-input--search",
|
|
871
919
|
type: "search",
|
|
872
|
-
value:
|
|
873
|
-
placeholder:
|
|
874
|
-
"aria-label":
|
|
875
|
-
onChange: (f) =>
|
|
876
|
-
onKeyDown:
|
|
920
|
+
value: m,
|
|
921
|
+
placeholder: p === "flows" ? c.sidebar.searchPlaceholder : c.sidebar.componentSearchPlaceholder,
|
|
922
|
+
"aria-label": p === "flows" ? c.sidebar.searchLabel : c.sidebar.componentSearchLabel,
|
|
923
|
+
onChange: (f) => b(f.target.value),
|
|
924
|
+
onKeyDown: U
|
|
925
|
+
}
|
|
926
|
+
),
|
|
927
|
+
/* @__PURE__ */ o("kbd", { children: c.sidebar.searchShortcut })
|
|
928
|
+
] }),
|
|
929
|
+
p === "flows" && /* @__PURE__ */ d("label", { className: "ds-sidebar__option", children: [
|
|
930
|
+
/* @__PURE__ */ o(
|
|
931
|
+
"input",
|
|
932
|
+
{
|
|
933
|
+
type: "checkbox",
|
|
934
|
+
checked: r.showPorted ?? !1,
|
|
935
|
+
onChange: (f) => s(f.target.checked)
|
|
877
936
|
}
|
|
878
937
|
),
|
|
879
|
-
/* @__PURE__ */ o("
|
|
938
|
+
/* @__PURE__ */ o("span", { children: c.sidebar.showPorted })
|
|
880
939
|
] }),
|
|
881
940
|
/* @__PURE__ */ d("div", { className: "ds-sidebar__tree", role: "tabpanel", children: [
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
941
|
+
m.trim() !== "" && /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", role: "status", children: p === "flows" ? D === 0 ? c.sidebar.noMatch(m) : c.sidebar.matchCount(D) : g.length === 0 ? c.sidebar.noComponentMatch(m) : c.sidebar.componentMatchCount(g.length) }),
|
|
942
|
+
p === "flows" ? /* @__PURE__ */ o(
|
|
943
|
+
Ke,
|
|
885
944
|
{
|
|
886
|
-
nodes:
|
|
945
|
+
nodes: _,
|
|
887
946
|
orphans: $,
|
|
888
|
-
matches:
|
|
889
|
-
collapsed:
|
|
947
|
+
matches: l,
|
|
948
|
+
collapsed: u,
|
|
890
949
|
activeScenario: t?.id,
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
950
|
+
showPorted: r.showPorted ?? !1,
|
|
951
|
+
activePortedLabel: c.sidebar.activePorted,
|
|
952
|
+
emptyModuleLabel: c.sidebar.emptyModule,
|
|
953
|
+
withoutModuleLabel: c.sidebar.withoutModule,
|
|
954
|
+
onToggle: K,
|
|
894
955
|
onOpen: i,
|
|
895
|
-
onKeyDown:
|
|
896
|
-
setItemRef:
|
|
956
|
+
onKeyDown: O,
|
|
957
|
+
setItemRef: H
|
|
897
958
|
}
|
|
898
|
-
) :
|
|
959
|
+
) : W.length === 0 && !m ? /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", children: c.sidebar.emptyComponents }) : W.map(([f, N]) => /* @__PURE__ */ d("section", { className: "ds-component-group", children: [
|
|
899
960
|
/* @__PURE__ */ o("h2", { children: f }),
|
|
900
|
-
/* @__PURE__ */ o("ul", { children:
|
|
961
|
+
/* @__PURE__ */ o("ul", { children: N.map((y) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d(
|
|
901
962
|
"button",
|
|
902
963
|
{
|
|
903
|
-
ref: (
|
|
964
|
+
ref: (x) => H(y.id, x),
|
|
904
965
|
type: "button",
|
|
905
966
|
className: "ds-component-item",
|
|
906
|
-
"aria-current":
|
|
907
|
-
onClick: () => a(
|
|
908
|
-
onKeyDown: (
|
|
967
|
+
"aria-current": y.id === n,
|
|
968
|
+
onClick: () => a(y.id),
|
|
969
|
+
onKeyDown: (x) => O(y.id, x),
|
|
909
970
|
children: [
|
|
910
|
-
/* @__PURE__ */ o("span", { children:
|
|
911
|
-
|
|
971
|
+
/* @__PURE__ */ o("span", { children: y.name }),
|
|
972
|
+
y.description && /* @__PURE__ */ o("small", { children: y.description })
|
|
912
973
|
]
|
|
913
974
|
}
|
|
914
|
-
) },
|
|
975
|
+
) }, y.id)) })
|
|
915
976
|
] }, f))
|
|
916
977
|
] }),
|
|
917
|
-
|
|
918
|
-
/* @__PURE__ */ o("h2", { children:
|
|
978
|
+
p === "flows" && t && /* @__PURE__ */ d("aside", { className: "ds-sidebar__scope", "aria-label": c.sidebar.scope, children: [
|
|
979
|
+
/* @__PURE__ */ o("h2", { children: c.sidebar.scope }),
|
|
919
980
|
/* @__PURE__ */ d("dl", { children: [
|
|
920
|
-
/* @__PURE__ */ o("dt", { children:
|
|
921
|
-
/* @__PURE__ */ o("dd", { children: e.fixture(
|
|
922
|
-
/* @__PURE__ */ o("dt", { children:
|
|
923
|
-
/* @__PURE__ */ o("dd", { children: e.persona(
|
|
924
|
-
/* @__PURE__ */ o("dt", { children:
|
|
925
|
-
/* @__PURE__ */ o("dd", { children:
|
|
981
|
+
/* @__PURE__ */ o("dt", { children: c.sidebar.scopeData }),
|
|
982
|
+
/* @__PURE__ */ o("dd", { children: e.fixture(r.fixture ?? t.fixture)?.label ?? c.controls.none }),
|
|
983
|
+
/* @__PURE__ */ o("dt", { children: c.sidebar.scopePersona }),
|
|
984
|
+
/* @__PURE__ */ o("dd", { children: e.persona(r.persona ?? t.persona)?.name ?? c.controls.none }),
|
|
985
|
+
/* @__PURE__ */ o("dt", { children: c.sidebar.scopeNetwork }),
|
|
986
|
+
/* @__PURE__ */ o("dd", { children: c.network[r.network] })
|
|
926
987
|
] })
|
|
927
988
|
] })
|
|
928
989
|
] });
|
|
929
990
|
}
|
|
930
|
-
function
|
|
931
|
-
return /* @__PURE__ */ d(
|
|
991
|
+
function Ke(e) {
|
|
992
|
+
return /* @__PURE__ */ d(P, { children: [
|
|
932
993
|
e.nodes.map((t) => {
|
|
933
994
|
const n = !e.collapsed.has(t.module.id) || !!e.matches;
|
|
934
995
|
return /* @__PURE__ */ d("section", { className: "ds-module", children: [
|
|
@@ -947,7 +1008,7 @@ function je(e) {
|
|
|
947
1008
|
}
|
|
948
1009
|
),
|
|
949
1010
|
n && /* @__PURE__ */ d("ul", { className: "ds-module__scenarios", children: [
|
|
950
|
-
t.scenarios.map((
|
|
1011
|
+
t.scenarios.map((r) => /* @__PURE__ */ o(ee, { scenario: r, ...e }, r.id)),
|
|
951
1012
|
t.scenarios.length === 0 && /* @__PURE__ */ o("li", { className: "ds-sidebar__empty", children: e.emptyModuleLabel })
|
|
952
1013
|
] })
|
|
953
1014
|
] }, t.module.id);
|
|
@@ -958,81 +1019,94 @@ function je(e) {
|
|
|
958
1019
|
/* @__PURE__ */ o("span", { children: e.withoutModuleLabel }),
|
|
959
1020
|
/* @__PURE__ */ o("span", { className: "ds-module__count", children: e.orphans.length })
|
|
960
1021
|
] }),
|
|
961
|
-
/* @__PURE__ */ o("ul", { className: "ds-module__scenarios", children: e.orphans.map((t) => /* @__PURE__ */ o(
|
|
1022
|
+
/* @__PURE__ */ o("ul", { className: "ds-module__scenarios", children: e.orphans.map((t) => /* @__PURE__ */ o(ee, { scenario: t, ...e }, t.id)) })
|
|
962
1023
|
] })
|
|
963
1024
|
] });
|
|
964
1025
|
}
|
|
965
|
-
function
|
|
966
|
-
|
|
1026
|
+
function ee({
|
|
1027
|
+
scenario: e,
|
|
1028
|
+
activeScenario: t,
|
|
1029
|
+
showPorted: n,
|
|
1030
|
+
activePortedLabel: r,
|
|
1031
|
+
onOpen: i,
|
|
1032
|
+
onKeyDown: a,
|
|
1033
|
+
setItemRef: s
|
|
1034
|
+
}) {
|
|
1035
|
+
const c = A().status[e.status], p = e.status === "ported" && e.id === t && !n;
|
|
967
1036
|
return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ d(
|
|
968
1037
|
"button",
|
|
969
1038
|
{
|
|
970
|
-
ref: (
|
|
1039
|
+
ref: (h) => s(e.id, h),
|
|
971
1040
|
type: "button",
|
|
972
1041
|
className: "ds-scenario",
|
|
973
1042
|
"aria-current": e.id === t,
|
|
974
|
-
onClick: () =>
|
|
975
|
-
onKeyDown: (
|
|
1043
|
+
onClick: () => i(e.id),
|
|
1044
|
+
onKeyDown: (h) => a(e.id, h),
|
|
976
1045
|
children: [
|
|
977
|
-
/* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": e.status, title:
|
|
1046
|
+
/* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": e.status, title: c }),
|
|
978
1047
|
/* @__PURE__ */ o("span", { className: "ds-scenario__title", children: e.title }),
|
|
979
|
-
/* @__PURE__ */ o("span", { className: "ds-visually-hidden", children:
|
|
1048
|
+
/* @__PURE__ */ o("span", { className: "ds-visually-hidden", children: c }),
|
|
1049
|
+
p && /* @__PURE__ */ o("span", { className: "ds-scenario__flag", title: r, children: c })
|
|
980
1050
|
]
|
|
981
1051
|
}
|
|
982
1052
|
) });
|
|
983
1053
|
}
|
|
984
|
-
function
|
|
1054
|
+
function ze(e) {
|
|
985
1055
|
const t = /* @__PURE__ */ new Map();
|
|
986
1056
|
for (const n of e) {
|
|
987
|
-
const
|
|
988
|
-
t.set(
|
|
1057
|
+
const r = n.group ?? "Componentes";
|
|
1058
|
+
t.set(r, [...t.get(r) ?? [], n]);
|
|
989
1059
|
}
|
|
990
1060
|
return [...t.entries()];
|
|
991
1061
|
}
|
|
992
|
-
function
|
|
1062
|
+
function te(e) {
|
|
993
1063
|
return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
|
|
994
1064
|
}
|
|
995
|
-
function
|
|
1065
|
+
function Ue(e) {
|
|
996
1066
|
const t = e.key.toLowerCase();
|
|
997
1067
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (t === "k" || t === "f");
|
|
998
1068
|
}
|
|
999
|
-
function
|
|
1069
|
+
function Ge(e, t, n) {
|
|
1000
1070
|
if (e.length === 0) return;
|
|
1001
|
-
const
|
|
1071
|
+
const r = t ? e.indexOf(t) : -1, i = Math.max(0, Math.min(e.length - 1, r + n));
|
|
1002
1072
|
return e[i];
|
|
1003
1073
|
}
|
|
1004
|
-
function
|
|
1074
|
+
function Ve({
|
|
1005
1075
|
product: e,
|
|
1006
1076
|
scenario: t,
|
|
1007
1077
|
deploy: n,
|
|
1008
|
-
inspectorOpen:
|
|
1078
|
+
inspectorOpen: r,
|
|
1009
1079
|
chromeTheme: i,
|
|
1010
|
-
|
|
1011
|
-
|
|
1080
|
+
showPorted: a,
|
|
1081
|
+
onToggleInspector: s,
|
|
1082
|
+
onToggleChromeTheme: c
|
|
1012
1083
|
}) {
|
|
1013
|
-
const
|
|
1014
|
-
const
|
|
1084
|
+
const p = A().topbar, [h, m] = F(!1), b = async () => {
|
|
1085
|
+
const w = t ? ue(t, {
|
|
1015
1086
|
origin: n.origin,
|
|
1016
|
-
overrides:
|
|
1087
|
+
overrides: {
|
|
1088
|
+
...i === "light" ? { chromeTheme: i } : {},
|
|
1089
|
+
...a ? { showPorted: !0 } : {}
|
|
1090
|
+
}
|
|
1017
1091
|
}) : `${n.origin}${window.location.pathname}${window.location.search}`;
|
|
1018
1092
|
try {
|
|
1019
|
-
await navigator.clipboard.writeText(
|
|
1093
|
+
await navigator.clipboard.writeText(w);
|
|
1020
1094
|
} catch {
|
|
1021
|
-
window.prompt(
|
|
1095
|
+
window.prompt(p.copyPrompt, w);
|
|
1022
1096
|
}
|
|
1023
|
-
|
|
1024
|
-
},
|
|
1097
|
+
m(!0), window.setTimeout(() => m(!1), 1600);
|
|
1098
|
+
}, u = qe(
|
|
1025
1099
|
typeof window > "u" ? `${n.origin}/` : window.location.href
|
|
1026
|
-
),
|
|
1100
|
+
), S = Ye(n.origin, i, a);
|
|
1027
1101
|
return /* @__PURE__ */ d("header", { className: "ds-chrome ds-topbar", children: [
|
|
1028
1102
|
/* @__PURE__ */ d("div", { className: "ds-topbar__product", children: [
|
|
1029
1103
|
/* @__PURE__ */ o(
|
|
1030
1104
|
"a",
|
|
1031
1105
|
{
|
|
1032
1106
|
className: "ds-topbar__home",
|
|
1033
|
-
href:
|
|
1034
|
-
"aria-label":
|
|
1035
|
-
title:
|
|
1107
|
+
href: S,
|
|
1108
|
+
"aria-label": p.homeTitle(e.name),
|
|
1109
|
+
title: p.homeTitle(e.name),
|
|
1036
1110
|
children: e.name
|
|
1037
1111
|
}
|
|
1038
1112
|
),
|
|
@@ -1040,9 +1114,9 @@ function Ue({
|
|
|
1040
1114
|
] }),
|
|
1041
1115
|
/* @__PURE__ */ o("div", { className: "ds-topbar__spacer" }),
|
|
1042
1116
|
/* @__PURE__ */ d("div", { className: "ds-topbar__meta", children: [
|
|
1043
|
-
n.branch && /* @__PURE__ */ o("code", { title:
|
|
1044
|
-
n.commit && /* @__PURE__ */ o("code", { title:
|
|
1045
|
-
/* @__PURE__ */ o("code", { title:
|
|
1117
|
+
n.branch && /* @__PURE__ */ o("code", { title: p.branchTitle(n.branch), children: n.branch.length > 28 ? `${n.branch.slice(0, 27)}…` : n.branch }),
|
|
1118
|
+
n.commit && /* @__PURE__ */ o("code", { title: p.commitTitle(n.commit), children: n.shortCommit }),
|
|
1119
|
+
/* @__PURE__ */ o("code", { title: p.envTitle(n.env), children: n.env })
|
|
1046
1120
|
] }),
|
|
1047
1121
|
/* @__PURE__ */ o(
|
|
1048
1122
|
"button",
|
|
@@ -1050,22 +1124,22 @@ function Ue({
|
|
|
1050
1124
|
type: "button",
|
|
1051
1125
|
className: "ds-btn ds-btn--icon",
|
|
1052
1126
|
"aria-pressed": i === "light",
|
|
1053
|
-
"aria-label": i === "dark" ?
|
|
1054
|
-
title: i === "dark" ?
|
|
1055
|
-
onClick:
|
|
1056
|
-
children: /* @__PURE__ */ o(
|
|
1127
|
+
"aria-label": i === "dark" ? p.lightMode : p.darkMode,
|
|
1128
|
+
title: i === "dark" ? p.lightMode : p.darkMode,
|
|
1129
|
+
onClick: c,
|
|
1130
|
+
children: /* @__PURE__ */ o(Je, { theme: i })
|
|
1057
1131
|
}
|
|
1058
1132
|
),
|
|
1059
|
-
/* @__PURE__ */ o("button", { type: "button", className: "ds-btn", onClick:
|
|
1133
|
+
/* @__PURE__ */ o("button", { type: "button", className: "ds-btn", onClick: b, children: h ? p.copied : p.copyLink }),
|
|
1060
1134
|
/* @__PURE__ */ o(
|
|
1061
1135
|
"a",
|
|
1062
1136
|
{
|
|
1063
1137
|
className: "ds-btn",
|
|
1064
|
-
href:
|
|
1138
|
+
href: u,
|
|
1065
1139
|
target: "_blank",
|
|
1066
1140
|
rel: "noreferrer",
|
|
1067
|
-
title:
|
|
1068
|
-
children:
|
|
1141
|
+
title: p.cleanReviewTitle,
|
|
1142
|
+
children: p.cleanReview
|
|
1069
1143
|
}
|
|
1070
1144
|
),
|
|
1071
1145
|
/* @__PURE__ */ o(
|
|
@@ -1073,22 +1147,22 @@ function Ue({
|
|
|
1073
1147
|
{
|
|
1074
1148
|
type: "button",
|
|
1075
1149
|
className: "ds-btn",
|
|
1076
|
-
"aria-pressed":
|
|
1077
|
-
onClick:
|
|
1078
|
-
children:
|
|
1150
|
+
"aria-pressed": r,
|
|
1151
|
+
onClick: s,
|
|
1152
|
+
children: p.panel
|
|
1079
1153
|
}
|
|
1080
1154
|
)
|
|
1081
1155
|
] });
|
|
1082
1156
|
}
|
|
1083
|
-
function
|
|
1157
|
+
function qe(e) {
|
|
1084
1158
|
const t = new URL(e);
|
|
1085
|
-
return t.searchParams.set(
|
|
1159
|
+
return t.searchParams.set(v.chrome, "0"), t.toString();
|
|
1086
1160
|
}
|
|
1087
|
-
function
|
|
1088
|
-
const
|
|
1089
|
-
return t === "light" &&
|
|
1161
|
+
function Ye(e, t, n = !1) {
|
|
1162
|
+
const r = new URL("/", e);
|
|
1163
|
+
return t === "light" && r.searchParams.set(v.chromeTheme, t), n && r.searchParams.set(v.showPorted, "1"), r.toString();
|
|
1090
1164
|
}
|
|
1091
|
-
function
|
|
1165
|
+
function Je({ theme: e }) {
|
|
1092
1166
|
const t = {
|
|
1093
1167
|
width: 15,
|
|
1094
1168
|
height: 15,
|
|
@@ -1105,50 +1179,70 @@ function qe({ theme: e }) {
|
|
|
1105
1179
|
/* @__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
1180
|
] }) : /* @__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
1181
|
}
|
|
1108
|
-
function
|
|
1109
|
-
|
|
1110
|
-
|
|
1182
|
+
function Qe({
|
|
1183
|
+
registry: e,
|
|
1184
|
+
controls: t,
|
|
1185
|
+
scenarioActive: n,
|
|
1186
|
+
component: r,
|
|
1187
|
+
componentFixture: i,
|
|
1188
|
+
onChange: a
|
|
1189
|
+
}) {
|
|
1190
|
+
const s = A(), c = s.controls, { product: p } = e, h = p.dataSources?.adapters ?? [], m = p.theme?.modes ?? [], b = p.theme?.locales ?? [];
|
|
1191
|
+
return /* @__PURE__ */ d("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": c.region, children: [
|
|
1192
|
+
r?.fixtures?.length ? /* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1193
|
+
/* @__PURE__ */ o("label", { htmlFor: "ds-component-fixture", children: c.componentFixture }),
|
|
1194
|
+
/* @__PURE__ */ o(
|
|
1195
|
+
"select",
|
|
1196
|
+
{
|
|
1197
|
+
id: "ds-component-fixture",
|
|
1198
|
+
className: "ds-select",
|
|
1199
|
+
value: i?.fixture?.id ?? "",
|
|
1200
|
+
onChange: (u) => a({ fixture: u.target.value || void 0 }),
|
|
1201
|
+
children: r.fixtures.map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.label }, u.id))
|
|
1202
|
+
}
|
|
1203
|
+
)
|
|
1204
|
+
] }) : null,
|
|
1111
1205
|
n && /* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1112
|
-
/* @__PURE__ */ o("label", { htmlFor: "ds-persona", children:
|
|
1206
|
+
/* @__PURE__ */ o("label", { htmlFor: "ds-persona", children: c.persona }),
|
|
1113
1207
|
/* @__PURE__ */ d(
|
|
1114
1208
|
"select",
|
|
1115
1209
|
{
|
|
1116
1210
|
id: "ds-persona",
|
|
1117
1211
|
className: "ds-select",
|
|
1118
1212
|
value: t.persona ?? "",
|
|
1119
|
-
onChange: (u) =>
|
|
1213
|
+
onChange: (u) => a({ persona: u.target.value || void 0 }),
|
|
1120
1214
|
children: [
|
|
1121
|
-
/* @__PURE__ */ o("option", { value: "", children:
|
|
1122
|
-
|
|
1215
|
+
/* @__PURE__ */ o("option", { value: "", children: c.none }),
|
|
1216
|
+
p.personas.map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.name }, u.id))
|
|
1123
1217
|
]
|
|
1124
1218
|
}
|
|
1125
1219
|
)
|
|
1126
1220
|
] }),
|
|
1127
1221
|
n && /* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1128
|
-
/* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-network-label", children:
|
|
1129
|
-
/* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children:
|
|
1222
|
+
/* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-network-label", children: c.network }),
|
|
1223
|
+
/* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: oe.map((u) => /* @__PURE__ */ o(
|
|
1130
1224
|
"button",
|
|
1131
1225
|
{
|
|
1132
1226
|
type: "button",
|
|
1133
1227
|
"aria-pressed": t.network === u,
|
|
1134
|
-
onClick: () =>
|
|
1135
|
-
children:
|
|
1228
|
+
onClick: () => a({ network: u }),
|
|
1229
|
+
children: s.network[u]
|
|
1136
1230
|
},
|
|
1137
1231
|
u
|
|
1138
1232
|
)) })
|
|
1139
1233
|
] }),
|
|
1140
1234
|
/* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1141
|
-
/* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-viewport-label", children:
|
|
1142
|
-
/* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children:
|
|
1235
|
+
/* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-viewport-label", children: c.viewport }),
|
|
1236
|
+
/* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: ne.map((u) => /* @__PURE__ */ o(
|
|
1143
1237
|
"button",
|
|
1144
1238
|
{
|
|
1145
1239
|
type: "button",
|
|
1146
1240
|
className: "ds-icon-button",
|
|
1147
1241
|
"aria-pressed": t.viewport === u.id,
|
|
1148
|
-
"aria-label":
|
|
1149
|
-
title:
|
|
1150
|
-
onClick: () =>
|
|
1151
|
-
children: /* @__PURE__ */ o(
|
|
1242
|
+
"aria-label": s.viewport[u.id] ?? u.label,
|
|
1243
|
+
title: s.viewport[u.id] ?? u.label,
|
|
1244
|
+
onClick: () => a({ viewport: u.id }),
|
|
1245
|
+
children: /* @__PURE__ */ o(Xe, { id: u.id })
|
|
1152
1246
|
},
|
|
1153
1247
|
u.id
|
|
1154
1248
|
)) }),
|
|
@@ -1161,57 +1255,57 @@ function Ye({ registry: e, controls: t, scenarioActive: n, onChange: s }) {
|
|
|
1161
1255
|
max: 3840,
|
|
1162
1256
|
step: 10,
|
|
1163
1257
|
style: { width: 88 },
|
|
1164
|
-
"aria-label":
|
|
1258
|
+
"aria-label": c.customWidth,
|
|
1165
1259
|
value: t.customWidth ?? 1024,
|
|
1166
|
-
onChange: (u) =>
|
|
1260
|
+
onChange: (u) => a({ customWidth: Number(u.target.value) || void 0 })
|
|
1167
1261
|
}
|
|
1168
1262
|
)
|
|
1169
1263
|
] }),
|
|
1170
|
-
|
|
1171
|
-
/* @__PURE__ */ o("label", { htmlFor: "ds-theme", children:
|
|
1264
|
+
m.length > 1 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1265
|
+
/* @__PURE__ */ o("label", { htmlFor: "ds-theme", children: c.theme }),
|
|
1172
1266
|
/* @__PURE__ */ o(
|
|
1173
1267
|
"select",
|
|
1174
1268
|
{
|
|
1175
1269
|
id: "ds-theme",
|
|
1176
1270
|
className: "ds-select",
|
|
1177
|
-
value: t.themeMode ??
|
|
1178
|
-
onChange: (u) =>
|
|
1179
|
-
children:
|
|
1271
|
+
value: t.themeMode ?? m[0],
|
|
1272
|
+
onChange: (u) => a({ themeMode: u.target.value }),
|
|
1273
|
+
children: m.map((u) => /* @__PURE__ */ o("option", { value: u, children: u }, u))
|
|
1180
1274
|
}
|
|
1181
1275
|
)
|
|
1182
1276
|
] }),
|
|
1183
|
-
|
|
1184
|
-
/* @__PURE__ */ o("label", { htmlFor: "ds-locale", children:
|
|
1277
|
+
b.length > 1 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1278
|
+
/* @__PURE__ */ o("label", { htmlFor: "ds-locale", children: c.locale }),
|
|
1185
1279
|
/* @__PURE__ */ o(
|
|
1186
1280
|
"select",
|
|
1187
1281
|
{
|
|
1188
1282
|
id: "ds-locale",
|
|
1189
1283
|
className: "ds-select",
|
|
1190
|
-
value: t.locale ??
|
|
1191
|
-
onChange: (u) =>
|
|
1192
|
-
children:
|
|
1284
|
+
value: t.locale ?? b[0],
|
|
1285
|
+
onChange: (u) => a({ locale: u.target.value }),
|
|
1286
|
+
children: b.map((u) => /* @__PURE__ */ o("option", { value: u, children: u }, u))
|
|
1193
1287
|
}
|
|
1194
1288
|
)
|
|
1195
1289
|
] }),
|
|
1196
|
-
|
|
1197
|
-
/* @__PURE__ */ o("label", { htmlFor: "ds-source", children:
|
|
1290
|
+
n && h.length > 0 && /* @__PURE__ */ d("div", { className: "ds-field", children: [
|
|
1291
|
+
/* @__PURE__ */ o("label", { htmlFor: "ds-source", children: c.dataSource }),
|
|
1198
1292
|
/* @__PURE__ */ d(
|
|
1199
1293
|
"select",
|
|
1200
1294
|
{
|
|
1201
1295
|
id: "ds-source",
|
|
1202
1296
|
className: "ds-select",
|
|
1203
1297
|
value: t.dataSource ?? "fixtures",
|
|
1204
|
-
onChange: (u) =>
|
|
1298
|
+
onChange: (u) => a({ dataSource: u.target.value }),
|
|
1205
1299
|
children: [
|
|
1206
|
-
/* @__PURE__ */ o("option", { value: "fixtures", children:
|
|
1207
|
-
|
|
1300
|
+
/* @__PURE__ */ o("option", { value: "fixtures", children: c.fixturesOption }),
|
|
1301
|
+
h.filter((u) => u.id !== "fixtures").map((u) => /* @__PURE__ */ o("option", { value: u.id, children: u.label }, u.id))
|
|
1208
1302
|
]
|
|
1209
1303
|
}
|
|
1210
1304
|
)
|
|
1211
1305
|
] })
|
|
1212
1306
|
] });
|
|
1213
1307
|
}
|
|
1214
|
-
function
|
|
1308
|
+
function Xe({ id: e }) {
|
|
1215
1309
|
const t = {
|
|
1216
1310
|
width: 16,
|
|
1217
1311
|
height: 16,
|
|
@@ -1234,42 +1328,52 @@ function Je({ id: e }) {
|
|
|
1234
1328
|
/* @__PURE__ */ o("path", { d: "M8 21h8M12 17v4" })
|
|
1235
1329
|
] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) });
|
|
1236
1330
|
}
|
|
1237
|
-
function
|
|
1331
|
+
function Ze({
|
|
1238
1332
|
registry: e,
|
|
1239
1333
|
scenario: t,
|
|
1240
1334
|
component: n,
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1335
|
+
componentFixture: r,
|
|
1336
|
+
controls: i,
|
|
1337
|
+
focusedNode: a,
|
|
1338
|
+
tabStopCount: s
|
|
1244
1339
|
}) {
|
|
1245
|
-
const
|
|
1246
|
-
return /* @__PURE__ */ d("aside", { className: "ds-chrome ds-inspector", "aria-label":
|
|
1340
|
+
const c = A().inspector, [p, h] = F("scenario"), m = e.issues.filter((b) => b.level === "error").length;
|
|
1341
|
+
return /* @__PURE__ */ d("aside", { className: "ds-chrome ds-inspector", "aria-label": c.region, children: [
|
|
1247
1342
|
/* @__PURE__ */ d("div", { className: "ds-inspector__tabs", role: "tablist", children: [
|
|
1248
|
-
/* @__PURE__ */ o(
|
|
1249
|
-
/* @__PURE__ */ o(
|
|
1250
|
-
/* @__PURE__ */ o(
|
|
1343
|
+
/* @__PURE__ */ o(V, { id: "scenario", current: p, onSelect: h, children: n ? c.componentReference : c.tabScenario }),
|
|
1344
|
+
/* @__PURE__ */ o(V, { id: "a11y", current: p, onSelect: h, children: c.tabA11y }),
|
|
1345
|
+
/* @__PURE__ */ o(V, { id: "diagnostics", current: p, onSelect: h, children: m > 0 ? c.diagnosticsWithErrors(m) : c.tabDiagnostics })
|
|
1251
1346
|
] }),
|
|
1252
1347
|
/* @__PURE__ */ d("div", { className: "ds-inspector__body", role: "tabpanel", children: [
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
Ze,
|
|
1348
|
+
p === "scenario" && /* @__PURE__ */ o(
|
|
1349
|
+
et,
|
|
1256
1350
|
{
|
|
1257
1351
|
registry: e,
|
|
1258
1352
|
scenario: t,
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1353
|
+
component: n,
|
|
1354
|
+
componentFixture: r,
|
|
1355
|
+
controls: i
|
|
1262
1356
|
}
|
|
1263
1357
|
),
|
|
1264
|
-
|
|
1358
|
+
p === "a11y" && /* @__PURE__ */ o(
|
|
1359
|
+
tt,
|
|
1360
|
+
{
|
|
1361
|
+
registry: e,
|
|
1362
|
+
scenario: t,
|
|
1363
|
+
focusedNode: a,
|
|
1364
|
+
keyboardMode: i.keyboardMode,
|
|
1365
|
+
tabStopCount: s
|
|
1366
|
+
}
|
|
1367
|
+
),
|
|
1368
|
+
p === "diagnostics" && /* @__PURE__ */ o(ot, { registry: e })
|
|
1265
1369
|
] })
|
|
1266
1370
|
] });
|
|
1267
1371
|
}
|
|
1268
|
-
function
|
|
1372
|
+
function V({
|
|
1269
1373
|
id: e,
|
|
1270
1374
|
current: t,
|
|
1271
1375
|
onSelect: n,
|
|
1272
|
-
children:
|
|
1376
|
+
children: r
|
|
1273
1377
|
}) {
|
|
1274
1378
|
return /* @__PURE__ */ o(
|
|
1275
1379
|
"button",
|
|
@@ -1278,152 +1382,169 @@ function U({
|
|
|
1278
1382
|
role: "tab",
|
|
1279
1383
|
"aria-selected": t === e,
|
|
1280
1384
|
onClick: () => n(e),
|
|
1281
|
-
children:
|
|
1385
|
+
children: r
|
|
1282
1386
|
}
|
|
1283
1387
|
);
|
|
1284
1388
|
}
|
|
1285
|
-
function
|
|
1389
|
+
function et({
|
|
1286
1390
|
registry: e,
|
|
1287
1391
|
scenario: t,
|
|
1288
1392
|
component: n,
|
|
1289
|
-
|
|
1393
|
+
componentFixture: r,
|
|
1394
|
+
controls: i
|
|
1290
1395
|
}) {
|
|
1291
|
-
const
|
|
1396
|
+
const a = A(), s = a.inspector;
|
|
1292
1397
|
if (!t)
|
|
1293
1398
|
return n ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1294
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1399
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.componentReference }),
|
|
1295
1400
|
/* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 15, fontWeight: 600 }, children: n.name }),
|
|
1296
1401
|
n.description && /* @__PURE__ */ o("p", { children: n.description }),
|
|
1297
1402
|
/* @__PURE__ */ d("dl", { className: "ds-kv", style: { marginTop: 14 }, children: [
|
|
1298
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1403
|
+
/* @__PURE__ */ o("dt", { children: s.id }),
|
|
1299
1404
|
/* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.id }),
|
|
1300
|
-
n.group && /* @__PURE__ */ d(
|
|
1301
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1405
|
+
n.group && /* @__PURE__ */ d(P, { children: [
|
|
1406
|
+
/* @__PURE__ */ o("dt", { children: s.componentGroup }),
|
|
1302
1407
|
/* @__PURE__ */ o("dd", { children: n.group })
|
|
1408
|
+
] }),
|
|
1409
|
+
r?.fixture && /* @__PURE__ */ d(P, { children: [
|
|
1410
|
+
/* @__PURE__ */ o("dt", { children: s.componentFixture }),
|
|
1411
|
+
/* @__PURE__ */ d("dd", { children: [
|
|
1412
|
+
r.fixture.label,
|
|
1413
|
+
" ",
|
|
1414
|
+
/* @__PURE__ */ o("code", { children: r.fixture.id })
|
|
1415
|
+
] }),
|
|
1416
|
+
r.fixture.description && /* @__PURE__ */ d(P, { children: [
|
|
1417
|
+
/* @__PURE__ */ o("dt", { children: s.componentFixtureDescription }),
|
|
1418
|
+
/* @__PURE__ */ o("dd", { children: r.fixture.description })
|
|
1419
|
+
] })
|
|
1303
1420
|
] })
|
|
1304
|
-
] })
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1421
|
+
] }),
|
|
1422
|
+
r?.didFallback && r.fixture && /* @__PURE__ */ o("p", { className: "ds-note", "data-tone": "warn", children: s.componentFixtureFallback(
|
|
1423
|
+
r.requestedId ?? "",
|
|
1424
|
+
r.fixture.id
|
|
1425
|
+
) })
|
|
1426
|
+
] }) : /* @__PURE__ */ o("p", { className: "ds-block", children: s.noScenario });
|
|
1427
|
+
const c = e.persona(i.persona ?? t.persona), p = i.persona ? e.persona(i.persona)?.permissions ?? [] : e.permissionsOf(t), h = e.rulesOf(t), m = e.fixture(i.fixture ?? t.fixture), b = !!(i.persona && i.persona !== t.persona);
|
|
1428
|
+
return /* @__PURE__ */ d(P, { children: [
|
|
1308
1429
|
/* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1309
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1430
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.situation }),
|
|
1310
1431
|
/* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: t.title }),
|
|
1311
1432
|
t.intent && /* @__PURE__ */ o("p", { children: t.intent }),
|
|
1312
1433
|
/* @__PURE__ */ d("div", { className: "ds-chips", children: [
|
|
1313
|
-
/* @__PURE__ */ o("span", { className: "ds-chip", "data-tone":
|
|
1314
|
-
(t.tags ?? []).map((
|
|
1434
|
+
/* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": at(t.status), children: a.status[t.status] }),
|
|
1435
|
+
(t.tags ?? []).map((u) => /* @__PURE__ */ o("span", { className: "ds-chip", children: u }, u))
|
|
1315
1436
|
] }),
|
|
1316
|
-
/* @__PURE__ */ o("p", { style: { marginTop: 6 }, children:
|
|
1437
|
+
/* @__PURE__ */ o("p", { style: { marginTop: 6 }, children: a.statusMeaning[t.status] })
|
|
1317
1438
|
] }),
|
|
1318
1439
|
/* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1319
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1440
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.reproduction }),
|
|
1320
1441
|
/* @__PURE__ */ d("dl", { className: "ds-kv", children: [
|
|
1321
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1442
|
+
/* @__PURE__ */ o("dt", { children: s.id }),
|
|
1322
1443
|
/* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.id }),
|
|
1323
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1444
|
+
/* @__PURE__ */ o("dt", { children: s.route }),
|
|
1324
1445
|
/* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.route }),
|
|
1325
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1446
|
+
/* @__PURE__ */ o("dt", { children: s.persona }),
|
|
1326
1447
|
/* @__PURE__ */ d("dd", { children: [
|
|
1327
|
-
|
|
1328
|
-
|
|
1448
|
+
c?.name ?? "—",
|
|
1449
|
+
b && /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: s.personaSwapped })
|
|
1329
1450
|
] }),
|
|
1330
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1331
|
-
/* @__PURE__ */ o("dd", { children:
|
|
1332
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1333
|
-
/* @__PURE__ */ o("dd", { children:
|
|
1451
|
+
/* @__PURE__ */ o("dt", { children: s.data }),
|
|
1452
|
+
/* @__PURE__ */ o("dd", { children: m?.label ?? "—" }),
|
|
1453
|
+
/* @__PURE__ */ o("dt", { children: s.network }),
|
|
1454
|
+
/* @__PURE__ */ o("dd", { children: a.network[i.network] })
|
|
1334
1455
|
] }),
|
|
1335
|
-
|
|
1456
|
+
c?.goal && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: s.goal(c.goal) })
|
|
1336
1457
|
] }),
|
|
1337
|
-
|
|
1338
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1339
|
-
/* @__PURE__ */ o("div", { className: "ds-chips", children:
|
|
1458
|
+
p.length > 0 && /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1459
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.permissions }),
|
|
1460
|
+
/* @__PURE__ */ o("div", { className: "ds-chips", children: p.map((u) => /* @__PURE__ */ o("span", { className: "ds-chip", children: u }, u)) })
|
|
1340
1461
|
] }),
|
|
1341
1462
|
t.preconditions?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1342
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1343
|
-
/* @__PURE__ */ o("ul", { className: "ds-list", children: t.preconditions.map((
|
|
1463
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.preconditions }),
|
|
1464
|
+
/* @__PURE__ */ o("ul", { className: "ds-list", children: t.preconditions.map((u) => /* @__PURE__ */ o("li", { children: u }, u)) })
|
|
1344
1465
|
] }) : null,
|
|
1345
|
-
|
|
1346
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1347
|
-
|
|
1348
|
-
/* @__PURE__ */ o("span", { className: "ds-rule__id", children:
|
|
1349
|
-
/* @__PURE__ */ o("span", { className: "ds-rule__statement", children:
|
|
1350
|
-
|
|
1351
|
-
] },
|
|
1466
|
+
h.length > 0 && /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1467
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.rules }),
|
|
1468
|
+
h.map((u) => /* @__PURE__ */ d("div", { className: "ds-rule", children: [
|
|
1469
|
+
/* @__PURE__ */ o("span", { className: "ds-rule__id", children: u.id }),
|
|
1470
|
+
/* @__PURE__ */ o("span", { className: "ds-rule__statement", children: u.statement }),
|
|
1471
|
+
u.rationale && /* @__PURE__ */ o("p", { className: "ds-rule__rationale", children: u.rationale })
|
|
1472
|
+
] }, u.id))
|
|
1352
1473
|
] }),
|
|
1353
1474
|
t.actions?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1354
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1355
|
-
/* @__PURE__ */ o("ul", { className: "ds-list", children: t.actions.map((
|
|
1475
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.actions }),
|
|
1476
|
+
/* @__PURE__ */ o("ul", { className: "ds-list", children: t.actions.map((u) => /* @__PURE__ */ o("li", { children: u }, u)) })
|
|
1356
1477
|
] }) : null,
|
|
1357
1478
|
t.expected?.length ? /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1358
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1359
|
-
/* @__PURE__ */ o("ul", { className: "ds-list", children: t.expected.map((
|
|
1479
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.expected }),
|
|
1480
|
+
/* @__PURE__ */ o("ul", { className: "ds-list", children: t.expected.map((u) => /* @__PURE__ */ o("li", { children: u }, u)) })
|
|
1360
1481
|
] }) : null,
|
|
1361
1482
|
t.approvedAt && /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1362
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1483
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.approval }),
|
|
1363
1484
|
/* @__PURE__ */ d("p", { children: [
|
|
1364
1485
|
t.approvedAt.date,
|
|
1365
1486
|
" · ",
|
|
1366
1487
|
/* @__PURE__ */ o("code", { children: t.approvedAt.commit.slice(0, 7) })
|
|
1367
1488
|
] }),
|
|
1368
|
-
/* @__PURE__ */ o("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children:
|
|
1489
|
+
/* @__PURE__ */ o("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children: s.openApproved })
|
|
1369
1490
|
] }),
|
|
1370
1491
|
t.ticket && /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1371
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1492
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.engineering }),
|
|
1372
1493
|
/* @__PURE__ */ o("p", { children: t.ticket })
|
|
1373
1494
|
] })
|
|
1374
1495
|
] });
|
|
1375
1496
|
}
|
|
1376
|
-
function
|
|
1497
|
+
function tt({
|
|
1377
1498
|
registry: e,
|
|
1378
1499
|
scenario: t,
|
|
1379
1500
|
focusedNode: n,
|
|
1380
|
-
keyboardMode:
|
|
1501
|
+
keyboardMode: r,
|
|
1381
1502
|
tabStopCount: i
|
|
1382
1503
|
}) {
|
|
1383
|
-
const a =
|
|
1384
|
-
return /* @__PURE__ */ d(
|
|
1504
|
+
const a = A(), s = a.inspector, c = he(e.product.theme?.contrastPairs), p = c.filter((h) => h.passes !== !0);
|
|
1505
|
+
return /* @__PURE__ */ d(P, { children: [
|
|
1385
1506
|
t && /* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1386
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1507
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.a11yContract }),
|
|
1387
1508
|
/* @__PURE__ */ d("dl", { className: "ds-kv", children: [
|
|
1388
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1509
|
+
/* @__PURE__ */ o("dt", { children: s.keyboard }),
|
|
1389
1510
|
/* @__PURE__ */ o("dd", { children: a.keyboard[t.a11y.keyboard] }),
|
|
1390
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1391
|
-
/* @__PURE__ */ o("dd", { children:
|
|
1511
|
+
/* @__PURE__ */ o("dt", { children: s.contrast }),
|
|
1512
|
+
/* @__PURE__ */ o("dd", { children: s.contrastTarget(t.a11y.contrast) })
|
|
1392
1513
|
] }),
|
|
1393
|
-
t.a11y.announces?.length ? /* @__PURE__ */ d(
|
|
1394
|
-
/* @__PURE__ */ o("p", { style: { marginTop: 8 }, children:
|
|
1514
|
+
t.a11y.announces?.length ? /* @__PURE__ */ d(P, { children: [
|
|
1515
|
+
/* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: s.announces }),
|
|
1395
1516
|
/* @__PURE__ */ o("div", { className: "ds-chips", children: t.a11y.announces.map((h) => /* @__PURE__ */ o("span", { className: "ds-chip", children: h }, h)) })
|
|
1396
1517
|
] }) : null,
|
|
1397
1518
|
t.a11y.notes && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: t.a11y.notes })
|
|
1398
1519
|
] }),
|
|
1399
1520
|
/* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1400
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1401
|
-
|
|
1521
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.focusedElement }),
|
|
1522
|
+
r ? n ? /* @__PURE__ */ d(P, { children: [
|
|
1402
1523
|
/* @__PURE__ */ d("dl", { className: "ds-kv", children: [
|
|
1403
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1524
|
+
/* @__PURE__ */ o("dt", { children: s.role }),
|
|
1404
1525
|
/* @__PURE__ */ o("dd", { children: n.role }),
|
|
1405
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1406
|
-
/* @__PURE__ */ o("dd", { children: n.name ? n.name : /* @__PURE__ */ o("span", { style: { color: "var(--ds-err)" }, children:
|
|
1407
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1526
|
+
/* @__PURE__ */ o("dt", { children: s.name }),
|
|
1527
|
+
/* @__PURE__ */ o("dd", { children: n.name ? n.name : /* @__PURE__ */ o("span", { style: { color: "var(--ds-err)" }, children: s.noAccessibleName }) }),
|
|
1528
|
+
/* @__PURE__ */ o("dt", { children: s.nameFrom }),
|
|
1408
1529
|
/* @__PURE__ */ o("dd", { children: n.nameFrom }),
|
|
1409
|
-
n.description ? /* @__PURE__ */ d(
|
|
1410
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1530
|
+
n.description ? /* @__PURE__ */ d(P, { children: [
|
|
1531
|
+
/* @__PURE__ */ o("dt", { children: s.description }),
|
|
1411
1532
|
/* @__PURE__ */ o("dd", { children: n.description })
|
|
1412
1533
|
] }) : null,
|
|
1413
|
-
/* @__PURE__ */ o("dt", { children:
|
|
1534
|
+
/* @__PURE__ */ o("dt", { children: s.selector }),
|
|
1414
1535
|
/* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.selector })
|
|
1415
1536
|
] }),
|
|
1416
1537
|
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:
|
|
1418
|
-
/* @__PURE__ */ o("p", { style: { marginTop: 8 }, children:
|
|
1419
|
-
] }) : /* @__PURE__ */ o("p", { children:
|
|
1538
|
+
n.hiddenFromAssistiveTech && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: s.focusableButHidden }),
|
|
1539
|
+
/* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: s.tabStopsInStage(i) })
|
|
1540
|
+
] }) : /* @__PURE__ */ o("p", { children: s.pressTab(i) }) : /* @__PURE__ */ o("p", { children: s.keyboardModeOff })
|
|
1420
1541
|
] }),
|
|
1421
1542
|
/* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1422
|
-
/* @__PURE__ */ o("h2", { className: "ds-block__title", children:
|
|
1423
|
-
c.length === 0 ? /* @__PURE__ */ o("p", { children:
|
|
1543
|
+
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: s.tokenContrast }),
|
|
1544
|
+
c.length === 0 ? /* @__PURE__ */ o("p", { children: s.noContrastPairs }) : /* @__PURE__ */ d("table", { className: "ds-contrast", children: [
|
|
1424
1545
|
/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ d("tr", { children: [
|
|
1425
|
-
/* @__PURE__ */ o("th", { scope: "col", children:
|
|
1426
|
-
/* @__PURE__ */ o("th", { scope: "col", children:
|
|
1546
|
+
/* @__PURE__ */ o("th", { scope: "col", children: s.pair }),
|
|
1547
|
+
/* @__PURE__ */ o("th", { scope: "col", children: s.ratio })
|
|
1427
1548
|
] }) }),
|
|
1428
1549
|
/* @__PURE__ */ o("tbody", { children: c.map((h) => /* @__PURE__ */ d("tr", { children: [
|
|
1429
1550
|
/* @__PURE__ */ d("td", { children: [
|
|
@@ -1456,32 +1577,32 @@ function Ze({
|
|
|
1456
1577
|
)
|
|
1457
1578
|
] }, h.pair.name)) })
|
|
1458
1579
|
] }),
|
|
1459
|
-
p.length > 0 && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children:
|
|
1580
|
+
p.length > 0 && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: s.pairsFailing(p.length) })
|
|
1460
1581
|
] }),
|
|
1461
|
-
/* @__PURE__ */ o("p", { className: "ds-note", children:
|
|
1582
|
+
/* @__PURE__ */ o("p", { className: "ds-note", children: s.automatedIsFloor })
|
|
1462
1583
|
] });
|
|
1463
1584
|
}
|
|
1464
|
-
function
|
|
1465
|
-
const t =
|
|
1466
|
-
return /* @__PURE__ */ d(
|
|
1585
|
+
function ot({ registry: e }) {
|
|
1586
|
+
const t = A(), n = t.inspector, r = e.coverage({ includePorted: !0 }), { issues: i } = e;
|
|
1587
|
+
return /* @__PURE__ */ d(P, { children: [
|
|
1467
1588
|
/* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1468
1589
|
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.coverage }),
|
|
1469
|
-
/* @__PURE__ */ o("dl", { className: "ds-kv", children: Object.entries(
|
|
1590
|
+
/* @__PURE__ */ o("dl", { className: "ds-kv", children: Object.entries(r).filter(([, a]) => a > 0).map(([a, s]) => /* @__PURE__ */ d("div", { style: { display: "contents" }, children: [
|
|
1470
1591
|
/* @__PURE__ */ o("dt", { children: t.status[a] }),
|
|
1471
|
-
/* @__PURE__ */ o("dd", { style: { fontVariantNumeric: "tabular-nums" }, children:
|
|
1592
|
+
/* @__PURE__ */ o("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: s })
|
|
1472
1593
|
] }, a)) }),
|
|
1473
1594
|
/* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: n.scenariosRegistered(e.product.scenarios.length) })
|
|
1474
1595
|
] }),
|
|
1475
1596
|
/* @__PURE__ */ d("div", { className: "ds-block", children: [
|
|
1476
1597
|
/* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.scenarioContract }),
|
|
1477
|
-
i.length === 0 ? /* @__PURE__ */ o("p", { children: n.noIssues }) : i.map((a,
|
|
1598
|
+
i.length === 0 ? /* @__PURE__ */ o("p", { children: n.noIssues }) : i.map((a, s) => /* @__PURE__ */ d("div", { className: "ds-issue", "data-level": a.level, children: [
|
|
1478
1599
|
/* @__PURE__ */ o("span", { className: "ds-issue__where", children: a.where }),
|
|
1479
1600
|
a.message
|
|
1480
|
-
] }, `${a.where}-${
|
|
1601
|
+
] }, `${a.where}-${s}`))
|
|
1481
1602
|
] })
|
|
1482
1603
|
] });
|
|
1483
1604
|
}
|
|
1484
|
-
const
|
|
1605
|
+
const nt = {
|
|
1485
1606
|
ported: void 0,
|
|
1486
1607
|
proposed: "warn",
|
|
1487
1608
|
"in-review": "warn",
|
|
@@ -1490,18 +1611,18 @@ const tt = {
|
|
|
1490
1611
|
implemented: "ok",
|
|
1491
1612
|
superseded: void 0
|
|
1492
1613
|
};
|
|
1493
|
-
function
|
|
1494
|
-
return
|
|
1614
|
+
function at(e) {
|
|
1615
|
+
return nt[e];
|
|
1495
1616
|
}
|
|
1496
|
-
const
|
|
1617
|
+
const rt = ce(function({ viewport: t, textScale: n, reducedMotion: r, keyboardMode: i, children: a }, s) {
|
|
1497
1618
|
return /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
|
|
1498
1619
|
"div",
|
|
1499
1620
|
{
|
|
1500
|
-
ref:
|
|
1621
|
+
ref: s,
|
|
1501
1622
|
className: "ds-stage",
|
|
1502
1623
|
"data-viewport": t.id,
|
|
1503
1624
|
"data-keyboard-mode": i,
|
|
1504
|
-
"data-reduced-motion":
|
|
1625
|
+
"data-reduced-motion": r,
|
|
1505
1626
|
style: {
|
|
1506
1627
|
width: t.width ? `${t.width}px` : "100%",
|
|
1507
1628
|
minHeight: t.height ? `${t.height}px` : void 0,
|
|
@@ -1514,7 +1635,7 @@ const nt = se(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMo
|
|
|
1514
1635
|
}
|
|
1515
1636
|
) });
|
|
1516
1637
|
});
|
|
1517
|
-
function
|
|
1638
|
+
function st({ stops: e }) {
|
|
1518
1639
|
return e.length === 0 ? null : /* @__PURE__ */ o("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((t) => /* @__PURE__ */ o(
|
|
1519
1640
|
"span",
|
|
1520
1641
|
{
|
|
@@ -1526,42 +1647,44 @@ function at({ stops: e }) {
|
|
|
1526
1647
|
`${t.index}-${t.rect.top}-${t.rect.left}`
|
|
1527
1648
|
)) });
|
|
1528
1649
|
}
|
|
1529
|
-
function
|
|
1650
|
+
function it({ title: e, children: t }) {
|
|
1530
1651
|
return /* @__PURE__ */ d("div", { className: "ds-chrome ds-stage-empty", children: [
|
|
1531
1652
|
/* @__PURE__ */ o("h2", { children: e }),
|
|
1532
1653
|
t
|
|
1533
1654
|
] });
|
|
1534
1655
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const
|
|
1656
|
+
function ct({ registry: e, onOpenScenario: t, showPorted: n = !1 }) {
|
|
1657
|
+
const r = A(), { product: i } = e, a = { includePorted: n }, s = e.coverage(a), c = e.activeScenarios(a).length, p = e.treeFor(a).filter((m) => m.scenarios.length > 0), h = e.orphansFor(a);
|
|
1537
1658
|
return /* @__PURE__ */ d("div", { className: "ds-chrome ds-home", children: [
|
|
1538
1659
|
/* @__PURE__ */ d("header", { className: "ds-home__header", children: [
|
|
1539
|
-
/* @__PURE__ */ o("h1", { children:
|
|
1540
|
-
|
|
1541
|
-
/* @__PURE__ */ o("p", { className: "ds-home__lead", children:
|
|
1542
|
-
/* @__PURE__ */ o("div", { className: "ds-chips", children: Object.entries(
|
|
1543
|
-
|
|
1660
|
+
/* @__PURE__ */ o("h1", { children: i.name }),
|
|
1661
|
+
i.tagline && /* @__PURE__ */ o("p", { className: "ds-home__tagline", children: i.tagline }),
|
|
1662
|
+
/* @__PURE__ */ o("p", { className: "ds-home__lead", children: r.home.lead(c) }),
|
|
1663
|
+
/* @__PURE__ */ o("div", { className: "ds-chips", children: Object.entries(s).filter(([, m]) => m > 0).map(([m, b]) => /* @__PURE__ */ d("span", { className: "ds-chip", children: [
|
|
1664
|
+
r.status[m],
|
|
1544
1665
|
": ",
|
|
1545
|
-
|
|
1546
|
-
] },
|
|
1666
|
+
b
|
|
1667
|
+
] }, m)) })
|
|
1547
1668
|
] }),
|
|
1548
|
-
|
|
1549
|
-
|
|
1669
|
+
c === 0 && /* @__PURE__ */ o("p", { className: "ds-home__empty", children: r.home.noActiveWork }),
|
|
1670
|
+
p.map(({ module: m, scenarios: b }) => /* @__PURE__ */ o(
|
|
1671
|
+
dt,
|
|
1550
1672
|
{
|
|
1551
|
-
module:
|
|
1552
|
-
scenarios:
|
|
1673
|
+
module: m,
|
|
1674
|
+
scenarios: b,
|
|
1553
1675
|
registry: e,
|
|
1676
|
+
showPorted: n,
|
|
1554
1677
|
onOpenScenario: t
|
|
1555
1678
|
},
|
|
1556
|
-
|
|
1679
|
+
m.id
|
|
1557
1680
|
)),
|
|
1558
|
-
|
|
1559
|
-
/* @__PURE__ */ o("h2", { children:
|
|
1560
|
-
/* @__PURE__ */ o("p", { className: "ds-home__hint", children:
|
|
1681
|
+
h.length > 0 && /* @__PURE__ */ d("section", { className: "ds-home__module", children: [
|
|
1682
|
+
/* @__PURE__ */ o("h2", { children: r.home.withoutModule }),
|
|
1683
|
+
/* @__PURE__ */ o("p", { className: "ds-home__hint", children: r.home.withoutModuleHint }),
|
|
1561
1684
|
/* @__PURE__ */ o(
|
|
1562
|
-
|
|
1685
|
+
re,
|
|
1563
1686
|
{
|
|
1564
|
-
scenarios:
|
|
1687
|
+
scenarios: h,
|
|
1565
1688
|
registry: e,
|
|
1566
1689
|
onOpenScenario: t
|
|
1567
1690
|
}
|
|
@@ -1569,55 +1692,73 @@ function st({ registry: e, onOpenScenario: t }) {
|
|
|
1569
1692
|
] })
|
|
1570
1693
|
] });
|
|
1571
1694
|
}
|
|
1572
|
-
function
|
|
1695
|
+
function dt({
|
|
1573
1696
|
module: e,
|
|
1574
1697
|
scenarios: t,
|
|
1575
1698
|
registry: n,
|
|
1576
|
-
|
|
1699
|
+
showPorted: r,
|
|
1700
|
+
onOpenScenario: i
|
|
1577
1701
|
}) {
|
|
1578
1702
|
return /* @__PURE__ */ d("section", { className: "ds-home__module", children: [
|
|
1579
1703
|
/* @__PURE__ */ o("h2", { children: e.name }),
|
|
1580
1704
|
e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
|
|
1581
|
-
(e.flows ?? []).map((
|
|
1582
|
-
|
|
1705
|
+
(e.flows ?? []).map((a) => /* @__PURE__ */ o(
|
|
1706
|
+
lt,
|
|
1707
|
+
{
|
|
1708
|
+
flow: a,
|
|
1709
|
+
registry: n,
|
|
1710
|
+
showPorted: r,
|
|
1711
|
+
onOpenScenario: i
|
|
1712
|
+
},
|
|
1713
|
+
a.id
|
|
1714
|
+
)),
|
|
1715
|
+
/* @__PURE__ */ o(re, { scenarios: t, registry: n, onOpenScenario: i })
|
|
1583
1716
|
] });
|
|
1584
1717
|
}
|
|
1585
|
-
function
|
|
1718
|
+
function lt({
|
|
1586
1719
|
flow: e,
|
|
1587
1720
|
registry: t,
|
|
1588
|
-
|
|
1721
|
+
showPorted: n,
|
|
1722
|
+
onOpenScenario: r
|
|
1589
1723
|
}) {
|
|
1590
|
-
|
|
1724
|
+
const i = e.steps.filter((a) => {
|
|
1725
|
+
const s = t.scenario(a.scenario);
|
|
1726
|
+
return s && (n || s.status !== "ported");
|
|
1727
|
+
});
|
|
1728
|
+
return i.length === 0 ? null : /* @__PURE__ */ d("div", { className: "ds-flow", children: [
|
|
1591
1729
|
/* @__PURE__ */ o("h3", { children: e.title }),
|
|
1592
1730
|
e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
|
|
1593
|
-
/* @__PURE__ */ o("ol", { className: "ds-flow__steps", children:
|
|
1594
|
-
const
|
|
1731
|
+
/* @__PURE__ */ o("ol", { className: "ds-flow__steps", children: i.map((a, s) => {
|
|
1732
|
+
const c = t.scenario(a.scenario), p = Object.entries(a.branches ?? {}).filter(([, h]) => {
|
|
1733
|
+
const m = t.scenario(h);
|
|
1734
|
+
return m && (n || m.status !== "ported");
|
|
1735
|
+
});
|
|
1595
1736
|
return /* @__PURE__ */ d("li", { children: [
|
|
1596
|
-
/* @__PURE__ */ o("button", { type: "button", className: "ds-flow__step", onClick: () =>
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
/* @__PURE__ */ o("span", { className: "ds-flow__branch-label", children:
|
|
1737
|
+
/* @__PURE__ */ o("button", { type: "button", className: "ds-flow__step", onClick: () => r(a.scenario), children: a.label ?? c?.title ?? a.scenario }),
|
|
1738
|
+
a.decision && /* @__PURE__ */ o("p", { className: "ds-flow__decision", children: a.decision }),
|
|
1739
|
+
p.length > 0 && /* @__PURE__ */ o("ul", { className: "ds-flow__branches", children: p.map(([h, m]) => /* @__PURE__ */ d("li", { children: [
|
|
1740
|
+
/* @__PURE__ */ o("span", { className: "ds-flow__branch-label", children: h }),
|
|
1600
1741
|
/* @__PURE__ */ o(
|
|
1601
1742
|
"button",
|
|
1602
1743
|
{
|
|
1603
1744
|
type: "button",
|
|
1604
1745
|
className: "ds-flow__step",
|
|
1605
|
-
onClick: () =>
|
|
1606
|
-
children: t.scenario(
|
|
1746
|
+
onClick: () => r(m),
|
|
1747
|
+
children: t.scenario(m)?.title ?? m
|
|
1607
1748
|
}
|
|
1608
1749
|
)
|
|
1609
|
-
] },
|
|
1610
|
-
] }, `${
|
|
1750
|
+
] }, h)) })
|
|
1751
|
+
] }, `${a.scenario}-${s}`);
|
|
1611
1752
|
}) })
|
|
1612
1753
|
] });
|
|
1613
1754
|
}
|
|
1614
|
-
function
|
|
1755
|
+
function re({
|
|
1615
1756
|
scenarios: e,
|
|
1616
1757
|
registry: t,
|
|
1617
1758
|
onOpenScenario: n
|
|
1618
1759
|
}) {
|
|
1619
|
-
const
|
|
1620
|
-
return e.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-home__hint", children:
|
|
1760
|
+
const r = A();
|
|
1761
|
+
return e.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-home__hint", children: r.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
1762
|
/* @__PURE__ */ d("span", { className: "ds-home__card-head", children: [
|
|
1622
1763
|
/* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": i.status }),
|
|
1623
1764
|
/* @__PURE__ */ o("span", { className: "ds-home__card-title", children: i.title })
|
|
@@ -1626,20 +1767,26 @@ function ne({
|
|
|
1626
1767
|
/* @__PURE__ */ d("span", { className: "ds-home__card-meta", children: [
|
|
1627
1768
|
t.persona(i.persona)?.name ?? i.persona,
|
|
1628
1769
|
" · ",
|
|
1629
|
-
|
|
1630
|
-
i.a11y.keyboard === "full" ? ` · ${
|
|
1770
|
+
r.status[i.status],
|
|
1771
|
+
i.a11y.keyboard === "full" ? ` · ${r.home.keyboardBadge}` : ""
|
|
1631
1772
|
] })
|
|
1632
1773
|
] }) }, i.id)) });
|
|
1633
1774
|
}
|
|
1634
|
-
function
|
|
1635
|
-
const t =
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1775
|
+
function Nt({ product: e }) {
|
|
1776
|
+
const t = T(() => me(e), [e]), n = T(() => je(e.theme?.labels), [e.theme?.labels]), r = T(() => pe(e.deploy), [e.deploy]), { location: i, controls: a, viewport: s, setControls: c, navigate: p, openScenario: h, openComponent: m } = ge(t), b = q(null), { focused: u, tabStops: S } = We(a.keyboardMode, b), w = t.scenario(a.scenario), C = t.component(a.component), l = T(
|
|
1777
|
+
() => t.resolveComponentFixture(C?.id, C ? a.fixture : void 0),
|
|
1778
|
+
[C, a.fixture, t]
|
|
1779
|
+
), g = T(() => {
|
|
1780
|
+
const x = l.fixture?.data;
|
|
1781
|
+
return typeof x == "function" ? x() : x;
|
|
1782
|
+
}, [l.fixture]), k = t.persona(a.persona ?? w?.persona), M = t.fixture(a.fixture ?? w?.fixture), _ = T(() => {
|
|
1783
|
+
const x = a.dataSource ?? "fixtures";
|
|
1784
|
+
return x === "fixtures" ? J : e.dataSources?.adapters?.find((L) => L.id === x) ?? J;
|
|
1785
|
+
}, [a.dataSource, e.dataSources?.adapters]), { data: $, isLoading: D, error: W } = Te({ scenario: w, fixture: M, network: a.network, adapter: _ });
|
|
1786
|
+
B(() => {
|
|
1787
|
+
const x = (L) => {
|
|
1788
|
+
if (!(!L.shiftKey || L.metaKey || L.ctrlKey || L.altKey || L.target?.matches("input, textarea, select, [contenteditable='true']"))) {
|
|
1789
|
+
switch (L.key) {
|
|
1643
1790
|
case "K":
|
|
1644
1791
|
c({ keyboardMode: !a.keyboardMode });
|
|
1645
1792
|
break;
|
|
@@ -1649,24 +1796,24 @@ function wt({ product: e }) {
|
|
|
1649
1796
|
default:
|
|
1650
1797
|
return;
|
|
1651
1798
|
}
|
|
1652
|
-
|
|
1799
|
+
L.preventDefault();
|
|
1653
1800
|
}
|
|
1654
1801
|
};
|
|
1655
|
-
return window.addEventListener("keydown",
|
|
1802
|
+
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
1656
1803
|
}, [a.keyboardMode, a.inspector, c]);
|
|
1657
|
-
const
|
|
1804
|
+
const R = T(() => a.persona && a.persona !== w?.persona ? t.persona(a.persona)?.permissions ?? [] : t.permissionsOf(w), [a.persona, t, w]), j = T(
|
|
1658
1805
|
() => ({
|
|
1659
|
-
scenario:
|
|
1660
|
-
persona:
|
|
1661
|
-
permissions:
|
|
1662
|
-
can: (
|
|
1806
|
+
scenario: w,
|
|
1807
|
+
persona: k,
|
|
1808
|
+
permissions: R,
|
|
1809
|
+
can: (x) => R.includes(x),
|
|
1663
1810
|
data: $,
|
|
1664
|
-
fixture:
|
|
1811
|
+
fixture: M,
|
|
1665
1812
|
network: a.network,
|
|
1666
|
-
isLoading:
|
|
1667
|
-
error:
|
|
1668
|
-
rules: t.rulesOf(
|
|
1669
|
-
viewport:
|
|
1813
|
+
isLoading: D,
|
|
1814
|
+
error: W,
|
|
1815
|
+
rules: t.rulesOf(w),
|
|
1816
|
+
viewport: s,
|
|
1670
1817
|
themeMode: a.themeMode,
|
|
1671
1818
|
locale: a.locale,
|
|
1672
1819
|
a11y: {
|
|
@@ -1678,95 +1825,121 @@ function wt({ product: e }) {
|
|
|
1678
1825
|
openScenario: h
|
|
1679
1826
|
}),
|
|
1680
1827
|
[
|
|
1681
|
-
l,
|
|
1682
1828
|
w,
|
|
1683
|
-
|
|
1829
|
+
k,
|
|
1830
|
+
R,
|
|
1684
1831
|
$,
|
|
1685
|
-
|
|
1832
|
+
M,
|
|
1686
1833
|
a.network,
|
|
1687
1834
|
a.themeMode,
|
|
1688
1835
|
a.locale,
|
|
1689
1836
|
a.keyboardMode,
|
|
1690
1837
|
a.reducedMotion,
|
|
1691
1838
|
a.textScale,
|
|
1692
|
-
|
|
1693
|
-
|
|
1839
|
+
D,
|
|
1840
|
+
W,
|
|
1694
1841
|
t,
|
|
1695
|
-
|
|
1842
|
+
s,
|
|
1696
1843
|
p,
|
|
1697
1844
|
h
|
|
1698
1845
|
]
|
|
1699
|
-
),
|
|
1846
|
+
), U = !w && !C && i.path === "/", O = xe(e.routes, i.path), H = e.wrapper, K = e.notFound, f = C?.preview, N = f ? /* @__PURE__ */ o(
|
|
1847
|
+
f,
|
|
1848
|
+
{
|
|
1849
|
+
fixture: l.fixture,
|
|
1850
|
+
data: g,
|
|
1851
|
+
viewport: s,
|
|
1852
|
+
themeMode: a.themeMode ?? "default",
|
|
1853
|
+
locale: a.locale ?? "default",
|
|
1854
|
+
a11y: {
|
|
1855
|
+
keyboardMode: a.keyboardMode,
|
|
1856
|
+
reducedMotion: a.reducedMotion,
|
|
1857
|
+
textScale: a.textScale
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
) : O ? /* @__PURE__ */ o(O.definition.screen, { params: O.params, context: j }) : K ? /* @__PURE__ */ o(K, { path: i.path }) : /* @__PURE__ */ o(it, { title: n.shell.noRoute, children: /* @__PURE__ */ d("p", { children: [
|
|
1700
1861
|
/* @__PURE__ */ o("code", { children: i.path }),
|
|
1701
1862
|
" ",
|
|
1702
1863
|
n.shell.noRouteHint
|
|
1703
|
-
] }) }),
|
|
1704
|
-
return /* @__PURE__ */ o(
|
|
1864
|
+
] }) }), y = H ? /* @__PURE__ */ o(H, { context: j, children: N }) : N;
|
|
1865
|
+
return /* @__PURE__ */ o(ae.Provider, { value: n, children: /* @__PURE__ */ d(
|
|
1705
1866
|
"div",
|
|
1706
1867
|
{
|
|
1707
1868
|
className: "ds-root",
|
|
1708
1869
|
"data-chrome": a.chrome ? "visible" : "hidden",
|
|
1709
1870
|
"data-appearance": a.chromeTheme ?? "dark",
|
|
1710
1871
|
"data-inspector": a.inspector ? "open" : "closed",
|
|
1711
|
-
"data-viewport":
|
|
1872
|
+
"data-viewport": s.id,
|
|
1712
1873
|
children: [
|
|
1713
1874
|
a.chrome && /* @__PURE__ */ o(
|
|
1714
|
-
|
|
1875
|
+
Ve,
|
|
1715
1876
|
{
|
|
1716
1877
|
product: e,
|
|
1717
|
-
scenario:
|
|
1718
|
-
deploy:
|
|
1878
|
+
scenario: w,
|
|
1879
|
+
deploy: r,
|
|
1719
1880
|
inspectorOpen: a.inspector,
|
|
1720
1881
|
chromeTheme: a.chromeTheme ?? "dark",
|
|
1882
|
+
showPorted: a.showPorted ?? !1,
|
|
1721
1883
|
onToggleInspector: () => c({ inspector: !a.inspector }),
|
|
1722
1884
|
onToggleChromeTheme: () => c({ chromeTheme: a.chromeTheme === "light" ? "dark" : "light" })
|
|
1723
1885
|
}
|
|
1724
1886
|
),
|
|
1725
1887
|
a.chrome && /* @__PURE__ */ o(
|
|
1726
|
-
|
|
1888
|
+
He,
|
|
1727
1889
|
{
|
|
1728
1890
|
registry: t,
|
|
1729
|
-
activeScenario:
|
|
1891
|
+
activeScenario: w,
|
|
1730
1892
|
activeComponent: a.component,
|
|
1731
1893
|
controls: a,
|
|
1732
1894
|
onOpenScenario: h,
|
|
1733
|
-
onOpenComponent:
|
|
1895
|
+
onOpenComponent: m,
|
|
1896
|
+
onShowPortedChange: (x) => c({ showPorted: x })
|
|
1734
1897
|
}
|
|
1735
1898
|
),
|
|
1736
1899
|
/* @__PURE__ */ d("div", { className: "ds-stage-area", children: [
|
|
1737
|
-
|
|
1738
|
-
|
|
1900
|
+
U ? /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
|
|
1901
|
+
ct,
|
|
1739
1902
|
{
|
|
1740
|
-
|
|
1741
|
-
|
|
1903
|
+
registry: t,
|
|
1904
|
+
showPorted: a.showPorted ?? !1,
|
|
1905
|
+
onOpenScenario: h
|
|
1906
|
+
}
|
|
1907
|
+
) }) : /* @__PURE__ */ o(
|
|
1908
|
+
rt,
|
|
1909
|
+
{
|
|
1910
|
+
ref: b,
|
|
1911
|
+
viewport: s,
|
|
1742
1912
|
textScale: a.textScale,
|
|
1743
1913
|
reducedMotion: a.reducedMotion,
|
|
1744
1914
|
keyboardMode: a.keyboardMode,
|
|
1745
|
-
children:
|
|
1915
|
+
children: y
|
|
1746
1916
|
}
|
|
1747
1917
|
),
|
|
1748
1918
|
a.chrome && /* @__PURE__ */ o(
|
|
1749
|
-
|
|
1919
|
+
Qe,
|
|
1750
1920
|
{
|
|
1751
1921
|
registry: t,
|
|
1752
1922
|
controls: a,
|
|
1753
|
-
scenarioActive: !!
|
|
1923
|
+
scenarioActive: !!w,
|
|
1924
|
+
component: C,
|
|
1925
|
+
componentFixture: l,
|
|
1754
1926
|
onChange: c
|
|
1755
1927
|
}
|
|
1756
1928
|
)
|
|
1757
1929
|
] }),
|
|
1758
1930
|
a.chrome && /* @__PURE__ */ o(
|
|
1759
|
-
|
|
1931
|
+
Ze,
|
|
1760
1932
|
{
|
|
1761
1933
|
registry: t,
|
|
1762
|
-
scenario:
|
|
1763
|
-
component:
|
|
1934
|
+
scenario: w,
|
|
1935
|
+
component: C,
|
|
1936
|
+
componentFixture: l,
|
|
1764
1937
|
controls: a,
|
|
1765
|
-
focusedNode:
|
|
1766
|
-
tabStopCount:
|
|
1938
|
+
focusedNode: u,
|
|
1939
|
+
tabStopCount: S.length
|
|
1767
1940
|
}
|
|
1768
1941
|
),
|
|
1769
|
-
a.keyboardMode && /* @__PURE__ */ o(
|
|
1942
|
+
a.keyboardMode && /* @__PURE__ */ o(st, { stops: S }),
|
|
1770
1943
|
!a.chrome && /* @__PURE__ */ o(
|
|
1771
1944
|
"button",
|
|
1772
1945
|
{
|
|
@@ -1780,76 +1953,77 @@ function wt({ product: e }) {
|
|
|
1780
1953
|
}
|
|
1781
1954
|
) });
|
|
1782
1955
|
}
|
|
1783
|
-
function
|
|
1956
|
+
function z(e) {
|
|
1784
1957
|
return new Date(e.length === 10 ? `${e}T00:00:00` : e);
|
|
1785
1958
|
}
|
|
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;
|
|
1791
|
-
}
|
|
1792
1959
|
function yt(e, t) {
|
|
1793
|
-
const n =
|
|
1794
|
-
|
|
1960
|
+
const n = z(e), r = z(t);
|
|
1961
|
+
let i = r.getFullYear() - n.getFullYear();
|
|
1962
|
+
const a = r.getMonth() - n.getMonth();
|
|
1963
|
+
return (a < 0 || a === 0 && r.getDate() < n.getDate()) && (i -= 1), i;
|
|
1964
|
+
}
|
|
1965
|
+
function xt(e, t) {
|
|
1966
|
+
const n = z(e), r = z(t);
|
|
1967
|
+
return Math.floor((r.getTime() - n.getTime()) / 864e5);
|
|
1795
1968
|
}
|
|
1796
1969
|
export {
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1970
|
+
_t as CONTRAST_THRESHOLDS,
|
|
1971
|
+
E as DEFAULT_LABELS,
|
|
1972
|
+
Nt as DesignSpace,
|
|
1973
|
+
bt as EN_US_LABELS,
|
|
1974
|
+
ct as Home,
|
|
1975
|
+
kt as KEYBOARD_LABELS,
|
|
1976
|
+
wt as NETWORK_LABELS,
|
|
1977
|
+
oe as NETWORK_STATES,
|
|
1978
|
+
v as PARAM,
|
|
1979
|
+
de as SCENARIO_STATUSES,
|
|
1980
|
+
Me as SLOW_NETWORK_DELAY_MS,
|
|
1981
|
+
gt as STATUS_LABELS,
|
|
1982
|
+
vt as STATUS_MEANING,
|
|
1983
|
+
_e as SimulatedNetworkError,
|
|
1984
|
+
rt as Stage,
|
|
1985
|
+
it as StageEmpty,
|
|
1986
|
+
fe as TEXT_SCALES,
|
|
1987
|
+
st as TabOrderOverlay,
|
|
1988
|
+
ne as VIEWPORTS,
|
|
1989
|
+
yt as ageInYears,
|
|
1990
|
+
Ct as applyOverrides,
|
|
1991
|
+
Tt as assertContrastPairs,
|
|
1992
|
+
Pt as checkContrastPair,
|
|
1993
|
+
he as checkContrastPairs,
|
|
1994
|
+
At as commitUrl,
|
|
1995
|
+
Lt as componentUrl,
|
|
1996
|
+
Ee as computeRole,
|
|
1997
|
+
Et as contrastRatio,
|
|
1998
|
+
ft as createHttpAdapter,
|
|
1999
|
+
me as createRegistry,
|
|
2000
|
+
xt as daysBetween,
|
|
1827
2001
|
Le as describeElement,
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
2002
|
+
J as fixtureAdapter,
|
|
2003
|
+
Ft as flatten,
|
|
2004
|
+
$t as formatIssues,
|
|
2005
|
+
pe as getDeployContext,
|
|
2006
|
+
Dt as hasErrors,
|
|
2007
|
+
ye as matchPath,
|
|
2008
|
+
Rt as parseColor,
|
|
2009
|
+
be as parseControls,
|
|
2010
|
+
z as parseIsoDate,
|
|
2011
|
+
Ot as readCssVariable,
|
|
2012
|
+
It as relativeLuminance,
|
|
2013
|
+
Y as resolveFixture,
|
|
2014
|
+
je as resolveLabels,
|
|
2015
|
+
xe as resolveRoute,
|
|
2016
|
+
ve as resolveViewport,
|
|
2017
|
+
ue as scenarioUrl,
|
|
2018
|
+
G as serializeControls,
|
|
2019
|
+
Bt as serializeValue,
|
|
2020
|
+
Ie as shortSelector,
|
|
2021
|
+
Be as tabbableElements,
|
|
2022
|
+
ge as useDesignSpaceState,
|
|
2023
|
+
We as useKeyboardMode,
|
|
2024
|
+
A as useLabels,
|
|
2025
|
+
Te as useScenarioData,
|
|
2026
|
+
le as validateProduct,
|
|
2027
|
+
Wt as validateScenario
|
|
1854
2028
|
};
|
|
1855
2029
|
//# sourceMappingURL=index.js.map
|