import { defineComponent, createVNode } from 'vue';
import '../../../utils/index.mjs';
import useConfigInject from '../../config-provider/src/hooks/useConfigInject.mjs';
import useStyle from '../style/index.mjs';
import { typographyProps } from './props.mjs';
import { classNames } from '../../../utils/dom/class.mjs';

const Typography = /* @__PURE__ */ defineComponent({
  name: "ATypography",
  inheritAttrs: false,
  props: typographyProps(),
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls,
      direction
    } = useConfigInject("typography", props);
    const [wrapSSR, hashId] = useStyle(prefixCls);
    return () => {
      const {
        prefixCls: _prefixCls,
        direction: _direction,
        component: Component = "article",
        ...restProps
      } = {
        ...props,
        ...attrs
      };
      return wrapSSR(createVNode(Component, {
        ...restProps,
        "class": classNames(prefixCls.value, {
          [`${prefixCls.value}-rtl`]: direction.value === "rtl"
        }, attrs.class, hashId.value)
      }, {
        default: () => {
          var _a;
          return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
        }
      }));
    };
  }
});

export { Typography as default };
//# sourceMappingURL=Typography.mjs.map
