@sovereignsquad/gds-core 6.8.0 → 6.10.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.md +33 -0
- package/dist/{GdsBadge-DqTdnomt.d.mts → GdsBadge-j_kQnIL0.d.mts} +1 -1
- package/dist/{GdsBadge-DqTdnomt.d.ts → GdsBadge-j_kQnIL0.d.ts} +1 -1
- package/dist/{PartnerDiscovery-Bwxixtka.d.mts → PartnerDiscovery-Dy3YnO02.d.mts} +15 -8
- package/dist/{PartnerDiscovery-As_-JKtb.d.ts → PartnerDiscovery-pdJmaKwq.d.ts} +15 -8
- package/dist/{QuickStartCard-CB7r-85z.d.ts → QuickStartCard-BqbYrKRY.d.ts} +4373 -131
- package/dist/{QuickStartCard-xIP1gbCL.d.mts → QuickStartCard-lE9kMqH8.d.mts} +4373 -131
- package/dist/{chunk-QO653DAE.mjs → chunk-7NNKXZFF.mjs} +120 -3
- package/dist/{chunk-GMK5GXWR.mjs → chunk-CWMDWMYL.mjs} +120 -3
- package/dist/{chunk-GGDCO5HR.mjs → chunk-D65VHUXK.mjs} +120 -3
- package/dist/{chunk-JTMPFTCK.mjs → chunk-J4TSXITU.mjs} +120 -3
- package/dist/{chunk-TJ3WMH25.mjs → chunk-LTNPECWV.mjs} +1696 -757
- package/dist/{chunk-BH2SMTND.mjs → chunk-MO5TLIIB.mjs} +1716 -2010
- package/dist/{chunk-VU2JLVD3.mjs → chunk-NTNVQZJU.mjs} +1 -1
- package/dist/{chunk-KFEPREUF.mjs → chunk-PCG34VRY.mjs} +13 -2
- package/dist/{chunk-H2QNW4D5.mjs → chunk-PJR3OJJD.mjs} +912 -212
- package/dist/{chunk-IHPZ7BNV.mjs → chunk-PLJT4I7B.mjs} +164 -47
- package/dist/{chunk-BHR4A3C6.mjs → chunk-RBXAJJB2.mjs} +120 -3
- package/dist/{chunk-MPZFCWWS.mjs → chunk-SPPTDVJC.mjs} +2 -1
- package/dist/{chunk-NWS7KJ2G.mjs → chunk-SV3VL3GG.mjs} +3 -2
- package/dist/{chunk-ZCQXBKDM.mjs → chunk-TD3JPMMO.mjs} +5 -2
- package/dist/{chunk-GKNSUUUE.mjs → chunk-TVGDH5O5.mjs} +120 -3
- package/dist/{chunk-SHQDVHGR.mjs → chunk-V5WUGRFL.mjs} +120 -3
- package/dist/{chunk-4LG6EED4.mjs → chunk-V6SP5O4D.mjs} +147 -30
- package/dist/{chunk-2XZMNT7I.mjs → chunk-XL7MGQJ4.mjs} +120 -3
- package/dist/{chunk-CNTTKK3H.mjs → chunk-YASVRGKJ.mjs} +121 -4
- package/dist/{chunk-6PBDLFSF.mjs → chunk-Z6XXK57E.mjs} +120 -3
- package/dist/client.d.mts +459 -51
- package/dist/client.d.ts +459 -51
- package/dist/client.js +13279 -10520
- package/dist/client.mjs +73 -33
- package/dist/{en-Dd7uvXnv.d.ts → en-CzuiMnTG.d.mts} +119 -2
- package/dist/{en-Dd7uvXnv.d.mts → en-CzuiMnTG.d.ts} +119 -2
- package/dist/index.d.mts +24 -22
- package/dist/index.d.ts +24 -22
- package/dist/index.js +10850 -7951
- package/dist/index.mjs +250 -71
- package/dist/locales/lazy/all.js +5449 -0
- package/dist/locales/lazy/all.mjs +50 -24
- package/dist/locales/lazy/ar.js +244 -7
- package/dist/locales/lazy/ar.mjs +10 -4
- package/dist/locales/lazy/de.js +244 -7
- package/dist/locales/lazy/de.mjs +10 -4
- package/dist/locales/lazy/es.js +244 -7
- package/dist/locales/lazy/es.mjs +10 -4
- package/dist/locales/lazy/fr.js +244 -7
- package/dist/locales/lazy/fr.mjs +10 -4
- package/dist/locales/lazy/he.js +245 -8
- package/dist/locales/lazy/he.mjs +10 -4
- package/dist/locales/lazy/hu.js +244 -7
- package/dist/locales/lazy/hu.mjs +10 -4
- package/dist/locales/lazy/index.d.mts +1 -1
- package/dist/locales/lazy/index.d.ts +1 -1
- package/dist/locales/lazy/index.js +124 -4
- package/dist/locales/lazy/index.mjs +2 -2
- package/dist/locales/lazy/it.js +244 -7
- package/dist/locales/lazy/it.mjs +10 -4
- package/dist/locales/lazy/ja.js +244 -7
- package/dist/locales/lazy/ja.mjs +10 -4
- package/dist/locales/lazy/ko.js +288 -51
- package/dist/locales/lazy/ko.mjs +10 -4
- package/dist/locales/lazy/ru.js +244 -7
- package/dist/locales/lazy/ru.mjs +10 -4
- package/dist/locales/lazy/zh.js +271 -34
- package/dist/locales/lazy/zh.mjs +10 -4
- package/dist/map.css +3 -9
- package/dist/map.d.mts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +2 -1
- package/dist/map.mjs +2 -2
- package/dist/reference-theme-explorer.d.mts +3 -1
- package/dist/reference-theme-explorer.d.ts +3 -1
- package/dist/reference-theme-explorer.js +2607 -509
- package/dist/reference-theme-explorer.mjs +58 -38
- package/dist/server.d.mts +6 -6
- package/dist/server.d.ts +6 -6
- package/dist/server.js +3336 -1513
- package/dist/server.mjs +43 -33
- package/package.json +10 -5
- package/dist/chunk-2AX4NCID.mjs +0 -9
- package/dist/chunk-2IUOZG4C.mjs +0 -9
- package/dist/chunk-3D7BVS7D.mjs +0 -9
- package/dist/chunk-6LULEPIE.mjs +0 -9
- package/dist/chunk-J6MXKFIM.mjs +0 -9
- package/dist/chunk-LNVLXOLI.mjs +0 -9
- package/dist/chunk-MAIU557K.mjs +0 -9
- package/dist/chunk-OC3M4CZY.mjs +0 -9
- package/dist/chunk-RCLWUNMR.mjs +0 -9
- package/dist/chunk-WNOWHB26.mjs +0 -9
- package/dist/chunk-XLPTCIXT.mjs +0 -9
|
@@ -4,47 +4,499 @@ import {
|
|
|
4
4
|
GdsBadgeStackLayer,
|
|
5
5
|
StateBlock,
|
|
6
6
|
resolveSurfacePresentationStyles
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SPPTDVJC.mjs";
|
|
8
8
|
import {
|
|
9
9
|
GdsIcon,
|
|
10
10
|
GdsIcons
|
|
11
11
|
} from "./chunk-J66ITCXC.mjs";
|
|
12
12
|
import {
|
|
13
13
|
ko
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PLJT4I7B.mjs";
|
|
15
15
|
import {
|
|
16
16
|
ru
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RBXAJJB2.mjs";
|
|
18
18
|
import {
|
|
19
19
|
zh
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-V6SP5O4D.mjs";
|
|
21
21
|
import {
|
|
22
22
|
de
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TVGDH5O5.mjs";
|
|
24
24
|
import {
|
|
25
25
|
es
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-J4TSXITU.mjs";
|
|
27
27
|
import {
|
|
28
28
|
fr
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Z6XXK57E.mjs";
|
|
30
30
|
import {
|
|
31
31
|
he
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YASVRGKJ.mjs";
|
|
33
33
|
import {
|
|
34
34
|
hu
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CWMDWMYL.mjs";
|
|
36
36
|
import {
|
|
37
37
|
it
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-V5WUGRFL.mjs";
|
|
39
39
|
import {
|
|
40
40
|
ja
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XL7MGQJ4.mjs";
|
|
42
42
|
import {
|
|
43
43
|
ar
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7NNKXZFF.mjs";
|
|
45
45
|
import {
|
|
46
46
|
en
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-D65VHUXK.mjs";
|
|
48
|
+
|
|
49
|
+
// src/LayoutPrimitives.tsx
|
|
50
|
+
import { forwardRef } from "react";
|
|
51
|
+
import { Box } from "@mantine/core";
|
|
52
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
53
|
+
var breakpointPixels = {
|
|
54
|
+
xs: 480,
|
|
55
|
+
sm: 640,
|
|
56
|
+
md: 768,
|
|
57
|
+
lg: 1024,
|
|
58
|
+
xl: 1280
|
|
59
|
+
};
|
|
60
|
+
var GdsMantineBox = Box;
|
|
61
|
+
var spacingTokenMap = {
|
|
62
|
+
none: "0",
|
|
63
|
+
xs: "var(--mantine-spacing-xs)",
|
|
64
|
+
sm: "var(--mantine-spacing-sm)",
|
|
65
|
+
md: "var(--mantine-spacing-md)",
|
|
66
|
+
lg: "var(--mantine-spacing-lg)",
|
|
67
|
+
xl: "var(--mantine-spacing-xl)",
|
|
68
|
+
"2xl": "calc(var(--mantine-spacing-xl) * 1.5)"
|
|
69
|
+
};
|
|
70
|
+
var sizeTokenMap = {
|
|
71
|
+
none: "0",
|
|
72
|
+
xs: "var(--mantine-spacing-xs)",
|
|
73
|
+
sm: "var(--mantine-spacing-sm)",
|
|
74
|
+
md: "var(--mantine-spacing-md)",
|
|
75
|
+
lg: "var(--mantine-spacing-lg)",
|
|
76
|
+
xl: "var(--mantine-spacing-xl)",
|
|
77
|
+
"2xl": "calc(var(--mantine-spacing-xl) * 1.5)",
|
|
78
|
+
aside: "18rem",
|
|
79
|
+
content: "42rem",
|
|
80
|
+
narrow: "56rem",
|
|
81
|
+
page: "72rem",
|
|
82
|
+
wide: "88rem",
|
|
83
|
+
full: "100%"
|
|
84
|
+
};
|
|
85
|
+
var alignMap = {
|
|
86
|
+
start: "flex-start",
|
|
87
|
+
center: "center",
|
|
88
|
+
end: "flex-end",
|
|
89
|
+
stretch: "stretch",
|
|
90
|
+
baseline: "baseline"
|
|
91
|
+
};
|
|
92
|
+
var justifyMap = {
|
|
93
|
+
start: "flex-start",
|
|
94
|
+
center: "center",
|
|
95
|
+
end: "flex-end",
|
|
96
|
+
between: "space-between",
|
|
97
|
+
around: "space-around",
|
|
98
|
+
evenly: "space-evenly"
|
|
99
|
+
};
|
|
100
|
+
var wrapMap = {
|
|
101
|
+
wrap: "wrap",
|
|
102
|
+
nowrap: "nowrap",
|
|
103
|
+
reverse: "wrap-reverse"
|
|
104
|
+
};
|
|
105
|
+
function isResponsiveRecord(value) {
|
|
106
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
107
|
+
}
|
|
108
|
+
function normalizeGdsResponsiveValue(value) {
|
|
109
|
+
if (value === void 0) {
|
|
110
|
+
return { breakpoints: {} };
|
|
111
|
+
}
|
|
112
|
+
if (!isResponsiveRecord(value)) {
|
|
113
|
+
return { base: value, breakpoints: {} };
|
|
114
|
+
}
|
|
115
|
+
const { base, xs, sm, md, lg, xl } = value;
|
|
116
|
+
return { base, breakpoints: { xs, sm, md, lg, xl } };
|
|
117
|
+
}
|
|
118
|
+
function resolveSpacing(value) {
|
|
119
|
+
if (value === void 0) return void 0;
|
|
120
|
+
if (value === 0) return "0";
|
|
121
|
+
return spacingTokenMap[value];
|
|
122
|
+
}
|
|
123
|
+
function resolveSize(value) {
|
|
124
|
+
if (value === void 0) return void 0;
|
|
125
|
+
return sizeTokenMap[value];
|
|
126
|
+
}
|
|
127
|
+
function hashLayoutSignature(input) {
|
|
128
|
+
let hash = 0;
|
|
129
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
130
|
+
hash = (hash << 5) - hash + input.charCodeAt(index) | 0;
|
|
131
|
+
}
|
|
132
|
+
return `gds-layout-${Math.abs(hash).toString(36)}`;
|
|
133
|
+
}
|
|
134
|
+
function hasBreakpoints(value) {
|
|
135
|
+
return Object.values(normalizeGdsResponsiveValue(value).breakpoints).some((entry) => entry !== void 0);
|
|
136
|
+
}
|
|
137
|
+
function responsiveCss(className, property, value, resolver, fallback) {
|
|
138
|
+
if (!hasBreakpoints(value)) return "";
|
|
139
|
+
const normalized = normalizeGdsResponsiveValue(value);
|
|
140
|
+
const base = normalized.base ?? fallback;
|
|
141
|
+
const resolvedBase = base === void 0 ? void 0 : resolver(base);
|
|
142
|
+
const baseRule = resolvedBase === void 0 ? "" : `.${className}{${property}:${resolvedBase};}`;
|
|
143
|
+
const rules = Object.entries(normalized.breakpoints).filter((entry) => entry[1] !== void 0).map(([breakpoint, nextValue]) => {
|
|
144
|
+
const resolved = resolver(nextValue);
|
|
145
|
+
return resolved === void 0 ? "" : `@media (min-width: ${breakpointPixels[breakpoint]}px){.${className}{${property}:${resolved};}}`;
|
|
146
|
+
}).filter(Boolean);
|
|
147
|
+
return baseRule + rules.join("");
|
|
148
|
+
}
|
|
149
|
+
function baseValue(value, fallback) {
|
|
150
|
+
const normalized = normalizeGdsResponsiveValue(value);
|
|
151
|
+
return normalized.base ?? fallback;
|
|
152
|
+
}
|
|
153
|
+
function composeResponsiveClass(signature) {
|
|
154
|
+
return hashLayoutSignature(JSON.stringify(signature));
|
|
155
|
+
}
|
|
156
|
+
function renderResponsiveStyle(css) {
|
|
157
|
+
return css ? /* @__PURE__ */ jsx("style", { "data-gds-layout": true, children: css }) : null;
|
|
158
|
+
}
|
|
159
|
+
function resolveGdsLayoutStyle({
|
|
160
|
+
display = "block",
|
|
161
|
+
gap,
|
|
162
|
+
padding,
|
|
163
|
+
margin,
|
|
164
|
+
align,
|
|
165
|
+
justify,
|
|
166
|
+
overflow,
|
|
167
|
+
minWidth,
|
|
168
|
+
maxWidth,
|
|
169
|
+
style
|
|
170
|
+
}) {
|
|
171
|
+
return {
|
|
172
|
+
boxSizing: "border-box",
|
|
173
|
+
display: baseValue(display, "block"),
|
|
174
|
+
gap: resolveSpacing(baseValue(gap, "none")),
|
|
175
|
+
padding: resolveSpacing(baseValue(padding, "none")),
|
|
176
|
+
margin: resolveSpacing(baseValue(margin, "none")),
|
|
177
|
+
alignItems: alignMap[baseValue(align, "stretch")],
|
|
178
|
+
justifyContent: justifyMap[baseValue(justify, "start")],
|
|
179
|
+
overflow,
|
|
180
|
+
minWidth: minWidth === "zero" ? 0 : minWidth === "content" ? "max-content" : void 0,
|
|
181
|
+
maxWidth: resolveSize(baseValue(maxWidth, "full")),
|
|
182
|
+
...style
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function sharedResponsiveCss(className, props) {
|
|
186
|
+
return [
|
|
187
|
+
responsiveCss(className, "display", props.display, (value) => String(value), "block"),
|
|
188
|
+
responsiveCss(className, "gap", props.gap, resolveSpacing, "none"),
|
|
189
|
+
responsiveCss(className, "padding", props.padding, resolveSpacing, "none"),
|
|
190
|
+
responsiveCss(className, "margin", props.margin, resolveSpacing, "none"),
|
|
191
|
+
responsiveCss(className, "align-items", props.align, (value) => alignMap[value], "stretch"),
|
|
192
|
+
responsiveCss(className, "justify-content", props.justify, (value) => justifyMap[value], "start"),
|
|
193
|
+
responsiveCss(className, "max-width", props.maxWidth, resolveSize, "full")
|
|
194
|
+
].join("");
|
|
195
|
+
}
|
|
196
|
+
function withoutResponsiveInline(computed, explicit, entries) {
|
|
197
|
+
const next = { ...computed };
|
|
198
|
+
for (const [value, key] of entries) {
|
|
199
|
+
if (hasBreakpoints(value) && !(explicit && key in explicit)) delete next[key];
|
|
200
|
+
}
|
|
201
|
+
return next;
|
|
202
|
+
}
|
|
203
|
+
function joinClassNames(...classNames) {
|
|
204
|
+
return classNames.filter(Boolean).join(" ") || void 0;
|
|
205
|
+
}
|
|
206
|
+
var GdsBox = forwardRef(function GdsBox2({
|
|
207
|
+
children,
|
|
208
|
+
className,
|
|
209
|
+
component = "div",
|
|
210
|
+
display = "block",
|
|
211
|
+
gap,
|
|
212
|
+
padding,
|
|
213
|
+
margin,
|
|
214
|
+
align,
|
|
215
|
+
justify,
|
|
216
|
+
overflow,
|
|
217
|
+
minWidth = "zero",
|
|
218
|
+
maxWidth,
|
|
219
|
+
style,
|
|
220
|
+
...props
|
|
221
|
+
}, ref) {
|
|
222
|
+
const generatedClassName = composeResponsiveClass({ display, gap, padding, margin, align, justify, maxWidth });
|
|
223
|
+
const css = sharedResponsiveCss(generatedClassName, { display, gap, padding, margin, align, justify, maxWidth });
|
|
224
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
225
|
+
renderResponsiveStyle(css),
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
227
|
+
GdsMantineBox,
|
|
228
|
+
{
|
|
229
|
+
ref,
|
|
230
|
+
component,
|
|
231
|
+
className: joinClassNames(generatedClassName, className),
|
|
232
|
+
style: withoutResponsiveInline(
|
|
233
|
+
resolveGdsLayoutStyle({ display, gap, padding, margin, align, justify, overflow, minWidth, maxWidth, style }),
|
|
234
|
+
style,
|
|
235
|
+
[[display, "display"], [gap, "gap"], [padding, "padding"], [margin, "margin"], [align, "alignItems"], [justify, "justifyContent"], [maxWidth, "maxWidth"]]
|
|
236
|
+
),
|
|
237
|
+
...props,
|
|
238
|
+
children
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
] });
|
|
242
|
+
});
|
|
243
|
+
var GdsStack = forwardRef(function GdsStack2({
|
|
244
|
+
reverse = false,
|
|
245
|
+
gap = "md",
|
|
246
|
+
align = "stretch",
|
|
247
|
+
component = "div",
|
|
248
|
+
style,
|
|
249
|
+
...props
|
|
250
|
+
}, ref) {
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
GdsBox,
|
|
253
|
+
{
|
|
254
|
+
ref,
|
|
255
|
+
component,
|
|
256
|
+
display: "flex",
|
|
257
|
+
gap,
|
|
258
|
+
align,
|
|
259
|
+
style: { flexDirection: reverse ? "column-reverse" : "column", ...style },
|
|
260
|
+
...props
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
});
|
|
264
|
+
var GdsInline = forwardRef(function GdsInline2({
|
|
265
|
+
gap = "sm",
|
|
266
|
+
align = "center",
|
|
267
|
+
justify = "start",
|
|
268
|
+
wrap = "wrap",
|
|
269
|
+
component = "div",
|
|
270
|
+
className,
|
|
271
|
+
style,
|
|
272
|
+
...props
|
|
273
|
+
}, ref) {
|
|
274
|
+
const generatedClassName = composeResponsiveClass({ wrap });
|
|
275
|
+
const css = responsiveCss(generatedClassName, "flex-wrap", wrap, (value) => wrapMap[value], "wrap");
|
|
276
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
277
|
+
renderResponsiveStyle(css),
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
GdsBox,
|
|
280
|
+
{
|
|
281
|
+
ref,
|
|
282
|
+
component,
|
|
283
|
+
display: "flex",
|
|
284
|
+
gap,
|
|
285
|
+
align,
|
|
286
|
+
justify,
|
|
287
|
+
className: joinClassNames(generatedClassName, className),
|
|
288
|
+
style: { flexWrap: hasBreakpoints(wrap) ? void 0 : wrapMap[baseValue(wrap, "wrap")], minWidth: 0, ...style },
|
|
289
|
+
...props
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] });
|
|
293
|
+
});
|
|
294
|
+
var GdsCluster = forwardRef(function GdsCluster2({
|
|
295
|
+
align = "center",
|
|
296
|
+
justify = "between",
|
|
297
|
+
gap = "sm",
|
|
298
|
+
...props
|
|
299
|
+
}, ref) {
|
|
300
|
+
return /* @__PURE__ */ jsx(GdsInline, { ref, align, justify, gap, ...props });
|
|
301
|
+
});
|
|
302
|
+
function resolveGridColumns(columns, minColumnWidth) {
|
|
303
|
+
if (typeof columns === "number") {
|
|
304
|
+
return `repeat(${columns}, minmax(0, 1fr))`;
|
|
305
|
+
}
|
|
306
|
+
if (columns === "auto-fill" || columns === "auto-fit") {
|
|
307
|
+
return `repeat(${columns}, minmax(min(100%, ${resolveSize(minColumnWidth)}), 1fr))`;
|
|
308
|
+
}
|
|
309
|
+
return "repeat(1, minmax(0, 1fr))";
|
|
310
|
+
}
|
|
311
|
+
var GdsGrid = forwardRef(function GdsGrid2({
|
|
312
|
+
columns = { base: 1, md: 2 },
|
|
313
|
+
minColumnWidth = "content",
|
|
314
|
+
gap = "md",
|
|
315
|
+
component = "div",
|
|
316
|
+
className,
|
|
317
|
+
style,
|
|
318
|
+
...props
|
|
319
|
+
}, ref) {
|
|
320
|
+
const generatedClassName = composeResponsiveClass({ columns, minColumnWidth });
|
|
321
|
+
const css = responsiveCss(generatedClassName, "grid-template-columns", columns, (value) => resolveGridColumns(value, minColumnWidth), 1);
|
|
322
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
323
|
+
renderResponsiveStyle(css),
|
|
324
|
+
/* @__PURE__ */ jsx(
|
|
325
|
+
GdsBox,
|
|
326
|
+
{
|
|
327
|
+
ref,
|
|
328
|
+
component,
|
|
329
|
+
display: "grid",
|
|
330
|
+
gap,
|
|
331
|
+
className: joinClassNames(generatedClassName, className),
|
|
332
|
+
style: { gridTemplateColumns: hasBreakpoints(columns) ? void 0 : resolveGridColumns(baseValue(columns, 1), minColumnWidth), minWidth: 0, ...style },
|
|
333
|
+
...props
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] });
|
|
337
|
+
});
|
|
338
|
+
var GdsColumnGrid = forwardRef(function GdsColumnGrid2({
|
|
339
|
+
columns = 12,
|
|
340
|
+
gap = "md",
|
|
341
|
+
component = "div",
|
|
342
|
+
className,
|
|
343
|
+
style,
|
|
344
|
+
...props
|
|
345
|
+
}, ref) {
|
|
346
|
+
const generatedClassName = composeResponsiveClass({ columns, type: "column-grid" });
|
|
347
|
+
const css = responsiveCss(generatedClassName, "grid-template-columns", columns, (value) => `repeat(${value}, minmax(0, 1fr))`, 12);
|
|
348
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
349
|
+
renderResponsiveStyle(css),
|
|
350
|
+
/* @__PURE__ */ jsx(
|
|
351
|
+
GdsBox,
|
|
352
|
+
{
|
|
353
|
+
ref,
|
|
354
|
+
component,
|
|
355
|
+
display: "grid",
|
|
356
|
+
gap,
|
|
357
|
+
className: joinClassNames(generatedClassName, className),
|
|
358
|
+
style: { gridTemplateColumns: hasBreakpoints(columns) ? void 0 : `repeat(${baseValue(columns, 12)}, minmax(0, 1fr))`, minWidth: 0, ...style },
|
|
359
|
+
...props
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
] });
|
|
363
|
+
});
|
|
364
|
+
var GdsColumnGridItem = forwardRef(function GdsColumnGridItem2({
|
|
365
|
+
span,
|
|
366
|
+
start,
|
|
367
|
+
component = "div",
|
|
368
|
+
className,
|
|
369
|
+
style,
|
|
370
|
+
...props
|
|
371
|
+
}, ref) {
|
|
372
|
+
const generatedClassName = composeResponsiveClass({ span, start, type: "column-grid-item" });
|
|
373
|
+
const css = [
|
|
374
|
+
responsiveCss(generatedClassName, "grid-column-start", start, (value) => value),
|
|
375
|
+
responsiveCss(generatedClassName, "grid-column-end", span, (value) => `span ${value}`)
|
|
376
|
+
].join("");
|
|
377
|
+
const baseSpan = normalizeGdsResponsiveValue(span).base;
|
|
378
|
+
const baseStart = normalizeGdsResponsiveValue(start).base;
|
|
379
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
380
|
+
renderResponsiveStyle(css),
|
|
381
|
+
/* @__PURE__ */ jsx(
|
|
382
|
+
GdsBox,
|
|
383
|
+
{
|
|
384
|
+
ref,
|
|
385
|
+
component,
|
|
386
|
+
className: joinClassNames(generatedClassName, className),
|
|
387
|
+
style: {
|
|
388
|
+
gridColumnStart: hasBreakpoints(start) ? void 0 : baseStart,
|
|
389
|
+
gridColumnEnd: hasBreakpoints(span) || baseSpan === void 0 ? void 0 : `span ${baseSpan}`,
|
|
390
|
+
minWidth: 0,
|
|
391
|
+
...style
|
|
392
|
+
},
|
|
393
|
+
...props
|
|
394
|
+
}
|
|
395
|
+
)
|
|
396
|
+
] });
|
|
397
|
+
});
|
|
398
|
+
function splitTemplate(ratio) {
|
|
399
|
+
const [start, end] = ratio.split(":").map(Number);
|
|
400
|
+
return `minmax(0, ${start}fr) minmax(0, ${end}fr)`;
|
|
401
|
+
}
|
|
402
|
+
var GdsSplit = forwardRef(function GdsSplit2({
|
|
403
|
+
ratio = "1:1",
|
|
404
|
+
collapseBelow = "md",
|
|
405
|
+
gap = "lg",
|
|
406
|
+
className,
|
|
407
|
+
style,
|
|
408
|
+
...props
|
|
409
|
+
}, ref) {
|
|
410
|
+
const generatedClassName = composeResponsiveClass({ ratio, collapseBelow, type: "split" });
|
|
411
|
+
const css = `.${generatedClassName}{grid-template-columns:minmax(0, 1fr);}@media (min-width: ${breakpointPixels[collapseBelow]}px){.${generatedClassName}{grid-template-columns:${splitTemplate(ratio)};}}`;
|
|
412
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
413
|
+
renderResponsiveStyle(css),
|
|
414
|
+
/* @__PURE__ */ jsx(
|
|
415
|
+
GdsBox,
|
|
416
|
+
{
|
|
417
|
+
ref,
|
|
418
|
+
display: "grid",
|
|
419
|
+
gap,
|
|
420
|
+
className: joinClassNames(generatedClassName, className),
|
|
421
|
+
style: { alignItems: "start", ...style },
|
|
422
|
+
...props
|
|
423
|
+
}
|
|
424
|
+
)
|
|
425
|
+
] });
|
|
426
|
+
});
|
|
427
|
+
var GdsSidebar = forwardRef(function GdsSidebar2({
|
|
428
|
+
side = "start",
|
|
429
|
+
sidebarWidth = "content",
|
|
430
|
+
collapseBelow = "md",
|
|
431
|
+
gap = "lg",
|
|
432
|
+
className,
|
|
433
|
+
style,
|
|
434
|
+
...props
|
|
435
|
+
}, ref) {
|
|
436
|
+
const generatedClassName = composeResponsiveClass({ side, sidebarWidth, collapseBelow, type: "sidebar" });
|
|
437
|
+
const sidebarTrack = `minmax(min(100%, ${resolveSize(sidebarWidth)}), ${resolveSize(sidebarWidth)})`;
|
|
438
|
+
const template = side === "start" ? `${sidebarTrack} minmax(0, 1fr)` : `minmax(0, 1fr) ${sidebarTrack}`;
|
|
439
|
+
const css = `.${generatedClassName}{grid-template-columns:minmax(0, 1fr);}@media (min-width: ${breakpointPixels[collapseBelow]}px){.${generatedClassName}{grid-template-columns:${template};}}`;
|
|
440
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
441
|
+
renderResponsiveStyle(css),
|
|
442
|
+
/* @__PURE__ */ jsx(
|
|
443
|
+
GdsBox,
|
|
444
|
+
{
|
|
445
|
+
ref,
|
|
446
|
+
display: "grid",
|
|
447
|
+
gap,
|
|
448
|
+
className: joinClassNames(generatedClassName, className),
|
|
449
|
+
style: { alignItems: "start", ...style },
|
|
450
|
+
...props
|
|
451
|
+
}
|
|
452
|
+
)
|
|
453
|
+
] });
|
|
454
|
+
});
|
|
455
|
+
var GdsBleed = forwardRef(function GdsBleed2({
|
|
456
|
+
bleed = "md",
|
|
457
|
+
className,
|
|
458
|
+
style,
|
|
459
|
+
...props
|
|
460
|
+
}, ref) {
|
|
461
|
+
const generatedClassName = composeResponsiveClass({ bleed, type: "bleed" });
|
|
462
|
+
const css = responsiveCss(generatedClassName, "margin-inline", bleed, (value) => {
|
|
463
|
+
const resolved = resolveSpacing(value);
|
|
464
|
+
return resolved ? `calc(${resolved} * -1)` : void 0;
|
|
465
|
+
}, "md");
|
|
466
|
+
const baseBleed = resolveSpacing(baseValue(bleed, "md"));
|
|
467
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
468
|
+
renderResponsiveStyle(css),
|
|
469
|
+
/* @__PURE__ */ jsx(
|
|
470
|
+
GdsBox,
|
|
471
|
+
{
|
|
472
|
+
ref,
|
|
473
|
+
className: joinClassNames(generatedClassName, className),
|
|
474
|
+
style: { marginInline: !hasBreakpoints(bleed) && baseBleed ? `calc(${baseBleed} * -1)` : void 0, ...style },
|
|
475
|
+
...props
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
] });
|
|
479
|
+
});
|
|
480
|
+
var GdsContainer = forwardRef(function GdsContainer2({
|
|
481
|
+
size = "page",
|
|
482
|
+
center = true,
|
|
483
|
+
padding = { base: "md", md: "lg" },
|
|
484
|
+
className,
|
|
485
|
+
style,
|
|
486
|
+
...props
|
|
487
|
+
}, ref) {
|
|
488
|
+
return /* @__PURE__ */ jsx(
|
|
489
|
+
GdsBox,
|
|
490
|
+
{
|
|
491
|
+
ref,
|
|
492
|
+
maxWidth: size,
|
|
493
|
+
padding,
|
|
494
|
+
className,
|
|
495
|
+
style: { width: "100%", marginInline: center ? "auto" : void 0, ...style },
|
|
496
|
+
...props
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
});
|
|
48
500
|
|
|
49
501
|
// src/vocabulary.ts
|
|
50
502
|
var GdsVocabulary = {
|
|
@@ -54,10 +506,10 @@ var GdsVocabulary = {
|
|
|
54
506
|
play: { id: "gds.action.play", defaultMessage: "Play", icon: GdsIcons.Play, feedback: { icon: GdsIcons.Play, color: "teal", messageId: "gds.feedback.started" } },
|
|
55
507
|
start: { id: "gds.action.start", defaultMessage: "Start", icon: GdsIcons.Start, feedback: { icon: GdsIcons.Start, color: "teal", messageId: "gds.feedback.started" } },
|
|
56
508
|
users: { id: "gds.action.users", defaultMessage: "Users", icon: GdsIcons.Users, feedback: { icon: GdsIcons.Users, color: "teal", messageId: "gds.feedback.loaded" } },
|
|
57
|
-
add: { id: "gds.action.add", defaultMessage: "Add", icon: GdsIcons.Add, feedback: { icon: GdsIcons.
|
|
509
|
+
add: { id: "gds.action.add", defaultMessage: "Add", icon: GdsIcons.Add, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.added" }, motion: { pending: "spinner", success: "turn" } },
|
|
58
510
|
edit: { id: "gds.action.edit", defaultMessage: "Edit", icon: GdsIcons.Edit, feedback: { icon: GdsIcons.Edit, color: "teal", messageId: "gds.feedback.edited" } },
|
|
59
|
-
delete: { id: "gds.action.delete", defaultMessage: "Delete", icon: GdsIcons.Delete, feedback: { icon: GdsIcons.
|
|
60
|
-
save: { id: "gds.action.save", defaultMessage: "Save", icon: GdsIcons.Save, feedback: { icon: GdsIcons.
|
|
511
|
+
delete: { id: "gds.action.delete", defaultMessage: "Delete", icon: GdsIcons.Delete, feedback: { icon: GdsIcons.Success, color: "red", messageId: "gds.feedback.deleted" }, motion: { pending: "spinner", success: "check-pop", confirm: true } },
|
|
512
|
+
save: { id: "gds.action.save", defaultMessage: "Save", icon: GdsIcons.Save, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.saved" }, motion: { pending: "spinner", success: "check-draw" } },
|
|
61
513
|
cancel: { id: "gds.action.cancel", defaultMessage: "Cancel", icon: GdsIcons.Cancel, feedback: { icon: GdsIcons.Cancel, color: "red", messageId: "gds.feedback.canceled" } },
|
|
62
514
|
confirm: { id: "gds.action.confirm", defaultMessage: "Confirm", icon: GdsIcons.Confirm, feedback: { icon: GdsIcons.Confirm, color: "teal", messageId: "gds.feedback.confirmed" } },
|
|
63
515
|
close: { id: "gds.action.close", defaultMessage: "Close", icon: GdsIcons.Close, feedback: { icon: GdsIcons.Close, color: "gray", messageId: "gds.feedback.closed" } },
|
|
@@ -69,18 +521,18 @@ var GdsVocabulary = {
|
|
|
69
521
|
gallery: { id: "gds.action.gallery", defaultMessage: "Gallery", icon: GdsIcons.Gallery, feedback: { icon: GdsIcons.Gallery, color: "teal", messageId: "gds.feedback.opened" } },
|
|
70
522
|
history: { id: "gds.action.history", defaultMessage: "History", icon: GdsIcons.History, feedback: { icon: GdsIcons.History, color: "teal", messageId: "gds.feedback.opened" } },
|
|
71
523
|
profile: { id: "gds.action.profile", defaultMessage: "Profile", icon: GdsIcons.Profile, feedback: { icon: GdsIcons.Profile, color: "teal", messageId: "gds.feedback.opened" } },
|
|
72
|
-
send: { id: "gds.action.send", defaultMessage: "Send", icon: GdsIcons.Send, feedback: { icon: GdsIcons.
|
|
524
|
+
send: { id: "gds.action.send", defaultMessage: "Send", icon: GdsIcons.Send, feedback: { icon: GdsIcons.Success, color: "blue", messageId: "gds.feedback.sent" }, motion: { pending: "spinner", success: "fly-off" } },
|
|
73
525
|
reply: { id: "gds.action.reply", defaultMessage: "Reply", icon: GdsIcons.Reply, feedback: { icon: GdsIcons.Reply, color: "blue", messageId: "gds.feedback.replied" } },
|
|
74
526
|
forward: { id: "gds.action.forward", defaultMessage: "Forward", icon: GdsIcons.Forward, feedback: { icon: GdsIcons.Forward, color: "blue", messageId: "gds.feedback.forwarded" } },
|
|
75
527
|
attach: { id: "gds.action.attach", defaultMessage: "Attach", icon: GdsIcons.Attach, feedback: { icon: GdsIcons.Attach, color: "teal", messageId: "gds.feedback.attached" } },
|
|
76
|
-
upload: { id: "gds.action.upload", defaultMessage: "Upload", icon: GdsIcons.Upload, feedback: { icon: GdsIcons.
|
|
77
|
-
download: { id: "gds.action.download", defaultMessage: "Download", icon: GdsIcons.Download, feedback: { icon: GdsIcons.
|
|
528
|
+
upload: { id: "gds.action.upload", defaultMessage: "Upload", icon: GdsIcons.Upload, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.uploaded" }, motion: { pending: "bob-up", success: "check-draw" } },
|
|
529
|
+
download: { id: "gds.action.download", defaultMessage: "Download", icon: GdsIcons.Download, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.downloaded" }, motion: { pending: "bob-down", success: "check-draw" } },
|
|
78
530
|
print: { id: "gds.action.print", defaultMessage: "Print", icon: GdsIcons.Print, feedback: { icon: GdsIcons.Print, color: "teal", messageId: "gds.feedback.printed" } },
|
|
79
|
-
copy: { id: "gds.action.copy", defaultMessage: "Copy", icon: GdsIcons.Copy, feedback: { icon: GdsIcons.
|
|
531
|
+
copy: { id: "gds.action.copy", defaultMessage: "Copy", icon: GdsIcons.Copy, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.copied" }, motion: { pending: "spinner", success: "check-pop" } },
|
|
80
532
|
duplicate: { id: "gds.action.duplicate", defaultMessage: "Duplicate", icon: GdsIcons.Duplicate, feedback: { icon: GdsIcons.Duplicate, color: "teal", messageId: "gds.feedback.duplicated" } },
|
|
81
533
|
check: { id: "gds.action.check", defaultMessage: "Check", icon: GdsIcons.Check, feedback: { icon: GdsIcons.Check, color: "teal", messageId: "gds.feedback.checked" } },
|
|
82
534
|
uncheck: { id: "gds.action.uncheck", defaultMessage: "Uncheck", icon: GdsIcons.Uncheck, feedback: { icon: GdsIcons.Uncheck, color: "red", messageId: "gds.feedback.unchecked" } },
|
|
83
|
-
complete: { id: "gds.action.complete", defaultMessage: "Complete", icon: GdsIcons.Complete, feedback: { icon: GdsIcons.Complete, color: "teal", messageId: "gds.feedback.completed" } },
|
|
535
|
+
complete: { id: "gds.action.complete", defaultMessage: "Complete", icon: GdsIcons.Complete, feedback: { icon: GdsIcons.Complete, color: "teal", messageId: "gds.feedback.completed" }, motion: { pending: "spinner", success: "draw" } },
|
|
84
536
|
clear: { id: "gds.action.clear", defaultMessage: "Clear", icon: GdsIcons.Clear, feedback: { icon: GdsIcons.Clear, color: "red", messageId: "gds.feedback.cleared" } },
|
|
85
537
|
capture: { id: "gds.action.capture", defaultMessage: "Capture", icon: GdsIcons.Capture, feedback: { icon: GdsIcons.Capture, color: "teal", messageId: "gds.feedback.captured" } },
|
|
86
538
|
record: { id: "gds.action.record", defaultMessage: "Record", icon: GdsIcons.Record, feedback: { icon: GdsIcons.Record, color: "teal", messageId: "gds.feedback.recorded" } },
|
|
@@ -97,13 +549,13 @@ var GdsVocabulary = {
|
|
|
97
549
|
habit: { id: "gds.action.habit", defaultMessage: "Habit", icon: GdsIcons.Habit, feedback: { icon: GdsIcons.Habit, color: "teal", messageId: "gds.feedback.done" } },
|
|
98
550
|
goal: { id: "gds.action.goal", defaultMessage: "Goal", icon: GdsIcons.Goal, feedback: { icon: GdsIcons.Goal, color: "teal", messageId: "gds.feedback.done" } },
|
|
99
551
|
streak: { id: "gds.action.streak", defaultMessage: "Streak", icon: GdsIcons.Streak, feedback: { icon: GdsIcons.Streak, color: "teal", messageId: "gds.feedback.done" } },
|
|
100
|
-
reward: { id: "gds.action.reward", defaultMessage: "Reward", icon: GdsIcons.Reward, feedback: { icon: GdsIcons.Reward, color: "yellow", messageId: "gds.feedback.rewarded" } },
|
|
552
|
+
reward: { id: "gds.action.reward", defaultMessage: "Reward", icon: GdsIcons.Reward, feedback: { icon: GdsIcons.Reward, color: "yellow", messageId: "gds.feedback.rewarded" }, motion: { pending: "spinner", success: "pop" } },
|
|
101
553
|
trophy: { id: "gds.action.trophy", defaultMessage: "Trophy", icon: GdsIcons.Trophy, feedback: { icon: GdsIcons.Trophy, color: "yellow", messageId: "gds.feedback.rewarded" } },
|
|
102
554
|
crown: { id: "gds.action.crown", defaultMessage: "Crown", icon: GdsIcons.Crown, feedback: { icon: GdsIcons.Crown, color: "yellow", messageId: "gds.feedback.rewarded" } },
|
|
103
555
|
pause: { id: "gds.action.pause", defaultMessage: "Pause", icon: GdsIcons.Pause, feedback: { icon: GdsIcons.Pause, color: "teal", messageId: "gds.feedback.paused" } },
|
|
104
556
|
message: { id: "gds.action.message", defaultMessage: "Message", icon: GdsIcons.Message, feedback: { icon: GdsIcons.Message, color: "blue", messageId: "gds.feedback.sent" } },
|
|
105
557
|
mail: { id: "gds.action.mail", defaultMessage: "Mail", icon: GdsIcons.Mail, feedback: { icon: GdsIcons.Mail, color: "blue", messageId: "gds.feedback.mailed" } },
|
|
106
|
-
refresh: { id: "gds.action.refresh", defaultMessage: "Refresh", icon: GdsIcons.Refresh, feedback: { icon: GdsIcons.
|
|
558
|
+
refresh: { id: "gds.action.refresh", defaultMessage: "Refresh", icon: GdsIcons.Refresh, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.refreshed" }, motion: { pending: "spin", success: "check-pop" } },
|
|
107
559
|
trendingUp: { id: "gds.action.trendingUp", defaultMessage: "Trending Up", icon: GdsIcons.TrendingUp, feedback: { icon: GdsIcons.TrendingUp, color: "teal", messageId: "gds.feedback.done" } },
|
|
108
560
|
trendingDown: { id: "gds.action.trendingDown", defaultMessage: "Trending Down", icon: GdsIcons.TrendingDown, feedback: { icon: GdsIcons.TrendingDown, color: "teal", messageId: "gds.feedback.done" } },
|
|
109
561
|
currency: { id: "gds.action.currency", defaultMessage: "Currency", icon: GdsIcons.Currency, feedback: { icon: GdsIcons.Currency, color: "teal", messageId: "gds.feedback.done" } },
|
|
@@ -179,7 +631,7 @@ function getSemanticActionLabel(action, translate, packs = []) {
|
|
|
179
631
|
// src/GdsBadge.tsx
|
|
180
632
|
import { Badge } from "@mantine/core";
|
|
181
633
|
import { GDS_ACCENT_NAMES, GDS_ACCENT_SHADES, gdsDevWarnOnce, resolveGdsAccentTokens, useGdsBadgeIconStyle } from "@sovereignsquad/gds-theme";
|
|
182
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
634
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
183
635
|
var toneColors = {
|
|
184
636
|
success: { bg: "var(--gds-badge-solid-success)", fg: "var(--gds-badge-solid-success-fg)" },
|
|
185
637
|
warning: { bg: "var(--gds-badge-solid-warning)", fg: "var(--gds-badge-solid-warning-fg)" },
|
|
@@ -203,7 +655,7 @@ var gdsBadgeAccentShades = Object.fromEntries(
|
|
|
203
655
|
])
|
|
204
656
|
);
|
|
205
657
|
function GdsBadgeEmojiCoin({ emoji }) {
|
|
206
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ jsx2(
|
|
207
659
|
"span",
|
|
208
660
|
{
|
|
209
661
|
"data-gds-badge-emoji-coin": "",
|
|
@@ -240,24 +692,24 @@ function GdsBadge(props) {
|
|
|
240
692
|
"GdsBadge received both `shape` and an active `emoji` glyph \u2014 shape composition is not supported in emoji mode yet, so `shape` is ignored and the emoji renders on its own disc instead."
|
|
241
693
|
);
|
|
242
694
|
}
|
|
243
|
-
leading = /* @__PURE__ */
|
|
695
|
+
leading = /* @__PURE__ */ jsx2(GdsBadgeEmojiCoin, { emoji });
|
|
244
696
|
} else if (shape) {
|
|
245
697
|
const Shape = GdsBadgeShapes[shape];
|
|
246
|
-
leading = /* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
icon ? /* @__PURE__ */
|
|
698
|
+
leading = /* @__PURE__ */ jsxs2(GdsBadgeStack, { size: "1.1em", children: [
|
|
699
|
+
/* @__PURE__ */ jsx2(GdsBadgeStackLayer, { children: /* @__PURE__ */ jsx2(Shape, { size: "100%", stroke: 1.75, "aria-hidden": "true" }) }),
|
|
700
|
+
icon ? /* @__PURE__ */ jsx2(
|
|
249
701
|
GdsBadgeStackLayer,
|
|
250
702
|
{
|
|
251
703
|
scale: shape === "pin" ? 0.42 : 0.55,
|
|
252
704
|
style: shape === "pin" ? { transform: "translateY(-4.1667%) scale(0.42)" } : void 0,
|
|
253
|
-
children: /* @__PURE__ */
|
|
705
|
+
children: /* @__PURE__ */ jsx2(GdsIcon, { icon, size: "100%" })
|
|
254
706
|
}
|
|
255
707
|
) : null
|
|
256
708
|
] });
|
|
257
709
|
} else if (icon) {
|
|
258
|
-
leading = /* @__PURE__ */
|
|
710
|
+
leading = /* @__PURE__ */ jsx2(GdsIcon, { icon, size: "xs" });
|
|
259
711
|
}
|
|
260
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ jsx2(
|
|
261
713
|
Badge,
|
|
262
714
|
{
|
|
263
715
|
"data-gds-badge": "",
|
|
@@ -272,8 +724,8 @@ function GdsBadge(props) {
|
|
|
272
724
|
}
|
|
273
725
|
|
|
274
726
|
// src/SectionPanel.tsx
|
|
275
|
-
import { Box, Divider, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
|
276
|
-
import { Fragment, jsx as
|
|
727
|
+
import { Box as Box2, Divider, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
|
728
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
277
729
|
var toneBackgrounds = {
|
|
278
730
|
default: "var(--mantine-color-body)",
|
|
279
731
|
supporting: "light-dark(var(--mantine-color-gray-0), color-mix(in srgb, var(--mantine-color-dark-7) 92%, black))",
|
|
@@ -283,6 +735,7 @@ var toneBackgrounds = {
|
|
|
283
735
|
function SectionPanel({
|
|
284
736
|
eyebrow,
|
|
285
737
|
title,
|
|
738
|
+
titleOrder = 3,
|
|
286
739
|
description,
|
|
287
740
|
action,
|
|
288
741
|
children,
|
|
@@ -312,27 +765,28 @@ function SectionPanel({
|
|
|
312
765
|
// that spacing props like `p` accept, and a flat `lg` still keeps the
|
|
313
766
|
// corner proportional enough not to visually clip content at the new
|
|
314
767
|
// smaller mobile padding (the original `xl` would, at `xs` padding).
|
|
315
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ jsx3(
|
|
316
769
|
Paper,
|
|
317
770
|
{
|
|
318
771
|
id,
|
|
772
|
+
"data-gds-section-panel": "",
|
|
319
773
|
withBorder: true,
|
|
320
774
|
radius: "lg",
|
|
321
775
|
p: { base: "xs", sm: "sm", md: "lg" },
|
|
322
776
|
style: { background: toneBackgrounds[tone] },
|
|
323
|
-
children: /* @__PURE__ */
|
|
324
|
-
eyebrow || title || description || action ? /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
eyebrow || title || description ? /* @__PURE__ */
|
|
327
|
-
eyebrow ? /* @__PURE__ */
|
|
328
|
-
title ? /* @__PURE__ */
|
|
329
|
-
description ? /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ jsxs3(Stack, { gap: "md", children: [
|
|
778
|
+
eyebrow || title || description || action ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
779
|
+
/* @__PURE__ */ jsxs3(Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
780
|
+
eyebrow || title || description ? /* @__PURE__ */ jsxs3(Stack, { gap: 4, children: [
|
|
781
|
+
eyebrow ? /* @__PURE__ */ jsx3(Text, { size: "xs", fw: 700, c: "dimmed", children: eyebrow }) : null,
|
|
782
|
+
title ? /* @__PURE__ */ jsx3(Title, { order: titleOrder, children: title }) : null,
|
|
783
|
+
description ? /* @__PURE__ */ jsx3(Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
330
784
|
] }) : null,
|
|
331
785
|
action
|
|
332
786
|
] }),
|
|
333
|
-
divided ? /* @__PURE__ */
|
|
787
|
+
divided ? /* @__PURE__ */ jsx3(Divider, {}) : null
|
|
334
788
|
] }) : null,
|
|
335
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ jsx3(Box2, { style: bodyLayout, children })
|
|
336
790
|
] })
|
|
337
791
|
}
|
|
338
792
|
)
|
|
@@ -342,7 +796,7 @@ function SectionPanel({
|
|
|
342
796
|
// src/ReferenceSection.tsx
|
|
343
797
|
import { Anchor } from "@mantine/core";
|
|
344
798
|
import { useGdsTranslation } from "@sovereignsquad/gds-theme";
|
|
345
|
-
import { jsx as
|
|
799
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
346
800
|
function ReferenceSection({
|
|
347
801
|
title,
|
|
348
802
|
description,
|
|
@@ -355,7 +809,7 @@ function ReferenceSection({
|
|
|
355
809
|
children
|
|
356
810
|
}) {
|
|
357
811
|
const { t } = useGdsTranslation();
|
|
358
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ jsx4(
|
|
359
813
|
SectionPanel,
|
|
360
814
|
{
|
|
361
815
|
id,
|
|
@@ -363,7 +817,7 @@ function ReferenceSection({
|
|
|
363
817
|
eyebrow,
|
|
364
818
|
title,
|
|
365
819
|
description,
|
|
366
|
-
action: action ?? (href ? /* @__PURE__ */
|
|
820
|
+
action: action ?? (href ? /* @__PURE__ */ jsx4(Anchor, { href, fw: 600, children: linkLabel ?? t("gds.reference.openSection", "Open section") }) : null),
|
|
367
821
|
divided: false,
|
|
368
822
|
children
|
|
369
823
|
}
|
|
@@ -373,17 +827,17 @@ function ReferenceSection({
|
|
|
373
827
|
// src/ActionBar.tsx
|
|
374
828
|
import { ActionIcon, Button, Group as Group2, Stack as Stack2 } from "@mantine/core";
|
|
375
829
|
import { useGdsTranslation as useGdsTranslation2 } from "@sovereignsquad/gds-theme";
|
|
376
|
-
import { jsx as
|
|
830
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
377
831
|
function renderSemanticAction(action, slot, vocabularyPacks, t) {
|
|
378
832
|
const { action: actionId, variant, ariaLabel, ...props } = action;
|
|
379
833
|
const fallbackVariant = slot === "primary" ? "filled" : slot === "secondary" ? "default" : "subtle";
|
|
380
834
|
const config = resolveSemanticActionConfig(actionId, vocabularyPacks);
|
|
381
835
|
const Icon = config.icon;
|
|
382
836
|
const label = getSemanticActionLabel(actionId, t, vocabularyPacks);
|
|
383
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ jsx5(
|
|
384
838
|
Button,
|
|
385
839
|
{
|
|
386
|
-
leftSection: /* @__PURE__ */
|
|
840
|
+
leftSection: /* @__PURE__ */ jsx5(Icon, { size: "1rem", stroke: 1.75 }),
|
|
387
841
|
"aria-label": ariaLabel ?? label,
|
|
388
842
|
variant: variant ?? fallbackVariant,
|
|
389
843
|
...props,
|
|
@@ -401,23 +855,23 @@ function ActionBar({
|
|
|
401
855
|
vocabularyPacks = []
|
|
402
856
|
}) {
|
|
403
857
|
const { t } = useGdsTranslation2();
|
|
404
|
-
return /* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ jsx5(Stack2, { gap, children: /* @__PURE__ */ jsxs4(Group2, { justify: "space-between", align: "center", gap, wrap: "wrap", children: [
|
|
859
|
+
/* @__PURE__ */ jsxs4(Group2, { gap, wrap: "wrap", children: [
|
|
406
860
|
secondary.map((action) => renderSemanticAction(action, "secondary", vocabularyPacks, t)),
|
|
407
861
|
tertiary.map((action) => renderSemanticAction(action, "tertiary", vocabularyPacks, t))
|
|
408
862
|
] }),
|
|
409
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ jsxs4(Group2, { gap, wrap: "wrap", justify: "flex-end", children: [
|
|
410
864
|
iconOnly.map(({ action, ariaLabel, ...props }) => {
|
|
411
865
|
const config = resolveSemanticActionConfig(action, vocabularyPacks);
|
|
412
866
|
const Icon = config.icon;
|
|
413
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ jsx5(
|
|
414
868
|
ActionIcon,
|
|
415
869
|
{
|
|
416
870
|
variant: "subtle",
|
|
417
871
|
size: "lg",
|
|
418
872
|
"aria-label": ariaLabel ?? getSemanticActionLabel(action, t, vocabularyPacks),
|
|
419
873
|
...props,
|
|
420
|
-
children: /* @__PURE__ */
|
|
874
|
+
children: /* @__PURE__ */ jsx5(Icon, { size: "1rem", stroke: 1.75 })
|
|
421
875
|
},
|
|
422
876
|
`icon-${action}`
|
|
423
877
|
);
|
|
@@ -519,7 +973,7 @@ function resolveGdsGeneratedPaletteHex(options = {}) {
|
|
|
519
973
|
|
|
520
974
|
// src/GdsGeneratedThumbnail.tsx
|
|
521
975
|
import { cloneElement, isValidElement, useId, useMemo } from "react";
|
|
522
|
-
import { Fragment as
|
|
976
|
+
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
523
977
|
var ASPECT_RATIO_VIEWBOX = {
|
|
524
978
|
"3:2": { width: 300, height: 200 },
|
|
525
979
|
"16:9": { width: 320, height: 180 },
|
|
@@ -529,7 +983,7 @@ var ASPECT_RATIO_VIEWBOX = {
|
|
|
529
983
|
var isIconKey = (icon) => typeof icon === "string";
|
|
530
984
|
function renderIcon(icon, size = "100%") {
|
|
531
985
|
if (isIconKey(icon)) {
|
|
532
|
-
return /* @__PURE__ */
|
|
986
|
+
return /* @__PURE__ */ jsx6(GdsIcon, { icon, size, tone: "default" });
|
|
533
987
|
}
|
|
534
988
|
if (isValidElement(icon)) {
|
|
535
989
|
return cloneElement(icon, { stroke: 1.75 });
|
|
@@ -584,7 +1038,7 @@ function computeIconFieldPlacements(seed, count, viewBoxWidth, viewBoxHeight) {
|
|
|
584
1038
|
function renderBackground(background, categories, seed, palette, viewBoxWidth, viewBoxHeight) {
|
|
585
1039
|
if (background === "mosaic-abstract") {
|
|
586
1040
|
const tiles = computeMosaicTiles(seed, viewBoxWidth, viewBoxHeight);
|
|
587
|
-
return /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ jsx6(Fragment3, { children: tiles.map((tile, index) => /* @__PURE__ */ jsx6(
|
|
588
1042
|
"rect",
|
|
589
1043
|
{
|
|
590
1044
|
x: tile.x,
|
|
@@ -604,23 +1058,23 @@ function renderBackground(background, categories, seed, palette, viewBoxWidth, v
|
|
|
604
1058
|
}
|
|
605
1059
|
const next = gdsSeededRandom(`${seed}:icon-field-pick`);
|
|
606
1060
|
const placements = computeIconFieldPlacements(seed, Math.min(categories.length, 8), viewBoxWidth, viewBoxHeight);
|
|
607
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ jsx6(Fragment3, { children: placements.map((placement, index) => {
|
|
608
1062
|
const entry = categories[Math.floor(next() * categories.length)];
|
|
609
|
-
return /* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsx6(
|
|
610
1064
|
"g",
|
|
611
1065
|
{
|
|
612
1066
|
transform: `translate(${placement.x} ${placement.y}) rotate(${placement.rotationDeg}) scale(${placement.size / 24})`,
|
|
613
1067
|
opacity: 0.1,
|
|
614
1068
|
style: { color: "var(--gds-text-on-inverse, var(--mantine-color-white))" },
|
|
615
|
-
children: /* @__PURE__ */
|
|
1069
|
+
children: /* @__PURE__ */ jsx6("svg", { x: -12, y: -12, width: 24, height: 24, viewBox: "0 0 24 24", children: renderIcon(entry.icon) })
|
|
616
1070
|
},
|
|
617
1071
|
index
|
|
618
1072
|
);
|
|
619
1073
|
}) });
|
|
620
1074
|
}
|
|
621
|
-
return /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ jsx6(Fragment3, { children: background.regions.map((region, index) => {
|
|
622
1076
|
const weight = region.weight ?? 1;
|
|
623
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ jsx6(
|
|
624
1078
|
"rect",
|
|
625
1079
|
{
|
|
626
1080
|
x: region.x0 * viewBoxWidth,
|
|
@@ -666,7 +1120,7 @@ function GdsGeneratedThumbnail({
|
|
|
666
1120
|
const secondary = categories.slice(1, Math.max(maxBadges, 1));
|
|
667
1121
|
const inverseColor = "var(--gds-text-on-inverse, var(--mantine-color-white))";
|
|
668
1122
|
const pillBg = darkSurface(palette.accent);
|
|
669
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ jsxs5(
|
|
670
1124
|
"div",
|
|
671
1125
|
{
|
|
672
1126
|
"data-gds-generated-thumbnail": "",
|
|
@@ -681,7 +1135,7 @@ function GdsGeneratedThumbnail({
|
|
|
681
1135
|
...style
|
|
682
1136
|
},
|
|
683
1137
|
children: [
|
|
684
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ jsxs5(
|
|
685
1139
|
"svg",
|
|
686
1140
|
{
|
|
687
1141
|
viewBox: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
|
|
@@ -689,24 +1143,24 @@ function GdsGeneratedThumbnail({
|
|
|
689
1143
|
"aria-hidden": "true",
|
|
690
1144
|
style: { position: "absolute", inset: 0, width: "100%", height: "100%", display: "block" },
|
|
691
1145
|
children: [
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsxs5("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1147
|
+
/* @__PURE__ */ jsx6("stop", { offset: "0%", stopColor: palette.primary }),
|
|
1148
|
+
/* @__PURE__ */ jsx6("stop", { offset: "100%", stopColor: darkSurface(palette.primary) })
|
|
695
1149
|
] }) }),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
background === "wash" ? /* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ jsx6("rect", { width: viewBoxWidth, height: viewBoxHeight, fill: `url(#${gradientId})` }),
|
|
1151
|
+
background === "wash" ? /* @__PURE__ */ jsx6(
|
|
698
1152
|
"g",
|
|
699
1153
|
{
|
|
700
1154
|
transform: `translate(${motif.centerX} ${motif.centerY}) rotate(${motif.rotationDeg}) scale(${motif.scale})`,
|
|
701
1155
|
opacity: motifOpacity,
|
|
702
1156
|
style: { color: inverseColor },
|
|
703
|
-
children: /* @__PURE__ */
|
|
1157
|
+
children: /* @__PURE__ */ jsx6("svg", { x: -12, y: -12, width: 24, height: 24, viewBox: "0 0 24 24", children: renderIcon(lead.icon) })
|
|
704
1158
|
}
|
|
705
1159
|
) : renderBackground(background, categories, seed, palette, viewBoxWidth, viewBoxHeight)
|
|
706
1160
|
]
|
|
707
1161
|
}
|
|
708
1162
|
),
|
|
709
|
-
badges === "none" ? null : /* @__PURE__ */
|
|
1163
|
+
badges === "none" ? null : /* @__PURE__ */ jsxs5(
|
|
710
1164
|
"div",
|
|
711
1165
|
{
|
|
712
1166
|
style: {
|
|
@@ -721,7 +1175,7 @@ function GdsGeneratedThumbnail({
|
|
|
721
1175
|
children: [
|
|
722
1176
|
(() => {
|
|
723
1177
|
const LeadTag = lead.onSelect ? "button" : "span";
|
|
724
|
-
return /* @__PURE__ */
|
|
1178
|
+
return /* @__PURE__ */ jsxs5(
|
|
725
1179
|
LeadTag,
|
|
726
1180
|
{
|
|
727
1181
|
"data-gds-generated-thumbnail-badge": "lead",
|
|
@@ -744,7 +1198,7 @@ function GdsGeneratedThumbnail({
|
|
|
744
1198
|
cursor: lead.onSelect ? "pointer" : void 0
|
|
745
1199
|
},
|
|
746
1200
|
children: [
|
|
747
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ jsx6("span", { "aria-hidden": "true", style: { width: "1.1em", height: "1.1em", display: "inline-flex" }, children: renderIcon(lead.icon, "100%") }),
|
|
748
1202
|
lead.label
|
|
749
1203
|
]
|
|
750
1204
|
}
|
|
@@ -752,7 +1206,7 @@ function GdsGeneratedThumbnail({
|
|
|
752
1206
|
})(),
|
|
753
1207
|
secondary.map((entry, index) => {
|
|
754
1208
|
const SecondaryTag = entry.onSelect ? "button" : "span";
|
|
755
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ jsx6(
|
|
756
1210
|
SecondaryTag,
|
|
757
1211
|
{
|
|
758
1212
|
"data-gds-generated-thumbnail-badge": "secondary",
|
|
@@ -777,7 +1231,7 @@ function GdsGeneratedThumbnail({
|
|
|
777
1231
|
font: entry.onSelect ? "inherit" : void 0,
|
|
778
1232
|
cursor: entry.onSelect ? "pointer" : void 0
|
|
779
1233
|
},
|
|
780
|
-
children: /* @__PURE__ */
|
|
1234
|
+
children: /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", style: { width: "1em", height: "1em", display: "inline-flex" }, children: renderIcon(entry.icon, "100%") })
|
|
781
1235
|
},
|
|
782
1236
|
entry.key
|
|
783
1237
|
);
|
|
@@ -855,8 +1309,8 @@ function resolveGdsCardContract({
|
|
|
855
1309
|
// src/ListingCard.tsx
|
|
856
1310
|
import { useState } from "react";
|
|
857
1311
|
import { useGdsTranslation as useGdsTranslation3 } from "@sovereignsquad/gds-theme";
|
|
858
|
-
import { ActionIcon as ActionIcon2, Badge as Badge2, Box as
|
|
859
|
-
import { Fragment as
|
|
1312
|
+
import { ActionIcon as ActionIcon2, Badge as Badge2, Box as Box3, Card, Group as Group3, Stack as Stack3, Text as Text2, Title as Title2 } from "@mantine/core";
|
|
1313
|
+
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
860
1314
|
var toneColorMap = {
|
|
861
1315
|
default: void 0,
|
|
862
1316
|
positive: "teal",
|
|
@@ -892,7 +1346,7 @@ function ListingImageFallback({
|
|
|
892
1346
|
seed,
|
|
893
1347
|
title
|
|
894
1348
|
}) {
|
|
895
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ jsx7(
|
|
896
1350
|
GdsGeneratedThumbnail,
|
|
897
1351
|
{
|
|
898
1352
|
seed,
|
|
@@ -918,7 +1372,7 @@ function ListingAffordance({ affordance }) {
|
|
|
918
1372
|
background: "var(--gds-brand-accent-tint, var(--mantine-color-default-hover))"
|
|
919
1373
|
} : void 0;
|
|
920
1374
|
if (affordance.href) {
|
|
921
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx7(
|
|
922
1376
|
ActionIcon2,
|
|
923
1377
|
{
|
|
924
1378
|
component: "a",
|
|
@@ -929,11 +1383,11 @@ function ListingAffordance({ affordance }) {
|
|
|
929
1383
|
"data-gds-active": affordance.active ? "true" : void 0,
|
|
930
1384
|
style: { ...mediaStyle, ...activeStyle },
|
|
931
1385
|
disabled: affordance.disabled,
|
|
932
|
-
children: /* @__PURE__ */
|
|
1386
|
+
children: /* @__PURE__ */ jsx7(Icon, { size: "1rem", stroke: 1.75 })
|
|
933
1387
|
}
|
|
934
1388
|
);
|
|
935
1389
|
}
|
|
936
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ jsx7(
|
|
937
1391
|
ActionIcon2,
|
|
938
1392
|
{
|
|
939
1393
|
variant: onMedia ? "transparent" : "subtle",
|
|
@@ -943,7 +1397,7 @@ function ListingAffordance({ affordance }) {
|
|
|
943
1397
|
"data-gds-active": affordance.active ? "true" : void 0,
|
|
944
1398
|
style: { ...mediaStyle, ...activeStyle },
|
|
945
1399
|
disabled: affordance.disabled,
|
|
946
|
-
children: /* @__PURE__ */
|
|
1400
|
+
children: /* @__PURE__ */ jsx7(Icon, { size: "1rem", stroke: 1.75 })
|
|
947
1401
|
}
|
|
948
1402
|
);
|
|
949
1403
|
}
|
|
@@ -954,7 +1408,7 @@ function ListingPickBadge({
|
|
|
954
1408
|
const override = typeof config === "object" ? config : void 0;
|
|
955
1409
|
const label = override?.label ?? defaultLabel;
|
|
956
1410
|
const ariaLabel = override?.ariaLabel ?? (typeof label === "string" ? label : defaultLabel);
|
|
957
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ jsxs6(
|
|
958
1412
|
Group3,
|
|
959
1413
|
{
|
|
960
1414
|
gap: 4,
|
|
@@ -975,8 +1429,8 @@ function ListingPickBadge({
|
|
|
975
1429
|
paddingInline: `${GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX}px`
|
|
976
1430
|
},
|
|
977
1431
|
children: [
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ jsx7(GdsIcons.Star, { size: GDS_LISTING_PICK_BADGE_ICON_PX, stroke: 1.75, fill: "currentColor", "aria-hidden": "true" }),
|
|
1433
|
+
/* @__PURE__ */ jsx7("span", { children: label })
|
|
980
1434
|
]
|
|
981
1435
|
}
|
|
982
1436
|
);
|
|
@@ -1030,7 +1484,7 @@ function ListingCard({
|
|
|
1030
1484
|
const isFlipMode = interactiveMode === "flip" && Boolean(revealContent);
|
|
1031
1485
|
const isRowTile = contract.mediaPlacement === "left";
|
|
1032
1486
|
const emphasized = featured || selected;
|
|
1033
|
-
const titleContent = href && typeof title === "string" && interactiveMode === "none" ? /* @__PURE__ */
|
|
1487
|
+
const titleContent = href && typeof title === "string" && interactiveMode === "none" ? /* @__PURE__ */ jsx7(Text2, { component: "a", href, inherit: true, td: "none", children: title }) : title;
|
|
1034
1488
|
const activateSurface = (event) => {
|
|
1035
1489
|
if (isNestedInteractiveTarget(event.target, event.currentTarget)) {
|
|
1036
1490
|
return;
|
|
@@ -1072,7 +1526,7 @@ function ListingCard({
|
|
|
1072
1526
|
} : {};
|
|
1073
1527
|
const mediaSeedValue = mediaSeed ?? href ?? imageAlt ?? (typeof title === "string" ? title : "gds-listing");
|
|
1074
1528
|
const fallbackTitle = typeof title === "string" ? title : imageAlt ?? "Listing";
|
|
1075
|
-
const mediaContent = image ?? /* @__PURE__ */
|
|
1529
|
+
const mediaContent = image ?? /* @__PURE__ */ jsx7(
|
|
1076
1530
|
ListingImageFallback,
|
|
1077
1531
|
{
|
|
1078
1532
|
mediaRatio: isRowTile ? "1:1" : mediaRatio,
|
|
@@ -1080,9 +1534,9 @@ function ListingCard({
|
|
|
1080
1534
|
title: fallbackTitle
|
|
1081
1535
|
}
|
|
1082
1536
|
);
|
|
1083
|
-
const pickBadgeElement = pickBadge ? /* @__PURE__ */
|
|
1084
|
-
const topLeftOverlay = pickBadgeElement ? /* @__PURE__ */
|
|
1085
|
-
|
|
1537
|
+
const pickBadgeElement = pickBadge ? /* @__PURE__ */ jsx7(ListingPickBadge, { config: pickBadge, defaultLabel: pickLabel }) : null;
|
|
1538
|
+
const topLeftOverlay = pickBadgeElement ? /* @__PURE__ */ jsx7(
|
|
1539
|
+
Box3,
|
|
1086
1540
|
{
|
|
1087
1541
|
style: {
|
|
1088
1542
|
position: "absolute",
|
|
@@ -1090,16 +1544,16 @@ function ListingCard({
|
|
|
1090
1544
|
insetInlineStart: `${GDS_LISTING_PICK_BADGE_INSET_PX}px`,
|
|
1091
1545
|
zIndex: 1
|
|
1092
1546
|
},
|
|
1093
|
-
children: mediaOverlay ? /* @__PURE__ */
|
|
1547
|
+
children: mediaOverlay ? /* @__PURE__ */ jsxs6(Stack3, { gap: "xs", children: [
|
|
1094
1548
|
pickBadgeElement,
|
|
1095
1549
|
mediaOverlay
|
|
1096
1550
|
] }) : pickBadgeElement
|
|
1097
1551
|
}
|
|
1098
|
-
) : mediaOverlay ? /* @__PURE__ */
|
|
1099
|
-
const affordanceOverlay = mediaAffordance ? /* @__PURE__ */
|
|
1552
|
+
) : mediaOverlay ? /* @__PURE__ */ jsx7(Box3, { style: { position: "absolute", top: "var(--mantine-spacing-xs)", left: "var(--mantine-spacing-xs)", zIndex: 1 }, children: mediaOverlay }) : null;
|
|
1553
|
+
const affordanceOverlay = mediaAffordance ? /* @__PURE__ */ jsx7(Box3, { style: { position: "absolute", top: 0, right: 0, zIndex: 1 }, children: /* @__PURE__ */ jsx7(ListingAffordance, { affordance: mediaAffordance }) }) : null;
|
|
1100
1554
|
const hasMediaOverlayContent = Boolean(mediaOverlay || mediaAffordance || pickBadge);
|
|
1101
|
-
const mediaBlock = isRowTile ? /* @__PURE__ */
|
|
1102
|
-
|
|
1555
|
+
const mediaBlock = isRowTile ? /* @__PURE__ */ jsxs6(
|
|
1556
|
+
Box3,
|
|
1103
1557
|
{
|
|
1104
1558
|
"data-gds-listing-row-tile": true,
|
|
1105
1559
|
style: {
|
|
@@ -1119,15 +1573,15 @@ function ListingCard({
|
|
|
1119
1573
|
) : hasMediaOverlayContent ? (
|
|
1120
1574
|
// Positioned wrapper only when something is actually overlaid, so a card without
|
|
1121
1575
|
// overlays keeps its previous DOM exactly (issue 679).
|
|
1122
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ jsxs6(Box3, { style: { position: "relative" }, children: [
|
|
1123
1577
|
mediaContent,
|
|
1124
1578
|
topLeftOverlay,
|
|
1125
1579
|
affordanceOverlay
|
|
1126
1580
|
] })
|
|
1127
1581
|
) : mediaContent;
|
|
1128
|
-
const contentItems = /* @__PURE__ */
|
|
1129
|
-
featured || sponsoredDisclosure ? /* @__PURE__ */
|
|
1130
|
-
featured ? /* @__PURE__ */
|
|
1582
|
+
const contentItems = /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1583
|
+
featured || sponsoredDisclosure ? /* @__PURE__ */ jsxs6(Group3, { justify: "space-between", gap: "sm", wrap: "wrap", children: [
|
|
1584
|
+
featured ? /* @__PURE__ */ jsx7(
|
|
1131
1585
|
Badge2,
|
|
1132
1586
|
{
|
|
1133
1587
|
variant: "light",
|
|
@@ -1137,27 +1591,27 @@ function ListingCard({
|
|
|
1137
1591
|
},
|
|
1138
1592
|
children: featuredLabel
|
|
1139
1593
|
}
|
|
1140
|
-
) : /* @__PURE__ */
|
|
1141
|
-
sponsoredDisclosure ? /* @__PURE__ */
|
|
1594
|
+
) : /* @__PURE__ */ jsx7("span", {}),
|
|
1595
|
+
sponsoredDisclosure ? /* @__PURE__ */ jsx7(Text2, { size: "xs", c: "dimmed", children: sponsoredDisclosure }) : null
|
|
1142
1596
|
] }) : null,
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
description ? /* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ jsxs6(Stack3, { gap: 4, children: [
|
|
1598
|
+
/* @__PURE__ */ jsx7(Title2, { order: contract.titleOrder, lineClamp: 2, children: titleContent }),
|
|
1599
|
+
description ? /* @__PURE__ */ jsx7(Text2, { size: "sm", c: "dimmed", lineClamp: contract.descriptionClamp, children: description }) : null
|
|
1146
1600
|
] }),
|
|
1147
|
-
metadata.length ? /* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1601
|
+
metadata.length ? /* @__PURE__ */ jsx7(Stack3, { gap: "xs", children: metadata.map((item) => /* @__PURE__ */ jsxs6(Group3, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
1602
|
+
/* @__PURE__ */ jsxs6(Group3, { gap: "xs", wrap: "nowrap", style: { minWidth: 0, flex: 1 }, children: [
|
|
1149
1603
|
item.icon,
|
|
1150
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsx7(Text2, { size: "sm", c: item.tone ? toneColorMap[item.tone] : "dimmed", lineClamp: 1, children: item.label })
|
|
1151
1605
|
] }),
|
|
1152
|
-
item.value ? /* @__PURE__ */
|
|
1606
|
+
item.value ? /* @__PURE__ */ jsx7(Text2, { size: "sm", fw: 500, ta: "right", children: item.value }) : null
|
|
1153
1607
|
] }, item.id)) }) : null,
|
|
1154
|
-
reason ? /* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1608
|
+
reason ? /* @__PURE__ */ jsxs6(Stack3, { gap: 4, role: "group", "aria-label": reasonLabel, children: [
|
|
1609
|
+
/* @__PURE__ */ jsx7(Text2, { size: "xs", fw: 700, tt: "uppercase", c: "dimmed", children: reasonLabel }),
|
|
1156
1610
|
reason
|
|
1157
1611
|
] }) : null,
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
price ? /* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ jsxs6(Group3, { justify: "space-between", align: "center", gap: "sm", wrap: "wrap", children: [
|
|
1613
|
+
/* @__PURE__ */ jsxs6(Stack3, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
|
|
1614
|
+
price ? /* @__PURE__ */ jsx7(
|
|
1161
1615
|
Text2,
|
|
1162
1616
|
{
|
|
1163
1617
|
fw: 700,
|
|
@@ -1166,8 +1620,8 @@ function ListingCard({
|
|
|
1166
1620
|
children: price
|
|
1167
1621
|
}
|
|
1168
1622
|
) : null,
|
|
1169
|
-
rating ? /* @__PURE__ */
|
|
1170
|
-
/* @__PURE__ */
|
|
1623
|
+
rating ? /* @__PURE__ */ jsxs6(Group3, { gap: 4, wrap: "nowrap", "aria-label": ratingLabel, children: [
|
|
1624
|
+
/* @__PURE__ */ jsx7(
|
|
1171
1625
|
GdsIcons.Star,
|
|
1172
1626
|
{
|
|
1173
1627
|
size: "1rem",
|
|
@@ -1176,23 +1630,23 @@ function ListingCard({
|
|
|
1176
1630
|
style: { color: "var(--gds-star, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" }
|
|
1177
1631
|
}
|
|
1178
1632
|
),
|
|
1179
|
-
/* @__PURE__ */
|
|
1633
|
+
/* @__PURE__ */ jsx7(Text2, { size: "sm", fw: 600, style: { color: "var(--gds-star, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" }, children: rating })
|
|
1180
1634
|
] }) : null
|
|
1181
1635
|
] }),
|
|
1182
|
-
score ? /* @__PURE__ */
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
resolvedSaveAction ? /* @__PURE__ */
|
|
1185
|
-
shareAction ? /* @__PURE__ */
|
|
1636
|
+
score ? /* @__PURE__ */ jsx7(Group3, { gap: "xs", wrap: "nowrap", children: score }) : null,
|
|
1637
|
+
/* @__PURE__ */ jsxs6(Group3, { gap: "xs", wrap: "nowrap", justify: "flex-end", style: { marginInlineStart: "auto" }, children: [
|
|
1638
|
+
resolvedSaveAction ? /* @__PURE__ */ jsx7(ListingAffordance, { affordance: resolvedSaveAction }) : null,
|
|
1639
|
+
shareAction ? /* @__PURE__ */ jsx7(ListingAffordance, { affordance: shareAction }) : null,
|
|
1186
1640
|
resolvedActions ? null : primaryAction,
|
|
1187
|
-
isFlipMode ? /* @__PURE__ */
|
|
1641
|
+
isFlipMode ? /* @__PURE__ */ jsx7(Text2, { size: "xs", c: "dimmed", children: "Press Enter or Space to reveal details." }) : null
|
|
1188
1642
|
] })
|
|
1189
1643
|
] }),
|
|
1190
|
-
resolvedActions ? /* @__PURE__ */
|
|
1644
|
+
resolvedActions ? /* @__PURE__ */ jsx7(Group3, { gap: "sm", wrap: "wrap", role: "group", "aria-label": "Listing actions", children: resolvedActions.map((action, index) => (
|
|
1191
1645
|
// eslint-disable-next-line react/no-array-index-key
|
|
1192
|
-
/* @__PURE__ */
|
|
1646
|
+
/* @__PURE__ */ jsx7("span", { children: action }, index)
|
|
1193
1647
|
)) }) : null
|
|
1194
1648
|
] });
|
|
1195
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ jsx7(
|
|
1196
1650
|
Card,
|
|
1197
1651
|
{
|
|
1198
1652
|
withBorder: true,
|
|
@@ -1215,10 +1669,10 @@ function ListingCard({
|
|
|
1215
1669
|
} : {}
|
|
1216
1670
|
},
|
|
1217
1671
|
...interactiveProps,
|
|
1218
|
-
children: /* @__PURE__ */
|
|
1672
|
+
children: /* @__PURE__ */ jsx7(Stack3, { gap: contract.gap, children: isFlipMode && flipped ? revealContent : isRowTile ? /* @__PURE__ */ jsxs6(Group3, { gap: contract.gap, wrap: "nowrap", align: "flex-start", "data-gds-listing-row": true, children: [
|
|
1219
1673
|
mediaBlock,
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
] }) : /* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ jsx7(Stack3, { gap: contract.gap, style: { minWidth: 0, flex: 1 }, children: contentItems })
|
|
1675
|
+
] }) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1222
1676
|
mediaBlock,
|
|
1223
1677
|
contentItems
|
|
1224
1678
|
] }) })
|
|
@@ -1226,23 +1680,46 @@ function ListingCard({
|
|
|
1226
1680
|
);
|
|
1227
1681
|
}
|
|
1228
1682
|
|
|
1683
|
+
// src/locales/index.ts
|
|
1684
|
+
var gdsLocales = {
|
|
1685
|
+
en,
|
|
1686
|
+
es,
|
|
1687
|
+
hu,
|
|
1688
|
+
de,
|
|
1689
|
+
fr,
|
|
1690
|
+
it,
|
|
1691
|
+
ru,
|
|
1692
|
+
he,
|
|
1693
|
+
ar,
|
|
1694
|
+
zh,
|
|
1695
|
+
ja,
|
|
1696
|
+
ko
|
|
1697
|
+
};
|
|
1698
|
+
function getGdsMessages(locale) {
|
|
1699
|
+
return gdsLocales[locale] ?? en;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1229
1702
|
// src/OwnedContrastSurface.tsx
|
|
1703
|
+
import { getGdsVibeThemeCssVariables as getGdsVibeThemeCssVariables2 } from "@sovereignsquad/gds-theme";
|
|
1230
1704
|
function createGdsOwnedContrastTokens(vibe, options) {
|
|
1231
1705
|
const text = options.text ?? vibe.textLight;
|
|
1232
1706
|
const muted = options.muted ?? vibe.mutedLight;
|
|
1233
1707
|
const surface = options.surface ?? vibe.surfaceLight;
|
|
1234
1708
|
const border = options.border ?? vibe.borderLight;
|
|
1709
|
+
const emitted = getGdsVibeThemeCssVariables2(vibe.id, "light");
|
|
1710
|
+
const primary = emitted["--gds-vibe-primary"];
|
|
1235
1711
|
return {
|
|
1236
1712
|
text,
|
|
1237
1713
|
muted,
|
|
1238
1714
|
background: options.background,
|
|
1239
1715
|
radius: options.radius,
|
|
1240
|
-
primary
|
|
1241
|
-
|
|
1716
|
+
primary,
|
|
1717
|
+
primaryFg: emitted["--gds-action-fill-fg"],
|
|
1718
|
+
accent: emitted["--gds-vibe-accent"],
|
|
1242
1719
|
surface,
|
|
1243
1720
|
border,
|
|
1244
|
-
link: options.link ?? `color-mix(in srgb, ${
|
|
1245
|
-
control: options.control ?? `color-mix(in srgb, ${surface} 88%, ${
|
|
1721
|
+
link: options.link ?? `color-mix(in srgb, ${primary} 64%, ${text})`,
|
|
1722
|
+
control: options.control ?? `color-mix(in srgb, ${surface} 88%, ${primary} 8%)`,
|
|
1246
1723
|
controlText: options.controlText ?? text,
|
|
1247
1724
|
backgroundColor: options.backgroundColor ?? surface,
|
|
1248
1725
|
borderColor: options.borderColor ?? border,
|
|
@@ -1256,6 +1733,7 @@ function getGdsOwnedContrastProps({ role, tokens }) {
|
|
|
1256
1733
|
"--gds-local-background": tokens.background,
|
|
1257
1734
|
"--gds-local-radius": tokens.radius,
|
|
1258
1735
|
"--gds-vibe-primary": tokens.primary,
|
|
1736
|
+
...tokens.primaryFg ? { "--gds-action-fill-fg": tokens.primaryFg } : {},
|
|
1259
1737
|
"--gds-vibe-accent": tokens.accent,
|
|
1260
1738
|
"--gds-vibe-surface": tokens.surface,
|
|
1261
1739
|
"--gds-vibe-border": tokens.border,
|
|
@@ -1278,21 +1756,21 @@ function getGdsOwnedContrastProps({ role, tokens }) {
|
|
|
1278
1756
|
}
|
|
1279
1757
|
|
|
1280
1758
|
// src/FormField.tsx
|
|
1281
|
-
import { Box as
|
|
1282
|
-
import { jsx as
|
|
1759
|
+
import { Box as Box4, Stack as Stack4, Text as Text3 } from "@mantine/core";
|
|
1760
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1283
1761
|
function FormField({ label, description, error, children }) {
|
|
1284
|
-
return /* @__PURE__ */
|
|
1285
|
-
typeof label === "string" ? /* @__PURE__ */
|
|
1286
|
-
description ? typeof description === "string" ? /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ jsx8(Box4, { component: "label", children: /* @__PURE__ */ jsxs7(Stack4, { gap: 4, children: [
|
|
1763
|
+
typeof label === "string" ? /* @__PURE__ */ jsx8(Text3, { size: "xs", fw: 600, c: "dimmed", children: label }) : label,
|
|
1764
|
+
description ? typeof description === "string" ? /* @__PURE__ */ jsx8(Text3, { size: "xs", c: "dimmed", children: description }) : description : null,
|
|
1287
1765
|
children,
|
|
1288
|
-
error ? typeof error === "string" ? /* @__PURE__ */
|
|
1766
|
+
error ? typeof error === "string" ? /* @__PURE__ */ jsx8(Text3, { size: "xs", c: "red.7", children: error }) : error : null
|
|
1289
1767
|
] }) });
|
|
1290
1768
|
}
|
|
1291
1769
|
|
|
1292
1770
|
// src/SimpleDataTable.tsx
|
|
1293
1771
|
import { useGdsTranslation as useGdsTranslation4 } from "@sovereignsquad/gds-theme";
|
|
1294
1772
|
import { ScrollArea, Table } from "@mantine/core";
|
|
1295
|
-
import { jsx as
|
|
1773
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1296
1774
|
function SimpleDataTable({
|
|
1297
1775
|
columns,
|
|
1298
1776
|
rows,
|
|
@@ -1300,29 +1778,68 @@ function SimpleDataTable({
|
|
|
1300
1778
|
error = null,
|
|
1301
1779
|
emptyTitle: emptyTitleProp,
|
|
1302
1780
|
emptyDescription: emptyDescriptionProp,
|
|
1303
|
-
getRowKey
|
|
1781
|
+
getRowKey,
|
|
1782
|
+
stateTitleOrder
|
|
1304
1783
|
}) {
|
|
1305
1784
|
const { t } = useGdsTranslation4();
|
|
1306
1785
|
const emptyTitle = emptyTitleProp ?? t("gds.simpleDataTable.emptyTitle", "No data available");
|
|
1307
1786
|
const emptyDescription = emptyDescriptionProp ?? t("gds.simpleDataTable.emptyDescription", "There is no live data to show yet.");
|
|
1308
1787
|
if (error) {
|
|
1309
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ jsx9(StateBlock, { variant: "error", title: "Unable to load data", description: error, compact: true, titleOrder: stateTitleOrder });
|
|
1310
1789
|
}
|
|
1311
1790
|
if (loading) {
|
|
1312
|
-
return /* @__PURE__ */
|
|
1791
|
+
return /* @__PURE__ */ jsx9(StateBlock, { variant: "loading", title: "Loading data", description: "Please wait while the shared dataset is prepared.", compact: true, titleOrder: stateTitleOrder });
|
|
1313
1792
|
}
|
|
1314
1793
|
if (!rows.length) {
|
|
1315
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ jsx9(StateBlock, { variant: "empty", title: emptyTitle, description: emptyDescription, compact: true, titleOrder: stateTitleOrder });
|
|
1316
1795
|
}
|
|
1317
|
-
return /* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1796
|
+
return /* @__PURE__ */ jsx9(ScrollArea, { children: /* @__PURE__ */ jsxs8(Table, { striped: true, highlightOnHover: true, withTableBorder: true, withColumnBorders: true, children: [
|
|
1797
|
+
/* @__PURE__ */ jsx9(Table.Thead, { children: /* @__PURE__ */ jsx9(Table.Tr, { children: columns.map((column) => /* @__PURE__ */ jsx9(Table.Th, { children: column.header }, String(column.key))) }) }),
|
|
1798
|
+
/* @__PURE__ */ jsx9(Table.Tbody, { children: rows.map((row, index) => /* @__PURE__ */ jsx9(Table.Tr, { children: columns.map((column) => /* @__PURE__ */ jsx9(Table.Td, { children: column.render ? column.render(row) : String(row[column.key] ?? "") }, String(column.key))) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
1320
1799
|
] }) });
|
|
1321
1800
|
}
|
|
1322
1801
|
|
|
1802
|
+
// src/chart-colors.ts
|
|
1803
|
+
var gdsSeriesPalette = {
|
|
1804
|
+
primary: "var(--gds-brand-primary, var(--gds-vibe-primary, var(--mantine-primary-color-filled)))",
|
|
1805
|
+
success: "var(--gds-state-success, var(--mantine-color-green-6))",
|
|
1806
|
+
warning: "var(--gds-state-warning, var(--mantine-color-yellow-7))",
|
|
1807
|
+
danger: "var(--gds-state-danger, var(--mantine-color-red-6))",
|
|
1808
|
+
info: "var(--gds-state-info, var(--gds-vibe-accent, var(--mantine-primary-color-filled)))",
|
|
1809
|
+
neutral: "var(--gds-text-meta, var(--gds-vibe-muted, var(--mantine-color-gray-6)))",
|
|
1810
|
+
accent: "var(--gds-brand-accent-action, var(--gds-brand-accent, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))"
|
|
1811
|
+
};
|
|
1812
|
+
function getGdsSeriesColor(tone = "primary") {
|
|
1813
|
+
return gdsSeriesPalette[tone];
|
|
1814
|
+
}
|
|
1815
|
+
var GDS_CHART_SERIES_COLORS = [
|
|
1816
|
+
"var(--gds-chart-series-1)",
|
|
1817
|
+
"var(--gds-chart-series-2)",
|
|
1818
|
+
"var(--gds-chart-series-3)",
|
|
1819
|
+
"var(--gds-chart-series-4)",
|
|
1820
|
+
"var(--gds-chart-series-5)",
|
|
1821
|
+
"var(--gds-chart-series-6)",
|
|
1822
|
+
"var(--gds-chart-series-7)",
|
|
1823
|
+
"var(--gds-chart-series-8)"
|
|
1824
|
+
];
|
|
1825
|
+
var GDS_CHART_SERIES_SLOTS = GDS_CHART_SERIES_COLORS.length;
|
|
1826
|
+
function getGdsChartSeriesColor(index) {
|
|
1827
|
+
const slot = Number.isFinite(index) ? Math.max(1, Math.trunc(index)) : 1;
|
|
1828
|
+
return GDS_CHART_SERIES_COLORS[(slot - 1) % GDS_CHART_SERIES_SLOTS];
|
|
1829
|
+
}
|
|
1830
|
+
function resolveGdsChartTokenColor(token) {
|
|
1831
|
+
const value = token.trim();
|
|
1832
|
+
if (Object.hasOwn(gdsSeriesPalette, value)) return gdsSeriesPalette[value];
|
|
1833
|
+
if (value.startsWith("--")) return `var(${value})`;
|
|
1834
|
+
if (/^[a-z][\w-]*(\.[\w-]+)+$/i.test(value)) {
|
|
1835
|
+
return `var(--gds-${value.replace(/\./g, "-")})`;
|
|
1836
|
+
}
|
|
1837
|
+
return value;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1323
1840
|
// src/ChartTokenPanel.tsx
|
|
1324
|
-
import { Badge as Badge3, Group as Group4, Paper as Paper2, Stack as Stack5, Text as Text4, Title as Title3 } from "@mantine/core";
|
|
1325
|
-
import { jsx as
|
|
1841
|
+
import { Badge as Badge3, Box as Box5, Group as Group4, Paper as Paper2, Stack as Stack5, Text as Text4, Title as Title3 } from "@mantine/core";
|
|
1842
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1326
1843
|
function ChartTokenPanel({
|
|
1327
1844
|
title,
|
|
1328
1845
|
description,
|
|
@@ -1334,43 +1851,211 @@ function ChartTokenPanel({
|
|
|
1334
1851
|
retryAction
|
|
1335
1852
|
}) {
|
|
1336
1853
|
if (state === "loading") {
|
|
1337
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ jsx10(StateBlock, { variant: "loading", title: "Loading chart", description: summary, compact: true, action: retryAction });
|
|
1338
1855
|
}
|
|
1339
1856
|
if (state === "empty") {
|
|
1340
|
-
return /* @__PURE__ */
|
|
1857
|
+
return /* @__PURE__ */ jsx10(StateBlock, { variant: "empty", title: "No chart data", description: summary, compact: true, action: retryAction });
|
|
1341
1858
|
}
|
|
1342
1859
|
if (state === "below-threshold") {
|
|
1343
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsx10(StateBlock, { variant: "not-enough-data", title: "Not enough data for chart", description: summary, compact: true, action: retryAction });
|
|
1344
1861
|
}
|
|
1345
1862
|
if (state === "error") {
|
|
1346
|
-
return /* @__PURE__ */
|
|
1863
|
+
return /* @__PURE__ */ jsx10(StateBlock, { variant: "error", title: "Unable to load chart", description: summary, compact: true, action: retryAction });
|
|
1347
1864
|
}
|
|
1348
|
-
return /* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
/* @__PURE__ */
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
description ? /* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ jsx10(Paper2, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ jsxs9(Stack5, { gap: "md", children: [
|
|
1866
|
+
/* @__PURE__ */ jsxs9(Group4, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
1867
|
+
/* @__PURE__ */ jsxs9(Stack5, { gap: 4, children: [
|
|
1868
|
+
/* @__PURE__ */ jsx10(Title3, { order: 4, children: title }),
|
|
1869
|
+
description ? /* @__PURE__ */ jsx10(Text4, { size: "sm", c: "dimmed", children: description }) : null
|
|
1353
1870
|
] }),
|
|
1354
|
-
state !== "ready" ? /* @__PURE__ */
|
|
1871
|
+
state !== "ready" ? /* @__PURE__ */ jsx10(
|
|
1872
|
+
Badge3,
|
|
1873
|
+
{
|
|
1874
|
+
variant: "filled",
|
|
1875
|
+
style: {
|
|
1876
|
+
background: `var(--gds-badge-soft-${state === "permission-limited" ? "info" : "warning"})`,
|
|
1877
|
+
color: `var(--gds-badge-soft-${state === "permission-limited" ? "info" : "warning"}-fg)`
|
|
1878
|
+
},
|
|
1879
|
+
children: state.replace("-", " ")
|
|
1880
|
+
}
|
|
1881
|
+
) : null
|
|
1355
1882
|
] }),
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
legend.length ? /* @__PURE__ */
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1883
|
+
/* @__PURE__ */ jsx10(Text4, { size: "sm", children: summary }),
|
|
1884
|
+
legend.length ? /* @__PURE__ */ jsx10(Group4, { component: "ul", role: "list", gap: "md", wrap: "wrap", "aria-label": "Chart legend", className: "gds-chart-legend", children: legend.map((item, index) => /* @__PURE__ */ jsxs9(
|
|
1885
|
+
Group4,
|
|
1886
|
+
{
|
|
1887
|
+
component: "li",
|
|
1888
|
+
gap: "xs",
|
|
1889
|
+
wrap: "nowrap",
|
|
1890
|
+
"data-token": item.token,
|
|
1891
|
+
title: typeof item.description === "string" ? item.description : void 0,
|
|
1892
|
+
children: [
|
|
1893
|
+
/* @__PURE__ */ jsx10(
|
|
1894
|
+
Box5,
|
|
1895
|
+
{
|
|
1896
|
+
component: "span",
|
|
1897
|
+
"aria-hidden": true,
|
|
1898
|
+
className: "gds-chart-legend-swatch",
|
|
1899
|
+
style: { background: resolveGdsChartTokenColor(item.token) }
|
|
1900
|
+
}
|
|
1901
|
+
),
|
|
1902
|
+
/* @__PURE__ */ jsx10(Text4, { component: "span", size: "sm", children: item.label })
|
|
1903
|
+
]
|
|
1904
|
+
},
|
|
1905
|
+
`${String(item.label)}-${index}`
|
|
1906
|
+
)) }) : null,
|
|
1362
1907
|
children,
|
|
1363
|
-
tableFallback ? /* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1908
|
+
tableFallback ? /* @__PURE__ */ jsxs9(Stack5, { gap: "xs", children: [
|
|
1909
|
+
/* @__PURE__ */ jsx10(Text4, { size: "sm", fw: 600, children: "Accessible data fallback" }),
|
|
1365
1910
|
tableFallback
|
|
1366
1911
|
] }) : null
|
|
1367
1912
|
] }) });
|
|
1368
1913
|
}
|
|
1369
1914
|
|
|
1370
|
-
// src/
|
|
1915
|
+
// src/chart-primitives.tsx
|
|
1371
1916
|
import { useId as useId2 } from "react";
|
|
1372
|
-
import {
|
|
1373
|
-
import { jsx as
|
|
1917
|
+
import { Box as Box6, Group as Group5, Paper as Paper3, Stack as Stack6, Text as Text5 } from "@mantine/core";
|
|
1918
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1919
|
+
function SemanticChartFrame({ title, summary, children, labelledBy, describedBy }) {
|
|
1920
|
+
return /* @__PURE__ */ jsx11(Paper3, { withBorder: true, radius: "md", p: "md", role: "img", "aria-labelledby": labelledBy, "aria-describedby": describedBy, children: /* @__PURE__ */ jsxs10(Stack6, { gap: "sm", children: [
|
|
1921
|
+
/* @__PURE__ */ jsx11(Text5, { id: labelledBy, fw: 700, children: title }),
|
|
1922
|
+
/* @__PURE__ */ jsx11(Text5, { id: describedBy, size: "sm", c: "dimmed", children: summary }),
|
|
1923
|
+
children
|
|
1924
|
+
] }) });
|
|
1925
|
+
}
|
|
1926
|
+
function getMaxValue(data) {
|
|
1927
|
+
return Math.max(1, ...data.map((item) => Math.abs(item.value ?? 0)));
|
|
1928
|
+
}
|
|
1929
|
+
function Bars({ data, tone = "primary" }) {
|
|
1930
|
+
const max = getMaxValue(data);
|
|
1931
|
+
return /* @__PURE__ */ jsx11(Stack6, { gap: "xs", children: data.map((item) => /* @__PURE__ */ jsxs10(Group5, { gap: "xs", wrap: "nowrap", children: [
|
|
1932
|
+
/* @__PURE__ */ jsx11(Text5, { size: "xs", miw: 96, children: item.label }),
|
|
1933
|
+
/* @__PURE__ */ jsx11(Box6, { h: 12, bg: getGdsSeriesColor(tone), style: { width: `${Math.max(4, Math.abs(item.value ?? 0) / max * 100)}%`, borderRadius: "var(--mantine-radius-sm)" } }),
|
|
1934
|
+
/* @__PURE__ */ jsx11(Text5, { size: "xs", c: "dimmed", children: item.value ?? "-" })
|
|
1935
|
+
] }, `${item.group ?? "series"}-${item.label}`)) });
|
|
1936
|
+
}
|
|
1937
|
+
var PLOT_TOP = 10;
|
|
1938
|
+
var GRID_LINES = [PLOT_TOP, 40, 70, 100];
|
|
1939
|
+
function plotPoints(data) {
|
|
1940
|
+
const max = getMaxValue(data);
|
|
1941
|
+
return data.map((item, index) => `${index / Math.max(1, data.length - 1) * 100},${100 - Math.abs(item.value ?? 0) / max * (100 - PLOT_TOP)}`).join(" ");
|
|
1942
|
+
}
|
|
1943
|
+
function Gridlines() {
|
|
1944
|
+
return /* @__PURE__ */ jsx11("g", { "aria-hidden": true, children: GRID_LINES.map((y) => /* @__PURE__ */ jsx11("line", { className: "gds-chart-grid", x1: "0", x2: "100", y1: y, y2: y, style: { stroke: "var(--gds-chart-grid)" }, strokeWidth: "1", vectorEffect: "non-scaling-stroke" }, y)) });
|
|
1945
|
+
}
|
|
1946
|
+
function AxisLabels({ data }) {
|
|
1947
|
+
if (data.length === 0) return null;
|
|
1948
|
+
const picks = data.length > 2 ? [data[0], data[Math.floor((data.length - 1) / 2)], data[data.length - 1]] : data;
|
|
1949
|
+
return /* @__PURE__ */ jsx11(Group5, { justify: "space-between", gap: "xs", wrap: "nowrap", "aria-hidden": true, className: "gds-chart-axis", children: picks.map((item, index) => /* @__PURE__ */ jsx11(Text5, { size: "xs", className: "gds-chart-axis-label", style: { color: "var(--gds-chart-axis-text)" }, children: item.label }, `${item.label}-${index}`)) });
|
|
1950
|
+
}
|
|
1951
|
+
function PlotSvg({ children }) {
|
|
1952
|
+
return /* @__PURE__ */ jsx11(Box6, { component: "svg", viewBox: "0 0 100 100", preserveAspectRatio: "none", h: 140, w: "100%", role: "presentation", "aria-hidden": true, style: { display: "block", overflow: "visible" }, children });
|
|
1953
|
+
}
|
|
1954
|
+
function SeriesLine({ points, color }) {
|
|
1955
|
+
return /* @__PURE__ */ jsx11("polyline", { className: "gds-chart-line", points, fill: "none", style: { stroke: color }, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" });
|
|
1956
|
+
}
|
|
1957
|
+
function Line({ data, tone = "primary", axisLabels = false }) {
|
|
1958
|
+
return /* @__PURE__ */ jsxs10(Stack6, { gap: 4, children: [
|
|
1959
|
+
/* @__PURE__ */ jsxs10(PlotSvg, { children: [
|
|
1960
|
+
/* @__PURE__ */ jsx11(Gridlines, {}),
|
|
1961
|
+
/* @__PURE__ */ jsx11(SeriesLine, { points: plotPoints(data), color: getGdsSeriesColor(tone) })
|
|
1962
|
+
] }),
|
|
1963
|
+
axisLabels ? /* @__PURE__ */ jsx11(AxisLabels, { data }) : null
|
|
1964
|
+
] });
|
|
1965
|
+
}
|
|
1966
|
+
function Area({ data, tone = "primary", axisLabels = false }) {
|
|
1967
|
+
const gradientId = `gds-chart-fill-${useId2().replace(/[^\w-]/g, "")}`;
|
|
1968
|
+
const points = plotPoints(data);
|
|
1969
|
+
const color = getGdsSeriesColor(tone);
|
|
1970
|
+
return /* @__PURE__ */ jsxs10(Stack6, { gap: 4, children: [
|
|
1971
|
+
/* @__PURE__ */ jsxs10(PlotSvg, { children: [
|
|
1972
|
+
/* @__PURE__ */ jsx11("defs", { children: /* @__PURE__ */ jsxs10("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1973
|
+
/* @__PURE__ */ jsx11("stop", { offset: "0%", style: { stopColor: color, stopOpacity: "var(--gds-chart-area-opacity-start)" } }),
|
|
1974
|
+
/* @__PURE__ */ jsx11("stop", { offset: "100%", style: { stopColor: color, stopOpacity: "var(--gds-chart-area-opacity-end)" } })
|
|
1975
|
+
] }) }),
|
|
1976
|
+
/* @__PURE__ */ jsx11(Gridlines, {}),
|
|
1977
|
+
/* @__PURE__ */ jsx11("polygon", { className: "gds-chart-area-fill", points: `0,100 ${points} 100,100`, fill: `url(#${gradientId})` }),
|
|
1978
|
+
/* @__PURE__ */ jsx11(SeriesLine, { points, color })
|
|
1979
|
+
] }),
|
|
1980
|
+
axisLabels ? /* @__PURE__ */ jsx11(AxisLabels, { data }) : null
|
|
1981
|
+
] });
|
|
1982
|
+
}
|
|
1983
|
+
function Sparkline({ data, tone = "primary" }) {
|
|
1984
|
+
const max = getMaxValue(data);
|
|
1985
|
+
const points = data.map((item, index) => `${index / Math.max(1, data.length - 1) * 100},${24 - Math.abs(item.value ?? 0) / max * 20}`).join(" ");
|
|
1986
|
+
return /* @__PURE__ */ jsx11(Box6, { component: "svg", viewBox: "0 0 100 28", h: 48, w: "100%", role: "presentation", "aria-hidden": true, children: /* @__PURE__ */ jsx11("polyline", { points, fill: "none", stroke: getGdsSeriesColor(tone), strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1987
|
+
}
|
|
1988
|
+
function Radar({ data, tone = "primary" }) {
|
|
1989
|
+
const max = getMaxValue(data);
|
|
1990
|
+
const center = 50;
|
|
1991
|
+
const radius = 42;
|
|
1992
|
+
const points = data.map((item, index) => {
|
|
1993
|
+
const angle = Math.PI * 2 / data.length * index - Math.PI / 2;
|
|
1994
|
+
const ratio = Math.abs(item.value ?? 0) / max;
|
|
1995
|
+
return `${center + Math.cos(angle) * radius * ratio},${center + Math.sin(angle) * radius * ratio}`;
|
|
1996
|
+
}).join(" ");
|
|
1997
|
+
return /* @__PURE__ */ jsxs10(Box6, { component: "svg", viewBox: "0 0 100 100", h: 160, w: "100%", role: "presentation", "aria-hidden": true, children: [
|
|
1998
|
+
/* @__PURE__ */ jsx11("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: "var(--gds-border-card, var(--mantine-color-gray-3))", strokeWidth: "1" }),
|
|
1999
|
+
/* @__PURE__ */ jsx11("polygon", { points, fill: getGdsSeriesColor(tone), opacity: "0.2" }),
|
|
2000
|
+
/* @__PURE__ */ jsx11("polyline", { points: `${points} ${points.split(" ")[0]}`, fill: "none", stroke: getGdsSeriesColor(tone), strokeWidth: "2.5", strokeLinejoin: "round" })
|
|
2001
|
+
] });
|
|
2002
|
+
}
|
|
2003
|
+
function Gauge({ data, tone = "primary" }) {
|
|
2004
|
+
const max = getMaxValue(data);
|
|
2005
|
+
const current = Math.max(0, data[0]?.value ?? 0);
|
|
2006
|
+
const width = `${Math.min(100, current / max * 100)}%`;
|
|
2007
|
+
return /* @__PURE__ */ jsxs10(Stack6, { gap: "xs", children: [
|
|
2008
|
+
/* @__PURE__ */ jsx11(Box6, { h: 18, bg: "var(--gds-bg-info-tag, var(--mantine-color-gray-1))", style: { borderRadius: "var(--mantine-radius-xl)", overflow: "hidden" }, children: /* @__PURE__ */ jsx11(Box6, { h: "100%", bg: getGdsSeriesColor(tone), style: { width, borderRadius: "var(--mantine-radius-xl)" } }) }),
|
|
2009
|
+
/* @__PURE__ */ jsxs10(Text5, { size: "xs", c: "dimmed", children: [
|
|
2010
|
+
data[0]?.label ?? "Current",
|
|
2011
|
+
": ",
|
|
2012
|
+
data[0]?.value ?? "-"
|
|
2013
|
+
] })
|
|
2014
|
+
] });
|
|
2015
|
+
}
|
|
2016
|
+
function Heatmap({ data, tone = "primary" }) {
|
|
2017
|
+
const max = getMaxValue(data);
|
|
2018
|
+
return /* @__PURE__ */ jsx11(
|
|
2019
|
+
Box6,
|
|
2020
|
+
{
|
|
2021
|
+
style: {
|
|
2022
|
+
display: "grid",
|
|
2023
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(56px, 1fr))",
|
|
2024
|
+
gap: "var(--mantine-spacing-xs)"
|
|
2025
|
+
},
|
|
2026
|
+
children: data.map((item) => /* @__PURE__ */ jsx11(
|
|
2027
|
+
Box6,
|
|
2028
|
+
{
|
|
2029
|
+
p: "xs",
|
|
2030
|
+
style: {
|
|
2031
|
+
minHeight: 48,
|
|
2032
|
+
borderRadius: "var(--mantine-radius-sm)",
|
|
2033
|
+
background: getGdsSeriesColor(tone),
|
|
2034
|
+
opacity: Math.max(0.22, Math.abs(item.value ?? 0) / max)
|
|
2035
|
+
},
|
|
2036
|
+
children: /* @__PURE__ */ jsx11(Text5, { size: "xs", c: "var(--gds-text-on-inverse, var(--mantine-color-white))", children: item.label })
|
|
2037
|
+
},
|
|
2038
|
+
`${item.group ?? "row"}-${item.label}`
|
|
2039
|
+
))
|
|
2040
|
+
}
|
|
2041
|
+
);
|
|
2042
|
+
}
|
|
2043
|
+
function semanticRenderer(kind, tone, axisLabels = false) {
|
|
2044
|
+
return ({ title, summary, data, labelledBy, describedBy }) => /* @__PURE__ */ jsxs10(SemanticChartFrame, { title, summary, labelledBy, describedBy, children: [
|
|
2045
|
+
kind === "line" ? /* @__PURE__ */ jsx11(Line, { data, tone, axisLabels }) : null,
|
|
2046
|
+
kind === "area" ? /* @__PURE__ */ jsx11(Area, { data, tone, axisLabels }) : null,
|
|
2047
|
+
kind === "sparkline" ? /* @__PURE__ */ jsx11(Sparkline, { data, tone }) : null,
|
|
2048
|
+
kind === "radar" ? /* @__PURE__ */ jsx11(Radar, { data, tone }) : null,
|
|
2049
|
+
kind === "gauge" ? /* @__PURE__ */ jsx11(Gauge, { data, tone }) : null,
|
|
2050
|
+
kind === "heatmap" ? /* @__PURE__ */ jsx11(Heatmap, { data, tone }) : null,
|
|
2051
|
+
kind === "bar" || kind === "stacked-bar" ? /* @__PURE__ */ jsx11(Bars, { data, tone }) : null
|
|
2052
|
+
] });
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
// src/GdsChart.tsx
|
|
2056
|
+
import { useId as useId3 } from "react";
|
|
2057
|
+
import { Badge as Badge4, Group as Group6, Paper as Paper4, Stack as Stack7, Text as Text6 } from "@mantine/core";
|
|
2058
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1374
2059
|
var gdsChartTypeRegistry = {
|
|
1375
2060
|
line: { type: "line", label: "Line", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, summaryHint: "Trend over an ordered series." },
|
|
1376
2061
|
area: { type: "area", label: "Area", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, summaryHint: "Filled trend over an ordered series." },
|
|
@@ -1388,8 +2073,8 @@ var gdsChartTypeRegistry = {
|
|
|
1388
2073
|
sankey: { type: "sankey", label: "Sankey", family: "process", minDataPoints: 1, maxDataPoints: 200, requiresGroup: false, summaryHint: "Flow volume between source and target stages." }
|
|
1389
2074
|
};
|
|
1390
2075
|
var gdsDefaultChartLegend = [
|
|
1391
|
-
{ label: "Primary series", token: "
|
|
1392
|
-
{ label: "Secondary series", token: "
|
|
2076
|
+
{ label: "Primary series", token: "chart.series-1", description: "Primary measured value" },
|
|
2077
|
+
{ label: "Secondary series", token: "chart.series-2", description: "Grouped or comparative value" }
|
|
1393
2078
|
];
|
|
1394
2079
|
var gdsChartSetATypeRegistry = {
|
|
1395
2080
|
line: gdsChartTypeRegistry.line,
|
|
@@ -1604,34 +2289,45 @@ function validateGdsChartData(type, data, config = {}) {
|
|
|
1604
2289
|
definition
|
|
1605
2290
|
};
|
|
1606
2291
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
2292
|
+
var DRAWN_CHART_TYPES = {
|
|
2293
|
+
line: "line",
|
|
2294
|
+
area: "area",
|
|
2295
|
+
bar: "bar",
|
|
2296
|
+
"stacked-bar": "stacked-bar",
|
|
2297
|
+
radar: "radar",
|
|
2298
|
+
heatmap: "heatmap"
|
|
2299
|
+
};
|
|
2300
|
+
function DefaultChartRenderer(context) {
|
|
2301
|
+
const { type, title, summary, data, definition, labelledBy, describedBy } = context;
|
|
2302
|
+
const drawn = DRAWN_CHART_TYPES[type];
|
|
2303
|
+
if (drawn) return semanticRenderer(drawn, "primary")(context);
|
|
2304
|
+
return /* @__PURE__ */ jsx12(Paper4, { withBorder: true, radius: "md", p: "md", role: "img", "aria-labelledby": labelledBy, "aria-describedby": describedBy, children: /* @__PURE__ */ jsxs11(Stack7, { gap: "sm", children: [
|
|
2305
|
+
/* @__PURE__ */ jsxs11(Group6, { justify: "space-between", children: [
|
|
2306
|
+
/* @__PURE__ */ jsx12(Text6, { id: labelledBy, fw: 700, children: title }),
|
|
2307
|
+
/* @__PURE__ */ jsx12(Badge4, { variant: "light", children: type })
|
|
1612
2308
|
] }),
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsx12(Text6, { id: describedBy, size: "sm", c: "dimmed", children: summary }),
|
|
2310
|
+
/* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
1615
2311
|
"Type lane: ",
|
|
1616
2312
|
type
|
|
1617
2313
|
] }),
|
|
1618
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
1619
2315
|
"Registry family: ",
|
|
1620
2316
|
definition.family
|
|
1621
2317
|
] }),
|
|
1622
|
-
isGdsChartSetAType(type) ? /* @__PURE__ */
|
|
2318
|
+
isGdsChartSetAType(type) ? /* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
1623
2319
|
"Set A primitive: ",
|
|
1624
2320
|
getSetARendererLabel(type)
|
|
1625
2321
|
] }) : null,
|
|
1626
|
-
isGdsChartSetBType(type) ? /* @__PURE__ */
|
|
2322
|
+
isGdsChartSetBType(type) ? /* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
1627
2323
|
"Set B primitive: ",
|
|
1628
2324
|
getSetBRendererLabel(type)
|
|
1629
2325
|
] }) : null,
|
|
1630
|
-
isGdsChartSetCType(type) ? /* @__PURE__ */
|
|
2326
|
+
isGdsChartSetCType(type) ? /* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
1631
2327
|
"Set C primitive: ",
|
|
1632
2328
|
getSetCRendererLabel(type)
|
|
1633
2329
|
] }) : null,
|
|
1634
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
1635
2331
|
"Data points: ",
|
|
1636
2332
|
data.length
|
|
1637
2333
|
] })
|
|
@@ -1648,8 +2344,8 @@ function GdsChart({
|
|
|
1648
2344
|
retryAction,
|
|
1649
2345
|
renderer
|
|
1650
2346
|
}) {
|
|
1651
|
-
const labelledBy =
|
|
1652
|
-
const describedBy =
|
|
2347
|
+
const labelledBy = useId3();
|
|
2348
|
+
const describedBy = useId3();
|
|
1653
2349
|
const validation = validateGdsChartData(type, data, config);
|
|
1654
2350
|
const resolvedState = state ?? validation.state;
|
|
1655
2351
|
const tableRows = validation.visibleData.map((item) => ({
|
|
@@ -1659,7 +2355,9 @@ function GdsChart({
|
|
|
1659
2355
|
group: item.group ?? "-"
|
|
1660
2356
|
}));
|
|
1661
2357
|
const Renderer = renderer ?? DefaultChartRenderer;
|
|
1662
|
-
|
|
2358
|
+
const hasSecondary = tableRows.some((row) => row.secondaryValue !== "-");
|
|
2359
|
+
const hasGroup = tableRows.some((row) => row.group !== "-");
|
|
2360
|
+
return /* @__PURE__ */ jsx12(
|
|
1663
2361
|
ChartTokenPanel,
|
|
1664
2362
|
{
|
|
1665
2363
|
title,
|
|
@@ -1668,19 +2366,19 @@ function GdsChart({
|
|
|
1668
2366
|
state: resolvedState,
|
|
1669
2367
|
retryAction,
|
|
1670
2368
|
legend,
|
|
1671
|
-
tableFallback: /* @__PURE__ */
|
|
2369
|
+
tableFallback: /* @__PURE__ */ jsx12(
|
|
1672
2370
|
SimpleDataTable,
|
|
1673
2371
|
{
|
|
1674
2372
|
columns: [
|
|
1675
2373
|
{ key: "label", header: "Label" },
|
|
1676
2374
|
{ key: "value", header: config.tableValueHeader ?? "Value" },
|
|
1677
|
-
{ key: "secondaryValue", header: "Secondary value" },
|
|
1678
|
-
{ key: "group", header: config.groupLabel ?? "Group" }
|
|
2375
|
+
...hasSecondary ? [{ key: "secondaryValue", header: "Secondary value" }] : [],
|
|
2376
|
+
...hasGroup ? [{ key: "group", header: config.groupLabel ?? "Group" }] : []
|
|
1679
2377
|
],
|
|
1680
2378
|
rows: tableRows
|
|
1681
2379
|
}
|
|
1682
2380
|
),
|
|
1683
|
-
children: resolvedState === "ready" || resolvedState === "partial" || resolvedState === "permission-limited" ? /* @__PURE__ */
|
|
2381
|
+
children: resolvedState === "ready" || resolvedState === "partial" || resolvedState === "permission-limited" ? /* @__PURE__ */ jsx12(
|
|
1684
2382
|
Renderer,
|
|
1685
2383
|
{
|
|
1686
2384
|
type,
|
|
@@ -1697,26 +2395,20 @@ function GdsChart({
|
|
|
1697
2395
|
);
|
|
1698
2396
|
}
|
|
1699
2397
|
|
|
1700
|
-
// src/locales/index.ts
|
|
1701
|
-
var gdsLocales = {
|
|
1702
|
-
en,
|
|
1703
|
-
es,
|
|
1704
|
-
hu,
|
|
1705
|
-
de,
|
|
1706
|
-
fr,
|
|
1707
|
-
it,
|
|
1708
|
-
ru,
|
|
1709
|
-
he,
|
|
1710
|
-
ar,
|
|
1711
|
-
zh,
|
|
1712
|
-
ja,
|
|
1713
|
-
ko
|
|
1714
|
-
};
|
|
1715
|
-
function getGdsMessages(locale) {
|
|
1716
|
-
return gdsLocales[locale] ?? en;
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
2398
|
export {
|
|
2399
|
+
normalizeGdsResponsiveValue,
|
|
2400
|
+
resolveGdsLayoutStyle,
|
|
2401
|
+
GdsBox,
|
|
2402
|
+
GdsStack,
|
|
2403
|
+
GdsInline,
|
|
2404
|
+
GdsCluster,
|
|
2405
|
+
GdsGrid,
|
|
2406
|
+
GdsColumnGrid,
|
|
2407
|
+
GdsColumnGridItem,
|
|
2408
|
+
GdsSplit,
|
|
2409
|
+
GdsSidebar,
|
|
2410
|
+
GdsBleed,
|
|
2411
|
+
GdsContainer,
|
|
1720
2412
|
GdsVocabulary,
|
|
1721
2413
|
createGdsVocabularyPack,
|
|
1722
2414
|
mergeGdsVocabularyPacks,
|
|
@@ -1748,11 +2440,21 @@ export {
|
|
|
1748
2440
|
GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX,
|
|
1749
2441
|
GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX,
|
|
1750
2442
|
ListingCard,
|
|
2443
|
+
gdsLocales,
|
|
2444
|
+
getGdsMessages,
|
|
1751
2445
|
createGdsOwnedContrastTokens,
|
|
1752
2446
|
getGdsOwnedContrastProps,
|
|
1753
2447
|
FormField,
|
|
1754
2448
|
SimpleDataTable,
|
|
2449
|
+
gdsSeriesPalette,
|
|
2450
|
+
getGdsSeriesColor,
|
|
2451
|
+
GDS_CHART_SERIES_COLORS,
|
|
2452
|
+
GDS_CHART_SERIES_SLOTS,
|
|
2453
|
+
getGdsChartSeriesColor,
|
|
2454
|
+
resolveGdsChartTokenColor,
|
|
1755
2455
|
ChartTokenPanel,
|
|
2456
|
+
SemanticChartFrame,
|
|
2457
|
+
semanticRenderer,
|
|
1756
2458
|
gdsChartTypeRegistry,
|
|
1757
2459
|
gdsDefaultChartLegend,
|
|
1758
2460
|
gdsChartSetATypeRegistry,
|
|
@@ -1762,7 +2464,5 @@ export {
|
|
|
1762
2464
|
isGdsChartSetBType,
|
|
1763
2465
|
isGdsChartSetCType,
|
|
1764
2466
|
validateGdsChartData,
|
|
1765
|
-
GdsChart
|
|
1766
|
-
gdsLocales,
|
|
1767
|
-
getGdsMessages
|
|
2467
|
+
GdsChart
|
|
1768
2468
|
};
|