@pega/cosmos-react-core 3.0.0-dev.15.0 → 3.0.0-dev.17.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 (475) hide show
  1. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppHeader.js +4 -6
  3. package/lib/components/AppShell/AppHeader.js.map +1 -1
  4. package/lib/components/AppShell/AppHeader.styles.d.ts +16 -0
  5. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -0
  6. package/lib/components/AppShell/AppHeader.styles.js +155 -0
  7. package/lib/components/AppShell/AppHeader.styles.js.map +1 -0
  8. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShell.js +44 -157
  10. package/lib/components/AppShell/AppShell.js.map +1 -1
  11. package/lib/components/AppShell/AppShell.styles.d.ts +7 -51
  12. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShell.styles.js +44 -535
  14. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.types.d.ts +16 -5
  16. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  18. package/lib/components/AppShell/AppShellContext.d.ts +2 -0
  19. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShellContext.js +2 -0
  21. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  22. package/lib/components/AppShell/AppShellList.js +3 -1
  23. package/lib/components/AppShell/AppShellList.js.map +1 -1
  24. package/lib/components/AppShell/AppShellList.styles.d.ts +19 -0
  25. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -0
  26. package/lib/components/AppShell/AppShellList.styles.js +141 -0
  27. package/lib/components/AppShell/AppShellList.styles.js.map +1 -0
  28. package/lib/components/AppShell/AppShellSearch.d.ts +10 -0
  29. package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -0
  30. package/lib/components/AppShell/AppShellSearch.js +32 -0
  31. package/lib/components/AppShell/AppShellSearch.js.map +1 -0
  32. package/lib/components/AppShell/AppShellSearch.styles.d.ts +8 -0
  33. package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -0
  34. package/lib/components/AppShell/AppShellSearch.styles.js +190 -0
  35. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -0
  36. package/lib/components/AppShell/Drawer.js +2 -2
  37. package/lib/components/AppShell/Drawer.js.map +1 -1
  38. package/lib/components/AppShell/Drawer.styles.d.ts +15 -0
  39. package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -0
  40. package/lib/components/AppShell/Drawer.styles.js +153 -0
  41. package/lib/components/AppShell/Drawer.styles.js.map +1 -0
  42. package/lib/components/AppShell/NavigationList.d.ts +5 -0
  43. package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
  44. package/lib/components/AppShell/NavigationList.js +123 -0
  45. package/lib/components/AppShell/NavigationList.js.map +1 -0
  46. package/lib/components/AppShell/NavigationListItemWrapper.d.ts +5 -0
  47. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -0
  48. package/lib/components/AppShell/NavigationListItemWrapper.js +109 -0
  49. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -0
  50. package/lib/components/AppShell/Operator.js +4 -4
  51. package/lib/components/AppShell/Operator.js.map +1 -1
  52. package/lib/components/Banner/Banner.d.ts.map +1 -1
  53. package/lib/components/Banner/Banner.js +2 -0
  54. package/lib/components/Banner/Banner.js.map +1 -1
  55. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  56. package/lib/components/Breadcrumbs/Breadcrumbs.js +10 -3
  57. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  58. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  59. package/lib/components/ComboBox/ComboBox.js +11 -2
  60. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  61. package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -1
  62. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  63. package/lib/components/ComboBox/ComboBox.types.d.ts +2 -0
  64. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  65. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  66. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  67. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +2 -2
  68. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  69. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +2 -0
  70. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
  71. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
  72. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  73. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -2
  74. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  75. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
  76. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
  77. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
  78. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  79. package/lib/components/CompositeInput/CompositeInput.js +4 -1
  80. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  81. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  82. package/lib/components/Currency/CurrencyInput.js +33 -6
  83. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  84. package/lib/components/Currency/utils.js +1 -1
  85. package/lib/components/Currency/utils.js.map +1 -1
  86. package/lib/components/DateTime/DateTime.types.d.ts +2 -0
  87. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  88. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  89. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  90. package/lib/components/DateTime/Input/DateInput.js +13 -4
  91. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  92. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  93. package/lib/components/DateTime/Input/DateTimeInput.js +17 -4
  94. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  95. package/lib/components/DateTime/Input/WeekInput.js +1 -1
  96. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  97. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  98. package/lib/components/DateTime/Picker/Calendar.js +2 -2
  99. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  100. package/lib/components/DateTime/Picker/Calendar.styles.js +2 -2
  101. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  102. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  103. package/lib/components/DateTime/Picker/TimePicker.js +10 -5
  104. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  105. package/lib/components/Dialog/Dialog.d.ts +30 -0
  106. package/lib/components/Dialog/Dialog.d.ts.map +1 -0
  107. package/lib/components/Dialog/Dialog.js +148 -0
  108. package/lib/components/Dialog/Dialog.js.map +1 -0
  109. package/lib/components/Dialog/index.d.ts +3 -0
  110. package/lib/components/Dialog/index.d.ts.map +1 -0
  111. package/lib/components/Dialog/index.js +3 -0
  112. package/lib/components/Dialog/index.js.map +1 -0
  113. package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  114. package/lib/components/ExpandCollapse/ExpandCollapse.js +1 -1
  115. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  116. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  117. package/lib/components/FieldGroup/FieldGroup.js +28 -26
  118. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  119. package/lib/components/FormControl/FormControl.d.ts +6 -2
  120. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  121. package/lib/components/FormControl/FormControl.js +60 -35
  122. package/lib/components/FormControl/FormControl.js.map +1 -1
  123. package/lib/components/FormField/FormField.d.ts.map +1 -1
  124. package/lib/components/FormField/FormField.js +65 -5
  125. package/lib/components/FormField/FormField.js.map +1 -1
  126. package/lib/components/Icon/iconNames.d.ts +1 -1
  127. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  128. package/lib/components/Icon/iconNames.js +2 -0
  129. package/lib/components/Icon/iconNames.js.map +1 -1
  130. package/lib/components/Icon/icons/ai-assist.icon.js +1 -1
  131. package/lib/components/Icon/icons/ai-assist.icon.js.map +1 -1
  132. package/lib/components/Icon/icons/align-center.icon.js +1 -1
  133. package/lib/components/Icon/icons/align-center.icon.js.map +1 -1
  134. package/lib/components/Icon/icons/align-left.icon.js +1 -1
  135. package/lib/components/Icon/icons/align-left.icon.js.map +1 -1
  136. package/lib/components/Icon/icons/align-right.icon.js +1 -1
  137. package/lib/components/Icon/icons/align-right.icon.js.map +1 -1
  138. package/lib/components/Icon/icons/arrow-left.icon.js +1 -1
  139. package/lib/components/Icon/icons/arrow-left.icon.js.map +1 -1
  140. package/lib/components/Icon/icons/arrow-micro-down.icon.js +1 -1
  141. package/lib/components/Icon/icons/arrow-micro-down.icon.js.map +1 -1
  142. package/lib/components/Icon/icons/arrow-micro-left.icon.js +1 -1
  143. package/lib/components/Icon/icons/arrow-micro-left.icon.js.map +1 -1
  144. package/lib/components/Icon/icons/arrow-micro-right.icon.js +1 -1
  145. package/lib/components/Icon/icons/arrow-micro-right.icon.js.map +1 -1
  146. package/lib/components/Icon/icons/arrow-micro-up-down.icon.js +1 -1
  147. package/lib/components/Icon/icons/arrow-micro-up-down.icon.js.map +1 -1
  148. package/lib/components/Icon/icons/arrow-micro-up.icon.js +1 -1
  149. package/lib/components/Icon/icons/arrow-micro-up.icon.js.map +1 -1
  150. package/lib/components/Icon/icons/arrow-up-down.icon.js +1 -1
  151. package/lib/components/Icon/icons/arrow-up-down.icon.js.map +1 -1
  152. package/lib/components/Icon/icons/bars.icon.js +1 -1
  153. package/lib/components/Icon/icons/bars.icon.js.map +1 -1
  154. package/lib/components/Icon/icons/bell-solid.icon.js +1 -1
  155. package/lib/components/Icon/icons/bell-solid.icon.js.map +1 -1
  156. package/lib/components/Icon/icons/bell.icon.js +1 -1
  157. package/lib/components/Icon/icons/bell.icon.js.map +1 -1
  158. package/lib/components/Icon/icons/box-4-solid.icon.js +1 -1
  159. package/lib/components/Icon/icons/box-4-solid.icon.js.map +1 -1
  160. package/lib/components/Icon/icons/box-4.icon.js +1 -1
  161. package/lib/components/Icon/icons/box-4.icon.js.map +1 -1
  162. package/lib/components/Icon/icons/calendar-range.icon.js +1 -1
  163. package/lib/components/Icon/icons/calendar-range.icon.js.map +1 -1
  164. package/lib/components/Icon/icons/calendar-solid.icon.js +1 -1
  165. package/lib/components/Icon/icons/calendar-solid.icon.js.map +1 -1
  166. package/lib/components/Icon/icons/caret-down.icon.js +1 -1
  167. package/lib/components/Icon/icons/caret-down.icon.js.map +1 -1
  168. package/lib/components/Icon/icons/caret-left.icon.js +1 -1
  169. package/lib/components/Icon/icons/caret-left.icon.js.map +1 -1
  170. package/lib/components/Icon/icons/caret-right.icon.js +1 -1
  171. package/lib/components/Icon/icons/caret-right.icon.js.map +1 -1
  172. package/lib/components/Icon/icons/caret-up.icon.js +1 -1
  173. package/lib/components/Icon/icons/caret-up.icon.js.map +1 -1
  174. package/lib/components/Icon/icons/carrot.icon.d.ts +4 -0
  175. package/lib/components/Icon/icons/carrot.icon.d.ts.map +1 -0
  176. package/lib/components/Icon/icons/carrot.icon.js +6 -0
  177. package/lib/components/Icon/icons/carrot.icon.js.map +1 -0
  178. package/lib/components/Icon/icons/case-solid.icon.js +1 -1
  179. package/lib/components/Icon/icons/case-solid.icon.js.map +1 -1
  180. package/lib/components/Icon/icons/case.icon.js +1 -1
  181. package/lib/components/Icon/icons/case.icon.js.map +1 -1
  182. package/lib/components/Icon/icons/chain.icon.js +1 -1
  183. package/lib/components/Icon/icons/chain.icon.js.map +1 -1
  184. package/lib/components/Icon/icons/chat-solid.icon.js +1 -1
  185. package/lib/components/Icon/icons/chat-solid.icon.js.map +1 -1
  186. package/lib/components/Icon/icons/chat.icon.js +1 -1
  187. package/lib/components/Icon/icons/chat.icon.js.map +1 -1
  188. package/lib/components/Icon/icons/check.icon.js +1 -1
  189. package/lib/components/Icon/icons/check.icon.js.map +1 -1
  190. package/lib/components/Icon/icons/clipboard-plus-solid.icon.js +1 -1
  191. package/lib/components/Icon/icons/clipboard-plus-solid.icon.js.map +1 -1
  192. package/lib/components/Icon/icons/clipboard-plus.icon.js +1 -1
  193. package/lib/components/Icon/icons/clipboard-plus.icon.js.map +1 -1
  194. package/lib/components/Icon/icons/clock-solid.icon.js +1 -1
  195. package/lib/components/Icon/icons/clock-solid.icon.js.map +1 -1
  196. package/lib/components/Icon/icons/clock.icon.js +1 -1
  197. package/lib/components/Icon/icons/clock.icon.js.map +1 -1
  198. package/lib/components/Icon/icons/code.icon.js +1 -1
  199. package/lib/components/Icon/icons/code.icon.js.map +1 -1
  200. package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts +1 -1
  201. package/lib/components/Icon/icons/dataviz-string-field.icon.js +2 -2
  202. package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
  203. package/lib/components/Icon/icons/dock.icon.js +1 -1
  204. package/lib/components/Icon/icons/dock.icon.js.map +1 -1
  205. package/lib/components/Icon/icons/dot-9-solid.icon.js +1 -1
  206. package/lib/components/Icon/icons/dot-9-solid.icon.js.map +1 -1
  207. package/lib/components/Icon/icons/dot-9.icon.js +1 -1
  208. package/lib/components/Icon/icons/dot-9.icon.js.map +1 -1
  209. package/lib/components/Icon/icons/download.icon.js +1 -1
  210. package/lib/components/Icon/icons/download.icon.js.map +1 -1
  211. package/lib/components/Icon/icons/drag.icon.js +1 -1
  212. package/lib/components/Icon/icons/drag.icon.js.map +1 -1
  213. package/lib/components/Icon/icons/eye-off-solid.icon.js +1 -1
  214. package/lib/components/Icon/icons/eye-off-solid.icon.js.map +1 -1
  215. package/lib/components/Icon/icons/eye-off.icon.js +1 -1
  216. package/lib/components/Icon/icons/eye-off.icon.js.map +1 -1
  217. package/lib/components/Icon/icons/face-blank-solid.icon.d.ts.map +1 -1
  218. package/lib/components/Icon/icons/face-blank-solid.icon.js +1 -1
  219. package/lib/components/Icon/icons/face-blank-solid.icon.js.map +1 -1
  220. package/lib/components/Icon/icons/face-blank.icon.d.ts.map +1 -1
  221. package/lib/components/Icon/icons/face-blank.icon.js +1 -1
  222. package/lib/components/Icon/icons/face-blank.icon.js.map +1 -1
  223. package/lib/components/Icon/icons/face-happy-solid.icon.d.ts.map +1 -1
  224. package/lib/components/Icon/icons/face-happy-solid.icon.js +1 -1
  225. package/lib/components/Icon/icons/face-happy-solid.icon.js.map +1 -1
  226. package/lib/components/Icon/icons/face-happy.icon.d.ts.map +1 -1
  227. package/lib/components/Icon/icons/face-happy.icon.js +1 -1
  228. package/lib/components/Icon/icons/face-happy.icon.js.map +1 -1
  229. package/lib/components/Icon/icons/face-sad-solid.icon.d.ts.map +1 -1
  230. package/lib/components/Icon/icons/face-sad-solid.icon.js +1 -1
  231. package/lib/components/Icon/icons/face-sad-solid.icon.js.map +1 -1
  232. package/lib/components/Icon/icons/face-sad.icon.d.ts.map +1 -1
  233. package/lib/components/Icon/icons/face-sad.icon.js +1 -1
  234. package/lib/components/Icon/icons/face-sad.icon.js.map +1 -1
  235. package/lib/components/Icon/icons/fast-forward-solid.icon.js +1 -1
  236. package/lib/components/Icon/icons/fast-forward-solid.icon.js.map +1 -1
  237. package/lib/components/Icon/icons/filetype-text.icon.d.ts.map +1 -1
  238. package/lib/components/Icon/icons/filetype-text.icon.js +2 -2
  239. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  240. package/lib/components/Icon/icons/filter-on.icon.js +1 -1
  241. package/lib/components/Icon/icons/filter-on.icon.js.map +1 -1
  242. package/lib/components/Icon/icons/filter.icon.js +1 -1
  243. package/lib/components/Icon/icons/filter.icon.js.map +1 -1
  244. package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js +1 -1
  245. package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js.map +1 -1
  246. package/lib/components/Icon/icons/folder-hierarchy.icon.js +1 -1
  247. package/lib/components/Icon/icons/folder-hierarchy.icon.js.map +1 -1
  248. package/lib/components/Icon/icons/forward-all-solid.icon.js +1 -1
  249. package/lib/components/Icon/icons/forward-all-solid.icon.js.map +1 -1
  250. package/lib/components/Icon/icons/forward-all.icon.js +1 -1
  251. package/lib/components/Icon/icons/forward-all.icon.js.map +1 -1
  252. package/lib/components/Icon/icons/forward-solid.icon.js +1 -1
  253. package/lib/components/Icon/icons/forward-solid.icon.js.map +1 -1
  254. package/lib/components/Icon/icons/forward.icon.js +1 -1
  255. package/lib/components/Icon/icons/forward.icon.js.map +1 -1
  256. package/lib/components/Icon/icons/galaxy.icon.d.ts.map +1 -1
  257. package/lib/components/Icon/icons/galaxy.icon.js +2 -2
  258. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  259. package/lib/components/Icon/icons/globe-solid.icon.js +1 -1
  260. package/lib/components/Icon/icons/globe-solid.icon.js.map +1 -1
  261. package/lib/components/Icon/icons/globe.icon.js +1 -1
  262. package/lib/components/Icon/icons/globe.icon.js.map +1 -1
  263. package/lib/components/Icon/icons/hand.icon.js +1 -1
  264. package/lib/components/Icon/icons/hand.icon.js.map +1 -1
  265. package/lib/components/Icon/icons/help-solid.icon.js +1 -1
  266. package/lib/components/Icon/icons/help-solid.icon.js.map +1 -1
  267. package/lib/components/Icon/icons/help.icon.js +1 -1
  268. package/lib/components/Icon/icons/help.icon.js.map +1 -1
  269. package/lib/components/Icon/icons/home-solid.icon.js +1 -1
  270. package/lib/components/Icon/icons/home-solid.icon.js.map +1 -1
  271. package/lib/components/Icon/icons/home.icon.js +1 -1
  272. package/lib/components/Icon/icons/home.icon.js.map +1 -1
  273. package/lib/components/Icon/icons/information-solid.icon.js +1 -1
  274. package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
  275. package/lib/components/Icon/icons/information.icon.js +1 -1
  276. package/lib/components/Icon/icons/information.icon.js.map +1 -1
  277. package/lib/components/Icon/icons/list-number.icon.d.ts.map +1 -1
  278. package/lib/components/Icon/icons/list-number.icon.js +2 -2
  279. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  280. package/lib/components/Icon/icons/list.icon.d.ts.map +1 -1
  281. package/lib/components/Icon/icons/list.icon.js +2 -2
  282. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  283. package/lib/components/Icon/icons/mail-solid.icon.js +1 -1
  284. package/lib/components/Icon/icons/mail-solid.icon.js.map +1 -1
  285. package/lib/components/Icon/icons/mail.icon.js +1 -1
  286. package/lib/components/Icon/icons/mail.icon.js.map +1 -1
  287. package/lib/components/Icon/icons/minus.icon.js +1 -1
  288. package/lib/components/Icon/icons/minus.icon.js.map +1 -1
  289. package/lib/components/Icon/icons/more.icon.js +1 -1
  290. package/lib/components/Icon/icons/more.icon.js.map +1 -1
  291. package/lib/components/Icon/icons/move-left-solid.icon.js +1 -1
  292. package/lib/components/Icon/icons/move-left-solid.icon.js.map +1 -1
  293. package/lib/components/Icon/icons/move-right-solid.icon.js +1 -1
  294. package/lib/components/Icon/icons/move-right-solid.icon.js.map +1 -1
  295. package/lib/components/Icon/icons/open.icon.js +1 -1
  296. package/lib/components/Icon/icons/open.icon.js.map +1 -1
  297. package/lib/components/Icon/icons/paper-clip.icon.js +1 -1
  298. package/lib/components/Icon/icons/paper-clip.icon.js.map +1 -1
  299. package/lib/components/Icon/icons/phone-solid.icon.js +1 -1
  300. package/lib/components/Icon/icons/phone-solid.icon.js.map +1 -1
  301. package/lib/components/Icon/icons/phone.icon.js +1 -1
  302. package/lib/components/Icon/icons/phone.icon.js.map +1 -1
  303. package/lib/components/Icon/icons/picture-solid.icon.js +1 -1
  304. package/lib/components/Icon/icons/picture-solid.icon.js.map +1 -1
  305. package/lib/components/Icon/icons/picture.icon.js +1 -1
  306. package/lib/components/Icon/icons/picture.icon.js.map +1 -1
  307. package/lib/components/Icon/icons/placeholder.icon.d.ts +4 -0
  308. package/lib/components/Icon/icons/placeholder.icon.d.ts.map +1 -0
  309. package/lib/components/Icon/icons/placeholder.icon.js +6 -0
  310. package/lib/components/Icon/icons/placeholder.icon.js.map +1 -0
  311. package/lib/components/Icon/icons/plus.icon.js +1 -1
  312. package/lib/components/Icon/icons/plus.icon.js.map +1 -1
  313. package/lib/components/Icon/icons/polaris-solid.icon.js +1 -1
  314. package/lib/components/Icon/icons/polaris-solid.icon.js.map +1 -1
  315. package/lib/components/Icon/icons/polaris.icon.js +1 -1
  316. package/lib/components/Icon/icons/polaris.icon.js.map +1 -1
  317. package/lib/components/Icon/icons/qr.icon.js +1 -1
  318. package/lib/components/Icon/icons/qr.icon.js.map +1 -1
  319. package/lib/components/Icon/icons/reply-all-solid.icon.js +1 -1
  320. package/lib/components/Icon/icons/reply-all-solid.icon.js.map +1 -1
  321. package/lib/components/Icon/icons/reply-all.icon.js +1 -1
  322. package/lib/components/Icon/icons/reply-all.icon.js.map +1 -1
  323. package/lib/components/Icon/icons/reply-solid.icon.js +1 -1
  324. package/lib/components/Icon/icons/reply-solid.icon.js.map +1 -1
  325. package/lib/components/Icon/icons/reply.icon.js +1 -1
  326. package/lib/components/Icon/icons/reply.icon.js.map +1 -1
  327. package/lib/components/Icon/icons/reset.icon.js +1 -1
  328. package/lib/components/Icon/icons/reset.icon.js.map +1 -1
  329. package/lib/components/Icon/icons/robot-happy-solid.icon.js +1 -1
  330. package/lib/components/Icon/icons/robot-happy-solid.icon.js.map +1 -1
  331. package/lib/components/Icon/icons/robot-happy.icon.js +1 -1
  332. package/lib/components/Icon/icons/robot-happy.icon.js.map +1 -1
  333. package/lib/components/Icon/icons/row-insert.icon.js +1 -1
  334. package/lib/components/Icon/icons/row-insert.icon.js.map +1 -1
  335. package/lib/components/Icon/icons/row.icon.js +1 -1
  336. package/lib/components/Icon/icons/row.icon.js.map +1 -1
  337. package/lib/components/Icon/icons/scale-down.icon.js +1 -1
  338. package/lib/components/Icon/icons/scale-down.icon.js.map +1 -1
  339. package/lib/components/Icon/icons/scale-up-solid.icon.js +1 -1
  340. package/lib/components/Icon/icons/scale-up-solid.icon.js.map +1 -1
  341. package/lib/components/Icon/icons/scale-up.icon.js +1 -1
  342. package/lib/components/Icon/icons/scale-up.icon.js.map +1 -1
  343. package/lib/components/Icon/icons/script.icon.d.ts +1 -1
  344. package/lib/components/Icon/icons/script.icon.d.ts.map +1 -1
  345. package/lib/components/Icon/icons/script.icon.js +3 -3
  346. package/lib/components/Icon/icons/script.icon.js.map +1 -1
  347. package/lib/components/Icon/icons/search-analytics-solid.icon.js +1 -1
  348. package/lib/components/Icon/icons/search-analytics-solid.icon.js.map +1 -1
  349. package/lib/components/Icon/icons/search-analytics.icon.js +1 -1
  350. package/lib/components/Icon/icons/search-analytics.icon.js.map +1 -1
  351. package/lib/components/Icon/icons/search.icon.js +1 -1
  352. package/lib/components/Icon/icons/search.icon.js.map +1 -1
  353. package/lib/components/Icon/icons/send-solid.icon.js +1 -1
  354. package/lib/components/Icon/icons/send-solid.icon.js.map +1 -1
  355. package/lib/components/Icon/icons/send.icon.js +1 -1
  356. package/lib/components/Icon/icons/send.icon.js.map +1 -1
  357. package/lib/components/Icon/icons/slideshow-solid.icon.js +1 -1
  358. package/lib/components/Icon/icons/slideshow-solid.icon.js.map +1 -1
  359. package/lib/components/Icon/icons/slideshow.icon.js +1 -1
  360. package/lib/components/Icon/icons/slideshow.icon.js.map +1 -1
  361. package/lib/components/Icon/icons/snow.icon.js +1 -1
  362. package/lib/components/Icon/icons/snow.icon.js.map +1 -1
  363. package/lib/components/Icon/icons/speaker-solid.icon.js +1 -1
  364. package/lib/components/Icon/icons/speaker-solid.icon.js.map +1 -1
  365. package/lib/components/Icon/icons/speaker.icon.js +1 -1
  366. package/lib/components/Icon/icons/speaker.icon.js.map +1 -1
  367. package/lib/components/Icon/icons/star-solid.icon.js +1 -1
  368. package/lib/components/Icon/icons/star-solid.icon.js.map +1 -1
  369. package/lib/components/Icon/icons/star.icon.js +1 -1
  370. package/lib/components/Icon/icons/star.icon.js.map +1 -1
  371. package/lib/components/Icon/icons/target-solid.icon.js +1 -1
  372. package/lib/components/Icon/icons/target-solid.icon.js.map +1 -1
  373. package/lib/components/Icon/icons/target.icon.js +1 -1
  374. package/lib/components/Icon/icons/target.icon.js.map +1 -1
  375. package/lib/components/Icon/icons/thumbs-up-solid.icon.js +1 -1
  376. package/lib/components/Icon/icons/thumbs-up-solid.icon.js.map +1 -1
  377. package/lib/components/Icon/icons/thumbs-up.icon.js +1 -1
  378. package/lib/components/Icon/icons/thumbs-up.icon.js.map +1 -1
  379. package/lib/components/Icon/icons/times.icon.js +1 -1
  380. package/lib/components/Icon/icons/times.icon.js.map +1 -1
  381. package/lib/components/Icon/icons/trash-solid.icon.js +1 -1
  382. package/lib/components/Icon/icons/trash-solid.icon.js.map +1 -1
  383. package/lib/components/Icon/icons/trash.icon.js +1 -1
  384. package/lib/components/Icon/icons/trash.icon.js.map +1 -1
  385. package/lib/components/Icon/icons/twitter.icon.js +1 -1
  386. package/lib/components/Icon/icons/twitter.icon.js.map +1 -1
  387. package/lib/components/Icon/icons/undock.icon.js +1 -1
  388. package/lib/components/Icon/icons/undock.icon.js.map +1 -1
  389. package/lib/components/Icon/icons/user-solid.icon.js +1 -1
  390. package/lib/components/Icon/icons/user-solid.icon.js.map +1 -1
  391. package/lib/components/Icon/icons/user-star-solid.icon.js +1 -1
  392. package/lib/components/Icon/icons/user-star-solid.icon.js.map +1 -1
  393. package/lib/components/Icon/icons/user-star.icon.js +1 -1
  394. package/lib/components/Icon/icons/user-star.icon.js.map +1 -1
  395. package/lib/components/Icon/icons/user.icon.js +1 -1
  396. package/lib/components/Icon/icons/user.icon.js.map +1 -1
  397. package/lib/components/Icon/icons/warn-solid.icon.js +1 -1
  398. package/lib/components/Icon/icons/warn-solid.icon.js.map +1 -1
  399. package/lib/components/Icon/icons/warn.icon.js +1 -1
  400. package/lib/components/Icon/icons/warn.icon.js.map +1 -1
  401. package/lib/components/Input/Input.d.ts.map +1 -1
  402. package/lib/components/Input/Input.js +13 -2
  403. package/lib/components/Input/Input.js.map +1 -1
  404. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  405. package/lib/components/ListToolbar/ListToolbar.js +16 -10
  406. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  407. package/lib/components/ListToolbar/ListToolbar.types.d.ts +8 -1
  408. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  409. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  410. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  411. package/lib/components/MetaList/MetaList.js +13 -10
  412. package/lib/components/MetaList/MetaList.js.map +1 -1
  413. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  414. package/lib/components/Number/NumberInput.js +25 -7
  415. package/lib/components/Number/NumberInput.js.map +1 -1
  416. package/lib/components/Number/NumberInput.styles.d.ts +6 -2
  417. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  418. package/lib/components/Number/NumberInput.styles.js +4 -2
  419. package/lib/components/Number/NumberInput.styles.js.map +1 -1
  420. package/lib/components/Number/NumberInput.types.d.ts +2 -0
  421. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  422. package/lib/components/Number/NumberInput.types.js.map +1 -1
  423. package/lib/components/Number/utils.d.ts.map +1 -1
  424. package/lib/components/Number/utils.js +1 -5
  425. package/lib/components/Number/utils.js.map +1 -1
  426. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  427. package/lib/components/Phone/PhoneInput.js +12 -3
  428. package/lib/components/Phone/PhoneInput.js.map +1 -1
  429. package/lib/components/SearchInput/SearchInput.d.ts +5 -0
  430. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  431. package/lib/components/SearchInput/SearchInput.js +14 -4
  432. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  433. package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -0
  434. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  435. package/lib/components/SearchInput/SearchInput.styles.js +6 -0
  436. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
  437. package/lib/components/Select/Select.d.ts +2 -0
  438. package/lib/components/Select/Select.d.ts.map +1 -1
  439. package/lib/components/Select/Select.js +4 -3
  440. package/lib/components/Select/Select.js.map +1 -1
  441. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  442. package/lib/components/Tabs/TabPanel.js +1 -7
  443. package/lib/components/Tabs/TabPanel.js.map +1 -1
  444. package/lib/components/Text/Text.js +2 -2
  445. package/lib/components/Text/Text.js.map +1 -1
  446. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  447. package/lib/components/TextArea/TextArea.js +4 -2
  448. package/lib/components/TextArea/TextArea.js.map +1 -1
  449. package/lib/components/Tooltip/Tooltip.d.ts +5 -0
  450. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  451. package/lib/components/Tooltip/Tooltip.js +22 -5
  452. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  453. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  454. package/lib/hooks/useActiveDescendant.js +6 -3
  455. package/lib/hooks/useActiveDescendant.js.map +1 -1
  456. package/lib/hooks/useI18n.d.ts +16 -5
  457. package/lib/hooks/useI18n.d.ts.map +1 -1
  458. package/lib/hooks/useInputFormatter.d.ts.map +1 -1
  459. package/lib/hooks/useInputFormatter.js +5 -0
  460. package/lib/hooks/useInputFormatter.js.map +1 -1
  461. package/lib/i18n/default.d.ts +16 -5
  462. package/lib/i18n/default.d.ts.map +1 -1
  463. package/lib/i18n/default.js +18 -6
  464. package/lib/i18n/default.js.map +1 -1
  465. package/lib/i18n/i18n.d.ts +32 -10
  466. package/lib/i18n/i18n.d.ts.map +1 -1
  467. package/lib/index.d.ts +2 -0
  468. package/lib/index.d.ts.map +1 -1
  469. package/lib/index.js +2 -0
  470. package/lib/index.js.map +1 -1
  471. package/lib/theme/theme.d.ts +54 -0
  472. package/lib/theme/theme.d.ts.map +1 -1
  473. package/lib/theme/themeDefinition.json +33 -1
  474. package/lib/theme/themeOverrides.schema.json +9 -0
  475. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYlD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAsF/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYlD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAmF/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,19 +1,17 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useRef, useState, useContext, useEffect } from 'react';
2
+ import { forwardRef, useRef, useContext, useEffect } from 'react';
3
3
  import Flex from '../Flex';
4
4
  import Image from '../Image';
5
5
  import SearchInput from '../SearchInput';
6
- import { useBreakpoint, useFocusWithin } from '../../hooks';
6
+ import { useBreakpoint } from '../../hooks';
7
7
  import BareButton from '../Button/BareButton';
8
8
  import AppShellOperator from './Operator';
9
- import { StyledAppHeader, StyledAppHeaderInfo, StyledAppHeaderSearchForm, StyledAppHeaderSpacer, StyledAppHeaderText, StyledAppHeaderOperator } from './AppShell.styles';
9
+ import { StyledAppHeader, StyledAppHeaderInfo, StyledAppHeaderSearchForm, StyledAppHeaderSpacer, StyledAppHeaderText, StyledAppHeaderOperator } from './AppHeader.styles';
10
10
  import AppShellContext from './AppShellContext';
11
11
  const AppHeader = forwardRef(({ appName, fullImageSrc, imageSrc, href, onClick, portalName, target, operator, searchInput, searchLabel, searchPage }, ref) => {
12
12
  const isMediumOrAbove = useBreakpoint('md');
13
13
  const searchRef = useRef(null);
14
- const [searchFocused, setSearchFocused] = useState(false);
15
14
  const { setSearchContainerEl } = useContext(AppShellContext);
16
- useFocusWithin([searchRef], setSearchFocused);
17
15
  useEffect(() => {
18
16
  if (searchPage && searchRef.current) {
19
17
  setSearchContainerEl(searchRef.current);
@@ -27,7 +25,7 @@ const AppHeader = forwardRef(({ appName, fullImageSrc, imageSrc, href, onClick,
27
25
  appInfoAs = 'a';
28
26
  else if (onClick)
29
27
  appInfoAs = BareButton;
30
- return (_jsxs(Flex, { as: StyledAppHeader, container: { alignItems: 'center', pad: 1 }, hideTitle: !isMediumOrAbove && searchFocused, 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 || !searchFocused) && (_jsxs(_Fragment, { children: [_jsx(StyledAppHeaderText, { children: appName }), _jsx(StyledAppHeaderText, { variant: 'secondary', children: portalName })] }))] }) }), _jsx(Flex, { item: { grow: 1 }, container: { justify: 'end' }, children: searchInput ? (_jsx(StyledAppHeaderSearchForm, { ref: searchRef, 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 })] }));
28
+ 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, { children: appName }), _jsx(StyledAppHeaderText, { variant: 'secondary', children: portalName })] }))] }) }), _jsx(Flex, { item: { grow: 1 }, container: { justify: 'end' }, children: searchInput ? (_jsx(StyledAppHeaderSearchForm, { ref: searchRef, 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 })] }));
31
29
  });
32
30
  export default AppHeader;
33
31
  //# sourceMappingURL=AppHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,MAAM,EACN,QAAQ,EAER,UAAU,EACV,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,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,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,YAErC,QAAQ,CAAC,MAAM,GACC,IACd,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n Ref,\n useRef,\n useState,\n ElementType,\n useContext,\n useEffect\n} from 'react';\n\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport SearchInput from '../SearchInput';\nimport { useBreakpoint, useFocusWithin } from '../../hooks';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\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 './AppShell.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 operator,\n searchInput,\n searchLabel,\n searchPage\n }: AppHeaderProps,\n ref: Ref<Element>\n ) => {\n const isMediumOrAbove = useBreakpoint('md');\n const searchRef = useRef<HTMLFormElement>(null);\n const [searchFocused, setSearchFocused] = useState(false);\n const { setSearchContainerEl } = useContext(AppShellContext);\n\n useFocusWithin([searchRef], setSearchFocused);\n\n useEffect(() => {\n if (searchPage && searchRef.current) {\n setSearchContainerEl(searchRef.current);\n } else {\n setSearchContainerEl(null);\n }\n }, [searchPage, searchRef]);\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 && searchFocused}\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 || !searchFocused) && (\n <>\n <StyledAppHeaderText>{appName}</StyledAppHeaderText>\n <StyledAppHeaderText variant='secondary'>{portalName}</StyledAppHeaderText>\n </>\n )}\n </Flex>\n </StyledAppHeaderInfo>\n <Flex item={{ grow: 1 }} container={{ justify: 'end' }}>\n {searchInput ? (\n <StyledAppHeaderSearchForm\n ref={searchRef}\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":";AAAA,OAAO,EACL,UAAU,EAGV,MAAM,EAEN,UAAU,EACV,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAG9C,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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EAAE,iBAAa,MAAM,GAAG,EACjE,eAAe,IAAI,CAClB,8BACE,KAAC,mBAAmB,cAAE,OAAO,GAAuB,EACpD,KAAC,mBAAmB,IAAC,OAAO,EAAC,WAAW,YAAE,UAAU,GAAuB,IAC1E,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,SAAS,EACd,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 {\n forwardRef,\n FunctionComponent,\n Ref,\n useRef,\n ElementType,\n useContext,\n useEffect\n} from 'react';\n\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport SearchInput from '../SearchInput';\nimport { useBreakpoint } from '../../hooks';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\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 operator,\n searchInput,\n searchLabel,\n searchPage\n }: AppHeaderProps,\n ref: Ref<Element>\n ) => {\n const isMediumOrAbove = useBreakpoint('md');\n const searchRef = useRef<HTMLFormElement>(null);\n const { setSearchContainerEl } = useContext(AppShellContext);\n\n useEffect(() => {\n if (searchPage && searchRef.current) {\n setSearchContainerEl(searchRef.current);\n } else {\n setSearchContainerEl(null);\n }\n }, [searchPage, searchRef]);\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>{appName}</StyledAppHeaderText>\n <StyledAppHeaderText variant='secondary'>{portalName}</StyledAppHeaderText>\n </>\n )}\n </Flex>\n </StyledAppHeaderInfo>\n <Flex item={{ grow: 1 }} container={{ justify: 'end' }}>\n {searchInput ? (\n <StyledAppHeaderSearchForm\n ref={searchRef}\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"]}
@@ -0,0 +1,16 @@
1
+ import { TextProps } from '../Text';
2
+ export declare const StyledAppHeaderInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
+ centerLogo: boolean;
4
+ }, never>;
5
+ export declare const StyledAppHeaderSearchForm: import("styled-components").StyledComponent<"form", import("styled-components").DefaultTheme, {
6
+ isMediumOrAbove: boolean;
7
+ }, never>;
8
+ export declare const StyledAppHeaderSpacer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const StyledAppHeaderText: import("styled-components").StyledComponent<import("react").FunctionComponent<TextProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {
10
+ variant: TextProps['variant'];
11
+ }, never>;
12
+ export declare const StyledAppHeaderOperator: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const StyledAppHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {
14
+ hideTitle: boolean;
15
+ }, never>;
16
+ //# sourceMappingURL=AppHeader.styles.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,155 @@
1
+ /* AppHeader styles */
2
+ import { mix, readableColor, rgba } from 'polished';
3
+ import styled, { css } from 'styled-components';
4
+ import { calculateFontSize, getHoverColors } from '../../styles';
5
+ import { defaultThemeProp } from '../../theme';
6
+ import { tryCatch } from '../../utils';
7
+ import { StyledImage } from '../Image';
8
+ import { StyledMenuListContainer } from '../Menu/Menu.styles';
9
+ import { StyledPopover } from '../Popover';
10
+ import { StyledSearchInput } from '../SearchInput';
11
+ import { StyledSearchButton, StyledSearchTextInput } from '../SearchInput/SearchInput.styles';
12
+ import Text from '../Text';
13
+ import { headerHeight } from './AppShell.styles';
14
+ export const StyledAppHeaderInfo = styled.div(({ centerLogo, theme }) => {
15
+ return css `
16
+ & > :first-child {
17
+ vertical-align: top;
18
+ }
19
+
20
+ & > a,
21
+ & > button {
22
+ cursor: pointer;
23
+ text-decoration: none;
24
+ user-select: none;
25
+ -webkit-user-select: none;
26
+ }
27
+
28
+ ${StyledImage} {
29
+ height: 1.625rem;
30
+
31
+ ${centerLogo &&
32
+ css `
33
+ padding-inline-start: ${theme.base.spacing};
34
+ `}
35
+ }
36
+ `;
37
+ });
38
+ StyledAppHeaderInfo.defaultProps = defaultThemeProp;
39
+ export const StyledAppHeaderSearchForm = styled.form(({ isMediumOrAbove, theme }) => {
40
+ const headerColor = theme.components['app-shell'].header['background-color'];
41
+ const contrastColor = tryCatch(() => readableColor(headerColor));
42
+ return css `
43
+ max-width: 33vw;
44
+ min-width: 10rem;
45
+ width: 100%;
46
+ justify-self: center;
47
+ margin-inline-start: 0;
48
+ margin-inline-end: auto;
49
+ transition: max-width ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
50
+
51
+ ${!isMediumOrAbove &&
52
+ css `
53
+ max-width: 75%;
54
+ min-width: 2rem;
55
+ margin-inline-start: auto;
56
+
57
+ &:not([focused]) {
58
+ ${StyledSearchInput} {
59
+ ${StyledSearchButton} {
60
+ background: ${headerColor};
61
+ color: ${contrastColor};
62
+ }
63
+
64
+ ${StyledSearchTextInput} {
65
+ background: ${headerColor};
66
+ }
67
+ }
68
+ }
69
+
70
+ &:focus-within {
71
+ /* max-width: 100%; */
72
+ min-width: 10rem;
73
+ }
74
+ `}
75
+ `;
76
+ });
77
+ StyledAppHeaderSearchForm.defaultProps = defaultThemeProp;
78
+ export const StyledAppHeaderSpacer = styled.div `
79
+ margin: auto;
80
+ `;
81
+ export const StyledAppHeaderText = styled(Text)(({ theme, variant }) => {
82
+ const contrastColor = tryCatch(() => readableColor(theme.components['app-shell'].header['background-color']));
83
+ const secondaryColor = tryCatch(() => rgba(contrastColor ?? theme.base.palette['foreground-color'], theme.base.transparency['transparent-2']));
84
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
85
+ return css `
86
+ text-overflow: ellipsis;
87
+ overflow: hidden;
88
+ white-space: nowrap;
89
+ color: ${variant === 'secondary' ? secondaryColor : contrastColor};
90
+ font-size: ${fontSize.s};
91
+
92
+ ${variant !== 'secondary' &&
93
+ css `
94
+ font-weight: ${theme.base['font-weight']['semi-bold']};
95
+ `}
96
+ `;
97
+ });
98
+ StyledAppHeaderText.defaultProps = defaultThemeProp;
99
+ export const StyledAppHeaderOperator = styled.button(({ theme }) => css `
100
+ border-radius: 50%;
101
+
102
+ :focus {
103
+ box-shadow: ${theme.base.shadow.focus};
104
+ }
105
+ `);
106
+ StyledAppHeaderOperator.defaultProps = defaultThemeProp;
107
+ export const StyledAppHeader = styled.header(({ hideTitle, theme }) => {
108
+ const headerColor = theme.components['app-shell'].header['background-color'];
109
+ const contrastColor = tryCatch(() => readableColor(headerColor));
110
+ const hoverColors = getHoverColors(mix(0.01, theme.base.palette.interactive, headerColor));
111
+ 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']};
120
+
121
+ > :first-child {
122
+ justify-self: flex-start;
123
+ min-width: 33vw;
124
+
125
+ ${hideTitle &&
126
+ css `
127
+ min-width: fit-content;
128
+ `}
129
+ }
130
+
131
+ > ${StyledAppHeaderOperator} {
132
+ justify-self: flex-end;
133
+
134
+ + ${StyledPopover} {
135
+ &,
136
+ ${StyledMenuListContainer} {
137
+ background-color: ${headerColor};
138
+ }
139
+
140
+ ${StyledMenuListContainer} li {
141
+ color: ${contrastColor};
142
+ background-color: transparent;
143
+
144
+ &:hover,
145
+ &[data-current='true'] {
146
+ color: ${hoverColors.foreground};
147
+ background-color: ${hoverColors.background};
148
+ }
149
+ }
150
+ }
151
+ }
152
+ `;
153
+ });
154
+ StyledAppHeader.defaultProps = defaultThemeProp;
155
+ //# sourceMappingURL=AppHeader.styles.js.map
@@ -0,0 +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,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AAW,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;;eAEG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM;;WAEhC,KAAK,CAAC,IAAI,CAAC,OAAO;;cAEf,YAAY;wBACF,WAAW;qCACE,KAAK,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 +1 @@
1
- {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAWjB,EAAE,EAIH,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,aAAa,CAAC;AAgD5D,OAAO,EACL,aAAa,EAQb,UAAU,EACX,MAAM,kBAAkB,CAAC;AA8V1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAmGhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAyR7D,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;AAuG1B,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CA4GhC,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAgU7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,11 +1,8 @@
1
- import { createElement as _createElement } from "react";
2
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { forwardRef, useState, useCallback, useEffect, useMemo, useContext, useRef, useLayoutEffect } from 'react';
2
+ import { forwardRef, useState, useCallback, useEffect, useMemo, useContext, useRef } from 'react';
4
3
  import Flex from '../Flex';
5
4
  import Link from '../Link';
6
5
  import Count from '../Badges/Count';
7
- import BareButton from '../Button/BareButton';
8
- import SearchInput from '../SearchInput';
9
6
  import Icon, { registerIcon } from '../Icon';
10
7
  import * as timesIcon from '../Icon/icons/times.icon';
11
8
  import * as plusIcon from '../Icon/icons/plus.icon';
@@ -13,140 +10,22 @@ import * as caseSolidIcon from '../Icon/icons/case-solid.icon';
13
10
  import * as barsIcon from '../Icon/icons/bars.icon';
14
11
  import * as caretLeftIcon from '../Icon/icons/caret-left.icon';
15
12
  import * as caretRightIcon from '../Icon/icons/caret-right.icon';
16
- import Text from '../Text';
17
13
  import Image from '../Image';
18
- import ExpandCollapse from '../ExpandCollapse';
19
- import { useFocusWithin, useI18n, useBreakpoint, useConsolidatedRef, useDirection, useTheme, useElement, useTransitionState, useArrows, useUID, useAfterInitialEffect } from '../../hooks';
14
+ import { useI18n, useBreakpoint, useConsolidatedRef, useDirection, useTheme, useElement, useTransitionState, useAfterInitialEffect } from '../../hooks';
20
15
  import { openCloseStates } from '../../hooks/useTransitionState';
21
16
  import Grid from '../Grid';
22
17
  import Button from '../Button';
23
18
  import Drawer from '../Drawer';
24
19
  import Backdrop from '../Backdrop';
25
- import { documentIsAvailable } from '../../utils';
20
+ import Tooltip from '../Tooltip/Tooltip';
26
21
  import AppShellContext from './AppShellContext';
27
22
  import AppShellDrawer from './Drawer';
28
- import AppShellOperator from './Operator';
29
23
  import AppHeader from './AppHeader';
30
24
  import SkipNavigation from './SkipNavigation';
31
- import { StyledAppNav, StyledAppInfo, StyledSearchForm, StyledCaseTypes, StyledScrollWrap, StyledUtils, StyledNavList, StyledNestedNavList, StyledNavListItem, StyledNavListMenuButton, StyledAppMain, StyledCaseClose, StyledAppShellNavIcon, StyledNavCasesList, StyledAppEnvironment, StyledBannerRegion, StyledCountIcon, StyledUtilIconCount, StyledMobileNav } from './AppShell.styles';
25
+ import { StyledAppNav, StyledAppInfo, StyledCaseTypes, StyledScrollWrap, StyledUtils, StyledAppMain, StyledAppShellNavIcon, StyledNavCasesList, StyledAppEnvironment, StyledBannerRegion, StyledCountIcon, StyledUtilIconCount, StyledMobileNav, StyledAppshellTooltip, StyledAppshellToggleButton } from './AppShell.styles';
26
+ import NavigationList from './NavigationList';
27
+ import { AppShellSearch } from './AppShellSearch';
32
28
  registerIcon(timesIcon, plusIcon, caseSolidIcon, barsIcon, caretRightIcon, caretLeftIcon);
33
- const NavComponents = {
34
- List(props) {
35
- const { items = [], nestedList, collapsed, id } = props;
36
- let Component = StyledNavList;
37
- let ItemComponent;
38
- let fwdProps = {
39
- collapsed: !!collapsed
40
- };
41
- const { base: { animation } } = useTheme();
42
- if (nestedList) {
43
- fwdProps = {
44
- as: ExpandCollapse,
45
- forwardedAs: 'ul',
46
- nullWhenCollapsed: true,
47
- transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,
48
- ...fwdProps
49
- };
50
- Component = StyledNestedNavList;
51
- }
52
- if (Array.isArray(items) && items.length > 0) {
53
- ItemComponent = NavComponents.Menu;
54
- }
55
- else {
56
- ItemComponent = NavComponents.ListItem;
57
- }
58
- return (_jsx(Component, { ...(nestedList ? { role: 'menu', id } : {}), ...fwdProps, children: items?.map(item => {
59
- if (item.items && item.items.length > 0) {
60
- ItemComponent = NavComponents.Menu;
61
- }
62
- else {
63
- ItemComponent = NavComponents.ListItem;
64
- }
65
- return _jsx(ItemComponent, { isMenuItem: nestedList, ...item }, item.id || item.primary);
66
- }) }));
67
- },
68
- ListItem(props) {
69
- const { navOpen } = useContext(AppShellContext);
70
- const { visual, primary, secondary, href, onClick, items, dismissible = false, onDismiss, active, actions, forwardedRef, isMenuItem, ...restProps } = props;
71
- const t = useI18n();
72
- const compProps = {
73
- onClick,
74
- href
75
- };
76
- let Component;
77
- if (actions) {
78
- Component = AppShellOperator;
79
- compProps.actions = actions;
80
- compProps.as = StyledNavListMenuButton;
81
- compProps.popover = {
82
- placement: 'right-end',
83
- modifiers: [
84
- {
85
- name: 'offset',
86
- options: { offset: [-12, -16] }
87
- },
88
- {
89
- name: 'flip',
90
- options: {
91
- boundary: documentIsAvailable ? document.body : undefined,
92
- fallbackPlacements: ['top-end']
93
- }
94
- }
95
- ]
96
- };
97
- }
98
- else if (href) {
99
- Component = Link;
100
- }
101
- else if (onClick) {
102
- Component = BareButton;
103
- }
104
- else {
105
- Component = 'div';
106
- }
107
- const itemRef = useConsolidatedRef(forwardedRef);
108
- useEffect(() => {
109
- if (!navOpen && actions) {
110
- const node = document.getElementsByTagName('body')[0];
111
- const clickEvent = document.createEvent('MouseEvent');
112
- clickEvent.initEvent('mousedown', true, true);
113
- node.dispatchEvent(clickEvent);
114
- }
115
- if (navOpen && isMenuItem && itemRef.current?.parentElement?.matches(':first-child'))
116
- itemRef.current?.focus();
117
- }, [navOpen]);
118
- const { end } = useDirection();
119
- return (_createElement(StyledNavListItem, { ...restProps, key: primary, nestedListCollapsed: true },
120
- _jsxs(Component, { ...compProps, ref: itemRef, ...(isMenuItem ? { tabIndex: -1, role: 'menuitem', 'aria-label': primary } : {}), children: [visual, secondary ? (_jsxs(Flex, { container: { direction: 'column', alignItems: 'start' }, children: [_jsx("span", { children: primary }), _jsx(Text, { variant: 'secondary', children: secondary })] })) : (_jsx("span", { children: primary })), actions && _jsx(Icon, { name: `caret-${end}`, as: StyledAppShellNavIcon })] }),
121
- dismissible && (_jsx(Button, { icon: true, variant: 'simple', as: StyledCaseClose, onClick: onDismiss, "aria-label": t('dismiss_case'), children: _jsx(Icon, { name: 'times' }) }))));
122
- },
123
- Menu(props) {
124
- const { navOpen } = useContext(AppShellContext);
125
- const { visual, primary, secondary, href, onClick, items, onDismiss, active, actions, forwardedRef, ...restProps } = props;
126
- const uid = useUID();
127
- const [collapsed, setCollapsed] = useState(true);
128
- const toggleCollapsed = useCallback(() => {
129
- setCollapsed(state => !state);
130
- }, []);
131
- const itemRef = useConsolidatedRef(forwardedRef);
132
- const onKeyDown = useCallback(({ key }) => {
133
- if (key === 'Escape') {
134
- setCollapsed(true);
135
- itemRef.current?.focus();
136
- }
137
- }, []);
138
- const menuRef = useRef(null);
139
- useArrows(menuRef, { selector: '[role="menuitem"]', cycle: true });
140
- useFocusWithin([menuRef], useCallback(isFocused => {
141
- if (!isFocused)
142
- setCollapsed(true);
143
- }, []));
144
- const { end } = useDirection();
145
- return (_createElement(StyledNavListItem, { ...restProps, key: primary, nestedListCollapsed: collapsed, onKeyDown: onKeyDown, ref: menuRef },
146
- _jsxs(BareButton, { id: uid, ref: itemRef, tabIndex: collapsed ? 0 : -1, "aria-expanded": !collapsed, "aria-controls": `${uid}-menu`, "aria-label": primary, onClick: toggleCollapsed, children: [visual, secondary ? (_jsxs(Flex, { container: { direction: 'column', alignItems: 'start' }, children: [_jsx("span", { children: primary }), _jsx(Text, { variant: 'secondary', children: secondary })] })) : (_jsx("span", { children: primary })), _jsx(Icon, { name: `caret-${end}`, as: StyledAppShellNavIcon })] }),
147
- _jsx(NavComponents.List, { id: `${uid}-menu`, nestedList: true, items: items, collapsed: !navOpen || collapsed })));
148
- }
149
- };
150
29
  const CaseTypes = ({ caseTypes }) => {
151
30
  const t = useI18n();
152
31
  const transformedCaseTypes = caseTypes.map(caseType => {
@@ -155,7 +34,7 @@ const CaseTypes = ({ caseTypes }) => {
155
34
  primary: caseType.name
156
35
  };
157
36
  });
158
- return useMemo(() => (_jsx(StyledCaseTypes, { children: _jsx(NavComponents.List, { items: [
37
+ return useMemo(() => (_jsx(StyledCaseTypes, { children: _jsx(NavigationList, { items: [
159
38
  {
160
39
  primary: t('app_shell_create'),
161
40
  visual: _jsx(Icon, { name: 'plus', as: StyledAppShellNavIcon }),
@@ -182,7 +61,7 @@ const Links = (props) => {
182
61
  useEffect(() => {
183
62
  setTransformedLinks(mergedNavLinks(links));
184
63
  }, [links]);
185
- return (_jsx("div", { children: _jsx(NavComponents.List, { items: transformedLinks }) }));
64
+ return (_jsx("div", { children: _jsx(NavigationList, { items: transformedLinks }) }));
186
65
  };
187
66
  const Cases = (props) => {
188
67
  const { cases } = props;
@@ -202,7 +81,7 @@ const Cases = (props) => {
202
81
  };
203
82
  });
204
83
  };
205
- return (_jsx(StyledNavCasesList, { children: _jsx(NavComponents.List, { items: setupCases(cases) }) }));
84
+ return (_jsx(StyledNavCasesList, { children: _jsx(NavigationList, { items: setupCases(cases) }) }));
206
85
  };
207
86
  // TODO: Need to add back re-focus support to drawer.
208
87
  export const Utils = ({ operator, items, appHeader }) => {
@@ -211,15 +90,20 @@ export const Utils = ({ operator, items, appHeader }) => {
211
90
  const [item, setItem] = useState();
212
91
  const [activeUtilItem, setActiveUtilItem] = useState('');
213
92
  const returnFocusRef = useRef(null);
93
+ const { navOpen } = useContext(AppShellContext);
94
+ const [expanded, setExpanded] = useState(false);
95
+ const toggleExpanded = useCallback(() => {
96
+ setExpanded(state => !state);
97
+ }, []);
214
98
  const operatorInfo = useMemo(() => appHeader
215
99
  ? []
216
100
  : [
217
101
  {
218
102
  primary: operator.name,
219
103
  visual: operator.avatar,
220
- actions: operator.actions
104
+ items: operator.actions
221
105
  }
222
- ], [appHeader, operator.name, operator.avatar, operator.actions]);
106
+ ], [appHeader, operator.name, operator.avatar, operator.actions, expanded, navOpen]);
223
107
  // TODO: Can this be a memo instead of a state and an effect?
224
108
  const mergedUtilItems = (drawerItems) => {
225
109
  return drawerItems?.map((drawerItem) => {
@@ -230,10 +114,12 @@ export const Utils = ({ operator, items, appHeader }) => {
230
114
  setItem(drawerItem);
231
115
  setActiveUtilItem(drawerItem.name);
232
116
  }
117
+ toggleExpanded();
233
118
  },
234
119
  ...drawerItem,
235
120
  primary: drawerItem.name,
236
- visual: drawerItem.count ? (_jsxs(StyledUtilIconCount, { children: [drawerItem.visual, _jsx(Count, { as: StyledCountIcon, variant: 'urgent', children: drawerItem.count })] })) : (drawerItem.visual)
121
+ visual: drawerItem.count ? (_jsxs(StyledUtilIconCount, { children: [drawerItem.visual, _jsx(Count, { as: StyledCountIcon, variant: 'urgent', children: drawerItem.count })] })) : (drawerItem.visual),
122
+ collapseItems: !expanded || !navOpen
237
123
  };
238
124
  });
239
125
  };
@@ -263,18 +149,18 @@ export const Utils = ({ operator, items, appHeader }) => {
263
149
  returnFocusRef?.current?.focus();
264
150
  }
265
151
  }, [drawerOpen]);
266
- return (_jsxs(_Fragment, { children: [_jsx(StyledUtils, { children: _jsx(NavComponents.List
152
+ return (_jsxs(_Fragment, { children: [_jsx(StyledUtils, { children: _jsx(NavigationList
267
153
  // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.
268
154
  , {
269
155
  // Pull onDrawerOpen and onDrawerClose off to avoid DOM passthrough warning.
270
- items: transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util) }) }), item && (_jsx(AppShellDrawer, { content: item.drawerView, header: item.drawerHeader || item.name, onDrawerClose: () => {
156
+ items: transformedLinks.map(({ onDrawerOpen, onDrawerClose, ...util }) => util), collapsed: true }) }), item && (_jsx(AppShellDrawer, { content: item.drawerView, header: item.drawerHeader || item.name, onDrawerClose: () => {
271
157
  setItem(undefined);
272
158
  item.onDrawerClose?.();
273
159
  }, onDrawerOpen: item.onDrawerOpen }))] }));
274
160
  };
275
161
  const AppShell = forwardRef((props, ref) => {
276
162
  const { appInfo, searchInput, appHeader, searchPage, searchLabel = 'Sitewide', // FIXME: TR
277
- caseTypes, links, banners, environment: { name: envName, color: envColor } = {}, main, operator, utils, cases, ...restProps } = props;
163
+ caseTypes, links, banners, environment: { name: envName, color: envColor } = {}, main, operator, utils, cases, defaultExpanded = false, ...restProps } = props;
278
164
  const { appName, portalName, href: appInfoHref, onClick: appInfoOnClick, imageSrc: logoSrc, ...appInfoRestProps } = appInfo;
279
165
  let appInfoAs = 'div';
280
166
  if (appInfoHref)
@@ -287,13 +173,15 @@ const AppShell = forwardRef((props, ref) => {
287
173
  const theme = useTheme();
288
174
  const navRef = useConsolidatedRef(ref);
289
175
  const [drawerOpen, setDrawerOpen] = useState(false);
176
+ const [menuOpen, setMenuOpen] = useState(false);
290
177
  const [mobileNavOpen, setMobileNavOpen] = useState(false);
291
178
  const [mobileNavBackdrop, setMobileNavBackdrop] = useState(false);
292
179
  const [refocusEl, setRefocusEl] = useState(null);
293
180
  const focusedImperatively = useRef(false);
294
181
  const [headerEl, setHeaderEl] = useElement();
295
182
  const [mobileHeaderEl, setMobileHeaderEl] = useElement();
296
- const isXlOrAbove = useBreakpoint('xl');
183
+ const [appInfoEl, setAppInfoEl] = useElement();
184
+ const [expandCollapseEl, setExpandCollapseEl] = useElement();
297
185
  const isSmallOrAbove = useBreakpoint('sm');
298
186
  const showAppHeader = !!appHeader && isSmallOrAbove;
299
187
  const showMainContent = showAppHeader ? headerEl || mobileHeaderEl : true;
@@ -305,7 +193,7 @@ const AppShell = forwardRef((props, ref) => {
305
193
  ref: navRef,
306
194
  property: 'width',
307
195
  states: openCloseStates,
308
- defaultState: isXlOrAbove ? 'open' : 'closed'
196
+ defaultState: defaultExpanded ? 'open' : 'closed'
309
197
  });
310
198
  const openNav = useCallback((delay = 0) => {
311
199
  if (closeNavTimeoutId.current)
@@ -322,26 +210,12 @@ const AppShell = forwardRef((props, ref) => {
322
210
  }, delay);
323
211
  }, []);
324
212
  const onFocus = useCallback(() => {
325
- if (!focusedImperatively.current && isSmallOrAbove)
326
- openNav();
327
213
  focusedImperatively.current = false;
328
214
  }, [openNav, isSmallOrAbove]);
329
215
  const onKeydown = useCallback(({ key }) => {
330
216
  if (key === 'Escape')
331
217
  setMobileNavOpen(false);
332
218
  }, []);
333
- useFocusWithin([navRef], useCallback((isFocused, navElement) => {
334
- if (!isFocused && !navElement?.matches(':hover'))
335
- closeNav();
336
- }, [closeNav]));
337
- useLayoutEffect(() => {
338
- if (isXlOrAbove) {
339
- openNav();
340
- }
341
- else {
342
- closeNav();
343
- }
344
- }, [isXlOrAbove, openNav, closeNav]);
345
219
  useEffect(() => {
346
220
  if (navState === 'closed' || navState === 'closing')
347
221
  setDrawerOpen(false);
@@ -363,13 +237,26 @@ const AppShell = forwardRef((props, ref) => {
363
237
  const appShellJSX = (_jsxs(Flex, { ...restProps, container: {
364
238
  direction: 'column',
365
239
  justify: 'between'
366
- }, ref: navRef, as: StyledAppNav, appHeader: showAppHeader, navOpen: mobileNavOpen, showEnv: !!envName, onFocus: onFocus, onMouseEnter: isSmallOrAbove && !isXlOrAbove ? () => openNav(200) : undefined, onMouseLeave: isSmallOrAbove && !isXlOrAbove ? () => closeNav(200) : undefined, children: [envName && (_jsx(StyledAppEnvironment, { item: { shrink: 0 }, color: envColor ?? theme.base.colors.red['extra-light'], children: envName })), !showAppHeader && (_jsxs(StyledAppInfo, { as: Grid, forwardedAs: appInfoAs, variant: 'link', href: appInfoHref, onClick: appInfoOnClick, "aria-label": `${appName}${portalName ? ` - ${portalName}` : ''}`, ...appInfoRestProps, container: {
367
- alignItems: 'center',
368
- areas: portalName ? '"logo app" "logo portal"' : '"logo app"'
369
- }, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }), _jsx(Grid, { item: { area: 'app' }, as: 'span', children: appName }), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: 'span', children: portalName }))] })), searchInput && !showAppHeader && (_jsx(StyledSearchForm, { role: 'search', "aria-label": searchLabel, collapsed: ['closed', 'closing'].includes(navState), onSubmit: e => e.preventDefault(), isMediumOrAbove: isMediumOrAbove, children: _jsx(SearchInput, { ...searchInput }) })), _jsxs(StyledScrollWrap, { 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 })] }));
240
+ }, ref: navRef, 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: {
241
+ alignItems: 'center',
242
+ areas: portalName ? '"logo app" "logo portal"' : '"logo app"'
243
+ }, ref: setAppInfoEl, children: [_jsx(Grid, { item: { area: 'logo' }, as: Image, src: logoSrc, alt: appName }), _jsx(Grid, { item: { area: 'app' }, as: 'span', children: appName }), portalName && (_jsx(Grid, { item: { area: 'portal' }, as: 'span', children: portalName }))] }), navState === 'closed' && (_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), isMediumOrAbove: isMediumOrAbove, searchInput: searchInput })), _jsxs(StyledScrollWrap, { onClick: isSmallOrAbove
244
+ ? () => {
245
+ if (['closing', 'closed'].includes(navState)) {
246
+ openNav(0);
247
+ }
248
+ else {
249
+ closeNav(0);
250
+ }
251
+ }
252
+ : 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 }), _jsxs(Flex, { container: { justify: 'center' }, children: [_jsx(StyledAppshellToggleButton, { icon: true, ref: setExpandCollapseEl, compact: true, variant: 'simple', onClick: () => {
253
+ setNavState(navState === 'closed' ? 'open' : 'closed');
254
+ }, open: ['open', 'opening'].includes(navState), "aria-label": navState === 'closed' ? t('expand') : t('collapse'), children: ['closed', 'closing'].includes(navState) ? (_jsx(Icon, { name: 'arrow-micro-right' })) : (_jsx(Icon, { name: 'arrow-micro-left' })) }), ['open', 'closed'].includes(navState) && (_jsx(Tooltip, { target: expandCollapseEl, placement: 'right', as: StyledAppshellTooltip, showDelay: 'none', hideDelay: 'none', children: navState === 'closed' ? t('expand') : t('collapse') }))] })] }));
370
255
  return (_jsxs(AppShellContext.Provider, { value: useMemo(() => ({
371
256
  navOpen: mobileNavOpen || navState === 'open' || navState === 'opening',
372
257
  navState,
258
+ menuOpen,
259
+ setMenuOpen,
373
260
  drawerOpen,
374
261
  setDrawerOpen,
375
262
  refocusEl,
@@ -384,7 +271,7 @@ const AppShell = forwardRef((props, ref) => {
384
271
  setMobileNavOpen(false);
385
272
  }, children: _jsx(Drawer, { open: mobileNavOpen, onAfterClose: () => {
386
273
  setMobileNavBackdrop(false);
387
- }, 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, children: [banners && _jsx(StyledBannerRegion, { children: banners }), main] }))] }));
274
+ }, 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] }))] }));
388
275
  });
389
276
  export default AppShell;
390
277
  //# sourceMappingURL=AppShell.js.map