@okta/odyssey-react-mui 1.71.1 → 1.73.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 (966) hide show
  1. package/README.md +15 -5
  2. package/dist/cjs/Accordion.cjs +1 -1
  3. package/dist/cjs/AnimationContext.cjs +1 -1
  4. package/dist/cjs/Autocomplete.cjs +1 -1
  5. package/dist/cjs/Badge.cjs +1 -1
  6. package/dist/cjs/Banner.cjs +1 -1
  7. package/dist/cjs/Box.cjs +1 -1
  8. package/dist/cjs/Breadcrumbs.cjs +1 -1
  9. package/dist/cjs/Buttons/BaseButton.cjs +4 -2
  10. package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
  11. package/dist/cjs/Buttons/BaseMenuButton.cjs +1 -1
  12. package/dist/cjs/Buttons/Button.cjs +1 -1
  13. package/dist/cjs/Buttons/MenuButton.cjs +1 -1
  14. package/dist/cjs/Buttons/MenuItem.cjs +1 -1
  15. package/dist/cjs/Callout.cjs +1 -1
  16. package/dist/cjs/Card.cjs +1 -1
  17. package/dist/cjs/CircularProgress.cjs +1 -1
  18. package/dist/cjs/ConditionalWrapper.cjs +1 -1
  19. package/dist/cjs/DataTable/DataTable.cjs +1 -1
  20. package/dist/cjs/DataTable/DataTableRowActions.cjs +1 -1
  21. package/dist/cjs/DataTable/DataTableSettings.cjs +1 -1
  22. package/dist/cjs/DatePickers/DateField.cjs +1 -1
  23. package/dist/cjs/DatePickers/DateFieldActionBar.cjs +1 -1
  24. package/dist/cjs/DatePickers/DateFieldLocalizationProvider.cjs +1 -1
  25. package/dist/cjs/DatePickers/DatePicker.cjs +1 -1
  26. package/dist/cjs/DatePickers/TimeZonePicker.cjs +1 -1
  27. package/dist/cjs/Dialog.cjs +10 -3
  28. package/dist/cjs/Dialog.cjs.map +1 -1
  29. package/dist/cjs/Drawer.cjs +14 -3
  30. package/dist/cjs/Drawer.cjs.map +1 -1
  31. package/dist/cjs/EmptyState.cjs +1 -1
  32. package/dist/cjs/ErrorMessageList.cjs +1 -1
  33. package/dist/cjs/Field.cjs +1 -1
  34. package/dist/cjs/FieldError.cjs +1 -1
  35. package/dist/cjs/FieldHint.cjs +1 -1
  36. package/dist/cjs/FieldLabel.cjs +1 -1
  37. package/dist/cjs/Fields/Checkbox.cjs +1 -1
  38. package/dist/cjs/Fields/CheckboxGroup.cjs +1 -1
  39. package/dist/cjs/Fields/Radio.cjs +1 -1
  40. package/dist/cjs/Fields/RadioGroup.cjs +1 -1
  41. package/dist/cjs/Fieldset.cjs +1 -1
  42. package/dist/cjs/FileUploader/FileUploadIllustration.cjs +1 -1
  43. package/dist/cjs/FileUploader/FileUploadPreview.cjs +1 -1
  44. package/dist/cjs/FileUploader/FileUploader.cjs +1 -1
  45. package/dist/cjs/Form.cjs +1 -1
  46. package/dist/cjs/FullScreenOverlay.cjs +20 -13
  47. package/dist/cjs/FullScreenOverlay.cjs.map +1 -1
  48. package/dist/cjs/FullScreenOverlayContext.cjs +19 -1
  49. package/dist/cjs/FullScreenOverlayContext.cjs.map +1 -1
  50. package/dist/cjs/HintLink.cjs +1 -1
  51. package/dist/cjs/IconWithTooltip.cjs +1 -1
  52. package/dist/cjs/Link.cjs +1 -1
  53. package/dist/cjs/MuiPropsChild.cjs +1 -1
  54. package/dist/cjs/NativeSelect.cjs +1 -1
  55. package/dist/cjs/OdysseyCacheProvider.cjs +11 -2
  56. package/dist/cjs/OdysseyCacheProvider.cjs.map +1 -1
  57. package/dist/cjs/OdysseyProvider.cjs +8 -1
  58. package/dist/cjs/OdysseyProvider.cjs.map +1 -1
  59. package/dist/cjs/OdysseyThemeProvider.cjs +61 -28
  60. package/dist/cjs/OdysseyThemeProvider.cjs.map +1 -1
  61. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs +1 -1
  62. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs.map +1 -1
  63. package/dist/cjs/Pagination/Pagination.cjs +37 -35
  64. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  65. package/dist/cjs/PasswordField.cjs +1 -1
  66. package/dist/cjs/ScreenReaderText.cjs +1 -1
  67. package/dist/cjs/SearchField.cjs +1 -1
  68. package/dist/cjs/Select.cjs +1 -1
  69. package/dist/cjs/Stack.cjs +1 -1
  70. package/dist/cjs/Status.cjs +1 -1
  71. package/dist/cjs/Surface.cjs +1 -1
  72. package/dist/cjs/Switch.cjs +3 -3
  73. package/dist/cjs/Switch.cjs.map +1 -1
  74. package/dist/cjs/Tabs.cjs +1 -1
  75. package/dist/cjs/Tag.cjs +31 -23
  76. package/dist/cjs/Tag.cjs.map +1 -1
  77. package/dist/cjs/TagList.cjs +1 -1
  78. package/dist/cjs/TextField.cjs +1 -1
  79. package/dist/cjs/Toast.cjs +1 -1
  80. package/dist/cjs/ToastStack.cjs +1 -2
  81. package/dist/cjs/ToastStack.cjs.map +1 -1
  82. package/dist/cjs/Tooltip.cjs +1 -1
  83. package/dist/cjs/Typography.cjs +12 -12
  84. package/dist/cjs/backdropStack.cjs +75 -0
  85. package/dist/cjs/backdropStack.cjs.map +1 -0
  86. package/dist/cjs/charts/BarChart.cjs +1 -1
  87. package/dist/cjs/charts/LineChart.cjs +1 -1
  88. package/dist/cjs/charts/components/ChartError.cjs +1 -1
  89. package/dist/cjs/charts/components/ChartFrame.cjs +1 -1
  90. package/dist/cjs/charts/components/ChartPopoverContent.cjs +1 -1
  91. package/dist/cjs/charts/utils/useStableValue.cjs +5 -3
  92. package/dist/cjs/charts/utils/useStableValue.cjs.map +1 -1
  93. package/dist/cjs/fullscreen/FullscreenButton.cjs +1 -1
  94. package/dist/cjs/fullscreen/FullscreenRegion.cjs +3 -1
  95. package/dist/cjs/fullscreen/FullscreenRegion.cjs.map +1 -1
  96. package/dist/cjs/{getTypedObjectKeys.cjs → getActionTintChannel.cjs} +7 -6
  97. package/dist/cjs/getActionTintChannel.cjs.map +1 -0
  98. package/dist/cjs/getColorSchemeDesignTokensOverride.cjs +33 -0
  99. package/dist/cjs/getColorSchemeDesignTokensOverride.cjs.map +1 -0
  100. package/dist/cjs/getDropShadowFilter.cjs +22 -0
  101. package/dist/cjs/getDropShadowFilter.cjs.map +1 -0
  102. package/dist/cjs/icons.generated/Add.cjs +1 -1
  103. package/dist/cjs/icons.generated/AddCircle.cjs +1 -1
  104. package/dist/cjs/icons.generated/Apps.cjs +1 -1
  105. package/dist/cjs/icons.generated/AppsSelected.cjs +1 -1
  106. package/dist/cjs/icons.generated/ArrowBottom.cjs +1 -1
  107. package/dist/cjs/icons.generated/ArrowDown.cjs +1 -1
  108. package/dist/cjs/icons.generated/ArrowLeft.cjs +1 -1
  109. package/dist/cjs/icons.generated/ArrowLowerLeft.cjs +1 -1
  110. package/dist/cjs/icons.generated/ArrowLowerRight.cjs +1 -1
  111. package/dist/cjs/icons.generated/ArrowRight.cjs +1 -1
  112. package/dist/cjs/icons.generated/ArrowTop.cjs +1 -1
  113. package/dist/cjs/icons.generated/ArrowUnsorted.cjs +1 -1
  114. package/dist/cjs/icons.generated/ArrowUp.cjs +1 -1
  115. package/dist/cjs/icons.generated/ArrowUpperLeft.cjs +1 -1
  116. package/dist/cjs/icons.generated/ArrowUpperRight.cjs +1 -1
  117. package/dist/cjs/icons.generated/Bug.cjs +1 -1
  118. package/dist/cjs/icons.generated/Calendar.cjs +1 -1
  119. package/dist/cjs/icons.generated/Call.cjs +1 -1
  120. package/dist/cjs/icons.generated/Chat.cjs +1 -1
  121. package/dist/cjs/icons.generated/Check.cjs +1 -1
  122. package/dist/cjs/icons.generated/CheckCircleFilled.cjs +1 -1
  123. package/dist/cjs/icons.generated/ChevronDown.cjs +1 -1
  124. package/dist/cjs/icons.generated/ChevronLeft.cjs +1 -1
  125. package/dist/cjs/icons.generated/ChevronRight.cjs +1 -1
  126. package/dist/cjs/icons.generated/ChevronUp.cjs +1 -1
  127. package/dist/cjs/icons.generated/Clock.cjs +1 -1
  128. package/dist/cjs/icons.generated/Close.cjs +1 -1
  129. package/dist/cjs/icons.generated/CloseCircleFilled.cjs +1 -1
  130. package/dist/cjs/icons.generated/CollapseLeft.cjs +1 -1
  131. package/dist/cjs/icons.generated/CollapseRight.cjs +1 -1
  132. package/dist/cjs/icons.generated/Copy.cjs +1 -1
  133. package/dist/cjs/icons.generated/Customizations.cjs +1 -1
  134. package/dist/cjs/icons.generated/CustomizationsSelected.cjs +1 -1
  135. package/dist/cjs/icons.generated/DangerDiamond.cjs +1 -1
  136. package/dist/cjs/icons.generated/DangerDiamondFilled.cjs +1 -1
  137. package/dist/cjs/icons.generated/Delete.cjs +1 -1
  138. package/dist/cjs/icons.generated/Deny.cjs +1 -1
  139. package/dist/cjs/icons.generated/Devices.cjs +1 -1
  140. package/dist/cjs/icons.generated/Directory.cjs +1 -1
  141. package/dist/cjs/icons.generated/DirectorySelected.cjs +1 -1
  142. package/dist/cjs/icons.generated/Documentation.cjs +1 -1
  143. package/dist/cjs/icons.generated/Download.cjs +1 -1
  144. package/dist/cjs/icons.generated/DragIndicator.cjs +1 -1
  145. package/dist/cjs/icons.generated/Edit.cjs +1 -1
  146. package/dist/cjs/icons.generated/ExpandLeft.cjs +1 -1
  147. package/dist/cjs/icons.generated/ExpandRight.cjs +1 -1
  148. package/dist/cjs/icons.generated/ExternalLink.cjs +1 -1
  149. package/dist/cjs/icons.generated/Filter.cjs +1 -1
  150. package/dist/cjs/icons.generated/Folder.cjs +1 -1
  151. package/dist/cjs/icons.generated/FullscreenEnter.cjs +1 -1
  152. package/dist/cjs/icons.generated/FullscreenExit.cjs +1 -1
  153. package/dist/cjs/icons.generated/Globe.cjs +1 -1
  154. package/dist/cjs/icons.generated/Grid.cjs +1 -1
  155. package/dist/cjs/icons.generated/Group.cjs +1 -1
  156. package/dist/cjs/icons.generated/Happy.cjs +1 -1
  157. package/dist/cjs/icons.generated/Hide.cjs +1 -1
  158. package/dist/cjs/icons.generated/Home.cjs +1 -1
  159. package/dist/cjs/icons.generated/HomeSelected.cjs +1 -1
  160. package/dist/cjs/icons.generated/IdentityGovernance.cjs +1 -1
  161. package/dist/cjs/icons.generated/IdentityGovernanceSelected.cjs +1 -1
  162. package/dist/cjs/icons.generated/InformationCircle.cjs +1 -1
  163. package/dist/cjs/icons.generated/InformationCircleFilled.cjs +1 -1
  164. package/dist/cjs/icons.generated/Link.cjs +1 -1
  165. package/dist/cjs/icons.generated/List.cjs +1 -1
  166. package/dist/cjs/icons.generated/Lock.cjs +1 -1
  167. package/dist/cjs/icons.generated/Menu.cjs +1 -1
  168. package/dist/cjs/icons.generated/More.cjs +1 -1
  169. package/dist/cjs/icons.generated/Neutral.cjs +1 -1
  170. package/dist/cjs/icons.generated/Notification.cjs +1 -1
  171. package/dist/cjs/icons.generated/Pause.cjs +1 -1
  172. package/dist/cjs/icons.generated/QuestionCircle.cjs +1 -1
  173. package/dist/cjs/icons.generated/QuestionCircleFilled.cjs +1 -1
  174. package/dist/cjs/icons.generated/Refresh.cjs +1 -1
  175. package/dist/cjs/icons.generated/Reports.cjs +1 -1
  176. package/dist/cjs/icons.generated/ReportsSelected.cjs +1 -1
  177. package/dist/cjs/icons.generated/Reset.cjs +1 -1
  178. package/dist/cjs/icons.generated/Resume.cjs +1 -1
  179. package/dist/cjs/icons.generated/Sad.cjs +1 -1
  180. package/dist/cjs/icons.generated/Same.cjs +1 -1
  181. package/dist/cjs/icons.generated/Search.cjs +1 -1
  182. package/dist/cjs/icons.generated/Security.cjs +1 -1
  183. package/dist/cjs/icons.generated/SecuritySelected.cjs +1 -1
  184. package/dist/cjs/icons.generated/Send.cjs +1 -1
  185. package/dist/cjs/icons.generated/Server.cjs +1 -1
  186. package/dist/cjs/icons.generated/Settings.cjs +1 -1
  187. package/dist/cjs/icons.generated/SettingsSelected.cjs +1 -1
  188. package/dist/cjs/icons.generated/Show.cjs +1 -1
  189. package/dist/cjs/icons.generated/Sparkle.cjs +1 -1
  190. package/dist/cjs/icons.generated/Subtract.cjs +1 -1
  191. package/dist/cjs/icons.generated/Sync.cjs +1 -1
  192. package/dist/cjs/icons.generated/ThumbsDown.cjs +1 -1
  193. package/dist/cjs/icons.generated/ThumbsUp.cjs +1 -1
  194. package/dist/cjs/icons.generated/Unlock.cjs +1 -1
  195. package/dist/cjs/icons.generated/Upload.cjs +1 -1
  196. package/dist/cjs/icons.generated/User.cjs +1 -1
  197. package/dist/cjs/icons.generated/Video.cjs +1 -1
  198. package/dist/cjs/icons.generated/Warning.cjs +1 -1
  199. package/dist/cjs/icons.generated/WarningFilled.cjs +1 -1
  200. package/dist/cjs/icons.generated/Workflows.cjs +1 -1
  201. package/dist/cjs/icons.generated/WorkflowsSelected.cjs +1 -1
  202. package/dist/cjs/index.cjs +46 -0
  203. package/dist/cjs/index.cjs.map +1 -1
  204. package/dist/cjs/isDeepEqual.cjs +93 -0
  205. package/dist/cjs/isDeepEqual.cjs.map +1 -0
  206. package/dist/cjs/labs/AppTile.cjs +1 -1
  207. package/dist/cjs/labs/DataFilters.cjs +2 -2
  208. package/dist/cjs/labs/DataTablePagination.cjs +1 -1
  209. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs +1 -1
  210. package/dist/cjs/labs/DataView/CardLayoutContent.cjs +2 -2
  211. package/dist/cjs/labs/DataView/DataCard.cjs +1 -1
  212. package/dist/cjs/labs/DataView/DataTable.cjs +1 -1
  213. package/dist/cjs/labs/DataView/DataView.cjs +6 -3
  214. package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
  215. package/dist/cjs/labs/DataView/DetailPanel.cjs +1 -1
  216. package/dist/cjs/labs/DataView/LayoutSwitcher.cjs +1 -1
  217. package/dist/cjs/labs/DataView/RowActions.cjs +1 -1
  218. package/dist/cjs/labs/DataView/TableLayoutContent.cjs +1 -1
  219. package/dist/cjs/labs/DataView/TableSettings.cjs +1 -1
  220. package/dist/cjs/labs/DatePickers/DateTimeField.cjs +1 -1
  221. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +1 -1
  222. package/dist/cjs/labs/GroupPicker.cjs +1 -0
  223. package/dist/cjs/labs/GroupPicker.cjs.map +1 -1
  224. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs +1 -1
  225. package/dist/cjs/labs/OdysseyPickers/Picker.cjs +1 -1
  226. package/dist/cjs/labs/OdysseyPickers/PickerVirtualizationListBox.cjs +1 -1
  227. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +1 -1
  228. package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +1 -1
  229. package/dist/cjs/labs/PageTemplate/DocumentationLink.cjs +1 -1
  230. package/dist/cjs/labs/PageTemplate/Layout.cjs +1 -1
  231. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +1 -1
  232. package/dist/cjs/labs/PaginatedTable.cjs +1 -1
  233. package/dist/cjs/labs/StaticTable.cjs +1 -1
  234. package/dist/cjs/labs/UserProfile.cjs +1 -1
  235. package/dist/cjs/labs/UserProfileMenuButton.cjs +1 -1
  236. package/dist/cjs/logos.generated/Duo.cjs +1 -1
  237. package/dist/cjs/logos.generated/GoogleAuth.cjs +1 -1
  238. package/dist/cjs/logos.generated/OktaVerify.cjs +1 -1
  239. package/dist/cjs/logos.generated/Persona.cjs +1 -1
  240. package/dist/cjs/logos.generated/SymantecVip.cjs +1 -1
  241. package/dist/cjs/logos.generated/Yubikey.cjs +1 -1
  242. package/dist/cjs/message-bus/messageGuards.cjs +1 -5
  243. package/dist/cjs/message-bus/messageGuards.cjs.map +1 -1
  244. package/dist/cjs/properties/ts/odyssey-react-mui.cjs +2 -0
  245. package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
  246. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +4 -0
  247. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
  248. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +5 -1
  249. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
  250. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +6 -2
  251. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
  252. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +4 -0
  253. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
  254. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +5 -1
  255. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
  256. package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs +4 -0
  257. package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs.map +1 -1
  258. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +5 -1
  259. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
  260. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +5 -1
  261. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
  262. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +6 -2
  263. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
  264. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +4 -0
  265. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
  266. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +4 -0
  267. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
  268. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +4 -0
  269. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
  270. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +7 -3
  271. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
  272. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +6 -2
  273. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
  274. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +6 -2
  275. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
  276. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +9 -5
  277. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
  278. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +4 -0
  279. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
  280. package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs +2 -0
  281. package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs.map +1 -1
  282. package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs +2 -0
  283. package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs.map +1 -1
  284. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +4 -0
  285. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
  286. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +4 -0
  287. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
  288. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +4 -0
  289. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
  290. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +5 -1
  291. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
  292. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +10 -6
  293. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
  294. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +4 -0
  295. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
  296. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +4 -0
  297. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
  298. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +5 -1
  299. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
  300. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +5 -1
  301. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
  302. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +5 -1
  303. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs.map +1 -1
  304. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +4 -0
  305. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
  306. package/dist/cjs/remUtils.cjs +1 -3
  307. package/dist/cjs/remUtils.cjs.map +1 -1
  308. package/dist/cjs/resolveColorSchemeDesignTokens.cjs +43 -0
  309. package/dist/cjs/resolveColorSchemeDesignTokens.cjs.map +1 -0
  310. package/dist/cjs/test-selectors/index.cjs.map +1 -1
  311. package/dist/cjs/test-selectors/sanityChecks.cjs +1 -19
  312. package/dist/cjs/test-selectors/sanityChecks.cjs.map +1 -1
  313. package/dist/cjs/theme/components/Backdrop.cjs +2 -1
  314. package/dist/cjs/theme/components/Backdrop.cjs.map +1 -1
  315. package/dist/cjs/theme/components/Button.cjs +7 -6
  316. package/dist/cjs/theme/components/Button.cjs.map +1 -1
  317. package/dist/cjs/theme/components/Checkbox.cjs +1 -1
  318. package/dist/cjs/theme/components/Checkbox.cjs.map +1 -1
  319. package/dist/cjs/theme/components/Chip.cjs +3 -1
  320. package/dist/cjs/theme/components/Chip.cjs.map +1 -1
  321. package/dist/cjs/theme/components/Dialog.cjs +6 -2
  322. package/dist/cjs/theme/components/Dialog.cjs.map +1 -1
  323. package/dist/cjs/theme/components/Paper.cjs +3 -0
  324. package/dist/cjs/theme/components/Paper.cjs.map +1 -1
  325. package/dist/cjs/theme/components/Tabs.cjs +7 -11
  326. package/dist/cjs/theme/components/Tabs.cjs.map +1 -1
  327. package/dist/cjs/theme/components/types.cjs.map +1 -1
  328. package/dist/cjs/theme/createOdysseyMuiTheme.cjs +3 -0
  329. package/dist/cjs/theme/createOdysseyMuiTheme.cjs.map +1 -1
  330. package/dist/cjs/theme/palette.cjs +14 -9
  331. package/dist/cjs/theme/palette.cjs.map +1 -1
  332. package/dist/cjs/ui-shell/AppSwitcher/AppSwitcher.cjs +10 -1
  333. package/dist/cjs/ui-shell/AppSwitcher/AppSwitcher.cjs.map +1 -1
  334. package/dist/cjs/ui-shell/InnerAppContainer.cjs +1 -1
  335. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +1 -1
  336. package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs +1 -1
  337. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +1 -1
  338. package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs +1 -1
  339. package/dist/cjs/ui-shell/SideNav/SideNavHeader.cjs +1 -1
  340. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs +2 -2
  341. package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +1 -1
  342. package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs +1 -1
  343. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +3 -3
  344. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs.map +1 -1
  345. package/dist/cjs/ui-shell/SkipToContent.cjs +1 -1
  346. package/dist/cjs/ui-shell/TopNav/HamburgerMenuIcon.cjs +1 -1
  347. package/dist/cjs/ui-shell/TopNav/TopNav.cjs +1 -1
  348. package/dist/cjs/ui-shell/UiShell.cjs +7 -2
  349. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  350. package/dist/cjs/ui-shell/UiShellLogo.cjs +24 -2
  351. package/dist/cjs/ui-shell/UiShellLogo.cjs.map +1 -1
  352. package/dist/cjs/ui-shell/WideUiShellContent.cjs +1 -1
  353. package/dist/cjs/ui-shell/renderUiShell.cjs +15 -0
  354. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  355. package/dist/cjs/useColorScheme.cjs +36 -0
  356. package/dist/cjs/useColorScheme.cjs.map +1 -0
  357. package/dist/cjs/useContrastMode.cjs +5 -4
  358. package/dist/cjs/useContrastMode.cjs.map +1 -1
  359. package/dist/cjs/useStackedBackdropProps.cjs +40 -0
  360. package/dist/cjs/useStackedBackdropProps.cjs.map +1 -0
  361. package/dist/cjs/useThemeCache.cjs +22 -14
  362. package/dist/cjs/useThemeCache.cjs.map +1 -1
  363. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  364. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  365. package/dist/esm/Accordion.js +1 -1
  366. package/dist/esm/AnimationContext.js +1 -1
  367. package/dist/esm/Autocomplete.js +1 -1
  368. package/dist/esm/Badge.js +1 -1
  369. package/dist/esm/Banner.js +1 -1
  370. package/dist/esm/Box.js +1 -1
  371. package/dist/esm/Breadcrumbs.js +1 -1
  372. package/dist/esm/Buttons/BaseButton.js +4 -2
  373. package/dist/esm/Buttons/BaseButton.js.map +1 -1
  374. package/dist/esm/Buttons/BaseMenuButton.js +1 -1
  375. package/dist/esm/Buttons/Button.js +1 -1
  376. package/dist/esm/Buttons/MenuButton.js +1 -1
  377. package/dist/esm/Buttons/MenuItem.js +1 -1
  378. package/dist/esm/Callout.js +1 -1
  379. package/dist/esm/Card.js +1 -1
  380. package/dist/esm/CircularProgress.js +1 -1
  381. package/dist/esm/ConditionalWrapper.js +1 -1
  382. package/dist/esm/DataTable/DataTable.js +1 -1
  383. package/dist/esm/DataTable/DataTableRowActions.js +1 -1
  384. package/dist/esm/DataTable/DataTableSettings.js +1 -1
  385. package/dist/esm/DatePickers/DateField.js +1 -1
  386. package/dist/esm/DatePickers/DateFieldActionBar.js +1 -1
  387. package/dist/esm/DatePickers/DateFieldLocalizationProvider.js +1 -1
  388. package/dist/esm/DatePickers/DatePicker.js +1 -1
  389. package/dist/esm/DatePickers/TimeZonePicker.js +1 -1
  390. package/dist/esm/Dialog.js +10 -3
  391. package/dist/esm/Dialog.js.map +1 -1
  392. package/dist/esm/Drawer.js +14 -3
  393. package/dist/esm/Drawer.js.map +1 -1
  394. package/dist/esm/EmptyState.js +1 -1
  395. package/dist/esm/ErrorMessageList.js +1 -1
  396. package/dist/esm/Field.js +1 -1
  397. package/dist/esm/FieldError.js +1 -1
  398. package/dist/esm/FieldHint.js +1 -1
  399. package/dist/esm/FieldLabel.js +1 -1
  400. package/dist/esm/Fields/Checkbox.js +1 -1
  401. package/dist/esm/Fields/CheckboxGroup.js +1 -1
  402. package/dist/esm/Fields/Radio.js +1 -1
  403. package/dist/esm/Fields/RadioGroup.js +1 -1
  404. package/dist/esm/Fieldset.js +1 -1
  405. package/dist/esm/FileUploader/FileUploadIllustration.js +1 -1
  406. package/dist/esm/FileUploader/FileUploadPreview.js +1 -1
  407. package/dist/esm/FileUploader/FileUploader.js +1 -1
  408. package/dist/esm/Form.js +1 -1
  409. package/dist/esm/FullScreenOverlay.js +21 -12
  410. package/dist/esm/FullScreenOverlay.js.map +1 -1
  411. package/dist/esm/FullScreenOverlayContext.js +19 -1
  412. package/dist/esm/FullScreenOverlayContext.js.map +1 -1
  413. package/dist/esm/HintLink.js +1 -1
  414. package/dist/esm/IconWithTooltip.js +1 -1
  415. package/dist/esm/Link.js +1 -1
  416. package/dist/esm/MuiPropsChild.js +1 -1
  417. package/dist/esm/NativeSelect.js +1 -1
  418. package/dist/esm/OdysseyCacheProvider.js +12 -3
  419. package/dist/esm/OdysseyCacheProvider.js.map +1 -1
  420. package/dist/esm/OdysseyProvider.js +8 -1
  421. package/dist/esm/OdysseyProvider.js.map +1 -1
  422. package/dist/esm/OdysseyThemeProvider.js +61 -26
  423. package/dist/esm/OdysseyThemeProvider.js.map +1 -1
  424. package/dist/esm/OdysseyThemeProviderPropsContext.js +1 -1
  425. package/dist/esm/OdysseyThemeProviderPropsContext.js.map +1 -1
  426. package/dist/esm/Pagination/Pagination.js +37 -35
  427. package/dist/esm/Pagination/Pagination.js.map +1 -1
  428. package/dist/esm/PasswordField.js +1 -1
  429. package/dist/esm/ScreenReaderText.js +1 -1
  430. package/dist/esm/SearchField.js +1 -1
  431. package/dist/esm/Select.js +1 -1
  432. package/dist/esm/Stack.js +1 -1
  433. package/dist/esm/Status.js +1 -1
  434. package/dist/esm/Surface.js +1 -1
  435. package/dist/esm/Switch.js +3 -3
  436. package/dist/esm/Switch.js.map +1 -1
  437. package/dist/esm/Tabs.js +1 -1
  438. package/dist/esm/Tag.js +31 -23
  439. package/dist/esm/Tag.js.map +1 -1
  440. package/dist/esm/TagList.js +1 -1
  441. package/dist/esm/TextField.js +1 -1
  442. package/dist/esm/Toast.js +1 -1
  443. package/dist/esm/ToastStack.js +1 -2
  444. package/dist/esm/ToastStack.js.map +1 -1
  445. package/dist/esm/Tooltip.js +1 -1
  446. package/dist/esm/Typography.js +12 -12
  447. package/dist/esm/backdropStack.js +68 -0
  448. package/dist/esm/backdropStack.js.map +1 -0
  449. package/dist/esm/charts/BarChart.js +1 -1
  450. package/dist/esm/charts/LineChart.js +1 -1
  451. package/dist/esm/charts/components/ChartError.js +1 -1
  452. package/dist/esm/charts/components/ChartFrame.js +1 -1
  453. package/dist/esm/charts/components/ChartPopoverContent.js +1 -1
  454. package/dist/esm/charts/utils/useStableValue.js +5 -2
  455. package/dist/esm/charts/utils/useStableValue.js.map +1 -1
  456. package/dist/esm/fullscreen/FullscreenButton.js +1 -1
  457. package/dist/esm/fullscreen/FullscreenRegion.js +3 -1
  458. package/dist/esm/fullscreen/FullscreenRegion.js.map +1 -1
  459. package/dist/esm/{getTypedObjectKeys.js → getActionTintChannel.js} +5 -5
  460. package/dist/esm/getActionTintChannel.js.map +1 -0
  461. package/dist/esm/getColorSchemeDesignTokensOverride.js +27 -0
  462. package/dist/esm/getColorSchemeDesignTokensOverride.js.map +1 -0
  463. package/dist/{types/getTypedObjectKeys.d.ts → esm/getDropShadowFilter.js} +6 -4
  464. package/dist/esm/getDropShadowFilter.js.map +1 -0
  465. package/dist/esm/icons.generated/Add.js +1 -1
  466. package/dist/esm/icons.generated/AddCircle.js +1 -1
  467. package/dist/esm/icons.generated/Apps.js +1 -1
  468. package/dist/esm/icons.generated/AppsSelected.js +1 -1
  469. package/dist/esm/icons.generated/ArrowBottom.js +1 -1
  470. package/dist/esm/icons.generated/ArrowDown.js +1 -1
  471. package/dist/esm/icons.generated/ArrowLeft.js +1 -1
  472. package/dist/esm/icons.generated/ArrowLowerLeft.js +1 -1
  473. package/dist/esm/icons.generated/ArrowLowerRight.js +1 -1
  474. package/dist/esm/icons.generated/ArrowRight.js +1 -1
  475. package/dist/esm/icons.generated/ArrowTop.js +1 -1
  476. package/dist/esm/icons.generated/ArrowUnsorted.js +1 -1
  477. package/dist/esm/icons.generated/ArrowUp.js +1 -1
  478. package/dist/esm/icons.generated/ArrowUpperLeft.js +1 -1
  479. package/dist/esm/icons.generated/ArrowUpperRight.js +1 -1
  480. package/dist/esm/icons.generated/Bug.js +1 -1
  481. package/dist/esm/icons.generated/Calendar.js +1 -1
  482. package/dist/esm/icons.generated/Call.js +1 -1
  483. package/dist/esm/icons.generated/Chat.js +1 -1
  484. package/dist/esm/icons.generated/Check.js +1 -1
  485. package/dist/esm/icons.generated/CheckCircleFilled.js +1 -1
  486. package/dist/esm/icons.generated/ChevronDown.js +1 -1
  487. package/dist/esm/icons.generated/ChevronLeft.js +1 -1
  488. package/dist/esm/icons.generated/ChevronRight.js +1 -1
  489. package/dist/esm/icons.generated/ChevronUp.js +1 -1
  490. package/dist/esm/icons.generated/Clock.js +1 -1
  491. package/dist/esm/icons.generated/Close.js +1 -1
  492. package/dist/esm/icons.generated/CloseCircleFilled.js +1 -1
  493. package/dist/esm/icons.generated/CollapseLeft.js +1 -1
  494. package/dist/esm/icons.generated/CollapseRight.js +1 -1
  495. package/dist/esm/icons.generated/Copy.js +1 -1
  496. package/dist/esm/icons.generated/Customizations.js +1 -1
  497. package/dist/esm/icons.generated/CustomizationsSelected.js +1 -1
  498. package/dist/esm/icons.generated/DangerDiamond.js +1 -1
  499. package/dist/esm/icons.generated/DangerDiamondFilled.js +1 -1
  500. package/dist/esm/icons.generated/Delete.js +1 -1
  501. package/dist/esm/icons.generated/Deny.js +1 -1
  502. package/dist/esm/icons.generated/Devices.js +1 -1
  503. package/dist/esm/icons.generated/Directory.js +1 -1
  504. package/dist/esm/icons.generated/DirectorySelected.js +1 -1
  505. package/dist/esm/icons.generated/Documentation.js +1 -1
  506. package/dist/esm/icons.generated/Download.js +1 -1
  507. package/dist/esm/icons.generated/DragIndicator.js +1 -1
  508. package/dist/esm/icons.generated/Edit.js +1 -1
  509. package/dist/esm/icons.generated/ExpandLeft.js +1 -1
  510. package/dist/esm/icons.generated/ExpandRight.js +1 -1
  511. package/dist/esm/icons.generated/ExternalLink.js +1 -1
  512. package/dist/esm/icons.generated/Filter.js +1 -1
  513. package/dist/esm/icons.generated/Folder.js +1 -1
  514. package/dist/esm/icons.generated/FullscreenEnter.js +1 -1
  515. package/dist/esm/icons.generated/FullscreenExit.js +1 -1
  516. package/dist/esm/icons.generated/Globe.js +1 -1
  517. package/dist/esm/icons.generated/Grid.js +1 -1
  518. package/dist/esm/icons.generated/Group.js +1 -1
  519. package/dist/esm/icons.generated/Happy.js +1 -1
  520. package/dist/esm/icons.generated/Hide.js +1 -1
  521. package/dist/esm/icons.generated/Home.js +1 -1
  522. package/dist/esm/icons.generated/HomeSelected.js +1 -1
  523. package/dist/esm/icons.generated/IdentityGovernance.js +1 -1
  524. package/dist/esm/icons.generated/IdentityGovernanceSelected.js +1 -1
  525. package/dist/esm/icons.generated/InformationCircle.js +1 -1
  526. package/dist/esm/icons.generated/InformationCircleFilled.js +1 -1
  527. package/dist/esm/icons.generated/Link.js +1 -1
  528. package/dist/esm/icons.generated/List.js +1 -1
  529. package/dist/esm/icons.generated/Lock.js +1 -1
  530. package/dist/esm/icons.generated/Menu.js +1 -1
  531. package/dist/esm/icons.generated/More.js +1 -1
  532. package/dist/esm/icons.generated/Neutral.js +1 -1
  533. package/dist/esm/icons.generated/Notification.js +1 -1
  534. package/dist/esm/icons.generated/Pause.js +1 -1
  535. package/dist/esm/icons.generated/QuestionCircle.js +1 -1
  536. package/dist/esm/icons.generated/QuestionCircleFilled.js +1 -1
  537. package/dist/esm/icons.generated/Refresh.js +1 -1
  538. package/dist/esm/icons.generated/Reports.js +1 -1
  539. package/dist/esm/icons.generated/ReportsSelected.js +1 -1
  540. package/dist/esm/icons.generated/Reset.js +1 -1
  541. package/dist/esm/icons.generated/Resume.js +1 -1
  542. package/dist/esm/icons.generated/Sad.js +1 -1
  543. package/dist/esm/icons.generated/Same.js +1 -1
  544. package/dist/esm/icons.generated/Search.js +1 -1
  545. package/dist/esm/icons.generated/Security.js +1 -1
  546. package/dist/esm/icons.generated/SecuritySelected.js +1 -1
  547. package/dist/esm/icons.generated/Send.js +1 -1
  548. package/dist/esm/icons.generated/Server.js +1 -1
  549. package/dist/esm/icons.generated/Settings.js +1 -1
  550. package/dist/esm/icons.generated/SettingsSelected.js +1 -1
  551. package/dist/esm/icons.generated/Show.js +1 -1
  552. package/dist/esm/icons.generated/Sparkle.js +1 -1
  553. package/dist/esm/icons.generated/Subtract.js +1 -1
  554. package/dist/esm/icons.generated/Sync.js +1 -1
  555. package/dist/esm/icons.generated/ThumbsDown.js +1 -1
  556. package/dist/esm/icons.generated/ThumbsUp.js +1 -1
  557. package/dist/esm/icons.generated/Unlock.js +1 -1
  558. package/dist/esm/icons.generated/Upload.js +1 -1
  559. package/dist/esm/icons.generated/User.js +1 -1
  560. package/dist/esm/icons.generated/Video.js +1 -1
  561. package/dist/esm/icons.generated/Warning.js +1 -1
  562. package/dist/esm/icons.generated/WarningFilled.js +1 -1
  563. package/dist/esm/icons.generated/Workflows.js +1 -1
  564. package/dist/esm/icons.generated/WorkflowsSelected.js +1 -1
  565. package/dist/esm/index.js +4 -0
  566. package/dist/esm/index.js.map +1 -1
  567. package/dist/esm/isDeepEqual.js +86 -0
  568. package/dist/esm/isDeepEqual.js.map +1 -0
  569. package/dist/esm/labs/AppTile.js +1 -1
  570. package/dist/esm/labs/DataFilters.js +2 -2
  571. package/dist/esm/labs/DataTablePagination.js +1 -1
  572. package/dist/esm/labs/DataView/BulkActionsMenu.js +1 -1
  573. package/dist/esm/labs/DataView/CardLayoutContent.js +2 -2
  574. package/dist/esm/labs/DataView/DataCard.js +1 -1
  575. package/dist/esm/labs/DataView/DataTable.js +1 -1
  576. package/dist/esm/labs/DataView/DataView.js +6 -3
  577. package/dist/esm/labs/DataView/DataView.js.map +1 -1
  578. package/dist/esm/labs/DataView/DetailPanel.js +1 -1
  579. package/dist/esm/labs/DataView/LayoutSwitcher.js +1 -1
  580. package/dist/esm/labs/DataView/RowActions.js +1 -1
  581. package/dist/esm/labs/DataView/TableLayoutContent.js +1 -1
  582. package/dist/esm/labs/DataView/TableSettings.js +1 -1
  583. package/dist/esm/labs/DatePickers/DateTimeField.js +1 -1
  584. package/dist/esm/labs/DatePickers/DateTimePicker.js +1 -1
  585. package/dist/esm/labs/GroupPicker.js +1 -0
  586. package/dist/esm/labs/GroupPicker.js.map +1 -1
  587. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js +1 -1
  588. package/dist/esm/labs/OdysseyPickers/Picker.js +1 -1
  589. package/dist/esm/labs/OdysseyPickers/PickerVirtualizationListBox.js +1 -1
  590. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +1 -1
  591. package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +1 -1
  592. package/dist/esm/labs/PageTemplate/DocumentationLink.js +1 -1
  593. package/dist/esm/labs/PageTemplate/Layout.js +1 -1
  594. package/dist/esm/labs/PageTemplate/PageTemplate.js +1 -1
  595. package/dist/esm/labs/PaginatedTable.js +1 -1
  596. package/dist/esm/labs/StaticTable.js +1 -1
  597. package/dist/esm/labs/UserProfile.js +1 -1
  598. package/dist/esm/labs/UserProfileMenuButton.js +1 -1
  599. package/dist/esm/logos.generated/Duo.js +1 -1
  600. package/dist/esm/logos.generated/GoogleAuth.js +1 -1
  601. package/dist/esm/logos.generated/OktaVerify.js +1 -1
  602. package/dist/esm/logos.generated/Persona.js +1 -1
  603. package/dist/esm/logos.generated/SymantecVip.js +1 -1
  604. package/dist/esm/logos.generated/Yubikey.js +1 -1
  605. package/dist/esm/message-bus/messageGuards.js +0 -2
  606. package/dist/esm/message-bus/messageGuards.js.map +1 -1
  607. package/dist/esm/properties/ts/odyssey-react-mui.js +2 -0
  608. package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
  609. package/dist/esm/properties/ts/odyssey-react-mui_cs.js +4 -0
  610. package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  611. package/dist/esm/properties/ts/odyssey-react-mui_da.js +5 -1
  612. package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
  613. package/dist/esm/properties/ts/odyssey-react-mui_de.js +6 -2
  614. package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
  615. package/dist/esm/properties/ts/odyssey-react-mui_el.js +4 -0
  616. package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
  617. package/dist/esm/properties/ts/odyssey-react-mui_es.js +5 -1
  618. package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
  619. package/dist/esm/properties/ts/odyssey-react-mui_eu.js +4 -0
  620. package/dist/esm/properties/ts/odyssey-react-mui_eu.js.map +1 -1
  621. package/dist/esm/properties/ts/odyssey-react-mui_fi.js +5 -1
  622. package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  623. package/dist/esm/properties/ts/odyssey-react-mui_fr.js +5 -1
  624. package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  625. package/dist/esm/properties/ts/odyssey-react-mui_ht.js +6 -2
  626. package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  627. package/dist/esm/properties/ts/odyssey-react-mui_hu.js +4 -0
  628. package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  629. package/dist/esm/properties/ts/odyssey-react-mui_id.js +4 -0
  630. package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
  631. package/dist/esm/properties/ts/odyssey-react-mui_it.js +4 -0
  632. package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
  633. package/dist/esm/properties/ts/odyssey-react-mui_ja.js +7 -3
  634. package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  635. package/dist/esm/properties/ts/odyssey-react-mui_ko.js +6 -2
  636. package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  637. package/dist/esm/properties/ts/odyssey-react-mui_ms.js +6 -2
  638. package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  639. package/dist/esm/properties/ts/odyssey-react-mui_nb.js +9 -5
  640. package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  641. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +4 -0
  642. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  643. package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js +2 -0
  644. package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
  645. package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js +2 -0
  646. package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
  647. package/dist/esm/properties/ts/odyssey-react-mui_pl.js +4 -0
  648. package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  649. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +4 -0
  650. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  651. package/dist/esm/properties/ts/odyssey-react-mui_ro.js +4 -0
  652. package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  653. package/dist/esm/properties/ts/odyssey-react-mui_ru.js +5 -1
  654. package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  655. package/dist/esm/properties/ts/odyssey-react-mui_sv.js +10 -6
  656. package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  657. package/dist/esm/properties/ts/odyssey-react-mui_th.js +4 -0
  658. package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
  659. package/dist/esm/properties/ts/odyssey-react-mui_tr.js +4 -0
  660. package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  661. package/dist/esm/properties/ts/odyssey-react-mui_uk.js +5 -1
  662. package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  663. package/dist/esm/properties/ts/odyssey-react-mui_vi.js +5 -1
  664. package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  665. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +5 -1
  666. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  667. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +4 -0
  668. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  669. package/dist/esm/remUtils.js +0 -1
  670. package/dist/esm/remUtils.js.map +1 -1
  671. package/dist/esm/resolveColorSchemeDesignTokens.js +37 -0
  672. package/dist/esm/resolveColorSchemeDesignTokens.js.map +1 -0
  673. package/dist/esm/test-selectors/index.js.map +1 -1
  674. package/dist/esm/test-selectors/sanityChecks.js +0 -15
  675. package/dist/esm/test-selectors/sanityChecks.js.map +1 -1
  676. package/dist/esm/theme/components/Backdrop.js +2 -1
  677. package/dist/esm/theme/components/Backdrop.js.map +1 -1
  678. package/dist/esm/theme/components/Button.js +7 -6
  679. package/dist/esm/theme/components/Button.js.map +1 -1
  680. package/dist/esm/theme/components/Checkbox.js +1 -1
  681. package/dist/esm/theme/components/Checkbox.js.map +1 -1
  682. package/dist/esm/theme/components/Chip.js +3 -1
  683. package/dist/esm/theme/components/Chip.js.map +1 -1
  684. package/dist/esm/theme/components/Dialog.js +6 -2
  685. package/dist/esm/theme/components/Dialog.js.map +1 -1
  686. package/dist/esm/theme/components/Paper.js +3 -0
  687. package/dist/esm/theme/components/Paper.js.map +1 -1
  688. package/dist/esm/theme/components/Tabs.js +7 -11
  689. package/dist/esm/theme/components/Tabs.js.map +1 -1
  690. package/dist/esm/theme/components/types.js.map +1 -1
  691. package/dist/esm/theme/createOdysseyMuiTheme.js +3 -0
  692. package/dist/esm/theme/createOdysseyMuiTheme.js.map +1 -1
  693. package/dist/esm/theme/palette.js +14 -9
  694. package/dist/esm/theme/palette.js.map +1 -1
  695. package/dist/esm/ui-shell/AppSwitcher/AppSwitcher.js +10 -1
  696. package/dist/esm/ui-shell/AppSwitcher/AppSwitcher.js.map +1 -1
  697. package/dist/esm/ui-shell/InnerAppContainer.js +1 -1
  698. package/dist/esm/ui-shell/NarrowUiShellContent.js +1 -1
  699. package/dist/esm/ui-shell/SideNav/NavAccordion.js +1 -1
  700. package/dist/esm/ui-shell/SideNav/SideNav.js +1 -1
  701. package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js +1 -1
  702. package/dist/esm/ui-shell/SideNav/SideNavHeader.js +1 -1
  703. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js +2 -2
  704. package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +1 -1
  705. package/dist/esm/ui-shell/SideNav/SideNavSortableList.js +1 -1
  706. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +3 -3
  707. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js.map +1 -1
  708. package/dist/esm/ui-shell/SkipToContent.js +1 -1
  709. package/dist/esm/ui-shell/TopNav/HamburgerMenuIcon.js +1 -1
  710. package/dist/esm/ui-shell/TopNav/TopNav.js +1 -1
  711. package/dist/esm/ui-shell/UiShell.js +7 -2
  712. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  713. package/dist/esm/ui-shell/UiShellLogo.js +23 -2
  714. package/dist/esm/ui-shell/UiShellLogo.js.map +1 -1
  715. package/dist/esm/ui-shell/WideUiShellContent.js +1 -1
  716. package/dist/esm/ui-shell/renderUiShell.js +15 -0
  717. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  718. package/dist/esm/useColorScheme.js +30 -0
  719. package/dist/esm/useColorScheme.js.map +1 -0
  720. package/dist/esm/useContrastMode.js +5 -4
  721. package/dist/esm/useContrastMode.js.map +1 -1
  722. package/dist/esm/useStackedBackdropProps.js +35 -0
  723. package/dist/esm/useStackedBackdropProps.js.map +1 -0
  724. package/dist/esm/useThemeCache.js +22 -14
  725. package/dist/esm/useThemeCache.js.map +1 -1
  726. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  727. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  728. package/dist/tsconfig.production.tsbuildinfo +1 -1
  729. package/dist/types/Buttons/BaseButton.d.ts +5 -1
  730. package/dist/types/Buttons/BaseButton.d.ts.map +1 -1
  731. package/dist/types/Dialog.d.ts.map +1 -1
  732. package/dist/types/Drawer.d.ts.map +1 -1
  733. package/dist/types/FullScreenOverlay.d.ts +4 -1
  734. package/dist/types/FullScreenOverlay.d.ts.map +1 -1
  735. package/dist/types/FullScreenOverlayContext.d.ts +5 -0
  736. package/dist/types/FullScreenOverlayContext.d.ts.map +1 -1
  737. package/dist/types/OdysseyCacheProvider.d.ts +6 -1
  738. package/dist/types/OdysseyCacheProvider.d.ts.map +1 -1
  739. package/dist/types/OdysseyDesignTokensContext.d.ts +3 -0
  740. package/dist/types/OdysseyDesignTokensContext.d.ts.map +1 -1
  741. package/dist/types/OdysseyProvider.d.ts +2 -2
  742. package/dist/types/OdysseyProvider.d.ts.map +1 -1
  743. package/dist/types/OdysseyThemeProvider.d.ts +9 -1
  744. package/dist/types/OdysseyThemeProvider.d.ts.map +1 -1
  745. package/dist/types/OdysseyThemeProviderPropsContext.d.ts +10 -2
  746. package/dist/types/OdysseyThemeProviderPropsContext.d.ts.map +1 -1
  747. package/dist/types/Pagination/Pagination.d.ts.map +1 -1
  748. package/dist/types/Tag.d.ts.map +1 -1
  749. package/dist/types/backdropStack.d.ts +41 -0
  750. package/dist/types/backdropStack.d.ts.map +1 -0
  751. package/dist/types/charts/utils/useStableValue.d.ts.map +1 -1
  752. package/dist/types/fullscreen/FullscreenRegion.d.ts.map +1 -1
  753. package/dist/types/getActionTintChannel.d.ts +18 -0
  754. package/dist/types/getActionTintChannel.d.ts.map +1 -0
  755. package/dist/types/getColorSchemeDesignTokensOverride.d.ts +46 -0
  756. package/dist/types/getColorSchemeDesignTokensOverride.d.ts.map +1 -0
  757. package/dist/types/getDropShadowFilter.d.ts +17 -0
  758. package/dist/types/getDropShadowFilter.d.ts.map +1 -0
  759. package/dist/types/i18n.generated/i18n.d.ts +4 -0
  760. package/dist/types/i18n.generated/i18n.d.ts.map +1 -1
  761. package/dist/types/i18n.generated/i18n.resources.d.ts +148 -30
  762. package/dist/types/i18n.generated/i18n.resources.d.ts.map +1 -1
  763. package/dist/types/index.d.ts +4 -0
  764. package/dist/types/index.d.ts.map +1 -1
  765. package/dist/types/isDeepEqual.d.ts +22 -0
  766. package/dist/types/isDeepEqual.d.ts.map +1 -0
  767. package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
  768. package/dist/types/labs/GroupPicker.d.ts +2 -1
  769. package/dist/types/labs/GroupPicker.d.ts.map +1 -1
  770. package/dist/types/message-bus/messageGuards.d.ts +0 -8
  771. package/dist/types/message-bus/messageGuards.d.ts.map +1 -1
  772. package/dist/types/properties/ts/odyssey-react-mui.d.ts +2 -0
  773. package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  774. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +4 -0
  775. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  776. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts +5 -1
  777. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  778. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts +6 -2
  779. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  780. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts +4 -0
  781. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  782. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts +5 -1
  783. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  784. package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts +4 -0
  785. package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts.map +1 -1
  786. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +5 -1
  787. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  788. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts +5 -1
  789. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  790. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +6 -2
  791. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  792. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts +4 -0
  793. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  794. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts +4 -0
  795. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  796. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts +4 -0
  797. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  798. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts +7 -3
  799. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  800. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts +6 -2
  801. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  802. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts +6 -2
  803. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  804. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts +9 -5
  805. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  806. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts +4 -0
  807. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  808. package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts +2 -0
  809. package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
  810. package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts +2 -0
  811. package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
  812. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +4 -0
  813. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  814. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts +4 -0
  815. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  816. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts +4 -0
  817. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  818. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts +5 -1
  819. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  820. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts +10 -6
  821. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  822. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts +4 -0
  823. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  824. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts +4 -0
  825. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  826. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts +5 -1
  827. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  828. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts +5 -1
  829. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  830. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts +5 -1
  831. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  832. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +4 -0
  833. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  834. package/dist/types/remUtils.d.ts +0 -4
  835. package/dist/types/remUtils.d.ts.map +1 -1
  836. package/dist/types/resolveColorSchemeDesignTokens.d.ts +25 -0
  837. package/dist/types/resolveColorSchemeDesignTokens.d.ts.map +1 -0
  838. package/dist/types/test-selectors/index.d.ts +1 -1
  839. package/dist/types/test-selectors/sanityChecks.d.ts +0 -3
  840. package/dist/types/test-selectors/sanityChecks.d.ts.map +1 -1
  841. package/dist/types/theme/components/Backdrop.d.ts.map +1 -1
  842. package/dist/types/theme/components/Button.d.ts +1 -1
  843. package/dist/types/theme/components/Button.d.ts.map +1 -1
  844. package/dist/types/theme/components/Chip.d.ts +1 -1
  845. package/dist/types/theme/components/Chip.d.ts.map +1 -1
  846. package/dist/types/theme/components/Dialog.d.ts.map +1 -1
  847. package/dist/types/theme/components/Paper.d.ts.map +1 -1
  848. package/dist/types/theme/components/Tabs.d.ts +1 -1
  849. package/dist/types/theme/components/Tabs.d.ts.map +1 -1
  850. package/dist/types/theme/components/types.d.ts +5 -0
  851. package/dist/types/theme/components/types.d.ts.map +1 -1
  852. package/dist/types/theme/createOdysseyMuiTheme.d.ts +8 -1
  853. package/dist/types/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  854. package/dist/types/theme/palette.d.ts +3 -1
  855. package/dist/types/theme/palette.d.ts.map +1 -1
  856. package/dist/types/ui-shell/AppSwitcher/AppSwitcher.d.ts.map +1 -1
  857. package/dist/types/ui-shell/UiShell.d.ts +8 -1
  858. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  859. package/dist/types/ui-shell/UiShellLogo.d.ts.map +1 -1
  860. package/dist/types/ui-shell/renderUiShell.d.ts +12 -1
  861. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  862. package/dist/types/useColorScheme.d.ts +41 -0
  863. package/dist/types/useColorScheme.d.ts.map +1 -0
  864. package/dist/types/useContrastMode.d.ts +16 -5
  865. package/dist/types/useContrastMode.d.ts.map +1 -1
  866. package/dist/types/useStackedBackdropProps.d.ts +36 -0
  867. package/dist/types/useStackedBackdropProps.d.ts.map +1 -0
  868. package/dist/types/useThemeCache.d.ts +15 -6
  869. package/dist/types/useThemeCache.d.ts.map +1 -1
  870. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  871. package/package.json +19 -38
  872. package/src/properties/odyssey-react-mui.properties +158 -0
  873. package/src/properties/translations/odyssey-react-mui_cs.properties +156 -0
  874. package/src/properties/translations/odyssey-react-mui_da.properties +156 -0
  875. package/src/properties/translations/odyssey-react-mui_de.properties +156 -0
  876. package/src/properties/translations/odyssey-react-mui_el.properties +156 -0
  877. package/src/properties/translations/odyssey-react-mui_es.properties +156 -0
  878. package/src/properties/translations/odyssey-react-mui_eu.properties +156 -0
  879. package/src/properties/translations/odyssey-react-mui_fi.properties +156 -0
  880. package/src/properties/translations/odyssey-react-mui_fr.properties +156 -0
  881. package/src/properties/translations/odyssey-react-mui_ht.properties +156 -0
  882. package/src/properties/translations/odyssey-react-mui_hu.properties +156 -0
  883. package/src/properties/translations/odyssey-react-mui_id.properties +156 -0
  884. package/src/properties/translations/odyssey-react-mui_it.properties +156 -0
  885. package/src/properties/translations/odyssey-react-mui_ja.properties +156 -0
  886. package/src/properties/translations/odyssey-react-mui_ko.properties +156 -0
  887. package/src/properties/translations/odyssey-react-mui_ms.properties +156 -0
  888. package/src/properties/translations/odyssey-react-mui_nb.properties +156 -0
  889. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +156 -0
  890. package/src/properties/translations/odyssey-react-mui_ok_PL.properties +149 -0
  891. package/src/properties/translations/odyssey-react-mui_ok_SK.properties +149 -0
  892. package/src/properties/translations/odyssey-react-mui_pl.properties +156 -0
  893. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +156 -0
  894. package/src/properties/translations/odyssey-react-mui_ro.properties +156 -0
  895. package/src/properties/translations/odyssey-react-mui_ru.properties +156 -0
  896. package/src/properties/translations/odyssey-react-mui_sv.properties +156 -0
  897. package/src/properties/translations/odyssey-react-mui_th.properties +156 -0
  898. package/src/properties/translations/odyssey-react-mui_tr.properties +156 -0
  899. package/src/properties/translations/odyssey-react-mui_uk.properties +156 -0
  900. package/src/properties/translations/odyssey-react-mui_vi.properties +156 -0
  901. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +156 -0
  902. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +156 -0
  903. package/src/properties/ts/odyssey-react-mui.ts +1 -0
  904. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -0
  905. package/src/properties/ts/odyssey-react-mui_da.ts +1 -0
  906. package/src/properties/ts/odyssey-react-mui_de.ts +1 -0
  907. package/src/properties/ts/odyssey-react-mui_el.ts +1 -0
  908. package/src/properties/ts/odyssey-react-mui_es.ts +1 -0
  909. package/src/properties/ts/odyssey-react-mui_eu.ts +1 -0
  910. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -0
  911. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -0
  912. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -0
  913. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -0
  914. package/src/properties/ts/odyssey-react-mui_id.ts +1 -0
  915. package/src/properties/ts/odyssey-react-mui_it.ts +1 -0
  916. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -0
  917. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -0
  918. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -0
  919. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -0
  920. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -0
  921. package/src/properties/ts/odyssey-react-mui_ok_PL.ts +1 -0
  922. package/src/properties/ts/odyssey-react-mui_ok_SK.ts +1 -0
  923. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -0
  924. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -0
  925. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -0
  926. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -0
  927. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -0
  928. package/src/properties/ts/odyssey-react-mui_th.ts +1 -0
  929. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -0
  930. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -0
  931. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -0
  932. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -0
  933. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -0
  934. package/dist/cjs/getTypedObjectKeys.cjs.map +0 -1
  935. package/dist/cjs/labs/DataTable.cjs +0 -485
  936. package/dist/cjs/labs/DataTable.cjs.map +0 -1
  937. package/dist/cjs/test-utils/getControlledElement.cjs +0 -48
  938. package/dist/cjs/test-utils/getControlledElement.cjs.map +0 -1
  939. package/dist/cjs/test-utils/renderWithOdysseyProvider.cjs +0 -47
  940. package/dist/cjs/test-utils/renderWithOdysseyProvider.cjs.map +0 -1
  941. package/dist/cjs/ui-shell/TopNav/TopNavLinksList.cjs +0 -43
  942. package/dist/cjs/ui-shell/TopNav/TopNavLinksList.cjs.map +0 -1
  943. package/dist/cjs/ui-shell/TopNav/TopNavListItem.cjs +0 -137
  944. package/dist/cjs/ui-shell/TopNav/TopNavListItem.cjs.map +0 -1
  945. package/dist/esm/getTypedObjectKeys.js.map +0 -1
  946. package/dist/esm/labs/DataTable.js +0 -478
  947. package/dist/esm/labs/DataTable.js.map +0 -1
  948. package/dist/esm/test-utils/getControlledElement.js +0 -41
  949. package/dist/esm/test-utils/getControlledElement.js.map +0 -1
  950. package/dist/esm/test-utils/renderWithOdysseyProvider.js +0 -42
  951. package/dist/esm/test-utils/renderWithOdysseyProvider.js.map +0 -1
  952. package/dist/esm/ui-shell/TopNav/TopNavLinksList.js +0 -37
  953. package/dist/esm/ui-shell/TopNav/TopNavLinksList.js.map +0 -1
  954. package/dist/esm/ui-shell/TopNav/TopNavListItem.js +0 -131
  955. package/dist/esm/ui-shell/TopNav/TopNavListItem.js.map +0 -1
  956. package/dist/types/getTypedObjectKeys.d.ts.map +0 -1
  957. package/dist/types/labs/DataTable.d.ts +0 -186
  958. package/dist/types/labs/DataTable.d.ts.map +0 -1
  959. package/dist/types/test-utils/getControlledElement.d.ts +0 -26
  960. package/dist/types/test-utils/getControlledElement.d.ts.map +0 -1
  961. package/dist/types/test-utils/renderWithOdysseyProvider.d.ts +0 -37
  962. package/dist/types/test-utils/renderWithOdysseyProvider.d.ts.map +0 -1
  963. package/dist/types/ui-shell/TopNav/TopNavLinksList.d.ts +0 -44
  964. package/dist/types/ui-shell/TopNav/TopNavLinksList.d.ts.map +0 -1
  965. package/dist/types/ui-shell/TopNav/TopNavListItem.d.ts +0 -41
  966. package/dist/types/ui-shell/TopNav/TopNavListItem.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"UiShell.js","names":["memo","useEffect","useState","ErrorBoundary","createFullscreenModeHost","OdysseyProvider","NarrowUiShellContent","UiShellProvider","useUiShellBreakpoints","WideUiShellContent","jsx","_jsx","jsxs","_jsxs","defaultComponentProps","sideNavProps","undefined","topNavProps","defaultTranslationSettings","errorComponent","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","connectFullscreenState","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","subscribeToTranslationSettings","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","translationSettings","setTranslationSettings","activeBreakpoint","logoProps","Error","fullscreenModeHost","disconnectFullscreenState","destroy","unsubscribeFromPropChanges","unsubscribeFromTranslationSettings","nextSettings","fallback","children","emotionRootElement","fullScreenOverlayId","hasCssBaseline","languageCode","shadowRootElement","translationOverrides","hasSideNavProps","Boolean","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","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 { createFullscreenModeHost } from \"../message-bus/index.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 * Called once the shell's fullscreen mode host is running. The function it returns is called when the shell unmounts, before the host stops.\n *\n * `renderUiShell` passes this so the fullscreen state it returns only listens to the page while the shell is on it.\n */\n connectFullscreenState?: () => () => void;\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 connectFullscreenState,\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 // Only one UI Shell renders on a page, while any number of apps can, so the shell is where the page's fullscreen stack lives. Destroying it on unmount clears the stack, so the app never stays in fullscreen with no shell to bring the navigation back.\n useEffect(() => {\n const fullscreenModeHost = createFullscreenModeHost();\n const disconnectFullscreenState = connectFullscreenState?.();\n\n return () => {\n disconnectFullscreenState?.();\n fullscreenModeHost.destroy();\n };\n }, [connectFullscreenState]);\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":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAuBC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACtE,SAASC,aAAa,QAAQ,sBAAsB;AAMpD,SAASC,wBAAwB,QAAQ,yBAAyB;AAClE,SAASC,eAAe,QAAQ,uBAAuB;AAGvD,SAASC,oBAAoB,QAAQ,2BAA2B;AAKhE,SAASC,eAAe,QAA8B,sBAAsB;AAC5E,SAEEC,qBAAqB,QAChB,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7D,OAAO,MAAMC,qBAA+C,GAAG;EAC7DC,YAAY,EAAEC,SAAS;EACvBC,WAAW,EAAED;AACf,CAAU;AAcV,MAAME,0BAAsD,GAAG,CAAC,CAAC;AAEjE,MAAMC,cAAc,GAAGR,IAAA;EAAK;AAAU,CAAE,CAAC;AAiEzC,MAAMS,OAAO,GAAGA,CAAC;EACfC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU;EACVC,uBAAuB;EACvBC,gBAAgB;EAChBC,gBAAgB;EAChBC,sBAAsB;EACtBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KA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KAC5DrC,IAAA,CAACF,kBAAkB;YAEf,GAAGmC,cAAc;YACjB,GAAG;cACD7B,YAAY,EAAE;gBACZ,GAAG6B,cAAc,CAAC7B,YAAY;gBAC9BoD,sBAAsB,EAAEnB,gBAAgB,KAAK,MAAM;gBACnDoB,WAAW,EACTpB,gBAAgB,KAAK,QAAQ,IAC7BJ,cAAc,CAAC7B,YAAY,EAAEqD,WAAW;gBAC1CC,aAAa,EACXrB,gBAAgB,KAAK,QAAQ,IAC7BJ,cAAc,CAAC7B,YAAY,EAAEsD,aAAa;gBAC5CpB,SAAS,EACPL,cAAc,CAAC7B,YAAY,EAAEkC,SAAS,IACtCL,cAAc,CAACK;cACnB;YACF,CAAC;YAEH1B,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjDyC,eAAe,EAAEC,OAAO,CAACtB,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,MAAMoC,eAAe,GAAGtE,IAAI,CAACoB,OAAO,CAAC;AACrCkD,eAAe,CAACC,WAAW,yCAAY;AAEvC,SAASD,eAAe,IAAIlD,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"UiShell.js","names":["memo","useEffect","useState","ErrorBoundary","createFullscreenModeHost","OdysseyProvider","NarrowUiShellContent","UiShellProvider","useUiShellBreakpoints","WideUiShellContent","jsx","_jsx","jsxs","_jsxs","defaultComponentProps","sideNavProps","undefined","topNavProps","defaultTranslationSettings","errorComponent","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","connectFullscreenState","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToColorScheme","subscribeToPropChanges","subscribeToTranslationSettings","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","translationSettings","setTranslationSettings","colorScheme","setColorScheme","activeBreakpoint","logoProps","Error","fullscreenModeHost","disconnectFullscreenState","destroy","unsubscribeFromPropChanges","unsubscribeFromTranslationSettings","nextSettings","unsubscribeFromColorScheme","fallback","children","emotionRootElement","fullScreenOverlayId","hasCssBaseline","languageCode","shadowRootElement","translationOverrides","hasSideNavProps","Boolean","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","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 { createFullscreenModeHost } from \"../message-bus/index.js\";\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { MessageBus } from \"../tools/createMessageBus.js\";\nimport { type ColorScheme } from \"../useColorScheme.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 * Called once the shell's fullscreen mode host is running. The function it returns is called when the shell unmounts, before the host stops.\n *\n * `renderUiShell` passes this so the fullscreen state it returns only listens to the page while the shell is on it.\n */\n connectFullscreenState?: () => () => void;\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 * Subscriber for runtime color scheme changes, forwarded to the shell's internal `OdysseyProvider`.\n *\n * Optional for backward compatibility. When omitted, the shell renders `light`.\n */\n subscribeToColorScheme?: MessageBus<ColorScheme>[\"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 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 connectFullscreenState,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToColorScheme,\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 const [colorScheme, setColorScheme] = useState<ColorScheme>();\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 // Only one UI Shell renders on a page, while any number of apps can, so the shell is where the page's fullscreen stack lives. Destroying it on unmount clears the stack, so the app never stays in fullscreen with no shell to bring the navigation back.\n useEffect(() => {\n const fullscreenModeHost = createFullscreenModeHost();\n const disconnectFullscreenState = connectFullscreenState?.();\n\n return () => {\n disconnectFullscreenState?.();\n fullscreenModeHost.destroy();\n };\n }, [connectFullscreenState]);\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 // Every subscriber 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 const unsubscribeFromColorScheme = subscribeToColorScheme?.(setColorScheme);\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribeFromPropChanges();\n unsubscribeFromTranslationSettings?.();\n unsubscribeFromColorScheme?.();\n };\n }, [\n onSubscriptionCreated,\n subscribeToColorScheme,\n subscribeToPropChanges,\n subscribeToTranslationSettings,\n ]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n colorScheme={colorScheme}\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":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EA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C,aAAa,EACXtB,gBAAgB,KAAK,QAAQ,IAC7BN,cAAc,CAAC9B,YAAY,EAAE0D,aAAa;gBAC5CrB,SAAS,EACPP,cAAc,CAAC9B,YAAY,EAAEqC,SAAS,IACtCP,cAAc,CAACO;cACnB;YACF,CAAC;YAEH7B,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjD6C,eAAe,EAAEC,OAAO,CAACzB,cAAc,CAAC9B,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,MAAMwC,eAAe,GAAG1E,IAAI,CAACoB,OAAO,CAAC;AACrCsD,eAAe,CAACC,WAAW,yCAAY;AAEvC,SAASD,eAAe,IAAItD,OAAO","ignoreList":[]}
@@ -11,7 +11,10 @@
11
11
  */
12
12
 
13
13
  import styled from "@emotion/styled";
14
+ import * as lightModeDesignTokens from "@okta/odyssey-design-tokens";
14
15
  import { memo, useMemo } from "react";
16
+ import { createOdysseyStyledComponent } from "../createOdysseyStyledComponent.js";
17
+ import { useColorScheme } from "../useColorScheme.js";
15
18
  import { OktaLogo } from "./SideNav/OktaLogo.js";
16
19
  import { jsx as _jsx } from "react/jsx-runtime";
17
20
  const StyledLogoContainer = styled("div", {
@@ -31,13 +34,28 @@ const StyledLogoLink = styled("a")(() => ({
31
34
  display: "flex",
32
35
  height: "100%"
33
36
  }));
37
+ const StyledDarkModeLogoPlate = createOdysseyStyledComponent({
38
+ tag: "span"
39
+ })(({
40
+ odysseyDesignTokens
41
+ }) => ({
42
+ alignItems: "center",
43
+ backgroundColor: lightModeDesignTokens.PaletteNeutralSurface,
44
+ borderRadius: odysseyDesignTokens.BorderRadiusTight,
45
+ boxSizing: "border-box",
46
+ display: "flex",
47
+ height: "100%",
48
+ paddingBlock: odysseyDesignTokens.Spacing1,
49
+ paddingInline: odysseyDesignTokens.Spacing2
50
+ }));
34
51
  const UiShellLogo = ({
35
52
  imageAltText,
36
53
  imageUrl,
37
54
  logoComponent,
38
55
  ...optionalProps
39
56
  }) => {
40
- const logo = useMemo(() => {
57
+ const colorScheme = useColorScheme();
58
+ const logoArtwork = useMemo(() => {
41
59
  if (logoComponent) {
42
60
  return logoComponent;
43
61
  }
@@ -49,6 +67,9 @@ const UiShellLogo = ({
49
67
  }
50
68
  return _jsx(OktaLogo, {});
51
69
  }, [imageAltText, logoComponent, imageUrl]);
70
+ const logo = colorScheme === "dark" ? _jsx(StyledDarkModeLogoPlate, {
71
+ children: logoArtwork
72
+ }) : logoArtwork;
52
73
  return "href" in optionalProps && "ariaLabel" in optionalProps ? _jsx(StyledLogoLink, {
53
74
  "aria-label": optionalProps.ariaLabel,
54
75
  "data-se": "sidenav-header-logo",
@@ -65,6 +86,6 @@ const UiShellLogo = ({
65
86
  });
66
87
  };
67
88
  const MemoizedUiShellLogo = memo(UiShellLogo);
68
- MemoizedUiShellLogo.displayName = "UiShellLogo::pkg=odyssey&odysseyV=1.71.1";
89
+ MemoizedUiShellLogo.displayName = "UiShellLogo::pkg=odyssey&odysseyV=1.73.0";
69
90
  export { MemoizedUiShellLogo as UiShellLogo };
70
91
  //# sourceMappingURL=UiShellLogo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiShellLogo.js","names":["styled","memo","useMemo","OktaLogo","jsx","_jsx","StyledLogoContainer","shouldForwardProp","prop","isLogoInteractive","alignItems","display","height","cursor","StyledLogoLink","UiShellLogo","imageAltText","imageUrl","logoComponent","optionalProps","logo","alt","src","ariaLabel","href","onClick","children","Boolean","role","MemoizedUiShellLogo","displayName"],"sources":["../../../src/ui-shell/UiShellLogo.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 memo,\n type MouseEventHandler,\n type ReactElement,\n useMemo,\n} from \"react\";\n\nimport { OktaLogo } from \"./SideNav/OktaLogo.js\";\n\nconst StyledLogoContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"isLogoInteractive\",\n})<{\n isLogoInteractive?: boolean;\n}>(({ isLogoInteractive }) => ({\n alignItems: \"center\",\n display: \"flex\",\n height: \"100%\",\n\n ...(isLogoInteractive && {\n cursor: \"pointer\",\n }),\n}));\n\nconst StyledLogoLink = styled(\"a\")(() => ({\n alignItems: \"center\",\n display: \"flex\",\n height: \"100%\",\n}));\n\nexport type UiShellLogoProps = {\n isSameBackgroundAsMain?: boolean;\n /**\n * Event fired when the logo is clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement | HTMLAnchorElement>;\n} & (\n | {\n ariaLabel: string;\n href: string;\n }\n | {\n ariaLabel?: never;\n href?: never;\n }\n) &\n (\n | {\n imageAltText?: never;\n imageUrl?: never;\n /**\n * a component to render as the logo\n */\n logoComponent: ReactElement;\n }\n | {\n /**\n * alt text for the img logo\n */\n imageAltText: string;\n /**\n * The src url to render in an `img` tag\n */\n imageUrl: string;\n logoComponent?: never;\n }\n | {\n /**\n * alt text for the img logo\n */\n imageAltText?: never;\n /**\n * The src url to render in an `img` tag\n */\n imageUrl?: never;\n logoComponent?: never;\n }\n );\n\nconst UiShellLogo = ({\n imageAltText,\n imageUrl,\n logoComponent,\n ...optionalProps\n}: UiShellLogoProps) => {\n const logo = useMemo(() => {\n if (logoComponent) {\n return logoComponent;\n }\n\n if (imageAltText && imageUrl) {\n return <img alt={imageAltText} src={imageUrl} />;\n }\n\n return <OktaLogo />;\n }, [imageAltText, logoComponent, imageUrl]);\n\n return \"href\" in optionalProps && \"ariaLabel\" in optionalProps ? (\n <StyledLogoLink\n aria-label={optionalProps.ariaLabel}\n data-se=\"sidenav-header-logo\"\n href={optionalProps.href}\n onClick={optionalProps.onClick}\n >\n {logo}\n </StyledLogoLink>\n ) : (\n <StyledLogoContainer\n aria-label={optionalProps.ariaLabel}\n data-se=\"sidenav-header-logo\"\n isLogoInteractive={Boolean(optionalProps.onClick) || optionalProps.href}\n onClick={optionalProps.onClick}\n role=\"presentation\"\n >\n {logo}\n </StyledLogoContainer>\n );\n};\n\nconst MemoizedUiShellLogo = memo(UiShellLogo);\nMemoizedUiShellLogo.displayName = \"UiShellLogo\";\n\nexport { MemoizedUiShellLogo as UiShellLogo };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,IAAI,EAGJC,OAAO,QACF,OAAO;AAEd,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,MAAMC,mBAAmB,GAAGN,MAAM,CAAC,KAAK,EAAE;EACxCO,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAkB,CAAC,MAAM;EAC7BC,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,MAAM;EACfC,MAAM,EAAE,MAAM;EAEd,IAAIH,iBAAiB,IAAI;IACvBI,MAAM,EAAE;EACV,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAMC,cAAc,GAAGd,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO;EACxCU,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,MAAM;EACfC,MAAM,EAAE;AACV,CAAC,CAAC,CAAC;AAmDH,MAAMG,WAAW,GAAGA,CAAC;EACnBC,YAAY;EACZC,QAAQ;EACRC,aAAa;EACb,GAAGC;AACa,CAAC,KAAK;EACtB,MAAMC,IAAI,GAAGlB,OAAO,CAAC,MAAM;IACzB,IAAIgB,aAAa,EAAE;MACjB,OAAOA,aAAa;IACtB;IAEA,IAAIF,YAAY,IAAIC,QAAQ,EAAE;MAC5B,OAAOZ,IAAA;QAAKgB,GAAG,EAAEL,YAAa;QAACM,GAAG,EAAEL;MAAS,CAAE,CAAC;IAClD;IAEA,OAAOZ,IAAA,CAACF,QAAQ,IAAE,CAAC;EACrB,CAAC,EAAE,CAACa,YAAY,EAAEE,aAAa,EAAED,QAAQ,CAAC,CAAC;EAE3C,OAAO,MAAM,IAAIE,aAAa,IAAI,WAAW,IAAIA,aAAa,GAC5Dd,IAAA,CAACS,cAAc;IACb,cAAYK,aAAa,CAACI,SAAU;IACpC,WAAQ,qBAAqB;IAC7BC,IAAI,EAAEL,aAAa,CAACK,IAAK;IACzBC,OAAO,EAAEN,aAAa,CAACM,OAAQ;IAAAC,QAAA,EAE9BN;EAAI,CACS,CAAC,GAEjBf,IAAA,CAACC,mBAAmB;IAClB,cAAYa,aAAa,CAACI,SAAU;IACpC,WAAQ,qBAAqB;IAC7Bd,iBAAiB,EAAEkB,OAAO,CAACR,aAAa,CAACM,OAAO,CAAC,IAAIN,aAAa,CAACK,IAAK;IACxEC,OAAO,EAAEN,aAAa,CAACM,OAAQ;IAC/BG,IAAI,EAAC,cAAc;IAAAF,QAAA,EAElBN;EAAI,CACc,CACtB;AACH,CAAC;AAED,MAAMS,mBAAmB,GAAG5B,IAAI,CAACc,WAAW,CAAC;AAC7Cc,mBAAmB,CAACC,WAAW,6CAAgB;AAE/C,SAASD,mBAAmB,IAAId,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"UiShellLogo.js","names":["styled","lightModeDesignTokens","memo","useMemo","createOdysseyStyledComponent","useColorScheme","OktaLogo","jsx","_jsx","StyledLogoContainer","shouldForwardProp","prop","isLogoInteractive","alignItems","display","height","cursor","StyledLogoLink","StyledDarkModeLogoPlate","tag","odysseyDesignTokens","backgroundColor","PaletteNeutralSurface","borderRadius","BorderRadiusTight","boxSizing","paddingBlock","Spacing1","paddingInline","Spacing2","UiShellLogo","imageAltText","imageUrl","logoComponent","optionalProps","colorScheme","logoArtwork","alt","src","logo","children","ariaLabel","href","onClick","Boolean","role","MemoizedUiShellLogo","displayName"],"sources":["../../../src/ui-shell/UiShellLogo.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 * as lightModeDesignTokens from \"@okta/odyssey-design-tokens\";\nimport {\n memo,\n type MouseEventHandler,\n type ReactElement,\n useMemo,\n} from \"react\";\n\nimport { createOdysseyStyledComponent } from \"../createOdysseyStyledComponent.js\";\nimport { useColorScheme } from \"../useColorScheme.js\";\nimport { OktaLogo } from \"./SideNav/OktaLogo.js\";\n\nconst StyledLogoContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"isLogoInteractive\",\n})<{\n isLogoInteractive?: boolean;\n}>(({ isLogoInteractive }) => ({\n alignItems: \"center\",\n display: \"flex\",\n height: \"100%\",\n\n ...(isLogoInteractive && {\n cursor: \"pointer\",\n }),\n}));\n\nconst StyledLogoLink = styled(\"a\")(() => ({\n alignItems: \"center\",\n display: \"flex\",\n height: \"100%\",\n}));\n\n// Brand logos are drawn for a light background and are often dark or low-contrast on a dark one, so dark mode sets them on a light-mode surface rather than recoloring artwork the shell does not own.\nconst StyledDarkModeLogoPlate = createOdysseyStyledComponent({ tag: \"span\" })(\n ({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n backgroundColor: lightModeDesignTokens.PaletteNeutralSurface,\n borderRadius: odysseyDesignTokens.BorderRadiusTight,\n boxSizing: \"border-box\",\n display: \"flex\",\n height: \"100%\",\n paddingBlock: odysseyDesignTokens.Spacing1,\n paddingInline: odysseyDesignTokens.Spacing2,\n }),\n);\n\nexport type UiShellLogoProps = {\n isSameBackgroundAsMain?: boolean;\n /**\n * Event fired when the logo is clicked\n */\n onClick?: MouseEventHandler<HTMLDivElement | HTMLAnchorElement>;\n} & (\n | {\n ariaLabel: string;\n href: string;\n }\n | {\n ariaLabel?: never;\n href?: never;\n }\n) &\n (\n | {\n imageAltText?: never;\n imageUrl?: never;\n /**\n * a component to render as the logo\n */\n logoComponent: ReactElement;\n }\n | {\n /**\n * alt text for the img logo\n */\n imageAltText: string;\n /**\n * The src url to render in an `img` tag\n */\n imageUrl: string;\n logoComponent?: never;\n }\n | {\n /**\n * alt text for the img logo\n */\n imageAltText?: never;\n /**\n * The src url to render in an `img` tag\n */\n imageUrl?: never;\n logoComponent?: never;\n }\n );\n\nconst UiShellLogo = ({\n imageAltText,\n imageUrl,\n logoComponent,\n ...optionalProps\n}: UiShellLogoProps) => {\n const colorScheme = useColorScheme();\n\n const logoArtwork = useMemo(() => {\n if (logoComponent) {\n return logoComponent;\n }\n\n if (imageAltText && imageUrl) {\n return <img alt={imageAltText} src={imageUrl} />;\n }\n\n return <OktaLogo />;\n }, [imageAltText, logoComponent, imageUrl]);\n\n const logo =\n colorScheme === \"dark\" ? (\n <StyledDarkModeLogoPlate>{logoArtwork}</StyledDarkModeLogoPlate>\n ) : (\n logoArtwork\n );\n\n return \"href\" in optionalProps && \"ariaLabel\" in optionalProps ? (\n <StyledLogoLink\n aria-label={optionalProps.ariaLabel}\n data-se=\"sidenav-header-logo\"\n href={optionalProps.href}\n onClick={optionalProps.onClick}\n >\n {logo}\n </StyledLogoLink>\n ) : (\n <StyledLogoContainer\n aria-label={optionalProps.ariaLabel}\n data-se=\"sidenav-header-logo\"\n isLogoInteractive={Boolean(optionalProps.onClick) || optionalProps.href}\n onClick={optionalProps.onClick}\n role=\"presentation\"\n >\n {logo}\n </StyledLogoContainer>\n );\n};\n\nconst MemoizedUiShellLogo = memo(UiShellLogo);\nMemoizedUiShellLogo.displayName = \"UiShellLogo\";\n\nexport { MemoizedUiShellLogo as UiShellLogo };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,OAAO,KAAKC,qBAAqB,MAAM,6BAA6B;AACpE,SACEC,IAAI,EAGJC,OAAO,QACF,OAAO;AAEd,SAASC,4BAA4B,QAAQ,oCAAoC;AACjF,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,MAAMC,mBAAmB,GAAGT,MAAM,CAAC,KAAK,EAAE;EACxCU,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAkB,CAAC,MAAM;EAC7BC,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,MAAM;EACfC,MAAM,EAAE,MAAM;EAEd,IAAIH,iBAAiB,IAAI;IACvBI,MAAM,EAAE;EACV,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAMC,cAAc,GAAGjB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO;EACxCa,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,MAAM;EACfC,MAAM,EAAE;AACV,CAAC,CAAC,CAAC;AAGH,MAAMG,uBAAuB,GAAGd,4BAA4B,CAAC;EAAEe,GAAG,EAAE;AAAO,CAAC,CAAC,CAC3E,CAAC;EAAEC;AAAoB,CAAC,MAAM;EAC5BP,UAAU,EAAE,QAAQ;EACpBQ,eAAe,EAAEpB,qBAAqB,CA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aAAa,CAACS,OAAO,CAAC,IAAIT,aAAa,CAACQ,IAAK;IACxEC,OAAO,EAAET,aAAa,CAACS,OAAQ;IAC/BE,IAAI,EAAC,cAAc;IAAAL,QAAA,EAElBD;EAAI,CACc,CACtB;AACH,CAAC;AAED,MAAMO,mBAAmB,GAAG5C,IAAI,CAAC4B,WAAW,CAAC;AAC7CgB,mBAAmB,CAACC,WAAW,6CAAgB;AAE/C,SAASD,mBAAmB,IAAIhB,WAAW","ignoreList":[]}
@@ -209,6 +209,6 @@ const WideUiShellContent = ({
209
209
  });
210
210
  };
211
211
  const MemoizedWideUiShellContent = memo(WideUiShellContent);
212
- MemoizedWideUiShellContent.displayName = "WideUiShellContent::pkg=odyssey&odysseyV=1.71.1";
212
+ MemoizedWideUiShellContent.displayName = "WideUiShellContent::pkg=odyssey&odysseyV=1.73.0";
213
213
  export { MemoizedWideUiShellContent as WideUiShellContent };
214
214
  //# sourceMappingURL=WideUiShellContent.js.map
@@ -31,6 +31,7 @@ export const renderUiShell = ({
31
31
  appElement: providedAppElement,
32
32
  appElementScrollingMode,
33
33
  breakpointConfig,
34
+ colorScheme,
34
35
  hasStandardAppContentPadding,
35
36
  initialVisibleSections,
36
37
  languageCode,
@@ -69,6 +70,17 @@ export const renderUiShell = ({
69
70
  languageCode,
70
71
  translationOverrides
71
72
  });
73
+ const {
74
+ publish: publishColorScheme,
75
+ subscribe: subscribeToColorScheme
76
+ } = createMessageBus();
77
+ const publishAfterReactAppReadyForColorScheme = bufferLatest({
78
+ publish: publishColorScheme,
79
+ subscribe: subscribeToReactAppSubscribed
80
+ });
81
+ if (colorScheme) {
82
+ publishAfterReactAppReadyForColorScheme(colorScheme);
83
+ }
72
84
  const {
73
85
  publish: closeRightSideMenu,
74
86
  subscribe: subscribeToCloseRightSideMenu
@@ -121,6 +133,7 @@ export const renderUiShell = ({
121
133
  sideNavBackgroundContrastColor: sideNavBackgroundContrastColor,
122
134
  subscribeToCloseRightSideMenu: subscribeToCloseRightSideMenu,
123
135
  subscribeToCloseSideNavMenu: subscribeToCloseSideNavMenu,
136
+ subscribeToColorScheme: subscribeToColorScheme,
124
137
  subscribeToPropChanges: subscribeToPropChanges,
125
138
  subscribeToTranslationSettings: subscribeToTranslationSettings,
126
139
  topNavBackgroundColor: topNavBackgroundColor,
@@ -141,6 +154,7 @@ export const renderUiShell = ({
141
154
  enterAppFullscreen,
142
155
  exitAppFullscreen,
143
156
  getFullscreenState,
157
+ setColorScheme: publishAfterReactAppReadyForColorScheme,
144
158
  setComponentProps: publishAfterReactAppReadyForProps,
145
159
  setTranslationSettings: publishAfterReactAppReadyForTranslationSettings,
146
160
  slottedElements,
@@ -156,6 +170,7 @@ export const renderUiShell = ({
156
170
  enterAppFullscreen,
157
171
  exitAppFullscreen,
158
172
  getFullscreenState,
173
+ setColorScheme: publishAfterReactAppReadyForColorScheme,
159
174
  setComponentProps: publishAfterReactAppReadyForProps,
160
175
  setTranslationSettings: publishAfterReactAppReadyForTranslationSettings,
161
176
  slottedElements,
@@ -1 +1 @@
1
- {"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","renderReactInWebComponent","createUiShellFullscreenState","UiShell","uiShellDataAttribute","jsx","_jsx","optionalComponentSlotNames","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","breakpointConfig","hasStandardAppContentPadding","initialVisibleSections","languageCode","onError","console","error","onRender","parentElement","sideNavBackgroundColor","sideNavBackgroundContrastColor","topNavBackgroundColor","translationOverrides","nonce","window","cspNonce","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishTranslationSettings","subscribeToTranslationSettings","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","publishAfterReactAppReadyForTranslationSettings","closeRightSideMenu","subscribeToCloseRightSideMenu","closeSideNavMenu","subscribeToCloseSideNavMenu","connect","connectFullscreenState","enterAppFullscreen","enterAppFullscreenNow","exitAppFullscreen","exitAppFullscreenNow","getFullscreenState","subscribeToFullscreenState","requestAfterReactAppReady","sendFullscreenRequest","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","unsubscribeFromUnifiedUiShellRendered","setComponentProps","setTranslationSettings","appendChild"],"sources":["../../../src/ui-shell/renderUiShell.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 SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { type FullscreenModeMessageBus } from \"../message-bus/index.js\";\nimport { bufferLatest } from \"../tools/bufferLatest.js\";\nimport { createMessageBus, PublishMessage } from \"../tools/createMessageBus.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\nimport { createUiShellFullscreenState } from \"./createUiShellFullscreenState.js\";\nimport {\n UiShell,\n UiShellProps,\n UiShellTranslationSettings,\n} from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\nexport type SlottedElements = Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n>;\n\nexport type RenderedUiShell = {\n closeRightSideMenu: PublishMessage<void>;\n closeSideNavMenu: PublishMessage<void>;\n /**\n * Put the whole app area in fullscreen. UI Shell hides its top nav, side nav, and banners so the app fills the page.\n *\n * Use this when your app isn't built with Odyssey's `FullscreenButton`, for example a non-React app.\n *\n * The app area is one more entry in the page's fullscreen stack, so a `FullscreenRegion` can enter on top of it, and Escape goes back one step at a time. Removing `uiShellElement` from the page clears the stack.\n */\n enterAppFullscreen: () => void;\n /**\n * Take the app area out of fullscreen. A `FullscreenRegion` that entered on top of it stays in fullscreen.\n */\n exitAppFullscreen: () => void;\n /**\n * The page's current fullscreen state.\n */\n getFullscreenState: FullscreenModeMessageBus[\"getFullscreenState\"];\n setComponentProps: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellNavComponentProps>>\n >;\n /**\n * Update the shell's translation settings (`languageCode`, `translationOverrides`) at runtime.\n *\n * Call this after the consumer's locale changes to re-localize shell-rendered chrome (skip-to-content link, top nav icons, side nav toggle) without re-rendering UI Shell.\n *\n * Accepts a React `SetStateAction`: passing a plain object **replaces** the entire settings value (so omitting `translationOverrides` clears it). Pass an updater function — `(previous) => ({ ...previous, languageCode: \"es\" })` — to merge with\n * the previous value.\n */\n setTranslationSettings: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellTranslationSettings>>\n >;\n slottedElements: SlottedElements;\n /**\n * Listen for fullscreen changes anywhere on the page, including ones from other apps. Returns a function that stops listening.\n */\n subscribeToFullscreenState: FullscreenModeMessageBus[\"subscribeToFullscreenState\"];\n uiShellElement: ReturnType<typeof renderReactInWebComponent>;\n} & Partial<Pick<UiShellProps, \"appElement\">>;\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n breakpointConfig,\n hasStandardAppContentPadding,\n initialVisibleSections,\n languageCode,\n onError = console.error,\n onRender,\n parentElement,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n topNavBackgroundColor,\n translationOverrides,\n nonce = window.cspNonce,\n}: {\n /**\n * Optional nonce for CSP compliance.\n */\n nonce?: string;\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * Notify once when React has rendered UI Shell the first time.\n */\n onRender?: (renderedUiShell: RenderedUiShell) => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"breakpointConfig\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"sideNavBackgroundContrastColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<UiShellTranslationSettings> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishTranslationSettings,\n subscribe: subscribeToTranslationSettings,\n } = createMessageBus<SetStateAction<UiShellTranslationSettings>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const publishAfterReactAppReadyForTranslationSettings = bufferLatest({\n publish: publishTranslationSettings,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n publishAfterReactAppReadyForTranslationSettings({\n languageCode,\n translationOverrides,\n });\n\n const {\n publish: closeRightSideMenu,\n subscribe: subscribeToCloseRightSideMenu,\n } = createMessageBus();\n\n const { publish: closeSideNavMenu, subscribe: subscribeToCloseSideNavMenu } =\n createMessageBus();\n\n const {\n connect: connectFullscreenState,\n enterAppFullscreen: enterAppFullscreenNow,\n exitAppFullscreen: exitAppFullscreenNow,\n getFullscreenState,\n subscribeToFullscreenState,\n } = createUiShellFullscreenState();\n\n // The page's fullscreen host starts when UI Shell's React tree renders, so a request made before then would reach no one. Like props, only the latest request is kept, so an enter followed by an exit leaves the app where it was.\n const requestAfterReactAppReady = bufferLatest<() => void>({\n publish: (sendFullscreenRequest) => sendFullscreenRequest(),\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const enterAppFullscreen = () =>\n requestAfterReactAppReady(enterAppFullscreenNow);\n\n const exitAppFullscreen = () =>\n requestAfterReactAppReady(exitAppFullscreenNow);\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as SlottedElements;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n breakpointConfig={breakpointConfig}\n closeSideNavMenu={closeSideNavMenu}\n connectFullscreenState={connectFullscreenState}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n subscribeToPropChanges={subscribeToPropChanges}\n subscribeToTranslationSettings={subscribeToTranslationSettings}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentChildren,\n webComponentParentElement: parentElement,\n nonce,\n });\n\n const unsubscribeFromUnifiedUiShellRendered = subscribeToReactAppSubscribed(\n () => {\n unsubscribeFromUnifiedUiShellRendered();\n\n onRender?.({\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n enterAppFullscreen,\n exitAppFullscreen,\n getFullscreenState,\n setComponentProps: publishAfterReactAppReadyForProps,\n setTranslationSettings: publishAfterReactAppReadyForTranslationSettings,\n slottedElements,\n subscribeToFullscreenState,\n uiShellElement,\n });\n },\n );\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n enterAppFullscreen,\n exitAppFullscreen,\n getFullscreenState,\n setComponentProps: publishAfterReactAppReadyForProps,\n setTranslationSettings: publishAfterReactAppReadyForTranslationSettings,\n slottedElements,\n subscribeToFullscreenState,\n uiShellElement,\n } satisfies RenderedUiShell;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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BAAiB,EAAEN,iBAAiB,CAACO,cAAe;QACpDC,oBAAoB,EAAER,iBAAiB,CAACS;MAAkB,CAC3D;IAAC,CACW,CAChB;IACDb,oBAAoB;IACpBc,yBAAyB,EAAEzD,aAAa;IACxCK;EACF,CAAC,CAAC;EAEF,MAAMqD,qCAAqC,GAAGxC,6BAA6B,CACzE,MAAM;IACJwC,qCAAqC,CAAC,CAAC;IAEvC3D,QAAQ,GAAG;MACTV,UAAU;MACVgC,kBAAkB;MAClBE,gBAAgB;MAChBI,kBAAkB;MAClBE,iBAAiB;MACjBE,kBAAkB;MAClB4B,iBAAiB,EAAExC,iCAAiC;MACpDyC,sBAAsB,EAAExC,+CAA+C;MACvEe,eAAe;MACfH,0BAA0B;MAC1Ba;IACF,CAAC,CAAC;EACJ,CACF,CAAC;EAED7C,aAAa,CAAC6D,WAAW,CAACxE,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACVgC,kBAAkB;IAClBE,gBAAgB;IAChBI,kBAAkB;IAClBE,iBAAiB;IACjBE,kBAAkB;IAClB4B,iBAAiB,EAAExC,iCAAiC;IACpDyC,sBAAsB,EAAExC,+CAA+C;IACvEe,eAAe;IACfH,0BAA0B;IAC1Ba;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","renderReactInWebComponent","createUiShellFullscreenState","UiShell","uiShellDataAttribute","jsx","_jsx","optionalComponentSlotNames","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","breakpointConfig","colorScheme","hasStandardAppContentPadding","initialVisibleSections","languageCode","onError","console","error","onRender","parentElement","sideNavBackgroundColor","sideNavBackgroundContrastColor","topNavBackgroundColor","translationOverrides","nonce","window","cspNonce","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishTranslationSettings","subscribeToTranslationSettings","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","publishAfterReactAppReadyForTranslationSettings","publishColorScheme","subscribeToColorScheme","publishAfterReactAppReadyForColorScheme","closeRightSideMenu","subscribeToCloseRightSideMenu","closeSideNavMenu","subscribeToCloseSideNavMenu","connect","connectFullscreenState","enterAppFullscreen","enterAppFullscreenNow","exitAppFullscreen","exitAppFullscreenNow","getFullscreenState","subscribeToFullscreenState","requestAfterReactAppReady","sendFullscreenRequest","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","unsubscribeFromUnifiedUiShellRendered","setColorScheme","setComponentProps","setTranslationSettings","appendChild"],"sources":["../../../src/ui-shell/renderUiShell.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 SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { type FullscreenModeMessageBus } from \"../message-bus/index.js\";\nimport { bufferLatest } from \"../tools/bufferLatest.js\";\nimport { createMessageBus, PublishMessage } from \"../tools/createMessageBus.js\";\nimport { type ColorScheme } from \"../useColorScheme.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\nimport { createUiShellFullscreenState } from \"./createUiShellFullscreenState.js\";\nimport {\n UiShell,\n UiShellProps,\n UiShellTranslationSettings,\n} from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\nexport type SlottedElements = Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n>;\n\nexport type RenderedUiShell = {\n closeRightSideMenu: PublishMessage<void>;\n closeSideNavMenu: PublishMessage<void>;\n /**\n * Put the whole app area in fullscreen. UI Shell hides its top nav, side nav, and banners so the app fills the page.\n *\n * Use this when your app isn't built with Odyssey's `FullscreenButton`, for example a non-React app.\n *\n * The app area is one more entry in the page's fullscreen stack, so a `FullscreenRegion` can enter on top of it, and Escape goes back one step at a time. Removing `uiShellElement` from the page clears the stack.\n */\n enterAppFullscreen: () => void;\n /**\n * Take the app area out of fullscreen. A `FullscreenRegion` that entered on top of it stays in fullscreen.\n */\n exitAppFullscreen: () => void;\n /**\n * The page's current fullscreen state.\n */\n getFullscreenState: FullscreenModeMessageBus[\"getFullscreenState\"];\n /**\n * Update the shell's color scheme at runtime, for example when the app's own dark mode toggle changes. `system` follows the operating system setting.\n */\n setColorScheme: ReturnType<typeof bufferLatest<ColorScheme>>;\n setComponentProps: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellNavComponentProps>>\n >;\n /**\n * Update the shell's translation settings (`languageCode`, `translationOverrides`) at runtime.\n *\n * Call this after the consumer's locale changes to re-localize shell-rendered chrome (skip-to-content link, top nav icons, side nav toggle) without re-rendering UI Shell.\n *\n * Accepts a React `SetStateAction`: passing a plain object **replaces** the entire settings value (so omitting `translationOverrides` clears it). Pass an updater function — `(previous) => ({ ...previous, languageCode: \"es\" })` — to merge with\n * the previous value.\n */\n setTranslationSettings: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellTranslationSettings>>\n >;\n slottedElements: SlottedElements;\n /**\n * Listen for fullscreen changes anywhere on the page, including ones from other apps. Returns a function that stops listening.\n */\n subscribeToFullscreenState: FullscreenModeMessageBus[\"subscribeToFullscreenState\"];\n uiShellElement: ReturnType<typeof renderReactInWebComponent>;\n} & Partial<Pick<UiShellProps, \"appElement\">>;\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n breakpointConfig,\n colorScheme,\n hasStandardAppContentPadding,\n initialVisibleSections,\n languageCode,\n onError = console.error,\n onRender,\n parentElement,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n topNavBackgroundColor,\n translationOverrides,\n nonce = window.cspNonce,\n}: {\n /**\n * The color scheme the shell renders. `system` follows the operating system setting. Change it later with `setColorScheme`.\n * @default \"light\"\n */\n colorScheme?: ColorScheme;\n /**\n * Optional nonce for CSP compliance.\n */\n nonce?: string;\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * Notify once when React has rendered UI Shell the first time.\n */\n onRender?: (renderedUiShell: RenderedUiShell) => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"breakpointConfig\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"sideNavBackgroundContrastColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<UiShellTranslationSettings> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishTranslationSettings,\n subscribe: subscribeToTranslationSettings,\n } = createMessageBus<SetStateAction<UiShellTranslationSettings>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const publishAfterReactAppReadyForTranslationSettings = bufferLatest({\n publish: publishTranslationSettings,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n publishAfterReactAppReadyForTranslationSettings({\n languageCode,\n translationOverrides,\n });\n\n const { publish: publishColorScheme, subscribe: subscribeToColorScheme } =\n createMessageBus<ColorScheme>();\n\n const publishAfterReactAppReadyForColorScheme = bufferLatest({\n publish: publishColorScheme,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n if (colorScheme) {\n publishAfterReactAppReadyForColorScheme(colorScheme);\n }\n\n const {\n publish: closeRightSideMenu,\n subscribe: subscribeToCloseRightSideMenu,\n } = createMessageBus();\n\n const { publish: closeSideNavMenu, subscribe: subscribeToCloseSideNavMenu } =\n createMessageBus();\n\n const {\n connect: connectFullscreenState,\n enterAppFullscreen: enterAppFullscreenNow,\n exitAppFullscreen: exitAppFullscreenNow,\n getFullscreenState,\n subscribeToFullscreenState,\n } = createUiShellFullscreenState();\n\n // The page's fullscreen host starts when UI Shell's React tree renders, so a request made before then would reach no one. Like props, only the latest request is kept, so an enter followed by an exit leaves the app where it was.\n const requestAfterReactAppReady = bufferLatest<() => void>({\n publish: (sendFullscreenRequest) => sendFullscreenRequest(),\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const enterAppFullscreen = () =>\n requestAfterReactAppReady(enterAppFullscreenNow);\n\n const exitAppFullscreen = () =>\n requestAfterReactAppReady(exitAppFullscreenNow);\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as SlottedElements;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n breakpointConfig={breakpointConfig}\n closeSideNavMenu={closeSideNavMenu}\n connectFullscreenState={connectFullscreenState}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n subscribeToColorScheme={subscribeToColorScheme}\n subscribeToPropChanges={subscribeToPropChanges}\n subscribeToTranslationSettings={subscribeToTranslationSettings}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentChildren,\n webComponentParentElement: parentElement,\n nonce,\n });\n\n const unsubscribeFromUnifiedUiShellRendered = subscribeToReactAppSubscribed(\n () => {\n unsubscribeFromUnifiedUiShellRendered();\n\n onRender?.({\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n enterAppFullscreen,\n exitAppFullscreen,\n getFullscreenState,\n setColorScheme: publishAfterReactAppReadyForColorScheme,\n setComponentProps: publishAfterReactAppReadyForProps,\n setTranslationSettings: publishAfterReactAppReadyForTranslationSettings,\n slottedElements,\n subscribeToFullscreenState,\n uiShellElement,\n });\n },\n );\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n enterAppFullscreen,\n exitAppFullscreen,\n getFullscreenState,\n setColorScheme: publishAfterReactAppReadyForColorScheme,\n setComponentProps: publishAfterReactAppReadyForProps,\n setTranslationSettings: publishAfterReactAppReadyForTranslationSettings,\n slottedElements,\n subscribeToFullscreenState,\n uiShellElement,\n } satisfies RenderedUiShell;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAGpD,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,gBAAgB,QAAwB,8BAA8B;AAE/E,SAASC,yBAAyB,QAAQ,+CAA+C;AACzF,SAASC,4BAA4B,QAAQ,mCAAmC;AAChF,SACEC,OAAO,QAGF,cAAc;AAErB,SAASC,oBAAoB,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1D,OAAO,MAAMC,0BAGZ,GAAG;EACFC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,iBAAiB;EAChCC,aAAa,EAAE,iBAAiB;EAChCC,cAAc,EAAE,mBAAmB;EACnCC,eAAe,EAAE;AACnB,CAAC;AA6DD,OAAO,MAAMC,aAAa,GAAGA,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C;EAEF,MAAMwD,qCAAqC,GAAG3C,6BAA6B,CACzE,MAAM;IACJ2C,qCAAqC,CAAC,CAAC;IAEvC9D,QAAQ,GAAG;MACTX,UAAU;MACVoC,kBAAkB;MAClBE,gBAAgB;MAChBI,kBAAkB;MAClBE,iBAAiB;MACjBE,kBAAkB;MAClB4B,cAAc,EAAEvC,uCAAuC;MACvDwC,iBAAiB,EAAE5C,iCAAiC;MACpD6C,sBAAsB,EAAE5C,+CAA+C;MACvEkB,eAAe;MACfH,0BAA0B;MAC1Ba;IACF,CAAC,CAAC;EACJ,CACF,CAAC;EAEDhD,aAAa,CAACiE,WAAW,CAAC7E,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACVoC,kBAAkB;IAClBE,gBAAgB;IAChBI,kBAAkB;IAClBE,iBAAiB;IACjBE,kBAAkB;IAClB4B,cAAc,EAAEvC,uCAAuC;IACvDwC,iBAAiB,EAAE5C,iCAAiC;IACpD6C,sBAAsB,EAAE5C,+CAA+C;IACvEkB,eAAe;IACfH,0BAA0B;IAC1Ba;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { createContext, useContext } from "react";
14
+ import { useMediaQuery } from "./theme/useMediaQuery.js";
15
+ export const colorSchemeValues = ["light", "dark", "system"];
16
+ export const resolvedColorSchemeValues = colorSchemeValues.filter(colorScheme => colorScheme !== "system");
17
+ export const defaultColorScheme = "light";
18
+ export const ColorSchemeContext = createContext(defaultColorScheme);
19
+ export const useColorScheme = () => useContext(ColorSchemeContext);
20
+ export const useResolvedColorScheme = ({
21
+ colorScheme
22
+ }) => {
23
+ const parentColorScheme = useColorScheme();
24
+ const isSystemDark = useMediaQuery("(prefers-color-scheme: dark)");
25
+ if (colorScheme === "system") {
26
+ return isSystemDark ? "dark" : "light";
27
+ }
28
+ return colorScheme ?? parentColorScheme;
29
+ };
30
+ //# sourceMappingURL=useColorScheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColorScheme.js","names":["createContext","useContext","useMediaQuery","colorSchemeValues","resolvedColorSchemeValues","filter","colorScheme","defaultColorScheme","ColorSchemeContext","useColorScheme","useResolvedColorScheme","parentColorScheme","isSystemDark"],"sources":["../../src/useColorScheme.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 { createContext, useContext } from \"react\";\n\nimport { useMediaQuery } from \"./theme/useMediaQuery.js\";\n\n/**\n * Every color scheme an app can ask for. This list is the one source of truth for scheme names. `ResolvedColorScheme`, the token sets, and the per-scheme keys of `designTokensOverride` all derive from it, so adding a scheme such as a high-contrast one starts here.\n */\nexport const colorSchemeValues = [\"light\", \"dark\", \"system\"] as const;\n\n/**\n * The color scheme an app asks for. `system` follows the operating system's\n * `prefers-color-scheme` setting and updates live when it changes.\n */\nexport type ColorScheme = (typeof colorSchemeValues)[number];\n\n/** The color scheme actually rendered, after `system` is resolved. */\nexport type ResolvedColorScheme = Exclude<ColorScheme, \"system\">;\n\n/** Every color scheme Odyssey renders, which is every requested scheme except `system`. */\nexport const resolvedColorSchemeValues = colorSchemeValues.filter(\n (colorScheme): colorScheme is ResolvedColorScheme => colorScheme !== \"system\",\n);\n\nexport const defaultColorScheme: ColorScheme = \"light\";\n\nexport const ColorSchemeContext =\n createContext<ResolvedColorScheme>(defaultColorScheme);\n\n/**\n * Returns the color scheme Odyssey is rendering, `light` or `dark`. Use it for\n * anything Odyssey does not style itself, such as a chart library or a logo\n * that ships separate light and dark artwork.\n */\nexport const useColorScheme = () => useContext(ColorSchemeContext);\n\n/**\n * Resolves a requested color scheme to the one to render. With nothing\n * requested, a nested provider inherits its parent's resolved scheme so a\n * `Surface` inside a dark app stays dark.\n */\nexport const useResolvedColorScheme = ({\n colorScheme,\n}: {\n colorScheme?: ColorScheme;\n}): ResolvedColorScheme => {\n const parentColorScheme = useColorScheme();\n const isSystemDark = useMediaQuery(\"(prefers-color-scheme: dark)\");\n\n if (colorScheme === \"system\") {\n return isSystemDark ? \"dark\" : \"light\";\n }\n\n return colorScheme ?? parentColorScheme;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAEjD,SAASC,aAAa,QAAQ,0BAA0B;AAKxD,OAAO,MAAMC,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU;AAYrE,OAAO,MAAMC,yBAAyB,GAAGD,iBAAiB,CAACE,MAAM,CAC9DC,WAAW,IAAyCA,WAAW,KAAK,QACvE,CAAC;AAED,OAAO,MAAMC,kBAA+B,GAAG,OAAO;AAEtD,OAAO,MAAMC,kBAAkB,GAC7BR,aAAa,CAAsBO,kBAAkB,CAAC;AAOxD,OAAO,MAAME,cAAc,GAAGA,CAAA,KAAMR,UAAU,CAACO,kBAAkB,CAAC;AAOlE,OAAO,MAAME,sBAAsB,GAAGA,CAAC;EACrCJ;AAGF,CAAC,KAA0B;EACzB,MAAMK,iBAAiB,GAAGF,cAAc,CAAC,CAAC;EAC1C,MAAMG,YAAY,GAAGV,aAAa,CAAC,8BAA8B,CAAC;EAElE,IAAII,WAAW,KAAK,QAAQ,EAAE;IAC5B,OAAOM,YAAY,GAAG,MAAM,GAAG,OAAO;EACxC;EAEA,OAAON,WAAW,IAAIK,iBAAiB;AACzC,CAAC","ignoreList":[]}
@@ -50,9 +50,10 @@ export const getBackgroundColor = element => {
50
50
  }
51
51
  return defaultParentBackgroundColor;
52
52
  };
53
- export const deriveContrastMode = bgColor => bgColor === Tokens.HueNeutral50 ? "highContrast" : "lowContrast";
53
+ export const deriveContrastMode = (bgColor, highContrastBackgroundColor = Tokens.HueNeutral50) => bgColor === Tokens.HueNeutral50 || bgColor === highContrastBackgroundColor || bgColor === hexToRgb(highContrastBackgroundColor).asFormattedString ? "highContrast" : "lowContrast";
54
54
  export const useContrastMode = ({
55
- contrastMode: explicitContrastMode
55
+ contrastMode: explicitContrastMode,
56
+ highContrastBackgroundColor = Tokens.HueNeutral50
56
57
  }) => {
57
58
  const contrastContainerRef = useRef(null);
58
59
  const {
@@ -64,8 +65,8 @@ export const useContrastMode = ({
64
65
  const updateBackgroundColor = useCallback(() => {
65
66
  const newBgColor = getBackgroundColor(contrastContainerRef.current);
66
67
  setParentBackgroundColor(newBgColor);
67
- setDetectedContrastMode(deriveContrastMode(newBgColor));
68
- }, []);
68
+ setDetectedContrastMode(deriveContrastMode(newBgColor, highContrastBackgroundColor));
69
+ }, [highContrastBackgroundColor]);
69
70
  useLayoutEffect(() => {
70
71
  if (explicitContrastMode) return;
71
72
  const observer = new MutationObserver(updateBackgroundColor);
@@ -1 +1 @@
1
- {"version":3,"file":"useContrastMode.js","names":["Tokens","createContext","useCallback","useContext","useLayoutEffect","useRef","useState","hexToRgb","ContrastModeContext","contrastMode","defaultContrast","useContrastModeContext","hueNeutral50Rgb","HueNeutral50","asFormattedString","isTransparentColor","color","normalizeRgbaToRgb","rgba","replace","getElementComputedBackgroundColor","element","window","getComputedStyle","backgroundColor","normalizeBackgroundColor","bgColor","test","normalizedColor","defaultParentBackgroundColor","getParentElement","parentElement","root","getRootNode","ShadowRoot","host","HTMLElement","getBackgroundColor","deriveContrastMode","useContrastMode","explicitContrastMode","contrastContainerRef","existingContrastMode","parentBackgroundColor","setParentBackgroundColor","detectedContrastMode","setDetectedContrastMode","updateBackgroundColor","newBgColor","current","observer","MutationObserver","htmlElement","document","documentElement","observe","attributes","attributeFilter","head","childList","subtree","onTransitionEnd","event","TransitionEvent","propertyName","eventRoot","addEventListener","removeEventListener","disconnect"],"sources":["../../src/useContrastMode.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 * as Tokens from \"@okta/odyssey-design-tokens\";\nimport {\n createContext,\n type RefObject,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { hexToRgb } from \"./hexToRgb.js\";\n\nexport type ContrastMode = \"lowContrast\" | \"highContrast\";\nexport type ContrastModeContextType = {\n /**\n * Odyssey's app wrapper element: the contrast and height container `OdysseyThemeProvider` renders. `useAppElementContainerQuery` observes it so container queries track the space Odyssey actually occupies. Absent outside a provider, and `current` stays `null` when the provider renders with `hasWrapperElement={false}`.\n */\n contrastContainerRef?: RefObject<HTMLDivElement>;\n contrastMode: ContrastMode;\n};\n\nexport const ContrastModeContext = createContext<ContrastModeContextType>({\n contrastMode: \"lowContrast\",\n});\n\nexport const defaultContrast = \"lowContrast\";\n\nexport const useContrastModeContext = () => useContext(ContrastModeContext);\n\nexport const hueNeutral50Rgb = hexToRgb(Tokens.HueNeutral50).asFormattedString;\n\nexport const isTransparentColor = (color: string) =>\n color === \"rgba(0, 0, 0, 0)\" || color === \"transparent\";\n\nexport const normalizeRgbaToRgb = (rgba: string) =>\n rgba.replace(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/, \"rgb($1, $2, $3)\");\n\nexport const getElementComputedBackgroundColor = (\n element: HTMLElement,\n): string => window.getComputedStyle(element).backgroundColor;\n\nexport const normalizeBackgroundColor = (bgColor: string): string => {\n if (/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/.test(bgColor)) {\n const normalizedColor = normalizeRgbaToRgb(bgColor);\n return normalizedColor === hueNeutral50Rgb\n ? Tokens.HueNeutral50\n : normalizedColor;\n }\n\n return bgColor === hueNeutral50Rgb ? Tokens.HueNeutral50 : bgColor;\n};\n\n/** Default background color when none is detected: HueNeutral50 (gray = highContrast). */\nexport const defaultParentBackgroundColor = Tokens.HueNeutral50;\n\n/**\n * Returns the parent element, crossing shadow DOM boundaries when necessary. When `parentElement` is null (e.g., at a shadow root), this checks if the element is inside a ShadowRoot and jumps to the host element to continue traversal.\n */\nconst getParentElement = (element: HTMLElement): HTMLElement | null => {\n if (element.parentElement) {\n return element.parentElement;\n }\n\n const root = element.getRootNode();\n if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {\n return root.host;\n }\n\n return null;\n};\n\n/**\n * Determines the effective background color of an element.\n *\n * @param element - The HTML element to check.\n * @returns The effective background color. Returns defaultParentBackgroundColor if no non-transparent background is found.\n *\n * Note:\n * - Low contrast mode is used for white background (HueNeutralWhite).\n * - High contrast mode is used for gray background (defaultParentBackgroundColor = HueNeutral50).\n * - Crosses shadow DOM boundaries via `getRootNode().host` to detect backgrounds set outside of shadow roots.\n */\nexport const getBackgroundColor = (element: HTMLElement | null): string => {\n while (element) {\n const bgColor = getElementComputedBackgroundColor(element);\n if (!isTransparentColor(bgColor)) {\n return normalizeBackgroundColor(bgColor);\n }\n element = getParentElement(element);\n }\n return defaultParentBackgroundColor; // Default to gray/high contrast if no background color is found\n};\n\nexport const deriveContrastMode = (bgColor: string): ContrastMode =>\n bgColor === Tokens.HueNeutral50 ? \"highContrast\" : \"lowContrast\";\n\ntype UseContrastModeProps = {\n contrastMode?: ContrastMode;\n};\n\nexport const useContrastMode = ({\n contrastMode: explicitContrastMode,\n}: UseContrastModeProps) => {\n const contrastContainerRef = useRef<HTMLDivElement>(null);\n const { contrastMode: existingContrastMode } = useContrastModeContext();\n\n const [parentBackgroundColor, setParentBackgroundColor] = useState(\n defaultParentBackgroundColor,\n );\n const [detectedContrastMode, setDetectedContrastMode] =\n useState<ContrastMode>(() => existingContrastMode);\n\n const contrastMode = explicitContrastMode ?? detectedContrastMode;\n\n const updateBackgroundColor = useCallback(() => {\n const newBgColor = getBackgroundColor(contrastContainerRef.current);\n setParentBackgroundColor(newBgColor);\n setDetectedContrastMode(deriveContrastMode(newBgColor));\n }, []);\n\n useLayoutEffect(() => {\n if (explicitContrastMode) return;\n\n const observer = new MutationObserver(updateBackgroundColor);\n\n // In shadow DOM contexts, document.documentElement and document.head may not be accessible. Guard against null to prevent observer.observe(null) from throwing.\n const htmlElement = document.documentElement;\n if (htmlElement) {\n observer.observe(htmlElement, {\n attributes: true,\n attributeFilter: [\"class\", \"style\"],\n });\n }\n\n if (document.head) {\n observer.observe(document.head, {\n childList: true,\n subtree: true,\n });\n }\n\n const onTransitionEnd = (event: Event) => {\n if (\n event instanceof TransitionEvent &&\n event.propertyName === \"background-color\"\n ) {\n updateBackgroundColor();\n }\n };\n\n // Attach the transitionend listener to the element's root node so it works inside shadow DOM (where events don't bubble to `document`).\n const eventRoot = contrastContainerRef.current?.getRootNode() ?? document;\n eventRoot.addEventListener(\"transitionend\", onTransitionEnd);\n updateBackgroundColor();\n\n return () => {\n eventRoot.removeEventListener(\"transitionend\", onTransitionEnd);\n observer.disconnect();\n };\n }, [explicitContrastMode, updateB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C,CAAC;EAEjD,OAAO;IACLN,oBAAoB;IACpBhC,YAAY;IACZkC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useContrastMode.js","names":["Tokens","createContext","useCallback","useContext","useLayoutEffect","useRef","useState","hexToRgb","ContrastModeContext","contrastMode","defaultContrast","useContrastModeContext","hueNeutral50Rgb","HueNeutral50","asFormattedString","isTransparentColor","color","normalizeRgbaToRgb","rgba","replace","getElementComputedBackgroundColor","element","window","getComputedStyle","backgroundColor","normalizeBackgroundColor","bgColor","test","normalizedColor","defaultParentBackgroundColor","getParentElement","parentElement","root","getRootNode","ShadowRoot","host","HTMLElement","getBackgroundColor","deriveContrastMode","highContrastBackgroundColor","useContrastMode","explicitContrastMode","contrastContainerRef","existingContrastMode","parentBackgroundColor","setParentBackgroundColor","detectedContrastMode","setDetectedContrastMode","updateBackgroundColor","newBgColor","current","observer","MutationObserver","htmlElement","document","documentElement","observe","attributes","attributeFilter","head","childList","subtree","onTransitionEnd","event","TransitionEvent","propertyName","eventRoot","addEventListener","removeEventListener","disconnect"],"sources":["../../src/useContrastMode.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 * as Tokens from \"@okta/odyssey-design-tokens\";\nimport {\n createContext,\n type RefObject,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { hexToRgb } from \"./hexToRgb.js\";\n\nexport type ContrastMode = \"lowContrast\" | \"highContrast\";\nexport type ContrastModeContextType = {\n /**\n * Odyssey's app wrapper element: the contrast and height container `OdysseyThemeProvider` renders. `useAppElementContainerQuery` observes it so container queries track the space Odyssey actually occupies. Absent outside a provider, and `current` stays `null` when the provider renders with `hasWrapperElement={false}`.\n */\n contrastContainerRef?: RefObject<HTMLDivElement>;\n contrastMode: ContrastMode;\n};\n\nexport const ContrastModeContext = createContext<ContrastModeContextType>({\n contrastMode: \"lowContrast\",\n});\n\nexport const defaultContrast = \"lowContrast\";\n\nexport const useContrastModeContext = () => useContext(ContrastModeContext);\n\nexport const hueNeutral50Rgb = hexToRgb(Tokens.HueNeutral50).asFormattedString;\n\nexport const isTransparentColor = (color: string) =>\n color === \"rgba(0, 0, 0, 0)\" || color === \"transparent\";\n\nexport const normalizeRgbaToRgb = (rgba: string) =>\n rgba.replace(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/, \"rgb($1, $2, $3)\");\n\nexport const getElementComputedBackgroundColor = (\n element: HTMLElement,\n): string => window.getComputedStyle(element).backgroundColor;\n\nexport const normalizeBackgroundColor = (bgColor: string): string => {\n if (/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/.test(bgColor)) {\n const normalizedColor = normalizeRgbaToRgb(bgColor);\n return normalizedColor === hueNeutral50Rgb\n ? Tokens.HueNeutral50\n : normalizedColor;\n }\n\n return bgColor === hueNeutral50Rgb ? Tokens.HueNeutral50 : bgColor;\n};\n\n/** Background color assumed when none is detected: the HueNeutral50 page color, which means `highContrast`. */\nexport const defaultParentBackgroundColor = Tokens.HueNeutral50;\n\n/**\n * Returns the parent element, crossing shadow DOM boundaries when necessary. When `parentElement` is null (e.g., at a shadow root), this checks if the element is inside a ShadowRoot and jumps to the host element to continue traversal.\n */\nconst getParentElement = (element: HTMLElement): HTMLElement | null => {\n if (element.parentElement) {\n return element.parentElement;\n }\n\n const root = element.getRootNode();\n if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {\n return root.host;\n }\n\n return null;\n};\n\n/**\n * Determines the effective background color of an element.\n *\n * @param element - The HTML element to check.\n * @returns The effective background color. Returns defaultParentBackgroundColor if no non-transparent background is found.\n *\n * Note:\n * - Low contrast mode is used on the PaletteNeutralSurface surface.\n * - High contrast mode is used on the HueNeutral50 page color (defaultParentBackgroundColor).\n * - Crosses shadow DOM boundaries via `getRootNode().host` to detect backgrounds set outside of shadow roots.\n */\nexport const getBackgroundColor = (element: HTMLElement | null): string => {\n while (element) {\n const bgColor = getElementComputedBackgroundColor(element);\n if (!isTransparentColor(bgColor)) {\n return normalizeBackgroundColor(bgColor);\n }\n element = getParentElement(element);\n }\n return defaultParentBackgroundColor; // No background found, so assume the HueNeutral50 page and high contrast\n};\n\n/**\n * The HueNeutral50 page color means `highContrast`. It is read from the active\n * tokens, so dark mode's page color counts too, not only light mode's\n * `HueNeutral50`.\n */\nexport const deriveContrastMode = (\n bgColor: string,\n highContrastBackgroundColor: string = Tokens.HueNeutral50,\n): ContrastMode =>\n bgColor === Tokens.HueNeutral50 ||\n bgColor === highContrastBackgroundColor ||\n bgColor === hexToRgb(highContrastBackgroundColor).asFormattedString\n ? \"highContrast\"\n : \"lowContrast\";\n\ntype UseContrastModeProps = {\n contrastMode?: ContrastMode;\n /**\n * The page color of the active color scheme, `HueNeutral50` from the active\n * tokens.\n * @default Tokens.HueNeutral50\n */\n highContrastBackgroundColor?: string;\n};\n\nexport const useContrastMode = ({\n contrastMode: explicitContrastMode,\n highContrastBackgroundColor = Tokens.HueNeutral50,\n}: UseContrastModeProps) => {\n const contrastContainerRef = useRef<HTMLDivElement>(null);\n const { contrastMode: existingContrastMode } = useContrastModeContext();\n\n const [parentBackgroundColor, setParentBackgroundColor] = useState(\n defaultParentBackgroundColor,\n );\n const [detectedContrastMode, setDetectedContrastMode] =\n useState<ContrastMode>(() => existingContrastMode);\n\n const contrastMode = explicitContrastMode ?? detectedContrastMode;\n\n const updateBackgroundColor = useCallback(() => {\n const newBgColor = getBackgroundColor(contrastContainerRef.current);\n setParentBackgroundColor(newBgColor);\n setDetectedContrastMode(\n deriveContrastMode(newBgColor, highContrastBackgroundColor),\n );\n }, [highContrastBackgroundColor]);\n\n useLayoutEffect(() => {\n if (explicitContrastMode) return;\n\n const observer = new MutationObserver(updateBackgroundColor);\n\n // In shadow DOM contexts, document.documentElement and document.head may not be accessible. Guard against null to prevent observer.observe(null) from throwing.\n const htmlElement = document.documentElement;\n if (htmlElement) {\n observer.observe(htmlElement, {\n attributes: true,\n attributeFilter: [\"class\", \"style\"],\n });\n }\n\n if (document.head) {\n observer.observe(document.head, {\n childList: true,\n subtree: true,\n });\n }\n\n const onTransitionEnd = (event: Event) => {\n if (\n event instanceof TransitionEvent &&\n event.propertyName === \"background-color\"\n ) {\n updateBackgroundColor();\n }\n };\n\n // Attach the transitionend listener to the element's root node so it works inside shadow DOM (where events don't bubble to `document`).\n const eventRoot = contrastContainerRef.current?.getRootNode() ?? document;\n eventRoot.addEventListener(\"transitionend\", onTransitionEnd);\n updateBackgroundColor();\n\n return () => {\n eventRoot.removeEventListener(\"transitionend\", onTransitionEnd);\n observer.disconnect();\n };\n }, [explicitContrastMode, updateBackgroundColor]);\n\n return {\n contrastContainerRef,\n contrastMode,\n parentBackgroundColor,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,MAAM,MAAM,6BAA6B;AACrD,SACEC,aAAa,EAEbC,WAAW,EACXC,UAAU,EACVC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SAASC,QAAQ,QAAQ,eAAe;AAWxC,OAAO,MAAMC,mBAAmB,GAAGP,aAAa,CAA0B;EACxEQ,YAAY,EAAE;AAChB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAG,aAAa;AAE5C,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAMR,UAAU,CAACK,mBAAmB,CAAC;AAE3E,OAAO,MAAMI,eAAe,GAAGL,QAAQ,CAACP,MAAM,CA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AqB,CAAC;IAG5D,MAAMK,WAAW,GAAGC,QAAQ,CAACC,eAAe;IAC5C,IAAIF,WAAW,EAAE;MACfF,QAAQ,CAACK,OAAO,CAACH,WAAW,EAAE;QAC5BI,UAAU,EAAE,IAAI;QAChBC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO;MACpC,CAAC,CAAC;IACJ;IAEA,IAAIJ,QAAQ,CAACK,IAAI,EAAE;MACjBR,QAAQ,CAACK,OAAO,CAACF,QAAQ,CAACK,IAAI,EAAE;QAC9BC,SAAS,EAAE,IAAI;QACfC,OAAO,EAAE;MACX,CAAC,CAAC;IACJ;IAEA,MAAMC,eAAe,GAAIC,KAAY,IAAK;MACxC,IACEA,KAAK,YAAYC,eAAe,IAChCD,KAAK,CAACE,YAAY,KAAK,kBAAkB,EACzC;QACAjB,qBAAqB,CAAC,CAAC;MACzB;IACF,CAAC;IAGD,MAAMkB,SAAS,GAAGxB,oBAAoB,CAACQ,OAAO,EAAEjB,WAAW,CAAC,CAAC,IAAIqB,QAAQ;IACzEY,SAAS,CAACC,gBAAgB,CAAC,eAAe,EAAEL,eAAe,CAAC;IAC5Dd,qBAAqB,CAAC,CAAC;IAEvB,OAAO,MAAM;MACXkB,SAAS,CAACE,mBAAmB,CAAC,eAAe,EAAEN,eAAe,CAAC;MAC/DX,QAAQ,CAACkB,UAAU,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAAC5B,oBAAoB,EAAEO,qBAAqB,CAAC,CAAC;EAEjD,OAAO;IACLN,oBAAoB;IACpBjC,YAAY;IACZmC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ /*!
2
+ * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { useLayoutEffect, useMemo } from "react";
14
+ import { useSyncExternalStore } from "use-sync-external-store/shim";
15
+ import { defaultBackdropStack } from "./backdropStack.js";
16
+ import { useUniqueId } from "./useUniqueId.js";
17
+ export const useStackedBackdropProps = ({
18
+ backdropStack = defaultBackdropStack,
19
+ isOpen,
20
+ layer
21
+ }) => {
22
+ const backdropId = useUniqueId();
23
+ const openBackdropIds = useSyncExternalStore(backdropStack.subscribeToOpenBackdropIds, backdropStack.getOpenBackdropIds, backdropStack.getOpenBackdropIds);
24
+ useLayoutEffect(() => isOpen ? backdropStack.openBackdrop({
25
+ backdropId,
26
+ layer
27
+ }) : undefined, [backdropId, backdropStack, isOpen, layer]);
28
+ return useMemo(() => ({
29
+ invisible: openBackdropIds.length > 0 && openBackdropIds.at(-1) !== backdropId,
30
+ ...(openBackdropIds.some(openBackdropId => openBackdropId !== backdropId) && {
31
+ transitionDuration: 0
32
+ })
33
+ }), [backdropId, openBackdropIds]);
34
+ };
35
+ //# sourceMappingURL=useStackedBackdropProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStackedBackdropProps.js","names":["useLayoutEffect","useMemo","useSyncExternalStore","defaultBackdropStack","useUniqueId","useStackedBackdropProps","backdropStack","isOpen","layer","backdropId","openBackdropIds","subscribeToOpenBackdropIds","getOpenBackdropIds","openBackdrop","undefined","invisible","length","at","some","openBackdropId","transitionDuration"],"sources":["../../src/useStackedBackdropProps.ts"],"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 { useLayoutEffect, useMemo } from \"react\";\n// React's `useSyncExternalStore` does not exist before React 18. The shim delegates to the native hook on React 18.\nimport { useSyncExternalStore } from \"use-sync-external-store/shim\";\n\nimport { type BackdropStack, defaultBackdropStack } from \"./backdropStack.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport type UseStackedBackdropPropsArgs = {\n /**\n * The stack this backdrop joins.\n * @default defaultBackdropStack\n */\n backdropStack?: BackdropStack;\n /**\n * If `true`, the overlay is open and its backdrop joins the stack.\n */\n isOpen: boolean;\n /**\n * The z-index the overlay renders at, such as `theme.zIndex.modal`.\n */\n layer: number;\n};\n\nexport type StackedBackdropProps = {\n invisible: boolean;\n transitionDuration?: number;\n};\n\n/**\n * Get the backdrop props that keep stacked overlays from darkening the page more than once. Only the top-most open backdrop paints.\n */\nexport const useStackedBackdropProps = ({\n backdropStack = defaultBackdropStack,\n isOpen,\n layer,\n}: UseStackedBackdropPropsArgs): StackedBackdropProps => {\n const backdropId = useUniqueId();\n\n const openBackdropIds = useSyncExternalStore(\n backdropStack.subscribeToOpenBackdropIds,\n backdropStack.getOpenBackdropIds,\n backdropStack.getOpenBackdropIds,\n );\n\n // A layout effect, so the backdrop underneath hides in the same frame the new one appears, not one paint later.\n useLayoutEffect(\n () =>\n isOpen ? backdropStack.openBackdrop({ backdropId, layer }) : undefined,\n [backdropId, backdropStack, isOpen, layer],\n );\n\n return useMemo(\n () => ({\n // A closing backdrop has already left the stack but stays mounted while it fades out, so membership alone would leave it painted under an overlay that opens during that fade.\n invisible:\n openBackdropIds.length > 0 && openBackdropIds.at(-1) !== backdropId,\n // A backdrop fading in or out over another one would briefly show both, so the gray changes in one step. The last backdrop to close still fades out.\n ...(openBackdropIds.some(\n (openBackdropId) => openBackdropId !== backdropId,\n ) && { transitionDuration: 0 }),\n }),\n [backdropId, openBackdropIds],\n );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,EAAEC,OAAO,QAAQ,OAAO;AAEhD,SAASC,oBAAoB,QAAQ,8BAA8B;AAEnE,SAA6BC,oBAAoB,QAAQ,oBAAoB;AAC7E,SAASC,WAAW,QAAQ,kBAAkB;AA0B9C,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EACtCC,aAAa,GAAGH,oBAAoB;EACpCI,MAAM;EACNC;AAC2B,CAAC,KAA2B;EACvD,MAAMC,UAAU,GAAGL,WAAW,CAAC,CAAC;EAEhC,MAAMM,eAAe,GAAGR,oBAAoB,CAC1CI,aAAa,CAACK,0BAA0B,EACxCL,aAAa,CAACM,kBAAkB,EAChCN,aAAa,CAACM,kBAChB,CAAC;EAGDZ,eAAe,CACb,MACEO,MAAM,GAAGD,aAAa,CAACO,YAAY,CAAC;IAAEJ,UAAU;IAAED;EAAM,CAAC,CAAC,GAAGM,SAAS,EACxE,CAACL,UAAU,EAAEH,aAAa,EAAEC,MAAM,EAAEC,KAAK,CAC3C,CAAC;EAED,OAAOP,OAAO,CACZ,OAAO;IAELc,SAAS,EACPL,eAAe,CAACM,MAAM,GAAG,CAAC,IAAIN,eAAe,CAACO,EAAE,CAAC,CAAC,CAAC,CAAC,KAAKR,UAAU;IAErE,IAAIC,eAAe,CAACQ,IAAI,CACrBC,cAAc,IAAKA,cAAc,KAAKV,UACzC,CAAC,IAAI;MAAEW,kBAAkB,EAAE;IAAE,CAAC;EAChC,CAAC,CAAC,EACF,CAACX,UAAU,EAAEC,eAAe,CAC9B,CAAC;AACH,CAAC","ignoreList":[]}
@@ -14,30 +14,38 @@ import { createContext, useCallback, useContext, useMemo } from "react";
14
14
  import { createOdysseyMuiTheme } from "./theme/theme.js";
15
15
  export const ThemeCacheContext = createContext(null);
16
16
  export const useThemeCache = ({
17
+ colorScheme,
18
+ isEnabled = true,
17
19
  odysseyTokens,
18
20
  shadowRootElement
19
21
  }) => {
20
22
  const existingCache = useContext(ThemeCacheContext);
21
- const localCache = useMemo(() => new Map(), [odysseyTokens, shadowRootElement]);
22
- const getOrCreateTheme = useCallback(mode => {
23
- if (existingCache && existingCache.odysseyTokens === odysseyTokens && existingCache.shadowRootElement === shadowRootElement) {
24
- return existingCache.get(mode);
25
- }
26
- const cached = localCache.get(mode);
27
- if (cached) return cached;
28
- const theme = createOdysseyMuiTheme({
29
- contrastMode: mode,
23
+ const hasMatchingParentCache = Boolean(existingCache && existingCache.colorScheme === colorScheme && existingCache.odysseyTokens === odysseyTokens && existingCache.shadowRootElement === shadowRootElement);
24
+ const localCache = useMemo(() => hasMatchingParentCache || !isEnabled ? undefined : {
25
+ highContrast: createOdysseyMuiTheme({
26
+ colorScheme,
27
+ contrastMode: "highContrast",
30
28
  odysseyTokens,
31
29
  shadowRootElement
32
- });
33
- localCache.set(mode, theme);
34
- return theme;
35
- }, [existingCache, localCache, odysseyTokens, shadowRootElement]);
30
+ }),
31
+ lowContrast: createOdysseyMuiTheme({
32
+ colorScheme,
33
+ contrastMode: "lowContrast",
34
+ odysseyTokens,
35
+ shadowRootElement
36
+ })
37
+ }, [colorScheme, hasMatchingParentCache, isEnabled, odysseyTokens, shadowRootElement]);
38
+ const getOrCreateTheme = useCallback(contrastMode => {
39
+ if (hasMatchingParentCache && existingCache) return existingCache.get(contrastMode);
40
+ if (localCache) return localCache[contrastMode];
41
+ throw new Error("Odyssey theme cache is unavailable");
42
+ }, [existingCache, hasMatchingParentCache, localCache]);
36
43
  const themeCache = useMemo(() => ({
44
+ colorScheme,
37
45
  get: getOrCreateTheme,
38
46
  odysseyTokens,
39
47
  shadowRootElement
40
- }), [getOrCreateTheme, odysseyTokens, shadowRootElement]);
48
+ }), [colorScheme, getOrCreateTheme, odysseyTokens, shadowRootElement]);
41
49
  return {
42
50
  getOrCreateTheme,
43
51
  themeCache
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeCache.js","names":["createContext","useCallback","useContext","useMemo","createOdysseyMuiTheme","ThemeCacheContext","useThemeCache","odysseyTokens","shadowRootElement","existingCache","localCache","Map","getOrCreateTheme","mode","get","cached","theme","contrastMode","set","themeCache"],"sources":["../../src/useThemeCache.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 { Theme } from \"@mui/material/styles\";\nimport { createContext, useCallback, useContext, useMemo } from \"react\";\n\nimport { createOdysseyMuiTheme, DesignTokens } from \"./theme/theme.js\";\nimport { ContrastMode } from \"./useContrastMode.js\";\n\nexport type ThemeCache = {\n get: (contrastMode: ContrastMode) => Theme;\n odysseyTokens: DesignTokens;\n shadowRootElement: HTMLElement | undefined;\n};\n\nexport const ThemeCacheContext = createContext<ThemeCache | null>(null);\n\nexport const useThemeCache = ({\n odysseyTokens,\n shadowRootElement,\n}: {\n odysseyTokens: DesignTokens;\n shadowRootElement: HTMLElement | undefined;\n}) => {\n const existingCache = useContext(ThemeCacheContext);\n\n const localCache = useMemo(\n () => new Map<ContrastMode, Theme>(),\n // Reset the cache when tokens or shadow root change so stale Themes can't be returned for a different DesignTokens/shadowRootElement pair.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [odysseyTokens, shadowRootElement],\n );\n\n const getOrCreateTheme = useCallback(\n (mode: ContrastMode) => {\n if (\n existingCache &&\n existingCache.odysseyTokens === odysseyTokens &&\n existingCache.shadowRootElement === shadowRootElement\n ) {\n return existingCache.get(mode);\n }\n const cached = localCache.get(mode);\n if (cached) return cached;\n const theme = createOdysseyMuiTheme({\n contrastMode: mode,\n odysseyTokens,\n shadowRootElement,\n });\n localCache.set(mode, theme);\n return theme;\n },\n [existingCache, localCache, odysseyTokens, shadowRootElement],\n );\n\n const themeCache = useMemo<ThemeCache>(\n () => ({ get: getOrCreateTheme, odysseyTokens, shadowRootElement }),\n [getOrCreateTheme, odysseyTokens, shadowRootElement],\n );\n\n return { getOrCreateTheme, themeCache };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAEvE,SAASC,qBAAqB,QAAsB,kBAAkB;AAStE,OAAO,MAAMC,iBAAiB,GAAGL,aAAa,CAAoB,IAAI,CAAC;AAEvE,OAAO,MAAMM,aAAa,GAAGA,CAAC;EAC5BC,aAAa;EACbC;AAIF,CAAC,KAAK;EACJ,MAAMC,aAAa,GAAGP,UAAU,CAACG,iBAAiB,CAAC;EAEnD,MAAMK,UAAU,GAAGP,OAAO,CACxB,MAAM,IAAIQ,GAAG,CAAsB,CAAC,EAGpC,CAACJ,aAAa,EAAEC,iBAAiB,CACnC,CAAC;EAED,MAAMI,gBAAgB,GAAGX,WAAW,CACjCY,IAAkB,IAAK;IACtB,IACEJ,aAAa,IACbA,aAAa,CAACF,aAAa,KAAKA,aAAa,IAC7CE,aAAa,CAACD,iBAAiB,KAAKA,iBAAiB,EACrD;MACA,OAAOC,aAAa,CAACK,GAAG,CAACD,IAAI,CAAC;IAChC;IACA,MAAME,MAAM,GAAGL,UAAU,CAACI,GAAG,CAACD,IAAI,CAAC;IACnC,IAAIE,MAAM,EAAE,OAAOA,MAAM;IACzB,MAAMC,KAAK,GAAGZ,qBAAqB,CAAC;MAClCa,YAAY,EAAEJ,IAAI;MAClBN,aAAa;MACbC;IACF,CAAC,CAAC;IACFE,UAAU,CAACQ,GAAG,CAACL,IAAI,EAAEG,KAAK,CAAC;IAC3B,OAAOA,KAAK;EACd,CAAC,EACD,CAACP,aAAa,EAAEC,UAAU,EAAEH,aAAa,EAAEC,iBAAiB,CAC9D,CAAC;EAED,MAAMW,UAAU,GAAGhB,OAAO,CACxB,OAAO;IAAEW,GAAG,EAAEF,gBAAgB;IAAEL,aAAa;IAAEC;EAAkB,CAAC,CAAC,EACnE,CAACI,gBAAgB,EAAEL,aAAa,EAAEC,iBAAiB,CACrD,CAAC;EAED,OAAO;IAAEI,gBAAgB;IAAEO;EAAW,CAAC;AACzC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"useThemeCache.js","names":["createContext","useCallback","useContext","useMemo","createOdysseyMuiTheme","ThemeCacheContext","useThemeCache","colorScheme","isEnabled","odysseyTokens","shadowRootElement","existingCache","hasMatchingParentCache","Boolean","localCache","undefined","highContrast","contrastMode","lowContrast","getOrCreateTheme","get","Error","themeCache"],"sources":["../../src/useThemeCache.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 { Theme } from \"@mui/material/styles\";\nimport { createContext, useCallback, useContext, useMemo } from \"react\";\n\nimport { createOdysseyMuiTheme, DesignTokens } from \"./theme/theme.js\";\nimport { type ResolvedColorScheme } from \"./useColorScheme.js\";\nimport { ContrastMode } from \"./useContrastMode.js\";\n\nexport type ThemeCache = {\n colorScheme: ResolvedColorScheme;\n get: (contrastMode: ContrastMode) => Theme;\n odysseyTokens: DesignTokens;\n shadowRootElement?: HTMLElement;\n};\n\nexport const ThemeCacheContext = createContext<ThemeCache | null>(null);\n\nexport const useThemeCache = ({\n colorScheme,\n isEnabled = true,\n odysseyTokens,\n shadowRootElement,\n}: UseThemeCacheArgs) => {\n const existingCache = useContext(ThemeCacheContext);\n const hasMatchingParentCache = Boolean(\n existingCache &&\n existingCache.colorScheme === colorScheme &&\n existingCache.odysseyTokens === odysseyTokens &&\n existingCache.shadowRootElement === shadowRootElement,\n );\n\n const localCache = useMemo(\n () =>\n hasMatchingParentCache || !isEnabled\n ? undefined\n : {\n highContrast: createOdysseyMuiTheme({\n colorScheme,\n contrastMode: \"highContrast\",\n odysseyTokens,\n shadowRootElement,\n }),\n lowContrast: createOdysseyMuiTheme({\n colorScheme,\n contrastMode: \"lowContrast\",\n odysseyTokens,\n shadowRootElement,\n }),\n },\n [\n colorScheme,\n hasMatchingParentCache,\n isEnabled,\n odysseyTokens,\n shadowRootElement,\n ],\n );\n\n const getOrCreateTheme = useCallback(\n (contrastMode: ContrastMode) => {\n if (hasMatchingParentCache && existingCache)\n return existingCache.get(contrastMode);\n if (localCache) return localCache[contrastMode];\n throw new Error(\"Odyssey theme cache is unavailable\");\n },\n [existingCache, hasMatchingParentCache, localCache],\n );\n\n const themeCache = useMemo<ThemeCache>(\n () => ({\n colorScheme,\n get: getOrCreateTheme,\n odysseyTokens,\n shadowRootElement,\n }),\n [colorScheme, getOrCreateTheme, odysseyTokens, shadowRootElement],\n );\n\n return { getOrCreateTheme, themeCache };\n};\n\nexport type UseThemeCacheArgs = {\n colorScheme: ResolvedColorScheme;\n /**\n * If `false`, builds no themes. A provider passes `false` for a scheme it is not rendering when it cannot switch to that scheme on its own, so it never builds themes nothing reads.\n * @default true\n */\n isEnabled?: boolean;\n odysseyTokens: DesignTokens;\n shadowRootElement?: HTMLElement;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAEvE,SAASC,qBAAqB,QAAsB,kBAAkB;AAWtE,OAAO,M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