le-kit 0.1.11 → 0.1.13

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 (279) hide show
  1. package/custom-elements.json +1192 -1192
  2. package/dist/{core/cjs/index-D7B9TPh8.js → cjs/index-o1DRKw1g.js} +11 -4
  3. package/dist/cjs/index-o1DRKw1g.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +3 -3
  5. package/dist/cjs/le-box.cjs.entry.js +2 -2
  6. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +1 -1
  7. package/dist/cjs/le-button_6.cjs.entry.js +11 -5
  8. package/dist/cjs/le-card.cjs.entry.js +2 -2
  9. package/dist/cjs/le-kit.cjs.js +1 -1
  10. package/dist/cjs/le-number-input.cjs.entry.js +2 -2
  11. package/dist/cjs/le-popup.cjs.entry.js +1 -1
  12. package/dist/cjs/le-round-progress.cjs.entry.js +1 -1
  13. package/dist/cjs/le-stack.cjs.entry.js +2 -2
  14. package/dist/cjs/le-text.cjs.entry.js +2 -2
  15. package/dist/cjs/le-turntable.cjs.entry.js +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/{core/cjs/utils-DrsoID-a.js → cjs/utils-DqhadIxH.js} +3 -3
  18. package/dist/cjs/{utils-DrsoID-a.js.map → utils-DqhadIxH.js.map} +1 -1
  19. package/dist/collection/assets/custom-elements.json +4305 -0
  20. package/dist/collection/components/le-component/le-component.js +5 -2
  21. package/dist/collection/components/le-component/le-component.js.map +1 -1
  22. package/dist/collection/components/le-slot/le-slot.js +6 -3
  23. package/dist/collection/components/le-slot/le-slot.js.map +1 -1
  24. package/dist/collection/dist/collection/themes/base.css +89 -0
  25. package/dist/collection/dist/collection/themes/dark.css +100 -0
  26. package/dist/collection/dist/collection/themes/default.css +108 -0
  27. package/dist/collection/dist/collection/themes/gradient.css +100 -0
  28. package/dist/collection/dist/collection/themes/index.css +413 -0
  29. package/dist/collection/dist/collection/themes/minimal.css +100 -0
  30. package/dist/collection/dist/collection/themes/warm.css +100 -0
  31. package/dist/collection/global/app.js +1 -1
  32. package/dist/collection/global/app.js.map +1 -1
  33. package/dist/collection/index.js +1 -1
  34. package/dist/collection/index.js.map +1 -1
  35. package/dist/collection/themes/base.css +89 -0
  36. package/dist/collection/themes/dark.css +100 -0
  37. package/dist/collection/themes/default.css +108 -0
  38. package/dist/collection/themes/gradient.css +100 -0
  39. package/dist/collection/themes/index.css +413 -0
  40. package/dist/collection/themes/minimal.css +100 -0
  41. package/dist/collection/themes/warm.css +100 -0
  42. package/dist/components/index.d.ts +33 -0
  43. package/dist/components/index.js +113 -0
  44. package/dist/components/index.js.map +1 -0
  45. package/dist/components/le-box.d.ts +11 -0
  46. package/dist/components/le-box.js +257 -0
  47. package/dist/components/le-box.js.map +1 -0
  48. package/dist/components/le-button.d.ts +11 -0
  49. package/dist/components/le-button.js +9 -0
  50. package/dist/components/le-button.js.map +1 -0
  51. package/dist/components/le-button2.js +1149 -0
  52. package/dist/components/le-button2.js.map +1 -0
  53. package/dist/components/le-card.d.ts +11 -0
  54. package/dist/components/le-card.js +84 -0
  55. package/dist/components/le-card.js.map +1 -0
  56. package/dist/components/le-checkbox.d.ts +11 -0
  57. package/dist/components/le-checkbox.js +9 -0
  58. package/dist/components/le-checkbox.js.map +1 -0
  59. package/dist/components/le-component.d.ts +11 -0
  60. package/dist/components/le-component.js +9 -0
  61. package/dist/components/le-component.js.map +1 -0
  62. package/dist/components/le-number-input.d.ts +11 -0
  63. package/dist/components/le-number-input.js +272 -0
  64. package/dist/components/le-number-input.js.map +1 -0
  65. package/dist/components/le-popover.d.ts +11 -0
  66. package/dist/components/le-popover.js +9 -0
  67. package/dist/components/le-popover.js.map +1 -0
  68. package/dist/components/le-popover2.js +382 -0
  69. package/dist/components/le-popover2.js.map +1 -0
  70. package/dist/components/le-popup.d.ts +11 -0
  71. package/dist/components/le-popup.js +279 -0
  72. package/dist/components/le-popup.js.map +1 -0
  73. package/dist/components/le-round-progress.d.ts +11 -0
  74. package/dist/components/le-round-progress.js +135 -0
  75. package/dist/components/le-round-progress.js.map +1 -0
  76. package/dist/components/le-slot.d.ts +11 -0
  77. package/dist/components/le-slot.js +9 -0
  78. package/dist/components/le-slot.js.map +1 -0
  79. package/dist/components/le-stack.d.ts +11 -0
  80. package/dist/components/le-stack.js +199 -0
  81. package/dist/components/le-stack.js.map +1 -0
  82. package/dist/components/le-string-input.d.ts +11 -0
  83. package/dist/components/le-string-input.js +9 -0
  84. package/dist/components/le-string-input.js.map +1 -0
  85. package/dist/components/le-text.d.ts +11 -0
  86. package/dist/components/le-text.js +399 -0
  87. package/dist/components/le-text.js.map +1 -0
  88. package/dist/components/le-turntable.d.ts +11 -0
  89. package/dist/components/le-turntable.js +164 -0
  90. package/dist/components/le-turntable.js.map +1 -0
  91. package/dist/components/utils.js +310 -0
  92. package/dist/components/utils.js.map +1 -0
  93. package/dist/{cjs/index-D7B9TPh8.js → core/cjs/index-BsRb_UTe.js} +4 -4
  94. package/dist/core/cjs/index-BsRb_UTe.js.map +1 -0
  95. package/dist/core/cjs/index.cjs.js +3 -3
  96. package/dist/core/cjs/le-box.cjs.entry.js +2 -2
  97. package/dist/core/cjs/le-button.cjs.entry.js +2 -2
  98. package/dist/core/cjs/le-card.cjs.entry.js +2 -2
  99. package/dist/core/cjs/le-checkbox.cjs.entry.js +2 -2
  100. package/dist/core/cjs/le-kit.cjs.js +1 -1
  101. package/dist/core/cjs/le-number-input.cjs.entry.js +2 -2
  102. package/dist/core/cjs/le-popover.cjs.entry.js +1 -1
  103. package/dist/core/cjs/le-popup.cjs.entry.js +1 -1
  104. package/dist/core/cjs/le-round-progress.cjs.entry.js +1 -1
  105. package/dist/core/cjs/le-stack.cjs.entry.js +2 -2
  106. package/dist/core/cjs/le-string-input.cjs.entry.js +2 -2
  107. package/dist/core/cjs/le-text.cjs.entry.js +2 -2
  108. package/dist/core/cjs/le-turntable.cjs.entry.js +1 -1
  109. package/dist/core/cjs/loader.cjs.js +1 -1
  110. package/dist/{cjs/utils-DrsoID-a.js → core/cjs/utils-nsP8_w8_.js} +3 -3
  111. package/dist/core/cjs/{utils-DrsoID-a.js.map → utils-nsP8_w8_.js.map} +1 -1
  112. package/dist/core/collection/assets/custom-elements.json +4305 -0
  113. package/dist/core/collection/global/app.js +1 -1
  114. package/dist/core/collection/global/app.js.map +1 -1
  115. package/dist/core/collection/index.js +1 -1
  116. package/dist/core/collection/index.js.map +1 -1
  117. package/dist/core/collection/themes/base.css +89 -0
  118. package/dist/core/collection/themes/dark.css +100 -0
  119. package/dist/core/collection/themes/default.css +108 -0
  120. package/dist/core/collection/themes/gradient.css +100 -0
  121. package/dist/core/collection/themes/index.css +413 -0
  122. package/dist/core/collection/themes/minimal.css +100 -0
  123. package/dist/core/collection/themes/warm.css +100 -0
  124. package/dist/core/components/index.d.ts +33 -0
  125. package/dist/core/components/index.js +113 -0
  126. package/dist/core/components/index.js.map +1 -0
  127. package/dist/core/components/le-box.d.ts +11 -0
  128. package/dist/core/components/le-box.js +225 -0
  129. package/dist/core/components/le-box.js.map +1 -0
  130. package/dist/core/components/le-button.d.ts +11 -0
  131. package/dist/core/components/le-button.js +9 -0
  132. package/dist/core/components/le-button.js.map +1 -0
  133. package/dist/core/components/le-button2.js +121 -0
  134. package/dist/core/components/le-button2.js.map +1 -0
  135. package/dist/core/components/le-card.d.ts +11 -0
  136. package/dist/core/components/le-card.js +52 -0
  137. package/dist/core/components/le-card.js.map +1 -0
  138. package/dist/core/components/le-checkbox.d.ts +11 -0
  139. package/dist/core/components/le-checkbox.js +87 -0
  140. package/dist/core/components/le-checkbox.js.map +1 -0
  141. package/dist/core/components/le-number-input.d.ts +11 -0
  142. package/dist/core/components/le-number-input.js +246 -0
  143. package/dist/core/components/le-number-input.js.map +1 -0
  144. package/dist/core/components/le-popover.d.ts +11 -0
  145. package/dist/core/components/le-popover.js +385 -0
  146. package/dist/core/components/le-popover.js.map +1 -0
  147. package/dist/core/components/le-popup.d.ts +11 -0
  148. package/dist/core/components/le-popup.js +253 -0
  149. package/dist/core/components/le-popup.js.map +1 -0
  150. package/dist/core/components/le-round-progress.d.ts +11 -0
  151. package/dist/core/components/le-round-progress.js +135 -0
  152. package/dist/core/components/le-round-progress.js.map +1 -0
  153. package/dist/core/components/le-stack.d.ts +11 -0
  154. package/dist/core/components/le-stack.js +167 -0
  155. package/dist/core/components/le-stack.js.map +1 -0
  156. package/dist/core/components/le-string-input.d.ts +11 -0
  157. package/dist/core/components/le-string-input.js +127 -0
  158. package/dist/core/components/le-string-input.js.map +1 -0
  159. package/dist/core/components/le-text.d.ts +11 -0
  160. package/dist/core/components/le-text.js +367 -0
  161. package/dist/core/components/le-text.js.map +1 -0
  162. package/dist/core/components/le-turntable.d.ts +11 -0
  163. package/dist/core/components/le-turntable.js +164 -0
  164. package/dist/core/components/le-turntable.js.map +1 -0
  165. package/dist/core/components/utils.js +310 -0
  166. package/dist/core/components/utils.js.map +1 -0
  167. package/dist/core/esm/{index-PS-3Rz-c.js → index-CJ-z5Zj1.js} +4 -4
  168. package/dist/core/esm/index-CJ-z5Zj1.js.map +1 -0
  169. package/dist/core/esm/index.js +2 -2
  170. package/dist/core/esm/le-box.entry.js +2 -2
  171. package/dist/core/esm/le-button.entry.js +2 -2
  172. package/dist/core/esm/le-card.entry.js +2 -2
  173. package/dist/core/esm/le-checkbox.entry.js +2 -2
  174. package/dist/core/esm/le-kit.js +2 -2
  175. package/dist/core/esm/le-number-input.entry.js +2 -2
  176. package/dist/core/esm/le-popover.entry.js +1 -1
  177. package/dist/core/esm/le-popup.entry.js +1 -1
  178. package/dist/core/esm/le-round-progress.entry.js +1 -1
  179. package/dist/core/esm/le-stack.entry.js +2 -2
  180. package/dist/core/esm/le-string-input.entry.js +2 -2
  181. package/dist/core/esm/le-text.entry.js +2 -2
  182. package/dist/core/esm/le-turntable.entry.js +1 -1
  183. package/dist/core/esm/loader.js +2 -2
  184. package/dist/core/esm/{utils-lgjSfQP0.js → utils-Bxmld82M.js} +3 -3
  185. package/dist/core/esm/{utils-lgjSfQP0.js.map → utils-Bxmld82M.js.map} +1 -1
  186. package/dist/core/le-kit/index.esm.js +1 -1
  187. package/dist/core/le-kit/le-kit.esm.js +1 -1
  188. package/dist/core/le-kit/{p-a5f1e539.entry.js → p-0308bd1f.entry.js} +2 -2
  189. package/dist/core/le-kit/{p-1c5262eb.entry.js → p-257495cc.entry.js} +2 -2
  190. package/dist/core/le-kit/{p-32c08678.entry.js → p-2ac4789a.entry.js} +2 -2
  191. package/dist/core/le-kit/{p-4bf51acc.entry.js → p-45eace7c.entry.js} +2 -2
  192. package/dist/core/le-kit/{p-fd665f35.entry.js → p-556086ca.entry.js} +2 -2
  193. package/dist/core/le-kit/{p-dcf1343d.entry.js → p-5ef81068.entry.js} +2 -2
  194. package/dist/core/le-kit/{p-a24b042d.entry.js → p-66d35f48.entry.js} +2 -2
  195. package/dist/core/le-kit/{p-4a9a9805.entry.js → p-73682c5e.entry.js} +2 -2
  196. package/dist/{le-kit/p-PS-3Rz-c.js → core/le-kit/p-CJ-z5Zj1.js} +1 -1
  197. package/dist/core/le-kit/p-CJ-z5Zj1.js.map +1 -0
  198. package/dist/core/le-kit/{p-DN2JVY-7.js → p-Drz36PDp.js} +2 -2
  199. package/dist/core/le-kit/{p-DN2JVY-7.js.map → p-Drz36PDp.js.map} +1 -1
  200. package/dist/core/le-kit/{p-bbc9e13e.entry.js → p-aa6e906f.entry.js} +2 -2
  201. package/dist/core/le-kit/{p-38e7ec05.entry.js → p-d75214f9.entry.js} +2 -2
  202. package/dist/core/le-kit/{p-9ee92c29.entry.js → p-df552906.entry.js} +2 -2
  203. package/dist/core/le-kit/{p-c4223c60.entry.js → p-e0861e82.entry.js} +2 -2
  204. package/dist/core/types/global/app.d.ts +1 -1
  205. package/dist/core/types/index.d.ts +1 -1
  206. package/dist/docs.json +1 -1
  207. package/dist/esm/{index-PS-3Rz-c.js → index-CwNQ1GTa.js} +10 -4
  208. package/dist/esm/index-CwNQ1GTa.js.map +1 -0
  209. package/dist/esm/index.js +2 -2
  210. package/dist/esm/le-box.entry.js +2 -2
  211. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +1 -1
  212. package/dist/esm/le-button_6.entry.js +11 -5
  213. package/dist/esm/le-card.entry.js +2 -2
  214. package/dist/esm/le-kit.js +2 -2
  215. package/dist/esm/le-number-input.entry.js +2 -2
  216. package/dist/esm/le-popup.entry.js +1 -1
  217. package/dist/esm/le-round-progress.entry.js +1 -1
  218. package/dist/esm/le-stack.entry.js +2 -2
  219. package/dist/esm/le-text.entry.js +2 -2
  220. package/dist/esm/le-turntable.entry.js +1 -1
  221. package/dist/esm/loader.js +2 -2
  222. package/dist/esm/{utils-lgjSfQP0.js → utils-Cf7fMI0j.js} +3 -3
  223. package/dist/esm/{utils-lgjSfQP0.js.map → utils-Cf7fMI0j.js.map} +1 -1
  224. package/dist/le-kit/assets/custom-elements.json +4305 -0
  225. package/dist/le-kit/dist/collection/themes/base.css +89 -0
  226. package/dist/le-kit/dist/collection/themes/dark.css +100 -0
  227. package/dist/le-kit/dist/collection/themes/default.css +108 -0
  228. package/dist/le-kit/dist/collection/themes/gradient.css +100 -0
  229. package/dist/le-kit/dist/collection/themes/index.css +413 -0
  230. package/dist/le-kit/dist/collection/themes/minimal.css +100 -0
  231. package/dist/le-kit/dist/collection/themes/warm.css +100 -0
  232. package/dist/le-kit/index.esm.js +1 -1
  233. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +1 -1
  234. package/dist/le-kit/le-kit.esm.js +1 -1
  235. package/dist/le-kit/{p-935bb2d4.entry.js → p-08dbcc25.entry.js} +2 -2
  236. package/dist/le-kit/{p-d8157b06.entry.js → p-5dc35729.entry.js} +2 -2
  237. package/dist/le-kit/{p-34102cef.entry.js → p-64374730.entry.js} +2 -2
  238. package/dist/le-kit/{p-27710b5b.entry.js → p-79ec6f7c.entry.js} +2 -2
  239. package/dist/le-kit/{p-ccabc638.entry.js → p-8daf3c7f.entry.js} +2 -2
  240. package/dist/le-kit/p-9c69235d.entry.js +2 -0
  241. package/dist/le-kit/p-9c69235d.entry.js.map +1 -0
  242. package/dist/{core/le-kit/p-PS-3Rz-c.js → le-kit/p-CwNQ1GTa.js} +2 -2
  243. package/dist/le-kit/p-CwNQ1GTa.js.map +1 -0
  244. package/dist/le-kit/{p-e8c2ca0e.entry.js → p-ad398acd.entry.js} +2 -2
  245. package/dist/le-kit/{p-9d3dc4e5.entry.js → p-b8122ad6.entry.js} +2 -2
  246. package/dist/le-kit/{p-56a80e6d.entry.js → p-f9008505.entry.js} +2 -2
  247. package/dist/le-kit/{p-DN2JVY-7.js → p-y3FECAx9.js} +2 -2
  248. package/dist/le-kit/{p-DN2JVY-7.js.map → p-y3FECAx9.js.map} +1 -1
  249. package/dist/types/global/app.d.ts +1 -1
  250. package/dist/types/index.d.ts +1 -1
  251. package/package.json +2 -2
  252. package/dist/cjs/index-D7B9TPh8.js.map +0 -1
  253. package/dist/core/cjs/index-D7B9TPh8.js.map +0 -1
  254. package/dist/core/esm/index-PS-3Rz-c.js.map +0 -1
  255. package/dist/core/le-kit/p-PS-3Rz-c.js.map +0 -1
  256. package/dist/esm/index-PS-3Rz-c.js.map +0 -1
  257. package/dist/le-kit/p-615ea10f.entry.js +0 -2
  258. package/dist/le-kit/p-615ea10f.entry.js.map +0 -1
  259. package/dist/le-kit/p-PS-3Rz-c.js.map +0 -1
  260. /package/dist/core/le-kit/{p-a5f1e539.entry.js.map → p-0308bd1f.entry.js.map} +0 -0
  261. /package/dist/core/le-kit/{p-1c5262eb.entry.js.map → p-257495cc.entry.js.map} +0 -0
  262. /package/dist/core/le-kit/{p-32c08678.entry.js.map → p-2ac4789a.entry.js.map} +0 -0
  263. /package/dist/core/le-kit/{p-4bf51acc.entry.js.map → p-45eace7c.entry.js.map} +0 -0
  264. /package/dist/core/le-kit/{p-fd665f35.entry.js.map → p-556086ca.entry.js.map} +0 -0
  265. /package/dist/core/le-kit/{p-dcf1343d.entry.js.map → p-5ef81068.entry.js.map} +0 -0
  266. /package/dist/core/le-kit/{p-a24b042d.entry.js.map → p-66d35f48.entry.js.map} +0 -0
  267. /package/dist/core/le-kit/{p-4a9a9805.entry.js.map → p-73682c5e.entry.js.map} +0 -0
  268. /package/dist/core/le-kit/{p-bbc9e13e.entry.js.map → p-aa6e906f.entry.js.map} +0 -0
  269. /package/dist/core/le-kit/{p-38e7ec05.entry.js.map → p-d75214f9.entry.js.map} +0 -0
  270. /package/dist/core/le-kit/{p-9ee92c29.entry.js.map → p-df552906.entry.js.map} +0 -0
  271. /package/dist/core/le-kit/{p-c4223c60.entry.js.map → p-e0861e82.entry.js.map} +0 -0
  272. /package/dist/le-kit/{p-935bb2d4.entry.js.map → p-08dbcc25.entry.js.map} +0 -0
  273. /package/dist/le-kit/{p-d8157b06.entry.js.map → p-5dc35729.entry.js.map} +0 -0
  274. /package/dist/le-kit/{p-34102cef.entry.js.map → p-64374730.entry.js.map} +0 -0
  275. /package/dist/le-kit/{p-27710b5b.entry.js.map → p-79ec6f7c.entry.js.map} +0 -0
  276. /package/dist/le-kit/{p-ccabc638.entry.js.map → p-8daf3c7f.entry.js.map} +0 -0
  277. /package/dist/le-kit/{p-e8c2ca0e.entry.js.map → p-ad398acd.entry.js.map} +0 -0
  278. /package/dist/le-kit/{p-9d3dc4e5.entry.js.map → p-b8122ad6.entry.js.map} +0 -0
  279. /package/dist/le-kit/{p-56a80e6d.entry.js.map → p-f9008505.entry.js.map} +0 -0
@@ -0,0 +1,1149 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, getAssetPath, Host, Fragment } from '@stencil/core/internal/client';
2
+ import { h as classnames, o as observeModeChanges, f as getLeKitConfig } from './utils.js';
3
+ import { d as defineCustomElement$5 } from './le-popover2.js';
4
+
5
+ const leStringInputCss = ":host{display:block;--le-input-bg:var(--le-color-surface, #ffffff);--le-input-color:var(--le-color-text-primary, #333333);--le-input-border:var(--le-border-width, 2px) solid var(--le-color-border-input, #007bff);--le-input-radius:var(--le-radius-sm, 4px);--le-input-padding:2px 6px;--le-input-height:1.5rem;--le-input-label-color:var(--le-color-text-primary, #333333);--le-input-desc-color:var(--le-color-text-secondary, #666666);--le-input-placeholder-color:#999999}.le-input-wrapper{display:flex;flex-direction:column;gap:2px}.le-input-label{display:block;font-size:0.9em;font-weight:500;color:var(--le-input-label-color);margin-bottom:2px}.le-input-container{position:relative;display:flex;align-items:center;background:var(--le-input-bg);border:var(--le-input-border);border-radius:var(--le-input-radius);transition:border-color 0.2s}.le-input-container:focus-within{outline:2px solid var(--le-color-focus);outline-offset:2px}:host([disabled]) .le-input-container{opacity:0.6;background-color:rgba(0,0,0,0.05);cursor:not-allowed}input{flex:1;min-height:var(--le-input-height);padding:var(--le-input-padding);border:none;background:transparent;color:var(--le-input-color);font-family:inherit;font-size:inherit;outline:none;width:100%}input::placeholder{color:var(--le-input-placeholder-color)}.icon-start,.icon-end{display:flex;align-items:center;justify-content:center;padding:0 8px;color:var(--le-input-desc-color)}.le-input-description{font-size:0.85em;color:var(--le-input-desc-color);margin-top:2px}.le-input-description::has(le-slot>slot[name=description]:empty){display:none}";
6
+
7
+ const LeStringInput = /*@__PURE__*/ proxyCustomElement(class LeStringInput extends HTMLElement {
8
+ constructor(registerHost) {
9
+ super();
10
+ if (registerHost !== false) {
11
+ this.__registerHost();
12
+ }
13
+ this.__attachShadow();
14
+ this.leChange = createEvent(this, "change", 7);
15
+ this.leInput = createEvent(this, "input", 7);
16
+ }
17
+ get el() { return this; }
18
+ /**
19
+ * Mode of the popover should be 'default' for internal use
20
+ */
21
+ mode;
22
+ /**
23
+ * The value of the input
24
+ */
25
+ value;
26
+ /**
27
+ * The name of the input
28
+ */
29
+ name;
30
+ /**
31
+ * The type of the input (text, email, password, etc.)
32
+ */
33
+ type = 'text';
34
+ /**
35
+ * Label for the input
36
+ */
37
+ label;
38
+ /**
39
+ * Icon for the start icon
40
+ */
41
+ iconStart;
42
+ /**
43
+ * Icon for the end icon
44
+ */
45
+ iconEnd;
46
+ /**
47
+ * Placeholder text
48
+ */
49
+ placeholder;
50
+ /**
51
+ * Whether the input is disabled
52
+ */
53
+ disabled = false;
54
+ /**
55
+ * Whether the input is read-only
56
+ */
57
+ readonly = false;
58
+ /**
59
+ * External ID for linking with external systems
60
+ */
61
+ externalId;
62
+ /**
63
+ * Emitted when the value changes (on blur or Enter)
64
+ */
65
+ leChange;
66
+ /**
67
+ * Emitted when the input value changes (on keystroke)
68
+ */
69
+ leInput;
70
+ handleInput = (ev) => {
71
+ const input = ev.target;
72
+ this.value = input.value;
73
+ this.leInput.emit({
74
+ value: this.value,
75
+ name: this.name,
76
+ externalId: this.externalId
77
+ });
78
+ };
79
+ handleChange = (ev) => {
80
+ const input = ev.target;
81
+ this.value = input.value;
82
+ this.leChange.emit({
83
+ value: this.value,
84
+ name: this.name,
85
+ externalId: this.externalId
86
+ });
87
+ };
88
+ handleClick = (ev) => {
89
+ ev.stopPropagation();
90
+ };
91
+ render() {
92
+ return (h("le-component", { key: 'd0c69370dae2d1fee5700954e4823d2a03a51331', component: "le-string-input", hostClass: classnames({ 'disabled': this.disabled }) }, h("div", { key: '4acae8d3c34da2a86970a616c493ff210d561f5f', class: "le-input-wrapper" }, this.label && (h("label", { key: '609191b45187b6b1a65d05cd594b149760ac6882', class: "le-input-label", htmlFor: this.name }, this.label)), h("div", { key: '36b4caff4468ac7421db03f811cb3ef4a622b001', class: "le-input-container" }, this.iconStart && (h("span", { key: '344f88887fe8270bbef7e26ec1ad5da9fae1f8e4', class: "icon-start" }, this.iconStart)), h("input", { key: '4ba7beeddd7fb3cf23d03e029d11a804764cdd6e', id: this.name, type: this.type, name: this.name, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput, onChange: this.handleChange, onClick: this.handleClick }), this.iconEnd && (h("span", { key: '7cdd4b52c3e1a1b18b19e697bdb42431941bba01', class: "icon-end" }, this.iconEnd))), h("div", { key: '113a75aa413e4d95300aeaa97d1ce7a75cf68c7a', class: "le-input-description" }, h("le-slot", { key: '0b37fc14e6df68f6c44cf9001d63a70f019e1cc3', name: "description", type: "text", tag: "p", label: "Description" }, h("slot", { key: '2674056dc915fabdb4fcbcaa13294a116b9509a6', name: "description" }))))));
93
+ }
94
+ static get style() { return leStringInputCss; }
95
+ }, [769, "le-string-input", {
96
+ "mode": [1537],
97
+ "value": [1537],
98
+ "name": [1],
99
+ "type": [1],
100
+ "label": [1],
101
+ "iconStart": [1, "icon-start"],
102
+ "iconEnd": [1, "icon-end"],
103
+ "placeholder": [1],
104
+ "disabled": [4],
105
+ "readonly": [4],
106
+ "externalId": [1, "external-id"]
107
+ }]);
108
+ function defineCustomElement$4() {
109
+ if (typeof customElements === "undefined") {
110
+ return;
111
+ }
112
+ const components = ["le-string-input", "le-button", "le-checkbox", "le-component", "le-popover", "le-slot", "le-string-input"];
113
+ components.forEach(tagName => { switch (tagName) {
114
+ case "le-string-input":
115
+ if (!customElements.get(tagName)) {
116
+ customElements.define(tagName, LeStringInput);
117
+ }
118
+ break;
119
+ case "le-button":
120
+ if (!customElements.get(tagName)) {
121
+ defineCustomElement();
122
+ }
123
+ break;
124
+ case "le-checkbox":
125
+ if (!customElements.get(tagName)) {
126
+ defineCustomElement$1();
127
+ }
128
+ break;
129
+ case "le-component":
130
+ if (!customElements.get(tagName)) {
131
+ defineCustomElement$2();
132
+ }
133
+ break;
134
+ case "le-popover":
135
+ if (!customElements.get(tagName)) {
136
+ defineCustomElement$5();
137
+ }
138
+ break;
139
+ case "le-slot":
140
+ if (!customElements.get(tagName)) {
141
+ defineCustomElement$3();
142
+ }
143
+ break;
144
+ case "le-string-input":
145
+ if (!customElements.get(tagName)) {
146
+ defineCustomElement$4();
147
+ }
148
+ break;
149
+ } });
150
+ }
151
+
152
+ const leSlotDefaultCss = ":host{display:contents;--le-slot-border-color:#0088ff;--le-slot-bg-color:rgba(0, 136, 255, 0.05);--le-slot-header-bg:rgb(218, 238, 255);--le-slot-label-color:#0066cc;--le-slot-description-color:#666;--le-slot-required-color:#e53935;--le-slot-dropzone-min-height:20px;--le-slot-dropzone-border-color:#ccc}.le-slot-container,.le-slot-header,.le-slot-description,.le-slot-dropzone,.le-slot-input{display:none}.hidden-slot{display:none}:host(.admin-mode){display:block;flex:1}:host(.admin-mode) .le-slot-container{position:relative;display:flex;flex-direction:column;border:2px dashed var(--le-slot-border-color);border-radius:4px;background:var(--le-slot-bg-color);margin:4px 0}:host(.admin-mode) .le-slot-header{display:flex;align-items:center;gap:4px;padding:0 0 0 var(--le-spacing-1, 4px);background:var(--le-slot-header-bg);border-bottom:1px solid var(--le-slot-border-color);font-size:var(--le-font-size-xs, 11px);font-weight:400;text-transform:capitalize}:host(.admin-mode) .le-slot-header-no-label{justify-content:flex-end;height:16px;border:none;background-color:transparent}.le-slot-label{color:var(--le-slot-label-color);text-align:start;overflow:hidden;width:0;flex:1 1 0%}.le-slot-required{color:var(--le-slot-required-color);font-weight:bold}:host(.admin-mode) .le-slot-description{display:block;padding:4px 8px;font-size:12px;color:var(--le-slot-description-color);font-style:italic}:host(.admin-mode) .le-slot-description-icon{display:inline-block;font-size:9px;line-height:1;cursor:pointer;color:var(--le-slot-description-color)}:host(.admin-mode) .le-slot-dropzone{display:block;min-height:var(--le-slot-dropzone-min-height);padding:var(--le-spacing-1, 4px);position:relative}:host(.admin-mode) .le-slot-dropzone:empty::before{content:'Drop content here';display:flex;align-items:center;justify-content:center;position:absolute;inset:8px;border:2px dashed var(--le-slot-dropzone-border-color);border-radius:4px;color:#999;font-size:12px;pointer-events:none}:host(.admin-mode.drag-over) .le-slot-container{border-color:#00cc66;background:rgba(0, 204, 102, 0.1)}:host(.admin-mode.drag-over) .le-slot-dropzone:empty::before{border-color:#00cc66;color:#00cc66;content:'Release to drop'}:host(.admin-mode) .le-slot-input{display:block;padding:var(--le-spacing-1, 4px)}:host(.admin-mode) .le-slot-input input,:host(.admin-mode) .le-slot-input textarea{display:block;width:100%;padding:8px 10px;border:1px solid var(--le-slot-dropzone-border-color);border-radius:4px;font-family:inherit;font-size:14px;line-height:1.4;background:#fff;color:#333;box-sizing:border-box;transition:border-color 0.2s, box-shadow 0.2s}:host(.admin-mode) .le-slot-input input:focus,:host(.admin-mode) .le-slot-input textarea:focus{outline:none;border-color:var(--le-slot-border-color);box-shadow:0 0 0 3px rgba(0, 136, 255, 0.15)}:host(.admin-mode) .le-slot-input input::placeholder,:host(.admin-mode) .le-slot-input textarea::placeholder{color:#999}:host(.admin-mode) .le-slot-input textarea{resize:vertical;min-height:60px}:host(.admin-mode) .le-slot-input slot{display:none}.le-slot-invalid{color:var(--le-slot-required-color);font-size:10px;margin-left:auto;font-weight:normal;text-transform:none}:host(.admin-mode) .le-slot-input.has-error input,:host(.admin-mode) .le-slot-input.has-error textarea{border-color:var(--le-slot-required-color);background:rgba(229, 57, 53, 0.05)}:host(.admin-mode) .le-slot-input.has-error input:focus,:host(.admin-mode) .le-slot-input.has-error textarea:focus{border-color:var(--le-slot-required-color);box-shadow:0 0 0 3px rgba(229, 57, 53, 0.15)}.le-slot-add-btn{font-size:24px;line-height:0px;width:12px;height:12px}.le-slot-header-no-label .le-slot-add-btn{font-size:16px}.le-slot-button{width:20px;height:20px}:host(.admin-mode) .le-slot-header-no-label.le-slot-header-text{height:0}";
153
+
154
+ const LeSlot = /*@__PURE__*/ proxyCustomElement(class LeSlot extends HTMLElement {
155
+ constructor(registerHost) {
156
+ super();
157
+ if (registerHost !== false) {
158
+ this.__registerHost();
159
+ }
160
+ this.__attachShadow();
161
+ this.leSlotChange = createEvent(this, "leSlotChange", 7);
162
+ }
163
+ get el() { return this; }
164
+ /**
165
+ * The type of slot content.
166
+ * - `slot`: Default, shows a dropzone for components (default)
167
+ * - `text`: Shows a single-line text input
168
+ * - `textarea`: Shows a multi-line text area
169
+ */
170
+ type = 'slot';
171
+ /**
172
+ * The name of the slot this placeholder represents.
173
+ * Should match the slot name in the parent component.
174
+ */
175
+ name = '';
176
+ /**
177
+ * Label to display in admin mode.
178
+ * If not provided, the slot name will be used.
179
+ */
180
+ label;
181
+ /**
182
+ * Description of what content this slot accepts.
183
+ * Shown in admin mode to guide content editors.
184
+ */
185
+ description;
186
+ /**
187
+ * Comma-separated list of allowed component tags for this slot.
188
+ * Used by CMS to filter available components.
189
+ *
190
+ * @example "le-card,le-button,le-text"
191
+ */
192
+ allowedComponents;
193
+ /**
194
+ * Whether multiple components can be dropped in this slot.
195
+ */
196
+ multiple = true;
197
+ /**
198
+ * Whether this slot is required to have content.
199
+ */
200
+ required = false;
201
+ /**
202
+ * Placeholder text for text/textarea inputs in admin mode.
203
+ */
204
+ placeholder;
205
+ /**
206
+ * The HTML tag to create when there's no slotted element.
207
+ * Used with type="text" or type="textarea" to auto-create elements.
208
+ *
209
+ * @example "h3" - creates <h3 slot="header">content</h3>
210
+ * @example "p" - creates <p slot="content">content</p>
211
+ */
212
+ tag;
213
+ /**
214
+ * CSS styles for the slot dropzone container.
215
+ * Useful for layouts - e.g., "flex-direction: row" for horizontal stacks.
216
+ * Only applies in admin mode for type="slot".
217
+ */
218
+ slotStyle;
219
+ /**
220
+ * Internal state to track admin mode
221
+ */
222
+ adminMode = false;
223
+ /**
224
+ * Internal state for text input value (synced from slot content)
225
+ */
226
+ textValue = '';
227
+ /**
228
+ * Whether the current textValue contains valid HTML
229
+ */
230
+ isValidHtml = true;
231
+ /**
232
+ * Available components loaded from Custom Elements Manifest
233
+ */
234
+ availableComponents = [];
235
+ /**
236
+ * Whether the component picker popover is open
237
+ */
238
+ pickerOpen = false;
239
+ /**
240
+ * Reference to the slot element to access assignedNodes
241
+ */
242
+ slotRef;
243
+ /**
244
+ * The original slotted element (e.g., <h3 slot="header">)
245
+ */
246
+ slottedElement;
247
+ /**
248
+ * Emitted when text content changes in admin mode.
249
+ * The event detail contains the new text value and validity.
250
+ */
251
+ leSlotChange;
252
+ disconnectModeObserver;
253
+ connectedCallback() {
254
+ this.disconnectModeObserver = observeModeChanges(this.el, mode => {
255
+ const wasAdmin = this.adminMode;
256
+ this.adminMode = mode === 'admin';
257
+ // When entering admin mode, read content from slotted elements
258
+ if (this.adminMode && !wasAdmin) {
259
+ // Need to wait for render to access slot ref
260
+ requestAnimationFrame(() => this.readSlottedContent());
261
+ // Load available components for the component picker
262
+ if (this.type === 'slot') {
263
+ this.loadAvailableComponents();
264
+ }
265
+ }
266
+ });
267
+ }
268
+ disconnectedCallback() {
269
+ this.disconnectModeObserver?.();
270
+ }
271
+ /**
272
+ * Flag to prevent re-reading content right after we updated it
273
+ */
274
+ isUpdating = false;
275
+ /**
276
+ * Read content from slotted elements via assignedNodes()
277
+ */
278
+ readSlottedContent() {
279
+ if (!this.slotRef)
280
+ return;
281
+ // Skip if we just updated the content ourselves
282
+ if (this.isUpdating) {
283
+ this.isUpdating = false;
284
+ return;
285
+ }
286
+ const assignedNodes = this.slotRef.assignedNodes({ flatten: true });
287
+ // For text/textarea types, we want to edit the innerHTML of slotted elements
288
+ if (this.type === 'text' || this.type === 'textarea') {
289
+ // Find the first element node (skip text nodes that are just whitespace)
290
+ const elementNode = assignedNodes.find(node => node.nodeType === Node.ELEMENT_NODE);
291
+ if (elementNode) {
292
+ // Only update textValue if slotted element changed or we don't have one yet
293
+ if (this.slottedElement !== elementNode) {
294
+ this.slottedElement = elementNode;
295
+ this.textValue = elementNode.innerHTML?.trim() || '';
296
+ // console.log(`[le-slot "${this.name}"] Read slotted content:`, this.textValue);
297
+ }
298
+ }
299
+ else {
300
+ // No element, check for direct text content
301
+ const textContent = assignedNodes
302
+ .filter(node => node.nodeType === Node.TEXT_NODE)
303
+ .map(node => node.textContent)
304
+ .join('')
305
+ .trim();
306
+ if (textContent && !this.textValue) {
307
+ this.textValue = textContent;
308
+ // console.log(`[le-slot "${this.name}"] Read text content:`, this.textValue);
309
+ }
310
+ }
311
+ }
312
+ }
313
+ /**
314
+ * Validates if a string contains valid HTML
315
+ */
316
+ validateHtml(html) {
317
+ // Empty string is valid
318
+ if (!html.trim())
319
+ return true;
320
+ // Create a template element to parse the HTML
321
+ const template = document.createElement('template');
322
+ template.innerHTML = html;
323
+ // Check that we don't have obviously broken HTML
324
+ // Count opening and closing tags for common elements
325
+ const openTags = (html.match(/<[a-z][^>]*(?<!\/)>/gi) || []).length;
326
+ const closeTags = (html.match(/<\/[a-z][^>]*>/gi) || []).length;
327
+ const selfClosing = (html.match(/<[a-z][^>]*\/>/gi) || []).length;
328
+ // Simple validation: opening tags (minus self-closing) should roughly match closing tags
329
+ // Allow some tolerance for void elements like <br>, <img>, etc.
330
+ const voidElements = (html.match(/<(br|hr|img|input|meta|link|area|base|col|embed|param|source|track|wbr)[^>]*>/gi) || []).length;
331
+ const effectiveOpenTags = openTags - selfClosing - voidElements;
332
+ // If difference is too large, HTML is likely broken
333
+ if (Math.abs(effectiveOpenTags - closeTags) > 1) {
334
+ return false;
335
+ }
336
+ return true;
337
+ }
338
+ handleTextInput = (event) => {
339
+ const target = event.target;
340
+ this.textValue = target.value;
341
+ this.isValidHtml = this.validateHtml(this.textValue);
342
+ if (this.isValidHtml) {
343
+ // Set flag to prevent slotchange from re-reading what we just wrote
344
+ this.isUpdating = true;
345
+ console.log('Updating text value:', this.textValue, 'slottedElement:', this.slottedElement);
346
+ if (this.slottedElement) {
347
+ // Update existing slotted element's innerHTML
348
+ this.slottedElement.innerHTML = this.textValue;
349
+ }
350
+ else if (this.tag && this.textValue) {
351
+ // No slotted element exists
352
+ // If the slot doesn't have a name, then it's the default slot
353
+ // remove the existing non-slotted content (text nodes and elements without slot attribute)
354
+ const rootNode = this.el.getRootNode();
355
+ if (!this.name && rootNode instanceof ShadowRoot) {
356
+ const hostComponent = rootNode.host;
357
+ Array.from(hostComponent.childNodes).forEach(node => {
358
+ if (node.nodeType === Node.TEXT_NODE || (node.nodeType === Node.ELEMENT_NODE && !node.hasAttribute('slot'))) {
359
+ node.remove();
360
+ }
361
+ });
362
+ }
363
+ // create one using the specified tag
364
+ this.createSlottedElement();
365
+ }
366
+ else if (this.textValue) {
367
+ // no tag specified - just replace everything in the host component
368
+ const rootNode = this.el.getRootNode();
369
+ if (rootNode instanceof ShadowRoot) {
370
+ const hostComponent = rootNode.host;
371
+ hostComponent.innerHTML = this.textValue;
372
+ }
373
+ }
374
+ }
375
+ this.leSlotChange.emit({
376
+ name: this.name,
377
+ value: this.textValue,
378
+ isValid: this.isValidHtml,
379
+ });
380
+ };
381
+ /**
382
+ * Create a new slotted element when none exists.
383
+ * The element is appended to the host component's light DOM.
384
+ */
385
+ createSlottedElement() {
386
+ if (!this.tag)
387
+ return;
388
+ // Find the host component (le-card, etc.) by traversing up through shadow DOM
389
+ // le-slot is inside le-card's shadow DOM, so we need to find le-card's host
390
+ const rootNode = this.el.getRootNode();
391
+ if (!(rootNode instanceof ShadowRoot))
392
+ return;
393
+ const hostComponent = rootNode.host;
394
+ if (!hostComponent)
395
+ return;
396
+ // Create the new element
397
+ const newElement = document.createElement(this.tag);
398
+ newElement.innerHTML = this.textValue;
399
+ // Set the slot attribute if this is a named slot
400
+ if (this.name) {
401
+ newElement.setAttribute('slot', this.name);
402
+ }
403
+ // Append to the host component's light DOM
404
+ hostComponent.appendChild(newElement);
405
+ // Store reference to the new element
406
+ this.slottedElement = newElement;
407
+ // console.log(`[le-slot "${this.name}"] Created new <${this.tag}> element`);
408
+ }
409
+ /**
410
+ * Load available components from Custom Elements Manifest
411
+ */
412
+ async loadAvailableComponents() {
413
+ try {
414
+ const { manifestUrl } = getLeKitConfig();
415
+ const manifestUrlResolved = manifestUrl.startsWith('/')
416
+ ? getAssetPath(`./assets${manifestUrl}`)
417
+ : manifestUrl;
418
+ const response = await fetch(manifestUrlResolved);
419
+ const manifest = await response.json();
420
+ const components = [];
421
+ const allowedList = this.allowedComponents?.split(',').map(s => s.trim()) || [];
422
+ for (const module of manifest.modules) {
423
+ for (const declaration of module.declarations || []) {
424
+ if (declaration.tagName && declaration.customElement) {
425
+ // Skip internal components (le-slot, le-component, le-popover)
426
+ const isInternal = ['le-slot', 'le-component', 'le-popover'].includes(declaration.tagName);
427
+ if (isInternal)
428
+ continue;
429
+ // If allowedComponents is specified, filter by it
430
+ if (allowedList.length > 0 && !allowedList.includes(declaration.tagName)) {
431
+ continue;
432
+ }
433
+ components.push({
434
+ tagName: declaration.tagName,
435
+ name: this.formatComponentName(declaration.tagName),
436
+ description: declaration.description || '',
437
+ });
438
+ }
439
+ }
440
+ }
441
+ this.availableComponents = components || [];
442
+ }
443
+ catch (error) {
444
+ console.warn('[le-slot] Failed to load component manifest:', error);
445
+ }
446
+ }
447
+ /**
448
+ * Format a tag name into a display name
449
+ * e.g., 'le-card' -> 'Card'
450
+ */
451
+ formatComponentName(tagName) {
452
+ return tagName
453
+ .replace(/^le-/, '')
454
+ .split('-')
455
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
456
+ .join(' ');
457
+ }
458
+ /**
459
+ * Add a new component to the slot
460
+ */
461
+ addComponent(tagName) {
462
+ // Find the host component by traversing up through shadow DOM
463
+ const rootNode = this.el.getRootNode();
464
+ if (!(rootNode instanceof ShadowRoot))
465
+ return;
466
+ const hostComponent = rootNode.host;
467
+ if (!hostComponent)
468
+ return;
469
+ // Create the new component element
470
+ const newElement = document.createElement(tagName);
471
+ // Set the slot attribute if this is a named slot
472
+ if (this.name) {
473
+ newElement.setAttribute('slot', this.name);
474
+ }
475
+ // Append to the host component's light DOM
476
+ hostComponent.appendChild(newElement);
477
+ // Emit change event so the page can save
478
+ this.leSlotChange.emit({
479
+ name: this.name,
480
+ value: hostComponent.innerHTML,
481
+ isValid: true,
482
+ });
483
+ }
484
+ /**
485
+ * Handle slot change event to re-read content when nodes are assigned
486
+ */
487
+ handleSlotChange = () => {
488
+ this.readSlottedContent();
489
+ };
490
+ render() {
491
+ const displayLabel = this.label || this.name;
492
+ // Always render the same structure, CSS handles visibility via .admin-mode class
493
+ return (h(Host, { key: 'e89effa647f07ae271cffc05aad6730b51da6447', class: {
494
+ 'admin-mode': this.adminMode,
495
+ 'invalid-html': !this.isValidHtml,
496
+ }, role: this.adminMode ? 'region' : undefined, "aria-label": this.adminMode ? `Slot: ${displayLabel}` : undefined, "data-slot-name": this.name, "data-slot-type": this.type, "data-allowed": this.allowedComponents, "data-multiple": this.multiple, "data-required": this.required }, this.adminMode ? (h("div", { class: "le-slot-container" }, h("div", { class: classnames('le-slot-header', {
497
+ 'le-slot-header-no-label': !displayLabel,
498
+ 'le-slot-header-text': this.type === 'text',
499
+ 'le-slot-header-error': !this.isValidHtml,
500
+ }) }, displayLabel && (h("span", { class: "le-slot-label" }, displayLabel, this.required && h("span", { class: "le-slot-required" }, "*"))), !this.isValidHtml && h("span", { class: "le-slot-invalid" }, "\u26A0 Invalid HTML"), this.type === 'slot' && this.adminMode && (h("le-popover", { mode: "default", showClose: true, align: "start", position: "right", popoverTitle: "Add Component", open: this.pickerOpen, onLePopoverOpen: () => (this.pickerOpen = true), onLePopoverClose: () => (this.pickerOpen = false) }, h("le-button", { type: "button", class: "le-slot-button", slot: "trigger", variant: "clear", size: "small", "aria-label": "Add component", "icon-only": true }, h("span", { class: "le-slot-add-btn", slot: "icon-only" }, "+")), h("div", { class: "le-slot-picker" }, this.availableComponents.length > 0 ? (h("ul", { class: "le-slot-picker-list" }, this.availableComponents.map(component => (h("li", { key: component.tagName }, h("button", { class: "le-slot-picker-item", onClick: () => {
501
+ this.addComponent(component.tagName);
502
+ this.pickerOpen = false;
503
+ } }, h("span", { class: "le-slot-picker-name" }, component.name), component.description && h("span", { class: "le-slot-picker-desc" }, component.description))))))) : (h("div", { class: "le-slot-picker-empty" }, "No components available")))))), this.renderContent())) : (
504
+ // In default mode, just pass through the slot - slotted content renders naturally
505
+ // Note: We use unnamed slot here because named slots from parent component
506
+ // are passed as le-slot's light DOM children
507
+ h("slot", null))));
508
+ }
509
+ renderContent() {
510
+ // Create the slot element with ref for reading assignedNodes
511
+ // Wrap in a hidden div since slot elements can't have style prop in Stencil
512
+ // Note: We use unnamed slot here because named slots from parent component
513
+ // are passed as le-slot's light DOM children
514
+ const slotElement = (h("div", { class: "hidden-slot" }, h("slot", { ref: el => (this.slotRef = el), onSlotchange: this.handleSlotChange })));
515
+ switch (this.type) {
516
+ case 'text':
517
+ return (h("div", { class: { 'le-slot-input': true, 'has-error': !this.isValidHtml } }, h("le-string-input", { mode: "default", value: this.textValue, placeholder: this.placeholder || `Enter ${this.label || this.name || 'text'}...`, onChange: this.handleTextInput }), slotElement));
518
+ case 'textarea':
519
+ return (h("div", { class: { 'le-slot-input': true, 'has-error': !this.isValidHtml } }, h("textarea", { value: this.textValue, placeholder: this.placeholder || `Enter ${this.label || this.name || 'text'}...`, onInput: this.handleTextInput, required: this.required, rows: 3 }), slotElement));
520
+ case 'slot':
521
+ default:
522
+ // Parse slotStyle string into style object if provided
523
+ const dropzoneStyle = {};
524
+ if (this.slotStyle) {
525
+ this.slotStyle.split(';').forEach(rule => {
526
+ const [prop, value] = rule.split(':').map(s => s.trim());
527
+ if (prop && value) {
528
+ // Convert kebab-case to camelCase for style object
529
+ const camelProp = prop.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
530
+ dropzoneStyle[camelProp] = value;
531
+ }
532
+ });
533
+ }
534
+ return (h("div", { class: "le-slot-dropzone", style: dropzoneStyle }, h("slot", { ref: el => (this.slotRef = el), onSlotchange: this.handleSlotChange })));
535
+ }
536
+ }
537
+ static get style() { return leSlotDefaultCss; }
538
+ }, [769, "le-slot", {
539
+ "type": [1],
540
+ "name": [1],
541
+ "label": [1],
542
+ "description": [1],
543
+ "allowedComponents": [1, "allowed-components"],
544
+ "multiple": [4],
545
+ "required": [4],
546
+ "placeholder": [1],
547
+ "tag": [1],
548
+ "slotStyle": [1, "slot-style"],
549
+ "adminMode": [32],
550
+ "textValue": [32],
551
+ "isValidHtml": [32],
552
+ "availableComponents": [32],
553
+ "pickerOpen": [32]
554
+ }]);
555
+ function defineCustomElement$3() {
556
+ if (typeof customElements === "undefined") {
557
+ return;
558
+ }
559
+ const components = ["le-slot", "le-button", "le-checkbox", "le-component", "le-popover", "le-slot", "le-string-input"];
560
+ components.forEach(tagName => { switch (tagName) {
561
+ case "le-slot":
562
+ if (!customElements.get(tagName)) {
563
+ customElements.define(tagName, LeSlot);
564
+ }
565
+ break;
566
+ case "le-button":
567
+ if (!customElements.get(tagName)) {
568
+ defineCustomElement();
569
+ }
570
+ break;
571
+ case "le-checkbox":
572
+ if (!customElements.get(tagName)) {
573
+ defineCustomElement$1();
574
+ }
575
+ break;
576
+ case "le-component":
577
+ if (!customElements.get(tagName)) {
578
+ defineCustomElement$2();
579
+ }
580
+ break;
581
+ case "le-popover":
582
+ if (!customElements.get(tagName)) {
583
+ defineCustomElement$5();
584
+ }
585
+ break;
586
+ case "le-slot":
587
+ if (!customElements.get(tagName)) {
588
+ defineCustomElement$3();
589
+ }
590
+ break;
591
+ case "le-string-input":
592
+ if (!customElements.get(tagName)) {
593
+ defineCustomElement$4();
594
+ }
595
+ break;
596
+ } });
597
+ }
598
+
599
+ const leComponentCss = ":host{display:contents}:host(.admin-mode){display:block}.le-component-wrapper{position:relative;border:2px dashed var(--le-admin-border-color, #90caf9);border-radius:var(--le-radius-md, 8px);background:var(--le-admin-bg, rgba(144, 202, 249, 0.05));transition:border-color 0.2s ease, box-shadow 0.2s ease}.le-component-wrapper:hover{border-color:var(--le-admin-border-hover, #42a5f5);box-shadow:0 0 0 2px var(--le-admin-glow, rgba(66, 165, 245, 0.2))}.le-component-header{display:flex;align-items:center;justify-content:space-between;gap:var(--le-spacing-1, 4px);padding:0 0 0 var(--le-spacing-1, 4px);background:var(--le-admin-header-bg, rgba(144, 202, 249, 0.15));border-bottom:1px solid var(--le-admin-border-color, #90caf9);border-radius:var(--le-radius-md, 8px) var(--le-radius-md, 8px) 0 0;font-size:var(--le-font-size-xs, 11px)}.le-component-name{font-weight:var(--le-font-weight-medium, 500);color:var(--le-admin-text, #1976d2);text-transform:capitalize;text-align:start;overflow:hidden;width:0;flex:1 1 0%}.le-component-content{padding:var(--le-space-xs, 4px)}.le-component-trigger{font-size:24px;line-height:0px;width:12px;height:12px}.le-component-button{width:20px}.property-editor{display:flex;flex-direction:column;gap:var(--le-space-sm, 8px);max-width:380px}.property-field{display:flex;flex-direction:column;gap:var(--le-space-xs, 4px)}.property-field label{display:flex;flex-direction:column;gap:2px;font-size:var(--le-font-size-sm, 13px);font-weight:var(--le-font-weight-medium, 500);color:var(--le-color-text, #333)}.property-hint{font-size:var(--le-font-size-xs, 11px);font-weight:normal;color:var(--le-color-text-secondary, #666);line-height:1.3}.property-field input[type=\"text\"],.property-field input[type=\"number\"],.property-field select{padding:var(--le-space-xs, 4px) var(--le-space-sm, 8px);border:1px solid var(--le-color-border, #ddd);border-radius:var(--le-radius-md, 7px);font-size:var(--le-font-size-sm, 13px);font-family:inherit;background:var(--le-color-surface, #fff);color:var(--le-color-text, #333);transition:border-color 0.15s ease, box-shadow 0.15s ease}.property-field input:focus,.property-field select:focus{outline:none;border-color:var(--le-color-primary, #1976d2);box-shadow:0 0 0 2px var(--le-color-primary-light, rgba(25, 118, 210, 0.2))}.property-field--checkbox{flex-direction:column}.property-field--checkbox label{flex-direction:row;align-items:center;gap:var(--le-space-sm, 8px);cursor:pointer}.property-field--checkbox input[type=\"checkbox\"]{width:16px;height:16px;margin:0;cursor:pointer;accent-color:var(--le-color-primary, #1976d2)}.property-field--checkbox .property-hint{margin-left:24px}.no-properties{margin:0;padding:var(--le-space-sm, 8px);font-size:var(--le-font-size-sm, 13px);color:var(--le-color-text-secondary, #666);text-align:center}.property-editor-container{display:flex;flex-direction:column;gap:var(--le-space-md, 12px)}.property-editor-actions{padding-top:var(--le-space-sm, 8px);border-top:1px solid var(--le-color-border, #e5e5e5)}.delete-component-btn{display:flex;align-items:center;justify-content:center;gap:var(--le-space-xs, 4px);width:100%;padding:var(--le-space-sm, 8px) var(--le-space-md, 12px);border:1px solid var(--le-color-danger, #e53935);border-radius:var(--le-radius-md, 6px);background:transparent;color:var(--le-color-danger, #e53935);font-size:var(--le-font-size-sm, 13px);font-weight:500;cursor:pointer;transition:background-color 0.15s, color 0.15s}.delete-component-btn:hover{background:var(--le-color-danger, #e53935);color:white}.delete-component-btn:active{opacity:0.9}";
600
+
601
+ const LeComponent = /*@__PURE__*/ proxyCustomElement(class LeComponent extends HTMLElement {
602
+ constructor(registerHost) {
603
+ super();
604
+ if (registerHost !== false) {
605
+ this.__registerHost();
606
+ }
607
+ this.__attachShadow();
608
+ }
609
+ get el() { return this; }
610
+ /**
611
+ * The tag name of the component (e.g., 'le-card').
612
+ * Used to look up property metadata and display the component name.
613
+ */
614
+ component;
615
+ /**
616
+ * Optional display name for the component.
617
+ * If not provided, the tag name will be formatted as the display name.
618
+ */
619
+ displayName;
620
+ /**
621
+ * Classes to apply to the host element.
622
+ * Allows parent components to pass their styling classes.
623
+ */
624
+ hostClass;
625
+ /**
626
+ * Inline styles to apply to the host element.
627
+ * Allows parent components to pass dynamic styles (e.g., flex properties).
628
+ */
629
+ hostStyle;
630
+ /**
631
+ * Reference to the host element (found automatically from parent)
632
+ */
633
+ hostElement;
634
+ /**
635
+ * Internal state to track admin mode
636
+ */
637
+ adminMode = false;
638
+ /**
639
+ * Component metadata loaded from Custom Elements Manifest
640
+ */
641
+ componentMeta = null;
642
+ /**
643
+ * Current property values of the host component
644
+ */
645
+ propertyValues = {};
646
+ disconnectModeObserver;
647
+ connectedCallback() {
648
+ // Find the host element - le-component is rendered inside the component's shadow DOM,
649
+ // so we need to find the shadow root's host element
650
+ this.findHostElement();
651
+ this.disconnectModeObserver = observeModeChanges(this.el, mode => {
652
+ this.adminMode = mode === 'admin';
653
+ // Load metadata and refresh property values only when entering admin mode
654
+ if (this.adminMode) {
655
+ if (!this.componentMeta) {
656
+ this.loadComponentMetadata();
657
+ }
658
+ else {
659
+ this.readPropertyValues();
660
+ }
661
+ }
662
+ });
663
+ }
664
+ /**
665
+ * Find the host element by traversing up through shadow DOM
666
+ */
667
+ findHostElement() {
668
+ // Get the shadow root that contains this le-component
669
+ const rootNode = this.el.getRootNode();
670
+ if (rootNode instanceof ShadowRoot) {
671
+ // The host of this shadow root is our target component (e.g., le-card)
672
+ this.hostElement = rootNode.host;
673
+ }
674
+ }
675
+ componentDidLoad() {
676
+ // Read initial property values from the host element
677
+ this.readPropertyValues();
678
+ }
679
+ disconnectedCallback() {
680
+ this.disconnectModeObserver?.();
681
+ }
682
+ /**
683
+ * Formats a tag name into a display name
684
+ * e.g., 'le-card' -> 'Card'
685
+ */
686
+ formatDisplayName(tagName) {
687
+ return tagName
688
+ .replace(/^le-/, '') // Remove 'le-' prefix
689
+ .split('-')
690
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
691
+ .join(' ');
692
+ }
693
+ /**
694
+ * Load component metadata from the Custom Elements Manifest
695
+ */
696
+ async loadComponentMetadata() {
697
+ try {
698
+ // Fetch the manifest from configured URL
699
+ const { manifestUrl } = getLeKitConfig();
700
+ const manifestUrlResolved = manifestUrl.startsWith('/')
701
+ ? getAssetPath(`./assets${manifestUrl}`)
702
+ : manifestUrl;
703
+ const response = await fetch(manifestUrlResolved);
704
+ const manifest = await response.json();
705
+ // Find the component definition
706
+ for (const module of manifest.modules) {
707
+ for (const declaration of module.declarations || []) {
708
+ if (declaration.tagName === this.component) {
709
+ const attributes = (declaration.attributes || []).filter((attr) => !this.isInternalAttribute(attr.name));
710
+ this.componentMeta = {
711
+ tagName: declaration.tagName,
712
+ description: declaration.description,
713
+ attributes,
714
+ };
715
+ // console.log(`[le-component] Loaded metadata for ${this.component}:`, this.componentMeta);
716
+ // Read property values after metadata is loaded
717
+ this.readPropertyValues();
718
+ return;
719
+ }
720
+ }
721
+ }
722
+ // console.warn(`[le-component] No metadata found for component: ${this.component}`);
723
+ }
724
+ catch (error) {
725
+ // console.warn(`[le-component] Failed to load metadata for component: ${this.component}`, error);
726
+ }
727
+ }
728
+ /**
729
+ * Check if an attribute is internal (should not be shown in editor)
730
+ */
731
+ isInternalAttribute(name) {
732
+ const internalAttrs = ['mode', 'theme', 'class', 'style', 'id', 'slot'];
733
+ return internalAttrs.includes(name);
734
+ }
735
+ /**
736
+ * Read current property values from the host element
737
+ */
738
+ readPropertyValues() {
739
+ if (!this.hostElement || !this.componentMeta)
740
+ return;
741
+ const values = {};
742
+ for (const attr of this.componentMeta.attributes) {
743
+ const value = this.hostElement.getAttribute(attr.name);
744
+ values[attr.name] = this.parseAttributeValue(value, attr.type?.text);
745
+ }
746
+ this.propertyValues = values;
747
+ }
748
+ /**
749
+ * Parse an attribute value based on its type
750
+ */
751
+ parseAttributeValue(value, type) {
752
+ if (value === null)
753
+ return undefined;
754
+ if (type === 'boolean') {
755
+ return value !== null && value !== 'false';
756
+ }
757
+ if (type === 'number') {
758
+ return parseFloat(value);
759
+ }
760
+ return value;
761
+ }
762
+ /**
763
+ * Handle property value changes from the editor
764
+ */
765
+ handlePropertyChange(attrName, value, type) {
766
+ if (!this.hostElement)
767
+ return;
768
+ // Update the host element's attribute
769
+ if (type === 'boolean') {
770
+ if (value) {
771
+ this.hostElement.setAttribute(attrName, '');
772
+ }
773
+ else {
774
+ this.hostElement.removeAttribute(attrName);
775
+ }
776
+ }
777
+ else if (value === undefined || value === '') {
778
+ this.hostElement.removeAttribute(attrName);
779
+ }
780
+ else {
781
+ this.hostElement.setAttribute(attrName, String(value));
782
+ }
783
+ // Update local state
784
+ this.propertyValues = { ...this.propertyValues, [attrName]: value };
785
+ }
786
+ /**
787
+ * Delete this component from the DOM
788
+ */
789
+ deleteComponent() {
790
+ if (!this.hostElement)
791
+ return;
792
+ // Confirm deletion
793
+ const name = this.displayName || this.formatDisplayName(this.component);
794
+ if (!confirm(`Delete this ${name}?`))
795
+ return;
796
+ // Remove the host element from its parent
797
+ const parent = this.hostElement.parentElement;
798
+ if (parent) {
799
+ this.hostElement.remove();
800
+ }
801
+ }
802
+ /**
803
+ * Render the property editor form
804
+ */
805
+ renderPropertyEditor() {
806
+ const hasProperties = this.componentMeta && this.componentMeta.attributes.length > 0;
807
+ return (h("div", { class: "property-editor-container" }, hasProperties ? (h("form", { class: "property-editor", onSubmit: e => e.preventDefault() }, this.componentMeta.attributes.map(attr => this.renderPropertyField(attr)))) : (h("p", { class: "no-properties" }, "No editable properties")), h("div", { class: "property-editor-actions" }, h("le-button", { type: "button", variant: "outlined", color: "danger", "full-width": true, onClick: () => this.deleteComponent() }, h("span", { slot: "icon-start" }, "\uD83D\uDDD1\uFE0F"), h("span", null, "Delete Component")))));
808
+ }
809
+ /**
810
+ * Render a single property field based on its type
811
+ */
812
+ renderPropertyField(attr) {
813
+ const value = this.propertyValues[attr.name];
814
+ const type = attr.type?.text || 'string';
815
+ // Check if type is a union of string literals (e.g., "'default' | 'outlined' | 'elevated'")
816
+ const enumMatch = type.match(/^'[^']+'/);
817
+ if (enumMatch) {
818
+ const options = type.split('|').map(opt => opt.trim().replace(/'/g, ''));
819
+ return (h("div", { class: "property-field" }, h("label", { htmlFor: `prop-${attr.name}` }, attr.name, attr.description && h("span", { class: "property-hint" }, attr.description)), h("select", { id: `prop-${attr.name}`, onChange: e => this.handlePropertyChange(attr.name, e.target.value, type) }, options.map(opt => (h("option", { value: opt, selected: value === opt || (!value && attr.default?.replace(/'/g, '') === opt) }, opt))))));
820
+ }
821
+ // Boolean type
822
+ if (type === 'boolean') {
823
+ return (h("div", { class: "property-field property-field--checkbox" }, h("le-checkbox", { name: `prop-${attr.name}`, checked: value === true || value === '', onChange: e => this.handlePropertyChange(attr.name, e.target.checked, type) }, attr.name, attr.description && h("div", { slot: "description" }, attr.description))));
824
+ }
825
+ // Number type
826
+ if (type === 'number') {
827
+ return (h("div", { class: "property-field" }, h("label", { htmlFor: `prop-${attr.name}` }, attr.name, attr.description && h("span", { class: "property-hint" }, attr.description)), h("input", { type: "number", id: `prop-${attr.name}`, value: value ?? '', placeholder: attr.default, onChange: e => this.handlePropertyChange(attr.name, e.target.value, type) })));
828
+ }
829
+ // Default: string/text input
830
+ return (h("div", { class: "property-field" }, h("le-string-input", { name: `prop-${attr.name}`, label: attr.name, value: value ?? '', placeholder: attr.default?.replace(/'/g, ''), onChange: (e) => this.handlePropertyChange(attr.name, e.detail.value, type) }, h("span", { slot: "description" }, attr.description))));
831
+ }
832
+ render() {
833
+ const name = this.displayName || this.formatDisplayName(this.component);
834
+ // In default mode, just pass through content with host classes
835
+ if (!this.adminMode) {
836
+ return (h(Host, { class: classnames(this.component, this.hostClass), style: this.hostStyle }, h("slot", null)));
837
+ }
838
+ // In admin mode, show wrapper with header and settings
839
+ return (h(Host, { class: classnames(this.component, this.hostClass, 'admin-mode'), style: this.hostStyle }, h("div", { class: "le-component-wrapper" }, h("div", { class: "le-component-header" }, h("span", { class: "le-component-name" }, name), h("le-popover", { popoverTitle: `${name} Settings`, position: "right", align: "start", "min-width": "300px", mode: "default" }, h("le-button", { type: "button", class: "le-component-button", slot: "trigger", variant: "clear", size: "small", "aria-label": "Edit component properties", "icon-only": true }, h("span", { class: "le-component-trigger", slot: "icon-only" }, "\u2699")), this.renderPropertyEditor())), h("div", { class: "le-component-content" }, h("slot", null)))));
840
+ }
841
+ static get style() { return leComponentCss; }
842
+ }, [769, "le-component", {
843
+ "component": [1],
844
+ "displayName": [1, "display-name"],
845
+ "hostClass": [1, "host-class"],
846
+ "hostStyle": [16],
847
+ "adminMode": [32],
848
+ "componentMeta": [32],
849
+ "propertyValues": [32]
850
+ }]);
851
+ function defineCustomElement$2() {
852
+ if (typeof customElements === "undefined") {
853
+ return;
854
+ }
855
+ const components = ["le-component", "le-button", "le-checkbox", "le-component", "le-popover", "le-slot", "le-string-input"];
856
+ components.forEach(tagName => { switch (tagName) {
857
+ case "le-component":
858
+ if (!customElements.get(tagName)) {
859
+ customElements.define(tagName, LeComponent);
860
+ }
861
+ break;
862
+ case "le-button":
863
+ if (!customElements.get(tagName)) {
864
+ defineCustomElement();
865
+ }
866
+ break;
867
+ case "le-checkbox":
868
+ if (!customElements.get(tagName)) {
869
+ defineCustomElement$1();
870
+ }
871
+ break;
872
+ case "le-component":
873
+ if (!customElements.get(tagName)) {
874
+ defineCustomElement$2();
875
+ }
876
+ break;
877
+ case "le-popover":
878
+ if (!customElements.get(tagName)) {
879
+ defineCustomElement$5();
880
+ }
881
+ break;
882
+ case "le-slot":
883
+ if (!customElements.get(tagName)) {
884
+ defineCustomElement$3();
885
+ }
886
+ break;
887
+ case "le-string-input":
888
+ if (!customElements.get(tagName)) {
889
+ defineCustomElement$4();
890
+ }
891
+ break;
892
+ } });
893
+ }
894
+
895
+ const leCheckboxCss = ":host{display:block;--le-checkbox-size:18px;--le-checkbox-color:var(--le-color-primary, #007bff);--le-checkbox-label-color:var(--le-color-text-primary, #333);--le-checkbox-desc-color:var(--le-color-text-secondary, #666);--le-checkbox-border-radius:var(--le-radius-sm, 2px);--le-checkbox-marker-color:var(--le-color-surface, #fff)}.le-checkbox-wrapper{display:flex;flex-direction:column;gap:4px}.le-checkbox-label{display:inline-flex;align-items:flex-start;gap:8px;cursor:pointer;user-select:none}:host([disabled]) .le-checkbox-label{cursor:not-allowed;opacity:0.6}.le-checkbox-input{display:flex;align-items:center;justify-content:center;min-height:1.4em}input[type=\"checkbox\"]{appearance:none;-webkit-appearance:none;width:var(--le-checkbox-size);height:var(--le-checkbox-size);border:var(--le-border-width, 2px) solid var(--le-checkbox-color);border-radius:var(--le-checkbox-border-radius);margin:0;margin-top:2px;position:relative;cursor:inherit;background-color:transparent;transition:background-color 0.2s, border-color 0.2s}input[type=\"checkbox\"]:checked{background-color:var(--le-checkbox-color)}input[type=\"checkbox\"]:checked::after{content:'';position:absolute;left:0;top:0;bottom:calc(var(--le-checkbox-size) / 5);right:0;margin:auto;width:calc(var(--le-checkbox-size) / 4);height:calc(var(--le-checkbox-size) / 2);border:solid var(--le-checkbox-marker-color, #fff);border-width:0 calc(var(--le-checkbox-size) / 10) calc(var(--le-checkbox-size) / 10) 0;transform:rotate(45deg)}input[type=\"checkbox\"]:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.le-checkbox-text{flex:1;flex-wrap:wrap;color:var(--le-checkbox-label-color);line-height:1.5;text-align:start}.le-checkbox-description{margin-left:calc(var(--le-checkbox-size) + 8px);font-size:0.875em;color:var(--le-checkbox-desc-color);line-height:1.4}:host [slot=\"description\"]{margin:0}";
896
+
897
+ const LeCheckbox = /*@__PURE__*/ proxyCustomElement(class LeCheckbox extends HTMLElement {
898
+ constructor(registerHost) {
899
+ super();
900
+ if (registerHost !== false) {
901
+ this.__registerHost();
902
+ }
903
+ this.__attachShadow();
904
+ this.leChange = createEvent(this, "change", 7);
905
+ }
906
+ get el() { return this; }
907
+ /**
908
+ * Whether the checkbox is checked
909
+ */
910
+ checked = false;
911
+ /**
912
+ * Whether the checkbox is disabled
913
+ */
914
+ disabled = false;
915
+ /**
916
+ * The name of the checkbox input
917
+ */
918
+ name;
919
+ /**
920
+ * The value of the checkbox input
921
+ */
922
+ value;
923
+ /**
924
+ * External ID for linking with external systems (e.g. database ID, PDF form field ID)
925
+ */
926
+ externalId;
927
+ /**
928
+ * Emitted when the checked state changes
929
+ */
930
+ leChange;
931
+ handleChange = (event) => {
932
+ // We stop the internal button click from bubbling up
933
+ event.stopPropagation();
934
+ if (this.disabled) {
935
+ event.preventDefault();
936
+ return;
937
+ }
938
+ const input = event.target;
939
+ this.checked = input.checked;
940
+ this.leChange.emit({
941
+ checked: this.checked,
942
+ value: this.value,
943
+ name: this.name,
944
+ externalId: this.externalId
945
+ });
946
+ };
947
+ render() {
948
+ return (h("le-component", { key: '43399929e07835e0019d509803e50a151921fa72', component: "le-checkbox", hostClass: classnames({ 'disabled': this.disabled }) }, h("div", { key: '7ddbf2ac1690bb09082adfea70b9767c972d007a', class: "le-checkbox-wrapper" }, h("label", { key: '8eec4055c713e8b3b155695751b10bff64c9f903', class: "le-checkbox-label" }, h("span", { key: '2118b1cbe7911ff1674e522d723949d81cade185', class: "le-checkbox-input" }, h("input", { key: 'd0a30af5c14497fa6fa294c07ba74ae2e032481f', type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, onChange: this.handleChange })), h("span", { key: '02cf9588431240039a53ee50e02b08ba5d63b974', class: "le-checkbox-text" }, h("le-slot", { key: 'e7d7b253deab72e627164eb72fc06109abfca6a5', name: "", type: "text", tag: "span" }, h("slot", { key: '1d8c443073e48848513a8a6d04cd7805a394e54e' })))), h("div", { key: '16c2c927dc0c0f7844a203a0628bf0e561009bd0', class: "le-checkbox-description" }, h("le-slot", { key: 'c6898ecc8992dce4786e68ab4b136bf5c3a4d3aa', name: "description", type: "text", tag: "div", label: "Description" }, h("slot", { key: '3342add8ed1400ab74681e445163eeb3dd415941', name: "description" }))))));
949
+ }
950
+ static get style() { return leCheckboxCss; }
951
+ }, [769, "le-checkbox", {
952
+ "checked": [1540],
953
+ "disabled": [4],
954
+ "name": [1],
955
+ "value": [1],
956
+ "externalId": [1, "external-id"]
957
+ }]);
958
+ function defineCustomElement$1() {
959
+ if (typeof customElements === "undefined") {
960
+ return;
961
+ }
962
+ const components = ["le-checkbox", "le-button", "le-checkbox", "le-component", "le-popover", "le-slot", "le-string-input"];
963
+ components.forEach(tagName => { switch (tagName) {
964
+ case "le-checkbox":
965
+ if (!customElements.get(tagName)) {
966
+ customElements.define(tagName, LeCheckbox);
967
+ }
968
+ break;
969
+ case "le-button":
970
+ if (!customElements.get(tagName)) {
971
+ defineCustomElement();
972
+ }
973
+ break;
974
+ case "le-checkbox":
975
+ if (!customElements.get(tagName)) {
976
+ defineCustomElement$1();
977
+ }
978
+ break;
979
+ case "le-component":
980
+ if (!customElements.get(tagName)) {
981
+ defineCustomElement$2();
982
+ }
983
+ break;
984
+ case "le-popover":
985
+ if (!customElements.get(tagName)) {
986
+ defineCustomElement$5();
987
+ }
988
+ break;
989
+ case "le-slot":
990
+ if (!customElements.get(tagName)) {
991
+ defineCustomElement$3();
992
+ }
993
+ break;
994
+ case "le-string-input":
995
+ if (!customElements.get(tagName)) {
996
+ defineCustomElement$4();
997
+ }
998
+ break;
999
+ } });
1000
+ }
1001
+
1002
+ const leButtonDefaultCss = ":host{display:inline-block;--le-button-border-radius:var(--le-radius-md);--le-button-padding-x:0.4rem;--le-button-padding-y:0.4rem;--le-button-small-padding:0.25rem;--le-button-font-size:var(--le-font-size-md);--le-button-font-weight:var(--le-font-weight-medium);--le-button-transition:var(--le-transition-fast);--le-button-icon-aspect-ratio:1;--_btn-bg:var(--le-color-primary);--_btn-bg-hover:var(--le-color-primary-dark);--_btn-bg-system:var(--le-color-black);--_btn-color:var(--le-color-primary-contrast);--_btn-border-color:var(--le-color-primary)}:host([full-width]){display:block;width:100%}.button{display:inline-flex;align-items:center;justify-content:center;gap:var(--le-spacing-3);width:100%;padding:var(--le-button-padding-y) var(--le-button-padding-x);border:1px solid var(--_btn-border-color);border-radius:var(--le-button-border-radius);background:var(--_btn-bg);color:var(--_btn-color);font-family:var(--le-font-family-base);font-size:var(--le-button-font-size);font-weight:var(--le-button-font-weight);line-height:var(--le-line-height-tight);text-decoration:none;cursor:pointer;transition:background-color var(--le-button-transition) var(--le-transition-easing),\n border-color var(--le-button-transition) var(--le-transition-easing),\n box-shadow var(--le-button-transition) var(--le-transition-easing),\n transform var(--le-button-transition) var(--le-transition-easing)}.button:hover:not(:disabled){background:var(--_btn-bg-hover);border-color:var(--_btn-bg-hover)}.button:active:not(:disabled){transform:translateY(1px)}.button:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.button:disabled{opacity:0.5;cursor:not-allowed}:host>le-component.color-primary{--_btn-bg:var(--le-color-primary);--_btn-bg-hover:var(--le-color-primary-dark);--_btn-color:var(--le-color-primary-contrast);--_btn-border-color:var(--le-color-primary)}:host>le-component.color-secondary{--_btn-bg:var(--le-color-secondary);--_btn-bg-hover:var(--le-color-secondary-dark);--_btn-color:var(--le-color-secondary-contrast);--_btn-border-color:var(--le-color-secondary)}:host>le-component.color-success{--_btn-bg:var(--le-color-success);--_btn-bg-hover:var(--le-color-success-dark);--_btn-color:var(--le-color-success-contrast);--_btn-border-color:var(--le-color-success)}:host>le-component.color-warning{--_btn-bg:var(--le-color-warning);--_btn-bg-hover:var(--le-color-warning-dark);--_btn-color:var(--le-color-warning-contrast);--_btn-border-color:var(--le-color-warning)}:host>le-component.color-danger{--_btn-bg:var(--le-color-danger);--_btn-bg-hover:var(--le-color-danger-dark);--_btn-color:var(--le-color-danger-contrast);--_btn-border-color:var(--le-color-danger)}:host>le-component.color-info{--_btn-bg:var(--le-color-info);--_btn-bg-hover:var(--le-color-info-dark);--_btn-color:var(--le-color-info-contrast);--_btn-border-color:var(--le-color-info)}:host>le-component.variant-solid .button{box-shadow:var(--le-shadow-sm)}:host>le-component.variant-solid .button:hover:not(:disabled){box-shadow:var(--le-shadow-md)}:host>le-component.variant-outlined .button{background:transparent;color:var(--_btn-bg);border-color:var(--_btn-border-color)}:host>le-component.variant-outlined .button:hover:not(:disabled){background:var(--_btn-bg);color:var(--_btn-color)}:host>le-component.variant-clear .button{background:transparent;color:var(--_btn-bg);border-color:transparent}:host>le-component.variant-clear .button:hover:not(:disabled){background:var(--le-color-gray-100);border-color:transparent}:host>le-component.variant-system .button{background:transparent;color:var(--_btn-bg-system);border-color:transparent}:host>le-component.size-small .button{--le-button-padding-x:0.4rem;--le-button-padding-y:0.3rem;--le-button-padding-top:0.35rem;--le-button-font-size:var(--le-button-small-font-size, var(--le-font-size-xs))}:host>le-component.size-large .button{--le-button-padding-x:0.9rem;--le-button-padding-y:0.6rem;--le-button-font-size:var(--le-font-size-xl)}:host>le-component.full-width{display:block;width:100%}:host>le-component.selected .button{box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.2)}:host>le-component.variant-outlined.selected .button,:host>le-component.variant-clear.selected .button{background:var(--_btn-bg);color:var(--_btn-color)}:host>le-component.icon-only .button{padding:0.5rem;padding-bottom:0.6rem;aspect-ratio:var(--le-button-icon-aspect-ratio, 1)}:host>le-component.icon-only.size-small .button{padding:var(--le-button-small-padding, 0.25rem)}:host>le-component.icon-only.size-large .button{padding:0.75rem}:host>le-component.icon-only .content{display:none}.content{display:inline}.content:empty{display:none}.icon-start,.icon-only,.icon-end{display:flex;align-items:center;justify-content:center}.icon-start:empty,.icon-only:empty,.icon-end:empty{display:none}::slotted([slot=\"icon-start\"]),::slotted([slot=\"icon-only\"]),::slotted([slot=\"icon-end\"]){display:flex;align-items:center;justify-content:center;width:1.125em;height:1.125em}";
1003
+
1004
+ const LeButton = /*@__PURE__*/ proxyCustomElement(class LeButton extends HTMLElement {
1005
+ constructor(registerHost) {
1006
+ super();
1007
+ if (registerHost !== false) {
1008
+ this.__registerHost();
1009
+ }
1010
+ this.__attachShadow();
1011
+ this.leClick = createEvent(this, "click", 7);
1012
+ }
1013
+ get el() { return this; }
1014
+ /**
1015
+ * Mode of the popover should be 'default' for internal use
1016
+ */
1017
+ mode;
1018
+ /**
1019
+ * Button variant style
1020
+ * @allowedValues solid | outlined | clear
1021
+ */
1022
+ variant = 'solid';
1023
+ /**
1024
+ * Button color theme (uses theme semantic colors)
1025
+ * @allowedValues primary | secondary | success | warning | danger | info
1026
+ */
1027
+ color = 'primary';
1028
+ /**
1029
+ * Button size
1030
+ * @allowedValues small | medium | large
1031
+ */
1032
+ size = 'medium';
1033
+ /**
1034
+ * Whether the button is in a selected/active state
1035
+ */
1036
+ selected = false;
1037
+ /**
1038
+ * Whether the button takes full width of its container
1039
+ */
1040
+ fullWidth = false;
1041
+ /**
1042
+ * Whether the button displays only an icon (square aspect ratio)
1043
+ */
1044
+ iconOnly = false;
1045
+ /**
1046
+ * Whether the button is disabled
1047
+ */
1048
+ disabled = false;
1049
+ /**
1050
+ * The button type attribute
1051
+ * @allowedValues button | submit | reset
1052
+ */
1053
+ type = 'button';
1054
+ /**
1055
+ * Optional href to make the button act as a link
1056
+ */
1057
+ href;
1058
+ /**
1059
+ * Link target when href is set
1060
+ */
1061
+ target;
1062
+ /**
1063
+ * Emitted when the button is clicked.
1064
+ * This is a custom event that wraps the native click but ensures the target is the le-button.
1065
+ */
1066
+ leClick;
1067
+ handleClick = (event) => {
1068
+ // We stop the internal button click from bubbling up
1069
+ event.stopPropagation();
1070
+ if (this.disabled) {
1071
+ event.preventDefault();
1072
+ return;
1073
+ }
1074
+ // And emit our own click event from the host element
1075
+ this.leClick.emit(event);
1076
+ };
1077
+ render() {
1078
+ const classes = classnames(`variant-${this.variant}`, `color-${this.color}`, `size-${this.size}`, {
1079
+ 'selected': this.selected,
1080
+ 'full-width': this.fullWidth,
1081
+ 'icon-only': this.iconOnly,
1082
+ 'disabled': this.disabled,
1083
+ });
1084
+ const TagType = this.href ? 'a' : 'button';
1085
+ const attrs = this.href ? { href: this.href, target: this.target, role: 'button' } : { type: this.type, disabled: this.disabled };
1086
+ return (h("le-component", { key: '363dbfddf4a765bfd6f36ed16d0912e281153806', component: "le-button", hostClass: classes }, h(TagType, { key: 'e112acdff4278e976ad767bd1ea7c9ced5e85f43', class: "button", part: "button", ...attrs, onClick: this.handleClick }, this.iconOnly ? (h("span", { class: "icon-start" }, h("slot", { name: "icon-only" }))) : (h(Fragment, null, h("span", { class: "icon-start" }, h("slot", { name: "icon-start" })), h("le-slot", { name: "", description: "Button text", type: "text", class: "content", part: "content" }, h("slot", null)), h("span", { class: "icon-end" }, h("slot", { name: "icon-end" })))))));
1087
+ }
1088
+ static get style() { return leButtonDefaultCss; }
1089
+ }, [769, "le-button", {
1090
+ "mode": [1537],
1091
+ "variant": [1],
1092
+ "color": [1],
1093
+ "size": [1],
1094
+ "selected": [4],
1095
+ "fullWidth": [516, "full-width"],
1096
+ "iconOnly": [4, "icon-only"],
1097
+ "disabled": [4],
1098
+ "type": [1],
1099
+ "href": [1],
1100
+ "target": [1]
1101
+ }]);
1102
+ function defineCustomElement() {
1103
+ if (typeof customElements === "undefined") {
1104
+ return;
1105
+ }
1106
+ const components = ["le-button", "le-button", "le-checkbox", "le-component", "le-popover", "le-slot", "le-string-input"];
1107
+ components.forEach(tagName => { switch (tagName) {
1108
+ case "le-button":
1109
+ if (!customElements.get(tagName)) {
1110
+ customElements.define(tagName, LeButton);
1111
+ }
1112
+ break;
1113
+ case "le-button":
1114
+ if (!customElements.get(tagName)) {
1115
+ defineCustomElement();
1116
+ }
1117
+ break;
1118
+ case "le-checkbox":
1119
+ if (!customElements.get(tagName)) {
1120
+ defineCustomElement$1();
1121
+ }
1122
+ break;
1123
+ case "le-component":
1124
+ if (!customElements.get(tagName)) {
1125
+ defineCustomElement$2();
1126
+ }
1127
+ break;
1128
+ case "le-popover":
1129
+ if (!customElements.get(tagName)) {
1130
+ defineCustomElement$5();
1131
+ }
1132
+ break;
1133
+ case "le-slot":
1134
+ if (!customElements.get(tagName)) {
1135
+ defineCustomElement$3();
1136
+ }
1137
+ break;
1138
+ case "le-string-input":
1139
+ if (!customElements.get(tagName)) {
1140
+ defineCustomElement$4();
1141
+ }
1142
+ break;
1143
+ } });
1144
+ }
1145
+
1146
+ export { LeButton as L, defineCustomElement$3 as a, defineCustomElement$2 as b, defineCustomElement$1 as c, defineCustomElement$4 as d, defineCustomElement as e, LeCheckbox as f, LeComponent as g, LeSlot as h, LeStringInput as i };
1147
+ //# sourceMappingURL=le-button2.js.map
1148
+
1149
+ //# sourceMappingURL=le-button2.js.map