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,473 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- import { renderIcon } from './icons.js';
3
- import { formatIdAsLabel } from '../utils/formatId.js'; // ✅ Import
4
-
5
- // Event definitions
6
- const TRIGGER_EVENTS = [] as const;
7
- const CALLBACK_EVENTS = ['change', 'input'] as const;
8
-
9
- export interface InputOptions {
10
- type?: string;
11
- value?: string;
12
- placeholder?: string;
13
- label?: string;
14
- icon?: string;
15
- required?: boolean;
16
- disabled?: boolean;
17
- name?: string;
18
- rows?: number;
19
- min?: number;
20
- max?: number;
21
- step?: number;
22
- minLength?: number;
23
- maxLength?: number;
24
- pattern?: string;
25
- onValidate?: (value: string) => boolean | string;
26
- style?: string;
27
- class?: string;
28
- }
29
-
30
- interface InputState extends BaseState {
31
- type: string;
32
- value: string;
33
- placeholder: string;
34
- icon: string;
35
- rows: number;
36
- min?: number;
37
- max?: number;
38
- step?: number;
39
- minLength?: number;
40
- maxLength?: number;
41
- pattern?: string;
42
- // ✅ Form-specific properties from BaseState are inherited:
43
- // label, required, name, errorMessage
44
- }
45
-
46
- export class Input extends BaseComponent<InputState> {
47
- constructor(id: string, options: InputOptions = {}) {
48
- super(id, {
49
- // ✅ BaseState properties
50
- visible: true,
51
- disabled: options.disabled ?? false,
52
- loading: false,
53
- class: options.class ?? '',
54
- style: options.style ?? '',
55
- attributes: {},
56
-
57
- // ✅ Form-specific BaseState properties
58
- label: options.label ?? formatIdAsLabel(id), // ✅ Auto-generate if not provided
59
- required: options.required ?? false,
60
- name: options.name ?? id,
61
- errorMessage: undefined,
62
-
63
- // ✅ Input-specific properties
64
- type: options.type ?? 'text',
65
- value: options.value ?? '',
66
- placeholder: options.placeholder ?? '',
67
- icon: options.icon ?? '',
68
- rows: options.rows ?? 3,
69
- min: options.min,
70
- max: options.max,
71
- step: options.step,
72
- minLength: options.minLength,
73
- maxLength: options.maxLength,
74
- pattern: options.pattern
75
- });
76
-
77
- if (options.onValidate) {
78
- this._onValidate = options.onValidate;
79
- }
80
- }
81
-
82
- protected getTriggerEvents(): readonly string[] {
83
- return TRIGGER_EVENTS;
84
- }
85
-
86
- protected getCallbackEvents(): readonly string[] {
87
- return CALLBACK_EVENTS;
88
- }
89
-
90
- /* ═════════════════════════════════════════════════════════════════
91
- * FLUENT API
92
- * ═════════════════════════════════════════════════════════════════ */
93
-
94
- type(value: string): this {
95
- this.state.type = value;
96
- return this;
97
- }
98
-
99
- value(value: string | number): this {
100
- return this.setValue(String(value));
101
- }
102
-
103
- placeholder(value: string): this {
104
- this.state.placeholder = value;
105
- return this;
106
- }
107
-
108
- icon(value: string): this {
109
- this.state.icon = value;
110
- return this;
111
- }
112
-
113
- rows(value: number): this {
114
- this.state.rows = value;
115
- return this;
116
- }
117
-
118
- min(value: number): this {
119
- this.state.min = value;
120
- return this;
121
- }
122
-
123
- max(value: number): this {
124
- this.state.max = value;
125
- return this;
126
- }
127
-
128
- step(value: number): this {
129
- this.state.step = value;
130
- return this;
131
- }
132
-
133
- minLength(value: number): this {
134
- this.state.minLength = value;
135
- return this;
136
- }
137
-
138
- maxLength(value: number): this {
139
- this.state.maxLength = value;
140
- return this;
141
- }
142
-
143
- pattern(value: string): this {
144
- this.state.pattern = value;
145
- return this;
146
- }
147
-
148
- /* ═════════════════════════════════════════════════════════════════
149
- * FORM INPUT IMPLEMENTATION (Override BaseComponent methods)
150
- * ═════════════════════════════════════════════════════════════════ */
151
-
152
- getValue(): string {
153
- return this.state.value;
154
- }
155
-
156
- setValue(value: string): this {
157
- this.state.value = value;
158
- if (this._inputElement) {
159
- (this._inputElement as HTMLInputElement | HTMLTextAreaElement).value = value;
160
- }
161
- return this;
162
- }
163
-
164
- getNumericValue(): number | null {
165
- const num = Number(this.state.value);
166
- return isNaN(num) ? null : num;
167
- }
168
-
169
- validate(): boolean {
170
- this._hasBeenValidated = true;
171
- const value = this.getValue();
172
- const result = this._validateValue(value);
173
-
174
- if (result === true) {
175
- this._clearError();
176
- return true;
177
- } else {
178
- this._showError(result as string);
179
- return false;
180
- }
181
- }
182
-
183
- isValid(): boolean {
184
- const value = this.getValue();
185
- return this._validateValue(value) === true;
186
- }
187
-
188
- protected _validateValue(value: string): boolean | string {
189
- const { required, type, min, max, minLength, maxLength, pattern } = this.state;
190
-
191
- if (required && !value.trim()) {
192
- return 'This field is required';
193
- }
194
-
195
- if (type === 'number' && value) {
196
- const numValue = Number(value);
197
-
198
- if (isNaN(numValue)) {
199
- return 'Must be a valid number';
200
- }
201
-
202
- if (min !== undefined && numValue < min) {
203
- return `Must be at least ${min}`;
204
- }
205
-
206
- if (max !== undefined && numValue > max) {
207
- return `Must be at most ${max}`;
208
- }
209
- }
210
-
211
- if ((type === 'text' || type === 'textarea') && value) {
212
- if (minLength !== undefined && value.length < minLength) {
213
- return `Must be at least ${minLength} characters`;
214
- }
215
-
216
- if (maxLength !== undefined && value.length > maxLength) {
217
- return `Must be at most ${maxLength} characters`;
218
- }
219
- }
220
-
221
- if (pattern && value) {
222
- const regex = new RegExp(pattern);
223
- if (!regex.test(value)) {
224
- return 'Invalid format';
225
- }
226
- }
227
-
228
- if (this._onValidate) {
229
- const result = this._onValidate(value);
230
- if (result !== true) {
231
- return result || 'Invalid value';
232
- }
233
- }
234
-
235
- return true;
236
- }
237
-
238
- protected _buildInputElement(): HTMLElement {
239
- const { type, value, placeholder, required, disabled, name, rows, min, max, step, minLength, maxLength, pattern } = this.state;
240
-
241
- let inputEl: HTMLInputElement | HTMLTextAreaElement;
242
-
243
- if (type === 'textarea') {
244
- inputEl = document.createElement('textarea');
245
- inputEl.rows = rows;
246
- if (minLength !== undefined) inputEl.minLength = minLength;
247
- if (maxLength !== undefined) inputEl.maxLength = maxLength;
248
- } else {
249
- inputEl = document.createElement('input');
250
- inputEl.type = type;
251
-
252
- if (type === 'number') {
253
- if (min !== undefined) inputEl.min = String(min);
254
- if (max !== undefined) inputEl.max = String(max);
255
- if (step !== undefined) inputEl.step = String(step);
256
- }
257
-
258
- if (type === 'text' || type === 'email' || type === 'tel' || type === 'url') {
259
- if (minLength !== undefined) inputEl.minLength = minLength;
260
- if (maxLength !== undefined) inputEl.maxLength = maxLength;
261
- if (pattern) inputEl.pattern = pattern;
262
- }
263
- }
264
-
265
- inputEl.className = 'jux-input-element';
266
- inputEl.id = `${this._id}-input`;
267
- inputEl.name = name!;
268
- inputEl.value = value;
269
- inputEl.placeholder = placeholder;
270
- inputEl.required = required!;
271
- inputEl.disabled = disabled!;
272
-
273
- return inputEl;
274
- }
275
-
276
- /* ═════════════════════════════════════════════════════════════════
277
- * RENDER
278
- * ═════════════════════════════════════════════════════════════════ */
279
-
280
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
281
- const container = this._setupContainer(targetId);
282
-
283
- const { icon, maxLength, type, style, class: className, label } = this.state;
284
-
285
- // Build wrapper
286
- const wrapper = document.createElement('div');
287
- wrapper.className = 'jux-input';
288
- wrapper.id = this._id;
289
- if (className) wrapper.className += ` ${className}`;
290
- if (style) wrapper.setAttribute('style', style);
291
-
292
- // ✅ Label - always render if exists or can be auto-generated
293
- if (label || !label) { // Always render label
294
- wrapper.appendChild(this._renderLabel());
295
- }
296
-
297
- // Input container
298
- const inputContainer = document.createElement('div');
299
- inputContainer.className = 'jux-input-container';
300
- if (icon) inputContainer.classList.add('jux-input-with-icon');
301
-
302
- // Icon
303
- if (icon) {
304
- const iconEl = document.createElement('span');
305
- iconEl.className = 'jux-input-icon';
306
- iconEl.appendChild(renderIcon(icon));
307
- inputContainer.appendChild(iconEl);
308
- }
309
-
310
- // Input element
311
- const inputEl = this._buildInputElement();
312
- this._inputElement = inputEl;
313
- inputContainer.appendChild(inputEl);
314
- wrapper.appendChild(inputContainer);
315
-
316
- // Error element
317
- wrapper.appendChild(this._renderError());
318
-
319
- // Character counter
320
- if (maxLength && (type === 'text' || type === 'textarea')) {
321
- const counterEl = document.createElement('div');
322
- counterEl.className = 'jux-input-counter';
323
- counterEl.id = `${this._id}-counter`;
324
- counterEl.textContent = `${this.state.value.length}/${maxLength}`;
325
- wrapper.appendChild(counterEl);
326
-
327
- inputEl.addEventListener('input', (e) => {
328
- const input = inputEl as HTMLInputElement | HTMLTextAreaElement;
329
- counterEl.textContent = `${input.value.length}/${maxLength}`;
330
- this.state.value = input.value;
331
- this._triggerCallback('input', input.value, e, this);
332
- });
333
- } else {
334
- inputEl.addEventListener('input', (e) => {
335
- const input = inputEl as HTMLInputElement | HTMLTextAreaElement;
336
- this.state.value = input.value;
337
- this._triggerCallback('input', input.value, e, this);
338
- });
339
- }
340
-
341
- // Fire change event on blur
342
- inputEl.addEventListener('change', (e) => {
343
- const input = inputEl as HTMLInputElement | HTMLTextAreaElement;
344
- this._triggerCallback('change', input.value, e, this);
345
- });
346
-
347
- // Wire events
348
- this._wireStandardEvents(wrapper);
349
- this._wireFormSync(inputEl, 'input');
350
-
351
- // Sync label changes
352
- const labelSync = this._syncBindings.find(b => b.property === 'label');
353
- if (labelSync) {
354
- const transform = labelSync.toComponent || ((v: any) => String(v));
355
- labelSync.stateObj.subscribe((val: any) => {
356
- this.label(transform(val));
357
- });
358
- }
359
-
360
- container.appendChild(wrapper);
361
-
362
- requestAnimationFrame(() => {
363
- if ((window as any).lucide) {
364
- (window as any).lucide.createIcons();
365
- }
366
- });
367
-
368
- return this;
369
- }
370
- }
371
-
372
- export function input(id: string, options: InputOptions = {}): Input {
373
- return new Input(id, options);
374
- }
375
-
376
- // Shorter, consistent naming
377
- export function text(id: string, options?: Omit<InputOptions, 'type'>): Input {
378
- return new Input(id, { ...options, type: 'text' });
379
- }
380
-
381
- export function textRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
382
- return new Input(id, { ...options, type: 'text', required: true });
383
- }
384
-
385
-
386
- export function number(id: string, options?: Omit<InputOptions, 'type'>): Input {
387
- return new Input(id, { ...options, type: 'number' });
388
- }
389
-
390
-
391
- export function numberRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
392
- return new Input(id, { ...options, type: 'number', required: true });
393
- }
394
-
395
-
396
- export function email(id: string, options?: Omit<InputOptions, 'type'>): Input {
397
- return new Input(id, { ...options, type: 'email' });
398
- }
399
-
400
- export function emailRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
401
- return new Input(id, { ...options, type: 'email', required: true });
402
- }
403
-
404
- export function password(id: string, options?: Omit<InputOptions, 'type'>): Input {
405
- return new Input(id, { ...options, type: 'password' });
406
- }
407
-
408
- export function passwordRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
409
- return new Input(id, { ...options, type: 'password', required: true });
410
- }
411
-
412
- export function tel(id: string, options?: Omit<InputOptions, 'type'>): Input {
413
- return new Input(id, { ...options, type: 'tel' });
414
- }
415
-
416
- export function telRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
417
- return new Input(id, { ...options, type: 'tel', required: true });
418
- }
419
-
420
- export function phone(id: string, options?: Omit<InputOptions, 'type'>): Input {
421
- return new Input(id, { ...options, type: 'tel' });
422
- }
423
- export function phoneRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
424
- return new Input(id, { ...options, type: 'tel', required: true });
425
- }
426
-
427
- export function url(id: string, options?: Omit<InputOptions, 'type'>): Input {
428
- return new Input(id, { ...options, type: 'url' });
429
- }
430
-
431
- export function urlRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
432
- return new Input(id, { ...options, type: 'url', required: true });
433
- }
434
- export function textarea(id: string, options?: Omit<InputOptions, 'type'>): Input {
435
- return new Input(id, { ...options, type: 'textarea' });
436
- }
437
- export function textareaRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
438
- return new Input(id, { ...options, type: 'textarea', required: true });
439
- }
440
-
441
- export function range(id: string, options?: Omit<InputOptions, 'type'>): Input {
442
- return new Input(id, { ...options, type: 'range' });
443
- }
444
-
445
- export function rangeRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
446
- return new Input(id, { ...options, type: 'range', required: true });
447
- }
448
-
449
-
450
- export function date(id: string, options?: Omit<InputOptions, 'type'>): Input {
451
- return new Input(id, { ...options, type: 'date' });
452
- }
453
-
454
-
455
- export function dateRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
456
- return new Input(id, { ...options, type: 'date', required: true });
457
- }
458
-
459
- export function time(id: string, options?: Omit<InputOptions, 'type'>): Input {
460
- return new Input(id, { ...options, type: 'time' });
461
- }
462
-
463
- export function timeRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
464
- return new Input(id, { ...options, type: 'time', required: true });
465
- }
466
-
467
- export function color(id: string, options?: Omit<InputOptions, 'type'>): Input {
468
- return new Input(id, { ...options, type: 'color' });
469
- }
470
-
471
- export function colorRequired(id: string, options?: Omit<InputOptions, 'type'>): Input {
472
- return new Input(id, { ...options, type: 'color', required: true });
473
- }
@@ -1,72 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- export interface LayerOptions {
3
- preset?: LayerPreset;
4
- opacity?: number;
5
- zIndex?: number;
6
- blur?: number;
7
- content?: string | BaseComponent<any>;
8
- style?: string;
9
- class?: string;
10
- }
11
- interface LayerState extends BaseState {
12
- preset?: string;
13
- content?: string;
14
- }
15
- /**
16
- * Gradient preset names from gradients.css
17
- */
18
- export type LayerPreset = 'ocean' | 'sunset' | 'forest' | 'fire' | 'ice' | 'candy' | 'emerald' | 'midnight' | 'peach' | 'royal' | 'coral' | 'mint' | 'grape' | 'cherry' | 'sky' | 'aurora' | 'tropical' | 'cosmic' | 'neon' | 'volcano' | 'radial-sun' | 'radial-moon' | 'radial-blue' | 'radial-purple' | 'radial-fire' | 'radial-ocean' | 'radial-emerald' | 'radial-sunset' | 'conic-rainbow' | 'conic-sunset' | 'conic-ocean' | 'conic-fire' | 'conic-neon' | 'dark-space' | 'dark-navy' | 'dark-purple' | 'dark-forest' | 'dark-crimson' | 'dark-slate' | 'overlay-dark' | 'overlay-light' | 'overlay-blue' | 'overlay-purple' | 'overlay-sunset' | 'mesh-purple' | 'mesh-ocean' | 'mesh-fire' | 'mesh-neon' | 'pastel-pink' | 'pastel-blue' | 'pastel-green' | 'pastel-purple' | 'pastel-peach' | 'pastel-lavender' | 'animated' | 'animated-fast' | 'animated-slow';
19
- export declare class Layer extends BaseComponent<LayerState> {
20
- constructor(id: string, options?: LayerOptions);
21
- protected getTriggerEvents(): readonly string[];
22
- protected getCallbackEvents(): readonly string[];
23
- /**
24
- * Set layer opacity
25
- */
26
- opacity(value: number): this;
27
- /**
28
- * Set layer z-index
29
- */
30
- zIndex(value: number): this;
31
- /**
32
- * Apply a gradient preset from gradients.css
33
- */
34
- preset(value: LayerPreset): this;
35
- /**
36
- * Set layer content (text or component)
37
- */
38
- content(value: string | BaseComponent<any>): this;
39
- /**
40
- * Apply backdrop blur (for overlay effects)
41
- */
42
- backdropBlur(value: number): this;
43
- /**
44
- * Make layer cover entire parent (position: absolute with inset: 0)
45
- */
46
- fullCover(): this;
47
- /**
48
- * Make layer fixed to viewport
49
- */
50
- fixed(): this;
51
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
52
- update(prop: string, value: any): void;
53
- }
54
- export declare function layer(id: string, options?: LayerOptions): Layer;
55
- /**
56
- * Create a gradient layer with preset
57
- */
58
- export declare function gradient(id: string, preset: LayerPreset, options?: Omit<LayerOptions, 'preset'>): Layer;
59
- /**
60
- * Create a dark overlay (for hero images, etc.)
61
- */
62
- export declare function overlay(id: string, opacity?: number): Layer;
63
- /**
64
- * Create a blur overlay (glassmorphism effect)
65
- */
66
- export declare function glassLayer(id: string, blur?: number, opacity?: number): Layer;
67
- /**
68
- * Create an animated gradient background
69
- */
70
- export declare function animatedGradient(id: string, speed?: 'fast' | 'normal' | 'slow'): Layer;
71
- export {};
72
- //# sourceMappingURL=layer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMnE,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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