juxscript 1.1.143 → 1.1.145

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;CA4DnE;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAElE"}
@@ -120,15 +120,21 @@ export class Button extends BaseComponent {
120
120
  }
121
121
  render(targetId) {
122
122
  const container = this._setupContainer(targetId);
123
- const { content, icon, iconPosition, style, class: className } = this.state;
123
+ const { content, icon, iconPosition, variant, size, style, class: className } = this.state;
124
124
  const button = document.createElement('button');
125
- // ✅ ONLY set base class - NO variant/size classes
125
+ // ✅ Base class + variant + size
126
126
  button.className = 'jux-button';
127
+ if (variant && variant !== 'primary') {
128
+ button.className += ` jux-button-${variant}`;
129
+ }
130
+ if (size && size !== 'medium') {
131
+ button.className += ` jux-button-${size}`;
132
+ }
127
133
  button.id = this._id;
128
- // ✅ Add user classes only
134
+ // ✅ Add user classes
129
135
  if (className)
130
136
  button.className += ` ${className}`;
131
- // ✅ Apply style (NO variant/size logic - pure cascade)
137
+ // ✅ Apply user style (no variant/size logic here)
132
138
  if (style)
133
139
  button.setAttribute('style', style);
134
140
  if (icon && iconPosition === 'left') {
@@ -138,7 +144,6 @@ export class Button extends BaseComponent {
138
144
  button.appendChild(iconEl);
139
145
  }
140
146
  const textEl = document.createElement('span');
141
- // ✅ Priority: content (HTML) > label (text) > loading state
142
147
  if (content) {
143
148
  textEl.innerHTML = content;
144
149
  }
@@ -173,18 +173,25 @@ 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, style, class: className } = this.state;
176
+ const { content, icon, iconPosition, variant, size, 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
+ // ✅ Base class + variant + size
181
181
  button.className = 'jux-button';
182
+ if (variant && variant !== 'primary') {
183
+ button.className += ` jux-button-${variant}`;
184
+ }
185
+ if (size && size !== 'medium') {
186
+ button.className += ` jux-button-${size}`;
187
+ }
188
+
182
189
  button.id = this._id;
183
190
 
184
- // ✅ Add user classes only
191
+ // ✅ Add user classes
185
192
  if (className) button.className += ` ${className}`;
186
193
 
187
- // ✅ Apply style (NO variant/size logic - pure cascade)
194
+ // ✅ Apply user style (no variant/size logic here)
188
195
  if (style) button.setAttribute('style', style);
189
196
 
190
197
  if (icon && iconPosition === 'left') {
@@ -195,8 +202,6 @@ export class Button extends BaseComponent<ButtonState> {
195
202
  }
196
203
 
197
204
  const textEl = document.createElement('span');
198
-
199
- // ✅ Priority: content (HTML) > label (text) > loading state
200
205
  if (content) {
201
206
  textEl.innerHTML = content;
202
207
  } else if (this.state.label) {
@@ -205,7 +210,6 @@ export class Button extends BaseComponent<ButtonState> {
205
210
  // Fallback to auto-generated label from ID
206
211
  textEl.textContent = this.state.loading ? 'Loading...' : formatIdAsLabel(this._id);
207
212
  }
208
-
209
213
  button.appendChild(textEl);
210
214
 
211
215
  if (icon && iconPosition === 'right') {
@@ -1 +1 @@
1
- {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["heading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,YAAY,GAAG;IAChB,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,OAAQ,SAAQ,aAAa,CAAC,YAAY,CAAC;gBACxC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB;IASpD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAatC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;IAKzC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI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AC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CA8BrE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAEzE"}
@@ -18,7 +18,20 @@ export class Heading extends BaseComponent {
18
18
  return CALLBACK_EVENTS;
19
19
  }
20
20
  update(prop, value) {
21
- // No reactive updates needed
21
+ const el = document.getElementById(this._id);
22
+ if (!el)
23
+ return;
24
+ switch (prop) {
25
+ case 'content':
26
+ el.textContent = value;
27
+ break;
28
+ case 'level':
29
+ // Would need to recreate element - skip for now
30
+ break;
31
+ default:
32
+ super.update(prop, value);
33
+ break;
34
+ }
22
35
  }
23
36
  /* ═════════════════════════════════════════════════════════════════
24
37
  * FLUENT API
@@ -37,7 +37,20 @@ export class Heading extends BaseComponent<HeadingState> {
37
37
  }
38
38
 
39
39
  update(prop: string, value: any): void {
40
- // No reactive updates needed
40
+ const el = document.getElementById(this._id);
41
+ if (!el) return;
42
+
43
+ switch (prop) {
44
+ case 'content':
45
+ el.textContent = value;
46
+ break;
47
+ case 'level':
48
+ // Would need to recreate element - skip for now
49
+ break;
50
+ default:
51
+ super.update(prop, value);
52
+ break;
53
+ }
41
54
  }
42
55
 
43
56
  /* ═════════════════════════════════════════════════════════════════
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,cAAc,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,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E,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAwBtC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQzB,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CAuCrE;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAE/E"}
@@ -24,22 +24,11 @@ export class Paragraph extends BaseComponent {
24
24
  const el = document.getElementById(this._id);
25
25
  if (!el)
26
26
  return;
27
- // Handle paragraph-specific properties
28
27
  switch (prop) {
29
28
  case 'content':
30
29
  el.textContent = value;
31
30
  break;
32
- case 'class':
33
- // Preserve base jux-paragraph class, add custom classes
34
- const baseClass = 'jux-paragraph';
35
- const userClasses = value.split(' ').filter((c) => c);
36
- el.className = [baseClass, ...userClasses].join(' ');
37
- break;
38
- case 'style':
39
- el.setAttribute('style', value);
40
- break;
41
31
  default:
42
- // Call parent for base properties (visible, disabled, loading, etc.)
43
32
  super.update(prop, value);
44
33
  break;
45
34
  }
@@ -41,25 +41,12 @@ export class Paragraph extends BaseComponent<ParagraphState> {
41
41
  const el = document.getElementById(this._id);
42
42
  if (!el) return;
43
43
 
44
- // Handle paragraph-specific properties
45
44
  switch (prop) {
46
45
  case 'content':
47
46
  el.textContent = value;
48
47
  break;
49
48
 
50
- case 'class':
51
- // Preserve base jux-paragraph class, add custom classes
52
- const baseClass = 'jux-paragraph';
53
- const userClasses = value.split(' ').filter((c: string) => c);
54
- el.className = [baseClass, ...userClasses].join(' ');
55
- break;
56
-
57
- case 'style':
58
- el.setAttribute('style', value);
59
- break;
60
-
61
49
  default:
62
- // Call parent for base properties (visible, disabled, loading, etc.)
63
50
  super.update(prop, value);
64
51
  break;
65
52
  }
@@ -321,7 +321,7 @@ html {
321
321
  .jux-button {
322
322
  /* Colors */
323
323
  background: var(--jux-brand-bg);
324
- color: #fff;
324
+ color: var(--jux-surface-from); /* ✅ Fixed - button text uses surface color (inverts with theme) */
325
325
  border: var(--jux-stroke) solid var(--jux-border-color);
326
326
 
327
327
  /* Shape */
@@ -363,4 +363,163 @@ html {
363
363
  .jux-button:disabled {
364
364
  opacity: var(--jux-burn-strong);
365
365
  cursor: not-allowed;
366
+ }
367
+
368
+ /* ══════════════════════════════════════════════════════════════════
369
+ BUTTON VARIANTS
370
+ ══════════════════════════════════════════════════════════════════ */
371
+
372
+ .jux-button-primary {
373
+ /* Default - uses --jux-brand-bg from above */
374
+ }
375
+
376
+ .jux-button-secondary {
377
+ background: var(--jux-brand-accent-bg);
378
+ }
379
+
380
+ .jux-button-secondary:hover:not(:disabled) {
381
+ background: var(--jux-brand-accent-color-hover);
382
+ }
383
+
384
+ .jux-button-secondary:active:not(:disabled) {
385
+ background: var(--jux-brand-accent-color-active);
386
+ }
387
+
388
+ .jux-button-danger {
389
+ background: var(--jux-danger-bg);
390
+ }
391
+
392
+ .jux-button-danger:hover:not(:disabled) {
393
+ background: color-mix(in srgb,
394
+ var(--jux-danger-from) calc(100% - var(--jux-burn-hover) * 100%),
395
+ var(--jux-danger-to) calc(var(--jux-burn-hover) * 100%)
396
+ );
397
+ }
398
+
399
+ .jux-button-success {
400
+ background: var(--jux-success-bg);
401
+ }
402
+
403
+ .jux-button-success:hover:not(:disabled) {
404
+ background: color-mix(in srgb,
405
+ var(--jux-success-from) calc(100% - var(--jux-burn-hover) * 100%),
406
+ var(--jux-success-to) calc(var(--jux-burn-hover) * 100%)
407
+ );
408
+ }
409
+
410
+ .jux-button-warning {
411
+ background: var(--jux-warning-bg);
412
+ }
413
+
414
+ .jux-button-warning:hover:not(:disabled) {
415
+ background: color-mix(in srgb,
416
+ var(--jux-warning-from) calc(100% - var(--jux-burn-hover) * 100%),
417
+ var(--jux-warning-to) calc(var(--jux-burn-hover) * 100%)
418
+ );
419
+ }
420
+
421
+ .jux-button-info {
422
+ background: var(--jux-info-bg);
423
+ }
424
+
425
+ .jux-button-info:hover:not(:disabled) {
426
+ background: color-mix(in srgb,
427
+ var(--jux-info-from) calc(100% - var(--jux-burn-hover) * 100%),
428
+ var(--jux-info-to) calc(var(--jux-burn-hover) * 100%)
429
+ );
430
+ }
431
+
432
+ .jux-button-ghost {
433
+ background: transparent;
434
+ color: var(--jux-brand-color);
435
+ border-color: var(--jux-brand-color);
436
+ }
437
+
438
+ .jux-button-ghost:hover:not(:disabled) {
439
+ background: color-mix(in srgb, var(--jux-brand-color) 10%, transparent 90%);
440
+ }
441
+
442
+ .jux-button-link {
443
+ background: transparent;
444
+ color: var(--jux-brand-color);
445
+ border: none;
446
+ text-decoration: underline;
447
+ }
448
+
449
+ .jux-button-link:hover:not(:disabled) {
450
+ background: transparent;
451
+ opacity: 0.8;
452
+ }
453
+
454
+ /* ══════════════════════════════════════════════════════════════════
455
+ BUTTON SIZES
456
+ ══════════════════════════════════════════════════════════════════ */
457
+
458
+ .jux-button-small {
459
+ padding: calc(var(--jux-space-sm) * 0.75) calc(var(--jux-space-md) * 0.75);
460
+ font-size: calc(var(--jux-text-base) * var(--jux-size-sm));
461
+ }
462
+
463
+ .jux-button-medium {
464
+ /* Default size from .jux-button */
465
+ }
466
+
467
+ .jux-button-large {
468
+ padding: calc(var(--jux-space-md) * 1.25) calc(var(--jux-space-lg) * 1.25);
469
+ font-size: calc(var(--jux-text-base) * var(--jux-size-lg));
470
+ }
471
+
472
+ /* ══════════════════════════════════════════════════════════════════
473
+ HEADING STYLES
474
+ ══════════════════════════════════════════════════════════════════ */
475
+
476
+ .jux-heading {
477
+ margin: 0;
478
+ font-family: var(--jux-font-family);
479
+ font-weight: var(--jux-weight-bold);
480
+ line-height: var(--jux-leading-tight);
481
+ color: var(--jux-text-color);
482
+ }
483
+
484
+ .jux-heading-1 {
485
+ font-size: var(--jux-text-4xl);
486
+ font-weight: var(--jux-weight-black);
487
+ }
488
+
489
+ .jux-heading-2 {
490
+ font-size: var(--jux-text-3xl);
491
+ font-weight: var(--jux-weight-bold);
492
+ }
493
+
494
+ .jux-heading-3 {
495
+ font-size: var(--jux-text-2xl);
496
+ font-weight: var(--jux-weight-bold);
497
+ }
498
+
499
+ .jux-heading-4 {
500
+ font-size: var(--jux-text-xl);
501
+ font-weight: var(--jux-weight-semibold);
502
+ }
503
+
504
+ .jux-heading-5 {
505
+ font-size: var(--jux-text-lg);
506
+ font-weight: var(--jux-weight-semibold);
507
+ }
508
+
509
+ .jux-heading-6 {
510
+ font-size: var(--jux-text-base);
511
+ font-weight: var(--jux-weight-semibold);
512
+ }
513
+
514
+ /* ══════════════════════════════════════════════════════════════════
515
+ PARAGRAPH STYLES
516
+ ══════════════════════════════════════════════════════════════════ */
517
+
518
+ .jux-paragraph {
519
+ margin: 0;
520
+ font-family: var(--jux-font-family);
521
+ font-size: var(--jux-text-base);
522
+ font-weight: var(--jux-weight-normal);
523
+ line-height: var(--jux-leading-normal);
524
+ color: var(--jux-text-color);
366
525
  }
@@ -1,80 +1,132 @@
1
- /* ═══════════════════════════════════════════════════════════════════
2
- * STACK LAYOUT COMPONENTS
3
- * Pure layout structure - no animations, no modifiers
4
- * ═══════════════════════════════════════════════════════════════════ */
1
+ /* ══════════════════════════════════════════════════════════════════
2
+ JUX STACKS - Layout System
3
+ Uses foundation tokens for spacing, auto-adapts to themes
4
+ ══════════════════════════════════════════════════════════════════ */
5
5
 
6
- /* Vertical Stack */
7
- .jux-vstack {
6
+ /* ═════════════════════════════════════════════════════════════════
7
+ * BASE STACK STYLES
8
+ * ═════════════════════════════════════════════════════════════════ */
9
+
10
+ .jux-vstack,
11
+ .jux-hstack,
12
+ .jux-zstack {
8
13
  display: flex;
14
+
15
+ /* ✅ Use CSS variables from foundation/theme */
16
+ gap: var(--jux-gap);
17
+ padding: var(--jux-pad);
18
+
19
+ /* Default alignment */
20
+ align-items: var(--jux-align, flex-start);
21
+ }
22
+
23
+ /* ═════════════════════════════════════════════════════════════════
24
+ * VERTICAL STACK (Column)
25
+ * ═════════════════════════════════════════════════════════════════ */
26
+
27
+ .jux-vstack {
9
28
  flex-direction: column;
10
29
  }
11
30
 
12
- .jux-vstack-tight { gap: 0.5rem; }
13
- .jux-vstack-loose { gap: 1.5rem; }
14
- .jux-vstack-none { gap: 0; }
31
+ /* ═════════════════════════════════════════════════════════════════
32
+ * HORIZONTAL STACK (Row)
33
+ * ═════════════════════════════════════════════════════════════════ */
15
34
 
16
- /* Horizontal Stack */
17
35
  .jux-hstack {
18
- display: flex;
19
36
  flex-direction: row;
20
- align-items: center;
37
+ flex-wrap: wrap; /* Allow wrapping on mobile */
21
38
  }
22
39
 
23
- .jux-hstack-tight { gap: 0.5rem; }
24
- .jux-hstack-loose { gap: 1.5rem; }
25
- .jux-hstack-none { gap: 0; }
40
+ /* ═════════════════════════════════════════════════════════════════
41
+ * Z-STACK (Layered)
42
+ * ═════════════════════════════════════════════════════════════════ */
26
43
 
27
- /* Z-Stack (Layered/Overlapping) */
28
44
  .jux-zstack {
29
- display: grid;
30
- grid-template-columns: 1fr;
31
- grid-template-rows: 1fr;
32
45
  position: relative;
46
+ flex-direction: column;
33
47
  }
34
48
 
35
49
  .jux-zstack > * {
36
- grid-column: 1;
37
- grid-row: 1;
50
+ position: absolute;
51
+ top: 0;
52
+ left: 0;
38
53
  }
39
54
 
40
- .jux-zstack-tight > * { margin: 0.25rem; }
41
- .jux-zstack-loose > * { margin: 0.75rem; }
42
- .jux-zstack-none > * { margin: 0; }
43
-
44
- /* Stack Alignment Options */
45
- .jux-stack-start { align-items: flex-start; }
46
- .jux-stack-center { align-items: center; }
47
- .jux-stack-end { align-items: flex-end; }
48
- .jux-stack-stretch { align-items: stretch; }
49
-
50
- /* Stack Justification Options */
51
- .jux-stack-justify-start { justify-content: flex-start; }
52
- .jux-stack-justify-center { justify-content: center; }
53
- .jux-stack-justify-end { justify-content: flex-end; }
54
- .jux-stack-justify-between { justify-content: space-between; }
55
- .jux-stack-justify-around { justify-content: space-around; }
56
- .jux-stack-justify-evenly { justify-content: space-evenly; }
57
-
58
- /* Responsive Stacks */
55
+ /* ═════════════════════════════════════════════════════════════════
56
+ * ALIGNMENT UTILITIES (Via CSS Variables)
57
+ * Applied via .align-* descriptor classes
58
+ * ═════════════════════════════════════════════════════════════════ */
59
+
60
+ .align-start { --jux-align: flex-start; }
61
+ .align-center { --jux-align: center; }
62
+ .align-end { --jux-align: flex-end; }
63
+ .align-stretch { --jux-align: stretch; }
64
+ .align-baseline { --jux-align: baseline; }
65
+
66
+ /* ═════════════════════════════════════════════════════════════════
67
+ * JUSTIFY CONTENT (For HStack distribution)
68
+ * ═════════════════════════════════════════════════════════════════ */
69
+
70
+ .justify-start { justify-content: flex-start; }
71
+ .justify-center { justify-content: center; }
72
+ .justify-end { justify-content: flex-end; }
73
+ .justify-between { justify-content: space-between; }
74
+ .justify-around { justify-content: space-around; }
75
+ .justify-evenly { justify-content: space-evenly; }
76
+
77
+ /* ═════════════════════════════════════════════════════════════════
78
+ * RESPONSIVE BEHAVIOR
79
+ * HStack becomes VStack on mobile for better UX
80
+ * ═════════════════════════════════════════════════════════════════ */
81
+
59
82
  @media (max-width: 768px) {
60
- .jux-hstack-responsive {
83
+ .jux-hstack {
61
84
  flex-direction: column;
85
+ /* Gap remains consistent via CSS variables */
86
+ }
87
+
88
+ /* Optional: Force HStack to stay horizontal on mobile */
89
+ .jux-hstack.stay-horizontal {
90
+ flex-direction: row;
62
91
  }
63
92
  }
64
93
 
65
- /* Stack with Dividers */
66
- .jux-vstack-divider > *:not(:last-child) {
67
- padding-bottom: 1rem;
68
- border-bottom: 1px solid #e4e4e7;
69
- margin-bottom: 1rem;
94
+ /* ═════════════════════════════════════════════════════════════════
95
+ * FULL WIDTH/HEIGHT UTILITIES
96
+ * ═════════════════════════════════════════════════════════════════ */
97
+
98
+ .full-width {
99
+ width: 100%;
100
+ }
101
+
102
+ .full-height {
103
+ height: 100%;
104
+ min-height: 100vh;
105
+ }
106
+
107
+ /* ═════════════════════════════════════════════════════════════════
108
+ * CENTERED CONTENT (Common Layout Pattern)
109
+ * ═════════════════════════════════════════════════════════════════ */
110
+
111
+ .center-content {
112
+ justify-content: center;
113
+ align-items: center;
114
+ }
115
+
116
+ /* ═════════════════════════════════════════════════════════════════
117
+ * SCROLL BEHAVIOR
118
+ * ═════════════════════════════════════════════════════════════════ */
119
+
120
+ .scroll-x {
121
+ overflow-x: auto;
122
+ overflow-y: hidden;
70
123
  }
71
124
 
72
- .jux-hstack-divider > *:not(:last-child) {
73
- padding-right: 1rem;
74
- border-right: 1px solid #e4e4e7;
75
- margin-right: 1rem;
125
+ .scroll-y {
126
+ overflow-y: auto;
127
+ overflow-x: hidden;
76
128
  }
77
129
 
78
- .jux-zstack-divider > * {
79
- border: 1px solid #e4e4e7;
130
+ .scroll-both {
131
+ overflow: auto;
80
132
  }
@@ -63,6 +63,10 @@
63
63
  --jux-burn-active: 0.08;
64
64
  --jux-burn-muted: 0.3;
65
65
  --jux-burn-strong: 0.6;
66
+
67
+ /* ✅ DEFAULT STACK SPACING */
68
+ --jux-gap-token: var(--jux-space-lg);
69
+ --jux-pad-token: var(--jux-space-xl);
66
70
  }
67
71
 
68
72
  [data-swag="apple"][data-mode="dark"] {
@@ -80,7 +84,9 @@
80
84
  --jux-border-from: #38383a;
81
85
  --jux-border-to: #545456;
82
86
 
83
- /* Radius, spacing, typography inherited from light mode */
87
+ /* DEFAULT STACK SPACING */
88
+ --jux-gap-token: var(--jux-space-lg);
89
+ --jux-pad-token: var(--jux-space-xl);
84
90
  }
85
91
 
86
92
  /* ══════════════════════════════════════════════════════════════════
@@ -133,6 +139,10 @@
133
139
  --jux-burn-active: 0.15;
134
140
  --jux-burn-muted: 0.25;
135
141
  --jux-burn-strong: 0.5;
142
+
143
+ /* ✅ DEFAULT STACK SPACING */
144
+ --jux-gap-token: var(--jux-space-md);
145
+ --jux-pad-token: var(--jux-space-lg);
136
146
  }
137
147
 
138
148
  [data-swag="google"][data-mode="dark"] {
@@ -149,6 +159,10 @@
149
159
 
150
160
  --jux-border-from: #3c4043;
151
161
  --jux-border-to: #5f6368;
162
+
163
+ /* ✅ DEFAULT STACK SPACING */
164
+ --jux-gap-token: var(--jux-space-md);
165
+ --jux-pad-token: var(--jux-space-lg);
152
166
  }
153
167
 
154
168
  /* ══════════════════════════════════════════════════════════════════
@@ -201,6 +215,10 @@
201
215
  --jux-burn-active: 0.08;
202
216
  --jux-burn-muted: 0.3;
203
217
  --jux-burn-strong: 0.5;
218
+
219
+ /* ✅ DEFAULT STACK SPACING */
220
+ --jux-gap-token: var(--jux-space-md);
221
+ --jux-pad-token: var(--jux-space-md);
204
222
  }
205
223
 
206
224
  [data-swag="stripe"][data-mode="dark"] {
@@ -217,6 +235,10 @@
217
235
 
218
236
  --jux-border-from: #1a365d;
219
237
  --jux-border-to: #2d4a6f;
238
+
239
+ /* ✅ DEFAULT STACK SPACING */
240
+ --jux-gap-token: var(--jux-space-md);
241
+ --jux-pad-token: var(--jux-space-md);
220
242
  }
221
243
 
222
244
  /* ══════════════════════════════════════════════════════════════════
@@ -269,6 +291,10 @@
269
291
  --jux-burn-active: 0.15;
270
292
  --jux-burn-muted: 0.25;
271
293
  --jux-burn-strong: 0.4;
294
+
295
+ /* ✅ DEFAULT STACK SPACING */
296
+ --jux-gap-token: var(--jux-space-xl);
297
+ --jux-pad-token: var(--jux-space-2xl);
272
298
  }
273
299
 
274
300
  [data-swag="gumroad"][data-mode="dark"] {
@@ -285,6 +311,10 @@
285
311
 
286
312
  --jux-border-from: #333333;
287
313
  --jux-border-to: #666666;
314
+
315
+ /* ✅ DEFAULT STACK SPACING */
316
+ --jux-gap-token: var(--jux-space-xl);
317
+ --jux-pad-token: var(--jux-space-2xl);
288
318
  }
289
319
 
290
320
  /* ══════════════════════════════════════════════════════════════════
@@ -337,6 +367,10 @@
337
367
  --jux-burn-active: 0.12;
338
368
  --jux-burn-muted: 0.25;
339
369
  --jux-burn-strong: 0.5;
370
+
371
+ /* ✅ DEFAULT STACK SPACING */
372
+ --jux-gap-token: var(--jux-space-md);
373
+ --jux-pad-token: var(--jux-space-lg);
340
374
  }
341
375
 
342
376
  [data-swag="meta"][data-mode="dark"] {
@@ -353,6 +387,10 @@
353
387
 
354
388
  --jux-border-from: #3a3b3c;
355
389
  --jux-border-to: #4e4f50;
390
+
391
+ /* ✅ DEFAULT STACK SPACING */
392
+ --jux-gap-token: var(--jux-space-md);
393
+ --jux-pad-token: var(--jux-space-lg);
356
394
  }
357
395
 
358
396
  /* ══════════════════════════════════════════════════════════════════
@@ -405,6 +443,10 @@
405
443
  --jux-burn-active: 0.08;
406
444
  --jux-burn-muted: 0.35;
407
445
  --jux-burn-strong: 0.6;
446
+
447
+ /* ✅ DEFAULT STACK SPACING */
448
+ --jux-gap-token: var(--jux-space-sm);
449
+ --jux-pad-token: var(--jux-space-md);
408
450
  }
409
451
 
410
452
  [data-swag="notion"][data-mode="dark"] {
@@ -421,6 +463,10 @@
421
463
 
422
464
  --jux-border-from: #373737;
423
465
  --jux-border-to: #4a4a4a;
466
+
467
+ /* ✅ DEFAULT STACK SPACING */
468
+ --jux-gap-token: var(--jux-space-sm);
469
+ --jux-pad-token: var(--jux-space-md);
424
470
  }
425
471
 
426
472
  /* ══════════════════════════════════════════════════════════════════
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.143",
3
+ "version": "1.1.145",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",