juxscript 1.1.240 → 1.1.244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/index.js +7 -137
  2. package/lib/components/dataframe.ts +0 -569
  3. package/lib/components/include.ts +229 -229
  4. package/lib/components/tag.ts +68 -0
  5. package/lib/styles/shadcn.css +17 -5
  6. package/lib/utils/idgen.ts +6 -0
  7. package/package.json +5 -6
  8. package/index.d.ts +0 -239
  9. package/index.d.ts.map +0 -1
  10. package/lib/components/alert.d.ts +0 -36
  11. package/lib/components/alert.d.ts.map +0 -1
  12. package/lib/components/alert.js +0 -172
  13. package/lib/components/alert.ts +0 -219
  14. package/lib/components/app.d.ts +0 -89
  15. package/lib/components/app.d.ts.map +0 -1
  16. package/lib/components/app.js +0 -175
  17. package/lib/components/app.ts +0 -247
  18. package/lib/components/badge.d.ts +0 -26
  19. package/lib/components/badge.d.ts.map +0 -1
  20. package/lib/components/badge.js +0 -91
  21. package/lib/components/badge.ts +0 -118
  22. package/lib/components/base/Animations.d.ts +0 -36
  23. package/lib/components/base/Animations.d.ts.map +0 -1
  24. package/lib/components/base/Animations.js +0 -70
  25. package/lib/components/base/Animations.ts +0 -112
  26. package/lib/components/base/BaseComponent.d.ts +0 -294
  27. package/lib/components/base/BaseComponent.d.ts.map +0 -1
  28. package/lib/components/base/BaseComponent.js +0 -735
  29. package/lib/components/base/BaseComponent.ts +0 -884
  30. package/lib/components/base/FormInput.d.ts +0 -77
  31. package/lib/components/base/FormInput.d.ts.map +0 -1
  32. package/lib/components/base/FormInput.js +0 -171
  33. package/lib/components/base/FormInput.ts +0 -237
  34. package/lib/components/blueprint.d.ts +0 -40
  35. package/lib/components/blueprint.d.ts.map +0 -1
  36. package/lib/components/blueprint.js +0 -327
  37. package/lib/components/button.d.ts +0 -70
  38. package/lib/components/button.d.ts.map +0 -1
  39. package/lib/components/button.js +0 -177
  40. package/lib/components/button.ts +0 -237
  41. package/lib/components/card.d.ts +0 -35
  42. package/lib/components/card.d.ts.map +0 -1
  43. package/lib/components/card.js +0 -130
  44. package/lib/components/card.ts +0 -177
  45. package/lib/components/chart.d.ts +0 -49
  46. package/lib/components/chart.d.ts.map +0 -1
  47. package/lib/components/chart.js +0 -205
  48. package/lib/components/chart.ts +0 -254
  49. package/lib/components/checkbox.d.ts +0 -33
  50. package/lib/components/checkbox.d.ts.map +0 -1
  51. package/lib/components/checkbox.js +0 -202
  52. package/lib/components/checkbox.ts +0 -260
  53. package/lib/components/code.d.ts +0 -52
  54. package/lib/components/code.d.ts.map +0 -1
  55. package/lib/components/code.js +0 -201
  56. package/lib/components/code.ts +0 -260
  57. package/lib/components/container.d.ts +0 -60
  58. package/lib/components/container.d.ts.map +0 -1
  59. package/lib/components/container.js +0 -195
  60. package/lib/components/container.ts +0 -259
  61. package/lib/components/data.d.ts +0 -36
  62. package/lib/components/data.d.ts.map +0 -1
  63. package/lib/components/data.js +0 -110
  64. package/lib/components/data.ts +0 -135
  65. package/lib/components/dataframe/DataFrameSource.d.ts +0 -118
  66. package/lib/components/dataframe/DataFrameSource.d.ts.map +0 -1
  67. package/lib/components/dataframe/DataFrameSource.js +0 -421
  68. package/lib/components/dataframe/DataFrameSource.ts +0 -532
  69. package/lib/components/dataframe/ImportSettingsModal.d.ts +0 -60
  70. package/lib/components/dataframe/ImportSettingsModal.d.ts.map +0 -1
  71. package/lib/components/dataframe/ImportSettingsModal.js +0 -442
  72. package/lib/components/dataframe/ImportSettingsModal.ts +0 -531
  73. package/lib/components/dataframe.d.ts +0 -110
  74. package/lib/components/dataframe.d.ts.map +0 -1
  75. package/lib/components/dataframe.js +0 -470
  76. package/lib/components/datepicker.d.ts +0 -40
  77. package/lib/components/datepicker.d.ts.map +0 -1
  78. package/lib/components/datepicker.js +0 -193
  79. package/lib/components/datepicker.ts +0 -251
  80. package/lib/components/dialog.d.ts +0 -39
  81. package/lib/components/dialog.d.ts.map +0 -1
  82. package/lib/components/dialog.js +0 -131
  83. package/lib/components/dialog.ts +0 -178
  84. package/lib/components/divider.d.ts +0 -31
  85. package/lib/components/divider.d.ts.map +0 -1
  86. package/lib/components/divider.js +0 -72
  87. package/lib/components/divider.ts +0 -104
  88. package/lib/components/dropdown-menu.d.ts +0 -42
  89. package/lib/components/dropdown-menu.d.ts.map +0 -1
  90. package/lib/components/dropdown-menu.js +0 -177
  91. package/lib/components/dropdown-menu.ts +0 -214
  92. package/lib/components/dropdown.d.ts +0 -41
  93. package/lib/components/dropdown.d.ts.map +0 -1
  94. package/lib/components/dropdown.js +0 -136
  95. package/lib/components/dropdown.ts +0 -188
  96. package/lib/components/element.d.ts +0 -51
  97. package/lib/components/element.d.ts.map +0 -1
  98. package/lib/components/element.js +0 -209
  99. package/lib/components/element.ts +0 -271
  100. package/lib/components/event-chain.d.ts +0 -9
  101. package/lib/components/event-chain.d.ts.map +0 -1
  102. package/lib/components/event-chain.js +0 -33
  103. package/lib/components/fileupload.d.ts +0 -98
  104. package/lib/components/fileupload.d.ts.map +0 -1
  105. package/lib/components/fileupload.js +0 -351
  106. package/lib/components/fileupload.ts +0 -449
  107. package/lib/components/grid.d.ts +0 -88
  108. package/lib/components/grid.d.ts.map +0 -1
  109. package/lib/components/grid.js +0 -208
  110. package/lib/components/grid.ts +0 -295
  111. package/lib/components/heading.d.ts +0 -25
  112. package/lib/components/heading.d.ts.map +0 -1
  113. package/lib/components/heading.js +0 -83
  114. package/lib/components/heading.ts +0 -113
  115. package/lib/components/helpers.d.ts +0 -9
  116. package/lib/components/helpers.d.ts.map +0 -1
  117. package/lib/components/helpers.js +0 -30
  118. package/lib/components/helpers.ts +0 -41
  119. package/lib/components/hero.d.ts +0 -60
  120. package/lib/components/hero.d.ts.map +0 -1
  121. package/lib/components/hero.js +0 -239
  122. package/lib/components/hero.ts +0 -302
  123. package/lib/components/history/StateHistory.d.ts +0 -91
  124. package/lib/components/history/StateHistory.d.ts.map +0 -1
  125. package/lib/components/history/StateHistory.js +0 -154
  126. package/lib/components/history/StateHistory.ts +0 -200
  127. package/lib/components/icon.d.ts +0 -36
  128. package/lib/components/icon.d.ts.map +0 -1
  129. package/lib/components/icon.js +0 -135
  130. package/lib/components/icon.ts +0 -182
  131. package/lib/components/icons.d.ts +0 -25
  132. package/lib/components/icons.d.ts.map +0 -1
  133. package/lib/components/icons.js +0 -440
  134. package/lib/components/icons.ts +0 -464
  135. package/lib/components/image.d.ts +0 -42
  136. package/lib/components/image.d.ts.map +0 -1
  137. package/lib/components/image.js +0 -204
  138. package/lib/components/image.ts +0 -260
  139. package/lib/components/include.d.ts +0 -86
  140. package/lib/components/include.d.ts.map +0 -1
  141. package/lib/components/include.js +0 -238
  142. package/lib/components/input.d.ts +0 -85
  143. package/lib/components/input.d.ts.map +0 -1
  144. package/lib/components/input.js +0 -362
  145. package/lib/components/input.ts +0 -473
  146. package/lib/components/layer.d.ts +0 -72
  147. package/lib/components/layer.d.ts.map +0 -1
  148. package/lib/components/layer.js +0 -219
  149. package/lib/components/layer.ts +0 -304
  150. package/lib/components/link.d.ts +0 -41
  151. package/lib/components/link.d.ts.map +0 -1
  152. package/lib/components/link.js +0 -216
  153. package/lib/components/link.ts +0 -268
  154. package/lib/components/list.d.ts +0 -83
  155. package/lib/components/list.d.ts.map +0 -1
  156. package/lib/components/list.js +0 -314
  157. package/lib/components/list.ts +0 -423
  158. package/lib/components/loading.d.ts +0 -25
  159. package/lib/components/loading.d.ts.map +0 -1
  160. package/lib/components/loading.js +0 -76
  161. package/lib/components/loading.ts +0 -104
  162. package/lib/components/menu.d.ts +0 -38
  163. package/lib/components/menu.d.ts.map +0 -1
  164. package/lib/components/menu.js +0 -205
  165. package/lib/components/menu.ts +0 -279
  166. package/lib/components/modal.d.ts +0 -97
  167. package/lib/components/modal.d.ts.map +0 -1
  168. package/lib/components/modal.js +0 -463
  169. package/lib/components/modal.ts +0 -576
  170. package/lib/components/nav.d.ts +0 -46
  171. package/lib/components/nav.d.ts.map +0 -1
  172. package/lib/components/nav.js +0 -193
  173. package/lib/components/nav.ts +0 -261
  174. package/lib/components/paragraph.d.ts +0 -30
  175. package/lib/components/paragraph.d.ts.map +0 -1
  176. package/lib/components/paragraph.js +0 -93
  177. package/lib/components/paragraph.ts +0 -123
  178. package/lib/components/pen.d.ts +0 -125
  179. package/lib/components/pen.d.ts.map +0 -1
  180. package/lib/components/pen.js +0 -443
  181. package/lib/components/pen.ts +0 -567
  182. package/lib/components/progress.d.ts +0 -40
  183. package/lib/components/progress.d.ts.map +0 -1
  184. package/lib/components/progress.js +0 -116
  185. package/lib/components/progress.ts +0 -163
  186. package/lib/components/radio.d.ts +0 -43
  187. package/lib/components/radio.d.ts.map +0 -1
  188. package/lib/components/radio.js +0 -226
  189. package/lib/components/radio.ts +0 -303
  190. package/lib/components/registry.d.ts +0 -34
  191. package/lib/components/registry.d.ts.map +0 -1
  192. package/lib/components/registry.js +0 -163
  193. package/lib/components/registry.ts +0 -193
  194. package/lib/components/req.d.ts +0 -155
  195. package/lib/components/req.d.ts.map +0 -1
  196. package/lib/components/req.js +0 -253
  197. package/lib/components/req.ts +0 -303
  198. package/lib/components/script.d.ts +0 -14
  199. package/lib/components/script.d.ts.map +0 -1
  200. package/lib/components/script.js +0 -33
  201. package/lib/components/script.ts +0 -41
  202. package/lib/components/select.d.ts +0 -42
  203. package/lib/components/select.d.ts.map +0 -1
  204. package/lib/components/select.js +0 -209
  205. package/lib/components/select.ts +0 -281
  206. package/lib/components/sidebar.d.ts +0 -59
  207. package/lib/components/sidebar.d.ts.map +0 -1
  208. package/lib/components/sidebar.js +0 -298
  209. package/lib/components/sidebar.ts +0 -395
  210. package/lib/components/stack/BaseStack.d.ts +0 -65
  211. package/lib/components/stack/BaseStack.d.ts.map +0 -1
  212. package/lib/components/stack/BaseStack.js +0 -274
  213. package/lib/components/stack/BaseStack.ts +0 -328
  214. package/lib/components/stack/HStack.d.ts +0 -18
  215. package/lib/components/stack/HStack.d.ts.map +0 -1
  216. package/lib/components/stack/HStack.js +0 -22
  217. package/lib/components/stack/HStack.ts +0 -25
  218. package/lib/components/stack/VStack.d.ts +0 -19
  219. package/lib/components/stack/VStack.d.ts.map +0 -1
  220. package/lib/components/stack/VStack.js +0 -23
  221. package/lib/components/stack/VStack.ts +0 -26
  222. package/lib/components/stack/ZStack.d.ts +0 -18
  223. package/lib/components/stack/ZStack.d.ts.map +0 -1
  224. package/lib/components/stack/ZStack.js +0 -22
  225. package/lib/components/stack/ZStack.ts +0 -25
  226. package/lib/components/style.d.ts +0 -14
  227. package/lib/components/style.d.ts.map +0 -1
  228. package/lib/components/style.js +0 -33
  229. package/lib/components/style.ts +0 -41
  230. package/lib/components/switch.d.ts +0 -34
  231. package/lib/components/switch.d.ts.map +0 -1
  232. package/lib/components/switch.js +0 -209
  233. package/lib/components/switch.ts +0 -272
  234. package/lib/components/table.d.ts +0 -137
  235. package/lib/components/table.d.ts.map +0 -1
  236. package/lib/components/table.js +0 -1019
  237. package/lib/components/table.ts +0 -1225
  238. package/lib/components/tabs.d.ts +0 -53
  239. package/lib/components/tabs.d.ts.map +0 -1
  240. package/lib/components/tabs.js +0 -275
  241. package/lib/components/tabs.ts +0 -349
  242. package/lib/components/theme-toggle.d.ts +0 -45
  243. package/lib/components/theme-toggle.d.ts.map +0 -1
  244. package/lib/components/theme-toggle.js +0 -218
  245. package/lib/components/theme-toggle.ts +0 -297
  246. package/lib/components/tooltip.d.ts +0 -31
  247. package/lib/components/tooltip.d.ts.map +0 -1
  248. package/lib/components/tooltip.js +0 -112
  249. package/lib/components/tooltip.ts +0 -148
  250. package/lib/components/watcher.d.ts +0 -195
  251. package/lib/components/watcher.d.ts.map +0 -1
  252. package/lib/components/watcher.js +0 -241
  253. package/lib/components/watcher.ts +0 -261
  254. package/lib/components/write.d.ts +0 -107
  255. package/lib/components/write.d.ts.map +0 -1
  256. package/lib/components/write.js +0 -222
  257. package/lib/components/write.ts +0 -272
  258. package/lib/data/DataPipeline.d.ts +0 -113
  259. package/lib/data/DataPipeline.d.ts.map +0 -1
  260. package/lib/data/DataPipeline.js +0 -359
  261. package/lib/data/DataPipeline.ts +0 -452
  262. package/lib/facades/dataframe.jux +0 -0
  263. package/lib/globals.d.ts +0 -21
  264. package/lib/reactivity/state.d.ts +0 -36
  265. package/lib/reactivity/state.d.ts.map +0 -1
  266. package/lib/reactivity/state.js +0 -67
  267. package/lib/reactivity/state.ts +0 -78
  268. package/lib/storage/DataFrame.d.ts +0 -284
  269. package/lib/storage/DataFrame.d.ts.map +0 -1
  270. package/lib/storage/DataFrame.js +0 -1022
  271. package/lib/storage/DataFrame.ts +0 -1195
  272. package/lib/storage/DataFrameSource.d.ts +0 -158
  273. package/lib/storage/DataFrameSource.d.ts.map +0 -1
  274. package/lib/storage/DataFrameSource.js +0 -409
  275. package/lib/storage/DataFrameSource.ts +0 -556
  276. package/lib/storage/FileStorage.d.ts +0 -53
  277. package/lib/storage/FileStorage.d.ts.map +0 -1
  278. package/lib/storage/FileStorage.js +0 -80
  279. package/lib/storage/FileStorage.ts +0 -95
  280. package/lib/storage/IndexedDBDriver.d.ts +0 -75
  281. package/lib/storage/IndexedDBDriver.d.ts.map +0 -1
  282. package/lib/storage/IndexedDBDriver.js +0 -177
  283. package/lib/storage/IndexedDBDriver.ts +0 -226
  284. package/lib/storage/TabularDriver.d.ts +0 -118
  285. package/lib/storage/TabularDriver.d.ts.map +0 -1
  286. package/lib/storage/TabularDriver.js +0 -731
  287. package/lib/storage/TabularDriver.ts +0 -874
  288. package/lib/utils/codeparser.d.ts +0 -29
  289. package/lib/utils/codeparser.d.ts.map +0 -1
  290. package/lib/utils/codeparser.js +0 -409
  291. package/lib/utils/fetch.d.ts +0 -176
  292. package/lib/utils/fetch.d.ts.map +0 -1
  293. package/lib/utils/fetch.js +0 -427
  294. package/lib/utils/formatId.d.ts +0 -16
  295. package/lib/utils/formatId.d.ts.map +0 -1
  296. package/lib/utils/formatId.js +0 -27
  297. package/lib/utils/path-resolver.js +0 -23
@@ -1,247 +0,0 @@
1
-
2
-
3
- /**
4
- * App component options
5
- */
6
- export interface AppOptions {
7
- title?: string;
8
- theme?: 'light' | 'dark' | 'auto';
9
- favicon?: string;
10
- meta?: Record<string, string>;
11
- stylesheets?: string[];
12
- scripts?: string[];
13
- layout?: {
14
- header?: boolean | string;
15
- subheader?: boolean | string;
16
- sidebar?: boolean | string;
17
- main?: boolean | string;
18
- aside?: boolean | string;
19
- footer?: boolean | string;
20
- };
21
- }
22
-
23
- /**
24
- * App component state
25
- */
26
- type AppState = {
27
- title: string;
28
- theme: string;
29
- favicon: string;
30
- meta: Map<string, string>;
31
- stylesheets: string[];
32
- scripts: string[];
33
- layout: {
34
- header: boolean | string;
35
- subheader: boolean | string;
36
- sidebar: boolean | string;
37
- main: boolean | string;
38
- aside: boolean | string;
39
- footer: boolean | string;
40
- };
41
- };
42
-
43
- /**
44
- * App - Configure application-level settings
45
- * Manages document metadata, theme, and global configuration
46
- *
47
- * Usage:
48
- * jux.app('myApp').setup({
49
- * title: 'My App',
50
- * theme: 'dark',
51
- * favicon: '/favicon.ico',
52
- * stylesheets: [
53
- * '/lib/layouts/notion.css',
54
- * '/lib/presets/light.css'
55
- * ],
56
- * layout: {
57
- * header: true,
58
- * sidebar: true,
59
- * main: true,
60
- * footer: true
61
- * }
62
- * });
63
- *
64
- * // Or fluent
65
- * jux.app('myApp')
66
- * .title('My App')
67
- * .theme('dark')
68
- * .addStylesheet('/presets/main.css')
69
- * .render();
70
- */
71
- export class App {
72
- state: AppState;
73
- _componentId: string;
74
- id: string;
75
-
76
- constructor(id: string, options?: AppOptions) {
77
- this._componentId = id;
78
- this.id = id;
79
-
80
- const opts = options || {};
81
-
82
- this.state = {
83
- title: opts.title ?? '',
84
- theme: opts.theme ?? 'auto',
85
- favicon: opts.favicon ?? '',
86
- meta: new Map(Object.entries(opts.meta || {})),
87
- stylesheets: opts.stylesheets || [],
88
- scripts: opts.scripts || [],
89
- layout: {
90
- header: opts.layout?.header ?? false,
91
- subheader: opts.layout?.subheader ?? false,
92
- sidebar: opts.layout?.sidebar ?? false,
93
- main: opts.layout?.main ?? true,
94
- aside: opts.layout?.aside ?? false,
95
- footer: opts.layout?.footer ?? false
96
- }
97
- };
98
- }
99
-
100
- /* -------------------------
101
- * Fluent API
102
- * ------------------------- */
103
-
104
- title(value: string): this {
105
- this.state.title = value;
106
- return this;
107
- }
108
-
109
- theme(value: 'light' | 'dark' | 'auto'): this {
110
- this.state.theme = value;
111
- return this;
112
- }
113
-
114
- favicon(value: string): this {
115
- this.state.favicon = value;
116
- return this;
117
- }
118
-
119
- meta(name: string, content: string): this {
120
- this.state.meta.set(name, content);
121
- return this;
122
- }
123
-
124
- addStylesheet(url: string): this {
125
- if (!this.state.stylesheets.includes(url)) {
126
- this.state.stylesheets.push(url);
127
- }
128
- return this;
129
- }
130
-
131
- addScript(url: string): this {
132
- if (!this.state.scripts.includes(url)) {
133
- this.state.scripts.push(url);
134
- }
135
- return this;
136
- }
137
-
138
- /**
139
- * Setup app with comprehensive configuration
140
- */
141
- setup(options: AppOptions): this {
142
- if (options.title) this.state.title = options.title;
143
- if (options.theme) this.state.theme = options.theme;
144
- if (options.favicon) this.state.favicon = options.favicon;
145
-
146
- if (options.meta) {
147
- Object.entries(options.meta).forEach(([name, content]) => {
148
- this.state.meta.set(name, content);
149
- });
150
- }
151
-
152
- if (options.stylesheets) {
153
- options.stylesheets.forEach(url => this.addStylesheet(url));
154
- }
155
-
156
- if (options.scripts) {
157
- options.scripts.forEach(url => this.addScript(url));
158
- }
159
-
160
- if (options.layout) {
161
- this.state.layout = { ...this.state.layout, ...options.layout };
162
- }
163
-
164
- return this;
165
- }
166
-
167
- /* -------------------------
168
- * Render
169
- * ------------------------- */
170
-
171
- render(): this {
172
- if (typeof document === 'undefined') return this;
173
-
174
- try {
175
- const { title, theme, favicon, meta, stylesheets, scripts } = this.state;
176
-
177
- // Apply title
178
- if (title) {
179
- document.title = title;
180
- }
181
-
182
- // Apply theme
183
- if (theme) {
184
- document.body.setAttribute('data-theme', theme);
185
- document.body.classList.remove('theme-light', 'theme-dark', 'theme-auto');
186
- document.body.classList.add(`theme-${theme}`);
187
- }
188
-
189
- // Apply favicon
190
- if (favicon) {
191
- let link = document.querySelector<HTMLLinkElement>('link[rel="icon"]');
192
-
193
- if (!link) {
194
- link = document.createElement('link');
195
- link.rel = 'icon';
196
- document.head.appendChild(link);
197
- }
198
-
199
- link.href = favicon;
200
- }
201
-
202
- // Apply meta tags
203
- meta.forEach((content, name) => {
204
- let metaEl = document.querySelector<HTMLMetaElement>(`meta[name="${name}"]`);
205
-
206
- if (!metaEl) {
207
- metaEl = document.createElement('meta');
208
- metaEl.name = name;
209
- document.head.appendChild(metaEl);
210
- }
211
-
212
- metaEl.content = content;
213
- });
214
-
215
- // Load stylesheets
216
- stylesheets.forEach(url => {
217
- if (!document.querySelector(`link[href="${url}"]`)) {
218
- const link = document.createElement('link');
219
- link.rel = 'stylesheet';
220
- link.href = url;
221
- document.head.appendChild(link);
222
- }
223
- });
224
-
225
- // Load scripts
226
- scripts.forEach(url => {
227
- if (!document.querySelector(`script[src="${url}"]`)) {
228
- const script = document.createElement('script');
229
- script.src = url;
230
- document.head.appendChild(script);
231
- }
232
- });
233
-
234
- } catch (error: any) {
235
- throw new Error(`App render failed: ${error.message}`);
236
- }
237
-
238
- return this;
239
- }
240
- }
241
-
242
- /**
243
- * Factory helper
244
- */
245
- export function app(id: string, options?: AppOptions): App {
246
- return new App(id, options);
247
- }
@@ -1,26 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- export interface BadgeOptions {
3
- label?: string;
4
- variant?: 'default' | 'success' | 'warning' | 'error' | 'info';
5
- pill?: boolean;
6
- style?: string;
7
- class?: string;
8
- }
9
- type BadgeState = BaseState & {
10
- label: string;
11
- variant: string;
12
- pill: boolean;
13
- };
14
- export declare class Badge extends BaseComponent<BadgeState> {
15
- constructor(id: string, options?: BadgeOptions);
16
- protected getTriggerEvents(): readonly string[];
17
- protected getCallbackEvents(): readonly string[];
18
- update(prop: string, value: any): void;
19
- label(value: string): this;
20
- variant(value: 'default' | 'success' | 'warning' | 'error' | 'info'): this;
21
- pill(value: boolean): this;
22
- render(targetId?: string | HTMLElement | BaseComponent<any>): this;
23
- }
24
- export declare function badge(id: string, options?: BadgeOptions): Badge;
25
- export {};
26
- //# sourceMappingURL=badge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAOnE,MAAM,WAAW,YAAY;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,UAAU,GAAG,SAAS,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAAU,CAAC;gBACpC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;IAUlD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAIhD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAwBtC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI;IAK1E,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAS1B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CA8BrE;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAEnE"}
@@ -1,91 +0,0 @@
1
- import { BaseComponent } from './base/BaseComponent.js';
2
- import { formatIdAsLabel } from '../utils/formatId.js'; // ✅ Import
3
- // Event definitions
4
- const TRIGGER_EVENTS = [];
5
- const CALLBACK_EVENTS = [];
6
- export class Badge extends BaseComponent {
7
- constructor(id, options = {}) {
8
- super(id, {
9
- label: options.label ?? formatIdAsLabel(id), // ✅ Auto-generate from ID
10
- variant: options.variant ?? 'default',
11
- pill: options.pill ?? false,
12
- style: options.style ?? '',
13
- class: options.class ?? ''
14
- });
15
- }
16
- getTriggerEvents() {
17
- return TRIGGER_EVENTS;
18
- }
19
- getCallbackEvents() {
20
- return CALLBACK_EVENTS;
21
- }
22
- update(prop, value) {
23
- const el = document.getElementById(this._id);
24
- if (!el)
25
- return;
26
- // ✅ Component-specific updates
27
- if (prop === 'label') {
28
- el.textContent = value;
29
- }
30
- else if (prop === 'variant') {
31
- const baseClass = 'jux-badge';
32
- el.className = `${baseClass} ${baseClass}-${value}`;
33
- if (this.state.pill)
34
- el.classList.add('jux-badge-pill');
35
- if (this.state.class)
36
- el.className += ` ${this.state.class}`;
37
- }
38
- else if (prop === 'pill') {
39
- el.classList.toggle('jux-badge-pill', value);
40
- }
41
- }
42
- /* ═════════════════════════════════════════════════════════════════
43
- * FLUENT API
44
- * ═════════════════════════════════════════════════════════════════ */
45
- // ✅ Inherited from BaseComponent
46
- label(value) {
47
- this.state.label = value;
48
- return this;
49
- }
50
- variant(value) {
51
- this.state.variant = value;
52
- return this;
53
- }
54
- pill(value) {
55
- this.state.pill = value;
56
- return this;
57
- }
58
- /* ═════════════════════════════════════════════════════════════════
59
- * RENDER
60
- * ═════════════════════════════════════════════════════════════════ */
61
- render(targetId) {
62
- const container = this._setupContainer(targetId);
63
- const { label, variant, pill, style, class: className } = this.state;
64
- const badge = document.createElement('span');
65
- badge.className = `jux-badge jux-badge-${variant}`;
66
- if (pill)
67
- badge.classList.add('jux-badge-pill');
68
- badge.id = this._id;
69
- if (className)
70
- badge.className += ` ${className}`;
71
- if (style)
72
- badge.setAttribute('style', style);
73
- badge.textContent = label;
74
- this._wireStandardEvents(badge);
75
- // Wire sync for label
76
- this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
77
- if (property === 'label') {
78
- const transform = toComponent || ((v) => String(v));
79
- stateObj.subscribe((val) => {
80
- badge.textContent = transform(val);
81
- this.state.label = transform(val);
82
- });
83
- }
84
- });
85
- container.appendChild(badge);
86
- return this;
87
- }
88
- }
89
- export function badge(id, options = {}) {
90
- return new Badge(id, options);
91
- }
@@ -1,118 +0,0 @@
1
- import { BaseComponent, BaseState } from './base/BaseComponent.js';
2
- import { formatIdAsLabel } from '../utils/formatId.js'; // ✅ Import
3
-
4
- // Event definitions
5
- const TRIGGER_EVENTS = [] as const;
6
- const CALLBACK_EVENTS = [] as const;
7
-
8
- export interface BadgeOptions {
9
- label?: string;
10
- variant?: 'default' | 'success' | 'warning' | 'error' | 'info';
11
- pill?: boolean;
12
- style?: string;
13
- class?: string;
14
- }
15
-
16
- type BadgeState = BaseState & {
17
- label: string;
18
- variant: string;
19
- pill: boolean;
20
- };
21
-
22
- export class Badge extends BaseComponent<BadgeState> {
23
- constructor(id: string, options: BadgeOptions = {}) {
24
- super(id, {
25
- label: options.label ?? formatIdAsLabel(id), // ✅ Auto-generate from ID
26
- variant: options.variant ?? 'default',
27
- pill: options.pill ?? false,
28
- style: options.style ?? '',
29
- class: options.class ?? ''
30
- });
31
- }
32
-
33
- protected getTriggerEvents(): readonly string[] {
34
- return TRIGGER_EVENTS;
35
- }
36
-
37
- protected getCallbackEvents(): readonly string[] {
38
- return CALLBACK_EVENTS;
39
- }
40
-
41
- update(prop: string, value: any): void {
42
-
43
- const el = document.getElementById(this._id);
44
- if (!el) return;
45
-
46
- // ✅ Component-specific updates
47
- if (prop === 'label') {
48
- el.textContent = value;
49
- } else if (prop === 'variant') {
50
- const baseClass = 'jux-badge';
51
- el.className = `${baseClass} ${baseClass}-${value}`;
52
- if (this.state.pill) el.classList.add('jux-badge-pill');
53
- if (this.state.class) el.className += ` ${this.state.class}`;
54
- } else if (prop === 'pill') {
55
- el.classList.toggle('jux-badge-pill', value);
56
- }
57
- }
58
-
59
- /* ═════════════════════════════════════════════════════════════════
60
- * FLUENT API
61
- * ═════════════════════════════════════════════════════════════════ */
62
-
63
- // ✅ Inherited from BaseComponent
64
-
65
- label(value: string): this {
66
- this.state.label = value;
67
- return this;
68
- }
69
-
70
- variant(value: 'default' | 'success' | 'warning' | 'error' | 'info'): this {
71
- this.state.variant = value;
72
- return this;
73
- }
74
-
75
- pill(value: boolean): this {
76
- this.state.pill = value;
77
- return this;
78
- }
79
-
80
- /* ═════════════════════════════════════════════════════════════════
81
- * RENDER
82
- * ═════════════════════════════════════════════════════════════════ */
83
-
84
- render(targetId?: string | HTMLElement | BaseComponent<any>): this {
85
- const container = this._setupContainer(targetId);
86
-
87
- const { label, variant, pill, style, class: className } = this.state;
88
-
89
- const badge = document.createElement('span');
90
- badge.className = `jux-badge jux-badge-${variant}`;
91
- if (pill) badge.classList.add('jux-badge-pill');
92
- badge.id = this._id;
93
- if (className) badge.className += ` ${className}`;
94
- if (style) badge.setAttribute('style', style);
95
- badge.textContent = label;
96
-
97
- this._wireStandardEvents(badge);
98
-
99
- // Wire sync for label
100
- this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
101
- if (property === 'label') {
102
- const transform = toComponent || ((v: any) => String(v));
103
- stateObj.subscribe((val: any) => {
104
- badge.textContent = transform(val);
105
- this.state.label = transform(val);
106
- });
107
- }
108
- });
109
-
110
- container.appendChild(badge);
111
-
112
- return this;
113
- }
114
- }
115
-
116
- export function badge(id: string, options: BadgeOptions = {}): Badge {
117
- return new Badge(id, options);
118
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * Animation Modifiers Extension
3
- *
4
- * Provides animation and transition control for all components.
5
- * This is the ONLY feature-oriented modifier we use at this phase.
6
- *
7
- * Automatically applied to BaseComponent - all components have these methods.
8
- */
9
- import type { BaseComponent } from './BaseComponent.js';
10
- export interface Animations {
11
- transform(value: string): this;
12
- transformOrigin(value: string): this;
13
- rotate(degrees: number): this;
14
- rotateX(degrees: number): this;
15
- rotateY(degrees: number): this;
16
- rotateZ(degrees: number): this;
17
- scale(value: number): this;
18
- scaleX(value: number): this;
19
- scaleY(value: number): this;
20
- translateX(value: string): this;
21
- translateY(value: string): this;
22
- translate(x: string, y: string): this;
23
- flipX(): this;
24
- flipY(): this;
25
- flipBoth(): this;
26
- transition(value: string): this;
27
- transitionDuration(value: string): this;
28
- transitionDelay(value: string): this;
29
- animation(value: string): this;
30
- }
31
- /**
32
- * Apply animation extensions to a component instance
33
- * Called automatically in BaseComponent constructor
34
- */
35
- export declare function applyAnimations<T extends BaseComponent<any>>(component: T): T & Animations;
36
- //# sourceMappingURL=Animations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Animations.d.ts","sourceRoot":"","sources":["Animations.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,UAAU;IAEvB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,IAAI,IAAI,CAAC;IAGjB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAsCD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,UAAU,CAmC1F"}
@@ -1,70 +0,0 @@
1
- /**
2
- * Animation Modifiers Extension
3
- *
4
- * Provides animation and transition control for all components.
5
- * This is the ONLY feature-oriented modifier we use at this phase.
6
- *
7
- * Automatically applied to BaseComponent - all components have these methods.
8
- */
9
- /**
10
- * Helper to add inline style
11
- */
12
- function addInlineStyle(component, property, value) {
13
- const currentStyle = component.state.style || '';
14
- // Parse existing styles into a map
15
- const styleMap = new Map();
16
- currentStyle.split(';').forEach((style) => {
17
- const trimmed = style.trim();
18
- if (!trimmed)
19
- return;
20
- const colonIndex = trimmed.indexOf(':');
21
- if (colonIndex === -1)
22
- return;
23
- const prop = trimmed.substring(0, colonIndex).trim();
24
- const val = trimmed.substring(colonIndex + 1).trim();
25
- if (prop && val) {
26
- styleMap.set(prop, val);
27
- }
28
- });
29
- // Update or add the new property
30
- styleMap.set(property, value);
31
- // Rebuild style string
32
- const styles = [];
33
- styleMap.forEach((val, prop) => {
34
- styles.push(`${prop}: ${val}`);
35
- });
36
- component.state.style = styles.join('; ');
37
- }
38
- /**
39
- * Apply animation extensions to a component instance
40
- * Called automatically in BaseComponent constructor
41
- */
42
- export function applyAnimations(component) {
43
- const ext = component;
44
- // Transform
45
- ext.transform = (v) => { addInlineStyle(component, 'transform', v); return ext; };
46
- ext.transformOrigin = (v) => { addInlineStyle(component, 'transform-origin', v); return ext; };
47
- // Rotation (all axes)
48
- ext.rotate = (deg) => { addInlineStyle(component, 'transform', `rotate(${deg}deg)`); return ext; };
49
- ext.rotateX = (deg) => { addInlineStyle(component, 'transform', `rotateX(${deg}deg)`); return ext; };
50
- ext.rotateY = (deg) => { addInlineStyle(component, 'transform', `rotateY(${deg}deg)`); return ext; };
51
- ext.rotateZ = (deg) => { addInlineStyle(component, 'transform', `rotateZ(${deg}deg)`); return ext; };
52
- // Scale (all axes)
53
- ext.scale = (v) => { addInlineStyle(component, 'transform', `scale(${v})`); return ext; };
54
- ext.scaleX = (v) => { addInlineStyle(component, 'transform', `scaleX(${v})`); return ext; };
55
- ext.scaleY = (v) => { addInlineStyle(component, 'transform', `scaleY(${v})`); return ext; };
56
- // Translate
57
- ext.translateX = (v) => { addInlineStyle(component, 'transform', `translateX(${v})`); return ext; };
58
- ext.translateY = (v) => { addInlineStyle(component, 'transform', `translateY(${v})`); return ext; };
59
- ext.translate = (x, y) => { addInlineStyle(component, 'transform', `translate(${x}, ${y})`); return ext; };
60
- // Flip (mirror) transforms
61
- ext.flipX = () => { addInlineStyle(component, 'transform', 'scaleX(-1)'); return ext; };
62
- ext.flipY = () => { addInlineStyle(component, 'transform', 'scaleY(-1)'); return ext; };
63
- ext.flipBoth = () => { addInlineStyle(component, 'transform', 'scale(-1, -1)'); return ext; };
64
- // Transition & Animation
65
- ext.transition = (v) => { addInlineStyle(component, 'transition', v); return ext; };
66
- ext.transitionDuration = (v) => { addInlineStyle(component, 'transition-duration', v); return ext; };
67
- ext.transitionDelay = (v) => { addInlineStyle(component, 'transition-delay', v); return ext; };
68
- ext.animation = (v) => { addInlineStyle(component, 'animation', v); return ext; };
69
- return ext;
70
- }