@okta/odyssey-react-mui 1.68.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 +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 +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 +13 -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/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/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/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 +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 +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/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/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/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/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/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/Drawer.d.ts.map +1 -1
- package/dist/types/theme/useMediaQuery.d.ts +29 -15
- package/dist/types/theme/useMediaQuery.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 +19 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartTokens.js","names":["useMemo","useOdysseyDesignTokens","CSS_ROOT_FONT_SIZE_PIXELS","chartTokens","ChartAnimationDuration","ChartBarRadius","ChartLegendLineSymbolWidth","ChartLineHoverStrokeWidthPlus","ChartLineMarkerHoverHaloOpacity","ChartLineMarkerHoverHaloSize","ChartLineMarkerHoverSize","ChartLineMarkerSize","ChartLineStrokeWidth","ChartMinHeight","ChartYAxisLabelBaselineCompensation","getTokenValueAsPixels","tokenValue","typographySizeBase","trimEnd","endsWith","parseFloat","useChartTokens","odysseyDesignTokens","toPixels","TypographySizeBase","lineHeight","TypographySizeBody","TypographyLineHeightBody","axisValueStyle","color","TypographyColorSubordinate","fontFamily","TypographyFamilyBody","fontSize","fontWeight","TypographyWeightBody","seriesColors","HueBlue600","HueAccentThree400","HueAccentTwo400","HueAccentOne600","HueYellow400","HueGreen600","animationDuration","barRadius","legendLineSymbolHeight","legendLineSymbolWidth","lineHoverStrokeWidthPlus","lineMarkerHoverHaloOpacity","lineMarkerHoverHaloRadius","lineMarkerHoverRadius","lineMarkerRadius","lineStrokeWidth","minHeight","bodyFontFamily","borderColor","BorderColorDisplay","borderWidth","BorderWidthMain","chartBackgroundColor","crosshairColor","crosshairWidth","edgeSpacing","Spacing2","focusRingColor","BorderColorPrimaryControl","focusRingOffset","FocusOutlineOffsetMain","focusRingRadius","BorderRadiusTight","focusRingWidth","FocusOutlineWidthMain","legendItemSpacing","Spacing4","legendSpacing","legendSymbolSpacing","popoverBackgroundColor","HueNeutralWhite","popoverRadius","BorderRadiusMain","popoverSpacing","topEdgeSpacing","Spacing3","xAxisLabelSpacing","yAxisLabelSpacing","axisLabelStyle","legendItemHiddenStyle","TypographyColorDisabled","legendItemHoverStyle","TypographyColorBody","legendItemStyle","popoverStyle","boxShadow","DepthMedium"],"sources":["../../../src/Charts/chartTokens.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 { useMemo } from \"react\";\n\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext.js\";\n\nconst CSS_ROOT_FONT_SIZE_PIXELS = 16;\n\n/**\n * The chart values that no Odyssey design token supplies. Each entry is either\n * a Highcharts implementation detail that no token will ever cover, or a chart\n * specification value that the design team has not yet turned into a token.\n */\nexport const chartTokens = {\n // TransitionDurationMainAsNumber is 100, and the spec asks for 250.\n ChartAnimationDuration: 250,\n // The spec asks for 3px, and BorderRadiusTight is 4px.\n ChartBarRadius: 3,\n // The spec asks for 22px, and the spacing scale has no 22px step.\n ChartLegendLineSymbolWidth: 22,\n // The amount Highcharts adds to ChartLineStrokeWidth on hover, for the\n // spec's 3px hover stroke. Set explicitly, so an undocumented Highcharts\n // default cannot move the hover stroke out of spec.\n ChartLineHoverStrokeWidthPlus: 1,\n ChartLineMarkerHoverHaloOpacity: 0.25,\n ChartLineMarkerHoverHaloSize: 20,\n ChartLineMarkerHoverSize: 12,\n ChartLineMarkerSize: 8,\n // The spec asks for 2px, and BorderWidthHeavy is 1.5px.\n ChartLineStrokeWidth: 2,\n // The floor for a consumer that sets no height on the chart container. The\n // spacing scale stops at Spacing9, which is 56px.\n ChartMinHeight: 400,\n // Highcharts gives the Y axis label less visible space than the X axis\n // label at the same `title.margin`. The comment on `yAxisLabelSpacing` below\n // gives the cause.\n ChartYAxisLabelBaselineCompensation: 8,\n} as const;\n\n/**\n * Converts an Odyssey design token length to a pixel number, because the\n * charting library takes numbers and not CSS length strings. The function\n * multiplies a `rem` token by the base font size. The function uses a `px`\n * token without a change, because a `px` value is already absolute. Therefore\n * the function does not scale a value such as `BorderRadiusTight` as a `rem`\n * value.\n */\nexport const getTokenValueAsPixels = ({\n tokenValue,\n typographySizeBase,\n}: {\n tokenValue: string;\n typographySizeBase: string;\n}) =>\n tokenValue.trimEnd().endsWith(\"rem\")\n ? parseFloat(tokenValue) *\n ((parseFloat(typographySizeBase) / 100) * CSS_ROOT_FONT_SIZE_PIXELS)\n : parseFloat(tokenValue);\n\n/**\n * Returns the chart values that come from the Odyssey design tokens in\n * context. The values include the series color palette, the style objects that\n * the charting library takes, and the lengths the library takes.\n *\n * A chart component calls this one hook, and does not resolve the tokens\n * itself. Therefore the same token choices apply to every chart in the family.\n *\n * The hook also returns `odysseyDesignTokens` for `ChartPopoverContent`. A\n * chart serializes that content to HTML, and does not mount it. Therefore the\n * content cannot read the context itself.\n *\n * The whole object comes from one `useMemo`. A chart passes these values to the\n * React children of the chart library, and that library rebuilds and redraws the\n * whole chart when the identity of a child changes. A new style object on each\n * render therefore costs a redraw. One memo over the whole object keeps every\n * value stable while the tokens stay the same.\n */\nexport const useChartTokens = () => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return useMemo(() => {\n const toPixels = (tokenValue: string) =>\n getTokenValueAsPixels({\n tokenValue,\n typographySizeBase: odysseyDesignTokens.TypographySizeBase,\n });\n\n // Highcharts reads a line height with `parseInt`, so it turns a unitless\n // ratio such as `1.5` into 1 pixel and draws the wrapped lines of a label\n // on top of each other.\n const lineHeight = `${\n toPixels(odysseyDesignTokens.TypographySizeBody) *\n odysseyDesignTokens.TypographyLineHeightBody\n }px`;\n\n // The axis values, the axis labels and the legend items share this\n // one style. The design specifies the same text treatment for all three,\n // so an axis label carries no more weight than an axis value.\n const axisValueStyle = {\n color: odysseyDesignTokens.TypographyColorSubordinate,\n fontFamily: odysseyDesignTokens.TypographyFamilyBody,\n fontSize: odysseyDesignTokens.TypographySizeBody,\n fontWeight: odysseyDesignTokens.TypographyWeightBody,\n lineHeight,\n };\n\n const seriesColors = [\n odysseyDesignTokens.HueBlue600,\n odysseyDesignTokens.HueAccentThree400,\n odysseyDesignTokens.HueAccentTwo400,\n odysseyDesignTokens.HueAccentOne600,\n odysseyDesignTokens.HueYellow400,\n odysseyDesignTokens.HueGreen600,\n ];\n\n return {\n animationDuration: chartTokens.ChartAnimationDuration,\n barRadius: chartTokens.ChartBarRadius,\n // Highcharts also uses this as the limit for the marker in the legend: it\n // draws that marker at a radius of half this height, or at\n // `lineMarkerRadius`, whichever is less. Both come from\n // ChartLineMarkerSize, so the legend cannot cut the marker down.\n legendLineSymbolHeight: chartTokens.ChartLineMarkerSize,\n legendLineSymbolWidth: chartTokens.ChartLegendLineSymbolWidth,\n lineHoverStrokeWidthPlus: chartTokens.ChartLineHoverStrokeWidthPlus,\n lineMarkerHoverHaloOpacity: chartTokens.ChartLineMarkerHoverHaloOpacity,\n lineMarkerHoverHaloRadius: chartTokens.ChartLineMarkerHoverHaloSize / 2,\n lineMarkerHoverRadius: chartTokens.ChartLineMarkerHoverSize / 2,\n lineMarkerRadius: chartTokens.ChartLineMarkerSize / 2,\n lineStrokeWidth: chartTokens.ChartLineStrokeWidth,\n minHeight: `${chartTokens.ChartMinHeight}px`,\n odysseyDesignTokens,\n\n bodyFontFamily: odysseyDesignTokens.TypographyFamilyBody,\n borderColor: odysseyDesignTokens.BorderColorDisplay,\n borderWidth: toPixels(odysseyDesignTokens.BorderWidthMain),\n chartBackgroundColor: \"transparent\",\n crosshairColor: odysseyDesignTokens.BorderColorDisplay,\n crosshairWidth: toPixels(odysseyDesignTokens.BorderWidthMain),\n // Without some outer spacing, Highcharts clips the left edge of the\n // widest Y axis value.\n edgeSpacing: toPixels(odysseyDesignTokens.Spacing2),\n focusRingColor: odysseyDesignTokens.BorderColorPrimaryControl,\n focusRingOffset: toPixels(odysseyDesignTokens.FocusOutlineOffsetMain),\n // Highcharts types the focus border style as a `CSSObject`, so this one\n // radius carries its unit while every other length here is a number.\n focusRingRadius: `${toPixels(odysseyDesignTokens.BorderRadiusTight)}px`,\n focusRingWidth: toPixels(odysseyDesignTokens.FocusOutlineWidthMain),\n legendItemSpacing: toPixels(odysseyDesignTokens.Spacing4),\n legendSpacing: toPixels(odysseyDesignTokens.Spacing4),\n legendSymbolSpacing: toPixels(odysseyDesignTokens.Spacing2),\n popoverBackgroundColor: odysseyDesignTokens.HueNeutralWhite,\n popoverRadius: toPixels(odysseyDesignTokens.BorderRadiusMain),\n popoverSpacing: toPixels(odysseyDesignTokens.Spacing4),\n topEdgeSpacing: toPixels(odysseyDesignTokens.Spacing3),\n xAxisLabelSpacing: toPixels(odysseyDesignTokens.Spacing2),\n // Highcharts renders the gap beside a rotated Y axis label about 3px\n // smaller than requested. Add that difference back so both axis labels\n // appear Spacing2 away from their values.\n yAxisLabelSpacing:\n toPixels(odysseyDesignTokens.Spacing2) +\n chartTokens.ChartYAxisLabelBaselineCompensation,\n\n /**\n * The palette that a chart gives to the charting library as its series\n * colors. The library assigns these colors to the series in order. A\n * caller cannot set the color of a series.\n */\n seriesColors,\n\n axisLabelStyle: axisValueStyle,\n axisValueStyle,\n\n // Highcharts merges this over `legendItemStyle` for a legend item\n // whose series is hidden (toggled off). The spec's \"Selected\" state is\n // this same toggled-off item, styled with Color/Disabled.\n legendItemHiddenStyle: {\n color: odysseyDesignTokens.TypographyColorDisabled,\n },\n legendItemHoverStyle: {\n color: odysseyDesignTokens.TypographyColorBody,\n },\n // The legend spec gives its label text a different default color\n // (Color/Body) than the axis values and labels (subordinate\n // gray), so the legend does not share `axisValueStyle`.\n legendItemStyle: {\n color: odysseyDesignTokens.TypographyColorSubordinate,\n fontFamily: odysseyDesignTokens.TypographyFamilyBody,\n fontSize: odysseyDesignTokens.TypographySizeBody,\n fontWeight: odysseyDesignTokens.TypographyWeightBody,\n lineHeight,\n },\n\n popoverStyle: {\n // Odyssey has no token named \"Depth/Menu\". DepthMedium is the\n // closest match to the hover spec's \"3-layer soft drop shadow\": it\n // has three shadow layers, and its opacities are lighter than\n // DepthHigh's. The popover's own `shadow` prop stays `false` because\n // Highcharts' built-in shadow is a single-layer SVG filter and\n // cannot reproduce a 3-layer shadow; this CSS box-shadow applies\n // instead through the popover's HTML container (Highcharts' `Tooltip`\n // defaults to `useHTML`).\n boxShadow: odysseyDesignTokens.DepthMedium,\n color: odysseyDesignTokens.TypographyColorBody,\n fontFamily: odysseyDesignTokens.TypographyFamilyBody,\n fontSize: odysseyDesignTokens.TypographySizeBody,\n fontWeight: odysseyDesignTokens.TypographyWeightBody,\n lineHeight,\n },\n };\n }, [odysseyDesignTokens]);\n};\n\n/** The chart tokens that {@link useChartTokens} returns. */\nexport type ChartTokens = ReturnType<typeof useChartTokens>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,OAAO;AAE/B,SAASC,sBAAsB,QAAQ,kCAAkC;AAEzE,MAAMC,yBAAyB,GAAG,EAAE;AAOpC,OAAO,MAAMC,WAAW,GAAG;EAEzBC,sBAAsB,EAAE,GAAG;EAE3BC,cAAc,EAAE,CAAC;EAEjBC,0BAA0B,EAAE,EAAE;EAI9BC,6BAA6B,EAAE,CAAC;EAChCC,+BAA+B,EAAE,IAAI;EACrCC,4BAA4B,EAAE,EAAE;EAChCC,wBAAwB,EAAE,EAAE;EAC5BC,mBAAmB,EAAE,CAAC;EAEtBC,oBAAoB,EAAE,CAAC;EAGvBC,cAAc,EAAE,GAAG;EAInBC,mCAAmC,EAAE;AACvC,CAAU;AAUV,OAAO,MAAMC,qBAAqB,GAAGA,CAAC;EACpCC,UAAU;EACVC;AAIF,CAAC,KACCD,UAAU,CAACE,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC,KA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AQ,CAACD,mBAAmB,CAACmD,QAAQ,CAAC;MACtDQ,cAAc,EAAE1D,QAAQ,CAACD,mBAAmB,CAAC4D,QAAQ,CAAC;MACtDC,iBAAiB,EAAE5D,QAAQ,CAACD,mBAAmB,CAACyC,QAAQ,CAAC;MAIzDqB,iBAAiB,EACf7D,QAAQ,CAACD,mBAAmB,CAACyC,QAAQ,CAAC,GACtC5D,WAAW,CAACW,mCAAmC;MAOjDsB,YAAY;MAEZiD,cAAc,EAAEzD,cAAc;MAC9BA,cAAc;MAKd0D,qBAAqB,EAAE;QACrBzD,KAAK,EAAEP,mBAAmB,CAACiE;MAC7B,CAAC;MACDC,oBAAoB,EAAE;QACpB3D,KAAK,EAAEP,mBAAmB,CAACmE;MAC7B,CAAC;MAIDC,eAAe,EAAE;QACf7D,KAAK,EAAEP,mBAAmB,CAACQ,0BAA0B;QACrDC,UAAU,EAAET,mBAAmB,CAACU,oBAAoB;QACpDC,QAAQ,EAAEX,mBAAmB,CAACI,kBAAkB;QAChDQ,UAAU,EAAEZ,mBAAmB,CAACa,oBAAoB;QACpDV;MACF,CAAC;MAEDkE,YAAY,EAAE;QASZC,SAAS,EAAEtE,mBAAmB,CAACuE,WAAW;QAC1ChE,KAAK,EAAEP,mBAAmB,CAACmE,mBAAmB;QAC9C1D,UAAU,EAAET,mBAAmB,CAACU,oBAAoB;QACpDC,QAAQ,EAAEX,mBAAmB,CAACI,kBAAkB;QAChDQ,UAAU,EAAEZ,mBAAmB,CAACa,oBAAoB;QACpDV;MACF;IACF,CAAC;EACH,CAAC,EAAE,CAACH,mBAAmB,CAAC,CAAC;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartTypes.js","names":[],"sources":["../../../src/Charts/chartTypes.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 { ChartValueFormat } from \"./formatChartValue.js\";\n\n/**\n * One line on the chart. A series has a name and one value for each category.\n *\n * The chart holds the list of categories. A series holds only the values. Put\n * the values in the same order as the categories.\n *\n * A category is always text, such as `\"Week 1\"` or `\"2026-08\"`. If your data\n * has dates or times, put that data into groups of equal length first. A chart\n * that needs a true time axis uses a different series type. See\n * `docs/decisions/2026-08-21-chart-data-model-and-axis-api.md`.\n */\nexport type ChartSeries = {\n /**\n * The values of this series, one for each category, in the same order as\n * the chart's `categories`.\n *\n * An entry of `null` means the series has no measurement for that\n * category. The chart then draws a gap at that category. It does not draw\n * a point with a value of zero.\n */\n data: Array<number | null>;\n /**\n * The name of the series. The chart shows this name in the legend and in the\n * popover. Each series in one chart must have a different name.\n */\n name: string;\n};\n\n/**\n * A data point that the chart sends to an interaction callback, such as\n * `onPointClick`. The callback receives one point at a time, so the point\n * carries the name of its own series.\n */\nexport type ChartPoint = {\n /** The category that this point belongs to. */\n category: string;\n /** The name of the series that this point belongs to. */\n seriesName: ChartSeries[\"name\"];\n /**\n * The measured value of this point. The type comes from one series value,\n * with `null` removed. The chart draws no point at a gap, so a user cannot\n * click one.\n */\n value: NonNullable<ChartSeries[\"data\"][number]>;\n};\n\n/**\n * The parts of a point that hold no position. Every chart type gives these\n * parts to a point, whatever axes that chart has.\n *\n * `custom.formattedValue` holds the text that the popover shows. The chart\n * formats a value once, when it builds the point, so the popover does not\n * format that value again on each hover.\n *\n * `events` is absent when the caller supplies no click handler. Highcharts\n * attaches a listener when it finds an `events` property, so a point with no\n * click behavior must omit the property.\n */\nexport type ChartPointDecoration = {\n custom: { formattedValue: string };\n events?: { click: () => void };\n};\n\n/**\n * The properties for a chart that plots series against a category axis and a\n * value axis.\n * The layout around a chart often supplies its own heading in surrounding HTML,\n * so a chart may need neither `title` nor `subtitle`.\n */\nexport type CartesianChartProps = {\n /**\n * A text description of the chart for assistive technology. The chart\n * library puts this description in a hidden region of its own.\n */\n ariaDescription: string;\n /**\n * The categories on the horizontal axis, in the order that the chart shows\n * them. Each series in `series` supplies one value for each category, at\n * the same index.\n */\n categories: string[];\n /**\n * If `true`, the chart shows an error state in place of its series.\n * `isLoading` takes precedence over this property.\n */\n hasError?: boolean;\n /**\n * If `true`, the chart shows a loading state in place of its series.\n * `isLoading` takes precedence over `hasError`.\n */\n isLoading?: boolean;\n /** The chart calls this function when a user clicks a point. */\n onPointClick?: (point: ChartPoint) => void;\n /**\n * The chart calls this function when a user clicks the retry button in the\n * error state. The error state shows no retry button when the caller\n * omits this property.\n *\n * Set `isLoading` to `true` in this function, then set `hasError` to\n * `false` once the data arrives. `isLoading` takes precedence over\n * `hasError`, so the loading state replaces the error state for the length\n * of the request. Leaving `isLoading` alone holds the error state, and its\n * retry button, on screen while the request is in flight.\n */\n onRetry?: () => void;\n /**\n * The format for the value in the popover of a point. If you omit this\n * property, the popover shows the value in full.\n */\n pointPopoverValueFormat?: ChartValueFormat;\n /**\n * The series that the chart plots. Each series is a set of values with a\n * name. Each value lines up by index with the chart's `categories`.\n */\n series: ChartSeries[];\n /**\n * The subtitle of the chart. The chart shows the subtitle below the title. A\n * subtitle gives more information about the title, so the chart ignores a\n * subtitle that arrives with no title.\n */\n subtitle?: string;\n /** The title of the chart. */\n title?: string;\n /** The label for the horizontal axis. */\n xAxisLabel?: string;\n /** The label for the vertical axis. */\n yAxisLabel?: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { resolveChartLocale } from "./resolveChartLocale.js";
|
|
14
|
+
const numberFormatOptionsByPreset = {
|
|
15
|
+
compact: {
|
|
16
|
+
notation: "compact"
|
|
17
|
+
},
|
|
18
|
+
decimal: {},
|
|
19
|
+
percent: {
|
|
20
|
+
style: "percent"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const formatChartValue = ({
|
|
24
|
+
format = "decimal",
|
|
25
|
+
languageCode,
|
|
26
|
+
value
|
|
27
|
+
}) => {
|
|
28
|
+
if (typeof format === "function") {
|
|
29
|
+
return format(value);
|
|
30
|
+
}
|
|
31
|
+
return new Intl.NumberFormat(resolveChartLocale(languageCode), typeof format === "string" ? numberFormatOptionsByPreset[format] : format).format(value);
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=formatChartValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatChartValue.js","names":["resolveChartLocale","numberFormatOptionsByPreset","compact","notation","decimal","percent","style","formatChartValue","format","languageCode","value","Intl","NumberFormat"],"sources":["../../../src/Charts/formatChartValue.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 { resolveChartLocale } from \"./resolveChartLocale.js\";\n\n/**\n * The `Intl.NumberFormat` options for each preset name. The preset union type\n * {@link ChartValueFormat} takes its members from the keys of this object.\n * This keeps the two lists in agreement. If a name exists in the union but\n * not here, it resolves to `undefined` options. The value then formats as a\n * plain decimal. The code gives no error.\n */\nconst numberFormatOptionsByPreset = {\n compact: { notation: \"compact\" },\n decimal: {},\n percent: { style: \"percent\" },\n} as const satisfies Record<string, Intl.NumberFormatOptions>;\n\n/**\n * The named presets accepted by {@link ChartValueFormat}.\n *\n * - `\"decimal\"` renders the value in full, for example `1,234.5`.\n * - `\"compact\"` shortens large values, for example `1.2K`.\n * - `\"percent\"` multiplies the value by 100 and adds a percent sign. For\n * example, `0.4567` renders as `46%`. Supply the value as a fraction, not\n * as a percentage that is already scaled to 100. If the value is already\n * scaled, the preset scales it twice. For example, `42` renders as\n * `4,200%`.\n */\nexport type ChartValueFormatPreset = keyof typeof numberFormatOptionsByPreset;\n\n/**\n * A chart renders a value in this currency.\n */\nexport type ChartValueCurrencyFormat = {\n /**\n * An ISO 4217 currency code such as `\"USD\"` or `\"JPY\"`.\n */\n currency: string;\n style: \"currency\";\n};\n\n/**\n * A chart value format is one of three kinds: a named preset, an explicit\n * currency, or a function. A function takes the raw number and returns a\n * string. A function gives the caller full control over the presentation.\n *\n * The presets are a closed set. They do not use the general type\n * `Intl.NumberFormatOptions`. That type allows combinations that fail when\n * the code builds them. For example, `{ style: \"currency\" }` without a\n * `currency` field passes the type check. However, it raises a `TypeError`\n * at construction. A caller that needs options outside the preset set can\n * pass a function instead.\n */\nexport type ChartValueFormat =\n | ChartValueFormatPreset\n | ChartValueCurrencyFormat\n | ((value: number) => string);\n\n/**\n * Props for {@link formatChartValue}.\n */\nexport type FormatChartValueProps = {\n /**\n * How to format the value.\n * @default \"decimal\"\n */\n format?: ChartValueFormat;\n /**\n * A language code from the Odyssey translation context, such as `\"en\"` or\n * `\"pt_BR\"`. The function converts the language code to a BCP 47 tag\n * before the value reaches `Intl`.\n */\n languageCode: string;\n /** The number to format. */\n value: number;\n};\n\n/**\n * Formats a single chart value into a locale aware string.\n *\n * When `format` is a function, the code calls it with `value`. The code\n * returns the result directly and ignores `languageCode`. A caller that\n * supplies a function controls the full presentation of the value.\n * Otherwise, the function formats the value with an `Intl.NumberFormat`\n * instance. It builds the instance from the resolved locale and the\n * requested preset or currency.\n */\nexport const formatChartValue = ({\n format = \"decimal\",\n languageCode,\n value,\n}: FormatChartValueProps): string => {\n if (typeof format === \"function\") {\n return format(value);\n }\n\n return new Intl.NumberFormat(\n resolveChartLocale(languageCode),\n typeof format === \"string\" ? numberFormatOptionsByPreset[format] : format,\n ).format(value);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,kBAAkB,QAAQ,yBAAyB;AAS5D,MAAMC,2BAA2B,GAAG;EAClCC,OAAO,EAAE;IAAEC,QAAQ,EAAE;EAAU,CAAC;EAChCC,OAAO,EAAE,CAAC,CAAC;EACXC,OAAO,EAAE;IAAEC,KAAK,EAAE;EAAU;AAC9B,CAA6D;AAwE7D,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,MAAM,GAAG,SAAS;EAClBC,YAAY;EACZC;AACqB,CAAC,KAAa;EACnC,IAAI,OAAOF,MAAM,KAAK,UAAU,EAAE;IAChC,OAAOA,MAAM,CAACE,KAAK,CAAC;EACtB;EAEA,OAAO,IAAIC,IAAI,CAACC,YAAY,CAC1BZ,kBAAkB,CAACS,YAAY,CAAC,EAChC,OAAOD,MAAM,KAAK,QAAQ,GAAGP,2BAA2B,CAACO,MAAM,CAAC,GAAGA,MACrE,CAAC,CAACA,MAAM,CAACE,KAAK,CAAC;AACjB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/export const getChartSeriesPointData = ({
|
|
12
|
+
categories,
|
|
13
|
+
chartSeries,
|
|
14
|
+
formatValue,
|
|
15
|
+
onPointClick,
|
|
16
|
+
pointPopoverValueFormat
|
|
17
|
+
}) => {
|
|
18
|
+
if (chartSeries.data.length !== categories.length) {
|
|
19
|
+
throw new Error(`Series "${chartSeries.name}" has ${chartSeries.data.length} values, but the chart has ${categories.length} categories. Series data and categories must have the same length.`);
|
|
20
|
+
}
|
|
21
|
+
return chartSeries.data.map((value, valueIndex) => {
|
|
22
|
+
if (value === null) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
custom: {
|
|
27
|
+
formattedValue: formatValue({
|
|
28
|
+
format: pointPopoverValueFormat,
|
|
29
|
+
value
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
y: value,
|
|
33
|
+
...(onPointClick ? {
|
|
34
|
+
events: {
|
|
35
|
+
click: () => onPointClick({
|
|
36
|
+
category: categories[valueIndex],
|
|
37
|
+
seriesName: chartSeries.name,
|
|
38
|
+
value
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
} : {})
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=getChartSeriesPointData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChartSeriesPointData.js","names":["getChartSeriesPointData","categories","chartSeries","formatValue","onPointClick","pointPopoverValueFormat","data","length","Error","name","map","value","valueIndex","custom","formattedValue","format","y","events","click","category","seriesName"],"sources":["../../../src/Charts/getChartSeriesPointData.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 {\n ChartPoint,\n ChartPointDecoration,\n ChartSeries,\n} from \"./chartTypes.js\";\nimport type { ChartValueFormat } from \"./formatChartValue.js\";\nimport type { ChartValueFormatter } from \"./useChartValueFormatter.js\";\n\n/**\n * One point of a series that plots against a category axis. The category axis\n * gives the position, so the point holds only its value.\n *\n * Highcharts names the value axis `y` for a line chart and also for a\n * horizontal bar chart, because a bar chart inverts the drawing and not the\n * data. So `y` means the measured value here, and not a vertical position.\n *\n * A chart that needs a position on both axes, such as a scatter chart, takes a\n * point type of its own that adds `x`. That type shares\n * `ChartPointDecoration` and does not extend this type.\n */\nexport type ChartSeriesPointDatum = ChartPointDecoration & {\n y: number;\n};\n\nexport type GetChartSeriesPointDataProps = {\n categories: string[];\n chartSeries: ChartSeries;\n formatValue: ChartValueFormatter;\n onPointClick?: (point: ChartPoint) => void;\n pointPopoverValueFormat?: ChartValueFormat;\n};\n\n/**\n * Returns one data point for each entry in `categories`, lined up by index\n * with `chartSeries.data`. A `null` entry in `chartSeries.data` returns\n * `null`. Highcharts then draws a gap, instead of a point with the value\n * zero.\n *\n * The function throws if `chartSeries.data` and `categories` have different\n * lengths. A value with no matching category has no position on the axis. If\n * the chart silently cut or padded the series to fit, the chart would look\n * correct while showing the wrong data. Throwing catches the mistake instead.\n */\nexport const getChartSeriesPointData = ({\n categories,\n chartSeries,\n formatValue,\n onPointClick,\n pointPopoverValueFormat,\n}: GetChartSeriesPointDataProps): Array<ChartSeriesPointDatum | null> => {\n if (chartSeries.data.length !== categories.length) {\n throw new Error(\n `Series \"${chartSeries.name}\" has ${chartSeries.data.length} values, but the chart has ${categories.length} categories. Series data and categories must have the same length.`,\n );\n }\n\n return chartSeries.data.map((value, valueIndex) => {\n if (value === null) {\n return null;\n }\n\n return {\n custom: {\n formattedValue: formatValue({\n format: pointPopoverValueFormat,\n value,\n }),\n },\n y: value,\n ...(onPointClick\n ? {\n events: {\n click: () =>\n onPointClick({\n category: categories[valueIndex],\n seriesName: chartSeries.name,\n value,\n }),\n },\n }\n : {}),\n };\n });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GA6CA,OAAO,MAAMA,uBAAuB,GAAGA,CAAC;EACtCC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,YAAY;EACZC;AAC4B,CAAC,KAA0C;EACvE,IAAIH,WAAW,CAACI,IAAI,CAACC,MAAM,KAAKN,UAAU,CAACM,MAAM,EAAE;IACjD,MAAM,IAAIC,KAAK,CACb,WAAWN,WAAW,CAACO,IAAI,SAASP,WAAW,CAACI,IAAI,CAACC,MAAM,8BAA8BN,UAAU,CAACM,MAAM,oEAC5G,CAAC;EACH;EAEA,OAAOL,WAAW,CAACI,IAAI,CAACI,GAAG,CAAC,CAACC,KAAK,EAAEC,UAAU,KAAK;IACjD,IAAID,KAAK,KAAK,IAAI,EAAE;MAClB,OAAO,IAAI;IACb;IAEA,OAAO;MACLE,MAAM,EAAE;QACNC,cAAc,EAAEX,WAAW,CAAC;UAC1BY,MAAM,EAAEV,uBAAuB;UAC/BM;QACF,CAAC;MACH,CAAC;MACDK,CAAC,EAAEL,KAAK;MACR,IAAIP,YAAY,GACZ;QACEa,MAAM,EAAE;UACNC,KAAK,EAAEA,CAAA,KACLd,YAAY,CAAC;YACXe,QAAQ,EAAElB,UAAU,CAACW,UAAU,CAAC;YAChCQ,UAAU,EAAElB,WAAW,CAACO,IAAI;YAC5BE;UACF,CAAC;QACL;MACF,CAAC,GACD,CAAC,CAAC;IACR,CAAC;EACH,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/export const hasDuplicateSeries = ({
|
|
12
|
+
series
|
|
13
|
+
}) => new Set(series.map(chartSeries => chartSeries.name)).size !== series.length;
|
|
14
|
+
//# sourceMappingURL=hasDuplicateSeries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasDuplicateSeries.js","names":["hasDuplicateSeries","series","Set","map","chartSeries","name","size","length"],"sources":["../../../src/Charts/hasDuplicateSeries.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 { ChartSeries } from \"./chartTypes.js\";\n\nexport type HasDuplicateSeriesProps = {\n series: ChartSeries[];\n};\n\n/**\n * Returns `true` when two or more series share one name.\n *\n * A chart uses the name of a series as its React key and as its legend label.\n * When two series share one name, React drops one of them, and the chart draws\n * fewer lines than the data holds.\n */\nexport const hasDuplicateSeries = ({ series }: HasDuplicateSeriesProps) =>\n new Set(series.map((chartSeries) => chartSeries.name)).size !== series.length;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAeA,OAAO,MAAMA,kBAAkB,GAAGA,CAAC;EAAEC;AAAgC,CAAC,KACpE,IAAIC,GAAG,CAACD,MAAM,CAACE,GAAG,CAAEC,WAAW,IAAKA,WAAW,CAACC,IAAI,CAAC,CAAC,CAACC,IAAI,KAAKL,MAAM,CAACM,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export { LineChart } from "./LineChart.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["LineChart"],"sources":["../../../src/Charts/index.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\nexport type { ChartPoint, ChartSeries } from \"./chartTypes.js\";\nexport { type ChartValueFormat } from \"./formatChartValue.js\";\nexport { LineChart, type LineChartProps } from \"./LineChart.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,SAAS,QAA6B,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const FALLBACK_LOCALE = "en-US";
|
|
14
|
+
export const resolveChartLocale = languageCode => {
|
|
15
|
+
try {
|
|
16
|
+
return Intl.getCanonicalLocales(languageCode.replaceAll("_", "-"))[0] ?? FALLBACK_LOCALE;
|
|
17
|
+
} catch {
|
|
18
|
+
return FALLBACK_LOCALE;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=resolveChartLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveChartLocale.js","names":["FALLBACK_LOCALE","resolveChartLocale","languageCode","Intl","getCanonicalLocales","replaceAll"],"sources":["../../../src/Charts/resolveChartLocale.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\nconst FALLBACK_LOCALE = \"en-US\";\n\n/**\n * The function converts a language code from the Odyssey translation\n * context to a BCP 47 locale tag. `Intl` constructors accept this tag.\n *\n * Okta's translation codes use an underscore to separate the region\n * subtag, for example `pt_BR`, `zh_CN`, and `nl_NL`. Every `Intl`\n * constructor rejects these codes with a `RangeError`. The Applitools test\n * environment reports the code `en-us@posix`. This code has no BCP 47\n * equivalent. As a result, six of the codes in `SupportedLanguages` crash\n * an unguarded `Intl` call.\n *\n * If a code has no valid equivalent, the function returns `en-US` instead\n * of raising an error. A chart with the wrong thousands separator is still\n * better than a chart that fails to render.\n */\nexport const resolveChartLocale = (languageCode: string): string => {\n try {\n return (\n Intl.getCanonicalLocales(languageCode.replaceAll(\"_\", \"-\"))[0] ??\n FALLBACK_LOCALE\n );\n } catch {\n return FALLBACK_LOCALE;\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,eAAe,GAAG,OAAO;AAiB/B,OAAO,MAAMC,kBAAkB,GAAIC,YAAoB,IAAa;EAClE,IAAI;IACF,OACEC,IAAI,CAACC,mBAAmB,CAACF,YAAY,CAACG,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAC9DL,eAAe;EAEnB,CAAC,CAAC,MAAM;IACN,OAAOA,eAAe;EACxB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useCallback } from "react";
|
|
14
|
+
import { useTranslation } from "../i18n.generated/i18n.js";
|
|
15
|
+
import { formatChartValue } from "./formatChartValue.js";
|
|
16
|
+
export const useChartValueFormatter = () => {
|
|
17
|
+
const {
|
|
18
|
+
i18n
|
|
19
|
+
} = useTranslation();
|
|
20
|
+
const languageCode = i18n.language;
|
|
21
|
+
return useCallback(({
|
|
22
|
+
format,
|
|
23
|
+
value
|
|
24
|
+
}) => formatChartValue({
|
|
25
|
+
format,
|
|
26
|
+
languageCode,
|
|
27
|
+
value
|
|
28
|
+
}), [languageCode]);
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=useChartValueFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartValueFormatter.js","names":["useCallback","useTranslation","formatChartValue","useChartValueFormatter","i18n","languageCode","language","format","value"],"sources":["../../../src/Charts/useChartValueFormatter.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 { useCallback } from \"react\";\n\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport {\n formatChartValue,\n type FormatChartValueProps,\n} from \"./formatChartValue.js\";\n\n/**\n * The formatter functions from {@link useChartValueFormatter} accept these\n * props. The props match {@link FormatChartValueProps}, but without\n * `languageCode`. The hook binds the `languageCode` field from context.\n */\nexport type ChartValueFormatterProps = Omit<\n FormatChartValueProps,\n \"languageCode\"\n>;\n\n/**\n * Formats a chart value with the active locale.\n */\nexport type ChartValueFormatter = (props: ChartValueFormatterProps) => string;\n\n/**\n * The hook reads the active language code from the Odyssey translation\n * context. The hook returns a version of {@link formatChartValue} that uses\n * that locale. A consumer only needs to supply `value` and an optional\n * `format`.\n *\n * The returned function stays referentially stable while the active\n * language stays the same. This makes it safe to add as a dependency of a\n * consumer's `useMemo`.\n */\nexport const useChartValueFormatter = (): ChartValueFormatter => {\n const { i18n } = useTranslation();\n const languageCode = i18n.language;\n\n return useCallback<ChartValueFormatter>(\n ({ format, value }) => formatChartValue({ format, languageCode, value }),\n [languageCode],\n );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SACEC,gBAAgB,QAEX,uBAAuB;AA2B9B,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAA2B;EAC/D,MAAM;IAAEC;EAAK,CAAC,GAAGH,cAAc,CAAC,CAAC;EACjC,MAAMI,YAAY,GAAGD,IAAI,CAACE,QAAQ;EAElC,OAAON,WAAW,CAChB,CAAC;IAAEO,MAAM;IAAEC;EAAM,CAAC,KAAKN,gBAAgB,CAAC;IAAEK,MAAM;IAAEF,YAAY;IAAEG;EAAM,CAAC,CAAC,EACxE,CAACH,YAAY,CACf,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import isEqual from "lodash.isequal";
|
|
14
|
+
import { useRef } from "react";
|
|
15
|
+
export const useStableValue = value => {
|
|
16
|
+
const stableValueRef = useRef(value);
|
|
17
|
+
if (!isEqual(stableValueRef.current, value)) {
|
|
18
|
+
stableValueRef.current = value;
|
|
19
|
+
}
|
|
20
|
+
return stableValueRef.current;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useStableValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStableValue.js","names":["isEqual","useRef","useStableValue","value","stableValueRef","current"],"sources":["../../../src/Charts/useStableValue.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 isEqual from \"lodash.isequal\";\nimport { useRef } from \"react\";\n\n/**\n * Returns the same object for as long as the contents of `value` stay the same.\n * The hook returns the new object after a content change.\n *\n * A chart needs this hook because the chart library rebuilds and redraws the\n * whole chart when the identity of its React children changes. A caller that\n * builds a `series` array inside its own render supplies a new array on each\n * render, and every memo below that point then misses. A comparison of the\n * contents costs one walk over the points, which is far less than one redraw of\n * the chart.\n *\n * The comparison treats a function by its identity, because two functions with\n * the same body can still behave differently. Therefore a caller that supplies a\n * new function on each render, such as an inline formatter, gets a new object\n * from this hook on each render.\n */\nexport const useStableValue = <ValueType>(value: ValueType): ValueType => {\n // This hook writes to the ref during the render. The write is safe here\n // because the new value comes only from `value`, so a second render with the\n // same input reaches the same result.\n const stableValueRef = useRef(value);\n\n if (!isEqual(stableValueRef.current, value)) {\n stableValueRef.current = value;\n }\n\n return stableValueRef.current;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,OAAO,MAAM,gBAAgB;AACpC,SAASC,MAAM,QAAQ,OAAO;AAkB9B,OAAO,MAAMC,cAAc,GAAeC,KAAgB,IAAgB;EAIxE,MAAMC,cAAc,GAAGH,MAAM,CAACE,KAAK,CAAC;EAEpC,IAAI,CAACH,OAAO,CAACI,cAAc,CAACC,OAAO,EAAEF,KAAK,CAAC,EAAE;IAC3CC,cAAc,CAACC,OAAO,GAAGF,KAAK;EAChC;EAEA,OAAOC,cAAc,CAACC,OAAO;AAC/B,CAAC","ignoreList":[]}
|
|
@@ -23,6 +23,6 @@ const CircularProgress = ({
|
|
|
23
23
|
variant: value ? "determinate" : "indeterminate"
|
|
24
24
|
});
|
|
25
25
|
const MemoizedCircularProgress = memo(CircularProgress);
|
|
26
|
-
MemoizedCircularProgress.displayName = "CircularProgress::pkg=odyssey&odysseyV=1.
|
|
26
|
+
MemoizedCircularProgress.displayName = "CircularProgress::pkg=odyssey&odysseyV=1.69.0";
|
|
27
27
|
export { MemoizedCircularProgress as CircularProgress };
|
|
28
28
|
//# sourceMappingURL=CircularProgress.js.map
|
|
@@ -20,6 +20,6 @@ const ConditionalWrapper = ({
|
|
|
20
20
|
children: children
|
|
21
21
|
});
|
|
22
22
|
const MemoizedConditionalWrapper = memo(ConditionalWrapper);
|
|
23
|
-
MemoizedConditionalWrapper.displayName = "ConditionalWrapper::pkg=odyssey&odysseyV=1.
|
|
23
|
+
MemoizedConditionalWrapper.displayName = "ConditionalWrapper::pkg=odyssey&odysseyV=1.69.0";
|
|
24
24
|
export { MemoizedConditionalWrapper as ConditionalWrapper };
|
|
25
25
|
//# sourceMappingURL=ConditionalWrapper.js.map
|
|
@@ -576,6 +576,6 @@ const DataTable = ({
|
|
|
576
576
|
});
|
|
577
577
|
};
|
|
578
578
|
const MemoizedDataTable = memo(DataTable);
|
|
579
|
-
MemoizedDataTable.displayName = "DataTable::pkg=odyssey&odysseyV=1.
|
|
579
|
+
MemoizedDataTable.displayName = "DataTable::pkg=odyssey&odysseyV=1.69.0";
|
|
580
580
|
export { MemoizedDataTable as DataTable };
|
|
581
581
|
//# sourceMappingURL=DataTable.js.map
|
|
@@ -100,6 +100,6 @@ const DataTableRowActions = ({
|
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
102
|
const MemoizedDataTableRowActions = memo(DataTableRowActions);
|
|
103
|
-
MemoizedDataTableRowActions.displayName = "DataTableRowActions::pkg=odyssey&odysseyV=1.
|
|
103
|
+
MemoizedDataTableRowActions.displayName = "DataTableRowActions::pkg=odyssey&odysseyV=1.69.0";
|
|
104
104
|
export { MemoizedDataTableRowActions as DataTableRowActions };
|
|
105
105
|
//# sourceMappingURL=DataTableRowActions.js.map
|
|
@@ -77,6 +77,6 @@ const DataTableSettings = ({
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
const MemoizedDataTableSettings = memo(DataTableSettings);
|
|
80
|
-
MemoizedDataTableSettings.displayName = "DataTableSettings::pkg=odyssey&odysseyV=1.
|
|
80
|
+
MemoizedDataTableSettings.displayName = "DataTableSettings::pkg=odyssey&odysseyV=1.69.0";
|
|
81
81
|
export { MemoizedDataTableSettings as DataTableSettings };
|
|
82
82
|
//# sourceMappingURL=DataTableSettings.js.map
|
|
@@ -161,6 +161,6 @@ const DateField = ({
|
|
|
161
161
|
});
|
|
162
162
|
};
|
|
163
163
|
const MemoizedDateField = memo(DateField);
|
|
164
|
-
MemoizedDateField.displayName = "DateField::pkg=odyssey&odysseyV=1.
|
|
164
|
+
MemoizedDateField.displayName = "DateField::pkg=odyssey&odysseyV=1.69.0";
|
|
165
165
|
export { MemoizedDateField as DateField };
|
|
166
166
|
//# sourceMappingURL=DateField.js.map
|
|
@@ -50,6 +50,6 @@ const DateFieldActionBar = ({
|
|
|
50
50
|
return null;
|
|
51
51
|
};
|
|
52
52
|
const MemoizedDateFieldActionBar = memo(DateFieldActionBar);
|
|
53
|
-
MemoizedDateFieldActionBar.displayName = "DateFieldActionBar::pkg=odyssey&odysseyV=1.
|
|
53
|
+
MemoizedDateFieldActionBar.displayName = "DateFieldActionBar::pkg=odyssey&odysseyV=1.69.0";
|
|
54
54
|
export { MemoizedDateFieldActionBar as DateFieldActionBar };
|
|
55
55
|
//# sourceMappingURL=DateFieldActionBar.js.map
|
|
@@ -27,6 +27,6 @@ const DateFieldLocalizationProvider = ({
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
const MemoizedDateFieldLocalizationProvider = memo(DateFieldLocalizationProvider);
|
|
30
|
-
MemoizedDateFieldLocalizationProvider.displayName = "DateFieldLocalizationProvider::pkg=odyssey&odysseyV=1.
|
|
30
|
+
MemoizedDateFieldLocalizationProvider.displayName = "DateFieldLocalizationProvider::pkg=odyssey&odysseyV=1.69.0";
|
|
31
31
|
export { MemoizedDateFieldLocalizationProvider as DateFieldLocalizationProvider };
|
|
32
32
|
//# sourceMappingURL=DateFieldLocalizationProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFieldLocalizationProvider.js","names":["LocalizationProvider","AdapterLuxon","memo","jsx","_jsx","DateFieldLocalizationProvider","children","defaultedLanguageCode","localeText","adapterLocale","dateAdapter","MemoizedDateFieldLocalizationProvider","displayName"],"sources":["../../../src/DatePickers/DateFieldLocalizationProvider.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 { LocalizationProvider } from \"@mui/x-date-pickers\";\nimport { AdapterLuxon } from \"@mui/x-date-pickers/AdapterLuxon\";\nimport { memo, PropsWithChildren } from \"react\";\n\nimport { DateFieldsTranslations } from \"./useDateFieldsTranslations.js\";\n\ntype DateFieldLocalizationProviderProps = {\n defaultedLanguageCode: string;\n localeText: DateFieldsTranslations;\n};\n\nconst DateFieldLocalizationProvider = ({\n children,\n defaultedLanguageCode,\n localeText,\n}: PropsWithChildren<DateFieldLocalizationProviderProps>) => {\n return (\n <LocalizationProvider\n adapterLocale={defaultedLanguageCode}\n dateAdapter={AdapterLuxon}\n localeText={localeText}\n >\n {children}\n </LocalizationProvider>\n );\n};\n\nconst MemoizedDateFieldLocalizationProvider = memo(\n DateFieldLocalizationProvider,\n);\nMemoizedDateFieldLocalizationProvider.displayName =\n \"DateFieldLocalizationProvider\";\n\nexport {
|
|
1
|
+
{"version":3,"file":"DateFieldLocalizationProvider.js","names":["LocalizationProvider","AdapterLuxon","memo","jsx","_jsx","DateFieldLocalizationProvider","children","defaultedLanguageCode","localeText","adapterLocale","dateAdapter","MemoizedDateFieldLocalizationProvider","displayName"],"sources":["../../../src/DatePickers/DateFieldLocalizationProvider.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 { LocalizationProvider } from \"@mui/x-date-pickers\";\nimport { AdapterLuxon } from \"@mui/x-date-pickers/AdapterLuxon\";\nimport { memo, PropsWithChildren } from \"react\";\n\nimport { DateFieldsTranslations } from \"./useDateFieldsTranslations.js\";\n\ntype DateFieldLocalizationProviderProps = {\n defaultedLanguageCode: string;\n localeText: DateFieldsTranslations;\n};\n\nconst DateFieldLocalizationProvider = ({\n children,\n defaultedLanguageCode,\n localeText,\n}: PropsWithChildren<DateFieldLocalizationProviderProps>) => {\n return (\n <LocalizationProvider\n adapterLocale={defaultedLanguageCode}\n dateAdapter={AdapterLuxon}\n localeText={localeText}\n >\n {children}\n </LocalizationProvider>\n );\n};\n\nconst MemoizedDateFieldLocalizationProvider = memo(\n DateFieldLocalizationProvider,\n);\nMemoizedDateFieldLocalizationProvider.displayName =\n \"DateFieldLocalizationProvider\";\n\nexport {\n MemoizedDateFieldLocalizationProvider as DateFieldLocalizationProvider,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,YAAY,QAAQ,kCAAkC;AAC/D,SAASC,IAAI,QAA2B,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAShD,MAAMC,6BAA6B,GAAGA,CAAC;EACrCC,QAAQ;EACRC,qBAAqB;EACrBC;AACqD,CAAC,KAAK;EAC3D,OACEJ,IAAA,CAACJ,oBAAoB;IACnBS,aAAa,EAAEF,qBAAsB;IACrCG,WAAW,EAAET,YAAa;IAC1BO,UAAU,EAAEA,UAAW;IAAAF,QAAA,EAEtBA;EAAQ,CACW,CAAC;AAE3B,CAAC;AAED,MAAMK,qCAAqC,GAAGT,IAAI,CAChDG,6BACF,CAAC;AACDM,qCAAqC,CAACC,WAAW,+DAChB;AAEjC,SACED,qCAAqC,IAAIN,6BAA6B","ignoreList":[]}
|
|
@@ -81,7 +81,6 @@ const DatePicker = ({
|
|
|
81
81
|
defaultedLanguageCode,
|
|
82
82
|
formatDateTimeToUtcIsoDateString,
|
|
83
83
|
formatDayOfWeek,
|
|
84
|
-
inputValues,
|
|
85
84
|
internalTimeZone,
|
|
86
85
|
isOpen,
|
|
87
86
|
localeText,
|
|
@@ -89,6 +88,7 @@ const DatePicker = ({
|
|
|
89
88
|
maxDate,
|
|
90
89
|
onInputChange,
|
|
91
90
|
onTimeZoneChange,
|
|
91
|
+
pickerValue,
|
|
92
92
|
popperElement,
|
|
93
93
|
setPopperElement,
|
|
94
94
|
shouldDisableDate,
|
|
@@ -192,7 +192,6 @@ const DatePicker = ({
|
|
|
192
192
|
ref: containerRef,
|
|
193
193
|
children: _jsx(MuiDatePicker, {
|
|
194
194
|
dayOfWeekFormatter: formatDayOfWeek,
|
|
195
|
-
defaultValue: inputValues?.defaultValue,
|
|
196
195
|
disabled: isDisabled,
|
|
197
196
|
fixedWeekNumber: 6,
|
|
198
197
|
inputRef: inputRef,
|
|
@@ -209,7 +208,7 @@ const DatePicker = ({
|
|
|
209
208
|
slotProps: slotProps,
|
|
210
209
|
slots: slots,
|
|
211
210
|
timezone: internalTimeZone,
|
|
212
|
-
value:
|
|
211
|
+
value: pickerValue
|
|
213
212
|
}, language)
|
|
214
213
|
})
|
|
215
214
|
}), timeZoneOptions && timeZonePickerLabel && _jsx(TimeZonePickerContainer, {
|
|
@@ -226,6 +225,6 @@ const DatePicker = ({
|
|
|
226
225
|
});
|
|
227
226
|
};
|
|
228
227
|
const MemoizedDatePicker = memo(DatePicker);
|
|
229
|
-
MemoizedDatePicker.displayName = "DatePicker::pkg=odyssey&odysseyV=1.
|
|
228
|
+
MemoizedDatePicker.displayName = "DatePicker::pkg=odyssey&odysseyV=1.69.0";
|
|
230
229
|
export { MemoizedDatePicker as DatePicker };
|
|
231
230
|
//# sourceMappingURL=DatePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","names":["styled","DatePicker","MuiDatePicker","memo","useCallback","useEffect","useMemo","useRef","Button","useTranslation","useOdysseyDesignTokens","OdysseyThemeProvider","useUniqueId","DateField","DateFieldActionBar","DateFieldLocalizationProvider","datePickerTheme","TimeZonePicker","useOdysseyDateFields","jsx","_jsx","jsxs","_jsxs","DatePickerContainer","div","marginBlockEnd","DatePickerWidthContainer","odysseyDesignTokens","width","maxWidth","TypographyLineLengthMax","TimeZonePickerContainer","shouldForwardProp","prop","marginBlockStart","Spacing3","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","id","idOverride","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","inputRef","datePickerId","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","language","containerRef","current","formatDateTimeToJsDateStringOnCalendarSelection","dateStringFromDateTime","renderDateField","endAdornment","ariaLabel","onClick","size","startIcon","CalendarIcon","variant","onChange","timezone","slots","actionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","toolbar","toolbarPlaceholder","themeOverride","children","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","MemoizedDatePicker","displayName"],"sources":["../../../src/DatePickers/DatePicker.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 styled from \"@emotion/styled\";\nimport {\n DatePickerSlotProps,\n type DatePickerSlots,\n DatePicker as MuiDatePicker,\n DatePickerProps as MuiDatePickerProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\n\nimport { Button } from \"../Buttons/Button.js\";\nimport { FieldComponentProps } from \"../FieldComponentProps.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../OdysseyThemeProvider.js\";\nimport { useUniqueId } from \"../useUniqueId.js\";\nimport { DateField, DateFieldProps } from \"./DateField.js\";\nimport { DateFieldActionBar } from \"./DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"./DateFieldLocalizationProvider.js\";\nimport { datePickerTheme } from \"./datePickerTheme.js\";\nimport { TimeZonePicker } from \"./TimeZonePicker.js\";\nimport {\n OdysseyDateFieldProps,\n useOdysseyDateFields,\n} from \"./useOdysseyDateFields.js\";\n\nconst DatePickerContainer = styled.div({\n \".MuiFormControl-root\": {\n marginBlockEnd: 0,\n },\n});\n\nconst DatePickerWidthContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n \".MuiInput-root\": {\n width: \"100%\",\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n },\n}));\n\nconst TimeZonePickerContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n marginBlockStart: odysseyDesignTokens.Spacing3,\n}));\n\ntype RenderDateFieldProps = {\n defaultValue: DateFieldProps[\"defaultValue\"];\n value: DateFieldProps[\"value\"];\n} & MuiDatePickerProps<DateTime>;\n\nexport type DatePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\n/**\n * A date input field with an optional calendar popover for selecting a single date.\n * Supports controlled and uncontrolled usage, date range constraints,\n * per-day/month/year disabling, and an optional inline time zone picker.\n */\nconst DatePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDateEnabled = () => true,\n isDisabled,\n isOptional,\n isReadOnly,\n isMonthEnabled = () => true,\n isYearEnabled = () => true,\n label,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onBlur,\n onCalendarDateChange,\n onInputChange: onInputChangeProp,\n timeZone,\n timeZonePickerLabel,\n timeZoneOptions,\n value: valueProp,\n}: DatePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const datePickerId = useUniqueId(idOverride);\n\n const {\n closeCalendar,\n commonIcons,\n defaultedLanguageCode,\n formatDateTimeToUtcIsoDateString,\n formatDayOfWeek,\n inputValues,\n internalTimeZone,\n isOpen,\n localeText,\n minDate,\n maxDate,\n onInputChange,\n onTimeZoneChange,\n popperElement,\n setPopperElement,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n toggleCalendarVisibility,\n } = useOdysseyDateFields({\n defaultValue: defaultValueProp,\n errorMessage,\n isDateEnabled,\n isMonthEnabled,\n isYearEnabled,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onInputChange: onInputChangeProp,\n timeZone,\n value: valueProp,\n });\n\n const { language } = i18n;\n const containerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setPopperElement(containerRef.current);\n }, [setPopperElement]);\n\n const formatDateTimeToJsDateStringOnCalendarSelection = useCallback<\n NonNullable<MuiDatePickerProps<DateTime>[\"onChange\"]>\n >(\n (value) => {\n if (value) {\n const dateStringFromDateTime = formatDateTimeToUtcIsoDateString(value);\n\n if (dateStringFromDateTime) {\n onCalendarDateChange?.({\n value: dateStringFromDateTime,\n timeZone: internalTimeZone,\n });\n }\n }\n },\n [formatDateTimeToUtcIsoDateString, internalTimeZone, onCalendarDateChange],\n );\n\n const renderDateField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateFieldProps) => {\n return (\n <DateField\n defaultValue={defaultValue}\n endAdornment={\n <Button\n ariaLabel={t(\"picker.labels.date.choose\")}\n label=\"\"\n onClick={toggleCalendarVisibility}\n size=\"small\"\n startIcon={<commonIcons.CalendarIcon />}\n variant=\"floating\"\n />\n }\n errorMessage={errorMessage}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={datePickerId}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n maxDate={maxDate}\n minDate={minDate}\n onBlur={onBlur}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\n datePickerId,\n errorMessage,\n hint,\n HintLinkComponent,\n internalTimeZone,\n isDisabled,\n isOptional,\n isReadOnly,\n label,\n onBlur,\n onInputChange,\n minDate,\n maxDate,\n t,\n toggleCalendarVisibility,\n ],\n );\n\n const slots = useMemo<DatePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateFieldProps) => renderDateField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateField],\n );\n\n const slotProps = useMemo<DatePickerSlotProps<DateTime, false>>(\n () => ({\n actionBar: ({ wrapperVariant, onAccept, onCancel }) => ({\n actions:\n // This is the default behavior but felt more clear to pass them in explicitly\n wrapperVariant === \"desktop\" ? [] : [\"accept\", \"cancel\"],\n onAccept,\n onCancel,\n }),\n popper: {\n anchorEl: popperElement,\n },\n\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={datePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDatePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n maxDate={maxDate}\n minDate={minDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slotProps={slotProps}\n slots={slots}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n isReadOnly={isReadOnly}\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDatePicker = memo(DatePicker);\nMemoizedDatePicker.displayName = \"DatePicker\";\n\nexport { MemoizedDatePicker as DatePicker };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAGEC,UAAU,IAAIC,aAAa,QAEtB,qBAAqB;AAE5B,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAErE,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAEEC,sBAAsB,QACjB,kCAAkC;AACzC,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,SAAS,QAAwB,gBAAgB;AAC1D,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAEEC,oBAAoB,QACf,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,MAAMC,mBAAmB,GAAGvB,MAAM,CAACwB,GAAG,CAAC;EACrC,sBAAsB,EAAE;IACtBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,MAAMC,wBAAwB,GAAG1B,MAAM,CAACwB,GAAG,CAExC,CAAC;EAAEG;AAAoB,CAAC,MAAM;EAC/B,gBAAgB,EAAE;IAChBC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAEF,mBAAmB,CAACG;EAChC;AACF,CAAC,CAAC,CAAC;AA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CAAC,EACrBvB,eAAe,IAAID,mBAAmB,IACrCvC,IAAA,CAACW,uBAAuB;QAACJ,mBAAmB,EAAEA,mBAAoB;QAAA2F,QAAA,EAChElG,IAAA,CAACH,cAAc;UACb6B,UAAU,EAAEA,UAAW;UACvBG,KAAK,EAAEU,mBAAoB;UAC3BiB,gBAAgB,EAAEA,gBAAiB;UACnChB,eAAe,EAAEA,eAAgB;UACjCC,KAAK,EAAEY;QAAiB,CACzB;MAAC,CACqB,CAC1B;IAAA,CAC4B;EAAC,CACZ,CAAC;AAE3B,CAAC;AAED,MAAMqD,kBAAkB,GAAG3H,IAAI,CAACF,UAAU,CAAC;AAC3C6H,kBAAkB,CAACC,WAAW,4CAAe;AAE7C,SAASD,kBAAkB,IAAI7H,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DatePicker.js","names":["styled","DatePicker","MuiDatePicker","memo","useCallback","useEffect","useMemo","useRef","Button","useTranslation","useOdysseyDesignTokens","OdysseyThemeProvider","useUniqueId","DateField","DateFieldActionBar","DateFieldLocalizationProvider","datePickerTheme","TimeZonePicker","useOdysseyDateFields","jsx","_jsx","jsxs","_jsxs","DatePickerContainer","div","marginBlockEnd","DatePickerWidthContainer","odysseyDesignTokens","width","maxWidth","TypographyLineLengthMax","TimeZonePickerContainer","shouldForwardProp","prop","marginBlockStart","Spacing3","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","id","idOverride","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","inputRef","datePickerId","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","internalTimeZone","isOpen","localeText","onTimeZoneChange","pickerValue","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","language","containerRef","current","formatDateTimeToJsDateStringOnCalendarSelection","dateStringFromDateTime","renderDateField","endAdornment","ariaLabel","onClick","size","startIcon","CalendarIcon","variant","onChange","timezone","slots","actionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","toolbar","toolbarPlaceholder","themeOverride","children","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","MemoizedDatePicker","displayName"],"sources":["../../../src/DatePickers/DatePicker.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 styled from \"@emotion/styled\";\nimport {\n DatePickerSlotProps,\n type DatePickerSlots,\n DatePicker as MuiDatePicker,\n DatePickerProps as MuiDatePickerProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\n\nimport { Button } from \"../Buttons/Button.js\";\nimport { FieldComponentProps } from \"../FieldComponentProps.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../OdysseyThemeProvider.js\";\nimport { useUniqueId } from \"../useUniqueId.js\";\nimport { DateField, DateFieldProps } from \"./DateField.js\";\nimport { DateFieldActionBar } from \"./DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"./DateFieldLocalizationProvider.js\";\nimport { datePickerTheme } from \"./datePickerTheme.js\";\nimport { TimeZonePicker } from \"./TimeZonePicker.js\";\nimport {\n OdysseyDateFieldProps,\n useOdysseyDateFields,\n} from \"./useOdysseyDateFields.js\";\n\nconst DatePickerContainer = styled.div({\n \".MuiFormControl-root\": {\n marginBlockEnd: 0,\n },\n});\n\nconst DatePickerWidthContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n \".MuiInput-root\": {\n width: \"100%\",\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n },\n}));\n\nconst TimeZonePickerContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n marginBlockStart: odysseyDesignTokens.Spacing3,\n}));\n\ntype RenderDateFieldProps = {\n defaultValue: DateFieldProps[\"defaultValue\"];\n value: DateFieldProps[\"value\"];\n} & MuiDatePickerProps<DateTime>;\n\nexport type DatePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\n/**\n * A date input field with an optional calendar popover for selecting a single date.\n * Supports controlled and uncontrolled usage, date range constraints,\n * per-day/month/year disabling, and an optional inline time zone picker.\n */\nconst DatePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDateEnabled = () => true,\n isDisabled,\n isOptional,\n isReadOnly,\n isMonthEnabled = () => true,\n isYearEnabled = () => true,\n label,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onBlur,\n onCalendarDateChange,\n onInputChange: onInputChangeProp,\n timeZone,\n timeZonePickerLabel,\n timeZoneOptions,\n value: valueProp,\n}: DatePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const datePickerId = useUniqueId(idOverride);\n\n const {\n closeCalendar,\n commonIcons,\n defaultedLanguageCode,\n formatDateTimeToUtcIsoDateString,\n formatDayOfWeek,\n internalTimeZone,\n isOpen,\n localeText,\n minDate,\n maxDate,\n onInputChange,\n onTimeZoneChange,\n pickerValue,\n popperElement,\n setPopperElement,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n toggleCalendarVisibility,\n } = useOdysseyDateFields({\n defaultValue: defaultValueProp,\n errorMessage,\n isDateEnabled,\n isMonthEnabled,\n isYearEnabled,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onInputChange: onInputChangeProp,\n timeZone,\n value: valueProp,\n });\n\n const { language } = i18n;\n const containerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setPopperElement(containerRef.current);\n }, [setPopperElement]);\n\n const formatDateTimeToJsDateStringOnCalendarSelection = useCallback<\n NonNullable<MuiDatePickerProps<DateTime>[\"onChange\"]>\n >(\n (value) => {\n if (value) {\n const dateStringFromDateTime = formatDateTimeToUtcIsoDateString(value);\n\n if (dateStringFromDateTime) {\n onCalendarDateChange?.({\n value: dateStringFromDateTime,\n timeZone: internalTimeZone,\n });\n }\n }\n },\n [formatDateTimeToUtcIsoDateString, internalTimeZone, onCalendarDateChange],\n );\n\n const renderDateField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateFieldProps) => {\n return (\n <DateField\n defaultValue={defaultValue}\n endAdornment={\n <Button\n ariaLabel={t(\"picker.labels.date.choose\")}\n label=\"\"\n onClick={toggleCalendarVisibility}\n size=\"small\"\n startIcon={<commonIcons.CalendarIcon />}\n variant=\"floating\"\n />\n }\n errorMessage={errorMessage}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={datePickerId}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n maxDate={maxDate}\n minDate={minDate}\n onBlur={onBlur}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\n datePickerId,\n errorMessage,\n hint,\n HintLinkComponent,\n internalTimeZone,\n isDisabled,\n isOptional,\n isReadOnly,\n label,\n onBlur,\n onInputChange,\n minDate,\n maxDate,\n t,\n toggleCalendarVisibility,\n ],\n );\n\n const slots = useMemo<DatePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateFieldProps) => renderDateField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateField],\n );\n\n const slotProps = useMemo<DatePickerSlotProps<DateTime, false>>(\n () => ({\n actionBar: ({ wrapperVariant, onAccept, onCancel }) => ({\n actions:\n // This is the default behavior but felt more clear to pass them in explicitly\n wrapperVariant === \"desktop\" ? [] : [\"accept\", \"cancel\"],\n onAccept,\n onCancel,\n }),\n popper: {\n anchorEl: popperElement,\n },\n\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={datePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDatePicker\n dayOfWeekFormatter={formatDayOfWeek}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n maxDate={maxDate}\n minDate={minDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slotProps={slotProps}\n slots={slots}\n timezone={internalTimeZone}\n value={pickerValue}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n isReadOnly={isReadOnly}\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDatePicker = memo(DatePicker);\nMemoizedDatePicker.displayName = \"DatePicker\";\n\nexport { MemoizedDatePicker as DatePicker };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAGEC,UAAU,IAAIC,aAAa,QAEtB,qBAAqB;AAE5B,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAErE,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAEEC,sBAAsB,QACjB,kCAAkC;AACzC,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,SAAS,QAAwB,gBAAgB;AAC1D,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAEEC,oBAAoB,QACf,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,MAAMC,mBAAmB,GAAGvB,MAAM,CAACwB,GAAG,CAAC;EACrC,sBAAsB,EAAE;IACtBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,MAAMC,wBAAwB,GAAG1B,MAAM,CAACwB,GAAG,CAExC,CAA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AQ,EAAEzB,gBAAiB;YAC3BX,KAAK,EAAEe;UAAY,GAddO,QAeN;QAAC,CACsB;MAAC,CACR,CAAC,EACrBvB,eAAe,IAAID,mBAAmB,IACrCvC,IAAA,CAACW,uBAAuB;QAACJ,mBAAmB,EAAEA,mBAAoB;QAAA2F,QAAA,EAChElG,IAAA,CAACH,cAAc;UACb6B,UAAU,EAAEA,UAAW;UACvBG,KAAK,EAAEU,mBAAoB;UAC3BgB,gBAAgB,EAAEA,gBAAiB;UACnCf,eAAe,EAAEA,eAAgB;UACjCC,KAAK,EAAEW;QAAiB,CACzB;MAAC,CACqB,CAC1B;IAAA,CAC4B;EAAC,CACZ,CAAC;AAE3B,CAAC;AAED,MAAMsD,kBAAkB,GAAG3H,IAAI,CAACF,UAAU,CAAC;AAC3C6H,kBAAkB,CAACC,WAAW,4CAAe;AAE7C,SAASD,kBAAkB,IAAI7H,UAAU","ignoreList":[]}
|
|
@@ -32,6 +32,6 @@ const TimeZonePicker = ({
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
const MemoizedTimeZonePicker = memo(TimeZonePicker);
|
|
35
|
-
MemoizedTimeZonePicker.displayName = "TimeZonePicker::pkg=odyssey&odysseyV=1.
|
|
35
|
+
MemoizedTimeZonePicker.displayName = "TimeZonePicker::pkg=odyssey&odysseyV=1.69.0";
|
|
36
36
|
export { MemoizedTimeZonePicker as TimeZonePicker };
|
|
37
37
|
//# sourceMappingURL=TimeZonePicker.js.map
|