@devslab/site-kit 0.30.0 → 0.32.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/README.ko.md +52 -1
- package/README.md +52 -1
- package/dist/flag-bodies.js +30 -0
- package/dist/flag-bodies.js.map +1 -1
- package/dist/react/chrome.d.ts +66 -0
- package/dist/react/chrome.d.ts.map +1 -0
- package/dist/react/chunks/flag-bodies.js +114 -0
- package/dist/react/chunks/flag-bodies.js.map +1 -0
- package/dist/react/consent.d.ts +15 -0
- package/dist/react/consent.d.ts.map +1 -0
- package/dist/react/flag-bodies.d.ts +21 -0
- package/dist/react/flag-bodies.d.ts.map +1 -0
- package/dist/react/flag-bodies.js +6 -0
- package/dist/react/flag-bodies.js.map +1 -0
- package/dist/react/flag-bodies.server.d.ts +4 -0
- package/dist/react/flag-bodies.server.d.ts.map +1 -0
- package/dist/react/flag-bodies.server.js +7 -0
- package/dist/react/flag-bodies.server.js.map +1 -0
- package/dist/react/index.d.ts +29 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +825 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/layouts.d.ts +51 -0
- package/dist/react/layouts.d.ts.map +1 -0
- package/dist/react/locale-menu.d.ts +24 -0
- package/dist/react/locale-menu.d.ts.map +1 -0
- package/dist/react/locale-state.d.ts +10 -0
- package/dist/react/locale-state.d.ts.map +1 -0
- package/dist/react/oss-product-mark.d.ts +9 -0
- package/dist/react/oss-product-mark.d.ts.map +1 -0
- package/dist/react/primitives.d.ts +18 -0
- package/dist/react/primitives.d.ts.map +1 -0
- package/dist/react/sections.d.ts +63 -0
- package/dist/react/sections.d.ts.map +1 -0
- package/dist/react/types.d.ts +82 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/solid.js +9 -1
- package/dist/solid.js.map +1 -1
- package/dist/solid.server.js +38 -1
- package/dist/solid.server.js.map +1 -1
- package/flags/kh.svg +61 -0
- package/flags/la.svg +12 -0
- package/flags/mm.svg +12 -0
- package/flags/mn.svg +14 -0
- package/flags/my.svg +26 -0
- package/flags/ph.svg +6 -0
- package/package.json +38 -10
- package/src/core/flag-bodies.mjs +6 -0
- package/src/core/flag-countries.mjs +1 -1
- package/src/core/locales.d.mts +10 -0
- package/src/core/locales.mjs +18 -0
- package/styles.css +4 -0
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as e, useEffect as t, useId as n, useRef as r, useState as i } from "react";
|
|
3
|
+
import { flagBodiesNow as a, loadFlagBodies as o } from "@devslab/site-kit/react/flag-bodies";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { directionPolicy as l, icons as u } from "@devslab/dds-icons";
|
|
6
|
+
//#region src/core/locales.mjs
|
|
7
|
+
var d = Object.freeze([
|
|
8
|
+
{
|
|
9
|
+
code: "ko",
|
|
10
|
+
language: "Korean",
|
|
11
|
+
nativeName: "한국어",
|
|
12
|
+
dir: "ltr"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
code: "en",
|
|
16
|
+
language: "English",
|
|
17
|
+
nativeName: "English",
|
|
18
|
+
dir: "ltr"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
code: "ja",
|
|
22
|
+
language: "Japanese",
|
|
23
|
+
nativeName: "日本語",
|
|
24
|
+
dir: "ltr"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
code: "zh-HK",
|
|
28
|
+
language: "Chinese (Hong Kong)",
|
|
29
|
+
nativeName: "繁體中文(香港)",
|
|
30
|
+
dir: "ltr"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
code: "zh-TW",
|
|
34
|
+
language: "Chinese (Taiwan)",
|
|
35
|
+
nativeName: "繁體中文(台灣)",
|
|
36
|
+
dir: "ltr"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: "hi",
|
|
40
|
+
language: "Hindi",
|
|
41
|
+
nativeName: "हिन्दी",
|
|
42
|
+
dir: "ltr"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
code: "vi",
|
|
46
|
+
language: "Vietnamese",
|
|
47
|
+
nativeName: "Tiếng Việt",
|
|
48
|
+
dir: "ltr"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
code: "id",
|
|
52
|
+
language: "Indonesian",
|
|
53
|
+
nativeName: "Bahasa Indonesia",
|
|
54
|
+
dir: "ltr"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
code: "th",
|
|
58
|
+
language: "Thai",
|
|
59
|
+
nativeName: "ไทย",
|
|
60
|
+
dir: "ltr"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
code: "pt-BR",
|
|
64
|
+
language: "Portuguese (Brazil)",
|
|
65
|
+
nativeName: "Português (Brasil)",
|
|
66
|
+
dir: "ltr"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
code: "fr",
|
|
70
|
+
language: "French",
|
|
71
|
+
nativeName: "Français",
|
|
72
|
+
dir: "ltr"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
code: "de",
|
|
76
|
+
language: "German",
|
|
77
|
+
nativeName: "Deutsch",
|
|
78
|
+
dir: "ltr"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
code: "es",
|
|
82
|
+
language: "Spanish",
|
|
83
|
+
nativeName: "Español",
|
|
84
|
+
dir: "ltr"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
code: "ar",
|
|
88
|
+
language: "Arabic",
|
|
89
|
+
nativeName: "العربية",
|
|
90
|
+
dir: "rtl"
|
|
91
|
+
}
|
|
92
|
+
]), f = Object.freeze([["zh", "zh-TW"], ["pt", "pt-BR"]]);
|
|
93
|
+
function p(e = {}) {
|
|
94
|
+
let t = e.extra ?? [], n = d;
|
|
95
|
+
if (e.only !== void 0) {
|
|
96
|
+
if (e.only.length === 0) throw RangeError("`only` needs at least one locale — a registry with none is a bug, not a choice");
|
|
97
|
+
let t = new Set(e.only);
|
|
98
|
+
for (let e of t) if (!d.some((t) => t.code === e)) throw RangeError(`${e} is not a family locale — \`only\` selects from the family list; use \`extra\` for a product's own`);
|
|
99
|
+
n = Object.freeze(d.filter((e) => t.has(e.code)));
|
|
100
|
+
}
|
|
101
|
+
let r = new Set(n.map(({ code: e }) => e));
|
|
102
|
+
for (let e of t) {
|
|
103
|
+
if (!e?.code) throw TypeError("every extra locale needs a code");
|
|
104
|
+
if (d.some((t) => t.code === e.code)) throw RangeError(`${e.code} is already a family locale — remove it from \`extra\``);
|
|
105
|
+
if (r.has(e.code)) throw RangeError(`${e.code} appears twice in \`extra\``);
|
|
106
|
+
if (!e.nativeName) throw TypeError(`${e.code} needs a nativeName — it is what the picker shows`);
|
|
107
|
+
if (e.dir !== "ltr" && e.dir !== "rtl") throw RangeError(`${e.code} needs dir "ltr" or "rtl"`);
|
|
108
|
+
r.add(e.code);
|
|
109
|
+
}
|
|
110
|
+
let i = Object.freeze([...n, ...t.map((e) => Object.freeze({ ...e }))]), a = new Map(i.map((e) => [e.code.toLowerCase(), e])), o = new Map([...f, ...e.aliases ?? []]);
|
|
111
|
+
function s(e) {
|
|
112
|
+
if (!e) return;
|
|
113
|
+
let t = a.get(String(e).trim().toLowerCase());
|
|
114
|
+
if (t) return t.code;
|
|
115
|
+
let n = String(e).trim().toLowerCase().split("-")[0];
|
|
116
|
+
if (o.has(n)) {
|
|
117
|
+
let e = o.get(n);
|
|
118
|
+
return a.has(e.toLowerCase()) ? e : void 0;
|
|
119
|
+
}
|
|
120
|
+
return a.get(n)?.code;
|
|
121
|
+
}
|
|
122
|
+
function c(e) {
|
|
123
|
+
let t = s(e);
|
|
124
|
+
if (!t) throw RangeError(`Unsupported locale: ${e}`);
|
|
125
|
+
return a.get(t.toLowerCase());
|
|
126
|
+
}
|
|
127
|
+
function l(e) {
|
|
128
|
+
let t = c(e);
|
|
129
|
+
return {
|
|
130
|
+
lang: t.code,
|
|
131
|
+
dir: t.dir
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function u({ pathname: e = "/", cookie: t = "", acceptLanguage: n = "", defaultLocale: r }) {
|
|
135
|
+
let i = s(e.split("/").filter(Boolean)[0]);
|
|
136
|
+
if (i) return {
|
|
137
|
+
locale: i,
|
|
138
|
+
source: "route"
|
|
139
|
+
};
|
|
140
|
+
let a = s(m(t, "locale"));
|
|
141
|
+
if (a) return {
|
|
142
|
+
locale: a,
|
|
143
|
+
source: "cookie"
|
|
144
|
+
};
|
|
145
|
+
let o = h(n, s)[0]?.locale;
|
|
146
|
+
if (o) return {
|
|
147
|
+
locale: o,
|
|
148
|
+
source: "accept-language"
|
|
149
|
+
};
|
|
150
|
+
let c = s(r);
|
|
151
|
+
if (!c) throw RangeError(`Unsupported default locale: ${r}`);
|
|
152
|
+
return {
|
|
153
|
+
locale: c,
|
|
154
|
+
source: "default"
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return Object.freeze({
|
|
158
|
+
LOCALES: i,
|
|
159
|
+
canonicalLocale: s,
|
|
160
|
+
localeAttributes: l,
|
|
161
|
+
resolveLocale: u,
|
|
162
|
+
definitionFor: c
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function m(e, t) {
|
|
166
|
+
for (let n of String(e ?? "").split(";")) {
|
|
167
|
+
let e = n.indexOf("=");
|
|
168
|
+
if (!(e < 0) && n.slice(0, e).trim() === t) try {
|
|
169
|
+
return decodeURIComponent(n.slice(e + 1).trim());
|
|
170
|
+
} catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function h(e, t) {
|
|
176
|
+
return String(e ?? "").split(",").map((e, n) => {
|
|
177
|
+
let [r, ...i] = e.trim().split(";"), a = Number(i.find((e) => e.trim().startsWith("q="))?.split("=")[1] ?? 1);
|
|
178
|
+
return {
|
|
179
|
+
locale: t(r),
|
|
180
|
+
q: Number.isFinite(a) ? a : 0,
|
|
181
|
+
order: n
|
|
182
|
+
};
|
|
183
|
+
}).filter(({ locale: e, q: t }) => e && t > 0).sort((e, t) => t.q - e.q || e.order - t.order);
|
|
184
|
+
}
|
|
185
|
+
var g = p(), { canonicalLocale: ee, localeAttributes: te, resolveLocale: ne } = g, _ = Object.freeze({
|
|
186
|
+
ko: "kr",
|
|
187
|
+
en: "us",
|
|
188
|
+
ja: "jp",
|
|
189
|
+
"zh-HK": "hk",
|
|
190
|
+
"zh-TW": "tw",
|
|
191
|
+
hi: "in",
|
|
192
|
+
vi: "vn",
|
|
193
|
+
id: "id",
|
|
194
|
+
th: "th",
|
|
195
|
+
"pt-BR": "br",
|
|
196
|
+
fr: "fr",
|
|
197
|
+
de: "de",
|
|
198
|
+
es: "es",
|
|
199
|
+
ar: "sa"
|
|
200
|
+
}), v = "0 0 640 480", y = /* @__PURE__ */ new Set([
|
|
201
|
+
...Object.values(_),
|
|
202
|
+
"my",
|
|
203
|
+
"la",
|
|
204
|
+
"kh",
|
|
205
|
+
"mm",
|
|
206
|
+
"ph",
|
|
207
|
+
"mn"
|
|
208
|
+
]);
|
|
209
|
+
function b(e, t) {
|
|
210
|
+
let n = _[e];
|
|
211
|
+
if (n) return n;
|
|
212
|
+
let r = t?.LOCALES?.find((t) => t.code === e);
|
|
213
|
+
if (r?.flagCountry) {
|
|
214
|
+
if (y.has(r.flagCountry)) return r.flagCountry;
|
|
215
|
+
throw RangeError(`No vendored flag for country: ${r.flagCountry} (locale ${e})`);
|
|
216
|
+
}
|
|
217
|
+
throw RangeError(`No flag for locale: ${e}`);
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/react/locale-state.ts
|
|
221
|
+
function x(e, t) {
|
|
222
|
+
if (e.hrefForLocale) return e.hrefForLocale(t);
|
|
223
|
+
let n = e.hrefs?.[t];
|
|
224
|
+
if (typeof n != "string") throw RangeError(`LocaleState.hrefs has no href for locale: ${t}`);
|
|
225
|
+
return n;
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/react/locale-menu.tsx
|
|
229
|
+
var S = (e) => e.registry ?? g, C = (e, t) => b(e, t), w = () => `rx${n().replace(/[^A-Za-z0-9_-]/g, "")}`;
|
|
230
|
+
function T(e, t) {
|
|
231
|
+
let n = [...e.matchAll(/\bid="([^"]+)"/g)].map((e) => e[1]);
|
|
232
|
+
if (n.length === 0) return e;
|
|
233
|
+
let r = e;
|
|
234
|
+
for (let e of n) {
|
|
235
|
+
let n = `${e}-${t}`;
|
|
236
|
+
r = r.replaceAll(`id="${e}"`, `id="${n}"`).replaceAll(`href="#${e}"`, `href="#${n}"`).replaceAll(`url(#${e})`, `url(#${n})`);
|
|
237
|
+
}
|
|
238
|
+
return r;
|
|
239
|
+
}
|
|
240
|
+
var E = (e, t) => `site-flag-${e}-${t}`;
|
|
241
|
+
function D(e, t, n) {
|
|
242
|
+
return e.map((e) => {
|
|
243
|
+
let r = t[e];
|
|
244
|
+
if (!r) throw RangeError(`No vendored flag for country: ${e}`);
|
|
245
|
+
return `<symbol id="${E(e, n)}" viewBox="${r.viewBox}">${T(r.body, n)}</symbol>`;
|
|
246
|
+
}).join("");
|
|
247
|
+
}
|
|
248
|
+
function O({ countries: e, uid: n }) {
|
|
249
|
+
let r = e.join(","), [c, l] = i(() => {
|
|
250
|
+
let t = a();
|
|
251
|
+
if (t) return D(e, t, n);
|
|
252
|
+
if (typeof document > "u") return null;
|
|
253
|
+
let r = document.querySelector(`svg.site-flag-sprite[data-flag-sprite="${n}"]`);
|
|
254
|
+
return r && r.childElementCount > 0 ? r.innerHTML : null;
|
|
255
|
+
});
|
|
256
|
+
return t(() => {
|
|
257
|
+
if (c !== null) return;
|
|
258
|
+
let t = !0;
|
|
259
|
+
return o().then((r) => {
|
|
260
|
+
t && l(D(e, r, n));
|
|
261
|
+
}), () => {
|
|
262
|
+
t = !1;
|
|
263
|
+
};
|
|
264
|
+
}, [
|
|
265
|
+
c,
|
|
266
|
+
r,
|
|
267
|
+
n
|
|
268
|
+
]), /* @__PURE__ */ s("svg", {
|
|
269
|
+
className: "site-flag-sprite",
|
|
270
|
+
"aria-hidden": "true",
|
|
271
|
+
"data-flag-sprite": n,
|
|
272
|
+
...c === null ? {} : { dangerouslySetInnerHTML: { __html: c } }
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function k({ locale: e, className: t, registry: n, uid: r }) {
|
|
276
|
+
let i = C(e, n);
|
|
277
|
+
return /* @__PURE__ */ s("svg", {
|
|
278
|
+
className: t,
|
|
279
|
+
viewBox: v,
|
|
280
|
+
"aria-hidden": "true",
|
|
281
|
+
children: /* @__PURE__ */ s("use", { href: `#${E(i, r)}` })
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function A(e) {
|
|
285
|
+
let t = S(e);
|
|
286
|
+
return /* @__PURE__ */ c("label", { children: [/* @__PURE__ */ s("span", {
|
|
287
|
+
className: "dds-sr-only",
|
|
288
|
+
children: e.messages.localeLabel
|
|
289
|
+
}), /* @__PURE__ */ s("span", {
|
|
290
|
+
className: "dds-select site-locale",
|
|
291
|
+
children: /* @__PURE__ */ s("select", {
|
|
292
|
+
className: "dds-select__input",
|
|
293
|
+
"aria-label": e.messages.localeLabel,
|
|
294
|
+
value: e.state.locale,
|
|
295
|
+
onChange: (t) => {
|
|
296
|
+
let n = t.currentTarget.value, r = x(e.state, n);
|
|
297
|
+
e.onLocaleChange ? e.onLocaleChange(n, r) : window.location.assign(r);
|
|
298
|
+
},
|
|
299
|
+
children: t.LOCALES.map((e) => /* @__PURE__ */ s("option", {
|
|
300
|
+
value: e.code,
|
|
301
|
+
lang: e.code,
|
|
302
|
+
dir: e.dir,
|
|
303
|
+
children: e.nativeName
|
|
304
|
+
}, e.code))
|
|
305
|
+
})
|
|
306
|
+
})] });
|
|
307
|
+
}
|
|
308
|
+
function j(e) {
|
|
309
|
+
let t = r(null), n = r(null), i = w(), a = S(e), o = [...new Set(a.LOCALES.map((e) => C(e.code, a)))], l = a.LOCALES.find((t) => t.code === e.state.locale), u = () => {
|
|
310
|
+
t.current && (t.current.open = !1);
|
|
311
|
+
}, d = (e) => {
|
|
312
|
+
e.key !== "Escape" || !t.current?.open || (e.preventDefault(), u(), n.current?.focus());
|
|
313
|
+
}, f = l?.nativeName, p = f ? `${e.messages.localeLabel}: ${f}` : e.messages.localeLabel;
|
|
314
|
+
return /* @__PURE__ */ c("details", {
|
|
315
|
+
ref: t,
|
|
316
|
+
className: "site-locale-flag",
|
|
317
|
+
onKeyDown: d,
|
|
318
|
+
children: [/* @__PURE__ */ c("summary", {
|
|
319
|
+
ref: n,
|
|
320
|
+
className: "site-locale-flag__trigger",
|
|
321
|
+
"aria-label": p,
|
|
322
|
+
title: e.messages.localeLabel,
|
|
323
|
+
children: [/* @__PURE__ */ s(O, {
|
|
324
|
+
countries: o,
|
|
325
|
+
uid: i
|
|
326
|
+
}), /* @__PURE__ */ s(k, {
|
|
327
|
+
locale: e.state.locale,
|
|
328
|
+
className: "site-locale-flag__svg",
|
|
329
|
+
registry: a,
|
|
330
|
+
uid: i
|
|
331
|
+
})]
|
|
332
|
+
}), /* @__PURE__ */ s("ul", {
|
|
333
|
+
className: "site-locale-flag__list",
|
|
334
|
+
role: "list",
|
|
335
|
+
children: a.LOCALES.map((t) => {
|
|
336
|
+
let n = x(e.state, t.code);
|
|
337
|
+
return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c("a", {
|
|
338
|
+
className: "site-locale-flag__option",
|
|
339
|
+
href: n,
|
|
340
|
+
lang: t.code,
|
|
341
|
+
hrefLang: t.code,
|
|
342
|
+
dir: t.dir,
|
|
343
|
+
"aria-current": t.code === e.state.locale ? "true" : void 0,
|
|
344
|
+
onClick: (r) => {
|
|
345
|
+
e.onLocaleChange && (r.preventDefault(), u(), e.onLocaleChange(t.code, n));
|
|
346
|
+
},
|
|
347
|
+
children: [/* @__PURE__ */ s(k, {
|
|
348
|
+
locale: t.code,
|
|
349
|
+
className: "site-locale-flag__svg",
|
|
350
|
+
registry: a,
|
|
351
|
+
uid: i
|
|
352
|
+
}), /* @__PURE__ */ s("span", { children: t.nativeName })]
|
|
353
|
+
}) }, t.code);
|
|
354
|
+
})
|
|
355
|
+
})]
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function M(e) {
|
|
359
|
+
return e.variant === "flag" ? /* @__PURE__ */ s(j, { ...e }) : /* @__PURE__ */ s(A, { ...e });
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/react/consent.tsx
|
|
363
|
+
function N(e) {
|
|
364
|
+
return /* @__PURE__ */ s("button", {
|
|
365
|
+
type: "button",
|
|
366
|
+
className: e.className ? `site-consent-trigger ${e.className}` : "site-consent-trigger",
|
|
367
|
+
"aria-haspopup": "dialog",
|
|
368
|
+
onClick: () => e.controller.openSettings(),
|
|
369
|
+
children: e.children
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/react/primitives.tsx
|
|
374
|
+
var P = (...e) => e.filter(Boolean).join(" ");
|
|
375
|
+
function F({ tone: e = "primary", type: t = "button", className: n, ...r }) {
|
|
376
|
+
return /* @__PURE__ */ s("button", {
|
|
377
|
+
...r,
|
|
378
|
+
type: t,
|
|
379
|
+
className: P("dds-btn", `dds-btn--${e}`, n)
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function I({ tone: e = "ghost", type: t = "button", className: n, ...r }) {
|
|
383
|
+
return /* @__PURE__ */ s("button", {
|
|
384
|
+
...r,
|
|
385
|
+
type: t,
|
|
386
|
+
className: P("dds-iconbtn", e !== "ghost" && `dds-iconbtn--${e}`, n)
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function L({ name: e, size: t = 24, className: n, ...r }) {
|
|
390
|
+
let i = u[e];
|
|
391
|
+
return /* @__PURE__ */ s("svg", {
|
|
392
|
+
...r,
|
|
393
|
+
viewBox: i.viewBox,
|
|
394
|
+
width: t,
|
|
395
|
+
height: t,
|
|
396
|
+
fill: "none",
|
|
397
|
+
stroke: "currentColor",
|
|
398
|
+
strokeWidth: i.strokeWidth,
|
|
399
|
+
strokeLinecap: "round",
|
|
400
|
+
strokeLinejoin: "round",
|
|
401
|
+
"aria-hidden": "true",
|
|
402
|
+
className: P(l.mirrorInRtl.includes(e) && l.cssClass, n) || void 0,
|
|
403
|
+
children: /* @__PURE__ */ s("g", { dangerouslySetInnerHTML: { __html: i.body } })
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/react/chrome.tsx
|
|
408
|
+
var R = [
|
|
409
|
+
"system",
|
|
410
|
+
"light",
|
|
411
|
+
"dark"
|
|
412
|
+
];
|
|
413
|
+
function z(e) {
|
|
414
|
+
let n = e.storageKey ?? "site-theme", [r, a] = i(e.defaultValue ?? "system"), [o, c] = i("light"), l = o === "dark" ? "light" : "dark", u = l === "dark" ? e.messages.themeDark : e.messages.themeLight, d = (e) => {
|
|
415
|
+
let t = e === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
|
|
416
|
+
c(t), document.documentElement.dataset.theme = t, document.documentElement.dataset.themePreference = e;
|
|
417
|
+
}, f = (t) => {
|
|
418
|
+
e.value === void 0 && a(t), e.onValueChange?.(t), d(t), localStorage.setItem(n, t);
|
|
419
|
+
};
|
|
420
|
+
t(() => {
|
|
421
|
+
let t = localStorage.getItem(n), i = t && R.includes(t) ? t : null;
|
|
422
|
+
e.value === void 0 && i && a(i), d(e.value ?? i ?? r);
|
|
423
|
+
}, []);
|
|
424
|
+
let p = l === "dark" ? "site-moon" : "site-sun";
|
|
425
|
+
return /* @__PURE__ */ s(I, {
|
|
426
|
+
className: "site-theme-toggle",
|
|
427
|
+
tone: "ghost",
|
|
428
|
+
"aria-label": `${e.messages.themeLabel}: ${u}`,
|
|
429
|
+
title: `${e.messages.themeLabel}: ${u}`,
|
|
430
|
+
onClick: () => f(l),
|
|
431
|
+
children: /* @__PURE__ */ s(L, {
|
|
432
|
+
className: "site-theme-toggle__icon",
|
|
433
|
+
name: p,
|
|
434
|
+
"data-icon": p,
|
|
435
|
+
size: 20
|
|
436
|
+
})
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
var B = (e) => e.emphasis ? "site-link--emphasis" : void 0;
|
|
440
|
+
function V(e) {
|
|
441
|
+
let [t, n] = i(!1), r = (e) => {
|
|
442
|
+
e.key !== "Escape" || e.defaultPrevented || !t || e.target?.closest("[aria-modal=\"true\"]") || (e.preventDefault(), n(!1), e.currentTarget.querySelector(".site-menu-button")?.focus());
|
|
443
|
+
}, a = (e) => {
|
|
444
|
+
let r = e.target?.closest("a");
|
|
445
|
+
!t || !r || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || r.target && r.target !== "_self" || n(!1);
|
|
446
|
+
}, o = String(t);
|
|
447
|
+
return /* @__PURE__ */ c("header", {
|
|
448
|
+
className: "site-header",
|
|
449
|
+
onKeyDown: r,
|
|
450
|
+
children: [/* @__PURE__ */ s("a", {
|
|
451
|
+
className: "dds-sr-only",
|
|
452
|
+
href: "#main-content",
|
|
453
|
+
children: e.messages.skipToContent
|
|
454
|
+
}), /* @__PURE__ */ c("div", {
|
|
455
|
+
className: "site-header__inner",
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ c("a", {
|
|
458
|
+
className: "site-brand",
|
|
459
|
+
href: e.brand.href,
|
|
460
|
+
"aria-label": e.brand.label,
|
|
461
|
+
children: [e.brand.logo, e.brand.name]
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ s(F, {
|
|
464
|
+
className: "site-menu-button",
|
|
465
|
+
tone: "ghost",
|
|
466
|
+
"aria-expanded": t,
|
|
467
|
+
"aria-controls": "site-navigation",
|
|
468
|
+
onClick: () => n((e) => !e),
|
|
469
|
+
children: t ? e.messages.menuClose : e.messages.menuOpen
|
|
470
|
+
}),
|
|
471
|
+
/* @__PURE__ */ s("nav", {
|
|
472
|
+
id: "site-navigation",
|
|
473
|
+
className: "site-nav",
|
|
474
|
+
"data-open": o,
|
|
475
|
+
"aria-label": e.messages.navigationLabel,
|
|
476
|
+
onClick: a,
|
|
477
|
+
children: /* @__PURE__ */ s("ul", {
|
|
478
|
+
className: "site-nav__list",
|
|
479
|
+
children: e.navigation.map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s("a", {
|
|
480
|
+
className: B(e),
|
|
481
|
+
href: e.href,
|
|
482
|
+
target: e.external ? "_blank" : void 0,
|
|
483
|
+
rel: e.external ? "noreferrer" : void 0,
|
|
484
|
+
children: e.label
|
|
485
|
+
}) }, e.href))
|
|
486
|
+
})
|
|
487
|
+
}),
|
|
488
|
+
/* @__PURE__ */ c("div", {
|
|
489
|
+
className: "site-header__controls",
|
|
490
|
+
"data-open": o,
|
|
491
|
+
onClick: a,
|
|
492
|
+
children: [
|
|
493
|
+
e.locale && /* @__PURE__ */ s(M, {
|
|
494
|
+
state: e.locale,
|
|
495
|
+
messages: e.messages,
|
|
496
|
+
...e.localeVariant ? { variant: e.localeVariant } : {},
|
|
497
|
+
...e.localeRegistry ? { registry: e.localeRegistry } : {},
|
|
498
|
+
...e.onLocaleChange ? { onLocaleChange: e.onLocaleChange } : {}
|
|
499
|
+
}),
|
|
500
|
+
e.theme && /* @__PURE__ */ s(z, {
|
|
501
|
+
...e.theme,
|
|
502
|
+
messages: e.messages
|
|
503
|
+
}),
|
|
504
|
+
e.actions
|
|
505
|
+
]
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
})]
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
function H(e) {
|
|
512
|
+
let t = r(null), n = r(null), i = e.registry.LOCALES.find((t) => t.code === e.state.locale), a = (e) => {
|
|
513
|
+
e.key !== "Escape" || !t.current?.open || (e.preventDefault(), t.current.open = !1, n.current?.focus());
|
|
514
|
+
}, o = i?.nativeName ?? e.state.locale;
|
|
515
|
+
return /* @__PURE__ */ s("nav", {
|
|
516
|
+
className: "site-footer__langs",
|
|
517
|
+
"aria-label": e.label,
|
|
518
|
+
children: /* @__PURE__ */ c("details", {
|
|
519
|
+
ref: t,
|
|
520
|
+
className: "site-footer__langs-menu",
|
|
521
|
+
onKeyDown: a,
|
|
522
|
+
children: [/* @__PURE__ */ s("summary", {
|
|
523
|
+
ref: n,
|
|
524
|
+
className: "site-footer__langs-trigger",
|
|
525
|
+
"aria-label": `${e.label}: ${o}`,
|
|
526
|
+
children: /* @__PURE__ */ s("span", {
|
|
527
|
+
lang: i?.code,
|
|
528
|
+
dir: i?.dir,
|
|
529
|
+
children: o
|
|
530
|
+
})
|
|
531
|
+
}), /* @__PURE__ */ s("ul", {
|
|
532
|
+
className: "site-footer__langs-list",
|
|
533
|
+
role: "list",
|
|
534
|
+
children: e.registry.LOCALES.map((t) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s("a", {
|
|
535
|
+
href: x(e.state, t.code),
|
|
536
|
+
hrefLang: t.code,
|
|
537
|
+
lang: t.code,
|
|
538
|
+
dir: t.dir,
|
|
539
|
+
"aria-current": t.code === e.state.locale ? "page" : void 0,
|
|
540
|
+
onClick: () => e.onSelect?.(t.code),
|
|
541
|
+
children: t.nativeName
|
|
542
|
+
}) }, t.code))
|
|
543
|
+
})]
|
|
544
|
+
})
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
function U(t) {
|
|
548
|
+
let n = t.localeRegistry ?? g, r = /* @__PURE__ */ c("p", {
|
|
549
|
+
className: "site-footer__brand",
|
|
550
|
+
children: [
|
|
551
|
+
t.brand.logo,
|
|
552
|
+
t.brand.name ? /* @__PURE__ */ s("strong", { children: t.brand.name }) : null,
|
|
553
|
+
(t.family ?? []).map((t) => /* @__PURE__ */ c(e, { children: [/* @__PURE__ */ s("span", {
|
|
554
|
+
"aria-hidden": "true",
|
|
555
|
+
children: "·"
|
|
556
|
+
}), /* @__PURE__ */ s("a", {
|
|
557
|
+
className: B(t),
|
|
558
|
+
href: t.href,
|
|
559
|
+
children: t.label
|
|
560
|
+
})] }, t.href))
|
|
561
|
+
]
|
|
562
|
+
}), i = /* @__PURE__ */ c("ul", {
|
|
563
|
+
className: "site-footer__links",
|
|
564
|
+
children: [
|
|
565
|
+
t.links.map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s("a", {
|
|
566
|
+
className: B(e),
|
|
567
|
+
href: e.href,
|
|
568
|
+
children: e.label
|
|
569
|
+
}) }, e.href)),
|
|
570
|
+
t.consentSettings && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(N, {
|
|
571
|
+
controller: t.consentSettings.controller,
|
|
572
|
+
children: t.consentSettings.label
|
|
573
|
+
}) }),
|
|
574
|
+
/* @__PURE__ */ s("li", { children: t.copyrightHref ? /* @__PURE__ */ s("a", {
|
|
575
|
+
href: t.copyrightHref,
|
|
576
|
+
children: /* @__PURE__ */ s("bdi", { children: t.copyright })
|
|
577
|
+
}) : /* @__PURE__ */ s("bdi", { children: t.copyright }) })
|
|
578
|
+
]
|
|
579
|
+
});
|
|
580
|
+
return /* @__PURE__ */ s("footer", {
|
|
581
|
+
className: "site-footer",
|
|
582
|
+
"aria-label": t.messages.footerLabel,
|
|
583
|
+
children: /* @__PURE__ */ c("div", {
|
|
584
|
+
className: "site-footer__inner",
|
|
585
|
+
children: [t.locale && /* @__PURE__ */ s(H, {
|
|
586
|
+
state: t.locale,
|
|
587
|
+
registry: n,
|
|
588
|
+
label: t.messages.localeLabel,
|
|
589
|
+
onSelect: t.onLocaleSelect
|
|
590
|
+
}), /* @__PURE__ */ c("div", {
|
|
591
|
+
className: "site-footer__row",
|
|
592
|
+
children: [t.details ? /* @__PURE__ */ c("div", {
|
|
593
|
+
className: "site-footer__identity",
|
|
594
|
+
children: [r, /* @__PURE__ */ s("div", {
|
|
595
|
+
className: "site-footer__details",
|
|
596
|
+
children: t.details
|
|
597
|
+
})]
|
|
598
|
+
}) : r, t.linksLabel ? /* @__PURE__ */ s("nav", {
|
|
599
|
+
className: "site-footer__nav",
|
|
600
|
+
"aria-label": t.linksLabel,
|
|
601
|
+
children: i
|
|
602
|
+
}) : i]
|
|
603
|
+
})]
|
|
604
|
+
})
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/react/layouts.tsx
|
|
609
|
+
function W(e) {
|
|
610
|
+
let t = e.mainWidth === "bleed" ? "site-main site-main--bleed" : "site-main";
|
|
611
|
+
return /* @__PURE__ */ c("div", {
|
|
612
|
+
className: "site-shell",
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ s(V, { ...e.header }),
|
|
615
|
+
/* @__PURE__ */ s("main", {
|
|
616
|
+
id: "main-content",
|
|
617
|
+
className: t,
|
|
618
|
+
tabIndex: -1,
|
|
619
|
+
children: e.children
|
|
620
|
+
}),
|
|
621
|
+
/* @__PURE__ */ s(U, { ...e.footer })
|
|
622
|
+
]
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
function G(e) {
|
|
626
|
+
return /* @__PURE__ */ c("article", {
|
|
627
|
+
className: "site-legal",
|
|
628
|
+
children: [/* @__PURE__ */ c("header", { children: [/* @__PURE__ */ s("h1", { children: e.title }), /* @__PURE__ */ c("p", { children: [
|
|
629
|
+
e.messages.updatedLabel,
|
|
630
|
+
": ",
|
|
631
|
+
/* @__PURE__ */ s("time", {
|
|
632
|
+
dateTime: e.updatedAt,
|
|
633
|
+
children: e.updatedAt
|
|
634
|
+
})
|
|
635
|
+
] })] }), e.children]
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
function K(e) {
|
|
639
|
+
return /* @__PURE__ */ c("section", {
|
|
640
|
+
className: `site-status site-status--${e.tone}`,
|
|
641
|
+
role: e.tone === "danger" ? "alert" : "status",
|
|
642
|
+
"aria-live": e.tone === "danger" ? "assertive" : "polite",
|
|
643
|
+
children: [
|
|
644
|
+
/* @__PURE__ */ s("strong", { children: e.title }),
|
|
645
|
+
e.children ? /* @__PURE__ */ s("div", { children: e.children }) : null,
|
|
646
|
+
e.action && /* @__PURE__ */ s(F, {
|
|
647
|
+
tone: e.action.tone ?? "secondary",
|
|
648
|
+
onClick: e.action.onClick,
|
|
649
|
+
children: e.action.label
|
|
650
|
+
})
|
|
651
|
+
]
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
function q(e) {
|
|
655
|
+
return /* @__PURE__ */ c("main", {
|
|
656
|
+
className: "site-main site-centered-layout",
|
|
657
|
+
children: [
|
|
658
|
+
/* @__PURE__ */ s("h1", { children: e.messages.notFoundTitle }),
|
|
659
|
+
/* @__PURE__ */ s("p", { children: e.messages.notFoundDescription }),
|
|
660
|
+
e.children,
|
|
661
|
+
/* @__PURE__ */ s("a", {
|
|
662
|
+
className: "dds-btn dds-btn--primary",
|
|
663
|
+
href: e.homeHref,
|
|
664
|
+
children: e.messages.backHome
|
|
665
|
+
})
|
|
666
|
+
]
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
function J(e) {
|
|
670
|
+
return /* @__PURE__ */ c("main", {
|
|
671
|
+
className: "site-main site-centered-layout",
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ s("h1", { children: e.messages.errorTitle }),
|
|
674
|
+
/* @__PURE__ */ s("p", { children: e.messages.errorDescription }),
|
|
675
|
+
e.errorId && /* @__PURE__ */ s("code", { children: e.errorId }),
|
|
676
|
+
e.children,
|
|
677
|
+
/* @__PURE__ */ s(F, {
|
|
678
|
+
tone: "primary",
|
|
679
|
+
onClick: e.onRetry,
|
|
680
|
+
children: e.messages.retry
|
|
681
|
+
})
|
|
682
|
+
]
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/react/oss-product-mark.tsx
|
|
687
|
+
var Y = {
|
|
688
|
+
sm: 24,
|
|
689
|
+
md: 32,
|
|
690
|
+
lg: 48
|
|
691
|
+
};
|
|
692
|
+
function X(e) {
|
|
693
|
+
let t = e.size ?? "md", n = Y[t];
|
|
694
|
+
return /* @__PURE__ */ s("img", {
|
|
695
|
+
className: `oss-product-mark oss-product-mark--${t}${e.className ? ` ${e.className}` : ""}`,
|
|
696
|
+
src: e.src,
|
|
697
|
+
alt: e.decorative ? "" : e.name,
|
|
698
|
+
"aria-hidden": e.decorative ? "true" : void 0,
|
|
699
|
+
width: n,
|
|
700
|
+
height: n,
|
|
701
|
+
decoding: "async"
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region src/react/sections.tsx
|
|
706
|
+
function Z(e) {
|
|
707
|
+
return /* @__PURE__ */ s("section", {
|
|
708
|
+
className: "site-section",
|
|
709
|
+
id: e.id,
|
|
710
|
+
"data-tone": e.tone ?? "default",
|
|
711
|
+
"aria-labelledby": e.labelledBy,
|
|
712
|
+
children: /* @__PURE__ */ s("div", {
|
|
713
|
+
className: "site-section__shell",
|
|
714
|
+
children: e.children
|
|
715
|
+
})
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
function Q(e) {
|
|
719
|
+
return /* @__PURE__ */ c("header", {
|
|
720
|
+
className: "site-section__head",
|
|
721
|
+
children: [
|
|
722
|
+
/* @__PURE__ */ s("p", {
|
|
723
|
+
className: "site-section__index",
|
|
724
|
+
"aria-hidden": "true",
|
|
725
|
+
children: e.index
|
|
726
|
+
}),
|
|
727
|
+
/* @__PURE__ */ s("h2", {
|
|
728
|
+
id: e.titleId,
|
|
729
|
+
children: e.title
|
|
730
|
+
}),
|
|
731
|
+
e.lede ? /* @__PURE__ */ s("p", {
|
|
732
|
+
className: "site-section__lede",
|
|
733
|
+
children: e.lede
|
|
734
|
+
}) : null
|
|
735
|
+
]
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
function $(e) {
|
|
739
|
+
return /* @__PURE__ */ s("section", {
|
|
740
|
+
id: e.id,
|
|
741
|
+
className: "site-hero",
|
|
742
|
+
"aria-labelledby": e.titleId,
|
|
743
|
+
children: /* @__PURE__ */ c("div", {
|
|
744
|
+
className: "site-hero__shell",
|
|
745
|
+
children: [/* @__PURE__ */ c("div", {
|
|
746
|
+
className: "site-hero__copy",
|
|
747
|
+
children: [
|
|
748
|
+
e.eyebrow ? /* @__PURE__ */ s("p", {
|
|
749
|
+
className: "site-hero__eyebrow",
|
|
750
|
+
children: e.eyebrow
|
|
751
|
+
}) : null,
|
|
752
|
+
/* @__PURE__ */ s("h1", {
|
|
753
|
+
id: e.titleId,
|
|
754
|
+
children: e.title
|
|
755
|
+
}),
|
|
756
|
+
/* @__PURE__ */ s("p", {
|
|
757
|
+
className: "site-hero__lede",
|
|
758
|
+
children: e.lede
|
|
759
|
+
}),
|
|
760
|
+
/* @__PURE__ */ s("div", {
|
|
761
|
+
className: "site-hero__actions",
|
|
762
|
+
children: e.actions
|
|
763
|
+
})
|
|
764
|
+
]
|
|
765
|
+
}), /* @__PURE__ */ s("figure", {
|
|
766
|
+
className: "site-hero__aside",
|
|
767
|
+
"aria-label": e.asideLabel,
|
|
768
|
+
children: e.aside
|
|
769
|
+
})]
|
|
770
|
+
})
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
function re(e) {
|
|
774
|
+
return /* @__PURE__ */ s("ol", {
|
|
775
|
+
className: "site-steps",
|
|
776
|
+
"aria-label": e.label,
|
|
777
|
+
children: e.steps.map((e, t) => /* @__PURE__ */ c("li", {
|
|
778
|
+
className: "site-steps__step",
|
|
779
|
+
children: [
|
|
780
|
+
/* @__PURE__ */ s("span", {
|
|
781
|
+
className: "site-steps__marker",
|
|
782
|
+
"aria-hidden": "true",
|
|
783
|
+
children: t + 1
|
|
784
|
+
}),
|
|
785
|
+
/* @__PURE__ */ s("h3", { children: e.title }),
|
|
786
|
+
/* @__PURE__ */ s("p", { children: e.body })
|
|
787
|
+
]
|
|
788
|
+
}, t))
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
function ie(e) {
|
|
792
|
+
return /* @__PURE__ */ s("ul", {
|
|
793
|
+
className: "site-rows",
|
|
794
|
+
"aria-label": e.label,
|
|
795
|
+
children: e.rows.map((e, t) => /* @__PURE__ */ c("li", {
|
|
796
|
+
className: "site-rows__row",
|
|
797
|
+
children: [/* @__PURE__ */ c("div", {
|
|
798
|
+
className: "site-rows__title",
|
|
799
|
+
children: [/* @__PURE__ */ s("h3", { children: e.title }), e.badge ? /* @__PURE__ */ s("span", {
|
|
800
|
+
className: "dds-badge dds-badge--brand",
|
|
801
|
+
children: e.badge
|
|
802
|
+
}) : null]
|
|
803
|
+
}), /* @__PURE__ */ s("p", {
|
|
804
|
+
className: "site-rows__body",
|
|
805
|
+
children: e.body
|
|
806
|
+
})]
|
|
807
|
+
}, t))
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
function ae(e) {
|
|
811
|
+
return /* @__PURE__ */ c("div", {
|
|
812
|
+
className: "site-pricing",
|
|
813
|
+
children: [/* @__PURE__ */ s("div", {
|
|
814
|
+
className: "site-pricing__note",
|
|
815
|
+
children: e.children
|
|
816
|
+
}), /* @__PURE__ */ s("div", {
|
|
817
|
+
className: "site-pricing__action",
|
|
818
|
+
children: e.action
|
|
819
|
+
})]
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
//#endregion
|
|
823
|
+
export { N as ConsentSettingsButton, J as ErrorLayout, ie as FeatureRows, $ as HeroSplit, G as LegalLayout, M as LocaleMenu, W as MarketingShell, q as NotFoundLayout, X as OssProductMark, ae as PricingNote, Z as SectionBlock, Q as SectionHead, U as SiteFooter, V as SiteHeader, K as StatusBanner, re as StepFlow, z as ThemeToggle };
|
|
824
|
+
|
|
825
|
+
//# sourceMappingURL=index.js.map
|