@okta/odyssey-react-mui 1.44.0 → 1.47.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 (752) hide show
  1. package/dist/cjs/Autocomplete.cjs +3 -33
  2. package/dist/cjs/Autocomplete.cjs.map +1 -1
  3. package/dist/cjs/Banner.cjs +2 -2
  4. package/dist/cjs/Banner.cjs.map +1 -1
  5. package/dist/cjs/Breadcrumbs.cjs +2 -2
  6. package/dist/cjs/Breadcrumbs.cjs.map +1 -1
  7. package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
  8. package/dist/cjs/Callout.cjs +3 -27
  9. package/dist/cjs/Callout.cjs.map +1 -1
  10. package/dist/cjs/Card.cjs +280 -63
  11. package/dist/cjs/Card.cjs.map +1 -1
  12. package/dist/cjs/Checkbox.cjs +14 -12
  13. package/dist/cjs/Checkbox.cjs.map +1 -1
  14. package/dist/cjs/DataTable/DataTable.cjs +2 -2
  15. package/dist/cjs/DataTable/DataTable.cjs.map +1 -1
  16. package/dist/cjs/DataTable/DataTableRowActions.cjs +6 -6
  17. package/dist/cjs/DataTable/DataTableRowActions.cjs.map +1 -1
  18. package/dist/cjs/DataTable/DataTableSettings.cjs +2 -2
  19. package/dist/cjs/DataTable/DataTableSettings.cjs.map +1 -1
  20. package/dist/cjs/DataTable/useRowReordering.cjs +2 -2
  21. package/dist/cjs/DataTable/useRowReordering.cjs.map +1 -1
  22. package/dist/cjs/DatePickers/DateField.cjs +2 -2
  23. package/dist/cjs/DatePickers/DateField.cjs.map +1 -1
  24. package/dist/cjs/DatePickers/DateFieldActionBar.cjs +2 -2
  25. package/dist/cjs/DatePickers/DateFieldActionBar.cjs.map +1 -1
  26. package/dist/cjs/DatePickers/DatePicker.cjs +2 -2
  27. package/dist/cjs/DatePickers/DatePicker.cjs.map +1 -1
  28. package/dist/cjs/DatePickers/useDateFieldsTranslations.cjs +2 -2
  29. package/dist/cjs/DatePickers/useDateFieldsTranslations.cjs.map +1 -1
  30. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs +2 -2
  31. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs.map +1 -1
  32. package/dist/cjs/Dialog.cjs +34 -31
  33. package/dist/cjs/Dialog.cjs.map +1 -1
  34. package/dist/cjs/Drawer.cjs +8 -4
  35. package/dist/cjs/Drawer.cjs.map +1 -1
  36. package/dist/cjs/Field.cjs +2 -2
  37. package/dist/cjs/Field.cjs.map +1 -1
  38. package/dist/cjs/FieldError.cjs +2 -2
  39. package/dist/cjs/FieldError.cjs.map +1 -1
  40. package/dist/cjs/FieldLabel.cjs +2 -2
  41. package/dist/cjs/FieldLabel.cjs.map +1 -1
  42. package/dist/cjs/FileUploader/FileUploadPreview.cjs +2 -2
  43. package/dist/cjs/FileUploader/FileUploadPreview.cjs.map +1 -1
  44. package/dist/cjs/FileUploader/FileUploader.cjs +2 -2
  45. package/dist/cjs/FileUploader/FileUploader.cjs.map +1 -1
  46. package/dist/cjs/FullScreenOverlay.cjs +40 -0
  47. package/dist/cjs/FullScreenOverlay.cjs.map +1 -0
  48. package/dist/cjs/FullScreenOverlayContext.cjs +72 -0
  49. package/dist/cjs/FullScreenOverlayContext.cjs.map +1 -0
  50. package/dist/cjs/OdysseyCacheProvider.cjs +12 -17
  51. package/dist/cjs/OdysseyCacheProvider.cjs.map +1 -1
  52. package/dist/cjs/OdysseyProvider.cjs +18 -10
  53. package/dist/cjs/OdysseyProvider.cjs.map +1 -1
  54. package/dist/cjs/OdysseyThemeProvider.cjs +27 -16
  55. package/dist/cjs/OdysseyThemeProvider.cjs.map +1 -1
  56. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs +44 -0
  57. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs.map +1 -0
  58. package/dist/cjs/Pagination/Pagination.cjs +2 -3
  59. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  60. package/dist/cjs/Pagination/usePagination.cjs +2 -2
  61. package/dist/cjs/Pagination/usePagination.cjs.map +1 -1
  62. package/dist/cjs/PasswordField.cjs +2 -2
  63. package/dist/cjs/PasswordField.cjs.map +1 -1
  64. package/dist/cjs/Radio.cjs +22 -20
  65. package/dist/cjs/Radio.cjs.map +1 -1
  66. package/dist/cjs/SearchField.cjs +2 -2
  67. package/dist/cjs/SearchField.cjs.map +1 -1
  68. package/dist/cjs/Select.cjs +1 -37
  69. package/dist/cjs/Select.cjs.map +1 -1
  70. package/dist/cjs/Surface.cjs +3 -3
  71. package/dist/cjs/Surface.cjs.map +1 -1
  72. package/dist/cjs/Switch.cjs +2 -2
  73. package/dist/cjs/Switch.cjs.map +1 -1
  74. package/dist/cjs/Tabs.cjs +1 -21
  75. package/dist/cjs/Tabs.cjs.map +1 -1
  76. package/dist/cjs/Tag.cjs +2 -2
  77. package/dist/cjs/Tag.cjs.map +1 -1
  78. package/dist/cjs/TextField.cjs +1 -26
  79. package/dist/cjs/TextField.cjs.map +1 -1
  80. package/dist/cjs/Toast.cjs +2 -2
  81. package/dist/cjs/Toast.cjs.map +1 -1
  82. package/dist/cjs/__internal.cjs +149 -0
  83. package/dist/cjs/__internal.cjs.map +1 -0
  84. package/dist/cjs/i18n.generated/i18n.cjs +35 -0
  85. package/dist/cjs/i18n.generated/i18n.cjs.map +1 -0
  86. package/dist/cjs/i18n.generated/i18n.resources.cjs +81 -0
  87. package/dist/cjs/i18n.generated/i18n.resources.cjs.map +1 -0
  88. package/dist/{esm/shadow-dom/index.js → cjs/i18n.generated/i18n.types.cjs} +9 -4
  89. package/dist/cjs/i18n.generated/i18n.types.cjs.map +1 -0
  90. package/dist/cjs/index.cjs +49 -30
  91. package/dist/cjs/index.cjs.map +1 -1
  92. package/dist/cjs/labs/DataFilters.cjs +4 -4
  93. package/dist/cjs/labs/DataFilters.cjs.map +1 -1
  94. package/dist/cjs/labs/DataTable.cjs +2 -2
  95. package/dist/cjs/labs/DataTable.cjs.map +1 -1
  96. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs +2 -2
  97. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs.map +1 -1
  98. package/dist/cjs/labs/DataView/CardLayoutContent.cjs +60 -44
  99. package/dist/cjs/labs/DataView/CardLayoutContent.cjs.map +1 -1
  100. package/dist/cjs/labs/DataView/DataCard.cjs +52 -181
  101. package/dist/cjs/labs/DataView/DataCard.cjs.map +1 -1
  102. package/dist/cjs/labs/DataView/DataView.cjs +2 -2
  103. package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
  104. package/dist/cjs/labs/DataView/LayoutSwitcher.cjs +2 -2
  105. package/dist/cjs/labs/DataView/LayoutSwitcher.cjs.map +1 -1
  106. package/dist/cjs/labs/DataView/RowActions.cjs +2 -2
  107. package/dist/cjs/labs/DataView/RowActions.cjs.map +1 -1
  108. package/dist/cjs/labs/DataView/TableLayoutContent.cjs +2 -2
  109. package/dist/cjs/labs/DataView/TableLayoutContent.cjs.map +1 -1
  110. package/dist/cjs/labs/DataView/TableSettings.cjs +2 -2
  111. package/dist/cjs/labs/DataView/TableSettings.cjs.map +1 -1
  112. package/dist/cjs/labs/DataView/componentTypes.cjs.map +1 -1
  113. package/dist/cjs/labs/DataView/fetchData.cjs +2 -2
  114. package/dist/cjs/labs/DataView/fetchData.cjs.map +1 -1
  115. package/dist/cjs/labs/DatePickers/DateTimeField.cjs +2 -2
  116. package/dist/cjs/labs/DatePickers/DateTimeField.cjs.map +1 -1
  117. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +2 -2
  118. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
  119. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs +3 -3
  120. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs.map +1 -1
  121. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs +2 -2
  122. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs.map +1 -1
  123. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +4 -0
  124. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
  125. package/dist/cjs/labs/OdysseyPickers/index.cjs.map +1 -1
  126. package/dist/cjs/labs/PageTemplate/Layout.cjs +2 -2
  127. package/dist/cjs/labs/PageTemplate/Layout.cjs.map +1 -1
  128. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
  129. package/dist/cjs/labs/PaginatedTable.cjs +4 -4
  130. package/dist/cjs/labs/PaginatedTable.cjs.map +1 -1
  131. package/dist/cjs/labs/StaticTable.cjs +2 -2
  132. package/dist/cjs/labs/StaticTable.cjs.map +1 -1
  133. package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
  134. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +7 -1
  135. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
  136. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +7 -1
  137. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
  138. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +8 -2
  139. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
  140. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +7 -1
  141. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
  142. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +7 -1
  143. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
  144. package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs +7 -1
  145. package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs.map +1 -1
  146. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +7 -1
  147. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
  148. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +7 -1
  149. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
  150. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +7 -1
  151. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
  152. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +7 -1
  153. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
  154. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +7 -1
  155. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
  156. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +7 -1
  157. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
  158. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +7 -1
  159. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
  160. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +7 -1
  161. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
  162. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +7 -1
  163. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
  164. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +7 -1
  165. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
  166. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +7 -1
  167. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
  168. package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs.map +1 -1
  169. package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs.map +1 -1
  170. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +7 -1
  171. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
  172. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +7 -1
  173. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
  174. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +7 -1
  175. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
  176. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +7 -1
  177. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
  178. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +7 -1
  179. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
  180. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +7 -1
  181. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
  182. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +7 -1
  183. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
  184. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +7 -1
  185. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
  186. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +7 -1
  187. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
  188. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +7 -1
  189. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs.map +1 -1
  190. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +7 -1
  191. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
  192. package/dist/cjs/test-selectors/AutocompleteTestSelector.cjs +49 -0
  193. package/dist/cjs/test-selectors/AutocompleteTestSelector.cjs.map +1 -0
  194. package/dist/cjs/test-selectors/CalloutTestSelector.cjs +43 -0
  195. package/dist/cjs/test-selectors/CalloutTestSelector.cjs.map +1 -0
  196. package/dist/cjs/test-selectors/SelectTestSelector.cjs +55 -0
  197. package/dist/cjs/test-selectors/SelectTestSelector.cjs.map +1 -0
  198. package/dist/cjs/{OdysseyTranslationProvider.types.cjs → test-selectors/TabsTestSelector.cjs} +23 -4
  199. package/dist/cjs/test-selectors/TabsTestSelector.cjs.map +1 -0
  200. package/dist/cjs/test-selectors/TextFieldTestSelector.cjs +44 -0
  201. package/dist/cjs/test-selectors/TextFieldTestSelector.cjs.map +1 -0
  202. package/dist/cjs/test-selectors/index.cjs +11 -0
  203. package/dist/cjs/test-selectors/index.cjs.map +1 -1
  204. package/dist/cjs/test-selectors/queryOdysseySelector.cjs +10 -10
  205. package/dist/cjs/test-selectors/queryOdysseySelector.cjs.map +1 -1
  206. package/dist/cjs/theme/components.cjs +5 -9
  207. package/dist/cjs/theme/components.cjs.map +1 -1
  208. package/dist/cjs/tools/addSpecificity.cjs.map +1 -0
  209. package/dist/cjs/tools/bufferLatest.cjs.map +1 -0
  210. package/dist/cjs/tools/createMessageBus.cjs.map +1 -0
  211. package/dist/cjs/tools/createStore.cjs.map +1 -0
  212. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +2 -12
  213. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  214. package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs +20 -15
  215. package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs.map +1 -1
  216. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +137 -136
  217. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  218. package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs +2 -2
  219. package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs.map +1 -1
  220. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs +7 -4
  221. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs.map +1 -1
  222. package/dist/cjs/ui-shell/SideNav/SideNavItemContentContext.cjs.map +1 -1
  223. package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +3 -4
  224. package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs.map +1 -1
  225. package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs +47 -0
  226. package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs.map +1 -0
  227. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +2 -2
  228. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs.map +1 -1
  229. package/dist/cjs/ui-shell/SideNav/SortableList/SortableItem.cjs +2 -2
  230. package/dist/cjs/ui-shell/SideNav/SortableList/SortableItem.cjs.map +1 -1
  231. package/dist/cjs/ui-shell/SideNav/SortableList/SortableList.cjs +2 -2
  232. package/dist/cjs/ui-shell/SideNav/SortableList/SortableList.cjs.map +1 -1
  233. package/dist/cjs/ui-shell/SideNav/types.cjs.map +1 -1
  234. package/dist/cjs/ui-shell/UiShell.cjs +4 -4
  235. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  236. package/dist/cjs/ui-shell/UiShellProvider.cjs +1 -1
  237. package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
  238. package/dist/cjs/ui-shell/WideUiShellContent.cjs +2 -1
  239. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  240. package/dist/cjs/ui-shell/renderUiShell.cjs +2 -2
  241. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  242. package/dist/cjs/ui-shell/uiShellContentTypes.cjs +2 -1
  243. package/dist/cjs/ui-shell/uiShellContentTypes.cjs.map +1 -1
  244. package/dist/cjs/{shadow-dom/shadow-dom.cjs → web-component/createShadowDomElements.cjs} +8 -3
  245. package/dist/cjs/web-component/createShadowDomElements.cjs.map +1 -0
  246. package/dist/cjs/web-component/index.cjs +33 -0
  247. package/dist/cjs/web-component/index.cjs.map +1 -1
  248. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  249. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  250. package/dist/cjs/web-component/removeGlobalStylesFromShadowDom.cjs +35 -0
  251. package/dist/cjs/web-component/removeGlobalStylesFromShadowDom.cjs.map +1 -0
  252. package/dist/cjs/web-component/renderReactInWebComponent.cjs +5 -9
  253. package/dist/cjs/web-component/renderReactInWebComponent.cjs.map +1 -1
  254. package/dist/esm/Autocomplete.js +1 -31
  255. package/dist/esm/Autocomplete.js.map +1 -1
  256. package/dist/esm/Banner.js +1 -1
  257. package/dist/esm/Banner.js.map +1 -1
  258. package/dist/esm/Breadcrumbs.js +1 -1
  259. package/dist/esm/Breadcrumbs.js.map +1 -1
  260. package/dist/esm/Buttons/BaseButton.js.map +1 -1
  261. package/dist/esm/Callout.js +1 -25
  262. package/dist/esm/Callout.js.map +1 -1
  263. package/dist/esm/Card.js +281 -63
  264. package/dist/esm/Card.js.map +1 -1
  265. package/dist/esm/Checkbox.js +13 -11
  266. package/dist/esm/Checkbox.js.map +1 -1
  267. package/dist/esm/DataTable/DataTable.js +1 -1
  268. package/dist/esm/DataTable/DataTable.js.map +1 -1
  269. package/dist/esm/DataTable/DataTableRowActions.js +1 -1
  270. package/dist/esm/DataTable/DataTableRowActions.js.map +1 -1
  271. package/dist/esm/DataTable/DataTableSettings.js +1 -1
  272. package/dist/esm/DataTable/DataTableSettings.js.map +1 -1
  273. package/dist/esm/DataTable/useRowReordering.js +1 -1
  274. package/dist/esm/DataTable/useRowReordering.js.map +1 -1
  275. package/dist/esm/DatePickers/DateField.js +1 -1
  276. package/dist/esm/DatePickers/DateField.js.map +1 -1
  277. package/dist/esm/DatePickers/DateFieldActionBar.js +1 -1
  278. package/dist/esm/DatePickers/DateFieldActionBar.js.map +1 -1
  279. package/dist/esm/DatePickers/DatePicker.js +1 -1
  280. package/dist/esm/DatePickers/DatePicker.js.map +1 -1
  281. package/dist/esm/DatePickers/useDateFieldsTranslations.js +1 -1
  282. package/dist/esm/DatePickers/useDateFieldsTranslations.js.map +1 -1
  283. package/dist/esm/DatePickers/useOdysseyDateFields.js +1 -1
  284. package/dist/esm/DatePickers/useOdysseyDateFields.js.map +1 -1
  285. package/dist/esm/Dialog.js +33 -30
  286. package/dist/esm/Dialog.js.map +1 -1
  287. package/dist/esm/Drawer.js +7 -3
  288. package/dist/esm/Drawer.js.map +1 -1
  289. package/dist/esm/Field.js +1 -1
  290. package/dist/esm/Field.js.map +1 -1
  291. package/dist/esm/FieldError.js +1 -1
  292. package/dist/esm/FieldError.js.map +1 -1
  293. package/dist/esm/FieldLabel.js +1 -1
  294. package/dist/esm/FieldLabel.js.map +1 -1
  295. package/dist/esm/FileUploader/FileUploadPreview.js +1 -1
  296. package/dist/esm/FileUploader/FileUploadPreview.js.map +1 -1
  297. package/dist/esm/FileUploader/FileUploader.js +1 -1
  298. package/dist/esm/FileUploader/FileUploader.js.map +1 -1
  299. package/dist/esm/FullScreenOverlay.js +35 -0
  300. package/dist/esm/FullScreenOverlay.js.map +1 -0
  301. package/dist/esm/FullScreenOverlayContext.js +66 -0
  302. package/dist/esm/FullScreenOverlayContext.js.map +1 -0
  303. package/dist/esm/OdysseyCacheProvider.js +12 -17
  304. package/dist/esm/OdysseyCacheProvider.js.map +1 -1
  305. package/dist/esm/OdysseyProvider.js +18 -10
  306. package/dist/esm/OdysseyProvider.js.map +1 -1
  307. package/dist/esm/OdysseyThemeProvider.js +27 -16
  308. package/dist/esm/OdysseyThemeProvider.js.map +1 -1
  309. package/dist/esm/OdysseyThemeProviderPropsContext.js +38 -0
  310. package/dist/esm/OdysseyThemeProviderPropsContext.js.map +1 -0
  311. package/dist/esm/Pagination/Pagination.js +1 -2
  312. package/dist/esm/Pagination/Pagination.js.map +1 -1
  313. package/dist/esm/Pagination/usePagination.js +1 -1
  314. package/dist/esm/Pagination/usePagination.js.map +1 -1
  315. package/dist/esm/PasswordField.js +1 -1
  316. package/dist/esm/PasswordField.js.map +1 -1
  317. package/dist/esm/Radio.js +22 -20
  318. package/dist/esm/Radio.js.map +1 -1
  319. package/dist/esm/SearchField.js +1 -1
  320. package/dist/esm/SearchField.js.map +1 -1
  321. package/dist/esm/Select.js +0 -36
  322. package/dist/esm/Select.js.map +1 -1
  323. package/dist/esm/Surface.js +3 -3
  324. package/dist/esm/Surface.js.map +1 -1
  325. package/dist/esm/Switch.js +1 -1
  326. package/dist/esm/Switch.js.map +1 -1
  327. package/dist/esm/Tabs.js +0 -20
  328. package/dist/esm/Tabs.js.map +1 -1
  329. package/dist/esm/Tag.js +1 -1
  330. package/dist/esm/Tag.js.map +1 -1
  331. package/dist/esm/TextField.js +0 -25
  332. package/dist/esm/TextField.js.map +1 -1
  333. package/dist/esm/Toast.js +1 -1
  334. package/dist/esm/Toast.js.map +1 -1
  335. package/dist/esm/__internal.js +24 -0
  336. package/dist/esm/__internal.js.map +1 -0
  337. package/dist/esm/i18n.generated/i18n.js +25 -0
  338. package/dist/esm/i18n.generated/i18n.js.map +1 -0
  339. package/dist/esm/i18n.generated/i18n.resources.js +75 -0
  340. package/dist/esm/i18n.generated/i18n.resources.js.map +1 -0
  341. package/dist/{types/shadow-dom/index.d.ts → esm/i18n.generated/i18n.types.js} +3 -3
  342. package/dist/esm/i18n.generated/i18n.types.js.map +1 -0
  343. package/dist/esm/index.js +4 -3
  344. package/dist/esm/index.js.map +1 -1
  345. package/dist/esm/labs/DataFilters.js +1 -1
  346. package/dist/esm/labs/DataFilters.js.map +1 -1
  347. package/dist/esm/labs/DataTable.js +1 -1
  348. package/dist/esm/labs/DataTable.js.map +1 -1
  349. package/dist/esm/labs/DataView/BulkActionsMenu.js +1 -1
  350. package/dist/esm/labs/DataView/BulkActionsMenu.js.map +1 -1
  351. package/dist/esm/labs/DataView/CardLayoutContent.js +61 -45
  352. package/dist/esm/labs/DataView/CardLayoutContent.js.map +1 -1
  353. package/dist/esm/labs/DataView/DataCard.js +51 -180
  354. package/dist/esm/labs/DataView/DataCard.js.map +1 -1
  355. package/dist/esm/labs/DataView/DataView.js +1 -1
  356. package/dist/esm/labs/DataView/DataView.js.map +1 -1
  357. package/dist/esm/labs/DataView/LayoutSwitcher.js +1 -1
  358. package/dist/esm/labs/DataView/LayoutSwitcher.js.map +1 -1
  359. package/dist/esm/labs/DataView/RowActions.js +1 -1
  360. package/dist/esm/labs/DataView/RowActions.js.map +1 -1
  361. package/dist/esm/labs/DataView/TableLayoutContent.js +1 -1
  362. package/dist/esm/labs/DataView/TableLayoutContent.js.map +1 -1
  363. package/dist/esm/labs/DataView/TableSettings.js +1 -1
  364. package/dist/esm/labs/DataView/TableSettings.js.map +1 -1
  365. package/dist/esm/labs/DataView/componentTypes.js.map +1 -1
  366. package/dist/esm/labs/DataView/fetchData.js +2 -2
  367. package/dist/esm/labs/DataView/fetchData.js.map +1 -1
  368. package/dist/esm/labs/DatePickers/DateTimeField.js +1 -1
  369. package/dist/esm/labs/DatePickers/DateTimeField.js.map +1 -1
  370. package/dist/esm/labs/DatePickers/DateTimePicker.js +1 -1
  371. package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
  372. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js +3 -3
  373. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js.map +1 -1
  374. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js +1 -1
  375. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js.map +1 -1
  376. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +4 -0
  377. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
  378. package/dist/esm/labs/OdysseyPickers/index.js.map +1 -1
  379. package/dist/esm/labs/PageTemplate/Layout.js +2 -2
  380. package/dist/esm/labs/PageTemplate/Layout.js.map +1 -1
  381. package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
  382. package/dist/esm/labs/PaginatedTable.js +1 -1
  383. package/dist/esm/labs/PaginatedTable.js.map +1 -1
  384. package/dist/esm/labs/StaticTable.js +1 -1
  385. package/dist/esm/labs/StaticTable.js.map +1 -1
  386. package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
  387. package/dist/esm/properties/ts/odyssey-react-mui_cs.js +7 -1
  388. package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  389. package/dist/esm/properties/ts/odyssey-react-mui_da.js +7 -1
  390. package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
  391. package/dist/esm/properties/ts/odyssey-react-mui_de.js +8 -2
  392. package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
  393. package/dist/esm/properties/ts/odyssey-react-mui_el.js +7 -1
  394. package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
  395. package/dist/esm/properties/ts/odyssey-react-mui_es.js +7 -1
  396. package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
  397. package/dist/esm/properties/ts/odyssey-react-mui_eu.js +7 -1
  398. package/dist/esm/properties/ts/odyssey-react-mui_eu.js.map +1 -1
  399. package/dist/esm/properties/ts/odyssey-react-mui_fi.js +7 -1
  400. package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  401. package/dist/esm/properties/ts/odyssey-react-mui_fr.js +7 -1
  402. package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  403. package/dist/esm/properties/ts/odyssey-react-mui_ht.js +7 -1
  404. package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  405. package/dist/esm/properties/ts/odyssey-react-mui_hu.js +7 -1
  406. package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  407. package/dist/esm/properties/ts/odyssey-react-mui_id.js +7 -1
  408. package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
  409. package/dist/esm/properties/ts/odyssey-react-mui_it.js +7 -1
  410. package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
  411. package/dist/esm/properties/ts/odyssey-react-mui_ja.js +7 -1
  412. package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  413. package/dist/esm/properties/ts/odyssey-react-mui_ko.js +7 -1
  414. package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  415. package/dist/esm/properties/ts/odyssey-react-mui_ms.js +7 -1
  416. package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  417. package/dist/esm/properties/ts/odyssey-react-mui_nb.js +7 -1
  418. package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  419. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +7 -1
  420. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  421. package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
  422. package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
  423. package/dist/esm/properties/ts/odyssey-react-mui_pl.js +7 -1
  424. package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  425. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +7 -1
  426. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  427. package/dist/esm/properties/ts/odyssey-react-mui_ro.js +7 -1
  428. package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  429. package/dist/esm/properties/ts/odyssey-react-mui_ru.js +7 -1
  430. package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  431. package/dist/esm/properties/ts/odyssey-react-mui_sv.js +7 -1
  432. package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  433. package/dist/esm/properties/ts/odyssey-react-mui_th.js +7 -1
  434. package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
  435. package/dist/esm/properties/ts/odyssey-react-mui_tr.js +7 -1
  436. package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  437. package/dist/esm/properties/ts/odyssey-react-mui_uk.js +7 -1
  438. package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  439. package/dist/esm/properties/ts/odyssey-react-mui_vi.js +7 -1
  440. package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  441. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +7 -1
  442. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  443. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +7 -1
  444. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  445. package/dist/esm/test-selectors/AutocompleteTestSelector.js +43 -0
  446. package/dist/esm/test-selectors/AutocompleteTestSelector.js.map +1 -0
  447. package/dist/esm/test-selectors/CalloutTestSelector.js +37 -0
  448. package/dist/esm/test-selectors/CalloutTestSelector.js.map +1 -0
  449. package/dist/esm/test-selectors/SelectTestSelector.js +49 -0
  450. package/dist/esm/test-selectors/SelectTestSelector.js.map +1 -0
  451. package/dist/esm/test-selectors/TabsTestSelector.js +33 -0
  452. package/dist/esm/test-selectors/TabsTestSelector.js.map +1 -0
  453. package/dist/esm/test-selectors/TextFieldTestSelector.js +38 -0
  454. package/dist/esm/test-selectors/TextFieldTestSelector.js.map +1 -0
  455. package/dist/esm/test-selectors/index.js +1 -0
  456. package/dist/esm/test-selectors/index.js.map +1 -1
  457. package/dist/esm/test-selectors/queryOdysseySelector.js +5 -5
  458. package/dist/esm/test-selectors/queryOdysseySelector.js.map +1 -1
  459. package/dist/esm/theme/components.js +5 -9
  460. package/dist/esm/theme/components.js.map +1 -1
  461. package/dist/esm/tools/addSpecificity.js.map +1 -0
  462. package/dist/esm/tools/bufferLatest.js.map +1 -0
  463. package/dist/esm/tools/createMessageBus.js.map +1 -0
  464. package/dist/esm/tools/createStore.js.map +1 -0
  465. package/dist/esm/ui-shell/NarrowUiShellContent.js +3 -13
  466. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  467. package/dist/esm/ui-shell/SideNav/NavAccordion.js +20 -15
  468. package/dist/esm/ui-shell/SideNav/NavAccordion.js.map +1 -1
  469. package/dist/esm/ui-shell/SideNav/SideNav.js +136 -135
  470. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  471. package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js +1 -1
  472. package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js.map +1 -1
  473. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js +7 -4
  474. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js.map +1 -1
  475. package/dist/esm/ui-shell/SideNav/SideNavItemContentContext.js.map +1 -1
  476. package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +3 -4
  477. package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js.map +1 -1
  478. package/dist/esm/ui-shell/SideNav/SideNavSortableList.js +42 -0
  479. package/dist/esm/ui-shell/SideNav/SideNavSortableList.js.map +1 -0
  480. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +1 -1
  481. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js.map +1 -1
  482. package/dist/esm/ui-shell/SideNav/SortableList/SortableItem.js +1 -1
  483. package/dist/esm/ui-shell/SideNav/SortableList/SortableItem.js.map +1 -1
  484. package/dist/esm/ui-shell/SideNav/SortableList/SortableList.js +1 -1
  485. package/dist/esm/ui-shell/SideNav/SortableList/SortableList.js.map +1 -1
  486. package/dist/esm/ui-shell/SideNav/types.js.map +1 -1
  487. package/dist/esm/ui-shell/UiShell.js +4 -4
  488. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  489. package/dist/esm/ui-shell/UiShellProvider.js +1 -1
  490. package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
  491. package/dist/esm/ui-shell/WideUiShellContent.js +2 -1
  492. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  493. package/dist/esm/ui-shell/renderUiShell.js +2 -2
  494. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  495. package/dist/esm/ui-shell/uiShellContentTypes.js +1 -0
  496. package/dist/esm/ui-shell/uiShellContentTypes.js.map +1 -1
  497. package/dist/esm/{shadow-dom/shadow-dom.js → web-component/createShadowDomElements.js} +8 -3
  498. package/dist/esm/web-component/createShadowDomElements.js.map +1 -0
  499. package/dist/esm/web-component/index.js +3 -0
  500. package/dist/esm/web-component/index.js.map +1 -1
  501. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  502. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  503. package/dist/esm/web-component/removeGlobalStylesFromShadowDom.js +28 -0
  504. package/dist/esm/web-component/removeGlobalStylesFromShadowDom.js.map +1 -0
  505. package/dist/esm/web-component/renderReactInWebComponent.js +5 -9
  506. package/dist/esm/web-component/renderReactInWebComponent.js.map +1 -1
  507. package/dist/tsconfig.production.tsbuildinfo +1 -1
  508. package/dist/types/Autocomplete.d.ts +0 -30
  509. package/dist/types/Autocomplete.d.ts.map +1 -1
  510. package/dist/types/Banner.d.ts.map +1 -1
  511. package/dist/types/Breadcrumbs.d.ts.map +1 -1
  512. package/dist/types/Buttons/BaseButton.d.ts +2 -2
  513. package/dist/types/Buttons/BaseButton.d.ts.map +1 -1
  514. package/dist/types/Callout.d.ts +0 -24
  515. package/dist/types/Callout.d.ts.map +1 -1
  516. package/dist/types/Card.d.ts +17 -6
  517. package/dist/types/Card.d.ts.map +1 -1
  518. package/dist/types/Checkbox.d.ts.map +1 -1
  519. package/dist/types/DataTable/DataTable.d.ts.map +1 -1
  520. package/dist/types/DataTable/DataTableRowActions.d.ts.map +1 -1
  521. package/dist/types/DatePickers/DatePicker.d.ts.map +1 -1
  522. package/dist/types/DatePickers/useDateFieldsTranslations.d.ts.map +1 -1
  523. package/dist/types/DatePickers/useOdysseyDateFields.d.ts.map +1 -1
  524. package/dist/types/Dialog.d.ts.map +1 -1
  525. package/dist/types/Drawer.d.ts.map +1 -1
  526. package/dist/types/Field.d.ts.map +1 -1
  527. package/dist/types/FieldError.d.ts.map +1 -1
  528. package/dist/types/FieldLabel.d.ts.map +1 -1
  529. package/dist/types/FileUploader/FileUploader.d.ts.map +1 -1
  530. package/dist/types/FullScreenOverlay.d.ts +19 -0
  531. package/dist/types/FullScreenOverlay.d.ts.map +1 -0
  532. package/dist/types/FullScreenOverlayContext.d.ts +31 -0
  533. package/dist/types/FullScreenOverlayContext.d.ts.map +1 -0
  534. package/dist/types/NativeSelect.d.ts +1 -1
  535. package/dist/types/OdysseyCacheProvider.d.ts +10 -3
  536. package/dist/types/OdysseyCacheProvider.d.ts.map +1 -1
  537. package/dist/types/OdysseyProvider.d.ts +8 -8
  538. package/dist/types/OdysseyProvider.d.ts.map +1 -1
  539. package/dist/types/OdysseyThemeProvider.d.ts +7 -16
  540. package/dist/types/OdysseyThemeProvider.d.ts.map +1 -1
  541. package/dist/types/OdysseyThemeProviderPropsContext.d.ts +27 -0
  542. package/dist/types/OdysseyThemeProviderPropsContext.d.ts.map +1 -0
  543. package/dist/types/Pagination/Pagination.d.ts +0 -1
  544. package/dist/types/Pagination/Pagination.d.ts.map +1 -1
  545. package/dist/types/Pagination/usePagination.d.ts.map +1 -1
  546. package/dist/types/PasswordField.d.ts.map +1 -1
  547. package/dist/types/Radio.d.ts.map +1 -1
  548. package/dist/types/SearchField.d.ts.map +1 -1
  549. package/dist/types/Select.d.ts +0 -36
  550. package/dist/types/Select.d.ts.map +1 -1
  551. package/dist/types/Surface.d.ts.map +1 -1
  552. package/dist/types/Switch.d.ts.map +1 -1
  553. package/dist/types/Tabs.d.ts +0 -20
  554. package/dist/types/Tabs.d.ts.map +1 -1
  555. package/dist/types/Tag.d.ts.map +1 -1
  556. package/dist/types/TextField.d.ts +0 -25
  557. package/dist/types/TextField.d.ts.map +1 -1
  558. package/dist/types/Toast.d.ts.map +1 -1
  559. package/dist/types/__internal.d.ts +30 -0
  560. package/dist/types/__internal.d.ts.map +1 -0
  561. package/dist/types/i18n.generated/i18n.d.ts +285 -0
  562. package/dist/types/i18n.generated/i18n.d.ts.map +1 -0
  563. package/dist/types/i18n.generated/i18n.resources.d.ts +4199 -0
  564. package/dist/types/{i18n.d.ts.map → i18n.generated/i18n.resources.d.ts.map} +1 -1
  565. package/dist/types/i18n.generated/i18n.types.d.ts +30 -0
  566. package/dist/types/i18n.generated/i18n.types.d.ts.map +1 -0
  567. package/dist/types/index.d.ts +4 -3
  568. package/dist/types/index.d.ts.map +1 -1
  569. package/dist/types/labs/DataTable.d.ts.map +1 -1
  570. package/dist/types/labs/DataView/CardLayoutContent.d.ts.map +1 -1
  571. package/dist/types/labs/DataView/DataCard.d.ts +14 -30
  572. package/dist/types/labs/DataView/DataCard.d.ts.map +1 -1
  573. package/dist/types/labs/DataView/RowActions.d.ts.map +1 -1
  574. package/dist/types/labs/DataView/componentTypes.d.ts +1 -1
  575. package/dist/types/labs/DataView/componentTypes.d.ts.map +1 -1
  576. package/dist/types/labs/DataView/fetchData.d.ts.map +1 -1
  577. package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
  578. package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -1
  579. package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
  580. package/dist/types/labs/OdysseyPickers/index.d.ts +1 -2
  581. package/dist/types/labs/OdysseyPickers/index.d.ts.map +1 -1
  582. package/dist/types/labs/PageTemplate/PageTemplate.d.ts.map +1 -1
  583. package/dist/types/labs/PaginatedTable.d.ts.map +1 -1
  584. package/dist/types/labs/StaticTable.d.ts.map +1 -1
  585. package/dist/types/properties/ts/odyssey-react-mui.d.ts +133 -133
  586. package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  587. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +133 -127
  588. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  589. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts +133 -127
  590. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  591. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts +133 -127
  592. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  593. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts +133 -127
  594. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  595. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts +133 -127
  596. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  597. package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts +133 -127
  598. package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts.map +1 -1
  599. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +133 -127
  600. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  601. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts +133 -127
  602. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  603. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +133 -127
  604. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  605. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts +133 -127
  606. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  607. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts +133 -127
  608. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  609. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts +133 -127
  610. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  611. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts +133 -127
  612. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  613. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts +133 -127
  614. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  615. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts +133 -127
  616. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  617. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts +133 -127
  618. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  619. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts +133 -127
  620. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  621. package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts +133 -133
  622. package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
  623. package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts +133 -133
  624. package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
  625. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +133 -127
  626. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  627. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts +133 -127
  628. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  629. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts +133 -127
  630. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  631. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts +133 -127
  632. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  633. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts +133 -127
  634. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  635. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts +133 -127
  636. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  637. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts +133 -127
  638. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  639. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts +133 -127
  640. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  641. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts +133 -127
  642. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  643. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts +133 -127
  644. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  645. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +133 -127
  646. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  647. package/dist/types/test-selectors/AutocompleteTestSelector.d.ts +42 -0
  648. package/dist/types/test-selectors/AutocompleteTestSelector.d.ts.map +1 -0
  649. package/dist/types/test-selectors/CalloutTestSelector.d.ts +36 -0
  650. package/dist/types/test-selectors/CalloutTestSelector.d.ts.map +1 -0
  651. package/dist/types/test-selectors/SelectTestSelector.d.ts +48 -0
  652. package/dist/types/test-selectors/SelectTestSelector.d.ts.map +1 -0
  653. package/dist/types/test-selectors/TabsTestSelector.d.ts +32 -0
  654. package/dist/types/test-selectors/TabsTestSelector.d.ts.map +1 -0
  655. package/dist/types/test-selectors/TextFieldTestSelector.d.ts +37 -0
  656. package/dist/types/test-selectors/TextFieldTestSelector.d.ts.map +1 -0
  657. package/dist/types/test-selectors/index.d.ts +1 -0
  658. package/dist/types/test-selectors/index.d.ts.map +1 -1
  659. package/dist/types/test-selectors/queryOdysseySelector.d.ts.map +1 -1
  660. package/dist/types/theme/components.d.ts.map +1 -1
  661. package/dist/types/tools/addSpecificity.d.ts.map +1 -0
  662. package/dist/types/tools/bufferLatest.d.ts.map +1 -0
  663. package/dist/types/tools/createMessageBus.d.ts.map +1 -0
  664. package/dist/types/tools/createStore.d.ts.map +1 -0
  665. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  666. package/dist/types/ui-shell/SideNav/NavAccordion.d.ts.map +1 -1
  667. package/dist/types/ui-shell/SideNav/SideNav.d.ts +1 -1
  668. package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
  669. package/dist/types/ui-shell/SideNav/SideNavFooterContent.d.ts.map +1 -1
  670. package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts +2 -1
  671. package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts.map +1 -1
  672. package/dist/types/ui-shell/SideNav/SideNavItemContentContext.d.ts +1 -0
  673. package/dist/types/ui-shell/SideNav/SideNavItemContentContext.d.ts.map +1 -1
  674. package/dist/types/ui-shell/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
  675. package/dist/types/ui-shell/SideNav/SideNavSortableList.d.ts +41 -0
  676. package/dist/types/ui-shell/SideNav/SideNavSortableList.d.ts.map +1 -0
  677. package/dist/types/ui-shell/SideNav/types.d.ts +13 -2
  678. package/dist/types/ui-shell/SideNav/types.d.ts.map +1 -1
  679. package/dist/types/ui-shell/UiShell.d.ts +1 -1
  680. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  681. package/dist/types/ui-shell/UiShellProvider.d.ts +1 -1
  682. package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
  683. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  684. package/dist/types/ui-shell/renderUiShell.d.ts +2 -2
  685. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  686. package/dist/types/ui-shell/uiShellContentTypes.d.ts +4 -1
  687. package/dist/types/ui-shell/uiShellContentTypes.d.ts.map +1 -1
  688. package/dist/types/{shadow-dom/shadow-dom.d.ts → web-component/createShadowDomElements.d.ts} +6 -4
  689. package/dist/types/web-component/createShadowDomElements.d.ts.map +1 -0
  690. package/dist/types/web-component/index.d.ts +3 -0
  691. package/dist/types/web-component/index.d.ts.map +1 -1
  692. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  693. package/dist/types/web-component/removeGlobalStylesFromShadowDom.d.ts +18 -0
  694. package/dist/types/web-component/removeGlobalStylesFromShadowDom.d.ts.map +1 -0
  695. package/dist/types/web-component/renderReactInWebComponent.d.ts +1 -1
  696. package/dist/types/web-component/renderReactInWebComponent.d.ts.map +1 -1
  697. package/package.json +26 -17
  698. package/dist/cjs/@types/i18next.d.cjs +0 -4
  699. package/dist/cjs/@types/i18next.d.cjs.map +0 -1
  700. package/dist/cjs/@types/properties.d.cjs +0 -2
  701. package/dist/cjs/@types/properties.d.cjs.map +0 -1
  702. package/dist/cjs/OdysseyTranslationProvider.cjs +0 -55
  703. package/dist/cjs/OdysseyTranslationProvider.cjs.map +0 -1
  704. package/dist/cjs/OdysseyTranslationProvider.types.cjs.map +0 -1
  705. package/dist/cjs/addSpecificity.cjs.map +0 -1
  706. package/dist/cjs/i18n.cjs +0 -113
  707. package/dist/cjs/i18n.cjs.map +0 -1
  708. package/dist/cjs/shadow-dom/index.cjs +0 -17
  709. package/dist/cjs/shadow-dom/index.cjs.map +0 -1
  710. package/dist/cjs/shadow-dom/shadow-dom.cjs.map +0 -1
  711. package/dist/cjs/ui-shell/bufferLatest.cjs.map +0 -1
  712. package/dist/cjs/ui-shell/createMessageBus.cjs.map +0 -1
  713. package/dist/cjs/ui-shell/createStore.cjs.map +0 -1
  714. package/dist/esm/@types/i18next.d.js +0 -14
  715. package/dist/esm/@types/i18next.d.js.map +0 -1
  716. package/dist/esm/@types/properties.d.js +0 -2
  717. package/dist/esm/@types/properties.d.js.map +0 -1
  718. package/dist/esm/OdysseyTranslationProvider.js +0 -48
  719. package/dist/esm/OdysseyTranslationProvider.js.map +0 -1
  720. package/dist/esm/OdysseyTranslationProvider.types.js +0 -14
  721. package/dist/esm/OdysseyTranslationProvider.types.js.map +0 -1
  722. package/dist/esm/addSpecificity.js.map +0 -1
  723. package/dist/esm/i18n.js +0 -100
  724. package/dist/esm/i18n.js.map +0 -1
  725. package/dist/esm/shadow-dom/index.js.map +0 -1
  726. package/dist/esm/shadow-dom/shadow-dom.js.map +0 -1
  727. package/dist/esm/ui-shell/bufferLatest.js.map +0 -1
  728. package/dist/esm/ui-shell/createMessageBus.js.map +0 -1
  729. package/dist/esm/ui-shell/createStore.js.map +0 -1
  730. package/dist/types/OdysseyTranslationProvider.d.ts +0 -24
  731. package/dist/types/OdysseyTranslationProvider.d.ts.map +0 -1
  732. package/dist/types/OdysseyTranslationProvider.types.d.ts +0 -14
  733. package/dist/types/OdysseyTranslationProvider.types.d.ts.map +0 -1
  734. package/dist/types/addSpecificity.d.ts.map +0 -1
  735. package/dist/types/i18n.d.ts +0 -3910
  736. package/dist/types/shadow-dom/index.d.ts.map +0 -1
  737. package/dist/types/shadow-dom/shadow-dom.d.ts.map +0 -1
  738. package/dist/types/ui-shell/bufferLatest.d.ts.map +0 -1
  739. package/dist/types/ui-shell/createMessageBus.d.ts.map +0 -1
  740. package/dist/types/ui-shell/createStore.d.ts.map +0 -1
  741. /package/dist/cjs/{addSpecificity.cjs → tools/addSpecificity.cjs} +0 -0
  742. /package/dist/cjs/{ui-shell → tools}/bufferLatest.cjs +0 -0
  743. /package/dist/cjs/{ui-shell → tools}/createMessageBus.cjs +0 -0
  744. /package/dist/cjs/{ui-shell → tools}/createStore.cjs +0 -0
  745. /package/dist/esm/{addSpecificity.js → tools/addSpecificity.js} +0 -0
  746. /package/dist/esm/{ui-shell → tools}/bufferLatest.js +0 -0
  747. /package/dist/esm/{ui-shell → tools}/createMessageBus.js +0 -0
  748. /package/dist/esm/{ui-shell → tools}/createStore.js +0 -0
  749. /package/dist/types/{addSpecificity.d.ts → tools/addSpecificity.d.ts} +0 -0
  750. /package/dist/types/{ui-shell → tools}/bufferLatest.d.ts +0 -0
  751. /package/dist/types/{ui-shell → tools}/createMessageBus.d.ts +0 -0
  752. /package/dist/types/{ui-shell → tools}/createStore.d.ts +0 -0
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SideNavSortableList = void 0;
7
+ var _react = require("react");
8
+ var _SortableList = require("./SortableList/SortableList.cjs");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /*!
11
+ * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
12
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
13
+ *
14
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ *
19
+ * See the License for the specific language governing permissions and limitations under the License.
20
+ */
21
+
22
+ const SideNavSortableList = ({
23
+ items,
24
+ onChange,
25
+ parentId,
26
+ processSideNavItems,
27
+ depth = 1
28
+ }) => {
29
+ const processedItems = (0, _react.useMemo)(() => processSideNavItems(items, depth), [processSideNavItems, items, depth]);
30
+ const sortableItems = (0, _react.useMemo)(() => processedItems.map(item => item.sortableItem), [processedItems]);
31
+ const renderItem = (0, _react.useCallback)(sortableItem => (0, _jsxRuntime.jsx)(_SortableList.SortableList.Item, {
32
+ id: sortableItem.id,
33
+ isDisabled: sortableItem.isDisabled,
34
+ isSelected: sortableItem.isSelected,
35
+ isSortable: sortableItem.isSortable,
36
+ children: sortableItem.navItem
37
+ }), []);
38
+ return (0, _jsxRuntime.jsx)(_SortableList.SortableList, {
39
+ items: sortableItems,
40
+ onChange: onChange,
41
+ parentId: parentId,
42
+ renderItem: renderItem
43
+ });
44
+ };
45
+ const MemoizedSideNavSortableList = exports.SideNavSortableList = (0, _react.memo)(SideNavSortableList);
46
+ MemoizedSideNavSortableList.displayName = "SideNavSortableList";
47
+ //# sourceMappingURL=SideNavSortableList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideNavSortableList.cjs","names":["_react","require","_SortableList","_jsxRuntime","SideNavSortableList","items","onChange","parentId","processSideNavItems","depth","processedItems","useMemo","sortableItems","map","item","sortableItem","renderItem","useCallback","jsx","SortableList","Item","id","isDisabled","isSelected","isSortable","children","navItem","MemoizedSideNavSortableList","exports","memo","displayName"],"sources":["../../../../src/ui-shell/SideNav/SideNavSortableList.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 { UniqueIdentifier } from \"@dnd-kit/core\";\nimport { memo, useCallback, useMemo } from \"react\";\n\nimport type { SideNavItem } from \"./types.js\";\n\nimport { BaseItem, SortableList } from \"./SortableList/SortableList.js\";\n\nexport type SideNavSortableListProps = {\n /**\n * The depth level for nested items\n */\n depth?: number;\n /**\n * The nav items to render as sortable list\n */\n items: SideNavItem[];\n /**\n * Callback when items are reordered\n */\n onChange: (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n /**\n * The parent ID for the sortable list\n */\n parentId: string;\n /**\n * Function to process nav items into sortable items\n */\n processSideNavItems: (\n items: SideNavItem[],\n depth?: number,\n ) => (SideNavItem & { sortableItem: BaseItem })[];\n};\n\nconst SideNavSortableList = ({\n items,\n onChange,\n parentId,\n processSideNavItems,\n depth = 1,\n}: SideNavSortableListProps) => {\n const processedItems = useMemo(\n () => processSideNavItems(items, depth),\n [processSideNavItems, items, depth],\n );\n\n const sortableItems = useMemo(\n () => processedItems.map((item) => item.sortableItem),\n [processedItems],\n );\n\n const renderItem = useCallback(\n (sortableItem: BaseItem) => (\n <SortableList.Item\n id={sortableItem.id}\n isDisabled={sortableItem.isDisabled}\n isSelected={sortableItem.isSelected}\n isSortable={sortableItem.isSortable}\n >\n {sortableItem.navItem}\n </SortableList.Item>\n ),\n [],\n );\n\n return (\n <SortableList\n items={sortableItems}\n onChange={onChange}\n parentId={parentId}\n renderItem={renderItem}\n />\n );\n};\n\nconst MemoizedSideNavSortableList = memo(SideNavSortableList);\nMemoizedSideNavSortableList.displayName = \"SideNavSortableList\";\n\nexport { MemoizedSideNavSortableList as SideNavSortableList };\n"],"mappings":";;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,aAAA,GAAAD,OAAA;AAAwE,IAAAE,WAAA,GAAAF,OAAA;AAjBxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwCA,MAAMG,mBAAmB,GAAGA,CAAC;EAC3BC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,mBAAmB;EACnBC,KAAK,GAAG;AACgB,CAAC,KAAK;EAC9B,MAAMC,cAAc,GAAG,IAAAC,cAAO,EAC5B,MAAMH,mBAAmB,CAACH,KAAK,EAAEI,KAAK,CAAC,EACvC,CAACD,mBAAmB,EAAEH,KAAK,EAAEI,KAAK,CACpC,CAAC;EAED,MAAMG,aAAa,GAAG,IAAAD,cAAO,EAC3B,MAAMD,cAAc,CAACG,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACC,YAAY,CAAC,EACrD,CAACL,cAAc,CACjB,CAAC;EAED,MAAMM,UAAU,GAAG,IAAAC,kBAAW,EAC3BF,YAAsB,IACrB,IAAAZ,WAAA,CAAAe,GAAA,EAAChB,aAAA,CAAAiB,YAAY,CAACC,IAAI;IAChBC,EAAE,EAAEN,YAAY,CAACM,EAAG;IACpBC,UAAU,EAAEP,YAAY,CAACO,UAAW;IACpCC,UAAU,EAAER,YAAY,CAACQ,UAAW;IACpCC,UAAU,EAAET,YAAY,CAACS,UAAW;IAAAC,QAAA,EAEnCV,YAAY,CAACW;EAAO,CACJ,CACpB,EACD,EACF,CAAC;EAED,OACE,IAAAvB,WAAA,CAAAe,GAAA,EAAChB,aAAA,CAAAiB,YAAY;IACXd,KAAK,EAAEO,aAAc;IACrBN,QAAQ,EAAEA,QAAS;IACnBC,QAAQ,EAAEA,QAAS;IACnBS,UAAU,EAAEA;EAAW,CACxB,CAAC;AAEN,CAAC;AAED,MAAMW,2BAA2B,GAAAC,OAAA,CAAAxB,mBAAA,GAAG,IAAAyB,WAAI,EAACzB,mBAAmB,CAAC;AAC7DuB,2BAA2B,CAACG,WAAW,GAAG,qBAAqB","ignoreList":[]}
@@ -7,7 +7,7 @@ exports.SideNavToggleButton = exports.SIDE_NAV_TOGGLE_ICON_SIZE = exports.SIDE_N
7
7
  var _Button2 = _interopRequireDefault(require("@mui/material/Button"));
8
8
  var _styled = _interopRequireDefault(require("@emotion/styled"));
9
9
  var _react = require("react");
10
- var _reactI18next = require("react-i18next");
10
+ var _i18n = require("../../i18n.generated/i18n.cjs");
11
11
  var _ChevronRight = require("../../icons.generated/ChevronRight.cjs");
12
12
  var _MuiPropsContext = require("../../MuiPropsContext.cjs");
13
13
  var _OdysseyDesignTokensContext = require("../../OdysseyDesignTokensContext.cjs");
@@ -100,7 +100,7 @@ const SideNavToggleButton = ({
100
100
  const odysseyDesignTokens = (0, _OdysseyDesignTokensContext.useOdysseyDesignTokens)();
101
101
  const {
102
102
  t
103
- } = (0, _reactI18next.useTranslation)();
103
+ } = (0, _i18n.useTranslation)();
104
104
  const buttonRef = (0, _react.useRef)(defaultLocalButton);
105
105
  (0, _react.useEffect)(() => {
106
106
  const setHighlighted = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavToggleButton.cjs","names":["_styled","_interopRequireDefault","require","_react","_reactI18next","_ChevronRight","_MuiPropsContext","_OdysseyDesignTokensContext","_Tooltip","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","SIDE_NAV_TOGGLE_ICON_SIZE","exports","SIDE_NAV_TOGGLE_ICON_HALF_SIZE","StyledToggleButton","styled","_Button2","shouldForwardProp","prop","clickAreaPadding","odysseyDesignTokens","border","height","left","padding","position","width","zIndex","UI_SHELL_OVERLAY_Z_INDEX","backgroundColor","borderColor","boxShadow","color","PalettePrimaryText","outline","HueNeutralWhite","borderRadius","ShadowScale1","content","top","StyledChevronRightIcon","ChevronRightIcon","isSideNavCollapsed","fontSize","undefined","right","transform","transitionDuration","TransitionDurationMain","transitionProperty","transitionTimingFunction","defaultLocalButton","window","document","createElement","SideNavToggleButton","ariaControls","id","onClick","onHighlight","tabIndex","useOdysseyDesignTokens","t","useTranslation","buttonRef","useRef","useEffect","setHighlighted","setUnhighlighted","setFocusHighlighted","Boolean","current","matches","addEventListener","removeEventListener","toggleLabel","useMemo","renderButton","useCallback","muiProps","jsx","ref","element","variant","children","Tooltip","ariaType","placement","text","MuiPropsContext","Consumer","MemoizedSideNavToggleButton","memo","displayName"],"sources":["../../../../src/ui-shell/SideNav/SideNavToggleButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\n\nimport styled from \"@emotion/styled\";\nimport { Button as MuiButton } from \"@mui/material\";\nimport {\n HTMLAttributes,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ChevronRightIcon } from \"../../icons.generated/ChevronRight.js\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../../MuiPropsContext.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Tooltip } from \"../../Tooltip.js\";\nimport { UI_SHELL_OVERLAY_Z_INDEX } from \"../uiShellSharedConstants.js\";\n\nexport const SIDE_NAV_TOGGLE_ICON_SIZE = 24;\nexport const SIDE_NAV_TOGGLE_ICON_HALF_SIZE = SIDE_NAV_TOGGLE_ICON_SIZE / 2;\n\nconst StyledToggleButton = styled(MuiButton, {\n shouldForwardProp: (prop) =>\n prop !== \"clickAreaPadding\" && prop !== \"odysseyDesignTokens\",\n})<{\n clickAreaPadding: number;\n odysseyDesignTokens: DesignTokens;\n}>(({ clickAreaPadding, odysseyDesignTokens }) => ({\n border: 0,\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `-${clickAreaPadding * 2}px`,\n padding: 0,\n position: \"relative\",\n width: `calc(${SIDE_NAV_TOGGLE_ICON_SIZE}px + (${clickAreaPadding}px * 2))`,\n zIndex: UI_SHELL_OVERLAY_Z_INDEX,\n\n // `&&` is a CSS specificity override. Used here to counteract MUI Button styles.\n \"&&\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n boxShadow: \"none\",\n color: odysseyDesignTokens.PalettePrimaryText,\n },\n\n \"&:focus-visible\": {\n outline: \"none\",\n },\n\n \"&:hover, &:focus-visible\": {\n color: odysseyDesignTokens.HueNeutralWhite,\n },\n\n \"&::before\": {\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n borderColor: \"transparent\",\n borderRadius: \"50%\",\n boxShadow: odysseyDesignTokens.ShadowScale1,\n color: odysseyDesignTokens.PalettePrimaryText,\n content: \"''\",\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `${clickAreaPadding * 2}px`,\n position: \"absolute\",\n top: 0,\n width: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n },\n\n \"&:hover::before, &:focus-visible::before\": {\n backgroundColor: odysseyDesignTokens.PalettePrimaryText,\n },\n}));\n\nconst StyledChevronRightIcon = styled(ChevronRightIcon, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})<{\n isSideNavCollapsed: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ isSideNavCollapsed, odysseyDesignTokens }) => ({\n fontSize: \"125%\",\n left: isSideNavCollapsed ? undefined : \"4px\",\n position: \"absolute\",\n right: isSideNavCollapsed ? \"4px\" : undefined,\n top: \"3px\",\n transform: isSideNavCollapsed ? \"rotate(0deg)\" : \"rotate(-180deg)\", // Leave this as `-180deg` so it rotates over the top, not the bottom.\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n transitionProperty: \"transform\",\n transitionTimingFunction: \"ease-in-out\",\n}));\n\nexport type SideNavToggleButtonProps = {\n /**\n * The `id` of the item this button controls\n */\n ariaControls: string;\n /**\n * Left padding in pixels for the click area of the button.\n *\n * Useful when moving the button around when trying to click it. This ensures the click area doesn't move to the right along with the button.\n */\n clickAreaPadding?: number;\n /**\n * HTML `id` attribute for the `<button>` element.\n */\n id?: string;\n isSideNavCollapsed: boolean;\n /**\n * Click event handler for the `<button>` element.\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * Provides the hovered or focused state of the `<button>` element.\n */\n onHighlight?: (isHighlighted: boolean) => void;\n onKeyDown?: MuiButtonProps[\"onKeyDown\"];\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n};\n\n// This allows us to mutate the value with TypeScript. A singleton is fine because it gets overridden on render.\nconst defaultLocalButton =\n typeof window === \"undefined\" ? null : document.createElement(\"button\");\n\nconst SideNavToggleButton = ({\n ariaControls,\n clickAreaPadding = 0,\n id,\n isSideNavCollapsed,\n onClick,\n onHighlight,\n tabIndex,\n}: SideNavToggleButtonProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const buttonRef = useRef(defaultLocalButton);\n\n useEffect(() => {\n const setHighlighted = () => {\n onHighlight?.(true);\n };\n\n const setUnhighlighted = () => {\n onHighlight?.(false);\n };\n\n const setFocusHighlighted = () => {\n onHighlight?.(Boolean(buttonRef.current?.matches(\":focus-visible\")));\n };\n\n buttonRef.current?.addEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.addEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.addEventListener(\"focus\", setFocusHighlighted, true);\n\n buttonRef.current?.addEventListener(\"blur\", setFocusHighlighted, true);\n\n setUnhighlighted();\n\n return () => {\n buttonRef.current?.removeEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.removeEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.removeEventListener(\n \"focus\",\n setFocusHighlighted,\n true,\n );\n\n buttonRef.current?.removeEventListener(\"blur\", setFocusHighlighted, true);\n };\n }, [onHighlight]);\n\n const toggleLabel = useMemo(\n () =>\n isSideNavCollapsed\n ? t(\"sidenav.toggle.expand\")\n : t(\"sidenav.toggle.collapse\"),\n [isSideNavCollapsed, t],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <StyledToggleButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-expanded={!isSideNavCollapsed}\n aria-label={toggleLabel}\n clickAreaPadding={clickAreaPadding}\n data-se=\"sidenav-toggle-button\"\n data-sidenav-toggle\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n onClick={onClick}\n ref={(element: HTMLButtonElement) => {\n if (element) {\n buttonRef.current = element;\n //@ts-expect-error `ref` is an optional prop, but TypeScript doesn't know this.\n muiProps.ref?.(element);\n }\n }}\n tabIndex={tabIndex}\n variant=\"floating\"\n >\n <StyledChevronRightIcon\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </StyledToggleButton>\n );\n },\n [\n ariaControls,\n clickAreaPadding,\n id,\n isSideNavCollapsed,\n odysseyDesignTokens,\n onClick,\n tabIndex,\n toggleLabel,\n ],\n );\n\n return (\n <Tooltip ariaType=\"description\" placement=\"right\" text={toggleLabel}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n};\n\nconst MemoizedSideNavToggleButton = memo(SideNavToggleButton);\nMemoizedSideNavToggleButton.displayName = \"SideNavToggleButton\";\n\nexport { MemoizedSideNavToggleButton as SideNavToggleButton };\n"],"mappings":";;;;;;;AAcA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAQA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AAAwE,IAAAQ,WAAA,GAAA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CAAAyE,GAAA,EAAC7E,gBAAA,CAAAsF,eAAe,CAACC,QAAQ;MAAAN,QAAA,EAAEP;IAAY,CAA2B;EAAC,CAC5D,CAAC;AAEd,CAAC;AAED,MAAMc,2BAA2B,GAAA/E,OAAA,CAAA2C,mBAAA,GAAG,IAAAqC,WAAI,EAACrC,mBAAmB,CAAC;AAC7DoC,2BAA2B,CAACE,WAAW,GAAG,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"SideNavToggleButton.cjs","names":["_styled","_interopRequireDefault","require","_react","_i18n","_ChevronRight","_MuiPropsContext","_OdysseyDesignTokensContext","_Tooltip","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","SIDE_NAV_TOGGLE_ICON_SIZE","exports","SIDE_NAV_TOGGLE_ICON_HALF_SIZE","StyledToggleButton","styled","_Button2","shouldForwardProp","prop","clickAreaPadding","odysseyDesignTokens","border","height","left","padding","position","width","zIndex","UI_SHELL_OVERLAY_Z_INDEX","backgroundColor","borderColor","boxShadow","color","PalettePrimaryText","outline","HueNeutralWhite","borderRadius","ShadowScale1","content","top","StyledChevronRightIcon","ChevronRightIcon","isSideNavCollapsed","fontSize","undefined","right","transform","transitionDuration","TransitionDurationMain","transitionProperty","transitionTimingFunction","defaultLocalButton","window","document","createElement","SideNavToggleButton","ariaControls","id","onClick","onHighlight","tabIndex","useOdysseyDesignTokens","t","useTranslation","buttonRef","useRef","useEffect","setHighlighted","setUnhighlighted","setFocusHighlighted","Boolean","current","matches","addEventListener","removeEventListener","toggleLabel","useMemo","renderButton","useCallback","muiProps","jsx","ref","element","variant","children","Tooltip","ariaType","placement","text","MuiPropsContext","Consumer","MemoizedSideNavToggleButton","memo","displayName"],"sources":["../../../../src/ui-shell/SideNav/SideNavToggleButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\n\nimport styled from \"@emotion/styled\";\nimport { Button as MuiButton } from \"@mui/material\";\nimport {\n HTMLAttributes,\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { useTranslation } from \"../../i18n.generated/i18n.js\";\nimport { ChevronRightIcon } from \"../../icons.generated/ChevronRight.js\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../../MuiPropsContext.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Tooltip } from \"../../Tooltip.js\";\nimport { UI_SHELL_OVERLAY_Z_INDEX } from \"../uiShellSharedConstants.js\";\n\nexport const SIDE_NAV_TOGGLE_ICON_SIZE = 24;\nexport const SIDE_NAV_TOGGLE_ICON_HALF_SIZE = SIDE_NAV_TOGGLE_ICON_SIZE / 2;\n\nconst StyledToggleButton = styled(MuiButton, {\n shouldForwardProp: (prop) =>\n prop !== \"clickAreaPadding\" && prop !== \"odysseyDesignTokens\",\n})<{\n clickAreaPadding: number;\n odysseyDesignTokens: DesignTokens;\n}>(({ clickAreaPadding, odysseyDesignTokens }) => ({\n border: 0,\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `-${clickAreaPadding * 2}px`,\n padding: 0,\n position: \"relative\",\n width: `calc(${SIDE_NAV_TOGGLE_ICON_SIZE}px + (${clickAreaPadding}px * 2))`,\n zIndex: UI_SHELL_OVERLAY_Z_INDEX,\n\n // `&&` is a CSS specificity override. Used here to counteract MUI Button styles.\n \"&&\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n boxShadow: \"none\",\n color: odysseyDesignTokens.PalettePrimaryText,\n },\n\n \"&:focus-visible\": {\n outline: \"none\",\n },\n\n \"&:hover, &:focus-visible\": {\n color: odysseyDesignTokens.HueNeutralWhite,\n },\n\n \"&::before\": {\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n borderColor: \"transparent\",\n borderRadius: \"50%\",\n boxShadow: odysseyDesignTokens.ShadowScale1,\n color: odysseyDesignTokens.PalettePrimaryText,\n content: \"''\",\n height: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n left: `${clickAreaPadding * 2}px`,\n position: \"absolute\",\n top: 0,\n width: `${SIDE_NAV_TOGGLE_ICON_SIZE}px`,\n },\n\n \"&:hover::before, &:focus-visible::before\": {\n backgroundColor: odysseyDesignTokens.PalettePrimaryText,\n },\n}));\n\nconst StyledChevronRightIcon = styled(ChevronRightIcon, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})<{\n isSideNavCollapsed: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ isSideNavCollapsed, odysseyDesignTokens }) => ({\n fontSize: \"125%\",\n left: isSideNavCollapsed ? undefined : \"4px\",\n position: \"absolute\",\n right: isSideNavCollapsed ? \"4px\" : undefined,\n top: \"3px\",\n transform: isSideNavCollapsed ? \"rotate(0deg)\" : \"rotate(-180deg)\", // Leave this as `-180deg` so it rotates over the top, not the bottom.\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n transitionProperty: \"transform\",\n transitionTimingFunction: \"ease-in-out\",\n}));\n\nexport type SideNavToggleButtonProps = {\n /**\n * The `id` of the item this button controls\n */\n ariaControls: string;\n /**\n * Left padding in pixels for the click area of the button.\n *\n * Useful when moving the button around when trying to click it. This ensures the click area doesn't move to the right along with the button.\n */\n clickAreaPadding?: number;\n /**\n * HTML `id` attribute for the `<button>` element.\n */\n id?: string;\n isSideNavCollapsed: boolean;\n /**\n * Click event handler for the `<button>` element.\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * Provides the hovered or focused state of the `<button>` element.\n */\n onHighlight?: (isHighlighted: boolean) => void;\n onKeyDown?: MuiButtonProps[\"onKeyDown\"];\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n};\n\n// This allows us to mutate the value with TypeScript. A singleton is fine because it gets overridden on render.\nconst defaultLocalButton =\n typeof window === \"undefined\" ? null : document.createElement(\"button\");\n\nconst SideNavToggleButton = ({\n ariaControls,\n clickAreaPadding = 0,\n id,\n isSideNavCollapsed,\n onClick,\n onHighlight,\n tabIndex,\n}: SideNavToggleButtonProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const buttonRef = useRef(defaultLocalButton);\n\n useEffect(() => {\n const setHighlighted = () => {\n onHighlight?.(true);\n };\n\n const setUnhighlighted = () => {\n onHighlight?.(false);\n };\n\n const setFocusHighlighted = () => {\n onHighlight?.(Boolean(buttonRef.current?.matches(\":focus-visible\")));\n };\n\n buttonRef.current?.addEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.addEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.addEventListener(\"focus\", setFocusHighlighted, true);\n\n buttonRef.current?.addEventListener(\"blur\", setFocusHighlighted, true);\n\n setUnhighlighted();\n\n return () => {\n buttonRef.current?.removeEventListener(\"mouseenter\", setHighlighted);\n\n buttonRef.current?.removeEventListener(\"mouseleave\", setUnhighlighted);\n\n buttonRef.current?.removeEventListener(\n \"focus\",\n setFocusHighlighted,\n true,\n );\n\n buttonRef.current?.removeEventListener(\"blur\", setFocusHighlighted, true);\n };\n }, [onHighlight]);\n\n const toggleLabel = useMemo(\n () =>\n isSideNavCollapsed\n ? t(\"sidenav.toggle.expand\")\n : t(\"sidenav.toggle.collapse\"),\n [isSideNavCollapsed, t],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <StyledToggleButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-expanded={!isSideNavCollapsed}\n aria-label={toggleLabel}\n clickAreaPadding={clickAreaPadding}\n data-se=\"sidenav-toggle-button\"\n data-sidenav-toggle\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n onClick={onClick}\n ref={(element: HTMLButtonElement) => {\n if (element) {\n buttonRef.current = element;\n //@ts-expect-error `ref` is an optional prop, but TypeScript doesn't know this.\n muiProps.ref?.(element);\n }\n }}\n tabIndex={tabIndex}\n variant=\"floating\"\n >\n <StyledChevronRightIcon\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n />\n </StyledToggleButton>\n );\n },\n [\n ariaControls,\n clickAreaPadding,\n id,\n isSideNavCollapsed,\n odysseyDesignTokens,\n onClick,\n tabIndex,\n toggleLabel,\n ],\n );\n\n return (\n <Tooltip ariaType=\"description\" placement=\"right\" text={toggleLabel}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n};\n\nconst MemoizedSideNavToggleButton = memo(SideNavToggleButton);\nMemoizedSideNavToggleButton.displayName = \"SideNavToggleButton\";\n\nexport { MemoizedSideNavToggleButton as SideNavToggleButton };\n"],"mappings":";;;;;;;AAcA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AAAwE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjCxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,MAAMG,yBAAyB,GAAAC,OAAA,CAA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C;AAC7DoC,2BAA2B,CAACE,WAAW,GAAG,qBAAqB","ignoreList":[]}
@@ -8,7 +8,7 @@ var _sortable = require("@dnd-kit/sortable");
8
8
  var _utilities = require("@dnd-kit/utilities");
9
9
  var _styled = _interopRequireDefault(require("@emotion/styled"));
10
10
  var _react = require("react");
11
- var _reactI18next = require("react-i18next");
11
+ var _i18n = require("../../../i18n.generated/i18n.cjs");
12
12
  var _OdysseyDesignTokensContext = require("../../../OdysseyDesignTokensContext.cjs");
13
13
  var _UiShellProvider = require("../../../ui-shell/UiShellProvider.cjs");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
@@ -110,7 +110,7 @@ const DragHandle = ({
110
110
  const odysseyDesignTokens = (0, _OdysseyDesignTokensContext.useOdysseyDesignTokens)();
111
111
  const {
112
112
  t
113
- } = (0, _reactI18next.useTranslation)();
113
+ } = (0, _i18n.useTranslation)();
114
114
  const uiShellContext = (0, _UiShellProvider.useUiShellContext)();
115
115
  return (0, _jsxRuntime.jsx)(StyledDragHandleButton, {
116
116
  ...attributes,
@@ -1 +1 @@
1
- {"version":3,"file":"SortableItem.cjs","names":["_sortable","require","_utilities","_styled","_interopRequireDefault","_react","_reactI18next","_OdysseyDesignTokensContext","_UiShellProvider","_jsxRuntime","e","__esModule","default","SortableItemContext","createContext","attributes","listeners","undefined","ref","createRef","StyledSortableListItem","styled","shouldForwardProp","prop","odysseyDesignTokens","isSelected","sideNavContrastColors","position","button","top","left","Spacing2","transform","svg","path","fill","fontColor","opacity","outlineWidth","TypographyColorAction","StyledUl","padding","listStyle","listStyleType","StyledDragHandleButton","isDragging","focusRingColor","border","backgroundColor","cursor","transition","TransitionDurationMain","borderRadius","BorderRadiusMain","display","outline","boxShadow","PalettePrimaryMain","DragHandle","useContext","useOdysseyDesignTokens","t","useTranslation","uiShellContext","useUiShellContext","jsx","children","height","viewBox","width","xmlns","clipRule","d","fillRule","exports","SortableItem","id","isDisabled","isSortable","setNodeRef","setActivatorNodeRef","useSortable","context","useMemo","style","CSS","Translate","toString","Provider","value","jsxs"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type {\n DraggableSyntheticListeners,\n UniqueIdentifier,\n} from \"@dnd-kit/core\";\n\nimport { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport styled from \"@emotion/styled\";\nimport {\n createContext,\n createRef,\n CSSProperties,\n PropsWithChildren,\n RefObject,\n useContext,\n useMemo,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ContrastColors } from \"../../../createContrastColors.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../../OdysseyDesignTokensContext.js\";\nimport {\n UiShellColors,\n useUiShellContext,\n} from \"../../../ui-shell/UiShellProvider.js\";\n\ntype ItemProps = {\n id: UniqueIdentifier;\n isDisabled?: boolean;\n isSelected?: boolean;\n isSortable?: boolean;\n};\n\nexport type SortableItemContextType = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n attributes: Record<string, any>;\n listeners: DraggableSyntheticListeners;\n ref: RefObject<HTMLButtonElement>;\n};\n\nconst SortableItemContext = createContext<SortableItemContextType>({\n attributes: {},\n listeners: undefined,\n ref: createRef<HTMLButtonElement>(),\n});\n\nconst StyledSortableListItem = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isSelected\" &&\n prop !== \"sideNavContrastColors\",\n})<{\n isSelected?: boolean;\n odysseyDesignTokens: DesignTokens;\n sideNavContrastColors: UiShellColors[\"sideNavContrastColors\"];\n}>(({ odysseyDesignTokens, isSelected, sideNavContrastColors }) => ({\n position: \"relative\",\n\n button: {\n top: \"50%\",\n left: odysseyDesignTokens.Spacing2,\n transform: \"translateY(-50%)\",\n },\n\n svg: {\n path: {\n fill: \"currentColor\",\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n\n \"&:has(a:hover, button:hover, a:focus, button:focus, a:focus-visible, button:focus-visible, [role='button']:hover, [role='button']:focus, [role='button']:focus-visible)\":\n {\n button: {\n opacity: 1,\n outlineWidth: 0,\n },\n },\n\n ...(isSelected && {\n svg: {\n path: {\n fill: odysseyDesignTokens.TypographyColorAction,\n\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n }),\n}));\n\nconst StyledUl = styled(\"ul\")({\n padding: 0,\n listStyle: \"none\",\n listStyleType: \"none\",\n});\n\nconst StyledDragHandleButton = styled(\"button\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isDragging\" &&\n prop !== \"focusRingColor\",\n})<{\n focusRingColor: ContrastColors[\"focusRingColor\"];\n isDragging?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens, isDragging, focusRingColor }) => ({\n position: \"absolute\",\n opacity: 0,\n padding: odysseyDesignTokens.Spacing2,\n border: \"none\",\n backgroundColor: \"transparent\",\n cursor: `${isDragging ? \"grabbing\" : \"grab\"}`,\n transition: `opacity ${odysseyDesignTokens.TransitionDurationMain}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n\n svg: {\n display: \"flex\",\n },\n\n \"&:focus, &:focus-visible\": {\n outline: \"none\",\n boxShadow: `inset 0 0 0 2px ${odysseyDesignTokens.PalettePrimaryMain}`,\n\n ...(focusRingColor && {\n boxShadow: `inset 0 0 0 2px ${focusRingColor}`,\n }),\n },\n}));\n\ntype DragHandleProps = {\n isDisabled?: boolean;\n isDragging?: boolean;\n};\n\nexport const DragHandle = ({ isDragging }: DragHandleProps) => {\n const { attributes, listeners, ref } = useContext(SortableItemContext);\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const uiShellContext = useUiShellContext();\n\n return (\n <StyledDragHandleButton\n {...attributes}\n {...listeners}\n aria-label={t(\"navigation.drag.handle\")}\n focusRingColor={uiShellContext?.sideNavContrastColors?.focusRingColor}\n isDragging={isDragging}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={ref}\n >\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M6 2.33331C6 2.8856 5.55228 3.33331 5 3.33331C4.44772 3.33331 4 2.8856 4 2.33331C4 1.78103 4.44772 1.33331 5 1.33331C5.55228 1.33331 6 1.78103 6 2.33331ZM11 3.33331C11.5523 3.33331 12 2.8856 12 2.33331C12 1.78103 11.5523 1.33331 11 1.33331C10.4477 1.33331 10 1.78103 10 2.33331C10 2.8856 10.4477 3.33331 11 3.33331ZM11 7.11109C11.5523 7.11109 12 6.66338 12 6.11109C12 5.55881 11.5523 5.11109 11 5.11109C10.4477 5.11109 10 5.55881 10 6.11109C10 6.66338 10.4477 7.11109 11 7.11109ZM12 9.88887C12 10.4412 11.5523 10.8889 11 10.8889C10.4477 10.8889 10 10.4412 10 9.88887C10 9.33659 10.4477 8.88887 11 8.88887C11.5523 8.88887 12 9.33659 12 9.88887ZM11 14.6666C11.5523 14.6666 12 14.2189 12 13.6666C12 13.1144 11.5523 12.6666 11 12.6666C10.4477 12.6666 10 13.1144 10 13.6666C10 14.2189 10.4477 14.6666 11 14.6666ZM5 7.11109C5.55228 7.11109 6 6.66338 6 6.11109C6 5.55881 5.55228 5.11109 5 5.11109C4.44772 5.11109 4 5.55881 4 6.11109C4 6.66338 4.44772 7.11109 5 7.11109ZM6 9.88888C6 10.4412 5.55228 10.8889 5 10.8889C4.44772 10.8889 4 10.4412 4 9.88888C4 9.33659 4.44772 8.88888 5 8.88888C5.55228 8.88888 6 9.33659 6 9.88888ZM5 14.6666C5.55228 14.6666 6 14.2189 6 13.6666C6 13.1144 5.55228 12.6666 5 12.6666C4.44772 12.6666 4 13.1144 4 13.6666C4 14.2189 4.44772 14.6666 5 14.6666Z\"\n fill=\"#3F59E4\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledDragHandleButton>\n );\n};\n\nexport const SortableItem = ({\n id,\n isDisabled,\n isSelected,\n isSortable = true,\n children,\n}: PropsWithChildren<ItemProps>) => {\n const {\n attributes,\n isDragging,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n } = useSortable({ id });\n\n const context: SortableItemContextType = useMemo(\n () => ({\n attributes,\n listeners,\n // This library gives us a legacy ref function, and I can't change it, so I had to override the type. --Kevin Ghadyani\n ref: setActivatorNodeRef as unknown as RefObject<HTMLButtonElement>,\n }),\n [attributes, listeners, setActivatorNodeRef],\n );\n\n const style: CSSProperties = {\n opacity: isDragging ? 0.4 : undefined,\n transform: CSS.Translate.toString(transform),\n transition,\n };\n\n const uiShellContext = useUiShellContext();\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n\n return (\n <SortableItemContext.Provider value={context}>\n <StyledSortableListItem\n isSelected={isSelected}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={setNodeRef}\n sideNavContrastColors={uiShellContext?.sideNavContrastColors}\n style={style}\n >\n {!isDisabled && isSortable && <DragHandle isDragging={isDragging} />}\n <StyledUl>{children}</StyledUl>\n </StyledSortableListItem>\n </SortableItemContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MA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C,GAAG,IAAAC,cAAO,EAC9C,OAAO;IACLpE,UAAU;IACVC,SAAS;IAETE,GAAG,EAAE8D;EACP,CAAC,CAAC,EACF,CAACjE,UAAU,EAAEC,SAAS,EAAEgE,mBAAmB,CAC7C,CAAC;EAED,MAAMI,KAAoB,GAAG;IAC3B/C,OAAO,EAAEQ,UAAU,GAAG,GAAG,GAAG5B,SAAS;IACrCe,SAAS,EAAEqD,cAAG,CAACC,SAAS,CAACC,QAAQ,CAACvD,SAAS,CAAC;IAC5CkB;EACF,CAAC;EAED,MAAMa,cAAc,GAAG,IAAAC,kCAAiB,EAAC,CAAC;EAC1C,MAAMxC,mBAAiC,GAAG,IAAAoC,kDAAsB,EAAC,CAAC;EAElE,OACE,IAAAnD,WAAA,CAAAwD,GAAA,EAACpD,mBAAmB,CAAC2E,QAAQ;IAACC,KAAK,EAAEP,OAAQ;IAAAhB,QAAA,EAC3C,IAAAzD,WAAA,CAAAiF,IAAA,EAACtE,sBAAsB;MACrBK,UAAU,EAAEA,UAAW;MACvBD,mBAAmB,EAAEA,mBAAoB;MACzCN,GAAG,EAAE6D,UAAW;MAChBrD,qBAAqB,EAAEqC,cAAc,EAAErC,qBAAsB;MAC7D0D,KAAK,EAAEA,KAAM;MAAAlB,QAAA,GAEZ,CAACW,UAAU,IAAIC,UAAU,IAAI,IAAArE,WAAA,CAAAwD,GAAA,EAACP,UAAU;QAACb,UAAU,EAAEA;MAAW,CAAE,CAAC,EACpE,IAAApC,WAAA,CAAAwD,GAAA,EAACzB,QAAQ;QAAA0B,QAAA,EAAEA;MAAQ,CAAW,CAAC;IAAA,CACT;EAAC,CACG,CAAC;AAEnC,CAAC;AAACQ,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"file":"SortableItem.cjs","names":["_sortable","require","_utilities","_styled","_interopRequireDefault","_react","_i18n","_OdysseyDesignTokensContext","_UiShellProvider","_jsxRuntime","e","__esModule","default","SortableItemContext","createContext","attributes","listeners","undefined","ref","createRef","StyledSortableListItem","styled","shouldForwardProp","prop","odysseyDesignTokens","isSelected","sideNavContrastColors","position","button","top","left","Spacing2","transform","svg","path","fill","fontColor","opacity","outlineWidth","TypographyColorAction","StyledUl","padding","listStyle","listStyleType","StyledDragHandleButton","isDragging","focusRingColor","border","backgroundColor","cursor","transition","TransitionDurationMain","borderRadius","BorderRadiusMain","display","outline","boxShadow","PalettePrimaryMain","DragHandle","useContext","useOdysseyDesignTokens","t","useTranslation","uiShellContext","useUiShellContext","jsx","children","height","viewBox","width","xmlns","clipRule","d","fillRule","exports","SortableItem","id","isDisabled","isSortable","setNodeRef","setActivatorNodeRef","useSortable","context","useMemo","style","CSS","Translate","toString","Provider","value","jsxs"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type {\n DraggableSyntheticListeners,\n UniqueIdentifier,\n} from \"@dnd-kit/core\";\n\nimport { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport styled from \"@emotion/styled\";\nimport {\n createContext,\n createRef,\n CSSProperties,\n PropsWithChildren,\n RefObject,\n useContext,\n useMemo,\n} from \"react\";\n\nimport { ContrastColors } from \"../../../createContrastColors.js\";\nimport { useTranslation } from \"../../../i18n.generated/i18n.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../../OdysseyDesignTokensContext.js\";\nimport {\n UiShellColors,\n useUiShellContext,\n} from \"../../../ui-shell/UiShellProvider.js\";\n\ntype ItemProps = {\n id: UniqueIdentifier;\n isDisabled?: boolean;\n isSelected?: boolean;\n isSortable?: boolean;\n};\n\nexport type SortableItemContextType = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n attributes: Record<string, any>;\n listeners: DraggableSyntheticListeners;\n ref: RefObject<HTMLButtonElement>;\n};\n\nconst SortableItemContext = createContext<SortableItemContextType>({\n attributes: {},\n listeners: undefined,\n ref: createRef<HTMLButtonElement>(),\n});\n\nconst StyledSortableListItem = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isSelected\" &&\n prop !== \"sideNavContrastColors\",\n})<{\n isSelected?: boolean;\n odysseyDesignTokens: DesignTokens;\n sideNavContrastColors: UiShellColors[\"sideNavContrastColors\"];\n}>(({ odysseyDesignTokens, isSelected, sideNavContrastColors }) => ({\n position: \"relative\",\n\n button: {\n top: \"50%\",\n left: odysseyDesignTokens.Spacing2,\n transform: \"translateY(-50%)\",\n },\n\n svg: {\n path: {\n fill: \"currentColor\",\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n\n \"&:has(a:hover, button:hover, a:focus, button:focus, a:focus-visible, button:focus-visible, [role='button']:hover, [role='button']:focus, [role='button']:focus-visible)\":\n {\n button: {\n opacity: 1,\n outlineWidth: 0,\n },\n },\n\n ...(isSelected && {\n svg: {\n path: {\n fill: odysseyDesignTokens.TypographyColorAction,\n\n ...(sideNavContrastColors?.fontColor && {\n fill: sideNavContrastColors.fontColor,\n }),\n },\n },\n }),\n}));\n\nconst StyledUl = styled(\"ul\")({\n padding: 0,\n listStyle: \"none\",\n listStyleType: \"none\",\n});\n\nconst StyledDragHandleButton = styled(\"button\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isDragging\" &&\n prop !== \"focusRingColor\",\n})<{\n focusRingColor: ContrastColors[\"focusRingColor\"];\n isDragging?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens, isDragging, focusRingColor }) => ({\n position: \"absolute\",\n opacity: 0,\n padding: odysseyDesignTokens.Spacing2,\n border: \"none\",\n backgroundColor: \"transparent\",\n cursor: `${isDragging ? \"grabbing\" : \"grab\"}`,\n transition: `opacity ${odysseyDesignTokens.TransitionDurationMain}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n\n svg: {\n display: \"flex\",\n },\n\n \"&:focus, &:focus-visible\": {\n outline: \"none\",\n boxShadow: `inset 0 0 0 2px ${odysseyDesignTokens.PalettePrimaryMain}`,\n\n ...(focusRingColor && {\n boxShadow: `inset 0 0 0 2px ${focusRingColor}`,\n }),\n },\n}));\n\ntype DragHandleProps = {\n isDisabled?: boolean;\n isDragging?: boolean;\n};\n\nexport const DragHandle = ({ isDragging }: DragHandleProps) => {\n const { attributes, listeners, ref } = useContext(SortableItemContext);\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const uiShellContext = useUiShellContext();\n\n return (\n <StyledDragHandleButton\n {...attributes}\n {...listeners}\n aria-label={t(\"navigation.drag.handle\")}\n focusRingColor={uiShellContext?.sideNavContrastColors?.focusRingColor}\n isDragging={isDragging}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={ref}\n >\n <svg\n fill=\"none\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M6 2.33331C6 2.8856 5.55228 3.33331 5 3.33331C4.44772 3.33331 4 2.8856 4 2.33331C4 1.78103 4.44772 1.33331 5 1.33331C5.55228 1.33331 6 1.78103 6 2.33331ZM11 3.33331C11.5523 3.33331 12 2.8856 12 2.33331C12 1.78103 11.5523 1.33331 11 1.33331C10.4477 1.33331 10 1.78103 10 2.33331C10 2.8856 10.4477 3.33331 11 3.33331ZM11 7.11109C11.5523 7.11109 12 6.66338 12 6.11109C12 5.55881 11.5523 5.11109 11 5.11109C10.4477 5.11109 10 5.55881 10 6.11109C10 6.66338 10.4477 7.11109 11 7.11109ZM12 9.88887C12 10.4412 11.5523 10.8889 11 10.8889C10.4477 10.8889 10 10.4412 10 9.88887C10 9.33659 10.4477 8.88887 11 8.88887C11.5523 8.88887 12 9.33659 12 9.88887ZM11 14.6666C11.5523 14.6666 12 14.2189 12 13.6666C12 13.1144 11.5523 12.6666 11 12.6666C10.4477 12.6666 10 13.1144 10 13.6666C10 14.2189 10.4477 14.6666 11 14.6666ZM5 7.11109C5.55228 7.11109 6 6.66338 6 6.11109C6 5.55881 5.55228 5.11109 5 5.11109C4.44772 5.11109 4 5.55881 4 6.11109C4 6.66338 4.44772 7.11109 5 7.11109ZM6 9.88888C6 10.4412 5.55228 10.8889 5 10.8889C4.44772 10.8889 4 10.4412 4 9.88888C4 9.33659 4.44772 8.88888 5 8.88888C5.55228 8.88888 6 9.33659 6 9.88888ZM5 14.6666C5.55228 14.6666 6 14.2189 6 13.6666C6 13.1144 5.55228 12.6666 5 12.6666C4.44772 12.6666 4 13.1144 4 13.6666C4 14.2189 4.44772 14.6666 5 14.6666Z\"\n fill=\"#3F59E4\"\n fillRule=\"evenodd\"\n />\n </svg>\n </StyledDragHandleButton>\n );\n};\n\nexport const SortableItem = ({\n id,\n isDisabled,\n isSelected,\n isSortable = true,\n children,\n}: PropsWithChildren<ItemProps>) => {\n const {\n attributes,\n isDragging,\n listeners,\n setNodeRef,\n setActivatorNodeRef,\n transform,\n transition,\n } = useSortable({ id });\n\n const context: SortableItemContextType = useMemo(\n () => ({\n attributes,\n listeners,\n // This library gives us a legacy ref function, and I can't change it, so I had to override the type. --Kevin Ghadyani\n ref: setActivatorNodeRef as unknown as RefObject<HTMLButtonElement>,\n }),\n [attributes, listeners, setActivatorNodeRef],\n );\n\n const style: CSSProperties = {\n opacity: isDragging ? 0.4 : undefined,\n transform: CSS.Translate.toString(transform),\n transition,\n };\n\n const uiShellContext = useUiShellContext();\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n\n return (\n <SortableItemContext.Provider value={context}>\n <StyledSortableListItem\n isSelected={isSelected}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={setNodeRef}\n sideNavContrastColors={uiShellContext?.sideNavContrastColors}\n style={style}\n >\n {!isDisabled && isSortable && <DragHandle isDragging={isDragging} />}\n <StyledUl>{children}</StyledUl>\n </StyledSortableListItem>\n </SortableItemContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAiBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAWA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,2BAAA,GAAAN,OAAA;AAIA,IAAAO,gBAAA,GAAAP,OAAA;AAG8C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAG,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6CA,MAAMG,mBAAmB,GAAG,IAAAC,oBAAa,EAA0B;EACjEC,UAAU,EAAE,CAAC,CAAC;EACdC,SAAS,EAAEC,SAAS;EACpBC,GAAG,EAAE,IAAAC,gBAAS,EAAoB;AACpC,CAAC,CAAC;AAEF,MAAMC,sBAAsB,GAAG,IAAAC,eAAM,EAAC,IAAI,EAAE;EAC1CC,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAC9BA,IAAI,KAAK,YAAY,IACrBA,IAAI,KAAK;AACb,CAAC,CAAC,CAIC,CAAC;EAAEC,mBAAmB;EAAEC,UAAU;EAAEC;AAAsB,CAAC,MAAM;EAClEC,QAAQ,EAAE,UAAU;EAEpBC,MAAM,EAAE;IACNC,GAAG,EAAE,KAAK;IACVC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AIC,UAAU,IAAI,IAAArE,WAAA,CAAAwD,GAAA,EAACP,UAAU;QAACb,UAAU,EAAEA;MAAW,CAAE,CAAC,EACpE,IAAApC,WAAA,CAAAwD,GAAA,EAACzB,QAAQ;QAAA0B,QAAA,EAAEA;MAAQ,CAAW,CAAC;IAAA,CACT;EAAC,CACG,CAAC;AAEnC,CAAC;AAACQ,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -7,7 +7,7 @@ exports.SortableList = void 0;
7
7
  var _core = require("@dnd-kit/core");
8
8
  var _sortable = require("@dnd-kit/sortable");
9
9
  var _react = require("react");
10
- var _reactI18next = require("react-i18next");
10
+ var _i18n = require("../../../i18n.generated/i18n.cjs");
11
11
  var _SortableItem = require("./SortableItem.cjs");
12
12
  var _SortableOverlay = require("./SortableOverlay.cjs");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
@@ -36,7 +36,7 @@ const SortableList = ({
36
36
  }));
37
37
  const {
38
38
  t
39
- } = (0, _reactI18next.useTranslation)();
39
+ } = (0, _i18n.useTranslation)();
40
40
  const announcements = (0, _react.useMemo)(() => ({
41
41
  onDragStart: ({
42
42
  active
@@ -1 +1 @@
1
- {"version":3,"file":"SortableList.cjs","names":["_core","require","_sortable","_react","_reactI18next","_SortableItem","_SortableOverlay","_jsxRuntime","SortableList","parentId","items","onChange","renderItem","active","setActive","useState","activeItem","useMemo","find","item","id","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","coordinateGetter","sortableKeyboardCoordinates","t","useTranslation","announcements","onDragStart","activeId","onDragOver","over","overId","onDragEnd","onDragCancel","jsxs","DndContext","accessibility","activeIndex","findIndex","overIndex","isSortable","children","jsx","SortableContext","map","Fragment","SortableOverlay","exports","Item","SortableItem"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactNode } from \"react\";\n\nimport {\n Active,\n Announcements,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n UniqueIdentifier,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport { Fragment, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { SortableItem } from \"./SortableItem.js\";\nimport { SortableOverlay } from \"./SortableOverlay.js\";\n\nexport interface BaseItem {\n id: UniqueIdentifier;\n isDisabled: boolean | undefined;\n isSelected: boolean | undefined;\n isSortable: boolean | undefined;\n navItem: ReactNode;\n}\n\ninterface ListProps<T extends BaseItem> {\n items: T[];\n onChange: (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n parentId: string;\n renderItem: (item: T) => ReactNode;\n}\n\nexport const SortableList = <T extends BaseItem>({\n parentId,\n items,\n onChange,\n renderItem,\n}: ListProps<T>) => {\n const [active, setActive] = useState<Active | null>(null);\n\n const activeItem = useMemo(\n () => items.find((item) => item.id === active?.id),\n [active, items],\n );\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const { t } = useTranslation();\n const announcements: Announcements = useMemo(\n () => ({\n onDragStart: ({ active }) => {\n return `${t(\"sortable.list.drag.start\", { activeId: active.id })}`;\n },\n onDragOver: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.moved.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.nolonger.over\", { activeId: active.id })}`;\n },\n onDragEnd: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.end.dropped.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.end.dropped\", { activeId: active.id })}`;\n },\n onDragCancel: ({ active }) => {\n return `${t(\"sortable.list.drag.cancel\", { activeId: active.id })}`;\n },\n }),\n [t],\n );\n\n return (\n <DndContext\n accessibility={{ announcements: announcements }}\n onDragCancel={() => {\n setActive(null);\n }}\n onDragEnd={({ active, over }) => {\n if (over && active.id !== over?.id) {\n const activeIndex = items.findIndex(({ id }) => id === active.id);\n const overIndex = items.findIndex(({ id }) => id === over.id);\n // allow sorting by default except when isSortable is set to false explicitly\n if (items[overIndex].isSortable !== false) {\n onChange(parentId, active.id, activeIndex, overIndex);\n }\n }\n setActive(null);\n }}\n onDragStart={({ active }) => {\n setActive(active);\n }}\n sensors={sensors}\n >\n <SortableContext items={items}>\n {items.map((item) => (\n <Fragment key={item.id}>{renderItem(item)}</Fragment>\n ))}\n </SortableContext>\n <SortableOverlay>\n {activeItem ? renderItem(activeItem) : null}\n </SortableOverlay>\n </DndContext>\n );\n};\n\nSortableList.Item = SortableItem;\n"],"mappings":";;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAUA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAuD,IAAAM,WAAA,GAAAN,OAAA;AAhCvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CO,MAAMO,YAAY,GAAGA,CAAqB;EAC/CC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC;AACY,CAAC,KAAK;EAClB,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAgB,IAAI,CAAC;EAEzD,MAAMC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OAAQ;IAAAwB,QAAA,GAEjB,IAAAtC,WAAA,CAAAuC,GAAA,EAAC5C,SAAA,CAAA6C,eAAe;MAACrC,KAAK,EAAEA,KAAM;MAAAmC,QAAA,EAC3BnC,KAAK,CAACsC,GAAG,CAAE7B,IAAI,IACd,IAAAZ,WAAA,CAAAuC,GAAA,EAAC3C,MAAA,CAAA8C,QAAQ;QAAAJ,QAAA,EAAgBjC,UAAU,CAACO,IAAI;MAAC,GAA1BA,IAAI,CAACC,EAAgC,CACrD;IAAC,CACa,CAAC,EAClB,IAAAb,WAAA,CAAAuC,GAAA,EAACxC,gBAAA,CAAA4C,eAAe;MAAAL,QAAA,EACb7B,UAAU,GAAGJ,UAAU,CAACI,UAAU,CAAC,GAAG;IAAI,CAC5B,CAAC;EAAA,CACR,CAAC;AAEjB,CAAC;AAACmC,OAAA,CAAA3C,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAAC4C,IAAI,GAAGC,0BAAY","ignoreList":[]}
1
+ {"version":3,"file":"SortableList.cjs","names":["_core","require","_sortable","_react","_i18n","_SortableItem","_SortableOverlay","_jsxRuntime","SortableList","parentId","items","onChange","renderItem","active","setActive","useState","activeItem","useMemo","find","item","id","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","coordinateGetter","sortableKeyboardCoordinates","t","useTranslation","announcements","onDragStart","activeId","onDragOver","over","overId","onDragEnd","onDragCancel","jsxs","DndContext","accessibility","activeIndex","findIndex","overIndex","isSortable","children","jsx","SortableContext","map","Fragment","SortableOverlay","exports","Item","SortableItem"],"sources":["../../../../../src/ui-shell/SideNav/SortableList/SortableList.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactNode } from \"react\";\n\nimport {\n Active,\n Announcements,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n UniqueIdentifier,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport { Fragment, useMemo, useState } from \"react\";\n\nimport { useTranslation } from \"../../../i18n.generated/i18n.js\";\nimport { SortableItem } from \"./SortableItem.js\";\nimport { SortableOverlay } from \"./SortableOverlay.js\";\n\nexport interface BaseItem {\n id: UniqueIdentifier;\n isDisabled: boolean | undefined;\n isSelected: boolean | undefined;\n isSortable: boolean | undefined;\n navItem: ReactNode;\n}\n\ninterface ListProps<T extends BaseItem> {\n items: T[];\n onChange: (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n parentId: string;\n renderItem: (item: T) => ReactNode;\n}\n\nexport const SortableList = <T extends BaseItem>({\n parentId,\n items,\n onChange,\n renderItem,\n}: ListProps<T>) => {\n const [active, setActive] = useState<Active | null>(null);\n\n const activeItem = useMemo(\n () => items.find((item) => item.id === active?.id),\n [active, items],\n );\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const { t } = useTranslation();\n const announcements: Announcements = useMemo(\n () => ({\n onDragStart: ({ active }) => {\n return `${t(\"sortable.list.drag.start\", { activeId: active.id })}`;\n },\n onDragOver: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.moved.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.nolonger.over\", { activeId: active.id })}`;\n },\n onDragEnd: ({ active, over }) => {\n if (over) {\n return `${t(\"sortable.list.drag.end.dropped.over\", { activeId: active.id, overId: over.id })}`;\n }\n return `${t(\"sortable.list.drag.end.dropped\", { activeId: active.id })}`;\n },\n onDragCancel: ({ active }) => {\n return `${t(\"sortable.list.drag.cancel\", { activeId: active.id })}`;\n },\n }),\n [t],\n );\n\n return (\n <DndContext\n accessibility={{ announcements: announcements }}\n onDragCancel={() => {\n setActive(null);\n }}\n onDragEnd={({ active, over }) => {\n if (over && active.id !== over?.id) {\n const activeIndex = items.findIndex(({ id }) => id === active.id);\n const overIndex = items.findIndex(({ id }) => id === over.id);\n // allow sorting by default except when isSortable is set to false explicitly\n if (items[overIndex].isSortable !== false) {\n onChange(parentId, active.id, activeIndex, overIndex);\n }\n }\n setActive(null);\n }}\n onDragStart={({ active }) => {\n setActive(active);\n }}\n sensors={sensors}\n >\n <SortableContext items={items}>\n {items.map((item) => (\n <Fragment key={item.id}>{renderItem(item)}</Fragment>\n ))}\n </SortableContext>\n <SortableOverlay>\n {activeItem ? renderItem(activeItem) : null}\n </SortableOverlay>\n </DndContext>\n );\n};\n\nSortableList.Item = SortableItem;\n"],"mappings":";;;;;;AAcA,IAAAA,KAAA,GAAAC,OAAA;AAUA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAuD,IAAAM,WAAA,GAAAN,OAAA;AAhCvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CO,MAAMO,YAAY,GAAGA,CAAqB;EAC/CC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC;AACY,CAAC,KAAK;EAClB,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAgB,IAAI,CAAC;EAEzD,MAAMC,UAAU,GAAG,IAAAC,cAAO,EACxB,MAAMP,KAAK,CAACQ,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,EAAE,KAAKP,MAAM,EAAEO,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mC,QAAA,EAC3BnC,KAAK,CAACsC,GAAG,CAAE7B,IAAI,IACd,IAAAZ,WAAA,CAAAuC,GAAA,EAAC3C,MAAA,CAAA8C,QAAQ;QAAAJ,QAAA,EAAgBjC,UAAU,CAACO,IAAI;MAAC,GAA1BA,IAAI,CAACC,EAAgC,CACrD;IAAC,CACa,CAAC,EAClB,IAAAb,WAAA,CAAAuC,GAAA,EAACxC,gBAAA,CAAA4C,eAAe;MAAAL,QAAA,EACb7B,UAAU,GAAGJ,UAAU,CAACI,UAAU,CAAC,GAAG;IAAI,CAC5B,CAAC;EAAA,CACR,CAAC;AAEjB,CAAC;AAACmC,OAAA,CAAA3C,YAAA,GAAAA,YAAA;AAEFA,YAAY,CAAC4C,IAAI,GAAGC,0BAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../../../src/ui-shell/SideNav/types.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactElement, SyntheticEvent } from \"react\";\n\nimport { UniqueIdentifier } from \"@dnd-kit/core\";\n\nimport type { HtmlProps } from \"../../HtmlProps.js\";\nimport type { statusSeverityValues } from \"../../Status.js\";\n\ntype LogoWithLink = {\n ariaLabel: string;\n href: string;\n};\ntype LogoWithNoLink = {\n ariaLabel?: never;\n href?: never;\n};\n\nexport type SideNavLogoProps = {\n isSameBackgroundAsMain?: boolean;\n /**\n * Event fired when the logo is clicked\n */\n onClick?: (event: SyntheticEvent) => void;\n} & (LogoWithLink | LogoWithNoLink) &\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\nexport type SideNavProps = {\n /**\n * Side Nav header text that is usually reserved to show the App name\n */\n appName?: string;\n /**\n * If we want the collapse state to be based on session storage, then this needs to be `true`.\n */\n hasSessionStorageState?: boolean;\n /**\n * Determines whether the side nav is collapsed by default. When `true`, side nav also closes once and item is clicked.\n */\n isCollapsed?: boolean;\n /**\n * Determines whether the side nav is collapsible\n */\n isCollapsible?: boolean;\n /**\n * Determines whether the side nav items use compact layout\n */\n isCompact?: boolean;\n /**\n * Before the side nav has items, it will be in a loading state.\n */\n isLoading?: boolean;\n /**\n * If the side nav is up too much screen real estate. For instance, if you're in a narrower view, and it displays next to the content.\n *\n * When `true`, side nav will close itself after nav items are clicked.\n */\n isObtrusive?: boolean;\n /**\n * An optional logo component or src string for an img to display in the header. If not provided, will default to the Okta logo\n */\n logoProps?: SideNavLogoProps;\n /**\n * Triggers when the side nav is collapsed\n */\n onCollapse?: () => void;\n /**\n * Triggers when the side nav is expanded\n */\n onExpand?: () => void;\n /**\n * Triggers when the item is reordered\n */\n onSort?: (\n reorderedItems: SideNavItem[],\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n /**\n * Nav items in the side nav\n */\n sideNavItems?: SideNavItem[];\n} & (\n | {\n /**\n * The component to display as the footer; if present the `footerItems` are ignored and not rendered.\n */\n footerComponent?: ReactElement;\n footerItems?: never;\n hasCustomFooter: true;\n }\n | {\n footerComponent?: never;\n /**\n * Footer items in the side nav\n */\n footerItems?: SideNavFooterItem[];\n hasCustomFooter?: false;\n }\n) &\n Pick<HtmlProps, \"testId\">;\n\nexport type SideNavItem = {\n /**\n * The number to display as a count alongside the nav item\n */\n count?: number;\n /**\n * The icon element to display after the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n endIcon?: ReactElement;\n id: string;\n /**\n * Whether the item is disabled. When set to true the nav item is set to Disabled color,\n * the link/item is not clickable, and item with nestedNavItems is not expandable.\n */\n isDisabled?: boolean;\n /**\n * Whether the item is active/selected\n */\n isSelected?: boolean;\n /**\n * Whether the item is sortable within a sortable list\n */\n isSortable?: boolean;\n label: string;\n /**\n * Event fired when the nav item is clicked\n */\n onClick?: (event: SyntheticEvent) => void;\n /**\n * The status element to display after the label\n */\n severity?: (typeof statusSeverityValues)[number];\n /**\n * The icon element to display before the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n startIcon?: ReactElement;\n /**\n * The label to display inside the status\n */\n statusLabel?: string;\n /**\n * The link target prop. e.g., \"_blank\"\n */\n target?: string;\n} & (\n | {\n href?: never;\n isDefaultExpanded?: never;\n isExpanded?: never;\n /**\n * Determines if the side nav item is a section header\n */\n isSectionHeader: true;\n nestedNavItems?: never;\n }\n | {\n /**\n * link added to the nav item. if it is undefined, static text will be displayed.\n * fires onClick event when it is passed\n */\n href?: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n nestedNavItems?: never;\n }\n | {\n href?: never;\n /**\n * Whether the accordion (nav item with nestedNavItems) is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * If true, expands the accordion, otherwise collapse it.\n * Setting this prop enables control over the accordion.\n */\n isExpanded?: boolean;\n /**\n * If true, enables sorting for the accordion items\n */\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<Omit<SideNavItem, \"nestedNavItems\" | \"startIcon\">>;\n }\n | {\n href: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<Omit<SideNavItem, \"nestedNavItems\" | \"startIcon\">>;\n }\n) &\n Pick<HtmlProps, \"translate\">;\n\nexport type SideNavFooterItem = {\n href?: string;\n id: string;\n label: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../../../src/ui-shell/SideNav/types.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ReactElement, SyntheticEvent } from \"react\";\n\nimport { UniqueIdentifier } from \"@dnd-kit/core\";\n\nimport type { HtmlProps } from \"../../HtmlProps.js\";\nimport type { DesignTokens } from \"../../OdysseyDesignTokensContext.js\";\nimport type { statusSeverityValues } from \"../../Status.js\";\n\n/**\n * Type representing spacing values from the design tokens.\n * odysseyDesignTokens.Spacing0, odysseyDesignTokens.Spacing1, etc.\n */\nexport type OdysseySpacingValue = DesignTokens[keyof Pick<\n DesignTokens,\n | \"Spacing0\"\n | \"Spacing1\"\n | \"Spacing2\"\n | \"Spacing3\"\n | \"Spacing4\"\n | \"Spacing5\"\n | \"Spacing6\"\n | \"Spacing7\"\n | \"Spacing8\"\n | \"Spacing9\"\n>];\n\ntype LogoWithLink = {\n ariaLabel: string;\n href: string;\n};\ntype LogoWithNoLink = {\n ariaLabel?: never;\n href?: never;\n};\n\nexport type SideNavLogoProps = {\n isSameBackgroundAsMain?: boolean;\n /**\n * Event fired when the logo is clicked\n */\n onClick?: (event: SyntheticEvent) => void;\n} & (LogoWithLink | LogoWithNoLink) &\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\nexport type SideNavProps = {\n /**\n * Side Nav header text that is usually reserved to show the App name\n */\n appName?: string;\n /**\n * If we want the collapse state to be based on session storage, then this needs to be `true`.\n */\n hasSessionStorageState?: boolean;\n /**\n * Determines whether the side nav is collapsed by default. When `true`, side nav also closes once and item is clicked.\n */\n isCollapsed?: boolean;\n /**\n * Determines whether the side nav is collapsible\n */\n isCollapsible?: boolean;\n /**\n * Determines whether the side nav items use compact layout\n */\n isCompact?: boolean;\n /**\n * Before the side nav has items, it will be in a loading state.\n */\n isLoading?: boolean;\n /**\n * If the side nav is up too much screen real estate. For instance, if you're in a narrower view, and it displays next to the content.\n *\n * When `true`, side nav will close itself after nav items are clicked.\n */\n isObtrusive?: boolean;\n /**\n * Optional padding to apply to the start of the leaves (items which are not expanded).\n * Should be one of the Odyssey design token spacing values (e.g., odysseyDesignTokens.Spacing1, odysseyDesignTokens.Spacing2, etc.)\n */\n leavesPaddingStart?: OdysseySpacingValue;\n /**\n * An optional logo component or src string for an img to display in the header. If not provided, will default to the Okta logo\n */\n logoProps?: SideNavLogoProps;\n /**\n * Triggers when the side nav is collapsed\n */\n onCollapse?: () => void;\n /**\n * Triggers when the side nav is expanded\n */\n onExpand?: () => void;\n /**\n * Triggers when the item is reordered\n */\n onSort?: (\n reorderedItems: SideNavItem[],\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => void;\n /**\n * Nav items in the side nav\n */\n sideNavItems?: SideNavItem[];\n} & (\n | {\n /**\n * The component to display as the footer; if present the `footerItems` are ignored and not rendered.\n */\n footerComponent?: ReactElement;\n footerItems?: never;\n hasCustomFooter: true;\n }\n | {\n footerComponent?: never;\n /**\n * Footer items in the side nav\n */\n footerItems?: SideNavFooterItem[];\n hasCustomFooter?: false;\n }\n) &\n Pick<HtmlProps, \"testId\">;\n\nexport type SideNavItem = {\n /**\n * The number to display as a count alongside the nav item\n */\n count?: number;\n /**\n * The icon element to display after the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n endIcon?: ReactElement;\n id: string;\n /**\n * Whether the item is disabled. When set to true the nav item is set to Disabled color,\n * the link/item is not clickable, and item with nestedNavItems is not expandable.\n */\n isDisabled?: boolean;\n /**\n * Whether the item is active/selected\n */\n isSelected?: boolean;\n /**\n * Whether the item is sortable within a sortable list\n */\n isSortable?: boolean;\n label: string;\n /**\n * Event fired when the nav item is clicked\n */\n onClick?: (event: SyntheticEvent) => void;\n /**\n * The status element to display after the label\n */\n severity?: (typeof statusSeverityValues)[number];\n /**\n * The icon element to display before the nav item text. Only use this with images that don't have React context. Even the official Odyssey Icons use MUI which references the MUI theme in context and will error when rendered in Unified UI Shell.\n */\n startIcon?: ReactElement;\n /**\n * The label to display inside the status\n */\n statusLabel?: string;\n /**\n * The link target prop. e.g., \"_blank\"\n */\n target?: string;\n} & (\n | {\n href?: never;\n isDefaultExpanded?: never;\n isExpanded?: never;\n /**\n * Determines if the side nav item is a section header\n */\n isSectionHeader: true;\n nestedNavItems?: never;\n }\n | {\n /**\n * link added to the nav item. if it is undefined, static text will be displayed.\n * fires onClick event when it is passed\n */\n href?: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n nestedNavItems?: never;\n }\n | {\n href?: never;\n /**\n * Whether the accordion (nav item with nestedNavItems) is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * If true, expands the accordion, otherwise collapse it.\n * Setting this prop enables control over the accordion.\n */\n isExpanded?: boolean;\n /**\n * If true, enables sorting for the accordion items\n */\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<SideNavItem>;\n }\n | {\n href: string;\n isDefaultExpanded?: never;\n isExpanded?: never;\n isSectionHeader?: never;\n /**\n * An array of side nav items to be displayed as nestedNavItems within Accordion\n */\n nestedNavItems: Array<SideNavItem>;\n }\n) &\n Pick<HtmlProps, \"translate\">;\n\nexport type SideNavFooterItem = {\n href?: string;\n id: string;\n label: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.defaultComponentProps = exports.UiShell = void 0;
7
7
  var _react = require("react");
8
8
  var _reactErrorBoundary = require("react-error-boundary");
9
- var _CssBaseline = require("../CssBaseline.cjs");
10
9
  var _OdysseyProvider = require("../OdysseyProvider.cjs");
11
10
  var _NarrowUiShellContent = require("./NarrowUiShellContent.cjs");
12
11
  var _UiShellProvider = require("./UiShellProvider.cjs");
@@ -69,11 +68,12 @@ const UiShell = ({
69
68
  onError: onError,
70
69
  children: (0, _jsxRuntime.jsx)(_OdysseyProvider.OdysseyProvider, {
71
70
  emotionRootElement: uiShellStylesElement,
71
+ hasCssBaseline: true,
72
72
  shadowRootElement: uiShellAppElement,
73
- children: (0, _jsxRuntime.jsxs)(_reactErrorBoundary.ErrorBoundary, {
73
+ children: (0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
74
74
  fallback: errorComponent,
75
75
  onError: onError,
76
- children: [(0, _jsxRuntime.jsx)(_CssBaseline.CssBaseline, {}), (0, _jsxRuntime.jsxs)(_UiShellProvider.UiShellProvider, {
76
+ children: (0, _jsxRuntime.jsxs)(_UiShellProvider.UiShellProvider, {
77
77
  appBackgroundColor: appBackgroundColor,
78
78
  appBackgroundContrastMode: appBackgroundContrastMode,
79
79
  closeSideNavMenu: closeSideNavMenu,
@@ -109,7 +109,7 @@ const UiShell = ({
109
109
  onError: onError,
110
110
  optionalComponents: optionalComponents
111
111
  })]
112
- })]
112
+ })
113
113
  })
114
114
  })
115
115
  });
@@ -1 +1 @@
1
- {"version":3,"file":"UiShell.cjs","names":["_react","require","_reactErrorBoundary","_CssBaseline","_OdysseyProvider","_NarrowUiShellContent","_UiShellProvider","_useUiShellBreakpoints","_WideUiShellContent","_jsxRuntime","defaultComponentProps","exports","sideNavProps","undefined","topNavProps","errorComponent","jsx","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","useState","activeBreakpoint","useUiShellBreakpoints","useEffect","unsubscribe","ErrorBoundary","fallback","children","OdysseyProvider","emotionRootElement","shadowRootElement","jsxs","CssBaseline","UiShellProvider","NarrowUiShellContent","hasSideNavProps","Boolean","WideUiShellContent","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","memo","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, type SetStateAction, useEffect, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { CssBaseline } from \"../CssBaseline.js\";\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { MessageBus } from \"./createMessageBus.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\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\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 activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n shadowRootElement={uiShellAppElement}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <CssBaseline />\n\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 // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n } as typeof componentProps.sideNavProps,\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\nMemoizedUiShell.displayName = \"UiShell\";\n\nexport { MemoizedUiShell as UiShell };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAGA,IAAAI,qBAAA,GAAAJ,OAAA;AAKA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AAIA,IAAAO,mBAAA,GAAAP,OAAA;AAA6D,IAAAQ,WAAA,GAAAR,OAAA;AA7B7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBO,MAAMS,qBAA+C,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EAC7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,KAAK,QAAQ,IAC7BH,cAAc,CAAC3B,YAAY,EAAEgD,WAAW;gBAC1CC,aAAa,EACXnB,gBAAgB,KAAK,QAAQ,IAC7BH,cAAc,CAAC3B,YAAY,EAAEiD;cAEjC;YACF,CAAC;YAEHzC,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjDmC,eAAe,EAAEC,OAAO,CAAClB,cAAc,CAAC3B,YAAY,CAAE;YACtDY,4BAA4B,EAAEA,4BAA6B;YAC3DC,sBAAsB,EAAEA,sBAAuB;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF;QAAA,CACc,CAAC;MAAA,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAMgC,eAAe,GAAAnD,OAAA,CAAAM,OAAA,GAAG,IAAA8C,WAAI,EAAC9C,OAAO,CAAC;AACrC6C,eAAe,CAACE,WAAW,GAAG,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"UiShell.cjs","names":["_react","require","_reactErrorBoundary","_OdysseyProvider","_NarrowUiShellContent","_UiShellProvider","_useUiShellBreakpoints","_WideUiShellContent","_jsxRuntime","defaultComponentProps","exports","sideNavProps","undefined","topNavProps","errorComponent","jsx","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","useState","activeBreakpoint","useUiShellBreakpoints","useEffect","unsubscribe","ErrorBoundary","fallback","children","OdysseyProvider","emotionRootElement","hasCssBaseline","shadowRootElement","jsxs","UiShellProvider","NarrowUiShellContent","hasSideNavProps","Boolean","WideUiShellContent","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","memo","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, type SetStateAction, useEffect, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { 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\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\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 activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n hasCssBaseline\n shadowRootElement={uiShellAppElement}\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 // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n } as typeof 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\nex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;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF,EAEA,CAACY,gBAAgB,KAAK,QAAQ,IAAIA,gBAAgB,KAAK,MAAM,KAC5D,IAAAjC,WAAA,CAAAO,GAAA,EAACR,mBAAA,CAAAkD,kBAAkB;YAEf,GAAGnB,cAAc;YACjB,GAAG;cACD3B,YAAY,EAAE;gBACZ,GAAG2B,cAAc,CAAC3B,YAAY;gBAC9B+C,sBAAsB,EAAEjB,gBAAgB,KAAK,MAAM;gBACnDkB,WAAW,EACTlB,gBAAgB,KAAK,QAAQ,IAC7BH,cAAc,CAAC3B,YAAY,EAAEgD,WAAW;gBAC1CC,aAAa,EACXnB,gBAAgB,KAAK,QAAQ,IAC7BH,cAAc,CAAC3B,YAAY,EAAEiD;cAEjC;YACF,CAAC;YAEHzC,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjDmC,eAAe,EAAEC,OAAO,CAAClB,cAAc,CAAC3B,YAAY,CAAE;YACtDY,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,MAAMgC,eAAe,GAAAnD,OAAA,CAAAM,OAAA,GAAG,IAAA8C,WAAI,EAAC9C,OAAO,CAAC;AACrC6C,eAAe,CAACE,WAAW,GAAG,SAAS","ignoreList":[]}
@@ -7,7 +7,7 @@ exports.useUiShellContext = exports.defaultSubscribeToCloseRightSideMenu = expor
7
7
  var _react = require("react");
8
8
  var _createContrastColors = require("../createContrastColors.cjs");
9
9
  var _OdysseyDesignTokensContext = require("../OdysseyDesignTokensContext.cjs");
10
- var _createMessageBus = require("./createMessageBus.cjs");
10
+ var _createMessageBus = require("../tools/createMessageBus.cjs");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  /*!
13
13
  * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
@@ -1 +1 @@
1
- {"version":3,"file":"UiShellProvider.cjs","names":["_react","require","_createContrastColors","_OdysseyDesignTokensContext","_createMessageBus","_jsxRuntime","defaultCloseSideNavMessageBus","exports","createMessageBus","defaultSubscribeToCloseRightSideMenu","UiShellContext","createContext","undefined","useUiShellContext","useContext","UiShellProvider","appBackgroundColor","appBackgroundContrastMode","children","closeSideNavMenu","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","topNavBackgroundColor","odysseyDesignTokens","useOdysseyDesignTokens","defaultedSideNavBackgroundColor","HueNeutralWhite","sideNavContrastColors","generateContrastColors","backgroundColor","backgroundContrastColor","isAppBackgroundHightContrast","defaultTopAndAppBackgroundColor","HueNeutral50","topNavColor","appContentBackgroundColor","memoizedContextValue","useMemo","publish","subscribe","jsx","Provider","value","MemoizedUiShellProvider","memo"],"sources":["../../../src/ui-shell/UiShellProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\n\nimport {\n ContrastColors,\n generateContrastColors,\n} from \"../createContrastColors.js\";\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { ContrastMode } from \"../useContrastMode.js\";\nimport { createMessageBus, MessageBus } from \"./createMessageBus.js\";\n\nexport const defaultCloseSideNavMessageBus = createMessageBus();\nexport const defaultSubscribeToCloseRightSideMenu = () => () => {};\n\nexport type UiShellColors = {\n /**\n * Custom background color for the app content area.\n */\n appBackgroundColor: string;\n /**\n * Custom background color for the side nav area.\n */\n sideNavBackgroundColor: string;\n /**\n * Custom color for fonts and other contrasted colors in the side nav area. Other contrast colors are derived from this one.\n *\n * If not passed, it gets computed from Odyssey.\n */\n sideNavBackgroundContrastColor?: string;\n sideNavContrastColors?: ContrastColors;\n /**\n * Custom background color for the top nav area.\n */\n topNavBackgroundColor: string;\n};\n\nexport type UiShellContext = {\n /**\n * This is a callback that publishes a change to all subscribers listening for when to close the side nav.\n */\n closeSideNavMenu: MessageBus<void>[\"publish\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the right-side menu.\n */\n subscribeToCloseRightSideMenu: MessageBus<void>[\"subscribe\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the side nav.\n */\n subscribeToCloseSideNavMenu: MessageBus<void>[\"subscribe\"];\n} & UiShellColors;\n\nconst UiShellContext = createContext<UiShellContext | undefined>(undefined);\n\nexport const useUiShellContext = () => {\n return useContext(UiShellContext);\n};\n\nexport type UiShellProviderProps = {\n /**\n * Sets either a gray or white background color for the app content area.\n */\n appBackgroundContrastMode?: ContrastMode;\n} & Partial<UiShellContext>;\n\nconst UiShellProvider = ({\n appBackgroundColor,\n appBackgroundContrastMode = \"lowContrast\",\n children,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavBackgroundColor,\n}: PropsWithChildren<UiShellProviderProps>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const defaultedSideNavBackgroundColor =\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite;\n\n const sideNavContrastColors =\n defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite\n ? generateContrastColors({\n backgroundColor:\n sideNavBackgroundColor || defaultedSideNavBackgroundColor,\n backgroundContrastColor: sideNavBackgroundContrastColor,\n odysseyDesignTokens,\n })\n : undefined;\n\n const isAppBackgroundHightContrast =\n appBackgroundContrastMode === \"highContrast\";\n\n const defaultTopAndAppBackgroundColor = isAppBackgroundHightContrast\n ? odysseyDesignTokens.HueNeutralWhite\n : odysseyDesignTokens.HueNeutral50;\n\n const topNavColor = topNavBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const appContentBackgroundColor =\n appBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const memoizedContextValue = useMemo(\n () => ({\n appBackgroundColor: appContentBackgroundColor,\n closeSideNavMenu:\n closeSideNavMenu ?? defaultCloseSideNavMessageBus.publish,\n sideNavBackgroundColor:\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite,\n sideNavContrastColors,\n subscribeToCloseSideNavMenu:\n subscribeToCloseSideNavMenu ?? defaultCloseSideNavMessageBus.subscribe,\n subscribeToCloseRightSideMenu:\n subscribeToCloseRightSideMenu ?? defaultSubscribeToCloseRightSideMenu,\n topNavBackgroundColor: topNavColor,\n }),\n [\n appContentBackgroundColor,\n odysseyDesignTokens.HueNeutralWhite,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavContrastColors,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavColor,\n ],\n );\n\n return (\n <UiShellContext.Provider value={memoizedContextValue}>\n {children}\n </UiShellContext.Provider>\n );\n};\n\nconst MemoizedUiShellProvider = memo(UiShellProvider);\n\nexport { MemoizedUiShellProvider as UiShellProvider };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,qBAAA,GAAAD,OAAA;AAIA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,iBAAA,GAAAH,OAAA;AAAqE,IAAAI,WAAA,GAAAJ,OAAA;AA1BrE;AACA;AACA;AACA;AACA;AACA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EAClC,OAAO;IACLvB,kBAAkB,EAAEqB,yBAAyB;IAC7ClB,gBAAgB,EACdA,gBAAgB,IAAIb,6BAA6B,CAACkC,OAAO;IAC3DpB,sBAAsB,EACpBA,sBAAsB,IAAIK,mBAAmB,CAACG,eAAe;IAC/DC,qBAAqB;IACrBN,2BAA2B,EACzBA,2BAA2B,IAAIjB,6BAA6B,CAACmC,SAAS;IACxEnB,6BAA6B,EAC3BA,6BAA6B,IAAIb,oCAAoC;IACvEe,qBAAqB,EAAEY;EACzB,CAAC,CAAC,EACF,CACEC,yBAAyB,EACzBZ,mBAAmB,CAACG,eAAe,EACnCT,gBAAgB,EAChBC,sBAAsB,EACtBS,qBAAqB,EACrBP,6BAA6B,EAC7BC,2BAA2B,EAC3Ba,WAAW,CAEf,CAAC;EAED,OACE,IAAA/B,WAAA,CAAAqC,GAAA,EAAChC,cAAc,CAACiC,QAAQ;IAACC,KAAK,EAAEN,oBAAqB;IAAApB,QAAA,EAClDA;EAAQ,CACc,CAAC;AAE9B,CAAC;AAED,MAAM2B,uBAAuB,GAAAtC,OAAA,CAAAQ,eAAA,GAAG,IAAA+B,WAAI,EAAC/B,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"UiShellProvider.cjs","names":["_react","require","_createContrastColors","_OdysseyDesignTokensContext","_createMessageBus","_jsxRuntime","defaultCloseSideNavMessageBus","exports","createMessageBus","defaultSubscribeToCloseRightSideMenu","UiShellContext","createContext","undefined","useUiShellContext","useContext","UiShellProvider","appBackgroundColor","appBackgroundContrastMode","children","closeSideNavMenu","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","topNavBackgroundColor","odysseyDesignTokens","useOdysseyDesignTokens","defaultedSideNavBackgroundColor","HueNeutralWhite","sideNavContrastColors","generateContrastColors","backgroundColor","backgroundContrastColor","isAppBackgroundHightContrast","defaultTopAndAppBackgroundColor","HueNeutral50","topNavColor","appContentBackgroundColor","memoizedContextValue","useMemo","publish","subscribe","jsx","Provider","value","MemoizedUiShellProvider","memo"],"sources":["../../../src/ui-shell/UiShellProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\n\nimport {\n ContrastColors,\n generateContrastColors,\n} from \"../createContrastColors.js\";\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { createMessageBus, MessageBus } from \"../tools/createMessageBus.js\";\nimport { ContrastMode } from \"../useContrastMode.js\";\n\nexport const defaultCloseSideNavMessageBus = createMessageBus();\nexport const defaultSubscribeToCloseRightSideMenu = () => () => {};\n\nexport type UiShellColors = {\n /**\n * Custom background color for the app content area.\n */\n appBackgroundColor: string;\n /**\n * Custom background color for the side nav area.\n */\n sideNavBackgroundColor: string;\n /**\n * Custom color for fonts and other contrasted colors in the side nav area. Other contrast colors are derived from this one.\n *\n * If not passed, it gets computed from Odyssey.\n */\n sideNavBackgroundContrastColor?: string;\n sideNavContrastColors?: ContrastColors;\n /**\n * Custom background color for the top nav area.\n */\n topNavBackgroundColor: string;\n};\n\nexport type UiShellContext = {\n /**\n * This is a callback that publishes a change to all subscribers listening for when to close the side nav.\n */\n closeSideNavMenu: MessageBus<void>[\"publish\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the right-side menu.\n */\n subscribeToCloseRightSideMenu: MessageBus<void>[\"subscribe\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the side nav.\n */\n subscribeToCloseSideNavMenu: MessageBus<void>[\"subscribe\"];\n} & UiShellColors;\n\nconst UiShellContext = createContext<UiShellContext | undefined>(undefined);\n\nexport const useUiShellContext = () => {\n return useContext(UiShellContext);\n};\n\nexport type UiShellProviderProps = {\n /**\n * Sets either a gray or white background color for the app content area.\n */\n appBackgroundContrastMode?: ContrastMode;\n} & Partial<UiShellContext>;\n\nconst UiShellProvider = ({\n appBackgroundColor,\n appBackgroundContrastMode = \"lowContrast\",\n children,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavBackgroundColor,\n}: PropsWithChildren<UiShellProviderProps>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const defaultedSideNavBackgroundColor =\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite;\n\n const sideNavContrastColors =\n defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite\n ? generateContrastColors({\n backgroundColor:\n sideNavBackgroundColor || defaultedSideNavBackgroundColor,\n backgroundContrastColor: sideNavBackgroundContrastColor,\n odysseyDesignTokens,\n })\n : undefined;\n\n const isAppBackgroundHightContrast =\n appBackgroundContrastMode === \"highContrast\";\n\n const defaultTopAndAppBackgroundColor = isAppBackgroundHightContrast\n ? odysseyDesignTokens.HueNeutralWhite\n : odysseyDesignTokens.HueNeutral50;\n\n const topNavColor = topNavBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const appContentBackgroundColor =\n appBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const memoizedContextValue = useMemo(\n () => ({\n appBackgroundColor: appContentBackgroundColor,\n closeSideNavMenu:\n closeSideNavMenu ?? defaultCloseSideNavMessageBus.publish,\n sideNavBackgroundColor:\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite,\n sideNavContrastColors,\n subscribeToCloseSideNavMenu:\n subscribeToCloseSideNavMenu ?? defaultCloseSideNavMessageBus.subscribe,\n subscribeToCloseRightSideMenu:\n subscribeToCloseRightSideMenu ?? defaultSubscribeToCloseRightSideMenu,\n topNavBackgroundColor: topNavColor,\n }),\n [\n appContentBackgroundColor,\n odysseyDesignTokens.HueNeutralWhite,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavContrastColors,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavColor,\n ],\n );\n\n return (\n <UiShellContext.Provider value={memoizedContextValue}>\n {children}\n </UiShellContext.Provider>\n );\n};\n\nconst MemoizedUiShellProvider = memo(UiShellProvider);\n\nexport { MemoizedUiShellProvider as UiShellProvider };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,qBAAA,GAAAD,OAAA;AAIA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAA4E,IAAAI,WAAA,GAAAJ,OAAA;AAzB5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBO,MAAMK,6BAA6B,GAAAC,OAAA,CAAAD,6BAAA,GAAG,IAAAE,kCAAgB,EAAC,CAAC;AACxD,MAAMC,oCAAoC,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAACF,OAAA,CAAAE,oCAAA,GAAAA,oCAAA;AAyCnE,MAAMC,cAAc,GAAG,IAAAC,oBAAa,EAA6BC,SAAS,CAAC;AAEpE,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrC,OAAO,IAAAC,iBAAU,EAACJ,cAAc,CAAC;AACnC,CAAC;AAACH,OAAA,CAAAM,iBAAA,GAAAA,iBAAA;AASF,MAAME,eAAe,GAAGA,CAAC;EACvBC,kBAAkB;EAClBC,yBAAyB,GAAG,aAAa;EACzCC,QAAQ;EACRC,gBAAgB;EAChBC,sBAAsB;EACtBC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,2BAA2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AAqB;IAAApB,QAAA,EAClDA;EAAQ,CACc,CAAC;AAE9B,CAAC;AAED,MAAM2B,uBAAuB,GAAAtC,OAAA,CAAAQ,eAAA,GAAG,IAAA+B,WAAI,EAAC/B,eAAe,CAAC","ignoreList":[]}
@@ -12,6 +12,7 @@ var _index = require("./AppSwitcher/index.cjs");
12
12
  var _InnerAppContainer = require("./InnerAppContainer.cjs");
13
13
  var _index2 = require("./SideNav/index.cjs");
14
14
  var _index3 = require("./TopNav/index.cjs");
15
+ var _uiShellContentTypes = require("./uiShellContentTypes.cjs");
15
16
  var _UiShellProvider = require("./UiShellProvider.cjs");
16
17
  var _uiShellSharedConstants = require("./uiShellSharedConstants.cjs");
17
18
  var _useMatchAppElementToUiShellAppArea = require("./useMatchAppElementToUiShellAppArea.cjs");
@@ -113,7 +114,7 @@ const WideUiShellContent = ({
113
114
  isLoading: true,
114
115
  selectedAppName: ""
115
116
  })
116
- }), appSwitcherProps && (0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
117
+ }), appSwitcherProps && appSwitcherProps !== _uiShellContentTypes.TURN_OFF_APP_SWITCHER && (0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
117
118
  fallback: null,
118
119
  onError: onError,
119
120
  children: (0, _jsxRuntime.jsx)(_index.AppSwitcher, {