@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.
@@ -0,0 +1,643 @@
1
+ var $=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var s=(p,m,e,t)=>{for(var r=t>1?void 0:t?S(m,e):m,o=p.length-1,n;o>=0;o--)(n=p[o])&&(r=(t?n(m,e,r):n(r))||r);return t&&r&&$(m,e,r),r};import{html as i,css as P,nothing as b}from"lit";import{property as g,state as f}from"lit/decorators.js";import{LitElement as C}from"lit";import{property as z}from"lit/decorators.js";var F="__MANZANO_VERSION__",T=new Map,h,v=!1;function y(){return h||(h=window.matchMedia("(prefers-reduced-motion: reduce)"),v=h.matches,h.addEventListener("change",p=>{v=p.matches})),h}var l=class extends C{constructor(){super();this.dir="";this.lang="";let e=this.constructor;for(let[t,r]of Object.entries(e.dependencies))r.define(t,r);typeof window<"u"&&y()}get prefersReducedMotion(){return typeof window>"u"?!1:(y(),v)}static define(e,t=this){let r=customElements.get(e);if(r){let o=r.version;o!==t.version&&console.warn(`Manzano: "${e}" was already registered with version ${o}. Attempted to re-register with version ${t.version}. This may cause issues.`);return}T.set(e,t),customElements.define(e,t)}emit(e,t){let r=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:{},...t});return this.dispatchEvent(r),!r.defaultPrevented}get updateComplete(){return super.updateComplete.then(async e=>{if(!this.shadowRoot)return e;let t=this.shadowRoot.querySelectorAll(":not(:defined)");if(t.length>0){let r=[...t].map(o=>customElements.whenDefined(o.localName));await Promise.all(r)}return e})}};l.version=F,l.dependencies={},s([z({reflect:!0})],l.prototype,"dir",2),s([z()],l.prototype,"lang",2);var x={"--mz-color-primary":"#4260a8","--mz-color-action":"#4260a8","--mz-color-on-action":"#ffffff","--mz-color-focus":"#4260a8","--mz-color-selected":"#4260a8","--mz-color-on-selected":"#ffffff","--mz-color-link":"#4260a8","--mz-color-surface":"#ffffff","--mz-color-surface-raised":"#faf9f7","--mz-color-text":"#1c1915","--mz-color-text-secondary":"#79726b","--mz-color-border":"#d5d1cb","--mz-color-success":"#2d8556","--mz-color-warning":"#d59724","--mz-color-danger":"#c04b34","--mz-color-neutral":"#433d37","--mz-font-sans":"'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif","--mz-space-scale":"1","--mz-font-size-scale":"1","--mz-radius-sm":"6px","--mz-radius-md":"8px","--mz-radius-lg":"12px","--mz-border-width-sm":"1px","--mz-input-bg":"#ffffff","--mz-input-border-width":"1px","--mz-shadow-sm":"0 1px 3px 0 rgb(28 25 21 / 0.09), 0 1px 2px -1px rgb(28 25 21 / 0.07)","--mz-shadow-md":"0 4px 8px -2px rgb(28 25 21 / 0.1), 0 2px 4px -2px rgb(28 25 21 / 0.06)","--mz-shadow-lg":"0 12px 20px -4px rgb(28 25 21 / 0.12), 0 4px 8px -4px rgb(28 25 21 / 0.05)"},u={none:{sm:"none",md:"none",lg:"none"},subtle:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.04)",md:"0 2px 4px -1px rgb(0 0 0 / 0.06)",lg:"0 6px 12px -3px rgb(0 0 0 / 0.08)"},medium:{sm:"0 1px 3px 0 rgb(28 25 21 / 0.09), 0 1px 2px -1px rgb(28 25 21 / 0.07)",md:"0 4px 8px -2px rgb(28 25 21 / 0.1), 0 2px 4px -2px rgb(28 25 21 / 0.06)",lg:"0 12px 20px -4px rgb(28 25 21 / 0.12), 0 4px 8px -4px rgb(28 25 21 / 0.05)"},dramatic:{sm:"0 2px 6px 0 rgb(0 0 0 / 0.16), 0 1px 3px -1px rgb(0 0 0 / 0.12)",md:"0 8px 16px -4px rgb(0 0 0 / 0.2), 0 4px 8px -4px rgb(0 0 0 / 0.14)",lg:"0 20px 40px -8px rgb(0 0 0 / 0.25), 0 8px 16px -6px rgb(0 0 0 / 0.15)"}},R=[{id:"colors",label:"Colors"},{id:"typography",label:"Typography & Spacing"},{id:"shape",label:"Shape"},{id:"shadows",label:"Shadows"}],M=P`
2
+ :host {
3
+ display: block;
4
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
5
+ font-size: 14px;
6
+ line-height: 1.5;
7
+
8
+ /* Editor chrome — light mode defaults */
9
+ --_editor-bg: #f6f6f7;
10
+ --_editor-bg-raised: #ffffff;
11
+ --_editor-text: #1a1a1a;
12
+ --_editor-text-secondary: #666;
13
+ --_editor-text-muted: #999;
14
+ --_editor-border: #e0e0e0;
15
+ --_editor-accent: #4260a8;
16
+ --_editor-input-bg: #ffffff;
17
+ --_editor-tab-bg: #eeeeef;
18
+
19
+ color: var(--_editor-text);
20
+ }
21
+
22
+ /* Dark mode — activated via JS-set [dark] attribute on :host */
23
+ :host([dark]) {
24
+ --_editor-bg: #1a1a1d;
25
+ --_editor-bg-raised: #252528;
26
+ --_editor-text: #e4e4e7;
27
+ --_editor-text-secondary: #a1a1a8;
28
+ --_editor-text-muted: #71717a;
29
+ --_editor-border: #333336;
30
+ --_editor-accent: #818cf8;
31
+ --_editor-input-bg: #252528;
32
+ --_editor-tab-bg: #141416;
33
+ }
34
+
35
+ *,
36
+ *::before,
37
+ *::after {
38
+ box-sizing: border-box;
39
+ }
40
+
41
+ /* ---- Full-width mode ---- */
42
+ :host([full-width]) .editor {
43
+ border: none;
44
+ border-radius: 0;
45
+ }
46
+
47
+ :host([full-width]) .editor__controls {
48
+ max-width: none;
49
+ }
50
+
51
+ /* ---- Layout ---- */
52
+ .editor {
53
+ display: flex;
54
+ height: 100%;
55
+ min-height: 540px;
56
+ border: 1px solid var(--_editor-border);
57
+ border-radius: 6px;
58
+ overflow: hidden;
59
+ background: var(--_editor-bg);
60
+ }
61
+
62
+ .editor__controls {
63
+ width: 40%;
64
+ min-width: 300px;
65
+ max-width: 480px;
66
+ display: flex;
67
+ flex-direction: column;
68
+ border-right: 1px solid var(--_editor-border);
69
+ overflow: hidden;
70
+ }
71
+
72
+ .editor__preview {
73
+ flex: 1;
74
+ overflow: auto;
75
+ background: var(--_editor-bg-raised);
76
+ }
77
+
78
+ /* ---- Tabs ---- */
79
+ .tabs {
80
+ display: flex;
81
+ background: var(--_editor-tab-bg);
82
+ border-bottom: 1px solid var(--_editor-border);
83
+ padding: 0;
84
+ margin: 0;
85
+ flex-shrink: 0;
86
+ }
87
+
88
+ .tabs__btn {
89
+ flex: 1;
90
+ padding: 8px 6px;
91
+ border: none;
92
+ background: transparent;
93
+ font: inherit;
94
+ font-size: 12px;
95
+ font-weight: 500;
96
+ color: var(--_editor-text-secondary);
97
+ cursor: pointer;
98
+ border-bottom: 2px solid transparent;
99
+ transition: color 0.15s, border-color 0.15s;
100
+ white-space: nowrap;
101
+ }
102
+
103
+ .tabs__btn:hover {
104
+ color: var(--_editor-text);
105
+ }
106
+
107
+ .tabs__btn--active {
108
+ color: var(--_editor-accent);
109
+ border-bottom-color: var(--_editor-accent);
110
+ background: var(--_editor-bg-raised);
111
+ }
112
+
113
+ /* ---- Controls panel ---- */
114
+ .controls {
115
+ flex: 1;
116
+ overflow-y: auto;
117
+ padding: 16px;
118
+ }
119
+
120
+ .section-label {
121
+ font-size: 11px;
122
+ font-weight: 600;
123
+ text-transform: uppercase;
124
+ letter-spacing: 0.05em;
125
+ color: var(--_editor-text-muted);
126
+ margin: 16px 0 8px;
127
+ }
128
+
129
+ .section-label:first-child {
130
+ margin-top: 0;
131
+ }
132
+
133
+ .section-desc {
134
+ font-size: 11px;
135
+ color: var(--_editor-text-muted);
136
+ margin: -4px 0 12px;
137
+ line-height: 1.4;
138
+ }
139
+
140
+ /* ---- Field row ---- */
141
+ .field {
142
+ display: flex;
143
+ align-items: center;
144
+ gap: 8px;
145
+ margin-bottom: 10px;
146
+ }
147
+
148
+ .field__info {
149
+ flex: 1;
150
+ min-width: 0;
151
+ }
152
+
153
+ .field__label {
154
+ font-size: 12px;
155
+ color: var(--_editor-text-secondary);
156
+ overflow: hidden;
157
+ text-overflow: ellipsis;
158
+ white-space: nowrap;
159
+ display: block;
160
+ }
161
+
162
+ .field__desc {
163
+ display: block;
164
+ font-size: 10px;
165
+ color: var(--_editor-text-muted);
166
+ line-height: 1.3;
167
+ margin-top: 1px;
168
+ }
169
+
170
+ .field__control {
171
+ display: flex;
172
+ align-items: center;
173
+ gap: 6px;
174
+ flex-shrink: 0;
175
+ }
176
+
177
+ /* ---- Color input ---- */
178
+ input[type='color'] {
179
+ -webkit-appearance: none;
180
+ appearance: none;
181
+ width: 32px;
182
+ height: 28px;
183
+ border: 1px solid var(--_editor-border);
184
+ border-radius: 4px;
185
+ padding: 1px;
186
+ cursor: pointer;
187
+ background: var(--_editor-input-bg);
188
+ }
189
+
190
+ input[type='color']::-webkit-color-swatch-wrapper {
191
+ padding: 0;
192
+ }
193
+
194
+ input[type='color']::-webkit-color-swatch {
195
+ border: none;
196
+ border-radius: 3px;
197
+ }
198
+
199
+ /* ---- Hex text input ---- */
200
+ .hex-input {
201
+ width: 76px;
202
+ padding: 4px 6px;
203
+ border: 1px solid var(--_editor-border);
204
+ border-radius: 4px;
205
+ font-family: SFMono-Regular, Consolas, monospace;
206
+ font-size: 12px;
207
+ color: var(--_editor-text);
208
+ background: var(--_editor-input-bg);
209
+ }
210
+
211
+ .hex-input:focus {
212
+ outline: 2px solid var(--_editor-accent);
213
+ outline-offset: -1px;
214
+ border-color: var(--_editor-accent);
215
+ }
216
+
217
+ /* ---- Text input ---- */
218
+ .text-input {
219
+ width: 100%;
220
+ padding: 5px 8px;
221
+ border: 1px solid var(--_editor-border);
222
+ border-radius: 4px;
223
+ font: inherit;
224
+ font-size: 12px;
225
+ color: var(--_editor-text);
226
+ background: var(--_editor-input-bg);
227
+ }
228
+
229
+ .text-input:focus {
230
+ outline: 2px solid var(--_editor-accent);
231
+ outline-offset: -1px;
232
+ border-color: var(--_editor-accent);
233
+ }
234
+
235
+ /* ---- Range slider ---- */
236
+ .range-row {
237
+ display: flex;
238
+ align-items: center;
239
+ gap: 8px;
240
+ margin-bottom: 10px;
241
+ }
242
+
243
+ .range-row__info {
244
+ flex: 1;
245
+ min-width: 0;
246
+ }
247
+
248
+ .range-row__label {
249
+ font-size: 12px;
250
+ color: var(--_editor-text-secondary);
251
+ overflow: hidden;
252
+ text-overflow: ellipsis;
253
+ white-space: nowrap;
254
+ display: block;
255
+ }
256
+
257
+ .range-row__desc {
258
+ display: block;
259
+ font-size: 10px;
260
+ color: var(--_editor-text-muted);
261
+ line-height: 1.3;
262
+ margin-top: 1px;
263
+ }
264
+
265
+ .range-row__slider {
266
+ width: 120px;
267
+ accent-color: var(--_editor-accent);
268
+ }
269
+
270
+ .range-row__value {
271
+ font-size: 11px;
272
+ font-family: SFMono-Regular, Consolas, monospace;
273
+ color: var(--_editor-text-muted);
274
+ width: 44px;
275
+ text-align: right;
276
+ flex-shrink: 0;
277
+ }
278
+
279
+ /* ---- Font text field (full-width) ---- */
280
+ .font-field {
281
+ margin-bottom: 10px;
282
+ }
283
+
284
+ .font-field__label {
285
+ display: block;
286
+ font-size: 12px;
287
+ color: var(--_editor-text-secondary);
288
+ margin-bottom: 2px;
289
+ }
290
+
291
+ .font-field__desc {
292
+ display: block;
293
+ font-size: 10px;
294
+ color: var(--_editor-text-muted);
295
+ line-height: 1.3;
296
+ margin-bottom: 4px;
297
+ }
298
+
299
+ /* ---- Shadow radio presets ---- */
300
+ .shadow-presets {
301
+ display: grid;
302
+ grid-template-columns: 1fr 1fr;
303
+ gap: 8px;
304
+ margin-top: 8px;
305
+ }
306
+
307
+ .shadow-preset {
308
+ display: flex;
309
+ align-items: center;
310
+ gap: 8px;
311
+ padding: 10px 12px;
312
+ border: 1px solid var(--_editor-border);
313
+ border-radius: 6px;
314
+ cursor: pointer;
315
+ transition: border-color 0.15s, background 0.15s;
316
+ background: var(--_editor-bg-raised);
317
+ }
318
+
319
+ .shadow-preset:hover {
320
+ border-color: var(--_editor-text-muted);
321
+ }
322
+
323
+ .shadow-preset--selected {
324
+ border-color: var(--_editor-accent);
325
+ background: color-mix(in srgb, var(--_editor-accent) 8%, var(--_editor-bg-raised));
326
+ }
327
+
328
+ .shadow-preset__radio {
329
+ width: 16px;
330
+ height: 16px;
331
+ border-radius: 50%;
332
+ border: 2px solid var(--_editor-border);
333
+ position: relative;
334
+ flex-shrink: 0;
335
+ }
336
+
337
+ .shadow-preset--selected .shadow-preset__radio {
338
+ border-color: var(--_editor-accent);
339
+ }
340
+
341
+ .shadow-preset--selected .shadow-preset__radio::after {
342
+ content: '';
343
+ position: absolute;
344
+ top: 3px;
345
+ left: 3px;
346
+ width: 6px;
347
+ height: 6px;
348
+ border-radius: 50%;
349
+ background: var(--_editor-accent);
350
+ }
351
+
352
+ .shadow-preset__label {
353
+ font-size: 13px;
354
+ font-weight: 500;
355
+ color: var(--_editor-text);
356
+ }
357
+
358
+ .shadow-preset__demo {
359
+ width: 28px;
360
+ height: 20px;
361
+ background: var(--_editor-bg-raised);
362
+ border-radius: 3px;
363
+ margin-left: auto;
364
+ flex-shrink: 0;
365
+ }
366
+
367
+ /* ---- Preview area ---- */
368
+ .preview {
369
+ padding: 24px;
370
+ min-height: 100%;
371
+ background: var(--mz-color-surface-raised, #faf9f7);
372
+ }
373
+
374
+ .preview-section {
375
+ margin-bottom: 24px;
376
+ }
377
+
378
+ .preview-section__title {
379
+ font-size: 11px;
380
+ font-weight: 600;
381
+ text-transform: uppercase;
382
+ letter-spacing: 0.06em;
383
+ color: var(--mz-color-text-secondary, #79726b);
384
+ margin: 0 0 12px;
385
+ font-family: var(--mz-font-sans, inherit);
386
+ }
387
+
388
+ .preview-row {
389
+ display: flex;
390
+ flex-wrap: wrap;
391
+ align-items: center;
392
+ gap: 10px;
393
+ }
394
+
395
+ .preview-cards {
396
+ display: grid;
397
+ grid-template-columns: repeat(3, 1fr);
398
+ gap: 10px;
399
+ }
400
+
401
+ .preview-link {
402
+ color: var(--mz-color-link, #4260a8);
403
+ text-decoration: underline;
404
+ font-family: var(--mz-font-sans, inherit);
405
+ font-size: var(--mz-font-size-sm, 0.875rem);
406
+ cursor: pointer;
407
+ }
408
+
409
+ .preview-link:hover {
410
+ opacity: 0.8;
411
+ }
412
+
413
+ .preview-card-wrapper {
414
+ margin-top: 16px;
415
+ }
416
+ `,d=class extends l{constructor(){super(...arguments);this.themeName="custom-theme";this.fullWidth=!1;this.activeTab="colors";this.tokens={...x};this.shadowPreset="medium";this._syncDarkMode=()=>{let e=document.documentElement.getAttribute("data-theme");e==="dark"||!e&&window.matchMedia("(prefers-color-scheme: dark)").matches?this.setAttribute("dark",""):this.removeAttribute("dark")}}get value(){return JSON.stringify(this.tokens)}set value(e){if(e)try{let t=JSON.parse(e);typeof t=="object"&&t!==null&&(this.tokens={...x,...t})}catch{}}connectedCallback(){super.connectedCallback(),this.shadowPreset=this.detectShadowPreset(),this._syncDarkMode(),this._darkQuery=window.matchMedia("(prefers-color-scheme: dark)"),this._darkQuery.addEventListener("change",this._syncDarkMode),this._darkObserver=new MutationObserver(this._syncDarkMode),this._darkObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}disconnectedCallback(){super.disconnectedCallback(),this._darkQuery?.removeEventListener("change",this._syncDarkMode),this._darkObserver?.disconnect()}getTokens(){return{...this.tokens}}getCSS(){let e=`[data-theme-custom="${this.themeName}"]`,t=[];for(let[r,o]of Object.entries(this.tokens))o!==x[r]&&t.push(` ${r}: ${o};`);return t.length===0?`${e} {
417
+ /* No overrides \u2014 using Manzano defaults */
418
+ }`:`${e} {
419
+ ${t.join(`
420
+ `)}
421
+ }`}setToken(e,t){this.tokens={...this.tokens,[e]:t},this.emitChange()}emitChange(){this.emit("mz-theme-change",{detail:{css:this.getCSS(),tokens:this.getTokens()}})}detectShadowPreset(){let e=this.tokens["--mz-shadow-sm"];for(let[t,r]of Object.entries(u))if(r.sm===e)return t;return"medium"}applyShadowPreset(e){let t=u[e];this.shadowPreset=e,this.tokens={...this.tokens,"--mz-shadow-sm":t.sm,"--mz-shadow-md":t.md,"--mz-shadow-lg":t.lg},this.emitChange()}renderColorField(e,t,r,o=""){let n=this.tokens[e]||"#000000";return i`
422
+ <div class="field">
423
+ <div class="field__info">
424
+ <span class="field__label" title="${e}">${t}</span>
425
+ ${o?i`<span class="field__desc">${o}</span>`:b}
426
+ </div>
427
+ <div class="field__control">
428
+ <input
429
+ type="color"
430
+ .value=${n}
431
+ @input=${c=>this.setToken(e,c.target.value)}
432
+ />
433
+ ${r?i`<input
434
+ class="hex-input"
435
+ type="text"
436
+ .value=${n}
437
+ @change=${c=>{let a=c.target.value.trim();a&&!a.startsWith("#")&&(a="#"+a),/^#[0-9a-fA-F]{3,8}$/.test(a)&&this.setToken(e,a)}}
438
+ />`:b}
439
+ </div>
440
+ </div>
441
+ `}renderRangeField(e,t,r,o,n,c="",a=""){let w=parseFloat(this.tokens[e])||0;return i`
442
+ <div class="range-row">
443
+ <div class="range-row__info">
444
+ <span class="range-row__label" title="${e}">${t}</span>
445
+ ${a?i`<span class="range-row__desc">${a}</span>`:b}
446
+ </div>
447
+ <input
448
+ class="range-row__slider"
449
+ type="range"
450
+ .min=${String(r)}
451
+ .max=${String(o)}
452
+ .step=${String(n)}
453
+ .value=${String(w)}
454
+ @input=${k=>{let _=k.target.value;this.setToken(e,c?`${_}${c}`:_)}}
455
+ />
456
+ <span class="range-row__value">${w}${c}</span>
457
+ </div>
458
+ `}renderColorsTab(){return i`
459
+ <div class="section-label">Brand &amp; Semantic</div>
460
+ ${this.renderColorField("--mz-color-primary","Primary",!0,"Base brand color. Fallback for action, focus, selected, link.")}
461
+ ${this.renderColorField("--mz-color-action","Action",!0,"Button fills, CTAs, progress indicators.")}
462
+ ${this.renderColorField("--mz-color-on-action","On Action",!1,"Text/icon color on action backgrounds.")}
463
+ ${this.renderColorField("--mz-color-focus","Focus",!0,"Focus rings and input focus borders.")}
464
+ ${this.renderColorField("--mz-color-selected","Selected",!0,"Checked checkboxes, switches, selected chips and cards.")}
465
+ ${this.renderColorField("--mz-color-on-selected","On Selected",!1,"Text/icon color on selected backgrounds.")}
466
+ ${this.renderColorField("--mz-color-link","Link",!0,"Text link color.")}
467
+
468
+ <div class="section-label">Surfaces</div>
469
+ ${this.renderColorField("--mz-color-surface","Surface",!1,"Page and card backgrounds.")}
470
+ ${this.renderColorField("--mz-color-surface-raised","Surface Raised",!1,"Elevated card and panel backgrounds.")}
471
+ ${this.renderColorField("--mz-color-text","Text",!1,"Primary body text color.")}
472
+ ${this.renderColorField("--mz-color-text-secondary","Text Secondary",!1,"Muted text, descriptions, placeholders.")}
473
+ ${this.renderColorField("--mz-color-border","Border",!1,"Dividers, card borders, input outlines.")}
474
+
475
+ <div class="section-label">Status</div>
476
+ ${this.renderColorField("--mz-color-success","Success",!1,"Success states, confirmations.")}
477
+ ${this.renderColorField("--mz-color-warning","Warning",!1,"Warning states, caution indicators.")}
478
+ ${this.renderColorField("--mz-color-danger","Danger",!1,"Error states, destructive actions.")}
479
+ ${this.renderColorField("--mz-color-neutral","Neutral",!1,"Neutral badge and button variant.")}
480
+ `}renderTypographyTab(){return i`
481
+ <div class="font-field">
482
+ <label class="font-field__label" title="--mz-font-sans">Font Family</label>
483
+ <span class="font-field__desc">Font stack for all text. Use quotes for multi-word names.</span>
484
+ <input
485
+ class="text-input"
486
+ type="text"
487
+ .value=${this.tokens["--mz-font-sans"]}
488
+ @change=${e=>this.setToken("--mz-font-sans",e.target.value)}
489
+ />
490
+ </div>
491
+
492
+ ${this.renderRangeField("--mz-space-scale","Space Scale",.7,1.4,.01,"","Global spacing multiplier. 0.8 = compact, 1.2 = spacious.")}
493
+ ${this.renderRangeField("--mz-font-size-scale","Font Size Scale",.8,1.2,.01,"","Global font size multiplier.")}
494
+ `}renderShapeTab(){return i`
495
+ ${this.renderRangeField("--mz-radius-sm","Radius SM",0,24,1,"px","Small elements: badges, chips, checkboxes.")}
496
+ ${this.renderRangeField("--mz-radius-md","Radius MD",0,24,1,"px","Medium elements: buttons, inputs, selects.")}
497
+ ${this.renderRangeField("--mz-radius-lg","Radius LG",0,32,1,"px","Large elements: cards, dialogs, panels.")}
498
+ ${this.renderRangeField("--mz-border-width-sm","Border Width",0,4,.5,"px","Default border thickness for panels and dividers.")}
499
+ ${this.renderColorField("--mz-input-bg","Input Background",!1,"Background fill for inputs. Use semi-transparent for dark themes.")}
500
+ ${this.renderRangeField("--mz-input-border-width","Input Border Width",0,4,.5,"px","Border thickness for form inputs.")}
501
+ `}renderShadowsTab(){let e=[{id:"none",label:"None",shadow:"none"},{id:"subtle",label:"Subtle",shadow:u.subtle.md},{id:"medium",label:"Medium",shadow:u.medium.md},{id:"dramatic",label:"Dramatic",shadow:u.dramatic.md}];return i`
502
+ <div class="section-label">Shadow Intensity</div>
503
+ <p class="section-desc">Controls the depth/elevation of cards, dropdowns, and dialogs.</p>
504
+ <div class="shadow-presets">
505
+ ${e.map(t=>i`
506
+ <div
507
+ class="shadow-preset ${this.shadowPreset===t.id?"shadow-preset--selected":""}"
508
+ @click=${()=>this.applyShadowPreset(t.id)}
509
+ >
510
+ <div class="shadow-preset__radio"></div>
511
+ <span class="shadow-preset__label">${t.label}</span>
512
+ <div class="shadow-preset__demo" style="box-shadow: ${t.shadow}"></div>
513
+ </div>
514
+ `)}
515
+ </div>
516
+ `}get themeStyleText(){let e=[];for(let[t,r]of Object.entries(this.tokens))e.push(` ${t}: ${r};`);return`.preview-themed {
517
+ ${e.join(`
518
+ `)}
519
+ }`}renderPreview(){return i`
520
+ <style>${this.themeStyleText}</style>
521
+ <div class="preview preview-themed">
522
+ <!-- Buttons -->
523
+ <div class="preview-section">
524
+ <p class="preview-section__title">Buttons</p>
525
+ <div class="preview-row">
526
+ <mz-button variant="primary">Primary</mz-button>
527
+ <mz-button variant="primary" appearance="outline">Outline</mz-button>
528
+ <mz-button variant="primary" appearance="ghost">Ghost</mz-button>
529
+ </div>
530
+ </div>
531
+
532
+ <!-- Input -->
533
+ <div class="preview-section">
534
+ <p class="preview-section__title">Input</p>
535
+ <mz-input placeholder="Focus me..." style="max-width: 280px;"></mz-input>
536
+ </div>
537
+
538
+ <!-- Checkbox & Switch -->
539
+ <div class="preview-section">
540
+ <p class="preview-section__title">Checkbox &amp; Switch</p>
541
+ <div class="preview-row">
542
+ <mz-checkbox checked>Checked</mz-checkbox>
543
+ <mz-switch checked>Active</mz-switch>
544
+ </div>
545
+ </div>
546
+
547
+ <!-- Chips -->
548
+ <div class="preview-section">
549
+ <p class="preview-section__title">Chips</p>
550
+ <div class="preview-row">
551
+ <mz-chip-group>
552
+ <mz-chip value="a" selected>Option A</mz-chip>
553
+ <mz-chip value="b">Option B</mz-chip>
554
+ <mz-chip value="c">Option C</mz-chip>
555
+ </mz-chip-group>
556
+ </div>
557
+ </div>
558
+
559
+ <!-- Selectable Cards -->
560
+ <div class="preview-section">
561
+ <p class="preview-section__title">Selectable Cards</p>
562
+ <div class="preview-cards">
563
+ <mz-selectable-card selected>Card 1</mz-selectable-card>
564
+ <mz-selectable-card>Card 2</mz-selectable-card>
565
+ <mz-selectable-card>Card 3</mz-selectable-card>
566
+ </div>
567
+ </div>
568
+
569
+ <!-- Badges -->
570
+ <div class="preview-section">
571
+ <p class="preview-section__title">Badges</p>
572
+ <div class="preview-row">
573
+ <mz-badge variant="primary">Primary</mz-badge>
574
+ <mz-badge variant="success">Success</mz-badge>
575
+ <mz-badge variant="warning">Warning</mz-badge>
576
+ <mz-badge variant="danger">Danger</mz-badge>
577
+ </div>
578
+ </div>
579
+
580
+ <!-- Progress -->
581
+ <div class="preview-section">
582
+ <p class="preview-section__title">Progress</p>
583
+ <mz-progress value="65" style="max-width: 300px;"></mz-progress>
584
+ </div>
585
+
586
+ <!-- Link -->
587
+ <div class="preview-section">
588
+ <p class="preview-section__title">Link</p>
589
+ <a class="preview-link" href="javascript:void(0)">This is a themed link</a>
590
+ </div>
591
+
592
+ <!-- Shadows & Card -->
593
+ <div class="preview-section">
594
+ <p class="preview-section__title">Shadows &amp; Card</p>
595
+ <div style="display: flex; gap: 16px; align-items: start;">
596
+ <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>
597
+ <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>
598
+ <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>
599
+ </div>
600
+ <div style="display: flex; gap: 16px; margin-top: 4px; font-size: 10px; color: var(--mz-color-text-secondary, #999);">
601
+ <span style="width: 80px; text-align: center;">sm</span>
602
+ <span style="width: 80px; text-align: center;">md</span>
603
+ <span style="width: 80px; text-align: center;">lg</span>
604
+ </div>
605
+ </div>
606
+
607
+ <!-- Card container -->
608
+ <div class="preview-section preview-card-wrapper">
609
+ <p class="preview-section__title">Card</p>
610
+ <mz-card style="max-width: 300px;">
611
+ <div slot="header" style="padding: 12px 16px 0; font-weight: 600; font-family: var(--mz-font-sans, inherit); color: var(--mz-color-text, #333);">
612
+ Example Card
613
+ </div>
614
+ <div style="padding: 0 16px 12px; font-family: var(--mz-font-sans, inherit); color: var(--mz-color-text-secondary, #666); font-size: 14px;">
615
+ This card shows surface color, border radius, border width, and shadow in context.
616
+ </div>
617
+ </mz-card>
618
+ </div>
619
+ </div>
620
+ `}render(){let e;switch(this.activeTab){case"colors":e=this.renderColorsTab();break;case"typography":e=this.renderTypographyTab();break;case"shape":e=this.renderShapeTab();break;case"shadows":e=this.renderShadowsTab();break}return i`
621
+ <div class="editor">
622
+ <!-- Left: controls -->
623
+ <div class="editor__controls">
624
+ <div class="tabs" role="tablist">
625
+ ${R.map(t=>i`
626
+ <button
627
+ class="tabs__btn ${this.activeTab===t.id?"tabs__btn--active":""}"
628
+ role="tab"
629
+ aria-selected=${this.activeTab===t.id}
630
+ @click=${()=>this.activeTab=t.id}
631
+ >
632
+ ${t.label}
633
+ </button>
634
+ `)}
635
+ </div>
636
+ <div class="controls" role="tabpanel">${e}</div>
637
+ </div>
638
+
639
+ <!-- Right: live preview -->
640
+ <div class="editor__preview">${this.renderPreview()}</div>
641
+ </div>
642
+ `}};d.styles=M,s([g({attribute:"theme-name"})],d.prototype,"themeName",2),s([g({type:Boolean,reflect:!0,attribute:"full-width"})],d.prototype,"fullWidth",2),s([g({attribute:"value"})],d.prototype,"value",1),s([f()],d.prototype,"activeTab",2),s([f()],d.prototype,"tokens",2),s([f()],d.prototype,"shadowPreset",2);export{d as a};
643
+ //# sourceMappingURL=chunk.5X2KFTEK.js.map