juxscript 1.0.55 → 1.0.57

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.
@@ -185,8 +185,6 @@ export class Alert extends BaseComponent<AlertState> {
185
185
  container.appendChild(alert);
186
186
  this._alert = alert;
187
187
 
188
- this._injectAlertStyles();
189
-
190
188
  requestAnimationFrame(() => {
191
189
  if ((window as any).lucide) {
192
190
  (window as any).lucide.createIcons();
@@ -195,91 +193,6 @@ export class Alert extends BaseComponent<AlertState> {
195
193
 
196
194
  return this;
197
195
  }
198
-
199
- private _injectAlertStyles(): void {
200
- const styleId = 'jux-alert-styles';
201
- if (document.getElementById(styleId)) return;
202
-
203
- const style = document.createElement('style');
204
- style.id = styleId;
205
- style.textContent = `
206
- .jux-alert {
207
- display: flex;
208
- align-items: center;
209
- gap: 12px;
210
- padding: 16px;
211
- border-radius: 8px;
212
- margin-bottom: 12px;
213
- position: relative;
214
- animation: slideIn 0.3s ease-out;
215
- }
216
-
217
- @keyframes slideIn {
218
- from {
219
- opacity: 0;
220
- transform: translateX(-20px);
221
- }
222
- to {
223
- opacity: 1;
224
- transform: translateX(0);
225
- }
226
- }
227
-
228
- .jux-alert-info {
229
- background: #dbeafe;
230
- border-left: 4px solid #3b82f6;
231
- color: #1e40af;
232
- }
233
-
234
- .jux-alert-success {
235
- background: #d1fae5;
236
- border-left: 4px solid #10b981;
237
- color: #065f46;
238
- }
239
-
240
- .jux-alert-warning {
241
- background: #fef3c7;
242
- border-left: 4px solid #f59e0b;
243
- color: #92400e;
244
- }
245
-
246
- .jux-alert-error {
247
- background: #fee2e2;
248
- border-left: 4px solid #ef4444;
249
- color: #991b1b;
250
- }
251
-
252
- .jux-alert-icon {
253
- flex-shrink: 0;
254
- }
255
-
256
- .jux-alert-content {
257
- flex: 1;
258
- font-size: 14px;
259
- }
260
-
261
- .jux-alert-close {
262
- flex-shrink: 0;
263
- background: transparent;
264
- border: none;
265
- font-size: 24px;
266
- cursor: pointer;
267
- opacity: 0.6;
268
- transition: opacity 0.2s;
269
- padding: 0;
270
- width: 24px;
271
- height: 24px;
272
- display: flex;
273
- align-items: center;
274
- justify-content: center;
275
- }
276
-
277
- .jux-alert-close:hover {
278
- opacity: 1;
279
- }
280
- `;
281
- document.head.appendChild(style);
282
- }
283
196
  }
284
197
 
285
198
  export function alert(id: string, options: AlertOptions = {}): Alert {
@@ -91,62 +91,9 @@ export class Badge extends BaseComponent<BadgeState> {
91
91
  });
92
92
 
93
93
  container.appendChild(badge);
94
- this._injectBadgeStyles();
95
94
 
96
95
  return this;
97
96
  }
98
-
99
- private _injectBadgeStyles(): void {
100
- const styleId = 'jux-badge-styles';
101
- if (document.getElementById(styleId)) return;
102
-
103
- const style = document.createElement('style');
104
- style.id = styleId;
105
- style.textContent = `
106
- .jux-badge {
107
- display: inline-block;
108
- padding: 0.25rem 0.75rem;
109
- font-size: 0.75rem;
110
- font-weight: 600;
111
- line-height: 1;
112
- text-align: center;
113
- white-space: nowrap;
114
- vertical-align: baseline;
115
- border-radius: 0.25rem;
116
- transition: all 0.2s;
117
- }
118
-
119
- .jux-badge-pill {
120
- border-radius: 10rem;
121
- }
122
-
123
- .jux-badge-default {
124
- color: #374151;
125
- background-color: #e5e7eb;
126
- }
127
-
128
- .jux-badge-success {
129
- color: #065f46;
130
- background-color: #d1fae5;
131
- }
132
-
133
- .jux-badge-warning {
134
- color: #92400e;
135
- background-color: #fef3c7;
136
- }
137
-
138
- .jux-badge-error {
139
- color: #991b1b;
140
- background-color: #fee2e2;
141
- }
142
-
143
- .jux-badge-info {
144
- color: #1e40af;
145
- background-color: #dbeafe;
146
- }
147
- `;
148
- document.head.appendChild(style);
149
- }
150
97
  }
151
98
 
152
99
  export function badge(id: string, options: BadgeOptions = {}): Badge {
@@ -224,99 +224,4 @@ export abstract class FormInput<TState extends FormInputState> extends BaseCompo
224
224
  }
225
225
  });
226
226
  }
227
-
228
- /**
229
- * Inject default form input styles
230
- */
231
- protected _injectFormStyles(): void {
232
- const styleId = 'jux-form-input-styles';
233
- if (document.getElementById(styleId)) return;
234
-
235
- const style = document.createElement('style');
236
- style.id = styleId;
237
- style.textContent = `
238
- .jux-input {
239
- margin-bottom: 16px;
240
- }
241
-
242
- .jux-input-container {
243
- position: relative;
244
- }
245
-
246
- .jux-input-with-icon .jux-input-element {
247
- padding-left: 40px;
248
- }
249
-
250
- .jux-input-icon {
251
- position: absolute;
252
- left: 12px;
253
- top: 50%;
254
- transform: translateY(-50%);
255
- display: flex;
256
- align-items: center;
257
- justify-content: center;
258
- color: #6b7280;
259
- pointer-events: none;
260
- }
261
-
262
- .jux-input-icon svg {
263
- width: 18px;
264
- height: 18px;
265
- }
266
-
267
- .jux-input-label {
268
- display: block;
269
- margin-bottom: 6px;
270
- font-weight: 500;
271
- color: #374151;
272
- }
273
-
274
- .jux-input-required {
275
- color: #ef4444;
276
- }
277
-
278
- .jux-input-element {
279
- width: 100%;
280
- padding: 8px 12px;
281
- border: 1px solid #d1d5db;
282
- border-radius: 6px;
283
- font-size: 14px;
284
- transition: border-color 0.2s;
285
- box-sizing: border-box;
286
- }
287
-
288
- .jux-input-element:focus {
289
- outline: none;
290
- border-color: #3b82f6;
291
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
292
- }
293
-
294
- .jux-input-element:disabled {
295
- background-color: #f3f4f6;
296
- cursor: not-allowed;
297
- }
298
-
299
- .jux-input-element.jux-input-invalid {
300
- border-color: #ef4444;
301
- }
302
-
303
- .jux-input-element.jux-input-invalid:focus {
304
- box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
305
- }
306
-
307
- .jux-input-error {
308
- color: #ef4444;
309
- font-size: 12px;
310
- margin-top: 4px;
311
- }
312
-
313
- .jux-input-counter {
314
- text-align: right;
315
- font-size: 12px;
316
- color: #6b7280;
317
- margin-top: 4px;
318
- }
319
- `;
320
- document.head.appendChild(style);
321
- }
322
227
  }
@@ -381,22 +381,9 @@ export abstract class BaseChart<TState extends BaseChartState> extends BaseCompo
381
381
  wrapper.setAttribute('style', style);
382
382
  }
383
383
 
384
- // Inject styles
385
- this._injectStyles();
386
-
387
384
  container.appendChild(wrapper);
388
385
  this._buildChart(wrapper);
389
386
 
390
387
  return this;
391
388
  }
392
-
393
- private _injectStyles(): void {
394
- const styleId = `${this._getChartClassName()}-styles`;
395
- if (document.getElementById(styleId)) return;
396
-
397
- const style = document.createElement('style');
398
- style.id = styleId;
399
- style.textContent = this._getBaseStyles();
400
- document.head.appendChild(style);
401
- }
402
389
  }
@@ -233,102 +233,8 @@ export class Checkbox extends FormInput<CheckboxState> {
233
233
  }
234
234
 
235
235
  container.appendChild(wrapper);
236
- this._injectCheckboxStyles();
237
-
238
- requestAnimationFrame(() => {
239
- if ((window as any).lucide) {
240
- (window as any).lucide.createIcons();
241
- }
242
- });
243
-
244
236
  return this;
245
237
  }
246
-
247
- private _injectCheckboxStyles(): void {
248
- const styleId = 'jux-checkbox-styles';
249
- if (document.getElementById(styleId)) return;
250
-
251
- const style = document.createElement('style');
252
- style.id = styleId;
253
- style.textContent = `
254
- .jux-checkbox {
255
- margin-bottom: 12px;
256
- }
257
-
258
- .jux-checkbox-container {
259
- display: inline-flex;
260
- align-items: center;
261
- cursor: pointer;
262
- user-select: none;
263
- position: relative;
264
- }
265
-
266
- .jux-checkbox-input {
267
- position: absolute;
268
- opacity: 0;
269
- cursor: pointer;
270
- height: 0;
271
- width: 0;
272
- }
273
-
274
- .jux-checkbox-checkmark {
275
- position: relative;
276
- height: 20px;
277
- width: 20px;
278
- border: 2px solid #d1d5db;
279
- border-radius: 4px;
280
- background-color: white;
281
- transition: all 0.2s;
282
- display: flex;
283
- align-items: center;
284
- justify-content: center;
285
- margin-right: 8px;
286
- }
287
-
288
- .jux-checkbox-checkmark svg {
289
- width: 14px;
290
- height: 14px;
291
- stroke: white;
292
- stroke-width: 3;
293
- opacity: 0;
294
- transition: opacity 0.2s;
295
- }
296
-
297
- .jux-checkbox-input:checked ~ .jux-checkbox-checkmark {
298
- background-color: #3b82f6;
299
- border-color: #3b82f6;
300
- }
301
-
302
- .jux-checkbox-input:checked ~ .jux-checkbox-checkmark svg {
303
- opacity: 1;
304
- }
305
-
306
- .jux-checkbox-input:disabled ~ .jux-checkbox-checkmark {
307
- background-color: #f3f4f6;
308
- border-color: #d1d5db;
309
- cursor: not-allowed;
310
- }
311
-
312
- .jux-checkbox-input:disabled ~ .jux-checkbox-label-text {
313
- color: #9ca3af;
314
- cursor: not-allowed;
315
- }
316
-
317
- .jux-checkbox-input:focus ~ .jux-checkbox-checkmark {
318
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
319
- }
320
-
321
- .jux-checkbox-input.jux-input-invalid ~ .jux-checkbox-checkmark {
322
- border-color: #ef4444;
323
- }
324
-
325
- .jux-checkbox-label-text {
326
- font-size: 14px;
327
- color: #374151;
328
- }
329
- `;
330
- document.head.appendChild(style);
331
- }
332
238
  }
333
239
 
334
240
  export function checkbox(id: string, options: CheckboxOptions = {}): Checkbox {
@@ -225,48 +225,8 @@ export class DatePicker extends FormInput<DatePickerState> {
225
225
  }
226
226
 
227
227
  container.appendChild(wrapper);
228
- this._injectDatePickerStyles();
229
- this._injectFormStyles();
230
-
231
- requestAnimationFrame(() => {
232
- if ((window as any).lucide) {
233
- (window as any).lucide.createIcons();
234
- }
235
- });
236
-
237
228
  return this;
238
229
  }
239
-
240
- private _injectDatePickerStyles(): void {
241
- const styleId = 'jux-datepicker-styles';
242
- if (document.getElementById(styleId)) return;
243
-
244
- const style = document.createElement('style');
245
- style.id = styleId;
246
- style.textContent = `
247
- .jux-datepicker-container {
248
- position: relative;
249
- }
250
-
251
- .jux-datepicker-container .jux-input-icon {
252
- pointer-events: none;
253
- }
254
-
255
- .jux-datepicker-input {
256
- padding-left: 40px;
257
- }
258
-
259
- .jux-datepicker-input::-webkit-calendar-picker-indicator {
260
- cursor: pointer;
261
- opacity: 0;
262
- position: absolute;
263
- right: 0;
264
- width: 100%;
265
- height: 100%;
266
- }
267
- `;
268
- document.head.appendChild(style);
269
- }
270
230
  }
271
231
 
272
232
  export function datepicker(id: string, options: DatePickerOptions = {}): DatePicker {
@@ -163,124 +163,8 @@ export class Dialog extends BaseComponent<DialogState> {
163
163
  overlay.appendChild(dialog);
164
164
  document.body.appendChild(overlay);
165
165
 
166
- this._injectDialogStyles();
167
-
168
166
  return this;
169
167
  }
170
-
171
- private _injectDialogStyles(): void {
172
- const styleId = 'jux-dialog-styles';
173
- if (document.getElementById(styleId)) return;
174
-
175
- const style = document.createElement('style');
176
- style.id = styleId;
177
- style.textContent = `
178
- .jux-dialog-overlay {
179
- position: fixed;
180
- top: 0;
181
- left: 0;
182
- right: 0;
183
- bottom: 0;
184
- background: rgba(0, 0, 0, 0.5);
185
- display: flex;
186
- align-items: center;
187
- justify-content: center;
188
- z-index: 10000;
189
- animation: jux-dialog-fade 0.2s;
190
- }
191
-
192
- @keyframes jux-dialog-fade {
193
- from { opacity: 0; }
194
- to { opacity: 1; }
195
- }
196
-
197
- .jux-dialog {
198
- background: white;
199
- border-radius: 12px;
200
- padding: 24px;
201
- max-width: 400px;
202
- width: 90%;
203
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
204
- animation: jux-dialog-slide 0.3s;
205
- }
206
-
207
- @keyframes jux-dialog-slide {
208
- from {
209
- opacity: 0;
210
- transform: translateY(-20px);
211
- }
212
- to {
213
- opacity: 1;
214
- transform: translateY(0);
215
- }
216
- }
217
-
218
- .jux-dialog-title {
219
- font-size: 20px;
220
- font-weight: 600;
221
- margin-bottom: 12px;
222
- color: #1f2937;
223
- }
224
-
225
- .jux-dialog-message {
226
- font-size: 14px;
227
- color: #6b7280;
228
- margin-bottom: 24px;
229
- line-height: 1.5;
230
- }
231
-
232
- .jux-dialog-actions {
233
- display: flex;
234
- gap: 12px;
235
- justify-content: flex-end;
236
- }
237
-
238
- .jux-dialog-button {
239
- padding: 8px 16px;
240
- border-radius: 6px;
241
- font-size: 14px;
242
- font-weight: 500;
243
- cursor: pointer;
244
- transition: all 0.2s;
245
- border: none;
246
- }
247
-
248
- .jux-dialog-button-cancel {
249
- background: #f3f4f6;
250
- color: #374151;
251
- }
252
-
253
- .jux-dialog-button-cancel:hover {
254
- background: #e5e7eb;
255
- }
256
-
257
- .jux-dialog-button-confirm {
258
- background: #3b82f6;
259
- color: white;
260
- }
261
-
262
- .jux-dialog-button-confirm:hover {
263
- background: #2563eb;
264
- }
265
-
266
- .jux-dialog-button-danger {
267
- background: #ef4444;
268
- }
269
-
270
- .jux-dialog-button-danger:hover {
271
- background: #dc2626;
272
- }
273
-
274
- .jux-dialog-button-warning {
275
- background: #f59e0b;
276
- }
277
-
278
- .jux-dialog-button-warning:hover {
279
- background: #d97706;
280
- }
281
- `;
282
- document.head.appendChild(style);
283
- }
284
168
  }
285
169
 
286
170
  export function dialog(id: string, options: DialogOptions = {}): Dialog {
@@ -82,7 +82,6 @@ export class Divider extends BaseComponent<DividerState> {
82
82
 
83
83
  this._wireStandardEvents(divider);
84
84
  container.appendChild(divider);
85
- this._injectDividerStyles();
86
85
 
87
86
  return this;
88
87
  }
@@ -93,32 +92,6 @@ export class Divider extends BaseComponent<DividerState> {
93
92
  }
94
93
  return this.render(`#${juxComponent._id}`);
95
94
  }
96
-
97
- private _injectDividerStyles(): void {
98
- if (document.getElementById('jux-divider-styles')) return;
99
-
100
- const style = document.createElement('style');
101
- style.id = 'jux-divider-styles';
102
- style.textContent = `
103
- .jux-divider {
104
- display: flex;
105
- align-items: center;
106
- border-top: 1px solid #e0e0e0;
107
- }
108
- .jux-divider-dashed {
109
- border-top-style: dashed;
110
- }
111
- .jux-divider-dotted {
112
- border-top-style: dotted;
113
- }
114
- .jux-divider-text {
115
- padding: 0 1rem;
116
- background: white;
117
- position: relative;
118
- }
119
- `;
120
- document.head.appendChild(style);
121
- }
122
95
  }
123
96
 
124
97
  // ✅ ID is now optional - auto-generated if not provided
@@ -970,6 +970,12 @@
970
970
  "returns": "this",
971
971
  "description": "Set subtitle"
972
972
  },
973
+ {
974
+ "name": "content",
975
+ "params": "(value)",
976
+ "returns": "this",
977
+ "description": "Set content"
978
+ },
973
979
  {
974
980
  "name": "cta",
975
981
  "params": "(value)",
@@ -988,12 +994,24 @@
988
994
  "returns": "this",
989
995
  "description": "Set backgroundImage"
990
996
  },
997
+ {
998
+ "name": "backgroundOverlay",
999
+ "params": "(value)",
1000
+ "returns": "this",
1001
+ "description": "Set backgroundOverlay"
1002
+ },
991
1003
  {
992
1004
  "name": "variant",
993
1005
  "params": "(value)",
994
1006
  "returns": "this",
995
1007
  "description": "Set variant"
996
1008
  },
1009
+ {
1010
+ "name": "centered",
1011
+ "params": "(value)",
1012
+ "returns": "this",
1013
+ "description": "Set centered"
1014
+ },
997
1015
  {
998
1016
  "name": "render",
999
1017
  "params": "(targetId?)",
@@ -2053,5 +2071,5 @@
2053
2071
  }
2054
2072
  ],
2055
2073
  "version": "1.0.0",
2056
- "lastUpdated": "2026-01-28T20:46:06.367Z"
2074
+ "lastUpdated": "2026-01-29T04:55:18.239Z"
2057
2075
  }