@sovereignsquad/gds-core 3.9.0 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +33 -0
  2. package/dist/GdsBadge-DqTdnomt.d.mts +417 -0
  3. package/dist/GdsBadge-DqTdnomt.d.ts +417 -0
  4. package/dist/PartnerDiscovery-As_-JKtb.d.ts +732 -0
  5. package/dist/PartnerDiscovery-Bwxixtka.d.mts +732 -0
  6. package/dist/QuickStartCard-Bgjdfs_t.d.ts +20798 -0
  7. package/dist/QuickStartCard-DnZMDjzb.d.mts +20798 -0
  8. package/dist/chunk-3B5MK2PG.mjs +6349 -0
  9. package/dist/{chunk-TQ7ZYMEA.mjs → chunk-5G3XZWSW.mjs} +4916 -6400
  10. package/dist/chunk-5GH7XD7X.mjs +430 -0
  11. package/dist/chunk-6WDH57MJ.mjs +430 -0
  12. package/dist/chunk-A32PWTD2.mjs +430 -0
  13. package/dist/chunk-BD5XQH5Z.mjs +430 -0
  14. package/dist/chunk-DBJE4TRO.mjs +430 -0
  15. package/dist/chunk-EQ7Y2PUI.mjs +1842 -0
  16. package/dist/chunk-F76YTG3S.mjs +430 -0
  17. package/dist/chunk-HJVDKPVW.mjs +245 -0
  18. package/dist/chunk-IMT3UTOT.mjs +430 -0
  19. package/dist/chunk-J66ITCXC.mjs +473 -0
  20. package/dist/chunk-KEYBUMOR.mjs +430 -0
  21. package/dist/chunk-KLFTBWEG.mjs +430 -0
  22. package/dist/chunk-KNP35WAB.mjs +27 -0
  23. package/dist/chunk-LERXSJHD.mjs +430 -0
  24. package/dist/chunk-MKEWYVTJ.mjs +430 -0
  25. package/dist/chunk-NTNVQZJU.mjs +89 -0
  26. package/dist/chunk-OH5HH4G3.mjs +430 -0
  27. package/dist/chunk-SPPTDVJC.mjs +211 -0
  28. package/dist/chunk-W5O2JSVK.mjs +20 -0
  29. package/dist/{chunk-BUC7QXRO.mjs → chunk-WI24JME4.mjs} +13 -5
  30. package/dist/chunk-ZFGYQSNR.mjs +33 -0
  31. package/dist/client.d.mts +1616 -64
  32. package/dist/client.d.ts +1616 -64
  33. package/dist/client.js +13417 -6683
  34. package/dist/client.mjs +303 -60
  35. package/dist/en-D9CWSH3F.d.mts +428 -0
  36. package/dist/en-D9CWSH3F.d.ts +428 -0
  37. package/dist/index.d.mts +632 -5
  38. package/dist/index.d.ts +632 -5
  39. package/dist/index.js +22423 -13558
  40. package/dist/index.mjs +2198 -61
  41. package/dist/locales/lazy/all.d.mts +2 -0
  42. package/dist/locales/lazy/all.d.ts +2 -0
  43. package/dist/locales/lazy/all.js +5150 -0
  44. package/dist/locales/lazy/all.mjs +50 -0
  45. package/dist/locales/lazy/ar.d.mts +2 -0
  46. package/dist/locales/lazy/ar.d.ts +2 -0
  47. package/dist/locales/lazy/ar.js +870 -0
  48. package/dist/locales/lazy/ar.mjs +10 -0
  49. package/dist/locales/lazy/de.d.mts +2 -0
  50. package/dist/locales/lazy/de.d.ts +2 -0
  51. package/dist/locales/lazy/de.js +870 -0
  52. package/dist/locales/lazy/de.mjs +10 -0
  53. package/dist/locales/lazy/es.d.mts +2 -0
  54. package/dist/locales/lazy/es.d.ts +2 -0
  55. package/dist/locales/lazy/es.js +870 -0
  56. package/dist/locales/lazy/es.mjs +10 -0
  57. package/dist/locales/lazy/fr.d.mts +2 -0
  58. package/dist/locales/lazy/fr.d.ts +2 -0
  59. package/dist/locales/lazy/fr.js +870 -0
  60. package/dist/locales/lazy/fr.mjs +10 -0
  61. package/dist/locales/lazy/he.d.mts +2 -0
  62. package/dist/locales/lazy/he.d.ts +2 -0
  63. package/dist/locales/lazy/he.js +870 -0
  64. package/dist/locales/lazy/he.mjs +10 -0
  65. package/dist/locales/lazy/hu.d.mts +2 -0
  66. package/dist/locales/lazy/hu.d.ts +2 -0
  67. package/dist/locales/lazy/hu.js +870 -0
  68. package/dist/locales/lazy/hu.mjs +10 -0
  69. package/dist/locales/lazy/index.d.mts +25 -0
  70. package/dist/locales/lazy/index.d.ts +25 -0
  71. package/dist/locales/lazy/index.js +479 -0
  72. package/dist/locales/lazy/index.mjs +9 -0
  73. package/dist/locales/lazy/it.d.mts +2 -0
  74. package/dist/locales/lazy/it.d.ts +2 -0
  75. package/dist/locales/lazy/it.js +870 -0
  76. package/dist/locales/lazy/it.mjs +10 -0
  77. package/dist/locales/lazy/ja.d.mts +2 -0
  78. package/dist/locales/lazy/ja.d.ts +2 -0
  79. package/dist/locales/lazy/ja.js +870 -0
  80. package/dist/locales/lazy/ja.mjs +10 -0
  81. package/dist/locales/lazy/ko.d.mts +2 -0
  82. package/dist/locales/lazy/ko.d.ts +2 -0
  83. package/dist/locales/lazy/ko.js +870 -0
  84. package/dist/locales/lazy/ko.mjs +10 -0
  85. package/dist/locales/lazy/ru.d.mts +2 -0
  86. package/dist/locales/lazy/ru.d.ts +2 -0
  87. package/dist/locales/lazy/ru.js +870 -0
  88. package/dist/locales/lazy/ru.mjs +10 -0
  89. package/dist/locales/lazy/zh.d.mts +2 -0
  90. package/dist/locales/lazy/zh.d.ts +2 -0
  91. package/dist/locales/lazy/zh.js +870 -0
  92. package/dist/locales/lazy/zh.mjs +10 -0
  93. package/dist/map.css +658 -0
  94. package/dist/map.d.mts +118 -0
  95. package/dist/map.d.ts +118 -0
  96. package/dist/map.js +778 -0
  97. package/dist/map.mjs +395 -0
  98. package/dist/reference-theme-explorer.d.mts +34 -0
  99. package/dist/reference-theme-explorer.d.ts +34 -0
  100. package/dist/reference-theme-explorer.js +9488 -0
  101. package/dist/reference-theme-explorer.mjs +1988 -0
  102. package/dist/rich-text-editor.d.mts +32 -0
  103. package/dist/rich-text-editor.d.ts +32 -0
  104. package/dist/rich-text-editor.js +469 -0
  105. package/dist/rich-text-editor.mjs +115 -0
  106. package/dist/server.d.mts +112 -248
  107. package/dist/server.d.ts +112 -248
  108. package/dist/server.js +8461 -1889
  109. package/dist/server.mjs +598 -57
  110. package/package.json +110 -10
  111. package/dist/AISearchCard-Bbnsd-yl.d.mts +0 -7786
  112. package/dist/AISearchCard-Bbnsd-yl.d.ts +0 -7786
  113. package/dist/chunk-5AJJNRZF.mjs +0 -5847
@@ -0,0 +1,245 @@
1
+ import {
2
+ GdsBadge,
3
+ GdsChart,
4
+ gdsGeneratedPaletteCssRefs,
5
+ gdsSeededRandom
6
+ } from "./chunk-EQ7Y2PUI.mjs";
7
+ import {
8
+ GdsIcon
9
+ } from "./chunk-J66ITCXC.mjs";
10
+
11
+ // src/GdsAccentContrastMatrix.tsx
12
+ import { useMemo } from "react";
13
+ import { Group, Stack, Table, Text } from "@mantine/core";
14
+ import {
15
+ GDS_ACCENT_MODES,
16
+ GDS_ACCENT_MODE_ENFORCEMENT,
17
+ GDS_ACCENT_NAMES,
18
+ GDS_ACCENT_SHADES,
19
+ evaluateGdsAccentContrast,
20
+ getGdsVibeThemeCssVariables
21
+ } from "@sovereignsquad/gds-theme";
22
+ import { jsx, jsxs } from "react/jsx-runtime";
23
+ function ResultCell({ result }) {
24
+ const enforced = result.enforced;
25
+ const failing = enforced && !result.passes;
26
+ return /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: "4px", wrap: "nowrap", align: "center", children: [
27
+ /* @__PURE__ */ jsx(GdsIcon, { icon: failing ? "Danger" : enforced ? "Success" : "Info", size: "xs", "aria-hidden": true }),
28
+ /* @__PURE__ */ jsxs(Text, { size: "sm", fw: failing ? 600 : 400, children: [
29
+ result.ratio,
30
+ ":1",
31
+ /* @__PURE__ */ jsxs(Text, { component: "span", size: "xs", c: "dimmed", children: [
32
+ " / ",
33
+ result.required
34
+ ] })
35
+ ] })
36
+ ] }) });
37
+ }
38
+ function GdsAccentContrastMatrix({ preset, colorScheme, title }) {
39
+ const results = useMemo(() => {
40
+ const light = getGdsVibeThemeCssVariables(preset, "light");
41
+ const dark = getGdsVibeThemeCssVariables(preset, "dark");
42
+ return evaluateGdsAccentContrast(void 0, { light: light["--gds-bg-page"], dark: dark["--gds-bg-page"] }, preset).filter((r) => r.scheme === colorScheme);
43
+ }, [preset, colorScheme]);
44
+ const byKey = useMemo(() => {
45
+ const map = /* @__PURE__ */ new Map();
46
+ for (const r of results) map.set(`${r.accent}:${r.shade}:${r.mode}`, r);
47
+ return map;
48
+ }, [results]);
49
+ const enforcedFailures = results.filter((r) => r.enforced && !r.passes).length;
50
+ const caption = `Accent contrast for ${preset} in ${colorScheme} mode: ${results.filter((r) => r.enforced).length} enforced combinations, ${enforcedFailures} failing.`;
51
+ return /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
52
+ title ? /* @__PURE__ */ jsx(Text, { fw: 600, children: title }) : null,
53
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
54
+ /* @__PURE__ */ jsx(
55
+ GdsBadge,
56
+ {
57
+ tone: enforcedFailures ? "danger" : "success",
58
+ icon: enforcedFailures ? "Danger" : "Success",
59
+ label: enforcedFailures ? `${enforcedFailures} enforced failing` : "All enforced combinations pass"
60
+ }
61
+ ),
62
+ GDS_ACCENT_MODES.filter((m) => !GDS_ACCENT_MODE_ENFORCEMENT[m].enforced).map((m) => /* @__PURE__ */ jsx(GdsBadge, { tone: "info", icon: "Info", label: `${m}: measured, not enforced` }, m))
63
+ ] }),
64
+ /* @__PURE__ */ jsx(Table.ScrollContainer, { minWidth: 640, children: /* @__PURE__ */ jsxs(Table, { striped: true, withTableBorder: true, children: [
65
+ /* @__PURE__ */ jsx(Table.Caption, { children: caption }),
66
+ /* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
67
+ /* @__PURE__ */ jsx(Table.Th, { scope: "col", children: "Accent" }),
68
+ GDS_ACCENT_SHADES.flatMap((shade) => GDS_ACCENT_MODES.map((mode) => /* @__PURE__ */ jsxs(Table.Th, { scope: "col", children: [
69
+ /* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, children: shade }),
70
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
71
+ mode,
72
+ GDS_ACCENT_MODE_ENFORCEMENT[mode].enforced ? "" : " *"
73
+ ] })
74
+ ] }, `${shade}-${mode}`)))
75
+ ] }) }),
76
+ /* @__PURE__ */ jsx(Table.Tbody, { children: GDS_ACCENT_NAMES.map((accent) => /* @__PURE__ */ jsxs(Table.Tr, { children: [
77
+ /* @__PURE__ */ jsx(Table.Th, { scope: "row", children: accent }),
78
+ GDS_ACCENT_SHADES.flatMap((shade) => GDS_ACCENT_MODES.map((mode) => {
79
+ const result = byKey.get(`${accent}:${shade}:${mode}`);
80
+ return result ? /* @__PURE__ */ jsx(ResultCell, { result }, `${shade}-${mode}`) : /* @__PURE__ */ jsx(Table.Td, { children: "\u2014" }, `${shade}-${mode}`);
81
+ }))
82
+ ] }, accent)) })
83
+ ] }) }),
84
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
85
+ "* measured but not enforced.",
86
+ " ",
87
+ GDS_ACCENT_MODES.filter((m) => !GDS_ACCENT_MODE_ENFORCEMENT[m].enforced).map((m) => `${m}: ${GDS_ACCENT_MODE_ENFORCEMENT[m].reason}`).join(" ")
88
+ ] })
89
+ ] });
90
+ }
91
+
92
+ // src/GdsGeneratedMark.tsx
93
+ import { useId, useMemo as useMemo2 } from "react";
94
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
95
+ var isIconKey = (icon) => typeof icon === "string";
96
+ function GdsGeneratedMark({
97
+ seed,
98
+ icon,
99
+ label,
100
+ size = "3em",
101
+ paletteSource,
102
+ category,
103
+ shade,
104
+ colors,
105
+ className,
106
+ style
107
+ }) {
108
+ const gradientId = useId();
109
+ const palette = useMemo2(
110
+ () => gdsGeneratedPaletteCssRefs({ paletteSource, category, shade, colors }),
111
+ [paletteSource, category, shade, colors]
112
+ );
113
+ const tilt = useMemo2(() => Math.round((gdsSeededRandom(seed)() - 0.5) * 40), [seed]);
114
+ return /* @__PURE__ */ jsxs2(
115
+ "span",
116
+ {
117
+ "data-gds-generated-mark": "",
118
+ role: label ? "img" : void 0,
119
+ "aria-label": label || void 0,
120
+ "aria-hidden": label ? void 0 : true,
121
+ className,
122
+ style: { display: "inline-block", width: size, height: size, borderRadius: "var(--mantine-radius-md, 12px)", overflow: "hidden", ...style },
123
+ children: [
124
+ /* @__PURE__ */ jsxs2("svg", { viewBox: "0 0 48 48", "aria-hidden": "true", style: { display: "block", width: "100%", height: "100%" }, children: [
125
+ /* @__PURE__ */ jsx2("defs", { children: /* @__PURE__ */ jsxs2("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
126
+ /* @__PURE__ */ jsx2("stop", { offset: "0%", stopColor: palette.primary }),
127
+ /* @__PURE__ */ jsx2("stop", { offset: "100%", stopColor: palette.accent })
128
+ ] }) }),
129
+ /* @__PURE__ */ jsx2("rect", { width: "48", height: "48", fill: `url(#${gradientId})` })
130
+ ] }),
131
+ /* @__PURE__ */ jsx2(
132
+ "span",
133
+ {
134
+ "aria-hidden": "true",
135
+ style: {
136
+ position: "relative",
137
+ display: "flex",
138
+ alignItems: "center",
139
+ justifyContent: "center",
140
+ width: "100%",
141
+ height: "100%",
142
+ marginTop: "-100%",
143
+ transform: `rotate(${tilt}deg)`,
144
+ color: "var(--gds-text-on-inverse, var(--mantine-color-white, #ffffff))"
145
+ },
146
+ children: isIconKey(icon) ? /* @__PURE__ */ jsx2(GdsIcon, { icon, size: "55%", tone: "default" }) : icon
147
+ }
148
+ )
149
+ ]
150
+ }
151
+ );
152
+ }
153
+
154
+ // src/GdsDesignRuleProfilePanel.tsx
155
+ import { Group as Group2, Stack as Stack2, Text as Text2 } from "@mantine/core";
156
+ import {
157
+ resolveGdsColorProportionProfile,
158
+ resolveGdsTypeScaleProfile,
159
+ resolveGdsColorHarmonyProfile,
160
+ NAMED_TYPE_SCALE_RATIO_LABELS
161
+ } from "@sovereignsquad/gds-theme";
162
+
163
+ // src/generated-design-rule-coverage.ts
164
+ var designRuleCoverageByPreset = {
165
+ "amber": { dominant: 47.3, secondary: 0, accent: 0, unclassified: 52.7 },
166
+ "athlete-gold": { dominant: 26.6, secondary: 0, accent: 0, unclassified: 73.4 },
167
+ "aurora": { dominant: 47.8, secondary: 0, accent: 0, unclassified: 52.2 },
168
+ "brand": { dominant: 48.4, secondary: 0, accent: 0, unclassified: 51.6 },
169
+ "class-usa": { dominant: 48.2, secondary: 0, accent: 0, unclassified: 51.8 },
170
+ "colorblind-safe": { dominant: 48, secondary: 0, accent: 0, unclassified: 52 },
171
+ "coral": { dominant: 47.9, secondary: 0, accent: 0, unclassified: 52.1 },
172
+ "cosmic": { dominant: 37.2, secondary: 0, accent: 0, unclassified: 62.8 },
173
+ "dark-public": { dominant: 31.6, secondary: 0, accent: 0, unclassified: 68.4 },
174
+ "default": { dominant: 47.5, secondary: 0, accent: 0, unclassified: 52.5 },
175
+ "editorial": { dominant: 48.4, secondary: 0, accent: 0, unclassified: 51.6 },
176
+ "flat-surface": { dominant: 48.4, secondary: 0, accent: 0, unclassified: 51.6 },
177
+ "forest": { dominant: 48.3, secondary: 0, accent: 0, unclassified: 51.7 },
178
+ "gold-athlete": { dominant: 48, secondary: 0, accent: 0, unclassified: 52 },
179
+ "high-contrast": { dominant: 81.3, secondary: 0, accent: 0, unclassified: 18.7 },
180
+ "mint": { dominant: 47.9, secondary: 0, accent: 0, unclassified: 52.1 },
181
+ "neon-night": { dominant: 46.9, secondary: 0, accent: 0, unclassified: 53.1 },
182
+ "oceanic": { dominant: 46.9, secondary: 0, accent: 0, unclassified: 53.1 },
183
+ "orchid": { dominant: 47.6, secondary: 0, accent: 0, unclassified: 52.4 },
184
+ "partner-discovery": { dominant: 48.4, secondary: 0, accent: 0, unclassified: 51.6 },
185
+ "royal": { dominant: 47.1, secondary: 0, accent: 0, unclassified: 52.9 },
186
+ "ruby": { dominant: 48.6, secondary: 0, accent: 0, unclassified: 51.4 },
187
+ "skyline": { dominant: 47.8, secondary: 0, accent: 0, unclassified: 52.2 },
188
+ "sunset": { dominant: 48, secondary: 0, accent: 0, unclassified: 52 },
189
+ "warm": { dominant: 26.4, secondary: 0, accent: 0, unclassified: 73.6 }
190
+ };
191
+
192
+ // src/GdsDesignRuleProfilePanel.tsx
193
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
194
+ function GdsDesignRuleProfilePanel({ preset }) {
195
+ const colorProportion = resolveGdsColorProportionProfile(preset);
196
+ const typeScale = resolveGdsTypeScaleProfile(preset);
197
+ const harmony = resolveGdsColorHarmonyProfile(preset);
198
+ const measured = designRuleCoverageByPreset[preset];
199
+ const declaredData = colorProportion.rule === "60-30-10" ? [
200
+ { label: "Dominant", value: colorProportion.classification.dominant.length },
201
+ { label: "Secondary", value: colorProportion.classification.secondary.length },
202
+ { label: "Accent", value: colorProportion.classification.accent.length }
203
+ ] : [];
204
+ const measuredData = measured ? [
205
+ { label: "Dominant", value: measured.dominant },
206
+ { label: "Secondary", value: measured.secondary },
207
+ { label: "Accent", value: measured.accent },
208
+ { label: "Unclassified", value: measured.unclassified }
209
+ ] : [];
210
+ const declaredSummary = colorProportion.rule === "60-30-10" ? `Declared/intended token-role classification (GH-644) -- ${colorProportion.classification.dominant.length} dominant, ${colorProportion.classification.secondary.length} secondary, and ${colorProportion.classification.accent.length} accent roles for "${preset}". Counts intended usage roles, not measured pixels.` : `Declared/intended token-role classification (GH-644) -- "${preset}" declares no color-proportion rule.`;
211
+ const measuredSummary = measured ? `Measured/rendered pixel-area coverage on the GDS reference site (GH-649) -- ${measured.dominant}% dominant, ${measured.secondary}% secondary, ${measured.accent}% accent, ${measured.unclassified}% unclassified for "${preset}". Reference site only, not a consumer's own app.` : `Measured/rendered pixel-area coverage on the GDS reference site (GH-649) -- no measurement recorded yet for "${preset}".`;
212
+ return /* @__PURE__ */ jsxs3(Stack2, { gap: "md", "data-gds-design-rule-profile-panel": "", children: [
213
+ /* @__PURE__ */ jsx3(Text2, { size: "sm", c: "dimmed", children: 'Declared intent (GH-644) and measured rendered reality (GH-649/GH-650) are two different metrics -- token-role count versus real rendered pixel area -- and can legitimately diverge. Neither is presented as more "correct" than the other.' }),
214
+ /* @__PURE__ */ jsxs3(Group2, { grow: true, align: "flex-start", children: [
215
+ /* @__PURE__ */ jsx3(
216
+ GdsChart,
217
+ {
218
+ type: "donut",
219
+ title: `${preset}: declared role classification`,
220
+ summary: declaredSummary,
221
+ data: declaredData
222
+ }
223
+ ),
224
+ /* @__PURE__ */ jsx3(
225
+ GdsChart,
226
+ {
227
+ type: "donut",
228
+ title: `${preset}: measured rendered proportion`,
229
+ summary: measuredSummary,
230
+ data: measuredData
231
+ }
232
+ )
233
+ ] }),
234
+ /* @__PURE__ */ jsxs3(Group2, { gap: "sm", children: [
235
+ /* @__PURE__ */ jsx3(GdsBadge, { tone: "neutral", label: `Type scale: ${typeScale.ratio} (${NAMED_TYPE_SCALE_RATIO_LABELS[typeScale.ratio]})` }),
236
+ /* @__PURE__ */ jsx3(GdsBadge, { tone: "neutral", label: `Color harmony: ${harmony}` })
237
+ ] })
238
+ ] });
239
+ }
240
+
241
+ export {
242
+ GdsAccentContrastMatrix,
243
+ GdsGeneratedMark,
244
+ GdsDesignRuleProfilePanel
245
+ };