@okta/odyssey-react-mui 1.28.1 → 1.29.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 (326) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/Breadcrumbs.js +1 -0
  3. package/dist/Breadcrumbs.js.map +1 -1
  4. package/dist/Buttons/MenuItem.js +1 -0
  5. package/dist/Buttons/MenuItem.js.map +1 -1
  6. package/dist/Checkbox.js +62 -35
  7. package/dist/Checkbox.js.map +1 -1
  8. package/dist/DataTable/reorderDataRowsLocally.js.map +1 -1
  9. package/dist/DataTable/useRowReordering.js.map +1 -1
  10. package/dist/HtmlProps.js.map +1 -1
  11. package/dist/Pagination/Pagination.js +2 -1
  12. package/dist/Pagination/Pagination.js.map +1 -1
  13. package/dist/Radio.js +65 -38
  14. package/dist/Radio.js.map +1 -1
  15. package/dist/Typography.js +20 -0
  16. package/dist/Typography.js.map +1 -1
  17. package/dist/index.scss +1 -1
  18. package/dist/labs/DataFilters.js +9 -5
  19. package/dist/labs/DataFilters.js.map +1 -1
  20. package/dist/labs/DataTable.js +7 -7
  21. package/dist/labs/DataTable.js.map +1 -1
  22. package/dist/labs/DataView/BulkActionsMenu.js.map +1 -1
  23. package/dist/labs/DataView/CardLayoutContent.js +6 -5
  24. package/dist/labs/DataView/CardLayoutContent.js.map +1 -1
  25. package/dist/labs/DataView/DataCard.js +1 -0
  26. package/dist/labs/DataView/DataCard.js.map +1 -1
  27. package/dist/labs/DataView/DataTable.js.map +1 -1
  28. package/dist/labs/DataView/DataView.js +2 -2
  29. package/dist/labs/DataView/DataView.js.map +1 -1
  30. package/dist/labs/DataView/DetailPanel.js.map +1 -1
  31. package/dist/labs/DataView/RowActions.js.map +1 -1
  32. package/dist/labs/DataView/TableLayoutContent.js +1 -1
  33. package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
  34. package/dist/labs/DataView/TableSettings.js.map +1 -1
  35. package/dist/labs/DataView/componentTypes.js.map +1 -1
  36. package/dist/labs/DataView/dataTypes.js.map +1 -1
  37. package/dist/labs/DataView/fetchData.js.map +1 -1
  38. package/dist/labs/DataView/testSupportData.js +201 -0
  39. package/dist/labs/DataView/testSupportData.js.map +1 -0
  40. package/dist/labs/DataView/useFilterConversion.js.map +1 -1
  41. package/dist/labs/{DateField.js → DatePickers/DateField.js} +1 -1
  42. package/dist/labs/DatePickers/DateField.js.map +1 -0
  43. package/dist/labs/DatePickers/DateFieldActionBar.js +56 -0
  44. package/dist/labs/DatePickers/DateFieldActionBar.js.map +1 -0
  45. package/dist/labs/DatePickers/DateFieldLocalizationProvider.js +32 -0
  46. package/dist/labs/DatePickers/DateFieldLocalizationProvider.js.map +1 -0
  47. package/dist/labs/{DatePicker.js → DatePickers/DatePicker.js} +30 -73
  48. package/dist/labs/DatePickers/DatePicker.js.map +1 -0
  49. package/dist/labs/DatePickers/DatePicker.types.d.js.map +1 -0
  50. package/dist/labs/DatePickers/DateTimeField.js +166 -0
  51. package/dist/labs/DatePickers/DateTimeField.js.map +1 -0
  52. package/dist/labs/DatePickers/DateTimePicker.js +233 -0
  53. package/dist/labs/DatePickers/DateTimePicker.js.map +1 -0
  54. package/dist/labs/{datePickerTheme.js → DatePickers/datePickerTheme.js} +2 -2
  55. package/dist/labs/DatePickers/datePickerTheme.js.map +1 -0
  56. package/dist/labs/DatePickers/dateTimePickerTheme.js +230 -0
  57. package/dist/labs/DatePickers/dateTimePickerTheme.js.map +1 -0
  58. package/dist/labs/DatePickers/index.js +15 -0
  59. package/dist/labs/DatePickers/index.js.map +1 -0
  60. package/dist/labs/DatePickers/useDateFieldsTranslations.js.map +1 -0
  61. package/dist/labs/{useOdysseyDateFields.js → DatePickers/useOdysseyDateFields.js} +36 -3
  62. package/dist/labs/DatePickers/useOdysseyDateFields.js.map +1 -0
  63. package/dist/labs/PageTemplate.js +1 -1
  64. package/dist/labs/PageTemplate.js.map +1 -1
  65. package/dist/labs/SideNav/SideNav.js +40 -34
  66. package/dist/labs/SideNav/SideNav.js.map +1 -1
  67. package/dist/labs/SideNav/SideNavHeader.js +6 -4
  68. package/dist/labs/SideNav/SideNavHeader.js.map +1 -1
  69. package/dist/labs/SideNav/SideNavItemContent.js +11 -11
  70. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -1
  71. package/dist/labs/SideNav/SideNavToggleButton.js +1 -1
  72. package/dist/labs/SideNav/SideNavToggleButton.js.map +1 -1
  73. package/dist/labs/SideNav/types.js.map +1 -1
  74. package/dist/labs/TimeZonePicker.js.map +1 -1
  75. package/dist/labs/index.js +1 -3
  76. package/dist/labs/index.js.map +1 -1
  77. package/dist/properties/ts/odyssey-react-mui.js +2 -0
  78. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  79. package/dist/src/Breadcrumbs.d.ts.map +1 -1
  80. package/dist/src/Buttons/MenuItem.d.ts.map +1 -1
  81. package/dist/src/Checkbox.d.ts.map +1 -1
  82. package/dist/src/DataTable/reorderDataRowsLocally.d.ts +3 -3
  83. package/dist/src/DataTable/reorderDataRowsLocally.d.ts.map +1 -1
  84. package/dist/src/DataTable/useRowReordering.d.ts +10 -10
  85. package/dist/src/DataTable/useRowReordering.d.ts.map +1 -1
  86. package/dist/src/HtmlProps.d.ts +27 -0
  87. package/dist/src/HtmlProps.d.ts.map +1 -1
  88. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  89. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  90. package/dist/src/Radio.d.ts +1 -1
  91. package/dist/src/Radio.d.ts.map +1 -1
  92. package/dist/src/Typography.d.ts +11 -11
  93. package/dist/src/Typography.d.ts.map +1 -1
  94. package/dist/src/labs/DataFilters.d.ts.map +1 -1
  95. package/dist/src/labs/DataTable.d.ts +11 -11
  96. package/dist/src/labs/DataTable.d.ts.map +1 -1
  97. package/dist/src/labs/DataView/BulkActionsMenu.d.ts +3 -3
  98. package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -1
  99. package/dist/src/labs/DataView/CardLayoutContent.d.ts +18 -15
  100. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -1
  101. package/dist/src/labs/DataView/DataCard.d.ts +7 -4
  102. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -1
  103. package/dist/src/labs/DataView/DataTable.d.ts +6 -2
  104. package/dist/src/labs/DataView/DataTable.d.ts.map +1 -1
  105. package/dist/src/labs/DataView/DataView.d.ts +6 -2
  106. package/dist/src/labs/DataView/DataView.d.ts.map +1 -1
  107. package/dist/src/labs/DataView/DetailPanel.d.ts +5 -5
  108. package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -1
  109. package/dist/src/labs/DataView/RowActions.d.ts +3 -3
  110. package/dist/src/labs/DataView/RowActions.d.ts.map +1 -1
  111. package/dist/src/labs/DataView/TableLayoutContent.d.ts +18 -15
  112. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
  113. package/dist/src/labs/DataView/TableSettings.d.ts +7 -3
  114. package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -1
  115. package/dist/src/labs/DataView/componentTypes.d.ts +17 -17
  116. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -1
  117. package/dist/src/labs/DataView/dataTypes.d.ts +6 -6
  118. package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -1
  119. package/dist/src/labs/DataView/fetchData.d.ts +6 -6
  120. package/dist/src/labs/DataView/fetchData.d.ts.map +1 -1
  121. package/dist/src/labs/DataView/testSupportData.d.ts +33 -0
  122. package/dist/src/labs/DataView/testSupportData.d.ts.map +1 -0
  123. package/dist/src/labs/DataView/useFilterConversion.d.ts +5 -4
  124. package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -1
  125. package/dist/src/labs/{DateField.d.ts → DatePickers/DateField.d.ts} +1 -1
  126. package/dist/src/labs/DatePickers/DateField.d.ts.map +1 -0
  127. package/dist/src/labs/DatePickers/DateFieldActionBar.d.ts +15 -0
  128. package/dist/src/labs/DatePickers/DateFieldActionBar.d.ts.map +1 -0
  129. package/dist/src/labs/DatePickers/DateFieldLocalizationProvider.d.ts +20 -0
  130. package/dist/src/labs/DatePickers/DateFieldLocalizationProvider.d.ts.map +1 -0
  131. package/dist/src/labs/DatePickers/DatePicker.d.ts +17 -0
  132. package/dist/src/labs/DatePickers/DatePicker.d.ts.map +1 -0
  133. package/dist/src/labs/DatePickers/DateTimeField.d.ts +20 -0
  134. package/dist/src/labs/DatePickers/DateTimeField.d.ts.map +1 -0
  135. package/dist/src/labs/DatePickers/DateTimePicker.d.ts +17 -0
  136. package/dist/src/labs/DatePickers/DateTimePicker.d.ts.map +1 -0
  137. package/dist/src/labs/DatePickers/datePickerTheme.d.ts +22 -0
  138. package/dist/src/labs/DatePickers/datePickerTheme.d.ts.map +1 -0
  139. package/dist/src/labs/{datePickerTheme.d.ts → DatePickers/dateTimePickerTheme.d.ts} +2 -2
  140. package/dist/src/labs/DatePickers/dateTimePickerTheme.d.ts.map +1 -0
  141. package/dist/src/labs/DatePickers/index.d.ts +15 -0
  142. package/dist/src/labs/DatePickers/index.d.ts.map +1 -0
  143. package/dist/src/labs/DatePickers/useDateFieldsTranslations.d.ts.map +1 -0
  144. package/dist/src/labs/{useOdysseyDateFields.d.ts → DatePickers/useOdysseyDateFields.d.ts} +49 -6
  145. package/dist/src/labs/DatePickers/useOdysseyDateFields.d.ts.map +1 -0
  146. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -1
  147. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -1
  148. package/dist/src/labs/SideNav/SideNavItemContent.d.ts +1 -1
  149. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -1
  150. package/dist/src/labs/SideNav/types.d.ts +2 -2
  151. package/dist/src/labs/SideNav/types.d.ts.map +1 -1
  152. package/dist/src/labs/TimeZonePicker.d.ts +4 -1
  153. package/dist/src/labs/TimeZonePicker.d.ts.map +1 -1
  154. package/dist/src/labs/index.d.ts +1 -3
  155. package/dist/src/labs/index.d.ts.map +1 -1
  156. package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -0
  157. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  158. package/dist/src/theme/components.d.ts.map +1 -1
  159. package/dist/src/theme/mixins.d.ts.map +1 -1
  160. package/dist/src/theme/mixins.types.d.ts +2 -0
  161. package/dist/src/theme/mixins.types.d.ts.map +1 -1
  162. package/dist/src/{labs → ui-shell}/UiShell/UiShell.d.ts +2 -2
  163. package/dist/src/ui-shell/UiShell/UiShell.d.ts.map +1 -0
  164. package/dist/src/{labs → ui-shell}/UiShell/UiShellContent.d.ts +12 -8
  165. package/dist/src/ui-shell/UiShell/UiShellContent.d.ts.map +1 -0
  166. package/dist/src/ui-shell/UiShell/bufferLatest.d.ts.map +1 -0
  167. package/dist/src/ui-shell/UiShell/createMessageBus.d.ts.map +1 -0
  168. package/dist/src/ui-shell/UiShell/createStore.d.ts.map +1 -0
  169. package/dist/src/ui-shell/UiShell/index.d.ts.map +1 -0
  170. package/dist/src/{labs → ui-shell}/UiShell/renderUiShell.d.ts +3 -4
  171. package/dist/src/ui-shell/UiShell/renderUiShell.d.ts.map +1 -0
  172. package/dist/src/{labs → ui-shell}/UiShell/useHasUiShell.d.ts +1 -0
  173. package/dist/src/ui-shell/UiShell/useHasUiShell.d.ts.map +1 -0
  174. package/dist/src/ui-shell/UiShell/useScrollState.d.ts.map +1 -0
  175. package/dist/src/ui-shell/index.d.ts +14 -0
  176. package/dist/src/ui-shell/index.d.ts.map +1 -0
  177. package/dist/src/{web-component → ui-shell}/renderReactInWebComponent.d.ts +3 -23
  178. package/dist/src/ui-shell/renderReactInWebComponent.d.ts.map +1 -0
  179. package/dist/src/web-component/index.d.ts +0 -1
  180. package/dist/src/web-component/index.d.ts.map +1 -1
  181. package/dist/src/web-component/shadow-dom.d.ts +23 -2
  182. package/dist/src/web-component/shadow-dom.d.ts.map +1 -1
  183. package/dist/theme/components.js +38 -4
  184. package/dist/theme/components.js.map +1 -1
  185. package/dist/theme/mixins.js +2 -1
  186. package/dist/theme/mixins.js.map +1 -1
  187. package/dist/theme/mixins.types.js.map +1 -1
  188. package/dist/tsconfig.production.tsbuildinfo +1 -1
  189. package/dist/{labs → ui-shell}/UiShell/UiShell.js +2 -0
  190. package/dist/ui-shell/UiShell/UiShell.js.map +1 -0
  191. package/dist/{labs → ui-shell}/UiShell/UiShellContent.js +19 -11
  192. package/dist/ui-shell/UiShell/UiShellContent.js.map +1 -0
  193. package/dist/ui-shell/UiShell/bufferLatest.js.map +1 -0
  194. package/dist/ui-shell/UiShell/createMessageBus.js.map +1 -0
  195. package/dist/ui-shell/UiShell/createStore.js.map +1 -0
  196. package/dist/ui-shell/UiShell/index.js.map +1 -0
  197. package/dist/{labs → ui-shell}/UiShell/renderUiShell.js +4 -2
  198. package/dist/ui-shell/UiShell/renderUiShell.js.map +1 -0
  199. package/dist/{labs → ui-shell}/UiShell/useHasUiShell.js +1 -1
  200. package/dist/ui-shell/UiShell/useHasUiShell.js.map +1 -0
  201. package/dist/ui-shell/UiShell/useScrollState.js.map +1 -0
  202. package/dist/ui-shell/index.js +14 -0
  203. package/dist/ui-shell/index.js.map +1 -0
  204. package/dist/{web-component → ui-shell}/renderReactInWebComponent.js +7 -17
  205. package/dist/ui-shell/renderReactInWebComponent.js.map +1 -0
  206. package/dist/web-component/index.js +0 -1
  207. package/dist/web-component/index.js.map +1 -1
  208. package/dist/web-component/shadow-dom.js +12 -2
  209. package/dist/web-component/shadow-dom.js.map +1 -1
  210. package/package.json +10 -3
  211. package/src/Breadcrumbs.tsx +5 -1
  212. package/src/Buttons/MenuItem.tsx +1 -0
  213. package/src/Checkbox.tsx +86 -44
  214. package/src/DataTable/reorderDataRowsLocally.tsx +3 -3
  215. package/src/DataTable/useRowReordering.tsx +16 -23
  216. package/src/HtmlProps.ts +27 -0
  217. package/src/Pagination/Pagination.tsx +2 -2
  218. package/src/Radio.tsx +78 -39
  219. package/src/Typography.tsx +26 -1
  220. package/src/labs/DataFilters.tsx +7 -3
  221. package/src/labs/DataTable.tsx +41 -33
  222. package/src/labs/DataView/BulkActionsMenu.tsx +4 -4
  223. package/src/labs/DataView/CardLayoutContent.tsx +34 -28
  224. package/src/labs/DataView/DataCard.tsx +13 -6
  225. package/src/labs/DataView/DataTable.tsx +11 -4
  226. package/src/labs/DataView/DataView.test.tsx +1012 -87
  227. package/src/labs/DataView/DataView.tsx +18 -11
  228. package/src/labs/DataView/DetailPanel.tsx +4 -4
  229. package/src/labs/DataView/RowActions.tsx +4 -4
  230. package/src/labs/DataView/TableLayoutContent.tsx +30 -24
  231. package/src/labs/DataView/TableSettings.tsx +12 -6
  232. package/src/labs/DataView/componentTypes.ts +17 -17
  233. package/src/labs/DataView/dataTypes.ts +14 -8
  234. package/src/labs/DataView/fetchData.ts +9 -7
  235. package/src/labs/DataView/testSupportData.tsx +301 -0
  236. package/src/labs/DataView/useFilterConversion.ts +8 -8
  237. package/src/labs/{DateField.tsx → DatePickers/DateField.tsx} +2 -2
  238. package/src/labs/DatePickers/DateFieldActionBar.tsx +65 -0
  239. package/src/labs/DatePickers/DateFieldLocalizationProvider.tsx +46 -0
  240. package/src/labs/{DatePicker.tsx → DatePickers/DatePicker.tsx} +31 -136
  241. package/src/labs/DatePickers/DateTimeField.tsx +271 -0
  242. package/src/labs/DatePickers/DateTimePicker.test.tsx +66 -0
  243. package/src/labs/DatePickers/DateTimePicker.tsx +303 -0
  244. package/src/labs/{datePickerTheme.tsx → DatePickers/datePickerTheme.tsx} +2 -2
  245. package/src/labs/DatePickers/dateTimePickerTheme.ts +213 -0
  246. package/src/labs/DatePickers/index.ts +15 -0
  247. package/src/labs/{useOdysseyDateFields.ts → DatePickers/useOdysseyDateFields.ts} +112 -10
  248. package/src/labs/PageTemplate.tsx +1 -1
  249. package/src/labs/SideNav/SideNav.tsx +38 -39
  250. package/src/labs/SideNav/SideNavHeader.tsx +6 -4
  251. package/src/labs/SideNav/SideNavItemContent.tsx +21 -18
  252. package/src/labs/SideNav/SideNavToggleButton.tsx +1 -1
  253. package/src/labs/SideNav/types.ts +2 -2
  254. package/src/labs/TimeZonePicker.tsx +5 -1
  255. package/src/labs/index.ts +2 -3
  256. package/src/properties/odyssey-react-mui.properties +2 -0
  257. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  258. package/src/theme/components.tsx +45 -4
  259. package/src/theme/mixins.ts +1 -0
  260. package/src/theme/mixins.types.ts +2 -0
  261. package/src/{labs → ui-shell}/UiShell/UiShell.tsx +3 -0
  262. package/src/{labs → ui-shell}/UiShell/UiShellContent.tsx +60 -31
  263. package/src/{labs → ui-shell}/UiShell/renderUiShell.test.tsx +16 -22
  264. package/src/{labs → ui-shell}/UiShell/renderUiShell.tsx +7 -4
  265. package/src/{labs → ui-shell}/UiShell/useHasUiShell.ts +1 -1
  266. package/src/ui-shell/index.ts +14 -0
  267. package/src/{web-component → ui-shell}/renderReactInWebComponent.test.tsx +1 -1
  268. package/src/{web-component → ui-shell}/renderReactInWebComponent.ts +9 -45
  269. package/src/web-component/index.ts +0 -1
  270. package/src/web-component/shadow-dom.ts +36 -3
  271. package/dist/labs/DateField.js.map +0 -1
  272. package/dist/labs/DatePicker.js.map +0 -1
  273. package/dist/labs/DatePicker.types.d.js.map +0 -1
  274. package/dist/labs/UiShell/UiShell.js.map +0 -1
  275. package/dist/labs/UiShell/UiShellContent.js.map +0 -1
  276. package/dist/labs/UiShell/bufferLatest.js.map +0 -1
  277. package/dist/labs/UiShell/createMessageBus.js.map +0 -1
  278. package/dist/labs/UiShell/createStore.js.map +0 -1
  279. package/dist/labs/UiShell/index.js.map +0 -1
  280. package/dist/labs/UiShell/renderUiShell.js.map +0 -1
  281. package/dist/labs/UiShell/useHasUiShell.js.map +0 -1
  282. package/dist/labs/UiShell/useScrollState.js.map +0 -1
  283. package/dist/labs/datePickerTheme.js.map +0 -1
  284. package/dist/labs/useDateFieldsTranslations.js.map +0 -1
  285. package/dist/labs/useOdysseyDateFields.js.map +0 -1
  286. package/dist/src/labs/DateField.d.ts.map +0 -1
  287. package/dist/src/labs/DatePicker.d.ts +0 -47
  288. package/dist/src/labs/DatePicker.d.ts.map +0 -1
  289. package/dist/src/labs/UiShell/UiShell.d.ts.map +0 -1
  290. package/dist/src/labs/UiShell/UiShellContent.d.ts.map +0 -1
  291. package/dist/src/labs/UiShell/bufferLatest.d.ts.map +0 -1
  292. package/dist/src/labs/UiShell/createMessageBus.d.ts.map +0 -1
  293. package/dist/src/labs/UiShell/createStore.d.ts.map +0 -1
  294. package/dist/src/labs/UiShell/index.d.ts.map +0 -1
  295. package/dist/src/labs/UiShell/renderUiShell.d.ts.map +0 -1
  296. package/dist/src/labs/UiShell/useHasUiShell.d.ts.map +0 -1
  297. package/dist/src/labs/UiShell/useScrollState.d.ts.map +0 -1
  298. package/dist/src/labs/datePickerTheme.d.ts.map +0 -1
  299. package/dist/src/labs/useDateFieldsTranslations.d.ts.map +0 -1
  300. package/dist/src/labs/useOdysseyDateFields.d.ts.map +0 -1
  301. package/dist/src/web-component/renderReactInWebComponent.d.ts.map +0 -1
  302. package/dist/web-component/renderReactInWebComponent.js.map +0 -1
  303. /package/dist/labs/{DatePicker.types.d.js → DatePickers/DatePicker.types.d.js} +0 -0
  304. /package/dist/labs/{useDateFieldsTranslations.js → DatePickers/useDateFieldsTranslations.js} +0 -0
  305. /package/dist/src/labs/{useDateFieldsTranslations.d.ts → DatePickers/useDateFieldsTranslations.d.ts} +0 -0
  306. /package/dist/src/{labs → ui-shell}/UiShell/bufferLatest.d.ts +0 -0
  307. /package/dist/src/{labs → ui-shell}/UiShell/createMessageBus.d.ts +0 -0
  308. /package/dist/src/{labs → ui-shell}/UiShell/createStore.d.ts +0 -0
  309. /package/dist/src/{labs → ui-shell}/UiShell/index.d.ts +0 -0
  310. /package/dist/src/{labs → ui-shell}/UiShell/useScrollState.d.ts +0 -0
  311. /package/dist/{labs → ui-shell}/UiShell/bufferLatest.js +0 -0
  312. /package/dist/{labs → ui-shell}/UiShell/createMessageBus.js +0 -0
  313. /package/dist/{labs → ui-shell}/UiShell/createStore.js +0 -0
  314. /package/dist/{labs → ui-shell}/UiShell/index.js +0 -0
  315. /package/dist/{labs → ui-shell}/UiShell/useScrollState.js +0 -0
  316. /package/src/labs/{DatePicker.types.d.ts → DatePickers/DatePicker.types.d.ts} +0 -0
  317. /package/src/labs/{useDateFieldsTranslations.ts → DatePickers/useDateFieldsTranslations.ts} +0 -0
  318. /package/src/{labs → ui-shell}/UiShell/UiShell.test.tsx +0 -0
  319. /package/src/{labs → ui-shell}/UiShell/bufferLatest.test.ts +0 -0
  320. /package/src/{labs → ui-shell}/UiShell/bufferLatest.ts +0 -0
  321. /package/src/{labs → ui-shell}/UiShell/createMessageBus.test.ts +0 -0
  322. /package/src/{labs → ui-shell}/UiShell/createMessageBus.ts +0 -0
  323. /package/src/{labs → ui-shell}/UiShell/createStore.test.ts +0 -0
  324. /package/src/{labs → ui-shell}/UiShell/createStore.ts +0 -0
  325. /package/src/{labs → ui-shell}/UiShell/index.ts +0 -0
  326. /package/src/{labs → ui-shell}/UiShell/useScrollState.ts +0 -0
@@ -25,6 +25,7 @@ const UiShell = ({
25
25
  appBackgroundContrastMode,
26
26
  appComponent,
27
27
  appRootElement,
28
+ hasStandardAppContentPadding,
28
29
  initialVisibleSections,
29
30
  onError = console.error,
30
31
  onSubscriptionCreated,
@@ -55,6 +56,7 @@ const UiShell = ({
55
56
  ...componentProps,
56
57
  appBackgroundContrastMode: appBackgroundContrastMode,
57
58
  appComponent: appComponent,
59
+ hasStandardAppContentPadding: hasStandardAppContentPadding,
58
60
  initialVisibleSections: initialVisibleSections,
59
61
  onError: onError,
60
62
  optionalComponents: optionalComponents
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiShell.js","names":["memo","useEffect","useState","ErrorBoundary","CssBaseline","OdysseyProvider","UiShellContent","jsx","_jsx","jsxs","_jsxs","defaultComponentProps","sideNavProps","undefined","topNavProps","UiShell","appBackgroundContrastMode","appComponent","appRootElement","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","stylesRootElement","subscribeToPropChanges","componentProps","setComponentProps","unsubscribe","fallback","children","emotionRootElement","shadowRootElement","MemoizedUiShell","displayName"],"sources":["../../../src/ui-shell/UiShell/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, useEffect, useState, type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { CssBaseline } from \"../../CssBaseline\";\nimport { OdysseyProvider } from \"../../OdysseyProvider\";\nimport {\n UiShellContent,\n type UiShellContentProps,\n type UiShellNavComponentProps,\n} from \"./UiShellContent\";\nimport { type ReactRootElements } from \"../../web-component\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\nexport type UiShellProps = {\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: (\n subscriber: (\n componentProps: SetStateAction<UiShellNavComponentProps>,\n ) => void,\n ) => () => void;\n} & Pick<ReactRootElements, \"appRootElement\" | \"stylesRootElement\"> &\n Pick<\n UiShellContentProps,\n | \"appBackgroundContrastMode\"\n | \"appComponent\"\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 appBackgroundContrastMode,\n appComponent,\n appRootElement,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n stylesRootElement,\n subscribeToPropChanges,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n useEffect(() => {\n const unsubscribe = subscribeToPropChanges((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 onSubscriptionCreated();\n\n return () => {\n unsubscribe();\n };\n }, [onSubscriptionCreated, subscribeToPropChanges]);\n\n return (\n <ErrorBoundary fallback={appComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={stylesRootElement}\n shadowRootElement={appRootElement}\n >\n <ErrorBoundary fallback={appComponent} onError={onError}>\n <CssBaseline />\n\n <UiShellContent\n {...componentProps}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appComponent={appComponent}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\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,EAAEC,SAAS,EAAEC,QAAQ,QAA6B,OAAO;AACtE,SAASC,aAAa,QAAQ,sBAAsB;AAAC,SAE5CC,WAAW;AAAA,SACXC,eAAe;AAAA,SAEtBC,cAAc;AAAA,SAAA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sBAAuB;UAC/CC,OAAO,EAAEA,OAAQ;UACjBI,kBAAkB,EAAEA;QAAmB,CACxC,CAAC;MAAA,CACW;IAAC,CACD;EAAC,CACL,CAAC;AAEpB,CAAC;AAED,MAAMU,eAAe,GAAGnC,IAAI,CAACe,OAAO,CAAC;AACrCoB,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIpB,OAAO"}
@@ -13,26 +13,29 @@
13
13
  import styled from "@emotion/styled";
14
14
  import { memo } from "react";
15
15
  import { ErrorBoundary } from "react-error-boundary";
16
- import { AppSwitcher } from "../AppSwitcher/index.js";
17
- import { SideNav } from "../SideNav/index.js";
18
- import { TopNav } from "../TopNav/index.js";
16
+ import { AppSwitcher } from "../../labs/AppSwitcher/index.js";
17
+ import { SideNav } from "../../labs/SideNav/index.js";
18
+ import { TopNav } from "../../labs/TopNav/index.js";
19
19
  import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
20
20
  import { useScrollState } from "./useScrollState.js";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
23
  const emptySideNavItems = [];
24
24
  const StyledAppContainer = styled("div", {
25
- shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "appBackgroundContrastMode"
25
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "appBackgroundContrastMode" && prop !== "hasStandardAppContentPadding"
26
26
  })(({
27
27
  appBackgroundContrastMode,
28
+ hasStandardAppContentPadding,
28
29
  odysseyDesignTokens
29
30
  }) => ({
30
31
  gridArea: "app-content",
31
32
  overflowX: "hidden",
32
33
  overflowY: "auto",
33
- paddingBlock: odysseyDesignTokens.Spacing5,
34
- paddingInline: odysseyDesignTokens.Spacing8,
35
- backgroundColor: appBackgroundContrastMode === "highContrast" ? odysseyDesignTokens.HueNeutralWhite : odysseyDesignTokens.HueNeutral50
34
+ backgroundColor: appBackgroundContrastMode === "highContrast" ? odysseyDesignTokens.HueNeutralWhite : odysseyDesignTokens.HueNeutral50,
35
+ ...(hasStandardAppContentPadding && {
36
+ paddingBlock: odysseyDesignTokens.Spacing5,
37
+ paddingInline: odysseyDesignTokens.Spacing8
38
+ })
36
39
  }));
37
40
  const StyledBannersContainer = styled("div")(() => ({
38
41
  gridArea: "banners"
@@ -68,6 +71,7 @@ export const subComponentNames = ["TopNav", "SideNav", "AppSwitcher"];
68
71
  const UiShellContent = ({
69
72
  appBackgroundContrastMode = "lowContrast",
70
73
  appComponent,
74
+ hasStandardAppContentPadding = true,
71
75
  initialVisibleSections = ["TopNav", "SideNav", "AppSwitcher"],
72
76
  onError = console.error,
73
77
  optionalComponents,
@@ -101,7 +105,7 @@ const UiShellContent = ({
101
105
  })
102
106
  })]
103
107
  }), _jsxs(StyledSideNavContainer, {
104
- children: [initialVisibleSections?.includes("SideNav") && !sideNavProps && _jsx(ErrorBoundary, {
108
+ children: [initialVisibleSections?.includes("SideNav") && sideNavProps === undefined && _jsx(ErrorBoundary, {
105
109
  fallback: null,
106
110
  onError: onError,
107
111
  children: _jsx(SideNav, {
@@ -125,10 +129,13 @@ const UiShellContent = ({
125
129
  })
126
130
  })]
127
131
  }), _jsxs(StyledTopNavContainer, {
128
- children: [initialVisibleSections?.includes("TopNav") && !topNavProps && _jsx(ErrorBoundary, {
132
+ children: [initialVisibleSections?.includes("TopNav") && topNavProps === undefined && _jsx(ErrorBoundary, {
129
133
  fallback: null,
130
134
  onError: onError,
131
- children: _jsx(TopNav, {})
135
+ children: _jsx(TopNav, {
136
+ leftSideComponent: optionalComponents?.topNavLeftSide,
137
+ rightSideComponent: optionalComponents?.topNavRightSide
138
+ })
132
139
  }), topNavProps && _jsx(ErrorBoundary, {
133
140
  fallback: null,
134
141
  onError: onError,
@@ -140,8 +147,9 @@ const UiShellContent = ({
140
147
  })
141
148
  })]
142
149
  }), _jsx(StyledAppContainer, {
143
- odysseyDesignTokens: odysseyDesignTokens,
144
150
  appBackgroundContrastMode: appBackgroundContrastMode,
151
+ hasStandardAppContentPadding: hasStandardAppContentPadding,
152
+ odysseyDesignTokens: odysseyDesignTokens,
145
153
  ref: scrollableContentRef,
146
154
  tabIndex: 0,
147
155
  children: appComponent
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiShellContent.js","names":["styled","memo","ErrorBoundary","AppSwitcher","SideNav","TopNav","useOdysseyDesignTokens","useScrollState","jsx","_jsx","jsxs","_jsxs","emptySideNavItems","StyledAppContainer","shouldForwardProp","prop","appBackgroundContrastMode","hasStandardAppContentPadding","odysseyDesignTokens","gridArea","overflowX","overflowY","backgroundColor","HueNeutralWhite","HueNeutral50","paddingBlock","Spacing5","paddingInline","Spacing8","StyledBannersContainer","StyledAppSwitcherContainer","StyledSideNavContainer","StyledShellContainer","display","gridGap","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","width","StyledTopNavContainer","subComponentNames","UiShellContent","appComponent","initialVisibleSections","onError","console","error","optionalComponents","appSwitcherProps","sideNavProps","topNavProps","isContentScrolled","scrollableContentRef","children","banners","includes","fallback","isLoading","appIcons","selectedAppName","undefined","appName","sideNavItems","hasCustomFooter","sideNavFooter","footerComponent","footerItems","leftSideComponent","topNavLeftSide","rightSideComponent","topNavRightSide","isScrolled","ref","tabIndex","MemoizedUiShellContent","displayName"],"sources":["../../../src/ui-shell/UiShell/UiShellContent.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 { memo, type ReactElement, type ReactNode } from \"react\";\nimport { ErrorBoundary, ErrorBoundaryProps } from \"react-error-boundary\";\n\nimport { AppSwitcher, type AppSwitcherProps } from \"../../labs/AppSwitcher\";\nimport { SideNav, type SideNavProps } from \"../../labs/SideNav\";\nimport { TopNav, type TopNavProps } from \"../../labs/TopNav\";\nimport {\n useOdysseyDesignTokens,\n type DesignTokens,\n} from \"../../OdysseyDesignTokensContext\";\nimport { useScrollState } from \"./useScrollState\";\nimport { ContrastMode } from \"../../useContrastMode\";\n\nconst emptySideNavItems = [] satisfies SideNavProps[\"sideNavItems\"];\n\nconst StyledAppContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"appBackgroundContrastMode\" &&\n prop !== \"hasStandardAppContentPadding\",\n})<{\n appBackgroundContrastMode: ContrastMode;\n hasStandardAppContentPadding: UiShellContentProps[\"hasStandardAppContentPadding\"];\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n appBackgroundContrastMode,\n hasStandardAppContentPadding,\n odysseyDesignTokens,\n }) => ({\n gridArea: \"app-content\",\n overflowX: \"hidden\",\n overflowY: \"auto\",\n backgroundColor:\n appBackgroundContrastMode === \"highContrast\"\n ? odysseyDesignTokens.HueNeutralWhite\n : odysseyDesignTokens.HueNeutral50,\n\n ...(hasStandardAppContentPadding && {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing8,\n }),\n }),\n);\n\nconst StyledBannersContainer = styled(\"div\")(() => ({\n gridArea: \"banners\",\n}));\n\nconst StyledAppSwitcherContainer = styled(\"div\")(() => ({\n gridArea: \"app-switcher\",\n}));\n\nconst StyledSideNavContainer = styled(\"div\")(() => ({\n gridArea: \"side-nav\",\n}));\n\nconst StyledShellContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n display: \"grid\",\n gridGap: 0,\n gridTemplateAreas: `\n \"banners banners banners\"\n \"app-switcher side-nav top-nav\"\n \"app-switcher side-nav app-content\"\n `,\n gridTemplateColumns: \"auto auto 1fr\",\n gridTemplateRows: \"auto auto 1fr\",\n height: \"100vh\",\n width: \"100vw\",\n}));\n\nconst StyledTopNavContainer = styled(\"div\")(() => ({\n gridArea: \"top-nav\",\n}));\n\nexport const subComponentNames = [\"TopNav\", \"SideNav\", \"AppSwitcher\"] as const;\nexport type SubComponentName = (typeof subComponentNames)[number];\n\nexport type UiShellNavComponentProps = {\n /**\n * Object that gets pass directly to the app switcher component.\n */\n appSwitcherProps?: AppSwitcherProps;\n /**\n * Object that gets pass directly to the side nav component. If `undefined` and in `initialVisibleSections`, SideNav will be initially rendered. Pass `null` to hide a previously-visible SideNav.\n */\n sideNavProps?: Omit<SideNavProps, \"footerComponent\"> | null;\n /**\n * Object that gets pass directly to the top nav component. If `undefined` and in `initialVisibleSections`, TopNav will be initially rendered. Pass `null` to hide a previously-visible TopNav.\n */\n topNavProps?: Omit<\n TopNavProps,\n \"leftSideComponent\" | \"rightSideComponent\"\n > | null;\n};\n\nexport type UiShellContentProps = {\n /**\n * Sets the background color for the app content area.\n */\n appBackgroundContrastMode?: ContrastMode;\n /**\n * React app component that renders as children in the correct location of the shell.\n */\n appComponent: ReactNode;\n /**\n * defaults to `true`. If `false`, the content area will have no padding provided\n */\n hasStandardAppContentPadding?: boolean;\n /**\n * Which parts of the UI Shell should be visible initially? For example,\n * if sideNavProps is undefined, should the space for the sidenav be initially visible?\n */\n initialVisibleSections?: SubComponentName[];\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, flagging \"p0\"s, and recovering UI Shell when errors occur.\n */\n onError?: ErrorBoundaryProps[\"onError\"];\n /**\n * Components that will render as children of various other components such as the top nav or side nav.\n */\n optionalComponents?: {\n banners?: ReactElement;\n sideNavFooter?: SideNavProps[\"footerComponent\"];\n topNavLeftSide?: TopNavProps[\"leftSideComponent\"];\n topNavRightSide?: TopNavProps[\"rightSideComponent\"];\n };\n} & UiShellNavComponentProps;\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 UiShellContent = ({\n appBackgroundContrastMode = \"lowContrast\",\n appComponent,\n hasStandardAppContentPadding = true,\n initialVisibleSections = [\"TopNav\", \"SideNav\", \"AppSwitcher\"],\n onError = console.error,\n optionalComponents,\n appSwitcherProps,\n sideNavProps,\n topNavProps,\n}: UiShellContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { isContentScrolled, scrollableContentRef } = useScrollState();\n\n return (\n <StyledShellContainer odysseyDesignTokens={odysseyDesignTokens}>\n <StyledBannersContainer>\n {optionalComponents?.banners}\n </StyledBannersContainer>\n\n <StyledAppSwitcherContainer>\n {\n /* If AppSwitcher should be initially visible and we have not yet received props, render AppSwitcher in the loading state */\n initialVisibleSections?.includes(\"AppSwitcher\") &&\n !appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher isLoading appIcons={[]} selectedAppName=\"\" />\n </ErrorBoundary>\n )\n }\n {appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher {...appSwitcherProps} />\n </ErrorBoundary>\n )}\n </StyledAppSwitcherContainer>\n\n <StyledSideNavContainer>\n {\n /* If SideNav should be initially visible and we have not yet received props, render SideNav with minimal inputs */\n initialVisibleSections?.includes(\"SideNav\") &&\n sideNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav\n isLoading\n appName=\"\"\n sideNavItems={emptySideNavItems}\n />\n </ErrorBoundary>\n )\n }\n {sideNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav\n {...{\n ...sideNavProps,\n ...(sideNavProps.hasCustomFooter &&\n optionalComponents?.sideNavFooter\n ? {\n footerComponent: optionalComponents.sideNavFooter,\n footerItems: undefined,\n hasCustomFooter: sideNavProps.hasCustomFooter,\n }\n : {\n footerItems: sideNavProps.footerItems,\n hasCustomFooter: false,\n }),\n }}\n />\n </ErrorBoundary>\n )}\n </StyledSideNavContainer>\n <StyledTopNavContainer>\n {\n /* If TopNav should be initially visible and we have not yet received props, render Topnav with minimal inputs */\n initialVisibleSections?.includes(\"TopNav\") &&\n topNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )\n }\n {topNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n {...topNavProps}\n isScrolled={isContentScrolled}\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )}\n </StyledTopNavContainer>\n\n <StyledAppContainer\n appBackgroundContrastMode={appBackgroundContrastMode}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={scrollableContentRef}\n tabIndex={0}\n >\n {appComponent}\n </StyledAppContainer>\n </StyledShellContainer>\n );\n};\n\nconst MemoizedUiShellContent = memo(UiShellContent);\nMemoizedUiShellContent.displayName = \"UiShellContent\";\n\nexport { MemoizedUiShellContent as UiShellContent };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,IAAI,QAA2C,OAAO;AAC/D,SAASC,aAAa,QAA4B,sBAAsB;AAAC,SAEhEC,WAAW;AAAA,SACXC,OAAO;AAAA,SACPC,MAAM;AAAA,SAEbC,sBAAsB;AAAA,SAGfC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGvB,MAAMC,iBAAiB,GAAG,EAAyC;AAEnE,MAAMC,kBAAkB,GAAGb,MAAM,CAAC,KAAK,EAAE;EACvCc,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WAAW,IACV1C,IAAA,CAACP,aAAa;QAACuD,QAAQ,EAAE,IAAK;QAACZ,OAAO,EAAEA,OAAQ;QAAAS,QAAA,EAC9C7C,IAAA,CAACJ,MAAM;UAAA,GACD8C,WAAW;UACfqB,UAAU,EAAEpB,iBAAkB;UAC9BgB,iBAAiB,EAAEpB,kBAAkB,EAAEqB,cAAe;UACtDC,kBAAkB,EAAEtB,kBAAkB,EAAEuB;QAAgB,CACzD;MAAC,CACW,CAChB;IAAA,CACoB,CAAC,EAExB9D,IAAA,CAACI,kBAAkB;MACjBG,yBAAyB,EAAEA,yBAA0B;MACrDC,4BAA4B,EAAEA,4BAA6B;MAC3DC,mBAAmB,EAAEA,mBAAoB;MACzCuD,GAAG,EAAEpB,oBAAqB;MAC1BqB,QAAQ,EAAE,CAAE;MAAApB,QAAA,EAEXX;IAAY,CACK,CAAC;EAAA,CACD,CAAC;AAE3B,CAAC;AAED,MAAMgC,sBAAsB,GAAG1E,IAAI,CAACyC,cAAc,CAAC;AACnDiC,sBAAsB,CAACC,WAAW,GAAG,gBAAgB;AAErD,SAASD,sBAAsB,IAAIjC,cAAc"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferLatest.js","names":["createStore","bufferLatest","publish","subscribe","store","isReactAppReadyForProps","unsubscribe","setState","getState","hasState","publishWhenReady","value"],"sources":["../../../src/ui-shell/UiShell/bufferLatest.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 { createStore } from \"./createStore\";\n\n/**\n * Buffers the values passed to a publisher, keeping only the latest value, until the subscriber emits.\n *\n * This is useful in restricting publishers from firing events until specific subscribers are active. Once active, the `publish` function reverts to its previous behavior.\n */\nexport const bufferLatest = <Value>({\n publish,\n subscribe,\n}: {\n /**\n * A function that publishes values to a subscriber, but not the same subscriber as the one passed to this function.\n *\n * Only the latest value published by this publisher is kept until the subscriber emits.\n */\n publish: (value: Value) => void;\n /**\n * A subscription that listens for emissions from a separate publisher.\n *\n * When that separate publisher emits, the latest value from the passed-in publish function is emitted as are all future values.\n */\n subscribe: (subscriber: () => void) => () => void;\n}) => {\n const store = createStore<{\n bufferedValue?: Value;\n isReactAppReadyForProps: boolean;\n }>({\n isReactAppReadyForProps: false,\n });\n\n const unsubscribe = subscribe(() => {\n unsubscribe();\n\n store.setState(\"isReactAppReadyForProps\", true);\n store.getState(\"bufferedValue\");\n if (store.hasState(\"bufferedValue\")) {\n // If we have a state, then the value in here is what we want. TypeScript expects this to possibly be `undefined` because the type we sent to `createStore` listed `bufferedValue` as optional. TypeScript doesn't seem to have any way of knowing we passed in the value at some point.\n publish(store.getState(\"bufferedValue\")!);\n }\n });\n\n const publishWhenReady: typeof publish = (value) => {\n if (store.getState(\"isReactAppReadyForProps\")) {\n publish(value);\n } else {\n store.setState(\"bufferedValue\", value);\n }\n };\n\n return publishWhenReady;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAYSA,WAAW;AAOpB,OAAO,MAAMC,YAAY,GAAGA,CAAQ;EAClCC,OAAO;EACPC;AAcF,CAAC,KAAK;EACJ,MAAMC,KAAK,GAAGJ,WAAW,CAGtB;IACDK,uBAAuB,EAAE;EAC3B,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGH,SAAS,CAAC,MAAM;IAClCG,WAAW,CAAC,CAAC;IAEbF,KAAK,CAACG,QAAQ,CAAC,yBAAyB,EAAE,IAAI,CAAC;IAC/CH,KAAK,CAACI,QAAQ,CAAC,eAAe,CAAC;IAC/B,IAAIJ,KAAK,CAACK,QAAQ,CAAC,eAAe,CAAC,EAAE;MAEnCP,OAAO,CAACE,KAAK,CAACI,QAAQ,CAAC,eAAe,CAAE,CAAC;IAC3C;EACF,CAAC,CAAC;EAEF,MAAME,gBAAgC,GAAIC,KAAK,IAAK;IAClD,IAAIP,KAAK,CAACI,QAAQ,CAAC,yBAAyB,CAAC,EAAE;MAC7CN,OAAO,CAACS,KAAK,CAAC;IAChB,CAAC,MAAM;MACLP,KAAK,CAACG,QAAQ,CAAC,eAAe,EAAEI,KAAK,CAAC;IACxC;EACF,CAAC;EAED,OAAOD,gBAAgB;AACzB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMessageBus.js","names":["createMessageBus","subscribers","Map","publish","message","Array","from","values","forEach","subscriber","subscribe","subscriberId","Symbol","set","delete"],"sources":["../../../src/ui-shell/UiShell/createMessageBus.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\nexport type MessageHandler<Message> = (message: Message) => void;\n\nexport type PublishMessage<Message> = MessageHandler<Message>;\n\nexport type UnsubscribeMessageSubscription = () => void;\n\nexport type MessageSubscription<Message> = (\n subscriber: MessageHandler<Message>,\n) => UnsubscribeMessageSubscription;\n\nexport type MessageBus<Message> = {\n publish: PublishMessage<Message>;\n subscribe: MessageSubscription<Message>;\n};\n\n/**\n * Create a self-contained message bus that allows you to subscribe to events published by the publisher.\n */\nexport const createMessageBus = <Message = void>(): MessageBus<Message> => {\n const subscribers = new Map<symbol, MessageHandler<Message>>();\n\n const publish: PublishMessage<Message> = (message) => {\n Array.from(subscribers.values()).forEach((subscriber) => {\n subscriber(message);\n });\n };\n\n const subscribe: MessageSubscription<Message> = (subscriber) => {\n const subscriberId = Symbol();\n subscribers.set(subscriberId, subscriber);\n\n return () => {\n subscribers.delete(subscriberId);\n };\n };\n\n return {\n publish,\n subscribe,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAoBA,OAAO,MAAMA,gBAAgB,GAAGA,CAAA,KAA2C;EACzE,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAkC,CAAC;EAE9D,MAAMC,OAAgC,GAAIC,OAAO,IAAK;IACpDC,KAAK,CAACC,IAAI,CAACL,WAAW,CAACM,MAAM,CAAC,CAAC,CAAC,CAACC,OAAO,CAAEC,UAAU,IAAK;MACvDA,UAAU,CAACL,OAAO,CAAC;IACrB,CAAC,CAAC;EACJ,CAAC;EAED,MAAMM,SAAuC,GAAID,UAAU,IAAK;IAC9D,MAAME,YAAY,GAAGC,MAAM,CAAC,CAAC;IAC7BX,WAAW,CAACY,GAAG,CAACF,YAAY,EAAEF,UAAU,CAAC;IAEzC,OAAO,MAAM;MACXR,WAAW,CAACa,MAAM,CAACH,YAAY,CAAC;IAClC,CAAC;EACH,CAAC;EAED,OAAO;IACLR,OAAO;IACPO;EACF,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStore.js","names":["createStore","initialState","state","hasState","name","getState","setState","value"],"sources":["../../../src/ui-shell/UiShell/createStore.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\n/**\n * Creates an internal state and gives access to those values via functions.\n *\n * It can be optionally given an initial state.\n */\nexport const createStore = <State extends object>(initialState?: State) => {\n const state = initialState || ({} as Partial<State>);\n\n const hasState = <Name extends keyof State>(name: Name) => name in state;\n\n const getState = <Name extends keyof State>(name: Name) => state[name];\n\n const setState = <Name extends keyof State>(\n name: Name,\n value: Required<State>[Name],\n ) => {\n state[name] = value;\n };\n\n return {\n getState,\n hasState,\n setState,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAOA,OAAO,MAAMA,WAAW,GAA0BC,YAAoB,IAAK;EACzE,MAAMC,KAAK,GAAGD,YAAY,IAAK,CAAC,CAAoB;EAEpD,MAAME,QAAQ,GAA8BC,IAAU,IAAKA,IAAI,IAAIF,KAAK;EAExE,MAAMG,QAAQ,GAA8BD,IAAU,IAAKF,KAAK,CAACE,IAAI,CAAC;EAEtE,MAAME,QAAQ,GAAGA,CACfF,IAAU,EACVG,KAA4B,KACzB;IACHL,KAAK,CAACE,IAAI,CAAC,GAAGG,KAAK;EACrB,CAAC;EAED,OAAO;IACLF,QAAQ;IACRF,QAAQ;IACRG;EACF,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["UiShell"],"sources":["../../../src/ui-shell/UiShell/index.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\nexport * from \"./renderUiShell\";\nexport * from \"./useHasUiShell\";\n\nexport { UiShell, type UiShellProps } from \"./UiShell\";\nexport { type UiShellNavComponentProps } from \"./UiShellContent\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA;AAAA;AAAA,SAeSA,OAAO"}
@@ -14,9 +14,9 @@ import { ErrorBoundary } from "react-error-boundary";
14
14
  import { bufferLatest } from "./bufferLatest.js";
15
15
  import { createMessageBus } from "./createMessageBus.js";
16
16
  import { UiShell } from "./UiShell.js";
17
- import { renderReactInWebComponent } from "../../web-component/renderReactInWebComponent.js";
17
+ import { renderReactInWebComponent } from "../renderReactInWebComponent.js";
18
+ import { uiShellDataAttribute } from "./useHasUiShell.js";
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
- export const uiShellDataAttribute = "data-unified-ui-shell";
20
20
  export const optionalComponentSlotNames = {
21
21
  banners: "banners",
22
22
  sideNavFooter: "side-nav-footer",
@@ -26,6 +26,7 @@ export const optionalComponentSlotNames = {
26
26
  export const renderUiShell = ({
27
27
  appBackgroundContrastMode,
28
28
  appRootElement: explicitAppRootElement,
29
+ hasStandardAppContentPadding,
29
30
  initialVisibleSections,
30
31
  onError = console.error,
31
32
  uiShellRootElement
@@ -59,6 +60,7 @@ export const renderUiShell = ({
59
60
  appBackgroundContrastMode: appBackgroundContrastMode,
60
61
  appComponent: appComponent,
61
62
  appRootElement: reactRootElements.appRootElement,
63
+ hasStandardAppContentPadding: hasStandardAppContentPadding,
62
64
  initialVisibleSections: initialVisibleSections,
63
65
  onError: onError,
64
66
  onSubscriptionCreated: publishSubscriptionCreated,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","UiShell","renderReactInWebComponent","uiShellDataAttribute","jsx","_jsx","optionalComponentSlotNames","banners","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundContrastMode","appRootElement","explicitAppRootElement","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","uiShellRootElement","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","concat","appComponent","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","stylesRootElement","webComponentRootElement","setComponentProps"],"sources":["../../../src/ui-shell/UiShell/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 { bufferLatest } from \"./bufferLatest\";\nimport { createMessageBus } from \"./createMessageBus\";\nimport { UiShell, UiShellProps } from \"./UiShell\";\nimport { renderReactInWebComponent } from \"../renderReactInWebComponent\";\nimport { type UiShellNavComponentProps } from \"./UiShellContent\";\nimport { uiShellDataAttribute } from \"./useHasUiShell\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\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 appBackgroundContrastMode,\n appRootElement: explicitAppRootElement,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n uiShellRootElement,\n}: {\n /**\n * HTML element used as the root for a React app.\n */\n appRootElement?: HTMLDivElement;\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 * HTML element used as the root for UI Shell.\n */\n uiShellRootElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundContrastMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n>) => {\n const appRootElement =\n explicitAppRootElement || 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 uiShellRootElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\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 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 Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n >;\n\n const webComponentChildren =\n Object.values(slottedElements).concat(appRootElement);\n\n const appComponent = <slot />;\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={appComponent} onError={onError}>\n <UiShell\n appBackgroundContrastMode={appBackgroundContrastMode}\n appComponent={appComponent}\n appRootElement={reactRootElements.appRootElement}\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.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n stylesRootElement={reactRootElements.stylesRootElement}\n subscribeToPropChanges={subscribeToPropChanges}\n />\n </ErrorBoundary>\n ),\n webComponentRootElement: uiShellRootElement,\n webComponentChildren,\n });\n\n return {\n appRootElement,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAAC,SAE5CC,YAAY;AAAA,SACZC,gBAAgB;AAAA,SAChBC,OAAO;AAAA,SACPC,yBAAyB;AAAA,SAEzBC,oBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE7B,OAAO,MAAMC,0BAGZ,GAAG;EACFC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,iBAAiB;EAChCC,cAAc,EAAE,mBAAmB;EACnCC,eAAe,EAAE;AACnB,CAAC;AAWD,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,yBAAyB;EACzBC,cAAc,EAAEC,sBAAsB;EACtCC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC;AAmBF,CAAC,KAAK;EACJ,MAAMP,cAAc,GAClBC,sBAAsB,IAAIO,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGzDF,kBAAkB,CAACG,YAAY,CAACpB,oBAAoB,EAAE,EAAE,CAAC;EAEzD,MAAM;IAAEqB,OAAO,EAAEC,kBAAkB;IAAEC,SAAS,EAAEC;E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,CACpCD,MAAM,CAACE,OAAO,CAAC5B,0BAA0B,CAAC,CAAC6B,GAAG,CAC5C,CAAC,CAACC,oBAAoB,EAAEC,QAAQ,CAAC,KAAK,CACpCD,oBAAoB,EACpB/B,IAAA;UAAM6C,IAAI,EAAEb;QAAS,CAAE,CAAC,CAE5B,CACF,CAAE;QACFc,iBAAiB,EAAEN,iBAAiB,CAACM,iBAAkB;QACvDxB,sBAAsB,EAAEA;MAAuB,CAChD;IAAC,CACW,CAChB;IACDyB,uBAAuB,EAAEhC,kBAAkB;IAC3CmB;EACF,CAAC,CAAC;EAEF,OAAO;IACL1B,cAAc;IACdwC,iBAAiB,EAAEvB,iCAAiC;IACpDC,eAAe;IACfY;EACF,CAAC;AACH,CAAC"}
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { useEffect, useState } from "react";
14
- import { uiShellDataAttribute } from "./renderUiShell.js";
14
+ export const uiShellDataAttribute = "data-unified-ui-shell";
15
15
  export const useHasUiShell = () => {
16
16
  const [hasUiShell, setHasUiShell] = useState(false);
17
17
  useEffect(() => {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHasUiShell.js","names":["useEffect","useState","uiShellDataAttribute","useHasUiShell","hasUiShell","setHasUiShell","Boolean","document","querySelector"],"sources":["../../../src/ui-shell/UiShell/useHasUiShell.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 { useEffect, useState } from \"react\";\n\nexport const uiShellDataAttribute = \"data-unified-ui-shell\";\n\nexport const useHasUiShell = () => {\n const [hasUiShell, setHasUiShell] = useState(false);\n\n useEffect(() => {\n setHasUiShell(Boolean(document.querySelector(`[${uiShellDataAttribute}]`)));\n }, []);\n\n return hasUiShell;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,OAAO,MAAMC,oBAAoB,GAAG,uBAAuB;AAE3D,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGJ,QAAQ,CAAC,KAAK,CAAC;EAEnDD,SAAS,CAAC,MAAM;IACdK,aAAa,CAACC,OAAO,CAACC,QAAQ,CAACC,aAAa,CAAE,IAAGN,oBAAqB,GAAE,CAAC,CAAC,CAAC;EAC7E,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOE,UAAU;AACnB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollState.js","names":["useEffect","useRef","useState","useScrollState","isContentScrolled","setIsContentScrolled","scrollableContentRef","current","requestedAnimationFrameId","scrollableContentElement","updateScrollState","cancelAnimationFrame","requestAnimationFrame","scrollTop","addEventListener","removeEventListener"],"sources":["../../../src/ui-shell/UiShell/useScrollState.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 { useEffect, useRef, useState } from \"react\";\n\nexport const useScrollState = <\n ScrollableContentElement extends HTMLElement = HTMLDivElement,\n>() => {\n const [isContentScrolled, setIsContentScrolled] = useState(false);\n\n const scrollableContentRef = useRef<ScrollableContentElement>(null);\n\n useEffect(() => {\n if (scrollableContentRef.current) {\n let requestedAnimationFrameId: number;\n const scrollableContentElement = scrollableContentRef.current;\n\n const updateScrollState = () => {\n cancelAnimationFrame(requestedAnimationFrameId);\n\n requestedAnimationFrameId = requestAnimationFrame(() => {\n setIsContentScrolled(scrollableContentElement.scrollTop > 0);\n });\n };\n\n scrollableContentElement.addEventListener(\"scroll\", updateScrollState);\n\n updateScrollState();\n\n return () => {\n scrollableContentElement.removeEventListener(\n \"scroll\",\n updateScrollState,\n );\n\n cancelAnimationFrame(requestedAnimationFrameId);\n };\n }\n\n return () => {};\n }, []);\n\n return {\n isContentScrolled,\n scrollableContentRef,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAEvB;EACL,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGH,QAAQ,CAAC,KAAK,CAAC;EAEjE,MAAMI,oBAAoB,GAAGL,MAAM,CAA2B,IAAI,CAAC;EAEnED,SAAS,CAAC,MAAM;IACd,IAAIM,oBAAoB,CAACC,OAAO,EAAE;MAChC,IAAIC,yBAAiC;MACrC,MAAMC,wBAAwB,GAAGH,oBAAoB,CAACC,OAAO;MAE7D,MAAMG,iBAAiB,GAAGA,CAAA,KAAM;QAC9BC,oBAAoB,CAACH,yBAAyB,CAAC;QAE/CA,yBAAyB,GAAGI,qBAAqB,CAAC,MAAM;UACtDP,oBAAoB,CAACI,wBAAwB,CAACI,SAAS,GAAG,CAAC,CAAC;QAC9D,CAAC,CAAC;MACJ,CAAC;MAEDJ,wBAAwB,CAACK,gBAAgB,CAAC,QAAQ,EAAEJ,iBAAiB,CAAC;MAEtEA,iBAAiB,CAAC,CAAC;MAEnB,OAAO,MAAM;QACXD,wBAAwB,CAACM,mBAAmB,CAC1C,QAAQ,EACRL,iBACF,CAAC;QAEDC,oBAAoB,CAACH,yBAAyB,CAAC;MACjD,CAAC;IACH;IAEA,OAAO,MAAM,CAAC,CAAC;EACjB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLJ,iBAAiB;IACjBE;EACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) 2022-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
+ export * from "./UiShell/index.js";
13
+ export * from "./renderReactInWebComponent.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/ui-shell/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./UiShell\";\nexport * from \"./renderReactInWebComponent\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA;AAAA"}
@@ -8,18 +8,10 @@
8
8
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
- */export const createReactRootElements = () => {
12
- const appRootElement = document.createElement("div");
13
- const stylesRootElement = document.createElement("div");
14
- appRootElement.style.setProperty("height", "inherit");
15
- appRootElement.setAttribute("id", "app-root");
16
- stylesRootElement.setAttribute("id", "style-root");
17
- stylesRootElement.setAttribute("nonce", window.cspNonce);
18
- return {
19
- appRootElement,
20
- stylesRootElement
21
- };
22
- };
11
+ */
12
+
13
+ import { createRoot } from "react-dom/client";
14
+ import { createReactRootElements } from "../web-component/index.js";
23
15
  export const reactWebComponentElementName = "odyssey-react-web-component";
24
16
  export class ReactInWebComponentElement extends HTMLElement {
25
17
  constructor(getReactComponent) {
@@ -40,15 +32,13 @@ export class ReactInWebComponentElement extends HTMLElement {
40
32
  this.reactRootElements.stylesRootElement.appendChild(styleElement);
41
33
  shadowRoot.appendChild(this.reactRootElements.stylesRootElement);
42
34
  shadowRoot.appendChild(this.reactRootElements.appRootElement);
43
- this.reactRootPromise = import("react-dom/client").then(({
44
- createRoot
45
- }) => createRoot(this.reactRootElements.appRootElement));
35
+ this.reactRoot = createRoot(this.reactRootElements.appRootElement);
46
36
  }
47
37
  connectedCallback() {
48
- this.reactRootPromise.then(reactRoot => reactRoot.render(this.getReactComponent(this.reactRootElements)));
38
+ this.reactRoot.render(this.getReactComponent(this.reactRootElements));
49
39
  }
50
40
  disconnectedCallback() {
51
- this.reactRootPromise.then(reactRoot => reactRoot.unmount());
41
+ this.reactRoot.unmount();
52
42
  }
53
43
  }
54
44
  if (!customElements.get(reactWebComponentElementName)) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderReactInWebComponent.js","names":["createRoot","createReactRootElements","reactWebComponentElementName","ReactInWebComponentElement","HTMLElement","constructor","getReactComponent","reactRootElements","styleElement","document","createElement","shadowRoot","attachShadow","mode","innerHTML","setAttribute","window","cspNonce","stylesRootElement","appendChild","appRootElement","reactRoot","connectedCallback","render","disconnectedCallback","unmount","customElements","get","define","renderReactInWebComponent","webComponentChildren","webComponentRootElement","reactElement","Array","isArray","forEach","webComponentChild"],"sources":["../../src/ui-shell/renderReactInWebComponent.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type ReactNode } from \"react\";\nimport { createRoot, type Root } from \"react-dom/client\";\nimport {\n createReactRootElements,\n type ReactRootElements,\n} from \"../web-component\";\n\nexport const reactWebComponentElementName = \"odyssey-react-web-component\";\n\nexport type GetReactComponentInWebComponent = (\n reactRootElements: ReactRootElements,\n) => ReactNode;\n\nexport class ReactInWebComponentElement extends HTMLElement {\n getReactComponent: GetReactComponentInWebComponent;\n reactRoot: Root;\n reactRootElements: ReactRootElements;\n\n constructor(getReactComponent: GetReactComponentInWebComponent) {\n super();\n\n this.getReactComponent = getReactComponent;\n this.reactRootElements = createReactRootElements();\n\n const styleElement = document.createElement(\"style\");\n const shadowRoot = this.attachShadow({ mode: \"open\" });\n\n styleElement.innerHTML = `\n :host {\n all: initial;\n contain: content;\n }\n `;\n\n styleElement.setAttribute(\"nonce\", window.cspNonce);\n\n this.reactRootElements.stylesRootElement.appendChild(styleElement);\n shadowRoot.appendChild(this.reactRootElements.stylesRootElement);\n shadowRoot.appendChild(this.reactRootElements.appRootElement);\n\n this.reactRoot = createRoot(this.reactRootElements.appRootElement);\n }\n\n connectedCallback() {\n this.reactRoot.render(this.getReactComponent(this.reactRootElements));\n }\n\n disconnectedCallback() {\n this.reactRoot.unmount();\n }\n}\n\nif (!customElements.get(reactWebComponentElementName)) {\n customElements.define(\n reactWebComponentElementName,\n ReactInWebComponentElement,\n );\n}\n\nexport type RenderReactInWebComponentProps = {\n /**\n * This is a callback function for rendering your React component or app in the Web Component.\n * It gives you access to the Shadow DOM elements if you need them for Odyssey, Emotion, or MUI.\n *\n * You will need to add `<slot>` elements if you want to pass child elements or components or React apps.\n * You can have multiple slots in your app if you add a `name` attribute to your `<slot>` elements.\n */\n getReactComponent: GetReactComponentInWebComponent;\n /**\n * One or more HTML elements that are going to render as `children` of the web component.\n * If your React component doesn't take children, this is unnecessary.\n *\n * Typically, a React app root element is passed, but it can include an array of other elements if there are multiple slots for children.\n *\n * You will need to have rendered `<slot>` elements in your React component or `children` won't show up.\n */\n webComponentChildren?: HTMLElement | HTMLElement[];\n /**\n * You React app renders in the web component, but the web component needs to be rendered in the document.\n *\n * This is the element the web component is rendered into.\n */\n webComponentRootElement: HTMLElement;\n};\n\n/**\n * Lets you render React apps or components in a Web Component.\n *\n * This is useful when global styles are causing conflicts with your React components.\n */\nexport const renderReactInWebComponent = ({\n getReactComponent,\n webComponentChildren,\n webComponentRootElement,\n}: RenderReactInWebComponentProps) => {\n const reactElement = new ReactInWebComponentElement(getReactComponent);\n\n if (webComponentChildren) {\n (Array.isArray(webComponentChildren)\n ? webComponentChildren\n : [webComponentChildren]\n ).forEach((webComponentChild) => {\n reactElement.appendChild(webComponentChild);\n });\n }\n\n webComponentRootElement.appendChild(reactElement);\n\n return reactElement;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,UAAU,QAAmB,kBAAkB;AAAC,SAEvDC,uBAAuB;AAIzB,OAAO,MAAMC,4BAA4B,GAAG,6BAA6B;AAMzE,OAAO,MAAMC,0BAA0B,SAASC,WAAW,CAAC;EAK1DC,WAAWA,CAACC,iBAAkD,EAAE;IAC9D,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,iBAAiB,GAAGA,iBAAiB;IAC1C,IAAI,CAACC,iBAAiB,GAAGN,uBAAuB,CAA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CAACA,oBAAoB,CAAC,EACxBK,OAAO,CAAEC,iBAAiB,IAAK;MAC/BJ,YAAY,CAACb,WAAW,CAACiB,iBAAiB,CAAC;IAC7C,CAAC,CAAC;EACJ;EAEAL,uBAAuB,CAACZ,WAAW,CAACa,YAAY,CAAC;EAEjD,OAAOA,YAAY;AACrB,CAAC"}
@@ -9,6 +9,5 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- export * from "./renderReactInWebComponent.js";
13
12
  export * from "./shadow-dom.js";
14
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/web-component/index.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\nexport * from \"./renderReactInWebComponent\";\nexport * from \"./shadow-dom\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/web-component/index.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\nexport * from \"./shadow-dom\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA"}
@@ -8,8 +8,18 @@
8
8
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
- */
12
- import { createReactRootElements } from "./renderReactInWebComponent.js";
11
+ */export const createReactRootElements = () => {
12
+ const appRootElement = document.createElement("div");
13
+ const stylesRootElement = document.createElement("div");
14
+ appRootElement.style.setProperty("height", "inherit");
15
+ appRootElement.setAttribute("id", "app-root");
16
+ stylesRootElement.setAttribute("id", "style-root");
17
+ stylesRootElement.setAttribute("nonce", window.cspNonce);
18
+ return {
19
+ appRootElement,
20
+ stylesRootElement
21
+ };
22
+ };
13
23
  export const createShadowDomElements = containerElement => {
14
24
  const shadowRoot = containerElement.attachShadow({
15
25
  mode: "open"
@@ -1 +1 @@
1
- {"version":3,"file":"shadow-dom.js","names":["createReactRootElements","createShadowDomElements","containerElement","shadowRoot","attachShadow","mode","appRootElement","stylesRootElement","appendChild","emotionRootElement","shadowRootElement","createShadowRootElement","document","createElement","setAttribute","window","cspNonce"],"sources":["../../src/web-component/shadow-dom.ts"],"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 { createReactRootElements } from \"./renderReactInWebComponent\";\n\n/**\n * @deprecated Use `renderReactInWebComponent` instead. This function was necessary when using bare Shadow DOM, but with UI Shell rendering in a Web Component, you won't be able to render your Shadow DOM in its Shadow DOM without using a Web Component.\n */\nexport const createShadowDomElements = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // Container for Emotion `<style>` elements.\n const { appRootElement, stylesRootElement } = createReactRootElements();\n\n shadowRoot.appendChild(appRootElement);\n shadowRoot.appendChild(stylesRootElement);\n\n return {\n emotionRootElement: stylesRootElement,\n shadowRootElement: appRootElement,\n };\n};\n\n/**\n * @deprecated Use `createShadowDomElements` instead which returns an object instead of an array. It's otherwise the same.\n * @deprecated Ideally, use `renderReactInWebComponent` instead. This function was necessary when using bare Shadow DOM, but with UI Shell rendering in a Web Component, you won't be able to render your Shadow DOM in its Shadow DOM without using a Web Component. */\nexport const createShadowRootElement = (\n containerElement: HTMLElement,\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRootElement = document.createElement(\"style\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return [emotionRootElement, shadowRootElement];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAYSA,uBAAuB;AAKhC,OAAO,MAAMC,uBAAuB,GAAIC,gBAA6B,IAAK;EACxE,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAM;IAAEC,cAAc;IAAEC;EAAkB,CAAC,GAAGP,uBAAuB,CAAC,CAAC;EAEvEG,UAAU,CAACK,WAAW,CAACF,cAAc,CAAC;EACtCH,UAAU,CAACK,WAAW,CAACD,iBAAiB,CAAC;EAEzC,OAAO;IACLE,kBAAkB,EAAEF,iBAAiB;IACrCG,iBAAiB,EAAEJ;EACrB,CAAC;AACH,CAAC;AAKD,OAAO,MAAMK,uBAAuB,GAClCT,gBAA6B,IACU;EACvC,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMI,kBAAkB,GAAGG,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC1DJ,kBAAkB,CAACK,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDL,kBAAkB,CAACK,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMN,iBAAiB,GAAGE,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDH,iBAAiB,CAACI,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDX,UAAU,CAACK,WAAW,CAACC,kBAAkB,CAAC;EAC1CN,UAAU,CAACK,WAAW,CAACE,iBAAiB,CAAC;EAEzC,OAAO,CAACD,kBAAkB,EAAEC,iBAAiB,CAAC;AAChD,CAAC"}
1
+ {"version":3,"file":"shadow-dom.js","names":["createReactRootElements","appRootElement","document","createElement","stylesRootElement","style","setProperty","setAttribute","window","cspNonce","createShadowDomElements","containerElement","shadowRoot","attachShadow","mode","appendChild","emotionRootElement","shadowRootElement","createShadowRootElement"],"sources":["../../src/web-component/shadow-dom.ts"],"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\n/**\n * Creates elements for a Shadow DOM that Odyssey will render into.\n * The Emotion root is for `<style>` tags and the app root is for an app to render into.\n * These are bare elements that\n */\nexport const createReactRootElements = () => {\n const appRootElement = document.createElement(\"div\");\n const stylesRootElement = document.createElement(\"div\");\n\n // This `div` may cause layout issues unless it inherits the parent's height.\n appRootElement.style.setProperty(\"height\", \"inherit\");\n\n appRootElement.setAttribute(\"id\", \"app-root\");\n stylesRootElement.setAttribute(\"id\", \"style-root\");\n stylesRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n return {\n /**\n * The element your React root component renders into.\n * React has to render or portal somewhere, and this element can be used for that root element.\n *\n * In the case of a web component, there is no defined root element, so you have to define it yourself.\n */\n appRootElement,\n /**\n * In React apps, your styles typically go in `document.head`, but you may want to render them somewhere else.\n *\n * Specifically when rendering in a web component, there is no `<head>`, so you have to create a spot for styles to render.\n */\n stylesRootElement,\n };\n};\n\nexport type ReactRootElements = ReturnType<typeof createReactRootElements>;\n\n/**\n * @deprecated Use `renderReactInWebComponent` from `@okta/odyssey-react-mui/ui-shell` instead. This function was necessary when using bare Shadow DOM, but with UI Shell rendering in a Web Component, you won't be able to render your Shadow DOM in its Shadow DOM without using a Web Component.\n */\nexport const createShadowDomElements = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // Container for Emotion `<style>` elements.\n const { appRootElement, stylesRootElement } = createReactRootElements();\n\n shadowRoot.appendChild(appRootElement);\n shadowRoot.appendChild(stylesRootElement);\n\n return {\n emotionRootElement: stylesRootElement,\n shadowRootElement: appRootElement,\n };\n};\n\n/**\n * @deprecated Use `createShadowDomElements` instead which returns an object instead of an array. It's otherwise the same.\n * @deprecated Ideally, use `renderReactInWebComponent` from `@okta/odyssey-react-mui/ui-shell` instead. This function was necessary when using bare Shadow DOM, but with UI Shell rendering in a Web Component, you won't be able to render your Shadow DOM in its Shadow DOM without using a Web Component. */\nexport const createShadowRootElement = (\n containerElement: HTMLElement,\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRootElement = document.createElement(\"style\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return [emotionRootElement, shadowRootElement];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAOA,OAAO,MAAMA,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,cAAc,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACpD,MAAMC,iBAAiB,GAAGF,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGvDF,cAAc,CAACI,KAAK,CAACC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;EAErDL,cAAc,CAACM,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC;EAC7CH,iBAAiB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EAClDH,iBAAiB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAExD,OAAO;IAOLR,cAAc;IAMdG;EACF,CAAC;AACH,CAAC;AAOD,OAAO,MAAMM,uBAAuB,GAAIC,gBAA6B,IAAK;EACxE,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAM;IAAEb,cAAc;IAAEG;EAAkB,CAAC,GAAGJ,uBAAuB,CAAC,CAAC;EAEvEY,UAAU,CAACG,WAAW,CAACd,cAAc,CAAC;EACtCW,UAAU,CAACG,WAAW,CAACX,iBAAiB,CAAC;EAEzC,OAAO;IACLY,kBAAkB,EAAEZ,iBAAiB;IACrCa,iBAAiB,EAAEhB;EACrB,CAAC;AACH,CAAC;AAKD,OAAO,MAAMiB,uBAAuB,GAClCP,gBAA6B,IACU;EACvC,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAME,kBAAkB,GAAGd,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC1Da,kBAAkB,CAACT,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDS,kBAAkB,CAACT,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMQ,iBAAiB,GAAGf,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDc,iBAAiB,CAACV,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDK,UAAU,CAACG,WAAW,CAACC,kBAAkB,CAAC;EAC1CJ,UAAU,CAACG,WAAW,CAACE,iBAAiB,CAAC;EAEzC,OAAO,CAACD,kBAAkB,EAAEC,iBAAiB,CAAC;AAChD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okta/odyssey-react-mui",
3
- "version": "1.28.1",
3
+ "version": "1.29.0",
4
4
  "description": "React MUI components for Odyssey, Okta's design system",
5
5
  "author": "Okta, Inc.",
6
6
  "license": "Apache-2.0",
@@ -19,6 +19,9 @@
19
19
  "labs": [
20
20
  "./dist/src/labs/index.d.ts"
21
21
  ],
22
+ "ui-shell": [
23
+ "./dist/src/ui-shell/index.d.ts"
24
+ ],
22
25
  "test-selectors": [
23
26
  "./dist/src/test-selectors/index.d.ts"
24
27
  ]
@@ -33,6 +36,10 @@
33
36
  "types": "./dist/src/labs/index.d.ts",
34
37
  "default": "./dist/labs/index.js"
35
38
  },
39
+ "./ui-shell": {
40
+ "types": "./dist/src/ui-shell/index.d.ts",
41
+ "default": "./dist/ui-shell/index.js"
42
+ },
36
43
  "./test-selectors": {
37
44
  "types": "./dist/src/test-selectors/index.d.ts",
38
45
  "default": "./dist/test-selectors/index.js"
@@ -61,7 +68,7 @@
61
68
  "@mui/system": "^5.15.9",
62
69
  "@mui/utils": "^5.15.9",
63
70
  "@mui/x-date-pickers": "^7.2.0",
64
- "@okta/odyssey-design-tokens": "^1.28.1",
71
+ "@okta/odyssey-design-tokens": "^1.29.0",
65
72
  "@types/luxon": "^3.4.2",
66
73
  "date-fns": "^2.30.0",
67
74
  "dom-accessibility-api": "^0.7.0",
@@ -77,5 +84,5 @@
77
84
  "react": "^18.2.0",
78
85
  "react-dom": "^18.2.0"
79
86
  },
80
- "gitHead": "114892c4072f9dc963e3dab57ee7fc6e3e9acfdd"
87
+ "gitHead": "07c7661c010d123c8461a9873c2526a6ff41cd0d"
81
88
  }
@@ -80,7 +80,11 @@ export const Breadcrumb = ({ children, href, iconName }: BreadcrumbProps) => {
80
80
  }
81
81
 
82
82
  if (breadcrumbType === "currentPage") {
83
- return <Subordinate color="textPrimary">{breadcrumbContent}</Subordinate>;
83
+ return (
84
+ <Subordinate ariaCurrent="page" color="textPrimary">
85
+ {breadcrumbContent}
86
+ </Subordinate>
87
+ );
84
88
  }
85
89
 
86
90
  // breadcrumbType === "listItem" is the default
@@ -77,6 +77,7 @@ const MenuItem = ({
77
77
 
78
78
  return (
79
79
  <MuiMenuItem
80
+ aria-current={isSelected}
80
81
  /* eslint-disable-next-line jsx-a11y/no-autofocus */
81
82
  autoFocus={hasInitialFocus}
82
83
  className={