@okta/odyssey-react-mui 1.33.0 → 1.35.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 (88) hide show
  1. package/dist/cjs/Buttons/BaseButton.cjs +1 -1
  2. package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
  3. package/dist/cjs/Dialog.cjs +9 -1
  4. package/dist/cjs/Dialog.cjs.map +1 -1
  5. package/dist/cjs/Select.cjs +3 -1
  6. package/dist/cjs/Select.cjs.map +1 -1
  7. package/dist/cjs/Typography.cjs +8 -4
  8. package/dist/cjs/Typography.cjs.map +1 -1
  9. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
  10. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
  11. package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +269 -0
  12. package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs.map +1 -0
  13. package/dist/cjs/labs/OdysseyPickers/index.cjs +9 -1
  14. package/dist/cjs/labs/OdysseyPickers/index.cjs.map +1 -1
  15. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +19 -6
  16. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  17. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +2 -2
  18. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  19. package/dist/cjs/ui-shell/SideNav/SideNavLogo.cjs +3 -3
  20. package/dist/cjs/ui-shell/SideNav/SideNavLogo.cjs.map +1 -1
  21. package/dist/cjs/ui-shell/UiShell.cjs +6 -0
  22. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  23. package/dist/cjs/ui-shell/UiShellProvider.cjs +11 -8
  24. package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
  25. package/dist/cjs/ui-shell/WideUiShellContent.cjs +2 -2
  26. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  27. package/dist/cjs/ui-shell/renderUiShell.cjs +13 -0
  28. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  29. package/dist/cjs/ui-shell/uiShellSharedConstants.cjs +2 -1
  30. package/dist/cjs/ui-shell/uiShellSharedConstants.cjs.map +1 -1
  31. package/dist/esm/Buttons/BaseButton.js +1 -1
  32. package/dist/esm/Buttons/BaseButton.js.map +1 -1
  33. package/dist/esm/Dialog.js +9 -1
  34. package/dist/esm/Dialog.js.map +1 -1
  35. package/dist/esm/Select.js +3 -1
  36. package/dist/esm/Select.js.map +1 -1
  37. package/dist/esm/Typography.js +8 -4
  38. package/dist/esm/Typography.js.map +1 -1
  39. package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
  40. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
  41. package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +263 -0
  42. package/dist/esm/labs/OdysseyPickers/SearchDropdown.js.map +1 -0
  43. package/dist/esm/labs/OdysseyPickers/index.js +1 -0
  44. package/dist/esm/labs/OdysseyPickers/index.js.map +1 -1
  45. package/dist/esm/ui-shell/NarrowUiShellContent.js +20 -7
  46. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  47. package/dist/esm/ui-shell/SideNav/SideNav.js +2 -2
  48. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  49. package/dist/esm/ui-shell/SideNav/SideNavLogo.js +3 -3
  50. package/dist/esm/ui-shell/SideNav/SideNavLogo.js.map +1 -1
  51. package/dist/esm/ui-shell/UiShell.js +6 -0
  52. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  53. package/dist/esm/ui-shell/UiShellProvider.js +9 -7
  54. package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
  55. package/dist/esm/ui-shell/WideUiShellContent.js +1 -1
  56. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  57. package/dist/esm/ui-shell/renderUiShell.js +13 -0
  58. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  59. package/dist/esm/ui-shell/uiShellSharedConstants.js +1 -0
  60. package/dist/esm/ui-shell/uiShellSharedConstants.js.map +1 -1
  61. package/dist/index.cjs +1 -1
  62. package/dist/index.mjs +1 -1
  63. package/dist/index.scss +1 -1
  64. package/dist/tsconfig.production.tsbuildinfo +1 -1
  65. package/dist/types/Buttons/BaseButton.d.ts +1 -1
  66. package/dist/types/Dialog.d.ts.map +1 -1
  67. package/dist/types/Select.d.ts +1 -0
  68. package/dist/types/Select.d.ts.map +1 -1
  69. package/dist/types/Typography.d.ts +6 -2
  70. package/dist/types/Typography.d.ts.map +1 -1
  71. package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
  72. package/dist/types/labs/OdysseyPickers/SearchDropdown.d.ts +33 -0
  73. package/dist/types/labs/OdysseyPickers/SearchDropdown.d.ts.map +1 -0
  74. package/dist/types/labs/OdysseyPickers/index.d.ts +2 -0
  75. package/dist/types/labs/OdysseyPickers/index.d.ts.map +1 -1
  76. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  77. package/dist/types/ui-shell/SideNav/SideNavLogo.d.ts +1 -1
  78. package/dist/types/ui-shell/SideNav/SideNavLogo.d.ts.map +1 -1
  79. package/dist/types/ui-shell/UiShell.d.ts +5 -20
  80. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  81. package/dist/types/ui-shell/UiShellProvider.d.ts +33 -6
  82. package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
  83. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  84. package/dist/types/ui-shell/renderUiShell.d.ts +2 -0
  85. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  86. package/dist/types/ui-shell/uiShellSharedConstants.d.ts +1 -0
  87. package/dist/types/ui-shell/uiShellSharedConstants.d.ts.map +1 -1
  88. package/package.json +6 -6
@@ -50,6 +50,14 @@ export const renderUiShell = ({
50
50
  publish: publishPropChanges,
51
51
  subscribe: subscribeToReactAppSubscribed
52
52
  });
53
+ const {
54
+ publish: closeRightSideMenu,
55
+ subscribe: subscribeToCloseRightSideMenu
56
+ } = createMessageBus();
57
+ const {
58
+ publish: closeSideNavMenu,
59
+ subscribe: subscribeToCloseSideNavMenu
60
+ } = createMessageBus();
53
61
  const slottedElements = Object.fromEntries(Object.entries(optionalComponentSlotNames).map(([optionalComponentKey, slotName]) => {
54
62
  const element = document.createElement("div");
55
63
  element.setAttribute("slot", slotName);
@@ -67,6 +75,7 @@ export const renderUiShell = ({
67
75
  appBackgroundContrastMode: appBackgroundContrastMode,
68
76
  appElement: appElement,
69
77
  appElementScrollingMode: appElementScrollingMode,
78
+ closeSideNavMenu: closeSideNavMenu,
70
79
  hasStandardAppContentPadding: hasStandardAppContentPadding,
71
80
  initialVisibleSections: initialVisibleSections,
72
81
  onError: onError,
@@ -75,6 +84,8 @@ export const renderUiShell = ({
75
84
  name: slotName
76
85
  })])),
77
86
  sideNavBackgroundColor: sideNavBackgroundColor,
87
+ subscribeToCloseRightSideMenu: subscribeToCloseRightSideMenu,
88
+ subscribeToCloseSideNavMenu: subscribeToCloseSideNavMenu,
78
89
  subscribeToPropChanges: subscribeToPropChanges,
79
90
  topNavBackgroundColor: topNavBackgroundColor,
80
91
  uiShellAppElement: reactRootElements.appRootElement,
@@ -87,6 +98,8 @@ export const renderUiShell = ({
87
98
  parentElement.appendChild(appElement);
88
99
  return {
89
100
  appElement,
101
+ closeRightSideMenu,
102
+ closeSideNavMenu,
90
103
  setComponentProps: publishAfterReactAppReadyForProps,
91
104
  slottedElements,
92
105
  uiShellElement
@@ -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","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","parentElement","sideNavBackgroundColor","topNavBackgroundColor","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","appendChild","setComponentProps"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus } from \"./createMessageBus.js\";\nimport { UiShell, UiShellProps } from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n parentElement,\n sideNavBackgroundColor,\n topNavBackgroundColor,\n}: {\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n >;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentParentElement: parentElement,\n webComponentChildren,\n });\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,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;E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C4C,iBAAiB,EAAGC,iBAAiB,IACnC3C,IAAA,CAACP,aAAa;MAACmD,QAAQ,EAAE5C,IAAA;QAAK;MAAU,CAAE,CAAE;MAACe,OAAO,EAAEA,OAAQ;MAAA8B,QAAA,EAC5D7C,IAAA,CAACJ,OAAO;QACNY,kBAAkB,EAAEA,kBAAmB;QACvCC,yBAAyB,EAAEA,yBAA0B;QACrDC,UAAU,EAAEA,UAAW;QACvBE,uBAAuB,EAAEA,uBAAwB;QACjDC,4BAA4B,EAAEA,4BAA6B;QAC3DC,sBAAsB,EAAEA,sBAAuB;QAC/CC,OAAO,EAAEA,OAAQ;QACjB+B,qBAAqB,EAAElB,0BAA2B;QAElDmB,kBAAkB,EAAEf,MAAM,CAACC,WAAW,CACpCD,MAAM,CAACE,OAAO,CAACjC,0BAA0B,CAAC,CAACkC,GAAG,CAC5C,CAAC,CAACC,oBAAoB,EAAEC,QAAQ,CAAC,KAAK,CACpCD,oBAAoB,EACpBpC,IAAA;UAAMgD,IAAI,EAAEX;QAAS,CAAE,CAAC,CAE5B,CACF,CAAE;QACFlB,sBAAsB,EAAEA,sBAAuB;QAC/CQ,sBAAsB,EAAEA,sBAAuB;QAC/CP,qBAAqB,EAAEA,qBAAsB;QAC7C6B,iBAAiB,EAAEN,iBAAiB,CAACO,cAAe;QACpDC,oBAAoB,EAAER,iBAAiB,CAACS;MAAkB,CAC3D;IAAC,CACW,CAChB;IACDC,yBAAyB,EAAEnC,aAAa;IACxCqB;EACF,CAAC,CAAC;EAEFrB,aAAa,CAACoC,WAAW,CAAC5C,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACV6C,iBAAiB,EAAEzB,iCAAiC;IACpDC,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","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","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","appendChild","setComponentProps"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus } from \"./createMessageBus.js\";\nimport { UiShell, UiShellProps } from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n parentElement,\n sideNavBackgroundColor,\n topNavBackgroundColor,\n}: {\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const {\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 Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n >;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n 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 webComponentParentElement: parentElement,\n webComponentChildren,\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;AAC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ACpCD,oBAAoB,EACpBxC,IAAA;UAAMoD,IAAI,EAAEX;QAAS,CAAE,CAAC,CAE5B,CACF,CAAE;QACFtB,sBAAsB,EAAEA,sBAAuB;QAC/Ca,6BAA6B,EAAEA,6BAA8B;QAC7DE,2BAA2B,EAAEA,2BAA4B;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;IACDC,yBAAyB,EAAEvC,aAAa;IACxCyB;EACF,CAAC,CAAC;EAEFzB,aAAa,CAACwC,WAAW,CAAChD,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACVqB,kBAAkB;IAClBE,gBAAgB;IAChB0B,iBAAiB,EAAE7B,iCAAiC;IACpDK,eAAe;IACfU;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -13,4 +13,5 @@ export const SIDE_NAV_WIDTH = "300px";
13
13
  export const TOP_NAV_HEIGHT = `${64 / 14}rem`;
14
14
  export const UI_SHELL_BASE_Z_INDEX = 100;
15
15
  export const UI_SHELL_OVERLAY_Z_INDEX = 200;
16
+ export const emptySideNavItems = [];
16
17
  //# sourceMappingURL=uiShellSharedConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uiShellSharedConstants.js","names":["SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION","SIDE_NAV_WIDTH","TOP_NAV_HEIGHT","UI_SHELL_BASE_Z_INDEX","UI_SHELL_OVERLAY_Z_INDEX"],"sources":["../../../src/ui-shell/uiShellSharedConstants.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// It's important to bring all our constant values together, so we can change them in one location and ensure the values are all correct relative to each other.\n// This also lends us the capability of swapping these out for a more robust solution in the future.\n\n/* The side nav collapse icon is placed absolutely from the top (Logo container + nav header height) to align it in the middle of the nav header text */\nexport const SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION = \"77px\";\n\nexport const SIDE_NAV_WIDTH = \"300px\";\n\nexport const TOP_NAV_HEIGHT = `${64 / 14}rem`;\n\nexport const UI_SHELL_BASE_Z_INDEX = 100;\n\nexport const UI_SHELL_OVERLAY_Z_INDEX = 200;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAMA,OAAO,MAAMA,wCAAwC,GAAG,MAAM;AAE9D,OAAO,MAAMC,cAAc,GAAG,OAAO;AAErC,OAAO,MAAMC,cAAc,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK;AAE7C,OAAO,MAAMC,qBAAqB,GAAG,GAAG;AAExC,OAAO,MAAMC,wBAAwB,GAAG,GAAG","ignoreList":[]}
1
+ {"version":3,"file":"uiShellSharedConstants.js","names":["SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION","SIDE_NAV_WIDTH","TOP_NAV_HEIGHT","UI_SHELL_BASE_Z_INDEX","UI_SHELL_OVERLAY_Z_INDEX","emptySideNavItems"],"sources":["../../../src/ui-shell/uiShellSharedConstants.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { SideNavProps } from \"./SideNav/types.js\";\n\n// It's important to bring all our constant values together, so we can change them in one location and ensure the values are all correct relative to each other.\n// This also lends us the capability of swapping these out for a more robust solution in the future.\n\n/* The side nav collapse icon is placed absolutely from the top (Logo container + nav header height) to align it in the middle of the nav header text */\nexport const SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION = \"77px\";\n\nexport const SIDE_NAV_WIDTH = \"300px\";\n\nexport const TOP_NAV_HEIGHT = `${64 / 14}rem`;\n\nexport const UI_SHELL_BASE_Z_INDEX = 100;\n\nexport const UI_SHELL_OVERLAY_Z_INDEX = 200;\n\nexport const emptySideNavItems = [] satisfies SideNavProps[\"sideNavItems\"];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAQA,OAAO,MAAMA,wCAAwC,GAAG,MAAM;AAE9D,OAAO,MAAMC,cAAc,GAAG,OAAO;AAErC,OAAO,MAAMC,cAAc,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK;AAE7C,OAAO,MAAMC,qBAAqB,GAAG,GAAG;AAExC,OAAO,MAAMC,wBAAwB,GAAG,GAAG;AAE3C,OAAO,MAAMC,iBAAiB,GAAG,EAAyC","ignoreList":[]}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 23:10:14 GMT
3
+ * Generated on Thu, 27 Mar 2025 19:35:44 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 27 Feb 2025 23:10:14 GMT
3
+ * Generated on Thu, 27 Mar 2025 19:35:44 GMT
4
4
  */
5
5
 
6
6
  export const BorderColorControl = "#8d8d8d";
package/dist/index.scss CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Thu, 27 Feb 2025 23:10:14 GMT
4
+ * Generated on Thu, 27 Mar 2025 19:35:44 GMT
5
5
  */
6
6
 
7
7
  $border-color-control: #8d8d8d !default;