{"version":3,"file":"Input.cjs","names":["_InputAdornment","require","_InputBase","inputComponents","odysseyTokens","contrastMode","MuiInput","defaultProps","disableUnderline","styleOverrides","root","marginTop","MuiInputAdornment","ownerState","display","minWidth","maxHeight","margin","alignItems","whiteSpace","color","TypographyColorSubordinate","position","marginInlineStart","Spacing3","marginInlineEnd","Spacing2","disablePointerEvents","pointerEvents","MuiInputBase","minRows","theme","typography","body1","flex","width","TypographyColorBody","lineHeight","TypographyLineHeightUi","borderWidth","BorderWidthMain","borderStyle","BorderStyleMain","borderRadius","BorderRadiusMain","borderColor","HueNeutral500","boxShadow","backgroundColor","HueNeutralWhite","transition","transitions","create","duration","TransitionDurationMain","HueNeutral400","border","inputBaseClasses","input","TypographyColorSupport","opacity","HueNeutral50","focused","FocusOutlineColorPrimary","fullWidth","readOnly","HueNeutral900","outline","FocusOutlineWidthMain","FocusOutlineStyle","outlineOffset","FocusOutlineOffsetTight","error","BorderColorDangerControl","disabled","TypographyColorDisabled","BorderColorDisabled","cursor","height","paddingBlock","paddingInline","inputAdornmentClasses","paddingInlineStart","formControl","MozAppearance","WebkitAppearance","MuiInputLabel","disableAnimation","shrink","justifyContent","overflow","transform","variant","maxWidth","size","exports"],"sources":["../../../../src/theme/components/Input.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ThemeOptions } from \"@mui/material\";\n\nimport { CSSObject } from \"@emotion/react\";\nimport { inputAdornmentClasses } from \"@mui/material/InputAdornment\";\nimport { inputBaseClasses } from \"@mui/material/InputBase\";\nimport { CSSProperties } from \"react\";\n\nimport type { GetComponentsProps } from \"./types.js\";\n\nexport const inputComponents = ({\n  odysseyTokens,\n  contrastMode,\n}: GetComponentsProps): Pick<\n  NonNullable<ThemeOptions[\"components\"]>,\n  \"MuiInput\" | \"MuiInputAdornment\" | \"MuiInputBase\" | \"MuiInputLabel\"\n> => ({\n  MuiInput: {\n    defaultProps: {\n      disableUnderline: true,\n    },\n    styleOverrides: {\n      root: {\n        \"label + &\": {\n          marginTop: 0,\n        },\n      },\n    },\n  },\n  MuiInputAdornment: {\n    styleOverrides: {\n      root: ({ ownerState }) => ({\n        display: \"flex\",\n        minWidth: \"1.25em\",\n        maxHeight: \"unset\",\n        margin: 0,\n        alignItems: \"center\",\n        whiteSpace: \"nowrap\",\n        color: odysseyTokens.TypographyColorSubordinate,\n        ...(ownerState.position === \"start\" && {\n          marginInlineStart: odysseyTokens.Spacing3,\n        }),\n        ...(ownerState.position === \"end\" && {\n          marginInlineEnd: odysseyTokens.Spacing2,\n        }),\n        ...(ownerState.disablePointerEvents === true && {\n          pointerEvents: \"none\",\n        }),\n      }),\n    },\n  },\n  MuiInputBase: {\n    defaultProps: {\n      minRows: 3,\n    },\n    styleOverrides: {\n      root: ({ ownerState, theme }) => ({\n        ...theme.typography.body1,\n        flex: \"1\",\n        width: \"auto\",\n        color: odysseyTokens.TypographyColorBody,\n        lineHeight: odysseyTokens.TypographyLineHeightUi,\n        borderWidth: odysseyTokens.BorderWidthMain,\n        borderStyle: odysseyTokens.BorderStyleMain,\n        borderRadius: odysseyTokens.BorderRadiusMain,\n        borderColor: odysseyTokens.HueNeutral500,\n        boxShadow: `0 0 0 0 transparent`,\n        backgroundColor: odysseyTokens.HueNeutralWhite,\n        transition: theme.transitions.create(\n          [\"border-color\", \"background-color\", \"box-shadow\"],\n          {\n            duration: odysseyTokens.TransitionDurationMain,\n          },\n        ),\n\n        [\"&[data-ods-type='search']\"]: {\n          borderColor: odysseyTokens.HueNeutral400,\n\n          ...(contrastMode === \"highContrast\" && {\n            border: \"none\",\n          }),\n\n          [`& .${inputBaseClasses.input}::placeholder`]: {\n            color: odysseyTokens.TypographyColorSupport,\n            opacity: 1,\n          },\n        },\n\n        [\"&[data-ods-variant='filled']\"]: {\n          backgroundColor: odysseyTokens.HueNeutral50,\n          borderColor: odysseyTokens.HueNeutral50,\n\n          [`&:hover`]: {\n            borderColor: odysseyTokens.HueNeutral400,\n          },\n\n          [`&.${inputBaseClasses.focused}`]: {\n            borderColor: odysseyTokens.FocusOutlineColorPrimary,\n            boxShadow: `0 0 0 1px ${odysseyTokens.FocusOutlineColorPrimary}`,\n          },\n        },\n\n        ...(ownerState.fullWidth && {\n          width: \"100%\",\n        }),\n\n        ...(ownerState.readOnly === true && {\n          borderColor: \"transparent\",\n          backgroundColor: odysseyTokens.HueNeutral50,\n        }),\n\n        [`&:hover`]: {\n          borderColor: odysseyTokens.HueNeutral900,\n        },\n\n        [`&.${inputBaseClasses.focused}`]: {\n          borderColor: odysseyTokens.FocusOutlineColorPrimary,\n          boxShadow: `0 0 0 1px ${odysseyTokens.FocusOutlineColorPrimary}`,\n          outline: `${odysseyTokens.FocusOutlineWidthMain} ${odysseyTokens.FocusOutlineStyle} transparent`,\n          outlineOffset: odysseyTokens.FocusOutlineOffsetTight,\n        },\n\n        [`&.${inputBaseClasses.error}`]: {\n          borderColor: odysseyTokens.BorderColorDangerControl,\n        },\n\n        [`&.${inputBaseClasses.error}:hover`]: {\n          borderColor: odysseyTokens.HueNeutral900,\n        },\n\n        [`&.${inputBaseClasses.error}.${inputBaseClasses.focused}`]: {\n          borderColor: odysseyTokens.FocusOutlineColorPrimary,\n          boxShadow: `0 0 0 1px ${odysseyTokens.FocusOutlineColorPrimary}`,\n        },\n\n        [`&.${inputBaseClasses.disabled}`]: {\n          color: odysseyTokens.TypographyColorDisabled,\n          borderColor: odysseyTokens.BorderColorDisabled,\n          pointerEvents: \"auto\",\n          backgroundColor: odysseyTokens.HueNeutral50,\n          cursor: \"not-allowed\",\n        },\n      }),\n      input: {\n        height: \"auto\",\n        // We're subtracting a pixel so the total height, including borders, is 40px\n        paddingBlock: `calc(${odysseyTokens.Spacing3} - ${odysseyTokens.BorderWidthMain})`,\n        paddingInline: odysseyTokens.Spacing3,\n        boxShadow: \"none\",\n\n        [`.${inputBaseClasses.disabled} &`]: {\n          pointerEvents: \"auto\",\n          cursor: \"not-allowed\",\n        },\n\n        [`.${inputAdornmentClasses.root} + &`]: {\n          paddingInlineStart: odysseyTokens.Spacing2,\n        },\n\n        [`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]: {\n          \"&::placeholder\": {\n            color: odysseyTokens.TypographyColorSupport,\n            opacity: \"1 !important\",\n          },\n        },\n\n        [`&::-webkit-search-cancel-button`]: {\n          display: \"none\",\n          MozAppearance: \"none\",\n          WebkitAppearance: \"none\",\n        } satisfies CSSProperties,\n\n        [`&::-ms-clear`]: {\n          display: \"none\",\n        },\n\n        // Chrome, Edge, and Safari (Blink/WebKit) reset border-radius on autofilled inputs, causing corners to appear square.\n        [`&:-webkit-autofill,\n          &:-webkit-autofill:hover,\n          &:-webkit-autofill:focus,\n          &:-webkit-autofill:active`]: {\n          borderRadius: odysseyTokens.BorderRadiusMain,\n        },\n      },\n    },\n  },\n  MuiInputLabel: {\n    defaultProps: {\n      disableAnimation: true,\n      shrink: false,\n    },\n    styleOverrides: {\n      root: ({ ownerState }) => ({\n        display: \"flex\",\n        justifyContent: \"space-between\",\n        overflow: \"unset\",\n        whiteSpace: \"unset\",\n        ...(ownerState.formControl\n          ? {\n              position: \"initial\",\n              transform: \"none\",\n            }\n          : {}),\n        ...(ownerState.variant === \"outlined\" && {\n          pointerEvents: \"initial\",\n          transform: \"none\",\n          maxWidth: \"100%\",\n          ...(ownerState.size === \"small\" && {\n            transform: \"none\",\n          }),\n        }),\n        [`& > .MuiTypography-root`]: {\n          lineHeight: \"unset\",\n        } satisfies CSSObject,\n      }),\n    },\n  },\n});\n"],"mappings":";;;;;;AAeA,IAAAA,eAAA,GAAA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