import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot, createElementVNode } from 'vue';
import '../../../utils/index.mjs';
import { iconProps } from './icon.mjs';
import { addUnit } from '../../../utils/add-unit.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';

"use strict";
const _hoisted_1 = { "aria-hidden": "true" };
const _hoisted_2 = ["xlink:href"];
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "LlIcon"
  },
  __name: "icon",
  props: iconProps,
  setup(__props) {
    const props = __props;
    const iconName = computed(() => {
      return `#${props.iconName}`;
    });
    const style = computed(() => {
      if (!props.size && !props.color) {
        return {};
      }
      return {
        ...props.size ? { "font-size": addUnit(props.size) } : {},
        ...props.color ? { color: props.color } : {}
      };
    });
    const bem = createNamespace("icon");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "i",
        {
          class: normalizeClass(unref(bem).b()),
          style: normalizeStyle(style.value)
        },
        [
          renderSlot(_ctx.$slots, "default", {}, () => [
            (openBlock(), createElementBlock("svg", _hoisted_1, [
              createElementVNode("use", { "xlink:href": iconName.value }, null, 8, _hoisted_2)
            ]))
          ])
        ],
        6
        /* CLASS, STYLE */
      );
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=icon.vue2.mjs.map
