import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
import { computed, unref } from "vue";
import { getCurrentInstanceName, propsFactory } from "@veno-ui/utils";
import { useColor } from "../color";
const VARIANTS = ["contained", "outlined", "plain", "text", "contained-text", "contained-outlined"];
function genOverlays(isClickable, name) {
  return _createVNode(_Fragment, null, [isClickable && _createVNode("div", {
    "aria-hidden": "true",
    "class": `${name}__overlay`
  }, null), _createVNode("div", {
    "aria-hidden": "true",
    "class": `${name}__underlay`
  }, null), _createVNode("div", {
    "aria-hidden": "true",
    "class": `${name}__border`
  }, null)]);
}
const makeVariantProps = propsFactory({
  /**
   * @zh 颜色
   */
  color: String,
  /**
   * @zh 文本颜色
   */
  textColor: String,
  /**
   * @zh 变体
   */
  variant: {
    type: String,
    default: "contained",
    validator: (v) => VARIANTS.includes(v)
  }
}, "variant");
function useVariant(props, name = getCurrentInstanceName()) {
  const variant = computed(() => {
    const {
      variant: variant2
    } = unref(props);
    return variant2;
  });
  const colors = computed(() => {
    const {
      textColor,
      color,
      variant: variant2
    } = unref(props);
    if (variant2 === "contained") {
      return {
        text: textColor,
        background: color
      };
    }
    return {
      text: color ?? textColor
    };
  });
  const variantClasses = computed(() => {
    return [`${name}--variant-${variant.value}`];
  });
  const {
    colorClasses,
    colorStyles
  } = useColor(colors);
  return {
    colorClasses,
    colorStyles,
    variantClasses
  };
}
export {
  VARIANTS,
  genOverlays,
  makeVariantProps,
  useVariant
};
//# sourceMappingURL=index.mjs.map
