@pega/cosmos-react-core 4.0.0-dev.13.0 → 4.0.0-dev.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/README.md +2 -2
  2. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppHeader.styles.js +0 -2
  4. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  5. package/lib/components/AppShell/AppShell.js.map +1 -1
  6. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  7. package/lib/components/AppShell/AppShell.styles.js +10 -16
  8. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  9. package/lib/components/AppShell/AppShell.types.d.ts +12 -11
  10. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  11. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  12. package/lib/components/AppShell/AppShellContext.d.ts +1 -1
  13. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  14. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  15. package/lib/components/AppShell/AppShellList.d.ts +1 -1
  16. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  17. package/lib/components/AppShell/AppShellList.js.map +1 -1
  18. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  19. package/lib/components/AppShell/AppShellList.styles.js +1 -2
  20. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  21. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  22. package/lib/components/AppShell/NavigationList.js.map +1 -1
  23. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  24. package/lib/components/AppShell/NavigationListItemWrapper.js +31 -11
  25. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  26. package/lib/components/AppShell/Operator.d.ts.map +1 -1
  27. package/lib/components/AppShell/Operator.js +1 -3
  28. package/lib/components/AppShell/Operator.js.map +1 -1
  29. package/lib/components/Avatar/Avatar.d.ts +2 -2
  30. package/lib/components/Avatar/Avatar.js.map +1 -1
  31. package/lib/components/Backdrop/Backdrop.d.ts +9 -21
  32. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  33. package/lib/components/Backdrop/Backdrop.js +0 -2
  34. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  35. package/lib/components/Badges/Count.d.ts +1 -1
  36. package/lib/components/Badges/Count.js.map +1 -1
  37. package/lib/components/Banner/Banner.d.ts +1 -1
  38. package/lib/components/Banner/Banner.d.ts.map +1 -1
  39. package/lib/components/Banner/Banner.js +3 -3
  40. package/lib/components/Banner/Banner.js.map +1 -1
  41. package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
  42. package/lib/components/Boolean/BooleanDisplay.js +2 -2
  43. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  44. package/lib/components/Button/BareButton.d.ts +1 -1
  45. package/lib/components/Button/BareButton.js.map +1 -1
  46. package/lib/components/Button/Button.d.ts +7 -9
  47. package/lib/components/Button/Button.d.ts.map +1 -1
  48. package/lib/components/Button/Button.js +168 -142
  49. package/lib/components/Button/Button.js.map +1 -1
  50. package/lib/components/ColorPicker/ColorPicker.d.ts +1 -1
  51. package/lib/components/ColorPicker/ColorPicker.js +1 -1
  52. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  53. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
  54. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
  55. package/lib/components/ColorPicker/ColorPicker.test-ids.js +5 -1
  56. package/lib/components/ColorPicker/ColorPicker.test-ids.js.map +1 -1
  57. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  58. package/lib/components/ComboBox/ComboBox.js +2 -10
  59. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  60. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
  61. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
  62. package/lib/components/ComboBox/ComboxBox.test-ids.js +2 -1
  63. package/lib/components/ComboBox/ComboxBox.test-ids.js.map +1 -1
  64. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  65. package/lib/components/CompositeInput/CompositeInput.js +8 -10
  66. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  67. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
  68. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
  69. package/lib/components/CompositeInput/CompositeInput.test-ids.js +5 -1
  70. package/lib/components/CompositeInput/CompositeInput.test-ids.js.map +1 -1
  71. package/lib/components/CompositeInput/CompositeInput.types.d.ts +2 -6
  72. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
  73. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
  74. package/lib/components/Configuration/Configuration.d.ts +9 -27
  75. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  76. package/lib/components/Configuration/Configuration.js +5 -1
  77. package/lib/components/Configuration/Configuration.js.map +1 -1
  78. package/lib/components/CreditCard/utils.d.ts +1 -1
  79. package/lib/components/CreditCard/utils.d.ts.map +1 -1
  80. package/lib/components/CreditCard/utils.js +1 -1
  81. package/lib/components/CreditCard/utils.js.map +1 -1
  82. package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
  83. package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
  84. package/lib/components/Currency/Currency.test-ids.js +5 -1
  85. package/lib/components/Currency/Currency.test-ids.js.map +1 -1
  86. package/lib/components/Currency/CurrencyInput.js +1 -1
  87. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  88. package/lib/components/Currency/CurrencyInput.types.d.ts +3 -7
  89. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  90. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  91. package/lib/components/DateTime/DateTimeDisplay.d.ts +4 -10
  92. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  93. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  94. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  95. package/lib/components/DateTime/Input/DateInput.js +25 -32
  96. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  97. package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
  98. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  99. package/lib/components/DateTime/Input/DateTime.styles.js +3 -0
  100. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  101. package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -3
  102. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  103. package/lib/components/DateTime/Input/DateTimeInput.js +20 -27
  104. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  105. package/lib/components/DateTime/Input/TimeInput.d.ts +1 -3
  106. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  107. package/lib/components/DateTime/Input/TimeInput.js +1 -9
  108. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  109. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -3
  110. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
  111. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  112. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  113. package/lib/components/DateTime/Input/WeekInput.js +11 -17
  114. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  115. package/lib/components/DateTime/Input/usePickerButton.js +3 -3
  116. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  117. package/lib/components/DateTime/Picker/Calendar.d.ts +4 -6
  118. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  119. package/lib/components/DateTime/Picker/Calendar.js +1 -1
  120. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  121. package/lib/components/DateTime/Picker/DatePicker.types.d.ts +2 -4
  122. package/lib/components/DateTime/Picker/DatePicker.types.d.ts.map +1 -1
  123. package/lib/components/DateTime/Picker/DatePicker.types.js.map +1 -1
  124. package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -3
  125. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  126. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  127. package/lib/components/DateTime/Picker/Weeks.d.ts +1 -3
  128. package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
  129. package/lib/components/DateTime/Picker/Weeks.js +1 -1
  130. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  131. package/lib/components/DateTime/Picker/utils.js +1 -1
  132. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  133. package/lib/components/DateTime/utils.d.ts.map +1 -1
  134. package/lib/components/DateTime/utils.js +8 -6
  135. package/lib/components/DateTime/utils.js.map +1 -1
  136. package/lib/components/Dialog/Dialog.d.ts.map +1 -1
  137. package/lib/components/Dialog/Dialog.js +2 -2
  138. package/lib/components/Dialog/Dialog.js.map +1 -1
  139. package/lib/components/Dialog/Dialog.styles.d.ts +3 -0
  140. package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -1
  141. package/lib/components/Dialog/Dialog.styles.js +29 -2
  142. package/lib/components/Dialog/Dialog.styles.js.map +1 -1
  143. package/lib/components/Dialog/Dialog.types.d.ts +34 -34
  144. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
  145. package/lib/components/Dialog/Dialog.types.js +0 -1
  146. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  147. package/lib/components/Dialog/FormDialog.d.ts +4 -1
  148. package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
  149. package/lib/components/Dialog/FormDialog.js +4 -5
  150. package/lib/components/Dialog/FormDialog.js.map +1 -1
  151. package/lib/components/Dialog/InfoDialog.d.ts +0 -1
  152. package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
  153. package/lib/components/Dialog/InfoDialog.js +15 -13
  154. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  155. package/lib/components/Dialog/InfoDialog.styles.d.ts +6 -0
  156. package/lib/components/Dialog/InfoDialog.styles.d.ts.map +1 -0
  157. package/lib/components/Dialog/InfoDialog.styles.js +18 -0
  158. package/lib/components/Dialog/InfoDialog.styles.js.map +1 -0
  159. package/lib/components/Drawer/Drawer.d.ts +9 -9
  160. package/lib/components/Drawer/Drawer.d.ts.map +1 -1
  161. package/lib/components/Drawer/Drawer.js.map +1 -1
  162. package/lib/components/Email/EmailDisplay.d.ts +1 -1
  163. package/lib/components/Email/EmailDisplay.js.map +1 -1
  164. package/lib/components/EmojiPicker/EmojiPicker.styles.d.ts.map +1 -1
  165. package/lib/components/EmojiPicker/EmojiPicker.styles.js +2 -7
  166. package/lib/components/EmojiPicker/EmojiPicker.styles.js.map +1 -1
  167. package/lib/components/ExpandCollapse/ExpandCollapse.d.ts +6 -6
  168. package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  169. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  170. package/lib/components/FieldGroup/FieldGroup.d.ts +1 -3
  171. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  172. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  173. package/lib/components/FieldValueList/FieldValueList.d.ts +5 -3
  174. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  175. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  176. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
  177. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
  178. package/lib/components/FieldValueList/index.d.ts +1 -1
  179. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  180. package/lib/components/FieldValueList/index.js.map +1 -1
  181. package/lib/components/File/File.test-ids.d.ts +1 -1
  182. package/lib/components/File/File.test-ids.d.ts.map +1 -1
  183. package/lib/components/File/File.test-ids.js +6 -1
  184. package/lib/components/File/File.test-ids.js.map +1 -1
  185. package/lib/components/File/FileDisplay.d.ts +2 -2
  186. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  187. package/lib/components/File/FileDisplay.js.map +1 -1
  188. package/lib/components/File/FileInput.d.ts +1 -3
  189. package/lib/components/File/FileInput.d.ts.map +1 -1
  190. package/lib/components/File/FileInput.js +1 -1
  191. package/lib/components/File/FileInput.js.map +1 -1
  192. package/lib/components/Flex/Flex.d.ts +7 -1
  193. package/lib/components/Flex/Flex.d.ts.map +1 -1
  194. package/lib/components/Flex/Flex.js +37 -10
  195. package/lib/components/Flex/Flex.js.map +1 -1
  196. package/lib/components/FormControl/FormControl.d.ts +3 -2
  197. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  198. package/lib/components/FormControl/FormControl.js.map +1 -1
  199. package/lib/components/FormField/FormField.d.ts +4 -3
  200. package/lib/components/FormField/FormField.d.ts.map +1 -1
  201. package/lib/components/FormField/FormField.js +10 -14
  202. package/lib/components/FormField/FormField.js.map +1 -1
  203. package/lib/components/FormField/FormField.test-ids.d.ts +2 -1
  204. package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
  205. package/lib/components/FormField/FormField.test-ids.js +3 -2
  206. package/lib/components/FormField/FormField.test-ids.js.map +1 -1
  207. package/lib/components/Grid/Grid.d.ts.map +1 -1
  208. package/lib/components/Grid/Grid.js +0 -3
  209. package/lib/components/Grid/Grid.js.map +1 -1
  210. package/lib/components/Grid/Grid.types.d.ts +6 -6
  211. package/lib/components/Grid/Grid.types.js.map +1 -1
  212. package/lib/components/Icon/iconNames.d.ts +2 -2
  213. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  214. package/lib/components/Icon/iconNames.js +2 -0
  215. package/lib/components/Icon/iconNames.js.map +1 -1
  216. package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts +4 -0
  217. package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts.map +1 -0
  218. package/lib/components/Icon/icons/phone-merge-solid.icon.js +6 -0
  219. package/lib/components/Icon/icons/phone-merge-solid.icon.js.map +1 -0
  220. package/lib/components/Icon/icons/phone-merge.icon.d.ts +4 -0
  221. package/lib/components/Icon/icons/phone-merge.icon.d.ts.map +1 -0
  222. package/lib/components/Icon/icons/phone-merge.icon.js +6 -0
  223. package/lib/components/Icon/icons/phone-merge.icon.js.map +1 -0
  224. package/lib/components/IconPicker/IconPicker.js +2 -2
  225. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  226. package/lib/components/Input/Input.d.ts +1 -1
  227. package/lib/components/Input/Input.js +1 -1
  228. package/lib/components/Input/Input.js.map +1 -1
  229. package/lib/components/Input/Input.test-ids.d.ts +1 -1
  230. package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
  231. package/lib/components/Input/Input.test-ids.js +2 -1
  232. package/lib/components/Input/Input.test-ids.js.map +1 -1
  233. package/lib/components/Label/Label.d.ts +1 -1
  234. package/lib/components/Label/Label.js.map +1 -1
  235. package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
  236. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
  237. package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
  238. package/lib/components/Link/Link.d.ts +1 -1
  239. package/lib/components/Link/Link.js.map +1 -1
  240. package/lib/components/List/List.d.ts.map +1 -1
  241. package/lib/components/List/List.js.map +1 -1
  242. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  243. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  244. package/lib/components/ListToolbar/ListToolbar.js +49 -17
  245. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  246. package/lib/components/ListToolbar/ListToolbar.styles.d.ts +3 -1
  247. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  248. package/lib/components/ListToolbar/ListToolbar.styles.js +2 -3
  249. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  250. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +2 -0
  251. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -0
  252. package/lib/components/ListToolbar/ListToolbar.test-ids.js +7 -0
  253. package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -0
  254. package/lib/components/ListToolbar/ListToolbar.types.d.ts +32 -9
  255. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  256. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  257. package/lib/components/ListToolbar/helpers.d.ts +10 -0
  258. package/lib/components/ListToolbar/helpers.d.ts.map +1 -0
  259. package/lib/components/ListToolbar/helpers.js +46 -0
  260. package/lib/components/ListToolbar/helpers.js.map +1 -0
  261. package/lib/components/ListToolbar/index.d.ts +1 -0
  262. package/lib/components/ListToolbar/index.d.ts.map +1 -1
  263. package/lib/components/ListToolbar/index.js +1 -0
  264. package/lib/components/ListToolbar/index.js.map +1 -1
  265. package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
  266. package/lib/components/LiveLog/LiveLog.js +17 -16
  267. package/lib/components/LiveLog/LiveLog.js.map +1 -1
  268. package/lib/components/Location/Location.test-ids.d.ts +1 -1
  269. package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
  270. package/lib/components/Location/Location.test-ids.js +5 -1
  271. package/lib/components/Location/Location.test-ids.js.map +1 -1
  272. package/lib/components/Location/LocationDisplay.d.ts +1 -1
  273. package/lib/components/Location/LocationDisplay.js.map +1 -1
  274. package/lib/components/Location/LocationInput.js +1 -1
  275. package/lib/components/Location/LocationInput.js.map +1 -1
  276. package/lib/components/Location/utils.d.ts +1 -1
  277. package/lib/components/Location/utils.d.ts.map +1 -1
  278. package/lib/components/Location/utils.js +1 -1
  279. package/lib/components/Location/utils.js.map +1 -1
  280. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  281. package/lib/components/Menu/Menu.styles.js +1 -4
  282. package/lib/components/Menu/Menu.styles.js.map +1 -1
  283. package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
  284. package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
  285. package/lib/components/Menu/Menu.types.d.ts +6 -12
  286. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  287. package/lib/components/Menu/Menu.types.js.map +1 -1
  288. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  289. package/lib/components/Menu/NavItemsList.js +2 -0
  290. package/lib/components/Menu/NavItemsList.js.map +1 -1
  291. package/lib/components/MenuButton/MenuButton.d.ts +3 -3
  292. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  293. package/lib/components/MenuButton/MenuButton.js +6 -4
  294. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  295. package/lib/components/MenuButton/MenuButton.test-ids.d.ts +2 -0
  296. package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -0
  297. package/lib/components/MenuButton/MenuButton.test-ids.js +3 -0
  298. package/lib/components/MenuButton/MenuButton.test-ids.js.map +1 -0
  299. package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
  300. package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
  301. package/lib/components/Modal/Modal.d.ts.map +1 -1
  302. package/lib/components/Modal/Modal.js +3 -5
  303. package/lib/components/Modal/Modal.js.map +1 -1
  304. package/lib/components/Modal/Modal.styles.js +1 -1
  305. package/lib/components/Modal/Modal.styles.js.map +1 -1
  306. package/lib/components/Modal/Modal.types.d.ts +25 -71
  307. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  308. package/lib/components/Modal/Modal.types.js.map +1 -1
  309. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  310. package/lib/components/Modal/ModalManager.js +5 -2
  311. package/lib/components/Modal/ModalManager.js.map +1 -1
  312. package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
  313. package/lib/components/MultiStepForm/HorizontalFormProgress.js +4 -0
  314. package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
  315. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  316. package/lib/components/MultiStepForm/MultiStepForm.js +1 -1
  317. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  318. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +1 -1
  319. package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
  320. package/lib/components/Number/Number.test-ids.d.ts +2 -2
  321. package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
  322. package/lib/components/Number/Number.test-ids.js +8 -2
  323. package/lib/components/Number/Number.test-ids.js.map +1 -1
  324. package/lib/components/Number/NumberInput.js +1 -1
  325. package/lib/components/Number/NumberInput.js.map +1 -1
  326. package/lib/components/Number/NumberRangeInput.js +1 -1
  327. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  328. package/lib/components/PageTemplates/PageTemplates.js +2 -2
  329. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  330. package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
  331. package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
  332. package/lib/components/Phone/Phone.test-ids.js +3 -1
  333. package/lib/components/Phone/Phone.test-ids.js.map +1 -1
  334. package/lib/components/Phone/PhoneDisplay.d.ts +1 -1
  335. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  336. package/lib/components/Phone/PhoneInput.js +2 -2
  337. package/lib/components/Phone/PhoneInput.js.map +1 -1
  338. package/lib/components/Popover/Popover.d.ts +4 -3
  339. package/lib/components/Popover/Popover.d.ts.map +1 -1
  340. package/lib/components/Popover/Popover.js +36 -24
  341. package/lib/components/Popover/Popover.js.map +1 -1
  342. package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
  343. package/lib/components/Popover/PopoverManager.js +11 -10
  344. package/lib/components/Popover/PopoverManager.js.map +1 -1
  345. package/lib/components/Popover/modifiers.d.ts +1 -0
  346. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  347. package/lib/components/Popover/modifiers.js +116 -1
  348. package/lib/components/Popover/modifiers.js.map +1 -1
  349. package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
  350. package/lib/components/Progress/Progress.styles.js +25 -20
  351. package/lib/components/Progress/Progress.styles.js.map +1 -1
  352. package/lib/components/Progress/Progress.types.d.ts +2 -2
  353. package/lib/components/Progress/Progress.types.js.map +1 -1
  354. package/lib/components/RadioCheck/RadioCheck.js +2 -2
  355. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  356. package/lib/components/SearchInput/SearchInput.d.ts +1 -1
  357. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  358. package/lib/components/SearchInput/SearchInput.js +1 -9
  359. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  360. package/lib/components/Select/Select.js +2 -2
  361. package/lib/components/Select/Select.js.map +1 -1
  362. package/lib/components/Select/Select.test-ids.d.ts +1 -1
  363. package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
  364. package/lib/components/Select/Select.test-ids.js +2 -1
  365. package/lib/components/Select/Select.test-ids.js.map +1 -1
  366. package/lib/components/Skeleton/LineSkeleton.d.ts +2 -2
  367. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  368. package/lib/components/Skeleton/RectangleSkeleton.d.ts +3 -3
  369. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  370. package/lib/components/Slider/Slider.js +1 -1
  371. package/lib/components/Slider/Slider.js.map +1 -1
  372. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  373. package/lib/components/Slider/Slider.styles.js +114 -128
  374. package/lib/components/Slider/Slider.styles.js.map +1 -1
  375. package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
  376. package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
  377. package/lib/components/Slider/Slider.test-ids.js +2 -1
  378. package/lib/components/Slider/Slider.test-ids.js.map +1 -1
  379. package/lib/components/Slider/Slider.types.d.ts +3 -9
  380. package/lib/components/Slider/Slider.types.d.ts.map +1 -1
  381. package/lib/components/Slider/Slider.types.js.map +1 -1
  382. package/lib/components/Slider/utils.d.ts.map +1 -1
  383. package/lib/components/Slider/utils.js +0 -1
  384. package/lib/components/Slider/utils.js.map +1 -1
  385. package/lib/components/SummaryItem/SummaryItem.d.ts +2 -1
  386. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  387. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  388. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
  389. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
  390. package/lib/components/SummaryList/SummaryList.d.ts +2 -2
  391. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  392. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  393. package/lib/components/Table/Table.d.ts +1 -1
  394. package/lib/components/Table/Table.js.map +1 -1
  395. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  396. package/lib/components/Tabs/Tab.js +21 -18
  397. package/lib/components/Tabs/Tab.js.map +1 -1
  398. package/lib/components/Tabs/TabPanel.d.ts +1 -1
  399. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  400. package/lib/components/Tabs/TabPanel.js.map +1 -1
  401. package/lib/components/Tabs/Tabs.types.d.ts +1 -1
  402. package/lib/components/Tabs/Tabs.types.js.map +1 -1
  403. package/lib/components/Text/Text.d.ts +2 -4
  404. package/lib/components/Text/Text.d.ts.map +1 -1
  405. package/lib/components/Text/Text.js.map +1 -1
  406. package/lib/components/TextArea/TextArea.js +1 -1
  407. package/lib/components/TextArea/TextArea.js.map +1 -1
  408. package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
  409. package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
  410. package/lib/components/TextArea/TextArea.test-ids.js +2 -1
  411. package/lib/components/TextArea/TextArea.test-ids.js.map +1 -1
  412. package/lib/components/Toaster/Toaster.types.d.ts +1 -1
  413. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  414. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  415. package/lib/components/Tooltip/Tooltip.d.ts +3 -3
  416. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  417. package/lib/components/URL/URLDisplay.d.ts +1 -1
  418. package/lib/components/URL/URLDisplay.js +2 -2
  419. package/lib/components/URL/URLDisplay.js.map +1 -1
  420. package/lib/hooks/index.d.ts +1 -0
  421. package/lib/hooks/index.d.ts.map +1 -1
  422. package/lib/hooks/index.js +1 -0
  423. package/lib/hooks/index.js.map +1 -1
  424. package/lib/hooks/useArrows.js +1 -1
  425. package/lib/hooks/useArrows.js.map +1 -1
  426. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  427. package/lib/hooks/useBreakpoint.js +4 -1
  428. package/lib/hooks/useBreakpoint.js.map +1 -1
  429. package/lib/hooks/useChToPxConversionFactor.d.ts +3 -0
  430. package/lib/hooks/useChToPxConversionFactor.d.ts.map +1 -0
  431. package/lib/hooks/useChToPxConversionFactor.js +13 -0
  432. package/lib/hooks/useChToPxConversionFactor.js.map +1 -0
  433. package/lib/hooks/useElement.d.ts +1 -1
  434. package/lib/hooks/useElement.d.ts.map +1 -1
  435. package/lib/hooks/useI18n.d.ts +13 -0
  436. package/lib/hooks/useI18n.d.ts.map +1 -1
  437. package/lib/hooks/useScrollToggle.d.ts.map +1 -1
  438. package/lib/hooks/useScrollToggle.js +0 -1
  439. package/lib/hooks/useScrollToggle.js.map +1 -1
  440. package/lib/hooks/useTestIds.d.ts +1 -1
  441. package/lib/hooks/useTestIds.d.ts.map +1 -1
  442. package/lib/hooks/useTestIds.js +3 -0
  443. package/lib/hooks/useTestIds.js.map +1 -1
  444. package/lib/i18n/default.d.ts +13 -0
  445. package/lib/i18n/default.d.ts.map +1 -1
  446. package/lib/i18n/default.js +14 -0
  447. package/lib/i18n/default.js.map +1 -1
  448. package/lib/i18n/i18n.d.ts +13 -0
  449. package/lib/i18n/i18n.d.ts.map +1 -1
  450. package/lib/i18n/translate.d.ts +2 -6
  451. package/lib/i18n/translate.d.ts.map +1 -1
  452. package/lib/i18n/translate.js.map +1 -1
  453. package/lib/styles/gradients.d.ts.map +1 -1
  454. package/lib/styles/gradients.js.map +1 -1
  455. package/lib/theme/ThemeMachine.js.map +1 -1
  456. package/lib/types/types.d.ts +7 -2
  457. package/lib/types/types.d.ts.map +1 -1
  458. package/lib/types/types.js.map +1 -1
  459. package/lib/utils/createTestIds.d.ts +1 -6
  460. package/lib/utils/createTestIds.d.ts.map +1 -1
  461. package/lib/utils/createTestIds.js +2 -4
  462. package/lib/utils/createTestIds.js.map +1 -1
  463. package/lib/utils/debounce.d.ts +2 -2
  464. package/lib/utils/debounce.d.ts.map +1 -1
  465. package/lib/utils/debounce.js +9 -10
  466. package/lib/utils/debounce.js.map +1 -1
  467. package/lib/utils/getEdge.d.ts +7 -0
  468. package/lib/utils/getEdge.d.ts.map +1 -0
  469. package/lib/utils/getEdge.js +9 -0
  470. package/lib/utils/getEdge.js.map +1 -0
  471. package/lib/utils/index.d.ts +2 -1
  472. package/lib/utils/index.d.ts.map +1 -1
  473. package/lib/utils/index.js +2 -0
  474. package/lib/utils/index.js.map +1 -1
  475. package/lib/utils/kebabToCamel.d.ts +1 -3
  476. package/lib/utils/kebabToCamel.d.ts.map +1 -1
  477. package/lib/utils/kebabToCamel.js +1 -3
  478. package/lib/utils/kebabToCamel.js.map +1 -1
  479. package/lib/utils/throttle.d.ts +4 -0
  480. package/lib/utils/throttle.d.ts.map +1 -0
  481. package/lib/utils/throttle.js +15 -0
  482. package/lib/utils/throttle.js.map +1 -0
  483. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.types.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n KeyboardEvent,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n Ref,\n RefObject\n} from 'react';\n\nimport { AsProp, BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { ImageProps } from '../Image';\nimport { ProgressProps } from '../Progress';\nimport { SearchInputProps } from '../SearchInput';\nimport { MenuItemProps } from '../Menu';\n\n/** AppShell props */\n\nexport interface AppInfoProps {\n /** The primary text to render in the header. */\n appName: string;\n /** If true, the appName will not be visibly displayed on screen. */\n appNameHidden?: boolean;\n /** The source for a small application image or logo that is rendered in the nav bar. */\n imageSrc: ImageProps['src'];\n /** The source for the full size application image or logo that is rendered in the app header, if enabled. */\n fullImageSrc?: ImageProps['src'];\n /** URL or DOM id to navigate to. */\n href?: string;\n /** Click handler for the header. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n /** The secondary text to render in the header. */\n portalName?: string;\n /** Specifies where to open the link href. */\n target?: string;\n}\n\nexport interface ContextItem extends Pick<MenuItemProps, 'id' | 'primary' | 'visual' | 'href'> {\n selected: MenuItemProps['selected'];\n}\n\ninterface ContextSwitcherOptions extends BaseProps {\n /** Application contexts available to user. */\n contexts: ContextItem[];\n /** Callback on click of item in context switcher. */\n onContextClick: (\n id: MenuItemProps['id'],\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement | HTMLDivElement>\n ) => void;\n /** Label of context being modified; i.e: \"Switch Application\", \"Switch Studio\"\n * @default \"Switch to…\"\n */\n label?: string;\n}\n\nexport type ContextSwitcherProps = ContextSwitcherOptions | Record<string, never>;\n\nexport interface AppShellProps extends BaseProps, NoChildrenProp {\n /** Props related to the App Shell header. */\n appInfo: AppInfoProps;\n /** The content of the application. */\n main: ReactNode;\n /** The active user of the application. */\n operator: OperatorProps;\n /** If true, a header will render containing the logo and name of the app as well as search and operator regions. */\n appHeader?: boolean;\n /** Context switcher configuration. */\n contextSwitcher?: ContextSwitcherProps;\n /** If true, the search results page will replace the search input in the app header with its own */\n searchPage?: boolean;\n /** Props related to the Search Input. */\n searchInput?: SearchInputProps;\n /**\n * The aria-label for the search input.\n * @default \"Sitewide\"\n */\n searchLabel?: string;\n /** A set of cases that will render in an expanded list within the App Shell. */\n caseTypes?: CaseTypeProps[];\n /** A set of links that will render as a flat list in the App Shell. */\n links?: LinkProps[];\n /** A set of cases that will render as a flat list in the App Shell. */\n cases?: CaseProps[];\n /** Used for alternate environments, such as \"dev\" or \"staging\". */\n environment?: {\n name: string;\n /** @default theme.base.colors.red['extra-light'] */\n color?: string;\n };\n /** Place the main content of the application into a loading state by way of a boolean or a custom message. */\n progress?: boolean | ProgressProps['message'];\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n utils?: (UtilItemProps | ReactElement)[];\n /** Banners will render above the main content if they are provided. */\n banners?: ReactNode;\n defaultExpanded?: boolean;\n /** When the navigation is collapsed menus will be shown on hover instead of on click */\n collapsedHoverMenus?: boolean;\n}\n\nexport interface CaseTypeProps {\n /** The display name of the case. */\n name: string;\n /** Click handler for the case. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface LinkProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** The display name of the link. */\n name: string;\n /** URL or DOM id to navigate to. */\n href: string;\n /** The name of the Cosmos Icon to render as a visual. */\n icon?: string;\n /** Determines if the link represents the active page. */\n active?: boolean;\n /** A set of nested links. */\n links?: LinkProps[];\n /** Click handler for the link. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n}\n\nexport interface CaseProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** Name of the case or some primary information like title. */\n primary: string;\n /** Additional info of a case like timestamp. */\n secondary?: string;\n /** A visual element identifying the case. If not passed will render case-solid icon */\n visual?: ReactNode;\n /** Determines if the case represents the active page. */\n active?: boolean;\n /** Click handler for the case . */\n onClick?: MouseEventHandler<HTMLElement>;\n /** Dismiss handler for the case. */\n onDismiss?: MouseEventHandler<HTMLElement>;\n}\n\nexport interface OperatorProps {\n /** A visual element identifying the operator. */\n avatar: ReactNode;\n /** A list of actions that will populate a menu attached to the operator. */\n actions: Pick<NavListItemProps, 'id' | 'primary' | 'href' | 'onClick' | 'visual'>[];\n /** The name of the operator. */\n name: string;\n}\n\nexport interface UtilItemProps extends Pick<NavListItemProps, 'visual' | 'actions' | 'onClick'> {\n /** The display name of an utility item. */\n name: string;\n /* Number when given displays on top-right of a given icon. */\n count?: number;\n /** View that renders on an appShell drawer onClick of an item */\n drawerView?: ReactNode;\n /** Heading for view that renders */\n drawerHeader?: string;\n /** Callback that fires on appshell drawer open */\n onDrawerOpen?: () => void;\n /** Callback that fires on appshell drawer close */\n onDrawerClose?: () => void;\n}\n\nexport interface UtilsProps {\n /** Context switcher config. */\n contextSwitcher?: ContextSwitcherProps | Record<string, never>;\n /** The active user of the application. */\n operator: AppShellProps['operator'];\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n items?: (UtilItemProps | ReactElement)[];\n appHeader?: boolean;\n}\n\nexport interface NavListProps extends AsProp, BaseProps {\n items?: (NavListItemProps | ReactElement)[];\n nestedList?: boolean;\n collapsed?: boolean;\n id?: string;\n /** Whether the list is of single-select style options */\n singleSelect?: boolean;\n}\n\nexport interface NavListItemWrapperProps extends ForwardProps {\n label: string;\n tooltipLabel: string;\n content?: ReactNode;\n items?: NavListItemProps[];\n onMenuToggle?: (state: 'open' | 'close') => void;\n childElementRef: RefObject<HTMLElement>;\n}\n\nexport interface NavListItemProps extends AsProp, BaseProps, ForwardProps, NoChildrenProp {\n id?: string;\n visual?: ReactNode;\n primary: string;\n secondary?: string;\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n items?: NavListItemProps[];\n collapseItems?: boolean;\n actions?: OperatorProps['actions'];\n onDismiss?: MouseEventHandler<HTMLElement>;\n forwardedRef?: Ref<HTMLAnchorElement | HTMLDivElement | HTMLButtonElement>;\n isMenuItem?: boolean;\n /** Whether the item is a single-select option */\n singleSelect?: NavListProps['singleSelect'];\n /** Whether the item is selected */\n selected?: boolean;\n}\n\nexport interface NavMenuProps extends NavListItemProps {\n forwardedRef?: Ref<HTMLButtonElement>;\n}\n\n/** AppHeader props */\n\nexport interface AppHeaderProps extends BaseProps, AppInfoProps {\n contextSwitcher?: ContextSwitcherProps | Record<string, never>;\n operator: AppShellProps['operator'];\n searchInput?: AppShellProps['searchInput'];\n searchLabel?: AppShellProps['searchLabel'];\n searchPage?: AppShellProps['searchPage'];\n}\n\n/** Drawer props */\n\nexport interface DrawerListProps {\n items: (DrawerItemProps & ForwardProps)[];\n loading?: boolean;\n viewAll?: {\n onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n } & ForwardProps;\n newNotifications?: number;\n onItemClick?: (id: string, event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n onItemPinToggle?: (id: string) => void;\n onDrawerOpen?: () => void;\n onDrawerClose?: () => void;\n}\n\nexport interface DrawerItemProps extends BaseProps {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** A flag indicating if the item has been pinned or not. */\n pinned?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (id: string, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;\n /** The handler hat is called when a pin icon is toggled on an item. */\n onPinToggle?: (id: string) => void;\n}\n\nexport interface ListProps extends DrawerListProps {\n headingText?: string;\n emptyText: string;\n displayRecents: boolean;\n displayPins?: boolean;\n}\n"]}
1
+ {"version":3,"file":"AppShell.types.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n KeyboardEvent,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n Ref,\n RefObject\n} from 'react';\n\nimport type { AsProp, BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport type { ImageProps } from '../Image';\nimport type { ProgressProps } from '../Progress';\nimport type { SearchInputProps } from '../SearchInput';\nimport type { MenuItemProps } from '../Menu';\n\n/** AppShell props */\n\nexport interface AppInfoProps {\n /** The primary text to render in the header. */\n appName: string;\n /** If true, the appName will not be visibly displayed on screen. */\n appNameHidden?: boolean;\n /** The source for a small application image or logo that is rendered in the nav bar. */\n imageSrc: ImageProps['src'];\n /** The source for the full size application image or logo that is rendered in the app header, if enabled. */\n fullImageSrc?: ImageProps['src'];\n /** URL or DOM id to navigate to. */\n href?: string;\n /** Click handler for the header. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n /** The secondary text to render in the header. */\n portalName?: string;\n /** Specifies where to open the link href. */\n target?: string;\n}\n\nexport interface ContextItem extends Pick<MenuItemProps, 'id' | 'primary' | 'visual' | 'href'> {\n selected: MenuItemProps['selected'];\n}\n\ninterface ContextSwitcherOptions extends BaseProps {\n /** Application contexts available to user. */\n contexts: ContextItem[];\n /** Callback on click of item in context switcher. */\n onContextClick: (\n id: MenuItemProps['id'],\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement | HTMLDivElement>\n ) => void;\n /** Label of context being modified; i.e: \"Switch Application\", \"Switch Studio\"\n * @default 'Switch to…'\n */\n label?: string;\n}\n\nexport type ContextSwitcherProps = ContextSwitcherOptions | Record<string, never>;\n\nexport interface AppShellProps extends BaseProps, NoChildrenProp {\n /** Props related to the App Shell header. */\n appInfo: AppInfoProps;\n /** The content of the application. */\n main: ReactNode;\n /** The active user of the application. */\n operator: OperatorProps;\n /** If true, a header will render containing the logo and name of the app as well as search and operator regions. */\n appHeader?: boolean;\n /** Context switcher configuration. */\n contextSwitcher?: ContextSwitcherProps;\n /** If true, the search results page will replace the search input in the app header with its own */\n searchPage?: boolean;\n /** Props related to the Search Input. */\n searchInput?: SearchInputProps;\n /**\n * The aria-label for the search input.\n * @default 'Sitewide'\n */\n searchLabel?: string;\n /** A set of cases that will render in an expanded list within the App Shell. */\n caseTypes?: CaseTypeProps[];\n /** A set of links that will render as a flat list in the App Shell. */\n links?: LinkProps[];\n /** A set of cases that will render as a flat list in the App Shell. */\n cases?: CaseProps[];\n /** Used for alternate environments, such as \"dev\" or \"staging\". */\n environment?: {\n name: string;\n /** @default theme.base.colors.red['extra-light'] */\n color?: string;\n };\n /** Place the main content of the application into a loading state by way of a boolean or a custom message. */\n progress?: boolean | ProgressProps['message'];\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n utils?: (UtilItemProps | ReactElement)[];\n /** Banners will render above the main content if they are provided. */\n banners?: ReactNode;\n defaultExpanded?: boolean;\n /** When the navigation is collapsed menus will be shown on hover instead of on click */\n collapsedHoverMenus?: boolean;\n}\n\nexport interface CaseTypeProps {\n /** The display name of the case. */\n name: string;\n /** Click handler for the case. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport interface LinkProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** The display name of the link. */\n name: string;\n /** URL or DOM id to navigate to. */\n href: string;\n /** The name of the Cosmos Icon to render as a visual. */\n icon?: string;\n /** Determines if the link represents the active page. */\n active?: boolean;\n /** A set of nested links. */\n links?: LinkProps[];\n /** Click handler for the link. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n}\n\nexport interface CaseProps extends ForwardProps {\n /** Unique id */\n id: string;\n /** Name of the case or some primary information like title. */\n primary: string;\n /** Additional info of a case like timestamp. */\n secondary?: string;\n /** A visual element identifying the case. If not passed will render case-solid icon */\n visual?: ReactNode;\n /** Determines if the case represents the active page. */\n active?: boolean;\n /** Click handler for the case . */\n onClick?: MouseEventHandler<HTMLElement>;\n /** Dismiss handler for the case. */\n onDismiss?: MouseEventHandler<HTMLElement>;\n}\n\nexport interface OperatorProps {\n /** A visual element identifying the operator. */\n avatar: ReactNode;\n /** A list of actions that will populate a menu attached to the operator. */\n actions: Pick<NavListItemProps, 'id' | 'primary' | 'href' | 'onClick' | 'visual'>[];\n /** The name of the operator. */\n name: string;\n}\n\nexport interface UtilItemProps extends Pick<NavListItemProps, 'visual' | 'actions' | 'onClick'> {\n /** The display name of an utility item. */\n name: string;\n /** Number when given displays on top-right of a given icon. */\n count?: number;\n /** View that renders on an appShell drawer onClick of an item */\n drawerView?: ReactNode;\n /** Heading for view that renders */\n drawerHeader?: string;\n /** Callback that fires on appshell drawer open */\n onDrawerOpen?: () => void;\n /** Callback that fires on appshell drawer close */\n onDrawerClose?: () => void;\n}\n\nexport interface UtilsProps {\n /** Context switcher config. */\n contextSwitcher?: ContextSwitcherProps | Record<string, never>;\n /** The active user of the application. */\n operator: AppShellProps['operator'];\n /** A set of app utilities like notifications, recents that renders at the bottom of AppShell */\n items?: (UtilItemProps | ReactElement)[];\n appHeader?: boolean;\n}\n\nexport interface NavListProps extends AsProp, BaseProps {\n items?: (NavListItemProps | ReactElement)[];\n nestedList?: boolean;\n collapsed?: boolean;\n id?: string;\n /** Whether the list is of single-select style options */\n singleSelect?: boolean;\n}\n\nexport interface NavListItemWrapperProps extends ForwardProps {\n label: string;\n tooltipLabel: string;\n content?: ReactNode;\n items?: NavListItemProps[];\n onMenuToggle?: (state: 'open' | 'close') => void;\n childElementRef: RefObject<HTMLElement>;\n}\n\nexport interface NavListItemProps extends AsProp, BaseProps, ForwardProps, NoChildrenProp {\n id?: string;\n visual?: ReactNode;\n primary: string;\n secondary?: string;\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n items?: NavListItemProps[];\n collapseItems?: boolean;\n actions?: OperatorProps['actions'];\n onDismiss?: MouseEventHandler<HTMLElement>;\n forwardedRef?: Ref<HTMLAnchorElement | HTMLDivElement | HTMLButtonElement>;\n isMenuItem?: boolean;\n /** Whether the item is a single-select option */\n singleSelect?: NavListProps['singleSelect'];\n /** Whether the item is selected */\n selected?: boolean;\n}\n\nexport interface NavMenuProps extends NavListItemProps {\n forwardedRef?: Ref<HTMLButtonElement>;\n}\n\n/** AppHeader props */\n\nexport interface AppHeaderProps extends BaseProps, AppInfoProps {\n contextSwitcher?: ContextSwitcherProps | Record<string, never>;\n operator: AppShellProps['operator'];\n searchInput?: AppShellProps['searchInput'];\n searchLabel?: AppShellProps['searchLabel'];\n searchPage?: AppShellProps['searchPage'];\n}\n\n/** Drawer props */\n\nexport interface DrawerListProps {\n items: (DrawerItemProps & ForwardProps)[];\n loading?: boolean;\n viewAll?: {\n onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;\n href?: string;\n } & ForwardProps;\n newNotifications?: number;\n onItemClick?: (id: string, event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n onItemPinToggle?: (id: string) => void;\n onDrawerOpen?: () => void;\n onDrawerClose?: () => void;\n}\n\nexport interface DrawerItemProps extends BaseProps {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** A flag indicating if the item has been pinned or not. */\n pinned?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (id: string, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;\n /** The handler hat is called when a pin icon is toggled on an item. */\n onPinToggle?: (id: string) => void;\n}\n\nexport interface ListProps extends DrawerListProps {\n headingText?: string;\n emptyText: string;\n displayRecents: boolean;\n displayPins?: boolean;\n}\n"]}
@@ -11,7 +11,7 @@ export interface AppShellContextValue {
11
11
  navOpen: boolean;
12
12
  drawerOpen: boolean;
13
13
  setDrawerOpen: (val: boolean) => void;
14
- navState: typeof openCloseStates[keyof typeof openCloseStates];
14
+ navState: (typeof openCloseStates)[keyof typeof openCloseStates];
15
15
  focusedImperatively: MutableRefObject<boolean>;
16
16
  headerEl: HTMLDivElement | null;
17
17
  previewTriggerRef: MutableRefObject<HTMLElement | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellContext.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM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Q,EAAE,QAAQ;IAClB,mBAAmB,EAAE,KAAK;IAC1B,mBAAmB,EAAE;QACnB,IAAI,OAAO;YACT,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IACD,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE;QACjB,IAAI,OAAO;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gEAAgE;QAChE,IAAI,OAAO,CAAC,GAAG,IAAG,CAAC;KACpB;IACD,iBAAiB,EAAE,IAAI;IACvB,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC9B,aAAa,EAAE,KAAK;CACrB,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC","sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\nimport { openCloseStates } from '../../hooks/useTransitionState';\n\nimport { AppShellProps, UtilItemProps } from './AppShell.types';\n\nexport interface AppShellDrawerContextValue {\n drawerOpen: boolean;\n openDrawer: (item: UtilItemProps) => void;\n closeDrawer: () => void;\n}\n\nexport const AppShellDrawerContext = createContext<AppShellDrawerContextValue>({\n drawerOpen: false,\n openDrawer: () => {},\n closeDrawer: () => {}\n});\n\nexport interface AppShellContextValue {\n navOpen: boolean;\n drawerOpen: boolean;\n setDrawerOpen: (val: boolean) => void;\n navState: typeof openCloseStates[keyof typeof openCloseStates];\n focusedImperatively: MutableRefObject<boolean>;\n headerEl: HTMLDivElement | null;\n previewTriggerRef: MutableRefObject<HTMLElement | null>;\n searchContainerEl: HTMLElement | null;\n setSearchContainerEl: (el: HTMLElement | null) => void;\n collapsedHoverMenus?: AppShellProps['collapsedHoverMenus'];\n mobileNavOpen: boolean;\n}\n\nconst AppShellContext = createContext<AppShellContextValue>({\n navOpen: false,\n drawerOpen: false,\n setDrawerOpen: () => {},\n navState: 'closed',\n collapsedHoverMenus: false,\n focusedImperatively: {\n get current() {\n return false;\n }\n },\n headerEl: null,\n previewTriggerRef: {\n get current() {\n return null;\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n set current(val) {}\n },\n searchContainerEl: null,\n setSearchContainerEl: () => {},\n mobileNavOpen: false\n});\n\nexport default AppShellContext;\n"]}
1
+ {"version":3,"file":"AppShellContext.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,OAAO,CAAC;AAYxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAA6B;IAC7E,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;CACtB,CAAC,CAAC;AAgBH,MAAM,eAAe,GAAG,aAAa,CAAuB;IAC1D,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;IACvB,QAAQ,EAAE,QAAQ;IAClB,mBAAmB,EAAE,KAAK;IAC1B,mBAAmB,EAAE;QACnB,IAAI,OAAO;YACT,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IACD,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE;QACjB,IAAI,OAAO;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gEAAgE;QAChE,IAAI,OAAO,CAAC,GAAG,IAAG,CAAC;KACpB;IACD,iBAAiB,EAAE,IAAI;IACvB,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC9B,aAAa,EAAE,KAAK;CACrB,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC","sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\nimport { openCloseStates } from '../../hooks/useTransitionState';\n\nimport { AppShellProps, UtilItemProps } from './AppShell.types';\n\nexport interface AppShellDrawerContextValue {\n drawerOpen: boolean;\n openDrawer: (item: UtilItemProps) => void;\n closeDrawer: () => void;\n}\n\nexport const AppShellDrawerContext = createContext<AppShellDrawerContextValue>({\n drawerOpen: false,\n openDrawer: () => {},\n closeDrawer: () => {}\n});\n\nexport interface AppShellContextValue {\n navOpen: boolean;\n drawerOpen: boolean;\n setDrawerOpen: (val: boolean) => void;\n navState: (typeof openCloseStates)[keyof typeof openCloseStates];\n focusedImperatively: MutableRefObject<boolean>;\n headerEl: HTMLDivElement | null;\n previewTriggerRef: MutableRefObject<HTMLElement | null>;\n searchContainerEl: HTMLElement | null;\n setSearchContainerEl: (el: HTMLElement | null) => void;\n collapsedHoverMenus?: AppShellProps['collapsedHoverMenus'];\n mobileNavOpen: boolean;\n}\n\nconst AppShellContext = createContext<AppShellContextValue>({\n navOpen: false,\n drawerOpen: false,\n setDrawerOpen: () => {},\n navState: 'closed',\n collapsedHoverMenus: false,\n focusedImperatively: {\n get current() {\n return false;\n }\n },\n headerEl: null,\n previewTriggerRef: {\n get current() {\n return null;\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n set current(val) {}\n },\n searchContainerEl: null,\n setSearchContainerEl: () => {},\n mobileNavOpen: false\n});\n\nexport default AppShellContext;\n"]}
@@ -32,7 +32,7 @@ export interface AppShellListItemProps extends BaseProps {
32
32
  visual?: ReactNode;
33
33
  /** A flag indicating if the item has been read. */
34
34
  unread?: boolean;
35
- /** Icon for displaying at the end of items */
35
+ /** Icon for displaying at the end of items */
36
36
  pinned?: boolean;
37
37
  /** URL or DOM id to navigate to. */
38
38
  href?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellList.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,GAAG,EACH,UAAU,EACV,SAAS,EACT,aAAa,EAGd,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiCtD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AACxF,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,EAAE,EAAE,MAA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,YAC7C,WAAW,GACP,CACR,EACA,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAC7E,KAAC,QAAQ,IAAC,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,QAAQ,GAAG,GAC7C,CACR,CAAC,CAAC,CAAC,CACF,aAAa,CACd,EACA,CAAC,YAAY,EAAE,IAAI,IAAI,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,IAAI,CAC9E,KAAC,mBAAmB,OAAK,YAAY,EAAE,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,YAC1E,CAAC,CAAC,UAAU,CAAC,GACM,CACvB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,YAAY,GAAyC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YACpE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CACxB,eAAC,IAAI,OAAK,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAI,CACzC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n FunctionComponent,\n Ref,\n MouseEvent,\n ReactNode,\n KeyboardEvent,\n useContext,\n useRef\n} from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport Alert from '../Badges/Alert';\nimport Button from '../Button';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport * as pinIcon from '../Icon/icons/pin.icon';\nimport * as pinSolidIcon from '../Icon/icons/pin-solid.icon';\nimport MetaList from '../MetaList';\nimport EmptyState from '../EmptyState';\nimport Progress from '../Progress';\nimport SummaryItem from '../SummaryItem';\nimport Text from '../Text';\nimport { useI18n } from '../../hooks';\n\nimport { StyledLoading } from './AppShell.styles';\nimport {\n StyledAppShellListWrapper,\n StyledAppShellList,\n StyledAppShellSummaryList,\n StyledAppShellMetaList,\n StyledNotificationPrimary,\n StyledNotificationSecondary,\n StyledAppShellPinButton,\n EmptyStateColorContrast,\n StyledAppShellListSection,\n StyledAppShellListHeading,\n StyledNotificationVisual\n} from './AppShellList.styles';\nimport { StyledDrawerViewAll } from './Drawer.styles';\nimport { AppShellDrawerContext } from './AppShellContext';\n\nregisterIcon(pinIcon, pinSolidIcon);\n\nexport type ListInteractionEvent = MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>;\nexport interface ListProps {\n /** An id representing the item. */\n id: string;\n ref?: Ref<HTMLDivElement>;\n items: (AppShellListItemProps & ForwardProps)[];\n headingText?: string;\n emptyText: string;\n loading?: boolean;\n viewAll?: {\n onClick?: (e: MouseEvent) => void;\n href?: string;\n } & ForwardProps;\n newNotifications?: number;\n displayPins?: boolean;\n onItemClick?: (id: string, event: ListInteractionEvent) => void;\n onItemPinToggle?: (id: string) => void;\n}\nexport interface AppShellListProps {\n listView: ListProps[];\n}\nexport interface AppShellListItemProps extends BaseProps {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** Icon for displaying at the end of items */\n pinned?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (id: string, event: ListInteractionEvent) => void;\n /** The handler hat is called when a pin icon is toggled on an item. */\n onPinToggle?: (id: string) => void;\n}\n\nconst List = ({\n headingText,\n emptyText,\n items,\n loading = false,\n displayPins = false,\n onItemClick,\n onItemPinToggle,\n viewAll: viewAllProps\n}: ListProps) => {\n const t = useI18n();\n const { closeDrawer } = useContext(AppShellDrawerContext);\n const pinButtons = useRef<Record<string, HTMLButtonElement>>({});\n\n const renderContent = items.length ? (\n <Flex as={StyledAppShellList} item={{ grow: 1 }}>\n {items.map(\n ({\n id,\n primary,\n secondary,\n visual,\n unread,\n href,\n onClick,\n pinned,\n onPinToggle,\n ...restProps\n }: AppShellListItemProps) => {\n const onSummaryItemClick = (e: ListInteractionEvent) => {\n onClick?.(id, e);\n onItemClick?.(id, e);\n\n if (!pinButtons.current[id]?.contains(e.target as Node)) {\n closeDrawer();\n }\n };\n\n return (\n <StyledAppShellSummaryList key={id}>\n <SummaryItem\n {...restProps}\n as={href ? 'a' : 'button'}\n primary={\n <StyledNotificationPrimary unread={unread}>{primary}</StyledNotificationPrimary>\n }\n secondary={\n secondary?.length ? (\n <StyledNotificationSecondary unread={unread}>\n <MetaList as={StyledAppShellMetaList} items={secondary} />\n </StyledNotificationSecondary>\n ) : undefined\n }\n visual={\n visual || unread ? (\n <StyledNotificationVisual unread={unread} visualIncluded={!!visual}>\n {visual} <Alert variant='urgent' />\n </StyledNotificationVisual>\n ) : undefined\n }\n href={href}\n onClick={onSummaryItemClick}\n onKeyDown={(e: KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onSummaryItemClick(e);\n }\n }}\n actions={\n displayPins ? (\n <Button\n ref={el => {\n if (!el) delete pinButtons.current[id];\n else pinButtons.current[id] = el;\n }}\n icon\n as={StyledAppShellPinButton}\n forwardedAs='div'\n onClick={() => {\n onPinToggle?.(id);\n onItemPinToggle?.(id);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Enter') {\n onPinToggle?.(id);\n onItemPinToggle?.(id);\n }\n }}\n role='button'\n tabIndex={0}\n >\n <Icon name={pinned ? 'pin-solid' : 'pin'} />\n </Button>\n ) : undefined\n }\n tabIndex={0}\n />\n </StyledAppShellSummaryList>\n );\n }\n )}\n </Flex>\n ) : (\n <Flex\n as={EmptyStateColorContrast}\n container={{ justify: 'center', alignItems: 'center' }}\n item={{ grow: 1 }}\n >\n <EmptyState message={emptyText} />\n </Flex>\n );\n\n return (\n <Flex as={StyledAppShellListSection} container={{ direction: 'column' }}>\n {headingText && (\n <Text variant='h3' as={StyledAppShellListHeading}>\n {headingText}\n </Text>\n )}\n {loading ? (\n <Flex container={{ justify: 'center', alignItems: 'center' }} item={{ grow: 1 }}>\n <Progress as={StyledLoading} placement='inline' />\n </Flex>\n ) : (\n renderContent\n )}\n {(viewAllProps?.href || viewAllProps?.onClick) && !!items.length && !loading && (\n <StyledDrawerViewAll {...viewAllProps} as={viewAllProps.href ? 'a' : 'button'}>\n {t('view_all')}\n </StyledDrawerViewAll>\n )}\n </Flex>\n );\n};\nconst AppShellList: FunctionComponent<AppShellListProps> = ({ listView }) => {\n return (\n <Flex as={StyledAppShellListWrapper} container={{ direction: 'column' }}>\n {listView.map(listItem => (\n <List {...listItem} key={listItem.id} />\n ))}\n </Flex>\n );\n};\n\nexport default AppShellList;\n"]}
1
+ {"version":3,"file":"AppShellList.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAML,UAAU,EACV,MAAM,EACP,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAC7D,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,O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AC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAE,yBAAyB,YAC7C,WAAW,GACP,CACR,EACA,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAC7E,KAAC,QAAQ,IAAC,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,QAAQ,GAAG,GAC7C,CACR,CAAC,CAAC,CAAC,CACF,aAAa,CACd,EACA,CAAC,YAAY,EAAE,IAAI,IAAI,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,IAAI,CAC9E,KAAC,mBAAmB,OAAK,YAAY,EAAE,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,YAC1E,CAAC,CAAC,UAAU,CAAC,GACM,CACvB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,YAAY,GAAyC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YACpE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CACxB,eAAC,IAAI,OAAK,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAI,CACzC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n FunctionComponent,\n Ref,\n MouseEvent,\n ReactNode,\n KeyboardEvent,\n useContext,\n useRef\n} from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport Alert from '../Badges/Alert';\nimport Button from '../Button';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport * as pinIcon from '../Icon/icons/pin.icon';\nimport * as pinSolidIcon from '../Icon/icons/pin-solid.icon';\nimport MetaList from '../MetaList';\nimport EmptyState from '../EmptyState';\nimport Progress from '../Progress';\nimport SummaryItem from '../SummaryItem';\nimport Text from '../Text';\nimport { useI18n } from '../../hooks';\n\nimport { StyledLoading } from './AppShell.styles';\nimport {\n StyledAppShellListWrapper,\n StyledAppShellList,\n StyledAppShellSummaryList,\n StyledAppShellMetaList,\n StyledNotificationPrimary,\n StyledNotificationSecondary,\n StyledAppShellPinButton,\n EmptyStateColorContrast,\n StyledAppShellListSection,\n StyledAppShellListHeading,\n StyledNotificationVisual\n} from './AppShellList.styles';\nimport { StyledDrawerViewAll } from './Drawer.styles';\nimport { AppShellDrawerContext } from './AppShellContext';\n\nregisterIcon(pinIcon, pinSolidIcon);\n\nexport type ListInteractionEvent = MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>;\nexport interface ListProps {\n /** An id representing the item. */\n id: string;\n ref?: Ref<HTMLDivElement>;\n items: (AppShellListItemProps & ForwardProps)[];\n headingText?: string;\n emptyText: string;\n loading?: boolean;\n viewAll?: {\n onClick?: (e: MouseEvent) => void;\n href?: string;\n } & ForwardProps;\n newNotifications?: number;\n displayPins?: boolean;\n onItemClick?: (id: string, event: ListInteractionEvent) => void;\n onItemPinToggle?: (id: string) => void;\n}\nexport interface AppShellListProps {\n listView: ListProps[];\n}\nexport interface AppShellListItemProps extends BaseProps {\n /** An id representing the item. */\n id: string;\n /** The primary text for the item. */\n primary: string;\n /** Secondary text that will be rendered as a Meta List. */\n secondary?: string[];\n /** A visual associated with the item. */\n visual?: ReactNode;\n /** A flag indicating if the item has been read. */\n unread?: boolean;\n /** Icon for displaying at the end of items */\n pinned?: boolean;\n /** URL or DOM id to navigate to. */\n href?: string;\n /** The onClick handler for the item. */\n onClick?: (id: string, event: ListInteractionEvent) => void;\n /** The handler hat is called when a pin icon is toggled on an item. */\n onPinToggle?: (id: string) => void;\n}\n\nconst List = ({\n headingText,\n emptyText,\n items,\n loading = false,\n displayPins = false,\n onItemClick,\n onItemPinToggle,\n viewAll: viewAllProps\n}: ListProps) => {\n const t = useI18n();\n const { closeDrawer } = useContext(AppShellDrawerContext);\n const pinButtons = useRef<Record<string, HTMLButtonElement>>({});\n\n const renderContent = items.length ? (\n <Flex as={StyledAppShellList} item={{ grow: 1 }}>\n {items.map(\n ({\n id,\n primary,\n secondary,\n visual,\n unread,\n href,\n onClick,\n pinned,\n onPinToggle,\n ...restProps\n }: AppShellListItemProps) => {\n const onSummaryItemClick = (e: ListInteractionEvent) => {\n onClick?.(id, e);\n onItemClick?.(id, e);\n\n if (!pinButtons.current[id]?.contains(e.target as Node)) {\n closeDrawer();\n }\n };\n\n return (\n <StyledAppShellSummaryList key={id}>\n <SummaryItem\n {...restProps}\n as={href ? 'a' : 'button'}\n primary={\n <StyledNotificationPrimary unread={unread}>{primary}</StyledNotificationPrimary>\n }\n secondary={\n secondary?.length ? (\n <StyledNotificationSecondary unread={unread}>\n <MetaList as={StyledAppShellMetaList} items={secondary} />\n </StyledNotificationSecondary>\n ) : undefined\n }\n visual={\n visual || unread ? (\n <StyledNotificationVisual unread={unread} visualIncluded={!!visual}>\n {visual} <Alert variant='urgent' />\n </StyledNotificationVisual>\n ) : undefined\n }\n href={href}\n onClick={onSummaryItemClick}\n onKeyDown={(e: KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onSummaryItemClick(e);\n }\n }}\n actions={\n displayPins ? (\n <Button\n ref={el => {\n if (!el) delete pinButtons.current[id];\n else pinButtons.current[id] = el;\n }}\n icon\n as={StyledAppShellPinButton}\n forwardedAs='div'\n onClick={() => {\n onPinToggle?.(id);\n onItemPinToggle?.(id);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Enter') {\n onPinToggle?.(id);\n onItemPinToggle?.(id);\n }\n }}\n role='button'\n tabIndex={0}\n >\n <Icon name={pinned ? 'pin-solid' : 'pin'} />\n </Button>\n ) : undefined\n }\n tabIndex={0}\n />\n </StyledAppShellSummaryList>\n );\n }\n )}\n </Flex>\n ) : (\n <Flex\n as={EmptyStateColorContrast}\n container={{ justify: 'center', alignItems: 'center' }}\n item={{ grow: 1 }}\n >\n <EmptyState message={emptyText} />\n </Flex>\n );\n\n return (\n <Flex as={StyledAppShellListSection} container={{ direction: 'column' }}>\n {headingText && (\n <Text variant='h3' as={StyledAppShellListHeading}>\n {headingText}\n </Text>\n )}\n {loading ? (\n <Flex container={{ justify: 'center', alignItems: 'center' }} item={{ grow: 1 }}>\n <Progress as={StyledLoading} placement='inline' />\n </Flex>\n ) : (\n renderContent\n )}\n {(viewAllProps?.href || viewAllProps?.onClick) && !!items.length && !loading && (\n <StyledDrawerViewAll {...viewAllProps} as={viewAllProps.href ? 'a' : 'button'}>\n {t('view_all')}\n </StyledDrawerViewAll>\n )}\n </Flex>\n );\n};\nconst AppShellList: FunctionComponent<AppShellListProps> = ({ listView }) => {\n return (\n <Flex as={StyledAppShellListWrapper} container={{ direction: 'column' }}>\n {listView.map(listItem => (\n <List {...listItem} key={listItem.id} />\n ))}\n </Flex>\n );\n};\n\nexport default AppShellList;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellList.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.styles.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,yBAAyB,yGAkBpC,CAAC;AAIH,eAAO,MAAM,kBAAkB,wGAAc,CAAC;AAI9C,eAAO,MAAM,yBAAyB,wGAwBpC,CAAC;AAIH,eAAO,MAAM,sBAAsB,wGAIlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,4GAiBlC,CAAC;AAIH,eAAO,MAAM,wBAAwB;;;SAepC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;SAOpC,CAAC;AAIH,eAAO,MAAM,2BAA2B;;SAUvC,CAAC;AAIF,eAAO,MAAM,uBAAuB,yGAOnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,yGAUpC,CAAC;AAIH,eAAO,MAAM,yBAAyB,wGAQpC,CAAC"}
1
+ {"version":3,"file":"AppShellList.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.styles.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,yBAAyB,yGAkBpC,CAAC;AAIH,eAAO,MAAM,kBAAkB,wGAAc,CAAC;AAI9C,eAAO,MAAM,yBAAyB,wGAwBpC,CAAC;AAIH,eAAO,MAAM,sBAAsB,wGAIlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,4GAiBlC,CAAC;AAIH,eAAO,MAAM,wBAAwB;;;SAepC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;SAOpC,CAAC;AAIH,eAAO,MAAM,2BAA2B;;SAUvC,CAAC;AAIF,eAAO,MAAM,uBAAuB,yGAOnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,yGAUpC,CAAC;AAIH,eAAO,MAAM,yBAAyB,wGAQpC,CAAC"}
@@ -6,7 +6,6 @@ import { StyledAlert } from '../Badges/Alert';
6
6
  import { StyledEmptyState } from '../EmptyState';
7
7
  import { StyledSummaryItem } from '../SummaryItem';
8
8
  import { StyledText } from '../Text';
9
- /* AppShellList styles */
10
9
  export const StyledAppShellListWrapper = styled.div(({ theme }) => {
11
10
  return css `
12
11
  max-height: 100%;
@@ -90,7 +89,7 @@ export const StyledNotificationVisual = styled.span(({ theme, unread, visualIncl
90
89
  background-color: ${theme.base.palette.light};
91
90
  height: 0.3125rem;
92
91
  width: 0.3125rem;
93
- } ;
92
+ }
94
93
  `;
95
94
  });
96
95
  StyledNotificationVisual.defaultProps = defaultThemeProp;
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellList.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG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port { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledAlert } from '../Badges/Alert';\nimport { StyledEmptyState } from '../EmptyState';\nimport { StyledSummaryItem } from '../SummaryItem';\nimport { StyledText } from '../Text';\n\n/* AppShellList styles */\nexport const StyledAppShellListWrapper = styled.div(({ theme }) => {\n return css`\n max-height: 100%;\n white-space: nowrap;\n\n ${StyledSummaryItem} {\n position: relative;\n &::after {\n content: '';\n position: absolute;\n top: calc(100% - 0.03125rem);\n inset-inline-end: 1rem;\n inset-inline-start: 1rem;\n height: 0.0625rem;\n background-color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n `;\n});\n\nStyledAppShellListWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellList = styled.ul``;\n\nStyledAppShellList.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellSummaryList = styled.li(({ theme }) => {\n return css`\n ${StyledSummaryItem} {\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n color: inherit;\n background-color: transparent;\n border: none;\n text-decoration: none;\n cursor: pointer;\n text-align: start;\n white-space: normal;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n `;\n});\n\nStyledAppShellSummaryList.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellMetaList = styled.ul`\n li {\n color: inherit;\n }\n`;\n\nexport const StyledAppShellPinButton = styled.button(({ theme }) => {\n return css`\n color: inherit;\n border: none;\n background-color: transparent;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n `;\n});\n\nStyledAppShellPinButton.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationVisual = styled.span<{ unread?: boolean; visualIncluded?: boolean }>(\n ({ theme, unread, visualIncluded }) => {\n return css`\n position: relative;\n ${StyledAlert} {\n display: ${unread ? 'auto' : 'none'};\n position: absolute;\n inset-inline-start: -0.65625rem;\n top: ${visualIncluded ? 'calc(50% - 0.15625rem)' : '0.5rem'};\n background-color: ${theme.base.palette.light};\n height: 0.3125rem;\n width: 0.3125rem;\n } ;\n `;\n }\n);\n\nStyledNotificationVisual.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationPrimary = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n font-weight: ${unread\n ? theme.base['font-weight'].bold\n : theme.base['font-weight']['semi-bold']};\n color: ${unread ? theme.base.palette.light : 'inherit'};\n `;\n});\n\nStyledNotificationPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationSecondary = styled.span<{ unread?: boolean }>(\n ({ theme, unread }) => {\n return css`\n ${StyledText} {\n opacity: ${unread\n ? theme.base.transparency['transparent-1']\n : theme.base.transparency['transparent-3']};\n }\n `;\n }\n);\n\nStyledNotificationSecondary.defaultProps = defaultThemeProp;\n\nexport const EmptyStateColorContrast = styled.div`\n ${StyledEmptyState} {\n span,\n svg {\n color: rgba(255, 255, 255, 0.7);\n }\n }\n`;\n\nexport const StyledAppShellListSection = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n border-top: 0.0625rem solid ${borderColor};\n min-height: max(20%, 8rem);\n overflow-y: auto;\n `;\n});\n\nStyledAppShellListSection.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellListHeading = styled.h3(({ theme }) => {\n return css`\n position: sticky;\n top: 0;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n background-color: hsl(207 14% 13% / 1);\n z-index: 1;\n `;\n});\n\nStyledAppShellListHeading.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"AppShellList.styles.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShellList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,O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cesContent":["import { lighten } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledAlert } from '../Badges/Alert';\nimport { StyledEmptyState } from '../EmptyState';\nimport { StyledSummaryItem } from '../SummaryItem';\nimport { StyledText } from '../Text';\n\nexport const StyledAppShellListWrapper = styled.div(({ theme }) => {\n return css`\n max-height: 100%;\n white-space: nowrap;\n\n ${StyledSummaryItem} {\n position: relative;\n &::after {\n content: '';\n position: absolute;\n top: calc(100% - 0.03125rem);\n inset-inline-end: 1rem;\n inset-inline-start: 1rem;\n height: 0.0625rem;\n background-color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n `;\n});\n\nStyledAppShellListWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellList = styled.ul``;\n\nStyledAppShellList.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellSummaryList = styled.li(({ theme }) => {\n return css`\n ${StyledSummaryItem} {\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n color: inherit;\n background-color: transparent;\n border: none;\n text-decoration: none;\n cursor: pointer;\n text-align: start;\n white-space: normal;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n `;\n});\n\nStyledAppShellSummaryList.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellMetaList = styled.ul`\n li {\n color: inherit;\n }\n`;\n\nexport const StyledAppShellPinButton = styled.button(({ theme }) => {\n return css`\n color: inherit;\n border: none;\n background-color: transparent;\n\n &:hover,\n &:focus {\n color: ${theme.base.colors.white};\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n `;\n});\n\nStyledAppShellPinButton.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationVisual = styled.span<{ unread?: boolean; visualIncluded?: boolean }>(\n ({ theme, unread, visualIncluded }) => {\n return css`\n position: relative;\n ${StyledAlert} {\n display: ${unread ? 'auto' : 'none'};\n position: absolute;\n inset-inline-start: -0.65625rem;\n top: ${visualIncluded ? 'calc(50% - 0.15625rem)' : '0.5rem'};\n background-color: ${theme.base.palette.light};\n height: 0.3125rem;\n width: 0.3125rem;\n }\n `;\n }\n);\n\nStyledNotificationVisual.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationPrimary = styled.span<{ unread?: boolean }>(({ theme, unread }) => {\n return css`\n font-weight: ${unread\n ? theme.base['font-weight'].bold\n : theme.base['font-weight']['semi-bold']};\n color: ${unread ? theme.base.palette.light : 'inherit'};\n `;\n});\n\nStyledNotificationPrimary.defaultProps = defaultThemeProp;\n\nexport const StyledNotificationSecondary = styled.span<{ unread?: boolean }>(\n ({ theme, unread }) => {\n return css`\n ${StyledText} {\n opacity: ${unread\n ? theme.base.transparency['transparent-1']\n : theme.base.transparency['transparent-3']};\n }\n `;\n }\n);\n\nStyledNotificationSecondary.defaultProps = defaultThemeProp;\n\nexport const EmptyStateColorContrast = styled.div`\n ${StyledEmptyState} {\n span,\n svg {\n color: rgba(255, 255, 255, 0.7);\n }\n }\n`;\n\nexport const StyledAppShellListSection = styled.div(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n\n return css`\n border-top: 0.0625rem solid ${borderColor};\n min-height: max(20%, 8rem);\n overflow-y: auto;\n `;\n});\n\nStyledAppShellListSection.defaultProps = defaultThemeProp;\n\nexport const StyledAppShellListHeading = styled.h3(({ theme }) => {\n return css`\n position: sticky;\n top: 0;\n padding: ${theme.base.spacing} calc(2 * ${theme.base.spacing});\n background-color: hsl(207 14% 13% / 1);\n z-index: 1;\n `;\n});\n\nStyledAppShellListHeading.defaultProps = defaultThemeProp;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationList.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EASH,MAAM,OAAO,CAAC;AA0Bf,OAAO,EACL,gBAAgB,EAEhB,YAAY,EAEb,MAAM,kBAAkB,CAAC;AA0F1B,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,gBAAgB,CAuInD,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,CA2DpC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"NavigationList.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EASH,MAAM,OAAO,CAAC;AA0Bf,OAAO,EACL,gBAAgB,EAEhB,YAAY,EAEb,MAAM,kBAAkB,CAAC;AA0F1B,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,gBAAgB,CAsInD,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,CA2DpC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationList.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAGL,cAAc,EAGd,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,O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a,GAAG,cAAc,CAAC;aAChC;iBAAM;gBACL,aAAa,GAAG,kBAAkB,CAAC;aACpC;YAED,OAAO,CACL,KAAC,aAAa,IAEZ,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,KACtB,IAAI,IAHH,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAI5B,CACH,CAAC;QACJ,CAAC,CAAC,GACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n ElementType,\n FC,\n isValidElement,\n MouseEvent,\n MouseEventHandler,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState\n} from 'react';\n\nimport {\n useTheme,\n useArrows,\n useConsolidatedRef,\n useDirection,\n useUID,\n useI18n,\n useEscape\n} from '../../hooks';\nimport ExpandCollapse from '../ExpandCollapse';\nimport BareButton from '../Button/BareButton';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport Text from '../Text';\nimport Button from '../Button';\nimport { OmitStrict } from '../../types';\nimport { PopoverProps } from '../Popover';\nimport Link from '../Link';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as checkIcon from '../Icon/icons/check.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\n\nimport NavigationListItemWrapper from './NavigationListItemWrapper';\nimport {\n NavListItemProps,\n NavListItemWrapperProps,\n NavListProps,\n NavMenuProps\n} from './AppShell.types';\nimport {\n StyledNavList,\n StyledNestedNavList,\n StyledNavItemIconBox,\n StyledNavListItem,\n StyledNavListItemExpandCollapse,\n StyledCaseClose,\n StyledSingleSelectIconBox\n} from './AppShell.styles';\nimport AppShellContext from './AppShellContext';\n\nregisterIcon(timesIcon, checkIcon, caretLeftIcon, caretRightIcon);\n\nconst NavigationMenu: FC<NavMenuProps> = props => {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n onDismiss,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const uid = useUID();\n\n const { navState } = useContext(AppShellContext);\n const [collapsed, setCollapsed] = useState(true);\n\n const toggleCollapsed = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n setCollapsed(state => !state);\n },\n [setCollapsed]\n );\n\n const itemRef = useConsolidatedRef(forwardedRef);\n\n const menuRef = useRef<HTMLLIElement>(null);\n\n useArrows(menuRef, { selector: '[role=\"menuitem\"]', cycle: true });\n\n useEscape(() => {\n setCollapsed(true);\n itemRef.current?.focus();\n }, menuRef);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem {...restProps} key={primary} nestedListCollapsed={collapsed} ref={menuRef}>\n <BareButton\n id={uid}\n ref={itemRef}\n aria-expanded={!collapsed}\n aria-controls={`${uid}-menu`}\n aria-label={primary}\n onClick={toggleCollapsed}\n >\n {visual && <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>}\n\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n\n {navState === 'open' && <Icon name={`caret-${end}`} as={StyledNavListItemExpandCollapse} />}\n </BareButton>\n\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <NavigationList\n id={`${uid}-menu`}\n nestedList\n items={items}\n collapsed={!navOpen || collapsed}\n />\n </StyledNavListItem>\n );\n};\n\nexport const NavigationListItem: FC<NavListItemProps> = ({\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n collapseItems = false,\n onDismiss,\n actions,\n forwardedRef,\n isMenuItem,\n count,\n singleSelect,\n selected,\n 'aria-labelledby': ariaLabelledBy,\n ...restProps\n}) => {\n const { navOpen, navState } = useContext(AppShellContext);\n const t = useI18n();\n const listItemRef = useConsolidatedRef(forwardedRef);\n const [menuState, setMenuState] = useState('');\n const hasItems =\n (Array.isArray(items) && items.length > 0) || (Array.isArray(actions) && actions.length > 0);\n const compProps: {\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n 'aria-label'?: string;\n } = {\n onClick: (e: MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>) => {\n e.stopPropagation();\n onClick?.(e);\n },\n href\n };\n\n let caseItems: NavListItemWrapperProps['items'] | undefined;\n if (onDismiss) {\n caseItems = [\n {\n primary: t('go_to_noun', [primary]),\n onClick\n },\n {\n primary: t('dismiss_case'),\n onClick: onDismiss\n }\n ];\n }\n\n let Component: ElementType;\n\n if (href) {\n Component = Link;\n } else {\n Component = BareButton;\n }\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n if (navOpen && isMenuItem && listItemRef.current?.parentElement?.matches(':first-child'))\n listItemRef.current?.focus();\n }, [navOpen]);\n\n const { end } = useDirection();\n const primaryId = useUID();\n\n return (\n <StyledNavListItem {...restProps} key={primary} singleSelect={singleSelect} nestedListCollapsed>\n {/* forwardedRef typed as 'any' due to ambiguity of Component element type */}\n <NavigationListItemWrapper\n tooltipLabel={secondary ? `${primary} ${secondary}` : primary}\n label={primary}\n childElementRef={listItemRef}\n items={actions || items || caseItems}\n onMenuToggle={setMenuState}\n >\n <Component\n {...compProps}\n ref={listItemRef}\n {...(navOpen && isMenuItem ? { tabIndex: -1, role: 'menuitem' } : {})}\n aria-labelledby={`${primaryId} ${count ? `${primary}-count` : ''} ${ariaLabelledBy}`}\n {...(hasItems && { 'aria-haspopup': 'menu', 'aria-expanded': menuState === 'open' })}\n >\n {singleSelect && (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledSingleSelectIconBox}\n >\n {selected && <Icon name='check' />}\n </Flex>\n )}\n\n {visual && <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>}\n\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span id={primaryId}>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span id={primaryId}>{primary}</span>\n )}\n\n {(hasItems || actions) && navState === 'open' && (\n <Icon name={`caret-${end}`} as={StyledNavListItemExpandCollapse} />\n )}\n </Component>\n </NavigationListItemWrapper>\n\n {onDismiss && navOpen && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n\n {hasItems && (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <NavigationList nestedList items={actions || items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n};\n\nconst NavigationList: FC<NavListProps> = ({\n items = [],\n nestedList,\n id,\n collapsed,\n singleSelect\n}) => {\n let Component: ElementType = StyledNavList;\n let ItemComponent: ElementType;\n const { navOpen } = useContext(AppShellContext);\n\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...(nestedList ? { role: 'menu', id } : {})} {...fwdProps}>\n {items.map(item => {\n if (isValidElement(item)) return item;\n\n if (item.items && item.items.length > 0 && navOpen) {\n ItemComponent = NavigationMenu;\n } else {\n ItemComponent = NavigationListItem;\n }\n\n return (\n <ItemComponent\n key={item.id || item.primary}\n isMenuItem={nestedList}\n singleSelect={singleSelect}\n {...item}\n />\n );\n })}\n </Component>\n );\n};\n\nexport default NavigationList;\n"]}
1
+ {"version":3,"file":"NavigationList.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAGL,cAAc,EAGd,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACN,OAAO,EACP,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAG/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AAEjE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAOpE,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,+BAA+B,EAC/B,eAAe,EACf,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;AAElE,MAAM,cAAc,GAAqB,KAAK,CAAC,EAAE;IAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,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W,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;YACvB,eAAe,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK;YACtF,GAAG,QAAQ;SACZ,CAAC;QAEF,SAAS,GAAG,mBAAmB,CAAC;KACjC;IAED,OAAO,CACL,KAAC,SAAS,OAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAM,QAAQ,YAClE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChB,IAAI,cAAc,CAAM,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC;YAE3C,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,EAAE;gBAClD,aAAa,GAAG,cAAc,CAAC;aAChC;iBAAM;gBACL,aAAa,GAAG,kBAAkB,CAAC;aACpC;YAED,OAAO,CACL,KAAC,aAAa,IAEZ,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,KACtB,IAAI,IAHH,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAI5B,CACH,CAAC;QACJ,CAAC,CAAC,GACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n ElementType,\n FC,\n isValidElement,\n MouseEvent,\n MouseEventHandler,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState\n} from 'react';\n\nimport {\n useTheme,\n useArrows,\n useConsolidatedRef,\n useDirection,\n useUID,\n useI18n,\n useEscape\n} from '../../hooks';\nimport ExpandCollapse from '../ExpandCollapse';\nimport BareButton from '../Button/BareButton';\nimport Flex from '../Flex';\nimport Icon, { registerIcon } from '../Icon';\nimport Text from '../Text';\nimport Button from '../Button';\nimport { OmitStrict } from '../../types';\nimport { PopoverProps } from '../Popover';\nimport Link from '../Link';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as checkIcon from '../Icon/icons/check.icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\n\nimport NavigationListItemWrapper from './NavigationListItemWrapper';\nimport {\n NavListItemProps,\n NavListItemWrapperProps,\n NavListProps,\n NavMenuProps\n} from './AppShell.types';\nimport {\n StyledNavList,\n StyledNestedNavList,\n StyledNavItemIconBox,\n StyledNavListItem,\n StyledNavListItemExpandCollapse,\n StyledCaseClose,\n StyledSingleSelectIconBox\n} from './AppShell.styles';\nimport AppShellContext from './AppShellContext';\n\nregisterIcon(timesIcon, checkIcon, caretLeftIcon, caretRightIcon);\n\nconst NavigationMenu: FC<NavMenuProps> = props => {\n const { navOpen } = useContext(AppShellContext);\n const {\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n onDismiss,\n actions,\n forwardedRef,\n ...restProps\n } = props;\n\n const uid = useUID();\n\n const { navState } = useContext(AppShellContext);\n const [collapsed, setCollapsed] = useState(true);\n\n const toggleCollapsed = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n setCollapsed(state => !state);\n },\n [setCollapsed]\n );\n\n const itemRef = useConsolidatedRef(forwardedRef);\n\n const menuRef = useRef<HTMLLIElement>(null);\n\n useArrows(menuRef, { selector: '[role=\"menuitem\"]', cycle: true });\n\n useEscape(() => {\n setCollapsed(true);\n itemRef.current?.focus();\n }, menuRef);\n\n const { end } = useDirection();\n\n return (\n <StyledNavListItem {...restProps} key={primary} nestedListCollapsed={collapsed} ref={menuRef}>\n <BareButton\n id={uid}\n ref={itemRef}\n aria-expanded={!collapsed}\n aria-controls={`${uid}-menu`}\n aria-label={primary}\n onClick={toggleCollapsed}\n >\n {visual && <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>}\n\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span>{primary}</span>\n )}\n\n {navState === 'open' && <Icon name={`caret-${end}`} as={StyledNavListItemExpandCollapse} />}\n </BareButton>\n\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <NavigationList\n id={`${uid}-menu`}\n nestedList\n items={items}\n collapsed={!navOpen || collapsed}\n />\n </StyledNavListItem>\n );\n};\n\nexport const NavigationListItem: FC<NavListItemProps> = ({\n visual,\n primary,\n secondary,\n href,\n onClick,\n items,\n collapseItems = false,\n onDismiss,\n actions,\n forwardedRef,\n isMenuItem,\n count,\n singleSelect,\n selected,\n 'aria-labelledby': ariaLabelledBy,\n ...restProps\n}) => {\n const { navOpen, navState } = useContext(AppShellContext);\n const t = useI18n();\n const listItemRef = useConsolidatedRef(forwardedRef);\n const [menuState, setMenuState] = useState('');\n const hasItems =\n (Array.isArray(items) && items.length > 0) || (Array.isArray(actions) && actions.length > 0);\n const compProps: {\n href?: string;\n onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>;\n actions?: NavListItemProps['actions'];\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n 'aria-label'?: string;\n } = {\n onClick: (e: MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLDivElement>) => {\n e.stopPropagation();\n onClick?.(e);\n },\n href\n };\n\n let caseItems: NavListItemWrapperProps['items'] | undefined;\n if (onDismiss) {\n caseItems = [\n {\n primary: t('go_to_noun', [primary]),\n onClick\n },\n {\n primary: t('dismiss_case'),\n onClick: onDismiss\n }\n ];\n }\n\n let Component: ElementType;\n\n if (href) {\n Component = Link;\n } else {\n Component = BareButton;\n }\n\n useEffect(() => {\n if (!navOpen && actions) {\n const node = document.getElementsByTagName('body')[0];\n const clickEvent = document.createEvent('MouseEvent');\n clickEvent.initEvent('mousedown', true, true);\n node.dispatchEvent(clickEvent);\n }\n if (navOpen && isMenuItem && listItemRef.current?.parentElement?.matches(':first-child'))\n listItemRef.current?.focus();\n }, [navOpen]);\n\n const { end } = useDirection();\n const primaryId = useUID();\n\n return (\n <StyledNavListItem {...restProps} key={primary} singleSelect={singleSelect} nestedListCollapsed>\n <NavigationListItemWrapper\n tooltipLabel={secondary ? `${primary} ${secondary}` : primary}\n label={primary}\n childElementRef={listItemRef}\n items={actions || items || caseItems}\n onMenuToggle={setMenuState}\n >\n <Component\n {...compProps}\n ref={listItemRef}\n {...(navOpen && isMenuItem ? { tabIndex: -1, role: 'menuitem' } : {})}\n aria-labelledby={`${primaryId} ${count ? `${primary}-count` : ''} ${ariaLabelledBy}`}\n {...(hasItems && { 'aria-haspopup': 'menu', 'aria-expanded': menuState === 'open' })}\n >\n {singleSelect && (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledSingleSelectIconBox}\n >\n {selected && <Icon name='check' />}\n </Flex>\n )}\n\n {visual && <StyledNavItemIconBox>{visual}</StyledNavItemIconBox>}\n\n {secondary ? (\n <Flex container={{ direction: 'column', alignItems: 'start' }}>\n <span id={primaryId}>{primary}</span>\n <Text variant='secondary'>{secondary}</Text>\n </Flex>\n ) : (\n <span id={primaryId}>{primary}</span>\n )}\n\n {(hasItems || actions) && navState === 'open' && (\n <Icon name={`caret-${end}`} as={StyledNavListItemExpandCollapse} />\n )}\n </Component>\n </NavigationListItemWrapper>\n\n {onDismiss && navOpen && (\n <Button\n icon\n variant='simple'\n as={StyledCaseClose}\n onClick={onDismiss}\n aria-label={t('dismiss_case')}\n >\n <Icon name='times' />\n </Button>\n )}\n\n {hasItems && (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <NavigationList nestedList items={actions || items} collapsed={!navOpen || collapseItems} />\n )}\n </StyledNavListItem>\n );\n};\n\nconst NavigationList: FC<NavListProps> = ({\n items = [],\n nestedList,\n id,\n collapsed,\n singleSelect\n}) => {\n let Component: ElementType = StyledNavList;\n let ItemComponent: ElementType;\n const { navOpen } = useContext(AppShellContext);\n\n let fwdProps: {\n as?: ElementType;\n forwardedAs?: ElementType;\n nullWhenCollapsed?: boolean;\n transitionSpeed?: string;\n collapsed: boolean;\n } = {\n collapsed: !!collapsed\n };\n\n const {\n base: { animation }\n } = useTheme();\n\n if (nestedList) {\n fwdProps = {\n as: ExpandCollapse,\n forwardedAs: 'ul',\n nullWhenCollapsed: true,\n transitionSpeed: items.length >= 10 ? `calc(2 * ${animation.speed})` : animation.speed,\n ...fwdProps\n };\n\n Component = StyledNestedNavList;\n }\n\n return (\n <Component {...(nestedList ? { role: 'menu', id } : {})} {...fwdProps}>\n {items.map(item => {\n if (isValidElement<any>(item)) return item;\n\n if (item.items && item.items.length > 0 && navOpen) {\n ItemComponent = NavigationMenu;\n } else {\n ItemComponent = NavigationListItem;\n }\n\n return (\n <ItemComponent\n key={item.id || item.primary}\n isMenuItem={nestedList}\n singleSelect={singleSelect}\n {...item}\n />\n );\n })}\n </Component>\n );\n};\n\nexport default NavigationList;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationListItemWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationListItemWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA2C,MAAM,OAAO,CAAC;AAYpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAsC3D,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,uBAAuB,CAkLhD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"NavigationListItemWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationListItemWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA0E,MAAM,OAAO,CAAC;AAYnG,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAiD3D,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,uBAAuB,CA8LhD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,19 +1,30 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext, useEffect, useRef, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { useDirection, useEscape, useFocusWithin, useOuterEvent, usePrevious } from '../../hooks';
4
+ import { useDirection, useEscape, useOuterEvent } from '../../hooks';
5
5
  import Text from '../Text';
6
6
  import Tooltip from '../Tooltip';
7
7
  import Popover from '../Popover';
8
8
  import Menu from '../Menu';
9
- import { StyledMenuListContainer } from '../Menu/Menu.styles';
9
+ import { StyledMenu, StyledMenuListContainer, StyledMenuListWrapper } from '../Menu/Menu.styles';
10
10
  import { defaultThemeProp } from '../../theme';
11
11
  import { calculateFontSize } from '../../styles';
12
12
  import AppShellContext from './AppShellContext';
13
13
  const StyledNavigationPopover = styled.div(({ theme }) => {
14
14
  const headingFontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']).s;
15
15
  return css `
16
+ display: flex;
16
17
  background-color: ${theme.components['app-shell'].nav['background-color']};
18
+
19
+ ${StyledMenu} {
20
+ display: flex;
21
+ flex-direction: column;
22
+ }
23
+
24
+ ${StyledMenuListWrapper} {
25
+ overflow: auto;
26
+ }
27
+
17
28
  &,
18
29
  ${StyledMenuListContainer} {
19
30
  background-color: ${theme.components['app-shell'].nav['background-color']};
@@ -45,14 +56,12 @@ const StyledNavigationPopover = styled.div(({ theme }) => {
45
56
  StyledNavigationPopover.defaultProps = defaultThemeProp;
46
57
  const ListItemWrapper = props => {
47
58
  const { children, childElementRef, label, tooltipLabel, items = [], content, onMenuToggle } = props;
48
- const { navOpen, collapsedHoverMenus } = useContext(AppShellContext);
59
+ const { navOpen, collapsedHoverMenus, headerEl } = useContext(AppShellContext);
49
60
  const popoverRef = useRef(null);
50
61
  const [popoverOpen, setPopoverOpen] = useState(false);
51
62
  const { end } = useDirection();
52
63
  const mousedOverMenu = useRef(false);
53
64
  const hidePopoverTimeout = useRef();
54
- const focusWithin = useFocusWithin([popoverRef, childElementRef]);
55
- const prevFocusWithin = usePrevious(focusWithin);
56
65
  const closePopover = (focusChildEl = true) => {
57
66
  if (popoverOpen) {
58
67
  setPopoverOpen(false);
@@ -138,14 +147,25 @@ const ListItemWrapper = props => {
138
147
  useEffect(() => {
139
148
  onMenuToggle?.(popoverOpen ? 'open' : 'close');
140
149
  }, [popoverOpen]);
141
- useEffect(() => {
142
- if (!focusWithin && prevFocusWithin) {
143
- setPopoverOpen(false);
144
- }
145
- }, [focusWithin, prevFocusWithin]);
146
150
  useEscape(() => closePopover(), childElementRef, [childElementRef]);
147
151
  useEscape(() => closePopover(), popoverRef, [popoverRef]);
148
- return (_jsxs(_Fragment, { children: [children, !navOpen && (_jsxs(_Fragment, { children: [!popoverOpen && (_jsx(Tooltip, { target: childElementRef.current, placement: end, showDelay: 'none', hideDelay: 'none', children: tooltipLabel })), popoverOpen && (items.length || content) && (_jsx(Popover, { target: childElementRef.current, placement: `${end}-start`, ref: popoverRef, as: StyledNavigationPopover, arrow: true, children: content ? (_jsx("div", { onMouseEnter: onMouseEnterContent, onMouseLeave: onMouseLeaveContent, children: content })) : (_jsx(Menu, { mode: 'action', variant: 'flyout', focusControlEl: childElementRef.current ?? undefined, scrollAt: 99, items: items.map(item => {
152
+ return (_jsxs(_Fragment, { children: [children, !navOpen && (_jsxs(_Fragment, { children: [!popoverOpen && (_jsx(Tooltip, { target: childElementRef.current, placement: end, showDelay: 'none', hideDelay: 'none', children: tooltipLabel })), popoverOpen && (items.length || content) && (_jsx(Popover, { target: childElementRef.current, placement: `${end}-start`, ref: popoverRef, as: StyledNavigationPopover, arrow: true, modifiers: headerEl
153
+ ? [
154
+ {
155
+ name: 'preventOverflow',
156
+ options: {
157
+ padding: {
158
+ top: headerEl.offsetHeight + 8,
159
+ right: 8,
160
+ bottom: 8,
161
+ left: 8
162
+ }
163
+ }
164
+ }
165
+ ]
166
+ : undefined, onClick: (e) => {
167
+ e.stopPropagation();
168
+ }, children: content ? (_jsx("div", { onMouseEnter: onMouseEnterContent, onMouseLeave: onMouseLeaveContent, children: content })) : (_jsx(Menu, { mode: 'action', variant: 'flyout', focusControlEl: childElementRef.current ?? undefined, scrollAt: 99, items: items.map(item => {
149
169
  return {
150
170
  id: (item.primary || item.text),
151
171
  primary: (item.primary || item.text),
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationListItemWrapper.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationListItemWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvD,MAAM,eAAe,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC;;MAEvE,uB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,EAAE,EAAE,uBAAuB,EAC3B,KAAK,kBAEJ,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,YACtE,OAAO,GACJ,CACP,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,QAAQ,EAChB,cAAc,EAAE,eAAe,CAAC,OAAO,IAAI,SAAS,EACpD,QAAQ,EAAE,EAAE,EACZ,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gCACtB,OAAO;oCACL,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAW;oCACzC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAW;oCAC9C,IAAI,EAAE,IAAI,CAAC,IAAI;oCACf,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;wCAChB,CAAC,CAAC,eAAe,EAAE,CAAC;wCACpB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;wCAClB,cAAc,CAAC,KAAK,CAAC,CAAC;oCACxB,CAAC;iCACF,CAAC;4BACJ,CAAC,CAAC,EACF,MAAM,EAAE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAQ,EACzC,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,mBAAmB,GACjC,CACH,GACO,CACX,IACA,CACJ,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC, useContext, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useDirection, useEscape, useFocusWithin, useOuterEvent, usePrevious } from '../../hooks';\nimport Text from '../Text';\nimport Tooltip from '../Tooltip';\nimport Popover from '../Popover';\nimport Menu from '../Menu';\nimport { StyledMenuListContainer } from '../Menu/Menu.styles';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\n\nimport { NavListItemWrapperProps } from './AppShell.types';\nimport AppShellContext from './AppShellContext';\n\nconst StyledNavigationPopover = styled.div(({ theme }) => {\n const headingFontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']).s;\n return css`\n background-color: ${theme.components['app-shell'].nav['background-color']};\n &,\n ${StyledMenuListContainer} {\n background-color: ${theme.components['app-shell'].nav['background-color']};\n\n header {\n color: ${theme.base.palette.light};\n border-bottom: none;\n opacity: 0.7;\n\n h2 {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${headingFontSize};\n }\n }\n }\n\n ${StyledMenuListContainer} li {\n color: rgba(255, 255, 255, 0.7);\n background-color: transparent;\n\n &:hover,\n &[data-current='true'] {\n color: #ffffff;\n background-color: rgba(255, 255, 255, 0.05);\n }\n }\n `;\n});\n\nStyledNavigationPopover.defaultProps = defaultThemeProp;\n\nconst ListItemWrapper: FC<NavListItemWrapperProps> = props => {\n const {\n children,\n childElementRef,\n label,\n tooltipLabel,\n items = [],\n content,\n onMenuToggle\n } = props;\n const { navOpen, collapsedHoverMenus } = useContext(AppShellContext);\n const popoverRef = useRef<HTMLDivElement>(null);\n const [popoverOpen, setPopoverOpen] = useState(false);\n const { end } = useDirection();\n const mousedOverMenu = useRef(false);\n const hidePopoverTimeout = useRef<number | null>();\n const focusWithin = useFocusWithin([popoverRef, childElementRef]);\n const prevFocusWithin = usePrevious(focusWithin);\n\n const closePopover = (focusChildEl: boolean = true) => {\n if (popoverOpen) {\n setPopoverOpen(false);\n if (focusChildEl) {\n childElementRef.current?.focus();\n }\n if (hidePopoverTimeout.current) {\n clearTimeout(hidePopoverTimeout.current);\n hidePopoverTimeout.current = null;\n }\n }\n };\n\n const onMouseEnterContent = () => {\n if (collapsedHoverMenus) {\n mousedOverMenu.current = true;\n }\n };\n\n const onMouseLeaveContent = () => {\n if (mousedOverMenu.current && collapsedHoverMenus) {\n mousedOverMenu.current = false;\n closePopover();\n }\n };\n\n useOuterEvent('click', [popoverRef], () => closePopover());\n\n useEffect(() => {\n const onClick = (e: Event) => {\n if (items.length || content) {\n if (!navOpen) {\n e.stopPropagation();\n e.preventDefault();\n }\n if (!navOpen && !popoverOpen) setPopoverOpen(true);\n else {\n setTimeout(() => {\n closePopover(false);\n }, 0);\n }\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Tab' && !content) {\n setPopoverOpen(false);\n }\n };\n\n const onMouseOut = (e: MouseEvent) => {\n if (hidePopoverTimeout.current) {\n clearTimeout(hidePopoverTimeout.current);\n hidePopoverTimeout.current = null;\n }\n const tag = (e.relatedTarget as HTMLElement).tagName;\n\n // If the mouse is mousing out from this nav item onto another nav item\n if (['A', 'BUTTON', 'FORM'].includes(tag)) {\n closePopover(false);\n } else {\n hidePopoverTimeout.current = window.setTimeout(() => {\n if (!mousedOverMenu.current) {\n closePopover(false);\n }\n }, 1000);\n }\n };\n\n childElementRef.current?.addEventListener('click', onClick);\n childElementRef.current?.addEventListener('keydown', onKeyDown);\n if (collapsedHoverMenus) {\n childElementRef.current?.addEventListener('mouseenter', onClick);\n childElementRef.current?.addEventListener('mouseleave', onMouseOut);\n }\n return () => {\n childElementRef.current?.removeEventListener('click', onClick);\n childElementRef.current?.removeEventListener('keydown', onKeyDown);\n if (collapsedHoverMenus) {\n childElementRef.current?.removeEventListener('mouseenter', onClick);\n childElementRef.current?.removeEventListener('mouseleave', onMouseOut);\n }\n if (hidePopoverTimeout.current) {\n clearTimeout(hidePopoverTimeout.current);\n hidePopoverTimeout.current = null;\n }\n };\n }, [items, content, navOpen, closePopover, collapsedHoverMenus]);\n\n useEffect(() => {\n onMenuToggle?.(popoverOpen ? 'open' : 'close');\n }, [popoverOpen]);\n\n useEffect(() => {\n if (!focusWithin && prevFocusWithin) {\n setPopoverOpen(false);\n }\n }, [focusWithin, prevFocusWithin]);\n\n useEscape(() => closePopover(), childElementRef, [childElementRef]);\n\n useEscape(() => closePopover(), popoverRef, [popoverRef]);\n\n return (\n <>\n {children}\n {!navOpen && (\n <>\n {!popoverOpen && (\n <Tooltip\n target={childElementRef.current}\n placement={end}\n showDelay='none'\n hideDelay='none'\n >\n {tooltipLabel}\n </Tooltip>\n )}\n {popoverOpen && (items.length || content) && (\n <Popover\n target={childElementRef.current}\n placement={`${end}-start`}\n ref={popoverRef}\n as={StyledNavigationPopover}\n arrow\n >\n {content ? (\n <div onMouseEnter={onMouseEnterContent} onMouseLeave={onMouseLeaveContent}>\n {content}\n </div>\n ) : (\n <Menu\n mode='action'\n variant='flyout'\n focusControlEl={childElementRef.current ?? undefined}\n scrollAt={99}\n items={items.map(item => {\n return {\n id: (item.primary || item.text) as string,\n primary: (item.primary || item.text) as string,\n href: item.href,\n onClick: (_, e) => {\n e.stopPropagation();\n item.onClick?.(e);\n setPopoverOpen(false);\n }\n };\n })}\n header={<Text variant='h2'>{label}</Text>}\n onMouseEnter={onMouseEnterContent}\n onMouseLeave={onMouseLeaveContent}\n />\n )}\n </Popover>\n )}\n </>\n )}\n </>\n );\n};\n\nexport default ListItemWrapper;\n"]}
1
+ {"version":3,"file":"NavigationListItemWrapper.js","sourceRoot":"","sources":["../../../src/components/AppShell/NavigationListItemWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAiC,MAAM,OAAO,CAAC;AACnG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,qBAA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CAChB,CAAC,CAAC,eAAe,EAAE,CAAC;wCACpB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;wCAClB,cAAc,CAAC,KAAK,CAAC,CAAC;oCACxB,CAAC;iCACF,CAAC;4BACJ,CAAC,CAAC,EACF,MAAM,EAAE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAQ,EACzC,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,mBAAmB,GACjC,CACH,GACO,CACX,IACA,CACJ,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC, useContext, useEffect, useRef, useState, MouseEvent as ReactMouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useDirection, useEscape, useOuterEvent } from '../../hooks';\nimport Text from '../Text';\nimport Tooltip from '../Tooltip';\nimport Popover from '../Popover';\nimport Menu from '../Menu';\nimport { StyledMenu, StyledMenuListContainer, StyledMenuListWrapper } from '../Menu/Menu.styles';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\n\nimport { NavListItemWrapperProps } from './AppShell.types';\nimport AppShellContext from './AppShellContext';\n\nconst StyledNavigationPopover = styled.div(({ theme }) => {\n const headingFontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']).s;\n return css`\n display: flex;\n background-color: ${theme.components['app-shell'].nav['background-color']};\n\n ${StyledMenu} {\n display: flex;\n flex-direction: column;\n }\n\n ${StyledMenuListWrapper} {\n overflow: auto;\n }\n\n &,\n ${StyledMenuListContainer} {\n background-color: ${theme.components['app-shell'].nav['background-color']};\n\n header {\n color: ${theme.base.palette.light};\n border-bottom: none;\n opacity: 0.7;\n\n h2 {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n font-size: ${headingFontSize};\n }\n }\n }\n\n ${StyledMenuListContainer} li {\n color: rgba(255, 255, 255, 0.7);\n background-color: transparent;\n\n &:hover,\n &[data-current='true'] {\n color: #ffffff;\n background-color: rgba(255, 255, 255, 0.05);\n }\n }\n `;\n});\n\nStyledNavigationPopover.defaultProps = defaultThemeProp;\n\nconst ListItemWrapper: FC<NavListItemWrapperProps> = props => {\n const {\n children,\n childElementRef,\n label,\n tooltipLabel,\n items = [],\n content,\n onMenuToggle\n } = props;\n const { navOpen, collapsedHoverMenus, headerEl } = useContext(AppShellContext);\n const popoverRef = useRef<HTMLDivElement>(null);\n const [popoverOpen, setPopoverOpen] = useState(false);\n const { end } = useDirection();\n const mousedOverMenu = useRef(false);\n const hidePopoverTimeout = useRef<number | null>();\n\n const closePopover = (focusChildEl: boolean = true) => {\n if (popoverOpen) {\n setPopoverOpen(false);\n if (focusChildEl) {\n childElementRef.current?.focus();\n }\n if (hidePopoverTimeout.current) {\n clearTimeout(hidePopoverTimeout.current);\n hidePopoverTimeout.current = null;\n }\n }\n };\n\n const onMouseEnterContent = () => {\n if (collapsedHoverMenus) {\n mousedOverMenu.current = true;\n }\n };\n\n const onMouseLeaveContent = () => {\n if (mousedOverMenu.current && collapsedHoverMenus) {\n mousedOverMenu.current = false;\n closePopover();\n }\n };\n\n useOuterEvent('click', [popoverRef], () => closePopover());\n\n useEffect(() => {\n const onClick = (e: Event) => {\n if (items.length || content) {\n if (!navOpen) {\n e.stopPropagation();\n e.preventDefault();\n }\n if (!navOpen && !popoverOpen) setPopoverOpen(true);\n else {\n setTimeout(() => {\n closePopover(false);\n }, 0);\n }\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Tab' && !content) {\n setPopoverOpen(false);\n }\n };\n\n const onMouseOut = (e: MouseEvent) => {\n if (hidePopoverTimeout.current) {\n clearTimeout(hidePopoverTimeout.current);\n hidePopoverTimeout.current = null;\n }\n const tag = (e.relatedTarget as HTMLElement).tagName;\n\n // If the mouse is mousing out from this nav item onto another nav item\n if (['A', 'BUTTON', 'FORM'].includes(tag)) {\n closePopover(false);\n } else {\n hidePopoverTimeout.current = window.setTimeout(() => {\n if (!mousedOverMenu.current) {\n closePopover(false);\n }\n }, 1000);\n }\n };\n\n childElementRef.current?.addEventListener('click', onClick);\n childElementRef.current?.addEventListener('keydown', onKeyDown);\n if (collapsedHoverMenus) {\n childElementRef.current?.addEventListener('mouseenter', onClick);\n childElementRef.current?.addEventListener('mouseleave', onMouseOut);\n }\n return () => {\n childElementRef.current?.removeEventListener('click', onClick);\n childElementRef.current?.removeEventListener('keydown', onKeyDown);\n if (collapsedHoverMenus) {\n childElementRef.current?.removeEventListener('mouseenter', onClick);\n childElementRef.current?.removeEventListener('mouseleave', onMouseOut);\n }\n if (hidePopoverTimeout.current) {\n clearTimeout(hidePopoverTimeout.current);\n hidePopoverTimeout.current = null;\n }\n };\n }, [items, content, navOpen, closePopover, collapsedHoverMenus]);\n\n useEffect(() => {\n onMenuToggle?.(popoverOpen ? 'open' : 'close');\n }, [popoverOpen]);\n\n useEscape(() => closePopover(), childElementRef, [childElementRef]);\n\n useEscape(() => closePopover(), popoverRef, [popoverRef]);\n\n return (\n <>\n {children}\n {!navOpen && (\n <>\n {!popoverOpen && (\n <Tooltip\n target={childElementRef.current}\n placement={end}\n showDelay='none'\n hideDelay='none'\n >\n {tooltipLabel}\n </Tooltip>\n )}\n {popoverOpen && (items.length || content) && (\n <Popover\n target={childElementRef.current}\n placement={`${end}-start`}\n ref={popoverRef}\n as={StyledNavigationPopover}\n arrow\n modifiers={\n headerEl\n ? [\n {\n name: 'preventOverflow',\n options: {\n padding: {\n top: headerEl.offsetHeight + 8,\n right: 8,\n bottom: 8,\n left: 8\n }\n }\n }\n ]\n : undefined\n }\n onClick={(e: ReactMouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n }}\n >\n {content ? (\n <div onMouseEnter={onMouseEnterContent} onMouseLeave={onMouseLeaveContent}>\n {content}\n </div>\n ) : (\n <Menu\n mode='action'\n variant='flyout'\n focusControlEl={childElementRef.current ?? undefined}\n scrollAt={99}\n items={items.map(item => {\n return {\n id: (item.primary || item.text) as string,\n primary: (item.primary || item.text) as string,\n href: item.href,\n onClick: (_, e) => {\n e.stopPropagation();\n item.onClick?.(e);\n setPopoverOpen(false);\n }\n };\n })}\n header={<Text variant='h2'>{label}</Text>}\n onMouseEnter={onMouseEnterContent}\n onMouseLeave={onMouseLeaveContent}\n />\n )}\n </Popover>\n )}\n </>\n )}\n </>\n );\n};\n\nexport default ListItemWrapper;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Operator.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/Operator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAO,SAAS,EAAuB,MAAM,OAAO,CAAC;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,QAAA,MAAM,QAAQ;cAQE,SAAS;aACV,aAAa,CAAC,SAAS,CAAC;;8DA+DtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Operator.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/Operator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAO,SAAS,EAAuB,MAAM,OAAO,CAAC;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,QAAA,MAAM,QAAQ;cAQE,SAAS;aACV,aAAa,CAAC,SAAS,CAAC;;8DA6DtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -29,9 +29,7 @@ const Operator = forwardRef(({ children, actions, popover, as }, ref) => {
29
29
  }, onBlur: () => {
30
30
  setShowMenu(false);
31
31
  }, children: children }), _jsx(Popover, { ...popover, show: showMenu, target: buttonRef.current, children: _jsx(Menu, { focusControlEl: buttonRef.current ?? undefined, mode: 'action', items: operatorMenuItems,
32
- /**
33
- * @see {@link MenuButton} implementation for explanation of conditions. This is in essence duplicated.
34
- */
32
+ /** @see {@link MenuButton} implementation for explanation of conditions. This is in essence duplicated. */
35
33
  onItemClick: (_, e) => {
36
34
  if (e
37
35
  .detail > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"Operator.js","sourceRoot":"","sources":["../../../src/components/AppShell/Operator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,IAAuB,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,QAAQ,GAAG,UAAU,CACzB,CACE,EACE,QAAQ,EACR,OAAO,EACP,OAAO,EACP,EAAE,EAKM,EACV,GAAuC,EACvC,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAE1C,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,EAAE;QACrC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAgB,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACtF,EAAE,EAAE,EAAE,IAAI,OAAO;YACjB,OAAO;YACP,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAClC,GAAG,IAAI;SACR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e,QAAQ,CAAC","sourcesContent":["import { forwardRef, useState, useEffect, useContext, useMemo } from 'react';\nimport type { Ref, ReactNode, MouseEvent, UIEvent } from 'react';\n\nimport BareButton from '../Button/BareButton';\nimport Popover from '../Popover';\nimport type { PopoverProps } from '../Popover';\nimport Menu, { MenuItemProps } from '../Menu';\nimport type { AcceptedMouseEventElement } from '../Menu/Menu.types';\nimport { useConsolidatedRef } from '../../hooks';\nimport type { AsProp, OmitStrict } from '../../types';\n\nimport AppShellContext from './AppShellContext';\nimport { OperatorProps } from './AppShell.types';\n\nconst Operator = forwardRef(\n (\n {\n children,\n actions,\n popover,\n as\n }: {\n children: ReactNode;\n actions: OperatorProps['actions'];\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n } & AsProp,\n ref: Ref<HTMLButtonElement> | undefined\n ) => {\n const { navOpen } = useContext(AppShellContext);\n const buttonRef = useConsolidatedRef(ref);\n\n const operatorMenuItems = useMemo(() => {\n return actions.flat().map<MenuItemProps>(({ id, primary, onClick: click, ...rest }) => ({\n id: id || primary,\n primary,\n onClick: (menuId, e) => click?.(e),\n ...rest\n }));\n }, [actions]);\n\n const [showMenu, setShowMenu] = useState(false);\n\n useEffect(() => {\n if (!navOpen) setShowMenu(false);\n }, [navOpen]);\n\n return (\n <>\n <BareButton\n as={as}\n ref={buttonRef}\n aria-expanded={showMenu ? 'true' : 'false'}\n aria-haspopup='menu'\n onClick={() => {\n setShowMenu(cur => !cur);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Escape') setShowMenu(false);\n }}\n onBlur={() => {\n setShowMenu(false);\n }}\n >\n {children}\n </BareButton>\n <Popover {...popover} show={showMenu} target={buttonRef.current}>\n <Menu\n focusControlEl={buttonRef.current ?? undefined}\n mode='action'\n items={operatorMenuItems}\n /**\n * @see {@link MenuButton} implementation for explanation of conditions. This is in essence duplicated.\n */\n onItemClick={(_, e) => {\n if (\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n setShowMenu(false);\n }\n }}\n />\n </Popover>\n </>\n );\n }\n);\n\nexport default Operator;\n"]}
1
+ {"version":3,"file":"Operator.js","sourceRoot":"","sources":["../../../src/components/AppShell/Operator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,IAAuB,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,MAAM,QAAQ,GAAG,UAAU,CACzB,CACE,EACE,QAAQ,EACR,OAAO,EACP,OAAO,EACP,EAAE,EAKM,EACV,GAAuC,EACvC,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAE1C,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,EAAE;QACrC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAgB,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACtF,EAAE,EAAE,EAAE,IAAI,OAAO;YACjB,OAAO;YACP,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAClC,GAAG,IAAI;SACR,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO;YAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,8BACE,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,SAAS,mBACC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAC5B,MAAM,EACpB,OAAO,EAAE,GAAG,EAAE;oBACZ,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;gBAC3B,CAAC,EACD,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;oBAC9B,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;wBAAE,WAAW,CAAC,KAAK,CAAC,CAAC;gBAC7C,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;oBACX,WAAW,CAAC,KAAK,CAAC,CAAC;gBACrB,CAAC,YAEA,QAAQ,GACE,EACb,KAAC,OAAO,OAAK,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,OAAO,YAC7D,KAAC,IAAI,IACH,cAAc,EAAE,SAAS,CAAC,OAAO,IAAI,SAAS,EAC9C,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,iBAAiB;oBACxB,2GAA2G;oBAC3G,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;wBACpB,IACG,CAAgF;6BAC9E,MAAM,GAAG,CAAC,EACb;4BACA,WAAW,CAAC,KAAK,CAAC,CAAC;yBACpB;oBACH,CAAC,GACD,GACM,IACT,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useState, useEffect, useContext, useMemo } from 'react';\nimport type { Ref, ReactNode, MouseEvent, UIEvent } from 'react';\n\nimport BareButton from '../Button/BareButton';\nimport Popover from '../Popover';\nimport type { PopoverProps } from '../Popover';\nimport Menu, { MenuItemProps } from '../Menu';\nimport type { AcceptedMouseEventElement } from '../Menu/Menu.types';\nimport { useConsolidatedRef } from '../../hooks';\nimport type { AsProp, OmitStrict } from '../../types';\n\nimport AppShellContext from './AppShellContext';\nimport { OperatorProps } from './AppShell.types';\n\nconst Operator = forwardRef(\n (\n {\n children,\n actions,\n popover,\n as\n }: {\n children: ReactNode;\n actions: OperatorProps['actions'];\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n } & AsProp,\n ref: Ref<HTMLButtonElement> | undefined\n ) => {\n const { navOpen } = useContext(AppShellContext);\n const buttonRef = useConsolidatedRef(ref);\n\n const operatorMenuItems = useMemo(() => {\n return actions.flat().map<MenuItemProps>(({ id, primary, onClick: click, ...rest }) => ({\n id: id || primary,\n primary,\n onClick: (menuId, e) => click?.(e),\n ...rest\n }));\n }, [actions]);\n\n const [showMenu, setShowMenu] = useState(false);\n\n useEffect(() => {\n if (!navOpen) setShowMenu(false);\n }, [navOpen]);\n\n return (\n <>\n <BareButton\n as={as}\n ref={buttonRef}\n aria-expanded={showMenu ? 'true' : 'false'}\n aria-haspopup='menu'\n onClick={() => {\n setShowMenu(cur => !cur);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Escape') setShowMenu(false);\n }}\n onBlur={() => {\n setShowMenu(false);\n }}\n >\n {children}\n </BareButton>\n <Popover {...popover} show={showMenu} target={buttonRef.current}>\n <Menu\n focusControlEl={buttonRef.current ?? undefined}\n mode='action'\n items={operatorMenuItems}\n /** @see {@link MenuButton} implementation for explanation of conditions. This is in essence duplicated. */\n onItemClick={(_, e) => {\n if (\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n setShowMenu(false);\n }\n }}\n />\n </Popover>\n </>\n );\n }\n);\n\nexport default Operator;\n"]}
@@ -13,12 +13,12 @@ export interface AvatarProps extends BaseProps, NoChildrenProp {
13
13
  backgroundColor?: string;
14
14
  /**
15
15
  * Shape of the Avatar.
16
- * @default "circle"
16
+ * @default 'circle'
17
17
  */
18
18
  shape?: 'circle' | 'squircle';
19
19
  /**
20
20
  * Avatar size.
21
- * @default "m"
21
+ * @default 'm'
22
22
  */
23
23
  size?: 's' | 'm' | 'l' | 'xl';
24
24
  /** If defined, will render status icon on the avatar. */