@webmate-studio/builder 0.2.134 → 0.2.135

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.134",
3
+ "version": "0.2.135",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -13,6 +13,7 @@ import {
13
13
  BUTTON_VARIANTS,
14
14
  BUTTON_SIZES,
15
15
  calculateOnColor,
16
+ DEFAULT_SURFACE_TOKENS,
16
17
  defaultDesignTokensV2
17
18
  } from './design-tokens-v2.js';
18
19
 
@@ -142,6 +143,22 @@ function generateColorVariables(t, lines) {
142
143
  if (mapping.ring) lines.push(` --color-${world}-ring: var(--color-${world}-${mapping.ring});`);
143
144
  }
144
145
  }
146
+
147
+ // Surface, Text & Border Tokens
148
+ const surface = t.surface || DEFAULT_SURFACE_TOKENS;
149
+ lines.push(' /* surface tokens */');
150
+ if (surface.page) lines.push(` --color-surface-page: ${resolveColorRef(surface.page, t)};`);
151
+ if (surface.elevated) lines.push(` --color-surface-elevated: ${resolveColorRef(surface.elevated, t)};`);
152
+ if (surface.lifted) lines.push(` --color-surface-lifted: ${resolveColorRef(surface.lifted, t)};`);
153
+ if (surface.overlay) lines.push(` --color-surface-overlay: ${resolveColorRef(surface.overlay, t)};`);
154
+ lines.push(' /* text tokens */');
155
+ if (surface.textDefault) lines.push(` --color-text-default: ${resolveColorRef(surface.textDefault, t)};`);
156
+ if (surface.textSubtle) lines.push(` --color-text-subtle: ${resolveColorRef(surface.textSubtle, t)};`);
157
+ if (surface.textMuted) lines.push(` --color-text-muted: ${resolveColorRef(surface.textMuted, t)};`);
158
+ lines.push(' /* border tokens */');
159
+ if (surface.borderDefault) lines.push(` --color-border-default: ${resolveColorRef(surface.borderDefault, t)};`);
160
+ if (surface.borderSubtle) lines.push(` --color-border-subtle: ${resolveColorRef(surface.borderSubtle, t)};`);
161
+ if (surface.borderStrong) lines.push(` --color-border-strong: ${resolveColorRef(surface.borderStrong, t)};`);
145
162
  }
146
163
 
147
164
 
@@ -205,6 +222,42 @@ function generateColorUtilities(t) {
205
222
  }
206
223
  }
207
224
 
225
+ // Surface Utilities: bg-page, bg-elevated, bg-lifted, bg-overlay
226
+ const surfaceUtils = [
227
+ { cls: 'bg-page', prop: 'background-color', varRef: '--color-surface-page' },
228
+ { cls: 'bg-elevated', prop: 'background-color', varRef: '--color-surface-elevated' },
229
+ { cls: 'bg-lifted', prop: 'background-color', varRef: '--color-surface-lifted' },
230
+ { cls: 'bg-overlay', prop: 'background-color', varRef: '--color-surface-overlay' },
231
+ ];
232
+
233
+ for (const { cls, prop, varRef } of surfaceUtils) {
234
+ css += `\n.${cls} { ${prop}: var(${varRef}); }`;
235
+ }
236
+
237
+ // Text Utilities: text-default, text-subtle, text-muted
238
+ const textUtils = [
239
+ { cls: 'text-default', prop: 'color', varRef: '--color-text-default' },
240
+ { cls: 'text-subtle', prop: 'color', varRef: '--color-text-subtle' },
241
+ { cls: 'text-muted', prop: 'color', varRef: '--color-text-muted' },
242
+ ];
243
+
244
+ for (const { cls, prop, varRef } of textUtils) {
245
+ css += `\n.${cls} { ${prop}: var(${varRef}); }`;
246
+ css += `\n.hover\\:${cls}:hover { ${prop}: var(${varRef}); }`;
247
+ }
248
+
249
+ // Border Utilities: border-default, border-subtle, border-strong
250
+ const borderUtils = [
251
+ { cls: 'border-default', prop: 'border-color', varRef: '--color-border-default' },
252
+ { cls: 'border-subtle', prop: 'border-color', varRef: '--color-border-subtle' },
253
+ { cls: 'border-strong', prop: 'border-color', varRef: '--color-border-strong' },
254
+ ];
255
+
256
+ for (const { cls, prop, varRef } of borderUtils) {
257
+ css += `\n.${cls} { ${prop}: var(${varRef}); }`;
258
+ css += `\n.hover\\:${cls}:hover { ${prop}: var(${varRef}); }`;
259
+ }
260
+
208
261
  css += '\n}'; // Close @layer utilities
209
262
  return css;
210
263
  }
@@ -686,8 +739,8 @@ function generateBaseStyles(t) {
686
739
  return `\n/* Global baseline styles */
687
740
  body {
688
741
  font-family: ${fontFamily};
689
- background-color: var(--color-neutral-1);
690
- color: var(--color-neutral-12);
742
+ background-color: var(--color-surface-page);
743
+ color: var(--color-text-default);
691
744
  }`;
692
745
  }
693
746
 
@@ -204,6 +204,45 @@ export const DEFAULT_SEMANTIC_MAPPINGS = {
204
204
  };
205
205
 
206
206
 
207
+ // ─── Surface & Text Tokens ─────────────────────────────────────────────────
208
+
209
+ /**
210
+ * Globale Surface-, Text- und Border-Aliase.
211
+ * Mappen semantische Konzepte (page, elevated, default, muted)
212
+ * auf Neutral-Stufen. Damit braucht der User kein Radix-Insiderwissen.
213
+ */
214
+ export const DEFAULT_SURFACE_TOKENS = {
215
+ page: 'neutral-1',
216
+ elevated: 'neutral-2',
217
+ lifted: 'neutral-3',
218
+ overlay: 'neutral-1/80',
219
+
220
+ textDefault: 'neutral-12',
221
+ textSubtle: 'neutral-11',
222
+ textMuted: 'neutral-8',
223
+
224
+ borderDefault: 'neutral-6',
225
+ borderSubtle: 'neutral-4',
226
+ borderStrong: 'neutral-7'
227
+ };
228
+
229
+ /**
230
+ * Labels und Beschreibungen für den Editor.
231
+ */
232
+ export const SURFACE_TOKEN_META = {
233
+ page: { label: 'Page', desc: 'Seitenhintergrund (body)', group: 'surface' },
234
+ elevated: { label: 'Elevated', desc: 'Karten, Modals, Panels', group: 'surface' },
235
+ lifted: { label: 'Lifted', desc: 'Element auf erhöhter Fläche', group: 'surface' },
236
+ overlay: { label: 'Overlay', desc: 'Backdrop / Overlay', group: 'surface' },
237
+ textDefault: { label: 'Default', desc: 'Standard-Textfarbe', group: 'text' },
238
+ textSubtle: { label: 'Subtle', desc: 'Sekundärer Text', group: 'text' },
239
+ textMuted: { label: 'Muted', desc: 'Platzhalter, deaktiviert', group: 'text' },
240
+ borderDefault: { label: 'Default', desc: 'Standard-Rahmen', group: 'border' },
241
+ borderSubtle: { label: 'Subtle', desc: 'Dezenter Rahmen', group: 'border' },
242
+ borderStrong: { label: 'Strong', desc: 'Starker Rahmen (Inputs)', group: 'border' }
243
+ };
244
+
245
+
207
246
  // ─── Typografie ─────────────────────────────────────────────────────────────
208
247
 
209
248
  /**
@@ -299,6 +338,8 @@ export const defaultDesignTokensV2 = {
299
338
  info: { ...DEFAULT_SEMANTIC_MAPPINGS }
300
339
  },
301
340
 
341
+ surface: { ...DEFAULT_SURFACE_TOKENS },
342
+
302
343
  darkMode: {
303
344
  enabled: false,
304
345
  colors: null, // Wird bei Aktivierung auto-generiert