@nice2dev/ui 1.3.17 → 1.4.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 (44) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/README.md +29 -2
  3. package/dist/{NiceDataGrid-aNPAHsWy.cjs → NiceDataGrid-BT6iCUgP.cjs} +1 -1
  4. package/dist/NiceForm-Bysp66Ef.cjs +1 -0
  5. package/dist/{NiceMention-CMqAGvO0.cjs → NiceMention-sc8W-DwH.cjs} +1 -1
  6. package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +1 -0
  7. package/dist/{NiceSavedQueryPanel-JHrSlHAV.cjs → NiceSavedQueryPanel-BbznsXFd.cjs} +1 -1
  8. package/dist/{NiceScheduler-2TwOZq-y.cjs → NiceScheduler-3Ez0zSQJ.cjs} +1 -1
  9. package/dist/{core-lazy-Cda-D35m.cjs → core-lazy-CL4ZIxF-.cjs} +1 -1
  10. package/dist/data/treeDragSession.mjs +52 -46
  11. package/dist/data.cjs +1 -1
  12. package/dist/editors/inputs/NiceAutocomplete.mjs +44 -46
  13. package/dist/editors/pickers/NiceDateTimePicker.mjs +1 -1
  14. package/dist/editors/pickers/pickerCommons.mjs +284 -87
  15. package/dist/editors/pickers/themePickerHelpers.mjs +10 -8
  16. package/dist/editors.cjs +1 -1
  17. package/dist/index.cjs +162 -162
  18. package/dist/index.d.ts +253 -31
  19. package/dist/index.mjs +1517 -1483
  20. package/dist/navigation/NiceIconRail.mjs +74 -53
  21. package/dist/navigation/NiceNavShell.mjs +855 -807
  22. package/dist/navigation/NiceSetupWizard.mjs +287 -278
  23. package/dist/navigation/NiceSidebarNav.mjs +1487 -1144
  24. package/dist/navigation/navItemDrag.mjs +42 -0
  25. package/dist/navigation/navShellPane.mjs +16 -11
  26. package/dist/navigation/sidebarColors.mjs +61 -50
  27. package/dist/navigation/sidebarNavTypes.mjs +1 -0
  28. package/dist/navigation/sidebarSearch.mjs +28 -0
  29. package/dist/navigation.cjs +1 -1
  30. package/dist/navigation.d.ts +70 -21
  31. package/dist/pickerCommons-CwcCc8Qi.cjs +1 -0
  32. package/dist/planning/NiceResourceAllocation.mjs +31 -31
  33. package/dist/style.css +4 -4
  34. package/dist/tools/NiceThemeDesigner.mjs +781 -708
  35. package/dist/tools/NiceThemePreview.mjs +344 -282
  36. package/dist/tools/themeCatalog.mjs +28 -44
  37. package/dist/tools/themeCatalogArchive.mjs +38 -0
  38. package/dist/tools/themeDesigner/ThemeSetEditors.mjs +400 -0
  39. package/dist/tools/themeDesigner/ThemeValueField.mjs +146 -0
  40. package/dist/tools/themeDesigner/themeDesignerPaths.mjs +105 -0
  41. package/package.json +4 -4
  42. package/dist/NiceForm-BtRBLffD.cjs +0 -1
  43. package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +0 -1
  44. package/dist/pickerCommons-BWglYl6J.cjs +0 -1
@@ -1,17 +1,22 @@
1
- import { jsxs as h, jsx as r, Fragment as Ye } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as n, Fragment as Ye } from "react/jsx-runtime";
2
2
  import { useNiceTranslation as Ge } from "@nice2dev/i18n";
3
- import { useControlId as st, niceThemeLight as Ke, NiceIcon as I, NiceTutorialButton as ot, resolveTutorial as lt, deserializeTheme as ct, useRovingFocus as mt, NiceThemeContext as dt, applyTheme as ht, serializeTheme as Ue, themeToCssVars as je, NICE_DISPLAY_STYLES as ut } from "@nice2dev/ui-core";
4
- import { forwardRef as pt, useState as E, useCallback as f, useRef as O, useMemo as ee, useEffect as de, useContext as bt } from "react";
3
+ import { useControlId as ot, niceThemeLight as Ke, NiceIcon as $, NiceTutorialButton as st, resolveTutorial as lt, deserializeTheme as ct, useRovingFocus as mt, NiceThemeContext as dt, applyTheme as ht, serializeTheme as Ue, themeToCssVars as We, NICE_DISPLAY_STYLES as ut } from "@nice2dev/ui-core";
4
+ import { forwardRef as pt, useState as O, useCallback as y, useRef as M, useMemo as G, useEffect as me, useContext as bt } from "react";
5
5
  import { NiceTreeGrid as gt } from "../data/NiceTreeGrid.mjs";
6
- import { NiceNumberInput as De } from "../editors/inputs/NiceNumberInput.mjs";
7
- import { NiceSelect as Ae } from "../editors/inputs/NiceSelect.mjs";
8
- import { NiceTextInput as We } from "../editors/inputs/NiceTextInput.mjs";
6
+ import { NiceNumberInput as ze } from "../editors/inputs/NiceNumberInput.mjs";
7
+ import { NiceSelect as Re } from "../editors/inputs/NiceSelect.mjs";
8
+ import { NiceTextInput as je } from "../editors/inputs/NiceTextInput.mjs";
9
9
  import { NiceColorPalette as ft } from "../editors/pickers/NiceColorPalette.mjs";
10
- import { NiceColorPicker as Xe } from "../editors/pickers/NiceColorPicker.mjs";
10
+ import { NiceColorPicker as yt } from "../editors/pickers/NiceColorPicker.mjs";
11
+ import { ThemePreviewSwatch as vt } from "../editors/pickers/pickerCommons.mjs";
12
+ import { toThemeDescriptor as _t } from "../editors/pickers/themePickerHelpers.mjs";
11
13
  import { NiceConfirmDialog as Ze } from "../feedback/NiceConfirmDialog.mjs";
12
- import { downloadBlob as yt } from "./NiceExport.mjs";
14
+ import { downloadBlob as St } from "./NiceExport.mjs";
13
15
  import { NiceThemePreview as Qe } from "./NiceThemePreview.mjs";
14
- import { NICE_THEME_CATALOG as Ne } from "./themeCatalog.mjs";
16
+ import { NICE_THEME_CATALOG as Se } from "./themeCatalog.mjs";
17
+ import { setThemePath as Nt } from "./themeDesigner/themeDesignerPaths.mjs";
18
+ import { ThemeScrollbarEditor as wt, ThemeColorSetEditor as Xe, ThemePaletteEditor as Tt } from "./themeDesigner/ThemeSetEditors.mjs";
19
+ import { ThemeValueField as kt } from "./themeDesigner/ThemeValueField.mjs";
15
20
  const et = {
16
21
  target: ".nice-theme-builder",
17
22
  titleKey: "tutorial.themeBuilder.intro.title",
@@ -19,7 +24,7 @@ const et = {
19
24
  contentKey: "tutorial.themeBuilder.intro.content",
20
25
  content: "Start from a preset, tweak colors, typography and other tokens by section, preview live, then apply or export the theme.",
21
26
  placement: "auto"
22
- }, vt = [
27
+ }, xt = [
23
28
  et,
24
29
  {
25
30
  target: ".nice-theme-builder__tree",
@@ -29,7 +34,7 @@ const et = {
29
34
  content: "Start from a built-in preset, then customise — the fastest way to a coherent palette.",
30
35
  placement: "right"
31
36
  }
32
- ], _t = [
37
+ ], Ct = [
33
38
  et,
34
39
  {
35
40
  target: ".nice-theme-builder__tabs",
@@ -56,118 +61,118 @@ const et = {
56
61
  placement: "bottom"
57
62
  }
58
63
  ];
59
- function St(s) {
60
- return s.startsWith("colors.") ? "colors" : s.startsWith("backgrounds.") ? "backgrounds" : s.startsWith("backgroundImage.") ? "background-image" : s.startsWith("text.") ? "text" : s.startsWith("borders.") ? "borders" : s.startsWith("spacing.") ? "spacing" : s.startsWith("typography.") ? "typography" : s.startsWith("shadows.") ? "shadows" : s.startsWith("transitions.") ? "transitions" : s === "name" || s === "darkMode" || s === "darkThemeName" || s === "recommendedDisplayStyle" ? "general" : null;
64
+ function $t(s) {
65
+ return s.startsWith("colors.") ? "colors" : s.startsWith("backgrounds.") ? "backgrounds" : s.startsWith("backgroundImage.") ? "background-image" : s.startsWith("text.") ? "text" : s.startsWith("borders.") ? "borders" : s.startsWith("spacing.") ? "spacing" : s.startsWith("typography.") ? "typography" : s.startsWith("shadows.") ? "shadows" : s.startsWith("transitions.") ? "transitions" : s.startsWith("palette.") || s.startsWith("gradients.") ? "palette" : s.startsWith("layout.") ? "layout" : s.startsWith("scrollbar.") ? "scrollbar" : s === "name" || s === "darkMode" || s === "darkThemeName" || s === "recommendedDisplayStyle" ? "general" : null;
61
66
  }
62
- function Je(s, d) {
63
- if (!d.has(s))
67
+ function Je(s, h) {
68
+ if (!h.has(s))
64
69
  return s;
65
- for (let u = 2; ; u++) {
66
- const T = `${s} ${u}`;
67
- if (!d.has(T))
70
+ for (let p = 2; ; p++) {
71
+ const T = `${s} ${p}`;
72
+ if (!h.has(T))
68
73
  return T;
69
74
  }
70
75
  }
71
76
  function tt(s) {
72
77
  if (!s || typeof s != "object")
73
78
  return null;
74
- const d = s;
75
- return typeof d.name != "string" ? null : { ...Ke, ...d };
79
+ const h = s;
80
+ return typeof h.name != "string" ? null : { ...Ke, ...h };
76
81
  }
77
- function nt(s, d) {
82
+ function nt(s, h) {
78
83
  if (s)
79
84
  try {
80
- const u = window.localStorage.getItem(`${s}:${d}`);
81
- return u ? JSON.parse(u) : void 0;
85
+ const p = window.localStorage.getItem(`${s}:${h}`);
86
+ return p ? JSON.parse(p) : void 0;
82
87
  } catch {
83
88
  return;
84
89
  }
85
90
  }
86
- function qe(s, d, u) {
91
+ function Ve(s, h, p) {
87
92
  if (s)
88
93
  try {
89
- window.localStorage.setItem(`${s}:${d}`, JSON.stringify(u));
94
+ window.localStorage.setItem(`${s}:${h}`, JSON.stringify(p));
90
95
  } catch {
91
96
  }
92
97
  }
93
- function Nt(s) {
94
- const d = nt(s, "themes");
95
- return Array.isArray(d) ? d.map(tt).filter((u) => u !== null) : [];
98
+ function Pt(s) {
99
+ const h = nt(s, "themes");
100
+ return Array.isArray(h) ? h.map(tt).filter((p) => p !== null) : [];
96
101
  }
97
- function wt(s) {
98
- const d = nt(s, "favorites");
99
- return Array.isArray(d) ? d.filter((u) => typeof u == "string") : [];
102
+ function Ft(s) {
103
+ const h = nt(s, "favorites");
104
+ return Array.isArray(h) ? h.filter((p) => typeof p == "string") : [];
100
105
  }
101
- function rt(s, d) {
102
- const u = new FileReader();
103
- u.onload = () => {
106
+ function rt(s, h) {
107
+ const p = new FileReader();
108
+ p.onload = () => {
104
109
  try {
105
- const T = String(u.result ?? "");
106
- let z;
110
+ const T = String(p.result ?? "");
111
+ let I;
107
112
  try {
108
- z = ct(T);
113
+ I = ct(T);
109
114
  } catch {
110
- z = JSON.parse(T);
115
+ I = JSON.parse(T);
111
116
  }
112
- const N = tt(z);
113
- N && d(N);
117
+ const N = tt(I);
118
+ N && h(N);
114
119
  } catch {
115
120
  }
116
- }, u.readAsText(s);
121
+ }, p.readAsText(s);
117
122
  }
118
- function Tt(s) {
123
+ function It(s) {
119
124
  if (!s)
120
- return Ne;
121
- const d = /* @__PURE__ */ new Map(), u = [
122
- ...Ne.filter((N) => !N.entries.some((w) => w.pack)),
123
- ...Ne.filter((N) => N.entries.some((w) => w.pack))
125
+ return Se;
126
+ const h = /* @__PURE__ */ new Map(), p = [
127
+ ...Se.filter((N) => !N.entries.some((w) => w.pack)),
128
+ ...Se.filter((N) => N.entries.some((w) => w.pack))
124
129
  ];
125
- for (const N of u)
130
+ for (const N of p)
126
131
  for (const w of N.entries)
127
- d.has(w.name) || d.set(w.name, N.id);
132
+ h.has(w.name) || h.set(w.name, N.id);
128
133
  const T = /* @__PURE__ */ new Map();
129
134
  for (const N of s) {
130
- const w = d.get(N.name) ?? "presets";
135
+ const w = h.get(N.name) ?? "presets";
131
136
  let g = T.get(w);
132
137
  if (!g) {
133
- const P = Ne.find((R) => R.id === w);
138
+ const P = Se.find((L) => L.id === w);
134
139
  g = { id: w, label: P?.label ?? "Presets", entries: [] }, T.set(w, g);
135
140
  }
136
141
  g.entries.push({ name: N.name, theme: N, category: w });
137
142
  }
138
- const z = (N) => {
139
- const w = Ne.findIndex((g) => g.id === N);
143
+ const I = (N) => {
144
+ const w = Se.findIndex((g) => g.id === N);
140
145
  return w < 0 ? Number.MAX_SAFE_INTEGER : w;
141
146
  };
142
- return [...T.values()].sort((N, w) => z(N.id) - z(w.id));
147
+ return [...T.values()].sort((N, w) => I(N.id) - I(w.id));
143
148
  }
144
- const kt = 1e3;
145
- function Ct(s) {
146
- const [d, u] = E(() => ({
149
+ const Lt = 1e3;
150
+ function zt(s) {
151
+ const [h, p] = O(() => ({
147
152
  past: [],
148
153
  present: s,
149
154
  future: [],
150
155
  lastKey: null,
151
156
  lastAt: 0
152
- })), T = f(
157
+ })), T = y(
153
158
  (g, P) => {
154
- u((R) => {
155
- const V = typeof g == "function" ? g(R.present) : g;
156
- if (V === R.present)
157
- return R;
158
- const j = Date.now();
159
+ p((L) => {
160
+ const Y = typeof g == "function" ? g(L.present) : g;
161
+ if (Y === L.present)
162
+ return L;
163
+ const E = Date.now();
159
164
  return {
160
- past: P !== null && P === R.lastKey && j - R.lastAt < kt ? R.past : [...R.past, R.present].slice(-100),
161
- present: V,
165
+ past: P !== null && P === L.lastKey && E - L.lastAt < Lt ? L.past : [...L.past, L.present].slice(-100),
166
+ present: Y,
162
167
  future: [],
163
168
  lastKey: P,
164
- lastAt: j
169
+ lastAt: E
165
170
  };
166
171
  });
167
172
  },
168
173
  []
169
- ), z = f(() => {
170
- u(
174
+ ), I = y(() => {
175
+ p(
171
176
  (g) => g.past.length === 0 ? g : {
172
177
  past: g.past.slice(0, -1),
173
178
  present: g.past[g.past.length - 1],
@@ -176,8 +181,8 @@ function Ct(s) {
176
181
  lastAt: 0
177
182
  }
178
183
  );
179
- }, []), N = f(() => {
180
- u(
184
+ }, []), N = y(() => {
185
+ p(
181
186
  (g) => g.future.length === 0 ? g : {
182
187
  past: [...g.past, g.present],
183
188
  present: g.future[0],
@@ -186,273 +191,276 @@ function Ct(s) {
186
191
  lastAt: 0
187
192
  }
188
193
  );
189
- }, []), w = f((g) => {
190
- u((P) => ({ ...P, present: g, lastKey: null, lastAt: 0 }));
194
+ }, []), w = y((g) => {
195
+ p((P) => ({ ...P, present: g, lastKey: null, lastAt: 0 }));
191
196
  }, []);
192
197
  return {
193
- theme: d.present,
194
- canUndo: d.past.length > 0,
195
- canRedo: d.future.length > 0,
198
+ theme: h.present,
199
+ canUndo: h.past.length > 0,
200
+ canRedo: h.future.length > 0,
196
201
  commit: T,
197
- undo: z,
202
+ undo: I,
198
203
  redo: N,
199
204
  replace: w
200
205
  };
201
206
  }
202
- function xt({
207
+ function Rt({
203
208
  controlId: s,
204
- original: d,
205
- own: u,
209
+ original: h,
210
+ own: p,
206
211
  groupLabel: T,
207
- allSections: z,
212
+ allSections: I,
208
213
  showPreview: N,
209
214
  onTogglePreview: w,
210
215
  onBack: g,
211
216
  onSave: P,
212
- onSaveCopy: R,
213
- onChange: V,
214
- onApply: j,
215
- onExport: Y,
216
- livePreview: Te,
217
- focusedToken: he
217
+ onSaveCopy: L,
218
+ onChange: Y,
219
+ onApply: E,
220
+ onExport: Z,
221
+ livePreview: we,
222
+ focusedToken: de
218
223
  }) {
219
- const { t: e } = Ge(), ke = O(null);
220
- mt(ke, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
221
- const { theme: m, canUndo: Be, canRedo: Me, commit: B, undo: te, redo: ue, replace: ne } = Ct(d), [pe, be] = E("colors"), [p, U] = E(!1), ge = O(null), fe = O(null), X = ee(
222
- () => m !== d && JSON.stringify(m) !== JSON.stringify(d),
223
- [m, d]
224
- ), Ce = O(V);
225
- de(() => {
226
- Ce.current = V;
224
+ const { t: e } = Ge(), Te = M(null);
225
+ mt(Te, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
226
+ const { theme: m, canUndo: Be, canRedo: De, commit: R, undo: te, redo: he, replace: ne } = zt(h), [ue, pe] = O("colors"), [b, U] = O(!1), be = M(null), ge = M(null), X = G(
227
+ () => m !== h && JSON.stringify(m) !== JSON.stringify(h),
228
+ [m, h]
229
+ ), ke = M(Y);
230
+ me(() => {
231
+ ke.current = Y;
227
232
  });
228
- const xe = O(m);
229
- de(() => {
230
- m !== xe.current && (xe.current = m, Ce.current?.(m));
233
+ const xe = M(m);
234
+ me(() => {
235
+ m !== xe.current && (xe.current = m, ke.current?.(m));
231
236
  }, [m]);
232
- const J = O(null), C = O(null), W = f(
237
+ const J = M(null), k = M(null), B = y(
233
238
  (i) => {
234
- const n = St(i);
235
- n && z.includes(n) && (be(n), requestAnimationFrame(() => {
239
+ const r = $t(i);
240
+ r && I.includes(r) && (pe(r), requestAnimationFrame(() => {
236
241
  requestAnimationFrame(() => {
237
- if (!ge.current)
242
+ if (!be.current)
238
243
  return;
239
- const a = ge.current.querySelector(
244
+ const o = be.current.querySelector(
240
245
  `[data-token="${i}"]`
241
246
  );
242
- if (!a)
247
+ if (!o)
243
248
  return;
244
- a.scrollIntoView({ behavior: "smooth", block: "center" }), a.querySelector("input, select, textarea")?.focus(), C.current?.classList.remove("nice-theme-builder__field--targeted"), a.classList.add("nice-theme-builder__field--targeted"), C.current = a, J.current && clearTimeout(J.current), J.current = setTimeout(() => {
245
- a.classList.remove("nice-theme-builder__field--targeted"), C.current = null, J.current = null;
249
+ o.scrollIntoView({ behavior: "smooth", block: "center" }), o.querySelector("input, select, textarea")?.focus(), k.current?.classList.remove("nice-theme-builder__field--targeted"), o.classList.add("nice-theme-builder__field--targeted"), k.current = o, J.current && clearTimeout(J.current), J.current = setTimeout(() => {
250
+ o.classList.remove("nice-theme-builder__field--targeted"), k.current = null, J.current = null;
246
251
  }, 1500);
247
252
  });
248
253
  }));
249
254
  },
250
- [z]
255
+ [I]
251
256
  );
252
- de(
257
+ me(
253
258
  () => () => {
254
259
  J.current && clearTimeout(J.current);
255
260
  },
256
261
  []
257
- ), de(() => {
258
- he && W(he);
259
- }, [he, W]);
260
- const ye = bt(dt)?.setTheme, re = f(
261
- (i) => ye ? ye(i) : ht(i),
262
- [ye]
263
- ), D = O(m);
264
- de(() => {
265
- Te && m !== D.current && re(m);
266
- }, [Te, m, re]);
267
- const H = f(
262
+ ), me(() => {
263
+ de && B(de);
264
+ }, [de, B]);
265
+ const fe = bt(dt)?.setTheme, re = y(
266
+ (i) => fe ? fe(i) : ht(i),
267
+ [fe]
268
+ ), z = M(m);
269
+ me(() => {
270
+ we && m !== z.current && re(m);
271
+ }, [we, m, re]);
272
+ const W = y(
268
273
  (i) => {
269
- B((n) => ({ ...n, ...i }), Object.keys(i).join(","));
274
+ R((r) => ({ ...r, ...i }), Object.keys(i).join(","));
270
275
  },
271
- [B]
272
- ), M = f(
273
- (i, n, a) => {
274
- B(
275
- (_) => {
276
- const y = _[i], t = typeof y == "object" && y !== null ? y : {};
277
- return { ..._, [i]: { ...t, [n]: a } };
276
+ [R]
277
+ ), D = y(
278
+ (i, r, o) => {
279
+ R(
280
+ (t) => {
281
+ const a = t[i], l = typeof a == "object" && a !== null ? a : {};
282
+ return { ...t, [i]: { ...l, [r]: o } };
278
283
  },
279
- `${String(i)}.${n}`
284
+ `${String(i)}.${r}`
280
285
  );
281
286
  },
282
- [B]
283
- ), $e = f(
287
+ [R]
288
+ ), V = G(
289
+ () => ({
290
+ set: (i, r) => R((o) => Nt(o, i, r), i),
291
+ replace: (i) => R(i, null)
292
+ }),
293
+ [R]
294
+ ), ae = y(
284
295
  (i) => {
285
- const n = i.target.files?.[0];
286
- i.target.value = "", n && rt(n, (a) => B(a, null));
296
+ const r = i.target.files?.[0];
297
+ i.target.value = "", r && rt(r, (o) => R(o, null));
287
298
  },
288
- [B]
289
- ), ie = f(() => {
290
- re(m), j?.(m);
291
- }, [m, j, re]), ae = f(() => {
299
+ [R]
300
+ ), ie = y(() => {
301
+ re(m), E?.(m);
302
+ }, [m, E, re]), ye = y(() => {
292
303
  const i = Ue(m);
293
- if (Y) {
294
- Y(i, je(m));
304
+ if (Z) {
305
+ Z(i, We(m));
295
306
  return;
296
307
  }
297
- const n = (m.name ?? "").trim().replace(/[^\w.-]+/g, "-") || "theme";
298
- yt(new Blob([i], { type: "application/json;charset=utf-8" }), `${n}.json`);
299
- }, [m, Y]), ve = f(() => ne(P(m)), [P, ne, m]), _e = f(
300
- () => ne(R(m)),
301
- [R, ne, m]
302
- ), Ie = f(() => B(d, null), [B, d]), se = f(
308
+ const r = (m.name ?? "").trim().replace(/[^\w.-]+/g, "-") || "theme";
309
+ St(new Blob([i], { type: "application/json;charset=utf-8" }), `${r}.json`);
310
+ }, [m, Z]), ve = y(() => ne(P(m)), [P, ne, m]), Ce = y(
311
+ () => ne(L(m)),
312
+ [L, ne, m]
313
+ ), oe = y(() => R(h, null), [R, h]), C = y(
303
314
  () => X ? U(!0) : g(),
304
315
  [X, g]
305
- ), x = O(null);
306
- de(() => {
307
- const i = x.current;
316
+ ), $e = M(null);
317
+ me(() => {
318
+ const i = $e.current;
308
319
  if (!i)
309
320
  return;
310
- const n = (a) => {
311
- if (!(a.ctrlKey || a.metaKey) || a.altKey)
321
+ const r = (o) => {
322
+ if (!(o.ctrlKey || o.metaKey) || o.altKey)
312
323
  return;
313
- const _ = a.key.toLowerCase();
314
- _ === "z" && !a.shiftKey ? (a.preventDefault(), te()) : (_ === "z" && a.shiftKey || _ === "y") && (a.preventDefault(), ue());
324
+ const t = o.key.toLowerCase();
325
+ t === "z" && !o.shiftKey ? (o.preventDefault(), te()) : (t === "z" && o.shiftKey || t === "y") && (o.preventDefault(), he());
315
326
  };
316
- return i.addEventListener("keydown", n), () => i.removeEventListener("keydown", n);
317
- }, [te, ue]);
318
- const Oe = ee(() => {
319
- const i = je(m);
320
- return Object.entries(i).map(([n, a]) => ` ${n}: ${a};`).join(`
327
+ return i.addEventListener("keydown", r), () => i.removeEventListener("keydown", r);
328
+ }, [te, he]);
329
+ const Pe = G(() => {
330
+ const i = We(m);
331
+ return Object.entries(i).map(([r, o]) => ` ${r}: ${o};`).join(`
321
332
  `);
322
- }, [m]), b = (i, n, a) => {
323
- const _ = m[i] ?? {}, y = `${i}.${n}`;
324
- return /* @__PURE__ */ r(
325
- "div",
326
- {
327
- className: "nice-theme-builder__field nice-theme-builder__field--color",
328
- "data-token": y,
329
- children: /* @__PURE__ */ r(
330
- Xe,
331
- {
332
- id: `${s}-${i}-${n}`,
333
- label: a,
334
- labelPlacement: "left",
335
- size: "sm",
336
- compact: !0,
337
- value: _[n] || "",
338
- onChange: (t) => M(i, n, t)
339
- }
340
- )
341
- },
342
- n
343
- );
344
- }, l = (i, n, a) => {
345
- const _ = m[i] ?? {}, y = `${i}.${n}`;
346
- return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": y, children: /* @__PURE__ */ r(
347
- We,
333
+ }, [m]), x = (i, r, o = "color") => /* @__PURE__ */ n(
334
+ "div",
335
+ {
336
+ className: "nice-theme-builder__field nice-theme-builder__field--color",
337
+ "data-token": i,
338
+ children: /* @__PURE__ */ n(
339
+ kt,
340
+ {
341
+ id: `${s}-${i.replace(/\./g, "-")}`,
342
+ label: r,
343
+ path: i,
344
+ theme: m,
345
+ kind: o,
346
+ onChange: (t, a) => V.set(t, a),
347
+ onGoTo: B
348
+ }
349
+ )
350
+ },
351
+ i
352
+ ), d = (i, r, o) => x(`${String(i)}.${r}`, o), c = (i, r, o) => {
353
+ const t = m[i] ?? {}, a = `${i}.${r}`;
354
+ return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": a, children: /* @__PURE__ */ n(
355
+ je,
348
356
  {
349
- id: `${s}-${i}-${n}`,
350
- label: a,
357
+ id: `${s}-${i}-${r}`,
358
+ label: o,
351
359
  labelPlacement: "left",
352
360
  size: "sm",
353
- value: _[n] || "",
354
- onChange: (t) => M(i, n, t)
361
+ value: t[r] || "",
362
+ onChange: (l) => D(i, r, l)
355
363
  }
356
- ) }, n);
357
- }, $ = (i, n, a) => {
358
- const _ = m[i] ?? {}, y = `${i}.${n}`;
359
- return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": y, children: /* @__PURE__ */ r(
360
- De,
364
+ ) }, r);
365
+ }, j = (i, r, o) => {
366
+ const t = m[i] ?? {}, a = `${i}.${r}`;
367
+ return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": a, children: /* @__PURE__ */ n(
368
+ ze,
361
369
  {
362
- id: `${s}-${i}-${n}`,
363
- label: a,
370
+ id: `${s}-${i}-${r}`,
371
+ label: o,
364
372
  labelPlacement: "left",
365
373
  size: "sm",
366
- value: _[n] ?? 0,
367
- onChange: (t) => M(i, n, typeof t == "number" ? t : parseFloat(String(t)) || 0),
374
+ value: t[r] ?? 0,
375
+ onChange: (l) => D(i, r, typeof l == "number" ? l : parseFloat(String(l)) || 0),
368
376
  showStepper: !0
369
377
  }
370
- ) }, n);
371
- }, G = (i, n, a, _) => {
372
- const y = m[i], t = `${i}.${n}`, o = y?.[n] ?? "";
373
- return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": t, children: /* @__PURE__ */ r(
374
- Ae,
378
+ ) }, r);
379
+ }, q = (i, r, o, t) => {
380
+ const a = m[i], l = `${i}.${r}`, S = a?.[r] ?? "";
381
+ return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": l, children: /* @__PURE__ */ n(
382
+ Re,
375
383
  {
376
- id: `${s}-${i}-${n}`,
377
- label: a,
384
+ id: `${s}-${i}-${r}`,
385
+ label: o,
378
386
  labelPlacement: "left",
379
387
  size: "sm",
380
388
  clearable: !0,
381
- value: o,
382
- onChange: (c) => M(i, n, Array.isArray(c) ? c[0] ?? "" : c),
383
- options: _.map((c) => ({ value: c, label: c }))
389
+ value: S,
390
+ onChange: (_) => D(i, r, Array.isArray(_) ? _[0] ?? "" : _),
391
+ options: t.map((_) => ({ value: _, label: _ }))
384
392
  }
385
- ) }, n);
386
- }, Z = (i, n, a, _ = !0) => {
387
- const y = m[i] ?? "", t = String(i);
388
- return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": t, children: /* @__PURE__ */ r(
389
- Ae,
393
+ ) }, r);
394
+ }, _e = (i, r, o, t = !0) => {
395
+ const a = m[i] ?? "", l = String(i);
396
+ return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": l, children: /* @__PURE__ */ n(
397
+ Re,
390
398
  {
391
- id: `${s}-${t}`,
392
- label: n,
399
+ id: `${s}-${l}`,
400
+ label: r,
393
401
  labelPlacement: "left",
394
402
  size: "sm",
395
- clearable: _,
396
- value: y,
397
- onChange: (o) => {
398
- const c = Array.isArray(o) ? o[0] ?? "" : o;
399
- H({ [i]: c || void 0 });
403
+ clearable: t,
404
+ value: a,
405
+ onChange: (S) => {
406
+ const _ = Array.isArray(S) ? S[0] ?? "" : S;
407
+ W({ [i]: _ || void 0 });
400
408
  },
401
- options: a.map((o) => ({ value: o, label: o }))
409
+ options: o.map((S) => ({ value: S, label: S }))
402
410
  }
403
- ) }, t);
404
- }, oe = (i, n) => {
405
- const a = m[i] ?? "", _ = String(i);
406
- return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": _, children: /* @__PURE__ */ r(
407
- We,
411
+ ) }, l);
412
+ }, H = (i, r) => {
413
+ const o = m[i] ?? "", t = String(i);
414
+ return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": t, children: /* @__PURE__ */ n(
415
+ je,
408
416
  {
409
- id: `${s}-${_}`,
410
- label: n,
417
+ id: `${s}-${t}`,
418
+ label: r,
411
419
  labelPlacement: "left",
412
420
  size: "sm",
413
- value: a,
414
- onChange: (y) => H({ [i]: y || void 0 })
421
+ value: o,
422
+ onChange: (a) => W({ [i]: a || void 0 })
415
423
  }
416
- ) }, _);
417
- }, Pe = (i, n, a, _ = 0, y = 1, t = 0.05) => {
418
- const o = m[i], c = `${i}.${n}`, L = o?.[n] ?? y;
419
- return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": c, children: /* @__PURE__ */ r(
420
- De,
424
+ ) }, t);
425
+ }, se = (i, r, o, t = 0, a = 1, l = 0.05) => {
426
+ const S = m[i], _ = `${i}.${r}`, f = S?.[r] ?? a;
427
+ return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": _, children: /* @__PURE__ */ n(
428
+ ze,
421
429
  {
422
- id: `${s}-${i}-${n}`,
423
- label: a,
430
+ id: `${s}-${i}-${r}`,
431
+ label: o,
424
432
  labelPlacement: "left",
425
433
  size: "sm",
426
- min: _,
427
- max: y,
428
- step: t,
434
+ min: t,
435
+ max: a,
436
+ step: l,
429
437
  precision: 2,
430
- value: Number(L),
431
- onChange: (k) => M(i, n, typeof k == "number" ? k : parseFloat(String(k)) || 0),
438
+ value: Number(f),
439
+ onChange: (v) => D(i, r, typeof v == "number" ? v : parseFloat(String(v)) || 0),
432
440
  showStepper: !0
433
441
  }
434
- ) }, n);
435
- }, [F, le] = E("sidebar"), A = m.nesting?.[F] ?? {}, Fe = Math.max(1, Math.min(10, A.levels ?? 5)), q = f(
436
- (i, n) => {
437
- B(
438
- (a) => ({
439
- ...a,
442
+ ) }, r);
443
+ }, [F, Ae] = O("sidebar"), Q = m.nesting?.[F] ?? {}, Fe = Math.max(1, Math.min(10, Q.levels ?? 5)), A = y(
444
+ (i, r) => {
445
+ R(
446
+ (o) => ({
447
+ ...o,
440
448
  nesting: {
441
- ...a.nesting ?? {},
442
- [i]: { ...(a.nesting ?? {})[i] ?? {}, ...n }
449
+ ...o.nesting ?? {},
450
+ [i]: { ...(o.nesting ?? {})[i] ?? {}, ...r }
443
451
  }
444
452
  }),
445
- `nesting.${i}.${Object.keys(n).join(",")}`
453
+ `nesting.${i}.${Object.keys(r).join(",")}`
446
454
  );
447
455
  },
448
- [B]
449
- ), Le = f(
450
- (i, n, a) => {
451
- const y = { ...((m.nesting ?? {})[i] ?? {}).overrides ?? {} };
452
- a === null ? delete y[n] : y[n] = { ...y[n] ?? {}, ...a }, q(i, { overrides: y });
456
+ [R]
457
+ ), le = y(
458
+ (i, r, o) => {
459
+ const a = { ...((m.nesting ?? {})[i] ?? {}).overrides ?? {} };
460
+ o === null ? delete a[r] : a[r] = { ...a[r] ?? {}, ...o }, A(i, { overrides: a });
453
461
  },
454
- [m.nesting, q]
455
- ), ce = () => {
462
+ [m.nesting, A]
463
+ ), Me = () => {
456
464
  const i = [
457
465
  { key: "background", label: e("theme.background", "Background") },
458
466
  { key: "text", label: e("theme.text", "Text") },
@@ -460,17 +468,17 @@ function xt({
460
468
  { key: "activeBackground", label: e("theme.activeBg", "Active bg") },
461
469
  { key: "border", label: e("theme.border", "Border") }
462
470
  ];
463
- return /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
464
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ r(
465
- Ae,
471
+ return /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
472
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
473
+ Re,
466
474
  {
467
475
  label: e("theme.nestingSurface", "Surface"),
468
476
  labelPlacement: "left",
469
477
  size: "sm",
470
478
  value: F,
471
- onChange: (n) => {
472
- const a = Array.isArray(n) ? n[0] : n;
473
- (a === "sidebar" || a === "menu" || a === "tree") && le(a);
479
+ onChange: (r) => {
480
+ const o = Array.isArray(r) ? r[0] : r;
481
+ (o === "sidebar" || o === "menu" || o === "tree") && Ae(o);
474
482
  },
475
483
  options: [
476
484
  { value: "sidebar", label: e("theme.sidebar", "Sidebar") },
@@ -479,8 +487,8 @@ function xt({
479
487
  ]
480
488
  }
481
489
  ) }),
482
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ r(
483
- De,
490
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
491
+ ze,
484
492
  {
485
493
  label: e("theme.nestingLevels", "Levels"),
486
494
  labelPlacement: "left",
@@ -490,23 +498,23 @@ function xt({
490
498
  step: 1,
491
499
  precision: 0,
492
500
  value: Fe,
493
- onChange: (n) => {
494
- const a = typeof n == "number" ? n : Number(n);
495
- Number.isFinite(a) && q(F, { levels: Math.max(1, Math.min(10, Math.round(a))) });
501
+ onChange: (r) => {
502
+ const o = typeof r == "number" ? r : Number(r);
503
+ Number.isFinite(o) && A(F, { levels: Math.max(1, Math.min(10, Math.round(o))) });
496
504
  },
497
505
  showStepper: !0
498
506
  }
499
507
  ) }),
500
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ r(
501
- Ae,
508
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
509
+ Re,
502
510
  {
503
511
  label: e("theme.nestingDerivation", "Bg derivation"),
504
512
  labelPlacement: "left",
505
513
  size: "sm",
506
- value: A.bgDerivation ?? "tint",
507
- onChange: (n) => {
508
- const a = Array.isArray(n) ? n[0] : n;
509
- (a === "tint" || a === "shade" || a === "mix-surface" || a === "palette") && q(F, { bgDerivation: a });
514
+ value: Q.bgDerivation ?? "tint",
515
+ onChange: (r) => {
516
+ const o = Array.isArray(r) ? r[0] : r;
517
+ (o === "tint" || o === "shade" || o === "mix-surface" || o === "palette") && A(F, { bgDerivation: o });
510
518
  },
511
519
  options: [
512
520
  {
@@ -522,8 +530,8 @@ function xt({
522
530
  ]
523
531
  }
524
532
  ) }),
525
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ r(
526
- De,
533
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
534
+ ze,
527
535
  {
528
536
  label: e("theme.nestingStep", "Step"),
529
537
  labelPlacement: "left",
@@ -532,21 +540,21 @@ function xt({
532
540
  max: 0.5,
533
541
  step: 0.02,
534
542
  precision: 2,
535
- value: A.bgStep ?? 0.06,
536
- onChange: (n) => {
537
- const a = typeof n == "number" ? n : Number(n);
538
- Number.isFinite(a) && q(F, { bgStep: Math.max(0, Math.min(0.5, a)) });
543
+ value: Q.bgStep ?? 0.06,
544
+ onChange: (r) => {
545
+ const o = typeof r == "number" ? r : Number(r);
546
+ Number.isFinite(o) && A(F, { bgStep: Math.max(0, Math.min(0.5, o)) });
539
547
  },
540
548
  showStepper: !0
541
549
  }
542
550
  ) }),
543
- /* @__PURE__ */ h("div", { className: "nice-theme-builder__field", style: { gridColumn: "1 / -1" }, children: [
544
- /* @__PURE__ */ r("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: e("theme.nestingPalette", "Base palette") }),
545
- /* @__PURE__ */ r(
551
+ /* @__PURE__ */ u("div", { className: "nice-theme-builder__field", style: { gridColumn: "1 / -1" }, children: [
552
+ /* @__PURE__ */ n("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: e("theme.nestingPalette", "Base palette") }),
553
+ /* @__PURE__ */ n(
546
554
  ft,
547
555
  {
548
- value: A.palette ?? [],
549
- onChange: (n) => q(F, { palette: n }),
556
+ value: Q.palette ?? [],
557
+ onChange: (r) => A(F, { palette: r }),
550
558
  minColors: 1,
551
559
  maxColors: 10,
552
560
  showWheel: !0,
@@ -557,8 +565,8 @@ function xt({
557
565
  }
558
566
  )
559
567
  ] }),
560
- /* @__PURE__ */ h("details", { className: "nice-theme-builder__field", style: { gridColumn: "1 / -1" }, children: [
561
- /* @__PURE__ */ r(
568
+ /* @__PURE__ */ u("details", { className: "nice-theme-builder__field", style: { gridColumn: "1 / -1" }, children: [
569
+ /* @__PURE__ */ n(
562
570
  "summary",
563
571
  {
564
572
  style: {
@@ -570,9 +578,9 @@ function xt({
570
578
  children: e("theme.nestingOverrides", "Per-level overrides")
571
579
  }
572
580
  ),
573
- /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 8, marginTop: 8 }, children: Array.from({ length: Fe }, (n, a) => a + 1).map((n) => {
574
- const a = A.overrides?.[n] ?? {}, _ = Object.keys(a).length > 0;
575
- return /* @__PURE__ */ h(
581
+ /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 8, marginTop: 8 }, children: Array.from({ length: Fe }, (r, o) => o + 1).map((r) => {
582
+ const o = Q.overrides?.[r] ?? {}, t = Object.keys(o).length > 0;
583
+ return /* @__PURE__ */ u(
576
584
  "div",
577
585
  {
578
586
  style: {
@@ -584,220 +592,289 @@ function xt({
584
592
  gap: 6
585
593
  },
586
594
  children: [
587
- /* @__PURE__ */ h("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
588
- /* @__PURE__ */ r("strong", { style: { flex: 1 }, children: e("theme.level", "Level {level}").replace("{level}", String(n)) }),
589
- _ && /* @__PURE__ */ r(
595
+ /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
596
+ /* @__PURE__ */ n("strong", { style: { flex: 1 }, children: e("theme.level", "Level {level}").replace("{level}", String(r)) }),
597
+ t && /* @__PURE__ */ n(
590
598
  "button",
591
599
  {
592
600
  type: "button",
593
601
  className: "nice-btn nice-btn--outline nice-btn--xs",
594
- onClick: () => Le(F, n, null),
602
+ onClick: () => le(F, r, null),
595
603
  children: e("themeBuilder.resetToDerived", "Reset to derived")
596
604
  }
597
605
  )
598
606
  ] }),
599
- /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: i.map((y) => /* @__PURE__ */ r(
600
- Xe,
607
+ /* @__PURE__ */ n("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: i.map((a) => /* @__PURE__ */ n(
608
+ yt,
601
609
  {
602
- label: y.label,
610
+ label: a.label,
603
611
  labelPlacement: "left",
604
612
  size: "sm",
605
- value: a[y.key] ?? "",
606
- onChange: (t) => Le(F, n, { [y.key]: t })
613
+ value: o[a.key] ?? "",
614
+ onChange: (l) => le(F, r, { [a.key]: l })
607
615
  },
608
- y.key
616
+ a.key
609
617
  )) })
610
618
  ]
611
619
  },
612
- n
620
+ r
613
621
  );
614
622
  }) })
615
623
  ] })
616
624
  ] });
617
- }, Se = {
618
- general: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
619
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": "name", children: /* @__PURE__ */ r(
620
- We,
625
+ }, Oe = {
626
+ general: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
627
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": "name", children: /* @__PURE__ */ n(
628
+ je,
621
629
  {
622
630
  id: `${s}-name`,
623
631
  label: e("theme.name", "Theme Name"),
624
632
  labelPlacement: "left",
625
633
  size: "sm",
626
634
  value: m.name ?? "",
627
- onChange: (i) => H({ name: i })
635
+ onChange: (i) => W({ name: i })
628
636
  }
629
637
  ) }, "name"),
630
- oe("darkThemeName", e("theme.darkThemeName", "Paired Dark Theme Name")),
631
- Z("darkMode", e("theme.darkMode", "Dark Mode"), [
638
+ H("darkThemeName", e("theme.darkThemeName", "Paired Dark Theme Name")),
639
+ _e("darkMode", e("theme.darkMode", "Dark Mode"), [
632
640
  "light",
633
641
  "dark",
634
642
  "auto"
635
643
  ]),
636
- Z(
644
+ _e(
637
645
  "recommendedDisplayStyle",
638
646
  e("theme.recommendedDisplayStyle", "Recommended Display Style"),
639
647
  ut
640
648
  )
641
649
  ] }),
642
- colors: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
643
- b("colors", "primary", e("theme.primary", "Primary")),
644
- b("colors", "primaryHover", e("theme.primaryHover", "Primary Hover")),
645
- b("colors", "accent", e("theme.accent", "Accent")),
646
- b("colors", "accentHover", e("theme.accentHover", "Accent Hover")),
647
- b("colors", "success", e("theme.success", "Success")),
648
- b("colors", "warning", e("theme.warning", "Warning")),
649
- b("colors", "error", e("theme.error", "Error")),
650
- b("colors", "info", e("theme.info", "Info")),
651
- b("colors", "link", e("theme.link", "Link")),
652
- b("colors", "linkHover", e("theme.linkHover", "Link Hover")),
653
- b("colors", "focus", e("theme.focus", "Focus Ring")),
654
- b("colors", "overlay", e("theme.overlay", "Overlay / Backdrop")),
655
- b("colors", "surface", e("theme.surface", "Surface")),
656
- b("colors", "surfaceHover", e("theme.surfaceHover", "Surface Hover")),
657
- b("colors", "disabled", e("theme.disabled", "Disabled")),
658
- b("colors", "disabledText", e("theme.disabledText", "Disabled Text"))
650
+ colors: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
651
+ d("colors", "primary", e("theme.primary", "Primary")),
652
+ d("colors", "primaryHover", e("theme.primaryHover", "Primary Hover")),
653
+ d("colors", "accent", e("theme.accent", "Accent")),
654
+ d("colors", "accentHover", e("theme.accentHover", "Accent Hover")),
655
+ d("colors", "success", e("theme.success", "Success")),
656
+ d("colors", "warning", e("theme.warning", "Warning")),
657
+ d("colors", "error", e("theme.error", "Error")),
658
+ d("colors", "info", e("theme.info", "Info")),
659
+ d("colors", "link", e("theme.link", "Link")),
660
+ d("colors", "linkHover", e("theme.linkHover", "Link Hover")),
661
+ d("colors", "focus", e("theme.focus", "Focus Ring")),
662
+ d("colors", "overlay", e("theme.overlay", "Overlay / Backdrop")),
663
+ d("colors", "surface", e("theme.surface", "Surface")),
664
+ d("colors", "surfaceHover", e("theme.surfaceHover", "Surface Hover")),
665
+ d("colors", "disabled", e("theme.disabled", "Disabled")),
666
+ d("colors", "disabledText", e("theme.disabledText", "Disabled Text"))
659
667
  ] }),
660
- backgrounds: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
661
- b("backgrounds", "primary", e("theme.bgPrimary", "Primary Background")),
662
- b(
668
+ backgrounds: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
669
+ d("backgrounds", "primary", e("theme.bgPrimary", "Primary Background")),
670
+ d(
663
671
  "backgrounds",
664
672
  "secondary",
665
673
  e("theme.bgSecondary", "Secondary Background")
666
674
  ),
667
- b("backgrounds", "tertiary", e("theme.bgTertiary", "Tertiary Background")),
668
- b("backgrounds", "hover", e("theme.bgHover", "Hover Background")),
669
- b("backgrounds", "elevated", e("theme.bgElevated", "Elevated Surface")),
670
- b("backgrounds", "inset", e("theme.bgInset", "Inset Surface")),
671
- b("backgrounds", "canvas", e("theme.bgCanvas", "Canvas / Body"))
675
+ d("backgrounds", "tertiary", e("theme.bgTertiary", "Tertiary Background")),
676
+ d("backgrounds", "hover", e("theme.bgHover", "Hover Background")),
677
+ d("backgrounds", "elevated", e("theme.bgElevated", "Elevated Surface")),
678
+ d("backgrounds", "inset", e("theme.bgInset", "Inset Surface")),
679
+ d("backgrounds", "canvas", e("theme.bgCanvas", "Canvas / Body"))
672
680
  ] }),
673
- "background-image": () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
674
- G("backgroundImage", "type", e("theme.bgiType", "Background Type"), [
681
+ "background-image": () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
682
+ q("backgroundImage", "type", e("theme.bgiType", "Background Type"), [
675
683
  "none",
676
684
  "solid",
677
685
  "gradient",
678
686
  "image",
679
687
  "pattern"
680
688
  ]),
681
- l(
689
+ c(
682
690
  "backgroundImage",
683
691
  "gradient",
684
692
  e("theme.bgiGradient", "CSS Gradient")
685
693
  ),
686
- l(
694
+ c(
687
695
  "backgroundImage",
688
696
  "imageUrl",
689
697
  e("theme.bgiImageUrl", "Image URL")
690
698
  ),
691
- l(
699
+ c(
692
700
  "backgroundImage",
693
701
  "imageSize",
694
702
  e("theme.bgiImageSize", "Image Size (cover/contain/…)")
695
703
  ),
696
- l(
704
+ c(
697
705
  "backgroundImage",
698
706
  "imagePosition",
699
707
  e("theme.bgiImagePosition", "Image Position")
700
708
  ),
701
- G(
709
+ q(
702
710
  "backgroundImage",
703
711
  "imageAttachment",
704
712
  e("theme.bgiImageAttachment", "Image Attachment"),
705
713
  ["scroll", "fixed", "local"]
706
714
  ),
707
- G(
715
+ q(
708
716
  "backgroundImage",
709
717
  "imageRepeat",
710
718
  e("theme.bgiImageRepeat", "Image Repeat"),
711
719
  ["repeat", "no-repeat", "repeat-x", "repeat-y"]
712
720
  ),
713
- l(
721
+ c(
714
722
  "backgroundImage",
715
723
  "pattern",
716
724
  e("theme.bgiPattern", "Named Pattern (dots/grid/…)")
717
725
  ),
718
- Pe("backgroundImage", "opacity", e("theme.bgiOpacity", "Pattern Opacity")),
719
- l(
726
+ se("backgroundImage", "opacity", e("theme.bgiOpacity", "Pattern Opacity")),
727
+ c(
720
728
  "backgroundImage",
721
729
  "blendMode",
722
730
  e("theme.bgiBlendMode", "Blend Mode")
723
731
  )
724
732
  ] }),
725
- text: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
726
- b("text", "primary", e("theme.textPrimary", "Primary Text")),
727
- b("text", "secondary", e("theme.textSecondary", "Secondary Text")),
728
- b("text", "muted", e("theme.textMuted", "Muted Text")),
729
- b("text", "inverse", e("theme.textInverse", "Inverse Text")),
730
- b("text", "onPrimary", e("theme.textOnPrimary", "Text on Primary")),
731
- b("text", "onAccent", e("theme.textOnAccent", "Text on Accent"))
733
+ text: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
734
+ d("text", "primary", e("theme.textPrimary", "Primary Text")),
735
+ d("text", "secondary", e("theme.textSecondary", "Secondary Text")),
736
+ d("text", "muted", e("theme.textMuted", "Muted Text")),
737
+ d("text", "inverse", e("theme.textInverse", "Inverse Text")),
738
+ d("text", "onPrimary", e("theme.textOnPrimary", "Text on Primary")),
739
+ d("text", "onAccent", e("theme.textOnAccent", "Text on Accent"))
732
740
  ] }),
733
- borders: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
734
- b("borders", "color", e("theme.borderColor", "Border Color")),
735
- b("borders", "focusColor", e("theme.borderFocus", "Focus Border Color")),
736
- b("borders", "divider", e("theme.borderDivider", "Divider Color")),
737
- l("borders", "width", e("theme.borderWidth", "Border Width")),
738
- l("borders", "radiusSm", e("theme.radiusSm", "Radius Small")),
739
- l("borders", "radiusMd", e("theme.radiusMd", "Radius Medium")),
740
- l("borders", "radiusLg", e("theme.radiusLg", "Radius Large")),
741
- l("borders", "radiusXl", e("theme.radiusXl", "Radius XL")),
742
- l("borders", "radiusFull", e("theme.radiusFull", "Radius Full"))
741
+ borders: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
742
+ d("borders", "color", e("theme.borderColor", "Border Color")),
743
+ d("borders", "focusColor", e("theme.borderFocus", "Focus Border Color")),
744
+ d("borders", "divider", e("theme.borderDivider", "Divider Color")),
745
+ c("borders", "width", e("theme.borderWidth", "Border Width")),
746
+ c("borders", "radiusSm", e("theme.radiusSm", "Radius Small")),
747
+ c("borders", "radiusMd", e("theme.radiusMd", "Radius Medium")),
748
+ c("borders", "radiusLg", e("theme.radiusLg", "Radius Large")),
749
+ c("borders", "radiusXl", e("theme.radiusXl", "Radius XL")),
750
+ c("borders", "radiusFull", e("theme.radiusFull", "Radius Full"))
743
751
  ] }),
744
- spacing: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
745
- l("spacing", "space1", "Space 1"),
746
- l("spacing", "space2", "Space 2"),
747
- l("spacing", "space3", "Space 3"),
748
- l("spacing", "space4", "Space 4"),
749
- l("spacing", "space5", "Space 5"),
750
- l("spacing", "space6", "Space 6"),
751
- l("spacing", "space8", "Space 8"),
752
- l("spacing", "space10", "Space 10"),
753
- l("spacing", "space12", "Space 12"),
754
- l("spacing", "space16", "Space 16")
752
+ spacing: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
753
+ c("spacing", "space1", "Space 1"),
754
+ c("spacing", "space2", "Space 2"),
755
+ c("spacing", "space3", "Space 3"),
756
+ c("spacing", "space4", "Space 4"),
757
+ c("spacing", "space5", "Space 5"),
758
+ c("spacing", "space6", "Space 6"),
759
+ c("spacing", "space8", "Space 8"),
760
+ c("spacing", "space10", "Space 10"),
761
+ c("spacing", "space12", "Space 12"),
762
+ c("spacing", "space16", "Space 16")
755
763
  ] }),
756
- typography: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
757
- l("typography", "fontFamily", e("theme.fontFamily", "Body Font Family")),
758
- l(
764
+ typography: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
765
+ c("typography", "fontFamily", e("theme.fontFamily", "Body Font Family")),
766
+ c(
759
767
  "typography",
760
768
  "headingFontFamily",
761
769
  e("theme.headingFontFamily", "Heading Font Family")
762
770
  ),
763
- l(
771
+ c(
764
772
  "typography",
765
773
  "monoFontFamily",
766
774
  e("theme.monoFontFamily", "Monospace Font Family")
767
775
  ),
768
- l("typography", "fontSizeXs", "Font Size XS"),
769
- l("typography", "fontSizeSm", "Font Size SM"),
770
- l("typography", "fontSizeMd", "Font Size MD"),
771
- l("typography", "fontSizeLg", "Font Size LG"),
772
- l("typography", "fontSizeXl", "Font Size XL"),
773
- l("typography", "fontSize2xl", "Font Size 2XL"),
774
- l("typography", "fontSize3xl", "Font Size 3XL"),
775
- $("typography", "fontWeightNormal", "Weight Normal"),
776
- $("typography", "fontWeightMedium", "Weight Medium"),
777
- $("typography", "fontWeightSemibold", "Weight Semibold"),
778
- $("typography", "fontWeightBold", "Weight Bold"),
779
- $("typography", "lineHeight", "Line Height"),
780
- l("typography", "letterSpacing", e("theme.letterSpacing", "Letter Spacing")),
781
- l(
776
+ c("typography", "fontSizeXs", "Font Size XS"),
777
+ c("typography", "fontSizeSm", "Font Size SM"),
778
+ c("typography", "fontSizeMd", "Font Size MD"),
779
+ c("typography", "fontSizeLg", "Font Size LG"),
780
+ c("typography", "fontSizeXl", "Font Size XL"),
781
+ c("typography", "fontSize2xl", "Font Size 2XL"),
782
+ c("typography", "fontSize3xl", "Font Size 3XL"),
783
+ j("typography", "fontWeightNormal", "Weight Normal"),
784
+ j("typography", "fontWeightMedium", "Weight Medium"),
785
+ j("typography", "fontWeightSemibold", "Weight Semibold"),
786
+ j("typography", "fontWeightBold", "Weight Bold"),
787
+ j("typography", "lineHeight", "Line Height"),
788
+ c("typography", "letterSpacing", e("theme.letterSpacing", "Letter Spacing")),
789
+ c(
782
790
  "typography",
783
791
  "headingLetterSpacing",
784
792
  e("theme.headingLetterSpacing", "Heading Letter Spacing")
785
793
  )
786
794
  ] }),
787
- shadows: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
788
- l("shadows", "sm", "Shadow SM"),
789
- l("shadows", "md", "Shadow MD"),
790
- l("shadows", "lg", "Shadow LG"),
791
- l("shadows", "xl", "Shadow XL"),
792
- l("shadows", "inner", e("theme.shadowInner", "Inner Shadow")),
793
- l("shadows", "glow", e("theme.shadowGlow", "Glow Shadow"))
795
+ shadows: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
796
+ c("shadows", "sm", "Shadow SM"),
797
+ c("shadows", "md", "Shadow MD"),
798
+ c("shadows", "lg", "Shadow LG"),
799
+ c("shadows", "xl", "Shadow XL"),
800
+ c("shadows", "inner", e("theme.shadowInner", "Inner Shadow")),
801
+ c("shadows", "glow", e("theme.shadowGlow", "Glow Shadow"))
794
802
  ] }),
795
- transitions: () => /* @__PURE__ */ h("div", { className: "nice-theme-builder__grid", children: [
796
- l("transitions", "fast", e("theme.transitionFast", "Transition Fast")),
797
- l("transitions", "normal", e("theme.transitionNormal", "Transition Normal")),
798
- l("transitions", "slow", e("theme.transitionSlow", "Transition Slow"))
803
+ transitions: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
804
+ c("transitions", "fast", e("theme.transitionFast", "Transition Fast")),
805
+ c("transitions", "normal", e("theme.transitionNormal", "Transition Normal")),
806
+ c("transitions", "slow", e("theme.transitionSlow", "Transition Slow"))
807
+ ] }),
808
+ nesting: () => Me(),
809
+ palette: () => /* @__PURE__ */ n(Tt, { id: `${s}-palette`, theme: m, edit: V }),
810
+ layout: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__layout", children: [
811
+ /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
812
+ x("layout.body.background", e("theme.layoutBody", "Body"), "surface"),
813
+ x("layout.body.text", e("theme.layoutBodyText", "Body text")),
814
+ x("layout.panel.background", e("theme.layoutPanel", "Panel"), "surface"),
815
+ x("layout.panel.text", e("theme.layoutPanelText", "Panel text")),
816
+ x("layout.panel.border", e("theme.layoutPanelBorder", "Panel border")),
817
+ x(
818
+ "layout.topNav.background",
819
+ e("theme.layoutTopNav", "Top bar"),
820
+ "surface"
821
+ ),
822
+ x("layout.topNav.text", e("theme.layoutTopNavText", "Top bar text")),
823
+ x(
824
+ "layout.topNav.border",
825
+ e("theme.layoutTopNavBorder", "Top bar border")
826
+ ),
827
+ x(
828
+ "layout.sideNav.background",
829
+ e("theme.layoutSideNav", "Sidebar"),
830
+ "surface"
831
+ ),
832
+ x("layout.sideNav.text", e("theme.layoutSideNavText", "Sidebar text")),
833
+ x(
834
+ "layout.sideNav.border",
835
+ e("theme.layoutSideNavBorder", "Sidebar border")
836
+ ),
837
+ x(
838
+ "layout.sideNav.items.background",
839
+ e("theme.layoutItems", "Sidebar items (leaves)")
840
+ ),
841
+ x(
842
+ "layout.sideNav.items.text",
843
+ e("theme.layoutItemsText", "Sidebar items text")
844
+ )
845
+ ] }),
846
+ /* @__PURE__ */ n(
847
+ Xe,
848
+ {
849
+ id: `${s}-headers`,
850
+ label: e("theme.layoutHeaders", "Sidebar header levels"),
851
+ which: "headers",
852
+ theme: m,
853
+ edit: V,
854
+ onGoTo: B
855
+ }
856
+ ),
857
+ /* @__PURE__ */ n(
858
+ Xe,
859
+ {
860
+ id: `${s}-highlight`,
861
+ label: e("theme.layoutHighlight", "Active item and its branch"),
862
+ which: "highlight",
863
+ theme: m,
864
+ edit: V,
865
+ onGoTo: B
866
+ }
867
+ )
799
868
  ] }),
800
- nesting: () => ce()
869
+ scrollbar: () => /* @__PURE__ */ n(
870
+ wt,
871
+ {
872
+ id: `${s}-scrollbar`,
873
+ theme: m,
874
+ edit: V,
875
+ onGoTo: B
876
+ }
877
+ )
801
878
  }, Ee = {
802
879
  general: e("theme.general", "General"),
803
880
  colors: e("theme.colors", "Colors"),
@@ -809,56 +886,59 @@ function xt({
809
886
  typography: e("theme.typography", "Typography"),
810
887
  shadows: e("theme.shadows", "Shadows"),
811
888
  transitions: e("theme.transitions", "Transitions"),
812
- nesting: e("theme.nesting", "Nesting")
813
- }, ze = e("theme.undo", "Undo"), Re = e("theme.redo", "Redo");
814
- return /* @__PURE__ */ h(Ye, { children: [
815
- /* @__PURE__ */ h("div", { className: "nice-theme-builder__main", ref: x, children: [
816
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__header", children: /* @__PURE__ */ h("div", { className: "nice-theme-builder__header-row", children: [
817
- /* @__PURE__ */ h("div", { className: "nice-theme-builder__crumbs", children: [
818
- /* @__PURE__ */ h(
889
+ nesting: e("theme.nesting", "Nesting"),
890
+ palette: e("theme.paletteSection", "Palette"),
891
+ layout: e("theme.layoutSection", "Layout"),
892
+ scrollbar: e("theme.scrollbarSection", "Scrollbar")
893
+ }, Ie = e("theme.undo", "Undo"), Le = e("theme.redo", "Redo");
894
+ return /* @__PURE__ */ u(Ye, { children: [
895
+ /* @__PURE__ */ u("div", { className: "nice-theme-builder__main", ref: $e, children: [
896
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__header", children: /* @__PURE__ */ u("div", { className: "nice-theme-builder__header-row", children: [
897
+ /* @__PURE__ */ u("div", { className: "nice-theme-builder__crumbs", children: [
898
+ /* @__PURE__ */ u(
819
899
  "button",
820
900
  {
821
901
  type: "button",
822
902
  className: "nice-theme-builder__btn",
823
- onClick: se,
903
+ onClick: C,
824
904
  title: e("theme.back", "Back to themes"),
825
905
  children: [
826
- /* @__PURE__ */ r(I, { name: "arrow-left", size: "sm" }),
906
+ /* @__PURE__ */ n($, { name: "arrow-left", size: "sm" }),
827
907
  e("theme.themes", "Themes")
828
908
  ]
829
909
  }
830
910
  ),
831
- /* @__PURE__ */ r("span", { className: "nice-theme-builder__crumb", children: T }),
832
- /* @__PURE__ */ r(I, { name: "chevron-right", size: "sm" }),
833
- /* @__PURE__ */ r("strong", { className: "nice-theme-builder__crumb nice-theme-builder__crumb--current", children: m.name?.trim() || e("theme.untitled", "Untitled") }),
834
- X && /* @__PURE__ */ r("span", { className: "nice-theme-builder__dirty", children: e("theme.unsaved", "Unsaved changes") })
911
+ /* @__PURE__ */ n("span", { className: "nice-theme-builder__crumb", children: T }),
912
+ /* @__PURE__ */ n($, { name: "chevron-right", size: "sm" }),
913
+ /* @__PURE__ */ n("strong", { className: "nice-theme-builder__crumb nice-theme-builder__crumb--current", children: m.name?.trim() || e("theme.untitled", "Untitled") }),
914
+ X && /* @__PURE__ */ n("span", { className: "nice-theme-builder__dirty", children: e("theme.unsaved", "Unsaved changes") })
835
915
  ] }),
836
- /* @__PURE__ */ h("div", { className: "nice-theme-builder__toolbar", children: [
837
- /* @__PURE__ */ r(
916
+ /* @__PURE__ */ u("div", { className: "nice-theme-builder__toolbar", children: [
917
+ /* @__PURE__ */ n(
838
918
  "button",
839
919
  {
840
920
  type: "button",
841
921
  className: "nice-theme-builder__btn",
842
922
  onClick: te,
843
923
  disabled: !Be,
844
- "aria-label": ze,
845
- title: `${ze} (Ctrl+Z)`,
846
- children: /* @__PURE__ */ r(I, { name: "undo", size: "sm" })
924
+ "aria-label": Ie,
925
+ title: `${Ie} (Ctrl+Z)`,
926
+ children: /* @__PURE__ */ n($, { name: "undo", size: "sm" })
847
927
  }
848
928
  ),
849
- /* @__PURE__ */ r(
929
+ /* @__PURE__ */ n(
850
930
  "button",
851
931
  {
852
932
  type: "button",
853
933
  className: "nice-theme-builder__btn",
854
- onClick: ue,
855
- disabled: !Me,
856
- "aria-label": Re,
857
- title: `${Re} (Ctrl+Y)`,
858
- children: /* @__PURE__ */ r(I, { name: "redo", size: "sm" })
934
+ onClick: he,
935
+ disabled: !De,
936
+ "aria-label": Le,
937
+ title: `${Le} (Ctrl+Y)`,
938
+ children: /* @__PURE__ */ n($, { name: "redo", size: "sm" })
859
939
  }
860
940
  ),
861
- u && /* @__PURE__ */ h(
941
+ p && /* @__PURE__ */ u(
862
942
  "button",
863
943
  {
864
944
  type: "button",
@@ -866,124 +946,124 @@ function xt({
866
946
  onClick: ve,
867
947
  disabled: !X,
868
948
  children: [
869
- /* @__PURE__ */ r(I, { name: "save", size: "sm" }),
949
+ /* @__PURE__ */ n($, { name: "save", size: "sm" }),
870
950
  e("theme.save", "Save")
871
951
  ]
872
952
  }
873
953
  ),
874
- /* @__PURE__ */ h("button", { type: "button", className: "nice-theme-builder__btn", onClick: _e, children: [
875
- /* @__PURE__ */ r(I, { name: "copy", size: "sm" }),
954
+ /* @__PURE__ */ u("button", { type: "button", className: "nice-theme-builder__btn", onClick: Ce, children: [
955
+ /* @__PURE__ */ n($, { name: "copy", size: "sm" }),
876
956
  e("theme.saveCopy", "Save as copy")
877
957
  ] }),
878
- /* @__PURE__ */ r(
958
+ /* @__PURE__ */ n(
879
959
  "button",
880
960
  {
881
961
  type: "button",
882
962
  className: "nice-theme-builder__btn",
883
- onClick: Ie,
963
+ onClick: oe,
884
964
  disabled: !X,
885
965
  children: e("theme.discard", "Discard changes")
886
966
  }
887
967
  ),
888
- /* @__PURE__ */ h(
968
+ /* @__PURE__ */ u(
889
969
  "button",
890
970
  {
891
971
  type: "button",
892
972
  className: "nice-theme-builder__btn",
893
- onClick: () => fe.current?.click(),
973
+ onClick: () => ge.current?.click(),
894
974
  title: e("theme.import", "Import"),
895
975
  children: [
896
- /* @__PURE__ */ r(I, { name: "upload", size: "sm" }),
976
+ /* @__PURE__ */ n($, { name: "upload", size: "sm" }),
897
977
  e("theme.import", "Import")
898
978
  ]
899
979
  }
900
980
  ),
901
- /* @__PURE__ */ r(
981
+ /* @__PURE__ */ n(
902
982
  "input",
903
983
  {
904
- ref: fe,
984
+ ref: ge,
905
985
  type: "file",
906
986
  accept: "application/json,.json",
907
987
  style: { display: "none" },
908
- onChange: $e
988
+ onChange: ae
909
989
  }
910
990
  ),
911
- /* @__PURE__ */ r(it, { showPreview: N, onToggle: w })
991
+ /* @__PURE__ */ n(at, { showPreview: N, onToggle: w })
912
992
  ] })
913
993
  ] }) }),
914
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__tabs", ref: ke, role: "tablist", children: z.map((i) => /* @__PURE__ */ r(
994
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__tabs", ref: Te, role: "tablist", children: I.map((i) => /* @__PURE__ */ n(
915
995
  "button",
916
996
  {
917
997
  type: "button",
918
998
  role: "tab",
919
- "aria-selected": i === pe,
920
- className: `nice-theme-builder__tab${i === pe ? " nice-theme-builder__tab--active" : ""}`,
921
- onClick: () => be(i),
999
+ "aria-selected": i === ue,
1000
+ className: `nice-theme-builder__tab${i === ue ? " nice-theme-builder__tab--active" : ""}`,
1001
+ onClick: () => pe(i),
922
1002
  children: Ee[i]
923
1003
  },
924
1004
  i
925
1005
  )) }),
926
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__body", role: "tabpanel", ref: ge, children: Se[pe]?.() }),
927
- /* @__PURE__ */ h("details", { className: "nice-theme-builder__preview", children: [
928
- /* @__PURE__ */ r("summary", { className: "nice-theme-builder__preview-toggle", children: e("theme.preview", "CSS Variables Preview") }),
929
- /* @__PURE__ */ r("pre", { className: "nice-theme-builder__preview-code", children: `:root {
930
- ${Oe}
1006
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__body", role: "tabpanel", ref: be, children: Oe[ue]?.() }),
1007
+ /* @__PURE__ */ u("details", { className: "nice-theme-builder__preview", children: [
1008
+ /* @__PURE__ */ n("summary", { className: "nice-theme-builder__preview-toggle", children: e("theme.preview", "CSS Variables Preview") }),
1009
+ /* @__PURE__ */ n("pre", { className: "nice-theme-builder__preview-code", children: `:root {
1010
+ ${Pe}
931
1011
  }` })
932
1012
  ] }),
933
- /* @__PURE__ */ h("div", { className: "nice-theme-builder__actions", children: [
934
- /* @__PURE__ */ h(
1013
+ /* @__PURE__ */ u("div", { className: "nice-theme-builder__actions", children: [
1014
+ /* @__PURE__ */ u(
935
1015
  "button",
936
1016
  {
937
1017
  type: "button",
938
1018
  className: "nice-theme-builder__btn nice-theme-builder__btn--apply",
939
1019
  onClick: ie,
940
1020
  children: [
941
- /* @__PURE__ */ r(I, { name: "check", size: "sm" }),
1021
+ /* @__PURE__ */ n($, { name: "check", size: "sm" }),
942
1022
  e("theme.apply", "Apply Theme")
943
1023
  ]
944
1024
  }
945
1025
  ),
946
- /* @__PURE__ */ h(
1026
+ /* @__PURE__ */ u(
947
1027
  "button",
948
1028
  {
949
1029
  type: "button",
950
1030
  className: "nice-theme-builder__btn nice-theme-builder__btn--export",
951
- onClick: ae,
1031
+ onClick: ye,
952
1032
  children: [
953
- /* @__PURE__ */ r(I, { name: "download", size: "sm" }),
1033
+ /* @__PURE__ */ n($, { name: "download", size: "sm" }),
954
1034
  e("theme.export", "Export JSON")
955
1035
  ]
956
1036
  }
957
1037
  ),
958
- /* @__PURE__ */ h(
1038
+ /* @__PURE__ */ u(
959
1039
  "button",
960
1040
  {
961
1041
  type: "button",
962
1042
  className: "nice-theme-builder__btn",
963
1043
  onClick: () => {
964
- const i = Ue(m), n = Object.entries(je(m)).map(([_, y]) => ` ${_}: ${y};`).join(`
965
- `), a = `/* Nice2Dev Theme: ${m.name} */
1044
+ const i = Ue(m), r = Object.entries(We(m)).map(([t, a]) => ` ${t}: ${a};`).join(`
1045
+ `), o = `/* Nice2Dev Theme: ${m.name} */
966
1046
  :root {
967
- ${n}
1047
+ ${r}
968
1048
  }
969
1049
 
970
1050
  /* JSON */
971
1051
  /* ${i} */`;
972
- navigator.clipboard?.writeText(a);
1052
+ navigator.clipboard?.writeText(o);
973
1053
  },
974
1054
  children: [
975
- /* @__PURE__ */ r(I, { name: "copy", size: "sm" }),
1055
+ /* @__PURE__ */ n($, { name: "copy", size: "sm" }),
976
1056
  e("theme.copy", "Copy to Clipboard")
977
1057
  ]
978
1058
  }
979
1059
  )
980
1060
  ] })
981
1061
  ] }),
982
- N && /* @__PURE__ */ r("div", { className: "nice-theme-builder__preview-pane", children: /* @__PURE__ */ r(Qe, { theme: m, onTokenClick: W }) }),
983
- /* @__PURE__ */ r(
1062
+ N && /* @__PURE__ */ n("div", { className: "nice-theme-builder__preview-pane", children: /* @__PURE__ */ n(Qe, { theme: m, onTokenClick: B }) }),
1063
+ /* @__PURE__ */ n(
984
1064
  Ze,
985
1065
  {
986
- visible: p,
1066
+ visible: b,
987
1067
  variant: "warning",
988
1068
  header: e("theme.unsaved", "Unsaved changes"),
989
1069
  message: e("theme.leaveConfirm", "Leave without saving? Your changes will be lost."),
@@ -997,253 +1077,246 @@ ${n}
997
1077
  )
998
1078
  ] });
999
1079
  }
1000
- function it({ showPreview: s, onToggle: d }) {
1001
- const { t: u } = Ge(), T = s ? u("theme.hidePreview", "Hide preview") : u("theme.showPreview", "Show preview");
1002
- return /* @__PURE__ */ h(
1080
+ function at({ showPreview: s, onToggle: h }) {
1081
+ const { t: p } = Ge(), T = s ? p("theme.hidePreview", "Hide preview") : p("theme.showPreview", "Show preview");
1082
+ return /* @__PURE__ */ u(
1003
1083
  "button",
1004
1084
  {
1005
1085
  type: "button",
1006
1086
  className: `nice-theme-builder__btn nice-theme-builder__btn--preview-toggle${s ? " nice-theme-builder__btn--active" : ""}`,
1007
- onClick: d,
1087
+ onClick: h,
1008
1088
  title: T,
1009
1089
  "aria-pressed": s,
1010
1090
  children: [
1011
- /* @__PURE__ */ r(I, { name: s ? "eye-off" : "eye", size: "sm" }),
1091
+ /* @__PURE__ */ n($, { name: s ? "eye-off" : "eye", size: "sm" }),
1012
1092
  T
1013
1093
  ]
1014
1094
  }
1015
1095
  );
1016
1096
  }
1017
- const He = "favorites", Q = "mine", Ve = (s) => `catalog:${s}`, we = (s, d) => `${s}::${d}`;
1018
- function at(s, d) {
1019
- if (!d)
1097
+ const He = "favorites", ee = "mine", qe = (s) => `catalog:${s}`, Ne = (s, h) => `${s}::${h}`;
1098
+ function it(s, h) {
1099
+ if (!h)
1020
1100
  return null;
1021
- for (const u of s) {
1022
- if (u.id === d)
1023
- return u;
1024
- const T = u.children ? at(u.children, d) : null;
1101
+ for (const p of s) {
1102
+ if (p.id === h)
1103
+ return p;
1104
+ const T = p.children ? it(p.children, h) : null;
1025
1105
  if (T)
1026
1106
  return T;
1027
1107
  }
1028
1108
  return null;
1029
1109
  }
1030
- function $t({ theme: s }) {
1031
- return /* @__PURE__ */ h(
1032
- "span",
1033
- {
1034
- className: "nice-theme-builder__swatch",
1035
- style: { background: s.backgrounds?.primary, borderColor: s.borders?.color },
1036
- "aria-hidden": "true",
1037
- children: [
1038
- /* @__PURE__ */ r("span", { style: { background: s.colors?.primary } }),
1039
- /* @__PURE__ */ r("span", { style: { background: s.colors?.accent ?? s.text?.primary } })
1040
- ]
1041
- }
1042
- );
1110
+ function Bt({ theme: s }) {
1111
+ const h = G(() => _t(s).preview, [s]);
1112
+ return /* @__PURE__ */ n("span", { className: "nice-theme-builder__swatch", "aria-hidden": "true", children: /* @__PURE__ */ n(vt, { colors: h, shape: "columns", size: 44 }) });
1043
1113
  }
1044
- const Ht = /* @__PURE__ */ Object.assign(
1045
- /* @__PURE__ */ pt((s, d) => {
1114
+ const tn = /* @__PURE__ */ Object.assign(
1115
+ /* @__PURE__ */ pt((s, h) => {
1046
1116
  const {
1047
- theme: u,
1117
+ theme: p,
1048
1118
  presets: T,
1049
- themes: z,
1119
+ themes: I,
1050
1120
  onThemesChange: N,
1051
1121
  favorites: w,
1052
1122
  onFavoritesChange: g,
1053
1123
  storageKey: P = "nice-theme-designer",
1054
- allowDelete: R = !1,
1055
- startScreen: V = "browser",
1056
- onSave: j,
1057
- sections: Y,
1058
- onChange: Te,
1059
- onApply: he,
1124
+ allowDelete: L = !1,
1125
+ startScreen: Y = "browser",
1126
+ onSave: E,
1127
+ sections: Z,
1128
+ onChange: we,
1129
+ onApply: de,
1060
1130
  onExport: e,
1061
- livePreview: ke = !1,
1131
+ livePreview: Te = !1,
1062
1132
  focusedToken: m,
1063
1133
  showPreview: Be = !0,
1064
- previewPlacement: Me = "right",
1065
- tutorial: B,
1134
+ previewPlacement: De = "right",
1135
+ tutorial: R,
1066
1136
  className: te,
1067
- style: ue,
1137
+ style: he,
1068
1138
  id: ne,
1069
- ...pe
1070
- } = s, be = st(ne), { t: p } = Ge(), [U, ge] = E(Be), fe = f(() => ge((t) => !t), []), X = O(null), Ce = ee(
1071
- () => Y ?? [
1139
+ ...ue
1140
+ } = s, pe = ot(ne), { t: b } = Ge(), [U, be] = O(Be), ge = y(() => be((t) => !t), []), X = M(null), ke = G(
1141
+ () => Z ?? [
1072
1142
  "general",
1143
+ "palette",
1073
1144
  "colors",
1074
1145
  "backgrounds",
1075
- "background-image",
1146
+ "layout",
1076
1147
  "text",
1077
1148
  "borders",
1149
+ "scrollbar",
1150
+ "background-image",
1078
1151
  "spacing",
1079
1152
  "typography",
1080
1153
  "shadows",
1081
1154
  "transitions"
1082
1155
  ],
1083
- [Y]
1084
- ), [xe, J] = E(() => Nt(P)), C = z ?? xe, W = f(
1156
+ [Z]
1157
+ ), [xe, J] = O(() => Pt(P)), k = I ?? xe, B = y(
1085
1158
  (t) => {
1086
- z === void 0 && (J(t), qe(P, "themes", t)), N?.(t);
1159
+ I === void 0 && (J(t), Ve(P, "themes", t)), N?.(t);
1087
1160
  },
1088
- [z, P, N]
1089
- ), [ye, re] = E(
1090
- () => wt(P)
1091
- ), D = w ?? ye, H = f(
1161
+ [I, P, N]
1162
+ ), [fe, re] = O(
1163
+ () => Ft(P)
1164
+ ), z = w ?? fe, W = y(
1092
1165
  (t) => {
1093
- w === void 0 && (re(t), qe(P, "favorites", t)), g?.(t);
1166
+ w === void 0 && (re(t), Ve(P, "favorites", t)), g?.(t);
1094
1167
  },
1095
1168
  [w, P, g]
1096
- ), M = ee(() => Tt(T), [T]), $e = f(
1097
- (t) => p(`theme.category.${t.id}`, t.label),
1098
- [p]
1099
- ), ie = ee(() => {
1169
+ ), D = G(() => It(T), [T]), V = y(
1170
+ (t) => b(`theme.category.${t.id}`, t.label),
1171
+ [b]
1172
+ ), ae = G(() => {
1100
1173
  const t = /* @__PURE__ */ new Map();
1101
- for (const o of M)
1102
- for (const c of o.entries)
1103
- t.has(c.name) || t.set(c.name, c.theme);
1174
+ for (const a of D)
1175
+ for (const l of a.entries)
1176
+ t.has(l.name) || t.set(l.name, l.theme);
1104
1177
  return t;
1105
- }, [M]), ae = ee(() => {
1106
- const t = (v, S, K) => ({
1107
- id: we(v, S.name),
1108
- label: S.name,
1178
+ }, [D]), ie = G(() => {
1179
+ const t = (f, v, K) => ({
1180
+ id: Ne(f, v.name),
1181
+ label: v.name,
1109
1182
  kind: "theme",
1110
- group: v,
1183
+ group: f,
1111
1184
  depth: 1,
1112
- theme: S,
1185
+ theme: v,
1113
1186
  own: K
1114
- }), o = (v, S, K) => ({
1115
- id: v,
1116
- label: S,
1187
+ }), a = (f, v, K) => ({
1188
+ id: f,
1189
+ label: v,
1117
1190
  kind: "group",
1118
- group: v,
1191
+ group: f,
1119
1192
  depth: 0,
1120
1193
  count: K.length,
1121
1194
  children: K
1122
- }), c = [];
1123
- for (const v of new Set(D)) {
1124
- const S = C.find((me) => me.name === v), K = S ?? ie.get(v);
1125
- K && c.push(t(He, K, !!S));
1195
+ }), l = [];
1196
+ for (const f of new Set(z)) {
1197
+ const v = k.find((ce) => ce.name === f), K = v ?? ae.get(f);
1198
+ K && l.push(t(He, K, !!v));
1126
1199
  }
1127
- const L = /* @__PURE__ */ new Set(), k = C.filter((v) => !L.has(v.name) && L.add(v.name)).map((v) => t(Q, v, !0));
1200
+ const S = /* @__PURE__ */ new Set(), _ = k.filter((f) => !S.has(f.name) && S.add(f.name)).map((f) => t(ee, f, !0));
1128
1201
  return [
1129
- o(He, p("theme.favorites", "Favorites"), c),
1130
- o(Q, p("theme.myThemes", "My themes"), k),
1131
- ...M.map((v) => {
1132
- const S = Ve(v.id), K = /* @__PURE__ */ new Set();
1133
- return o(
1134
- S,
1135
- $e(v),
1136
- v.entries.filter((me) => !K.has(me.name) && K.add(me.name)).map((me) => t(S, me.theme, !1))
1202
+ a(He, b("theme.favorites", "Favorites"), l),
1203
+ a(ee, b("theme.myThemes", "My themes"), _),
1204
+ ...D.map((f) => {
1205
+ const v = qe(f.id), K = /* @__PURE__ */ new Set();
1206
+ return a(
1207
+ v,
1208
+ V(f),
1209
+ f.entries.filter((ce) => !K.has(ce.name) && K.add(ce.name)).map((ce) => t(v, ce.theme, !1))
1137
1210
  );
1138
1211
  })
1139
1212
  ];
1140
- }, [D, C, ie, M, $e, p]), ve = f(
1141
- (t) => ae.find((o) => o.id === t)?.label ?? p("theme.themes", "Themes"),
1142
- [ae, p]
1143
- ), _e = f(
1213
+ }, [z, k, ae, D, V, b]), ye = y(
1214
+ (t) => ie.find((a) => a.id === t)?.label ?? b("theme.themes", "Themes"),
1215
+ [ie, b]
1216
+ ), ve = y(
1144
1217
  (t) => {
1145
1218
  if (!t)
1146
1219
  return null;
1147
- if (C.some((c) => c.name === t.name))
1148
- return we(Q, t.name);
1149
- const o = M.find((c) => c.entries.some((L) => L.name === t.name));
1150
- return o ? we(Ve(o.id), t.name) : null;
1220
+ if (k.some((l) => l.name === t.name))
1221
+ return Ne(ee, t.name);
1222
+ const a = D.find((l) => l.entries.some((S) => S.name === t.name));
1223
+ return a ? Ne(qe(a.id), t.name) : null;
1151
1224
  },
1152
- [C, M]
1153
- ), [Ie, se] = E(() => _e(u)), x = at(ae, Ie), [Oe, b] = E(() => {
1154
- const t = [He, Q], c = _e(u)?.split("::")[0];
1155
- return c && !t.includes(c) ? [...t, c] : t;
1156
- }), l = f((t) => {
1157
- se(t);
1158
- const o = t.split("::")[0];
1159
- b((c) => c.includes(o) ? c : [...c, o]);
1160
- }, []), [$, G] = E(() => {
1161
- if (V !== "edit")
1225
+ [k, D]
1226
+ ), [Ce, oe] = O(() => ve(p)), C = it(ie, Ce), [$e, Pe] = O(() => {
1227
+ const t = [He, ee], l = ve(p)?.split("::")[0];
1228
+ return l && !t.includes(l) ? [...t, l] : t;
1229
+ }), x = y((t) => {
1230
+ oe(t);
1231
+ const a = t.split("::")[0];
1232
+ Pe((l) => l.includes(a) ? l : [...l, a]);
1233
+ }, []), [d, c] = O(() => {
1234
+ if (Y !== "edit")
1162
1235
  return null;
1163
- const t = u ?? Ke, o = _e(t), c = o?.startsWith(`${Q}::`) ?? !1;
1236
+ const t = p ?? Ke, a = ve(t), l = a?.startsWith(`${ee}::`) ?? !1;
1164
1237
  return {
1165
1238
  original: t,
1166
- ownName: c ? t.name : null,
1167
- groupLabel: o ? ve(o.split("::")[0]) : p("theme.themes", "Themes"),
1239
+ ownName: l ? t.name : null,
1240
+ groupLabel: a ? ye(a.split("::")[0]) : b("theme.themes", "Themes"),
1168
1241
  session: 0
1169
1242
  };
1170
- }), Z = O(0), oe = f(
1243
+ }), j = M(0), q = y(
1171
1244
  (t) => {
1172
- t.theme && (Z.current += 1, se(t.id), G({
1245
+ t.theme && (j.current += 1, oe(t.id), c({
1173
1246
  original: t.theme,
1174
1247
  ownName: t.own ? t.theme.name : null,
1175
- groupLabel: ve(t.group),
1176
- session: Z.current
1248
+ groupLabel: ye(t.group),
1249
+ session: j.current
1177
1250
  }));
1178
1251
  },
1179
- [ve]
1180
- ), Pe = f(
1181
- (t) => H(
1182
- D.includes(t) ? D.filter((o) => o !== t) : [...D, t]
1252
+ [ye]
1253
+ ), _e = y(
1254
+ (t) => W(
1255
+ z.includes(t) ? z.filter((a) => a !== t) : [...z, t]
1183
1256
  ),
1184
- [D, H]
1185
- ), F = p("theme.untitled", "Untitled"), le = p("theme.copySuffix", "copy"), A = f(
1186
- (t, o) => {
1187
- const c = Je(o, new Set(C.map((k) => k.name))), L = { ...t, name: c };
1188
- return W([...C, L]), l(we(Q, c)), L;
1257
+ [z, W]
1258
+ ), H = b("theme.untitled", "Untitled"), se = b("theme.copySuffix", "copy"), F = y(
1259
+ (t, a) => {
1260
+ const l = Je(a, new Set(k.map((_) => _.name))), S = { ...t, name: l };
1261
+ return B([...k, S]), x(Ne(ee, l)), S;
1189
1262
  },
1190
- [C, W, l]
1191
- ), Fe = f(() => {
1192
- const t = A(x?.theme ?? Ke, p("theme.myThemeName", "My theme"));
1193
- Z.current += 1, G({
1263
+ [k, B, x]
1264
+ ), Ae = y(() => {
1265
+ const t = F(C?.theme ?? Ke, b("theme.myThemeName", "My theme"));
1266
+ j.current += 1, c({
1194
1267
  original: t,
1195
1268
  ownName: t.name,
1196
- groupLabel: p("theme.myThemes", "My themes"),
1197
- session: Z.current
1269
+ groupLabel: b("theme.myThemes", "My themes"),
1270
+ session: j.current
1198
1271
  });
1199
- }, [A, x, p]), q = f(() => {
1200
- x?.theme && A(x.theme, `${x.theme.name.trim() || F} ${le}`);
1201
- }, [A, x, F, le]), Le = f(
1272
+ }, [F, C, b]), Q = y(() => {
1273
+ C?.theme && F(C.theme, `${C.theme.name.trim() || H} ${se}`);
1274
+ }, [F, C, H, se]), Fe = y(
1202
1275
  (t) => {
1203
- const o = t.target.files?.[0];
1204
- t.target.value = "", o && rt(o, (c) => A(c, c.name.trim() || F));
1276
+ const a = t.target.files?.[0];
1277
+ t.target.value = "", a && rt(a, (l) => F(l, l.name.trim() || H));
1205
1278
  },
1206
- [A, F]
1207
- ), [ce, Se] = E(null), Ee = f(() => {
1208
- const t = ce;
1209
- Se(null), t !== null && (W(C.filter((o) => o.name !== t)), D.includes(t) && !ie.has(t) && H(D.filter((o) => o !== t)), se(null));
1210
- }, [ce, C, W, D, H, ie]), ze = f(
1279
+ [F, H]
1280
+ ), [A, le] = O(null), Me = y(() => {
1281
+ const t = A;
1282
+ le(null), t !== null && (B(k.filter((a) => a.name !== t)), z.includes(t) && !ae.has(t) && W(z.filter((a) => a !== t)), oe(null));
1283
+ }, [A, k, B, z, W, ae]), Oe = y(
1211
1284
  (t) => {
1212
- const o = $?.ownName ?? t.name, c = C.some((S) => S.name === o), L = new Set(C.filter((S) => S.name !== o).map((S) => S.name)), k = Je(t.name.trim() || F, L), v = k === t.name ? t : { ...t, name: k };
1213
- return W(
1214
- c ? C.map((S) => S.name === o ? v : S) : [...C, v]
1215
- ), k !== o && D.includes(o) && H(D.map((S) => S === o ? k : S)), G((S) => S && { ...S, original: v, ownName: k }), l(we(Q, k)), j?.(v), v;
1285
+ const a = d?.ownName ?? t.name, l = k.some((v) => v.name === a), S = new Set(k.filter((v) => v.name !== a).map((v) => v.name)), _ = Je(t.name.trim() || H, S), f = _ === t.name ? t : { ...t, name: _ };
1286
+ return B(
1287
+ l ? k.map((v) => v.name === a ? f : v) : [...k, f]
1288
+ ), _ !== a && z.includes(a) && W(z.map((v) => v === a ? _ : v)), c((v) => v && { ...v, original: f, ownName: _ }), x(Ne(ee, _)), E?.(f), f;
1216
1289
  },
1217
- [$, C, W, D, H, l, j, F]
1218
- ), Re = f(
1290
+ [d, k, B, z, W, x, E, H]
1291
+ ), Ee = y(
1219
1292
  (t) => {
1220
- const o = t.name.trim() || F, c = new Set(C.map((v) => v.name)), L = $ && o !== $.original.name && !c.has(o), k = A(t, L ? o : `${o} ${le}`);
1221
- return G(
1222
- (v) => v && {
1223
- ...v,
1224
- original: k,
1225
- ownName: k.name,
1226
- groupLabel: p("theme.myThemes", "My themes")
1293
+ const a = t.name.trim() || H, l = new Set(k.map((f) => f.name)), S = d && a !== d.original.name && !l.has(a), _ = F(t, S ? a : `${a} ${se}`);
1294
+ return c(
1295
+ (f) => f && {
1296
+ ...f,
1297
+ original: _,
1298
+ ownName: _.name,
1299
+ groupLabel: b("theme.myThemes", "My themes")
1227
1300
  }
1228
- ), j?.(k), k;
1301
+ ), E?.(_), _;
1229
1302
  },
1230
- [$, C, A, j, F, le, p]
1231
- ), i = f(() => G(null), []), n = ee(
1303
+ [d, k, F, E, H, se, b]
1304
+ ), Ie = y(() => c(null), []), Le = G(
1232
1305
  () => [
1233
1306
  {
1234
1307
  field: "label",
1235
- header: p("theme.name", "Theme Name"),
1236
- render: (t, o) => o.kind === "group" ? /* @__PURE__ */ h("span", { className: "nice-theme-builder__tree-group", children: [
1237
- o.label,
1238
- /* @__PURE__ */ r("span", { className: "nice-theme-builder__tree-count", children: o.count })
1239
- ] }) : /* @__PURE__ */ h(
1308
+ header: b("theme.name", "Theme Name"),
1309
+ render: (t, a) => a.kind === "group" ? /* @__PURE__ */ u("span", { className: "nice-theme-builder__tree-group", children: [
1310
+ a.label,
1311
+ /* @__PURE__ */ n("span", { className: "nice-theme-builder__tree-count", children: a.count })
1312
+ ] }) : /* @__PURE__ */ u(
1240
1313
  "span",
1241
1314
  {
1242
1315
  className: "nice-theme-builder__tree-theme",
1243
- onDoubleClick: () => oe(o),
1316
+ onDoubleClick: () => q(a),
1244
1317
  children: [
1245
- o.theme && /* @__PURE__ */ r($t, { theme: o.theme }),
1246
- /* @__PURE__ */ r("span", { className: "nice-theme-builder__tree-label", title: o.label, children: o.label })
1318
+ a.theme && /* @__PURE__ */ n(Bt, { theme: a.theme }),
1319
+ /* @__PURE__ */ n("span", { className: "nice-theme-builder__tree-label", title: a.label, children: a.label })
1247
1320
  ]
1248
1321
  }
1249
1322
  )
@@ -1253,195 +1326,195 @@ const Ht = /* @__PURE__ */ Object.assign(
1253
1326
  header: "",
1254
1327
  width: 72,
1255
1328
  align: "right",
1256
- render: (t, o) => {
1257
- if (o.kind !== "theme" || !o.theme)
1329
+ render: (t, a) => {
1330
+ if (a.kind !== "theme" || !a.theme)
1258
1331
  return null;
1259
- const c = o.theme.name, L = D.includes(c), k = L ? p("theme.removeFavorite", "Remove from favorites") : p("theme.addFavorite", "Add to favorites");
1260
- return /* @__PURE__ */ h("span", { className: "nice-theme-builder__row-actions", children: [
1261
- /* @__PURE__ */ r(
1332
+ const l = a.theme.name, S = z.includes(l), _ = S ? b("theme.removeFavorite", "Remove from favorites") : b("theme.addFavorite", "Add to favorites");
1333
+ return /* @__PURE__ */ u("span", { className: "nice-theme-builder__row-actions", children: [
1334
+ /* @__PURE__ */ n(
1262
1335
  "button",
1263
1336
  {
1264
1337
  type: "button",
1265
- className: `nice-theme-builder__icon-btn nice-theme-builder__star${L ? " nice-theme-builder__star--on" : ""}`,
1266
- "aria-pressed": L,
1267
- "aria-label": `${k}: ${c}`,
1268
- title: k,
1269
- onClick: (v) => {
1270
- v.stopPropagation(), Pe(c);
1338
+ className: `nice-theme-builder__icon-btn nice-theme-builder__star${S ? " nice-theme-builder__star--on" : ""}`,
1339
+ "aria-pressed": S,
1340
+ "aria-label": `${_}: ${l}`,
1341
+ title: _,
1342
+ onClick: (f) => {
1343
+ f.stopPropagation(), _e(l);
1271
1344
  },
1272
- children: /* @__PURE__ */ r(I, { name: "star", size: 14 })
1345
+ children: /* @__PURE__ */ n($, { name: "star", size: 14 })
1273
1346
  }
1274
1347
  ),
1275
- /* @__PURE__ */ r(
1348
+ /* @__PURE__ */ n(
1276
1349
  "button",
1277
1350
  {
1278
1351
  type: "button",
1279
1352
  className: "nice-theme-builder__icon-btn",
1280
- "aria-label": `${p("theme.edit", "Edit")}: ${c}`,
1281
- title: p("theme.edit", "Edit"),
1282
- onClick: (v) => {
1283
- v.stopPropagation(), oe(o);
1353
+ "aria-label": `${b("theme.edit", "Edit")}: ${l}`,
1354
+ title: b("theme.edit", "Edit"),
1355
+ onClick: (f) => {
1356
+ f.stopPropagation(), q(a);
1284
1357
  },
1285
- children: /* @__PURE__ */ r(I, { name: "edit", size: 14 })
1358
+ children: /* @__PURE__ */ n($, { name: "edit", size: 14 })
1286
1359
  }
1287
1360
  )
1288
1361
  ] });
1289
1362
  }
1290
1363
  }
1291
1364
  ],
1292
- [D, oe, Pe, p]
1293
- ), a = R && !!x?.own && !!x.theme, _ = /* @__PURE__ */ h("div", { className: "nice-theme-builder__toolbar", children: [
1294
- /* @__PURE__ */ h(
1365
+ [z, q, _e, b]
1366
+ ), i = L && !!C?.own && !!C.theme, r = /* @__PURE__ */ u("div", { className: "nice-theme-builder__toolbar", children: [
1367
+ /* @__PURE__ */ u(
1295
1368
  "button",
1296
1369
  {
1297
1370
  type: "button",
1298
1371
  className: "nice-theme-builder__btn nice-theme-builder__btn--new",
1299
- onClick: Fe,
1372
+ onClick: Ae,
1300
1373
  children: [
1301
- /* @__PURE__ */ r(I, { name: "plus", size: "sm" }),
1302
- p("theme.newTheme", "New")
1374
+ /* @__PURE__ */ n($, { name: "plus", size: "sm" }),
1375
+ b("theme.newTheme", "New")
1303
1376
  ]
1304
1377
  }
1305
1378
  ),
1306
- /* @__PURE__ */ h(
1379
+ /* @__PURE__ */ u(
1307
1380
  "button",
1308
1381
  {
1309
1382
  type: "button",
1310
1383
  className: "nice-theme-builder__btn",
1311
- onClick: q,
1312
- disabled: !x?.theme,
1384
+ onClick: Q,
1385
+ disabled: !C?.theme,
1313
1386
  children: [
1314
- /* @__PURE__ */ r(I, { name: "copy", size: "sm" }),
1315
- p("theme.duplicate", "Duplicate")
1387
+ /* @__PURE__ */ n($, { name: "copy", size: "sm" }),
1388
+ b("theme.duplicate", "Duplicate")
1316
1389
  ]
1317
1390
  }
1318
1391
  ),
1319
- /* @__PURE__ */ h(
1392
+ /* @__PURE__ */ u(
1320
1393
  "button",
1321
1394
  {
1322
1395
  type: "button",
1323
1396
  className: "nice-theme-builder__btn",
1324
- onClick: () => x && oe(x),
1325
- disabled: !x?.theme,
1397
+ onClick: () => C && q(C),
1398
+ disabled: !C?.theme,
1326
1399
  children: [
1327
- /* @__PURE__ */ r(I, { name: "edit", size: "sm" }),
1328
- p("theme.edit", "Edit")
1400
+ /* @__PURE__ */ n($, { name: "edit", size: "sm" }),
1401
+ b("theme.edit", "Edit")
1329
1402
  ]
1330
1403
  }
1331
1404
  ),
1332
- /* @__PURE__ */ h(
1405
+ /* @__PURE__ */ u(
1333
1406
  "button",
1334
1407
  {
1335
1408
  type: "button",
1336
1409
  className: "nice-theme-builder__btn",
1337
1410
  onClick: () => X.current?.click(),
1338
1411
  children: [
1339
- /* @__PURE__ */ r(I, { name: "upload", size: "sm" }),
1340
- p("theme.import", "Import")
1412
+ /* @__PURE__ */ n($, { name: "upload", size: "sm" }),
1413
+ b("theme.import", "Import")
1341
1414
  ]
1342
1415
  }
1343
1416
  ),
1344
- /* @__PURE__ */ r(
1417
+ /* @__PURE__ */ n(
1345
1418
  "input",
1346
1419
  {
1347
1420
  ref: X,
1348
1421
  type: "file",
1349
1422
  accept: "application/json,.json",
1350
1423
  style: { display: "none" },
1351
- onChange: Le
1424
+ onChange: Fe
1352
1425
  }
1353
1426
  ),
1354
- R && /* @__PURE__ */ h(
1427
+ L && /* @__PURE__ */ u(
1355
1428
  "button",
1356
1429
  {
1357
1430
  type: "button",
1358
1431
  className: "nice-theme-builder__btn nice-theme-builder__btn--danger",
1359
- onClick: () => x?.theme && Se(x.theme.name),
1360
- disabled: !a,
1432
+ onClick: () => C?.theme && le(C.theme.name),
1433
+ disabled: !i,
1361
1434
  children: [
1362
- /* @__PURE__ */ r(I, { name: "trash", size: "sm" }),
1363
- p("theme.delete", "Delete")
1435
+ /* @__PURE__ */ n($, { name: "trash", size: "sm" }),
1436
+ b("theme.delete", "Delete")
1364
1437
  ]
1365
1438
  }
1366
1439
  ),
1367
- /* @__PURE__ */ r(it, { showPreview: U, onToggle: fe })
1368
- ] }), y = $ ? "edit" : "browser";
1369
- return /* @__PURE__ */ h(
1440
+ /* @__PURE__ */ n(at, { showPreview: U, onToggle: ge })
1441
+ ] }), o = d ? "edit" : "browser";
1442
+ return /* @__PURE__ */ u(
1370
1443
  "div",
1371
1444
  {
1372
- ref: d,
1373
- id: be,
1374
- className: `nice-theme-builder nice-theme-builder--${y}${U ? ` nice-theme-builder--with-preview nice-theme-builder--preview-${Me}` : ""}${te ? ` ${te}` : ""}`,
1375
- style: { position: "relative", ...ue },
1376
- "data-testid": pe["data-testid"] ?? "nice-theme-builder",
1377
- "data-screen": y,
1445
+ ref: h,
1446
+ id: pe,
1447
+ className: `nice-theme-builder nice-theme-builder--${o}${U ? ` nice-theme-builder--with-preview nice-theme-builder--preview-${De}` : ""}${te ? ` ${te}` : ""}`,
1448
+ style: { position: "relative", ...he },
1449
+ "data-testid": ue["data-testid"] ?? "nice-theme-builder",
1450
+ "data-screen": o,
1378
1451
  children: [
1379
- /* @__PURE__ */ r("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ r(
1380
- ot,
1452
+ /* @__PURE__ */ n("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ n(
1453
+ st,
1381
1454
  {
1382
- steps: lt(B, $ ? _t : vt)
1455
+ steps: lt(R, d ? Ct : xt)
1383
1456
  }
1384
1457
  ) }),
1385
- $ ? /* @__PURE__ */ r(
1386
- xt,
1458
+ d ? /* @__PURE__ */ n(
1459
+ Rt,
1387
1460
  {
1388
- controlId: be,
1389
- original: $.original,
1390
- own: $.ownName !== null,
1391
- groupLabel: $.groupLabel,
1392
- allSections: Ce,
1461
+ controlId: pe,
1462
+ original: d.original,
1463
+ own: d.ownName !== null,
1464
+ groupLabel: d.groupLabel,
1465
+ allSections: ke,
1393
1466
  showPreview: U,
1394
- onTogglePreview: fe,
1395
- onBack: i,
1396
- onSave: ze,
1397
- onSaveCopy: Re,
1398
- onChange: Te,
1399
- onApply: he,
1467
+ onTogglePreview: ge,
1468
+ onBack: Ie,
1469
+ onSave: Oe,
1470
+ onSaveCopy: Ee,
1471
+ onChange: we,
1472
+ onApply: de,
1400
1473
  onExport: e,
1401
- livePreview: ke,
1474
+ livePreview: Te,
1402
1475
  focusedToken: m
1403
1476
  },
1404
- $.session
1405
- ) : /* @__PURE__ */ h(Ye, { children: [
1406
- /* @__PURE__ */ r("div", { className: "nice-theme-builder__main nice-theme-builder__browser", children: /* @__PURE__ */ r("div", { className: "nice-theme-builder__tree", children: /* @__PURE__ */ r(
1477
+ d.session
1478
+ ) : /* @__PURE__ */ u(Ye, { children: [
1479
+ /* @__PURE__ */ n("div", { className: "nice-theme-builder__main nice-theme-builder__browser", children: /* @__PURE__ */ n("div", { className: "nice-theme-builder__tree", children: /* @__PURE__ */ n(
1407
1480
  gt,
1408
1481
  {
1409
- data: ae,
1482
+ data: ie,
1410
1483
  nested: !0,
1411
1484
  keyField: "id",
1412
1485
  childrenField: "children",
1413
- columns: n,
1486
+ columns: Le,
1414
1487
  sortable: !1,
1415
1488
  compact: !0,
1416
1489
  searchable: !0,
1417
1490
  searchFields: ["label"],
1418
1491
  searchKeepDescendants: !0,
1419
- searchPlaceholder: p("theme.search", "Search themes"),
1420
- toolbar: _,
1492
+ searchPlaceholder: b("theme.search", "Search themes"),
1493
+ toolbar: r,
1421
1494
  toolbarActions: ["collapseAll"],
1422
- expandedKeys: Oe,
1423
- onExpandedChange: b,
1424
- onRowClick: (t) => t.kind === "theme" && se(t.id),
1425
- rowClassName: (t) => t.kind === "group" ? "nice-theme-builder__tree-row--group" : t.id === Ie ? "nice-theme-builder__tree-row--selected" : void 0,
1426
- "aria-label": p("theme.themes", "Themes"),
1495
+ expandedKeys: $e,
1496
+ onExpandedChange: Pe,
1497
+ onRowClick: (t) => t.kind === "theme" && oe(t.id),
1498
+ rowClassName: (t) => t.kind === "group" ? "nice-theme-builder__tree-row--group" : t.id === Ce ? "nice-theme-builder__tree-row--selected" : void 0,
1499
+ "aria-label": b("theme.themes", "Themes"),
1427
1500
  "data-testid": "nice-theme-designer-tree"
1428
1501
  }
1429
1502
  ) }) }),
1430
- U && /* @__PURE__ */ r("div", { className: "nice-theme-builder__preview-pane", children: x?.theme ? /* @__PURE__ */ r(Qe, { theme: x.theme }) : /* @__PURE__ */ r("div", { className: "nice-theme-builder__empty", children: p("theme.noSelection", "Select a theme to preview it") }) }),
1431
- /* @__PURE__ */ r(
1503
+ U && /* @__PURE__ */ n("div", { className: "nice-theme-builder__preview-pane", children: C?.theme ? /* @__PURE__ */ n(Qe, { theme: C.theme }) : /* @__PURE__ */ n("div", { className: "nice-theme-builder__empty", children: b("theme.noSelection", "Select a theme to preview it") }) }),
1504
+ /* @__PURE__ */ n(
1432
1505
  Ze,
1433
1506
  {
1434
- visible: ce !== null,
1507
+ visible: A !== null,
1435
1508
  variant: "error",
1436
- header: p("theme.delete", "Delete"),
1437
- message: p(
1509
+ header: b("theme.delete", "Delete"),
1510
+ message: b(
1438
1511
  "theme.deleteConfirm",
1439
1512
  'Delete the theme "{name}"? This cannot be undone.'
1440
- ).replace("{name}", ce ?? ""),
1441
- acceptLabel: p("theme.delete", "Delete"),
1442
- rejectLabel: p("theme.cancel", "Cancel"),
1443
- onAccept: Ee,
1444
- onReject: () => Se(null)
1513
+ ).replace("{name}", A ?? ""),
1514
+ acceptLabel: b("theme.delete", "Delete"),
1515
+ rejectLabel: b("theme.cancel", "Cancel"),
1516
+ onAccept: Me,
1517
+ onReject: () => le(null)
1445
1518
  }
1446
1519
  )
1447
1520
  ] })
@@ -1452,5 +1525,5 @@ const Ht = /* @__PURE__ */ Object.assign(
1452
1525
  { displayName: "NiceThemeDesigner" }
1453
1526
  );
1454
1527
  export {
1455
- Ht as NiceThemeDesigner
1528
+ tn as NiceThemeDesigner
1456
1529
  };