'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.js');
var icon = require('./icon.js');
var addUnit = require('../../../utils/add-unit.js');
var createNamespace = require('../../../utils/create-namespace.js');

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

exports.default = _sfc_main;
//# sourceMappingURL=icon.vue2.js.map
