{"version":3,"file":"Surface.cjs","names":["_styled","_interopRequireDefault","require","_react","_OdysseyDesignTokensContext","_OdysseyThemeProvider","_useContrastMode","_jsxRuntime","e","__esModule","default","StyledContainer","styled","_Paper2","shouldForwardProp","prop","contrastMode","odysseyDesignTokens","border","HueNeutral100","borderRadius","Spacing4","boxShadow","padding","Spacing5","Surface","children","useOdysseyDesignTokens","useContrastModeContext","jsx","OdysseyThemeProvider","MemoizedSurface","exports","memo","displayName"],"sources":["../../src/Surface.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 styled from \"@emotion/styled\";\nimport { Paper as MuiPaper } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\n\nimport {\n  DesignTokens,\n  useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"./OdysseyThemeProvider.js\";\nimport { ContrastMode, useContrastModeContext } from \"./useContrastMode.js\";\n\nconst StyledContainer = styled(MuiPaper, {\n  shouldForwardProp: (prop) =>\n    prop !== \"odysseyDesignTokens\" && prop !== \"contrastMode\",\n})<{\n  contrastMode: ContrastMode;\n  odysseyDesignTokens: DesignTokens;\n}>(({ contrastMode, odysseyDesignTokens }) => ({\n  border:\n    contrastMode === \"lowContrast\"\n      ? `1px solid ${odysseyDesignTokens.HueNeutral100}`\n      : \"none\",\n  borderRadius: odysseyDesignTokens.Spacing4,\n  boxShadow: \"none\",\n  padding: odysseyDesignTokens.Spacing5,\n}));\n\nexport type SurfaceProps = {\n  /** Content to render inside the surface container. */\n  children: ReactNode;\n};\n\n/**\n * A styled container that provides a visually distinct background for grouping related content. Automatically adapts its border and theme to the current contrast mode.\n */\nconst Surface = ({ children }: SurfaceProps) => {\n  const odysseyDesignTokens = useOdysseyDesignTokens();\n  const { contrastMode } = useContrastModeContext();\n\n  return (\n    <StyledContainer\n      contrastMode={contrastMode}\n      odysseyDesignTokens={odysseyDesignTokens}\n    >\n      {/* Required for `contrastMode`. */}\n      <OdysseyThemeProvider>{children}</OdysseyThemeProvider>\n    </StyledContainer>\n  );\n};\n\nconst MemoizedSurface = memo(Surface);\nMemoizedSurface.displayName = \"Surface\";\n\nexport { MemoizedSurface as Surface };\n"],"mappings":";;;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAF,OAAA;AAIA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAA4E,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AArB5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAMG,eAAe,GAAG,IAAAC,eAAM,EAAAC,OAAA,CAAAH,OAAA,EAAW;EACvCI,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAAIA,IAAI,KAAK;AAC/C,CAAC,CAAC,CAGC,CAAC;EAAEC,YAAY;EAAEC;AAAoB,CAAC,MAAM;EAC7CC,MAAM,EACJF,YAAY,KAAK,aAAa,GAC1B,aAAaC,mBAAmB,CAACE,aAAa,EAAE,GAChD,MAAM;EACZC,YAAY,EAAEH,mBAAmB,CAACI,QAAQ;EAC1CC,SAAS,EAAE,MAAM;EACjBC,OAAO,EAAEN,mBAAmB,CAACO;AAC/B,CAAC,CAAC,CAAC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