@onewelcome/react-lib-components 14.0.0-experiment.1 → 14.1.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 (510) hide show
  1. package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs.js +2 -2
  2. package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.es.js +5 -5
  3. package/dist/components/Button/BaseButton.module.scss.cjs.js +2 -2
  4. package/dist/components/Button/BaseButton.module.scss.es.js +4 -4
  5. package/dist/components/Button/Button.cjs.js +1 -1
  6. package/dist/components/Button/Button.cjs.js.map +1 -1
  7. package/dist/components/Button/Button.es.js +11 -2
  8. package/dist/components/Button/Button.es.js.map +1 -1
  9. package/dist/components/Button/Button.module.scss.cjs.js +2 -2
  10. package/dist/components/Button/Button.module.scss.es.js +17 -17
  11. package/dist/components/Button/IconButton.module.scss.cjs.js +2 -2
  12. package/dist/components/Button/IconButton.module.scss.es.js +18 -18
  13. package/dist/components/ContextMenu/ContextMenu.cjs.js.map +1 -1
  14. package/dist/components/ContextMenu/ContextMenu.es.js.map +1 -1
  15. package/dist/components/ContextMenu/ContextMenu.module.scss.cjs.js +2 -2
  16. package/dist/components/ContextMenu/ContextMenu.module.scss.es.js +6 -6
  17. package/dist/components/ContextMenu/ContextMenuDivider.module.scss.cjs.js +2 -2
  18. package/dist/components/ContextMenu/ContextMenuDivider.module.scss.es.js +2 -2
  19. package/dist/components/ContextMenu/ContextMenuItem.cjs.js.map +1 -1
  20. package/dist/components/ContextMenu/ContextMenuItem.es.js.map +1 -1
  21. package/dist/components/ContextMenu/ContextMenuItem.module.scss.cjs.js +2 -2
  22. package/dist/components/ContextMenu/ContextMenuItem.module.scss.es.js +3 -3
  23. package/dist/components/ContextMenu/ContextMenuService.cjs.js +1 -1
  24. package/dist/components/ContextMenu/ContextMenuService.cjs.js.map +1 -1
  25. package/dist/components/ContextMenu/ContextMenuService.es.js +20 -17
  26. package/dist/components/ContextMenu/ContextMenuService.es.js.map +1 -1
  27. package/dist/components/DataGrid/DataGrid.cjs.js +1 -1
  28. package/dist/components/DataGrid/DataGrid.cjs.js.map +1 -1
  29. package/dist/components/DataGrid/DataGrid.es.js +102 -59
  30. package/dist/components/DataGrid/DataGrid.es.js.map +1 -1
  31. package/dist/components/DataGrid/DataGrid.module.scss.cjs.js +2 -2
  32. package/dist/components/DataGrid/DataGrid.module.scss.es.js +8 -6
  33. package/dist/components/DataGrid/DataGrid.module.scss.es.js.map +1 -1
  34. package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.cjs.js +2 -2
  35. package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.es.js +6 -6
  36. package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.cjs.js +2 -2
  37. package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.es.js +7 -7
  38. package/dist/components/DataGrid/DataGridBody/DataGridBody.cjs.js +1 -1
  39. package/dist/components/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
  40. package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js +4 -2
  41. package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js.map +1 -1
  42. package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.cjs.js +2 -2
  43. package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.es.js +2 -2
  44. package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.cjs.js +2 -2
  45. package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.es.js +5 -5
  46. package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.cjs.js +2 -2
  47. package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.es.js +4 -4
  48. package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.cjs.js +2 -2
  49. package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.es.js +5 -5
  50. package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js +1 -1
  51. package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js.map +1 -1
  52. package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.es.js +2 -1
  53. package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.es.js.map +1 -1
  54. package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.cjs.js +2 -2
  55. package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.es.js +24 -24
  56. package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.cjs.js.map +1 -1
  57. package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js +1 -1
  58. package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js.map +1 -1
  59. package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js +1 -1
  60. package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -1
  61. package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js +4 -4
  62. package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js.map +1 -1
  63. package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.cjs.js +2 -2
  64. package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.es.js +9 -9
  65. package/dist/components/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js.map +1 -1
  66. package/dist/components/DataGrid/DataGridFilters/DataGridFilterPopover.es.js.map +1 -1
  67. package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +1 -1
  68. package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -1
  69. package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js +17 -21
  70. package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js.map +1 -1
  71. package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +1 -1
  72. package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
  73. package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js +15 -4
  74. package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js.map +1 -1
  75. package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js +1 -1
  76. package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js.map +1 -1
  77. package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js +54 -6
  78. package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js.map +1 -1
  79. package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -1
  80. package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.es.js.map +1 -1
  81. package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.cjs.js +1 -1
  82. package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -1
  83. package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.es.js +4 -4
  84. package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.es.js.map +1 -1
  85. package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.cjs.js +2 -2
  86. package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.es.js +10 -10
  87. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.cjs.js +1 -1
  88. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.cjs.js.map +1 -1
  89. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js +1 -1
  90. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js.map +1 -1
  91. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.cjs.js +2 -2
  92. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.es.js +17 -17
  93. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js +1 -1
  94. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js.map +1 -1
  95. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js +45 -24
  96. package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js.map +1 -1
  97. package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js +1 -1
  98. package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js.map +1 -1
  99. package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js +7 -9
  100. package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js.map +1 -1
  101. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
  102. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
  103. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js +6 -2
  104. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js.map +1 -1
  105. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.cjs.js +2 -2
  106. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js +7 -4
  107. package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js.map +1 -1
  108. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js +1 -1
  109. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js.map +1 -1
  110. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js +14 -12
  111. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js.map +1 -1
  112. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.cjs.js +2 -2
  113. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js +11 -10
  114. package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js.map +1 -1
  115. package/dist/components/DatePicker/DatePicker.module.scss.cjs.js +2 -2
  116. package/dist/components/DatePicker/DatePicker.module.scss.es.js +31 -31
  117. package/dist/components/Form/Checkbox/Checkbox.cjs.js.map +1 -1
  118. package/dist/components/Form/Checkbox/Checkbox.es.js.map +1 -1
  119. package/dist/components/Form/Checkbox/Checkbox.module.scss.cjs.js +2 -2
  120. package/dist/components/Form/Checkbox/Checkbox.module.scss.es.js +13 -13
  121. package/dist/components/Form/Fieldset/Fieldset.cjs.js +1 -1
  122. package/dist/components/Form/Fieldset/Fieldset.cjs.js.map +1 -1
  123. package/dist/components/Form/Fieldset/Fieldset.es.js +3 -2
  124. package/dist/components/Form/Fieldset/Fieldset.es.js.map +1 -1
  125. package/dist/components/Form/Fieldset/Fieldset.module.scss.cjs.js +2 -2
  126. package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js +8 -5
  127. package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js.map +1 -1
  128. package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
  129. package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
  130. package/dist/components/Form/FileUpload/FileItem/FileItem.es.js +1 -1
  131. package/dist/components/Form/FileUpload/FileItem/FileItem.es.js.map +1 -1
  132. package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.cjs.js +2 -2
  133. package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.es.js +18 -18
  134. package/dist/components/Form/FileUpload/FileUpload.cjs.js +1 -1
  135. package/dist/components/Form/FileUpload/FileUpload.cjs.js.map +1 -1
  136. package/dist/components/Form/FileUpload/FileUpload.es.js +6 -6
  137. package/dist/components/Form/FileUpload/FileUpload.es.js.map +1 -1
  138. package/dist/components/Form/FileUpload/FileUpload.module.scss.cjs.js +2 -2
  139. package/dist/components/Form/FileUpload/FileUpload.module.scss.es.js +16 -16
  140. package/dist/components/Form/Form.module.scss.cjs.js +2 -2
  141. package/dist/components/Form/Form.module.scss.es.js +2 -2
  142. package/dist/components/Form/FormControl/FormControl.cjs.js +1 -1
  143. package/dist/components/Form/FormControl/FormControl.cjs.js.map +1 -1
  144. package/dist/components/Form/FormControl/FormControl.es.js +3 -3
  145. package/dist/components/Form/FormControl/FormControl.es.js.map +1 -1
  146. package/dist/components/Form/FormControl/FormControl.module.scss.cjs.js +2 -2
  147. package/dist/components/Form/FormControl/FormControl.module.scss.es.js +13 -13
  148. package/dist/components/Form/FormErrorText/FormErrorText.module.scss.cjs.js +2 -2
  149. package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js +9 -6
  150. package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js.map +1 -1
  151. package/dist/components/Form/FormGroup/FormGroup.cjs.js.map +1 -1
  152. package/dist/components/Form/FormGroup/FormGroup.es.js.map +1 -1
  153. package/dist/components/Form/FormGroup/FormGroup.module.scss.cjs.js +2 -2
  154. package/dist/components/Form/FormGroup/FormGroup.module.scss.es.js +3 -3
  155. package/dist/components/Form/FormHelperText/FormHelperText.module.scss.cjs.js +2 -2
  156. package/dist/components/Form/FormHelperText/FormHelperText.module.scss.es.js +4 -4
  157. package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.cjs.js +1 -1
  158. package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.cjs.js.map +1 -1
  159. package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js +4 -1
  160. package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js.map +1 -1
  161. package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.cjs.js +2 -2
  162. package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.es.js +6 -6
  163. package/dist/components/Form/Input/Input.cjs.js +1 -1
  164. package/dist/components/Form/Input/Input.cjs.js.map +1 -1
  165. package/dist/components/Form/Input/Input.es.js +48 -5
  166. package/dist/components/Form/Input/Input.es.js.map +1 -1
  167. package/dist/components/Form/Input/Input.module.scss.cjs.js +2 -2
  168. package/dist/components/Form/Input/Input.module.scss.es.js +8 -8
  169. package/dist/components/Form/Label/Label.module.scss.cjs.js +2 -2
  170. package/dist/components/Form/Label/Label.module.scss.es.js +2 -2
  171. package/dist/components/Form/Radio/Radio.cjs.js.map +1 -1
  172. package/dist/components/Form/Radio/Radio.es.js +1 -1
  173. package/dist/components/Form/Radio/Radio.es.js.map +1 -1
  174. package/dist/components/Form/Radio/Radio.module.scss.cjs.js +2 -2
  175. package/dist/components/Form/Radio/Radio.module.scss.es.js +11 -11
  176. package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
  177. package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
  178. package/dist/components/Form/Select/MultiSelect/MultiOption.es.js +11 -10
  179. package/dist/components/Form/Select/MultiSelect/MultiOption.es.js.map +1 -1
  180. package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
  181. package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
  182. package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js +236 -57
  183. package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js.map +1 -1
  184. package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.cjs.js +2 -2
  185. package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js +20 -15
  186. package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js.map +1 -1
  187. package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.cjs.js +2 -2
  188. package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.es.js +2 -2
  189. package/dist/components/Form/Select/MultiSelect/SelectedOptions.cjs.js.map +1 -1
  190. package/dist/components/Form/Select/MultiSelect/SelectedOptions.es.js.map +1 -1
  191. package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.cjs.js +2 -2
  192. package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.es.js +4 -4
  193. package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js +1 -1
  194. package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js.map +1 -1
  195. package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js +134 -32
  196. package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js.map +1 -1
  197. package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
  198. package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
  199. package/dist/components/Form/Select/MultiSelect/useSearch.es.js +73 -55
  200. package/dist/components/Form/Select/MultiSelect/useSearch.es.js.map +1 -1
  201. package/dist/components/Form/Select/Select.interfaces.cjs.js.map +1 -1
  202. package/dist/components/Form/Select/Select.interfaces.es.js.map +1 -1
  203. package/dist/components/Form/Select/SingleSelect/Option.cjs.js +1 -1
  204. package/dist/components/Form/Select/SingleSelect/Option.cjs.js.map +1 -1
  205. package/dist/components/Form/Select/SingleSelect/Option.es.js +16 -9
  206. package/dist/components/Form/Select/SingleSelect/Option.es.js.map +1 -1
  207. package/dist/components/Form/Select/SingleSelect/Select.cjs.js +1 -1
  208. package/dist/components/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
  209. package/dist/components/Form/Select/SingleSelect/Select.es.js +202 -46
  210. package/dist/components/Form/Select/SingleSelect/Select.es.js.map +1 -1
  211. package/dist/components/Form/Select/SingleSelect/Select.module.scss.cjs.js +2 -2
  212. package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js +21 -17
  213. package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js.map +1 -1
  214. package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js +1 -1
  215. package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js.map +1 -1
  216. package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js +176 -89
  217. package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js.map +1 -1
  218. package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
  219. package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
  220. package/dist/components/Form/Select/SingleSelect/useSearch.es.js +48 -36
  221. package/dist/components/Form/Select/SingleSelect/useSearch.es.js.map +1 -1
  222. package/dist/components/Form/Select/useAddNewBtn.cjs.js +1 -1
  223. package/dist/components/Form/Select/useAddNewBtn.cjs.js.map +1 -1
  224. package/dist/components/Form/Select/useAddNewBtn.es.js +8 -6
  225. package/dist/components/Form/Select/useAddNewBtn.es.js.map +1 -1
  226. package/dist/components/Form/Select/useAddNewBtn.module.scss.cjs.js +2 -2
  227. package/dist/components/Form/Select/useAddNewBtn.module.scss.es.js +4 -4
  228. package/dist/components/Form/Select/useBaseSearch.cjs.js +2 -0
  229. package/dist/components/Form/Select/useBaseSearch.cjs.js.map +1 -0
  230. package/dist/components/Form/Select/useBaseSearch.es.js +85 -0
  231. package/dist/components/Form/Select/useBaseSearch.es.js.map +1 -0
  232. package/dist/components/Form/Select/useSelectPositionList.cjs.js +1 -1
  233. package/dist/components/Form/Select/useSelectPositionList.cjs.js.map +1 -1
  234. package/dist/components/Form/Select/useSelectPositionList.es.js +18 -5
  235. package/dist/components/Form/Select/useSelectPositionList.es.js.map +1 -1
  236. package/dist/components/Form/Textarea/Textarea.cjs.js +1 -1
  237. package/dist/components/Form/Textarea/Textarea.cjs.js.map +1 -1
  238. package/dist/components/Form/Textarea/Textarea.es.js +4 -0
  239. package/dist/components/Form/Textarea/Textarea.es.js.map +1 -1
  240. package/dist/components/Form/Textarea/Textarea.module.scss.cjs.js +2 -2
  241. package/dist/components/Form/Textarea/Textarea.module.scss.es.js +6 -6
  242. package/dist/components/Form/Toggle/Toggle.cjs.js +1 -1
  243. package/dist/components/Form/Toggle/Toggle.cjs.js.map +1 -1
  244. package/dist/components/Form/Toggle/Toggle.es.js +5 -3
  245. package/dist/components/Form/Toggle/Toggle.es.js.map +1 -1
  246. package/dist/components/Form/Toggle/Toggle.module.scss.cjs.js +2 -2
  247. package/dist/components/Form/Toggle/Toggle.module.scss.es.js +18 -18
  248. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js +1 -1
  249. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js.map +1 -1
  250. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js +25 -17
  251. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js.map +1 -1
  252. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.cjs.js +2 -2
  253. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js +8 -4
  254. package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js.map +1 -1
  255. package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.cjs.js +2 -2
  256. package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.es.js +5 -5
  257. package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.cjs.js.map +1 -1
  258. package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.es.js.map +1 -1
  259. package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.cjs.js +2 -2
  260. package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.es.js +3 -3
  261. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js +1 -1
  262. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js.map +1 -1
  263. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js +41 -22
  264. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js.map +1 -1
  265. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.cjs.js +2 -2
  266. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js +8 -4
  267. package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js.map +1 -1
  268. package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js.map +1 -1
  269. package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.es.js.map +1 -1
  270. package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.cjs.js +2 -2
  271. package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.es.js +3 -3
  272. package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js +1 -1
  273. package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js.map +1 -1
  274. package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js +2 -0
  275. package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js.map +1 -1
  276. package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.cjs.js +2 -2
  277. package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.es.js +8 -8
  278. package/dist/components/Form/Wrapper/Wrapper/Wrapper.cjs.js +1 -1
  279. package/dist/components/Form/Wrapper/Wrapper/Wrapper.cjs.js.map +1 -1
  280. package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js +1 -1
  281. package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js.map +1 -1
  282. package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.cjs.js +2 -2
  283. package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.es.js +6 -6
  284. package/dist/components/Icon/Icon.cjs.js +1 -1
  285. package/dist/components/Icon/Icon.cjs.js.map +1 -1
  286. package/dist/components/Icon/Icon.es.js +3 -1
  287. package/dist/components/Icon/Icon.es.js.map +1 -1
  288. package/dist/components/Icon/Icon.module.scss.cjs.js +2 -2
  289. package/dist/components/Icon/Icon.module.scss.es.js +109 -107
  290. package/dist/components/Icon/Icon.module.scss.es.js.map +1 -1
  291. package/dist/components/Layout/ActionBar/ActionBar.cjs.js +2 -0
  292. package/dist/components/Layout/ActionBar/ActionBar.cjs.js.map +1 -0
  293. package/dist/components/Layout/ActionBar/ActionBar.es.js +122 -0
  294. package/dist/components/Layout/ActionBar/ActionBar.es.js.map +1 -0
  295. package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js +3 -0
  296. package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js.map +1 -0
  297. package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js +24 -0
  298. package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js.map +1 -0
  299. package/dist/components/Layout/Card/Card.module.scss.cjs.js +2 -2
  300. package/dist/components/Layout/Card/Card.module.scss.es.js +12 -12
  301. package/dist/components/Layout/ContentHeader/ContentHeader.cjs.js +1 -1
  302. package/dist/components/Layout/ContentHeader/ContentHeader.cjs.js.map +1 -1
  303. package/dist/components/Layout/ContentHeader/ContentHeader.es.js +66 -41
  304. package/dist/components/Layout/ContentHeader/ContentHeader.es.js.map +1 -1
  305. package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.cjs.js +2 -2
  306. package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js +28 -13
  307. package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js.map +1 -1
  308. package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.cjs.js +2 -2
  309. package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.es.js +4 -4
  310. package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.cjs.js +2 -2
  311. package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.es.js +2 -2
  312. package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.cjs.js +2 -2
  313. package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.es.js +3 -3
  314. package/dist/components/Link/Link.cjs.js.map +1 -1
  315. package/dist/components/Link/Link.es.js +1 -1
  316. package/dist/components/Link/Link.es.js.map +1 -1
  317. package/dist/components/Link/Link.module.scss.cjs.js +2 -2
  318. package/dist/components/Link/Link.module.scss.es.js +17 -17
  319. package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.cjs.js +2 -2
  320. package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.es.js +11 -11
  321. package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js +1 -1
  322. package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js.map +1 -1
  323. package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js +7 -1
  324. package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js.map +1 -1
  325. package/dist/components/Notifications/Alert/AlertItem/AlertItem.cjs.js +1 -1
  326. package/dist/components/Notifications/Alert/AlertItem/AlertItem.cjs.js.map +1 -1
  327. package/dist/components/Notifications/Alert/AlertItem/AlertItem.es.js +1 -1
  328. package/dist/components/Notifications/Alert/AlertItem/AlertItem.es.js.map +1 -1
  329. package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.cjs.js +2 -2
  330. package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.es.js +22 -22
  331. package/dist/components/Notifications/Banner/Banner.module.scss.cjs.js +2 -2
  332. package/dist/components/Notifications/Banner/Banner.module.scss.es.js +9 -9
  333. package/dist/components/Notifications/BaseModal/BaseModal.cjs.js +1 -1
  334. package/dist/components/Notifications/BaseModal/BaseModal.cjs.js.map +1 -1
  335. package/dist/components/Notifications/BaseModal/BaseModal.es.js +1 -1
  336. package/dist/components/Notifications/BaseModal/BaseModal.es.js.map +1 -1
  337. package/dist/components/Notifications/BaseModal/BaseModal.module.scss.cjs.js +2 -2
  338. package/dist/components/Notifications/BaseModal/BaseModal.module.scss.es.js +5 -5
  339. package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.cjs.js.map +1 -1
  340. package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.es.js.map +1 -1
  341. package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.cjs.js +2 -2
  342. package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.es.js +4 -4
  343. package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.cjs.js.map +1 -1
  344. package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.es.js.map +1 -1
  345. package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.cjs.js +2 -2
  346. package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.es.js +2 -2
  347. package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.cjs.js +2 -2
  348. package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.es.js +6 -6
  349. package/dist/components/Notifications/Dialog/Dialog.module.scss.cjs.js +2 -2
  350. package/dist/components/Notifications/Dialog/Dialog.module.scss.es.js +4 -4
  351. package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.cjs.js +2 -2
  352. package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.es.js +3 -3
  353. package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.cjs.js +2 -2
  354. package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.es.js +10 -10
  355. package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.cjs.js.map +1 -1
  356. package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.es.js.map +1 -1
  357. package/dist/components/Notifications/SideSheet/SideSheet.cjs.js.map +1 -1
  358. package/dist/components/Notifications/SideSheet/SideSheet.es.js +1 -1
  359. package/dist/components/Notifications/SideSheet/SideSheet.es.js.map +1 -1
  360. package/dist/components/Notifications/SideSheet/SideSheet.module.scss.cjs.js +2 -2
  361. package/dist/components/Notifications/SideSheet/SideSheet.module.scss.es.js +13 -13
  362. package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.cjs.js +2 -2
  363. package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.es.js +2 -2
  364. package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.cjs.js +2 -2
  365. package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.es.js +2 -2
  366. package/dist/components/Notifications/SlideInModal/SlideInModal.cjs.js.map +1 -1
  367. package/dist/components/Notifications/SlideInModal/SlideInModal.es.js +1 -1
  368. package/dist/components/Notifications/SlideInModal/SlideInModal.es.js.map +1 -1
  369. package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.cjs.js +2 -2
  370. package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.es.js +10 -10
  371. package/dist/components/Pagination/Pagination.cjs.js +1 -1
  372. package/dist/components/Pagination/Pagination.cjs.js.map +1 -1
  373. package/dist/components/Pagination/Pagination.es.js +118 -90
  374. package/dist/components/Pagination/Pagination.es.js.map +1 -1
  375. package/dist/components/Pagination/Pagination.module.scss.cjs.js +2 -2
  376. package/dist/components/Pagination/Pagination.module.scss.es.js +15 -14
  377. package/dist/components/Pagination/Pagination.module.scss.es.js.map +1 -1
  378. package/dist/components/Popover/Popover.cjs.js.map +1 -1
  379. package/dist/components/Popover/Popover.es.js.map +1 -1
  380. package/dist/components/Popover/Popover.module.scss.cjs.js +2 -2
  381. package/dist/components/Popover/Popover.module.scss.es.js +3 -3
  382. package/dist/components/ProgressBar/ProgressBar.cjs.js.map +1 -1
  383. package/dist/components/ProgressBar/ProgressBar.es.js.map +1 -1
  384. package/dist/components/ProgressBar/ProgressBar.module.scss.cjs.js +2 -2
  385. package/dist/components/ProgressBar/ProgressBar.module.scss.es.js +9 -9
  386. package/dist/components/Skeleton/Skeleton.module.scss.cjs.js +2 -2
  387. package/dist/components/Skeleton/Skeleton.module.scss.es.js +5 -5
  388. package/dist/components/Spinner/Spinner.module.scss.cjs.js +2 -2
  389. package/dist/components/Spinner/Spinner.module.scss.es.js +3 -3
  390. package/dist/components/Stepper/Step.module.scss.cjs.js +2 -2
  391. package/dist/components/Stepper/Step.module.scss.es.js +22 -22
  392. package/dist/components/Stepper/Stepper.module.scss.cjs.js +2 -2
  393. package/dist/components/Stepper/Stepper.module.scss.es.js +4 -4
  394. package/dist/components/Tabs/Tab.module.scss.cjs.js +2 -2
  395. package/dist/components/Tabs/Tab.module.scss.es.js +3 -3
  396. package/dist/components/Tabs/TabButton.cjs.js.map +1 -1
  397. package/dist/components/Tabs/TabButton.es.js.map +1 -1
  398. package/dist/components/Tabs/TabButton.module.scss.cjs.js +2 -2
  399. package/dist/components/Tabs/TabButton.module.scss.es.js +12 -12
  400. package/dist/components/Tabs/Tabs.cjs.js +1 -1
  401. package/dist/components/Tabs/Tabs.cjs.js.map +1 -1
  402. package/dist/components/Tabs/Tabs.es.js +1 -1
  403. package/dist/components/Tabs/Tabs.es.js.map +1 -1
  404. package/dist/components/Tabs/Tabs.module.scss.cjs.js +2 -2
  405. package/dist/components/Tabs/Tabs.module.scss.es.js +10 -10
  406. package/dist/components/Tag/RemoveButton.module.scss.cjs.js +2 -2
  407. package/dist/components/Tag/RemoveButton.module.scss.es.js +3 -3
  408. package/dist/components/Tag/Tag.cjs.js +1 -1
  409. package/dist/components/Tag/Tag.cjs.js.map +1 -1
  410. package/dist/components/Tag/Tag.es.js +7 -1
  411. package/dist/components/Tag/Tag.es.js.map +1 -1
  412. package/dist/components/Tag/Tag.module.scss.cjs.js +2 -2
  413. package/dist/components/Tag/Tag.module.scss.es.js +6 -6
  414. package/dist/components/TextEllipsis/TextEllipsis.cjs.js.map +1 -1
  415. package/dist/components/TextEllipsis/TextEllipsis.es.js.map +1 -1
  416. package/dist/components/TextEllipsis/TextEllipsis.module.scss.cjs.js +2 -2
  417. package/dist/components/TextEllipsis/TextEllipsis.module.scss.es.js +3 -3
  418. package/dist/components/Tiles/Tile.cjs.js.map +1 -1
  419. package/dist/components/Tiles/Tile.es.js.map +1 -1
  420. package/dist/components/Tiles/Tile.module.scss.cjs.js +2 -2
  421. package/dist/components/Tiles/Tile.module.scss.es.js +8 -8
  422. package/dist/components/Tiles/Tiles.module.scss.cjs.js +2 -2
  423. package/dist/components/Tiles/Tiles.module.scss.es.js +2 -2
  424. package/dist/components/Tooltip/Tooltip.cjs.js +1 -1
  425. package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
  426. package/dist/components/Tooltip/Tooltip.es.js +47 -39
  427. package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
  428. package/dist/components/Tooltip/Tooltip.module.scss.cjs.js +2 -2
  429. package/dist/components/Tooltip/Tooltip.module.scss.es.js +28 -27
  430. package/dist/components/Tooltip/Tooltip.module.scss.es.js.map +1 -1
  431. package/dist/components/Typography/Typography.module.scss.cjs.js +2 -2
  432. package/dist/components/Typography/Typography.module.scss.es.js +13 -13
  433. package/dist/components/_BaseStyling_/BaseStyling.cjs.js +2 -1
  434. package/dist/components/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
  435. package/dist/components/_BaseStyling_/BaseStyling.es.js +3 -3
  436. package/dist/components/_BaseStyling_/BaseStyling.es.js.map +1 -1
  437. package/dist/components/admin/layout/LeftNav/LeftNav.cjs.js.map +1 -1
  438. package/dist/components/admin/layout/LeftNav/LeftNav.es.js +1 -1
  439. package/dist/components/admin/layout/LeftNav/LeftNav.es.js.map +1 -1
  440. package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.cjs.js +2 -2
  441. package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.es.js +5 -5
  442. package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.cjs.js.map +1 -1
  443. package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.es.js +3 -1
  444. package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.es.js.map +1 -1
  445. package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.cjs.js +2 -2
  446. package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.es.js +14 -14
  447. package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.cjs.js.map +1 -1
  448. package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.es.js +6 -2
  449. package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.es.js.map +1 -1
  450. package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js +1 -1
  451. package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js.map +1 -1
  452. package/dist/components/admin/layout/LeftNav/useRefItems.es.js +7 -6
  453. package/dist/components/admin/layout/LeftNav/useRefItems.es.js.map +1 -1
  454. package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.cjs.js +2 -2
  455. package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.es.js +3 -3
  456. package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.cjs.js +2 -2
  457. package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.es.js +7 -7
  458. package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.cjs.js +2 -2
  459. package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.es.js +13 -13
  460. package/dist/components/miscellaneous/IdentityProviderButton.cjs.js.map +1 -1
  461. package/dist/components/miscellaneous/IdentityProviderButton.es.js.map +1 -1
  462. package/dist/components/miscellaneous/IdentityProviderButton.module.scss.cjs.js +2 -2
  463. package/dist/components/miscellaneous/IdentityProviderButton.module.scss.es.js +3 -3
  464. package/dist/components/withReadOnly.cjs.js +1 -1
  465. package/dist/components/withReadOnly.cjs.js.map +1 -1
  466. package/dist/components/withReadOnly.es.js +2 -4
  467. package/dist/components/withReadOnly.es.js.map +1 -1
  468. package/dist/hooks/useClickOutside.cjs.js +1 -1
  469. package/dist/hooks/useClickOutside.cjs.js.map +1 -1
  470. package/dist/hooks/useClickOutside.es.js +1 -1
  471. package/dist/hooks/useClickOutside.es.js.map +1 -1
  472. package/dist/hooks/useDebouncedCallback.cjs.js +1 -1
  473. package/dist/hooks/useDebouncedCallback.cjs.js.map +1 -1
  474. package/dist/hooks/useDebouncedCallback.es.js +9 -2
  475. package/dist/hooks/useDebouncedCallback.es.js.map +1 -1
  476. package/dist/hooks/useGetDomRoot.cjs.js.map +1 -1
  477. package/dist/hooks/useGetDomRoot.es.js.map +1 -1
  478. package/dist/hooks/usePosition.cjs.js +1 -1
  479. package/dist/hooks/usePosition.cjs.js.map +1 -1
  480. package/dist/hooks/usePosition.es.js +105 -4
  481. package/dist/hooks/usePosition.es.js.map +1 -1
  482. package/dist/hooks/useRepeatFocus.cjs.js.map +1 -1
  483. package/dist/hooks/useRepeatFocus.es.js.map +1 -1
  484. package/dist/hooks/useScreenSize.cjs.js +1 -1
  485. package/dist/hooks/useScreenSize.cjs.js.map +1 -1
  486. package/dist/hooks/useScreenSize.es.js +1 -1
  487. package/dist/hooks/useScreenSize.es.js.map +1 -1
  488. package/dist/hooks/useStickyStacking.cjs.js +2 -0
  489. package/dist/hooks/useStickyStacking.cjs.js.map +1 -0
  490. package/dist/hooks/useStickyStacking.es.js +208 -0
  491. package/dist/hooks/useStickyStacking.es.js.map +1 -0
  492. package/dist/hooks/useUploadFile.cjs.js +1 -1
  493. package/dist/hooks/useUploadFile.cjs.js.map +1 -1
  494. package/dist/hooks/useUploadFile.es.js +1 -1
  495. package/dist/hooks/useUploadFile.es.js.map +1 -1
  496. package/dist/index.cjs.js +1 -1
  497. package/dist/index.d.ts +141 -29
  498. package/dist/index.es.js +4 -0
  499. package/dist/index.es.js.map +1 -1
  500. package/dist/node_modules/tabbable/dist/index.esm.cjs.js +1 -1
  501. package/dist/node_modules/tabbable/dist/index.esm.cjs.js.map +1 -1
  502. package/dist/node_modules/tabbable/dist/index.esm.es.js +4 -3
  503. package/dist/node_modules/tabbable/dist/index.esm.es.js.map +1 -1
  504. package/dist/readyclasses.module.scss.cjs.js +2 -2
  505. package/dist/readyclasses.module.scss.es.js +5 -5
  506. package/dist/util/helper.cjs.js +1 -1
  507. package/dist/util/helper.cjs.js.map +1 -1
  508. package/dist/util/helper.es.js +33 -16
  509. package/dist/util/helper.es.js.map +1 -1
  510. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs.js","sources":["../../../../src/components/Form/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ForwardRefRenderFunction,\n ComponentPropsWithRef,\n ReactElement,\n ReactNode,\n useEffect\n} from \"react\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { Props as FormHelperTextProps } from \"../FormHelperText/FormHelperText\";\nimport classes from \"./Checkbox.module.scss\";\nimport { useFormSelector } from \"../../../hooks/useFormSelector\";\nimport {\n FormSelectorWrapper,\n Props as FormSelectorWrapperProps\n} from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormSelector } from \"../form.interfaces\";\nimport { withReadOnly } from \"../../withReadOnly\";\nimport { useInlineEditing } from \"../../InlineEditing/InlineEditingContext\";\n\nconst isToggle = (children: ReactNode) => !!(children as ReactElement)?.props?.[\"data-toggle\"];\n\nexport interface Props extends ComponentPropsWithRef<\"input\">, FormSelector {\n label?: string | React.ReactElement;\n indeterminate?: boolean;\n required?: boolean;\n helperProps?: FormHelperTextProps;\n formSelectorWrapperProps?: FormSelectorWrapperProps;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n readOnlyView?: boolean;\n}\n\nconst CheckboxComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (\n {\n readOnly,\n children,\n name,\n helperText,\n helperProps,\n indeterminate,\n parentErrorId,\n errorMessage,\n errorMessageProps,\n disabled,\n label,\n parentHelperId,\n className,\n error,\n checked = false,\n formSelectorWrapperProps,\n required,\n onChange,\n ...rest\n }: Props,\n ref\n) => {\n const { errorId, identifier, describedBy } = useFormSelector({\n name,\n helperText,\n parentErrorId,\n errorMessage,\n error,\n parentHelperId\n });\n\n const { required: inlineRequired } = useInlineEditing();\n\n useEffect(() => {\n if (!name) {\n throw new Error(\"Please pass a 'name' prop to your <Checkbox> component.\");\n }\n\n if (typeof children === \"object\" && !isToggle(children) && indeterminate === undefined) {\n throw new Error(\n \"If you have nested checkboxes you have to manage the indeterminate state by passing a boolean to the `indeterminate` prop.\"\n );\n }\n }, []);\n\n const determineLabel = () => {\n // this should be temporary, for backwards compatibility;\n // once the components implementing checkboxes in microfrontends are updated, only label should be returned\n if (label) {\n return label;\n } else if (typeof children === \"string\") {\n return children;\n }\n };\n\n const renderNestedCheckboxes = () => (\n <ul className={classes[\"checkbox-list\"]}>\n {React.Children.map(children as ReactElement[], child => {\n return (\n <li>\n <Checkbox\n {...child.props}\n parentHelperId={parentHelperId}\n parentErrorId={parentErrorId}\n error={error}\n disabled={child.props.disabled ? child.props.disabled : disabled}\n >\n {child.props.children}\n </Checkbox>\n </li>\n );\n })}\n </ul>\n );\n\n const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n return;\n }\n onChange?.(event);\n };\n\n const renderToggle = () => React.Children.toArray(children).filter(isToggle);\n\n const iconClasses = [classes[\"input\"]];\n const nativeInputClasses = [classes[\"native-input\"]];\n const wrapperClasses = [classes[\"checkbox-wrapper\"]];\n error && nativeInputClasses.push(classes[\"error\"]);\n disabled && nativeInputClasses.push(classes[\"disabled\"]) && iconClasses.push(classes[\"disabled\"]);\n className && wrapperClasses.push(className);\n\n return (\n <FormSelectorWrapper\n {...formSelectorWrapperProps}\n className={wrapperClasses.join(\" \")}\n containerProps={{ className: classes[\"checkbox-container\"] }}\n helperText={helperText}\n helperProps={helperProps}\n parentErrorId={parentErrorId}\n errorId={errorId}\n errorMessage={errorMessage}\n errorMessageProps={{\n ...errorMessageProps,\n className: `${errorMessageProps?.className} ${classes[\"error-message\"]}`\n }}\n error={error}\n disabled={disabled}\n identifier={identifier}\n required={inlineRequired}\n nestedChildren={\n typeof children === \"object\" && !isToggle(children) && renderNestedCheckboxes()\n }\n >\n <input\n {...rest}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n className={nativeInputClasses.join(\" \")}\n checked={checked}\n onChange={onChangeHandler}\n aria-invalid={error as boolean}\n aria-checked={indeterminate ? \"mixed\" : checked}\n aria-describedby={describedBy}\n aria-required={required || inlineRequired}\n id={`${identifier}-checkbox`}\n name={name}\n type=\"checkbox\"\n />\n {renderToggle()}\n\n {indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"indeterminate\"]}`}\n icon={Icons.MinusSquare}\n />\n )}\n {checked && !indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"checkmark\"]}`}\n icon={Icons.CheckmarkSquare}\n />\n )}\n {!checked && !indeterminate && (\n <Icon className={`${iconClasses.join(\" \")} ${classes[\"square\"]}`} icon={Icons.Square} />\n )}\n <label\n className={`${required ? classes[\"required\"] : \"\"}`}\n htmlFor={`${identifier}-checkbox`}\n >\n {determineLabel()}\n </label>\n </FormSelectorWrapper>\n );\n};\n\nexport const Checkbox = withReadOnly(React.forwardRef(CheckboxComponent));\n"],"names":["isToggle","children","_a","props","Checkbox","withReadOnly","React","forwardRef","readOnly","name","helperText","helperProps","indeterminate","parentErrorId","errorMessage","errorMessageProps","disabled","label","parentHelperId","className","error","checked","formSelectorWrapperProps","required","onChange","rest","ref","errorId","identifier","describedBy","useFormSelector","inlineRequired","useInlineEditing","useEffect","Error","iconClasses","classes","nativeInputClasses","wrapperClasses","push","createElement","FormSelectorWrapper","join","containerProps","nestedChildren","Children","map","child","event","id","type","to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B,UAAWiB,EAAAA,QAAQ,kBACpB9B,EAAMuC,SAASC,IAAI7C,EAA4B8C,mBAE3C,KAAA,KACCzC,EAAAkC,cAACpC,EAAA,IACK2C,EAAM5C,MACVe,iBACAL,gBACAO,QACAJ,SAAU+B,EAAM5C,MAAMa,SAAW+B,EAAM5C,MAAMa,SAAWA,GAEvD+B,EAAM5C,MAAMF,cA8CrBK,EAAAkC,cAAC,QAAA,IACKf,EACJC,MACAV,WACA,gBAAeA,EACfG,UAAWkB,EAAmBK,KAAK,KACnCrB,UACAG,SA7CmBwB,IACnBhC,GAGJ,MAAAQ,GAAAA,EAAWwB,IA0CP,eAAc5B,EACd,eAAcR,EAAgB,QAAUS,EACxC,mBAAkBQ,EAClB,gBAAeN,GAAYQ,EAC3BkB,GAAI,GAAGrB,aACPnB,OACAyC,KAAK,aA7CgB5C,EAAMuC,SAASM,QAAQlD,GAAUmD,OAAOpD,GAiD9DY,GACCN,EAAAkC,cAACa,EAAAA,KAAA,CACClC,UAAW,GAAGgB,EAAYO,KAAK,QAAQN,EAAAA,QAAuB,gBAC9DkB,KAAMC,EAAAA,MAAMC,cAGfnC,IAAYT,GACXN,EAAAkC,cAACa,EAAAA,KAAA,CACClC,UAAW,GAAGgB,EAAYO,KAAK,QAAQN,EAAAA,QAAmB,YAC1DkB,KAAMC,EAAAA,MAAME,mBAGdpC,IAAYT,GACZN,EAAAkC,cAACa,OAAA,CAAKlC,UAAW,GAAGgB,EAAYO,KAAK,QAAQN,EAAAA,QAAgB,SAAKkB,KAAMC,QAAMG,SAEhFpD,EAAAkC,cAAC,QAAA,CACCrB,UAAW,GAAGI,EAAWa,EAAAA,QAAkB,SAAI,KAC/CuB,QAAS,GAAG/B,cApGZX,IAE2B,iBAAbhB,EACTA,OADT"}
1
+ {"version":3,"file":"Checkbox.cjs.js","sources":["../../../../src/components/Form/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ForwardRefRenderFunction,\n ComponentPropsWithRef,\n ReactElement,\n ReactNode,\n useEffect\n} from \"react\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { Props as FormHelperTextProps } from \"../FormHelperText/FormHelperText\";\nimport classes from \"./Checkbox.module.scss\";\nimport { useFormSelector } from \"../../../hooks/useFormSelector\";\nimport {\n FormSelectorWrapper,\n Props as FormSelectorWrapperProps\n} from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormSelector } from \"../form.interfaces\";\nimport { withReadOnly } from \"../../withReadOnly\";\nimport { useInlineEditing } from \"../../InlineEditing/InlineEditingContext\";\n\nconst isToggle = (children: ReactNode) =>\n !!(children as ReactElement<Record<string, unknown>>)?.props?.[\"data-toggle\"];\n\nexport interface Props extends ComponentPropsWithRef<\"input\">, FormSelector {\n label?: string | React.ReactElement;\n indeterminate?: boolean;\n required?: boolean;\n helperProps?: FormHelperTextProps;\n formSelectorWrapperProps?: FormSelectorWrapperProps;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n readOnlyView?: boolean;\n}\n\nconst CheckboxComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (\n {\n readOnly,\n children,\n name,\n helperText,\n helperProps,\n indeterminate,\n parentErrorId,\n errorMessage,\n errorMessageProps,\n disabled,\n label,\n parentHelperId,\n className,\n error,\n checked = false,\n formSelectorWrapperProps,\n required,\n onChange,\n ...rest\n }: Props,\n ref\n) => {\n const { errorId, identifier, describedBy } = useFormSelector({\n name,\n helperText,\n parentErrorId,\n errorMessage,\n error,\n parentHelperId\n });\n\n const { required: inlineRequired } = useInlineEditing();\n\n useEffect(() => {\n if (!name) {\n throw new Error(\"Please pass a 'name' prop to your <Checkbox> component.\");\n }\n\n if (typeof children === \"object\" && !isToggle(children) && indeterminate === undefined) {\n throw new Error(\n \"If you have nested checkboxes you have to manage the indeterminate state by passing a boolean to the `indeterminate` prop.\"\n );\n }\n }, []);\n\n const determineLabel = () => {\n // this should be temporary, for backwards compatibility;\n // once the components implementing checkboxes in microfrontends are updated, only label should be returned\n if (label) {\n return label;\n } else if (typeof children === \"string\") {\n return children;\n }\n };\n\n const renderNestedCheckboxes = () => (\n <ul className={classes[\"checkbox-list\"]}>\n {React.Children.map(children as ReactElement<Props>[], child => {\n return (\n <li>\n <Checkbox\n {...child.props}\n parentHelperId={parentHelperId}\n parentErrorId={parentErrorId}\n error={error}\n disabled={child.props.disabled ? child.props.disabled : disabled}\n >\n {child.props.children}\n </Checkbox>\n </li>\n );\n })}\n </ul>\n );\n\n const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n return;\n }\n onChange?.(event);\n };\n\n const renderToggle = () => React.Children.toArray(children).filter(isToggle);\n\n const iconClasses = [classes[\"input\"]];\n const nativeInputClasses = [classes[\"native-input\"]];\n const wrapperClasses = [classes[\"checkbox-wrapper\"]];\n error && nativeInputClasses.push(classes[\"error\"]);\n disabled && nativeInputClasses.push(classes[\"disabled\"]) && iconClasses.push(classes[\"disabled\"]);\n className && wrapperClasses.push(className);\n\n return (\n <FormSelectorWrapper\n {...formSelectorWrapperProps}\n className={wrapperClasses.join(\" \")}\n containerProps={{ className: classes[\"checkbox-container\"] }}\n helperText={helperText}\n helperProps={helperProps}\n parentErrorId={parentErrorId}\n errorId={errorId}\n errorMessage={errorMessage}\n errorMessageProps={{\n ...errorMessageProps,\n className: `${errorMessageProps?.className} ${classes[\"error-message\"]}`\n }}\n error={error}\n disabled={disabled}\n identifier={identifier}\n required={inlineRequired}\n nestedChildren={\n typeof children === \"object\" && !isToggle(children) && renderNestedCheckboxes()\n }\n >\n <input\n {...rest}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n className={nativeInputClasses.join(\" \")}\n checked={checked}\n onChange={onChangeHandler}\n aria-invalid={error as boolean}\n aria-checked={indeterminate ? \"mixed\" : checked}\n aria-describedby={describedBy}\n aria-required={required || inlineRequired}\n id={`${identifier}-checkbox`}\n name={name}\n type=\"checkbox\"\n />\n {renderToggle()}\n\n {indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"indeterminate\"]}`}\n icon={Icons.MinusSquare}\n />\n )}\n {checked && !indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"checkmark\"]}`}\n icon={Icons.CheckmarkSquare}\n />\n )}\n {!checked && !indeterminate && (\n <Icon className={`${iconClasses.join(\" \")} ${classes[\"square\"]}`} icon={Icons.Square} />\n )}\n <label\n className={`${required ? classes[\"required\"] : \"\"}`}\n htmlFor={`${identifier}-checkbox`}\n >\n {determineLabel()}\n </label>\n </FormSelectorWrapper>\n );\n};\n\nexport const Checkbox = withReadOnly(React.forwardRef(CheckboxComponent));\n"],"names":["isToggle","children","_a","props","Checkbox","withReadOnly","React","forwardRef","readOnly","name","helperText","helperProps","indeterminate","parentErrorId","errorMessage","errorMessageProps","disabled","label","parentHelperId","className","error","checked","formSelectorWrapperProps","required","onChange","rest","ref","errorId","identifier","describedBy","useFormSelector","inlineRequired","useInlineEditing","useEffect","Error","iconClasses","classes","nativeInputClasses","wrapperClasses","push","createElement","FormSelectorWrapper","join","containerProps","nestedChildren","Children","map","child","event","id","type","toArray","filter","Icon","icon","Icons","MinusSquare","CheckmarkSquare","Square","htmlFor"],"mappings":"8YAmCMA,EAAYC,UAChB,SAAG,OAAAC,EAAA,MAAAD,OAAA,EAAAA,EAAoDE,YAApD,EAAAD,EAA4D,iBA0KpDE,EAAWC,EAAAA,aAAaC,EAAMC,WA9JkC,EAEzEC,WACAP,WACAQ,OACAC,aACAC,cACAC,gBACAC,gBACAC,eACAC,oBAC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Kf,EACJC,MACAV,WACA,gBAAeA,EACfG,UAAWkB,EAAmBK,KAAK,KACnCrB,UACAG,SA7CmBwB,IACnBhC,GAGJ,MAAAQ,GAAAA,EAAWwB,IA0CP,eAAc5B,EACd,eAAcR,EAAgB,QAAUS,EACxC,mBAAkBQ,EAClB,gBAAeN,GAAYQ,EAC3BkB,GAAI,GAAGrB,aACPnB,OACAyC,KAAK,aA7CgB5C,EAAMuC,SAASM,QAAQlD,GAAUmD,OAAOpD,GAiD9DY,GACCN,EAAAkC,cAACa,EAAAA,KAAA,CACClC,UAAW,GAAGgB,EAAYO,KAAK,QAAQN,EAAAA,QAAuB,gBAC9DkB,KAAMC,EAAAA,MAAMC,cAGfnC,IAAYT,GACXN,EAAAkC,cAACa,EAAAA,KAAA,CACClC,UAAW,GAAGgB,EAAYO,KAAK,QAAQN,EAAAA,QAAmB,YAC1DkB,KAAMC,EAAAA,MAAME,mBAGdpC,IAAYT,GACZN,EAAAkC,cAACa,OAAA,CAAKlC,UAAW,GAAGgB,EAAYO,KAAK,QAAQN,EAAAA,QAAgB,SAAKkB,KAAMC,QAAMG,SAEhFpD,EAAAkC,cAAC,QAAA,CACCrB,UAAW,GAAGI,EAAWa,EAAAA,QAAkB,SAAI,KAC/CuB,QAAS,GAAG/B,cApGZX,IAE2B,iBAAbhB,EACTA,OADT"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.es.js","sources":["../../../../src/components/Form/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ForwardRefRenderFunction,\n ComponentPropsWithRef,\n ReactElement,\n ReactNode,\n useEffect\n} from \"react\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { Props as FormHelperTextProps } from \"../FormHelperText/FormHelperText\";\nimport classes from \"./Checkbox.module.scss\";\nimport { useFormSelector } from \"../../../hooks/useFormSelector\";\nimport {\n FormSelectorWrapper,\n Props as FormSelectorWrapperProps\n} from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormSelector } from \"../form.interfaces\";\nimport { withReadOnly } from \"../../withReadOnly\";\nimport { useInlineEditing } from \"../../InlineEditing/InlineEditingContext\";\n\nconst isToggle = (children: ReactNode) => !!(children as ReactElement)?.props?.[\"data-toggle\"];\n\nexport interface Props extends ComponentPropsWithRef<\"input\">, FormSelector {\n label?: string | React.ReactElement;\n indeterminate?: boolean;\n required?: boolean;\n helperProps?: FormHelperTextProps;\n formSelectorWrapperProps?: FormSelectorWrapperProps;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n readOnlyView?: boolean;\n}\n\nconst CheckboxComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (\n {\n readOnly,\n children,\n name,\n helperText,\n helperProps,\n indeterminate,\n parentErrorId,\n errorMessage,\n errorMessageProps,\n disabled,\n label,\n parentHelperId,\n className,\n error,\n checked = false,\n formSelectorWrapperProps,\n required,\n onChange,\n ...rest\n }: Props,\n ref\n) => {\n const { errorId, identifier, describedBy } = useFormSelector({\n name,\n helperText,\n parentErrorId,\n errorMessage,\n error,\n parentHelperId\n });\n\n const { required: inlineRequired } = useInlineEditing();\n\n useEffect(() => {\n if (!name) {\n throw new Error(\"Please pass a 'name' prop to your <Checkbox> component.\");\n }\n\n if (typeof children === \"object\" && !isToggle(children) && indeterminate === undefined) {\n throw new Error(\n \"If you have nested checkboxes you have to manage the indeterminate state by passing a boolean to the `indeterminate` prop.\"\n );\n }\n }, []);\n\n const determineLabel = () => {\n // this should be temporary, for backwards compatibility;\n // once the components implementing checkboxes in microfrontends are updated, only label should be returned\n if (label) {\n return label;\n } else if (typeof children === \"string\") {\n return children;\n }\n };\n\n const renderNestedCheckboxes = () => (\n <ul className={classes[\"checkbox-list\"]}>\n {React.Children.map(children as ReactElement[], child => {\n return (\n <li>\n <Checkbox\n {...child.props}\n parentHelperId={parentHelperId}\n parentErrorId={parentErrorId}\n error={error}\n disabled={child.props.disabled ? child.props.disabled : disabled}\n >\n {child.props.children}\n </Checkbox>\n </li>\n );\n })}\n </ul>\n );\n\n const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n return;\n }\n onChange?.(event);\n };\n\n const renderToggle = () => React.Children.toArray(children).filter(isToggle);\n\n const iconClasses = [classes[\"input\"]];\n const nativeInputClasses = [classes[\"native-input\"]];\n const wrapperClasses = [classes[\"checkbox-wrapper\"]];\n error && nativeInputClasses.push(classes[\"error\"]);\n disabled && nativeInputClasses.push(classes[\"disabled\"]) && iconClasses.push(classes[\"disabled\"]);\n className && wrapperClasses.push(className);\n\n return (\n <FormSelectorWrapper\n {...formSelectorWrapperProps}\n className={wrapperClasses.join(\" \")}\n containerProps={{ className: classes[\"checkbox-container\"] }}\n helperText={helperText}\n helperProps={helperProps}\n parentErrorId={parentErrorId}\n errorId={errorId}\n errorMessage={errorMessage}\n errorMessageProps={{\n ...errorMessageProps,\n className: `${errorMessageProps?.className} ${classes[\"error-message\"]}`\n }}\n error={error}\n disabled={disabled}\n identifier={identifier}\n required={inlineRequired}\n nestedChildren={\n typeof children === \"object\" && !isToggle(children) && renderNestedCheckboxes()\n }\n >\n <input\n {...rest}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n className={nativeInputClasses.join(\" \")}\n checked={checked}\n onChange={onChangeHandler}\n aria-invalid={error as boolean}\n aria-checked={indeterminate ? \"mixed\" : checked}\n aria-describedby={describedBy}\n aria-required={required || inlineRequired}\n id={`${identifier}-checkbox`}\n name={name}\n type=\"checkbox\"\n />\n {renderToggle()}\n\n {indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"indeterminate\"]}`}\n icon={Icons.MinusSquare}\n />\n )}\n {checked && !indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"checkmark\"]}`}\n icon={Icons.CheckmarkSquare}\n />\n )}\n {!checked && !indeterminate && (\n <Icon className={`${iconClasses.join(\" \")} ${classes[\"square\"]}`} icon={Icons.Square} />\n )}\n <label\n className={`${required ? classes[\"required\"] : \"\"}`}\n htmlFor={`${identifier}-checkbox`}\n >\n {determineLabel()}\n </label>\n </FormSelectorWrapper>\n );\n};\n\nexport const Checkbox = withReadOnly(React.forwardRef(CheckboxComponent));\n"],"names":[],"mappings":";;;;;;;AAmCA,MAAM,WAAW,CAAC,aAAA;;AAAwB,UAAC,GAAE,0CAA2B,UAA3B,mBAAmC;AAAA;AAYhF,MAAM,oBAAuE,CAC3E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,QACG;AACH,QAAM,EAAE,SAAS,YAAY,YAAA,IAAgB,gBAAgB;AAAA,IAC3D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAED,QAAM,EAAE,UAAU,eAAA,IAAmB,iBAAA;AAErC,YAAU,MAAM;AACd,QAAI,CAAC,MAAM;AACT,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC3E;AAEA,QAAI,OAAO,aAAa,YAAY,CAAC,SAAS,QAAQ,KAAK,kBAAkB,QAAW;AACtF,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,QAAM,iBAAiB,MAAM;AAG3B,QAAI,OAAO;AAC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+ {"version":3,"file":"Checkbox.es.js","sources":["../../../../src/components/Form/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ForwardRefRenderFunction,\n ComponentPropsWithRef,\n ReactElement,\n ReactNode,\n useEffect\n} from \"react\";\nimport { Icon, Icons } from \"../../Icon/Icon\";\nimport { Props as FormHelperTextProps } from \"../FormHelperText/FormHelperText\";\nimport classes from \"./Checkbox.module.scss\";\nimport { useFormSelector } from \"../../../hooks/useFormSelector\";\nimport {\n FormSelectorWrapper,\n Props as FormSelectorWrapperProps\n} from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormSelector } from \"../form.interfaces\";\nimport { withReadOnly } from \"../../withReadOnly\";\nimport { useInlineEditing } from \"../../InlineEditing/InlineEditingContext\";\n\nconst isToggle = (children: ReactNode) =>\n !!(children as ReactElement<Record<string, unknown>>)?.props?.[\"data-toggle\"];\n\nexport interface Props extends ComponentPropsWithRef<\"input\">, FormSelector {\n label?: string | React.ReactElement;\n indeterminate?: boolean;\n required?: boolean;\n helperProps?: FormHelperTextProps;\n formSelectorWrapperProps?: FormSelectorWrapperProps;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n readOnlyView?: boolean;\n}\n\nconst CheckboxComponent: ForwardRefRenderFunction<HTMLInputElement, Props> = (\n {\n readOnly,\n children,\n name,\n helperText,\n helperProps,\n indeterminate,\n parentErrorId,\n errorMessage,\n errorMessageProps,\n disabled,\n label,\n parentHelperId,\n className,\n error,\n checked = false,\n formSelectorWrapperProps,\n required,\n onChange,\n ...rest\n }: Props,\n ref\n) => {\n const { errorId, identifier, describedBy } = useFormSelector({\n name,\n helperText,\n parentErrorId,\n errorMessage,\n error,\n parentHelperId\n });\n\n const { required: inlineRequired } = useInlineEditing();\n\n useEffect(() => {\n if (!name) {\n throw new Error(\"Please pass a 'name' prop to your <Checkbox> component.\");\n }\n\n if (typeof children === \"object\" && !isToggle(children) && indeterminate === undefined) {\n throw new Error(\n \"If you have nested checkboxes you have to manage the indeterminate state by passing a boolean to the `indeterminate` prop.\"\n );\n }\n }, []);\n\n const determineLabel = () => {\n // this should be temporary, for backwards compatibility;\n // once the components implementing checkboxes in microfrontends are updated, only label should be returned\n if (label) {\n return label;\n } else if (typeof children === \"string\") {\n return children;\n }\n };\n\n const renderNestedCheckboxes = () => (\n <ul className={classes[\"checkbox-list\"]}>\n {React.Children.map(children as ReactElement<Props>[], child => {\n return (\n <li>\n <Checkbox\n {...child.props}\n parentHelperId={parentHelperId}\n parentErrorId={parentErrorId}\n error={error}\n disabled={child.props.disabled ? child.props.disabled : disabled}\n >\n {child.props.children}\n </Checkbox>\n </li>\n );\n })}\n </ul>\n );\n\n const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n return;\n }\n onChange?.(event);\n };\n\n const renderToggle = () => React.Children.toArray(children).filter(isToggle);\n\n const iconClasses = [classes[\"input\"]];\n const nativeInputClasses = [classes[\"native-input\"]];\n const wrapperClasses = [classes[\"checkbox-wrapper\"]];\n error && nativeInputClasses.push(classes[\"error\"]);\n disabled && nativeInputClasses.push(classes[\"disabled\"]) && iconClasses.push(classes[\"disabled\"]);\n className && wrapperClasses.push(className);\n\n return (\n <FormSelectorWrapper\n {...formSelectorWrapperProps}\n className={wrapperClasses.join(\" \")}\n containerProps={{ className: classes[\"checkbox-container\"] }}\n helperText={helperText}\n helperProps={helperProps}\n parentErrorId={parentErrorId}\n errorId={errorId}\n errorMessage={errorMessage}\n errorMessageProps={{\n ...errorMessageProps,\n className: `${errorMessageProps?.className} ${classes[\"error-message\"]}`\n }}\n error={error}\n disabled={disabled}\n identifier={identifier}\n required={inlineRequired}\n nestedChildren={\n typeof children === \"object\" && !isToggle(children) && renderNestedCheckboxes()\n }\n >\n <input\n {...rest}\n ref={ref}\n disabled={disabled}\n aria-disabled={disabled}\n className={nativeInputClasses.join(\" \")}\n checked={checked}\n onChange={onChangeHandler}\n aria-invalid={error as boolean}\n aria-checked={indeterminate ? \"mixed\" : checked}\n aria-describedby={describedBy}\n aria-required={required || inlineRequired}\n id={`${identifier}-checkbox`}\n name={name}\n type=\"checkbox\"\n />\n {renderToggle()}\n\n {indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"indeterminate\"]}`}\n icon={Icons.MinusSquare}\n />\n )}\n {checked && !indeterminate && (\n <Icon\n className={`${iconClasses.join(\" \")} ${classes[\"checkmark\"]}`}\n icon={Icons.CheckmarkSquare}\n />\n )}\n {!checked && !indeterminate && (\n <Icon className={`${iconClasses.join(\" \")} ${classes[\"square\"]}`} icon={Icons.Square} />\n )}\n <label\n className={`${required ? classes[\"required\"] : \"\"}`}\n htmlFor={`${identifier}-checkbox`}\n >\n {determineLabel()}\n </label>\n </FormSelectorWrapper>\n );\n};\n\nexport const Checkbox = withReadOnly(React.forwardRef(CheckboxComponent));\n"],"names":[],"mappings":";;;;;;;AAmCA,MAAM,WAAW,CAAC,aAAA;;AAChB,UAAC,GAAE,0CAAoD,UAApD,mBAA4D;AAAA;AAYjE,MAAM,oBAAuE,CAC3E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,QACG;AACH,QAAM,EAAE,SAAS,YAAY,YAAA,IAAgB,gBAAgB;AAAA,I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;AAAA,IAAA;AAAA,IAGf,CAAC,WAAW,CAAC,iBACZ,sBAAA,cAAC,MAAA,EAAK,WAAW,GAAG,YAAY,KAAK,GAAG,CAAC,IAAI,QAAQ,QAAQ,CAAC,IAAI,MAAM,MAAM,QAAQ;AAAA,IAExF,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,GAAG,WAAW,QAAQ,UAAU,IAAI,EAAE;AAAA,QACjD,SAAS,GAAG,UAAU;AAAA,MAAA;AAAA,MAErB,eAAA;AAAA,IAAe;AAAA,EAClB;AAGN;AAEO,MAAM,WAAW,aAAa,MAAM,WAAW,iBAAiB,CAAC;"}
@@ -1,3 +1,3 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.Checkbox_sr-only_gLrTA{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.Checkbox_hidden_gLrTA{display:none}.Checkbox_slide-in_gLrTA{animation:Checkbox_slide-in_gLrTA .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-in_gLrTA{animation-duration:.1ms}}.Checkbox_slide-out_gLrTA{animation:Checkbox_slide-out_gLrTA .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-out_gLrTA{animation-duration:.1ms}}@keyframes Checkbox_slide-in_gLrTA{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes Checkbox_slide-out_gLrTA{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Checkbox_checkbox-wrapper_gLrTA{position:relative}.Checkbox_checkbox-wrapper_gLrTA+.Checkbox_checkbox-wrapper_gLrTA{margin-top:.75rem}.Checkbox_checkbox-container_gLrTA{display:flex}.Checkbox_checkbox-container_gLrTA label{display:inline-block;margin-left:calc(.5 * var(--font-size));-webkit-user-select:none;user-select:none;font-size:var(--font-size-form-label);font-family:var(--font-family);margin-top:.1rem}.Checkbox_checkbox-list_gLrTA{padding:0;margin:1rem 0 0 1.75rem;list-style:none}.Checkbox_checkbox-list_gLrTA li+li{margin-top:.75rem}.Checkbox_native-input_gLrTA{position:absolute;top:0;left:0;opacity:0;margin:0;width:var(--font-size-big);height:var(--font-size-big);z-index:2}.Checkbox_native-input_gLrTA:checked:not(.Checkbox_disabled_gLrTA)+*{color:var(--checkbox-checked-color)}.Checkbox_native-input_gLrTA:focus-visible+*{border-radius:2px;outline:2px solid var(--color-focus);outline-offset:2px}.Checkbox_native-input_gLrTA:active:not(.Checkbox_disabled_gLrTA)+span{background-color:var(--disabled)}.Checkbox_native-input_gLrTA.Checkbox_error_gLrTA:focus-visible+*{outline-color:var(--color-error)}.Checkbox_native-input_gLrTA+span[data-icon=true]:before{display:block;width:var(--font-size-big);height:var(--font-size-big)}.Checkbox_native-input_gLrTA:hover+.Checkbox_square_gLrTA:not(.Checkbox_disabled_gLrTA){background-color:var(--checkbox-unchecked-hover-color)}.Checkbox_native-input_gLrTA:active+.Checkbox_square_gLrTA:not(.Checkbox_disabled_gLrTA){background-color:var(--checkbox-unchecked-pressed-color)}.Checkbox_native-input_gLrTA:hover+.Checkbox_checkmark_gLrTA:not(.Checkbox_disabled_gLrTA),.Checkbox_native-input_gLrTA:active+.Checkbox_indeterminate_gLrTA:not(.Checkbox_disabled_gLrTA){color:var(--checkbox-checked-hover-color)}.Checkbox_native-input_gLrTA:active+.Checkbox_checkmark_gLrTA:not(.Checkbox_disabled_gLrTA),.Checkbox_native-input_gLrTA:active+.Checkbox_indeterminate_gLrTA:not(.Checkbox_disabled_gLrTA){color:var(--checkbox-checked-pressed-color)}.Checkbox_error-message_gLrTA{margin-top:.25rem;margin-left:calc(1.75 * var(--font-size));font-size:var(--font-size-sub)}.Checkbox_input_gLrTA{font-size:var(--font-size-big);width:var(--font-size-big);height:var(--font-size-big);z-index:1;color:var(--checkbox-unchecked-color)}.Checkbox_disabled_gLrTA{cursor:not-allowed}.Checkbox_disabled_gLrTA+span{color:var(--disabled);pointer-events:none}.Checkbox_disabled_gLrTA+label{color:var(--greyed-out)}.Checkbox_disabled_gLrTA+.Checkbox_checkmark_gLrTA,.Checkbox_disabled_gLrTA+.Checkbox_indeterminate_gLrTA{color:var(--disabled);background-color:var(--greyed-out);border-radius:2px;outline:1px var(--disabled) solid;outline-offset:-1px}.Checkbox_indeterminate_gLrTA{color:var(--checkbox-checked-color)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA label{border-color:var(--read-only-border-color);color:var(--read-only-text-color);background-color:transparent;-webkit-user-select:text;user-select:text}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA span{color:var(--color-blue-grey100)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA span.Checkbox_checkmark_gLrTA{background-color:var(--color-blue-grey900);color:var(--color-white);border-radius:2px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA span.Checkbox_checkmark_gLrTA:before{outline:1px solid var(--read-only-border-color);border-radius:2px;outline-offset:-1px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA input[type=checkbox]{pointer-events:none}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span:before{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_gLrTA{background-color:var(--color-blue-grey900);color:var(--color-white);border:1px solid var(--read-only-border-color);border-radius:3px}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_gLrTA:before{color:var(--color-white)}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span[data-icon=true]{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_gLrTA{background-color:var(--color-blue-grey900);color:var(--color-white);border:0}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_gLrTA:before{outline:1px solid var(--read-only-border-color);outline-offset:-1px;border-radius:2px}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~label{pointer-events:none;-webkit-user-select:text;user-select:text}.Checkbox_required_gLrTA:after{content:" *";color:var(--error)}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}}();
2
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="Checkbox_disabled_gLrTA",r="Checkbox_error_gLrTA",o="Checkbox_square_gLrTA",c="Checkbox_checkmark_gLrTA",t="Checkbox_indeterminate_gLrTA",i="Checkbox_input_gLrTA",x="Checkbox_required_gLrTA",s={"checkbox-wrapper":"Checkbox_checkbox-wrapper_gLrTA","checkbox-container":"Checkbox_checkbox-container_gLrTA","checkbox-list":"Checkbox_checkbox-list_gLrTA","native-input":"Checkbox_native-input_gLrTA",disabled:e,error:r,square:o,checkmark:c,indeterminate:t,"error-message":"Checkbox_error-message_gLrTA",input:i,required:x};exports.checkmark=c,exports.default=s,exports.disabled=e,exports.error=r,exports.indeterminate=t,exports.input=i,exports.required=x,exports.square=o;
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.Checkbox_sr-only_8eZbI{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.Checkbox_hidden_8eZbI{display:none}.Checkbox_slide-in_8eZbI{animation:Checkbox_slide-in_8eZbI .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-in_8eZbI{animation-duration:.1ms}}.Checkbox_slide-out_8eZbI{animation:Checkbox_slide-out_8eZbI .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-out_8eZbI{animation-duration:.1ms}}@keyframes Checkbox_slide-in_8eZbI{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes Checkbox_slide-out_8eZbI{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Checkbox_checkbox-wrapper_8eZbI{position:relative}.Checkbox_checkbox-wrapper_8eZbI+.Checkbox_checkbox-wrapper_8eZbI{margin-top:.75rem}.Checkbox_checkbox-container_8eZbI{display:flex}.Checkbox_checkbox-container_8eZbI label{display:inline-block;margin-left:calc(.5 * var(--font-size));-webkit-user-select:none;user-select:none;font-size:var(--font-size-form-label);font-family:var(--font-family);margin-top:.1rem}.Checkbox_checkbox-list_8eZbI{padding:0;margin:.75rem 0 0 1.75rem;list-style:none}.Checkbox_checkbox-list_8eZbI li+li{margin-top:.75rem}.Checkbox_native-input_8eZbI{position:absolute;top:0;left:0;opacity:0;margin:0;width:var(--font-size-big);height:var(--font-size-big);z-index:2}.Checkbox_native-input_8eZbI:checked:not(.Checkbox_disabled_8eZbI)+*{color:var(--checkbox-checked-color)}.Checkbox_native-input_8eZbI:focus-visible+*{border-radius:2px;outline:2px solid var(--color-focus);outline-offset:2px}.Checkbox_native-input_8eZbI:active:not(.Checkbox_disabled_8eZbI)+span{background-color:var(--disabled)}.Checkbox_native-input_8eZbI.Checkbox_error_8eZbI:focus-visible+*{outline-color:var(--color-error)}.Checkbox_native-input_8eZbI+span[data-icon=true]:before{display:block;width:var(--font-size-big);height:var(--font-size-big)}.Checkbox_native-input_8eZbI:hover+.Checkbox_square_8eZbI:not(.Checkbox_disabled_8eZbI){background-color:var(--checkbox-unchecked-hover-color)}.Checkbox_native-input_8eZbI:active+.Checkbox_square_8eZbI:not(.Checkbox_disabled_8eZbI){background-color:var(--checkbox-unchecked-pressed-color)}.Checkbox_native-input_8eZbI:hover+.Checkbox_checkmark_8eZbI:not(.Checkbox_disabled_8eZbI),.Checkbox_native-input_8eZbI:active+.Checkbox_indeterminate_8eZbI:not(.Checkbox_disabled_8eZbI){color:var(--checkbox-checked-hover-color)}.Checkbox_native-input_8eZbI:active+.Checkbox_checkmark_8eZbI:not(.Checkbox_disabled_8eZbI),.Checkbox_native-input_8eZbI:active+.Checkbox_indeterminate_8eZbI:not(.Checkbox_disabled_8eZbI){color:var(--checkbox-checked-pressed-color)}.Checkbox_error-message_8eZbI{margin-top:.25rem;margin-left:calc(1.75 * var(--font-size));font-size:var(--font-size-sub)}.Checkbox_error-message_8eZbI [data-icon]{font-size:1rem}.Checkbox_input_8eZbI{font-size:var(--font-size-big);width:var(--font-size-big);height:var(--font-size-big);z-index:1;color:var(--checkbox-unchecked-color)}.Checkbox_disabled_8eZbI{cursor:not-allowed}.Checkbox_disabled_8eZbI+span{color:var(--disabled);pointer-events:none}.Checkbox_disabled_8eZbI+label{color:var(--greyed-out)}.Checkbox_disabled_8eZbI+.Checkbox_checkmark_8eZbI,.Checkbox_disabled_8eZbI+.Checkbox_indeterminate_8eZbI{color:var(--disabled);background-color:var(--greyed-out);border-radius:2px;outline:1px var(--disabled) solid;outline-offset:-1px}.Checkbox_indeterminate_8eZbI{color:var(--checkbox-checked-color)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI label{border-color:var(--read-only-border-color);color:var(--read-only-text-color);background-color:transparent;-webkit-user-select:text;user-select:text}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI span{color:var(--color-blue-grey100)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI span.Checkbox_checkmark_8eZbI{background-color:var(--color-blue-grey900);color:var(--color-white);border-radius:2px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI span.Checkbox_checkmark_8eZbI:before{outline:1px solid var(--read-only-border-color);border-radius:2px;outline-offset:-1px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI input[type=checkbox]{pointer-events:none}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span:before{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_8eZbI{background-color:var(--color-blue-grey900);color:var(--color-white);border:1px solid var(--read-only-border-color);border-radius:3px}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_8eZbI:before{color:var(--color-white)}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span[data-icon=true]{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_8eZbI{background-color:var(--color-blue-grey900);color:var(--color-white);border:0}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_8eZbI:before{outline:1px solid var(--read-only-border-color);outline-offset:-1px;border-radius:2px}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~label{pointer-events:none;-webkit-user-select:text;user-select:text}.Checkbox_required_8eZbI:after{content:" *";color:var(--error)}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}}();
2
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="Checkbox_disabled_8eZbI",r="Checkbox_error_8eZbI",o="Checkbox_square_8eZbI",b="Checkbox_checkmark_8eZbI",c="Checkbox_indeterminate_8eZbI",t="Checkbox_input_8eZbI",i="Checkbox_required_8eZbI",x={"checkbox-wrapper":"Checkbox_checkbox-wrapper_8eZbI","checkbox-container":"Checkbox_checkbox-container_8eZbI","checkbox-list":"Checkbox_checkbox-list_8eZbI","native-input":"Checkbox_native-input_8eZbI",disabled:e,error:r,square:o,checkmark:b,indeterminate:c,"error-message":"Checkbox_error-message_8eZbI",input:t,required:i};exports.checkmark=b,exports.default=x,exports.disabled=e,exports.error=r,exports.indeterminate=c,exports.input=t,exports.required=i,exports.square=o;
3
3
  //# sourceMappingURL=Checkbox.module.scss.cjs.js.map
@@ -1,22 +1,22 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.Checkbox_sr-only_gLrTA{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.Checkbox_hidden_gLrTA{display:none}.Checkbox_slide-in_gLrTA{animation:Checkbox_slide-in_gLrTA .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-in_gLrTA{animation-duration:.1ms}}.Checkbox_slide-out_gLrTA{animation:Checkbox_slide-out_gLrTA .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-out_gLrTA{animation-duration:.1ms}}@keyframes Checkbox_slide-in_gLrTA{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes Checkbox_slide-out_gLrTA{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Checkbox_checkbox-wrapper_gLrTA{position:relative}.Checkbox_checkbox-wrapper_gLrTA+.Checkbox_checkbox-wrapper_gLrTA{margin-top:.75rem}.Checkbox_checkbox-container_gLrTA{display:flex}.Checkbox_checkbox-container_gLrTA label{display:inline-block;margin-left:calc(.5 * var(--font-size));-webkit-user-select:none;user-select:none;font-size:var(--font-size-form-label);font-family:var(--font-family);margin-top:.1rem}.Checkbox_checkbox-list_gLrTA{padding:0;margin:1rem 0 0 1.75rem;list-style:none}.Checkbox_checkbox-list_gLrTA li+li{margin-top:.75rem}.Checkbox_native-input_gLrTA{position:absolute;top:0;left:0;opacity:0;margin:0;width:var(--font-size-big);height:var(--font-size-big);z-index:2}.Checkbox_native-input_gLrTA:checked:not(.Checkbox_disabled_gLrTA)+*{color:var(--checkbox-checked-color)}.Checkbox_native-input_gLrTA:focus-visible+*{border-radius:2px;outline:2px solid var(--color-focus);outline-offset:2px}.Checkbox_native-input_gLrTA:active:not(.Checkbox_disabled_gLrTA)+span{background-color:var(--disabled)}.Checkbox_native-input_gLrTA.Checkbox_error_gLrTA:focus-visible+*{outline-color:var(--color-error)}.Checkbox_native-input_gLrTA+span[data-icon=true]:before{display:block;width:var(--font-size-big);height:var(--font-size-big)}.Checkbox_native-input_gLrTA:hover+.Checkbox_square_gLrTA:not(.Checkbox_disabled_gLrTA){background-color:var(--checkbox-unchecked-hover-color)}.Checkbox_native-input_gLrTA:active+.Checkbox_square_gLrTA:not(.Checkbox_disabled_gLrTA){background-color:var(--checkbox-unchecked-pressed-color)}.Checkbox_native-input_gLrTA:hover+.Checkbox_checkmark_gLrTA:not(.Checkbox_disabled_gLrTA),.Checkbox_native-input_gLrTA:active+.Checkbox_indeterminate_gLrTA:not(.Checkbox_disabled_gLrTA){color:var(--checkbox-checked-hover-color)}.Checkbox_native-input_gLrTA:active+.Checkbox_checkmark_gLrTA:not(.Checkbox_disabled_gLrTA),.Checkbox_native-input_gLrTA:active+.Checkbox_indeterminate_gLrTA:not(.Checkbox_disabled_gLrTA){color:var(--checkbox-checked-pressed-color)}.Checkbox_error-message_gLrTA{margin-top:.25rem;margin-left:calc(1.75 * var(--font-size));font-size:var(--font-size-sub)}.Checkbox_input_gLrTA{font-size:var(--font-size-big);width:var(--font-size-big);height:var(--font-size-big);z-index:1;color:var(--checkbox-unchecked-color)}.Checkbox_disabled_gLrTA{cursor:not-allowed}.Checkbox_disabled_gLrTA+span{color:var(--disabled);pointer-events:none}.Checkbox_disabled_gLrTA+label{color:var(--greyed-out)}.Checkbox_disabled_gLrTA+.Checkbox_checkmark_gLrTA,.Checkbox_disabled_gLrTA+.Checkbox_indeterminate_gLrTA{color:var(--disabled);background-color:var(--greyed-out);border-radius:2px;outline:1px var(--disabled) solid;outline-offset:-1px}.Checkbox_indeterminate_gLrTA{color:var(--checkbox-checked-color)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA label{border-color:var(--read-only-border-color);color:var(--read-only-text-color);background-color:transparent;-webkit-user-select:text;user-select:text}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA span{color:var(--color-blue-grey100)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA span.Checkbox_checkmark_gLrTA{background-color:var(--color-blue-grey900);color:var(--color-white);border-radius:2px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA span.Checkbox_checkmark_gLrTA:before{outline:1px solid var(--read-only-border-color);border-radius:2px;outline-offset:-1px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_gLrTA input[type=checkbox]{pointer-events:none}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span:before{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_gLrTA{background-color:var(--color-blue-grey900);color:var(--color-white);border:1px solid var(--read-only-border-color);border-radius:3px}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_gLrTA:before{color:var(--color-white)}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span[data-icon=true]{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_gLrTA{background-color:var(--color-blue-grey900);color:var(--color-white);border:0}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_gLrTA:before{outline:1px solid var(--read-only-border-color);outline-offset:-1px;border-radius:2px}.Checkbox_checkbox-container_gLrTA input[type=checkbox][data-readonlyview=true]~label{pointer-events:none;-webkit-user-select:text;user-select:text}.Checkbox_required_gLrTA:after{content:" *";color:var(--error)}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}}();
2
- const disabled = "Checkbox_disabled_gLrTA";
3
- const error = "Checkbox_error_gLrTA";
4
- const square = "Checkbox_square_gLrTA";
5
- const checkmark = "Checkbox_checkmark_gLrTA";
6
- const indeterminate = "Checkbox_indeterminate_gLrTA";
7
- const input = "Checkbox_input_gLrTA";
8
- const required = "Checkbox_required_gLrTA";
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.Checkbox_sr-only_8eZbI{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.Checkbox_hidden_8eZbI{display:none}.Checkbox_slide-in_8eZbI{animation:Checkbox_slide-in_8eZbI .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-in_8eZbI{animation-duration:.1ms}}.Checkbox_slide-out_8eZbI{animation:Checkbox_slide-out_8eZbI .5s forwards}@media(prefers-reduced-motion:reduce){.Checkbox_slide-out_8eZbI{animation-duration:.1ms}}@keyframes Checkbox_slide-in_8eZbI{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes Checkbox_slide-out_8eZbI{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Checkbox_checkbox-wrapper_8eZbI{position:relative}.Checkbox_checkbox-wrapper_8eZbI+.Checkbox_checkbox-wrapper_8eZbI{margin-top:.75rem}.Checkbox_checkbox-container_8eZbI{display:flex}.Checkbox_checkbox-container_8eZbI label{display:inline-block;margin-left:calc(.5 * var(--font-size));-webkit-user-select:none;user-select:none;font-size:var(--font-size-form-label);font-family:var(--font-family);margin-top:.1rem}.Checkbox_checkbox-list_8eZbI{padding:0;margin:.75rem 0 0 1.75rem;list-style:none}.Checkbox_checkbox-list_8eZbI li+li{margin-top:.75rem}.Checkbox_native-input_8eZbI{position:absolute;top:0;left:0;opacity:0;margin:0;width:var(--font-size-big);height:var(--font-size-big);z-index:2}.Checkbox_native-input_8eZbI:checked:not(.Checkbox_disabled_8eZbI)+*{color:var(--checkbox-checked-color)}.Checkbox_native-input_8eZbI:focus-visible+*{border-radius:2px;outline:2px solid var(--color-focus);outline-offset:2px}.Checkbox_native-input_8eZbI:active:not(.Checkbox_disabled_8eZbI)+span{background-color:var(--disabled)}.Checkbox_native-input_8eZbI.Checkbox_error_8eZbI:focus-visible+*{outline-color:var(--color-error)}.Checkbox_native-input_8eZbI+span[data-icon=true]:before{display:block;width:var(--font-size-big);height:var(--font-size-big)}.Checkbox_native-input_8eZbI:hover+.Checkbox_square_8eZbI:not(.Checkbox_disabled_8eZbI){background-color:var(--checkbox-unchecked-hover-color)}.Checkbox_native-input_8eZbI:active+.Checkbox_square_8eZbI:not(.Checkbox_disabled_8eZbI){background-color:var(--checkbox-unchecked-pressed-color)}.Checkbox_native-input_8eZbI:hover+.Checkbox_checkmark_8eZbI:not(.Checkbox_disabled_8eZbI),.Checkbox_native-input_8eZbI:active+.Checkbox_indeterminate_8eZbI:not(.Checkbox_disabled_8eZbI){color:var(--checkbox-checked-hover-color)}.Checkbox_native-input_8eZbI:active+.Checkbox_checkmark_8eZbI:not(.Checkbox_disabled_8eZbI),.Checkbox_native-input_8eZbI:active+.Checkbox_indeterminate_8eZbI:not(.Checkbox_disabled_8eZbI){color:var(--checkbox-checked-pressed-color)}.Checkbox_error-message_8eZbI{margin-top:.25rem;margin-left:calc(1.75 * var(--font-size));font-size:var(--font-size-sub)}.Checkbox_error-message_8eZbI [data-icon]{font-size:1rem}.Checkbox_input_8eZbI{font-size:var(--font-size-big);width:var(--font-size-big);height:var(--font-size-big);z-index:1;color:var(--checkbox-unchecked-color)}.Checkbox_disabled_8eZbI{cursor:not-allowed}.Checkbox_disabled_8eZbI+span{color:var(--disabled);pointer-events:none}.Checkbox_disabled_8eZbI+label{color:var(--greyed-out)}.Checkbox_disabled_8eZbI+.Checkbox_checkmark_8eZbI,.Checkbox_disabled_8eZbI+.Checkbox_indeterminate_8eZbI{color:var(--disabled);background-color:var(--greyed-out);border-radius:2px;outline:1px var(--disabled) solid;outline-offset:-1px}.Checkbox_indeterminate_8eZbI{color:var(--checkbox-checked-color)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI label{border-color:var(--read-only-border-color);color:var(--read-only-text-color);background-color:transparent;-webkit-user-select:text;user-select:text}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI span{color:var(--color-blue-grey100)}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI span.Checkbox_checkmark_8eZbI{background-color:var(--color-blue-grey900);color:var(--color-white);border-radius:2px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI span.Checkbox_checkmark_8eZbI:before{outline:1px solid var(--read-only-border-color);border-radius:2px;outline-offset:-1px}[data-readonlyview=true] .Checkbox_checkbox-wrapper_8eZbI input[type=checkbox]{pointer-events:none}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span:before{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_8eZbI{background-color:var(--color-blue-grey900);color:var(--color-white);border:1px solid var(--read-only-border-color);border-radius:3px}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span.Checkbox_checkmark_8eZbI:before{color:var(--color-white)}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span[data-icon=true]{color:var(--color-blue-grey100)}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_8eZbI{background-color:var(--color-blue-grey900);color:var(--color-white);border:0}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~span[data-icon=true].Checkbox_checkmark_8eZbI:before{outline:1px solid var(--read-only-border-color);outline-offset:-1px;border-radius:2px}.Checkbox_checkbox-container_8eZbI input[type=checkbox][data-readonlyview=true]~label{pointer-events:none;-webkit-user-select:text;user-select:text}.Checkbox_required_8eZbI:after{content:" *";color:var(--error)}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}}();
2
+ const disabled = "Checkbox_disabled_8eZbI";
3
+ const error = "Checkbox_error_8eZbI";
4
+ const square = "Checkbox_square_8eZbI";
5
+ const checkmark = "Checkbox_checkmark_8eZbI";
6
+ const indeterminate = "Checkbox_indeterminate_8eZbI";
7
+ const input = "Checkbox_input_8eZbI";
8
+ const required = "Checkbox_required_8eZbI";
9
9
  const classes = {
10
- "checkbox-wrapper": "Checkbox_checkbox-wrapper_gLrTA",
11
- "checkbox-container": "Checkbox_checkbox-container_gLrTA",
12
- "checkbox-list": "Checkbox_checkbox-list_gLrTA",
13
- "native-input": "Checkbox_native-input_gLrTA",
10
+ "checkbox-wrapper": "Checkbox_checkbox-wrapper_8eZbI",
11
+ "checkbox-container": "Checkbox_checkbox-container_8eZbI",
12
+ "checkbox-list": "Checkbox_checkbox-list_8eZbI",
13
+ "native-input": "Checkbox_native-input_8eZbI",
14
14
  disabled,
15
15
  error,
16
16
  square,
17
17
  checkmark,
18
18
  indeterminate,
19
- "error-message": "Checkbox_error-message_gLrTA",
19
+ "error-message": "Checkbox_error-message_8eZbI",
20
20
  input,
21
21
  required
22
22
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("../../../readyclasses.module.scss.cjs.js"),a=require("./Fieldset.module.scss.cjs.js"),s=require("../../Typography/Typography.cjs.js"),t=require("../Input/Input.cjs.js"),l=require("../Select/SingleSelect/Select.cjs.js"),c=require("../Select/MultiSelect/MultiSelect.cjs.js"),o=require("../Radio/Radio.cjs.js"),p=require("../Checkbox/Checkbox.cjs.js"),i=require("../Textarea/Textarea.cjs.js"),d=require("../Toggle/Toggle.cjs.js"),u=require("../Label/Label.cjs.js"),n=require("../FormControl/FormControl.cjs.js"),j=require("../FormSelectorWrapper/FormSelectorWrapper.cjs.js"),g=require("../FormHelperText/FormHelperText.cjs.js"),m=require("../Wrapper/InputWrapper/InputWrapper.cjs.js"),q=require("../Wrapper/SelectWrapper/SelectWrapper.cjs.js"),S=require("../Wrapper/TextareaWrapper/TextareaWrapper.cjs.js"),y=require("../../withReadOnly.cjs.js").withReadOnly(e.forwardRef(({children:y,className:b,legend:T,legendStyle:W="body",hideLegend:x=!1,noBackground:F,background:f=(F?"":"#FFF"),noPadding:h=!1,disabled:C=!1,required:k=!1,disablePropagation:I=!1,...R},$)=>e.createElement("fieldset",{...R,ref:$,disabled:C,style:{backgroundColor:f,...R.style},className:`${a.default.fieldset} ${h?a.default["no-padding"]:""} ${b??""}`},T&&e.createElement("legend",{className:r.default["sr-only"]},T),T&&!x&&e.createElement(s.Typography,{variant:W,tag:"span","aria-hidden":"true",className:`${a.default.legend} ${k?a.default.required:""}`},T),(()=>{if(!y)return;const r=[t.Input,l.Select,c.MultiSelect,o.Radio,p.Checkbox,i.Textarea,d.Toggle,u.Label,n.FormControl,j.FormSelectorWrapper,g.FormHelperText,m.InputWrapper,q.SelectWrapper,S.TextareaWrapper];return e.Children.map(y,a=>r.includes(a.type)&&!I?e.cloneElement(a,{disabled:a.props.disabled??C}):a)})())));exports.Fieldset=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("../../../readyclasses.module.scss.cjs.js"),a=require("./Fieldset.module.scss.cjs.js"),l=require("../../Typography/Typography.cjs.js"),s=require("../Input/Input.cjs.js"),t=require("../Select/SingleSelect/Select.cjs.js"),c=require("../Select/MultiSelect/MultiSelect.cjs.js"),i=require("../Radio/Radio.cjs.js"),o=require("../Checkbox/Checkbox.cjs.js"),p=require("../Textarea/Textarea.cjs.js"),d=require("../Toggle/Toggle.cjs.js"),u=require("../Label/Label.cjs.js"),n=require("../FormControl/FormControl.cjs.js"),j=require("../FormSelectorWrapper/FormSelectorWrapper.cjs.js"),g=require("../FormHelperText/FormHelperText.cjs.js"),m=require("../Wrapper/InputWrapper/InputWrapper.cjs.js"),q=require("../Wrapper/SelectWrapper/SelectWrapper.cjs.js"),S=require("../Wrapper/TextareaWrapper/TextareaWrapper.cjs.js"),y=require("../../withReadOnly.cjs.js").withReadOnly(e.forwardRef(({children:y,className:b,legend:T,legendStyle:f="body",hideLegend:W=!1,noBackground:h,background:x=(h?"":"#FFF"),noPadding:F=!1,disabled:C=!1,required:k=!1,flushLegend:I=!1,disablePropagation:R=!1,...$},E)=>e.createElement("fieldset",{...$,ref:E,disabled:C,style:{backgroundColor:x,...$.style},className:`${a.default.fieldset} ${F?a.default["no-padding"]:""} ${b??""}`},T&&e.createElement("legend",{className:r.default["sr-only"]},T),T&&!W&&e.createElement(l.Typography,{variant:f,tag:"span","aria-hidden":"true",className:`${a.default.legend} ${k?a.default.required:""} ${I?a.default.flush:""}`},T),(()=>{if(!y)return;const r=[s.Input,t.Select,c.MultiSelect,i.Radio,o.Checkbox,p.Textarea,d.Toggle,u.Label,n.FormControl,j.FormSelectorWrapper,g.FormHelperText,m.InputWrapper,q.SelectWrapper,S.TextareaWrapper];return e.Children.map(y,a=>e.isValidElement(a)&&r.includes(a.type)&&!R?e.cloneElement(a,{disabled:a.props.disabled??C}):a)})())));exports.Fieldset=y;
2
2
  //# sourceMappingURL=Fieldset.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.cjs.js","sources":["../../../../src/components/Form/Fieldset/Fieldset.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactElement } from \"react\";\nimport readyclasses from \"../../../readyclasses.module.scss\";\nimport classes from \"./Fieldset.module.scss\";\nimport { Typography, Variant } from \"../../Typography/Typography\";\nimport { Input } from \"../Input/Input\";\nimport { Select } from \"../Select/SingleSelect/Select\";\nimport { MultiSelect } from \"../Select/MultiSelect/MultiSelect\";\nimport { Radio } from \"../Radio/Radio\";\nimport { Checkbox } from \"../Checkbox/Checkbox\";\nimport { Textarea } from \"../Textarea/Textarea\";\nimport { Toggle } from \"../Toggle/Toggle\";\nimport { Label } from \"../Label/Label\";\nimport { FormControl } from \"../FormControl/FormControl\";\nimport { FormSelectorWrapper } from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormHelperText } from \"../FormHelperText/FormHelperText\";\nimport { InputWrapper } from \"../Wrapper/InputWrapper/InputWrapper\";\nimport { SelectWrapper } from \"../Wrapper/SelectWrapper/SelectWrapper\";\nimport { TextareaWrapper } from \"../Wrapper/TextareaWrapper/TextareaWrapper\";\nimport { withReadOnly } from \"../../withReadOnly\";\n\nexport interface Props extends ComponentPropsWithRef<\"fieldset\"> {\n children?: ReactElement | ReactElement[];\n legend: string;\n legendStyle?: Variant;\n hideLegend?: boolean;\n background?: string;\n noPadding?: boolean;\n noBackground?: boolean;\n required?: boolean;\n disablePropagation?: boolean;\n}\n\nconst FieldsetComponent: ForwardRefRenderFunction<HTMLFieldSetElement, Props> = (\n {\n children,\n className,\n legend,\n legendStyle = \"body\",\n hideLegend = false,\n noBackground,\n background = noBackground ? \"\" : \"#FFF\",\n noPadding = false,\n disabled = false,\n required = false,\n disablePropagation = false,\n ...rest\n }: Props,\n ref\n) => {\n const renderChildren = () => {\n if (!children) {\n return;\n }\n\n /* All right, so the issue is that whenever we try to add disabled prop to a component that doesn't accept it,\n React will throw an error. However, it might occur that we want a component inside Fieldset because of aesthetic purposes\n (fieldset applies a sort of container with white background and if we want to display it inside of this container... then yea).\n So instead we supply an array of components that we want to add the disabled prop to and check if child.type equals one of these. */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n const allowedComponents: React.ComponentPropsWithRef<any>[] = [\n Input,\n Select,\n MultiSelect,\n Radio,\n Checkbox,\n Textarea,\n Toggle,\n Label,\n FormControl,\n FormSelectorWrapper,\n FormHelperText,\n InputWrapper,\n SelectWrapper,\n TextareaWrapper\n ];\n\n return React.Children.map(children, (child: ReactElement) => {\n if (allowedComponents.includes(child.type) && !disablePropagation) {\n return React.cloneElement(child, {\n disabled: child.props.disabled ?? disabled\n });\n }\n\n return child;\n });\n };\n\n return (\n <fieldset\n {...rest}\n ref={ref}\n disabled={disabled}\n style={{ backgroundColor: background, ...rest.style }}\n className={`${classes.fieldset} ${noPadding ? classes[\"no-padding\"] : \"\"} ${className ?? \"\"}`}\n >\n {legend && <legend className={readyclasses[\"sr-only\"]}>{legend}</legend>}\n {legend && !hideLegend && (\n <Typography\n variant={legendStyle}\n tag=\"span\"\n aria-hidden=\"true\"\n className={`${classes[\"legend\"]} ${required ? classes[\"required\"] : \"\"}`}\n >\n {legend}\n </Typography>\n )}\n {renderChildren()}\n </fieldset>\n );\n};\n\nexport const Fieldset = withReadOnly(React.forwardRef(FieldsetComponent));\n"],"names":["Fieldset","withReadOnly","React","forwardRef","children","className","legend","legendStyle","hideLegend","noBackground","background","noPadding","disabled","required","disablePropagation","rest","ref","createElement","style","backgroundColor","classes","fieldset","readyclasses","Typography","variant","tag","allowedComponents","Input","Select","MultiSelect","Radio","Checkbox","Textarea","Toggle","Label","FormControl","FormSelectorWrapper","FormHelperText","InputWrapper","SelectWrapper","TextareaWrapper","Children","map","child","includes","type","cloneElement","props","renderChildren"],"mappings":"w5BA+HaA,uCAAWC,aAAaC,EAAMC,WA/EqC,EAE5EC,WACAC,YACAC,SACAC,cAAc,OACdC,cAAa,EACbC,eACAC,cAAaD,EAAe,GAAK,QACjCE,aAAY,EACZC,YAAW,EACXC,YAAW,EACXC,sBAAqB,KAClBC,GAELC,IAyCEd,EAAAe,cAAC,WAAA,IACKF,EACJC,MACAJ,WACAM,MAAO,CAAEC,gBAAiBT,KAAeK,EAAKG,OAC9Cb,UAAW,GAAGe,EAAAA,QAAQC,YAAYV,EAAYS,UAAQ,cAAgB,MAAMf,GAAa,MAExFC,GAAUJ,EAAAe,cAAC,SAAA,CAAOZ,UAAWiB,UAAa,YAAahB,GACvDA,IAAWE,GACVN,EAAAe,cAACM,EAAAA,WAAA,CACCC,QAASjB,EACTkB,IAAI,OACJ,cAAY,OACZpB,UAAW,GAAGe,EAAAA,QAAgB,UAAKP,EAAWO,EAAAA,QAAkB,SAAI,MAEnEd,GAtDc,MACrB,IAAKF,EACH,OAQF,MAAMsB,EAAwD,CAC5DC,EAAAA,MACAC,EAAAA,OACAC,EAAAA,YACAC,EAAAA,MACAC,EAAAA,SACAC,EAAAA,SACAC,EAAAA,OACAC,EAAAA,MACAC,EAAAA,YACAC,EAAAA,oBACAC,EAAAA,eACAC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,iBAGF,OAAOtC,EAAMuC,SAASC,IAAItC,EAAWuC,GAC/BjB,EAAkBkB,SAASD,EAAME,QAAU/B,EACtCZ,EAAM4C,aAAaH,EAAO,CAC/B/B,SAAU+B,EAAMI,MAAMnC,UAAYA,IAI/B+B,IAuBNK"}
1
+ {"version":3,"file":"Fieldset.cjs.js","sources":["../../../../src/components/Form/Fieldset/Fieldset.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactElement } from \"react\";\nimport readyclasses from \"../../../readyclasses.module.scss\";\nimport classes from \"./Fieldset.module.scss\";\nimport { Typography, Variant } from \"../../Typography/Typography\";\nimport { Input } from \"../Input/Input\";\nimport { Select } from \"../Select/SingleSelect/Select\";\nimport { MultiSelect } from \"../Select/MultiSelect/MultiSelect\";\nimport { Radio } from \"../Radio/Radio\";\nimport { Checkbox } from \"../Checkbox/Checkbox\";\nimport { Textarea } from \"../Textarea/Textarea\";\nimport { Toggle } from \"../Toggle/Toggle\";\nimport { Label } from \"../Label/Label\";\nimport { FormControl } from \"../FormControl/FormControl\";\nimport { FormSelectorWrapper } from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormHelperText } from \"../FormHelperText/FormHelperText\";\nimport { InputWrapper } from \"../Wrapper/InputWrapper/InputWrapper\";\nimport { SelectWrapper } from \"../Wrapper/SelectWrapper/SelectWrapper\";\nimport { TextareaWrapper } from \"../Wrapper/TextareaWrapper/TextareaWrapper\";\nimport { withReadOnly } from \"../../withReadOnly\";\n\nexport interface Props extends ComponentPropsWithRef<\"fieldset\"> {\n children?: ReactElement | ReactElement[];\n legend: string;\n legendStyle?: Variant;\n hideLegend?: boolean;\n background?: string;\n noPadding?: boolean;\n noBackground?: boolean;\n required?: boolean;\n flushLegend?: boolean;\n disablePropagation?: boolean;\n}\n\nconst FieldsetComponent: ForwardRefRenderFunction<HTMLFieldSetElement, Props> = (\n {\n children,\n className,\n legend,\n legendStyle = \"body\",\n hideLegend = false,\n noBackground,\n background = noBackground ? \"\" : \"#FFF\",\n noPadding = false,\n disabled = false,\n required = false,\n flushLegend = false,\n disablePropagation = false,\n ...rest\n }: Props,\n ref\n) => {\n const renderChildren = () => {\n if (!children) {\n return;\n }\n\n /* All right, so the issue is that whenever we try to add disabled prop to a component that doesn't accept it,\n React will throw an error. However, it might occur that we want a component inside Fieldset because of aesthetic purposes\n (fieldset applies a sort of container with white background and if we want to display it inside of this container... then yea).\n So instead we supply an array of components that we want to add the disabled prop to and check if child.type equals one of these. */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n const allowedComponents: React.ComponentPropsWithRef<any>[] = [\n Input,\n Select,\n MultiSelect,\n Radio,\n Checkbox,\n Textarea,\n Toggle,\n Label,\n FormControl,\n FormSelectorWrapper,\n FormHelperText,\n InputWrapper,\n SelectWrapper,\n TextareaWrapper\n ];\n\n return React.Children.map(children, child => {\n if (\n React.isValidElement<{ disabled?: boolean }>(child) &&\n allowedComponents.includes(child.type) &&\n !disablePropagation\n ) {\n return React.cloneElement(child, {\n disabled: child.props.disabled ?? disabled\n });\n }\n\n return child;\n });\n };\n\n return (\n <fieldset\n {...rest}\n ref={ref}\n disabled={disabled}\n style={{ backgroundColor: background, ...rest.style }}\n className={`${classes.fieldset} ${noPadding ? classes[\"no-padding\"] : \"\"} ${className ?? \"\"}`}\n >\n {legend && <legend className={readyclasses[\"sr-only\"]}>{legend}</legend>}\n {legend && !hideLegend && (\n <Typography\n variant={legendStyle}\n tag=\"span\"\n aria-hidden=\"true\"\n className={`${classes[\"legend\"]} ${required ? classes[\"required\"] : \"\"} ${\n flushLegend ? classes[\"flush\"] : \"\"\n }`}\n >\n {legend}\n </Typography>\n )}\n {renderChildren()}\n </fieldset>\n );\n};\n\nexport const Fieldset = withReadOnly(React.forwardRef(FieldsetComponent));\n"],"names":["Fieldset","withReadOnly","React","forwardRef","children","className","legend","legendStyle","hideLegend","noBackground","background","noPadding","disabled","required","flushLegend","disablePropagation","rest","ref","createElement","style","backgroundColor","classes","fieldset","readyclasses","Typography","variant","tag","allowedComponents","Input","Select","MultiSelect","Radio","Checkbox","Textarea","Toggle","Label","FormControl","FormSelectorWrapper","FormHelperText","InputWrapper","SelectWrapper","TextareaWrapper","Children","map","child","isValidElement","includes","type","cloneElement","props","renderChildren"],"mappings":"w5BAuIaA,uCAAWC,aAAaC,EAAMC,WAtFqC,EAE5EC,WACAC,YACAC,SACAC,cAAc,OACdC,cAAa,EACbC,eACAC,cAAaD,EAAe,GAAK,QACjCE,aAAY,EACZC,YAAW,EACXC,YAAW,EACXC,eAAc,EACdC,sBAAqB,KAClBC,GAELC,IA6CEf,EAAAgB,cAAC,WAAA,IACKF,EACJC,MACAL,WACAO,MAAO,CAAEC,gBAAiBV,KAAeM,EAAKG,OAC9Cd,UAAW,GAAGgB,EAAAA,QAAQC,YAAYX,EAAYU,UAAQ,cAAgB,MAAMhB,GAAa,MAExFC,GAAUJ,EAAAgB,cAAC,SAAA,CAAOb,UAAWkB,UAAa,YAAajB,GACvDA,IAAWE,GACVN,EAAAgB,cAACM,EAAAA,WAAA,CACCC,QAASlB,EACTmB,IAAI,OACJ,cAAY,OACZrB,UAAW,GAAGgB,EAAAA,QAAgB,UAAKR,EAAWQ,EAAAA,QAAkB,SAAI,MAClEP,EAAcO,EAAAA,QAAe,MAAI,MAGlCf,GA5Dc,MACrB,IAAKF,EACH,OAQF,MAAMuB,EAAwD,CAC5DC,EAAAA,MACAC,EAAAA,OACAC,EAAAA,YACAC,EAAAA,MACAC,EAAAA,SACAC,EAAAA,SACAC,EAAAA,OACAC,EAAAA,MACAC,EAAAA,YACAC,EAAAA,oBACAC,EAAAA,eACAC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,iBAGF,OAAOvC,EAAMwC,SAASC,IAAIvC,EAAUwC,GAEhC1C,EAAM2C,eAAuCD,IAC7CjB,EAAkBmB,SAASF,EAAMG,QAChChC,EAEMb,EAAM8C,aAAaJ,EAAO,CAC/BhC,SAAUgC,EAAMK,MAAMrC,UAAYA,IAI/BgC,IAyBNM"}
@@ -28,6 +28,7 @@ const FieldsetComponent = ({
28
28
  noPadding = false,
29
29
  disabled = false,
30
30
  required = false,
31
+ flushLegend = false,
31
32
  disablePropagation = false,
32
33
  ...rest
33
34
  }, ref) => {
@@ -52,7 +53,7 @@ const FieldsetComponent = ({
52
53
  TextareaWrapper
53
54
  ];
54
55
  return React.Children.map(children, (child) => {
55
- if (allowedComponents.includes(child.type) && !disablePropagation) {
56
+ if (React.isValidElement(child) && allowedComponents.includes(child.type) && !disablePropagation) {
56
57
  return React.cloneElement(child, {
57
58
  disabled: child.props.disabled ?? disabled
58
59
  });
@@ -76,7 +77,7 @@ const FieldsetComponent = ({
76
77
  variant: legendStyle,
77
78
  tag: "span",
78
79
  "aria-hidden": "true",
79
- className: `${classes["legend"]} ${required ? classes["required"] : ""}`
80
+ className: `${classes["legend"]} ${required ? classes["required"] : ""} ${flushLegend ? classes["flush"] : ""}`
80
81
  },
81
82
  legend
82
83
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.es.js","sources":["../../../../src/components/Form/Fieldset/Fieldset.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactElement } from \"react\";\nimport readyclasses from \"../../../readyclasses.module.scss\";\nimport classes from \"./Fieldset.module.scss\";\nimport { Typography, Variant } from \"../../Typography/Typography\";\nimport { Input } from \"../Input/Input\";\nimport { Select } from \"../Select/SingleSelect/Select\";\nimport { MultiSelect } from \"../Select/MultiSelect/MultiSelect\";\nimport { Radio } from \"../Radio/Radio\";\nimport { Checkbox } from \"../Checkbox/Checkbox\";\nimport { Textarea } from \"../Textarea/Textarea\";\nimport { Toggle } from \"../Toggle/Toggle\";\nimport { Label } from \"../Label/Label\";\nimport { FormControl } from \"../FormControl/FormControl\";\nimport { FormSelectorWrapper } from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormHelperText } from \"../FormHelperText/FormHelperText\";\nimport { InputWrapper } from \"../Wrapper/InputWrapper/InputWrapper\";\nimport { SelectWrapper } from \"../Wrapper/SelectWrapper/SelectWrapper\";\nimport { TextareaWrapper } from \"../Wrapper/TextareaWrapper/TextareaWrapper\";\nimport { withReadOnly } from \"../../withReadOnly\";\n\nexport interface Props extends ComponentPropsWithRef<\"fieldset\"> {\n children?: ReactElement | ReactElement[];\n legend: string;\n legendStyle?: Variant;\n hideLegend?: boolean;\n background?: string;\n noPadding?: boolean;\n noBackground?: boolean;\n required?: boolean;\n disablePropagation?: boolean;\n}\n\nconst FieldsetComponent: ForwardRefRenderFunction<HTMLFieldSetElement, Props> = (\n {\n children,\n className,\n legend,\n legendStyle = \"body\",\n hideLegend = false,\n noBackground,\n background = noBackground ? \"\" : \"#FFF\",\n noPadding = false,\n disabled = false,\n required = false,\n disablePropagation = false,\n ...rest\n }: Props,\n ref\n) => {\n const renderChildren = () => {\n if (!children) {\n return;\n }\n\n /* All right, so the issue is that whenever we try to add disabled prop to a component that doesn't accept it,\n React will throw an error. However, it might occur that we want a component inside Fieldset because of aesthetic purposes\n (fieldset applies a sort of container with white background and if we want to display it inside of this container... then yea).\n So instead we supply an array of components that we want to add the disabled prop to and check if child.type equals one of these. */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n const allowedComponents: React.ComponentPropsWithRef<any>[] = [\n Input,\n Select,\n MultiSelect,\n Radio,\n Checkbox,\n Textarea,\n Toggle,\n Label,\n FormControl,\n FormSelectorWrapper,\n FormHelperText,\n InputWrapper,\n SelectWrapper,\n TextareaWrapper\n ];\n\n return React.Children.map(children, (child: ReactElement) => {\n if (allowedComponents.includes(child.type) && !disablePropagation) {\n return React.cloneElement(child, {\n disabled: child.props.disabled ?? disabled\n });\n }\n\n return child;\n });\n };\n\n return (\n <fieldset\n {...rest}\n ref={ref}\n disabled={disabled}\n style={{ backgroundColor: background, ...rest.style }}\n className={`${classes.fieldset} ${noPadding ? classes[\"no-padding\"] : \"\"} ${className ?? \"\"}`}\n >\n {legend && <legend className={readyclasses[\"sr-only\"]}>{legend}</legend>}\n {legend && !hideLegend && (\n <Typography\n variant={legendStyle}\n tag=\"span\"\n aria-hidden=\"true\"\n className={`${classes[\"legend\"]} ${required ? classes[\"required\"] : \"\"}`}\n >\n {legend}\n </Typography>\n )}\n {renderChildren()}\n </fieldset>\n );\n};\n\nexport const Fieldset = withReadOnly(React.forwardRef(FieldsetComponent));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAgDA,MAAM,oBAA0E,CAC9E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb;AAAA,EACA,aAAa,eAAe,KAAK;AAAA,EACjC,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,qBAAqB;AAAA,EACrB,GAAG;AACL,GACA,QACG;AACH,QAAM,iBAAiB,MAAM;AAC3B,QAAI,CAAC,UAAU;AACb;AAAA,IACF;AAOA,UAAM,oBAAwD;AAAA,MAC5D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,WAAO,MAAM,SAAS,IAAI,UAAU,CAAC,UAAwB;AAC3D,UAAI,kBAAkB,SAAS,MAAM,IAAI,KAAK,CAAC,oBAAoB;AACjE,eAAO,MAAM,aAAa,OAAO;AAAA,UAC/B,UAAU,MAAM,MAAM,YAAY;AAAA,QAAA,CACnC;AAAA,MACH;AAEA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SACE,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,OAAO,EAAE,iBAAiB,YAAY,GAAG,KAAK,MAAA;AAAA,MAC9C,WAAW,GAAG,QAAQ,QAAQ,IAAI,YAAY,QAAQ,YAAY,IAAI,EAAE,IAAI,aAAa,EAAE;AAAA,IAAA;AAAA,IAE1F,UAAU,sBAAA,cAAC,UAAA,EAAO,WAAW,aAAa,SAAS,KAAI,MAAO;AAAA,IAC9D,UAAU,CAAC,cACV,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,KAAI;AAAA,QACJ,eAAY;AAAA,QACZ,WAAW,GAAG,QAAQ,QAAQ,CAAC,IAAI,WAAW,QAAQ,UAAU,IAAI,EAAE;AAAA,MAAA;AAAA,MAErE;AAAA,IAAA;AAAA,IAGJ,eAAA;AAAA,EAAe;AAGtB;AAEO,MAAM,WAAW,aAAa,MAAM,WAAW,iBAAiB,CAAC;"}
1
+ {"version":3,"file":"Fieldset.es.js","sources":["../../../../src/components/Form/Fieldset/Fieldset.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactElement } from \"react\";\nimport readyclasses from \"../../../readyclasses.module.scss\";\nimport classes from \"./Fieldset.module.scss\";\nimport { Typography, Variant } from \"../../Typography/Typography\";\nimport { Input } from \"../Input/Input\";\nimport { Select } from \"../Select/SingleSelect/Select\";\nimport { MultiSelect } from \"../Select/MultiSelect/MultiSelect\";\nimport { Radio } from \"../Radio/Radio\";\nimport { Checkbox } from \"../Checkbox/Checkbox\";\nimport { Textarea } from \"../Textarea/Textarea\";\nimport { Toggle } from \"../Toggle/Toggle\";\nimport { Label } from \"../Label/Label\";\nimport { FormControl } from \"../FormControl/FormControl\";\nimport { FormSelectorWrapper } from \"../FormSelectorWrapper/FormSelectorWrapper\";\nimport { FormHelperText } from \"../FormHelperText/FormHelperText\";\nimport { InputWrapper } from \"../Wrapper/InputWrapper/InputWrapper\";\nimport { SelectWrapper } from \"../Wrapper/SelectWrapper/SelectWrapper\";\nimport { TextareaWrapper } from \"../Wrapper/TextareaWrapper/TextareaWrapper\";\nimport { withReadOnly } from \"../../withReadOnly\";\n\nexport interface Props extends ComponentPropsWithRef<\"fieldset\"> {\n children?: ReactElement | ReactElement[];\n legend: string;\n legendStyle?: Variant;\n hideLegend?: boolean;\n background?: string;\n noPadding?: boolean;\n noBackground?: boolean;\n required?: boolean;\n flushLegend?: boolean;\n disablePropagation?: boolean;\n}\n\nconst FieldsetComponent: ForwardRefRenderFunction<HTMLFieldSetElement, Props> = (\n {\n children,\n className,\n legend,\n legendStyle = \"body\",\n hideLegend = false,\n noBackground,\n background = noBackground ? \"\" : \"#FFF\",\n noPadding = false,\n disabled = false,\n required = false,\n flushLegend = false,\n disablePropagation = false,\n ...rest\n }: Props,\n ref\n) => {\n const renderChildren = () => {\n if (!children) {\n return;\n }\n\n /* All right, so the issue is that whenever we try to add disabled prop to a component that doesn't accept it,\n React will throw an error. However, it might occur that we want a component inside Fieldset because of aesthetic purposes\n (fieldset applies a sort of container with white background and if we want to display it inside of this container... then yea).\n So instead we supply an array of components that we want to add the disabled prop to and check if child.type equals one of these. */\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n const allowedComponents: React.ComponentPropsWithRef<any>[] = [\n Input,\n Select,\n MultiSelect,\n Radio,\n Checkbox,\n Textarea,\n Toggle,\n Label,\n FormControl,\n FormSelectorWrapper,\n FormHelperText,\n InputWrapper,\n SelectWrapper,\n TextareaWrapper\n ];\n\n return React.Children.map(children, child => {\n if (\n React.isValidElement<{ disabled?: boolean }>(child) &&\n allowedComponents.includes(child.type) &&\n !disablePropagation\n ) {\n return React.cloneElement(child, {\n disabled: child.props.disabled ?? disabled\n });\n }\n\n return child;\n });\n };\n\n return (\n <fieldset\n {...rest}\n ref={ref}\n disabled={disabled}\n style={{ backgroundColor: background, ...rest.style }}\n className={`${classes.fieldset} ${noPadding ? classes[\"no-padding\"] : \"\"} ${className ?? \"\"}`}\n >\n {legend && <legend className={readyclasses[\"sr-only\"]}>{legend}</legend>}\n {legend && !hideLegend && (\n <Typography\n variant={legendStyle}\n tag=\"span\"\n aria-hidden=\"true\"\n className={`${classes[\"legend\"]} ${required ? classes[\"required\"] : \"\"} ${\n flushLegend ? classes[\"flush\"] : \"\"\n }`}\n >\n {legend}\n </Typography>\n )}\n {renderChildren()}\n </fieldset>\n );\n};\n\nexport const Fieldset = withReadOnly(React.forwardRef(FieldsetComponent));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,MAAM,oBAA0E,CAC9E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb;AAAA,EACA,aAAa,eAAe,KAAK;AAAA,EACjC,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,cAA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,iBAAiB,CAAC;"}
@@ -1,3 +1,3 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Fieldset_fieldset_gLrTA{border:0;padding:calc(.5 * var(--font-size));border-radius:.5rem;margin:0}.Fieldset_fieldset_gLrTA.Fieldset_no-padding_gLrTA{padding:0}.Fieldset_fieldset_gLrTA+.Fieldset_wrapper_gLrTA,.Fieldset_fieldset_gLrTA+.Fieldset_fieldset_gLrTA{margin-top:1rem}.Fieldset_fieldset_gLrTA .Fieldset_legend_gLrTA{display:block}.Fieldset_fieldset_gLrTA .Fieldset_legend_gLrTA.Fieldset_required_gLrTA:after{content:" *"}@media only screen and (min-width:30em){.Fieldset_fieldset_gLrTA{padding:calc(.5 * var(--font-size))}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
2
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="Fieldset_fieldset_gLrTA",d="Fieldset_legend_gLrTA",t="Fieldset_required_gLrTA",r={fieldset:e,"no-padding":"Fieldset_no-padding_gLrTA",legend:d,required:t};exports.default=r,exports.fieldset=e,exports.legend=d,exports.required=t;
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Fieldset_fieldset_8eZbI{border:0;padding:calc(.5 * var(--font-size));border-radius:.5rem;margin:0}.Fieldset_fieldset_8eZbI.Fieldset_no-padding_8eZbI{padding:0}.Fieldset_fieldset_8eZbI+.Fieldset_wrapper_8eZbI,.Fieldset_fieldset_8eZbI+.Fieldset_fieldset_8eZbI{margin-top:1rem}.Fieldset_fieldset_8eZbI .Fieldset_legend_8eZbI{display:block;margin-bottom:.75rem}.Fieldset_fieldset_8eZbI .Fieldset_legend_8eZbI.Fieldset_flush_8eZbI{margin-bottom:0}.Fieldset_fieldset_8eZbI .Fieldset_legend_8eZbI.Fieldset_required_8eZbI:after{content:" *";color:var(--error)}@media only screen and (min-width:30em){.Fieldset_fieldset_8eZbI{padding:calc(.5 * var(--font-size))}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
2
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="Fieldset_fieldset_8eZbI",d="Fieldset_legend_8eZbI",s="Fieldset_flush_8eZbI",t="Fieldset_required_8eZbI",l={fieldset:e,"no-padding":"Fieldset_no-padding_8eZbI",legend:d,flush:s,required:t};exports.default=l,exports.fieldset=e,exports.flush=s,exports.legend=d,exports.required=t;
3
3
  //# sourceMappingURL=Fieldset.module.scss.cjs.js.map
@@ -1,16 +1,19 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Fieldset_fieldset_gLrTA{border:0;padding:calc(.5 * var(--font-size));border-radius:.5rem;margin:0}.Fieldset_fieldset_gLrTA.Fieldset_no-padding_gLrTA{padding:0}.Fieldset_fieldset_gLrTA+.Fieldset_wrapper_gLrTA,.Fieldset_fieldset_gLrTA+.Fieldset_fieldset_gLrTA{margin-top:1rem}.Fieldset_fieldset_gLrTA .Fieldset_legend_gLrTA{display:block}.Fieldset_fieldset_gLrTA .Fieldset_legend_gLrTA.Fieldset_required_gLrTA:after{content:" *"}@media only screen and (min-width:30em){.Fieldset_fieldset_gLrTA{padding:calc(.5 * var(--font-size))}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
2
- const fieldset = "Fieldset_fieldset_gLrTA";
3
- const legend = "Fieldset_legend_gLrTA";
4
- const required = "Fieldset_required_gLrTA";
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.Fieldset_fieldset_8eZbI{border:0;padding:calc(.5 * var(--font-size));border-radius:.5rem;margin:0}.Fieldset_fieldset_8eZbI.Fieldset_no-padding_8eZbI{padding:0}.Fieldset_fieldset_8eZbI+.Fieldset_wrapper_8eZbI,.Fieldset_fieldset_8eZbI+.Fieldset_fieldset_8eZbI{margin-top:1rem}.Fieldset_fieldset_8eZbI .Fieldset_legend_8eZbI{display:block;margin-bottom:.75rem}.Fieldset_fieldset_8eZbI .Fieldset_legend_8eZbI.Fieldset_flush_8eZbI{margin-bottom:0}.Fieldset_fieldset_8eZbI .Fieldset_legend_8eZbI.Fieldset_required_8eZbI:after{content:" *";color:var(--error)}@media only screen and (min-width:30em){.Fieldset_fieldset_8eZbI{padding:calc(.5 * var(--font-size))}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
2
+ const fieldset = "Fieldset_fieldset_8eZbI";
3
+ const legend = "Fieldset_legend_8eZbI";
4
+ const flush = "Fieldset_flush_8eZbI";
5
+ const required = "Fieldset_required_8eZbI";
5
6
  const classes = {
6
7
  fieldset,
7
- "no-padding": "Fieldset_no-padding_gLrTA",
8
+ "no-padding": "Fieldset_no-padding_8eZbI",
8
9
  legend,
10
+ flush,
9
11
  required
10
12
  };
11
13
  export {
12
14
  classes as default,
13
15
  fieldset,
16
+ flush,
14
17
  legend,
15
18
  required
16
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.module.scss.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"Fieldset.module.scss.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./FileItem.module.scss.cjs.js"),n=require("../../../Typography/Typography.cjs.js"),a=require("../../../Icon/Icon.cjs.js"),r=require("../../../ProgressBar/ProgressBar.cjs.js"),o=require("../../../Button/Button.cjs.js"),i=require("../../../Link/Link.cjs.js"),c=require("../../../withReadOnly.cjs.js");var l=(e=>(e.DELETE="delete",e.DOWNLOAD="download",e.REMOVE="remove",e.ABORT="abort",e.RETRY="retry",e))(l||{}),s=(e=>(e.COMPLETED="completed",e.UPLOADING="uploading",e.ERROR="error",e.RETRY="retry",e.READONLY="readonly",e))(s||{});const d=c.withReadOnly(e.forwardRef(({name:c,status:l,error:s,progress:d,onDownloadFile:u,downloadFileLink:f,totalPercentage:p,onRequestedFileAction:m,...y},I)=>{const[E,g]=e.useState(!1),[v,b]=e.useState(""),h=e.useRef(null),N=e.useRef([]),T=e.useRef(0),x=(e=>{switch(e){case"completed":return{fileIcon:a.Icons.FileAltIcon,actionIcons:[{type:a.Icons.Trash,action:"delete"},{type:a.Icons.DownloadFile,action:"download"}]};case"error":return{fileIcon:a.Icons.Error,actionIcons:[{type:a.Icons.Times,action:"remove"}]};case"uploading":return{fileIcon:a.Icons.FileAltIcon,actionIcons:[{type:a.Icons.AbortFile,action:"abort"}]};case"retry":return{fileIcon:a.Icons.FileAltIcon,actionIcons:[{type:a.Icons.Refresh,action:"retry"},{type:a.Icons.Trash,action:"remove"}]};default:return{fileIcon:a.Icons.FileAltIcon}}})(l),{friendlyName:w,extension:R}=(e=>{const t=e.indexOf(".");return{friendlyName:e.slice(0,t),extension:e.slice(t+1)}})(c),k=()=>{!E&&F&&(g(!0),b("Entered file actions"))};e.useEffect(()=>{if(E&&N.current.length>0){const e=N.current[0];e&&(e.focus(),T.current=0)}},[E]),e.useEffect(()=>{if(v){const e=setTimeout(()=>b(""),1e3);return()=>clearTimeout(e)}},[v]);const j=n=>e.createElement(a.Icon,{key:n.action,icon:n.type,className:t.default["action-icon"],"aria-hidden":"true"}),A=`file-item-instructions-${c.replace(/[^a-zA-Z0-9]/g,"-")}`,O=`file-item-live-${c.replace(/[^a-zA-Z0-9]/g,"-")}`,F=x.actionIcons&&x.actionIcons.length>0;return e.createElement("fieldset",{ref:e=>{h.current=e,"function"==typeof I?I(e):I&&(I.current=e)},className:t.default["file-item-wrapper"],role:F&&!E?"button":"group","aria-label":E?void 0:c,"aria-describedby":F?A:void 0,"aria-expanded":!(F&&!E)&&void 0,tabIndex:E?-1:0,onClick:()=>{k()},onKeyDown:e=>{(e=>{if("Escape"===e.key&&!E){e.preventDefault();const t=e.currentTarget.closest('[data-file-upload-component="true"]');if(t){const e=t.querySelector('[data-file-upload-dropzone="true"]');if(e)return e.focus(),void b("Moved to file upload area")}return}!E&&x.actionIcons&&x.actionIcons.length>0&&"Enter"===e.key&&(e.preventDefault(),k())})(e),(e=>{var t;if(E){if("Escape"===e.key)return e.preventDefault(),g(!1),b("Exited file item"),void(null==(t=h.current)||t.focus());if("Tab"===e.key){const t=N.current.filter(e=>null!==e),n=document.activeElement,a=t.findIndex(e=>e===n);(!e.shiftKey&&a===t.length-1||e.shiftKey&&0===a)&&(g(!1),b("Exited file item"))}}})(e)},...(()=>{var e;const t={...y};return null==(e=null==t?void 0:t.style)||delete e.pointerEvents,delete t["aria-readonly"],t})()},F&&!E&&e.createElement("span",{id:A,className:t.default["sr-only"]},"Press Enter to navigate inside and interact with file actions. Press Escape to exit."),e.createElement("div",{id:O,"aria-live":"polite","aria-atomic":"true",className:t.default["sr-only"]},v),e.createElement("div",{className:t.default["file-list-container"]},"uploading"!==l&&e.createElement(n.Typography,{variant:"body",title:c,className:`${t.default["file-name"]} ${l?t.default[l]:""}`},"retry"===l&&e.createElement(a.Icon,{icon:a.Icons.Error,className:`${t.default["file-icon"]} ${l?t.default[l]:""}`}),e.createElement(a.Icon,{icon:x.fileIcon,className:t.default["file-icon"]}),e.createElement("span",{className:t.default["friendly-name"]},w,".",R)),e.createElement("div",{className:`${"uploading"===l?t.default["progress-with-action"]:""}`},"uploading"===l&&e.createElement(r.ProgressBar,{className:t.default["progress-bar"],completed:d,label:`${w}.${R}`,percentage:p}),e.createElement("div",{className:t.default["action-button-wrapper"]},x.actionIcons&&(n=>{let r=0;return n.map(n=>e.createElement(e.Fragment,{key:n.action},"download"!==n.action&&e.createElement(o.Button,{ref:e=>{N.current[r]=e,r++},color:"primary",startIcon:j(n),type:"button",variant:"text",tabIndex:E?0:-1,onClick:()=>n&&m&&m(n.action,c),"aria-label":n.action},e.createElement("span",{"aria-hidden":"true"},"abort"!==n.action?n.action:"")),"download"===n.action&&f&&!u&&e.createElement(i.Link,{ref:e=>{N.current[r]=e,r++},color:"primary",display:"link",to:f,type:"download",target:"_blank",tabIndex:E?0:-1,"aria-label":n.action,prefixIcon:e.createElement(a.Icon,{key:n.action,className:t.default["action-icon"],icon:n.type,"aria-hidden":"true"})},e.createElement("span",{"aria-hidden":"true"},n.action)),"download"===n.action&&u&&e.createElement(o.Button,{ref:e=>{N.current[r]=e,r++},color:"primary",onClick:u,type:"button",variant:"text",tabIndex:E?0:-1,"aria-label":n.action,startIcon:j(n)},e.createElement("span",{"aria-hidden":"true"},n.action))))})(x.actionIcons)))),s&&e.createElement(n.Typography,{variant:"sub-text",className:`${t.default["file-subtitle"]} ${l?t.default[l]:""}`},s))}));exports.ACTION_STATUS=s,exports.FILE_ACTION=l,exports.FileItem=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./FileItem.module.scss.cjs.js"),n=require("../../../Typography/Typography.cjs.js"),a=require("../../../Icon/Icon.cjs.js"),r=require("../../../ProgressBar/ProgressBar.cjs.js"),o=require("../../../Button/Button.cjs.js"),i=require("../../../Link/Link.cjs.js"),c=require("../../../withReadOnly.cjs.js");var l=(e=>(e.DELETE="delete",e.DOWNLOAD="download",e.REMOVE="remove",e.ABORT="abort",e.RETRY="retry",e))(l||{}),s=(e=>(e.COMPLETED="completed",e.UPLOADING="uploading",e.ERROR="error",e.RETRY="retry",e.READONLY="readonly",e))(s||{});const d=c.withReadOnly(e.forwardRef(({name:c,status:l,error:s,progress:d,onDownloadFile:u,downloadFileLink:f,totalPercentage:p,onRequestedFileAction:m,...y},I)=>{const[E,v]=e.useState(!1),[g,b]=e.useState(""),h=e.useRef(null),N=e.useRef([]),T=e.useRef(0),x=(e=>{switch(e){case"completed":return{fileIcon:a.Icons.FileAltIcon,actionIcons:[{type:a.Icons.Trash,action:"delete"},{type:a.Icons.DownloadFile,action:"download"}]};case"error":return{fileIcon:a.Icons.Error,actionIcons:[{type:a.Icons.Times,action:"remove"}]};case"uploading":return{fileIcon:a.Icons.FileAltIcon,actionIcons:[{type:a.Icons.AbortFile,action:"abort"}]};case"retry":return{fileIcon:a.Icons.FileAltIcon,actionIcons:[{type:a.Icons.Refresh,action:"retry"},{type:a.Icons.Trash,action:"remove"}]};default:return{fileIcon:a.Icons.FileAltIcon}}})(l),{friendlyName:w,extension:R}=(e=>{const t=e.indexOf(".");return{friendlyName:e.slice(0,t),extension:e.slice(t+1)}})(c),k=()=>{!E&&F&&(v(!0),b("Entered file actions"))};e.useEffect(()=>{if(E&&N.current.length>0){const e=N.current[0];e&&(e.focus(),T.current=0)}},[E]),e.useEffect(()=>{if(g){const e=setTimeout(()=>b(""),1e3);return()=>clearTimeout(e)}},[g]);const j=n=>e.createElement(a.Icon,{key:n.action,icon:n.type,className:t.default["action-icon"],"aria-hidden":"true"}),A=`file-item-instructions-${c.replace(/[^a-zA-Z0-9]/g,"-")}`,O=`file-item-live-${c.replace(/[^a-zA-Z0-9]/g,"-")}`,F=x.actionIcons&&x.actionIcons.length>0;return e.createElement("fieldset",{ref:e=>{h.current=e,"function"==typeof I?I(e):I&&(I.current=e)},className:t.default["file-item-wrapper"],role:F&&!E?"button":"group","aria-label":E?void 0:c,"aria-describedby":F?A:void 0,"aria-expanded":!(F&&!E)&&void 0,tabIndex:E?-1:0,onClick:()=>{k()},onKeyDown:e=>{(e=>{if("Escape"===e.key&&!E){e.preventDefault();const t=e.currentTarget.closest('[data-file-upload-component="true"]');if(t){const e=t.querySelector('[data-file-upload-dropzone="true"]');if(e)return e.focus(),void b("Moved to file upload area")}return}!E&&x.actionIcons&&x.actionIcons.length>0&&"Enter"===e.key&&(e.preventDefault(),k())})(e),(e=>{var t;if(E){if("Escape"===e.key)return e.preventDefault(),v(!1),b("Exited file item"),void(null==(t=h.current)||t.focus());if("Tab"===e.key){const t=N.current.filter(e=>null!==e),n=document.activeElement,a=t.findIndex(e=>e===n);(!e.shiftKey&&a===t.length-1||e.shiftKey&&0===a)&&(v(!1),b("Exited file item"))}}})(e)},...(()=>{var e;const t={...y};return null==(e=null==t?void 0:t.style)||delete e.pointerEvents,delete t["aria-readonly"],t})()},F&&!E&&e.createElement("span",{id:A,className:t.default["sr-only"]},"Press Enter to navigate inside and interact with file actions. Press Escape to exit."),e.createElement("div",{id:O,"aria-live":"polite","aria-atomic":"true",className:t.default["sr-only"]},g),e.createElement("div",{className:t.default["file-list-container"]},"uploading"!==l&&e.createElement(n.Typography,{variant:"body",title:c,className:`${t.default["file-name"]} ${l?t.default[l]:""}`},"retry"===l&&e.createElement(a.Icon,{icon:a.Icons.Error,className:`${t.default["file-icon"]} ${l?t.default[l]:""}`}),e.createElement(a.Icon,{icon:x.fileIcon,className:t.default["file-icon"]}),e.createElement("span",{className:t.default["friendly-name"]},w,".",R)),e.createElement("div",{className:`${"uploading"===l?t.default["progress-with-action"]:""}`},"uploading"===l&&e.createElement(r.ProgressBar,{className:t.default["progress-bar"],completed:d,label:`${w}.${R}`,percentage:p}),e.createElement("div",{className:t.default["action-button-wrapper"]},x.actionIcons&&(n=>{let r=0;return n.map(n=>e.createElement(e.Fragment,{key:n.action},"download"!==n.action&&e.createElement(o.Button,{ref:e=>{N.current[r]=e,r++},color:"primary",startIcon:j(n),type:"button",variant:"text",tabIndex:E?0:-1,onClick:()=>n&&(null==m?void 0:m(n.action,c)),"aria-label":n.action},e.createElement("span",{"aria-hidden":"true"},"abort"!==n.action?n.action:"")),"download"===n.action&&f&&!u&&e.createElement(i.Link,{ref:e=>{N.current[r]=e,r++},color:"primary",display:"link",to:f,type:"download",target:"_blank",tabIndex:E?0:-1,"aria-label":n.action,prefixIcon:e.createElement(a.Icon,{key:n.action,className:t.default["action-icon"],icon:n.type,"aria-hidden":"true"})},e.createElement("span",{"aria-hidden":"true"},n.action)),"download"===n.action&&u&&e.createElement(o.Button,{ref:e=>{N.current[r]=e,r++},color:"primary",onClick:u,type:"button",variant:"text",tabIndex:E?0:-1,"aria-label":n.action,startIcon:j(n)},e.createElement("span",{"aria-hidden":"true"},n.action))))})(x.actionIcons)))),s&&e.createElement(n.Typography,{variant:"sub-text",className:`${t.default["file-subtitle"]} ${l?t.default[l]:""}`},s))}));exports.ACTION_STATUS=s,exports.FILE_ACTION=l,exports.FileItem=d;
2
2
  //# sourceMappingURL=FileItem.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.cjs.js","sources":["../../../../../src/components/Form/FileUpload/FileItem/FileItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n ForwardRefRenderFunction,\n Fragment,\n useRef,\n useState,\n useEffect,\n KeyboardEvent\n} from \"react\";\nimport classes from \"./FileItem.module.scss\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { ProgressBar } from \"../../../ProgressBar/ProgressBar\";\nimport { FileType } from \"../FileUpload\";\nimport { Button } from \"../../../Button/Button\";\nimport { Link } from \"../../../Link/Link\";\nimport { withReadOnly } from \"../../../withReadOnly\";\nexport type UploadProgress = \"uploading\" | \"completed\" | \"error\" | \"readonly\" | \"retry\";\n\nexport interface Props extends ComponentPropsWithRef<\"fieldset\"> {\n name: string;\n status?: UploadProgress;\n progress?: number;\n error?: string;\n downloadFileLink?: string;\n onDownloadFile?: () => void;\n totalPercentage?: number;\n onRequestedFileAction?: (action: FILE_ACTION, name: FileType[\"name\"]) => void;\n}\ninterface FileItemIcons {\n fileIcon: Icons;\n actionIcons?: { type: Icons; action: FILE_ACTION }[];\n}\n\nexport enum FILE_ACTION {\n DELETE = \"delete\",\n DOWNLOAD = \"download\",\n REMOVE = \"remove\",\n ABORT = \"abort\",\n RETRY = \"retry\"\n}\n\nexport enum ACTION_STATUS {\n COMPLETED = \"completed\",\n UPLOADING = \"uploading\",\n ERROR = \"error\",\n RETRY = \"retry\",\n READONLY = \"readonly\"\n}\n\nconst FileItemComponent: ForwardRefRenderFunction<HTMLFieldSetElement, Props> = (\n {\n name,\n status,\n error,\n progress,\n onDownloadFile,\n downloadFileLink,\n totalPercentage,\n onRequestedFileAction,\n ...rest\n }: Props,\n ref\n) => {\n // State for managing navigation mode (outside vs inside component)\n const [isNavigatingInside, setIsNavigatingInside] = useState(false);\n const [liveRegionMessage, setLiveRegionMessage] = useState(\"\");\n\n // Refs for focus management\n const wrapperRef = useRef<HTMLFieldSetElement>(null);\n const actionButtonsRef = useRef<(HTMLButtonElement | HTMLAnchorElement | null)[]>([]);\n const currentFocusIndex = useRef<number>(0);\n\n const determineIcons = (status?: UploadProgress): FileItemIcons => {\n switch (status) {\n case ACTION_STATUS.COMPLETED:\n return {\n fileIcon: Icons.FileAltIcon,\n actionIcons: [\n {\n type: Icons.Trash,\n action: FILE_ACTION.DELETE\n },\n {\n type: Icons.DownloadFile,\n action: FILE_ACTION.DOWNLOAD\n }\n ]\n };\n case ACTION_STATUS.ERROR:\n return {\n fileIcon: Icons.Error,\n actionIcons: [\n {\n type: Icons.Times,\n action: FILE_ACTION.REMOVE\n }\n ]\n };\n case ACTION_STATUS.UPLOADING:\n return {\n fileIcon: Icons.FileAltIcon,\n actionIcons: [\n {\n type: Icons.AbortFile,\n action: FILE_ACTION.ABORT\n }\n ]\n };\n case ACTION_STATUS.RETRY:\n return {\n fileIcon: Icons.FileAltIcon,\n actionIcons: [\n {\n type: Icons.Refresh,\n action: FILE_ACTION.RETRY\n },\n {\n type: Icons.Trash,\n action: FILE_ACTION.REMOVE\n }\n ]\n };\n case ACTION_STATUS.READONLY:\n default:\n return { fileIcon: Icons.FileAltIcon };\n }\n };\n\n const icons = determineIcons(status);\n\n const getFriendlyNameAndExtension = (name: string) => {\n const index = name.indexOf(\".\");\n return { friendlyName: name.slice(0, index), extension: name.slice(index + 1) };\n };\n\n const { friendlyName, extension } = getFriendlyNameAndExtension(name);\n\n const handleWrapperKeyDown = (e: KeyboardEvent<HTMLFieldSetElement>) => {\n if (e.key === \"Escape\" && !isNavigatingInside) {\n e.preventDefault();\n const currentElement = e.currentTarget;\n const fileUploadWrapper = currentElement.closest('[data-file-upload-component=\"true\"]');\n if (fileUploadWrapper) {\n const dropzoneContainer = fileUploadWrapper.querySelector(\n '[data-file-upload-dropzone=\"true\"]'\n ) as HTMLElement;\n if (dropzoneContainer) {\n dropzoneContainer.focus();\n setLiveRegionMessage(\"Moved to file upload area\");\n return;\n }\n }\n return;\n }\n\n if (!isNavigatingInside && icons.actionIcons && icons.actionIcons.length > 0) {\n if (e.key === \"Enter\") {\n e.preventDefault();\n enterActionMode();\n }\n }\n };\n\n const enterActionMode = () => {\n if (!isNavigatingInside && hasActions) {\n setIsNavigatingInside(true);\n setLiveRegionMessage(\"Entered file actions\");\n }\n };\n\n const handleWrapperClick = () => {\n enterActionMode();\n };\n\n const handleInsideKeyDown = (e: KeyboardEvent<HTMLFieldSetElement>) => {\n if (!isNavigatingInside) {\n return;\n }\n\n if (e.key === \"Escape\") {\n e.preventDefault();\n setIsNavigatingInside(false);\n setLiveRegionMessage(\"Exited file item\");\n wrapperRef.current?.focus();\n return;\n }\n\n if (e.key === \"Tab\") {\n const buttons = actionButtonsRef.current.filter(btn => btn !== null);\n const activeElement = document.activeElement;\n const currentIndex = buttons.findIndex(btn => btn === activeElement);\n\n if (\n (!e.shiftKey && currentIndex === buttons.length - 1) ||\n (e.shiftKey && currentIndex === 0)\n ) {\n setIsNavigatingInside(false);\n setLiveRegionMessage(\"Exited file item\");\n }\n }\n };\n\n useEffect(() => {\n if (isNavigatingInside && actionButtonsRef.current.length > 0) {\n const firstButton = actionButtonsRef.current[0];\n if (firstButton) {\n firstButton.focus();\n currentFocusIndex.current = 0;\n }\n }\n }, [isNavigatingInside]);\n\n useEffect(() => {\n if (liveRegionMessage) {\n const timer = setTimeout(() => setLiveRegionMessage(\"\"), 1000);\n return () => clearTimeout(timer);\n }\n }, [liveRegionMessage]);\n\n const getStartIcon = (icon: { type: Icons; action: FILE_ACTION }) => (\n <Icon\n key={icon.action}\n icon={icon.type}\n className={classes[\"action-icon\"]}\n aria-hidden=\"true\"\n ></Icon>\n );\n\n const renderActionIcons = (actionIcons: { type: Icons; action: FILE_ACTION }[]) => {\n let buttonIndex = 0;\n\n return actionIcons.map(icon => (\n <Fragment key={icon.action}>\n {icon.action !== FILE_ACTION.DOWNLOAD && (\n <Button\n ref={el => {\n actionButtonsRef.current[buttonIndex] = el;\n buttonIndex++;\n }}\n color=\"primary\"\n startIcon={getStartIcon(icon)}\n type=\"button\"\n variant=\"text\"\n tabIndex={isNavigatingInside ? 0 : -1}\n onClick={() =>\n icon && onRequestedFileAction && onRequestedFileAction(icon.action, name)\n }\n aria-label={icon.action}\n >\n <span aria-hidden=\"true\">{icon.action !== FILE_ACTION.ABORT ? icon.action : \"\"}</span>\n </Button>\n )}\n\n {icon.action === FILE_ACTION.DOWNLOAD && downloadFileLink && !onDownloadFile && (\n <Link\n ref={el => {\n actionButtonsRef.current[buttonIndex] = el;\n buttonIndex++;\n }}\n color=\"primary\"\n display=\"link\"\n to={downloadFileLink}\n type=\"download\"\n target=\"_blank\"\n tabIndex={isNavigatingInside ? 0 : -1}\n aria-label={icon.action}\n prefixIcon={\n <Icon\n key={icon.action}\n className={classes[\"action-icon\"]}\n icon={icon.type}\n aria-hidden=\"true\"\n ></Icon>\n }\n >\n <span aria-hidden=\"true\">{icon.action}</span>\n </Link>\n )}\n\n {icon.action === FILE_ACTION.DOWNLOAD && onDownloadFile && (\n <Button\n ref={el => {\n actionButtonsRef.current[buttonIndex] = el;\n buttonIndex++;\n }}\n color=\"primary\"\n onClick={onDownloadFile}\n type=\"button\"\n variant=\"text\"\n tabIndex={isNavigatingInside ? 0 : -1}\n aria-label={icon.action}\n startIcon={getStartIcon(icon)}\n >\n <span aria-hidden=\"true\">{icon.action}</span>\n </Button>\n )}\n </Fragment>\n ));\n };\n\n const getUploadedFileInfo = () => {\n return (\n <Typography\n variant={\"body\"}\n title={name}\n className={`${classes[\"file-name\"]} ${status ? classes[status] : \"\"}`}\n >\n {status === \"retry\" && (\n <Icon\n icon={Icons.Error}\n className={`${classes[\"file-icon\"]} ${status ? classes[status] : \"\"}`}\n />\n )}\n <Icon icon={icons.fileIcon} className={classes[\"file-icon\"]} />\n <span className={classes[\"friendly-name\"]}>\n {friendlyName}.{extension}\n </span>\n </Typography>\n );\n };\n\n const getProgressBar = () => {\n return (\n <ProgressBar\n className={classes[\"progress-bar\"]}\n completed={progress}\n label={`${friendlyName}.${extension}`}\n percentage={totalPercentage}\n />\n );\n };\n\n const restPropsWithoutPointerEvents = () => {\n const props = { ...rest };\n delete props?.style?.pointerEvents;\n delete props[\"aria-readonly\"];\n return props;\n };\n\n const instructionsId = `file-item-instructions-${name.replace(/[^a-zA-Z0-9]/g, \"-\")}`;\n const liveRegionId = `file-item-live-${name.replace(/[^a-zA-Z0-9]/g, \"-\")}`;\n const hasActions = icons.actionIcons && icons.actionIcons.length > 0;\n\n const handleRef = (node: HTMLFieldSetElement | null) => {\n (wrapperRef as React.MutableRefObject<HTMLFieldSetElement | null>).current = node;\n\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLFieldSetElement | null>).current = node;\n }\n };\n\n return (\n <fieldset // NOSONAR S6847 - fieldset is intentionally focusable (tabIndex) and requires keyboard handling for composite widget navigation (ARIA pattern). Using fieldset per S6836 recommendation over div[role=\"group\"].\n ref={handleRef}\n className={classes[\"file-item-wrapper\"]}\n role={hasActions && !isNavigatingInside ? \"button\" : \"group\"}\n aria-label={!isNavigatingInside ? name : undefined}\n aria-describedby={hasActions ? instructionsId : undefined}\n aria-expanded={hasActions && !isNavigatingInside ? false : undefined}\n tabIndex={isNavigatingInside ? -1 : 0}\n onClick={handleWrapperClick}\n onKeyDown={e => {\n // NOSONAR\n handleWrapperKeyDown(e);\n handleInsideKeyDown(e);\n }}\n {...restPropsWithoutPointerEvents()}\n >\n {hasActions && !isNavigatingInside && (\n <span id={instructionsId} className={classes[\"sr-only\"]}>\n Press Enter to navigate inside and interact with file actions. Press Escape to exit.\n </span>\n )}\n\n <div id={liveRegionId} aria-live=\"polite\" aria-atomic=\"true\" className={classes[\"sr-only\"]}>\n {liveRegionMessage}\n </div>\n\n <div className={classes[\"file-list-container\"]}>\n {status !== ACTION_STATUS.UPLOADING && getUploadedFileInfo()}\n\n <div\n className={`${status === ACTION_STATUS.UPLOADING ? classes[\"progress-with-action\"] : \"\"}`}\n >\n {status === ACTION_STATUS.UPLOADING && getProgressBar()}\n\n <div className={classes[\"action-button-wrapper\"]}>\n {icons.actionIcons && renderActionIcons(icons.actionIcons)}\n </div>\n </div>\n </div>\n {error && (\n <Typography\n variant={\"sub-text\"}\n className={`${classes[\"file-subtitle\"]} ${status ? classes[status] : \"\"}`}\n >\n {error}\n </Typography>\n )}\n </fieldset>\n );\n};\n\nexport const FileItem = withReadOnly(React.forwardRef(FileItemComponent));\n"],"names":["FILE_ACTION","ACTION_STATUS","FileItem","withReadOnly","React","forwardRef","name","status","error","progress","onDownloadFile","downloadFileLink","totalPercentage","onRequestedFileAction","rest","ref","isNavigatingInside","setIsNavigatingInside","useState","liveRegionMessage","setLiveRegionMessage","wrapperRef","useRef","actionButtonsRef","currentFocusIndex","icons","fileIcon","Icons","FileAltIcon","actionIcons","type","Trash","action","DownloadFile","Error","Times","AbortFile","Refresh","determineIcons","friendlyName","extension","index","indexOf","slice","getFriendlyNameAndExtension","enterActionMode","hasActions","useEffect","current","length","firstButton","focus","timer","setTimeout","clearTimeout","getStartIcon","icon","createElement","Icon","key","className","classes","instructionsId","replace","liveRegionId","node","role","tabIndex","onClick","onKeyDown","e","preventDefault","fileUploadWrapper","currentTarget","closest","dropzoneContainer","querySelector","handleWrapperKeyDown","_a","buttons","filter","btn","activeElement","document","currentIndex","findIndex","shiftKey","handleInsideKeyDown","props","style","pointerEvents","restPropsWithoutPointerEvents","id","Typography","variant","title","ProgressBar","completed","label","percentage","buttonIndex","map","Fragment","Button","el","color","startIcon","Link","display","to","target","prefixIcon","renderActionIcons"],"mappings":"+ZAkDO,IAAKA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QALEA,IAAAA,GAAA,CAAA,GAQAC,GAAAA,IACVA,EAAA,UAAY,YACZA,EAAA,UAAY,YACZA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,SAAW,WALDA,IAAAA,GAAA,CAAA,GAQZ,MAoWaC,EAAWC,EAAAA,aAAaC,EAAMC,WApWqC,EAE5EC,OACAC,SACAC,QACAC,WACAC,iBACAC,mBACAC,kBACAC,2BACGC,GAELC,KAGA,MAAOC,EAAoBC,GAAyBC,EAAAA,UAAS,IACtDC,EAAmBC,GAAwBF,EAAAA,SAAS,IAGrDG,EAAaC,EAAAA,OAA4B,MACzCC,EAAmBD,EAAAA,OAAyD,IAC5EE,EAAoBF,EAAAA,OAAe,GA0DnCG,EAxDiB,CAAClB,IACtB,OAAQA,GACN,IAAK,YACH,MAAO,CACLmB,SAAUC,EAAAA,MAAMC,YAChBC,YAAa,CACX,CACEC,KAAMH,EAAAA,MAAMI,MACZC,OAAQ,UAEV,CACEF,KAAMH,EAAAA,MAAMM,aACZD,OAAQ,cAIhB,IAAK,QACH,MAAO,CACLN,SAAUC,EAAAA,MAAMO,MAChBL,YAAa,CACX,CACEC,KAAMH,EAAAA,MAAMQ,MACZH,OAAQ,YAIhB,IAAK,YACH,MAAO,CACLN,SAAUC,EAAAA,MAAMC,YAChBC,YAAa,CACX,CACEC,KAAMH,EAAAA,MAAMS,UACZJ,OAAQ,WAIhB,IAAK,QACH,M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esContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n ForwardRefRenderFunction,\n Fragment,\n useRef,\n useState,\n useEffect,\n KeyboardEvent\n} from \"react\";\nimport classes from \"./FileItem.module.scss\";\nimport { Typography } from \"../../../Typography/Typography\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { ProgressBar } from \"../../../ProgressBar/ProgressBar\";\nimport { FileType } from \"../FileUpload\";\nimport { Button } from \"../../../Button/Button\";\nimport { Link } from \"../../../Link/Link\";\nimport { withReadOnly } from \"../../../withReadOnly\";\nexport type UploadProgress = \"uploading\" | \"completed\" | \"error\" | \"readonly\" | \"retry\";\n\nexport interface Props extends ComponentPropsWithRef<\"fieldset\"> {\n name: string;\n status?: UploadProgress;\n progress?: number;\n error?: string;\n downloadFileLink?: string;\n onDownloadFile?: () => void;\n totalPercentage?: number;\n onRequestedFileAction?: (action: FILE_ACTION, name: FileType[\"name\"]) => void;\n}\ninterface FileItemIcons {\n fileIcon: Icons;\n actionIcons?: { type: Icons; action: FILE_ACTION }[];\n}\n\nexport enum FILE_ACTION {\n DELETE = \"delete\",\n DOWNLOAD = \"download\",\n REMOVE = \"remove\",\n ABORT = \"abort\",\n RETRY = \"retry\"\n}\n\nexport enum ACTION_STATUS {\n COMPLETED = \"completed\",\n UPLOADING = \"uploading\",\n ERROR = \"error\",\n RETRY = \"retry\",\n READONLY = \"readonly\"\n}\n\nconst FileItemComponent: ForwardRefRenderFunction<HTMLFieldSetElement, Props> = (\n {\n name,\n status,\n error,\n progress,\n onDownloadFile,\n downloadFileLink,\n totalPercentage,\n onRequestedFileAction,\n ...rest\n }: Props,\n ref\n) => {\n // State for managing navigation mode (outside vs inside component)\n const [isNavigatingInside, setIsNavigatingInside] = useState(false);\n const [liveRegionMessage, setLiveRegionMessage] = useState(\"\");\n\n // Refs for focus management\n const wrapperRef = useRef<HTMLFieldSetElement>(null);\n const actionButtonsRef = useRef<(HTMLButtonElement | HTMLAnchorElement | null)[]>([]);\n const currentFocusIndex = useRef<number>(0);\n\n const determineIcons = (status?: UploadProgress): FileItemIcons => {\n switch (status) {\n case ACTION_STATUS.COMPLETED:\n return {\n fileIcon: Icons.FileAltIcon,\n actionIcons: [\n {\n type: Icons.Trash,\n action: FILE_ACTION.DELETE\n },\n {\n type: Icons.DownloadFile,\n action: FILE_ACTION.DOWNLOAD\n }\n ]\n };\n case ACTION_STATUS.ERROR:\n return {\n fileIcon: Icons.Error,\n actionIcons: [\n {\n type: Icons.Times,\n action: FILE_ACTION.REMOVE\n }\n ]\n };\n case ACTION_STATUS.UPLOADING:\n return {\n fileIcon: Icons.FileAltIcon,\n actionIcons: [\n {\n type: Icons.AbortFile,\n action: FILE_ACTION.ABORT\n }\n ]\n };\n case ACTION_STATUS.RETRY:\n return {\n fileIcon: Icons.FileAltIcon,\n actionIcons: [\n {\n type: Icons.Refresh,\n action: FILE_ACTION.RETRY\n },\n {\n type: Icons.Trash,\n action: FILE_ACTION.REMOVE\n }\n ]\n };\n case ACTION_STATUS.READONLY:\n default:\n return { fileIcon: Icons.FileAltIcon };\n }\n };\n\n const icons = determineIcons(status);\n\n const getFriendlyNameAndExtension = (name: string) => {\n const index = name.indexOf(\".\");\n return { friendlyName: name.slice(0, index), extension: name.slice(index + 1) };\n };\n\n const { friendlyName, extension } = getFriendlyNameAndExtension(name);\n\n const handleWrapperKeyDown = (e: KeyboardEvent<HTMLFieldSetElement>) => {\n if (e.key === \"Escape\" && !isNavigatingInside) {\n e.preventDefault();\n const currentElement = e.currentTarget;\n const fileUploadWrapper = currentElement.closest('[data-file-upload-component=\"true\"]');\n if (fileUploadWrapper) {\n const dropzoneContainer = fileUploadWrapper.querySelector(\n '[data-file-upload-dropzone=\"true\"]'\n ) as HTMLElement;\n if (dropzoneContainer) {\n dropzoneContainer.focus();\n setLiveRegionMessage(\"Moved to file upload area\");\n return;\n }\n }\n return;\n }\n\n if (!isNavigatingInside && icons.actionIcons && icons.actionIcons.length > 0) {\n if (e.key === \"Enter\") {\n e.preventDefault();\n enterActionMode();\n }\n }\n };\n\n const enterActionMode = () => {\n if (!isNavigatingInside && hasActions) {\n setIsNavigatingInside(true);\n setLiveRegionMessage(\"Entered file actions\");\n }\n };\n\n const handleWrapperClick = () => {\n enterActionMode();\n };\n\n const handleInsideKeyDown = (e: KeyboardEvent<HTMLFieldSetElement>) => {\n if (!isNavigatingInside) {\n return;\n }\n\n if (e.key === \"Escape\") {\n e.preventDefault();\n setIsNavigatingInside(false);\n setLiveRegionMessage(\"Exited file item\");\n wrapperRef.current?.focus();\n return;\n }\n\n if (e.key === \"Tab\") {\n const buttons = actionButtonsRef.current.filter(btn => btn !== null);\n const activeElement = document.activeElement;\n const currentIndex = buttons.findIndex(btn => btn === activeElement);\n\n if (\n (!e.shiftKey && currentIndex === buttons.length - 1) ||\n (e.shiftKey && currentIndex === 0)\n ) {\n setIsNavigatingInside(false);\n setLiveRegionMessage(\"Exited file item\");\n }\n }\n };\n\n useEffect(() => {\n if (isNavigatingInside && actionButtonsRef.current.length > 0) {\n const firstButton = actionButtonsRef.current[0];\n if (firstButton) {\n firstButton.focus();\n currentFocusIndex.current = 0;\n }\n }\n }, [isNavigatingInside]);\n\n useEffect(() => {\n if (liveRegionMessage) {\n const timer = setTimeout(() => setLiveRegionMessage(\"\"), 1000);\n return () => clearTimeout(timer);\n }\n }, [liveRegionMessage]);\n\n const getStartIcon = (icon: { type: Icons; action: FILE_ACTION }) => (\n <Icon\n key={icon.action}\n icon={icon.type}\n className={classes[\"action-icon\"]}\n aria-hidden=\"true\"\n ></Icon>\n );\n\n const renderActionIcons = (actionIcons: { type: Icons; action: FILE_ACTION }[]) => {\n let buttonIndex = 0;\n\n return actionIcons.map(icon => (\n <Fragment key={icon.action}>\n {icon.action !== FILE_ACTION.DOWNLOAD && (\n <Button\n ref={el => {\n actionButtonsRef.current[buttonIndex] = el;\n buttonIndex++;\n }}\n color=\"primary\"\n startIcon={getStartIcon(icon)}\n type=\"button\"\n variant=\"text\"\n tabIndex={isNavigatingInside ? 0 : -1}\n onClick={() => icon && onRequestedFileAction?.(icon.action, name)}\n aria-label={icon.action}\n >\n <span aria-hidden=\"true\">{icon.action !== FILE_ACTION.ABORT ? icon.action : \"\"}</span>\n </Button>\n )}\n\n {icon.action === FILE_ACTION.DOWNLOAD && downloadFileLink && !onDownloadFile && (\n <Link\n ref={el => {\n actionButtonsRef.current[buttonIndex] = el;\n buttonIndex++;\n }}\n color=\"primary\"\n display=\"link\"\n to={downloadFileLink}\n type=\"download\"\n target=\"_blank\"\n tabIndex={isNavigatingInside ? 0 : -1}\n aria-label={icon.action}\n prefixIcon={\n <Icon\n key={icon.action}\n className={classes[\"action-icon\"]}\n icon={icon.type}\n aria-hidden=\"true\"\n ></Icon>\n }\n >\n <span aria-hidden=\"true\">{icon.action}</span>\n </Link>\n )}\n\n {icon.action === FILE_ACTION.DOWNLOAD && onDownloadFile && (\n <Button\n ref={el => {\n actionButtonsRef.current[buttonIndex] = el;\n buttonIndex++;\n }}\n color=\"primary\"\n onClick={onDownloadFile}\n type=\"button\"\n variant=\"text\"\n tabIndex={isNavigatingInside ? 0 : -1}\n aria-label={icon.action}\n startIcon={getStartIcon(icon)}\n >\n <span aria-hidden=\"true\">{icon.action}</span>\n </Button>\n )}\n </Fragment>\n ));\n };\n\n const getUploadedFileInfo = () => {\n return (\n <Typography\n variant={\"body\"}\n title={name}\n className={`${classes[\"file-name\"]} ${status ? classes[status] : \"\"}`}\n >\n {status === \"retry\" && (\n <Icon\n icon={Icons.Error}\n className={`${classes[\"file-icon\"]} ${status ? classes[status] : \"\"}`}\n />\n )}\n <Icon icon={icons.fileIcon} className={classes[\"file-icon\"]} />\n <span className={classes[\"friendly-name\"]}>\n {friendlyName}.{extension}\n </span>\n </Typography>\n );\n };\n\n const getProgressBar = () => {\n return (\n <ProgressBar\n className={classes[\"progress-bar\"]}\n completed={progress}\n label={`${friendlyName}.${extension}`}\n percentage={totalPercentage}\n />\n );\n };\n\n const restPropsWithoutPointerEvents = () => {\n const props = { ...rest };\n delete props?.style?.pointerEvents;\n delete props[\"aria-readonly\"];\n return props;\n };\n\n const instructionsId = `file-item-instructions-${name.replace(/[^a-zA-Z0-9]/g, \"-\")}`;\n const liveRegionId = `file-item-live-${name.replace(/[^a-zA-Z0-9]/g, \"-\")}`;\n const hasActions = icons.actionIcons && icons.actionIcons.length > 0;\n\n const handleRef = (node: HTMLFieldSetElement | null) => {\n (wrapperRef as React.MutableRefObject<HTMLFieldSetElement | null>).current = node;\n\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLFieldSetElement | null>).current = node;\n }\n };\n\n return (\n <fieldset // NOSONAR S6847 - fieldset is intentionally focusable (tabIndex) and requires keyboard handling for composite widget navigation (ARIA pattern). Using fieldset per S6836 recommendation over div[role=\"group\"].\n ref={handleRef}\n className={classes[\"file-item-wrapper\"]}\n role={hasActions && !isNavigatingInside ? \"button\" : \"group\"}\n aria-label={!isNavigatingInside ? name : undefined}\n aria-describedby={hasActions ? instructionsId : undefined}\n aria-expanded={hasActions && !isNavigatingInside ? false : undefined}\n tabIndex={isNavigatingInside ? -1 : 0}\n onClick={handleWrapperClick}\n onKeyDown={e => {\n // NOSONAR\n handleWrapperKeyDown(e);\n handleInsideKeyDown(e);\n }}\n {...restPropsWithoutPointerEvents()}\n >\n {hasActions && !isNavigatingInside && (\n <span id={instructionsId} className={classes[\"sr-only\"]}>\n Press Enter to navigate inside and interact with file actions. Press Escape to exit.\n </span>\n )}\n\n <div id={liveRegionId} aria-live=\"polite\" aria-atomic=\"true\" className={classes[\"sr-only\"]}>\n {liveRegionMessage}\n </div>\n\n <div className={classes[\"file-list-container\"]}>\n {status !== ACTION_STATUS.UPLOADING && getUploadedFileInfo()}\n\n <div\n className={`${status === ACTION_STATUS.UPLOADING ? classes[\"progress-with-action\"] : \"\"}`}\n >\n {status === ACTION_STATUS.UPLOADING && getProgressBar()}\n\n <div className={classes[\"action-button-wrapper\"]}>\n {icons.actionIcons && renderActionIcons(icons.actionIcons)}\n </div>\n </div>\n </div>\n {error && (\n <Typography\n variant={\"sub-text\"}\n className={`${classes[\"file-subtitle\"]} ${status ? classes[status] : \"\"}`}\n >\n {error}\n </Typography>\n )}\n </fieldset>\n );\n};\n\nexport const FileItem = withReadOnly(React.forwardRef(FileItemComponent));\n"],"names":["FILE_ACTION","ACTION_STATUS","FileItem","withReadOnly","React","forwardRef","name","status","error","progress","onDownloadFile","downloadFileLink","totalPercentage","onRequestedFileAction","rest","ref","isNavigatingInside","setIsNavigatingInside","useState","liveRegionMessage","setLiveRegionMessage","wrapperRef","useRef","actionButtonsRef","currentFocusIndex","icons","fileIcon","Icons","FileAltIcon","actionIcons","type","Trash","action","DownloadFile","Error","Times","AbortFile","Refresh","determineIcons","friendlyName","extension","index","indexOf","slice","getFriendlyNameAndExtension","enterActionMode","hasActions","useEffect","current","length","firstButton","focus","timer","setTimeout","clearTimeout","getStartIcon","icon","createElement","Icon","key","className","classes","instructionsId","replace","liveRegionId","node","role","tabIndex","onClick","onKeyDown","e","preventDefault","fileUploadWrapper","currentTarget","closest","dropzoneContainer","querySelector","handleWrapperKeyDown","_a","buttons","filter","btn","activeElement","document","currentIndex","findIndex","shiftKey","handleInsideKeyDown","props","style","pointerEvents","restPropsWithoutPointerEvents","id","Typography","variant","title","ProgressBar","completed","label","percentage","buttonIndex","map","Fragment","Button","el","color","startIcon","Link","display","to","target","prefixIcon","renderActionIcons"],"mappings":"+ZAkDO,IAAKA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA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,GAC5DN,EAAAqD,cAACkD,EAAAA,KAAA,CACC5F,IAAKyF,IACHjF,EAAiByB,QAAQoD,GAAeI,EACxCJ,KAEFK,MAAM,UACNG,QAAQ,OACRC,GAAIlG,EACJmB,KAAK,WACLgF,OAAO,SACP3C,SAAUnD,EAAqB,GAAI,EACnC,aAAYwC,EAAKxB,OACjB+E,WACE3G,EAAAqD,cAACC,EAAAA,KAAA,CACCC,IAAKH,EAAKxB,OACV4B,UAAWC,EAAAA,QAAQ,eACnBL,KAAMA,EAAK1B,KACX,cAAY,UAIhB1B,EAAAqD,cAAC,OAAA,CAAK,cAAY,QAAQD,EAAKxB,SAIlB,aAAhBwB,EAAKxB,QAAmCtB,GACvCN,EAAAqD,cAAC8C,EAAAA,OAAA,CACCxF,IAAKyF,IACHjF,EAAiByB,QAAQoD,GAAeI,EACxCJ,KAEFK,MAAM,UACNrC,QAAS1D,EACToB,KAAK,SACLgE,QAAQ,OACR3B,SAAUnD,EAAqB,GAAI,EACnC,aAAYwC,EAAKxB,OACjB0E,UAAWnD,EAAaC,IAExBpD,EAAAqD,cAAC,OAAA,CAAK,cAAY,QAAQD,EAAKxB,YAgGTgF,CAAkBvF,EAAMI,gBAInDrB,GACCJ,EAAAqD,cAACoC,EAAAA,WAAA,CACCC,QAAS,WACTlC,UAAW,GAAGC,EAAAA,QAAQ,oBAAoBtD,EAASsD,EAAAA,QAAQtD,GAAU,MAEpEC"}
@@ -198,7 +198,7 @@ const FileItemComponent = ({
198
198
  type: "button",
199
199
  variant: "text",
200
200
  tabIndex: isNavigatingInside ? 0 : -1,
201
- onClick: () => icon && onRequestedFileAction && onRequestedFileAction(icon.action, name),
201
+ onClick: () => icon && (onRequestedFileAction == null ? void 0 : onRequestedFileAction(icon.action, name)),
202
202
  "aria-label": icon.action
203
203
  },
204
204
  /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true" }, icon.action !== "abort" ? icon.action : "")