"use strict";
var import_Typography = require("./Typography.css");
const jsxRuntime = require("react/jsx-runtime");
const antd = require("antd");
const _ = require("lodash");
const kit_Theme_UI = require("./kit/Theme/UI.cjs");
require("./kit/Theme/themeUtils.cjs");
require("./kit/Theme/themes.cjs");
const title = "Typography_title_38dad";
const large = "Typography_large_38dad";
const small = "Typography_small_38dad";
const body = "Typography_body_38dad";
const label = "Typography_label_38dad";
const code = "Typography_code_38dad";
const strong = "Typography_strong_38dad";
const inactive = "Typography_inactive_38dad";
const css = {
  title,
  "default": "Typography_default_38dad",
  large,
  small,
  "x-small": "Typography_x-small_38dad",
  body,
  label,
  code,
  strong,
  inactive
};
const TypographySize = {
  Default: "default",
  L: "large",
  S: "small",
  XS: "x-small"
};
const getEllipsisConfig = (themeClass, children, truncate, isText = false) => {
  let ellipsis;
  if (truncate) {
    ellipsis = {
      tooltip: truncate.tooltip ? {
        overlayClassName: themeClass,
        title: !_.isBoolean(truncate.tooltip) ? truncate.tooltip : children,
        trigger: ["hover", "focus"]
      } : false
    };
    if (!isText)
      ellipsis.rows = truncate.rows;
  }
  return ellipsis;
};
const getClassName = (element, size) => {
  const classes = [css[element]];
  if (size)
    classes.push(css[size]);
  return classes.join(" ");
};
const Title = ({
  children,
  truncate,
  size = "default"
}) => {
  const {
    themeSettings: { className: themeClass }
  } = kit_Theme_UI.useTheme();
  const classes = [getClassName("title", size), themeClass];
  const ellipsis = getEllipsisConfig(themeClass, children, truncate);
  return /* @__PURE__ */ jsxRuntime.jsx(
    antd.Typography.Title,
    {
      className: classes.join(" "),
      ellipsis,
      tabIndex: (truncate == null ? void 0 : truncate.tooltip) ? 0 : void 0,
      children
    }
  );
};
const Body = ({
  children,
  truncate,
  inactive: inactive2,
  size = "default"
}) => {
  const {
    themeSettings: { className: themeClass }
  } = kit_Theme_UI.useTheme();
  const classes = [getClassName("body", size), themeClass];
  const ellipsis = getEllipsisConfig(themeClass, children, truncate);
  if (inactive2)
    classes.push(css.inactive);
  return /* @__PURE__ */ jsxRuntime.jsx(
    antd.Typography.Paragraph,
    {
      className: classes.join(" "),
      ellipsis,
      tabIndex: (truncate == null ? void 0 : truncate.tooltip) ? 0 : void 0,
      children
    }
  );
};
const Label = ({
  children,
  truncate,
  inactive: inactive2,
  strong: strong2,
  size = "default"
}) => {
  const {
    themeSettings: { className: themeClass }
  } = kit_Theme_UI.useTheme();
  const classes = [getClassName("label", size), themeClass];
  const ellipsis = getEllipsisConfig(themeClass, children, truncate, true);
  if (strong2)
    classes.push(css.strong);
  if (inactive2)
    classes.push(css.inactive);
  return /* @__PURE__ */ jsxRuntime.jsx(
    antd.Typography.Text,
    {
      className: classes.join(" "),
      ellipsis,
      tabIndex: (truncate == null ? void 0 : truncate.tooltip) ? 0 : void 0,
      children
    }
  );
};
const Code = ({ children, truncate }) => {
  const {
    themeSettings: { className: themeClass }
  } = kit_Theme_UI.useTheme();
  const classes = [getClassName("code"), themeClass];
  const ellipsis = getEllipsisConfig(themeClass, children, truncate);
  return /* @__PURE__ */ jsxRuntime.jsx(
    antd.Typography.Paragraph,
    {
      className: classes.join(" "),
      ellipsis,
      tabIndex: (truncate == null ? void 0 : truncate.tooltip) ? 0 : void 0,
      children
    }
  );
};
const Typography = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Body,
  Code,
  Label,
  Title,
  TypographySize
}, Symbol.toStringTag, { value: "Module" }));
exports.Body = Body;
exports.Code = Code;
exports.Label = Label;
exports.Title = Title;
exports.Typography = Typography;
exports.TypographySize = TypographySize;
