@inera/ids-react 8.2.0 → 9.0.0

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 (370) hide show
  1. package/components/accordion/accordion-base.d.ts +18 -0
  2. package/components/accordion/accordion-base.js +33 -0
  3. package/components/accordion/accordion.d.ts +5 -4
  4. package/components/accordion/accordion.js +16 -35
  5. package/components/alert/alert-base.d.ts +21 -0
  6. package/components/alert/alert-base.js +29 -0
  7. package/components/alert/alert.d.ts +3 -19
  8. package/components/alert/alert.js +8 -18
  9. package/components/alert/global-alert-base.d.ts +15 -0
  10. package/components/alert/global-alert-base.js +21 -0
  11. package/components/alert/global-alert.d.ts +7 -0
  12. package/components/alert/global-alert.js +19 -0
  13. package/components/badge/badge.js +2 -2
  14. package/components/breadcrumbs/breadcrumbs.js +2 -2
  15. package/components/{button-group → button}/button-group.js +2 -2
  16. package/components/button/button.js +3 -3
  17. package/components/card/card.js +3 -3
  18. package/components/carousel/carousel-item.d.ts +5 -4
  19. package/components/carousel/carousel-item.js +8 -6
  20. package/components/carousel/carousel.d.ts +4 -1
  21. package/components/carousel/carousel.js +24 -39
  22. package/components/{pagination/data-pagination → data-pagination}/data-pagination.d.ts +2 -6
  23. package/components/data-pagination/data-pagination.js +12 -0
  24. package/components/date-label/date-label.js +2 -2
  25. package/components/dialog/dialog-base.d.ts +21 -0
  26. package/components/dialog/dialog-base.js +29 -0
  27. package/components/dialog/dialog.d.ts +14 -17
  28. package/components/dialog/dialog.js +36 -36
  29. package/components/dropdown/dropdown-base.d.ts +18 -0
  30. package/components/dropdown/dropdown-base.js +42 -0
  31. package/components/dropdown/dropdown-content-button.d.ts +0 -1
  32. package/components/dropdown/dropdown-content-button.js +0 -1
  33. package/components/dropdown/dropdown-content-link.d.ts +2 -3
  34. package/components/dropdown/dropdown-content-link.js +3 -10
  35. package/components/dropdown/dropdown.d.ts +11 -13
  36. package/components/dropdown/dropdown.js +34 -53
  37. package/components/footer-1177/footer-1177.d.ts +6 -7
  38. package/components/footer-1177/footer-1177.js +8 -5
  39. package/components/footer-1177-admin/footer-1177-admin.d.ts +6 -7
  40. package/components/footer-1177-admin/footer-1177-admin.js +9 -6
  41. package/components/footer-1177-pro/footer-1177-pro.d.ts +6 -7
  42. package/components/footer-1177-pro/footer-1177-pro.js +9 -6
  43. package/components/footer-inera/footer-inera.d.ts +6 -7
  44. package/components/footer-inera/footer-inera.js +9 -6
  45. package/components/footer-inera-admin/footer-inera-admin.d.ts +6 -7
  46. package/components/footer-inera-admin/footer-inera-admin.js +9 -6
  47. package/components/form/check-button/check-button.d.ts +5 -6
  48. package/components/form/check-button/check-button.js +5 -10
  49. package/components/form/checkbox/checkbox-base.d.ts +19 -0
  50. package/components/form/checkbox/checkbox-base.js +29 -0
  51. package/components/form/checkbox/checkbox-group-base.d.ts +12 -0
  52. package/components/form/checkbox/checkbox-group-base.js +13 -0
  53. package/components/form/checkbox/checkbox-group.d.ts +4 -5
  54. package/components/form/checkbox/checkbox-group.js +26 -30
  55. package/components/form/checkbox/checkbox.d.ts +3 -3
  56. package/components/form/checkbox/checkbox.js +17 -41
  57. package/components/form/darkmode-toggle/darkmode-toggle.d.ts +11 -0
  58. package/components/form/darkmode-toggle/darkmode-toggle.js +13 -0
  59. package/components/form/datepicker/datepicker.d.ts +11 -4
  60. package/components/form/datepicker/datepicker.js +65 -27
  61. package/components/form/error-message/error-message.d.ts +1 -2
  62. package/components/form/error-message/error-message.js +2 -4
  63. package/components/form/form-hooks/useGroupValidity.d.ts +4 -1
  64. package/components/form/form-hooks/useGroupValidity.js +7 -2
  65. package/components/form/form-hooks/useInputValidity.d.ts +1 -1
  66. package/components/form/form-hooks/useInputValidity.js +9 -5
  67. package/components/form/input/input-base.d.ts +24 -0
  68. package/components/form/input/input-base.js +32 -0
  69. package/components/form/input/input.d.ts +3 -2
  70. package/components/form/input/input.js +8 -24
  71. package/components/form/radio/radio-base.d.ts +16 -0
  72. package/components/form/radio/radio-base.js +24 -0
  73. package/components/form/radio/radio-group-base.d.ts +13 -0
  74. package/components/form/radio/radio-group-base.js +10 -0
  75. package/components/form/radio/radio-group.d.ts +6 -5
  76. package/components/form/radio/radio-group.js +25 -19
  77. package/components/form/radio/radio.d.ts +9 -9
  78. package/components/form/radio/radio.js +7 -20
  79. package/components/form/radio-button/radio-button-group-base.d.ts +8 -0
  80. package/components/form/radio-button/radio-button-group-base.js +8 -0
  81. package/components/form/radio-button/radio-button-group.d.ts +4 -3
  82. package/components/form/radio-button/radio-button-group.js +18 -12
  83. package/components/form/radio-button/radio-button.d.ts +4 -5
  84. package/components/form/radio-button/radio-button.js +5 -10
  85. package/components/form/range/range-base.d.ts +18 -0
  86. package/components/form/range/range-base.js +16 -0
  87. package/components/form/range/range.d.ts +3 -6
  88. package/components/form/range/range.js +23 -23
  89. package/components/form/select/select-base.d.ts +19 -0
  90. package/components/form/select/select-base.js +24 -0
  91. package/components/form/select/select.d.ts +7 -7
  92. package/components/form/select/select.js +8 -18
  93. package/components/form/select-multiple/select-multiple-base.d.ts +27 -0
  94. package/components/form/select-multiple/select-multiple-base.js +27 -0
  95. package/components/form/select-multiple/select-multiple.d.ts +10 -7
  96. package/components/form/select-multiple/select-multiple.js +29 -54
  97. package/components/form/spinner/spinner.d.ts +3 -4
  98. package/components/form/spinner/spinner.js +3 -7
  99. package/components/form/textarea/textarea-base.d.ts +24 -0
  100. package/components/form/textarea/textarea-base.js +34 -0
  101. package/components/form/textarea/textarea.d.ts +4 -5
  102. package/components/form/textarea/textarea.js +6 -22
  103. package/components/form/time/time-base.d.ts +17 -0
  104. package/components/form/time/time-base.js +24 -0
  105. package/components/form/time/time.d.ts +8 -7
  106. package/components/form/time/time.js +5 -16
  107. package/components/form/toggle/toggle.d.ts +1 -2
  108. package/components/form/toggle/toggle.js +5 -8
  109. package/components/grid/column.d.ts +1 -1
  110. package/components/grid/column.js +6 -7
  111. package/components/grid/container.js +1 -1
  112. package/components/grid/row.js +1 -1
  113. package/components/grid-layout/grid-column.d.ts +19 -0
  114. package/components/grid-layout/grid-column.js +14 -0
  115. package/components/grid-layout/grid-container.d.ts +10 -0
  116. package/components/grid-layout/grid-container.js +17 -0
  117. package/components/grid-layout/grid-row.d.ts +8 -0
  118. package/components/grid-layout/grid-row.js +12 -0
  119. package/components/header-1177/header-1177-avatar-base.d.ts +16 -0
  120. package/components/header-1177/header-1177-avatar-base.js +24 -0
  121. package/components/header-1177/header-1177-avatar.d.ts +4 -7
  122. package/components/header-1177/header-1177-avatar.js +35 -42
  123. package/components/header-1177/header-1177-base.d.ts +18 -0
  124. package/components/header-1177/header-1177-base.js +14 -0
  125. package/components/header-1177/header-1177-item-base.d.ts +9 -0
  126. package/components/header-1177/header-1177-item-base.js +13 -0
  127. package/components/header-1177/header-1177-item.d.ts +2 -7
  128. package/components/header-1177/header-1177-item.js +6 -29
  129. package/components/header-1177/header-1177-menu-mobile-base.d.ts +12 -0
  130. package/components/header-1177/header-1177-menu-mobile-base.js +18 -0
  131. package/components/header-1177/header-1177-menu-mobile.d.ts +4 -5
  132. package/components/header-1177/header-1177-menu-mobile.js +29 -28
  133. package/components/header-1177/header-1177-nav-base.d.ts +9 -0
  134. package/components/header-1177/header-1177-nav-base.js +12 -0
  135. package/components/header-1177/header-1177-nav-item-base.d.ts +18 -0
  136. package/components/header-1177/header-1177-nav-item-base.js +31 -0
  137. package/components/header-1177/header-1177-nav-item-mobile-base.d.ts +7 -0
  138. package/components/header-1177/header-1177-nav-item-mobile-base.js +10 -0
  139. package/components/header-1177/header-1177-nav-item-mobile.d.ts +4 -8
  140. package/components/header-1177/header-1177-nav-item-mobile.js +5 -16
  141. package/components/header-1177/header-1177-nav-item.d.ts +7 -7
  142. package/components/header-1177/header-1177-nav-item.js +44 -35
  143. package/components/header-1177/header-1177-nav.d.ts +2 -4
  144. package/components/header-1177/header-1177-nav.js +5 -9
  145. package/components/header-1177/header-1177-region-picker-base.d.ts +9 -0
  146. package/components/header-1177/header-1177-region-picker-base.js +21 -0
  147. package/components/header-1177/header-1177-region-picker-mobile-base.d.ts +9 -0
  148. package/components/header-1177/header-1177-region-picker-mobile-base.js +21 -0
  149. package/components/header-1177/header-1177-region-picker-mobile.d.ts +3 -6
  150. package/components/header-1177/header-1177-region-picker-mobile.js +13 -29
  151. package/components/header-1177/header-1177-region-picker.d.ts +3 -6
  152. package/components/header-1177/header-1177-region-picker.js +15 -29
  153. package/components/header-1177/header-1177.d.ts +3 -3
  154. package/components/header-1177/header-1177.js +5 -10
  155. package/components/header-1177-admin/header-1177-admin-avatar-base.d.ts +14 -0
  156. package/components/header-1177-admin/header-1177-admin-avatar-base.js +23 -0
  157. package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.d.ts +13 -0
  158. package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.js +23 -0
  159. package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +3 -5
  160. package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +27 -23
  161. package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -5
  162. package/components/header-1177-admin/header-1177-admin-avatar.js +26 -25
  163. package/components/header-1177-admin/header-1177-admin-base.d.ts +18 -0
  164. package/components/header-1177-admin/header-1177-admin-base.js +14 -0
  165. package/components/header-1177-admin/header-1177-admin-item-base.d.ts +8 -0
  166. package/components/header-1177-admin/header-1177-admin-item-base.js +12 -0
  167. package/components/header-1177-admin/header-1177-admin-item.d.ts +3 -8
  168. package/components/header-1177-admin/header-1177-admin-item.js +5 -27
  169. package/components/header-1177-admin/header-1177-admin-menu-mobile-base.d.ts +11 -0
  170. package/components/header-1177-admin/header-1177-admin-menu-mobile-base.js +18 -0
  171. package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +4 -5
  172. package/components/header-1177-admin/header-1177-admin-menu-mobile.js +27 -25
  173. package/components/header-1177-admin/header-1177-admin-nav-base.d.ts +7 -0
  174. package/components/header-1177-admin/header-1177-admin-nav-base.js +10 -0
  175. package/components/header-1177-admin/header-1177-admin-nav-item-base.d.ts +18 -0
  176. package/components/header-1177-admin/header-1177-admin-nav-item-base.js +31 -0
  177. package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.d.ts +7 -0
  178. package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.js +10 -0
  179. package/components/header-1177-admin/header-1177-admin-nav-item-mobile.d.ts +7 -0
  180. package/components/header-1177-admin/header-1177-admin-nav-item-mobile.js +11 -0
  181. package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +6 -6
  182. package/components/header-1177-admin/header-1177-admin-nav-item.js +44 -35
  183. package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -4
  184. package/components/header-1177-admin/header-1177-admin-nav.js +4 -6
  185. package/components/header-1177-admin/header-1177-admin.d.ts +2 -3
  186. package/components/header-1177-admin/header-1177-admin.js +5 -10
  187. package/components/header-1177-pro/header-1177-pro-avatar-base.d.ts +14 -0
  188. package/components/header-1177-pro/header-1177-pro-avatar-base.js +23 -0
  189. package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.d.ts +13 -0
  190. package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.js +24 -0
  191. package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +3 -6
  192. package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +23 -20
  193. package/components/header-1177-pro/header-1177-pro-avatar.d.ts +4 -6
  194. package/components/header-1177-pro/header-1177-pro-avatar.js +32 -30
  195. package/components/header-1177-pro/header-1177-pro-base.d.ts +19 -0
  196. package/components/header-1177-pro/header-1177-pro-base.js +11 -0
  197. package/components/header-1177-pro/header-1177-pro-item-base.d.ts +8 -0
  198. package/components/header-1177-pro/header-1177-pro-item-base.js +12 -0
  199. package/components/header-1177-pro/header-1177-pro-item.d.ts +3 -8
  200. package/components/header-1177-pro/header-1177-pro-item.js +5 -27
  201. package/components/header-1177-pro/header-1177-pro-menu-mobile-base.d.ts +11 -0
  202. package/components/header-1177-pro/header-1177-pro-menu-mobile-base.js +18 -0
  203. package/components/header-1177-pro/header-1177-pro-menu-mobile.d.ts +5 -6
  204. package/components/header-1177-pro/header-1177-pro-menu-mobile.js +27 -25
  205. package/components/header-1177-pro/header-1177-pro-nav-base.d.ts +10 -0
  206. package/components/header-1177-pro/header-1177-pro-nav-base.js +10 -0
  207. package/components/header-1177-pro/header-1177-pro-nav-item-base.d.ts +18 -0
  208. package/components/header-1177-pro/header-1177-pro-nav-item-base.js +31 -0
  209. package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.d.ts +7 -0
  210. package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.js +10 -0
  211. package/components/header-1177-pro/header-1177-pro-nav-item-mobile.d.ts +7 -0
  212. package/components/header-1177-pro/header-1177-pro-nav-item-mobile.js +11 -0
  213. package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +6 -6
  214. package/components/header-1177-pro/header-1177-pro-nav-item.js +44 -35
  215. package/components/header-1177-pro/header-1177-pro-nav.d.ts +4 -5
  216. package/components/header-1177-pro/header-1177-pro-nav.js +5 -7
  217. package/components/header-1177-pro/header-1177-pro-region-picker-base.d.ts +9 -0
  218. package/components/header-1177-pro/header-1177-pro-region-picker-base.js +19 -0
  219. package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.d.ts +9 -0
  220. package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.js +19 -0
  221. package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +3 -5
  222. package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +13 -29
  223. package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +3 -5
  224. package/components/header-1177-pro/header-1177-pro-region-picker.js +15 -29
  225. package/components/header-1177-pro/header-1177-pro.d.ts +4 -5
  226. package/components/header-1177-pro/header-1177-pro.js +5 -7
  227. package/components/header-inera/header-inera-base.d.ts +14 -0
  228. package/components/header-inera/header-inera-base.js +11 -0
  229. package/components/header-inera/header-inera-item-base.d.ts +8 -0
  230. package/components/header-inera/header-inera-item-base.js +12 -0
  231. package/components/header-inera/header-inera-item.d.ts +3 -8
  232. package/components/header-inera/header-inera-item.js +5 -36
  233. package/components/header-inera/header-inera-menu-mobile-base.d.ts +11 -0
  234. package/components/header-inera/header-inera-menu-mobile-base.js +18 -0
  235. package/components/header-inera/header-inera-menu-mobile.d.ts +5 -6
  236. package/components/header-inera/header-inera-menu-mobile.js +27 -26
  237. package/components/header-inera/header-inera-nav-base.d.ts +7 -0
  238. package/components/header-inera/header-inera-nav-base.js +10 -0
  239. package/components/header-inera/header-inera-nav-item-base.d.ts +17 -0
  240. package/components/header-inera/header-inera-nav-item-base.js +26 -0
  241. package/components/header-inera/header-inera-nav-item.d.ts +7 -7
  242. package/components/header-inera/header-inera-nav-item.js +44 -34
  243. package/components/header-inera/header-inera-nav.d.ts +4 -6
  244. package/components/header-inera/header-inera-nav.js +4 -7
  245. package/components/header-inera/header-inera.d.ts +1 -3
  246. package/components/header-inera/header-inera.js +5 -7
  247. package/components/header-inera-admin/header-inera-admin-avatar-base.d.ts +14 -0
  248. package/components/header-inera-admin/header-inera-admin-avatar-base.js +23 -0
  249. package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.d.ts +13 -0
  250. package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.js +23 -0
  251. package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +3 -6
  252. package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +26 -21
  253. package/components/header-inera-admin/header-inera-admin-avatar.d.ts +4 -6
  254. package/components/header-inera-admin/header-inera-admin-avatar.js +35 -31
  255. package/components/header-inera-admin/header-inera-admin-base.d.ts +15 -0
  256. package/components/header-inera-admin/header-inera-admin-base.js +20 -0
  257. package/components/header-inera-admin/header-inera-admin-item-base.d.ts +8 -0
  258. package/components/header-inera-admin/header-inera-admin-item-base.js +13 -0
  259. package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -8
  260. package/components/header-inera-admin/header-inera-admin-item.js +6 -26
  261. package/components/header-inera-admin/header-inera-admin-menu-mobile-base.d.ts +11 -0
  262. package/components/header-inera-admin/header-inera-admin-menu-mobile-base.js +18 -0
  263. package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +4 -5
  264. package/components/header-inera-admin/header-inera-admin-menu-mobile.js +27 -25
  265. package/components/header-inera-admin/header-inera-admin-nav-base.d.ts +7 -0
  266. package/components/header-inera-admin/header-inera-admin-nav-base.js +10 -0
  267. package/components/header-inera-admin/header-inera-admin-nav-item-base.d.ts +18 -0
  268. package/components/header-inera-admin/header-inera-admin-nav-item-base.js +31 -0
  269. package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.d.ts +7 -0
  270. package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.js +10 -0
  271. package/components/header-inera-admin/header-inera-admin-nav-item-mobile.d.ts +7 -0
  272. package/components/header-inera-admin/header-inera-admin-nav-item-mobile.js +11 -0
  273. package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +7 -6
  274. package/components/header-inera-admin/header-inera-admin-nav-item.js +44 -34
  275. package/components/header-inera-admin/header-inera-admin-nav.d.ts +4 -6
  276. package/components/header-inera-admin/header-inera-admin-nav.js +5 -8
  277. package/components/header-inera-admin/header-inera-admin.d.ts +3 -4
  278. package/components/header-inera-admin/header-inera-admin.js +5 -16
  279. package/components/header-patient/header-patient.d.ts +2 -4
  280. package/components/header-patient/header-patient.js +6 -10
  281. package/components/{action-link → link}/action-link.js +2 -2
  282. package/components/link/box-link.d.ts +6 -0
  283. package/components/link/box-link.js +9 -0
  284. package/components/link/link.d.ts +2 -2
  285. package/components/link/link.js +3 -10
  286. package/components/list-pagination/list-pagination-links.d.ts +19 -0
  287. package/components/list-pagination/list-pagination-links.js +48 -0
  288. package/components/{pagination/list-pagination → list-pagination}/list-pagination.d.ts +3 -2
  289. package/components/{pagination/list-pagination → list-pagination}/list-pagination.js +4 -3
  290. package/components/mobile-menu/mobile-item-base.d.ts +14 -0
  291. package/components/mobile-menu/mobile-item-base.js +46 -0
  292. package/components/mobile-menu/mobile-item.d.ts +6 -0
  293. package/components/mobile-menu/mobile-item.js +26 -0
  294. package/components/mobile-menu/mobile-menu.d.ts +6 -0
  295. package/components/mobile-menu/mobile-menu.js +10 -0
  296. package/components/{navigation/content → navigation-content}/navigation-content.d.ts +1 -1
  297. package/components/{navigation/content → navigation-content}/navigation-content.js +1 -1
  298. package/components/{navigation/local → navigation-local}/navigation-local.d.ts +1 -1
  299. package/components/{navigation/local → navigation-local}/navigation-local.js +1 -1
  300. package/components/{notification/badge → notification-badge}/notification-badge.d.ts +1 -1
  301. package/components/notification-badge/notification-badge.js +9 -0
  302. package/components/popover/popover-base.d.ts +15 -0
  303. package/components/popover/popover-base.js +27 -0
  304. package/components/popover/popover-content.d.ts +19 -0
  305. package/components/popover/popover-content.js +20 -0
  306. package/components/popover/popover.d.ts +7 -8
  307. package/components/popover/popover.js +67 -161
  308. package/components/progressbar/progressbar.js +2 -2
  309. package/components/puff-list/{puff-list-item/puff-list-item-date.d.ts → puff-list-item-date.d.ts} +0 -1
  310. package/components/puff-list/{puff-list-item/puff-list-item-date.js → puff-list-item-date.js} +2 -3
  311. package/components/puff-list/{puff-list-item/puff-list-item-header.d.ts → puff-list-item-header.d.ts} +1 -1
  312. package/components/puff-list/puff-list-item-header.js +12 -0
  313. package/components/puff-list/{puff-list-item/puff-list-item-info.d.ts → puff-list-item-info.d.ts} +1 -2
  314. package/components/puff-list/puff-list-item-info.js +8 -0
  315. package/components/puff-list/{puff-list-item/puff-list-item.d.ts → puff-list-item.d.ts} +0 -2
  316. package/components/puff-list/{puff-list-item/puff-list-item.js → puff-list-item.js} +2 -3
  317. package/components/puff-list/puff-list.js +2 -3
  318. package/components/region-icon/region-icon.js +2 -2
  319. package/components/side-menu/side-menu-base.d.ts +22 -0
  320. package/components/side-menu/side-menu-base.js +42 -0
  321. package/components/side-menu/side-menu.d.ts +6 -9
  322. package/components/side-menu/side-menu.js +13 -43
  323. package/components/side-panel/side-panel-base.d.ts +24 -0
  324. package/components/side-panel/side-panel-base.js +33 -0
  325. package/components/side-panel/side-panel-provider.d.ts +7 -0
  326. package/components/side-panel/side-panel-provider.js +12 -0
  327. package/components/side-panel/side-panel.d.ts +14 -15
  328. package/components/side-panel/side-panel.js +49 -54
  329. package/components/stepper/step-base.d.ts +15 -0
  330. package/components/stepper/step-base.js +36 -0
  331. package/components/stepper/step.d.ts +5 -8
  332. package/components/stepper/step.js +17 -33
  333. package/components/stepper/stepper.d.ts +4 -6
  334. package/components/stepper/stepper.js +8 -13
  335. package/components/tabs/tab-link.d.ts +15 -0
  336. package/components/tabs/tab-link.js +10 -0
  337. package/components/tabs/tab-panel.d.ts +2 -4
  338. package/components/tabs/tab-panel.js +5 -12
  339. package/components/tabs/tab.d.ts +5 -5
  340. package/components/tabs/tab.js +5 -8
  341. package/components/tabs/tabs-base.d.ts +15 -0
  342. package/components/tabs/tabs-base.js +15 -0
  343. package/components/tabs/tabs.d.ts +5 -8
  344. package/components/tabs/tabs.js +38 -51
  345. package/components/tag/tag.d.ts +5 -15
  346. package/components/tag/tag.js +3 -8
  347. package/components/tooltip/tooltip-base.d.ts +14 -0
  348. package/components/tooltip/tooltip-base.js +18 -0
  349. package/components/tooltip/tooltip.d.ts +3 -10
  350. package/components/tooltip/tooltip.js +59 -43
  351. package/components/utils/contexts/HeaderContext.d.ts +1 -0
  352. package/index.d.ts +90 -16
  353. package/index.js +90 -16
  354. package/package.json +2 -2
  355. package/components/box-link/box-link.d.ts +0 -9
  356. package/components/box-link/box-link.js +0 -11
  357. package/components/global-alert/global-alert.d.ts +0 -16
  358. package/components/global-alert/global-alert.js +0 -26
  359. package/components/mobile/menu/item/mobile-item.d.ts +0 -15
  360. package/components/mobile/menu/item/mobile-item.js +0 -61
  361. package/components/mobile/menu/mobile-menu.d.ts +0 -7
  362. package/components/mobile/menu/mobile-menu.js +0 -12
  363. package/components/notification/badge/notification-badge.js +0 -9
  364. package/components/pagination/data-pagination/data-pagination.js +0 -16
  365. package/components/puff-list/puff-list-item/puff-list-item-header.js +0 -11
  366. package/components/puff-list/puff-list-item/puff-list-item-info.js +0 -10
  367. package/components/utils/hooks/useElementId.d.ts +0 -5
  368. package/components/utils/hooks/useElementId.js +0 -12
  369. /package/components/{button-group → button}/button-group.d.ts +0 -0
  370. /package/components/{action-link → link}/action-link.d.ts +0 -0
@@ -1,7 +1,12 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import { Matcher, Modifiers } from "react-day-picker";
3
- import "@inera/ids-design/components/form/datepicker/datepicker.css";
4
- export interface IDSDatePickerProps extends React.HTMLAttributes<HTMLElement> {
3
+ export interface IDSDatePickerChangeEvent {
4
+ value: string;
5
+ valueAsDate?: Date;
6
+ invalidDate: boolean;
7
+ missingDate: boolean;
8
+ }
9
+ export interface IDSDatePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
5
10
  label: string;
6
11
  value?: string;
7
12
  light?: boolean;
@@ -21,9 +26,11 @@ export interface IDSDatePickerProps extends React.HTMLAttributes<HTMLElement> {
21
26
  invalidDateErrorMsg?: string;
22
27
  invalid?: boolean;
23
28
  disableNavigation?: boolean;
29
+ tooltip?: ReactNode;
24
30
  modifiers?: Record<string, Matcher | Matcher[]>;
31
+ onChange?: (event: IDSDatePickerChangeEvent) => void;
25
32
  onOpen?: () => void;
26
33
  onClose?: () => void;
27
34
  onDayClick?: (date: Date, modifiers: Modifiers, e: React.MouseEvent) => void;
28
35
  }
29
- export declare function IDSDatePicker({ label, value, light, placeholder, errorMsg, missingDateErrorMsg, invalidDateErrorMsg, calendarHeader, srOpenText, srCloseText, defaultMonth, startMonth, endMonth, noValidation, disabled, required, invalid, disableNavigation, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }: IDSDatePickerProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function IDSDatePicker({ label, value, light, placeholder, errorMsg, missingDateErrorMsg, invalidDateErrorMsg, calendarHeader, srOpenText, srCloseText, defaultMonth, startMonth, endMonth, noValidation, disabled, required, invalid, tooltip, disableNavigation, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }: IDSDatePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,12 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useRef, useState, useEffect } from 'react';
3
- import { getWeek, format, isValid, subMonths, addMonths } from 'date-fns';
2
+ import { useRef, useId, useState, useEffect } from 'react';
3
+ import { isValid, getWeek, format, subMonths, addMonths } from 'date-fns';
4
4
  import { sv } from 'react-day-picker/locale';
5
5
  import clsx from 'clsx';
6
- import { useElementId } from '../../utils/hooks/useElementId.js';
7
6
  import { IDSErrorMessage } from '../error-message/error-message.js';
8
7
  import { DayPicker, WeekNumberHeader, MonthsDropdown, YearsDropdown, useDayPicker, DropdownNav } from 'react-day-picker';
9
8
  import { useFocusTrap } from '../../utils/hooks/useFocusTrap.js';
10
9
  import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
11
- import '@inera/ids-design/components/form/datepicker/datepicker.css';
12
10
 
13
11
  const locale = { locale: sv };
14
12
  const createNewDate = (dateString) => {
@@ -26,7 +24,7 @@ const getPrevMonthYear = (date) => {
26
24
  const getNextMonthYear = (date) => {
27
25
  return `${getSweMonth(addMonths(date, 1))} ${getSweYear(addMonths(date, 1))}`;
28
26
  };
29
- function IDSDatePicker({ label, value = "", light = false, placeholder = "åååå/mm/dd", errorMsg = "", missingDateErrorMsg = "Datum saknas", invalidDateErrorMsg = "Ogiltigt datum", calendarHeader = "Välj datum", srOpenText = "Öppna kalendern", srCloseText = "Stäng kalendern", defaultMonth, startMonth = new Date(1900, 0, 1), endMonth = new Date(2050, 0, 1), noValidation = false, disabled = false, required = false, invalid = false, disableNavigation = false, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }) {
27
+ function IDSDatePicker({ label, value, light = false, placeholder = "åååå/mm/dd", errorMsg = "", missingDateErrorMsg = "Datum saknas", invalidDateErrorMsg = "Ogiltigt datum", calendarHeader = "Välj datum", srOpenText = "Öppna kalendern", srCloseText = "Stäng kalendern", defaultMonth, startMonth = new Date(1900, 0, 1), endMonth = new Date(2050, 0, 1), noValidation = false, disabled = false, required = false, invalid = false, tooltip, disableNavigation = false, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }) {
30
28
  const shortWeek = "v.";
31
29
  const inputRef = useRef(null);
32
30
  const triggerRef = useRef(null);
@@ -34,10 +32,10 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
34
32
  const headerRef = useRef(null);
35
33
  const prevMonthButtonRef = useRef(null);
36
34
  const nextMonthButtonRef = useRef(null);
37
- const dialogId = useElementId();
38
- const headerId = useElementId();
39
- const inputId = useElementId();
40
- const errorMsgId = useElementId();
35
+ const dialogId = `datepicker-dialog-${useId()}`;
36
+ const headerId = `datepicker-header-${useId()}`;
37
+ const inputId = `datepicker-input-${useId()}`;
38
+ const errorMsgId = `datepicker-error-${useId()}`;
41
39
  const [isDialogOpen, setIsDialogOpen] = useState(false);
42
40
  const [inputValue, setInputValue] = useState(value);
43
41
  const initialSelectedDate = !!value ? createNewDate(value) : undefined;
@@ -48,7 +46,7 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
48
46
  const [isInvalid, setIsInvalid] = useState(invalid);
49
47
  const showInvalidError = !!hasDateError && !!invalidDateErrorMsg;
50
48
  const showMissingError = !!hasMissingError && !!missingDateErrorMsg;
51
- const showError = !!invalid && !!errorMsg;
49
+ const showError = !!invalid && !!errorMsg && !isDialogOpen;
52
50
  useAriaDescribedBy(inputRef, errorMsgId, isInvalid, (showError || showMissingError || showInvalidError) && !noValidation);
53
51
  useFocusTrap(dialogRef.current, isDialogOpen);
54
52
  const handleOpenDialog = (e) => {
@@ -61,6 +59,27 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
61
59
  triggerRef.current.focus();
62
60
  onClose?.();
63
61
  };
62
+ useEffect(() => {
63
+ const handleClickOutside = (event) => {
64
+ if (dialogRef.current && !dialogRef.current.contains(event.target)) {
65
+ setIsDialogOpen(false);
66
+ }
67
+ };
68
+ document.addEventListener("mousedown", handleClickOutside);
69
+ return () => document.removeEventListener("mousedown", handleClickOutside);
70
+ }, []);
71
+ useEffect(() => {
72
+ if (!isDialogOpen)
73
+ return;
74
+ const handleKeyDown = (event) => {
75
+ if (event.key === "Escape") {
76
+ event.preventDefault();
77
+ setIsDialogOpen(false);
78
+ }
79
+ };
80
+ document.addEventListener("keydown", handleKeyDown);
81
+ return () => document.removeEventListener("keydown", handleKeyDown);
82
+ }, [isDialogOpen]);
64
83
  const handleDayPickerSelect = (date) => {
65
84
  const dateString = format(date, "yyyy-MM-dd");
66
85
  setHasMissingError(false);
@@ -76,7 +95,7 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
76
95
  }
77
96
  requestAnimationFrame(() => {
78
97
  if (inputRef.current) {
79
- inputRef.current.reportValidity();
98
+ inputRef.current.checkValidity();
80
99
  inputRef.current.dispatchEvent(new Event("input", { bubbles: true }));
81
100
  inputRef.current.dispatchEvent(new Event("change", { bubbles: true }));
82
101
  setHasMissingError(!noValidation && required && inputRef.current.validity.valueMissing);
@@ -87,37 +106,56 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
87
106
  closeDialog();
88
107
  };
89
108
  const handleInvalid = (e) => {
90
- setHasMissingError(!noValidation && required && e.target.validity.valueMissing);
91
- setIsInvalid(!e.target.validity.valid || invalid);
109
+ setHasMissingError(!noValidation && required && e.currentTarget.validity.valueMissing);
110
+ setIsInvalid(!e.currentTarget.validity.valid || invalid);
111
+ emitValue(e.currentTarget.value, undefined);
92
112
  };
113
+ // if the input value is changed programmatically
114
+ useEffect(() => {
115
+ if (value !== inputValue && inputRef.current) {
116
+ setIsInvalid(false);
117
+ setHasDateError(false);
118
+ setInputValue(value);
119
+ setHasMissingError(!noValidation && required && !value);
120
+ if (value) {
121
+ const parsedDate = createNewDate(value);
122
+ if (isValid(parsedDate)) {
123
+ setSelectedDate(parsedDate);
124
+ setMonth(parsedDate);
125
+ }
126
+ else {
127
+ setSelectedDate(undefined);
128
+ setIsInvalid(true);
129
+ setHasDateError(true);
130
+ }
131
+ }
132
+ }
133
+ }, [value, inputRef]);
93
134
  const handleInputChange = (e) => {
94
135
  setHasMissingError(false);
95
136
  setIsInvalid(false);
96
137
  setHasDateError(false);
97
- setInputValue(e.target.value);
98
- const parsedDate = createNewDate(e.target.value);
138
+ setInputValue(e.currentTarget.value);
139
+ const parsedDate = createNewDate(e.currentTarget.value);
99
140
  if (isValid(parsedDate)) {
100
141
  setSelectedDate(parsedDate);
101
142
  setMonth(parsedDate);
102
143
  }
103
144
  else {
104
145
  setSelectedDate(undefined);
146
+ setIsInvalid(!e.currentTarget.validity.valid || invalid);
105
147
  }
106
- emitValue(e.target.value, parsedDate);
148
+ emitValue(e.currentTarget.value, parsedDate);
107
149
  };
108
150
  const emitValue = (val, parsedDate) => {
109
151
  const isMissing = required && !val;
110
- const isValidDate = parsedDate instanceof Date && isValid(parsedDate);
111
- const customEvent = new CustomEvent("change", {
112
- detail: {
113
- value: val,
114
- valueAsDate: isValidDate ? createNewDate(val) : undefined,
115
- invalidDate: !isValid(parsedDate),
116
- missingDate: isMissing
117
- },
118
- bubbles: true
152
+ const isValidDate = parsedDate && parsedDate instanceof Date && isValid(parsedDate);
153
+ onChange?.({
154
+ value: val,
155
+ valueAsDate: isValidDate ? createNewDate(val) : undefined,
156
+ invalidDate: !isValid(parsedDate),
157
+ missingDate: isMissing
119
158
  });
120
- onChange?.(customEvent);
121
159
  };
122
160
  const handleBlur = () => {
123
161
  setHasDateError(!noValidation && value.trim().length && !isValid(selectedDate));
@@ -152,7 +190,7 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
152
190
  return;
153
191
  header?.focus();
154
192
  }, [isDialogOpen]);
155
- return (jsxs("div", { className: clsx("ids-datepicker", { "ids-datepicker--invalid": !noValidation && (isInvalid || hasDateError) }, className), ...props, children: [isDialogOpen && jsx("div", { className: "ids-datepicker__overlay" }), jsx("label", { htmlFor: inputId, className: "ids-label", children: label }), jsxs("div", { className: "ids-datepicker__input-wrapper", children: [jsx("input", { className: clsx("ids-datepicker__input", { "ids-input--light": light }), ref: inputRef, style: { fontSize: "inherit" }, id: inputId, type: "text", value: inputValue, required: required, disabled: disabled, "aria-invalid": !noValidation && (isInvalid || hasDateError), placeholder: placeholder, onChange: handleInputChange, onInvalid: handleInvalid, onBlur: handleBlur }), jsx("button", { ref: triggerRef, className: "ids-datepicker__trigger", style: { fontSize: "inherit" }, disabled: disabled, onClick: handleOpenDialog, "aria-controls": "dialog", "aria-haspopup": "dialog", "aria-expanded": isDialogOpen, "aria-label": srOpenText }), jsxs("div", { className: clsx("ids-datepicker__dialog", { "ids-datepicker__dialog--show": isDialogOpen }), role: "dialog", ref: dialogRef, id: dialogId, "aria-modal": true, "aria-labelledby": headerId, children: [jsxs("div", { className: "ids-datepicker__dialog-bar", children: [jsx("div", { className: "ids-datepicker__dialog-header", id: headerId, ref: headerRef, tabIndex: -1, children: calendarHeader }), jsx("button", { className: "ids-datepicker__dialog-close-button", onClick: closeDialog, "aria-label": srCloseText })] }), jsx(DayPicker, { mode: "single", locale: sv, labels: {
193
+ return (jsxs("div", { className: clsx("ids-datepicker", { "ids-datepicker--invalid": !noValidation && (isInvalid || hasDateError) }, className), ...props, children: [isDialogOpen && jsx("div", { className: "ids-datepicker__overlay" }), label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { htmlFor: inputId, className: "ids-label", children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsxs("div", { className: "ids-datepicker__input-wrapper", children: [jsx("input", { className: clsx("ids-datepicker__input", { "ids-input--light": light }), ref: inputRef, style: { fontSize: "inherit" }, id: inputId, type: "text", value: inputValue, required: required, disabled: disabled, "aria-invalid": !noValidation && (isInvalid || hasDateError), placeholder: placeholder, onChange: handleInputChange, onInvalid: handleInvalid, onBlur: handleBlur }), jsx("button", { ref: triggerRef, type: "button", className: "ids-datepicker__trigger", style: { fontSize: "inherit" }, disabled: disabled, onClick: handleOpenDialog, "aria-controls": "dialog", "aria-haspopup": "dialog", "aria-expanded": isDialogOpen, "aria-label": srOpenText }), jsxs("div", { className: clsx("ids-datepicker__dialog", { "ids-datepicker__dialog--show": isDialogOpen }), role: "dialog", ref: dialogRef, id: dialogId, "aria-modal": true, "aria-labelledby": headerId, children: [jsxs("div", { className: "ids-datepicker__dialog-bar", children: [jsx("div", { className: "ids-datepicker__dialog-header", id: headerId, ref: headerRef, tabIndex: -1, children: calendarHeader }), jsx("button", { className: "ids-datepicker__dialog-close-button", onClick: closeDialog, "aria-label": srCloseText })] }), jsx(DayPicker, { mode: "single", locale: sv, labels: {
156
194
  labelWeekNumberHeader: () => "Veckonumer",
157
195
  labelWeekNumber: (weekNumber) => `vecka`,
158
196
  labelDayButton(date, modifiers, options, dateLib) {
@@ -1,10 +1,9 @@
1
1
  import React, { ReactNode } from "react";
2
- import "@inera/ids-design/components/form/error-message/error-message.css";
3
2
  interface IDSErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
4
3
  id?: string;
5
4
  show?: boolean;
6
5
  compact?: boolean;
7
6
  children?: ReactNode;
8
7
  }
9
- export declare const IDSErrorMessage: React.FC<IDSErrorMessageProps>;
8
+ export declare function IDSErrorMessage({ show, compact, id, children, className, ...props }: IDSErrorMessageProps): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,12 +1,10 @@
1
- "use client";
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import '@inera/ids-design/components/form/error-message/error-message.css';
4
2
  import clsx from 'clsx';
5
3
 
6
- const IDSErrorMessage = ({ show = false, compact = false, id, children, className, ...props }) => {
4
+ function IDSErrorMessage({ show = false, compact = false, id, children, className, ...props }) {
7
5
  return (jsx("div", { id: id, style: { marginTop: compact && "0" }, className: clsx("ids-error-message", {
8
6
  "ids-error-message--show": show
9
7
  }, className), ...props, children: jsxs("span", { className: "ids-error-message__text", children: [" ", children, " "] }) }));
10
- };
8
+ }
11
9
 
12
10
  export { IDSErrorMessage };
@@ -1 +1,4 @@
1
- export declare function useGroupValidity(ref: React.RefObject<HTMLFieldSetElement>, type: "checkbox" | "radio", onInvalid?: () => void): boolean;
1
+ export declare function useGroupValidity(ref: React.RefObject<HTMLFieldSetElement>, type: "checkbox" | "radio", onInvalid?: () => void): {
2
+ isValid: boolean;
3
+ hasInteracted: boolean;
4
+ };
@@ -34,7 +34,9 @@ function useGroupValidity(ref, type, onInvalid) {
34
34
  validate();
35
35
  };
36
36
  const handleChange = () => {
37
- setHasInteracted(false);
37
+ if (isValid) {
38
+ setHasInteracted(false);
39
+ }
38
40
  validate();
39
41
  };
40
42
  inputs.forEach(cb => {
@@ -55,7 +57,10 @@ function useGroupValidity(ref, type, onInvalid) {
55
57
  form?.removeEventListener("submit", handleSubmit);
56
58
  };
57
59
  }, [ref, onInvalid]);
58
- return isValid || !hasInteracted;
60
+ return {
61
+ isValid,
62
+ hasInteracted
63
+ };
59
64
  }
60
65
 
61
66
  export { useGroupValidity };
@@ -1 +1 @@
1
- export declare function useInputValidity(ref: React.RefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>): boolean;
1
+ export declare function useInputValidity(ref: React.RefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, validateOnBlur?: boolean): boolean;
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
 
3
- function useInputValidity(ref) {
3
+ function useInputValidity(ref, validateOnBlur) {
4
4
  const [isValid, setIsValid] = useState(true);
5
5
  useEffect(() => {
6
6
  const inputEl = ref.current;
@@ -11,13 +11,17 @@ function useInputValidity(ref) {
11
11
  };
12
12
  const form = inputEl.closest("form");
13
13
  form?.addEventListener("submit", updateValidity);
14
- inputEl.addEventListener("blur", updateValidity);
15
- inputEl.addEventListener("change", updateValidity);
14
+ if (validateOnBlur) {
15
+ inputEl.addEventListener("blur", updateValidity);
16
+ }
17
+ inputEl.addEventListener("input", updateValidity);
16
18
  inputEl.addEventListener("invalid", updateValidity);
17
19
  return () => {
18
20
  form?.removeEventListener("submit", updateValidity);
19
- inputEl.removeEventListener("blur", updateValidity);
20
- inputEl.removeEventListener("change", updateValidity);
21
+ if (validateOnBlur) {
22
+ inputEl.removeEventListener("blur", updateValidity);
23
+ }
24
+ inputEl.removeEventListener("input", updateValidity);
21
25
  inputEl.removeEventListener("invalid", updateValidity);
22
26
  };
23
27
  }, [ref]);
@@ -0,0 +1,24 @@
1
+ import React, { ReactNode, InputHTMLAttributes, CSSProperties } from "react";
2
+ export interface IDSInputBaseProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ label: string;
4
+ type?: string;
5
+ icon?: string;
6
+ hint?: string | ReactNode;
7
+ showSearchLabel?: boolean;
8
+ errorMsg?: string;
9
+ disabled?: boolean;
10
+ invalid?: boolean;
11
+ required?: boolean;
12
+ focusAnchor?: boolean;
13
+ light?: boolean;
14
+ readOnly?: boolean;
15
+ tooltip?: ReactNode;
16
+ submitButton?: ReactNode;
17
+ dataTestId?: string;
18
+ id?: string;
19
+ hintId?: string;
20
+ errorMsgId?: string;
21
+ inputRef?: React.Ref<HTMLInputElement>;
22
+ style?: CSSProperties;
23
+ }
24
+ export declare function IDSInputBase({ label, type, icon, hint, showSearchLabel, errorMsg, dataTestId, disabled, invalid, required, focusAnchor, light, readOnly, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef, style, ...props }: IDSInputBaseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useId } from 'react';
3
+ import clsx from 'clsx';
4
+ import { IDSErrorMessage } from '../error-message/error-message.js';
5
+
6
+ function IDSInputBase({ label, type = "text", icon, hint, showSearchLabel = false, errorMsg, dataTestId, disabled = false, invalid = false, required = false, focusAnchor = false, light = false, readOnly = false, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef, style, ...props }) {
7
+ const reactId = useId();
8
+ const inputId = !!id ? id : `input-base-${reactId}`;
9
+ const baseHintId = !!hintId ? hintId : `input-base-hint-${reactId}`;
10
+ const baseErrorMsgId = !!errorMsgId ? errorMsgId : `input-base-error-${reactId}`;
11
+ const showErrorMsg = invalid && !!errorMsg;
12
+ const ariaHandler = showErrorMsg
13
+ ? {
14
+ "aria-describedby": baseErrorMsgId
15
+ }
16
+ : !!hint
17
+ ? {
18
+ "aria-describedby": baseHintId
19
+ }
20
+ : {};
21
+ ariaHandler["aria-label"] = type === "search" && !showSearchLabel ? label : "";
22
+ return (jsx("div", { className: clsx("ids-input", { "ids-input--search": type === "search", "ids-inout--icon": !!icon }, className), "data-testid": dataTestId, style: style, children: jsxs("div", { className: "ids-input__wrapper", children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { className: clsx("ids-label", {
23
+ "ids-label--disabled": disabled || readOnly,
24
+ "ids-hidden": type === "search" && !showSearchLabel
25
+ }), htmlFor: inputId, children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsxs("div", { className: "ids-input__input-wrapper", children: [type === "search" && jsx("span", { className: "ids-input__search-icon" }), jsx("input", { ref: inputRef, id: inputId, type: type, readOnly: readOnly, className: clsx("ids-input__input", {
26
+ "ids-input--light": light,
27
+ "ids-input--invalid": invalid,
28
+ "ids-focus-anchor": focusAnchor
29
+ }), "aria-invalid": invalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, ...ariaHandler, ...props }), icon && type !== "search" && jsx("span", { className: `ids-input__icon ids-icon-${icon}` })] }), hint && (jsx("div", { id: baseHintId, className: "ids-input__hint", children: hint })), showErrorMsg && (jsx(IDSErrorMessage, { id: baseErrorMsgId, show: true, children: errorMsg }))] }) }));
30
+ }
31
+
32
+ export { IDSInputBase };
@@ -1,4 +1,4 @@
1
- import React, { ReactNode, InputHTMLAttributes } from "react";
1
+ import { ReactNode, InputHTMLAttributes } from "react";
2
2
  interface IDSInputProps extends InputHTMLAttributes<HTMLInputElement> {
3
3
  label: string;
4
4
  type?: string;
@@ -16,6 +16,7 @@ interface IDSInputProps extends InputHTMLAttributes<HTMLInputElement> {
16
16
  tooltip?: ReactNode;
17
17
  submitButton?: ReactNode;
18
18
  dataTestId?: string;
19
+ validationOnBlur?: boolean;
19
20
  }
20
- export declare const IDSInput: React.ForwardRefExoticComponent<IDSInputProps & React.RefAttributes<HTMLInputElement>>;
21
+ export declare const IDSInput: import("react").ForwardRefExoticComponent<IDSInputProps & import("react").RefAttributes<HTMLInputElement>>;
21
22
  export {};
@@ -1,39 +1,23 @@
1
1
  "use client";
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef, useRef } from 'react';
4
- import { useElementId } from '../../utils/hooks/useElementId.js';
5
- import { IDSErrorMessage } from '../error-message/error-message.js';
6
4
  import { useInputValidity } from '../form-hooks/useInputValidity.js';
7
- import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
8
- import clsx from 'clsx';
5
+ import { IDSInputBase } from './input-base.js';
9
6
 
10
- const IDSInput = forwardRef(({ label = "", type = "text", icon = "", hint = "", showSearchLabel = false, errorMsg = "", dataTestId = "", disabled = false, invalid = false, required = false, noValidation = false, focusAnchor = false, light = false, readOnly = false, id, tooltip, submitButton, className, ...props }, ref) => {
11
- const fieldId = useElementId(id);
12
- const errorMsgId = useElementId();
13
- const hintId = useElementId();
7
+ const IDSInput = forwardRef(({ invalid = false, noValidation = false, style, validationOnBlur = false, ...props }, ref) => {
14
8
  const inputRef = useRef(null);
15
- const combinedRef = (node) => {
9
+ // Merge forwarded + local ref
10
+ const mergedRef = (node) => {
16
11
  inputRef.current = node;
17
12
  if (typeof ref === "function")
18
13
  ref(node);
19
14
  else if (ref)
20
15
  ref.current = node;
21
16
  };
22
- const hasValidValue = useInputValidity(inputRef);
17
+ // Validation
18
+ const hasValidValue = useInputValidity(inputRef, validationOnBlur);
23
19
  const isInvalid = (invalid || !hasValidValue) && !noValidation;
24
- useAriaDescribedBy(inputRef, errorMsgId, isInvalid, !!errorMsg && !noValidation, !!hint, hintId);
25
- const inputElement = (jsxs("div", { className: clsx("ids-input__wrapper", {
26
- "ids-input--icon": icon
27
- }), "data-testid": dataTestId, children: [type === "search" && jsx("span", { className: "ids-input__search-icon" }), jsx("input", { ref: combinedRef, id: fieldId, type: type, readOnly: readOnly, className: clsx("ids-input__input", {
28
- "ids-input--light": light,
29
- "ids-input--invalid": invalid,
30
- "ids-focus-anchor": focusAnchor
31
- }), "aria-invalid": isInvalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, ...props }), icon && type !== "search" && jsx("span", { className: `ids-input__icon ids-icon-${icon}` })] }));
32
- const labelElement = (jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
33
- "ids-label--disabled": disabled || readOnly,
34
- "ids-hidden": type === "search" && !showSearchLabel
35
- }), htmlFor: fieldId, children: label }), tooltip] }));
36
- return (jsxs("div", { className: "ids-input-component", children: [jsxs("div", { className: clsx("ids-input", { "ids-input--search": type === "search" }, className), children: [type === "search" ? (jsxs(Fragment, { children: [jsxs("div", { className: "ids-input__search-wrapper", children: [labelElement, inputElement] }), submitButton] })) : (jsxs(Fragment, { children: [labelElement, inputElement] })), hint && (jsx("div", { id: hintId, className: "ids-input__hint", children: hint }))] }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
20
+ return jsx(IDSInputBase, { ...props, style: style, invalid: isInvalid, inputRef: mergedRef });
37
21
  });
38
22
  IDSInput.displayName = "IDSInput";
39
23
 
@@ -0,0 +1,16 @@
1
+ import React, { ReactNode, InputHTMLAttributes } from "react";
2
+ export interface IDSRadioBaseProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ id?: string;
4
+ name?: string;
5
+ light?: boolean;
6
+ compact?: boolean;
7
+ disabled?: boolean;
8
+ invalid?: boolean;
9
+ focusAnchor?: boolean;
10
+ tooltip?: ReactNode;
11
+ dataTestId?: string;
12
+ children?: ReactNode;
13
+ errorMsgId?: string;
14
+ inputRef?: React.Ref<HTMLInputElement>;
15
+ }
16
+ export declare function IDSRadioBase({ id, name, light, compact, disabled, focusAnchor, tooltip, dataTestId, children, className, inputRef, invalid, errorMsgId, ...props }: IDSRadioBaseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useId } from 'react';
3
+ import clsx from 'clsx';
4
+
5
+ function IDSRadioBase({ id, name, light, compact, disabled, focusAnchor, tooltip, dataTestId, children, className, inputRef, invalid, errorMsgId, ...props }) {
6
+ const reactId = useId();
7
+ const inputId = !!id ? id : `radio-base-${reactId}`;
8
+ const showErrorMsg = invalid && !!errorMsgId;
9
+ // for radio the errorMsgId always comes from the group
10
+ const ariaHandler = showErrorMsg
11
+ ? {
12
+ "aria-describedby": errorMsgId
13
+ }
14
+ : {};
15
+ return (jsxs("div", { className: clsx("ids-radio", className), "data-testid": dataTestId, children: [jsx("input", { id: inputId, ref: inputRef, type: "radio", className: clsx("ids-radio__input", {
16
+ "ids-input--light": light,
17
+ "ids-focus-anchor": focusAnchor
18
+ }), name: name, disabled: disabled, "aria-disabled": disabled, "aria-invalid": invalid, ...ariaHandler, ...props }), !!children && (jsxs("div", { className: "ids-label-wrapper", children: [jsx("label", { htmlFor: inputId, className: clsx("ids-radio__label ids-label", {
19
+ "ids-label--clickable": !disabled,
20
+ "ids-label--disabled": disabled
21
+ }), children: children }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] }))] }));
22
+ }
23
+
24
+ export { IDSRadioBase };
@@ -0,0 +1,13 @@
1
+ import React, { ReactNode, FieldsetHTMLAttributes } from "react";
2
+ interface IDSRadioGroupBaseProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
3
+ legend?: string;
4
+ errorMsg?: string | ReactNode;
5
+ compact?: boolean;
6
+ required?: boolean;
7
+ tooltip?: ReactNode;
8
+ invalid?: boolean;
9
+ errorMsgId?: string;
10
+ groupRef?: React.Ref<HTMLFieldSetElement>;
11
+ }
12
+ export declare function IDSRadioGroupBase({ legend, errorMsg, errorMsgId, compact, required, tooltip, className, children, invalid, groupRef, ...props }: IDSRadioGroupBaseProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { IDSErrorMessage } from '../error-message/error-message.js';
3
+ import clsx from 'clsx';
4
+
5
+ function IDSRadioGroupBase({ legend, errorMsg, errorMsgId, compact = false, required = false, tooltip, className, children, invalid, groupRef, ...props }) {
6
+ const showErrorMsg = invalid && !!errorMsg && !!errorMsgId;
7
+ return (jsxs("fieldset", { ref: groupRef, "aria-required": required, className: clsx("ids-form-group__fieldset", { "ids-form-group__fieldset--compact": compact }, className), ...props, children: [legend && (jsx("div", { className: "ids-label-wrapper", children: jsxs("legend", { children: [legend, tooltip && jsx("span", { className: "ids-legend__tooltip", children: tooltip })] }) })), children, showErrorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
8
+ }
9
+
10
+ export { IDSRadioGroupBase };
@@ -1,13 +1,14 @@
1
- import React, { ReactNode, ChangeEvent } from "react";
2
- interface IDSRadioGroupProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {
3
- name: string;
1
+ import { ChangeEvent, ReactNode, FieldsetHTMLAttributes } from "react";
2
+ interface IDSRadioGroupProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
3
+ name?: string;
4
4
  legend?: string;
5
5
  errorMsg?: string | ReactNode;
6
6
  compact?: boolean;
7
+ invalid?: boolean;
7
8
  required?: boolean;
8
9
  tooltip?: ReactNode;
9
- children?: ReactNode;
10
+ noValidation?: boolean;
10
11
  onRadioChange?: (e: ChangeEvent<HTMLInputElement>) => void;
11
12
  }
12
- export declare const IDSRadioGroup: React.FC<IDSRadioGroupProps>;
13
+ export declare function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, children, onRadioChange, ...props }: IDSRadioGroupProps): import("react/jsx-runtime").JSX.Element;
13
14
  export {};
@@ -1,31 +1,37 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import React, { useRef } from 'react';
4
- import { IDSErrorMessage } from '../error-message/error-message.js';
5
- import { useElementId } from '../../utils/hooks/useElementId.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import React, { useRef, useId } from 'react';
4
+ import { IDSRadioGroupBase } from './radio-group-base.js';
5
+ import { IDSRadio } from './radio.js';
6
6
  import { useGroupValidity } from '../form-hooks/useGroupValidity.js';
7
- import clsx from 'clsx';
8
7
 
9
- const IDSRadioGroup = ({ name = "options", legend = "", errorMsg = "", compact = false, required = false, onRadioChange, tooltip, className, children, ...props }) => {
8
+ function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, children, onRadioChange, ...props }) {
10
9
  const groupRef = useRef(null);
11
- const isValid = useGroupValidity(groupRef, "radio");
12
- const errorMsgId = useElementId();
10
+ const { isValid, hasInteracted } = useGroupValidity(groupRef, "radio");
11
+ const reactId = useId();
12
+ const groupName = !!name ? name : `radio-group-name-${reactId}`;
13
+ const errorMsgId = `radio-error-${reactId}`;
13
14
  const clonedChildren = React.Children.map(children, child => {
14
- if (React.isValidElement(child) && child.type.displayName === "IDSRadio") {
15
- return React.cloneElement(child, {
15
+ if (!React.isValidElement(child))
16
+ return child;
17
+ if (child.type === IDSRadio) {
18
+ const { id, ...rest } = child.props;
19
+ const cloneProps = {
20
+ ...rest,
16
21
  key: child.props.id,
17
- name,
18
- required,
19
- groupErrorMsgId: errorMsg && errorMsgId,
20
- groupInvalid: !isValid,
22
+ id: child.props.id,
23
+ name: groupName,
24
+ required: required && !noValidation,
25
+ noValidation,
26
+ groupErrorMsgId: errorMsg ? errorMsgId : undefined,
27
+ groupInvalid: !isValid && hasInteracted && !noValidation,
21
28
  onChange: onRadioChange
22
- });
29
+ };
30
+ return React.cloneElement(child, cloneProps);
23
31
  }
24
32
  return child;
25
33
  });
26
- return (jsxs("fieldset", { ref: groupRef, "aria-required": required, className: clsx("ids-form-group__fieldset", {
27
- "ids-form-group__fieldset--compact": compact
28
- }, className), ...props, children: [jsxs("legend", { children: [legend, tooltip] }), clonedChildren, !isValid && !!errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
29
- };
34
+ return (jsx(IDSRadioGroupBase, { ...props, groupRef: groupRef, invalid: !isValid && hasInteracted || invalid, errorMsg: !noValidation && errorMsg, errorMsgId: errorMsgId, children: clonedChildren }));
35
+ }
30
36
 
31
37
  export { IDSRadioGroup };
@@ -1,18 +1,18 @@
1
- import { ReactNode, ChangeEvent, InputHTMLAttributes } from "react";
1
+ import { ReactNode, InputHTMLAttributes } from "react";
2
2
  export interface IDSRadioProps extends InputHTMLAttributes<HTMLInputElement> {
3
- name?: string;
4
3
  id?: string;
5
- groupErrorMsgId?: string;
6
- invalid?: boolean;
7
- groupInvalid?: boolean;
8
- disabled?: boolean;
9
- noValidation?: boolean;
4
+ key?: string;
5
+ name?: string;
10
6
  light?: boolean;
11
7
  compact?: boolean;
8
+ disabled?: boolean;
9
+ invalid?: boolean;
10
+ groupInvalid?: boolean;
12
11
  focusAnchor?: boolean;
13
12
  tooltip?: ReactNode;
14
- children?: ReactNode;
15
- onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
16
13
  dataTestId?: string;
14
+ children?: ReactNode;
15
+ noValidation?: boolean;
16
+ groupErrorMsgId?: string;
17
17
  }
18
18
  export declare const IDSRadio: import("react").ForwardRefExoticComponent<IDSRadioProps & import("react").RefAttributes<HTMLInputElement>>;