@capsuletech/web-style 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.
Files changed (49) hide show
  1. package/README.md +7 -0
  2. package/dist/assets/web-style.css +1 -0
  3. package/dist/constants.d.ts +2 -0
  4. package/dist/createStyle.d.ts +4 -0
  5. package/dist/editor/ThemeEditor.d.ts +17 -0
  6. package/dist/editor/apply.d.ts +12 -0
  7. package/dist/editor/export.d.ts +9 -0
  8. package/dist/editor/index.d.ts +7 -0
  9. package/dist/editor/oklch.d.ts +14 -0
  10. package/dist/editor/panel/ExportButton.d.ts +6 -0
  11. package/dist/editor/panel/FontControl.d.ts +12 -0
  12. package/dist/editor/panel/ModeToggle.d.ts +11 -0
  13. package/dist/editor/panel/OklchSliders.d.ts +10 -0
  14. package/dist/editor/panel/Panel.d.ts +11 -0
  15. package/dist/editor/panel/PresetPicker.d.ts +11 -0
  16. package/dist/editor/panel/RadiusControl.d.ts +6 -0
  17. package/dist/editor/panel/Section.d.ts +15 -0
  18. package/dist/editor/panel/Slider.d.ts +18 -0
  19. package/dist/editor/panel/SpacingControl.d.ts +6 -0
  20. package/dist/editor/presets.d.ts +10 -0
  21. package/dist/editor/preview/Preview.d.ts +9 -0
  22. package/dist/editor/preview/SampleAuth.d.ts +6 -0
  23. package/dist/editor/preview/SampleButtons.d.ts +5 -0
  24. package/dist/editor/preview/SampleMetrics.d.ts +1 -0
  25. package/dist/editor/preview/SamplePricing.d.ts +1 -0
  26. package/dist/editor/types.d.ts +31 -0
  27. package/dist/editor.mjs +549 -0
  28. package/dist/editor.mjs.map +1 -0
  29. package/dist/index.css +168 -0
  30. package/dist/index.d.ts +4 -0
  31. package/dist/index.mjs +114 -0
  32. package/dist/index.mjs.map +1 -0
  33. package/dist/package.json +32 -0
  34. package/dist/switcher/ThemeSwitcher.d.ts +19 -0
  35. package/dist/switcher/index.d.ts +1 -0
  36. package/dist/themes/black.css +176 -0
  37. package/dist/themes/damon.css +174 -0
  38. package/dist/themes/deepPurple.css +182 -0
  39. package/dist/themes/index.css +13 -0
  40. package/dist/themes/lightGreen.css +182 -0
  41. package/dist/themes/minimalNeutral.css +174 -0
  42. package/dist/themes/openprofile.css +178 -0
  43. package/dist/themes/pasteelement.css +174 -0
  44. package/dist/themes/shopifyRed.css +182 -0
  45. package/dist/themes/tiesen.css +184 -0
  46. package/dist/themes/vescrow.css +182 -0
  47. package/dist/themes/zen.css +182 -0
  48. package/dist/utils.d.ts +4 -0
  49. package/package.json +41 -0
@@ -0,0 +1,549 @@
1
+ import { delegateEvents as $, insert as r, createComponent as a, template as c, effect as x, setAttribute as y, classList as p, setStyleProperty as C, memo as L, use as E } from "solid-js/web";
2
+ import { createSignal as k, Show as S, For as v, createMemo as O, createEffect as R } from "solid-js";
3
+ import { Check as w, Copy as M, Sun as A, Moon as N, SunMoon as I, Palette as G, Spline as H, Ruler as U, Type as D, Mail as j, Lock as K, ArrowRight as J, Sparkles as z, Plus as V, Heart as Z, Trash2 as q, Users as Q, TrendingUp as W, TrendingDown as X } from "lucide-solid";
4
+ const Y = /^oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)$/i, P = (e) => {
5
+ const t = e.trim().match(Y);
6
+ return t ? {
7
+ l: Number.parseFloat(t[1]),
8
+ c: Number.parseFloat(t[2]),
9
+ h: Number.parseFloat(t[3])
10
+ } : { l: 0.5, c: 0, h: 0 };
11
+ }, ee = (e) => `oklch(${e.l.toFixed(3)} ${e.c.toFixed(3)} ${e.h.toFixed(1)})`, T = (e) => {
12
+ const { l: t } = P(e);
13
+ return t < 0.5 ? "oklch(0.985 0 0)" : "oklch(0.145 0 0)";
14
+ }, te = (e, t) => {
15
+ e.style.setProperty("--primary", t.primary), e.style.setProperty("--primary-foreground", T(t.primary)), e.style.setProperty("--ring", t.primary), e.style.setProperty("--radius", `${t.radius}rem`), e.style.setProperty("--spacing-base", `${t.spacingBase}rem`), e.style.setProperty("--text-base-size", `${t.fontBaseSize}rem`), e.style.setProperty("font-family", t.fontFamily), t.mode === "dark" ? e.classList.add("dark") : e.classList.remove("dark");
16
+ }, Je = (e) => {
17
+ for (const t of [
18
+ "--primary",
19
+ "--primary-foreground",
20
+ "--ring",
21
+ "--radius",
22
+ "--spacing-base",
23
+ "--text-base-size"
24
+ ])
25
+ e.style.removeProperty(t);
26
+ e.style.removeProperty("font-family"), e.classList.remove("dark");
27
+ }, re = (e) => `${e.mode === "dark" ? ".dark" : ":root"} {
28
+ --primary: ${e.primary};
29
+ --primary-foreground: ${T(e.primary)};
30
+ --ring: ${e.primary};
31
+ --radius: ${e.radius}rem;
32
+ --spacing-base: ${e.spacingBase}rem;
33
+ --text-base-size: ${e.fontBaseSize}rem;
34
+ font-family: ${e.fontFamily};
35
+ }`, le = async (e) => {
36
+ await navigator.clipboard.writeText(re(e));
37
+ };
38
+ var ie = /* @__PURE__ */ c('<button type=button class="w-full inline-flex items-center justify-center gap-2 rounded-md bg-primary text-primary-foreground text-sm font-medium px-3 py-2 shadow-sm hover:opacity-90 transition-opacity">');
39
+ const ne = (e) => {
40
+ const [t, n] = k(!1), l = async () => {
41
+ await le(e.theme), n(!0), setTimeout(() => n(!1), 1500);
42
+ };
43
+ return (() => {
44
+ var i = ie();
45
+ return i.$$click = l, r(i, a(S, {
46
+ get when() {
47
+ return t();
48
+ },
49
+ get fallback() {
50
+ return a(M, {
51
+ size: 14
52
+ });
53
+ },
54
+ get children() {
55
+ return a(w, {
56
+ size: 14
57
+ });
58
+ }
59
+ }), null), r(i, () => t() ? "Скопировано" : "Скопировать CSS", null), i;
60
+ })();
61
+ };
62
+ $(["click"]);
63
+ const F = [
64
+ { id: "zinc", label: "Zinc", primary: "oklch(0.21 0 0)" },
65
+ { id: "slate", label: "Slate", primary: "oklch(0.45 0.04 264)" },
66
+ { id: "stone", label: "Stone", primary: "oklch(0.27 0.01 50)" },
67
+ { id: "red", label: "Red", primary: "oklch(0.58 0.22 27)" },
68
+ { id: "rose", label: "Rose", primary: "oklch(0.65 0.22 16)" },
69
+ { id: "orange", label: "Orange", primary: "oklch(0.7 0.18 48)" },
70
+ { id: "green", label: "Green", primary: "oklch(0.6 0.16 158)" },
71
+ { id: "blue", label: "Blue", primary: "oklch(0.55 0.18 256)" },
72
+ { id: "violet", label: "Violet", primary: "oklch(0.55 0.22 285)" }
73
+ ], B = [
74
+ {
75
+ id: "system",
76
+ label: "System UI",
77
+ stack: 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'
78
+ },
79
+ {
80
+ id: "inter",
81
+ label: "Inter",
82
+ stack: '"Inter", system-ui, sans-serif'
83
+ },
84
+ {
85
+ id: "geist",
86
+ label: "Geist",
87
+ stack: '"Geist", "Inter", system-ui, sans-serif'
88
+ },
89
+ {
90
+ id: "mono",
91
+ label: "Mono",
92
+ stack: '"JetBrains Mono", ui-monospace, "Cascadia Code", monospace'
93
+ },
94
+ {
95
+ id: "serif",
96
+ label: "Serif",
97
+ stack: 'ui-serif, Georgia, Cambria, "Times New Roman", serif'
98
+ }
99
+ ], ae = {
100
+ mode: "dark",
101
+ primary: F[7].primary,
102
+ // Blue по дефолту
103
+ radius: 0.5,
104
+ spacingBase: 1,
105
+ fontBaseSize: 1,
106
+ fontFamily: B[0].stack
107
+ };
108
+ var se = /* @__PURE__ */ c('<div class="flex items-center gap-3"><input type=range class="capsule-slider flex-1 h-1.5 rounded-full bg-muted accent-primary cursor-pointer"><span class="text-xs text-muted-foreground font-mono w-14 text-right shrink-0">');
109
+ const b = (e) => (() => {
110
+ var t = se(), n = t.firstChild, l = n.nextSibling;
111
+ return n.$$input = (i) => e.onChange(i.currentTarget.valueAsNumber), r(l, () => e.value.toFixed(e.precision ?? 2), null), r(l, () => e.unit ?? "", null), x((i) => {
112
+ var s = e.min, d = e.max, o = e.step;
113
+ return s !== i.e && y(n, "min", i.e = s), d !== i.t && y(n, "max", i.t = d), o !== i.a && y(n, "step", i.a = o), i;
114
+ }, {
115
+ e: void 0,
116
+ t: void 0,
117
+ a: void 0
118
+ }), x(() => n.value = e.value), t;
119
+ })();
120
+ $(["input"]);
121
+ var oe = /* @__PURE__ */ c('<div class="flex flex-col gap-3"><div class="grid grid-cols-3 gap-2">'), de = /* @__PURE__ */ c('<button type=button class="rounded-md border border-border bg-card/40 px-2.5 py-2 text-left text-sm transition-all hover:bg-card/80 hover:border-foreground/30"><div class=text-sm></div><div class="text-[10px] text-muted-foreground truncate">Aa Bb Cc');
122
+ const ce = (e) => (() => {
123
+ var t = oe(), n = t.firstChild;
124
+ return r(n, a(v, {
125
+ each: B,
126
+ children: (l) => {
127
+ const i = () => e.family === l.stack;
128
+ return (() => {
129
+ var s = de(), d = s.firstChild;
130
+ return s.$$click = () => e.onFamilyChange(l.stack), r(d, () => l.label), x((o) => {
131
+ var m = {
132
+ "ring-2 ring-ring shadow-md": i()
133
+ }, u = l.stack;
134
+ return o.e = p(s, m, o.e), u !== o.t && C(s, "font-family", o.t = u), o;
135
+ }, {
136
+ e: void 0,
137
+ t: void 0
138
+ }), s;
139
+ })();
140
+ }
141
+ })), r(t, a(b, {
142
+ get value() {
143
+ return e.size;
144
+ },
145
+ min: 0.75,
146
+ max: 1.25,
147
+ step: 0.0625,
148
+ precision: 3,
149
+ unit: "rem",
150
+ get onChange() {
151
+ return e.onSizeChange;
152
+ }
153
+ }), null), t;
154
+ })();
155
+ $(["click"]);
156
+ var ue = /* @__PURE__ */ c('<div class="inline-flex rounded-md border border-border bg-card/40 p-1 gap-1"><button type=button class="flex items-center gap-1.5 px-3 py-1.5 rounded text-sm transition-colors">Light</button><button type=button class="flex items-center gap-1.5 px-3 py-1.5 rounded text-sm transition-colors">Dark');
157
+ const me = (e) => (() => {
158
+ var t = ue(), n = t.firstChild, l = n.firstChild, i = n.nextSibling, s = i.firstChild;
159
+ return n.$$click = () => e.onChange("light"), r(n, a(A, {
160
+ size: 14
161
+ }), l), i.$$click = () => e.onChange("dark"), r(i, a(N, {
162
+ size: 14
163
+ }), s), x((d) => {
164
+ var o = {
165
+ "bg-primary text-primary-foreground shadow-sm": e.mode === "light",
166
+ "text-muted-foreground hover:text-foreground": e.mode !== "light"
167
+ }, m = {
168
+ "bg-primary text-primary-foreground shadow-sm": e.mode === "dark",
169
+ "text-muted-foreground hover:text-foreground": e.mode !== "dark"
170
+ };
171
+ return d.e = p(n, o, d.e), d.t = p(i, m, d.t), d;
172
+ }, {
173
+ e: void 0,
174
+ t: void 0
175
+ }), t;
176
+ })();
177
+ $(["click"]);
178
+ var ge = /* @__PURE__ */ c('<div class="flex flex-col gap-2">'), fe = /* @__PURE__ */ c('<div class="flex items-center gap-3"><span class="text-xs text-muted-foreground w-20 shrink-0"></span><div class=flex-1>');
179
+ const xe = (e) => {
180
+ const t = O(() => P(e.value)), n = (l) => {
181
+ e.onChange(ee({
182
+ ...t(),
183
+ ...l
184
+ }));
185
+ };
186
+ return (() => {
187
+ var l = ge();
188
+ return r(l, a(_, {
189
+ label: "Lightness",
190
+ get children() {
191
+ return a(b, {
192
+ get value() {
193
+ return t().l;
194
+ },
195
+ min: 0,
196
+ max: 1,
197
+ step: 0.01,
198
+ precision: 2,
199
+ onChange: (i) => n({
200
+ l: i
201
+ })
202
+ });
203
+ }
204
+ }), null), r(l, a(_, {
205
+ label: "Chroma",
206
+ get children() {
207
+ return a(b, {
208
+ get value() {
209
+ return t().c;
210
+ },
211
+ min: 0,
212
+ max: 0.4,
213
+ step: 5e-3,
214
+ precision: 3,
215
+ onChange: (i) => n({
216
+ c: i
217
+ })
218
+ });
219
+ }
220
+ }), null), r(l, a(_, {
221
+ label: "Hue",
222
+ get children() {
223
+ return a(b, {
224
+ get value() {
225
+ return t().h;
226
+ },
227
+ min: 0,
228
+ max: 360,
229
+ step: 1,
230
+ precision: 0,
231
+ unit: "°",
232
+ onChange: (i) => n({
233
+ h: i
234
+ })
235
+ });
236
+ }
237
+ }), null), l;
238
+ })();
239
+ }, _ = (e) => (() => {
240
+ var t = fe(), n = t.firstChild, l = n.nextSibling;
241
+ return r(n, () => e.label), r(l, () => e.children), t;
242
+ })();
243
+ var be = /* @__PURE__ */ c('<div class="grid grid-cols-3 gap-2">'), pe = /* @__PURE__ */ c('<button type=button class="group flex items-center gap-2 rounded-md border border-border bg-card/40 px-2.5 py-2 text-left text-sm transition-all hover:bg-card/80 hover:border-foreground/30"><span class="h-4 w-4 rounded-full ring-1 ring-foreground/20 shrink-0"aria-hidden></span><span class=truncate>');
244
+ const he = (e) => (() => {
245
+ var t = be();
246
+ return r(t, a(v, {
247
+ each: F,
248
+ children: (n) => {
249
+ const l = () => e.current === n.primary;
250
+ return (() => {
251
+ var i = pe(), s = i.firstChild, d = s.nextSibling;
252
+ return i.$$click = () => e.onPick(n.primary), r(d, () => n.label), x((o) => {
253
+ var m = {
254
+ "ring-2 ring-ring shadow-md scale-[1.02]": l()
255
+ }, u = n.primary;
256
+ return o.e = p(i, m, o.e), u !== o.t && C(s, "background", o.t = u), o;
257
+ }, {
258
+ e: void 0,
259
+ t: void 0
260
+ }), i;
261
+ })();
262
+ }
263
+ })), t;
264
+ })();
265
+ $(["click"]);
266
+ const ve = (e) => a(b, {
267
+ get value() {
268
+ return e.value;
269
+ },
270
+ min: 0,
271
+ max: 1.5,
272
+ step: 0.05,
273
+ precision: 2,
274
+ unit: "rem",
275
+ get onChange() {
276
+ return e.onChange;
277
+ }
278
+ });
279
+ var $e = /* @__PURE__ */ c('<div class="text-xs text-muted-foreground mt-0.5">'), ye = /* @__PURE__ */ c('<div class="flex flex-col gap-3 py-4 first:pt-0 last:pb-0 border-b border-border last:border-0"><div class="flex items-start gap-3"><div class="h-8 w-8 rounded-md bg-muted/60 grid place-items-center text-muted-foreground shrink-0"></div><div class="flex-1 min-w-0"><div class="text-sm font-medium leading-tight"></div></div></div><div class=pl-11>');
280
+ const h = (e) => (() => {
281
+ var t = ye(), n = t.firstChild, l = n.firstChild, i = l.nextSibling, s = i.firstChild, d = n.nextSibling;
282
+ return r(l, a(e.icon, {
283
+ size: 16
284
+ })), r(s, () => e.title), r(i, a(S, {
285
+ get when() {
286
+ return e.description;
287
+ },
288
+ get children() {
289
+ var o = $e();
290
+ return r(o, () => e.description), o;
291
+ }
292
+ }), null), r(d, () => e.children), t;
293
+ })(), _e = (e) => a(b, {
294
+ get value() {
295
+ return e.value;
296
+ },
297
+ min: 0.5,
298
+ max: 1.5,
299
+ step: 0.05,
300
+ precision: 2,
301
+ unit: "rem",
302
+ get onChange() {
303
+ return e.onChange;
304
+ }
305
+ });
306
+ var Ce = /* @__PURE__ */ c('<div class="flex flex-col gap-3"><details class=text-xs><summary class="cursor-pointer text-muted-foreground hover:text-foreground select-none">Тонкая подстройка (OKLCH)</summary><div class=mt-3>'), ke = /* @__PURE__ */ c('<div class="flex flex-col h-full"><header class="px-6 py-5 border-b border-border"><h2 class="text-lg font-semibold tracking-tight">Theme</h2><p class="text-xs text-muted-foreground mt-1">Настройте цвет, форму и шрифт — превью обновится мгновенно.</p></header><div class="flex-1 overflow-y-auto px-6"></div><footer class="px-6 py-4 border-t border-border bg-card/40">');
307
+ const Se = (e) => (() => {
308
+ var t = ke(), n = t.firstChild, l = n.nextSibling, i = l.nextSibling;
309
+ return r(l, a(h, {
310
+ icon: I,
311
+ title: "Режим",
312
+ description: "Светлая или тёмная тема для превью",
313
+ get children() {
314
+ return a(me, {
315
+ get mode() {
316
+ return e.theme.mode;
317
+ },
318
+ onChange: (s) => e.onChange({
319
+ mode: s
320
+ })
321
+ });
322
+ }
323
+ }), null), r(l, a(h, {
324
+ icon: G,
325
+ title: "Primary",
326
+ description: "Акцентный цвет — кнопки, фокус, ссылки",
327
+ get children() {
328
+ var s = Ce(), d = s.firstChild, o = d.firstChild, m = o.nextSibling;
329
+ return r(s, a(he, {
330
+ get current() {
331
+ return e.theme.primary;
332
+ },
333
+ onPick: (u) => e.onChange({
334
+ primary: u
335
+ })
336
+ }), d), r(m, a(xe, {
337
+ get value() {
338
+ return e.theme.primary;
339
+ },
340
+ onChange: (u) => e.onChange({
341
+ primary: u
342
+ })
343
+ })), s;
344
+ }
345
+ }), null), r(l, a(h, {
346
+ icon: H,
347
+ title: "Скругление",
348
+ description: "Радиус углов компонентов",
349
+ get children() {
350
+ return a(ve, {
351
+ get value() {
352
+ return e.theme.radius;
353
+ },
354
+ onChange: (s) => e.onChange({
355
+ radius: s
356
+ })
357
+ });
358
+ }
359
+ }), null), r(l, a(h, {
360
+ icon: U,
361
+ title: "Отступы",
362
+ description: "Базовый шаг spacing'а",
363
+ get children() {
364
+ return a(_e, {
365
+ get value() {
366
+ return e.theme.spacingBase;
367
+ },
368
+ onChange: (s) => e.onChange({
369
+ spacingBase: s
370
+ })
371
+ });
372
+ }
373
+ }), null), r(l, a(h, {
374
+ icon: D,
375
+ title: "Шрифт",
376
+ description: "Семейство и базовый размер",
377
+ get children() {
378
+ return a(ce, {
379
+ get family() {
380
+ return e.theme.fontFamily;
381
+ },
382
+ get size() {
383
+ return e.theme.fontBaseSize;
384
+ },
385
+ onFamilyChange: (s) => e.onChange({
386
+ fontFamily: s
387
+ }),
388
+ onSizeChange: (s) => e.onChange({
389
+ fontBaseSize: s
390
+ })
391
+ });
392
+ }
393
+ }), null), r(i, a(ne, {
394
+ get theme() {
395
+ return e.theme;
396
+ }
397
+ })), t;
398
+ })();
399
+ var we = /* @__PURE__ */ c('<div class="rounded-lg border border-border bg-card text-card-foreground p-6 shadow-sm"><div class="space-y-1.5 mb-5"><h3 class="text-base font-semibold leading-none">Войти в Capsule</h3><p class="text-xs text-muted-foreground">Войдите, чтобы продолжить редактирование</p></div><div class="flex flex-col gap-3"><label class="flex flex-col gap-1.5"><span class="text-xs font-medium">Email</span><div class=relative><input type=email placeholder=you@company.com class="w-full h-9 rounded-md border border-input bg-background pl-8 pr-3 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"></div></label><label class="flex flex-col gap-1.5"><span class="text-xs font-medium">Пароль</span><div class=relative><input type=password placeholder=•••••••• class="w-full h-9 rounded-md border border-input bg-background pl-8 pr-3 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"></div></label><button type=button class="mt-1 inline-flex items-center justify-center gap-2 h-9 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow-sm hover:opacity-90 transition-opacity">Войти');
400
+ const ze = () => (() => {
401
+ var e = we(), t = e.firstChild, n = t.nextSibling, l = n.firstChild, i = l.firstChild, s = i.nextSibling, d = s.firstChild, o = l.nextSibling, m = o.firstChild, u = m.nextSibling, g = u.firstChild, f = o.nextSibling;
402
+ return f.firstChild, r(s, a(j, {
403
+ size: 14,
404
+ class: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"
405
+ }), d), r(u, a(K, {
406
+ size: 14,
407
+ class: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"
408
+ }), g), r(f, a(J, {
409
+ size: 14
410
+ }), null), e;
411
+ })();
412
+ var Pe = /* @__PURE__ */ c('<div class="rounded-lg border border-border bg-card p-4"><div class="text-xs text-muted-foreground mb-3">Buttons</div><div class="flex flex-wrap gap-2"><button type=button class="inline-flex items-center gap-1.5 h-8 px-3 rounded-md bg-primary text-primary-foreground text-xs font-medium shadow-sm hover:opacity-90">Primary</button><button type=button class="inline-flex items-center gap-1.5 h-8 px-3 rounded-md bg-secondary text-secondary-foreground text-xs font-medium hover:bg-secondary/80">Secondary</button><button type=button class="inline-flex items-center gap-1.5 h-8 px-3 rounded-md border border-input bg-background text-xs font-medium hover:bg-accent hover:text-accent-foreground">Outline</button><button type=button class="inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-foreground text-xs font-medium hover:bg-accent hover:text-accent-foreground">Ghost</button><button type=button class="inline-flex items-center gap-1.5 h-8 px-3 rounded-md bg-destructive text-destructive-foreground text-xs font-medium shadow-sm hover:opacity-90">Destructive');
413
+ const Te = () => (() => {
414
+ var e = Pe(), t = e.firstChild, n = t.nextSibling, l = n.firstChild, i = l.firstChild, s = l.nextSibling, d = s.firstChild, o = s.nextSibling, m = o.firstChild, u = o.nextSibling, g = u.nextSibling, f = g.firstChild;
415
+ return r(l, a(z, {
416
+ size: 12
417
+ }), i), r(s, a(V, {
418
+ size: 12
419
+ }), d), r(o, a(Z, {
420
+ size: 12
421
+ }), m), r(g, a(q, {
422
+ size: 12
423
+ }), f), e;
424
+ })();
425
+ var Fe = /* @__PURE__ */ c('<div class="grid grid-cols-3 gap-3">'), Be = /* @__PURE__ */ c('<div class="rounded-lg border border-border bg-card p-3"><div class="flex items-center justify-between text-muted-foreground mb-2"><span class="text-[10px] font-mono px-1.5 py-0.5 rounded"></span></div><div class="text-xs text-muted-foreground"></div><div class="text-lg font-semibold tracking-tight mt-0.5">');
426
+ const Le = [{
427
+ label: "Активные",
428
+ value: "12 480",
429
+ delta: "+12%",
430
+ positive: !0,
431
+ icon: Q
432
+ }, {
433
+ label: "Сессии",
434
+ value: "1.2M",
435
+ delta: "+4.3%",
436
+ positive: !0,
437
+ icon: W
438
+ }, {
439
+ label: "Ошибки",
440
+ value: "38",
441
+ delta: "-22%",
442
+ positive: !1,
443
+ icon: X
444
+ }], Ee = () => (() => {
445
+ var e = Fe();
446
+ return r(e, a(v, {
447
+ each: Le,
448
+ children: (t) => (() => {
449
+ var n = Be(), l = n.firstChild, i = l.firstChild, s = l.nextSibling, d = s.nextSibling;
450
+ return r(l, a(t.icon, {
451
+ size: 14
452
+ }), i), r(i, () => t.delta), r(s, () => t.label), r(d, () => t.value), x((o) => p(i, {
453
+ "text-green-500 bg-green-500/10": t.positive,
454
+ "text-red-500 bg-red-500/10": !t.positive
455
+ }, o)), n;
456
+ })()
457
+ })), e;
458
+ })();
459
+ var Oe = /* @__PURE__ */ c('<div class="grid grid-cols-2 gap-3">'), Re = /* @__PURE__ */ c('<div class="relative rounded-lg border p-4 transition-colors"><div class="flex flex-col"><span class="text-xs text-muted-foreground"></span><div class="flex items-baseline gap-1 mt-1"><span class="text-xl font-semibold leading-none"></span><span class="text-[11px] text-muted-foreground"></span></div></div><ul class="mt-3 flex flex-col gap-1.5">'), Me = /* @__PURE__ */ c('<span class="absolute -top-2.5 right-4 inline-flex items-center gap-1 rounded-full bg-primary px-2 py-0.5 text-[10px] font-medium text-primary-foreground">Хит'), Ae = /* @__PURE__ */ c('<li class="flex items-center gap-1.5 text-xs"><span class=text-muted-foreground>');
460
+ const Ne = [{
461
+ id: "starter",
462
+ name: "Starter",
463
+ price: "0 ₽",
464
+ sub: "Forever free",
465
+ features: ["1 проект", "3 редактора", "Базовая палитра"],
466
+ featured: !1
467
+ }, {
468
+ id: "pro",
469
+ name: "Pro",
470
+ price: "1 290 ₽",
471
+ sub: "в месяц",
472
+ features: ["Неограниченные проекты", "Своя дизайн-система", "Экспорт CSS"],
473
+ featured: !0
474
+ }], Ie = () => (() => {
475
+ var e = Oe();
476
+ return r(e, a(v, {
477
+ each: Ne,
478
+ children: (t) => (() => {
479
+ var n = Re(), l = n.firstChild, i = l.firstChild, s = i.nextSibling, d = s.firstChild, o = d.nextSibling, m = l.nextSibling;
480
+ return r(n, (() => {
481
+ var u = L(() => !!t.featured);
482
+ return () => u() ? (() => {
483
+ var g = Me(), f = g.firstChild;
484
+ return r(g, a(z, {
485
+ size: 10
486
+ }), f), g;
487
+ })() : null;
488
+ })(), l), r(i, () => t.name), r(d, () => t.price), r(o, () => t.sub), r(m, a(v, {
489
+ get each() {
490
+ return t.features;
491
+ },
492
+ children: (u) => (() => {
493
+ var g = Ae(), f = g.firstChild;
494
+ return r(g, a(w, {
495
+ size: 12,
496
+ class: "text-primary shrink-0"
497
+ }), f), r(f, u), g;
498
+ })()
499
+ })), x((u) => p(n, {
500
+ "border-primary bg-primary/5 shadow-md": t.featured,
501
+ "border-border bg-card": !t.featured
502
+ }, u)), n;
503
+ })()
504
+ })), e;
505
+ })();
506
+ var Ge = /* @__PURE__ */ c('<div class="h-full overflow-y-auto bg-background text-foreground p-8"><div class="max-w-3xl mx-auto flex flex-col gap-4"><div class="grid grid-cols-12 gap-4 items-start"><div class=col-span-5></div><div class="col-span-7 flex flex-col gap-4">');
507
+ const He = () => (() => {
508
+ var e = Ge(), t = e.firstChild, n = t.firstChild, l = n.firstChild, i = l.nextSibling;
509
+ return r(l, a(ze, {})), r(i, a(Ee, {}), null), r(i, a(Ie, {}), null), r(t, a(Te, {}), null), e;
510
+ })();
511
+ var Ue = /* @__PURE__ */ c('<div class="grid grid-cols-[380px_1fr] h-screen overflow-hidden bg-background text-foreground"><aside class="border-r border-border bg-card/30 overflow-hidden"></aside><main class=overflow-hidden>');
512
+ const Ve = (e) => {
513
+ const [t, n] = k(e.initialTheme ?? ae);
514
+ let l;
515
+ R(() => {
516
+ l && te(l, t()), e.onChange?.(t());
517
+ });
518
+ const i = (s) => {
519
+ n((d) => ({
520
+ ...d,
521
+ ...s
522
+ }));
523
+ };
524
+ return (() => {
525
+ var s = Ue(), d = s.firstChild, o = d.nextSibling;
526
+ r(d, a(Se, {
527
+ get theme() {
528
+ return t();
529
+ },
530
+ onChange: i
531
+ }));
532
+ var m = l;
533
+ return typeof m == "function" ? E(m, o) : l = o, r(o, a(He, {})), s;
534
+ })();
535
+ };
536
+ export {
537
+ F as COLOR_PRESETS,
538
+ ae as DEFAULT_THEME,
539
+ B as FONT_OPTIONS,
540
+ Ve as ThemeEditor,
541
+ te as applyTheme,
542
+ T as contrastForeground,
543
+ le as copyTheme,
544
+ re as exportTheme,
545
+ ee as formatOklch,
546
+ P as parseOklch,
547
+ Je as resetTheme
548
+ };
549
+ //# sourceMappingURL=editor.mjs.map