import { createVNode, Fragment, computed, unref } from "vue";
import { useColor } from "../color/index.mjs";
import { propsFactory, getCurrentInstanceName } from "../../utils/dist/index.mjs";
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({
  color: String,
  textColor: String,
  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 != null ? 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
