@hitachivantara/uikit-react-core 5.89.0 → 5.91.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 (443) hide show
  1. package/dist/cjs/Accordion/Accordion.cjs +1 -1
  2. package/dist/cjs/Accordion/Accordion.styles.cjs +1 -5
  3. package/dist/cjs/ActionBar/ActionBar.styles.cjs +1 -1
  4. package/dist/cjs/ActionsGeneric/ActionsGeneric.cjs +1 -1
  5. package/dist/cjs/AppSwitcher/Action/Action.cjs +2 -2
  6. package/dist/cjs/AppSwitcher/Action/Action.styles.cjs +1 -1
  7. package/dist/cjs/Avatar/Avatar.cjs +21 -17
  8. package/dist/cjs/Avatar/Avatar.styles.cjs +16 -39
  9. package/dist/cjs/AvatarGroup/AvatarGroup.cjs +1 -1
  10. package/dist/cjs/AvatarGroup/AvatarGroup.styles.cjs +37 -44
  11. package/dist/cjs/Badge/Badge.cjs +3 -2
  12. package/dist/cjs/Badge/Badge.styles.cjs +7 -4
  13. package/dist/cjs/Banner/Banner.cjs +2 -0
  14. package/dist/cjs/Banner/BannerContent/BannerContent.styles.cjs +3 -1
  15. package/dist/cjs/BaseCheckBox/BaseCheckBox.cjs +8 -11
  16. package/dist/cjs/BaseCheckBox/BaseCheckBox.styles.cjs +21 -20
  17. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +5 -4
  18. package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +36 -34
  19. package/dist/cjs/BaseInput/BaseInput.styles.cjs +15 -18
  20. package/dist/cjs/BaseRadio/BaseRadio.cjs +6 -10
  21. package/dist/cjs/BaseRadio/BaseRadio.styles.cjs +17 -31
  22. package/dist/cjs/BaseSwitch/BaseSwitch.styles.cjs +18 -14
  23. package/dist/cjs/BreadCrumb/Page/Page.styles.cjs +2 -2
  24. package/dist/cjs/BreadCrumb/PathElement/PathElement.cjs +1 -1
  25. package/dist/cjs/BreadCrumb/utils.cjs +1 -1
  26. package/dist/cjs/BulkActions/BulkActions.styles.cjs +10 -9
  27. package/dist/cjs/Button/Button.styles.cjs +19 -20
  28. package/dist/cjs/ButtonBase/ButtonBase.styles.cjs +2 -2
  29. package/dist/cjs/Calendar/Calendar.styles.cjs +1 -1
  30. package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.styles.cjs +1 -1
  31. package/dist/cjs/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.cjs +1 -1
  32. package/dist/cjs/Calendar/CalendarNavigation/Navigation/Navigation.styles.cjs +1 -1
  33. package/dist/cjs/Calendar/SingleCalendar/CalendarCell.styles.cjs +8 -8
  34. package/dist/cjs/Calendar/SingleCalendar/SingleCalendar.styles.cjs +11 -11
  35. package/dist/cjs/Card/Card.cjs +1 -1
  36. package/dist/cjs/Card/Card.styles.cjs +4 -8
  37. package/dist/cjs/Carousel/Carousel.styles.cjs +8 -8
  38. package/dist/cjs/CheckBox/CheckBox.cjs +1 -1
  39. package/dist/cjs/CheckBox/CheckBox.styles.cjs +16 -7
  40. package/dist/cjs/CheckBoxGroup/CheckBoxGroup.styles.cjs +1 -1
  41. package/dist/cjs/ColorPicker/Picker/Picker.styles.cjs +2 -2
  42. package/dist/cjs/ColorPicker/PresetColors/PresetColors.cjs +2 -0
  43. package/dist/cjs/ColorPicker/SavedColors/SavedColors.cjs +5 -6
  44. package/dist/cjs/ColorPicker/SavedColors/SavedColors.styles.cjs +1 -1
  45. package/dist/cjs/DatePicker/DatePicker.cjs +1 -1
  46. package/dist/cjs/DatePicker/DatePicker.styles.cjs +2 -3
  47. package/dist/cjs/Dialog/Actions/Actions.styles.cjs +1 -1
  48. package/dist/cjs/Dialog/Dialog.styles.cjs +6 -4
  49. package/dist/cjs/DotPagination/DotPagination.cjs +10 -15
  50. package/dist/cjs/DotPagination/DotPagination.styles.cjs +16 -4
  51. package/dist/cjs/Drawer/Drawer.styles.cjs +4 -4
  52. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +2 -2
  53. package/dist/cjs/DropDownMenu/DropDownMenu.styles.cjs +8 -8
  54. package/dist/cjs/Dropdown/Dropdown.styles.cjs +9 -10
  55. package/dist/cjs/DropdownButton/DropdownButton.cjs +2 -3
  56. package/dist/cjs/DropdownButton/DropdownButton.styles.cjs +12 -18
  57. package/dist/cjs/FileUploader/DropZone/DropZone.styles.cjs +7 -7
  58. package/dist/cjs/FileUploader/File/File.cjs +4 -2
  59. package/dist/cjs/FileUploader/File/File.styles.cjs +15 -13
  60. package/dist/cjs/FileUploader/FileList/FileList.cjs +1 -1
  61. package/dist/cjs/FileUploader/FileList/FileList.styles.cjs +2 -10
  62. package/dist/cjs/FileUploader/Preview/Preview.styles.cjs +1 -1
  63. package/dist/cjs/FilterGroup/FilterContent/FilterContent.styles.cjs +1 -1
  64. package/dist/cjs/Footer/Footer.styles.cjs +7 -15
  65. package/dist/cjs/FormElement/CharCounter/CharCounter.styles.cjs +1 -1
  66. package/dist/cjs/FormElement/InfoMessage/InfoMessage.styles.cjs +2 -2
  67. package/dist/cjs/FormElement/Label/Label.styles.cjs +1 -1
  68. package/dist/cjs/FormElement/Suggestions/Suggestions.styles.cjs +2 -2
  69. package/dist/cjs/FormElement/WarningText/WarningText.styles.cjs +1 -1
  70. package/dist/cjs/GlobalActions/GlobalActions.styles.cjs +3 -3
  71. package/dist/cjs/Header/Actions/Actions.styles.cjs +1 -1
  72. package/dist/cjs/Header/Brand/Brand.styles.cjs +1 -1
  73. package/dist/cjs/Header/Header.styles.cjs +2 -2
  74. package/dist/cjs/Header/Navigation/MenuBar/Bar.styles.cjs +3 -3
  75. package/dist/cjs/Header/Navigation/MenuItem/MenuItem.styles.cjs +3 -3
  76. package/dist/cjs/InlineEditor/InlineEditor.cjs +1 -2
  77. package/dist/cjs/InlineEditor/InlineEditor.styles.cjs +5 -5
  78. package/dist/cjs/Input/Input.styles.cjs +2 -2
  79. package/dist/cjs/List/List.styles.cjs +1 -1
  80. package/dist/cjs/ListContainer/ListItem/ListItem.styles.cjs +6 -6
  81. package/dist/cjs/Loading/Loading.cjs +1 -1
  82. package/dist/cjs/Loading/Loading.styles.cjs +1 -1
  83. package/dist/cjs/LoadingContainer/LoadingContainer.styles.cjs +1 -1
  84. package/dist/cjs/Login/Login.styles.cjs +1 -1
  85. package/dist/cjs/MultiButton/MultiButton.styles.cjs +24 -22
  86. package/dist/cjs/Pagination/Pagination.styles.cjs +2 -3
  87. package/dist/cjs/Pagination/Select.styles.cjs +3 -3
  88. package/dist/cjs/Panel/Panel.styles.cjs +2 -2
  89. package/dist/cjs/ProgressBar/ProgressBar.styles.cjs +2 -2
  90. package/dist/cjs/QueryBuilder/QueryBuilder.styles.cjs +9 -10
  91. package/dist/cjs/QueryBuilder/Rule/Rule.styles.cjs +3 -3
  92. package/dist/cjs/Radio/Radio.styles.cjs +7 -9
  93. package/dist/cjs/RadioGroup/RadioGroup.styles.cjs +1 -1
  94. package/dist/cjs/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.cjs +3 -3
  95. package/dist/cjs/ScrollToHorizontal/ScrollToHorizontal.styles.cjs +1 -1
  96. package/dist/cjs/ScrollToVertical/ScrollToVertical.styles.cjs +1 -1
  97. package/dist/cjs/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.cjs +6 -6
  98. package/dist/cjs/Section/Section.styles.cjs +2 -3
  99. package/dist/cjs/Select/Select.cjs +1 -1
  100. package/dist/cjs/Select/Select.styles.cjs +15 -10
  101. package/dist/cjs/SelectionList/SelectionList.styles.cjs +1 -1
  102. package/dist/cjs/Skeleton/Skeleton.cjs +2 -5
  103. package/dist/cjs/Skeleton/Skeleton.styles.cjs +3 -3
  104. package/dist/cjs/Slider/Slider.styles.cjs +14 -16
  105. package/dist/cjs/Slider/SliderInput/SliderInput.cjs +2 -3
  106. package/dist/cjs/Slider/SliderInput/SliderInput.styles.cjs +9 -3
  107. package/dist/cjs/Slider/base.cjs +6 -8
  108. package/dist/cjs/Slider/utils.cjs +10 -10
  109. package/dist/cjs/Snackbar/Snackbar.cjs +2 -0
  110. package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.styles.cjs +2 -0
  111. package/dist/cjs/Stack/Stack.styles.cjs +1 -1
  112. package/dist/cjs/Switch/Switch.styles.cjs +1 -1
  113. package/dist/cjs/Table/Table.styles.cjs +1 -1
  114. package/dist/cjs/Table/TableCell/TableCell.styles.cjs +4 -4
  115. package/dist/cjs/Table/TableHeader/TableHeader.cjs +0 -1
  116. package/dist/cjs/Table/TableHeader/TableHeader.styles.cjs +6 -6
  117. package/dist/cjs/Table/TableRow/TableRow.styles.cjs +10 -10
  118. package/dist/cjs/Table/TableSection/TableSection.styles.cjs +6 -6
  119. package/dist/cjs/Table/hooks/useHvPagination.cjs +0 -1
  120. package/dist/cjs/Table/hooks/useHvRowExpand.cjs +0 -1
  121. package/dist/cjs/Table/hooks/useHvRowSelection.cjs +0 -3
  122. package/dist/cjs/Table/hooks/useHvSticky.cjs +1 -1
  123. package/dist/cjs/Table/renderers/ProgressColumnCell.cjs +3 -4
  124. package/dist/cjs/Tabs/Tab/Tab.styles.cjs +4 -4
  125. package/dist/cjs/Tag/Tag.cjs +20 -11
  126. package/dist/cjs/Tag/Tag.styles.cjs +40 -13
  127. package/dist/cjs/TagsInput/TagsInput.styles.cjs +8 -11
  128. package/dist/cjs/TimePicker/TimePicker.cjs +1 -1
  129. package/dist/cjs/TimePicker/TimePicker.styles.cjs +3 -4
  130. package/dist/cjs/Tooltip/Tooltip.styles.cjs +2 -2
  131. package/dist/cjs/TreeView/TreeItem/TreeItem.styles.cjs +5 -5
  132. package/dist/cjs/Typography/Typography.styles.cjs +1 -1
  133. package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.cjs +1 -1
  134. package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +3 -3
  135. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +2 -2
  136. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +4 -3
  137. package/dist/cjs/VerticalNavigation/VerticalNavigation.styles.cjs +3 -3
  138. package/dist/cjs/index.cjs +0 -15
  139. package/dist/cjs/providers/ThemeProvider.cjs +11 -11
  140. package/dist/cjs/utils/Callout.cjs +23 -15
  141. package/dist/cjs/utils/iconVariant.cjs +4 -4
  142. package/dist/esm/Accordion/Accordion.js +1 -1
  143. package/dist/esm/Accordion/Accordion.js.map +1 -1
  144. package/dist/esm/Accordion/Accordion.styles.js +1 -5
  145. package/dist/esm/Accordion/Accordion.styles.js.map +1 -1
  146. package/dist/esm/ActionBar/ActionBar.styles.js +1 -1
  147. package/dist/esm/ActionBar/ActionBar.styles.js.map +1 -1
  148. package/dist/esm/ActionsGeneric/ActionsGeneric.js +1 -1
  149. package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
  150. package/dist/esm/AppSwitcher/Action/Action.js +2 -2
  151. package/dist/esm/AppSwitcher/Action/Action.js.map +1 -1
  152. package/dist/esm/AppSwitcher/Action/Action.styles.js +1 -1
  153. package/dist/esm/AppSwitcher/Action/Action.styles.js.map +1 -1
  154. package/dist/esm/Avatar/Avatar.js +20 -16
  155. package/dist/esm/Avatar/Avatar.js.map +1 -1
  156. package/dist/esm/Avatar/Avatar.styles.js +16 -39
  157. package/dist/esm/Avatar/Avatar.styles.js.map +1 -1
  158. package/dist/esm/AvatarGroup/AvatarGroup.js +1 -1
  159. package/dist/esm/AvatarGroup/AvatarGroup.js.map +1 -1
  160. package/dist/esm/AvatarGroup/AvatarGroup.styles.js +37 -44
  161. package/dist/esm/AvatarGroup/AvatarGroup.styles.js.map +1 -1
  162. package/dist/esm/Badge/Badge.js +3 -2
  163. package/dist/esm/Badge/Badge.js.map +1 -1
  164. package/dist/esm/Badge/Badge.styles.js +7 -4
  165. package/dist/esm/Badge/Badge.styles.js.map +1 -1
  166. package/dist/esm/Banner/Banner.js +2 -0
  167. package/dist/esm/Banner/Banner.js.map +1 -1
  168. package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
  169. package/dist/esm/Banner/BannerContent/BannerContent.styles.js +3 -1
  170. package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
  171. package/dist/esm/BaseCheckBox/BaseCheckBox.js +4 -7
  172. package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
  173. package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js +21 -20
  174. package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js.map +1 -1
  175. package/dist/esm/BaseDropdown/BaseDropdown.js +5 -4
  176. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  177. package/dist/esm/BaseDropdown/BaseDropdown.styles.js +36 -34
  178. package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
  179. package/dist/esm/BaseInput/BaseInput.styles.js +15 -18
  180. package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
  181. package/dist/esm/BaseRadio/BaseRadio.js +4 -8
  182. package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
  183. package/dist/esm/BaseRadio/BaseRadio.styles.js +17 -31
  184. package/dist/esm/BaseRadio/BaseRadio.styles.js.map +1 -1
  185. package/dist/esm/BaseSwitch/BaseSwitch.styles.js +18 -14
  186. package/dist/esm/BaseSwitch/BaseSwitch.styles.js.map +1 -1
  187. package/dist/esm/BreadCrumb/Page/Page.styles.js +2 -2
  188. package/dist/esm/BreadCrumb/Page/Page.styles.js.map +1 -1
  189. package/dist/esm/BreadCrumb/PathElement/PathElement.js +1 -1
  190. package/dist/esm/BreadCrumb/PathElement/PathElement.js.map +1 -1
  191. package/dist/esm/BreadCrumb/utils.js +1 -1
  192. package/dist/esm/BreadCrumb/utils.js.map +1 -1
  193. package/dist/esm/BulkActions/BulkActions.styles.js +10 -9
  194. package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
  195. package/dist/esm/Button/Button.styles.js +19 -20
  196. package/dist/esm/Button/Button.styles.js.map +1 -1
  197. package/dist/esm/ButtonBase/ButtonBase.styles.js +2 -2
  198. package/dist/esm/ButtonBase/ButtonBase.styles.js.map +1 -1
  199. package/dist/esm/Calendar/Calendar.styles.js +1 -1
  200. package/dist/esm/Calendar/Calendar.styles.js.map +1 -1
  201. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js +1 -1
  202. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
  203. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js +1 -1
  204. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js.map +1 -1
  205. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.styles.js +1 -1
  206. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.styles.js.map +1 -1
  207. package/dist/esm/Calendar/SingleCalendar/CalendarCell.styles.js +8 -8
  208. package/dist/esm/Calendar/SingleCalendar/CalendarCell.styles.js.map +1 -1
  209. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.styles.js +11 -11
  210. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.styles.js.map +1 -1
  211. package/dist/esm/Card/Card.js +1 -1
  212. package/dist/esm/Card/Card.js.map +1 -1
  213. package/dist/esm/Card/Card.styles.js +4 -8
  214. package/dist/esm/Card/Card.styles.js.map +1 -1
  215. package/dist/esm/Carousel/Carousel.styles.js +8 -8
  216. package/dist/esm/Carousel/Carousel.styles.js.map +1 -1
  217. package/dist/esm/CheckBox/CheckBox.js +1 -1
  218. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  219. package/dist/esm/CheckBox/CheckBox.styles.js +16 -7
  220. package/dist/esm/CheckBox/CheckBox.styles.js.map +1 -1
  221. package/dist/esm/CheckBoxGroup/CheckBoxGroup.styles.js +1 -1
  222. package/dist/esm/CheckBoxGroup/CheckBoxGroup.styles.js.map +1 -1
  223. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  224. package/dist/esm/ColorPicker/Picker/Picker.styles.js +2 -2
  225. package/dist/esm/ColorPicker/Picker/Picker.styles.js.map +1 -1
  226. package/dist/esm/ColorPicker/PresetColors/PresetColors.js +2 -0
  227. package/dist/esm/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  228. package/dist/esm/ColorPicker/SavedColors/SavedColors.js +5 -6
  229. package/dist/esm/ColorPicker/SavedColors/SavedColors.js.map +1 -1
  230. package/dist/esm/ColorPicker/SavedColors/SavedColors.styles.js +1 -1
  231. package/dist/esm/ColorPicker/SavedColors/SavedColors.styles.js.map +1 -1
  232. package/dist/esm/DatePicker/DatePicker.js +1 -1
  233. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  234. package/dist/esm/DatePicker/DatePicker.styles.js +2 -3
  235. package/dist/esm/DatePicker/DatePicker.styles.js.map +1 -1
  236. package/dist/esm/Dialog/Actions/Actions.styles.js +1 -1
  237. package/dist/esm/Dialog/Actions/Actions.styles.js.map +1 -1
  238. package/dist/esm/Dialog/Dialog.styles.js +6 -4
  239. package/dist/esm/Dialog/Dialog.styles.js.map +1 -1
  240. package/dist/esm/DotPagination/DotPagination.js +10 -15
  241. package/dist/esm/DotPagination/DotPagination.js.map +1 -1
  242. package/dist/esm/DotPagination/DotPagination.styles.js +16 -4
  243. package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
  244. package/dist/esm/Drawer/Drawer.styles.js +4 -4
  245. package/dist/esm/Drawer/Drawer.styles.js.map +1 -1
  246. package/dist/esm/DropDownMenu/DropDownMenu.js +2 -2
  247. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  248. package/dist/esm/DropDownMenu/DropDownMenu.styles.js +8 -8
  249. package/dist/esm/DropDownMenu/DropDownMenu.styles.js.map +1 -1
  250. package/dist/esm/Dropdown/Dropdown.styles.js +9 -10
  251. package/dist/esm/Dropdown/Dropdown.styles.js.map +1 -1
  252. package/dist/esm/DropdownButton/DropdownButton.js +2 -3
  253. package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
  254. package/dist/esm/DropdownButton/DropdownButton.styles.js +12 -18
  255. package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -1
  256. package/dist/esm/FileUploader/DropZone/DropZone.styles.js +7 -7
  257. package/dist/esm/FileUploader/DropZone/DropZone.styles.js.map +1 -1
  258. package/dist/esm/FileUploader/File/File.js +4 -2
  259. package/dist/esm/FileUploader/File/File.js.map +1 -1
  260. package/dist/esm/FileUploader/File/File.styles.js +15 -13
  261. package/dist/esm/FileUploader/File/File.styles.js.map +1 -1
  262. package/dist/esm/FileUploader/FileList/FileList.js +1 -1
  263. package/dist/esm/FileUploader/FileList/FileList.js.map +1 -1
  264. package/dist/esm/FileUploader/FileList/FileList.styles.js +2 -10
  265. package/dist/esm/FileUploader/FileList/FileList.styles.js.map +1 -1
  266. package/dist/esm/FileUploader/Preview/Preview.styles.js +1 -1
  267. package/dist/esm/FileUploader/Preview/Preview.styles.js.map +1 -1
  268. package/dist/esm/FilterGroup/FilterContent/FilterContent.styles.js +1 -1
  269. package/dist/esm/FilterGroup/FilterContent/FilterContent.styles.js.map +1 -1
  270. package/dist/esm/Footer/Footer.styles.js +7 -15
  271. package/dist/esm/Footer/Footer.styles.js.map +1 -1
  272. package/dist/esm/FormElement/CharCounter/CharCounter.styles.js +1 -1
  273. package/dist/esm/FormElement/CharCounter/CharCounter.styles.js.map +1 -1
  274. package/dist/esm/FormElement/InfoMessage/InfoMessage.styles.js +2 -2
  275. package/dist/esm/FormElement/InfoMessage/InfoMessage.styles.js.map +1 -1
  276. package/dist/esm/FormElement/Label/Label.styles.js +1 -1
  277. package/dist/esm/FormElement/Label/Label.styles.js.map +1 -1
  278. package/dist/esm/FormElement/Suggestions/Suggestions.styles.js +2 -2
  279. package/dist/esm/FormElement/Suggestions/Suggestions.styles.js.map +1 -1
  280. package/dist/esm/FormElement/WarningText/WarningText.styles.js +1 -1
  281. package/dist/esm/FormElement/WarningText/WarningText.styles.js.map +1 -1
  282. package/dist/esm/GlobalActions/GlobalActions.styles.js +3 -3
  283. package/dist/esm/GlobalActions/GlobalActions.styles.js.map +1 -1
  284. package/dist/esm/Header/Actions/Actions.styles.js +1 -1
  285. package/dist/esm/Header/Actions/Actions.styles.js.map +1 -1
  286. package/dist/esm/Header/Brand/Brand.styles.js +1 -1
  287. package/dist/esm/Header/Brand/Brand.styles.js.map +1 -1
  288. package/dist/esm/Header/Header.styles.js +2 -2
  289. package/dist/esm/Header/Header.styles.js.map +1 -1
  290. package/dist/esm/Header/Navigation/MenuBar/Bar.styles.js +3 -3
  291. package/dist/esm/Header/Navigation/MenuBar/Bar.styles.js.map +1 -1
  292. package/dist/esm/Header/Navigation/MenuItem/MenuItem.styles.js +3 -3
  293. package/dist/esm/Header/Navigation/MenuItem/MenuItem.styles.js.map +1 -1
  294. package/dist/esm/InlineEditor/InlineEditor.js +1 -2
  295. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  296. package/dist/esm/InlineEditor/InlineEditor.styles.js +5 -5
  297. package/dist/esm/InlineEditor/InlineEditor.styles.js.map +1 -1
  298. package/dist/esm/Input/Input.styles.js +2 -2
  299. package/dist/esm/Input/Input.styles.js.map +1 -1
  300. package/dist/esm/List/List.styles.js +1 -1
  301. package/dist/esm/List/List.styles.js.map +1 -1
  302. package/dist/esm/ListContainer/ListItem/ListItem.styles.js +6 -6
  303. package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
  304. package/dist/esm/Loading/Loading.js +1 -1
  305. package/dist/esm/Loading/Loading.js.map +1 -1
  306. package/dist/esm/Loading/Loading.styles.js +1 -1
  307. package/dist/esm/Loading/Loading.styles.js.map +1 -1
  308. package/dist/esm/LoadingContainer/LoadingContainer.styles.js +1 -1
  309. package/dist/esm/LoadingContainer/LoadingContainer.styles.js.map +1 -1
  310. package/dist/esm/Login/Login.styles.js +1 -1
  311. package/dist/esm/Login/Login.styles.js.map +1 -1
  312. package/dist/esm/MultiButton/MultiButton.styles.js +24 -22
  313. package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
  314. package/dist/esm/Pagination/Pagination.styles.js +2 -3
  315. package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
  316. package/dist/esm/Pagination/Select.styles.js +3 -3
  317. package/dist/esm/Pagination/Select.styles.js.map +1 -1
  318. package/dist/esm/Panel/Panel.styles.js +2 -2
  319. package/dist/esm/Panel/Panel.styles.js.map +1 -1
  320. package/dist/esm/ProgressBar/ProgressBar.styles.js +2 -2
  321. package/dist/esm/ProgressBar/ProgressBar.styles.js.map +1 -1
  322. package/dist/esm/QueryBuilder/QueryBuilder.styles.js +9 -10
  323. package/dist/esm/QueryBuilder/QueryBuilder.styles.js.map +1 -1
  324. package/dist/esm/QueryBuilder/Rule/Rule.styles.js +3 -3
  325. package/dist/esm/QueryBuilder/Rule/Rule.styles.js.map +1 -1
  326. package/dist/esm/Radio/Radio.styles.js +7 -9
  327. package/dist/esm/Radio/Radio.styles.js.map +1 -1
  328. package/dist/esm/RadioGroup/RadioGroup.styles.js +1 -1
  329. package/dist/esm/RadioGroup/RadioGroup.styles.js.map +1 -1
  330. package/dist/esm/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js +3 -3
  331. package/dist/esm/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js.map +1 -1
  332. package/dist/esm/ScrollToHorizontal/ScrollToHorizontal.styles.js +1 -1
  333. package/dist/esm/ScrollToHorizontal/ScrollToHorizontal.styles.js.map +1 -1
  334. package/dist/esm/ScrollToVertical/ScrollToVertical.styles.js +1 -1
  335. package/dist/esm/ScrollToVertical/ScrollToVertical.styles.js.map +1 -1
  336. package/dist/esm/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.js +6 -6
  337. package/dist/esm/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +1 -1
  338. package/dist/esm/Section/Section.styles.js +2 -3
  339. package/dist/esm/Section/Section.styles.js.map +1 -1
  340. package/dist/esm/Select/Select.js +1 -1
  341. package/dist/esm/Select/Select.js.map +1 -1
  342. package/dist/esm/Select/Select.styles.js +15 -10
  343. package/dist/esm/Select/Select.styles.js.map +1 -1
  344. package/dist/esm/SelectionList/SelectionList.styles.js +1 -1
  345. package/dist/esm/SelectionList/SelectionList.styles.js.map +1 -1
  346. package/dist/esm/SimpleGrid/SimpleGrid.js.map +1 -1
  347. package/dist/esm/Skeleton/Skeleton.js +2 -5
  348. package/dist/esm/Skeleton/Skeleton.js.map +1 -1
  349. package/dist/esm/Skeleton/Skeleton.styles.js +3 -3
  350. package/dist/esm/Skeleton/Skeleton.styles.js.map +1 -1
  351. package/dist/esm/Slider/Slider.styles.js +14 -16
  352. package/dist/esm/Slider/Slider.styles.js.map +1 -1
  353. package/dist/esm/Slider/SliderInput/SliderInput.js +3 -4
  354. package/dist/esm/Slider/SliderInput/SliderInput.js.map +1 -1
  355. package/dist/esm/Slider/SliderInput/SliderInput.styles.js +9 -3
  356. package/dist/esm/Slider/SliderInput/SliderInput.styles.js.map +1 -1
  357. package/dist/esm/Slider/base.js +6 -8
  358. package/dist/esm/Slider/base.js.map +1 -1
  359. package/dist/esm/Slider/utils.js +10 -10
  360. package/dist/esm/Slider/utils.js.map +1 -1
  361. package/dist/esm/Snackbar/Snackbar.js +2 -0
  362. package/dist/esm/Snackbar/Snackbar.js.map +1 -1
  363. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
  364. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js +2 -0
  365. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
  366. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  367. package/dist/esm/Stack/Stack.styles.js +1 -1
  368. package/dist/esm/Stack/Stack.styles.js.map +1 -1
  369. package/dist/esm/Switch/Switch.styles.js +1 -1
  370. package/dist/esm/Switch/Switch.styles.js.map +1 -1
  371. package/dist/esm/Table/Table.styles.js +1 -1
  372. package/dist/esm/Table/Table.styles.js.map +1 -1
  373. package/dist/esm/Table/TableCell/TableCell.styles.js +4 -4
  374. package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
  375. package/dist/esm/Table/TableHeader/TableHeader.js +0 -1
  376. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  377. package/dist/esm/Table/TableHeader/TableHeader.styles.js +6 -6
  378. package/dist/esm/Table/TableHeader/TableHeader.styles.js.map +1 -1
  379. package/dist/esm/Table/TableRow/TableRow.styles.js +10 -10
  380. package/dist/esm/Table/TableRow/TableRow.styles.js.map +1 -1
  381. package/dist/esm/Table/TableSection/TableSection.styles.js +6 -6
  382. package/dist/esm/Table/TableSection/TableSection.styles.js.map +1 -1
  383. package/dist/esm/Table/hooks/useHvPagination.js +0 -1
  384. package/dist/esm/Table/hooks/useHvPagination.js.map +1 -1
  385. package/dist/esm/Table/hooks/useHvRowExpand.js +0 -1
  386. package/dist/esm/Table/hooks/useHvRowExpand.js.map +1 -1
  387. package/dist/esm/Table/hooks/useHvRowSelection.js +0 -3
  388. package/dist/esm/Table/hooks/useHvRowSelection.js.map +1 -1
  389. package/dist/esm/Table/hooks/useHvSticky.js +1 -1
  390. package/dist/esm/Table/hooks/useHvSticky.js.map +1 -1
  391. package/dist/esm/Table/renderers/ProgressColumnCell.js +4 -5
  392. package/dist/esm/Table/renderers/ProgressColumnCell.js.map +1 -1
  393. package/dist/esm/Tabs/Tab/Tab.styles.js +4 -4
  394. package/dist/esm/Tabs/Tab/Tab.styles.js.map +1 -1
  395. package/dist/esm/Tag/Tag.js +21 -12
  396. package/dist/esm/Tag/Tag.js.map +1 -1
  397. package/dist/esm/Tag/Tag.styles.js +40 -13
  398. package/dist/esm/Tag/Tag.styles.js.map +1 -1
  399. package/dist/esm/TagsInput/TagsInput.styles.js +8 -11
  400. package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
  401. package/dist/esm/TimePicker/TimePicker.js +1 -1
  402. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  403. package/dist/esm/TimePicker/TimePicker.styles.js +3 -4
  404. package/dist/esm/TimePicker/TimePicker.styles.js.map +1 -1
  405. package/dist/esm/Tooltip/Tooltip.styles.js +2 -2
  406. package/dist/esm/Tooltip/Tooltip.styles.js.map +1 -1
  407. package/dist/esm/TreeView/TreeItem/TreeItem.styles.js +5 -5
  408. package/dist/esm/TreeView/TreeItem/TreeItem.styles.js.map +1 -1
  409. package/dist/esm/Typography/Typography.styles.js +1 -1
  410. package/dist/esm/Typography/Typography.styles.js.map +1 -1
  411. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js +1 -1
  412. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  413. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +3 -3
  414. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
  415. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +2 -2
  416. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  417. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +4 -3
  418. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
  419. package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js +3 -3
  420. package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
  421. package/dist/esm/index.js +6 -21
  422. package/dist/esm/index.js.map +1 -1
  423. package/dist/esm/providers/ThemeProvider.js +11 -11
  424. package/dist/esm/providers/ThemeProvider.js.map +1 -1
  425. package/dist/esm/utils/Callout.js +24 -16
  426. package/dist/esm/utils/Callout.js.map +1 -1
  427. package/dist/esm/utils/hexToRgbA.js.map +1 -1
  428. package/dist/esm/utils/iconVariant.js +4 -4
  429. package/dist/esm/utils/iconVariant.js.map +1 -1
  430. package/dist/types/index.d.ts +57 -64
  431. package/package.json +6 -6
  432. package/dist/cjs/hocs/withTooltip.cjs +0 -53
  433. package/dist/cjs/utils/Random.cjs +0 -18
  434. package/dist/cjs/utils/checkValidHexColorValue.cjs +0 -7
  435. package/dist/cjs/utils/wrapperTooltip.cjs +0 -14
  436. package/dist/esm/hocs/withTooltip.js +0 -53
  437. package/dist/esm/hocs/withTooltip.js.map +0 -1
  438. package/dist/esm/utils/Random.js +0 -18
  439. package/dist/esm/utils/Random.js.map +0 -1
  440. package/dist/esm/utils/checkValidHexColorValue.js +0 -7
  441. package/dist/esm/utils/checkValidHexColorValue.js.map +0 -1
  442. package/dist/esm/utils/wrapperTooltip.js +0 -14
  443. package/dist/esm/utils/wrapperTooltip.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Action.styles.js","sources":["../../../../src/AppSwitcher/Action/Action.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvAppSwitcher-Action\",\n {\n root: {\n width: \"100%\",\n maxWidth: 280,\n minHeight: 52,\n },\n icon: { display: \"flex\", minWidth: 40, justifyContent: \"center\" },\n iconUrl: { width: 32 },\n iconInfo: { minWidth: 32 },\n disabled: {},\n selected: {},\n typography: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n\n width: \"100%\",\n minHeight: 52,\n\n padding: `6px ${theme.space.xs}`,\n\n border: \"none\",\n borderLeft: `solid 2px ${theme.colors.secondary}`,\n\n cursor: \"pointer\",\n\n textDecoration: \"inherit\",\n backgroundColor: \"inherit\",\n\n \"$disabled &\": {\n cursor: \"not-allowed\",\n },\n },\n title: {\n flexGrow: 1,\n whiteSpace: \"normal\",\n textAlign: \"left\",\n margin: `0 ${theme.space.xs}`,\n textWrap: \"balance\",\n ...theme.typography.label,\n color: \"inherit\",\n },\n titleAnchor: {\n WebkitLineClamp: 2,\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,eAAe,WAAA,IAAe;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,MAAM,EAAE,SAAS,QAAQ,UAAU,IAAI,gBAAgB,SAAS;AAAA,IAChE,SAAS,EAAE,OAAO,GAAG;AAAA,IACrB,UAAU,EAAE,UAAU,GAAG;AAAA,IACzB,UAAU,CAAC;AAAA,IACX,UAAU,CAAC;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MAEZ,OAAO;AAAA,MACP,WAAW;AAAA,MAEX,SAAS,OAAO,MAAM,MAAM,EAAE;AAAA,MAE9B,QAAQ;AAAA,MACR,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,MAE/C,QAAQ;AAAA,MAER,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MAEjB,eAAe;AAAA,QACb,QAAQ;AAAA,MAAA;AAAA,IAEZ;AAAA,IACA,OAAO;AAAA,MACL,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,QAAQ,KAAK,MAAM,MAAM,EAAE;AAAA,MAC3B,UAAU;AAAA,MACV,GAAG,MAAM,WAAW;AAAA,MACpB,OAAO;AAAA,IACT;AAAA,IACA,aAAa;AAAA,MACX,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ;"}
1
+ {"version":3,"file":"Action.styles.js","sources":["../../../../src/AppSwitcher/Action/Action.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvAppSwitcher-Action\",\n {\n root: {\n width: \"100%\",\n maxWidth: 280,\n minHeight: 52,\n },\n icon: { display: \"flex\", minWidth: 40, justifyContent: \"center\" },\n iconUrl: { width: 32 },\n iconInfo: { minWidth: 32 },\n disabled: {},\n selected: {},\n typography: {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n\n width: \"100%\",\n minHeight: 52,\n\n padding: `6px ${theme.space.xs}`,\n\n border: \"none\",\n borderLeft: `2px solid currentcolor`,\n\n cursor: \"pointer\",\n\n textDecoration: \"inherit\",\n backgroundColor: \"inherit\",\n\n \"$disabled &\": {\n cursor: \"not-allowed\",\n },\n },\n title: {\n flexGrow: 1,\n whiteSpace: \"normal\",\n textAlign: \"left\",\n margin: `0 ${theme.space.xs}`,\n textWrap: \"balance\",\n ...theme.typography.label,\n color: \"inherit\",\n },\n titleAnchor: {\n WebkitLineClamp: 2,\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,eAAe,WAAA,IAAe;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,IACA,MAAM,EAAE,SAAS,QAAQ,UAAU,IAAI,gBAAgB,SAAS;AAAA,IAChE,SAAS,EAAE,OAAO,GAAG;AAAA,IACrB,UAAU,EAAE,UAAU,GAAG;AAAA,IACzB,UAAU,CAAC;AAAA,IACX,UAAU,CAAC;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MAEZ,OAAO;AAAA,MACP,WAAW;AAAA,MAEX,SAAS,OAAO,MAAM,MAAM,EAAE;AAAA,MAE9B,QAAQ;AAAA,MACR,YAAY;AAAA,MAEZ,QAAQ;AAAA,MAER,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MAEjB,eAAe;AAAA,QACb,QAAQ;AAAA,MAAA;AAAA,IAEZ;AAAA,IACA,OAAO;AAAA,MACL,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,QAAQ,KAAK,MAAM,MAAM,EAAE;AAAA,MAC3B,UAAU;AAAA,MACV,GAAG,MAAM,WAAW;AAAA,MACpB,OAAO;AAAA,IACT;AAAA,IACA,aAAa;AAAA,MACX,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ;"}
@@ -3,12 +3,18 @@ import { forwardRef } from "react";
3
3
  import MuiAvatar from "@mui/material/Avatar";
4
4
  import { User } from "@hitachivantara/uikit-react-icons";
5
5
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
6
- import { getColor, theme } from "@hitachivantara/uikit-styles";
6
+ import { getColor } from "@hitachivantara/uikit-styles";
7
7
  import { useAvatarGroupContext } from "../AvatarGroup/AvatarGroupContext.js";
8
8
  import { useImageLoaded } from "../hooks/useImageLoaded.js";
9
- import { decreaseSize } from "../utils/sizes.js";
10
9
  import { useClasses } from "./Avatar.styles.js";
11
10
  import { staticClasses } from "./Avatar.styles.js";
11
+ const decreaseSizeMap = {
12
+ xl: "lg",
13
+ lg: "md",
14
+ md: "sm",
15
+ sm: "xs",
16
+ xs: "xs"
17
+ };
12
18
  const HvAvatar = forwardRef(function HvAvatar2(props, ref) {
13
19
  const {
14
20
  className,
@@ -17,8 +23,8 @@ const HvAvatar = forwardRef(function HvAvatar2(props, ref) {
17
23
  children: childrenProp,
18
24
  component = "div",
19
25
  size: sizeProp,
20
- backgroundColor = "secondary",
21
- color = "atmo1",
26
+ backgroundColor = "text",
27
+ color = "bgContainer",
22
28
  src,
23
29
  srcSet,
24
30
  sizes,
@@ -58,7 +64,7 @@ const HvAvatar = forwardRef(function HvAvatar2(props, ref) {
58
64
  User,
59
65
  {
60
66
  color,
61
- iconSize: decreaseSize(size),
67
+ size: decreaseSizeMap[size],
62
68
  className: classes.fallback
63
69
  }
64
70
  );
@@ -70,29 +76,27 @@ const HvAvatar = forwardRef(function HvAvatar2(props, ref) {
70
76
  inlineStyle.borderRadius = "50%";
71
77
  }
72
78
  if (!hasImgNotFailing) {
73
- inlineStyle.backgroundColor = getColor(
74
- backgroundColor,
75
- theme.colors.secondary
76
- );
77
- inlineStyle.color = getColor(color, theme.colors.atmo1);
79
+ inlineStyle.backgroundColor = getColor(backgroundColor, "text");
80
+ inlineStyle.color = getColor(color, "textDimmed");
78
81
  }
79
82
  const statusInlineStyle = {};
80
83
  if (status) {
81
- const statusColor = getColor(status, theme.colors.positive);
84
+ const statusColor = getColor(status, "positive");
82
85
  statusInlineStyle.boxShadow = `inset 0px 0px 0px 2px ${statusColor}`;
83
86
  }
84
- const badgeColor = getColor(badge || "", theme.colors.positive);
85
- return /* @__PURE__ */ jsx("div", { ref, className: classes.container, ...others, children: /* @__PURE__ */ jsxs(
87
+ return /* @__PURE__ */ jsxs(
86
88
  "div",
87
89
  {
88
- className: cx(classes.status, classes[variant], classes[size]),
90
+ ref,
91
+ className: cx(classes.container, classes.status, classes[variant]),
89
92
  style: statusInlineStyle,
93
+ ...others,
90
94
  children: [
91
95
  badge && /* @__PURE__ */ jsx(
92
96
  "div",
93
97
  {
94
98
  className: classes.badge,
95
- style: { backgroundColor: badgeColor }
99
+ style: { backgroundColor: getColor(badge, "positive") }
96
100
  }
97
101
  ),
98
102
  /* @__PURE__ */ jsx(
@@ -109,7 +113,7 @@ const HvAvatar = forwardRef(function HvAvatar2(props, ref) {
109
113
  )
110
114
  ]
111
115
  }
112
- ) });
116
+ );
113
117
  });
114
118
  export {
115
119
  HvAvatar,
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../src/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport MuiAvatar, { AvatarProps as MuiAvatarProps } from \"@mui/material/Avatar\";\nimport { User } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport {\n getColor,\n HvColorAny,\n HvSize,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport { useAvatarGroupContext } from \"../AvatarGroup/AvatarGroupContext\";\nimport { useImageLoaded } from \"../hooks/useImageLoaded\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { decreaseSize } from \"../utils/sizes\";\nimport { staticClasses, useClasses } from \"./Avatar.styles\";\n\nexport { staticClasses as avatarClasses };\n\nexport type HvAvatarClasses = ExtractNames<typeof useClasses>;\n\nexport type HvAvatarVariant = \"circular\" | \"square\";\n\n/** @deprecated use `HvSize` instead */\nexport type HvAvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface HvAvatarProps extends HvBaseProps {\n /** The component used for the root node. Either a string to use a DOM element or a component. */\n component?: React.ElementType;\n /** Sets one of the standard sizes of the icons */\n size?: HvSize;\n /** A color representing the foreground color of the avatar's letters or the generic User icon fallback. */\n color?: HvColorAny;\n /** A String representing the background color of the avatar. */\n backgroundColor?: HvColorAny;\n /** The `src` attribute for the `img` element. */\n src?: string;\n /** The `srcSet` attribute for the `img` element. Use this attribute for responsive image display. */\n srcSet?: string;\n /** The `sizes` attribute for the `img` element. */\n sizes?: string;\n /** Used in combination with `src` or `srcSet` to provide an alt attribute for the rendered `img` element. */\n alt?: string;\n /**\n * Attributes applied to the `img` element if the component is used to display an image.\n * It can be used to listen for the loading error event.\n */\n imgProps?: React.HTMLAttributes<HTMLImageElement>;\n /** A string representing the type of avatar to display, circular or square. */\n variant?: HvAvatarVariant;\n /** A string representing the color of the avatar border that represents its status. */\n status?: string;\n /** A string representing the color of the avatar badge. */\n badge?: string;\n /** Attributes applied to the avatar element. */\n avatarProps?: MuiAvatarProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarClasses;\n}\n\n/**\n * Avatars can be used to represent a user or a brand.\n * They can show an image, an icon or the initial letters of a name, for example.\n */\nexport const HvAvatar = forwardRef<\n // no-indent\n React.ComponentRef<\"div\">,\n HvAvatarProps\n>(function HvAvatar(props, ref) {\n const {\n className,\n style,\n classes: classesProp,\n children: childrenProp,\n component = \"div\",\n size: sizeProp,\n backgroundColor = \"secondary\",\n color = \"atmo1\",\n src,\n srcSet,\n sizes,\n alt,\n imgProps,\n status,\n badge,\n variant = \"circular\",\n avatarProps,\n ...others\n } = useDefaultProps(\"HvAvatar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const avatarGroupContext = useAvatarGroupContext();\n\n const size = sizeProp || avatarGroupContext?.size || \"sm\";\n\n let children: React.ReactNode;\n\n // Use a hook instead of onError on the img element to support server-side rendering.\n const imageLoaded = useImageLoaded(src, srcSet);\n const hasImg = src || srcSet;\n const hasImgNotFailing = hasImg && imageLoaded !== \"error\";\n\n if (hasImgNotFailing) {\n children = (\n <img\n alt={alt}\n src={src}\n srcSet={srcSet}\n sizes={sizes}\n className={classes.img}\n {...imgProps}\n />\n );\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (hasImg && alt) {\n [children] = alt;\n } else {\n children = (\n <User\n color={color}\n iconSize={decreaseSize(size)}\n className={classes.fallback}\n />\n );\n }\n\n const inlineStyle: React.CSSProperties = {\n ...style,\n };\n\n if (component != null && typeof component !== \"string\") {\n // override border-radius with custom components\n inlineStyle.borderRadius = \"50%\";\n }\n\n if (!hasImgNotFailing) {\n inlineStyle.backgroundColor = getColor(\n backgroundColor,\n theme.colors.secondary,\n );\n inlineStyle.color = getColor(color, theme.colors.atmo1);\n }\n\n const statusInlineStyle: React.CSSProperties = {};\n if (status) {\n // set the status border. we're using the boxShadow property to set the border\n // to be inside the container and not on its edge.\n const statusColor = getColor(status, theme.colors.positive);\n statusInlineStyle.boxShadow = `inset 0px 0px 0px 2px ${statusColor}`;\n }\n\n const badgeColor = getColor(badge || \"\", theme.colors.positive);\n\n return (\n <div ref={ref} className={classes.container} {...others}>\n <div\n className={cx(classes.status, classes[variant], classes[size])}\n style={statusInlineStyle}\n >\n {badge && (\n <div\n className={classes.badge}\n style={{ backgroundColor: badgeColor }}\n />\n )}\n <MuiAvatar\n component={component}\n // Consider not using the root and className classes in this component\n className={cx(classes.root, classes.avatar, classes[size], className)}\n style={inlineStyle}\n variant={variant}\n size={size}\n {...avatarProps}\n >\n {children}\n </MuiAvatar>\n </div>\n </div>\n );\n});\n"],"names":["HvAvatar"],"mappings":";;;;;;;;;;;AAmEO,MAAM,WAAW,WAItB,SAASA,UAAS,OAAO,KAAK;AACxB,QAAA;AAAA,IACJ;AAA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AAI,QAAQ;AAGV,UAAM,cAAc,SAAS,QAAQ,MAAM,OAAO,QAAQ;AACxC,sBAAA,YAAY,yBAAyB,WAAW;AAAA,EAAA;AAGpE,QAAM,aAAa,SAAS,SAAS,IAAI,MAAM,OAAO,QAAQ;AAE9D,6BACG,OAAI,EAAA,KAAU,WAAW,QAAQ,WAAY,GAAG,QAC/C,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,QAAQ,QAAQ,QAAQ,OAAO,GAAG,QAAQ,IAAI,CAAC;AAAA,MAC7D,OAAO;AAAA,MAEN,UAAA;AAAA,QACC,SAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,QAAQ;AAAA,YACnB,OAAO,EAAE,iBAAiB,WAAW;AAAA,UAAA;AAAA,QACvC;AAAA,QAEF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YAEA,WAAW,GAAG,QAAQ,MAAM,QAAQ,QAAQ,QAAQ,IAAI,GAAG,SAAS;AAAA,YACpE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACC,GAAG;AAAA,YAEH;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../src/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport MuiAvatar, { AvatarProps as MuiAvatarProps } from \"@mui/material/Avatar\";\nimport { User } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny, HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { useAvatarGroupContext } from \"../AvatarGroup/AvatarGroupContext\";\nimport { useImageLoaded } from \"../hooks/useImageLoaded\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./Avatar.styles\";\n\nconst decreaseSizeMap = {\n xl: \"lg\",\n lg: \"md\",\n md: \"sm\",\n sm: \"xs\",\n xs: \"xs\",\n} satisfies Record<HvSize, HvSize>;\n\nexport { staticClasses as avatarClasses };\n\nexport type HvAvatarClasses = ExtractNames<typeof useClasses>;\n\nexport type HvAvatarVariant = \"circular\" | \"square\";\n\n/** @deprecated use `HvSize` instead */\nexport type HvAvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface HvAvatarProps extends HvBaseProps {\n /** The component used for the root node. Either a string to use a DOM element or a component. */\n component?: React.ElementType;\n /** Sets one of the standard sizes of the icons */\n size?: HvSize;\n /** A color representing the foreground color of the avatar's letters or the generic User icon fallback. */\n color?: HvColorAny;\n /** A String representing the background color of the avatar. */\n backgroundColor?: HvColorAny;\n /** The `src` attribute for the `img` element. */\n src?: string;\n /** The `srcSet` attribute for the `img` element. Use this attribute for responsive image display. */\n srcSet?: string;\n /** The `sizes` attribute for the `img` element. */\n sizes?: string;\n /** Used in combination with `src` or `srcSet` to provide an alt attribute for the rendered `img` element. */\n alt?: string;\n /**\n * Attributes applied to the `img` element if the component is used to display an image.\n * It can be used to listen for the loading error event.\n */\n imgProps?: React.HTMLAttributes<HTMLImageElement>;\n /** A string representing the type of avatar to display, circular or square. */\n variant?: HvAvatarVariant;\n /** A string representing the color of the avatar border that represents its status. */\n status?: string;\n /** A string representing the color of the avatar badge. */\n badge?: string;\n /** Attributes applied to the avatar element. */\n avatarProps?: MuiAvatarProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarClasses;\n}\n\n/**\n * Avatars can be used to represent a user or a brand.\n * They can show an image, an icon or the initial letters of a name, for example.\n */\nexport const HvAvatar = forwardRef<\n // no-indent\n React.ComponentRef<\"div\">,\n HvAvatarProps\n>(function HvAvatar(props, ref) {\n const {\n className,\n style,\n classes: classesProp,\n children: childrenProp,\n component = \"div\",\n size: sizeProp,\n backgroundColor = \"text\",\n color = \"bgContainer\",\n src,\n srcSet,\n sizes,\n alt,\n imgProps,\n status,\n badge,\n variant = \"circular\",\n avatarProps,\n ...others\n } = useDefaultProps(\"HvAvatar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const avatarGroupContext = useAvatarGroupContext();\n\n const size = sizeProp || avatarGroupContext?.size || \"sm\";\n\n let children: React.ReactNode;\n\n // Use a hook instead of onError on the img element to support server-side rendering.\n const imageLoaded = useImageLoaded(src, srcSet);\n const hasImg = src || srcSet;\n const hasImgNotFailing = hasImg && imageLoaded !== \"error\";\n\n if (hasImgNotFailing) {\n children = (\n <img\n alt={alt}\n src={src}\n srcSet={srcSet}\n sizes={sizes}\n className={classes.img}\n {...imgProps}\n />\n );\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (hasImg && alt) {\n [children] = alt;\n } else {\n children = (\n <User\n color={color}\n size={decreaseSizeMap[size]}\n className={classes.fallback}\n />\n );\n }\n\n const inlineStyle: React.CSSProperties = {\n ...style,\n };\n\n if (component != null && typeof component !== \"string\") {\n // override border-radius with custom components\n inlineStyle.borderRadius = \"50%\";\n }\n\n if (!hasImgNotFailing) {\n inlineStyle.backgroundColor = getColor(backgroundColor, \"text\");\n inlineStyle.color = getColor(color, \"textDimmed\");\n }\n\n const statusInlineStyle: React.CSSProperties = {};\n if (status) {\n // set the status border. we're using the boxShadow property to set the border\n // to be inside the container and not on its edge.\n const statusColor = getColor(status, \"positive\");\n statusInlineStyle.boxShadow = `inset 0px 0px 0px 2px ${statusColor}`;\n }\n\n return (\n <div\n ref={ref}\n className={cx(classes.container, classes.status, classes[variant])}\n style={statusInlineStyle}\n {...others}\n >\n {badge && (\n <div\n className={classes.badge}\n style={{ backgroundColor: getColor(badge, \"positive\") }}\n />\n )}\n <MuiAvatar\n component={component}\n // Consider not using the root and className classes in this component\n className={cx(classes.root, classes.avatar, classes[size], className)}\n style={inlineStyle}\n variant={variant}\n size={size}\n {...avatarProps}\n >\n {children}\n </MuiAvatar>\n </div>\n );\n});\n"],"names":["HvAvatar"],"mappings":";;;;;;;;;;AAcA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G7B,MAAI,CAAC,kBAAkB;AACT,gBAAA,kBAAkB,SAAS,iBAAiB,MAAM;AAClD,gBAAA,QAAQ,SAAS,OAAO,YAAY;AAAA,EAAA;AAGlD,QAAM,oBAAyC,CAAC;AAChD,MAAI,QAAQ;AAGJ,UAAA,cAAc,SAAS,QAAQ,UAAU;AAC7B,sBAAA,YAAY,yBAAyB,WAAW;AAAA,EAAA;AAIlE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,QAAQ,WAAW,QAAQ,QAAQ,QAAQ,OAAO,CAAC;AAAA,MACjE,OAAO;AAAA,MACN,GAAG;AAAA,MAEH,UAAA;AAAA,QACC,SAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,QAAQ;AAAA,YACnB,OAAO,EAAE,iBAAiB,SAAS,OAAO,UAAU,EAAE;AAAA,UAAA;AAAA,QACxD;AAAA,QAEF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YAEA,WAAW,GAAG,QAAQ,MAAM,QAAQ,QAAQ,QAAQ,IAAI,GAAG,SAAS;AAAA,YACpE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACC,GAAG;AAAA,YAEH;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}
@@ -1,20 +1,10 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
+ import { theme } from "@hitachivantara/uikit-styles";
2
3
  import { outlineStyles } from "../utils/focusUtils.js";
3
- const EXTRA_SMALL = { container: "32px", avatar: "24px" };
4
- const SMALL = { container: "40px", avatar: "32px" };
5
- const MEDIUM = { container: "48px", avatar: "40px" };
6
- const LARGE = { container: "60px", avatar: "52px" };
7
- const EXTRA_LARGE = { container: "96px", avatar: "88px" };
8
4
  const { staticClasses, useClasses } = createClasses("HvAvatar", {
9
5
  root: {
10
6
  fontSize: "1rem"
11
7
  },
12
- container: {
13
- "&:focus-visible": {
14
- ...outlineStyles,
15
- borderRadius: 0
16
- }
17
- },
18
8
  img: {
19
9
  width: "100%",
20
10
  height: "100%",
@@ -27,47 +17,34 @@ const { staticClasses, useClasses } = createClasses("HvAvatar", {
27
17
  textIndent: 1e4
28
18
  },
29
19
  fallback: {},
30
- status: {
20
+ /** @deprecated use `classes.container` instead */
21
+ status: {},
22
+ container: {
31
23
  display: "flex",
32
24
  alignItems: "center",
33
- justifyContent: "center",
34
25
  position: "relative",
35
- "&$xs": { width: EXTRA_SMALL.container, height: EXTRA_SMALL.container },
36
- "&$sm": { width: SMALL.container, height: SMALL.container },
37
- "&$md": { width: MEDIUM.container, height: MEDIUM.container },
38
- "&$lg": { width: LARGE.container, height: LARGE.container },
39
- "&$xl": { width: EXTRA_LARGE.container, height: EXTRA_LARGE.container }
40
- },
41
- avatar: {
42
- "&$xs": {
43
- width: EXTRA_SMALL.avatar,
44
- height: EXTRA_SMALL.avatar,
45
- fontSize: "0.5rem"
46
- },
47
- "&$sm": { width: SMALL.avatar, height: SMALL.avatar, fontSize: "0.625rem" },
48
- "&$md": { width: MEDIUM.avatar, height: MEDIUM.avatar, fontSize: "1rem" },
49
- "&$lg": { width: LARGE.avatar, height: LARGE.avatar, fontSize: "1.5rem" },
50
- "&$xl": {
51
- width: EXTRA_LARGE.avatar,
52
- height: EXTRA_LARGE.avatar,
53
- fontSize: "2rem"
26
+ padding: theme.space.xxs,
27
+ ":focus-visible": {
28
+ ...outlineStyles,
29
+ borderRadius: 0
54
30
  }
55
31
  },
32
+ xs: { width: 24, height: 24, fontSize: "0.5rem" },
33
+ sm: { width: 32, height: 32, fontSize: "0.625rem" },
34
+ md: { width: 40, height: 40, fontSize: "1rem" },
35
+ lg: { width: 52, height: 52, fontSize: "1.5rem" },
36
+ xl: { width: 88, height: 88, fontSize: "2rem" },
37
+ avatar: {},
56
38
  badge: {
57
39
  width: 8,
58
40
  height: 8,
59
41
  position: "absolute",
60
42
  top: 0,
61
43
  right: 0,
62
- borderRadius: "50%",
44
+ borderRadius: theme.radii.full,
63
45
  zIndex: 1
64
46
  },
65
- xs: {},
66
- sm: {},
67
- md: {},
68
- lg: {},
69
- xl: {},
70
- circular: { borderRadius: "50%" },
47
+ circular: { borderRadius: theme.radii.full },
71
48
  square: {}
72
49
  });
73
50
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.styles.js","sources":["../../../src/Avatar/Avatar.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nconst EXTRA_SMALL = { container: \"32px\", avatar: \"24px\" };\nconst SMALL = { container: \"40px\", avatar: \"32px\" };\nconst MEDIUM = { container: \"48px\", avatar: \"40px\" };\nconst LARGE = { container: \"60px\", avatar: \"52px\" };\nconst EXTRA_LARGE = { container: \"96px\", avatar: \"88px\" };\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAvatar\", {\n root: {\n fontSize: \"1rem\",\n },\n container: {\n \"&:focus-visible\": {\n ...outlineStyles,\n borderRadius: 0,\n },\n },\n img: {\n width: \"100%\",\n height: \"100%\",\n textAlign: \"center\",\n // Handle non-square image. The property isn't supported by IE 11.\n objectFit: \"cover\",\n // Hide alt text.\n color: \"transparent\",\n // Hide the image broken icon, only works on Chrome.\n textIndent: 10000,\n },\n fallback: {},\n status: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n position: \"relative\",\n\n \"&$xs\": { width: EXTRA_SMALL.container, height: EXTRA_SMALL.container },\n \"&$sm\": { width: SMALL.container, height: SMALL.container },\n \"&$md\": { width: MEDIUM.container, height: MEDIUM.container },\n \"&$lg\": { width: LARGE.container, height: LARGE.container },\n \"&$xl\": { width: EXTRA_LARGE.container, height: EXTRA_LARGE.container },\n },\n avatar: {\n \"&$xs\": {\n width: EXTRA_SMALL.avatar,\n height: EXTRA_SMALL.avatar,\n fontSize: \"0.5rem\",\n },\n \"&$sm\": { width: SMALL.avatar, height: SMALL.avatar, fontSize: \"0.625rem\" },\n \"&$md\": { width: MEDIUM.avatar, height: MEDIUM.avatar, fontSize: \"1rem\" },\n \"&$lg\": { width: LARGE.avatar, height: LARGE.avatar, fontSize: \"1.5rem\" },\n \"&$xl\": {\n width: EXTRA_LARGE.avatar,\n height: EXTRA_LARGE.avatar,\n fontSize: \"2rem\",\n },\n },\n badge: {\n width: 8,\n height: 8,\n position: \"absolute\",\n top: 0,\n right: 0,\n borderRadius: \"50%\",\n zIndex: 1,\n },\n xs: {},\n sm: {},\n md: {},\n lg: {},\n xl: {},\n circular: { borderRadius: \"50%\" },\n square: {},\n});\n"],"names":[],"mappings":";;AAIA,MAAM,cAAc,EAAE,WAAW,QAAQ,QAAQ,OAAO;AACxD,MAAM,QAAQ,EAAE,WAAW,QAAQ,QAAQ,OAAO;AAClD,MAAM,SAAS,EAAE,WAAW,QAAQ,QAAQ,OAAO;AACnD,MAAM,QAAQ,EAAE,WAAW,QAAQ,QAAQ,OAAO;AAClD,MAAM,cAAc,EAAE,WAAW,QAAQ,QAAQ,OAAO;AAEjD,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,WAAW;AAAA,IACT,mBAAmB;AAAA,MACjB,GAAG;AAAA,MACH,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA;AAAA,IAEX,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAEP,YAAY;AAAA,EACd;AAAA,EACA,UAAU,CAAC;AAAA,EACX,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,UAAU;AAAA,IAEV,QAAQ,EAAE,OAAO,YAAY,WAAW,QAAQ,YAAY,UAAU;AAAA,IACtE,QAAQ,EAAE,OAAO,MAAM,WAAW,QAAQ,MAAM,UAAU;AAAA,IAC1D,QAAQ,EAAE,OAAO,OAAO,WAAW,QAAQ,OAAO,UAAU;AAAA,IAC5D,QAAQ,EAAE,OAAO,MAAM,WAAW,QAAQ,MAAM,UAAU;AAAA,IAC1D,QAAQ,EAAE,OAAO,YAAY,WAAW,QAAQ,YAAY,UAAU;AAAA,EACxE;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,MACN,OAAO,YAAY;AAAA,MACnB,QAAQ,YAAY;AAAA,MACpB,UAAU;AAAA,IACZ;AAAA,IACA,QAAQ,EAAE,OAAO,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,WAAW;AAAA,IAC1E,QAAQ,EAAE,OAAO,OAAO,QAAQ,QAAQ,OAAO,QAAQ,UAAU,OAAO;AAAA,IACxE,QAAQ,EAAE,OAAO,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,SAAS;AAAA,IACxE,QAAQ;AAAA,MACN,OAAO,YAAY;AAAA,MACnB,QAAQ,YAAY;AAAA,MACpB,UAAU;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IACd,QAAQ;AAAA,EACV;AAAA,EACA,IAAI,CAAC;AAAA,EACL,IAAI,CAAC;AAAA,EACL,IAAI,CAAC;AAAA,EACL,IAAI,CAAC;AAAA,EACL,IAAI,CAAC;AAAA,EACL,UAAU,EAAE,cAAc,MAAM;AAAA,EAChC,QAAQ,CAAA;AACV,CAAC;"}
1
+ {"version":3,"file":"Avatar.styles.js","sources":["../../../src/Avatar/Avatar.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(\"HvAvatar\", {\n root: {\n fontSize: \"1rem\",\n },\n img: {\n width: \"100%\",\n height: \"100%\",\n textAlign: \"center\",\n // Handle non-square image. The property isn't supported by IE 11.\n objectFit: \"cover\",\n // Hide alt text.\n color: \"transparent\",\n // Hide the image broken icon, only works on Chrome.\n textIndent: 10000,\n },\n fallback: {},\n /** @deprecated use `classes.container` instead */\n status: {},\n container: {\n display: \"flex\",\n alignItems: \"center\",\n position: \"relative\",\n padding: theme.space.xxs,\n\n \":focus-visible\": {\n ...outlineStyles,\n borderRadius: 0,\n },\n },\n xs: { width: 24, height: 24, fontSize: \"0.5rem\" },\n sm: { width: 32, height: 32, fontSize: \"0.625rem\" },\n md: { width: 40, height: 40, fontSize: \"1rem\" },\n lg: { width: 52, height: 52, fontSize: \"1.5rem\" },\n xl: { width: 88, height: 88, fontSize: \"2rem\" },\n avatar: {},\n badge: {\n width: 8,\n height: 8,\n position: \"absolute\",\n top: 0,\n right: 0,\n borderRadius: theme.radii.full,\n zIndex: 1,\n },\n circular: { borderRadius: theme.radii.full },\n square: {},\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA;AAAA,IAEX,WAAW;AAAA;AAAA,IAEX,OAAO;AAAA;AAAA,IAEP,YAAY;AAAA,EACd;AAAA,EACA,UAAU,CAAC;AAAA;AAAA,EAEX,QAAQ,CAAC;AAAA,EACT,WAAW;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS,MAAM,MAAM;AAAA,IAErB,kBAAkB;AAAA,MAChB,GAAG;AAAA,MACH,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA,EACA,IAAI,EAAE,OAAO,IAAI,QAAQ,IAAI,UAAU,SAAS;AAAA,EAChD,IAAI,EAAE,OAAO,IAAI,QAAQ,IAAI,UAAU,WAAW;AAAA,EAClD,IAAI,EAAE,OAAO,IAAI,QAAQ,IAAI,UAAU,OAAO;AAAA,EAC9C,IAAI,EAAE,OAAO,IAAI,QAAQ,IAAI,UAAU,SAAS;AAAA,EAChD,IAAI,EAAE,OAAO,IAAI,QAAQ,IAAI,UAAU,OAAO;AAAA,EAC9C,QAAQ,CAAC;AAAA,EACT,OAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc,MAAM,MAAM;AAAA,IAC1B,QAAQ;AAAA,EACV;AAAA,EACA,UAAU,EAAE,cAAc,MAAM,MAAM,KAAK;AAAA,EAC3C,QAAQ,CAAA;AACV,CAAC;"}
@@ -60,7 +60,7 @@ const Overflow = ({
60
60
  HvAvatar,
61
61
  {
62
62
  size,
63
- backgroundColor: theme.colors.atmo4,
63
+ backgroundColor: theme.colors.border,
64
64
  classes: {
65
65
  avatar: css({
66
66
  [`&.HvAvatar-${size}`]: {
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarGroup.js","sources":["../../../src/AvatarGroup/AvatarGroup.tsx"],"sourcesContent":["import { Children, forwardRef } from \"react\";\nimport {\n mergeStyles,\n useCss,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { HvSize, theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvAvatar } from \"../Avatar/Avatar\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./AvatarGroup.styles\";\nimport { HvAvatarGroupProvider } from \"./AvatarGroupContext\";\n\nexport { staticClasses as avatarGroupClasses };\n\nexport type HvAvatarGroupClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAvatarGroupProps extends HvBaseProps {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarGroupClasses;\n /** The avatar size. */\n size?: HvSize;\n /** The spacing between avatars. */\n spacing?: \"compact\" | \"loose\";\n /** The direction of the group. */\n direction?: \"row\" | \"column\";\n /** Whether the avatars display behind the previous avatar or on top. */\n toBack?: boolean;\n /**\n * The maximum number of visible avatars. If there are more avatars then the value of this property, an added avatar will\n * be added to the end of the list, indicating the number of hidden avatars.\n */\n maxVisible?: number;\n /**\n * What to show as an overflow representation.\n * If `undefined` a default `HvAvatar` will be displayed along with a HvTooltip with the count of overflowing items.\n * */\n overflowComponent?: (overflowCount: number) => React.ReactNode;\n /**\n * If `true` the avatars will be brought to the front when hovered.\n */\n highlight?: boolean;\n}\n\nconst getSpacingValue = (\n spacing: HvAvatarGroupProps[\"spacing\"],\n size: HvAvatarGroupProps[\"size\"],\n) => {\n switch (size) {\n case \"xs\":\n return spacing === \"compact\" ? 24 : 16;\n case \"sm\":\n return spacing === \"compact\" ? 30 : 18;\n case \"md\":\n return spacing === \"compact\" ? 36 : 20;\n case \"lg\":\n return spacing === \"compact\" ? 44 : 24;\n case \"xl\":\n return spacing === \"compact\" ? 72 : 34;\n default:\n return spacing === \"compact\" ? 30 : 18;\n }\n};\n\nconst getFontSize = (size: HvAvatarGroupProps[\"size\"]) => {\n switch (size) {\n case \"xs\":\n return \"1em\";\n case \"sm\":\n return \"1.25em\";\n case \"md\":\n return \"1.5em\";\n case \"lg\":\n return \"1.75em\";\n case \"xl\":\n return \"3em\";\n default:\n return \"1em\";\n }\n};\n\ninterface OverflowProps {\n direction: HvAvatarGroupProps[\"direction\"];\n childrenToShow: React.ReactNode[];\n spacingValue: number;\n overflowComponent?: (n: number) => React.ReactNode;\n totalChildren: number;\n maxVisible: number;\n size: HvAvatarGroupProps[\"size\"];\n}\n\nconst Overflow = ({\n direction,\n childrenToShow,\n spacingValue,\n overflowComponent,\n totalChildren,\n maxVisible,\n size,\n}: OverflowProps) => {\n const { css } = useCss();\n\n return (\n <div\n style={{\n marginLeft:\n direction === \"row\" && childrenToShow.length > 0 ? -spacingValue : 0,\n marginTop:\n direction === \"column\" && childrenToShow.length > 0\n ? -spacingValue\n : 0,\n zIndex: 0,\n }}\n >\n {overflowComponent ? (\n overflowComponent(totalChildren - maxVisible)\n ) : (\n <HvAvatar\n size={size}\n backgroundColor={theme.colors.atmo4}\n classes={{\n avatar: css({\n [`&.HvAvatar-${size}`]: {\n fontSize: getFontSize(size),\n },\n }),\n }}\n >\n +{totalChildren - maxVisible}\n </HvAvatar>\n )}\n </div>\n );\n};\n\n/**\n * The AvatarGroup component is used to group multiple avatars.\n */\nexport const HvAvatarGroup = forwardRef<HTMLDivElement, HvAvatarGroupProps>(\n function HvAvatarGroup(props, ref) {\n const {\n className,\n style,\n classes: classesProp,\n children,\n size = \"sm\",\n spacing = \"loose\",\n direction = \"row\",\n maxVisible = 3,\n overflowComponent,\n highlight = false,\n toBack = false,\n ...others\n } = useDefaultProps(\"HvAvatarGroup\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const spacingValue = getSpacingValue(spacing, size);\n\n const totalChildren = Children.count(children);\n const willOverflow = totalChildren > maxVisible;\n\n const childrenToShow = Children.toArray(children).slice(0, maxVisible);\n\n // Since the `HvAvatar` components are displayed in reverse order using `row-reverse`, we need to reverse the array.\n if (toBack) childrenToShow.reverse();\n\n return (\n <div\n className={cx(\n classes.root,\n classes[direction],\n {\n [classes.highlight]: highlight,\n [classes.toBack]: toBack,\n },\n className,\n )}\n style={mergeStyles(style, {\n \"--spacing\": `-${spacingValue}px`,\n })}\n ref={ref}\n {...others}\n >\n <HvAvatarGroupProvider size={size}>\n {toBack && willOverflow && (\n <Overflow\n childrenToShow={childrenToShow}\n direction={direction}\n maxVisible={maxVisible}\n overflowComponent={overflowComponent}\n size={size}\n spacingValue={spacingValue}\n totalChildren={totalChildren}\n />\n )}\n {childrenToShow}\n {!toBack && willOverflow && (\n <Overflow\n childrenToShow={childrenToShow}\n direction={direction}\n maxVisible={maxVisible}\n overflowComponent={overflowComponent}\n size={size}\n spacingValue={spacingValue}\n totalChildren={totalChildren}\n />\n )}\n </HvAvatarGroupProvider>\n </div>\n );\n },\n);\n"],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,YAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAEJ,CAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"AvatarGroup.js","sources":["../../../src/AvatarGroup/AvatarGroup.tsx"],"sourcesContent":["import { Children, forwardRef } from \"react\";\nimport {\n mergeStyles,\n useCss,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { HvSize, theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvAvatar } from \"../Avatar/Avatar\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./AvatarGroup.styles\";\nimport { HvAvatarGroupProvider } from \"./AvatarGroupContext\";\n\nexport { staticClasses as avatarGroupClasses };\n\nexport type HvAvatarGroupClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAvatarGroupProps extends HvBaseProps {\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvAvatarGroupClasses;\n /** The avatar size. */\n size?: HvSize;\n /** The spacing between avatars. */\n spacing?: \"compact\" | \"loose\";\n /** The direction of the group. */\n direction?: \"row\" | \"column\";\n /** Whether the avatars display behind the previous avatar or on top. */\n toBack?: boolean;\n /**\n * The maximum number of visible avatars. If there are more avatars then the value of this property, an added avatar will\n * be added to the end of the list, indicating the number of hidden avatars.\n */\n maxVisible?: number;\n /**\n * What to show as an overflow representation.\n * If `undefined` a default `HvAvatar` will be displayed along with a HvTooltip with the count of overflowing items.\n * */\n overflowComponent?: (overflowCount: number) => React.ReactNode;\n /**\n * If `true` the avatars will be brought to the front when hovered.\n */\n highlight?: boolean;\n}\n\nconst getSpacingValue = (\n spacing: HvAvatarGroupProps[\"spacing\"],\n size: HvAvatarGroupProps[\"size\"],\n) => {\n switch (size) {\n case \"xs\":\n return spacing === \"compact\" ? 24 : 16;\n case \"sm\":\n return spacing === \"compact\" ? 30 : 18;\n case \"md\":\n return spacing === \"compact\" ? 36 : 20;\n case \"lg\":\n return spacing === \"compact\" ? 44 : 24;\n case \"xl\":\n return spacing === \"compact\" ? 72 : 34;\n default:\n return spacing === \"compact\" ? 30 : 18;\n }\n};\n\nconst getFontSize = (size: HvAvatarGroupProps[\"size\"]) => {\n switch (size) {\n case \"xs\":\n return \"1em\";\n case \"sm\":\n return \"1.25em\";\n case \"md\":\n return \"1.5em\";\n case \"lg\":\n return \"1.75em\";\n case \"xl\":\n return \"3em\";\n default:\n return \"1em\";\n }\n};\n\ninterface OverflowProps {\n direction: HvAvatarGroupProps[\"direction\"];\n childrenToShow: React.ReactNode[];\n spacingValue: number;\n overflowComponent?: (n: number) => React.ReactNode;\n totalChildren: number;\n maxVisible: number;\n size: HvAvatarGroupProps[\"size\"];\n}\n\nconst Overflow = ({\n direction,\n childrenToShow,\n spacingValue,\n overflowComponent,\n totalChildren,\n maxVisible,\n size,\n}: OverflowProps) => {\n const { css } = useCss();\n\n return (\n <div\n style={{\n marginLeft:\n direction === \"row\" && childrenToShow.length > 0 ? -spacingValue : 0,\n marginTop:\n direction === \"column\" && childrenToShow.length > 0\n ? -spacingValue\n : 0,\n zIndex: 0,\n }}\n >\n {overflowComponent ? (\n overflowComponent(totalChildren - maxVisible)\n ) : (\n <HvAvatar\n size={size}\n backgroundColor={theme.colors.border}\n classes={{\n avatar: css({\n [`&.HvAvatar-${size}`]: {\n fontSize: getFontSize(size),\n },\n }),\n }}\n >\n +{totalChildren - maxVisible}\n </HvAvatar>\n )}\n </div>\n );\n};\n\n/**\n * The AvatarGroup component is used to group multiple avatars.\n */\nexport const HvAvatarGroup = forwardRef<HTMLDivElement, HvAvatarGroupProps>(\n function HvAvatarGroup(props, ref) {\n const {\n className,\n style,\n classes: classesProp,\n children,\n size = \"sm\",\n spacing = \"loose\",\n direction = \"row\",\n maxVisible = 3,\n overflowComponent,\n highlight = false,\n toBack = false,\n ...others\n } = useDefaultProps(\"HvAvatarGroup\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const spacingValue = getSpacingValue(spacing, size);\n\n const totalChildren = Children.count(children);\n const willOverflow = totalChildren > maxVisible;\n\n const childrenToShow = Children.toArray(children).slice(0, maxVisible);\n\n // Since the `HvAvatar` components are displayed in reverse order using `row-reverse`, we need to reverse the array.\n if (toBack) childrenToShow.reverse();\n\n return (\n <div\n className={cx(\n classes.root,\n classes[direction],\n {\n [classes.highlight]: highlight,\n [classes.toBack]: toBack,\n },\n className,\n )}\n style={mergeStyles(style, {\n \"--spacing\": `-${spacingValue}px`,\n })}\n ref={ref}\n {...others}\n >\n <HvAvatarGroupProvider size={size}>\n {toBack && willOverflow && (\n <Overflow\n childrenToShow={childrenToShow}\n direction={direction}\n maxVisible={maxVisible}\n overflowComponent={overflowComponent}\n size={size}\n spacingValue={spacingValue}\n totalChildren={totalChildren}\n />\n )}\n {childrenToShow}\n {!toBack && willOverflow && (\n <Overflow\n childrenToShow={childrenToShow}\n direction={direction}\n maxVisible={maxVisible}\n overflowComponent={overflowComponent}\n size={size}\n spacingValue={spacingValue}\n totalChildren={totalChildren}\n />\n )}\n </HvAvatarGroupProvider>\n </div>\n );\n },\n);\n"],"names":["HvAvatarGroup"],"mappings":";;;;;;;;AA6CA,MAAM,kBAAkB,CACtB,SACA,SACG;AACH,UAAQ,MAAM;AAAA,IACZ,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC,KAAK;AACI,aAAA,YAAY,YAAY,KAAK;AAAA,IACtC;AACS,aAAA,YAAY,YAAY,KAAK;AAAA,EAAA;AAE1C;AAEA,MAAM,cAAc,CAAC,SAAqC;AACxD,UAAQ,MAAM;AAAA,IACZ,KAAK;AACI,aAAA;AAAA,IACT,KAA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gBAAgB,SAAS,IAAI;AAE5C,UAAA,gBAAgB,SAAS,MAAM,QAAQ;AAC7C,UAAM,eAAe,gBAAgB;AAErC,UAAM,iBAAiB,SAAS,QAAQ,QAAQ,EAAE,MAAM,GAAG,UAAU;AAGjE,QAAA,uBAAuB,QAAQ;AAGjC,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,SAAS;AAAA,UACjB;AAAA,YACE,CAAC,QAAQ,SAAS,GAAG;AAAA,YACrB,CAAC,QAAQ,MAAM,GAAG;AAAA,UACpB;AAAA,UACA;AAAA,QACF;AAAA,QACA,OAAO,YAAY,OAAO;AAAA,UACxB,aAAa,IAAI,YAAY;AAAA,QAAA,CAC9B;AAAA,QACD;AAAA,QACC,GAAG;AAAA,QAEJ,UAAA,qBAAC,yBAAsB,MACpB,UAAA;AAAA,UAAA,UAAU,gBACT;AAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UACF;AAAA,UAED;AAAA,UACA,CAAC,UAAU,gBACV;AAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAEJ,CAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -6,65 +6,58 @@ const { staticClasses, useClasses } = createClasses("HvAvatarGroup", {
6
6
  root: {
7
7
  display: "flex",
8
8
  [`& .${staticClasses$1.root}`]: {
9
- border: `2px solid ${theme.colors.atmo2}`,
9
+ border: `2px solid ${theme.colors.bgPage}`,
10
10
  boxSizing: "content-box"
11
11
  },
12
- "&$row": {
13
- flexDirection: "row",
14
- justifyContent: "flex-start",
12
+ [`& .${staticClasses$1.container}`]: {
13
+ padding: 2
14
+ }
15
+ },
16
+ row: {
17
+ flexDirection: "row",
18
+ justifyContent: "flex-start",
19
+ [`& .${staticClasses$1.container}`]: {
20
+ "&:not(:first-of-type)": {
21
+ marginLeft: "var(--spacing)"
22
+ }
23
+ },
24
+ "&$toBack": {
25
+ flexDirection: "row-reverse",
26
+ justifyContent: "flex-end",
15
27
  [`& .${staticClasses$1.container}`]: {
16
- "&:not(:first-of-type)": {
28
+ "&:last-of-type": {
29
+ marginLeft: 0
30
+ },
31
+ "&:not(:last-of-type)": {
17
32
  marginLeft: "var(--spacing)"
18
33
  }
19
- },
20
- "&$toBack": {
21
- flexDirection: "row-reverse",
22
- justifyContent: "flex-end",
23
- [`& .${staticClasses$1.container}`]: {
24
- "&:last-of-type": {
25
- marginLeft: 0
26
- },
27
- "&:not(:last-of-type)": {
28
- marginLeft: "var(--spacing)"
29
- }
30
- }
34
+ }
35
+ }
36
+ },
37
+ column: {
38
+ flexDirection: "column",
39
+ [`& .${staticClasses$1.container}`]: {
40
+ "&:not(:first-of-type)": {
41
+ marginTop: "var(--spacing)"
31
42
  }
32
43
  },
33
- "&$column": {
34
- flexDirection: "column",
44
+ "&$toBack": {
45
+ flexDirection: "column-reverse",
35
46
  [`& .${staticClasses$1.container}`]: {
36
- "&:not(:first-of-type)": {
47
+ "&:last-of-type": {
48
+ marginTop: 0
49
+ },
50
+ "&:not(:last-of-type)": {
37
51
  marginTop: "var(--spacing)"
38
52
  }
39
- },
40
- "&$toBack": {
41
- flexDirection: "column-reverse",
42
- [`& .${staticClasses$1.container}`]: {
43
- "&:last-of-type": {
44
- marginTop: 0
45
- },
46
- "&:not(:last-of-type)": {
47
- marginTop: "var(--spacing)"
48
- }
49
- }
50
- }
51
- },
52
- [`&$highlight`]: {
53
- [`& .${staticClasses$1.status}:hover`]: {
54
- zIndex: theme.zIndices.popover
55
53
  }
56
54
  }
57
55
  },
58
- row: {
59
- flexDirection: "row",
60
- justifyContent: "flex-start",
61
- "&$toBack": {
62
- flexDirection: "row-reverse",
63
- justifyContent: "flex-end"
56
+ highlight: {
57
+ [`& .${staticClasses$1.container}:hover`]: {
58
+ zIndex: theme.zIndices.popover
64
59
  }
65
60
  },
66
- column: {},
67
- highlight: {},
68
61
  toBack: {}
69
62
  });
70
63
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarGroup.styles.js","sources":["../../../src/AvatarGroup/AvatarGroup.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { avatarClasses } from \"../Avatar/Avatar\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAvatarGroup\", {\n root: {\n display: \"flex\",\n [`& .${avatarClasses.root}`]: {\n border: `2px solid ${theme.colors.atmo2}`,\n boxSizing: \"content-box\",\n },\n \"&$row\": {\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n\n [`& .${avatarClasses.container}`]: {\n \"&:not(:first-of-type)\": {\n marginLeft: \"var(--spacing)\",\n },\n },\n \"&$toBack\": {\n flexDirection: \"row-reverse\",\n justifyContent: \"flex-end\",\n [`& .${avatarClasses.container}`]: {\n \"&:last-of-type\": {\n marginLeft: 0,\n },\n \"&:not(:last-of-type)\": {\n marginLeft: \"var(--spacing)\",\n },\n },\n },\n },\n \"&$column\": {\n flexDirection: \"column\",\n [`& .${avatarClasses.container}`]: {\n \"&:not(:first-of-type)\": {\n marginTop: \"var(--spacing)\",\n },\n },\n \"&$toBack\": {\n flexDirection: \"column-reverse\",\n [`& .${avatarClasses.container}`]: {\n \"&:last-of-type\": {\n marginTop: 0,\n },\n \"&:not(:last-of-type)\": {\n marginTop: \"var(--spacing)\",\n },\n },\n },\n },\n [`&$highlight`]: {\n [`& .${avatarClasses.status}:hover`]: {\n zIndex: theme.zIndices.popover,\n },\n },\n },\n row: {\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n \"&$toBack\": {\n flexDirection: \"row-reverse\",\n justifyContent: \"flex-end\",\n },\n },\n column: {},\n highlight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YAAY;AAAA,MACV,eAAe;AAAA,MACf,gBAAgB;AAAA,IAAA;AAAA,EAEpB;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,WAAW,CAAC;AAAA,EACZ,QAAQ,CAAA;AACV,CAAC;"}
1
+ {"version":3,"file":"AvatarGroup.styles.js","sources":["../../../src/AvatarGroup/AvatarGroup.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { avatarClasses } from \"../Avatar/Avatar\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAvatarGroup\", {\n root: {\n display: \"flex\",\n [`& .${avatarClasses.root}`]: {\n border: `2px solid ${theme.colors.bgPage}`,\n boxSizing: \"content-box\",\n },\n [`& .${avatarClasses.container}`]: {\n padding: 2,\n },\n },\n row: {\n flexDirection: \"row\",\n justifyContent: \"flex-start\",\n [`& .${avatarClasses.container}`]: {\n \"&:not(:first-of-type)\": {\n marginLeft: \"var(--spacing)\",\n },\n },\n \"&$toBack\": {\n flexDirection: \"row-reverse\",\n justifyContent: \"flex-end\",\n [`& .${avatarClasses.container}`]: {\n \"&:last-of-type\": {\n marginLeft: 0,\n },\n \"&:not(:last-of-type)\": {\n marginLeft: \"var(--spacing)\",\n },\n },\n },\n },\n column: {\n flexDirection: \"column\",\n [`& .${avatarClasses.container}`]: {\n \"&:not(:first-of-type)\": {\n marginTop: \"var(--spacing)\",\n },\n },\n \"&$toBack\": {\n flexDirection: \"column-reverse\",\n [`& .${avatarClasses.container}`]: {\n \"&:last-of-type\": {\n marginTop: 0,\n },\n \"&:not(:last-of-type)\": {\n marginTop: \"var(--spacing)\",\n },\n },\n },\n },\n highlight: {\n [`& .${avatarClasses.container}:hover`]: {\n zIndex: theme.zIndices.popover,\n },\n },\n toBack: {},\n});\n"],"names":["avatarClasses"],"mappings":";;;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,CAAC,MAAMA,gBAAc,IAAI,EAAE,GAAG;AAAA,MAC5B,QAAQ,aAAa,MAAM,OAAO,MAAM;AAAA,MACxC,WAAW;AAAA,IACb;AAAA,IACA,CAAC,MAAMA,gBAAc,SAAS,EAAE,GAAG;AAAA,MACjC,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,KAAK;AAAA,IACH,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,CAAC,MAAMA,gBAAc,SAAS,EAAE,GAAG;AAAA,MACjC,yBAAyB;AAAA,QACvB,YAAY;AAAA,MAAA;AAAA,IAEhB;AAAA,IACA,YAAY;AAAA,MACV,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,CAAC,MAAMA,gBAAc,SAAS,EAAE,GAAG;AAAA,QACjC,kBAAkB;AAAA,UAChB,YAAY;AAAA,QACd;AAAA,QACA,wBAAwB;AAAA,UACtB,YAAY;AAAA,QAAA;AAAA,MACd;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,QAAQ;AAAA,IACN,eAAe;AAAA,IACf,CAAC,MAAMA,gBAAc,SAAS,EAAE,GAAG;AAAA,MACjC,yBAAyB;AAAA,QACvB,WAAW;AAAA,MAAA;AAAA,IAEf;AAAA,IACA,YAAY;AAAA,MACV,eAAe;AAAA,MACf,CAAC,MAAMA,gBAAc,SAAS,EAAE,GAAG;AAAA,QACjC,kBAAkB;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA,wBAAwB;AAAA,UACtB,WAAW;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,WAAW;AAAA,IACT,CAAC,MAAMA,gBAAc,SAAS,QAAQ,GAAG;AAAA,MACvC,QAAQ,MAAM,SAAS;AAAA,IAAA;AAAA,EAE3B;AAAA,EACA,QAAQ,CAAA;AACV,CAAC;"}
@@ -26,10 +26,11 @@ const HvBadge = forwardRef(function HvBadge2(props, ref) {
26
26
  const children = childrenProp || icon || text && /* @__PURE__ */ jsx(HvTypography, { variant: textVariant, children: text });
27
27
  return /* @__PURE__ */ jsxs("div", { ref, className: cx(classes.root, className), ...others, children: [
28
28
  children,
29
- /* @__PURE__ */ jsx("div", { className: cx({ [classes.badgeContainer]: children }), children: /* @__PURE__ */ jsx(
29
+ /* @__PURE__ */ jsx(
30
30
  "div",
31
31
  {
32
32
  className: cx(classes.badgePosition, {
33
+ [classes.badgeContainer]: children,
33
34
  [classes.badgeHidden]: !(count > 0 || renderedCountOrLabel),
34
35
  // TODO: remove unnecessary classes in v6 (hoist+rename `badge` to `badgePosition`)
35
36
  [classes.badge]: !!(count > 0 || renderedCountOrLabel),
@@ -40,7 +41,7 @@ const HvBadge = forwardRef(function HvBadge2(props, ref) {
40
41
  }),
41
42
  children: renderedCountOrLabel
42
43
  }
43
- ) })
44
+ )
44
45
  ] });
45
46
  });
46
47
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/Badge/Badge.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 { HvTypography, HvTypographyVariants } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Badge.styles\";\n\nexport { staticClasses as badgeClasses };\n\nexport type HvBadgeClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBadgeProps extends HvBaseProps {\n /**\n * Count is the number of unread notifications.\n * Note count and label are mutually exclusive.\n * count is ignored when label is specified at the same time.\n * @deprecated use numeric `label` instead\n */\n count?: number;\n /**\n * True if `count` should be displayed.\n *\n * NOTE: `showCount` is ignored when a **non-numeric** `label` is specified.\n */\n showCount?: boolean;\n /** The maximum number of unread notifications to be displayed */\n maxCount?: number;\n /**\n * Badge content to show in.\n *\n * If value is numeric, then `showCount` and `maxCount` will show or limit the value respectively.\n */\n label?: React.ReactNode;\n /** Icon which the notification will be attached. */\n icon?: React.ReactNode;\n /** Text which the notification will be attached. @deprecated use `children` instead. */\n text?: string;\n /** Text variant. @deprecated use a `HvTypography` on `children` instead. */\n textVariant?: HvTypographyVariants;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBadgeClasses;\n}\n\n/**\n * The badge is a component used to notify the user that something has occurred, in the app context.\n */\nexport const HvBadge = forwardRef<\n // no-indent\n HTMLDivElement,\n HvBadgeProps\n>(function HvBadge(props, ref) {\n const {\n classes: classesProp,\n className,\n showCount = false,\n count: countProp = 0,\n maxCount = 99,\n label,\n icon,\n text,\n textVariant,\n children: childrenProp,\n ...others\n } = useDefaultProps(\"HvBadge\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const count = typeof label === \"number\" ? label : countProp;\n const countValue = count > maxCount ? `${maxCount}+` : count;\n const renderedCount = showCount && count > 0 ? countValue : \"\";\n // If label is specified and non-empty, render it.\n // If showCount is specified and count > 0, render the count.\n // Otherwise, render nothing on the badge.\n // (Note count=0 should not be rendered to avoid ghosty 0.)\n const renderedCountOrLabel =\n label && typeof label !== \"number\" ? label : renderedCount;\n const children =\n childrenProp ||\n icon ||\n (text && <HvTypography variant={textVariant}>{text}</HvTypography>);\n\n return (\n <div ref={ref} className={cx(classes.root, className)} {...others}>\n {children}\n <div className={cx({ [classes.badgeContainer]: children })}>\n <div\n className={cx(classes.badgePosition, {\n [classes.badgeHidden]: !(count > 0 || renderedCountOrLabel),\n // TODO: remove unnecessary classes in v6 (hoist+rename `badge` to `badgePosition`)\n [classes.badge]: !!(count > 0 || renderedCountOrLabel),\n [classes.showCount]: !!(!label && renderedCountOrLabel),\n [classes.showLabel]: !!label,\n [classes.badgeIcon]: !!icon,\n [classes.badgeOneDigit]: String(renderedCountOrLabel).length === 1,\n })}\n >\n {renderedCountOrLabel}\n </div>\n </div>\n </div>\n );\n});\n"],"names":["HvBadge"],"mappings":";;;;;;AAiDO,MAAM,UAAU,WAIrB,SAASA,SAAQ,OAAO,KAAK;AACvB,QAAA;AAAA,IACJ,SAA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Badge.js","sources":["../../../src/Badge/Badge.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 { HvTypography, HvTypographyVariants } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Badge.styles\";\n\nexport { staticClasses as badgeClasses };\n\nexport type HvBadgeClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBadgeProps extends HvBaseProps {\n /**\n * Count is the number of unread notifications.\n * Note count and label are mutually exclusive.\n * count is ignored when label is specified at the same time.\n * @deprecated use numeric `label` instead\n */\n count?: number;\n /**\n * True if `count` should be displayed.\n *\n * NOTE: `showCount` is ignored when a **non-numeric** `label` is specified.\n */\n showCount?: boolean;\n /** The maximum number of unread notifications to be displayed */\n maxCount?: number;\n /**\n * Badge content to show in.\n *\n * If value is numeric, then `showCount` and `maxCount` will show or limit the value respectively.\n */\n label?: React.ReactNode;\n /** Icon which the notification will be attached. */\n icon?: React.ReactNode;\n /** Text which the notification will be attached. @deprecated use `children` instead. */\n text?: string;\n /** Text variant. @deprecated use a `HvTypography` on `children` instead. */\n textVariant?: HvTypographyVariants;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBadgeClasses;\n}\n\n/**\n * The badge is a component used to notify the user that something has occurred, in the app context.\n */\nexport const HvBadge = forwardRef<\n // no-indent\n HTMLDivElement,\n HvBadgeProps\n>(function HvBadge(props, ref) {\n const {\n classes: classesProp,\n className,\n showCount = false,\n count: countProp = 0,\n maxCount = 99,\n label,\n icon,\n text,\n textVariant,\n children: childrenProp,\n ...others\n } = useDefaultProps(\"HvBadge\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const count = typeof label === \"number\" ? label : countProp;\n const countValue = count > maxCount ? `${maxCount}+` : count;\n const renderedCount = showCount && count > 0 ? countValue : \"\";\n // If label is specified and non-empty, render it.\n // If showCount is specified and count > 0, render the count.\n // Otherwise, render nothing on the badge.\n // (Note count=0 should not be rendered to avoid ghosty 0.)\n const renderedCountOrLabel =\n label && typeof label !== \"number\" ? label : renderedCount;\n const children =\n childrenProp ||\n icon ||\n (text && <HvTypography variant={textVariant}>{text}</HvTypography>);\n\n return (\n <div ref={ref} className={cx(classes.root, className)} {...others}>\n {children}\n <div\n className={cx(classes.badgePosition, {\n [classes.badgeContainer]: children,\n [classes.badgeHidden]: !(count > 0 || renderedCountOrLabel),\n // TODO: remove unnecessary classes in v6 (hoist+rename `badge` to `badgePosition`)\n [classes.badge]: !!(count > 0 || renderedCountOrLabel),\n [classes.showCount]: !!(!label && renderedCountOrLabel),\n [classes.showLabel]: !!label,\n [classes.badgeIcon]: !!icon,\n [classes.badgeOneDigit]: String(renderedCountOrLabel).length === 1,\n })}\n >\n {renderedCountOrLabel}\n </div>\n </div>\n );\n});\n"],"names":["HvBadge"],"mappings":";;;;;;AAiDO,MAAM,UAAU,WAIrB,SAASA,SAAQ,OAAO,KAAK;AACvB,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,YAAY;AAAA,IACZ,OAAO,YAAY;AAAA,IACnB,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,IACD,gBAAgB,WAAW,KAAK;AAEpC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,QAAQ,OAAO,UAAU,WAAW,QAAQ;AAClD,QAAM,aAAa,QAAQ,WAAW,GAAG,QAAQ,MAAM;AACvD,QAAM,gBAAgB,aAAa,QAAQ,IAAI,aAAa;AAK5D,QAAM,uBACJ,SAAS,OAAO,UAAU,WAAW,QAAQ;AACzC,QAAA,WACJ,gBACA,QACC,4BAAS,cAAa,EAAA,SAAS,aAAc,UAAK,KAAA,CAAA;AAGnD,SAAA,qBAAC,OAAI,EAAA,KAAU,WAAW,GAAG,QAAQ,MAAM,SAAS,GAAI,GAAG,QACxD,UAAA;AAAA,IAAA;AAAA,IACD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,GAAG,QAAQ,eAAe;AAAA,UACnC,CAAC,QAAQ,cAAc,GAAG;AAAA,UAC1B,CAAC,QAAQ,WAAW,GAAG,EAAE,QAAQ,KAAK;AAAA;AAAA,UAEtC,CAAC,QAAQ,KAAK,GAAG,CAAC,EAAE,QAAQ,KAAK;AAAA,UACjC,CAAC,QAAQ,SAAS,GAAG,CAAC,EAAE,CAAC,SAAS;AAAA,UAClC,CAAC,QAAQ,SAAS,GAAG,CAAC,CAAC;AAAA,UACvB,CAAC,QAAQ,SAAS,GAAG,CAAC,CAAC;AAAA,UACvB,CAAC,QAAQ,aAAa,GAAG,OAAO,oBAAoB,EAAE,WAAW;AAAA,QAAA,CAClE;AAAA,QAEA,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ,CAAC;"}
@@ -3,13 +3,16 @@ import { theme } from "@hitachivantara/uikit-styles";
3
3
  const { staticClasses, useClasses } = createClasses("HvBadge", {
4
4
  root: { position: "relative", "&>*": { float: "left" } },
5
5
  /** class applied to the badge container when it has content */
6
- badgeContainer: { width: 0 },
6
+ badgeContainer: {},
7
7
  /** class applied to the badge */
8
8
  badgePosition: {
9
+ // TODO: change to relative so that badges don't overflow into the siblings
10
+ position: "absolute",
11
+ left: "100%",
9
12
  ...theme.typography.caption2,
10
- color: theme.colors.atmo1,
13
+ color: theme.colors.textDimmed,
11
14
  borderRadius: theme.radii.full,
12
- backgroundColor: theme.colors.secondary,
15
+ backgroundColor: theme.colors.text,
13
16
  lineHeight: "16px",
14
17
  minWidth: 8,
15
18
  padding: "0 5px",
@@ -30,7 +33,7 @@ const { staticClasses, useClasses } = createClasses("HvBadge", {
30
33
  },
31
34
  showCount: {},
32
35
  showLabel: {},
33
- badgeIcon: { position: "relative", top: "1px", left: "-7px" },
36
+ badgeIcon: { top: "1px", left: "calc(100% - 7px)" },
34
37
  badgeOneDigit: { padding: 0, width: "16px" }
35
38
  });
36
39
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.styles.js","sources":["../../../src/Badge/Badge.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBadge\", {\n root: { position: \"relative\", \"&>*\": { float: \"left\" } },\n /** class applied to the badge container when it has content */\n badgeContainer: { width: 0 },\n /** class applied to the badge */\n badgePosition: {\n ...theme.typography.caption2,\n color: theme.colors.atmo1,\n borderRadius: theme.radii.full,\n backgroundColor: theme.colors.secondary,\n lineHeight: \"16px\",\n minWidth: 8,\n padding: \"0 5px\",\n float: \"left\",\n wordBreak: \"keep-all\",\n textAlign: \"center\",\n\n \":empty\": {\n height: 8,\n width: 8,\n padding: 0,\n },\n },\n /** applied to the badge when it's visible */\n badge: {},\n /** applied to the badge when it's hidden */\n badgeHidden: {\n display: \"none\",\n },\n showCount: {},\n showLabel: {},\n badgeIcon: { position: \"relative\", top: \"1px\", left: \"-7px\" },\n badgeOneDigit: { padding: 0, width: \"16px\" },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,WAAW;AAAA,EACpE,MAAM,EAAE,UAAU,YAAY,OAAO,EAAE,OAAO,SAAS;AAAA;AAAA,EAEvD,gBAAgB,EAAE,OAAO,EAAE;AAAA;AAAA,EAE3B,eAAe;AAAA,IACb,GAAG,MAAM,WAAW;AAAA,IACpB,OAAO,MAAM,OAAO;AAAA,IACpB,cAAc,MAAM,MAAM;AAAA,IAC1B,iBAAiB,MAAM,OAAO;AAAA,IAC9B,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IAEX,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA;AAAA,EAEA,OAAO,CAAC;AAAA;AAAA,EAER,aAAa;AAAA,IACX,SAAS;AAAA,EACX;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW,CAAC;AAAA,EACZ,WAAW,EAAE,UAAU,YAAY,KAAK,OAAO,MAAM,OAAO;AAAA,EAC5D,eAAe,EAAE,SAAS,GAAG,OAAO,OAAO;AAC7C,CAAC;"}
1
+ {"version":3,"file":"Badge.styles.js","sources":["../../../src/Badge/Badge.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBadge\", {\n root: { position: \"relative\", \"&>*\": { float: \"left\" } },\n /** class applied to the badge container when it has content */\n badgeContainer: {},\n /** class applied to the badge */\n badgePosition: {\n // TODO: change to relative so that badges don't overflow into the siblings\n position: \"absolute\",\n left: \"100%\",\n ...theme.typography.caption2,\n color: theme.colors.textDimmed,\n borderRadius: theme.radii.full,\n backgroundColor: theme.colors.text,\n lineHeight: \"16px\",\n minWidth: 8,\n padding: \"0 5px\",\n float: \"left\",\n wordBreak: \"keep-all\",\n textAlign: \"center\",\n\n \":empty\": {\n height: 8,\n width: 8,\n padding: 0,\n },\n },\n /** applied to the badge when it's visible */\n badge: {},\n /** applied to the badge when it's hidden */\n badgeHidden: {\n display: \"none\",\n },\n showCount: {},\n showLabel: {},\n badgeIcon: { top: \"1px\", left: \"calc(100% - 7px)\" },\n badgeOneDigit: { padding: 0, width: \"16px\" },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,WAAW;AAAA,EACpE,MAAM,EAAE,UAAU,YAAY,OAAO,EAAE,OAAO,SAAS;AAAA;AAAA,EAEvD,gBAAgB,CAAC;AAAA;AAAA,EAEjB,eAAe;AAAA;AAAA,IAEb,UAAU;AAAA,IACV,MAAM;AAAA,IACN,GAAG,MAAM,WAAW;AAAA,IACpB,OAAO,MAAM,OAAO;AAAA,IACpB,cAAc,MAAM,MAAM;AAAA,IAC1B,iBAAiB,MAAM,OAAO;AAAA,IAC9B,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IAEX,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA;AAAA,EAEA,OAAO,CAAC;AAAA;AAAA,EAER,aAAa;AAAA,IACX,SAAS;AAAA,EACX;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,WAAW,CAAC;AAAA,EACZ,WAAW,EAAE,KAAK,OAAO,MAAM,mBAAmB;AAAA,EAClD,eAAe,EAAE,SAAS,GAAG,OAAO,OAAO;AAC7C,CAAC;"}
@@ -12,6 +12,7 @@ const HvBanner = forwardRef(function HvBanner2(props, ref) {
12
12
  id,
13
13
  classes: classesProp,
14
14
  className,
15
+ title,
15
16
  open,
16
17
  onClose,
17
18
  anchorOrigin = "top",
@@ -68,6 +69,7 @@ const HvBanner = forwardRef(function HvBanner2(props, ref) {
68
69
  HvBannerContent,
69
70
  {
70
71
  id: setId(id, "content"),
72
+ title,
71
73
  variant,
72
74
  customIcon,
73
75
  showIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","sources":["../../../src/Banner/Banner.tsx"],"sourcesContent":["import { forwardRef, useCallback } from \"react\";\nimport Slide, { SlideProps } from \"@mui/material/Slide\";\nimport Snackbar, {\n SnackbarProps as MuiSnackbarProps,\n SnackbarOrigin,\n} from \"@mui/material/Snackbar\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGenericProps } from \"../ActionsGeneric\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Banner.styles\";\nimport {\n HvBannerContent,\n HvBannerContentProps,\n} from \"./BannerContent/BannerContent\";\nimport { HvBannerActionPosition, HvBannerVariant } from \"./types\";\n\nexport { staticClasses as bannerClasses };\n\nexport type HvBannerClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerProps\n extends Omit<MuiSnackbarProps, \"anchorOrigin\" | \"classes\" | \"onClose\"> {\n /** If true, the snackbar is open. */\n open: boolean;\n /**\n * Callback fired when the component requests to be closed.\n * Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop.\n * The reason parameter can optionally be used to control the response to onClose, for example ignoring click away.\n * */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** The message to display. */\n label?: string;\n /** The anchor of the Snackbar. */\n anchorOrigin?: \"top\" | \"bottom\";\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Actions to display on the right side. */\n actions?: HvActionsGenericProps[\"actions\"];\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** How much the transition animation last in milliseconds, if 0 no animation is played. */\n transitionDuration?: number;\n /** Direction of slide transition. */\n transitionDirection?: \"up\" | \"down\" | \"left\" | \"right\";\n /** The container the banner should slide from. */\n container?: SlideProps[\"container\"];\n /** Offset from top/bottom of the page, in px. Defaults to 60px. */\n offset?: number;\n /** Props to pass down to the banner Wrapper. An object `actionProps` can be included to be passed as others to actions. */\n bannerContentProps?: HvBannerContentProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerClasses;\n /** @ignore */\n ref?: MuiSnackbarProps[\"ref\"];\n}\n\n/**\n * A Banner displays an important and succinct message. It can also provide actions for the user to address, or dismiss.\n * It requires a user action, for it to be dismissed. Banners should appear at the top of the screen, below a top app bar.\n */\nexport const HvBanner = forwardRef<\n React.ComponentRef<typeof Snackbar>,\n HvBannerProps\n>(function HvBanner(props, ref) {\n const {\n id,\n classes: classesProp,\n className,\n open,\n onClose,\n anchorOrigin = \"top\",\n variant,\n transitionDuration = 300,\n transitionDirection = \"down\",\n container,\n showIcon,\n customIcon,\n actions,\n actionsCallback, // TODO - remove in v6\n onAction,\n actionsPosition,\n label,\n offset = 60,\n bannerContentProps,\n ...others\n } = useDefaultProps(\"HvBanner\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const anchorOriginBanner: SnackbarOrigin = {\n horizontal: \"center\",\n vertical: anchorOrigin,\n };\n\n const SlideTransition = useCallback<\n NonNullable<MuiSnackbarProps[\"TransitionComponent\"]>\n >(\n (properties) => (\n <Slide\n {...properties}\n container={container}\n direction={transitionDirection}\n />\n ),\n [container, transitionDirection],\n );\n\n return (\n <Snackbar\n ref={ref}\n id={id}\n open={open}\n className={className}\n classes={{\n root: cx(classes.root, { [classes.rootClosed]: !open }),\n anchorOriginTopCenter: classes.anchorOriginTopCenter,\n anchorOriginBottomCenter: classes.anchorOriginBottomCenter,\n }}\n style={{ [anchorOrigin]: offset }}\n anchorOrigin={anchorOriginBanner}\n TransitionComponent={SlideTransition}\n transitionDuration={transitionDuration}\n {...others}\n >\n <HvBannerContent\n id={setId(id, \"content\")}\n variant={variant}\n customIcon={customIcon}\n showIcon={showIcon}\n actions={actions}\n actionsCallback={actionsCallback}\n onAction={onAction}\n actionsPosition={actionsPosition}\n onClose={onClose}\n {...bannerContentProps}\n >\n {label}\n </HvBannerContent>\n </Snackbar>\n );\n});\n"],"names":["HvBanner"],"mappings":";;;;;;;;;AA4EO,MAAM,WAAW,WAGtB,SAASA,UAAS,OAAO,KAAK;AACxB,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA,qBAAqB;AAAA,IACrB,sBAAsB;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,qBAAqC;AAAA,IACzC,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAEA,QAAM,kBAAkB;AAAA,IAGtB,CAAC,eACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF,CAAC,WAAW,mBAAmB;AAAA,EACjC;AAGE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP,MAAM,GAAG,QAAQ,MAAM,EAAE,CAAC,QAAQ,UAAU,GAAG,CAAC,MAAM;AAAA,QACtD,uBAAuB,QAAQ;AAAA,QAC/B,0BAA0B,QAAQ;AAAA,MACpC;AAAA,MACA,OAAO,EAAE,CAAC,YAAY,GAAG,OAAO;AAAA,MAChC,cAAc;AAAA,MACd,qBAAqB;AAAA,MACrB;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI,MAAM,IAAI,SAAS;AAAA,UACvB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACC,GAAG;AAAA,UAEH,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Banner.js","sources":["../../../src/Banner/Banner.tsx"],"sourcesContent":["import { forwardRef, useCallback } from \"react\";\nimport Slide, { SlideProps } from \"@mui/material/Slide\";\nimport Snackbar, {\n SnackbarProps as MuiSnackbarProps,\n SnackbarOrigin,\n} from \"@mui/material/Snackbar\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGenericProps } from \"../ActionsGeneric\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Banner.styles\";\nimport {\n HvBannerActionPosition,\n HvBannerContent,\n HvBannerContentProps,\n HvBannerVariant,\n} from \"./BannerContent/BannerContent\";\n\nexport { staticClasses as bannerClasses };\n\nexport type HvBannerClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerProps\n extends Omit<MuiSnackbarProps, \"anchorOrigin\" | \"classes\" | \"onClose\"> {\n /** If true, the snackbar is open. */\n open: boolean;\n /**\n * Callback fired when the component requests to be closed.\n * Typically onClose is used to set state in the parent component, which is used to control the Snackbar open prop.\n * The reason parameter can optionally be used to control the response to onClose, for example ignoring click away.\n * */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** The message to display. */\n label?: string;\n /** The anchor of the Snackbar. */\n anchorOrigin?: \"top\" | \"bottom\";\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Actions to display on the right side. */\n actions?: HvActionsGenericProps[\"actions\"];\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** How much the transition animation last in milliseconds, if 0 no animation is played. */\n transitionDuration?: number;\n /** Direction of slide transition. */\n transitionDirection?: \"up\" | \"down\" | \"left\" | \"right\";\n /** The container the banner should slide from. */\n container?: SlideProps[\"container\"];\n /** Offset from top/bottom of the page, in px. Defaults to 60px. */\n offset?: number;\n /** Props to pass down to the banner Wrapper. An object `actionProps` can be included to be passed as others to actions. */\n bannerContentProps?: HvBannerContentProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerClasses;\n /** @ignore */\n ref?: MuiSnackbarProps[\"ref\"];\n}\n\n/**\n * A Banner displays an important and succinct message. It can also provide actions for the user to address, or dismiss.\n * It requires a user action, for it to be dismissed. Banners should appear at the top of the screen, below a top app bar.\n */\nexport const HvBanner = forwardRef<\n React.ComponentRef<typeof Snackbar>,\n HvBannerProps\n>(function HvBanner(props, ref) {\n const {\n id,\n classes: classesProp,\n className,\n title,\n open,\n onClose,\n anchorOrigin = \"top\",\n variant,\n transitionDuration = 300,\n transitionDirection = \"down\",\n container,\n showIcon,\n customIcon,\n actions,\n actionsCallback, // TODO - remove in v6\n onAction,\n actionsPosition,\n label,\n offset = 60,\n bannerContentProps,\n ...others\n } = useDefaultProps(\"HvBanner\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const anchorOriginBanner: SnackbarOrigin = {\n horizontal: \"center\",\n vertical: anchorOrigin,\n };\n\n const SlideTransition = useCallback<\n NonNullable<MuiSnackbarProps[\"TransitionComponent\"]>\n >(\n (properties) => (\n <Slide\n {...properties}\n container={container}\n direction={transitionDirection}\n />\n ),\n [container, transitionDirection],\n );\n\n return (\n <Snackbar\n ref={ref}\n id={id}\n open={open}\n className={className}\n classes={{\n root: cx(classes.root, { [classes.rootClosed]: !open }),\n anchorOriginTopCenter: classes.anchorOriginTopCenter,\n anchorOriginBottomCenter: classes.anchorOriginBottomCenter,\n }}\n style={{ [anchorOrigin]: offset }}\n anchorOrigin={anchorOriginBanner}\n TransitionComponent={SlideTransition}\n transitionDuration={transitionDuration}\n {...others}\n >\n <HvBannerContent\n id={setId(id, \"content\")}\n title={title}\n variant={variant}\n customIcon={customIcon}\n showIcon={showIcon}\n actions={actions}\n actionsCallback={actionsCallback}\n onAction={onAction}\n actionsPosition={actionsPosition}\n onClose={onClose}\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AA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACC,GAAG;AAAA,UAEH,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BannerContent.js","sources":["../../../../src/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { SnackbarContentProps as MuiSnackbarContentProps } from \"@mui/material/SnackbarContent\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGenericProps } from \"../../ActionsGeneric\";\nimport { HvButtonProps } from \"../../Button\";\nimport { HvCallout } from \"../../utils/Callout\";\nimport { HvBannerActionPosition, HvBannerVariant } from \"../types\";\nimport { staticClasses, useClasses } from \"./BannerContent.styles\";\n\nexport { staticClasses as bannerContentClasses };\n\nexport type HvBannerContentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerContentProps\n extends Omit<MuiSnackbarContentProps, \"variant\" | \"classes\" | \"onClose\"> {\n /** The message to display. @deprecated use `children` instead */\n content?: string;\n /** The message to display. */\n children?: React.ReactNode;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Function called when clicking on the close button. */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Actions to display on the right side. */\n actions?: HvActionsGenericProps[\"actions\"];\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: Partial<HvButtonProps>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n}\n\nexport const HvBannerContent = forwardRef<\n // no-indent\n HTMLDivElement,\n HvBannerContentProps\n>(function HvBannerContent(props, ref) {\n const {\n id,\n classes: classesProp,\n className,\n showIcon,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback, // TODO - remove in v6\n onAction,\n actionsPosition = \"auto\",\n content,\n children,\n actionProps,\n ...others\n } = useDefaultProps(\"HvBannerContent\", props);\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <HvCallout\n ref={ref}\n id={id}\n variant={variant}\n showClose\n showIcon={showIcon}\n customIcon={customIcon}\n classes={{\n root: cx(\n classes.root,\n classes.outContainer,\n classes.baseVariant,\n classes[variant],\n className,\n ),\n message: classes.message,\n action: classes.action,\n messageIcon: classes.iconContainer,\n messageContent: classes.messageContainer,\n actionCustom: classes.messageActions,\n actionContent: cx(\n classes.actionContainer,\n classes.actionsInnerContainer,\n ),\n actionClose: classes.closeAction,\n }}\n actions={actions}\n actionsPosition={actionsPosition}\n actionProps={actionProps}\n onClose={(evt) => onClose?.(evt as React.MouseEvent<any>)}\n onAction={(evt, action) => {\n onAction?.(evt, action);\n actionsCallback?.(evt, id!, action);\n }}\n {...others}\n >\n {children ?? content}\n </HvCallout>\n );\n});\n"],"names":["HvBannerContent"],"mappings":";;;;;;AAiDO,MAAM,kBAAkB,WAI7B,SAASA,iBAAgB,OAAO,KAAK;AAC/B,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,mBAAmB,KAAK;AAC5C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,UACf;AAAA,QACF;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,QAAQ,QAAQ;AAAA,QAChB,aAAa,QAAQ;AAAA,QACrB,gBAAgB,QAAQ;AAAA,QACxB,cAAc,QAAQ;AAAA,QACtB,eAAe;AAAA,UACb,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,aAAa,QAAQ;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,CAAC,QAAQ,UAAU,GAA4B;AAAA,MACxD,UAAU,CAAC,KAAK,WAAW;AACzB,mBAAW,KAAK,MAAM;AACJ,0BAAA,KAAK,IAAK,MAAM;AAAA,MACpC;AAAA,MACC,GAAG;AAAA,MAEH,UAAY,YAAA;AAAA,IAAA;AAAA,EACf;AAEJ,CAAC;"}
1
+ {"version":3,"file":"BannerContent.js","sources":["../../../../src/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { SnackbarContentProps as MuiSnackbarContentProps } from \"@mui/material/SnackbarContent\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGenericProps } from \"../../ActionsGeneric\";\nimport { HvButtonProps } from \"../../Button\";\nimport { HvCallout, HvCalloutVariant } from \"../../utils/Callout\";\nimport { staticClasses, useClasses } from \"./BannerContent.styles\";\n\nexport { staticClasses as bannerContentClasses };\n\nexport type HvBannerVariant = HvCalloutVariant;\n\nexport type HvBannerActionPosition = \"auto\" | \"inline\" | \"bottom-right\";\n\nexport type HvBannerContentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerContentProps\n extends Omit<MuiSnackbarContentProps, \"variant\" | \"classes\" | \"onClose\"> {\n /** The message to display. @deprecated use `children` instead */\n content?: string;\n /** The message to display. */\n children?: React.ReactNode;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Function called when clicking on the close button. */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Actions to display on the right side. */\n actions?: HvActionsGenericProps[\"actions\"];\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: Partial<HvButtonProps>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n}\n\nexport const HvBannerContent = forwardRef<\n // no-indent\n HTMLDivElement,\n HvBannerContentProps\n>(function HvBannerContent(props, ref) {\n const {\n id,\n classes: classesProp,\n className,\n showIcon,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback, // TODO - remove in v6\n onAction,\n actionsPosition = \"auto\",\n content,\n children,\n actionProps,\n ...others\n } = useDefaultProps(\"HvBannerContent\", props);\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <HvCallout\n ref={ref}\n id={id}\n variant={variant}\n showClose\n showIcon={showIcon}\n customIcon={customIcon}\n classes={{\n root: cx(\n classes.root,\n classes.outContainer,\n classes.baseVariant,\n classes[variant],\n className,\n ),\n message: classes.message,\n action: classes.action,\n messageIcon: classes.iconContainer,\n messageContent: classes.messageContainer,\n actionCustom: classes.messageActions,\n actionContent: cx(\n classes.actionContainer,\n classes.actionsInnerContainer,\n ),\n actionClose: classes.closeAction,\n }}\n actions={actions}\n actionsPosition={actionsPosition}\n actionProps={actionProps}\n onClose={(evt) => onClose?.(evt as React.MouseEvent<any>)}\n onAction={(evt, action) => {\n onAction?.(evt, action);\n actionsCallback?.(evt, id!, action);\n }}\n {...others}\n >\n {children ?? content}\n </HvCallout>\n );\n});\n"],"names":["HvBannerContent"],"mappings":";;;;;;AAoDO,MAAM,kBAAkB,WAI7B,SAASA,iBAAgB,OAAO,KAAK;AAC/B,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,mBAAmB,KAAK;AAC5C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,UACf;AAAA,QACF;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,QAAQ,QAAQ;AAAA,QAChB,aAAa,QAAQ;AAAA,QACrB,gBAAgB,QAAQ;AAAA,QACxB,cAAc,QAAQ;AAAA,QACtB,eAAe;AAAA,UACb,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,aAAa,QAAQ;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,CAAC,QAAQ,UAAU,GAA4B;AAAA,MACxD,UAAU,CAAC,KAAK,WAAW;AACzB,mBAAW,KAAK,MAAM;AACJ,0BAAA,KAAK,IAAK,MAAM;AAAA,MACpC;AAAA,MACC,GAAG;AAAA,MAEH,UAAY,YAAA;AAAA,IAAA;AAAA,EACf;AAEJ,CAAC;"}