@commercetools-demo/puck-theme-manager 0.1.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/dist/index.d.mts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +1923 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1880 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1923 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
DEFAULT_THEME: () => DEFAULT_THEME,
|
|
34
|
+
ImportContentTypes: () => import_content_types_default,
|
|
35
|
+
PRESET_KEYS_SELECTOR: () => PRESET_KEYS_SELECTOR,
|
|
36
|
+
ThemeManager: () => theme_editor_default,
|
|
37
|
+
buildCssVars: () => buildCssVars,
|
|
38
|
+
paradigmLabels: () => paradigmLabels,
|
|
39
|
+
themePresets: () => themePresets
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(index_exports);
|
|
42
|
+
|
|
43
|
+
// src/components/theme-editor.tsx
|
|
44
|
+
var import_react2 = require("react");
|
|
45
|
+
var import_react_router_dom = require("react-router-dom");
|
|
46
|
+
var import_puck_api = require("@commercetools-demo/puck-api");
|
|
47
|
+
var import_card = __toESM(require("@commercetools-uikit/card"));
|
|
48
|
+
var import_flat_button = __toESM(require("@commercetools-uikit/flat-button"));
|
|
49
|
+
var import_primary_button2 = __toESM(require("@commercetools-uikit/primary-button"));
|
|
50
|
+
var import_secondary_button = __toESM(require("@commercetools-uikit/secondary-button"));
|
|
51
|
+
var import_field_label2 = __toESM(require("@commercetools-uikit/field-label"));
|
|
52
|
+
var import_number_input = __toESM(require("@commercetools-uikit/number-input"));
|
|
53
|
+
var import_select_input2 = __toESM(require("@commercetools-uikit/select-input"));
|
|
54
|
+
var import_spacings2 = __toESM(require("@commercetools-uikit/spacings"));
|
|
55
|
+
var import_text = __toESM(require("@commercetools-uikit/text"));
|
|
56
|
+
var import_text_input = __toESM(require("@commercetools-uikit/text-input"));
|
|
57
|
+
var import_loading_spinner = __toESM(require("@commercetools-uikit/loading-spinner"));
|
|
58
|
+
var import_grid = __toESM(require("@commercetools-uikit/grid"));
|
|
59
|
+
|
|
60
|
+
// src/constants.ts
|
|
61
|
+
var DEFAULT_THEME = {
|
|
62
|
+
colorPrimary: "#0f766e",
|
|
63
|
+
colorPrimaryHover: "#0d9488",
|
|
64
|
+
colorSecondary: "#64748b",
|
|
65
|
+
colorBackground: "#ffffff",
|
|
66
|
+
colorSurface: "#f8fafc",
|
|
67
|
+
colorText: "#0f172a",
|
|
68
|
+
colorTextMuted: "#64748b",
|
|
69
|
+
borderRadius: "md",
|
|
70
|
+
borderWidth: "1",
|
|
71
|
+
fontFamily: "system-ui, sans-serif",
|
|
72
|
+
fontHeading: "system-ui, sans-serif",
|
|
73
|
+
spacingScale: 8,
|
|
74
|
+
buttonStyle: "solid",
|
|
75
|
+
cardShadow: "md",
|
|
76
|
+
headerStyle: "solid",
|
|
77
|
+
colorShadowLight: "#ffffff",
|
|
78
|
+
colorShadowDark: "#b8bec7",
|
|
79
|
+
colorSurfaceGlass: "rgba(255,255,255,0.18)",
|
|
80
|
+
shadowStyle: "none",
|
|
81
|
+
surfaceBlur: "none",
|
|
82
|
+
surfaceOpacity: 1,
|
|
83
|
+
fontWeightBase: "400",
|
|
84
|
+
fontWeightHeading: "700",
|
|
85
|
+
letterSpacing: "normal",
|
|
86
|
+
textTransform: "none",
|
|
87
|
+
borderStyle: "solid",
|
|
88
|
+
backgroundStyle: "solid"
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/components/theme-preset-selector.tsx
|
|
92
|
+
var import_react = require("react");
|
|
93
|
+
var import_primary_button = __toESM(require("@commercetools-uikit/primary-button"));
|
|
94
|
+
var import_select_input = __toESM(require("@commercetools-uikit/select-input"));
|
|
95
|
+
var import_spacings = __toESM(require("@commercetools-uikit/spacings"));
|
|
96
|
+
var import_field_label = __toESM(require("@commercetools-uikit/field-label"));
|
|
97
|
+
|
|
98
|
+
// src/presets.ts
|
|
99
|
+
var flatTheme = {
|
|
100
|
+
colorPrimary: "#2563EB",
|
|
101
|
+
colorPrimaryHover: "#1D4ED8",
|
|
102
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
103
|
+
colorSecondary: "#64748B",
|
|
104
|
+
colorSecondaryForeground: "#FFFFFF",
|
|
105
|
+
colorBackground: "#F8FAFC",
|
|
106
|
+
colorSurface: "#FFFFFF",
|
|
107
|
+
colorText: "#0F172A",
|
|
108
|
+
colorTextMuted: "#64748B",
|
|
109
|
+
colorForeground: "#0F172A",
|
|
110
|
+
colorMuted: "#F1F5F9",
|
|
111
|
+
colorMutedForeground: "#64748B",
|
|
112
|
+
colorDestructive: "#EF4444",
|
|
113
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
114
|
+
colorAccent: "#0EA5E9",
|
|
115
|
+
colorAccentForeground: "#FFFFFF",
|
|
116
|
+
colorBorder: "#E2E8F0",
|
|
117
|
+
colorInput: "#FFFFFF",
|
|
118
|
+
colorRing: "#2563EB",
|
|
119
|
+
colorShadowLight: "#FFFFFF",
|
|
120
|
+
colorShadowDark: "#CBD5E1",
|
|
121
|
+
colorSurfaceGlass: "rgba(255,255,255,0.9)",
|
|
122
|
+
borderRadius: "sm",
|
|
123
|
+
borderWidth: "1",
|
|
124
|
+
borderStyle: "solid",
|
|
125
|
+
fontFamily: "Inter, system-ui, sans-serif",
|
|
126
|
+
fontHeading: "Inter, system-ui, sans-serif",
|
|
127
|
+
fontWeightBase: "400",
|
|
128
|
+
fontWeightHeading: "700",
|
|
129
|
+
letterSpacing: "normal",
|
|
130
|
+
textTransform: "none",
|
|
131
|
+
spacingScale: 1,
|
|
132
|
+
buttonStyle: "solid",
|
|
133
|
+
cardShadow: "none",
|
|
134
|
+
shadowStyle: "none",
|
|
135
|
+
surfaceBlur: "none",
|
|
136
|
+
surfaceOpacity: 1,
|
|
137
|
+
backgroundStyle: "solid",
|
|
138
|
+
headerStyle: "solid",
|
|
139
|
+
animationStyle: "subtle"
|
|
140
|
+
};
|
|
141
|
+
var skeuomorphismTheme = {
|
|
142
|
+
colorPrimary: "#B8860B",
|
|
143
|
+
colorPrimaryHover: "#9A7209",
|
|
144
|
+
colorPrimaryForeground: "#FFFBEA",
|
|
145
|
+
colorSecondary: "#8B6914",
|
|
146
|
+
colorSecondaryForeground: "#FFFBEA",
|
|
147
|
+
colorBackground: "#C8B97D",
|
|
148
|
+
colorSurface: "#EDE0B0",
|
|
149
|
+
colorText: "#2C1A00",
|
|
150
|
+
colorTextMuted: "#6B4F1A",
|
|
151
|
+
colorForeground: "#2C1A00",
|
|
152
|
+
colorMuted: "#D9C98A",
|
|
153
|
+
colorMutedForeground: "#6B4F1A",
|
|
154
|
+
colorDestructive: "#C0392B",
|
|
155
|
+
colorDestructiveForeground: "#FFF8F0",
|
|
156
|
+
colorAccent: "#D4A017",
|
|
157
|
+
colorAccentForeground: "#2C1A00",
|
|
158
|
+
colorBorder: "#8B6914",
|
|
159
|
+
colorInput: "#F5EBD0",
|
|
160
|
+
colorRing: "#B8860B",
|
|
161
|
+
colorShadowLight: "rgba(255,255,255,0.5)",
|
|
162
|
+
colorShadowDark: "rgba(0,0,0,0.4)",
|
|
163
|
+
colorSurfaceGlass: "rgba(237,224,176,0.95)",
|
|
164
|
+
borderRadius: "sm",
|
|
165
|
+
borderWidth: "1",
|
|
166
|
+
borderStyle: "solid",
|
|
167
|
+
fontFamily: 'Georgia, "Times New Roman", serif',
|
|
168
|
+
fontHeading: 'Georgia, "Times New Roman", serif',
|
|
169
|
+
fontWeightBase: "400",
|
|
170
|
+
fontWeightHeading: "700",
|
|
171
|
+
letterSpacing: "normal",
|
|
172
|
+
textTransform: "none",
|
|
173
|
+
spacingScale: 1,
|
|
174
|
+
buttonStyle: "solid",
|
|
175
|
+
cardShadow: "lg",
|
|
176
|
+
shadowStyle: "soft",
|
|
177
|
+
surfaceBlur: "none",
|
|
178
|
+
surfaceOpacity: 1,
|
|
179
|
+
backgroundStyle: "noise",
|
|
180
|
+
headerStyle: "solid",
|
|
181
|
+
animationStyle: "subtle"
|
|
182
|
+
};
|
|
183
|
+
var materialTheme = {
|
|
184
|
+
colorPrimary: "#6200EE",
|
|
185
|
+
colorPrimaryHover: "#3700B3",
|
|
186
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
187
|
+
colorSecondary: "#03DAC6",
|
|
188
|
+
colorSecondaryForeground: "#000000",
|
|
189
|
+
colorBackground: "#FAFAFA",
|
|
190
|
+
colorSurface: "#FFFFFF",
|
|
191
|
+
colorText: "#000000",
|
|
192
|
+
colorTextMuted: "#757575",
|
|
193
|
+
colorForeground: "#000000",
|
|
194
|
+
colorMuted: "#F5F5F5",
|
|
195
|
+
colorMutedForeground: "#757575",
|
|
196
|
+
colorDestructive: "#B00020",
|
|
197
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
198
|
+
colorAccent: "#03DAC6",
|
|
199
|
+
colorAccentForeground: "#000000",
|
|
200
|
+
colorBorder: "#E0E0E0",
|
|
201
|
+
colorInput: "#FFFFFF",
|
|
202
|
+
colorRing: "#6200EE",
|
|
203
|
+
colorShadowLight: "rgba(255,255,255,0.1)",
|
|
204
|
+
colorShadowDark: "rgba(0,0,0,0.2)",
|
|
205
|
+
colorSurfaceGlass: "rgba(255,255,255,0.95)",
|
|
206
|
+
borderRadius: "sm",
|
|
207
|
+
borderWidth: "0",
|
|
208
|
+
borderStyle: "solid",
|
|
209
|
+
fontFamily: '"Roboto", system-ui, sans-serif',
|
|
210
|
+
fontHeading: '"Roboto", system-ui, sans-serif',
|
|
211
|
+
fontWeightBase: "400",
|
|
212
|
+
fontWeightHeading: "500",
|
|
213
|
+
letterSpacing: "normal",
|
|
214
|
+
textTransform: "none",
|
|
215
|
+
spacingScale: 1,
|
|
216
|
+
buttonStyle: "solid",
|
|
217
|
+
cardShadow: "md",
|
|
218
|
+
shadowStyle: "soft",
|
|
219
|
+
surfaceBlur: "none",
|
|
220
|
+
surfaceOpacity: 1,
|
|
221
|
+
backgroundStyle: "solid",
|
|
222
|
+
headerStyle: "solid",
|
|
223
|
+
animationStyle: "material-ripple"
|
|
224
|
+
};
|
|
225
|
+
var neumorphismTheme = {
|
|
226
|
+
colorPrimary: "#5B8DEF",
|
|
227
|
+
colorPrimaryHover: "#3D6ECC",
|
|
228
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
229
|
+
colorSecondary: "#8B8FA8",
|
|
230
|
+
colorSecondaryForeground: "#FFFFFF",
|
|
231
|
+
colorBackground: "#E0E5EC",
|
|
232
|
+
colorSurface: "#E0E5EC",
|
|
233
|
+
colorText: "#31344B",
|
|
234
|
+
colorTextMuted: "#6B7280",
|
|
235
|
+
colorForeground: "#31344B",
|
|
236
|
+
colorMuted: "#E0E5EC",
|
|
237
|
+
colorMutedForeground: "#6B7280",
|
|
238
|
+
colorDestructive: "#E74C3C",
|
|
239
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
240
|
+
colorAccent: "#5B8DEF",
|
|
241
|
+
colorAccentForeground: "#FFFFFF",
|
|
242
|
+
colorBorder: "#E0E5EC",
|
|
243
|
+
colorInput: "#E0E5EC",
|
|
244
|
+
colorRing: "#5B8DEF",
|
|
245
|
+
colorShadowLight: "#FFFFFF",
|
|
246
|
+
colorShadowDark: "#A3B1C6",
|
|
247
|
+
colorSurfaceGlass: "rgba(224,229,236,0.95)",
|
|
248
|
+
borderRadius: "lg",
|
|
249
|
+
borderWidth: "0",
|
|
250
|
+
borderStyle: "solid",
|
|
251
|
+
fontFamily: '"Nunito", system-ui, sans-serif',
|
|
252
|
+
fontHeading: '"Nunito", system-ui, sans-serif',
|
|
253
|
+
fontWeightBase: "400",
|
|
254
|
+
fontWeightHeading: "700",
|
|
255
|
+
letterSpacing: "normal",
|
|
256
|
+
textTransform: "none",
|
|
257
|
+
spacingScale: 1.1,
|
|
258
|
+
buttonStyle: "solid",
|
|
259
|
+
cardShadow: "lg",
|
|
260
|
+
shadowStyle: "neumorphic",
|
|
261
|
+
surfaceBlur: "none",
|
|
262
|
+
surfaceOpacity: 1,
|
|
263
|
+
backgroundStyle: "solid",
|
|
264
|
+
headerStyle: "solid",
|
|
265
|
+
animationStyle: "subtle"
|
|
266
|
+
};
|
|
267
|
+
var glassmorphismTheme = {
|
|
268
|
+
colorPrimary: "#818CF8",
|
|
269
|
+
colorPrimaryHover: "#6366F1",
|
|
270
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
271
|
+
colorSecondary: "#C084FC",
|
|
272
|
+
colorSecondaryForeground: "#FFFFFF",
|
|
273
|
+
colorBackground: "#4F46E5",
|
|
274
|
+
colorSurface: "#6366F1",
|
|
275
|
+
colorText: "#FFFFFF",
|
|
276
|
+
colorTextMuted: "rgba(255,255,255,0.65)",
|
|
277
|
+
colorForeground: "#FFFFFF",
|
|
278
|
+
colorMuted: "rgba(255,255,255,0.1)",
|
|
279
|
+
colorMutedForeground: "rgba(255,255,255,0.55)",
|
|
280
|
+
colorDestructive: "#F87171",
|
|
281
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
282
|
+
colorAccent: "#E879F9",
|
|
283
|
+
colorAccentForeground: "#FFFFFF",
|
|
284
|
+
colorBorder: "rgba(255,255,255,0.25)",
|
|
285
|
+
colorInput: "rgba(255,255,255,0.15)",
|
|
286
|
+
colorRing: "rgba(255,255,255,0.5)",
|
|
287
|
+
colorShadowLight: "rgba(255,255,255,0.25)",
|
|
288
|
+
colorShadowDark: "rgba(0,0,0,0.15)",
|
|
289
|
+
colorSurfaceGlass: "rgba(255,255,255,0.15)",
|
|
290
|
+
borderRadius: "lg",
|
|
291
|
+
borderWidth: "1",
|
|
292
|
+
borderStyle: "solid",
|
|
293
|
+
fontFamily: '"Inter", system-ui, sans-serif',
|
|
294
|
+
fontHeading: '"Inter", system-ui, sans-serif',
|
|
295
|
+
fontWeightBase: "300",
|
|
296
|
+
fontWeightHeading: "500",
|
|
297
|
+
letterSpacing: "wide",
|
|
298
|
+
textTransform: "none",
|
|
299
|
+
spacingScale: 1.1,
|
|
300
|
+
buttonStyle: "outline",
|
|
301
|
+
cardShadow: "sm",
|
|
302
|
+
shadowStyle: "soft",
|
|
303
|
+
surfaceBlur: "md",
|
|
304
|
+
surfaceOpacity: 0.15,
|
|
305
|
+
backgroundStyle: "gradient",
|
|
306
|
+
headerStyle: "transparent",
|
|
307
|
+
animationStyle: "subtle"
|
|
308
|
+
};
|
|
309
|
+
var brutalismTheme = {
|
|
310
|
+
colorPrimary: "#FF3C00",
|
|
311
|
+
colorPrimaryHover: "#CC3000",
|
|
312
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
313
|
+
colorSecondary: "#FFEE00",
|
|
314
|
+
colorSecondaryForeground: "#000000",
|
|
315
|
+
colorBackground: "#FFFFFF",
|
|
316
|
+
colorSurface: "#FFFFFF",
|
|
317
|
+
colorText: "#000000",
|
|
318
|
+
colorTextMuted: "#333333",
|
|
319
|
+
colorForeground: "#000000",
|
|
320
|
+
colorMuted: "#F5F5F5",
|
|
321
|
+
colorMutedForeground: "#333333",
|
|
322
|
+
colorDestructive: "#FF0000",
|
|
323
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
324
|
+
colorAccent: "#FFEE00",
|
|
325
|
+
colorAccentForeground: "#000000",
|
|
326
|
+
colorBorder: "#000000",
|
|
327
|
+
colorInput: "#FFFFFF",
|
|
328
|
+
colorRing: "#000000",
|
|
329
|
+
colorShadowLight: "#FFFFFF",
|
|
330
|
+
colorShadowDark: "#000000",
|
|
331
|
+
colorSurfaceGlass: "rgba(255,255,255,0.95)",
|
|
332
|
+
borderRadius: "none",
|
|
333
|
+
borderWidth: "2",
|
|
334
|
+
borderStyle: "solid",
|
|
335
|
+
fontFamily: '"Space Mono", "Courier New", monospace',
|
|
336
|
+
fontHeading: '"Space Grotesk", "Arial Black", sans-serif',
|
|
337
|
+
fontWeightBase: "400",
|
|
338
|
+
fontWeightHeading: "900",
|
|
339
|
+
letterSpacing: "tight",
|
|
340
|
+
textTransform: "uppercase",
|
|
341
|
+
spacingScale: 1,
|
|
342
|
+
buttonStyle: "solid",
|
|
343
|
+
cardShadow: "md",
|
|
344
|
+
shadowStyle: "hard-offset",
|
|
345
|
+
surfaceBlur: "none",
|
|
346
|
+
surfaceOpacity: 1,
|
|
347
|
+
backgroundStyle: "solid",
|
|
348
|
+
headerStyle: "solid",
|
|
349
|
+
animationStyle: "none"
|
|
350
|
+
};
|
|
351
|
+
var claymorphismTheme = {
|
|
352
|
+
colorPrimary: "#A855F7",
|
|
353
|
+
colorPrimaryHover: "#9333EA",
|
|
354
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
355
|
+
colorSecondary: "#EC4899",
|
|
356
|
+
colorSecondaryForeground: "#FFFFFF",
|
|
357
|
+
colorBackground: "#F3E8FF",
|
|
358
|
+
colorSurface: "#FFFFFF",
|
|
359
|
+
colorText: "#1E1033",
|
|
360
|
+
colorTextMuted: "#7C3AED",
|
|
361
|
+
colorForeground: "#1E1033",
|
|
362
|
+
colorMuted: "#FAF5FF",
|
|
363
|
+
colorMutedForeground: "#9061C2",
|
|
364
|
+
colorDestructive: "#F43F5E",
|
|
365
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
366
|
+
colorAccent: "#F0ABFC",
|
|
367
|
+
colorAccentForeground: "#701A75",
|
|
368
|
+
colorBorder: "#E9D5FF",
|
|
369
|
+
colorInput: "#FAF5FF",
|
|
370
|
+
colorRing: "#A855F7",
|
|
371
|
+
colorShadowLight: "rgba(255,255,255,0.8)",
|
|
372
|
+
colorShadowDark: "#7E22CE",
|
|
373
|
+
colorSurfaceGlass: "rgba(255,255,255,0.8)",
|
|
374
|
+
borderRadius: "lg",
|
|
375
|
+
borderWidth: "0",
|
|
376
|
+
borderStyle: "solid",
|
|
377
|
+
fontFamily: '"Nunito", "Poppins", system-ui, sans-serif',
|
|
378
|
+
fontHeading: '"Nunito", "Poppins", system-ui, sans-serif',
|
|
379
|
+
fontWeightBase: "400",
|
|
380
|
+
fontWeightHeading: "700",
|
|
381
|
+
letterSpacing: "normal",
|
|
382
|
+
textTransform: "none",
|
|
383
|
+
spacingScale: 1.15,
|
|
384
|
+
buttonStyle: "solid",
|
|
385
|
+
cardShadow: "lg",
|
|
386
|
+
shadowStyle: "clay",
|
|
387
|
+
surfaceBlur: "none",
|
|
388
|
+
surfaceOpacity: 1,
|
|
389
|
+
backgroundStyle: "solid",
|
|
390
|
+
headerStyle: "solid",
|
|
391
|
+
animationStyle: "bouncy"
|
|
392
|
+
};
|
|
393
|
+
var minimalismTheme = {
|
|
394
|
+
colorPrimary: "#111111",
|
|
395
|
+
colorPrimaryHover: "#333333",
|
|
396
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
397
|
+
colorSecondary: "#666666",
|
|
398
|
+
colorSecondaryForeground: "#FFFFFF",
|
|
399
|
+
colorBackground: "#FFFFFF",
|
|
400
|
+
colorSurface: "#FAFAFA",
|
|
401
|
+
colorText: "#111111",
|
|
402
|
+
colorTextMuted: "#999999",
|
|
403
|
+
colorForeground: "#111111",
|
|
404
|
+
colorMuted: "#F5F5F5",
|
|
405
|
+
colorMutedForeground: "#999999",
|
|
406
|
+
colorDestructive: "#CC0000",
|
|
407
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
408
|
+
colorAccent: "#111111",
|
|
409
|
+
colorAccentForeground: "#FFFFFF",
|
|
410
|
+
colorBorder: "#E5E5E5",
|
|
411
|
+
colorInput: "#FFFFFF",
|
|
412
|
+
colorRing: "#111111",
|
|
413
|
+
colorShadowLight: "#FFFFFF",
|
|
414
|
+
colorShadowDark: "#E5E5E5",
|
|
415
|
+
colorSurfaceGlass: "rgba(255,255,255,0.95)",
|
|
416
|
+
borderRadius: "none",
|
|
417
|
+
borderWidth: "1",
|
|
418
|
+
borderStyle: "solid",
|
|
419
|
+
fontFamily: '"DM Sans", "Helvetica Neue", sans-serif',
|
|
420
|
+
fontHeading: '"DM Serif Display", Georgia, serif',
|
|
421
|
+
fontWeightBase: "300",
|
|
422
|
+
fontWeightHeading: "400",
|
|
423
|
+
letterSpacing: "wider",
|
|
424
|
+
textTransform: "none",
|
|
425
|
+
spacingScale: 1.4,
|
|
426
|
+
buttonStyle: "outline",
|
|
427
|
+
cardShadow: "none",
|
|
428
|
+
shadowStyle: "none",
|
|
429
|
+
surfaceBlur: "none",
|
|
430
|
+
surfaceOpacity: 1,
|
|
431
|
+
backgroundStyle: "solid",
|
|
432
|
+
headerStyle: "minimal",
|
|
433
|
+
animationStyle: "subtle"
|
|
434
|
+
};
|
|
435
|
+
var darkMoodyTheme = {
|
|
436
|
+
colorPrimary: "#818CF8",
|
|
437
|
+
colorPrimaryHover: "#6366F1",
|
|
438
|
+
colorPrimaryForeground: "#FFFFFF",
|
|
439
|
+
colorSecondary: "#334155",
|
|
440
|
+
colorSecondaryForeground: "#E2E8F0",
|
|
441
|
+
colorBackground: "#0F1117",
|
|
442
|
+
colorSurface: "#1A1D28",
|
|
443
|
+
colorText: "#E2E8F0",
|
|
444
|
+
colorTextMuted: "#94A3B8",
|
|
445
|
+
colorForeground: "#E2E8F0",
|
|
446
|
+
colorMuted: "#1E2235",
|
|
447
|
+
colorMutedForeground: "#64748B",
|
|
448
|
+
colorDestructive: "#F87171",
|
|
449
|
+
colorDestructiveForeground: "#FFFFFF",
|
|
450
|
+
colorAccent: "#818CF8",
|
|
451
|
+
colorAccentForeground: "#FFFFFF",
|
|
452
|
+
colorBorder: "#2D3148",
|
|
453
|
+
colorInput: "#1A1D28",
|
|
454
|
+
colorRing: "#6366F1",
|
|
455
|
+
colorShadowLight: "rgba(129,140,248,0.25)",
|
|
456
|
+
colorShadowDark: "rgba(0,0,0,0.5)",
|
|
457
|
+
colorSurfaceGlass: "rgba(26,29,40,0.85)",
|
|
458
|
+
borderRadius: "md",
|
|
459
|
+
borderWidth: "1",
|
|
460
|
+
borderStyle: "solid",
|
|
461
|
+
fontFamily: '"Inter", system-ui, sans-serif',
|
|
462
|
+
fontHeading: '"Inter", system-ui, sans-serif',
|
|
463
|
+
fontWeightBase: "400",
|
|
464
|
+
fontWeightHeading: "500",
|
|
465
|
+
letterSpacing: "normal",
|
|
466
|
+
textTransform: "none",
|
|
467
|
+
spacingScale: 1,
|
|
468
|
+
buttonStyle: "solid",
|
|
469
|
+
cardShadow: "sm",
|
|
470
|
+
shadowStyle: "glow",
|
|
471
|
+
surfaceBlur: "none",
|
|
472
|
+
surfaceOpacity: 1,
|
|
473
|
+
backgroundStyle: "solid",
|
|
474
|
+
headerStyle: "solid",
|
|
475
|
+
animationStyle: "subtle"
|
|
476
|
+
};
|
|
477
|
+
var themePresets = {
|
|
478
|
+
flat: flatTheme,
|
|
479
|
+
skeuomorphism: skeuomorphismTheme,
|
|
480
|
+
material: materialTheme,
|
|
481
|
+
neumorphism: neumorphismTheme,
|
|
482
|
+
glassmorphism: glassmorphismTheme,
|
|
483
|
+
brutalism: brutalismTheme,
|
|
484
|
+
claymorphism: claymorphismTheme,
|
|
485
|
+
minimalism: minimalismTheme,
|
|
486
|
+
"dark-moody": darkMoodyTheme
|
|
487
|
+
};
|
|
488
|
+
var paradigmLabels = {
|
|
489
|
+
flat: "Flat design",
|
|
490
|
+
skeuomorphism: "Skeuomorphism",
|
|
491
|
+
material: "Material design",
|
|
492
|
+
neumorphism: "Neumorphism",
|
|
493
|
+
glassmorphism: "Glassmorphism",
|
|
494
|
+
brutalism: "Brutalism",
|
|
495
|
+
claymorphism: "Claymorphism",
|
|
496
|
+
minimalism: "Minimalism",
|
|
497
|
+
"dark-moody": "Dark / moody"
|
|
498
|
+
};
|
|
499
|
+
var PRESET_KEYS_SELECTOR = [
|
|
500
|
+
"flat",
|
|
501
|
+
"material",
|
|
502
|
+
"neumorphism",
|
|
503
|
+
"glassmorphism",
|
|
504
|
+
"brutalism",
|
|
505
|
+
"dark-moody"
|
|
506
|
+
];
|
|
507
|
+
var shadowMap = {
|
|
508
|
+
none: "none",
|
|
509
|
+
soft: "0 2px 8px 0 var(--color-shadow-dark)",
|
|
510
|
+
"hard-offset": "4px 4px 0px 0px var(--color-shadow-dark)",
|
|
511
|
+
neumorphic: "6px 6px 14px var(--color-shadow-dark), -6px -6px 14px var(--color-shadow-light)",
|
|
512
|
+
clay: "0 8px 0 var(--color-shadow-dark), 0 12px 28px var(--color-shadow-dark)",
|
|
513
|
+
glow: "0 0 24px var(--color-shadow-light)"
|
|
514
|
+
};
|
|
515
|
+
var blurMap = {
|
|
516
|
+
none: "0px",
|
|
517
|
+
sm: "4px",
|
|
518
|
+
md: "12px",
|
|
519
|
+
lg: "24px"
|
|
520
|
+
};
|
|
521
|
+
var letterSpacingMap = {
|
|
522
|
+
tight: "-0.025em",
|
|
523
|
+
normal: "0em",
|
|
524
|
+
wide: "0.05em",
|
|
525
|
+
wider: "0.15em"
|
|
526
|
+
};
|
|
527
|
+
var borderRadiusMap = {
|
|
528
|
+
none: "0px",
|
|
529
|
+
sm: "4px",
|
|
530
|
+
md: "8px",
|
|
531
|
+
lg: "16px",
|
|
532
|
+
full: "9999px"
|
|
533
|
+
};
|
|
534
|
+
function buildCssVars(tokens) {
|
|
535
|
+
return {
|
|
536
|
+
"--color-primary": tokens.colorPrimary,
|
|
537
|
+
"--color-primary-hover": tokens.colorPrimaryHover,
|
|
538
|
+
"--color-primary-foreground": tokens.colorPrimaryForeground ?? "#ffffff",
|
|
539
|
+
"--color-secondary": tokens.colorSecondary,
|
|
540
|
+
"--color-secondary-foreground": tokens.colorSecondaryForeground ?? "#ffffff",
|
|
541
|
+
"--color-background": tokens.colorBackground,
|
|
542
|
+
"--color-surface": tokens.colorSurface,
|
|
543
|
+
"--color-text": tokens.colorText,
|
|
544
|
+
"--color-text-muted": tokens.colorTextMuted,
|
|
545
|
+
"--color-foreground": tokens.colorForeground ?? tokens.colorText,
|
|
546
|
+
"--color-muted": tokens.colorMuted ?? tokens.colorSurface,
|
|
547
|
+
"--color-muted-foreground": tokens.colorMutedForeground ?? tokens.colorTextMuted,
|
|
548
|
+
"--color-destructive": tokens.colorDestructive ?? "#ef4444",
|
|
549
|
+
"--color-destructive-foreground": tokens.colorDestructiveForeground ?? "#ffffff",
|
|
550
|
+
"--color-accent": tokens.colorAccent ?? tokens.colorPrimary,
|
|
551
|
+
"--color-accent-foreground": tokens.colorAccentForeground ?? "#ffffff",
|
|
552
|
+
"--color-border": tokens.colorBorder ?? "#e2e8f0",
|
|
553
|
+
"--color-input": tokens.colorInput ?? tokens.colorSurface,
|
|
554
|
+
"--color-ring": tokens.colorRing ?? tokens.colorPrimary,
|
|
555
|
+
"--color-shadow-light": tokens.colorShadowLight ?? "#ffffff",
|
|
556
|
+
"--color-shadow-dark": tokens.colorShadowDark ?? "#b8bec7",
|
|
557
|
+
"--color-surface-glass": tokens.colorSurfaceGlass ?? "rgba(255,255,255,0.15)",
|
|
558
|
+
"--shadow-card": shadowMap[tokens.shadowStyle ?? "none"],
|
|
559
|
+
"--surface-blur": blurMap[tokens.surfaceBlur ?? "none"],
|
|
560
|
+
"--surface-opacity": String(tokens.surfaceOpacity),
|
|
561
|
+
"--letter-spacing": letterSpacingMap[tokens.letterSpacing ?? "normal"],
|
|
562
|
+
"--border-radius": borderRadiusMap[tokens.borderRadius],
|
|
563
|
+
"--border-width": `${tokens.borderWidth}px`,
|
|
564
|
+
"--border-style": tokens.borderStyle ?? "",
|
|
565
|
+
"--font-family": tokens.fontFamily,
|
|
566
|
+
"--font-heading": tokens.fontHeading,
|
|
567
|
+
"--font-weight-base": tokens.fontWeightBase ?? "300",
|
|
568
|
+
"--font-weight-heading": tokens.fontWeightHeading ?? "700",
|
|
569
|
+
"--text-transform": tokens.textTransform ?? "none",
|
|
570
|
+
"--spacing-scale": String(tokens.spacingScale)
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// src/components/theme-preset-selector.tsx
|
|
575
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
576
|
+
var PRESET_OPTIONS = [
|
|
577
|
+
{ value: "", label: "Choose a preset\u2026" },
|
|
578
|
+
...PRESET_KEYS_SELECTOR.map((key) => ({
|
|
579
|
+
value: key,
|
|
580
|
+
label: paradigmLabels[key]
|
|
581
|
+
}))
|
|
582
|
+
];
|
|
583
|
+
var ThemePresetSelector = ({
|
|
584
|
+
onSelectPreset
|
|
585
|
+
}) => {
|
|
586
|
+
const [selectedKey, setSelectedKey] = (0, import_react.useState)("");
|
|
587
|
+
const handleApply = () => {
|
|
588
|
+
if (selectedKey && selectedKey in themePresets) {
|
|
589
|
+
onSelectPreset(themePresets[selectedKey]);
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_spacings.default.Stack, { scale: "s", children: [
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_field_label.default, { title: "Quick apply preset", htmlFor: "theme-preset-select" }),
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_spacings.default.Inline, { scale: "s", alignItems: "center", children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
596
|
+
import_select_input.default,
|
|
597
|
+
{
|
|
598
|
+
id: "theme-preset-select",
|
|
599
|
+
value: selectedKey,
|
|
600
|
+
onChange: (e) => {
|
|
601
|
+
const v = e.target.value;
|
|
602
|
+
setSelectedKey(typeof v === "string" ? v : Array.isArray(v) ? v[0] ?? "" : "");
|
|
603
|
+
},
|
|
604
|
+
options: PRESET_OPTIONS
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
608
|
+
import_primary_button.default,
|
|
609
|
+
{
|
|
610
|
+
label: "Apply",
|
|
611
|
+
onClick: handleApply,
|
|
612
|
+
isDisabled: !selectedKey
|
|
613
|
+
}
|
|
614
|
+
)
|
|
615
|
+
] })
|
|
616
|
+
] });
|
|
617
|
+
};
|
|
618
|
+
var theme_preset_selector_default = ThemePresetSelector;
|
|
619
|
+
|
|
620
|
+
// src/components/theme-editor.tsx
|
|
621
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
622
|
+
var BORDER_RADIUS_OPTIONS = [
|
|
623
|
+
{ value: "none", label: "None" },
|
|
624
|
+
{ value: "sm", label: "Small" },
|
|
625
|
+
{ value: "md", label: "Medium" },
|
|
626
|
+
{ value: "lg", label: "Large" },
|
|
627
|
+
{ value: "full", label: "Full" }
|
|
628
|
+
];
|
|
629
|
+
var BORDER_WIDTH_OPTIONS = [
|
|
630
|
+
{ value: "0", label: "0" },
|
|
631
|
+
{ value: "1", label: "1" },
|
|
632
|
+
{ value: "2", label: "2" }
|
|
633
|
+
];
|
|
634
|
+
var BUTTON_STYLE_OPTIONS = [
|
|
635
|
+
{ value: "solid", label: "Solid" },
|
|
636
|
+
{ value: "outline", label: "Outline" },
|
|
637
|
+
{ value: "ghost", label: "Ghost" }
|
|
638
|
+
];
|
|
639
|
+
var CARD_SHADOW_OPTIONS = [
|
|
640
|
+
{ value: "none", label: "None" },
|
|
641
|
+
{ value: "sm", label: "Small" },
|
|
642
|
+
{ value: "md", label: "Medium" },
|
|
643
|
+
{ value: "lg", label: "Large" }
|
|
644
|
+
];
|
|
645
|
+
var HEADER_STYLE_OPTIONS = [
|
|
646
|
+
{ value: "transparent", label: "Transparent" },
|
|
647
|
+
{ value: "solid", label: "Solid" },
|
|
648
|
+
{ value: "minimal", label: "Minimal" }
|
|
649
|
+
];
|
|
650
|
+
var SHADOW_STYLE_OPTIONS = [
|
|
651
|
+
{ value: "none", label: "None" },
|
|
652
|
+
{ value: "soft", label: "Soft" },
|
|
653
|
+
{ value: "hard-offset", label: "Hard offset" },
|
|
654
|
+
{ value: "neumorphic", label: "Neumorphic" },
|
|
655
|
+
{ value: "clay", label: "Clay" },
|
|
656
|
+
{ value: "glow", label: "Glow" }
|
|
657
|
+
];
|
|
658
|
+
var SURFACE_BLUR_OPTIONS = [
|
|
659
|
+
{ value: "none", label: "None" },
|
|
660
|
+
{ value: "sm", label: "Small" },
|
|
661
|
+
{ value: "md", label: "Medium" },
|
|
662
|
+
{ value: "lg", label: "Large" }
|
|
663
|
+
];
|
|
664
|
+
var FONT_WEIGHT_BASE_OPTIONS = [
|
|
665
|
+
{ value: "300", label: "300" },
|
|
666
|
+
{ value: "400", label: "400" },
|
|
667
|
+
{ value: "500", label: "500" }
|
|
668
|
+
];
|
|
669
|
+
var FONT_WEIGHT_HEADING_OPTIONS = [
|
|
670
|
+
{ value: "400", label: "400" },
|
|
671
|
+
{ value: "500", label: "500" },
|
|
672
|
+
{ value: "700", label: "700" },
|
|
673
|
+
{ value: "900", label: "900" }
|
|
674
|
+
];
|
|
675
|
+
var LETTER_SPACING_OPTIONS = [
|
|
676
|
+
{ value: "tight", label: "Tight" },
|
|
677
|
+
{ value: "normal", label: "Normal" },
|
|
678
|
+
{ value: "wide", label: "Wide" },
|
|
679
|
+
{ value: "wider", label: "Wider" }
|
|
680
|
+
];
|
|
681
|
+
var TEXT_TRANSFORM_OPTIONS = [
|
|
682
|
+
{ value: "none", label: "None" },
|
|
683
|
+
{ value: "uppercase", label: "Uppercase" }
|
|
684
|
+
];
|
|
685
|
+
var BORDER_STYLE_OPTIONS = [
|
|
686
|
+
{ value: "solid", label: "Solid" },
|
|
687
|
+
{ value: "dashed", label: "Dashed" },
|
|
688
|
+
{ value: "double", label: "Double" }
|
|
689
|
+
];
|
|
690
|
+
var BACKGROUND_STYLE_OPTIONS = [
|
|
691
|
+
{ value: "solid", label: "Solid" },
|
|
692
|
+
{ value: "gradient", label: "Gradient" },
|
|
693
|
+
{ value: "noise", label: "Noise" }
|
|
694
|
+
];
|
|
695
|
+
var ThemeEditorInner = ({ backButton }) => {
|
|
696
|
+
const history = (0, import_react_router_dom.useHistory)();
|
|
697
|
+
const {
|
|
698
|
+
theme,
|
|
699
|
+
loading,
|
|
700
|
+
error,
|
|
701
|
+
fetchTheme,
|
|
702
|
+
saveTheme,
|
|
703
|
+
updateTheme,
|
|
704
|
+
clearError
|
|
705
|
+
} = (0, import_puck_api.usePuckConfiguration)();
|
|
706
|
+
const [formValues, setFormValues] = (0, import_react2.useState)(DEFAULT_THEME);
|
|
707
|
+
const [saving, setSaving] = (0, import_react2.useState)(false);
|
|
708
|
+
const [saveSuccess, setSaveSuccess] = (0, import_react2.useState)(false);
|
|
709
|
+
const [isConfigExpanded, setIsConfigExpanded] = (0, import_react2.useState)(false);
|
|
710
|
+
const applyThemeToForm = (0, import_react2.useCallback)((t) => {
|
|
711
|
+
if (t == null || typeof t !== "object") {
|
|
712
|
+
setFormValues(DEFAULT_THEME);
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
setFormValues({
|
|
716
|
+
...DEFAULT_THEME,
|
|
717
|
+
...t,
|
|
718
|
+
colorPrimary: t.colorPrimary ?? DEFAULT_THEME.colorPrimary,
|
|
719
|
+
colorPrimaryHover: t.colorPrimaryHover ?? DEFAULT_THEME.colorPrimaryHover,
|
|
720
|
+
colorSecondary: t.colorSecondary ?? DEFAULT_THEME.colorSecondary,
|
|
721
|
+
colorBackground: t.colorBackground ?? DEFAULT_THEME.colorBackground,
|
|
722
|
+
colorSurface: t.colorSurface ?? DEFAULT_THEME.colorSurface,
|
|
723
|
+
colorText: t.colorText ?? DEFAULT_THEME.colorText,
|
|
724
|
+
colorTextMuted: t.colorTextMuted ?? DEFAULT_THEME.colorTextMuted,
|
|
725
|
+
borderRadius: t.borderRadius ?? DEFAULT_THEME.borderRadius,
|
|
726
|
+
borderWidth: t.borderWidth ?? DEFAULT_THEME.borderWidth,
|
|
727
|
+
fontFamily: t.fontFamily ?? DEFAULT_THEME.fontFamily,
|
|
728
|
+
fontHeading: t.fontHeading ?? DEFAULT_THEME.fontHeading,
|
|
729
|
+
spacingScale: typeof t.spacingScale === "number" ? t.spacingScale : DEFAULT_THEME.spacingScale,
|
|
730
|
+
buttonStyle: t.buttonStyle ?? DEFAULT_THEME.buttonStyle,
|
|
731
|
+
cardShadow: t.cardShadow ?? DEFAULT_THEME.cardShadow,
|
|
732
|
+
headerStyle: t.headerStyle ?? DEFAULT_THEME.headerStyle,
|
|
733
|
+
colorPrimaryForeground: t.colorPrimaryForeground ?? void 0,
|
|
734
|
+
colorSecondaryForeground: t.colorSecondaryForeground ?? void 0,
|
|
735
|
+
colorForeground: t.colorForeground ?? void 0,
|
|
736
|
+
colorMuted: t.colorMuted ?? void 0,
|
|
737
|
+
colorMutedForeground: t.colorMutedForeground ?? void 0,
|
|
738
|
+
colorDestructive: t.colorDestructive ?? void 0,
|
|
739
|
+
colorDestructiveForeground: t.colorDestructiveForeground ?? void 0,
|
|
740
|
+
colorAccent: t.colorAccent ?? void 0,
|
|
741
|
+
colorAccentForeground: t.colorAccentForeground ?? void 0,
|
|
742
|
+
colorBorder: t.colorBorder ?? void 0,
|
|
743
|
+
colorInput: t.colorInput ?? void 0,
|
|
744
|
+
colorRing: t.colorRing ?? void 0,
|
|
745
|
+
colorShadowLight: t.colorShadowLight ?? DEFAULT_THEME.colorShadowLight,
|
|
746
|
+
colorShadowDark: t.colorShadowDark ?? DEFAULT_THEME.colorShadowDark,
|
|
747
|
+
colorSurfaceGlass: t.colorSurfaceGlass ?? DEFAULT_THEME.colorSurfaceGlass,
|
|
748
|
+
shadowStyle: t.shadowStyle ?? DEFAULT_THEME.shadowStyle,
|
|
749
|
+
surfaceBlur: t.surfaceBlur ?? DEFAULT_THEME.surfaceBlur,
|
|
750
|
+
surfaceOpacity: typeof t.surfaceOpacity === "number" ? t.surfaceOpacity : DEFAULT_THEME.surfaceOpacity,
|
|
751
|
+
fontWeightBase: t.fontWeightBase ?? DEFAULT_THEME.fontWeightBase,
|
|
752
|
+
fontWeightHeading: t.fontWeightHeading ?? DEFAULT_THEME.fontWeightHeading,
|
|
753
|
+
letterSpacing: t.letterSpacing ?? DEFAULT_THEME.letterSpacing,
|
|
754
|
+
textTransform: t.textTransform ?? DEFAULT_THEME.textTransform,
|
|
755
|
+
borderStyle: t.borderStyle ?? DEFAULT_THEME.borderStyle,
|
|
756
|
+
backgroundStyle: t.backgroundStyle ?? DEFAULT_THEME.backgroundStyle
|
|
757
|
+
});
|
|
758
|
+
}, []);
|
|
759
|
+
(0, import_react2.useEffect)(() => {
|
|
760
|
+
void fetchTheme();
|
|
761
|
+
}, [fetchTheme]);
|
|
762
|
+
(0, import_react2.useEffect)(() => {
|
|
763
|
+
applyThemeToForm(theme);
|
|
764
|
+
}, [theme, applyThemeToForm]);
|
|
765
|
+
const handleChange = (0, import_react2.useCallback)(
|
|
766
|
+
(key, value) => {
|
|
767
|
+
setFormValues((prev) => ({ ...prev, [key]: value }));
|
|
768
|
+
setSaveSuccess(false);
|
|
769
|
+
},
|
|
770
|
+
[]
|
|
771
|
+
);
|
|
772
|
+
const handleSave = (0, import_react2.useCallback)(async () => {
|
|
773
|
+
setSaving(true);
|
|
774
|
+
setSaveSuccess(false);
|
|
775
|
+
clearError();
|
|
776
|
+
try {
|
|
777
|
+
await saveTheme(formValues);
|
|
778
|
+
setSaveSuccess(true);
|
|
779
|
+
} finally {
|
|
780
|
+
setSaving(false);
|
|
781
|
+
}
|
|
782
|
+
}, [formValues, saveTheme, clearError]);
|
|
783
|
+
const handleResetToDefault = (0, import_react2.useCallback)(async () => {
|
|
784
|
+
setFormValues(DEFAULT_THEME);
|
|
785
|
+
setSaveSuccess(false);
|
|
786
|
+
if (theme != null) {
|
|
787
|
+
setSaving(true);
|
|
788
|
+
clearError();
|
|
789
|
+
try {
|
|
790
|
+
await updateTheme(DEFAULT_THEME);
|
|
791
|
+
setSaveSuccess(true);
|
|
792
|
+
} finally {
|
|
793
|
+
setSaving(false);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}, [theme, updateTheme, clearError]);
|
|
797
|
+
if (loading && theme == null) {
|
|
798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { display: "flex", justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_loading_spinner.default, {}) });
|
|
799
|
+
}
|
|
800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Stack, { scale: "l", children: [
|
|
801
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
802
|
+
import_flat_button.default,
|
|
803
|
+
{
|
|
804
|
+
onClick: () => history.push("/"),
|
|
805
|
+
label: backButton.label,
|
|
806
|
+
icon: backButton.icon,
|
|
807
|
+
children: backButton.label
|
|
808
|
+
}
|
|
809
|
+
),
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { padding: "0 20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Stack, { scale: "l", alignItems: "flex-start", children: [
|
|
811
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h1", children: "Theme" }),
|
|
812
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Body, { tone: "secondary", children: "Customize colors, typography, spacing, and component styles." })
|
|
813
|
+
] }) }),
|
|
814
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_card.default, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Stack, { scale: "m", children: [
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Error" }),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Body, { tone: "critical", children: error })
|
|
817
|
+
] }) }),
|
|
818
|
+
saveSuccess && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Body, { tone: "positive", children: "Theme saved successfully." }),
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Stack, { scale: "l", children: [
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { padding: "0 20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_spacings2.default.Inline, { scale: "s", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(theme_preset_selector_default, { onSelectPreset: applyThemeToForm }) }) }),
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Stack, { scale: "s", children: [
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { padding: "0 20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
823
|
+
"button",
|
|
824
|
+
{
|
|
825
|
+
type: "button",
|
|
826
|
+
onClick: () => setIsConfigExpanded((prev) => !prev),
|
|
827
|
+
"aria-expanded": isConfigExpanded,
|
|
828
|
+
style: {
|
|
829
|
+
display: "flex",
|
|
830
|
+
alignItems: "center",
|
|
831
|
+
justifyContent: "space-between",
|
|
832
|
+
width: "100%",
|
|
833
|
+
padding: "12px 16px",
|
|
834
|
+
margin: 0,
|
|
835
|
+
border: "none",
|
|
836
|
+
borderRadius: "4px",
|
|
837
|
+
cursor: "pointer",
|
|
838
|
+
font: "inherit",
|
|
839
|
+
textAlign: "left",
|
|
840
|
+
background: "transparent"
|
|
841
|
+
},
|
|
842
|
+
children: [
|
|
843
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Theme configuration" }),
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
845
|
+
"span",
|
|
846
|
+
{
|
|
847
|
+
style: {
|
|
848
|
+
display: "inline-block",
|
|
849
|
+
width: 0,
|
|
850
|
+
height: 0,
|
|
851
|
+
borderLeft: "5px solid transparent",
|
|
852
|
+
borderRight: "5px solid transparent",
|
|
853
|
+
borderTop: "6px solid currentColor",
|
|
854
|
+
transform: isConfigExpanded ? "rotate(180deg)" : "none",
|
|
855
|
+
opacity: 0.7
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
)
|
|
859
|
+
]
|
|
860
|
+
}
|
|
861
|
+
) }),
|
|
862
|
+
isConfigExpanded && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { padding: "0 20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_spacings2.default.Stack, { scale: "l", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Stack, { scale: "xl", children: [
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Colors" }),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
865
|
+
import_grid.default,
|
|
866
|
+
{
|
|
867
|
+
gridGap: "16px",
|
|
868
|
+
gridAutoColumns: "1fr",
|
|
869
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Primary", htmlFor: "colorPrimary" }),
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
875
|
+
"input",
|
|
876
|
+
{
|
|
877
|
+
type: "color",
|
|
878
|
+
id: "colorPrimary",
|
|
879
|
+
value: formValues.colorPrimary,
|
|
880
|
+
onChange: (e) => handleChange("colorPrimary", e.target.value),
|
|
881
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
882
|
+
}
|
|
883
|
+
),
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
885
|
+
import_text_input.default,
|
|
886
|
+
{
|
|
887
|
+
value: formValues.colorPrimary,
|
|
888
|
+
onChange: (e) => handleChange("colorPrimary", e.target.value),
|
|
889
|
+
horizontalConstraint: 3
|
|
890
|
+
}
|
|
891
|
+
)
|
|
892
|
+
] })
|
|
893
|
+
] }) }),
|
|
894
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
895
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
896
|
+
import_field_label2.default,
|
|
897
|
+
{
|
|
898
|
+
title: "Primary Hover",
|
|
899
|
+
htmlFor: "colorPrimaryHover"
|
|
900
|
+
}
|
|
901
|
+
),
|
|
902
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
904
|
+
"input",
|
|
905
|
+
{
|
|
906
|
+
type: "color",
|
|
907
|
+
id: "colorPrimaryHover",
|
|
908
|
+
value: formValues.colorPrimaryHover,
|
|
909
|
+
onChange: (e) => handleChange("colorPrimaryHover", e.target.value),
|
|
910
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
911
|
+
}
|
|
912
|
+
),
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
914
|
+
import_text_input.default,
|
|
915
|
+
{
|
|
916
|
+
horizontalConstraint: 3,
|
|
917
|
+
value: formValues.colorPrimaryHover,
|
|
918
|
+
onChange: (e) => handleChange("colorPrimaryHover", e.target.value)
|
|
919
|
+
}
|
|
920
|
+
)
|
|
921
|
+
] })
|
|
922
|
+
] }) }),
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
924
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Secondary", htmlFor: "colorSecondary" }),
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
927
|
+
"input",
|
|
928
|
+
{
|
|
929
|
+
type: "color",
|
|
930
|
+
id: "colorSecondary",
|
|
931
|
+
value: formValues.colorSecondary,
|
|
932
|
+
onChange: (e) => handleChange("colorSecondary", e.target.value),
|
|
933
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
934
|
+
}
|
|
935
|
+
),
|
|
936
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
937
|
+
import_text_input.default,
|
|
938
|
+
{
|
|
939
|
+
horizontalConstraint: 3,
|
|
940
|
+
value: formValues.colorSecondary,
|
|
941
|
+
onChange: (e) => handleChange("colorSecondary", e.target.value)
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
] })
|
|
945
|
+
] }) }),
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
948
|
+
import_field_label2.default,
|
|
949
|
+
{
|
|
950
|
+
title: "Background",
|
|
951
|
+
htmlFor: "colorBackground"
|
|
952
|
+
}
|
|
953
|
+
),
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
956
|
+
"input",
|
|
957
|
+
{
|
|
958
|
+
type: "color",
|
|
959
|
+
id: "colorBackground",
|
|
960
|
+
value: formValues.colorBackground,
|
|
961
|
+
onChange: (e) => handleChange("colorBackground", e.target.value),
|
|
962
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
963
|
+
}
|
|
964
|
+
),
|
|
965
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
966
|
+
import_text_input.default,
|
|
967
|
+
{
|
|
968
|
+
horizontalConstraint: 3,
|
|
969
|
+
value: formValues.colorBackground,
|
|
970
|
+
onChange: (e) => handleChange("colorBackground", e.target.value)
|
|
971
|
+
}
|
|
972
|
+
)
|
|
973
|
+
] })
|
|
974
|
+
] }) }),
|
|
975
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Surface", htmlFor: "colorSurface" }),
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
979
|
+
"input",
|
|
980
|
+
{
|
|
981
|
+
type: "color",
|
|
982
|
+
id: "colorSurface",
|
|
983
|
+
value: formValues.colorSurface,
|
|
984
|
+
onChange: (e) => handleChange("colorSurface", e.target.value),
|
|
985
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
986
|
+
}
|
|
987
|
+
),
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
989
|
+
import_text_input.default,
|
|
990
|
+
{
|
|
991
|
+
horizontalConstraint: 3,
|
|
992
|
+
value: formValues.colorSurface,
|
|
993
|
+
onChange: (e) => handleChange("colorSurface", e.target.value)
|
|
994
|
+
}
|
|
995
|
+
)
|
|
996
|
+
] })
|
|
997
|
+
] }) }),
|
|
998
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
999
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Text", htmlFor: "colorText" }),
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1002
|
+
"input",
|
|
1003
|
+
{
|
|
1004
|
+
type: "color",
|
|
1005
|
+
id: "colorText",
|
|
1006
|
+
value: formValues.colorText,
|
|
1007
|
+
onChange: (e) => handleChange("colorText", e.target.value),
|
|
1008
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
1011
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1012
|
+
import_text_input.default,
|
|
1013
|
+
{
|
|
1014
|
+
horizontalConstraint: 3,
|
|
1015
|
+
value: formValues.colorText,
|
|
1016
|
+
onChange: (e) => handleChange("colorText", e.target.value)
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
] })
|
|
1020
|
+
] }) }),
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Text Muted", htmlFor: "colorTextMuted" }),
|
|
1023
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1024
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1025
|
+
"input",
|
|
1026
|
+
{
|
|
1027
|
+
type: "color",
|
|
1028
|
+
id: "colorTextMuted",
|
|
1029
|
+
value: formValues.colorTextMuted,
|
|
1030
|
+
onChange: (e) => handleChange("colorTextMuted", e.target.value),
|
|
1031
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1032
|
+
}
|
|
1033
|
+
),
|
|
1034
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1035
|
+
import_text_input.default,
|
|
1036
|
+
{
|
|
1037
|
+
horizontalConstraint: 3,
|
|
1038
|
+
value: formValues.colorTextMuted,
|
|
1039
|
+
onChange: (e) => handleChange("colorTextMuted", e.target.value)
|
|
1040
|
+
}
|
|
1041
|
+
)
|
|
1042
|
+
] })
|
|
1043
|
+
] }) })
|
|
1044
|
+
]
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Extended colors" }),
|
|
1048
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Body, { tone: "secondary", children: "Optional theme tokens for foregrounds, muted, destructive, accent, border, input, and ring." }),
|
|
1049
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1050
|
+
import_grid.default,
|
|
1051
|
+
{
|
|
1052
|
+
gridGap: "16px",
|
|
1053
|
+
gridAutoColumns: "1fr",
|
|
1054
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1055
|
+
children: [
|
|
1056
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1057
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1058
|
+
import_field_label2.default,
|
|
1059
|
+
{
|
|
1060
|
+
title: "Primary Foreground",
|
|
1061
|
+
htmlFor: "colorPrimaryForeground"
|
|
1062
|
+
}
|
|
1063
|
+
),
|
|
1064
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1065
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1066
|
+
"input",
|
|
1067
|
+
{
|
|
1068
|
+
type: "color",
|
|
1069
|
+
id: "colorPrimaryForeground",
|
|
1070
|
+
value: formValues.colorPrimaryForeground || "#000000",
|
|
1071
|
+
onChange: (e) => handleChange("colorPrimaryForeground", e.target.value),
|
|
1072
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1073
|
+
}
|
|
1074
|
+
),
|
|
1075
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1076
|
+
import_text_input.default,
|
|
1077
|
+
{
|
|
1078
|
+
horizontalConstraint: 3,
|
|
1079
|
+
value: formValues.colorPrimaryForeground ?? "",
|
|
1080
|
+
onChange: (e) => handleChange(
|
|
1081
|
+
"colorPrimaryForeground",
|
|
1082
|
+
e.target.value
|
|
1083
|
+
)
|
|
1084
|
+
}
|
|
1085
|
+
)
|
|
1086
|
+
] })
|
|
1087
|
+
] }) }),
|
|
1088
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1090
|
+
import_field_label2.default,
|
|
1091
|
+
{
|
|
1092
|
+
title: "Secondary Foreground",
|
|
1093
|
+
htmlFor: "colorSecondaryForeground"
|
|
1094
|
+
}
|
|
1095
|
+
),
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1098
|
+
"input",
|
|
1099
|
+
{
|
|
1100
|
+
type: "color",
|
|
1101
|
+
id: "colorSecondaryForeground",
|
|
1102
|
+
value: formValues.colorSecondaryForeground || "#000000",
|
|
1103
|
+
onChange: (e) => handleChange("colorSecondaryForeground", e.target.value),
|
|
1104
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1108
|
+
import_text_input.default,
|
|
1109
|
+
{
|
|
1110
|
+
horizontalConstraint: 3,
|
|
1111
|
+
value: formValues.colorSecondaryForeground ?? "",
|
|
1112
|
+
onChange: (e) => handleChange(
|
|
1113
|
+
"colorSecondaryForeground",
|
|
1114
|
+
e.target.value
|
|
1115
|
+
)
|
|
1116
|
+
}
|
|
1117
|
+
)
|
|
1118
|
+
] })
|
|
1119
|
+
] }) }),
|
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1121
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Foreground", htmlFor: "colorForeground" }),
|
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1124
|
+
"input",
|
|
1125
|
+
{
|
|
1126
|
+
type: "color",
|
|
1127
|
+
id: "colorForeground",
|
|
1128
|
+
value: formValues.colorForeground || "#000000",
|
|
1129
|
+
onChange: (e) => handleChange("colorForeground", e.target.value),
|
|
1130
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1134
|
+
import_text_input.default,
|
|
1135
|
+
{
|
|
1136
|
+
horizontalConstraint: 3,
|
|
1137
|
+
value: formValues.colorForeground ?? "",
|
|
1138
|
+
onChange: (e) => handleChange(
|
|
1139
|
+
"colorForeground",
|
|
1140
|
+
e.target.value
|
|
1141
|
+
)
|
|
1142
|
+
}
|
|
1143
|
+
)
|
|
1144
|
+
] })
|
|
1145
|
+
] }) }),
|
|
1146
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Muted", htmlFor: "colorMuted" }),
|
|
1148
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1150
|
+
"input",
|
|
1151
|
+
{
|
|
1152
|
+
type: "color",
|
|
1153
|
+
id: "colorMuted",
|
|
1154
|
+
value: formValues.colorMuted || "#000000",
|
|
1155
|
+
onChange: (e) => handleChange("colorMuted", e.target.value),
|
|
1156
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1157
|
+
}
|
|
1158
|
+
),
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1160
|
+
import_text_input.default,
|
|
1161
|
+
{
|
|
1162
|
+
horizontalConstraint: 3,
|
|
1163
|
+
value: formValues.colorMuted ?? "",
|
|
1164
|
+
onChange: (e) => handleChange(
|
|
1165
|
+
"colorMuted",
|
|
1166
|
+
e.target.value
|
|
1167
|
+
)
|
|
1168
|
+
}
|
|
1169
|
+
)
|
|
1170
|
+
] })
|
|
1171
|
+
] }) }),
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1173
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1174
|
+
import_field_label2.default,
|
|
1175
|
+
{
|
|
1176
|
+
title: "Muted Foreground",
|
|
1177
|
+
htmlFor: "colorMutedForeground"
|
|
1178
|
+
}
|
|
1179
|
+
),
|
|
1180
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1181
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1182
|
+
"input",
|
|
1183
|
+
{
|
|
1184
|
+
type: "color",
|
|
1185
|
+
id: "colorMutedForeground",
|
|
1186
|
+
value: formValues.colorMutedForeground || "#000000",
|
|
1187
|
+
onChange: (e) => handleChange("colorMutedForeground", e.target.value),
|
|
1188
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1189
|
+
}
|
|
1190
|
+
),
|
|
1191
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1192
|
+
import_text_input.default,
|
|
1193
|
+
{
|
|
1194
|
+
horizontalConstraint: 3,
|
|
1195
|
+
value: formValues.colorMutedForeground ?? "",
|
|
1196
|
+
onChange: (e) => handleChange(
|
|
1197
|
+
"colorMutedForeground",
|
|
1198
|
+
e.target.value
|
|
1199
|
+
)
|
|
1200
|
+
}
|
|
1201
|
+
)
|
|
1202
|
+
] })
|
|
1203
|
+
] }) }),
|
|
1204
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1205
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Destructive", htmlFor: "colorDestructive" }),
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1208
|
+
"input",
|
|
1209
|
+
{
|
|
1210
|
+
type: "color",
|
|
1211
|
+
id: "colorDestructive",
|
|
1212
|
+
value: formValues.colorDestructive || "#000000",
|
|
1213
|
+
onChange: (e) => handleChange("colorDestructive", e.target.value),
|
|
1214
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1215
|
+
}
|
|
1216
|
+
),
|
|
1217
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1218
|
+
import_text_input.default,
|
|
1219
|
+
{
|
|
1220
|
+
horizontalConstraint: 3,
|
|
1221
|
+
value: formValues.colorDestructive ?? "",
|
|
1222
|
+
onChange: (e) => handleChange(
|
|
1223
|
+
"colorDestructive",
|
|
1224
|
+
e.target.value
|
|
1225
|
+
)
|
|
1226
|
+
}
|
|
1227
|
+
)
|
|
1228
|
+
] })
|
|
1229
|
+
] }) }),
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1231
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1232
|
+
import_field_label2.default,
|
|
1233
|
+
{
|
|
1234
|
+
title: "Destructive Foreground",
|
|
1235
|
+
htmlFor: "colorDestructiveForeground"
|
|
1236
|
+
}
|
|
1237
|
+
),
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1240
|
+
"input",
|
|
1241
|
+
{
|
|
1242
|
+
type: "color",
|
|
1243
|
+
id: "colorDestructiveForeground",
|
|
1244
|
+
value: formValues.colorDestructiveForeground || "#000000",
|
|
1245
|
+
onChange: (e) => handleChange("colorDestructiveForeground", e.target.value),
|
|
1246
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1247
|
+
}
|
|
1248
|
+
),
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1250
|
+
import_text_input.default,
|
|
1251
|
+
{
|
|
1252
|
+
horizontalConstraint: 3,
|
|
1253
|
+
value: formValues.colorDestructiveForeground ?? "",
|
|
1254
|
+
onChange: (e) => handleChange(
|
|
1255
|
+
"colorDestructiveForeground",
|
|
1256
|
+
e.target.value
|
|
1257
|
+
)
|
|
1258
|
+
}
|
|
1259
|
+
)
|
|
1260
|
+
] })
|
|
1261
|
+
] }) }),
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Accent", htmlFor: "colorAccent" }),
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1266
|
+
"input",
|
|
1267
|
+
{
|
|
1268
|
+
type: "color",
|
|
1269
|
+
id: "colorAccent",
|
|
1270
|
+
value: formValues.colorAccent || "#000000",
|
|
1271
|
+
onChange: (e) => handleChange("colorAccent", e.target.value),
|
|
1272
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1273
|
+
}
|
|
1274
|
+
),
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1276
|
+
import_text_input.default,
|
|
1277
|
+
{
|
|
1278
|
+
horizontalConstraint: 3,
|
|
1279
|
+
value: formValues.colorAccent ?? "",
|
|
1280
|
+
onChange: (e) => handleChange(
|
|
1281
|
+
"colorAccent",
|
|
1282
|
+
e.target.value
|
|
1283
|
+
)
|
|
1284
|
+
}
|
|
1285
|
+
)
|
|
1286
|
+
] })
|
|
1287
|
+
] }) }),
|
|
1288
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1290
|
+
import_field_label2.default,
|
|
1291
|
+
{
|
|
1292
|
+
title: "Accent Foreground",
|
|
1293
|
+
htmlFor: "colorAccentForeground"
|
|
1294
|
+
}
|
|
1295
|
+
),
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1298
|
+
"input",
|
|
1299
|
+
{
|
|
1300
|
+
type: "color",
|
|
1301
|
+
id: "colorAccentForeground",
|
|
1302
|
+
value: formValues.colorAccentForeground || "#000000",
|
|
1303
|
+
onChange: (e) => handleChange("colorAccentForeground", e.target.value),
|
|
1304
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1305
|
+
}
|
|
1306
|
+
),
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1308
|
+
import_text_input.default,
|
|
1309
|
+
{
|
|
1310
|
+
horizontalConstraint: 3,
|
|
1311
|
+
value: formValues.colorAccentForeground ?? "",
|
|
1312
|
+
onChange: (e) => handleChange(
|
|
1313
|
+
"colorAccentForeground",
|
|
1314
|
+
e.target.value
|
|
1315
|
+
)
|
|
1316
|
+
}
|
|
1317
|
+
)
|
|
1318
|
+
] })
|
|
1319
|
+
] }) }),
|
|
1320
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1321
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Border", htmlFor: "colorBorder" }),
|
|
1322
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1323
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1324
|
+
"input",
|
|
1325
|
+
{
|
|
1326
|
+
type: "color",
|
|
1327
|
+
id: "colorBorder",
|
|
1328
|
+
value: formValues.colorBorder || "#000000",
|
|
1329
|
+
onChange: (e) => handleChange("colorBorder", e.target.value),
|
|
1330
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1331
|
+
}
|
|
1332
|
+
),
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1334
|
+
import_text_input.default,
|
|
1335
|
+
{
|
|
1336
|
+
horizontalConstraint: 3,
|
|
1337
|
+
value: formValues.colorBorder ?? "",
|
|
1338
|
+
onChange: (e) => handleChange(
|
|
1339
|
+
"colorBorder",
|
|
1340
|
+
e.target.value
|
|
1341
|
+
)
|
|
1342
|
+
}
|
|
1343
|
+
)
|
|
1344
|
+
] })
|
|
1345
|
+
] }) }),
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Input", htmlFor: "colorInput" }),
|
|
1348
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1349
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1350
|
+
"input",
|
|
1351
|
+
{
|
|
1352
|
+
type: "color",
|
|
1353
|
+
id: "colorInput",
|
|
1354
|
+
value: formValues.colorInput || "#000000",
|
|
1355
|
+
onChange: (e) => handleChange("colorInput", e.target.value),
|
|
1356
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1357
|
+
}
|
|
1358
|
+
),
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1360
|
+
import_text_input.default,
|
|
1361
|
+
{
|
|
1362
|
+
horizontalConstraint: 3,
|
|
1363
|
+
value: formValues.colorInput ?? "",
|
|
1364
|
+
onChange: (e) => handleChange(
|
|
1365
|
+
"colorInput",
|
|
1366
|
+
e.target.value
|
|
1367
|
+
)
|
|
1368
|
+
}
|
|
1369
|
+
)
|
|
1370
|
+
] })
|
|
1371
|
+
] }) }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Ring", htmlFor: "colorRing" }),
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1376
|
+
"input",
|
|
1377
|
+
{
|
|
1378
|
+
type: "color",
|
|
1379
|
+
id: "colorRing",
|
|
1380
|
+
value: formValues.colorRing || "#000000",
|
|
1381
|
+
onChange: (e) => handleChange("colorRing", e.target.value),
|
|
1382
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1383
|
+
}
|
|
1384
|
+
),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1386
|
+
import_text_input.default,
|
|
1387
|
+
{
|
|
1388
|
+
horizontalConstraint: 3,
|
|
1389
|
+
value: formValues.colorRing ?? "",
|
|
1390
|
+
onChange: (e) => handleChange(
|
|
1391
|
+
"colorRing",
|
|
1392
|
+
e.target.value
|
|
1393
|
+
)
|
|
1394
|
+
}
|
|
1395
|
+
)
|
|
1396
|
+
] })
|
|
1397
|
+
] }) })
|
|
1398
|
+
]
|
|
1399
|
+
}
|
|
1400
|
+
),
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Typography" }),
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1403
|
+
import_grid.default,
|
|
1404
|
+
{
|
|
1405
|
+
gridGap: "16px",
|
|
1406
|
+
gridAutoColumns: "1fr",
|
|
1407
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1408
|
+
children: [
|
|
1409
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1410
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Font Family", htmlFor: "fontFamily" }),
|
|
1411
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1412
|
+
import_text_input.default,
|
|
1413
|
+
{
|
|
1414
|
+
horizontalConstraint: 4,
|
|
1415
|
+
id: "fontFamily",
|
|
1416
|
+
value: formValues.fontFamily,
|
|
1417
|
+
onChange: (e) => handleChange("fontFamily", e.target.value)
|
|
1418
|
+
}
|
|
1419
|
+
)
|
|
1420
|
+
] }) }),
|
|
1421
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1422
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Heading Font", htmlFor: "fontHeading" }),
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1424
|
+
import_text_input.default,
|
|
1425
|
+
{
|
|
1426
|
+
horizontalConstraint: 4,
|
|
1427
|
+
id: "fontHeading",
|
|
1428
|
+
value: formValues.fontHeading,
|
|
1429
|
+
onChange: (e) => handleChange("fontHeading", e.target.value)
|
|
1430
|
+
}
|
|
1431
|
+
)
|
|
1432
|
+
] }) })
|
|
1433
|
+
]
|
|
1434
|
+
}
|
|
1435
|
+
),
|
|
1436
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Layout & Components" }),
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1438
|
+
import_grid.default,
|
|
1439
|
+
{
|
|
1440
|
+
gridGap: "16px",
|
|
1441
|
+
gridAutoColumns: "1fr",
|
|
1442
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1443
|
+
children: [
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Spacing Scale", htmlFor: "spacingScale" }),
|
|
1446
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1447
|
+
import_number_input.default,
|
|
1448
|
+
{
|
|
1449
|
+
id: "spacingScale",
|
|
1450
|
+
horizontalConstraint: 3,
|
|
1451
|
+
value: formValues.spacingScale,
|
|
1452
|
+
onChange: (e) => handleChange(
|
|
1453
|
+
"spacingScale",
|
|
1454
|
+
e.target.value === "" ? 0 : Number(e.target.value)
|
|
1455
|
+
)
|
|
1456
|
+
}
|
|
1457
|
+
)
|
|
1458
|
+
] }) }),
|
|
1459
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Border Radius", htmlFor: "borderRadius" }),
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1462
|
+
import_select_input2.default,
|
|
1463
|
+
{
|
|
1464
|
+
id: "borderRadius",
|
|
1465
|
+
horizontalConstraint: 3,
|
|
1466
|
+
value: formValues.borderRadius,
|
|
1467
|
+
onChange: (e) => handleChange(
|
|
1468
|
+
"borderRadius",
|
|
1469
|
+
e.target.value
|
|
1470
|
+
),
|
|
1471
|
+
options: BORDER_RADIUS_OPTIONS
|
|
1472
|
+
}
|
|
1473
|
+
)
|
|
1474
|
+
] }) }),
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1476
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Border Width", htmlFor: "borderWidth" }),
|
|
1477
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1478
|
+
import_select_input2.default,
|
|
1479
|
+
{
|
|
1480
|
+
id: "borderWidth",
|
|
1481
|
+
horizontalConstraint: 3,
|
|
1482
|
+
value: formValues.borderWidth,
|
|
1483
|
+
onChange: (e) => handleChange(
|
|
1484
|
+
"borderWidth",
|
|
1485
|
+
e.target.value
|
|
1486
|
+
),
|
|
1487
|
+
options: BORDER_WIDTH_OPTIONS
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
] }) }),
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Button Style", htmlFor: "buttonStyle" }),
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1494
|
+
import_select_input2.default,
|
|
1495
|
+
{
|
|
1496
|
+
id: "buttonStyle",
|
|
1497
|
+
horizontalConstraint: 3,
|
|
1498
|
+
value: formValues.buttonStyle,
|
|
1499
|
+
onChange: (e) => handleChange(
|
|
1500
|
+
"buttonStyle",
|
|
1501
|
+
e.target.value
|
|
1502
|
+
),
|
|
1503
|
+
options: BUTTON_STYLE_OPTIONS
|
|
1504
|
+
}
|
|
1505
|
+
)
|
|
1506
|
+
] }) }),
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Card Shadow", htmlFor: "cardShadow" }),
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1510
|
+
import_select_input2.default,
|
|
1511
|
+
{
|
|
1512
|
+
id: "cardShadow",
|
|
1513
|
+
horizontalConstraint: 3,
|
|
1514
|
+
value: formValues.cardShadow,
|
|
1515
|
+
onChange: (e) => handleChange(
|
|
1516
|
+
"cardShadow",
|
|
1517
|
+
e.target.value
|
|
1518
|
+
),
|
|
1519
|
+
options: CARD_SHADOW_OPTIONS
|
|
1520
|
+
}
|
|
1521
|
+
)
|
|
1522
|
+
] }) }),
|
|
1523
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Header Style", htmlFor: "headerStyle" }),
|
|
1525
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1526
|
+
import_select_input2.default,
|
|
1527
|
+
{
|
|
1528
|
+
id: "headerStyle",
|
|
1529
|
+
horizontalConstraint: 3,
|
|
1530
|
+
value: formValues.headerStyle,
|
|
1531
|
+
onChange: (e) => handleChange(
|
|
1532
|
+
"headerStyle",
|
|
1533
|
+
e.target.value
|
|
1534
|
+
),
|
|
1535
|
+
options: HEADER_STYLE_OPTIONS
|
|
1536
|
+
}
|
|
1537
|
+
)
|
|
1538
|
+
] }) })
|
|
1539
|
+
]
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Shadow & surface" }),
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1544
|
+
import_grid.default,
|
|
1545
|
+
{
|
|
1546
|
+
gridGap: "16px",
|
|
1547
|
+
gridAutoColumns: "1fr",
|
|
1548
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1549
|
+
children: [
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Shadow Light", htmlFor: "colorShadowLight" }),
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1554
|
+
"input",
|
|
1555
|
+
{
|
|
1556
|
+
type: "color",
|
|
1557
|
+
id: "colorShadowLight",
|
|
1558
|
+
value: formValues.colorShadowLight ?? "#ffffff",
|
|
1559
|
+
onChange: (e) => handleChange("colorShadowLight", e.target.value),
|
|
1560
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1561
|
+
}
|
|
1562
|
+
),
|
|
1563
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1564
|
+
import_text_input.default,
|
|
1565
|
+
{
|
|
1566
|
+
horizontalConstraint: 3,
|
|
1567
|
+
value: formValues.colorShadowLight ?? "",
|
|
1568
|
+
onChange: (e) => handleChange(
|
|
1569
|
+
"colorShadowLight",
|
|
1570
|
+
e.target.value
|
|
1571
|
+
)
|
|
1572
|
+
}
|
|
1573
|
+
)
|
|
1574
|
+
] })
|
|
1575
|
+
] }) }),
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Shadow Dark", htmlFor: "colorShadowDark" }),
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { alignItems: "center", scale: "s", children: [
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1580
|
+
"input",
|
|
1581
|
+
{
|
|
1582
|
+
type: "color",
|
|
1583
|
+
id: "colorShadowDark",
|
|
1584
|
+
value: formValues.colorShadowDark ?? "#b8bec7",
|
|
1585
|
+
onChange: (e) => handleChange("colorShadowDark", e.target.value),
|
|
1586
|
+
style: { width: 40, height: 32, cursor: "pointer" }
|
|
1587
|
+
}
|
|
1588
|
+
),
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1590
|
+
import_text_input.default,
|
|
1591
|
+
{
|
|
1592
|
+
horizontalConstraint: 3,
|
|
1593
|
+
value: formValues.colorShadowDark ?? "",
|
|
1594
|
+
onChange: (e) => handleChange(
|
|
1595
|
+
"colorShadowDark",
|
|
1596
|
+
e.target.value
|
|
1597
|
+
)
|
|
1598
|
+
}
|
|
1599
|
+
)
|
|
1600
|
+
] })
|
|
1601
|
+
] }) }),
|
|
1602
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Surface Glass", htmlFor: "colorSurfaceGlass" }),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1605
|
+
import_text_input.default,
|
|
1606
|
+
{
|
|
1607
|
+
horizontalConstraint: 3,
|
|
1608
|
+
id: "colorSurfaceGlass",
|
|
1609
|
+
value: formValues.colorSurfaceGlass ?? "",
|
|
1610
|
+
onChange: (e) => handleChange(
|
|
1611
|
+
"colorSurfaceGlass",
|
|
1612
|
+
e.target.value
|
|
1613
|
+
)
|
|
1614
|
+
}
|
|
1615
|
+
)
|
|
1616
|
+
] }) }),
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1618
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Shadow Style", htmlFor: "shadowStyle" }),
|
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1620
|
+
import_select_input2.default,
|
|
1621
|
+
{
|
|
1622
|
+
id: "shadowStyle",
|
|
1623
|
+
horizontalConstraint: 3,
|
|
1624
|
+
value: formValues.shadowStyle ?? DEFAULT_THEME.shadowStyle,
|
|
1625
|
+
onChange: (e) => handleChange(
|
|
1626
|
+
"shadowStyle",
|
|
1627
|
+
e.target.value
|
|
1628
|
+
),
|
|
1629
|
+
options: SHADOW_STYLE_OPTIONS
|
|
1630
|
+
}
|
|
1631
|
+
)
|
|
1632
|
+
] }) }),
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Surface Blur", htmlFor: "surfaceBlur" }),
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1636
|
+
import_select_input2.default,
|
|
1637
|
+
{
|
|
1638
|
+
id: "surfaceBlur",
|
|
1639
|
+
horizontalConstraint: 3,
|
|
1640
|
+
value: formValues.surfaceBlur ?? DEFAULT_THEME.surfaceBlur,
|
|
1641
|
+
onChange: (e) => handleChange(
|
|
1642
|
+
"surfaceBlur",
|
|
1643
|
+
e.target.value
|
|
1644
|
+
),
|
|
1645
|
+
options: SURFACE_BLUR_OPTIONS
|
|
1646
|
+
}
|
|
1647
|
+
)
|
|
1648
|
+
] }) }),
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Surface Opacity", htmlFor: "surfaceOpacity" }),
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1652
|
+
import_number_input.default,
|
|
1653
|
+
{
|
|
1654
|
+
id: "surfaceOpacity",
|
|
1655
|
+
horizontalConstraint: 3,
|
|
1656
|
+
value: formValues.surfaceOpacity ?? 1,
|
|
1657
|
+
onChange: (e) => handleChange(
|
|
1658
|
+
"surfaceOpacity",
|
|
1659
|
+
e.target.value === "" ? 0 : Math.min(1, Math.max(0, Number(e.target.value)))
|
|
1660
|
+
)
|
|
1661
|
+
}
|
|
1662
|
+
)
|
|
1663
|
+
] }) }),
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Border Style", htmlFor: "borderStyle" }),
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1667
|
+
import_select_input2.default,
|
|
1668
|
+
{
|
|
1669
|
+
id: "borderStyle",
|
|
1670
|
+
horizontalConstraint: 3,
|
|
1671
|
+
value: formValues.borderStyle ?? DEFAULT_THEME.borderStyle,
|
|
1672
|
+
onChange: (e) => handleChange(
|
|
1673
|
+
"borderStyle",
|
|
1674
|
+
e.target.value
|
|
1675
|
+
),
|
|
1676
|
+
options: BORDER_STYLE_OPTIONS
|
|
1677
|
+
}
|
|
1678
|
+
)
|
|
1679
|
+
] }) }),
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Background Style", htmlFor: "backgroundStyle" }),
|
|
1682
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1683
|
+
import_select_input2.default,
|
|
1684
|
+
{
|
|
1685
|
+
id: "backgroundStyle",
|
|
1686
|
+
horizontalConstraint: 3,
|
|
1687
|
+
value: formValues.backgroundStyle ?? DEFAULT_THEME.backgroundStyle,
|
|
1688
|
+
onChange: (e) => handleChange(
|
|
1689
|
+
"backgroundStyle",
|
|
1690
|
+
e.target.value
|
|
1691
|
+
),
|
|
1692
|
+
options: BACKGROUND_STYLE_OPTIONS
|
|
1693
|
+
}
|
|
1694
|
+
)
|
|
1695
|
+
] }) })
|
|
1696
|
+
]
|
|
1697
|
+
}
|
|
1698
|
+
),
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text.default.Headline, { as: "h2", children: "Typography (weight & transform)" }),
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1701
|
+
import_grid.default,
|
|
1702
|
+
{
|
|
1703
|
+
gridGap: "16px",
|
|
1704
|
+
gridAutoColumns: "1fr",
|
|
1705
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1706
|
+
children: [
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Font Weight Base", htmlFor: "fontWeightBase" }),
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1710
|
+
import_select_input2.default,
|
|
1711
|
+
{
|
|
1712
|
+
id: "fontWeightBase",
|
|
1713
|
+
horizontalConstraint: 3,
|
|
1714
|
+
value: formValues.fontWeightBase ?? DEFAULT_THEME.fontWeightBase,
|
|
1715
|
+
onChange: (e) => handleChange(
|
|
1716
|
+
"fontWeightBase",
|
|
1717
|
+
e.target.value
|
|
1718
|
+
),
|
|
1719
|
+
options: FONT_WEIGHT_BASE_OPTIONS
|
|
1720
|
+
}
|
|
1721
|
+
)
|
|
1722
|
+
] }) }),
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Font Weight Heading", htmlFor: "fontWeightHeading" }),
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1726
|
+
import_select_input2.default,
|
|
1727
|
+
{
|
|
1728
|
+
id: "fontWeightHeading",
|
|
1729
|
+
horizontalConstraint: 3,
|
|
1730
|
+
value: formValues.fontWeightHeading ?? DEFAULT_THEME.fontWeightHeading,
|
|
1731
|
+
onChange: (e) => handleChange(
|
|
1732
|
+
"fontWeightHeading",
|
|
1733
|
+
e.target.value
|
|
1734
|
+
),
|
|
1735
|
+
options: FONT_WEIGHT_HEADING_OPTIONS
|
|
1736
|
+
}
|
|
1737
|
+
)
|
|
1738
|
+
] }) }),
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Letter Spacing", htmlFor: "letterSpacing" }),
|
|
1741
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1742
|
+
import_select_input2.default,
|
|
1743
|
+
{
|
|
1744
|
+
id: "letterSpacing",
|
|
1745
|
+
horizontalConstraint: 3,
|
|
1746
|
+
value: formValues.letterSpacing ?? DEFAULT_THEME.letterSpacing,
|
|
1747
|
+
onChange: (e) => handleChange(
|
|
1748
|
+
"letterSpacing",
|
|
1749
|
+
e.target.value
|
|
1750
|
+
),
|
|
1751
|
+
options: LETTER_SPACING_OPTIONS
|
|
1752
|
+
}
|
|
1753
|
+
)
|
|
1754
|
+
] }) }),
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_grid.default.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
1756
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_field_label2.default, { title: "Text Transform", htmlFor: "textTransform" }),
|
|
1757
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1758
|
+
import_select_input2.default,
|
|
1759
|
+
{
|
|
1760
|
+
id: "textTransform",
|
|
1761
|
+
horizontalConstraint: 3,
|
|
1762
|
+
value: formValues.textTransform ?? DEFAULT_THEME.textTransform,
|
|
1763
|
+
onChange: (e) => handleChange(
|
|
1764
|
+
"textTransform",
|
|
1765
|
+
e.target.value
|
|
1766
|
+
),
|
|
1767
|
+
options: TEXT_TRANSFORM_OPTIONS
|
|
1768
|
+
}
|
|
1769
|
+
)
|
|
1770
|
+
] }) })
|
|
1771
|
+
]
|
|
1772
|
+
}
|
|
1773
|
+
),
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_spacings2.default.Inline, { children: [
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1776
|
+
import_primary_button2.default,
|
|
1777
|
+
{
|
|
1778
|
+
label: saving ? "Saving\u2026" : "Save",
|
|
1779
|
+
onClick: handleSave,
|
|
1780
|
+
isDisabled: saving
|
|
1781
|
+
}
|
|
1782
|
+
),
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1784
|
+
import_secondary_button.default,
|
|
1785
|
+
{
|
|
1786
|
+
label: "Reset to default",
|
|
1787
|
+
onClick: handleResetToDefault,
|
|
1788
|
+
isDisabled: saving
|
|
1789
|
+
}
|
|
1790
|
+
)
|
|
1791
|
+
] })
|
|
1792
|
+
] }) }) })
|
|
1793
|
+
] })
|
|
1794
|
+
] })
|
|
1795
|
+
] });
|
|
1796
|
+
};
|
|
1797
|
+
var ThemeManager = ({
|
|
1798
|
+
baseURL,
|
|
1799
|
+
projectKey,
|
|
1800
|
+
businessUnitKey,
|
|
1801
|
+
jwtToken,
|
|
1802
|
+
...innerProps
|
|
1803
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1804
|
+
import_puck_api.PuckApiProvider,
|
|
1805
|
+
{
|
|
1806
|
+
baseURL,
|
|
1807
|
+
projectKey,
|
|
1808
|
+
businessUnitKey,
|
|
1809
|
+
jwtToken,
|
|
1810
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ThemeEditorInner, { ...innerProps })
|
|
1811
|
+
}
|
|
1812
|
+
);
|
|
1813
|
+
var theme_editor_default = ThemeManager;
|
|
1814
|
+
|
|
1815
|
+
// src/components/import-content-types.tsx
|
|
1816
|
+
var import_react3 = require("react");
|
|
1817
|
+
var import_react_router_dom2 = require("react-router-dom");
|
|
1818
|
+
var import_puck_api2 = require("@commercetools-demo/puck-api");
|
|
1819
|
+
var import_card2 = __toESM(require("@commercetools-uikit/card"));
|
|
1820
|
+
var import_flat_button2 = __toESM(require("@commercetools-uikit/flat-button"));
|
|
1821
|
+
var import_primary_button3 = __toESM(require("@commercetools-uikit/primary-button"));
|
|
1822
|
+
var import_spacings3 = __toESM(require("@commercetools-uikit/spacings"));
|
|
1823
|
+
var import_text2 = __toESM(require("@commercetools-uikit/text"));
|
|
1824
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1825
|
+
var ImportContentTypesInner = ({ backButton }) => {
|
|
1826
|
+
const history = (0, import_react_router_dom2.useHistory)();
|
|
1827
|
+
const { importDefaultContentTypes, loading, error, clearError } = (0, import_puck_api2.usePuckContentType)();
|
|
1828
|
+
const [result, setResult] = (0, import_react3.useState)(null);
|
|
1829
|
+
const handleBack = (0, import_react3.useCallback)(() => {
|
|
1830
|
+
if (backButton?.onClick) {
|
|
1831
|
+
backButton.onClick();
|
|
1832
|
+
} else {
|
|
1833
|
+
history.push("/");
|
|
1834
|
+
}
|
|
1835
|
+
}, [backButton, history]);
|
|
1836
|
+
const handleImport = (0, import_react3.useCallback)(async () => {
|
|
1837
|
+
clearError();
|
|
1838
|
+
setResult(null);
|
|
1839
|
+
try {
|
|
1840
|
+
const importResult = await importDefaultContentTypes();
|
|
1841
|
+
setResult(importResult);
|
|
1842
|
+
} catch {
|
|
1843
|
+
}
|
|
1844
|
+
}, [importDefaultContentTypes, clearError]);
|
|
1845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_spacings3.default.Stack, { scale: "l", children: [
|
|
1846
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1847
|
+
import_flat_button2.default,
|
|
1848
|
+
{
|
|
1849
|
+
onClick: handleBack,
|
|
1850
|
+
label: backButton.label,
|
|
1851
|
+
icon: backButton.icon,
|
|
1852
|
+
children: backButton.label
|
|
1853
|
+
}
|
|
1854
|
+
),
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_text2.default.Headline, { as: "h1", children: "Import default content types" }),
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_text2.default.Body, { tone: "secondary", children: "Import default content type definitions from samples. Existing content types with the same key may be skipped or cause errors." }),
|
|
1857
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_card2.default, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_spacings3.default.Stack, { scale: "m", children: [
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_text2.default.Headline, { as: "h2", children: "Error" }),
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_text2.default.Body, { tone: "critical", children: error })
|
|
1860
|
+
] }) }),
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_spacings3.default.Inline, { scale: "m", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1862
|
+
import_primary_button3.default,
|
|
1863
|
+
{
|
|
1864
|
+
label: loading ? "Importing\u2026" : "Import default content types",
|
|
1865
|
+
onClick: handleImport,
|
|
1866
|
+
isDisabled: loading
|
|
1867
|
+
}
|
|
1868
|
+
) }),
|
|
1869
|
+
result && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_card2.default, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_spacings3.default.Stack, { scale: "m", children: [
|
|
1870
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_text2.default.Headline, { as: "h2", children: "Result" }),
|
|
1871
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_text2.default.Body, { children: [
|
|
1872
|
+
"Imported: ",
|
|
1873
|
+
result.imported.length,
|
|
1874
|
+
" content type",
|
|
1875
|
+
result.imported.length !== 1 ? "s" : "",
|
|
1876
|
+
"."
|
|
1877
|
+
] }),
|
|
1878
|
+
result.imported.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_text2.default.Body, { tone: "secondary", children: result.imported.join(", ") }),
|
|
1879
|
+
result.failed.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_text2.default.Body, { tone: "critical", children: [
|
|
1881
|
+
"Failed: ",
|
|
1882
|
+
result.failed.length,
|
|
1883
|
+
" content type",
|
|
1884
|
+
result.failed.length !== 1 ? "s" : "",
|
|
1885
|
+
"."
|
|
1886
|
+
] }),
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_spacings3.default.Stack, { scale: "s", children: result.failed.map(({ key, error: err }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_text2.default.Body, { tone: "critical", children: [
|
|
1888
|
+
key,
|
|
1889
|
+
": ",
|
|
1890
|
+
err
|
|
1891
|
+
] }, key)) })
|
|
1892
|
+
] })
|
|
1893
|
+
] }) })
|
|
1894
|
+
] });
|
|
1895
|
+
};
|
|
1896
|
+
var ImportContentTypes = ({
|
|
1897
|
+
baseURL,
|
|
1898
|
+
projectKey,
|
|
1899
|
+
businessUnitKey,
|
|
1900
|
+
jwtToken,
|
|
1901
|
+
...innerProps
|
|
1902
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1903
|
+
import_puck_api2.PuckApiProvider,
|
|
1904
|
+
{
|
|
1905
|
+
baseURL,
|
|
1906
|
+
projectKey,
|
|
1907
|
+
businessUnitKey,
|
|
1908
|
+
jwtToken,
|
|
1909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ImportContentTypesInner, { ...innerProps })
|
|
1910
|
+
}
|
|
1911
|
+
);
|
|
1912
|
+
var import_content_types_default = ImportContentTypes;
|
|
1913
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1914
|
+
0 && (module.exports = {
|
|
1915
|
+
DEFAULT_THEME,
|
|
1916
|
+
ImportContentTypes,
|
|
1917
|
+
PRESET_KEYS_SELECTOR,
|
|
1918
|
+
ThemeManager,
|
|
1919
|
+
buildCssVars,
|
|
1920
|
+
paradigmLabels,
|
|
1921
|
+
themePresets
|
|
1922
|
+
});
|
|
1923
|
+
//# sourceMappingURL=index.js.map
|