juxscript 1.1.239 → 1.1.243

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/tag.ts +68 -0
  4. package/lib/styles/shadcn.css +20 -7
  5. package/lib/utils/idgen.ts +6 -0
  6. package/package.json +5 -6
  7. package/index.d.ts +0 -239
  8. package/index.d.ts.map +0 -1
  9. package/lib/components/alert.d.ts +0 -36
  10. package/lib/components/alert.d.ts.map +0 -1
  11. package/lib/components/alert.js +0 -172
  12. package/lib/components/alert.ts +0 -219
  13. package/lib/components/app.d.ts +0 -89
  14. package/lib/components/app.d.ts.map +0 -1
  15. package/lib/components/app.js +0 -175
  16. package/lib/components/app.ts +0 -247
  17. package/lib/components/badge.d.ts +0 -26
  18. package/lib/components/badge.d.ts.map +0 -1
  19. package/lib/components/badge.js +0 -91
  20. package/lib/components/badge.ts +0 -118
  21. package/lib/components/base/Animations.d.ts +0 -36
  22. package/lib/components/base/Animations.d.ts.map +0 -1
  23. package/lib/components/base/Animations.js +0 -70
  24. package/lib/components/base/Animations.ts +0 -112
  25. package/lib/components/base/BaseComponent.d.ts +0 -294
  26. package/lib/components/base/BaseComponent.d.ts.map +0 -1
  27. package/lib/components/base/BaseComponent.js +0 -735
  28. package/lib/components/base/BaseComponent.ts +0 -884
  29. package/lib/components/base/FormInput.d.ts +0 -77
  30. package/lib/components/base/FormInput.d.ts.map +0 -1
  31. package/lib/components/base/FormInput.js +0 -171
  32. package/lib/components/base/FormInput.ts +0 -237
  33. package/lib/components/blueprint.d.ts +0 -40
  34. package/lib/components/blueprint.d.ts.map +0 -1
  35. package/lib/components/blueprint.js +0 -327
  36. package/lib/components/button.d.ts +0 -70
  37. package/lib/components/button.d.ts.map +0 -1
  38. package/lib/components/button.js +0 -177
  39. package/lib/components/button.ts +0 -237
  40. package/lib/components/card.d.ts +0 -35
  41. package/lib/components/card.d.ts.map +0 -1
  42. package/lib/components/card.js +0 -130
  43. package/lib/components/card.ts +0 -177
  44. package/lib/components/chart.d.ts +0 -49
  45. package/lib/components/chart.d.ts.map +0 -1
  46. package/lib/components/chart.js +0 -205
  47. package/lib/components/chart.ts +0 -254
  48. package/lib/components/checkbox.d.ts +0 -33
  49. package/lib/components/checkbox.d.ts.map +0 -1
  50. package/lib/components/checkbox.js +0 -202
  51. package/lib/components/checkbox.ts +0 -260
  52. package/lib/components/code.d.ts +0 -52
  53. package/lib/components/code.d.ts.map +0 -1
  54. package/lib/components/code.js +0 -201
  55. package/lib/components/code.ts +0 -260
  56. package/lib/components/container.d.ts +0 -60
  57. package/lib/components/container.d.ts.map +0 -1
  58. package/lib/components/container.js +0 -195
  59. package/lib/components/container.ts +0 -259
  60. package/lib/components/data.d.ts +0 -36
  61. package/lib/components/data.d.ts.map +0 -1
  62. package/lib/components/data.js +0 -110
  63. package/lib/components/data.ts +0 -135
  64. package/lib/components/dataframe/DataFrameSource.d.ts +0 -118
  65. package/lib/components/dataframe/DataFrameSource.d.ts.map +0 -1
  66. package/lib/components/dataframe/DataFrameSource.js +0 -421
  67. package/lib/components/dataframe/DataFrameSource.ts +0 -532
  68. package/lib/components/dataframe/ImportSettingsModal.d.ts +0 -60
  69. package/lib/components/dataframe/ImportSettingsModal.d.ts.map +0 -1
  70. package/lib/components/dataframe/ImportSettingsModal.js +0 -442
  71. package/lib/components/dataframe/ImportSettingsModal.ts +0 -531
  72. package/lib/components/dataframe.d.ts +0 -110
  73. package/lib/components/dataframe.d.ts.map +0 -1
  74. package/lib/components/dataframe.js +0 -470
  75. package/lib/components/datepicker.d.ts +0 -40
  76. package/lib/components/datepicker.d.ts.map +0 -1
  77. package/lib/components/datepicker.js +0 -193
  78. package/lib/components/datepicker.ts +0 -251
  79. package/lib/components/dialog.d.ts +0 -39
  80. package/lib/components/dialog.d.ts.map +0 -1
  81. package/lib/components/dialog.js +0 -131
  82. package/lib/components/dialog.ts +0 -178
  83. package/lib/components/divider.d.ts +0 -31
  84. package/lib/components/divider.d.ts.map +0 -1
  85. package/lib/components/divider.js +0 -72
  86. package/lib/components/divider.ts +0 -104
  87. package/lib/components/dropdown-menu.d.ts +0 -42
  88. package/lib/components/dropdown-menu.d.ts.map +0 -1
  89. package/lib/components/dropdown-menu.js +0 -177
  90. package/lib/components/dropdown-menu.ts +0 -214
  91. package/lib/components/dropdown.d.ts +0 -41
  92. package/lib/components/dropdown.d.ts.map +0 -1
  93. package/lib/components/dropdown.js +0 -136
  94. package/lib/components/dropdown.ts +0 -188
  95. package/lib/components/element.d.ts +0 -51
  96. package/lib/components/element.d.ts.map +0 -1
  97. package/lib/components/element.js +0 -209
  98. package/lib/components/element.ts +0 -271
  99. package/lib/components/event-chain.d.ts +0 -9
  100. package/lib/components/event-chain.d.ts.map +0 -1
  101. package/lib/components/event-chain.js +0 -33
  102. package/lib/components/fileupload.d.ts +0 -98
  103. package/lib/components/fileupload.d.ts.map +0 -1
  104. package/lib/components/fileupload.js +0 -351
  105. package/lib/components/fileupload.ts +0 -449
  106. package/lib/components/grid.d.ts +0 -88
  107. package/lib/components/grid.d.ts.map +0 -1
  108. package/lib/components/grid.js +0 -208
  109. package/lib/components/grid.ts +0 -295
  110. package/lib/components/heading.d.ts +0 -25
  111. package/lib/components/heading.d.ts.map +0 -1
  112. package/lib/components/heading.js +0 -83
  113. package/lib/components/heading.ts +0 -113
  114. package/lib/components/helpers.d.ts +0 -9
  115. package/lib/components/helpers.d.ts.map +0 -1
  116. package/lib/components/helpers.js +0 -30
  117. package/lib/components/helpers.ts +0 -41
  118. package/lib/components/hero.d.ts +0 -60
  119. package/lib/components/hero.d.ts.map +0 -1
  120. package/lib/components/hero.js +0 -239
  121. package/lib/components/hero.ts +0 -302
  122. package/lib/components/history/StateHistory.d.ts +0 -91
  123. package/lib/components/history/StateHistory.d.ts.map +0 -1
  124. package/lib/components/history/StateHistory.js +0 -154
  125. package/lib/components/history/StateHistory.ts +0 -200
  126. package/lib/components/icon.d.ts +0 -36
  127. package/lib/components/icon.d.ts.map +0 -1
  128. package/lib/components/icon.js +0 -135
  129. package/lib/components/icon.ts +0 -182
  130. package/lib/components/icons.d.ts +0 -25
  131. package/lib/components/icons.d.ts.map +0 -1
  132. package/lib/components/icons.js +0 -440
  133. package/lib/components/icons.ts +0 -464
  134. package/lib/components/image.d.ts +0 -42
  135. package/lib/components/image.d.ts.map +0 -1
  136. package/lib/components/image.js +0 -204
  137. package/lib/components/image.ts +0 -260
  138. package/lib/components/include.d.ts +0 -86
  139. package/lib/components/include.d.ts.map +0 -1
  140. package/lib/components/include.js +0 -238
  141. package/lib/components/include.ts +0 -281
  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,178 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
-
3
- // Event definitions
4
- const TRIGGER_EVENTS = [] as const;
5
- const CALLBACK_EVENTS = ['confirm', 'cancel'] as const;
6
-
7
- export interface DialogOptions {
8
- title?: string;
9
- message?: string;
10
- confirmText?: string;
11
- cancelText?: string;
12
- variant?: 'default' | 'danger' | 'warning';
13
- style?: string;
14
- class?: string;
15
- }
16
-
17
- type DialogState = {
18
- title: string;
19
- message: string;
20
- confirmText: string;
21
- cancelText: string;
22
- variant: string;
23
- open: boolean;
24
- style: string;
25
- class: string;
26
- };
27
-
28
- export class Dialog extends BaseComponent<DialogState> {
29
- private _dialog: HTMLElement | null = null;
30
- private _overlay: HTMLElement | null = null;
31
-
32
- constructor(id: string, options: DialogOptions = {}) {
33
- super(id, {
34
- title: options.title ?? 'Confirm',
35
- message: options.message ?? 'Are you sure?',
36
- confirmText: options.confirmText ?? 'Confirm',
37
- cancelText: options.cancelText ?? 'Cancel',
38
- variant: options.variant ?? 'default',
39
- open: false,
40
- style: options.style ?? '',
41
- class: options.class ?? ''
42
- });
43
- }
44
-
45
- protected getTriggerEvents(): readonly string[] {
46
- return TRIGGER_EVENTS;
47
- }
48
-
49
- protected getCallbackEvents(): readonly string[] {
50
- return CALLBACK_EVENTS;
51
- }
52
-
53
- /* ═════════════════════════════════════════════════════════════════
54
- * FLUENT API
55
- * ═════════════════════════════════════════════════════════════════ */
56
-
57
- title(value: string): this {
58
- this.state.title = value;
59
- return this;
60
- }
61
-
62
- message(value: string): this {
63
- this.state.message = value;
64
- return this;
65
- }
66
-
67
- confirmText(value: string): this {
68
- this.state.confirmText = value;
69
- return this;
70
- }
71
-
72
- cancelText(value: string): this {
73
- this.state.cancelText = value;
74
- return this;
75
- }
76
-
77
- variant(value: 'default' | 'danger' | 'warning'): this {
78
- this.state.variant = value;
79
- return this;
80
- }
81
-
82
- open(): this {
83
- this.state.open = true;
84
- if (this._overlay) {
85
- this._overlay.style.display = 'flex';
86
- }
87
- this._triggerCallback('open', true, null, this);
88
- return this;
89
- }
90
-
91
- close(): this {
92
- this.state.open = false;
93
- if (this._overlay) {
94
- this._overlay.style.display = 'none';
95
- }
96
- this._triggerCallback('close', false, null, this);
97
- return this;
98
- }
99
-
100
- update(prop: string, value: any): void {
101
- // No reactive updates needed
102
- }
103
-
104
- /* ═════════════════════════════════════════════════════════════════
105
- * RENDER
106
- * ═════════════════════════════════════════════════════════════════ */
107
-
108
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
109
- const { title, message, confirmText, cancelText, variant, style, class: className } = this.state;
110
-
111
- // Overlay
112
- const overlay = document.createElement('div');
113
- overlay.className = 'jux-dialog-overlay';
114
- overlay.style.display = 'none';
115
- this._overlay = overlay;
116
-
117
- // Dialog
118
- const dialog = document.createElement('div');
119
- dialog.className = `jux-dialog jux-dialog-${variant}`;
120
- dialog.id = this._id;
121
- if (className) dialog.className += ` ${className}`;
122
- if (style) dialog.setAttribute('style', style);
123
- this._dialog = dialog;
124
-
125
- // Title
126
- const titleEl = document.createElement('div');
127
- titleEl.className = 'jux-dialog-title';
128
- titleEl.textContent = title;
129
- dialog.appendChild(titleEl);
130
-
131
- // Message
132
- const messageEl = document.createElement('div');
133
- messageEl.className = 'jux-dialog-message';
134
- messageEl.textContent = message;
135
- dialog.appendChild(messageEl);
136
-
137
- // Actions
138
- const actions = document.createElement('div');
139
- actions.className = 'jux-dialog-actions';
140
-
141
- const cancelBtn = document.createElement('button');
142
- cancelBtn.className = 'jux-dialog-button jux-dialog-button-cancel';
143
- cancelBtn.textContent = cancelText;
144
- cancelBtn.addEventListener('click', () => {
145
- this._triggerCallback('cancel');
146
- this.close();
147
- });
148
-
149
- const confirmBtn = document.createElement('button');
150
- confirmBtn.className = `jux-dialog-button jux-dialog-button-confirm jux-dialog-button-${variant}`;
151
- confirmBtn.textContent = confirmText;
152
- confirmBtn.addEventListener('click', () => {
153
- this._triggerCallback('confirm');
154
- this.close();
155
- });
156
-
157
- actions.appendChild(cancelBtn);
158
- actions.appendChild(confirmBtn);
159
- dialog.appendChild(actions);
160
-
161
- // Close on overlay click
162
- overlay.addEventListener('click', (e) => {
163
- if (e.target === overlay) {
164
- this._triggerCallback('cancel');
165
- this.close();
166
- }
167
- });
168
-
169
- overlay.appendChild(dialog);
170
- document.body.appendChild(overlay);
171
-
172
- return this;
173
- }
174
- }
175
-
176
- export function dialog(id: string, options: DialogOptions = {}): Dialog {
177
- return new Dialog(id, options);
178
- }
@@ -1,31 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- export interface DividerOptions {
3
- text?: string;
4
- variant?: 'default' | 'dashed' | 'dotted';
5
- margin?: string;
6
- style?: string;
7
- class?: string;
8
- }
9
- type DividerState = {
10
- text: string;
11
- variant: string;
12
- margin: string;
13
- style: string;
14
- class: string;
15
- orientation: string;
16
- };
17
- export declare class Divider extends BaseComponent<DividerState> {
18
- constructor(id?: string, options?: DividerOptions);
19
- protected getTriggerEvents(): readonly string[];
20
- protected getCallbackEvents(): readonly string[];
21
- text(value: string): this;
22
- orientation(value: 'horizontal' | 'vertical'): this;
23
- style(value: string): this;
24
- class(value: string): this;
25
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
26
- renderTo(juxComponent: any): this;
27
- update(prop: string, value: any): void;
28
- }
29
- export declare function divider(options?: DividerOptions): Divider;
30
- export {};
31
- //# sourceMappingURL=divider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["divider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAMxD,MAAM,WAAW,cAAc;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,qBAAa,OAAQ,SAAQ,aAAa,CAAC,YAAY,CAAC;gBACxC,EAAE,GAAE,MAA2E,EAAE,OAAO,GAAE,cAAmB;IAWzH,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,IAAI;IAKnD,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAyBlE,QAAQ,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI;IAOjC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAGzC;AAGD,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAE7D"}
@@ -1,72 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- // Event definitions
3
- const TRIGGER_EVENTS = [];
4
- const CALLBACK_EVENTS = [];
5
- export class Divider extends BaseComponent {
6
- constructor(id = `divider-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, options = {}) {
7
- super(id, {
8
- text: options.text ?? '',
9
- variant: options.variant ?? 'default',
10
- margin: options.margin ?? '1rem 0',
11
- style: options.style ?? '',
12
- class: options.class ?? '',
13
- orientation: 'horizontal'
14
- });
15
- }
16
- getTriggerEvents() {
17
- return TRIGGER_EVENTS;
18
- }
19
- getCallbackEvents() {
20
- return CALLBACK_EVENTS;
21
- }
22
- text(value) {
23
- this.state.text = value;
24
- return this;
25
- }
26
- orientation(value) {
27
- this.state.orientation = value;
28
- return this;
29
- }
30
- style(value) {
31
- this.state.style = value;
32
- return this;
33
- }
34
- class(value) {
35
- this.state.class = value;
36
- return this;
37
- }
38
- render(targetId) {
39
- const container = this._setupContainer(targetId);
40
- const { text, variant, margin, style, class: className } = this.state;
41
- const divider = document.createElement('div');
42
- divider.className = `jux-divider jux-divider-${variant}`;
43
- divider.id = this._id;
44
- divider.style.margin = margin;
45
- if (className)
46
- divider.className += ` ${className}`;
47
- if (style)
48
- divider.setAttribute('style', `${divider.getAttribute('style')}; ${style}`);
49
- if (text) {
50
- const textEl = document.createElement('span');
51
- textEl.className = 'jux-divider-text';
52
- textEl.textContent = text;
53
- divider.appendChild(textEl);
54
- }
55
- this._wireStandardEvents(divider);
56
- container.appendChild(divider);
57
- return this;
58
- }
59
- renderTo(juxComponent) {
60
- if (!juxComponent?._id) {
61
- throw new Error('Divider.renderTo: Invalid component');
62
- }
63
- return this.render(`#${juxComponent._id}`);
64
- }
65
- update(prop, value) {
66
- // No reactive updates needed
67
- }
68
- }
69
- // ✅ ID is now optional - auto-generated if not provided
70
- export function divider(options = {}) {
71
- return new Divider(undefined, options);
72
- }
@@ -1,104 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
-
3
- // Event definitions
4
- const TRIGGER_EVENTS = [] as const;
5
- const CALLBACK_EVENTS = [] as const;
6
-
7
- export interface DividerOptions {
8
- text?: string;
9
- variant?: 'default' | 'dashed' | 'dotted';
10
- margin?: string;
11
- style?: string;
12
- class?: string;
13
- }
14
-
15
- type DividerState = {
16
- text: string;
17
- variant: string;
18
- margin: string;
19
- style: string;
20
- class: string;
21
- orientation: string;
22
- };
23
-
24
- export class Divider extends BaseComponent<DividerState> {
25
- constructor(id: string = `divider-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, options: DividerOptions = {}) {
26
- super(id, {
27
- text: options.text ?? '',
28
- variant: options.variant ?? 'default',
29
- margin: options.margin ?? '1rem 0',
30
- style: options.style ?? '',
31
- class: options.class ?? '',
32
- orientation: 'horizontal'
33
- });
34
- }
35
-
36
- protected getTriggerEvents(): readonly string[] {
37
- return TRIGGER_EVENTS;
38
- }
39
-
40
- protected getCallbackEvents(): readonly string[] {
41
- return CALLBACK_EVENTS;
42
- }
43
-
44
- text(value: string): this {
45
- this.state.text = value;
46
- return this;
47
- }
48
-
49
- orientation(value: 'horizontal' | 'vertical'): this {
50
- this.state.orientation = value;
51
- return this;
52
- }
53
-
54
- style(value: string): this {
55
- this.state.style = value;
56
- return this;
57
- }
58
-
59
- class(value: string): this {
60
- this.state.class = value;
61
- return this;
62
- }
63
-
64
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
65
- const container = this._setupContainer(targetId);
66
-
67
- const { text, variant, margin, style, class: className } = this.state;
68
-
69
- const divider = document.createElement('div');
70
- divider.className = `jux-divider jux-divider-${variant}`;
71
- divider.id = this._id;
72
- divider.style.margin = margin;
73
- if (className) divider.className += ` ${className}`;
74
- if (style) divider.setAttribute('style', `${divider.getAttribute('style')}; ${style}`);
75
-
76
- if (text) {
77
- const textEl = document.createElement('span');
78
- textEl.className = 'jux-divider-text';
79
- textEl.textContent = text;
80
- divider.appendChild(textEl);
81
- }
82
-
83
- this._wireStandardEvents(divider);
84
- container.appendChild(divider);
85
-
86
- return this;
87
- }
88
-
89
- renderTo(juxComponent: any): this {
90
- if (!juxComponent?._id) {
91
- throw new Error('Divider.renderTo: Invalid component');
92
- }
93
- return this.render(`#${juxComponent._id}`);
94
- }
95
-
96
- update(prop: string, value: any): void {
97
- // No reactive updates needed
98
- }
99
- }
100
-
101
- // ✅ ID is now optional - auto-generated if not provided
102
- export function divider(options: DividerOptions = {}): Divider {
103
- return new Divider(undefined, options);
104
- }
@@ -1,42 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- export interface DropdownMenuItem {
3
- type?: 'item' | 'label' | 'separator';
4
- label?: string;
5
- value?: string;
6
- shortcut?: string;
7
- disabled?: boolean;
8
- submenu?: boolean;
9
- }
10
- export interface DropdownMenuOptions {
11
- trigger?: string;
12
- items?: DropdownMenuItem[];
13
- style?: string;
14
- class?: string;
15
- }
16
- type DropdownMenuState = BaseState & {
17
- trigger: string;
18
- items: DropdownMenuItem[];
19
- open: boolean;
20
- };
21
- export declare class DropdownMenu extends BaseComponent<DropdownMenuState> {
22
- private _wrapper;
23
- private _menuEl;
24
- constructor(id: string, options?: DropdownMenuOptions);
25
- protected getTriggerEvents(): readonly string[];
26
- protected getCallbackEvents(): readonly string[];
27
- trigger(value: string): this;
28
- items(value: DropdownMenuItem[]): this;
29
- addItem(item: DropdownMenuItem): this;
30
- separator(): this;
31
- label(text: string): this;
32
- item(label: string, value?: string, shortcut?: string): this;
33
- open(): this;
34
- close(): this;
35
- toggle(): this;
36
- update(prop: string, value: any): void;
37
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
38
- private _buildItems;
39
- }
40
- export declare function dropdownMenu(id: string, options?: DropdownMenuOptions): DropdownMenu;
41
- export {};
42
- //# sourceMappingURL=dropdown-menu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["dropdown-menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKnE,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,iBAAiB,GAAG,SAAS,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,YAAa,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IAC9D,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,OAAO,CAA4B;gBAE/B,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;IAUzD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAC/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAE5B,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAEtC,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAKrC,SAAS,IAAI,IAAI;IAIjB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5D,IAAI,IAAI,IAAI;IAMZ,KAAK,IAAI,IAAI;IAMb,MAAM,IAAI,IAAI;IAId,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAItC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IA2ElE,OAAO,CAAC,WAAW;CA+CtB;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY,CAExF"}
@@ -1,177 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- const TRIGGER_EVENTS = [];
3
- const CALLBACK_EVENTS = ['select'];
4
- export class DropdownMenu extends BaseComponent {
5
- constructor(id, options = {}) {
6
- super(id, {
7
- trigger: options.trigger ?? 'Open',
8
- items: options.items ?? [],
9
- open: false,
10
- style: options.style ?? '',
11
- class: options.class ?? ''
12
- });
13
- this._wrapper = null;
14
- this._menuEl = null;
15
- }
16
- getTriggerEvents() { return TRIGGER_EVENTS; }
17
- getCallbackEvents() { return CALLBACK_EVENTS; }
18
- /* ═══════════════════════ FLUENT API ═══════════════════════ */
19
- trigger(value) { this.state.trigger = value; return this; }
20
- items(value) { this.state.items = value; return this; }
21
- addItem(item) {
22
- this.state.items = [...this.state.items, item];
23
- return this;
24
- }
25
- separator() {
26
- return this.addItem({ type: 'separator' });
27
- }
28
- label(text) {
29
- return this.addItem({ type: 'label', label: text });
30
- }
31
- item(label, value, shortcut) {
32
- return this.addItem({ label, value: value ?? label, shortcut });
33
- }
34
- open() {
35
- this.state.open = true;
36
- if (this._menuEl)
37
- this._menuEl.style.display = 'flex';
38
- return this;
39
- }
40
- close() {
41
- this.state.open = false;
42
- if (this._menuEl)
43
- this._menuEl.style.display = 'none';
44
- return this;
45
- }
46
- toggle() {
47
- return this.state.open ? this.close() : this.open();
48
- }
49
- update(prop, value) { }
50
- /* ═══════════════════════ RENDER ═══════════════════════ */
51
- render(targetId) {
52
- const container = this._setupContainer(targetId);
53
- const { trigger, items, style, class: className } = this.state;
54
- // Inject styles once
55
- if (!document.getElementById('jux-dropdown-menu-styles')) {
56
- const styleEl = document.createElement('style');
57
- styleEl.id = 'jux-dropdown-menu-styles';
58
- styleEl.textContent = `
59
- .jux-dmenu-wrapper { position:relative; display:inline-block; }
60
- .jux-dmenu-trigger { display:inline-flex; align-items:center; gap:4px; padding:8px 16px; font-size:14px; font-weight:500; border-radius:6px; border:1px solid hsl(var(--border,0 0% 80%)); background:hsl(var(--background,0 0% 100%)); color:hsl(var(--foreground,0 0% 9%)); cursor:pointer; transition:background .15s; }
61
- .jux-dmenu-trigger:hover { background:hsl(var(--accent,0 0% 96%)); }
62
- .jux-dmenu-menu { position:absolute; top:calc(100% + 4px); left:0; min-width:220px; padding:4px; border-radius:8px; border:1px solid hsl(var(--border,0 0% 90%)); background:hsl(var(--popover,0 0% 100%)); color:hsl(var(--popover-foreground,0 0% 9%)); box-shadow:0 4px 12px rgba(0,0,0,.08),0 1px 3px rgba(0,0,0,.06); z-index:100; display:none; flex-direction:column; animation:jux-dmenu-in .12s ease-out; }
63
- @keyframes jux-dmenu-in { from{opacity:0;transform:translateY(-4px) scale(.98)} to{opacity:1;transform:translateY(0) scale(1)} }
64
- .jux-dmenu-label { padding:6px 8px 4px; font-size:12px; font-weight:600; color:hsl(var(--muted-foreground,0 0% 45%)); user-select:none; }
65
- .jux-dmenu-sep { height:1px; margin:4px -4px; background:hsl(var(--border,0 0% 90%)); }
66
- .jux-dmenu-item { display:flex; align-items:center; justify-content:space-between; width:100%; padding:6px 8px; font-size:14px; border-radius:4px; border:none; background:transparent; color:hsl(var(--popover-foreground,0 0% 9%)); cursor:pointer; text-align:left; transition:background .1s; gap:8px; font-family:inherit; }
67
- .jux-dmenu-item:hover { background:hsl(var(--accent,0 0% 96%)); }
68
- .jux-dmenu-item:focus-visible { outline:2px solid hsl(var(--ring,0 0% 63%)); outline-offset:-2px; }
69
- .jux-dmenu-item[disabled] { opacity:.5; pointer-events:none; }
70
- .jux-dmenu-item-label { flex:1; }
71
- .jux-dmenu-shortcut { font-size:12px; color:hsl(var(--muted-foreground,0 0% 45%)); letter-spacing:.04em; }
72
- .jux-dmenu-arrow { font-size:10px; color:hsl(var(--muted-foreground,0 0% 45%)); }
73
- `;
74
- document.head.appendChild(styleEl);
75
- }
76
- const wrapper = document.createElement('div');
77
- wrapper.className = 'jux-dmenu-wrapper';
78
- wrapper.id = this._id;
79
- if (className)
80
- wrapper.className += ` ${className}`;
81
- if (style)
82
- wrapper.setAttribute('style', style);
83
- const triggerBtn = document.createElement('button');
84
- triggerBtn.className = 'jux-dmenu-trigger';
85
- triggerBtn.textContent = trigger;
86
- triggerBtn.type = 'button';
87
- wrapper.appendChild(triggerBtn);
88
- const menu = document.createElement('div');
89
- menu.className = 'jux-dmenu-menu';
90
- this._menuEl = menu;
91
- this._buildItems(menu, items);
92
- wrapper.appendChild(menu);
93
- // Toggle
94
- triggerBtn.addEventListener('click', (e) => { e.stopPropagation(); this.toggle(); });
95
- document.addEventListener('click', (e) => { if (!wrapper.contains(e.target))
96
- this.close(); });
97
- // Keyboard
98
- triggerBtn.addEventListener('keydown', (e) => {
99
- if (e.key === 'ArrowDown' || e.key === 'Enter' || e.key === ' ') {
100
- e.preventDefault();
101
- this.open();
102
- const first = menu.querySelector('.jux-dmenu-item:not([disabled])');
103
- if (first)
104
- first.focus();
105
- }
106
- });
107
- menu.addEventListener('keydown', (e) => {
108
- const btns = Array.from(menu.querySelectorAll('.jux-dmenu-item:not([disabled])'));
109
- const idx = btns.indexOf(document.activeElement);
110
- if (e.key === 'ArrowDown') {
111
- e.preventDefault();
112
- btns[(idx + 1) % btns.length]?.focus();
113
- }
114
- else if (e.key === 'ArrowUp') {
115
- e.preventDefault();
116
- btns[(idx - 1 + btns.length) % btns.length]?.focus();
117
- }
118
- else if (e.key === 'Escape') {
119
- this.close();
120
- triggerBtn.focus();
121
- }
122
- });
123
- this._wireStandardEvents(wrapper);
124
- container.appendChild(wrapper);
125
- this._wrapper = wrapper;
126
- return this;
127
- }
128
- _buildItems(menu, items) {
129
- menu.innerHTML = '';
130
- items.forEach(item => {
131
- if (item.type === 'separator') {
132
- const sep = document.createElement('div');
133
- sep.className = 'jux-dmenu-sep';
134
- menu.appendChild(sep);
135
- }
136
- else if (item.type === 'label') {
137
- const lbl = document.createElement('div');
138
- lbl.className = 'jux-dmenu-label';
139
- lbl.textContent = item.label ?? '';
140
- menu.appendChild(lbl);
141
- }
142
- else {
143
- const btn = document.createElement('button');
144
- btn.className = 'jux-dmenu-item';
145
- btn.type = 'button';
146
- if (item.disabled)
147
- btn.disabled = true;
148
- const labelSpan = document.createElement('span');
149
- labelSpan.className = 'jux-dmenu-item-label';
150
- labelSpan.textContent = item.label ?? '';
151
- btn.appendChild(labelSpan);
152
- if (item.submenu) {
153
- const arrow = document.createElement('span');
154
- arrow.className = 'jux-dmenu-arrow';
155
- arrow.textContent = '›';
156
- btn.appendChild(arrow);
157
- }
158
- else if (item.shortcut) {
159
- const sc = document.createElement('span');
160
- sc.className = 'jux-dmenu-shortcut';
161
- sc.textContent = item.shortcut;
162
- btn.appendChild(sc);
163
- }
164
- btn.addEventListener('click', (e) => {
165
- if (!item.disabled) {
166
- this._triggerCallback('select', item.value || item.label, e, this);
167
- this.close();
168
- }
169
- });
170
- menu.appendChild(btn);
171
- }
172
- });
173
- }
174
- }
175
- export function dropdownMenu(id, options = {}) {
176
- return new DropdownMenu(id, options);
177
- }