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
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
|
-
import { table, Table, type TableOptions
|
|
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,27 +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';
|
|
54
|
+
import { icon as iconComponent, Icon, type IconOptions } from './components/icon.js';
|
|
55
|
+
import { renderIcon, renderEmoji } from './components/icons.js';
|
|
56
|
+
import { sidebar, Sidebar, type SidebarOptions } from './components/sidebar.js';
|
|
57
|
+
|
|
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';
|
|
58
65
|
|
|
59
66
|
/* -------------------------
|
|
60
67
|
* Type Exports
|
|
61
68
|
* ------------------------- */
|
|
62
69
|
|
|
63
70
|
export type {
|
|
71
|
+
GuardOptions,
|
|
64
72
|
HeroOptions,
|
|
65
73
|
ButtonOptions,
|
|
66
74
|
ContainerOptions,
|
|
67
75
|
ListOptions,
|
|
68
76
|
ListItem,
|
|
69
|
-
HeaderOptions,
|
|
70
|
-
FooterOptions,
|
|
71
|
-
MainOptions,
|
|
72
|
-
SidebarOptions,
|
|
73
77
|
ModalOptions,
|
|
74
78
|
TabsOptions,
|
|
75
79
|
Tab,
|
|
@@ -79,7 +83,6 @@ export type {
|
|
|
79
83
|
NavItem,
|
|
80
84
|
ViewOptions,
|
|
81
85
|
TableOptions,
|
|
82
|
-
TableColumn,
|
|
83
86
|
ChartOptions,
|
|
84
87
|
CodeOptions,
|
|
85
88
|
InputOptions,
|
|
@@ -110,15 +113,13 @@ export type {
|
|
|
110
113
|
HeadingOptions,
|
|
111
114
|
ParagraphOptions,
|
|
112
115
|
BarChartOptions,
|
|
113
|
-
BarChartDataPoint,
|
|
114
116
|
AreaChartOptions,
|
|
115
|
-
AreaChartDataPoint,
|
|
116
|
-
AreaChartSmoothOptions,
|
|
117
|
-
AreaChartSmoothDataPoint,
|
|
118
117
|
DoughnutChartOptions,
|
|
119
|
-
DoughnutChartDataPoint,
|
|
120
118
|
KPICardOptions,
|
|
121
|
-
|
|
119
|
+
ChartDataPoint,
|
|
120
|
+
DividerOptions,
|
|
121
|
+
IconOptions,
|
|
122
|
+
SidebarOptions
|
|
122
123
|
};
|
|
123
124
|
|
|
124
125
|
/* -------------------------
|
|
@@ -126,6 +127,7 @@ export type {
|
|
|
126
127
|
* ------------------------- */
|
|
127
128
|
|
|
128
129
|
export {
|
|
130
|
+
Guard,
|
|
129
131
|
Data,
|
|
130
132
|
Hero,
|
|
131
133
|
Card,
|
|
@@ -133,10 +135,6 @@ export {
|
|
|
133
135
|
Container,
|
|
134
136
|
List,
|
|
135
137
|
Table,
|
|
136
|
-
Header,
|
|
137
|
-
Footer,
|
|
138
|
-
Main,
|
|
139
|
-
Sidebar,
|
|
140
138
|
Modal,
|
|
141
139
|
Tabs,
|
|
142
140
|
Menu,
|
|
@@ -148,7 +146,6 @@ export {
|
|
|
148
146
|
App,
|
|
149
147
|
Style,
|
|
150
148
|
Script,
|
|
151
|
-
Layout,
|
|
152
149
|
Include,
|
|
153
150
|
ThemeToggle,
|
|
154
151
|
TokenCalculator,
|
|
@@ -172,10 +169,11 @@ export {
|
|
|
172
169
|
Paragraph,
|
|
173
170
|
BarChart,
|
|
174
171
|
AreaChart,
|
|
175
|
-
AreaChartSmooth,
|
|
176
172
|
DoughnutChart,
|
|
177
173
|
KPICard,
|
|
178
|
-
Divider
|
|
174
|
+
Divider,
|
|
175
|
+
Icon,
|
|
176
|
+
Sidebar
|
|
179
177
|
};
|
|
180
178
|
|
|
181
179
|
/* -------------------------
|
|
@@ -188,8 +186,14 @@ export interface JuxAPI {
|
|
|
188
186
|
param(name: string): string | null;
|
|
189
187
|
req: typeof req;
|
|
190
188
|
|
|
189
|
+
// Icon utilities
|
|
190
|
+
icon: typeof renderIcon;
|
|
191
|
+
emoji: typeof renderEmoji;
|
|
192
|
+
iconComponent: typeof iconComponent;
|
|
193
|
+
|
|
191
194
|
// Component factories
|
|
192
195
|
data: typeof data;
|
|
196
|
+
guard: typeof guard;
|
|
193
197
|
table: typeof table;
|
|
194
198
|
hero: typeof hero;
|
|
195
199
|
card: typeof card;
|
|
@@ -198,20 +202,24 @@ export interface JuxAPI {
|
|
|
198
202
|
footer: typeof footer;
|
|
199
203
|
main: typeof main;
|
|
200
204
|
sidebar: typeof sidebar;
|
|
205
|
+
aside: typeof aside;
|
|
206
|
+
section: typeof section;
|
|
207
|
+
article: typeof article;
|
|
201
208
|
container: typeof container;
|
|
202
209
|
modal: typeof modal;
|
|
203
210
|
tabs: typeof tabs;
|
|
204
211
|
list: typeof list;
|
|
205
212
|
menu: typeof menu;
|
|
206
213
|
nav: typeof nav;
|
|
214
|
+
div: typeof div;
|
|
215
|
+
span: typeof span;
|
|
207
216
|
chart: typeof chart;
|
|
208
217
|
code: typeof code;
|
|
209
|
-
|
|
218
|
+
|
|
210
219
|
view: typeof view;
|
|
211
220
|
app: typeof app;
|
|
212
221
|
style: typeof style;
|
|
213
222
|
script: typeof script;
|
|
214
|
-
layout: typeof layout;
|
|
215
223
|
include: typeof include;
|
|
216
224
|
themeToggle: typeof themeToggle;
|
|
217
225
|
tokenCalculator: typeof tokenCalculator;
|
|
@@ -234,10 +242,23 @@ export interface JuxAPI {
|
|
|
234
242
|
paragraph: typeof paragraph;
|
|
235
243
|
barchart: typeof barchart;
|
|
236
244
|
areachart: typeof areachart;
|
|
237
|
-
areachartsmooth: typeof areachartsmooth;
|
|
238
245
|
doughnutchart: typeof doughnutchart;
|
|
239
246
|
kpicard: typeof kpicard;
|
|
240
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;
|
|
241
262
|
}
|
|
242
263
|
|
|
243
264
|
/* -------------------------
|
|
@@ -266,8 +287,14 @@ class Jux implements JuxAPI {
|
|
|
266
287
|
// Request utilities
|
|
267
288
|
req = req;
|
|
268
289
|
|
|
290
|
+
// Icon utilities
|
|
291
|
+
icon = renderIcon;
|
|
292
|
+
emoji = renderEmoji;
|
|
293
|
+
iconComponent = iconComponent;
|
|
294
|
+
|
|
269
295
|
// Component factory methods
|
|
270
296
|
data = data;
|
|
297
|
+
guard = guard;
|
|
271
298
|
table = table;
|
|
272
299
|
hero = hero;
|
|
273
300
|
card = card;
|
|
@@ -276,6 +303,9 @@ class Jux implements JuxAPI {
|
|
|
276
303
|
footer = footer;
|
|
277
304
|
main = main;
|
|
278
305
|
sidebar = sidebar;
|
|
306
|
+
aside = aside;
|
|
307
|
+
section = section;
|
|
308
|
+
article = article;
|
|
279
309
|
container = container;
|
|
280
310
|
modal = modal;
|
|
281
311
|
tabs = tabs;
|
|
@@ -283,14 +313,14 @@ class Jux implements JuxAPI {
|
|
|
283
313
|
menu = menu;
|
|
284
314
|
code = code;
|
|
285
315
|
nav = nav;
|
|
286
|
-
|
|
287
|
-
|
|
316
|
+
div = div;
|
|
317
|
+
span = span;
|
|
288
318
|
chart = chart;
|
|
319
|
+
view = view;
|
|
289
320
|
app = app;
|
|
290
321
|
include = include;
|
|
291
322
|
style = style;
|
|
292
323
|
script = script;
|
|
293
|
-
layout = layout;
|
|
294
324
|
themeToggle = themeToggle;
|
|
295
325
|
tokenCalculator = tokenCalculator;
|
|
296
326
|
write = write;
|
|
@@ -312,10 +342,23 @@ class Jux implements JuxAPI {
|
|
|
312
342
|
paragraph = paragraph;
|
|
313
343
|
barchart = barchart;
|
|
314
344
|
areachart = areachart;
|
|
315
|
-
areachartsmooth = areachartsmooth;
|
|
316
345
|
doughnutchart = doughnutchart;
|
|
317
346
|
kpicard = kpicard;
|
|
318
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;
|
|
319
362
|
}
|
|
320
363
|
/**
|
|
321
364
|
* Global jux singleton instance
|
|
@@ -335,5 +378,7 @@ export {
|
|
|
335
378
|
jux,
|
|
336
379
|
state,
|
|
337
380
|
req,
|
|
338
|
-
ErrorHandler
|
|
381
|
+
ErrorHandler,
|
|
382
|
+
renderIcon,
|
|
383
|
+
renderEmoji
|
|
339
384
|
};
|