@manzanohq/theme-editor 0.1.7
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/LICENSE +191 -0
- package/cdn/chunks/chunk.5X2KFTEK.js +643 -0
- package/cdn/chunks/chunk.5X2KFTEK.js.map +7 -0
- package/cdn/chunks/chunk.YADVC6ZY.js +2 -0
- package/cdn/chunks/chunk.YADVC6ZY.js.map +7 -0
- package/cdn/index.d.ts +2 -0
- package/cdn/index.js +2 -0
- package/cdn/index.js.map +7 -0
- package/cdn/theme-editor.component.d.ts +50 -0
- package/cdn/theme-editor.component.js +2 -0
- package/cdn/theme-editor.component.js.map +7 -0
- package/cdn/theme-editor.d.ts +8 -0
- package/cdn/theme-editor.js +2 -0
- package/cdn/theme-editor.js.map +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/dist/theme-editor.component.d.ts +50 -0
- package/dist/theme-editor.component.d.ts.map +1 -0
- package/dist/theme-editor.component.js +910 -0
- package/dist/theme-editor.component.js.map +7 -0
- package/dist/theme-editor.d.ts +8 -0
- package/dist/theme-editor.d.ts.map +1 -0
- package/dist/theme-editor.js +4 -0
- package/dist/theme-editor.js.map +7 -0
- package/package.json +32 -0
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
import { html, css, nothing } from "lit";
|
|
12
|
+
import { property, state } from "lit/decorators.js";
|
|
13
|
+
import { ManzanoElement } from "../../components/src/internal/manzano-element.js";
|
|
14
|
+
const DEFAULT_TOKENS = {
|
|
15
|
+
// Brand & Semantic
|
|
16
|
+
"--mz-color-primary": "#4260a8",
|
|
17
|
+
"--mz-color-action": "#4260a8",
|
|
18
|
+
"--mz-color-on-action": "#ffffff",
|
|
19
|
+
"--mz-color-focus": "#4260a8",
|
|
20
|
+
"--mz-color-selected": "#4260a8",
|
|
21
|
+
"--mz-color-on-selected": "#ffffff",
|
|
22
|
+
"--mz-color-link": "#4260a8",
|
|
23
|
+
// Surfaces
|
|
24
|
+
"--mz-color-surface": "#ffffff",
|
|
25
|
+
"--mz-color-surface-raised": "#faf9f7",
|
|
26
|
+
"--mz-color-text": "#1c1915",
|
|
27
|
+
"--mz-color-text-secondary": "#79726b",
|
|
28
|
+
"--mz-color-border": "#d5d1cb",
|
|
29
|
+
// Status
|
|
30
|
+
"--mz-color-success": "#2d8556",
|
|
31
|
+
"--mz-color-warning": "#d59724",
|
|
32
|
+
"--mz-color-danger": "#c04b34",
|
|
33
|
+
"--mz-color-neutral": "#433d37",
|
|
34
|
+
// Typography & Spacing
|
|
35
|
+
"--mz-font-sans": "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
36
|
+
"--mz-space-scale": "1",
|
|
37
|
+
"--mz-font-size-scale": "1",
|
|
38
|
+
// Shape
|
|
39
|
+
"--mz-radius-sm": "6px",
|
|
40
|
+
"--mz-radius-md": "8px",
|
|
41
|
+
"--mz-radius-lg": "12px",
|
|
42
|
+
"--mz-border-width-sm": "1px",
|
|
43
|
+
"--mz-input-bg": "#ffffff",
|
|
44
|
+
"--mz-input-border-width": "1px",
|
|
45
|
+
// Shadows
|
|
46
|
+
"--mz-shadow-sm": "0 1px 3px 0 rgb(28 25 21 / 0.09), 0 1px 2px -1px rgb(28 25 21 / 0.07)",
|
|
47
|
+
"--mz-shadow-md": "0 4px 8px -2px rgb(28 25 21 / 0.1), 0 2px 4px -2px rgb(28 25 21 / 0.06)",
|
|
48
|
+
"--mz-shadow-lg": "0 12px 20px -4px rgb(28 25 21 / 0.12), 0 4px 8px -4px rgb(28 25 21 / 0.05)"
|
|
49
|
+
};
|
|
50
|
+
const SHADOW_PRESETS = {
|
|
51
|
+
none: {
|
|
52
|
+
sm: "none",
|
|
53
|
+
md: "none",
|
|
54
|
+
lg: "none"
|
|
55
|
+
},
|
|
56
|
+
subtle: {
|
|
57
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.04)",
|
|
58
|
+
md: "0 2px 4px -1px rgb(0 0 0 / 0.06)",
|
|
59
|
+
lg: "0 6px 12px -3px rgb(0 0 0 / 0.08)"
|
|
60
|
+
},
|
|
61
|
+
medium: {
|
|
62
|
+
sm: "0 1px 3px 0 rgb(28 25 21 / 0.09), 0 1px 2px -1px rgb(28 25 21 / 0.07)",
|
|
63
|
+
md: "0 4px 8px -2px rgb(28 25 21 / 0.1), 0 2px 4px -2px rgb(28 25 21 / 0.06)",
|
|
64
|
+
lg: "0 12px 20px -4px rgb(28 25 21 / 0.12), 0 4px 8px -4px rgb(28 25 21 / 0.05)"
|
|
65
|
+
},
|
|
66
|
+
dramatic: {
|
|
67
|
+
sm: "0 2px 6px 0 rgb(0 0 0 / 0.16), 0 1px 3px -1px rgb(0 0 0 / 0.12)",
|
|
68
|
+
md: "0 8px 16px -4px rgb(0 0 0 / 0.2), 0 4px 8px -4px rgb(0 0 0 / 0.14)",
|
|
69
|
+
lg: "0 20px 40px -8px rgb(0 0 0 / 0.25), 0 8px 16px -6px rgb(0 0 0 / 0.15)"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const TABS = [
|
|
73
|
+
{ id: "colors", label: "Colors" },
|
|
74
|
+
{ id: "typography", label: "Typography & Spacing" },
|
|
75
|
+
{ id: "shape", label: "Shape" },
|
|
76
|
+
{ id: "shadows", label: "Shadows" }
|
|
77
|
+
];
|
|
78
|
+
const editorStyles = css`
|
|
79
|
+
:host {
|
|
80
|
+
display: block;
|
|
81
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
82
|
+
font-size: 14px;
|
|
83
|
+
line-height: 1.5;
|
|
84
|
+
|
|
85
|
+
/* Editor chrome — light mode defaults */
|
|
86
|
+
--_editor-bg: #f6f6f7;
|
|
87
|
+
--_editor-bg-raised: #ffffff;
|
|
88
|
+
--_editor-text: #1a1a1a;
|
|
89
|
+
--_editor-text-secondary: #666;
|
|
90
|
+
--_editor-text-muted: #999;
|
|
91
|
+
--_editor-border: #e0e0e0;
|
|
92
|
+
--_editor-accent: #4260a8;
|
|
93
|
+
--_editor-input-bg: #ffffff;
|
|
94
|
+
--_editor-tab-bg: #eeeeef;
|
|
95
|
+
|
|
96
|
+
color: var(--_editor-text);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Dark mode — activated via JS-set [dark] attribute on :host */
|
|
100
|
+
:host([dark]) {
|
|
101
|
+
--_editor-bg: #1a1a1d;
|
|
102
|
+
--_editor-bg-raised: #252528;
|
|
103
|
+
--_editor-text: #e4e4e7;
|
|
104
|
+
--_editor-text-secondary: #a1a1a8;
|
|
105
|
+
--_editor-text-muted: #71717a;
|
|
106
|
+
--_editor-border: #333336;
|
|
107
|
+
--_editor-accent: #818cf8;
|
|
108
|
+
--_editor-input-bg: #252528;
|
|
109
|
+
--_editor-tab-bg: #141416;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
*,
|
|
113
|
+
*::before,
|
|
114
|
+
*::after {
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ---- Full-width mode ---- */
|
|
119
|
+
:host([full-width]) .editor {
|
|
120
|
+
border: none;
|
|
121
|
+
border-radius: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([full-width]) .editor__controls {
|
|
125
|
+
max-width: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* ---- Layout ---- */
|
|
129
|
+
.editor {
|
|
130
|
+
display: flex;
|
|
131
|
+
height: 100%;
|
|
132
|
+
min-height: 540px;
|
|
133
|
+
border: 1px solid var(--_editor-border);
|
|
134
|
+
border-radius: 6px;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
background: var(--_editor-bg);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.editor__controls {
|
|
140
|
+
width: 40%;
|
|
141
|
+
min-width: 300px;
|
|
142
|
+
max-width: 480px;
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
border-right: 1px solid var(--_editor-border);
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.editor__preview {
|
|
150
|
+
flex: 1;
|
|
151
|
+
overflow: auto;
|
|
152
|
+
background: var(--_editor-bg-raised);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* ---- Tabs ---- */
|
|
156
|
+
.tabs {
|
|
157
|
+
display: flex;
|
|
158
|
+
background: var(--_editor-tab-bg);
|
|
159
|
+
border-bottom: 1px solid var(--_editor-border);
|
|
160
|
+
padding: 0;
|
|
161
|
+
margin: 0;
|
|
162
|
+
flex-shrink: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.tabs__btn {
|
|
166
|
+
flex: 1;
|
|
167
|
+
padding: 8px 6px;
|
|
168
|
+
border: none;
|
|
169
|
+
background: transparent;
|
|
170
|
+
font: inherit;
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
font-weight: 500;
|
|
173
|
+
color: var(--_editor-text-secondary);
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
border-bottom: 2px solid transparent;
|
|
176
|
+
transition: color 0.15s, border-color 0.15s;
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.tabs__btn:hover {
|
|
181
|
+
color: var(--_editor-text);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.tabs__btn--active {
|
|
185
|
+
color: var(--_editor-accent);
|
|
186
|
+
border-bottom-color: var(--_editor-accent);
|
|
187
|
+
background: var(--_editor-bg-raised);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* ---- Controls panel ---- */
|
|
191
|
+
.controls {
|
|
192
|
+
flex: 1;
|
|
193
|
+
overflow-y: auto;
|
|
194
|
+
padding: 16px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.section-label {
|
|
198
|
+
font-size: 11px;
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
text-transform: uppercase;
|
|
201
|
+
letter-spacing: 0.05em;
|
|
202
|
+
color: var(--_editor-text-muted);
|
|
203
|
+
margin: 16px 0 8px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.section-label:first-child {
|
|
207
|
+
margin-top: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.section-desc {
|
|
211
|
+
font-size: 11px;
|
|
212
|
+
color: var(--_editor-text-muted);
|
|
213
|
+
margin: -4px 0 12px;
|
|
214
|
+
line-height: 1.4;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* ---- Field row ---- */
|
|
218
|
+
.field {
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: 8px;
|
|
222
|
+
margin-bottom: 10px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.field__info {
|
|
226
|
+
flex: 1;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.field__label {
|
|
231
|
+
font-size: 12px;
|
|
232
|
+
color: var(--_editor-text-secondary);
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
text-overflow: ellipsis;
|
|
235
|
+
white-space: nowrap;
|
|
236
|
+
display: block;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.field__desc {
|
|
240
|
+
display: block;
|
|
241
|
+
font-size: 10px;
|
|
242
|
+
color: var(--_editor-text-muted);
|
|
243
|
+
line-height: 1.3;
|
|
244
|
+
margin-top: 1px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.field__control {
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
gap: 6px;
|
|
251
|
+
flex-shrink: 0;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* ---- Color input ---- */
|
|
255
|
+
input[type='color'] {
|
|
256
|
+
-webkit-appearance: none;
|
|
257
|
+
appearance: none;
|
|
258
|
+
width: 32px;
|
|
259
|
+
height: 28px;
|
|
260
|
+
border: 1px solid var(--_editor-border);
|
|
261
|
+
border-radius: 4px;
|
|
262
|
+
padding: 1px;
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
background: var(--_editor-input-bg);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
input[type='color']::-webkit-color-swatch-wrapper {
|
|
268
|
+
padding: 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
input[type='color']::-webkit-color-swatch {
|
|
272
|
+
border: none;
|
|
273
|
+
border-radius: 3px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* ---- Hex text input ---- */
|
|
277
|
+
.hex-input {
|
|
278
|
+
width: 76px;
|
|
279
|
+
padding: 4px 6px;
|
|
280
|
+
border: 1px solid var(--_editor-border);
|
|
281
|
+
border-radius: 4px;
|
|
282
|
+
font-family: SFMono-Regular, Consolas, monospace;
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
color: var(--_editor-text);
|
|
285
|
+
background: var(--_editor-input-bg);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.hex-input:focus {
|
|
289
|
+
outline: 2px solid var(--_editor-accent);
|
|
290
|
+
outline-offset: -1px;
|
|
291
|
+
border-color: var(--_editor-accent);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* ---- Text input ---- */
|
|
295
|
+
.text-input {
|
|
296
|
+
width: 100%;
|
|
297
|
+
padding: 5px 8px;
|
|
298
|
+
border: 1px solid var(--_editor-border);
|
|
299
|
+
border-radius: 4px;
|
|
300
|
+
font: inherit;
|
|
301
|
+
font-size: 12px;
|
|
302
|
+
color: var(--_editor-text);
|
|
303
|
+
background: var(--_editor-input-bg);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.text-input:focus {
|
|
307
|
+
outline: 2px solid var(--_editor-accent);
|
|
308
|
+
outline-offset: -1px;
|
|
309
|
+
border-color: var(--_editor-accent);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* ---- Range slider ---- */
|
|
313
|
+
.range-row {
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
gap: 8px;
|
|
317
|
+
margin-bottom: 10px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.range-row__info {
|
|
321
|
+
flex: 1;
|
|
322
|
+
min-width: 0;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.range-row__label {
|
|
326
|
+
font-size: 12px;
|
|
327
|
+
color: var(--_editor-text-secondary);
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
text-overflow: ellipsis;
|
|
330
|
+
white-space: nowrap;
|
|
331
|
+
display: block;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.range-row__desc {
|
|
335
|
+
display: block;
|
|
336
|
+
font-size: 10px;
|
|
337
|
+
color: var(--_editor-text-muted);
|
|
338
|
+
line-height: 1.3;
|
|
339
|
+
margin-top: 1px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.range-row__slider {
|
|
343
|
+
width: 120px;
|
|
344
|
+
accent-color: var(--_editor-accent);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.range-row__value {
|
|
348
|
+
font-size: 11px;
|
|
349
|
+
font-family: SFMono-Regular, Consolas, monospace;
|
|
350
|
+
color: var(--_editor-text-muted);
|
|
351
|
+
width: 44px;
|
|
352
|
+
text-align: right;
|
|
353
|
+
flex-shrink: 0;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* ---- Font text field (full-width) ---- */
|
|
357
|
+
.font-field {
|
|
358
|
+
margin-bottom: 10px;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.font-field__label {
|
|
362
|
+
display: block;
|
|
363
|
+
font-size: 12px;
|
|
364
|
+
color: var(--_editor-text-secondary);
|
|
365
|
+
margin-bottom: 2px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.font-field__desc {
|
|
369
|
+
display: block;
|
|
370
|
+
font-size: 10px;
|
|
371
|
+
color: var(--_editor-text-muted);
|
|
372
|
+
line-height: 1.3;
|
|
373
|
+
margin-bottom: 4px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* ---- Shadow radio presets ---- */
|
|
377
|
+
.shadow-presets {
|
|
378
|
+
display: grid;
|
|
379
|
+
grid-template-columns: 1fr 1fr;
|
|
380
|
+
gap: 8px;
|
|
381
|
+
margin-top: 8px;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.shadow-preset {
|
|
385
|
+
display: flex;
|
|
386
|
+
align-items: center;
|
|
387
|
+
gap: 8px;
|
|
388
|
+
padding: 10px 12px;
|
|
389
|
+
border: 1px solid var(--_editor-border);
|
|
390
|
+
border-radius: 6px;
|
|
391
|
+
cursor: pointer;
|
|
392
|
+
transition: border-color 0.15s, background 0.15s;
|
|
393
|
+
background: var(--_editor-bg-raised);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.shadow-preset:hover {
|
|
397
|
+
border-color: var(--_editor-text-muted);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.shadow-preset--selected {
|
|
401
|
+
border-color: var(--_editor-accent);
|
|
402
|
+
background: color-mix(in srgb, var(--_editor-accent) 8%, var(--_editor-bg-raised));
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.shadow-preset__radio {
|
|
406
|
+
width: 16px;
|
|
407
|
+
height: 16px;
|
|
408
|
+
border-radius: 50%;
|
|
409
|
+
border: 2px solid var(--_editor-border);
|
|
410
|
+
position: relative;
|
|
411
|
+
flex-shrink: 0;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.shadow-preset--selected .shadow-preset__radio {
|
|
415
|
+
border-color: var(--_editor-accent);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.shadow-preset--selected .shadow-preset__radio::after {
|
|
419
|
+
content: '';
|
|
420
|
+
position: absolute;
|
|
421
|
+
top: 3px;
|
|
422
|
+
left: 3px;
|
|
423
|
+
width: 6px;
|
|
424
|
+
height: 6px;
|
|
425
|
+
border-radius: 50%;
|
|
426
|
+
background: var(--_editor-accent);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.shadow-preset__label {
|
|
430
|
+
font-size: 13px;
|
|
431
|
+
font-weight: 500;
|
|
432
|
+
color: var(--_editor-text);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.shadow-preset__demo {
|
|
436
|
+
width: 28px;
|
|
437
|
+
height: 20px;
|
|
438
|
+
background: var(--_editor-bg-raised);
|
|
439
|
+
border-radius: 3px;
|
|
440
|
+
margin-left: auto;
|
|
441
|
+
flex-shrink: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/* ---- Preview area ---- */
|
|
445
|
+
.preview {
|
|
446
|
+
padding: 24px;
|
|
447
|
+
min-height: 100%;
|
|
448
|
+
background: var(--mz-color-surface-raised, #faf9f7);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.preview-section {
|
|
452
|
+
margin-bottom: 24px;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.preview-section__title {
|
|
456
|
+
font-size: 11px;
|
|
457
|
+
font-weight: 600;
|
|
458
|
+
text-transform: uppercase;
|
|
459
|
+
letter-spacing: 0.06em;
|
|
460
|
+
color: var(--mz-color-text-secondary, #79726b);
|
|
461
|
+
margin: 0 0 12px;
|
|
462
|
+
font-family: var(--mz-font-sans, inherit);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.preview-row {
|
|
466
|
+
display: flex;
|
|
467
|
+
flex-wrap: wrap;
|
|
468
|
+
align-items: center;
|
|
469
|
+
gap: 10px;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.preview-cards {
|
|
473
|
+
display: grid;
|
|
474
|
+
grid-template-columns: repeat(3, 1fr);
|
|
475
|
+
gap: 10px;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.preview-link {
|
|
479
|
+
color: var(--mz-color-link, #4260a8);
|
|
480
|
+
text-decoration: underline;
|
|
481
|
+
font-family: var(--mz-font-sans, inherit);
|
|
482
|
+
font-size: var(--mz-font-size-sm, 0.875rem);
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.preview-link:hover {
|
|
487
|
+
opacity: 0.8;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.preview-card-wrapper {
|
|
491
|
+
margin-top: 16px;
|
|
492
|
+
}
|
|
493
|
+
`;
|
|
494
|
+
class MzThemeEditor extends ManzanoElement {
|
|
495
|
+
constructor() {
|
|
496
|
+
super(...arguments);
|
|
497
|
+
this.themeName = "custom-theme";
|
|
498
|
+
this.fullWidth = false;
|
|
499
|
+
this.activeTab = "colors";
|
|
500
|
+
this.tokens = { ...DEFAULT_TOKENS };
|
|
501
|
+
this.shadowPreset = "medium";
|
|
502
|
+
this._syncDarkMode = () => {
|
|
503
|
+
const htmlTheme = document.documentElement.getAttribute("data-theme");
|
|
504
|
+
const isDark = htmlTheme === "dark" || !htmlTheme && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
505
|
+
if (isDark) {
|
|
506
|
+
this.setAttribute("dark", "");
|
|
507
|
+
} else {
|
|
508
|
+
this.removeAttribute("dark");
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
get value() {
|
|
513
|
+
return JSON.stringify(this.tokens);
|
|
514
|
+
}
|
|
515
|
+
set value(val) {
|
|
516
|
+
if (!val) return;
|
|
517
|
+
try {
|
|
518
|
+
const parsed = JSON.parse(val);
|
|
519
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
520
|
+
this.tokens = { ...DEFAULT_TOKENS, ...parsed };
|
|
521
|
+
}
|
|
522
|
+
} catch {
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
// ---------- Lifecycle ----------
|
|
526
|
+
connectedCallback() {
|
|
527
|
+
super.connectedCallback();
|
|
528
|
+
this.shadowPreset = this.detectShadowPreset();
|
|
529
|
+
this._syncDarkMode();
|
|
530
|
+
this._darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
531
|
+
this._darkQuery.addEventListener("change", this._syncDarkMode);
|
|
532
|
+
this._darkObserver = new MutationObserver(this._syncDarkMode);
|
|
533
|
+
this._darkObserver.observe(document.documentElement, {
|
|
534
|
+
attributes: true,
|
|
535
|
+
attributeFilter: ["data-theme"]
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
disconnectedCallback() {
|
|
539
|
+
super.disconnectedCallback();
|
|
540
|
+
this._darkQuery?.removeEventListener("change", this._syncDarkMode);
|
|
541
|
+
this._darkObserver?.disconnect();
|
|
542
|
+
}
|
|
543
|
+
// ---------- Public methods ----------
|
|
544
|
+
/** Returns the current token map. */
|
|
545
|
+
getTokens() {
|
|
546
|
+
return { ...this.tokens };
|
|
547
|
+
}
|
|
548
|
+
/** Generates a full theme CSS file string. Only includes tokens that differ from defaults. */
|
|
549
|
+
getCSS() {
|
|
550
|
+
const selector = `[data-theme-custom="${this.themeName}"]`;
|
|
551
|
+
const lines = [];
|
|
552
|
+
for (const [key, val] of Object.entries(this.tokens)) {
|
|
553
|
+
if (val !== DEFAULT_TOKENS[key]) {
|
|
554
|
+
lines.push(` ${key}: ${val};`);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (lines.length === 0) {
|
|
558
|
+
return `${selector} {
|
|
559
|
+
/* No overrides \u2014 using Manzano defaults */
|
|
560
|
+
}`;
|
|
561
|
+
}
|
|
562
|
+
return `${selector} {
|
|
563
|
+
${lines.join("\n")}
|
|
564
|
+
}`;
|
|
565
|
+
}
|
|
566
|
+
// ---------- Token mutation ----------
|
|
567
|
+
setToken(name, value) {
|
|
568
|
+
this.tokens = { ...this.tokens, [name]: value };
|
|
569
|
+
this.emitChange();
|
|
570
|
+
}
|
|
571
|
+
emitChange() {
|
|
572
|
+
this.emit("mz-theme-change", {
|
|
573
|
+
detail: { css: this.getCSS(), tokens: this.getTokens() }
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
// ---------- Shadow preset helpers ----------
|
|
577
|
+
detectShadowPreset() {
|
|
578
|
+
const sm = this.tokens["--mz-shadow-sm"];
|
|
579
|
+
for (const [preset, vals] of Object.entries(SHADOW_PRESETS)) {
|
|
580
|
+
if (vals.sm === sm) return preset;
|
|
581
|
+
}
|
|
582
|
+
return "medium";
|
|
583
|
+
}
|
|
584
|
+
applyShadowPreset(preset) {
|
|
585
|
+
const vals = SHADOW_PRESETS[preset];
|
|
586
|
+
this.shadowPreset = preset;
|
|
587
|
+
this.tokens = {
|
|
588
|
+
...this.tokens,
|
|
589
|
+
"--mz-shadow-sm": vals.sm,
|
|
590
|
+
"--mz-shadow-md": vals.md,
|
|
591
|
+
"--mz-shadow-lg": vals.lg
|
|
592
|
+
};
|
|
593
|
+
this.emitChange();
|
|
594
|
+
}
|
|
595
|
+
// ---------- Render helpers: controls ----------
|
|
596
|
+
renderColorField(token, label, showHex, desc = "") {
|
|
597
|
+
const val = this.tokens[token] || "#000000";
|
|
598
|
+
return html`
|
|
599
|
+
<div class="field">
|
|
600
|
+
<div class="field__info">
|
|
601
|
+
<span class="field__label" title="${token}">${label}</span>
|
|
602
|
+
${desc ? html`<span class="field__desc">${desc}</span>` : nothing}
|
|
603
|
+
</div>
|
|
604
|
+
<div class="field__control">
|
|
605
|
+
<input
|
|
606
|
+
type="color"
|
|
607
|
+
.value=${val}
|
|
608
|
+
@input=${(e) => this.setToken(token, e.target.value)}
|
|
609
|
+
/>
|
|
610
|
+
${showHex ? html`<input
|
|
611
|
+
class="hex-input"
|
|
612
|
+
type="text"
|
|
613
|
+
.value=${val}
|
|
614
|
+
@change=${(e) => {
|
|
615
|
+
let v = e.target.value.trim();
|
|
616
|
+
if (v && !v.startsWith("#")) v = "#" + v;
|
|
617
|
+
if (/^#[0-9a-fA-F]{3,8}$/.test(v)) {
|
|
618
|
+
this.setToken(token, v);
|
|
619
|
+
}
|
|
620
|
+
}}
|
|
621
|
+
/>` : nothing}
|
|
622
|
+
</div>
|
|
623
|
+
</div>
|
|
624
|
+
`;
|
|
625
|
+
}
|
|
626
|
+
renderRangeField(token, label, min, max, step, unit = "", desc = "") {
|
|
627
|
+
const raw = parseFloat(this.tokens[token]) || 0;
|
|
628
|
+
return html`
|
|
629
|
+
<div class="range-row">
|
|
630
|
+
<div class="range-row__info">
|
|
631
|
+
<span class="range-row__label" title="${token}">${label}</span>
|
|
632
|
+
${desc ? html`<span class="range-row__desc">${desc}</span>` : nothing}
|
|
633
|
+
</div>
|
|
634
|
+
<input
|
|
635
|
+
class="range-row__slider"
|
|
636
|
+
type="range"
|
|
637
|
+
.min=${String(min)}
|
|
638
|
+
.max=${String(max)}
|
|
639
|
+
.step=${String(step)}
|
|
640
|
+
.value=${String(raw)}
|
|
641
|
+
@input=${(e) => {
|
|
642
|
+
const v = e.target.value;
|
|
643
|
+
this.setToken(token, unit ? `${v}${unit}` : v);
|
|
644
|
+
}}
|
|
645
|
+
/>
|
|
646
|
+
<span class="range-row__value">${raw}${unit}</span>
|
|
647
|
+
</div>
|
|
648
|
+
`;
|
|
649
|
+
}
|
|
650
|
+
// ---------- Tab panels ----------
|
|
651
|
+
renderColorsTab() {
|
|
652
|
+
return html`
|
|
653
|
+
<div class="section-label">Brand & Semantic</div>
|
|
654
|
+
${this.renderColorField("--mz-color-primary", "Primary", true, "Base brand color. Fallback for action, focus, selected, link.")}
|
|
655
|
+
${this.renderColorField("--mz-color-action", "Action", true, "Button fills, CTAs, progress indicators.")}
|
|
656
|
+
${this.renderColorField("--mz-color-on-action", "On Action", false, "Text/icon color on action backgrounds.")}
|
|
657
|
+
${this.renderColorField("--mz-color-focus", "Focus", true, "Focus rings and input focus borders.")}
|
|
658
|
+
${this.renderColorField("--mz-color-selected", "Selected", true, "Checked checkboxes, switches, selected chips and cards.")}
|
|
659
|
+
${this.renderColorField("--mz-color-on-selected", "On Selected", false, "Text/icon color on selected backgrounds.")}
|
|
660
|
+
${this.renderColorField("--mz-color-link", "Link", true, "Text link color.")}
|
|
661
|
+
|
|
662
|
+
<div class="section-label">Surfaces</div>
|
|
663
|
+
${this.renderColorField("--mz-color-surface", "Surface", false, "Page and card backgrounds.")}
|
|
664
|
+
${this.renderColorField("--mz-color-surface-raised", "Surface Raised", false, "Elevated card and panel backgrounds.")}
|
|
665
|
+
${this.renderColorField("--mz-color-text", "Text", false, "Primary body text color.")}
|
|
666
|
+
${this.renderColorField("--mz-color-text-secondary", "Text Secondary", false, "Muted text, descriptions, placeholders.")}
|
|
667
|
+
${this.renderColorField("--mz-color-border", "Border", false, "Dividers, card borders, input outlines.")}
|
|
668
|
+
|
|
669
|
+
<div class="section-label">Status</div>
|
|
670
|
+
${this.renderColorField("--mz-color-success", "Success", false, "Success states, confirmations.")}
|
|
671
|
+
${this.renderColorField("--mz-color-warning", "Warning", false, "Warning states, caution indicators.")}
|
|
672
|
+
${this.renderColorField("--mz-color-danger", "Danger", false, "Error states, destructive actions.")}
|
|
673
|
+
${this.renderColorField("--mz-color-neutral", "Neutral", false, "Neutral badge and button variant.")}
|
|
674
|
+
`;
|
|
675
|
+
}
|
|
676
|
+
renderTypographyTab() {
|
|
677
|
+
return html`
|
|
678
|
+
<div class="font-field">
|
|
679
|
+
<label class="font-field__label" title="--mz-font-sans">Font Family</label>
|
|
680
|
+
<span class="font-field__desc">Font stack for all text. Use quotes for multi-word names.</span>
|
|
681
|
+
<input
|
|
682
|
+
class="text-input"
|
|
683
|
+
type="text"
|
|
684
|
+
.value=${this.tokens["--mz-font-sans"]}
|
|
685
|
+
@change=${(e) => this.setToken("--mz-font-sans", e.target.value)}
|
|
686
|
+
/>
|
|
687
|
+
</div>
|
|
688
|
+
|
|
689
|
+
${this.renderRangeField("--mz-space-scale", "Space Scale", 0.7, 1.4, 0.01, "", "Global spacing multiplier. 0.8 = compact, 1.2 = spacious.")}
|
|
690
|
+
${this.renderRangeField("--mz-font-size-scale", "Font Size Scale", 0.8, 1.2, 0.01, "", "Global font size multiplier.")}
|
|
691
|
+
`;
|
|
692
|
+
}
|
|
693
|
+
renderShapeTab() {
|
|
694
|
+
return html`
|
|
695
|
+
${this.renderRangeField("--mz-radius-sm", "Radius SM", 0, 24, 1, "px", "Small elements: badges, chips, checkboxes.")}
|
|
696
|
+
${this.renderRangeField("--mz-radius-md", "Radius MD", 0, 24, 1, "px", "Medium elements: buttons, inputs, selects.")}
|
|
697
|
+
${this.renderRangeField("--mz-radius-lg", "Radius LG", 0, 32, 1, "px", "Large elements: cards, dialogs, panels.")}
|
|
698
|
+
${this.renderRangeField("--mz-border-width-sm", "Border Width", 0, 4, 0.5, "px", "Default border thickness for panels and dividers.")}
|
|
699
|
+
${this.renderColorField("--mz-input-bg", "Input Background", false, "Background fill for inputs. Use semi-transparent for dark themes.")}
|
|
700
|
+
${this.renderRangeField("--mz-input-border-width", "Input Border Width", 0, 4, 0.5, "px", "Border thickness for form inputs.")}
|
|
701
|
+
`;
|
|
702
|
+
}
|
|
703
|
+
renderShadowsTab() {
|
|
704
|
+
const presets = [
|
|
705
|
+
{ id: "none", label: "None", shadow: "none" },
|
|
706
|
+
{ id: "subtle", label: "Subtle", shadow: SHADOW_PRESETS.subtle.md },
|
|
707
|
+
{ id: "medium", label: "Medium", shadow: SHADOW_PRESETS.medium.md },
|
|
708
|
+
{ id: "dramatic", label: "Dramatic", shadow: SHADOW_PRESETS.dramatic.md }
|
|
709
|
+
];
|
|
710
|
+
return html`
|
|
711
|
+
<div class="section-label">Shadow Intensity</div>
|
|
712
|
+
<p class="section-desc">Controls the depth/elevation of cards, dropdowns, and dialogs.</p>
|
|
713
|
+
<div class="shadow-presets">
|
|
714
|
+
${presets.map(
|
|
715
|
+
(p) => html`
|
|
716
|
+
<div
|
|
717
|
+
class="shadow-preset ${this.shadowPreset === p.id ? "shadow-preset--selected" : ""}"
|
|
718
|
+
@click=${() => this.applyShadowPreset(p.id)}
|
|
719
|
+
>
|
|
720
|
+
<div class="shadow-preset__radio"></div>
|
|
721
|
+
<span class="shadow-preset__label">${p.label}</span>
|
|
722
|
+
<div class="shadow-preset__demo" style="box-shadow: ${p.shadow}"></div>
|
|
723
|
+
</div>
|
|
724
|
+
`
|
|
725
|
+
)}
|
|
726
|
+
</div>
|
|
727
|
+
`;
|
|
728
|
+
}
|
|
729
|
+
// ---------- Build the theme <style> text for the preview area ----------
|
|
730
|
+
get themeStyleText() {
|
|
731
|
+
const lines = [];
|
|
732
|
+
for (const [key, val] of Object.entries(this.tokens)) {
|
|
733
|
+
lines.push(` ${key}: ${val};`);
|
|
734
|
+
}
|
|
735
|
+
return `.preview-themed {
|
|
736
|
+
${lines.join("\n")}
|
|
737
|
+
}`;
|
|
738
|
+
}
|
|
739
|
+
// ---------- Preview panel ----------
|
|
740
|
+
renderPreview() {
|
|
741
|
+
return html`
|
|
742
|
+
<style>${this.themeStyleText}</style>
|
|
743
|
+
<div class="preview preview-themed">
|
|
744
|
+
<!-- Buttons -->
|
|
745
|
+
<div class="preview-section">
|
|
746
|
+
<p class="preview-section__title">Buttons</p>
|
|
747
|
+
<div class="preview-row">
|
|
748
|
+
<mz-button variant="primary">Primary</mz-button>
|
|
749
|
+
<mz-button variant="primary" appearance="outline">Outline</mz-button>
|
|
750
|
+
<mz-button variant="primary" appearance="ghost">Ghost</mz-button>
|
|
751
|
+
</div>
|
|
752
|
+
</div>
|
|
753
|
+
|
|
754
|
+
<!-- Input -->
|
|
755
|
+
<div class="preview-section">
|
|
756
|
+
<p class="preview-section__title">Input</p>
|
|
757
|
+
<mz-input placeholder="Focus me..." style="max-width: 280px;"></mz-input>
|
|
758
|
+
</div>
|
|
759
|
+
|
|
760
|
+
<!-- Checkbox & Switch -->
|
|
761
|
+
<div class="preview-section">
|
|
762
|
+
<p class="preview-section__title">Checkbox & Switch</p>
|
|
763
|
+
<div class="preview-row">
|
|
764
|
+
<mz-checkbox checked>Checked</mz-checkbox>
|
|
765
|
+
<mz-switch checked>Active</mz-switch>
|
|
766
|
+
</div>
|
|
767
|
+
</div>
|
|
768
|
+
|
|
769
|
+
<!-- Chips -->
|
|
770
|
+
<div class="preview-section">
|
|
771
|
+
<p class="preview-section__title">Chips</p>
|
|
772
|
+
<div class="preview-row">
|
|
773
|
+
<mz-chip-group>
|
|
774
|
+
<mz-chip value="a" selected>Option A</mz-chip>
|
|
775
|
+
<mz-chip value="b">Option B</mz-chip>
|
|
776
|
+
<mz-chip value="c">Option C</mz-chip>
|
|
777
|
+
</mz-chip-group>
|
|
778
|
+
</div>
|
|
779
|
+
</div>
|
|
780
|
+
|
|
781
|
+
<!-- Selectable Cards -->
|
|
782
|
+
<div class="preview-section">
|
|
783
|
+
<p class="preview-section__title">Selectable Cards</p>
|
|
784
|
+
<div class="preview-cards">
|
|
785
|
+
<mz-selectable-card selected>Card 1</mz-selectable-card>
|
|
786
|
+
<mz-selectable-card>Card 2</mz-selectable-card>
|
|
787
|
+
<mz-selectable-card>Card 3</mz-selectable-card>
|
|
788
|
+
</div>
|
|
789
|
+
</div>
|
|
790
|
+
|
|
791
|
+
<!-- Badges -->
|
|
792
|
+
<div class="preview-section">
|
|
793
|
+
<p class="preview-section__title">Badges</p>
|
|
794
|
+
<div class="preview-row">
|
|
795
|
+
<mz-badge variant="primary">Primary</mz-badge>
|
|
796
|
+
<mz-badge variant="success">Success</mz-badge>
|
|
797
|
+
<mz-badge variant="warning">Warning</mz-badge>
|
|
798
|
+
<mz-badge variant="danger">Danger</mz-badge>
|
|
799
|
+
</div>
|
|
800
|
+
</div>
|
|
801
|
+
|
|
802
|
+
<!-- Progress -->
|
|
803
|
+
<div class="preview-section">
|
|
804
|
+
<p class="preview-section__title">Progress</p>
|
|
805
|
+
<mz-progress value="65" style="max-width: 300px;"></mz-progress>
|
|
806
|
+
</div>
|
|
807
|
+
|
|
808
|
+
<!-- Link -->
|
|
809
|
+
<div class="preview-section">
|
|
810
|
+
<p class="preview-section__title">Link</p>
|
|
811
|
+
<a class="preview-link" href="javascript:void(0)">This is a themed link</a>
|
|
812
|
+
</div>
|
|
813
|
+
|
|
814
|
+
<!-- Shadows & Card -->
|
|
815
|
+
<div class="preview-section">
|
|
816
|
+
<p class="preview-section__title">Shadows & Card</p>
|
|
817
|
+
<div style="display: flex; gap: 16px; align-items: start;">
|
|
818
|
+
<div style="width: 80px; height: 60px; background: var(--mz-color-surface, #fff); border-radius: var(--mz-radius-md, 8px); box-shadow: var(--mz-shadow-sm); border: 1px solid var(--mz-color-border, #ddd);"></div>
|
|
819
|
+
<div style="width: 80px; height: 60px; background: var(--mz-color-surface, #fff); border-radius: var(--mz-radius-md, 8px); box-shadow: var(--mz-shadow-md); border: 1px solid var(--mz-color-border, #ddd);"></div>
|
|
820
|
+
<div style="width: 80px; height: 60px; background: var(--mz-color-surface, #fff); border-radius: var(--mz-radius-md, 8px); box-shadow: var(--mz-shadow-lg); border: 1px solid var(--mz-color-border, #ddd);"></div>
|
|
821
|
+
</div>
|
|
822
|
+
<div style="display: flex; gap: 16px; margin-top: 4px; font-size: 10px; color: var(--mz-color-text-secondary, #999);">
|
|
823
|
+
<span style="width: 80px; text-align: center;">sm</span>
|
|
824
|
+
<span style="width: 80px; text-align: center;">md</span>
|
|
825
|
+
<span style="width: 80px; text-align: center;">lg</span>
|
|
826
|
+
</div>
|
|
827
|
+
</div>
|
|
828
|
+
|
|
829
|
+
<!-- Card container -->
|
|
830
|
+
<div class="preview-section preview-card-wrapper">
|
|
831
|
+
<p class="preview-section__title">Card</p>
|
|
832
|
+
<mz-card style="max-width: 300px;">
|
|
833
|
+
<div slot="header" style="padding: 12px 16px 0; font-weight: 600; font-family: var(--mz-font-sans, inherit); color: var(--mz-color-text, #333);">
|
|
834
|
+
Example Card
|
|
835
|
+
</div>
|
|
836
|
+
<div style="padding: 0 16px 12px; font-family: var(--mz-font-sans, inherit); color: var(--mz-color-text-secondary, #666); font-size: 14px;">
|
|
837
|
+
This card shows surface color, border radius, border width, and shadow in context.
|
|
838
|
+
</div>
|
|
839
|
+
</mz-card>
|
|
840
|
+
</div>
|
|
841
|
+
</div>
|
|
842
|
+
`;
|
|
843
|
+
}
|
|
844
|
+
// ---------- Main render ----------
|
|
845
|
+
render() {
|
|
846
|
+
let tabContent;
|
|
847
|
+
switch (this.activeTab) {
|
|
848
|
+
case "colors":
|
|
849
|
+
tabContent = this.renderColorsTab();
|
|
850
|
+
break;
|
|
851
|
+
case "typography":
|
|
852
|
+
tabContent = this.renderTypographyTab();
|
|
853
|
+
break;
|
|
854
|
+
case "shape":
|
|
855
|
+
tabContent = this.renderShapeTab();
|
|
856
|
+
break;
|
|
857
|
+
case "shadows":
|
|
858
|
+
tabContent = this.renderShadowsTab();
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
return html`
|
|
862
|
+
<div class="editor">
|
|
863
|
+
<!-- Left: controls -->
|
|
864
|
+
<div class="editor__controls">
|
|
865
|
+
<div class="tabs" role="tablist">
|
|
866
|
+
${TABS.map(
|
|
867
|
+
(tab) => html`
|
|
868
|
+
<button
|
|
869
|
+
class="tabs__btn ${this.activeTab === tab.id ? "tabs__btn--active" : ""}"
|
|
870
|
+
role="tab"
|
|
871
|
+
aria-selected=${this.activeTab === tab.id}
|
|
872
|
+
@click=${() => this.activeTab = tab.id}
|
|
873
|
+
>
|
|
874
|
+
${tab.label}
|
|
875
|
+
</button>
|
|
876
|
+
`
|
|
877
|
+
)}
|
|
878
|
+
</div>
|
|
879
|
+
<div class="controls" role="tabpanel">${tabContent}</div>
|
|
880
|
+
</div>
|
|
881
|
+
|
|
882
|
+
<!-- Right: live preview -->
|
|
883
|
+
<div class="editor__preview">${this.renderPreview()}</div>
|
|
884
|
+
</div>
|
|
885
|
+
`;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
MzThemeEditor.styles = editorStyles;
|
|
889
|
+
__decorateClass([
|
|
890
|
+
property({ attribute: "theme-name" })
|
|
891
|
+
], MzThemeEditor.prototype, "themeName", 2);
|
|
892
|
+
__decorateClass([
|
|
893
|
+
property({ type: Boolean, reflect: true, attribute: "full-width" })
|
|
894
|
+
], MzThemeEditor.prototype, "fullWidth", 2);
|
|
895
|
+
__decorateClass([
|
|
896
|
+
property({ attribute: "value" })
|
|
897
|
+
], MzThemeEditor.prototype, "value", 1);
|
|
898
|
+
__decorateClass([
|
|
899
|
+
state()
|
|
900
|
+
], MzThemeEditor.prototype, "activeTab", 2);
|
|
901
|
+
__decorateClass([
|
|
902
|
+
state()
|
|
903
|
+
], MzThemeEditor.prototype, "tokens", 2);
|
|
904
|
+
__decorateClass([
|
|
905
|
+
state()
|
|
906
|
+
], MzThemeEditor.prototype, "shadowPreset", 2);
|
|
907
|
+
export {
|
|
908
|
+
MzThemeEditor
|
|
909
|
+
};
|
|
910
|
+
//# sourceMappingURL=theme-editor.component.js.map
|