{"version":3,"file":"FieldHint.cjs","names":["_styled","_interopRequireDefault","require","_react","_OdysseyDesignTokensContext","_jsxRuntime","e","__esModule","default","HintLinkContainer","styled","span","odysseyDesignTokens","a","color","TypographyColorBody","textDecoration","TypographyColorSubordinate","FieldHint","id","LinkComponent","testId","text","translate","useOdysseyDesignTokens","jsxs","_FormHelperText2","children","MemoizedFieldHint","exports","memo","displayName"],"sources":["../../src/FieldHint.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { FormHelperText } from \"@mui/material\";\nimport { memo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps.js\";\nimport {\n  DesignTokens,\n  useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst HintLinkContainer = styled.span<{ odysseyDesignTokens: DesignTokens }>(\n  ({ odysseyDesignTokens }) => ({\n    a: {\n      color: odysseyDesignTokens.TypographyColorBody,\n      textDecoration: \"underline\",\n\n      \"&:visited\": {\n        color: odysseyDesignTokens.TypographyColorBody,\n      },\n\n      \"&:hover\": {\n        color: odysseyDesignTokens.TypographyColorSubordinate,\n      },\n    },\n  }),\n);\n\nexport type FieldHintProps = {\n  id?: string;\n  LinkComponent?: FieldComponentProps[\"HintLinkComponent\"];\n  text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst FieldHint = ({\n  id,\n  LinkComponent,\n  testId,\n  text,\n  translate,\n}: FieldHintProps) => {\n  const odysseyDesignTokens = useOdysseyDesignTokens();\n\n  return (\n    <FormHelperText data-se={testId} id={id} translate={translate}>\n      {text}\n      {LinkComponent && (\n        <HintLinkContainer odysseyDesignTokens={odysseyDesignTokens}>\n          {\" \"}\n          {LinkComponent}\n        </HintLinkContainer>\n      )}\n    </FormHelperText>\n  );\n};\n\nconst MemoizedFieldHint = memo(FieldHint);\nMemoizedFieldHint.displayName = \"FieldHint\";\n\nexport { MemoizedFieldHint as FieldHint };\n"],"mappings":";;;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,2BAAA,GAAAF,OAAA;AAGyC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAtBzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,MAAMG,iBAAiB,GAAGC,eAAM,CAACC,IAAI,CACnC,CAAC;EAAEC;AAAoB,CAAC,MAAM;EAC5BC,CAAC,EAAE;IACDC,KAAK,EAAEF,mBAAmB,CAACG,mBAAmB;IAC9CC,cAAc,EAAE,WAAW;IAE3B,WAAW,EAAE;MACXF,KAAK,EAAEF,mBAAmB,CAACG;IAC7B,CAAC;IAED,SAAS,EAAE;MACTD,KAAK,EAAEF,mBAAmB,CAACK;IAC7B;EACF;AACF,CAAC,CACH,CAAC;AAQD,MAAMC,SAAS,GAAGA,CAAC;EACjBC,EAAE;EACFC,aAAa;EACbC,MAAM;EACNC,IAAI;EACJC;AACc,CAAC,KAAK;EACpB,MAAMX,mBAAmB,GAAG,IAAAY,kDAAsB,EAAC,CAAC;EAEpD,OACE,IAAAnB,WAAA,CAAAoB,IAAA,EAAAC,gBAAA,CAAAlB,OAAA;IAAgB,WAASa,MAAO;IAACF,EAAE,EAAEA,EAAG;IAACI,SAAS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