juxscript 1.1.142 → 1.1.143

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.
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQxD,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAChG,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,q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AiB,IAAI,SAAS,MAAM,EAAE;IAQhD;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO1B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM5B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAI3C,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAK/B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI;IAO/C;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAgBzB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAQtC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAW7B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CAwDnE;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAElE"}
@@ -120,50 +120,17 @@ export class Button extends BaseComponent {
120
120
  }
121
121
  render(targetId) {
122
122
  const container = this._setupContainer(targetId);
123
- const { content, icon, iconPosition, variant, size, style, class: className } = this.state;
123
+ const { content, icon, iconPosition, style, class: className } = this.state;
124
124
  const button = document.createElement('button');
125
- // ✅ ONLY set base class (no variant/size classes)
125
+ // ✅ ONLY set base class - NO variant/size classes
126
126
  button.className = 'jux-button';
127
127
  button.id = this._id;
128
- // ✅ Add user classes
128
+ // ✅ Add user classes only
129
129
  if (className)
130
130
  button.className += ` ${className}`;
131
- // ✅ Apply variant via CSS variables (inline style)
132
- let inlineStyle = style || '';
133
- // Map variant to CSS variable overrides
134
- if (variant === 'success') {
135
- inlineStyle += `--jux-accent-bg: var(--jux-success-bg); --jux-accent-to: var(--jux-success-to);`;
136
- }
137
- else if (variant === 'danger') {
138
- inlineStyle += `--jux-accent-bg: var(--jux-danger-bg); --jux-accent-to: var(--jux-danger-to);`;
139
- }
140
- else if (variant === 'warning') {
141
- inlineStyle += `--jux-accent-bg: var(--jux-warning-bg); --jux-accent-to: var(--jux-warning-to);`;
142
- }
143
- else if (variant === 'info') {
144
- inlineStyle += `--jux-accent-bg: var(--jux-info-bg); --jux-accent-to: var(--jux-info-to);`;
145
- }
146
- else if (variant === 'secondary') {
147
- inlineStyle += `--jux-accent-bg: var(--jux-brand-accent-bg); --jux-accent-to: var(--jux-brand-accent-to);`;
148
- }
149
- else if (variant === 'ghost') {
150
- inlineStyle += `background: transparent; border-color: transparent; color: var(--jux-brand-color);`;
151
- }
152
- else if (variant === 'outline') {
153
- inlineStyle += `background: transparent; color: var(--jux-brand-color); border-color: var(--jux-brand-color);`;
154
- }
155
- // 'primary' uses default --jux-brand-bg from foundation.css
156
- // Map size to CSS variable overrides
157
- if (size === 'small') {
158
- inlineStyle += `--jux-pad: calc(0.375rem * var(--jux-size-xs)) calc(0.75rem * var(--jux-size-xs)); font-size: calc(var(--jux-base-font) * var(--jux-size-xs));`;
159
- }
160
- else if (size === 'large') {
161
- inlineStyle += `--jux-pad: calc(0.5rem * var(--jux-size-lg)) calc(1rem * var(--jux-size-lg)); font-size: calc(var(--jux-base-font) * var(--jux-size-lg));`;
162
- }
163
- // 'medium' uses default --jux-base-pad from foundation.css
164
- if (inlineStyle) {
165
- button.setAttribute('style', inlineStyle);
166
- }
131
+ // ✅ Apply style (NO variant/size logic - pure cascade)
132
+ if (style)
133
+ button.setAttribute('style', style);
167
134
  if (icon && iconPosition === 'left') {
168
135
  const iconEl = document.createElement('span');
169
136
  iconEl.className = 'jux-button-icon';
@@ -196,6 +163,7 @@ export class Button extends BaseComponent {
196
163
  });
197
164
  this._wireStandardEvents(button);
198
165
  container.appendChild(button);
166
+ this._buttonElement = button;
199
167
  return this;
200
168
  }
201
169
  }
@@ -173,49 +173,19 @@ export class Button extends BaseComponent<ButtonState> {
173
173
  render(targetId?: string | HTMLElement | BaseComponent<any>): this {
174
174
  const container = this._setupContainer(targetId);
175
175
 
176
- const { content, icon, iconPosition, variant, size, style, class: className } = this.state;
176
+ const { content, icon, iconPosition, style, class: className } = this.state;
177
177
 
178
178
  const button = document.createElement('button');
179
179
 
180
- // ✅ ONLY set base class (no variant/size classes)
180
+ // ✅ ONLY set base class - NO variant/size classes
181
181
  button.className = 'jux-button';
182
182
  button.id = this._id;
183
183
 
184
- // ✅ Add user classes
184
+ // ✅ Add user classes only
185
185
  if (className) button.className += ` ${className}`;
186
186
 
187
- // ✅ Apply variant via CSS variables (inline style)
188
- let inlineStyle = style || '';
189
-
190
- // Map variant to CSS variable overrides
191
- if (variant === 'success') {
192
- inlineStyle += `--jux-accent-bg: var(--jux-success-bg); --jux-accent-to: var(--jux-success-to);`;
193
- } else if (variant === 'danger') {
194
- inlineStyle += `--jux-accent-bg: var(--jux-danger-bg); --jux-accent-to: var(--jux-danger-to);`;
195
- } else if (variant === 'warning') {
196
- inlineStyle += `--jux-accent-bg: var(--jux-warning-bg); --jux-accent-to: var(--jux-warning-to);`;
197
- } else if (variant === 'info') {
198
- inlineStyle += `--jux-accent-bg: var(--jux-info-bg); --jux-accent-to: var(--jux-info-to);`;
199
- } else if (variant === 'secondary') {
200
- inlineStyle += `--jux-accent-bg: var(--jux-brand-accent-bg); --jux-accent-to: var(--jux-brand-accent-to);`;
201
- } else if (variant === 'ghost') {
202
- inlineStyle += `background: transparent; border-color: transparent; color: var(--jux-brand-color);`;
203
- } else if (variant === 'outline') {
204
- inlineStyle += `background: transparent; color: var(--jux-brand-color); border-color: var(--jux-brand-color);`;
205
- }
206
- // 'primary' uses default --jux-brand-bg from foundation.css
207
-
208
- // Map size to CSS variable overrides
209
- if (size === 'small') {
210
- inlineStyle += `--jux-pad: calc(0.375rem * var(--jux-size-xs)) calc(0.75rem * var(--jux-size-xs)); font-size: calc(var(--jux-base-font) * var(--jux-size-xs));`;
211
- } else if (size === 'large') {
212
- inlineStyle += `--jux-pad: calc(0.5rem * var(--jux-size-lg)) calc(1rem * var(--jux-size-lg)); font-size: calc(var(--jux-base-font) * var(--jux-size-lg));`;
213
- }
214
- // 'medium' uses default --jux-base-pad from foundation.css
215
-
216
- if (inlineStyle) {
217
- button.setAttribute('style', inlineStyle);
218
- }
187
+ // ✅ Apply style (NO variant/size logic - pure cascade)
188
+ if (style) button.setAttribute('style', style);
219
189
 
220
190
  if (icon && iconPosition === 'left') {
221
191
  const iconEl = document.createElement('span');
@@ -253,6 +223,7 @@ export class Button extends BaseComponent<ButtonState> {
253
223
 
254
224
  this._wireStandardEvents(button);
255
225
  container.appendChild(button);
226
+ this._buttonElement = button;
256
227
  return this;
257
228
  }
258
229
  }
@@ -44,13 +44,13 @@
44
44
  /* ═════════════════════════════════════════════════════════════════
45
45
  * 📏 SPACING SCALE (Base units for padding, gap, margins)
46
46
  * ═════════════════════════════════════════════════════════════════ */
47
- --jux-space-xs: 0.25rem; /* 4px */
48
- --jux-space-sm: 0.5rem; /* 8px */
49
- --jux-space-md: 1rem; /* 16px */
50
- --jux-space-lg: 1.5rem; /* 24px */
51
- --jux-space-xl: 2rem; /* 32px */
52
- --jux-space-2xl: 3rem; /* 48px */
53
- --jux-space-3xl: 4rem; /* 64px */
47
+ --jux-space-xs: 0.25rem;
48
+ --jux-space-sm: 0.5rem;
49
+ --jux-space-md: 1rem;
50
+ --jux-space-lg: 1.5rem;
51
+ --jux-space-xl: 2rem;
52
+ --jux-space-2xl: 3rem;
53
+ --jux-space-3xl: 4rem;
54
54
 
55
55
  /* ═════════════════════════════════════════════════════════════════
56
56
  * 🔤 TYPOGRAPHY SCALE
@@ -62,15 +62,15 @@
62
62
  --jux-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
63
63
 
64
64
  /* Font Sizes */
65
- --jux-text-xs: 0.75rem; /* 12px */
66
- --jux-text-sm: 0.875rem; /* 14px */
67
- --jux-text-base: 1rem; /* 16px */
68
- --jux-text-lg: 1.125rem; /* 18px */
69
- --jux-text-xl: 1.25rem; /* 20px */
70
- --jux-text-2xl: 1.5rem; /* 24px */
71
- --jux-text-3xl: 1.875rem; /* 30px */
72
- --jux-text-4xl: 2.25rem; /* 36px */
73
- --jux-text-5xl: 3rem; /* 48px */
65
+ --jux-text-xs: 0.75rem;
66
+ --jux-text-sm: 0.875rem;
67
+ --jux-text-base: 1rem;
68
+ --jux-text-lg: 1.125rem;
69
+ --jux-text-xl: 1.25rem;
70
+ --jux-text-2xl: 1.5rem;
71
+ --jux-text-3xl: 1.875rem;
72
+ --jux-text-4xl: 2.25rem;
73
+ --jux-text-5xl: 3rem;
74
74
 
75
75
  /* Font Weights */
76
76
  --jux-weight-thin: 100;
@@ -112,13 +112,15 @@
112
112
  --jux-size-md: 1;
113
113
  --jux-size-lg: 1.25;
114
114
  --jux-size-xl: 1.5;
115
-
116
- /* ═════════════════════════════════════════════════════════════════
117
- * 🤖 SYSTEM CONFIGURATION - AUTO-GENERATED
118
- * These are computed from your brand colors above
119
- * DO NOT MODIFY - Override brand colors instead
120
- * ═════════════════════════════════════════════════════════════════ */
121
-
115
+ }
116
+
117
+ /* ══════════════════════════════════════════════════════════════════
118
+ 🤖 SYSTEM CONFIGURATION - AUTO-GENERATED
119
+ These are computed from your brand colors above
120
+ MOVED TO html SCOPE - Re-computes on [data-swag] change
121
+ ══════════════════════════════════════════════════════════════════ */
122
+
123
+ html {
122
124
  /* Generated Brand Colors */
123
125
  --jux-brand-color: var(--jux-brand-from);
124
126
  --jux-brand-bg: var(--jux-brand-from);
@@ -361,56 +363,4 @@
361
363
  .jux-button:disabled {
362
364
  opacity: var(--jux-burn-strong);
363
365
  cursor: not-allowed;
364
- }
365
-
366
- /* ══════════════════════════════════════════════════════════════════
367
- BUTTON VARIANT CLASSES (Optional)
368
- ══════════════════════════════════════════════════════════════════ */
369
-
370
- .jux-button-success {
371
- --jux-accent-bg: var(--jux-success-bg);
372
- --jux-accent-to: var(--jux-success-to);
373
- }
374
-
375
- .jux-button-danger {
376
- --jux-accent-bg: var(--jux-danger-bg);
377
- --jux-accent-to: var(--jux-danger-to);
378
- }
379
-
380
- .jux-button-warning {
381
- --jux-accent-bg: var(--jux-warning-bg);
382
- --jux-accent-to: var(--jux-warning-to);
383
- }
384
-
385
- .jux-button-info {
386
- --jux-accent-bg: var(--jux-info-bg);
387
- --jux-accent-to: var(--jux-info-to);
388
- }
389
-
390
- .jux-button-secondary {
391
- --jux-accent-bg: var(--jux-brand-accent-bg);
392
- --jux-accent-to: var(--jux-brand-accent-to);
393
- }
394
-
395
- .jux-button-ghost {
396
- background: transparent;
397
- border-color: transparent;
398
- color: var(--jux-brand-color);
399
- }
400
-
401
- .jux-button-outline {
402
- background: transparent;
403
- color: var(--jux-brand-color);
404
- border-color: var(--jux-brand-color);
405
- }
406
-
407
- /* Size classes */
408
- .jux-button-small {
409
- --jux-pad: calc(0.375rem * var(--jux-size-xs)) calc(0.75rem * var(--jux-size-xs));
410
- font-size: calc(var(--jux-base-font) * var(--jux-size-xs));
411
- }
412
-
413
- .jux-button-large {
414
- --jux-pad: calc(0.5rem * var(--jux-size-lg)) calc(1rem * var(--jux-size-lg));
415
- font-size: calc(var(--jux-base-font) * var(--jux-size-lg));
416
366
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.142",
3
+ "version": "1.1.143",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",