canvas-ui-sdk 0.1.7 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3337,6 +3337,7 @@ var defaultButtonSizes = {
3337
3337
  "--btn-mini-radius": "4px",
3338
3338
  "--btn-mini-font-weight": "500",
3339
3339
  "--btn-mini-letter-spacing": "0em",
3340
+ "--btn-mini-font-family": "",
3340
3341
  // Small
3341
3342
  "--btn-small-height": "32px",
3342
3343
  "--btn-small-font-size": "14px",
@@ -3344,6 +3345,7 @@ var defaultButtonSizes = {
3344
3345
  "--btn-small-radius": "6px",
3345
3346
  "--btn-small-font-weight": "500",
3346
3347
  "--btn-small-letter-spacing": "0em",
3348
+ "--btn-small-font-family": "",
3347
3349
  // Standard
3348
3350
  "--btn-standard-height": "40px",
3349
3351
  "--btn-standard-font-size": "14px",
@@ -3351,13 +3353,15 @@ var defaultButtonSizes = {
3351
3353
  "--btn-standard-radius": "8px",
3352
3354
  "--btn-standard-font-weight": "500",
3353
3355
  "--btn-standard-letter-spacing": "0em",
3356
+ "--btn-standard-font-family": "",
3354
3357
  // Large
3355
3358
  "--btn-large-height": "48px",
3356
3359
  "--btn-large-font-size": "16px",
3357
3360
  "--btn-large-px": "20px",
3358
3361
  "--btn-large-radius": "10px",
3359
3362
  "--btn-large-font-weight": "500",
3360
- "--btn-large-letter-spacing": "0em"
3363
+ "--btn-large-letter-spacing": "0em",
3364
+ "--btn-large-font-family": ""
3361
3365
  };
3362
3366
  var defaultButtonColorStyles = [
3363
3367
  { id: "primary", label: "Primary Save", description: "Main action button", isDefault: true },
@@ -24088,27 +24092,136 @@ function exportCSS(overrides) {
24088
24092
  ${lines.join("\n")}
24089
24093
  }`;
24090
24094
  }
24091
- function exportJSON(overrides) {
24092
- return JSON.stringify({ overrides }, null, 2);
24095
+ function exportJSON(overrides, branding, images, customButtonStyles) {
24096
+ const data = { overrides };
24097
+ if (branding) data.branding = branding;
24098
+ if (images) data.images = images;
24099
+ if (customButtonStyles && customButtonStyles.length > 0) {
24100
+ data.customButtonStyles = customButtonStyles;
24101
+ }
24102
+ return JSON.stringify(data, null, 2);
24093
24103
  }
24094
24104
  function importJSON(json) {
24095
24105
  try {
24096
24106
  const parsed = JSON.parse(json);
24097
- if (parsed && typeof parsed.overrides === "object" && !Array.isArray(parsed.overrides)) {
24098
- const overrides = {};
24107
+ if (!parsed || typeof parsed !== "object") return null;
24108
+ let overrides = {};
24109
+ if (parsed.overrides && typeof parsed.overrides === "object" && !Array.isArray(parsed.overrides)) {
24099
24110
  for (const [key, value] of Object.entries(parsed.overrides)) {
24100
24111
  if (typeof key === "string" && typeof value === "string") {
24101
24112
  overrides[key] = value;
24102
24113
  }
24103
24114
  }
24104
- return Object.keys(overrides).length > 0 ? overrides : null;
24105
24115
  }
24106
- return null;
24116
+ const result = { overrides };
24117
+ if (parsed.branding && typeof parsed.branding === "object") {
24118
+ result.branding = parsed.branding;
24119
+ }
24120
+ if (parsed.images && typeof parsed.images === "object") {
24121
+ result.images = parsed.images;
24122
+ }
24123
+ if (Array.isArray(parsed.customButtonStyles)) {
24124
+ result.customButtonStyles = parsed.customButtonStyles;
24125
+ }
24126
+ if (Object.keys(overrides).length === 0 && !result.branding && !result.images && !result.customButtonStyles) {
24127
+ return null;
24128
+ }
24129
+ return result;
24107
24130
  } catch {
24108
24131
  return null;
24109
24132
  }
24110
24133
  }
24111
24134
 
24135
+ // src/components/theme-drawer/utils/color-utils.ts
24136
+ function hexToHsl2(hex) {
24137
+ hex = hex.replace(/^#/, "");
24138
+ if (hex.length === 3) {
24139
+ hex = hex.split("").map((c) => c + c).join("");
24140
+ }
24141
+ const r = parseInt(hex.slice(0, 2), 16) / 255;
24142
+ const g = parseInt(hex.slice(2, 4), 16) / 255;
24143
+ const b = parseInt(hex.slice(4, 6), 16) / 255;
24144
+ const max = Math.max(r, g, b);
24145
+ const min = Math.min(r, g, b);
24146
+ let h = 0;
24147
+ let s = 0;
24148
+ const l = (max + min) / 2;
24149
+ if (max !== min) {
24150
+ const d = max - min;
24151
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
24152
+ switch (max) {
24153
+ case r:
24154
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
24155
+ break;
24156
+ case g:
24157
+ h = ((b - r) / d + 2) / 6;
24158
+ break;
24159
+ case b:
24160
+ h = ((r - g) / d + 4) / 6;
24161
+ break;
24162
+ }
24163
+ }
24164
+ return {
24165
+ h: Math.round(h * 360),
24166
+ s: Math.round(s * 100),
24167
+ l: Math.round(l * 100)
24168
+ };
24169
+ }
24170
+ function hslToHex2(h, s, l) {
24171
+ h = (h % 360 + 360) % 360;
24172
+ s /= 100;
24173
+ l /= 100;
24174
+ const c = (1 - Math.abs(2 * l - 1)) * s;
24175
+ const x = c * (1 - Math.abs(h / 60 % 2 - 1));
24176
+ const m = l - c / 2;
24177
+ let r = 0, g = 0, b = 0;
24178
+ if (h >= 0 && h < 60) {
24179
+ r = c;
24180
+ g = x;
24181
+ b = 0;
24182
+ } else if (h >= 60 && h < 120) {
24183
+ r = x;
24184
+ g = c;
24185
+ b = 0;
24186
+ } else if (h >= 120 && h < 180) {
24187
+ r = 0;
24188
+ g = c;
24189
+ b = x;
24190
+ } else if (h >= 180 && h < 240) {
24191
+ r = 0;
24192
+ g = x;
24193
+ b = c;
24194
+ } else if (h >= 240 && h < 300) {
24195
+ r = x;
24196
+ g = 0;
24197
+ b = c;
24198
+ } else if (h >= 300 && h < 360) {
24199
+ r = c;
24200
+ g = 0;
24201
+ b = x;
24202
+ }
24203
+ const toHex = (n) => {
24204
+ const hex = Math.round((n + m) * 255).toString(16);
24205
+ return hex.length === 1 ? "0" + hex : hex;
24206
+ };
24207
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
24208
+ }
24209
+ function resolveBrandingColor(value) {
24210
+ if (!value) return "#ffffff";
24211
+ if (value.startsWith("var(")) {
24212
+ const varName = value.replace("var(", "").replace(")", "");
24213
+ if (typeof window !== "undefined") {
24214
+ const computed = getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
24215
+ return computed || "#ffffff";
24216
+ }
24217
+ return "#ffffff";
24218
+ }
24219
+ return value;
24220
+ }
24221
+ function isVariableReference(value) {
24222
+ return value?.startsWith("var(") ?? false;
24223
+ }
24224
+
24112
24225
  // src/components/theme-drawer/hooks/use-theme-state.ts
24113
24226
  var FONT_VARS = [
24114
24227
  "--typo-h1-font",
@@ -24141,25 +24254,79 @@ var allDefaults = {
24141
24254
  ...defaultButtonColors,
24142
24255
  ...defaultInputSizes
24143
24256
  };
24257
+ var brandColorVars = [
24258
+ "--canvas-primary",
24259
+ "--canvas-primary-dark",
24260
+ "--canvas-flair-bg",
24261
+ "--canvas-surface-brand",
24262
+ "--canvas-sidebar-light-active-bg",
24263
+ "--canvas-sidebar-light-active-text",
24264
+ "--canvas-sidebar-dark-bg",
24265
+ "--canvas-sidebar-dark-active-bg",
24266
+ "--canvas-sidebar-dark-text",
24267
+ "--canvas-sidebar-dark-border",
24268
+ "--canvas-border-input-focus"
24269
+ ];
24144
24270
  function useThemeState(options) {
24145
24271
  const {
24146
24272
  storageKey = "canvas-ui-theme",
24147
24273
  initialOverrides,
24148
- onThemeChange
24274
+ onThemeChange,
24275
+ onBrandingChange,
24276
+ onImagesChange
24149
24277
  } = options ?? {};
24150
24278
  const [overrides, setOverrides] = useState(() => {
24151
24279
  return initialOverrides ?? {};
24152
24280
  });
24281
+ const [branding, setBrandingState] = useState({ ...defaultBranding });
24282
+ const [images, setImagesState] = useState({ ...defaultImages });
24283
+ const [customButtonStyles, setCustomButtonStyles] = useState([
24284
+ ...defaultCustomButtonStyles
24285
+ ]);
24286
+ const [brandHue, setBrandHueState] = useState(217);
24287
+ const [brandVibrancy, setBrandVibrancyState] = useState(1);
24288
+ const [syncRelatedColors, setSyncRelatedColorsState] = useState(true);
24153
24289
  const onThemeChangeRef = useRef(onThemeChange);
24154
24290
  onThemeChangeRef.current = onThemeChange;
24291
+ const onBrandingChangeRef = useRef(onBrandingChange);
24292
+ onBrandingChangeRef.current = onBrandingChange;
24293
+ const onImagesChangeRef = useRef(onImagesChange);
24294
+ onImagesChangeRef.current = onImagesChange;
24295
+ const persistState = useCallback(
24296
+ (ovr, brd, img, cbs) => {
24297
+ try {
24298
+ localStorage.setItem(
24299
+ storageKey,
24300
+ exportJSON(ovr, brd, img, cbs)
24301
+ );
24302
+ } catch {
24303
+ }
24304
+ },
24305
+ [storageKey]
24306
+ );
24155
24307
  useEffect(() => {
24156
24308
  try {
24157
24309
  const stored = localStorage.getItem(storageKey);
24158
24310
  if (stored) {
24159
24311
  const parsed = importJSON(stored);
24160
24312
  if (parsed) {
24161
- setOverrides(parsed);
24162
- setCSSVariables(parsed);
24313
+ if (parsed.overrides) {
24314
+ setOverrides(parsed.overrides);
24315
+ setCSSVariables(parsed.overrides);
24316
+ }
24317
+ if (parsed.branding) {
24318
+ setBrandingState(parsed.branding);
24319
+ }
24320
+ if (parsed.images) {
24321
+ setImagesState(parsed.images);
24322
+ }
24323
+ if (parsed.customButtonStyles) {
24324
+ setCustomButtonStyles(parsed.customButtonStyles);
24325
+ }
24326
+ if (parsed.overrides?.["--canvas-primary"]) {
24327
+ const hsl = hexToHsl2(parsed.overrides["--canvas-primary"]);
24328
+ setBrandHueState(hsl.h);
24329
+ }
24163
24330
  }
24164
24331
  } else if (initialOverrides) {
24165
24332
  setCSSVariables(initialOverrides);
@@ -24171,16 +24338,13 @@ function useThemeState(options) {
24171
24338
  (name, value) => {
24172
24339
  setOverrides((prev) => {
24173
24340
  const next = { ...prev, [name]: value };
24174
- try {
24175
- localStorage.setItem(storageKey, exportJSON(next));
24176
- } catch {
24177
- }
24341
+ persistState(next, void 0, void 0, void 0);
24178
24342
  setCSSVariables({ [name]: value });
24179
24343
  onThemeChangeRef.current?.(next);
24180
24344
  return next;
24181
24345
  });
24182
24346
  },
24183
- [storageKey]
24347
+ [persistState]
24184
24348
  );
24185
24349
  const resetCategory = useCallback(
24186
24350
  (prefix) => {
@@ -24196,10 +24360,7 @@ function useThemeState(options) {
24196
24360
  next[key] = value;
24197
24361
  }
24198
24362
  }
24199
- try {
24200
- localStorage.setItem(storageKey, exportJSON(next));
24201
- } catch {
24202
- }
24363
+ persistState(next);
24203
24364
  const fontVarsToRemove = FONT_VARS.filter((v) => v.startsWith(prefix));
24204
24365
  if (fontVarsToRemove.length > 0) {
24205
24366
  removeCSSVariables(fontVarsToRemove);
@@ -24211,10 +24372,15 @@ function useThemeState(options) {
24211
24372
  return next;
24212
24373
  });
24213
24374
  },
24214
- [storageKey]
24375
+ [persistState]
24215
24376
  );
24216
24377
  const resetAll = useCallback(() => {
24217
24378
  setOverrides({});
24379
+ setBrandingState({ ...defaultBranding });
24380
+ setImagesState({ ...defaultImages });
24381
+ setCustomButtonStyles([...defaultCustomButtonStyles]);
24382
+ setBrandHueState(217);
24383
+ setBrandVibrancyState(1);
24218
24384
  try {
24219
24385
  localStorage.removeItem(storageKey);
24220
24386
  } catch {
@@ -24227,143 +24393,486 @@ function useThemeState(options) {
24227
24393
  (json) => {
24228
24394
  const parsed = importJSON(json);
24229
24395
  if (!parsed) return false;
24230
- setOverrides(parsed);
24231
- try {
24232
- localStorage.setItem(storageKey, exportJSON(parsed));
24233
- } catch {
24234
- }
24396
+ const ovr = parsed.overrides ?? {};
24397
+ setOverrides(ovr);
24398
+ if (parsed.branding) setBrandingState(parsed.branding);
24399
+ if (parsed.images) setImagesState(parsed.images);
24400
+ if (parsed.customButtonStyles) setCustomButtonStyles(parsed.customButtonStyles);
24401
+ persistState(ovr, parsed.branding, parsed.images, parsed.customButtonStyles);
24235
24402
  removeCSSVariables(FONT_VARS);
24236
- setCSSVariables({ ...allDefaults, ...parsed });
24237
- onThemeChangeRef.current?.(parsed);
24403
+ setCSSVariables({ ...allDefaults, ...ovr });
24404
+ onThemeChangeRef.current?.(ovr);
24238
24405
  return true;
24239
24406
  },
24240
- [storageKey]
24407
+ [persistState]
24408
+ );
24409
+ const setBranding = useCallback(
24410
+ (updates) => {
24411
+ setBrandingState((prev) => {
24412
+ const next = { ...prev, ...updates };
24413
+ setOverrides((ovr) => {
24414
+ persistState(ovr, next);
24415
+ return ovr;
24416
+ });
24417
+ onBrandingChangeRef.current?.(next);
24418
+ return next;
24419
+ });
24420
+ },
24421
+ [persistState]
24422
+ );
24423
+ const setImage = useCallback(
24424
+ (key, url) => {
24425
+ setImagesState((prev) => {
24426
+ const next = { ...prev, [key]: url };
24427
+ setOverrides((ovr) => {
24428
+ persistState(ovr, void 0, next);
24429
+ return ovr;
24430
+ });
24431
+ onImagesChangeRef.current?.(next);
24432
+ return next;
24433
+ });
24434
+ },
24435
+ [persistState]
24436
+ );
24437
+ const deleteImage = useCallback(
24438
+ (key) => {
24439
+ setImagesState((prev) => {
24440
+ const next = { ...prev, [key]: "" };
24441
+ setOverrides((ovr) => {
24442
+ persistState(ovr, void 0, next);
24443
+ return ovr;
24444
+ });
24445
+ onImagesChangeRef.current?.(next);
24446
+ return next;
24447
+ });
24448
+ },
24449
+ [persistState]
24450
+ );
24451
+ const addCustomButtonStyle = useCallback(() => {
24452
+ setCustomButtonStyles((prev) => {
24453
+ const id = `custom-${Date.now()}`;
24454
+ const next = [
24455
+ ...prev,
24456
+ {
24457
+ id,
24458
+ label: "New Style",
24459
+ description: "Custom button style",
24460
+ bg: "var(--canvas-primary)",
24461
+ text: "var(--canvas-primary-foreground)",
24462
+ border: "var(--canvas-primary)",
24463
+ bgHover: "var(--canvas-primary-dark)",
24464
+ textHover: "var(--canvas-primary-foreground)",
24465
+ borderHover: "var(--canvas-primary-dark)"
24466
+ }
24467
+ ];
24468
+ setOverrides((ovr) => {
24469
+ persistState(ovr, void 0, void 0, next);
24470
+ return ovr;
24471
+ });
24472
+ return next;
24473
+ });
24474
+ }, [persistState]);
24475
+ const updateCustomButtonStyle = useCallback(
24476
+ (id, updates) => {
24477
+ setCustomButtonStyles((prev) => {
24478
+ const next = prev.map((s) => s.id === id ? { ...s, ...updates } : s);
24479
+ setOverrides((ovr) => {
24480
+ persistState(ovr, void 0, void 0, next);
24481
+ return ovr;
24482
+ });
24483
+ return next;
24484
+ });
24485
+ },
24486
+ [persistState]
24487
+ );
24488
+ const deleteCustomButtonStyle = useCallback(
24489
+ (id) => {
24490
+ setCustomButtonStyles((prev) => {
24491
+ const next = prev.filter((s) => s.id !== id);
24492
+ setOverrides((ovr) => {
24493
+ persistState(ovr, void 0, void 0, next);
24494
+ return ovr;
24495
+ });
24496
+ return next;
24497
+ });
24498
+ },
24499
+ [persistState]
24500
+ );
24501
+ const applyBrandHueVibrancy = useCallback(
24502
+ (hue, vibrancy, skipPrimary = false) => {
24503
+ const newValues = {};
24504
+ const varsToUpdate = skipPrimary ? brandColorVars.filter((v) => v !== "--canvas-primary") : brandColorVars;
24505
+ if (!skipPrimary) {
24506
+ const defaultColor = defaultColors["--canvas-primary"];
24507
+ if (defaultColor && defaultColor.startsWith("#")) {
24508
+ const defaultHsl = hexToHsl2(defaultColor);
24509
+ const newHex = hslToHex2(hue, defaultHsl.s, defaultHsl.l);
24510
+ newValues["--canvas-primary"] = newHex;
24511
+ document.documentElement.style.setProperty("--canvas-primary", newHex);
24512
+ }
24513
+ }
24514
+ setOverrides((prev) => {
24515
+ const effectivePrimaryColor = newValues["--canvas-primary"] || prev["--canvas-primary"] || defaultColors["--canvas-primary"];
24516
+ varsToUpdate.forEach((varName) => {
24517
+ if (varName === "--canvas-sidebar-light-active-text" || varName === "--canvas-border-input-focus") {
24518
+ newValues[varName] = effectivePrimaryColor;
24519
+ document.documentElement.style.setProperty(varName, effectivePrimaryColor);
24520
+ return;
24521
+ }
24522
+ if (varName === "--canvas-primary") return;
24523
+ const defaultColor = defaultColors[varName];
24524
+ if (!defaultColor || !defaultColor.startsWith("#")) return;
24525
+ const defaultHsl = hexToHsl2(defaultColor);
24526
+ const minSaturation = 10;
24527
+ const newS = Math.max(
24528
+ minSaturation,
24529
+ Math.min(100, Math.round(defaultHsl.s * vibrancy))
24530
+ );
24531
+ const minLightness = 10;
24532
+ const lightnessMultiplier = vibrancy < 1 ? vibrancy : 1;
24533
+ const newL = Math.max(
24534
+ minLightness,
24535
+ Math.min(100, Math.round(defaultHsl.l * lightnessMultiplier))
24536
+ );
24537
+ const newHex = hslToHex2(hue, newS, newL);
24538
+ newValues[varName] = newHex;
24539
+ document.documentElement.style.setProperty(varName, newHex);
24540
+ });
24541
+ const next = { ...prev, ...newValues };
24542
+ persistState(next);
24543
+ onThemeChangeRef.current?.(next);
24544
+ return next;
24545
+ });
24546
+ },
24547
+ [persistState]
24548
+ );
24549
+ const setBrandHue = useCallback(
24550
+ (hue) => {
24551
+ setBrandHueState(hue);
24552
+ },
24553
+ []
24554
+ );
24555
+ const setBrandVibrancy = useCallback(
24556
+ (vibrancy) => {
24557
+ setBrandVibrancyState(vibrancy);
24558
+ },
24559
+ []
24560
+ );
24561
+ const setSyncRelatedColors = useCallback(
24562
+ (sync) => {
24563
+ setSyncRelatedColorsState(sync);
24564
+ },
24565
+ []
24241
24566
  );
24242
- const variables = { ...allDefaults, ...overrides };
24567
+ const variables = useMemo(() => ({ ...allDefaults, ...overrides }), [overrides]);
24568
+ const unsavedChangesCount = Object.keys(overrides).length;
24243
24569
  return {
24244
24570
  variables,
24245
24571
  overrides,
24246
- isDirty: Object.keys(overrides).length > 0,
24572
+ isDirty: unsavedChangesCount > 0,
24573
+ unsavedChangesCount,
24247
24574
  setVariable,
24248
24575
  resetCategory,
24249
24576
  resetAll,
24250
24577
  exportCSS: () => exportCSS(overrides),
24251
- exportJSON: () => exportJSON(overrides),
24252
- importJSON: handleImportJSON
24578
+ exportJSON: () => exportJSON(overrides, branding, images, customButtonStyles),
24579
+ importJSON: handleImportJSON,
24580
+ branding,
24581
+ setBranding,
24582
+ images,
24583
+ setImage,
24584
+ deleteImage,
24585
+ customButtonStyles,
24586
+ addCustomButtonStyle,
24587
+ updateCustomButtonStyle,
24588
+ deleteCustomButtonStyle,
24589
+ brandHue,
24590
+ brandVibrancy,
24591
+ syncRelatedColors,
24592
+ setBrandHue,
24593
+ setBrandVibrancy,
24594
+ setSyncRelatedColors,
24595
+ applyBrandHueVibrancy
24253
24596
  };
24254
24597
  }
24255
- function ColorsPanel({ theme }) {
24256
- return /* @__PURE__ */ jsx("div", { "data-theme-drawer-panel": true, className: "flex flex-col gap-6 p-4", children: colorVariables.map((category) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
24257
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
24258
- /* @__PURE__ */ jsx(
24259
- "h3",
24260
- {
24261
- style: {
24262
- fontSize: "13px",
24263
- fontWeight: 600,
24264
- color: "#374151",
24265
- textTransform: "uppercase",
24266
- letterSpacing: "0.05em"
24267
- },
24268
- children: category.category
24269
- }
24270
- ),
24271
- /* @__PURE__ */ jsx(
24272
- "button",
24273
- {
24274
- onClick: () => {
24275
- const prefix = category.variables[0]?.name.split("-").slice(0, 3).join("-");
24276
- if (prefix) theme.resetCategory(prefix);
24277
- },
24278
- style: {
24279
- fontSize: "11px",
24280
- color: "#6b7280",
24281
- background: "none",
24282
- border: "none",
24283
- cursor: "pointer",
24284
- padding: "2px 6px",
24285
- borderRadius: "4px"
24286
- },
24287
- onMouseEnter: (e) => {
24288
- e.target.style.color = "#374151";
24289
- e.target.style.background = "#f3f4f6";
24290
- },
24291
- onMouseLeave: (e) => {
24292
- e.target.style.color = "#6b7280";
24293
- e.target.style.background = "none";
24294
- },
24295
- children: "Reset"
24296
- }
24297
- )
24298
- ] }),
24299
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: category.variables.map((v) => /* @__PURE__ */ jsx(
24300
- ColorRow,
24598
+ function HslColorPicker({ value, onChange }) {
24599
+ const hsl = hexToHsl2(value);
24600
+ const satLightRef = useRef(null);
24601
+ const [isDragging, setIsDragging] = useState(false);
24602
+ const handleHslChange = (component, newValue) => {
24603
+ const updated = { ...hsl, [component]: newValue };
24604
+ onChange(hslToHex2(updated.h, updated.s, updated.l));
24605
+ };
24606
+ const handleSatLightInteraction = (clientX, clientY) => {
24607
+ if (!satLightRef.current) return;
24608
+ const rect = satLightRef.current.getBoundingClientRect();
24609
+ const x = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
24610
+ const y = Math.max(0, Math.min(1, (clientY - rect.top) / rect.height));
24611
+ const s = Math.round(x * 100);
24612
+ const l = Math.round((1 - y) * 100);
24613
+ onChange(hslToHex2(hsl.h, s, l));
24614
+ };
24615
+ const handlePointerDown = (e) => {
24616
+ e.preventDefault();
24617
+ e.stopPropagation();
24618
+ setIsDragging(true);
24619
+ handleSatLightInteraction(e.clientX, e.clientY);
24620
+ e.target.setPointerCapture(e.pointerId);
24621
+ };
24622
+ const handlePointerMove = (e) => {
24623
+ if (!isDragging) return;
24624
+ handleSatLightInteraction(e.clientX, e.clientY);
24625
+ };
24626
+ const handlePointerUp = (e) => {
24627
+ setIsDragging(false);
24628
+ e.target.releasePointerCapture(e.pointerId);
24629
+ };
24630
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px", padding: "12px", width: "256px" }, children: [
24631
+ /* @__PURE__ */ jsx(
24632
+ "div",
24301
24633
  {
24302
- label: v.label,
24303
- value: theme.variables[v.name] ?? v.default,
24304
- defaultValue: v.default,
24305
- onChange: (val) => theme.setVariable(v.name, val)
24306
- },
24307
- v.name
24308
- )) })
24309
- ] }, category.category)) });
24634
+ ref: satLightRef,
24635
+ style: {
24636
+ position: "relative",
24637
+ width: "100%",
24638
+ height: "160px",
24639
+ borderRadius: "6px",
24640
+ cursor: "crosshair",
24641
+ touchAction: "none",
24642
+ background: `
24643
+ linear-gradient(to top, #000, transparent),
24644
+ linear-gradient(to right, #fff, hsl(${hsl.h}, 100%, 50%))
24645
+ `
24646
+ },
24647
+ onPointerDown: handlePointerDown,
24648
+ onPointerMove: handlePointerMove,
24649
+ onPointerUp: handlePointerUp,
24650
+ children: /* @__PURE__ */ jsx(
24651
+ "div",
24652
+ {
24653
+ style: {
24654
+ position: "absolute",
24655
+ width: "16px",
24656
+ height: "16px",
24657
+ border: "2px solid white",
24658
+ borderRadius: "50%",
24659
+ pointerEvents: "none",
24660
+ transform: "translate(-50%, -50%)",
24661
+ left: `${hsl.s}%`,
24662
+ top: `${100 - hsl.l}%`,
24663
+ boxShadow: "0 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2)"
24664
+ }
24665
+ }
24666
+ )
24667
+ }
24668
+ ),
24669
+ /* @__PURE__ */ jsx(
24670
+ SliderRow,
24671
+ {
24672
+ label: "Hue",
24673
+ value: hsl.h,
24674
+ min: 0,
24675
+ max: 360,
24676
+ suffix: "\xB0",
24677
+ inputWidth: "48px",
24678
+ onChange: (v) => handleHslChange("h", v),
24679
+ gradient: `linear-gradient(to right,
24680
+ hsl(0, 100%, 50%),
24681
+ hsl(60, 100%, 50%),
24682
+ hsl(120, 100%, 50%),
24683
+ hsl(180, 100%, 50%),
24684
+ hsl(240, 100%, 50%),
24685
+ hsl(300, 100%, 50%),
24686
+ hsl(360, 100%, 50%)
24687
+ )`
24688
+ }
24689
+ ),
24690
+ /* @__PURE__ */ jsx(
24691
+ SliderRow,
24692
+ {
24693
+ label: "Saturation",
24694
+ value: hsl.s,
24695
+ min: 0,
24696
+ max: 100,
24697
+ suffix: "%",
24698
+ inputWidth: "40px",
24699
+ onChange: (v) => handleHslChange("s", v),
24700
+ gradient: `linear-gradient(to right,
24701
+ hsl(${hsl.h}, 0%, ${hsl.l}%),
24702
+ hsl(${hsl.h}, 100%, ${hsl.l}%)
24703
+ )`
24704
+ }
24705
+ ),
24706
+ /* @__PURE__ */ jsx(
24707
+ SliderRow,
24708
+ {
24709
+ label: "Lightness",
24710
+ value: hsl.l,
24711
+ min: 0,
24712
+ max: 100,
24713
+ suffix: "%",
24714
+ inputWidth: "40px",
24715
+ onChange: (v) => handleHslChange("l", v),
24716
+ gradient: `linear-gradient(to right,
24717
+ hsl(${hsl.h}, ${hsl.s}%, 0%),
24718
+ hsl(${hsl.h}, ${hsl.s}%, 50%),
24719
+ hsl(${hsl.h}, ${hsl.s}%, 100%)
24720
+ )`
24721
+ }
24722
+ )
24723
+ ] });
24310
24724
  }
24311
- function ColorRow({
24725
+ function SliderRow({
24312
24726
  label,
24313
24727
  value,
24314
- defaultValue,
24315
- onChange
24728
+ min,
24729
+ max,
24730
+ suffix,
24731
+ inputWidth,
24732
+ onChange,
24733
+ gradient
24316
24734
  }) {
24317
- const isModified = value !== defaultValue;
24318
- return /* @__PURE__ */ jsxs(
24319
- "div",
24320
- {
24321
- style: {
24322
- display: "flex",
24323
- alignItems: "center",
24324
- gap: "10px"
24325
- },
24326
- children: [
24327
- /* @__PURE__ */ jsx(
24328
- "label",
24329
- {
24330
- style: {
24331
- position: "relative",
24332
- width: "32px",
24333
- height: "32px",
24334
- flexShrink: 0,
24335
- borderRadius: "6px",
24336
- border: "1px solid #e5e7eb",
24337
- overflow: "hidden",
24338
- cursor: "pointer"
24339
- },
24340
- children: /* @__PURE__ */ jsx(
24735
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
24736
+ /* @__PURE__ */ jsxs(
24737
+ "div",
24738
+ {
24739
+ style: {
24740
+ display: "flex",
24741
+ alignItems: "center",
24742
+ justifyContent: "space-between",
24743
+ fontSize: "12px",
24744
+ color: "#6b7280"
24745
+ },
24746
+ children: [
24747
+ /* @__PURE__ */ jsx("span", { children: label }),
24748
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px" }, children: [
24749
+ /* @__PURE__ */ jsx(
24341
24750
  "input",
24342
24751
  {
24343
- type: "color",
24752
+ type: "number",
24753
+ min,
24754
+ max,
24344
24755
  value,
24345
- onChange: (e) => onChange(e.target.value),
24756
+ onChange: (e) => onChange(
24757
+ Math.min(max, Math.max(min, parseInt(e.target.value) || 0))
24758
+ ),
24346
24759
  style: {
24347
- position: "absolute",
24348
- inset: "-4px",
24349
- width: "calc(100% + 8px)",
24350
- height: "calc(100% + 8px)",
24351
- cursor: "pointer",
24352
- border: "none",
24353
- padding: 0
24760
+ width: inputWidth,
24761
+ padding: "2px 4px",
24762
+ fontSize: "12px",
24763
+ fontFamily: "monospace",
24764
+ border: "1px solid #e5e7eb",
24765
+ borderRadius: "4px",
24766
+ background: "#ffffff",
24767
+ color: "#374151",
24768
+ textAlign: "right"
24354
24769
  }
24355
24770
  }
24356
- )
24357
- }
24358
- ),
24359
- /* @__PURE__ */ jsx(
24360
- "span",
24361
- {
24362
- style: {
24363
- fontSize: "13px",
24771
+ ),
24772
+ /* @__PURE__ */ jsx("span", { children: suffix })
24773
+ ] })
24774
+ ]
24775
+ }
24776
+ ),
24777
+ /* @__PURE__ */ jsx(
24778
+ "input",
24779
+ {
24780
+ type: "range",
24781
+ min,
24782
+ max,
24783
+ value,
24784
+ onChange: (e) => onChange(parseInt(e.target.value)),
24785
+ style: {
24786
+ width: "100%",
24787
+ height: "12px",
24788
+ borderRadius: "6px",
24789
+ appearance: "none",
24790
+ WebkitAppearance: "none",
24791
+ cursor: "pointer",
24792
+ background: gradient
24793
+ }
24794
+ }
24795
+ )
24796
+ ] });
24797
+ }
24798
+ function ColorInputRow({
24799
+ label,
24800
+ value,
24801
+ onChange,
24802
+ variableOptions
24803
+ }) {
24804
+ const [pickerOpen, setPickerOpen] = useState(false);
24805
+ if (variableOptions) {
24806
+ return /* @__PURE__ */ jsx(
24807
+ VariableColorRow,
24808
+ {
24809
+ label,
24810
+ value,
24811
+ onChange,
24812
+ variableOptions
24813
+ }
24814
+ );
24815
+ }
24816
+ const handleHexInput = (e) => {
24817
+ let hex = e.target.value;
24818
+ if (hex && !hex.startsWith("#")) {
24819
+ hex = "#" + hex;
24820
+ }
24821
+ if (/^#[0-9A-Fa-f]{0,6}$/.test(hex)) {
24822
+ onChange(hex);
24823
+ }
24824
+ };
24825
+ return /* @__PURE__ */ jsxs(
24826
+ "div",
24827
+ {
24828
+ style: {
24829
+ display: "flex",
24830
+ alignItems: "center",
24831
+ gap: "8px",
24832
+ padding: "8px 0"
24833
+ },
24834
+ children: [
24835
+ /* @__PURE__ */ jsxs(Popover, { open: pickerOpen, onOpenChange: setPickerOpen, children: [
24836
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
24837
+ "button",
24838
+ {
24839
+ style: {
24840
+ width: "32px",
24841
+ height: "32px",
24842
+ borderRadius: "6px",
24843
+ border: "1px solid #e5e7eb",
24844
+ cursor: "pointer",
24845
+ flexShrink: 0,
24846
+ backgroundColor: value,
24847
+ transition: "transform 150ms"
24848
+ },
24849
+ onMouseEnter: (e) => {
24850
+ e.currentTarget.style.transform = "scale(1.05)";
24851
+ },
24852
+ onMouseLeave: (e) => {
24853
+ e.currentTarget.style.transform = "scale(1)";
24854
+ },
24855
+ "aria-label": `Edit ${label} color`
24856
+ }
24857
+ ) }),
24858
+ /* @__PURE__ */ jsx(
24859
+ PopoverContent,
24860
+ {
24861
+ className: "w-auto p-0",
24862
+ align: "start",
24863
+ onPointerDownOutside: (e) => e.preventDefault(),
24864
+ children: /* @__PURE__ */ jsx(HslColorPicker, { value, onChange })
24865
+ }
24866
+ )
24867
+ ] }),
24868
+ /* @__PURE__ */ jsx(
24869
+ "span",
24870
+ {
24871
+ style: {
24872
+ fontSize: "13px",
24364
24873
  color: "#374151",
24365
24874
  flex: 1,
24366
- fontWeight: isModified ? 500 : 400
24875
+ minWidth: 0
24367
24876
  },
24368
24877
  children: label
24369
24878
  }
@@ -24373,7 +24882,7 @@ function ColorRow({
24373
24882
  {
24374
24883
  type: "text",
24375
24884
  value,
24376
- onChange: (e) => onChange(e.target.value),
24885
+ onChange: handleHexInput,
24377
24886
  style: {
24378
24887
  width: "80px",
24379
24888
  fontSize: "12px",
@@ -24382,52 +24891,1122 @@ function ColorRow({
24382
24891
  border: "1px solid #e5e7eb",
24383
24892
  borderRadius: "4px",
24384
24893
  color: "#374151",
24385
- background: "#ffffff"
24386
- }
24894
+ background: "#ffffff",
24895
+ textTransform: "uppercase",
24896
+ textAlign: "center"
24897
+ },
24898
+ placeholder: "#000000"
24387
24899
  }
24388
24900
  )
24389
24901
  ]
24390
24902
  }
24391
24903
  );
24392
24904
  }
24393
- var typographyGroups = [
24394
- {
24395
- label: "Global",
24396
- prefix: "--typo-global",
24397
- fields: [{ key: "--typo-global-font", label: "Font Family", type: "text" }]
24398
- },
24399
- ...["h1", "h2", "h3", "h4", "h5", "h6"].map((level) => ({
24400
- label: level.toUpperCase(),
24401
- prefix: `--typo-${level}`,
24402
- fields: [
24403
- { key: `--typo-${level}-font`, label: "Font", type: "text" },
24404
- { key: `--typo-${level}-size`, label: "Size", type: "text" },
24405
- { key: `--typo-${level}-size-mobile`, label: "Mobile Size", type: "text" },
24406
- { key: `--typo-${level}-weight`, label: "Weight", type: "text" },
24407
- { key: `--typo-${level}-spacing`, label: "Spacing", type: "text" },
24408
- { key: `--typo-${level}-line-height`, label: "Line Height", type: "text" }
24409
- ]
24410
- })),
24411
- ...["body-xl", "body-l", "body-m", "body-s", "body-xs"].map((level) => ({
24412
- label: level.replace("body-", "Body ").toUpperCase(),
24413
- prefix: `--typo-${level}`,
24414
- fields: [
24415
- { key: `--typo-${level}-font`, label: "Font", type: "text" },
24416
- { key: `--typo-${level}-size`, label: "Size", type: "text" },
24417
- { key: `--typo-${level}-weight`, label: "Weight", type: "text" },
24418
- { key: `--typo-${level}-spacing`, label: "Spacing", type: "text" },
24419
- { key: `--typo-${level}-line-height`, label: "Line Height", type: "text" }
24420
- ]
24421
- }))
24422
- ];
24423
- function TypographyPanel({ theme }) {
24424
- return /* @__PURE__ */ jsx("div", { "data-theme-drawer-panel": true, className: "flex flex-col gap-5 p-4", children: typographyGroups.map((group) => /* @__PURE__ */ jsx(TypoGroup, { group, theme }, group.prefix)) });
24905
+ function VariableColorRow({
24906
+ label,
24907
+ value,
24908
+ onChange,
24909
+ variableOptions
24910
+ }) {
24911
+ const isVariable = isVariableReference(value);
24912
+ const resolvedColor = resolveBrandingColor(value);
24913
+ const selectedOption = variableOptions.find((opt) => opt.value === value);
24914
+ const selectValue = selectedOption ? value : "__custom__";
24915
+ return /* @__PURE__ */ jsxs(
24916
+ "div",
24917
+ {
24918
+ style: {
24919
+ display: "flex",
24920
+ alignItems: "center",
24921
+ gap: "8px",
24922
+ padding: "8px 0"
24923
+ },
24924
+ children: [
24925
+ /* @__PURE__ */ jsx(
24926
+ "div",
24927
+ {
24928
+ style: {
24929
+ width: "24px",
24930
+ height: "24px",
24931
+ borderRadius: "4px",
24932
+ border: "1px solid #e5e7eb",
24933
+ flexShrink: 0,
24934
+ backgroundColor: resolvedColor
24935
+ }
24936
+ }
24937
+ ),
24938
+ /* @__PURE__ */ jsx(
24939
+ "span",
24940
+ {
24941
+ style: {
24942
+ fontSize: "13px",
24943
+ color: "#374151",
24944
+ flex: 1,
24945
+ minWidth: 0
24946
+ },
24947
+ children: label
24948
+ }
24949
+ ),
24950
+ /* @__PURE__ */ jsxs(
24951
+ "select",
24952
+ {
24953
+ value: selectValue,
24954
+ onChange: (e) => {
24955
+ if (e.target.value === "__custom__") {
24956
+ onChange("#000000");
24957
+ } else {
24958
+ onChange(e.target.value);
24959
+ }
24960
+ },
24961
+ style: {
24962
+ height: "28px",
24963
+ fontSize: "11px",
24964
+ padding: "0 6px",
24965
+ border: "1px solid #e5e7eb",
24966
+ borderRadius: "4px",
24967
+ color: "#374151",
24968
+ background: "#ffffff",
24969
+ cursor: "pointer",
24970
+ flexShrink: 0,
24971
+ maxWidth: "120px"
24972
+ },
24973
+ children: [
24974
+ variableOptions.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)),
24975
+ /* @__PURE__ */ jsx("option", { value: "__custom__", children: "Custom" })
24976
+ ]
24977
+ }
24978
+ ),
24979
+ !isVariable && /* @__PURE__ */ jsxs(Fragment, { children: [
24980
+ /* @__PURE__ */ jsxs(Popover, { children: [
24981
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
24982
+ "button",
24983
+ {
24984
+ style: {
24985
+ width: "24px",
24986
+ height: "24px",
24987
+ borderRadius: "4px",
24988
+ border: "1px solid #e5e7eb",
24989
+ cursor: "pointer",
24990
+ flexShrink: 0,
24991
+ backgroundColor: value
24992
+ },
24993
+ "aria-label": `Edit ${label} color`
24994
+ }
24995
+ ) }),
24996
+ /* @__PURE__ */ jsx(
24997
+ PopoverContent,
24998
+ {
24999
+ className: "w-auto p-0",
25000
+ align: "start",
25001
+ onPointerDownOutside: (e) => e.preventDefault(),
25002
+ children: /* @__PURE__ */ jsx(HslColorPicker, { value, onChange })
25003
+ }
25004
+ )
25005
+ ] }),
25006
+ /* @__PURE__ */ jsx(
25007
+ "input",
25008
+ {
25009
+ type: "text",
25010
+ value,
25011
+ onChange: (e) => {
25012
+ let hex = e.target.value;
25013
+ if (hex && !hex.startsWith("#")) hex = "#" + hex;
25014
+ if (/^#[0-9A-Fa-f]{0,6}$/.test(hex)) onChange(hex);
25015
+ },
25016
+ style: {
25017
+ width: "72px",
25018
+ fontSize: "11px",
25019
+ fontFamily: "monospace",
25020
+ padding: "4px 6px",
25021
+ border: "1px solid #e5e7eb",
25022
+ borderRadius: "4px",
25023
+ color: "#374151",
25024
+ background: "#ffffff",
25025
+ textTransform: "uppercase",
25026
+ textAlign: "center"
25027
+ },
25028
+ placeholder: "#000000"
25029
+ }
25030
+ )
25031
+ ] })
25032
+ ]
25033
+ }
25034
+ );
25035
+ }
25036
+ function ColorsPanel({ theme }) {
25037
+ return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, className: "flex flex-col gap-6 p-4", children: [
25038
+ /* @__PURE__ */ jsxs(
25039
+ "div",
25040
+ {
25041
+ style: {
25042
+ padding: "12px",
25043
+ background: "#f9fafb",
25044
+ borderRadius: "8px",
25045
+ border: "1px solid #e5e7eb"
25046
+ },
25047
+ children: [
25048
+ /* @__PURE__ */ jsx(
25049
+ "h3",
25050
+ {
25051
+ style: {
25052
+ fontSize: "11px",
25053
+ fontWeight: 600,
25054
+ color: "#6b7280",
25055
+ textTransform: "uppercase",
25056
+ letterSpacing: "0.05em",
25057
+ marginBottom: "12px"
25058
+ },
25059
+ children: "Brand Controls"
25060
+ }
25061
+ ),
25062
+ /* @__PURE__ */ jsx(
25063
+ ColorInputRow,
25064
+ {
25065
+ label: "Primary",
25066
+ value: theme.variables["--canvas-primary"] || "#1165ef",
25067
+ onChange: (hex) => {
25068
+ theme.setVariable("--canvas-primary", hex);
25069
+ if (/^#[0-9A-Fa-f]{6}$/.test(hex)) {
25070
+ const hsl = hexToHsl2(hex);
25071
+ theme.setBrandHue(hsl.h);
25072
+ theme.setBrandVibrancy(1);
25073
+ if (theme.syncRelatedColors) {
25074
+ theme.applyBrandHueVibrancy(hsl.h, 1, true);
25075
+ }
25076
+ }
25077
+ }
25078
+ }
25079
+ ),
25080
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
25081
+ /* @__PURE__ */ jsxs(
25082
+ "div",
25083
+ {
25084
+ style: {
25085
+ display: "flex",
25086
+ alignItems: "center",
25087
+ justifyContent: "space-between",
25088
+ marginBottom: "6px"
25089
+ },
25090
+ children: [
25091
+ /* @__PURE__ */ jsx("label", { style: { fontSize: "12px", color: "#6b7280" }, children: "Brand Hue" }),
25092
+ /* @__PURE__ */ jsxs(
25093
+ "span",
25094
+ {
25095
+ style: { fontSize: "12px", fontFamily: "monospace", color: "#6b7280" },
25096
+ children: [
25097
+ theme.brandHue,
25098
+ "\xB0"
25099
+ ]
25100
+ }
25101
+ )
25102
+ ]
25103
+ }
25104
+ ),
25105
+ /* @__PURE__ */ jsx(
25106
+ "input",
25107
+ {
25108
+ type: "range",
25109
+ min: "0",
25110
+ max: "360",
25111
+ value: theme.brandHue,
25112
+ onChange: (e) => {
25113
+ const newHue = parseInt(e.target.value);
25114
+ theme.setBrandHue(newHue);
25115
+ if (theme.syncRelatedColors) {
25116
+ theme.applyBrandHueVibrancy(newHue, theme.brandVibrancy);
25117
+ }
25118
+ },
25119
+ style: {
25120
+ width: "100%",
25121
+ height: "12px",
25122
+ borderRadius: "6px",
25123
+ appearance: "none",
25124
+ WebkitAppearance: "none",
25125
+ cursor: "pointer",
25126
+ background: "linear-gradient(to right, hsl(0, 80%, 50%), hsl(60, 80%, 50%), hsl(120, 80%, 50%), hsl(180, 80%, 50%), hsl(240, 80%, 50%), hsl(300, 80%, 50%), hsl(360, 80%, 50%))"
25127
+ }
25128
+ }
25129
+ )
25130
+ ] }),
25131
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
25132
+ /* @__PURE__ */ jsxs(
25133
+ "div",
25134
+ {
25135
+ style: {
25136
+ display: "flex",
25137
+ alignItems: "center",
25138
+ justifyContent: "space-between",
25139
+ marginBottom: "6px"
25140
+ },
25141
+ children: [
25142
+ /* @__PURE__ */ jsx("label", { style: { fontSize: "12px", color: "#6b7280" }, children: "Brand Vibrancy" }),
25143
+ /* @__PURE__ */ jsxs(
25144
+ "span",
25145
+ {
25146
+ style: { fontSize: "12px", fontFamily: "monospace", color: "#6b7280" },
25147
+ children: [
25148
+ Math.round(theme.brandVibrancy * 100),
25149
+ "%"
25150
+ ]
25151
+ }
25152
+ )
25153
+ ]
25154
+ }
25155
+ ),
25156
+ /* @__PURE__ */ jsx(
25157
+ "input",
25158
+ {
25159
+ type: "range",
25160
+ min: "0",
25161
+ max: "150",
25162
+ value: theme.brandVibrancy * 100,
25163
+ onChange: (e) => {
25164
+ const newVibrancy = parseInt(e.target.value) / 100;
25165
+ theme.setBrandVibrancy(newVibrancy);
25166
+ if (theme.syncRelatedColors) {
25167
+ theme.applyBrandHueVibrancy(theme.brandHue, newVibrancy, true);
25168
+ }
25169
+ },
25170
+ style: {
25171
+ width: "100%",
25172
+ height: "8px",
25173
+ borderRadius: "4px",
25174
+ appearance: "none",
25175
+ WebkitAppearance: "none",
25176
+ cursor: "pointer",
25177
+ background: `linear-gradient(to right, #d1d5db, ${theme.variables["--canvas-primary"] || "#1165ef"})`
25178
+ }
25179
+ }
25180
+ )
25181
+ ] }),
25182
+ /* @__PURE__ */ jsxs(
25183
+ "label",
25184
+ {
25185
+ style: {
25186
+ display: "flex",
25187
+ alignItems: "center",
25188
+ gap: "8px",
25189
+ cursor: "pointer",
25190
+ fontSize: "13px",
25191
+ color: "#374151"
25192
+ },
25193
+ children: [
25194
+ /* @__PURE__ */ jsx(
25195
+ "input",
25196
+ {
25197
+ type: "checkbox",
25198
+ checked: theme.syncRelatedColors,
25199
+ onChange: (e) => theme.setSyncRelatedColors(e.target.checked),
25200
+ style: { width: "16px", height: "16px", cursor: "pointer" }
25201
+ }
25202
+ ),
25203
+ "Apply to related colors"
25204
+ ]
25205
+ }
25206
+ )
25207
+ ]
25208
+ }
25209
+ ),
25210
+ colorVariables.map((category) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
25211
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
25212
+ /* @__PURE__ */ jsx(
25213
+ "h3",
25214
+ {
25215
+ style: {
25216
+ fontSize: "11px",
25217
+ fontWeight: 600,
25218
+ color: "#6b7280",
25219
+ textTransform: "uppercase",
25220
+ letterSpacing: "0.05em"
25221
+ },
25222
+ children: category.category
25223
+ }
25224
+ ),
25225
+ /* @__PURE__ */ jsx(
25226
+ "button",
25227
+ {
25228
+ onClick: () => {
25229
+ const prefix = category.variables[0]?.name.split("-").slice(0, 3).join("-");
25230
+ if (prefix) theme.resetCategory(prefix);
25231
+ },
25232
+ style: {
25233
+ fontSize: "11px",
25234
+ color: "#6b7280",
25235
+ background: "none",
25236
+ border: "none",
25237
+ cursor: "pointer",
25238
+ padding: "2px 6px",
25239
+ borderRadius: "4px"
25240
+ },
25241
+ onMouseEnter: (e) => {
25242
+ e.target.style.color = "#374151";
25243
+ e.target.style.background = "#f3f4f6";
25244
+ },
25245
+ onMouseLeave: (e) => {
25246
+ e.target.style.color = "#6b7280";
25247
+ e.target.style.background = "none";
25248
+ },
25249
+ children: "Reset"
25250
+ }
25251
+ )
25252
+ ] }),
25253
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: category.variables.map((v) => /* @__PURE__ */ jsx(
25254
+ ColorInputRow,
25255
+ {
25256
+ label: v.label,
25257
+ value: theme.variables[v.name] ?? v.default,
25258
+ onChange: (val) => theme.setVariable(v.name, val)
25259
+ },
25260
+ v.name
25261
+ )) })
25262
+ ] }, category.category))
25263
+ ] });
25264
+ }
25265
+ var logoIcons = [
25266
+ { name: "Diamond", icon: Diamond },
25267
+ { name: "Hexagon", icon: Hexagon },
25268
+ { name: "Star", icon: Star$1 },
25269
+ { name: "Lightning", icon: Lightning },
25270
+ { name: "Sparkle", icon: Sparkle },
25271
+ { name: "Infinity", icon: Infinity },
25272
+ { name: "Code", icon: Code },
25273
+ { name: "Terminal", icon: Terminal },
25274
+ { name: "Cpu", icon: Cpu },
25275
+ { name: "Database", icon: Database },
25276
+ { name: "Globe", icon: Globe },
25277
+ { name: "Cloud", icon: Cloud },
25278
+ { name: "WifiHigh", icon: WifiHigh },
25279
+ { name: "Briefcase", icon: Briefcase },
25280
+ { name: "Buildings", icon: Buildings },
25281
+ { name: "Storefront", icon: Storefront },
25282
+ { name: "Handshake", icon: Handshake },
25283
+ { name: "ChartLine", icon: ChartLine },
25284
+ { name: "Palette", icon: Palette },
25285
+ { name: "PencilSimple", icon: PencilSimple },
25286
+ { name: "Camera", icon: Camera },
25287
+ { name: "MusicNote", icon: MusicNote },
25288
+ { name: "Lightbulb", icon: Lightbulb },
25289
+ { name: "Leaf", icon: Leaf },
25290
+ { name: "Tree", icon: Tree },
25291
+ { name: "Sun", icon: Sun },
25292
+ { name: "Moon", icon: Moon },
25293
+ { name: "Fire", icon: Fire },
25294
+ { name: "Drop", icon: Drop },
25295
+ { name: "ChatCircle", icon: ChatCircle },
25296
+ { name: "Envelope", icon: Envelope },
25297
+ { name: "Phone", icon: Phone$1 },
25298
+ { name: "Megaphone", icon: Megaphone$1 },
25299
+ { name: "Heart", icon: Heart },
25300
+ { name: "Shield", icon: Shield },
25301
+ { name: "Trophy", icon: Trophy },
25302
+ { name: "Rocket", icon: Rocket },
25303
+ { name: "Target", icon: Target },
25304
+ { name: "Flag", icon: Flag }
25305
+ ];
25306
+ var iconShapes6 = [
25307
+ { id: "rounded", label: "Rounded", borderRadius: "8px" },
25308
+ { id: "circle", label: "Circle", borderRadius: "50%" },
25309
+ { id: "square", label: "Square", borderRadius: "0px" }
25310
+ ];
25311
+ var brandingColorOptions = [
25312
+ { value: "var(--canvas-primary)", label: "Primary" },
25313
+ { value: "var(--canvas-primary-foreground)", label: "Primary Text" },
25314
+ { value: "var(--canvas-primary-dark)", label: "Primary Dark" },
25315
+ { value: "var(--canvas-surface)", label: "Neutral" },
25316
+ { value: "var(--canvas-surface-hover)", label: "Neutral Hovered" },
25317
+ { value: "var(--canvas-text)", label: "Text" },
25318
+ { value: "var(--canvas-text-muted)", label: "Gray" },
25319
+ { value: "var(--canvas-destructive)", label: "Destructive" }
25320
+ ];
25321
+ var imageConfig = [
25322
+ { key: "logoLight", label: "Logo (Light)" },
25323
+ { key: "logoDark", label: "Logo (Dark)" },
25324
+ { key: "faviconLight", label: "Favicon (Light)" },
25325
+ { key: "faviconDark", label: "Favicon (Dark)" }
25326
+ ];
25327
+ function ImagesPanel({ theme, onImageUpload }) {
25328
+ const currentShape = iconShapes6.find((s) => s.id === theme.branding.iconShape) ?? iconShapes6[0];
25329
+ const resolvedBgColor = resolveBrandingColor(theme.branding.bgColor);
25330
+ const resolvedIconColor = resolveBrandingColor(theme.branding.iconColor);
25331
+ const SelectedIcon = logoIcons.find((i) => i.name === theme.branding.iconName)?.icon ?? Buildings;
25332
+ return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, style: { display: "flex", flexDirection: "column", gap: "24px", padding: "16px" }, children: [
25333
+ /* @__PURE__ */ jsxs("div", { children: [
25334
+ /* @__PURE__ */ jsx(
25335
+ "h3",
25336
+ {
25337
+ style: {
25338
+ fontSize: "11px",
25339
+ fontWeight: 600,
25340
+ color: "#6b7280",
25341
+ textTransform: "uppercase",
25342
+ letterSpacing: "0.05em",
25343
+ marginBottom: "12px"
25344
+ },
25345
+ children: "Logo Creator"
25346
+ }
25347
+ ),
25348
+ /* @__PURE__ */ jsxs(
25349
+ "div",
25350
+ {
25351
+ style: {
25352
+ display: "flex",
25353
+ alignItems: "center",
25354
+ gap: "12px",
25355
+ marginBottom: "16px",
25356
+ padding: "16px",
25357
+ background: "#f9fafb",
25358
+ borderRadius: "8px",
25359
+ border: "1px solid #e5e7eb"
25360
+ },
25361
+ children: [
25362
+ /* @__PURE__ */ jsx(
25363
+ "div",
25364
+ {
25365
+ style: {
25366
+ width: "48px",
25367
+ height: "48px",
25368
+ borderRadius: currentShape.borderRadius,
25369
+ backgroundColor: resolvedBgColor,
25370
+ display: "flex",
25371
+ alignItems: "center",
25372
+ justifyContent: "center",
25373
+ flexShrink: 0
25374
+ },
25375
+ children: /* @__PURE__ */ jsx(SelectedIcon, { size: 28, color: resolvedIconColor, weight: "bold" })
25376
+ }
25377
+ ),
25378
+ /* @__PURE__ */ jsx(
25379
+ "span",
25380
+ {
25381
+ style: {
25382
+ fontSize: "18px",
25383
+ fontWeight: 700,
25384
+ color: "#0d121c",
25385
+ letterSpacing: "-0.01em"
25386
+ },
25387
+ children: theme.branding.wordmark || "canvas"
25388
+ }
25389
+ )
25390
+ ]
25391
+ }
25392
+ ),
25393
+ /* @__PURE__ */ jsxs(
25394
+ "div",
25395
+ {
25396
+ style: {
25397
+ display: "grid",
25398
+ gridTemplateColumns: "1fr 1fr",
25399
+ gap: "8px",
25400
+ marginBottom: "12px"
25401
+ },
25402
+ children: [
25403
+ /* @__PURE__ */ jsxs("div", { children: [
25404
+ /* @__PURE__ */ jsx(
25405
+ "label",
25406
+ {
25407
+ style: {
25408
+ display: "block",
25409
+ fontSize: "12px",
25410
+ color: "#6b7280",
25411
+ marginBottom: "4px"
25412
+ },
25413
+ children: "Wordmark"
25414
+ }
25415
+ ),
25416
+ /* @__PURE__ */ jsx(
25417
+ "input",
25418
+ {
25419
+ type: "text",
25420
+ value: theme.branding.wordmark,
25421
+ onChange: (e) => theme.setBranding({ wordmark: e.target.value }),
25422
+ style: {
25423
+ width: "100%",
25424
+ fontSize: "13px",
25425
+ padding: "6px 10px",
25426
+ border: "1px solid #e5e7eb",
25427
+ borderRadius: "6px",
25428
+ color: "#374151",
25429
+ background: "#ffffff",
25430
+ boxSizing: "border-box"
25431
+ },
25432
+ placeholder: "Your brand name"
25433
+ }
25434
+ )
25435
+ ] }),
25436
+ /* @__PURE__ */ jsxs("div", { children: [
25437
+ /* @__PURE__ */ jsx(
25438
+ "label",
25439
+ {
25440
+ style: {
25441
+ display: "block",
25442
+ fontSize: "12px",
25443
+ color: "#6b7280",
25444
+ marginBottom: "4px"
25445
+ },
25446
+ children: "Icon Shape"
25447
+ }
25448
+ ),
25449
+ /* @__PURE__ */ jsx(
25450
+ "select",
25451
+ {
25452
+ value: theme.branding.iconShape,
25453
+ onChange: (e) => theme.setBranding({ iconShape: e.target.value }),
25454
+ style: {
25455
+ width: "100%",
25456
+ height: "32px",
25457
+ fontSize: "13px",
25458
+ padding: "0 10px",
25459
+ border: "1px solid #e5e7eb",
25460
+ borderRadius: "6px",
25461
+ color: "#374151",
25462
+ background: "#ffffff",
25463
+ cursor: "pointer",
25464
+ boxSizing: "border-box"
25465
+ },
25466
+ children: iconShapes6.map((shape) => /* @__PURE__ */ jsx("option", { value: shape.id, children: shape.label }, shape.id))
25467
+ }
25468
+ )
25469
+ ] })
25470
+ ]
25471
+ }
25472
+ ),
25473
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "12px" }, children: [
25474
+ /* @__PURE__ */ jsx(
25475
+ "label",
25476
+ {
25477
+ style: {
25478
+ display: "block",
25479
+ fontSize: "12px",
25480
+ color: "#6b7280",
25481
+ marginBottom: "6px"
25482
+ },
25483
+ children: "Icon"
25484
+ }
25485
+ ),
25486
+ /* @__PURE__ */ jsx(
25487
+ "div",
25488
+ {
25489
+ style: {
25490
+ display: "grid",
25491
+ gridTemplateColumns: "repeat(8, 1fr)",
25492
+ gap: "4px"
25493
+ },
25494
+ children: logoIcons.map((icon) => {
25495
+ const isSelected = theme.branding.iconName === icon.name;
25496
+ const IconComp = icon.icon;
25497
+ return /* @__PURE__ */ jsx(
25498
+ "button",
25499
+ {
25500
+ onClick: () => theme.setBranding({ iconName: icon.name }),
25501
+ title: icon.name,
25502
+ style: {
25503
+ width: "100%",
25504
+ aspectRatio: "1",
25505
+ display: "flex",
25506
+ alignItems: "center",
25507
+ justifyContent: "center",
25508
+ borderRadius: "6px",
25509
+ border: isSelected ? "2px solid #1165ef" : "1px solid transparent",
25510
+ background: isSelected ? "#1165ef" : "transparent",
25511
+ cursor: "pointer",
25512
+ padding: 0,
25513
+ transition: "background 100ms, border-color 100ms"
25514
+ },
25515
+ onMouseEnter: (e) => {
25516
+ if (!isSelected) {
25517
+ e.currentTarget.style.background = "#f3f4f6";
25518
+ }
25519
+ },
25520
+ onMouseLeave: (e) => {
25521
+ if (!isSelected) {
25522
+ e.currentTarget.style.background = "transparent";
25523
+ }
25524
+ },
25525
+ children: /* @__PURE__ */ jsx(
25526
+ IconComp,
25527
+ {
25528
+ size: 20,
25529
+ color: isSelected ? "#ffffff" : "#374151",
25530
+ weight: "regular"
25531
+ }
25532
+ )
25533
+ },
25534
+ icon.name
25535
+ );
25536
+ })
25537
+ }
25538
+ )
25539
+ ] }),
25540
+ /* @__PURE__ */ jsx(
25541
+ ColorInputRow,
25542
+ {
25543
+ label: "Background Color",
25544
+ value: theme.branding.bgColor,
25545
+ onChange: (val) => theme.setBranding({ bgColor: val }),
25546
+ variableOptions: brandingColorOptions
25547
+ }
25548
+ ),
25549
+ /* @__PURE__ */ jsx(
25550
+ ColorInputRow,
25551
+ {
25552
+ label: "Icon Color",
25553
+ value: theme.branding.iconColor,
25554
+ onChange: (val) => theme.setBranding({ iconColor: val }),
25555
+ variableOptions: brandingColorOptions
25556
+ }
25557
+ )
25558
+ ] }),
25559
+ /* @__PURE__ */ jsxs("div", { children: [
25560
+ /* @__PURE__ */ jsx(
25561
+ "h3",
25562
+ {
25563
+ style: {
25564
+ fontSize: "11px",
25565
+ fontWeight: 600,
25566
+ color: "#6b7280",
25567
+ textTransform: "uppercase",
25568
+ letterSpacing: "0.05em",
25569
+ marginBottom: "12px"
25570
+ },
25571
+ children: "Upload Custom Images"
25572
+ }
25573
+ ),
25574
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: imageConfig.map((img) => /* @__PURE__ */ jsx(
25575
+ ImageUploadRow,
25576
+ {
25577
+ imageKey: img.key,
25578
+ label: img.label,
25579
+ url: theme.images[img.key],
25580
+ onImageUpload,
25581
+ onSetImage: (url) => theme.setImage(img.key, url),
25582
+ onDeleteImage: () => theme.deleteImage(img.key)
25583
+ },
25584
+ img.key
25585
+ )) })
25586
+ ] })
25587
+ ] });
25588
+ }
25589
+ function ImageUploadRow({
25590
+ imageKey,
25591
+ label,
25592
+ url,
25593
+ onImageUpload,
25594
+ onSetImage,
25595
+ onDeleteImage
25596
+ }) {
25597
+ const fileInputRef = useRef(null);
25598
+ const handleFileChange = async (e) => {
25599
+ const file = e.target.files?.[0];
25600
+ if (!file || !onImageUpload) return;
25601
+ try {
25602
+ const uploadedUrl = await onImageUpload(imageKey, file);
25603
+ onSetImage(uploadedUrl);
25604
+ } catch {
25605
+ }
25606
+ if (fileInputRef.current) {
25607
+ fileInputRef.current.value = "";
25608
+ }
25609
+ };
25610
+ return /* @__PURE__ */ jsxs(
25611
+ "div",
25612
+ {
25613
+ style: {
25614
+ display: "flex",
25615
+ alignItems: "center",
25616
+ gap: "10px",
25617
+ padding: "8px 10px",
25618
+ background: "#f9fafb",
25619
+ borderRadius: "6px",
25620
+ border: "1px solid #e5e7eb"
25621
+ },
25622
+ children: [
25623
+ /* @__PURE__ */ jsx(
25624
+ "div",
25625
+ {
25626
+ style: {
25627
+ width: "40px",
25628
+ height: "40px",
25629
+ borderRadius: "4px",
25630
+ border: "1px solid #e5e7eb",
25631
+ background: "#ffffff",
25632
+ display: "flex",
25633
+ alignItems: "center",
25634
+ justifyContent: "center",
25635
+ flexShrink: 0,
25636
+ overflow: "hidden"
25637
+ },
25638
+ children: url ? /* @__PURE__ */ jsx(
25639
+ "img",
25640
+ {
25641
+ src: url,
25642
+ alt: label,
25643
+ style: {
25644
+ width: "100%",
25645
+ height: "100%",
25646
+ objectFit: "contain"
25647
+ }
25648
+ }
25649
+ ) : /* @__PURE__ */ jsx("span", { style: { fontSize: "10px", color: "#9ca3af" }, children: "--" })
25650
+ }
25651
+ ),
25652
+ /* @__PURE__ */ jsx(
25653
+ "span",
25654
+ {
25655
+ style: {
25656
+ fontSize: "13px",
25657
+ color: "#374151",
25658
+ flex: 1,
25659
+ minWidth: 0
25660
+ },
25661
+ children: label
25662
+ }
25663
+ ),
25664
+ onImageUpload && /* @__PURE__ */ jsxs(Fragment, { children: [
25665
+ /* @__PURE__ */ jsx(
25666
+ "input",
25667
+ {
25668
+ ref: fileInputRef,
25669
+ type: "file",
25670
+ accept: "image/*",
25671
+ onChange: handleFileChange,
25672
+ style: { display: "none" }
25673
+ }
25674
+ ),
25675
+ /* @__PURE__ */ jsx(
25676
+ "button",
25677
+ {
25678
+ onClick: () => fileInputRef.current?.click(),
25679
+ style: {
25680
+ fontSize: "12px",
25681
+ fontWeight: 500,
25682
+ color: "#1165ef",
25683
+ background: "#ebf2ff",
25684
+ border: "1px solid #1165ef",
25685
+ borderRadius: "4px",
25686
+ padding: "4px 10px",
25687
+ cursor: "pointer",
25688
+ flexShrink: 0,
25689
+ transition: "background 100ms"
25690
+ },
25691
+ onMouseEnter: (e) => {
25692
+ e.currentTarget.style.background = "#dbeafe";
25693
+ },
25694
+ onMouseLeave: (e) => {
25695
+ e.currentTarget.style.background = "#ebf2ff";
25696
+ },
25697
+ children: "Upload"
25698
+ }
25699
+ )
25700
+ ] }),
25701
+ url && /* @__PURE__ */ jsx(
25702
+ "button",
25703
+ {
25704
+ onClick: onDeleteImage,
25705
+ title: `Remove ${label}`,
25706
+ style: {
25707
+ width: "24px",
25708
+ height: "24px",
25709
+ display: "flex",
25710
+ alignItems: "center",
25711
+ justifyContent: "center",
25712
+ borderRadius: "4px",
25713
+ border: "none",
25714
+ background: "transparent",
25715
+ cursor: "pointer",
25716
+ fontSize: "14px",
25717
+ fontWeight: 600,
25718
+ color: "#9ca3af",
25719
+ flexShrink: 0,
25720
+ lineHeight: 1,
25721
+ transition: "color 100ms, background 100ms"
25722
+ },
25723
+ onMouseEnter: (e) => {
25724
+ e.currentTarget.style.color = "#ef4444";
25725
+ e.currentTarget.style.background = "#fef2f2";
25726
+ },
25727
+ onMouseLeave: (e) => {
25728
+ e.currentTarget.style.color = "#9ca3af";
25729
+ e.currentTarget.style.background = "transparent";
25730
+ },
25731
+ children: "\u2715"
25732
+ }
25733
+ )
25734
+ ]
25735
+ }
25736
+ );
25737
+ }
25738
+
25739
+ // src/components/theme-drawer/components/font-config.ts
25740
+ var googleFontFamilies = {
25741
+ // Sans-Serif
25742
+ Inter: "Inter",
25743
+ Geist: "Geist",
25744
+ "Plus Jakarta Sans": "Plus+Jakarta+Sans",
25745
+ Poppins: "Poppins",
25746
+ "IBM Plex Sans": "IBM+Plex+Sans",
25747
+ Roboto: "Roboto",
25748
+ "Open Sans": "Open+Sans",
25749
+ "Noto Sans": "Noto+Sans",
25750
+ Montserrat: "Montserrat",
25751
+ Lato: "Lato",
25752
+ Raleway: "Raleway",
25753
+ "DM Sans": "DM+Sans",
25754
+ "Work Sans": "Work+Sans",
25755
+ Manrope: "Manrope",
25756
+ Outfit: "Outfit",
25757
+ "Source Sans 3": "Source+Sans+3",
25758
+ // Serif
25759
+ "Playfair Display": "Playfair+Display",
25760
+ Merriweather: "Merriweather",
25761
+ "Noto Serif": "Noto+Serif",
25762
+ "Libre Baskerville": "Libre+Baskerville",
25763
+ // Monospace
25764
+ "IBM Plex Mono": "IBM+Plex+Mono",
25765
+ "Courier Prime": "Courier+Prime",
25766
+ "Geist Mono": "Geist+Mono"
25767
+ };
25768
+ var loadedFonts = /* @__PURE__ */ new Set();
25769
+ function loadGoogleFont(fontName) {
25770
+ if (loadedFonts.has(fontName)) return;
25771
+ const fontFamily = googleFontFamilies[fontName];
25772
+ if (!fontFamily) return;
25773
+ const link = document.createElement("link");
25774
+ link.rel = "stylesheet";
25775
+ link.href = `https://fonts.googleapis.com/css2?family=${fontFamily}:wght@400;500;600;700&display=swap`;
25776
+ document.head.appendChild(link);
25777
+ loadedFonts.add(fontName);
25778
+ }
25779
+ var fontsPreloaded = false;
25780
+ function preloadAllFonts() {
25781
+ if (fontsPreloaded) return;
25782
+ Object.keys(googleFontFamilies).forEach((fontName) => {
25783
+ loadGoogleFont(fontName);
25784
+ });
25785
+ fontsPreloaded = true;
25786
+ }
25787
+ var fontOptions = [
25788
+ { value: "Courier Prime", label: "Courier Prime" },
25789
+ { value: "DM Sans", label: "DM Sans" },
25790
+ { value: "Geist", label: "Geist" },
25791
+ { value: "Geist Mono", label: "Geist Mono" },
25792
+ { value: "IBM Plex Mono", label: "IBM Plex Mono" },
25793
+ { value: "IBM Plex Sans", label: "IBM Plex Sans" },
25794
+ { value: "Inter", label: "Inter" },
25795
+ { value: "Lato", label: "Lato" },
25796
+ { value: "Libre Baskerville", label: "Libre Baskerville" },
25797
+ { value: "Manrope", label: "Manrope" },
25798
+ { value: "Merriweather", label: "Merriweather" },
25799
+ { value: "Montserrat", label: "Montserrat" },
25800
+ { value: "Noto Sans", label: "Noto Sans" },
25801
+ { value: "Noto Serif", label: "Noto Serif" },
25802
+ { value: "Open Sans", label: "Open Sans" },
25803
+ { value: "Outfit", label: "Outfit" },
25804
+ { value: "Playfair Display", label: "Playfair Display" },
25805
+ { value: "Plus Jakarta Sans", label: "Plus Jakarta Sans" },
25806
+ { value: "Poppins", label: "Poppins" },
25807
+ { value: "Raleway", label: "Raleway" },
25808
+ { value: "Roboto", label: "Roboto" },
25809
+ { value: "Source Sans 3", label: "Source Sans 3" },
25810
+ { value: "Work Sans", label: "Work Sans" }
25811
+ ];
25812
+ var fontWeightOptions = [
25813
+ { value: "400", label: "Regular (400)" },
25814
+ { value: "500", label: "Medium (500)" },
25815
+ { value: "600", label: "Semibold (600)" },
25816
+ { value: "700", label: "Bold (700)" }
25817
+ ];
25818
+ var typographyColorOptions = [
25819
+ { value: "var(--canvas-text)", label: "Text" },
25820
+ { value: "var(--canvas-text-muted)", label: "Text Muted" },
25821
+ { value: "var(--canvas-text-placeholder)", label: "Placeholder" },
25822
+ { value: "var(--canvas-primary)", label: "Primary" },
25823
+ { value: "var(--canvas-destructive)", label: "Destructive" }
25824
+ ];
25825
+ var generalPurposeStyles = [
25826
+ { prefix: "h1", label: "H1", description: "Hero headlines" },
25827
+ { prefix: "h2", label: "H2", description: "Major section headers" },
25828
+ { prefix: "h3", label: "H3", description: "Banner titles" },
25829
+ { prefix: "h4", label: "H4", description: "Page titles" },
25830
+ { prefix: "h5", label: "H5", description: "Large section headers" },
25831
+ { prefix: "h6", label: "H6", description: "Section titles" },
25832
+ { prefix: "body-xl", label: "Body XL", description: "Lead paragraphs" },
25833
+ { prefix: "body-l", label: "Body L", description: "Descriptions" },
25834
+ { prefix: "body-m", label: "Body M", description: "Standard body text" },
25835
+ { prefix: "body-s", label: "Body S", description: "Captions, metadata" },
25836
+ { prefix: "body-xs", label: "Body XS", description: "Fine print, labels" }
25837
+ ];
25838
+ var componentStyles = [
25839
+ { prefix: "menu-label", label: "Menu Label" },
25840
+ { prefix: "sidebar-label", label: "Sidebar Label" },
25841
+ { prefix: "sidebar-tab", label: "Sidebar Tab" },
25842
+ { prefix: "sidebar-subtab", label: "Sidebar Subtab" },
25843
+ { prefix: "header", label: "Header" },
25844
+ { prefix: "input-label", label: "Input Label" },
25845
+ { prefix: "button", label: "Button" }
25846
+ ];
25847
+ function TypographyPanel({ theme }) {
25848
+ useEffect(() => {
25849
+ preloadAllFonts();
25850
+ }, []);
25851
+ const globalFont = theme.variables["--typo-global-font"] || "Inter";
25852
+ return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, style: { padding: "16px" }, children: [
25853
+ /* @__PURE__ */ jsxs(
25854
+ "div",
25855
+ {
25856
+ style: {
25857
+ display: "flex",
25858
+ alignItems: "center",
25859
+ justifyContent: "space-between",
25860
+ padding: "12px",
25861
+ background: "#f9fafb",
25862
+ borderRadius: "8px",
25863
+ border: "1px solid #e5e7eb",
25864
+ marginBottom: "20px"
25865
+ },
25866
+ children: [
25867
+ /* @__PURE__ */ jsxs("div", { children: [
25868
+ /* @__PURE__ */ jsx(
25869
+ "div",
25870
+ {
25871
+ style: {
25872
+ fontSize: "13px",
25873
+ fontWeight: 600,
25874
+ color: "#374151"
25875
+ },
25876
+ children: "Global Font"
25877
+ }
25878
+ ),
25879
+ /* @__PURE__ */ jsx(
25880
+ "div",
25881
+ {
25882
+ style: {
25883
+ fontSize: "11px",
25884
+ color: "#6b7280",
25885
+ marginTop: "2px"
25886
+ },
25887
+ children: "Default font for all text styles"
25888
+ }
25889
+ )
25890
+ ] }),
25891
+ /* @__PURE__ */ jsx(
25892
+ "select",
25893
+ {
25894
+ value: globalFont,
25895
+ onChange: (e) => {
25896
+ const v = e.target.value;
25897
+ loadGoogleFont(v);
25898
+ theme.setVariable("--typo-global-font", v);
25899
+ },
25900
+ style: {
25901
+ height: "32px",
25902
+ fontSize: "12px",
25903
+ padding: "0 8px",
25904
+ border: "1px solid #e5e7eb",
25905
+ borderRadius: "6px",
25906
+ color: "#374151",
25907
+ background: "#ffffff",
25908
+ cursor: "pointer",
25909
+ maxWidth: "180px"
25910
+ },
25911
+ children: fontOptions.map((f) => /* @__PURE__ */ jsx(
25912
+ "option",
25913
+ {
25914
+ value: f.value,
25915
+ style: { fontFamily: f.value },
25916
+ children: f.label
25917
+ },
25918
+ f.value
25919
+ ))
25920
+ }
25921
+ )
25922
+ ]
25923
+ }
25924
+ ),
25925
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
25926
+ /* @__PURE__ */ jsx(
25927
+ "h3",
25928
+ {
25929
+ style: {
25930
+ fontSize: "11px",
25931
+ fontWeight: 600,
25932
+ color: "#6b7280",
25933
+ textTransform: "uppercase",
25934
+ letterSpacing: "0.05em",
25935
+ marginBottom: "4px"
25936
+ },
25937
+ children: "General Purpose"
25938
+ }
25939
+ ),
25940
+ /* @__PURE__ */ jsx(
25941
+ "p",
25942
+ {
25943
+ style: {
25944
+ fontSize: "11px",
25945
+ color: "#6b7280",
25946
+ marginBottom: "12px"
25947
+ },
25948
+ children: "Headings and body text used across the application."
25949
+ }
25950
+ ),
25951
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: generalPurposeStyles.map((s) => /* @__PURE__ */ jsx(
25952
+ TypographyRow,
25953
+ {
25954
+ config: s,
25955
+ theme,
25956
+ globalFont,
25957
+ hasMutedColor: true
25958
+ },
25959
+ s.prefix
25960
+ )) })
25961
+ ] }),
25962
+ /* @__PURE__ */ jsxs("div", { children: [
25963
+ /* @__PURE__ */ jsx(
25964
+ "h3",
25965
+ {
25966
+ style: {
25967
+ fontSize: "11px",
25968
+ fontWeight: 600,
25969
+ color: "#6b7280",
25970
+ textTransform: "uppercase",
25971
+ letterSpacing: "0.05em",
25972
+ marginBottom: "4px"
25973
+ },
25974
+ children: "Component-Specific"
25975
+ }
25976
+ ),
25977
+ /* @__PURE__ */ jsx(
25978
+ "p",
25979
+ {
25980
+ style: {
25981
+ fontSize: "11px",
25982
+ color: "#6b7280",
25983
+ marginBottom: "12px"
25984
+ },
25985
+ children: "Typography styles scoped to specific UI components."
25986
+ }
25987
+ ),
25988
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: componentStyles.map((s) => /* @__PURE__ */ jsx(
25989
+ TypographyRow,
25990
+ {
25991
+ config: s,
25992
+ theme,
25993
+ globalFont,
25994
+ hasMutedColor: false
25995
+ },
25996
+ s.prefix
25997
+ )) })
25998
+ ] })
25999
+ ] });
24425
26000
  }
24426
- function TypoGroup({
24427
- group,
24428
- theme
26001
+ function TypographyRow({
26002
+ config,
26003
+ theme,
26004
+ globalFont,
26005
+ hasMutedColor
24429
26006
  }) {
24430
- const [expanded, setExpanded] = React13__default.useState(false);
26007
+ const [expanded, setExpanded] = useState(false);
26008
+ const { prefix, label, description } = config;
26009
+ const varKey = (suffix) => `--typo-${prefix}-${suffix}`;
24431
26010
  return /* @__PURE__ */ jsxs(
24432
26011
  "div",
24433
26012
  {
@@ -24455,7 +26034,20 @@ function TypoGroup({
24455
26034
  color: "#374151"
24456
26035
  },
24457
26036
  children: [
24458
- /* @__PURE__ */ jsx("span", { children: group.label }),
26037
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: "8px" }, children: [
26038
+ /* @__PURE__ */ jsx("span", { children: label }),
26039
+ description && /* @__PURE__ */ jsx(
26040
+ "span",
26041
+ {
26042
+ style: {
26043
+ fontSize: "11px",
26044
+ fontWeight: 400,
26045
+ color: "#6b7280"
26046
+ },
26047
+ children: description
26048
+ }
26049
+ )
26050
+ ] }),
24459
26051
  /* @__PURE__ */ jsx(
24460
26052
  "span",
24461
26053
  {
@@ -24471,69 +26063,332 @@ function TypoGroup({
24471
26063
  ]
24472
26064
  }
24473
26065
  ),
24474
- expanded && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", style: { padding: "10px 12px" }, children: [
24475
- group.fields.map((field) => /* @__PURE__ */ jsxs(
26066
+ expanded && /* @__PURE__ */ jsxs("div", { style: { padding: "12px" }, children: [
26067
+ /* @__PURE__ */ jsxs(
24476
26068
  "div",
24477
26069
  {
24478
26070
  style: {
24479
- display: "flex",
24480
- alignItems: "center",
24481
- gap: "8px"
26071
+ display: "grid",
26072
+ gridTemplateColumns: "1fr 1fr",
26073
+ gap: "8px",
26074
+ marginBottom: "8px"
24482
26075
  },
24483
26076
  children: [
24484
- /* @__PURE__ */ jsx(
24485
- "label",
24486
- {
24487
- style: {
24488
- fontSize: "12px",
24489
- color: "#6b7280",
24490
- width: "90px",
24491
- flexShrink: 0
24492
- },
24493
- children: field.label
24494
- }
24495
- ),
24496
- /* @__PURE__ */ jsx(
24497
- "input",
24498
- {
24499
- type: "text",
24500
- value: theme.variables[field.key] ?? "",
24501
- onChange: (e) => theme.setVariable(field.key, e.target.value),
24502
- placeholder: field.label,
24503
- style: {
24504
- flex: 1,
24505
- fontSize: "12px",
24506
- fontFamily: "monospace",
24507
- padding: "4px 8px",
24508
- border: "1px solid #e5e7eb",
24509
- borderRadius: "4px",
24510
- color: "#374151",
24511
- background: "#ffffff"
26077
+ /* @__PURE__ */ jsxs("div", { children: [
26078
+ /* @__PURE__ */ jsx(
26079
+ "label",
26080
+ {
26081
+ style: {
26082
+ display: "block",
26083
+ fontSize: "11px",
26084
+ color: "#6b7280",
26085
+ marginBottom: "4px"
26086
+ },
26087
+ children: "Font Family"
24512
26088
  }
24513
- }
24514
- )
26089
+ ),
26090
+ /* @__PURE__ */ jsxs(
26091
+ "select",
26092
+ {
26093
+ value: theme.variables[varKey("font")] ?? "",
26094
+ onChange: (e) => {
26095
+ const v = e.target.value;
26096
+ if (v) {
26097
+ loadGoogleFont(v);
26098
+ theme.setVariable(varKey("font"), v);
26099
+ } else {
26100
+ theme.setVariable(varKey("font"), "");
26101
+ }
26102
+ },
26103
+ style: {
26104
+ width: "100%",
26105
+ height: "30px",
26106
+ fontSize: "12px",
26107
+ padding: "0 6px",
26108
+ border: "1px solid #e5e7eb",
26109
+ borderRadius: "4px",
26110
+ color: "#374151",
26111
+ background: "#ffffff",
26112
+ cursor: "pointer"
26113
+ },
26114
+ children: [
26115
+ /* @__PURE__ */ jsxs("option", { value: "", style: { fontFamily: globalFont }, children: [
26116
+ "Use Global (",
26117
+ globalFont,
26118
+ ")"
26119
+ ] }),
26120
+ fontOptions.map((f) => /* @__PURE__ */ jsx(
26121
+ "option",
26122
+ {
26123
+ value: f.value,
26124
+ style: { fontFamily: f.value },
26125
+ children: f.label
26126
+ },
26127
+ f.value
26128
+ ))
26129
+ ]
26130
+ }
26131
+ )
26132
+ ] }),
26133
+ /* @__PURE__ */ jsxs("div", { children: [
26134
+ /* @__PURE__ */ jsx(
26135
+ "label",
26136
+ {
26137
+ style: {
26138
+ display: "block",
26139
+ fontSize: "11px",
26140
+ color: "#6b7280",
26141
+ marginBottom: "4px"
26142
+ },
26143
+ children: "Size"
26144
+ }
26145
+ ),
26146
+ /* @__PURE__ */ jsx(
26147
+ "input",
26148
+ {
26149
+ type: "text",
26150
+ value: theme.variables[varKey("size")] ?? "",
26151
+ onChange: (e) => theme.setVariable(varKey("size"), e.target.value),
26152
+ placeholder: "e.g. 16px",
26153
+ style: {
26154
+ width: "100%",
26155
+ height: "30px",
26156
+ fontSize: "12px",
26157
+ fontFamily: "monospace",
26158
+ padding: "0 8px",
26159
+ border: "1px solid #e5e7eb",
26160
+ borderRadius: "4px",
26161
+ color: "#374151",
26162
+ background: "#ffffff",
26163
+ boxSizing: "border-box"
26164
+ }
26165
+ }
26166
+ )
26167
+ ] })
24515
26168
  ]
24516
- },
24517
- field.key
24518
- )),
26169
+ }
26170
+ ),
24519
26171
  /* @__PURE__ */ jsxs(
24520
- "button",
26172
+ "div",
24521
26173
  {
24522
- onClick: () => theme.resetCategory(group.prefix),
24523
26174
  style: {
24524
- fontSize: "11px",
24525
- color: "#6b7280",
24526
- background: "none",
24527
- border: "none",
24528
- cursor: "pointer",
24529
- textAlign: "right",
24530
- padding: "2px 0"
26175
+ display: "grid",
26176
+ gridTemplateColumns: "1fr 1fr",
26177
+ gap: "8px",
26178
+ marginBottom: "8px"
26179
+ },
26180
+ children: [
26181
+ /* @__PURE__ */ jsxs("div", { children: [
26182
+ /* @__PURE__ */ jsx(
26183
+ "label",
26184
+ {
26185
+ style: {
26186
+ display: "block",
26187
+ fontSize: "11px",
26188
+ color: "#6b7280",
26189
+ marginBottom: "4px"
26190
+ },
26191
+ children: "Mobile Size"
26192
+ }
26193
+ ),
26194
+ /* @__PURE__ */ jsx(
26195
+ "input",
26196
+ {
26197
+ type: "text",
26198
+ value: theme.variables[varKey("size-mobile")] ?? "",
26199
+ onChange: (e) => theme.setVariable(varKey("size-mobile"), e.target.value),
26200
+ placeholder: "e.g. 14px",
26201
+ style: {
26202
+ width: "100%",
26203
+ height: "30px",
26204
+ fontSize: "12px",
26205
+ fontFamily: "monospace",
26206
+ padding: "0 8px",
26207
+ border: "1px solid #e5e7eb",
26208
+ borderRadius: "4px",
26209
+ color: "#374151",
26210
+ background: "#ffffff",
26211
+ boxSizing: "border-box"
26212
+ }
26213
+ }
26214
+ )
26215
+ ] }),
26216
+ /* @__PURE__ */ jsxs("div", { children: [
26217
+ /* @__PURE__ */ jsx(
26218
+ "label",
26219
+ {
26220
+ style: {
26221
+ display: "block",
26222
+ fontSize: "11px",
26223
+ color: "#6b7280",
26224
+ marginBottom: "4px"
26225
+ },
26226
+ children: "Weight"
26227
+ }
26228
+ ),
26229
+ /* @__PURE__ */ jsxs(
26230
+ "select",
26231
+ {
26232
+ value: theme.variables[varKey("weight")] ?? "",
26233
+ onChange: (e) => theme.setVariable(varKey("weight"), e.target.value),
26234
+ style: {
26235
+ width: "100%",
26236
+ height: "30px",
26237
+ fontSize: "12px",
26238
+ padding: "0 6px",
26239
+ border: "1px solid #e5e7eb",
26240
+ borderRadius: "4px",
26241
+ color: "#374151",
26242
+ background: "#ffffff",
26243
+ cursor: "pointer"
26244
+ },
26245
+ children: [
26246
+ /* @__PURE__ */ jsx("option", { value: "", children: "Default" }),
26247
+ fontWeightOptions.map((w) => /* @__PURE__ */ jsx("option", { value: w.value, children: w.label }, w.value))
26248
+ ]
26249
+ }
26250
+ )
26251
+ ] })
26252
+ ]
26253
+ }
26254
+ ),
26255
+ /* @__PURE__ */ jsxs(
26256
+ "div",
26257
+ {
26258
+ style: {
26259
+ display: "grid",
26260
+ gridTemplateColumns: "1fr 1fr",
26261
+ gap: "8px",
26262
+ marginBottom: "8px"
24531
26263
  },
24532
26264
  children: [
24533
- "Reset ",
24534
- group.label
26265
+ /* @__PURE__ */ jsxs("div", { children: [
26266
+ /* @__PURE__ */ jsx(
26267
+ "label",
26268
+ {
26269
+ style: {
26270
+ display: "block",
26271
+ fontSize: "11px",
26272
+ color: "#6b7280",
26273
+ marginBottom: "4px"
26274
+ },
26275
+ children: "Letter Spacing"
26276
+ }
26277
+ ),
26278
+ /* @__PURE__ */ jsx(
26279
+ "input",
26280
+ {
26281
+ type: "text",
26282
+ value: theme.variables[varKey("spacing")] ?? "",
26283
+ onChange: (e) => theme.setVariable(varKey("spacing"), e.target.value),
26284
+ placeholder: "e.g. -0.02em",
26285
+ style: {
26286
+ width: "100%",
26287
+ height: "30px",
26288
+ fontSize: "12px",
26289
+ fontFamily: "monospace",
26290
+ padding: "0 8px",
26291
+ border: "1px solid #e5e7eb",
26292
+ borderRadius: "4px",
26293
+ color: "#374151",
26294
+ background: "#ffffff",
26295
+ boxSizing: "border-box"
26296
+ }
26297
+ }
26298
+ )
26299
+ ] }),
26300
+ /* @__PURE__ */ jsxs("div", { children: [
26301
+ /* @__PURE__ */ jsx(
26302
+ "label",
26303
+ {
26304
+ style: {
26305
+ display: "block",
26306
+ fontSize: "11px",
26307
+ color: "#6b7280",
26308
+ marginBottom: "4px"
26309
+ },
26310
+ children: "Line Height"
26311
+ }
26312
+ ),
26313
+ /* @__PURE__ */ jsx(
26314
+ "input",
26315
+ {
26316
+ type: "text",
26317
+ value: theme.variables[varKey("line-height")] ?? "",
26318
+ onChange: (e) => theme.setVariable(varKey("line-height"), e.target.value),
26319
+ placeholder: "e.g. 1.5",
26320
+ style: {
26321
+ width: "100%",
26322
+ height: "30px",
26323
+ fontSize: "12px",
26324
+ fontFamily: "monospace",
26325
+ padding: "0 8px",
26326
+ border: "1px solid #e5e7eb",
26327
+ borderRadius: "4px",
26328
+ color: "#374151",
26329
+ background: "#ffffff",
26330
+ boxSizing: "border-box"
26331
+ }
26332
+ }
26333
+ )
26334
+ ] })
24535
26335
  ]
24536
26336
  }
26337
+ ),
26338
+ /* @__PURE__ */ jsx(
26339
+ ColorInputRow,
26340
+ {
26341
+ label: "Color",
26342
+ value: theme.variables[varKey("color")] ?? "var(--canvas-text)",
26343
+ onChange: (val) => theme.setVariable(varKey("color"), val),
26344
+ variableOptions: typographyColorOptions
26345
+ }
26346
+ ),
26347
+ hasMutedColor && /* @__PURE__ */ jsx(
26348
+ ColorInputRow,
26349
+ {
26350
+ label: "Muted Color",
26351
+ value: theme.variables[varKey("color-muted")] ?? "var(--canvas-text-muted)",
26352
+ onChange: (val) => theme.setVariable(varKey("color-muted"), val),
26353
+ variableOptions: typographyColorOptions
26354
+ }
26355
+ ),
26356
+ /* @__PURE__ */ jsx(
26357
+ "div",
26358
+ {
26359
+ style: {
26360
+ display: "flex",
26361
+ justifyContent: "flex-end",
26362
+ marginTop: "8px"
26363
+ },
26364
+ children: /* @__PURE__ */ jsxs(
26365
+ "button",
26366
+ {
26367
+ onClick: () => theme.resetCategory("--typo-" + prefix),
26368
+ style: {
26369
+ fontSize: "11px",
26370
+ color: "#6b7280",
26371
+ background: "none",
26372
+ border: "none",
26373
+ cursor: "pointer",
26374
+ padding: "4px 8px",
26375
+ borderRadius: "4px"
26376
+ },
26377
+ onMouseEnter: (e) => {
26378
+ e.currentTarget.style.color = "#374151";
26379
+ e.currentTarget.style.background = "#f3f4f6";
26380
+ },
26381
+ onMouseLeave: (e) => {
26382
+ e.currentTarget.style.color = "#6b7280";
26383
+ e.currentTarget.style.background = "none";
26384
+ },
26385
+ children: [
26386
+ "Reset ",
26387
+ label
26388
+ ]
26389
+ }
26390
+ )
26391
+ }
24537
26392
  )
24538
26393
  ] })
24539
26394
  ]
@@ -24552,15 +26407,24 @@ var sizeFields = [
24552
26407
  { suffix: "-px", label: "Padding X" },
24553
26408
  { suffix: "-radius", label: "Radius" },
24554
26409
  { suffix: "-font-weight", label: "Weight" },
24555
- { suffix: "-letter-spacing", label: "Spacing" }
26410
+ { suffix: "-letter-spacing", label: "Spacing" },
26411
+ { suffix: "-font-family", label: "Font Family" }
24556
26412
  ];
24557
- var colorFields = [
24558
- { suffix: "-bg", label: "Background" },
24559
- { suffix: "-text", label: "Text" },
24560
- { suffix: "-border", label: "Border" },
24561
- { suffix: "-bg-hover", label: "Bg Hover" },
24562
- { suffix: "-text-hover", label: "Text Hover" },
24563
- { suffix: "-border-hover", label: "Border Hover" }
26413
+ var buttonColorVariableOptions = [
26414
+ { value: "var(--canvas-primary)", label: "Primary" },
26415
+ { value: "var(--canvas-primary-dark)", label: "Primary Dark" },
26416
+ { value: "var(--canvas-primary-foreground)", label: "Primary Text" },
26417
+ { value: "var(--canvas-background)", label: "Background" },
26418
+ { value: "var(--canvas-surface)", label: "Surface" },
26419
+ { value: "var(--canvas-surface-hover)", label: "Surface Hover" },
26420
+ { value: "var(--canvas-surface-brand)", label: "Brand Surface" },
26421
+ { value: "var(--canvas-outline-bg)", label: "Outline Bg" },
26422
+ { value: "var(--canvas-text)", label: "Text" },
26423
+ { value: "var(--canvas-text-muted)", label: "Text Muted" },
26424
+ { value: "var(--canvas-border)", label: "Border" },
26425
+ { value: "var(--canvas-border-input)", label: "Input Border" },
26426
+ { value: "var(--canvas-destructive)", label: "Destructive" },
26427
+ { value: "var(--canvas-transparent)", label: "Transparent" }
24564
26428
  ];
24565
26429
  function ButtonsPanel({ theme }) {
24566
26430
  return /* @__PURE__ */ jsxs("div", { "data-theme-drawer-panel": true, className: "flex flex-col gap-5 p-4", children: [
@@ -24569,9 +26433,9 @@ function ButtonsPanel({ theme }) {
24569
26433
  "h3",
24570
26434
  {
24571
26435
  style: {
24572
- fontSize: "13px",
26436
+ fontSize: "11px",
24573
26437
  fontWeight: 600,
24574
- color: "#374151",
26438
+ color: "#6b7280",
24575
26439
  textTransform: "uppercase",
24576
26440
  letterSpacing: "0.05em",
24577
26441
  marginBottom: "12px"
@@ -24579,24 +26443,78 @@ function ButtonsPanel({ theme }) {
24579
26443
  children: "Button Sizes"
24580
26444
  }
24581
26445
  ),
24582
- buttonSizeConfigs.map((size) => /* @__PURE__ */ jsx(SizeGroup, { size, theme }, size.id))
24583
- ] }),
24584
- /* @__PURE__ */ jsxs("div", { children: [
24585
- /* @__PURE__ */ jsx(
24586
- "h3",
24587
- {
24588
- style: {
24589
- fontSize: "13px",
24590
- fontWeight: 600,
24591
- color: "#374151",
24592
- textTransform: "uppercase",
24593
- letterSpacing: "0.05em",
24594
- marginBottom: "12px"
26446
+ buttonSizeConfigs.map((size) => /* @__PURE__ */ jsx(SizeGroup, { size, theme }, size.id))
26447
+ ] }),
26448
+ /* @__PURE__ */ jsxs("div", { children: [
26449
+ /* @__PURE__ */ jsxs(
26450
+ "div",
26451
+ {
26452
+ style: {
26453
+ display: "flex",
26454
+ alignItems: "center",
26455
+ justifyContent: "space-between",
26456
+ marginBottom: "12px"
26457
+ },
26458
+ children: [
26459
+ /* @__PURE__ */ jsx(
26460
+ "h3",
26461
+ {
26462
+ style: {
26463
+ fontSize: "11px",
26464
+ fontWeight: 600,
26465
+ color: "#6b7280",
26466
+ textTransform: "uppercase",
26467
+ letterSpacing: "0.05em"
26468
+ },
26469
+ children: "Color Styles"
26470
+ }
26471
+ ),
26472
+ /* @__PURE__ */ jsx(
26473
+ "button",
26474
+ {
26475
+ onClick: theme.addCustomButtonStyle,
26476
+ style: {
26477
+ fontSize: "11px",
26478
+ fontWeight: 500,
26479
+ color: "#1165ef",
26480
+ background: "none",
26481
+ border: "1px solid #e5e7eb",
26482
+ cursor: "pointer",
26483
+ padding: "4px 10px",
26484
+ borderRadius: "4px",
26485
+ display: "flex",
26486
+ alignItems: "center",
26487
+ gap: "4px"
26488
+ },
26489
+ children: "+ Add Style"
26490
+ }
26491
+ )
26492
+ ]
26493
+ }
26494
+ ),
26495
+ defaultButtonColorStyles.map((style) => /* @__PURE__ */ jsx(ButtonColorGroup, { style, theme }, style.id)),
26496
+ theme.customButtonStyles.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginTop: "16px", paddingTop: "16px", borderTop: "1px solid #e5e7eb" }, children: [
26497
+ /* @__PURE__ */ jsx(
26498
+ "h4",
26499
+ {
26500
+ style: {
26501
+ fontSize: "11px",
26502
+ fontWeight: 600,
26503
+ color: "#6b7280",
26504
+ marginBottom: "12px"
26505
+ },
26506
+ children: "Custom Styles"
26507
+ }
26508
+ ),
26509
+ theme.customButtonStyles.map((style) => /* @__PURE__ */ jsx(
26510
+ CustomButtonColorGroup,
26511
+ {
26512
+ style,
26513
+ theme
24595
26514
  },
24596
- children: "Button Colors"
24597
- }
24598
- ),
24599
- defaultButtonColorStyles.map((style) => /* @__PURE__ */ jsx(ColorGroup, { style, theme }, style.id))
26515
+ style.id
26516
+ ))
26517
+ ] })
24600
26518
  ] })
24601
26519
  ] });
24602
26520
  }
@@ -24692,7 +26610,18 @@ function SizeGroup({
24692
26610
  children: field.label
24693
26611
  }
24694
26612
  ),
24695
- /* @__PURE__ */ jsx(
26613
+ field.suffix === "-font-family" ? /* @__PURE__ */ jsx(
26614
+ "span",
26615
+ {
26616
+ style: {
26617
+ flex: 1,
26618
+ fontSize: "12px",
26619
+ color: "#9ca3af",
26620
+ fontStyle: "italic"
26621
+ },
26622
+ children: "Uses Button Text style"
26623
+ }
26624
+ ) : /* @__PURE__ */ jsx(
24696
26625
  "input",
24697
26626
  {
24698
26627
  type: "text",
@@ -24720,7 +26649,7 @@ function SizeGroup({
24720
26649
  }
24721
26650
  );
24722
26651
  }
24723
- function ColorGroup({
26652
+ function ButtonColorGroup({
24724
26653
  style,
24725
26654
  theme
24726
26655
  }) {
@@ -24770,52 +26699,287 @@ function ColorGroup({
24770
26699
  ]
24771
26700
  }
24772
26701
  ),
24773
- expanded && /* @__PURE__ */ jsx("div", { style: { padding: "10px 12px" }, className: "flex flex-col gap-2", children: colorFields.map((field) => {
24774
- const key = `${prefix}${field.suffix}`;
24775
- return /* @__PURE__ */ jsxs(
24776
- "div",
24777
- {
24778
- style: {
24779
- display: "flex",
24780
- alignItems: "center",
24781
- gap: "8px"
24782
- },
24783
- children: [
26702
+ expanded && /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px" }, className: "flex flex-col gap-1", children: [
26703
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "8px" }, children: [
26704
+ /* @__PURE__ */ jsx(
26705
+ "span",
26706
+ {
26707
+ style: {
26708
+ fontSize: "11px",
26709
+ fontWeight: 600,
26710
+ color: "#9ca3af",
26711
+ textTransform: "uppercase",
26712
+ letterSpacing: "0.05em"
26713
+ },
26714
+ children: "Normal"
26715
+ }
26716
+ ),
26717
+ /* @__PURE__ */ jsx(
26718
+ ColorInputRow,
26719
+ {
26720
+ label: "Background",
26721
+ value: theme.variables[`${prefix}-bg`] ?? "",
26722
+ onChange: (val) => theme.setVariable(`${prefix}-bg`, val),
26723
+ variableOptions: buttonColorVariableOptions
26724
+ }
26725
+ ),
26726
+ /* @__PURE__ */ jsx(
26727
+ ColorInputRow,
26728
+ {
26729
+ label: "Text",
26730
+ value: theme.variables[`${prefix}-text`] ?? "",
26731
+ onChange: (val) => theme.setVariable(`${prefix}-text`, val),
26732
+ variableOptions: buttonColorVariableOptions
26733
+ }
26734
+ ),
26735
+ /* @__PURE__ */ jsx(
26736
+ ColorInputRow,
26737
+ {
26738
+ label: "Border",
26739
+ value: theme.variables[`${prefix}-border`] ?? "",
26740
+ onChange: (val) => theme.setVariable(`${prefix}-border`, val),
26741
+ variableOptions: buttonColorVariableOptions
26742
+ }
26743
+ )
26744
+ ] }),
26745
+ /* @__PURE__ */ jsxs("div", { children: [
26746
+ /* @__PURE__ */ jsx(
26747
+ "span",
26748
+ {
26749
+ style: {
26750
+ fontSize: "11px",
26751
+ fontWeight: 600,
26752
+ color: "#9ca3af",
26753
+ textTransform: "uppercase",
26754
+ letterSpacing: "0.05em"
26755
+ },
26756
+ children: "Hover"
26757
+ }
26758
+ ),
26759
+ /* @__PURE__ */ jsx(
26760
+ ColorInputRow,
26761
+ {
26762
+ label: "Background",
26763
+ value: theme.variables[`${prefix}-bg-hover`] ?? "",
26764
+ onChange: (val) => theme.setVariable(`${prefix}-bg-hover`, val),
26765
+ variableOptions: buttonColorVariableOptions
26766
+ }
26767
+ ),
26768
+ /* @__PURE__ */ jsx(
26769
+ ColorInputRow,
26770
+ {
26771
+ label: "Text",
26772
+ value: theme.variables[`${prefix}-text-hover`] ?? "",
26773
+ onChange: (val) => theme.setVariable(`${prefix}-text-hover`, val),
26774
+ variableOptions: buttonColorVariableOptions
26775
+ }
26776
+ ),
26777
+ /* @__PURE__ */ jsx(
26778
+ ColorInputRow,
26779
+ {
26780
+ label: "Border",
26781
+ value: theme.variables[`${prefix}-border-hover`] ?? "",
26782
+ onChange: (val) => theme.setVariable(`${prefix}-border-hover`, val),
26783
+ variableOptions: buttonColorVariableOptions
26784
+ }
26785
+ )
26786
+ ] })
26787
+ ] })
26788
+ ]
26789
+ }
26790
+ );
26791
+ }
26792
+ function CustomButtonColorGroup({
26793
+ style,
26794
+ theme
26795
+ }) {
26796
+ const [expanded, setExpanded] = React13__default.useState(false);
26797
+ const [editing, setEditing] = React13__default.useState(false);
26798
+ return /* @__PURE__ */ jsxs(
26799
+ "div",
26800
+ {
26801
+ style: {
26802
+ border: "1px solid #e5e7eb",
26803
+ borderRadius: "8px",
26804
+ marginBottom: "8px",
26805
+ overflow: "hidden"
26806
+ },
26807
+ children: [
26808
+ /* @__PURE__ */ jsxs(
26809
+ "div",
26810
+ {
26811
+ style: {
26812
+ display: "flex",
26813
+ alignItems: "center",
26814
+ justifyContent: "space-between",
26815
+ width: "100%",
26816
+ padding: "10px 12px",
26817
+ background: "#f9fafb"
26818
+ },
26819
+ children: [
26820
+ editing ? /* @__PURE__ */ jsx(
26821
+ "input",
26822
+ {
26823
+ type: "text",
26824
+ value: style.label,
26825
+ onChange: (e) => theme.updateCustomButtonStyle(style.id, { label: e.target.value }),
26826
+ onBlur: () => setEditing(false),
26827
+ onKeyDown: (e) => e.key === "Enter" && setEditing(false),
26828
+ autoFocus: true,
26829
+ style: {
26830
+ fontSize: "13px",
26831
+ fontWeight: 600,
26832
+ color: "#374151",
26833
+ border: "1px solid #e5e7eb",
26834
+ borderRadius: "4px",
26835
+ padding: "2px 6px",
26836
+ background: "#ffffff",
26837
+ flex: 1
26838
+ }
26839
+ }
26840
+ ) : /* @__PURE__ */ jsx(
26841
+ "button",
26842
+ {
26843
+ onClick: () => setExpanded(!expanded),
26844
+ style: {
26845
+ flex: 1,
26846
+ textAlign: "left",
26847
+ fontSize: "13px",
26848
+ fontWeight: 600,
26849
+ color: "#374151",
26850
+ background: "none",
26851
+ border: "none",
26852
+ cursor: "pointer"
26853
+ },
26854
+ onDoubleClick: (e) => {
26855
+ e.stopPropagation();
26856
+ setEditing(true);
26857
+ },
26858
+ children: style.label
26859
+ }
26860
+ ),
26861
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
24784
26862
  /* @__PURE__ */ jsx(
24785
- "label",
26863
+ "button",
24786
26864
  {
26865
+ onClick: () => theme.deleteCustomButtonStyle(style.id),
24787
26866
  style: {
24788
- fontSize: "12px",
24789
- color: "#6b7280",
24790
- width: "80px",
24791
- flexShrink: 0
26867
+ fontSize: "11px",
26868
+ color: "#dc2626",
26869
+ background: "none",
26870
+ border: "none",
26871
+ cursor: "pointer",
26872
+ padding: "2px 6px"
24792
26873
  },
24793
- children: field.label
26874
+ children: "Delete"
24794
26875
  }
24795
26876
  ),
24796
26877
  /* @__PURE__ */ jsx(
24797
- "input",
26878
+ "button",
24798
26879
  {
24799
- type: "text",
24800
- value: theme.variables[key] ?? "",
24801
- onChange: (e) => theme.setVariable(key, e.target.value),
26880
+ onClick: () => setExpanded(!expanded),
24802
26881
  style: {
24803
- flex: 1,
24804
- fontSize: "12px",
24805
- fontFamily: "monospace",
24806
- padding: "4px 8px",
24807
- border: "1px solid #e5e7eb",
24808
- borderRadius: "4px",
24809
- color: "#374151",
24810
- background: "#ffffff"
24811
- }
26882
+ fontSize: "11px",
26883
+ color: "#9ca3af",
26884
+ background: "none",
26885
+ border: "none",
26886
+ cursor: "pointer",
26887
+ transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
26888
+ transition: "transform 150ms"
26889
+ },
26890
+ children: "\u25BC"
24812
26891
  }
24813
26892
  )
24814
- ]
24815
- },
24816
- key
24817
- );
24818
- }) })
26893
+ ] })
26894
+ ]
26895
+ }
26896
+ ),
26897
+ expanded && /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px" }, className: "flex flex-col gap-1", children: [
26898
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "8px" }, children: [
26899
+ /* @__PURE__ */ jsx(
26900
+ "span",
26901
+ {
26902
+ style: {
26903
+ fontSize: "11px",
26904
+ fontWeight: 600,
26905
+ color: "#9ca3af",
26906
+ textTransform: "uppercase",
26907
+ letterSpacing: "0.05em"
26908
+ },
26909
+ children: "Normal"
26910
+ }
26911
+ ),
26912
+ /* @__PURE__ */ jsx(
26913
+ ColorInputRow,
26914
+ {
26915
+ label: "Background",
26916
+ value: style.bg,
26917
+ onChange: (val) => theme.updateCustomButtonStyle(style.id, { bg: val }),
26918
+ variableOptions: buttonColorVariableOptions
26919
+ }
26920
+ ),
26921
+ /* @__PURE__ */ jsx(
26922
+ ColorInputRow,
26923
+ {
26924
+ label: "Text",
26925
+ value: style.text,
26926
+ onChange: (val) => theme.updateCustomButtonStyle(style.id, { text: val }),
26927
+ variableOptions: buttonColorVariableOptions
26928
+ }
26929
+ ),
26930
+ /* @__PURE__ */ jsx(
26931
+ ColorInputRow,
26932
+ {
26933
+ label: "Border",
26934
+ value: style.border,
26935
+ onChange: (val) => theme.updateCustomButtonStyle(style.id, { border: val }),
26936
+ variableOptions: buttonColorVariableOptions
26937
+ }
26938
+ )
26939
+ ] }),
26940
+ /* @__PURE__ */ jsxs("div", { children: [
26941
+ /* @__PURE__ */ jsx(
26942
+ "span",
26943
+ {
26944
+ style: {
26945
+ fontSize: "11px",
26946
+ fontWeight: 600,
26947
+ color: "#9ca3af",
26948
+ textTransform: "uppercase",
26949
+ letterSpacing: "0.05em"
26950
+ },
26951
+ children: "Hover"
26952
+ }
26953
+ ),
26954
+ /* @__PURE__ */ jsx(
26955
+ ColorInputRow,
26956
+ {
26957
+ label: "Background",
26958
+ value: style.bgHover,
26959
+ onChange: (val) => theme.updateCustomButtonStyle(style.id, { bgHover: val }),
26960
+ variableOptions: buttonColorVariableOptions
26961
+ }
26962
+ ),
26963
+ /* @__PURE__ */ jsx(
26964
+ ColorInputRow,
26965
+ {
26966
+ label: "Text",
26967
+ value: style.textHover,
26968
+ onChange: (val) => theme.updateCustomButtonStyle(style.id, { textHover: val }),
26969
+ variableOptions: buttonColorVariableOptions
26970
+ }
26971
+ ),
26972
+ /* @__PURE__ */ jsx(
26973
+ ColorInputRow,
26974
+ {
26975
+ label: "Border",
26976
+ value: style.borderHover,
26977
+ onChange: (val) => theme.updateCustomButtonStyle(style.id, { borderHover: val }),
26978
+ variableOptions: buttonColorVariableOptions
26979
+ }
26980
+ )
26981
+ ] })
26982
+ ] })
24819
26983
  ]
24820
26984
  }
24821
26985
  );
@@ -25221,6 +27385,7 @@ function ExportPanel({ theme }) {
25221
27385
  }
25222
27386
  var panelConfig = [
25223
27387
  { id: "colors", label: "Colors" },
27388
+ { id: "images", label: "Images" },
25224
27389
  { id: "typography", label: "Type" },
25225
27390
  { id: "buttons", label: "Buttons" },
25226
27391
  { id: "inputs", label: "Inputs" },
@@ -25257,7 +27422,8 @@ var drawerStyles = {
25257
27422
  background: "#f9fafb",
25258
27423
  padding: "0",
25259
27424
  gap: "0",
25260
- flexShrink: 0
27425
+ flexShrink: 0,
27426
+ overflowX: "auto"
25261
27427
  },
25262
27428
  tab: (active) => ({
25263
27429
  flex: 1,
@@ -25270,8 +27436,18 @@ var drawerStyles = {
25270
27436
  borderBottom: active ? "2px solid #1f2937" : "2px solid transparent",
25271
27437
  cursor: "pointer",
25272
27438
  transition: "color 150ms, border-color 150ms",
25273
- textAlign: "center"
25274
- })
27439
+ textAlign: "center",
27440
+ whiteSpace: "nowrap"
27441
+ }),
27442
+ footer: {
27443
+ display: "flex",
27444
+ justifyContent: "center",
27445
+ alignItems: "center",
27446
+ padding: "12px 16px",
27447
+ borderTop: "1px solid #e5e7eb",
27448
+ flexShrink: 0,
27449
+ background: "#ffffff"
27450
+ }
25275
27451
  };
25276
27452
  function PaletteIcon6() {
25277
27453
  return /* @__PURE__ */ jsxs(
@@ -25301,20 +27477,32 @@ function ThemeDrawer({
25301
27477
  defaultOpen = false,
25302
27478
  panels: enabledPanels,
25303
27479
  onThemeChange,
27480
+ onBrandingChange,
27481
+ onImagesChange,
27482
+ onImageUpload,
25304
27483
  initialOverrides,
25305
- storageKey
27484
+ storageKey,
27485
+ title = "Design Variables",
27486
+ width = 464
25306
27487
  }) {
25307
27488
  if (devOnly && process.env.NODE_ENV === "production") {
25308
27489
  return null;
25309
27490
  }
25310
27491
  const [open, setOpen] = useState(defaultOpen);
25311
27492
  const [activeTab, setActiveTab] = useState("colors");
27493
+ const [resetConfirmOpen, setResetConfirmOpen] = useState(false);
25312
27494
  const theme = useThemeState({
25313
27495
  storageKey,
25314
27496
  initialOverrides,
25315
- onThemeChange
27497
+ onThemeChange,
27498
+ onBrandingChange,
27499
+ onImagesChange
25316
27500
  });
25317
27501
  const activePanels = enabledPanels ? panelConfig.filter((p) => enabledPanels.includes(p.id)) : panelConfig;
27502
+ const handleReset = () => {
27503
+ theme.resetAll();
27504
+ setResetConfirmOpen(false);
27505
+ };
25318
27506
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25319
27507
  !open && /* @__PURE__ */ jsx(
25320
27508
  "button",
@@ -25338,8 +27526,12 @@ function ThemeDrawer({
25338
27526
  {
25339
27527
  side: "right",
25340
27528
  "data-theme-drawer": true,
25341
- className: "!p-0 !gap-0 !w-[380px] !max-w-[380px]",
25342
- style: drawerStyles.container,
27529
+ className: `!p-0 !gap-0 !w-[${width}px] !max-w-[${width}px]`,
27530
+ style: {
27531
+ ...drawerStyles.container,
27532
+ width: `${width}px`,
27533
+ maxWidth: `${width}px`
27534
+ },
25343
27535
  children: [
25344
27536
  /* @__PURE__ */ jsx(
25345
27537
  SheetHeader,
@@ -25360,7 +27552,7 @@ function ThemeDrawer({
25360
27552
  color: "#1f2937",
25361
27553
  fontFamily: drawerStyles.container.fontFamily
25362
27554
  },
25363
- children: "Theme Editor"
27555
+ children: title
25364
27556
  }
25365
27557
  ),
25366
27558
  /* @__PURE__ */ jsx(
@@ -25372,7 +27564,7 @@ function ThemeDrawer({
25372
27564
  marginTop: "2px",
25373
27565
  fontFamily: drawerStyles.container.fontFamily
25374
27566
  },
25375
- children: "Customize your design system"
27567
+ children: theme.unsavedChangesCount > 0 ? `${theme.unsavedChangesCount} unsaved modification${theme.unsavedChangesCount !== 1 ? "s" : ""}` : "Customize your design system"
25376
27568
  }
25377
27569
  )
25378
27570
  ] })
@@ -25387,13 +27579,108 @@ function ThemeDrawer({
25387
27579
  },
25388
27580
  panel.id
25389
27581
  )) }),
25390
- /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 overflow-hidden", style: { height: "calc(100vh - 140px)" }, children: /* @__PURE__ */ jsxs("div", { style: drawerStyles.container, children: [
25391
- activeTab === "colors" && /* @__PURE__ */ jsx(ColorsPanel, { theme }),
25392
- activeTab === "typography" && /* @__PURE__ */ jsx(TypographyPanel, { theme }),
25393
- activeTab === "buttons" && /* @__PURE__ */ jsx(ButtonsPanel, { theme }),
25394
- activeTab === "inputs" && /* @__PURE__ */ jsx(InputsPanel, { theme }),
25395
- activeTab === "export" && /* @__PURE__ */ jsx(ExportPanel, { theme })
25396
- ] }) })
27582
+ /* @__PURE__ */ jsx(
27583
+ ScrollArea,
27584
+ {
27585
+ className: "flex-1 overflow-hidden",
27586
+ style: { height: `calc(100vh - ${theme.isDirty ? 200 : 150}px)` },
27587
+ children: /* @__PURE__ */ jsxs("div", { style: drawerStyles.container, children: [
27588
+ activeTab === "colors" && /* @__PURE__ */ jsx(ColorsPanel, { theme }),
27589
+ activeTab === "images" && /* @__PURE__ */ jsx(ImagesPanel, { theme, onImageUpload }),
27590
+ activeTab === "typography" && /* @__PURE__ */ jsx(TypographyPanel, { theme }),
27591
+ activeTab === "buttons" && /* @__PURE__ */ jsx(ButtonsPanel, { theme }),
27592
+ activeTab === "inputs" && /* @__PURE__ */ jsx(InputsPanel, { theme }),
27593
+ activeTab === "export" && /* @__PURE__ */ jsx(ExportPanel, { theme })
27594
+ ] })
27595
+ }
27596
+ ),
27597
+ theme.isDirty && /* @__PURE__ */ jsx("div", { style: drawerStyles.footer, children: resetConfirmOpen ? /* @__PURE__ */ jsxs(
27598
+ "div",
27599
+ {
27600
+ style: {
27601
+ display: "flex",
27602
+ flexDirection: "column",
27603
+ gap: "8px",
27604
+ width: "100%"
27605
+ },
27606
+ children: [
27607
+ /* @__PURE__ */ jsx(
27608
+ "span",
27609
+ {
27610
+ style: {
27611
+ fontSize: "13px",
27612
+ color: "#374151",
27613
+ textAlign: "center"
27614
+ },
27615
+ children: "Reset all settings to defaults?"
27616
+ }
27617
+ ),
27618
+ /* @__PURE__ */ jsxs(
27619
+ "div",
27620
+ {
27621
+ style: {
27622
+ display: "flex",
27623
+ gap: "8px",
27624
+ justifyContent: "center"
27625
+ },
27626
+ children: [
27627
+ /* @__PURE__ */ jsx(
27628
+ "button",
27629
+ {
27630
+ onClick: () => setResetConfirmOpen(false),
27631
+ style: {
27632
+ fontSize: "13px",
27633
+ fontWeight: 500,
27634
+ color: "#374151",
27635
+ background: "#ffffff",
27636
+ border: "1px solid #e5e7eb",
27637
+ cursor: "pointer",
27638
+ padding: "6px 16px",
27639
+ borderRadius: "6px"
27640
+ },
27641
+ children: "Cancel"
27642
+ }
27643
+ ),
27644
+ /* @__PURE__ */ jsx(
27645
+ "button",
27646
+ {
27647
+ onClick: handleReset,
27648
+ style: {
27649
+ fontSize: "13px",
27650
+ fontWeight: 500,
27651
+ color: "#ffffff",
27652
+ background: "#dc2626",
27653
+ border: "1px solid #dc2626",
27654
+ cursor: "pointer",
27655
+ padding: "6px 16px",
27656
+ borderRadius: "6px"
27657
+ },
27658
+ children: "Reset All"
27659
+ }
27660
+ )
27661
+ ]
27662
+ }
27663
+ )
27664
+ ]
27665
+ }
27666
+ ) : /* @__PURE__ */ jsx(
27667
+ "button",
27668
+ {
27669
+ onClick: () => setResetConfirmOpen(true),
27670
+ style: {
27671
+ fontSize: "13px",
27672
+ fontWeight: 500,
27673
+ color: "#dc2626",
27674
+ background: "none",
27675
+ border: "1px solid #fca5a5",
27676
+ cursor: "pointer",
27677
+ padding: "8px 16px",
27678
+ borderRadius: "6px",
27679
+ width: "100%"
27680
+ },
27681
+ children: "Reset All to Defaults"
27682
+ }
27683
+ ) })
25397
27684
  ]
25398
27685
  }
25399
27686
  ) })
@@ -25419,6 +27706,6 @@ function getTopLevelScreens(allScreens) {
25419
27706
  return allScreens.filter((s) => !s.parentId);
25420
27707
  }
25421
27708
 
25422
- export { AccountSettingsShell, ActivityFeed, Avatar, AvatarFallback, AvatarImage, BadgesCard, BlogCards, BottomInputChatWidget, Button, Calendar, CanvasItem, CategoryGrid, CenteredHero, ChatBubble, ChatDateSeparator, ChatInput, ChatMessageList, Checkbox, CheckboxWithLabel, CircularProgressBar, CircularProgressBarList, ComponentPalette, ComponentSearch, ContentDropzone, ContentWithImage, CoreValuesGrid, CreditCardDisplay, CtaBanner, CustomComponentHelper, DashboardHeader, DashboardShell, DateInput, DescriptionCard, DestinationCards, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChartWidget, DoubleSidebar, DoubleSidebarShell, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FaqAccordion, FaqsTable, FeatureWithImage, FeaturedNewsCards, FeaturedPlaces, FeaturesComparison, FileUploader, FilterPopover, FixedColumnDataTable, FlairBanner, FooterNavbar, FormGroup, GallerySection, GradientBanner, GraphMetricTilesDemo, GridTilesList, Header, HeroDarkCentered, HeroDarkWithImage, HeroFullwidthImage, HeroSection, HowItWorks, IconSidebar, IconSidebarShell, ImageFeedWithNestedComments, ImageUploader, InfoCard, Input, Label2 as Label, LargeImageLabelsList, Sidebar2 as LayoutSidebar, LineChartWidget, LineTabs, LinksCard, Loader, LoginBrandingPanel, MenuSection, MenufocusTemplate, MessengerInput, MessengerSidebar, MetricCard, MetricCardsRow, MetricListCard, MetricsSection, MobileBottomNav, MobileMenuShell, MonthlyCalendarWidget, MultiselectCheckboxField, MultiselectTags, MultistepProgressBarShell, MultistepShell, MultistepSidebarShell, NestedCommentsTable, NestedDataTable, OfficeLocations, PageHeaderSection, Pagination, ParticipantList, PersonaCard, PersonaGrid, PillTabs, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortfolioCard, PreviewBrandingContext, PricingCards, PricingCta, ProfileCard, ProfileGridTilesList, ProfileImageUploader, ProgressBar, ProgressMetricCard, ProjectContextShell, PromptChipsRow, PromptTemplate, RadioGroup2 as RadioGroup, RadioGroupItem, RangeInput, ReviewsGrid, ReviewsTable, ScreenFlowchart, ScreenPromptBuilder, ScreenPromptTemplate, ScrollArea, ScrollBar, SearchBar, SearchBarShell, SearchSidebar, Searchbox, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectablePills, Separator3 as Separator, SettingsListRow, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNav, SidebarProfileCard, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, SkillsCard, Slider, SlideshowGridTiles, SocialFeed, SocialProof, StandardDataTable, StandardListWithImage, StandardPageShell, StatsCard, StepTracker, Switch, Tabs, TabsContent, TabsList, TabsTrigger, TeamCardsGrid, TeamCircularGrid, TestimonialCarousel, TextInput, Textarea, ThemeContext, ThemeDrawer, ThemeProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TwoColumnWidgets, Typography, UpvotingPostsTable, VerticalHowItWorks, VerticalMultistepShell, VerticalStepTracker, VideoChatControls, VideoContentSection, VideoPlaylistCard, VideoPlaylistItem, WebcamPreview, YouTubePlayer, accountTabs, allColorVariables, blocks, broadcastCSSVariables, buttonVariants, canvasBlocks, cn, colorVariables, defaultBranding, defaultButtonColorStyles, defaultButtonColors, defaultButtonSizes, defaultColors, defaultCustomButtonStyles, defaultDoubleSidebarSections, defaultIconNavItems, defaultImages, defaultInputSizes, defaultProgressBarSteps, defaultSteps, defaultSupportLinks, defaultTypography, defaultVerticalSteps, getChildScreens, getScreenUrl, getTopLevelScreens, groupModalDrawerBlocks, layoutPrimitives, layoutShells, marketingBlocks, pageTemplates, pricingBlocks, removeCSSVariables, setCSSVariable, setCSSVariables, setupCSSVariableListener, useCSSVariableSync, useIsMobile, usePreviewBranding, useSidebar, useThemeBrandAssets, useThemeBranding, useThemeImages, videoBlocks };
27709
+ export { AccountSettingsShell, ActivityFeed, Avatar, AvatarFallback, AvatarImage, BadgesCard, BlogCards, BottomInputChatWidget, Button, Calendar, CanvasItem, CategoryGrid, CenteredHero, ChatBubble, ChatDateSeparator, ChatInput, ChatMessageList, Checkbox, CheckboxWithLabel, CircularProgressBar, CircularProgressBarList, ColorInputRow, ComponentPalette, ComponentSearch, ContentDropzone, ContentWithImage, CoreValuesGrid, CreditCardDisplay, CtaBanner, CustomComponentHelper, DashboardHeader, DashboardShell, DateInput, DescriptionCard, DestinationCards, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChartWidget, DoubleSidebar, DoubleSidebarShell, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FaqAccordion, FaqsTable, FeatureWithImage, FeaturedNewsCards, FeaturedPlaces, FeaturesComparison, FileUploader, FilterPopover, FixedColumnDataTable, FlairBanner, FooterNavbar, FormGroup, GallerySection, GradientBanner, GraphMetricTilesDemo, GridTilesList, Header, HeroDarkCentered, HeroDarkWithImage, HeroFullwidthImage, HeroSection, HowItWorks, HslColorPicker, IconSidebar, IconSidebarShell, ImageFeedWithNestedComments, ImageUploader, InfoCard, Input, Label2 as Label, LargeImageLabelsList, Sidebar2 as LayoutSidebar, LineChartWidget, LineTabs, LinksCard, Loader, LoginBrandingPanel, MenuSection, MenufocusTemplate, MessengerInput, MessengerSidebar, MetricCard, MetricCardsRow, MetricListCard, MetricsSection, MobileBottomNav, MobileMenuShell, MonthlyCalendarWidget, MultiselectCheckboxField, MultiselectTags, MultistepProgressBarShell, MultistepShell, MultistepSidebarShell, NestedCommentsTable, NestedDataTable, OfficeLocations, PageHeaderSection, Pagination, ParticipantList, PersonaCard, PersonaGrid, PillTabs, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortfolioCard, PreviewBrandingContext, PricingCards, PricingCta, ProfileCard, ProfileGridTilesList, ProfileImageUploader, ProgressBar, ProgressMetricCard, ProjectContextShell, PromptChipsRow, PromptTemplate, RadioGroup2 as RadioGroup, RadioGroupItem, RangeInput, ReviewsGrid, ReviewsTable, ScreenFlowchart, ScreenPromptBuilder, ScreenPromptTemplate, ScrollArea, ScrollBar, SearchBar, SearchBarShell, SearchSidebar, Searchbox, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectablePills, Separator3 as Separator, SettingsListRow, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNav, SidebarProfileCard, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, SkillsCard, Slider, SlideshowGridTiles, SocialFeed, SocialProof, StandardDataTable, StandardListWithImage, StandardPageShell, StatsCard, StepTracker, Switch, Tabs, TabsContent, TabsList, TabsTrigger, TeamCardsGrid, TeamCircularGrid, TestimonialCarousel, TextInput, Textarea, ThemeContext, ThemeDrawer, ThemeProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TwoColumnWidgets, Typography, UpvotingPostsTable, VerticalHowItWorks, VerticalMultistepShell, VerticalStepTracker, VideoChatControls, VideoContentSection, VideoPlaylistCard, VideoPlaylistItem, WebcamPreview, YouTubePlayer, accountTabs, allColorVariables, blocks, broadcastCSSVariables, buttonVariants, canvasBlocks, cn, colorVariables, defaultBranding, defaultButtonColorStyles, defaultButtonColors, defaultButtonSizes, defaultColors, defaultCustomButtonStyles, defaultDoubleSidebarSections, defaultIconNavItems, defaultImages, defaultInputSizes, defaultProgressBarSteps, defaultSteps, defaultSupportLinks, defaultTypography, defaultVerticalSteps, getChildScreens, getScreenUrl, getTopLevelScreens, groupModalDrawerBlocks, layoutPrimitives, layoutShells, marketingBlocks, pageTemplates, pricingBlocks, removeCSSVariables, setCSSVariable, setCSSVariables, setupCSSVariableListener, useCSSVariableSync, useIsMobile, usePreviewBranding, useSidebar, useThemeBrandAssets, useThemeBranding, useThemeImages, videoBlocks };
25423
27710
  //# sourceMappingURL=index.js.map
25424
27711
  //# sourceMappingURL=index.js.map