@okta/odyssey-react-mui 1.67.0 → 1.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Accordion.cjs +1 -1
- package/dist/cjs/Autocomplete.cjs +1 -1
- package/dist/cjs/Badge.cjs +1 -1
- package/dist/cjs/Banner.cjs +1 -1
- package/dist/cjs/Banner.cjs.map +1 -1
- package/dist/cjs/Box.cjs +1 -1
- package/dist/cjs/Breadcrumbs.cjs +1 -1
- package/dist/cjs/Buttons/BaseButton.cjs +24 -6
- package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
- package/dist/cjs/Buttons/BaseMenuButton.cjs +1 -1
- package/dist/cjs/Buttons/Button.cjs +1 -1
- package/dist/cjs/Buttons/MenuButton.cjs +1 -1
- package/dist/cjs/Buttons/MenuItem.cjs +1 -1
- package/dist/cjs/Callout.cjs +1 -1
- package/dist/cjs/Callout.cjs.map +1 -1
- package/dist/cjs/Card.cjs +1 -1
- package/dist/cjs/Charts/ChartError.cjs +73 -0
- package/dist/cjs/Charts/ChartError.cjs.map +1 -0
- package/dist/cjs/Charts/ChartFrame.cjs +112 -0
- package/dist/cjs/Charts/ChartFrame.cjs.map +1 -0
- package/dist/cjs/Charts/ChartPopoverContent.cjs +56 -0
- package/dist/cjs/Charts/ChartPopoverContent.cjs.map +1 -0
- package/dist/cjs/Charts/LineChart.cjs +268 -0
- package/dist/cjs/Charts/LineChart.cjs.map +1 -0
- package/dist/cjs/Charts/chartTokens.cjs +117 -0
- package/dist/cjs/Charts/chartTokens.cjs.map +1 -0
- package/dist/cjs/Charts/chartTypes.cjs +6 -0
- package/dist/cjs/Charts/chartTypes.cjs.map +1 -0
- package/dist/cjs/Charts/formatChartValue.cjs +38 -0
- package/dist/cjs/Charts/formatChartValue.cjs.map +1 -0
- package/dist/cjs/Charts/getChartSeriesPointData.cjs +52 -0
- package/dist/cjs/Charts/getChartSeriesPointData.cjs.map +1 -0
- package/dist/cjs/Charts/hasDuplicateSeries.cjs +21 -0
- package/dist/cjs/Charts/hasDuplicateSeries.cjs.map +1 -0
- package/dist/cjs/Charts/index.cjs +13 -0
- package/dist/cjs/Charts/index.cjs.map +1 -0
- package/dist/cjs/Charts/resolveChartLocale.cjs +28 -0
- package/dist/cjs/Charts/resolveChartLocale.cjs.map +1 -0
- package/dist/cjs/Charts/useChartValueFormatter.cjs +35 -0
- package/dist/cjs/Charts/useChartValueFormatter.cjs.map +1 -0
- package/dist/cjs/Charts/useStableValue.cjs +28 -0
- package/dist/cjs/Charts/useStableValue.cjs.map +1 -0
- package/dist/cjs/CircularProgress.cjs +1 -1
- package/dist/cjs/ConditionalWrapper.cjs +1 -1
- package/dist/cjs/DataTable/DataTable.cjs +1 -1
- package/dist/cjs/DataTable/DataTableRowActions.cjs +1 -1
- package/dist/cjs/DataTable/DataTableSettings.cjs +1 -1
- package/dist/cjs/DatePickers/DateField.cjs +1 -1
- package/dist/cjs/DatePickers/DateFieldActionBar.cjs +1 -1
- package/dist/cjs/DatePickers/DateFieldLocalizationProvider.cjs +1 -1
- package/dist/cjs/DatePickers/DateFieldLocalizationProvider.cjs.map +1 -1
- package/dist/cjs/DatePickers/DatePicker.cjs +3 -4
- package/dist/cjs/DatePickers/DatePicker.cjs.map +1 -1
- package/dist/cjs/DatePickers/TimeZonePicker.cjs +1 -1
- package/dist/cjs/DatePickers/useOdysseyDateFields.cjs +10 -28
- package/dist/cjs/DatePickers/useOdysseyDateFields.cjs.map +1 -1
- package/dist/cjs/Dialog.cjs +1 -1
- package/dist/cjs/Drawer.cjs +19 -6
- package/dist/cjs/Drawer.cjs.map +1 -1
- package/dist/cjs/EmptyState.cjs +1 -1
- package/dist/cjs/ErrorMessageList.cjs +1 -1
- package/dist/cjs/Field.cjs +1 -1
- package/dist/cjs/FieldError.cjs +1 -1
- package/dist/cjs/FieldHint.cjs +1 -1
- package/dist/cjs/FieldLabel.cjs +1 -1
- package/dist/cjs/Fields/Checkbox.cjs +1 -1
- package/dist/cjs/Fields/CheckboxGroup.cjs +1 -1
- package/dist/cjs/Fields/Radio.cjs +1 -1
- package/dist/cjs/Fields/RadioGroup.cjs +1 -1
- package/dist/cjs/Fieldset.cjs +1 -1
- package/dist/cjs/FileUploader/FileUploadIllustration.cjs +1 -1
- package/dist/cjs/FileUploader/FileUploadPreview.cjs +1 -1
- package/dist/cjs/FileUploader/FileUploader.cjs +1 -1
- package/dist/cjs/Form.cjs +1 -1
- package/dist/cjs/FullScreenOverlay.cjs +1 -1
- package/dist/cjs/FullScreenOverlayContext.cjs +1 -1
- package/dist/cjs/HintLink.cjs +1 -1
- package/dist/cjs/IconWithTooltip.cjs +1 -1
- package/dist/cjs/Link.cjs +1 -1
- package/dist/cjs/MuiPropsChild.cjs +1 -1
- package/dist/cjs/NativeSelect.cjs +1 -1
- package/dist/cjs/OdysseyCacheProvider.cjs +1 -1
- package/dist/cjs/OdysseyProvider.cjs +1 -1
- package/dist/cjs/OdysseyThemeProvider.cjs +3 -2
- package/dist/cjs/OdysseyThemeProvider.cjs.map +1 -1
- package/dist/cjs/OdysseyThemeProviderPropsContext.cjs +1 -1
- package/dist/cjs/OdysseyThemeProviderPropsContext.cjs.map +1 -1
- package/dist/cjs/Pagination/Pagination.cjs +1 -1
- package/dist/cjs/PasswordField.cjs +1 -1
- package/dist/cjs/ScreenReaderText.cjs +1 -1
- package/dist/cjs/SearchField.cjs +1 -1
- package/dist/cjs/Select.cjs +1 -1
- package/dist/cjs/Stack.cjs +1 -1
- package/dist/cjs/Status.cjs +1 -1
- package/dist/cjs/Surface.cjs +1 -1
- package/dist/cjs/Switch.cjs +2 -2
- package/dist/cjs/Tabs.cjs +1 -1
- package/dist/cjs/Tag.cjs +1 -1
- package/dist/cjs/TagList.cjs +1 -1
- package/dist/cjs/TextField.cjs +1 -1
- package/dist/cjs/Toast.cjs +1 -1
- package/dist/cjs/ToastStack.cjs +1 -1
- package/dist/cjs/Tooltip.cjs +1 -1
- package/dist/cjs/Typography.cjs +40 -13
- package/dist/cjs/Typography.cjs.map +1 -1
- package/dist/cjs/icons.generated/Add.cjs +1 -1
- package/dist/cjs/icons.generated/AddCircle.cjs +1 -1
- package/dist/cjs/icons.generated/Apps.cjs +1 -1
- package/dist/cjs/icons.generated/AppsSelected.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowBottom.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowDown.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowLeft.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowLowerLeft.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowLowerRight.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowRight.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowTop.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowUnsorted.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowUp.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowUpperLeft.cjs +1 -1
- package/dist/cjs/icons.generated/ArrowUpperRight.cjs +1 -1
- package/dist/cjs/icons.generated/Bug.cjs +1 -1
- package/dist/cjs/icons.generated/Calendar.cjs +1 -1
- package/dist/cjs/icons.generated/Call.cjs +1 -1
- package/dist/cjs/icons.generated/Chat.cjs +1 -1
- package/dist/cjs/icons.generated/Check.cjs +1 -1
- package/dist/cjs/icons.generated/CheckCircleFilled.cjs +1 -1
- package/dist/cjs/icons.generated/ChevronDown.cjs +1 -1
- package/dist/cjs/icons.generated/ChevronLeft.cjs +1 -1
- package/dist/cjs/icons.generated/ChevronRight.cjs +1 -1
- package/dist/cjs/icons.generated/ChevronUp.cjs +1 -1
- package/dist/cjs/icons.generated/Clock.cjs +1 -1
- package/dist/cjs/icons.generated/Close.cjs +1 -1
- package/dist/cjs/icons.generated/CloseCircleFilled.cjs +1 -1
- package/dist/cjs/icons.generated/CollapseLeft.cjs +1 -1
- package/dist/cjs/icons.generated/CollapseRight.cjs +1 -1
- package/dist/cjs/icons.generated/Copy.cjs +1 -1
- package/dist/cjs/icons.generated/Customizations.cjs +1 -1
- package/dist/cjs/icons.generated/CustomizationsSelected.cjs +1 -1
- package/dist/cjs/icons.generated/DangerDiamond.cjs +1 -1
- package/dist/cjs/icons.generated/DangerDiamondFilled.cjs +1 -1
- package/dist/cjs/icons.generated/Delete.cjs +1 -1
- package/dist/cjs/icons.generated/Deny.cjs +1 -1
- package/dist/cjs/icons.generated/Devices.cjs +1 -1
- package/dist/cjs/icons.generated/Directory.cjs +1 -1
- package/dist/cjs/icons.generated/DirectorySelected.cjs +1 -1
- package/dist/cjs/icons.generated/Documentation.cjs +1 -1
- package/dist/cjs/icons.generated/Download.cjs +1 -1
- package/dist/cjs/icons.generated/DragIndicator.cjs +1 -1
- package/dist/cjs/icons.generated/Edit.cjs +1 -1
- package/dist/cjs/icons.generated/ExpandLeft.cjs +1 -1
- package/dist/cjs/icons.generated/ExpandRight.cjs +1 -1
- package/dist/cjs/icons.generated/ExternalLink.cjs +1 -1
- package/dist/cjs/icons.generated/Filter.cjs +1 -1
- package/dist/cjs/icons.generated/Folder.cjs +1 -1
- package/dist/cjs/icons.generated/Globe.cjs +1 -1
- package/dist/cjs/icons.generated/Grid.cjs +1 -1
- package/dist/cjs/icons.generated/Group.cjs +1 -1
- package/dist/cjs/icons.generated/Happy.cjs +1 -1
- package/dist/cjs/icons.generated/Hide.cjs +1 -1
- package/dist/cjs/icons.generated/Home.cjs +1 -1
- package/dist/cjs/icons.generated/HomeSelected.cjs +1 -1
- package/dist/cjs/icons.generated/IdentityGovernance.cjs +1 -1
- package/dist/cjs/icons.generated/IdentityGovernanceSelected.cjs +1 -1
- package/dist/cjs/icons.generated/IdentityGovernanceSelected.cjs.map +1 -1
- package/dist/cjs/icons.generated/InformationCircle.cjs +1 -1
- package/dist/cjs/icons.generated/InformationCircleFilled.cjs +1 -1
- package/dist/cjs/icons.generated/Link.cjs +1 -1
- package/dist/cjs/icons.generated/List.cjs +1 -1
- package/dist/cjs/icons.generated/Lock.cjs +1 -1
- package/dist/cjs/icons.generated/Menu.cjs +1 -1
- package/dist/cjs/icons.generated/More.cjs +1 -1
- package/dist/cjs/icons.generated/Neutral.cjs +1 -1
- package/dist/cjs/icons.generated/Notification.cjs +1 -1
- package/dist/cjs/icons.generated/Pause.cjs +1 -1
- package/dist/cjs/icons.generated/QuestionCircle.cjs +1 -1
- package/dist/cjs/icons.generated/QuestionCircleFilled.cjs +1 -1
- package/dist/cjs/icons.generated/Refresh.cjs +1 -1
- package/dist/cjs/icons.generated/Reports.cjs +1 -1
- package/dist/cjs/icons.generated/ReportsSelected.cjs +1 -1
- package/dist/cjs/icons.generated/Reset.cjs +1 -1
- package/dist/cjs/icons.generated/Resume.cjs +1 -1
- package/dist/cjs/icons.generated/Sad.cjs +1 -1
- package/dist/cjs/icons.generated/Same.cjs +1 -1
- package/dist/cjs/icons.generated/Search.cjs +1 -1
- package/dist/cjs/icons.generated/Security.cjs +1 -1
- package/dist/cjs/icons.generated/SecuritySelected.cjs +1 -1
- package/dist/cjs/icons.generated/Send.cjs +1 -1
- package/dist/cjs/icons.generated/Server.cjs +1 -1
- package/dist/cjs/icons.generated/Settings.cjs +1 -1
- package/dist/cjs/icons.generated/SettingsSelected.cjs +1 -1
- package/dist/cjs/icons.generated/Show.cjs +1 -1
- package/dist/cjs/icons.generated/Sparkle.cjs +1 -1
- package/dist/cjs/icons.generated/Subtract.cjs +1 -1
- package/dist/cjs/icons.generated/Sync.cjs +1 -1
- package/dist/cjs/icons.generated/ThumbsDown.cjs +1 -1
- package/dist/cjs/icons.generated/ThumbsUp.cjs +1 -1
- package/dist/cjs/icons.generated/Unlock.cjs +1 -1
- package/dist/cjs/icons.generated/Upload.cjs +1 -1
- package/dist/cjs/icons.generated/User.cjs +1 -1
- package/dist/cjs/icons.generated/Video.cjs +1 -1
- package/dist/cjs/icons.generated/Warning.cjs +1 -1
- package/dist/cjs/icons.generated/WarningFilled.cjs +1 -1
- package/dist/cjs/icons.generated/Workflows.cjs +1 -1
- package/dist/cjs/icons.generated/WorkflowsSelected.cjs +1 -1
- package/dist/cjs/index.cjs +25 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/labs/AppTile.cjs +1 -1
- package/dist/cjs/labs/DataFilters.cjs +2 -2
- package/dist/cjs/labs/DataTable.cjs +1 -1
- package/dist/cjs/labs/DataTablePagination.cjs +1 -1
- package/dist/cjs/labs/DataView/BulkActionsMenu.cjs +1 -1
- package/dist/cjs/labs/DataView/CardLayoutContent.cjs +2 -2
- package/dist/cjs/labs/DataView/DataCard.cjs +1 -1
- package/dist/cjs/labs/DataView/DataTable.cjs +1 -1
- package/dist/cjs/labs/DataView/DataView.cjs +1 -1
- package/dist/cjs/labs/DataView/DetailPanel.cjs +1 -1
- package/dist/cjs/labs/DataView/LayoutSwitcher.cjs +1 -1
- package/dist/cjs/labs/DataView/RowActions.cjs +1 -1
- package/dist/cjs/labs/DataView/TableLayoutContent.cjs +1 -1
- package/dist/cjs/labs/DataView/TableSettings.cjs +1 -1
- package/dist/cjs/labs/DatePickers/DateTimeField.cjs +1 -1
- package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +3 -4
- package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs +1 -1
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs +1 -1
- package/dist/cjs/labs/OdysseyPickers/PickerVirtualizationListBox.cjs +1 -1
- package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +1 -1
- package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +1 -1
- package/dist/cjs/labs/PageTemplate/DocumentationLink.cjs +1 -1
- package/dist/cjs/labs/PageTemplate/Layout.cjs +1 -1
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +1 -1
- package/dist/cjs/labs/PaginatedTable.cjs +1 -1
- package/dist/cjs/labs/StaticTable.cjs +1 -1
- package/dist/cjs/labs/UserProfile.cjs +1 -1
- package/dist/cjs/labs/UserProfileMenuButton.cjs +1 -1
- package/dist/cjs/logos.generated/Duo.cjs +1 -1
- package/dist/cjs/logos.generated/GoogleAuth.cjs +1 -1
- package/dist/cjs/logos.generated/OktaVerify.cjs +1 -1
- package/dist/cjs/logos.generated/Persona.cjs +1 -1
- package/dist/cjs/logos.generated/SymantecVip.cjs +1 -1
- package/dist/cjs/logos.generated/Yubikey.cjs +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs +4 -0
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs +4 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs +4 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
- package/dist/cjs/theme/components/Button.cjs +6 -6
- package/dist/cjs/theme/components/Button.cjs.map +1 -1
- package/dist/cjs/theme/components/Dialog.cjs +1 -1
- package/dist/cjs/theme/components/Dialog.cjs.map +1 -1
- package/dist/cjs/theme/components/Drawer.cjs +5 -1
- package/dist/cjs/theme/components/Drawer.cjs.map +1 -1
- package/dist/cjs/theme/theme.cjs +22 -0
- package/dist/cjs/theme/theme.cjs.map +1 -1
- package/dist/cjs/theme/useAppElementContainerQuery.cjs +37 -0
- package/dist/cjs/theme/useAppElementContainerQuery.cjs.map +1 -0
- package/dist/cjs/theme/useContainerQuery.cjs +94 -0
- package/dist/cjs/theme/useContainerQuery.cjs.map +1 -0
- package/dist/cjs/theme/useMediaQuery.cjs +9 -6
- package/dist/cjs/theme/useMediaQuery.cjs.map +1 -1
- package/dist/cjs/ui-shell/AppSwitcher/AppSwitcher.cjs +1 -1
- package/dist/cjs/ui-shell/InnerAppContainer.cjs +1 -1
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavHeader.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs +2 -2
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +2 -2
- package/dist/cjs/ui-shell/SkipToContent.cjs +1 -1
- package/dist/cjs/ui-shell/TopNav/HamburgerMenuIcon.cjs +1 -1
- package/dist/cjs/ui-shell/TopNav/TopNav.cjs +1 -1
- package/dist/cjs/ui-shell/TopNav/TopNavLinksList.cjs +1 -1
- package/dist/cjs/ui-shell/TopNav/TopNavListItem.cjs +1 -1
- package/dist/cjs/ui-shell/UiShell.cjs +1 -1
- package/dist/cjs/ui-shell/UiShellLogo.cjs +1 -1
- package/dist/cjs/ui-shell/WideUiShellContent.cjs +1 -1
- package/dist/cjs/useContrastMode.cjs.map +1 -1
- package/dist/cjs/useStableCallback.cjs +23 -0
- package/dist/cjs/useStableCallback.cjs.map +1 -0
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
- package/dist/esm/Accordion.js +1 -1
- package/dist/esm/Autocomplete.js +1 -1
- package/dist/esm/Badge.js +1 -1
- package/dist/esm/Banner.js +1 -1
- package/dist/esm/Banner.js.map +1 -1
- package/dist/esm/Box.js +1 -1
- package/dist/esm/Breadcrumbs.js +1 -1
- package/dist/esm/Buttons/BaseButton.js +24 -6
- package/dist/esm/Buttons/BaseButton.js.map +1 -1
- package/dist/esm/Buttons/BaseMenuButton.js +1 -1
- package/dist/esm/Buttons/Button.js +1 -1
- package/dist/esm/Buttons/MenuButton.js +1 -1
- package/dist/esm/Buttons/MenuItem.js +1 -1
- package/dist/esm/Callout.js +1 -1
- package/dist/esm/Callout.js.map +1 -1
- package/dist/esm/Card.js +1 -1
- package/dist/esm/Charts/ChartError.js +70 -0
- package/dist/esm/Charts/ChartError.js.map +1 -0
- package/dist/esm/Charts/ChartFrame.js +108 -0
- package/dist/esm/Charts/ChartFrame.js.map +1 -0
- package/dist/esm/Charts/ChartPopoverContent.js +49 -0
- package/dist/esm/Charts/ChartPopoverContent.js.map +1 -0
- package/dist/esm/Charts/LineChart.js +263 -0
- package/dist/esm/Charts/LineChart.js.map +1 -0
- package/dist/esm/Charts/chartTokens.js +109 -0
- package/dist/esm/Charts/chartTokens.js.map +1 -0
- package/dist/esm/Charts/chartTypes.js +2 -0
- package/dist/esm/Charts/chartTypes.js.map +1 -0
- package/dist/esm/Charts/formatChartValue.js +33 -0
- package/dist/esm/Charts/formatChartValue.js.map +1 -0
- package/dist/esm/Charts/getChartSeriesPointData.js +45 -0
- package/dist/esm/Charts/getChartSeriesPointData.js.map +1 -0
- package/dist/esm/Charts/hasDuplicateSeries.js +14 -0
- package/dist/esm/Charts/hasDuplicateSeries.js.map +1 -0
- package/dist/esm/Charts/index.js +14 -0
- package/dist/esm/Charts/index.js.map +1 -0
- package/dist/esm/Charts/resolveChartLocale.js +21 -0
- package/dist/esm/Charts/resolveChartLocale.js.map +1 -0
- package/dist/esm/Charts/useChartValueFormatter.js +30 -0
- package/dist/esm/Charts/useChartValueFormatter.js.map +1 -0
- package/dist/esm/Charts/useStableValue.js +22 -0
- package/dist/esm/Charts/useStableValue.js.map +1 -0
- package/dist/esm/CircularProgress.js +1 -1
- package/dist/esm/ConditionalWrapper.js +1 -1
- package/dist/esm/DataTable/DataTable.js +1 -1
- package/dist/esm/DataTable/DataTableRowActions.js +1 -1
- package/dist/esm/DataTable/DataTableSettings.js +1 -1
- package/dist/esm/DatePickers/DateField.js +1 -1
- package/dist/esm/DatePickers/DateFieldActionBar.js +1 -1
- package/dist/esm/DatePickers/DateFieldLocalizationProvider.js +1 -1
- package/dist/esm/DatePickers/DateFieldLocalizationProvider.js.map +1 -1
- package/dist/esm/DatePickers/DatePicker.js +3 -4
- package/dist/esm/DatePickers/DatePicker.js.map +1 -1
- package/dist/esm/DatePickers/TimeZonePicker.js +1 -1
- package/dist/esm/DatePickers/useOdysseyDateFields.js +10 -28
- package/dist/esm/DatePickers/useOdysseyDateFields.js.map +1 -1
- package/dist/esm/Dialog.js +1 -1
- package/dist/esm/Drawer.js +15 -2
- package/dist/esm/Drawer.js.map +1 -1
- package/dist/esm/EmptyState.js +1 -1
- package/dist/esm/ErrorMessageList.js +1 -1
- package/dist/esm/Field.js +1 -1
- package/dist/esm/FieldError.js +1 -1
- package/dist/esm/FieldHint.js +1 -1
- package/dist/esm/FieldLabel.js +1 -1
- package/dist/esm/Fields/Checkbox.js +1 -1
- package/dist/esm/Fields/CheckboxGroup.js +1 -1
- package/dist/esm/Fields/Radio.js +1 -1
- package/dist/esm/Fields/RadioGroup.js +1 -1
- package/dist/esm/Fieldset.js +1 -1
- package/dist/esm/FileUploader/FileUploadIllustration.js +1 -1
- package/dist/esm/FileUploader/FileUploadPreview.js +1 -1
- package/dist/esm/FileUploader/FileUploader.js +1 -1
- package/dist/esm/Form.js +1 -1
- package/dist/esm/FullScreenOverlay.js +1 -1
- package/dist/esm/FullScreenOverlayContext.js +1 -1
- package/dist/esm/HintLink.js +1 -1
- package/dist/esm/IconWithTooltip.js +1 -1
- package/dist/esm/Link.js +1 -1
- package/dist/esm/MuiPropsChild.js +1 -1
- package/dist/esm/NativeSelect.js +1 -1
- package/dist/esm/OdysseyCacheProvider.js +1 -1
- package/dist/esm/OdysseyProvider.js +1 -1
- package/dist/esm/OdysseyThemeProvider.js +3 -2
- package/dist/esm/OdysseyThemeProvider.js.map +1 -1
- package/dist/esm/OdysseyThemeProviderPropsContext.js +1 -1
- package/dist/esm/OdysseyThemeProviderPropsContext.js.map +1 -1
- package/dist/esm/Pagination/Pagination.js +1 -1
- package/dist/esm/PasswordField.js +1 -1
- package/dist/esm/ScreenReaderText.js +1 -1
- package/dist/esm/SearchField.js +1 -1
- package/dist/esm/Select.js +1 -1
- package/dist/esm/Stack.js +1 -1
- package/dist/esm/Status.js +1 -1
- package/dist/esm/Surface.js +1 -1
- package/dist/esm/Switch.js +2 -2
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/Tag.js +1 -1
- package/dist/esm/TagList.js +1 -1
- package/dist/esm/TextField.js +1 -1
- package/dist/esm/Toast.js +1 -1
- package/dist/esm/ToastStack.js +1 -1
- package/dist/esm/Tooltip.js +1 -1
- package/dist/esm/Typography.js +39 -12
- package/dist/esm/Typography.js.map +1 -1
- package/dist/esm/icons.generated/Add.js +1 -1
- package/dist/esm/icons.generated/AddCircle.js +1 -1
- package/dist/esm/icons.generated/Apps.js +1 -1
- package/dist/esm/icons.generated/AppsSelected.js +1 -1
- package/dist/esm/icons.generated/ArrowBottom.js +1 -1
- package/dist/esm/icons.generated/ArrowDown.js +1 -1
- package/dist/esm/icons.generated/ArrowLeft.js +1 -1
- package/dist/esm/icons.generated/ArrowLowerLeft.js +1 -1
- package/dist/esm/icons.generated/ArrowLowerRight.js +1 -1
- package/dist/esm/icons.generated/ArrowRight.js +1 -1
- package/dist/esm/icons.generated/ArrowTop.js +1 -1
- package/dist/esm/icons.generated/ArrowUnsorted.js +1 -1
- package/dist/esm/icons.generated/ArrowUp.js +1 -1
- package/dist/esm/icons.generated/ArrowUpperLeft.js +1 -1
- package/dist/esm/icons.generated/ArrowUpperRight.js +1 -1
- package/dist/esm/icons.generated/Bug.js +1 -1
- package/dist/esm/icons.generated/Calendar.js +1 -1
- package/dist/esm/icons.generated/Call.js +1 -1
- package/dist/esm/icons.generated/Chat.js +1 -1
- package/dist/esm/icons.generated/Check.js +1 -1
- package/dist/esm/icons.generated/CheckCircleFilled.js +1 -1
- package/dist/esm/icons.generated/ChevronDown.js +1 -1
- package/dist/esm/icons.generated/ChevronLeft.js +1 -1
- package/dist/esm/icons.generated/ChevronRight.js +1 -1
- package/dist/esm/icons.generated/ChevronUp.js +1 -1
- package/dist/esm/icons.generated/Clock.js +1 -1
- package/dist/esm/icons.generated/Close.js +1 -1
- package/dist/esm/icons.generated/CloseCircleFilled.js +1 -1
- package/dist/esm/icons.generated/CollapseLeft.js +1 -1
- package/dist/esm/icons.generated/CollapseRight.js +1 -1
- package/dist/esm/icons.generated/Copy.js +1 -1
- package/dist/esm/icons.generated/Customizations.js +1 -1
- package/dist/esm/icons.generated/CustomizationsSelected.js +1 -1
- package/dist/esm/icons.generated/DangerDiamond.js +1 -1
- package/dist/esm/icons.generated/DangerDiamondFilled.js +1 -1
- package/dist/esm/icons.generated/Delete.js +1 -1
- package/dist/esm/icons.generated/Deny.js +1 -1
- package/dist/esm/icons.generated/Devices.js +1 -1
- package/dist/esm/icons.generated/Directory.js +1 -1
- package/dist/esm/icons.generated/DirectorySelected.js +1 -1
- package/dist/esm/icons.generated/Documentation.js +1 -1
- package/dist/esm/icons.generated/Download.js +1 -1
- package/dist/esm/icons.generated/DragIndicator.js +1 -1
- package/dist/esm/icons.generated/Edit.js +1 -1
- package/dist/esm/icons.generated/ExpandLeft.js +1 -1
- package/dist/esm/icons.generated/ExpandRight.js +1 -1
- package/dist/esm/icons.generated/ExternalLink.js +1 -1
- package/dist/esm/icons.generated/Filter.js +1 -1
- package/dist/esm/icons.generated/Folder.js +1 -1
- package/dist/esm/icons.generated/Globe.js +1 -1
- package/dist/esm/icons.generated/Grid.js +1 -1
- package/dist/esm/icons.generated/Group.js +1 -1
- package/dist/esm/icons.generated/Happy.js +1 -1
- package/dist/esm/icons.generated/Hide.js +1 -1
- package/dist/esm/icons.generated/Home.js +1 -1
- package/dist/esm/icons.generated/HomeSelected.js +1 -1
- package/dist/esm/icons.generated/IdentityGovernance.js +1 -1
- package/dist/esm/icons.generated/IdentityGovernanceSelected.js +1 -1
- package/dist/esm/icons.generated/IdentityGovernanceSelected.js.map +1 -1
- package/dist/esm/icons.generated/InformationCircle.js +1 -1
- package/dist/esm/icons.generated/InformationCircleFilled.js +1 -1
- package/dist/esm/icons.generated/Link.js +1 -1
- package/dist/esm/icons.generated/List.js +1 -1
- package/dist/esm/icons.generated/Lock.js +1 -1
- package/dist/esm/icons.generated/Menu.js +1 -1
- package/dist/esm/icons.generated/More.js +1 -1
- package/dist/esm/icons.generated/Neutral.js +1 -1
- package/dist/esm/icons.generated/Notification.js +1 -1
- package/dist/esm/icons.generated/Pause.js +1 -1
- package/dist/esm/icons.generated/QuestionCircle.js +1 -1
- package/dist/esm/icons.generated/QuestionCircleFilled.js +1 -1
- package/dist/esm/icons.generated/Refresh.js +1 -1
- package/dist/esm/icons.generated/Reports.js +1 -1
- package/dist/esm/icons.generated/ReportsSelected.js +1 -1
- package/dist/esm/icons.generated/Reset.js +1 -1
- package/dist/esm/icons.generated/Resume.js +1 -1
- package/dist/esm/icons.generated/Sad.js +1 -1
- package/dist/esm/icons.generated/Same.js +1 -1
- package/dist/esm/icons.generated/Search.js +1 -1
- package/dist/esm/icons.generated/Security.js +1 -1
- package/dist/esm/icons.generated/SecuritySelected.js +1 -1
- package/dist/esm/icons.generated/Send.js +1 -1
- package/dist/esm/icons.generated/Server.js +1 -1
- package/dist/esm/icons.generated/Settings.js +1 -1
- package/dist/esm/icons.generated/SettingsSelected.js +1 -1
- package/dist/esm/icons.generated/Show.js +1 -1
- package/dist/esm/icons.generated/Sparkle.js +1 -1
- package/dist/esm/icons.generated/Subtract.js +1 -1
- package/dist/esm/icons.generated/Sync.js +1 -1
- package/dist/esm/icons.generated/ThumbsDown.js +1 -1
- package/dist/esm/icons.generated/ThumbsUp.js +1 -1
- package/dist/esm/icons.generated/Unlock.js +1 -1
- package/dist/esm/icons.generated/Upload.js +1 -1
- package/dist/esm/icons.generated/User.js +1 -1
- package/dist/esm/icons.generated/Video.js +1 -1
- package/dist/esm/icons.generated/Warning.js +1 -1
- package/dist/esm/icons.generated/WarningFilled.js +1 -1
- package/dist/esm/icons.generated/Workflows.js +1 -1
- package/dist/esm/icons.generated/WorkflowsSelected.js +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/labs/AppTile.js +1 -1
- package/dist/esm/labs/DataFilters.js +2 -2
- package/dist/esm/labs/DataTable.js +1 -1
- package/dist/esm/labs/DataTablePagination.js +1 -1
- package/dist/esm/labs/DataView/BulkActionsMenu.js +1 -1
- package/dist/esm/labs/DataView/CardLayoutContent.js +2 -2
- package/dist/esm/labs/DataView/DataCard.js +1 -1
- package/dist/esm/labs/DataView/DataTable.js +1 -1
- package/dist/esm/labs/DataView/DataView.js +1 -1
- package/dist/esm/labs/DataView/DetailPanel.js +1 -1
- package/dist/esm/labs/DataView/LayoutSwitcher.js +1 -1
- package/dist/esm/labs/DataView/RowActions.js +1 -1
- package/dist/esm/labs/DataView/TableLayoutContent.js +1 -1
- package/dist/esm/labs/DataView/TableSettings.js +1 -1
- package/dist/esm/labs/DatePickers/DateTimeField.js +1 -1
- package/dist/esm/labs/DatePickers/DateTimePicker.js +3 -4
- package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/ComposablePicker.js +1 -1
- package/dist/esm/labs/OdysseyPickers/Picker.js +1 -1
- package/dist/esm/labs/OdysseyPickers/PickerVirtualizationListBox.js +1 -1
- package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +1 -1
- package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +1 -1
- package/dist/esm/labs/PageTemplate/DocumentationLink.js +1 -1
- package/dist/esm/labs/PageTemplate/Layout.js +1 -1
- package/dist/esm/labs/PageTemplate/PageTemplate.js +1 -1
- package/dist/esm/labs/PaginatedTable.js +1 -1
- package/dist/esm/labs/StaticTable.js +1 -1
- package/dist/esm/labs/UserProfile.js +1 -1
- package/dist/esm/labs/UserProfileMenuButton.js +1 -1
- package/dist/esm/logos.generated/Duo.js +1 -1
- package/dist/esm/logos.generated/GoogleAuth.js +1 -1
- package/dist/esm/logos.generated/OktaVerify.js +1 -1
- package/dist/esm/logos.generated/Persona.js +1 -1
- package/dist/esm/logos.generated/SymantecVip.js +1 -1
- package/dist/esm/logos.generated/Yubikey.js +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui.js +4 -0
- package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js +4 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js +4 -0
- package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/esm/theme/components/Button.js +6 -6
- package/dist/esm/theme/components/Button.js.map +1 -1
- package/dist/esm/theme/components/Dialog.js +2 -2
- package/dist/esm/theme/components/Dialog.js.map +1 -1
- package/dist/esm/theme/components/Drawer.js +5 -1
- package/dist/esm/theme/components/Drawer.js.map +1 -1
- package/dist/esm/theme/theme.js +2 -0
- package/dist/esm/theme/theme.js.map +1 -1
- package/dist/esm/theme/useAppElementContainerQuery.js +32 -0
- package/dist/esm/theme/useAppElementContainerQuery.js.map +1 -0
- package/dist/esm/theme/useContainerQuery.js +87 -0
- package/dist/esm/theme/useContainerQuery.js.map +1 -0
- package/dist/esm/theme/useMediaQuery.js +7 -5
- package/dist/esm/theme/useMediaQuery.js.map +1 -1
- package/dist/esm/ui-shell/AppSwitcher/AppSwitcher.js +1 -1
- package/dist/esm/ui-shell/InnerAppContainer.js +1 -1
- package/dist/esm/ui-shell/NarrowUiShellContent.js +1 -1
- package/dist/esm/ui-shell/SideNav/NavAccordion.js +1 -1
- package/dist/esm/ui-shell/SideNav/SideNav.js +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavHeader.js +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavItemContent.js +2 -2
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavSortableList.js +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +2 -2
- package/dist/esm/ui-shell/SkipToContent.js +1 -1
- package/dist/esm/ui-shell/TopNav/HamburgerMenuIcon.js +1 -1
- package/dist/esm/ui-shell/TopNav/TopNav.js +1 -1
- package/dist/esm/ui-shell/TopNav/TopNavLinksList.js +1 -1
- package/dist/esm/ui-shell/TopNav/TopNavListItem.js +1 -1
- package/dist/esm/ui-shell/UiShell.js +1 -1
- package/dist/esm/ui-shell/UiShellLogo.js +1 -1
- package/dist/esm/ui-shell/WideUiShellContent.js +1 -1
- package/dist/esm/useContrastMode.js.map +1 -1
- package/dist/esm/useStableCallback.js +16 -0
- package/dist/esm/useStableCallback.js.map +1 -0
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/types/Banner.d.ts.map +1 -1
- package/dist/types/Buttons/BaseButton.d.ts +8 -1
- package/dist/types/Buttons/BaseButton.d.ts.map +1 -1
- package/dist/types/Callout.d.ts.map +1 -1
- package/dist/types/Charts/ChartError.d.ts +23 -0
- package/dist/types/Charts/ChartError.d.ts.map +1 -0
- package/dist/types/Charts/ChartFrame.d.ts +54 -0
- package/dist/types/Charts/ChartFrame.d.ts.map +1 -0
- package/dist/types/Charts/ChartPopoverContent.d.ts +97 -0
- package/dist/types/Charts/ChartPopoverContent.d.ts.map +1 -0
- package/dist/types/Charts/LineChart.d.ts +26 -0
- package/dist/types/Charts/LineChart.d.ts.map +1 -0
- package/dist/types/Charts/chartTokens.d.ts +362 -0
- package/dist/types/Charts/chartTokens.d.ts.map +1 -0
- package/dist/types/Charts/chartTypes.d.ts +142 -0
- package/dist/types/Charts/chartTypes.d.ts.map +1 -0
- package/dist/types/Charts/formatChartValue.d.ts +93 -0
- package/dist/types/Charts/formatChartValue.d.ts.map +1 -0
- package/dist/types/Charts/getChartSeriesPointData.d.ts +49 -0
- package/dist/types/Charts/getChartSeriesPointData.d.ts.map +1 -0
- package/dist/types/Charts/hasDuplicateSeries.d.ts +24 -0
- package/dist/types/Charts/hasDuplicateSeries.d.ts.map +1 -0
- package/dist/types/Charts/index.d.ts +15 -0
- package/dist/types/Charts/index.d.ts.map +1 -0
- package/dist/types/Charts/resolveChartLocale.d.ts +28 -0
- package/dist/types/Charts/resolveChartLocale.d.ts.map +1 -0
- package/dist/types/Charts/useChartValueFormatter.d.ts +34 -0
- package/dist/types/Charts/useChartValueFormatter.d.ts.map +1 -0
- package/dist/types/Charts/useStableValue.d.ts +29 -0
- package/dist/types/Charts/useStableValue.d.ts.map +1 -0
- package/dist/types/DatePickers/DateFieldLocalizationProvider.d.ts +1 -1
- package/dist/types/DatePickers/DateFieldLocalizationProvider.d.ts.map +1 -1
- package/dist/types/DatePickers/DatePicker.d.ts.map +1 -1
- package/dist/types/DatePickers/useOdysseyDateFields.d.ts +27 -15
- package/dist/types/DatePickers/useOdysseyDateFields.d.ts.map +1 -1
- package/dist/types/Drawer.d.ts +4 -0
- package/dist/types/Drawer.d.ts.map +1 -1
- package/dist/types/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/types/OdysseyThemeProviderPropsContext.d.ts +1 -1
- package/dist/types/OdysseyThemeProviderPropsContext.d.ts.map +1 -1
- package/dist/types/Typography.d.ts +26 -12
- package/dist/types/Typography.d.ts.map +1 -1
- package/dist/types/i18n.generated/i18n.d.ts +8 -0
- package/dist/types/i18n.generated/i18n.d.ts.map +1 -1
- package/dist/types/i18n.generated/i18n.resources.d.ts +14 -2
- package/dist/types/i18n.generated/i18n.resources.d.ts.map +1 -1
- package/dist/types/icons.generated/IdentityGovernanceSelected.d.ts +1 -1
- package/dist/types/icons.generated/IdentityGovernanceSelected.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui.d.ts +4 -0
- package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts +4 -0
- package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts +4 -0
- package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/types/theme/components/Button.d.ts.map +1 -1
- package/dist/types/theme/components/Drawer.d.ts.map +1 -1
- package/dist/types/theme/theme.d.ts +2 -0
- package/dist/types/theme/theme.d.ts.map +1 -1
- package/dist/types/theme/useAppElementContainerQuery.d.ts +24 -0
- package/dist/types/theme/useAppElementContainerQuery.d.ts.map +1 -0
- package/dist/types/theme/useContainerQuery.d.ts +37 -0
- package/dist/types/theme/useContainerQuery.d.ts.map +1 -0
- package/dist/types/theme/useMediaQuery.d.ts +29 -15
- package/dist/types/theme/useMediaQuery.d.ts.map +1 -1
- package/dist/types/useContrastMode.d.ts +10 -1
- package/dist/types/useContrastMode.d.ts.map +1 -1
- package/dist/types/useStableCallback.d.ts +45 -0
- package/dist/types/useStableCallback.d.ts.map +1 -0
- package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
- package/package.json +49 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.cjs","names":["_useMediaQuery","require","dialogComponents","odysseyTokens","shadowDomElement","shadowRootElement","MuiDialog","defaultProps","container","scroll","styleOverrides","paper","maxWidth","TypographyLineLengthMax","Spacing6","boxShadow","filter","borderRadius","BorderRadiusOuter","
|
|
1
|
+
{"version":3,"file":"Dialog.cjs","names":["_useMediaQuery","require","dialogComponents","odysseyTokens","shadowDomElement","shadowRootElement","MuiDialog","defaultProps","container","scroll","styleOverrides","paper","maxWidth","TypographyLineLengthMax","Spacing6","boxShadow","filter","borderRadius","BorderRadiusOuter","toCompactMediaQuery","MuiDialogActions","root","flexWrap","gap","Spacing2","paddingBlockStart","Spacing5","paddingBlockEnd","paddingInline","MuiDialogContent","ownerState","paddingBlock","dividers","color","HueNeutral600","MuiDialogContentText","marginBlockEnd","HueNeutral700","MuiDialogTitle","component","variant","padding","minWidth","flex","exports"],"sources":["../../../../src/theme/components/Dialog.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-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 { ThemeOptions } from \"@mui/material\";\n\nimport type { GetComponentsProps } from \"./types.js\";\n\nimport { toCompactMediaQuery } from \"../useMediaQuery.js\";\n\nexport const dialogComponents = ({\n odysseyTokens,\n shadowDomElement,\n shadowRootElement,\n}: GetComponentsProps): Pick<\n NonNullable<ThemeOptions[\"components\"]>,\n | \"MuiDialog\"\n | \"MuiDialogActions\"\n | \"MuiDialogContent\"\n | \"MuiDialogContentText\"\n | \"MuiDialogTitle\"\n> => ({\n MuiDialog: {\n defaultProps: {\n container: shadowRootElement || shadowDomElement,\n scroll: \"paper\",\n },\n styleOverrides: {\n paper: {\n maxWidth: `calc(${odysseyTokens.TypographyLineLengthMax} + (${odysseyTokens.Spacing6} * 2))`,\n boxShadow: \"none\",\n filter:\n \"drop-shadow(0px 1px 4px rgba(29, 29, 33, 0.08)) drop-shadow(0px 4px 10px rgba(29, 29, 33, 0.08)) drop-shadow(0px 8px 30px rgba(29, 29, 33, 0.1))\",\n borderRadius: odysseyTokens.BorderRadiusOuter,\n // Full-screen at compact viewports has no rounded corners.\n [toCompactMediaQuery(\"width\", \"height\")]: {\n borderRadius: 0,\n },\n },\n },\n },\n MuiDialogActions: {\n styleOverrides: {\n root: {\n flexWrap: \"wrap\",\n gap: odysseyTokens.Spacing2,\n paddingBlockStart: odysseyTokens.Spacing5,\n paddingBlockEnd: odysseyTokens.Spacing5,\n paddingInline: odysseyTokens.Spacing6,\n },\n },\n },\n MuiDialogContent: {\n styleOverrides: {\n root: ({ ownerState }) => ({\n paddingBlock: 0,\n paddingInline: odysseyTokens.Spacing6,\n\n ...(ownerState.dividers === true && {\n paddingBlock: odysseyTokens.Spacing6,\n color: odysseyTokens.HueNeutral600,\n }),\n\n [\"&:last-child\"]: {\n paddingBlockEnd: odysseyTokens.Spacing6,\n },\n }),\n },\n },\n MuiDialogContentText: {\n styleOverrides: {\n root: {\n marginBlockEnd: odysseyTokens.Spacing5,\n color: odysseyTokens.HueNeutral700,\n\n \"&:last-child\": {\n marginBlockEnd: \"0\",\n },\n },\n },\n },\n MuiDialogTitle: {\n defaultProps: {\n component: \"h1\",\n variant: \"h5\",\n },\n styleOverrides: {\n root: {\n marginBlockEnd: 0,\n padding: 0,\n minWidth: 0,\n flex: \"1 1 auto\",\n },\n },\n },\n});\n"],"mappings":";;;;;;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a,CAACW;QACjC;MACF,CAAC;IACH;EACF,CAAC;EACDqB,oBAAoB,EAAE;IACpBzB,cAAc,EAAE;MACdW,IAAI,EAAE;QACJe,cAAc,EAAEjC,aAAa,CAACuB,QAAQ;QACtCO,KAAK,EAAE9B,aAAa,CAACkC,aAAa;QAElC,cAAc,EAAE;UACdD,cAAc,EAAE;QAClB;MACF;IACF;EACF,CAAC;EACDE,cAAc,EAAE;IACd/B,YAAY,EAAE;MACZgC,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC;IACD9B,cAAc,EAAE;MACdW,IAAI,EAAE;QACJe,cAAc,EAAE,CAAC;QACjBK,OAAO,EAAE,CAAC;QACVC,QAAQ,EAAE,CAAC;QACXC,IAAI,EAAE;MACR;IACF;EACF;AACF,CAAC,CAAC;AAACC,OAAA,CAAA1C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.drawerComponents = void 0;
|
|
7
|
+
var _useMediaQuery = require("../useMediaQuery.cjs");
|
|
7
8
|
/*!
|
|
8
9
|
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
10
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -44,7 +45,10 @@ const drawerComponents = ({
|
|
|
44
45
|
border: "0"
|
|
45
46
|
}),
|
|
46
47
|
...(ownerState.variant === "temporary" && {
|
|
47
|
-
boxShadow: odysseyTokens.ShadowScale1
|
|
48
|
+
boxShadow: odysseyTokens.ShadowScale1,
|
|
49
|
+
[(0, _useMediaQuery.toCompactMediaQuery)("width")]: {
|
|
50
|
+
width: "100%"
|
|
51
|
+
}
|
|
48
52
|
})
|
|
49
53
|
})
|
|
50
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.cjs","names":["drawerSizes","persistent","temporary","drawerComponents","odysseyTokens","MuiDrawer","styleOverrides","root","paper","ownerState","width","variant","display","overflowY","flexDirection","flexWrap","justifyContent","alignItems","alignContent","color","HueNeutral700","position","borderRadius","BorderRadiusOuter","border","boxShadow","ShadowScale1","exports"],"sources":["../../../../src/theme/components/Drawer.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-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 { ThemeOptions } from \"@mui/material\";\n\nimport type { GetComponentsProps } from \"./types.js\";\n\nconst drawerSizes = {\n persistent: \"25.714rem\", //~360px\n temporary: \"28.571rem\", //~400px\n};\n\nexport const drawerComponents = ({\n odysseyTokens,\n}: GetComponentsProps): Pick<\n NonNullable<ThemeOptions[\"components\"]>,\n \"MuiDrawer\"\n> => ({\n MuiDrawer: {\n styleOverrides: {\n root: {},\n paper: ({ ownerState }) => ({\n width:\n ownerState.variant === \"temporary\"\n ? drawerSizes.temporary\n : drawerSizes.persistent, //Temporary = overlay drawer, Persistent = inline drawer\n display: \"flex\",\n overflowY: \"auto\",\n flexDirection: \"column\",\n flexWrap: \"nowrap\",\n justifyContent: \"space-between\",\n alignItems: \"stretch\",\n alignContent: \"flex-end\",\n color: odysseyTokens.HueNeutral700,\n ...(ownerState.variant === \"persistent\" && {\n position: \"static\",\n borderRadius: odysseyTokens.BorderRadiusOuter,\n border: \"0\",\n }),\n ...(ownerState.variant === \"temporary\" && {\n boxShadow: odysseyTokens.ShadowScale1,\n }),\n }),\n },\n },\n});\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Drawer.cjs","names":["_useMediaQuery","require","drawerSizes","persistent","temporary","drawerComponents","odysseyTokens","MuiDrawer","styleOverrides","root","paper","ownerState","width","variant","display","overflowY","flexDirection","flexWrap","justifyContent","alignItems","alignContent","color","HueNeutral700","position","borderRadius","BorderRadiusOuter","border","boxShadow","ShadowScale1","toCompactMediaQuery","exports"],"sources":["../../../../src/theme/components/Drawer.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-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 { ThemeOptions } from \"@mui/material\";\n\nimport type { GetComponentsProps } from \"./types.js\";\n\nimport { toCompactMediaQuery } from \"../useMediaQuery.js\";\n\nconst drawerSizes = {\n persistent: \"25.714rem\", //~360px\n temporary: \"28.571rem\", //~400px\n};\n\nexport const drawerComponents = ({\n odysseyTokens,\n}: GetComponentsProps): Pick<\n NonNullable<ThemeOptions[\"components\"]>,\n \"MuiDrawer\"\n> => ({\n MuiDrawer: {\n styleOverrides: {\n root: {},\n paper: ({ ownerState }) => ({\n width:\n ownerState.variant === \"temporary\"\n ? drawerSizes.temporary\n : drawerSizes.persistent, //Temporary = overlay drawer, Persistent = inline drawer\n display: \"flex\",\n overflowY: \"auto\",\n flexDirection: \"column\",\n flexWrap: \"nowrap\",\n justifyContent: \"space-between\",\n alignItems: \"stretch\",\n alignContent: \"flex-end\",\n color: odysseyTokens.HueNeutral700,\n ...(ownerState.variant === \"persistent\" && {\n position: \"static\",\n borderRadius: odysseyTokens.BorderRadiusOuter,\n border: \"0\",\n }),\n ...(ownerState.variant === \"temporary\" && {\n boxShadow: odysseyTokens.ShadowScale1,\n // A fixed-width overlay wider than the viewport clips its content and\n // makes the page scroll horizontally at the WCAG 1.4.10 reflow floor.\n // Not 100vw: that counts the scrollbar gutter and keeps the\n // horizontal scrollbar.\n [toCompactMediaQuery(\"width\")]: {\n width: \"100%\",\n },\n }),\n }),\n },\n },\n});\n"],"mappings":";;;;;;AAgBA,IAAAA,cAAA,GAAAC,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,MAAMC,WAAW,GAAG;EAClBC,UAAU,EAAE,WAAW;EACvBC,SAAS,EAAE;AACb,CAAC;AAEM,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC;AACkB,CAAC,MAGf;EACJC,SAAS,EAAE;IACTC,cAAc,EAAE;MACdC,IAAI,EAAE,CAAC,CAAC;MACRC,KAAK,EAAEA,CAAC;QAAEC;MAAW,CAAC,MAAM;QAC1BC,KAAK,EACHD,UAAU,CAACE,OAAO,KAAK,WAAW,GAC9BX,WAAW,CAACE,SAAS,GACrBF,WAAW,CAACC,UAAU;QAC5BW,OAAO,EAAE,MAAM;QACfC,SAAS,EAAE,MAAM;QACjBC,aAAa,EAAE,QAAQ;QACvBC,QAAQ,EAAE,QAAQ;QAClBC,cAAc,EAAE,eAAe;QAC/BC,UAAU,EAAE,SAAS;QACrBC,YAAY,EAAE,UAAU;QACxBC,KAAK,EAAEf,aAAa,CAACgB,aAAa;QAClC,IAAIX,UAAU,CAACE,OAAO,KAAK,YAAY,IAAI;UACzCU,QAAQ,EAAE,QAAQ;UAClBC,YAAY,EAAElB,aAAa,CAACmB,iBAAiB;UAC7CC,MAAM,EAAE;QACV,CAAC,CAAC;QACF,IAAIf,UAAU,CAACE,OAAO,KAAK,WAAW,IAAI;UACxCc,SAAS,EAAErB,aAAa,CAACsB,YAAY;UAKrC,CAAC,IAAAC,kCAAmB,EAAC,OAAO,CAAC,GAAG;YAC9BjB,KAAK,EAAE;UACT;QACF,CAAC;MACH,CAAC;IACH;EACF;AACF,CAAC,CAAC;AAACkB,OAAA,CAAAzB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/dist/cjs/theme/theme.cjs
CHANGED
|
@@ -25,6 +25,28 @@ Object.keys(_pxToRem).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _useAppElementContainerQuery = require("./useAppElementContainerQuery.cjs");
|
|
29
|
+
Object.keys(_useAppElementContainerQuery).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _useAppElementContainerQuery[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _useAppElementContainerQuery[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _useContainerQuery = require("./useContainerQuery.cjs");
|
|
40
|
+
Object.keys(_useContainerQuery).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _useContainerQuery[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _useContainerQuery[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
28
50
|
var _useMediaQuery = require("./useMediaQuery.cjs");
|
|
29
51
|
Object.keys(_useMediaQuery).forEach(function (key) {
|
|
30
52
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.cjs","names":["_createOdysseyMuiTheme","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_pxToRem","_useMediaQuery"],"sources":["../../../src/theme/theme.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./createOdysseyMuiTheme.js\";\nexport * from \"./pxToRem.js\";\nexport * from \"./useMediaQuery.js\";\n"],"mappings":";;;;;AAYA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,sBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,sBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,sBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,
|
|
1
|
+
{"version":3,"file":"theme.cjs","names":["_createOdysseyMuiTheme","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_pxToRem","_useAppElementContainerQuery","_useContainerQuery","_useMediaQuery"],"sources":["../../../src/theme/theme.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./createOdysseyMuiTheme.js\";\nexport * from \"./pxToRem.js\";\nexport * from \"./useAppElementContainerQuery.js\";\nexport * from \"./useContainerQuery.js\";\nexport * from \"./useMediaQuery.js\";\n"],"mappings":";;;;;AAYA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,sBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,sBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,sBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,4BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,4BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,4BAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,4BAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,kBAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,kBAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,kBAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,kBAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,cAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,cAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,cAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,cAAA,CAAAR,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAppElementContainerQuery = void 0;
|
|
7
|
+
var _useContrastMode = require("../useContrastMode.cjs");
|
|
8
|
+
var _useContainerQuery = require("./useContainerQuery.cjs");
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (c) 2026-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
|
+
*/const useAppElementContainerQuery = ({
|
|
20
|
+
maxHeight,
|
|
21
|
+
maxWidth,
|
|
22
|
+
minHeight,
|
|
23
|
+
minWidth
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
contrastContainerRef
|
|
27
|
+
} = (0, _useContrastMode.useContrastModeContext)();
|
|
28
|
+
return (0, _useContainerQuery.useContainerQuery)({
|
|
29
|
+
maxHeight,
|
|
30
|
+
maxWidth,
|
|
31
|
+
minHeight,
|
|
32
|
+
minWidth,
|
|
33
|
+
target: contrastContainerRef ?? null
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
exports.useAppElementContainerQuery = useAppElementContainerQuery;
|
|
37
|
+
//# sourceMappingURL=useAppElementContainerQuery.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppElementContainerQuery.cjs","names":["_useContrastMode","require","_useContainerQuery","useAppElementContainerQuery","maxHeight","maxWidth","minHeight","minWidth","contrastContainerRef","useContrastModeContext","useContainerQuery","target","exports"],"sources":["../../../src/theme/useAppElementContainerQuery.ts"],"sourcesContent":["/*!\n * Copyright (c) 2026-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 { useContrastModeContext } from \"../useContrastMode.js\";\nimport {\n useContainerQuery,\n type UseContainerQueryProps,\n} from \"./useContainerQuery.js\";\n\nexport type UseAppElementContainerQueryProps = Omit<\n UseContainerQueryProps,\n \"target\"\n>;\n\n/**\n * Reports whether Odyssey's app wrapper element satisfies a container query.\n * This is the app-scoped analog of `useMediaQuery`: bounds are matched against\n * the wrapper's `inline-size` (width) and `block-size` (height) rather than the\n * viewport, so responsiveness tracks the space Odyssey actually occupies (which\n * shrinks as surrounding chrome such as a side nav expands). Returns `false`\n * until the wrapper element exists, including when `OdysseyProvider` renders\n * with `hasWrapperElement={false}` and when called outside a provider.\n */\nexport const useAppElementContainerQuery = ({\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n}: UseAppElementContainerQueryProps) => {\n const { contrastContainerRef } = useContrastModeContext();\n\n return useContainerQuery({\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n target: contrastContainerRef ?? null,\n });\n};\n"],"mappings":";;;;;;AAYA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAsBO,MAAME,2BAA2B,GAAGA,CAAC;EAC1CC,SAAS;EACTC,QAAQ;EACRC,SAAS;EACTC;AACgC,CAAC,KAAK;EACtC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,uCAAsB,EAAC,CAAC;EAEzD,OAAO,IAAAC,oCAAiB,EAAC;IACvBN,SAAS;IACTC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRI,MAAM,EAAEH,oBAAoB,IAAI;EAClC,CAAC,CAAC;AACJ,CAAC;AAACI,OAAA,CAAAT,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useContainerQuery = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2026-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 resolveTargetElement = target => target && "current" in target ? target.current : target;
|
|
21
|
+
const isResizeObserverSizeList = borderBoxSize => Array.isArray(borderBoxSize);
|
|
22
|
+
const resolveBorderBoxSize = borderBoxSize => isResizeObserverSizeList(borderBoxSize) ? borderBoxSize[0] : borderBoxSize;
|
|
23
|
+
const doesSizeMatchQuery = ({
|
|
24
|
+
blockSize,
|
|
25
|
+
inlineSize,
|
|
26
|
+
maxHeight,
|
|
27
|
+
maxWidth,
|
|
28
|
+
minHeight,
|
|
29
|
+
minWidth
|
|
30
|
+
}) => (minWidth === undefined || inlineSize >= minWidth) && (maxWidth === undefined || inlineSize <= maxWidth) && (minHeight === undefined || blockSize >= minHeight) && (maxHeight === undefined || blockSize <= maxHeight);
|
|
31
|
+
const useContainerQuery = ({
|
|
32
|
+
target,
|
|
33
|
+
minWidth,
|
|
34
|
+
maxWidth,
|
|
35
|
+
minHeight,
|
|
36
|
+
maxHeight
|
|
37
|
+
}) => {
|
|
38
|
+
const resolvedTargetElement = resolveTargetElement(target);
|
|
39
|
+
const [hasMatches, setHasMatches] = (0, _react.useState)(() => {
|
|
40
|
+
if (!resolvedTargetElement) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const {
|
|
44
|
+
height,
|
|
45
|
+
width
|
|
46
|
+
} = resolvedTargetElement.getBoundingClientRect();
|
|
47
|
+
return doesSizeMatchQuery({
|
|
48
|
+
blockSize: height,
|
|
49
|
+
inlineSize: width,
|
|
50
|
+
maxHeight,
|
|
51
|
+
maxWidth,
|
|
52
|
+
minHeight,
|
|
53
|
+
minWidth
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const animationFrameIdRef = (0, _react.useRef)(null);
|
|
57
|
+
(0, _react.useEffect)(() => {
|
|
58
|
+
const targetElement = resolveTargetElement(target);
|
|
59
|
+
if (typeof ResizeObserver === "undefined" || !targetElement) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const resizeObserver = new ResizeObserver(([resizeObserverEntry]) => {
|
|
63
|
+
if (animationFrameIdRef.current !== null) {
|
|
64
|
+
cancelAnimationFrame(animationFrameIdRef.current);
|
|
65
|
+
}
|
|
66
|
+
animationFrameIdRef.current = requestAnimationFrame(() => {
|
|
67
|
+
animationFrameIdRef.current = null;
|
|
68
|
+
if (!resizeObserverEntry) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const borderBoxSize = resolveBorderBoxSize(resizeObserverEntry.borderBoxSize);
|
|
72
|
+
setHasMatches(doesSizeMatchQuery({
|
|
73
|
+
blockSize: borderBoxSize?.blockSize ?? resizeObserverEntry.contentRect.height,
|
|
74
|
+
inlineSize: borderBoxSize?.inlineSize ?? resizeObserverEntry.contentRect.width,
|
|
75
|
+
maxHeight,
|
|
76
|
+
maxWidth,
|
|
77
|
+
minHeight,
|
|
78
|
+
minWidth
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
resizeObserver.observe(targetElement);
|
|
83
|
+
return () => {
|
|
84
|
+
resizeObserver.disconnect();
|
|
85
|
+
if (animationFrameIdRef.current !== null) {
|
|
86
|
+
cancelAnimationFrame(animationFrameIdRef.current);
|
|
87
|
+
animationFrameIdRef.current = null;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}, [maxHeight, maxWidth, minHeight, minWidth, target]);
|
|
91
|
+
return hasMatches;
|
|
92
|
+
};
|
|
93
|
+
exports.useContainerQuery = useContainerQuery;
|
|
94
|
+
//# sourceMappingURL=useContainerQuery.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContainerQuery.cjs","names":["_react","require","resolveTargetElement","target","current","isResizeObserverSizeList","borderBoxSize","Array","isArray","resolveBorderBoxSize","doesSizeMatchQuery","blockSize","inlineSize","maxHeight","maxWidth","minHeight","minWidth","undefined","useContainerQuery","resolvedTargetElement","hasMatches","setHasMatches","useState","height","width","getBoundingClientRect","animationFrameIdRef","useRef","useEffect","targetElement","ResizeObserver","resizeObserver","resizeObserverEntry","cancelAnimationFrame","requestAnimationFrame","contentRect","observe","disconnect","exports"],"sources":["../../../src/theme/useContainerQuery.ts"],"sourcesContent":["/*!\n * Copyright (c) 2026-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 RefObject, useEffect, useRef, useState } from \"react\";\n\nexport type UseContainerQueryProps = {\n /** Inclusive upper bound on the target's block-size (px). */\n maxHeight?: number;\n /** Inclusive upper bound on the target's inline-size (px). */\n maxWidth?: number;\n /** Inclusive lower bound on the target's block-size (px). */\n minHeight?: number;\n /** Inclusive lower bound on the target's inline-size (px). */\n minWidth?: number;\n /**\n * Element to observe, passed as a ref or a raw element. The hook returns\n * `false` until an element is present.\n */\n target: RefObject<HTMLElement | null> | HTMLElement | null;\n};\n\nconst resolveTargetElement = (target: UseContainerQueryProps[\"target\"]) =>\n target && \"current\" in target ? target.current : target;\n\n/**\n * `borderBoxSize` is typed as an array but is absent in older browsers and a\n * single object in some, so it is narrowed through a predicate that keeps the\n * element type intact (`Array.isArray` alone widens a readonly array to `any[]`).\n */\nconst isResizeObserverSizeList = (\n borderBoxSize: ResizeObserverSize | readonly ResizeObserverSize[] | undefined,\n): borderBoxSize is readonly ResizeObserverSize[] =>\n Array.isArray(borderBoxSize);\n\nconst resolveBorderBoxSize = (\n borderBoxSize: ResizeObserverSize | readonly ResizeObserverSize[] | undefined,\n): ResizeObserverSize | undefined =>\n isResizeObserverSizeList(borderBoxSize) ? borderBoxSize[0] : borderBoxSize;\n\nconst doesSizeMatchQuery = ({\n blockSize,\n inlineSize,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n}: {\n blockSize: number;\n inlineSize: number;\n} & Omit<UseContainerQueryProps, \"target\">) =>\n (minWidth === undefined || inlineSize >= minWidth) &&\n (maxWidth === undefined || inlineSize <= maxWidth) &&\n (minHeight === undefined || blockSize >= minHeight) &&\n (maxHeight === undefined || blockSize <= maxHeight);\n\n/**\n * Reports whether an element's size satisfies a container query, mirroring\n * `useMediaQuery` but observing an element with `ResizeObserver` instead of the\n * viewport. Bounds are matched against the target's `inline-size` (width) and\n * `block-size` (height); an omitted bound is always satisfied. Returns `false`\n * until the target element exists (and when `ResizeObserver` is unavailable,\n * e.g. during server rendering).\n */\nexport const useContainerQuery = ({\n target,\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n}: UseContainerQueryProps) => {\n const resolvedTargetElement = resolveTargetElement(target);\n\n const [hasMatches, setHasMatches] = useState(() => {\n if (!resolvedTargetElement) {\n return false;\n }\n\n const { height, width } = resolvedTargetElement.getBoundingClientRect();\n\n return doesSizeMatchQuery({\n blockSize: height,\n inlineSize: width,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n });\n });\n\n const animationFrameIdRef = useRef<number | null>(null);\n\n useEffect(() => {\n // Resolve the element inside the effect: a `RefObject`'s `current` is `null`\n // during render and only populated after commit, so resolving here (rather\n // than during render) is what lets a ref target attach the observer.\n const targetElement = resolveTargetElement(target);\n\n if (typeof ResizeObserver === \"undefined\" || !targetElement) {\n return;\n }\n\n const resizeObserver = new ResizeObserver(([resizeObserverEntry]) => {\n if (animationFrameIdRef.current !== null) {\n cancelAnimationFrame(animationFrameIdRef.current);\n }\n\n animationFrameIdRef.current = requestAnimationFrame(() => {\n animationFrameIdRef.current = null;\n\n if (!resizeObserverEntry) {\n return;\n }\n\n const borderBoxSize = resolveBorderBoxSize(\n resizeObserverEntry.borderBoxSize,\n );\n\n setHasMatches(\n doesSizeMatchQuery({\n blockSize:\n borderBoxSize?.blockSize ??\n resizeObserverEntry.contentRect.height,\n inlineSize:\n borderBoxSize?.inlineSize ??\n resizeObserverEntry.contentRect.width,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n }),\n );\n });\n });\n\n resizeObserver.observe(targetElement);\n\n return () => {\n resizeObserver.disconnect();\n\n if (animationFrameIdRef.current !== null) {\n cancelAnimationFrame(animationFrameIdRef.current);\n animationFrameIdRef.current = null;\n }\n };\n }, [maxHeight, maxWidth, minHeight, minWidth, target]);\n\n return hasMatches;\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,MAAMC,oBAAoB,GAAIC,MAAwC,IACpEA,MAAM,IAAI,SAAS,IAAIA,MAAM,GAAGA,MAAM,CAACC,OAAO,GAAGD,MAAM;AAOzD,MAAME,wBAAwB,GAC5BC,aAA6E,IAE7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
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useMediaQuery = exports.useCompactViewportMatches = exports.
|
|
6
|
+
exports.useMediaQuery = exports.useCompactViewportMatches = exports.toCompactMediaQuery = exports.COMPACT_MAX_WIDTH = exports.COMPACT_MAX_HEIGHT = exports.ABSOLUTE_MINIMUM_WIDTH = exports.ABSOLUTE_MINIMUM_HEIGHT = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _shim = require("use-sync-external-store/shim");
|
|
9
9
|
/*!
|
|
@@ -40,12 +40,15 @@ const COMPACT_WIDTH_ACTIVATION_BUFFER = 80;
|
|
|
40
40
|
const COMPACT_HEIGHT_ACTIVATION_BUFFER = 244;
|
|
41
41
|
const COMPACT_MAX_WIDTH = exports.COMPACT_MAX_WIDTH = ABSOLUTE_MINIMUM_WIDTH + COMPACT_WIDTH_ACTIVATION_BUFFER;
|
|
42
42
|
const COMPACT_MAX_HEIGHT = exports.COMPACT_MAX_HEIGHT = ABSOLUTE_MINIMUM_HEIGHT + COMPACT_HEIGHT_ACTIVATION_BUFFER;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const COMPACT_CONDITION_BY_AXIS = {
|
|
44
|
+
height: `(max-height: ${COMPACT_MAX_HEIGHT}px)`,
|
|
45
|
+
width: `(max-width: ${COMPACT_MAX_WIDTH}px)`
|
|
46
|
+
};
|
|
47
|
+
const toCompactMediaQuery = (firstAxis, otherAxis) => `@media ${[firstAxis, otherAxis].filter(axis => axis !== undefined).map(axis => COMPACT_CONDITION_BY_AXIS[axis]).join(",")}`;
|
|
48
|
+
exports.toCompactMediaQuery = toCompactMediaQuery;
|
|
46
49
|
const useCompactViewportMatches = () => {
|
|
47
|
-
const isWithinCompactWidth = useMediaQuery(
|
|
48
|
-
const isWithinCompactHeight = useMediaQuery(
|
|
50
|
+
const isWithinCompactWidth = useMediaQuery(COMPACT_CONDITION_BY_AXIS.width);
|
|
51
|
+
const isWithinCompactHeight = useMediaQuery(COMPACT_CONDITION_BY_AXIS.height);
|
|
49
52
|
return (0, _react.useMemo)(() => ({
|
|
50
53
|
isWithinCompactWidth,
|
|
51
54
|
isWithinCompactHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaQuery.cjs","names":["_react","require","_shim","useMediaQuery","mediaQuery","normalizedMediaQuery","replace","supportsMatchMedia","window","matchMedia","mediaQueryList","useMemo","subscribe","useCallback","notifyReactOfChange","addEventListener","removeEventListener","getSnapshot","matches","getServerSnapshot","useSyncExternalStore","exports","ABSOLUTE_MINIMUM_WIDTH","ABSOLUTE_MINIMUM_HEIGHT","COMPACT_WIDTH_ACTIVATION_BUFFER","COMPACT_HEIGHT_ACTIVATION_BUFFER","COMPACT_MAX_WIDTH","COMPACT_MAX_HEIGHT","COMPACT_MAX_WIDTH_CONDITION","COMPACT_MAX_HEIGHT_CONDITION","COMPACT_MEDIA_QUERY","useCompactViewportMatches","isWithinCompactWidth","isWithinCompactHeight","isWithinCompactWidthOrHeight"],"sources":["../../../src/theme/useMediaQuery.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, useMemo } from \"react\";\n// React's `useSyncExternalStore` does not exist before React 18. Import it from\n// the official backport shim so the hook resolves on React 16.8+/17 consumers\n// too; the shim delegates to the native hook when running on React 18.\nimport { useSyncExternalStore } from \"use-sync-external-store/shim\";\n\nimport { StringWithValue } from \"../StringWithValue.js\";\n\n/**\n * Subscribes to a CSS media query and returns whether it currently matches,\n * re-rendering when the match state changes. Accepts the query with or without\n * a leading `@media` prefix. Uses `useSyncExternalStore` so the match is read\n * synchronously at render time (no tearing, no stale first frame), and\n * degrades to `false` in environments without `matchMedia` (server render,\n * jsdom).\n */\nexport const useMediaQuery = <MediaQuery extends string>(\n mediaQuery: StringWithValue<MediaQuery>,\n) => {\n // A leading `@media` prefix is valid CSS but is rejected by\n // `window.matchMedia`, so strip it to accept either form of the query.\n const normalizedMediaQuery = mediaQuery.replace(/^@media( ?)/m, \"\");\n\n // jsdom and server environments may not implement `matchMedia`. Guard so the\n // hook degrades to \"no match\" instead of throwing during render.\n const supportsMatchMedia =\n typeof window !== \"undefined\" && typeof window.matchMedia !== \"undefined\";\n\n const mediaQueryList = useMemo(\n () => (supportsMatchMedia ? window.matchMedia(normalizedMediaQuery) : null),\n [supportsMatchMedia, normalizedMediaQuery],\n );\n\n // `useSyncExternalStore` reads the match synchronously at render time, so\n // every component in a concurrent render sees a consistent value (no\n // tearing) and there is no stale first frame before an effect runs.\n const subscribe = useCallback(\n (notifyReactOfChange: () => void) => {\n if (!mediaQueryList) {\n return () => {};\n }\n\n mediaQueryList.addEventListener(\"change\", notifyReactOfChange);\n\n return () => {\n mediaQueryList.removeEventListener(\"change\", notifyReactOfChange);\n };\n },\n [mediaQueryList],\n );\n\n const getSnapshot = useCallback(\n () => mediaQueryList?.matches ?? false,\n [mediaQueryList],\n );\n\n // Server render (and any environment without `matchMedia`) resolves to \"no\n // match\", consistent with the guard above.\n const getServerSnapshot = useCallback(() => false, []);\n\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n};\n\n/**\n * The absolute minimum viewport width, in CSS pixels, that the UI supports.\n * WCAG 1.4.10 (Reflow) requires content to remain usable down to 320px, so\n * this is the hard floor below which layout must not lose information or\n * functionality.\n */\nexport const ABSOLUTE_MINIMUM_WIDTH = 320;\n\n/**\n * The absolute minimum viewport height, in CSS pixels, that the UI supports:\n * the hard floor below which layout must not lose information or functionality.\n */\nexport const ABSOLUTE_MINIMUM_HEIGHT = 256;\n\n// Each axis starts adapting a set distance above its absolute-minimum floor so\n// the UI gets breathing room instead of snapping exactly at the floor. Width\n// uses a small buffer just above the reflow floor. Height uses a much larger\n// one: around 500px the app starts to feel cramped (still usable, but not\n// pleasant), so we adapt the layout there rather than waiting for the 256px\n// floor.\nconst COMPACT_WIDTH_ACTIVATION_BUFFER = 80;\nconst COMPACT_HEIGHT_ACTIVATION_BUFFER = 244;\n\n/**\n * The widest viewport, in CSS pixels, still treated as compact-width. At or\n * below this width the layout adapts toward the absolute-minimum floor.\n */\nexport const COMPACT_MAX_WIDTH =\n ABSOLUTE_MINIMUM_WIDTH + COMPACT_WIDTH_ACTIVATION_BUFFER;\n\n/**\n * The tallest viewport, in CSS pixels, still treated as compact-height. At or\n * below this height the layout adapts toward the absolute-minimum floor.\n */\nexport const COMPACT_MAX_HEIGHT =\n ABSOLUTE_MINIMUM_HEIGHT + COMPACT_HEIGHT_ACTIVATION_BUFFER;\n\n/**\n * The `matchMedia`/CSS condition that matches when the viewport is\n * compact-width. Single source of truth shared by the hook and style\n * overrides so the two cannot drift.\n */\nexport const COMPACT_MAX_WIDTH_CONDITION = `(max-width: ${COMPACT_MAX_WIDTH}px)`;\n\n/**\n * The `matchMedia`/CSS condition that matches when the viewport is\n * compact-height. Single source of truth shared by the hook and style\n * overrides so the two cannot drift.\n */\nexport const COMPACT_MAX_HEIGHT_CONDITION = `(max-height: ${COMPACT_MAX_HEIGHT}px)`;\n\n/**\n * The combined CSS media query for use in style overrides, where a React hook\n * cannot run. The comma matches when either dimension is compact.\n */\nexport const COMPACT_MEDIA_QUERY = `@media ${COMPACT_MAX_WIDTH_CONDITION}, ${COMPACT_MAX_HEIGHT_CONDITION}`;\n\n/**\n * Reports whether the viewport is within the compact range, i.e. approaching\n * the absolute minimum supported size along either axis (each axis activates at\n * its own buffer above the floor). Returns a match per dimension plus a combined\n * flag so callers can adapt layout (e.g. switch a Dialog to full-screen) as the\n * viewport approaches the WCAG 1.4.10 reflow floor rather than snapping exactly\n * at it.\n *\n * `isWithinCompactWidthOrHeight` is `true` when either dimension is compact,\n * matching the OR semantics of `COMPACT_MEDIA_QUERY`.\n */\nexport const useCompactViewportMatches = () => {\n const isWithinCompactWidth = useMediaQuery(COMPACT_MAX_WIDTH_CONDITION);\n const isWithinCompactHeight = useMediaQuery(COMPACT_MAX_HEIGHT_CONDITION);\n\n return useMemo(\n () => ({\n isWithinCompactWidth,\n isWithinCompactHeight,\n isWithinCompactWidthOrHeight:\n isWithinCompactWidth || isWithinCompactHeight,\n }),\n [isWithinCompactWidth, isWithinCompactHeight],\n );\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAkBO,MAAME,aAAa,GACxBC,UAAuC,IACpC;EAGH,MAAMC,oBAAoB,GAAGD,UAAU,CAACE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;EAInE,MAAMC,kBAAkB,GACtB,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,WAAW;EAE3E,MAAMC,cAAc,GAAG,IAAAC,cAAO,EAC5B,MAAOJ,kBAAkB,GAAGC,MAAM,CAACC,UAAU,CAACJ,oBAAoB,CAAC,GAAG,IAAK,EAC3E,CAACE,kBAAkB,EAAEF,oBAAoB,CAC3C,CAAC;EAKD,MAAMO,SAAS,GAAG,IAAAC,kBAAW,EAC1BC,mBAA+B,IAAK;IACnC,IAAI,CAACJ,cAAc,EAAE;MACnB,OAAO,MAAM,CAAC,CAAC;IACjB;IAEAA,cAAc,CAACK,gBAAgB,CAAC,QAAQ,EAAED,mBAAmB,CAAC;IAE9D,OAAO,MAAM;MACXJ,cAAc,CAACM,mBAAmB,CAAC,QAAQ,EAAEF,mBAAmB,CAAC;IACnE,CAAC;EACH,CAAC,EACD,C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EAC5B,CAAC,CAAC,EACF,CAACD,oBAAoB,EAAEC,qBAAqB,CAC9C,CAAC;AACH,CAAC;AAACZ,OAAA,CAAAU,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useMediaQuery.cjs","names":["_react","require","_shim","useMediaQuery","mediaQuery","normalizedMediaQuery","replace","supportsMatchMedia","window","matchMedia","mediaQueryList","useMemo","subscribe","useCallback","notifyReactOfChange","addEventListener","removeEventListener","getSnapshot","matches","getServerSnapshot","useSyncExternalStore","exports","ABSOLUTE_MINIMUM_WIDTH","ABSOLUTE_MINIMUM_HEIGHT","COMPACT_WIDTH_ACTIVATION_BUFFER","COMPACT_HEIGHT_ACTIVATION_BUFFER","COMPACT_MAX_WIDTH","COMPACT_MAX_HEIGHT","COMPACT_CONDITION_BY_AXIS","height","width","toCompactMediaQuery","firstAxis","otherAxis","filter","axis","undefined","map","join","useCompactViewportMatches","isWithinCompactWidth","isWithinCompactHeight","isWithinCompactWidthOrHeight"],"sources":["../../../src/theme/useMediaQuery.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, useMemo } from \"react\";\n// React's `useSyncExternalStore` does not exist before React 18. Import it from\n// the official backport shim so the hook resolves on React 16.8+/17 consumers\n// too; the shim delegates to the native hook when running on React 18.\nimport { useSyncExternalStore } from \"use-sync-external-store/shim\";\n\nimport { StringWithValue } from \"../StringWithValue.js\";\n\n/**\n * Subscribes to a CSS media query and returns whether it currently matches,\n * re-rendering when the match state changes. Accepts the query with or without\n * a leading `@media` prefix. Uses `useSyncExternalStore` so the match is read\n * synchronously at render time (no tearing, no stale first frame), and\n * degrades to `false` in environments without `matchMedia` (server render,\n * jsdom).\n */\nexport const useMediaQuery = <MediaQuery extends string>(\n mediaQuery: StringWithValue<MediaQuery>,\n) => {\n // A leading `@media` prefix is valid CSS but is rejected by\n // `window.matchMedia`, so strip it to accept either form of the query.\n const normalizedMediaQuery = mediaQuery.replace(/^@media( ?)/m, \"\");\n\n // jsdom and server environments may not implement `matchMedia`. Guard so the\n // hook degrades to \"no match\" instead of throwing during render.\n const supportsMatchMedia =\n typeof window !== \"undefined\" && typeof window.matchMedia !== \"undefined\";\n\n const mediaQueryList = useMemo(\n () => (supportsMatchMedia ? window.matchMedia(normalizedMediaQuery) : null),\n [supportsMatchMedia, normalizedMediaQuery],\n );\n\n // `useSyncExternalStore` reads the match synchronously at render time, so\n // every component in a concurrent render sees a consistent value (no\n // tearing) and there is no stale first frame before an effect runs.\n const subscribe = useCallback(\n (notifyReactOfChange: () => void) => {\n if (!mediaQueryList) {\n return () => {};\n }\n\n mediaQueryList.addEventListener(\"change\", notifyReactOfChange);\n\n return () => {\n mediaQueryList.removeEventListener(\"change\", notifyReactOfChange);\n };\n },\n [mediaQueryList],\n );\n\n const getSnapshot = useCallback(\n () => mediaQueryList?.matches ?? false,\n [mediaQueryList],\n );\n\n // Server render (and any environment without `matchMedia`) resolves to \"no\n // match\", consistent with the guard above.\n const getServerSnapshot = useCallback(() => false, []);\n\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n};\n\n/**\n * The absolute minimum viewport width, in CSS pixels, that the UI supports.\n * WCAG 1.4.10 (Reflow) requires content to remain usable down to 320px, so\n * this is the hard floor below which layout must not lose information or\n * functionality.\n */\nexport const ABSOLUTE_MINIMUM_WIDTH = 320;\n\n/**\n * The absolute minimum viewport height, in CSS pixels, that the UI supports:\n * the hard floor below which layout must not lose information or functionality.\n */\nexport const ABSOLUTE_MINIMUM_HEIGHT = 256;\n\n// Each axis starts adapting a set distance above its absolute-minimum floor so\n// the UI gets breathing room instead of snapping exactly at the floor. Width\n// uses a small buffer just above the reflow floor. Height uses a much larger\n// one: around 500px the app starts to feel cramped (still usable, but not\n// pleasant), so we adapt the layout there rather than waiting for the 256px\n// floor.\nconst COMPACT_WIDTH_ACTIVATION_BUFFER = 80;\nconst COMPACT_HEIGHT_ACTIVATION_BUFFER = 244;\n\n/**\n * The widest viewport, in CSS pixels, still treated as compact-width. At or\n * below this width the layout adapts toward the absolute-minimum floor.\n */\nexport const COMPACT_MAX_WIDTH =\n ABSOLUTE_MINIMUM_WIDTH + COMPACT_WIDTH_ACTIVATION_BUFFER;\n\n/**\n * The tallest viewport, in CSS pixels, still treated as compact-height. At or\n * below this height the layout adapts toward the absolute-minimum floor.\n */\nexport const COMPACT_MAX_HEIGHT =\n ABSOLUTE_MINIMUM_HEIGHT + COMPACT_HEIGHT_ACTIVATION_BUFFER;\n\n/**\n * The `matchMedia` and CSS condition for each axis. This is the only place that\n * turns a threshold into a condition string, so the hook and the style overrides\n * cannot drift.\n */\nconst COMPACT_CONDITION_BY_AXIS = {\n height: `(max-height: ${COMPACT_MAX_HEIGHT}px)`,\n width: `(max-width: ${COMPACT_MAX_WIDTH}px)`,\n} as const;\n\n/** The axis names that `toCompactMediaQuery` accepts. */\nexport type CompactViewportAxis = keyof typeof COMPACT_CONDITION_BY_AXIS;\n\n/**\n * Builds the compact CSS `@media` rule for the given axes. The rule matches when\n * any one of those axes is compact. Use the result as a key in a style override\n * object, where a React hook cannot run.\n *\n * Give the name of an axis, not a condition string. The function holds the\n * threshold, so no caller can pass a wrong pixel value, and the compact\n * conditions need no export at all.\n *\n * A viewport has two axes, so the parameters spell out every legal call: one\n * axis, then at most one axis that the first call did not name. TypeScript\n * rejects a call with no axis, a repeated axis, or a third axis.\n *\n * Call `useCompactViewportMatches` in a component instead.\n *\n * This function stays internal to the package. Add it to the public `index.ts`\n * only when a consumer outside the package needs it.\n */\nexport const toCompactMediaQuery = <FirstAxis extends CompactViewportAxis>(\n firstAxis: FirstAxis,\n otherAxis?: Exclude<CompactViewportAxis, FirstAxis>,\n) =>\n `@media ${[firstAxis, otherAxis]\n .filter((axis) => axis !== undefined)\n .map((axis) => COMPACT_CONDITION_BY_AXIS[axis])\n .join(\",\")}`;\n\n/**\n * Reports whether the viewport is within the compact range, i.e. approaching\n * the absolute minimum supported size along either axis (each axis activates at\n * its own buffer above the floor). Returns a match per dimension plus a combined\n * flag so callers can adapt layout (e.g. switch a Dialog to full-screen) as the\n * viewport approaches the WCAG 1.4.10 reflow floor rather than snapping exactly\n * at it.\n *\n * `isWithinCompactWidthOrHeight` is `true` when either dimension is compact. It\n * matches a style override that gives both axes to `toCompactMediaQuery`.\n */\nexport const useCompactViewportMatches = () => {\n const isWithinCompactWidth = useMediaQuery(COMPACT_CONDITION_BY_AXIS.width);\n const isWithinCompactHeight = useMediaQuery(COMPACT_CONDITION_BY_AXIS.height);\n\n return useMemo(\n () => ({\n isWithinCompactWidth,\n isWithinCompactHeight,\n isWithinCompactWidthOrHeight:\n isWithinCompactWidth || isWithinCompactHeight,\n }),\n [isWithinCompactWidth, isWithinCompactHeight],\n );\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAkBO,MAAME,aAAa,GACxBC,UAAuC,IACpC;EAGH,MAAMC,oBAAoB,GAAGD,UAAU,CAACE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;EAInE,MAAMC,kBAAkB,GACtB,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,WAAW;EAE3E,MAAMC,cAAc,GAAG,IAAAC,cAAO,EAC5B,MAAOJ,kBAAkB,GAAGC,MAAM,CAACC,UAAU,CAACJ,oBAAoB,CAAC,GAAG,IAAK,EAC3E,CAACE,kBAAkB,E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,CAACD,SAAS,EAAEC,SAAS,CAAC,CAC7BC,MAAM,CAAEC,IAAI,IAAKA,IAAI,KAAKC,SAAS,CAAC,CACpCC,GAAG,CAAEF,IAAI,IAAKP,yBAAyB,CAACO,IAAI,CAAC,CAAC,CAC9CG,IAAI,CAAC,GAAG,CAAC,EAAE;AAACjB,OAAA,CAAAU,mBAAA,GAAAA,mBAAA;AAaV,MAAMQ,yBAAyB,GAAGA,CAAA,KAAM;EAC7C,MAAMC,oBAAoB,GAAGrC,aAAa,CAACyB,yBAAyB,CAACE,KAAK,CAAC;EAC3E,MAAMW,qBAAqB,GAAGtC,aAAa,CAACyB,yBAAyB,CAACC,MAAM,CAAC;EAE7E,OAAO,IAAAlB,cAAO,EACZ,OAAO;IACL6B,oBAAoB;IACpBC,qBAAqB;IACrBC,4BAA4B,EAC1BF,oBAAoB,IAAIC;EAC5B,CAAC,CAAC,EACF,CAACD,oBAAoB,EAAEC,qBAAqB,CAC9C,CAAC;AACH,CAAC;AAACpB,OAAA,CAAAkB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -77,5 +77,5 @@ const AppSwitcher = ({
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
const MemoizedAppSwitcher = exports.AppSwitcher = (0, _react.memo)(AppSwitcher);
|
|
80
|
-
MemoizedAppSwitcher.displayName = "AppSwitcher::pkg=odyssey&odysseyV=1.
|
|
80
|
+
MemoizedAppSwitcher.displayName = "AppSwitcher::pkg=odyssey&odysseyV=1.69.0";
|
|
81
81
|
//# sourceMappingURL=AppSwitcher.cjs.map
|
|
@@ -57,5 +57,5 @@ const InnerAppContainer = ({
|
|
|
57
57
|
children: [(0, _jsxRuntime.jsx)(StyledAppContainerShadow1, {}), (0, _jsxRuntime.jsx)(StyledAppContainerShadow2, {}), (0, _jsxRuntime.jsx)(StyledAppContainerShadow3, {})]
|
|
58
58
|
}) : null;
|
|
59
59
|
const MemoizedInnerAppContainer = exports.InnerAppContainer = (0, _react.memo)(InnerAppContainer);
|
|
60
|
-
MemoizedInnerAppContainer.displayName = "InnerAppContainer::pkg=odyssey&odysseyV=1.
|
|
60
|
+
MemoizedInnerAppContainer.displayName = "InnerAppContainer::pkg=odyssey&odysseyV=1.69.0";
|
|
61
61
|
//# sourceMappingURL=InnerAppContainer.cjs.map
|
|
@@ -379,5 +379,5 @@ const NarrowUiShellContent = ({
|
|
|
379
379
|
});
|
|
380
380
|
};
|
|
381
381
|
const MemoizedNarrowUiShellContent = exports.NarrowUiShellContent = (0, _react.memo)(NarrowUiShellContent);
|
|
382
|
-
MemoizedNarrowUiShellContent.displayName = "NarrowUiShellContent::pkg=odyssey&odysseyV=1.
|
|
382
|
+
MemoizedNarrowUiShellContent.displayName = "NarrowUiShellContent::pkg=odyssey&odysseyV=1.69.0";
|
|
383
383
|
//# sourceMappingURL=NarrowUiShellContent.cjs.map
|
|
@@ -170,5 +170,5 @@ const NavAccordion = ({
|
|
|
170
170
|
});
|
|
171
171
|
};
|
|
172
172
|
const MemoizedNavAccordion = exports.NavAccordion = (0, _react.memo)(NavAccordion);
|
|
173
|
-
MemoizedNavAccordion.displayName = "NavAccordion::pkg=odyssey&odysseyV=1.
|
|
173
|
+
MemoizedNavAccordion.displayName = "NavAccordion::pkg=odyssey&odysseyV=1.69.0";
|
|
174
174
|
//# sourceMappingURL=NavAccordion.cjs.map
|
|
@@ -653,5 +653,5 @@ const SideNav = ({
|
|
|
653
653
|
});
|
|
654
654
|
};
|
|
655
655
|
const MemoizedSideNav = exports.SideNav = (0, _react.memo)(SideNav);
|
|
656
|
-
MemoizedSideNav.displayName = "SideNav::pkg=odyssey&odysseyV=1.
|
|
656
|
+
MemoizedSideNav.displayName = "SideNav::pkg=odyssey&odysseyV=1.69.0";
|
|
657
657
|
//# sourceMappingURL=SideNav.cjs.map
|
|
@@ -69,5 +69,5 @@ const SideNavFooterContent = ({
|
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
const MemoizedSideNavFooterContent = exports.SideNavFooterContent = (0, _react.memo)(SideNavFooterContent);
|
|
72
|
-
MemoizedSideNavFooterContent.displayName = "SideNavFooterContent::pkg=odyssey&odysseyV=1.
|
|
72
|
+
MemoizedSideNavFooterContent.displayName = "SideNavFooterContent::pkg=odyssey&odysseyV=1.69.0";
|
|
73
73
|
//# sourceMappingURL=SideNavFooterContent.cjs.map
|
|
@@ -100,5 +100,5 @@ const SideNavHeader = ({
|
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
102
|
const MemoizedSideNavHeader = exports.SideNavHeader = (0, _react.memo)(SideNavHeader);
|
|
103
|
-
MemoizedSideNavHeader.displayName = "SideNavHeader::pkg=odyssey&odysseyV=1.
|
|
103
|
+
MemoizedSideNavHeader.displayName = "SideNavHeader::pkg=odyssey&odysseyV=1.69.0";
|
|
104
104
|
//# sourceMappingURL=SideNavHeader.cjs.map
|
|
@@ -61,7 +61,7 @@ const SideNavListItem = (0, _react.forwardRef)(({
|
|
|
61
61
|
...sideNavListItemProps,
|
|
62
62
|
ref: sideNavListItemRef
|
|
63
63
|
}));
|
|
64
|
-
SideNavListItem.displayName = "SideNavListItem::pkg=odyssey&odysseyV=1.
|
|
64
|
+
SideNavListItem.displayName = "SideNavListItem::pkg=odyssey&odysseyV=1.69.0";
|
|
65
65
|
const scrollToNode = node => {
|
|
66
66
|
if (node) {
|
|
67
67
|
node?.scrollIntoView({
|
|
@@ -346,5 +346,5 @@ const SideNavItemContent = ({
|
|
|
346
346
|
}, id);
|
|
347
347
|
};
|
|
348
348
|
const MemoizedSideNavItemContent = exports.SideNavItemContent = (0, _react.memo)(SideNavItemContent);
|
|
349
|
-
MemoizedSideNavItemContent.displayName = "SideNavItemContent::pkg=odyssey&odysseyV=1.
|
|
349
|
+
MemoizedSideNavItemContent.displayName = "SideNavItemContent::pkg=odyssey&odysseyV=1.69.0";
|
|
350
350
|
//# sourceMappingURL=SideNavItemContent.cjs.map
|
|
@@ -74,5 +74,5 @@ const SideNavItemLinkContent = ({
|
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
76
|
const MemoizedSideNavItemLinkContent = exports.SideNavItemLinkContent = (0, _react.memo)(SideNavItemLinkContent);
|
|
77
|
-
MemoizedSideNavItemLinkContent.displayName = "SideNavItemLinkContent::pkg=odyssey&odysseyV=1.
|
|
77
|
+
MemoizedSideNavItemLinkContent.displayName = "SideNavItemLinkContent::pkg=odyssey&odysseyV=1.69.0";
|
|
78
78
|
//# sourceMappingURL=SideNavItemLinkContent.cjs.map
|
|
@@ -44,5 +44,5 @@ const SideNavSortableList = ({
|
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
46
|
const MemoizedSideNavSortableList = exports.SideNavSortableList = (0, _react.memo)(SideNavSortableList);
|
|
47
|
-
MemoizedSideNavSortableList.displayName = "SideNavSortableList::pkg=odyssey&odysseyV=1.
|
|
47
|
+
MemoizedSideNavSortableList.displayName = "SideNavSortableList::pkg=odyssey&odysseyV=1.69.0";
|
|
48
48
|
//# sourceMappingURL=SideNavSortableList.cjs.map
|
|
@@ -88,7 +88,7 @@ const StyledChevronRightIcon = (0, _styled.default)(_ChevronRight.ChevronRightIc
|
|
|
88
88
|
transitionProperty: "transform",
|
|
89
89
|
transitionTimingFunction: "ease-in-out"
|
|
90
90
|
}));
|
|
91
|
-
StyledChevronRightIcon.displayName = "StyledChevronRightIcon::pkg=odyssey&odysseyV=1.
|
|
91
|
+
StyledChevronRightIcon.displayName = "StyledChevronRightIcon::pkg=odyssey&odysseyV=1.69.0";
|
|
92
92
|
const defaultLocalButton = typeof window === "undefined" ? null : document.createElement("button");
|
|
93
93
|
const SideNavToggleButton = ({
|
|
94
94
|
ariaControls,
|
|
@@ -163,5 +163,5 @@ const SideNavToggleButton = ({
|
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
165
|
const MemoizedSideNavToggleButton = exports.SideNavToggleButton = (0, _react.memo)(SideNavToggleButton);
|
|
166
|
-
MemoizedSideNavToggleButton.displayName = "SideNavToggleButton::pkg=odyssey&odysseyV=1.
|
|
166
|
+
MemoizedSideNavToggleButton.displayName = "SideNavToggleButton::pkg=odyssey&odysseyV=1.69.0";
|
|
167
167
|
//# sourceMappingURL=SideNavToggleButton.cjs.map
|
|
@@ -121,5 +121,5 @@ const SkipToContent = ({
|
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
123
|
const MemoizedSkipToContent = exports.SkipToContent = (0, _react.memo)(SkipToContent);
|
|
124
|
-
MemoizedSkipToContent.displayName = "SkipToContent::pkg=odyssey&odysseyV=1.
|
|
124
|
+
MemoizedSkipToContent.displayName = "SkipToContent::pkg=odyssey&odysseyV=1.69.0";
|
|
125
125
|
//# sourceMappingURL=SkipToContent.cjs.map
|
|
@@ -33,5 +33,5 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
const MemoizedHamburgerMenuIcon = exports.HamburgerMenuIcon = (0, _react.memo)(HamburgerMenuIcon);
|
|
36
|
-
MemoizedHamburgerMenuIcon.displayName = "HamburgerMenuIcon::pkg=odyssey&odysseyV=1.
|
|
36
|
+
MemoizedHamburgerMenuIcon.displayName = "HamburgerMenuIcon::pkg=odyssey&odysseyV=1.69.0";
|
|
37
37
|
//# sourceMappingURL=HamburgerMenuIcon.cjs.map
|
|
@@ -69,5 +69,5 @@ const TopNav = ({
|
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
const MemoizedTopNav = exports.TopNav = (0, _react.memo)(TopNav);
|
|
72
|
-
MemoizedTopNav.displayName = "TopNav::pkg=odyssey&odysseyV=1.
|
|
72
|
+
MemoizedTopNav.displayName = "TopNav::pkg=odyssey&odysseyV=1.69.0";
|
|
73
73
|
//# sourceMappingURL=TopNav.cjs.map
|
|
@@ -39,5 +39,5 @@ const TopNavLinksList = ({
|
|
|
39
39
|
})
|
|
40
40
|
});
|
|
41
41
|
const MemoizedTopNavLinksList = exports.TopNavLinksList = (0, _react.memo)(TopNavLinksList);
|
|
42
|
-
MemoizedTopNavLinksList.displayName = "TopNavLinksList::pkg=odyssey&odysseyV=1.
|
|
42
|
+
MemoizedTopNavLinksList.displayName = "TopNavLinksList::pkg=odyssey&odysseyV=1.69.0";
|
|
43
43
|
//# sourceMappingURL=TopNavLinksList.cjs.map
|
|
@@ -133,5 +133,5 @@ const TopNavListItem = ({
|
|
|
133
133
|
});
|
|
134
134
|
};
|
|
135
135
|
const MemoizedTopNavListItem = exports.TopNavListItem = (0, _react.memo)(TopNavListItem);
|
|
136
|
-
MemoizedTopNavListItem.displayName = "TopNavListItem::pkg=odyssey&odysseyV=1.
|
|
136
|
+
MemoizedTopNavListItem.displayName = "TopNavListItem::pkg=odyssey&odysseyV=1.69.0";
|
|
137
137
|
//# sourceMappingURL=TopNavListItem.cjs.map
|
|
@@ -129,5 +129,5 @@ const UiShell = ({
|
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
131
|
const MemoizedUiShell = exports.UiShell = (0, _react.memo)(UiShell);
|
|
132
|
-
MemoizedUiShell.displayName = "UiShell::pkg=odyssey&odysseyV=1.
|
|
132
|
+
MemoizedUiShell.displayName = "UiShell::pkg=odyssey&odysseyV=1.69.0";
|
|
133
133
|
//# sourceMappingURL=UiShell.cjs.map
|
|
@@ -72,5 +72,5 @@ const UiShellLogo = ({
|
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
const MemoizedUiShellLogo = exports.UiShellLogo = (0, _react.memo)(UiShellLogo);
|
|
75
|
-
MemoizedUiShellLogo.displayName = "UiShellLogo::pkg=odyssey&odysseyV=1.
|
|
75
|
+
MemoizedUiShellLogo.displayName = "UiShellLogo::pkg=odyssey&odysseyV=1.69.0";
|
|
76
76
|
//# sourceMappingURL=UiShellLogo.cjs.map
|
|
@@ -177,5 +177,5 @@ const WideUiShellContent = ({
|
|
|
177
177
|
});
|
|
178
178
|
};
|
|
179
179
|
const MemoizedWideUiShellContent = exports.WideUiShellContent = (0, _react.memo)(WideUiShellContent);
|
|
180
|
-
MemoizedWideUiShellContent.displayName = "WideUiShellContent::pkg=odyssey&odysseyV=1.
|
|
180
|
+
MemoizedWideUiShellContent.displayName = "WideUiShellContent::pkg=odyssey&odysseyV=1.69.0";
|
|
181
181
|
//# sourceMappingURL=WideUiShellContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContrastMode.cjs","names":["Tokens","_interopRequireWildcard","require","_react","_hexToRgb","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ContrastModeContext","exports","createContext","contrastMode","defaultContrast","useContrastModeContext","useContext","hueNeutral50Rgb","hexToRgb","HueNeutral50","asFormattedString","isTransparentColor","color","normalizeRgbaToRgb","rgba","replace","getElementComputedBackgroundColor","element","window","getComputedStyle","backgroundColor","normalizeBackgroundColor","bgColor","test","normalizedColor","defaultParentBackgroundColor","getParentElement","parentElement","root","getRootNode","ShadowRoot","host","HTMLElement","getBackgroundColor","deriveContrastMode","useContrastMode","explicitContrastMode","contrastContainerRef","useRef","existingContrastMode","parentBackgroundColor","setParentBackgroundColor","useState","detectedContrastMode","setDetectedContrastMode","updateBackgroundColor","useCallback","newBgColor","current","useLayoutEffect","observer","MutationObserver","htmlElement","document","documentElement","observe","attributes","attributeFilter","head","childList","subtree","onTransitionEnd","event","TransitionEvent","propertyName","eventRoot","addEventListener","removeEventListener","disconnect"],"sources":["../../src/useContrastMode.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { hexToRgb } from \"./hexToRgb.js\";\n\nexport type ContrastMode = \"lowContrast\" | \"highContrast\";\nexport type ContrastModeContextType = {\n contrastMode: ContrastMode;\n};\n\nexport const ContrastModeContext = createContext<ContrastModeContextType>({\n contrastMode: \"lowContrast\",\n});\n\nexport const defaultContrast = \"lowContrast\";\n\nexport const useContrastModeContext = () => useContext(ContrastModeContext);\n\nexport const hueNeutral50Rgb = hexToRgb(Tokens.HueNeutral50).asFormattedString;\n\nexport const isTransparentColor = (color: string) =>\n color === \"rgba(0, 0, 0, 0)\" || color === \"transparent\";\n\nexport const normalizeRgbaToRgb = (rgba: string) =>\n rgba.replace(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/, \"rgb($1, $2, $3)\");\n\nexport const getElementComputedBackgroundColor = (\n element: HTMLElement,\n): string => window.getComputedStyle(element).backgroundColor;\n\nexport const normalizeBackgroundColor = (bgColor: string): string => {\n if (/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/.test(bgColor)) {\n const normalizedColor = normalizeRgbaToRgb(bgColor);\n return normalizedColor === hueNeutral50Rgb\n ? Tokens.HueNeutral50\n : normalizedColor;\n }\n\n return bgColor === hueNeutral50Rgb ? Tokens.HueNeutral50 : bgColor;\n};\n\n/** Default background color when none is detected: HueNeutral50 (gray = highContrast). */\nexport const defaultParentBackgroundColor = Tokens.HueNeutral50;\n\n/**\n * Returns the parent element, crossing shadow DOM boundaries when necessary.\n * When `parentElement` is null (e.g., at a shadow root), this checks if the\n * element is inside a ShadowRoot and jumps to the host element to continue\n * traversal.\n */\nconst getParentElement = (element: HTMLElement): HTMLElement | null => {\n if (element.parentElement) {\n return element.parentElement;\n }\n\n const root = element.getRootNode();\n if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {\n return root.host;\n }\n\n return null;\n};\n\n/**\n * Determines the effective background color of an element.\n *\n * @param element - The HTML element to check.\n * @returns The effective background color. Returns defaultParentBackgroundColor if no non-transparent background is found.\n *\n * Note:\n * - Low contrast mode is used for white background (HueNeutralWhite).\n * - High contrast mode is used for gray background (defaultParentBackgroundColor = HueNeutral50).\n * - Crosses shadow DOM boundaries via `getRootNode().host` to detect backgrounds\n * set outside of shadow roots.\n */\nexport const getBackgroundColor = (element: HTMLElement | null): string => {\n while (element) {\n const bgColor = getElementComputedBackgroundColor(element);\n if (!isTransparentColor(bgColor)) {\n return normalizeBackgroundColor(bgColor);\n }\n element = getParentElement(element);\n }\n return defaultParentBackgroundColor; // Default to gray/high contrast if no background color is found\n};\n\nexport const deriveContrastMode = (bgColor: string): ContrastMode =>\n bgColor === Tokens.HueNeutral50 ? \"highContrast\" : \"lowContrast\";\n\ntype UseContrastModeProps = {\n contrastMode?: ContrastMode;\n};\n\nexport const useContrastMode = ({\n contrastMode: explicitContrastMode,\n}: UseContrastModeProps) => {\n const contrastContainerRef = useRef<HTMLDivElement>(null);\n const { contrastMode: existingContrastMode } = useContrastModeContext();\n\n const [parentBackgroundColor, setParentBackgroundColor] = useState(\n defaultParentBackgroundColor,\n );\n const [detectedContrastMode, setDetectedContrastMode] =\n useState<ContrastMode>(() => existingContrastMode);\n\n const contrastMode = explicitContrastMode ?? detectedContrastMode;\n\n const updateBackgroundColor = useCallback(() => {\n const newBgColor = getBackgroundColor(contrastContainerRef.current);\n setParentBackgroundColor(newBgColor);\n setDetectedContrastMode(deriveContrastMode(newBgColor));\n }, []);\n\n useLayoutEffect(() => {\n if (explicitContrastMode) return;\n\n const observer = new MutationObserver(updateBackgroundColor);\n\n // In shadow DOM contexts, document.documentElement and\n // document.head may not be accessible. Guard against null to\n // prevent observer.observe(null) from throwing.\n const htmlElement = document.documentElement;\n if (htmlElement) {\n observer.observe(htmlElement, {\n attributes: true,\n attributeFilter: [\"class\", \"style\"],\n });\n }\n\n if (document.head) {\n observer.observe(document.head, {\n childList: true,\n subtree: true,\n });\n }\n\n const onTransitionEnd = (event: Event) => {\n if (\n event instanceof TransitionEvent &&\n event.propertyName === \"background-color\"\n ) {\n updateBackgroundColor();\n }\n };\n\n // Attach the transitionend listener to the element's root node so it\n // works inside shadow DOM (where events don't bubble to `document`).\n const eventRoot = contrastContainerRef.current?.getRootNode() ?? document;\n eventRoot.addEventListener(\"transitionend\", onTransitionEnd);\n updateBackgroundColor();\n\n return () => {\n eventRoot.removeEventListener(\"transitionend\", onTransitionEnd);\n observer.disconnect();\n };\n }, [explicitContrastMode, updateBackgroundColor]);\n\n return {\n contrastContainerRef,\n contrastMode,\n parentBackgroundColor,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,SAAA,GAAAF,OAAA;AAAyC,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAA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AAC,CAAC;MACzB;IACF,CAAC;IAID,MAAMoB,SAAS,GAAG5B,oBAAoB,CAACW,OAAO,EAAEnB,WAAW,CAAC,CAAC,IAAIwB,QAAQ;IACzEY,SAAS,CAACC,gBAAgB,CAAC,eAAe,EAAEL,eAAe,CAAC;IAC5DhB,qBAAqB,CAAC,CAAC;IAEvB,OAAO,MAAM;MACXoB,SAAS,CAACE,mBAAmB,CAAC,eAAe,EAAEN,eAAe,CAAC;MAC/DX,QAAQ,CAACkB,UAAU,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAAChC,oBAAoB,EAAES,qBAAqB,CAAC,CAAC;EAEjD,OAAO;IACLR,oBAAoB;IACpBlC,YAAY;IACZqC;EACF,CAAC;AACH,CAAC;AAACvC,OAAA,CAAAkC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useContrastMode.cjs","names":["Tokens","_interopRequireWildcard","require","_react","_hexToRgb","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ContrastModeContext","exports","createContext","contrastMode","defaultContrast","useContrastModeContext","useContext","hueNeutral50Rgb","hexToRgb","HueNeutral50","asFormattedString","isTransparentColor","color","normalizeRgbaToRgb","rgba","replace","getElementComputedBackgroundColor","element","window","getComputedStyle","backgroundColor","normalizeBackgroundColor","bgColor","test","normalizedColor","defaultParentBackgroundColor","getParentElement","parentElement","root","getRootNode","ShadowRoot","host","HTMLElement","getBackgroundColor","deriveContrastMode","useContrastMode","explicitContrastMode","contrastContainerRef","useRef","existingContrastMode","parentBackgroundColor","setParentBackgroundColor","useState","detectedContrastMode","setDetectedContrastMode","updateBackgroundColor","useCallback","newBgColor","current","useLayoutEffect","observer","MutationObserver","htmlElement","document","documentElement","observe","attributes","attributeFilter","head","childList","subtree","onTransitionEnd","event","TransitionEvent","propertyName","eventRoot","addEventListener","removeEventListener","disconnect"],"sources":["../../src/useContrastMode.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport {\n createContext,\n type RefObject,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { hexToRgb } from \"./hexToRgb.js\";\n\nexport type ContrastMode = \"lowContrast\" | \"highContrast\";\nexport type ContrastModeContextType = {\n /**\n * Odyssey's app wrapper element: the contrast and height container\n * `OdysseyThemeProvider` renders. `useAppElementContainerQuery` observes it so\n * container queries track the space Odyssey actually occupies. Absent outside\n * a provider, and `current` stays `null` when the provider renders with\n * `hasWrapperElement={false}`.\n */\n contrastContainerRef?: RefObject<HTMLDivElement>;\n contrastMode: ContrastMode;\n};\n\nexport const ContrastModeContext = createContext<ContrastModeContextType>({\n contrastMode: \"lowContrast\",\n});\n\nexport const defaultContrast = \"lowContrast\";\n\nexport const useContrastModeContext = () => useContext(ContrastModeContext);\n\nexport const hueNeutral50Rgb = hexToRgb(Tokens.HueNeutral50).asFormattedString;\n\nexport const isTransparentColor = (color: string) =>\n color === \"rgba(0, 0, 0, 0)\" || color === \"transparent\";\n\nexport const normalizeRgbaToRgb = (rgba: string) =>\n rgba.replace(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/, \"rgb($1, $2, $3)\");\n\nexport const getElementComputedBackgroundColor = (\n element: HTMLElement,\n): string => window.getComputedStyle(element).backgroundColor;\n\nexport const normalizeBackgroundColor = (bgColor: string): string => {\n if (/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*[\\d.]+\\)/.test(bgColor)) {\n const normalizedColor = normalizeRgbaToRgb(bgColor);\n return normalizedColor === hueNeutral50Rgb\n ? Tokens.HueNeutral50\n : normalizedColor;\n }\n\n return bgColor === hueNeutral50Rgb ? Tokens.HueNeutral50 : bgColor;\n};\n\n/** Default background color when none is detected: HueNeutral50 (gray = highContrast). */\nexport const defaultParentBackgroundColor = Tokens.HueNeutral50;\n\n/**\n * Returns the parent element, crossing shadow DOM boundaries when necessary.\n * When `parentElement` is null (e.g., at a shadow root), this checks if the\n * element is inside a ShadowRoot and jumps to the host element to continue\n * traversal.\n */\nconst getParentElement = (element: HTMLElement): HTMLElement | null => {\n if (element.parentElement) {\n return element.parentElement;\n }\n\n const root = element.getRootNode();\n if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {\n return root.host;\n }\n\n return null;\n};\n\n/**\n * Determines the effective background color of an element.\n *\n * @param element - The HTML element to check.\n * @returns The effective background color. Returns defaultParentBackgroundColor if no non-transparent background is found.\n *\n * Note:\n * - Low contrast mode is used for white background (HueNeutralWhite).\n * - High contrast mode is used for gray background (defaultParentBackgroundColor = HueNeutral50).\n * - Crosses shadow DOM boundaries via `getRootNode().host` to detect backgrounds\n * set outside of shadow roots.\n */\nexport const getBackgroundColor = (element: HTMLElement | null): string => {\n while (element) {\n const bgColor = getElementComputedBackgroundColor(element);\n if (!isTransparentColor(bgColor)) {\n return normalizeBackgroundColor(bgColor);\n }\n element = getParentElement(element);\n }\n return defaultParentBackgroundColor; // Default to gray/high contrast if no background color is found\n};\n\nexport const deriveContrastMode = (bgColor: string): ContrastMode =>\n bgColor === Tokens.HueNeutral50 ? \"highContrast\" : \"lowContrast\";\n\ntype UseContrastModeProps = {\n contrastMode?: ContrastMode;\n};\n\nexport const useContrastMode = ({\n contrastMode: explicitContrastMode,\n}: UseContrastModeProps) => {\n const contrastContainerRef = useRef<HTMLDivElement>(null);\n const { contrastMode: existingContrastMode } = useContrastModeContext();\n\n const [parentBackgroundColor, setParentBackgroundColor] = useState(\n defaultParentBackgroundColor,\n );\n const [detectedContrastMode, setDetectedContrastMode] =\n useState<ContrastMode>(() => existingContrastMode);\n\n const contrastMode = explicitContrastMode ?? detectedContrastMode;\n\n const updateBackgroundColor = useCallback(() => {\n const newBgColor = getBackgroundColor(contrastContainerRef.current);\n setParentBackgroundColor(newBgColor);\n setDetectedContrastMode(deriveContrastMode(newBgColor));\n }, []);\n\n useLayoutEffect(() => {\n if (explicitContrastMode) return;\n\n const observer = new MutationObserver(updateBackgroundColor);\n\n // In shadow DOM contexts, document.documentElement and\n // document.head may not be accessible. Guard against null to\n // prevent observer.observe(null) from throwing.\n const htmlElement = document.documentElement;\n if (htmlElement) {\n observer.observe(htmlElement, {\n attributes: true,\n attributeFilter: [\"class\", \"style\"],\n });\n }\n\n if (document.head) {\n observer.observe(document.head, {\n childList: true,\n subtree: true,\n });\n }\n\n const onTransitionEnd = (event: Event) => {\n if (\n event instanceof TransitionEvent &&\n event.propertyName === \"background-color\"\n ) {\n updateBackgroundColor();\n }\n };\n\n // Attach the transitionend listener to the element's root node so it\n // works inside shadow DOM (where events don't bubble to `document`).\n const eventRoot = contrastContainerRef.current?.getRootNode() ?? document;\n eventRoot.addEventListener(\"transitionend\", onTransitionEnd);\n updateBackgroundColor();\n\n return () => {\n eventRoot.removeEventListener(\"transitionend\", onTransitionEnd);\n observer.disconnect();\n };\n }, [explicitContrastMode, updateBackgroundColor]);\n\n return {\n contrastContainerRef,\n contrastMode,\n parentBackgroundColor,\n };\n};\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,SAAA,GAAAF,OAAA;AAAyC,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EA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