@inera/ids-react 8.1.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 (372) 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 -40
  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 +36 -0
  60. package/components/form/datepicker/datepicker.js +217 -0
  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 -19
  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.d.ts +1 -0
  112. package/components/grid/container.js +9 -5
  113. package/components/grid/row.js +1 -1
  114. package/components/grid-layout/grid-column.d.ts +19 -0
  115. package/components/grid-layout/grid-column.js +14 -0
  116. package/components/grid-layout/grid-container.d.ts +10 -0
  117. package/components/grid-layout/grid-container.js +17 -0
  118. package/components/grid-layout/grid-row.d.ts +8 -0
  119. package/components/grid-layout/grid-row.js +12 -0
  120. package/components/header-1177/header-1177-avatar-base.d.ts +16 -0
  121. package/components/header-1177/header-1177-avatar-base.js +24 -0
  122. package/components/header-1177/header-1177-avatar.d.ts +4 -7
  123. package/components/header-1177/header-1177-avatar.js +35 -42
  124. package/components/header-1177/header-1177-base.d.ts +18 -0
  125. package/components/header-1177/header-1177-base.js +14 -0
  126. package/components/header-1177/header-1177-item-base.d.ts +9 -0
  127. package/components/header-1177/header-1177-item-base.js +13 -0
  128. package/components/header-1177/header-1177-item.d.ts +2 -7
  129. package/components/header-1177/header-1177-item.js +6 -29
  130. package/components/header-1177/header-1177-menu-mobile-base.d.ts +12 -0
  131. package/components/header-1177/header-1177-menu-mobile-base.js +18 -0
  132. package/components/header-1177/header-1177-menu-mobile.d.ts +4 -5
  133. package/components/header-1177/header-1177-menu-mobile.js +29 -28
  134. package/components/header-1177/header-1177-nav-base.d.ts +9 -0
  135. package/components/header-1177/header-1177-nav-base.js +12 -0
  136. package/components/header-1177/header-1177-nav-item-base.d.ts +18 -0
  137. package/components/header-1177/header-1177-nav-item-base.js +31 -0
  138. package/components/header-1177/header-1177-nav-item-mobile-base.d.ts +7 -0
  139. package/components/header-1177/header-1177-nav-item-mobile-base.js +10 -0
  140. package/components/header-1177/header-1177-nav-item-mobile.d.ts +4 -8
  141. package/components/header-1177/header-1177-nav-item-mobile.js +5 -16
  142. package/components/header-1177/header-1177-nav-item.d.ts +7 -7
  143. package/components/header-1177/header-1177-nav-item.js +44 -35
  144. package/components/header-1177/header-1177-nav.d.ts +2 -4
  145. package/components/header-1177/header-1177-nav.js +5 -9
  146. package/components/header-1177/header-1177-region-picker-base.d.ts +9 -0
  147. package/components/header-1177/header-1177-region-picker-base.js +21 -0
  148. package/components/header-1177/header-1177-region-picker-mobile-base.d.ts +9 -0
  149. package/components/header-1177/header-1177-region-picker-mobile-base.js +21 -0
  150. package/components/header-1177/header-1177-region-picker-mobile.d.ts +3 -6
  151. package/components/header-1177/header-1177-region-picker-mobile.js +13 -29
  152. package/components/header-1177/header-1177-region-picker.d.ts +3 -6
  153. package/components/header-1177/header-1177-region-picker.js +15 -29
  154. package/components/header-1177/header-1177.d.ts +3 -3
  155. package/components/header-1177/header-1177.js +5 -10
  156. package/components/header-1177-admin/header-1177-admin-avatar-base.d.ts +14 -0
  157. package/components/header-1177-admin/header-1177-admin-avatar-base.js +23 -0
  158. package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.d.ts +13 -0
  159. package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.js +23 -0
  160. package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +3 -5
  161. package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +27 -23
  162. package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -5
  163. package/components/header-1177-admin/header-1177-admin-avatar.js +26 -25
  164. package/components/header-1177-admin/header-1177-admin-base.d.ts +18 -0
  165. package/components/header-1177-admin/header-1177-admin-base.js +14 -0
  166. package/components/header-1177-admin/header-1177-admin-item-base.d.ts +8 -0
  167. package/components/header-1177-admin/header-1177-admin-item-base.js +12 -0
  168. package/components/header-1177-admin/header-1177-admin-item.d.ts +3 -8
  169. package/components/header-1177-admin/header-1177-admin-item.js +5 -27
  170. package/components/header-1177-admin/header-1177-admin-menu-mobile-base.d.ts +11 -0
  171. package/components/header-1177-admin/header-1177-admin-menu-mobile-base.js +18 -0
  172. package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +4 -5
  173. package/components/header-1177-admin/header-1177-admin-menu-mobile.js +27 -25
  174. package/components/header-1177-admin/header-1177-admin-nav-base.d.ts +7 -0
  175. package/components/header-1177-admin/header-1177-admin-nav-base.js +10 -0
  176. package/components/header-1177-admin/header-1177-admin-nav-item-base.d.ts +18 -0
  177. package/components/header-1177-admin/header-1177-admin-nav-item-base.js +31 -0
  178. package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.d.ts +7 -0
  179. package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.js +10 -0
  180. package/components/header-1177-admin/header-1177-admin-nav-item-mobile.d.ts +7 -0
  181. package/components/header-1177-admin/header-1177-admin-nav-item-mobile.js +11 -0
  182. package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +6 -6
  183. package/components/header-1177-admin/header-1177-admin-nav-item.js +44 -35
  184. package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -4
  185. package/components/header-1177-admin/header-1177-admin-nav.js +4 -6
  186. package/components/header-1177-admin/header-1177-admin.d.ts +2 -3
  187. package/components/header-1177-admin/header-1177-admin.js +5 -10
  188. package/components/header-1177-pro/header-1177-pro-avatar-base.d.ts +14 -0
  189. package/components/header-1177-pro/header-1177-pro-avatar-base.js +23 -0
  190. package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.d.ts +13 -0
  191. package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.js +24 -0
  192. package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +3 -6
  193. package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +23 -20
  194. package/components/header-1177-pro/header-1177-pro-avatar.d.ts +4 -6
  195. package/components/header-1177-pro/header-1177-pro-avatar.js +32 -30
  196. package/components/header-1177-pro/header-1177-pro-base.d.ts +19 -0
  197. package/components/header-1177-pro/header-1177-pro-base.js +11 -0
  198. package/components/header-1177-pro/header-1177-pro-item-base.d.ts +8 -0
  199. package/components/header-1177-pro/header-1177-pro-item-base.js +12 -0
  200. package/components/header-1177-pro/header-1177-pro-item.d.ts +3 -8
  201. package/components/header-1177-pro/header-1177-pro-item.js +5 -27
  202. package/components/header-1177-pro/header-1177-pro-menu-mobile-base.d.ts +11 -0
  203. package/components/header-1177-pro/header-1177-pro-menu-mobile-base.js +18 -0
  204. package/components/header-1177-pro/header-1177-pro-menu-mobile.d.ts +5 -6
  205. package/components/header-1177-pro/header-1177-pro-menu-mobile.js +27 -25
  206. package/components/header-1177-pro/header-1177-pro-nav-base.d.ts +10 -0
  207. package/components/header-1177-pro/header-1177-pro-nav-base.js +10 -0
  208. package/components/header-1177-pro/header-1177-pro-nav-item-base.d.ts +18 -0
  209. package/components/header-1177-pro/header-1177-pro-nav-item-base.js +31 -0
  210. package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.d.ts +7 -0
  211. package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.js +10 -0
  212. package/components/header-1177-pro/header-1177-pro-nav-item-mobile.d.ts +7 -0
  213. package/components/header-1177-pro/header-1177-pro-nav-item-mobile.js +11 -0
  214. package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +6 -6
  215. package/components/header-1177-pro/header-1177-pro-nav-item.js +44 -35
  216. package/components/header-1177-pro/header-1177-pro-nav.d.ts +4 -5
  217. package/components/header-1177-pro/header-1177-pro-nav.js +5 -7
  218. package/components/header-1177-pro/header-1177-pro-region-picker-base.d.ts +9 -0
  219. package/components/header-1177-pro/header-1177-pro-region-picker-base.js +19 -0
  220. package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.d.ts +9 -0
  221. package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.js +19 -0
  222. package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +3 -5
  223. package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +13 -29
  224. package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +3 -5
  225. package/components/header-1177-pro/header-1177-pro-region-picker.js +15 -29
  226. package/components/header-1177-pro/header-1177-pro.d.ts +4 -5
  227. package/components/header-1177-pro/header-1177-pro.js +5 -7
  228. package/components/header-inera/header-inera-base.d.ts +14 -0
  229. package/components/header-inera/header-inera-base.js +11 -0
  230. package/components/header-inera/header-inera-item-base.d.ts +8 -0
  231. package/components/header-inera/header-inera-item-base.js +12 -0
  232. package/components/header-inera/header-inera-item.d.ts +3 -8
  233. package/components/header-inera/header-inera-item.js +5 -36
  234. package/components/header-inera/header-inera-menu-mobile-base.d.ts +11 -0
  235. package/components/header-inera/header-inera-menu-mobile-base.js +18 -0
  236. package/components/header-inera/header-inera-menu-mobile.d.ts +5 -6
  237. package/components/header-inera/header-inera-menu-mobile.js +27 -26
  238. package/components/header-inera/header-inera-nav-base.d.ts +7 -0
  239. package/components/header-inera/header-inera-nav-base.js +10 -0
  240. package/components/header-inera/header-inera-nav-item-base.d.ts +17 -0
  241. package/components/header-inera/header-inera-nav-item-base.js +26 -0
  242. package/components/header-inera/header-inera-nav-item.d.ts +7 -7
  243. package/components/header-inera/header-inera-nav-item.js +44 -34
  244. package/components/header-inera/header-inera-nav.d.ts +4 -6
  245. package/components/header-inera/header-inera-nav.js +4 -7
  246. package/components/header-inera/header-inera.d.ts +1 -3
  247. package/components/header-inera/header-inera.js +5 -7
  248. package/components/header-inera-admin/header-inera-admin-avatar-base.d.ts +14 -0
  249. package/components/header-inera-admin/header-inera-admin-avatar-base.js +23 -0
  250. package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.d.ts +13 -0
  251. package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.js +23 -0
  252. package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +3 -6
  253. package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +26 -21
  254. package/components/header-inera-admin/header-inera-admin-avatar.d.ts +4 -6
  255. package/components/header-inera-admin/header-inera-admin-avatar.js +35 -31
  256. package/components/header-inera-admin/header-inera-admin-base.d.ts +15 -0
  257. package/components/header-inera-admin/header-inera-admin-base.js +20 -0
  258. package/components/header-inera-admin/header-inera-admin-item-base.d.ts +8 -0
  259. package/components/header-inera-admin/header-inera-admin-item-base.js +13 -0
  260. package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -8
  261. package/components/header-inera-admin/header-inera-admin-item.js +6 -26
  262. package/components/header-inera-admin/header-inera-admin-menu-mobile-base.d.ts +11 -0
  263. package/components/header-inera-admin/header-inera-admin-menu-mobile-base.js +18 -0
  264. package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +4 -5
  265. package/components/header-inera-admin/header-inera-admin-menu-mobile.js +27 -25
  266. package/components/header-inera-admin/header-inera-admin-nav-base.d.ts +7 -0
  267. package/components/header-inera-admin/header-inera-admin-nav-base.js +10 -0
  268. package/components/header-inera-admin/header-inera-admin-nav-item-base.d.ts +18 -0
  269. package/components/header-inera-admin/header-inera-admin-nav-item-base.js +31 -0
  270. package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.d.ts +7 -0
  271. package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.js +10 -0
  272. package/components/header-inera-admin/header-inera-admin-nav-item-mobile.d.ts +7 -0
  273. package/components/header-inera-admin/header-inera-admin-nav-item-mobile.js +11 -0
  274. package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +7 -6
  275. package/components/header-inera-admin/header-inera-admin-nav-item.js +44 -34
  276. package/components/header-inera-admin/header-inera-admin-nav.d.ts +4 -6
  277. package/components/header-inera-admin/header-inera-admin-nav.js +5 -8
  278. package/components/header-inera-admin/header-inera-admin.d.ts +3 -4
  279. package/components/header-inera-admin/header-inera-admin.js +5 -16
  280. package/components/header-patient/header-patient.d.ts +2 -4
  281. package/components/header-patient/header-patient.js +6 -10
  282. package/components/link/action-link.d.ts +6 -0
  283. package/components/link/action-link.js +9 -0
  284. package/components/link/box-link.d.ts +6 -0
  285. package/components/link/box-link.js +9 -0
  286. package/components/link/link.d.ts +2 -2
  287. package/components/link/link.js +3 -10
  288. package/components/list-pagination/list-pagination-links.d.ts +19 -0
  289. package/components/list-pagination/list-pagination-links.js +48 -0
  290. package/components/{pagination/list-pagination → list-pagination}/list-pagination.d.ts +3 -2
  291. package/components/{pagination/list-pagination → list-pagination}/list-pagination.js +4 -3
  292. package/components/mobile-menu/mobile-item-base.d.ts +14 -0
  293. package/components/mobile-menu/mobile-item-base.js +46 -0
  294. package/components/mobile-menu/mobile-item.d.ts +6 -0
  295. package/components/mobile-menu/mobile-item.js +26 -0
  296. package/components/mobile-menu/mobile-menu.d.ts +6 -0
  297. package/components/mobile-menu/mobile-menu.js +10 -0
  298. package/components/{navigation/content → navigation-content}/navigation-content.d.ts +1 -1
  299. package/components/{navigation/content → navigation-content}/navigation-content.js +2 -2
  300. package/components/{navigation/local → navigation-local}/navigation-local.d.ts +1 -1
  301. package/components/{navigation/local → navigation-local}/navigation-local.js +1 -1
  302. package/components/{notification/badge → notification-badge}/notification-badge.d.ts +1 -1
  303. package/components/notification-badge/notification-badge.js +9 -0
  304. package/components/popover/popover-base.d.ts +15 -0
  305. package/components/popover/popover-base.js +27 -0
  306. package/components/popover/popover-content.d.ts +19 -0
  307. package/components/popover/popover-content.js +20 -0
  308. package/components/popover/popover.d.ts +7 -8
  309. package/components/popover/popover.js +67 -161
  310. package/components/progressbar/progressbar.js +2 -2
  311. package/components/puff-list/{puff-list-item/puff-list-item-date.d.ts → puff-list-item-date.d.ts} +0 -1
  312. package/components/puff-list/{puff-list-item/puff-list-item-date.js → puff-list-item-date.js} +2 -3
  313. package/components/puff-list/{puff-list-item/puff-list-item-header.d.ts → puff-list-item-header.d.ts} +1 -1
  314. package/components/puff-list/puff-list-item-header.js +12 -0
  315. package/components/puff-list/{puff-list-item/puff-list-item-info.d.ts → puff-list-item-info.d.ts} +1 -2
  316. package/components/puff-list/puff-list-item-info.js +8 -0
  317. package/components/puff-list/{puff-list-item/puff-list-item.d.ts → puff-list-item.d.ts} +0 -2
  318. package/components/puff-list/{puff-list-item/puff-list-item.js → puff-list-item.js} +2 -3
  319. package/components/puff-list/puff-list.js +2 -3
  320. package/components/region-icon/region-icon.js +2 -2
  321. package/components/side-menu/side-menu-base.d.ts +22 -0
  322. package/components/side-menu/side-menu-base.js +42 -0
  323. package/components/side-menu/side-menu.d.ts +6 -9
  324. package/components/side-menu/side-menu.js +13 -43
  325. package/components/side-panel/side-panel-base.d.ts +24 -0
  326. package/components/side-panel/side-panel-base.js +33 -0
  327. package/components/side-panel/side-panel-provider.d.ts +7 -0
  328. package/components/side-panel/side-panel-provider.js +12 -0
  329. package/components/side-panel/side-panel.d.ts +14 -15
  330. package/components/side-panel/side-panel.js +49 -54
  331. package/components/stepper/step-base.d.ts +15 -0
  332. package/components/stepper/step-base.js +36 -0
  333. package/components/stepper/step.d.ts +5 -8
  334. package/components/stepper/step.js +17 -33
  335. package/components/stepper/stepper.d.ts +4 -6
  336. package/components/stepper/stepper.js +8 -13
  337. package/components/tabs/tab-link.d.ts +15 -0
  338. package/components/tabs/tab-link.js +10 -0
  339. package/components/tabs/tab-panel.d.ts +2 -4
  340. package/components/tabs/tab-panel.js +5 -12
  341. package/components/tabs/tab.d.ts +5 -5
  342. package/components/tabs/tab.js +5 -8
  343. package/components/tabs/tabs-base.d.ts +15 -0
  344. package/components/tabs/tabs-base.js +15 -0
  345. package/components/tabs/tabs.d.ts +5 -8
  346. package/components/tabs/tabs.js +38 -51
  347. package/components/tag/tag.d.ts +5 -15
  348. package/components/tag/tag.js +3 -8
  349. package/components/tooltip/tooltip-base.d.ts +14 -0
  350. package/components/tooltip/tooltip-base.js +18 -0
  351. package/components/tooltip/tooltip.d.ts +3 -10
  352. package/components/tooltip/tooltip.js +59 -43
  353. package/components/utils/contexts/HeaderContext.d.ts +1 -0
  354. package/components/utils/hooks/useFocusTrap.js +1 -1
  355. package/index.d.ts +91 -15
  356. package/index.js +91 -15
  357. package/package.json +2 -2
  358. package/components/box-link/box-link.d.ts +0 -9
  359. package/components/box-link/box-link.js +0 -11
  360. package/components/global-alert/global-alert.d.ts +0 -16
  361. package/components/global-alert/global-alert.js +0 -26
  362. package/components/mobile/menu/item/mobile-item.d.ts +0 -15
  363. package/components/mobile/menu/item/mobile-item.js +0 -61
  364. package/components/mobile/menu/mobile-menu.d.ts +0 -7
  365. package/components/mobile/menu/mobile-menu.js +0 -12
  366. package/components/notification/badge/notification-badge.js +0 -9
  367. package/components/pagination/data-pagination/data-pagination.js +0 -16
  368. package/components/puff-list/puff-list-item/puff-list-item-header.js +0 -11
  369. package/components/puff-list/puff-list-item/puff-list-item-info.js +0 -10
  370. package/components/utils/hooks/useElementId.d.ts +0 -5
  371. package/components/utils/hooks/useElementId.js +0 -12
  372. /package/components/{button-group → button}/button-group.d.ts +0 -0
@@ -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>>;
@@ -1,28 +1,16 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef, useRef, useImperativeHandle } from 'react';
4
- import { useElementId } from '../../utils/hooks/useElementId.js';
5
4
  import { useInputValidity } from '../form-hooks/useInputValidity.js';
6
- import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
7
- import clsx from 'clsx';
5
+ import { IDSRadioBase } from './radio-base.js';
8
6
 
9
- const IDSRadio = forwardRef(({ name = "", groupErrorMsgId = "", invalid = false, groupInvalid = false, disabled = false, noValidation = false, light = false, compact = false, focusAnchor = false, dataTestId = "", tooltip, id, children, className, onChange, ...props }, ref) => {
10
- const fieldId = useElementId(id);
7
+ const IDSRadio = forwardRef(({ groupErrorMsgId, invalid = false, groupInvalid = false, noValidation = false, children, ...props }, ref) => {
11
8
  const radioRef = useRef(null);
12
- useImperativeHandle(ref, () => radioRef.current);
13
9
  const hasValidValue = useInputValidity(radioRef);
14
- const isInvalid = (invalid || groupInvalid || !hasValidValue) && !noValidation;
15
- useAriaDescribedBy(radioRef, groupErrorMsgId, isInvalid, !!groupErrorMsgId);
16
- return (jsxs("div", { className: clsx("ids-radio", {
17
- "ids-radio--compact": compact
18
- }, className), "data-testid": dataTestId, children: [jsx("input", { id: fieldId, ref: radioRef, type: "radio", className: clsx("ids-radio__input", {
19
- "ids-input--light": light,
20
- "ids-focus-anchor": focusAnchor
21
- }), disabled: disabled, "aria-disabled": disabled, "aria-invalid": isInvalid, name: name, onChange: onChange, ...props }), jsxs("div", { className: clsx("ids-label-tooltip-wrapper", {
22
- "ids-label-tooltip-wrapper--inline": tooltip
23
- }), children: [jsx("label", { htmlFor: fieldId, className: clsx("ids-radio__label ids-label", {
24
- "ids-input--clickable": !disabled
25
- }), children: children }), tooltip] })] }));
10
+ const isInvalid = invalid || groupInvalid || (!hasValidValue && !noValidation);
11
+ // Expose ref to user
12
+ useImperativeHandle(ref, () => radioRef.current);
13
+ return (jsx(IDSRadioBase, { ...props, inputRef: radioRef, errorMsgId: groupErrorMsgId, invalid: isInvalid, children: children }));
26
14
  });
27
15
  IDSRadio.displayName = "IDSRadio";
28
16
 
@@ -0,0 +1,8 @@
1
+ import { ReactNode, InputHTMLAttributes } from "react";
2
+ export interface IDSRadioButtonGroupBaseProps extends InputHTMLAttributes<HTMLFieldSetElement> {
3
+ legend?: string;
4
+ children?: ReactNode;
5
+ tooltip?: ReactNode;
6
+ groupRef?: React.Ref<HTMLFieldSetElement>;
7
+ }
8
+ export declare function IDSRadioButtonGroupBase({ legend, groupRef, tooltip, children, className, ...props }: IDSRadioButtonGroupBaseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+
4
+ function IDSRadioButtonGroupBase({ legend, groupRef, tooltip, children, className, ...props }) {
5
+ return (jsxs("fieldset", { ref: groupRef, className: clsx("ids-form-group__fieldset", className), ...props, children: [legend ? (jsx("div", { className: "ids-label-wrapper", children: jsxs("legend", { children: [legend, tooltip && jsx("span", { className: "ids-legend__tooltip", children: tooltip })] }) })) : null, children] }));
6
+ }
7
+
8
+ export { IDSRadioButtonGroupBase };
@@ -1,9 +1,10 @@
1
- import React, { ReactNode, InputHTMLAttributes } from "react";
1
+ import { ReactNode, ChangeEvent, InputHTMLAttributes } from "react";
2
2
  interface IDSRadioButtonGroupProps extends InputHTMLAttributes<HTMLFieldSetElement> {
3
3
  name: string;
4
4
  legend?: string;
5
+ tooltip?: ReactNode;
5
6
  children?: ReactNode;
6
- onRadioChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
+ onRadioChange?: (e: ChangeEvent<HTMLInputElement>) => void;
7
8
  }
8
- export declare const IDSRadioButtonGroup: React.FC<IDSRadioButtonGroupProps>;
9
+ export declare function IDSRadioButtonGroup({ name, legend, tooltip, children, onRadioChange, className, ...props }: IDSRadioButtonGroupProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -1,22 +1,28 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import React, { useRef } from 'react';
4
- import clsx from 'clsx';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { IDSRadioButtonGroupBase } from './radio-button-group-base.js';
4
+ import { IDSRadioButton } from './radio-button.js';
5
+ import React from 'react';
5
6
 
6
- const IDSRadioButtonGroup = ({ name = "options", legend = "", onRadioChange, className, children, ...props }) => {
7
- const groupRef = useRef(null);
7
+ function IDSRadioButtonGroup({ name, legend, tooltip, children, onRadioChange, className, ...props }) {
8
8
  const clonedChildren = React.Children.map(children, child => {
9
- if (React.isValidElement(child) && child.type.displayName === "IDSRadioButton") {
10
- return React.cloneElement(child, {
11
- key: child.props.id,
12
- icon: child.props.icon,
9
+ if (!React.isValidElement(child))
10
+ return child;
11
+ if (child.type === IDSRadioButton) {
12
+ const { id, icon, ...rest } = child.props;
13
+ const cloneProps = {
14
+ ...rest,
15
+ icon,
13
16
  name,
14
17
  onChange: onRadioChange
15
- });
18
+ };
19
+ if (id)
20
+ cloneProps.id = id;
21
+ return React.cloneElement(child, cloneProps);
16
22
  }
17
23
  return child;
18
24
  });
19
- return (jsxs("fieldset", { ref: groupRef, className: clsx("ids-form-group__fieldset", className), ...props, children: [jsx("legend", { children: legend && legend }), clonedChildren] }));
20
- };
25
+ return (jsx(IDSRadioButtonGroupBase, { legend: legend, tooltip: tooltip, className: className, ...props, children: clonedChildren }));
26
+ }
21
27
 
22
28
  export { IDSRadioButtonGroup };
@@ -1,11 +1,10 @@
1
- import { ChangeEvent, ReactNode, InputHTMLAttributes } from "react";
1
+ import { InputHTMLAttributes } from "react";
2
2
  export interface IDSRadioButtonProps extends InputHTMLAttributes<HTMLInputElement> {
3
- name?: string;
4
3
  id?: string;
5
- focusAnchor?: boolean;
6
4
  icon: string;
7
- children?: ReactNode;
5
+ name?: string;
8
6
  dataTestId?: string;
9
- onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
7
+ focusAnchor?: boolean;
8
+ disabled?: boolean;
10
9
  }
11
10
  export declare const IDSRadioButton: import("react").ForwardRefExoticComponent<IDSRadioButtonProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,17 +1,12 @@
1
- "use client";
2
1
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { forwardRef, useRef, useImperativeHandle } from 'react';
4
- import { useElementId } from '../../utils/hooks/useElementId.js';
2
+ import { forwardRef, useId } from 'react';
5
3
  import clsx from 'clsx';
6
4
 
7
- const IDSRadioButton = forwardRef(({ name = "", icon = "user", focusAnchor = false, id, children, onChange, dataTestId = "", className, ...props }, ref) => {
8
- const fieldId = useElementId(id);
9
- const radioButtonRef = useRef(null);
10
- useImperativeHandle(ref, () => radioButtonRef.current);
11
- return (jsxs("div", { className: clsx("ids-radio-button", className), "data-testid": dataTestId, children: [jsx("input", { id: fieldId, ref: radioButtonRef, type: "radio", className: clsx("ids-radio-button__input", {
5
+ const IDSRadioButton = forwardRef(function IDSRadioButton({ id, icon, name, dataTestId, disabled, focusAnchor, className, children, ...props }, ref) {
6
+ const inputId = !!id ? id : useId();
7
+ return (jsxs("div", { className: clsx("ids-radio-button", className), "data-testid": dataTestId, children: [jsx("input", { id: inputId, name: name, ref: ref, type: "radio", disabled: disabled, className: clsx("ids-radio-button__input", {
12
8
  "ids-focus-anchor": focusAnchor
13
- }), name: name, onChange: onChange, ...props }), jsx("label", { htmlFor: fieldId, className: `ids-radio-button__label ids-icon-${icon}`, children: children })] }));
9
+ }), ...props }), jsx("label", { htmlFor: inputId, className: `ids-radio-button__label ids-icon-${icon}`, children: children })] }));
14
10
  });
15
- IDSRadioButton.displayName = "IDSRadioButton";
16
11
 
17
12
  export { IDSRadioButton };
@@ -0,0 +1,18 @@
1
+ import { InputHTMLAttributes, ReactNode, Ref, CSSProperties } from "react";
2
+ export interface IDSRangeBaseProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ id?: string;
4
+ label?: string;
5
+ showTicks?: boolean;
6
+ ticks?: number[];
7
+ disabled?: boolean;
8
+ focusAnchor?: boolean;
9
+ dataTestId?: string;
10
+ tooltip?: ReactNode;
11
+ valueNow: number;
12
+ min?: number;
13
+ max?: number;
14
+ step?: number;
15
+ inputRef?: Ref<HTMLInputElement>;
16
+ style?: CSSProperties;
17
+ }
18
+ export declare function IDSRangeBase({ id, label, showTicks, ticks, disabled, focusAnchor, dataTestId, tooltip, valueNow, min, max, step, inputRef, style, className, ...props }: IDSRangeBaseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useId } from 'react';
3
+ import clsx from 'clsx';
4
+
5
+ function IDSRangeBase({ id, label, showTicks, ticks = [], disabled, focusAnchor, dataTestId, tooltip, valueNow, min, max, step = 1, inputRef, style, className, ...props }) {
6
+ const inputId = !!id ? id : `range-${useId()}`;
7
+ return (jsxs("div", { className: clsx("ids-range", className), "data-testid": dataTestId, style: style, children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { htmlFor: inputId, className: clsx("ids-label", { "ids-label--disabled": disabled }), children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsx("input", { id: inputId, ref: inputRef, type: "range", className: clsx("ids-range__input", {
8
+ "ids-focus-anchor": focusAnchor
9
+ }), min: min, "aria-valuemin": min, max: max, "aria-valuemax": max, "aria-valuenow": valueNow, "aria-disabled": disabled, disabled: disabled, step: step, style: {
10
+ backgroundSize: ((valueNow - min) * 100) / (max - min) + "% 100%"
11
+ }, ...props }), showTicks && (jsx("div", { className: clsx("ids-range-ticks", {
12
+ "ids-range-ticks--disabled": disabled
13
+ }), children: ticks.map(tick => (jsx("div", { className: "ids-range-tick", children: tick }, tick))) }))] }));
14
+ }
15
+
16
+ export { IDSRangeBase };
@@ -1,6 +1,5 @@
1
- import React, { ReactNode, InputHTMLAttributes, ChangeEvent } from "react";
2
- import "@inera/ids-design/components/form/range/range.css";
3
- interface IDSRangeProps extends InputHTMLAttributes<HTMLInputElement> {
1
+ import { ReactNode, InputHTMLAttributes } from "react";
2
+ export interface IDSRangeProps extends InputHTMLAttributes<HTMLInputElement> {
4
3
  label?: string;
5
4
  value?: number;
6
5
  showTicks?: boolean;
@@ -12,7 +11,5 @@ interface IDSRangeProps extends InputHTMLAttributes<HTMLInputElement> {
12
11
  focusAnchor?: boolean;
13
12
  dataTestId?: string;
14
13
  tooltip?: ReactNode;
15
- onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
16
14
  }
17
- export declare const IDSRange: React.ForwardRefExoticComponent<IDSRangeProps & React.RefAttributes<HTMLInputElement>>;
18
- export {};
15
+ export declare const IDSRange: import("react").ForwardRefExoticComponent<IDSRangeProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,35 +1,35 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef, useState, useRef, useImperativeHandle, useEffect } from 'react';
4
- import { useElementId } from '../../utils/hooks/useElementId.js';
5
- import '@inera/ids-design/components/form/range/range.css';
6
- import clsx from 'clsx';
4
+ import { IDSRangeBase } from './range-base.js';
7
5
 
8
- const IDSRange = forwardRef(({ label = "", value = 0, showTicks = false, interval = 0, min = 0, max = 0, step = 0, disabled = false, focusAnchor = false, dataTestId = "", tooltip, id, onChange, className, ...props }, ref) => {
9
- const [internalValue, setInternalValue] = useState(value);
6
+ const IDSRange = forwardRef(({ label, value = 0, showTicks = false, interval = 0, min = 0, max = 0, step = 0, onChange, style, ...props }, ref) => {
7
+ const [internalValue, setInternalValue] = useState(value ?? 0);
10
8
  const [ticks, setTicks] = useState([]);
11
- const fieldId = useElementId(id);
12
- const rangeRef = useRef(null);
13
- useImperativeHandle(ref, () => rangeRef.current);
9
+ const inputRef = useRef(null);
10
+ useImperativeHandle(ref, () => inputRef.current);
14
11
  useEffect(() => {
15
- if (step > 0) {
16
- const steps = [];
17
- const increment = interval > 0 ? interval : step;
18
- for (let i = min; i <= max; i += increment) {
19
- steps.push(Math.floor(i));
12
+ if (step > 0 && showTicks) {
13
+ const out = [];
14
+ const inc = interval > 0 ? interval : step;
15
+ for (let i = min; i <= max; i += inc) {
16
+ out.push(Math.floor(i));
20
17
  }
21
- setTicks(steps);
18
+ setTicks(out);
22
19
  }
23
- }, [min, max, step, interval, showTicks]);
24
- const handleOnChange = (ev) => {
25
- setInternalValue(+ev.target.value);
26
- if (onChange) {
27
- onChange(ev);
20
+ else {
21
+ setTicks([]);
28
22
  }
23
+ }, [min, max, step, interval, showTicks]);
24
+ useEffect(() => {
25
+ setInternalValue(value);
26
+ }, [value]);
27
+ const handleChange = (e) => {
28
+ const newValue = Number(e.target.value);
29
+ setInternalValue(newValue);
30
+ onChange?.(e);
29
31
  };
30
- return (jsxs("div", { className: clsx("ids-range", className), "data-testid": dataTestId, children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { htmlFor: fieldId, className: clsx("ids-label", { "ids-label--disabled": disabled }), children: label }), tooltip] }), jsx("input", { id: fieldId, ref: rangeRef, type: "range", className: clsx("ids-range__input", {
31
- "ids-focus-anchor": focusAnchor
32
- }), min: min, "aria-valuemin": min, max: max, "aria-valuemax": max, step: step, value: internalValue, "aria-valuenow": internalValue, disabled: disabled, style: { backgroundSize: ((internalValue - min) * 100) / (max - min) + "% 100%" }, onChange: handleOnChange, ...props }), showTicks && (jsx("div", { className: clsx("ids-range-ticks", { "ids-range-ticks--disabled": disabled }), children: ticks.map(tick => (jsx("div", { className: "ids-range-tick", children: tick }, tick))) }))] }));
32
+ return (jsx(IDSRangeBase, { ...props, label: label, inputRef: inputRef, ticks: ticks, showTicks: showTicks, min: min, max: max, step: step, value: internalValue, valueNow: internalValue, onChange: handleChange, style: style }));
33
33
  });
34
34
  IDSRange.displayName = "IDSRange";
35
35
 
@@ -0,0 +1,19 @@
1
+ import { CSSProperties, ReactNode, SelectHTMLAttributes } from "react";
2
+ export interface IDSSelectBaseProps extends SelectHTMLAttributes<HTMLSelectElement> {
3
+ id?: string;
4
+ label?: string;
5
+ errorMsgId?: string;
6
+ errorMsg?: string;
7
+ invalid?: boolean;
8
+ disabled?: boolean;
9
+ required?: boolean;
10
+ light?: boolean;
11
+ focusAnchor?: boolean;
12
+ tooltip?: ReactNode;
13
+ children?: ReactNode;
14
+ className?: string;
15
+ dataTestId?: string;
16
+ selectRef?: React.Ref<HTMLSelectElement>;
17
+ style?: CSSProperties;
18
+ }
19
+ export declare function IDSSelectBase({ id, label, errorMsgId, errorMsg, invalid, disabled, required, light, focusAnchor, tooltip, children, className, selectRef, dataTestId, style, ...props }: IDSSelectBaseProps): 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
+ import { IDSErrorMessage } from '../error-message/error-message.js';
5
+
6
+ function IDSSelectBase({ id, label, errorMsgId, errorMsg, invalid, disabled, required, light, focusAnchor, tooltip, children, className, selectRef, dataTestId, style, ...props }) {
7
+ const reactId = useId();
8
+ const selectId = !!id ? id : `select-base-${reactId}`;
9
+ const baseErrorMsgId = !!errorMsgId ? errorMsgId : `select-base-error-${reactId}`;
10
+ const showErrorMsg = invalid && !!errorMsg;
11
+ const ariaHandler = showErrorMsg
12
+ ? {
13
+ "aria-describedby": baseErrorMsgId
14
+ }
15
+ : {};
16
+ return (jsxs("div", { className: clsx("ids-select", className), "data-testid": dataTestId, style: style, children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { htmlFor: selectId, className: clsx("ids-label", {
17
+ "ids-label--disabled": disabled
18
+ }), children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsx("div", { className: "ids-select__wrapper", children: jsx("select", { id: selectId, ref: selectRef, className: clsx("ids-select__select", {
19
+ "ids-input--light": light,
20
+ "ids-focus-anchor": focusAnchor
21
+ }), "aria-invalid": invalid, "aria-required": required, "aria-disabled": disabled, disabled: disabled, required: required, ...ariaHandler, ...props, children: children }) }), showErrorMsg && (jsx(IDSErrorMessage, { id: baseErrorMsgId, show: true, children: errorMsg }))] }));
22
+ }
23
+
24
+ export { IDSSelectBase };
@@ -1,16 +1,16 @@
1
- import React, { ReactNode } from "react";
2
- interface IDSSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
1
+ import { ReactNode, SelectHTMLAttributes } from "react";
2
+ export interface IDSSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
3
+ id?: string;
3
4
  label?: string;
4
5
  errorMsg?: string;
6
+ invalid?: boolean;
5
7
  disabled?: boolean;
6
8
  required?: boolean;
7
- invalid?: boolean;
8
9
  light?: boolean;
9
10
  focusAnchor?: boolean;
10
- noValidation?: boolean;
11
11
  tooltip?: ReactNode;
12
- children?: ReactNode;
13
12
  dataTestId?: string;
13
+ noValidation?: boolean;
14
+ validatesOnBlur?: boolean;
14
15
  }
15
- export declare const IDSSelect: React.ForwardRefExoticComponent<IDSSelectProps & React.RefAttributes<HTMLSelectElement>>;
16
- export {};
16
+ export declare const IDSSelect: import("react").ForwardRefExoticComponent<IDSSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
@@ -1,26 +1,16 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { forwardRef, useRef, useImperativeHandle } from 'react';
4
- import { useElementId } from '../../utils/hooks/useElementId.js';
5
- import { IDSErrorMessage } from '../error-message/error-message.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef, useId, useRef, useImperativeHandle } from 'react';
6
4
  import { useInputValidity } from '../form-hooks/useInputValidity.js';
7
- import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
8
- import clsx from 'clsx';
5
+ import { IDSSelectBase } from './select-base.js';
9
6
 
10
- const IDSSelect = forwardRef(({ label = "", errorMsg = "", disabled = false, required = false, invalid = false, light = false, dataTestId = "", noValidation = false, focusAnchor = false, tooltip, id, children, className, ...props }, ref) => {
11
- const fieldId = useElementId(id);
12
- const errorMsgId = useElementId();
7
+ const IDSSelect = forwardRef(({ id, label, errorMsg, disabled, required, light, focusAnchor, tooltip, dataTestId, invalid = false, noValidation = false, validatesOnBlur = false, children, style, ...props }, ref) => {
8
+ const errorMsgId = `select-error-${useId()}`;
13
9
  const selectRef = useRef(null);
14
- useImperativeHandle(ref, () => selectRef.current);
15
- const hasValidValue = useInputValidity(selectRef);
10
+ const hasValidValue = useInputValidity(selectRef, validatesOnBlur);
16
11
  const isInvalid = (invalid || !hasValidValue) && !noValidation;
17
- useAriaDescribedBy(selectRef, errorMsgId, isInvalid, !!errorMsg);
18
- return (jsxs("div", { className: clsx("ids-select", className), "data-testid": dataTestId, children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { htmlFor: fieldId, className: clsx("ids-label", {
19
- "ids-label--disabled": disabled
20
- }), children: label }), tooltip] }), jsx("div", { className: "ids-select__wrapper", children: jsx("select", { id: fieldId, ref: selectRef, className: clsx("ids-select__select", {
21
- "ids-input--light": light,
22
- "ids-focus-anchor": focusAnchor
23
- }), "aria-invalid": isInvalid, "aria-disabled": disabled, required: required, disabled: disabled, ...props, children: children }) }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
12
+ useImperativeHandle(ref, () => selectRef.current);
13
+ return (jsx(IDSSelectBase, { ...props, style: style, id: id, label: label, errorMsg: errorMsg, disabled: disabled, required: required, light: light, focusAnchor: focusAnchor, tooltip: tooltip, dataTestId: dataTestId, selectRef: selectRef, errorMsgId: errorMsgId, invalid: isInvalid, children: children }));
24
14
  });
25
15
  IDSSelect.displayName = "IDSSelect";
26
16
 
@@ -0,0 +1,27 @@
1
+ import { CSSProperties, ReactNode } from "react";
2
+ export interface IDSSelectMultipleBaseProps {
3
+ labelId?: string;
4
+ id?: string;
5
+ label?: string;
6
+ expanded?: boolean;
7
+ placeholder?: string;
8
+ numbCheckedBoxes?: number;
9
+ selectedLabel?: string;
10
+ selectedLabelPlural?: string;
11
+ maxHeight?: string;
12
+ errorMsg?: string;
13
+ invalid?: boolean;
14
+ disabled?: boolean;
15
+ ariaDisabled?: boolean;
16
+ light?: boolean;
17
+ focusAnchor?: boolean;
18
+ tooltip?: ReactNode;
19
+ inputRef?: React.Ref<HTMLInputElement>;
20
+ componentRef?: React.Ref<HTMLDivElement>;
21
+ children?: ReactNode;
22
+ className?: string;
23
+ onClick?: () => void;
24
+ client?: boolean;
25
+ style?: CSSProperties;
26
+ }
27
+ export declare function IDSSelectMultipleBase({ labelId, id, label, placeholder, numbCheckedBoxes, selectedLabel, selectedLabelPlural, expanded, maxHeight, tooltip, componentRef, inputRef, invalid, disabled, ariaDisabled, light, focusAnchor, className, children, style, onClick, client }: IDSSelectMultipleBaseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useId } from 'react';
3
+ import clsx from 'clsx';
4
+
5
+ function IDSSelectMultipleBase({ labelId, id, label, placeholder, numbCheckedBoxes, selectedLabel = "vald", selectedLabelPlural = "valda", expanded, maxHeight = "8.125rem", tooltip, componentRef, inputRef, invalid, disabled, ariaDisabled, light, focusAnchor, className, children, style, onClick, client = false }) {
6
+ const reactId = useId();
7
+ const inputId = !!id ? id : `select-multiple-base-${reactId}`;
8
+ const inputLabelId = !!labelId ? labelId : `select-multiple-base-label-${reactId}`;
9
+ const displayedValue = numbCheckedBoxes === 0 || !numbCheckedBoxes
10
+ ? placeholder
11
+ : numbCheckedBoxes === 1
12
+ ? `${numbCheckedBoxes} ${selectedLabel}`
13
+ : `${numbCheckedBoxes} ${selectedLabelPlural}`;
14
+ const clickHandler = client && !!onClick
15
+ ? {
16
+ onClick
17
+ }
18
+ : {};
19
+ return (jsxs("div", { className: clsx("ids-select-multiple", className), ref: componentRef, style: style, children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { id: inputLabelId, htmlFor: inputId, className: clsx("ids-label", { "ids-label--disabled": disabled || ariaDisabled }), children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsx("div", { className: "ids-select-multiple__select-wrapper", children: jsx("input", { id: inputId, ref: inputRef, "aria-labelledby": inputLabelId, type: "button", className: clsx("ids-select-multiple__select", {
20
+ "ids-input--light": light,
21
+ "ids-focus-anchor": focusAnchor
22
+ }), "aria-expanded": expanded, disabled: disabled, "aria-disabled": ariaDisabled, "aria-invalid": invalid, placeholder: placeholder, defaultValue: displayedValue, ...clickHandler }) }), jsx("div", { className: "ids-select-multiple__dropdown-wrapper", children: jsx("div", { className: clsx("ids-select-multiple__dropdown", {
23
+ "ids-select-multiple__dropdown--expanded": expanded
24
+ }), children: jsx("div", { className: "ids-select-multiple__dropdown-scroll-area", style: { maxHeight }, children: children }) }) })] }));
25
+ }
26
+
27
+ export { IDSSelectMultipleBase };
@@ -1,10 +1,10 @@
1
- import React, { ReactNode } from "react";
2
- import "@inera/ids-design/components/form/select-multiple/select-multiple.css";
3
- interface IDSSelectMultipleProps extends React.InputHTMLAttributes<HTMLInputElement> {
1
+ import React, { HTMLAttributes } from "react";
2
+ export interface IDSSelectMultipleProps extends HTMLAttributes<HTMLDivElement> {
4
3
  label?: string;
5
4
  selectedLabel?: string;
6
5
  selectedLabelPlural?: string;
7
6
  placeholder?: string;
7
+ numbCheckedBoxes?: number;
8
8
  maxHeight?: string;
9
9
  expanded?: boolean;
10
10
  errorMsg?: string;
@@ -14,9 +14,12 @@ interface IDSSelectMultipleProps extends React.InputHTMLAttributes<HTMLInputElem
14
14
  light?: boolean;
15
15
  focusAnchor?: boolean;
16
16
  noValidation?: boolean;
17
- tooltip?: ReactNode;
18
- children?: ReactNode;
17
+ tooltip?: React.ReactNode;
18
+ children?: React.ReactNode;
19
19
  dataTestId?: string;
20
+ id?: string;
21
+ }
22
+ export declare function IDSSelectMultiple({ invalid, noValidation, expanded, errorMsg, ariaDisabled, style, children, ...props }: IDSSelectMultipleProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare namespace IDSSelectMultiple {
24
+ var displayName: string;
20
25
  }
21
- export declare const IDSSelectMultiple: React.FC<IDSSelectMultipleProps>;
22
- export {};
@@ -1,74 +1,49 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx } from 'react/jsx-runtime';
3
3
  import { useState, useRef, useEffect } from 'react';
4
- import { useElementId } from '../../utils/hooks/useElementId.js';
4
+ import { IDSSelectMultipleBase } from './select-multiple-base.js';
5
5
  import { IDSCheckboxGroup } from '../checkbox/checkbox-group.js';
6
- import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
7
- import '@inera/ids-design/components/form/select-multiple/select-multiple.css';
8
- import clsx from 'clsx';
9
6
 
10
- const IDSSelectMultiple = ({ label = "", selectedLabel = "vald", selectedLabelPlural = "valda", placeholder = "", maxHeight = "", dataTestId = "", expanded = false, errorMsg = "", invalid = false, disabled = false, ariaDisabled = false, light = false, noValidation = false, focusAnchor = false, tooltip, id, children, className, ...props }) => {
11
- const [checkboxListInvalid, setCheckboxListInvalid] = useState(false);
12
- const [checkedBoxesCount, setCheckedBoxesCount] = useState(0);
13
- const [value, setValue] = useState(placeholder);
7
+ function IDSSelectMultiple({ invalid = false, noValidation = false, expanded = false, errorMsg, ariaDisabled = false, style, children, ...props }) {
14
8
  const [isExpanded, setIsExpanded] = useState(expanded);
15
- const labelId = useElementId("label-" + id);
16
- const inputId = useElementId("input-" + id);
17
- const errorMsgId = useElementId();
18
- const selectMultipleRef = useRef(null);
19
- useAriaDescribedBy(selectMultipleRef, errorMsgId, checkboxListInvalid, !!errorMsg);
20
- useEffect(() => {
21
- let inputValue = placeholder;
22
- if (checkedBoxesCount === 1) {
23
- inputValue = `${checkedBoxesCount} ${selectedLabel}`;
24
- }
25
- if (checkedBoxesCount > 1) {
26
- inputValue = `${checkedBoxesCount} ${selectedLabelPlural}`;
27
- }
28
- setValue(inputValue);
29
- }, [checkedBoxesCount]);
9
+ const [checkboxListInvalid, setCheckboxListInvalid] = useState(false);
10
+ const inputRef = useRef(null);
11
+ const componentRef = useRef(null);
30
12
  useEffect(() => {
31
- if (checkboxListInvalid) {
13
+ if (checkboxListInvalid)
32
14
  setIsExpanded(true);
33
- }
34
15
  }, [checkboxListInvalid]);
35
16
  useEffect(() => {
36
- const handleInteractionOutside = (event) => {
37
- const target = event.target;
38
- if (selectMultipleRef.current) {
39
- const root = selectMultipleRef.current.closest(".ids-select-multiple");
40
- if (root && !root.contains(target)) {
41
- setIsExpanded(false);
42
- }
17
+ const handleClickOutside = (event) => {
18
+ if (componentRef.current && !componentRef.current.contains(event.target)) {
19
+ setIsExpanded(false);
43
20
  }
44
21
  };
45
22
  const handleKeyDown = (event) => {
46
- if (event.key === "Escape" && isExpanded) {
23
+ if (event.key === "Escape")
47
24
  setIsExpanded(false);
48
- }
49
25
  };
50
- document.addEventListener("click", handleInteractionOutside);
51
- document.addEventListener("focusin", handleInteractionOutside);
26
+ document.addEventListener("click", handleClickOutside);
27
+ document.addEventListener("focusin", handleClickOutside);
52
28
  document.addEventListener("keydown", handleKeyDown);
53
29
  return () => {
54
- document.removeEventListener("click", handleInteractionOutside);
55
- document.removeEventListener("focusin", handleInteractionOutside);
30
+ document.removeEventListener("click", handleClickOutside);
31
+ document.removeEventListener("focusin", handleClickOutside);
56
32
  document.removeEventListener("keydown", handleKeyDown);
57
33
  };
58
- }, [isExpanded]);
59
- return (jsxs("div", { className: clsx("ids-select-multiple", className), "data-testid": dataTestId, children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { id: labelId, htmlFor: inputId, className: clsx("ids-label", {
60
- "ids-label--disabled": disabled || ariaDisabled
61
- }), children: label }), tooltip] }), jsx("div", { className: "ids-select-multiple__select-wrapper", children: jsx("input", { id: inputId, "aria-labelledby": labelId, ref: selectMultipleRef, type: "button", className: clsx("ids-select-multiple__select", {
62
- "ids-input--light": light,
63
- "ids-focus-anchor": focusAnchor
64
- }), "aria-expanded": isExpanded, disabled: disabled, "aria-disabled": ariaDisabled, "aria-invalid": invalid || checkboxListInvalid, placeholder: placeholder, value: value, onClick: () => setIsExpanded(!isExpanded), ...props }) }), jsx("div", { className: "ids-select-multiple__dropdown-wrapper", children: jsx("div", { className: clsx("ids-select-multiple__dropdown", {
65
- "ids-select-multiple__dropdown--expanded": isExpanded
66
- }), children: jsx("div", { className: "ids-select-multiple__dropdown-scroll-area", style: { maxHeight: maxHeight }, children: jsx(IDSCheckboxGroup, { block: true, noValidation: noValidation, errorMsg: errorMsg, setCheckedBoxesCount: setCheckedBoxesCount, onValidityChange: (isValid) => {
67
- if (!isValid) {
68
- setIsExpanded(true);
69
- }
70
- setCheckboxListInvalid(!isValid);
71
- }, children: children }) }) }) })] }));
72
- };
34
+ }, []);
35
+ return (jsx(IDSSelectMultipleBase, { ...props, style: style, client: true, componentRef: componentRef, inputRef: inputRef, invalid: invalid || (!noValidation && checkboxListInvalid), expanded: isExpanded, ariaDisabled: ariaDisabled, onClick: () => {
36
+ setIsExpanded(!isExpanded);
37
+ }, children: jsx(IDSCheckboxGroup, { block: true, noValidation: noValidation, errorMsg: errorMsg, onValidityChange: (isValid) => {
38
+ if (!isValid) {
39
+ setIsExpanded(true);
40
+ setCheckboxListInvalid(!isValid);
41
+ }
42
+ else {
43
+ setCheckboxListInvalid(false);
44
+ }
45
+ }, children: children }) }));
46
+ }
47
+ IDSSelectMultiple.displayName = "IDSSelectMultiple";
73
48
 
74
49
  export { IDSSelectMultiple };
@@ -1,9 +1,8 @@
1
1
  import React from "react";
2
- import "@inera/ids-design/components/form/spinner/spinner.css";
3
- interface IDSSpinnerProps extends React.HTMLAttributes<HTMLElement> {
4
- light?: boolean;
2
+ interface IDSSpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ variant?: "1" | "2" | "3";
5
4
  live?: "polite" | "assertive" | "off";
6
5
  srText?: string;
7
6
  }
8
- export declare const IDSSpinner: React.FC<IDSSpinnerProps>;
7
+ export declare function IDSSpinner({ variant, live, srText, className, ...rest }: IDSSpinnerProps): import("react/jsx-runtime").JSX.Element;
9
8
  export {};