@hitachivantara/uikit-react-core 5.80.2 → 5.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (447) hide show
  1. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +82 -165
  2. package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +2 -2
  3. package/dist/cjs/BaseDropdown/BaseDropdownPanel.cjs +80 -0
  4. package/dist/cjs/BaseDropdown/{BaseDropdownContext/BaseDropdownContext.cjs → context.cjs} +2 -2
  5. package/dist/cjs/Button/Button.styles.cjs +6 -2
  6. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +21 -28
  7. package/dist/cjs/DropDownMenu/DropDownMenu.styles.cjs +15 -2
  8. package/dist/cjs/Dropdown/List/List.cjs +6 -5
  9. package/dist/cjs/InlineEditor/InlineEditor.cjs +13 -2
  10. package/dist/cjs/MultiButton/MultiButton.cjs +3 -4
  11. package/dist/cjs/MultiButton/MultiButton.styles.cjs +48 -109
  12. package/dist/cjs/Pagination/Pagination.styles.cjs +1 -1
  13. package/dist/cjs/Table/TableCell/TableCell.styles.cjs +2 -5
  14. package/dist/cjs/Table/TableHeader/TableHeader.cjs +40 -49
  15. package/dist/cjs/Table/TableHeader/TableHeader.styles.cjs +18 -20
  16. package/dist/cjs/Table/TableRow/TableRow.styles.cjs +7 -15
  17. package/dist/esm/Accordion/Accordion.js.map +1 -1
  18. package/dist/esm/Accordion/Accordion.styles.js.map +1 -1
  19. package/dist/esm/ActionBar/ActionBar.js.map +1 -1
  20. package/dist/esm/ActionBar/ActionBar.styles.js.map +1 -1
  21. package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
  22. package/dist/esm/ActionsGeneric/ActionsGeneric.styles.js.map +1 -1
  23. package/dist/esm/AppSwitcher/Action/Action.js.map +1 -1
  24. package/dist/esm/AppSwitcher/Action/Action.styles.js.map +1 -1
  25. package/dist/esm/AppSwitcher/AppSwitcher.js.map +1 -1
  26. package/dist/esm/AppSwitcher/AppSwitcher.styles.js.map +1 -1
  27. package/dist/esm/Avatar/Avatar.js.map +1 -1
  28. package/dist/esm/Avatar/Avatar.styles.js.map +1 -1
  29. package/dist/esm/AvatarGroup/AvatarGroup.js.map +1 -1
  30. package/dist/esm/AvatarGroup/AvatarGroup.styles.js.map +1 -1
  31. package/dist/esm/Badge/Badge.js.map +1 -1
  32. package/dist/esm/Badge/Badge.styles.js.map +1 -1
  33. package/dist/esm/Banner/Banner.js.map +1 -1
  34. package/dist/esm/Banner/Banner.styles.js.map +1 -1
  35. package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js.map +1 -1
  36. package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.styles.js.map +1 -1
  37. package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
  38. package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
  39. package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.js.map +1 -1
  40. package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.styles.js.map +1 -1
  41. package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
  42. package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js.map +1 -1
  43. package/dist/esm/BaseCheckBox/icons.js.map +1 -1
  44. package/dist/esm/BaseDropdown/BaseDropdown.js +82 -163
  45. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  46. package/dist/esm/BaseDropdown/BaseDropdown.styles.js +2 -2
  47. package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
  48. package/dist/esm/BaseDropdown/BaseDropdownPanel.js +80 -0
  49. package/dist/esm/BaseDropdown/BaseDropdownPanel.js.map +1 -0
  50. package/dist/esm/BaseDropdown/{BaseDropdownContext/BaseDropdownContext.js → context.js} +1 -1
  51. package/dist/esm/BaseDropdown/context.js.map +1 -0
  52. package/dist/esm/BaseInput/BaseInput.js.map +1 -1
  53. package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
  54. package/dist/esm/BaseInput/validations.js.map +1 -1
  55. package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
  56. package/dist/esm/BaseRadio/BaseRadio.styles.js.map +1 -1
  57. package/dist/esm/BaseRadio/icons.js.map +1 -1
  58. package/dist/esm/BaseSwitch/BaseSwitch.js.map +1 -1
  59. package/dist/esm/BaseSwitch/BaseSwitch.styles.js.map +1 -1
  60. package/dist/esm/BreadCrumb/BreadCrumb.js.map +1 -1
  61. package/dist/esm/BreadCrumb/BreadCrumb.styles.js.map +1 -1
  62. package/dist/esm/BreadCrumb/Page/Page.js.map +1 -1
  63. package/dist/esm/BreadCrumb/Page/Page.styles.js.map +1 -1
  64. package/dist/esm/BreadCrumb/PathElement/PathElement.js.map +1 -1
  65. package/dist/esm/BreadCrumb/PathElement/PathElement.styles.js.map +1 -1
  66. package/dist/esm/BreadCrumb/utils.js.map +1 -1
  67. package/dist/esm/BulkActions/BulkActions.js.map +1 -1
  68. package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
  69. package/dist/esm/Button/Button.js.map +1 -1
  70. package/dist/esm/Button/Button.styles.js +6 -2
  71. package/dist/esm/Button/Button.styles.js.map +1 -1
  72. package/dist/esm/ButtonBase/ButtonBase.js.map +1 -1
  73. package/dist/esm/ButtonBase/ButtonBase.styles.js.map +1 -1
  74. package/dist/esm/Calendar/Calendar.js.map +1 -1
  75. package/dist/esm/Calendar/Calendar.styles.js.map +1 -1
  76. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
  77. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
  78. package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js.map +1 -1
  79. package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js.map +1 -1
  80. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
  81. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js.map +1 -1
  82. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.js.map +1 -1
  83. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.styles.js.map +1 -1
  84. package/dist/esm/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
  85. package/dist/esm/Calendar/SingleCalendar/CalendarCell.styles.js.map +1 -1
  86. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.js.map +1 -1
  87. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.styles.js.map +1 -1
  88. package/dist/esm/Calendar/model.js.map +1 -1
  89. package/dist/esm/Calendar/utils.js.map +1 -1
  90. package/dist/esm/Card/Card.js.map +1 -1
  91. package/dist/esm/Card/Card.styles.js.map +1 -1
  92. package/dist/esm/Card/Content/Content.js.map +1 -1
  93. package/dist/esm/Card/Content/Content.styles.js.map +1 -1
  94. package/dist/esm/Card/Header/Header.js.map +1 -1
  95. package/dist/esm/Card/Header/Header.styles.js.map +1 -1
  96. package/dist/esm/Card/Media/Media.js.map +1 -1
  97. package/dist/esm/Card/Media/Media.styles.js.map +1 -1
  98. package/dist/esm/Carousel/Carousel.js.map +1 -1
  99. package/dist/esm/Carousel/Carousel.styles.js.map +1 -1
  100. package/dist/esm/Carousel/CarouselControls.js.map +1 -1
  101. package/dist/esm/Carousel/CarouselSlide/CarouselSlide.js.map +1 -1
  102. package/dist/esm/Carousel/CarouselSlide/CarouselSlide.styles.js.map +1 -1
  103. package/dist/esm/Carousel/CarouselThumbnails.js.map +1 -1
  104. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  105. package/dist/esm/CheckBox/CheckBox.styles.js.map +1 -1
  106. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
  107. package/dist/esm/CheckBoxGroup/CheckBoxGroup.styles.js.map +1 -1
  108. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  109. package/dist/esm/ColorPicker/ColorPicker.styles.js.map +1 -1
  110. package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
  111. package/dist/esm/ColorPicker/Fields/Fields.styles.js.map +1 -1
  112. package/dist/esm/ColorPicker/Picker/Picker.js.map +1 -1
  113. package/dist/esm/ColorPicker/Picker/Picker.styles.js.map +1 -1
  114. package/dist/esm/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  115. package/dist/esm/ColorPicker/PresetColors/PresetColors.styles.js.map +1 -1
  116. package/dist/esm/ColorPicker/SavedColors/SavedColors.js.map +1 -1
  117. package/dist/esm/ColorPicker/SavedColors/SavedColors.styles.js.map +1 -1
  118. package/dist/esm/Container/Container.js.map +1 -1
  119. package/dist/esm/Container/Container.styles.js.map +1 -1
  120. package/dist/esm/Controls/Controls.js.map +1 -1
  121. package/dist/esm/Controls/Controls.styles.js.map +1 -1
  122. package/dist/esm/Controls/LeftControl/LeftControl.js.map +1 -1
  123. package/dist/esm/Controls/RightControl/RightControl.js.map +1 -1
  124. package/dist/esm/Controls/context/ControlsContext.js.map +1 -1
  125. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  126. package/dist/esm/DatePicker/DatePicker.styles.js.map +1 -1
  127. package/dist/esm/DatePicker/useVisibleDate.js.map +1 -1
  128. package/dist/esm/DatePicker/utils.js.map +1 -1
  129. package/dist/esm/Dialog/Actions/Actions.js.map +1 -1
  130. package/dist/esm/Dialog/Actions/Actions.styles.js.map +1 -1
  131. package/dist/esm/Dialog/Content/Content.js.map +1 -1
  132. package/dist/esm/Dialog/Content/Content.styles.js.map +1 -1
  133. package/dist/esm/Dialog/Dialog.js.map +1 -1
  134. package/dist/esm/Dialog/Dialog.styles.js.map +1 -1
  135. package/dist/esm/Dialog/Title/Title.js.map +1 -1
  136. package/dist/esm/Dialog/Title/Title.styles.js.map +1 -1
  137. package/dist/esm/Dialog/context.js.map +1 -1
  138. package/dist/esm/DotPagination/DotPagination.js.map +1 -1
  139. package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
  140. package/dist/esm/Drawer/Drawer.js.map +1 -1
  141. package/dist/esm/Drawer/Drawer.styles.js.map +1 -1
  142. package/dist/esm/DropDownMenu/DropDownMenu.js +20 -27
  143. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  144. package/dist/esm/DropDownMenu/DropDownMenu.styles.js +15 -2
  145. package/dist/esm/DropDownMenu/DropDownMenu.styles.js.map +1 -1
  146. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  147. package/dist/esm/Dropdown/Dropdown.styles.js.map +1 -1
  148. package/dist/esm/Dropdown/List/List.js +6 -5
  149. package/dist/esm/Dropdown/List/List.js.map +1 -1
  150. package/dist/esm/Dropdown/List/List.styles.js.map +1 -1
  151. package/dist/esm/Dropdown/utils.js.map +1 -1
  152. package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
  153. package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -1
  154. package/dist/esm/EmptyState/EmptyState.js.map +1 -1
  155. package/dist/esm/EmptyState/EmptyState.styles.js.map +1 -1
  156. package/dist/esm/FileUploader/DropZone/DropZone.js.map +1 -1
  157. package/dist/esm/FileUploader/DropZone/DropZone.styles.js.map +1 -1
  158. package/dist/esm/FileUploader/File/File.js.map +1 -1
  159. package/dist/esm/FileUploader/File/File.styles.js.map +1 -1
  160. package/dist/esm/FileUploader/FileList/FileList.js.map +1 -1
  161. package/dist/esm/FileUploader/FileList/FileList.styles.js.map +1 -1
  162. package/dist/esm/FileUploader/FileUploader.js.map +1 -1
  163. package/dist/esm/FileUploader/Preview/Preview.js.map +1 -1
  164. package/dist/esm/FileUploader/Preview/Preview.styles.js.map +1 -1
  165. package/dist/esm/FileUploader/utils.js.map +1 -1
  166. package/dist/esm/FilterGroup/Counter/Counter.js.map +1 -1
  167. package/dist/esm/FilterGroup/Counter/Counter.styles.js.map +1 -1
  168. package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
  169. package/dist/esm/FilterGroup/FilterContent/FilterContent.styles.js.map +1 -1
  170. package/dist/esm/FilterGroup/FilterGroup.js.map +1 -1
  171. package/dist/esm/FilterGroup/FilterGroup.styles.js.map +1 -1
  172. package/dist/esm/FilterGroup/FilterGroupContext.js.map +1 -1
  173. package/dist/esm/FilterGroup/LeftPanel/LeftPanel.js.map +1 -1
  174. package/dist/esm/FilterGroup/LeftPanel/LeftPanel.styles.js.map +1 -1
  175. package/dist/esm/FilterGroup/RightPanel/RightPanel.js.map +1 -1
  176. package/dist/esm/FilterGroup/RightPanel/RightPanel.styles.js.map +1 -1
  177. package/dist/esm/Focus/Focus.js.map +1 -1
  178. package/dist/esm/Focus/Focus.styles.js.map +1 -1
  179. package/dist/esm/Focus/utils.js.map +1 -1
  180. package/dist/esm/Footer/Footer.js.map +1 -1
  181. package/dist/esm/Footer/Footer.styles.js.map +1 -1
  182. package/dist/esm/Forms/Adornment/Adornment.js.map +1 -1
  183. package/dist/esm/Forms/Adornment/Adornment.styles.js.map +1 -1
  184. package/dist/esm/Forms/CharCounter/CharCounter.js.map +1 -1
  185. package/dist/esm/Forms/FormElement/FormElement.js.map +1 -1
  186. package/dist/esm/Forms/FormElement/FormElement.styles.js.map +1 -1
  187. package/dist/esm/Forms/FormElement/context/FormElementContext.js.map +1 -1
  188. package/dist/esm/Forms/FormElement/context/FormElementDescriptorsContext.js.map +1 -1
  189. package/dist/esm/Forms/FormElement/utils/FormUtils.js.map +1 -1
  190. package/dist/esm/Forms/InfoMessage/InfoMessage.js.map +1 -1
  191. package/dist/esm/Forms/Label/Label.js.map +1 -1
  192. package/dist/esm/Forms/Suggestions/Suggestions.js.map +1 -1
  193. package/dist/esm/Forms/Suggestions/Suggestions.styles.js.map +1 -1
  194. package/dist/esm/Forms/WarningText/WarningText.js.map +1 -1
  195. package/dist/esm/GlobalActions/GlobalActions.js.map +1 -1
  196. package/dist/esm/GlobalActions/GlobalActions.styles.js.map +1 -1
  197. package/dist/esm/Grid/Grid.js.map +1 -1
  198. package/dist/esm/Grid/Grid.styles.js.map +1 -1
  199. package/dist/esm/Header/Actions/Actions.js.map +1 -1
  200. package/dist/esm/Header/Actions/Actions.styles.js.map +1 -1
  201. package/dist/esm/Header/Brand/Brand.js.map +1 -1
  202. package/dist/esm/Header/Brand/Brand.styles.js.map +1 -1
  203. package/dist/esm/Header/Header.js.map +1 -1
  204. package/dist/esm/Header/Header.styles.js.map +1 -1
  205. package/dist/esm/Header/Navigation/MenuBar/Bar.js.map +1 -1
  206. package/dist/esm/Header/Navigation/MenuBar/Bar.styles.js.map +1 -1
  207. package/dist/esm/Header/Navigation/MenuBar/MenuBar.js.map +1 -1
  208. package/dist/esm/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
  209. package/dist/esm/Header/Navigation/MenuItem/MenuItem.styles.js.map +1 -1
  210. package/dist/esm/Header/Navigation/Navigation.js.map +1 -1
  211. package/dist/esm/Header/Navigation/Navigation.styles.js.map +1 -1
  212. package/dist/esm/Header/Navigation/useSelectionPath.js.map +1 -1
  213. package/dist/esm/Header/Navigation/utils/FocusContext.js.map +1 -1
  214. package/dist/esm/IconButton/IconButton.js.map +1 -1
  215. package/dist/esm/InlineEditor/InlineEditor.js +13 -2
  216. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  217. package/dist/esm/InlineEditor/InlineEditor.styles.js.map +1 -1
  218. package/dist/esm/Input/Input.js.map +1 -1
  219. package/dist/esm/Input/Input.styles.js.map +1 -1
  220. package/dist/esm/Kpi/Kpi.js.map +1 -1
  221. package/dist/esm/Link/Link.js.map +1 -1
  222. package/dist/esm/Link/Link.styles.js.map +1 -1
  223. package/dist/esm/List/List.js.map +1 -1
  224. package/dist/esm/List/List.styles.js.map +1 -1
  225. package/dist/esm/List/utils.js.map +1 -1
  226. package/dist/esm/ListContainer/ListContainer.js.map +1 -1
  227. package/dist/esm/ListContainer/ListContainer.styles.js.map +1 -1
  228. package/dist/esm/ListContainer/ListContext/ListContext.js.map +1 -1
  229. package/dist/esm/ListContainer/ListItem/ListItem.js.map +1 -1
  230. package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
  231. package/dist/esm/Loading/Loading.js.map +1 -1
  232. package/dist/esm/Loading/Loading.styles.js.map +1 -1
  233. package/dist/esm/LoadingContainer/LoadingContainer.js.map +1 -1
  234. package/dist/esm/LoadingContainer/LoadingContainer.styles.js.map +1 -1
  235. package/dist/esm/Login/Login.js.map +1 -1
  236. package/dist/esm/Login/Login.styles.js.map +1 -1
  237. package/dist/esm/MultiButton/MultiButton.js +3 -4
  238. package/dist/esm/MultiButton/MultiButton.js.map +1 -1
  239. package/dist/esm/MultiButton/MultiButton.styles.js +48 -109
  240. package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
  241. package/dist/esm/OverflowTooltip/OverflowTooltip.js.map +1 -1
  242. package/dist/esm/OverflowTooltip/OverflowTooltip.styles.js.map +1 -1
  243. package/dist/esm/Pagination/Pagination.js.map +1 -1
  244. package/dist/esm/Pagination/Pagination.styles.js +1 -1
  245. package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
  246. package/dist/esm/Pagination/Select.js.map +1 -1
  247. package/dist/esm/Pagination/Select.styles.js.map +1 -1
  248. package/dist/esm/Panel/Panel.js.map +1 -1
  249. package/dist/esm/Panel/Panel.styles.js.map +1 -1
  250. package/dist/esm/ProgressBar/ProgressBar.js.map +1 -1
  251. package/dist/esm/ProgressBar/ProgressBar.styles.js.map +1 -1
  252. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
  253. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.js.map +1 -1
  254. package/dist/esm/QueryBuilder/Context.js.map +1 -1
  255. package/dist/esm/QueryBuilder/QueryBuilder.js.map +1 -1
  256. package/dist/esm/QueryBuilder/QueryBuilder.styles.js.map +1 -1
  257. package/dist/esm/QueryBuilder/Rule/Attribute/Attribute.js.map +1 -1
  258. package/dist/esm/QueryBuilder/Rule/Operator/Operator.js.map +1 -1
  259. package/dist/esm/QueryBuilder/Rule/Rule.js.map +1 -1
  260. package/dist/esm/QueryBuilder/Rule/Rule.styles.js.map +1 -1
  261. package/dist/esm/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.js.map +1 -1
  262. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js.map +1 -1
  263. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.js.map +1 -1
  264. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/utils.js.map +1 -1
  265. package/dist/esm/QueryBuilder/Rule/Value/EmptyValue/EmptyValue.js.map +1 -1
  266. package/dist/esm/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.js.map +1 -1
  267. package/dist/esm/QueryBuilder/Rule/Value/NumericValue/NumericValue.js.map +1 -1
  268. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.js.map +1 -1
  269. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.styles.js.map +1 -1
  270. package/dist/esm/QueryBuilder/Rule/Value/Value.js.map +1 -1
  271. package/dist/esm/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
  272. package/dist/esm/QueryBuilder/utils/index.js.map +1 -1
  273. package/dist/esm/QueryBuilder/utils/reducer.js.map +1 -1
  274. package/dist/esm/Radio/Radio.js.map +1 -1
  275. package/dist/esm/Radio/Radio.styles.js.map +1 -1
  276. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  277. package/dist/esm/RadioGroup/RadioGroup.styles.js.map +1 -1
  278. package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -1
  279. package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js.map +1 -1
  280. package/dist/esm/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -1
  281. package/dist/esm/ScrollTo/Horizontal/ScrollToHorizontal.styles.js.map +1 -1
  282. package/dist/esm/ScrollTo/Vertical/ScrollToVertical.js.map +1 -1
  283. package/dist/esm/ScrollTo/Vertical/ScrollToVertical.styles.js.map +1 -1
  284. package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -1
  285. package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +1 -1
  286. package/dist/esm/ScrollTo/useScrollTo.js.map +1 -1
  287. package/dist/esm/ScrollTo/utils.js.map +1 -1
  288. package/dist/esm/Section/Section.js.map +1 -1
  289. package/dist/esm/Section/Section.styles.js.map +1 -1
  290. package/dist/esm/Select/Option.js.map +1 -1
  291. package/dist/esm/Select/OptionGroup.js.map +1 -1
  292. package/dist/esm/Select/Select.js.map +1 -1
  293. package/dist/esm/Select/Select.styles.js.map +1 -1
  294. package/dist/esm/SelectionList/SelectionList.js.map +1 -1
  295. package/dist/esm/SelectionList/SelectionList.styles.js.map +1 -1
  296. package/dist/esm/SimpleGrid/SimpleGrid.js.map +1 -1
  297. package/dist/esm/SimpleGrid/SimpleGrid.styles.js.map +1 -1
  298. package/dist/esm/Skeleton/Skeleton.js.map +1 -1
  299. package/dist/esm/Skeleton/Skeleton.styles.js.map +1 -1
  300. package/dist/esm/Slider/Slider.js.map +1 -1
  301. package/dist/esm/Slider/Slider.styles.js.map +1 -1
  302. package/dist/esm/Slider/SliderInput/SliderInput.js.map +1 -1
  303. package/dist/esm/Slider/base.js.map +1 -1
  304. package/dist/esm/Slider/utils.js.map +1 -1
  305. package/dist/esm/Snackbar/Snackbar.js.map +1 -1
  306. package/dist/esm/Snackbar/Snackbar.styles.js.map +1 -1
  307. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
  308. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
  309. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  310. package/dist/esm/SnackbarProvider/SnackbarProvider.styles.js.map +1 -1
  311. package/dist/esm/Stack/Stack.js.map +1 -1
  312. package/dist/esm/Stack/Stack.styles.js.map +1 -1
  313. package/dist/esm/Switch/Switch.js.map +1 -1
  314. package/dist/esm/Switch/Switch.styles.js.map +1 -1
  315. package/dist/esm/Tab/Tab.js.map +1 -1
  316. package/dist/esm/Tab/Tab.styles.js.map +1 -1
  317. package/dist/esm/Table/Table.js.map +1 -1
  318. package/dist/esm/Table/Table.styles.js.map +1 -1
  319. package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
  320. package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
  321. package/dist/esm/Table/TableCell/TableCell.styles.js +2 -5
  322. package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
  323. package/dist/esm/Table/TableContainer/TableContainer.js.map +1 -1
  324. package/dist/esm/Table/TableContainer/TableContainer.styles.js.map +1 -1
  325. package/dist/esm/Table/TableHead/TableHead.js.map +1 -1
  326. package/dist/esm/Table/TableHeader/TableHeader.js +44 -52
  327. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  328. package/dist/esm/Table/TableHeader/TableHeader.styles.js +18 -20
  329. package/dist/esm/Table/TableHeader/TableHeader.styles.js.map +1 -1
  330. package/dist/esm/Table/TableHeader/utils.js.map +1 -1
  331. package/dist/esm/Table/TableRow/TableRow.js.map +1 -1
  332. package/dist/esm/Table/TableRow/TableRow.styles.js +7 -15
  333. package/dist/esm/Table/TableRow/TableRow.styles.js.map +1 -1
  334. package/dist/esm/Table/hooks/useBulkActions.js.map +1 -1
  335. package/dist/esm/Table/hooks/useFilters.js.map +1 -1
  336. package/dist/esm/Table/hooks/useGlobalFilter.js.map +1 -1
  337. package/dist/esm/Table/hooks/useHeaderGroups.js.map +1 -1
  338. package/dist/esm/Table/hooks/usePagination.js.map +1 -1
  339. package/dist/esm/Table/hooks/useResizeColumns.js.map +1 -1
  340. package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
  341. package/dist/esm/Table/hooks/useRowSelection.js.map +1 -1
  342. package/dist/esm/Table/hooks/useRowState.js.map +1 -1
  343. package/dist/esm/Table/hooks/useSortBy.js.map +1 -1
  344. package/dist/esm/Table/hooks/useSticky.js.map +1 -1
  345. package/dist/esm/Table/hooks/useTable.js.map +1 -1
  346. package/dist/esm/Table/hooks/useTableStyles.js.map +1 -1
  347. package/dist/esm/Table/renderers/DateColumnCell/DateColumnCell.js.map +1 -1
  348. package/dist/esm/Table/renderers/ProgressColumnCell/ProgressColumnCell.js.map +1 -1
  349. package/dist/esm/Table/renderers/ProgressColumnCell/ProgressColumnCell.styles.js.map +1 -1
  350. package/dist/esm/Table/renderers/SwitchColumnCell/SwitchColumnCell.js.map +1 -1
  351. package/dist/esm/Table/renderers/SwitchColumnCell/SwitchColumnCell.styles.js.map +1 -1
  352. package/dist/esm/Table/renderers/renderers.js.map +1 -1
  353. package/dist/esm/Table/utils/fallbacks.js.map +1 -1
  354. package/dist/esm/Table/utils/utils.js.map +1 -1
  355. package/dist/esm/TableSection/TableSection.js.map +1 -1
  356. package/dist/esm/TableSection/TableSection.styles.js.map +1 -1
  357. package/dist/esm/Tabs/Tabs.js.map +1 -1
  358. package/dist/esm/Tabs/Tabs.styles.js.map +1 -1
  359. package/dist/esm/Tag/Tag.js.map +1 -1
  360. package/dist/esm/Tag/Tag.styles.js.map +1 -1
  361. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  362. package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
  363. package/dist/esm/TextArea/TextArea.js.map +1 -1
  364. package/dist/esm/TimeAgo/TimeAgo.js.map +1 -1
  365. package/dist/esm/TimeAgo/TimeAgo.styles.js.map +1 -1
  366. package/dist/esm/TimeAgo/formatUtils.js.map +1 -1
  367. package/dist/esm/TimeAgo/useTimeAgo.js.map +1 -1
  368. package/dist/esm/TimePicker/Placeholder.js.map +1 -1
  369. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  370. package/dist/esm/TimePicker/TimePicker.styles.js.map +1 -1
  371. package/dist/esm/TimePicker/Unit/Unit.js.map +1 -1
  372. package/dist/esm/TimePicker/Unit/Unit.styles.js.map +1 -1
  373. package/dist/esm/ToggleButton/ToggleButton.js.map +1 -1
  374. package/dist/esm/Tooltip/Tooltip.js.map +1 -1
  375. package/dist/esm/Tooltip/Tooltip.styles.js.map +1 -1
  376. package/dist/esm/TreeView/TreeItem/DefaultContent.js.map +1 -1
  377. package/dist/esm/TreeView/TreeItem/TreeItem.js.map +1 -1
  378. package/dist/esm/TreeView/TreeItem/TreeItem.styles.js.map +1 -1
  379. package/dist/esm/TreeView/TreeItem/useHvTreeItem.js.map +1 -1
  380. package/dist/esm/TreeView/TreeView.js.map +1 -1
  381. package/dist/esm/TreeView/TreeView.styles.js.map +1 -1
  382. package/dist/esm/TreeView/internals/DescendantProvider.js.map +1 -1
  383. package/dist/esm/TreeView/internals/TreeViewProvider.js.map +1 -1
  384. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewContextValueBuilder.js.map +1 -1
  385. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewExpansion.js.map +1 -1
  386. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewFocus.js.map +1 -1
  387. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js.map +1 -1
  388. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewNodes.js.map +1 -1
  389. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewSelection.js.map +1 -1
  390. package/dist/esm/TreeView/internals/hooks/useInstanceEventHandler.js.map +1 -1
  391. package/dist/esm/TreeView/internals/hooks/useTreeView.js.map +1 -1
  392. package/dist/esm/TreeView/internals/hooks/useTreeViewInstanceEvents.js.map +1 -1
  393. package/dist/esm/TreeView/internals/hooks/useTreeViewModels.js.map +1 -1
  394. package/dist/esm/TreeView/internals/hooks/utils.js.map +1 -1
  395. package/dist/esm/TreeView/internals/utils/EventManager.js.map +1 -1
  396. package/dist/esm/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.js.map +1 -1
  397. package/dist/esm/TreeView/internals/utils/TimerBasedCleanupTracking.js.map +1 -1
  398. package/dist/esm/Typography/Typography.js.map +1 -1
  399. package/dist/esm/Typography/Typography.styles.js.map +1 -1
  400. package/dist/esm/VerticalNavigation/Actions/Action.js.map +1 -1
  401. package/dist/esm/VerticalNavigation/Actions/Action.styles.js.map +1 -1
  402. package/dist/esm/VerticalNavigation/Actions/Actions.js.map +1 -1
  403. package/dist/esm/VerticalNavigation/Actions/Actions.styles.js.map +1 -1
  404. package/dist/esm/VerticalNavigation/Header/Header.js.map +1 -1
  405. package/dist/esm/VerticalNavigation/Header/Header.styles.js.map +1 -1
  406. package/dist/esm/VerticalNavigation/Navigation/Navigation.js.map +1 -1
  407. package/dist/esm/VerticalNavigation/Navigation/Navigation.styles.js.map +1 -1
  408. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js.map +1 -1
  409. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js.map +1 -1
  410. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  411. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
  412. package/dist/esm/VerticalNavigation/NavigationSlider/utils.js.map +1 -1
  413. package/dist/esm/VerticalNavigation/TreeView/TreeView.js.map +1 -1
  414. package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js.map +1 -1
  415. package/dist/esm/VerticalNavigation/TreeView/TreeViewContext.js.map +1 -1
  416. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  417. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
  418. package/dist/esm/VerticalNavigation/VerticalNavigation.js.map +1 -1
  419. package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
  420. package/dist/esm/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
  421. package/dist/esm/hocs/withTooltip.js.map +1 -1
  422. package/dist/esm/hooks/useClickOutside.js.map +1 -1
  423. package/dist/esm/hooks/useComputation.js.map +1 -1
  424. package/dist/esm/hooks/useControlled.js.map +1 -1
  425. package/dist/esm/hooks/useExpandable.js.map +1 -1
  426. package/dist/esm/hooks/useForkRef.js.map +1 -1
  427. package/dist/esm/hooks/useImageLoaded.js.map +1 -1
  428. package/dist/esm/hooks/useIsMounted.js.map +1 -1
  429. package/dist/esm/hooks/useUniqueId.js.map +1 -1
  430. package/dist/esm/hooks/useWidth.js.map +1 -1
  431. package/dist/esm/providers/Provider.js.map +1 -1
  432. package/dist/esm/providers/ThemeProvider.js.map +1 -1
  433. package/dist/esm/utils/Random.js.map +1 -1
  434. package/dist/esm/utils/browser.js.map +1 -1
  435. package/dist/esm/utils/deepMerge.js.map +1 -1
  436. package/dist/esm/utils/document.js.map +1 -1
  437. package/dist/esm/utils/focusableElementFinder.js.map +1 -1
  438. package/dist/esm/utils/helpers.js.map +1 -1
  439. package/dist/esm/utils/iconVariant.js.map +1 -1
  440. package/dist/esm/utils/multiSelectionEventHandler.js.map +1 -1
  441. package/dist/esm/utils/sizes.js.map +1 -1
  442. package/dist/esm/utils/theme.js.map +1 -1
  443. package/dist/esm/utils/useSavedState.js.map +1 -1
  444. package/dist/esm/utils/wrapperTooltip.js.map +1 -1
  445. package/dist/types/index.d.ts +7 -4
  446. package/package.json +6 -6
  447. package/dist/esm/BaseDropdown/BaseDropdownContext/BaseDropdownContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Focus.js","sources":["../../../src/Focus/Focus.tsx"],"sourcesContent":["import { cloneElement, useState } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { isBrowser } from \"../utils/browser\";\nimport { ConditionalWrapper } from \"../utils/ConditionalWrapper\";\nimport { isKey, isOneOfKeys } from \"../utils/keyboardUtils\";\nimport { staticClasses, useClasses } from \"./Focus.styles\";\nimport { getFocusableChildren, setFocusTo } from \"./utils\";\n\nexport { staticClasses as focusClasses };\nexport type HvFocusClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFocusStrategies = \"listbox\" | \"menu\" | \"card\" | \"grid\";\n\nexport interface HvFocusProps extends HvBaseProps<HTMLElement, \"children\"> {\n children: React.ReactElement;\n /** Extra configuration for the child element. */\n configuration?: {\n tabIndex?: number;\n };\n /** Indicates that the disabled class should be applied. */\n disabledClass?: boolean;\n /** Whether the focus is selected. */\n selected?: boolean;\n /** Whether the focus is disabled. */\n disabled?: boolean;\n /** The reference to the root element to hold all Focus' context. */\n rootRef?: React.RefObject<HTMLElement>;\n /** Show focus when click element. v */\n focusOnClick?: boolean;\n /** Show focus when click element. v */\n focusDisabled?: boolean;\n /** Focus and navigation strategy to be used. v */\n strategy?: HvFocusStrategies;\n /** Uses an absolute positioned div as a focus. v */\n useFalseFocus?: boolean;\n /** Narrows the results of the focus to only theses class v */\n filterClass?: string;\n /** How much the navigation will skip when using the arrows. v */\n navigationJump?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFocusClasses;\n}\n\ninterface Focuses {\n first: Element;\n last: Element;\n previous: Element;\n next: Element;\n fall: Element;\n jump: Element;\n}\n\nexport const HvFocus = ({\n classes: classesProp,\n children,\n configuration = {},\n disabledClass = false,\n selected = false,\n disabled = false,\n rootRef = undefined,\n focusOnClick = false,\n focusDisabled = true,\n strategy = \"listbox\",\n useFalseFocus = false,\n filterClass,\n navigationJump = 4,\n}: HvFocusProps) => {\n const [showFocus, setShowFocus] = useState<boolean>(false);\n const [childFocus, setChildFocus] = useState<any>();\n const [hasRunConfig, setHasRunConfig] = useState(false);\n const { classes, cx } = useClasses(classesProp);\n\n const getFocuses = () => {\n const focuses = rootRef?.current\n ? Array.from(\n rootRef.current.getElementsByClassName(\n filterClass || staticClasses.root || \"root\",\n ),\n )\n : [];\n return focuses;\n };\n\n const setTabIndex = (el: any, tabIndex = 0) => {\n if (!el) return;\n const elChildFocus = getFocusableChildren(el)[0];\n if (elChildFocus) {\n el.tabIndex = -1;\n elChildFocus.tabIndex = tabIndex;\n } else {\n el.tabIndex = tabIndex;\n }\n };\n\n const setSelectedTabIndex = () => {\n const focuses = getFocuses();\n const firstSelected = focuses.find((focus) =>\n focus.classList.contains(classes.selected || \"selected\"),\n );\n\n if (!firstSelected) return;\n focuses.forEach((focus) => setTabIndex(focus, -1));\n setTabIndex(firstSelected, 0);\n };\n\n const clearTabSiblings = (el: any) => {\n getFocuses().forEach((focus) => setTabIndex(focus, -1));\n setTabIndex(el, 0);\n };\n\n const onFocusStrategy = (evt: any) => {\n if (strategy === \"listbox\") {\n clearTabSiblings(evt.currentTarget);\n }\n };\n\n const onBlurStrategy = () => {\n if (\n strategy === \"listbox\" &&\n rootRef &&\n rootRef.current &&\n !rootRef.current.contains(document.activeElement)\n ) {\n setTimeout(() => {\n setSelectedTabIndex();\n }, 10);\n }\n };\n\n const config = (el: any) => {\n const { tabIndex } = configuration;\n if (!el || hasRunConfig) return;\n if (strategy === \"card\") {\n setChildFocus(children);\n return;\n }\n\n if (strategy === \"grid\") {\n return;\n }\n\n const focusableChildren = getFocusableChildren(el);\n if (focusableChildren.length) {\n focusableChildren.forEach((child: any) => setTabIndex(child, -1));\n setChildFocus(focusableChildren[0]);\n }\n\n if (tabIndex != null) setTabIndex(el, tabIndex);\n setHasRunConfig(true);\n };\n\n const addFocusClass = (evt: any) => {\n if (!useFalseFocus) {\n // evt.currentTarget.classList.add(classes.focused);\n classes.focused\n .split(\" \")\n .forEach((c) => evt.currentTarget.classList.add(c));\n // add global class HvIsFocused as a marker\n // not to be styled directly, only as helper in specific css queries\n evt.currentTarget.classList.add(\"HvIsFocused\");\n classes?.focus\n ?.split(\" \")\n .forEach((c) => evt.currentTarget.classList.add(c));\n }\n };\n\n const removeFocusClass = () => {\n if (!useFalseFocus) {\n getFocuses().forEach((element) => {\n // element.classList.remove(classes.focused);\n classes.focused.split(\" \").forEach((c) => element.classList.remove(c));\n // remove the global class HvIsFocused\n element.classList.remove(\"HvIsFocused\");\n classes?.focus?.split(\" \").forEach((c) => element.classList.remove(c));\n });\n }\n };\n\n const onFocus = (evt: any) => {\n addFocusClass(evt);\n setShowFocus(true);\n // give focus to child element if any focusable\n\n childFocus?.focus?.();\n onFocusStrategy(evt);\n };\n\n const onBlur = () => {\n setShowFocus(false);\n removeFocusClass();\n onBlurStrategy();\n };\n\n const onMouseDown = (evt: any) => {\n const hasCard = !!evt.currentTarget?.querySelector(\".HvIsCardGridElement\");\n if (strategy === \"grid\" && hasCard) return;\n\n setFocusTo(evt.currentTarget);\n setTabIndex(evt.currentTarget, 0);\n // remove focus outline unless explicitly enabled\n if (!focusOnClick) {\n // TODO this piece of code works only because onMouseDown is happening after the focus event\n // There is nothing in here that guarantees the order of these events, so it may present a problem in the future\n removeFocusClass();\n setShowFocus(false);\n }\n };\n\n const focusAndUpdateIndex = (\n nextFocus: Element,\n previousFocus: any,\n focusesList: Element[],\n ) => {\n if (focusesList?.includes(previousFocus)) {\n setTabIndex(previousFocus, -1);\n }\n setTabIndex(nextFocus, 0);\n setFocusTo(nextFocus);\n };\n\n const getEnabledKeys = (\n currentFocusIndex: number,\n jump: number,\n listSize: number,\n ) => ({\n right:\n (currentFocusIndex + 1) % jump === 0 ||\n currentFocusIndex + 1 > listSize - 1,\n left: currentFocusIndex % jump === 0,\n up: currentFocusIndex - jump < 0,\n down:\n currentFocusIndex + jump > listSize ||\n currentFocusIndex + jump > listSize - 1,\n });\n\n const onGridKeyDownHandler = (\n evt: any,\n focuses: Focuses,\n focusesList: Element[],\n currentFocusIndex: number,\n jump: number,\n ) => {\n const childFocusIsInput = childFocus && childFocus.nodeName === \"INPUT\";\n\n if (\n !isOneOfKeys(evt, [\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n \"Space\",\n \"Enter\",\n ]) ||\n (childFocusIsInput && isKey(evt, \"Enter\"))\n ) {\n // nothing to do\n return;\n }\n\n // we'll do something with the key so prevent default and stop propagation\n // except for Enter and SpaceBar\n if (!isOneOfKeys(evt, [\"Enter\", \"Space\"])) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n const blockedKeys = getEnabledKeys(\n currentFocusIndex,\n jump,\n focusesList.length,\n );\n\n switch (evt.code) {\n case \"Space\":\n case \"Enter\":\n if (isBrowser(\"firefox\")) {\n evt.target.click();\n } else {\n evt.currentTarget.click();\n }\n break;\n case \"ArrowUp\":\n if (!blockedKeys.up) {\n focusAndUpdateIndex(\n focuses.jump || focuses.last,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"ArrowDown\":\n if (!blockedKeys.down) {\n focusAndUpdateIndex(\n focuses.fall || focuses.first,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"ArrowLeft\":\n if (!blockedKeys.left) {\n focusAndUpdateIndex(\n focuses.previous || focuses.last,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"ArrowRight\":\n if (!blockedKeys.right) {\n focusAndUpdateIndex(\n focuses.next || focuses.first,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"Home\":\n focusAndUpdateIndex(focuses.first, evt.current, focusesList);\n break;\n case \"End\":\n focusAndUpdateIndex(focuses.last, evt.current, focusesList);\n break;\n default:\n }\n };\n\n const onVerticalArrangementHandler = (\n evt: any,\n focuses: Focuses,\n focusesList: Element[],\n ) => {\n const childFocusIsInput = childFocus && childFocus.nodeName === \"INPUT\";\n\n if (\n !isOneOfKeys(evt, [\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"Space\",\n \"Enter\",\n ]) ||\n (childFocusIsInput && isKey(evt, \"Enter\"))\n ) {\n // nothing to do\n return;\n }\n\n // we'll do something with the key so prevent default and stop propagation\n evt.preventDefault();\n evt.stopPropagation();\n\n switch (evt.code) {\n case \"Space\":\n case \"Enter\":\n evt.target.click();\n break;\n case \"ArrowUp\":\n focusAndUpdateIndex(\n focuses.previous || focuses.last,\n evt.current,\n focusesList,\n );\n break;\n case \"ArrowDown\":\n focusAndUpdateIndex(\n focuses.next || focuses.first,\n evt.current,\n focusesList,\n );\n break;\n case \"Home\":\n focusAndUpdateIndex(focuses.first, evt.current, focusesList);\n break;\n case \"End\":\n focusAndUpdateIndex(focuses.last, evt.current, focusesList);\n break;\n default:\n }\n };\n\n const onSingleHandler = (evt: any) => {\n const childFocusIsInput = childFocus && childFocus.nodeName === \"INPUT\";\n\n if (\n !isOneOfKeys(evt, [\"Space\", \"Enter\"]) ||\n (childFocusIsInput && isKey(evt, \"Enter\"))\n ) {\n // nothing to do\n return;\n }\n\n // we'll do something with the key so prevent default and stop propagation\n evt.preventDefault();\n evt.stopPropagation();\n\n evt.currentTarget.click();\n };\n\n const onKeyDown = (evt: any) => {\n if (rootRef?.current == null) {\n // operating outside of a composite widget\n // nothing to manage, just style and trigger clicks\n onSingleHandler(evt);\n return;\n }\n\n // TODO keep the smart default, but allow to explicitly override if disabled elements should be focusable\n const isDisabledFocusable = strategy === \"menu\";\n const focusesList = getFocuses().filter(\n (el) =>\n isDisabledFocusable ||\n !el.classList.contains(classes?.disabled as string),\n );\n\n const currentFocus = focusesList.indexOf(evt.currentTarget);\n\n const focuses: Focuses = {\n first: focusesList[0],\n last: focusesList[focusesList.length - 1],\n previous: focusesList[currentFocus - 1],\n next: focusesList[currentFocus + 1],\n fall: focusesList[currentFocus + navigationJump],\n jump: focusesList[currentFocus - navigationJump],\n };\n\n if (strategy === \"grid\") {\n onGridKeyDownHandler(\n evt,\n focuses,\n focusesList,\n currentFocus,\n navigationJump,\n );\n return;\n }\n\n // TODO add property for specifying the composite widget orientation\n // TODO implement handler for horizontal orientation\n onVerticalArrangementHandler(evt, focuses, focusesList);\n };\n\n const onKeyUp = (evt: any) => {\n if (isBrowser(\"firefox\")) evt.preventDefault();\n };\n\n if (disabled) return children;\n\n const focusWrapper = (childrenToWrap: React.ReactNode) => (\n <div className={classes.externalReference}>\n {childrenToWrap}\n {showFocus && <div className={classes.falseFocus} />}\n </div>\n );\n\n return (\n <ConditionalWrapper condition={useFalseFocus} wrapper={focusWrapper}>\n {cloneElement(children, {\n className: cx(\n [classes.root, filterClass],\n {\n [classes.selected]: selected,\n [classes.disabled]: disabledClass,\n [classes.focusDisabled]: focusDisabled,\n },\n children.props.className,\n ),\n ref: config,\n onFocus,\n onBlur,\n onMouseDown,\n onKeyDown,\n onKeyUp,\n selected,\n })}\n </ConditionalWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsDO,MAAM,UAAU,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AAAA,EACV,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB;AAAA,EACA,iBAAiB;AACnB,MAAoB;AAClB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAkB,KAAK;AACzD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAc;AAClD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,aAAa,MAAM;AACjB,UAAA,UAAU,SAAS,UACrB,MAAM;AAAA,MACJ,QAAQ,QAAQ;AAAA,QACd,eAAe,cAAc,QAAQ;AAAA,MACvC;AAAA,QAEF;AACG,WAAA;AAAA,EAAA;AAGT,QAAM,cAAc,CAAC,IAAS,WAAW,MAAM;AAC7C,QAAI,CAAC,GAAI;AACT,UAAM,eAAe,qBAAqB,EAAE,EAAE,CAAC;AAC/C,QAAI,cAAc;AAChB,SAAG,WAAW;AACd,mBAAa,WAAW;AAAA,IAAA,OACnB;AACL,SAAG,WAAW;AAAA,IAChB;AAAA,EAAA;AAGF,QAAM,sBAAsB,MAAM;AAChC,UAAM,UAAU;AAChB,UAAM,gBAAgB,QAAQ;AAAA,MAAK,CAAC,UAClC,MAAM,UAAU,SAAS,QAAQ,YAAY,UAAU;AAAA,IAAA;AAGzD,QAAI,CAAC,cAAe;AACpB,YAAQ,QAAQ,CAAC,UAAU,YA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loneElement, useState } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { isBrowser } from \"../utils/browser\";\nimport { ConditionalWrapper } from \"../utils/ConditionalWrapper\";\nimport { isKey, isOneOfKeys } from \"../utils/keyboardUtils\";\nimport { staticClasses, useClasses } from \"./Focus.styles\";\nimport { getFocusableChildren, setFocusTo } from \"./utils\";\n\nexport { staticClasses as focusClasses };\nexport type HvFocusClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFocusStrategies = \"listbox\" | \"menu\" | \"card\" | \"grid\";\n\nexport interface HvFocusProps extends HvBaseProps<HTMLElement, \"children\"> {\n children: React.ReactElement;\n /** Extra configuration for the child element. */\n configuration?: {\n tabIndex?: number;\n };\n /** Indicates that the disabled class should be applied. */\n disabledClass?: boolean;\n /** Whether the focus is selected. */\n selected?: boolean;\n /** Whether the focus is disabled. */\n disabled?: boolean;\n /** The reference to the root element to hold all Focus' context. */\n rootRef?: React.RefObject<HTMLElement>;\n /** Show focus when click element. v */\n focusOnClick?: boolean;\n /** Show focus when click element. v */\n focusDisabled?: boolean;\n /** Focus and navigation strategy to be used. v */\n strategy?: HvFocusStrategies;\n /** Uses an absolute positioned div as a focus. v */\n useFalseFocus?: boolean;\n /** Narrows the results of the focus to only theses class v */\n filterClass?: string;\n /** How much the navigation will skip when using the arrows. v */\n navigationJump?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFocusClasses;\n}\n\ninterface Focuses {\n first: Element;\n last: Element;\n previous: Element;\n next: Element;\n fall: Element;\n jump: Element;\n}\n\nexport const HvFocus = ({\n classes: classesProp,\n children,\n configuration = {},\n disabledClass = false,\n selected = false,\n disabled = false,\n rootRef = undefined,\n focusOnClick = false,\n focusDisabled = true,\n strategy = \"listbox\",\n useFalseFocus = false,\n filterClass,\n navigationJump = 4,\n}: HvFocusProps) => {\n const [showFocus, setShowFocus] = useState<boolean>(false);\n const [childFocus, setChildFocus] = useState<any>();\n const [hasRunConfig, setHasRunConfig] = useState(false);\n const { classes, cx } = useClasses(classesProp);\n\n const getFocuses = () => {\n const focuses = rootRef?.current\n ? Array.from(\n rootRef.current.getElementsByClassName(\n filterClass || staticClasses.root || \"root\",\n ),\n )\n : [];\n return focuses;\n };\n\n const setTabIndex = (el: any, tabIndex = 0) => {\n if (!el) return;\n const elChildFocus = getFocusableChildren(el)[0];\n if (elChildFocus) {\n el.tabIndex = -1;\n elChildFocus.tabIndex = tabIndex;\n } else {\n el.tabIndex = tabIndex;\n }\n };\n\n const setSelectedTabIndex = () => {\n const focuses = getFocuses();\n const firstSelected = focuses.find((focus) =>\n focus.classList.contains(classes.selected || \"selected\"),\n );\n\n if (!firstSelected) return;\n focuses.forEach((focus) => setTabIndex(focus, -1));\n setTabIndex(firstSelected, 0);\n };\n\n const clearTabSiblings = (el: any) => {\n getFocuses().forEach((focus) => setTabIndex(focus, -1));\n setTabIndex(el, 0);\n };\n\n const onFocusStrategy = (evt: any) => {\n if (strategy === \"listbox\") {\n clearTabSiblings(evt.currentTarget);\n }\n };\n\n const onBlurStrategy = () => {\n if (\n strategy === \"listbox\" &&\n rootRef &&\n rootRef.current &&\n !rootRef.current.contains(document.activeElement)\n ) {\n setTimeout(() => {\n setSelectedTabIndex();\n }, 10);\n }\n };\n\n const config = (el: any) => {\n const { tabIndex } = configuration;\n if (!el || hasRunConfig) return;\n if (strategy === \"card\") {\n setChildFocus(children);\n return;\n }\n\n if (strategy === \"grid\") {\n return;\n }\n\n const focusableChildren = getFocusableChildren(el);\n if (focusableChildren.length) {\n focusableChildren.forEach((child: any) => setTabIndex(child, -1));\n setChildFocus(focusableChildren[0]);\n }\n\n if (tabIndex != null) setTabIndex(el, tabIndex);\n setHasRunConfig(true);\n };\n\n const addFocusClass = (evt: any) => {\n if (!useFalseFocus) {\n // evt.currentTarget.classList.add(classes.focused);\n classes.focused\n .split(\" \")\n .forEach((c) => evt.currentTarget.classList.add(c));\n // add global class HvIsFocused as a marker\n // not to be styled directly, only as helper in specific css queries\n evt.currentTarget.classList.add(\"HvIsFocused\");\n classes?.focus\n ?.split(\" \")\n .forEach((c) => evt.currentTarget.classList.add(c));\n }\n };\n\n const removeFocusClass = () => {\n if (!useFalseFocus) {\n getFocuses().forEach((element) => {\n // element.classList.remove(classes.focused);\n classes.focused.split(\" \").forEach((c) => element.classList.remove(c));\n // remove the global class HvIsFocused\n element.classList.remove(\"HvIsFocused\");\n classes?.focus?.split(\" \").forEach((c) => element.classList.remove(c));\n });\n }\n };\n\n const onFocus = (evt: any) => {\n addFocusClass(evt);\n setShowFocus(true);\n // give focus to child element if any focusable\n\n childFocus?.focus?.();\n onFocusStrategy(evt);\n };\n\n const onBlur = () => {\n setShowFocus(false);\n removeFocusClass();\n onBlurStrategy();\n };\n\n const onMouseDown = (evt: any) => {\n const hasCard = !!evt.currentTarget?.querySelector(\".HvIsCardGridElement\");\n if (strategy === \"grid\" && hasCard) return;\n\n setFocusTo(evt.currentTarget);\n setTabIndex(evt.currentTarget, 0);\n // remove focus outline unless explicitly enabled\n if (!focusOnClick) {\n // TODO this piece of code works only because onMouseDown is happening after the focus event\n // There is nothing in here that guarantees the order of these events, so it may present a problem in the future\n removeFocusClass();\n setShowFocus(false);\n }\n };\n\n const focusAndUpdateIndex = (\n nextFocus: Element,\n previousFocus: any,\n focusesList: Element[],\n ) => {\n if (focusesList?.includes(previousFocus)) {\n setTabIndex(previousFocus, -1);\n }\n setTabIndex(nextFocus, 0);\n setFocusTo(nextFocus);\n };\n\n const getEnabledKeys = (\n currentFocusIndex: number,\n jump: number,\n listSize: number,\n ) => ({\n right:\n (currentFocusIndex + 1) % jump === 0 ||\n currentFocusIndex + 1 > listSize - 1,\n left: currentFocusIndex % jump === 0,\n up: currentFocusIndex - jump < 0,\n down:\n currentFocusIndex + jump > listSize ||\n currentFocusIndex + jump > listSize - 1,\n });\n\n const onGridKeyDownHandler = (\n evt: any,\n focuses: Focuses,\n focusesList: Element[],\n currentFocusIndex: number,\n jump: number,\n ) => {\n const childFocusIsInput = childFocus && childFocus.nodeName === \"INPUT\";\n\n if (\n !isOneOfKeys(evt, [\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n \"Space\",\n \"Enter\",\n ]) ||\n (childFocusIsInput && isKey(evt, \"Enter\"))\n ) {\n // nothing to do\n return;\n }\n\n // we'll do something with the key so prevent default and stop propagation\n // except for Enter and SpaceBar\n if (!isOneOfKeys(evt, [\"Enter\", \"Space\"])) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n const blockedKeys = getEnabledKeys(\n currentFocusIndex,\n jump,\n focusesList.length,\n );\n\n switch (evt.code) {\n case \"Space\":\n case \"Enter\":\n if (isBrowser(\"firefox\")) {\n evt.target.click();\n } else {\n evt.currentTarget.click();\n }\n break;\n case \"ArrowUp\":\n if (!blockedKeys.up) {\n focusAndUpdateIndex(\n focuses.jump || focuses.last,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"ArrowDown\":\n if (!blockedKeys.down) {\n focusAndUpdateIndex(\n focuses.fall || focuses.first,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"ArrowLeft\":\n if (!blockedKeys.left) {\n focusAndUpdateIndex(\n focuses.previous || focuses.last,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"ArrowRight\":\n if (!blockedKeys.right) {\n focusAndUpdateIndex(\n focuses.next || focuses.first,\n evt.current,\n focusesList,\n );\n }\n break;\n case \"Home\":\n focusAndUpdateIndex(focuses.first, evt.current, focusesList);\n break;\n case \"End\":\n focusAndUpdateIndex(focuses.last, evt.current, focusesList);\n break;\n default:\n }\n };\n\n const onVerticalArrangementHandler = (\n evt: any,\n focuses: Focuses,\n focusesList: Element[],\n ) => {\n const childFocusIsInput = childFocus && childFocus.nodeName === \"INPUT\";\n\n if (\n !isOneOfKeys(evt, [\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"Space\",\n \"Enter\",\n ]) ||\n (childFocusIsInput && isKey(evt, \"Enter\"))\n ) {\n // nothing to do\n return;\n }\n\n // we'll do something with the key so prevent default and stop propagation\n evt.preventDefault();\n evt.stopPropagation();\n\n switch (evt.code) {\n case \"Space\":\n case \"Enter\":\n evt.target.click();\n break;\n case \"ArrowUp\":\n focusAndUpdateIndex(\n focuses.previous || focuses.last,\n evt.current,\n focusesList,\n );\n break;\n case \"ArrowDown\":\n focusAndUpdateIndex(\n focuses.next || focuses.first,\n evt.current,\n focusesList,\n );\n break;\n case \"Home\":\n focusAndUpdateIndex(focuses.first, evt.current, focusesList);\n break;\n case \"End\":\n focusAndUpdateIndex(focuses.last, evt.current, focusesList);\n break;\n default:\n }\n };\n\n const onSingleHandler = (evt: any) => {\n const childFocusIsInput = childFocus && childFocus.nodeName === \"INPUT\";\n\n if (\n !isOneOfKeys(evt, [\"Space\", \"Enter\"]) ||\n (childFocusIsInput && isKey(evt, \"Enter\"))\n ) {\n // nothing to do\n return;\n }\n\n // we'll do something with the key so prevent default and stop propagation\n evt.preventDefault();\n evt.stopPropagation();\n\n evt.currentTarget.click();\n };\n\n const onKeyDown = (evt: any) => {\n if (rootRef?.current == null) {\n // operating outside of a composite widget\n // nothing to manage, just style and trigger clicks\n onSingleHandler(evt);\n return;\n }\n\n // TODO keep the smart default, but allow to explicitly override if disabled elements should be focusable\n const isDisabledFocusable = strategy === \"menu\";\n const focusesList = getFocuses().filter(\n (el) =>\n isDisabledFocusable ||\n !el.classList.contains(classes?.disabled as string),\n );\n\n const currentFocus = focusesList.indexOf(evt.currentTarget);\n\n const focuses: Focuses = {\n first: focusesList[0],\n last: focusesList[focusesList.length - 1],\n previous: focusesList[currentFocus - 1],\n next: focusesList[currentFocus + 1],\n fall: focusesList[currentFocus + navigationJump],\n jump: focusesList[currentFocus - navigationJump],\n };\n\n if (strategy === \"grid\") {\n onGridKeyDownHandler(\n evt,\n focuses,\n focusesList,\n currentFocus,\n navigationJump,\n );\n return;\n }\n\n // TODO add property for specifying the composite widget orientation\n // TODO implement handler for horizontal orientation\n onVerticalArrangementHandler(evt, focuses, focusesList);\n };\n\n const onKeyUp = (evt: any) => {\n if (isBrowser(\"firefox\")) evt.preventDefault();\n };\n\n if (disabled) return children;\n\n const focusWrapper = (childrenToWrap: React.ReactNode) => (\n <div className={classes.externalReference}>\n {childrenToWrap}\n {showFocus && <div className={classes.falseFocus} />}\n </div>\n );\n\n return (\n <ConditionalWrapper condition={useFalseFocus} wrapper={focusWrapper}>\n {cloneElement(children, {\n className: cx(\n [classes.root, filterClass],\n {\n [classes.selected]: selected,\n [classes.disabled]: disabledClass,\n [classes.focusDisabled]: focusDisabled,\n },\n children.props.className,\n ),\n ref: config,\n onFocus,\n onBlur,\n onMouseDown,\n onKeyDown,\n onKeyUp,\n selected,\n })}\n </ConditionalWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsDO,MAAM,UAAU,CAAC;AAAA,EACtB,SAAS;AAAA,EACT;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AAAA,EACV,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB;AAAA,EACA,iBAAiB;AACnB,MAAoB;AAClB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAkB,KAAK;AACzD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAc;AAClD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,aAAa,MAAM;AACjB,UAAA,UAAU,SAAS,UACrB,MAAM;AAAA,MACJ,QAAQ,QAAQ;AAAA,QACd,eAAe,cAAc,QAAQ;AAAA,MAAA;AAAA,IACvC,IAEF,CAAC;AACE,WAAA;AAAA,EACT;AAEA,QAAM,cAAc,CAAC,IAAS,WAAW,MAAM;AAC7C,QAAI,CAAC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AA,WAAW,eAAe,SAAS,cACpD,uBAAa,UAAU;AAAA,IACtB,WAAW;AAAA,MACT,CAAC,QAAQ,MAAM,WAAW;AAAA,MAC1B;AAAA,QACE,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACpB,CAAC,QAAQ,aAAa,GAAG;AAAA,MAC3B;AAAA,MACA,SAAS,MAAM;AAAA,IACjB;AAAA,IACA,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAA,GACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Focus.styles.js","sources":["../../../src/Focus/Focus.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFocus\", {\n root: {},\n selected: {},\n disabled: {},\n focusDisabled: {\n outline: \"none\",\n \"& *:focus\": {\n outline: \"none\",\n },\n \"& *\": {\n outline: \"none !important\",\n },\n },\n focused: {\n ...outlineStyles,\n \"@media (-webkit-min-device-pixel-ratio:0)\": {\n ...outlineStyles,\n },\n },\n externalReference: {\n position: \"relative\",\n },\n falseFocus: {\n width: \"98%\",\n height: \"98%\",\n position: \"absolute\",\n zIndex: \"1\",\n ...outlineStyles,\n \"@media (-webkit-min-device-pixel-ratio:0)\": {\n ...outlineStyles,\n },\n top: 0,\n left: \"0.5%\",\n backgroundColor: \"transparent\",\n pointerEvents: \"none\",\n },\n focus: {},\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,WAAW;AAAA,EACpE,MAAM,CAAC;AAAA,EACP,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,IACb,SAAS;AAAA,IACT,aAAa;AAAA,MACX,SAAS;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,GAAG;AAAA,IACH,6CAA6C;AAAA,MAC3C,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,GAAG;AAAA,IACH,6CAA6C;AAAA,MAC3C,GAAG;AAAA,IACL;AAAA,IACA,KAAK;AAAA,IACL,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,eAAe;AAAA,EACjB;AAAA,EACA,OAAO,CAAC;AACV,CAAC;"}
1
+ {"version":3,"file":"Focus.styles.js","sources":["../../../src/Focus/Focus.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFocus\", {\n root: {},\n selected: {},\n disabled: {},\n focusDisabled: {\n outline: \"none\",\n \"& *:focus\": {\n outline: \"none\",\n },\n \"& *\": {\n outline: \"none !important\",\n },\n },\n focused: {\n ...outlineStyles,\n \"@media (-webkit-min-device-pixel-ratio:0)\": {\n ...outlineStyles,\n },\n },\n externalReference: {\n position: \"relative\",\n },\n falseFocus: {\n width: \"98%\",\n height: \"98%\",\n position: \"absolute\",\n zIndex: \"1\",\n ...outlineStyles,\n \"@media (-webkit-min-device-pixel-ratio:0)\": {\n ...outlineStyles,\n },\n top: 0,\n left: \"0.5%\",\n backgroundColor: \"transparent\",\n pointerEvents: \"none\",\n },\n focus: {},\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,WAAW;AAAA,EACpE,MAAM,CAAC;AAAA,EACP,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,IACb,SAAS;AAAA,IACT,aAAa;AAAA,MACX,SAAS;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,SAAS;AAAA,IACP,GAAG;AAAA,IACH,6CAA6C;AAAA,MAC3C,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EACA,mBAAmB;AAAA,IACjB,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,GAAG;AAAA,IACH,6CAA6C;AAAA,MAC3C,GAAG;AAAA,IACL;AAAA,IACA,KAAK;AAAA,IACL,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,eAAe;AAAA,EACjB;AAAA,EACA,OAAO,CAAA;AACT,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/Focus/utils.ts"],"sourcesContent":["export const getFocusableChildren = (el: any) =>\n el?.querySelectorAll(\"input, button, select, textarea, a[href]\") || [];\n\nexport const setFocusTo = (el: any) => {\n el.focus();\n};\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB,CAAC,OACnC,IAAI,iBAAiB,0CAA0C,KAAK,CAAC;AAE1D,MAAA,aAAa,CAAC,OAAY;AACrC,KAAG,MAAM;AACX;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/Focus/utils.ts"],"sourcesContent":["export const getFocusableChildren = (el: any) =>\n el?.querySelectorAll(\"input, button, select, textarea, a[href]\") || [];\n\nexport const setFocusTo = (el: any) => {\n el.focus();\n};\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB,CAAC,OACnC,IAAI,iBAAiB,0CAA0C,KAAK,CAAA;AAEzD,MAAA,aAAa,CAAC,OAAY;AACrC,KAAG,MAAM;AACX;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.js","sources":["../../../src/Footer/Footer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { useTheme } from \"@mui/material/styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Footer.styles\";\n\nexport { staticClasses as footerClasses };\n\nexport type HvFooterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFooterProps extends HvBaseProps {\n /** Footer name. */\n name?: React.ReactNode;\n /** Footer copyright. */\n copyright?: React.ReactNode;\n /** Footer links. */\n links?: React.ReactNode;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFooterClasses;\n}\n\n/**\n * A Footer is a way of providing extra information at the end of a page.\n */\nexport const HvFooter = forwardRef<\n // no-indent\n React.ComponentRef<\"footer\">,\n HvFooterProps\n>(function HvFooter(props, ref) {\n const {\n name = \"Hitachi Vantara\",\n copyright = `© Hitachi Vantara LLC ${new Date().getFullYear()}. All Rights Reserved.`,\n links,\n classes: classesProp,\n className,\n ...others\n } = useDefaultProps(\"HvFooter\", props);\n const muiTheme = useTheme();\n const { classes, cx } = useClasses(classesProp);\n\n const isSmDown = useMediaQuery(muiTheme.breakpoints.down(\"sm\"));\n\n return (\n <footer\n ref={ref}\n className={cx(classes.root, { [classes.small]: isSmDown }, className)}\n {...others}\n >\n <HvTypography variant=\"label\" className={classes.name}>\n {name}\n </HvTypography>\n <div className={classes.rightContainer}>\n <HvTypography className={classes.copyright}>{copyright}</HvTypography>\n {links && <div className={classes.separator} />}\n {links}\n </div>\n </footer>\n );\n});\n"],"names":["HvFooter"],"mappings":";;;;;;;;AA8BO,MAAM,WAAW,WAItB,SAASA,UAAS,OAAO,KAAK;AACxB,QAAA;AAAA,IACJ,OAAO;AAAA,IACP,YAAY,0BAAyB,oBAAI,KAAK,GAAE,YAAa,CAAA;AAAA,IAC7D;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,WAAW;AACjB,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,WAAW,cAAc,SAAS,YAAY,KAAK,IAAI,CAAC;AAG5D,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,KAAK,GAAG,SAAS,GAAG,SAAS;AAAA,MACnE,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,gBAAa,SAAQ,SAAQ,WAAW,QAAQ,MAC9C,UACH,MAAA;AAAA,QACC,qBAAA,OAAA,EAAI,WAAW,QAAQ,gBACtB,UAAA;AAAA,UAAA,oBAAC,cAAa,EAAA,WAAW,QAAQ,WAAY,UAAU,WAAA;AAAA,UACtD,SAAS,oBAAC,OAAI,EAAA,WAAW,QAAQ,WAAW;AAAA,UAC5C;AAAA,QAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"Footer.js","sources":["../../../src/Footer/Footer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { useTheme } from \"@mui/material/styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Footer.styles\";\n\nexport { staticClasses as footerClasses };\n\nexport type HvFooterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFooterProps extends HvBaseProps {\n /** Footer name. */\n name?: React.ReactNode;\n /** Footer copyright. */\n copyright?: React.ReactNode;\n /** Footer links. */\n links?: React.ReactNode;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFooterClasses;\n}\n\n/**\n * A Footer is a way of providing extra information at the end of a page.\n */\nexport const HvFooter = forwardRef<\n // no-indent\n React.ComponentRef<\"footer\">,\n HvFooterProps\n>(function HvFooter(props, ref) {\n const {\n name = \"Hitachi Vantara\",\n copyright = `© Hitachi Vantara LLC ${new Date().getFullYear()}. All Rights Reserved.`,\n links,\n classes: classesProp,\n className,\n ...others\n } = useDefaultProps(\"HvFooter\", props);\n const muiTheme = useTheme();\n const { classes, cx } = useClasses(classesProp);\n\n const isSmDown = useMediaQuery(muiTheme.breakpoints.down(\"sm\"));\n\n return (\n <footer\n ref={ref}\n className={cx(classes.root, { [classes.small]: isSmDown }, className)}\n {...others}\n >\n <HvTypography variant=\"label\" className={classes.name}>\n {name}\n </HvTypography>\n <div className={classes.rightContainer}>\n <HvTypography className={classes.copyright}>{copyright}</HvTypography>\n {links && <div className={classes.separator} />}\n {links}\n </div>\n </footer>\n );\n});\n"],"names":["HvFooter"],"mappings":";;;;;;;;AA8BO,MAAM,WAAW,WAItB,SAASA,UAAS,OAAO,KAAK;AACxB,QAAA;AAAA,IACJ,OAAO;AAAA,IACP,YAAY,0BAAyB,oBAAI,KAAK,GAAE,YAAa,CAAA;AAAA,IAC7D;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,WAAW,SAAS;AAC1B,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,WAAW,cAAc,SAAS,YAAY,KAAK,IAAI,CAAC;AAG5D,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,KAAK,GAAG,SAAS,GAAG,SAAS;AAAA,MACnE,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,gBAAa,SAAQ,SAAQ,WAAW,QAAQ,MAC9C,UACH,MAAA;AAAA,QACC,qBAAA,OAAA,EAAI,WAAW,QAAQ,gBACtB,UAAA;AAAA,UAAA,oBAAC,cAAa,EAAA,WAAW,QAAQ,WAAY,UAAU,WAAA;AAAA,UACtD,SAAS,oBAAC,OAAI,EAAA,WAAW,QAAQ,WAAW;AAAA,UAC5C;AAAA,QAAA,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.styles.js","sources":["../../../src/Footer/Footer.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFooter\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n padding: `${theme.space.xs} ${theme.space.sm}`,\n height: 40,\n bottom: 0,\n zIndex: theme.zIndices.base,\n backgroundColor: theme.colors.atmo1,\n boxShadow: `0 -1px 0 ${theme.colors.atmo4}`,\n },\n name: {},\n rightContainer: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n marginLeft: \"auto\",\n },\n copyright: {},\n separator: {\n width: 1,\n height: 16,\n backgroundColor: theme.colors.secondary,\n margin: `${theme.space.xs} ${theme.space.sm}`,\n },\n small: {\n \"&$root\": {\n height: \"unset\",\n flexDirection: \"column\",\n padding: theme.space.xs,\n },\n \"& $name\": {\n marginBottom: theme.space.xs,\n },\n \"& $rightContainer\": {\n flexDirection: \"column\",\n textAlign: \"center\",\n marginLeft: \"unset\",\n },\n \"& $copyright\": {\n flexDirection: \"column\",\n marginBottom: theme.space.xs,\n },\n \"& $separator\": { display: \"none\" },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,SAAS,GAAG,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,IAC5C,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ,MAAM,SAAS;AAAA,IACvB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,YAAY,MAAM,OAAO,KAAK;AAAA,EAC3C;AAAA,EACA,MAAM,CAAC;AAAA,EACP,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,QAAQ,GAAG,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,EAC7C;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,SAAS,MAAM,MAAM;AAAA,IACvB;AAAA,IACA,WAAW;AAAA,MACT,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,qBAAqB;AAAA,MACnB,eAAe;AAAA,MACf,WAAW;AAAA,MACX,YAAY;AAAA,IACd;AAAA,IACA,gBAAgB;AAAA,MACd,eAAe;AAAA,MACf,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,gBAAgB,EAAE,SAAS,OAAO;AAAA,EACpC;AACF,CAAC;"}
1
+ {"version":3,"file":"Footer.styles.js","sources":["../../../src/Footer/Footer.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFooter\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n padding: `${theme.space.xs} ${theme.space.sm}`,\n height: 40,\n bottom: 0,\n zIndex: theme.zIndices.base,\n backgroundColor: theme.colors.atmo1,\n boxShadow: `0 -1px 0 ${theme.colors.atmo4}`,\n },\n name: {},\n rightContainer: {\n display: \"flex\",\n alignItems: \"center\",\n flexDirection: \"row\",\n marginLeft: \"auto\",\n },\n copyright: {},\n separator: {\n width: 1,\n height: 16,\n backgroundColor: theme.colors.secondary,\n margin: `${theme.space.xs} ${theme.space.sm}`,\n },\n small: {\n \"&$root\": {\n height: \"unset\",\n flexDirection: \"column\",\n padding: theme.space.xs,\n },\n \"& $name\": {\n marginBottom: theme.space.xs,\n },\n \"& $rightContainer\": {\n flexDirection: \"column\",\n textAlign: \"center\",\n marginLeft: \"unset\",\n },\n \"& $copyright\": {\n flexDirection: \"column\",\n marginBottom: theme.space.xs,\n },\n \"& $separator\": { display: \"none\" },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,SAAS,GAAG,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,IAC5C,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ,MAAM,SAAS;AAAA,IACvB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,YAAY,MAAM,OAAO,KAAK;AAAA,EAC3C;AAAA,EACA,MAAM,CAAC;AAAA,EACP,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,QAAQ,GAAG,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,EAC7C;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,SAAS,MAAM,MAAM;AAAA,IACvB;AAAA,IACA,WAAW;AAAA,MACT,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,qBAAqB;AAAA,MACnB,eAAe;AAAA,MACf,WAAW;AAAA,MACX,YAAY;AAAA,IACd;AAAA,IACA,gBAAgB;AAAA,MACd,eAAe;AAAA,MACf,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,gBAAgB,EAAE,SAAS,OAAO;AAAA,EAAA;AAEtC,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Adornment.js","sources":["../../../../src/Forms/Adornment/Adornment.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n HvFormStatus,\n} from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./Adornment.styles\";\n\nconst noop = () => {};\n\nexport { staticClasses as adornmentClasses };\n\nexport type HvAdornmentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAdornmentProps\n extends HvBaseProps<\n HTMLDivElement | HTMLButtonElement,\n \"onMouseDown\" | \"onKeyDown\"\n > {\n /** The icon to be added into the input. */\n icon: React.ReactNode;\n /** When the adornment should be displayed. */\n showWhen?: HvFormStatus;\n /** Function to be executed when this element is clicked. */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** If this property is defined the adornment visibility will be exclusively controlled by this value. */\n isVisible?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAdornmentClasses;\n}\n\n/**\n * Allows to add a decorative icon or an action to a form element, usually on the right side of an input.\n * E.g., the reveal password button.\n *\n * In addition to the showWhen feature, which uses the form element's context validation state to determine\n * its visibility, this component also ensures that it does not steal focus from the input and that it is\n * not accessible using the keyboard.\n *\n * As such, its functionality, if any, for accessibility purposes must be provided through an alternative mean,\n * or by using a regular icon button or toggle button instead.\n */\nexport const HvAdornment = forwardRef<\n HTMLDivElement | HTMLButtonElement,\n HvAdornmentProps\n>(\n (\n {\n id,\n classes: classesProp,\n className,\n icon,\n showWhen = undefined,\n onClick,\n isVisible = undefined,\n ...others\n },\n ref,\n ) => {\n const { classes, cx } = useClasses(classesProp);\n\n const { elementStatus = \"\", elementDisabled } =\n useContext(HvFormElementContext);\n\n const { input } = useContext(HvFormElementDescriptorsContext);\n\n const displayIcon =\n isVisible ?? (showWhen === undefined || elementStatus === showWhen);\n\n const isClickable = !!onClick;\n\n return isClickable ? (\n <button\n id={id}\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n type=\"button\"\n tabIndex={-1}\n aria-controls={input?.[0]?.id}\n className={cx(\n classes.root,\n classes.adornment,\n classes.adornmentButton,\n {\n [classes.hideIcon]: !displayIcon,\n [classes.disabled]: elementDisabled,\n },\n className,\n )}\n onClick={onClick}\n onMouseDown={(event) => event.preventDefault()}\n onKeyDown={noop}\n disabled={elementDisabled}\n aria-disabled={elementDisabled}\n {...others}\n >\n <div className={classes.icon}>{icon}</div>\n </button>\n ) : (\n <div\n id={id}\n ref={ref as React.ForwardedRef<HTMLDivElement>}\n className={cx(\n classes.root,\n classes.adornment,\n classes.adornmentIcon,\n {\n [classes.hideIcon]: !displayIcon,\n [classes.disabled]: elementDisabled,\n },\n className,\n )}\n role=\"presentation\"\n {...others}\n >\n <div className={classes.icon}>{icon}</div>\n </div>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,OAAO,MAAM;AAAC;AAkCb,MAAM,cAAc;AAAA,EAIzB,CACE;AAAA,IACE;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,KAEL,QACG;AACH,UAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,UAAM,EAAE,gBAAgB,IAAI,gBAAgB,IAC1C,WAAW,oBAAoB;AAEjC,UAAM,EAAE,MAAA,IAAU,WAAW,+BAA+B;AAE5D,UAAM,cACJ,cAAc,aAAa,UAAa,kBAAkB;AAEtD,UAAA,cAAc,CAAC,CAAC;AAEtB,WAAO,cACL;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QACL,UAAU;AAAA,QACV,iBAAe,QAAQ,CAAC,GAAG;AAAA,QAC3B,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,YACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA,aAAa,CAAC,UAAU,MAAM,eAAe;AAAA,QAC7C,WAAW;AAAA,QACX,UAAU;AAAA,QACV,iBAAe;AAAA,QACd,GAAG;AAAA,QAEJ,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,MAAA;AAAA,MAAA;AAAA,IAAA,IAGtC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,YACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACA,MAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,MAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG1C;AACF;"}
1
+ {"version":3,"file":"Adornment.js","sources":["../../../../src/Forms/Adornment/Adornment.tsx"],"sourcesContent":["import { forwardRef, useContext } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n HvFormStatus,\n} from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./Adornment.styles\";\n\nconst noop = () => {};\n\nexport { staticClasses as adornmentClasses };\n\nexport type HvAdornmentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAdornmentProps\n extends HvBaseProps<\n HTMLDivElement | HTMLButtonElement,\n \"onMouseDown\" | \"onKeyDown\"\n > {\n /** The icon to be added into the input. */\n icon: React.ReactNode;\n /** When the adornment should be displayed. */\n showWhen?: HvFormStatus;\n /** Function to be executed when this element is clicked. */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /** If this property is defined the adornment visibility will be exclusively controlled by this value. */\n isVisible?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAdornmentClasses;\n}\n\n/**\n * Allows to add a decorative icon or an action to a form element, usually on the right side of an input.\n * E.g., the reveal password button.\n *\n * In addition to the showWhen feature, which uses the form element's context validation state to determine\n * its visibility, this component also ensures that it does not steal focus from the input and that it is\n * not accessible using the keyboard.\n *\n * As such, its functionality, if any, for accessibility purposes must be provided through an alternative mean,\n * or by using a regular icon button or toggle button instead.\n */\nexport const HvAdornment = forwardRef<\n HTMLDivElement | HTMLButtonElement,\n HvAdornmentProps\n>(\n (\n {\n id,\n classes: classesProp,\n className,\n icon,\n showWhen = undefined,\n onClick,\n isVisible = undefined,\n ...others\n },\n ref,\n ) => {\n const { classes, cx } = useClasses(classesProp);\n\n const { elementStatus = \"\", elementDisabled } =\n useContext(HvFormElementContext);\n\n const { input } = useContext(HvFormElementDescriptorsContext);\n\n const displayIcon =\n isVisible ?? (showWhen === undefined || elementStatus === showWhen);\n\n const isClickable = !!onClick;\n\n return isClickable ? (\n <button\n id={id}\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\n type=\"button\"\n tabIndex={-1}\n aria-controls={input?.[0]?.id}\n className={cx(\n classes.root,\n classes.adornment,\n classes.adornmentButton,\n {\n [classes.hideIcon]: !displayIcon,\n [classes.disabled]: elementDisabled,\n },\n className,\n )}\n onClick={onClick}\n onMouseDown={(event) => event.preventDefault()}\n onKeyDown={noop}\n disabled={elementDisabled}\n aria-disabled={elementDisabled}\n {...others}\n >\n <div className={classes.icon}>{icon}</div>\n </button>\n ) : (\n <div\n id={id}\n ref={ref as React.ForwardedRef<HTMLDivElement>}\n className={cx(\n classes.root,\n classes.adornment,\n classes.adornmentIcon,\n {\n [classes.hideIcon]: !displayIcon,\n [classes.disabled]: elementDisabled,\n },\n className,\n )}\n role=\"presentation\"\n {...others}\n >\n <div className={classes.icon}>{icon}</div>\n </div>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,OAAO,MAAM;AAAC;AAkCb,MAAM,cAAc;AAAA,EAIzB,CACE;AAAA,IACE;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,KAEL,QACG;AACH,UAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,UAAM,EAAE,gBAAgB,IAAI,gBAAgB,IAC1C,WAAW,oBAAoB;AAEjC,UAAM,EAAE,MAAA,IAAU,WAAW,+BAA+B;AAE5D,UAAM,cACJ,cAAc,aAAa,UAAa,kBAAkB;AAEtD,UAAA,cAAc,CAAC,CAAC;AAEtB,WAAO,cACL;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QACL,UAAU;AAAA,QACV,iBAAe,QAAQ,CAAC,GAAG;AAAA,QAC3B,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,YACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACA,aAAa,CAAC,UAAU,MAAM,eAAe;AAAA,QAC7C,WAAW;AAAA,QACX,UAAU;AAAA,QACV,iBAAe;AAAA,QACd,GAAG;AAAA,QAEJ,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,KAAA,CAAA;AAAA,MAAA;AAAA,IAAA,IAGtC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,YACrB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACA,MAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,KAAA,CAAA;AAAA,MAAA;AAAA,IACtC;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Adornment.styles.js","sources":["../../../../src/Forms/Adornment/Adornment.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAdornment\", {\n root: {},\n icon: { width: 32, height: 32 },\n adornment: {\n backgroundColor: \"transparent\",\n border: \"none\",\n padding: 0,\n margin: 0,\n },\n adornmentIcon: { cursor: \"default\", pointerEvents: \"none\" },\n hideIcon: { display: \"none\" },\n adornmentButton: {\n cursor: \"pointer\",\n \"&:focus\": {\n ...outlineStyles,\n },\n },\n disabled: {\n \"&$adornmentButton\": { cursor: \"not-allowed\" },\n \"&$adornmentIcon\": { cursor: \"not-allowed\" },\n \"& svg *.color0\": { fill: theme.colors.secondary_60 },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM,CAAC;AAAA,EACP,MAAM,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,EAC9B,WAAW;AAAA,IACT,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,eAAe,EAAE,QAAQ,WAAW,eAAe,OAAO;AAAA,EAC1D,UAAU,EAAE,SAAS,OAAO;AAAA,EAC5B,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,WAAW;AAAA,MACT,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB,EAAE,QAAQ,cAAc;AAAA,IAC7C,mBAAmB,EAAE,QAAQ,cAAc;AAAA,IAC3C,kBAAkB,EAAE,MAAM,MAAM,OAAO,aAAa;AAAA,EACtD;AACF,CAAC;"}
1
+ {"version":3,"file":"Adornment.styles.js","sources":["../../../../src/Forms/Adornment/Adornment.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAdornment\", {\n root: {},\n icon: { width: 32, height: 32 },\n adornment: {\n backgroundColor: \"transparent\",\n border: \"none\",\n padding: 0,\n margin: 0,\n },\n adornmentIcon: { cursor: \"default\", pointerEvents: \"none\" },\n hideIcon: { display: \"none\" },\n adornmentButton: {\n cursor: \"pointer\",\n \"&:focus\": {\n ...outlineStyles,\n },\n },\n disabled: {\n \"&$adornmentButton\": { cursor: \"not-allowed\" },\n \"&$adornmentIcon\": { cursor: \"not-allowed\" },\n \"& svg *.color0\": { fill: theme.colors.secondary_60 },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM,CAAC;AAAA,EACP,MAAM,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,EAC9B,WAAW;AAAA,IACT,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,eAAe,EAAE,QAAQ,WAAW,eAAe,OAAO;AAAA,EAC1D,UAAU,EAAE,SAAS,OAAO;AAAA,EAC5B,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,WAAW;AAAA,MACT,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB,EAAE,QAAQ,cAAc;AAAA,IAC7C,mBAAmB,EAAE,QAAQ,cAAc;AAAA,IAC3C,kBAAkB,EAAE,MAAM,MAAM,OAAO,aAAa;AAAA,EAAA;AAExD,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CharCounter.js","sources":["../../../../src/Forms/CharCounter/CharCounter.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./CharCounter.styles\";\n\nexport { staticClasses as charCounterClasses };\n\nexport type HvCharCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCharCounterProps extends HvBaseProps {\n /** The string that separates the current char quantity from the max quantity. */\n separator?: string;\n /** The maximum allowed length of the characters. */\n maxCharQuantity: number;\n /** The current char quantity to be rendered. */\n currentCharQuantity?: number;\n /** If `true` the counter is disabled. */\n disabled?: boolean;\n /** If `true` the info message won't have margins. */\n disableGutter?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvCharCounterClasses;\n}\n\n/**\n * Displays the capacity and current usage of a text input box (character count by default).\n *\n * Use the character counter when there is a character or word limit.\n * By itself it doesn't block the user from going above the limit.\n */\nexport const HvCharCounter = (props: HvCharCounterProps) => {\n const {\n separator = \"/\",\n maxCharQuantity,\n currentCharQuantity = 0,\n classes: classesProp,\n className,\n id,\n disabled,\n disableGutter = false,\n ...others\n } = useDefaultProps(\"HvCharCounter\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localId = id ?? setId(elementId, \"counter\");\n const currentId = setId(localId, \"currentQuantity\");\n const maxQuantityId = setId(localId, \"maxQuantity\");\n const isOverloaded = currentCharQuantity > maxCharQuantity;\n\n return (\n <div\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.counterDisabled]: !!localDisabled,\n [classes.gutter]: !disableGutter,\n },\n className,\n )}\n aria-live=\"polite\"\n aria-disabled={localDisabled}\n {...others}\n >\n <HvTypography\n id={currentId}\n className={cx({\n [classes.overloaded]: isOverloaded && !localDisabled,\n [classes.counterDisabled]: !!localDisabled,\n })}\n variant=\"label\"\n component=\"label\"\n >\n {currentCharQuantity}\n </HvTypography>\n <HvTypography\n id={maxQuantityId}\n className={cx({\n [classes.overloaded]: isOverloaded && !localDisabled,\n [classes.counterDisabled]: !!localDisabled,\n })}\n variant=\"body\"\n component=\"label\"\n >\n {` ${separator} ${maxCharQuantity}`}\n </HvTypography>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAqCa,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA,sBAAsB;AAAA,IACtB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,gBAAgB,IAAI,WAAW,oBAAoB;AACtE,QAAM,gBAAgB,YAAY;AAClC,QAAM,UAAU,MAAM,MAAM,WAAW,SAAS;AAC1C,QAAA,YAAY,MAAM,SAAS,iBAAiB;AAC5C,QAAA,gBAAgB,MAAM,SAAS,aAAa;AAClD,QAAM,eAAe,sBAAsB;AAGzC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC;AAAA,UAC7B,CAAC,QAAQ,MAAM,GAAG,CAAC;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AAAA,MACA,aAAU;AAAA,MACV,iBAAe;AAAA,MACd,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ,WAAW,GAAG;AAAA,cACZ,CAAC,QAAQ,UAAU,GAAG,gBAAgB,CAAC;AAAA,cACvC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC;AAAA,YAAA,CAC9B;AAAA,YACD,SAAQ;AAAA,YACR,WAAU;AAAA,YAET,UAAA;AAAA,UAAA;AAAA,QACH;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ,WAAW,GAAG;AAAA,cACZ,CAAC,QAAQ,UAAU,GAAG,gBAAgB,CAAC;AAAA,cACvC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC;AAAA,YAAA,CAC9B;AAAA,YACD,SAAQ;AAAA,YACR,WAAU;AAAA,YAET,UAAA,IAAI,SAAS,IAAI,eAAe;AAAA,UAAA;AAAA,QACnC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"CharCounter.js","sources":["../../../../src/Forms/CharCounter/CharCounter.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./CharCounter.styles\";\n\nexport { staticClasses as charCounterClasses };\n\nexport type HvCharCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCharCounterProps extends HvBaseProps {\n /** The string that separates the current char quantity from the max quantity. */\n separator?: string;\n /** The maximum allowed length of the characters. */\n maxCharQuantity: number;\n /** The current char quantity to be rendered. */\n currentCharQuantity?: number;\n /** If `true` the counter is disabled. */\n disabled?: boolean;\n /** If `true` the info message won't have margins. */\n disableGutter?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvCharCounterClasses;\n}\n\n/**\n * Displays the capacity and current usage of a text input box (character count by default).\n *\n * Use the character counter when there is a character or word limit.\n * By itself it doesn't block the user from going above the limit.\n */\nexport const HvCharCounter = (props: HvCharCounterProps) => {\n const {\n separator = \"/\",\n maxCharQuantity,\n currentCharQuantity = 0,\n classes: classesProp,\n className,\n id,\n disabled,\n disableGutter = false,\n ...others\n } = useDefaultProps(\"HvCharCounter\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localId = id ?? setId(elementId, \"counter\");\n const currentId = setId(localId, \"currentQuantity\");\n const maxQuantityId = setId(localId, \"maxQuantity\");\n const isOverloaded = currentCharQuantity > maxCharQuantity;\n\n return (\n <div\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.counterDisabled]: !!localDisabled,\n [classes.gutter]: !disableGutter,\n },\n className,\n )}\n aria-live=\"polite\"\n aria-disabled={localDisabled}\n {...others}\n >\n <HvTypography\n id={currentId}\n className={cx({\n [classes.overloaded]: isOverloaded && !localDisabled,\n [classes.counterDisabled]: !!localDisabled,\n })}\n variant=\"label\"\n component=\"label\"\n >\n {currentCharQuantity}\n </HvTypography>\n <HvTypography\n id={maxQuantityId}\n className={cx({\n [classes.overloaded]: isOverloaded && !localDisabled,\n [classes.counterDisabled]: !!localDisabled,\n })}\n variant=\"body\"\n component=\"label\"\n >\n {` ${separator} ${maxCharQuantity}`}\n </HvTypography>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAqCa,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IAC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S,IAAI,eAAe;AAAA,UAAA;AAAA,QAAA;AAAA,MACnC;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormElement.js","sources":["../../../../src/Forms/FormElement/FormElement.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { useUniqueId } from \"../../hooks/useUniqueId\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvFormElementContextProvider } from \"./context/FormElementContext\";\nimport { HvFormElementDescriptorsContextProvider } from \"./context/FormElementDescriptorsContext\";\nimport { HvFormElementValueContextProvider } from \"./context/FormElementValueContext\";\nimport { staticClasses, useClasses } from \"./FormElement.styles\";\nimport { findDescriptors } from \"./utils/FormUtils\";\n\nexport { staticClasses as formElementClasses };\n\nexport type HvFormElementClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFormStatus = \"standBy\" | \"valid\" | \"invalid\" | \"empty\";\n\nexport interface HvFormElementProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"onToggle\"> {\n /**\n * Name of the form element.\n *\n * Part of a name/value pair, should be the name property of the underling native input.\n */\n name?: string;\n /**\n * Current value of the form element.\n *\n * Part of a name/value pair, should be the value property of the underling native input.\n */\n value?: any;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label?: React.ReactNode;\n /** Provide additional descriptive text for the form element. */\n description?: React.ReactNode;\n /** Whether the form element is disabled. */\n disabled?: boolean;\n /** Indicates that the form element is not editable. */\n readOnly?: boolean;\n /** Indicates that user input is required on the form element. */\n required?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to the state.\n */\n status?: HvFormStatus;\n /** The error message to show when `status` is \"invalid\". */\n statusMessage?: string;\n /** The callback fired when the value changes. */\n onChange?: (event: React.FormEvent<HTMLDivElement>) => void;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFormElementClasses;\n}\n\nexport const HvFormElement = (props: HvFormElementProps) => {\n const {\n classes: classesProp,\n className,\n children,\n id,\n name,\n value,\n disabled = false,\n required = false,\n readOnly = false,\n status = \"standBy\",\n ...others\n } = useDefaultProps(\"HvFormElement\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const contextValue = useMemo(\n () => ({\n elementId,\n elementName: name,\n elementStatus: status,\n elementDisabled: disabled,\n elementRequired: required,\n elementReadOnly: readOnly,\n }),\n [disabled, elementId, name, readOnly, required, status],\n );\n\n const descriptors = useMemo(() => findDescriptors(children), [children]);\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n <HvFormElementContextProvider value={contextValue}>\n <HvFormElementValueContextProvider value={value}>\n <HvFormElementDescriptorsContextProvider value={descriptors}>\n {children}\n </HvFormElementDescriptorsContextProvider>\n </HvFormElementValueContextProvider>\n </HvFormElementContextProvider>\n </div>\n );\n};\n\nHvFormElement.formElementType = \"formelement\";\n"],"names":[],"mappings":";;;;;;;;;;AAkEa,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,QAAA,YAAY,YAAY,EAAE;AAEhC,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,MACL;AAAA,MACA,aAAa;AAAA,MACb,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,IAAA;AAAA,IAEnB,CAAC,UAAU,WAAW,MAAM,UAAU,UAAU,MAAM;AAAA,EAAA;AAGlD,QAAA,cAAc,QAAQ,MAAM,gBAAgB,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAGrE,SAAA,oBAAC,OAAI,EAAA,IAAQ,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QACvD,UAAA,oBAAC,gCAA6B,OAAO,cACnC,UAAC,oBAAA,mCAAA,EAAkC,OACjC,UAAA,oBAAC,yCAAwC,EAAA,OAAO,aAC7C,SAAA,CACH,EACF,CAAA,EAAA,CACF,EACF,CAAA;AAEJ;AAEA,cAAc,kBAAkB;"}
1
+ {"version":3,"file":"FormElement.js","sources":["../../../../src/Forms/FormElement/FormElement.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { useUniqueId } from \"../../hooks/useUniqueId\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvFormElementContextProvider } from \"./context/FormElementContext\";\nimport { HvFormElementDescriptorsContextProvider } from \"./context/FormElementDescriptorsContext\";\nimport { HvFormElementValueContextProvider } from \"./context/FormElementValueContext\";\nimport { staticClasses, useClasses } from \"./FormElement.styles\";\nimport { findDescriptors } from \"./utils/FormUtils\";\n\nexport { staticClasses as formElementClasses };\n\nexport type HvFormElementClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFormStatus = \"standBy\" | \"valid\" | \"invalid\" | \"empty\";\n\nexport interface HvFormElementProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"onToggle\"> {\n /**\n * Name of the form element.\n *\n * Part of a name/value pair, should be the name property of the underling native input.\n */\n name?: string;\n /**\n * Current value of the form element.\n *\n * Part of a name/value pair, should be the value property of the underling native input.\n */\n value?: any;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be provided instead.\n */\n label?: React.ReactNode;\n /** Provide additional descriptive text for the form element. */\n description?: React.ReactNode;\n /** Whether the form element is disabled. */\n disabled?: boolean;\n /** Indicates that the form element is not editable. */\n readOnly?: boolean;\n /** Indicates that user input is required on the form element. */\n required?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to the state.\n */\n status?: HvFormStatus;\n /** The error message to show when `status` is \"invalid\". */\n statusMessage?: string;\n /** The callback fired when the value changes. */\n onChange?: (event: React.FormEvent<HTMLDivElement>) => void;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFormElementClasses;\n}\n\nexport const HvFormElement = (props: HvFormElementProps) => {\n const {\n classes: classesProp,\n className,\n children,\n id,\n name,\n value,\n disabled = false,\n required = false,\n readOnly = false,\n status = \"standBy\",\n ...others\n } = useDefaultProps(\"HvFormElement\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const contextValue = useMemo(\n () => ({\n elementId,\n elementName: name,\n elementStatus: status,\n elementDisabled: disabled,\n elementRequired: required,\n elementReadOnly: readOnly,\n }),\n [disabled, elementId, name, readOnly, required, status],\n );\n\n const descriptors = useMemo(() => findDescriptors(children), [children]);\n\n return (\n <div id={id} className={cx(classes.root, className)} {...others}>\n <HvFormElementContextProvider value={contextValue}>\n <HvFormElementValueContextProvider value={value}>\n <HvFormElementDescriptorsContextProvider value={descriptors}>\n {children}\n </HvFormElementDescriptorsContextProvider>\n </HvFormElementValueContextProvider>\n </HvFormElementContextProvider>\n </div>\n );\n};\n\nHvFormElement.formElementType = \"formelement\";\n"],"names":[],"mappings":";;;;;;;;;;AAkEa,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,YAAY,YAAY,EAAE;AAEhC,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,MACL;AAAA,MACA,aAAa;AAAA,MACb,eAAe;AAAA,MACf,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,IAAA;AAAA,IAEnB,CAAC,UAAU,WAAW,MAAM,UAAU,UAAU,MAAM;AAAA,EACxD;AAEM,QAAA,cAAc,QAAQ,MAAM,gBAAgB,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAGrE,SAAA,oBAAC,OAAI,EAAA,IAAQ,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QACvD,UAAA,oBAAC,gCAA6B,OAAO,cACnC,UAAC,oBAAA,mCAAA,EAAkC,OACjC,UAAA,oBAAC,yCAAwC,EAAA,OAAO,aAC7C,SACH,CAAA,EACF,CAAA,EACF,CAAA,GACF;AAEJ;AAEA,cAAc,kBAAkB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormElement.styles.js","sources":["../../../../src/Forms/FormElement/FormElement.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFormElement\", {\n root: {},\n});\n"],"names":[],"mappings":";AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM,CAAC;AACT,CAAC;"}
1
+ {"version":3,"file":"FormElement.styles.js","sources":["../../../../src/Forms/FormElement/FormElement.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFormElement\", {\n root: {},\n});\n"],"names":[],"mappings":";AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM,CAAA;AACR,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormElementContext.js","sources":["../../../../../src/Forms/FormElement/context/FormElementContext.ts"],"sourcesContent":["import React from \"react\";\n\nexport interface HvFormElementContextValue {\n elementId?: string;\n elementDisabled?: boolean;\n elementRequired?: boolean;\n elementStatus?: string;\n elementReadOnly?: boolean;\n elementName?: string;\n}\n\nexport const HvFormElementContext =\n React.createContext<HvFormElementContextValue>({});\n\nexport const HvFormElementContextProvider = HvFormElementContext.Provider;\nexport const HvFormElementContextConsumer = HvFormElementContext.Consumer;\nexport default HvFormElementContext;\n"],"names":["React"],"mappings":";AAWO,MAAM,uBACXA,eAAM,cAAyC,EAAE;AAE5C,MAAM,+BAA+B,qBAAqB;AAC1D,MAAM,+BAA+B,qBAAqB;"}
1
+ {"version":3,"file":"FormElementContext.js","sources":["../../../../../src/Forms/FormElement/context/FormElementContext.ts"],"sourcesContent":["import React from \"react\";\n\nexport interface HvFormElementContextValue {\n elementId?: string;\n elementDisabled?: boolean;\n elementRequired?: boolean;\n elementStatus?: string;\n elementReadOnly?: boolean;\n elementName?: string;\n}\n\nexport const HvFormElementContext =\n React.createContext<HvFormElementContextValue>({});\n\nexport const HvFormElementContextProvider = HvFormElementContext.Provider;\nexport const HvFormElementContextConsumer = HvFormElementContext.Consumer;\nexport default HvFormElementContext;\n"],"names":["React"],"mappings":";AAWO,MAAM,uBACXA,eAAM,cAAyC,CAAE,CAAA;AAE5C,MAAM,+BAA+B,qBAAqB;AAC1D,MAAM,+BAA+B,qBAAqB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormElementDescriptorsContext.js","sources":["../../../../../src/Forms/FormElement/context/FormElementDescriptorsContext.ts"],"sourcesContent":["import React from \"react\";\n\nexport interface HvFormElementDescriptorsContextValue {\n input?: any;\n label?: any;\n descriptors?: any;\n}\n\nexport const HvFormElementDescriptorsContext =\n React.createContext<HvFormElementDescriptorsContextValue>({});\n\nexport const HvFormElementDescriptorsContextProvider =\n HvFormElementDescriptorsContext.Provider;\nexport const HvFormElementDescriptorsContextConsumer =\n HvFormElementDescriptorsContext.Consumer;\nexport default HvFormElementDescriptorsContext;\n"],"names":["React"],"mappings":";AAQO,MAAM,kCACXA,eAAM,cAAoD,EAAE;AAEvD,MAAM,0CACX,gCAAgC;AAC3B,MAAM,0CACX,gCAAgC;"}
1
+ {"version":3,"file":"FormElementDescriptorsContext.js","sources":["../../../../../src/Forms/FormElement/context/FormElementDescriptorsContext.ts"],"sourcesContent":["import React from \"react\";\n\nexport interface HvFormElementDescriptorsContextValue {\n input?: any;\n label?: any;\n descriptors?: any;\n}\n\nexport const HvFormElementDescriptorsContext =\n React.createContext<HvFormElementDescriptorsContextValue>({});\n\nexport const HvFormElementDescriptorsContextProvider =\n HvFormElementDescriptorsContext.Provider;\nexport const HvFormElementDescriptorsContextConsumer =\n HvFormElementDescriptorsContext.Consumer;\nexport default HvFormElementDescriptorsContext;\n"],"names":["React"],"mappings":";AAQO,MAAM,kCACXA,eAAM,cAAoD,CAAE,CAAA;AAEvD,MAAM,0CACX,gCAAgC;AAC3B,MAAM,0CACX,gCAAgC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormUtils.js","sources":["../../../../../src/Forms/FormElement/utils/FormUtils.ts"],"sourcesContent":["import React from \"react\";\nimport { InputBaseComponentProps } from \"@mui/material/InputBase\";\n\nimport { HvFormElementContextValue } from \"../context/FormElementContext\";\nimport { HvFormElementDescriptorsContextValue } from \"../context/FormElementDescriptorsContext\";\n\ninterface Descriptor {\n id?: string;\n htmlFor?: string;\n}\n/**\n * Scans the element's children looking for the children IDs that match the different form element types.\n * This function will produce an object that has a key for each provided name\n * Inside each key there will be an array with each id of the found descriptor.\n *\n * @param {Array} children - The children inside the form element to scan.\n * @param {Object} descriptors - Initial descriptors map (used for recursion).\n *\n */\nconst findDescriptors = (\n children: React.ReactNode,\n descriptors: {\n input: Descriptor[];\n label: Descriptor[];\n description: Descriptor[];\n controlled: Descriptor[];\n errormessage: Descriptor[];\n HvCalendarHeader?: Descriptor[];\n } = {\n input: [],\n label: [],\n description: [],\n controlled: [],\n errormessage: [],\n\n // TODO: refactor this out\n HvCalendarHeader: [],\n },\n) => {\n React.Children.forEach(children, (child: any) => {\n if (child?.type?.formElementType && child.props?.id) {\n descriptors[child.type.formElementType as keyof typeof descriptors]?.push(\n {\n id: child.props?.id,\n htmlFor: child.props?.htmlFor,\n },\n );\n }\n\n if (child?.type?.formElementType !== \"formelement\") {\n findDescriptors(child?.props?.children, descriptors);\n }\n });\n\n return descriptors;\n};\n\nconst getIdReferenceListFor = (\n formElementType: string,\n descriptors: any,\n filterFor: string | null = null,\n) => {\n const referenceList = descriptors?.[formElementType]\n ?.filter((d: any) => d.htmlFor !== filterFor)\n ?.map((d: any) => d.id)\n .join(\" \")\n .trim();\n\n return referenceList !== \"\" ? referenceList : undefined;\n};\n\nconst getIdReferenceFor = (\n formElementType: string,\n descriptors: any,\n filterFor = null,\n) => {\n const referenceList = descriptors?.[formElementType]\n ?.filter((d: any) => d.htmlFor !== filterFor)\n ?.map((d: any) => d.id)?.[0];\n\n return referenceList !== \"\" ? referenceList : undefined;\n};\n\nconst buildFormElementPropsFromContext = (\n name?: string,\n disabled?: boolean,\n readOnly?: boolean,\n required?: boolean,\n context?: HvFormElementContextValue,\n) => {\n return {\n name: name || context?.elementName,\n disabled: disabled !== undefined ? disabled : context?.elementDisabled,\n readOnly: readOnly !== undefined ? readOnly : context?.elementReadOnly,\n required: required !== undefined ? required : context?.elementRequired,\n status: context?.elementStatus,\n };\n};\n\nconst buildAriaPropsFromContext = (\n props: InputBaseComponentProps,\n context: HvFormElementDescriptorsContextValue,\n isInvalid: boolean,\n inputId?: string,\n) => {\n const arias: React.AriaAttributes = {\n \"aria-labelledby\":\n props?.[\"aria-labelledby\"] !== undefined\n ? props?.[\"aria-labelledby\"]\n : getIdReferenceListFor(\"label\", context?.descriptors, inputId),\n \"aria-describedby\":\n props?.[\"aria-describedby\"] !== undefined\n ? props?.[\"aria-describedby\"]\n : getIdReferenceListFor(\"description\", context?.descriptors),\n \"aria-controls\":\n props?.[\"aria-controls\"] !== undefined\n ? props?.[\"aria-controls\"]\n : getIdReferenceListFor(\"controlled\", context?.descriptors),\n };\n\n if (isInvalid) {\n arias[\"aria-invalid\"] = isInvalid;\n arias[\"aria-errormessage\"] =\n props?.[\"aria-errormessage\"] !== undefined\n ? props?.[\"aria-errormessage\"]\n : getIdReferenceFor(\"errormessage\", context?.descriptors);\n }\n\n return arias;\n};\n\nexport {\n findDescriptors,\n getIdReferenceListFor,\n getIdReferenceFor,\n buildFormElementPropsFromContext,\n buildAriaPropsFromContext,\n};\n"],"names":["React"],"mappings":";AAmBM,MAAA,kBAAkB,CACtB,UACA,cAOI;AAAA,EACF,OAAO,CAAC;AAAA,EACR,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,YAAY,CAAC;AAAA,EACb,cAAc,CAAC;AAAA;AAAA,EAGf,kBAAkB,CAAC;AACrB,MACG;AACHA,iBAAM,SAAS,QAAQ,UAAU,CAAC,UAAe;AAC/C,QAAI,OAAO,MAAM,mBAAmB,MAAM,OAAO,IAAI;AACvC,kBAAA,MAAM,KAAK,eAA2C,GAAG;AAAA,QACnE;AAAA,UACE,IAAI,MAAM,OAAO;AAAA,UACjB,SAAS,MAAM,OAAO;AAAA,QACxB;AAAA,MAAA;AAAA,IAEJ;AAEI,QAAA,OAAO,MAAM,oBAAoB,eAAe;AAClC,sBAAA,OAAO,OAAO,UAAU,WAAW;AAAA,IACrD;AAAA,EAAA,CACD;AAEM,SAAA;AACT;AAEA,MAAM,wBAAwB,CAC5B,iBACA,aACA,YAA2B,SACxB;AACG,QAAA,gBAAgB,cAAc,eAAe,GAC/C,OAAO,CAAC,MAAW,EAAE,YAAY,SAAS,GAC1C,IAAI,CAAC,MAAW,EAAE,EAAE,EACrB,KAAK,GAAG,EACR;AAEI,SAAA,kBAAkB,KAAK,gBAAgB;AAChD;AAEA,MAAM,oBAAoB,CACxB,iBACA,aACA,YAAY,SACT;AACH,QAAM,gBAAgB,cAAc,eAAe,GAC/C,OAAO,CAAC,MAAW,EAAE,YAAY,SAAS,GAC1C,IAAI,CAAC,MAAW,EAAE,EAAE,IAAI,CAAC;AAEtB,SAAA,kBAAkB,KAAK,gBAAgB;AAChD;AAEA,MAAM,mCAAmC,CACvC,MACA,UACA,UACA,UACA,YACG;AACI,SAAA;AAAA,IACL,MAAM,QAAQ,SAAS;AAAA,IACvB,UAAU,aAAa,SAAY,WAAW,SAAS;AAAA,IACvD,UAAU,aAAa,SAAY,WAAW,SAAS;AAAA,IACvD,UAAU,aAAa,SAAY,WAAW,SAAS;AAAA,IACvD,QAAQ,SAAS;AAAA,EAAA;AAErB;AAEA,MAAM,4BAA4B,CAChC,OACA,SACA,WACA,YACG;AACH,QAAM,QAA8B;AAAA,IAClC,mBACE,QAAQ,iBAAiB,MAAM,SAC3B,QAAQ,iBAAiB,IACzB,sBAAsB,SAAS,SAAS,aAAa,OAAO;AAAA,IAClE,oBACE,QAAQ,kBAAkB,MAAM,SAC5B,QAAQ,kBAAkB,IAC1B,sBAAsB,eAAe,SAAS,WAAW;AAAA,IAC/D,iBACE,QAAQ,eAAe,MAAM,SACzB,QAAQ,eAAe,IACvB,sBAAsB,cAAc,SAAS,WAAW;AAAA,EAAA;AAGhE,MAAI,WAAW;AACb,UAAM,cAAc,IAAI;AACxB,UAAM,mBAAmB,IACvB,QAAQ,mBAAmB,MAAM,SAC7B,QAAQ,mBAAmB,IAC3B,kBAAkB,gBAAgB,SAAS,WAAW;AAAA,EAC9D;AAEO,SAAA;AACT;"}
1
+ {"version":3,"file":"FormUtils.js","sources":["../../../../../src/Forms/FormElement/utils/FormUtils.ts"],"sourcesContent":["import React from \"react\";\nimport { InputBaseComponentProps } from \"@mui/material/InputBase\";\n\nimport { HvFormElementContextValue } from \"../context/FormElementContext\";\nimport { HvFormElementDescriptorsContextValue } from \"../context/FormElementDescriptorsContext\";\n\ninterface Descriptor {\n id?: string;\n htmlFor?: string;\n}\n/**\n * Scans the element's children looking for the children IDs that match the different form element types.\n * This function will produce an object that has a key for each provided name\n * Inside each key there will be an array with each id of the found descriptor.\n *\n * @param {Array} children - The children inside the form element to scan.\n * @param {Object} descriptors - Initial descriptors map (used for recursion).\n *\n */\nconst findDescriptors = (\n children: React.ReactNode,\n descriptors: {\n input: Descriptor[];\n label: Descriptor[];\n description: Descriptor[];\n controlled: Descriptor[];\n errormessage: Descriptor[];\n HvCalendarHeader?: Descriptor[];\n } = {\n input: [],\n label: [],\n description: [],\n controlled: [],\n errormessage: [],\n\n // TODO: refactor this out\n HvCalendarHeader: [],\n },\n) => {\n React.Children.forEach(children, (child: any) => {\n if (child?.type?.formElementType && child.props?.id) {\n descriptors[child.type.formElementType as keyof typeof descriptors]?.push(\n {\n id: child.props?.id,\n htmlFor: child.props?.htmlFor,\n },\n );\n }\n\n if (child?.type?.formElementType !== \"formelement\") {\n findDescriptors(child?.props?.children, descriptors);\n }\n });\n\n return descriptors;\n};\n\nconst getIdReferenceListFor = (\n formElementType: string,\n descriptors: any,\n filterFor: string | null = null,\n) => {\n const referenceList = descriptors?.[formElementType]\n ?.filter((d: any) => d.htmlFor !== filterFor)\n ?.map((d: any) => d.id)\n .join(\" \")\n .trim();\n\n return referenceList !== \"\" ? referenceList : undefined;\n};\n\nconst getIdReferenceFor = (\n formElementType: string,\n descriptors: any,\n filterFor = null,\n) => {\n const referenceList = descriptors?.[formElementType]\n ?.filter((d: any) => d.htmlFor !== filterFor)\n ?.map((d: any) => d.id)?.[0];\n\n return referenceList !== \"\" ? referenceList : undefined;\n};\n\nconst buildFormElementPropsFromContext = (\n name?: string,\n disabled?: boolean,\n readOnly?: boolean,\n required?: boolean,\n context?: HvFormElementContextValue,\n) => {\n return {\n name: name || context?.elementName,\n disabled: disabled !== undefined ? disabled : context?.elementDisabled,\n readOnly: readOnly !== undefined ? readOnly : context?.elementReadOnly,\n required: required !== undefined ? required : context?.elementRequired,\n status: context?.elementStatus,\n };\n};\n\nconst buildAriaPropsFromContext = (\n props: InputBaseComponentProps,\n context: HvFormElementDescriptorsContextValue,\n isInvalid: boolean,\n inputId?: string,\n) => {\n const arias: React.AriaAttributes = {\n \"aria-labelledby\":\n props?.[\"aria-labelledby\"] !== undefined\n ? props?.[\"aria-labelledby\"]\n : getIdReferenceListFor(\"label\", context?.descriptors, inputId),\n \"aria-describedby\":\n props?.[\"aria-describedby\"] !== undefined\n ? props?.[\"aria-describedby\"]\n : getIdReferenceListFor(\"description\", context?.descriptors),\n \"aria-controls\":\n props?.[\"aria-controls\"] !== undefined\n ? props?.[\"aria-controls\"]\n : getIdReferenceListFor(\"controlled\", context?.descriptors),\n };\n\n if (isInvalid) {\n arias[\"aria-invalid\"] = isInvalid;\n arias[\"aria-errormessage\"] =\n props?.[\"aria-errormessage\"] !== undefined\n ? props?.[\"aria-errormessage\"]\n : getIdReferenceFor(\"errormessage\", context?.descriptors);\n }\n\n return arias;\n};\n\nexport {\n findDescriptors,\n getIdReferenceListFor,\n getIdReferenceFor,\n buildFormElementPropsFromContext,\n buildAriaPropsFromContext,\n};\n"],"names":["React"],"mappings":";AAmBM,MAAA,kBAAkB,CACtB,UACA,cAOI;AAAA,EACF,OAAO,CAAC;AAAA,EACR,OAAO,CAAC;AAAA,EACR,aAAa,CAAC;AAAA,EACd,YAAY,CAAC;AAAA,EACb,cAAc,CAAC;AAAA;AAAA,EAGf,kBAAkB,CAAA;AACpB,MACG;AACHA,iBAAM,SAAS,QAAQ,UAAU,CAAC,UAAe;AAC/C,QAAI,OAAO,MAAM,mBAAmB,MAAM,OAAO,IAAI;AACvC,kBAAA,MAAM,KAAK,eAA2C,GAAG;AAAA,QACnE;AAAA,UACE,IAAI,MAAM,OAAO;AAAA,UACjB,SAAS,MAAM,OAAO;AAAA,QAAA;AAAA,MAE1B;AAAA,IAAA;AAGE,QAAA,OAAO,MAAM,oBAAoB,eAAe;AAClC,sBAAA,OAAO,OAAO,UAAU,WAAW;AAAA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AAkB,gBAAgB,SAAS,WAAW;AAAA,EAAA;AAGvD,SAAA;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InfoMessage.js","sources":["../../../../src/Forms/InfoMessage/InfoMessage.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvTypography, HvTypographyProps } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./InfoMessage.styles\";\n\nexport { staticClasses as infoMessageClasses };\n\nexport type HvInfoMessageClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvInfoMessageProps extends HvTypographyProps<\"label\"> {\n /** If `true` the label is disabled. */\n disabled?: boolean;\n /** If `true` the info message won't have margins. */\n disableGutter?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvInfoMessageClasses;\n}\n\n/**\n * Provides the user with additional descriptive text for the form element.\n */\nexport const HvInfoMessage = (props: HvInfoMessageProps) => {\n const {\n id,\n classes: classesProp,\n className,\n children,\n disabled,\n disableGutter = false,\n ...others\n } = useDefaultProps(\"HvInfoMessage\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localId = id ?? setId(elementId, \"description\");\n\n return (\n <HvTypography\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.infoDisabled]: !!localDisabled,\n [classes.gutter]: !disableGutter,\n },\n className,\n )}\n variant=\"body\"\n component=\"label\"\n {...others}\n >\n {children}\n </HvTypography>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA2Ba,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,gBAAgB,IAAI,WAAW,oBAAoB;AACtE,QAAM,gBAAgB,YAAY;AAClC,QAAM,UAAU,MAAM,MAAM,WAAW,aAAa;AAGlD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,YAAY,GAAG,CAAC,CAAC;AAAA,UAC1B,CAAC,QAAQ,MAAM,GAAG,CAAC;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAQ;AAAA,MACR,WAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"InfoMessage.js","sources":["../../../../src/Forms/InfoMessage/InfoMessage.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvTypography, HvTypographyProps } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./InfoMessage.styles\";\n\nexport { staticClasses as infoMessageClasses };\n\nexport type HvInfoMessageClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvInfoMessageProps extends HvTypographyProps<\"label\"> {\n /** If `true` the label is disabled. */\n disabled?: boolean;\n /** If `true` the info message won't have margins. */\n disableGutter?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvInfoMessageClasses;\n}\n\n/**\n * Provides the user with additional descriptive text for the form element.\n */\nexport const HvInfoMessage = (props: HvInfoMessageProps) => {\n const {\n id,\n classes: classesProp,\n className,\n children,\n disabled,\n disableGutter = false,\n ...others\n } = useDefaultProps(\"HvInfoMessage\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled } = useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localId = id ?? setId(elementId, \"description\");\n\n return (\n <HvTypography\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.infoDisabled]: !!localDisabled,\n [classes.gutter]: !disableGutter,\n },\n className,\n )}\n variant=\"body\"\n component=\"label\"\n {...others}\n >\n {children}\n </HvTypography>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA2Ba,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,oBAAoB,WAAW,oBAAoB;AACtE,QAAM,gBAAgB,YAAY;AAClC,QAAM,UAAU,MAAM,MAAM,WAAW,aAAa;AAGlD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,YAAY,GAAG,CAAC,CAAC;AAAA,UAC1B,CAAC,QAAQ,MAAM,GAAG,CAAC;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAQ;AAAA,MACR,WAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sources":["../../../../src/Forms/Label/Label.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvTypography, HvTypographyProps } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { findDescriptors } from \"../FormElement/utils/FormUtils\";\nimport { staticClasses, useClasses } from \"./Label.styles\";\n\nexport { staticClasses as labelClasses };\n\nexport type HvLabelClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvLabelProps extends HvTypographyProps<\"label\"> {\n /** Id to be applied to the root node */\n id?: string;\n /** The text to be shown by the label. */\n label?: React.ReactNode;\n /** The id of the form element the label is bound to. */\n htmlFor?: string;\n /** If `true` the label is displayed with a disabled style. */\n disabled?: boolean;\n /** If `true`, the label will indicate that the form element is required (an `*` after the label text). */\n required?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvLabelClasses;\n}\n\n/**\n * Provides the user with a recognizable name for a given form element.\n */\nexport const HvLabel = (props: HvLabelProps) => {\n const {\n id,\n classes: classesProp,\n className,\n children,\n label,\n disabled,\n required,\n htmlFor: htmlForProp,\n ...others\n } = useDefaultProps(\"HvLabel\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled, elementRequired } =\n useContext(HvFormElementContext);\n\n const localDisabled = disabled || elementDisabled;\n const localRequired = required || elementRequired;\n\n const localId = id ?? setId(elementId, \"label\");\n\n const forId = htmlForProp || findDescriptors(children)?.input?.[0]?.id;\n\n return (\n <>\n <HvTypography\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.labelDisabled]: !!localDisabled,\n [classes.childGutter]: !!(children && label),\n },\n className,\n )}\n variant=\"label\"\n component=\"label\"\n htmlFor={forId}\n {...others}\n >\n {label}\n {localRequired && <span aria-hidden=\"true\">*</span>}\n </HvTypography>\n {children}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAkCa,MAAA,UAAU,CAAC,UAAwB;AACxC,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,IACD,gBAAgB,WAAW,KAAK;AAEpC,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,iBAAiB,gBAAgB,IAClD,WAAW,oBAAoB;AAEjC,QAAM,gBAAgB,YAAY;AAClC,QAAM,gBAAgB,YAAY;AAElC,QAAM,UAAU,MAAM,MAAM,WAAW,OAAO;AAE9C,QAAM,QAAQ,eAAe,gBAAgB,QAAQ,GAAG,QAAQ,CAAC,GAAG;AAEpE,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,QACJ,WAAW;AAAA,UACT,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,aAAa,GAAG,CAAC,CAAC;AAAA,YAC3B,CAAC,QAAQ,WAAW,GAAG,CAAC,EAAE,YAAY;AAAA,UACxC;AAAA,UACA;AAAA,QACF;AAAA,QACA,SAAQ;AAAA,QACR,WAAU;AAAA,QACV,SAAS;AAAA,QACR,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACA,iBAAiB,oBAAC,QAAK,EAAA,eAAY,QAAO,UAAC,KAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9C;AAAA,IACC;AAAA,EACH,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Label.js","sources":["../../../../src/Forms/Label/Label.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvTypography, HvTypographyProps } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { findDescriptors } from \"../FormElement/utils/FormUtils\";\nimport { staticClasses, useClasses } from \"./Label.styles\";\n\nexport { staticClasses as labelClasses };\n\nexport type HvLabelClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvLabelProps extends HvTypographyProps<\"label\"> {\n /** Id to be applied to the root node */\n id?: string;\n /** The text to be shown by the label. */\n label?: React.ReactNode;\n /** The id of the form element the label is bound to. */\n htmlFor?: string;\n /** If `true` the label is displayed with a disabled style. */\n disabled?: boolean;\n /** If `true`, the label will indicate that the form element is required (an `*` after the label text). */\n required?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvLabelClasses;\n}\n\n/**\n * Provides the user with a recognizable name for a given form element.\n */\nexport const HvLabel = (props: HvLabelProps) => {\n const {\n id,\n classes: classesProp,\n className,\n children,\n label,\n disabled,\n required,\n htmlFor: htmlForProp,\n ...others\n } = useDefaultProps(\"HvLabel\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementDisabled, elementRequired } =\n useContext(HvFormElementContext);\n\n const localDisabled = disabled || elementDisabled;\n const localRequired = required || elementRequired;\n\n const localId = id ?? setId(elementId, \"label\");\n\n const forId = htmlForProp || findDescriptors(children)?.input?.[0]?.id;\n\n return (\n <>\n <HvTypography\n id={localId}\n className={cx(\n classes.root,\n {\n [classes.labelDisabled]: !!localDisabled,\n [classes.childGutter]: !!(children && label),\n },\n className,\n )}\n variant=\"label\"\n component=\"label\"\n htmlFor={forId}\n {...others}\n >\n {label}\n {localRequired && <span aria-hidden=\"true\">*</span>}\n </HvTypography>\n {children}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAkCa,MAAA,UAAU,CAAC,UAAwB;AACxC,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,IACD,gBAAgB,WAAW,KAAK;AAEpC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,iBAAiB,gBAAgB,IAClD,WAAW,oBAAoB;AAEjC,QAAM,gBAAgB,YAAY;AAClC,QAAM,gBAAgB,YAAY;AAElC,QAAM,UAAU,MAAM,MAAM,WAAW,OAAO;AAE9C,QAAM,QAAQ,eAAe,gBAAgB,QAAQ,GAAG,QAAQ,CAAC,GAAG;AAEpE,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,QACJ,WAAW;AAAA,UACT,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,aAAa,GAAG,CAAC,CAAC;AAAA,YAC3B,CAAC,QAAQ,WAAW,GAAG,CAAC,EAAE,YAAY;AAAA,UACxC;AAAA,UACA;AAAA,QACF;AAAA,QACA,SAAQ;AAAA,QACR,WAAU;AAAA,QACV,SAAS;AAAA,QACR,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACA,iBAAiB,oBAAC,QAAK,EAAA,eAAY,QAAO,UAAC,IAAA,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9C;AAAA,IACC;AAAA,EAAA,GACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Suggestions.js","sources":["../../../../src/Forms/Suggestions/Suggestions.tsx"],"sourcesContent":["import { forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport {\n ClickAwayListener,\n ClickAwayListenerProps,\n} from \"@mui/base/ClickAwayListener\";\nimport { Popper } from \"@mui/base/Popper\";\nimport { useForkRef } from \"@mui/material/utils\";\nimport { useTheme, type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvListItem } from \"../../ListContainer\";\nimport { HvSelectionList } from \"../../SelectionList\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport { getContainerElement } from \"../../utils/document\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./Suggestions.styles\";\n\nexport { staticClasses as suggestionsClasses };\n\nexport type HvSuggestionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSuggestion {\n id?: string;\n label: React.ReactNode;\n value?: string;\n disabled?: boolean;\n}\n\nexport interface HvSuggestionsProps extends HvBaseProps {\n /** Whether suggestions is visible */\n open?: boolean;\n /**\n * Whether suggestions is visible.\n * @deprecated use `open` instead.\n * */\n expanded?: boolean;\n /** The HTML element Suggestions attaches to. */\n anchorEl?: HTMLElement | null;\n /** Array of { id, label, ...others } values to display in the suggestion list */\n suggestionValues?: HvSuggestion[] | null;\n /** Function called when a suggestion is selected */\n onSuggestionSelected?: (event: React.MouseEvent, value: HvSuggestion) => void;\n /** Function called when suggestion list is closed */\n onClose?: ClickAwayListenerProps[\"onClickAway\"];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvSuggestionsClasses;\n /**\n * If enabled, the suggestions list will be rendered using a portal.\n * If disabled, it will be under the DOM hierarchy of the parent component.\n * @default false\n * */\n enablePortal?: boolean;\n}\n\nexport const HvSuggestions = forwardRef<\n // no-indent\n unknown,\n HvSuggestionsProps\n>((props, extRef) => {\n const {\n id,\n className,\n classes: classesProp,\n expanded = false,\n enablePortal = false,\n open: openProp,\n anchorEl,\n suggestionValues = [],\n onClose,\n onSuggestionSelected,\n ...others\n } = props;\n\n const { classes, cx } = useClasses(classesProp);\n\n const { rootId } = useTheme();\n\n const { elementId } = useContext(HvFormElementContext);\n const localId = id ?? setId(elementId, \"suggestions\");\n\n const ref = useRef<HTMLDivElement>(null);\n const forkedRef = useForkRef(ref, extRef);\n\n // TODO: remove controlled+uncontrolled `expanded` prop in v6\n const [isOpen, setIsOpen] = useState(expanded);\n useEffect(() => {\n setIsOpen(expanded);\n }, [expanded]);\n\n return (\n <div\n id={localId}\n ref={forkedRef}\n className={cx(classes.root, className)}\n {...others}\n >\n <ClickAwayListener\n onClickAway={(event) => {\n setIsOpen(false);\n onClose?.(event);\n }}\n >\n <Popper\n style={{\n // @ts-ignore\n \"--popper-width\": enablePortal\n ? `${anchorEl?.clientWidth}px`\n : \"100%\",\n }}\n open={openProp ?? isOpen}\n disablePortal={!enablePortal}\n container={enablePortal ? getContainerElement(rootId) : undefined}\n anchorEl={anchorEl}\n className={cx(classes.popper, {\n [classes.portal]: enablePortal,\n })}\n >\n <HvSelectionList\n className={classes.list}\n id={setId(localId, \"list\")}\n onChange={onSuggestionSelected}\n >\n {suggestionValues?.map((item) => (\n <HvListItem key={item.id} value={item} disabled={item.disabled}>\n {item.label}\n </HvListItem>\n ))}\n </HvSelectionList>\n </Popper>\n </ClickAwayListener>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsDO,MAAM,gBAAgB,WAI3B,CAAC,OAAO,WAAW;AACb,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX,eAAe;AAAA,IACf,MAAM;AAAA,IACN;AAAA,IACA,mBAAmB,CAAC;AAAA,IACpB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACD,IAAA;AAEJ,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,QAAA,EAAE,WAAW;AAEnB,QAAM,EAAE,UAAA,IAAc,WAAW,oBAAoB;AACrD,QAAM,UAAU,MAAM,MAAM,WAAW,aAAa;AAE9C,QAAA,MAAM,OAAuB,IAAI;AACjC,QAAA,YAAY,WAAW,KAAK,MAAM;AAGxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,QAAQ;AAC7C,YAAU,MAAM;AACd,cAAU,QAAQ;AAAA,EAAA,GACjB,CAAC,QAAQ,CAAC;AAGX,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,MACpC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAa,CAAC,UAAU;AACtB,sBAAU,KAAK;AACf,sBAAU,KAAK;AAAA,UACjB;AAAA,UAEA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAO;AAAA;AAAA,gBAEL,kBAAkB,eACd,GAAG,UAAU,WAAW,OACxB;AAAA,cACN;AAAA,cACA,MAAM,YAAY;AAAA,cAClB,eAAe,CAAC;AAAA,cAChB,WAAW,eAAe,oBAAoB,MAAM,IAAI;AAAA,cACxD;AAAA,cACA,WAAW,GAAG,QAAQ,QAAQ;AAAA,gBAC5B,CAAC,QAAQ,MAAM,GAAG;AAAA,cAAA,CACnB;AAAA,cAED,UAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAW,QAAQ;AAAA,kBACnB,IAAI,MAAM,SAAS,MAAM;AAAA,kBACzB,UAAU;AAAA,kBAET,UAAkB,kBAAA,IAAI,CAAC,6BACrB,YAAyB,EAAA,OAAO,MAAM,UAAU,KAAK,UACnD,UAAA,KAAK,SADS,KAAK,EAEtB,CACD;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"Suggestions.js","sources":["../../../../src/Forms/Suggestions/Suggestions.tsx"],"sourcesContent":["import { forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport {\n ClickAwayListener,\n ClickAwayListenerProps,\n} from \"@mui/base/ClickAwayListener\";\nimport { Popper } from \"@mui/base/Popper\";\nimport { useForkRef } from \"@mui/material/utils\";\nimport { useTheme, type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvListItem } from \"../../ListContainer\";\nimport { HvSelectionList } from \"../../SelectionList\";\nimport { HvBaseProps } from \"../../types/generic\";\nimport { getContainerElement } from \"../../utils/document\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./Suggestions.styles\";\n\nexport { staticClasses as suggestionsClasses };\n\nexport type HvSuggestionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSuggestion {\n id?: string;\n label: React.ReactNode;\n value?: string;\n disabled?: boolean;\n}\n\nexport interface HvSuggestionsProps extends HvBaseProps {\n /** Whether suggestions is visible */\n open?: boolean;\n /**\n * Whether suggestions is visible.\n * @deprecated use `open` instead.\n * */\n expanded?: boolean;\n /** The HTML element Suggestions attaches to. */\n anchorEl?: HTMLElement | null;\n /** Array of { id, label, ...others } values to display in the suggestion list */\n suggestionValues?: HvSuggestion[] | null;\n /** Function called when a suggestion is selected */\n onSuggestionSelected?: (event: React.MouseEvent, value: HvSuggestion) => void;\n /** Function called when suggestion list is closed */\n onClose?: ClickAwayListenerProps[\"onClickAway\"];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvSuggestionsClasses;\n /**\n * If enabled, the suggestions list will be rendered using a portal.\n * If disabled, it will be under the DOM hierarchy of the parent component.\n * @default false\n * */\n enablePortal?: boolean;\n}\n\nexport const HvSuggestions = forwardRef<\n // no-indent\n unknown,\n HvSuggestionsProps\n>((props, extRef) => {\n const {\n id,\n className,\n classes: classesProp,\n expanded = false,\n enablePortal = false,\n open: openProp,\n anchorEl,\n suggestionValues = [],\n onClose,\n onSuggestionSelected,\n ...others\n } = props;\n\n const { classes, cx } = useClasses(classesProp);\n\n const { rootId } = useTheme();\n\n const { elementId } = useContext(HvFormElementContext);\n const localId = id ?? setId(elementId, \"suggestions\");\n\n const ref = useRef<HTMLDivElement>(null);\n const forkedRef = useForkRef(ref, extRef);\n\n // TODO: remove controlled+uncontrolled `expanded` prop in v6\n const [isOpen, setIsOpen] = useState(expanded);\n useEffect(() => {\n setIsOpen(expanded);\n }, [expanded]);\n\n return (\n <div\n id={localId}\n ref={forkedRef}\n className={cx(classes.root, className)}\n {...others}\n >\n <ClickAwayListener\n onClickAway={(event) => {\n setIsOpen(false);\n onClose?.(event);\n }}\n >\n <Popper\n style={{\n // @ts-ignore\n \"--popper-width\": enablePortal\n ? `${anchorEl?.clientWidth}px`\n : \"100%\",\n }}\n open={openProp ?? isOpen}\n disablePortal={!enablePortal}\n container={enablePortal ? getContainerElement(rootId) : undefined}\n anchorEl={anchorEl}\n className={cx(classes.popper, {\n [classes.portal]: enablePortal,\n })}\n >\n <HvSelectionList\n className={classes.list}\n id={setId(localId, \"list\")}\n onChange={onSuggestionSelected}\n >\n {suggestionValues?.map((item) => (\n <HvListItem key={item.id} value={item} disabled={item.disabled}>\n {item.label}\n </HvListItem>\n ))}\n </HvSelectionList>\n </Popper>\n </ClickAwayListener>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsDO,MAAM,gBAAgB,WAI3B,CAAC,OAAO,WAAW;AACb,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX,eAAe;AAAA,IACf,MAAM;AAAA,IACN;AAAA,IACA,mBAAmB,CAAC;AAAA,IACpB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAEJ,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,EAAE,OAAO,IAAI,SAAS;AAE5B,QAAM,EAAE,UAAA,IAAc,WAAW,oBAAoB;AACrD,QAAM,UAAU,MAAM,MAAM,WAAW,aAAa;AAE9C,QAAA,MAAM,OAAuB,IAAI;AACjC,QAAA,YAAY,WAAW,KAAK,MAAM;AAGxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,QAAQ;AAC7C,YAAU,MAAM;AACd,cAAU,QAAQ;AAAA,EAAA,GACjB,CAAC,QAAQ,CAAC;AAGX,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,MACpC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAa,CAAC,UAAU;AACtB,sBAAU,KAAK;AACf,sBAAU,KAAK;AAAA,UACjB;AAAA,UAEA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAO;AAAA;AAAA,gBAEL,kBAAkB,eACd,GAAG,UAAU,WAAW,OACxB;AAAA,cACN;AAAA,cACA,MAAM,YAAY;AAAA,cAClB,eAAe,CAAC;AAAA,cAChB,WAAW,eAAe,oBAAoB,MAAM,IAAI;AAAA,cACxD;AAAA,cACA,WAAW,GAAG,QAAQ,QAAQ;AAAA,gBAC5B,CAAC,QAAQ,MAAM,GAAG;AAAA,cAAA,CACnB;AAAA,cAED,UAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAW,QAAQ;AAAA,kBACnB,IAAI,MAAM,SAAS,MAAM;AAAA,kBACzB,UAAU;AAAA,kBAET,UAAkB,kBAAA,IAAI,CAAC,6BACrB,YAAyB,EAAA,OAAO,MAAM,UAAU,KAAK,UACnD,UAAA,KAAK,MADS,GAAA,KAAK,EAEtB,CACD;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Suggestions.styles.js","sources":["../../../../src/Forms/Suggestions/Suggestions.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSuggestions\", {\n root: { position: \"relative\" },\n list: {\n backgroundColor: theme.colors.atmo1,\n boxShadow: theme.colors.shadow,\n padding: theme.space.xs,\n width: \"100%\",\n },\n popper: {\n width: \"var(--popper-width)\",\n position: \"absolute\",\n zIndex: theme.zIndices.tooltip,\n \":not($portal)\": {\n transform: \"translate3d(0, -1px, 0) !important\",\n },\n },\n portal: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM,EAAE,UAAU,WAAW;AAAA,EAC7B,MAAM;AAAA,IACJ,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,MAAM,OAAO;AAAA,IACxB,SAAS,MAAM,MAAM;AAAA,IACrB,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,QAAQ,MAAM,SAAS;AAAA,IACvB,iBAAiB;AAAA,MACf,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,QAAQ,CAAC;AACX,CAAC;"}
1
+ {"version":3,"file":"Suggestions.styles.js","sources":["../../../../src/Forms/Suggestions/Suggestions.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSuggestions\", {\n root: { position: \"relative\" },\n list: {\n backgroundColor: theme.colors.atmo1,\n boxShadow: theme.colors.shadow,\n padding: theme.space.xs,\n width: \"100%\",\n },\n popper: {\n width: \"var(--popper-width)\",\n position: \"absolute\",\n zIndex: theme.zIndices.tooltip,\n \":not($portal)\": {\n transform: \"translate3d(0, -1px, 0) !important\",\n },\n },\n portal: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM,EAAE,UAAU,WAAW;AAAA,EAC7B,MAAM;AAAA,IACJ,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW,MAAM,OAAO;AAAA,IACxB,SAAS,MAAM,MAAM;AAAA,IACrB,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,QAAQ,MAAM,SAAS;AAAA,IACvB,iBAAiB;AAAA,MACf,WAAW;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,QAAQ,CAAA;AACV,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WarningText.js","sources":["../../../../src/Forms/WarningText/WarningText.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { Fail } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./WarningText.styles\";\n\nexport { staticClasses as warningTextClasses };\n\nexport type HvWarningTextClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvWarningTextProps extends HvBaseProps {\n /** Icon to be rendered alongside the warning text. */\n adornment?: React.ReactNode;\n /** If `true` the text is not rendered. */\n isVisible?: boolean;\n /** If `true` the text is disabled. */\n disabled?: boolean;\n /** If `true` the text won't include a gutter. */\n disableGutter?: boolean;\n /** If `true` the text won't include the top border. */\n disableBorder?: boolean;\n /** If `true` the adornment icon isn't shown. */\n disableAdornment?: boolean;\n /** If `true` the text isn't shown. */\n hideText?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvWarningTextClasses;\n}\n\n/**\n * Provides the user with a descriptive text, signaling an error, for when the form element is in an invalid state.\n */\nexport const HvWarningText = (props: HvWarningTextProps) => {\n const {\n children,\n adornment,\n isVisible,\n classes: classesProp,\n className,\n id,\n disabled,\n disableGutter = false,\n disableBorder = false,\n disableAdornment = false,\n hideText = false,\n ...others\n } = useDefaultProps(\"HvWarningText\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementStatus, elementDisabled } =\n useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localVisible = isVisible ?? elementStatus === \"invalid\";\n const localId = id ?? setId(elementId, \"error\");\n const showWarning = localVisible && !localDisabled;\n const content = showWarning ? children : \"\";\n const localAdornment = adornment || (\n <Fail iconSize=\"XS\" className={classes.defaultIcon} color=\"negative\" />\n );\n\n return (\n <div\n className={cx(\n classes.root,\n {\n [classes.show]: showWarning,\n [classes.topBorder]: !disableBorder,\n },\n className,\n )}\n >\n {!disableAdornment && localAdornment}\n <HvTypography\n id={localId}\n className={cx(classes.warningText, {\n [classes.topGutter]: !disableGutter,\n [classes.hideText]: hideText,\n })}\n variant=\"caption1\"\n role=\"status\"\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n {...others}\n >\n {showWarning && content}\n </HvT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;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"WarningText.js","sources":["../../../../src/Forms/WarningText/WarningText.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { Fail } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport { HvFormElementContext } from \"../FormElement\";\nimport { staticClasses, useClasses } from \"./WarningText.styles\";\n\nexport { staticClasses as warningTextClasses };\n\nexport type HvWarningTextClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvWarningTextProps extends HvBaseProps {\n /** Icon to be rendered alongside the warning text. */\n adornment?: React.ReactNode;\n /** If `true` the text is not rendered. */\n isVisible?: boolean;\n /** If `true` the text is disabled. */\n disabled?: boolean;\n /** If `true` the text won't include a gutter. */\n disableGutter?: boolean;\n /** If `true` the text won't include the top border. */\n disableBorder?: boolean;\n /** If `true` the adornment icon isn't shown. */\n disableAdornment?: boolean;\n /** If `true` the text isn't shown. */\n hideText?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvWarningTextClasses;\n}\n\n/**\n * Provides the user with a descriptive text, signaling an error, for when the form element is in an invalid state.\n */\nexport const HvWarningText = (props: HvWarningTextProps) => {\n const {\n children,\n adornment,\n isVisible,\n classes: classesProp,\n className,\n id,\n disabled,\n disableGutter = false,\n disableBorder = false,\n disableAdornment = false,\n hideText = false,\n ...others\n } = useDefaultProps(\"HvWarningText\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId, elementStatus, elementDisabled } =\n useContext(HvFormElementContext);\n const localDisabled = disabled || elementDisabled;\n const localVisible = isVisible ?? elementStatus === \"invalid\";\n const localId = id ?? setId(elementId, \"error\");\n const showWarning = localVisible && !localDisabled;\n const content = showWarning ? children : \"\";\n const localAdornment = adornment || (\n <Fail iconSize=\"XS\" className={classes.defaultIcon} color=\"negative\" />\n );\n\n return (\n <div\n className={cx(\n classes.root,\n {\n [classes.show]: showWarning,\n [classes.topBorder]: !disableBorder,\n },\n className,\n )}\n >\n {!disableAdornment && localAdornment}\n <HvTypography\n id={localId}\n className={cx(classes.warningText, {\n [classes.topGutter]: !disableGutter,\n [classes.hideText]: hideText,\n })}\n variant=\"caption1\"\n role=\"status\"\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n {...others}\n >\n {showWarning && content}\n </HvTypography>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAuCa,MAAA,gBAAgB,CAAC,UAA8B;AACpD,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,EAAE,WAAW,eAAe,gBAAgB,IAChD,WAAW,oBAAoB;AACjC,QAAM,gBAAgB,YAAY;AAC5B,QAAA,eAAe,aAAa,kBAAkB;AACpD,QAAM,UAAU,MAAM,MAAM,WAAW,OAAO;AACxC,QAAA,cAAc,gBAAgB,CAAC;AAC/B,QAAA,UAAU,cAAc,WAAW;AACnC,QAAA,iBAAiB,aACrB,oBAAC,MAAK,EAAA,UAAS,MAAK,WAAW,QAAQ,aAAa,OAAM,WAAW,CAAA;AAIrE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,IAAI,GAAG;AAAA,UAChB,CAAC,QAAQ,SAAS,GAAG,CAAC;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAAA,MAEC,UAAA;AAAA,QAAA,CAAC,oBAAoB;AAAA,QACtB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ,WAAW,GAAG,QAAQ,aAAa;AAAA,cACjC,CAAC,QAAQ,SAAS,GAAG,CAAC;AAAA,cACtB,CAAC,QAAQ,QAAQ,GAAG;AAAA,YAAA,CACrB;AAAA,YACD,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,aAAU;AAAA,YACV,iBAAc;AAAA,YACb,GAAG;AAAA,YAEH,UAAe,eAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalActions.js","sources":["../../../src/GlobalActions/GlobalActions.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { useTheme as useMuiTheme } from \"@mui/material/styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport {\n getBreakpointStyles,\n staticClasses,\n useClasses,\n} from \"./GlobalActions.styles\";\n\nexport { staticClasses as globalActionsClasses };\nexport type HvGlobalActionsClasses = ExtractNames<typeof useClasses>;\n\nexport type HvGlobalActionsVariant = \"global\" | \"section\";\nexport type HvGlobalActionsPosition = \"sticky\" | \"fixed\" | \"relative\";\nexport type HvGlobalActionsHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface HvGlobalActionsProps\n extends HvBaseProps<HTMLDivElement, \"title\"> {\n /** Text to display in the component. */\n title?: React.ReactNode;\n /** Denotes if this is a global or section component. */\n variant?: HvGlobalActionsVariant;\n /** User can pass in a fully customized button or false for when the back button should not be rendered. */\n backButton?: React.ReactNode;\n /** Heading Level to apply to Title Area. */\n headingLevel?: HvGlobalActionsHeadingLevel;\n /**\n * Position of the Global Actions.\n * @default variant === \"global\" ? \"sticky\" : \"relative\"\n */\n position?: HvGlobalActionsPosition;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvGlobalActionsClasses;\n}\n\n/**\n * Global Actions are actions that affect the entire page they live in.\n * They should persist while scrolling down the screen.\n */\nexport const HvGlobalActions = forwardRef<\n React.ComponentRef<\"div\">,\n HvGlobalActionsProps\n>(function HvGlobalActions(props, ref) {\n const {\n children,\n classes: classesProp,\n className,\n title,\n variant = \"global\",\n backButton,\n headingLevel,\n position: positionProp,\n ...others\n } = useDefaultProps(\"HvGlobalActions\", props);\n const muiTheme = useMuiTheme();\n const { classes, cx, css } = useClasses(classesProp);\n const isSmDown = useMediaQuery(muiTheme.breakpoints.down(\"sm\"));\n const isUpMd = useMediaQuery(muiTheme.breakpoints.up(\"md\"));\n\n const headingLevelToApply = headingLevel || (variant === \"global\" ? 1 : 2);\n\n const position =\n positionProp || (variant === \"global\" ? \"sticky\" : \"relative\");\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n {\n [classes.positionSticky]: position === \"sticky\",\n [classes.positionFixed]: position === \"fixed\",\n [classes.global]: variant === \"global\",\n [classes.section]: variant === \"section\",\n },\n position === \"fixed\" && css(getBreakpointStyles(isUpMd, isSmDown)),\n className,\n )}\n {...others}\n >\n <div\n className={cx(classes.wrapper, {\n [classes.globalWrapperComplement]: variant === \"global\",\n [classes.globalSectionArea]: variant === \"section\",\n })}\n >\n {variant === \"global\" && backButton && (\n <div className={classes.backButton}>{backButton}</div>\n )}\n {typeof title !== \"string\" ? (\n title\n ) : (\n <HvTypography\n variant={variant === \"global\" ? \"title3\" : \"title4\"}\n component={`h${headingLevelToApply}`}\n className={cx(classes.name, {\n [classes.sectionName]: variant !== \"global\",\n })}\n >\n {title}\n </HvTypography>\n )}\n {children && <div className={classes.actions}>{children}</div>}\n </div>\n </div>\n );\n});\n"],"names":["HvGlobalActions","useMuiTheme"],"mappings":";;;;;;;;AA8CO,MAAM,kBAAkB,WAG7B,SAASA,iBAAgB,O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A,gBAC3C,WAAW,IAAI,mBAAmB;AAAA,gBAClC,WAAW,GAAG,QAAQ,MAAM;AAAA,kBAC1B,CAAC,QAAQ,WAAW,GAAG,YAAY;AAAA,gBAAA,CACpC;AAAA,gBAEA,UAAA;AAAA,cAAA;AAAA,YACH;AAAA,YAED,YAAa,oBAAA,OAAA,EAAI,WAAW,QAAQ,SAAU,UAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1D;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"GlobalActions.js","sources":["../../../src/GlobalActions/GlobalActions.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { useTheme as useMuiTheme } from \"@mui/material/styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport {\n getBreakpointStyles,\n staticClasses,\n useClasses,\n} from \"./GlobalActions.styles\";\n\nexport { staticClasses as globalActionsClasses };\nexport type HvGlobalActionsClasses = ExtractNames<typeof useClasses>;\n\nexport type HvGlobalActionsVariant = \"global\" | \"section\";\nexport type HvGlobalActionsPosition = \"sticky\" | \"fixed\" | \"relative\";\nexport type HvGlobalActionsHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface HvGlobalActionsProps\n extends HvBaseProps<HTMLDivElement, \"title\"> {\n /** Text to display in the component. */\n title?: React.ReactNode;\n /** Denotes if this is a global or section component. */\n variant?: HvGlobalActionsVariant;\n /** User can pass in a fully customized button or false for when the back button should not be rendered. */\n backButton?: React.ReactNode;\n /** Heading Level to apply to Title Area. */\n headingLevel?: HvGlobalActionsHeadingLevel;\n /**\n * Position of the Global Actions.\n * @default variant === \"global\" ? \"sticky\" : \"relative\"\n */\n position?: HvGlobalActionsPosition;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvGlobalActionsClasses;\n}\n\n/**\n * Global Actions are actions that affect the entire page they live in.\n * They should persist while scrolling down the screen.\n */\nexport const HvGlobalActions = forwardRef<\n React.ComponentRef<\"div\">,\n HvGlobalActionsProps\n>(function HvGlobalActions(props, ref) {\n const {\n children,\n classes: classesProp,\n className,\n title,\n variant = \"global\",\n backButton,\n headingLevel,\n position: positionProp,\n ...others\n } = useDefaultProps(\"HvGlobalActions\", props);\n const muiTheme = useMuiTheme();\n const { classes, cx, css } = useClasses(classesProp);\n const isSmDown = useMediaQuery(muiTheme.breakpoints.down(\"sm\"));\n const isUpMd = useMediaQuery(muiTheme.breakpoints.up(\"md\"));\n\n const headingLevelToApply = headingLevel || (variant === \"global\" ? 1 : 2);\n\n const position =\n positionProp || (variant === \"global\" ? \"sticky\" : \"relative\");\n\n return (\n <div\n ref={ref}\n className={cx(\n classes.root,\n {\n [classes.positionSticky]: position === \"sticky\",\n [classes.positionFixed]: position === \"fixed\",\n [classes.global]: variant === \"global\",\n [classes.section]: variant === \"section\",\n },\n position === \"fixed\" && css(getBreakpointStyles(isUpMd, isSmDown)),\n className,\n )}\n {...others}\n >\n <div\n className={cx(classes.wrapper, {\n [classes.globalWrapperComplement]: variant === \"global\",\n [classes.globalSectionArea]: variant === \"section\",\n })}\n >\n {variant === \"global\" && backButton && (\n <div className={classes.backButton}>{backButton}</div>\n )}\n {typeof title !== \"string\" ? (\n title\n ) : (\n <HvTypography\n variant={variant === \"global\" ? \"title3\" : \"title4\"}\n component={`h${headingLevelToApply}`}\n className={cx(classes.name, {\n [classes.sectionName]: variant !== \"global\",\n })}\n >\n {title}\n </HvTypography>\n )}\n {children && <div className={classes.actions}>{children}</div>}\n </div>\n </div>\n );\n});\n"],"names":["HvGlobalActions","useMuiTheme"],"mappings":";;;;;;;;AA8CO,MAAM,kBAAkB,WAG7B,SAASA,iBAAgB,OAAO,KAAK;AAC/B,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,UAAU;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CAAC,QAAQ,WAAW,GAAG,YAAY;AAAA,gBAAA,CACpC;AAAA,gBAEA,UAAA;AAAA,cAAA;AAAA,YACH;AAAA,YAED,YAAa,oBAAA,OAAA,EAAI,WAAW,QAAQ,SAAU,SAAS,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1D;AAAA,EACF;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalActions.styles.js","sources":["../../../src/GlobalActions/GlobalActions.styles.tsx"],"sourcesContent":["import type { CSSInterpolation } from \"@emotion/serialize\";\nimport { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvGlobalActions\", {\n root: {\n position: \"relative\",\n },\n positionSticky: {\n width: \"100%\",\n position: \"sticky\",\n },\n positionFixed: {\n width: \"100%\",\n position: \"fixed\",\n },\n global: {\n zIndex: `calc(${theme.zIndices.banner} - 2)`,\n top: 0,\n left: 0,\n padding: theme.spacing(1, 0),\n backdropFilter: \"blur(1px)\",\n\n \"&:before\": {\n content: \"''\",\n display: \"flex\",\n position: \"absolute\",\n inset: 0,\n background: theme.colors.atmo2,\n opacity: \"75%\",\n },\n\n \"& $wrapper\": {\n top: 0,\n left: 0,\n backgroundColor: theme.colors.atmo1,\n width: \"100%\",\n borderWidth: 1,\n borderRadius: theme.radii.round,\n },\n },\n section: {\n \"& $wrapper\": {\n borderTopWidth: 1,\n paddingLeft: 0,\n },\n },\n wrapper: {\n padding: theme.space.xs,\n position: \"relative\",\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n gap: theme.space.xs,\n borderColor: theme.colors.atmo4,\n paddingLeft: theme.space.sm,\n },\n\n /** @deprecated use classes.global $wrapper */\n globalSectionArea: {},\n /** @deprecated use classes.section $wrapper */\n globalWrapperComplement: {},\n backButton: {},\n name: {\n flexGrow: 1,\n },\n /** @deprecated use classes.name */\n sectionName: {},\n actions: {\n display: \"flex\",\n alignItems: \"center\",\n gap: theme.space.xs,\n // TODO: remove in v6 in favour of consistently setting `flexGrow: 1` in a title \"wrapper\"\n marginLeft: \"auto\",\n },\n});\n\nexport const getBreakpointStyles = (\n isUpMd: boolean,\n isSmDown: boolean,\n): CSSInterpolation => {\n const unit = isUpMd ? 4 : isSmDown ? 2 : 0;\n if (!unit) return {};\n\n return {\n width: `calc(100% - 2 * ${theme.spacing(unit)})`,\n marginLeft: theme.spacing(unit),\n marginRight: theme.spacing(unit),\n };\n};\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,IACb,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ,QAAQ,MAAM,SAAS,MAAM;AAAA,IACrC,KAAK;AAAA,IACL,MAAM;AAAA,IACN,SAAS,MAAM,QAAQ,GAAG,CAAC;AAAA,IAC3B,gBAAgB;AAAA,IAEhB,YAAY;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY,MAAM,OAAO;AAAA,MACzB,SAAS;AAAA,IACX;AAAA,IAEA,cAAc;AAAA,MACZ,KAAK;AAAA,MACL,MAAM;AAAA,MACN,iBAAiB,MAAM,OAAO;AAAA,MAC9B,OAAO;AAAA,MACP,aAAa;AAAA,MACb,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,cAAc;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,SAAS,MAAM,MAAM;AAAA,IACrB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,KAAK,MAAM,MAAM;AAAA,IACjB,aAAa,MAAM,OAAO;AAAA,IAC1B,aAAa,MAAM,MAAM;AAAA,EAC3B;AAAA;AAAA,EAGA,mBAAmB,CAAC;AAAA;AAAA,EAEpB,yBAAyB,CAAC;AAAA,EAC1B,YAAY,CAAC;AAAA,EACb,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA;AAAA,EAEA,aAAa,CAAC;AAAA,EACd,SAAS;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK,MAAM,MAAM;AAAA;AAAA,IAEjB,YAAY;AAAA,EACd;AACF,CAAC;AAEY,MAAA,sBAAsB,CACjC,QACA,aACqB;AACrB,QAAM,OAAO,SAAS,IAAI,WAAW,IAAI;AACrC,MAAA,CAAC,KAAM,QAAO;AAEX,SAAA;AAAA,IACL,OAAO,mBAAmB,MAAM,QAAQ,IAAI,CAAC;AAAA,IAC7C,YAAY,MAAM,QAAQ,IAAI;AAAA,IAC9B,aAAa,MAAM,QAAQ,IAAI;AAAA,EAAA;AAEnC;"}
1
+ {"version":3,"file":"GlobalActions.styles.js","sources":["../../../src/GlobalActions/GlobalActions.styles.tsx"],"sourcesContent":["import type { CSSInterpolation } from \"@emotion/serialize\";\nimport { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvGlobalActions\", {\n root: {\n position: \"relative\",\n },\n positionSticky: {\n width: \"100%\",\n position: \"sticky\",\n },\n positionFixed: {\n width: \"100%\",\n position: \"fixed\",\n },\n global: {\n zIndex: `calc(${theme.zIndices.banner} - 2)`,\n top: 0,\n left: 0,\n padding: theme.spacing(1, 0),\n backdropFilter: \"blur(1px)\",\n\n \"&:before\": {\n content: \"''\",\n display: \"flex\",\n position: \"absolute\",\n inset: 0,\n background: theme.colors.atmo2,\n opacity: \"75%\",\n },\n\n \"& $wrapper\": {\n top: 0,\n left: 0,\n backgroundColor: theme.colors.atmo1,\n width: \"100%\",\n borderWidth: 1,\n borderRadius: theme.radii.round,\n },\n },\n section: {\n \"& $wrapper\": {\n borderTopWidth: 1,\n paddingLeft: 0,\n },\n },\n wrapper: {\n padding: theme.space.xs,\n position: \"relative\",\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n gap: theme.space.xs,\n borderColor: theme.colors.atmo4,\n paddingLeft: theme.space.sm,\n },\n\n /** @deprecated use classes.global $wrapper */\n globalSectionArea: {},\n /** @deprecated use classes.section $wrapper */\n globalWrapperComplement: {},\n backButton: {},\n name: {\n flexGrow: 1,\n },\n /** @deprecated use classes.name */\n sectionName: {},\n actions: {\n display: \"flex\",\n alignItems: \"center\",\n gap: theme.space.xs,\n // TODO: remove in v6 in favour of consistently setting `flexGrow: 1` in a title \"wrapper\"\n marginLeft: \"auto\",\n },\n});\n\nexport const getBreakpointStyles = (\n isUpMd: boolean,\n isSmDown: boolean,\n): CSSInterpolation => {\n const unit = isUpMd ? 4 : isSmDown ? 2 : 0;\n if (!unit) return {};\n\n return {\n width: `calc(100% - 2 * ${theme.spacing(unit)})`,\n marginLeft: theme.spacing(unit),\n marginRight: theme.spacing(unit),\n };\n};\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,IACb,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ,QAAQ,MAAM,SAAS,MAAM;AAAA,IACrC,KAAK;AAAA,IACL,MAAM;AAAA,IACN,SAAS,MAAM,QAAQ,GAAG,CAAC;AAAA,IAC3B,gBAAgB;AAAA,IAEhB,YAAY;AAAA,MACV,SAAS;AAAA,MAC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"],"sourcesContent":["import { forwardRef } from \"react\";\nimport MuiGrid, { GridProps as MuiGridProps } from \"@mui/material/Grid\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { useWidth } from \"../hooks/useWidth\";\nimport { staticClasses, useClasses } from \"./Grid.styles\";\n\nexport { staticClasses as gridClasses };\n\nexport type HvGridClasses = ExtractNames<typeof useClasses>;\n\nconst BREAKPOINT_GUTTERS = {\n xs: 2,\n sm: 2,\n md: 4,\n lg: 4,\n xl: 4,\n};\n\nconst BREAKPOINT_COLUMNS = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 12,\n xl: 12,\n};\n\nexport type HvGridDirection =\n | \"row\"\n | \"row-reverse\"\n | \"column\"\n | \"column-reverse\";\n\nexport type HvGridSpacing =\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"auto\"\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10;\n\nexport interface HvGridProps extends Omit<MuiGridProps, \"classes\" | \"columns\"> {\n /**\n * If `true`, the component will have the flex *container* behavior.\n * You should be wrapping *items* with a *container*.\n */\n container?: boolean;\n /**\n * If `true`, the component will have the flex *item* behavior.\n * You should be wrapping *items* with a *container*.\n */\n item?: boolean;\n /**\n * Defines the space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n */\n spacing?: HvGridSpacing | number;\n /**\n * Defines the vertical space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n rowSpacing?: HvGridSpacing | number;\n /**\n * Defines the horizontal space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n columnSpacing?: HvGridSpacing | number;\n /**\n * The number of columns.\n * Defaults to a 12-column grid.\n * The value \"auto\" implements the Design System directives in terms of variable number of columns.\n * @default 12\n */\n columns?: \"auto\" | MuiGridProps[\"columns\"];\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n */\n direction?: HvGridDirection;\n /**\n * Defines the `justify-content` style property.\n * It is applied for all screen sizes.\n */\n justify?:\n | \"flex-start\"\n | \"center\"\n | \"flex-end\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for all the screen sizes with the lowest priority.\n */\n xs?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `sm` breakpoint and wider screens if not overridden.\n */\n sm?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `md` breakpoint and wider screens if not overridden.\n */\n md?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `lg` breakpoint and wider screens if not overridden.\n */\n lg?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `xl` breakpoint and wider screens.\n */\n xl?: number | boolean;\n /**\n * Defines the `flex-wrap` style property.\n * It's applied for all screen sizes.\n */\n wrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n /**\n * If `true`, it sets `min-width: 0` on the item.\n * Refer to the limitations section of the documentation to better understand the use case.\n */\n zeroMinWidth?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvGridClasses;\n}\n\nfunction getGridSpacing(spacing: HvGridProps[\"spacing\"]) {\n let gridSpacing: MuiGridProps[\"spacing\"];\n\n if (typeof spacing === \"string\") {\n if (spacing === \"auto\") {\n gridSpacing = BREAKPOINT_GUTTERS;\n } else {\n gridSpacing = BREAKPOINT_GUTTERS[spacing];\n }\n } else if (typeof spacing === \"object\") {\n gridSpacing = Object.keys(spacing).reduce<Record<string, number>>(\n (acc, bp) => {\n acc[bp] = BREAKPOINT_GUTTERS[spacing[bp]] ?? spacing[bp];\n return acc;\n },\n {},\n );\n } else if (spacing === 0) {\n gridSpacing = { xs: 0 };\n } else {\n gridSpacing = spacing;\n }\n\n return gridSpacing;\n}\n\nfunction getNumberOfColumns(columns: HvGridProps[\"columns\"]) {\n let numberOfColumns: MuiGridProps[\"columns\"];\n\n if (columns === \"auto\") {\n numberOfColumns = BREAKPOINT_COLUMNS;\n } else {\n numberOfColumns = columns;\n }\n\n return numberOfColumns;\n}\n\nfunction getContainerProps(\n spacing: HvGridProps[\"spacing\"],\n rowSpacing: HvGridProps[\"rowSpacing\"],\n columnSpacing: HvGridProps[\"columnSpacing\"],\n columns: HvGridProps[\"columns\"],\n) {\n const containerProps: Pick<\n MuiGridProps,\n \"container\" | \"spacing\" | \"rowSpacing\" | \"columnSpacing\" | \"columns\"\n > = { container: true };\n\n if (spacing != null) {\n containerProps.spacing = getGridSpacing(spacing);\n }\n if (rowSpacing != null) {\n containerProps.rowSpacing = getGridSpacing(rowSpacing);\n }\n if (columnSpacing != null) {\n containerProps.columnSpacing = getGridSpacing(columnSpacing);\n }\n if (columns != null) {\n containerProps.columns = getNumberOfColumns(columns);\n }\n\n return containerProps;\n}\n\nconst WidthGrid = forwardRef<HTMLDivElement, HvGridProps>((props, ref) => {\n const { container, spacing, rowSpacing, columnSpacing, columns, ...others } =\n props;\n\n const width = useWidth();\n\n const containerProps = container\n ? getContainerProps(\n spacing === \"auto\" ? width : spacing,\n rowSpacing === \"auto\" ? width : rowSpacing,\n columnSpacing === \"auto\" ? width : columnSpacing,\n columns,\n )\n : {};\n\n return <MuiGrid ref={ref} {...containerProps} {...others} />;\n});\n\n/**\n * The grid creates visual consistency between layouts while allowing flexibility\n * across a wide variety of designs. This component is based on a 12-column grid layout.\n *\n * It's based on the [Material UI Grid](https://mui.com/material-ui/react-grid/).\n *\n * The definitions were set following the Design System directives:\n *\n * | Breakpoint | Width (in px) | Gutters (in px) | Number of columns |\n * | ---------- | ------------- | --------------- | ----------------- |\n * | xs | [0-600[ | 16 | 4 |\n * | sm | [600-960[ | 16 | 8 |\n * | md | [960-1270[ | 32 | 12 |\n * | lg | [1270-1920[ | 32 | 12 |\n * | xl | [1920-...[ | 32 | 12 |\n *\n * However, the number of columns is set to 12 for all breakpoints, as it serves most\n * of the use cases and simplifies the implementation.\n * To opt-in to the Design System directives, you can set the `columns` prop to `auto`.\n *\n * Also, the Design System specifications are omissive about the horizontal gutters.\n * The HvGrid sets them to the same value as the vertical gutters, depending on the breakpoint.\n * It can be overridden by setting the `rowSpacing` prop.\n */\nexport const HvGrid = forwardRef<\n // no-indent\n HTMLDivElement,\n HvGridProps\n>(function HvGrid(props, ref) {\n const {\n item,\n container,\n spacing = \"auto\",\n rowSpacing,\n columnSpacing,\n columns,\n classes: classesProp,\n ...others\n } = useDefaultProps(\"HvGrid\", props);\n\n const { classes } = useClasses(classesProp);\n\n // Fixes MUI error when using spacings as objects and the grid is an item and container\n // When set to \"auto\", the spacing changes depending on the screen's breakpoint\n // The condition avoids using useWidth and re-rendering the component unnecessarily\n if (\n container &&\n item &&\n (spacing === \"auto\" || rowSpacing === \"auto\" || columnSpacing === \"auto\")\n ) {\n return (\n <WidthGrid\n ref={ref}\n classes={classes}\n item={item}\n container={container}\n spacing={spacing}\n rowSpacing={rowSpacing}\n columnSpacing={columnSpacing}\n columns={columns}\n {...others}\n />\n );\n }\n\n const containerProps = container\n ? getContainerProps(spacing, rowSpacing, columnSpacing, columns)\n : {};\n\n return (\n <MuiGrid\n ref={ref}\n classes={classes}\n item={item}\n {...containerProps}\n {...others}\n />\n );\n});\n"],"names":["HvGrid"],"mappings":";;;;;;;AAcA,MAAM,qBAAqB;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,qBAAqB;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,I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kB,SAAS,QAAQ;AAAA,IACnC;AAAA,MAEF;AAEJ,6BAAQ,SAAQ,EAAA,KAAW,GAAG,gBAAiB,GAAG,OAAQ,CAAA;AAC5D,CAAC;AA0BM,MAAM,SAAS,WAIpB,SAASA,QAAO,OAAO,KAAK;AACtB,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,IACD,gBAAgB,UAAU,KAAK;AAEnC,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAK1C,MACE,aACA,SACC,YAAY,UAAU,eAAe,UAAU,kBAAkB,SAClE;AAEE,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AAEM,QAAA,iBAAiB,YACnB,kBAAkB,SAAS,YAAY,eAAe,OAAO,IAC7D;AAGF,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
1
+ {"version":3,"file":"Grid.js","sources":["../../../src/Grid/Grid.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport MuiGrid, { GridProps as MuiGridProps } from \"@mui/material/Grid\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { useWidth } from \"../hooks/useWidth\";\nimport { staticClasses, useClasses } from \"./Grid.styles\";\n\nexport { staticClasses as gridClasses };\n\nexport type HvGridClasses = ExtractNames<typeof useClasses>;\n\nconst BREAKPOINT_GUTTERS = {\n xs: 2,\n sm: 2,\n md: 4,\n lg: 4,\n xl: 4,\n};\n\nconst BREAKPOINT_COLUMNS = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 12,\n xl: 12,\n};\n\nexport type HvGridDirection =\n | \"row\"\n | \"row-reverse\"\n | \"column\"\n | \"column-reverse\";\n\nexport type HvGridSpacing =\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"auto\"\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10;\n\nexport interface HvGridProps extends Omit<MuiGridProps, \"classes\" | \"columns\"> {\n /**\n * If `true`, the component will have the flex *container* behavior.\n * You should be wrapping *items* with a *container*.\n */\n container?: boolean;\n /**\n * If `true`, the component will have the flex *item* behavior.\n * You should be wrapping *items* with a *container*.\n */\n item?: boolean;\n /**\n * Defines the space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n */\n spacing?: HvGridSpacing | number;\n /**\n * Defines the vertical space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n rowSpacing?: HvGridSpacing | number;\n /**\n * Defines the horizontal space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n columnSpacing?: HvGridSpacing | number;\n /**\n * The number of columns.\n * Defaults to a 12-column grid.\n * The value \"auto\" implements the Design System directives in terms of variable number of columns.\n * @default 12\n */\n columns?: \"auto\" | MuiGridProps[\"columns\"];\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n */\n direction?: HvGridDirection;\n /**\n * Defines the `justify-content` style property.\n * It is applied for all screen sizes.\n */\n justify?:\n | \"flex-start\"\n | \"center\"\n | \"flex-end\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for all the screen sizes with the lowest priority.\n */\n xs?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `sm` breakpoint and wider screens if not overridden.\n */\n sm?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `md` breakpoint and wider screens if not overridden.\n */\n md?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `lg` breakpoint and wider screens if not overridden.\n */\n lg?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `xl` breakpoint and wider screens.\n */\n xl?: number | boolean;\n /**\n * Defines the `flex-wrap` style property.\n * It's applied for all screen sizes.\n */\n wrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n /**\n * If `true`, it sets `min-width: 0` on the item.\n * Refer to the limitations section of the documentation to better understand the use case.\n */\n zeroMinWidth?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvGridClasses;\n}\n\nfunction getGridSpacing(spacing: HvGridProps[\"spacing\"]) {\n let gridSpacing: MuiGridProps[\"spacing\"];\n\n if (typeof spacing === \"string\") {\n if (spacing === \"auto\") {\n gridSpacing = BREAKPOINT_GUTTERS;\n } else {\n gridSpacing = BREAKPOINT_GUTTERS[spacing];\n }\n } else if (typeof spacing === \"object\") {\n gridSpacing = Object.keys(spacing).reduce<Record<string, number>>(\n (acc, bp) => {\n acc[bp] = BREAKPOINT_GUTTERS[spacing[bp]] ?? spacing[bp];\n return acc;\n },\n {},\n );\n } else if (spacing === 0) {\n gridSpacing = { xs: 0 };\n } else {\n gridSpacing = spacing;\n }\n\n return gridSpacing;\n}\n\nfunction getNumberOfColumns(columns: HvGridProps[\"columns\"]) {\n let numberOfColumns: MuiGridProps[\"columns\"];\n\n if (columns === \"auto\") {\n numberOfColumns = BREAKPOINT_COLUMNS;\n } else {\n numberOfColumns = columns;\n }\n\n return numberOfColumns;\n}\n\nfunction getContainerProps(\n spacing: HvGridProps[\"spacing\"],\n rowSpacing: HvGridProps[\"rowSpacing\"],\n columnSpacing: HvGridProps[\"columnSpacing\"],\n columns: HvGridProps[\"columns\"],\n) {\n const containerProps: Pick<\n MuiGridProps,\n \"container\" | \"spacing\" | \"rowSpacing\" | \"columnSpacing\" | \"columns\"\n > = { container: true };\n\n if (spacing != null) {\n containerProps.spacing = getGridSpacing(spacing);\n }\n if (rowSpacing != null) {\n containerProps.rowSpacing = getGridSpacing(rowSpacing);\n }\n if (columnSpacing != null) {\n containerProps.columnSpacing = getGridSpacing(columnSpacing);\n }\n if (columns != null) {\n containerProps.columns = getNumberOfColumns(columns);\n }\n\n return containerProps;\n}\n\nconst WidthGrid = forwardRef<HTMLDivElement, HvGridProps>((props, ref) => {\n const { container, spacing, rowSpacing, columnSpacing, columns, ...others } =\n props;\n\n const width = useWidth();\n\n const containerProps = container\n ? getContainerProps(\n spacing === \"auto\" ? width : spacing,\n rowSpacing === \"auto\" ? width : rowSpacing,\n columnSpacing === \"auto\" ? width : columnSpacing,\n columns,\n )\n : {};\n\n return <MuiGrid ref={ref} {...containerProps} {...others} />;\n});\n\n/**\n * The grid creates visual consistency between layouts while allowing flexibility\n * across a wide variety of designs. This component is based on a 12-column grid layout.\n *\n * It's based on the [Material UI Grid](https://mui.com/material-ui/react-grid/).\n *\n * The definitions were set following the Design System directives:\n *\n * | Breakpoint | Width (in px) | Gutters (in px) | Number of columns |\n * | ---------- | ------------- | --------------- | ----------------- |\n * | xs | [0-600[ | 16 | 4 |\n * | sm | [600-960[ | 16 | 8 |\n * | md | [960-1270[ | 32 | 12 |\n * | lg | [1270-1920[ | 32 | 12 |\n * | xl | [1920-...[ | 32 | 12 |\n *\n * However, the number of columns is set to 12 for all breakpoints, as it serves most\n * of the use cases and simplifies the implementation.\n * To opt-in to the Design System directives, you can set the `columns` prop to `auto`.\n *\n * Also, the Design System specifications are omissive about the horizontal gutters.\n * The HvGrid sets them to the same value as the vertical gutters, depending on the breakpoint.\n * It can be overridden by setting the `rowSpacing` prop.\n */\nexport const HvGrid = forwardRef<\n // no-indent\n HTMLDivElement,\n HvGridProps\n>(function HvGrid(props, ref) {\n const {\n item,\n container,\n spacing = \"auto\",\n rowSpacing,\n columnSpacing,\n columns,\n classes: classesProp,\n ...others\n } = useDefaultProps(\"HvGrid\", props);\n\n const { classes } = useClasses(classesProp);\n\n // Fixes MUI error when using spacings as objects and the grid is an item and container\n // When set to \"auto\", the spacing changes depending on the screen's breakpoint\n // The condition avoids using useWidth and re-rendering the component unnecessarily\n if (\n container &&\n item &&\n (spacing === \"auto\" || rowSpacing === \"auto\" || columnSpacing === \"auto\")\n ) {\n return (\n <WidthGrid\n ref={ref}\n classes={classes}\n item={item}\n container={container}\n spacing={spacing}\n rowSpacing={rowSpacing}\n columnSpacing={columnSpacing}\n columns={columns}\n {...others}\n />\n );\n }\n\n const containerProps = container\n ? getContainerProps(spacing, rowSpacing, columnSpacing, columns)\n : {};\n\n return (\n <MuiGrid\n ref={ref}\n classes={classes}\n item={item}\n {...containerProps}\n {...others}\n />\n );\n});\n"],"names":["HvGrid"],"mappings":";;;;;;;AAcA,MAAM,qBAAqB;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,qBAAqB;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAuHA,SAAS,eAAe,SAAiC;AACnD,MAAA;AAEA,MAAA,OAAO,YAAY,UAAU;AAC/B,QAAI,YAAY,QAAQ;AACR,oBAAA;AAAA,IAAA,OACT;AACL,oBAAc,mBAAmB,OAAO;AAAA,IAAA;AAAA,EAC1C,WACS,OAAO,YAAY,UAAU;AACxB,kBAAA,OAAO,KAAK,OAAO,EAAE;AAAA,MACjC,CAAC,KAAK,OAAO;AACP,YAAA,EAAE,IAAI,mBAAmB,QAAQ,EAAE,CAAC,KAAK,QAAQ,EAAE;AAChD,eAAA;AAAA,MACT;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AAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAK1C,MACE,aACA,SACC,YAAY,UAAU,eAAe,UAAU,kBAAkB,SAClE;AAEE,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIE,QAAA,iBAAiB,YACnB,kBAAkB,SAAS,YAAY,eAAe,OAAO,IAC7D,CAAC;AAGH,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.styles.js","sources":["../../../src/Grid/Grid.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvGrid\", {\n root: {},\n container: {},\n item: {},\n zeroMinWidth: {},\n \"direction-xs-column\": {},\n \"direction-xs-reverse\": {},\n \"direction-xs-row-reverse\": {},\n \"wrap-xs-nowrap\": {},\n \"wrap-xs-wrap-reverse\": {},\n \"spacing-xs-1\": {},\n \"spacing-xs-2\": {},\n \"spacing-xs-3\": {},\n \"spacing-xs-4\": {},\n \"spacing-xs-5\": {},\n \"spacing-xs-6\": {},\n \"spacing-xs-7\": {},\n \"spacing-xs-8\": {},\n \"spacing-xs-9\": {},\n \"spacing-xs-10\": {},\n \"grid-xs-auto\": {},\n \"grid-xs-true\": {},\n \"grid-xs-1\": {},\n \"grid-xs-2\": {},\n \"grid-xs-3\": {},\n \"grid-xs-4\": {},\n \"grid-xs-5\": {},\n \"grid-xs-6\": {},\n \"grid-xs-7\": {},\n \"grid-xs-8\": {},\n \"grid-xs-9\": {},\n \"grid-xs-10\": {},\n \"grid-xs-11\": {},\n \"grid-xs-12\": {},\n});\n"],"names":[],"mappings":";AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,UAAU;AAAA,EACnE,MAAM,CAAC;AAAA,EACP,WAAW,CAAC;AAAA,EACZ,MAAM,CAAC;AAAA,EACP,cAAc,CAAC;AAAA,EACf,uBAAuB,CAAC;AAAA,EACxB,wBAAwB,CAAC;AAAA,EACzB,4BAA4B,CAAC;AAAA,EAC7B,kBAAkB,CAAC;AAAA,EACnB,wBAAwB,CAAC;AAAA,EACzB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,cAAc,CAAC;AAAA,EACf,cAAc,CAAC;AAAA,EACf,cAAc,CAAC;AACjB,CAAC;"}
1
+ {"version":3,"file":"Grid.styles.js","sources":["../../../src/Grid/Grid.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvGrid\", {\n root: {},\n container: {},\n item: {},\n zeroMinWidth: {},\n \"direction-xs-column\": {},\n \"direction-xs-reverse\": {},\n \"direction-xs-row-reverse\": {},\n \"wrap-xs-nowrap\": {},\n \"wrap-xs-wrap-reverse\": {},\n \"spacing-xs-1\": {},\n \"spacing-xs-2\": {},\n \"spacing-xs-3\": {},\n \"spacing-xs-4\": {},\n \"spacing-xs-5\": {},\n \"spacing-xs-6\": {},\n \"spacing-xs-7\": {},\n \"spacing-xs-8\": {},\n \"spacing-xs-9\": {},\n \"spacing-xs-10\": {},\n \"grid-xs-auto\": {},\n \"grid-xs-true\": {},\n \"grid-xs-1\": {},\n \"grid-xs-2\": {},\n \"grid-xs-3\": {},\n \"grid-xs-4\": {},\n \"grid-xs-5\": {},\n \"grid-xs-6\": {},\n \"grid-xs-7\": {},\n \"grid-xs-8\": {},\n \"grid-xs-9\": {},\n \"grid-xs-10\": {},\n \"grid-xs-11\": {},\n \"grid-xs-12\": {},\n});\n"],"names":[],"mappings":";AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,UAAU;AAAA,EACnE,MAAM,CAAC;AAAA,EACP,WAAW,CAAC;AAAA,EACZ,MAAM,CAAC;AAAA,EACP,cAAc,CAAC;AAAA,EACf,uBAAuB,CAAC;AAAA,EACxB,wBAAwB,CAAC;AAAA,EACzB,4BAA4B,CAAC;AAAA,EAC7B,kBAAkB,CAAC;AAAA,EACnB,wBAAwB,CAAC;AAAA,EACzB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,aAAa,CAAC;AAAA,EACd,cAAc,CAAC;AAAA,EACf,cAAc,CAAC;AAAA,EACf,cAAc,CAAA;AAChB,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/Header/Actions/Actions.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { staticClasses, useClasses } from \"./Actions.styles\";\n\nexport { staticClasses as headerActionsClasses };\n\nexport type HvHeaderActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvHeaderActionsProps extends HvBaseProps {\n classes?: HvHeaderActionsClasses;\n}\n\nexport const HvHeaderActions = forwardRef<\n React.ElementRef<\"div\">,\n HvHeaderActionsProps\n>(function HvHeaderActions(props, ref) {\n const {\n classes: classesProp,\n className,\n children,\n ...others\n } = useDefaultProps(\"HvHeaderActions\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div ref={ref} className={cx(classes.root, className)} {...others}>\n {children}\n </div>\n );\n});\n"],"names":["HvHeaderActions"],"mappings":";;;;;AAiBO,MAAM,kBAAkB,WAG7B,SAASA,iBAAgB,OAAO,KAAK;AAC/B,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,mBAAmB,KAAK;AAE5C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAG5C,SAAA,oBAAC,OAAI,EAAA,KAAU,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QACxD,SACH,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/Header/Actions/Actions.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseProps } from \"../../types/generic\";\nimport { staticClasses, useClasses } from \"./Actions.styles\";\n\nexport { staticClasses as headerActionsClasses };\n\nexport type HvHeaderActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvHeaderActionsProps extends HvBaseProps {\n classes?: HvHeaderActionsClasses;\n}\n\nexport const HvHeaderActions = forwardRef<\n React.ElementRef<\"div\">,\n HvHeaderActionsProps\n>(function HvHeaderActions(props, ref) {\n const {\n classes: classesProp,\n className,\n children,\n ...others\n } = useDefaultProps(\"HvHeaderActions\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div ref={ref} className={cx(classes.root, className)} {...others}>\n {children}\n </div>\n );\n});\n"],"names":["HvHeaderActions"],"mappings":";;;;;AAiBO,MAAM,kBAAkB,WAG7B,SAASA,iBAAgB,OAAO,KAAK;AAC/B,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,mBAAmB,KAAK;AAE5C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA,oBAAC,OAAI,EAAA,KAAU,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QACxD,SACH,CAAA;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.styles.js","sources":["../../../../src/Header/Actions/Actions.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { buttonClasses } from \"../../Button\";\n\n// TODO - rename to HvHeaderActions (the actual component's name) in v6\nexport const { staticClasses, useClasses } = createClasses(\"HvHeader-Actions\", {\n root: {\n backgroundColor: \"transparent\",\n display: \"flex\",\n gap: theme.space.xs,\n alignItems: \"center\",\n marginLeft: \"auto\",\n [`& .${buttonClasses?.root}`]: {\n \"&:hover\": { backgroundColor: theme.colors.containerBackgroundHover },\n },\n },\n});\n"],"names":["buttonClasses"],"mappings":";;;;AAMO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,KAAK,MAAM,MAAM;AAAA,IACjB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,CAAC,MAAMA,iBAAe,IAAI,EAAE,GAAG;AAAA,MAC7B,WAAW,EAAE,iBAAiB,MAAM,OAAO,yBAAyB;AAAA,IACtE;AAAA,EACF;AACF,CAAC;"}
1
+ {"version":3,"file":"Actions.styles.js","sources":["../../../../src/Header/Actions/Actions.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { buttonClasses } from \"../../Button\";\n\n// TODO - rename to HvHeaderActions (the actual component's name) in v6\nexport const { staticClasses, useClasses } = createClasses(\"HvHeader-Actions\", {\n root: {\n backgroundColor: \"transparent\",\n display: \"flex\",\n gap: theme.space.xs,\n alignItems: \"center\",\n marginLeft: \"auto\",\n [`& .${buttonClasses?.root}`]: {\n \"&:hover\": { backgroundColor: theme.colors.containerBackgroundHover },\n },\n },\n});\n"],"names":["buttonClasses"],"mappings":";;;;AAMO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,KAAK,MAAM,MAAM;AAAA,IACjB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,CAAC,MAAMA,iBAAe,IAAI,EAAE,GAAG;AAAA,MAC7B,WAAW,EAAE,iBAAiB,MAAM,OAAO,yBAAyB;AAAA,IAAA;AAAA,EACtE;AAEJ,CAAC;"}