UNPKG

@vuesax-alpha/nightly

Version:
51 lines (48 loc) 1.62 kB
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, renderSlot } from 'vue'; import '../../../utils/index.mjs'; import '../../../hooks/index.mjs'; import { iconProps } from './icon.mjs'; import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs'; import { useNamespace } from '../../../hooks/use-namespace/index.mjs'; import { getVsColor } from '../../../utils/color.mjs'; import { isUndefined } from '../../../utils/types.mjs'; import { addUnit } from '../../../utils/dom/style.mjs'; const __default__ = defineComponent({ name: "VsIcon" }); const _sfc_main = defineComponent({ ...__default__, props: iconProps, setup(__props) { const props = __props; const ns = useNamespace("icon"); const style = computed(() => { const { size, color } = props; if (!size && !color) return {}; return { ...ns.cssVar({ color: getVsColor(color) }), color: `rgb(${ns.cssVarName("color")})`, fontSize: isUndefined(size) ? void 0 : addUnit(size) }; }); return (_ctx, _cache) => { return openBlock(), createElementBlock( "i", { class: normalizeClass(unref(ns).b()), style: normalizeStyle(style.value) }, [ renderSlot(_ctx.$slots, "default") ], 6 ); }; } }); var Icon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/vuesax-alpha/vuesax-alpha/packages/components/icon/src/icon.vue"]]); export { Icon as default }; //# sourceMappingURL=icon2.mjs.map