@okta/odyssey-react-mui 1.35.2 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs +2 -2
  2. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs.map +1 -1
  3. package/dist/cjs/Field.cjs +1 -1
  4. package/dist/cjs/Field.cjs.map +1 -1
  5. package/dist/cjs/Pagination/Pagination.cjs +0 -6
  6. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  7. package/dist/cjs/StringWithValue.cjs.map +1 -0
  8. package/dist/cjs/inputUtils.cjs +1 -1
  9. package/dist/cjs/inputUtils.cjs.map +1 -1
  10. package/dist/cjs/labs/DataFilters.cjs +4 -4
  11. package/dist/cjs/labs/DataFilters.cjs.map +1 -1
  12. package/dist/cjs/labs/DataView/DataCard.cjs +18 -18
  13. package/dist/cjs/labs/DataView/DataCard.cjs.map +1 -1
  14. package/dist/cjs/labs/DataView/DataView.cjs +10 -10
  15. package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
  16. package/dist/cjs/labs/DataView/useFilterConversion.cjs +1 -1
  17. package/dist/cjs/labs/DataView/useFilterConversion.cjs.map +1 -1
  18. package/dist/cjs/theme/useMediaQuery.cjs +1 -1
  19. package/dist/cjs/theme/useMediaQuery.cjs.map +1 -1
  20. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +108 -60
  21. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  22. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +84 -112
  23. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs.map +1 -1
  24. package/dist/cjs/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.cjs +26 -0
  25. package/dist/cjs/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.cjs.map +1 -0
  26. package/dist/cjs/ui-shell/WideUiShellContent.cjs +2 -1
  27. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  28. package/dist/cjs/ui-shell/index.cjs +8 -1
  29. package/dist/cjs/ui-shell/index.cjs.map +1 -1
  30. package/dist/cjs/ui-shell/useMatchAppElementToUiShellAppArea.cjs +1 -1
  31. package/dist/cjs/ui-shell/useMatchAppElementToUiShellAppArea.cjs.map +1 -1
  32. package/dist/cjs/ui-shell/useScrollState.cjs +71 -21
  33. package/dist/cjs/ui-shell/useScrollState.cjs.map +1 -1
  34. package/dist/cjs/useMountLifecycleEffect.cjs +36 -0
  35. package/dist/cjs/useMountLifecycleEffect.cjs.map +1 -0
  36. package/dist/cjs/useSessionStorageState.cjs +64 -0
  37. package/dist/cjs/useSessionStorageState.cjs.map +1 -0
  38. package/dist/cjs/web-component/createReactRootElements.cjs +5 -3
  39. package/dist/cjs/web-component/createReactRootElements.cjs.map +1 -1
  40. package/dist/esm/DatePickers/useOdysseyDateFields.js +2 -2
  41. package/dist/esm/DatePickers/useOdysseyDateFields.js.map +1 -1
  42. package/dist/esm/Field.js +1 -1
  43. package/dist/esm/Field.js.map +1 -1
  44. package/dist/esm/Pagination/Pagination.js +0 -6
  45. package/dist/esm/Pagination/Pagination.js.map +1 -1
  46. package/dist/esm/StringWithValue.js.map +1 -0
  47. package/dist/esm/inputUtils.js +1 -1
  48. package/dist/esm/inputUtils.js.map +1 -1
  49. package/dist/esm/labs/DataFilters.js +4 -4
  50. package/dist/esm/labs/DataFilters.js.map +1 -1
  51. package/dist/esm/labs/DataView/DataCard.js +18 -18
  52. package/dist/esm/labs/DataView/DataCard.js.map +1 -1
  53. package/dist/esm/labs/DataView/DataView.js +10 -10
  54. package/dist/esm/labs/DataView/DataView.js.map +1 -1
  55. package/dist/esm/labs/DataView/useFilterConversion.js +1 -1
  56. package/dist/esm/labs/DataView/useFilterConversion.js.map +1 -1
  57. package/dist/esm/theme/useMediaQuery.js +1 -1
  58. package/dist/esm/theme/useMediaQuery.js.map +1 -1
  59. package/dist/esm/ui-shell/SideNav/SideNav.js +109 -61
  60. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  61. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +85 -113
  62. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js.map +1 -1
  63. package/dist/esm/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.js +19 -0
  64. package/dist/esm/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.js.map +1 -0
  65. package/dist/esm/ui-shell/WideUiShellContent.js +2 -1
  66. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  67. package/dist/esm/ui-shell/index.js +1 -1
  68. package/dist/esm/ui-shell/index.js.map +1 -1
  69. package/dist/esm/ui-shell/useMatchAppElementToUiShellAppArea.js +1 -1
  70. package/dist/esm/ui-shell/useMatchAppElementToUiShellAppArea.js.map +1 -1
  71. package/dist/esm/ui-shell/useScrollState.js +67 -21
  72. package/dist/esm/ui-shell/useScrollState.js.map +1 -1
  73. package/dist/esm/useMountLifecycleEffect.js +29 -0
  74. package/dist/esm/useMountLifecycleEffect.js.map +1 -0
  75. package/dist/esm/useSessionStorageState.js +56 -0
  76. package/dist/esm/useSessionStorageState.js.map +1 -0
  77. package/dist/esm/web-component/createReactRootElements.js +4 -2
  78. package/dist/esm/web-component/createReactRootElements.js.map +1 -1
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.mjs +1 -1
  81. package/dist/index.scss +1 -1
  82. package/dist/tsconfig.production.tsbuildinfo +1 -1
  83. package/dist/tsconfig.tsbuildinfo +1 -1
  84. package/dist/types/DatePickers/useOdysseyDateFields.d.ts.map +1 -1
  85. package/dist/types/Pagination/Pagination.d.ts.map +1 -1
  86. package/dist/types/StringWithValue.d.ts.map +1 -0
  87. package/dist/types/labs/DataView/DataCard.d.ts.map +1 -1
  88. package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
  89. package/dist/types/theme/useMediaQuery.d.ts +1 -1
  90. package/dist/types/theme/useMediaQuery.d.ts.map +1 -1
  91. package/dist/types/ui-shell/SideNav/SideNav.d.ts +2 -0
  92. package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
  93. package/dist/types/ui-shell/SideNav/SideNavToggleButton.d.ts +15 -8
  94. package/dist/types/ui-shell/SideNav/SideNavToggleButton.d.ts.map +1 -1
  95. package/dist/types/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.d.ts +17 -0
  96. package/dist/types/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.d.ts.map +1 -0
  97. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  98. package/dist/types/ui-shell/index.d.ts +1 -1
  99. package/dist/types/ui-shell/index.d.ts.map +1 -1
  100. package/dist/types/ui-shell/useMatchAppElementToUiShellAppArea.d.ts.map +1 -1
  101. package/dist/types/ui-shell/useScrollState.d.ts +9 -1
  102. package/dist/types/ui-shell/useScrollState.d.ts.map +1 -1
  103. package/dist/types/useMountLifecycleEffect.d.ts +16 -0
  104. package/dist/types/useMountLifecycleEffect.d.ts.map +1 -0
  105. package/dist/types/useSessionStorageState.d.ts +20 -0
  106. package/dist/types/useSessionStorageState.d.ts.map +1 -0
  107. package/dist/types/web-component/createReactRootElements.d.ts +2 -0
  108. package/dist/types/web-component/createReactRootElements.d.ts.map +1 -1
  109. package/package.json +14 -11
  110. package/dist/cjs/theme/StringWithValue.cjs.map +0 -1
  111. package/dist/esm/theme/StringWithValue.js.map +0 -1
  112. package/dist/types/theme/StringWithValue.d.ts.map +0 -1
  113. /package/dist/cjs/{theme/StringWithValue.cjs → StringWithValue.cjs} +0 -0
  114. /package/dist/esm/{theme/StringWithValue.js → StringWithValue.js} +0 -0
  115. /package/dist/types/{theme/StringWithValue.d.ts → StringWithValue.d.ts} +0 -0
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useIsSideNavCollapsedSessionStorage = exports.sessionStorageKey = void 0;
7
+ var _useSessionStorageState = require("../../useSessionStorageState.cjs");
8
+ /*!
9
+ * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
10
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
11
+ *
12
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ *
17
+ * See the License for the specific language governing permissions and limitations under the License.
18
+ */
19
+
20
+ const sessionStorageKey = exports.sessionStorageKey = "__uiShell-sideNav-isCollapsed";
21
+ const useIsSideNavCollapsedSessionStorage = isSideNavInitiallyCollapsed => (0, _useSessionStorageState.useSessionStorageState)({
22
+ initialState: isSideNavInitiallyCollapsed,
23
+ key: sessionStorageKey
24
+ });
25
+ exports.useIsSideNavCollapsedSessionStorage = useIsSideNavCollapsedSessionStorage;
26
+ //# sourceMappingURL=useIsSideNavCollapsedSessionStorage.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsSideNavCollapsedSessionStorage.cjs","names":["_useSessionStorageState","require","sessionStorageKey","exports","useIsSideNavCollapsedSessionStorage","isSideNavInitiallyCollapsed","useSessionStorageState","initialState","key"],"sources":["../../../../src/ui-shell/SideNav/useIsSideNavCollapsedSessionStorage.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 { useSessionStorageState } from \"../../useSessionStorageState.js\";\n\nexport const sessionStorageKey = \"__uiShell-sideNav-isCollapsed\";\n\nexport const useIsSideNavCollapsedSessionStorage = (\n isSideNavInitiallyCollapsed: boolean,\n) =>\n useSessionStorageState({\n initialState: isSideNavInitiallyCollapsed,\n key: sessionStorageKey,\n });\n"],"mappings":";;;;;;AAYA,IAAAA,uBAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,+BAA+B;AAEzD,MAAME,mCAAmC,GAC9CC,2BAAoC,IAEpC,IAAAC,8CAAsB,EAAC;EACrBC,YAAY,EAAEF,2BAA2B;EACzCG,GAAG,EAAEN;AACP,CAAC,CAAC;AAACC,OAAA,CAAAC,mCAAA,GAAAA,mCAAA","ignoreList":[]}
@@ -30,6 +30,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
30
30
  * See the License for the specific language governing permissions and limitations under the License.
31
31
  */
32
32
 
33
+ const appSwitcherDefaultAppIcons = [];
33
34
  const StyledAppContainer = (0, _styled.default)("div", {
34
35
  shouldForwardProp: prop => prop !== "appBackgroundColor" && prop !== "odysseyDesignTokens"
35
36
  })(({
@@ -108,8 +109,8 @@ const WideUiShellContent = ({
108
109
  fallback: null,
109
110
  onError: onError,
110
111
  children: (0, _jsxRuntime.jsx)(_index.AppSwitcher, {
112
+ appIcons: appSwitcherDefaultAppIcons,
111
113
  isLoading: true,
112
- appIcons: [],
113
114
  selectedAppName: ""
114
115
  })
115
116
  }), appSwitcherProps && (0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
@@ -1 +1 @@
1
- {"version":3,"file":"WideUiShellContent.cjs","names":["_styled","_interopRequireDefault","require","_react","_reactErrorBoundary","_index","_InnerAppContainer","_OdysseyDesignTokensContext","_index2","_index3","_useScrollState","_useMatchAppElementToUiShellAppArea","_UiShellProvider","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","StyledAppContainer","styled","shouldForwardProp","prop","appBackgroundColor","backgroundColor","gridArea","pointerEvents","position","StyledAppSwitcherContainer","StyledBannersContainer","StyledSideNavContainer","StyledShellContainer","odysseyDesignTokens","HueNeutral50","display","gridGap","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","width","StyledTopNavContainer","WideUiShellContent","appElement","appElementScrollingMode","appSwitcherProps","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","optionalComponents","sideNavProps","topNavProps","useOdysseyDesignTokens","uiShellContext","useUiShellContext","isContentScrolled","useScrollState","sideNavContainerRef","useRef","topNavContainerRef","uiShellAppAreaRef","parentContainerRef","useMatchAppElementToUiShellAppArea","paddingMode","uiShellResizableRefs","jsxs","ref","children","jsx","banners","includes","ErrorBoundary","fallback","AppSwitcher","isLoading","appIcons","selectedAppName","undefined","SideNav","sideNavItems","emptySideNavItems","hasCustomFooter","sideNavFooter","footerComponent","footerItems","TopNav","leftSideComponent","topNavLeftSide","rightSideComponent","topNavRightSide","tabIndex","InnerAppContainer","MemoizedWideUiShellContent","exports","memo","displayName"],"sources":["../../../src/ui-shell/WideUiShellContent.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, useRef } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { AppSwitcher } from \"./AppSwitcher/index.js\";\nimport { InnerAppContainer } from \"./InnerAppContainer.js\";\nimport {\n useOdysseyDesignTokens,\n type DesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { SideNav } from \"./SideNav/index.js\";\nimport { TopNav } from \"./TopNav/index.js\";\nimport { useScrollState } from \"./useScrollState.js\";\nimport { useMatchAppElementToUiShellAppArea } from \"./useMatchAppElementToUiShellAppArea.js\";\nimport {\n UiShellNavComponentProps,\n UiShellContentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellColors, useUiShellContext } from \"./UiShellProvider.js\";\nimport { emptySideNavItems } from \"./uiShellSharedConstants.js\";\n\nconst StyledAppContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"appBackgroundColor\" && prop !== \"odysseyDesignTokens\",\n})<{\n appBackgroundColor?: UiShellColors[\"appBackgroundColor\"];\n}>(({ appBackgroundColor }) => ({\n backgroundColor: appBackgroundColor,\n gridArea: \"app-content\",\n pointerEvents: \"none\",\n position: \"relative\",\n}));\n\nconst StyledAppSwitcherContainer = styled(\"div\")({\n gridArea: \"app-switcher\",\n});\n\nconst StyledBannersContainer = styled(\"div\")({\n gridArea: \"banners\",\n});\n\nconst StyledSideNavContainer = styled(\"div\")({\n gridArea: \"side-nav\",\n});\n\nconst StyledShellContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n display: \"grid\",\n gridGap: 0,\n gridTemplateAreas: `\n \"banners banners banners\"\n \"app-switcher side-nav top-nav\"\n \"app-switcher side-nav app-content\"\n `,\n gridTemplateColumns: \"auto auto 1fr\",\n gridTemplateRows: \"auto auto 1fr\",\n height: \"100vh\",\n width: \"100vw\",\n}));\n\nconst StyledTopNavContainer = styled(\"div\")({\n gridArea: \"top-nav\",\n});\n\nexport type WideUiShellContentProps = UiShellNavComponentProps &\n UiShellContentProps;\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 WideUiShellContent = ({\n appElement,\n appElementScrollingMode,\n appSwitcherProps,\n hasStandardAppContentPadding = true,\n initialVisibleSections = [\"TopNav\", \"SideNav\", \"AppSwitcher\"],\n onError = console.error,\n optionalComponents,\n sideNavProps,\n topNavProps,\n}: WideUiShellContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const uiShellContext = useUiShellContext();\n\n const { isContentScrolled } = useScrollState(appElement);\n\n const sideNavContainerRef = useRef<HTMLDivElement>(null);\n const topNavContainerRef = useRef<HTMLDivElement>(null);\n const uiShellAppAreaRef = useRef<HTMLDivElement>(null);\n\n const { parentContainerRef } = useMatchAppElementToUiShellAppArea({\n appElement,\n appElementScrollingMode,\n paddingMode: hasStandardAppContentPadding ? \"comfortable\" : \"none\",\n uiShellAppAreaRef,\n uiShellResizableRefs: [\n sideNavContainerRef,\n topNavContainerRef,\n uiShellAppAreaRef,\n ],\n });\n\n return (\n <StyledShellContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={parentContainerRef}\n >\n <StyledBannersContainer>\n {optionalComponents?.banners}\n </StyledBannersContainer>\n\n <StyledAppSwitcherContainer>\n {\n /* If AppSwitcher should be initially visible and we have not yet received props, render AppSwitcher in the loading state */\n initialVisibleSections?.includes(\"AppSwitcher\") &&\n !appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher isLoading appIcons={[]} selectedAppName=\"\" />\n </ErrorBoundary>\n )\n }\n\n {appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher {...appSwitcherProps} />\n </ErrorBoundary>\n )}\n </StyledAppSwitcherContainer>\n\n <StyledSideNavContainer ref={sideNavContainerRef}>\n {\n /* If SideNav should be initially visible and we have not yet received props, render SideNav with minimal inputs */\n initialVisibleSections?.includes(\"SideNav\") &&\n sideNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav isLoading sideNavItems={emptySideNavItems} />\n </ErrorBoundary>\n )\n }\n\n {sideNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav\n {...{\n ...sideNavProps,\n ...(sideNavProps.hasCustomFooter &&\n optionalComponents?.sideNavFooter\n ? {\n footerComponent: optionalComponents.sideNavFooter,\n footerItems: undefined,\n hasCustomFooter: sideNavProps.hasCustomFooter,\n }\n : {\n footerItems: sideNavProps.footerItems,\n hasCustomFooter: false,\n }),\n }}\n />\n </ErrorBoundary>\n )}\n </StyledSideNavContainer>\n\n <StyledTopNavContainer ref={topNavContainerRef}>\n {\n /* If TopNav should be initially visible and we have not yet received props, render Topnav with minimal inputs */\n initialVisibleSections?.includes(\"TopNav\") &&\n topNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )\n }\n\n {topNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n {...topNavProps}\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )}\n </StyledTopNavContainer>\n\n <StyledAppContainer\n appBackgroundColor={uiShellContext?.appBackgroundColor}\n tabIndex={0}\n ref={uiShellAppAreaRef}\n >\n <InnerAppContainer isContentScrolled={isContentScrolled} />\n </StyledAppContainer>\n </StyledShellContainer>\n );\n};\n\nconst MemoizedWideUiShellContent = memo(WideUiShellContent);\nMemoizedWideUiShellContent.displayName = \"WideUiShellContent\";\n\nexport { MemoizedWideUiShellContent as WideUiShellContent };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,OAAA,GAA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AAEA,OAAQ;QAAAqB,QAAA,EAC9C,IAAAtD,WAAA,CAAAuD,GAAA,EAAC5D,OAAA,CAAA6E,MAAM;UAAA,GACDlC,WAAW;UACfmC,iBAAiB,EAAErC,kBAAkB,EAAEsC,cAAe;UACtDC,kBAAkB,EAAEvC,kBAAkB,EAAEwC;QAAgB,CACzD;MAAC,CACW,CAChB;IAAA,CACoB,CAAC,EAExB,IAAA5E,WAAA,CAAAuD,GAAA,EAACnD,kBAAkB;MACjBI,kBAAkB,EAAEgC,cAAc,EAAEhC,kBAAmB;MACvDqE,QAAQ,EAAE,CAAE;MACZxB,GAAG,EAAEN,iBAAkB;MAAAO,QAAA,EAEvB,IAAAtD,WAAA,CAAAuD,GAAA,EAAC/D,kBAAA,CAAAsF,iBAAiB;QAACpC,iBAAiB,EAAEA;MAAkB,CAAE;IAAC,CACzC,CAAC;EAAA,CACD,CAAC;AAE3B,CAAC;AAED,MAAMqC,0BAA0B,GAAAC,OAAA,CAAArD,kBAAA,GAAG,IAAAsD,WAAI,EAACtD,kBAAkB,CAAC;AAC3DoD,0BAA0B,CAACG,WAAW,GAAG,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"WideUiShellContent.cjs","names":["_styled","_interopRequireDefault","require","_react","_reactErrorBoundary","_index","_InnerAppContainer","_OdysseyDesignTokensContext","_index2","_index3","_useScrollState","_useMatchAppElementToUiShellAppArea","_UiShellProvider","_uiShellSharedConstants","_jsxRuntime","e","__esModule","default","appSwitcherDefaultAppIcons","StyledAppContainer","styled","shouldForwardProp","prop","appBackgroundColor","backgroundColor","gridArea","pointerEvents","position","StyledAppSwitcherContainer","StyledBannersContainer","StyledSideNavContainer","StyledShellContainer","odysseyDesignTokens","HueNeutral50","display","gridGap","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","width","StyledTopNavContainer","WideUiShellContent","appElement","appElementScrollingMode","appSwitcherProps","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","optionalComponents","sideNavProps","topNavProps","useOdysseyDesignTokens","uiShellContext","useUiShellContext","isContentScrolled","useScrollState","sideNavContainerRef","useRef","topNavContainerRef","uiShellAppAreaRef","parentContainerRef","useMatchAppElementToUiShellAppArea","paddingMode","uiShellResizableRefs","jsxs","ref","children","jsx","banners","includes","ErrorBoundary","fallback","AppSwitcher","appIcons","isLoading","selectedAppName","undefined","SideNav","sideNavItems","emptySideNavItems","hasCustomFooter","sideNavFooter","footerComponent","footerItems","TopNav","leftSideComponent","topNavLeftSide","rightSideComponent","topNavRightSide","tabIndex","InnerAppContainer","MemoizedWideUiShellContent","exports","memo","displayName"],"sources":["../../../src/ui-shell/WideUiShellContent.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, useRef } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { AppSwitcher } from \"./AppSwitcher/index.js\";\nimport { AppSwitcherAppIconData } from \"./AppSwitcher/AppSwitcherApp.js\";\nimport { InnerAppContainer } from \"./InnerAppContainer.js\";\nimport {\n useOdysseyDesignTokens,\n type DesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { SideNav } from \"./SideNav/index.js\";\nimport { TopNav } from \"./TopNav/index.js\";\nimport { useScrollState } from \"./useScrollState.js\";\nimport { useMatchAppElementToUiShellAppArea } from \"./useMatchAppElementToUiShellAppArea.js\";\nimport {\n UiShellNavComponentProps,\n UiShellContentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellColors, useUiShellContext } from \"./UiShellProvider.js\";\nimport { emptySideNavItems } from \"./uiShellSharedConstants.js\";\n\nconst appSwitcherDefaultAppIcons = [] satisfies AppSwitcherAppIconData[];\n\nconst StyledAppContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"appBackgroundColor\" && prop !== \"odysseyDesignTokens\",\n})<{\n appBackgroundColor?: UiShellColors[\"appBackgroundColor\"];\n}>(({ appBackgroundColor }) => ({\n backgroundColor: appBackgroundColor,\n gridArea: \"app-content\",\n pointerEvents: \"none\",\n position: \"relative\",\n}));\n\nconst StyledAppSwitcherContainer = styled(\"div\")({\n gridArea: \"app-switcher\",\n});\n\nconst StyledBannersContainer = styled(\"div\")({\n gridArea: \"banners\",\n});\n\nconst StyledSideNavContainer = styled(\"div\")({\n gridArea: \"side-nav\",\n});\n\nconst StyledShellContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n display: \"grid\",\n gridGap: 0,\n gridTemplateAreas: `\n \"banners banners banners\"\n \"app-switcher side-nav top-nav\"\n \"app-switcher side-nav app-content\"\n `,\n gridTemplateColumns: \"auto auto 1fr\",\n gridTemplateRows: \"auto auto 1fr\",\n height: \"100vh\",\n width: \"100vw\",\n}));\n\nconst StyledTopNavContainer = styled(\"div\")({\n gridArea: \"top-nav\",\n});\n\nexport type WideUiShellContentProps = UiShellNavComponentProps &\n UiShellContentProps;\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 WideUiShellContent = ({\n appElement,\n appElementScrollingMode,\n appSwitcherProps,\n hasStandardAppContentPadding = true,\n initialVisibleSections = [\"TopNav\", \"SideNav\", \"AppSwitcher\"],\n onError = console.error,\n optionalComponents,\n sideNavProps,\n topNavProps,\n}: WideUiShellContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const uiShellContext = useUiShellContext();\n\n const { isContentScrolled } = useScrollState(appElement);\n\n const sideNavContainerRef = useRef<HTMLDivElement>(null);\n const topNavContainerRef = useRef<HTMLDivElement>(null);\n const uiShellAppAreaRef = useRef<HTMLDivElement>(null);\n\n const { parentContainerRef } = useMatchAppElementToUiShellAppArea({\n appElement,\n appElementScrollingMode,\n paddingMode: hasStandardAppContentPadding ? \"comfortable\" : \"none\",\n uiShellAppAreaRef,\n uiShellResizableRefs: [\n sideNavContainerRef,\n topNavContainerRef,\n uiShellAppAreaRef,\n ],\n });\n\n return (\n <StyledShellContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={parentContainerRef}\n >\n <StyledBannersContainer>\n {optionalComponents?.banners}\n </StyledBannersContainer>\n\n <StyledAppSwitcherContainer>\n {\n /* If AppSwitcher should be initially visible and we have not yet received props, render AppSwitcher in the loading state */\n initialVisibleSections?.includes(\"AppSwitcher\") &&\n !appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher\n appIcons={appSwitcherDefaultAppIcons}\n isLoading\n selectedAppName=\"\"\n />\n </ErrorBoundary>\n )\n }\n\n {appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher {...appSwitcherProps} />\n </ErrorBoundary>\n )}\n </StyledAppSwitcherContainer>\n\n <StyledSideNavContainer ref={sideNavContainerRef}>\n {\n /* If SideNav should be initially visible and we have not yet received props, render SideNav with minimal inputs */\n initialVisibleSections?.includes(\"SideNav\") &&\n sideNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav isLoading sideNavItems={emptySideNavItems} />\n </ErrorBoundary>\n )\n }\n\n {sideNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav\n {...{\n ...sideNavProps,\n ...(sideNavProps.hasCustomFooter &&\n optionalComponents?.sideNavFooter\n ? {\n footerComponent: optionalComponents.sideNavFooter,\n footerItems: undefined,\n hasCustomFooter: sideNavProps.hasCustomFooter,\n }\n : {\n footerItems: sideNavProps.footerItems,\n hasCustomFooter: false,\n }),\n }}\n />\n </ErrorBoundary>\n )}\n </StyledSideNavContainer>\n\n <StyledTopNavContainer ref={topNavContainerRef}>\n {\n /* If TopNav should be initially visible and we have not yet received props, render Topnav with minimal inputs */\n initialVisibleSections?.includes(\"TopNav\") &&\n topNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )\n }\n\n {topNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n {...topNavProps}\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )}\n </StyledTopNavContainer>\n\n <StyledAppContainer\n appBackgroundColor={uiShellContext?.appBackgroundColor}\n tabIndex={0}\n ref={uiShellAppAreaRef}\n >\n <InnerAppContainer isContentScrolled={isContentScrolled} />\n </StyledAppContainer>\n </StyledShellContainer>\n );\n};\n\nconst MemoizedWideUiShellContent = memo(WideUiShellContent);\nMemoizedWideUiShellContent.displayName = \"WideUiShellContent\";\n\nexport { MemoizedWideUiShellContent as WideUiShellContent };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,mCAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAV,OAAA;AACA,IAAAW,uBAAA,GAAAX,OAA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ErC,kBAAkB,EAAEsC,cAAe;UACtDC,kBAAkB,EAAEvC,kBAAkB,EAAEwC;QAAgB,CACzD;MAAC,CACW,CAChB;IAAA,CACoB,CAAC,EAExB,IAAA7E,WAAA,CAAAwD,GAAA,EAACnD,kBAAkB;MACjBI,kBAAkB,EAAEgC,cAAc,EAAEhC,kBAAmB;MACvDqE,QAAQ,EAAE,CAAE;MACZxB,GAAG,EAAEN,iBAAkB;MAAAO,QAAA,EAEvB,IAAAvD,WAAA,CAAAwD,GAAA,EAAChE,kBAAA,CAAAuF,iBAAiB;QAACpC,iBAAiB,EAAEA;MAAkB,CAAE;IAAC,CACzC,CAAC;EAAA,CACD,CAAC;AAE3B,CAAC;AAED,MAAMqC,0BAA0B,GAAAC,OAAA,CAAArD,kBAAA,GAAG,IAAAsD,WAAI,EAACtD,kBAAkB,CAAC;AAC3DoD,0BAA0B,CAACG,WAAW,GAAG,oBAAoB","ignoreList":[]}
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  UiShell: true,
8
- adminAppUiShellBreakpoints: true
8
+ adminAppUiShellBreakpoints: true,
9
+ useUiShellBreakpoints: true
9
10
  };
10
11
  Object.defineProperty(exports, "UiShell", {
11
12
  enumerable: true,
@@ -19,6 +20,12 @@ Object.defineProperty(exports, "adminAppUiShellBreakpoints", {
19
20
  return _useUiShellBreakpoints.adminAppUiShellBreakpoints;
20
21
  }
21
22
  });
23
+ Object.defineProperty(exports, "useUiShellBreakpoints", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return _useUiShellBreakpoints.useUiShellBreakpoints;
27
+ }
28
+ });
22
29
  var _index = require("./AppSwitcher/index.cjs");
23
30
  Object.keys(_index).forEach(function (key) {
24
31
  if (key === "default" || key === "__esModule") return;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["_index","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_InnerAppContainer","_NarrowUiShellContent","_renderUiShell","_index2","_index3","_uiShellContentTypes","_useHasUiShell","_WideUiShellContent","_renderReactInWebComponent","_UiShell","_useUiShellBreakpoints"],"sources":["../../../src/ui-shell/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./AppSwitcher/index.js\";\nexport * from \"./InnerAppContainer.js\";\nexport * from \"./NarrowUiShellContent.js\";\nexport * from \"./renderUiShell.js\";\nexport * from \"./SideNav/index.js\";\nexport * from \"./TopNav/index.js\";\nexport * from \"./uiShellContentTypes.js\";\nexport * from \"./useHasUiShell.js\";\nexport * from \"./WideUiShellContent.js\";\n\nexport * from \"../web-component/renderReactInWebComponent.js\"; // This is located here because some teams use React v17, and this uses React v18's `ReactDOM/client` import which isn't in older versions.\n\nexport { UiShell, type UiShellProps } from \"./UiShell.js\";\nexport { adminAppUiShellBreakpoints } from \"./useUiShellBreakpoints.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GA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A;AAAA;AAEA,IAAAiB,0BAAA,GAAArB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAmB,0BAAA,EAAAlB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAiB,0BAAA,CAAAjB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAS,0BAAA,CAAAjB,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAkB,QAAA,GAAAtB,OAAA;AACA,IAAAuB,sBAAA,GAAAvB,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.cjs","names":["_index","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_InnerAppContainer","_NarrowUiShellContent","_renderUiShell","_index2","_index3","_uiShellContentTypes","_useHasUiShell","_WideUiShellContent","_renderReactInWebComponent","_UiShell","_useUiShellBreakpoints"],"sources":["../../../src/ui-shell/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./AppSwitcher/index.js\";\nexport * from \"./InnerAppContainer.js\";\nexport * from \"./NarrowUiShellContent.js\";\nexport * from \"./renderUiShell.js\";\nexport * from \"./SideNav/index.js\";\nexport * from \"./TopNav/index.js\";\nexport * from \"./uiShellContentTypes.js\";\nexport * from \"./useHasUiShell.js\";\nexport * from \"./WideUiShellContent.js\";\n\nexport * from \"../web-component/renderReactInWebComponent.js\"; // This is located here because some teams use React v17, and this uses React v18's `ReactDOM/client` import which isn't in older versions.\n\nexport { UiShell, type UiShellProps } from \"./UiShell.js\";\nexport {\n adminAppUiShellBreakpoints,\n useUiShellBreakpoints,\n} from \"./useUiShellBreakpoints.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,kBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,kBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,kBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,kBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;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[]}
@@ -100,7 +100,7 @@ const useMatchAppElementToUiShellAppArea = ({
100
100
  };
101
101
  }
102
102
  return () => {};
103
- }, [appElement, appContainerElementStyles, uiShellAppAreaRef]);
103
+ }, [appElement, appContainerElementStyles, uiShellAppAreaRef, uiShellResizableRefs]);
104
104
  return {
105
105
  parentContainerRef
106
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useMatchAppElementToUiShellAppArea.cjs","names":["_react","require","_OdysseyDesignTokensContext","convertCamelCaseToKebabCase","string","replace","toLowerCase","exports","setStylesToMatchElement","additionalStyles","appContainerElement","appContentReferenceElement","parentElement","appContentReferenceRectangle","getBoundingClientRect","parentElementRectangle","style","setProperty","top","left","width","height","Object","entries","forEach","cssPropertyName","cssPropertyValue","String","useMatchAppElementToUiShellAppArea","appElement","appElementScrollingMode","paddingMode","uiShellAppAreaRef","uiShellResizableRefs","odysseyDesignTokens","useOdysseyDesignTokens","parentContainerRef","useRef","appContainerElementStyles","useMemo","boxSizing","zIndex","paddingBlock","Spacing5","paddingInline","Spacing8","overflowX","overflowY","useEffect","current","animationFrameId","updateStyles","cancelAnimationFrame","requestAnimationFrame","resizingElements","map","resizingRef","filter","element","Boolean","observer","ResizeObserver","resizingElement","addEventListener","observe","disconnect","removeEventListener"],"sources":["../../../src/ui-shell/useMatchAppElementToUiShellAppArea.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { CSSProperties, RefObject, useEffect, useMemo, useRef } from \"react\";\n\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { UiShellContentProps } from \"./uiShellContentTypes.js\";\n\nexport const convertCamelCaseToKebabCase = (string: string) =>\n string.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n\nexport const setStylesToMatchElement = ({\n additionalStyles,\n appContainerElement,\n appContentReferenceElement,\n parentElement,\n}: {\n additionalStyles: CSSProperties;\n appContainerElement: HTMLElement;\n appContentReferenceElement: HTMLElement;\n parentElement: HTMLElement;\n}) => {\n const appContentReferenceRectangle =\n appContentReferenceElement.getBoundingClientRect();\n const parentElementRectangle = parentElement.getBoundingClientRect();\n\n appContainerElement.style.setProperty(\"position\", \"absolute\");\n appContainerElement.style.setProperty(\n \"top\",\n `${appContentReferenceRectangle.top - parentElementRectangle.top}px`,\n );\n appContainerElement.style.setProperty(\n \"left\",\n `${appContentReferenceRectangle.left - parentElementRectangle.left}px`,\n );\n appContainerElement.style.setProperty(\n \"width\",\n `${appContentReferenceRectangle.width}px`,\n );\n appContainerElement.style.setProperty(\n \"height\",\n `${appContentReferenceRectangle.height}px`,\n );\n\n (\n Object.entries(additionalStyles) as Array<\n [\n keyof typeof additionalStyles,\n (typeof additionalStyles)[keyof typeof additionalStyles],\n ]\n >\n ).forEach(([cssPropertyName, cssPropertyValue]) => {\n appContainerElement.style.setProperty(\n convertCamelCaseToKebabCase(cssPropertyName),\n String(cssPropertyValue),\n );\n });\n};\n\nexport type UseMatchAppElementToUiShellAppAreaProps = {\n /**\n * Padding around the app area. \"comfortable\" is designed for wider views whereas \"compact\" is designed for narrower views.\n */\n paddingMode: \"comfortable\" | \"compact\" | \"none\";\n /**\n * Ref for the App Container in UI Shell. This should be the one inside the Shell, **not** the element we're going to align.\n */\n uiShellAppAreaRef: RefObject<HTMLDivElement>;\n /**\n * Array of refs of items that indirectly resize the app content area such as \"side nav\" and \"top nav\".\n */\n uiShellResizableRefs: Array<RefObject<HTMLDivElement>>;\n} & Pick<UiShellContentProps, \"appElement\" | \"appElementScrollingMode\">;\n\nexport const useMatchAppElementToUiShellAppArea = ({\n appElement,\n appElementScrollingMode,\n paddingMode,\n uiShellAppAreaRef,\n uiShellResizableRefs,\n}: UseMatchAppElementToUiShellAppAreaProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const parentContainerRef = useRef<HTMLDivElement>(null);\n\n const appContainerElementStyles = useMemo<CSSProperties>(\n () => ({\n boxSizing: \"border-box\",\n zIndex: 1,\n ...(paddingMode === \"comfortable\"\n ? {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing8,\n }\n : {}),\n\n ...(paddingMode === \"compact\"\n ? {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing5,\n }\n : {}),\n\n ...(appElementScrollingMode === \"horizontal\" ||\n appElementScrollingMode === \"both\"\n ? {\n overflowX: \"auto\",\n }\n : {\n overflowX: \"hidden\",\n }),\n\n ...(appElementScrollingMode === \"vertical\" ||\n appElementScrollingMode === \"both\"\n ? {\n overflowY: \"auto\",\n }\n : {\n overflowY: \"hidden\",\n }),\n }),\n [appElementScrollingMode, paddingMode, odysseyDesignTokens],\n );\n\n useEffect(() => {\n // Once `appContainerRef` is rendered, we can position `appContainerElement` on top to match.\n if (uiShellAppAreaRef.current && appElement && parentContainerRef.current) {\n let animationFrameId: number;\n\n const updateStyles = () => {\n cancelAnimationFrame(animationFrameId);\n\n animationFrameId = requestAnimationFrame(() => {\n if (uiShellAppAreaRef.current && parentContainerRef.current) {\n setStylesToMatchElement({\n additionalStyles: appContainerElementStyles,\n appContentReferenceElement: uiShellAppAreaRef.current,\n appContainerElement: appElement,\n parentElement: parentContainerRef.current,\n });\n }\n });\n };\n\n // These refs might change by the time we unsubscribe, so we need to keep references to the original elements.\n const resizingElements = uiShellResizableRefs\n .map((resizingRef) => resizingRef.current)\n .filter((element): element is NonNullable<typeof element> =>\n Boolean(element),\n );\n\n // Set up a mutation observer to sync later updates\n const observer = new ResizeObserver(updateStyles);\n\n // document.addEventListener(\"ready\", updateStyles);\n\n resizingElements.forEach((resizingElement) => {\n resizingElement.addEventListener(\"transitionend\", updateStyles);\n\n observer.observe(resizingElement);\n });\n\n // Set the initial styles\n updateStyles();\n\n return () => {\n observer.disconnect();\n\n resizingElements.forEach((resizingElement) => {\n resizingElement.removeEventListener(\"transitionend\", updateStyles);\n });\n };\n }\n return () => {};\n }, [appElement, appContainerElementStyles, uiShellAppAreaRef]);\n\n return {\n parentContainerRef,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,2BAAA,GAAAD,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,MAAME,2BAA2B,GAAIC,MAAc,IACxDA,MAAM,CAACC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAACC,WAAW,CAAC,CAAC;AAACC,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA;AAE3C,MAAMK,uBAAuB,GAAGA,CAAC;EACtCC,gBAAgB;EAChBC,mBAAmB;EACnBC,0BAA0B;EAC1BC;AAMF,CAAC,KAAK;EACJ,MAAMC,4BAA4B,GAChCF,0BAA0B,CAACG,qBAAqB,CAAC,CAAC;EACpD,MAAMC,sBAAsB,GAAGH,aAAa,CAACE,qBAAqB,CAAC,CAAC;EAEpEJ,mBAAmB,CAACM,KAAK,CAACC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC;EAC7DP,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,KAAK,EACL,GAAGJ,4BAA4B,CAACK,GAAG,GAAGH,sBAAsB,CAACG,GAAG,IAClE,CAAC;EACDR,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,MAAM,EACN,GAAGJ,4BAA4B,CAACM,IAAI,GAAGJ,sBAAsB,CAACI,IAAI,IACpE,CAAC;EACDT,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,OAAO,EACP,GAAGJ,4BAA4B,CAACO,KAAK,IACvC,CAAC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IAAK;UAC5CA,eAAe,CAACI,mBAAmB,CAAC,eAAe,EAAEf,YAAY,CAAC;QACpE,CAAC,CAAC;MACJ,CAAC;IACH;IACA,OAAO,MAAM,CAAC,CAAC;EACjB,CAAC,EAAE,CAACtB,UAAU,EAAES,yBAAyB,EAAEN,iBAAiB,CAAC,CAAC;EAE9D,OAAO;IACLI;EACF,CAAC;AACH,CAAC;AAAC7B,OAAA,CAAAqB,kCAAA,GAAAA,kCAAA","ignoreList":[]}
1
+ {"version":3,"file":"useMatchAppElementToUiShellAppArea.cjs","names":["_react","require","_OdysseyDesignTokensContext","convertCamelCaseToKebabCase","string","replace","toLowerCase","exports","setStylesToMatchElement","additionalStyles","appContainerElement","appContentReferenceElement","parentElement","appContentReferenceRectangle","getBoundingClientRect","parentElementRectangle","style","setProperty","top","left","width","height","Object","entries","forEach","cssPropertyName","cssPropertyValue","String","useMatchAppElementToUiShellAppArea","appElement","appElementScrollingMode","paddingMode","uiShellAppAreaRef","uiShellResizableRefs","odysseyDesignTokens","useOdysseyDesignTokens","parentContainerRef","useRef","appContainerElementStyles","useMemo","boxSizing","zIndex","paddingBlock","Spacing5","paddingInline","Spacing8","overflowX","overflowY","useEffect","current","animationFrameId","updateStyles","cancelAnimationFrame","requestAnimationFrame","resizingElements","map","resizingRef","filter","element","Boolean","observer","ResizeObserver","resizingElement","addEventListener","observe","disconnect","removeEventListener"],"sources":["../../../src/ui-shell/useMatchAppElementToUiShellAppArea.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { CSSProperties, RefObject, useEffect, useMemo, useRef } from \"react\";\n\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\nimport { UiShellContentProps } from \"./uiShellContentTypes.js\";\n\nexport const convertCamelCaseToKebabCase = (string: string) =>\n string.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n\nexport const setStylesToMatchElement = ({\n additionalStyles,\n appContainerElement,\n appContentReferenceElement,\n parentElement,\n}: {\n additionalStyles: CSSProperties;\n appContainerElement: HTMLElement;\n appContentReferenceElement: HTMLElement;\n parentElement: HTMLElement;\n}) => {\n const appContentReferenceRectangle =\n appContentReferenceElement.getBoundingClientRect();\n const parentElementRectangle = parentElement.getBoundingClientRect();\n\n appContainerElement.style.setProperty(\"position\", \"absolute\");\n appContainerElement.style.setProperty(\n \"top\",\n `${appContentReferenceRectangle.top - parentElementRectangle.top}px`,\n );\n appContainerElement.style.setProperty(\n \"left\",\n `${appContentReferenceRectangle.left - parentElementRectangle.left}px`,\n );\n appContainerElement.style.setProperty(\n \"width\",\n `${appContentReferenceRectangle.width}px`,\n );\n appContainerElement.style.setProperty(\n \"height\",\n `${appContentReferenceRectangle.height}px`,\n );\n\n (\n Object.entries(additionalStyles) as Array<\n [\n keyof typeof additionalStyles,\n (typeof additionalStyles)[keyof typeof additionalStyles],\n ]\n >\n ).forEach(([cssPropertyName, cssPropertyValue]) => {\n appContainerElement.style.setProperty(\n convertCamelCaseToKebabCase(cssPropertyName),\n String(cssPropertyValue),\n );\n });\n};\n\nexport type UseMatchAppElementToUiShellAppAreaProps = {\n /**\n * Padding around the app area. \"comfortable\" is designed for wider views whereas \"compact\" is designed for narrower views.\n */\n paddingMode: \"comfortable\" | \"compact\" | \"none\";\n /**\n * Ref for the App Container in UI Shell. This should be the one inside the Shell, **not** the element we're going to align.\n */\n uiShellAppAreaRef: RefObject<HTMLDivElement>;\n /**\n * Array of refs of items that indirectly resize the app content area such as \"side nav\" and \"top nav\".\n */\n uiShellResizableRefs: Array<RefObject<HTMLDivElement>>;\n} & Pick<UiShellContentProps, \"appElement\" | \"appElementScrollingMode\">;\n\nexport const useMatchAppElementToUiShellAppArea = ({\n appElement,\n appElementScrollingMode,\n paddingMode,\n uiShellAppAreaRef,\n uiShellResizableRefs,\n}: UseMatchAppElementToUiShellAppAreaProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const parentContainerRef = useRef<HTMLDivElement>(null);\n\n const appContainerElementStyles = useMemo<CSSProperties>(\n () => ({\n boxSizing: \"border-box\",\n zIndex: 1,\n ...(paddingMode === \"comfortable\"\n ? {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing8,\n }\n : {}),\n\n ...(paddingMode === \"compact\"\n ? {\n paddingBlock: odysseyDesignTokens.Spacing5,\n paddingInline: odysseyDesignTokens.Spacing5,\n }\n : {}),\n\n ...(appElementScrollingMode === \"horizontal\" ||\n appElementScrollingMode === \"both\"\n ? {\n overflowX: \"auto\",\n }\n : {\n overflowX: \"hidden\",\n }),\n\n ...(appElementScrollingMode === \"vertical\" ||\n appElementScrollingMode === \"both\"\n ? {\n overflowY: \"auto\",\n }\n : {\n overflowY: \"hidden\",\n }),\n }),\n [appElementScrollingMode, paddingMode, odysseyDesignTokens],\n );\n\n useEffect(() => {\n // Once `appContainerRef` is rendered, we can position `appContainerElement` on top to match.\n if (uiShellAppAreaRef.current && appElement && parentContainerRef.current) {\n let animationFrameId: number;\n\n const updateStyles = () => {\n cancelAnimationFrame(animationFrameId);\n\n animationFrameId = requestAnimationFrame(() => {\n if (uiShellAppAreaRef.current && parentContainerRef.current) {\n setStylesToMatchElement({\n additionalStyles: appContainerElementStyles,\n appContentReferenceElement: uiShellAppAreaRef.current,\n appContainerElement: appElement,\n parentElement: parentContainerRef.current,\n });\n }\n });\n };\n\n // These refs might change by the time we unsubscribe, so we need to keep references to the original elements.\n const resizingElements = uiShellResizableRefs\n .map((resizingRef) => resizingRef.current)\n .filter((element): element is NonNullable<typeof element> =>\n Boolean(element),\n );\n\n // Set up a mutation observer to sync later updates\n const observer = new ResizeObserver(updateStyles);\n\n // document.addEventListener(\"ready\", updateStyles);\n\n resizingElements.forEach((resizingElement) => {\n resizingElement.addEventListener(\"transitionend\", updateStyles);\n\n observer.observe(resizingElement);\n });\n\n // Set the initial styles\n updateStyles();\n\n return () => {\n observer.disconnect();\n\n resizingElements.forEach((resizingElement) => {\n resizingElement.removeEventListener(\"transitionend\", updateStyles);\n });\n };\n }\n return () => {};\n }, [\n appElement,\n appContainerElementStyles,\n uiShellAppAreaRef,\n uiShellResizableRefs,\n ]);\n\n return {\n parentContainerRef,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,2BAAA,GAAAD,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOO,MAAME,2BAA2B,GAAIC,MAAc,IACxDA,MAAM,CAACC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAACC,WAAW,CAAC,CAAC;AAACC,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA;AAE3C,MAAMK,uBAAuB,GAAGA,CAAC;EACtCC,gBAAgB;EAChBC,mBAAmB;EACnBC,0BAA0B;EAC1BC;AAMF,CAAC,KAAK;EACJ,MAAMC,4BAA4B,GAChCF,0BAA0B,CAACG,qBAAqB,CAAC,CAAC;EACpD,MAAMC,sBAAsB,GAAGH,aAAa,CAACE,qBAAqB,CAAC,CAAC;EAEpEJ,mBAAmB,CAACM,KAAK,CAACC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC;EAC7DP,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,KAAK,EACL,GAAGJ,4BAA4B,CAACK,GAAG,GAAGH,sBAAsB,CAACG,GAAG,IAClE,CAAC;EACDR,mBAAmB,CAACM,KAAK,CAACC,WAAW,CACnC,MAAM,EACN,GAAGJ,4BAA4B,CAACM,IAAI,GAAGJ,sBAAsB,CAACI,IAAI,IAC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AAC;MAEd,OAAO,MAAM;QACXS,QAAQ,CAACK,UAAU,CAAC,CAAC;QAErBX,gBAAgB,CAAC9B,OAAO,CAAEsC,eAAe,IAAK;UAC5CA,eAAe,CAACI,mBAAmB,CAAC,eAAe,EAAEf,YAAY,CAAC;QACpE,CAAC,CAAC;MACJ,CAAC;IACH;IACA,OAAO,MAAM,CAAC,CAAC;EACjB,CAAC,EAAE,CACDtB,UAAU,EACVS,yBAAyB,EACzBN,iBAAiB,EACjBC,oBAAoB,CACrB,CAAC;EAEF,OAAO;IACLG;EACF,CAAC;AACH,CAAC;AAAC7B,OAAA,CAAAqB,kCAAA,GAAAA,kCAAA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useScrollState = void 0;
6
+ exports.useScrollState = exports.getNestedScrollContainers = exports.getIsYAxisScrolling = exports.getIsYAxisScrollContainer = exports.getIsScrollHeightElement = exports.fakeDefaultContainerElement = void 0;
7
7
  var _react = require("react");
8
8
  /*!
9
9
  * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
@@ -17,29 +17,79 @@ var _react = require("react");
17
17
  * See the License for the specific language governing permissions and limitations under the License.
18
18
  */
19
19
 
20
- const useScrollState = scrollableContentElement => {
21
- const [isContentScrolled, setIsContentScrolled] = (0, _react.useState)(false);
22
- const scrollableElement = (0, _react.useMemo)(() => scrollableContentElement, [scrollableContentElement]);
23
- (0, _react.useEffect)(() => {
24
- if (scrollableElement) {
25
- let requestedAnimationFrameId;
26
- const updateScrollState = () => {
27
- cancelAnimationFrame(requestedAnimationFrameId);
28
- requestedAnimationFrameId = requestAnimationFrame(() => {
29
- setIsContentScrolled(scrollableElement.scrollTop > 0);
30
- });
31
- };
20
+ const getIsScrollHeightElement = ({
21
+ containerElement,
22
+ scrollableElement
23
+ }) => {
24
+ const containerElementHeight = containerElement.getBoundingClientRect().height;
25
+ const scrollableElementHeight = scrollableElement.getBoundingClientRect().height;
26
+ return scrollableElementHeight - containerElementHeight >= 0;
27
+ };
28
+ exports.getIsScrollHeightElement = getIsScrollHeightElement;
29
+ const getIsYAxisScrollContainer = element => {
30
+ const overflowY = window.getComputedStyle(element).overflowY;
31
+ return overflowY === "auto" || overflowY === "scroll";
32
+ };
33
+ exports.getIsYAxisScrollContainer = getIsYAxisScrollContainer;
34
+ const getIsYAxisScrolling = element => element.scrollHeight > element.clientHeight ? getIsYAxisScrollContainer(element) : false;
35
+ exports.getIsYAxisScrolling = getIsYAxisScrolling;
36
+ const getNestedScrollContainers = containerElement => Array.from(containerElement.querySelectorAll("*")).filter(element => getIsYAxisScrollContainer(element)).filter(scrollableElement => getIsScrollHeightElement({
37
+ containerElement,
38
+ scrollableElement
39
+ }));
40
+ exports.getNestedScrollContainers = getNestedScrollContainers;
41
+ const fakeDefaultContainerElement = exports.fakeDefaultContainerElement = document.createElement("div");
42
+ const useScrollState = containerElement => {
43
+ const [isScrolled, setIsScrolled] = (0, _react.useState)(false);
44
+ const requestedAnimationFrameIdRef = (0, _react.useRef)(0);
45
+ const scrollableElementsRef = (0, _react.useRef)([]);
46
+ const updateScrollState = (0, _react.useCallback)(() => {
47
+ cancelAnimationFrame(requestedAnimationFrameIdRef.current);
48
+ requestedAnimationFrameIdRef.current = requestAnimationFrame(() => {
49
+ setIsScrolled(scrollableElementsRef.current.reduce((isScrolled, scrollableElement) => isScrolled || scrollableElement.scrollTop > 0, false));
50
+ });
51
+ }, []);
52
+ const addScrollEventListeners = (0, _react.useCallback)(() => {
53
+ scrollableElementsRef.current.forEach(scrollableElement => {
32
54
  scrollableElement.addEventListener("scroll", updateScrollState);
33
- updateScrollState();
34
- return () => {
35
- scrollableElement.removeEventListener("scroll", updateScrollState);
36
- cancelAnimationFrame(requestedAnimationFrameId);
37
- };
55
+ });
56
+ }, [updateScrollState]);
57
+ const removeScrollEventListeners = (0, _react.useCallback)(() => {
58
+ scrollableElementsRef.current.forEach(scrollableElement => {
59
+ scrollableElement.removeEventListener("scroll", updateScrollState);
60
+ });
61
+ }, [updateScrollState]);
62
+ const updateScrollableElements = (0, _react.useCallback)(() => {
63
+ const computedContainerElement = containerElement || fakeDefaultContainerElement;
64
+ scrollableElementsRef.current = getNestedScrollContainers(computedContainerElement).concat(computedContainerElement);
65
+ }, [containerElement]);
66
+ const updateScrollListeners = (0, _react.useCallback)(() => {
67
+ removeScrollEventListeners();
68
+ updateScrollableElements();
69
+ addScrollEventListeners();
70
+ updateScrollState();
71
+ }, [addScrollEventListeners, removeScrollEventListeners, updateScrollableElements, updateScrollState]);
72
+ (0, _react.useEffect)(() => {
73
+ const mutationObserver = new MutationObserver(() => {
74
+ updateScrollListeners();
75
+ });
76
+ if (containerElement) {
77
+ mutationObserver.observe(containerElement, {
78
+ attributes: true,
79
+ attributeFilter: ["style"],
80
+ childList: true,
81
+ subtree: true
82
+ });
38
83
  }
39
- return () => {};
40
- }, [scrollableElement]);
84
+ updateScrollListeners();
85
+ return () => {
86
+ cancelAnimationFrame(requestedAnimationFrameIdRef.current);
87
+ removeScrollEventListeners();
88
+ mutationObserver.disconnect();
89
+ };
90
+ }, [containerElement, removeScrollEventListeners, updateScrollListeners]);
41
91
  return {
42
- isContentScrolled
92
+ isContentScrolled: isScrolled
43
93
  };
44
94
  };
45
95
  exports.useScrollState = useScrollState;
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollState.cjs","names":["_react","require","useScrollState","scrollableContentElement","isContentScrolled","setIsContentScrolled","useState","scrollableElement","useMemo","useEffect","requestedAnimationFrameId","updateScrollState","cancelAnimationFrame","requestAnimationFrame","scrollTop","addEventListener","removeEventListener","exports"],"sources":["../../../src/ui-shell/useScrollState.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useEffect, useMemo, useState } from \"react\";\n\nexport const useScrollState = <\n ScrollableContentElement extends HTMLElement = HTMLDivElement,\n>(\n scrollableContentElement?: ScrollableContentElement,\n) => {\n const [isContentScrolled, setIsContentScrolled] = useState(false);\n\n const scrollableElement = useMemo(\n () => scrollableContentElement,\n [scrollableContentElement],\n );\n\n useEffect(() => {\n if (scrollableElement) {\n let requestedAnimationFrameId: number;\n\n const updateScrollState = () => {\n cancelAnimationFrame(requestedAnimationFrameId);\n\n requestedAnimationFrameId = requestAnimationFrame(() => {\n setIsContentScrolled(scrollableElement.scrollTop > 0);\n });\n };\n\n scrollableElement.addEventListener(\"scroll\", updateScrollState);\n\n updateScrollState();\n\n return () => {\n scrollableElement.removeEventListener(\"scroll\", updateScrollState);\n\n cancelAnimationFrame(requestedAnimationFrameId);\n };\n }\n\n return () => {};\n }, [scrollableElement]);\n\n return {\n isContentScrolled,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMC,cAAc,GAGzBC,wBAAmD,IAChD;EACH,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEjE,MAAMC,iBAAiB,GAAG,IAAAC,cAAO,EAC/B,MAAML,wBAAwB,EAC9B,CAACA,wBAAwB,CAC3B,CAAC;EAED,IAAAM,gBAAS,EAAC,MAAM;IACd,IAAIF,iBAAiB,EAAE;MACrB,IAAIG,yBAAiC;MAErC,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;QAC9BC,oBAAoB,CAACF,yBAAyB,CAAC;QAE/CA,yBAAyB,GAAGG,qBAAqB,CAAC,MAAM;UACtDR,oBAAoB,CAACE,iBAAiB,CAACO,SAAS,GAAG,CAAC,CAAC;QACvD,CAAC,CAAC;MACJ,CAAC;MAEDP,iBAAiB,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,iBAAiB,CAAC;MAE/DA,iBAAiB,CAAC,CAAC;MAEnB,OAAO,MAAM;QACXJ,iBAAiB,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,iBAAiB,CAAC;QAElEC,oBAAoB,CAACF,yBAAyB,CAAC;MACjD,CAAC;IACH;IAEA,OAAO,MAAM,CAAC,CAAC;EACjB,CAAC,EAAE,CAACH,iBAAiB,CAAC,CAAC;EAEvB,OAAO;IACLH;EACF,CAAC;AACH,CAAC;AAACa,OAAA,CAAAf,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"file":"useScrollState.cjs","names":["_react","require","getIsScrollHeightElement","containerElement","scrollableElement","containerElementHeight","getBoundingClientRect","height","scrollableElementHeight","exports","getIsYAxisScrollContainer","element","overflowY","window","getComputedStyle","getIsYAxisScrolling","scrollHeight","clientHeight","getNestedScrollContainers","Array","from","querySelectorAll","filter","fakeDefaultContainerElement","document","createElement","useScrollState","isScrolled","setIsScrolled","useState","requestedAnimationFrameIdRef","useRef","scrollableElementsRef","updateScrollState","useCallback","cancelAnimationFrame","current","requestAnimationFrame","reduce","scrollTop","addScrollEventListeners","forEach","addEventListener","removeScrollEventListeners","removeEventListener","updateScrollableElements","computedContainerElement","concat","updateScrollListeners","useEffect","mutationObserver","MutationObserver","observe","attributes","attributeFilter","childList","subtree","disconnect","isContentScrolled"],"sources":["../../../src/ui-shell/useScrollState.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport const getIsScrollHeightElement = ({\n containerElement,\n scrollableElement,\n}: {\n containerElement: HTMLElement;\n scrollableElement: HTMLElement;\n}) => {\n const containerElementHeight =\n containerElement.getBoundingClientRect().height;\n const scrollableElementHeight =\n scrollableElement.getBoundingClientRect().height;\n\n return scrollableElementHeight - containerElementHeight >= 0;\n};\n\nexport const getIsYAxisScrollContainer = (element: HTMLElement) => {\n const overflowY = window.getComputedStyle(element).overflowY;\n\n return overflowY === \"auto\" || overflowY === \"scroll\";\n};\n\nexport const getIsYAxisScrolling = (element: HTMLElement) =>\n element.scrollHeight > element.clientHeight\n ? getIsYAxisScrollContainer(element)\n : false;\n\nexport const getNestedScrollContainers = (containerElement: HTMLElement) =>\n Array.from(containerElement.querySelectorAll<HTMLElement>(\"*\"))\n .filter((element) => getIsYAxisScrollContainer(element))\n .filter((scrollableElement) =>\n getIsScrollHeightElement({\n containerElement,\n scrollableElement,\n }),\n );\n\nexport const fakeDefaultContainerElement = document.createElement(\"div\");\n\nexport const useScrollState = <\n ContainerElement extends HTMLElement = HTMLDivElement,\n>(\n /**\n * The element containing a scroll area.\n */\n containerElement: ContainerElement | null,\n) => {\n const [isScrolled, setIsScrolled] = useState(false);\n\n const requestedAnimationFrameIdRef = useRef(0);\n const scrollableElementsRef = useRef<HTMLElement[]>([]);\n\n const updateScrollState = useCallback(() => {\n cancelAnimationFrame(requestedAnimationFrameIdRef.current);\n\n requestedAnimationFrameIdRef.current = requestAnimationFrame(() => {\n setIsScrolled(\n scrollableElementsRef.current.reduce(\n (isScrolled, scrollableElement) =>\n isScrolled || scrollableElement.scrollTop > 0,\n false,\n ),\n );\n });\n }, []);\n\n const addScrollEventListeners = useCallback(() => {\n scrollableElementsRef.current.forEach((scrollableElement) => {\n scrollableElement.addEventListener(\"scroll\", updateScrollState);\n });\n }, [updateScrollState]);\n\n const removeScrollEventListeners = useCallback(() => {\n scrollableElementsRef.current.forEach((scrollableElement) => {\n scrollableElement.removeEventListener(\"scroll\", updateScrollState);\n });\n }, [updateScrollState]);\n\n const updateScrollableElements = useCallback(() => {\n const computedContainerElement =\n containerElement || fakeDefaultContainerElement;\n\n scrollableElementsRef.current = getNestedScrollContainers(\n computedContainerElement,\n ).concat(computedContainerElement);\n }, [containerElement]);\n\n const updateScrollListeners = useCallback(() => {\n removeScrollEventListeners();\n updateScrollableElements();\n addScrollEventListeners();\n updateScrollState();\n }, [\n addScrollEventListeners,\n removeScrollEventListeners,\n updateScrollableElements,\n updateScrollState,\n ]);\n\n useEffect(() => {\n const mutationObserver = new MutationObserver(() => {\n updateScrollListeners();\n });\n\n if (containerElement) {\n mutationObserver.observe(containerElement, {\n attributes: true,\n attributeFilter: [\"style\"],\n childList: true,\n subtree: true,\n });\n }\n\n updateScrollListeners();\n\n return () => {\n cancelAnimationFrame(requestedAnimationFrameIdRef.current);\n removeScrollEventListeners();\n mutationObserver.disconnect();\n };\n }, [containerElement, removeScrollEventListeners, updateScrollListeners]);\n\n return {\n isContentScrolled: isScrolled,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMC,wBAAwB,GAAGA,CAAC;EACvCC,gBAAgB;EAChBC;AAIF,CAAC,KAAK;EACJ,MAAMC,sBAAsB,GAC1BF,gBAAgB,CAACG,qBAAqB,CAAC,CAAC,CAACC,MAAM;EACjD,MAAMC,uBAAuB,GAC3BJ,iBAAiB,CAACE,qBAAqB,CAAC,CAAC,CAACC,MAAM;EAElD,OAAOC,uBAAuB,GAAGH,sBAAsB,IAAI,CAAC;AAC9D,CAAC;AAACI,OAAA,CAAAP,wBAAA,GAAAA,wBAAA;AAEK,MAAMQ,yBAAyB,GAAIC,OAAoB,IAAK;EAC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,GAAG,IAAIC,gBAAgB,CAAC,MAAM;MAClDH,qBAAqB,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,IAAI7C,gBAAgB,EAAE;MACpB+C,gBAAgB,CAACE,OAAO,CAACjD,gBAAgB,EAAE;QACzCkD,UAAU,EAAE,IAAI;QAChBC,eAAe,EAAE,CAAC,OAAO,CAAC;QAC1BC,SAAS,EAAE,IAAI;QACfC,OAAO,EAAE;MACX,CAAC,CAAC;IACJ;IAEAR,qBAAqB,CAAC,CAAC;IAEvB,OAAO,MAAM;MACXb,oBAAoB,CAACL,4BAA4B,CAACM,OAAO,CAAC;MAC1DO,0BAA0B,CAAC,CAAC;MAC5BO,gBAAgB,CAACO,UAAU,CAAC,CAAC;IAC/B,CAAC;EACH,CAAC,EAAE,CAACtD,gBAAgB,EAAEwC,0BAA0B,EAAEK,qBAAqB,CAAC,CAAC;EAEzE,OAAO;IACLU,iBAAiB,EAAE/B;EACrB,CAAC;AACH,CAAC;AAAClB,OAAA,CAAAiB,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMountLifecycleEffect = void 0;
7
+ var _react = require("react");
8
+ /*!
9
+ * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
10
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
11
+ *
12
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ *
17
+ * See the License for the specific language governing permissions and limitations under the License.
18
+ */
19
+
20
+ const useMountLifecycleEffect = ({
21
+ onMount,
22
+ onUpdate
23
+ }) => {
24
+ const hasSetSessionStorageRef = (0, _react.useRef)(false);
25
+ const onMountRef = (0, _react.useRef)(onMount);
26
+ (0, _react.useEffect)(() => {
27
+ if (hasSetSessionStorageRef.current) {
28
+ onUpdate?.();
29
+ } else {
30
+ hasSetSessionStorageRef.current = true;
31
+ onMountRef.current?.();
32
+ }
33
+ }, [onUpdate]);
34
+ };
35
+ exports.useMountLifecycleEffect = useMountLifecycleEffect;
36
+ //# sourceMappingURL=useMountLifecycleEffect.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMountLifecycleEffect.cjs","names":["_react","require","useMountLifecycleEffect","onMount","onUpdate","hasSetSessionStorageRef","useRef","onMountRef","useEffect","current","exports"],"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 hasSetSessionStorageRef = useRef(false);\n const onMountRef = useRef(onMount);\n\n useEffect(() => {\n if (hasSetSessionStorageRef.current) {\n onUpdate?.();\n } else {\n hasSetSessionStorageRef.current = true;\n onMountRef.current?.();\n }\n }, [onUpdate]);\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,MAAMC,uBAAuB,GAAGA,CAAC;EACtCC,OAAO;EACPC;AAIF,CAAC,KAAK;EACJ,MAAMC,uBAAuB,GAAG,IAAAC,aAAM,EAAC,KAAK,CAAC;EAC7C,MAAMC,UAAU,GAAG,IAAAD,aAAM,EAACH,OAAO,CAAC;EAElC,IAAAK,gBAAS,EAAC,MAAM;IACd,IAAIH,uBAAuB,CAACI,OAAO,EAAE;MACnCL,QAAQ,GAAG,CAAC;IACd,CAAC,MAAM;MACLC,uBAAuB,CAACI,OAAO,GAAG,IAAI;MACtCF,UAAU,CAACE,OAAO,GAAG,CAAC;IACxB;EACF,CAAC,EAAE,CAACL,QAAQ,CAAC,CAAC;AAChB,CAAC;AAACM,OAAA,CAAAR,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSessionStorageState = exports.getSessionStorageValue = void 0;
7
+ var _react = require("react");
8
+ var _useMountLifecycleEffect = require("./useMountLifecycleEffect.cjs");
9
+ /*!
10
+ * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
11
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
12
+ *
13
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ *
18
+ * See the License for the specific language governing permissions and limitations under the License.
19
+ */
20
+
21
+ const getSessionStorageValue = key => {
22
+ const sessionStorageValue = window.sessionStorage.getItem(key);
23
+ try {
24
+ if (typeof sessionStorageValue === "string") {
25
+ return JSON.parse(sessionStorageValue);
26
+ }
27
+ return null;
28
+ } catch {
29
+ if (typeof sessionStorageValue === "string") {
30
+ return sessionStorageValue;
31
+ }
32
+ return null;
33
+ }
34
+ };
35
+ exports.getSessionStorageValue = getSessionStorageValue;
36
+ const useSessionStorageState = ({
37
+ initialState,
38
+ key
39
+ }) => {
40
+ if (!key) {
41
+ throw new Error("You must pass a value for `key`.");
42
+ }
43
+ const sessionState = (0, _react.useMemo)(() => getSessionStorageValue(key), [key]);
44
+ const setSessionState = (0, _react.useCallback)(value => {
45
+ const sessionStorageState = typeof value === "undefined" ? "" : JSON.stringify(value);
46
+ window.sessionStorage.setItem(key, sessionStorageState);
47
+ }, [key]);
48
+ const [localState, setLocalState] = (0, _react.useState)(() => sessionState ?? initialState);
49
+ (0, _react.useEffect)(() => {
50
+ setSessionState(localState);
51
+ }, [localState, setSessionState]);
52
+ const onUpdate = (0, _react.useCallback)(() => {
53
+ setLocalState(sessionState ?? initialState);
54
+ }, [initialState, sessionState]);
55
+ (0, _useMountLifecycleEffect.useMountLifecycleEffect)({
56
+ onUpdate
57
+ });
58
+ return {
59
+ sessionState: localState,
60
+ setSessionState: setLocalState
61
+ };
62
+ };
63
+ exports.useSessionStorageState = useSessionStorageState;
64
+ //# sourceMappingURL=useSessionStorageState.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSessionStorageState.cjs","names":["_react","require","_useMountLifecycleEffect","getSessionStorageValue","key","sessionStorageValue","window","sessionStorage","getItem","JSON","parse","exports","useSessionStorageState","initialState","Error","sessionState","useMemo","setSessionState","useCallback","value","sessionStorageState","stringify","setItem","localState","setLocalState","useState","useEffect","onUpdate","useMountLifecycleEffect"],"sources":["../../src/useSessionStorageState.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 { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useMountLifecycleEffect } from \"./useMountLifecycleEffect.js\";\n\nexport const getSessionStorageValue = <Value>(key: string): Value | null => {\n const sessionStorageValue = window.sessionStorage.getItem(key);\n\n try {\n if (typeof sessionStorageValue === \"string\") {\n return JSON.parse(sessionStorageValue) as Value;\n }\n\n return null;\n } catch {\n if (typeof sessionStorageValue === \"string\") {\n return sessionStorageValue as Value;\n }\n\n return null;\n }\n};\n\nexport const useSessionStorageState = <Value>({\n initialState,\n key,\n}: {\n initialState: Value;\n key: string;\n}) => {\n if (!key) {\n throw new Error(\"You must pass a value for `key`.\");\n }\n\n const sessionState = useMemo(() => getSessionStorageValue<Value>(key), [key]);\n\n const setSessionState = useCallback(\n (value: Value) => {\n const sessionStorageState =\n typeof value === \"undefined\" ? \"\" : JSON.stringify(value);\n\n window.sessionStorage.setItem(key, sessionStorageState);\n },\n [key],\n );\n\n const [localState, setLocalState] = useState<Value>(\n () => sessionState ?? initialState,\n );\n\n // This keeps session storage's state based on local state.\n useEffect(() => {\n setSessionState(localState);\n }, [localState, setSessionState]);\n\n // This updates when `key` is updated.\n const onUpdate = useCallback(() => {\n setLocalState(sessionState ?? initialState);\n }, [initialState, sessionState]);\n\n useMountLifecycleEffect({\n onUpdate,\n });\n\n return {\n sessionState: localState,\n setSessionState: setLocalState,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,MAAME,sBAAsB,GAAWC,GAAW,IAAmB;EAC1E,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,cAAc,CAACC,OAAO,CAACJ,GAAG,CAAC;EAE9D,IAAI;IACF,IAAI,OAAOC,mBAAmB,KAAK,QAAQ,EAAE;MAC3C,OAAOI,IAAI,CAACC,KAAK,CAACL,mBAAmB,CAAC;IACxC;IAEA,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,IAAI,OAAOA,mBAAmB,KAAK,QAAQ,EAAE;MAC3C,OAA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
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createReactRootElements = void 0;
6
+ exports.stylesRootElementId = exports.createReactRootElements = exports.appRootElementId = void 0;
7
7
  /*!
8
8
  * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
9
9
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -16,12 +16,14 @@ exports.createReactRootElements = void 0;
16
16
  * See the License for the specific language governing permissions and limitations under the License.
17
17
  */
18
18
 
19
+ const appRootElementId = exports.appRootElementId = "app-root";
20
+ const stylesRootElementId = exports.stylesRootElementId = "style-root";
19
21
  const createReactRootElements = () => {
20
22
  const appRootElement = document.createElement("div");
21
23
  const stylesRootElement = document.createElement("div");
22
24
  appRootElement.style.setProperty("height", "inherit");
23
- appRootElement.setAttribute("id", "app-root");
24
- stylesRootElement.setAttribute("id", "style-root");
25
+ appRootElement.setAttribute("id", appRootElementId);
26
+ stylesRootElement.setAttribute("id", stylesRootElementId);
25
27
  stylesRootElement.setAttribute("nonce", window.cspNonce);
26
28
  return {
27
29
  appRootElement,
@@ -1 +1 @@
1
- {"version":3,"file":"createReactRootElements.cjs","names":["createReactRootElements","appRootElement","document","createElement","stylesRootElement","style","setProperty","setAttribute","window","cspNonce","exports"],"sources":["../../../src/web-component/createReactRootElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport type ReactRootElements = {\n /**\n * The element your root React component renders into.\n * React has to render or portal somewhere, and this element can be used for that root element.\n */\n appRootElement: HTMLDivElement;\n /**\n * In React apps, your styles typically go in `document.head`, but you may want to render them somewhere else.\n *\n * Specifically when rendering in a web component, there is no `<head>`, so you have to create a spot for styles to render.\n */\n stylesRootElement: HTMLDivElement | HTMLHeadElement;\n};\n\nexport const createReactRootElements = () => {\n const appRootElement = document.createElement(\"div\");\n const stylesRootElement = document.createElement(\"div\");\n\n // This `div` may cause layout issues unless it inherits the parent's height.\n appRootElement.style.setProperty(\"height\", \"inherit\");\n\n appRootElement.setAttribute(\"id\", \"app-root\");\n stylesRootElement.setAttribute(\"id\", \"style-root\");\n stylesRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n return {\n appRootElement,\n stylesRootElement,\n } satisfies ReactRootElements;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBO,MAAMA,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,cAAc,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACpD,MAAMC,iBAAiB,GAAGF,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGvDF,cAAc,CAACI,KAAK,CAACC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;EAErDL,cAAc,CAACM,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC;EAC7CH,iBAAiB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EAClDH,iBAAiB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAExD,OAAO;IACLR,cAAc;IACdG;EACF,CAAC;AACH,CAAC;AAACM,OAAA,CAAAV,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"file":"createReactRootElements.cjs","names":["appRootElementId","exports","stylesRootElementId","createReactRootElements","appRootElement","document","createElement","stylesRootElement","style","setProperty","setAttribute","window","cspNonce"],"sources":["../../../src/web-component/createReactRootElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport type ReactRootElements = {\n /**\n * The element your root React component renders into.\n * React has to render or portal somewhere, and this element can be used for that root element.\n */\n appRootElement: HTMLDivElement;\n /**\n * In React apps, your styles typically go in `document.head`, but you may want to render them somewhere else.\n *\n * Specifically when rendering in a web component, there is no `<head>`, so you have to create a spot for styles to render.\n */\n stylesRootElement: HTMLDivElement | HTMLHeadElement;\n};\n\nexport const appRootElementId = \"app-root\";\nexport const stylesRootElementId = \"style-root\";\n\nexport const createReactRootElements = () => {\n const appRootElement = document.createElement(\"div\");\n const stylesRootElement = document.createElement(\"div\");\n\n // This `div` may cause layout issues unless it inherits the parent's height.\n appRootElement.style.setProperty(\"height\", \"inherit\");\n\n appRootElement.setAttribute(\"id\", appRootElementId);\n stylesRootElement.setAttribute(\"id\", stylesRootElementId);\n stylesRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n return {\n appRootElement,\n stylesRootElement,\n } satisfies ReactRootElements;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,UAAU;AACnC,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,YAAY;AAExC,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,cAAc,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACpD,MAAMC,iBAAiB,GAAGF,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGvDF,cAAc,CAACI,KAAK,CAACC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;EAErDL,cAAc,CAACM,YAAY,CAAC,IAAI,EAAEV,gBAAgB,CAAC;EACnDO,iBAAiB,CAACG,YAAY,CAAC,IAAI,EAAER,mBAAmB,CAAC;EACzDK,iBAAiB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAExD,OAAO;IACLR,cAAc;IACdG;EACF,CAAC;AACH,CAAC;AAACN,OAAA,CAAAE,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -62,7 +62,7 @@ export const useOdysseyDateFields = ({
62
62
  uncontrolledValue: defaultValue
63
63
  }));
64
64
  const defaultedLanguageCode = isInvalidLocale ? "en-US" : language.replaceAll("_", "-");
65
- const isValidTimeZone = timeZone => DateTime.local().setZone(timeZone).isValid;
65
+ const isValidTimeZone = useCallback(timeZone => DateTime.local().setZone(timeZone).isValid, []);
66
66
  const formatDateTimeToUtcIsoDateString = useCallback(value => value.toUTC().toISO() || undefined, []);
67
67
  const shouldDisableDate = useCallback(date => !isDateEnabled(new Date(date?.toJSDate())) || false, [isDateEnabled]);
68
68
  const shouldDisableMonth = useCallback(date => !isMonthEnabled(new Date(date?.toJSDate())) || false, [isMonthEnabled]);
@@ -85,7 +85,7 @@ export const useOdysseyDateFields = ({
85
85
  }
86
86
  }
87
87
  return null;
88
- }, [defaultValue, validationDateRanges, value]);
88
+ }, [defaultValue, value]);
89
89
  const onTimeZoneChange = useCallback(timeZone => {
90
90
  if (timeZone && isValidTimeZone(timeZone)) {
91
91
  setInternalTimeZone(timeZone);