"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.typographyVariantMapping = exports.typographyColorValues = exports.Typography = exports.Support = exports.Subordinate = exports.Paragraph = exports.Overline = exports.Legend = exports.Heading6 = exports.Heading5 = exports.Heading4 = exports.Heading3 = exports.Heading2 = exports.Heading1 = void 0;
var _Typography2 = _interopRequireDefault(require("@mui/material/Typography"));
var _react = require("react");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/*!
 * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */

const typographyVariantMapping = exports.typographyVariantMapping = {
  h1: "h1",
  h2: "h2",
  h3: "h3",
  h4: "h4",
  h5: "h5",
  h6: "h6",
  body: "body1",
  legend: "legend",
  overline: "overline",
  subordinate: "subtitle1",
  support: "subtitle2"
};
const typographyColorValues = exports.typographyColorValues = ["primary", "textPrimary", "secondary", "textSecondary", "error"];
const Typography = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component: componentProp,
  id,
  isPresentational,
  testId,
  translate,
  typographyRef,
  variant = "body"
}) => {
  const component = (0, _react.useMemo)(() => {
    if (!componentProp) {
      if (variant === "body" || variant === "subordinate" || variant === "support" || variant === "overline") {
        return "p";
      } else {
        return variant;
      }
    }
    return componentProp;
  }, [componentProp, variant]);
  const localTypographyRef = (0, _react.useRef)(null);
  (0, _react.useImperativeHandle)(typographyRef, () => {
    return {
      focus: () => {
        localTypographyRef.current?.focus();
      }
    };
  }, []);
  return (0, _jsxRuntime.jsx)(_Typography2.default, {
    "aria-current": ariaCurrent,
    "aria-describedby": ariaDescribedBy,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy,
    children: children,
    color: color,
    component: component,
    "data-se": testId,
    id: id,
    ref: localTypographyRef,
    role: isPresentational ? "presentation" : undefined,
    tabIndex: -1,
    translate: translate,
    variant: typographyVariantMapping[variant]
  });
};
const MemoizedTypography = exports.Typography = (0, _react.memo)(Typography);
MemoizedTypography.displayName = "Typography";
const Heading1 = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  isPresentational,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  isPresentational: isPresentational,
  testId: testId,
  translate: translate,
  variant: "h1"
});
const MemoizedHeading1 = exports.Heading1 = (0, _react.memo)(Heading1);
MemoizedHeading1.displayName = "Heading1";
const Heading2 = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "h2"
});
const MemoizedHeading2 = exports.Heading2 = (0, _react.memo)(Heading2);
MemoizedHeading2.displayName = "Heading2";
const Heading3 = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "h3"
});
const MemoizedHeading3 = exports.Heading3 = (0, _react.memo)(Heading3);
MemoizedHeading3.displayName = "Heading3";
const Heading4 = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "h4"
});
const MemoizedHeading4 = exports.Heading4 = (0, _react.memo)(Heading4);
MemoizedHeading4.displayName = "Heading4";
const Heading5 = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "h5"
});
const MemoizedHeading5 = exports.Heading5 = (0, _react.memo)(Heading5);
MemoizedHeading5.displayName = "Heading5";
const Heading6 = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "h6"
});
const MemoizedHeading6 = exports.Heading6 = (0, _react.memo)(Heading6);
MemoizedHeading6.displayName = "Heading6";
const Paragraph = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "body"
});
const MemoizedParagraph = exports.Paragraph = (0, _react.memo)(Paragraph);
MemoizedParagraph.displayName = "Paragraph";
const Subordinate = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "subordinate"
});
const MemoizedSubordinate = exports.Subordinate = (0, _react.memo)(Subordinate);
MemoizedSubordinate.displayName = "Subordinate";
const Support = ({
  ariaCurrent,
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaCurrent: ariaCurrent,
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "support"
});
const MemoizedSupport = exports.Support = (0, _react.memo)(Support);
MemoizedSupport.displayName = "Support";
const Legend = ({
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "legend"
});
const MemoizedLegend = exports.Legend = (0, _react.memo)(Legend);
MemoizedLegend.displayName = "Legend";
const Overline = ({
  ariaDescribedBy,
  ariaLabel,
  ariaLabelledBy,
  children,
  color,
  component,
  id,
  testId,
  translate
}) => (0, _jsxRuntime.jsx)(Typography, {
  ariaDescribedBy: ariaDescribedBy,
  ariaLabel: ariaLabel,
  ariaLabelledBy: ariaLabelledBy,
  children: children,
  color: color,
  component: component,
  id: id,
  testId: testId,
  translate: translate,
  variant: "overline"
});
const MemoizedOverline = exports.Overline = (0, _react.memo)(Overline);
MemoizedOverline.displayName = "Overline";
//# sourceMappingURL=Typography.cjs.map