@pega/cosmos-react-core 4.0.0-dev.1.1 → 4.0.0-dev.10.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 (589) hide show
  1. package/lib/components/Actions/Actions.d.ts.map +1 -1
  2. package/lib/components/Actions/Actions.js +11 -5
  3. package/lib/components/Actions/Actions.js.map +1 -1
  4. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +2 -0
  5. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
  6. package/lib/components/AdditionalInfo/AdditionalInfo.js +24 -15
  7. package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -1
  8. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppHeader.js +4 -3
  10. package/lib/components/AppShell/AppHeader.js.map +1 -1
  11. package/lib/components/AppShell/AppHeader.styles.d.ts +2 -0
  12. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppHeader.styles.js +43 -33
  14. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.js +37 -13
  17. package/lib/components/AppShell/AppShell.js.map +1 -1
  18. package/lib/components/AppShell/AppShell.styles.d.ts +4 -1
  19. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShell.styles.js +45 -14
  21. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  22. package/lib/components/AppShell/AppShell.types.d.ts +30 -0
  23. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  25. package/lib/components/AppShell/AppShellContext.d.ts +2 -0
  26. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  27. package/lib/components/AppShell/AppShellContext.js +2 -0
  28. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  29. package/lib/components/AppShell/AppShellList.d.ts +1 -1
  30. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  31. package/lib/components/AppShell/AppShellList.js +6 -2
  32. package/lib/components/AppShell/AppShellList.js.map +1 -1
  33. package/lib/components/AppShell/AppShellList.styles.d.ts +1 -1
  34. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  35. package/lib/components/AppShell/AppShellList.styles.js +21 -19
  36. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  37. package/lib/components/AppShell/AppShellSearch.styles.js +1 -1
  38. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
  39. package/lib/components/AppShell/ContextSwitcher.d.ts +6 -0
  40. package/lib/components/AppShell/ContextSwitcher.d.ts.map +1 -0
  41. package/lib/components/AppShell/ContextSwitcher.js +18 -0
  42. package/lib/components/AppShell/ContextSwitcher.js.map +1 -0
  43. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  44. package/lib/components/AppShell/Drawer.js +8 -9
  45. package/lib/components/AppShell/Drawer.js.map +1 -1
  46. package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -1
  47. package/lib/components/AppShell/Drawer.styles.js +7 -4
  48. package/lib/components/AppShell/Drawer.styles.js.map +1 -1
  49. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  50. package/lib/components/AppShell/NavigationList.js +15 -12
  51. package/lib/components/AppShell/NavigationList.js.map +1 -1
  52. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  53. package/lib/components/AppShell/NavigationListItemWrapper.js +4 -2
  54. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  55. package/lib/components/AppShell/index.d.ts +2 -1
  56. package/lib/components/AppShell/index.d.ts.map +1 -1
  57. package/lib/components/AppShell/index.js +1 -0
  58. package/lib/components/AppShell/index.js.map +1 -1
  59. package/lib/components/Avatar/Avatar.d.ts +1 -1
  60. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  61. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  62. package/lib/components/Backdrop/Backdrop.js +22 -2
  63. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  64. package/lib/components/Badges/Count.d.ts +2 -2
  65. package/lib/components/Badges/Count.d.ts.map +1 -1
  66. package/lib/components/Badges/Count.js +22 -25
  67. package/lib/components/Badges/Count.js.map +1 -1
  68. package/lib/components/Badges/Selection.js +1 -1
  69. package/lib/components/Badges/Selection.js.map +1 -1
  70. package/lib/components/Badges/Tag.js +1 -1
  71. package/lib/components/Badges/Tag.js.map +1 -1
  72. package/lib/components/Banner/Banner.d.ts +28 -21
  73. package/lib/components/Banner/Banner.d.ts.map +1 -1
  74. package/lib/components/Banner/Banner.js +138 -96
  75. package/lib/components/Banner/Banner.js.map +1 -1
  76. package/lib/components/Banner/index.d.ts +1 -1
  77. package/lib/components/Banner/index.d.ts.map +1 -1
  78. package/lib/components/Banner/index.js.map +1 -1
  79. package/lib/components/Button/Button.d.ts +1 -1
  80. package/lib/components/Button/Button.d.ts.map +1 -1
  81. package/lib/components/Card/Card.d.ts +4 -7
  82. package/lib/components/Card/Card.d.ts.map +1 -1
  83. package/lib/components/Card/Card.js +2 -9
  84. package/lib/components/Card/Card.js.map +1 -1
  85. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  86. package/lib/components/ComboBox/ComboBox.styles.js +0 -3
  87. package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
  88. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  89. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -3
  90. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  91. package/lib/components/Configuration/Configuration.d.ts +4 -1
  92. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  93. package/lib/components/Configuration/Configuration.js +2 -0
  94. package/lib/components/Configuration/Configuration.js.map +1 -1
  95. package/lib/components/CreditCard/CreditCard.types.d.ts +1 -1
  96. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  97. package/lib/components/DateTime/DateTime.types.d.ts +10 -7
  98. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  99. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  100. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  101. package/lib/components/DateTime/Input/DateInput.js +19 -4
  102. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  103. package/lib/components/DateTime/Input/DateRangeInput.d.ts +4 -2
  104. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  105. package/lib/components/DateTime/Input/DateRangeInput.js +71 -34
  106. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  107. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  108. package/lib/components/DateTime/Input/DateTimeInput.js +26 -5
  109. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  110. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
  111. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  112. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts +1 -1
  113. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
  114. package/lib/components/DateTime/Input/Duration/Time.d.ts +1 -1
  115. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  116. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  117. package/lib/components/DateTime/Input/MonthInput.js +8 -3
  118. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  119. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  120. package/lib/components/DateTime/Input/PartInput.js +2 -2
  121. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  122. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  123. package/lib/components/DateTime/Input/TimeInput.js +13 -3
  124. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  125. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +4 -2
  126. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
  127. package/lib/components/DateTime/Input/TimeRangeInput.js +70 -27
  128. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  129. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  130. package/lib/components/DateTime/Input/WeekInput.js +7 -2
  131. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  132. package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
  133. package/lib/components/DateTime/Input/usePickerButton.js +19 -27
  134. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  135. package/lib/components/DateTime/Input/utils.d.ts +2 -2
  136. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  137. package/lib/components/DateTime/Input/utils.js +6 -17
  138. package/lib/components/DateTime/Input/utils.js.map +1 -1
  139. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  140. package/lib/components/DateTime/Picker/Calendar.js +3 -1
  141. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  142. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  143. package/lib/components/DateTime/Picker/DatePicker.js +2 -8
  144. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  145. package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -1
  146. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  147. package/lib/components/DateTime/Picker/TimePicker.js +1 -1
  148. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  149. package/lib/components/Dialog/Dialog.d.ts +3 -30
  150. package/lib/components/Dialog/Dialog.d.ts.map +1 -1
  151. package/lib/components/Dialog/Dialog.js +7 -147
  152. package/lib/components/Dialog/Dialog.js.map +1 -1
  153. package/lib/components/Dialog/Dialog.styles.d.ts +3 -0
  154. package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -0
  155. package/lib/components/Dialog/Dialog.styles.js +18 -0
  156. package/lib/components/Dialog/Dialog.styles.js.map +1 -0
  157. package/lib/components/Dialog/Dialog.types.d.ts +87 -0
  158. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -0
  159. package/lib/components/Dialog/Dialog.types.js +3 -0
  160. package/lib/components/Dialog/Dialog.types.js.map +1 -0
  161. package/lib/components/Dialog/FormDialog.d.ts +7 -0
  162. package/lib/components/Dialog/FormDialog.d.ts.map +1 -0
  163. package/lib/components/Dialog/FormDialog.js +58 -0
  164. package/lib/components/Dialog/FormDialog.js.map +1 -0
  165. package/lib/components/Dialog/InfoDialog.d.ts +6 -0
  166. package/lib/components/Dialog/InfoDialog.d.ts.map +1 -0
  167. package/lib/components/Dialog/InfoDialog.js +43 -0
  168. package/lib/components/Dialog/InfoDialog.js.map +1 -0
  169. package/lib/components/Dialog/index.d.ts +3 -2
  170. package/lib/components/Dialog/index.d.ts.map +1 -1
  171. package/lib/components/Dialog/index.js +2 -2
  172. package/lib/components/Dialog/index.js.map +1 -1
  173. package/lib/components/Drawer/Drawer.d.ts +1 -1
  174. package/lib/components/Drawer/Drawer.d.ts.map +1 -1
  175. package/lib/components/EmojiPicker/EmojiPicker.d.ts +1 -1
  176. package/lib/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  177. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  178. package/lib/components/FieldGroup/FieldGroup.js +2 -1
  179. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  180. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  181. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  182. package/lib/components/FieldValueList/FieldValueList.js +5 -36
  183. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  184. package/lib/components/FieldValueList/index.d.ts +1 -1
  185. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  186. package/lib/components/FieldValueList/index.js.map +1 -1
  187. package/lib/components/File/utils.d.ts +1 -1
  188. package/lib/components/File/utils.d.ts.map +1 -1
  189. package/lib/components/Flex/Flex.d.ts +2 -2
  190. package/lib/components/Flex/Flex.d.ts.map +1 -1
  191. package/lib/components/FormControl/FormControl.d.ts +4 -0
  192. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  193. package/lib/components/FormControl/FormControl.js +3 -1
  194. package/lib/components/FormControl/FormControl.js.map +1 -1
  195. package/lib/components/FormControl/index.d.ts +1 -0
  196. package/lib/components/FormControl/index.d.ts.map +1 -1
  197. package/lib/components/FormControl/index.js.map +1 -1
  198. package/lib/components/Grid/Grid.types.d.ts +2 -2
  199. package/lib/components/Grid/Grid.types.d.ts.map +1 -1
  200. package/lib/components/HTML/HTML.d.ts.map +1 -1
  201. package/lib/components/HTML/HTML.js +1 -0
  202. package/lib/components/HTML/HTML.js.map +1 -1
  203. package/lib/components/Icon/iconNames.d.ts +2 -2
  204. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  205. package/lib/components/Icon/iconNames.js +2 -0
  206. package/lib/components/Icon/iconNames.js.map +1 -1
  207. package/lib/components/Icon/icons/user-question-mark-solid.icon.d.ts +4 -0
  208. package/lib/components/Icon/icons/user-question-mark-solid.icon.d.ts.map +1 -0
  209. package/lib/components/Icon/icons/user-question-mark-solid.icon.js +6 -0
  210. package/lib/components/Icon/icons/user-question-mark-solid.icon.js.map +1 -0
  211. package/lib/components/Icon/icons/user-question-mark.icon.d.ts +4 -0
  212. package/lib/components/Icon/icons/user-question-mark.icon.d.ts.map +1 -0
  213. package/lib/components/Icon/icons/user-question-mark.icon.js +6 -0
  214. package/lib/components/Icon/icons/user-question-mark.icon.js.map +1 -0
  215. package/lib/components/Lightbox/Lightbox.styles.js +2 -2
  216. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
  217. package/lib/components/Link/Link.d.ts.map +1 -1
  218. package/lib/components/Link/Link.js +13 -4
  219. package/lib/components/Link/Link.js.map +1 -1
  220. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
  221. package/lib/components/List/CommaSeparatedList.js +5 -37
  222. package/lib/components/List/CommaSeparatedList.js.map +1 -1
  223. package/lib/components/List/List.d.ts.map +1 -1
  224. package/lib/components/List/List.js +11 -1
  225. package/lib/components/List/List.js.map +1 -1
  226. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  227. package/lib/components/ListToolbar/ListToolbar.js +106 -68
  228. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  229. package/lib/components/ListToolbar/ListToolbar.styles.d.ts +5 -1
  230. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  231. package/lib/components/ListToolbar/ListToolbar.styles.js +50 -5
  232. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  233. package/lib/components/ListToolbar/ListToolbar.types.d.ts +5 -5
  234. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  235. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  236. package/lib/components/LiveLog/Context.d.ts +3 -0
  237. package/lib/components/LiveLog/Context.d.ts.map +1 -0
  238. package/lib/components/LiveLog/Context.js +9 -0
  239. package/lib/components/LiveLog/Context.js.map +1 -0
  240. package/lib/components/LiveLog/LiveLog.d.ts +10 -0
  241. package/lib/components/LiveLog/LiveLog.d.ts.map +1 -0
  242. package/lib/components/LiveLog/LiveLog.js +99 -0
  243. package/lib/components/LiveLog/LiveLog.js.map +1 -0
  244. package/lib/components/LiveLog/LiveLog.styles.d.ts +3 -0
  245. package/lib/components/LiveLog/LiveLog.styles.d.ts.map +1 -0
  246. package/lib/components/LiveLog/LiveLog.styles.js +9 -0
  247. package/lib/components/LiveLog/LiveLog.styles.js.map +1 -0
  248. package/lib/components/LiveLog/LiveLog.types.d.ts +93 -0
  249. package/lib/components/LiveLog/LiveLog.types.d.ts.map +1 -0
  250. package/lib/components/LiveLog/LiveLog.types.js +2 -0
  251. package/lib/components/LiveLog/LiveLog.types.js.map +1 -0
  252. package/lib/components/LiveLog/index.d.ts +4 -0
  253. package/lib/components/LiveLog/index.d.ts.map +1 -0
  254. package/lib/components/LiveLog/index.js +3 -0
  255. package/lib/components/LiveLog/index.js.map +1 -0
  256. package/lib/components/Location/CurrentLocationButton.d.ts +1 -1
  257. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  258. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  259. package/lib/components/Location/LocationInput.js +1 -2
  260. package/lib/components/Location/LocationInput.js.map +1 -1
  261. package/lib/components/Location/LocationView.d.ts.map +1 -1
  262. package/lib/components/Location/LocationView.js +4 -4
  263. package/lib/components/Location/LocationView.js.map +1 -1
  264. package/lib/components/Location/MapsContext.d.ts +1 -1
  265. package/lib/components/Location/MapsContext.d.ts.map +1 -1
  266. package/lib/components/Location/utils.d.ts +1 -1
  267. package/lib/components/Location/utils.d.ts.map +1 -1
  268. package/lib/components/Location/utils.js.map +1 -1
  269. package/lib/components/Menu/Menu.js +3 -3
  270. package/lib/components/Menu/Menu.js.map +1 -1
  271. package/lib/components/Menu/Menu.styles.js +1 -1
  272. package/lib/components/Menu/Menu.styles.js.map +1 -1
  273. package/lib/components/Menu/Menu.types.d.ts +3 -5
  274. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  275. package/lib/components/Menu/Menu.types.js.map +1 -1
  276. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  277. package/lib/components/Menu/MenuList.js +4 -3
  278. package/lib/components/Menu/MenuList.js.map +1 -1
  279. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  280. package/lib/components/MenuButton/MenuButton.js +18 -4
  281. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  282. package/lib/components/Modal/Modal.d.ts.map +1 -1
  283. package/lib/components/Modal/Modal.js +6 -8
  284. package/lib/components/Modal/Modal.js.map +1 -1
  285. package/lib/components/Modal/Modal.types.d.ts +2 -1
  286. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  287. package/lib/components/Modal/Modal.types.js.map +1 -1
  288. package/lib/components/MultiStepForm/FormProgress.d.ts.map +1 -1
  289. package/lib/components/MultiStepForm/FormProgress.js +15 -6
  290. package/lib/components/MultiStepForm/FormProgress.js.map +1 -1
  291. package/lib/components/Number/NumberInput.types.d.ts +3 -1
  292. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  293. package/lib/components/Number/NumberInput.types.js.map +1 -1
  294. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  295. package/lib/components/Number/NumberRangeInput.js +71 -4
  296. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  297. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  298. package/lib/components/PageTemplates/CategorySubPage.js +15 -4
  299. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  300. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  301. package/lib/components/PageTemplates/CategorySubPage.styles.js +5 -0
  302. package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
  303. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  304. package/lib/components/PageTemplates/DashboardPage.js +16 -2
  305. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  306. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  307. package/lib/components/PageTemplates/PageTemplates.js +20 -3
  308. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  309. package/lib/components/Popover/Popover.d.ts +1 -1
  310. package/lib/components/Popover/Popover.d.ts.map +1 -1
  311. package/lib/components/Popover/Popover.js +2 -5
  312. package/lib/components/Popover/Popover.js.map +1 -1
  313. package/lib/components/Popover/Popover.styles.d.ts +0 -1
  314. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  315. package/lib/components/Popover/Popover.styles.js +0 -6
  316. package/lib/components/Popover/Popover.styles.js.map +1 -1
  317. package/lib/components/Popover/modifiers.d.ts +0 -2
  318. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  319. package/lib/components/Popover/modifiers.js +1 -32
  320. package/lib/components/Popover/modifiers.js.map +1 -1
  321. package/lib/components/Progress/Bar.d.ts +0 -3
  322. package/lib/components/Progress/Bar.d.ts.map +1 -1
  323. package/lib/components/Progress/Bar.js +1 -54
  324. package/lib/components/Progress/Bar.js.map +1 -1
  325. package/lib/components/Progress/Ellipsis.d.ts +0 -1
  326. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  327. package/lib/components/Progress/Ellipsis.js +1 -72
  328. package/lib/components/Progress/Ellipsis.js.map +1 -1
  329. package/lib/components/Progress/Progress.d.ts.map +1 -1
  330. package/lib/components/Progress/Progress.js +99 -60
  331. package/lib/components/Progress/Progress.js.map +1 -1
  332. package/lib/components/Progress/Progress.styles.d.ts +12 -0
  333. package/lib/components/Progress/Progress.styles.d.ts.map +1 -0
  334. package/lib/components/Progress/Progress.styles.js +217 -0
  335. package/lib/components/Progress/Progress.styles.js.map +1 -0
  336. package/lib/components/Progress/Progress.types.d.ts +19 -2
  337. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  338. package/lib/components/Progress/Progress.types.js.map +1 -1
  339. package/lib/components/Progress/Ring.d.ts +0 -3
  340. package/lib/components/Progress/Ring.d.ts.map +1 -1
  341. package/lib/components/Progress/Ring.js +1 -58
  342. package/lib/components/Progress/Ring.js.map +1 -1
  343. package/lib/components/Progress/index.d.ts +1 -3
  344. package/lib/components/Progress/index.d.ts.map +1 -1
  345. package/lib/components/Progress/index.js +1 -3
  346. package/lib/components/Progress/index.js.map +1 -1
  347. package/lib/components/QRCode/QRCode.d.ts +14 -0
  348. package/lib/components/QRCode/QRCode.d.ts.map +1 -0
  349. package/lib/components/QRCode/QRCode.js +39 -0
  350. package/lib/components/QRCode/QRCode.js.map +1 -0
  351. package/lib/components/QRCode/index.d.ts +3 -0
  352. package/lib/components/QRCode/index.d.ts.map +1 -0
  353. package/lib/components/QRCode/index.js +2 -0
  354. package/lib/components/QRCode/index.js.map +1 -0
  355. package/lib/components/RadioCheck/RadioCheck.js +1 -1
  356. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  357. package/lib/components/SearchInput/SearchInput.d.ts +2 -2
  358. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  359. package/lib/components/SearchInput/SearchInput.js +28 -8
  360. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  361. package/lib/components/SearchInput/SearchInput.styles.js +1 -1
  362. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
  363. package/lib/components/ShowMoreLess/ShowMoreLess.d.ts +9 -0
  364. package/lib/components/ShowMoreLess/ShowMoreLess.d.ts.map +1 -0
  365. package/lib/components/ShowMoreLess/ShowMoreLess.js +41 -0
  366. package/lib/components/ShowMoreLess/ShowMoreLess.js.map +1 -0
  367. package/lib/components/ShowMoreLess/index.d.ts +3 -0
  368. package/lib/components/ShowMoreLess/index.d.ts.map +1 -0
  369. package/lib/components/ShowMoreLess/index.js +2 -0
  370. package/lib/components/ShowMoreLess/index.js.map +1 -0
  371. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
  372. package/lib/components/SkipLinks/SkipLinks.js +3 -26
  373. package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
  374. package/lib/components/Slider/Slider.styles.d.ts +1 -1
  375. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  376. package/lib/components/Tabs/Tab.js +2 -2
  377. package/lib/components/Tabs/Tab.js.map +1 -1
  378. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  379. package/lib/components/Tabs/Tabs.js +8 -10
  380. package/lib/components/Tabs/Tabs.js.map +1 -1
  381. package/lib/components/TextArea/TextArea.js +2 -2
  382. package/lib/components/TextArea/TextArea.js.map +1 -1
  383. package/lib/components/Toaster/Context.d.ts +1 -0
  384. package/lib/components/Toaster/Context.d.ts.map +1 -1
  385. package/lib/components/Toaster/Context.js.map +1 -1
  386. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  387. package/lib/components/Toaster/Toaster.js +6 -2
  388. package/lib/components/Toaster/Toaster.js.map +1 -1
  389. package/lib/components/Tree/StandardTree.d.ts.map +1 -1
  390. package/lib/components/Tree/StandardTree.js +70 -27
  391. package/lib/components/Tree/StandardTree.js.map +1 -1
  392. package/lib/components/Tree/StandardTree.styles.d.ts +1 -0
  393. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
  394. package/lib/components/Tree/StandardTree.styles.js +32 -18
  395. package/lib/components/Tree/StandardTree.styles.js.map +1 -1
  396. package/lib/components/Tree/StandardTree.types.d.ts +28 -1
  397. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
  398. package/lib/components/Tree/StandardTree.types.js.map +1 -1
  399. package/lib/components/Tree/Tree.d.ts +2 -2
  400. package/lib/components/Tree/Tree.d.ts.map +1 -1
  401. package/lib/components/Tree/helpers.d.ts +11 -9
  402. package/lib/components/Tree/helpers.d.ts.map +1 -1
  403. package/lib/components/Tree/helpers.js +25 -5
  404. package/lib/components/Tree/helpers.js.map +1 -1
  405. package/lib/components/Tree/index.d.ts +1 -1
  406. package/lib/components/Tree/index.d.ts.map +1 -1
  407. package/lib/components/Tree/index.js.map +1 -1
  408. package/lib/components/URL/URLDisplay.d.ts +2 -2
  409. package/lib/components/URL/URLDisplay.d.ts.map +1 -1
  410. package/lib/components/URL/URLDisplay.js +8 -1
  411. package/lib/components/URL/URLDisplay.js.map +1 -1
  412. package/lib/hooks/index.d.ts +1 -0
  413. package/lib/hooks/index.d.ts.map +1 -1
  414. package/lib/hooks/index.js +1 -0
  415. package/lib/hooks/index.js.map +1 -1
  416. package/lib/hooks/useActiveDescendant.d.ts +2 -2
  417. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  418. package/lib/hooks/useArrows.d.ts.map +1 -1
  419. package/lib/hooks/useArrows.js +3 -3
  420. package/lib/hooks/useArrows.js.map +1 -1
  421. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  422. package/lib/hooks/useBreakpoint.js +3 -2
  423. package/lib/hooks/useBreakpoint.js.map +1 -1
  424. package/lib/hooks/useEvent.d.ts +2 -2
  425. package/lib/hooks/useEvent.d.ts.map +1 -1
  426. package/lib/hooks/useI18n.d.ts +90 -19
  427. package/lib/hooks/useI18n.d.ts.map +1 -1
  428. package/lib/hooks/useLiveLog.d.ts +8 -0
  429. package/lib/hooks/useLiveLog.d.ts.map +1 -0
  430. package/lib/hooks/useLiveLog.js +16 -0
  431. package/lib/hooks/useLiveLog.js.map +1 -0
  432. package/lib/hooks/useOverride.d.ts +1 -1
  433. package/lib/hooks/useOverride.d.ts.map +1 -1
  434. package/lib/hooks/useScrollStick.d.ts +1 -1
  435. package/lib/hooks/useScrollStick.d.ts.map +1 -1
  436. package/lib/i18n/default.d.ts +90 -19
  437. package/lib/i18n/default.d.ts.map +1 -1
  438. package/lib/i18n/default.js +100 -27
  439. package/lib/i18n/default.js.map +1 -1
  440. package/lib/i18n/i18n.d.ts +92 -21
  441. package/lib/i18n/i18n.d.ts.map +1 -1
  442. package/lib/i18n/translate.d.ts +1 -1
  443. package/lib/i18n/translate.d.ts.map +1 -1
  444. package/lib/index.d.ts +6 -1
  445. package/lib/index.d.ts.map +1 -1
  446. package/lib/index.js +6 -1
  447. package/lib/index.js.map +1 -1
  448. package/lib/register-contexts.js +2 -0
  449. package/lib/register-contexts.js.map +1 -1
  450. package/lib/styles/gradients.d.ts +1 -1
  451. package/lib/styles/gradients.d.ts.map +1 -1
  452. package/lib/styles/utils.d.ts +1 -1
  453. package/lib/styles/utils.d.ts.map +1 -1
  454. package/lib/styles/utils.js +10 -10
  455. package/lib/styles/utils.js.map +1 -1
  456. package/lib/theme/ThemeMachine.d.ts +3 -3
  457. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  458. package/lib/theme/ThemeMachine.js +30 -30
  459. package/lib/theme/ThemeMachine.js.map +1 -1
  460. package/lib/theme/theme.d.ts +45 -75
  461. package/lib/theme/theme.d.ts.map +1 -1
  462. package/lib/theme/themeDefinition.json +14 -30
  463. package/lib/theme/themeOverrides.schema.json +1 -4
  464. package/lib/theme/themes/darkTheme.json +4 -1
  465. package/lib/theme/themes/legacyBuildTheme.json +2 -3
  466. package/lib/types/types.d.ts +19 -11
  467. package/lib/types/types.d.ts.map +1 -1
  468. package/lib/types/types.js.map +1 -1
  469. package/lib/utils/bindAll.d.ts +4 -0
  470. package/lib/utils/bindAll.d.ts.map +1 -0
  471. package/lib/utils/bindAll.js +9 -0
  472. package/lib/utils/bindAll.js.map +1 -0
  473. package/lib/utils/cap.d.ts +4 -0
  474. package/lib/utils/cap.d.ts.map +1 -0
  475. package/lib/utils/cap.js +6 -0
  476. package/lib/utils/cap.js.map +1 -0
  477. package/lib/utils/createStringMatcher.d.ts +10 -0
  478. package/lib/utils/createStringMatcher.d.ts.map +1 -0
  479. package/lib/utils/createStringMatcher.js +21 -0
  480. package/lib/utils/createStringMatcher.js.map +1 -0
  481. package/lib/utils/createUID.d.ts +4 -0
  482. package/lib/utils/createUID.d.ts.map +1 -0
  483. package/lib/utils/createUID.js +6 -0
  484. package/lib/utils/createUID.js.map +1 -0
  485. package/lib/utils/debounce.d.ts +4 -0
  486. package/lib/utils/debounce.d.ts.map +1 -0
  487. package/lib/utils/debounce.js +14 -0
  488. package/lib/utils/debounce.js.map +1 -0
  489. package/lib/utils/deepGet.d.ts +3 -0
  490. package/lib/utils/deepGet.d.ts.map +1 -0
  491. package/lib/utils/deepGet.js +15 -0
  492. package/lib/utils/deepGet.js.map +1 -0
  493. package/lib/utils/deepObjectComparison.d.ts +4 -0
  494. package/lib/utils/deepObjectComparison.d.ts.map +1 -0
  495. package/lib/utils/deepObjectComparison.js +35 -0
  496. package/lib/utils/deepObjectComparison.js.map +1 -0
  497. package/lib/utils/defineSmartGetter.d.ts +3 -0
  498. package/lib/utils/defineSmartGetter.d.ts.map +1 -0
  499. package/lib/utils/defineSmartGetter.js +14 -0
  500. package/lib/utils/defineSmartGetter.js.map +1 -0
  501. package/lib/utils/documentIsAvailable.d.ts +3 -0
  502. package/lib/utils/documentIsAvailable.d.ts.map +1 -0
  503. package/lib/utils/documentIsAvailable.js +3 -0
  504. package/lib/utils/documentIsAvailable.js.map +1 -0
  505. package/lib/utils/escapeRegExp.d.ts +8 -0
  506. package/lib/utils/escapeRegExp.d.ts.map +1 -0
  507. package/lib/utils/escapeRegExp.js +8 -0
  508. package/lib/utils/escapeRegExp.js.map +1 -0
  509. package/lib/utils/focusHeadingOrContainer.d.ts +8 -0
  510. package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -0
  511. package/lib/utils/focusHeadingOrContainer.js +29 -0
  512. package/lib/utils/focusHeadingOrContainer.js.map +1 -0
  513. package/lib/utils/formatListToLocaleString.d.ts +15 -0
  514. package/lib/utils/formatListToLocaleString.d.ts.map +1 -0
  515. package/lib/utils/formatListToLocaleString.js +17 -0
  516. package/lib/utils/formatListToLocaleString.js.map +1 -0
  517. package/lib/utils/getActiveElement.d.ts +8 -0
  518. package/lib/utils/getActiveElement.d.ts.map +1 -0
  519. package/lib/utils/getActiveElement.js +18 -0
  520. package/lib/utils/getActiveElement.js.map +1 -0
  521. package/lib/utils/getFocusables.d.ts +9 -0
  522. package/lib/utils/getFocusables.d.ts.map +1 -0
  523. package/lib/utils/getFocusables.js +15 -0
  524. package/lib/utils/getFocusables.js.map +1 -0
  525. package/lib/utils/getScrollbarWidth.d.ts +4 -0
  526. package/lib/utils/getScrollbarWidth.d.ts.map +1 -0
  527. package/lib/utils/getScrollbarWidth.js +17 -0
  528. package/lib/utils/getScrollbarWidth.js.map +1 -0
  529. package/lib/utils/hasProp.d.ts +4 -0
  530. package/lib/utils/hasProp.d.ts.map +1 -0
  531. package/lib/utils/hasProp.js +6 -0
  532. package/lib/utils/hasProp.js.map +1 -0
  533. package/lib/utils/index.d.ts +27 -1
  534. package/lib/utils/index.d.ts.map +1 -1
  535. package/lib/utils/index.js +27 -1
  536. package/lib/utils/index.js.map +1 -1
  537. package/lib/utils/loadScript.d.ts +3 -0
  538. package/lib/utils/loadScript.d.ts.map +1 -0
  539. package/lib/utils/loadScript.js +9 -0
  540. package/lib/utils/loadScript.js.map +1 -0
  541. package/lib/utils/navigatorIsAvailable.d.ts +3 -0
  542. package/lib/utils/navigatorIsAvailable.d.ts.map +1 -0
  543. package/lib/utils/navigatorIsAvailable.js +3 -0
  544. package/lib/utils/navigatorIsAvailable.js.map +1 -0
  545. package/lib/utils/normalizeElements.d.ts +9 -0
  546. package/lib/utils/normalizeElements.d.ts.map +1 -0
  547. package/lib/utils/normalizeElements.js +14 -0
  548. package/lib/utils/normalizeElements.js.map +1 -0
  549. package/lib/utils/range.d.ts +4 -0
  550. package/lib/utils/range.d.ts.map +1 -0
  551. package/lib/utils/range.js +8 -0
  552. package/lib/utils/range.js.map +1 -0
  553. package/lib/utils/reflow.d.ts +4 -0
  554. package/lib/utils/reflow.d.ts.map +1 -0
  555. package/lib/utils/reflow.js +7 -0
  556. package/lib/utils/reflow.js.map +1 -0
  557. package/lib/utils/replaceMatchWithElement.d.ts +4 -0
  558. package/lib/utils/replaceMatchWithElement.d.ts.map +1 -0
  559. package/lib/utils/replaceMatchWithElement.js +32 -0
  560. package/lib/utils/replaceMatchWithElement.js.map +1 -0
  561. package/lib/utils/sameOrigin.d.ts +7 -0
  562. package/lib/utils/sameOrigin.d.ts.map +1 -0
  563. package/lib/utils/sameOrigin.js +25 -0
  564. package/lib/utils/sameOrigin.js.map +1 -0
  565. package/lib/utils/testElForOverflow.d.ts +4 -0
  566. package/lib/utils/testElForOverflow.d.ts.map +1 -0
  567. package/lib/utils/testElForOverflow.js +6 -0
  568. package/lib/utils/testElForOverflow.js.map +1 -0
  569. package/lib/utils/triple.d.ts +12 -0
  570. package/lib/utils/triple.d.ts.map +1 -0
  571. package/lib/utils/triple.js +13 -0
  572. package/lib/utils/triple.js.map +1 -0
  573. package/lib/utils/tryCatch.d.ts +5 -0
  574. package/lib/utils/tryCatch.d.ts.map +1 -0
  575. package/lib/utils/tryCatch.js +16 -0
  576. package/lib/utils/tryCatch.js.map +1 -0
  577. package/lib/utils/windowIsAvailable.d.ts +3 -0
  578. package/lib/utils/windowIsAvailable.d.ts.map +1 -0
  579. package/lib/utils/windowIsAvailable.js +3 -0
  580. package/lib/utils/windowIsAvailable.js.map +1 -0
  581. package/package.json +4 -2
  582. package/lib/components/ListToolbar/QueryOptionPopover.d.ts +0 -12
  583. package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +0 -1
  584. package/lib/components/ListToolbar/QueryOptionPopover.js +0 -36
  585. package/lib/components/ListToolbar/QueryOptionPopover.js.map +0 -1
  586. package/lib/utils/utils.d.ts +0 -93
  587. package/lib/utils/utils.d.ts.map +0 -1
  588. package/lib/utils/utils.js +0 -287
  589. package/lib/utils/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../src/components/Actions/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAc,MAAM,OAAO,CAAC;AAGxF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACrC,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;KAC1C,CAAC;IACF,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CA+C3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../src/components/Actions/Actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAc,MAAM,OAAO,CAAC;AAGxF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iBAAiB;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACrC,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;KAC1C,CAAC;IACF,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAoD3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,21 +1,27 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import { useI18n } from '../../hooks';
3
+ import { useConsolidatedRef, useI18n } from '../../hooks';
4
4
  import Button from '../Button';
5
5
  import Icon from '../Icon';
6
6
  import MenuButton from '../MenuButton';
7
7
  const Actions = forwardRef(({ items, menuAt = 2, iconOnly = true, menuButtonProps }, ref) => {
8
8
  const t = useI18n();
9
+ const menuButtonRef = useConsolidatedRef(ref);
9
10
  if (!items || items.length === 0) {
10
11
  return null;
11
12
  }
12
- return items.length >= menuAt ? (_jsx(MenuButton, { ref: ref, text: t('actions'), iconOnly: true, icon: 'more', variant: 'simple', onClick: menuButtonProps?.onClick, onKeyDown: menuButtonProps?.onKeyDown, menu: {
13
- items: items.map(({ text, ...restProps }) => ({
13
+ return items.length >= menuAt ? (_jsx(MenuButton, { ref: menuButtonRef, text: t('actions'), iconOnly: true, icon: 'more', variant: 'simple', onClick: menuButtonProps?.onClick, onKeyDown: menuButtonProps?.onKeyDown, menu: {
14
+ items: items.map(({ text, onClick, ...restProps }) => ({
15
+ ...restProps,
14
16
  primary: text,
15
- ...restProps
17
+ onClick: onClick
18
+ ? (id, e) => {
19
+ onClick(id, e, menuButtonRef.current ?? undefined);
20
+ }
21
+ : undefined
16
22
  }))
17
23
  } })) : (_jsx(_Fragment, { children: items.map(({ id, icon, text, onClick, ...restProps }) => {
18
- return (_jsx(Button, { ref: ref, variant: icon && iconOnly ? 'simple' : undefined, onClick: (event) => onClick?.(id, event), label: icon ? text : undefined, icon: !!icon && iconOnly, ...restProps, children: icon && iconOnly ? _jsx(Icon, { name: icon }) : text }, id));
24
+ return (_jsx(Button, { variant: icon && iconOnly ? 'simple' : undefined, onClick: (event) => onClick?.(id, event), label: icon ? text : undefined, icon: !!icon && iconOnly, ...restProps, children: icon && iconOnly ? _jsx(Icon, { name: icon }) : text }, id));
19
25
  }) }));
20
26
  });
21
27
  export default Actions;
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../src/components/Actions/Actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuD,MAAM,OAAO,CAAC;AAExF,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,UAA+B,MAAM,eAAe,CAAC;AAe5D,MAAM,OAAO,GAAmD,UAAU,CACxE,CACE,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE,eAAe,EAAiC,EACtF,GAAwB,EACxB,EAAE;IACF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,C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ref, MouseEvent } from 'react';\n\nimport { useI18n } from '../../hooks';\nimport { Action, ForwardProps, NoChildrenProp } from '../../types';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport MenuButton, { MenuButtonProps } from '../MenuButton';\n\nexport interface ActionsProps extends NoChildrenProp {\n items: Action[];\n /** @default 2 */\n menuAt?: number;\n menuButtonProps?: {\n onClick?: MenuButtonProps['onClick'];\n onKeyDown?: MenuButtonProps['onKeyDown'];\n };\n /** @default true */\n iconOnly?: boolean;\n ref?: Ref<HTMLButtonElement>;\n}\n\nconst Actions: FunctionComponent<ActionsProps & ForwardProps> = forwardRef(\n (\n { items, menuAt = 2, iconOnly = true, menuButtonProps }: PropsWithoutRef<ActionsProps>,\n ref: ActionsProps['ref']\n ) => {\n const t = useI18n();\n\n if (!items || items.length === 0) {\n return null;\n }\n\n return items.length >= menuAt ? (\n <MenuButton\n ref={ref}\n text={t('actions')}\n iconOnly\n icon='more'\n variant='simple'\n onClick={menuButtonProps?.onClick}\n onKeyDown={menuButtonProps?.onKeyDown}\n menu={{\n items: items.map(({ text, ...restProps }) => ({\n primary: text,\n ...restProps\n }))\n }}\n />\n ) : (\n <>\n {items.map(({ id, icon, text, onClick, ...restProps }) => {\n return (\n <Button\n key={id}\n ref={ref}\n variant={icon && iconOnly ? 'simple' : undefined}\n onClick={(event: MouseEvent<HTMLButtonElement>) => onClick?.(id, event)}\n label={icon ? text : undefined}\n icon={!!icon && iconOnly}\n {...restProps}\n >\n {icon && iconOnly ? <Icon name={icon} /> : text}\n </Button>\n );\n })}\n </>\n );\n }\n);\n\nexport default Actions;\n"]}
1
+ {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../src/components/Actions/Actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuD,MAAM,OAAO,CAAC;AAExF,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,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,EAAE;YACvD,OAAO,CACL,KAAC,MAAM,IAEL,OAAO,EAAE,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAChD,OAAO,EAAE,CAAC,KAAoC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,EACvE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAC9B,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,QAAQ,KACpB,SAAS,YAEZ,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IAP1C,EAAE,CAQA,CACV,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref, MouseEvent } from 'react';\n\nimport { useConsolidatedRef, useI18n } from '../../hooks';\nimport { Action, ForwardProps, NoChildrenProp } from '../../types';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport MenuButton, { MenuButtonProps } from '../MenuButton';\n\nexport interface ActionsProps extends NoChildrenProp {\n items: Action[];\n /** @default 2 */\n menuAt?: number;\n menuButtonProps?: {\n onClick?: MenuButtonProps['onClick'];\n onKeyDown?: MenuButtonProps['onKeyDown'];\n };\n /** @default true */\n iconOnly?: boolean;\n ref?: Ref<HTMLButtonElement>;\n}\n\nconst Actions: FunctionComponent<ActionsProps & ForwardProps> = forwardRef(\n (\n { items, menuAt = 2, iconOnly = true, menuButtonProps }: PropsWithoutRef<ActionsProps>,\n ref: ActionsProps['ref']\n ) => {\n const t = useI18n();\n const menuButtonRef = useConsolidatedRef(ref);\n\n if (!items || items.length === 0) {\n return null;\n }\n\n return items.length >= menuAt ? (\n <MenuButton\n ref={menuButtonRef}\n text={t('actions')}\n iconOnly\n icon='more'\n variant='simple'\n onClick={menuButtonProps?.onClick}\n onKeyDown={menuButtonProps?.onKeyDown}\n menu={{\n items: items.map(({ text, onClick, ...restProps }) => ({\n ...restProps,\n primary: text,\n onClick: onClick\n ? (id, e) => {\n onClick(id, e, menuButtonRef.current ?? undefined);\n }\n : undefined\n }))\n }}\n />\n ) : (\n <>\n {items.map(({ id, icon, text, onClick, ...restProps }) => {\n return (\n <Button\n key={id}\n variant={icon && iconOnly ? 'simple' : undefined}\n onClick={(event: MouseEvent<HTMLButtonElement>) => onClick?.(id, event)}\n label={icon ? text : undefined}\n icon={!!icon && iconOnly}\n {...restProps}\n >\n {icon && iconOnly ? <Icon name={icon} /> : text}\n </Button>\n );\n })}\n </>\n );\n }\n);\n\nexport default Actions;\n"]}
@@ -1,8 +1,10 @@
1
1
  import { FunctionComponent, Ref } from 'react';
2
2
  import { BaseProps, ForwardProps } from '../../types';
3
+ import { DialogHandleValue } from '../Dialog';
3
4
  export interface AdditionalInfoProps extends BaseProps {
4
5
  heading: string;
5
6
  children: string | JSX.Element;
7
+ dialogHandle?: Ref<DialogHandleValue>;
6
8
  ref?: Ref<HTMLDivElement>;
7
9
  }
8
10
  export declare const StyledAdditionalInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalInfo.d.ts","sourceRoot":"","sources":["../../../src/components/AdditionalInfo/AdditionalInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUtD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC/B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB,yGAMhC,CAAC;AAIF,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAmBzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AdditionalInfo.d.ts","sourceRoot":"","sources":["../../../src/components/AdditionalInfo/AdditionalInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAc,MAAM,WAAW,CAAC;AAM1D,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB,yGAAe,CAAC;AAEjD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAiDzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,25 +1,34 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import styled, { css } from 'styled-components';
2
+ import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
3
+ import styled from 'styled-components';
4
4
  import Icon, { registerIcon } from '../Icon';
5
- import { defaultThemeProp } from '../../theme';
6
5
  import HTML from '../HTML';
7
6
  import Button from '../Button';
8
- import Dialog, { useDialog } from '../Dialog';
7
+ import { InfoDialog } from '../Dialog';
9
8
  import * as informationIcon from '../Icon/icons/information.icon';
10
- import { useI18n } from '../../hooks';
11
- import { StyledDialog } from '../Dialog/Dialog';
9
+ import { useConsolidatedRef, useI18n } from '../../hooks';
12
10
  registerIcon(informationIcon);
13
- export const StyledAdditionalInfo = styled.div(({ theme }) => css `
14
- & > ${StyledDialog} {
15
- max-width: ${theme.base['content-width'].md};
16
- }
17
- `);
18
- StyledAdditionalInfo.defaultProps = defaultThemeProp;
19
- const AdditionalInfo = forwardRef(({ heading, children, ...restProps }, ref) => {
20
- const { target, events } = useDialog();
11
+ export const StyledAdditionalInfo = styled.div ``;
12
+ const AdditionalInfo = forwardRef(({ heading, children, dialogHandle, ...restProps }, ref) => {
21
13
  const t = useI18n();
22
- return (_jsxs(StyledAdditionalInfo, { ref: ref, ...restProps, children: [_jsx(Button, { variant: 'simple', label: t('additional_info'), compact: true, icon: true, ...events, children: _jsx(Icon, { name: 'information' }) }), _jsx(Dialog, { heading: heading, target: target, children: typeof children === 'string' ? _jsx(HTML, { content: children }) : children })] }));
14
+ const [target, setTarget] = useState(null);
15
+ const buttonRef = useRef(null);
16
+ const handleRef = useConsolidatedRef(dialogHandle);
17
+ useImperativeHandle(handleRef, () => {
18
+ return {
19
+ open: () => {
20
+ setTarget(buttonRef.current);
21
+ },
22
+ close: () => {
23
+ setTarget(null);
24
+ }
25
+ };
26
+ });
27
+ return (_jsxs(StyledAdditionalInfo, { ref: ref, ...restProps, children: [_jsx(Button, { variant: 'simple', label: t('additional_info'), compact: true, icon: true, ref: buttonRef, onClick: () => {
28
+ handleRef.current?.open();
29
+ }, children: _jsx(Icon, { name: 'information' }) }), target && (_jsx(InfoDialog, { heading: heading, target: target, onDismiss: () => {
30
+ handleRef.current?.close();
31
+ }, children: typeof children === 'string' ? _jsx(HTML, { content: children }) : children }))] }));
23
32
  });
24
33
  export default AdditionalInfo;
25
34
  //# sourceMappingURL=AdditionalInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalInfo.js","sourceRoot":"","sources":["../../../src/components/AdditionalInfo/AdditionalInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,O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EACT,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YACrC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,OAAO,EAAE,QAAQ,GAAI,CAAC,CAAC,CAAC,QAAQ,GAC/D,IACY,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Icon, { registerIcon } from '../Icon';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps } from '../../types';\nimport HTML from '../HTML';\nimport Button from '../Button';\nimport Dialog, { useDialog } from '../Dialog';\nimport * as informationIcon from '../Icon/icons/information.icon';\nimport { useI18n } from '../../hooks';\nimport { StyledDialog } from '../Dialog/Dialog';\n\nregisterIcon(informationIcon);\n\nexport interface AdditionalInfoProps extends BaseProps {\n heading: string;\n children: string | JSX.Element;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledAdditionalInfo = styled.div(\n ({ theme }) => css`\n & > ${StyledDialog} {\n max-width: ${theme.base['content-width'].md};\n }\n `\n);\n\nStyledAdditionalInfo.defaultProps = defaultThemeProp;\n\nconst AdditionalInfo: FunctionComponent<AdditionalInfoProps & ForwardProps> = forwardRef(\n (\n { heading, children, ...restProps }: PropsWithoutRef<AdditionalInfoProps>,\n ref: AdditionalInfoProps['ref']\n ) => {\n const { target, events } = useDialog();\n const t = useI18n();\n\n return (\n <StyledAdditionalInfo ref={ref} {...restProps}>\n <Button variant='simple' label={t('additional_info')} compact icon {...events}>\n <Icon name='information' />\n </Button>\n <Dialog heading={heading} target={target}>\n {typeof children === 'string' ? <HTML content={children} /> : children}\n </Dialog>\n </StyledAdditionalInfo>\n );\n }\n);\n\nexport default AdditionalInfo;\n"]}
1
+ {"version":3,"file":"AdditionalInfo.js","sourceRoot":"","sources":["../../../src/components/AdditionalInf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AAE,GAAG,KAAM,SAAS,aAC3C,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAC3B,OAAO,QACP,IAAI,QACJ,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,GAAG,EAAE;oBACZ,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;gBAC5B,CAAC,YAED,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GACpB,EACR,MAAM,IAAI,CACT,KAAC,UAAU,IACT,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,GAAG,EAAE;oBACd,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;gBAC7B,CAAC,YAEA,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,OAAO,EAAE,QAAQ,GAAI,CAAC,CAAC,CAAC,QAAQ,GAC3D,CACd,IACoB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useImperativeHandle,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport Icon, { registerIcon } from '../Icon';\nimport { BaseProps, ForwardProps } from '../../types';\nimport HTML from '../HTML';\nimport Button from '../Button';\nimport { DialogHandleValue, InfoDialog } from '../Dialog';\nimport * as informationIcon from '../Icon/icons/information.icon';\nimport { useConsolidatedRef, useI18n } from '../../hooks';\n\nregisterIcon(informationIcon);\n\nexport interface AdditionalInfoProps extends BaseProps {\n heading: string;\n children: string | JSX.Element;\n dialogHandle?: Ref<DialogHandleValue>;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledAdditionalInfo = styled.div``;\n\nconst AdditionalInfo: FunctionComponent<AdditionalInfoProps & ForwardProps> = forwardRef(\n (\n { heading, children, dialogHandle, ...restProps }: PropsWithoutRef<AdditionalInfoProps>,\n ref: AdditionalInfoProps['ref']\n ) => {\n const t = useI18n();\n const [target, setTarget] = useState<HTMLButtonElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const handleRef = useConsolidatedRef(dialogHandle);\n\n useImperativeHandle(handleRef, () => {\n return {\n open: () => {\n setTarget(buttonRef.current);\n },\n close: () => {\n setTarget(null);\n }\n };\n });\n\n return (\n <StyledAdditionalInfo ref={ref} {...restProps}>\n <Button\n variant='simple'\n label={t('additional_info')}\n compact\n icon\n ref={buttonRef}\n onClick={() => {\n handleRef.current?.open();\n }}\n >\n <Icon name='information' />\n </Button>\n {target && (\n <InfoDialog\n heading={heading}\n target={target}\n onDismiss={() => {\n handleRef.current?.close();\n }}\n >\n {typeof children === 'string' ? <HTML content={children} /> : children}\n </InfoDialog>\n )}\n </StyledAdditionalInfo>\n );\n }\n);\n\nexport default AdditionalInfo;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAM/F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYlD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAgG/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAM/F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAalD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CA0G/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -7,12 +7,13 @@ import { useBreakpoint, useElement } from '../../hooks';
7
7
  import BareButton from '../Button/BareButton';
8
8
  import VisuallyHiddenText from '../VisuallyHiddenText';
9
9
  import AppShellOperator from './Operator';
10
+ import ContextSwitcher from './ContextSwitcher';
10
11
  import { StyledAppHeader, StyledAppHeaderInfo, StyledAppHeaderSearchForm, StyledAppHeaderSpacer, StyledAppHeaderText, StyledAppHeaderOperator } from './AppHeader.styles';
11
12
  import AppShellContext from './AppShellContext';
12
- const AppHeader = forwardRef(({ appName, fullImageSrc, imageSrc, href, onClick, portalName, target, appNameHidden, operator, searchInput, searchLabel, searchPage }, ref) => {
13
+ const AppHeader = forwardRef(({ appName, contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {}, fullImageSrc, imageSrc, href, onClick, portalName, target, appNameHidden, operator, searchInput, searchLabel, searchPage }, ref) => {
13
14
  const isMediumOrAbove = useBreakpoint('md');
14
15
  const [searchContainer, setSearchContainer] = useElement();
15
- const { setSearchContainerEl } = useContext(AppShellContext);
16
+ const { drawerOpen, setSearchContainerEl } = useContext(AppShellContext);
16
17
  useEffect(() => {
17
18
  if (searchPage && searchContainer) {
18
19
  setSearchContainerEl(searchContainer);
@@ -26,7 +27,7 @@ const AppHeader = forwardRef(({ appName, fullImageSrc, imageSrc, href, onClick,
26
27
  appInfoAs = 'a';
27
28
  else if (onClick)
28
29
  appInfoAs = BareButton;
29
- return (_jsxs(Flex, { as: StyledAppHeader, container: { alignItems: 'center', pad: 1 }, hideTitle: !isMediumOrAbove, ref: ref, children: [_jsx(StyledAppHeaderInfo, { centerLogo: !fullImageSrc, children: _jsxs(Flex, { container: { inline: true, alignItems: 'center', gap: 1 }, as: appInfoAs, href: href, onClick: onClick, target: target, children: [_jsx(Image, { src: fullImageSrc || imageSrc, alt: '', "aria-hidden": 'true' }), isMediumOrAbove && (_jsxs(_Fragment, { children: [_jsx(StyledAppHeaderText, { as: appNameHidden ? VisuallyHiddenText : 'span', variant: 'primary', children: appName }), portalName && (_jsx(StyledAppHeaderText, { as: appNameHidden ? VisuallyHiddenText : 'span', variant: 'secondary', children: portalName }))] }))] }) }), _jsx(Flex, { item: { grow: 1 }, container: { justify: 'end' }, children: searchInput ? (_jsx(StyledAppHeaderSearchForm, { ref: setSearchContainer, role: 'search', "aria-label": searchLabel, onSubmit: e => e.preventDefault(), isMediumOrAbove: isMediumOrAbove, children: !searchPage && _jsx(SearchInput, { ...searchInput }) })) : (_jsx(StyledAppHeaderSpacer, {})) }), _jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-start' }, children: operator.avatar })] }));
30
+ return (_jsxs(Flex, { as: StyledAppHeader, container: { alignItems: 'center', pad: 1 }, hideTitle: !isMediumOrAbove, drawerOpen: drawerOpen, ref: ref, children: [contexts && contexts.length > 1 && onContextClick && (_jsx(ContextSwitcher, { contexts: contexts, onContextClick: onContextClick, label: contextSwitcherLabel })), _jsx(StyledAppHeaderInfo, { centerLogo: !fullImageSrc, children: _jsxs(Flex, { container: { inline: true, alignItems: 'center', gap: 1 }, as: appInfoAs, href: href, onClick: onClick, target: target, children: [_jsx(Image, { src: fullImageSrc || imageSrc, alt: '', "aria-hidden": 'true' }), isMediumOrAbove && (_jsxs(_Fragment, { children: [_jsx(StyledAppHeaderText, { as: appNameHidden ? VisuallyHiddenText : 'span', variant: 'primary', children: appName }), portalName && (_jsx(StyledAppHeaderText, { as: appNameHidden ? VisuallyHiddenText : 'span', variant: 'secondary', children: portalName }))] }))] }) }), _jsx(Flex, { item: { grow: 1 }, container: { justify: 'end' }, children: searchInput ? (_jsx(StyledAppHeaderSearchForm, { ref: setSearchContainer, role: 'search', "aria-label": searchLabel, onSubmit: e => e.preventDefault(), isMediumOrAbove: isMediumOrAbove, children: !searchPage && _jsx(SearchInput, { ...searchInput }) })) : (_jsx(StyledAppHeaderSpacer, {})) }), _jsx(AppShellOperator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-start' }, children: operator.avatar })] }));
30
31
  });
31
32
  export default AppHeader;
32
33
  //# sourceMappingURL=AppHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuC,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/F,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAGvD,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,SAAS,GAAqD,UAAU,CAC5E,CACE,EACE,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,aAAa,EACb,QAAQ,EACR,WAAW,EACX,WAAW,EACX,UAAU,EACK,EACjB,GAAiB,EACjB,EAAE;IACF,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,UAAU,EAAe,CAAC;IACxE,MAAM,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,IAAI,eAAe,EAAE;YACjC,oBAAoB,CAAC,eAAe,CAAC,CA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E,EAAE,OAAO,EAAE,KAAK,EAAE,YACnD,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,yBAAyB,IACxB,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAC,QAAQ,gBACD,WAAW,EACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACjC,eAAe,EAAE,eAAe,YAE/B,CAAC,UAAU,IAAI,KAAC,WAAW,OAAK,WAAW,GAAI,GACtB,CAC7B,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,KAAG,CAC1B,GACI,EAEP,KAAC,gBAAgB,IACf,EAAE,EAAE,uBAAuB,EAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,YAErC,QAAQ,CAAC,MAAM,GACC,IACd,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref, ElementType, useContext, useEffect } from 'react';\n\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport SearchInput from '../SearchInput';\nimport { useBreakpoint, useElement } from '../../hooks';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport { AppHeaderProps } from './AppShell.types';\nimport AppShellOperator from './Operator';\nimport {\n StyledAppHeader,\n StyledAppHeaderInfo,\n StyledAppHeaderSearchForm,\n StyledAppHeaderSpacer,\n StyledAppHeaderText,\n StyledAppHeaderOperator\n} from './AppHeader.styles';\nimport AppShellContext from './AppShellContext';\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(\n (\n {\n appName,\n fullImageSrc,\n imageSrc,\n href,\n onClick,\n portalName,\n target,\n appNameHidden,\n operator,\n searchInput,\n searchLabel,\n searchPage\n }: AppHeaderProps,\n ref: Ref<Element>\n ) => {\n const isMediumOrAbove = useBreakpoint('md');\n const [searchContainer, setSearchContainer] = useElement<HTMLElement>();\n const { setSearchContainerEl } = useContext(AppShellContext);\n\n useEffect(() => {\n if (searchPage && searchContainer) {\n setSearchContainerEl(searchContainer);\n } else {\n setSearchContainerEl(null);\n }\n }, [searchPage, searchContainer, setSearchContainerEl]);\n\n let appInfoAs: ElementType = 'div';\n if (href) appInfoAs = 'a';\n else if (onClick) appInfoAs = BareButton;\n\n return (\n <Flex\n as={StyledAppHeader}\n container={{ alignItems: 'center', pad: 1 }}\n hideTitle={!isMediumOrAbove}\n ref={ref}\n >\n <StyledAppHeaderInfo centerLogo={!fullImageSrc}>\n <Flex\n container={{ inline: true, alignItems: 'center', gap: 1 }}\n as={appInfoAs}\n href={href}\n onClick={onClick}\n target={target}\n >\n <Image src={fullImageSrc || imageSrc} alt='' aria-hidden='true' />\n {isMediumOrAbove && (\n <>\n <StyledAppHeaderText\n as={appNameHidden ? VisuallyHiddenText : 'span'}\n variant='primary'\n >\n {appName}\n </StyledAppHeaderText>\n {portalName && (\n <StyledAppHeaderText\n as={appNameHidden ? VisuallyHiddenText : 'span'}\n variant='secondary'\n >\n {portalName}\n </StyledAppHeaderText>\n )}\n </>\n )}\n </Flex>\n </StyledAppHeaderInfo>\n <Flex item={{ grow: 1 }} container={{ justify: 'end' }}>\n {searchInput ? (\n <StyledAppHeaderSearchForm\n ref={setSearchContainer}\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n {!searchPage && <SearchInput {...searchInput} />}\n </StyledAppHeaderSearchForm>\n ) : (\n <StyledAppHeaderSpacer />\n )}\n </Flex>\n\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n >\n {operator.avatar}\n </AppShellOperator>\n </Flex>\n );\n }\n);\n\nexport default AppHeader;\n"]}
1
+ {"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":";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,EAAC,WAAW,YAElB,UAAU,GACS,CACvB,IACA,CACJ,IACI,GACa,EACtB,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YACnD,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,yBAAyB,IACxB,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAC,QAAQ,gBACD,WAAW,EACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACjC,eAAe,EAAE,eAAe,YAE/B,CAAC,UAAU,IAAI,KAAC,WAAW,OAAK,WAAW,GAAI,GACtB,CAC7B,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,KAAG,CAC1B,GACI,EAEP,KAAC,gBAAgB,IACf,EAAE,EAAE,uBAAuB,EAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,YAErC,QAAQ,CAAC,MAAM,GACC,IACd,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref, ElementType, useContext, useEffect } from 'react';\n\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport SearchInput from '../SearchInput';\nimport { useBreakpoint, useElement } from '../../hooks';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport { AppHeaderProps } from './AppShell.types';\nimport AppShellOperator from './Operator';\nimport ContextSwitcher from './ContextSwitcher';\nimport {\n StyledAppHeader,\n StyledAppHeaderInfo,\n StyledAppHeaderSearchForm,\n StyledAppHeaderSpacer,\n StyledAppHeaderText,\n StyledAppHeaderOperator\n} from './AppHeader.styles';\nimport AppShellContext from './AppShellContext';\n\nconst AppHeader: FunctionComponent<AppHeaderProps & ForwardProps> = forwardRef(\n (\n {\n appName,\n contextSwitcher: { contexts, onContextClick, label: contextSwitcherLabel } = {},\n fullImageSrc,\n imageSrc,\n href,\n onClick,\n portalName,\n target,\n appNameHidden,\n operator,\n searchInput,\n searchLabel,\n searchPage\n }: AppHeaderProps,\n ref: Ref<Element>\n ) => {\n const isMediumOrAbove = useBreakpoint('md');\n const [searchContainer, setSearchContainer] = useElement<HTMLElement>();\n const { drawerOpen, setSearchContainerEl } = useContext(AppShellContext);\n\n useEffect(() => {\n if (searchPage && searchContainer) {\n setSearchContainerEl(searchContainer);\n } else {\n setSearchContainerEl(null);\n }\n }, [searchPage, searchContainer, setSearchContainerEl]);\n\n let appInfoAs: ElementType = 'div';\n if (href) appInfoAs = 'a';\n else if (onClick) appInfoAs = BareButton;\n\n return (\n <Flex\n as={StyledAppHeader}\n container={{ alignItems: 'center', pad: 1 }}\n hideTitle={!isMediumOrAbove}\n drawerOpen={drawerOpen}\n ref={ref}\n >\n {contexts && contexts.length > 1 && onContextClick && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n />\n )}\n\n <StyledAppHeaderInfo centerLogo={!fullImageSrc}>\n <Flex\n container={{ inline: true, alignItems: 'center', gap: 1 }}\n as={appInfoAs}\n href={href}\n onClick={onClick}\n target={target}\n >\n <Image src={fullImageSrc || imageSrc} alt='' aria-hidden='true' />\n {isMediumOrAbove && (\n <>\n <StyledAppHeaderText\n as={appNameHidden ? VisuallyHiddenText : 'span'}\n variant='primary'\n >\n {appName}\n </StyledAppHeaderText>\n {portalName && (\n <StyledAppHeaderText\n as={appNameHidden ? VisuallyHiddenText : 'span'}\n variant='secondary'\n >\n {portalName}\n </StyledAppHeaderText>\n )}\n </>\n )}\n </Flex>\n </StyledAppHeaderInfo>\n <Flex item={{ grow: 1 }} container={{ justify: 'end' }}>\n {searchInput ? (\n <StyledAppHeaderSearchForm\n ref={setSearchContainer}\n role='search'\n aria-label={searchLabel}\n onSubmit={e => e.preventDefault()}\n isMediumOrAbove={isMediumOrAbove}\n >\n {!searchPage && <SearchInput {...searchInput} />}\n </StyledAppHeaderSearchForm>\n ) : (\n <StyledAppHeaderSpacer />\n )}\n </Flex>\n\n <AppShellOperator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n >\n {operator.avatar}\n </AppShellOperator>\n </Flex>\n );\n }\n);\n\nexport default AppHeader;\n"]}
@@ -1,4 +1,5 @@
1
1
  import { TextProps } from '../Text';
2
+ export declare const StyledContextSwitcher: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
3
  export declare const StyledAppHeaderInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
4
  centerLogo: boolean;
4
5
  }, never>;
@@ -12,5 +13,6 @@ export declare const StyledAppHeaderText: import("styled-components").StyledComp
12
13
  export declare const StyledAppHeaderOperator: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
13
14
  export declare const StyledAppHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {
14
15
  hideTitle: boolean;
16
+ drawerOpen: boolean;
15
17
  }, never>;
16
18
  //# sourceMappingURL=AppHeader.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAaA,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI1C,eAAO,MAAM,mBAAmB;gBAA4B,OAAO;SAuBjE,CAAC;AAIH,eAAO,MAAM,yBAAyB;qBAAkC,OAAO;SAwC9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,yGAEjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;aAA2B,SAAS,CAAC,SAAS,CAAC;SA0B9E,CAAC;AAIF,eAAO,MAAM,uBAAuB,4GAQnC,CAAC;AAIF,eAAO,MAAM,eAAe;eAA8B,OAAO;SA+C/D,CAAC"}
1
+ {"version":3,"file":"AppHeader.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAaA,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI1C,eAAO,MAAM,qBAAqB,yGAIhC,CAAC;AAIH,eAAO,MAAM,mBAAmB;gBAA4B,OAAO;SAuBjE,CAAC;AAIH,eAAO,MAAM,yBAAyB;qBAAkC,OAAO;SAwC9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,yGAEjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;aAA2B,SAAS,CAAC,SAAS,CAAC;SA0B9E,CAAC;AAIF,eAAO,MAAM,uBAAuB,4GAQnC,CAAC;AAIF,eAAO,MAAM,eAAe;eAA8B,OAAO;gBAAc,OAAO;SAqDrF,CAAC"}
@@ -10,7 +10,13 @@ import { StyledPopover } from '../Popover';
10
10
  import { StyledSearchInput } from '../SearchInput';
11
11
  import { StyledSearchButton, StyledSearchTextInput } from '../SearchInput/SearchInput.styles';
12
12
  import Text from '../Text';
13
- import { headerHeight } from './AppShell.styles';
13
+ import { headerHeight, navWidth } from './AppShell.styles';
14
+ export const StyledContextSwitcher = styled.div(({ theme }) => {
15
+ return css `
16
+ width: calc(${navWidth} - 2 * ${theme.base.spacing});
17
+ `;
18
+ });
19
+ StyledContextSwitcher.defaultProps = defaultThemeProp;
14
20
  export const StyledAppHeaderInfo = styled.div(({ centerLogo, theme }) => {
15
21
  return css `
16
22
  & > :first-child {
@@ -104,52 +110,56 @@ export const StyledAppHeaderOperator = styled.button(({ theme }) => css `
104
110
  }
105
111
  `);
106
112
  StyledAppHeaderOperator.defaultProps = defaultThemeProp;
107
- export const StyledAppHeader = styled.header(({ hideTitle, theme }) => {
113
+ export const StyledAppHeader = styled.header(({ hideTitle, drawerOpen, theme }) => {
108
114
  const headerColor = theme.components['app-shell'].header['background-color'];
109
115
  const contrastColor = tryCatch(() => readableColor(headerColor));
110
116
  const hoverColors = getHoverColors(mix(0.01, theme.base.palette.interactive, headerColor));
111
117
  return css `
112
- position: sticky;
113
- z-index: ${theme.base['z-index'].drawer};
114
- top: 0;
115
- gap: ${theme.base.spacing};
116
- max-width: 100%;
117
- height: ${headerHeight};
118
- background-color: ${headerColor};
119
- border-bottom: solid 0.0625rem ${theme.base.palette['border-line']};
118
+ position: sticky;
119
+ z-index: calc(${theme.base['z-index'].backdrop} - 1);
120
+ ${drawerOpen &&
121
+ css `
122
+ z-index: calc(${theme.base['z-index'].backdrop} - 2);
123
+ `}
124
+ top: 0;
125
+ gap: ${theme.base.spacing};
126
+ max-width: 100%;
127
+ height: ${headerHeight};
128
+ background-color: ${headerColor};
129
+ border-bottom: solid 0.0625rem ${theme.base.palette['border-line']};
120
130
 
121
- > :first-child {
122
- justify-self: flex-start;
123
- min-width: 33vw;
131
+ ${StyledAppHeaderInfo} {
132
+ justify-self: flex-start;
133
+ min-width: 33vw;
124
134
 
125
- ${hideTitle &&
135
+ ${hideTitle &&
126
136
  css `
127
- min-width: fit-content;
128
- `}
129
- }
137
+ min-width: fit-content;
138
+ `}
139
+ }
130
140
 
131
- > ${StyledAppHeaderOperator} {
132
- justify-self: flex-end;
141
+ > ${StyledAppHeaderOperator} {
142
+ justify-self: flex-end;
133
143
 
134
- + ${StyledPopover} {
135
- &,
136
- ${StyledMenuListContainer} {
137
- background-color: ${headerColor};
138
- }
144
+ + ${StyledPopover} {
145
+ &,
146
+ ${StyledMenuListContainer} {
147
+ background-color: ${headerColor};
148
+ }
139
149
 
140
- ${StyledMenuListContainer} li {
141
- color: ${contrastColor};
142
- background-color: transparent;
150
+ ${StyledMenuListContainer} li {
151
+ color: ${contrastColor};
152
+ background-color: transparent;
143
153
 
144
- &:hover,
145
- &[data-current='true'] {
146
- color: ${hoverColors.foreground};
147
- background-color: ${hoverColors.background};
154
+ &:hover,
155
+ &[data-current='true'] {
156
+ color: ${hoverColors.foreground};
157
+ background-color: ${hoverColors.background};
158
+ }
148
159
  }
149
160
  }
150
161
  }
151
- }
152
- `;
162
+ `;
153
163
  });
154
164
  StyledAppHeader.defaultProps = defaultThemeProp;
155
165
  //# sourceMappingURL=AppHeader.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC9F,OAAO,IAAmB,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAA0B,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/F,OAAO,GAAG,CAAA;;;;;;;;;;;;;MAaN,WAAW;;;QAGT,UAAU;QACZ,GAAG,CAAA;gCACuB,KAAK,CAAC,IAAI,CAAC,OAAO;OAC3C;;GAEJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,yBA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,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;;;;QAM9D,SAAS;QACX,GAAG,CAAA;;OAEF;;;QAGC,uBAAuB;;;UAGrB,aAAa;;UAEb,uBAAuB;8BACH,WAAW;;;UAG/B,uBAAuB;mBACd,aAAa;;;;;qBAKX,WAAW,CAAC,UAAU;gCACX,WAAW,CAAC,UAAU;;;;;GAKnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["/* AppHeader styles */\n\nimport { mix, readableColor, rgba } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { calculateFontSize, getHoverColors } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledImage } from '../Image';\nimport { StyledMenuListContainer } from '../Menu/Menu.styles';\nimport { StyledPopover } from '../Popover';\nimport { StyledSearchInput } from '../SearchInput';\nimport { StyledSearchButton, StyledSearchTextInput } from '../SearchInput/SearchInput.styles';\nimport Text, { TextProps } from '../Text';\n\nimport { headerHeight } from './AppShell.styles';\n\nexport const StyledAppHeaderInfo = styled.div<{ centerLogo: boolean }>(({ centerLogo, theme }) => {\n return css`\n & > :first-child {\n vertical-align: top;\n }\n\n & > a,\n & > button {\n cursor: pointer;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n ${StyledImage} {\n height: 1.625rem;\n\n ${centerLogo &&\n css`\n padding-inline-start: ${theme.base.spacing};\n `}\n }\n `;\n});\n\nStyledAppHeaderInfo.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearchForm = styled.form<{ isMediumOrAbove: boolean }>(\n ({ isMediumOrAbove, theme }) => {\n const headerColor = theme.components['app-shell'].header['background-color'];\n const contrastColor = tryCatch(() => readableColor(headerColor));\n\n return css`\n max-width: 33vw;\n min-width: 10rem;\n width: 100%;\n justify-self: center;\n margin-inline-start: 0;\n margin-inline-end: auto;\n transition: max-width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n ${!isMediumOrAbove &&\n css`\n max-width: 75%;\n min-width: 2rem;\n margin-inline-start: auto;\n\n &:not([focused]) {\n ${StyledSearchInput} {\n ${StyledSearchButton} {\n background: ${headerColor};\n color: ${contrastColor};\n }\n\n ${StyledSearchTextInput} {\n background: ${headerColor};\n }\n }\n }\n\n &:focus-within {\n /* max-width: 100%; */\n min-width: 10rem;\n }\n `}\n `;\n }\n);\n\nStyledAppHeaderSearchForm.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSpacer = styled.div`\n margin: auto;\n`;\n\nexport const StyledAppHeaderText = styled(Text)<{ variant: TextProps['variant'] }>(\n ({ theme, variant }) => {\n const contrastColor = tryCatch(() =>\n readableColor(theme.components['app-shell'].header['background-color'])\n );\n const secondaryColor = tryCatch(() =>\n rgba(\n contrastColor ?? theme.base.palette['foreground-color'],\n theme.base.transparency['transparent-2']\n )\n );\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${variant === 'secondary' ? secondaryColor : contrastColor};\n font-size: ${fontSize.s};\n\n ${variant !== 'secondary' &&\n css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `}\n `;\n }\n);\n\nStyledAppHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderOperator = styled.button(\n ({ theme }) => css`\n border-radius: 50%;\n\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `\n);\n\nStyledAppHeaderOperator.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeader = styled.header<{ hideTitle: boolean }>(({ hideTitle, theme }) => {\n const headerColor = theme.components['app-shell'].header['background-color'];\n const contrastColor = tryCatch(() => readableColor(headerColor));\n const hoverColors = getHoverColors(mix(0.01, theme.base.palette.interactive, headerColor));\n\n return css`\n position: sticky;\n z-index: ${theme.base['z-index'].drawer};\n top: 0;\n gap: ${theme.base.spacing};\n max-width: 100%;\n height: ${headerHeight};\n background-color: ${headerColor};\n border-bottom: solid 0.0625rem ${theme.base.palette['border-line']};\n\n > :first-child {\n justify-self: flex-start;\n min-width: 33vw;\n\n ${hideTitle &&\n css`\n min-width: fit-content;\n `}\n }\n\n > ${StyledAppHeaderOperator} {\n justify-self: flex-end;\n\n + ${StyledPopover} {\n &,\n ${StyledMenuListContainer} {\n background-color: ${headerColor};\n }\n\n ${StyledMenuListContainer} li {\n color: ${contrastColor};\n background-color: transparent;\n\n &:hover,\n &[data-current='true'] {\n color: ${hoverColors.foreground};\n background-color: ${hoverColors.background};\n }\n }\n }\n }\n `;\n});\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"AppHeader.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.styles.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAEtB,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC9F,OAAO,IAAmB,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAA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;AAExD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAC1C,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE;IACnC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC7E,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3F,OAAO,GAAG,CAAA;;sBAEQ,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;QAC5C,UAAU;QACZ,GAAG,CAAA;wBACe,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;OAC/C;;aAEM,KAAK,CAAC,IAAI,CAAC,OAAO;;gBAEf,YAAY;0BACF,WAAW;uCACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;QAEhE,mBAAmB;;;;UAIjB,SAAS;QACX,GAAG,CAAA;;SAEF;;;UAGC,uBAAuB;;;YAGrB,aAAa;;YAEb,uBAAuB;gCACH,WAAW;;;YAG/B,uBAAuB;qBACd,aAAa;;;;;uBAKX,WAAW,CAAC,UAAU;kCACX,WAAW,CAAC,UAAU;;;;;KAKnD,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["/* AppHeader styles */\n\nimport { mix, readableColor, rgba } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { calculateFontSize, getHoverColors } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledImage } from '../Image';\nimport { StyledMenuListContainer } from '../Menu/Menu.styles';\nimport { StyledPopover } from '../Popover';\nimport { StyledSearchInput } from '../SearchInput';\nimport { StyledSearchButton, StyledSearchTextInput } from '../SearchInput/SearchInput.styles';\nimport Text, { TextProps } from '../Text';\n\nimport { headerHeight, navWidth } from './AppShell.styles';\n\nexport const StyledContextSwitcher = styled.div(({ theme }) => {\n return css`\n width: calc(${navWidth} - 2 * ${theme.base.spacing});\n `;\n});\n\nStyledContextSwitcher.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderInfo = styled.div<{ centerLogo: boolean }>(({ centerLogo, theme }) => {\n return css`\n & > :first-child {\n vertical-align: top;\n }\n\n & > a,\n & > button {\n cursor: pointer;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n }\n\n ${StyledImage} {\n height: 1.625rem;\n\n ${centerLogo &&\n css`\n padding-inline-start: ${theme.base.spacing};\n `}\n }\n `;\n});\n\nStyledAppHeaderInfo.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSearchForm = styled.form<{ isMediumOrAbove: boolean }>(\n ({ isMediumOrAbove, theme }) => {\n const headerColor = theme.components['app-shell'].header['background-color'];\n const contrastColor = tryCatch(() => readableColor(headerColor));\n\n return css`\n max-width: 33vw;\n min-width: 10rem;\n width: 100%;\n justify-self: center;\n margin-inline-start: 0;\n margin-inline-end: auto;\n transition: max-width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n\n ${!isMediumOrAbove &&\n css`\n max-width: 75%;\n min-width: 2rem;\n margin-inline-start: auto;\n\n &:not([focused]) {\n ${StyledSearchInput} {\n ${StyledSearchButton} {\n background: ${headerColor};\n color: ${contrastColor};\n }\n\n ${StyledSearchTextInput} {\n background: ${headerColor};\n }\n }\n }\n\n &:focus-within {\n /* max-width: 100%; */\n min-width: 10rem;\n }\n `}\n `;\n }\n);\n\nStyledAppHeaderSearchForm.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderSpacer = styled.div`\n margin: auto;\n`;\n\nexport const StyledAppHeaderText = styled(Text)<{ variant: TextProps['variant'] }>(\n ({ theme, variant }) => {\n const contrastColor = tryCatch(() =>\n readableColor(theme.components['app-shell'].header['background-color'])\n );\n const secondaryColor = tryCatch(() =>\n rgba(\n contrastColor ?? theme.base.palette['foreground-color'],\n theme.base.transparency['transparent-2']\n )\n );\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ${variant === 'secondary' ? secondaryColor : contrastColor};\n font-size: ${fontSize.s};\n\n ${variant !== 'secondary' &&\n css`\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `}\n `;\n }\n);\n\nStyledAppHeaderText.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeaderOperator = styled.button(\n ({ theme }) => css`\n border-radius: 50%;\n\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `\n);\n\nStyledAppHeaderOperator.defaultProps = defaultThemeProp;\n\nexport const StyledAppHeader = styled.header<{ hideTitle: boolean; drawerOpen: boolean }>(\n ({ hideTitle, drawerOpen, theme }) => {\n const headerColor = theme.components['app-shell'].header['background-color'];\n const contrastColor = tryCatch(() => readableColor(headerColor));\n const hoverColors = getHoverColors(mix(0.01, theme.base.palette.interactive, headerColor));\n\n return css`\n position: sticky;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n ${drawerOpen &&\n css`\n z-index: calc(${theme.base['z-index'].backdrop} - 2);\n `}\n top: 0;\n gap: ${theme.base.spacing};\n max-width: 100%;\n height: ${headerHeight};\n background-color: ${headerColor};\n border-bottom: solid 0.0625rem ${theme.base.palette['border-line']};\n\n ${StyledAppHeaderInfo} {\n justify-self: flex-start;\n min-width: 33vw;\n\n ${hideTitle &&\n css`\n min-width: fit-content;\n `}\n }\n\n > ${StyledAppHeaderOperator} {\n justify-self: flex-end;\n\n + ${StyledPopover} {\n &,\n ${StyledMenuListContainer} {\n background-color: ${headerColor};\n }\n\n ${StyledMenuListContainer} li {\n color: ${contrastColor};\n background-color: transparent;\n\n &:hover,\n &[data-current='true'] {\n color: ${hoverColors.foreground};\n background-color: ${hoverColors.background};\n }\n }\n }\n }\n `;\n }\n);\n\nStyledAppHeader.defaultProps = defaultThemeProp;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAEH,MAAM,OAAO,CAAC;AAaf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuChD,OAAO,EACL,aAAa,EAMb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsG1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA2GhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAkU7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAEH,MAAM,OAAO,CAAC;AAaf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuChD,OAAO,EACL,aAAa,EAMb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsG1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA0IhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAsV7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -20,10 +20,11 @@ import Backdrop from '../Backdrop';
20
20
  import Tooltip from '../Tooltip/Tooltip';
21
21
  import SkipLinks from '../SkipLinks';
22
22
  import VisuallyHiddenText from '../VisuallyHiddenText';
23
+ import Progress from '../Progress';
23
24
  import AppShellContext, { AppShellDrawerContext } from './AppShellContext';
24
25
  import AppShellDrawer from './Drawer';
25
26
  import AppHeader from './AppHeader';
26
- import { StyledAppNav, StyledAppInfo, StyledCaseTypes, StyledScrollWrap, StyledUtils, StyledAppMain, StyledAppShellNavIcon, StyledNavCasesList, StyledAppEnvironment, StyledBannerRegion, StyledCountIcon, StyledUtilIconCount, StyledMobileNav, StyledAppShellTooltip, StyledAppShellToggleButton } from './AppShell.styles';
27
+ import { StyledAppNav, StyledAppInfo, StyledCaseTypes, StyledScrollWrap, StyledUtils, StyledAppMain, StyledNavCasesList, StyledAppEnvironment, StyledBannerRegion, StyledCountIcon, StyledUtilIconCount, StyledMobileNav, StyledAppShellTooltip, StyledAppShellToggleButton } from './AppShell.styles';
27
28
  import NavigationList from './NavigationList';
28
29
  import { AppShellSearch } from './AppShellSearch';
29
30
  registerIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);
@@ -38,7 +39,7 @@ const CaseTypes = ({ caseTypes }) => {
38
39
  return useMemo(() => (_jsx(StyledCaseTypes, { children: _jsx(NavigationList, { items: [
39
40
  {
40
41
  primary: t('app_shell_create'),
41
- visual: _jsx(Icon, { name: 'plus', as: StyledAppShellNavIcon }),
42
+ visual: _jsx(Icon, { name: 'plus' }),
42
43
  items: transformedCaseTypes
43
44
  }
44
45
  ] }) })), [caseTypes]);
@@ -53,7 +54,7 @@ const Links = (props) => {
53
54
  ...link,
54
55
  primary: link.name,
55
56
  'aria-current': link.active ? 'page' : null,
56
- visual: link.icon ? _jsx(Icon, { name: link.icon, as: StyledAppShellNavIcon }) : null,
57
+ visual: link.icon ? _jsx(Icon, { name: link.icon }) : null,
57
58
  onClick: link.links ? undefined : link.onClick,
58
59
  items: link.links ? mergedNavLinks(link.links) : undefined
59
60
  };
@@ -68,7 +69,7 @@ const Cases = (props) => {
68
69
  const { cases } = props;
69
70
  const setupCases = (items) => {
70
71
  return items.map((item) => {
71
- const { id, primary, secondary, visual = _jsx(Icon, { name: 'case-solid', as: StyledAppShellNavIcon }), active, onClick, onDismiss } = item;
72
+ const { id, primary, secondary, visual = _jsx(Icon, { name: 'case-solid' }), active, onClick, onDismiss } = item;
72
73
  return {
73
74
  id,
74
75
  'aria-current': active ? 'page' : undefined,
@@ -84,10 +85,11 @@ const Cases = (props) => {
84
85
  };
85
86
  return (_jsx(StyledNavCasesList, { children: _jsx(NavigationList, { items: setupCases(cases) }) }));
86
87
  };
87
- export const Utils = ({ operator, items, appHeader }) => {
88
- const { navOpen, navState } = useContext(AppShellContext);
88
+ export const Utils = ({ contextSwitcher = {}, operator, items, appHeader }) => {
89
+ const t = useI18n();
90
+ const { contexts, onContextClick, label: contextSwitcherLabel = t('switch_to') } = contextSwitcher;
91
+ const { navOpen, navState, drawerOpen, setDrawerOpen } = useContext(AppShellContext);
89
92
  const [item, setItem] = useState();
90
- const [drawerOpen, setDrawerOpen] = useState(false);
91
93
  useEffect(() => {
92
94
  if (drawerOpen && item) {
93
95
  setItem(items?.find((utilItem) => !isValidElement(utilItem) && utilItem.name === item.name));
@@ -102,6 +104,24 @@ export const Utils = ({ operator, items, appHeader }) => {
102
104
  items: operator.actions
103
105
  }
104
106
  ], [appHeader, operator.name, operator.avatar, operator.actions]);
107
+ const contextSwitcherUtilItem = useMemo(() => {
108
+ if (!appHeader && contexts && contexts?.length > 1 && !!onContextClick) {
109
+ return {
110
+ name: contextSwitcherLabel,
111
+ primary: contextSwitcherLabel,
112
+ visual: _jsx(Icon, { name: 'dot-9-solid' }),
113
+ drawerView: (_jsx(NavigationList, { items: contexts.map(context => ({
114
+ ...context,
115
+ primary: context.primary,
116
+ 'aria-current': !!context.selected,
117
+ visual: context.visual,
118
+ onClick: e => {
119
+ onContextClick(context.id, e);
120
+ }
121
+ })), singleSelect: true }))
122
+ };
123
+ }
124
+ }, [appHeader, contexts, contextSwitcherLabel, onContextClick]);
105
125
  const transform = useCallback((utilItem) => {
106
126
  const uItem = { ...utilItem };
107
127
  delete uItem.onDrawerClose;
@@ -114,7 +134,7 @@ export const Utils = ({ operator, items, appHeader }) => {
114
134
  },
115
135
  ...uItem,
116
136
  primary: utilItem.name,
117
- visual: utilItem.count ? (_jsxs(StyledUtilIconCount, { children: [utilItem.visual, _jsx(Count, { as: StyledCountIcon, variant: 'urgent', children: utilItem.count })] })) : (utilItem.visual),
137
+ visual: utilItem.count ? (_jsxs(StyledUtilIconCount, { children: [utilItem.visual, _jsx(Count, { as: StyledCountIcon, variant: 'urgent', id: `${utilItem.name}-count`, children: utilItem.count })] })) : (utilItem.visual),
118
138
  collapseItems: !navOpen
119
139
  };
120
140
  }, [navOpen]);
@@ -123,6 +143,7 @@ export const Utils = ({ operator, items, appHeader }) => {
123
143
  ...(items ?? []).map(uItem => {
124
144
  return isValidElement(uItem) ? uItem : transform(uItem);
125
145
  }),
146
+ ...(contextSwitcherUtilItem ? [transform(contextSwitcherUtilItem)] : []),
126
147
  ...operatorInfo
127
148
  ];
128
149
  }, [items, operatorInfo, transform]);
@@ -147,7 +168,7 @@ export const Utils = ({ operator, items, appHeader }) => {
147
168
  };
148
169
  const AppShell = forwardRef((props, ref) => {
149
170
  const t = useI18n();
150
- const { appInfo, searchInput, appHeader, searchPage, searchLabel = t('sitewide'), caseTypes, links, banners, environment: { name: envName, color: envColor } = {}, main, operator, utils, cases, defaultExpanded = false, collapsedHoverMenus = false, ...restProps } = props;
171
+ const { appInfo, contextSwitcher, searchInput, appHeader, searchPage, searchLabel = t('sitewide'), caseTypes, links, banners, progress, environment: { name: envName, color: envColor } = {}, main, operator, utils, cases, defaultExpanded = false, collapsedHoverMenus = false, ...restProps } = props;
151
172
  const { appName, portalName, href: appInfoHref, onClick: appInfoOnClick, imageSrc: logoSrc, appNameHidden, ...appInfoRestProps } = appInfo;
152
173
  let appInfoAs = 'div';
153
174
  if (appInfoHref)
@@ -159,6 +180,7 @@ const AppShell = forwardRef((props, ref) => {
159
180
  const navRef = useConsolidatedRef(ref);
160
181
  const [mobileNavOpen, setMobileNavOpen] = useState(false);
161
182
  const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);
183
+ const [drawerOpen, setDrawerOpen] = useState(false);
162
184
  const focusedImperatively = useRef(false);
163
185
  const [headerEl, setHeaderEl] = useElement();
164
186
  const [mobileHeaderEl, setMobileHeaderEl] = useElement();
@@ -224,7 +246,7 @@ const AppShell = forwardRef((props, ref) => {
224
246
  }, ref: isSmallOrAbove ? navRef : undefined, as: StyledAppNav, appHeader: showAppHeader, navOpen: mobileNavOpen, showEnv: !!envName, onFocus: onFocus, children: [envName && (_jsx(StyledAppEnvironment, { item: { shrink: 0 }, color: envColor ?? theme.base.colors.red['extra-light'], children: envName })), !showAppHeader && (_jsxs(_Fragment, { children: [_jsxs(StyledAppInfo, { as: Grid, forwardedAs: appInfoAs, variant: 'link', href: appInfoHref, onClick: appInfoOnClick, "aria-label": `${appName}${portalName ? ` - ${portalName}` : ''}`, ...appInfoRestProps, container: {
225
247
  alignItems: 'center',
226
248
  areas: portalName ? '"logo app" "logo portal"' : '"logo app"'
227
- }, ref: setAppInfoEl, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }), _jsx(Grid, { item: { area: 'app' }, as: appNameHidden ? VisuallyHiddenText : 'span', children: appName }), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: appNameHidden ? VisuallyHiddenText : 'span', children: portalName }))] }), navState === 'closed' && !appNameHidden && (_jsx(Tooltip, { target: appInfoEl, placement: 'right', as: StyledAppShellTooltip, showDelay: 'none', hideDelay: 'none', children: appName }))] })), searchInput && !showAppHeader && (_jsx(AppShellSearch, { searchLabel: searchLabel, collapsed: !mobileNavOpen && ['closed', 'closing'].includes(navState), searchInput: searchInput })), _jsxs(StyledScrollWrap, { onClick: isSmallOrAbove
249
+ }, ref: setAppInfoEl, icon: true, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }), _jsx(Grid, { item: { area: 'app' }, as: appNameHidden ? VisuallyHiddenText : 'span', children: appName }), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: appNameHidden ? VisuallyHiddenText : 'span', children: portalName }))] }), navState === 'closed' && !appNameHidden && (_jsx(Tooltip, { target: appInfoEl, placement: 'right', as: StyledAppShellTooltip, showDelay: 'none', hideDelay: 'none', children: appName }))] })), searchInput && !showAppHeader && (_jsx(AppShellSearch, { searchLabel: searchLabel, collapsed: !mobileNavOpen && ['closed', 'closing'].includes(navState), searchInput: searchInput })), _jsxs(StyledScrollWrap, { onClick: isSmallOrAbove
228
250
  ? () => {
229
251
  if (['closing', 'closed'].includes(navState)) {
230
252
  openNav(0);
@@ -233,11 +255,13 @@ const AppShell = forwardRef((props, ref) => {
233
255
  closeNav(0);
234
256
  }
235
257
  }
236
- : undefined, children: [caseTypes && caseTypes.length > 0 && _jsx(CaseTypes, { caseTypes: caseTypes }), links && _jsx(Links, { links: links }), cases && _jsx(Cases, { cases: cases })] }), _jsx(Utils, { appHeader: showAppHeader, operator: operator, items: utils }), !mobileNavOpen && (_jsxs(Flex, { container: { justify: 'center' }, children: [_jsx(StyledAppShellToggleButton, { icon: true, ref: setExpandCollapseEl, compact: true, variant: 'simple', onClick: () => {
258
+ : undefined, children: [caseTypes && caseTypes.length > 0 && _jsx(CaseTypes, { caseTypes: caseTypes }), links && _jsx(Links, { links: links }), cases && _jsx(Cases, { cases: cases })] }), _jsx(Utils, { appHeader: showAppHeader, operator: operator, contextSwitcher: contextSwitcher, items: utils }), !mobileNavOpen && (_jsxs(Flex, { container: { justify: 'center' }, children: [_jsx(StyledAppShellToggleButton, { icon: true, ref: setExpandCollapseEl, compact: true, variant: 'simple', onClick: () => {
237
259
  setNavState(navState === 'closed' ? 'open' : 'closed');
238
260
  }, open: ['open', 'opening'].includes(navState), "aria-label": navState === 'closed' ? t('expand') : t('collapse'), children: ['closed', 'closing'].includes(navState) ? (_jsx(Icon, { name: `arrow-micro-${end}` })) : (_jsx(Icon, { name: `arrow-micro-${start}` })) }), ['open', 'closed'].includes(navState) && (_jsx(Tooltip, { target: expandCollapseEl, placement: 'right', as: StyledAppShellTooltip, showDelay: 'none', hideDelay: 'none', children: navState === 'closed' ? t('expand') : t('collapse') }))] }))] }));
239
261
  return (_jsxs(AppShellContext.Provider, { value: useMemo(() => ({
240
262
  navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',
263
+ drawerOpen,
264
+ setDrawerOpen,
241
265
  collapsedHoverMenus,
242
266
  navState,
243
267
  focusedImperatively,
@@ -246,12 +270,12 @@ const AppShell = forwardRef((props, ref) => {
246
270
  searchContainerEl,
247
271
  setSearchContainerEl,
248
272
  mobileNavOpen
249
- }), [navState, mobileNavOpen, headerEl, mobileHeaderEl, searchContainerEl]), children: [_jsx(SkipLinks, { items: skipLinks }), showAppHeader && (_jsx(AppHeader, { ...appInfo, searchInput: searchInput, searchLabel: searchLabel, operator: operator, searchPage: searchPage, ref: setHeaderEl })), isSmallOrAbove ? (appShellJSX) : (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledMobileNav, container: { alignItems: 'center' }, ref: setMobileHeaderEl, children: _jsx(Button, { variant: 'simple', onClick: () => setMobileNavBackdrop(true), "aria-label": t('app_shell_open_nav'), icon: true, children: _jsx(Icon, { name: 'bars' }) }) }), _jsx(Backdrop, { open: mobileNavBackdrop, transitionSpeed: 'none', onAfterTransitionIn: () => setMobileNavOpen(true), onBeforeTransitionOut: () => setMobileNavOpen(false), onClick: e => {
273
+ }), [navState, drawerOpen, mobileNavOpen, headerEl, mobileHeaderEl, searchContainerEl]), children: [_jsx(SkipLinks, { items: skipLinks }), showAppHeader && (_jsx(AppHeader, { ...appInfo, contextSwitcher: contextSwitcher, searchInput: searchInput, searchLabel: searchLabel, operator: operator, searchPage: searchPage, ref: setHeaderEl })), isSmallOrAbove ? (appShellJSX) : (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledMobileNav, container: { alignItems: 'center' }, ref: setMobileHeaderEl, children: _jsx(Button, { variant: 'simple', onClick: () => setMobileNavBackdrop(true), "aria-label": t('app_shell_open_nav'), icon: true, children: _jsx(Icon, { name: 'bars' }) }) }), _jsx(Backdrop, { open: mobileNavBackdrop, transitionSpeed: 'none', onAfterTransitionIn: () => setMobileNavOpen(true), onBeforeTransitionOut: () => setMobileNavOpen(false), onClick: e => {
250
274
  if (e.currentTarget === e.target)
251
275
  setMobileNavOpen(false);
252
276
  }, children: _jsx(Drawer, { open: mobileNavOpen, onAfterClose: () => {
253
277
  setMobileNavBackdrop(false);
254
- }, position: 'fixed', placement: start, size: 'min(18.75rem, calc(100vw - 3.5rem))', nullWhenClosed: true, children: appShellJSX }) })] })), showMainContent && (_jsxs(StyledAppMain, { appHeader: showAppHeader, mobileNav: !isSmallOrAbove, headerOffset: isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight, navOpen: ['open', 'opening'].includes(navState), children: [banners && _jsx(StyledBannerRegion, { children: banners }), main] }))] }));
278
+ }, position: 'fixed', placement: start, size: 'min(18.75rem, calc(100vw - 3.5rem))', nullWhenClosed: true, children: appShellJSX }) })] })), showMainContent && (_jsxs(StyledAppMain, { appHeader: showAppHeader, mobileNav: !isSmallOrAbove, headerOffset: isSmallOrAbove ? headerEl?.offsetHeight : mobileHeaderEl?.offsetHeight, navOpen: ['open', 'opening'].includes(navState), "aria-busy": progress ? 'true' : 'false', children: [_jsx(Progress, { visible: !!progress, placement: 'local', message: typeof progress === 'string' ? progress : t('loading') }), banners && _jsx(StyledBannerRegion, { children: banners }), main] }))] }));
255
279
  });
256
280
  export default AppShell;
257
281
  //# sourceMappingURL=AppShell.js.map