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,219 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- // Event definitions
3
- const TRIGGER_EVENTS = [];
4
- const CALLBACK_EVENTS = [];
5
- export class Layer extends BaseComponent {
6
- constructor(id, options = {}) {
7
- super(id, {
8
- visible: true,
9
- disabled: false,
10
- loading: false,
11
- class: options.class ?? '',
12
- style: options.style ?? '',
13
- attributes: {},
14
- preset: options.preset,
15
- content: typeof options.content === 'string' ? options.content : undefined
16
- });
17
- // Apply initial options via layout extensions
18
- if (options.opacity !== undefined) {
19
- this.opacity(options.opacity);
20
- }
21
- if (options.zIndex !== undefined) {
22
- this.zIndex(options.zIndex);
23
- }
24
- if (options.blur !== undefined) {
25
- this.backdropBlur(options.blur);
26
- }
27
- }
28
- getTriggerEvents() {
29
- return TRIGGER_EVENTS;
30
- }
31
- getCallbackEvents() {
32
- return CALLBACK_EVENTS;
33
- }
34
- /* ═════════════════════════════════════════════════════════════════
35
- * FLUENT API
36
- * ═════════════════════════════════════════════════════════════════ */
37
- /**
38
- * Set layer opacity
39
- */
40
- opacity(value) {
41
- const opacityValue = Math.max(0, Math.min(1, value));
42
- const currentStyle = this.state.style || '';
43
- // Remove existing opacity
44
- const styles = currentStyle
45
- .split(';')
46
- .filter(s => !s.trim().startsWith('opacity'))
47
- .map(s => s.trim());
48
- styles.push(`opacity: ${opacityValue}`);
49
- this.state.style = styles.join('; ');
50
- return this;
51
- }
52
- /**
53
- * Set layer z-index
54
- */
55
- zIndex(value) {
56
- const currentStyle = this.state.style || '';
57
- // Remove existing z-index
58
- const styles = currentStyle
59
- .split(';')
60
- .filter(s => !s.trim().startsWith('z-index'))
61
- .map(s => s.trim());
62
- styles.push(`z-index: ${value}`);
63
- this.state.style = styles.join('; ');
64
- return this;
65
- }
66
- /**
67
- * Apply a gradient preset from gradients.css
68
- */
69
- preset(value) {
70
- this.state.preset = value;
71
- this.addClass(`jux-gradient-${value}`);
72
- return this;
73
- }
74
- /**
75
- * Set layer content (text or component)
76
- */
77
- content(value) {
78
- if (typeof value === 'string') {
79
- this.state.content = value;
80
- if (this.container) {
81
- const el = this.container.querySelector(`#${this._id}`);
82
- if (el)
83
- el.innerHTML = value;
84
- }
85
- }
86
- return this;
87
- }
88
- /**
89
- * Apply backdrop blur (for overlay effects)
90
- */
91
- backdropBlur(value) {
92
- const blurValue = `blur(${value}px)`;
93
- const currentStyle = this.state.style || '';
94
- // Remove existing backdrop-filter
95
- const styles = currentStyle
96
- .split(';')
97
- .filter(s => !s.trim().startsWith('backdrop-filter'))
98
- .map(s => s.trim());
99
- styles.push(`backdrop-filter: ${blurValue}`);
100
- this.state.style = styles.join('; ');
101
- return this;
102
- }
103
- /**
104
- * Make layer cover entire parent (position: absolute with inset: 0)
105
- */
106
- fullCover() {
107
- const currentStyle = this.state.style || '';
108
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
109
- styles.push('position: absolute', 'top: 0', 'left: 0', 'right: 0', 'bottom: 0');
110
- this.state.style = styles.join('; ');
111
- return this;
112
- }
113
- /**
114
- * Make layer fixed to viewport
115
- */
116
- fixed() {
117
- const currentStyle = this.state.style || '';
118
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
119
- styles.push('position: fixed', 'top: 0', 'left: 0', 'right: 0', 'bottom: 0');
120
- this.state.style = styles.join('; ');
121
- return this;
122
- }
123
- /* ═════════════════════════════════════════════════════════════════
124
- * RENDER
125
- * ═════════════════════════════════════════════════════════════════ */
126
- render(targetId) {
127
- const container = this._setupContainer(targetId);
128
- const { preset, content, style, class: className } = this.state;
129
- const layer = document.createElement('div');
130
- layer.id = this._id;
131
- layer.className = 'jux-layer';
132
- if (preset) {
133
- layer.className += ` jux-gradient-${preset}`;
134
- }
135
- if (className) {
136
- layer.className += ` ${className}`;
137
- }
138
- if (style) {
139
- layer.setAttribute('style', style);
140
- }
141
- if (content) {
142
- layer.innerHTML = content;
143
- }
144
- this._wireStandardEvents(layer);
145
- container.appendChild(layer);
146
- return this;
147
- }
148
- update(prop, value) {
149
- if (!this.container)
150
- return;
151
- const el = this.container.querySelector(`#${this._id}`);
152
- if (!el)
153
- return;
154
- switch (prop) {
155
- case 'preset':
156
- // Remove old gradient classes
157
- el.className = el.className
158
- .split(' ')
159
- .filter(c => !c.startsWith('jux-gradient-'))
160
- .join(' ');
161
- // Add new gradient class
162
- if (value) {
163
- el.classList.add(`jux-gradient-${value}`);
164
- }
165
- break;
166
- case 'content':
167
- el.innerHTML = value;
168
- break;
169
- default:
170
- super.update(prop, value);
171
- break;
172
- }
173
- }
174
- }
175
- export function layer(id, options = {}) {
176
- return new Layer(id, options);
177
- }
178
- // ✅ Convenience helpers for common use cases
179
- /**
180
- * Create a gradient layer with preset
181
- */
182
- export function gradient(id, preset, options = {}) {
183
- return new Layer(id, { ...options, preset });
184
- }
185
- /**
186
- * Create a dark overlay (for hero images, etc.)
187
- */
188
- export function overlay(id, opacity = 0.5) {
189
- const layer = new Layer(id, { preset: 'overlay-dark', opacity }).fullCover();
190
- const currentStyle = layer.state.style || '';
191
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
192
- styles.push('pointer-events: none');
193
- layer.state.style = styles.join('; ');
194
- return layer;
195
- }
196
- /**
197
- * Create a blur overlay (glassmorphism effect)
198
- */
199
- export function glassLayer(id, blur = 10, opacity = 0.8) {
200
- const layer = new Layer(id, { blur, opacity }).fullCover();
201
- const currentStyle = layer.state.style || '';
202
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
203
- styles.push('background-color: rgba(255, 255, 255, 0.1)');
204
- layer.state.style = styles.join('; ');
205
- return layer;
206
- }
207
- /**
208
- * Create an animated gradient background
209
- */
210
- export function animatedGradient(id, speed = 'normal') {
211
- const presetMap = {
212
- fast: 'animated-fast',
213
- normal: 'animated',
214
- slow: 'animated-slow'
215
- };
216
- return new Layer(id, { preset: presetMap[speed] })
217
- .fullCover()
218
- .zIndex(-1);
219
- }
@@ -1,304 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
-
3
- // Event definitions
4
- const TRIGGER_EVENTS = [] as const;
5
- const CALLBACK_EVENTS = [] as const;
6
-
7
- export interface LayerOptions {
8
- preset?: LayerPreset;
9
- opacity?: number;
10
- zIndex?: number;
11
- blur?: number;
12
- content?: string | BaseComponent<any>;
13
- style?: string;
14
- class?: string;
15
- }
16
-
17
- interface LayerState extends BaseState {
18
- preset?: string;
19
- content?: string;
20
- }
21
-
22
- /**
23
- * Gradient preset names from gradients.css
24
- */
25
- export type LayerPreset =
26
- // Linear Gradients
27
- | 'ocean' | 'sunset' | 'forest' | 'fire' | 'ice' | 'candy' | 'emerald'
28
- | 'midnight' | 'peach' | 'royal' | 'coral' | 'mint' | 'grape' | 'cherry' | 'sky'
29
- // Multi-Stop Linear
30
- | 'aurora' | 'tropical' | 'cosmic' | 'neon' | 'volcano'
31
- // Radial Gradients
32
- | 'radial-sun' | 'radial-moon' | 'radial-blue' | 'radial-purple'
33
- | 'radial-fire' | 'radial-ocean' | 'radial-emerald' | 'radial-sunset'
34
- // Conic Gradients
35
- | 'conic-rainbow' | 'conic-sunset' | 'conic-ocean' | 'conic-fire' | 'conic-neon'
36
- // Dark Gradients
37
- | 'dark-space' | 'dark-navy' | 'dark-purple' | 'dark-forest'
38
- | 'dark-crimson' | 'dark-slate'
39
- // Transparent Overlays
40
- | 'overlay-dark' | 'overlay-light' | 'overlay-blue' | 'overlay-purple' | 'overlay-sunset'
41
- // Mesh/Textured
42
- | 'mesh-purple' | 'mesh-ocean' | 'mesh-fire' | 'mesh-neon'
43
- // Pastel
44
- | 'pastel-pink' | 'pastel-blue' | 'pastel-green' | 'pastel-purple'
45
- | 'pastel-peach' | 'pastel-lavender'
46
- // Animated
47
- | 'animated' | 'animated-fast' | 'animated-slow';
48
-
49
- export class Layer extends BaseComponent<LayerState> {
50
- constructor(id: string, options: LayerOptions = {}) {
51
- super(id, {
52
- visible: true,
53
- disabled: false,
54
- loading: false,
55
- class: options.class ?? '',
56
- style: options.style ?? '',
57
- attributes: {},
58
- preset: options.preset,
59
- content: typeof options.content === 'string' ? options.content : undefined
60
- });
61
-
62
- // Apply initial options via layout extensions
63
- if (options.opacity !== undefined) {
64
- this.opacity(options.opacity);
65
- }
66
- if (options.zIndex !== undefined) {
67
- this.zIndex(options.zIndex);
68
- }
69
- if (options.blur !== undefined) {
70
- this.backdropBlur(options.blur);
71
- }
72
- }
73
-
74
- protected getTriggerEvents(): readonly string[] {
75
- return TRIGGER_EVENTS;
76
- }
77
-
78
- protected getCallbackEvents(): readonly string[] {
79
- return CALLBACK_EVENTS;
80
- }
81
-
82
- /* ═════════════════════════════════════════════════════════════════
83
- * FLUENT API
84
- * ═════════════════════════════════════════════════════════════════ */
85
-
86
- /**
87
- * Set layer opacity
88
- */
89
- opacity(value: number): this {
90
- const opacityValue = Math.max(0, Math.min(1, value));
91
- const currentStyle = this.state.style || '';
92
-
93
- // Remove existing opacity
94
- const styles = currentStyle
95
- .split(';')
96
- .filter(s => !s.trim().startsWith('opacity'))
97
- .map(s => s.trim());
98
-
99
- styles.push(`opacity: ${opacityValue}`);
100
- this.state.style = styles.join('; ');
101
-
102
- return this;
103
- }
104
-
105
- /**
106
- * Set layer z-index
107
- */
108
- zIndex(value: number): this {
109
- const currentStyle = this.state.style || '';
110
-
111
- // Remove existing z-index
112
- const styles = currentStyle
113
- .split(';')
114
- .filter(s => !s.trim().startsWith('z-index'))
115
- .map(s => s.trim());
116
-
117
- styles.push(`z-index: ${value}`);
118
- this.state.style = styles.join('; ');
119
-
120
- return this;
121
- }
122
-
123
- /**
124
- * Apply a gradient preset from gradients.css
125
- */
126
- preset(value: LayerPreset): this {
127
- this.state.preset = value;
128
- this.addClass(`jux-gradient-${value}`);
129
- return this;
130
- }
131
-
132
- /**
133
- * Set layer content (text or component)
134
- */
135
- content(value: string | BaseComponent<any>): this {
136
- if (typeof value === 'string') {
137
- this.state.content = value;
138
- if (this.container) {
139
- const el = this.container.querySelector(`#${this._id}`) as HTMLElement;
140
- if (el) el.innerHTML = value;
141
- }
142
- }
143
- return this;
144
- }
145
-
146
- /**
147
- * Apply backdrop blur (for overlay effects)
148
- */
149
- backdropBlur(value: number): this {
150
- const blurValue = `blur(${value}px)`;
151
- const currentStyle = this.state.style || '';
152
-
153
- // Remove existing backdrop-filter
154
- const styles = currentStyle
155
- .split(';')
156
- .filter(s => !s.trim().startsWith('backdrop-filter'))
157
- .map(s => s.trim());
158
-
159
- styles.push(`backdrop-filter: ${blurValue}`);
160
- this.state.style = styles.join('; ');
161
-
162
- return this;
163
- }
164
-
165
- /**
166
- * Make layer cover entire parent (position: absolute with inset: 0)
167
- */
168
- fullCover(): this {
169
- const currentStyle = this.state.style || '';
170
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
171
- styles.push('position: absolute', 'top: 0', 'left: 0', 'right: 0', 'bottom: 0');
172
- this.state.style = styles.join('; ');
173
- return this;
174
- }
175
-
176
- /**
177
- * Make layer fixed to viewport
178
- */
179
- fixed(): this {
180
- const currentStyle = this.state.style || '';
181
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
182
- styles.push('position: fixed', 'top: 0', 'left: 0', 'right: 0', 'bottom: 0');
183
- this.state.style = styles.join('; ');
184
- return this;
185
- }
186
-
187
- /* ═════════════════════════════════════════════════════════════════
188
- * RENDER
189
- * ═════════════════════════════════════════════════════════════════ */
190
-
191
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
192
- const container = this._setupContainer(targetId);
193
-
194
- const { preset, content, style, class: className } = this.state;
195
-
196
- const layer = document.createElement('div');
197
- layer.id = this._id;
198
- layer.className = 'jux-layer';
199
-
200
- if (preset) {
201
- layer.className += ` jux-gradient-${preset}`;
202
- }
203
-
204
- if (className) {
205
- layer.className += ` ${className}`;
206
- }
207
-
208
- if (style) {
209
- layer.setAttribute('style', style);
210
- }
211
-
212
- if (content) {
213
- layer.innerHTML = content;
214
- }
215
-
216
- this._wireStandardEvents(layer);
217
-
218
- container.appendChild(layer);
219
-
220
- return this;
221
- }
222
-
223
- update(prop: string, value: any): void {
224
- if (!this.container) return;
225
-
226
- const el = this.container.querySelector(`#${this._id}`) as HTMLElement;
227
- if (!el) return;
228
-
229
- switch (prop) {
230
- case 'preset':
231
- // Remove old gradient classes
232
- el.className = el.className
233
- .split(' ')
234
- .filter(c => !c.startsWith('jux-gradient-'))
235
- .join(' ');
236
-
237
- // Add new gradient class
238
- if (value) {
239
- el.classList.add(`jux-gradient-${value}`);
240
- }
241
- break;
242
-
243
- case 'content':
244
- el.innerHTML = value;
245
- break;
246
-
247
- default:
248
- super.update(prop, value);
249
- break;
250
- }
251
- }
252
- }
253
-
254
- export function layer(id: string, options: LayerOptions = {}): Layer {
255
- return new Layer(id, options);
256
- }
257
-
258
- // ✅ Convenience helpers for common use cases
259
-
260
- /**
261
- * Create a gradient layer with preset
262
- */
263
- export function gradient(id: string, preset: LayerPreset, options: Omit<LayerOptions, 'preset'> = {}): Layer {
264
- return new Layer(id, { ...options, preset });
265
- }
266
-
267
- /**
268
- * Create a dark overlay (for hero images, etc.)
269
- */
270
- export function overlay(id: string, opacity: number = 0.5): Layer {
271
- const layer = new Layer(id, { preset: 'overlay-dark', opacity }).fullCover();
272
- const currentStyle = layer.state.style || '';
273
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
274
- styles.push('pointer-events: none');
275
- layer.state.style = styles.join('; ');
276
- return layer;
277
- }
278
-
279
- /**
280
- * Create a blur overlay (glassmorphism effect)
281
- */
282
- export function glassLayer(id: string, blur: number = 10, opacity: number = 0.8): Layer {
283
- const layer = new Layer(id, { blur, opacity }).fullCover();
284
- const currentStyle = layer.state.style || '';
285
- const styles = currentStyle.split(';').map(s => s.trim()).filter(Boolean);
286
- styles.push('background-color: rgba(255, 255, 255, 0.1)');
287
- layer.state.style = styles.join('; ');
288
- return layer;
289
- }
290
-
291
- /**
292
- * Create an animated gradient background
293
- */
294
- export function animatedGradient(id: string, speed: 'fast' | 'normal' | 'slow' = 'normal'): Layer {
295
- const presetMap = {
296
- fast: 'animated-fast' as LayerPreset,
297
- normal: 'animated' as LayerPreset,
298
- slow: 'animated-slow' as LayerPreset
299
- };
300
-
301
- return new Layer(id, { preset: presetMap[speed] })
302
- .fullCover()
303
- .zIndex(-1);
304
- }
@@ -1,41 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- export interface LinkOptions {
3
- href?: string;
4
- text?: string;
5
- icon?: string;
6
- iconPosition?: 'left' | 'right';
7
- target?: '_self' | '_blank' | '_parent' | '_top';
8
- external?: boolean;
9
- active?: boolean;
10
- disabled?: boolean;
11
- style?: string;
12
- class?: string;
13
- }
14
- interface LinkState extends BaseState {
15
- href: string;
16
- text: string;
17
- icon: string;
18
- iconPosition: 'left' | 'right';
19
- target: string;
20
- external: boolean;
21
- active: boolean;
22
- }
23
- export declare class Link extends BaseComponent<LinkState> {
24
- constructor(id: string, options?: LinkOptions);
25
- protected getTriggerEvents(): readonly string[];
26
- protected getCallbackEvents(): readonly string[];
27
- href(value: string): this;
28
- text(value: string): this;
29
- icon(value: string): this;
30
- iconPosition(value: 'left' | 'right'): this;
31
- target(value: '_self' | '_blank' | '_parent' | '_top'): this;
32
- external(value?: boolean): this;
33
- active(value?: boolean): this;
34
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
35
- update(prop: string, value: any): void;
36
- }
37
- export declare function link(id: string, options?: LinkOptions): Link;
38
- export declare function navLink(id: string, text?: string): Link;
39
- export declare function externalLink(id: string, href: string, text?: string): Link;
40
- export {};
41
- //# sourceMappingURL=link.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAQnE,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,SAAU,SAAQ,SAAS;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,IAAK,SAAQ,aAAa,CAAC,SAAS,CAAC;gBAClC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;IAkBjD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAQhD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IASzB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAYzB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAK3C,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI;IAS5D,QAAQ,CAAC,KAAK,GAAE,OAAc,GAAG,IAAI;IAQrC,MAAM,CAAC,KAAK,GAAE,OAAc,GAAG,IAAI;IAanC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAyFlE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAiCzC;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CAEhE;AAGD,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAKvD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAQ1E"}