@nuraly/lumenui 0.1.0 → 0.2.1

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 (312) hide show
  1. package/dist/nuralyui.bundle.js +23024 -17355
  2. package/dist/nuralyui.bundle.js.gz +0 -0
  3. package/dist/src/components/alert/alert.component.d.ts +8 -5
  4. package/dist/src/components/alert/alert.component.js +24 -20
  5. package/dist/src/components/alert/alert.style.d.ts +0 -7
  6. package/dist/src/components/alert/alert.style.js +48 -90
  7. package/dist/src/components/alert/bundle.js +82 -108
  8. package/dist/src/components/alert/bundle.js.gz +0 -0
  9. package/dist/src/components/badge/badge.component.d.ts +9 -8
  10. package/dist/src/components/badge/badge.component.js +17 -14
  11. package/dist/src/components/badge/badge.style.d.ts +0 -7
  12. package/dist/src/components/badge/badge.style.js +49 -107
  13. package/dist/src/components/badge/bundle.js +81 -119
  14. package/dist/src/components/badge/bundle.js.gz +0 -0
  15. package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +8 -10
  16. package/dist/src/components/breadcrumb/breadcrumb.component.js +16 -15
  17. package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +0 -7
  18. package/dist/src/components/breadcrumb/breadcrumb.style.js +42 -60
  19. package/dist/src/components/breadcrumb/bundle.js +96 -93
  20. package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
  21. package/dist/src/components/button/bundle.js +221 -470
  22. package/dist/src/components/button/bundle.js.gz +0 -0
  23. package/dist/src/components/button/button.component.d.ts +2 -1
  24. package/dist/src/components/button/button.component.js +6 -6
  25. package/dist/src/components/button/button.style.d.ts +0 -7
  26. package/dist/src/components/button/button.style.js +167 -433
  27. package/dist/src/components/canvas/base-canvas.component.d.ts +2 -1
  28. package/dist/src/components/canvas/base-canvas.component.js +1 -0
  29. package/dist/src/components/canvas/bundle.js +16919 -9595
  30. package/dist/src/components/canvas/bundle.js.gz +0 -0
  31. package/dist/src/components/canvas/canvas.constants.d.ts +1 -1
  32. package/dist/src/components/canvas/canvas.constants.js +1 -1
  33. package/dist/src/components/canvas/chatbot-panel.style.js +31 -31
  34. package/dist/src/components/canvas/index.d.ts +2 -0
  35. package/dist/src/components/canvas/index.js +3 -0
  36. package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +3 -1
  37. package/dist/src/components/canvas/whiteboard-canvas.component.js +19 -1
  38. package/dist/src/components/canvas/whiteboard-canvas.style.js +159 -138
  39. package/dist/src/components/canvas/whiteboard-node.component.d.ts +2 -1
  40. package/dist/src/components/canvas/whiteboard-node.component.js +2 -1
  41. package/dist/src/components/canvas/whiteboard-node.style.js +44 -44
  42. package/dist/src/components/canvas/workflow-canvas-only.d.ts +4 -0
  43. package/dist/src/components/canvas/workflow-canvas-only.js +5 -0
  44. package/dist/src/components/canvas/workflow-canvas.component.d.ts +3 -1
  45. package/dist/src/components/canvas/workflow-canvas.component.js +24 -2
  46. package/dist/src/components/canvas/workflow-canvas.style.js +776 -648
  47. package/dist/src/components/canvas/workflow-canvas.types.d.ts +113 -4
  48. package/dist/src/components/canvas/workflow-canvas.types.js +646 -3
  49. package/dist/src/components/canvas/workflow-node.component.d.ts +3 -2
  50. package/dist/src/components/canvas/workflow-node.component.js +5 -5
  51. package/dist/src/components/canvas/workflow-node.style.js +183 -181
  52. package/dist/src/components/card/bundle.js +43 -35
  53. package/dist/src/components/card/bundle.js.gz +0 -0
  54. package/dist/src/components/card/card.component.d.ts +6 -1
  55. package/dist/src/components/card/card.component.js +8 -2
  56. package/dist/src/components/card/card.style.js +26 -30
  57. package/dist/src/components/carousel/bundle.js +8 -8
  58. package/dist/src/components/carousel/bundle.js.gz +0 -0
  59. package/dist/src/components/carousel/carousel.component.d.ts +12 -0
  60. package/dist/src/components/carousel/carousel.component.js +16 -4
  61. package/dist/src/components/chatbot/bundle.js +422 -406
  62. package/dist/src/components/chatbot/bundle.js.gz +0 -0
  63. package/dist/src/components/chatbot/chatbot.component.d.ts +2 -1
  64. package/dist/src/components/chatbot/chatbot.component.js +1 -0
  65. package/dist/src/components/chatbot/chatbot.style.js +277 -277
  66. package/dist/src/components/checkbox/bundle.js +86 -245
  67. package/dist/src/components/checkbox/bundle.js.gz +0 -0
  68. package/dist/src/components/checkbox/checkbox.component.d.ts +5 -2
  69. package/dist/src/components/checkbox/checkbox.component.js +11 -13
  70. package/dist/src/components/checkbox/checkbox.style.js +56 -231
  71. package/dist/src/components/code-editor/bundle.js +151 -25
  72. package/dist/src/components/code-editor/bundle.js.gz +0 -0
  73. package/dist/src/components/code-editor/code-editor.component.d.ts +18 -56
  74. package/dist/src/components/code-editor/code-editor.component.js +141 -394
  75. package/dist/src/components/code-editor/code-editor.style.js +139 -15
  76. package/dist/src/components/collapse/bundle.js +97 -84
  77. package/dist/src/components/collapse/bundle.js.gz +0 -0
  78. package/dist/src/components/collapse/collapse.component.d.ts +7 -1
  79. package/dist/src/components/collapse/collapse.component.js +11 -2
  80. package/dist/src/components/collapse/collapse.style.js +60 -60
  81. package/dist/src/components/colorpicker/bundle.js +85 -48
  82. package/dist/src/components/colorpicker/bundle.js.gz +0 -0
  83. package/dist/src/components/colorpicker/color-holder.component.d.ts +2 -4
  84. package/dist/src/components/colorpicker/color-holder.component.js +5 -6
  85. package/dist/src/components/colorpicker/color-holder.style.js +11 -11
  86. package/dist/src/components/colorpicker/color-picker.component.d.ts +2 -1
  87. package/dist/src/components/colorpicker/color-picker.component.js +1 -0
  88. package/dist/src/components/colorpicker/color-picker.style.js +12 -12
  89. package/dist/src/components/colorpicker/default-color-sets.component.d.ts +2 -2
  90. package/dist/src/components/colorpicker/default-color-sets.component.js +4 -3
  91. package/dist/src/components/colorpicker/default-color-sets.style.js +5 -5
  92. package/dist/src/components/container/bundle.js +24 -14
  93. package/dist/src/components/container/bundle.js.gz +0 -0
  94. package/dist/src/components/container/container.component.d.ts +4 -1
  95. package/dist/src/components/container/container.component.js +7 -5
  96. package/dist/src/components/container/container.style.js +9 -9
  97. package/dist/src/components/datepicker/bundle.js +193 -177
  98. package/dist/src/components/datepicker/bundle.js.gz +0 -0
  99. package/dist/src/components/datepicker/datepicker.component.d.ts +2 -1
  100. package/dist/src/components/datepicker/datepicker.component.js +1 -0
  101. package/dist/src/components/datepicker/datepicker.style.js +65 -65
  102. package/dist/src/components/datepicker/datepicker.style.variables.js +91 -91
  103. package/dist/src/components/db-connection-select/bundle.js +7 -6
  104. package/dist/src/components/db-connection-select/bundle.js.gz +0 -0
  105. package/dist/src/components/db-connection-select/db-connection-select.component.d.ts +3 -0
  106. package/dist/src/components/db-connection-select/db-connection-select.component.js +4 -0
  107. package/dist/src/components/divider/bundle.js +61 -35
  108. package/dist/src/components/divider/bundle.js.gz +0 -0
  109. package/dist/src/components/divider/divider.component.d.ts +4 -6
  110. package/dist/src/components/divider/divider.component.js +10 -14
  111. package/dist/src/components/divider/divider.style.js +41 -31
  112. package/dist/src/components/document/bundle.js +50 -48
  113. package/dist/src/components/document/bundle.js.gz +0 -0
  114. package/dist/src/components/document/document.component.d.ts +12 -1
  115. package/dist/src/components/document/document.component.js +18 -6
  116. package/dist/src/components/document/document.style.js +21 -36
  117. package/dist/src/components/dropdown/bundle.js +117 -101
  118. package/dist/src/components/dropdown/bundle.js.gz +0 -0
  119. package/dist/src/components/dropdown/dropdown.component.d.ts +2 -1
  120. package/dist/src/components/dropdown/dropdown.component.js +1 -0
  121. package/dist/src/components/dropdown/dropdown.style.js +68 -68
  122. package/dist/src/components/file-upload/bundle.js +82 -76
  123. package/dist/src/components/file-upload/bundle.js.gz +0 -0
  124. package/dist/src/components/file-upload/file-upload.component.d.ts +2 -1
  125. package/dist/src/components/file-upload/file-upload.component.js +1 -0
  126. package/dist/src/components/file-upload/styles.js +59 -59
  127. package/dist/src/components/flex/bundle.js +18 -8
  128. package/dist/src/components/flex/bundle.js.gz +0 -0
  129. package/dist/src/components/flex/flex.component.d.ts +4 -1
  130. package/dist/src/components/flex/flex.component.js +7 -4
  131. package/dist/src/components/flex/flex.style.js +2 -2
  132. package/dist/src/components/form/bundle.js +22 -10
  133. package/dist/src/components/form/bundle.js.gz +0 -0
  134. package/dist/src/components/form/form.component.d.ts +4 -1
  135. package/dist/src/components/form/form.component.js +5 -1
  136. package/dist/src/components/form/form.style.js +2 -2
  137. package/dist/src/components/grid/bundle.js +26 -14
  138. package/dist/src/components/grid/bundle.js.gz +0 -0
  139. package/dist/src/components/grid/col.component.d.ts +4 -1
  140. package/dist/src/components/grid/col.component.js +4 -1
  141. package/dist/src/components/grid/col.style.js +2 -2
  142. package/dist/src/components/grid/row.component.d.ts +4 -1
  143. package/dist/src/components/grid/row.component.js +4 -1
  144. package/dist/src/components/grid/row.style.js +2 -2
  145. package/dist/src/components/icon/bundle.js +78 -252
  146. package/dist/src/components/icon/bundle.js.gz +0 -0
  147. package/dist/src/components/icon/icon-paths.d.ts +2 -0
  148. package/dist/src/components/icon/icon-paths.js +141 -0
  149. package/dist/src/components/icon/icon.component.d.ts +10 -12
  150. package/dist/src/components/icon/icon.component.js +42 -93
  151. package/dist/src/components/icon/icon.style.js +42 -130
  152. package/dist/src/components/icon/icon.variables.js +9 -9
  153. package/dist/src/components/iconpicker/bundle.js +859 -1511
  154. package/dist/src/components/iconpicker/bundle.js.gz +0 -0
  155. package/dist/src/components/iconpicker/icon-picker.component.d.ts +2 -1
  156. package/dist/src/components/iconpicker/icon-picker.component.js +1 -0
  157. package/dist/src/components/iconpicker/icon-picker.style.js +13 -13
  158. package/dist/src/components/image/bundle.js +43 -33
  159. package/dist/src/components/image/bundle.js.gz +0 -0
  160. package/dist/src/components/image/image.component.d.ts +10 -1
  161. package/dist/src/components/image/image.component.js +13 -3
  162. package/dist/src/components/image/image.style.js +19 -26
  163. package/dist/src/components/input/bundle.js +420 -644
  164. package/dist/src/components/input/bundle.js.gz +0 -0
  165. package/dist/src/components/input/input.component.d.ts +16 -3
  166. package/dist/src/components/input/input.component.js +43 -27
  167. package/dist/src/components/input/input.style.d.ts +1 -1
  168. package/dist/src/components/input/input.style.js +331 -634
  169. package/dist/src/components/kv-secret-select/bundle.js +2 -1
  170. package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
  171. package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +3 -0
  172. package/dist/src/components/kv-secret-select/kv-secret-select.component.js +4 -0
  173. package/dist/src/components/label/bundle.js +37 -60
  174. package/dist/src/components/label/bundle.js.gz +0 -0
  175. package/dist/src/components/label/label.component.d.ts +8 -4
  176. package/dist/src/components/label/label.component.js +9 -14
  177. package/dist/src/components/label/label.style.js +17 -25
  178. package/dist/src/components/label/label.style.variables.js +18 -18
  179. package/dist/src/components/layout/bundle.js +86 -70
  180. package/dist/src/components/layout/bundle.js.gz +0 -0
  181. package/dist/src/components/layout/content.component.d.ts +2 -1
  182. package/dist/src/components/layout/content.component.js +2 -1
  183. package/dist/src/components/layout/content.style.js +3 -3
  184. package/dist/src/components/layout/footer.component.d.ts +2 -1
  185. package/dist/src/components/layout/footer.component.js +3 -2
  186. package/dist/src/components/layout/footer.style.js +7 -7
  187. package/dist/src/components/layout/header.component.d.ts +2 -1
  188. package/dist/src/components/layout/header.component.js +3 -2
  189. package/dist/src/components/layout/header.style.js +7 -7
  190. package/dist/src/components/layout/layout.component.d.ts +4 -7
  191. package/dist/src/components/layout/layout.component.js +9 -22
  192. package/dist/src/components/layout/layout.style.js +1 -1
  193. package/dist/src/components/layout/sider.component.d.ts +3 -1
  194. package/dist/src/components/layout/sider.component.js +3 -1
  195. package/dist/src/components/layout/sider.style.js +29 -29
  196. package/dist/src/components/menu/bundle.js +135 -125
  197. package/dist/src/components/menu/bundle.js.gz +0 -0
  198. package/dist/src/components/menu/menu.component.d.ts +2 -1
  199. package/dist/src/components/menu/menu.component.js +1 -0
  200. package/dist/src/components/menu/menu.style.js +87 -87
  201. package/dist/src/components/modal/bundle.js +105 -96
  202. package/dist/src/components/modal/bundle.js.gz +0 -0
  203. package/dist/src/components/modal/modal.component.d.ts +2 -1
  204. package/dist/src/components/modal/modal.component.js +1 -0
  205. package/dist/src/components/modal/modal.style.js +69 -71
  206. package/dist/src/components/panel/bundle.js +190 -391
  207. package/dist/src/components/panel/bundle.js.gz +0 -0
  208. package/dist/src/components/panel/panel.component.d.ts +2 -1
  209. package/dist/src/components/panel/panel.component.js +1 -0
  210. package/dist/src/components/panel/panel.style.js +65 -65
  211. package/dist/src/components/popconfirm/bundle.js +107 -93
  212. package/dist/src/components/popconfirm/bundle.js.gz +0 -0
  213. package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +2 -1
  214. package/dist/src/components/popconfirm/popconfirm-manager.component.js +1 -0
  215. package/dist/src/components/popconfirm/popconfirm-manager.style.js +16 -16
  216. package/dist/src/components/popconfirm/popconfirm.component.d.ts +2 -1
  217. package/dist/src/components/popconfirm/popconfirm.component.js +9 -5
  218. package/dist/src/components/popconfirm/popconfirm.style.js +43 -43
  219. package/dist/src/components/radio/bundle.js +56 -86
  220. package/dist/src/components/radio/bundle.js.gz +0 -0
  221. package/dist/src/components/radio/radio.component.d.ts +8 -2
  222. package/dist/src/components/radio/radio.component.js +17 -9
  223. package/dist/src/components/radio/radio.style.js +30 -77
  224. package/dist/src/components/radio-group/bundle.js +125 -89
  225. package/dist/src/components/radio-group/bundle.js.gz +0 -0
  226. package/dist/src/components/radio-group/radio-group.component.d.ts +5 -1
  227. package/dist/src/components/radio-group/radio-group.component.js +18 -10
  228. package/dist/src/components/radio-group/radio-group.style.js +44 -44
  229. package/dist/src/components/select/bundle.js +260 -367
  230. package/dist/src/components/select/bundle.js.gz +0 -0
  231. package/dist/src/components/select/select.component.d.ts +12 -17
  232. package/dist/src/components/select/select.component.js +35 -35
  233. package/dist/src/components/select/select.style.js +184 -324
  234. package/dist/src/components/skeleton/bundle.js +82 -162
  235. package/dist/src/components/skeleton/bundle.js.gz +0 -0
  236. package/dist/src/components/skeleton/skeleton.component.d.ts +10 -5
  237. package/dist/src/components/skeleton/skeleton.component.js +20 -7
  238. package/dist/src/components/skeleton/skeleton.style.js +34 -133
  239. package/dist/src/components/slider-input/bundle.js +89 -88
  240. package/dist/src/components/slider-input/bundle.js.gz +0 -0
  241. package/dist/src/components/slider-input/slider-input.component.d.ts +11 -0
  242. package/dist/src/components/slider-input/slider-input.component.js +20 -8
  243. package/dist/src/components/slider-input/slider-input.style.js +47 -47
  244. package/dist/src/components/slider-input/slider-input.style.variables.js +32 -32
  245. package/dist/src/components/table/bundle.js +149 -128
  246. package/dist/src/components/table/bundle.js.gz +0 -0
  247. package/dist/src/components/table/table.component.d.ts +2 -1
  248. package/dist/src/components/table/table.component.js +1 -0
  249. package/dist/src/components/table/table.style.js +79 -79
  250. package/dist/src/components/tabs/bundle.js +462 -663
  251. package/dist/src/components/tabs/bundle.js.gz +0 -0
  252. package/dist/src/components/tabs/tabs.component.d.ts +6 -1
  253. package/dist/src/components/tabs/tabs.component.js +8 -1
  254. package/dist/src/components/tabs/tabs.style.js +200 -201
  255. package/dist/src/components/tag/bundle.js +44 -36
  256. package/dist/src/components/tag/bundle.js.gz +0 -0
  257. package/dist/src/components/tag/tag.component.d.ts +7 -6
  258. package/dist/src/components/tag/tag.component.js +10 -19
  259. package/dist/src/components/tag/tag.style.js +20 -24
  260. package/dist/src/components/textarea/bundle.js +131 -94
  261. package/dist/src/components/textarea/bundle.js.gz +0 -0
  262. package/dist/src/components/textarea/textarea.component.d.ts +7 -1
  263. package/dist/src/components/textarea/textarea.component.js +10 -3
  264. package/dist/src/components/textarea/textarea.style.d.ts +1 -13
  265. package/dist/src/components/textarea/textarea.style.js +79 -91
  266. package/dist/src/components/timeline/bundle.js +71 -134
  267. package/dist/src/components/timeline/bundle.js.gz +0 -0
  268. package/dist/src/components/timeline/timeline.component.d.ts +9 -6
  269. package/dist/src/components/timeline/timeline.component.js +16 -13
  270. package/dist/src/components/timeline/timeline.style.d.ts +0 -7
  271. package/dist/src/components/timeline/timeline.style.js +41 -122
  272. package/dist/src/components/timepicker/bundle.js +196 -166
  273. package/dist/src/components/timepicker/bundle.js.gz +0 -0
  274. package/dist/src/components/timepicker/timepicker.component.d.ts +2 -1
  275. package/dist/src/components/timepicker/timepicker.component.js +1 -0
  276. package/dist/src/components/timepicker/timepicker.style.js +42 -42
  277. package/dist/src/components/timepicker/timepicker.style.variables.js +91 -91
  278. package/dist/src/components/toast/bundle.js +97 -81
  279. package/dist/src/components/toast/bundle.js.gz +0 -0
  280. package/dist/src/components/toast/toast.component.d.ts +2 -1
  281. package/dist/src/components/toast/toast.component.js +1 -0
  282. package/dist/src/components/toast/toast.style.js +62 -62
  283. package/dist/src/components/tooltips/bundle.js +10 -10
  284. package/dist/src/components/tooltips/bundle.js.gz +0 -0
  285. package/dist/src/components/tooltips/tooltips.component.d.ts +8 -0
  286. package/dist/src/components/tooltips/tooltips.component.js +9 -1
  287. package/dist/src/components/tooltips/tooltips.style.js +6 -6
  288. package/dist/src/components/video/bundle.js +47 -36
  289. package/dist/src/components/video/bundle.js.gz +0 -0
  290. package/dist/src/components/video/video.component.d.ts +12 -1
  291. package/dist/src/components/video/video.component.js +18 -6
  292. package/dist/src/components/video/video.style.js +18 -24
  293. package/package.json +25 -12
  294. package/packages/common/dist/VERSIONS.md +2 -2
  295. package/packages/common/dist/shared/base-mixin.d.ts +21 -19
  296. package/packages/common/dist/shared/base-mixin.d.ts.map +1 -1
  297. package/packages/common/dist/shared/base-mixin.js +102 -18
  298. package/packages/common/dist/shared/base-mixin.js.map +1 -1
  299. package/packages/common/dist/shared/index.d.ts +1 -0
  300. package/packages/common/dist/shared/index.d.ts.map +1 -1
  301. package/packages/common/dist/shared/index.js +2 -0
  302. package/packages/common/dist/shared/index.js.map +1 -1
  303. package/packages/common/dist/shared/style-injector.d.ts +11 -0
  304. package/packages/common/dist/shared/style-injector.d.ts.map +1 -0
  305. package/packages/common/dist/shared/style-injector.js +53 -0
  306. package/packages/common/dist/shared/style-injector.js.map +1 -0
  307. package/packages/common/dist/shared/theme-mixin.d.ts +2 -24
  308. package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -1
  309. package/packages/common/dist/shared/theme-mixin.js +5 -38
  310. package/packages/common/dist/shared/theme-mixin.js.map +1 -1
  311. package/packages/themes/dist/default.css +0 -10
  312. package/packages/themes/dist/package.json +1 -1
@@ -1,34 +1,66 @@
1
- import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property as e,customElement as n}from"lit/decorators.js";import{choose as a}from"lit/directives/choose.js";import{classMap as s}from"lit/directives/class-map.js";import{NuralyUIBaseMixin as l}from"@nuralyui/common/mixins";import{BaseValidationController as d}from"@nuralyui/common/controllers";import{throttle as u}from"@nuralyui/common/utils";
1
+ import{css as t,html as e,nothing as i,LitElement as s}from"lit";import{property as o,customElement as r}from"lit/decorators.js";import{choose as n}from"lit/directives/choose.js";import{classMap as a}from"lit/directives/class-map.js";import"lit/directives/if-defined.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2023 Nuraly, Laabidi Aymen
5
5
  * SPDX-License-Identifier: MIT
6
- */class h{constructor(t){this.host=t,t.addController(this)}hostConnected(){if(this.host.defaultValue&&!this.host.value){const t=this.host.options.find(t=>t.value===this.host.defaultValue);t&&!this.isOptionDisabled(t)&&this.selectOption(t)}}hostDisconnected(){}selectOption(t){if(this.isOptionDisabled(t))return;const r=this.host.value;this.host.value=t.value,this.dispatchChangeEvent(t,r),this.host.requestUpdate()}getSelectedOption(){return this.host.options.find(t=>t.value===this.host.value)}isOptionSelected(t){return t.value===this.host.value}isOptionDisabled(t){return this.host.disabled||Boolean(t.disabled)}getFormData(){return this.host.name?{[this.host.name]:this.host.value}:{}}reset(){this.host.value=this.host.defaultValue||"",this.host.requestUpdate()}getSelectedValue(){return this.host.value}dispatchChangeEvent(t,r){const o=new CustomEvent("nr-change",{detail:{value:t.value,option:t,oldValue:r},bubbles:!0,composed:!0});this.host.dispatchEvent(o)}}
6
+ */const l=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,e,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(e=this.designSystemObserver)||void 0===e||e.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,e;const i=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return i||((null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const e=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===e?e:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},d=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},h=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(d())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!d())return!0;let e=!0;for(const i of this.requiredComponents)if(!this.isComponentAvailable(i)){e=!1;const s=new Error(`Required component "${i}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(i,s):console.error(s.message)}return e}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter(t=>!this.isComponentAvailable(t))}areDependenciesAvailable(){return this.requiredComponents.every(t=>this.isComponentAvailable(t))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const e=this.requiredComponents.indexOf(t);e>-1&&this.requiredComponents.splice(e,1)}},u=t=>class extends t{dispatchCustomEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,e){var i;const s=Object.assign(Object.assign({},e),{timestamp:Date.now(),componentName:(null===(i=this.tagName)||void 0===i?void 0:i.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,s)}dispatchInputEvent(t,e){const i=Object.assign({target:e.target||this,value:e.value,originalEvent:e.originalEvent},e);this.dispatchCustomEvent(t,i)}dispatchFocusEvent(t,e){const i=Object.assign({target:e.target||this,value:e.value,focused:e.focused,cursorPosition:e.cursorPosition,selectedText:e.selectedText},e);this.dispatchCustomEvent(t,i)}dispatchValidationEvent(t,e){var i;const s=Object.assign({target:e.target||this,value:e.value,isValid:null!==(i=e.isValid)&&void 0!==i&&i,error:e.error},e);this.dispatchCustomEvent(t,s)}dispatchActionEvent(t,e){const i=Object.assign({target:e.target||this,action:e.action,previousValue:e.previousValue,newValue:e.newValue},e);this.dispatchCustomEvent(t,i)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},c=new Set,p=new Map;
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2023 Nuraly, Laabidi Aymen
10
10
  * SPDX-License-Identifier: MIT
11
- */class c{constructor(t,r){this.groupController=r,this.host=t,this.boundKeyDownHandler=this.handleKeyDown.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("keydown",this.boundKeyDownHandler)}hostDisconnected(){this.host.removeEventListener("keydown",this.boundKeyDownHandler)}handleKeyDown(t){const r=this.host.options;if(!r||0===r.length)return;const o=r.findIndex(t=>this.groupController.isOptionSelected(t));switch(t.key){case"ArrowDown":case"ArrowRight":t.preventDefault(),this.selectNextOption(r,o);break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.selectPreviousOption(r,o);break;case" ":case"Enter":t.preventDefault(),-1===o&&this.selectFirstEnabledOption(r);break;case"Home":t.preventDefault(),this.selectFirstEnabledOption(r);break;case"End":t.preventDefault(),this.selectLastEnabledOption(r)}}selectNextOption(t,r){const o=-1===r?0:r+1;for(let r=0;r<t.length;r++){const i=t[(o+r)%t.length];if(!this.groupController.isOptionDisabled(i)){this.groupController.selectOption(i);break}}}selectPreviousOption(t,r){const o=-1===r?t.length-1:r-1;for(let r=0;r<t.length;r++){const i=t[(o-r+t.length)%t.length];if(!this.groupController.isOptionDisabled(i)){this.groupController.selectOption(i);break}}}selectFirstEnabledOption(t){const r=t.find(t=>!this.groupController.isOptionDisabled(t));r&&this.groupController.selectOption(r)}selectLastEnabledOption(t){const r=t.filter(t=>!this.groupController.isOptionDisabled(t)),o=r[r.length-1];o&&this.groupController.selectOption(o)}}
11
+ */
12
+ /**
13
+ * @license
14
+ * Copyright 2023 Nuraly, Laabidi Aymen
15
+ * SPDX-License-Identifier: MIT
16
+ */
17
+ const b=t=>{class e extends t{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const t=this.constructor.useShadowDom;if(!t&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!t){const t=this.constructor,e=this.tagName.toLowerCase(),i=t.styles;if(i){const t=m(i);t&&function(t,e,i){var s;if(!p.has(t)){const i=new CSSStyleSheet;i.replaceSync(e),p.set(t,i)}const o=p.get(t),r=`doc:${t}`;if(c.has(r)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,o],c.add(r)),i){let e=i;for(;e;){const i=e.getRootNode();if(!(i instanceof ShadowRoot))break;{const r=`shadow:${((null===(s=i.host)||void 0===s?void 0:s.tagName)||"").toLowerCase()}:${t}`;c.has(r)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,o],c.add(r)),e=i.host}}}}(e,t,this)}}}get lightChildren(){return this.t?this.t.filter(t=>!(t instanceof Element&&t.hasAttribute("slot"))):[]}lightChildrenNamed(t){return this.t?this.t.filter(e=>e instanceof Element&&e.getAttribute("slot")===t):[]}}return e.useShadowDom=!1,e};function m(t){return Array.isArray(t)?t.map(t=>m(t)).filter(Boolean).join("\n"):t&&"string"==typeof t.cssText?t.cssText:"string"==typeof t?t:""}
12
18
  /**
13
19
  * @license
14
20
  * Copyright 2023 Nuraly, Laabidi Aymen
15
21
  * SPDX-License-Identifier: MIT
16
- */class p{constructor(t){this._focusedIndex=-1,this._hasFocus=!1,this.host=t,this.boundFocusInHandler=this.handleFocusIn.bind(this),this.boundFocusOutHandler=this.handleFocusOut.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("focusin",this.boundFocusInHandler),this.host.addEventListener("focusout",this.boundFocusOutHandler)}hostDisconnected(){this.host.removeEventListener("focusin",this.boundFocusInHandler),this.host.removeEventListener("focusout",this.boundFocusOutHandler)}get focusedIndex(){return this._focusedIndex}get hasFocus(){return this._hasFocus}setFocusedOption(t){const r=this._focusedIndex;this._focusedIndex=t,r!==t&&this.host.requestUpdate()}getFocusedIndex(){return this._focusedIndex}clearFocus(){this._focusedIndex=-1,this._hasFocus=!1,this.host.requestUpdate()}handleFocusIn(t){var r;this._hasFocus=!0;const o=t.target;if(o&&o.matches('input[type="radio"], nr-button[role="radio"]')){const t=null===(r=this.host.shadowRoot)||void 0===r?void 0:r.querySelectorAll('input[type="radio"], nr-button[role="radio"]');if(t){const r=Array.from(t).indexOf(o);-1!==r&&this.setFocusedOption(r)}}this.host.requestUpdate()}handleFocusOut(t){const r=t.relatedTarget,o=this.host;r&&o.contains(r)||(this._hasFocus=!1,this.host.requestUpdate())}focus(){const t=this.host.options,r=this.host.value,o=t.findIndex(t=>t.value===r);if(-1!==o)return void this.focusOptionAtIndex(o);const i=t.findIndex(t=>!t.disabled);-1!==i&&this.focusOptionAtIndex(i)}blur(){const t=this.host.shadowRoot;if(!t)return;const r=t.querySelector('input[type="radio"]:focus, nr-button[role="radio"]:focus');r&&"function"==typeof r.blur&&r.blur()}focusOptionAtIndex(t){const r=this.host.shadowRoot;if(!r)return;this.updateTabIndices(t);const o=r.querySelectorAll('input[type="radio"]');if(o[t])return void o[t].focus();const i=r.querySelectorAll('nr-button[role="radio"]');i[t]&&i[t].focus()}updateTabIndices(t){const r=this.host.shadowRoot;if(!r)return;const o=this.host.options,i=this.host.value;let e=t;if(void 0===e){const t=o.findIndex(t=>t.value===i);e=-1!==t?t:o.findIndex(t=>!t.disabled)}r.querySelectorAll('input[type="radio"]').forEach((t,r)=>{t.tabIndex=r===e?0:-1});r.querySelectorAll('nr-button[role="radio"]').forEach((t,r)=>{t.tabIndex=r===e?0:-1})}hostUpdated(){this.updateTabIndices()}}
22
+ */class g{constructor(t){this.host=t,t.addController(this)}hostConnected(){if(this.host.defaultValue&&!this.host.value){const t=this.host.options.find(t=>t.value===this.host.defaultValue);t&&!this.isOptionDisabled(t)&&this.selectOption(t)}}hostDisconnected(){}selectOption(t){if(this.isOptionDisabled(t))return;const e=this.host.value;this.host.value=t.value,this.dispatchChangeEvent(t,e),this.host.requestUpdate()}getSelectedOption(){return this.host.options.find(t=>t.value===this.host.value)}isOptionSelected(t){return t.value===this.host.value}isOptionDisabled(t){return this.host.disabled||Boolean(t.disabled)}getFormData(){return this.host.name?{[this.host.name]:this.host.value}:{}}reset(){this.host.value=this.host.defaultValue||"",this.host.requestUpdate()}getSelectedValue(){return this.host.value}dispatchChangeEvent(t,e){const i=new CustomEvent("nr-change",{detail:{value:t.value,option:t,oldValue:e},bubbles:!0,composed:!0});this.host.dispatchEvent(i)}}
17
23
  /**
18
24
  * @license
19
25
  * Copyright 2023 Nuraly, Laabidi Aymen
20
26
  * SPDX-License-Identifier: MIT
21
- */class b extends d{validate(){const t=this.host.required,r=this.host.value;return t&&!r?(this._isValid=!1,this._validationMessage="Please select an option",this.requestUpdate(),!1):(this._isValid=!0,this._validationMessage="",this.requestUpdate(),!0)}setCustomValidity(t){this._isValid=!t,this._validationMessage=t,this.requestUpdate()}getFormData(){const t=this.host.name,r=this.host.value;return t?{[t]:r}:{}}reportValidity(){const t=this.validate();if(!t){const t=new CustomEvent("invalid",{detail:{message:this._validationMessage},bubbles:!0,composed:!0});this._host.dispatchEvent(t)}return t}reset(){this.clearValidation()}getFormDataObject(){const t=this.host.name,r=this.host.value;if(!t||!r)return null;const o=new FormData;return o.append(t,r),o}validateOnChange(){this._isValid||this.validate()}}
27
+ */class f{constructor(t,e){this.groupController=e,this.host=t,this.boundKeyDownHandler=this.handleKeyDown.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("keydown",this.boundKeyDownHandler)}hostDisconnected(){this.host.removeEventListener("keydown",this.boundKeyDownHandler)}handleKeyDown(t){const e=this.host.options;if(!e||0===e.length)return;const i=e.findIndex(t=>this.groupController.isOptionSelected(t));switch(t.key){case"ArrowDown":case"ArrowRight":t.preventDefault(),this.selectNextOption(e,i);break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.selectPreviousOption(e,i);break;case" ":case"Enter":t.preventDefault(),-1===i&&this.selectFirstEnabledOption(e);break;case"Home":t.preventDefault(),this.selectFirstEnabledOption(e);break;case"End":t.preventDefault(),this.selectLastEnabledOption(e)}}selectNextOption(t,e){const i=-1===e?0:e+1;for(let e=0;e<t.length;e++){const s=t[(i+e)%t.length];if(!this.groupController.isOptionDisabled(s)){this.groupController.selectOption(s);break}}}selectPreviousOption(t,e){const i=-1===e?t.length-1:e-1;for(let e=0;e<t.length;e++){const s=t[(i-e+t.length)%t.length];if(!this.groupController.isOptionDisabled(s)){this.groupController.selectOption(s);break}}}selectFirstEnabledOption(t){const e=t.find(t=>!this.groupController.isOptionDisabled(t));e&&this.groupController.selectOption(e)}selectLastEnabledOption(t){const e=t.filter(t=>!this.groupController.isOptionDisabled(t)),i=e[e.length-1];i&&this.groupController.selectOption(i)}}
22
28
  /**
23
29
  * @license
24
30
  * Copyright 2023 Nuraly, Laabidi Aymen
25
31
  * SPDX-License-Identifier: MIT
26
- */class y{constructor(t){this._rippleEnabled=!0,this.activeRipples=new Set,this.ripplePool=[],this.host=t,this.boundClickHandler=this.handleClick.bind(this),t.addController(this);const r=this.addRippleEffect.bind(this);this.addRippleEffect=u(r,16)}hostConnected(){this.host.addEventListener("click",this.boundClickHandler)}hostDisconnected(){this.host.removeEventListener("click",this.boundClickHandler)}get rippleEnabled(){return this._rippleEnabled}set rippleEnabled(t){this._rippleEnabled=t}handleClick(t){if(!this._rippleEnabled)return;const r=t.target;r&&r.matches('input[type="radio"]')&&this.addRippleToElement(r),r&&r.matches('nr-button[role="radio"]')&&this.addButtonRippleEffect(r)}addRippleEffect(t){const r=t.target;r&&this.addRippleToElement(r)}addRippleToElement(t){t.style.animation="none",t.getAnimations();const r=getComputedStyle(t).getPropertyValue("--nuraly-radio-ripple-duration")||getComputedStyle(t).getPropertyValue("--nuraly-radio-local-ripple-duration")||"300ms";t.style.animation=`radioRipple ${r} ease-out`;const o=this.parseDuration(r);setTimeout(()=>{t.style.animation=""},o)}addButtonRippleEffect(t){const r=this.createRippleElement(t);r&&(t.appendChild(r),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r)},600))}createRippleElement(t){const r=this.getRippleElement(t);return r.style.animation="radioRippleSpread 600ms ease-out",r}parseDuration(t){const r=t.match(/^([\d.]+)(s|ms)$/);if(!r)return 300;const o=Number.parseFloat(r[1]);return"s"===r[2]?1e3*o:o}triggerRipple(t){if(!this._rippleEnabled)return;const r=this.host.shadowRoot;if(!r)return;let o=null;o=t?r.querySelector(`input[type="radio"][value="${t}"]`):r.querySelector('input[type="radio"]:checked'),o&&this.addRippleToElement(o)}disableRipple(){this._rippleEnabled=!1}enableRipple(){this._rippleEnabled=!0}clearRipples(){this.activeRipples.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t),this.ripplePool.length<10&&(t.style.animation="",t.style.transform="scale(0)",this.ripplePool.push(t))}),this.activeRipples.clear();const t=this.host.shadowRoot;if(t){t.querySelectorAll('input[type="radio"]').forEach(t=>{t.style.animation=""})}}getRippleElement(t){let r=this.ripplePool.pop();r||(r=document.createElement("span"),r.className="radio-ripple",r.style.position="absolute",r.style.borderRadius="50%",r.style.background="currentColor",r.style.opacity="0.1",r.style.pointerEvents="none");const o=t.getBoundingClientRect(),i=Math.max(o.width,o.height);return r.style.width=`${i}px`,r.style.height=`${i}px`,r.style.left=-i/2+"px",r.style.top=-i/2+"px",r.style.transform="scale(0)",this.activeRipples.add(r),r}addRippleEffectToElement(t){this.addRippleToElement(t)}setRippleEnabled(t){this._rippleEnabled=t}}
32
+ */class y{constructor(t){this._focusedIndex=-1,this._hasFocus=!1,this.host=t,this.boundFocusInHandler=this.handleFocusIn.bind(this),this.boundFocusOutHandler=this.handleFocusOut.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("focusin",this.boundFocusInHandler),this.host.addEventListener("focusout",this.boundFocusOutHandler)}hostDisconnected(){this.host.removeEventListener("focusin",this.boundFocusInHandler),this.host.removeEventListener("focusout",this.boundFocusOutHandler)}get focusedIndex(){return this._focusedIndex}get hasFocus(){return this._hasFocus}setFocusedOption(t){const e=this._focusedIndex;this._focusedIndex=t,e!==t&&this.host.requestUpdate()}getFocusedIndex(){return this._focusedIndex}clearFocus(){this._focusedIndex=-1,this._hasFocus=!1,this.host.requestUpdate()}handleFocusIn(t){var e;this._hasFocus=!0;const i=t.target;if(i&&i.matches('input[type="radio"], nr-button[role="radio"]')){const t=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelectorAll('input[type="radio"], nr-button[role="radio"]');if(t){const e=Array.from(t).indexOf(i);-1!==e&&this.setFocusedOption(e)}}this.host.requestUpdate()}handleFocusOut(t){const e=t.relatedTarget,i=this.host;e&&i.contains(e)||(this._hasFocus=!1,this.host.requestUpdate())}focus(){const t=this.host.options,e=this.host.value,i=t.findIndex(t=>t.value===e);if(-1!==i)return void this.focusOptionAtIndex(i);const s=t.findIndex(t=>!t.disabled);-1!==s&&this.focusOptionAtIndex(s)}blur(){const t=this.host.shadowRoot;if(!t)return;const e=t.querySelector('input[type="radio"]:focus, nr-button[role="radio"]:focus');e&&"function"==typeof e.blur&&e.blur()}focusOptionAtIndex(t){const e=this.host.shadowRoot;if(!e)return;this.updateTabIndices(t);const i=e.querySelectorAll('input[type="radio"]');if(i[t])return void i[t].focus();const s=e.querySelectorAll('nr-button[role="radio"]');s[t]&&s[t].focus()}updateTabIndices(t){const e=this.host.shadowRoot;if(!e)return;const i=this.host.options,s=this.host.value;let o=t;if(void 0===o){const t=i.findIndex(t=>t.value===s);o=-1!==t?t:i.findIndex(t=>!t.disabled)}e.querySelectorAll('input[type="radio"]').forEach((t,e)=>{t.tabIndex=e===o?0:-1});e.querySelectorAll('nr-button[role="radio"]').forEach((t,e)=>{t.tabIndex=e===o?0:-1})}hostUpdated(){this.updateTabIndices()}}
27
33
  /**
28
34
  * @license
29
35
  * Copyright 2023 Nuraly, Laabidi Aymen
30
36
  * SPDX-License-Identifier: MIT
31
- */const g=t`
37
+ */class v{constructor(t){this._host=t,t.addController(this)}get host(){return this._host}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(){try{this._host.requestUpdate()}catch(t){this.handleError(t,"requestUpdate")}}dispatchEvent(t){try{return this._host.dispatchEvent(t)}catch(t){return this.handleError(t,"dispatchEvent"),!1}}handleError(t,e){console.error(`[${this.constructor.name}] Error in ${e}:`,t);try{this._host.dispatchEvent(new CustomEvent("nr-controller-error",{detail:{error:t.message,context:e,controller:this.constructor.name},bubbles:!0,composed:!0}))}catch(t){}}safeExecute(t,e,i){try{return t()}catch(t){return this.handleError(t,e),i}}debounce(t,e){let i;const s=(...s)=>{void 0!==i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)};return s.cancel=()=>{void 0!==i&&(clearTimeout(i),i=void 0)},s}}
38
+ /**
39
+ * @license
40
+ * Copyright 2023 Nuraly, Laabidi Aymen
41
+ * SPDX-License-Identifier: MIT
42
+ */class w extends v{constructor(){super(...arguments),this._isValid=!0,this._validationMessage="",this._validationState="pristine",this._rules=[]}get isValid(){return this._isValid}get validationMessage(){return this._validationMessage}get validationState(){return this._validationState}addRule(t){this._rules.push(t),this.requestUpdate()}removeRule(t){this._rules=this._rules.filter(e=>!t(e)),this.requestUpdate()}clearRules(){this._rules=[],this.clearValidation()}clearValidation(){this._isValid=!0,this._validationMessage="",this._validationState="pristine",this.requestUpdate(),this.dispatchValidationEvent()}checkValidity(){return this.validate()}reportValidity(){const t=this.checkValidity();return t||this.dispatchValidationEvent(),t}dispatchValidationEvent(){this.dispatchEvent(new CustomEvent("nr-validation",{detail:{isValid:this._isValid,validationMessage:this._validationMessage,validationState:this._validationState},bubbles:!0,composed:!0}))}}
43
+ /**
44
+ * @license
45
+ * Copyright 2023 Nuraly, Laabidi Aymen
46
+ * SPDX-License-Identifier: MIT
47
+ */class $ extends w{validate(){const t=this.host.required,e=this.host.value;return t&&!e?(this._isValid=!1,this._validationMessage="Please select an option",this.requestUpdate(),!1):(this._isValid=!0,this._validationMessage="",this.requestUpdate(),!0)}setCustomValidity(t){this._isValid=!t,this._validationMessage=t,this.requestUpdate()}getFormData(){const t=this.host.name,e=this.host.value;return t?{[t]:e}:{}}reportValidity(){const t=this.validate();if(!t){const t=new CustomEvent("invalid",{detail:{message:this._validationMessage},bubbles:!0,composed:!0});this._host.dispatchEvent(t)}return t}reset(){this.clearValidation()}getFormDataObject(){const t=this.host.name,e=this.host.value;if(!t||!e)return null;const i=new FormData;return i.append(t,e),i}validateOnChange(){this._isValid||this.validate()}}
48
+ /**
49
+ * @license
50
+ * Copyright 2023 Nuraly, Laabidi Aymen
51
+ * SPDX-License-Identifier: MIT
52
+ */
53
+ /**
54
+ * @license
55
+ * Copyright 2023 Nuraly, Laabidi Aymen
56
+ * SPDX-License-Identifier: MIT
57
+ */
58
+ class x{constructor(t){this._rippleEnabled=!0,this.activeRipples=new Set,this.ripplePool=[],this.host=t,this.boundClickHandler=this.handleClick.bind(this),t.addController(this);const e=this.addRippleEffect.bind(this);this.addRippleEffect=function(t,e){let i;return function(...s){i||(t.apply(this,s),i=!0,setTimeout(()=>i=!1,e))}}(e,16)}hostConnected(){this.host.addEventListener("click",this.boundClickHandler)}hostDisconnected(){this.host.removeEventListener("click",this.boundClickHandler)}get rippleEnabled(){return this._rippleEnabled}set rippleEnabled(t){this._rippleEnabled=t}handleClick(t){if(!this._rippleEnabled)return;const e=t.target;e&&e.matches('input[type="radio"]')&&this.addRippleToElement(e),e&&e.matches('nr-button[role="radio"]')&&this.addButtonRippleEffect(e)}addRippleEffect(t){const e=t.target;e&&this.addRippleToElement(e)}addRippleToElement(t){t.style.animation="none",t.getAnimations();const e=getComputedStyle(t).getPropertyValue("--nuraly-radio-ripple-duration")||getComputedStyle(t).getPropertyValue("--nuraly-radio-local-ripple-duration")||"300ms";t.style.animation=`radioRipple ${e} ease-out`;const i=this.parseDuration(e);setTimeout(()=>{t.style.animation=""},i)}addButtonRippleEffect(t){const e=this.createRippleElement(t);e&&(t.appendChild(e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},600))}createRippleElement(t){const e=this.getRippleElement(t);return e.style.animation="radioRippleSpread 600ms ease-out",e}parseDuration(t){const e=t.match(/^([\d.]+)(s|ms)$/);if(!e)return 300;const i=Number.parseFloat(e[1]);return"s"===e[2]?1e3*i:i}triggerRipple(t){if(!this._rippleEnabled)return;const e=this.host.shadowRoot;if(!e)return;let i=null;i=t?e.querySelector(`input[type="radio"][value="${t}"]`):e.querySelector('input[type="radio"]:checked'),i&&this.addRippleToElement(i)}disableRipple(){this._rippleEnabled=!1}enableRipple(){this._rippleEnabled=!0}clearRipples(){this.activeRipples.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t),this.ripplePool.length<10&&(t.style.animation="",t.style.transform="scale(0)",this.ripplePool.push(t))}),this.activeRipples.clear();const t=this.host.shadowRoot;if(t){t.querySelectorAll('input[type="radio"]').forEach(t=>{t.style.animation=""})}}getRippleElement(t){let e=this.ripplePool.pop();e||(e=document.createElement("span"),e.className="radio-ripple",e.style.position="absolute",e.style.borderRadius="50%",e.style.background="currentColor",e.style.opacity="0.1",e.style.pointerEvents="none");const i=t.getBoundingClientRect(),s=Math.max(i.width,i.height);return e.style.width=`${s}px`,e.style.height=`${s}px`,e.style.left=-s/2+"px",e.style.top=-s/2+"px",e.style.transform="scale(0)",this.activeRipples.add(e),e}addRippleEffectToElement(t){this.addRippleToElement(t)}setRippleEnabled(t){this._rippleEnabled=t}}
59
+ /**
60
+ * @license
61
+ * Copyright 2023 Nuraly, Laabidi Aymen
62
+ * SPDX-License-Identifier: MIT
63
+ */const E=t`
32
64
  :host {
33
65
  /* ========================================
34
66
  * CSS CUSTOM PROPERTIES - RADIO GROUP
@@ -39,18 +71,18 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
39
71
  --nuraly-radio-group-horizontal-gap: 16px;
40
72
 
41
73
  /* Colors - Error/Warning states */
42
- --nuraly-radio-group-error-icon-color: var(--nuraly-color-radio-error-icon, #ef4444);
43
- --nuraly-radio-group-error-text-color: var(--nuraly-color-radio-error-text, #ef4444);
44
- --nuraly-radio-group-warning-icon-color: var(--nuraly-color-radio-warning-icon, #f59e0b);
45
- --nuraly-radio-group-warning-text-color: var(--nuraly-color-radio-warning-text, #f59e0b);
74
+ --nuraly-radio-group-error-icon-color: #ef4444;
75
+ --nuraly-radio-group-error-text-color: #ef4444;
76
+ --nuraly-radio-group-warning-icon-color: #f59e0b;
77
+ --nuraly-radio-group-warning-text-color: #f59e0b;
46
78
 
47
79
  /* Typography */
48
- --nuraly-radio-group-font-family: var(--nuraly-font-family-radio, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif);
49
- --nuraly-radio-group-message-font-size: var(--nuraly-font-size-radio-message, 12px);
80
+ --nuraly-radio-group-font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
81
+ --nuraly-radio-group-message-font-size: 12px;
50
82
 
51
83
  /* Button type styling */
52
84
  --nuraly-radio-group-button-border-radius: 4px;
53
- --nuraly-radio-group-button-hover-color: var(--nuraly-color-radio-border-hover, #7c3aed);
85
+ --nuraly-radio-group-button-hover-color: #7c3aed;
54
86
 
55
87
  /* Slot container styling */
56
88
  --nuraly-radio-group-slot-hover-bg: rgba(124, 58, 237, 0.04);
@@ -63,7 +95,7 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
63
95
 
64
96
  width: fit-content;
65
97
  display: block;
66
- font-family: var(--nuraly-radio-group-font-family);
98
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
67
99
  }
68
100
 
69
101
  /* ========================================
@@ -73,13 +105,13 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
73
105
  .radio-group {
74
106
  display: flex;
75
107
  flex-direction: column;
76
- gap: var(--nuraly-radio-group-gap);
108
+ gap: 12px;
77
109
  }
78
110
 
79
111
  .radio-group.horizontal {
80
112
  flex-direction: row;
81
113
  flex-wrap: wrap;
82
- gap: var(--nuraly-radio-group-horizontal-gap);
114
+ gap: 16px;
83
115
  }
84
116
 
85
117
  .radio-wrapper {
@@ -96,7 +128,7 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
96
128
  display: flex;
97
129
  align-items: center;
98
130
  gap: 6px;
99
- font-size: var(--nuraly-radio-group-message-font-size);
131
+ font-size: 12px;
100
132
  padding-left: 28px; /* Align with radio label */
101
133
  }
102
134
 
@@ -105,19 +137,19 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
105
137
  }
106
138
 
107
139
  .radio-wrapper.error nr-icon {
108
- --nuraly-icon-color: var(--nuraly-radio-group-error-icon-color);
140
+ --nuraly-icon-color: #ef4444;
109
141
  }
110
142
 
111
143
  .radio-wrapper.warning nr-icon {
112
- --nuraly-icon-color: var(--nuraly-radio-group-warning-icon-color);
144
+ --nuraly-icon-color: #f59e0b;
113
145
  }
114
146
 
115
147
  .radio-wrapper.error .message-container {
116
- color: var(--nuraly-radio-group-error-text-color);
148
+ color: #ef4444;
117
149
  }
118
150
 
119
151
  .radio-wrapper.warning .message-container {
120
- color: var(--nuraly-radio-group-warning-text-color);
152
+ color: #f59e0b;
121
153
  }
122
154
 
123
155
  /* ========================================
@@ -131,13 +163,13 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
131
163
 
132
164
  /* Button border radius for first and last child */
133
165
  .type-button :first-child {
134
- --nuraly-button-border-top-left-radius: var(--nuraly-radio-group-button-border-radius);
135
- --nuraly-button-border-bottom-left-radius: var(--nuraly-radio-group-button-border-radius);
166
+ --nuraly-button-border-top-left-radius: 4px;
167
+ --nuraly-button-border-bottom-left-radius: 4px;
136
168
  }
137
169
 
138
170
  .type-button :last-child {
139
- --nuraly-button-border-top-right-radius: var(--nuraly-radio-group-button-border-radius);
140
- --nuraly-button-border-bottom-right-radius: var(--nuraly-radio-group-button-border-radius);
171
+ --nuraly-button-border-top-right-radius: 4px;
172
+ --nuraly-button-border-bottom-right-radius: 4px;
141
173
  }
142
174
 
143
175
  .type-button nr-button:not(:last-child) {
@@ -150,8 +182,8 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
150
182
  }
151
183
 
152
184
  .type-button nr-button[type="default"]:hover {
153
- --nuraly-button-color: var(--nuraly-radio-group-button-hover-color);
154
- --nuraly-button-border-color: var(--nuraly-radio-group-button-hover-color);
185
+ --nuraly-button-color: #7c3aed;
186
+ --nuraly-button-border-color: #7c3aed;
155
187
  z-index: 2;
156
188
  }
157
189
 
@@ -169,20 +201,20 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
169
201
 
170
202
  .type-button nr-button[disabled]:hover {
171
203
  z-index: auto;
172
- --nuraly-button-border-color: var(--nuraly-button-disabled-border-color, var(--nuraly-button-local-disabled-border-color));
173
- --nuraly-button-background-color: var(--nuraly-button-disabled-background-color, var(--nuraly-button-local-disabled-background-color));
174
- --nuraly-button-color: var(--nuraly-button-disabled-text-color, var(--nuraly-button-local-disabled-text-color));
204
+ --nuraly-button-border-color: #c6c6c6;
205
+ --nuraly-button-background-color: #f4f4f4;
206
+ --nuraly-button-color: #c6c6c6;
175
207
  }
176
208
 
177
209
  .type-button nr-button[type="primary"][disabled] {
178
- --nuraly-button-background-color: var(--nuraly-button-primary-disabled-background-color, var(--nuraly-button-local-primary-disabled-background-color));
179
- --nuraly-button-border-color: var(--nuraly-button-primary-disabled-border-color, var(--nuraly-button-local-primary-disabled-border-color));
180
- --nuraly-button-color: var(--nuraly-button-primary-disabled-text-color, var(--nuraly-button-local-primary-disabled-text-color));
210
+ --nuraly-button-background-color: #c6c6c6;
211
+ --nuraly-button-border-color: #c6c6c6;
212
+ --nuraly-button-color: #ffffff;
181
213
  }
182
214
 
183
215
  .type-button nr-button[type="primary"][disabled] nr-icon {
184
- --nuraly-icon-color: var(--nuraly-button-primary-disabled-text-color, var(--nuraly-button-local-primary-disabled-text-color));
185
- --nuraly-icon-local-color: var(--nuraly-button-primary-disabled-text-color, var(--nuraly-button-local-primary-disabled-text-color));
216
+ --nuraly-icon-color: #ffffff;
217
+ --nuraly-icon-local-color: #ffffff;
186
218
  }
187
219
 
188
220
  /* ========================================
@@ -198,8 +230,8 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
198
230
  /* Ensure minimum padding for auto-width buttons to prevent them from becoming too small */
199
231
  :host([auto-width]) .type-button nr-button button {
200
232
  min-width: auto;
201
- padding-left: max(var(--nuraly-spacing-2), 0.5rem);
202
- padding-right: max(var(--nuraly-spacing-2), 0.5rem);
233
+ padding-left: max(0.5rem, 0.5rem);
234
+ padding-right: max(0.5rem, 0.5rem);
203
235
  }
204
236
 
205
237
  /* Icon-only buttons with auto-width should have minimal but adequate padding */
@@ -210,30 +242,30 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
210
242
  }
211
243
 
212
244
  :host([auto-width]) .type-button nr-button.icon-only button {
213
- padding: max(0.375rem, var(--nuraly-spacing-2)); /* Ensure minimum 6px padding for icon-only */
245
+ padding: max(0.375rem, 0.5rem); /* Ensure minimum 6px padding for icon-only */
214
246
  min-width: auto;
215
247
  }
216
248
 
217
249
  /* For small size buttons, use proportionally smaller but still adequate padding */
218
250
  :host([auto-width]) .type-button nr-button[size="small"] button {
219
- padding-left: max(var(--nuraly-spacing-1-5), 0.375rem);
220
- padding-right: max(var(--nuraly-spacing-1-5), 0.375rem);
251
+ padding-left: max(0.375rem, 0.375rem);
252
+ padding-right: max(0.375rem, 0.375rem);
221
253
  }
222
254
 
223
255
  /* For small size icon-only buttons, use even less but still minimum padding */
224
256
  :host([auto-width]) .type-button nr-button.icon-only[size="small"] button {
225
- padding: max(0.25rem, var(--nuraly-spacing-1-5));
257
+ padding: max(0.25rem, 0.375rem);
226
258
  }
227
259
 
228
260
  /* For large size buttons, maintain larger minimum padding */
229
261
  :host([auto-width]) .type-button nr-button[size="large"] button {
230
- padding-left: max(var(--nuraly-spacing-4), 0.75rem);
231
- padding-right: max(var(--nuraly-spacing-4), 0.75rem);
262
+ padding-left: max(1rem, 0.75rem);
263
+ padding-right: max(1rem, 0.75rem);
232
264
  }
233
265
 
234
266
  /* For large size icon-only buttons, use proportionally larger padding */
235
267
  :host([auto-width]) .type-button nr-button.icon-only[size="large"] button {
236
- padding: max(0.5rem, var(--nuraly-spacing-3));
268
+ padding: max(0.5rem, 0.75rem);
237
269
  }
238
270
 
239
271
  /* ========================================
@@ -247,11 +279,11 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
247
279
  cursor: pointer;
248
280
  transition: all 0.2s ease;
249
281
  padding: 8px;
250
- border-radius: var(--nuraly-radio-group-slot-border-radius);
282
+ border-radius: 6px;
251
283
  }
252
284
 
253
285
  .slot-wrapper:hover {
254
- background-color: var(--nuraly-radio-group-slot-hover-bg);
286
+ background-color: rgba(124, 58, 237, 0.04);
255
287
  }
256
288
 
257
289
  .slot-wrapper nr-radio {
@@ -265,7 +297,7 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
265
297
  }
266
298
 
267
299
  .slot-container.selected .slot-wrapper {
268
- background-color: var(--nuraly-radio-group-slot-selected-bg);
300
+ background-color: rgba(124, 58, 237, 0.08);
269
301
  }
270
302
 
271
303
  /* ========================================
@@ -273,9 +305,9 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
273
305
  * ======================================== */
274
306
 
275
307
  ::slotted([slot='helper-text']) {
276
- color: var(--nuraly-input-helper-text-color, var(--nuraly-helper-text-color, #8c8c8c));
277
- font-size: var(--nuraly-input-helper-text-font-size, var(--nuraly-helper-text-font-size, 12px));
278
- padding-top: var(--nuraly-input-helper-text-padding-top, var(--nuraly-helper-text-padding-top, 4px));
308
+ color: #8c8c8c;
309
+ font-size: 12px;
310
+ padding-top: 4px;
279
311
 
280
312
  /* Prevent text overflow and ensure proper wrapping without affecting parent width */
281
313
  word-wrap: break-word;
@@ -290,21 +322,22 @@ import{css as t,LitElement as r,html as o,nothing as i}from"lit";import{property
290
322
  line-height: 1.4;
291
323
  display: block;
292
324
  }
293
- `;var m,v,f,w,x;!function(t){t.Horizontal="horizontal",t.Vertical="vertical"}(m||(m={})),function(t){t.Left="left",t.Right="right"}(v||(v={})),function(t){t.Default="default",t.Button="button",t.Slot="slot",t.ButtonSlot="button-slot"}(f||(f={})),function(t){t.Small="small",t.Medium="medium",t.Large="large"}(w||(w={})),function(t){t.Default="default",t.Solid="solid"}(x||(x={}));
325
+ `;var S,O,k,R,C;!function(t){t.Horizontal="horizontal",t.Vertical="vertical"}(S||(S={})),function(t){t.Left="left",t.Right="right"}(O||(O={})),function(t){t.Default="default",t.Button="button",t.Slot="slot",t.ButtonSlot="button-slot"}(k||(k={})),function(t){t.Small="small",t.Medium="medium",t.Large="large"}(R||(R={})),function(t){t.Default="default",t.Solid="solid"}(C||(C={}));
294
326
  /**
295
327
  * @license
296
328
  * Copyright 2023 Nuraly, Laabidi Aymen
297
329
  * SPDX-License-Identifier: MIT
298
330
  */
299
- var $=function(t,r,o,i){for(var e,n=arguments.length,a=n<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,o):i,s=t.length-1;s>=0;s--)(e=t[s])&&(a=(n<3?e(a):n>3?e(r,o,a):e(r,o))||a);return n>3&&a&&Object.defineProperty(r,o,a),a};let O=class extends(l(r)){constructor(){super(...arguments),this.requiredComponents=["nr-icon","nr-radio"],this.options=[],this.defaultValue="",this.value="",this.name="radioGroup",this.direction="vertical",this.type=f.Default,this.required=!1,this.disabled=!1,this.size="medium",this.position="left",this.autoWidth=!1,this.helper="",this.groupController=new h(this),this.keyboardController=new c(this,this.groupController),this.focusController=new p(this),this.validationController=new b(this),this.rippleController=new y(this)}get selectedOption(){return this.groupController.getSelectedOption()}isOptionSelected(t){return this.groupController.isOptionSelected(t)}isOptionDisabled(t){return this.groupController.isOptionDisabled(t)}isOptionIconOnly(t){return!(!t.icon||t.label&&""!==t.label.trim())}handleSelectionChange(t){this.groupController.selectOption(t)}setFocusedOption(t){this.focusController.setFocusedOption(t)}handleKeyDown(t){}addRippleEffect(t){this.rippleController.addRippleEffect(t)}validate(){return this.validationController.validate()}get validationMessage(){return this.validationController.validationMessage}get isValid(){return this.validationController.isValid}getFormData(){return this.validationController.getFormData()}reset(){this.validationController.reset()}get formData(){return this.validationController.getFormDataObject()}checkValidity(){return this.validate()}reportValidity(){return this.validationController.reportValidity()}focus(){this.focusController.focus()}blur(){this.focusController.blur()}renderOptionDefault(){return o`
300
- <div
301
- role="radiogroup"
331
+ var T=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let D=class extends((t=>h(l(u(b(t)))))(s)){constructor(){super(...arguments),this.requiredComponents=["nr-icon","nr-radio"],this.options=[],this.defaultValue="",this.value="",this.name="radioGroup",this.direction="vertical",this.type=k.Default,this.required=!1,this.disabled=!1,this.size="medium",this.position="left",this.autoWidth=!1,this.helper="",this.groupController=new g(this),this.keyboardController=new f(this,this.groupController),this.focusController=new y(this),this.validationController=new $(this),this.rippleController=new x(this)}get selectedOption(){return this.groupController.getSelectedOption()}isOptionSelected(t){return this.groupController.isOptionSelected(t)}isOptionDisabled(t){return this.groupController.isOptionDisabled(t)}isOptionIconOnly(t){return!(!t.icon||t.label&&""!==t.label.trim())}handleSelectionChange(t){this.groupController.selectOption(t)}setFocusedOption(t){this.focusController.setFocusedOption(t)}handleKeyDown(t){}addRippleEffect(t){this.rippleController.addRippleEffect(t)}validate(){return this.validationController.validate()}get validationMessage(){return this.validationController.validationMessage}get isValid(){return this.validationController.isValid}getFormData(){return this.validationController.getFormData()}reset(){this.validationController.reset()}get formData(){return this.validationController.getFormDataObject()}checkValidity(){return this.validate()}reportValidity(){return this.validationController.reportValidity()}focus(){this.focusController.focus()}blur(){this.focusController.blur()}renderOptionDefault(){return e`
332
+ <div
333
+ role="radiogroup"
302
334
  aria-labelledby="radio-group-label"
303
335
  class="radio-group ${this.direction}"
336
+ part="radio-group"
304
337
  >
305
- ${this.options.map((t,r)=>o`
338
+ ${this.options.map((t,s)=>e`
306
339
  <div
307
- class="${s({"radio-wrapper":!0,error:"error"===t.state,warning:"warning"===t.state,[t.className||""]:Boolean(t.className)})}"
340
+ class="${a({"radio-wrapper":!0,error:"error"===t.state,warning:"warning"===t.state,[t.className||""]:Boolean(t.className)})}"
308
341
  data-theme="${this.currentTheme}"
309
342
  style="${t.style||""}"
310
343
  title="${t.title||""}"
@@ -318,56 +351,58 @@ var $=function(t,r,o,i){for(var e,n=arguments.length,a=n<3?r:null===i?i=Object.g
318
351
  ?disabled="${this.isOptionDisabled(t)||this.disabled}"
319
352
  ?required="${this.required}"
320
353
  tabindex="${this.isOptionSelected(t)?"0":"-1"}"
321
- @change="${r=>{this.addRippleEffect(r),this.handleSelectionChange(t)}}"
322
- @focus="${()=>this.setFocusedOption(r)}"
354
+ @change="${e=>{this.addRippleEffect(e),this.handleSelectionChange(t)}}"
355
+ @focus="${()=>this.setFocusedOption(s)}"
323
356
  >
324
357
  ${t.label}
325
358
  </nr-radio>
326
- ${t.state&&t.message?o`<div class="message-container" id="${t.value}-message">
359
+ ${t.state&&t.message?e`<div class="message-container" id="${t.value}-message">
327
360
  <nr-icon name="${"error"===t.state?"exclamation-circle":"warning"}"></nr-icon>
328
361
  <span>${t.message}</span>
329
362
  </div>`:i}
330
363
  </div>
331
364
  `)}
332
365
  </div>
333
- `}renderOptionsWithButtons(){return o`
334
- <div
335
- class="type-button"
336
- role="radiogroup"
366
+ `}renderOptionsWithButtons(){return e`
367
+ <div
368
+ class="type-button"
369
+ role="radiogroup"
337
370
  aria-labelledby="radio-group-label"
371
+ part="type-button"
338
372
  @keydown="${this.handleKeyDown}"
339
373
  >
340
- ${this.options.map((t,r)=>{const e=this.isOptionSelected(t),n=[e?"selected":"",this.isOptionIconOnly(t)&&this.autoWidth?"icon-only":""].filter(Boolean).join(" ");return o`
374
+ ${this.options.map((t,s)=>{const o=this.isOptionSelected(t),r=[o?"selected":"",this.isOptionIconOnly(t)&&this.autoWidth?"icon-only":""].filter(Boolean).join(" ");return e`
341
375
  <nr-button
342
- class="${n}"
343
- type="${e?"primary":"default"}"
376
+ class="${r}"
377
+ type="${o?"primary":"default"}"
344
378
  size="${this.size}"
345
379
  role="radio"
346
- aria-checked="${e}"
380
+ aria-checked="${o}"
347
381
  aria-describedby="${t.state&&t.message?`${t.value}-message`:i}"
348
- tabindex="${e?"0":"-1"}"
382
+ tabindex="${o?"0":"-1"}"
349
383
  .icon="${t.icon?[t.icon]:[]}"
350
384
  .disabled="${this.isOptionDisabled(t)}"
351
385
  @click="${()=>this.handleSelectionChange(t)}"
352
- @focus="${()=>this.setFocusedOption(r)}"
386
+ @focus="${()=>this.setFocusedOption(s)}"
353
387
  >
354
388
  ${t.label}
355
389
  </nr-button>
356
- ${t.state&&t.message?o`<div class="message-container" id="${t.value}-message">
390
+ ${t.state&&t.message?e`<div class="message-container" id="${t.value}-message">
357
391
  <nr-icon name="${"error"===t.state?"exclamation-circle":"warning"}"></nr-icon>
358
392
  <span>${t.message}</span>
359
393
  </div>`:i}
360
394
  `})}
361
395
  </div>
362
- `}renderOptionsWithSlots(){return o`
363
- <div
364
- role="radiogroup"
396
+ `}renderOptionsWithSlots(){return e`
397
+ <div
398
+ role="radiogroup"
365
399
  aria-labelledby="radio-group-label"
366
400
  class="radio-group slot-group ${this.direction}"
401
+ part="radio-group"
367
402
  >
368
- ${this.options.map((t,r)=>o`
403
+ ${this.options.map((t,s)=>e`
369
404
  <div
370
- class="${s({"radio-wrapper":!0,"slot-container":!0,error:"error"===t.state,warning:"warning"===t.state,selected:this.isOptionSelected(t),[t.className||""]:Boolean(t.className)})}"
405
+ class="${a({"radio-wrapper":!0,"slot-container":!0,error:"error"===t.state,warning:"warning"===t.state,selected:this.isOptionSelected(t),[t.className||""]:Boolean(t.className)})}"
371
406
  data-theme="${this.currentTheme}"
372
407
  style="${t.style||""}"
373
408
  title="${t.title||""}"
@@ -382,29 +417,30 @@ var $=function(t,r,o,i){for(var e,n=arguments.length,a=n<3?r:null===i?i=Object.g
382
417
  ?disabled="${this.isOptionDisabled(t)||this.disabled}"
383
418
  ?required="${this.required}"
384
419
  tabindex="${this.isOptionSelected(t)?"0":"-1"}"
385
- @change="${r=>{this.addRippleEffect(r),this.handleSelectionChange(t)}}"
386
- @focus="${()=>this.setFocusedOption(r)}"
420
+ @change="${e=>{this.addRippleEffect(e),this.handleSelectionChange(t)}}"
421
+ @focus="${()=>this.setFocusedOption(s)}"
387
422
  >
388
423
  </nr-radio>
389
424
  <div class="slot-content">
390
425
  <slot name="${t.value}"></slot>
391
426
  </div>
392
427
  </div>
393
- ${t.state&&t.message?o`<div class="message-container" id="${t.value}-message">
428
+ ${t.state&&t.message?e`<div class="message-container" id="${t.value}-message">
394
429
  <nr-icon name="${"error"===t.state?"exclamation-circle":"warning"}"></nr-icon>
395
430
  <span>${t.message}</span>
396
431
  </div>`:i}
397
432
  </div>
398
433
  `)}
399
434
  </div>
400
- `}renderButtonsWithSlots(){return o`
401
- <div
402
- class="type-button"
403
- role="radiogroup"
435
+ `}renderButtonsWithSlots(){return e`
436
+ <div
437
+ class="type-button"
438
+ role="radiogroup"
404
439
  aria-labelledby="radio-group-label"
440
+ part="type-button"
405
441
  @keydown="${this.handleKeyDown}"
406
442
  >
407
- ${this.options.map((t,r)=>o`
443
+ ${this.options.map((t,s)=>e`
408
444
  <nr-button
409
445
  class="${this.isOptionSelected(t)?"selected":""}"
410
446
  type="${this.isOptionSelected(t)?"primary":"default"}"
@@ -414,17 +450,17 @@ var $=function(t,r,o,i){for(var e,n=arguments.length,a=n<3?r:null===i?i=Object.g
414
450
  tabindex="${this.isOptionSelected(t)?"0":"-1"}"
415
451
  .disabled="${this.isOptionDisabled(t)}"
416
452
  @click="${()=>this.handleSelectionChange(t)}"
417
- @focus="${()=>this.setFocusedOption(r)}"
453
+ @focus="${()=>this.setFocusedOption(s)}"
418
454
  >
419
455
  <slot name="${t.value}" slot="default"></slot>
420
456
  </nr-button>
421
- ${t.state&&t.message?o`<div class="message-container" id="${t.value}-message">
457
+ ${t.state&&t.message?e`<div class="message-container" id="${t.value}-message">
422
458
  <nr-icon name="${"error"===t.state?"exclamation-circle":"warning"}"></nr-icon>
423
459
  <span>${t.message}</span>
424
460
  </div>`:i}
425
461
  `)}
426
462
  </div>
427
- `}render(){return o`
428
- ${a(this.type,[[f.Default,()=>this.renderOptionDefault()],[f.Button,()=>this.renderOptionsWithButtons()],[f.Slot,()=>this.renderOptionsWithSlots()],[f.ButtonSlot,()=>this.renderButtonsWithSlots()]])}
463
+ `}render(){return e`
464
+ ${n(this.type,[[k.Default,()=>this.renderOptionDefault()],[k.Button,()=>this.renderOptionsWithButtons()],[k.Slot,()=>this.renderOptionsWithSlots()],[k.ButtonSlot,()=>this.renderButtonsWithSlots()]])}
429
465
  <slot name="helper-text"></slot>
430
- `}};O.styles=g,$([e({type:Array})],O.prototype,"options",void 0),$([e({type:String,attribute:"default-value"})],O.prototype,"defaultValue",void 0),$([e({type:String})],O.prototype,"value",void 0),$([e({type:String})],O.prototype,"name",void 0),$([e({type:String})],O.prototype,"direction",void 0),$([e({type:String})],O.prototype,"type",void 0),$([e({type:Boolean})],O.prototype,"required",void 0),$([e({type:Boolean})],O.prototype,"disabled",void 0),$([e({type:String})],O.prototype,"size",void 0),$([e({type:String})],O.prototype,"position",void 0),$([e({type:Boolean,attribute:"auto-width"})],O.prototype,"autoWidth",void 0),$([e({type:String})],O.prototype,"helper",void 0),O=$([n("nr-radio-group")],O);export{O as NrRadioGroupElement,m as RadioButtonDirection,v as RadioButtonPosition,w as RadioButtonSize,f as RadioButtonType,x as RadioButtonVariant};
466
+ `}};D.styles=E,D.useShadowDom=!0,T([o({type:Array})],D.prototype,"options",void 0),T([o({type:String,attribute:"default-value"})],D.prototype,"defaultValue",void 0),T([o({type:String})],D.prototype,"value",void 0),T([o({type:String})],D.prototype,"name",void 0),T([o({type:String})],D.prototype,"direction",void 0),T([o({type:String})],D.prototype,"type",void 0),T([o({type:Boolean})],D.prototype,"required",void 0),T([o({type:Boolean})],D.prototype,"disabled",void 0),T([o({type:String})],D.prototype,"size",void 0),T([o({type:String})],D.prototype,"position",void 0),T([o({type:Boolean,attribute:"auto-width"})],D.prototype,"autoWidth",void 0),T([o({type:String})],D.prototype,"helper",void 0),D=T([r("nr-radio-group")],D);export{D as NrRadioGroupElement,S as RadioButtonDirection,O as RadioButtonPosition,R as RadioButtonSize,k as RadioButtonType,C as RadioButtonVariant};
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { LitElement } from 'lit';
7
7
  import { RadioButtonType, RadioButtonOption } from './radio-group.types.js';
8
- declare const NrRadioGroupElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
8
+ declare const NrRadioGroupElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & (new (...args: any[]) => import("packages/common/src/shared/base-mixin.js").LightDomContent) & typeof LitElement;
9
9
  /**
10
10
  * A radio button group component using Reactive Controllers architecture.
11
11
  *
@@ -48,9 +48,13 @@ declare const NrRadioGroupElement_base: (new (...args: any[]) => import("@nuraly
48
48
  * @fires nr-change - Dispatched when the selected option changes
49
49
  *
50
50
  * @slot helper-text - Helper text displayed below the radio group
51
+ *
52
+ * @csspart radio-group - The default radio group container
53
+ * @csspart type-button - The button-style radio group container
51
54
  */
52
55
  export declare class NrRadioGroupElement extends NrRadioGroupElement_base {
53
56
  static styles: import("lit").CSSResult;
57
+ static useShadowDom: boolean;
54
58
  requiredComponents: string[];
55
59
  options: RadioButtonOption[];
56
60
  defaultValue: string;