@okta/odyssey-react-mui 1.41.1 → 1.43.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/DataTable/DataTable.cjs +67 -42
- package/dist/cjs/DataTable/DataTable.cjs.map +1 -1
- package/dist/cjs/Drawer.cjs +16 -14
- package/dist/cjs/Drawer.cjs.map +1 -1
- package/dist/cjs/PasswordField.cjs +1 -1
- package/dist/cjs/PasswordField.cjs.map +1 -1
- package/dist/cjs/Select.cjs +35 -44
- package/dist/cjs/Select.cjs.map +1 -1
- package/dist/cjs/Status.cjs +2 -0
- package/dist/cjs/Status.cjs.map +1 -1
- package/dist/cjs/Typography.cjs +32 -8
- package/dist/cjs/Typography.cjs.map +1 -1
- package/dist/cjs/createContrastColors.cjs +6 -2
- package/dist/cjs/createContrastColors.cjs.map +1 -1
- package/dist/cjs/getLogicalBoundaries.cjs +33 -0
- package/dist/cjs/getLogicalBoundaries.cjs.map +1 -0
- package/dist/cjs/labs/DataFilters.cjs +1 -0
- package/dist/cjs/labs/DataFilters.cjs.map +1 -1
- package/dist/cjs/labs/DataView/BulkActionsMenu.cjs.map +1 -1
- package/dist/cjs/labs/DataView/CardLayoutContent.cjs.map +1 -1
- package/dist/cjs/labs/DataView/DataView.cjs +10 -1
- package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
- package/dist/cjs/labs/DataView/RowActions.cjs +3 -4
- package/dist/cjs/labs/DataView/RowActions.cjs.map +1 -1
- package/dist/cjs/labs/DataView/TableLayoutContent.cjs +2 -4
- package/dist/cjs/labs/DataView/TableLayoutContent.cjs.map +1 -1
- package/dist/cjs/labs/DataView/useFilterConversion.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs +17 -11
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +2 -1
- package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +2 -3
- package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs.map +1 -1
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +15 -4
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs +136 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs.map +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs +4 -2
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs +129 -126
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +0 -1
- 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 +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
- package/dist/cjs/theme/components.cjs +7 -1
- package/dist/cjs/theme/components.cjs.map +1 -1
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +0 -1
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs +24 -18
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +4 -3
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs.map +1 -1
- package/dist/cjs/ui-shell/UiShell.cjs +2 -0
- package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
- package/dist/cjs/ui-shell/UiShellProvider.cjs +6 -1
- package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
- package/dist/cjs/ui-shell/renderUiShell.cjs +2 -0
- package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
- package/dist/cjs/ui-shell/useElementAtContainerEdge.cjs +74 -0
- package/dist/cjs/ui-shell/useElementAtContainerEdge.cjs.map +1 -0
- package/dist/cjs/useMountLifecycleEffect.cjs +3 -3
- package/dist/cjs/useMountLifecycleEffect.cjs.map +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
- package/dist/esm/DataTable/DataTable.js +67 -40
- package/dist/esm/DataTable/DataTable.js.map +1 -1
- package/dist/esm/Drawer.js +16 -14
- package/dist/esm/Drawer.js.map +1 -1
- package/dist/esm/PasswordField.js +1 -1
- package/dist/esm/PasswordField.js.map +1 -1
- package/dist/esm/Select.js +35 -44
- package/dist/esm/Select.js.map +1 -1
- package/dist/esm/Status.js +2 -0
- package/dist/esm/Status.js.map +1 -1
- package/dist/esm/Typography.js +32 -8
- package/dist/esm/Typography.js.map +1 -1
- package/dist/esm/createContrastColors.js +6 -2
- package/dist/esm/createContrastColors.js.map +1 -1
- package/dist/esm/getLogicalBoundaries.js +26 -0
- package/dist/esm/getLogicalBoundaries.js.map +1 -0
- package/dist/esm/labs/DataFilters.js +1 -0
- package/dist/esm/labs/DataFilters.js.map +1 -1
- package/dist/esm/labs/DataView/BulkActionsMenu.js.map +1 -1
- package/dist/esm/labs/DataView/CardLayoutContent.js.map +1 -1
- package/dist/esm/labs/DataView/DataView.js +10 -1
- package/dist/esm/labs/DataView/DataView.js.map +1 -1
- package/dist/esm/labs/DataView/RowActions.js +2 -1
- package/dist/esm/labs/DataView/RowActions.js.map +1 -1
- package/dist/esm/labs/DataView/TableLayoutContent.js +2 -4
- package/dist/esm/labs/DataView/TableLayoutContent.js.map +1 -1
- package/dist/esm/labs/DataView/useFilterConversion.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/ComposablePicker.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/Picker.js +19 -13
- package/dist/esm/labs/OdysseyPickers/Picker.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +2 -1
- package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +2 -3
- package/dist/esm/labs/OdysseyPickers/SearchDropdown.js.map +1 -1
- package/dist/esm/labs/PageTemplate/PageTemplate.js +16 -5
- package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_cs.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_da.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_de.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_el.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_es.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_eu.js +130 -0
- package/dist/esm/properties/ts/odyssey-react-mui_eu.js.map +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_fi.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fr.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_hu.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_id.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_it.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ja.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ko.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ms.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nb.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js +4 -2
- package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js +129 -126
- package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pl.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ro.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ru.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_sv.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_th.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_tr.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_uk.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_vi.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +0 -1
- 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 +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/esm/theme/components.js +7 -1
- package/dist/esm/theme/components.js.map +1 -1
- package/dist/esm/ui-shell/NarrowUiShellContent.js +0 -1
- package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNav.js +24 -18
- package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +4 -3
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js.map +1 -1
- package/dist/esm/ui-shell/UiShell.js +2 -0
- package/dist/esm/ui-shell/UiShell.js.map +1 -1
- package/dist/esm/ui-shell/UiShellProvider.js +6 -1
- package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
- package/dist/esm/ui-shell/renderUiShell.js +2 -0
- package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
- package/dist/esm/ui-shell/useElementAtContainerEdge.js +68 -0
- package/dist/esm/ui-shell/useElementAtContainerEdge.js.map +1 -0
- package/dist/esm/useMountLifecycleEffect.js +3 -3
- package/dist/esm/useMountLifecycleEffect.js.map +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.mjs +1 -1
- package/dist/index.scss +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/DataTable/DataTable.d.ts +2 -2
- package/dist/types/DataTable/DataTable.d.ts.map +1 -1
- package/dist/types/Drawer.d.ts +24 -6
- package/dist/types/Drawer.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/PasswordField.d.ts.map +1 -1
- package/dist/types/Select.d.ts.map +1 -1
- package/dist/types/Status.d.ts +2 -2
- package/dist/types/Status.d.ts.map +1 -1
- package/dist/types/Typography.d.ts +16 -12
- package/dist/types/Typography.d.ts.map +1 -1
- package/dist/types/createContrastColors.d.ts +5 -1
- package/dist/types/createContrastColors.d.ts.map +1 -1
- package/dist/types/getLogicalBoundaries.d.ts +24 -0
- package/dist/types/getLogicalBoundaries.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +6 -29
- package/dist/types/i18n.d.ts.map +1 -1
- package/dist/types/labs/DataFilters.d.ts.map +1 -1
- package/dist/types/labs/DataView/BulkActionsMenu.d.ts +1 -1
- package/dist/types/labs/DataView/BulkActionsMenu.d.ts.map +1 -1
- package/dist/types/labs/DataView/CardLayoutContent.d.ts.map +1 -1
- package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
- package/dist/types/labs/DataView/RowActions.d.ts +5 -4
- package/dist/types/labs/DataView/RowActions.d.ts.map +1 -1
- package/dist/types/labs/DataView/TableLayoutContent.d.ts +1 -1
- package/dist/types/labs/DataView/TableLayoutContent.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts +4 -1
- package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/Picker.d.ts +7 -7
- package/dist/types/labs/OdysseyPickers/Picker.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/SearchDropdown.d.ts.map +1 -1
- package/dist/types/labs/PageTemplate/PageTemplate.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts +130 -0
- package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts.map +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts +3 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts +3 -0
- package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
- package/dist/types/ui-shell/UiShell.d.ts +1 -1
- package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
- package/dist/types/ui-shell/UiShellProvider.d.ts +10 -4
- package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
- package/dist/types/ui-shell/renderUiShell.d.ts +2 -2
- package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
- package/dist/types/ui-shell/useElementAtContainerEdge.d.ts +43 -0
- package/dist/types/ui-shell/useElementAtContainerEdge.d.ts.map +1 -0
- package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
- package/package.json +9 -7
|
@@ -23,12 +23,13 @@ const SideNavItemLabelContainer = styled("div", {
|
|
|
23
23
|
odysseyDesignTokens,
|
|
24
24
|
isIconVisible
|
|
25
25
|
}) => ({
|
|
26
|
-
|
|
26
|
+
alignItems: "center",
|
|
27
27
|
display: "flex",
|
|
28
28
|
flexWrap: "wrap",
|
|
29
|
-
alignItems: "center",
|
|
30
29
|
fontSize: odysseyDesignTokens.TypographySizeBody,
|
|
31
|
-
marginInlineStart: isIconVisible ? odysseyDesignTokens.Spacing3 : 0
|
|
30
|
+
marginInlineStart: isIconVisible ? odysseyDesignTokens.Spacing3 : 0,
|
|
31
|
+
overflowWrap: "anywhere",
|
|
32
|
+
width: "100%"
|
|
32
33
|
}));
|
|
33
34
|
const SideNavItemLinkContent = ({
|
|
34
35
|
count,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavItemLinkContent.js","names":["styled","memo","useMemo","useOdysseyDesignTokens","Box","Status","Badge","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SideNavItemLabelContainer","shouldForwardProp","prop","odysseyDesignTokens","isIconVisible","
|
|
1
|
+
{"version":3,"file":"SideNavItemLinkContent.js","names":["styled","memo","useMemo","useOdysseyDesignTokens","Box","Status","Badge","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SideNavItemLabelContainer","shouldForwardProp","prop","odysseyDesignTokens","isIconVisible","alignItems","display","flexWrap","fontSize","TypographySizeBody","marginInlineStart","Spacing3","overflowWrap","width","SideNavItemLinkContent","count","label","startIcon","endIcon","severity","statusLabel","translate","sideNavItemContentStyles","gap","Spacing1","Spacing2","children","Boolean","sx","badgeContent","MemoizedSideNavItemLinkContent","displayName"],"sources":["../../../../src/ui-shell/SideNav/SideNavItemLinkContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, ReactNode, useMemo } from \"react\";\nimport {\n type DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Box } from \"../../Box.js\";\nimport { Status } from \"../../Status.js\";\nimport type { SideNavItem } from \"./types.js\";\nimport { Badge } from \"../../Badge.js\";\n\nconst SideNavItemLabelContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isIconVisible\",\n})<{\n odysseyDesignTokens: DesignTokens;\n isIconVisible: boolean;\n}>(({ odysseyDesignTokens, isIconVisible }) => ({\n alignItems: \"center\",\n display: \"flex\",\n flexWrap: \"wrap\",\n fontSize: odysseyDesignTokens.TypographySizeBody,\n marginInlineStart: isIconVisible ? odysseyDesignTokens.Spacing3 : 0,\n overflowWrap: \"anywhere\", // New way to do `wordBreak: \"break-word\"`. Source: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#break-word\n width: \"100%\",\n}));\n\nconst SideNavItemLinkContent = ({\n count,\n label,\n startIcon,\n endIcon,\n severity,\n statusLabel,\n translate,\n}: Pick<\n SideNavItem,\n | \"count\"\n | \"label\"\n | \"startIcon\"\n | \"endIcon\"\n | \"severity\"\n | \"statusLabel\"\n | \"translate\"\n>): ReactNode => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const sideNavItemContentStyles = useMemo(\n () => ({\n alignItems: \"center\",\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing1,\n marginInlineStart: odysseyDesignTokens.Spacing2,\n }),\n [odysseyDesignTokens],\n );\n\n return (\n <>\n {startIcon && startIcon}\n <SideNavItemLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n isIconVisible={Boolean(startIcon)}\n translate={translate}\n >\n {label}\n {!count && severity && (\n <Box sx={sideNavItemContentStyles}>\n {severity && (\n <Status severity={severity} label={statusLabel || \"\"} />\n )}\n </Box>\n )}\n {!severity && count && (\n <Box sx={sideNavItemContentStyles}>\n {count && <Badge badgeContent={count} />}\n </Box>\n )}\n </SideNavItemLabelContainer>\n {endIcon && endIcon}\n </>\n );\n};\nconst MemoizedSideNavItemLinkContent = memo(SideNavItemLinkContent);\nMemoizedSideNavItemLinkContent.displayName = \"SideNavItemLinkContent\";\n\nexport { MemoizedSideNavItemLinkContent as SideNavItemLinkContent };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAChD,SAEEC,sBAAsB,QACjB,qCAAqC;AAC5C,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,MAAM,QAAQ,iBAAiB;AAExC,SAASC,KAAK,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEvC,MAAMC,yBAAyB,GAAGb,MAAM,CAAC,KAAK,EAAE;EAC9Cc,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAAIA,IAAI,KAAK;AAC/C,CAAC,CAAC,CAGC,CAAC;EAAEC,mBAAmB;EAAEC;AAAc,CAAC,MAAM;EAC9CC,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE,MAAM;EACfC,QAAQ,EAAE,MAAM;EAChBC,QAAQ,EAAEL,mBAAmB,CAACM,kBAAkB;EAChDC,iBAAiB,EAAEN,aAAa,GAAGD,mBAAmB,CAACQ,QAAQ,GAAG,CAAC;EACnEC,YAAY,EAAE,UAAU;EACxBC,KAAK,EAAE;AACT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,8BAA8B,CAACC,WAAW,GAAG,wBAAwB;AAErE,SAASD,8BAA8B,IAAIhB,sBAAsB","ignoreList":[]}
|
|
@@ -39,6 +39,7 @@ const UiShell = ({
|
|
|
39
39
|
onSubscriptionCreated,
|
|
40
40
|
optionalComponents,
|
|
41
41
|
sideNavBackgroundColor,
|
|
42
|
+
sideNavBackgroundContrastColor,
|
|
42
43
|
subscribeToCloseRightSideMenu,
|
|
43
44
|
subscribeToCloseSideNavMenu,
|
|
44
45
|
subscribeToPropChanges,
|
|
@@ -71,6 +72,7 @@ const UiShell = ({
|
|
|
71
72
|
appBackgroundContrastMode: appBackgroundContrastMode,
|
|
72
73
|
closeSideNavMenu: closeSideNavMenu,
|
|
73
74
|
sideNavBackgroundColor: sideNavBackgroundColor,
|
|
75
|
+
sideNavBackgroundContrastColor: sideNavBackgroundContrastColor,
|
|
74
76
|
subscribeToCloseRightSideMenu: subscribeToCloseRightSideMenu,
|
|
75
77
|
subscribeToCloseSideNavMenu: subscribeToCloseSideNavMenu,
|
|
76
78
|
topNavBackgroundColor: topNavBackgroundColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiShell.js","names":["memo","useEffect","useState","ErrorBoundary","CssBaseline","NarrowUiShellContent","OdysseyProvider","UiShellProvider","useUiShellBreakpoints","WideUiShellContent","jsx","_jsx","jsxs","_jsxs","defaultComponentProps","sideNavProps","undefined","topNavProps","errorComponent","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","activeBreakpoint","unsubscribe","fallback","children","emotionRootElement","shadowRootElement","hasSideNavProps","Boolean","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useEffect, useState, type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { CssBaseline } from \"../CssBaseline.js\";\nimport { NarrowUiShellContent } from \"./NarrowUiShellContent.js\";\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { UiShellProvider, UiShellProviderProps } from \"./UiShellProvider.js\";\nimport {\n UiShellNavComponentProps,\n UiShellContentProps,\n} from \"./uiShellContentTypes.js\";\nimport {\n UiShellBreakpointConfig,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\nimport { WideUiShellContent } from \"./WideUiShellContent.js\";\nimport { MessageBus } from \"./createMessageBus.js\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\n\n useEffect(() => {\n const unsubscribe = subscribeToPropChanges((componentProps) => {\n // If for some reason nothing is passed as `componentProps`, we fallback on `defaultComponentProps` as a safety mechanism to ensure nothing breaks.\n setComponentProps(componentProps || defaultComponentProps);\n });\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribe();\n };\n }, [onSubscriptionCreated, subscribeToPropChanges]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n shadowRootElement={uiShellAppElement}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <CssBaseline />\n\n <UiShellProvider\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n closeSideNavMenu={closeSideNavMenu}\n sideNavBackgroundColor={sideNavBackgroundColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n topNavBackgroundColor={topNavBackgroundColor}\n >\n {activeBreakpoint === \"narrow\" && (\n <NarrowUiShellContent\n {...componentProps}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n\n {(activeBreakpoint === \"medium\" || activeBreakpoint === \"wide\") && (\n <WideUiShellContent\n {...{\n ...componentProps,\n ...{\n sideNavProps: {\n ...componentProps.sideNavProps,\n hasSessionStorageState: activeBreakpoint === \"wide\",\n isCollapsed:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsed,\n isCollapsible:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsible,\n // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n } as typeof componentProps.sideNavProps,\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\nMemoizedUiShell.displayName = \"UiShell\";\n\nexport { MemoizedUiShell as UiShell };\n"],"mappings":"AAAA;AACA;AACA;AACA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,cAAc,CAACzB,YAAY;gBAC9BmC,sBAAsB,EAAER,gBAAgB,KAAK,MAAM;gBACnDS,WAAW,EACTT,gBAAgB,KAAK,QAAQ,IAC7BF,cAAc,CAACzB,YAAY,EAAEoC,WAAW;gBAC1CC,aAAa,EACXV,gBAAgB,KAAK,QAAQ,IAC7BF,cAAc,CAACzB,YAAY,EAAEqC;cAEjC;YACF,CAAC;YAEH9B,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjDG,4BAA4B,EAAEA,4BAA6B;YAC3DsB,eAAe,EAAEC,OAAO,CAACT,cAAc,CAACzB,YAAY,CAAE;YACtDY,sBAAsB,EAAEA,sBAAuB;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF;QAAA,CACc,CAAC;MAAA,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAMqB,eAAe,GAAGrD,IAAI,CAACmB,OAAO,CAAC;AACrCkC,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIlC,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"UiShell.js","names":["memo","useEffect","useState","ErrorBoundary","CssBaseline","NarrowUiShellContent","OdysseyProvider","UiShellProvider","useUiShellBreakpoints","WideUiShellContent","jsx","_jsx","jsxs","_jsxs","defaultComponentProps","sideNavProps","undefined","topNavProps","errorComponent","UiShell","appBackgroundColor","appBackgroundContrastMode","appElement","appElementScrollingMode","breakpointConfig","closeSideNavMenu","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onSubscriptionCreated","optionalComponents","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","subscribeToPropChanges","topNavBackgroundColor","uiShellAppElement","uiShellStylesElement","componentProps","setComponentProps","activeBreakpoint","unsubscribe","fallback","children","emotionRootElement","shadowRootElement","hasSideNavProps","Boolean","hasSessionStorageState","isCollapsed","isCollapsible","MemoizedUiShell","displayName"],"sources":["../../../src/ui-shell/UiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useEffect, useState, type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { type ReactRootElements } from \"../web-component/createReactRootElements.js\";\nimport { CssBaseline } from \"../CssBaseline.js\";\nimport { NarrowUiShellContent } from \"./NarrowUiShellContent.js\";\nimport { OdysseyProvider } from \"../OdysseyProvider.js\";\nimport { UiShellProvider, UiShellProviderProps } from \"./UiShellProvider.js\";\nimport {\n UiShellNavComponentProps,\n UiShellContentProps,\n} from \"./uiShellContentTypes.js\";\nimport {\n UiShellBreakpointConfig,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\nimport { WideUiShellContent } from \"./WideUiShellContent.js\";\nimport { MessageBus } from \"./createMessageBus.js\";\n\nexport const defaultComponentProps: UiShellNavComponentProps = {\n sideNavProps: undefined,\n topNavProps: undefined,\n} as const;\n\nconst errorComponent = <div data-error />;\n\nexport type UiShellProps = {\n /**\n * Customized breakpoints for UI Shell.\n *\n * The defaults are set for you. Pass these only if your app doesn't work properly with the defaults (like Admin).\n */\n breakpointConfig?: UiShellBreakpointConfig;\n /**\n * Notifies when subscribed to prop changes.\n *\n * UI Shell listens to prop updates, and it won't subscribe synchronously. Because of that, this callback notifies when that subscription is ready.\n */\n onSubscriptionCreated: () => void;\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for state changes.\n *\n * The props coming in this callback go directly to a React state; therefore, it shares the same signature and provides a previous state.\n */\n subscribeToPropChanges: MessageBus<\n SetStateAction<UiShellNavComponentProps>\n >[\"subscribe\"];\n /**\n * Element inside UI Shell's React root component renders into. If using a web component, this is going to exist inside it.\n */\n uiShellAppElement: ReactRootElements[\"appRootElement\"];\n /**\n * Typically, this is your `<head>` element. If using a web component, you need to create one yourself as Shadow DOM's don't have a `<head>`.\n */\n uiShellStylesElement: ReactRootElements[\"stylesRootElement\"];\n} & UiShellProviderProps &\n Pick<\n UiShellContentProps,\n | \"appElement\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"onError\"\n | \"optionalComponents\"\n >;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst UiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement,\n appElementScrollingMode,\n breakpointConfig,\n closeSideNavMenu,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onSubscriptionCreated,\n optionalComponents,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n subscribeToPropChanges,\n topNavBackgroundColor,\n uiShellAppElement,\n uiShellStylesElement,\n}: UiShellProps) => {\n const [componentProps, setComponentProps] = useState(defaultComponentProps);\n\n const activeBreakpoint = useUiShellBreakpoints(breakpointConfig);\n\n useEffect(() => {\n const unsubscribe = subscribeToPropChanges((componentProps) => {\n // If for some reason nothing is passed as `componentProps`, we fallback on `defaultComponentProps` as a safety mechanism to ensure nothing breaks.\n setComponentProps(componentProps || defaultComponentProps);\n });\n\n onSubscriptionCreated();\n\n return () => {\n unsubscribe();\n };\n }, [onSubscriptionCreated, subscribeToPropChanges]);\n\n return activeBreakpoint === \"none\" ? null : (\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <OdysseyProvider\n emotionRootElement={uiShellStylesElement}\n shadowRootElement={uiShellAppElement}\n >\n <ErrorBoundary fallback={errorComponent} onError={onError}>\n <CssBaseline />\n\n <UiShellProvider\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n closeSideNavMenu={closeSideNavMenu}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n topNavBackgroundColor={topNavBackgroundColor}\n >\n {activeBreakpoint === \"narrow\" && (\n <NarrowUiShellContent\n {...componentProps}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n\n {(activeBreakpoint === \"medium\" || activeBreakpoint === \"wide\") && (\n <WideUiShellContent\n {...{\n ...componentProps,\n ...{\n sideNavProps: {\n ...componentProps.sideNavProps,\n hasSessionStorageState: activeBreakpoint === \"wide\",\n isCollapsed:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsed,\n isCollapsible:\n activeBreakpoint === \"medium\" ||\n componentProps.sideNavProps?.isCollapsible,\n // We have to use `as` because sideNavProps expects you to have `sideNavItems` defined even though it had to be passed in `...componentProps.sideNavProps`.\n } as typeof componentProps.sideNavProps,\n },\n }}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n hasSideNavProps={Boolean(componentProps.sideNavProps)}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n optionalComponents={optionalComponents}\n />\n )}\n </UiShellProvider>\n </ErrorBoundary>\n </OdysseyProvider>\n </ErrorBoundary>\n );\n};\n\nconst MemoizedUiShell = memo(UiShell);\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KAAK,QAAQ,IAAIA,gBAAgB,KAAK,MAAM,KAC5DhC,IAAA,CAACF,kBAAkB;YAEf,GAAGgC,cAAc;YACjB,GAAG;cACD1B,YAAY,EAAE;gBACZ,GAAG0B,cAAc,CAAC1B,YAAY;gBAC9BoC,sBAAsB,EAAER,gBAAgB,KAAK,MAAM;gBACnDS,WAAW,EACTT,gBAAgB,KAAK,QAAQ,IAC7BF,cAAc,CAAC1B,YAAY,EAAEqC,WAAW;gBAC1CC,aAAa,EACXV,gBAAgB,KAAK,QAAQ,IAC7BF,cAAc,CAAC1B,YAAY,EAAEsC;cAEjC;YACF,CAAC;YAEH/B,UAAU,EAAEA,UAAW;YACvBC,uBAAuB,EAAEA,uBAAwB;YACjDG,4BAA4B,EAAEA,4BAA6B;YAC3DuB,eAAe,EAAEC,OAAO,CAACT,cAAc,CAAC1B,YAAY,CAAE;YACtDY,sBAAsB,EAAEA,sBAAuB;YAC/CC,OAAO,EAAEA,OAAQ;YACjBI,kBAAkB,EAAEA;UAAmB,CACxC,CACF;QAAA,CACc,CAAC;MAAA,CACL;IAAC,CACD;EAAC,CACL,CAChB;AACH,CAAC;AAED,MAAMsB,eAAe,GAAGtD,IAAI,CAACmB,OAAO,CAAC;AACrCmC,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAInC,OAAO","ignoreList":[]}
|
|
@@ -27,13 +27,18 @@ const UiShellProvider = ({
|
|
|
27
27
|
children,
|
|
28
28
|
closeSideNavMenu,
|
|
29
29
|
sideNavBackgroundColor,
|
|
30
|
+
sideNavBackgroundContrastColor,
|
|
30
31
|
subscribeToCloseRightSideMenu,
|
|
31
32
|
subscribeToCloseSideNavMenu,
|
|
32
33
|
topNavBackgroundColor
|
|
33
34
|
}) => {
|
|
34
35
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
35
36
|
const defaultedSideNavBackgroundColor = sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite;
|
|
36
|
-
const sideNavContrastColors = defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite ? generateContrastColors(
|
|
37
|
+
const sideNavContrastColors = defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite ? generateContrastColors({
|
|
38
|
+
backgroundColor: sideNavBackgroundColor || defaultedSideNavBackgroundColor,
|
|
39
|
+
backgroundContrastColor: sideNavBackgroundContrastColor,
|
|
40
|
+
odysseyDesignTokens
|
|
41
|
+
}) : undefined;
|
|
37
42
|
const isAppBackgroundHightContrast = appBackgroundContrastMode === "highContrast";
|
|
38
43
|
const defaultTopAndAppBackgroundColor = isAppBackgroundHightContrast ? odysseyDesignTokens.HueNeutralWhite : odysseyDesignTokens.HueNeutral50;
|
|
39
44
|
const topNavColor = topNavBackgroundColor || defaultTopAndAppBackgroundColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiShellProvider.js","names":["createContext","memo","useContext","useMemo","generateContrastColors","useOdysseyDesignTokens","createMessageBus","jsx","_jsx","defaultCloseSideNavMessageBus","defaultSubscribeToCloseRightSideMenu","UiShellContext","undefined","useUiShellContext","UiShellProvider","appBackgroundColor","appBackgroundContrastMode","children","closeSideNavMenu","sideNavBackgroundColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","topNavBackgroundColor","odysseyDesignTokens","defaultedSideNavBackgroundColor","HueNeutralWhite","sideNavContrastColors","isAppBackgroundHightContrast","defaultTopAndAppBackgroundColor","HueNeutral50","topNavColor","appContentBackgroundColor","memoizedContextValue","publish","subscribe","Provider","value","MemoizedUiShellProvider"],"sources":["../../../src/ui-shell/UiShellProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\nimport {\n ContrastColors,\n generateContrastColors,\n} from \"../createContrastColors.js\";\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { createMessageBus, MessageBus } from \"./createMessageBus.js\";\nimport { ContrastMode } from \"../useContrastMode.js\";\n\nexport const defaultCloseSideNavMessageBus = createMessageBus();\nexport const defaultSubscribeToCloseRightSideMenu = () => () => {};\n\nexport type UiShellColors = {\n /**\n *
|
|
1
|
+
{"version":3,"file":"UiShellProvider.js","names":["createContext","memo","useContext","useMemo","generateContrastColors","useOdysseyDesignTokens","createMessageBus","jsx","_jsx","defaultCloseSideNavMessageBus","defaultSubscribeToCloseRightSideMenu","UiShellContext","undefined","useUiShellContext","UiShellProvider","appBackgroundColor","appBackgroundContrastMode","children","closeSideNavMenu","sideNavBackgroundColor","sideNavBackgroundContrastColor","subscribeToCloseRightSideMenu","subscribeToCloseSideNavMenu","topNavBackgroundColor","odysseyDesignTokens","defaultedSideNavBackgroundColor","HueNeutralWhite","sideNavContrastColors","backgroundColor","backgroundContrastColor","isAppBackgroundHightContrast","defaultTopAndAppBackgroundColor","HueNeutral50","topNavColor","appContentBackgroundColor","memoizedContextValue","publish","subscribe","Provider","value","MemoizedUiShellProvider"],"sources":["../../../src/ui-shell/UiShellProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createContext,\n memo,\n PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\nimport {\n ContrastColors,\n generateContrastColors,\n} from \"../createContrastColors.js\";\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { createMessageBus, MessageBus } from \"./createMessageBus.js\";\nimport { ContrastMode } from \"../useContrastMode.js\";\n\nexport const defaultCloseSideNavMessageBus = createMessageBus();\nexport const defaultSubscribeToCloseRightSideMenu = () => () => {};\n\nexport type UiShellColors = {\n /**\n * Custom background color for the app content area.\n */\n appBackgroundColor: string;\n /**\n * Custom background color for the side nav area.\n */\n sideNavBackgroundColor: string;\n /**\n * Custom color for fonts and other contrasted colors in the side nav area. Other contrast colors are derived from this one.\n *\n * If not passed, it gets computed from Odyssey.\n */\n sideNavBackgroundContrastColor?: string;\n sideNavContrastColors?: ContrastColors;\n /**\n * Custom background color for the top nav area.\n */\n topNavBackgroundColor: string;\n};\n\nexport type UiShellContext = {\n /**\n * This is a callback that publishes a change to all subscribers listening for when to close the side nav.\n */\n closeSideNavMenu: MessageBus<void>[\"publish\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the side nav.\n */\n subscribeToCloseSideNavMenu: MessageBus<void>[\"subscribe\"];\n /**\n * This is a callback that provides a subscriber callback to listen for changes to state.\n * It allows UI Shell to listen for a publisher that asks us to close the right-side menu.\n */\n subscribeToCloseRightSideMenu: MessageBus<void>[\"subscribe\"];\n} & UiShellColors;\n\nconst UiShellContext = createContext<UiShellContext | undefined>(undefined);\n\nexport const useUiShellContext = () => {\n return useContext(UiShellContext);\n};\n\nexport type UiShellProviderProps = {\n /**\n * Sets either a gray or white background color for the app content area.\n */\n appBackgroundContrastMode?: ContrastMode;\n} & Partial<UiShellContext>;\n\nconst UiShellProvider = ({\n appBackgroundColor,\n appBackgroundContrastMode = \"lowContrast\",\n children,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavBackgroundColor,\n}: PropsWithChildren<UiShellProviderProps>) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const defaultedSideNavBackgroundColor =\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite;\n\n const sideNavContrastColors =\n defaultedSideNavBackgroundColor !== odysseyDesignTokens.HueNeutralWhite\n ? generateContrastColors({\n backgroundColor:\n sideNavBackgroundColor || defaultedSideNavBackgroundColor,\n backgroundContrastColor: sideNavBackgroundContrastColor,\n odysseyDesignTokens,\n })\n : undefined;\n\n const isAppBackgroundHightContrast =\n appBackgroundContrastMode === \"highContrast\";\n\n const defaultTopAndAppBackgroundColor = isAppBackgroundHightContrast\n ? odysseyDesignTokens.HueNeutralWhite\n : odysseyDesignTokens.HueNeutral50;\n\n const topNavColor = topNavBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const appContentBackgroundColor =\n appBackgroundColor || defaultTopAndAppBackgroundColor;\n\n const memoizedContextValue = useMemo(\n () => ({\n appBackgroundColor: appContentBackgroundColor,\n closeSideNavMenu:\n closeSideNavMenu ?? defaultCloseSideNavMessageBus.publish,\n sideNavBackgroundColor:\n sideNavBackgroundColor || odysseyDesignTokens.HueNeutralWhite,\n sideNavContrastColors,\n subscribeToCloseSideNavMenu:\n subscribeToCloseSideNavMenu ?? defaultCloseSideNavMessageBus.subscribe,\n subscribeToCloseRightSideMenu:\n subscribeToCloseRightSideMenu ?? defaultSubscribeToCloseRightSideMenu,\n topNavBackgroundColor: topNavColor,\n }),\n [\n appContentBackgroundColor,\n odysseyDesignTokens.HueNeutralWhite,\n closeSideNavMenu,\n sideNavBackgroundColor,\n sideNavContrastColors,\n subscribeToCloseRightSideMenu,\n subscribeToCloseSideNavMenu,\n topNavColor,\n ],\n );\n\n return (\n <UiShellContext.Provider value={memoizedContextValue}>\n {children}\n </UiShellContext.Provider>\n );\n};\n\nconst MemoizedUiShellProvider = memo(UiShellProvider);\n\nexport { MemoizedUiShellProvider as UiShellProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,IAAI,EAEJC,UAAU,EACVC,OAAO,QACF,OAAO;AACd,SAEEC,sBAAsB,QACjB,4BAA4B;AACnC,SAASC,sBAAsB,QAAQ,kCAAkC;AACzE,SAASC,gBAAgB,QAAoB,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGrE,OAAO,MAAMC,6BAA6B,GAAGH,gBAAgB,CAAC,CAAC;AAC/D,OAAO,MAAMI,oCAAoC,GAAGA,CAAA,KAAM,MAAM,CAAC,CAAC;AAyClE,MAAMC,cAAc,GAAGX,aAAa,CAA6BY,SAAS,CAAC;AAE3E,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACrC,OAAOX,UAAU,CAACS,cAAc,CAAC;AACnC,CAAC;AASD,MAAMG,eAAe,GAAGA,CAAC;EACvBC,kBAAkB;EAClBC,yBAAyB,GAAG,aAAa;EACzCC,QAAQ;EACRC,gBAAgB;EAChBC,sBAAsB;EACtBC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,2BAA2B;EAC3BC;AACuC,CAAC,KAAK;EAC7C,MAAMC,mBAAmB,GAAGnB,sBAAsB,CAAC,CAAC;EACpD,MAAMoB,+BAA+B,GACnCN,sBAAsB,IAAIK,mBAAmB,CAACE,eAAe;EAE/D,MAAMC,qBAAqB,GACzBF,+BAA+B,KAAKD,mBAAmB,CAACE,eAAe,GACnEtB,sBAAsB,CAAC;IACrBwB,eAAe,EACbT,sBAAsB,IAAIM,+BAA+B;IAC3DI,uBAAuB,EAAET,8BAA8B;IACvDI;EACF,CAAC,CAAC,GACFZ,SAAS;EAEf,MAAMkB,4BAA4B,GAChCd,yBAAyB,KAAK,cAAc;EAE9C,MAAMe,+BAA+B,GAAGD,4BAA4B,GAChEN,mBAAmB,CAACE,eAAe,GACnCF,mBAAmB,CAACQ,YAAY;EAEpC,MAAMC,WAAW,GAAGV,qBAAqB,IAAIQ,+BAA+B;EAE5E,MAAMG,yBAAyB,GAC7BnB,kBAAkB,IAAIgB,+BAA+B;EAEvD,MAAMI,oBAAoB,GAAGhC,OAAO,CAClC,OAAO;IACLY,kBAAkB,EAAEmB,yBAAyB;IAC7ChB,gBAAgB,EACdA,gBAAgB,IAAIT,6BAA6B,CAAC2B,OAAO;IAC3DjB,sBAAsB,EACpBA,sBAAsB,IAAIK,mBAAmB,CAACE,eAAe;IAC/DC,qBAAqB;IACrBL,2BAA2B,EACzBA,2BAA2B,IAAIb,6BAA6B,CAAC4B,SAAS;IACxEhB,6BAA6B,EAC3BA,6BAA6B,IAAIX,oCAAoC;IACvEa,qBAAqB,EAAEU;EACzB,CAAC,CAAC,EACF,CACEC,yBAAyB,EACzBV,mBAAmB,CAACE,eAAe,EACnCR,gBAAgB,EAChBC,sBAAsB,EACtBQ,qBAAqB,EACrBN,6BAA6B,EAC7BC,2BAA2B,EAC3BW,WAAW,CAEf,CAAC;EAED,OACEzB,IAAA,CAACG,cAAc,CAAC2B,QAAQ;IAACC,KAAK,EAAEJ,oBAAqB;IAAAlB,QAAA,EAClDA;EAAQ,CACc,CAAC;AAE9B,CAAC;AAED,MAAMuB,uBAAuB,GAAGvC,IAAI,CAACa,eAAe,CAAC;AAErD,SAAS0B,uBAAuB,IAAI1B,eAAe","ignoreList":[]}
|
|
@@ -36,6 +36,7 @@ export const renderUiShell = ({
|
|
|
36
36
|
onRender,
|
|
37
37
|
parentElement,
|
|
38
38
|
sideNavBackgroundColor,
|
|
39
|
+
sideNavBackgroundContrastColor,
|
|
39
40
|
topNavBackgroundColor
|
|
40
41
|
}) => {
|
|
41
42
|
const appElement = providedAppElement || document.createElement("div");
|
|
@@ -87,6 +88,7 @@ export const renderUiShell = ({
|
|
|
87
88
|
name: slotName
|
|
88
89
|
})])),
|
|
89
90
|
sideNavBackgroundColor: sideNavBackgroundColor,
|
|
91
|
+
sideNavBackgroundContrastColor: sideNavBackgroundContrastColor,
|
|
90
92
|
subscribeToCloseRightSideMenu: subscribeToCloseRightSideMenu,
|
|
91
93
|
subscribeToCloseSideNavMenu: subscribeToCloseSideNavMenu,
|
|
92
94
|
subscribeToPropChanges: subscribeToPropChanges,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","UiShell","uiShellDataAttribute","renderReactInWebComponent","jsx","_jsx","optionalComponentSlotNames","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","breakpointConfig","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onRender","parentElement","sideNavBackgroundColor","topNavBackgroundColor","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","closeRightSideMenu","subscribeToCloseRightSideMenu","closeSideNavMenu","subscribeToCloseSideNavMenu","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","unsubscribeFromUnifiedUiShellRendered","setComponentProps","appendChild"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus, PublishMessage } 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\nexport type SlottedElements = Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n>;\n\nexport type RenderedUiShell = {\n closeRightSideMenu: PublishMessage<void>;\n closeSideNavMenu: PublishMessage<void>;\n setComponentProps: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellNavComponentProps>>\n >;\n slottedElements: SlottedElements;\n uiShellElement: ReturnType<typeof renderReactInWebComponent>;\n} & Partial<Pick<UiShellProps, \"appElement\">>;\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n breakpointConfig,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onRender,\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 * Notify once when React has rendered UI Shell the first time.\n */\n onRender?: (renderedUiShell: RenderedUiShell) => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"breakpointConfig\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"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 {\n publish: closeRightSideMenu,\n subscribe: subscribeToCloseRightSideMenu,\n } = createMessageBus();\n\n const { publish: closeSideNavMenu, subscribe: subscribeToCloseSideNavMenu } =\n createMessageBus();\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as SlottedElements;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n breakpointConfig={breakpointConfig}\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n closeSideNavMenu={closeSideNavMenu}\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 subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentChildren,\n webComponentParentElement: parentElement,\n });\n\n const unsubscribeFromUnifiedUiShellRendered = subscribeToReactAppSubscribed(\n () => {\n unsubscribeFromUnifiedUiShellRendered();\n\n onRender?.({\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n });\n },\n );\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAwB,uBAAuB;AACxE,SAASC,OAAO,QAAsB,cAAc;AAEpD,SAASC,oBAAoB,QAAQ,oBAAoB;AACzD,SAASC,yBAAyB,QAA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AA4B;QACzDP,sBAAsB,EAAEA,sBAAuB;QAC/CP,qBAAqB,EAAEA,qBAAsB;QAC7CiC,iBAAiB,EAAEN,iBAAiB,CAACO,cAAe;QACpDC,oBAAoB,EAAER,iBAAiB,CAACS;MAAkB,CAC3D;IAAC,CACW,CAChB;IACDb,oBAAoB;IACpBc,yBAAyB,EAAEvC;EAC7B,CAAC,CAAC;EAEF,MAAMwC,qCAAqC,GAAG7B,6BAA6B,CACzE,MAAM;IACJ6B,qCAAqC,CAAC,CAAC;IAEvCzC,QAAQ,GAAG;MACTT,UAAU;MACVuB,kBAAkB;MAClBE,gBAAgB;MAChB0B,iBAAiB,EAAE7B,iCAAiC;MACpDK,eAAe;MACfU;IACF,CAAC,CAAC;EACJ,CACF,CAAC;EAED3B,aAAa,CAAC0C,WAAW,CAACpD,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACVuB,kBAAkB;IAClBE,gBAAgB;IAChB0B,iBAAiB,EAAE7B,iCAAiC;IACpDK,eAAe;IACfU;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","UiShell","uiShellDataAttribute","renderReactInWebComponent","jsx","_jsx","optionalComponentSlotNames","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","breakpointConfig","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onRender","parentElement","sideNavBackgroundColor","sideNavBackgroundContrastColor","topNavBackgroundColor","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","closeRightSideMenu","subscribeToCloseRightSideMenu","closeSideNavMenu","subscribeToCloseSideNavMenu","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","unsubscribeFromUnifiedUiShellRendered","setComponentProps","appendChild"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus, PublishMessage } 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\nexport type SlottedElements = Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n>;\n\nexport type RenderedUiShell = {\n closeRightSideMenu: PublishMessage<void>;\n closeSideNavMenu: PublishMessage<void>;\n setComponentProps: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellNavComponentProps>>\n >;\n slottedElements: SlottedElements;\n uiShellElement: ReturnType<typeof renderReactInWebComponent>;\n} & Partial<Pick<UiShellProps, \"appElement\">>;\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n breakpointConfig,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onRender,\n parentElement,\n sideNavBackgroundColor,\n sideNavBackgroundContrastColor,\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 * Notify once when React has rendered UI Shell the first time.\n */\n onRender?: (renderedUiShell: RenderedUiShell) => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"breakpointConfig\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"sideNavBackgroundContrastColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<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 {\n publish: closeRightSideMenu,\n subscribe: subscribeToCloseRightSideMenu,\n } = createMessageBus();\n\n const { publish: closeSideNavMenu, subscribe: subscribeToCloseSideNavMenu } =\n createMessageBus();\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as SlottedElements;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n breakpointConfig={breakpointConfig}\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n closeSideNavMenu={closeSideNavMenu}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n sideNavBackgroundContrastColor={sideNavBackgroundContrastColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentChildren,\n webComponentParentElement: parentElement,\n });\n\n const unsubscribeFromUnifiedUiShellRendered = subscribeToReactAppSubscribed(\n () => {\n unsubscribeFromUnifiedUiShellRendered();\n\n onRender?.({\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n });\n },\n );\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAwB,uBAAuB;AACxE,SAASC,OAAO,QAAsB,cAAc;AAEpD,SAASC,oBAAoB,QAAQ,oBAAoB;AACzD,SAASC,yBAAyB,QAAQ,+CAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1F,OAAO,MAAMC,0BAGZ,GAAG;EACFC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,iBAAiB;EAChCC,aAAa,EAAE,iBAAiB;EAChCC,cAAc,EAAE,mBAAmB;EACnCC,eAAe,EAAE;AACnB,CAAC;AA0BD,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU,EAAEC,kBAAkB;EAC9BC,uBAAuB;EACvBC,gBAAgB;EAChBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,QAAQ;EACRC,aAAa;EACbC,sBAAsB;EACtBC,8BAA8B;EAC9BC;AA0BwC,CAAC,KAAK;EAC9C,MAAMb,UAAU,GAAGC,kBAAkB,IAAIa,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGtEL,aAAa,CAACM,YAAY,CAAC7B,oBAAoB,EAAE,EAAE,CAAC;EAEpD,MAAM;IAAE8B,OAAO,EAAEC,kBAA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,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useEffect, useState, useRef, useCallback } from "react";
|
|
14
|
+
import { getLogicalBoundaries } from "../getLogicalBoundaries.js";
|
|
15
|
+
const defaultEdgeState = {
|
|
16
|
+
isAtContainerInlineStart: null,
|
|
17
|
+
isAtContainerInlineEnd: null,
|
|
18
|
+
isAtContainerBlockStart: null,
|
|
19
|
+
isAtContainerBlockEnd: null
|
|
20
|
+
};
|
|
21
|
+
export function useElementAtContainerEdge({
|
|
22
|
+
containerElement,
|
|
23
|
+
element,
|
|
24
|
+
monitoringElement
|
|
25
|
+
}) {
|
|
26
|
+
const [edgeState, setEdgeState] = useState(defaultEdgeState);
|
|
27
|
+
const requestedAnimationFrameIdRef = useRef(0);
|
|
28
|
+
const resolvedMonitoringElement = monitoringElement ?? element?.parentElement;
|
|
29
|
+
const updateEdgeState = useCallback(() => {
|
|
30
|
+
cancelAnimationFrame(requestedAnimationFrameIdRef.current);
|
|
31
|
+
requestedAnimationFrameIdRef.current = requestAnimationFrame(() => {
|
|
32
|
+
if (element) {
|
|
33
|
+
const elementBoundaries = getLogicalBoundaries(element);
|
|
34
|
+
const containerBoundaries = getLogicalBoundaries(containerElement ?? document.body);
|
|
35
|
+
setEdgeState({
|
|
36
|
+
isAtContainerInlineStart: elementBoundaries.left === containerBoundaries.left,
|
|
37
|
+
isAtContainerInlineEnd: elementBoundaries.right === containerBoundaries.right,
|
|
38
|
+
isAtContainerBlockStart: elementBoundaries.top === containerBoundaries.top,
|
|
39
|
+
isAtContainerBlockEnd: elementBoundaries.bottom === containerBoundaries.bottom
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
setEdgeState(defaultEdgeState);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}, [containerElement, element]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const mutationObserver = new MutationObserver(() => {
|
|
48
|
+
updateEdgeState();
|
|
49
|
+
});
|
|
50
|
+
if (resolvedMonitoringElement) {
|
|
51
|
+
mutationObserver.observe(resolvedMonitoringElement, {
|
|
52
|
+
attributes: true,
|
|
53
|
+
attributeFilter: ["style"],
|
|
54
|
+
childList: true,
|
|
55
|
+
subtree: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
window.addEventListener("resize", updateEdgeState);
|
|
59
|
+
updateEdgeState();
|
|
60
|
+
return () => {
|
|
61
|
+
cancelAnimationFrame(requestedAnimationFrameIdRef.current);
|
|
62
|
+
mutationObserver.disconnect();
|
|
63
|
+
window.removeEventListener("resize", updateEdgeState);
|
|
64
|
+
};
|
|
65
|
+
}, [resolvedMonitoringElement, updateEdgeState]);
|
|
66
|
+
return edgeState;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=useElementAtContainerEdge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useElementAtContainerEdge.js","names":["useEffect","useState","useRef","useCallback","getLogicalBoundaries","defaultEdgeState","isAtContainerInlineStart","isAtContainerInlineEnd","isAtContainerBlockStart","isAtContainerBlockEnd","useElementAtContainerEdge","containerElement","element","monitoringElement","edgeState","setEdgeState","requestedAnimationFrameIdRef","resolvedMonitoringElement","parentElement","updateEdgeState","cancelAnimationFrame","current","requestAnimationFrame","elementBoundaries","containerBoundaries","document","body","left","right","top","bottom","mutationObserver","MutationObserver","observe","attributes","attributeFilter","childList","subtree","window","addEventListener","disconnect","removeEventListener"],"sources":["../../../src/ui-shell/useElementAtContainerEdge.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 { useEffect, useState, useRef, useCallback } from \"react\";\nimport { getLogicalBoundaries } from \"../getLogicalBoundaries.js\";\n\nconst defaultEdgeState = {\n isAtContainerInlineStart: null,\n isAtContainerInlineEnd: null,\n isAtContainerBlockStart: null,\n isAtContainerBlockEnd: null,\n};\n\ntype EdgeState =\n | {\n isAtContainerInlineStart: null;\n isAtContainerInlineEnd: null;\n isAtContainerBlockStart: null;\n isAtContainerBlockEnd: null;\n }\n | {\n isAtContainerInlineStart: boolean;\n isAtContainerInlineEnd: boolean;\n isAtContainerBlockStart: boolean;\n isAtContainerBlockEnd: boolean;\n };\n\n/**\n * Determines if an element is at the edge of its container.\n *\n * If `element` is `null`, all returned edge state values will be `null`.\n */\nexport function useElementAtContainerEdge({\n containerElement,\n element,\n monitoringElement,\n}: {\n /**\n * The container element against which the edges are checked. If not provided, it defaults to the document body.\n */\n containerElement?: HTMLElement | null;\n /**\n * The element whose edges you want to track.\n */\n element?: HTMLElement | null;\n /**\n * The element whose mutations you want to track. If not provided, it defaults to the parent element of the `element`.\n */\n monitoringElement?: HTMLElement | null;\n}) {\n const [edgeState, setEdgeState] = useState<EdgeState>(defaultEdgeState);\n\n const requestedAnimationFrameIdRef = useRef(0);\n\n const resolvedMonitoringElement = monitoringElement ?? element?.parentElement;\n\n // will check the position of the element and update state accordingly\n const updateEdgeState = useCallback(() => {\n cancelAnimationFrame(requestedAnimationFrameIdRef.current);\n\n requestedAnimationFrameIdRef.current = requestAnimationFrame(() => {\n if (element) {\n const elementBoundaries = getLogicalBoundaries(element);\n const containerBoundaries = getLogicalBoundaries(\n containerElement ?? document.body,\n );\n\n setEdgeState({\n isAtContainerInlineStart:\n elementBoundaries.left === containerBoundaries.left,\n isAtContainerInlineEnd:\n elementBoundaries.right === containerBoundaries.right,\n isAtContainerBlockStart:\n elementBoundaries.top === containerBoundaries.top,\n isAtContainerBlockEnd:\n elementBoundaries.bottom === containerBoundaries.bottom,\n });\n } else {\n setEdgeState(defaultEdgeState);\n }\n });\n }, [containerElement, element]);\n\n useEffect(() => {\n // Listen for mutations that might affect position\n const mutationObserver = new MutationObserver(() => {\n updateEdgeState();\n });\n\n if (resolvedMonitoringElement) {\n mutationObserver.observe(resolvedMonitoringElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n childList: true,\n subtree: true,\n });\n }\n\n // Listen for window resize, which can affect position\n window.addEventListener(\"resize\", updateEdgeState);\n\n // Initial check\n updateEdgeState();\n\n // cleanup function to remove listeners and observer\n return () => {\n cancelAnimationFrame(requestedAnimationFrameIdRef.current);\n mutationObserver.disconnect();\n window.removeEventListener(\"resize\", updateEdgeState);\n };\n }, [resolvedMonitoringElement, updateEdgeState]);\n\n return edgeState;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QAAQ,OAAO;AAChE,SAASC,oBAAoB,QAAQ,4BAA4B;AAEjE,MAAMC,gBAAgB,GAAG;EACvBC,wBAAwB,EAAE,IAAI;EAC9BC,sBAAsB,EAAE,IAAI;EAC5BC,uBAAuB,EAAE,IAAI;EAC7BC,qBAAqB,EAAE;AACzB,CAAC;AAqBD,OAAO,SAASC,yBA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yBAAyB,EAAE;QAClDiB,UAAU,EAAE,IAAI;QAChBC,eAAe,EAAE,CAAC,OAAO,CAAC;QAC1BC,SAAS,EAAE,IAAI;QACfC,OAAO,EAAE;MACX,CAAC,CAAC;IACJ;IAGAC,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAEpB,eAAe,CAAC;IAGlDA,eAAe,CAAC,CAAC;IAGjB,OAAO,MAAM;MACXC,oBAAoB,CAACJ,4BAA4B,CAACK,OAAO,CAAC;MAC1DU,gBAAgB,CAACS,UAAU,CAAC,CAAC;MAC7BF,MAAM,CAACG,mBAAmB,CAAC,QAAQ,EAAEtB,eAAe,CAAC;IACvD,CAAC;EACH,CAAC,EAAE,CAACF,yBAAyB,EAAEE,eAAe,CAAC,CAAC;EAEhD,OAAOL,SAAS;AAClB","ignoreList":[]}
|
|
@@ -15,13 +15,13 @@ export const useMountLifecycleEffect = ({
|
|
|
15
15
|
onMount,
|
|
16
16
|
onUpdate
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
18
|
+
const isMounted = useRef(false);
|
|
19
19
|
const onMountRef = useRef(onMount);
|
|
20
20
|
useEffect(() => {
|
|
21
|
-
if (
|
|
21
|
+
if (isMounted.current) {
|
|
22
22
|
onUpdate?.();
|
|
23
23
|
} else {
|
|
24
|
-
|
|
24
|
+
isMounted.current = true;
|
|
25
25
|
onMountRef.current?.();
|
|
26
26
|
}
|
|
27
27
|
}, [onUpdate]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMountLifecycleEffect.js","names":["useEffect","useRef","useMountLifecycleEffect","onMount","onUpdate","
|
|
1
|
+
{"version":3,"file":"useMountLifecycleEffect.js","names":["useEffect","useRef","useMountLifecycleEffect","onMount","onUpdate","isMounted","onMountRef","current"],"sources":["../../src/useMountLifecycleEffect.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 { useEffect, useRef } from \"react\";\n\nexport const useMountLifecycleEffect = ({\n onMount,\n onUpdate,\n}: {\n onMount?: () => void;\n onUpdate?: () => void;\n}) => {\n const isMounted = useRef(false);\n const onMountRef = useRef(onMount);\n\n useEffect(() => {\n if (isMounted.current) {\n onUpdate?.();\n } else {\n isMounted.current = true;\n onMountRef.current?.();\n }\n }, [onUpdate]);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EACtCC,OAAO;EACPC;AAIF,CAAC,KAAK;EACJ,MAAMC,SAAS,GAAGJ,MAAM,CAAC,KAAK,CAAC;EAC/B,MAAMK,UAAU,GAAGL,MAAM,CAACE,OAAO,CAAC;EAElCH,SAAS,CAAC,MAAM;IACd,IAAIK,SAAS,CAACE,OAAO,EAAE;MACrBH,QAAQ,GAAG,CAAC;IACd,CAAC,MAAM;MACLC,SAAS,CAACE,OAAO,GAAG,IAAI;MACxBD,UAAU,CAACC,OAAO,GAAG,CAAC;IACxB;EACF,CAAC,EAAE,CAACH,QAAQ,CAAC,CAAC;AAChB,CAAC","ignoreList":[]}
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
-
*/export default "1-
|
|
11
|
+
*/export default "1-43-0";
|
|
12
12
|
//# sourceMappingURL=odysseyWebComponentVersion.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odysseyWebComponentVersion.generated.js","names":[],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\n\nexport default \"1-
|
|
1
|
+
{"version":3,"file":"odysseyWebComponentVersion.generated.js","names":[],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\n\nexport default \"1-43-0\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAQA,eAAe,QAAQ","ignoreList":[]}
|
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iBAAS,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAE5E;AAED,QAAA,MAAM,MAAM,oHAMX,CAAC;AAEF,QAAA,MAAM,GAAG,oHAA0B,CAAC;AAEpC,QAAA,MAAM,MAAM;;;;;;CAMX,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
4
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
5
|
+
*
|
|
6
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
*
|
|
11
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
function literalTuple(...args) {
|
|
14
|
+
return args;
|
|
15
|
+
}
|
|
16
|
+
const modern = literalTuple("last 1 Chrome version", "last 1 Safari version", "last 1 Edge version", "last 1 Firefox version", "Firefox ESR");
|
|
17
|
+
const all = literalTuple(...modern);
|
|
18
|
+
const config = {
|
|
19
|
+
all,
|
|
20
|
+
development: modern,
|
|
21
|
+
modern,
|
|
22
|
+
production: all,
|
|
23
|
+
test: modern,
|
|
24
|
+
};
|
|
25
|
+
module.exports = config;
|
package/dist/index.mjs
CHANGED