import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
import "./styles/anchor.css";
import { toRef } from "vue";
import { defineComponent } from "../../utils";
import { provideDefaults } from "../../composables/defaults";
import { makeNamedAnchor, useNamedAnchor } from "../../composables/named-anchor";
import { AnchorItem } from "./anchor-item";
const Anchor = defineComponent({
  name: "VeAnchor",
  props: {
    /**
     * @zh 激活时的颜色
     */
    activeColor: {
      type: String,
      default: "primary"
    },
    /**
     * @zh 锚点项
     */
    items: Array,
    ...makeNamedAnchor()
  },
  setup(props, {
    slots
  }) {
    useNamedAnchor(props);
    provideDefaults({
      VeAnchorItem: {
        activeColor: toRef(props, "activeColor")
      }
    });
    return () => _createVNode("ul", {
      "class": "ve-anchor"
    }, [slots.default?.(), props.items?.map((item) => _createVNode(AnchorItem, _mergeProps({
      "key": item.value
    }, item), null))]);
  }
});
export {
  Anchor
};
//# sourceMappingURL=anchor.mjs.map
