@doneisbetter/gds-theme 3.0.0 → 3.0.1
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/dist/{chunk-QTH2PIZY.mjs → chunk-7B3MG4NV.mjs} +28 -6
- package/dist/chunk-TAPLA36E.mjs +354 -0
- package/dist/client.d.mts +3 -2
- package/dist/client.d.ts +3 -2
- package/dist/client.js +170 -10
- package/dist/client.mjs +12 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +170 -10
- package/dist/index.mjs +12 -2
- package/dist/server.d.mts +27 -1
- package/dist/server.d.ts +27 -1
- package/dist/server.js +142 -4
- package/dist/server.mjs +11 -1
- package/package.json +1 -1
- package/styles.css +1 -0
- package/dist/chunk-Z5I7D255.mjs +0 -221
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
gdsTheme
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TAPLA36E.mjs";
|
|
4
4
|
|
|
5
5
|
// src/i18n.ts
|
|
6
6
|
import { createContext, useContext } from "react";
|
|
@@ -26,14 +26,36 @@ function GdsProvider({
|
|
|
26
26
|
locale = "en",
|
|
27
27
|
messages = {},
|
|
28
28
|
theme = gdsTheme,
|
|
29
|
-
defaultColorScheme = "light"
|
|
29
|
+
defaultColorScheme = "light",
|
|
30
|
+
forceColorScheme
|
|
30
31
|
}) {
|
|
31
32
|
const isRtl = ["ar", "he"].includes(locale);
|
|
32
33
|
const dir = isRtl ? "rtl" : "ltr";
|
|
33
|
-
return /* @__PURE__ */ jsx(DirectionProvider, { initialDirection: dir, children: /* @__PURE__ */ jsx(GdsI18nContext.Provider, { value: { locale, messages }, children: /* @__PURE__ */ jsx(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
return /* @__PURE__ */ jsx(DirectionProvider, { initialDirection: dir, children: /* @__PURE__ */ jsx(GdsI18nContext.Provider, { value: { locale, messages }, children: /* @__PURE__ */ jsx(
|
|
35
|
+
MantineProvider,
|
|
36
|
+
{
|
|
37
|
+
theme,
|
|
38
|
+
withCssVariables: true,
|
|
39
|
+
withGlobalClasses: true,
|
|
40
|
+
defaultColorScheme,
|
|
41
|
+
forceColorScheme,
|
|
42
|
+
children: /* @__PURE__ */ jsx(ModalsProvider, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(Notifications, {}),
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Box,
|
|
46
|
+
{
|
|
47
|
+
dir,
|
|
48
|
+
mih: "100vh",
|
|
49
|
+
h: "100%",
|
|
50
|
+
bg: "var(--mantine-color-body)",
|
|
51
|
+
c: "var(--mantine-color-text)",
|
|
52
|
+
style: { transition: "background-color 120ms ease, color 120ms ease" },
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }) })
|
|
57
|
+
}
|
|
58
|
+
) }) });
|
|
37
59
|
}
|
|
38
60
|
|
|
39
61
|
// src/notifications.ts
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// src/theme.ts
|
|
2
|
+
import { DEFAULT_THEME, createTheme, mergeMantineTheme, mergeThemeOverrides } from "@mantine/core";
|
|
3
|
+
var baseTheme = mergeMantineTheme(DEFAULT_THEME, createTheme({
|
|
4
|
+
primaryColor: "violet",
|
|
5
|
+
fontFamily: "Inter, system-ui, Avenir, Helvetica, Arial, sans-serif",
|
|
6
|
+
fontSmoothing: true,
|
|
7
|
+
defaultRadius: "md",
|
|
8
|
+
black: "#111827",
|
|
9
|
+
white: "#ffffff",
|
|
10
|
+
headings: {
|
|
11
|
+
fontFamily: "Inter, system-ui, Avenir, Helvetica, Arial, sans-serif",
|
|
12
|
+
sizes: {
|
|
13
|
+
h1: { fontSize: "2.5rem", fontWeight: "800" },
|
|
14
|
+
h2: { fontSize: "1.75rem", fontWeight: "700" },
|
|
15
|
+
h3: { fontSize: "1.25rem", fontWeight: "600" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
shadows: {
|
|
19
|
+
md: "0 8px 24px rgba(15, 23, 42, 0.08)",
|
|
20
|
+
lg: "0 16px 40px rgba(15, 23, 42, 0.12)"
|
|
21
|
+
},
|
|
22
|
+
components: {
|
|
23
|
+
Button: {
|
|
24
|
+
defaultProps: {
|
|
25
|
+
radius: "md",
|
|
26
|
+
size: "sm",
|
|
27
|
+
fw: 600
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
Card: {
|
|
31
|
+
defaultProps: {
|
|
32
|
+
radius: "lg",
|
|
33
|
+
shadow: "sm",
|
|
34
|
+
withBorder: true
|
|
35
|
+
},
|
|
36
|
+
styles: {
|
|
37
|
+
root: {
|
|
38
|
+
background: "var(--mantine-color-body)"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
Paper: {
|
|
43
|
+
defaultProps: {
|
|
44
|
+
radius: "lg",
|
|
45
|
+
withBorder: true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
TextInput: {
|
|
49
|
+
defaultProps: {
|
|
50
|
+
radius: "md"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
Table: {
|
|
54
|
+
defaultProps: {
|
|
55
|
+
highlightOnHover: true,
|
|
56
|
+
verticalSpacing: "md"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
Badge: {
|
|
60
|
+
defaultProps: {
|
|
61
|
+
radius: "xl"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
var gdsTheme = baseTheme;
|
|
67
|
+
var gdsDarkPublicTheme = extendGdsTheme({
|
|
68
|
+
primaryColor: "violet",
|
|
69
|
+
components: {
|
|
70
|
+
AppShell: {
|
|
71
|
+
styles: {
|
|
72
|
+
main: {
|
|
73
|
+
background: "var(--mantine-color-dark-8)"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
Card: {
|
|
78
|
+
styles: {
|
|
79
|
+
root: {
|
|
80
|
+
background: "var(--mantine-color-dark-7)",
|
|
81
|
+
borderColor: "var(--mantine-color-dark-4)"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
Paper: {
|
|
86
|
+
styles: {
|
|
87
|
+
root: {
|
|
88
|
+
background: "var(--mantine-color-dark-7)",
|
|
89
|
+
borderColor: "var(--mantine-color-dark-4)"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
Table: {
|
|
94
|
+
styles: {
|
|
95
|
+
table: {
|
|
96
|
+
color: "var(--mantine-color-gray-0)"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
var gdsFlatSurfaceTheme = extendGdsTheme({
|
|
103
|
+
shadows: {
|
|
104
|
+
xs: "none",
|
|
105
|
+
sm: "none",
|
|
106
|
+
md: "none",
|
|
107
|
+
lg: "none",
|
|
108
|
+
xl: "none"
|
|
109
|
+
},
|
|
110
|
+
components: {
|
|
111
|
+
Card: {
|
|
112
|
+
defaultProps: {
|
|
113
|
+
shadow: void 0,
|
|
114
|
+
withBorder: true
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
Paper: {
|
|
118
|
+
defaultProps: {
|
|
119
|
+
withBorder: true
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
var gdsEditorialPublicTheme = extendGdsTheme({
|
|
125
|
+
headings: {
|
|
126
|
+
fontFamily: '"Instrument Serif", Georgia, "Times New Roman", serif',
|
|
127
|
+
sizes: {
|
|
128
|
+
h1: { fontSize: "2.75rem", fontWeight: "700" },
|
|
129
|
+
h2: { fontSize: "2rem", fontWeight: "700" },
|
|
130
|
+
h3: { fontSize: "1.375rem", fontWeight: "600" }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
shadows: {
|
|
134
|
+
xs: "none",
|
|
135
|
+
sm: "none",
|
|
136
|
+
md: "none",
|
|
137
|
+
lg: "none",
|
|
138
|
+
xl: "none"
|
|
139
|
+
},
|
|
140
|
+
components: {
|
|
141
|
+
Card: {
|
|
142
|
+
defaultProps: {
|
|
143
|
+
shadow: void 0,
|
|
144
|
+
withBorder: true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
Paper: {
|
|
148
|
+
defaultProps: {
|
|
149
|
+
withBorder: true
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
function composeGdsTheme(overrides = {}) {
|
|
155
|
+
return mergeMantineTheme(baseTheme, overrides);
|
|
156
|
+
}
|
|
157
|
+
function createPublicBrandTheme({
|
|
158
|
+
editorialSerif = false,
|
|
159
|
+
flatSurfaces = false,
|
|
160
|
+
overrides = {}
|
|
161
|
+
} = {}) {
|
|
162
|
+
const layeredOverrides = [];
|
|
163
|
+
if (flatSurfaces) {
|
|
164
|
+
layeredOverrides.push(gdsFlatSurfaceTheme);
|
|
165
|
+
}
|
|
166
|
+
if (editorialSerif) {
|
|
167
|
+
layeredOverrides.push(gdsEditorialPublicTheme);
|
|
168
|
+
}
|
|
169
|
+
layeredOverrides.push(overrides);
|
|
170
|
+
const mergedOverrides = layeredOverrides.reduce(
|
|
171
|
+
(theme, layer) => mergeThemeOverrides(theme, layer),
|
|
172
|
+
{}
|
|
173
|
+
);
|
|
174
|
+
return composeGdsTheme(mergedOverrides);
|
|
175
|
+
}
|
|
176
|
+
function extendGdsTheme(overrides = {}) {
|
|
177
|
+
return composeGdsTheme(overrides);
|
|
178
|
+
}
|
|
179
|
+
function withGdsMotion(overrides = {}) {
|
|
180
|
+
return extendGdsTheme(
|
|
181
|
+
mergeThemeOverrides(
|
|
182
|
+
{
|
|
183
|
+
components: {
|
|
184
|
+
Button: {
|
|
185
|
+
styles: {
|
|
186
|
+
root: {
|
|
187
|
+
transition: "transform 150ms ease, filter 120ms ease",
|
|
188
|
+
"&:hover": {
|
|
189
|
+
transform: "translateY(-1px)",
|
|
190
|
+
filter: "brightness(1.05)"
|
|
191
|
+
},
|
|
192
|
+
"&:active": {
|
|
193
|
+
transform: "translateY(0)",
|
|
194
|
+
filter: "brightness(0.95)"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
Card: {
|
|
200
|
+
styles: {
|
|
201
|
+
root: {
|
|
202
|
+
transition: "transform 150ms ease, box-shadow 150ms ease"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
overrides
|
|
209
|
+
)
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// src/theme-presets.ts
|
|
214
|
+
function createVibrantPresetTheme(primaryColor, options = {}) {
|
|
215
|
+
const darkSurface = options.darkForward ? `color-mix(in srgb, var(--mantine-color-${primaryColor}-9) 18%, var(--mantine-color-dark-8))` : "var(--mantine-color-dark-8)";
|
|
216
|
+
return extendGdsTheme({
|
|
217
|
+
primaryColor,
|
|
218
|
+
components: {
|
|
219
|
+
AppShell: {
|
|
220
|
+
styles: {
|
|
221
|
+
main: {
|
|
222
|
+
background: `light-dark(color-mix(in srgb, var(--mantine-color-${primaryColor}-0) 58%, var(--mantine-color-white)), ${darkSurface})`
|
|
223
|
+
},
|
|
224
|
+
header: {
|
|
225
|
+
background: `light-dark(color-mix(in srgb, var(--mantine-color-${primaryColor}-0) 68%, var(--mantine-color-white)), var(--mantine-color-dark-8))`,
|
|
226
|
+
borderColor: `light-dark(var(--mantine-color-${primaryColor}-2), var(--mantine-color-dark-5))`
|
|
227
|
+
},
|
|
228
|
+
navbar: {
|
|
229
|
+
background: `light-dark(color-mix(in srgb, var(--mantine-color-${primaryColor}-0) 48%, var(--mantine-color-white)), var(--mantine-color-dark-8))`,
|
|
230
|
+
borderColor: `light-dark(var(--mantine-color-${primaryColor}-2), var(--mantine-color-dark-5))`
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
Card: {
|
|
235
|
+
styles: {
|
|
236
|
+
root: {
|
|
237
|
+
background: `light-dark(var(--mantine-color-white), color-mix(in srgb, var(--mantine-color-${primaryColor}-9) 10%, var(--mantine-color-dark-7)))`,
|
|
238
|
+
borderColor: `light-dark(var(--mantine-color-${primaryColor}-2), var(--mantine-color-dark-4))`
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
Paper: {
|
|
243
|
+
styles: {
|
|
244
|
+
root: {
|
|
245
|
+
background: `light-dark(color-mix(in srgb, var(--mantine-color-${primaryColor}-0) 16%, var(--mantine-color-white)), color-mix(in srgb, var(--mantine-color-${primaryColor}-9) 8%, var(--mantine-color-dark-7)))`,
|
|
246
|
+
borderColor: `light-dark(var(--mantine-color-${primaryColor}-2), var(--mantine-color-dark-4))`
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
var customPresetThemes = {
|
|
254
|
+
sunset: createVibrantPresetTheme("orange"),
|
|
255
|
+
oceanic: createVibrantPresetTheme("cyan"),
|
|
256
|
+
forest: createVibrantPresetTheme("green"),
|
|
257
|
+
ruby: createVibrantPresetTheme("red"),
|
|
258
|
+
amber: createVibrantPresetTheme("yellow"),
|
|
259
|
+
"neon-night": createVibrantPresetTheme("lime", { darkForward: true }),
|
|
260
|
+
skyline: createVibrantPresetTheme("indigo"),
|
|
261
|
+
aurora: createVibrantPresetTheme("teal"),
|
|
262
|
+
coral: createVibrantPresetTheme("pink"),
|
|
263
|
+
mint: createVibrantPresetTheme("lime"),
|
|
264
|
+
orchid: createVibrantPresetTheme("grape"),
|
|
265
|
+
royal: createVibrantPresetTheme("violet")
|
|
266
|
+
};
|
|
267
|
+
var themePresetCatalog = [
|
|
268
|
+
{ id: "default", label: "Default runtime theme", description: "Balanced, neutral baseline lane.", runtimeLane: "gdsTheme" },
|
|
269
|
+
{ id: "dark-public", label: "Dark public theme", description: "Dark-first public lane.", runtimeLane: "gdsDarkPublicTheme" },
|
|
270
|
+
{ id: "flat-surface", label: "Flat surface theme", description: "Lower-elevation operational lane.", runtimeLane: "gdsFlatSurfaceTheme" },
|
|
271
|
+
{ id: "editorial", label: "Editorial serif theme", description: "Reading-first, serif headline lane.", runtimeLane: "gdsEditorialPublicTheme" },
|
|
272
|
+
{ id: "brand", label: "Brand theme generator", description: "Governed brand composition lane.", runtimeLane: "createPublicBrandTheme(...)" },
|
|
273
|
+
{ id: "sunset", label: "Sunset pulse", description: "Warm orange-magenta vibrant lane.", runtimeLane: "resolveGdsThemePreset(sunset)" },
|
|
274
|
+
{ id: "oceanic", label: "Oceanic wave", description: "Cool cyan-blue vibrant lane.", runtimeLane: "resolveGdsThemePreset(oceanic)" },
|
|
275
|
+
{ id: "forest", label: "Forest signal", description: "Natural emerald-driven vibrant lane.", runtimeLane: "resolveGdsThemePreset(forest)" },
|
|
276
|
+
{ id: "ruby", label: "Ruby spark", description: "Bold red high-contrast lane.", runtimeLane: "resolveGdsThemePreset(ruby)" },
|
|
277
|
+
{ id: "amber", label: "Amber glow", description: "Golden yellow energetic lane.", runtimeLane: "resolveGdsThemePreset(amber)" },
|
|
278
|
+
{ id: "neon-night", label: "Neon night", description: "Lime-accented dark-forward lane.", runtimeLane: "resolveGdsThemePreset(neon-night)" },
|
|
279
|
+
{ id: "skyline", label: "Skyline indigo", description: "Indigo technology-forward lane.", runtimeLane: "resolveGdsThemePreset(skyline)" },
|
|
280
|
+
{ id: "aurora", label: "Aurora teal", description: "Fresh teal-cyan app lane for optimistic product surfaces.", runtimeLane: "resolveGdsThemePreset(aurora)" },
|
|
281
|
+
{ id: "coral", label: "Coral bloom", description: "Expressive pink-coral lane for creator, commerce, and social products.", runtimeLane: "resolveGdsThemePreset(coral)" },
|
|
282
|
+
{ id: "mint", label: "Mint circuit", description: "Clean green-mint lane for health, learning, and growth products.", runtimeLane: "resolveGdsThemePreset(mint)" },
|
|
283
|
+
{ id: "orchid", label: "Orchid signal", description: "Purple-grape lane for editorial, culture, and premium tools.", runtimeLane: "resolveGdsThemePreset(orchid)" },
|
|
284
|
+
{ id: "royal", label: "Royal violet", description: "Confident violet lane for SaaS dashboards and professional apps.", runtimeLane: "resolveGdsThemePreset(royal)" }
|
|
285
|
+
];
|
|
286
|
+
function getGdsThemePresets() {
|
|
287
|
+
return themePresetCatalog;
|
|
288
|
+
}
|
|
289
|
+
function resolveGdsThemePreset(id, options) {
|
|
290
|
+
switch (id) {
|
|
291
|
+
case "default":
|
|
292
|
+
return gdsTheme;
|
|
293
|
+
case "dark-public":
|
|
294
|
+
return gdsDarkPublicTheme;
|
|
295
|
+
case "flat-surface":
|
|
296
|
+
return gdsFlatSurfaceTheme;
|
|
297
|
+
case "editorial":
|
|
298
|
+
return gdsEditorialPublicTheme;
|
|
299
|
+
case "brand":
|
|
300
|
+
return createPublicBrandTheme({
|
|
301
|
+
editorialSerif: options?.brandEditorialSerif ?? false,
|
|
302
|
+
flatSurfaces: options?.brandFlatSurfaces ?? true,
|
|
303
|
+
overrides: { primaryColor: options?.brandPrimary ?? "blue" }
|
|
304
|
+
});
|
|
305
|
+
default:
|
|
306
|
+
return customPresetThemes[id] ?? gdsTheme;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// src/font-lanes.ts
|
|
311
|
+
import { mergeThemeOverrides as mergeThemeOverrides2 } from "@mantine/core";
|
|
312
|
+
var lanes = [
|
|
313
|
+
{ id: "inter", label: "Inter", body: "Inter, system-ui, sans-serif", heading: "Inter, system-ui, sans-serif", mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
314
|
+
{ id: "manrope", label: "Manrope", body: "Manrope, system-ui, sans-serif", heading: "Manrope, system-ui, sans-serif", mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
315
|
+
{ id: "space-grotesk", label: "Space Grotesk", body: '"Space Grotesk", Inter, system-ui, sans-serif', heading: '"Space Grotesk", Inter, system-ui, sans-serif', mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
316
|
+
{ id: "plus-jakarta", label: "Plus Jakarta Sans", body: '"Plus Jakarta Sans", Inter, system-ui, sans-serif', heading: '"Plus Jakarta Sans", Inter, system-ui, sans-serif', mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
317
|
+
{ id: "nunito", label: "Nunito", body: "Nunito, Inter, system-ui, sans-serif", heading: "Nunito, Inter, system-ui, sans-serif", mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
318
|
+
{ id: "work-sans", label: "Work Sans", body: '"Work Sans", Inter, system-ui, sans-serif', heading: '"Work Sans", Inter, system-ui, sans-serif', mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
319
|
+
{ id: "barlow", label: "Barlow", body: "Barlow, Inter, system-ui, sans-serif", heading: "Barlow, Inter, system-ui, sans-serif", mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
320
|
+
{ id: "dm-sans", label: "DM Sans", body: '"DM Sans", Inter, system-ui, sans-serif', heading: '"DM Sans", Inter, system-ui, sans-serif', mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
321
|
+
{ id: "instrument-serif", label: "Instrument Serif", body: "Inter, system-ui, sans-serif", heading: '"Instrument Serif", Georgia, serif', mono: "ui-monospace, SFMono-Regular, Menlo, monospace" },
|
|
322
|
+
{ id: "source-serif", label: "Source Serif", body: '"Source Serif 4", Georgia, serif', heading: '"Source Serif 4", Georgia, serif', mono: "ui-monospace, SFMono-Regular, Menlo, monospace" }
|
|
323
|
+
];
|
|
324
|
+
function getGdsFontLanes() {
|
|
325
|
+
return lanes;
|
|
326
|
+
}
|
|
327
|
+
function resolveGdsFontLane(id) {
|
|
328
|
+
return lanes.find((lane) => lane.id === id) ?? lanes[0];
|
|
329
|
+
}
|
|
330
|
+
function applyGdsFontLane(theme, laneId) {
|
|
331
|
+
const lane = resolveGdsFontLane(laneId);
|
|
332
|
+
return mergeThemeOverrides2(theme, {
|
|
333
|
+
fontFamily: lane.body,
|
|
334
|
+
fontFamilyMonospace: lane.mono,
|
|
335
|
+
headings: {
|
|
336
|
+
fontFamily: lane.heading
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export {
|
|
342
|
+
gdsTheme,
|
|
343
|
+
gdsDarkPublicTheme,
|
|
344
|
+
gdsFlatSurfaceTheme,
|
|
345
|
+
gdsEditorialPublicTheme,
|
|
346
|
+
createPublicBrandTheme,
|
|
347
|
+
extendGdsTheme,
|
|
348
|
+
withGdsMotion,
|
|
349
|
+
getGdsThemePresets,
|
|
350
|
+
resolveGdsThemePreset,
|
|
351
|
+
getGdsFontLanes,
|
|
352
|
+
resolveGdsFontLane,
|
|
353
|
+
applyGdsFontLane
|
|
354
|
+
};
|
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createPublicBrandTheme, extendGdsTheme, gdsDarkPublicTheme, gdsEditorialPublicTheme, gdsFlatSurfaceTheme, gdsTheme, withGdsMotion } from './server.mjs';
|
|
1
|
+
export { GdsFontLane, GdsFontLaneId, GdsThemePreset, GdsThemePresetId, applyGdsFontLane, createPublicBrandTheme, extendGdsTheme, gdsDarkPublicTheme, gdsEditorialPublicTheme, gdsFlatSurfaceTheme, gdsTheme, getGdsFontLanes, getGdsThemePresets, resolveGdsFontLane, resolveGdsThemePreset, withGdsMotion } from './server.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { MantineThemeOverride } from '@mantine/core';
|
|
@@ -9,12 +9,13 @@ interface GdsProviderProps {
|
|
|
9
9
|
messages?: Record<string, string>;
|
|
10
10
|
theme?: MantineThemeOverride;
|
|
11
11
|
defaultColorScheme?: 'light' | 'dark' | 'auto';
|
|
12
|
+
forceColorScheme?: 'light' | 'dark';
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* GdsProvider is the single required root provider for any application
|
|
15
16
|
* adopting the General Design System. It injects the strict Mantine theme.
|
|
16
17
|
*/
|
|
17
|
-
declare function GdsProvider({ children, locale, messages, theme, defaultColorScheme, }: GdsProviderProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function GdsProvider({ children, locale, messages, theme, defaultColorScheme, forceColorScheme, }: GdsProviderProps): react_jsx_runtime.JSX.Element;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* useGdsTranslation provides a lightweight translation hook.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createPublicBrandTheme, extendGdsTheme, gdsDarkPublicTheme, gdsEditorialPublicTheme, gdsFlatSurfaceTheme, gdsTheme, withGdsMotion } from './server.js';
|
|
1
|
+
export { GdsFontLane, GdsFontLaneId, GdsThemePreset, GdsThemePresetId, applyGdsFontLane, createPublicBrandTheme, extendGdsTheme, gdsDarkPublicTheme, gdsEditorialPublicTheme, gdsFlatSurfaceTheme, gdsTheme, getGdsFontLanes, getGdsThemePresets, resolveGdsFontLane, resolveGdsThemePreset, withGdsMotion } from './server.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { MantineThemeOverride } from '@mantine/core';
|
|
@@ -9,12 +9,13 @@ interface GdsProviderProps {
|
|
|
9
9
|
messages?: Record<string, string>;
|
|
10
10
|
theme?: MantineThemeOverride;
|
|
11
11
|
defaultColorScheme?: 'light' | 'dark' | 'auto';
|
|
12
|
+
forceColorScheme?: 'light' | 'dark';
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* GdsProvider is the single required root provider for any application
|
|
15
16
|
* adopting the General Design System. It injects the strict Mantine theme.
|
|
16
17
|
*/
|
|
17
|
-
declare function GdsProvider({ children, locale, messages, theme, defaultColorScheme, }: GdsProviderProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function GdsProvider({ children, locale, messages, theme, defaultColorScheme, forceColorScheme, }: GdsProviderProps): react_jsx_runtime.JSX.Element;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* useGdsTranslation provides a lightweight translation hook.
|