juxscript 1.0.20 → 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 +143 -92
- package/lib/components/badge.ts +93 -94
- package/lib/components/base/BaseComponent.ts +397 -0
- package/lib/components/base/FormInput.ts +322 -0
- package/lib/components/button.ts +40 -131
- package/lib/components/card.ts +57 -79
- 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/{chart-types.ts → charts/lib/chart-types.ts} +1 -1
- package/lib/components/{chart-utils.ts → charts/lib/chart-utils.ts} +1 -1
- package/lib/components/{chart.ts → charts/lib/chart.ts} +3 -3
- package/lib/components/checkbox.ts +255 -204
- package/lib/components/code.ts +31 -78
- package/lib/components/container.ts +113 -130
- package/lib/components/data.ts +37 -5
- package/lib/components/datepicker.ts +180 -147
- package/lib/components/dialog.ts +218 -221
- package/lib/components/divider.ts +63 -87
- package/lib/components/docs-data.json +498 -2404
- package/lib/components/dropdown.ts +191 -236
- package/lib/components/element.ts +196 -145
- package/lib/components/fileupload.ts +253 -167
- package/lib/components/guard.ts +92 -0
- package/lib/components/heading.ts +31 -97
- package/lib/components/helpers.ts +13 -6
- package/lib/components/hero.ts +51 -114
- package/lib/components/icon.ts +33 -120
- package/lib/components/icons.ts +2 -1
- package/lib/components/include.ts +76 -3
- package/lib/components/input.ts +155 -407
- package/lib/components/kpicard.ts +16 -16
- package/lib/components/list.ts +358 -261
- package/lib/components/loading.ts +142 -211
- package/lib/components/menu.ts +63 -152
- package/lib/components/modal.ts +42 -129
- package/lib/components/nav.ts +79 -101
- package/lib/components/paragraph.ts +38 -102
- package/lib/components/progress.ts +108 -166
- package/lib/components/radio.ts +283 -234
- package/lib/components/script.ts +19 -87
- package/lib/components/select.ts +189 -199
- package/lib/components/sidebar.ts +110 -141
- package/lib/components/style.ts +19 -82
- package/lib/components/switch.ts +254 -183
- package/lib/components/table.ts +1078 -208
- package/lib/components/tabs.ts +42 -106
- package/lib/components/theme-toggle.ts +73 -165
- package/lib/components/tooltip.ts +85 -316
- package/lib/components/write.ts +108 -127
- package/lib/jux.ts +67 -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 -1
- 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 -1128
- package/lib/components/areachartsmooth.ts +0 -1380
- package/lib/components/barchart.ts +0 -1322
- package/lib/components/doughnutchart.ts +0 -1259
- 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
package/lib/components/write.ts
CHANGED
|
@@ -22,18 +22,10 @@ export interface WriteOptions {
|
|
|
22
22
|
* jux.write('Content').render('#container');
|
|
23
23
|
*
|
|
24
24
|
* // Write HTML
|
|
25
|
-
* jux.write('<strong>Bold text</strong>'
|
|
25
|
+
* jux.write('<strong>Bold text</strong>').html(true).render('#container');
|
|
26
26
|
*
|
|
27
27
|
* // Write with styling
|
|
28
|
-
* jux.write('Styled text'
|
|
29
|
-
* tagType: 'p',
|
|
30
|
-
* className: 'highlight',
|
|
31
|
-
* style: 'color: red;'
|
|
32
|
-
* }).render('#container');
|
|
33
|
-
*
|
|
34
|
-
* // Append multiple writes
|
|
35
|
-
* jux.write('First').render('#container');
|
|
36
|
-
* jux.write('Second').render('#container');
|
|
28
|
+
* jux.write('Styled text').style('color: red;').render('#container');
|
|
37
29
|
*/
|
|
38
30
|
export class Write {
|
|
39
31
|
private content: string;
|
|
@@ -50,54 +42,63 @@ export class Write {
|
|
|
50
42
|
...options
|
|
51
43
|
};
|
|
52
44
|
}
|
|
45
|
+
|
|
46
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
47
|
+
* FLUENT API
|
|
48
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
49
|
+
|
|
53
50
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
* Set HTML mode (treat content as HTML)
|
|
52
|
+
*/
|
|
56
53
|
html(enabled: boolean = true): this {
|
|
57
54
|
this.options.html = enabled;
|
|
58
55
|
return this;
|
|
59
56
|
}
|
|
57
|
+
|
|
60
58
|
/**
|
|
61
|
-
*
|
|
62
|
-
* Falls back to body if no target specified
|
|
59
|
+
* Set tag type
|
|
63
60
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!target || !(target instanceof HTMLElement)) {
|
|
70
|
-
console.warn(`Write: Target element "${selector}" not found`);
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
61
|
+
tagType(value: string): this {
|
|
62
|
+
this.options.tagType = value;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
73
65
|
|
|
74
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Set CSS class
|
|
68
|
+
*/
|
|
69
|
+
className(value: string): this {
|
|
70
|
+
this.options.className = value;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Set inline styles
|
|
76
|
+
*/
|
|
77
|
+
style(value: string): this {
|
|
78
|
+
this.options.style = value;
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Set custom attributes
|
|
84
|
+
*/
|
|
85
|
+
attrs(attributes: Record<string, string>): this {
|
|
86
|
+
this.options.attributes = attributes;
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
90
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
91
|
+
* RENDER METHODS
|
|
92
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Render content to target element
|
|
96
|
+
*/
|
|
97
|
+
render(targetSelector?: string): this {
|
|
98
|
+
const target = this._getTarget(targetSelector);
|
|
99
|
+
if (!target) return this;
|
|
99
100
|
|
|
100
|
-
|
|
101
|
+
const element = this._createElement();
|
|
101
102
|
target.appendChild(element);
|
|
102
103
|
|
|
103
104
|
return this;
|
|
@@ -107,19 +108,14 @@ export class Write {
|
|
|
107
108
|
* Replace target content (clear first, then render)
|
|
108
109
|
*/
|
|
109
110
|
replace(targetSelector?: string): this {
|
|
110
|
-
const
|
|
111
|
-
|
|
111
|
+
const target = this._getTarget(targetSelector);
|
|
112
|
+
if (!target) return this;
|
|
112
113
|
|
|
113
|
-
if (!target || !(target instanceof HTMLElement)) {
|
|
114
|
-
console.warn(`Write: Target element "${selector}" not found`);
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Clear existing content
|
|
119
114
|
target.innerHTML = '';
|
|
115
|
+
const element = this._createElement();
|
|
116
|
+
target.appendChild(element);
|
|
120
117
|
|
|
121
|
-
|
|
122
|
-
return this.render(selector);
|
|
118
|
+
return this;
|
|
123
119
|
}
|
|
124
120
|
|
|
125
121
|
/**
|
|
@@ -127,35 +123,12 @@ export class Write {
|
|
|
127
123
|
*/
|
|
128
124
|
before(targetSelector: string): this {
|
|
129
125
|
const target = document.querySelector(targetSelector);
|
|
130
|
-
|
|
131
126
|
if (!target || !(target instanceof HTMLElement)) {
|
|
132
127
|
console.warn(`Write: Target element "${targetSelector}" not found`);
|
|
133
128
|
return this;
|
|
134
129
|
}
|
|
135
130
|
|
|
136
|
-
const element =
|
|
137
|
-
|
|
138
|
-
if (this.options.html) {
|
|
139
|
-
element.innerHTML = this.content;
|
|
140
|
-
} else {
|
|
141
|
-
element.textContent = this.content;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (this.options.className) {
|
|
145
|
-
element.className = this.options.className;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (this.options.style) {
|
|
149
|
-
element.setAttribute('style', this.options.style);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (this.options.attributes) {
|
|
153
|
-
Object.entries(this.options.attributes).forEach(([key, value]) => {
|
|
154
|
-
element.setAttribute(key, value);
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Insert before target
|
|
131
|
+
const element = this._createElement();
|
|
159
132
|
target.parentNode?.insertBefore(element, target);
|
|
160
133
|
|
|
161
134
|
return this;
|
|
@@ -166,35 +139,12 @@ export class Write {
|
|
|
166
139
|
*/
|
|
167
140
|
after(targetSelector: string): this {
|
|
168
141
|
const target = document.querySelector(targetSelector);
|
|
169
|
-
|
|
170
142
|
if (!target || !(target instanceof HTMLElement)) {
|
|
171
143
|
console.warn(`Write: Target element "${targetSelector}" not found`);
|
|
172
144
|
return this;
|
|
173
145
|
}
|
|
174
146
|
|
|
175
|
-
const element =
|
|
176
|
-
|
|
177
|
-
if (this.options.html) {
|
|
178
|
-
element.innerHTML = this.content;
|
|
179
|
-
} else {
|
|
180
|
-
element.textContent = this.content;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (this.options.className) {
|
|
184
|
-
element.className = this.options.className;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (this.options.style) {
|
|
188
|
-
element.setAttribute('style', this.options.style);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (this.options.attributes) {
|
|
192
|
-
Object.entries(this.options.attributes).forEach(([key, value]) => {
|
|
193
|
-
element.setAttribute(key, value);
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Insert after target
|
|
147
|
+
const element = this._createElement();
|
|
198
148
|
target.parentNode?.insertBefore(element, target.nextSibling);
|
|
199
149
|
|
|
200
150
|
return this;
|
|
@@ -204,87 +154,118 @@ export class Write {
|
|
|
204
154
|
* Prepend to target (insert as first child)
|
|
205
155
|
*/
|
|
206
156
|
prepend(targetSelector?: string): this {
|
|
207
|
-
const
|
|
208
|
-
|
|
157
|
+
const target = this._getTarget(targetSelector);
|
|
158
|
+
if (!target) return this;
|
|
159
|
+
|
|
160
|
+
const element = this._createElement();
|
|
161
|
+
target.insertBefore(element, target.firstChild);
|
|
162
|
+
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Append to target (alias for render)
|
|
168
|
+
*/
|
|
169
|
+
append(targetSelector?: string): this {
|
|
170
|
+
return this.render(targetSelector);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
174
|
+
* PRIVATE HELPERS
|
|
175
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
176
|
+
|
|
177
|
+
private _getTarget(selector?: string): HTMLElement | null {
|
|
178
|
+
const targetSelector = selector || 'body';
|
|
179
|
+
const target = document.querySelector(targetSelector);
|
|
209
180
|
|
|
210
181
|
if (!target || !(target instanceof HTMLElement)) {
|
|
211
|
-
console.warn(`Write: Target element "${
|
|
212
|
-
return
|
|
182
|
+
console.warn(`Write: Target element "${targetSelector}" not found`);
|
|
183
|
+
return null;
|
|
213
184
|
}
|
|
214
185
|
|
|
186
|
+
return target;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private _createElement(): HTMLElement {
|
|
215
190
|
const element = document.createElement(this.options.tagType!);
|
|
216
191
|
|
|
192
|
+
// Set content (text or HTML)
|
|
217
193
|
if (this.options.html) {
|
|
218
194
|
element.innerHTML = this.content;
|
|
219
195
|
} else {
|
|
220
196
|
element.textContent = this.content;
|
|
221
197
|
}
|
|
222
198
|
|
|
199
|
+
// Apply className
|
|
223
200
|
if (this.options.className) {
|
|
224
201
|
element.className = this.options.className;
|
|
225
202
|
}
|
|
226
203
|
|
|
204
|
+
// Apply inline styles
|
|
227
205
|
if (this.options.style) {
|
|
228
206
|
element.setAttribute('style', this.options.style);
|
|
229
207
|
}
|
|
230
208
|
|
|
209
|
+
// Apply custom attributes
|
|
231
210
|
if (this.options.attributes) {
|
|
232
211
|
Object.entries(this.options.attributes).forEach(([key, value]) => {
|
|
233
212
|
element.setAttribute(key, value);
|
|
234
213
|
});
|
|
235
214
|
}
|
|
236
215
|
|
|
237
|
-
|
|
238
|
-
target.insertBefore(element, target.firstChild);
|
|
239
|
-
|
|
240
|
-
return this;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Append to target (alias for render)
|
|
245
|
-
*/
|
|
246
|
-
append(targetSelector?: string): this {
|
|
247
|
-
return this.render(targetSelector);
|
|
216
|
+
return element;
|
|
248
217
|
}
|
|
249
218
|
}
|
|
250
219
|
|
|
251
220
|
/**
|
|
252
|
-
* Factory function
|
|
221
|
+
* Factory function - simple, no overloads
|
|
253
222
|
*/
|
|
254
223
|
export function write(content: string, options: WriteOptions = {}): Write {
|
|
255
224
|
return new Write(content, options);
|
|
256
225
|
}
|
|
257
226
|
|
|
227
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
228
|
+
* SHORTHAND HELPERS
|
|
229
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
230
|
+
|
|
258
231
|
/**
|
|
259
|
-
*
|
|
232
|
+
* Write text (explicit)
|
|
260
233
|
*/
|
|
261
|
-
|
|
262
|
-
// Write text (alias)
|
|
263
234
|
export function writeText(content: string, options: Omit<WriteOptions, 'html'> = {}): Write {
|
|
264
235
|
return new Write(content, { ...options, html: false });
|
|
265
236
|
}
|
|
266
237
|
|
|
267
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Write HTML (explicit)
|
|
240
|
+
*/
|
|
268
241
|
export function writeHtml(content: string, options: Omit<WriteOptions, 'html'> = {}): Write {
|
|
269
242
|
return new Write(content, { ...options, html: true });
|
|
270
243
|
}
|
|
271
244
|
|
|
272
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Write paragraph
|
|
247
|
+
*/
|
|
273
248
|
export function writeParagraph(content: string, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
274
249
|
return new Write(content, { ...options, tagType: 'p' });
|
|
275
250
|
}
|
|
276
251
|
|
|
277
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Write heading
|
|
254
|
+
*/
|
|
278
255
|
export function writeHeading(content: string, level: 1 | 2 | 3 | 4 | 5 | 6 = 2, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
279
256
|
return new Write(content, { ...options, tagType: `h${level}` });
|
|
280
257
|
}
|
|
281
258
|
|
|
282
|
-
|
|
259
|
+
/**
|
|
260
|
+
* Write span
|
|
261
|
+
*/
|
|
283
262
|
export function writeSpan(content: string, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
284
263
|
return new Write(content, { ...options, tagType: 'span' });
|
|
285
264
|
}
|
|
286
265
|
|
|
287
|
-
|
|
266
|
+
/**
|
|
267
|
+
* Write div (explicit)
|
|
268
|
+
*/
|
|
288
269
|
export function writeDiv(content: string, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
289
270
|
return new Write(content, { ...options, tagType: 'div' });
|
|
290
271
|
}
|
package/lib/jux.ts
CHANGED
|
@@ -4,35 +4,36 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { state } from './reactivity/state.js';
|
|
7
|
+
import { Guard, type GuardOptions, guard } from './components/guard.js';
|
|
7
8
|
import { Data, data } from './components/data.js';
|
|
8
9
|
import { table, Table, type TableOptions } from './components/table.js';
|
|
9
10
|
import { hero, Hero, type HeroOptions } from './components/hero.js';
|
|
10
11
|
import { card, Card, type CardOptions } from './components/card.js';
|
|
11
12
|
import { button, Button, type ButtonOptions } from './components/button.js';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import {
|
|
14
|
+
element, Element, type ElementOptions,
|
|
15
|
+
header, footer, main, aside, section, article, div, span
|
|
16
|
+
} from './components/element.js';
|
|
16
17
|
import { container, Container, type ContainerOptions } from './components/container.js';
|
|
17
18
|
import { modal, Modal, type ModalOptions } from './components/modal.js';
|
|
18
19
|
import { tabs, Tabs, type TabsOptions, type Tab } from './components/tabs.js';
|
|
19
20
|
import { list, List, type ListOptions, type ListItem } from './components/list.js';
|
|
20
21
|
import { menu, Menu, type MenuOptions, type MenuItem } from './components/menu.js';
|
|
21
22
|
import { nav, Nav, type NavOptions, type NavItem } from './components/nav.js';
|
|
22
|
-
import { chart, Chart, type ChartOptions } from './components/chart.js';
|
|
23
23
|
import { view, View, type ViewOptions } from './components/view.js';
|
|
24
24
|
import { code, Code, type CodeOptions } from './components/code.js';
|
|
25
|
-
import {
|
|
26
|
-
|
|
25
|
+
import {
|
|
26
|
+
input, Input, type InputOptions,
|
|
27
|
+
text, number, email, password, tel, url, textarea, range, date, time, color
|
|
28
|
+
} from './components/input.js';
|
|
29
|
+
import { app, App, type AppOptions } from './components/app.js';
|
|
27
30
|
import { style, Style } from './components/style.js';
|
|
28
31
|
import { script, Script } from './components/script.js';
|
|
29
|
-
import { layout, Layout } from './components/layout.js';
|
|
30
32
|
import { ErrorHandler } from './components/error-handler.js';
|
|
31
33
|
import { include, Include } from './components/include.js';
|
|
32
34
|
import { themeToggle, ThemeToggle, type ThemeToggleOptions, type Theme } from './components/theme-toggle.js';
|
|
33
35
|
import { tokenCalculator, TokenCalculator, type TokenCalculatorOptions } from './components/token-calculator.js';
|
|
34
36
|
import { write, Write, type WriteOptions } from './components/write.js';
|
|
35
|
-
import { element, Element, type ElementOptions } from './components/element.js';
|
|
36
37
|
import { alert, Alert, type AlertOptions } from './components/alert.js';
|
|
37
38
|
import { loading, Loading, type LoadingOptions } from './components/loading.js';
|
|
38
39
|
import { checkbox, Checkbox, type CheckboxOptions } from './components/checkbox.js';
|
|
@@ -49,33 +50,30 @@ import { fileupload, FileUpload, type FileUploadOptions } from './components/fil
|
|
|
49
50
|
import { req, Req, type RequestInfo } from './components/req.js';
|
|
50
51
|
import { heading, Heading, type HeadingOptions } from './components/heading.js';
|
|
51
52
|
import { paragraph, Paragraph, type ParagraphOptions } from './components/paragraph.js';
|
|
52
|
-
import { barchart, BarChart, type BarChartOptions, type BarChartDataPoint } from './components/barchart.js';
|
|
53
|
-
import { areachart, AreaChart, type AreaChartOptions, type AreaChartDataPoint } from './components/areachart.js';
|
|
54
|
-
import { areachartsmooth, AreaChartSmooth, type AreaChartSmoothOptions, AreaChartSmoothDataPoint } from './components/areachartsmooth.js';
|
|
55
|
-
import { doughnutchart, DoughnutChart, type DoughnutChartOptions, type DoughnutChartDataPoint } from './components/doughnutchart.js';
|
|
56
|
-
import { kpicard, KPICard, type KPICardOptions } from './components/kpicard.js';
|
|
57
53
|
import { divider, Divider, type DividerOptions } from './components/divider.js';
|
|
58
54
|
import { icon as iconComponent, Icon, type IconOptions } from './components/icon.js';
|
|
59
55
|
import { renderIcon, renderEmoji } from './components/icons.js';
|
|
56
|
+
import { sidebar, Sidebar, type SidebarOptions } from './components/sidebar.js';
|
|
60
57
|
|
|
61
|
-
// NEW:
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
// ✅ NEW: Chart imports from /charts folder
|
|
59
|
+
import { chart, Chart, type ChartOptions } from './components/charts/lib/chart.js';
|
|
60
|
+
import { barchart, BarChart, type BarChartOptions } from './components/charts/barchart.js';
|
|
61
|
+
import { areachart, AreaChart, type AreaChartOptions } from './components/charts/areachart.js';
|
|
62
|
+
import { doughnutchart, DoughnutChart, type DoughnutChartOptions } from './components/charts/doughnutchart.js';
|
|
63
|
+
import { kpicard, KPICard, type KPICardOptions } from './components/kpicard.js';
|
|
64
|
+
import type { ChartDataPoint } from './components/charts/lib/BaseChart.js';
|
|
64
65
|
|
|
65
66
|
/* -------------------------
|
|
66
67
|
* Type Exports
|
|
67
68
|
* ------------------------- */
|
|
68
69
|
|
|
69
70
|
export type {
|
|
71
|
+
GuardOptions,
|
|
70
72
|
HeroOptions,
|
|
71
73
|
ButtonOptions,
|
|
72
74
|
ContainerOptions,
|
|
73
75
|
ListOptions,
|
|
74
76
|
ListItem,
|
|
75
|
-
HeaderOptions,
|
|
76
|
-
FooterOptions,
|
|
77
|
-
MainOptions,
|
|
78
|
-
SidebarOptions,
|
|
79
77
|
ModalOptions,
|
|
80
78
|
TabsOptions,
|
|
81
79
|
Tab,
|
|
@@ -115,16 +113,13 @@ export type {
|
|
|
115
113
|
HeadingOptions,
|
|
116
114
|
ParagraphOptions,
|
|
117
115
|
BarChartOptions,
|
|
118
|
-
BarChartDataPoint,
|
|
119
116
|
AreaChartOptions,
|
|
120
|
-
AreaChartDataPoint,
|
|
121
|
-
AreaChartSmoothOptions,
|
|
122
|
-
AreaChartSmoothDataPoint,
|
|
123
117
|
DoughnutChartOptions,
|
|
124
|
-
DoughnutChartDataPoint,
|
|
125
118
|
KPICardOptions,
|
|
119
|
+
ChartDataPoint,
|
|
126
120
|
DividerOptions,
|
|
127
|
-
IconOptions
|
|
121
|
+
IconOptions,
|
|
122
|
+
SidebarOptions
|
|
128
123
|
};
|
|
129
124
|
|
|
130
125
|
/* -------------------------
|
|
@@ -132,6 +127,7 @@ export type {
|
|
|
132
127
|
* ------------------------- */
|
|
133
128
|
|
|
134
129
|
export {
|
|
130
|
+
Guard,
|
|
135
131
|
Data,
|
|
136
132
|
Hero,
|
|
137
133
|
Card,
|
|
@@ -139,10 +135,6 @@ export {
|
|
|
139
135
|
Container,
|
|
140
136
|
List,
|
|
141
137
|
Table,
|
|
142
|
-
Header,
|
|
143
|
-
Footer,
|
|
144
|
-
Main,
|
|
145
|
-
Sidebar,
|
|
146
138
|
Modal,
|
|
147
139
|
Tabs,
|
|
148
140
|
Menu,
|
|
@@ -154,7 +146,6 @@ export {
|
|
|
154
146
|
App,
|
|
155
147
|
Style,
|
|
156
148
|
Script,
|
|
157
|
-
Layout,
|
|
158
149
|
Include,
|
|
159
150
|
ThemeToggle,
|
|
160
151
|
TokenCalculator,
|
|
@@ -178,11 +169,11 @@ export {
|
|
|
178
169
|
Paragraph,
|
|
179
170
|
BarChart,
|
|
180
171
|
AreaChart,
|
|
181
|
-
AreaChartSmooth,
|
|
182
172
|
DoughnutChart,
|
|
183
173
|
KPICard,
|
|
184
174
|
Divider,
|
|
185
|
-
Icon
|
|
175
|
+
Icon,
|
|
176
|
+
Sidebar
|
|
186
177
|
};
|
|
187
178
|
|
|
188
179
|
/* -------------------------
|
|
@@ -202,6 +193,7 @@ export interface JuxAPI {
|
|
|
202
193
|
|
|
203
194
|
// Component factories
|
|
204
195
|
data: typeof data;
|
|
196
|
+
guard: typeof guard;
|
|
205
197
|
table: typeof table;
|
|
206
198
|
hero: typeof hero;
|
|
207
199
|
card: typeof card;
|
|
@@ -210,20 +202,24 @@ export interface JuxAPI {
|
|
|
210
202
|
footer: typeof footer;
|
|
211
203
|
main: typeof main;
|
|
212
204
|
sidebar: typeof sidebar;
|
|
205
|
+
aside: typeof aside;
|
|
206
|
+
section: typeof section;
|
|
207
|
+
article: typeof article;
|
|
213
208
|
container: typeof container;
|
|
214
209
|
modal: typeof modal;
|
|
215
210
|
tabs: typeof tabs;
|
|
216
211
|
list: typeof list;
|
|
217
212
|
menu: typeof menu;
|
|
218
213
|
nav: typeof nav;
|
|
214
|
+
div: typeof div;
|
|
215
|
+
span: typeof span;
|
|
219
216
|
chart: typeof chart;
|
|
220
217
|
code: typeof code;
|
|
221
|
-
|
|
218
|
+
|
|
222
219
|
view: typeof view;
|
|
223
220
|
app: typeof app;
|
|
224
221
|
style: typeof style;
|
|
225
222
|
script: typeof script;
|
|
226
|
-
layout: typeof layout;
|
|
227
223
|
include: typeof include;
|
|
228
224
|
themeToggle: typeof themeToggle;
|
|
229
225
|
tokenCalculator: typeof tokenCalculator;
|
|
@@ -246,10 +242,23 @@ export interface JuxAPI {
|
|
|
246
242
|
paragraph: typeof paragraph;
|
|
247
243
|
barchart: typeof barchart;
|
|
248
244
|
areachart: typeof areachart;
|
|
249
|
-
areachartsmooth: typeof areachartsmooth;
|
|
250
245
|
doughnutchart: typeof doughnutchart;
|
|
251
246
|
kpicard: typeof kpicard;
|
|
252
247
|
divider: typeof divider;
|
|
248
|
+
|
|
249
|
+
// Input factories
|
|
250
|
+
input: typeof input;
|
|
251
|
+
text: typeof text;
|
|
252
|
+
number: typeof number;
|
|
253
|
+
email: typeof email;
|
|
254
|
+
password: typeof password;
|
|
255
|
+
tel: typeof tel;
|
|
256
|
+
url: typeof url;
|
|
257
|
+
textarea: typeof textarea;
|
|
258
|
+
range: typeof range;
|
|
259
|
+
date: typeof date;
|
|
260
|
+
time: typeof time;
|
|
261
|
+
color: typeof color;
|
|
253
262
|
}
|
|
254
263
|
|
|
255
264
|
/* -------------------------
|
|
@@ -285,6 +294,7 @@ class Jux implements JuxAPI {
|
|
|
285
294
|
|
|
286
295
|
// Component factory methods
|
|
287
296
|
data = data;
|
|
297
|
+
guard = guard;
|
|
288
298
|
table = table;
|
|
289
299
|
hero = hero;
|
|
290
300
|
card = card;
|
|
@@ -293,6 +303,9 @@ class Jux implements JuxAPI {
|
|
|
293
303
|
footer = footer;
|
|
294
304
|
main = main;
|
|
295
305
|
sidebar = sidebar;
|
|
306
|
+
aside = aside;
|
|
307
|
+
section = section;
|
|
308
|
+
article = article;
|
|
296
309
|
container = container;
|
|
297
310
|
modal = modal;
|
|
298
311
|
tabs = tabs;
|
|
@@ -300,14 +313,14 @@ class Jux implements JuxAPI {
|
|
|
300
313
|
menu = menu;
|
|
301
314
|
code = code;
|
|
302
315
|
nav = nav;
|
|
303
|
-
|
|
304
|
-
|
|
316
|
+
div = div;
|
|
317
|
+
span = span;
|
|
305
318
|
chart = chart;
|
|
319
|
+
view = view;
|
|
306
320
|
app = app;
|
|
307
321
|
include = include;
|
|
308
322
|
style = style;
|
|
309
323
|
script = script;
|
|
310
|
-
layout = layout;
|
|
311
324
|
themeToggle = themeToggle;
|
|
312
325
|
tokenCalculator = tokenCalculator;
|
|
313
326
|
write = write;
|
|
@@ -329,10 +342,23 @@ class Jux implements JuxAPI {
|
|
|
329
342
|
paragraph = paragraph;
|
|
330
343
|
barchart = barchart;
|
|
331
344
|
areachart = areachart;
|
|
332
|
-
areachartsmooth = areachartsmooth;
|
|
333
345
|
doughnutchart = doughnutchart;
|
|
334
346
|
kpicard = kpicard;
|
|
335
347
|
divider = divider;
|
|
348
|
+
|
|
349
|
+
// Input factories
|
|
350
|
+
input = input;
|
|
351
|
+
text = text;
|
|
352
|
+
number = number;
|
|
353
|
+
email = email;
|
|
354
|
+
password = password;
|
|
355
|
+
tel = tel;
|
|
356
|
+
url = url;
|
|
357
|
+
textarea = textarea;
|
|
358
|
+
range = range;
|
|
359
|
+
date = date;
|
|
360
|
+
time = time;
|
|
361
|
+
color = color;
|
|
336
362
|
}
|
|
337
363
|
/**
|
|
338
364
|
* Global jux singleton instance
|