juxscript 1.1.142 → 1.1.144
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/lib/components/button.d.ts.map +1 -1
- package/lib/components/button.js +11 -38
- package/lib/components/button.ts +11 -36
- package/lib/components/heading.d.ts.map +1 -1
- package/lib/components/heading.js +14 -1
- package/lib/components/heading.ts +14 -1
- package/lib/components/paragraph.d.ts.map +1 -1
- package/lib/components/paragraph.js +0 -11
- package/lib/components/paragraph.ts +0 -13
- package/lib/styles/foundation.css +153 -44
- package/package.json +1 -1
|
@@ -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,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C,WAAW,CAAC;IACpD,OAAO,CAAC,cAAc,CAAkC;gBAE5C,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAmB/C,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,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"}
|
package/lib/components/button.js
CHANGED
|
@@ -122,48 +122,21 @@ export class Button extends BaseComponent {
|
|
|
122
122
|
const container = this._setupContainer(targetId);
|
|
123
123
|
const { content, icon, iconPosition, variant, size, style, class: className } = this.state;
|
|
124
124
|
const button = document.createElement('button');
|
|
125
|
-
// ✅
|
|
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
134
|
// ✅ Add user classes
|
|
129
135
|
if (className)
|
|
130
136
|
button.className += ` ${className}`;
|
|
131
|
-
// ✅ Apply
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
}
|
|
137
|
+
// ✅ Apply user style (no variant/size logic here)
|
|
138
|
+
if (style)
|
|
139
|
+
button.setAttribute('style', style);
|
|
167
140
|
if (icon && iconPosition === 'left') {
|
|
168
141
|
const iconEl = document.createElement('span');
|
|
169
142
|
iconEl.className = 'jux-button-icon';
|
|
@@ -171,7 +144,6 @@ export class Button extends BaseComponent {
|
|
|
171
144
|
button.appendChild(iconEl);
|
|
172
145
|
}
|
|
173
146
|
const textEl = document.createElement('span');
|
|
174
|
-
// ✅ Priority: content (HTML) > label (text) > loading state
|
|
175
147
|
if (content) {
|
|
176
148
|
textEl.innerHTML = content;
|
|
177
149
|
}
|
|
@@ -196,6 +168,7 @@ export class Button extends BaseComponent {
|
|
|
196
168
|
});
|
|
197
169
|
this._wireStandardEvents(button);
|
|
198
170
|
container.appendChild(button);
|
|
171
|
+
this._buttonElement = button;
|
|
199
172
|
return this;
|
|
200
173
|
}
|
|
201
174
|
}
|
package/lib/components/button.ts
CHANGED
|
@@ -177,45 +177,22 @@ export class Button extends BaseComponent<ButtonState> {
|
|
|
177
177
|
|
|
178
178
|
const button = document.createElement('button');
|
|
179
179
|
|
|
180
|
-
// ✅
|
|
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
191
|
// ✅ Add user classes
|
|
185
192
|
if (className) button.className += ` ${className}`;
|
|
186
193
|
|
|
187
|
-
// ✅ Apply
|
|
188
|
-
|
|
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
|
-
}
|
|
194
|
+
// ✅ Apply user style (no variant/size logic here)
|
|
195
|
+
if (style) button.setAttribute('style', style);
|
|
219
196
|
|
|
220
197
|
if (icon && iconPosition === 'left') {
|
|
221
198
|
const iconEl = document.createElement('span');
|
|
@@ -225,8 +202,6 @@ export class Button extends BaseComponent<ButtonState> {
|
|
|
225
202
|
}
|
|
226
203
|
|
|
227
204
|
const textEl = document.createElement('span');
|
|
228
|
-
|
|
229
|
-
// ✅ Priority: content (HTML) > label (text) > loading state
|
|
230
205
|
if (content) {
|
|
231
206
|
textEl.innerHTML = content;
|
|
232
207
|
} else if (this.state.label) {
|
|
@@ -235,7 +210,6 @@ export class Button extends BaseComponent<ButtonState> {
|
|
|
235
210
|
// Fallback to auto-generated label from ID
|
|
236
211
|
textEl.textContent = this.state.loading ? 'Loading...' : formatIdAsLabel(this._id);
|
|
237
212
|
}
|
|
238
|
-
|
|
239
213
|
button.appendChild(textEl);
|
|
240
214
|
|
|
241
215
|
if (icon && iconPosition === 'right') {
|
|
@@ -253,6 +227,7 @@ export class Button extends BaseComponent<ButtonState> {
|
|
|
253
227
|
|
|
254
228
|
this._wireStandardEvents(button);
|
|
255
229
|
container.appendChild(button);
|
|
230
|
+
this._buttonElement = button;
|
|
256
231
|
return this;
|
|
257
232
|
}
|
|
258
233
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"he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,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;IA0BtC,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;IAS5B,MAAM,CAAC,QAAQ,CAAC,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
|
-
|
|
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
|
-
|
|
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,qBAAa,SAAU,SAAQ,aAAa,CAAC,cAAc,CAAC;gBAC5C,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQtD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;
|
|
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,qBAAa,SAAU,SAAQ,aAAa,CAAC,cAAc,CAAC;gBAC5C,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQtD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,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
|
}
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
/* ═════════════════════════════════════════════════════════════════
|
|
45
45
|
* 📏 SPACING SCALE (Base units for padding, gap, margins)
|
|
46
46
|
* ═════════════════════════════════════════════════════════════════ */
|
|
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;
|
|
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;
|
|
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;
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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);
|
|
@@ -364,53 +366,160 @@
|
|
|
364
366
|
}
|
|
365
367
|
|
|
366
368
|
/* ══════════════════════════════════════════════════════════════════
|
|
367
|
-
BUTTON
|
|
369
|
+
BUTTON VARIANTS
|
|
368
370
|
══════════════════════════════════════════════════════════════════ */
|
|
369
371
|
|
|
370
|
-
.jux-button-
|
|
371
|
-
|
|
372
|
-
|
|
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);
|
|
373
386
|
}
|
|
374
387
|
|
|
375
388
|
.jux-button-danger {
|
|
376
|
-
|
|
377
|
-
|
|
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
|
+
);
|
|
378
408
|
}
|
|
379
409
|
|
|
380
410
|
.jux-button-warning {
|
|
381
|
-
|
|
382
|
-
|
|
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
|
+
);
|
|
383
419
|
}
|
|
384
420
|
|
|
385
421
|
.jux-button-info {
|
|
386
|
-
|
|
387
|
-
--jux-accent-to: var(--jux-info-to);
|
|
422
|
+
background: var(--jux-info-bg);
|
|
388
423
|
}
|
|
389
424
|
|
|
390
|
-
.jux-button-
|
|
391
|
-
|
|
392
|
-
|
|
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
|
+
);
|
|
393
430
|
}
|
|
394
431
|
|
|
395
432
|
.jux-button-ghost {
|
|
396
433
|
background: transparent;
|
|
397
|
-
border-color: transparent;
|
|
398
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%);
|
|
399
440
|
}
|
|
400
441
|
|
|
401
|
-
.jux-button-
|
|
442
|
+
.jux-button-link {
|
|
402
443
|
background: transparent;
|
|
403
444
|
color: var(--jux-brand-color);
|
|
404
|
-
border
|
|
445
|
+
border: none;
|
|
446
|
+
text-decoration: underline;
|
|
405
447
|
}
|
|
406
448
|
|
|
407
|
-
|
|
449
|
+
.jux-button-link:hover:not(:disabled) {
|
|
450
|
+
background: transparent;
|
|
451
|
+
opacity: 0.8;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/* ══════════════════════════════════════════════════════════════════
|
|
455
|
+
BUTTON SIZES
|
|
456
|
+
══════════════════════════════════════════════════════════════════ */
|
|
457
|
+
|
|
408
458
|
.jux-button-small {
|
|
409
|
-
|
|
410
|
-
font-size: calc(var(--jux-base
|
|
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 */
|
|
411
465
|
}
|
|
412
466
|
|
|
413
467
|
.jux-button-large {
|
|
414
|
-
|
|
415
|
-
font-size: calc(var(--jux-base
|
|
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);
|
|
416
525
|
}
|