juxscript 1.0.19 → 1.0.21
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/bin/cli.js +121 -72
- package/lib/components/alert.ts +212 -165
- package/lib/components/badge.ts +93 -103
- package/lib/components/base/BaseComponent.ts +397 -0
- package/lib/components/base/FormInput.ts +322 -0
- package/lib/components/button.ts +63 -122
- package/lib/components/card.ts +109 -155
- package/lib/components/charts/areachart.ts +315 -0
- package/lib/components/charts/barchart.ts +421 -0
- package/lib/components/charts/doughnutchart.ts +263 -0
- package/lib/components/charts/lib/BaseChart.ts +402 -0
- package/lib/components/charts/lib/chart-types.ts +159 -0
- package/lib/components/charts/lib/chart-utils.ts +160 -0
- package/lib/components/charts/lib/chart.ts +707 -0
- package/lib/components/checkbox.ts +264 -127
- package/lib/components/code.ts +75 -108
- package/lib/components/container.ts +113 -130
- package/lib/components/data.ts +37 -5
- package/lib/components/datepicker.ts +195 -147
- package/lib/components/dialog.ts +187 -157
- package/lib/components/divider.ts +85 -191
- package/lib/components/docs-data.json +544 -2027
- package/lib/components/dropdown.ts +178 -136
- package/lib/components/element.ts +227 -171
- package/lib/components/fileupload.ts +285 -228
- package/lib/components/guard.ts +92 -0
- package/lib/components/heading.ts +46 -69
- package/lib/components/helpers.ts +13 -6
- package/lib/components/hero.ts +107 -95
- package/lib/components/icon.ts +160 -0
- package/lib/components/icons.ts +175 -0
- package/lib/components/include.ts +153 -5
- package/lib/components/input.ts +174 -374
- package/lib/components/kpicard.ts +16 -16
- package/lib/components/list.ts +378 -240
- package/lib/components/loading.ts +142 -211
- package/lib/components/menu.ts +103 -97
- package/lib/components/modal.ts +138 -144
- package/lib/components/nav.ts +169 -90
- package/lib/components/paragraph.ts +49 -150
- package/lib/components/progress.ts +118 -200
- package/lib/components/radio.ts +297 -149
- package/lib/components/script.ts +19 -87
- package/lib/components/select.ts +184 -186
- package/lib/components/sidebar.ts +152 -140
- package/lib/components/style.ts +19 -82
- package/lib/components/switch.ts +258 -188
- package/lib/components/table.ts +1117 -170
- package/lib/components/tabs.ts +162 -145
- package/lib/components/theme-toggle.ts +108 -169
- package/lib/components/tooltip.ts +86 -157
- package/lib/components/write.ts +108 -127
- package/lib/jux.ts +86 -41
- package/machinery/build.js +466 -0
- package/machinery/compiler.js +354 -105
- package/machinery/server.js +23 -100
- package/machinery/watcher.js +153 -130
- package/package.json +1 -2
- package/presets/base.css +1166 -0
- package/presets/notion.css +2 -1975
- package/lib/adapters/base-adapter.js +0 -35
- package/lib/adapters/index.js +0 -33
- package/lib/adapters/mysql-adapter.js +0 -65
- package/lib/adapters/postgres-adapter.js +0 -70
- package/lib/adapters/sqlite-adapter.js +0 -56
- package/lib/components/areachart.ts +0 -1246
- package/lib/components/areachartsmooth.ts +0 -1380
- package/lib/components/barchart.ts +0 -1250
- package/lib/components/chart.ts +0 -127
- package/lib/components/doughnutchart.ts +0 -1191
- package/lib/components/footer.ts +0 -165
- package/lib/components/header.ts +0 -187
- package/lib/components/layout.ts +0 -239
- package/lib/components/main.ts +0 -137
- package/lib/layouts/default.jux +0 -8
- package/lib/layouts/figma.jux +0 -0
- /package/lib/{themes → components/charts/lib}/charts.js +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
notionTheme,
|
|
8
8
|
chalkTheme,
|
|
9
9
|
mintTheme
|
|
10
|
-
} from '
|
|
10
|
+
} from './charts/lib/charts.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* KPI card options
|
|
@@ -67,7 +67,7 @@ export class KPICard {
|
|
|
67
67
|
private _id: string;
|
|
68
68
|
private _element?: HTMLElement;
|
|
69
69
|
private _container?: string;
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
public state: KPICardState = {
|
|
72
72
|
title: 'KPI',
|
|
73
73
|
value: 0,
|
|
@@ -94,7 +94,7 @@ export class KPICard {
|
|
|
94
94
|
|
|
95
95
|
constructor(id: string, options: KPICardOptions = {}) {
|
|
96
96
|
this._id = id;
|
|
97
|
-
|
|
97
|
+
|
|
98
98
|
// Apply options
|
|
99
99
|
if (options.title !== undefined) this.state.title = options.title;
|
|
100
100
|
if (options.value !== undefined) this.state.value = options.value;
|
|
@@ -254,7 +254,7 @@ export class KPICard {
|
|
|
254
254
|
|
|
255
255
|
private _updateCard(): void {
|
|
256
256
|
if (!this._container) return;
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
const element = document.querySelector(this._container);
|
|
259
259
|
if (!element) return;
|
|
260
260
|
|
|
@@ -269,7 +269,7 @@ export class KPICard {
|
|
|
269
269
|
|
|
270
270
|
private _loadThemeFont(): void {
|
|
271
271
|
const themeConfig = this._getThemeConfig();
|
|
272
|
-
|
|
272
|
+
|
|
273
273
|
if (themeConfig.font && !document.querySelector(`link[href="${themeConfig.font}"]`)) {
|
|
274
274
|
const link = document.createElement('link');
|
|
275
275
|
link.rel = 'stylesheet';
|
|
@@ -303,7 +303,7 @@ export class KPICard {
|
|
|
303
303
|
wrapper.style.opacity = '0';
|
|
304
304
|
wrapper.style.transform = 'translateY(20px)';
|
|
305
305
|
wrapper.style.transition = `opacity ${animationDuration}ms ease-out, transform ${animationDuration}ms ease-out`;
|
|
306
|
-
|
|
306
|
+
|
|
307
307
|
requestAnimationFrame(() => {
|
|
308
308
|
setTimeout(() => {
|
|
309
309
|
wrapper.style.opacity = '1';
|
|
@@ -342,7 +342,7 @@ export class KPICard {
|
|
|
342
342
|
const titleEl = document.createElement('div');
|
|
343
343
|
titleEl.className = 'jux-kpicard-title';
|
|
344
344
|
titleEl.textContent = title;
|
|
345
|
-
|
|
345
|
+
|
|
346
346
|
// Smart color selection based on theme
|
|
347
347
|
let titleColor = '#6b7280'; // default light mode
|
|
348
348
|
if (styleMode === 'gradient') {
|
|
@@ -350,7 +350,7 @@ export class KPICard {
|
|
|
350
350
|
} else if (styleMode === 'glass') {
|
|
351
351
|
titleColor = 'rgba(31, 41, 55, 0.9)'; // dark text for glass effect
|
|
352
352
|
}
|
|
353
|
-
|
|
353
|
+
|
|
354
354
|
titleEl.style.cssText = `
|
|
355
355
|
font-size: ${16 * scaleFactor}px;
|
|
356
356
|
font-weight: 500;
|
|
@@ -372,7 +372,7 @@ export class KPICard {
|
|
|
372
372
|
const valueEl = document.createElement('div');
|
|
373
373
|
valueEl.className = 'jux-kpicard-value';
|
|
374
374
|
valueEl.textContent = `${prefix}${value}${suffix}`;
|
|
375
|
-
|
|
375
|
+
|
|
376
376
|
// Smart color selection for value
|
|
377
377
|
let valueColor = '#1f2937'; // default dark
|
|
378
378
|
if (styleMode === 'gradient') {
|
|
@@ -380,7 +380,7 @@ export class KPICard {
|
|
|
380
380
|
} else if (styleMode === 'glass') {
|
|
381
381
|
valueColor = '#111827'; // very dark for glass
|
|
382
382
|
}
|
|
383
|
-
|
|
383
|
+
|
|
384
384
|
valueEl.style.cssText = `
|
|
385
385
|
font-size: ${56 * scaleFactor}px;
|
|
386
386
|
font-weight: 800;
|
|
@@ -394,7 +394,7 @@ export class KPICard {
|
|
|
394
394
|
valueEl.style.opacity = '0';
|
|
395
395
|
valueEl.style.transform = 'scale(0.8)';
|
|
396
396
|
valueEl.style.transition = `opacity ${animationDuration}ms ease-out ${animationDuration / 2}ms, transform ${animationDuration}ms cubic-bezier(0.34, 1.56, 0.64, 1) ${animationDuration / 2}ms`;
|
|
397
|
-
|
|
397
|
+
|
|
398
398
|
requestAnimationFrame(() => {
|
|
399
399
|
setTimeout(() => {
|
|
400
400
|
valueEl.style.opacity = '1';
|
|
@@ -423,7 +423,7 @@ export class KPICard {
|
|
|
423
423
|
// Delta text with smart coloring
|
|
424
424
|
const deltaText = document.createElement('span');
|
|
425
425
|
deltaText.textContent = `${delta > 0 ? '+' : ''}${delta}%`;
|
|
426
|
-
|
|
426
|
+
|
|
427
427
|
let deltaColor;
|
|
428
428
|
if (styleMode === 'gradient') {
|
|
429
429
|
deltaColor = delta > 0 ? 'rgba(255, 255, 255, 0.95)' : 'rgba(255, 200, 200, 0.95)';
|
|
@@ -432,7 +432,7 @@ export class KPICard {
|
|
|
432
432
|
} else {
|
|
433
433
|
deltaColor = delta > 0 ? '#10b981' : '#ef4444';
|
|
434
434
|
}
|
|
435
|
-
|
|
435
|
+
|
|
436
436
|
deltaText.style.cssText = `
|
|
437
437
|
font-size: ${18 * scaleFactor}px;
|
|
438
438
|
font-weight: 700;
|
|
@@ -444,7 +444,7 @@ export class KPICard {
|
|
|
444
444
|
deltaContainer.style.opacity = '0';
|
|
445
445
|
deltaContainer.style.transform = 'translateX(-10px)';
|
|
446
446
|
deltaContainer.style.transition = `opacity ${animationDuration}ms ease-out ${animationDuration}ms, transform ${animationDuration}ms ease-out ${animationDuration}ms`;
|
|
447
|
-
|
|
447
|
+
|
|
448
448
|
requestAnimationFrame(() => {
|
|
449
449
|
setTimeout(() => {
|
|
450
450
|
deltaContainer.style.opacity = '1';
|
|
@@ -473,7 +473,7 @@ export class KPICard {
|
|
|
473
473
|
svg.setAttribute('fill', 'none');
|
|
474
474
|
svg.style.flexShrink = '0';
|
|
475
475
|
|
|
476
|
-
const color = isGradientMode
|
|
476
|
+
const color = isGradientMode
|
|
477
477
|
? (isUp ? 'rgba(255, 255, 255, 0.9)' : 'rgba(255, 200, 200, 0.9)')
|
|
478
478
|
: (isUp ? '#10b981' : '#ef4444');
|
|
479
479
|
|
|
@@ -542,7 +542,7 @@ export class KPICard {
|
|
|
542
542
|
|
|
543
543
|
private _getThemeConfig() {
|
|
544
544
|
const { theme } = this.state;
|
|
545
|
-
|
|
545
|
+
|
|
546
546
|
switch (theme) {
|
|
547
547
|
case 'google':
|
|
548
548
|
return googleTheme;
|