@hitachivantara/uikit-react-core 5.58.2 → 5.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/dist/cjs/Accordion/Accordion.cjs.map +1 -1
  2. package/dist/cjs/Avatar/Avatar.cjs.map +1 -1
  3. package/dist/cjs/Badge/Badge.styles.cjs.map +1 -1
  4. package/dist/cjs/BaseCheckBox/BaseCheckBox.cjs.map +1 -1
  5. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +1 -2
  6. package/dist/cjs/BaseDropdown/BaseDropdown.cjs.map +1 -1
  7. package/dist/cjs/BaseInput/BaseInput.styles.cjs.map +1 -1
  8. package/dist/cjs/BaseInput/validations.cjs.map +1 -1
  9. package/dist/cjs/BaseRadio/BaseRadio.cjs.map +1 -1
  10. package/dist/cjs/BaseSwitch/BaseSwitch.cjs.map +1 -1
  11. package/dist/cjs/BreadCrumb/BreadCrumb.cjs.map +1 -1
  12. package/dist/cjs/BreadCrumb/Page/Page.cjs.map +1 -1
  13. package/dist/cjs/BreadCrumb/utils.cjs.map +1 -1
  14. package/dist/cjs/BulkActions/BulkActions.styles.cjs +13 -1
  15. package/dist/cjs/BulkActions/BulkActions.styles.cjs.map +1 -1
  16. package/dist/cjs/Button/Button.styles.cjs.map +1 -1
  17. package/dist/cjs/Calendar/Calendar.cjs.map +1 -1
  18. package/dist/cjs/Calendar/SingleCalendar/CalendarCell.cjs.map +1 -1
  19. package/dist/cjs/Card/Media/Media.cjs.map +1 -1
  20. package/dist/cjs/Carousel/Carousel.cjs.map +1 -1
  21. package/dist/cjs/Carousel/CarouselControls.cjs.map +1 -1
  22. package/dist/cjs/Carousel/CarouselSlide/CarouselSlide.cjs.map +1 -1
  23. package/dist/cjs/Carousel/CarouselThumbnails.cjs.map +1 -1
  24. package/dist/cjs/Controls/Controls.cjs.map +1 -1
  25. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +12 -20
  26. package/dist/cjs/DropDownMenu/DropDownMenu.cjs.map +1 -1
  27. package/dist/cjs/DropDownMenu/DropDownMenu.styles.cjs +4 -34
  28. package/dist/cjs/DropDownMenu/DropDownMenu.styles.cjs.map +1 -1
  29. package/dist/cjs/Dropdown/List/List.cjs.map +1 -1
  30. package/dist/cjs/DropdownButton/DropdownButton.cjs +57 -0
  31. package/dist/cjs/DropdownButton/DropdownButton.cjs.map +1 -0
  32. package/dist/cjs/DropdownButton/DropdownButton.styles.cjs +65 -0
  33. package/dist/cjs/DropdownButton/DropdownButton.styles.cjs.map +1 -0
  34. package/dist/cjs/FileUploader/DropZone/DropZone.cjs.map +1 -1
  35. package/dist/cjs/FileUploader/DropZone/DropZone.styles.cjs.map +1 -1
  36. package/dist/cjs/Focus/Focus.cjs +1 -3
  37. package/dist/cjs/Focus/Focus.cjs.map +1 -1
  38. package/dist/cjs/Forms/Adornment/Adornment.cjs.map +1 -1
  39. package/dist/cjs/Forms/Suggestions/Suggestions.cjs.map +1 -1
  40. package/dist/cjs/Header/Navigation/MenuBar/MenuBar.cjs.map +1 -1
  41. package/dist/cjs/Header/Navigation/MenuItem/MenuItem.cjs.map +1 -1
  42. package/dist/cjs/Header/Navigation/Navigation.cjs.map +1 -1
  43. package/dist/cjs/Header/Navigation/utils/FocusContext.cjs.map +1 -1
  44. package/dist/cjs/IconButton/IconButton.cjs +2 -1
  45. package/dist/cjs/IconButton/IconButton.cjs.map +1 -1
  46. package/dist/cjs/InlineEditor/InlineEditor.cjs.map +1 -1
  47. package/dist/cjs/Input/Input.cjs +1 -3
  48. package/dist/cjs/Input/Input.cjs.map +1 -1
  49. package/dist/cjs/ListContainer/ListContainer.cjs +3 -5
  50. package/dist/cjs/ListContainer/ListContainer.cjs.map +1 -1
  51. package/dist/cjs/ListContainer/ListItem/ListItem.cjs +4 -6
  52. package/dist/cjs/ListContainer/ListItem/ListItem.cjs.map +1 -1
  53. package/dist/cjs/MultiButton/MultiButton.cjs +24 -11
  54. package/dist/cjs/MultiButton/MultiButton.cjs.map +1 -1
  55. package/dist/cjs/MultiButton/MultiButton.styles.cjs +56 -326
  56. package/dist/cjs/MultiButton/MultiButton.styles.cjs.map +1 -1
  57. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  58. package/dist/cjs/Pagination/Pagination.styles.cjs.map +1 -1
  59. package/dist/cjs/Pagination/Select.cjs.map +1 -1
  60. package/dist/cjs/Radio/Radio.cjs.map +1 -1
  61. package/dist/cjs/Select/Select.cjs +6 -2
  62. package/dist/cjs/Select/Select.cjs.map +1 -1
  63. package/dist/cjs/SelectionList/SelectionList.cjs +4 -6
  64. package/dist/cjs/SelectionList/SelectionList.cjs.map +1 -1
  65. package/dist/cjs/Slider/Slider.cjs.map +1 -1
  66. package/dist/cjs/Slider/Slider.styles.cjs.map +1 -1
  67. package/dist/cjs/Slider/utils.cjs.map +1 -1
  68. package/dist/cjs/Snackbar/Snackbar.cjs.map +1 -1
  69. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.styles.cjs +0 -3
  70. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.styles.cjs.map +1 -1
  71. package/dist/cjs/SnackbarProvider/SnackbarProvider.cjs.map +1 -1
  72. package/dist/cjs/Stack/Stack.cjs +2 -3
  73. package/dist/cjs/Stack/Stack.cjs.map +1 -1
  74. package/dist/cjs/Switch/Switch.cjs.map +1 -1
  75. package/dist/cjs/Tab/Tab.styles.cjs.map +1 -1
  76. package/dist/cjs/Table/Table.cjs.map +1 -1
  77. package/dist/cjs/Table/TableBody/TableBody.cjs.map +1 -1
  78. package/dist/cjs/Table/TableCell/TableCell.cjs.map +1 -1
  79. package/dist/cjs/Table/TableCell/TableCell.styles.cjs.map +1 -1
  80. package/dist/cjs/Table/TableHeader/TableHeader.cjs.map +1 -1
  81. package/dist/cjs/Table/hooks/useHeaderGroups.cjs.map +1 -1
  82. package/dist/cjs/Table/hooks/useResizeColumns.cjs.map +1 -1
  83. package/dist/cjs/Table/hooks/useRowExpand.cjs.map +1 -1
  84. package/dist/cjs/Table/hooks/useRowSelection.cjs.map +1 -1
  85. package/dist/cjs/Table/hooks/useSticky.cjs.map +1 -1
  86. package/dist/cjs/Table/hooks/useTableStyles.cjs.map +1 -1
  87. package/dist/cjs/Tag/Tag.cjs.map +1 -1
  88. package/dist/cjs/Tag/Tag.styles.cjs.map +1 -1
  89. package/dist/cjs/TagsInput/TagsInput.cjs.map +1 -1
  90. package/dist/cjs/Tooltip/Tooltip.cjs.map +1 -1
  91. package/dist/cjs/TreeView/TreeItem/DefaultContent.cjs.map +1 -1
  92. package/dist/cjs/TreeView/TreeItem/TreeItem.cjs.map +1 -1
  93. package/dist/cjs/VerticalNavigation/Actions/Action.cjs.map +1 -1
  94. package/dist/cjs/VerticalNavigation/Header/Header.cjs.map +1 -1
  95. package/dist/cjs/VerticalNavigation/VerticalNavigationContext.cjs.map +1 -1
  96. package/dist/cjs/hooks/useClickOutside.cjs.map +1 -1
  97. package/dist/cjs/providers/Provider.cjs.map +1 -1
  98. package/dist/esm/Accordion/Accordion.js.map +1 -1
  99. package/dist/esm/Avatar/Avatar.js.map +1 -1
  100. package/dist/esm/Badge/Badge.styles.js.map +1 -1
  101. package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
  102. package/dist/esm/BaseDropdown/BaseDropdown.js +2 -2
  103. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  104. package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
  105. package/dist/esm/BaseInput/validations.js.map +1 -1
  106. package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
  107. package/dist/esm/BaseSwitch/BaseSwitch.js.map +1 -1
  108. package/dist/esm/BreadCrumb/BreadCrumb.js.map +1 -1
  109. package/dist/esm/BreadCrumb/Page/Page.js.map +1 -1
  110. package/dist/esm/BreadCrumb/utils.js.map +1 -1
  111. package/dist/esm/BulkActions/BulkActions.styles.js +13 -1
  112. package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
  113. package/dist/esm/Button/Button.styles.js.map +1 -1
  114. package/dist/esm/Calendar/Calendar.js.map +1 -1
  115. package/dist/esm/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
  116. package/dist/esm/Card/Media/Media.js.map +1 -1
  117. package/dist/esm/Carousel/Carousel.js.map +1 -1
  118. package/dist/esm/Carousel/CarouselControls.js.map +1 -1
  119. package/dist/esm/Carousel/CarouselSlide/CarouselSlide.js.map +1 -1
  120. package/dist/esm/Carousel/CarouselThumbnails.js.map +1 -1
  121. package/dist/esm/Controls/Controls.js.map +1 -1
  122. package/dist/esm/DropDownMenu/DropDownMenu.js +12 -20
  123. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  124. package/dist/esm/DropDownMenu/DropDownMenu.styles.js +4 -34
  125. package/dist/esm/DropDownMenu/DropDownMenu.styles.js.map +1 -1
  126. package/dist/esm/Dropdown/List/List.js.map +1 -1
  127. package/dist/esm/DropdownButton/DropdownButton.js +58 -0
  128. package/dist/esm/DropdownButton/DropdownButton.js.map +1 -0
  129. package/dist/esm/DropdownButton/DropdownButton.styles.js +65 -0
  130. package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -0
  131. package/dist/esm/FileUploader/DropZone/DropZone.js.map +1 -1
  132. package/dist/esm/FileUploader/DropZone/DropZone.styles.js.map +1 -1
  133. package/dist/esm/Focus/Focus.js +2 -2
  134. package/dist/esm/Focus/Focus.js.map +1 -1
  135. package/dist/esm/Forms/Adornment/Adornment.js.map +1 -1
  136. package/dist/esm/Forms/Suggestions/Suggestions.js.map +1 -1
  137. package/dist/esm/Header/Navigation/MenuBar/MenuBar.js.map +1 -1
  138. package/dist/esm/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
  139. package/dist/esm/Header/Navigation/Navigation.js.map +1 -1
  140. package/dist/esm/Header/Navigation/utils/FocusContext.js.map +1 -1
  141. package/dist/esm/IconButton/IconButton.js +2 -1
  142. package/dist/esm/IconButton/IconButton.js.map +1 -1
  143. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  144. package/dist/esm/Input/Input.js +2 -2
  145. package/dist/esm/Input/Input.js.map +1 -1
  146. package/dist/esm/ListContainer/ListContainer.js +4 -4
  147. package/dist/esm/ListContainer/ListContainer.js.map +1 -1
  148. package/dist/esm/ListContainer/ListItem/ListItem.js +5 -5
  149. package/dist/esm/ListContainer/ListItem/ListItem.js.map +1 -1
  150. package/dist/esm/MultiButton/MultiButton.js +26 -11
  151. package/dist/esm/MultiButton/MultiButton.js.map +1 -1
  152. package/dist/esm/MultiButton/MultiButton.styles.js +56 -326
  153. package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
  154. package/dist/esm/Pagination/Pagination.js.map +1 -1
  155. package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
  156. package/dist/esm/Pagination/Select.js.map +1 -1
  157. package/dist/esm/Radio/Radio.js.map +1 -1
  158. package/dist/esm/Select/Select.js +6 -2
  159. package/dist/esm/Select/Select.js.map +1 -1
  160. package/dist/esm/SelectionList/SelectionList.js +5 -5
  161. package/dist/esm/SelectionList/SelectionList.js.map +1 -1
  162. package/dist/esm/Slider/Slider.js.map +1 -1
  163. package/dist/esm/Slider/Slider.styles.js.map +1 -1
  164. package/dist/esm/Slider/utils.js.map +1 -1
  165. package/dist/esm/Snackbar/Snackbar.js.map +1 -1
  166. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js +0 -3
  167. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
  168. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  169. package/dist/esm/Stack/Stack.js +3 -3
  170. package/dist/esm/Stack/Stack.js.map +1 -1
  171. package/dist/esm/Switch/Switch.js.map +1 -1
  172. package/dist/esm/Tab/Tab.styles.js.map +1 -1
  173. package/dist/esm/Table/Table.js.map +1 -1
  174. package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
  175. package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
  176. package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
  177. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  178. package/dist/esm/Table/hooks/useHeaderGroups.js.map +1 -1
  179. package/dist/esm/Table/hooks/useResizeColumns.js.map +1 -1
  180. package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
  181. package/dist/esm/Table/hooks/useRowSelection.js.map +1 -1
  182. package/dist/esm/Table/hooks/useSticky.js.map +1 -1
  183. package/dist/esm/Table/hooks/useTableStyles.js.map +1 -1
  184. package/dist/esm/Tag/Tag.js.map +1 -1
  185. package/dist/esm/Tag/Tag.styles.js.map +1 -1
  186. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  187. package/dist/esm/Tooltip/Tooltip.js.map +1 -1
  188. package/dist/esm/TreeView/TreeItem/DefaultContent.js.map +1 -1
  189. package/dist/esm/TreeView/TreeItem/TreeItem.js.map +1 -1
  190. package/dist/esm/VerticalNavigation/Actions/Action.js.map +1 -1
  191. package/dist/esm/VerticalNavigation/Header/Header.js.map +1 -1
  192. package/dist/esm/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
  193. package/dist/esm/hooks/useClickOutside.js.map +1 -1
  194. package/dist/esm/providers/Provider.js.map +1 -1
  195. package/dist/types/index.d.ts +247 -258
  196. package/package.json +5 -5
  197. package/dist/cjs/Select/SelectButton.cjs +0 -92
  198. package/dist/cjs/Select/SelectButton.cjs.map +0 -1
  199. package/dist/esm/Select/SelectButton.js +0 -92
  200. package/dist/esm/Select/SelectButton.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Action.js","sources":["../../../../src/VerticalNavigation/Actions/Action.tsx"],"sourcesContent":["import { MouseEventHandler, useCallback, useContext } from \"react\";\n\nimport { isKey } from \"../../utils/keyboardUtils\";\nimport { setId } from \"../../utils/setId\";\n\nimport { ExtractNames } from \"../../utils/classes\";\nimport { HvTypography } from \"../../Typography\";\n\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { staticClasses, useClasses } from \"./Action.styles\";\n\nexport { staticClasses as actionClasses };\n\nexport type HvVerticalNavigationActionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvVerticalNavigationActionProps {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationActionClasses;\n /**\n * Id to be applied to the action.\n */\n id?: string;\n /**\n * Visual label.\n */\n label?: string;\n /**\n * Icon.\n */\n icon?: React.ReactNode;\n /**\n * Callback called when clicked.\n */\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationAction = ({\n className,\n classes: classesProp,\n id,\n label = \"\",\n icon,\n onClick,\n ...others\n}: HvVerticalNavigationActionProps) => {\n const { isOpen } = useContext(VerticalNavigationContext);\n\n const { classes, cx } = useClasses(classesProp);\n\n const handleKeyDown = useCallback(\n (event) => {\n if (\n onClick == null ||\n (!isKey(event, \"Enter\") && !isKey(event, \"Space\"))\n ) {\n return;\n }\n\n onClick(event);\n },\n [onClick]\n );\n\n return (\n <HvTypography\n id={setId(id, \"button\")}\n component=\"div\"\n role=\"button\"\n className={cx(\n classes.action,\n {\n [classes.noIcon]: !icon,\n [classes.minimized]: !isOpen,\n },\n className\n )}\n tabIndex={0}\n {...(!isOpen && { \"aria-label\": label })}\n onKeyDown={handleKeyDown}\n onClick={onClick}\n {...others}\n >\n {icon}\n {isOpen && label}\n </HvTypography>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0CO,MAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuC;AACrC,QAAM,EAAE,OAAA,IAAW,WAAW,yBAAyB;AAEvD,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,gBAAgB;AAAA,IACpB,CAAC,UAAU;AAEP,UAAA,WAAW,QACV,CAAC,MAAM,OAAO,OAAO,KAAK,CAAC,MAAM,OAAO,OAAO,GAChD;AACA;AAAA,MACF;AAEA,cAAQ,KAAK;AAAA,IACf;AAAA,IACA,CAAC,OAAO;AAAA,EAAA;AAIR,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI,MAAM,IAAI,QAAQ;AAAA,MACtB,WAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,MAAM,GAAG,CAAC;AAAA,UACnB,CAAC,QAAQ,SAAS,GAAG,CAAC;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAU;AAAA,MACT,GAAI,CAAC,UAAU,EAAE,cAAc,MAAM;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACC,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA;AAAA,QACA,UAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGjB;"}
1
+ {"version":3,"file":"Action.js","sources":["../../../../src/VerticalNavigation/Actions/Action.tsx"],"sourcesContent":["import { useCallback, useContext } from \"react\";\n\nimport { isKey } from \"../../utils/keyboardUtils\";\nimport { setId } from \"../../utils/setId\";\n\nimport { ExtractNames } from \"../../utils/classes\";\nimport { HvTypography } from \"../../Typography\";\n\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { staticClasses, useClasses } from \"./Action.styles\";\n\nexport { staticClasses as actionClasses };\n\nexport type HvVerticalNavigationActionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvVerticalNavigationActionProps {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationActionClasses;\n /**\n * Id to be applied to the action.\n */\n id?: string;\n /**\n * Visual label.\n */\n label?: string;\n /**\n * Icon.\n */\n icon?: React.ReactNode;\n /**\n * Callback called when clicked.\n */\n onClick?: React.MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationAction = ({\n className,\n classes: classesProp,\n id,\n label = \"\",\n icon,\n onClick,\n ...others\n}: HvVerticalNavigationActionProps) => {\n const { isOpen } = useContext(VerticalNavigationContext);\n\n const { classes, cx } = useClasses(classesProp);\n\n const handleKeyDown = useCallback(\n (event) => {\n if (\n onClick == null ||\n (!isKey(event, \"Enter\") && !isKey(event, \"Space\"))\n ) {\n return;\n }\n\n onClick(event);\n },\n [onClick]\n );\n\n return (\n <HvTypography\n id={setId(id, \"button\")}\n component=\"div\"\n role=\"button\"\n className={cx(\n classes.action,\n {\n [classes.noIcon]: !icon,\n [classes.minimized]: !isOpen,\n },\n className\n )}\n tabIndex={0}\n {...(!isOpen && { \"aria-label\": label })}\n onKeyDown={handleKeyDown}\n onClick={onClick}\n {...others}\n >\n {icon}\n {isOpen && label}\n </HvTypography>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0CO,MAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuC;AACrC,QAAM,EAAE,OAAA,IAAW,WAAW,yBAAyB;AAEvD,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,gBAAgB;AAAA,IACpB,CAAC,UAAU;AAEP,UAAA,WAAW,QACV,CAAC,MAAM,OAAO,OAAO,KAAK,CAAC,MAAM,OAAO,OAAO,GAChD;AACA;AAAA,MACF;AAEA,cAAQ,KAAK;AAAA,IACf;AAAA,IACA,CAAC,OAAO;AAAA,EAAA;AAIR,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI,MAAM,IAAI,QAAQ;AAAA,MACtB,WAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,MAAM,GAAG,CAAC;AAAA,UACnB,CAAC,QAAQ,SAAS,GAAG,CAAC;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAU;AAAA,MACT,GAAI,CAAC,UAAU,EAAE,cAAc,MAAM;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACC,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA;AAAA,QACA,UAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGjB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sources":["../../../../src/VerticalNavigation/Header/Header.tsx"],"sourcesContent":["import { MouseEventHandler, useContext, useMemo } from \"react\";\nimport { Backwards, Forwards, Menu } from \"@hitachivantara/uikit-react-icons\";\n\nimport { ExtractNames } from \"../../utils/classes\";\nimport { HvTypography } from \"../../Typography\";\nimport { HvButton, HvButtonProps } from \"../../Button\";\n\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { staticClasses, useClasses } from \"./Header.styles\";\n\nexport { staticClasses as verticalNavigationHeaderClasses };\n\nexport type HvVerticalNavigationHeaderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvVerticalNavigationHeaderProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The title text to show on Header.\n */\n title?: string;\n /**\n * Icon to show when Vertical Navigation is collapsed.\n */\n openIcon?: React.ReactNode;\n /**\n * Icon to show when Vertical Navigation is expanded.\n */\n closeIcon?: React.ReactNode;\n /**\n * Props for the collapse button.\n */\n collapseButtonProps?: HvButtonProps;\n /**\n * Props for the back button.\n */\n backButtonProps?: HvButtonProps;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationHeaderClasses;\n /**\n * Handler for the collapse button.\n */\n onCollapseButtonClick?: MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationHeader = ({\n title,\n openIcon: openIconProp,\n closeIcon: closeIconProp,\n collapseButtonProps,\n backButtonProps,\n className,\n classes: classesProp,\n onCollapseButtonClick,\n ...others\n}: HvVerticalNavigationHeaderProps) => {\n const {\n isOpen,\n useIcons,\n headerTitle,\n slider,\n navigateToParentHandler,\n parentItem,\n } = useContext(VerticalNavigationContext);\n\n const { classes, cx } = useClasses(classesProp);\n\n const openIcon = openIconProp ?? (!useIcons ? <Menu /> : <Forwards />);\n const closeIcon = closeIconProp ?? <Backwards />;\n\n const backButtonClickHandler = () => {\n if (navigateToParentHandler) navigateToParentHandler();\n };\n\n // whenever we're in a sublevel, the parentItem is always a single item.\n // In the first level it's always an array with the first level elements.\n const shouldShowTitle = useMemo(\n () => !slider || (slider && !Array.isArray(parentItem)),\n [parentItem, slider]\n );\n\n return shouldShowTitle ? (\n <div\n className={cx(classes.root, { [classes.minimized]: !isOpen }, className)}\n {...others}\n >\n {isOpen && headerTitle && slider && (\n <HvButton\n icon\n onClick={backButtonClickHandler}\n aria-label=\"Back\"\n {...backButtonProps}\n >\n <Backwards iconSize=\"XS\" />\n </HvButton>\n )}\n {isOpen && (\n <HvTypography variant={slider ? \"label\" : \"title3\"}>\n {headerTitle && slider ? headerTitle : title}\n </HvTypography>\n )}\n {onCollapseButtonClick && (\n <HvButton\n icon\n onClick={onCollapseButtonClick}\n className={classes.collapseButton}\n classes={{\n root: isOpen ? \"\" : classes.minimized,\n }}\n {...collapseButtonProps}\n >\n {isOpen ? closeIcon : openIcon}\n </HvButton>\n )}\n </div>\n ) : null;\n};\n"],"names":[],"mappings":";;;;;;;;AAqDO,MAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA,UAAU;AAAA,EACV,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,GAAG;AACL,MAAuC;AAC/B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,WAAW,yBAAyB;AAExC,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,QAAA,WAAW,iBAAiB,CAAC,+BAAY,MAAK,CAAA,CAAA,wBAAM,UAAS,CAAA,CAAA;AAC7D,QAAA,YAAY,iBAAiB,oBAAC,WAAU,CAAA,CAAA;AAE9C,QAAM,yBAAyB,MAAM;AAC/B,QAAA;AAAiD;EAAA;AAKvD,QAAM,kBAAkB;AAAA,IACtB,MAAM,CAAC,UAAW,UAAU,CAAC,MAAM,QAAQ,UAAU;AAAA,IACrD,CAAC,YAAY,MAAM;AAAA,EAAA;AAGrB,SAAO,kBACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,OAAO,GAAG,SAAS;AAAA,MACtE,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,UAAU,eAAe,UACxB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAI;AAAA,YACJ,SAAS;AAAA,YACT,cAAW;AAAA,YACV,GAAG;AAAA,YAEJ,UAAA,oBAAC,WAAU,EAAA,UAAS,KAAK,CAAA;AAAA,UAAA;AAAA,QAC3B;AAAA,QAED,UACE,oBAAA,cAAA,EAAa,SAAS,SAAS,UAAU,UACvC,UAAA,eAAe,SAAS,cAAc,MACzC,CAAA;AAAA,QAED,yBACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAI;AAAA,YACJ,SAAS;AAAA,YACT,WAAW,QAAQ;AAAA,YACnB,SAAS;AAAA,cACP,MAAM,SAAS,KAAK,QAAQ;AAAA,YAC9B;AAAA,YACC,GAAG;AAAA,YAEH,mBAAS,YAAY;AAAA,UAAA;AAAA,QACxB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGF,IAAA;AACN;"}
1
+ {"version":3,"file":"Header.js","sources":["../../../../src/VerticalNavigation/Header/Header.tsx"],"sourcesContent":["import { useContext, useMemo } from \"react\";\nimport { Backwards, Forwards, Menu } from \"@hitachivantara/uikit-react-icons\";\n\nimport { ExtractNames } from \"../../utils/classes\";\nimport { HvTypography } from \"../../Typography\";\nimport { HvButton, HvButtonProps } from \"../../Button\";\n\nimport { VerticalNavigationContext } from \"../VerticalNavigationContext\";\nimport { staticClasses, useClasses } from \"./Header.styles\";\n\nexport { staticClasses as verticalNavigationHeaderClasses };\n\nexport type HvVerticalNavigationHeaderClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvVerticalNavigationHeaderProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The title text to show on Header.\n */\n title?: string;\n /**\n * Icon to show when Vertical Navigation is collapsed.\n */\n openIcon?: React.ReactNode;\n /**\n * Icon to show when Vertical Navigation is expanded.\n */\n closeIcon?: React.ReactNode;\n /**\n * Props for the collapse button.\n */\n collapseButtonProps?: HvButtonProps;\n /**\n * Props for the back button.\n */\n backButtonProps?: HvButtonProps;\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied to the component.\n */\n classes?: HvVerticalNavigationHeaderClasses;\n /**\n * Handler for the collapse button.\n */\n onCollapseButtonClick?: React.MouseEventHandler<HTMLElement>;\n}\n\nexport const HvVerticalNavigationHeader = ({\n title,\n openIcon: openIconProp,\n closeIcon: closeIconProp,\n collapseButtonProps,\n backButtonProps,\n className,\n classes: classesProp,\n onCollapseButtonClick,\n ...others\n}: HvVerticalNavigationHeaderProps) => {\n const {\n isOpen,\n useIcons,\n headerTitle,\n slider,\n navigateToParentHandler,\n parentItem,\n } = useContext(VerticalNavigationContext);\n\n const { classes, cx } = useClasses(classesProp);\n\n const openIcon = openIconProp ?? (!useIcons ? <Menu /> : <Forwards />);\n const closeIcon = closeIconProp ?? <Backwards />;\n\n const backButtonClickHandler = () => {\n if (navigateToParentHandler) navigateToParentHandler();\n };\n\n // whenever we're in a sublevel, the parentItem is always a single item.\n // In the first level it's always an array with the first level elements.\n const shouldShowTitle = useMemo(\n () => !slider || (slider && !Array.isArray(parentItem)),\n [parentItem, slider]\n );\n\n return shouldShowTitle ? (\n <div\n className={cx(classes.root, { [classes.minimized]: !isOpen }, className)}\n {...others}\n >\n {isOpen && headerTitle && slider && (\n <HvButton\n icon\n onClick={backButtonClickHandler}\n aria-label=\"Back\"\n {...backButtonProps}\n >\n <Backwards iconSize=\"XS\" />\n </HvButton>\n )}\n {isOpen && (\n <HvTypography variant={slider ? \"label\" : \"title3\"}>\n {headerTitle && slider ? headerTitle : title}\n </HvTypography>\n )}\n {onCollapseButtonClick && (\n <HvButton\n icon\n onClick={onCollapseButtonClick}\n className={classes.collapseButton}\n classes={{\n root: isOpen ? \"\" : classes.minimized,\n }}\n {...collapseButtonProps}\n >\n {isOpen ? closeIcon : openIcon}\n </HvButton>\n )}\n </div>\n ) : null;\n};\n"],"names":[],"mappings":";;;;;;;;AAqDO,MAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA,UAAU;AAAA,EACV,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,GAAG;AACL,MAAuC;AAC/B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,WAAW,yBAAyB;AAExC,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,QAAA,WAAW,iBAAiB,CAAC,+BAAY,MAAK,CAAA,CAAA,wBAAM,UAAS,CAAA,CAAA;AAC7D,QAAA,YAAY,iBAAiB,oBAAC,WAAU,CAAA,CAAA;AAE9C,QAAM,yBAAyB,MAAM;AAC/B,QAAA;AAAiD;EAAA;AAKvD,QAAM,kBAAkB;AAAA,IACtB,MAAM,CAAC,UAAW,UAAU,CAAC,MAAM,QAAQ,UAAU;AAAA,IACrD,CAAC,YAAY,MAAM;AAAA,EAAA;AAGrB,SAAO,kBACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,OAAO,GAAG,SAAS;AAAA,MACtE,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,UAAU,eAAe,UACxB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAI;AAAA,YACJ,SAAS;AAAA,YACT,cAAW;AAAA,YACV,GAAG;AAAA,YAEJ,UAAA,oBAAC,WAAU,EAAA,UAAS,KAAK,CAAA;AAAA,UAAA;AAAA,QAC3B;AAAA,QAED,UACE,oBAAA,cAAA,EAAa,SAAS,SAAS,UAAU,UACvC,UAAA,eAAe,SAAS,cAAc,MACzC,CAAA;AAAA,QAED,yBACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAI;AAAA,YACJ,SAAS;AAAA,YACT,WAAW,QAAQ;AAAA,YACnB,SAAS;AAAA,cACP,MAAM,SAAS,KAAK,QAAQ;AAAA,YAC9B;AAAA,YACC,GAAG;AAAA,YAEH,mBAAS,YAAY;AAAA,UAAA;AAAA,QACxB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGF,IAAA;AACN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerticalNavigationContext.js","sources":["../../../src/VerticalNavigation/VerticalNavigationContext.tsx"],"sourcesContent":["import { createContext, ComponentProps } from \"react\";\n\nexport type NavigationData<T extends React.ElementType = \"a\"> =\n ComponentProps<T> &\n Record<string, any> & {\n /** The id to be applied to the root element. */\n id: string;\n /** The label to be rendered on the menu item. */\n label: string;\n /** The icon to be rendered. */\n icon?: React.ReactNode;\n /** The Data children subset. */\n data?: NavigationData<T>[];\n /** Whether the item is disabled and not interactive. */\n disabled?: boolean;\n /** Whether the item has a selected state. */\n selectable?: boolean;\n };\n\ninterface VerticalNavigationContextValue {\n isOpen: boolean;\n useIcons: boolean;\n slider?: boolean;\n headerTitle?: string;\n setHeaderTitle?: React.Dispatch<React.SetStateAction<string | undefined>>;\n\n parentItem?;\n setParentItem?: React.Dispatch<React.SetStateAction<any>>;\n withParentData?;\n navigateToChildHandler?: (event, item) => void;\n navigateToParentHandler?: () => void;\n\n parentData?: NavigationData[];\n setParentData?: React.Dispatch<React.SetStateAction<any>>;\n parentSelected?;\n setParentSelected?: React.Dispatch<React.SetStateAction<any>>;\n\n hasAnyChildWithData?: boolean;\n}\n\nconst VerticalNavigationContext = createContext<VerticalNavigationContextValue>(\n {\n isOpen: true,\n useIcons: false,\n slider: false,\n }\n);\n\nexport { VerticalNavigationContext };\n"],"names":[],"mappings":";AAwCA,MAAM,4BAA4B;AAAA,EAChC;AAAA,IACE,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AACF;"}
1
+ {"version":3,"file":"VerticalNavigationContext.js","sources":["../../../src/VerticalNavigation/VerticalNavigationContext.tsx"],"sourcesContent":["import { createContext } from \"react\";\n\nexport type NavigationData<T extends React.ElementType = \"a\"> =\n React.ComponentProps<T> &\n Record<string, any> & {\n /** The id to be applied to the root element. */\n id: string;\n /** The label to be rendered on the menu item. */\n label: string;\n /** The icon to be rendered. */\n icon?: React.ReactNode;\n /** The Data children subset. */\n data?: NavigationData<T>[];\n /** Whether the item is disabled and not interactive. */\n disabled?: boolean;\n /** Whether the item has a selected state. */\n selectable?: boolean;\n };\n\ninterface VerticalNavigationContextValue {\n isOpen: boolean;\n useIcons: boolean;\n slider?: boolean;\n headerTitle?: string;\n setHeaderTitle?: React.Dispatch<React.SetStateAction<string | undefined>>;\n\n parentItem?;\n setParentItem?: React.Dispatch<React.SetStateAction<any>>;\n withParentData?;\n navigateToChildHandler?: (event, item) => void;\n navigateToParentHandler?: () => void;\n\n parentData?: NavigationData[];\n setParentData?: React.Dispatch<React.SetStateAction<any>>;\n parentSelected?;\n setParentSelected?: React.Dispatch<React.SetStateAction<any>>;\n\n hasAnyChildWithData?: boolean;\n}\n\nconst VerticalNavigationContext = createContext<VerticalNavigationContextValue>(\n {\n isOpen: true,\n useIcons: false,\n slider: false,\n }\n);\n\nexport { VerticalNavigationContext };\n"],"names":[],"mappings":";AAwCA,MAAM,4BAA4B;AAAA,EAChC;AAAA,IACE,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useClickOutside.js","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect, RefObject } from \"react\";\n\nexport type HvClickOutsideEvent = MouseEvent | KeyboardEvent | TouchEvent;\n\nexport const useClickOutside = <T extends HTMLElement = HTMLElement>(\n ref: RefObject<T>,\n handler: (event: HvClickOutsideEvent) => void\n) => {\n useEffect(() => {\n const listener = (event: HvClickOutsideEvent) => {\n const el = ref?.current;\n const isKeyUp = event.type === \"keyup\";\n const isEscape = (event as KeyboardEvent).key === \"Escape\";\n\n if (!el || el.contains((event?.target as Node) || null)) {\n return {};\n }\n\n return isKeyUp ? (isEscape ? handler(event) : null) : handler(event);\n };\n\n document.addEventListener(\"click\", listener);\n document.addEventListener(\"touchstart\", listener);\n document.addEventListener(\"keyup\", listener);\n\n return () => {\n document.removeEventListener(\"click\", listener);\n document.removeEventListener(\"touchstart\", listener);\n document.removeEventListener(\"keyup\", listener);\n };\n }, [ref, handler]);\n};\n"],"names":[],"mappings":";AAIa,MAAA,kBAAkB,CAC7B,KACA,YACG;AACH,YAAU,MAAM;AACR,UAAA,WAAW,CAAC,UAA+B;AAC/C,YAAM,KAAK,KAAK;AACV,YAAA,UAAU,MAAM,SAAS;AACzB,YAAA,WAAY,MAAwB,QAAQ;AAElD,UAAI,CAAC,MAAM,GAAG,SAAU,OAAO,UAAmB,IAAI,GAAG;AACvD,eAAO;MACT;AAEA,aAAO,UAAW,WAAW,QAAQ,KAAK,IAAI,OAAQ,QAAQ,KAAK;AAAA,IAAA;AAG5D,aAAA,iBAAiB,SAAS,QAAQ;AAClC,aAAA,iBAAiB,cAAc,QAAQ;AACvC,aAAA,iBAAiB,SAAS,QAAQ;AAE3C,WAAO,MAAM;AACF,eAAA,oBAAoB,SAAS,QAAQ;AACrC,eAAA,oBAAoB,cAAc,QAAQ;AAC1C,eAAA,oBAAoB,SAAS,QAAQ;AAAA,IAAA;AAAA,EAChD,GACC,CAAC,KAAK,OAAO,CAAC;AACnB;"}
1
+ {"version":3,"file":"useClickOutside.js","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nexport type HvClickOutsideEvent = MouseEvent | KeyboardEvent | TouchEvent;\n\nexport const useClickOutside = <T extends HTMLElement = HTMLElement>(\n ref: React.RefObject<T>,\n handler: (event: HvClickOutsideEvent) => void\n) => {\n useEffect(() => {\n const listener = (event: HvClickOutsideEvent) => {\n const el = ref?.current;\n const isKeyUp = event.type === \"keyup\";\n const isEscape = (event as KeyboardEvent).key === \"Escape\";\n\n if (!el || el.contains((event?.target as Node) || null)) {\n return {};\n }\n\n return isKeyUp ? (isEscape ? handler(event) : null) : handler(event);\n };\n\n document.addEventListener(\"click\", listener);\n document.addEventListener(\"touchstart\", listener);\n document.addEventListener(\"keyup\", listener);\n\n return () => {\n document.removeEventListener(\"click\", listener);\n document.removeEventListener(\"touchstart\", listener);\n document.removeEventListener(\"keyup\", listener);\n };\n }, [ref, handler]);\n};\n"],"names":[],"mappings":";AAIa,MAAA,kBAAkB,CAC7B,KACA,YACG;AACH,YAAU,MAAM;AACR,UAAA,WAAW,CAAC,UAA+B;AAC/C,YAAM,KAAK,KAAK;AACV,YAAA,UAAU,MAAM,SAAS;AACzB,YAAA,WAAY,MAAwB,QAAQ;AAElD,UAAI,CAAC,MAAM,GAAG,SAAU,OAAO,UAAmB,IAAI,GAAG;AACvD,eAAO;MACT;AAEA,aAAO,UAAW,WAAW,QAAQ,KAAK,IAAI,OAAQ,QAAQ,KAAK;AAAA,IAAA;AAG5D,aAAA,iBAAiB,SAAS,QAAQ;AAClC,aAAA,iBAAiB,cAAc,QAAQ;AACvC,aAAA,iBAAiB,SAAS,QAAQ;AAE3C,WAAO,MAAM;AACF,eAAA,oBAAoB,SAAS,QAAQ;AACrC,eAAA,oBAAoB,cAAc,QAAQ;AAC1C,eAAA,oBAAoB,SAAS,QAAQ;AAAA,IAAA;AAAA,EAChD,GACC,CAAC,KAAK,OAAO,CAAC;AACnB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport createCache, { EmotionCache } from \"@emotion/cache\";\nimport {\n css as cssReact,\n Global,\n CacheProvider,\n ClassNames,\n} from \"@emotion/react\";\n\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport { HvTheme } from \"../types/theme\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\n\nimport {\n HvThemeProvider,\n defaultCacheKey,\n defaultEmotionCache,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If `emotionCache` is passed, this is value is ignored.\n *\n * @default \"hv\"\n */\n classNameKey?: string;\n /**\n * The emotion cache instance to use. If no value is provided, the default cache is used.\n */\n emotionCache?: EmotionCache;\n /**\n * List of themes to be used by UI Kit.\n * You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.\n *\n * If no value is provided, the `ds5` theme will be used.\n */\n themes?: (HvTheme | HvThemeStructure)[];\n /**\n * The active theme. It must be one of the themes passed to `themes`.\n *\n * If no value is provided, the first theme from the `themes` list is used. If no `themes` list is provided, the `ds5` theme will be used.\n */\n theme?: string;\n /**\n * The active color mode. It must be one of the color modes of the active theme.\n *\n * If no value is provided, the first color mode defined in the active theme is used.\n * For the default themes `ds3` and `ds5`, the `dawn` color mode is the one used.\n */\n colorMode?: string;\n}\n\nconst scopedRootPrefix = \"hv-uikit-scoped-root\" as const;\n\n/**\n * Enables theming capabilities and makes cross-component theme properties available down the tree.\n */\nexport const HvProvider = ({\n children,\n rootElementId,\n cssBaseline = \"global\",\n cssTheme = \"global\",\n themes,\n theme,\n colorMode,\n emotionCache: emotionCacheProp,\n classNameKey = defaultCacheKey,\n}: HvProviderProps) => {\n const generatedId = useUniqueId();\n const scopedRootId = `${scopedRootPrefix}-${generatedId}`;\n\n // Themes\n const themesList: (HvTheme | HvThemeStructure)[] = processThemes(themes);\n\n // Emotion cache\n // Moves UI Kit styles to the top of the <head> so they're loaded first\n // This enables users to override the UI Kit styles if necessary\n const emotionCache = useMemo(() => {\n if (emotionCacheProp) return emotionCacheProp;\n // reuse the default shared cache if `classNameKey` is the same\n if (classNameKey === defaultCacheKey) return defaultEmotionCache;\n\n return createCache({ key: classNameKey, prepend: true });\n }, [classNameKey, emotionCacheProp]);\n\n return (\n <CacheProvider value={emotionCache}>\n <Global\n styles={cssReact`\n ${\n cssBaseline === \"global\" && {\n [`@layer hv-uikit-baseline`]: {\n ...CssBaseline,\n },\n }\n }\n ${getThemesVars(themesList)}\n `}\n />\n <HvThemeProvider\n themes={themesList}\n theme={theme || themesList[0].name}\n emotionCache={emotionCache}\n colorMode={colorMode || Object.keys(themesList[0].colors.modes)[0]}\n themeRootId={\n cssTheme === \"scoped\" ? rootElementId || scopedRootId : undefined\n }\n >\n <ClassNames>\n {({ css }) => {\n if (cssBaseline === \"scoped\") {\n const rootElement = getElementById(rootElementId);\n\n if (rootElement) {\n rootElement.classList.add(\n css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n );\n }\n }\n\n return (cssTheme === \"scoped\" || cssBaseline === \"scoped\") &&\n !rootElementId ? (\n <div\n id={scopedRootId}\n className={\n cssBaseline === \"scoped\"\n ? css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n : undefined\n }\n >\n {children}\n </div>\n ) : (\n children\n );\n }}\n </ClassNames>\n </HvThemeProvider>\n </CacheProvider>\n );\n};\n"],"names":["cssReact","css"],"mappings":";;;;;;;;;;AAwFA,MAAM,mBAAmB;AAKlB,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAe;AACjB,MAAuB;AACrB,QAAM,cAAc;AACpB,QAAM,eAAe,GAAG,gBAAgB,IAAI,WAAW;AAGjD,QAAA,aAA6C,cAAc,MAAM;AAKjE,QAAA,eAAe,QAAQ,MAAM;AAC7B,QAAA;AAAyB,aAAA;AAE7B,QAAI,iBAAiB;AAAwB,aAAA;AAE7C,WAAO,YAAY,EAAE,KAAK,cAAc,SAAS,MAAM;AAAA,EAAA,GACtD,CAAC,cAAc,gBAAgB,CAAC;AAGjC,SAAA,qBAAC,eAAc,EAAA,OAAO,cACpB,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQA;AAAAA,YAEJ,gBAAgB,YAAY;AAAA,UAC1B,CAAC,0BAA0B,GAAG;AAAA,YAC5B,GAAG;AAAA,UACL;AAAA,QAAA,CAEJ;AAAA,YACE,cAAc,UAAU,CAAC;AAAA;AAAA,MAAA;AAAA,IAE/B;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO,SAAS,WAAW,CAAC,EAAE;AAAA,QAC9B;AAAA,QACA,WAAW,aAAa,OAAO,KAAK,WAAW,CAAC,EAAE,OAAO,KAAK,EAAE,CAAC;AAAA,QACjE,aACE,aAAa,WAAW,iBAAiB,eAAe;AAAA,QAG1D,UAAC,oBAAA,YAAA,EACE,UAAC,CAAA,EAAE,KAAAC,WAAU;AACZ,cAAI,gBAAgB,UAAU;AACtB,kBAAA,cAAc,eAAe,aAAa;AAEhD,gBAAI,aAAa;AACf,0BAAY,UAAU;AAAA,gBACpBA,KAAI;AAAA,kBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,oBACpC,GAAG;AAAA,kBACL;AAAA,gBAAA,CACD;AAAA,cAAA;AAAA,YAEL;AAAA,UACF;AAEA,kBAAQ,aAAa,YAAY,gBAAgB,aAC/C,CAAC,gBACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WACE,gBAAgB,WACZA,KAAI;AAAA,gBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,kBACpC,GAAG;AAAA,gBACL;AAAA,cACD,CAAA,IACD;AAAA,cAGL;AAAA,YAAA;AAAA,UAGH,IAAA;AAAA,QAAA,GAGN;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport createCache, { EmotionCache } from \"@emotion/cache\";\nimport {\n css as cssReact,\n Global,\n CacheProvider,\n ClassNames,\n} from \"@emotion/react\";\n\nimport {\n CssBaseline,\n CssScopedBaseline,\n getThemesVars,\n HvThemeStructure,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { getElementById } from \"../utils/document\";\nimport { processThemes } from \"../utils/theme\";\nimport { HvTheme } from \"../types/theme\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\n\nimport {\n HvThemeProvider,\n defaultCacheKey,\n defaultEmotionCache,\n} from \"./ThemeProvider\";\n\n// Provider props\nexport interface HvProviderProps {\n /**\n * Your component tree.\n */\n children?: React.ReactNode;\n /**\n * Id of your root element.\n */\n rootElementId?: string;\n /**\n * By default the baseline styles are applied globally, `global`, to the application for the UI Kit components to work properly.\n * If you need to scope the baseline styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the baseline to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the baseline will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n * If you are providing your own baseline styles, you can set this property to `none` to disable the baseline styles.\n */\n cssBaseline?: \"global\" | \"scoped\" | \"none\";\n /**\n * By default the theme styles are applied globally, `global`, to the application.\n * If you need to scope the theme styles to avoid styling conflicts, you can set this property to `scoped`.\n * To scope the theme to your root, you need to add the `rootElementId` property.\n * If the `rootElementId` property is not set, the theme will be scoped to a new container, `hv-uikit-scoped-root*`, created around your content.\n */\n cssTheme?: \"global\" | \"scoped\";\n /**\n * The string used to prefix the class names and uniquely identify them. The key can only contain lower case alphabetical characters.\n * This is useful to avoid class name collisions.\n *\n * If `emotionCache` is passed, this is value is ignored.\n *\n * @default \"hv\"\n */\n classNameKey?: string;\n /**\n * The emotion cache instance to use. If no value is provided, the default cache is used.\n */\n emotionCache?: EmotionCache;\n /**\n * List of themes to be used by UI Kit.\n * You can provide your own themes created with the `createTheme` utility and/or the default themes `ds3` and `ds5` provided by UI Kit.\n *\n * If no value is provided, the `ds5` theme will be used.\n */\n themes?: (HvTheme | HvThemeStructure)[];\n /**\n * The active theme. It must be one of the themes passed to `themes`.\n *\n * If no value is provided, the first theme from the `themes` list is used. If no `themes` list is provided, the `ds5` theme will be used.\n */\n theme?: string;\n /**\n * The active color mode. It must be one of the color modes of the active theme.\n *\n * If no value is provided, the first color mode defined in the active theme is used.\n * For the default themes `ds3` and `ds5`, the `dawn` color mode is the one used.\n */\n colorMode?: string;\n}\n\nconst scopedRootPrefix = \"hv-uikit-scoped-root\" as const;\n\n/**\n * Enables theming capabilities and makes cross-component theme properties available down the tree.\n */\nexport const HvProvider = ({\n children,\n rootElementId,\n cssBaseline = \"global\",\n cssTheme = \"global\",\n themes,\n theme,\n colorMode,\n emotionCache: emotionCacheProp,\n classNameKey = defaultCacheKey,\n}: HvProviderProps) => {\n const generatedId = useUniqueId();\n const scopedRootId = `${scopedRootPrefix}-${generatedId}`;\n\n // Themes\n const themesList: (HvTheme | HvThemeStructure)[] = processThemes(themes);\n\n // Emotion cache\n // Moves UI Kit styles to the top of the <head> so they're loaded first\n // This enables users to override the UI Kit styles if necessary\n const emotionCache = useMemo(() => {\n if (emotionCacheProp) return emotionCacheProp;\n // reuse the default shared cache if `classNameKey` is the same\n if (classNameKey === defaultCacheKey) return defaultEmotionCache;\n\n return createCache({ key: classNameKey, prepend: true });\n }, [classNameKey, emotionCacheProp]);\n\n return (\n <CacheProvider value={emotionCache}>\n <Global\n styles={cssReact`\n ${\n cssBaseline === \"global\" && {\n [`@layer hv-uikit-baseline`]: {\n ...CssBaseline,\n },\n }\n }\n ${getThemesVars(themesList)}\n `}\n />\n <HvThemeProvider\n themes={themesList}\n theme={theme || themesList[0].name}\n emotionCache={emotionCache}\n colorMode={colorMode || Object.keys(themesList[0].colors.modes)[0]}\n themeRootId={\n cssTheme === \"scoped\" ? rootElementId || scopedRootId : undefined\n }\n >\n <ClassNames>\n {({ css }) => {\n if (cssBaseline === \"scoped\") {\n const rootElement = getElementById(rootElementId);\n\n if (rootElement) {\n rootElement.classList.add(\n css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n );\n }\n }\n\n return (cssTheme === \"scoped\" || cssBaseline === \"scoped\") &&\n !rootElementId ? (\n <div\n id={scopedRootId}\n className={\n cssBaseline === \"scoped\"\n ? css({\n [`@layer ${rootElementId}-baseline`]: {\n ...CssScopedBaseline,\n },\n })\n : undefined\n }\n >\n {children}\n </div>\n ) : (\n children\n );\n }}\n </ClassNames>\n </HvThemeProvider>\n </CacheProvider>\n );\n};\n"],"names":["cssReact","css"],"mappings":";;;;;;;;;;AAwFA,MAAM,mBAAmB;AAKlB,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAe;AACjB,MAAuB;AACrB,QAAM,cAAc;AACpB,QAAM,eAAe,GAAG,gBAAgB,IAAI,WAAW;AAGjD,QAAA,aAA6C,cAAc,MAAM;AAKjE,QAAA,eAAe,QAAQ,MAAM;AAC7B,QAAA;AAAyB,aAAA;AAE7B,QAAI,iBAAiB;AAAwB,aAAA;AAE7C,WAAO,YAAY,EAAE,KAAK,cAAc,SAAS,MAAM;AAAA,EAAA,GACtD,CAAC,cAAc,gBAAgB,CAAC;AAGjC,SAAA,qBAAC,eAAc,EAAA,OAAO,cACpB,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQA;AAAAA,YAEJ,gBAAgB,YAAY;AAAA,UAC1B,CAAC,0BAA0B,GAAG;AAAA,YAC5B,GAAG;AAAA,UACL;AAAA,QAAA,CAEJ;AAAA,YACE,cAAc,UAAU,CAAC;AAAA;AAAA,MAAA;AAAA,IAE/B;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO,SAAS,WAAW,CAAC,EAAE;AAAA,QAC9B;AAAA,QACA,WAAW,aAAa,OAAO,KAAK,WAAW,CAAC,EAAE,OAAO,KAAK,EAAE,CAAC;AAAA,QACjE,aACE,aAAa,WAAW,iBAAiB,eAAe;AAAA,QAG1D,UAAC,oBAAA,YAAA,EACE,UAAC,CAAA,EAAE,KAAAC,WAAU;AACZ,cAAI,gBAAgB,UAAU;AACtB,kBAAA,cAAc,eAAe,aAAa;AAEhD,gBAAI,aAAa;AACf,0BAAY,UAAU;AAAA,gBACpBA,KAAI;AAAA,kBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,oBACpC,GAAG;AAAA,kBACL;AAAA,gBAAA,CACD;AAAA,cAAA;AAAA,YAEL;AAAA,UACF;AAEA,kBAAQ,aAAa,YAAY,gBAAgB,aAC/C,CAAC,gBACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WACE,gBAAgB,WACZA,KAAI;AAAA,gBACF,CAAC,UAAU,aAAa,WAAW,GAAG;AAAA,kBACpC,GAAG;AAAA,gBACL;AAAA,cACD,CAAA,IACD;AAAA,cAGL;AAAA,YAAA;AAAA,UAGH,IAAA;AAAA,QAAA,GAGN;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}