@okta/odyssey-react-mui 1.32.0 → 1.33.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.
- package/dist/cjs/Autocomplete.cjs +1 -1
- package/dist/cjs/Autocomplete.cjs.map +1 -1
- package/dist/cjs/Breadcrumbs.cjs +23 -7
- package/dist/cjs/Breadcrumbs.cjs.map +1 -1
- package/dist/cjs/DatePickers/datePickerTheme.cjs +1 -1
- package/dist/cjs/DatePickers/datePickerTheme.cjs.map +1 -1
- package/dist/cjs/OdysseyProvider.cjs +2 -2
- package/dist/cjs/OdysseyProvider.cjs.map +1 -1
- package/dist/cjs/OdysseyThemeProvider.cjs +2 -2
- package/dist/cjs/OdysseyThemeProvider.cjs.map +1 -1
- package/dist/cjs/hexToRgb.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
- package/dist/cjs/theme/components.cjs +6 -0
- package/dist/cjs/theme/components.cjs.map +1 -1
- package/{src/theme/palette.types.ts → dist/cjs/theme/pxToRem.cjs} +10 -13
- package/dist/cjs/theme/pxToRem.cjs.map +1 -0
- package/dist/cjs/theme/theme.cjs +22 -0
- package/dist/cjs/theme/theme.cjs.map +1 -1
- package/dist/cjs/theme/useMediaQuery.cjs +34 -0
- package/dist/cjs/theme/useMediaQuery.cjs.map +1 -0
- package/dist/cjs/ui-shell/AppSwitcher/AppSwitcher.cjs +3 -3
- package/dist/cjs/ui-shell/AppSwitcher/AppSwitcher.cjs.map +1 -1
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +340 -0
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -0
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs +64 -45
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavHeader.cjs +8 -5
- package/dist/cjs/ui-shell/SideNav/SideNavHeader.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs +39 -11
- package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +3 -1
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavLogo.cjs +14 -2
- package/dist/cjs/ui-shell/SideNav/SideNavLogo.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +2 -1
- package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/types.cjs.map +1 -1
- package/dist/cjs/ui-shell/TopNav/HamburgerMenuIcon.cjs +37 -0
- package/dist/cjs/ui-shell/TopNav/HamburgerMenuIcon.cjs.map +1 -0
- package/dist/cjs/ui-shell/TopNav/TopNav.cjs +5 -5
- package/dist/cjs/ui-shell/TopNav/TopNav.cjs.map +1 -1
- package/dist/cjs/ui-shell/UiShell.cjs +37 -18
- package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
- package/dist/cjs/ui-shell/UiShellProvider.cjs +10 -3
- package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
- package/dist/cjs/ui-shell/WideUiShellContent.cjs +171 -0
- package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -0
- package/dist/cjs/ui-shell/index.cjs +36 -0
- package/dist/cjs/ui-shell/index.cjs.map +1 -1
- package/dist/cjs/ui-shell/renderUiShell.cjs +19 -20
- package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
- package/{src/TagListContext.tsx → dist/cjs/ui-shell/uiShellContentTypes.cjs} +9 -12
- package/dist/cjs/ui-shell/uiShellContentTypes.cjs.map +1 -0
- package/dist/cjs/ui-shell/uiShellSharedConstants.cjs +22 -0
- package/dist/cjs/ui-shell/uiShellSharedConstants.cjs.map +1 -0
- package/dist/cjs/ui-shell/useMatchAppElementToUiShellAppArea.cjs +108 -0
- package/dist/cjs/ui-shell/useMatchAppElementToUiShellAppArea.cjs.map +1 -0
- package/dist/cjs/ui-shell/useScrollState.cjs +2 -4
- package/dist/cjs/ui-shell/useScrollState.cjs.map +1 -1
- package/dist/cjs/ui-shell/useUiShellBreakpoints.cjs +41 -0
- package/dist/cjs/ui-shell/useUiShellBreakpoints.cjs.map +1 -0
- package/dist/cjs/useContrastMode.cjs +1 -1
- package/dist/cjs/useContrastMode.cjs.map +1 -1
- package/dist/cjs/web-component/createReactRootElements.cjs.map +1 -1
- package/dist/cjs/web-component/renderReactInWebComponent.cjs +6 -1
- package/dist/cjs/web-component/renderReactInWebComponent.cjs.map +1 -1
- package/dist/esm/Autocomplete.js +1 -1
- package/dist/esm/Autocomplete.js.map +1 -1
- package/dist/esm/Breadcrumbs.js +23 -7
- package/dist/esm/Breadcrumbs.js.map +1 -1
- package/dist/esm/DatePickers/datePickerTheme.js +1 -1
- package/dist/esm/DatePickers/datePickerTheme.js.map +1 -1
- package/dist/esm/OdysseyProvider.js +2 -2
- package/dist/esm/OdysseyProvider.js.map +1 -1
- package/dist/esm/OdysseyThemeProvider.js +2 -2
- package/dist/esm/OdysseyThemeProvider.js.map +1 -1
- package/dist/esm/hexToRgb.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_cs.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_da.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_de.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_el.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_es.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fi.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fr.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_hu.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_id.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_it.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ja.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ko.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ms.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nb.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pl.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ro.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ru.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_sv.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_th.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_tr.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_uk.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_vi.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/esm/theme/components.js +6 -0
- package/dist/esm/theme/components.js.map +1 -1
- package/{src/shadow-dom/index.ts → dist/esm/theme/pxToRem.js} +2 -1
- package/dist/esm/theme/pxToRem.js.map +1 -0
- package/dist/esm/theme/theme.js +2 -0
- package/dist/esm/theme/theme.js.map +1 -1
- package/{src/ui-shell/useHasUiShell.ts → dist/esm/theme/useMediaQuery.js} +13 -11
- package/dist/esm/theme/useMediaQuery.js.map +1 -0
- package/dist/esm/ui-shell/AppSwitcher/AppSwitcher.js +2 -2
- package/dist/esm/ui-shell/AppSwitcher/AppSwitcher.js.map +1 -1
- package/dist/esm/ui-shell/NarrowUiShellContent.js +334 -0
- package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -0
- package/dist/esm/ui-shell/SideNav/SideNav.js +63 -44
- package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavHeader.js +7 -4
- package/dist/esm/ui-shell/SideNav/SideNavHeader.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavItemContent.js +40 -12
- package/dist/esm/ui-shell/SideNav/SideNavItemContent.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +3 -1
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavLogo.js +14 -2
- package/dist/esm/ui-shell/SideNav/SideNavLogo.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +2 -1
- package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/types.js.map +1 -1
- package/dist/esm/ui-shell/TopNav/HamburgerMenuIcon.js +32 -0
- package/dist/esm/ui-shell/TopNav/HamburgerMenuIcon.js.map +1 -0
- package/dist/esm/ui-shell/TopNav/TopNav.js +2 -2
- package/dist/esm/ui-shell/TopNav/TopNav.js.map +1 -1
- package/dist/esm/ui-shell/UiShell.js +37 -18
- package/dist/esm/ui-shell/UiShell.js.map +1 -1
- package/dist/esm/ui-shell/UiShellProvider.js +10 -3
- package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
- package/dist/esm/ui-shell/WideUiShellContent.js +165 -0
- package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -0
- package/dist/esm/ui-shell/index.js +3 -0
- package/dist/esm/ui-shell/index.js.map +1 -1
- package/dist/esm/ui-shell/renderUiShell.js +19 -20
- package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
- package/{src/DataTable/constants.ts → dist/esm/ui-shell/uiShellContentTypes.js} +3 -2
- package/dist/esm/ui-shell/uiShellContentTypes.js.map +1 -0
- package/{src/CssBaseline.tsx → dist/esm/ui-shell/uiShellSharedConstants.js} +7 -11
- package/dist/esm/ui-shell/uiShellSharedConstants.js.map +1 -0
- package/dist/esm/ui-shell/useMatchAppElementToUiShellAppArea.js +99 -0
- package/dist/esm/ui-shell/useMatchAppElementToUiShellAppArea.js.map +1 -0
- package/dist/esm/ui-shell/useScrollState.js +3 -5
- package/dist/esm/ui-shell/useScrollState.js.map +1 -1
- package/dist/esm/ui-shell/useUiShellBreakpoints.js +34 -0
- package/dist/esm/ui-shell/useUiShellBreakpoints.js.map +1 -0
- package/dist/esm/useContrastMode.js +2 -2
- package/dist/esm/useContrastMode.js.map +1 -1
- package/dist/esm/web-component/createReactRootElements.js.map +1 -1
- package/dist/esm/web-component/renderReactInWebComponent.js +6 -1
- package/dist/esm/web-component/renderReactInWebComponent.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.scss +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/types/Autocomplete.d.ts +1 -1
- package/dist/types/Breadcrumbs.d.ts +4 -3
- package/dist/types/Breadcrumbs.d.ts.map +1 -1
- package/dist/types/OdysseyProvider.d.ts +1 -1
- package/dist/types/OdysseyProvider.d.ts.map +1 -1
- package/dist/types/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/types/OdysseyTranslationProvider.d.ts +1 -1
- package/dist/types/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/types/hexToRgb.d.ts.map +1 -1
- package/dist/types/i18n.d.ts +28 -0
- package/dist/types/i18n.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_da.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_de.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_el.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_es.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_id.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_it.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_th.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/types/theme/components.d.ts.map +1 -1
- package/{src/DatePickers/index.ts → dist/types/theme/pxToRem.d.ts} +3 -5
- package/dist/types/theme/pxToRem.d.ts.map +1 -0
- package/dist/types/theme/theme.d.ts +2 -0
- package/dist/types/theme/theme.d.ts.map +1 -1
- package/{src/web-component/index.ts → dist/types/theme/useMediaQuery.d.ts} +2 -2
- package/dist/types/theme/useMediaQuery.d.ts.map +1 -0
- package/dist/types/ui-shell/AppSwitcher/AppSwitcher.d.ts.map +1 -1
- package/dist/types/ui-shell/NarrowUiShellContent.d.ts +17 -0
- package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -0
- package/dist/types/ui-shell/SideNav/SideNav.d.ts +1 -3
- package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavHeader.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts +9 -7
- package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavItemLinkContent.d.ts +1 -1
- package/dist/types/ui-shell/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavLogo.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavToggleButton.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/types.d.ts +12 -2
- package/dist/types/ui-shell/SideNav/types.d.ts.map +1 -1
- package/{src/Buttons/ButtonContext.tsx → dist/types/ui-shell/TopNav/HamburgerMenuIcon.d.ts} +5 -12
- package/dist/types/ui-shell/TopNav/HamburgerMenuIcon.d.ts.map +1 -0
- package/dist/types/ui-shell/TopNav/TopNav.d.ts +0 -1
- package/dist/types/ui-shell/TopNav/TopNav.d.ts.map +1 -1
- package/dist/types/ui-shell/UiShell.d.ts +20 -7
- package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
- package/dist/types/ui-shell/UiShellProvider.d.ts +8 -6
- package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
- package/{src/Buttons/index.ts → dist/types/ui-shell/WideUiShellContent.d.ts} +5 -14
- package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -0
- package/dist/types/ui-shell/index.d.ts +3 -1
- package/dist/types/ui-shell/index.d.ts.map +1 -1
- package/dist/types/ui-shell/renderUiShell.d.ts +7 -11
- package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
- package/dist/types/ui-shell/uiShellContentTypes.d.ts +96 -0
- package/dist/types/ui-shell/uiShellContentTypes.d.ts.map +1 -0
- package/{src/@types/i18next.d.ts → dist/types/ui-shell/uiShellSharedConstants.d.ts} +7 -14
- package/dist/types/ui-shell/uiShellSharedConstants.d.ts.map +1 -0
- package/dist/types/ui-shell/useMatchAppElementToUiShellAppArea.d.ts +38 -0
- package/dist/types/ui-shell/useMatchAppElementToUiShellAppArea.d.ts.map +1 -0
- package/dist/types/ui-shell/useScrollState.d.ts +0 -1
- package/dist/types/ui-shell/useScrollState.d.ts.map +1 -1
- package/{src/FieldsetContext.tsx → dist/types/ui-shell/useUiShellBreakpoints.d.ts} +7 -12
- package/dist/types/ui-shell/useUiShellBreakpoints.d.ts.map +1 -0
- package/dist/types/web-component/createReactRootElements.d.ts +6 -4
- package/dist/types/web-component/createReactRootElements.d.ts.map +1 -1
- package/dist/types/web-component/renderReactInWebComponent.d.ts +12 -5
- package/dist/types/web-component/renderReactInWebComponent.d.ts.map +1 -1
- package/package.json +4 -4
- package/.browserslistrc +0 -1
- package/.svgrrc.cjs +0 -13
- package/CHANGELOG.md +0 -1490
- package/babel.config.cjs +0 -112
- package/dist/cjs/ui-shell/UiShellContent.cjs +0 -226
- package/dist/cjs/ui-shell/UiShellContent.cjs.map +0 -1
- package/dist/esm/ui-shell/UiShellContent.js +0 -220
- package/dist/esm/ui-shell/UiShellContent.js.map +0 -1
- package/dist/types/ui-shell/UiShellContent.d.ts +0 -76
- package/dist/types/ui-shell/UiShellContent.d.ts.map +0 -1
- package/i18n.config.json +0 -10
- package/scripts/generateIconsIndex.ts +0 -49
- package/scripts/generateTestSelectorsJson.ts +0 -33
- package/scripts/properties-to-ts.ts +0 -111
- package/src/@types/properties.d.ts +0 -292
- package/src/@types/react-augment.d.ts +0 -22
- package/src/Accordion.tsx +0 -117
- package/src/Autocomplete.tsx +0 -321
- package/src/Badge.tsx +0 -112
- package/src/Banner.tsx +0 -112
- package/src/Box.tsx +0 -44
- package/src/Breadcrumbs.tsx +0 -221
- package/src/Buttons/BaseButton.tsx +0 -250
- package/src/Buttons/BaseMenuButton.tsx +0 -342
- package/src/Buttons/Button.tsx +0 -30
- package/src/Buttons/MenuButton.tsx +0 -33
- package/src/Buttons/MenuContext.ts +0 -25
- package/src/Buttons/MenuItem.tsx +0 -103
- package/src/Callout.tsx +0 -176
- package/src/Card.tsx +0 -186
- package/src/Checkbox.tsx +0 -261
- package/src/CheckboxGroup.tsx +0 -127
- package/src/CircularProgress.tsx +0 -42
- package/src/DataTable/DataTable.tsx +0 -968
- package/src/DataTable/DataTableRowActions.tsx +0 -132
- package/src/DataTable/DataTableSettings.tsx +0 -136
- package/src/DataTable/index.tsx +0 -28
- package/src/DataTable/reorderDataRowsLocally.tsx +0 -48
- package/src/DataTable/useRowReordering.tsx +0 -232
- package/src/DataTable/useScrollIndication.tsx +0 -125
- package/src/DatePickers/DateField.tsx +0 -267
- package/src/DatePickers/DateFieldActionBar.tsx +0 -65
- package/src/DatePickers/DateFieldLocalizationProvider.tsx +0 -46
- package/src/DatePickers/DatePicker.test.tsx +0 -66
- package/src/DatePickers/DatePicker.tsx +0 -299
- package/src/DatePickers/DatePicker.types.d.ts +0 -14
- package/src/DatePickers/TimeZonePicker.tsx +0 -59
- package/src/DatePickers/datePickerTheme.tsx +0 -377
- package/src/DatePickers/useDateFieldsTranslations.ts +0 -94
- package/src/DatePickers/useOdysseyDateFields.ts +0 -303
- package/src/Dialog.tsx +0 -178
- package/src/Drawer.tsx +0 -255
- package/src/EmptyState.tsx +0 -79
- package/src/ErrorMessageList.tsx +0 -56
- package/src/Field.tsx +0 -189
- package/src/FieldComponentProps.ts +0 -66
- package/src/FieldError.tsx +0 -59
- package/src/FieldHint.tsx +0 -72
- package/src/FieldLabel.tsx +0 -67
- package/src/Fieldset.tsx +0 -116
- package/src/FileUploader/FileUploadIllustration.tsx +0 -66
- package/src/FileUploader/FileUploadPreview.tsx +0 -151
- package/src/FileUploader/FileUploader.tsx +0 -311
- package/src/FileUploader/index.ts +0 -13
- package/src/Form.tsx +0 -185
- package/src/FormCheckedProps.ts +0 -59
- package/src/HintLink.tsx +0 -28
- package/src/HtmlProps.ts +0 -112
- package/src/IconWithTooltip.tsx +0 -90
- package/src/Link.tsx +0 -115
- package/src/MuiPropsChild.tsx +0 -42
- package/src/MuiPropsContext.ts +0 -18
- package/src/NativeSelect.tsx +0 -249
- package/src/NullElement.tsx +0 -13
- package/src/OdysseyCacheProvider.test.tsx +0 -39
- package/src/OdysseyCacheProvider.tsx +0 -86
- package/src/OdysseyDesignTokensContext.tsx +0 -23
- package/src/OdysseyProvider.tsx +0 -92
- package/src/OdysseyThemeProvider.test.tsx +0 -211
- package/src/OdysseyThemeProvider.tsx +0 -109
- package/src/OdysseyTranslationProvider.test.tsx +0 -95
- package/src/OdysseyTranslationProvider.tsx +0 -77
- package/src/OdysseyTranslationProvider.types.ts +0 -47
- package/src/Pagination/Pagination.test.tsx +0 -327
- package/src/Pagination/Pagination.tsx +0 -417
- package/src/Pagination/constants.ts +0 -13
- package/src/Pagination/index.ts +0 -15
- package/src/Pagination/usePagination.ts +0 -45
- package/src/PasswordField.tsx +0 -253
- package/src/Radio.tsx +0 -199
- package/src/RadioGroup.tsx +0 -164
- package/src/ScreenReaderText.tsx +0 -53
- package/src/SearchField.tsx +0 -240
- package/src/Select.tsx +0 -576
- package/src/Stack.tsx +0 -56
- package/src/Status.tsx +0 -67
- package/src/Surface.tsx +0 -61
- package/src/SvgIcon.ts +0 -22
- package/src/Switch.tsx +0 -425
- package/src/Tabs.tsx +0 -259
- package/src/Tag.tsx +0 -317
- package/src/TagList.tsx +0 -55
- package/src/TextField.tsx +0 -298
- package/src/Toast.tsx +0 -151
- package/src/ToastStack.tsx +0 -43
- package/src/Tooltip.tsx +0 -61
- package/src/Typography.test.tsx +0 -26
- package/src/Typography.tsx +0 -474
- package/src/createContrastColors.ts +0 -112
- package/src/createUniqueAlphabeticalId.test.ts +0 -22
- package/src/createUniqueAlphabeticalId.ts +0 -17
- package/src/createUniqueId.test.ts +0 -22
- package/src/createUniqueId.ts +0 -17
- package/src/getTypedObjectKeys.ts +0 -15
- package/src/hexToRgb.ts +0 -40
- package/src/i18n.ts +0 -110
- package/src/icons.generated/Add.tsx +0 -44
- package/src/icons.generated/AddCircle.tsx +0 -46
- package/src/icons.generated/Apps.tsx +0 -44
- package/src/icons.generated/ArrowBottom.tsx +0 -46
- package/src/icons.generated/ArrowDown.tsx +0 -46
- package/src/icons.generated/ArrowLeft.tsx +0 -46
- package/src/icons.generated/ArrowLowerLeft.tsx +0 -46
- package/src/icons.generated/ArrowLowerRight.tsx +0 -46
- package/src/icons.generated/ArrowRight.tsx +0 -46
- package/src/icons.generated/ArrowTop.tsx +0 -46
- package/src/icons.generated/ArrowUnsorted.tsx +0 -46
- package/src/icons.generated/ArrowUp.tsx +0 -46
- package/src/icons.generated/ArrowUpperLeft.tsx +0 -46
- package/src/icons.generated/ArrowUpperRight.tsx +0 -46
- package/src/icons.generated/Bug.tsx +0 -44
- package/src/icons.generated/Calendar.tsx +0 -46
- package/src/icons.generated/Call.tsx +0 -44
- package/src/icons.generated/Chat.tsx +0 -44
- package/src/icons.generated/Check.tsx +0 -44
- package/src/icons.generated/CheckCircleFilled.tsx +0 -47
- package/src/icons.generated/ChevronDown.tsx +0 -46
- package/src/icons.generated/ChevronLeft.tsx +0 -46
- package/src/icons.generated/ChevronRight.tsx +0 -46
- package/src/icons.generated/ChevronUp.tsx +0 -46
- package/src/icons.generated/Clock.tsx +0 -44
- package/src/icons.generated/Close.tsx +0 -44
- package/src/icons.generated/CloseCircleFilled.tsx +0 -47
- package/src/icons.generated/CollapseLeft.tsx +0 -46
- package/src/icons.generated/CollapseRight.tsx +0 -46
- package/src/icons.generated/Copy.tsx +0 -44
- package/src/icons.generated/Custom.tsx +0 -50
- package/src/icons.generated/DangerDiamond.tsx +0 -46
- package/src/icons.generated/DangerDiamondFilled.tsx +0 -47
- package/src/icons.generated/Delete.tsx +0 -44
- package/src/icons.generated/Deny.tsx +0 -44
- package/src/icons.generated/Devices.tsx +0 -46
- package/src/icons.generated/Directory.tsx +0 -46
- package/src/icons.generated/Documentation.tsx +0 -46
- package/src/icons.generated/Download.tsx +0 -46
- package/src/icons.generated/DragIndicator.tsx +0 -46
- package/src/icons.generated/Duo.tsx +0 -62
- package/src/icons.generated/Edit.tsx +0 -44
- package/src/icons.generated/Email.tsx +0 -49
- package/src/icons.generated/ExpandLeft.tsx +0 -46
- package/src/icons.generated/ExpandRight.tsx +0 -46
- package/src/icons.generated/ExternalLink.tsx +0 -44
- package/src/icons.generated/Fido2.tsx +0 -72
- package/src/icons.generated/Filter.tsx +0 -44
- package/src/icons.generated/Folder.tsx +0 -44
- package/src/icons.generated/Globe.tsx +0 -44
- package/src/icons.generated/GoogleAuth.tsx +0 -70
- package/src/icons.generated/Grid.tsx +0 -47
- package/src/icons.generated/Group.tsx +0 -44
- package/src/icons.generated/Hide.tsx +0 -44
- package/src/icons.generated/Home.tsx +0 -44
- package/src/icons.generated/Idp.tsx +0 -54
- package/src/icons.generated/InformationCircle.tsx +0 -47
- package/src/icons.generated/InformationCircleFilled.tsx +0 -47
- package/src/icons.generated/Link.tsx +0 -44
- package/src/icons.generated/List.tsx +0 -44
- package/src/icons.generated/Lock.tsx +0 -44
- package/src/icons.generated/More.tsx +0 -44
- package/src/icons.generated/Notification.tsx +0 -46
- package/src/icons.generated/OktaVerify.tsx +0 -46
- package/src/icons.generated/OnPremMfa.tsx +0 -52
- package/src/icons.generated/OneTimePassword.tsx +0 -65
- package/src/icons.generated/Password.tsx +0 -80
- package/src/icons.generated/Pause.tsx +0 -44
- package/src/icons.generated/QuestionCircle.tsx +0 -46
- package/src/icons.generated/QuestionCircleFilled.tsx +0 -47
- package/src/icons.generated/Refresh.tsx +0 -46
- package/src/icons.generated/Reset.tsx +0 -44
- package/src/icons.generated/Resume.tsx +0 -44
- package/src/icons.generated/Search.tsx +0 -44
- package/src/icons.generated/SecurityQuestion.tsx +0 -51
- package/src/icons.generated/Server.tsx +0 -44
- package/src/icons.generated/Settings.tsx +0 -46
- package/src/icons.generated/Show.tsx +0 -44
- package/src/icons.generated/SmartCard.tsx +0 -65
- package/src/icons.generated/Sms.tsx +0 -55
- package/src/icons.generated/Subtract.tsx +0 -46
- package/src/icons.generated/SymantecVip.tsx +0 -52
- package/src/icons.generated/Sync.tsx +0 -44
- package/src/icons.generated/ThumbsDown.tsx +0 -46
- package/src/icons.generated/ThumbsUp.tsx +0 -46
- package/src/icons.generated/Unlock.tsx +0 -44
- package/src/icons.generated/Upload.tsx +0 -44
- package/src/icons.generated/User.tsx +0 -44
- package/src/icons.generated/Video.tsx +0 -44
- package/src/icons.generated/VoiceCall.tsx +0 -62
- package/src/icons.generated/Warning.tsx +0 -46
- package/src/icons.generated/WarningFilled.tsx +0 -46
- package/src/icons.generated/Yubikey.tsx +0 -44
- package/src/icons.generated/index.ts +0 -107
- package/src/index.ts +0 -118
- package/src/inputUtils.ts +0 -80
- package/src/labs/AppTile.tsx +0 -421
- package/src/labs/DataFilters.tsx +0 -871
- package/src/labs/DataTable.tsx +0 -877
- package/src/labs/DataTablePagination.tsx +0 -88
- package/src/labs/DataView/BulkActionsMenu.tsx +0 -98
- package/src/labs/DataView/CardLayoutContent.tsx +0 -272
- package/src/labs/DataView/DataCard.tsx +0 -357
- package/src/labs/DataView/DataTable.tsx +0 -128
- package/src/labs/DataView/DataView.test.tsx +0 -1168
- package/src/labs/DataView/DataView.tsx +0 -504
- package/src/labs/DataView/DetailPanel.tsx +0 -31
- package/src/labs/DataView/LayoutSwitcher.tsx +0 -72
- package/src/labs/DataView/RowActions.tsx +0 -125
- package/src/labs/DataView/TableLayoutContent.tsx +0 -500
- package/src/labs/DataView/TableSettings.tsx +0 -144
- package/src/labs/DataView/componentTypes.ts +0 -129
- package/src/labs/DataView/constants.tsx +0 -28
- package/src/labs/DataView/dataTypes.ts +0 -83
- package/src/labs/DataView/fetchData.ts +0 -49
- package/src/labs/DataView/index.ts +0 -19
- package/src/labs/DataView/tableConstants.tsx +0 -137
- package/src/labs/DataView/testSupportData.tsx +0 -301
- package/src/labs/DataView/useFilterConversion.ts +0 -88
- package/src/labs/DatePickers/DateTimeField.tsx +0 -267
- package/src/labs/DatePickers/DateTimePicker.test.tsx +0 -70
- package/src/labs/DatePickers/DateTimePicker.tsx +0 -303
- package/src/labs/DatePickers/dateTimePickerTheme.ts +0 -216
- package/src/labs/DatePickers/index.ts +0 -13
- package/src/labs/GroupPicker.tsx +0 -261
- package/src/labs/OdysseyPickers/ComposablePicker.test.tsx +0 -32
- package/src/labs/OdysseyPickers/ComposablePicker.tsx +0 -188
- package/src/labs/OdysseyPickers/Picker.tsx +0 -381
- package/src/labs/OdysseyPickers/PickerVirtualizationListBox.tsx +0 -192
- package/src/labs/OdysseyPickers/PickerWithOptionAdornment.tsx +0 -429
- package/src/labs/OdysseyPickers/index.ts +0 -15
- package/src/labs/PageTemplate/Layout.tsx +0 -85
- package/src/labs/PageTemplate/PageTemplate.tsx +0 -234
- package/src/labs/PageTemplate/index.ts +0 -14
- package/src/labs/PaginatedTable.tsx +0 -290
- package/src/labs/README.md +0 -46
- package/src/labs/StaticTable.tsx +0 -131
- package/src/labs/UserProfile.tsx +0 -104
- package/src/labs/UserProfileMenuButton.tsx +0 -86
- package/src/labs/index.ts +0 -47
- package/src/labs/materialReactTableTypes.tsx +0 -19
- package/src/properties/odyssey-react-mui.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_cs.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_da.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_de.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_el.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_es.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_fi.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_fr.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ht.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_hu.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_id.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_it.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ja.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ko.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ms.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_nb.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_nl_NL.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ok_PL.properties +0 -126
- package/src/properties/translations/odyssey-react-mui_ok_SK.properties +0 -126
- package/src/properties/translations/odyssey-react-mui_pl.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_pt_BR.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ro.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_ru.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_sv.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_th.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_tr.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_uk.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_vi.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_zh_CN.properties +0 -140
- package/src/properties/translations/odyssey-react-mui_zh_TW.properties +0 -140
- package/src/properties/ts/odyssey-react-mui.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_cs.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_da.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_de.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_el.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_es.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_fi.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_fr.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ht.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_hu.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_id.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_it.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ja.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ko.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ms.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_nb.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_nl_NL.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ok_PL.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ok_SK.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_pl.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_pt_BR.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ro.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_ru.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_sv.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_th.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_tr.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_uk.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_vi.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_zh_CN.ts +0 -1
- package/src/properties/ts/odyssey-react-mui_zh_TW.ts +0 -1
- package/src/remUtils.ts +0 -27
- package/src/shadow-dom/shadow-dom.test.ts +0 -24
- package/src/shadow-dom/shadow-dom.ts +0 -54
- package/src/test-selectors/getByQuerySelector.ts +0 -176
- package/src/test-selectors/getComputedAccessibleErrorMessageText.ts +0 -52
- package/src/test-selectors/getComputedAccessibleText.ts +0 -36
- package/src/test-selectors/index.ts +0 -15
- package/src/test-selectors/interpolateString.ts +0 -41
- package/src/test-selectors/linkedHtmlSelectors.ts +0 -73
- package/src/test-selectors/queryOdysseySelector.ts +0 -36
- package/src/test-selectors/querySelector.ts +0 -249
- package/src/test-selectors/sanityChecks.ts +0 -53
- package/src/test-selectors/testSelector.ts +0 -143
- package/src/theme/components.tsx +0 -3275
- package/src/theme/components.types.ts +0 -111
- package/src/theme/createOdysseyMuiTheme.ts +0 -54
- package/src/theme/index.ts +0 -13
- package/src/theme/mixins.ts +0 -29
- package/src/theme/mixins.types.ts +0 -31
- package/src/theme/palette.ts +0 -112
- package/src/theme/shape.ts +0 -31
- package/src/theme/spacing.ts +0 -34
- package/src/theme/theme.ts +0 -13
- package/src/theme/typography.ts +0 -137
- package/src/theme/typography.types.ts +0 -41
- package/src/theme/useContrastMode.test.tsx +0 -504
- package/src/ui-shell/AppSwitcher/AppSwitcher.tsx +0 -94
- package/src/ui-shell/AppSwitcher/AppSwitcherApp.tsx +0 -146
- package/src/ui-shell/AppSwitcher/OktaAura.tsx +0 -50
- package/src/ui-shell/AppSwitcher/index.ts +0 -13
- package/src/ui-shell/SideNav/CollapseIcon.tsx +0 -34
- package/src/ui-shell/SideNav/HandleIcon.tsx +0 -35
- package/src/ui-shell/SideNav/NavAccordion.tsx +0 -243
- package/src/ui-shell/SideNav/OktaLogo.tsx +0 -34
- package/src/ui-shell/SideNav/SideNav.test.tsx +0 -326
- package/src/ui-shell/SideNav/SideNav.tsx +0 -810
- package/src/ui-shell/SideNav/SideNavFooterContent.tsx +0 -85
- package/src/ui-shell/SideNav/SideNavHeader.tsx +0 -134
- package/src/ui-shell/SideNav/SideNavItemContent.tsx +0 -402
- package/src/ui-shell/SideNav/SideNavItemContentContext.tsx +0 -29
- package/src/ui-shell/SideNav/SideNavItemLinkContent.tsx +0 -90
- package/src/ui-shell/SideNav/SideNavLogo.tsx +0 -65
- package/src/ui-shell/SideNav/SideNavToggleButton.tsx +0 -272
- package/src/ui-shell/SideNav/SortableList/SortableItem.tsx +0 -237
- package/src/ui-shell/SideNav/SortableList/SortableList.tsx +0 -132
- package/src/ui-shell/SideNav/SortableList/SortableOverlay.tsx +0 -34
- package/src/ui-shell/SideNav/index.ts +0 -16
- package/src/ui-shell/SideNav/types.ts +0 -224
- package/src/ui-shell/TopNav/TopNav.tsx +0 -109
- package/src/ui-shell/TopNav/TopNavLinksList.tsx +0 -68
- package/src/ui-shell/TopNav/TopNavListItem.tsx +0 -209
- package/src/ui-shell/TopNav/index.ts +0 -13
- package/src/ui-shell/UiShell.test.tsx +0 -366
- package/src/ui-shell/UiShell.tsx +0 -153
- package/src/ui-shell/UiShellContent.tsx +0 -350
- package/src/ui-shell/UiShellProvider.tsx +0 -103
- package/src/ui-shell/bufferLatest.test.ts +0 -79
- package/src/ui-shell/bufferLatest.ts +0 -64
- package/src/ui-shell/createMessageBus.test.ts +0 -115
- package/src/ui-shell/createMessageBus.ts +0 -53
- package/src/ui-shell/createStore.test.ts +0 -103
- package/src/ui-shell/createStore.ts +0 -37
- package/src/ui-shell/index.ts +0 -21
- package/src/ui-shell/renderUiShell.test.tsx +0 -203
- package/src/ui-shell/renderUiShell.tsx +0 -158
- package/src/ui-shell/useScrollState.ts +0 -59
- package/src/useAutocomplete.tsx +0 -184
- package/src/useContrastMode.tsx +0 -143
- package/src/useNormalizedKey.ts +0 -17
- package/src/useUniqueAlphabeticalId.ts +0 -21
- package/src/useUniqueId.ts +0 -21
- package/src/web-component/createReactRootElements.test.ts +0 -40
- package/src/web-component/createReactRootElements.ts +0 -39
- package/src/web-component/renderReactInWebComponent.test.tsx +0 -128
- package/src/web-component/renderReactInWebComponent.ts +0 -135
- package/tsconfig.json +0 -16
- package/tsconfig.production.json +0 -13
- package/vitest.config.ts +0 -36
- package/vitest.setup.ts +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["_index","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_renderUiShell","_index2","_index3","_useHasUiShell","_renderReactInWebComponent","_UiShell"],"sources":["../../../src/ui-shell/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./AppSwitcher/index.js\";\nexport * from \"./renderUiShell.js\";\nexport * from \"./SideNav/index.js\";\nexport * from \"./TopNav/index.js\";\nexport * from \"./useHasUiShell.js\";\nexport * from \"../web-component/renderReactInWebComponent.js\"; // This is located here because some teams use React v17, and this uses React v18's `ReactDOM/client` import which isn't in older versions.\
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["_index","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_NarrowUiShellContent","_renderUiShell","_index2","_index3","_uiShellContentTypes","_useHasUiShell","_renderReactInWebComponent","_WideUiShellContent","_UiShell"],"sources":["../../../src/ui-shell/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./AppSwitcher/index.js\";\nexport * from \"./NarrowUiShellContent.js\";\nexport * from \"./renderUiShell.js\";\nexport * from \"./SideNav/index.js\";\nexport * from \"./TopNav/index.js\";\nexport * from \"./uiShellContentTypes.js\";\nexport * from \"./useHasUiShell.js\";\nexport * from \"../web-component/renderReactInWebComponent.js\"; // This is located here because some teams use React v17, and this uses React v18's `ReactDOM/client` import which isn't in older versions.\nexport * from \"./WideUiShellContent.js\";\n\nexport { UiShell, type UiShellProps } from \"./UiShell.js\";\n"],"mappings":";;;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,qBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,qBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,qBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,qBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,cAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,cAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAA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AO,0BAAA,CAAAf,GAAA;IAAA;EAAA;AAAA;AACA,IAAAgB,mBAAA,GAAApB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAkB,mBAAA,EAAAjB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAgB,mBAAA,CAAAhB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,mBAAA,CAAAhB,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAiB,QAAA,GAAArB,OAAA","ignoreList":[]}
|
|
@@ -8,8 +8,8 @@ var _reactErrorBoundary = require("react-error-boundary");
|
|
|
8
8
|
var _bufferLatest = require("./bufferLatest.cjs");
|
|
9
9
|
var _createMessageBus = require("./createMessageBus.cjs");
|
|
10
10
|
var _UiShell = require("./UiShell.cjs");
|
|
11
|
-
var _renderReactInWebComponent = require("../web-component/renderReactInWebComponent.cjs");
|
|
12
11
|
var _useHasUiShell = require("./useHasUiShell.cjs");
|
|
12
|
+
var _renderReactInWebComponent = require("../web-component/renderReactInWebComponent.cjs");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
/*!
|
|
15
15
|
* Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
@@ -25,6 +25,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
25
25
|
|
|
26
26
|
const optionalComponentSlotNames = exports.optionalComponentSlotNames = {
|
|
27
27
|
banners: "banners",
|
|
28
|
+
rightSideMenu: "right-side-menu",
|
|
28
29
|
sideNavFooter: "side-nav-footer",
|
|
29
30
|
topNavLeftSide: "top-nav-left-side",
|
|
30
31
|
topNavRightSide: "top-nav-right-side"
|
|
@@ -32,17 +33,17 @@ const optionalComponentSlotNames = exports.optionalComponentSlotNames = {
|
|
|
32
33
|
const renderUiShell = ({
|
|
33
34
|
appBackgroundColor,
|
|
34
35
|
appBackgroundContrastMode,
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
appElement: providedAppElement,
|
|
37
|
+
appElementScrollingMode,
|
|
37
38
|
hasStandardAppContentPadding,
|
|
38
39
|
initialVisibleSections,
|
|
39
40
|
onError = console.error,
|
|
41
|
+
parentElement,
|
|
40
42
|
sideNavBackgroundColor,
|
|
41
|
-
topNavBackgroundColor
|
|
42
|
-
uiShellRootElement
|
|
43
|
+
topNavBackgroundColor
|
|
43
44
|
}) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
45
|
+
const appElement = providedAppElement || document.createElement("div");
|
|
46
|
+
parentElement.setAttribute(_useHasUiShell.uiShellDataAttribute, "");
|
|
46
47
|
const {
|
|
47
48
|
publish: publishPropChanges,
|
|
48
49
|
subscribe: subscribeToPropChanges
|
|
@@ -60,21 +61,18 @@ const renderUiShell = ({
|
|
|
60
61
|
element.setAttribute("slot", slotName);
|
|
61
62
|
return [optionalComponentKey, element];
|
|
62
63
|
}));
|
|
63
|
-
const appContainerElement = document.createElement("div");
|
|
64
|
-
appContainerElement.appendChild(appRootElement);
|
|
65
64
|
const webComponentChildren = Object.values(slottedElements);
|
|
66
|
-
const appComponent = (0, _jsxRuntime.jsx)("slot", {});
|
|
67
65
|
const uiShellElement = (0, _renderReactInWebComponent.renderReactInWebComponent)({
|
|
68
66
|
getReactComponent: reactRootElements => (0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
|
|
69
|
-
fallback:
|
|
67
|
+
fallback: (0, _jsxRuntime.jsx)("div", {
|
|
68
|
+
"data-error": true
|
|
69
|
+
}),
|
|
70
70
|
onError: onError,
|
|
71
71
|
children: (0, _jsxRuntime.jsx)(_UiShell.UiShell, {
|
|
72
72
|
appBackgroundColor: appBackgroundColor,
|
|
73
73
|
appBackgroundContrastMode: appBackgroundContrastMode,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
appContainerScrollingMode: appContainerScrollingMode,
|
|
77
|
-
appRootElement: reactRootElements.appRootElement,
|
|
74
|
+
appElement: appElement,
|
|
75
|
+
appElementScrollingMode: appElementScrollingMode,
|
|
78
76
|
hasStandardAppContentPadding: hasStandardAppContentPadding,
|
|
79
77
|
initialVisibleSections: initialVisibleSections,
|
|
80
78
|
onError: onError,
|
|
@@ -83,17 +81,18 @@ const renderUiShell = ({
|
|
|
83
81
|
name: slotName
|
|
84
82
|
})])),
|
|
85
83
|
sideNavBackgroundColor: sideNavBackgroundColor,
|
|
86
|
-
stylesRootElement: reactRootElements.stylesRootElement,
|
|
87
84
|
subscribeToPropChanges: subscribeToPropChanges,
|
|
88
|
-
topNavBackgroundColor: topNavBackgroundColor
|
|
85
|
+
topNavBackgroundColor: topNavBackgroundColor,
|
|
86
|
+
uiShellAppElement: reactRootElements.appRootElement,
|
|
87
|
+
uiShellStylesElement: reactRootElements.stylesRootElement
|
|
89
88
|
})
|
|
90
89
|
}),
|
|
91
|
-
|
|
90
|
+
webComponentParentElement: parentElement,
|
|
92
91
|
webComponentChildren
|
|
93
92
|
});
|
|
94
|
-
|
|
93
|
+
parentElement.appendChild(appElement);
|
|
95
94
|
return {
|
|
96
|
-
|
|
95
|
+
appElement,
|
|
97
96
|
setComponentProps: publishAfterReactAppReadyForProps,
|
|
98
97
|
slottedElements,
|
|
99
98
|
uiShellElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderUiShell.cjs","names":["_reactErrorBoundary","require","_bufferLatest","_createMessageBus","_UiShell","_renderReactInWebComponent","_useHasUiShell","_jsxRuntime","optionalComponentSlotNames","exports","banners","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appContainerScrollingMode","appRootElement","explicitAppRootElement","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","sideNavBackgroundColor","topNavBackgroundColor","uiShellRootElement","document","createElement","setAttribute","uiShellDataAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","createMessageBus","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","bufferLatest","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","appContainerElement","appendChild","webComponentChildren","values","appComponent","jsx","uiShellElement","renderReactInWebComponent","getReactComponent","reactRootElements","ErrorBoundary","fallback","children","UiShell","onSubscriptionCreated","optionalComponents","name","stylesRootElement","webComponentRootElement","setComponentProps"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus } from \"./createMessageBus.js\";\nimport { UiShell, UiShellProps } from \"./UiShell.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\nimport { type UiShellNavComponentProps } from \"./UiShellContent.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appContainerScrollingMode,\n appRootElement: explicitAppRootElement,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n sideNavBackgroundColor,\n topNavBackgroundColor,\n uiShellRootElement,\n}: {\n /**\n * HTML element used as the root for a React app.\n */\n appRootElement?: HTMLDivElement;\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * HTML element used as the root for UI Shell.\n */\n uiShellRootElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appContainerScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"topNavBackgroundColor\"\n>) => {\n const appRootElement =\n explicitAppRootElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n uiShellRootElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n >;\n\n const appContainerElement = document.createElement(\"div\");\n appContainerElement.appendChild(appRootElement);\n\n const webComponentChildren = Object.values(slottedElements);\n\n const appComponent = <slot />;\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={appComponent} onError={onError}>\n <UiShell\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appComponent={appComponent}\n appContainerElement={appContainerElement}\n appContainerScrollingMode={appContainerScrollingMode}\n appRootElement={reactRootElements.appRootElement}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n stylesRootElement={reactRootElements.stylesRootElement}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n />\n </ErrorBoundary>\n ),\n webComponentRootElement: uiShellRootElement,\n webComponentChildren,\n });\n uiShellRootElement.appendChild(appContainerElement);\n\n return {\n appRootElement,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":";;;;;;AAaA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AAEA,IAAAK,cAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AApB1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,sBAAuB;QAC/CT,qBAAqB,EAAEA;MAAsB,CAC9C;IAAC,CACW,CAChB;IACDyC,uBAAuB,EAAExC,kBAAkB;IAC3CwB;EACF,CAAC,CAAC;EACFxB,kBAAkB,CAACuB,WAAW,CAACD,mBAAmB,CAAC;EAEnD,OAAO;IACL/B,cAAc;IACdkD,iBAAiB,EAAE7B,iCAAiC;IACpDE,eAAe;IACfc;EACF,CAAC;AACH,CAAC;AAAC9C,OAAA,CAAAK,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"renderUiShell.cjs","names":["_reactErrorBoundary","require","_bufferLatest","_createMessageBus","_UiShell","_useHasUiShell","_renderReactInWebComponent","_jsxRuntime","optionalComponentSlotNames","exports","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","parentElement","sideNavBackgroundColor","topNavBackgroundColor","document","createElement","setAttribute","uiShellDataAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","createMessageBus","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","bufferLatest","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","renderReactInWebComponent","getReactComponent","reactRootElements","jsx","ErrorBoundary","fallback","children","UiShell","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","appendChild","setComponentProps"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus } from \"./createMessageBus.js\";\nimport { UiShell, UiShellProps } from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n parentElement,\n sideNavBackgroundColor,\n topNavBackgroundColor,\n}: {\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n >;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentParentElement: parentElement,\n webComponentChildren,\n });\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":";;;;;;AAaA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AAA0F,IAAAM,WAAA,GAAAN,OAAA;AApB1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAMO,0BAGZ,GAAAC,OAAA,CAAAD,0BAAA,GAAG;EACFE,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,iBAAiB;EAChCC,aAAa,EAAE,iBAAiB;EAChCC,cAAc,EAAE,mBAAmB;EACnCC,eAAe,EAAE;AACnB,CAAC;AAWM,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU,EAAEC,kBAAkB;EAC9BC,uBAAuB;EACvBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,aAAa;EACbC,sBAAsB;EACtBC;AAoBwC,CAAC,KAAK;EAC9C,MAAMV,UAAU,GAAGC,kBAAkB,IAAIU,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGtEJ,aAAa,CAACK,YAAY,CAACC,mCAAoB,EAAE,EAAE,CAAC;EAEpD,MAAM;IAAEC,OAAO,EAAEC,kBAAkB;IAAEC,SAAS,EAAEC;EAAuB,CAAC,GACtE,IAAAC,kCAAgB,EAA2C,CAAC;EAE9D,MAAM;IACJJ,OAAO,EAAEK,0BAA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ACE,OAAO,CAACrC,0BAA0B,CAAC,CAACsC,GAAG,CAC5C,CAAC,CAACC,oBAAoB,EAAEC,QAAQ,CAAC,KAAK,CACpCD,oBAAoB,EACpB,IAAAxC,WAAA,CAAAiD,GAAA;UAAMO,IAAI,EAAEf;QAAS,CAAE,CAAC,CAE5B,CACF,CAAE;QACFrB,sBAAsB,EAAEA,sBAAuB;QAC/CS,sBAAsB,EAAEA,sBAAuB;QAC/CR,qBAAqB,EAAEA,qBAAsB;QAC7CoC,iBAAiB,EAAET,iBAAiB,CAACU,cAAe;QACpDC,oBAAoB,EAAEX,iBAAiB,CAACY;MAAkB,CAC3D;IAAC,CACW,CAChB;IACDC,yBAAyB,EAAE1C,aAAa;IACxCwB;EACF,CAAC,CAAC;EAEFxB,aAAa,CAAC2C,WAAW,CAACnD,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACVoD,iBAAiB,EAAE9B,iCAAiC;IACpDE,eAAe;IACfU;EACF,CAAC;AACH,CAAC;AAAC3C,OAAA,CAAAM,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.subComponentNames = void 0;
|
|
1
7
|
/*!
|
|
2
|
-
* Copyright (c)
|
|
8
|
+
* Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
9
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
10
|
*
|
|
5
11
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
@@ -10,14 +16,5 @@
|
|
|
10
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
17
|
*/
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type ChipElementType = "li" | "div";
|
|
16
|
-
|
|
17
|
-
export type TagListContextType = {
|
|
18
|
-
chipElementType: ChipElementType;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const TagListContext = createContext<TagListContextType>({
|
|
22
|
-
chipElementType: "div",
|
|
23
|
-
});
|
|
19
|
+
const subComponentNames = exports.subComponentNames = ["TopNav", "SideNav", "AppSwitcher"];
|
|
20
|
+
//# sourceMappingURL=uiShellContentTypes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uiShellContentTypes.cjs","names":["subComponentNames","exports"],"sources":["../../../src/ui-shell/uiShellContentTypes.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-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 { ReactElement } from \"react\";\nimport { ErrorBoundaryProps } from \"react-error-boundary\";\n\nimport { AppSwitcherProps } from \"./AppSwitcher/AppSwitcher.js\";\nimport { SideNavProps } from \"./SideNav/types.js\";\nimport { TopNavProps } from \"./TopNav/TopNav.js\";\n\nexport const subComponentNames = [\"TopNav\", \"SideNav\", \"AppSwitcher\"] as const;\nexport type SubComponentName = (typeof subComponentNames)[number];\n\nexport type UiShellNavComponentProps = {\n /**\n * Object that gets pass directly to the app switcher component.\n */\n appSwitcherProps?: AppSwitcherProps;\n /**\n * Object that gets pass directly to the side nav component. If `undefined` and in `initialVisibleSections`, SideNav will be initially rendered. Pass `null` to hide a previously-visible SideNav.\n */\n sideNavProps?: Omit<SideNavProps, \"footerComponent\"> | null;\n /**\n * Object that gets pass directly to the top nav component. If `undefined` and in `initialVisibleSections`, TopNav will be initially rendered. Pass `null` to hide a previously-visible TopNav.\n */\n topNavProps?: Omit<\n TopNavProps,\n \"leftSideComponent\" | \"rightSideComponent\"\n > | null;\n};\n\nexport type UiShellContentProps = {\n /**\n * **WARNING:** UI Shell will modify the styling of this element.\n * HTML element where the app gets rendered. This typically called the React root element for your app.\n *\n * When passed, the app is expected to render into this element, not the Shadow DOM.\n *\n * UI Shell will position this element appropriately to match the content area inside the Shadow DOM.\n *\n * A major benefit to having this element separate from UI Shell is related to encapsulation. UI Shell has the capability of rendering inside a web component, but in doing so, the app would be subject to the styles in the web component and not the page itself.\n * The app should either be in its own web component or use the global styles, and having this separate element allows us to accomplish that goal.\n */\n appElement: HTMLDivElement;\n /**\n * Controls the scrolling behavior of the app element area.\n *\n * In the case of an app wanting to control their own scrolling, use `\"none\"`.\n *\n * Most apps will want to use `\"vertical\"` and let UI Shell manage scrolling behavior.\n */\n appElementScrollingMode: \"none\" | \"horizontal\" | \"vertical\" | \"both\";\n /**\n * Defaults to `true`.\n *\n * If `false`, the content area will have no padding provided. This is for the case where an app wants to manage this separate from UI Shell.\n */\n hasStandardAppContentPadding?: boolean;\n /**\n * Parts of UI Shell that are visible when rendered.\n *\n * For example, if `sideNavProps` is `undefined`, should there be a space left for side nav or should that space not exist?\n */\n initialVisibleSections?: SubComponentName[];\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, flagging \"p0\"s, and recovering UI Shell when errors occur.\n */\n onError?: ErrorBoundaryProps[\"onError\"];\n /**\n * Components that will render as children of various other components such as the top nav or side nav.\n */\n optionalComponents?: {\n /**\n * Spot for banners to go at the top of the page.\n */\n banners?: ReactElement;\n /**\n * In narrow view, this is the right-side menu area.\n */\n rightSideMenu?: ReactElement;\n /**\n * Footer in the side nav.\n */\n sideNavFooter?: SideNavProps[\"footerComponent\"];\n /**\n * Top nav is divided into 2 parts. This is the left-aligned half.\n */\n topNavLeftSide?: TopNavProps[\"leftSideComponent\"];\n /**\n * Top nav is divided into 2 parts. This is the right-aligned half.\n */\n topNavRightSide?: TopNavProps[\"rightSideComponent\"];\n };\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASO,MAAMA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UI_SHELL_OVERLAY_Z_INDEX = exports.UI_SHELL_BASE_Z_INDEX = exports.TOP_NAV_HEIGHT = exports.SIDE_NAV_WIDTH = exports.SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION = void 0;
|
|
7
|
+
/*!
|
|
8
|
+
* Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
+
*
|
|
11
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
*
|
|
16
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
+
*/const SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION = exports.SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION = "77px";
|
|
18
|
+
const SIDE_NAV_WIDTH = exports.SIDE_NAV_WIDTH = "300px";
|
|
19
|
+
const TOP_NAV_HEIGHT = exports.TOP_NAV_HEIGHT = `${64 / 14}rem`;
|
|
20
|
+
const UI_SHELL_BASE_Z_INDEX = exports.UI_SHELL_BASE_Z_INDEX = 100;
|
|
21
|
+
const UI_SHELL_OVERLAY_Z_INDEX = exports.UI_SHELL_OVERLAY_Z_INDEX = 200;
|
|
22
|
+
//# sourceMappingURL=uiShellSharedConstants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uiShellSharedConstants.cjs","names":["SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION","exports","SIDE_NAV_WIDTH","TOP_NAV_HEIGHT","UI_SHELL_BASE_Z_INDEX","UI_SHELL_OVERLAY_Z_INDEX"],"sources":["../../../src/ui-shell/uiShellSharedConstants.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// It's important to bring all our constant values together, so we can change them in one location and ensure the values are all correct relative to each other.\n// This also lends us the capability of swapping these out for a more robust solution in the future.\n\n/* The side nav collapse icon is placed absolutely from the top (Logo container + nav header height) to align it in the middle of the nav header text */\nexport const SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION = \"77px\";\n\nexport const SIDE_NAV_WIDTH = \"300px\";\n\nexport const TOP_NAV_HEIGHT = `${64 / 14}rem`;\n\nexport const UI_SHELL_BASE_Z_INDEX = 100;\n\nexport const UI_SHELL_OVERLAY_Z_INDEX = 200;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAMO,MAAMA,wCAAwC,GAAAC,OAAA,CAAAD,wCAAA,GAAG,MAAM;AAEvD,MAAME,cAAc,GAAAD,OAAA,CAAAC,cAAA,GAAG,OAAO;AAE9B,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK;AAEtC,MAAMC,qBAAqB,GAAAH,OAAA,CAAAG,qBAAA,GAAG,GAAG;AAEjC,MAAMC,wBAAwB,GAAAJ,OAAA,CAAAI,wBAAA,GAAG,GAAG","ignoreList":[]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMatchAppElementToUiShellAppArea = exports.setStylesToMatchElement = exports.convertCamelCaseToKebabCase = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _OdysseyDesignTokensContext = require("../OdysseyDesignTokensContext.cjs");
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
11
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
12
|
+
*
|
|
13
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
16
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
*
|
|
18
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const convertCamelCaseToKebabCase = string => string.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
22
|
+
exports.convertCamelCaseToKebabCase = convertCamelCaseToKebabCase;
|
|
23
|
+
const setStylesToMatchElement = ({
|
|
24
|
+
additionalStyles,
|
|
25
|
+
appContainerElement,
|
|
26
|
+
appContentReferenceElement,
|
|
27
|
+
parentElement
|
|
28
|
+
}) => {
|
|
29
|
+
const appContentReferenceRectangle = appContentReferenceElement.getBoundingClientRect();
|
|
30
|
+
const parentElementRectangle = parentElement.getBoundingClientRect();
|
|
31
|
+
appContainerElement.style.setProperty("position", "absolute");
|
|
32
|
+
appContainerElement.style.setProperty("top", `${appContentReferenceRectangle.top - parentElementRectangle.top}px`);
|
|
33
|
+
appContainerElement.style.setProperty("left", `${appContentReferenceRectangle.left - parentElementRectangle.left}px`);
|
|
34
|
+
appContainerElement.style.setProperty("width", `${appContentReferenceRectangle.width}px`);
|
|
35
|
+
appContainerElement.style.setProperty("height", `${appContentReferenceRectangle.height}px`);
|
|
36
|
+
appContainerElement.style.setProperty("z-index", "1");
|
|
37
|
+
Object.entries(additionalStyles).forEach(([cssPropertyName, cssPropertyValue]) => {
|
|
38
|
+
appContainerElement.style.setProperty(convertCamelCaseToKebabCase(cssPropertyName), String(cssPropertyValue));
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.setStylesToMatchElement = setStylesToMatchElement;
|
|
42
|
+
const useMatchAppElementToUiShellAppArea = ({
|
|
43
|
+
appElement,
|
|
44
|
+
appElementScrollingMode,
|
|
45
|
+
paddingMode,
|
|
46
|
+
uiShellAppAreaRef,
|
|
47
|
+
uiShellResizableRefs
|
|
48
|
+
}) => {
|
|
49
|
+
const odysseyDesignTokens = (0, _OdysseyDesignTokensContext.useOdysseyDesignTokens)();
|
|
50
|
+
const parentContainerRef = (0, _react.useRef)(null);
|
|
51
|
+
const appContainerElementStyles = (0, _react.useMemo)(() => ({
|
|
52
|
+
...(paddingMode === "comfortable" ? {
|
|
53
|
+
paddingBlock: odysseyDesignTokens.Spacing5,
|
|
54
|
+
paddingInline: odysseyDesignTokens.Spacing8
|
|
55
|
+
} : {}),
|
|
56
|
+
...(paddingMode === "compact" ? {
|
|
57
|
+
paddingBlock: odysseyDesignTokens.Spacing5,
|
|
58
|
+
paddingInline: odysseyDesignTokens.Spacing5
|
|
59
|
+
} : {}),
|
|
60
|
+
...(appElementScrollingMode === "horizontal" || appElementScrollingMode === "both" ? {
|
|
61
|
+
overflowX: "auto"
|
|
62
|
+
} : {
|
|
63
|
+
overflowX: "hidden"
|
|
64
|
+
}),
|
|
65
|
+
...(appElementScrollingMode === "vertical" || appElementScrollingMode === "both" ? {
|
|
66
|
+
overflowY: "auto"
|
|
67
|
+
} : {
|
|
68
|
+
overflowY: "hidden"
|
|
69
|
+
})
|
|
70
|
+
}), [appElementScrollingMode, paddingMode, odysseyDesignTokens]);
|
|
71
|
+
(0, _react.useEffect)(() => {
|
|
72
|
+
if (uiShellAppAreaRef.current && appElement && parentContainerRef.current) {
|
|
73
|
+
let animationFrameId;
|
|
74
|
+
const updateStyles = () => {
|
|
75
|
+
cancelAnimationFrame(animationFrameId);
|
|
76
|
+
animationFrameId = requestAnimationFrame(() => {
|
|
77
|
+
if (uiShellAppAreaRef.current && parentContainerRef.current) {
|
|
78
|
+
setStylesToMatchElement({
|
|
79
|
+
additionalStyles: appContainerElementStyles,
|
|
80
|
+
appContentReferenceElement: uiShellAppAreaRef.current,
|
|
81
|
+
appContainerElement: appElement,
|
|
82
|
+
parentElement: parentContainerRef.current
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const resizingElements = uiShellResizableRefs.map(resizingRef => resizingRef.current).filter(element => Boolean(element));
|
|
88
|
+
const observer = new ResizeObserver(updateStyles);
|
|
89
|
+
resizingElements.forEach(resizingElement => {
|
|
90
|
+
resizingElement.addEventListener("transitionend", updateStyles);
|
|
91
|
+
observer.observe(resizingElement);
|
|
92
|
+
});
|
|
93
|
+
updateStyles();
|
|
94
|
+
return () => {
|
|
95
|
+
observer.disconnect();
|
|
96
|
+
resizingElements.forEach(resizingElement => {
|
|
97
|
+
resizingElement.removeEventListener("transitionend", updateStyles);
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return () => {};
|
|
102
|
+
}, [appElement, appContainerElementStyles, uiShellAppAreaRef]);
|
|
103
|
+
return {
|
|
104
|
+
parentContainerRef
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
exports.useMatchAppElementToUiShellAppArea = useMatchAppElementToUiShellAppArea;
|
|
108
|
+
//# sourceMappingURL=useMatchAppElementToUiShellAppArea.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchAppElementToUiShellAppArea.cjs","names":["_react","require","_OdysseyDesignTokensContext","convertCamelCaseToKebabCase","string","replace","toLowerCase","exports","setStylesToMatchElement","additionalStyles","appContainerElement","appContentReferenceElement","parentElement","appContentReferenceRectangle","getBoundingClientRect","parentElementRectangle","style","setProperty","top","left","width","height","Object","entries","forEach","cssPropertyName","cssPropertyValue","String","useMatchAppElementToUiShellAppArea","appElement","appElementScrollingMode","paddingMode","uiShellAppAreaRef","uiShellResizableRefs","odysseyDesignTokens","useOdysseyDesignTokens","parentContainerRef","useRef","appContainerElementStyles","useMemo","paddingBlock","Spacing5","paddingInline","Spacing8","overflowX","overflowY","useEffect","current","animationFrameId","updateStyles","cancelAnimationFrame","requestAnimationFrame","resizingElements","map","resizingRef","filter","element","Boolean","observer","ResizeObserver","resizingElement","addEventListener","observe","disconnect","removeEventListener"],"sources":["../../../src/ui-shell/useMatchAppElementToUiShellAppArea.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-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 { CSSProperties, RefObject, useEffect, useMemo, useRef } from \"react\";\n\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { UiShellContentProps } from \"./uiShellContentTypes.js\";\n\nexport const convertCamelCaseToKebabCase = (string: string) =>\n string.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n\nexport const setStylesToMatchElement = ({\n additionalStyles,\n appContainerElement,\n appContentReferenceElement,\n parentElement,\n}: {\n additionalStyles: CSSProperties;\n appContainerElement: HTMLElement;\n appContentReferenceElement: HTMLElement;\n parentElement: HTMLElement;\n}) => {\n const appContentReferenceRectangle =\n appContentReferenceElement.getBoundingClientRect();\n const parentElementRectangle = parentElement.getBoundingClientRect();\n\n appContainerElement.style.setProperty(\"position\", \"absolute\");\n appContainerElement.style.setProperty(\n \"top\",\n `${appContentReferenceRectangle.top - parentElementRectangle.top}px`,\n );\n appContainerElement.style.setProperty(\n \"left\",\n `${appContentReferenceRectangle.left - parentElementRectangle.left}px`,\n );\n appContainerElement.style.setProperty(\n \"width\",\n `${appContentReferenceRectangle.width}px`,\n );\n appContainerElement.style.setProperty(\n \"height\",\n `${appContentReferenceRectangle.height}px`,\n );\n appContainerElement.style.setProperty(\"z-index\", \"1\");\n\n (\n Object.entries(additionalStyles) as Array<\n [\n keyof typeof additionalStyles,\n (typeof additionalStyles)[keyof typeof additionalStyles],\n ]\n >\n ).forEach(([cssPropertyName, cssPropertyValue]) => {\n appContainerElement.style.setProperty(\n convertCamelCaseToKebabCase(cssPropertyName),\n String(cssPropertyValue),\n );\n });\n};\n\nexport type UseMatchAppElementToUiShellAppAreaProps = {\n /**\n * Padding around the app area. \"comfortable\" is designed for wider views whereas \"compact\" is designed for narrower views.\n */\n paddingMode: \"comfortable\" | \"compact\" | \"none\";\n /**\n * Ref for the App Container in UI Shell. This should be the one inside the Shell, **not** the element we're going to align.\n */\n uiShellAppAreaRef: RefObject<HTMLDivElement>;\n /**\n * Array of refs of items that indirectly resize the app content area such as \"side nav\" and \"top nav\".\n */\n uiShellResizableRefs: Array<RefObject<HTMLDivElement>>;\n} & Pick<UiShellContentProps, \"appElement\" | \"appElementScrollingMode\">;\n\nexport const useMatchAppElementToUiShellAppArea = ({\n appElement,\n appElementScrollingMode,\n paddingMode,\n uiShellAppAreaRef,\n uiShellResizableRefs,\n}: UseMatchAppElementToUiShellAppAreaProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const parentContainerRef = useRef<HTMLDivElement>(null);\n\n const appContainerElementStyles = useMemo<CSSProperties>(\n () => ({\n ...(paddingMode === \"comfortable\"\n ? {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing8,\n }\n : {}),\n ...(paddingMode === \"compact\"\n ? {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing5,\n }\n : {}),\n ...(appElementScrollingMode === \"horizontal\" ||\n appElementScrollingMode === \"both\"\n ? {\n overflowX: \"auto\",\n }\n : {\n overflowX: \"hidden\",\n }),\n ...(appElementScrollingMode === \"vertical\" ||\n appElementScrollingMode === \"both\"\n ? {\n overflowY: \"auto\",\n }\n : {\n overflowY: \"hidden\",\n }),\n }),\n [appElementScrollingMode, paddingMode, odysseyDesignTokens],\n );\n\n useEffect(() => {\n // Once `appContainerRef` is rendered, we can position `appContainerElement` on top to match.\n if (uiShellAppAreaRef.current && appElement && parentContainerRef.current) {\n let animationFrameId: number;\n\n const updateStyles = () => {\n cancelAnimationFrame(animationFrameId);\n\n animationFrameId = requestAnimationFrame(() => {\n if (uiShellAppAreaRef.current && parentContainerRef.current) {\n setStylesToMatchElement({\n additionalStyles: appContainerElementStyles,\n appContentReferenceElement: uiShellAppAreaRef.current,\n appContainerElement: appElement,\n parentElement: parentContainerRef.current,\n });\n }\n });\n };\n\n // These refs might change by the time we unsubscribe, so we need to keep references to the original elements.\n const resizingElements = uiShellResizableRefs\n .map((resizingRef) => resizingRef.current)\n .filter((element): element is NonNullable<typeof element> =>\n Boolean(element),\n );\n\n // Set up a mutation observer to sync later updates\n const observer = new ResizeObserver(updateStyles);\n\n // document.addEventListener(\"ready\", updateStyles);\n\n resizingElements.forEach((resizingElement) => {\n resizingElement.addEventListener(\"transitionend\", updateStyles);\n\n observer.observe(resizingElement);\n });\n\n // Set the initial styles\n updateStyles();\n\n return () => {\n observer.disconnect();\n\n resizingElements.forEach((resizingElement) => {\n resizingElement.removeEventListener(\"transitionend\", updateStyles);\n });\n };\n }\n return () => {};\n }, [appElement, appContainerElementStyles, uiShellAppAreaRef]);\n\n return {\n parentContainerRef,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,2BAAA,GAAAD,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,MAAME,2BAA2B,GAAIC,MAAc,IACxDA,MAAM,CAACC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAACC,WAAW,CAAC,CAAC;AAACC,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA;AAE3C,MAAMK,uBAAuB,GAAGA,CAAC;EACtCC,gBAAgB;EAChBC,mBAAmB;EACnBC,0BAA0B;EAC1BC;AAMF,CAAC,KAAK;EACJ,MAAMC,4BAA4B,GAChCF,0BAA0B,CAACG,qBAAqB,CAAC,CAAC;EACpD,MAAMC,sBAAsB,GAAGH,aAAa,CAACE,qBAAqB,CAAC,CAAC;EAEpEJ,mBAAmB,CAACM,KAAK,CAACC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC;EAC7DP,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,KAAK,EACL,GAAGJ,4BAA4B,CAACK,GAAG,GAAGH,sBAAsB,CAACG,GAAG,IAClE,CAAC;EACDR,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,MAAM,EACN,GAAGJ,4BAA4B,CAACM,IAAI,GAAGJ,sBAAsB,CAACI,IAAI,IACpE,CAAC;EACDT,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,OAAO,EACP,GAAGJ,4BAA4B,CAACO,KAAK,IACvC,CAAC;EACDV,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,QAAQ,EACR,GAAGJ,4BAA4B,CAACQ,MAAM,IACxC,CAAC;EACDX,mBA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OAAO,MAAM,CAAC,CAAC;EACjB,CAAC,EAAE,CAACpB,UAAU,EAAES,yBAAyB,EAAEN,iBAAiB,CAAC,CAAC;EAE9D,OAAO;IACLI;EACF,CAAC;AACH,CAAC;AAAC7B,OAAA,CAAAqB,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
|
@@ -19,8 +19,7 @@ var _react = require("react");
|
|
|
19
19
|
|
|
20
20
|
const useScrollState = scrollableContentElement => {
|
|
21
21
|
const [isContentScrolled, setIsContentScrolled] = (0, _react.useState)(false);
|
|
22
|
-
const
|
|
23
|
-
const scrollableElement = (0, _react.useMemo)(() => scrollableContentElement ?? scrollableContentRef.current, [scrollableContentElement, scrollableContentRef.current]);
|
|
22
|
+
const scrollableElement = (0, _react.useMemo)(() => scrollableContentElement, [scrollableContentElement]);
|
|
24
23
|
(0, _react.useEffect)(() => {
|
|
25
24
|
if (scrollableElement) {
|
|
26
25
|
let requestedAnimationFrameId;
|
|
@@ -40,8 +39,7 @@ const useScrollState = scrollableContentElement => {
|
|
|
40
39
|
return () => {};
|
|
41
40
|
}, [scrollableElement]);
|
|
42
41
|
return {
|
|
43
|
-
isContentScrolled
|
|
44
|
-
scrollableContentRef
|
|
42
|
+
isContentScrolled
|
|
45
43
|
};
|
|
46
44
|
};
|
|
47
45
|
exports.useScrollState = useScrollState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollState.cjs","names":["_react","require","useScrollState","scrollableContentElement","isContentScrolled","setIsContentScrolled","useState","
|
|
1
|
+
{"version":3,"file":"useScrollState.cjs","names":["_react","require","useScrollState","scrollableContentElement","isContentScrolled","setIsContentScrolled","useState","scrollableElement","useMemo","useEffect","requestedAnimationFrameId","updateScrollState","cancelAnimationFrame","requestAnimationFrame","scrollTop","addEventListener","removeEventListener","exports"],"sources":["../../../src/ui-shell/useScrollState.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useEffect, useMemo, useState } from \"react\";\n\nexport const useScrollState = <\n ScrollableContentElement extends HTMLElement = HTMLDivElement,\n>(\n scrollableContentElement?: ScrollableContentElement,\n) => {\n const [isContentScrolled, setIsContentScrolled] = useState(false);\n\n const scrollableElement = useMemo(\n () => scrollableContentElement,\n [scrollableContentElement],\n );\n\n useEffect(() => {\n if (scrollableElement) {\n let requestedAnimationFrameId: number;\n\n const updateScrollState = () => {\n cancelAnimationFrame(requestedAnimationFrameId);\n\n requestedAnimationFrameId = requestAnimationFrame(() => {\n setIsContentScrolled(scrollableElement.scrollTop > 0);\n });\n };\n\n scrollableElement.addEventListener(\"scroll\", updateScrollState);\n\n updateScrollState();\n\n return () => {\n scrollableElement.removeEventListener(\"scroll\", updateScrollState);\n\n cancelAnimationFrame(requestedAnimationFrameId);\n };\n }\n\n return () => {};\n }, [scrollableElement]);\n\n return {\n isContentScrolled,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMC,cAAc,GAGzBC,wBAAmD,IAChD;EACH,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEjE,MAAMC,iBAAiB,GAAG,IAAAC,cAAO,EAC/B,MAAML,wBAAwB,EAC9B,CAACA,wBAAwB,CAC3B,CAAC;EAED,IAAAM,gBAAS,EAAC,MAAM;IACd,IAAIF,iBAAiB,EAAE;MACrB,IAAIG,yBAAiC;MAErC,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;QAC9BC,oBAAoB,CAACF,yBAAyB,CAAC;QAE/CA,yBAAyB,GAAGG,qBAAqB,CAAC,MAAM;UACtDR,oBAAoB,CAACE,iBAAiB,CAACO,SAAS,GAAG,CAAC,CAAC;QACvD,CAAC,CAAC;MACJ,CAAC;MAEDP,iBAAiB,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,iBAAiB,CAAC;MAE/DA,iBAAiB,CAAC,CAAC;MAEnB,OAAO,MAAM;QACXJ,iBAAiB,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,iBAAiB,CAAC;QAElEC,oBAAoB,CAACF,yBAAyB,CAAC;MACjD,CAAC;IACH;IAEA,OAAO,MAAM,CAAC,CAAC;EACjB,CAAC,EAAE,CAACH,iBAAiB,CAAC,CAAC;EAEvB,OAAO;IACLH;EACF,CAAC;AACH,CAAC;AAACa,OAAA,CAAAf,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUiShellBreakpoints = exports.uiShellBreakpoint = void 0;
|
|
7
|
+
var _useMediaQuery = require("../theme/useMediaQuery.cjs");
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
11
|
+
*
|
|
12
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
15
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
*
|
|
17
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const uiShellBreakpoint = exports.uiShellBreakpoint = {
|
|
21
|
+
comfortable: 800,
|
|
22
|
+
compact: 600,
|
|
23
|
+
constrained: 0
|
|
24
|
+
};
|
|
25
|
+
const useUiShellBreakpoints = () => {
|
|
26
|
+
const isConstrainedView = (0, _useMediaQuery.useMediaQuery)(`(min-width: ${uiShellBreakpoint.constrained}px)`);
|
|
27
|
+
const isCompactView = (0, _useMediaQuery.useMediaQuery)(`(min-width: ${uiShellBreakpoint.compact}px)`);
|
|
28
|
+
const isComfortableView = (0, _useMediaQuery.useMediaQuery)(`(min-width: ${uiShellBreakpoint.comfortable}px)`);
|
|
29
|
+
if (isComfortableView) {
|
|
30
|
+
return "comfortable";
|
|
31
|
+
}
|
|
32
|
+
if (isCompactView) {
|
|
33
|
+
return "compact";
|
|
34
|
+
}
|
|
35
|
+
if (isConstrainedView) {
|
|
36
|
+
return "constrained";
|
|
37
|
+
}
|
|
38
|
+
return "none";
|
|
39
|
+
};
|
|
40
|
+
exports.useUiShellBreakpoints = useUiShellBreakpoints;
|
|
41
|
+
//# sourceMappingURL=useUiShellBreakpoints.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUiShellBreakpoints.cjs","names":["_useMediaQuery","require","uiShellBreakpoint","exports","comfortable","compact","constrained","useUiShellBreakpoints","isConstrainedView","useMediaQuery","isCompactView","isComfortableView"],"sources":["../../../src/ui-shell/useUiShellBreakpoints.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-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 { useMediaQuery } from \"../theme/useMediaQuery.js\";\n\nexport const uiShellBreakpoint = {\n comfortable: 800,\n compact: 600,\n constrained: 0,\n} as const;\n\nexport const useUiShellBreakpoints = ():\n | keyof typeof uiShellBreakpoint\n | \"none\" => {\n const isConstrainedView = useMediaQuery(\n `(min-width: ${uiShellBreakpoint.constrained}px)`,\n );\n\n const isCompactView = useMediaQuery(\n `(min-width: ${uiShellBreakpoint.compact}px)`,\n );\n\n const isComfortableView = useMediaQuery(\n `(min-width: ${uiShellBreakpoint.comfortable}px)`,\n );\n\n if (isComfortableView) {\n return \"comfortable\";\n }\n\n if (isCompactView) {\n return \"compact\";\n }\n\n if (isConstrainedView) {\n return \"constrained\";\n }\n\n // For the initial page load as we don't have media queries until the page loads.\n return \"none\";\n};\n"],"mappings":";;;;;;AAYA,IAAAA,cAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,WAAW,EAAE,GAAG;EAChBC,OAAO,EAAE,GAAG;EACZC,WAAW,EAAE;AACf,CAAU;AAEH,MAAMC,qBAAqB,GAAGA,CAAA,KAEvB;EACZ,MAAMC,iBAAiB,GAAG,IAAAC,4BAAa,EACrC,eAAeP,iBAAiB,CAACI,WAAW,KAC9C,CAAC;EAED,MAAMI,aAAa,GAAG,IAAAD,4BAAa,EACjC,eAAeP,iBAAiB,CAACG,OAAO,KAC1C,CAAC;EAED,MAAMM,iBAAiB,GAAG,IAAAF,4BAAa,EACrC,eAAeP,iBAAiB,CAACE,WAAW,KAC9C,CAAC;EAED,IAAIO,iBAAiB,EAAE;IACrB,OAAO,aAAa;EACtB;EAEA,IAAID,aAAa,EAAE;IACjB,OAAO,SAAS;EAClB;EAEA,IAAIF,iBAAiB,EAAE;IACrB,OAAO,aAAa;EACtB;EAGA,OAAO,MAAM;AACf,CAAC;AAACL,OAAA,CAAAI,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -70,7 +70,7 @@ const useContrastMode = ({
|
|
|
70
70
|
setContrastMode(newBgColor === Tokens.HueNeutral50 ? "highContrast" : "lowContrast");
|
|
71
71
|
}
|
|
72
72
|
}, [explicitContrastMode]);
|
|
73
|
-
(0, _react.
|
|
73
|
+
(0, _react.useEffect)(() => {
|
|
74
74
|
const observer = new MutationObserver(updateBackgroundColor);
|
|
75
75
|
observer.observe(document.querySelector("html"), {
|
|
76
76
|
attributes: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContrastMode.cjs","names":["_react","require","Tokens","_interopRequireWildcard","_hexToRgb","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ContrastModeContext","exports","createContext","contrastMode","defaultContrast","useContrastModeContext","useContext","hueNeutral50Rgb","hexToRgb","HueNeutral50","asFormattedString","isTransparentColor","color","normalizeRgbaToRgb","rgba","replace","getElementComputedBackgroundColor","element","window","getComputedStyle","backgroundColor","normalizeBackgroundColor","bgColor","test","normalizedColor","defaultParentBackgroundColor","getBackgroundColor","parentElement","useContrastMode","explicitContrastMode","contrastContainerRef","useRef","existingContrastMode","parentBackgroundColor","setParentBackgroundColor","useState","setContrastMode","updateBackgroundColor","useCallback","newBgColor","current","useLayoutEffect","observer","MutationObserver","observe","document","querySelector","attributes","attributeFilter","head","childList","subtree","onTransitionEnd","event","propertyName","addEventListener","removeEventListener","disconnect"],"sources":["../../src/useContrastMode.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n useContext,\n useRef,\n useLayoutEffect,\n useState,\n useCallback,\n} from \"react\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\n\nimport { hexToRgb } from \"./hexToRgb.js\";\n\nexport type ContrastMode = \"lowContrast\" | \"highContrast\";\nexport type ContrastModeContextType = {\n contrastMode: ContrastMode;\n};\n\nexport const ContrastModeContext = createContext<ContrastModeContextType>({\n contrastMode: \"lowContrast\",\n});\n\nexport const defaultContrast = \"lowContrast\";\n\nexport const useContrastModeContext = () => useContext(ContrastModeContext);\n\nexport const hueNeutral50Rgb = hexToRgb(Tokens.HueNeutral50).asFormattedString;\n\nexport const isTransparentColor = (color: string) =>\n color === \"rgba(0, 0, 0, 0)\" || color === \"transparent\";\n\nexport const normalizeRgbaToRgb = (rgba: string) =>\n rgba.replace(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/, \"rgb($1, $2, $3)\");\n\nexport const getElementComputedBackgroundColor = (\n element: HTMLElement,\n): string => window.getComputedStyle(element).backgroundColor;\n\nexport const normalizeBackgroundColor = (bgColor: string): string => {\n if (/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/.test(bgColor)) {\n const normalizedColor = normalizeRgbaToRgb(bgColor);\n return normalizedColor === hueNeutral50Rgb\n ? Tokens.HueNeutral50\n : normalizedColor;\n }\n\n return bgColor === hueNeutral50Rgb ? Tokens.HueNeutral50 : bgColor;\n};\n\nexport const defaultParentBackgroundColor = \"#ffffff\";\n\n/**\n * Determines the effective background color of an element.\n *\n * @param element - The HTML element to check.\n * @returns The effective background color. Returns defaultParentBackgroundColor if no non-transparent background is found.\n *\n * Note:\n * - Low contrast mode is used for white background (defaultParentBackgroundColor or HueNeutralWhite).\n * - High contrast mode is used for gray background (#f4f4f4 or HueNeutral50).\n */\nexport const getBackgroundColor = (element: HTMLElement | null): string => {\n while (element) {\n const bgColor = getElementComputedBackgroundColor(element);\n if (!isTransparentColor(bgColor)) {\n return normalizeBackgroundColor(bgColor);\n }\n element = element.parentElement;\n }\n return defaultParentBackgroundColor; // Default to white/low contrast if no background color is found\n};\n\ntype UseContrastModeProps = {\n contrastMode?: ContrastMode;\n};\n\nexport const useContrastMode = ({\n contrastMode: explicitContrastMode,\n}: UseContrastModeProps) => {\n const contrastContainerRef = useRef<HTMLDivElement>(null);\n const { contrastMode: existingContrastMode } = useContrastModeContext();\n\n const [parentBackgroundColor, setParentBackgroundColor] = useState(\n defaultParentBackgroundColor,\n );\n const [contrastMode, setContrastMode] = useState<ContrastMode>(\n () => explicitContrastMode || existingContrastMode,\n );\n\n const updateBackgroundColor = useCallback(() => {\n const newBgColor = getBackgroundColor(contrastContainerRef.current);\n setParentBackgroundColor(newBgColor);\n\n if (!explicitContrastMode) {\n setContrastMode(\n newBgColor === Tokens.HueNeutral50 ? \"highContrast\" : \"lowContrast\",\n );\n }\n }, [explicitContrastMode]);\n\n useLayoutEffect(() => {\n const observer = new MutationObserver(updateBackgroundColor);\n observer.observe(document.querySelector(\"html\") as HTMLHtmlElement, {\n attributes: true,\n attributeFilter: [\"class\", \"style\"],\n });\n observer.observe(document.head, {\n childList: true,\n subtree: true,\n });\n\n const onTransitionEnd = (event: TransitionEvent) => {\n if (event.propertyName === \"background-color\") {\n updateBackgroundColor();\n }\n };\n\n document.addEventListener(\"transitionend\", onTransitionEnd);\n updateBackgroundColor();\n\n return () => {\n document.removeEventListener(\"transitionend\", onTransitionEnd);\n observer.disconnect();\n };\n }, [updateBackgroundColor]);\n\n return {\n contrastContainerRef,\n contrastMode,\n parentBackgroundColor,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAAyC,SAAAI,yBAAAC,CAAA,6B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,QAAQ,CAACI,IAAI,EAAE;MAC9BC,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IAEF,MAAMC,eAAe,GAAIC,KAAsB,IAAK;MAClD,IAAIA,KAAK,CAACC,YAAY,KAAK,kBAAkB,EAAE;QAC7CjB,qBAAqB,CAAC,CAAC;MACzB;IACF,CAAC;IAEDQ,QAAQ,CAACU,gBAAgB,CAAC,eAAe,EAAEH,eAAe,CAAC;IAC3Df,qBAAqB,CAAC,CAAC;IAEvB,OAAO,MAAM;MACXQ,QAAQ,CAACW,mBAAmB,CAAC,eAAe,EAAEJ,eAAe,CAAC;MAC9DV,QAAQ,CAACe,UAAU,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAACpB,qBAAqB,CAAC,CAAC;EAE3B,OAAO;IACLP,oBAAoB;IACpB3B,YAAY;IACZ8B;EACF,CAAC;AACH,CAAC;AAAChC,OAAA,CAAA2B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useContrastMode.cjs","names":["_react","require","Tokens","_interopRequireWildcard","_hexToRgb","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ContrastModeContext","exports","createContext","contrastMode","defaultContrast","useContrastModeContext","useContext","hueNeutral50Rgb","hexToRgb","HueNeutral50","asFormattedString","isTransparentColor","color","normalizeRgbaToRgb","rgba","replace","getElementComputedBackgroundColor","element","window","getComputedStyle","backgroundColor","normalizeBackgroundColor","bgColor","test","normalizedColor","defaultParentBackgroundColor","getBackgroundColor","parentElement","useContrastMode","explicitContrastMode","contrastContainerRef","useRef","existingContrastMode","parentBackgroundColor","setParentBackgroundColor","useState","setContrastMode","updateBackgroundColor","useCallback","newBgColor","current","useEffect","observer","MutationObserver","observe","document","querySelector","attributes","attributeFilter","head","childList","subtree","onTransitionEnd","event","propertyName","addEventListener","removeEventListener","disconnect"],"sources":["../../src/useContrastMode.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\n\nimport { hexToRgb } from \"./hexToRgb.js\";\n\nexport type ContrastMode = \"lowContrast\" | \"highContrast\";\nexport type ContrastModeContextType = {\n contrastMode: ContrastMode;\n};\n\nexport const ContrastModeContext = createContext<ContrastModeContextType>({\n contrastMode: \"lowContrast\",\n});\n\nexport const defaultContrast = \"lowContrast\";\n\nexport const useContrastModeContext = () => useContext(ContrastModeContext);\n\nexport const hueNeutral50Rgb = hexToRgb(Tokens.HueNeutral50).asFormattedString;\n\nexport const isTransparentColor = (color: string) =>\n color === \"rgba(0, 0, 0, 0)\" || color === \"transparent\";\n\nexport const normalizeRgbaToRgb = (rgba: string) =>\n rgba.replace(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/, \"rgb($1, $2, $3)\");\n\nexport const getElementComputedBackgroundColor = (\n element: HTMLElement,\n): string => window.getComputedStyle(element).backgroundColor;\n\nexport const normalizeBackgroundColor = (bgColor: string): string => {\n if (/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/.test(bgColor)) {\n const normalizedColor = normalizeRgbaToRgb(bgColor);\n return normalizedColor === hueNeutral50Rgb\n ? Tokens.HueNeutral50\n : normalizedColor;\n }\n\n return bgColor === hueNeutral50Rgb ? Tokens.HueNeutral50 : bgColor;\n};\n\nexport const defaultParentBackgroundColor = \"#ffffff\";\n\n/**\n * Determines the effective background color of an element.\n *\n * @param element - The HTML element to check.\n * @returns The effective background color. Returns defaultParentBackgroundColor if no non-transparent background is found.\n *\n * Note:\n * - Low contrast mode is used for white background (defaultParentBackgroundColor or HueNeutralWhite).\n * - High contrast mode is used for gray background (#f4f4f4 or HueNeutral50).\n */\nexport const getBackgroundColor = (element: HTMLElement | null): string => {\n while (element) {\n const bgColor = getElementComputedBackgroundColor(element);\n if (!isTransparentColor(bgColor)) {\n return normalizeBackgroundColor(bgColor);\n }\n element = element.parentElement;\n }\n return defaultParentBackgroundColor; // Default to white/low contrast if no background color is found\n};\n\ntype UseContrastModeProps = {\n contrastMode?: ContrastMode;\n};\n\nexport const useContrastMode = ({\n contrastMode: explicitContrastMode,\n}: UseContrastModeProps) => {\n const contrastContainerRef = useRef<HTMLDivElement>(null);\n const { contrastMode: existingContrastMode } = useContrastModeContext();\n\n const [parentBackgroundColor, setParentBackgroundColor] = useState(\n defaultParentBackgroundColor,\n );\n const [contrastMode, setContrastMode] = useState<ContrastMode>(\n () => explicitContrastMode || existingContrastMode,\n );\n\n const updateBackgroundColor = useCallback(() => {\n const newBgColor = getBackgroundColor(contrastContainerRef.current);\n setParentBackgroundColor(newBgColor);\n\n if (!explicitContrastMode) {\n setContrastMode(\n newBgColor === Tokens.HueNeutral50 ? \"highContrast\" : \"lowContrast\",\n );\n }\n }, [explicitContrastMode]);\n\n useEffect(() => {\n const observer = new MutationObserver(updateBackgroundColor);\n observer.observe(document.querySelector(\"html\") as HTMLHtmlElement, {\n attributes: true,\n attributeFilter: [\"class\", \"style\"],\n });\n observer.observe(document.head, {\n childList: true,\n subtree: true,\n });\n\n const onTransitionEnd = (event: TransitionEvent) => {\n if (event.propertyName === \"background-color\") {\n updateBackgroundColor();\n }\n };\n\n document.addEventListener(\"transitionend\", onTransitionEnd);\n updateBackgroundColor();\n\n return () => {\n document.removeEventListener(\"transitionend\", onTransit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,MAAMC,QAAQ,GAAG,IAAIC,gBAAgB,CAACN,qBAAqB,CAAC;IAC5DK,QAAQ,CAACE,OAAO,CAACC,QAAQ,CAACC,aAAa,CAAC,MAAM,CAAC,EAAqB;MAClEC,UAAU,EAAE,IAAI;MAChBC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO;IACpC,CAAC,CAAC;IACFN,QAAQ,CAACE,OAAO,CAACC,QAAQ,CAACI,IAAI,EAAE;MAC9BC,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IAEF,MAAMC,eAAe,GAAIC,KAAsB,IAAK;MAClD,IAAIA,KAAK,CAACC,YAAY,KAAK,kBAAkB,EAAE;QAC7CjB,qBAAqB,CAAC,CAAC;MACzB;IACF,CAAC;IAEDQ,QAAQ,CAACU,gBAAgB,CAAC,eAAe,EAAEH,eAAe,CAAC;IAC3Df,qBAAqB,CAAC,CAAC;IAEvB,OAAO,MAAM;MACXQ,QAAQ,CAACW,mBAAmB,CAAC,eAAe,EAAEJ,eAAe,CAAC;MAC9DV,QAAQ,CAACe,UAAU,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAACpB,qBAAqB,CAAC,CAAC;EAE3B,OAAO;IACLP,oBAAoB;IACpB3B,YAAY;IACZ8B;EACF,CAAC;AACH,CAAC;AAAChC,OAAA,CAAA2B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createReactRootElements.cjs","names":["createReactRootElements","appRootElement","document","createElement","stylesRootElement","style","setProperty","setAttribute","window","cspNonce","exports"],"sources":["../../../src/web-component/createReactRootElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport const createReactRootElements = () => {\n const appRootElement = document.createElement(\"div\");\n const stylesRootElement = document.createElement(\"div\");\n\n // This `div` may cause layout issues unless it inherits the parent's height.\n appRootElement.style.setProperty(\"height\", \"inherit\");\n\n appRootElement.setAttribute(\"id\", \"app-root\");\n stylesRootElement.setAttribute(\"id\", \"style-root\");\n stylesRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n return {\n
|
|
1
|
+
{"version":3,"file":"createReactRootElements.cjs","names":["createReactRootElements","appRootElement","document","createElement","stylesRootElement","style","setProperty","setAttribute","window","cspNonce","exports"],"sources":["../../../src/web-component/createReactRootElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport type ReactRootElements = {\n /**\n * The element your root React component renders into.\n * React has to render or portal somewhere, and this element can be used for that root element.\n */\n appRootElement: HTMLDivElement;\n /**\n * In React apps, your styles typically go in `document.head`, but you may want to render them somewhere else.\n *\n * Specifically when rendering in a web component, there is no `<head>`, so you have to create a spot for styles to render.\n */\n stylesRootElement: HTMLDivElement | HTMLHeadElement;\n};\n\nexport const createReactRootElements = () => {\n const appRootElement = document.createElement(\"div\");\n const stylesRootElement = document.createElement(\"div\");\n\n // This `div` may cause layout issues unless it inherits the parent's height.\n appRootElement.style.setProperty(\"height\", \"inherit\");\n\n appRootElement.setAttribute(\"id\", \"app-root\");\n stylesRootElement.setAttribute(\"id\", \"style-root\");\n stylesRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n return {\n appRootElement,\n stylesRootElement,\n } satisfies ReactRootElements;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBO,MAAMA,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,cAAc,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACpD,MAAMC,iBAAiB,GAAGF,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGvDF,cAAc,CAACI,KAAK,CAACC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;EAErDL,cAAc,CAACM,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC;EAC7CH,iBAAiB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EAClDH,iBAAiB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAExD,OAAO;IACLR,cAAc;IACdG;EACF,CAAC;AACH,CAAC;AAACM,OAAA,CAAAV,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -78,6 +78,7 @@ if ("customElements" in globalThis && !customElements.get(reactWebComponentEleme
|
|
|
78
78
|
const renderReactInWebComponent = ({
|
|
79
79
|
getReactComponent,
|
|
80
80
|
webComponentChildren,
|
|
81
|
+
webComponentParentElement,
|
|
81
82
|
webComponentRootElement
|
|
82
83
|
}) => {
|
|
83
84
|
const reactElement = new ReactInWebComponentElement(getReactComponent);
|
|
@@ -86,7 +87,11 @@ const renderReactInWebComponent = ({
|
|
|
86
87
|
reactElement.appendChild(webComponentChild);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
if (webComponentParentElement) {
|
|
91
|
+
webComponentParentElement.appendChild(reactElement);
|
|
92
|
+
} else if (webComponentRootElement) {
|
|
93
|
+
webComponentRootElement.appendChild(reactElement);
|
|
94
|
+
}
|
|
90
95
|
return reactElement;
|
|
91
96
|
};
|
|
92
97
|
exports.renderReactInWebComponent = renderReactInWebComponent;
|