@okta/odyssey-react-mui 1.70.0 → 1.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (930) hide show
  1. package/README.md +8 -20
  2. package/dist/cjs/@types/react-augment.d.cjs.map +1 -1
  3. package/dist/cjs/Accordion.cjs +1 -1
  4. package/dist/cjs/Accordion.cjs.map +1 -1
  5. package/dist/cjs/AnimationContext.cjs +1 -1
  6. package/dist/cjs/Autocomplete.cjs +1 -1
  7. package/dist/cjs/Autocomplete.cjs.map +1 -1
  8. package/dist/cjs/Badge.cjs +1 -1
  9. package/dist/cjs/Badge.cjs.map +1 -1
  10. package/dist/cjs/Banner.cjs +1 -1
  11. package/dist/cjs/Banner.cjs.map +1 -1
  12. package/dist/cjs/Box.cjs +1 -1
  13. package/dist/cjs/Box.cjs.map +1 -1
  14. package/dist/cjs/Breadcrumbs.cjs +1 -1
  15. package/dist/cjs/Breadcrumbs.cjs.map +1 -1
  16. package/dist/cjs/Buttons/BaseButton.cjs +1 -1
  17. package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
  18. package/dist/cjs/Buttons/BaseMenuButton.cjs +1 -1
  19. package/dist/cjs/Buttons/BaseMenuButton.cjs.map +1 -1
  20. package/dist/cjs/Buttons/Button.cjs +1 -1
  21. package/dist/cjs/Buttons/Button.cjs.map +1 -1
  22. package/dist/cjs/Buttons/MenuButton.cjs +1 -1
  23. package/dist/cjs/Buttons/MenuButton.cjs.map +1 -1
  24. package/dist/cjs/Buttons/MenuItem.cjs +1 -1
  25. package/dist/cjs/Buttons/MenuItem.cjs.map +1 -1
  26. package/dist/cjs/Callout.cjs +1 -1
  27. package/dist/cjs/Callout.cjs.map +1 -1
  28. package/dist/cjs/Card.cjs +1 -1
  29. package/dist/cjs/Card.cjs.map +1 -1
  30. package/dist/cjs/CircularProgress.cjs +1 -1
  31. package/dist/cjs/CircularProgress.cjs.map +1 -1
  32. package/dist/cjs/ConditionalWrapper.cjs +1 -1
  33. package/dist/cjs/ConditionalWrapper.cjs.map +1 -1
  34. package/dist/cjs/CssBaseline.cjs.map +1 -1
  35. package/dist/cjs/DataTable/DataTable.cjs +1 -1
  36. package/dist/cjs/DataTable/DataTable.cjs.map +1 -1
  37. package/dist/cjs/DataTable/DataTableRowActions.cjs +1 -1
  38. package/dist/cjs/DataTable/DataTableSettings.cjs +1 -1
  39. package/dist/cjs/DataTable/useRowReordering.cjs.map +1 -1
  40. package/dist/cjs/DatePickers/DateField.cjs +1 -1
  41. package/dist/cjs/DatePickers/DateFieldActionBar.cjs +1 -1
  42. package/dist/cjs/DatePickers/DateFieldLocalizationProvider.cjs +1 -1
  43. package/dist/cjs/DatePickers/DatePicker.cjs +1 -1
  44. package/dist/cjs/DatePickers/DatePicker.cjs.map +1 -1
  45. package/dist/cjs/DatePickers/TimeZonePicker.cjs +1 -1
  46. package/dist/cjs/DatePickers/TimeZonePicker.cjs.map +1 -1
  47. package/dist/cjs/DatePickers/datePickerTheme.cjs +57 -27
  48. package/dist/cjs/DatePickers/datePickerTheme.cjs.map +1 -1
  49. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs.map +1 -1
  50. package/dist/cjs/Dialog.cjs +1 -1
  51. package/dist/cjs/Dialog.cjs.map +1 -1
  52. package/dist/cjs/Drawer.cjs +1 -1
  53. package/dist/cjs/Drawer.cjs.map +1 -1
  54. package/dist/cjs/EmptyState.cjs +1 -1
  55. package/dist/cjs/EmptyState.cjs.map +1 -1
  56. package/dist/cjs/ErrorMessageList.cjs +1 -1
  57. package/dist/cjs/Field.cjs +1 -1
  58. package/dist/cjs/FieldError.cjs +1 -1
  59. package/dist/cjs/FieldHint.cjs +1 -1
  60. package/dist/cjs/FieldLabel.cjs +1 -1
  61. package/dist/cjs/Fields/Checkbox.cjs +1 -1
  62. package/dist/cjs/Fields/Checkbox.cjs.map +1 -1
  63. package/dist/cjs/Fields/CheckboxGroup.cjs +1 -1
  64. package/dist/cjs/Fields/CheckboxGroup.cjs.map +1 -1
  65. package/dist/cjs/Fields/Hint.cjs.map +1 -1
  66. package/dist/cjs/Fields/Radio.cjs +1 -1
  67. package/dist/cjs/Fields/RadioGroup.cjs +1 -1
  68. package/dist/cjs/Fields/RadioGroup.cjs.map +1 -1
  69. package/dist/cjs/Fieldset.cjs +1 -1
  70. package/dist/cjs/Fieldset.cjs.map +1 -1
  71. package/dist/cjs/FileUploader/FileUploadIllustration.cjs +1 -1
  72. package/dist/cjs/FileUploader/FileUploadPreview.cjs +1 -1
  73. package/dist/cjs/FileUploader/FileUploader.cjs +1 -1
  74. package/dist/cjs/FileUploader/FileUploader.cjs.map +1 -1
  75. package/dist/cjs/Form.cjs +1 -1
  76. package/dist/cjs/Form.cjs.map +1 -1
  77. package/dist/cjs/FormCheckedProps.cjs.map +1 -1
  78. package/dist/cjs/FullScreenOverlay.cjs +1 -1
  79. package/dist/cjs/FullScreenOverlayContext.cjs +1 -1
  80. package/dist/cjs/HintLink.cjs +1 -1
  81. package/dist/cjs/IconWithTooltip.cjs +1 -1
  82. package/dist/cjs/IconWithTooltip.cjs.map +1 -1
  83. package/dist/cjs/Link.cjs +1 -1
  84. package/dist/cjs/Link.cjs.map +1 -1
  85. package/dist/cjs/MuiPropsChild.cjs +1 -1
  86. package/dist/cjs/NativeSelect.cjs +1 -1
  87. package/dist/cjs/NativeSelect.cjs.map +1 -1
  88. package/dist/cjs/OdysseyCacheProvider.cjs +1 -1
  89. package/dist/cjs/OdysseyCacheProvider.cjs.map +1 -1
  90. package/dist/cjs/OdysseyDesignTokensContext.cjs.map +1 -1
  91. package/dist/cjs/OdysseyProvider.cjs +1 -1
  92. package/dist/cjs/OdysseyProvider.cjs.map +1 -1
  93. package/dist/cjs/OdysseyThemeProvider.cjs +1 -1
  94. package/dist/cjs/OdysseyThemeProvider.cjs.map +1 -1
  95. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs +1 -1
  96. package/dist/cjs/Pagination/Pagination.cjs +1 -1
  97. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  98. package/dist/cjs/PasswordField.cjs +1 -1
  99. package/dist/cjs/PasswordField.cjs.map +1 -1
  100. package/dist/cjs/ScreenReaderText.cjs +1 -1
  101. package/dist/cjs/ScreenReaderText.cjs.map +1 -1
  102. package/dist/cjs/SearchField.cjs +1 -1
  103. package/dist/cjs/SearchField.cjs.map +1 -1
  104. package/dist/cjs/Select.cjs +1 -1
  105. package/dist/cjs/Select.cjs.map +1 -1
  106. package/dist/cjs/Stack.cjs +1 -1
  107. package/dist/cjs/Stack.cjs.map +1 -1
  108. package/dist/cjs/Status.cjs +1 -1
  109. package/dist/cjs/Status.cjs.map +1 -1
  110. package/dist/cjs/Surface.cjs +1 -1
  111. package/dist/cjs/Surface.cjs.map +1 -1
  112. package/dist/cjs/Switch.cjs +2 -2
  113. package/dist/cjs/Switch.cjs.map +1 -1
  114. package/dist/cjs/Tabs.cjs +1 -1
  115. package/dist/cjs/Tabs.cjs.map +1 -1
  116. package/dist/cjs/Tag.cjs +1 -1
  117. package/dist/cjs/Tag.cjs.map +1 -1
  118. package/dist/cjs/TagList.cjs +1 -1
  119. package/dist/cjs/TagList.cjs.map +1 -1
  120. package/dist/cjs/TextField.cjs +1 -1
  121. package/dist/cjs/TextField.cjs.map +1 -1
  122. package/dist/cjs/Toast.cjs +1 -1
  123. package/dist/cjs/Toast.cjs.map +1 -1
  124. package/dist/cjs/ToastStack.cjs +1 -1
  125. package/dist/cjs/ToastStack.cjs.map +1 -1
  126. package/dist/cjs/Tooltip.cjs +1 -1
  127. package/dist/cjs/Tooltip.cjs.map +1 -1
  128. package/dist/cjs/Typography.cjs +12 -12
  129. package/dist/cjs/Typography.cjs.map +1 -1
  130. package/dist/cjs/__internal.cjs.map +1 -1
  131. package/dist/cjs/charts/BarChart.cjs +1 -1
  132. package/dist/cjs/charts/BarChart.cjs.map +1 -1
  133. package/dist/cjs/charts/LineChart.cjs +1 -1
  134. package/dist/cjs/charts/LineChart.cjs.map +1 -1
  135. package/dist/cjs/charts/components/ChartContainer.cjs.map +1 -1
  136. package/dist/cjs/charts/components/ChartError.cjs +1 -1
  137. package/dist/cjs/charts/components/ChartError.cjs.map +1 -1
  138. package/dist/cjs/charts/components/ChartFrame.cjs +1 -1
  139. package/dist/cjs/charts/components/ChartFrame.cjs.map +1 -1
  140. package/dist/cjs/charts/components/ChartPopoverContent.cjs +1 -1
  141. package/dist/cjs/charts/components/ChartPopoverContent.cjs.map +1 -1
  142. package/dist/cjs/charts/utils/chartTokens.cjs.map +1 -1
  143. package/dist/cjs/charts/utils/chartTypes.cjs.map +1 -1
  144. package/dist/cjs/charts/utils/formatChartValue.cjs.map +1 -1
  145. package/dist/cjs/charts/utils/getChartSeriesPointData.cjs.map +1 -1
  146. package/dist/cjs/charts/utils/hasDuplicateSeries.cjs.map +1 -1
  147. package/dist/cjs/charts/utils/resolveChartLocale.cjs.map +1 -1
  148. package/dist/cjs/charts/utils/useChartValueFormatter.cjs.map +1 -1
  149. package/dist/cjs/charts/utils/useStableValue.cjs.map +1 -1
  150. package/dist/cjs/createContrastColors.cjs.map +1 -1
  151. package/dist/cjs/createOdysseyStyledComponent.cjs.map +1 -1
  152. package/dist/cjs/getLogicalBoundaries.cjs.map +1 -1
  153. package/dist/cjs/icons.generated/Add.cjs +1 -1
  154. package/dist/cjs/icons.generated/AddCircle.cjs +1 -1
  155. package/dist/cjs/icons.generated/Apps.cjs +1 -1
  156. package/dist/cjs/icons.generated/AppsSelected.cjs +1 -1
  157. package/dist/cjs/icons.generated/ArrowBottom.cjs +1 -1
  158. package/dist/cjs/icons.generated/ArrowDown.cjs +1 -1
  159. package/dist/cjs/icons.generated/ArrowLeft.cjs +1 -1
  160. package/dist/cjs/icons.generated/ArrowLowerLeft.cjs +1 -1
  161. package/dist/cjs/icons.generated/ArrowLowerRight.cjs +1 -1
  162. package/dist/cjs/icons.generated/ArrowRight.cjs +1 -1
  163. package/dist/cjs/icons.generated/ArrowTop.cjs +1 -1
  164. package/dist/cjs/icons.generated/ArrowUnsorted.cjs +1 -1
  165. package/dist/cjs/icons.generated/ArrowUp.cjs +1 -1
  166. package/dist/cjs/icons.generated/ArrowUpperLeft.cjs +1 -1
  167. package/dist/cjs/icons.generated/ArrowUpperRight.cjs +1 -1
  168. package/dist/cjs/icons.generated/Bug.cjs +1 -1
  169. package/dist/cjs/icons.generated/Calendar.cjs +1 -1
  170. package/dist/cjs/icons.generated/Call.cjs +1 -1
  171. package/dist/cjs/icons.generated/Chat.cjs +1 -1
  172. package/dist/cjs/icons.generated/Check.cjs +1 -1
  173. package/dist/cjs/icons.generated/CheckCircleFilled.cjs +1 -1
  174. package/dist/cjs/icons.generated/ChevronDown.cjs +1 -1
  175. package/dist/cjs/icons.generated/ChevronLeft.cjs +1 -1
  176. package/dist/cjs/icons.generated/ChevronRight.cjs +1 -1
  177. package/dist/cjs/icons.generated/ChevronUp.cjs +1 -1
  178. package/dist/cjs/icons.generated/Clock.cjs +1 -1
  179. package/dist/cjs/icons.generated/Close.cjs +1 -1
  180. package/dist/cjs/icons.generated/CloseCircleFilled.cjs +1 -1
  181. package/dist/cjs/icons.generated/CollapseLeft.cjs +1 -1
  182. package/dist/cjs/icons.generated/CollapseRight.cjs +1 -1
  183. package/dist/cjs/icons.generated/Copy.cjs +1 -1
  184. package/dist/cjs/icons.generated/Customizations.cjs +1 -1
  185. package/dist/cjs/icons.generated/CustomizationsSelected.cjs +1 -1
  186. package/dist/cjs/icons.generated/DangerDiamond.cjs +1 -1
  187. package/dist/cjs/icons.generated/DangerDiamondFilled.cjs +1 -1
  188. package/dist/cjs/icons.generated/Delete.cjs +1 -1
  189. package/dist/cjs/icons.generated/Deny.cjs +1 -1
  190. package/dist/cjs/icons.generated/Devices.cjs +1 -1
  191. package/dist/cjs/icons.generated/Directory.cjs +1 -1
  192. package/dist/cjs/icons.generated/DirectorySelected.cjs +1 -1
  193. package/dist/cjs/icons.generated/Documentation.cjs +1 -1
  194. package/dist/cjs/icons.generated/Download.cjs +1 -1
  195. package/dist/cjs/icons.generated/DragIndicator.cjs +1 -1
  196. package/dist/cjs/icons.generated/Edit.cjs +1 -1
  197. package/dist/cjs/icons.generated/ExpandLeft.cjs +1 -1
  198. package/dist/cjs/icons.generated/ExpandRight.cjs +1 -1
  199. package/dist/cjs/icons.generated/ExternalLink.cjs +1 -1
  200. package/dist/cjs/icons.generated/Filter.cjs +1 -1
  201. package/dist/cjs/icons.generated/Folder.cjs +1 -1
  202. package/dist/cjs/icons.generated/Globe.cjs +1 -1
  203. package/dist/cjs/icons.generated/Grid.cjs +1 -1
  204. package/dist/cjs/icons.generated/Group.cjs +1 -1
  205. package/dist/cjs/icons.generated/Happy.cjs +1 -1
  206. package/dist/cjs/icons.generated/Hide.cjs +1 -1
  207. package/dist/cjs/icons.generated/Home.cjs +1 -1
  208. package/dist/cjs/icons.generated/HomeSelected.cjs +1 -1
  209. package/dist/cjs/icons.generated/IdentityGovernance.cjs +1 -1
  210. package/dist/cjs/icons.generated/IdentityGovernanceSelected.cjs +1 -1
  211. package/dist/cjs/icons.generated/InformationCircle.cjs +1 -1
  212. package/dist/cjs/icons.generated/InformationCircleFilled.cjs +1 -1
  213. package/dist/cjs/icons.generated/Link.cjs +1 -1
  214. package/dist/cjs/icons.generated/List.cjs +1 -1
  215. package/dist/cjs/icons.generated/Lock.cjs +1 -1
  216. package/dist/cjs/icons.generated/Menu.cjs +1 -1
  217. package/dist/cjs/icons.generated/More.cjs +1 -1
  218. package/dist/cjs/icons.generated/Neutral.cjs +1 -1
  219. package/dist/cjs/icons.generated/Notification.cjs +1 -1
  220. package/dist/cjs/icons.generated/Pause.cjs +1 -1
  221. package/dist/cjs/icons.generated/QuestionCircle.cjs +1 -1
  222. package/dist/cjs/icons.generated/QuestionCircleFilled.cjs +1 -1
  223. package/dist/cjs/icons.generated/Refresh.cjs +1 -1
  224. package/dist/cjs/icons.generated/Reports.cjs +1 -1
  225. package/dist/cjs/icons.generated/ReportsSelected.cjs +1 -1
  226. package/dist/cjs/icons.generated/Reset.cjs +1 -1
  227. package/dist/cjs/icons.generated/Resume.cjs +1 -1
  228. package/dist/cjs/icons.generated/Sad.cjs +1 -1
  229. package/dist/cjs/icons.generated/Same.cjs +1 -1
  230. package/dist/cjs/icons.generated/Search.cjs +1 -1
  231. package/dist/cjs/icons.generated/Security.cjs +1 -1
  232. package/dist/cjs/icons.generated/SecuritySelected.cjs +1 -1
  233. package/dist/cjs/icons.generated/Send.cjs +1 -1
  234. package/dist/cjs/icons.generated/Server.cjs +1 -1
  235. package/dist/cjs/icons.generated/Settings.cjs +1 -1
  236. package/dist/cjs/icons.generated/SettingsSelected.cjs +1 -1
  237. package/dist/cjs/icons.generated/Show.cjs +1 -1
  238. package/dist/cjs/icons.generated/Sparkle.cjs +1 -1
  239. package/dist/cjs/icons.generated/Subtract.cjs +1 -1
  240. package/dist/cjs/icons.generated/Sync.cjs +1 -1
  241. package/dist/cjs/icons.generated/ThumbsDown.cjs +1 -1
  242. package/dist/cjs/icons.generated/ThumbsUp.cjs +1 -1
  243. package/dist/cjs/icons.generated/Unlock.cjs +1 -1
  244. package/dist/cjs/icons.generated/Upload.cjs +1 -1
  245. package/dist/cjs/icons.generated/User.cjs +1 -1
  246. package/dist/cjs/icons.generated/Video.cjs +1 -1
  247. package/dist/cjs/icons.generated/Warning.cjs +1 -1
  248. package/dist/cjs/icons.generated/WarningFilled.cjs +1 -1
  249. package/dist/cjs/icons.generated/Workflows.cjs +1 -1
  250. package/dist/cjs/icons.generated/WorkflowsSelected.cjs +1 -1
  251. package/dist/cjs/inputUtils.cjs.map +1 -1
  252. package/dist/cjs/labs/AppTile.cjs +1 -1
  253. package/dist/cjs/labs/AppTile.cjs.map +1 -1
  254. package/dist/cjs/labs/DataFilters.cjs +2 -2
  255. package/dist/cjs/labs/DataFilters.cjs.map +1 -1
  256. package/dist/cjs/labs/DataTable.cjs +1 -1
  257. package/dist/cjs/labs/DataTable.cjs.map +1 -1
  258. package/dist/cjs/labs/DataTablePagination.cjs +1 -1
  259. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs +1 -1
  260. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs.map +1 -1
  261. package/dist/cjs/labs/DataView/CardLayoutContent.cjs +2 -2
  262. package/dist/cjs/labs/DataView/CardLayoutContent.cjs.map +1 -1
  263. package/dist/cjs/labs/DataView/DataCard.cjs +1 -1
  264. package/dist/cjs/labs/DataView/DataCard.cjs.map +1 -1
  265. package/dist/cjs/labs/DataView/DataTable.cjs +1 -1
  266. package/dist/cjs/labs/DataView/DataTable.cjs.map +1 -1
  267. package/dist/cjs/labs/DataView/DataView.cjs +1 -1
  268. package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
  269. package/dist/cjs/labs/DataView/DetailPanel.cjs +1 -1
  270. package/dist/cjs/labs/DataView/LayoutSwitcher.cjs +1 -1
  271. package/dist/cjs/labs/DataView/RowActions.cjs +1 -1
  272. package/dist/cjs/labs/DataView/RowActions.cjs.map +1 -1
  273. package/dist/cjs/labs/DataView/TableLayoutContent.cjs +1 -1
  274. package/dist/cjs/labs/DataView/TableLayoutContent.cjs.map +1 -1
  275. package/dist/cjs/labs/DataView/TableSettings.cjs +1 -1
  276. package/dist/cjs/labs/DataView/TableSettings.cjs.map +1 -1
  277. package/dist/cjs/labs/DataView/componentTypes.cjs.map +1 -1
  278. package/dist/cjs/labs/DataView/tableConstants.cjs.map +1 -1
  279. package/dist/cjs/labs/DataView/testSupportData.cjs.map +1 -1
  280. package/dist/cjs/labs/DataView/useFilterConversion.cjs.map +1 -1
  281. package/dist/cjs/labs/DatePickers/DateTimeField.cjs +1 -1
  282. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +2 -2
  283. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
  284. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs +4 -4
  285. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs.map +1 -1
  286. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs +1 -1
  287. package/dist/cjs/labs/OdysseyPickers/Picker.cjs +1 -1
  288. package/dist/cjs/labs/OdysseyPickers/PickerVirtualizationListBox.cjs +1 -1
  289. package/dist/cjs/labs/OdysseyPickers/PickerVirtualizationListBox.cjs.map +1 -1
  290. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +1 -1
  291. package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +1 -1
  292. package/dist/cjs/labs/PageTemplate/DocumentationLink.cjs +1 -1
  293. package/dist/cjs/labs/PageTemplate/Layout.cjs +1 -1
  294. package/dist/cjs/labs/PageTemplate/Layout.cjs.map +1 -1
  295. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +1 -1
  296. package/dist/cjs/labs/PaginatedTable.cjs +1 -1
  297. package/dist/cjs/labs/StaticTable.cjs +1 -1
  298. package/dist/cjs/labs/UserProfile.cjs +1 -1
  299. package/dist/cjs/labs/UserProfileMenuButton.cjs +1 -1
  300. package/dist/cjs/logos.generated/Duo.cjs +1 -1
  301. package/dist/cjs/logos.generated/GoogleAuth.cjs +1 -1
  302. package/dist/cjs/logos.generated/OktaVerify.cjs +1 -1
  303. package/dist/cjs/logos.generated/Persona.cjs +1 -1
  304. package/dist/cjs/logos.generated/SymantecVip.cjs +1 -1
  305. package/dist/cjs/logos.generated/Yubikey.cjs +1 -1
  306. package/dist/cjs/test-utils/appendToSandbox.cjs.map +1 -1
  307. package/dist/cjs/test-utils/getControlledElement.cjs.map +1 -1
  308. package/dist/cjs/test-utils/renderWithOdysseyProvider.cjs.map +1 -1
  309. package/dist/cjs/test-utils/viewportTestSizes.cjs.map +1 -1
  310. package/dist/cjs/theme/components/Autocomplete.cjs.map +1 -1
  311. package/dist/cjs/theme/components/Button.cjs.map +1 -1
  312. package/dist/cjs/theme/components/CircularProgress.cjs.map +1 -1
  313. package/dist/cjs/theme/components/Drawer.cjs.map +1 -1
  314. package/dist/cjs/theme/components/Form.cjs.map +1 -1
  315. package/dist/cjs/theme/components/Input.cjs.map +1 -1
  316. package/dist/cjs/theme/components/Table.cjs.map +1 -1
  317. package/dist/cjs/theme/useAppElementContainerQuery.cjs.map +1 -1
  318. package/dist/cjs/theme/useContainerQuery.cjs.map +1 -1
  319. package/dist/cjs/theme/useMediaQuery.cjs.map +1 -1
  320. package/dist/cjs/tools/addSpecificity.cjs.map +1 -1
  321. package/dist/cjs/tools/createBrowserMessageBus.cjs +48 -0
  322. package/dist/cjs/tools/createBrowserMessageBus.cjs.map +1 -0
  323. package/dist/cjs/ui-shell/AppSwitcher/AppSwitcher.cjs +1 -1
  324. package/dist/cjs/ui-shell/InnerAppContainer.cjs +1 -1
  325. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +1 -1
  326. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  327. package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs +1 -1
  328. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +1 -1
  329. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  330. package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs +1 -1
  331. package/dist/cjs/ui-shell/SideNav/SideNavHeader.cjs +1 -1
  332. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs +2 -2
  333. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs.map +1 -1
  334. package/dist/cjs/ui-shell/SideNav/SideNavItemContentContext.cjs.map +1 -1
  335. package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +1 -1
  336. package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs +1 -1
  337. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +2 -2
  338. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs.map +1 -1
  339. package/dist/cjs/ui-shell/SideNav/SortableList/SortableItem.cjs.map +1 -1
  340. package/dist/cjs/ui-shell/SideNav/SortableList/SortableList.cjs.map +1 -1
  341. package/dist/cjs/ui-shell/SideNav/SortableList/SortableOverlay.cjs.map +1 -1
  342. package/dist/cjs/ui-shell/SideNav/types.cjs.map +1 -1
  343. package/dist/cjs/ui-shell/SkipToContent.cjs +1 -1
  344. package/dist/cjs/ui-shell/SkipToContent.cjs.map +1 -1
  345. package/dist/cjs/ui-shell/TopNav/HamburgerMenuIcon.cjs +1 -1
  346. package/dist/cjs/ui-shell/TopNav/TopNav.cjs +1 -1
  347. package/dist/cjs/ui-shell/TopNav/TopNavLinksList.cjs +1 -1
  348. package/dist/cjs/ui-shell/TopNav/TopNavListItem.cjs +1 -1
  349. package/dist/cjs/ui-shell/TopNav/TopNavListItem.cjs.map +1 -1
  350. package/dist/cjs/ui-shell/UiShell.cjs +1 -1
  351. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  352. package/dist/cjs/ui-shell/UiShellLogo.cjs +1 -1
  353. package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
  354. package/dist/cjs/ui-shell/WideUiShellContent.cjs +1 -1
  355. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  356. package/dist/cjs/ui-shell/uiShellContentTypes.cjs.map +1 -1
  357. package/dist/cjs/ui-shell/uiShellSharedConstants.cjs.map +1 -1
  358. package/dist/cjs/useContrastMode.cjs.map +1 -1
  359. package/dist/cjs/useStableCallback.cjs.map +1 -1
  360. package/dist/cjs/useThemeCache.cjs.map +1 -1
  361. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  362. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  363. package/dist/cjs/web-component/renderReactInWebComponent.cjs.map +1 -1
  364. package/dist/esm/@types/react-augment.d.js.map +1 -1
  365. package/dist/esm/Accordion.js +1 -1
  366. package/dist/esm/Accordion.js.map +1 -1
  367. package/dist/esm/AnimationContext.js +1 -1
  368. package/dist/esm/Autocomplete.js +1 -1
  369. package/dist/esm/Autocomplete.js.map +1 -1
  370. package/dist/esm/Badge.js +1 -1
  371. package/dist/esm/Badge.js.map +1 -1
  372. package/dist/esm/Banner.js +1 -1
  373. package/dist/esm/Banner.js.map +1 -1
  374. package/dist/esm/Box.js +1 -1
  375. package/dist/esm/Box.js.map +1 -1
  376. package/dist/esm/Breadcrumbs.js +1 -1
  377. package/dist/esm/Breadcrumbs.js.map +1 -1
  378. package/dist/esm/Buttons/BaseButton.js +1 -1
  379. package/dist/esm/Buttons/BaseButton.js.map +1 -1
  380. package/dist/esm/Buttons/BaseMenuButton.js +1 -1
  381. package/dist/esm/Buttons/BaseMenuButton.js.map +1 -1
  382. package/dist/esm/Buttons/Button.js +1 -1
  383. package/dist/esm/Buttons/Button.js.map +1 -1
  384. package/dist/esm/Buttons/MenuButton.js +1 -1
  385. package/dist/esm/Buttons/MenuButton.js.map +1 -1
  386. package/dist/esm/Buttons/MenuItem.js +1 -1
  387. package/dist/esm/Buttons/MenuItem.js.map +1 -1
  388. package/dist/esm/Callout.js +1 -1
  389. package/dist/esm/Callout.js.map +1 -1
  390. package/dist/esm/Card.js +1 -1
  391. package/dist/esm/Card.js.map +1 -1
  392. package/dist/esm/CircularProgress.js +1 -1
  393. package/dist/esm/CircularProgress.js.map +1 -1
  394. package/dist/esm/ConditionalWrapper.js +1 -1
  395. package/dist/esm/ConditionalWrapper.js.map +1 -1
  396. package/dist/esm/CssBaseline.js.map +1 -1
  397. package/dist/esm/DataTable/DataTable.js +1 -1
  398. package/dist/esm/DataTable/DataTable.js.map +1 -1
  399. package/dist/esm/DataTable/DataTableRowActions.js +1 -1
  400. package/dist/esm/DataTable/DataTableSettings.js +1 -1
  401. package/dist/esm/DataTable/useRowReordering.js.map +1 -1
  402. package/dist/esm/DatePickers/DateField.js +1 -1
  403. package/dist/esm/DatePickers/DateFieldActionBar.js +1 -1
  404. package/dist/esm/DatePickers/DateFieldLocalizationProvider.js +1 -1
  405. package/dist/esm/DatePickers/DatePicker.js +1 -1
  406. package/dist/esm/DatePickers/DatePicker.js.map +1 -1
  407. package/dist/esm/DatePickers/TimeZonePicker.js +1 -1
  408. package/dist/esm/DatePickers/TimeZonePicker.js.map +1 -1
  409. package/dist/esm/DatePickers/datePickerTheme.js +57 -27
  410. package/dist/esm/DatePickers/datePickerTheme.js.map +1 -1
  411. package/dist/esm/DatePickers/useOdysseyDateFields.js.map +1 -1
  412. package/dist/esm/Dialog.js +1 -1
  413. package/dist/esm/Dialog.js.map +1 -1
  414. package/dist/esm/Drawer.js +1 -1
  415. package/dist/esm/Drawer.js.map +1 -1
  416. package/dist/esm/EmptyState.js +1 -1
  417. package/dist/esm/EmptyState.js.map +1 -1
  418. package/dist/esm/ErrorMessageList.js +1 -1
  419. package/dist/esm/Field.js +1 -1
  420. package/dist/esm/FieldError.js +1 -1
  421. package/dist/esm/FieldHint.js +1 -1
  422. package/dist/esm/FieldLabel.js +1 -1
  423. package/dist/esm/Fields/Checkbox.js +1 -1
  424. package/dist/esm/Fields/Checkbox.js.map +1 -1
  425. package/dist/esm/Fields/CheckboxGroup.js +1 -1
  426. package/dist/esm/Fields/CheckboxGroup.js.map +1 -1
  427. package/dist/esm/Fields/Hint.js.map +1 -1
  428. package/dist/esm/Fields/Radio.js +1 -1
  429. package/dist/esm/Fields/RadioGroup.js +1 -1
  430. package/dist/esm/Fields/RadioGroup.js.map +1 -1
  431. package/dist/esm/Fieldset.js +1 -1
  432. package/dist/esm/Fieldset.js.map +1 -1
  433. package/dist/esm/FileUploader/FileUploadIllustration.js +1 -1
  434. package/dist/esm/FileUploader/FileUploadPreview.js +1 -1
  435. package/dist/esm/FileUploader/FileUploader.js +1 -1
  436. package/dist/esm/FileUploader/FileUploader.js.map +1 -1
  437. package/dist/esm/Form.js +1 -1
  438. package/dist/esm/Form.js.map +1 -1
  439. package/dist/esm/FormCheckedProps.js.map +1 -1
  440. package/dist/esm/FullScreenOverlay.js +1 -1
  441. package/dist/esm/FullScreenOverlayContext.js +1 -1
  442. package/dist/esm/HintLink.js +1 -1
  443. package/dist/esm/IconWithTooltip.js +1 -1
  444. package/dist/esm/IconWithTooltip.js.map +1 -1
  445. package/dist/esm/Link.js +1 -1
  446. package/dist/esm/Link.js.map +1 -1
  447. package/dist/esm/MuiPropsChild.js +1 -1
  448. package/dist/esm/NativeSelect.js +1 -1
  449. package/dist/esm/NativeSelect.js.map +1 -1
  450. package/dist/esm/OdysseyCacheProvider.js +1 -1
  451. package/dist/esm/OdysseyCacheProvider.js.map +1 -1
  452. package/dist/esm/OdysseyDesignTokensContext.js.map +1 -1
  453. package/dist/esm/OdysseyProvider.js +1 -1
  454. package/dist/esm/OdysseyProvider.js.map +1 -1
  455. package/dist/esm/OdysseyThemeProvider.js +1 -1
  456. package/dist/esm/OdysseyThemeProvider.js.map +1 -1
  457. package/dist/esm/OdysseyThemeProviderPropsContext.js +1 -1
  458. package/dist/esm/Pagination/Pagination.js +1 -1
  459. package/dist/esm/Pagination/Pagination.js.map +1 -1
  460. package/dist/esm/PasswordField.js +1 -1
  461. package/dist/esm/PasswordField.js.map +1 -1
  462. package/dist/esm/ScreenReaderText.js +1 -1
  463. package/dist/esm/ScreenReaderText.js.map +1 -1
  464. package/dist/esm/SearchField.js +1 -1
  465. package/dist/esm/SearchField.js.map +1 -1
  466. package/dist/esm/Select.js +1 -1
  467. package/dist/esm/Select.js.map +1 -1
  468. package/dist/esm/Stack.js +1 -1
  469. package/dist/esm/Stack.js.map +1 -1
  470. package/dist/esm/Status.js +1 -1
  471. package/dist/esm/Status.js.map +1 -1
  472. package/dist/esm/Surface.js +1 -1
  473. package/dist/esm/Surface.js.map +1 -1
  474. package/dist/esm/Switch.js +2 -2
  475. package/dist/esm/Switch.js.map +1 -1
  476. package/dist/esm/Tabs.js +1 -1
  477. package/dist/esm/Tabs.js.map +1 -1
  478. package/dist/esm/Tag.js +1 -1
  479. package/dist/esm/Tag.js.map +1 -1
  480. package/dist/esm/TagList.js +1 -1
  481. package/dist/esm/TagList.js.map +1 -1
  482. package/dist/esm/TextField.js +1 -1
  483. package/dist/esm/TextField.js.map +1 -1
  484. package/dist/esm/Toast.js +1 -1
  485. package/dist/esm/Toast.js.map +1 -1
  486. package/dist/esm/ToastStack.js +1 -1
  487. package/dist/esm/ToastStack.js.map +1 -1
  488. package/dist/esm/Tooltip.js +1 -1
  489. package/dist/esm/Tooltip.js.map +1 -1
  490. package/dist/esm/Typography.js +12 -12
  491. package/dist/esm/Typography.js.map +1 -1
  492. package/dist/esm/__internal.js.map +1 -1
  493. package/dist/esm/charts/BarChart.js +1 -1
  494. package/dist/esm/charts/BarChart.js.map +1 -1
  495. package/dist/esm/charts/LineChart.js +1 -1
  496. package/dist/esm/charts/LineChart.js.map +1 -1
  497. package/dist/esm/charts/components/ChartContainer.js.map +1 -1
  498. package/dist/esm/charts/components/ChartError.js +1 -1
  499. package/dist/esm/charts/components/ChartError.js.map +1 -1
  500. package/dist/esm/charts/components/ChartFrame.js +1 -1
  501. package/dist/esm/charts/components/ChartFrame.js.map +1 -1
  502. package/dist/esm/charts/components/ChartPopoverContent.js +1 -1
  503. package/dist/esm/charts/components/ChartPopoverContent.js.map +1 -1
  504. package/dist/esm/charts/utils/chartTokens.js.map +1 -1
  505. package/dist/esm/charts/utils/chartTypes.js.map +1 -1
  506. package/dist/esm/charts/utils/formatChartValue.js.map +1 -1
  507. package/dist/esm/charts/utils/getChartSeriesPointData.js.map +1 -1
  508. package/dist/esm/charts/utils/hasDuplicateSeries.js.map +1 -1
  509. package/dist/esm/charts/utils/resolveChartLocale.js.map +1 -1
  510. package/dist/esm/charts/utils/useChartValueFormatter.js.map +1 -1
  511. package/dist/esm/charts/utils/useStableValue.js.map +1 -1
  512. package/dist/esm/createContrastColors.js.map +1 -1
  513. package/dist/esm/createOdysseyStyledComponent.js.map +1 -1
  514. package/dist/esm/getLogicalBoundaries.js.map +1 -1
  515. package/dist/esm/icons.generated/Add.js +1 -1
  516. package/dist/esm/icons.generated/AddCircle.js +1 -1
  517. package/dist/esm/icons.generated/Apps.js +1 -1
  518. package/dist/esm/icons.generated/AppsSelected.js +1 -1
  519. package/dist/esm/icons.generated/ArrowBottom.js +1 -1
  520. package/dist/esm/icons.generated/ArrowDown.js +1 -1
  521. package/dist/esm/icons.generated/ArrowLeft.js +1 -1
  522. package/dist/esm/icons.generated/ArrowLowerLeft.js +1 -1
  523. package/dist/esm/icons.generated/ArrowLowerRight.js +1 -1
  524. package/dist/esm/icons.generated/ArrowRight.js +1 -1
  525. package/dist/esm/icons.generated/ArrowTop.js +1 -1
  526. package/dist/esm/icons.generated/ArrowUnsorted.js +1 -1
  527. package/dist/esm/icons.generated/ArrowUp.js +1 -1
  528. package/dist/esm/icons.generated/ArrowUpperLeft.js +1 -1
  529. package/dist/esm/icons.generated/ArrowUpperRight.js +1 -1
  530. package/dist/esm/icons.generated/Bug.js +1 -1
  531. package/dist/esm/icons.generated/Calendar.js +1 -1
  532. package/dist/esm/icons.generated/Call.js +1 -1
  533. package/dist/esm/icons.generated/Chat.js +1 -1
  534. package/dist/esm/icons.generated/Check.js +1 -1
  535. package/dist/esm/icons.generated/CheckCircleFilled.js +1 -1
  536. package/dist/esm/icons.generated/ChevronDown.js +1 -1
  537. package/dist/esm/icons.generated/ChevronLeft.js +1 -1
  538. package/dist/esm/icons.generated/ChevronRight.js +1 -1
  539. package/dist/esm/icons.generated/ChevronUp.js +1 -1
  540. package/dist/esm/icons.generated/Clock.js +1 -1
  541. package/dist/esm/icons.generated/Close.js +1 -1
  542. package/dist/esm/icons.generated/CloseCircleFilled.js +1 -1
  543. package/dist/esm/icons.generated/CollapseLeft.js +1 -1
  544. package/dist/esm/icons.generated/CollapseRight.js +1 -1
  545. package/dist/esm/icons.generated/Copy.js +1 -1
  546. package/dist/esm/icons.generated/Customizations.js +1 -1
  547. package/dist/esm/icons.generated/CustomizationsSelected.js +1 -1
  548. package/dist/esm/icons.generated/DangerDiamond.js +1 -1
  549. package/dist/esm/icons.generated/DangerDiamondFilled.js +1 -1
  550. package/dist/esm/icons.generated/Delete.js +1 -1
  551. package/dist/esm/icons.generated/Deny.js +1 -1
  552. package/dist/esm/icons.generated/Devices.js +1 -1
  553. package/dist/esm/icons.generated/Directory.js +1 -1
  554. package/dist/esm/icons.generated/DirectorySelected.js +1 -1
  555. package/dist/esm/icons.generated/Documentation.js +1 -1
  556. package/dist/esm/icons.generated/Download.js +1 -1
  557. package/dist/esm/icons.generated/DragIndicator.js +1 -1
  558. package/dist/esm/icons.generated/Edit.js +1 -1
  559. package/dist/esm/icons.generated/ExpandLeft.js +1 -1
  560. package/dist/esm/icons.generated/ExpandRight.js +1 -1
  561. package/dist/esm/icons.generated/ExternalLink.js +1 -1
  562. package/dist/esm/icons.generated/Filter.js +1 -1
  563. package/dist/esm/icons.generated/Folder.js +1 -1
  564. package/dist/esm/icons.generated/Globe.js +1 -1
  565. package/dist/esm/icons.generated/Grid.js +1 -1
  566. package/dist/esm/icons.generated/Group.js +1 -1
  567. package/dist/esm/icons.generated/Happy.js +1 -1
  568. package/dist/esm/icons.generated/Hide.js +1 -1
  569. package/dist/esm/icons.generated/Home.js +1 -1
  570. package/dist/esm/icons.generated/HomeSelected.js +1 -1
  571. package/dist/esm/icons.generated/IdentityGovernance.js +1 -1
  572. package/dist/esm/icons.generated/IdentityGovernanceSelected.js +1 -1
  573. package/dist/esm/icons.generated/InformationCircle.js +1 -1
  574. package/dist/esm/icons.generated/InformationCircleFilled.js +1 -1
  575. package/dist/esm/icons.generated/Link.js +1 -1
  576. package/dist/esm/icons.generated/List.js +1 -1
  577. package/dist/esm/icons.generated/Lock.js +1 -1
  578. package/dist/esm/icons.generated/Menu.js +1 -1
  579. package/dist/esm/icons.generated/More.js +1 -1
  580. package/dist/esm/icons.generated/Neutral.js +1 -1
  581. package/dist/esm/icons.generated/Notification.js +1 -1
  582. package/dist/esm/icons.generated/Pause.js +1 -1
  583. package/dist/esm/icons.generated/QuestionCircle.js +1 -1
  584. package/dist/esm/icons.generated/QuestionCircleFilled.js +1 -1
  585. package/dist/esm/icons.generated/Refresh.js +1 -1
  586. package/dist/esm/icons.generated/Reports.js +1 -1
  587. package/dist/esm/icons.generated/ReportsSelected.js +1 -1
  588. package/dist/esm/icons.generated/Reset.js +1 -1
  589. package/dist/esm/icons.generated/Resume.js +1 -1
  590. package/dist/esm/icons.generated/Sad.js +1 -1
  591. package/dist/esm/icons.generated/Same.js +1 -1
  592. package/dist/esm/icons.generated/Search.js +1 -1
  593. package/dist/esm/icons.generated/Security.js +1 -1
  594. package/dist/esm/icons.generated/SecuritySelected.js +1 -1
  595. package/dist/esm/icons.generated/Send.js +1 -1
  596. package/dist/esm/icons.generated/Server.js +1 -1
  597. package/dist/esm/icons.generated/Settings.js +1 -1
  598. package/dist/esm/icons.generated/SettingsSelected.js +1 -1
  599. package/dist/esm/icons.generated/Show.js +1 -1
  600. package/dist/esm/icons.generated/Sparkle.js +1 -1
  601. package/dist/esm/icons.generated/Subtract.js +1 -1
  602. package/dist/esm/icons.generated/Sync.js +1 -1
  603. package/dist/esm/icons.generated/ThumbsDown.js +1 -1
  604. package/dist/esm/icons.generated/ThumbsUp.js +1 -1
  605. package/dist/esm/icons.generated/Unlock.js +1 -1
  606. package/dist/esm/icons.generated/Upload.js +1 -1
  607. package/dist/esm/icons.generated/User.js +1 -1
  608. package/dist/esm/icons.generated/Video.js +1 -1
  609. package/dist/esm/icons.generated/Warning.js +1 -1
  610. package/dist/esm/icons.generated/WarningFilled.js +1 -1
  611. package/dist/esm/icons.generated/Workflows.js +1 -1
  612. package/dist/esm/icons.generated/WorkflowsSelected.js +1 -1
  613. package/dist/esm/inputUtils.js.map +1 -1
  614. package/dist/esm/labs/AppTile.js +1 -1
  615. package/dist/esm/labs/AppTile.js.map +1 -1
  616. package/dist/esm/labs/DataFilters.js +2 -2
  617. package/dist/esm/labs/DataFilters.js.map +1 -1
  618. package/dist/esm/labs/DataTable.js +1 -1
  619. package/dist/esm/labs/DataTable.js.map +1 -1
  620. package/dist/esm/labs/DataTablePagination.js +1 -1
  621. package/dist/esm/labs/DataView/BulkActionsMenu.js +1 -1
  622. package/dist/esm/labs/DataView/BulkActionsMenu.js.map +1 -1
  623. package/dist/esm/labs/DataView/CardLayoutContent.js +2 -2
  624. package/dist/esm/labs/DataView/CardLayoutContent.js.map +1 -1
  625. package/dist/esm/labs/DataView/DataCard.js +1 -1
  626. package/dist/esm/labs/DataView/DataCard.js.map +1 -1
  627. package/dist/esm/labs/DataView/DataTable.js +1 -1
  628. package/dist/esm/labs/DataView/DataTable.js.map +1 -1
  629. package/dist/esm/labs/DataView/DataView.js +1 -1
  630. package/dist/esm/labs/DataView/DataView.js.map +1 -1
  631. package/dist/esm/labs/DataView/DetailPanel.js +1 -1
  632. package/dist/esm/labs/DataView/LayoutSwitcher.js +1 -1
  633. package/dist/esm/labs/DataView/RowActions.js +1 -1
  634. package/dist/esm/labs/DataView/RowActions.js.map +1 -1
  635. package/dist/esm/labs/DataView/TableLayoutContent.js +1 -1
  636. package/dist/esm/labs/DataView/TableLayoutContent.js.map +1 -1
  637. package/dist/esm/labs/DataView/TableSettings.js +1 -1
  638. package/dist/esm/labs/DataView/TableSettings.js.map +1 -1
  639. package/dist/esm/labs/DataView/componentTypes.js.map +1 -1
  640. package/dist/esm/labs/DataView/tableConstants.js.map +1 -1
  641. package/dist/esm/labs/DataView/testSupportData.js.map +1 -1
  642. package/dist/esm/labs/DataView/useFilterConversion.js.map +1 -1
  643. package/dist/esm/labs/DatePickers/DateTimeField.js +1 -1
  644. package/dist/esm/labs/DatePickers/DateTimePicker.js +2 -2
  645. package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
  646. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js +4 -4
  647. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js.map +1 -1
  648. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js +1 -1
  649. package/dist/esm/labs/OdysseyPickers/Picker.js +1 -1
  650. package/dist/esm/labs/OdysseyPickers/PickerVirtualizationListBox.js +1 -1
  651. package/dist/esm/labs/OdysseyPickers/PickerVirtualizationListBox.js.map +1 -1
  652. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +1 -1
  653. package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +1 -1
  654. package/dist/esm/labs/PageTemplate/DocumentationLink.js +1 -1
  655. package/dist/esm/labs/PageTemplate/Layout.js +1 -1
  656. package/dist/esm/labs/PageTemplate/Layout.js.map +1 -1
  657. package/dist/esm/labs/PageTemplate/PageTemplate.js +1 -1
  658. package/dist/esm/labs/PaginatedTable.js +1 -1
  659. package/dist/esm/labs/StaticTable.js +1 -1
  660. package/dist/esm/labs/UserProfile.js +1 -1
  661. package/dist/esm/labs/UserProfileMenuButton.js +1 -1
  662. package/dist/esm/logos.generated/Duo.js +1 -1
  663. package/dist/esm/logos.generated/GoogleAuth.js +1 -1
  664. package/dist/esm/logos.generated/OktaVerify.js +1 -1
  665. package/dist/esm/logos.generated/Persona.js +1 -1
  666. package/dist/esm/logos.generated/SymantecVip.js +1 -1
  667. package/dist/esm/logos.generated/Yubikey.js +1 -1
  668. package/dist/esm/test-utils/appendToSandbox.js.map +1 -1
  669. package/dist/esm/test-utils/getControlledElement.js.map +1 -1
  670. package/dist/esm/test-utils/renderWithOdysseyProvider.js.map +1 -1
  671. package/dist/esm/test-utils/viewportTestSizes.js.map +1 -1
  672. package/dist/esm/theme/components/Autocomplete.js.map +1 -1
  673. package/dist/esm/theme/components/Button.js.map +1 -1
  674. package/dist/esm/theme/components/CircularProgress.js.map +1 -1
  675. package/dist/esm/theme/components/Drawer.js.map +1 -1
  676. package/dist/esm/theme/components/Form.js.map +1 -1
  677. package/dist/esm/theme/components/Input.js.map +1 -1
  678. package/dist/esm/theme/components/Table.js.map +1 -1
  679. package/dist/esm/theme/useAppElementContainerQuery.js.map +1 -1
  680. package/dist/esm/theme/useContainerQuery.js.map +1 -1
  681. package/dist/esm/theme/useMediaQuery.js.map +1 -1
  682. package/dist/esm/tools/addSpecificity.js.map +1 -1
  683. package/dist/esm/tools/createBrowserMessageBus.js +41 -0
  684. package/dist/esm/tools/createBrowserMessageBus.js.map +1 -0
  685. package/dist/esm/ui-shell/AppSwitcher/AppSwitcher.js +1 -1
  686. package/dist/esm/ui-shell/InnerAppContainer.js +1 -1
  687. package/dist/esm/ui-shell/NarrowUiShellContent.js +1 -1
  688. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  689. package/dist/esm/ui-shell/SideNav/NavAccordion.js +1 -1
  690. package/dist/esm/ui-shell/SideNav/SideNav.js +1 -1
  691. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  692. package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js +1 -1
  693. package/dist/esm/ui-shell/SideNav/SideNavHeader.js +1 -1
  694. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js +2 -2
  695. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js.map +1 -1
  696. package/dist/esm/ui-shell/SideNav/SideNavItemContentContext.js.map +1 -1
  697. package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +1 -1
  698. package/dist/esm/ui-shell/SideNav/SideNavSortableList.js +1 -1
  699. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +2 -2
  700. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js.map +1 -1
  701. package/dist/esm/ui-shell/SideNav/SortableList/SortableItem.js.map +1 -1
  702. package/dist/esm/ui-shell/SideNav/SortableList/SortableList.js.map +1 -1
  703. package/dist/esm/ui-shell/SideNav/SortableList/SortableOverlay.js.map +1 -1
  704. package/dist/esm/ui-shell/SideNav/types.js.map +1 -1
  705. package/dist/esm/ui-shell/SkipToContent.js +1 -1
  706. package/dist/esm/ui-shell/SkipToContent.js.map +1 -1
  707. package/dist/esm/ui-shell/TopNav/HamburgerMenuIcon.js +1 -1
  708. package/dist/esm/ui-shell/TopNav/TopNav.js +1 -1
  709. package/dist/esm/ui-shell/TopNav/TopNavLinksList.js +1 -1
  710. package/dist/esm/ui-shell/TopNav/TopNavListItem.js +1 -1
  711. package/dist/esm/ui-shell/TopNav/TopNavListItem.js.map +1 -1
  712. package/dist/esm/ui-shell/UiShell.js +1 -1
  713. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  714. package/dist/esm/ui-shell/UiShellLogo.js +1 -1
  715. package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
  716. package/dist/esm/ui-shell/WideUiShellContent.js +1 -1
  717. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  718. package/dist/esm/ui-shell/uiShellContentTypes.js.map +1 -1
  719. package/dist/esm/ui-shell/uiShellSharedConstants.js.map +1 -1
  720. package/dist/esm/useContrastMode.js.map +1 -1
  721. package/dist/esm/useStableCallback.js.map +1 -1
  722. package/dist/esm/useThemeCache.js.map +1 -1
  723. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  724. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  725. package/dist/esm/web-component/renderReactInWebComponent.js.map +1 -1
  726. package/dist/tsconfig.production.tsbuildinfo +1 -1
  727. package/dist/types/Accordion.d.ts.map +1 -1
  728. package/dist/types/Autocomplete.d.ts +5 -17
  729. package/dist/types/Autocomplete.d.ts.map +1 -1
  730. package/dist/types/Badge.d.ts.map +1 -1
  731. package/dist/types/Banner.d.ts.map +1 -1
  732. package/dist/types/Box.d.ts.map +1 -1
  733. package/dist/types/Breadcrumbs.d.ts +4 -8
  734. package/dist/types/Breadcrumbs.d.ts.map +1 -1
  735. package/dist/types/Buttons/BaseButton.d.ts +2 -6
  736. package/dist/types/Buttons/BaseButton.d.ts.map +1 -1
  737. package/dist/types/Buttons/BaseMenuButton.d.ts +1 -2
  738. package/dist/types/Buttons/BaseMenuButton.d.ts.map +1 -1
  739. package/dist/types/Buttons/Button.d.ts.map +1 -1
  740. package/dist/types/Buttons/MenuButton.d.ts.map +1 -1
  741. package/dist/types/Buttons/MenuItem.d.ts.map +1 -1
  742. package/dist/types/Callout.d.ts.map +1 -1
  743. package/dist/types/Card.d.ts.map +1 -1
  744. package/dist/types/CircularProgress.d.ts +1 -2
  745. package/dist/types/CircularProgress.d.ts.map +1 -1
  746. package/dist/types/ConditionalWrapper.d.ts +1 -2
  747. package/dist/types/ConditionalWrapper.d.ts.map +1 -1
  748. package/dist/types/CssBaseline.d.ts +1 -2
  749. package/dist/types/CssBaseline.d.ts.map +1 -1
  750. package/dist/types/DataTable/DataTable.d.ts +9 -19
  751. package/dist/types/DataTable/DataTable.d.ts.map +1 -1
  752. package/dist/types/DataTable/useRowReordering.d.ts.map +1 -1
  753. package/dist/types/DatePickers/DatePicker.d.ts.map +1 -1
  754. package/dist/types/DatePickers/TimeZonePicker.d.ts +1 -2
  755. package/dist/types/DatePickers/TimeZonePicker.d.ts.map +1 -1
  756. package/dist/types/DatePickers/datePickerTheme.d.ts.map +1 -1
  757. package/dist/types/DatePickers/useOdysseyDateFields.d.ts +4 -8
  758. package/dist/types/DatePickers/useOdysseyDateFields.d.ts.map +1 -1
  759. package/dist/types/Dialog.d.ts +5 -10
  760. package/dist/types/Dialog.d.ts.map +1 -1
  761. package/dist/types/Drawer.d.ts +4 -9
  762. package/dist/types/Drawer.d.ts.map +1 -1
  763. package/dist/types/EmptyState.d.ts.map +1 -1
  764. package/dist/types/Fields/Checkbox.d.ts.map +1 -1
  765. package/dist/types/Fields/CheckboxGroup.d.ts.map +1 -1
  766. package/dist/types/Fields/Hint.d.ts.map +1 -1
  767. package/dist/types/Fields/RadioGroup.d.ts.map +1 -1
  768. package/dist/types/Fieldset.d.ts.map +1 -1
  769. package/dist/types/FileUploader/FileUploader.d.ts +2 -4
  770. package/dist/types/FileUploader/FileUploader.d.ts.map +1 -1
  771. package/dist/types/Form.d.ts +6 -13
  772. package/dist/types/Form.d.ts.map +1 -1
  773. package/dist/types/FormCheckedProps.d.ts +4 -8
  774. package/dist/types/FormCheckedProps.d.ts.map +1 -1
  775. package/dist/types/IconWithTooltip.d.ts.map +1 -1
  776. package/dist/types/Link.d.ts.map +1 -1
  777. package/dist/types/NativeSelect.d.ts +2 -4
  778. package/dist/types/NativeSelect.d.ts.map +1 -1
  779. package/dist/types/OdysseyCacheProvider.d.ts +5 -11
  780. package/dist/types/OdysseyCacheProvider.d.ts.map +1 -1
  781. package/dist/types/OdysseyDesignTokensContext.d.ts.map +1 -1
  782. package/dist/types/OdysseyProvider.d.ts +1 -2
  783. package/dist/types/OdysseyProvider.d.ts.map +1 -1
  784. package/dist/types/OdysseyThemeProvider.d.ts +1 -2
  785. package/dist/types/OdysseyThemeProvider.d.ts.map +1 -1
  786. package/dist/types/Pagination/Pagination.d.ts +1 -2
  787. package/dist/types/Pagination/Pagination.d.ts.map +1 -1
  788. package/dist/types/PasswordField.d.ts +2 -14
  789. package/dist/types/PasswordField.d.ts.map +1 -1
  790. package/dist/types/ScreenReaderText.d.ts +1 -2
  791. package/dist/types/ScreenReaderText.d.ts.map +1 -1
  792. package/dist/types/SearchField.d.ts +2 -4
  793. package/dist/types/SearchField.d.ts.map +1 -1
  794. package/dist/types/Select.d.ts.map +1 -1
  795. package/dist/types/Stack.d.ts.map +1 -1
  796. package/dist/types/Status.d.ts.map +1 -1
  797. package/dist/types/Surface.d.ts.map +1 -1
  798. package/dist/types/Switch.d.ts.map +1 -1
  799. package/dist/types/Tabs.d.ts +1 -2
  800. package/dist/types/Tabs.d.ts.map +1 -1
  801. package/dist/types/Tag.d.ts.map +1 -1
  802. package/dist/types/TagList.d.ts.map +1 -1
  803. package/dist/types/TextField.d.ts +6 -12
  804. package/dist/types/TextField.d.ts.map +1 -1
  805. package/dist/types/Toast.d.ts +2 -4
  806. package/dist/types/Toast.d.ts.map +1 -1
  807. package/dist/types/ToastStack.d.ts.map +1 -1
  808. package/dist/types/Tooltip.d.ts.map +1 -1
  809. package/dist/types/Typography.d.ts +3 -6
  810. package/dist/types/Typography.d.ts.map +1 -1
  811. package/dist/types/__internal.d.ts +1 -2
  812. package/dist/types/__internal.d.ts.map +1 -1
  813. package/dist/types/charts/BarChart.d.ts +1 -3
  814. package/dist/types/charts/BarChart.d.ts.map +1 -1
  815. package/dist/types/charts/LineChart.d.ts +1 -3
  816. package/dist/types/charts/LineChart.d.ts.map +1 -1
  817. package/dist/types/charts/components/ChartContainer.d.ts +1 -3
  818. package/dist/types/charts/components/ChartContainer.d.ts.map +1 -1
  819. package/dist/types/charts/components/ChartError.d.ts +1 -3
  820. package/dist/types/charts/components/ChartError.d.ts.map +1 -1
  821. package/dist/types/charts/components/ChartFrame.d.ts +7 -16
  822. package/dist/types/charts/components/ChartFrame.d.ts.map +1 -1
  823. package/dist/types/charts/components/ChartPopoverContent.d.ts +14 -36
  824. package/dist/types/charts/components/ChartPopoverContent.d.ts.map +1 -1
  825. package/dist/types/charts/utils/chartTokens.d.ts +7 -25
  826. package/dist/types/charts/utils/chartTokens.d.ts.map +1 -1
  827. package/dist/types/charts/utils/chartTypes.d.ts +21 -55
  828. package/dist/types/charts/utils/chartTypes.d.ts.map +1 -1
  829. package/dist/types/charts/utils/formatChartValue.d.ts +7 -28
  830. package/dist/types/charts/utils/formatChartValue.d.ts.map +1 -1
  831. package/dist/types/charts/utils/getChartSeriesPointData.d.ts +5 -16
  832. package/dist/types/charts/utils/getChartSeriesPointData.d.ts.map +1 -1
  833. package/dist/types/charts/utils/hasDuplicateSeries.d.ts +1 -3
  834. package/dist/types/charts/utils/hasDuplicateSeries.d.ts.map +1 -1
  835. package/dist/types/charts/utils/resolveChartLocale.d.ts +3 -11
  836. package/dist/types/charts/utils/resolveChartLocale.d.ts.map +1 -1
  837. package/dist/types/charts/utils/useChartValueFormatter.d.ts +3 -10
  838. package/dist/types/charts/utils/useChartValueFormatter.d.ts.map +1 -1
  839. package/dist/types/charts/utils/useStableValue.d.ts +3 -12
  840. package/dist/types/charts/utils/useStableValue.d.ts.map +1 -1
  841. package/dist/types/createContrastColors.d.ts.map +1 -1
  842. package/dist/types/createOdysseyStyledComponent.d.ts +1 -3
  843. package/dist/types/createOdysseyStyledComponent.d.ts.map +1 -1
  844. package/dist/types/getLogicalBoundaries.d.ts +1 -2
  845. package/dist/types/getLogicalBoundaries.d.ts.map +1 -1
  846. package/dist/types/inputUtils.d.ts +2 -4
  847. package/dist/types/inputUtils.d.ts.map +1 -1
  848. package/dist/types/labs/AppTile.d.ts.map +1 -1
  849. package/dist/types/labs/DataFilters.d.ts +9 -20
  850. package/dist/types/labs/DataFilters.d.ts.map +1 -1
  851. package/dist/types/labs/DataTable.d.ts +10 -21
  852. package/dist/types/labs/DataTable.d.ts.map +1 -1
  853. package/dist/types/labs/DataView/BulkActionsMenu.d.ts.map +1 -1
  854. package/dist/types/labs/DataView/CardLayoutContent.d.ts +1 -1
  855. package/dist/types/labs/DataView/CardLayoutContent.d.ts.map +1 -1
  856. package/dist/types/labs/DataView/DataCard.d.ts +1 -2
  857. package/dist/types/labs/DataView/DataCard.d.ts.map +1 -1
  858. package/dist/types/labs/DataView/DataTable.d.ts +1 -0
  859. package/dist/types/labs/DataView/DataTable.d.ts.map +1 -1
  860. package/dist/types/labs/DataView/DataView.d.ts +1 -0
  861. package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
  862. package/dist/types/labs/DataView/RowActions.d.ts.map +1 -1
  863. package/dist/types/labs/DataView/TableLayoutContent.d.ts +1 -1
  864. package/dist/types/labs/DataView/TableLayoutContent.d.ts.map +1 -1
  865. package/dist/types/labs/DataView/TableSettings.d.ts +1 -1
  866. package/dist/types/labs/DataView/TableSettings.d.ts.map +1 -1
  867. package/dist/types/labs/DataView/componentTypes.d.ts +4 -13
  868. package/dist/types/labs/DataView/componentTypes.d.ts.map +1 -1
  869. package/dist/types/labs/DataView/tableConstants.d.ts.map +1 -1
  870. package/dist/types/labs/DataView/testSupportData.d.ts.map +1 -1
  871. package/dist/types/labs/DataView/useFilterConversion.d.ts.map +1 -1
  872. package/dist/types/labs/OdysseyPickers/PickerVirtualizationListBox.d.ts.map +1 -1
  873. package/dist/types/labs/PageTemplate/Layout.d.ts +1 -2
  874. package/dist/types/labs/PageTemplate/Layout.d.ts.map +1 -1
  875. package/dist/types/test-utils/appendToSandbox.d.ts +3 -16
  876. package/dist/types/test-utils/appendToSandbox.d.ts.map +1 -1
  877. package/dist/types/test-utils/getControlledElement.d.ts +1 -2
  878. package/dist/types/test-utils/getControlledElement.d.ts.map +1 -1
  879. package/dist/types/test-utils/renderWithOdysseyProvider.d.ts.map +1 -1
  880. package/dist/types/test-utils/viewportTestSizes.d.ts.map +1 -1
  881. package/dist/types/theme/components/Autocomplete.d.ts.map +1 -1
  882. package/dist/types/theme/components/Button.d.ts.map +1 -1
  883. package/dist/types/theme/components/CircularProgress.d.ts.map +1 -1
  884. package/dist/types/theme/components/Drawer.d.ts.map +1 -1
  885. package/dist/types/theme/components/Form.d.ts.map +1 -1
  886. package/dist/types/theme/components/Input.d.ts.map +1 -1
  887. package/dist/types/theme/components/Table.d.ts.map +1 -1
  888. package/dist/types/theme/useAppElementContainerQuery.d.ts +1 -7
  889. package/dist/types/theme/useAppElementContainerQuery.d.ts.map +1 -1
  890. package/dist/types/theme/useContainerQuery.d.ts +2 -8
  891. package/dist/types/theme/useContainerQuery.d.ts.map +1 -1
  892. package/dist/types/theme/useMediaQuery.d.ts +12 -38
  893. package/dist/types/theme/useMediaQuery.d.ts.map +1 -1
  894. package/dist/types/tools/addSpecificity.d.ts +1 -2
  895. package/dist/types/tools/addSpecificity.d.ts.map +1 -1
  896. package/dist/types/tools/createBrowserMessageBus.d.ts +45 -0
  897. package/dist/types/tools/createBrowserMessageBus.d.ts.map +1 -0
  898. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  899. package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
  900. package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts.map +1 -1
  901. package/dist/types/ui-shell/SideNav/SideNavItemContentContext.d.ts +1 -3
  902. package/dist/types/ui-shell/SideNav/SideNavItemContentContext.d.ts.map +1 -1
  903. package/dist/types/ui-shell/SideNav/SideNavToggleButton.d.ts.map +1 -1
  904. package/dist/types/ui-shell/SideNav/SortableList/SortableItem.d.ts.map +1 -1
  905. package/dist/types/ui-shell/SideNav/SortableList/SortableList.d.ts +1 -3
  906. package/dist/types/ui-shell/SideNav/SortableList/SortableList.d.ts.map +1 -1
  907. package/dist/types/ui-shell/SideNav/SortableList/SortableOverlay.d.ts.map +1 -1
  908. package/dist/types/ui-shell/SideNav/types.d.ts +6 -13
  909. package/dist/types/ui-shell/SideNav/types.d.ts.map +1 -1
  910. package/dist/types/ui-shell/SkipToContent.d.ts.map +1 -1
  911. package/dist/types/ui-shell/TopNav/TopNavListItem.d.ts +1 -2
  912. package/dist/types/ui-shell/TopNav/TopNavListItem.d.ts.map +1 -1
  913. package/dist/types/ui-shell/UiShell.d.ts +4 -8
  914. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  915. package/dist/types/ui-shell/UiShellProvider.d.ts +2 -4
  916. package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
  917. package/dist/types/ui-shell/renderUiShell.d.ts +2 -5
  918. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  919. package/dist/types/ui-shell/uiShellContentTypes.d.ts +1 -2
  920. package/dist/types/ui-shell/uiShellContentTypes.d.ts.map +1 -1
  921. package/dist/types/ui-shell/uiShellSharedConstants.d.ts.map +1 -1
  922. package/dist/types/useContrastMode.d.ts +2 -7
  923. package/dist/types/useContrastMode.d.ts.map +1 -1
  924. package/dist/types/useStableCallback.d.ts +5 -16
  925. package/dist/types/useStableCallback.d.ts.map +1 -1
  926. package/dist/types/useThemeCache.d.ts.map +1 -1
  927. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  928. package/dist/types/web-component/renderReactInWebComponent.d.ts +6 -12
  929. package/dist/types/web-component/renderReactInWebComponent.d.ts.map +1 -1
  930. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavToggleButton.cjs","names":["_styled","_interopRequireDefault","require","_react","_i18n","_ChevronRight","_MuiPropsContext","_OdysseyDesignTokensContext","_Tooltip","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","SIDE_NAV_TOGGLE_ICON_SIZE","exports","SIDE_NAV_TOGGLE_ICON_HALF_SIZE","StyledToggleButton","styled","_Button2","shouldForwardProp","prop","clickAreaPadding","odysseyDesignTokens","border","height","left","padding","position","width","zIndex","UI_SHELL_OVERLAY_Z_INDEX","backgroundColor","borderColor","boxShadow","color","PalettePrimaryText","outline","HueNeutralWhite","borderRadius","ShadowScale1","content","top","StyledChevronRightIcon","ChevronRightIcon","isSideNavCollapsed","fontSize","undefined","right","transform","transitionDuration","TransitionDurationMain","transitionProperty","transitionTimingFunction","displayName","defaultLocalButton","window","document","createElement","SideNavToggleButton","ariaControls","id","onClick","onHighlight","tabIndex","useOdysseyDesignTokens","t","useTranslation","buttonRef","useRef","useEffect","setHighlighted","setUnhighlighted","setFocusHighlighted","Boolean","current","matches","addEventListener","removeEventListener","toggleLabel","useMemo","renderButton","useCallback","muiProps","jsx","ref","element","variant","children","Tooltip","ariaType","placement","text","MuiPropsContext","Consumer","MemoizedSideNavToggleButton","memo"],"sources":["../../../../src/ui-shell/SideNav/SideNavToggleButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\n\nimport styled from \"@emotion/styled\";\nimport { Button as MuiButton } from \"@mui/material\";\nimport {\n HTMLAttributes,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { useTranslation } from \"../../i18n.generated/i18n.js\";\nimport { ChevronRightIcon } from \"../../icons.generated/ChevronRight.js\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../../MuiPropsContext.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Tooltip } from \"../../Tooltip.js\";\nimport { UI_SHELL_OVERLAY_Z_INDEX } from \"../uiShellSharedConstants.js\";\n\nexport const SIDE_NAV_TOGGLE_ICON_SIZE = 24;\nexport const SIDE_NAV_TOGGLE_ICON_HALF_SIZE = SIDE_NAV_TOGGLE_ICON_SIZE / 2;\n\nconst StyledToggleButton = styled(MuiButton, {\n shouldForwardProp: (prop) =>\n prop !== \"clickAreaPadding\" && prop !== \"odysseyDesignTokens\",\n})<{\n clickAreaPadding: number;\n odysseyDesignTokens: DesignTokens;\n}>(({ clickAreaPadding, odysseyDesignTokens }) => ({\n border: 0,\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `-${clickAreaPadding * 2}px`,\n padding: 0,\n position: \"relative\",\n width: `calc(${SIDE_NAV_TOGGLE_ICON_SIZE}px + (${clickAreaPadding}px * 2))`,\n zIndex: UI_SHELL_OVERLAY_Z_INDEX,\n\n // `&&` is a CSS specificity override. Used here to counteract MUI Button styles.\n \"&&\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n boxShadow: \"none\",\n color: odysseyDesignTokens.PalettePrimaryText,\n },\n\n \"&:focus-visible\": {\n outline: \"none\",\n },\n\n // `&&` raises specificity to counteract the \"floating\" Button variant's\n // `&[aria-expanded='true']:not([aria-disabled='true'])` rule. Since this\n // button is always `aria-expanded` while open, that theme rule would\n // otherwise set the chevron to `HueBlue600` on hover, matching the hover\n // background and making the arrow invisible.\n \"&&:hover, &&:focus-visible\": {\n backgroundColor: \"transparent\",\n color: odysseyDesignTokens.HueNeutralWhite,\n },\n\n \"&::before\": {\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n borderColor: \"transparent\",\n borderRadius: \"50%\",\n boxShadow: odysseyDesignTokens.ShadowScale1,\n color: odysseyDesignTokens.PalettePrimaryText,\n content: \"''\",\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `${clickAreaPadding * 2}px`,\n position: \"absolute\",\n top: 0,\n width: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n },\n\n \"&:hover::before, &:focus-visible::before\": {\n backgroundColor: odysseyDesignTokens.PalettePrimaryText,\n },\n}));\n\nconst StyledChevronRightIcon = styled(ChevronRightIcon, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})<{\n isSideNavCollapsed: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ isSideNavCollapsed, odysseyDesignTokens }) => ({\n fontSize: \"125%\",\n left: isSideNavCollapsed ? undefined : \"4px\",\n position: \"absolute\",\n right: isSideNavCollapsed ? \"4px\" : undefined,\n top: \"3px\",\n transform: isSideNavCollapsed ? \"rotate(0deg)\" : \"rotate(-180deg)\", // Leave this as `-180deg` so it rotates over the top, not the bottom.\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n transitionProperty: \"transform\",\n transitionTimingFunction: \"ease-in-out\",\n}));\nStyledChevronRightIcon.displayName = \"StyledChevronRightIcon\";\n\nexport type SideNavToggleButtonProps = {\n /**\n * The `id` of the item this button controls\n */\n ariaControls: string;\n /**\n * Left padding in pixels for the click area of the button.\n *\n * Useful when moving the button around when trying to click it. This ensures the click area doesn't move to the right along with the button.\n */\n clickAreaPadding?: number;\n /**\n * HTML `id` attribute for the `<button>` element.\n */\n id?: string;\n isSideNavCollapsed: boolean;\n /**\n * Click event handler for the `<button>` element.\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * Provides the hovered or focused state of the `<button>` element.\n */\n onHighlight?: (isHighlighted: boolean) => void;\n onKeyDown?: MuiButtonProps[\"onKeyDown\"];\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n};\n\n// This allows us to mutate the value with TypeScript. A singleton is fine because it gets overridden on render.\nconst defaultLocalButton =\n typeof window === \"undefined\" ? null : document.createElement(\"button\");\n\nconst SideNavToggleButton = ({\n ariaControls,\n clickAreaPadding = 0,\n id,\n isSideNavCollapsed,\n onClick,\n onHighlight,\n tabIndex,\n}: SideNavToggleButtonProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const buttonRef = useRef(defaultLocalButton);\n\n useEffect(() => {\n const setHighlighted = () => {\n onHighlight?.(true);\n };\n\n const setUnhighlighted = () => {\n onHighlight?.(false);\n };\n\n const setFocusHighlighted = () => {\n onHighlight?.(Boolean(buttonRef.current?.matches(\":focus-visible\")));\n };\n\n buttonRef.current?.addEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.addEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.addEventListener(\"focus\", setFocusHighlighted, true);\n\n buttonRef.current?.addEventListener(\"blur\", setFocusHighlighted, true);\n\n setUnhighlighted();\n\n return () => {\n buttonRef.current?.removeEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.removeEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.removeEventListener(\n \"focus\",\n setFocusHighlighted,\n true,\n );\n\n buttonRef.current?.removeEventListener(\"blur\", setFocusHighlighted, true);\n };\n }, [onHighlight]);\n\n const toggleLabel = useMemo(\n () =>\n isSideNavCollapsed\n ? t(\"sidenav.toggle.expand\")\n : t(\"sidenav.toggle.collapse\"),\n [isSideNavCollapsed, t],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <StyledToggleButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-expanded={!isSideNavCollapsed}\n aria-label={toggleLabel}\n clickAreaPadding={clickAreaPadding}\n data-se=\"sidenav-toggle-button\"\n data-sidenav-toggle\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n onClick={onClick}\n ref={(element: HTMLButtonElement) => {\n if (element) {\n buttonRef.current = element;\n //@ts-expect-error `ref` is an optional prop, but TypeScript doesn't know this.\n muiProps.ref?.(element);\n }\n }}\n tabIndex={tabIndex}\n variant=\"floating\"\n >\n <StyledChevronRightIcon\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </StyledToggleButton>\n );\n },\n [\n ariaControls,\n clickAreaPadding,\n id,\n isSideNavCollapsed,\n odysseyDesignTokens,\n onClick,\n tabIndex,\n toggleLabel,\n ],\n );\n\n return (\n <Tooltip ariaType=\"description\" placement=\"right\" text={toggleLabel}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n};\n\nconst MemoizedSideNavToggleButton = memo(SideNavToggleButton);\nMemoizedSideNavToggleButton.displayName = \"SideNavToggleButton\";\n\nexport { MemoizedSideNavToggleButton as SideNavToggleButton };\n"],"mappings":";;;;;;;AAcA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AAAwE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjCxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,MAAMG,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,EAAE;AACpC,MAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAGF,yBAAyB,GAAG,CAAC;AAE3E,MAAMG,kBAAkB,GAAG,IAAAC,eAAM,EAAAC,QAAA,CAAAN,OAAA,EAAY;EAC3CO,iBAAiB,EAAGC,IA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BAAe,CAACf,kBAAmB;MACnC,cAAYkC,WAAY;MACxBzD,gBAAgB,EAAEA,gBAAiB;MACnC,WAAQ,uBAAuB;MAC/B,2BAAmB;MACnBuC,EAAE,EAAEA,EAAG;MACPtC,mBAAmB,EAAEA,mBAAoB;MACzCuC,OAAO,EAAEA,OAAQ;MACjBuB,GAAG,EAAGC,OAA0B,IAAK;QACnC,IAAIA,OAAO,EAAE;UACXlB,SAAS,CAACO,OAAO,GAAGW,OAAO;UAE3BH,QAAQ,CAACE,GAAG,GAAGC,OAAO,CAAC;QACzB;MACF,CAAE;MACFtB,QAAQ,EAAEA,QAAS;MACnBuB,OAAO,EAAC,UAAU;MAAAC,QAAA,EAElB,IAAA9E,WAAA,CAAA0E,GAAA,EAACzC,sBAAsB;QACrBE,kBAAkB,EAAEA,kBAAmB;QACvCtB,mBAAmB,EAAEA;MAAoB,CAC1C;IAAC,CACgB,CAAC;EAEzB,CAAC,EACD,CACEqC,YAAY,EACZtC,gBAAgB,EAChBuC,EAAE,EACFhB,kBAAkB,EAClBtB,mBAAmB,EACnBuC,OAAO,EACPE,QAAQ,EACRe,WAAW,CAEf,CAAC;EAED,OACE,IAAArE,WAAA,CAAA0E,GAAA,EAAC5E,QAAA,CAAAiF,OAAO;IAACC,QAAQ,EAAC,aAAa;IAACC,SAAS,EAAC,OAAO;IAACC,IAAI,EAAEb,WAAY;IAAAS,QAAA,EAClE,IAAA9E,WAAA,CAAA0E,GAAA,EAAC9E,gBAAA,CAAAuF,eAAe,CAACC,QAAQ;MAAAN,QAAA,EAAEP;IAAY,CAA2B;EAAC,CAC5D,CAAC;AAEd,CAAC;AAED,MAAMc,2BAA2B,GAAAhF,OAAA,CAAA4C,mBAAA,GAAG,IAAAqC,WAAI,EAACrC,mBAAmB,CAAC;AAC7DoC,2BAA2B,CAACzC,WAAW,qDAAwB","ignoreList":[]}
1
+ {"version":3,"file":"SideNavToggleButton.cjs","names":["_styled","_interopRequireDefault","require","_react","_i18n","_ChevronRight","_MuiPropsContext","_OdysseyDesignTokensContext","_Tooltip","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","SIDE_NAV_TOGGLE_ICON_SIZE","exports","SIDE_NAV_TOGGLE_ICON_HALF_SIZE","StyledToggleButton","styled","_Button2","shouldForwardProp","prop","clickAreaPadding","odysseyDesignTokens","border","height","left","padding","position","width","zIndex","UI_SHELL_OVERLAY_Z_INDEX","backgroundColor","borderColor","boxShadow","color","PalettePrimaryText","outline","HueNeutralWhite","borderRadius","ShadowScale1","content","top","StyledChevronRightIcon","ChevronRightIcon","isSideNavCollapsed","fontSize","undefined","right","transform","transitionDuration","TransitionDurationMain","transitionProperty","transitionTimingFunction","displayName","defaultLocalButton","window","document","createElement","SideNavToggleButton","ariaControls","id","onClick","onHighlight","tabIndex","useOdysseyDesignTokens","t","useTranslation","buttonRef","useRef","useEffect","setHighlighted","setUnhighlighted","setFocusHighlighted","Boolean","current","matches","addEventListener","removeEventListener","toggleLabel","useMemo","renderButton","useCallback","muiProps","jsx","ref","element","variant","children","Tooltip","ariaType","placement","text","MuiPropsContext","Consumer","MemoizedSideNavToggleButton","memo"],"sources":["../../../../src/ui-shell/SideNav/SideNavToggleButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\n\nimport styled from \"@emotion/styled\";\nimport { Button as MuiButton } from \"@mui/material\";\nimport {\n HTMLAttributes,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { useTranslation } from \"../../i18n.generated/i18n.js\";\nimport { ChevronRightIcon } from \"../../icons.generated/ChevronRight.js\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../../MuiPropsContext.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Tooltip } from \"../../Tooltip.js\";\nimport { UI_SHELL_OVERLAY_Z_INDEX } from \"../uiShellSharedConstants.js\";\n\nexport const SIDE_NAV_TOGGLE_ICON_SIZE = 24;\nexport const SIDE_NAV_TOGGLE_ICON_HALF_SIZE = SIDE_NAV_TOGGLE_ICON_SIZE / 2;\n\nconst StyledToggleButton = styled(MuiButton, {\n shouldForwardProp: (prop) =>\n prop !== \"clickAreaPadding\" && prop !== \"odysseyDesignTokens\",\n})<{\n clickAreaPadding: number;\n odysseyDesignTokens: DesignTokens;\n}>(({ clickAreaPadding, odysseyDesignTokens }) => ({\n border: 0,\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `-${clickAreaPadding * 2}px`,\n padding: 0,\n position: \"relative\",\n width: `calc(${SIDE_NAV_TOGGLE_ICON_SIZE}px + (${clickAreaPadding}px * 2))`,\n zIndex: UI_SHELL_OVERLAY_Z_INDEX,\n\n // `&&` is a CSS specificity override. Used here to counteract MUI Button styles.\n \"&&\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n boxShadow: \"none\",\n color: odysseyDesignTokens.PalettePrimaryText,\n },\n\n \"&:focus-visible\": {\n outline: \"none\",\n },\n\n // `&&` raises specificity to counteract the \"floating\" Button variant's `&[aria-expanded='true']:not([aria-disabled='true'])` rule. Since this button is always `aria-expanded` while open, that theme rule would otherwise set the chevron to `HueBlue600` on hover, matching the hover background and making the arrow invisible.\n \"&&:hover, &&:focus-visible\": {\n backgroundColor: \"transparent\",\n color: odysseyDesignTokens.HueNeutralWhite,\n },\n\n \"&::before\": {\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n borderColor: \"transparent\",\n borderRadius: \"50%\",\n boxShadow: odysseyDesignTokens.ShadowScale1,\n color: odysseyDesignTokens.PalettePrimaryText,\n content: \"''\",\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `${clickAreaPadding * 2}px`,\n position: \"absolute\",\n top: 0,\n width: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n },\n\n \"&:hover::before, &:focus-visible::before\": {\n backgroundColor: odysseyDesignTokens.PalettePrimaryText,\n },\n}));\n\nconst StyledChevronRightIcon = styled(ChevronRightIcon, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})<{\n isSideNavCollapsed: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ isSideNavCollapsed, odysseyDesignTokens }) => ({\n fontSize: \"125%\",\n left: isSideNavCollapsed ? undefined : \"4px\",\n position: \"absolute\",\n right: isSideNavCollapsed ? \"4px\" : undefined,\n top: \"3px\",\n transform: isSideNavCollapsed ? \"rotate(0deg)\" : \"rotate(-180deg)\", // Leave this as `-180deg` so it rotates over the top, not the bottom.\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n transitionProperty: \"transform\",\n transitionTimingFunction: \"ease-in-out\",\n}));\nStyledChevronRightIcon.displayName = \"StyledChevronRightIcon\";\n\nexport type SideNavToggleButtonProps = {\n /**\n * The `id` of the item this button controls\n */\n ariaControls: string;\n /**\n * Left padding in pixels for the click area of the button.\n *\n * Useful when moving the button around when trying to click it. This ensures the click area doesn't move to the right along with the button.\n */\n clickAreaPadding?: number;\n /**\n * HTML `id` attribute for the `<button>` element.\n */\n id?: string;\n isSideNavCollapsed: boolean;\n /**\n * Click event handler for the `<button>` element.\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * Provides the hovered or focused state of the `<button>` element.\n */\n onHighlight?: (isHighlighted: boolean) => void;\n onKeyDown?: MuiButtonProps[\"onKeyDown\"];\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n};\n\n// This allows us to mutate the value with TypeScript. A singleton is fine because it gets overridden on render.\nconst defaultLocalButton =\n typeof window === \"undefined\" ? null : document.createElement(\"button\");\n\nconst SideNavToggleButton = ({\n ariaControls,\n clickAreaPadding = 0,\n id,\n isSideNavCollapsed,\n onClick,\n onHighlight,\n tabIndex,\n}: SideNavToggleButtonProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const buttonRef = useRef(defaultLocalButton);\n\n useEffect(() => {\n const setHighlighted = () => {\n onHighlight?.(true);\n };\n\n const setUnhighlighted = () => {\n onHighlight?.(false);\n };\n\n const setFocusHighlighted = () => {\n onHighlight?.(Boolean(buttonRef.current?.matches(\":focus-visible\")));\n };\n\n buttonRef.current?.addEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.addEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.addEventListener(\"focus\", setFocusHighlighted, true);\n\n buttonRef.current?.addEventListener(\"blur\", setFocusHighlighted, true);\n\n setUnhighlighted();\n\n return () => {\n buttonRef.current?.removeEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.removeEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.removeEventListener(\n \"focus\",\n setFocusHighlighted,\n true,\n );\n\n buttonRef.current?.removeEventListener(\"blur\", setFocusHighlighted, true);\n };\n }, [onHighlight]);\n\n const toggleLabel = useMemo(\n () =>\n isSideNavCollapsed\n ? t(\"sidenav.toggle.expand\")\n : t(\"sidenav.toggle.collapse\"),\n [isSideNavCollapsed, t],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <StyledToggleButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-expanded={!isSideNavCollapsed}\n aria-label={toggleLabel}\n clickAreaPadding={clickAreaPadding}\n data-se=\"sidenav-toggle-button\"\n data-sidenav-toggle\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n onClick={onClick}\n ref={(element: HTMLButtonElement) => {\n if (element) {\n buttonRef.current = element;\n //@ts-expect-error `ref` is an optional prop, but TypeScript doesn't know this.\n muiProps.ref?.(element);\n }\n }}\n tabIndex={tabIndex}\n variant=\"floating\"\n >\n <StyledChevronRightIcon\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </StyledToggleButton>\n );\n },\n [\n ariaControls,\n clickAreaPadding,\n id,\n isSideNavCollapsed,\n odysseyDesignTokens,\n onClick,\n tabIndex,\n toggleLabel,\n ],\n );\n\n return (\n <Tooltip ariaType=\"description\" placement=\"right\" text={toggleLabel}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n};\n\nconst MemoizedSideNavToggleButton = memo(SideNavToggleButton);\nMemoizedSideNavToggleButton.displayName = \"SideNavToggleButton\";\n\nexport { MemoizedSideNavToggleButton as SideNavToggleButton };\n"],"mappings":";;;;;;;AAcA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AAAwE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjCxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,MAAMG,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,EAAE;AACpC,MAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAGF,yBAAyB,GAAG,CAAC;AAE3E,MAAMG,kBAAkB,GAAG,IAAAC,eAAM,EAAAC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"file":"SortableItem.cjs","names":["_sortable","require","_utilities","_styled","_interopRequireDefault","_react","_i18n","_OdysseyDesignTokensContext","_UiShellProvider","_SortableOverlay","_jsxRuntime","e","__esModule","default","SortableItemContext","createContext","attributes","listeners","undefined","ref","createRef","StyledSortableListItem","styled","shouldForwardProp","prop","odysseyDesignTokens","isSelected","sideNavContrastColors","position","button","top","left","Spacing2","transform","svg","path","fill","fontColor","opacity","outlineWidth","TypographyColorAction","getFocusRingStyles","focusRingColor","outline","boxShadow","HueNeutralWhite","PalettePrimaryMain","StyledDragHandleButton","isGrabbed","padding","border","borderRadius","BorderRadiusMain","backgroundColor","cursor","display","HueBlue100","HueNeutral200","borderColor","HueBlue600","color","DragHandle","label","useContext","useOdysseyDesignTokens","t","useTranslation","uiShellContext","useUiShellContext","useDragOverlayContext","jsx","children","height","viewBox","width","xmlns","clipRule","d","fillRule","exports","SortableItem","id","isDisabled","isSortable","isDragging","setNodeRef","setActivatorNodeRef","transition","useSortable","context","useMemo","style","CSS","Translate","toString","Provider","value","jsxs"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type {\n DraggableSyntheticListeners,\n UniqueIdentifier,\n} from \"@dnd-kit/core\";\n\nimport { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport styled from \"@emotion/styled\";\nimport {\n createContext,\n createRef,\n CSSProperties,\n PropsWithChildren,\n RefObject,\n useContext,\n useMemo,\n} from \"react\";\n\nimport { ContrastColors } from \"../../../createContrastColors.js\";\nimport { useTranslation } from \"../../../i18n.generated/i18n.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../../OdysseyDesignTokensContext.js\";\nimport {\n UiShellColors,\n useUiShellContext,\n} from \"../../../ui-shell/UiShellProvider.js\";\nimport { useDragOverlayContext } from \"./SortableOverlay.js\";\n\ntype ItemProps = {\n id: UniqueIdentifier;\n isDisabled?: boolean;\n isSelected?: boolean;\n isSortable?: boolean;\n label: string;\n};\n\nexport type SortableItemContextType = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n attributes: Record<string, any>;\n listeners: DraggableSyntheticListeners;\n ref: RefObject<HTMLButtonElement>;\n};\n\nconst SortableItemContext = createContext<SortableItemContextType>({\n attributes: {},\n listeners: undefined,\n ref: createRef<HTMLButtonElement>(),\n});\n\nconst StyledSortableListItem = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isSelected\" &&\n prop !== \"sideNavContrastColors\",\n})<{\n isSelected?: boolean;\n odysseyDesignTokens: DesignTokens;\n sideNavContrastColors: UiShellColors[\"sideNavContrastColors\"];\n}>(({ odysseyDesignTokens, isSelected, sideNavContrastColors }) => ({\n position: \"relative\",\n\n button: {\n top: \"50%\",\n left: odysseyDesignTokens.Spacing2,\n transform: \"translateY(-50%)\",\n },\n\n svg: {\n path: {\n fill: \"currentColor\",\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n\n \"&:has(a:hover, button:hover, a:focus, button:focus, a:focus-visible, button:focus-visible, [role='button']:hover, [role='button']:focus, [role='button']:focus-visible)\":\n {\n button: {\n opacity: 1,\n outlineWidth: 0,\n },\n },\n\n ...(isSelected && {\n svg: {\n path: {\n fill: odysseyDesignTokens.TypographyColorAction,\n\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n }),\n}));\n\nconst getFocusRingStyles = ({\n focusRingColor,\n odysseyDesignTokens,\n}: {\n focusRingColor: ContrastColors[\"focusRingColor\"];\n odysseyDesignTokens: DesignTokens;\n}) => ({\n outline: \"2px solid transparent\",\n boxShadow: `0 0 0 2px ${odysseyDesignTokens.HueNeutralWhite}, 0 0 0 4px ${focusRingColor || odysseyDesignTokens.PalettePrimaryMain}`,\n});\n\nconst StyledDragHandleButton = styled(\"button\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isGrabbed\" &&\n prop !== \"isSelected\" &&\n prop !== \"focusRingColor\",\n})<{\n focusRingColor: ContrastColors[\"focusRingColor\"];\n isGrabbed?: boolean;\n isSelected?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens, isGrabbed, isSelected, focusRingColor }) => ({\n position: \"absolute\",\n opacity: 0,\n padding: odysseyDesignTokens.Spacing2,\n // Transparent 1px border by default so toggling to the HueBlue600 grabbed\n // border does not shift the icon.\n border: \"1px solid transparent\",\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n backgroundColor: \"transparent\",\n cursor: `${isGrabbed ? \"grabbing\" : \"grab\"}`,\n outline: \"none\",\n\n svg: {\n display: \"flex\",\n },\n\n // hover state, only applied when not actively grabbing/dragging the handle\n ...(!isGrabbed && {\n \"&:hover\": {\n backgroundColor: isSelected\n ? odysseyDesignTokens.HueBlue100\n : odysseyDesignTokens.HueNeutral200,\n },\n }),\n\n // Focus ring for a resting handle (keyboard focus). Excludes the actively\n // grabbed handle via aria-pressed so the isGrabbed block styles that state.\n \"&:focus-visible:not([aria-pressed='true'])\": getFocusRingStyles({\n focusRingColor,\n odysseyDesignTokens,\n }),\n\n // grabbed (overlay)\n ...(isGrabbed && {\n opacity: 1,\n borderColor: odysseyDesignTokens.HueBlue600,\n // icon fills with currentColor, so `color` recolors it to match the border\n color: odysseyDesignTokens.HueBlue600,\n ...getFocusRingStyles({ focusRingColor, odysseyDesignTokens }),\n }),\n}));\n\ntype DragHandleProps = {\n isDisabled?: boolean;\n isSelected?: boolean;\n label: string;\n};\n\nexport const DragHandle = ({ isSelected, label }: DragHandleProps) => {\n const { attributes, listeners, ref } = useContext(SortableItemContext);\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const uiShellContext = useUiShellContext();\n // True only for the overlay copy that follows the pointer.\n const { isGrabbed } = useDragOverlayContext();\n\n return (\n <StyledDragHandleButton\n {...attributes}\n {...listeners}\n aria-label={\n label\n ? t(\"navigation.drag.handle.label\", { label })\n : t(\"navigation.drag.handle\")\n }\n focusRingColor={uiShellContext?.sideNavContrastColors?.focusRingColor}\n isGrabbed={isGrabbed}\n isSelected={isSelected}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={ref}\n >\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M6 2.33331C6 2.8856 5.55228 3.33331 5 3.33331C4.44772 3.33331 4 2.8856 4 2.33331C4 1.78103 4.44772 1.33331 5 1.33331C5.55228 1.33331 6 1.78103 6 2.33331ZM11 3.33331C11.5523 3.33331 12 2.8856 12 2.33331C12 1.78103 11.5523 1.33331 11 1.33331C10.4477 1.33331 10 1.78103 10 2.33331C10 2.8856 10.4477 3.33331 11 3.33331ZM11 7.11109C11.5523 7.11109 12 6.66338 12 6.11109C12 5.55881 11.5523 5.11109 11 5.11109C10.4477 5.11109 10 5.55881 10 6.11109C10 6.66338 10.4477 7.11109 11 7.11109ZM12 9.88887C12 10.4412 11.5523 10.8889 11 10.8889C10.4477 10.8889 10 10.4412 10 9.88887C10 9.33659 10.4477 8.88887 11 8.88887C11.5523 8.88887 12 9.33659 12 9.88887ZM11 14.6666C11.5523 14.6666 12 14.2189 12 13.6666C12 13.1144 11.5523 12.6666 11 12.6666C10.4477 12.6666 10 13.1144 10 13.6666C10 14.2189 10.4477 14.6666 11 14.6666ZM5 7.11109C5.55228 7.11109 6 6.66338 6 6.11109C6 5.55881 5.55228 5.11109 5 5.11109C4.44772 5.11109 4 5.55881 4 6.11109C4 6.66338 4.44772 7.11109 5 7.11109ZM6 9.88888C6 10.4412 5.55228 10.8889 5 10.8889C4.44772 10.8889 4 10.4412 4 9.88888C4 9.33659 4.44772 8.88888 5 8.88888C5.55228 8.88888 6 9.33659 6 9.88888ZM5 14.6666C5.55228 14.6666 6 14.2189 6 13.6666C6 13.1144 5.55228 12.6666 5 12.6666C4.44772 12.6666 4 13.1144 4 13.6666C4 14.2189 4.44772 14.6666 5 14.6666Z\"\n fill=\"#3F59E4\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledDragHandleButton>\n );\n};\n\nexport const SortableItem = ({\n id,\n isDisabled,\n isSelected,\n isSortable = true,\n label,\n children,\n}: PropsWithChildren<ItemProps>) => {\n const {\n attributes,\n isDragging,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n } = useSortable({ id });\n\n const context: SortableItemContextType = useMemo(\n () => ({\n attributes,\n listeners,\n // This library gives us a legacy ref function, and I can't change it, so I had to override the type. --Kevin Ghadyani\n ref: setActivatorNodeRef as unknown as RefObject<HTMLButtonElement>,\n }),\n [attributes, listeners, setActivatorNodeRef],\n );\n\n const style: CSSProperties = {\n opacity: isDragging ? 0.4 : undefined,\n transform: CSS.Translate.toString(transform),\n transition,\n };\n\n const uiShellContext = useUiShellContext();\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n\n return (\n <SortableItemContext.Provider value={context}>\n <StyledSortableListItem\n isSelected={isSelected}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={setNodeRef}\n sideNavContrastColors={uiShellContext?.sideNavContrastColors}\n style={style}\n >\n {!isDisabled && isSortable && (\n <DragHandle isSelected={isSelected} label={label} />\n )}\n {children}\n </StyledSortableListItem>\n </SortableItemContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAAA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AA7D,WAAA,CAAAuF,IAAA,EAAC5E,sBAAsB;MACrBK,UAAU,EAAEA,UAAW;MACvBD,mBAAmB,EAAEA,mBAAoB;MACzCN,GAAG,EAAEkE,UAAW;MAChB1D,qBAAqB,EAAEwC,cAAc,EAAExC,qBAAsB;MAC7DgE,KAAK,EAAEA,KAAM;MAAApB,QAAA,GAEZ,CAACW,UAAU,IAAIC,UAAU,IACxB,IAAAzE,WAAA,CAAA4D,GAAA,EAACT,UAAU;QAACnC,UAAU,EAAEA,UAAW;QAACoC,KAAK,EAAEA;MAAM,CAAE,CACpD,EACAS,QAAQ;IAAA,CACa;EAAC,CACG,CAAC;AAEnC,CAAC;AAACQ,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"file":"SortableItem.cjs","names":["_sortable","require","_utilities","_styled","_interopRequireDefault","_react","_i18n","_OdysseyDesignTokensContext","_UiShellProvider","_SortableOverlay","_jsxRuntime","e","__esModule","default","SortableItemContext","createContext","attributes","listeners","undefined","ref","createRef","StyledSortableListItem","styled","shouldForwardProp","prop","odysseyDesignTokens","isSelected","sideNavContrastColors","position","button","top","left","Spacing2","transform","svg","path","fill","fontColor","opacity","outlineWidth","TypographyColorAction","getFocusRingStyles","focusRingColor","outline","boxShadow","HueNeutralWhite","PalettePrimaryMain","StyledDragHandleButton","isGrabbed","padding","border","borderRadius","BorderRadiusMain","backgroundColor","cursor","display","HueBlue100","HueNeutral200","borderColor","HueBlue600","color","DragHandle","label","useContext","useOdysseyDesignTokens","t","useTranslation","uiShellContext","useUiShellContext","useDragOverlayContext","jsx","children","height","viewBox","width","xmlns","clipRule","d","fillRule","exports","SortableItem","id","isDisabled","isSortable","isDragging","setNodeRef","setActivatorNodeRef","transition","useSortable","context","useMemo","style","CSS","Translate","toString","Provider","value","jsxs"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type {\n DraggableSyntheticListeners,\n UniqueIdentifier,\n} from \"@dnd-kit/core\";\n\nimport { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport styled from \"@emotion/styled\";\nimport {\n createContext,\n createRef,\n CSSProperties,\n PropsWithChildren,\n RefObject,\n useContext,\n useMemo,\n} from \"react\";\n\nimport { ContrastColors } from \"../../../createContrastColors.js\";\nimport { useTranslation } from \"../../../i18n.generated/i18n.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../../OdysseyDesignTokensContext.js\";\nimport {\n UiShellColors,\n useUiShellContext,\n} from \"../../../ui-shell/UiShellProvider.js\";\nimport { useDragOverlayContext } from \"./SortableOverlay.js\";\n\ntype ItemProps = {\n id: UniqueIdentifier;\n isDisabled?: boolean;\n isSelected?: boolean;\n isSortable?: boolean;\n label: string;\n};\n\nexport type SortableItemContextType = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n attributes: Record<string, any>;\n listeners: DraggableSyntheticListeners;\n ref: RefObject<HTMLButtonElement>;\n};\n\nconst SortableItemContext = createContext<SortableItemContextType>({\n attributes: {},\n listeners: undefined,\n ref: createRef<HTMLButtonElement>(),\n});\n\nconst StyledSortableListItem = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isSelected\" &&\n prop !== \"sideNavContrastColors\",\n})<{\n isSelected?: boolean;\n odysseyDesignTokens: DesignTokens;\n sideNavContrastColors: UiShellColors[\"sideNavContrastColors\"];\n}>(({ odysseyDesignTokens, isSelected, sideNavContrastColors }) => ({\n position: \"relative\",\n\n button: {\n top: \"50%\",\n left: odysseyDesignTokens.Spacing2,\n transform: \"translateY(-50%)\",\n },\n\n svg: {\n path: {\n fill: \"currentColor\",\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n\n \"&:has(a:hover, button:hover, a:focus, button:focus, a:focus-visible, button:focus-visible, [role='button']:hover, [role='button']:focus, [role='button']:focus-visible)\":\n {\n button: {\n opacity: 1,\n outlineWidth: 0,\n },\n },\n\n ...(isSelected && {\n svg: {\n path: {\n fill: odysseyDesignTokens.TypographyColorAction,\n\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n }),\n}));\n\nconst getFocusRingStyles = ({\n focusRingColor,\n odysseyDesignTokens,\n}: {\n focusRingColor: ContrastColors[\"focusRingColor\"];\n odysseyDesignTokens: DesignTokens;\n}) => ({\n outline: \"2px solid transparent\",\n boxShadow: `0 0 0 2px ${odysseyDesignTokens.HueNeutralWhite}, 0 0 0 4px ${focusRingColor || odysseyDesignTokens.PalettePrimaryMain}`,\n});\n\nconst StyledDragHandleButton = styled(\"button\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isGrabbed\" &&\n prop !== \"isSelected\" &&\n prop !== \"focusRingColor\",\n})<{\n focusRingColor: ContrastColors[\"focusRingColor\"];\n isGrabbed?: boolean;\n isSelected?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens, isGrabbed, isSelected, focusRingColor }) => ({\n position: \"absolute\",\n opacity: 0,\n padding: odysseyDesignTokens.Spacing2,\n // Transparent 1px border by default so toggling to the HueBlue600 grabbed border does not shift the icon.\n border: \"1px solid transparent\",\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n backgroundColor: \"transparent\",\n cursor: `${isGrabbed ? \"grabbing\" : \"grab\"}`,\n outline: \"none\",\n\n svg: {\n display: \"flex\",\n },\n\n // hover state, only applied when not actively grabbing/dragging the handle\n ...(!isGrabbed && {\n \"&:hover\": {\n backgroundColor: isSelected\n ? odysseyDesignTokens.HueBlue100\n : odysseyDesignTokens.HueNeutral200,\n },\n }),\n\n // Focus ring for a resting handle (keyboard focus). Excludes the actively grabbed handle via aria-pressed so the isGrabbed block styles that state.\n \"&:focus-visible:not([aria-pressed='true'])\": getFocusRingStyles({\n focusRingColor,\n odysseyDesignTokens,\n }),\n\n // grabbed (overlay)\n ...(isGrabbed && {\n opacity: 1,\n borderColor: odysseyDesignTokens.HueBlue600,\n // icon fills with currentColor, so `color` recolors it to match the border\n color: odysseyDesignTokens.HueBlue600,\n ...getFocusRingStyles({ focusRingColor, odysseyDesignTokens }),\n }),\n}));\n\ntype DragHandleProps = {\n isDisabled?: boolean;\n isSelected?: boolean;\n label: string;\n};\n\nexport const DragHandle = ({ isSelected, label }: DragHandleProps) => {\n const { attributes, listeners, ref } = useContext(SortableItemContext);\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const uiShellContext = useUiShellContext();\n // True only for the overlay copy that follows the pointer.\n const { isGrabbed } = useDragOverlayContext();\n\n return (\n <StyledDragHandleButton\n {...attributes}\n {...listeners}\n aria-label={\n label\n ? t(\"navigation.drag.handle.label\", { label })\n : t(\"navigation.drag.handle\")\n }\n focusRingColor={uiShellContext?.sideNavContrastColors?.focusRingColor}\n isGrabbed={isGrabbed}\n isSelected={isSelected}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={ref}\n >\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M6 2.33331C6 2.8856 5.55228 3.33331 5 3.33331C4.44772 3.33331 4 2.8856 4 2.33331C4 1.78103 4.44772 1.33331 5 1.33331C5.55228 1.33331 6 1.78103 6 2.33331ZM11 3.33331C11.5523 3.33331 12 2.8856 12 2.33331C12 1.78103 11.5523 1.33331 11 1.33331C10.4477 1.33331 10 1.78103 10 2.33331C10 2.8856 10.4477 3.33331 11 3.33331ZM11 7.11109C11.5523 7.11109 12 6.66338 12 6.11109C12 5.55881 11.5523 5.11109 11 5.11109C10.4477 5.11109 10 5.55881 10 6.11109C10 6.66338 10.4477 7.11109 11 7.11109ZM12 9.88887C12 10.4412 11.5523 10.8889 11 10.8889C10.4477 10.8889 10 10.4412 10 9.88887C10 9.33659 10.4477 8.88887 11 8.88887C11.5523 8.88887 12 9.33659 12 9.88887ZM11 14.6666C11.5523 14.6666 12 14.2189 12 13.6666C12 13.1144 11.5523 12.6666 11 12.6666C10.4477 12.6666 10 13.1144 10 13.6666C10 14.2189 10.4477 14.6666 11 14.6666ZM5 7.11109C5.55228 7.11109 6 6.66338 6 6.11109C6 5.55881 5.55228 5.11109 5 5.11109C4.44772 5.11109 4 5.55881 4 6.11109C4 6.66338 4.44772 7.11109 5 7.11109ZM6 9.88888C6 10.4412 5.55228 10.8889 5 10.8889C4.44772 10.8889 4 10.4412 4 9.88888C4 9.33659 4.44772 8.88888 5 8.88888C5.55228 8.88888 6 9.33659 6 9.88888ZM5 14.6666C5.55228 14.6666 6 14.2189 6 13.6666C6 13.1144 5.55228 12.6666 5 12.6666C4.44772 12.6666 4 13.1144 4 13.6666C4 14.2189 4.44772 14.6666 5 14.6666Z\"\n fill=\"#3F59E4\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledDragHandleButton>\n );\n};\n\nexport const SortableItem = ({\n id,\n isDisabled,\n isSelected,\n isSortable = true,\n label,\n children,\n}: PropsWithChildren<ItemProps>) => {\n const {\n attributes,\n isDragging,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n } = useSortable({ id });\n\n const context: SortableItemContextType = useMemo(\n () => ({\n attributes,\n listeners,\n // This library gives us a legacy ref function, and I can't change it, so I had to override the type. --Kevin Ghadyani\n ref: setActivatorNodeRef as unknown as RefObject<HTMLButtonElement>,\n }),\n [attributes, listeners, setActivatorNodeRef],\n );\n\n const style: CSSProperties = {\n opacity: isDragging ? 0.4 : undefined,\n transform: CSS.Translate.toString(transform),\n transition,\n };\n\n const uiShellContext = useUiShellContext();\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n\n return (\n <SortableItemContext.Provider value={context}>\n <StyledSortableListItem\n isSelected={isSelected}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={setNodeRef}\n sideNavContrastColors={uiShellContext?.sideNavContrastColors}\n style={style}\n >\n {!isDisabled && isSortable && (\n <DragHandle isSelected={isSelected} label={label} />\n )}\n {children}\n </StyledSortableListItem>\n </SortableItemContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAWA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,2BAAA,GAAAN,OAAA;AAIA,IAAAO,gBAAA,GAAAP,OAAA;AAIA,IAAAQ,gBAAA,GAAAR,OAAA;AAA6D,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAG,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAxC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+CA,MAAMG,mBAAmB,GAAG,IAAAC,oBAAa,EAA0B;EACjEC,UAAU,EAAE,CAAC,CAAC;EACdC,SAAS,EAAEC,SAAS;EACpBC,GAAG,EAAE,IAAAC,gBAAS,EAAoB;AACpC,CAAC,CAAC;AAEF,MAAMC,sBAAsB,GAAG,IAAAC,eAAM,EAAC,IAAI,EAAE;EAC1CC,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAC9BA,IAAI,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C,EACF,CAACtE,UAAU,EAAEC,SAAS,EAAEqE,mBAAmB,CAC7C,CAAC;EAED,MAAMK,KAAoB,GAAG;IAC3BrD,OAAO,EAAE8C,UAAU,GAAG,GAAG,GAAGlE,SAAS;IACrCe,SAAS,EAAE2D,cAAG,CAACC,SAAS,CAACC,QAAQ,CAAC7D,SAAS,CAAC;IAC5CsD;EACF,CAAC;EAED,MAAMpB,cAAc,GAAG,IAAAC,kCAAiB,EAAC,CAAC;EAC1C,MAAM3C,mBAAiC,GAAG,IAAAuC,kDAAsB,EAAC,CAAC;EAElE,OACE,IAAAtD,WAAA,CAAA4D,GAAA,EAACxD,mBAAmB,CAACiF,QAAQ;IAACC,KAAK,EAAEP,OAAQ;IAAAlB,QAAA,EAC3C,IAAA7D,WAAA,CAAAuF,IAAA,EAAC5E,sBAAsB;MACrBK,UAAU,EAAEA,UAAW;MACvBD,mBAAmB,EAAEA,mBAAoB;MACzCN,GAAG,EAAEkE,UAAW;MAChB1D,qBAAqB,EAAEwC,cAAc,EAAExC,qBAAsB;MAC7DgE,KAAK,EAAEA,KAAM;MAAApB,QAAA,GAEZ,CAACW,UAAU,IAAIC,UAAU,IACxB,IAAAzE,WAAA,CAAA4D,GAAA,EAACT,UAAU;QAACnC,UAAU,EAAEA,UAAW;QAACoC,KAAK,EAAEA;MAAM,CAAE,CACpD,EACAS,QAAQ;IAAA,CACa;EAAC,CACG,CAAC;AAEnC,CAAC;AAACQ,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SortableList.cjs","names":["_core","require","_sortable","_react","_i18n","_SortableItem","_SortableOverlay","_jsxRuntime","SortableList","parentId","items","onChange","renderItem","active","setActive","useState","activeItem","useMemo","find","item","id","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","coordinateGetter","sortableKeyboardCoordinates","t","useTranslation","announcements","onDragStart","activeId","onDragOver","over","overId","onDragEnd","onDragCancel","jsxs","DndContext","accessibility","container","document","body","undefined","activeIndex","findIndex","overIndex","isSortable","children","jsx","SortableContext","map","Fragment","SortableOverlay","exports","Item","SortableItem"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactNode } from \"react\";\n\nimport {\n Active,\n Announcements,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n UniqueIdentifier,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport { Fragment, useMemo, useState } from \"react\";\n\nimport { useTranslation } from \"../../../i18n.generated/i18n.js\";\nimport { SortableItem } from \"./SortableItem.js\";\nimport { SortableOverlay } from \"./SortableOverlay.js\";\n\nexport interface BaseItem {\n id: UniqueIdentifier;\n isDisabled: boolean | undefined;\n isSelected: boolean | undefined;\n isSortable: boolean | undefined;\n /**\n * The item's visible label, used to give its drag handle a unique\n * accessible name (e.g. \"Drag handle for Work\") so screen-reader users can\n * distinguish handles that otherwise share the same name.\n */\n label: string;\n navItem: ReactNode;\n}\n\ninterface ListProps<T extends BaseItem> {\n items: T[];\n onChange: (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n parentId: string;\n renderItem: (item: T) => ReactNode;\n}\n\nexport const SortableList = <T extends BaseItem>({\n parentId,\n items,\n onChange,\n renderItem,\n}: ListProps<T>) => {\n const [active, setActive] = useState<Active | null>(null);\n\n const activeItem = useMemo(\n () => items.find((item) => item.id === active?.id),\n [active, items],\n );\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const { t } = useTranslation();\n const announcements: Announcements = useMemo(\n () => ({\n onDragStart: ({ active }) => {\n return `${t(\"sortable.list.drag.start\", { activeId: active.id })}`;\n },\n onDragOver: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.moved.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.nolonger.over\", { activeId: active.id })}`;\n },\n onDragEnd: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.end.dropped.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.end.dropped\", { activeId: active.id })}`;\n },\n onDragCancel: ({ active }) => {\n return `${t(\"sortable.list.drag.cancel\", { activeId: active.id })}`;\n },\n }),\n [t],\n );\n\n return (\n <DndContext\n accessibility={{\n announcements,\n // Portal the drag live region to the document body: SortableList renders\n // inside a semantic <ul>, and an inline role=\"status\" element would be an\n // invalid non-<li> child, breaking the list's accessibility semantics.\n container: typeof document !== \"undefined\" ? document.body : undefined,\n }}\n onDragCancel={() => {\n setActive(null);\n }}\n onDragEnd={({ active, over }) => {\n if (over && active.id !== over?.id) {\n const activeIndex = items.findIndex(({ id }) => id === active.id);\n const overIndex = items.findIndex(({ id }) => id === over.id);\n // allow sorting by default except when isSortable is set to false explicitly\n if (items[overIndex].isSortable !== false) {\n onChange(parentId, active.id, activeIndex, overIndex);\n }\n }\n setActive(null);\n }}\n onDragStart={({ active }) => {\n setActive(active);\n }}\n sensors={sensors}\n >\n <SortableContext items={items}>\n {items.map((item) => (\n <Fragment key={item.id}>{renderItem(item)}</Fragment>\n ))}\n </SortableContext>\n <SortableOverlay>\n {activeItem ? renderItem(activeItem) : null}\n </SortableOverlay>\n </DndContext>\n );\n};\n\nSortableList.Item = SortableItem;\n"],"mappings":";;;;;;AAcA,IAAA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ACoC,SAAS,CAAC,CAAC;UAAE1B;QAAG,CAAC,KAAKA,EAAE,KAAKP,MAAM,CAACO,EAAE,CAAC;QACjE,MAAM2B,SAAS,GAAGrC,KAAK,CAACoC,SAAS,CAAC,CAAC;UAAE1B;QAAG,CAAC,KAAKA,EAAE,KAAKc,IAAI,CAACd,EAAE,CAAC;QAE7D,IAAIV,KAAK,CAACqC,SAAS,CAAC,CAACC,UAAU,KAAK,KAAK,EAAE;UACzCrC,QAAQ,CAACF,QAAQ,EAAEI,MAAM,CAACO,EAAE,EAAEyB,WAAW,EAAEE,SAAS,CAAC;QACvD;MACF;MACAjC,SAAS,CAAC,IAAI,CAAC;IACjB,CAAE;IACFiB,WAAW,EAAEA,CAAC;MAAElB;IAAO,CAAC,KAAK;MAC3BC,SAAS,CAACD,MAAM,CAAC;IACnB,CAAE;IACFQ,OAAO,EAAEA,OAAQ;IAAA4B,QAAA,GAEjB,IAAA1C,WAAA,CAAA2C,GAAA,EAAChD,SAAA,CAAAiD,eAAe;MAACzC,KAAK,EAAEA,KAAM;MAAAuC,QAAA,EAC3BvC,KAAK,CAAC0C,GAAG,CAAEjC,IAAI,IACd,IAAAZ,WAAA,CAAA2C,GAAA,EAAC/C,MAAA,CAAAkD,QAAQ;QAAAJ,QAAA,EAAgBrC,UAAU,CAACO,IAAI;MAAC,GAA1BA,IAAI,CAACC,EAAgC,CACrD;IAAC,CACa,CAAC,EAClB,IAAAb,WAAA,CAAA2C,GAAA,EAAC5C,gBAAA,CAAAgD,eAAe;MAAAL,QAAA,EACbjC,UAAU,GAAGJ,UAAU,CAACI,UAAU,CAAC,GAAG;IAAI,CAC5B,CAAC;EAAA,CACR,CAAC;AAEjB,CAAC;AAACuC,OAAA,CAAA/C,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAACgD,IAAI,GAAGC,0BAAY","ignoreList":[]}
1
+ {"version":3,"file":"SortableList.cjs","names":["_core","require","_sortable","_react","_i18n","_SortableItem","_SortableOverlay","_jsxRuntime","SortableList","parentId","items","onChange","renderItem","active","setActive","useState","activeItem","useMemo","find","item","id","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","coordinateGetter","sortableKeyboardCoordinates","t","useTranslation","announcements","onDragStart","activeId","onDragOver","over","overId","onDragEnd","onDragCancel","jsxs","DndContext","accessibility","container","document","body","undefined","activeIndex","findIndex","overIndex","isSortable","children","jsx","SortableContext","map","Fragment","SortableOverlay","exports","Item","SortableItem"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactNode } from \"react\";\n\nimport {\n Active,\n Announcements,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n UniqueIdentifier,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport { Fragment, useMemo, useState } from \"react\";\n\nimport { useTranslation } from \"../../../i18n.generated/i18n.js\";\nimport { SortableItem } from \"./SortableItem.js\";\nimport { SortableOverlay } from \"./SortableOverlay.js\";\n\nexport interface BaseItem {\n id: UniqueIdentifier;\n isDisabled: boolean | undefined;\n isSelected: boolean | undefined;\n isSortable: boolean | undefined;\n /**\n * The item's visible label, used to give its drag handle a unique accessible name (e.g. \"Drag handle for Work\") so screen-reader users can distinguish handles that otherwise share the same name.\n */\n label: string;\n navItem: ReactNode;\n}\n\ninterface ListProps<T extends BaseItem> {\n items: T[];\n onChange: (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n parentId: string;\n renderItem: (item: T) => ReactNode;\n}\n\nexport const SortableList = <T extends BaseItem>({\n parentId,\n items,\n onChange,\n renderItem,\n}: ListProps<T>) => {\n const [active, setActive] = useState<Active | null>(null);\n\n const activeItem = useMemo(\n () => items.find((item) => item.id === active?.id),\n [active, items],\n );\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const { t } = useTranslation();\n const announcements: Announcements = useMemo(\n () => ({\n onDragStart: ({ active }) => {\n return `${t(\"sortable.list.drag.start\", { activeId: active.id })}`;\n },\n onDragOver: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.moved.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.nolonger.over\", { activeId: active.id })}`;\n },\n onDragEnd: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.end.dropped.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.end.dropped\", { activeId: active.id })}`;\n },\n onDragCancel: ({ active }) => {\n return `${t(\"sortable.list.drag.cancel\", { activeId: active.id })}`;\n },\n }),\n [t],\n );\n\n return (\n <DndContext\n accessibility={{\n announcements,\n // Portal the drag live region to the document body: SortableList renders inside a semantic <ul>, and an inline role=\"status\" element would be an invalid non-<li> child, breaking the list's accessibility semantics.\n container: typeof document !== \"undefined\" ? document.body : undefined,\n }}\n onDragCancel={() => {\n setActive(null);\n }}\n onDragEnd={({ active, over }) => {\n if (over && active.id !== over?.id) {\n const activeIndex = items.findIndex(({ id }) => id === active.id);\n const overIndex = items.findIndex(({ id }) => id === over.id);\n // allow sorting by default except when isSortable is set to false explicitly\n if (items[overIndex].isSortable !== false) {\n onChange(parentId, active.id, activeIndex, overIndex);\n }\n }\n setActive(null);\n }}\n onDragStart={({ active }) => {\n setActive(active);\n }}\n sensors={sensors}\n >\n <SortableContext items={items}>\n {items.map((item) => (\n <Fragment key={item.id}>{renderItem(item)}</Fragment>\n ))}\n </SortableContext>\n <SortableOverlay>\n {activeItem ? renderItem(activeItem) : null}\n </SortableOverlay>\n </DndContext>\n );\n};\n\nSortableList.Item = SortableItem;\n"],"mappings":";;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAUA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAuD,IAAAM,WAAA,GAAAN,OAAA;AAhCvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgDO,MAAMO,YAAY,GAAGA,CAAqB;EAC/CC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC;AACY,CAAC,KAAK;EAClB,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAgB,IAAI,CAAC;EAEzD,MAAMC,UAAU,GAAG,IAAAC,cAAO,EACxB,MAAMP,KAAK,CAACQ,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,EAAE,KAAKP,MAAM,EAAEO,EAAE,CAAC,EAClD,CAACP,MAAM,EAAEH,KAAK,CAChB,CAAC;EACD,MAAMW,OAAO,GAAG,IAAAC,gBAAU,EACxB,IAAAC,eAAS,EAACC,mBAAa,CAAC,EACxB,IAAAD,eAAS,EAACE,oBAAc,EAAE;IACxBC,gBAAgB,EAAEC;EACpB,CAAC,CACH,CAAC;EAED,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,oBAAc,EAAC,CAAC;EAC9B,MAAMC,aAA4B,GAAG,IAAAb,cAAO,EAC1C,OAAO;IACLc,WAAW,EAAEA,CAAC;MAAElB;IAAO,CAAC,KAAK;MAC3B,OAAO,GAAGe,CAAC,CAAC,0BAA0B,EAAE;QAAEI,QAAQ,EAAEnB,MAAM,CAACO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AAACuC,OAAA,CAAA/C,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAACgD,IAAI,GAAGC,0BAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"SortableOverlay.cjs","names":["_core","require","_react","_jsxRuntime","dropAnimationConfig","sideEffects","defaultDropAnimationSideEffects","styles","active","opacity","DragOverlayContext","createContext","isGrabbed","useDragOverlayContext","useContext","exports","dragOverlayContextValue","SortableOverlay","children","jsx","DragOverlay","dropAnimation","Provider","value"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableOverlay.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { PropsWithChildren } from \"react\";\n\nimport {\n defaultDropAnimationSideEffects,\n DragOverlay,\n DropAnimation,\n} from \"@dnd-kit/core\";\nimport { createContext, useContext } from \"react\";\n\nconst dropAnimationConfig: DropAnimation = {\n sideEffects: defaultDropAnimationSideEffects({\n styles: {\n active: {\n opacity: \"0.4\",\n },\n },\n }),\n};\n\ntype DragOverlayContextValue = {\n isGrabbed: boolean;\n};\n\n// @dnd-kit renders two copies of the dragged row: the source item that stays in\n// the list (flagged by `useSortable().isDragging`) and this floating overlay\n// copy that follows the pointer. The overlay renders outside SortableContext,\n// so it has no `isDragging` flag of its own. This context lets nested components\n// tell they are inside the overlay (the \"grabbed\" copy) vs. the source ghost.\nconst DragOverlayContext = createContext<DragOverlayContextValue>({\n isGrabbed: false,\n});\n\nexport const useDragOverlayContext = () => useContext(DragOverlayContext);\n\n// Stable reference so the provider doesn't re-render every consumer each render.\nconst dragOverlayContextValue: DragOverlayContextValue = { isGrabbed: true };\n\nexport function SortableOverlay({ children }: PropsWithChildren<object>) {\n return (\n <DragOverlay dropAnimation={dropAnimationConfig}>\n <DragOverlayContext.Provider value={dragOverlayContextValue}>\n {children}\n </DragOverlayContext.Provider>\n </DragOverlay>\n );\n}\n"],"mappings":";;;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAnBlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMG,mBAAkC,GAAG;EACzCC,WAAW,EAAE,IAAAC,qCAA+B,EAAC;IAC3CC,MAAM,EAAE;MACNC,MAAM,EAAE;QACNC,OAAO,EAAE;MACX;IACF;EACF,CAAC;AACH,CAAC;AAWD,MAAMC,kBAAkB,GAAG,IAAAC,oBAAa,EAA0B;EAChEC,SAAS,EAAE;AACb,CAAC,CAAC;AAEK,MAAMC,qBAAqB,GAAGA,CAAA,KAAM,IAAAC,iBAAU,EAACJ,kBAAkB,CAAC;AAACK,OAAA,CAAAF,qBAAA,GAAAA,qBAAA;AAG1E,MAAMG,uBAAgD,GAAG;EAAEJ,SAAS,EAAE;AAAK,CAAC;AAErE,SAASK,eAAeA,CAAC;EAAEC;AAAoC,CAAC,EAAE;EACvE,OACE,IAAAf,WAAA,CAAAgB,GAAA,EAACnB,KAAA,CAAAoB,WAAW;IAACC,aAAa,EAAEjB,mBAAoB;IAAAc,QAAA,EAC9C,IAAAf,WAAA,CAAAgB,GAAA,EAACT,kBAAkB,CAACY,QAAQ;MAACC,KAAK,EAAEP,uBAAwB;MAAAE,QAAA,EACzDA;IAAQ,CACkB;EAAC,CACnB,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"file":"SortableOverlay.cjs","names":["_core","require","_react","_jsxRuntime","dropAnimationConfig","sideEffects","defaultDropAnimationSideEffects","styles","active","opacity","DragOverlayContext","createContext","isGrabbed","useDragOverlayContext","useContext","exports","dragOverlayContextValue","SortableOverlay","children","jsx","DragOverlay","dropAnimation","Provider","value"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableOverlay.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { PropsWithChildren } from \"react\";\n\nimport {\n defaultDropAnimationSideEffects,\n DragOverlay,\n DropAnimation,\n} from \"@dnd-kit/core\";\nimport { createContext, useContext } from \"react\";\n\nconst dropAnimationConfig: DropAnimation = {\n sideEffects: defaultDropAnimationSideEffects({\n styles: {\n active: {\n opacity: \"0.4\",\n },\n },\n }),\n};\n\ntype DragOverlayContextValue = {\n isGrabbed: boolean;\n};\n\n// @dnd-kit renders two copies of the dragged row: the source item that stays in the list (flagged by `useSortable().isDragging`) and this floating overlay copy that follows the pointer. The overlay renders outside SortableContext, so it has no `isDragging` flag of its own. This context lets nested components tell they are inside the overlay (the \"grabbed\" copy) vs. the source ghost.\nconst DragOverlayContext = createContext<DragOverlayContextValue>({\n isGrabbed: false,\n});\n\nexport const useDragOverlayContext = () => useContext(DragOverlayContext);\n\n// Stable reference so the provider doesn't re-render every consumer each render.\nconst dragOverlayContextValue: DragOverlayContextValue = { isGrabbed: true };\n\nexport function SortableOverlay({ children }: PropsWithChildren<object>) {\n return (\n <DragOverlay dropAnimation={dropAnimationConfig}>\n <DragOverlayContext.Provider value={dragOverlayContextValue}>\n {children}\n </DragOverlayContext.Provider>\n </DragOverlay>\n );\n}\n"],"mappings":";;;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAnBlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,MAAMG,mBAAkC,GAAG;EACzCC,WAAW,EAAE,IAAAC,qCAA+B,EAAC;IAC3CC,MAAM,EAAE;MACNC,MAAM,EAAE;QACNC,OAAO,EAAE;MACX;IACF;EACF,CAAC;AACH,CAAC;AAOD,MAAMC,kBAAkB,GAAG,IAAAC,oBAAa,EAA0B;EAChEC,SAAS,EAAE;AACb,CAAC,CAAC;AAEK,MAAMC,qBAAqB,GAAGA,CAAA,KAAM,IAAAC,iBAAU,EAACJ,kBAAkB,CAAC;AAACK,OAAA,CAAAF,qBAAA,GAAAA,qBAAA;AAG1E,MAAMG,uBAAgD,GAAG;EAAEJ,SAAS,EAAE;AAAK,CAAC;AAErE,SAASK,eAAeA,CAAC;EAAEC;AAAoC,CAAC,EAAE;EACvE,OACE,IAAAf,WAAA,CAAAgB,GAAA,EAACnB,KAAA,CAAAoB,WAAW;IAACC,aAAa,EAAEjB,mBAAoB;IAAAc,QAAA,EAC9C,IAAAf,WAAA,CAAAgB,GAAA,EAACT,kBAAkB,CAACY,QAAQ;MAACC,KAAK,EAAEP,uBAAwB;MAAAE,QAAA,EACzDA;IAAQ,CACkB;EAAC,CACnB,CAAC;AAElB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../../../src/ui-shell/SideNav/types.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactElement, SyntheticEvent } from \"react\";\n\nimport { UniqueIdentifier } from \"@dnd-kit/core\";\n\nimport type { HtmlProps } from \"../../HtmlProps.js\";\nimport type { DesignTokens } from \"../../OdysseyDesignTokensContext.js\";\nimport type { statusSeverityValues } from \"../../Status.js\";\nimport type { UiShellLogoProps } from \"../UiShellLogo.js\";\n\n/**\n * Type representing spacing values from the design tokens.\n * odysseyDesignTokens.Spacing0, odysseyDesignTokens.Spacing1, etc.\n */\nexport type OdysseySpacingValue = DesignTokens[keyof Pick<\n DesignTokens,\n | \"Spacing0\"\n | \"Spacing1\"\n | \"Spacing2\"\n | \"Spacing3\"\n | \"Spacing4\"\n | \"Spacing5\"\n | \"Spacing6\"\n | \"Spacing7\"\n | \"Spacing8\"\n | \"Spacing9\"\n>];\n\nexport type SideNavProps = {\n /**\n * Side Nav header text that is usually reserved to show the App name\n */\n appName?: string;\n /**\n * If we want the collapse state to be based on session storage, then this needs to be `true`.\n */\n hasSessionStorageState?: boolean;\n /**\n * Determines whether the side nav is collapsed by default. When `true`, side nav also closes once and item is clicked.\n */\n isCollapsed?: boolean;\n /**\n * Determines whether the side nav is collapsible\n */\n isCollapsible?: boolean;\n /**\n * Determines whether the side nav items use compact layout\n */\n isCompact?: boolean;\n /**\n * Before the side nav has items, it will be in a loading state.\n */\n isLoading?: boolean;\n /**\n * If the side nav is up too much screen real estate. For instance, if you're in a narrower view, and it displays next to the content.\n *\n * When `true`, side nav will close itself after nav items are clicked.\n */\n isObtrusive?: boolean;\n /**\n * Optional padding to apply to the start of the leaves (items which are not expanded).\n * Should be one of the Odyssey design token spacing values (e.g., odysseyDesignTokens.Spacing1, odysseyDesignTokens.Spacing2, etc.)\n */\n leavesPaddingStart?: OdysseySpacingValue;\n /**\n * @deprecated use `logoProps` next to `sideNavProps` instead. This was moved to the top level.\n *\n * An optional logo component or src string for an img to display in the header. If not provided, will default to the Okta logo\n */\n logoProps?: UiShellLogoProps;\n /**\n * Triggers when the side nav is collapsed\n */\n onCollapse?: () => void;\n /**\n * Triggers when the side nav is expanded\n */\n onExpand?: () => void;\n /**\n * Triggers when the item is reordered\n */\n onSort?: (\n reorderedItems: SideNavItem[],\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n /**\n * Nav items in the side nav\n */\n sideNavItems?: SideNavItem[];\n} & (\n | {\n /**\n * The component to display as the footer; if present the `footerItems` are ignored and not rendered.\n */\n footerComponent?: ReactElement;\n footerItems?: never;\n hasCustomFooter: true;\n }\n | {\n footerComponent?: never;\n /**\n * Footer items in the side nav\n */\n footerItems?: SideNavFooterItem[];\n hasCustomFooter?: false;\n }\n) &\n Pick<HtmlProps, \"testId\">;\n\nexport type SideNavItem = {\n /**\n * The number to display as a count alongside the nav item\n */\n count?: number;\n /**\n * The icon element to display after the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n endIcon?: ReactElement;\n id: string;\n /**\n * Whether the item is disabled. When set to true the nav item is set to Disabled color,\n * the link/item is not clickable, and item with nestedNavItems is not expandable.\n */\n isDisabled?: boolean;\n /**\n * Whether the item is active/selected\n */\n isSelected?: boolean;\n /**\n * Whether the item is sortable within a sortable list\n */\n isSortable?: boolean;\n label: string;\n /**\n * Event fired when the nav item is changed (for instance, capturing clicks on Accordion)\n */\n onChange?: (event: SyntheticEvent) => void;\n /**\n * Event fired when the nav item is clicked\n */\n onClick?: (event: SyntheticEvent) => void;\n /**\n * The status element to display after the label\n */\n severity?: (typeof statusSeverityValues)[number];\n /**\n * The icon element to display before the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n startIcon?: ReactElement;\n /**\n * The label to display inside the status\n */\n statusLabel?: string;\n /**\n * The link target prop. e.g., \"_blank\"\n */\n target?: string;\n} & (\n | {\n ariaControls?: never;\n href?: never;\n isDefaultExpanded?: never;\n isExpanded?: never;\n /**\n * Determines if the side nav item is a section header\n */\n isSectionHeader: true;\n nestedNavItems?: never;\n }\n | {\n /**\n * The `id` of the element this button controls. Use alongside\n * `isExpanded` to wire up `aria-controls` for assistive technology.\n */\n ariaControls?: string;\n href?: never;\n isDefaultExpanded?: never;\n /**\n * If `true`, communicates to assistive technology that this button\n * controls an expanded panel. Use when this item opens a panel or\n * drawer rather than navigating.\n */\n isExpanded?: boolean;\n isSectionHeader?: never;\n nestedNavItems?: never;\n }\n | {\n ariaControls?: never;\n /**\n * link added to the nav item. if it is undefined, static text will be\n * displayed. fires onClick event when it is passed\n */\n href: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n nestedNavItems?: never;\n }\n | {\n ariaControls?: never;\n href?: never;\n /**\n * Whether the accordion (nav item with nestedNavItems) is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * If true, expands the accordion, otherwise collapse it.\n * Setting this prop enables control over the accordion.\n */\n isExpanded?: boolean;\n /**\n * If true, enables sorting for the accordion items\n */\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<SideNavItem>;\n }\n | {\n ariaControls?: never;\n href: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<SideNavItem>;\n }\n) &\n Pick<HtmlProps, \"translate\">;\n\nexport type SideNavFooterItem = {\n href?: string;\n id: string;\n label: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../../../src/ui-shell/SideNav/types.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactElement, SyntheticEvent } from \"react\";\n\nimport { UniqueIdentifier } from \"@dnd-kit/core\";\n\nimport type { HtmlProps } from \"../../HtmlProps.js\";\nimport type { DesignTokens } from \"../../OdysseyDesignTokensContext.js\";\nimport type { statusSeverityValues } from \"../../Status.js\";\nimport type { UiShellLogoProps } from \"../UiShellLogo.js\";\n\n/**\n * Type representing spacing values from the design tokens. odysseyDesignTokens.Spacing0, odysseyDesignTokens.Spacing1, etc.\n */\nexport type OdysseySpacingValue = DesignTokens[keyof Pick<\n DesignTokens,\n | \"Spacing0\"\n | \"Spacing1\"\n | \"Spacing2\"\n | \"Spacing3\"\n | \"Spacing4\"\n | \"Spacing5\"\n | \"Spacing6\"\n | \"Spacing7\"\n | \"Spacing8\"\n | \"Spacing9\"\n>];\n\nexport type SideNavProps = {\n /**\n * Side Nav header text that is usually reserved to show the App name\n */\n appName?: string;\n /**\n * If we want the collapse state to be based on session storage, then this needs to be `true`.\n */\n hasSessionStorageState?: boolean;\n /**\n * Determines whether the side nav is collapsed by default. When `true`, side nav also closes once and item is clicked.\n */\n isCollapsed?: boolean;\n /**\n * Determines whether the side nav is collapsible\n */\n isCollapsible?: boolean;\n /**\n * Determines whether the side nav items use compact layout\n */\n isCompact?: boolean;\n /**\n * Before the side nav has items, it will be in a loading state.\n */\n isLoading?: boolean;\n /**\n * If the side nav is up too much screen real estate. For instance, if you're in a narrower view, and it displays next to the content.\n *\n * When `true`, side nav will close itself after nav items are clicked.\n */\n isObtrusive?: boolean;\n /**\n * Optional padding to apply to the start of the leaves (items which are not expanded).\n * Should be one of the Odyssey design token spacing values (e.g., odysseyDesignTokens.Spacing1, odysseyDesignTokens.Spacing2, etc.)\n */\n leavesPaddingStart?: OdysseySpacingValue;\n /**\n * @deprecated use `logoProps` next to `sideNavProps` instead. This was moved to the top level.\n *\n * An optional logo component or src string for an img to display in the header. If not provided, will default to the Okta logo\n */\n logoProps?: UiShellLogoProps;\n /**\n * Triggers when the side nav is collapsed\n */\n onCollapse?: () => void;\n /**\n * Triggers when the side nav is expanded\n */\n onExpand?: () => void;\n /**\n * Triggers when the item is reordered\n */\n onSort?: (\n reorderedItems: SideNavItem[],\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n /**\n * Nav items in the side nav\n */\n sideNavItems?: SideNavItem[];\n} & (\n | {\n /**\n * The component to display as the footer; if present the `footerItems` are ignored and not rendered.\n */\n footerComponent?: ReactElement;\n footerItems?: never;\n hasCustomFooter: true;\n }\n | {\n footerComponent?: never;\n /**\n * Footer items in the side nav\n */\n footerItems?: SideNavFooterItem[];\n hasCustomFooter?: false;\n }\n) &\n Pick<HtmlProps, \"testId\">;\n\nexport type SideNavItem = {\n /**\n * The number to display as a count alongside the nav item\n */\n count?: number;\n /**\n * The icon element to display after the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n endIcon?: ReactElement;\n id: string;\n /**\n * Whether the item is disabled. When set to true the nav item is set to Disabled color, the link/item is not clickable, and item with nestedNavItems is not expandable.\n */\n isDisabled?: boolean;\n /**\n * Whether the item is active/selected\n */\n isSelected?: boolean;\n /**\n * Whether the item is sortable within a sortable list\n */\n isSortable?: boolean;\n label: string;\n /**\n * Event fired when the nav item is changed (for instance, capturing clicks on Accordion)\n */\n onChange?: (event: SyntheticEvent) => void;\n /**\n * Event fired when the nav item is clicked\n */\n onClick?: (event: SyntheticEvent) => void;\n /**\n * The status element to display after the label\n */\n severity?: (typeof statusSeverityValues)[number];\n /**\n * The icon element to display before the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n startIcon?: ReactElement;\n /**\n * The label to display inside the status\n */\n statusLabel?: string;\n /**\n * The link target prop. e.g., \"_blank\"\n */\n target?: string;\n} & (\n | {\n ariaControls?: never;\n href?: never;\n isDefaultExpanded?: never;\n isExpanded?: never;\n /**\n * Determines if the side nav item is a section header\n */\n isSectionHeader: true;\n nestedNavItems?: never;\n }\n | {\n /**\n * The `id` of the element this button controls. Use alongside `isExpanded` to wire up `aria-controls` for assistive technology.\n */\n ariaControls?: string;\n href?: never;\n isDefaultExpanded?: never;\n /**\n * If `true`, communicates to assistive technology that this button controls an expanded panel. Use when this item opens a panel or drawer rather than navigating.\n */\n isExpanded?: boolean;\n isSectionHeader?: never;\n nestedNavItems?: never;\n }\n | {\n ariaControls?: never;\n /**\n * link added to the nav item. if it is undefined, static text will be displayed. fires onClick event when it is passed\n */\n href: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n nestedNavItems?: never;\n }\n | {\n ariaControls?: never;\n href?: never;\n /**\n * Whether the accordion (nav item with nestedNavItems) is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * If true, expands the accordion, otherwise collapse it. Setting this prop enables control over the accordion.\n */\n isExpanded?: boolean;\n /**\n * If true, enables sorting for the accordion items\n */\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<SideNavItem>;\n }\n | {\n ariaControls?: never;\n href: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<SideNavItem>;\n }\n) &\n Pick<HtmlProps, \"translate\">;\n\nexport type SideNavFooterItem = {\n href?: string;\n id: string;\n label: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -121,5 +121,5 @@ const SkipToContent = ({
121
121
  });
122
122
  };
123
123
  const MemoizedSkipToContent = exports.SkipToContent = (0, _react.memo)(SkipToContent);
124
- MemoizedSkipToContent.displayName = "SkipToContent::pkg=odyssey&odysseyV=1.70.0";
124
+ MemoizedSkipToContent.displayName = "SkipToContent::pkg=odyssey&odysseyV=1.71.0";
125
125
  //# sourceMappingURL=SkipToContent.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SkipToContent.cjs","names":["_styled","_interopRequireDefault","require","_react","_BaseButton","_i18n","_OdysseyDesignTokensContext","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","StyledContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","left","Spacing4","position","top","Spacing3","zIndex","SKIP_LINKS_Z_INDEX","clip","clipPath","height","overflow","pointerEvents","whiteSpace","width","SkipToContent","appElement","useOdysseyDesignTokens","t","useTranslation","containerRef","useRef","buttonRef","interceptedFromRef","useEffect","hasTabIndex","hasAttribute","hasOutlineStyle","style","getPropertyValue","setAttribute","setProperty","removeAttribute","removeProperty","stopInterceptor","document","removeEventListener","handleKeyDown","keyboardEvent","key","shiftKey","current","contains","activeElement","preventDefault","requestAnimationFrame","focus","addEventListener","resumeFromInterceptedPosition","focusMainContent","useCallback","jsx","ref","children","BaseButton","id","label","onClick","variant","MemoizedSkipToContent","exports","memo","displayName"],"sources":["../../../src/ui-shell/SkipToContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, useCallback, useEffect, useRef } from \"react\";\n\nimport { BaseButton } from \"../Buttons/BaseButton.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport { FocusHandle } from \"../inputUtils.js\";\nimport {\n type DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { SKIP_LINKS_Z_INDEX } from \"./uiShellSharedConstants.js\";\n\nconst StyledContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n left: odysseyDesignTokens.Spacing4,\n position: \"fixed\",\n top: odysseyDesignTokens.Spacing3,\n zIndex: SKIP_LINKS_Z_INDEX,\n // Visually hidden when not focused — the \"sr-only\" pattern.\n // https://www.a11yproject.com/posts/how-to-hide-content/\n //\n // We found this method via the A11y Project. It fixes axe color-contrast\n // violations that `opacity: 0` triggers (axe still evaluates contrast on\n // opacity-0 elements because they occupy space in the layout). The sr-only\n // pattern collapses the element to 1×1 px and clips it, which axe — and\n // every modern screen reader — treats as fully hidden. Unlike a large\n // negative `left` offset, it also avoids any risk of a phantom scrollbar.\n \"&:not(:focus-within)\": {\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n height: \"1px\",\n overflow: \"hidden\",\n pointerEvents: \"none\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n },\n}));\n\ntype SkipToContentProps = {\n appElement: HTMLDivElement | null;\n};\n\nconst SkipToContent = ({ appElement }: SkipToContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<FocusHandle>(null);\n const interceptedFromRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (appElement) {\n const hasTabIndex = appElement.hasAttribute(\"tabindex\");\n const hasOutlineStyle =\n appElement.style.getPropertyValue(\"outline\") !== \"\";\n\n if (!hasTabIndex) {\n appElement.setAttribute(\"tabindex\", \"-1\");\n }\n if (!hasOutlineStyle) {\n appElement.style.setProperty(\"outline\", \"none\");\n }\n\n return () => {\n if (!hasTabIndex) {\n appElement.removeAttribute(\"tabindex\");\n }\n if (!hasOutlineStyle) {\n appElement.style.removeProperty(\"outline\");\n }\n };\n }\n\n return;\n }, [appElement]);\n\n useEffect(() => {\n const stopInterceptor = () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n document.removeEventListener(\"pointerdown\", stopInterceptor);\n };\n\n const handleKeyDown = (keyboardEvent: globalThis.KeyboardEvent) => {\n if (\n keyboardEvent.key === \"Tab\" &&\n !keyboardEvent.shiftKey &&\n !containerRef.current?.contains(document.activeElement)\n ) {\n interceptedFromRef.current = document.activeElement as HTMLElement;\n keyboardEvent.preventDefault();\n stopInterceptor();\n\n requestAnimationFrame(() => {\n buttonRef.current?.focus();\n });\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n document.addEventListener(\"pointerdown\", stopInterceptor);\n\n return stopInterceptor;\n }, []);\n\n useEffect(() => {\n const resumeFromInterceptedPosition = (\n keyboardEvent: globalThis.KeyboardEvent,\n ) => {\n if (\n interceptedFromRef.current &&\n keyboardEvent.key === \"Tab\" &&\n !keyboardEvent.shiftKey &&\n containerRef.current?.contains(document.activeElement)\n ) {\n interceptedFromRef.current.focus();\n interceptedFromRef.current = null;\n }\n };\n\n document.addEventListener(\"keydown\", resumeFromInterceptedPosition);\n\n return () => {\n document.removeEventListener(\"keydown\", resumeFromInterceptedPosition);\n };\n }, []);\n\n const focusMainContent = useCallback(() => {\n appElement?.focus();\n }, [appElement]);\n\n return (\n <StyledContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <BaseButton\n buttonRef={buttonRef}\n id=\"skip-to-main-content\"\n label={t(\"skiplinks.main\")}\n onClick={focusMainContent}\n variant=\"primary\"\n />\n </StyledContainer>\n );\n};\n\nconst MemoizedSkipToContent = memo(SkipToContent);\nMemoizedSkipToContent.displayName = \"SkipToContent\";\n\nexport { MemoizedSkipToContent as SkipToContent };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAA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1BS,OAAO,EAAC;IAAS,CAClB;EAAC,CACa,CAAC;AAEtB,CAAC;AAED,MAAMC,qBAAqB,GAAAC,OAAA,CAAA7C,aAAA,GAAG,IAAA8C,WAAI,EAAC9C,aAAa,CAAC;AACjD4C,qBAAqB,CAACG,WAAW,+CAAkB","ignoreList":[]}
1
+ {"version":3,"file":"SkipToContent.cjs","names":["_styled","_interopRequireDefault","require","_react","_BaseButton","_i18n","_OdysseyDesignTokensContext","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","StyledContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","left","Spacing4","position","top","Spacing3","zIndex","SKIP_LINKS_Z_INDEX","clip","clipPath","height","overflow","pointerEvents","whiteSpace","width","SkipToContent","appElement","useOdysseyDesignTokens","t","useTranslation","containerRef","useRef","buttonRef","interceptedFromRef","useEffect","hasTabIndex","hasAttribute","hasOutlineStyle","style","getPropertyValue","setAttribute","setProperty","removeAttribute","removeProperty","stopInterceptor","document","removeEventListener","handleKeyDown","keyboardEvent","key","shiftKey","current","contains","activeElement","preventDefault","requestAnimationFrame","focus","addEventListener","resumeFromInterceptedPosition","focusMainContent","useCallback","jsx","ref","children","BaseButton","id","label","onClick","variant","MemoizedSkipToContent","exports","memo","displayName"],"sources":["../../../src/ui-shell/SkipToContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, useCallback, useEffect, useRef } from \"react\";\n\nimport { BaseButton } from \"../Buttons/BaseButton.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport { FocusHandle } from \"../inputUtils.js\";\nimport {\n type DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { SKIP_LINKS_Z_INDEX } from \"./uiShellSharedConstants.js\";\n\nconst StyledContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n left: odysseyDesignTokens.Spacing4,\n position: \"fixed\",\n top: odysseyDesignTokens.Spacing3,\n zIndex: SKIP_LINKS_Z_INDEX,\n // Visually hidden when not focused — the \"sr-only\" pattern. https://www.a11yproject.com/posts/how-to-hide-content/\n //\n // We found this method via the A11y Project. It fixes axe color-contrast violations that `opacity: 0` triggers (axe still evaluates contrast on opacity-0 elements because they occupy space in the layout). The sr-only pattern collapses the element to 1×1 px and clips it, which axe — and every modern screen reader — treats as fully hidden. Unlike a large negative `left` offset, it also avoids any risk of a phantom scrollbar.\n \"&:not(:focus-within)\": {\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n height: \"1px\",\n overflow: \"hidden\",\n pointerEvents: \"none\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n },\n}));\n\ntype SkipToContentProps = {\n appElement: HTMLDivElement | null;\n};\n\nconst SkipToContent = ({ appElement }: SkipToContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<FocusHandle>(null);\n const interceptedFromRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (appElement) {\n const hasTabIndex = appElement.hasAttribute(\"tabindex\");\n const hasOutlineStyle =\n appElement.style.getPropertyValue(\"outline\") !== \"\";\n\n if (!hasTabIndex) {\n appElement.setAttribute(\"tabindex\", \"-1\");\n }\n if (!hasOutlineStyle) {\n appElement.style.setProperty(\"outline\", \"none\");\n }\n\n return () => {\n if (!hasTabIndex) {\n appElement.removeAttribute(\"tabindex\");\n }\n if (!hasOutlineStyle) {\n appElement.style.removeProperty(\"outline\");\n }\n };\n }\n\n return;\n }, [appElement]);\n\n useEffect(() => {\n const stopInterceptor = () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n document.removeEventListener(\"pointerdown\", stopInterceptor);\n };\n\n const handleKeyDown = (keyboardEvent: globalThis.KeyboardEvent) => {\n if (\n keyboardEvent.key === \"Tab\" &&\n !keyboardEvent.shiftKey &&\n !containerRef.current?.contains(document.activeElement)\n ) {\n interceptedFromRef.current = document.activeElement as HTMLElement;\n keyboardEvent.preventDefault();\n stopInterceptor();\n\n requestAnimationFrame(() => {\n buttonRef.current?.focus();\n });\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n document.addEventListener(\"pointerdown\", stopInterceptor);\n\n return stopInterceptor;\n }, []);\n\n useEffect(() => {\n const resumeFromInterceptedPosition = (\n keyboardEvent: globalThis.KeyboardEvent,\n ) => {\n if (\n interceptedFromRef.current &&\n keyboardEvent.key === \"Tab\" &&\n !keyboardEvent.shiftKey &&\n containerRef.current?.contains(document.activeElement)\n ) {\n interceptedFromRef.current.focus();\n interceptedFromRef.current = null;\n }\n };\n\n document.addEventListener(\"keydown\", resumeFromInterceptedPosition);\n\n return () => {\n document.removeEventListener(\"keydown\", resumeFromInterceptedPosition);\n };\n }, []);\n\n const focusMainContent = useCallback(() => {\n appElement?.focus();\n }, [appElement]);\n\n return (\n <StyledContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <BaseButton\n buttonRef={buttonRef}\n id=\"skip-to-main-content\"\n label={t(\"skiplinks.main\")}\n onClick={focusMainContent}\n variant=\"primary\"\n />\n </StyledContainer>\n );\n};\n\nconst MemoizedSkipToContent = memo(SkipToContent);\nMemoizedSkipToContent.displayName = \"SkipToContent\";\n\nexport { MemoizedSkipToContent as SkipToContent };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAA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AC,gBAAgB,CAAE;MAC3BuC,OAAO,EAAER,gBAAiB;MAC1BS,OAAO,EAAC;IAAS,CAClB;EAAC,CACa,CAAC;AAEtB,CAAC;AAED,MAAMC,qBAAqB,GAAAC,OAAA,CAAA7C,aAAA,GAAG,IAAA8C,WAAI,EAAC9C,aAAa,CAAC;AACjD4C,qBAAqB,CAACG,WAAW,+CAAkB","ignoreList":[]}
@@ -33,5 +33,5 @@ var _jsxRuntime = require("react/jsx-runtime");
33
33
  });
34
34
  });
35
35
  const MemoizedHamburgerMenuIcon = exports.HamburgerMenuIcon = (0, _react.memo)(HamburgerMenuIcon);
36
- MemoizedHamburgerMenuIcon.displayName = "HamburgerMenuIcon::pkg=odyssey&odysseyV=1.70.0";
36
+ MemoizedHamburgerMenuIcon.displayName = "HamburgerMenuIcon::pkg=odyssey&odysseyV=1.71.0";
37
37
  //# sourceMappingURL=HamburgerMenuIcon.cjs.map
@@ -69,5 +69,5 @@ const TopNav = ({
69
69
  });
70
70
  };
71
71
  const MemoizedTopNav = exports.TopNav = (0, _react.memo)(TopNav);
72
- MemoizedTopNav.displayName = "TopNav::pkg=odyssey&odysseyV=1.70.0";
72
+ MemoizedTopNav.displayName = "TopNav::pkg=odyssey&odysseyV=1.71.0";
73
73
  //# sourceMappingURL=TopNav.cjs.map
@@ -39,5 +39,5 @@ const TopNavLinksList = ({
39
39
  })
40
40
  });
41
41
  const MemoizedTopNavLinksList = exports.TopNavLinksList = (0, _react.memo)(TopNavLinksList);
42
- MemoizedTopNavLinksList.displayName = "TopNavLinksList::pkg=odyssey&odysseyV=1.70.0";
42
+ MemoizedTopNavLinksList.displayName = "TopNavLinksList::pkg=odyssey&odysseyV=1.71.0";
43
43
  //# sourceMappingURL=TopNavLinksList.cjs.map
@@ -133,5 +133,5 @@ const TopNavListItem = ({
133
133
  });
134
134
  };
135
135
  const MemoizedTopNavListItem = exports.TopNavListItem = (0, _react.memo)(TopNavListItem);
136
- MemoizedTopNavListItem.displayName = "TopNavListItem::pkg=odyssey&odysseyV=1.70.0";
136
+ MemoizedTopNavListItem.displayName = "TopNavListItem::pkg=odyssey&odysseyV=1.71.0";
137
137
  //# sourceMappingURL=TopNavListItem.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopNavListItem.cjs","names":["_styled","_interopRequireDefault","require","_react","_Link","_OdysseyDesignTokensContext","_jsxRuntime","e","__esModule","default","StyledTopNavItemLabelContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","alignItems","display","flexWrap","fontSize","TypographyScale0","fontWeight","TypographyWeightHeading","StyledTopNavListItem","isDisabled","color","TypographyColorDisabled","TypographyColorHeading","cursor","pointerEvents","a","paddingBlock","Spacing2","paddingInline","Spacing4","backgroundColor","HueNeutral50","textDecoration","borderRadius","outlineOffset","outlineWidth","FocusOutlineWidthMain","StyledNavItemContentClickContainer","width","outlineColor","FocusOutlineColorPrimary","outlineStyle","FocusOutlineStyle","TopNavListItem","href","id","label","onClick","target","useOdysseyDesignTokens","topNavItemContentKeyHandler","useCallback","event","key","preventDefault","stopPropagation","jsxs","children","jsx","Link","onKeyDown","role","tabIndex","MemoizedTopNavListItem","exports","memo","displayName"],"sources":["../../../../src/ui-shell/TopNav/TopNavListItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n KeyboardEventHandler,\n memo,\n MouseEventHandler,\n useCallback,\n} from \"react\";\n\nimport { Link } from \"../../Link.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\n\nconst StyledTopNavItemLabelContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n flexWrap: \"wrap\",\n fontSize: odysseyDesignTokens.TypographyScale0,\n fontWeight: odysseyDesignTokens.TypographyWeightHeading,\n}));\n\nconst StyledTopNavListItem = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isDisabled\",\n})<{\n isDisabled?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens, isDisabled }) => ({\n alignItems: \"center\",\n color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,\n cursor: isDisabled ? \"default\" : \"pointer\",\n display: \"flex\",\n pointerEvents: isDisabled ? \"none\" : \"auto\",\n\n a: {\n alignItems: \"center\",\n color: `${odysseyDesignTokens.TypographyColorHeading} !important`,\n display: \"flex\",\n paddingBlock: odysseyDesignTokens.Spacing2,\n paddingInline: odysseyDesignTokens.Spacing4,\n\n \"&:hover\": {\n backgroundColor: !isDisabled\n ? odysseyDesignTokens.HueNeutral50\n : \"inherit\",\n textDecoration: \"none\",\n },\n\n \"&:focus-visible\": {\n backgroundColor: !isDisabled\n ? odysseyDesignTokens.HueNeutral50\n : \"inherit\",\n borderRadius: 0,\n outlineOffset: 0,\n outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,\n },\n },\n\n \"div[role='button']:hover\": {\n backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : \"inherit\",\n },\n}));\n\nconst StyledNavItemContentClickContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n paddingBlock: odysseyDesignTokens.Spacing2,\n paddingInline: odysseyDesignTokens.Spacing4,\n width: \"100%\",\n\n \"&:focus-visible\": {\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n borderRadius: 0,\n outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n outlineStyle: odysseyDesignTokens.FocusOutlineStyle,\n outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,\n textDecoration: \"none\",\n },\n}));\n\nexport type TopNavListItemProps = {\n /**\n * Without a hyperlink reference, `onClick` functionality will not function.\n * If `undefined`, static text will be displayed.\n */\n href?: string;\n /**\n * HTML `id` attribute.\n */\n id: string;\n /**\n * If `true`, the navigation link item is disabled and cannot be activated.\n */\n isDisabled?: boolean;\n /**\n * Display text for the link.\n */\n label: string;\n /**\n * Handles both mouse and keyboard interactions.\n */\n onClick?: MouseEventHandler<HTMLAnchorElement> &\n MouseEventHandler<HTMLDivElement> &\n KeyboardEventHandler<HTMLDivElement>;\n /**\n * Where to display the linked URL.\n */\n target?: string;\n};\n\nconst TopNavListItem = ({\n href,\n id,\n isDisabled,\n label,\n onClick,\n target,\n}: TopNavListItemProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const topNavItemContentKeyHandler = useCallback<\n KeyboardEventHandler<HTMLDivElement>\n >(\n (event) => {\n if (event?.key === \"Enter\") {\n event.preventDefault();\n event.stopPropagation();\n onClick?.(event);\n }\n },\n [onClick],\n );\n\n return (\n <StyledTopNavListItem\n aria-disabled={isDisabled}\n id={id}\n isDisabled={isDisabled}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {\n // Use Link for nav items with links and div for disabled or non-link items\n isDisabled && (\n <StyledNavItemContentClickContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <StyledTopNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {label}\n </StyledTopNavItemLabelContainer>\n </StyledNavItemContentClickContainer>\n )\n }\n\n {!isDisabled && href && (\n <Link href={href} onClick={onClick} target={target}>\n <StyledTopNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {label}\n </StyledTopNavItemLabelContainer>\n </Link>\n )}\n\n {!isDisabled && !href && (\n <StyledNavItemContentClickContainer\n odysseyDesignTokens={odysseyDesignTokens}\n onClick={onClick}\n onKeyDown={topNavItemContentKeyHandler}\n role=\"button\"\n tabIndex={0}\n >\n <StyledTopNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {label}\n </StyledTopNavItemLabelContainer>\n </StyledNavItemContentClickContainer>\n )}\n </StyledTopNavListItem>\n );\n};\n\nconst MemoizedTopNavListItem = memo(TopNavListItem);\nMemoizedTopNavListItem.displayName = \"TopNavListItem\";\n\nexport { MemoizedTopNavListItem as TopNavListItem };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAG6C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAxB7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,MAAMG,8BAA8B,GAAG,IAAAC,eAAM,EAAC,KAAK,EAAE;EACnDC,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAoB,CAAC,MAAM;EAC/BC,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,MAAM;EACfC,QAAQ,EAAE,MAAM;EAChBC,QAAQ,EAAEJ,mBAAmB,CAACK,gBAAgB;EAC9CC,UAAU,EAAEN,mBAAmB,CAACO;AAClC,CAAC,CAAC,CAAC;AAEH,MAAMC,oBAAoB,GAAG,IAAAX,eAAM,EAAC,IAAI,EAAE;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,mBAAoB;QAAA+C,QAAA,EAExCX;MAAK,CACwB;IAAC,CACC,CACrC,EAGF,CAAC3B,UAAU,IAAIyB,IAAI,IAClB,IAAA1C,WAAA,CAAAwD,GAAA,EAAC1D,KAAA,CAAA2D,IAAI;MAACf,IAAI,EAAEA,IAAK;MAACG,OAAO,EAAEA,OAAQ;MAACC,MAAM,EAAEA,MAAO;MAAAS,QAAA,EACjD,IAAAvD,WAAA,CAAAwD,GAAA,EAACpD,8BAA8B;QAC7BI,mBAAmB,EAAEA,mBAAoB;QAAA+C,QAAA,EAExCX;MAAK,CACwB;IAAC,CAC7B,CACP,EAEA,CAAC3B,UAAU,IAAI,CAACyB,IAAI,IACnB,IAAA1C,WAAA,CAAAwD,GAAA,EAACrB,kCAAkC;MACjC3B,mBAAmB,EAAEA,mBAAoB;MACzCqC,OAAO,EAAEA,OAAQ;MACjBa,SAAS,EAAEV,2BAA4B;MACvCW,IAAI,EAAC,QAAQ;MACbC,QAAQ,EAAE,CAAE;MAAAL,QAAA,EAEZ,IAAAvD,WAAA,CAAAwD,GAAA,EAACpD,8BAA8B;QAC7BI,mBAAmB,EAAEA,mBAAoB;QAAA+C,QAAA,EAExCX;MAAK,CACwB;IAAC,CACC,CACrC;EAAA,CACmB,CAAC;AAE3B,CAAC;AAED,MAAMiB,sBAAsB,GAAAC,OAAA,CAAArB,cAAA,GAAG,IAAAsB,WAAI,EAACtB,cAAc,CAAC;AACnDoB,sBAAsB,CAACG,WAAW,gDAAmB","ignoreList":[]}
1
+ {"version":3,"file":"TopNavListItem.cjs","names":["_styled","_interopRequireDefault","require","_react","_Link","_OdysseyDesignTokensContext","_jsxRuntime","e","__esModule","default","StyledTopNavItemLabelContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","alignItems","display","flexWrap","fontSize","TypographyScale0","fontWeight","TypographyWeightHeading","StyledTopNavListItem","isDisabled","color","TypographyColorDisabled","TypographyColorHeading","cursor","pointerEvents","a","paddingBlock","Spacing2","paddingInline","Spacing4","backgroundColor","HueNeutral50","textDecoration","borderRadius","outlineOffset","outlineWidth","FocusOutlineWidthMain","StyledNavItemContentClickContainer","width","outlineColor","FocusOutlineColorPrimary","outlineStyle","FocusOutlineStyle","TopNavListItem","href","id","label","onClick","target","useOdysseyDesignTokens","topNavItemContentKeyHandler","useCallback","event","key","preventDefault","stopPropagation","jsxs","children","jsx","Link","onKeyDown","role","tabIndex","MemoizedTopNavListItem","exports","memo","displayName"],"sources":["../../../../src/ui-shell/TopNav/TopNavListItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n KeyboardEventHandler,\n memo,\n MouseEventHandler,\n useCallback,\n} from \"react\";\n\nimport { Link } from \"../../Link.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\n\nconst StyledTopNavItemLabelContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n flexWrap: \"wrap\",\n fontSize: odysseyDesignTokens.TypographyScale0,\n fontWeight: odysseyDesignTokens.TypographyWeightHeading,\n}));\n\nconst StyledTopNavListItem = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isDisabled\",\n})<{\n isDisabled?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens, isDisabled }) => ({\n alignItems: \"center\",\n color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,\n cursor: isDisabled ? \"default\" : \"pointer\",\n display: \"flex\",\n pointerEvents: isDisabled ? \"none\" : \"auto\",\n\n a: {\n alignItems: \"center\",\n color: `${odysseyDesignTokens.TypographyColorHeading} !important`,\n display: \"flex\",\n paddingBlock: odysseyDesignTokens.Spacing2,\n paddingInline: odysseyDesignTokens.Spacing4,\n\n \"&:hover\": {\n backgroundColor: !isDisabled\n ? odysseyDesignTokens.HueNeutral50\n : \"inherit\",\n textDecoration: \"none\",\n },\n\n \"&:focus-visible\": {\n backgroundColor: !isDisabled\n ? odysseyDesignTokens.HueNeutral50\n : \"inherit\",\n borderRadius: 0,\n outlineOffset: 0,\n outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,\n },\n },\n\n \"div[role='button']:hover\": {\n backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : \"inherit\",\n },\n}));\n\nconst StyledNavItemContentClickContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n paddingBlock: odysseyDesignTokens.Spacing2,\n paddingInline: odysseyDesignTokens.Spacing4,\n width: \"100%\",\n\n \"&:focus-visible\": {\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n borderRadius: 0,\n outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n outlineStyle: odysseyDesignTokens.FocusOutlineStyle,\n outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,\n textDecoration: \"none\",\n },\n}));\n\nexport type TopNavListItemProps = {\n /**\n * Without a hyperlink reference, `onClick` functionality will not function. If `undefined`, static text will be displayed.\n */\n href?: string;\n /**\n * HTML `id` attribute.\n */\n id: string;\n /**\n * If `true`, the navigation link item is disabled and cannot be activated.\n */\n isDisabled?: boolean;\n /**\n * Display text for the link.\n */\n label: string;\n /**\n * Handles both mouse and keyboard interactions.\n */\n onClick?: MouseEventHandler<HTMLAnchorElement> &\n MouseEventHandler<HTMLDivElement> &\n KeyboardEventHandler<HTMLDivElement>;\n /**\n * Where to display the linked URL.\n */\n target?: string;\n};\n\nconst TopNavListItem = ({\n href,\n id,\n isDisabled,\n label,\n onClick,\n target,\n}: TopNavListItemProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const topNavItemContentKeyHandler = useCallback<\n KeyboardEventHandler<HTMLDivElement>\n >(\n (event) => {\n if (event?.key === \"Enter\") {\n event.preventDefault();\n event.stopPropagation();\n onClick?.(event);\n }\n },\n [onClick],\n );\n\n return (\n <StyledTopNavListItem\n aria-disabled={isDisabled}\n id={id}\n isDisabled={isDisabled}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {\n // Use Link for nav items with links and div for disabled or non-link items\n isDisabled && (\n <StyledNavItemContentClickContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <StyledTopNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {label}\n </StyledTopNavItemLabelContainer>\n </StyledNavItemContentClickContainer>\n )\n }\n\n {!isDisabled && href && (\n <Link href={href} onClick={onClick} target={target}>\n <StyledTopNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {label}\n </StyledTopNavItemLabelContainer>\n </Link>\n )}\n\n {!isDisabled && !href && (\n <StyledNavItemContentClickContainer\n odysseyDesignTokens={odysseyDesignTokens}\n onClick={onClick}\n onKeyDown={topNavItemContentKeyHandler}\n role=\"button\"\n tabIndex={0}\n >\n <StyledTopNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {label}\n </StyledTopNavItemLabelContainer>\n </StyledNavItemContentClickContainer>\n )}\n </StyledTopNavListItem>\n );\n};\n\nconst MemoizedTopNavListItem = memo(TopNavListItem);\nMemoizedTopNavListItem.displayName = \"TopNavListItem\";\n\nexport { Memo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A,CAAAwD,GAAA,EAACrB,kCAAkC;MACjC3B,mBAAmB,EAAEA,mBAAoB;MACzCqC,OAAO,EAAEA,OAAQ;MACjBa,SAAS,EAAEV,2BAA4B;MACvCW,IAAI,EAAC,QAAQ;MACbC,QAAQ,EAAE,CAAE;MAAAL,QAAA,EAEZ,IAAAvD,WAAA,CAAAwD,GAAA,EAACpD,8BAA8B;QAC7BI,mBAAmB,EAAEA,mBAAoB;QAAA+C,QAAA,EAExCX;MAAK,CACwB;IAAC,CACC,CACrC;EAAA,CACmB,CAAC;AAE3B,CAAC;AAED,MAAMiB,sBAAsB,GAAAC,OAAA,CAAArB,cAAA,GAAG,IAAAsB,WAAI,EAACtB,cAAc,CAAC;AACnDoB,sBAAsB,CAACG,WAAW,gDAAmB","ignoreList":[]}
@@ -129,5 +129,5 @@ const UiShell = ({
129
129
  });
130
130
  };
131
131
  const MemoizedUiShell = exports.UiShell = (0, _react.memo)(UiShell);
132
- MemoizedUiShell.displayName = "UiShell::pkg=odyssey&odysseyV=1.70.0";
132
+ MemoizedUiShell.displayName = "UiShell::pkg=odyssey&odysseyV=1.71.0";
133
133
  //# sourceMappingURL=UiShell.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiShell.cjs","names":["_react","require","_reactErrorBoundary","_OdysseyProvider","_NarrowUiShellContent","_UiShellProvider","_useUiShellBreakpoints","_WideUiShellContent","_jsxRuntime","defaultComponentProps","exports","sideNavProps","undefined","topNavProps","defaultTranslationSettings","errorComponent","jsx","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","subscribeToTranslationSettings","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","useState","translationSettings","setTranslationSettings","activeBreakpoint","useUiShellBreakpoints","logoProps","Error","useEffect","unsubscribeFromPropChanges","unsubscribeFromTranslationSettings","nextSettings","ErrorBoundary","fallback","children","OdysseyProvider","emotionRootElement","fullScreenOverlayId","hasCssBaseline","languageCode","shadowRootElement","translationOverrides","jsxs","UiShellProvider","NarrowUiShellContent","hasSideNavProps","Boolean","WideUiShellContent","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","memo","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, type SetStateAction, useEffect, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport {\n type TranslationOverrides,\n type TranslationProviderProps,\n} from \"../i18n.generated/i18n.js\";\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { MessageBus } from \"../tools/createMessageBus.js\";\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { NarrowUiShellContent } from \"./NarrowUiShellContent.js\";\nimport {\n UiShellContentProps,\n UiShellNavComponentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellProvider, UiShellProviderProps } from \"./UiShellProvider.js\";\nimport {\n UiShellBreakpointConfig,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\nimport { WideUiShellContent } from \"./WideUiShellContent.js\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\n/**\n * Runtime-updatable translation settings forwarded to UI Shell's internal `OdysseyProvider`.\n *\n * Consumers pass these as initial props to `renderUiShell({...})` and can update them later\n * by calling `setTranslationSettings(...)` on the returned object.\n */\nexport type UiShellTranslationSettings = Pick<\n TranslationProviderProps,\n \"languageCode\"\n> & {\n translationOverrides?: TranslationOverrides;\n};\n\nconst defaultTranslationSettings: UiShellTranslationSettings = {};\n\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Subscriber for runtime-updatable translation settings (`languageCode`, `translationOverrides`).\n *\n * These are forwarded to the shell's internal `OdysseyProvider` so consumers can drive shell\n * localization from their own i18n source instead of the browser's `navigator.language`.\n *\n * Optional for backward compatibility — when omitted, the shell falls back to\n * `window.navigator.language` (its prior behavior).\n */\n subscribeToTranslationSettings?: MessageBus<\n SetStateAction<UiShellTranslationSettings>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n subscribeToTranslationSettings,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n const [translationSettings, setTranslationSettings] =\n useState<UiShellTranslationSettings>(defaultTranslationSettings);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\n\n if (componentProps.sideNavProps?.logoProps && componentProps.logoProps) {\n throw new Error(\n \"Unified UI Shell: You passed both `logoProps` and `sideNavProps.logoProps` as component props. Please only use the top-level `logoProps` instead.\",\n );\n }\n\n useEffect(() => {\n const unsubscribeFromPropChanges = subscribeToPropChanges(\n (componentProps) => {\n // If for some reason nothing is passed as `componentProps`, we fallback on `defaultComponentProps` as a safety mechanism to ensure nothing breaks.\n setComponentProps(componentProps || defaultComponentProps);\n },\n );\n\n // Both subscribers must be wired BEFORE `onSubscriptionCreated()` fires.\n // `renderUiShell` uses `bufferLatest` to queue the initial translation settings\n // until the React app subscribes; if we called `onSubscriptionCreated()` first,\n // the buffered emission would fire before this subscriber exists and be lost.\n const unsubscribeFromTranslationSettings = subscribeToTranslationSettings?.(\n (nextSettings) => {\n setTranslationSettings(nextSettings || defaultTranslationSettings);\n },\n );\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribeFromPropChanges();\n unsubscribeFromTranslationSettings?.();\n };\n }, [\n onSubscriptionCreated,\n subscribeToPropChanges,\n subscribeToTranslationSettings,\n ]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n fullScreenOverlayId=\"odyssey-react-overlay-component-render-ui-shell\"\n hasCssBaseline\n languageCode={translationSettings.languageCode}\n shadowRootElement={uiShellAppElement}\n translationOverrides={translationSettings.translationOverrides}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <UiShellProvider\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n closeSideNavMenu={closeSideNavMenu}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n topNavBackgroundColor={topNavBackgroundColor}\n >\n {activeBreakpoint === \"narrow\" && (\n <NarrowUiShellContent\n {...componentProps}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n\n {(activeBreakpoint === \"medium\" || activeBreakpoint === \"wide\") && (\n <WideUiShellContent\n {...{\n ...componentProps,\n ...{\n sideNavProps: {\n ...componentProps.sideNavProps,\n hasSessionStorageState: activeBreakpoint === \"wide\",\n isCollapsed:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsed,\n isCollapsible:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsible,\n logoProps:\n componentProps.sideNavProps?.logoProps ||\n componentProps.logoProps,\n } as typeof componentProps.sideNavProps, // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\nMemoizedUiShell.displayName = \"UiShell\";\n\nexport { MemoizedUiShell as UiShell };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAMA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,qBAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AAA6D,IAAAO,WAAA,GAAAP,OAAA;AAhC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBO,MAAMQ,qBAA+C,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EAC7DE,YAAY,EAAEC,SAAS;EACvBC,WAAW,EAAED;AACf,CAAU;AAeV,MAAME,0BAAsD,GAAG,CAAC,CAAC;AAEjE,MAAMC,cAAc,GAAG,IAAAP,WAAA,CAAAQ,GAAA;EAAK;AAAU,CAAE,CAAC;AA8DzC,MAAMC,OAAO,GAAGA,CAAC;EACfC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU;EACVC,uBAAuB;EACvBC,gBAAgB;EAChBC,gBAAgB;EAChBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,qBAAqB;EACrBC,kBAAkB;EAClBC,sBAAsB;EACtBC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,2BAA2B;EAC3BC,sBAAsB;EACtBC,8BAA8B;EAC9BC,qBAAqB;EACrBC,iBAAiB;EACjBC;AACY,CAAC,KAAK;EAClB,MAAM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,EAAE2D,WAAW;gBAC1CC,aAAa,EACX1B,gBAAgB,KAAK,QAAQ,IAC7BL,cAAc,CAAC7B,YAAY,EAAE4D,aAAa;gBAC5CxB,SAAS,EACPP,cAAc,CAAC7B,YAAY,EAAEoC,SAAS,IACtCP,cAAc,CAACO;cACnB;YACF,CAAC;YAEH3B,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjD6C,eAAe,EAAEC,OAAO,CAAC3B,cAAc,CAAC7B,YAAY,CAAE;YACtDa,4BAA4B,EAAEA,4BAA6B;YAC3DC,sBAAsB,EAAEA,sBAAuB;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF;QAAA,CACc;MAAC,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAM0C,eAAe,GAAA9D,OAAA,CAAAO,OAAA,GAAG,IAAAwD,WAAI,EAACxD,OAAO,CAAC;AACrCuD,eAAe,CAACE,WAAW,yCAAY","ignoreList":[]}
1
+ {"version":3,"file":"UiShell.cjs","names":["_react","require","_reactErrorBoundary","_OdysseyProvider","_NarrowUiShellContent","_UiShellProvider","_useUiShellBreakpoints","_WideUiShellContent","_jsxRuntime","defaultComponentProps","exports","sideNavProps","undefined","topNavProps","defaultTranslationSettings","errorComponent","jsx","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","subscribeToTranslationSettings","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","useState","translationSettings","setTranslationSettings","activeBreakpoint","useUiShellBreakpoints","logoProps","Error","useEffect","unsubscribeFromPropChanges","unsubscribeFromTranslationSettings","nextSettings","ErrorBoundary","fallback","children","OdysseyProvider","emotionRootElement","fullScreenOverlayId","hasCssBaseline","languageCode","shadowRootElement","translationOverrides","jsxs","UiShellProvider","NarrowUiShellContent","hasSideNavProps","Boolean","WideUiShellContent","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","memo","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, type SetStateAction, useEffect, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport {\n type TranslationOverrides,\n type TranslationProviderProps,\n} from \"../i18n.generated/i18n.js\";\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { MessageBus } from \"../tools/createMessageBus.js\";\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { NarrowUiShellContent } from \"./NarrowUiShellContent.js\";\nimport {\n UiShellContentProps,\n UiShellNavComponentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellProvider, UiShellProviderProps } from \"./UiShellProvider.js\";\nimport {\n UiShellBreakpointConfig,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\nimport { WideUiShellContent } from \"./WideUiShellContent.js\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\n/**\n * Runtime-updatable translation settings forwarded to UI Shell's internal `OdysseyProvider`.\n *\n * Consumers pass these as initial props to `renderUiShell({...})` and can update them later by calling `setTranslationSettings(...)` on the returned object.\n */\nexport type UiShellTranslationSettings = Pick<\n TranslationProviderProps,\n \"languageCode\"\n> & {\n translationOverrides?: TranslationOverrides;\n};\n\nconst defaultTranslationSettings: UiShellTranslationSettings = {};\n\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state. It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Subscriber for runtime-updatable translation settings (`languageCode`, `translationOverrides`).\n *\n * These are forwarded to the shell's internal `OdysseyProvider` so consumers can drive shell localization from their own i18n source instead of the browser's `navigator.language`.\n *\n * Optional for backward compatibility — when omitted, the shell falls back to `window.navigator.language` (its prior behavior).\n */\n subscribeToTranslationSettings?: MessageBus<\n SetStateAction<UiShellTranslationSettings>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n subscribeToTranslationSettings,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n const [translationSettings, setTranslationSettings] =\n useState<UiShellTranslationSettings>(defaultTranslationSettings);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\n\n if (componentProps.sideNavProps?.logoProps && componentProps.logoProps) {\n throw new Error(\n \"Unified UI Shell: You passed both `logoProps` and `sideNavProps.logoProps` as component props. Please only use the top-level `logoProps` instead.\",\n );\n }\n\n useEffect(() => {\n const unsubscribeFromPropChanges = subscribeToPropChanges(\n (componentProps) => {\n // If for some reason nothing is passed as `componentProps`, we fallback on `defaultComponentProps` as a safety mechanism to ensure nothing breaks.\n setComponentProps(componentProps || defaultComponentProps);\n },\n );\n\n // Both subscribers must be wired BEFORE `onSubscriptionCreated()` fires. `renderUiShell` uses `bufferLatest` to queue the initial translation settings until the React app subscribes; if we called `onSubscriptionCreated()` first, the buffered emission would fire before this subscriber exists and be lost.\n const unsubscribeFromTranslationSettings = subscribeToTranslationSettings?.(\n (nextSettings) => {\n setTranslationSettings(nextSettings || defaultTranslationSettings);\n },\n );\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribeFromPropChanges();\n unsubscribeFromTranslationSettings?.();\n };\n }, [\n onSubscriptionCreated,\n subscribeToPropChanges,\n subscribeToTranslationSettings,\n ]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n fullScreenOverlayId=\"odyssey-react-overlay-component-render-ui-shell\"\n hasCssBaseline\n languageCode={translationSettings.languageCode}\n shadowRootElement={uiShellAppElement}\n translationOverrides={translationSettings.translationOverrides}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <UiShellProvider\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n closeSideNavMenu={closeSideNavMenu}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n topNavBackgroundColor={topNavBackgroundColor}\n >\n {activeBreakpoint === \"narrow\" && (\n <NarrowUiShellContent\n {...componentProps}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n\n {(activeBreakpoint === \"medium\" || activeBreakpoint === \"wide\") && (\n <WideUiShellContent\n {...{\n ...componentProps,\n ...{\n sideNavProps: {\n ...componentProps.sideNavProps,\n hasSessionStorageState: activeBreakpoint === \"wide\",\n isCollapsed:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsed,\n isCollapsible:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsible,\n logoProps:\n componentProps.sideNavProps?.logoProps ||\n componentProps.logoProps,\n } as typeof componentProps.sideNavProps, // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\nMemoizedUiShell.displayName = \"UiShell\";\n\nexport { MemoizedUiShell as UiShell };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAMA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,qBAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AAA6D,IAAAO,WAAA,GAAAP,OAAA;AAhC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBO,MAAMQ,qBAA+C,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EAC7DE,YAAY,EAAEC,SAAS;EACvBC,WAAW,EAAED;AACf,CAAU;AAcV,MAAME,0BAAsD,GAAG,CAAC,CAAC;AAEjE,MAAMC,cAAc,GAAG,IAAAP,WAAA,CAAAQ,GAAA;EAAK;AAAU,CAAE,CAAC;AA2DzC,MAAMC,OAAO,GAAGA,CAAC;EACfC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU;EACVC,uBAAuB;EACvBC,gBAAgB;EAChBC,gBAAgB;EAChBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,qBAAqB;EACrBC,kBAAkB;EAClBC,sBAAsB;EACtBC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,2BAA2B;EAC3BC,sBAAsB;EACtBC,8BAA8B;EAC9BC,qBAAqB;EACrBC,iBAAiB;EACjBC;AACY,CAAC,KAAK;EAClB,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAG,IAAAC,eAAQ,EAACjC,qBAAqB,CAAC;EAC3E,MAAM,CAACkC,mBAAmB,EAAEC,sBAAsB,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ACPP,cAAc,CAAC7B,YAAY,EAAEoC,SAAS,IACtCP,cAAc,CAACO;cACnB;YACF,CAAC;YAEH3B,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjD6C,eAAe,EAAEC,OAAO,CAAC3B,cAAc,CAAC7B,YAAY,CAAE;YACtDa,4BAA4B,EAAEA,4BAA6B;YAC3DC,sBAAsB,EAAEA,sBAAuB;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF;QAAA,CACc;MAAC,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAM0C,eAAe,GAAA9D,OAAA,CAAAO,OAAA,GAAG,IAAAwD,WAAI,EAACxD,OAAO,CAAC;AACrCuD,eAAe,CAACE,WAAW,yCAAY","ignoreList":[]}
@@ -72,5 +72,5 @@ const UiShellLogo = ({
72
72
  });
73
73
  };
74
74
  const MemoizedUiShellLogo = exports.UiShellLogo = (0, _react.memo)(UiShellLogo);
75
- MemoizedUiShellLogo.displayName = "UiShellLogo::pkg=odyssey&odysseyV=1.70.0";
75
+ MemoizedUiShellLogo.displayName = "UiShellLogo::pkg=odyssey&odysseyV=1.71.0";
76
76
  //# sourceMappingURL=UiShellLogo.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiShellProvider.cjs","names":["_react","require","_createContrastColors","_OdysseyDesignTokensContext","_createMessageBus","_jsxRuntime","defaultCloseSideNavMessageBus","exports","createMessageBus","defaultSubscribeToCloseRightSideMenu","UiShellContext","createContext","undefined","useUiShellContext","useContext","UiShellProvider","appBackgroundColor","appBackgroundContrastMode","children","closeSideNavMenu","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","topNavBackgroundColor","odysseyDesignTokens","useOdysseyDesignTokens","defaultedSideNavBackgroundColor","HueNeutralWhite","sideNavContrastColors","generateContrastColors","backgroundColor","backgroundContrastColor","isAppBackgroundHightContrast","defaultTopAndAppBackgroundColor","HueNeutral50","topNavColor","appContentBackgroundColor","memoizedContextValue","useMemo","publish","subscribe","jsx","Provider","value","MemoizedUiShellProvider","memo"],"sources":["../../../src/ui-shell/UiShellProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\n\nimport {\n ContrastColors,\n generateContrastColors,\n} from \"../createContrastColors.js\";\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { createMessageBus, MessageBus } from \"../tools/createMessageBus.js\";\nimport { ContrastMode } from \"../useContrastMode.js\";\n\nexport const defaultCloseSideNavMessageBus = createMessageBus();\nexport const defaultSubscribeToCloseRightSideMenu = () => () => {};\n\nexport type UiShellColors = {\n /**\n * Custom background color for the app content area.\n */\n appBackgroundColor: string;\n /**\n * Custom background color for the side nav area.\n */\n sideNavBackgroundColor: string;\n /**\n * Custom color for fonts and other contrasted colors in the side nav area. Other contrast colors are derived from this one.\n *\n * If not passed, it gets computed from Odyssey.\n */\n sideNavBackgroundContrastColor?: string;\n sideNavContrastColors?: ContrastColors;\n /**\n * Custom background color for the top nav area.\n */\n topNavBackgroundColor: string;\n};\n\nexport type UiShellContext = {\n /**\n * This is a callback that publishes a change to all subscribers listening for when to close the side nav.\n */\n closeSideNavMenu: MessageBus<void>[\"publish\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the right-side menu.\n */\n subscribeToCloseRightSideMenu: MessageBus<void>[\"subscribe\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the side nav.\n */\n subscribeToCloseSideNavMenu: MessageBus<void>[\"subscribe\"];\n} & UiShellColors;\n\nconst UiShellContext = createContext<UiShellContext | undefined>(undefined);\n\nexport const useUiShellContext = () => {\n return useContext(UiShellContext);\n};\n\nexport type UiShellProviderProps = {\n /**\n * Sets either a gray or white background color for the app content area.\n */\n appBackgroundContrastMode?: ContrastMode;\n} & Partial<UiShellContext>;\n\nconst UiShellProvider = ({\n appBackgroundColor,\n appBackgroundContrastMode = \"lowContrast\",\n children,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavBackgroundColor,\n}: PropsWithChildren<UiShellProviderProps>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const defaultedSideNavBackgroundColor =\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite;\n\n const sideNavContrastColors =\n defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite\n ? generateContrastColors({\n backgroundColor:\n sideNavBackgroundColor || defaultedSideNavBackgroundColor,\n backgroundContrastColor: sideNavBackgroundContrastColor,\n odysseyDesignTokens,\n })\n : undefined;\n\n const isAppBackgroundHightContrast =\n appBackgroundContrastMode === \"highContrast\";\n\n const defaultTopAndAppBackgroundColor = isAppBackgroundHightContrast\n ? odysseyDesignTokens.HueNeutralWhite\n : odysseyDesignTokens.HueNeutral50;\n\n const topNavColor = topNavBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const appContentBackgroundColor =\n appBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const memoizedContextValue = useMemo(\n () => ({\n appBackgroundColor: appContentBackgroundColor,\n closeSideNavMenu:\n closeSideNavMenu ?? defaultCloseSideNavMessageBus.publish,\n sideNavBackgroundColor:\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite,\n sideNavContrastColors,\n subscribeToCloseSideNavMenu:\n subscribeToCloseSideNavMenu ?? defaultCloseSideNavMessageBus.subscribe,\n subscribeToCloseRightSideMenu:\n subscribeToCloseRightSideMenu ?? defaultSubscribeToCloseRightSideMenu,\n topNavBackgroundColor: topNavColor,\n }),\n [\n appContentBackgroundColor,\n odysseyDesignTokens.HueNeutralWhite,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavContrastColors,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavColor,\n ],\n );\n\n return (\n <UiShellContext.Provider value={memoizedContextValue}>\n {children}\n </UiShellContext.Provider>\n );\n};\n\nconst MemoizedUiShellProvider = memo(UiShellProvider);\n\nexport { MemoizedUiShellProvider as UiShellProvider };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,qBAAA,GAAAD,OAAA;AAIA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAA4E,IAAAI,WAAA,GAAAJ,OAAA;AAzB5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBO,MAAMK,6BAA6B,GAAAC,OAAA,CAAAD,6BAAA,GAAG,IAAAE,kCAAgB,EAAC,CAAC;AACxD,MAAMC,oCAAoC,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAACF,OAAA,CAAAE,oCAAA,GAAAA,oCAAA;AAyCnE,MAAMC,cAAc,GAAG,IAAAC,oBAAa,EAA6BC,SAAS,CAAC;AAEpE,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrC,OAAO,IAAAC,iBAAU,EAACJ,cAAc,CAAC;AACnC,CAAC;AAACH,OAAA,CAAAM,iBAAA,GAAAA,iBAAA;AASF,MAAME,eAAe,GAAGA,CAAC;EACvBC,kBAAkB;EAClBC,yBAAyB,GAAG,aAAa;EACzCC,QAAQ;EACRC,gBAA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A,CAAAqC,GAAA,EAAChC,cAAc,CAACiC,QAAQ;IAACC,KAAK,EAAEN,oBAAqB;IAAApB,QAAA,EAClDA;EAAQ,CACc,CAAC;AAE9B,CAAC;AAED,MAAM2B,uBAAuB,GAAAtC,OAAA,CAAAQ,eAAA,GAAG,IAAA+B,WAAI,EAAC/B,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"UiShellProvider.cjs","names":["_react","require","_createContrastColors","_OdysseyDesignTokensContext","_createMessageBus","_jsxRuntime","defaultCloseSideNavMessageBus","exports","createMessageBus","defaultSubscribeToCloseRightSideMenu","UiShellContext","createContext","undefined","useUiShellContext","useContext","UiShellProvider","appBackgroundColor","appBackgroundContrastMode","children","closeSideNavMenu","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","topNavBackgroundColor","odysseyDesignTokens","useOdysseyDesignTokens","defaultedSideNavBackgroundColor","HueNeutralWhite","sideNavContrastColors","generateContrastColors","backgroundColor","backgroundContrastColor","isAppBackgroundHightContrast","defaultTopAndAppBackgroundColor","HueNeutral50","topNavColor","appContentBackgroundColor","memoizedContextValue","useMemo","publish","subscribe","jsx","Provider","value","MemoizedUiShellProvider","memo"],"sources":["../../../src/ui-shell/UiShellProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\n\nimport {\n ContrastColors,\n generateContrastColors,\n} from \"../createContrastColors.js\";\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { createMessageBus, MessageBus } from \"../tools/createMessageBus.js\";\nimport { ContrastMode } from \"../useContrastMode.js\";\n\nexport const defaultCloseSideNavMessageBus = createMessageBus();\nexport const defaultSubscribeToCloseRightSideMenu = () => () => {};\n\nexport type UiShellColors = {\n /**\n * Custom background color for the app content area.\n */\n appBackgroundColor: string;\n /**\n * Custom background color for the side nav area.\n */\n sideNavBackgroundColor: string;\n /**\n * Custom color for fonts and other contrasted colors in the side nav area. Other contrast colors are derived from this one.\n *\n * If not passed, it gets computed from Odyssey.\n */\n sideNavBackgroundContrastColor?: string;\n sideNavContrastColors?: ContrastColors;\n /**\n * Custom background color for the top nav area.\n */\n topNavBackgroundColor: string;\n};\n\nexport type UiShellContext = {\n /**\n * This is a callback that publishes a change to all subscribers listening for when to close the side nav.\n */\n closeSideNavMenu: MessageBus<void>[\"publish\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state. It allows UI Shell to listen for a publisher that asks us to close the right-side menu.\n */\n subscribeToCloseRightSideMenu: MessageBus<void>[\"subscribe\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state. It allows UI Shell to listen for a publisher that asks us to close the side nav.\n */\n subscribeToCloseSideNavMenu: MessageBus<void>[\"subscribe\"];\n} & UiShellColors;\n\nconst UiShellContext = createContext<UiShellContext | undefined>(undefined);\n\nexport const useUiShellContext = () => {\n return useContext(UiShellContext);\n};\n\nexport type UiShellProviderProps = {\n /**\n * Sets either a gray or white background color for the app content area.\n */\n appBackgroundContrastMode?: ContrastMode;\n} & Partial<UiShellContext>;\n\nconst UiShellProvider = ({\n appBackgroundColor,\n appBackgroundContrastMode = \"lowContrast\",\n children,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavBackgroundColor,\n}: PropsWithChildren<UiShellProviderProps>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const defaultedSideNavBackgroundColor =\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite;\n\n const sideNavContrastColors =\n defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite\n ? generateContrastColors({\n backgroundColor:\n sideNavBackgroundColor || defaultedSideNavBackgroundColor,\n backgroundContrastColor: sideNavBackgroundContrastColor,\n odysseyDesignTokens,\n })\n : undefined;\n\n const isAppBackgroundHightContrast =\n appBackgroundContrastMode === \"highContrast\";\n\n const defaultTopAndAppBackgroundColor = isAppBackgroundHightContrast\n ? odysseyDesignTokens.HueNeutralWhite\n : odysseyDesignTokens.HueNeutral50;\n\n const topNavColor = topNavBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const appContentBackgroundColor =\n appBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const memoizedContextValue = useMemo(\n () => ({\n appBackgroundColor: appContentBackgroundColor,\n closeSideNavMenu:\n closeSideNavMenu ?? defaultCloseSideNavMessageBus.publish,\n sideNavBackgroundColor:\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite,\n sideNavContrastColors,\n subscribeToCloseSideNavMenu:\n subscribeToCloseSideNavMenu ?? defaultCloseSideNavMessageBus.subscribe,\n subscribeToCloseRightSideMenu:\n subscribeToCloseRightSideMenu ?? defaultSubscribeToCloseRightSideMenu,\n topNavBackgroundColor: topNavColor,\n }),\n [\n appContentBackgroundColor,\n odysseyDesignTokens.HueNeutralWhite,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavContrastColors,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavColor,\n ],\n );\n\n return (\n <UiShellContext.Provider value={memoizedContextValue}>\n {children}\n </UiShellContext.Provider>\n );\n};\n\nconst MemoizedUiShellProvider = memo(UiShellProvider);\n\nexport { MemoizedUiShellProvider as UiShellProvider };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,qBAAA,GAAAD,OAAA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