juxscript 1.1.240 → 1.1.244

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.
Files changed (297) hide show
  1. package/index.js +7 -137
  2. package/lib/components/dataframe.ts +0 -569
  3. package/lib/components/include.ts +229 -229
  4. package/lib/components/tag.ts +68 -0
  5. package/lib/styles/shadcn.css +17 -5
  6. package/lib/utils/idgen.ts +6 -0
  7. package/package.json +5 -6
  8. package/index.d.ts +0 -239
  9. package/index.d.ts.map +0 -1
  10. package/lib/components/alert.d.ts +0 -36
  11. package/lib/components/alert.d.ts.map +0 -1
  12. package/lib/components/alert.js +0 -172
  13. package/lib/components/alert.ts +0 -219
  14. package/lib/components/app.d.ts +0 -89
  15. package/lib/components/app.d.ts.map +0 -1
  16. package/lib/components/app.js +0 -175
  17. package/lib/components/app.ts +0 -247
  18. package/lib/components/badge.d.ts +0 -26
  19. package/lib/components/badge.d.ts.map +0 -1
  20. package/lib/components/badge.js +0 -91
  21. package/lib/components/badge.ts +0 -118
  22. package/lib/components/base/Animations.d.ts +0 -36
  23. package/lib/components/base/Animations.d.ts.map +0 -1
  24. package/lib/components/base/Animations.js +0 -70
  25. package/lib/components/base/Animations.ts +0 -112
  26. package/lib/components/base/BaseComponent.d.ts +0 -294
  27. package/lib/components/base/BaseComponent.d.ts.map +0 -1
  28. package/lib/components/base/BaseComponent.js +0 -735
  29. package/lib/components/base/BaseComponent.ts +0 -884
  30. package/lib/components/base/FormInput.d.ts +0 -77
  31. package/lib/components/base/FormInput.d.ts.map +0 -1
  32. package/lib/components/base/FormInput.js +0 -171
  33. package/lib/components/base/FormInput.ts +0 -237
  34. package/lib/components/blueprint.d.ts +0 -40
  35. package/lib/components/blueprint.d.ts.map +0 -1
  36. package/lib/components/blueprint.js +0 -327
  37. package/lib/components/button.d.ts +0 -70
  38. package/lib/components/button.d.ts.map +0 -1
  39. package/lib/components/button.js +0 -177
  40. package/lib/components/button.ts +0 -237
  41. package/lib/components/card.d.ts +0 -35
  42. package/lib/components/card.d.ts.map +0 -1
  43. package/lib/components/card.js +0 -130
  44. package/lib/components/card.ts +0 -177
  45. package/lib/components/chart.d.ts +0 -49
  46. package/lib/components/chart.d.ts.map +0 -1
  47. package/lib/components/chart.js +0 -205
  48. package/lib/components/chart.ts +0 -254
  49. package/lib/components/checkbox.d.ts +0 -33
  50. package/lib/components/checkbox.d.ts.map +0 -1
  51. package/lib/components/checkbox.js +0 -202
  52. package/lib/components/checkbox.ts +0 -260
  53. package/lib/components/code.d.ts +0 -52
  54. package/lib/components/code.d.ts.map +0 -1
  55. package/lib/components/code.js +0 -201
  56. package/lib/components/code.ts +0 -260
  57. package/lib/components/container.d.ts +0 -60
  58. package/lib/components/container.d.ts.map +0 -1
  59. package/lib/components/container.js +0 -195
  60. package/lib/components/container.ts +0 -259
  61. package/lib/components/data.d.ts +0 -36
  62. package/lib/components/data.d.ts.map +0 -1
  63. package/lib/components/data.js +0 -110
  64. package/lib/components/data.ts +0 -135
  65. package/lib/components/dataframe/DataFrameSource.d.ts +0 -118
  66. package/lib/components/dataframe/DataFrameSource.d.ts.map +0 -1
  67. package/lib/components/dataframe/DataFrameSource.js +0 -421
  68. package/lib/components/dataframe/DataFrameSource.ts +0 -532
  69. package/lib/components/dataframe/ImportSettingsModal.d.ts +0 -60
  70. package/lib/components/dataframe/ImportSettingsModal.d.ts.map +0 -1
  71. package/lib/components/dataframe/ImportSettingsModal.js +0 -442
  72. package/lib/components/dataframe/ImportSettingsModal.ts +0 -531
  73. package/lib/components/dataframe.d.ts +0 -110
  74. package/lib/components/dataframe.d.ts.map +0 -1
  75. package/lib/components/dataframe.js +0 -470
  76. package/lib/components/datepicker.d.ts +0 -40
  77. package/lib/components/datepicker.d.ts.map +0 -1
  78. package/lib/components/datepicker.js +0 -193
  79. package/lib/components/datepicker.ts +0 -251
  80. package/lib/components/dialog.d.ts +0 -39
  81. package/lib/components/dialog.d.ts.map +0 -1
  82. package/lib/components/dialog.js +0 -131
  83. package/lib/components/dialog.ts +0 -178
  84. package/lib/components/divider.d.ts +0 -31
  85. package/lib/components/divider.d.ts.map +0 -1
  86. package/lib/components/divider.js +0 -72
  87. package/lib/components/divider.ts +0 -104
  88. package/lib/components/dropdown-menu.d.ts +0 -42
  89. package/lib/components/dropdown-menu.d.ts.map +0 -1
  90. package/lib/components/dropdown-menu.js +0 -177
  91. package/lib/components/dropdown-menu.ts +0 -214
  92. package/lib/components/dropdown.d.ts +0 -41
  93. package/lib/components/dropdown.d.ts.map +0 -1
  94. package/lib/components/dropdown.js +0 -136
  95. package/lib/components/dropdown.ts +0 -188
  96. package/lib/components/element.d.ts +0 -51
  97. package/lib/components/element.d.ts.map +0 -1
  98. package/lib/components/element.js +0 -209
  99. package/lib/components/element.ts +0 -271
  100. package/lib/components/event-chain.d.ts +0 -9
  101. package/lib/components/event-chain.d.ts.map +0 -1
  102. package/lib/components/event-chain.js +0 -33
  103. package/lib/components/fileupload.d.ts +0 -98
  104. package/lib/components/fileupload.d.ts.map +0 -1
  105. package/lib/components/fileupload.js +0 -351
  106. package/lib/components/fileupload.ts +0 -449
  107. package/lib/components/grid.d.ts +0 -88
  108. package/lib/components/grid.d.ts.map +0 -1
  109. package/lib/components/grid.js +0 -208
  110. package/lib/components/grid.ts +0 -295
  111. package/lib/components/heading.d.ts +0 -25
  112. package/lib/components/heading.d.ts.map +0 -1
  113. package/lib/components/heading.js +0 -83
  114. package/lib/components/heading.ts +0 -113
  115. package/lib/components/helpers.d.ts +0 -9
  116. package/lib/components/helpers.d.ts.map +0 -1
  117. package/lib/components/helpers.js +0 -30
  118. package/lib/components/helpers.ts +0 -41
  119. package/lib/components/hero.d.ts +0 -60
  120. package/lib/components/hero.d.ts.map +0 -1
  121. package/lib/components/hero.js +0 -239
  122. package/lib/components/hero.ts +0 -302
  123. package/lib/components/history/StateHistory.d.ts +0 -91
  124. package/lib/components/history/StateHistory.d.ts.map +0 -1
  125. package/lib/components/history/StateHistory.js +0 -154
  126. package/lib/components/history/StateHistory.ts +0 -200
  127. package/lib/components/icon.d.ts +0 -36
  128. package/lib/components/icon.d.ts.map +0 -1
  129. package/lib/components/icon.js +0 -135
  130. package/lib/components/icon.ts +0 -182
  131. package/lib/components/icons.d.ts +0 -25
  132. package/lib/components/icons.d.ts.map +0 -1
  133. package/lib/components/icons.js +0 -440
  134. package/lib/components/icons.ts +0 -464
  135. package/lib/components/image.d.ts +0 -42
  136. package/lib/components/image.d.ts.map +0 -1
  137. package/lib/components/image.js +0 -204
  138. package/lib/components/image.ts +0 -260
  139. package/lib/components/include.d.ts +0 -86
  140. package/lib/components/include.d.ts.map +0 -1
  141. package/lib/components/include.js +0 -238
  142. package/lib/components/input.d.ts +0 -85
  143. package/lib/components/input.d.ts.map +0 -1
  144. package/lib/components/input.js +0 -362
  145. package/lib/components/input.ts +0 -473
  146. package/lib/components/layer.d.ts +0 -72
  147. package/lib/components/layer.d.ts.map +0 -1
  148. package/lib/components/layer.js +0 -219
  149. package/lib/components/layer.ts +0 -304
  150. package/lib/components/link.d.ts +0 -41
  151. package/lib/components/link.d.ts.map +0 -1
  152. package/lib/components/link.js +0 -216
  153. package/lib/components/link.ts +0 -268
  154. package/lib/components/list.d.ts +0 -83
  155. package/lib/components/list.d.ts.map +0 -1
  156. package/lib/components/list.js +0 -314
  157. package/lib/components/list.ts +0 -423
  158. package/lib/components/loading.d.ts +0 -25
  159. package/lib/components/loading.d.ts.map +0 -1
  160. package/lib/components/loading.js +0 -76
  161. package/lib/components/loading.ts +0 -104
  162. package/lib/components/menu.d.ts +0 -38
  163. package/lib/components/menu.d.ts.map +0 -1
  164. package/lib/components/menu.js +0 -205
  165. package/lib/components/menu.ts +0 -279
  166. package/lib/components/modal.d.ts +0 -97
  167. package/lib/components/modal.d.ts.map +0 -1
  168. package/lib/components/modal.js +0 -463
  169. package/lib/components/modal.ts +0 -576
  170. package/lib/components/nav.d.ts +0 -46
  171. package/lib/components/nav.d.ts.map +0 -1
  172. package/lib/components/nav.js +0 -193
  173. package/lib/components/nav.ts +0 -261
  174. package/lib/components/paragraph.d.ts +0 -30
  175. package/lib/components/paragraph.d.ts.map +0 -1
  176. package/lib/components/paragraph.js +0 -93
  177. package/lib/components/paragraph.ts +0 -123
  178. package/lib/components/pen.d.ts +0 -125
  179. package/lib/components/pen.d.ts.map +0 -1
  180. package/lib/components/pen.js +0 -443
  181. package/lib/components/pen.ts +0 -567
  182. package/lib/components/progress.d.ts +0 -40
  183. package/lib/components/progress.d.ts.map +0 -1
  184. package/lib/components/progress.js +0 -116
  185. package/lib/components/progress.ts +0 -163
  186. package/lib/components/radio.d.ts +0 -43
  187. package/lib/components/radio.d.ts.map +0 -1
  188. package/lib/components/radio.js +0 -226
  189. package/lib/components/radio.ts +0 -303
  190. package/lib/components/registry.d.ts +0 -34
  191. package/lib/components/registry.d.ts.map +0 -1
  192. package/lib/components/registry.js +0 -163
  193. package/lib/components/registry.ts +0 -193
  194. package/lib/components/req.d.ts +0 -155
  195. package/lib/components/req.d.ts.map +0 -1
  196. package/lib/components/req.js +0 -253
  197. package/lib/components/req.ts +0 -303
  198. package/lib/components/script.d.ts +0 -14
  199. package/lib/components/script.d.ts.map +0 -1
  200. package/lib/components/script.js +0 -33
  201. package/lib/components/script.ts +0 -41
  202. package/lib/components/select.d.ts +0 -42
  203. package/lib/components/select.d.ts.map +0 -1
  204. package/lib/components/select.js +0 -209
  205. package/lib/components/select.ts +0 -281
  206. package/lib/components/sidebar.d.ts +0 -59
  207. package/lib/components/sidebar.d.ts.map +0 -1
  208. package/lib/components/sidebar.js +0 -298
  209. package/lib/components/sidebar.ts +0 -395
  210. package/lib/components/stack/BaseStack.d.ts +0 -65
  211. package/lib/components/stack/BaseStack.d.ts.map +0 -1
  212. package/lib/components/stack/BaseStack.js +0 -274
  213. package/lib/components/stack/BaseStack.ts +0 -328
  214. package/lib/components/stack/HStack.d.ts +0 -18
  215. package/lib/components/stack/HStack.d.ts.map +0 -1
  216. package/lib/components/stack/HStack.js +0 -22
  217. package/lib/components/stack/HStack.ts +0 -25
  218. package/lib/components/stack/VStack.d.ts +0 -19
  219. package/lib/components/stack/VStack.d.ts.map +0 -1
  220. package/lib/components/stack/VStack.js +0 -23
  221. package/lib/components/stack/VStack.ts +0 -26
  222. package/lib/components/stack/ZStack.d.ts +0 -18
  223. package/lib/components/stack/ZStack.d.ts.map +0 -1
  224. package/lib/components/stack/ZStack.js +0 -22
  225. package/lib/components/stack/ZStack.ts +0 -25
  226. package/lib/components/style.d.ts +0 -14
  227. package/lib/components/style.d.ts.map +0 -1
  228. package/lib/components/style.js +0 -33
  229. package/lib/components/style.ts +0 -41
  230. package/lib/components/switch.d.ts +0 -34
  231. package/lib/components/switch.d.ts.map +0 -1
  232. package/lib/components/switch.js +0 -209
  233. package/lib/components/switch.ts +0 -272
  234. package/lib/components/table.d.ts +0 -137
  235. package/lib/components/table.d.ts.map +0 -1
  236. package/lib/components/table.js +0 -1019
  237. package/lib/components/table.ts +0 -1225
  238. package/lib/components/tabs.d.ts +0 -53
  239. package/lib/components/tabs.d.ts.map +0 -1
  240. package/lib/components/tabs.js +0 -275
  241. package/lib/components/tabs.ts +0 -349
  242. package/lib/components/theme-toggle.d.ts +0 -45
  243. package/lib/components/theme-toggle.d.ts.map +0 -1
  244. package/lib/components/theme-toggle.js +0 -218
  245. package/lib/components/theme-toggle.ts +0 -297
  246. package/lib/components/tooltip.d.ts +0 -31
  247. package/lib/components/tooltip.d.ts.map +0 -1
  248. package/lib/components/tooltip.js +0 -112
  249. package/lib/components/tooltip.ts +0 -148
  250. package/lib/components/watcher.d.ts +0 -195
  251. package/lib/components/watcher.d.ts.map +0 -1
  252. package/lib/components/watcher.js +0 -241
  253. package/lib/components/watcher.ts +0 -261
  254. package/lib/components/write.d.ts +0 -107
  255. package/lib/components/write.d.ts.map +0 -1
  256. package/lib/components/write.js +0 -222
  257. package/lib/components/write.ts +0 -272
  258. package/lib/data/DataPipeline.d.ts +0 -113
  259. package/lib/data/DataPipeline.d.ts.map +0 -1
  260. package/lib/data/DataPipeline.js +0 -359
  261. package/lib/data/DataPipeline.ts +0 -452
  262. package/lib/facades/dataframe.jux +0 -0
  263. package/lib/globals.d.ts +0 -21
  264. package/lib/reactivity/state.d.ts +0 -36
  265. package/lib/reactivity/state.d.ts.map +0 -1
  266. package/lib/reactivity/state.js +0 -67
  267. package/lib/reactivity/state.ts +0 -78
  268. package/lib/storage/DataFrame.d.ts +0 -284
  269. package/lib/storage/DataFrame.d.ts.map +0 -1
  270. package/lib/storage/DataFrame.js +0 -1022
  271. package/lib/storage/DataFrame.ts +0 -1195
  272. package/lib/storage/DataFrameSource.d.ts +0 -158
  273. package/lib/storage/DataFrameSource.d.ts.map +0 -1
  274. package/lib/storage/DataFrameSource.js +0 -409
  275. package/lib/storage/DataFrameSource.ts +0 -556
  276. package/lib/storage/FileStorage.d.ts +0 -53
  277. package/lib/storage/FileStorage.d.ts.map +0 -1
  278. package/lib/storage/FileStorage.js +0 -80
  279. package/lib/storage/FileStorage.ts +0 -95
  280. package/lib/storage/IndexedDBDriver.d.ts +0 -75
  281. package/lib/storage/IndexedDBDriver.d.ts.map +0 -1
  282. package/lib/storage/IndexedDBDriver.js +0 -177
  283. package/lib/storage/IndexedDBDriver.ts +0 -226
  284. package/lib/storage/TabularDriver.d.ts +0 -118
  285. package/lib/storage/TabularDriver.d.ts.map +0 -1
  286. package/lib/storage/TabularDriver.js +0 -731
  287. package/lib/storage/TabularDriver.ts +0 -874
  288. package/lib/utils/codeparser.d.ts +0 -29
  289. package/lib/utils/codeparser.d.ts.map +0 -1
  290. package/lib/utils/codeparser.js +0 -409
  291. package/lib/utils/fetch.d.ts +0 -176
  292. package/lib/utils/fetch.d.ts.map +0 -1
  293. package/lib/utils/fetch.js +0 -427
  294. package/lib/utils/formatId.d.ts +0 -16
  295. package/lib/utils/formatId.d.ts.map +0 -1
  296. package/lib/utils/formatId.js +0 -27
  297. package/lib/utils/path-resolver.js +0 -23
@@ -1,237 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { renderIcon } from './icons.js';
3
- import { formatIdAsLabel } from '../utils/formatId.js'; // ✅ Import utility
4
-
5
- // Event definitions
6
- const TRIGGER_EVENTS = [] as const;
7
- const CALLBACK_EVENTS = ['click'] as const; // ✅ Button fires click events
8
-
9
- export interface ButtonOptions {
10
- label?: string;
11
- icon?: string;
12
- variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'link' | string;
13
- size?: 'small' | 'medium' | 'large';
14
- disabled?: boolean;
15
- loading?: boolean;
16
- iconPosition?: 'left' | 'right';
17
- fullWidth?: boolean;
18
- type?: 'button' | 'submit' | 'reset';
19
- style?: string;
20
- class?: string;
21
- }
22
-
23
- type ButtonState = {
24
- label: string;
25
- content: string; // ✅ Raw HTML content (overrides label if set)
26
- icon: string;
27
- variant: string;
28
- size: string;
29
- disabled: boolean;
30
- loading: boolean;
31
- iconPosition: string;
32
- fullWidth: boolean;
33
- type: 'button' | 'submit' | 'reset';
34
- style: string;
35
- class: string;
36
- };
37
-
38
- export class Button extends BaseComponent<ButtonState> {
39
- private _buttonElement: HTMLButtonElement | null = null;
40
-
41
- constructor(id: string, options?: ButtonOptions) {
42
- const opts = options || {};
43
-
44
- super(id, {
45
- label: opts.label ?? formatIdAsLabel(id), // ✅ Auto-generate label
46
- content: '', // ✅ Empty by default
47
- icon: opts.icon ?? '',
48
- variant: opts.variant ?? 'primary',
49
- size: opts.size ?? 'medium',
50
- disabled: opts.disabled ?? false,
51
- loading: opts.loading ?? false,
52
- iconPosition: opts.iconPosition ?? 'left',
53
- fullWidth: opts.fullWidth ?? false,
54
- type: opts.type ?? 'button',
55
- style: opts.style ?? '',
56
- class: opts.class ?? ''
57
- });
58
- }
59
-
60
- protected getTriggerEvents(): readonly string[] {
61
- return TRIGGER_EVENTS;
62
- }
63
-
64
- protected getCallbackEvents(): readonly string[] {
65
- return CALLBACK_EVENTS;
66
- }
67
-
68
- /* ═════════════════════════════════════════════════════════════════
69
- * FLUENT API - Priority: content > label > auto-generated
70
- * ═════════════════════════════════════════════════════════════════ */
71
-
72
- /**
73
- * Set button label (plain text, auto-escaped)
74
- * Clears any HTML content
75
- */
76
- label(value: string): this {
77
- this.state.label = value;
78
- this.state.content = ''; // ✅ Clear HTML content when label is set
79
- this._updateButtonText();
80
- return this;
81
- }
82
-
83
- /**
84
- * Alias for label() - more semantic for buttons
85
- */
86
- text(value: string): this {
87
- return this.label(value);
88
- }
89
-
90
- /**
91
- * Set button content as HTML (overrides label)
92
- */
93
- content(value: string): this {
94
- this.state.content = value;
95
- this._updateButtonText();
96
- return this;
97
- }
98
-
99
- icon(value: string): this {
100
- this.state.icon = value;
101
- return this;
102
- }
103
- iconPosition(value: 'left' | 'right'): this {
104
- this.state.iconPosition = value;
105
- return this;
106
- }
107
- fullWidth(value: boolean): this {
108
- this.state.fullWidth = value;
109
- return this;
110
- }
111
-
112
- variant(value: string): this {
113
- this.state.variant = value;
114
- return this;
115
- }
116
-
117
- size(value: 'small' | 'medium' | 'large'): this {
118
- this.state.size = value;
119
- return this;
120
- }
121
-
122
-
123
-
124
- /**
125
- * Alias for content() - more semantic
126
- */
127
- html(value: string): this {
128
- return this.content(value);
129
- }
130
-
131
- /**
132
- * Update button text/HTML based on priority
133
- * Priority: content (HTML) > label (text) > loading state
134
- */
135
- private _updateButtonText(): void {
136
- if (!this._buttonElement) return;
137
-
138
- const textEl = this._buttonElement.querySelector('span:not(.jux-button-icon)') as HTMLElement;
139
- if (!textEl) return;
140
-
141
- // Priority 1: HTML content (if set)
142
- if (this.state.content) {
143
- textEl.innerHTML = this.state.content;
144
- }
145
- // Priority 2: Label text
146
- else if (this.state.label) {
147
- textEl.textContent = this.state.loading ? 'Loading...' : this.state.label;
148
- }
149
- }
150
-
151
- update(prop: string, value: any): void {
152
- // No reactive updates needed
153
- }
154
-
155
- /* ═════════════════════════════════════════════════════════════════
156
- * RENDER
157
- * ═════════════════════════════════════════════════════════════════ */
158
-
159
- /**
160
- * Override visible() to update the actual button element
161
- */
162
- visible(value: boolean): this {
163
- (this.state as any).visible = value;
164
-
165
- // Update the button element directly, not the container
166
- if (this._buttonElement) {
167
- this._buttonElement.style.display = value ? '' : 'none';
168
- }
169
-
170
- return this;
171
- }
172
-
173
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
174
- const container = this._setupContainer(targetId);
175
-
176
- const { content, icon, iconPosition, variant, size, style, class: className } = this.state;
177
-
178
- const button = document.createElement('button');
179
-
180
- // ✅ Base class + variant + size
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
-
189
- button.id = this._id;
190
-
191
- // ✅ Add user classes
192
- if (className) button.className += ` ${className}`;
193
-
194
- // ✅ Apply user style (no variant/size logic here)
195
- if (style) button.setAttribute('style', style);
196
-
197
- if (icon && iconPosition === 'left') {
198
- const iconEl = document.createElement('span');
199
- iconEl.className = 'jux-button-icon';
200
- iconEl.appendChild(renderIcon(icon));
201
- button.appendChild(iconEl);
202
- }
203
-
204
- const textEl = document.createElement('span');
205
- if (content) {
206
- textEl.innerHTML = content;
207
- } else if (this.state.label) {
208
- textEl.textContent = this.state.loading ? 'Loading...' : this.state.label;
209
- } else {
210
- // Fallback to auto-generated label from ID
211
- textEl.textContent = this.state.loading ? 'Loading...' : formatIdAsLabel(this._id);
212
- }
213
- button.appendChild(textEl);
214
-
215
- if (icon && iconPosition === 'right') {
216
- const iconEl = document.createElement('span');
217
- iconEl.className = 'jux-button-icon';
218
- iconEl.appendChild(renderIcon(icon));
219
- button.appendChild(iconEl);
220
- }
221
-
222
- button.addEventListener('click', (e) => {
223
- if (!this.state.disabled && !this.state.loading) {
224
- this._triggerCallback('click', e);
225
- }
226
- });
227
-
228
- this._wireStandardEvents(button);
229
- container.appendChild(button);
230
- this._buttonElement = button;
231
- return this;
232
- }
233
- }
234
-
235
- export function button(id: string, options?: ButtonOptions): Button {
236
- return new Button(id, options);
237
- }
@@ -1,35 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- export interface CardOptions {
3
- title?: string;
4
- content?: string;
5
- footer?: string;
6
- variant?: string;
7
- hoverable?: boolean;
8
- icon?: string;
9
- style?: string;
10
- class?: string;
11
- }
12
- type CardState = {
13
- title: string;
14
- content: string;
15
- footer: string;
16
- variant: string;
17
- hoverable: boolean;
18
- icon: string;
19
- style: string;
20
- class: string;
21
- };
22
- export declare class Card extends BaseComponent<CardState> {
23
- constructor(id: string, options?: CardOptions);
24
- protected getTriggerEvents(): readonly string[];
25
- protected getCallbackEvents(): readonly string[];
26
- title(value: string): this;
27
- content(value: string): this;
28
- footer(value: string): this;
29
- icon(value: string): this;
30
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
31
- update(prop: string, value: any): void;
32
- }
33
- export declare function card(id: string, options?: CardOptions): Card;
34
- export {};
35
- //# sourceMappingURL=card.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qBAAa,IAAK,SAAQ,aAAa,CAAC,SAAS,CAAC;gBACpC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;IAajD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAUhD,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK3B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IASzB,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAwFlE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAGvC;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CAEhE"}
@@ -1,130 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { renderIcon } from './icons.js';
3
- // Event definitions - Card is display-only, no interactive events
4
- const TRIGGER_EVENTS = [];
5
- const CALLBACK_EVENTS = ['click']; // ✅ Can be clicked for navigation/selection
6
- export class Card extends BaseComponent {
7
- constructor(id, options = {}) {
8
- super(id, {
9
- title: options.title ?? '',
10
- content: options.content ?? '',
11
- footer: options.footer ?? '',
12
- variant: options.variant ?? 'default',
13
- hoverable: options.hoverable ?? false,
14
- icon: options.icon ?? '',
15
- style: options.style ?? '',
16
- class: options.class ?? ''
17
- });
18
- }
19
- getTriggerEvents() {
20
- return TRIGGER_EVENTS;
21
- }
22
- getCallbackEvents() {
23
- return CALLBACK_EVENTS;
24
- }
25
- /* ═════════════════════════════════════════════════════════════════
26
- * FLUENT API
27
- * ═════════════════════════════════════════════════════════════════ */
28
- // ✅ Inherited from BaseComponent
29
- title(value) {
30
- this.state.title = value;
31
- return this;
32
- }
33
- content(value) {
34
- this.state.content = value;
35
- return this;
36
- }
37
- footer(value) {
38
- this.state.footer = value;
39
- return this;
40
- }
41
- icon(value) {
42
- this.state.icon = value;
43
- return this;
44
- }
45
- /* ═════════════════════════════════════════════════════════════════
46
- * RENDER
47
- * ═════════════════════════════════════════════════════════════════ */
48
- render(targetId) {
49
- const container = this._setupContainer(targetId);
50
- const { title, content, footer, variant, hoverable, icon, style, class: className } = this.state;
51
- const card = document.createElement('div');
52
- card.className = `jux-card jux-card-${variant}`;
53
- card.id = this._id;
54
- if (hoverable)
55
- card.classList.add('jux-card-hoverable');
56
- if (className)
57
- card.className += ` ${className}`;
58
- if (style)
59
- card.setAttribute('style', style);
60
- if (title || icon) {
61
- const header = document.createElement('div');
62
- header.className = 'jux-card-header';
63
- if (icon) {
64
- const iconEl = document.createElement('span');
65
- iconEl.className = 'jux-card-icon';
66
- iconEl.appendChild(renderIcon(icon));
67
- header.appendChild(iconEl);
68
- }
69
- if (title) {
70
- const titleEl = document.createElement('span');
71
- titleEl.className = 'jux-card-title';
72
- titleEl.textContent = title;
73
- header.appendChild(titleEl);
74
- }
75
- card.appendChild(header);
76
- }
77
- const body = document.createElement('div');
78
- body.className = 'jux-card-body';
79
- body.innerHTML = content;
80
- card.appendChild(body);
81
- if (footer) {
82
- const footerEl = document.createElement('div');
83
- footerEl.className = 'jux-card-footer';
84
- footerEl.innerHTML = footer;
85
- card.appendChild(footerEl);
86
- }
87
- this._wireStandardEvents(card);
88
- // Wire sync bindings
89
- this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
90
- if (property === 'title') {
91
- const transform = toComponent || ((v) => String(v));
92
- stateObj.subscribe((val) => {
93
- const transformed = transform(val);
94
- const header = card.querySelector('.jux-card-header');
95
- if (header) {
96
- header.textContent = transformed;
97
- }
98
- this.state.title = transformed;
99
- });
100
- }
101
- else if (property === 'content') {
102
- const transform = toComponent || ((v) => String(v));
103
- stateObj.subscribe((val) => {
104
- const transformed = transform(val);
105
- body.innerHTML = transformed;
106
- this.state.content = transformed;
107
- });
108
- }
109
- else if (property === 'footer') {
110
- const transform = toComponent || ((v) => String(v));
111
- stateObj.subscribe((val) => {
112
- const transformed = transform(val);
113
- const footerEl = card.querySelector('.jux-card-footer');
114
- if (footerEl) {
115
- footerEl.innerHTML = transformed;
116
- }
117
- this.state.footer = transformed;
118
- });
119
- }
120
- });
121
- container.appendChild(card);
122
- return this;
123
- }
124
- update(prop, value) {
125
- // No reactive updates needed
126
- }
127
- }
128
- export function card(id, options = {}) {
129
- return new Card(id, options);
130
- }
@@ -1,177 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { renderIcon } from './icons.js';
3
-
4
- // Event definitions - Card is display-only, no interactive events
5
- const TRIGGER_EVENTS = [] as const;
6
- const CALLBACK_EVENTS = ['click'] as const; // ✅ Can be clicked for navigation/selection
7
-
8
- export interface CardOptions {
9
- title?: string;
10
- content?: string;
11
- footer?: string;
12
- variant?: string;
13
- hoverable?: boolean;
14
- icon?: string;
15
- style?: string;
16
- class?: string;
17
- }
18
-
19
- type CardState = {
20
- title: string;
21
- content: string;
22
- footer: string;
23
- variant: string;
24
- hoverable: boolean;
25
- icon: string;
26
- style: string;
27
- class: string;
28
- };
29
-
30
- export class Card extends BaseComponent<CardState> {
31
- constructor(id: string, options: CardOptions = {}) {
32
- super(id, {
33
- title: options.title ?? '',
34
- content: options.content ?? '',
35
- footer: options.footer ?? '',
36
- variant: options.variant ?? 'default',
37
- hoverable: options.hoverable ?? false,
38
- icon: options.icon ?? '',
39
- style: options.style ?? '',
40
- class: options.class ?? ''
41
- });
42
- }
43
-
44
- protected getTriggerEvents(): readonly string[] {
45
- return TRIGGER_EVENTS;
46
- }
47
-
48
- protected getCallbackEvents(): readonly string[] {
49
- return CALLBACK_EVENTS;
50
- }
51
-
52
- /* ═════════════════════════════════════════════════════════════════
53
- * FLUENT API
54
- * ═════════════════════════════════════════════════════════════════ */
55
-
56
- // ✅ Inherited from BaseComponent
57
-
58
- title(value: string): this {
59
- this.state.title = value;
60
- return this;
61
- }
62
-
63
- content(value: string): this {
64
- this.state.content = value;
65
- return this;
66
- }
67
-
68
- footer(value: string): this {
69
- this.state.footer = value;
70
- return this;
71
- }
72
-
73
- icon(value: string): this {
74
- this.state.icon = value;
75
- return this;
76
- }
77
-
78
- /* ═════════════════════════════════════════════════════════════════
79
- * RENDER
80
- * ═════════════════════════════════════════════════════════════════ */
81
-
82
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
83
- const container = this._setupContainer(targetId);
84
-
85
- const { title, content, footer, variant, hoverable, icon, style, class: className } = this.state;
86
-
87
- const card = document.createElement('div');
88
- card.className = `jux-card jux-card-${variant}`;
89
- card.id = this._id;
90
- if (hoverable) card.classList.add('jux-card-hoverable');
91
- if (className) card.className += ` ${className}`;
92
- if (style) card.setAttribute('style', style);
93
-
94
- if (title || icon) {
95
- const header = document.createElement('div');
96
- header.className = 'jux-card-header';
97
-
98
- if (icon) {
99
- const iconEl = document.createElement('span');
100
- iconEl.className = 'jux-card-icon';
101
- iconEl.appendChild(renderIcon(icon));
102
- header.appendChild(iconEl);
103
- }
104
-
105
- if (title) {
106
- const titleEl = document.createElement('span');
107
- titleEl.className = 'jux-card-title';
108
- titleEl.textContent = title;
109
- header.appendChild(titleEl);
110
- }
111
-
112
- card.appendChild(header);
113
- }
114
-
115
- const body = document.createElement('div');
116
- body.className = 'jux-card-body';
117
- body.innerHTML = content;
118
- card.appendChild(body);
119
-
120
- if (footer) {
121
- const footerEl = document.createElement('div');
122
- footerEl.className = 'jux-card-footer';
123
- footerEl.innerHTML = footer;
124
- card.appendChild(footerEl);
125
- }
126
-
127
- this._wireStandardEvents(card);
128
-
129
- // Wire sync bindings
130
- this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
131
- if (property === 'title') {
132
- const transform = toComponent || ((v: any) => String(v));
133
-
134
- stateObj.subscribe((val: any) => {
135
- const transformed = transform(val);
136
- const header = card.querySelector('.jux-card-header');
137
- if (header) {
138
- header.textContent = transformed;
139
- }
140
- this.state.title = transformed;
141
- });
142
- }
143
- else if (property === 'content') {
144
- const transform = toComponent || ((v: any) => String(v));
145
-
146
- stateObj.subscribe((val: any) => {
147
- const transformed = transform(val);
148
- body.innerHTML = transformed;
149
- this.state.content = transformed;
150
- });
151
- }
152
- else if (property === 'footer') {
153
- const transform = toComponent || ((v: any) => String(v));
154
-
155
- stateObj.subscribe((val: any) => {
156
- const transformed = transform(val);
157
- const footerEl = card.querySelector('.jux-card-footer');
158
- if (footerEl) {
159
- footerEl.innerHTML = transformed;
160
- }
161
- this.state.footer = transformed;
162
- });
163
- }
164
- });
165
-
166
- container.appendChild(card);
167
- return this;
168
- }
169
-
170
- update(prop: string, value: any): void {
171
- // No reactive updates needed
172
- }
173
- }
174
-
175
- export function card(id: string, options: CardOptions = {}): Card {
176
- return new Card(id, options);
177
- }
@@ -1,49 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { Chart, ChartType, ChartOptions, ChartData } from 'chart.js/auto';
3
- export interface ChartState {
4
- type: ChartType;
5
- data: ChartData;
6
- options: ChartOptions;
7
- style?: string;
8
- class?: string;
9
- visible?: boolean;
10
- disabled?: boolean;
11
- loading?: boolean;
12
- }
13
- /**
14
- * Chart component using Chart.js
15
- * Provides fluent API for creating and configuring charts
16
- */
17
- export declare class ChartComponent extends BaseComponent<ChartState> {
18
- private static readonly TRIGGER_EVENTS;
19
- private static readonly CALLBACK_EVENTS;
20
- private chartInstance;
21
- constructor(id: string, type?: ChartType, options?: Partial<ChartState>);
22
- protected getTriggerEvents(): readonly string[];
23
- protected getCallbackEvents(): readonly string[];
24
- type(value: ChartType): this;
25
- data(value: ChartData): this;
26
- labels(value: string[]): this;
27
- datasets(value: any[]): this;
28
- addDataset(dataset: any): this;
29
- options(value: ChartOptions): this;
30
- responsive(value?: boolean): this;
31
- maintainAspectRatio(value?: boolean): this;
32
- title(text: string, display?: boolean): this;
33
- legend(display?: boolean, position?: 'top' | 'bottom' | 'left' | 'right'): this;
34
- tooltip(enabled?: boolean): this;
35
- /**
36
- * Update chart with new data or configuration
37
- */
38
- updateChart(mode?: 'resize' | 'reset' | 'none' | 'hide' | 'show' | 'default'): this;
39
- reset(): this;
40
- destroy(): this;
41
- getChart(): Chart | null;
42
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
43
- update(prop: string, value: any): void;
44
- }
45
- /**
46
- * Factory function for creating chart components
47
- */
48
- export declare function chart(id: string, type?: ChartType, options?: Partial<ChartState>): ChartComponent;
49
- //# sourceMappingURL=chart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAsB,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI9F,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,aAAa,CAAC,UAAU,CAAC;IACzD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAyB;IAC/D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAsD;IAC7F,OAAO,CAAC,aAAa,CAAsB;gBAE/B,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,SAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC;IAS9E,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAQhD,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAoB5B,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAS5B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAS7B,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI;IAS5B,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAa9B,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IASlC,UAAU,CAAC,KAAK,GAAE,OAAc,GAAG,IAAI;IAIvC,mBAAmB,CAAC,KAAK,GAAE,OAAc,GAAG,IAAI;IAIhD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,OAAc,GAAG,IAAI;IASlD,MAAM,CAAC,OAAO,GAAE,OAAc,EAAE,QAAQ,GAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAe,GAAG,IAAI;IAS5F,OAAO,CAAC,OAAO,GAAE,OAAc,GAAG,IAAI;IAatC;;OAEG;IACH,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI;IAOnF,KAAK,IAAI,IAAI;IAOb,OAAO,IAAI,IAAI;IASf,QAAQ,IAAI,KAAK,GAAG,IAAI;IAQxB,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAuDlE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAGzC;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,SAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,cAAc,CAExG"}