@okta/odyssey-react-mui 1.33.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/cjs/Buttons/BaseButton.cjs +1 -1
  2. package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
  3. package/dist/cjs/Dialog.cjs +9 -1
  4. package/dist/cjs/Dialog.cjs.map +1 -1
  5. package/dist/cjs/Select.cjs +3 -1
  6. package/dist/cjs/Select.cjs.map +1 -1
  7. package/dist/cjs/Typography.cjs +8 -4
  8. package/dist/cjs/Typography.cjs.map +1 -1
  9. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
  10. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
  11. package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +269 -0
  12. package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs.map +1 -0
  13. package/dist/cjs/labs/OdysseyPickers/index.cjs +9 -1
  14. package/dist/cjs/labs/OdysseyPickers/index.cjs.map +1 -1
  15. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +19 -6
  16. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  17. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +2 -2
  18. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  19. package/dist/cjs/ui-shell/SideNav/SideNavLogo.cjs +3 -3
  20. package/dist/cjs/ui-shell/SideNav/SideNavLogo.cjs.map +1 -1
  21. package/dist/cjs/ui-shell/UiShell.cjs +6 -0
  22. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  23. package/dist/cjs/ui-shell/UiShellProvider.cjs +11 -8
  24. package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
  25. package/dist/cjs/ui-shell/WideUiShellContent.cjs +2 -2
  26. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  27. package/dist/cjs/ui-shell/renderUiShell.cjs +13 -0
  28. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  29. package/dist/cjs/ui-shell/uiShellSharedConstants.cjs +2 -1
  30. package/dist/cjs/ui-shell/uiShellSharedConstants.cjs.map +1 -1
  31. package/dist/esm/Buttons/BaseButton.js +1 -1
  32. package/dist/esm/Buttons/BaseButton.js.map +1 -1
  33. package/dist/esm/Dialog.js +9 -1
  34. package/dist/esm/Dialog.js.map +1 -1
  35. package/dist/esm/Select.js +3 -1
  36. package/dist/esm/Select.js.map +1 -1
  37. package/dist/esm/Typography.js +8 -4
  38. package/dist/esm/Typography.js.map +1 -1
  39. package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
  40. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
  41. package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +263 -0
  42. package/dist/esm/labs/OdysseyPickers/SearchDropdown.js.map +1 -0
  43. package/dist/esm/labs/OdysseyPickers/index.js +1 -0
  44. package/dist/esm/labs/OdysseyPickers/index.js.map +1 -1
  45. package/dist/esm/ui-shell/NarrowUiShellContent.js +20 -7
  46. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  47. package/dist/esm/ui-shell/SideNav/SideNav.js +2 -2
  48. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  49. package/dist/esm/ui-shell/SideNav/SideNavLogo.js +3 -3
  50. package/dist/esm/ui-shell/SideNav/SideNavLogo.js.map +1 -1
  51. package/dist/esm/ui-shell/UiShell.js +6 -0
  52. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  53. package/dist/esm/ui-shell/UiShellProvider.js +9 -7
  54. package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
  55. package/dist/esm/ui-shell/WideUiShellContent.js +1 -1
  56. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  57. package/dist/esm/ui-shell/renderUiShell.js +13 -0
  58. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  59. package/dist/esm/ui-shell/uiShellSharedConstants.js +1 -0
  60. package/dist/esm/ui-shell/uiShellSharedConstants.js.map +1 -1
  61. package/dist/index.cjs +1 -1
  62. package/dist/index.mjs +1 -1
  63. package/dist/index.scss +1 -1
  64. package/dist/tsconfig.production.tsbuildinfo +1 -1
  65. package/dist/types/Buttons/BaseButton.d.ts +1 -1
  66. package/dist/types/Dialog.d.ts.map +1 -1
  67. package/dist/types/Select.d.ts +1 -0
  68. package/dist/types/Select.d.ts.map +1 -1
  69. package/dist/types/Typography.d.ts +6 -2
  70. package/dist/types/Typography.d.ts.map +1 -1
  71. package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
  72. package/dist/types/labs/OdysseyPickers/SearchDropdown.d.ts +33 -0
  73. package/dist/types/labs/OdysseyPickers/SearchDropdown.d.ts.map +1 -0
  74. package/dist/types/labs/OdysseyPickers/index.d.ts +2 -0
  75. package/dist/types/labs/OdysseyPickers/index.d.ts.map +1 -1
  76. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  77. package/dist/types/ui-shell/SideNav/SideNavLogo.d.ts +1 -1
  78. package/dist/types/ui-shell/SideNav/SideNavLogo.d.ts.map +1 -1
  79. package/dist/types/ui-shell/UiShell.d.ts +5 -20
  80. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  81. package/dist/types/ui-shell/UiShellProvider.d.ts +33 -6
  82. package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
  83. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  84. package/dist/types/ui-shell/renderUiShell.d.ts +2 -0
  85. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  86. package/dist/types/ui-shell/uiShellSharedConstants.d.ts +1 -0
  87. package/dist/types/ui-shell/uiShellSharedConstants.d.ts.map +1 -1
  88. package/package.json +6 -6
@@ -34,13 +34,13 @@ const BaseButton = ({
34
34
  ariaLabel,
35
35
  ariaLabelledBy,
36
36
  buttonRef,
37
+ children,
37
38
  endIcon,
38
39
  href,
39
40
  id,
40
41
  isDisabled,
41
42
  isFullWidth: isFullWidthProp,
42
43
  label = "",
43
- children,
44
44
  onClick,
45
45
  size = "medium",
46
46
  startIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"BaseButton.cjs","names":["_react","require","_ButtonContext","_MuiPropsContext","_Tooltip","_jsxRuntime","_interopRequireDefault","e","__esModule","default","buttonSizeValues","exports","buttonTypeValues","buttonVariantValues","BaseButton","ariaControls","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaLabel","ariaLabelledBy","buttonRef","endIcon","href","id","isDisabled","isFullWidth","isFullWidthProp","label","children","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","useMuiProps","localButtonRef","useRef","buttonContext","useButton","useMemo","useImperativeHandle","focus","current","renderButton","useCallback","jsx","_Button2","disabled","fullWidth","ref","element","Tooltip","ariaType","placement","text","MuiPropsContext","Consumer","MemoizedBaseButton","memo","displayName"],"sources":["../../../src/Buttons/BaseButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport {\n HTMLAttributes,\n memo,\n ReactElement,\n ReactNode,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { useButton } from \"./ButtonContext.js\";\nimport type { HtmlProps } from \"../HtmlProps.js\";\nimport { FocusHandle } from \"../inputUtils.js\";\nimport {\n MuiPropsContext,\n MuiPropsContextType,\n useMuiProps,\n} from \"../MuiPropsContext.js\";\nimport { Tooltip } from \"../Tooltip.js\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"danger\",\n \"dangerSecondary\",\n \"floating\",\n \"floatingAction\",\n] as const;\n\nexport type BaseButtonProps = {\n /**\n * The ref forwarded to the Button\n */\n buttonRef?: React.RefObject<FocusHandle>;\n /**\n * Optional href to render the button as a link\n */\n href?: string;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number] | \"tertiary\";\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The contents of the button. Only available internal to Odyssey here in BaseButton. If set, label is ignored.\n */\n children?: ReactNode;\n /**\n * The icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n};\n\n// These are split and exported separately from the above because wrappers of this (e.g. Button) will\n// want to omit children, which they cannot do from the combined union type. Instead, they should\n// omit from BaseButtonProps, then union with the AdditionalBaseButtonProps (as seen in Button)\nexport type AdditionalBaseButtonProps = Pick<\n HtmlProps,\n | \"ariaControls\"\n | \"ariaDescribedBy\"\n | \"ariaExpanded\"\n | \"ariaHasPopup\"\n | \"ariaLabel\"\n | \"ariaLabelledBy\"\n | \"tabIndex\"\n | \"testId\"\n | \"translate\"\n>;\n\nconst BaseButton = ({\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n buttonRef,\n endIcon,\n href,\n id,\n isDisabled,\n isFullWidth: isFullWidthProp,\n label = \"\",\n children,\n onClick,\n size = \"medium\",\n startIcon,\n tabIndex,\n testId,\n tooltipText,\n translate,\n type = \"button\",\n variant: variantProp,\n}: BaseButtonProps & AdditionalBaseButtonProps) => {\n const muiProps = useMuiProps();\n\n // We're deprecating the \"tertiary\" variant, so map it to\n // \"secondary\" in lieu of making a breaking change\n const variant = variantProp === \"tertiary\" ? \"secondary\" : variantProp;\n const localButtonRef = useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n const buttonContext = useButton();\n const isFullWidth = useMemo(\n () =>\n buttonContext.isFullWidth ? buttonContext.isFullWidth : isFullWidthProp,\n [buttonContext, isFullWidthProp],\n );\n\n useImperativeHandle(\n buttonRef,\n () => ({\n focus: () => {\n localButtonRef.current?.focus();\n },\n }),\n [],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <MuiButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n href={href}\n id={id}\n onClick={onClick}\n ref={(element) => {\n if (element) {\n (\n localButtonRef as React.MutableRefObject<\n HTMLButtonElement | HTMLAnchorElement\n >\n ).current = element;\n //@ts-expect-error ref is not an optional prop on the props context type\n muiProps?.ref?.(element);\n }\n }}\n size={size}\n startIcon={startIcon}\n tabIndex={tabIndex}\n translate={translate}\n type={type}\n variant={variant}\n >\n {children ?? label}\n </MuiButton>\n );\n },\n [\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n href,\n id,\n isDisabled,\n isFullWidth,\n label,\n children,\n onClick,\n size,\n startIcon,\n tabIndex,\n testId,\n translate,\n type,\n variant,\n ],\n );\n\n if (tooltipText) {\n return (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n }\n\n return renderButton(muiProps);\n};\n\nconst MemoizedBaseButton = memo(BaseButton);\nMemoizedBaseButton.displayName = \"BaseButton\";\n\nexport { MemoizedBaseButton as BaseButton };\n"],"mappings":";;;;;;;AAcA,IAAAA,MAAA,GAAAC,OAAA;AAWA,IAAAC,cAAA,GAAAD,OAAA;AAGA,IAAAE,gBAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAAwC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjCxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AAC9D,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AAC/D,MAAMC,mBAAmB,GAAAF,OAAA,CAAAE,mBAAA,GAAG,CACjC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,gBAAgB,CACR;AA8EV,MAAMC,UAAU,GAAGA,CAAC;EAClBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,SAAS;EACTC,cAAc;EACdC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJ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js","names":["_react","require","_ButtonContext","_MuiPropsContext","_Tooltip","_jsxRuntime","_interopRequireDefault","e","__esModule","default","buttonSizeValues","exports","buttonTypeValues","buttonVariantValues","BaseButton","ariaControls","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaLabel","ariaLabelledBy","buttonRef","children","endIcon","href","id","isDisabled","isFullWidth","isFullWidthProp","label","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","useMuiProps","localButtonRef","useRef","buttonContext","useButton","useMemo","useImperativeHandle","focus","current","renderButton","useCallback","jsx","_Button2","disabled","fullWidth","ref","element","Tooltip","ariaType","placement","text","MuiPropsContext","Consumer","MemoizedBaseButton","memo","displayName"],"sources":["../../../src/Buttons/BaseButton.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport {\n HTMLAttributes,\n memo,\n ReactElement,\n ReactNode,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { useButton } from \"./ButtonContext.js\";\nimport type { HtmlProps } from \"../HtmlProps.js\";\nimport { FocusHandle } from \"../inputUtils.js\";\nimport {\n MuiPropsContext,\n MuiPropsContextType,\n useMuiProps,\n} from \"../MuiPropsContext.js\";\nimport { Tooltip } from \"../Tooltip.js\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"danger\",\n \"dangerSecondary\",\n \"floating\",\n \"floatingAction\",\n] as const;\n\nexport type BaseButtonProps = {\n /**\n * The ref forwarded to the Button\n */\n buttonRef?: React.RefObject<FocusHandle>;\n /**\n * Optional href to render the button as a link\n */\n href?: string;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number] | \"tertiary\";\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The contents of the button. Only available internal to Odyssey here in BaseButton. If set, label is ignored.\n */\n children?: ReactNode;\n /**\n * The icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n};\n\n// These are split and exported separately from the above because wrappers of this (e.g. Button) will\n// want to omit children, which they cannot do from the combined union type. Instead, they should\n// omit from BaseButtonProps, then union with the AdditionalBaseButtonProps (as seen in Button)\nexport type AdditionalBaseButtonProps = Pick<\n HtmlProps,\n | \"ariaControls\"\n | \"ariaDescribedBy\"\n | \"ariaExpanded\"\n | \"ariaHasPopup\"\n | \"ariaLabel\"\n | \"ariaLabelledBy\"\n | \"tabIndex\"\n | \"testId\"\n | \"translate\"\n>;\n\nconst BaseButton = ({\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n buttonRef,\n children,\n endIcon,\n href,\n id,\n isDisabled,\n isFullWidth: isFullWidthProp,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n tabIndex,\n testId,\n tooltipText,\n translate,\n type = \"button\",\n variant: variantProp,\n}: BaseButtonProps & AdditionalBaseButtonProps) => {\n const muiProps = useMuiProps();\n\n // We're deprecating the \"tertiary\" variant, so map it to\n // \"secondary\" in lieu of making a breaking change\n const variant = variantProp === \"tertiary\" ? \"secondary\" : variantProp;\n const localButtonRef = useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n const buttonContext = useButton();\n const isFullWidth = useMemo(\n () =>\n buttonContext.isFullWidth ? buttonContext.isFullWidth : isFullWidthProp,\n [buttonContext, isFullWidthProp],\n );\n\n useImperativeHandle(\n buttonRef,\n () => ({\n focus: () => {\n localButtonRef.current?.focus();\n },\n }),\n [],\n );\n\n const renderButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <MuiButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n href={href}\n id={id}\n onClick={onClick}\n ref={(element) => {\n if (element) {\n (\n localButtonRef as React.MutableRefObject<\n HTMLButtonElement | HTMLAnchorElement\n >\n ).current = element;\n //@ts-expect-error ref is not an optional prop on the props context type\n muiProps?.ref?.(element);\n }\n }}\n size={size}\n startIcon={startIcon}\n tabIndex={tabIndex}\n translate={translate}\n type={type}\n variant={variant}\n >\n {children ?? label}\n </MuiButton>\n );\n },\n [\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n href,\n id,\n isDisabled,\n isFullWidth,\n label,\n children,\n onClick,\n size,\n startIcon,\n tabIndex,\n testId,\n translate,\n type,\n variant,\n ],\n );\n\n if (tooltipText) {\n return (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n }\n\n return renderButton(muiProps);\n};\n\nconst MemoizedBaseButton = memo(BaseButton);\nMemoizedBaseButton.displayName = \"BaseButton\";\n\nexport { MemoizedBaseButton as BaseButton };\n"],"mappings":";;;;;;;AAcA,IAAAA,MAAA,GAAAC,OAAA;AAWA,IAAAC,cAAA,GAAAD,OAAA;AAGA,IAAAE,gBAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAAwC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjCxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyBO,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AAC9D,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AAC/D,MAAMC,mBAAmB,GAAAF,OAAA,CAAAE,mBAAA,GAAG,CACjC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,gBAAgB,CACR;AA8EV,MAAMC,UAAU,GAAGA,CAAC;EAClBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,SAAS;EACTC,cAAc;EACdC,SAAS;EACTC,QAAQ;EACRC,OAAO;EACPC,IAAI;EACJC,EAAE;EACFC,UAAU;EACVC,WAAW,EAAEC,eAAe;EAC5BC,KAAK,GAAG,EAAE;EACVC,OAAO;EACPC,IAAI,GAAG,QAAQ;EACfC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,WAAW;EACXC,SAAS;EACTC,IAAI,GAAG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ACF1B,IAAI,EAAEA,IAAK;MACXC,SAAS,EAAEA,SAAU;MACrBC,QAAQ,EAAEA,QAAS;MACnBG,SAAS,EAAEA,SAAU;MACrBC,IAAI,EAAEA,IAAK;MACXC,OAAO,EAAEA,OAAQ;MAAAhB,QAAA,EAEhBA,QAAQ,IAAIO;IAAK,CACT,CAAC;EAEhB,CAAC,EACD,CACEd,YAAY,EACZC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdG,OAAO,EACPC,IAAI,EACJC,EAAE,EACFC,UAAU,EACVC,WAAW,EACXE,KAAK,EACLP,QAAQ,EACRQ,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNE,SAAS,EACTC,IAAI,EACJC,OAAO,CAEX,CAAC;EAED,IAAIH,WAAW,EAAE;IACf,OACE,IAAA9B,WAAA,CAAA+C,GAAA,EAAChD,QAAA,CAAAsD,OAAO;MAACC,QAAQ,EAAC,aAAa;MAACC,SAAS,EAAC,KAAK;MAACC,IAAI,EAAE1B,WAAY;MAAAb,QAAA,EAChE,IAAAjB,WAAA,CAAA+C,GAAA,EAACjD,gBAAA,CAAA2D,eAAe,CAACC,QAAQ;QAAAzC,QAAA,EAAE4B;MAAY,CAA2B;IAAC,CAC5D,CAAC;EAEd;EAEA,OAAOA,YAAY,CAACV,QAAQ,CAAC;AAC/B,CAAC;AAED,MAAMwB,kBAAkB,GAAArD,OAAA,CAAAG,UAAA,GAAG,IAAAmD,WAAI,EAACnD,UAAU,CAAC;AAC3CkD,kBAAkB,CAACE,WAAW,GAAG,YAAY","ignoreList":[]}
@@ -13,6 +13,7 @@ var _reactI18next = require("react-i18next");
13
13
  var _index = require("./Buttons/index.cjs");
14
14
  var _index2 = require("./icons.generated/index.cjs");
15
15
  var _react = require("react");
16
+ var _useUniqueId = require("./useUniqueId.cjs");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
19
  /*!
@@ -46,6 +47,8 @@ const Dialog = ({
46
47
  } = (0, _reactI18next.useTranslation)();
47
48
  const [isContentScrollable, setIsContentScrollable] = (0, _react.useState)(false);
48
49
  const dialogContentRef = (0, _react.useRef)(null);
50
+ const dialogTitleId = (0, _useUniqueId.useUniqueId)();
51
+ const dialogLabelId = (0, _useUniqueId.useUniqueId)();
49
52
  (0, _react.useEffect)(() => {
50
53
  let frameId;
51
54
  const handleContentScroll = () => {
@@ -71,9 +74,14 @@ const Dialog = ({
71
74
  "data-se": testId,
72
75
  open: isOpen,
73
76
  onClose: onClose,
77
+ "aria-labelledby": dialogLabelId,
74
78
  children: [(0, _jsxRuntime.jsxs)(_DialogTitle2.default, {
79
+ id: dialogTitleId,
75
80
  translate: translate,
76
- children: [title, (0, _jsxRuntime.jsx)(_index.Button, {
81
+ children: [(0, _jsxRuntime.jsx)("span", {
82
+ id: dialogLabelId,
83
+ children: title
84
+ }), (0, _jsxRuntime.jsx)(_index.Button, {
77
85
  ariaLabel: t("close.text"),
78
86
  onClick: onClose,
79
87
  size: "small",
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","names":["_reactI18next","require","_index","_index2","_react","_jsxRuntime","_interopRequireDefault","e","__esModule","default","Dialog","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","testId","title","translate","t","useTranslation","isContentScrollable","setIsContentScrollable","useState","dialogContentRef","useRef","useEffect","frameId","handleContentScroll","dialogContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","content","jsx","_DialogContentText2","actionButtons","filter","Boolean","jsxs","_Dialog2","open","_DialogTitle2","Button","ariaLabel","onClick","size","startIcon","CloseIcon","variant","_DialogContent2","tabIndex","dividers","ref","length","_DialogActions2","map","actionButton","index","cloneElement","key","MemoizedDialog","exports","memo","displayName"],"sources":["../../src/Dialog.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useTranslation } from \"react-i18next\";\nimport {\n Dialog as MuiDialog,\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from \"@mui/material\";\nimport { Button } from \"./Buttons/index.js\";\nimport { CloseIcon } from \"./icons.generated/index.js\";\nimport {\n cloneElement,\n memo,\n useState,\n useEffect,\n useRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nexport type DialogProps = {\n /**\n * @deprecated `aria-label` for close button comes from translation file\n */\n ariaLabel?: string;\n\n /**\n * An optional Button object to be situated in the Dialog footer as the primary call to action.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `primaryCallToActionComponent` instead.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer as the secondary call to action, alongside the `primaryCallToActionComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `secondaryCallToActionComponent` instead.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer as the tertiary call to action, alongside the other `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `tertiaryCallToActionComponent` instead.\n */\n callToActionLastComponent?: ReactElement<typeof Button>;\n /**\n * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children: ReactNode;\n\n /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n\n /**\n * Callback that controls what happens when the Dialog is dismissed.\n */\n onClose: () => void;\n\n /**\n * The title of the Dialog.\n */\n title: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Dialog = ({\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n callToActionFirstComponent,\n callToActionSecondComponent,\n callToActionLastComponent,\n children,\n isOpen,\n onClose,\n testId,\n title,\n translate,\n}: DialogProps) => {\n const { t } = useTranslation();\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const dialogContentElement = dialogContentRef.current;\n if (dialogContentElement) {\n cancelAnimationFrame(frameId);\n setIsContentScrollable(\n dialogContentElement.scrollHeight > dialogContentElement.clientHeight,\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const content =\n typeof children === \"string\" ? (\n <DialogContentText>{children}</DialogContentText>\n ) : (\n children\n );\n\n // Prioritize new action button format (|| used as a fallback)\n const actionButtons = [\n tertiaryCallToActionComponent || callToActionLastComponent,\n secondaryCallToActionComponent || callToActionSecondComponent,\n primaryCallToActionComponent || callToActionFirstComponent,\n ].filter(Boolean);\n\n return (\n <MuiDialog data-se={testId} open={isOpen} onClose={onClose}>\n <DialogTitle translate={translate}>\n {title}\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onClose}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DialogTitle>\n <DialogContent\n {...(isContentScrollable && {\n // Sets tabIndex on content element if scrollable so content is easier to navigate with the keyboard\n tabIndex: 0,\n })}\n dividers={isContentScrollable}\n ref={dialogContentRef}\n >\n {content}\n </DialogContent>\n\n {actionButtons.length > 0 && (\n <DialogActions>\n {actionButtons.map((actionButton, index) =>\n actionButton ? cloneElement(actionButton, { key: index }) : null,\n )}\n </DialogActions>\n )}\n </MuiDialog>\n );\n};\n\nconst MemoizedDialog = memo(Dialog);\nMemoizedDialog.displayName = \"Dialog\";\n\nexport { MemoizedDialog as Dialog };\n"],"mappings":";;;;;;;;;;;AAYA,IAAAA,aAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAQe,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA9Bf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2EA,MAAMG,MAAM,GAAGA,CAAC;EACdC,4BAA4B;EAC5BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,0BAA0B;EAC1BC,2BAA2B;EAC3BC,yBAAyB;EACzBC,QAAQ;EACRC,MAAM;EACNC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC;AACW,CAAC,KAAK;EACjB,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAAC,CAAC;EAC9B,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EACrE,MAAMC,gBAAgB,GAAG,IAAAC,aAAM,EAAiB,IAAI,CAAC;EAErD,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,OAAe;IAEnB,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;MAChC,MAAMC,oBAAoB,GAAGL,gBAAgB,CAACM,OAAO;MACrD,IAAID,oBAAoB,EAAE;QACxBE,oBAAoB,CAACJ,OAAO,CAAC;QAC7BL,s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AC,EACd,IAAAlD,WAAA,CAAAmC,GAAA,EAAAgB,eAAA,CAAA/C,OAAA;MAAA,IACOgB,mBAAmB,IAAI;QAE1BgC,QAAQ,EAAE;MACZ,CAAC;MACDC,QAAQ,EAAEjC,mBAAoB;MAC9BkC,GAAG,EAAE/B,gBAAiB;MAAAX,QAAA,EAErBsB;IAAO,CACK,CAAC,EAEfG,aAAa,CAACkB,MAAM,GAAG,CAAC,IACvB,IAAAvD,WAAA,CAAAmC,GAAA,EAAAqB,eAAA,CAAApD,OAAA;MAAAQ,QAAA,EACGyB,aAAa,CAACoB,GAAG,CAAC,CAACC,YAAY,EAAEC,KAAK,KACrCD,YAAY,GAAG,IAAAE,mBAAY,EAACF,YAAY,EAAE;QAAEG,GAAG,EAAEF;MAAM,CAAC,CAAC,GAAG,IAC9D;IAAC,CACY,CAChB;EAAA,CACQ,CAAC;AAEhB,CAAC;AAED,MAAMG,cAAc,GAAAC,OAAA,CAAA1D,MAAA,GAAG,IAAA2D,WAAI,EAAC3D,MAAM,CAAC;AACnCyD,cAAc,CAACG,WAAW,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"Dialog.cjs","names":["_reactI18next","require","_index","_index2","_react","_useUniqueId","_jsxRuntime","_interopRequireDefault","e","__esModule","default","Dialog","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","testId","title","translate","t","useTranslation","isContentScrollable","setIsContentScrollable","useState","dialogContentRef","useRef","dialogTitleId","useUniqueId","dialogLabelId","useEffect","frameId","handleContentScroll","dialogContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","content","jsx","_DialogContentText2","actionButtons","filter","Boolean","jsxs","_Dialog2","open","_DialogTitle2","id","Button","ariaLabel","onClick","size","startIcon","CloseIcon","variant","_DialogContent2","tabIndex","dividers","ref","length","_DialogActions2","map","actionButton","index","cloneElement","key","MemoizedDialog","exports","memo","displayName"],"sources":["../../src/Dialog.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useTranslation } from \"react-i18next\";\nimport {\n Dialog as MuiDialog,\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from \"@mui/material\";\nimport { Button } from \"./Buttons/index.js\";\nimport { CloseIcon } from \"./icons.generated/index.js\";\nimport {\n cloneElement,\n memo,\n useState,\n useEffect,\n useRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport type DialogProps = {\n /**\n * @deprecated `aria-label` for close button comes from translation file\n */\n ariaLabel?: string;\n\n /**\n * An optional Button object to be situated in the Dialog footer as the primary call to action.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `primaryCallToActionComponent` instead.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer as the secondary call to action, alongside the `primaryCallToActionComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `secondaryCallToActionComponent` instead.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer as the tertiary call to action, alongside the other `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `tertiaryCallToActionComponent` instead.\n */\n callToActionLastComponent?: ReactElement<typeof Button>;\n /**\n * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children: ReactNode;\n\n /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n\n /**\n * Callback that controls what happens when the Dialog is dismissed.\n */\n onClose: () => void;\n\n /**\n * The title of the Dialog.\n */\n title: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Dialog = ({\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n callToActionFirstComponent,\n callToActionSecondComponent,\n callToActionLastComponent,\n children,\n isOpen,\n onClose,\n testId,\n title,\n translate,\n}: DialogProps) => {\n const { t } = useTranslation();\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const dialogTitleId = useUniqueId();\n const dialogLabelId = useUniqueId();\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const dialogContentElement = dialogContentRef.current;\n if (dialogContentElement) {\n cancelAnimationFrame(frameId);\n setIsContentScrollable(\n dialogContentElement.scrollHeight > dialogContentElement.clientHeight,\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const content =\n typeof children === \"string\" ? (\n <DialogContentText>{children}</DialogContentText>\n ) : (\n children\n );\n\n // Prioritize new action button format (|| used as a fallback)\n const actionButtons = [\n tertiaryCallToActionComponent || callToActionLastComponent,\n secondaryCallToActionComponent || callToActionSecondComponent,\n primaryCallToActionComponent || callToActionFirstComponent,\n ].filter(Boolean);\n\n return (\n <MuiDialog\n data-se={testId}\n open={isOpen}\n onClose={onClose}\n aria-labelledby={dialogLabelId}\n >\n <DialogTitle\n id={dialogTitleId} // We need to explicitly unset `id` for MUI to automatically set it based on the `aria-labelledby` prop passed to `MuiDialog`\n translate={translate}\n >\n <span id={dialogLabelId}>{title}</span>\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onClose}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DialogTitle>\n <DialogContent\n {...(isContentScrollable && {\n // Sets tabIndex on content element if scrollable so content is easier to navigate with the keyboard\n tabIndex: 0,\n })}\n dividers={isContentScrollable}\n ref={dialogContentRef}\n >\n {content}\n </DialogContent>\n\n {actionButtons.length > 0 && (\n <DialogActions>\n {actionButtons.map((actionButton, index) =>\n actionButton ? cloneElement(actionButton, { key: index }) : null,\n )}\n </DialogActions>\n )}\n </MuiDialog>\n );\n};\n\nconst MemoizedDialog = memo(Dialog);\nMemoizedDialog.displayName = \"Dialog\";\n\nexport { MemoizedDialog as Dialog };\n"],"mappings":";;;;;;;;;;;AAYA,IAAAA,aAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAWA,IAAAI,YAAA,GAAAJ,OAAA;AAA+C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4EA,MAAMG,MAAM,GAAGA,CAAC;EACdC,4BAA4B;EAC5BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,0BAA0B;EAC1BC,2BAA2B;EAC3BC,yBAAyB;EACzBC,QAAQ;EACRC,MAAM;EACNC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC;AACW,CAAC,KAAK;EACjB,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAAC,CAAC;EAC9B,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAA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 const Select = ({
202
202
  return {
203
203
  text: option.text,
204
204
  value,
205
- type: option.type === "heading" ? "heading" : "option"
205
+ type: option.type === "heading" ? "heading" : "option",
206
+ lang: option.language
206
207
  };
207
208
  }
208
209
  return {
@@ -263,6 +264,7 @@ const Select = ({
263
264
  "data-empty": !option.text,
264
265
  value: option.value,
265
266
  selected: isSelected,
267
+ lang: option.lang,
266
268
  children: [hasMultipleChoices && (0, _jsxRuntime.jsx)(_Checkbox2.default, {
267
269
  checked: isSelected
268
270
  }), option.text, !hasMultipleChoices && internalSelectedValues === option.value && (0, _jsxRuntime.jsx)(_ListItemSecondaryAction2.default, {
@@ -1 +1 @@
1
- {"version":3,"file":"Select.cjs","names":["_react","require","_styled","_interopRequireDefault","_Field","_index","_inputUtils","_OdysseyDesignTokensContext","_useNormalizedKey","_jsxRuntime","e","__esModule","default","SelectTestSelector","exports","accessibleText","errorMessage","hint","label","children","list","listItem","elementSelector","method","options","role","isControlledElement","SelectContainer","styled","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing0","Spacing5","Spacing1","BorderWidthMain","NonInteractiveIcon","CloseCircleFilledIcon","Spacing2","ChipsInnerContainer","_Box2","isInteractive","isReadOnly","Spacing6","CONTROLLED","ComponentControlledState","Select","ariaDescribedBy","defaultValue","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","testId","translate","value","selectRef","useRef","useMemo","undefined","controlledStateRef","getControlState","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","useState","current","localInputRef","useOdysseyDesignTokens","useImperativeHandle","focus","useEffect","inputValues","useInputValues","controlState","useCallback","event","child","preventDefault","target","split","normalizedOptions","normalizedOptionsMap","map","option","text","type","Map","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","stopPropagation","hasNonInteractiveIcon","jsx","item","length","_Chip2","jsxs","Fragment","get","tabIndex","onDelete","deleteIcon","sx","pointerEvents","onMouseDown","renderedOptions","index","_ListSubheader2","isSelected","includes","_MenuItem2","selected","_Checkbox2","checked","_ListItemSecondaryAction2","CheckIcon","normalizedKey","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select2","displayEmpty","inputProps","readOnly","el","labelId","MenuProps","maxHeight","multiple","Field","fieldType","hasVisibleLabel","MemoizedSelect","memo","displayName"],"sources":["../../src/Select.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectProps as MuiSelectProps,\n SelectChangeEvent,\n} from \"@mui/material\";\n\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated/index.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { TestSelector } from \"./test-selectors/index.js\";\nimport { normalizedKey } from \"./useNormalizedKey.js\";\n\nexport const SelectTestSelector = {\n accessibleText: {\n errorMessage: \"errorMessage\",\n hint: \"description\",\n label: \"label\",\n },\n children: {\n list: {\n accessibleText: {\n label: \"label\",\n },\n children: {\n listItem: {\n accessibleText: {\n label: \"label\",\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"option\",\n },\n },\n },\n isControlledElement: true,\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"combobox\",\n },\n} as const satisfies TestSelector;\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n align-items: center;\n position: absolute;\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n bottom: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n left: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.BorderWidthMain};\n opacity: 1;\n pointer-events: none;\n`;\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n font-size: 1em;\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing2};\n margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-block-end: -1px;\n`;\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isInteractive\" &&\n prop !== \"isReadOnly\",\n})<{\n isInteractive?: boolean;\n isReadOnly?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n pointer-events: none;\n opacity: ${({ isInteractive, isReadOnly }) =>\n isInteractive || isReadOnly ? 1 : 0};\n min-height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};\n`;\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n isReadOnly = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const selectRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" && hasMultipleChoices\n ? value.split(\",\")\n : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n }\n },\n [hasMultipleChoices, onChangeProp, isReadOnly],\n );\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {\n const normalizedOptions = options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n };\n }\n\n return { text: option, value: option, type: \"option\" };\n });\n\n const normalizedOptionsMap = new Map(\n normalizedOptions.map((option) => [option.value, option]),\n );\n return [normalizedOptions, normalizedOptionsMap];\n }, [options]);\n\n const removeSelectedValue = useCallback(\n (selectedValue: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (internalSelectedValue) => internalSelectedValue !== selectedValue,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n },\n [internalSelectedValues, onChange],\n );\n\n const Chips = useCallback(\n ({\n isInteractive,\n isReadOnly,\n }: {\n isInteractive: boolean;\n isReadOnly?: boolean;\n }) => {\n const stopPropagation = (event: React.MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n const hasNonInteractiveIcon =\n !isInteractive &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices;\n return (\n Array.isArray(internalSelectedValues) && (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n isReadOnly={isReadOnly}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {internalSelectedValues.map(\n (item) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {normalizedOptionsMap.get(item)?.text}\n {hasNonInteractiveIcon && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelectedValue(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n )\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n removeSelectedValue,\n normalizedOptionsMap,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const renderedOptions = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n data-empty={!option.text}\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices && internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n\n const renderValue = useCallback(\n (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n displayEmpty\n id={id}\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n }}\n inputRef={(el: HTMLInputElement | HTMLTextAreaElement | null) => {\n if (localInputRef.current !== el) {\n (localInputRef as React.MutableRefObject<typeof el>).current = el;\n }\n selectRef.current = el;\n }}\n labelId={labelElementId}\n MenuProps={{\n sx: {\n \".MuiPaper-root\": {\n maxHeight: \"50vh\",\n },\n },\n }}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n >\n {renderedOptions}\n </MuiSelect>\n {hasMultipleChoices && (\n <>\n <ChipsPositioningContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Chips isInteractive={!isReadOnly} isReadOnly={isReadOnly} />\n </ChipsPositioningContainer>\n </>\n )}\n </SelectContainer>\n ),\n [\n Chips,\n inputValues,\n hasMultipleChoices,\n isDisabled,\n isReadOnly,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderedOptions,\n renderValue,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAA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AEA,mBAAoB;QAAAd,QAAA,EAEzC,IAAAV,WAAA,CAAA0G,GAAA,EAACH,KAAK;UAACrE,aAAa,EAAE,CAACC,UAAW;UAACA,UAAU,EAAEA;QAAW,CAAE;MAAC,CACpC;IAAC,CAC5B,CACH;EAAA,CACc,CAClB,EACD,CACEoE,KAAK,EACLxB,WAAW,EACXpC,kBAAkB,EAClBM,UAAU,EACVd,UAAU,EACVmB,YAAY,EACZ9B,mBAAmB,EACnB+B,MAAM,EACNC,QAAQ,EACRE,OAAO,EACP6D,eAAe,EACfa,WAAW,EACXzE,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OACE,IAAA5D,WAAA,CAAA0G,GAAA,EAAC/G,MAAA,CAAAsJ,KAAK;IACJzG,eAAe,EAAEA,eAAgB;IACjCjC,YAAY,EAAEA,YAAa;IAC3BmC,gBAAgB,EAAEA,gBAAiB;IACnCwG,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf3I,IAAI,EAAEA,IAAK;IACXqC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvB3C,KAAK,EAAEA,KAAM;IACb4H,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMe,cAAc,GAAA/I,OAAA,CAAAkC,MAAA,GAAG,IAAA8G,WAAI,EAAC9G,MAAM,CAAC;AACnC6G,cAAc,CAACE,WAAW,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"Select.cjs","names":["_react","require","_styled","_interopRequireDefault","_Field","_index","_inputUtils","_OdysseyDesignTokensContext","_useNormalizedKey","_jsxRuntime","e","__esModule","default","SelectTestSelector","exports","accessibleText","errorMessage","hint","label","children","list","listItem","elementSelector","method","options","role","isControlledElement","SelectContainer","styled","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing0","Spacing5","Spacing1","BorderWidthMain","NonInteractiveIcon","CloseCircleFilledIcon","Spacing2","ChipsInnerContainer","_Box2","isInteractive","isReadOnly","Spacing6","CONTROLLED","ComponentControlledState","Select","ariaDescribedBy","defaultValue","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","testId","translate","value","selectRef","useRef","useMemo","undefined","controlledStateRef","getControlState","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","useState","current","localInputRef","useOdysseyDesignTokens","useImperativeHandle","focus","useEffect","inputValues","useInputValues","controlState","useCallback","event","child","preventDefault","target","split","normalizedOptions","normalizedOptionsMap","map","option","text","type","lang","language","Map","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","stopPropagation","hasNonInteractiveIcon","jsx","item","length","_Chip2","jsxs","Fragment","get","tabIndex","onDelete","deleteIcon","sx","pointerEvents","onMouseDown","renderedOptions","index","_ListSubheader2","isSelected","includes","_MenuItem2","selected","_Checkbox2","checked","_ListItemSecondaryAction2","CheckIcon","normalizedKey","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select2","displayEmpty","inputProps","readOnly","el","labelId","MenuProps","maxHeight","multiple","Field","fieldType","hasVisibleLabel","MemoizedSelect","memo","displayName"],"sources":["../../src/Select.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectProps as MuiSelectProps,\n SelectChangeEvent,\n} from \"@mui/material\";\n\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated/index.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { TestSelector } from \"./test-selectors/index.js\";\nimport { normalizedKey } from \"./useNormalizedKey.js\";\n\nexport const SelectTestSelector = {\n accessibleText: {\n errorMessage: \"errorMessage\",\n hint: \"description\",\n label: \"label\",\n },\n children: {\n list: {\n accessibleText: {\n label: \"label\",\n },\n children: {\n listItem: {\n accessibleText: {\n label: \"label\",\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"option\",\n },\n },\n },\n isControlledElement: true,\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"combobox\",\n },\n} as const satisfies TestSelector;\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n language?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n align-items: center;\n position: absolute;\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n bottom: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n left: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.BorderWidthMain};\n opacity: 1;\n pointer-events: none;\n`;\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n font-size: 1em;\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing2};\n margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-block-end: -1px;\n`;\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isInteractive\" &&\n prop !== \"isReadOnly\",\n})<{\n isInteractive?: boolean;\n isReadOnly?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n pointer-events: none;\n opacity: ${({ isInteractive, isReadOnly }) =>\n isInteractive || isReadOnly ? 1 : 0};\n min-height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};\n`;\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n isReadOnly = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const selectRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" && hasMultipleChoices\n ? value.split(\",\")\n : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n }\n },\n [hasMultipleChoices, onChangeProp, isReadOnly],\n );\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {\n const normalizedOptions = options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n lang: option.language,\n };\n }\n\n return { text: option, value: option, type: \"option\" };\n });\n\n const normalizedOptionsMap = new Map(\n normalizedOptions.map((option) => [option.value, option]),\n );\n return [normalizedOptions, normalizedOptionsMap];\n }, [options]);\n\n const removeSelectedValue = useCallback(\n (selectedValue: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (internalSelectedValue) => internalSelectedValue !== selectedValue,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n },\n [internalSelectedValues, onChange],\n );\n\n const Chips = useCallback(\n ({\n isInteractive,\n isReadOnly,\n }: {\n isInteractive: boolean;\n isReadOnly?: boolean;\n }) => {\n const stopPropagation = (event: React.MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n const hasNonInteractiveIcon =\n !isInteractive &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices;\n return (\n Array.isArray(internalSelectedValues) && (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n isReadOnly={isReadOnly}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {internalSelectedValues.map(\n (item) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {normalizedOptionsMap.get(item)?.text}\n {hasNonInteractiveIcon && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelectedValue(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n )\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n removeSelectedValue,\n normalizedOptionsMap,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const renderedOptions = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n data-empty={!option.text}\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n lang={option.lang}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices && internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n\n const renderValue = useCallback(\n (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n displayEmpty\n id={id}\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n }}\n inputRef={(el: HTMLInputElement | HTMLTextAreaElement | null) => {\n if (localInputRef.current !== el) {\n (localInputRef as React.MutableRefObject<typeof el>).current = el;\n }\n selectRef.current = el;\n }}\n labelId={labelElementId}\n MenuProps={{\n sx: {\n \".MuiPaper-root\": {\n maxHeight: \"50vh\",\n },\n },\n }}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n >\n {renderedOptions}\n </MuiSelect>\n {hasMultipleChoices && (\n <>\n <ChipsPositioningContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Chips isInteractive={!isReadOnly} isReadOnly={isReadOnly} />\n </ChipsPositioningContainer>\n </>\n )}\n </SelectContainer>\n ),\n [\n Chips,\n inputValues,\n hasMultipleChoices,\n isDisabled,\n isReadOnly,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderedOptions,\n renderValue,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAaA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AAMA,IAAAM,2BAAA,GAAAN,OAAA;AAKA,IAAAO,iBAAA,GAAAP,OAAA;AAAsD,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApDtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,cAAc,EAAE;IACdC,YAAY,EAAE,cAAc;IAC5BC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJL,cAAc,EAAE;QACdG,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,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf7I,IAAI,EAAEA,IAAK;IACXqC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvB3C,KAAK,EAAEA,KAAM;IACb8H,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMe,cAAc,GAAAjJ,OAAA,CAAAkC,MAAA,GAAG,IAAAgH,WAAI,EAAChH,MAAM,CAAC;AACnC+G,cAAc,CAACE,WAAW,GAAG,QAAQ","ignoreList":[]}
@@ -45,7 +45,8 @@ const Typography = ({
45
45
  testId,
46
46
  translate,
47
47
  typographyRef,
48
- variant = "body"
48
+ variant = "body",
49
+ isPresentational
49
50
  }) => {
50
51
  const component = (0, _react.useMemo)(() => {
51
52
  if (!componentProp) {
@@ -77,7 +78,8 @@ const Typography = ({
77
78
  ref: localTypographyRef,
78
79
  tabIndex: -1,
79
80
  translate: translate,
80
- variant: typographyVariantMapping[variant]
81
+ variant: typographyVariantMapping[variant],
82
+ role: isPresentational ? "presentation" : undefined
81
83
  });
82
84
  };
83
85
  const MemoizedTypography = exports.Typography = (0, _react.memo)(Typography);
@@ -91,7 +93,8 @@ const Heading1 = ({
91
93
  color,
92
94
  component,
93
95
  testId,
94
- translate
96
+ translate,
97
+ isPresentational
95
98
  }) => (0, _jsxRuntime.jsx)(Typography, {
96
99
  ariaCurrent: ariaCurrent,
97
100
  ariaDescribedBy: ariaDescribedBy,
@@ -102,7 +105,8 @@ const Heading1 = ({
102
105
  component: component,
103
106
  testId: testId,
104
107
  translate: translate,
105
- variant: "h1"
108
+ variant: "h1",
109
+ isPresentational: isPresentational
106
110
  });
107
111
  const MemoizedHeading1 = exports.Heading1 = (0, _react.memo)(Heading1);
108
112
  MemoizedHeading1.displayName = "Heading1";
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.cjs","names":["_react","require","_jsxRuntime","_interopRequireDefault","e","__esModule","default","typographyVariantMapping","exports","h1","h2","h3","h4","h5","h6","body","legend","overline","subordinate","support","typographyColorValues","Typography","ariaCurrent","ariaDescribedBy","ariaLabel","ariaLabelledBy","children","color","component","componentProp","testId","translate","typographyRef","variant","useMemo","localTypographyRef","useRef","useImperativeHandle","focus","current","jsx","_Typography2","ref","tabIndex","MemoizedTypography","memo","displayName","Heading1","MemoizedHeading1","Heading2","MemoizedHeading2","Heading3","MemoizedHeading3","Heading4","MemoizedHeading4","Heading5","MemoizedHeading5","Heading6","MemoizedHeading6","Paragraph","MemoizedParagraph","Subordinate","MemoizedSubordinate","Support","MemoizedSupport","Legend","MemoizedLegend","Overline","MemoizedOverline"],"sources":["../../src/Typography.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 {\n ElementType,\n ReactNode,\n memo,\n useMemo,\n useRef,\n useImperativeHandle,\n} from \"react\";\nimport {\n Typography as MuiTypography,\n TypographyProps as MuiTypographyProps,\n} from \"@mui/material\";\n\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { FocusHandle } from \"./inputUtils.js\";\n\nexport type TypographyVariantValue =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"body\"\n | \"legend\"\n | \"overline\"\n | \"subordinate\"\n | \"support\";\n\nexport const typographyVariantMapping: Record<\n TypographyVariantValue,\n MuiTypographyProps[\"variant\"]\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\",\n body: \"body1\",\n legend: \"legend\",\n overline: \"overline\",\n subordinate: \"subtitle1\",\n support: \"subtitle2\",\n} as const;\n\nexport const typographyColorValues = [\n \"primary\",\n \"textPrimary\",\n \"secondary\",\n \"textSecondary\",\n \"error\",\n] as const;\n\nexport type TypographyProps = {\n /**\n * The text content of the component.\n */\n children: ReactNode;\n /**\n * The color of the text.\n */\n color?: (typeof typographyColorValues)[number];\n /**\n * The HTML element the component should render, if different from the default.\n */\n component?: ElementType;\n /**\n * The ref forwarded to the Typography\n */\n typographyRef?: React.RefObject<FocusHandle>;\n /**\n * The variant of Typography to render.\n */\n variant?: keyof typeof typographyVariantMapping;\n} & Pick<\n HtmlProps,\n | \"ariaCurrent\"\n | \"ariaDescribedBy\"\n | \"ariaLabel\"\n | \"ariaLabelledBy\"\n | \"testId\"\n | \"translate\"\n>;\n\nconst Typography = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component: componentProp,\n testId,\n translate,\n typographyRef,\n variant = \"body\",\n}: TypographyProps) => {\n const component = useMemo(() => {\n if (!componentProp) {\n if (\n variant === \"body\" ||\n variant === \"subordinate\" ||\n variant === \"support\" ||\n variant === \"overline\"\n ) {\n return \"p\";\n } else {\n return variant;\n }\n }\n return componentProp;\n }, [componentProp, variant]);\n\n const localTypographyRef = useRef<HTMLElement>(null);\n useImperativeHandle(typographyRef, () => {\n return {\n focus: () => {\n localTypographyRef.current?.focus();\n },\n };\n }, []);\n\n return (\n <MuiTypography\n aria-current={ariaCurrent}\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n ref={localTypographyRef}\n tabIndex={-1}\n translate={translate}\n variant={typographyVariantMapping[variant]}\n />\n );\n};\n\nconst MemoizedTypography = memo(Typography);\nMemoizedTypography.displayName = \"Typography\";\n\nconst Heading1 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h1\"\n />\n);\n\nconst MemoizedHeading1 = memo(Heading1);\nMemoizedHeading1.displayName = \"Heading1\";\n\nconst Heading2 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h2\"\n />\n);\n\nconst MemoizedHeading2 = memo(Heading2);\nMemoizedHeading2.displayName = \"Heading2\";\n\nconst Heading3 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h3\"\n />\n);\n\nconst MemoizedHeading3 = memo(Heading3);\nMemoizedHeading3.displayName = \"Heading3\";\n\nconst Heading4 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h4\"\n />\n);\n\nconst MemoizedHeading4 = memo(Heading4);\nMemoizedHeading4.displayName = \"Heading4\";\n\nconst Heading5 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h5\"\n />\n);\n\nconst MemoizedHeading5 = memo(Heading5);\nMemoizedHeading5.displayName = \"Heading5\";\n\nconst Heading6 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h6\"\n />\n);\n\nconst MemoizedHeading6 = memo(Heading6);\nMemoizedHeading6.displayName = \"Heading6\";\n\nconst Paragraph = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"body\"\n />\n);\n\nconst MemoizedParagraph = memo(Paragraph);\nMemoizedParagraph.displayName = \"Paragraph\";\n\nconst Subordinate = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"subordinate\"\n />\n);\n\nconst MemoizedSubordinate = memo(Subordinate);\nMemoizedSubordinate.displayName = \"Subordinate\";\n\nconst Support = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"support\"\n />\n);\n\nconst MemoizedSupport = memo(Support);\nMemoizedSupport.displayName = \"Support\";\n\nconst Legend = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"legend\"\n />\n);\n\nconst MemoizedLegend = memo(Legend);\nMemoizedLegend.displayName = \"Legend\";\n\nconst Overline = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"overline\"\n />\n);\n\nconst MemoizedOverline = memo(Overline);\nMemoizedOverline.displayName = \"Overline\";\n\nexport {\n MemoizedTypography as Typography,\n MemoizedHeading1 as Heading1,\n MemoizedHeading2 as Heading2,\n MemoizedHeading3 as Heading3,\n MemoizedHeading4 as Heading4,\n MemoizedHeading5 as Heading5,\n MemoizedHeading6 as Heading6,\n MemoizedLegend as Legend,\n MemoizedOverline as Overline,\n MemoizedParagraph as Paragraph,\n MemoizedSubordinate as Subordinate,\n MemoizedSupport as Support,\n};\n"],"mappings":";;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAOe,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAnBf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BO,MAAMG,wBAGZ,GAAAC,OAAA,CAAAD,wBAAA,GAAG;EACFE,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE,OAAO;EACbC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,WAAW,EAAE,WAAW;EACxBC,OAAO,EAAE;AACX,CAAU;AAEH,MAAMC,qBAAqB,GAAAZ,OAAA,CAAAY,qBAAA,GAAG,CACnC,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,OAAO,CACC;AAiCV,MAAMC,UAAU,GAAGA,CAAC;EAClBC,WAAW;EACXC,eAAe;EACfC,SAAS;EACTC,cAAc;EACdC,QAAQ;EACRC,KAAK;EACLC,SAAS,EAAEC,aAAa;EACxBC,MAAM;EACNC,SAAS;EACTC,aAAa;EACbC,OAAO,GAAG;AACK,CAAC,KAAK;EACrB,MAAML,SAAS,GAAG,IAAAM,cAAO,EAAC,MAAM;IAC9B,IAAI,CAACL,aAAa,EAAE;MAClB,IACEI,OAAO,KAAK,MAAM,IAClBA,OAAO,KAAK,aAAa,IACzBA,OAAO,KAAK,SAAS,IACrBA,OAAO,KAAK,UAAU,EACtB;QACA,OAAO,GAAG;MACZ,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B,QAAQ,CAAC;AACvCC,gBAAgB,CAACtB,WAAW,GAAG,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"Typography.cjs","names":["_react","require","_jsxRuntime","_interopRequireDefault","e","__esModule","default","typographyVariantMapping","exports","h1","h2","h3","h4","h5","h6","body","legend","overline","subordinate","support","typographyColorValues","Typography","ariaCurrent","ariaDescribedBy","ariaLabel","ariaLabelledBy","children","color","component","componentProp","testId","translate","typographyRef","variant","isPresentational","useMemo","localTypographyRef","useRef","useImperativeHandle","focus","current","jsx","_Typography2","ref","tabIndex","role","undefined","MemoizedTypography","memo","displayName","Heading1","MemoizedHeading1","Heading2","MemoizedHeading2","Heading3","MemoizedHeading3","Heading4","MemoizedHeading4","Heading5","MemoizedHeading5","Heading6","MemoizedHeading6","Paragraph","MemoizedParagraph","Subordinate","MemoizedSubordinate","Support","MemoizedSupport","Legend","MemoizedLegend","Overline","MemoizedOverline"],"sources":["../../src/Typography.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 {\n ElementType,\n ReactNode,\n memo,\n useMemo,\n useRef,\n useImperativeHandle,\n} from \"react\";\nimport {\n Typography as MuiTypography,\n TypographyProps as MuiTypographyProps,\n} from \"@mui/material\";\n\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { FocusHandle } from \"./inputUtils.js\";\n\nexport type TypographyVariantValue =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"body\"\n | \"legend\"\n | \"overline\"\n | \"subordinate\"\n | \"support\";\n\nexport const typographyVariantMapping: Record<\n TypographyVariantValue,\n MuiTypographyProps[\"variant\"]\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\",\n body: \"body1\",\n legend: \"legend\",\n overline: \"overline\",\n subordinate: \"subtitle1\",\n support: \"subtitle2\",\n} as const;\n\nexport const typographyColorValues = [\n \"primary\",\n \"textPrimary\",\n \"secondary\",\n \"textSecondary\",\n \"error\",\n] as const;\n\nexport type TypographyProps = {\n /**\n * The text content of the component.\n */\n children: ReactNode;\n /**\n * The color of the text.\n */\n color?: (typeof typographyColorValues)[number];\n /**\n * The HTML element the component should render, if different from the default.\n */\n component?: ElementType;\n /**\n * The ref forwarded to the Typography\n */\n typographyRef?: React.RefObject<FocusHandle>;\n /**\n * The variant of Typography to render.\n */\n variant?: keyof typeof typographyVariantMapping;\n /**\n * If true, the component is presentational and should be ignored by screen readers.\n */\n isPresentational?: boolean;\n} & Pick<\n HtmlProps,\n | \"ariaCurrent\"\n | \"ariaDescribedBy\"\n | \"ariaLabel\"\n | \"ariaLabelledBy\"\n | \"testId\"\n | \"translate\"\n>;\n\nconst Typography = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component: componentProp,\n testId,\n translate,\n typographyRef,\n variant = \"body\",\n isPresentational,\n}: TypographyProps) => {\n const component = useMemo(() => {\n if (!componentProp) {\n if (\n variant === \"body\" ||\n variant === \"subordinate\" ||\n variant === \"support\" ||\n variant === \"overline\"\n ) {\n return \"p\";\n } else {\n return variant;\n }\n }\n return componentProp;\n }, [componentProp, variant]);\n\n const localTypographyRef = useRef<HTMLElement>(null);\n useImperativeHandle(typographyRef, () => {\n return {\n focus: () => {\n localTypographyRef.current?.focus();\n },\n };\n }, []);\n\n return (\n <MuiTypography\n aria-current={ariaCurrent}\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n ref={localTypographyRef}\n tabIndex={-1}\n translate={translate}\n variant={typographyVariantMapping[variant]}\n role={isPresentational ? \"presentation\" : undefined}\n />\n );\n};\n\nconst MemoizedTypography = memo(Typography);\nMemoizedTypography.displayName = \"Typography\";\n\nconst Heading1 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n isPresentational,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h1\"\n isPresentational={isPresentational}\n />\n);\n\nconst MemoizedHeading1 = memo(Heading1);\nMemoizedHeading1.displayName = \"Heading1\";\n\nconst Heading2 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h2\"\n />\n);\n\nconst MemoizedHeading2 = memo(Heading2);\nMemoizedHeading2.displayName = \"Heading2\";\n\nconst Heading3 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h3\"\n />\n);\n\nconst MemoizedHeading3 = memo(Heading3);\nMemoizedHeading3.displayName = \"Heading3\";\n\nconst Heading4 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h4\"\n />\n);\n\nconst MemoizedHeading4 = memo(Heading4);\nMemoizedHeading4.displayName = \"Heading4\";\n\nconst Heading5 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h5\"\n />\n);\n\nconst MemoizedHeading5 = memo(Heading5);\nMemoizedHeading5.displayName = \"Heading5\";\n\nconst Heading6 = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"h6\"\n />\n);\n\nconst MemoizedHeading6 = memo(Heading6);\nMemoizedHeading6.displayName = \"Heading6\";\n\nconst Paragraph = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"body\"\n />\n);\n\nconst MemoizedParagraph = memo(Paragraph);\nMemoizedParagraph.displayName = \"Paragraph\";\n\nconst Subordinate = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"subordinate\"\n />\n);\n\nconst MemoizedSubordinate = memo(Subordinate);\nMemoizedSubordinate.displayName = \"Subordinate\";\n\nconst Support = ({\n ariaCurrent,\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaCurrent={ariaCurrent}\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"support\"\n />\n);\n\nconst MemoizedSupport = memo(Support);\nMemoizedSupport.displayName = \"Support\";\n\nconst Legend = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"legend\"\n />\n);\n\nconst MemoizedLegend = memo(Legend);\nMemoizedLegend.displayName = \"Legend\";\n\nconst Overline = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n translate,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n testId={testId}\n translate={translate}\n variant=\"overline\"\n />\n);\n\nconst MemoizedOverline = memo(Overline);\nMemoizedOverline.displayName = \"Overline\";\n\nexport {\n MemoizedTypography as Typography,\n MemoizedHeading1 as Heading1,\n MemoizedHeading2 as Heading2,\n MemoizedHeading3 as Heading3,\n MemoizedHeading4 as Heading4,\n MemoizedHeading5 as Heading5,\n MemoizedHeading6 as Heading6,\n MemoizedLegend as Legend,\n MemoizedOverline as Overline,\n MemoizedParagraph as Paragraph,\n MemoizedSubordinate as Subordinate,\n MemoizedSupport as Support,\n};\n"],"mappings":";;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAOe,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAnBf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BO,MAAMG,wBAGZ,GAAAC,OAAA,CAAAD,wBAAA,GAAG;EACFE,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE,OAAO;EACbC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,WAAW,EAAE,WAAW;EACxBC,OAAO,EAAE;AACX,CAAU;AAEH,MAAMC,qBAAqB,GAAAZ,OAAA,CAAAY,qBAAA,GAAG,CACnC,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,OAAO,CACC;AAqCV,MAAMC,UAAU,GAAGA,CAAC;EAClBC,WAAW;EACXC,eAAe;EACfC,SAAS;EACTC,cAAc;EACdC,QAAQ;EACRC,KAAK;EACLC,SAAS,EAAEC,aAAa;EACxBC,MAAM;EACNC,SAAS;EACTC,aAAa;EACbC,OAAO,GAAG,MAAM;EA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EAACpB,UAAU;EACTE,eAAe,EAAEA,eAAgB;EACjCC,SAAS,EAAEA,SAAU;EACrBC,cAAc,EAAEA,cAAe;EAC/BC,QAAQ,EAAEA,QAAS;EACnBC,KAAK,EAAEA,KAAM;EACbC,SAAS,EAAEA,SAAU;EACrBE,MAAM,EAAEA,MAAO;EACfC,SAAS,EAAEA,SAAU;EACrBE,OAAO,EAAC;AAAU,CACnB,CACF;AAED,MAAMsC,gBAAgB,GAAA/D,OAAA,CAAA8D,QAAA,GAAG,IAAAtB,WAAI,EAACsB,QAAQ,CAAC;AACvCC,gBAAgB,CAACtB,WAAW,GAAG,UAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePicker.cjs","names":["_react","require","_reactI18next","_xDatePickers","_styled","_interopRequireDefault","_index","_DateFieldActionBar","_DateFieldLocalizationProvider","_TimeZonePicker","_useOdysseyDateFields","_DateTimeField","_dateTimePickerTheme","_index2","_OdysseyDesignTokensContext","_OdysseyThemeProvider","_jsxRuntime","e","__esModule","default","DatePickerContainer","styled","div","marginBlockEnd","DatePickerWidthContainer","odysseyDesignTokens","width","maxWidth","TypographyLineLengthMax","TimeZonePickerContainer","shouldForwardProp","prop","marginBlockStart","Spacing3","DateTimePicker","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","useTranslation","inputRef","useRef","useOdysseyDesignTokens","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","useOdysseyDateFields","language","containerRef","useEffect","current","formatDateTimeToJsDateStringOnCalendarSelection","useCallback","dateStringFromDateTime","renderDateTimeField","jsx","DateTimeField","endAdornment","Button","ariaLabel","onClick","size","startIcon","CalendarIcon","variant","onChange","timezone","slots","useMemo","actionBar","DateFieldActionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","tabs","dateIcon","timeIcon","ClockIcon","toolbar","toolbarPlaceholder","OdysseyThemeProvider","themeOverride","dateTimePickerTheme","children","jsxs","DateFieldLocalizationProvider","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","TimeZonePicker","MemoizedDateTimePicker","exports","memo","displayName"],"sources":["../../../../src/labs/DatePickers/DateTimePicker.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 { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n type DateTimePickerSlots,\n DateTimePicker as MuiDateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n DateTimePickerSlotProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"../../Buttons/index.js\";\nimport { DateFieldActionBar } from \"../../DatePickers/DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"../../DatePickers/DateFieldLocalizationProvider.js\";\nimport { TimeZonePicker } from \"../../DatePickers/TimeZonePicker.js\";\nimport {\n useOdysseyDateFields,\n OdysseyDateFieldProps,\n} from \"../../DatePickers/useOdysseyDateFields.js\";\nimport { DateTimeField, DateTimeFieldProps } from \"./DateTimeField.js\";\nimport { dateTimePickerTheme } from \"./dateTimePickerTheme.js\";\nimport { FieldComponentProps } from \"../../FieldComponentProps.js\";\nimport { CalendarIcon, ClockIcon } from \"../../icons.generated/index.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.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 RenderDateTimeFieldProps = {\n defaultValue: DateTimeFieldProps[\"defaultValue\"];\n value: DateTimeFieldProps[\"value\"];\n} & MuiDateTimePickerProps<DateTime>;\n\nexport type DateTimePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\nconst DateTimePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\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}: DateTimePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\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<MuiDateTimePickerProps<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 renderDateTimeField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateTimeFieldProps) => {\n return (\n <DateTimeField\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 inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n onBlur={onBlur}\n minDate={minDate}\n maxDate={maxDate}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\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<DateTimePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateTimeFieldProps) =>\n renderDateTimeField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateTimeField],\n );\n\n const slotProps = useMemo<DateTimePickerSlotProps<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 tabs: {\n dateIcon: <CalendarIcon />,\n timeIcon: <ClockIcon />,\n },\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={dateTimePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDateTimePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n minDate={minDate}\n maxDate={maxDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slots={slots}\n slotProps={slotProps}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n isReadOnly={isReadOnly}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDateTimePicker = memo(DateTimePicker);\nMemoizedDateTimePicker.displayName = \"DateTimePicker\";\n\nexport { MemoizedDateTimePicker as DateTimePicker };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,8BAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AAIA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,2BAAA,GAAAb,OAAA;AAIA,IAAAc,qBAAA,GAAAd,OAAA;AAAqE,IAAAe,WAAA,GAAAf,OAAA;AAAA,SAAAI,uBAAAY,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvCrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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A,GAAG,IAAA8G,WAAI,EAAC9G,cAAc,CAAC;AACnD4G,sBAAsB,CAACG,WAAW,GAAG,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"DateTimePicker.cjs","names":["_react","require","_reactI18next","_xDatePickers","_styled","_interopRequireDefault","_index","_DateFieldActionBar","_DateFieldLocalizationProvider","_TimeZonePicker","_useOdysseyDateFields","_DateTimeField","_dateTimePickerTheme","_index2","_OdysseyDesignTokensContext","_OdysseyThemeProvider","_jsxRuntime","e","__esModule","default","DatePickerContainer","styled","div","marginBlockEnd","DatePickerWidthContainer","odysseyDesignTokens","width","maxWidth","TypographyLineLengthMax","TimeZonePickerContainer","shouldForwardProp","prop","marginBlockStart","Spacing3","DateTimePicker","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","useTranslation","inputRef","useRef","useOdysseyDesignTokens","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","useOdysseyDateFields","language","containerRef","useEffect","current","formatDateTimeToJsDateStringOnCalendarSelection","useCallback","dateStringFromDateTime","renderDateTimeField","jsx","DateTimeField","endAdornment","Button","ariaLabel","onClick","size","startIcon","CalendarIcon","variant","onChange","timezone","slots","useMemo","actionBar","DateFieldActionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","tabs","dateIcon","timeIcon","ClockIcon","toolbar","toolbarPlaceholder","OdysseyThemeProvider","themeOverride","dateTimePickerTheme","children","jsxs","DateFieldLocalizationProvider","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","TimeZonePicker","MemoizedDateTimePicker","exports","memo","displayName"],"sources":["../../../../src/labs/DatePickers/DateTimePicker.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 { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n type DateTimePickerSlots,\n DateTimePicker as MuiDateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n DateTimePickerSlotProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"../../Buttons/index.js\";\nimport { DateFieldActionBar } from \"../../DatePickers/DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"../../DatePickers/DateFieldLocalizationProvider.js\";\nimport { TimeZonePicker } from \"../../DatePickers/TimeZonePicker.js\";\nimport {\n useOdysseyDateFields,\n OdysseyDateFieldProps,\n} from \"../../DatePickers/useOdysseyDateFields.js\";\nimport { DateTimeField, DateTimeFieldProps } from \"./DateTimeField.js\";\nimport { dateTimePickerTheme } from \"./dateTimePickerTheme.js\";\nimport { FieldComponentProps } from \"../../FieldComponentProps.js\";\nimport { CalendarIcon, ClockIcon } from \"../../icons.generated/index.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.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 RenderDateTimeFieldProps = {\n defaultValue: DateTimeFieldProps[\"defaultValue\"];\n value: DateTimeFieldProps[\"value\"];\n} & MuiDateTimePickerProps<DateTime>;\n\nexport type DateTimePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\nconst DateTimePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\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}: DateTimePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\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<MuiDateTimePickerProps<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 renderDateTimeField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateTimeFieldProps) => {\n return (\n <DateTimeField\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 inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n onBlur={onBlur}\n minDate={minDate}\n maxDate={maxDate}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\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<DateTimePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateTimeFieldProps) =>\n renderDateTimeField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateTimeField],\n );\n\n const slotProps = useMemo<DateTimePickerSlotProps<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 tabs: {\n dateIcon: <CalendarIcon />,\n timeIcon: <ClockIcon />,\n },\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={dateTimePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDateTimePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n minDate={minDate}\n maxDate={maxDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slots={slots}\n slotProps={slotProps}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n isReadOnly={isReadOnly}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDateTimePicker = memo(DateTimePicker);\nMemoizedDateTimePicker.displayName = \"DateTimePicker\";\n\nexport { MemoizedDateTimePicker as DateTimePicker };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,8BAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AAIA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,2BAAA,GAAAb,OAAA;AAIA,IAAAc,qBAAA,GAAAd,OAAA;AAAqE,IAAAe,WAAA,GAAAf,OAAA;AAAA,SAAAI,uBAAAY,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvCrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BA,MAAMG,mBAAmB,GAAGC,eAAM,CAACC,GAAG,CAAC;EACrC,sBAAsB,EAAE;IACtBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,MAAMC,wBAAwB,GAAGH,eAAM,CAACC,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;A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