@hugeicons/vue 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +307 -0
- package/dist/cjs/_virtual/_plugin-vue_export-helper.js +14 -0
- package/dist/cjs/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/dist/cjs/components/HugeiconsIcon.vue.js +44 -0
- package/dist/cjs/components/HugeiconsIcon.vue.js.map +1 -0
- package/dist/cjs/components/HugeiconsIcon.vue2.js +80 -0
- package/dist/cjs/components/HugeiconsIcon.vue2.js.map +1 -0
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/esm/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/dist/esm/components/HugeiconsIcon.vue.js +40 -0
- package/dist/esm/components/HugeiconsIcon.vue.js.map +1 -0
- package/dist/esm/components/HugeiconsIcon.vue2.js +76 -0
- package/dist/esm/components/HugeiconsIcon.vue2.js.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/types.d.ts +4 -0
- package/dist/umd/index.js +2 -0
- package/dist/umd/index.js.map +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# @hugeicons/vue
|
|
4
|
+
|
|
5
|
+
> HugeIcons Pro Vue Component Library - Beautiful and customizable icons for your Vue applications
|
|
6
|
+
|
|
7
|
+
## What is HugeIcons?
|
|
8
|
+
|
|
9
|
+
HugeIcons is a comprehensive icon library designed for modern web and mobile applications. The free package includes 4,000+ carefully crafted icons in the Stroke Rounded style, while the pro version offers over 36,000 icons across 9 unique styles.
|
|
10
|
+
|
|
11
|
+
### Key Highlights
|
|
12
|
+
- **4,000+ Free Icons**: Extensive collection of Stroke Rounded icons covering essential UI elements, actions, and concepts
|
|
13
|
+
- **Pixel Perfect**: Every icon is crafted on a 24x24 pixel grid ensuring crisp, clear display at any size
|
|
14
|
+
- **Customizable**: Easily adjust colors, sizes, and styles to match your design needs
|
|
15
|
+
- **Regular Updates**: New icons added regularly to keep up with evolving design trends
|
|
16
|
+
|
|
17
|
+
> 📚 **Looking for Pro Icons?** Check out our comprehensive documentation at [docs.hugeicons.com](https://docs.hugeicons.com) for detailed information about pro icons, styles, and advanced usage.
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
## Table of Contents
|
|
22
|
+
- [What is HugeIcons?](#what-is-hugeicons)
|
|
23
|
+
- [Features](#features)
|
|
24
|
+
- [Installation](#installation)
|
|
25
|
+
- [Usage](#usage)
|
|
26
|
+
- [Props](#props)
|
|
27
|
+
- [Examples](#examples)
|
|
28
|
+
- [Basic Usage](#basic-usage)
|
|
29
|
+
- [Custom Size and Color](#custom-size-and-color)
|
|
30
|
+
- [Interactive Examples](#interactive-examples)
|
|
31
|
+
- [Performance](#performance)
|
|
32
|
+
- [Troubleshooting](#troubleshooting)
|
|
33
|
+
- [Browser Support](#browser-support)
|
|
34
|
+
- [Related Packages](#related-packages)
|
|
35
|
+
- [Pro Version](#pro-version)
|
|
36
|
+
- [License](#license)
|
|
37
|
+
- [Related](#related)
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- 🎨 Customizable colors and sizes
|
|
42
|
+
- 💪 TypeScript support with full type definitions
|
|
43
|
+
- 🎯 Tree-shakeable for optimal bundle size
|
|
44
|
+
- 📦 Multiple bundle formats (ESM, CJS, UMD)
|
|
45
|
+
- âš¡ Lightweight and optimized
|
|
46
|
+
- 🔄 Alternate icon support for dynamic interactions
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Using npm
|
|
52
|
+
npm install @hugeicons/vue @hugeicons/core-free-icons
|
|
53
|
+
|
|
54
|
+
# Using yarn
|
|
55
|
+
yarn add @hugeicons/vue @hugeicons/core-free-icons
|
|
56
|
+
|
|
57
|
+
# Using pnpm
|
|
58
|
+
pnpm add @hugeicons/vue @hugeicons/core-free-icons
|
|
59
|
+
|
|
60
|
+
# Using bun
|
|
61
|
+
bun add @hugeicons/vue @hugeicons/core-free-icons
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
```vue
|
|
67
|
+
<template>
|
|
68
|
+
<HugeiconsIcon
|
|
69
|
+
:icon="SearchIcon"
|
|
70
|
+
:size="24"
|
|
71
|
+
color="currentColor"
|
|
72
|
+
:stroke-width="1.5"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script>
|
|
77
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
78
|
+
import { SearchIcon } from '@hugeicons/core-free-icons';
|
|
79
|
+
|
|
80
|
+
export default {
|
|
81
|
+
components: {
|
|
82
|
+
HugeiconsIcon
|
|
83
|
+
},
|
|
84
|
+
setup() {
|
|
85
|
+
return {
|
|
86
|
+
SearchIcon
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Props
|
|
94
|
+
|
|
95
|
+
| Prop (in template) | Prop (in script) | Type | Default | Description |
|
|
96
|
+
|-------------------|------------------|------|---------|-------------|
|
|
97
|
+
| `icon` | `icon` | `[string, Record<string, any>][]` | Required | The main icon to display (array of SVG elements and their attributes) |
|
|
98
|
+
| `size` | `size` | `number \| string` | `24` | Icon size in pixels. Must be a positive number. String values will be parsed to numbers |
|
|
99
|
+
| `stroke-width` | `strokeWidth` | `number \| undefined` | `undefined` | Width of the icon strokes. When used with `absoluteStrokeWidth`, the stroke width will be automatically scaled relative to the icon size |
|
|
100
|
+
| `absolute-stroke-width` | `absoluteStrokeWidth` | `boolean` | `false` | When true, the stroke width will be scaled relative to the icon size to maintain visual consistency across different sizes |
|
|
101
|
+
| `alt-icon` | `altIcon` | `[string, Record<string, any>][]` | `undefined` | Alternative icon that can be used for states, interactions, or animations |
|
|
102
|
+
| `show-alt` | `showAlt` | `boolean` | `false` | When true, displays the altIcon instead of the main icon |
|
|
103
|
+
| `color` | `color` | `string` | `currentColor` | Icon color (CSS color value) |
|
|
104
|
+
|
|
105
|
+
Note:
|
|
106
|
+
- The component accepts all standard SVG attributes as props which will be passed to the root SVG element.
|
|
107
|
+
- The `size` prop accepts both numbers and strings, but strings will be parsed to numbers and must result in a positive number.
|
|
108
|
+
- Icon arrays are tuples of `[elementName: string, attributes: Record<string, any>][]` representing SVG elements.
|
|
109
|
+
|
|
110
|
+
## Examples
|
|
111
|
+
|
|
112
|
+
### Basic Usage
|
|
113
|
+
```vue
|
|
114
|
+
<template>
|
|
115
|
+
<HugeiconsIcon :icon="SearchIcon" />
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<script>
|
|
119
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
120
|
+
import { SearchIcon } from '@hugeicons/core-free-icons';
|
|
121
|
+
|
|
122
|
+
export default {
|
|
123
|
+
components: { HugeiconsIcon },
|
|
124
|
+
setup() {
|
|
125
|
+
return { SearchIcon }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</script>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Custom Size and Color
|
|
132
|
+
```vue
|
|
133
|
+
<template>
|
|
134
|
+
<HugeiconsIcon
|
|
135
|
+
:icon="NotificationIcon"
|
|
136
|
+
:size="32"
|
|
137
|
+
color="#FF5733"
|
|
138
|
+
/>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
141
|
+
<script>
|
|
142
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
143
|
+
import { NotificationIcon } from '@hugeicons/core-free-icons';
|
|
144
|
+
|
|
145
|
+
export default {
|
|
146
|
+
components: { HugeiconsIcon },
|
|
147
|
+
setup() {
|
|
148
|
+
return { NotificationIcon }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</script>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Interactive Examples
|
|
155
|
+
|
|
156
|
+
#### Search Bar with Clear Button
|
|
157
|
+
```vue
|
|
158
|
+
<template>
|
|
159
|
+
<div>
|
|
160
|
+
<input
|
|
161
|
+
v-model="searchValue"
|
|
162
|
+
type="text"
|
|
163
|
+
placeholder="Search..."
|
|
164
|
+
/>
|
|
165
|
+
<HugeiconsIcon
|
|
166
|
+
:icon="SearchIcon"
|
|
167
|
+
:alt-icon="CloseCircleIcon"
|
|
168
|
+
:show-alt="searchValue.length > 0"
|
|
169
|
+
@click="clearSearch"
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
</template>
|
|
173
|
+
|
|
174
|
+
<script>
|
|
175
|
+
import { ref } from 'vue';
|
|
176
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
177
|
+
import { SearchIcon, CloseCircleIcon } from '@hugeicons/core-free-icons';
|
|
178
|
+
|
|
179
|
+
export default {
|
|
180
|
+
components: { HugeiconsIcon },
|
|
181
|
+
setup() {
|
|
182
|
+
const searchValue = ref('');
|
|
183
|
+
|
|
184
|
+
const clearSearch = () => {
|
|
185
|
+
if (searchValue.value.length > 0) {
|
|
186
|
+
searchValue.value = '';
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
searchValue,
|
|
192
|
+
clearSearch,
|
|
193
|
+
SearchIcon,
|
|
194
|
+
CloseCircleIcon
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
</script>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### Theme Toggle
|
|
202
|
+
```vue
|
|
203
|
+
<template>
|
|
204
|
+
<button @click="toggleTheme">
|
|
205
|
+
<HugeiconsIcon
|
|
206
|
+
:icon="SunIcon"
|
|
207
|
+
:alt-icon="MoonIcon"
|
|
208
|
+
:show-alt="isDark"
|
|
209
|
+
/>
|
|
210
|
+
</button>
|
|
211
|
+
</template>
|
|
212
|
+
|
|
213
|
+
<script>
|
|
214
|
+
import { ref } from 'vue';
|
|
215
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
216
|
+
import { SunIcon, MoonIcon } from '@hugeicons/core-free-icons';
|
|
217
|
+
|
|
218
|
+
export default {
|
|
219
|
+
components: { HugeiconsIcon },
|
|
220
|
+
setup() {
|
|
221
|
+
const isDark = ref(false);
|
|
222
|
+
const toggleTheme = () => isDark.value = !isDark.value;
|
|
223
|
+
|
|
224
|
+
return {
|
|
225
|
+
isDark,
|
|
226
|
+
toggleTheme,
|
|
227
|
+
SunIcon,
|
|
228
|
+
MoonIcon
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
</script>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Performance
|
|
236
|
+
|
|
237
|
+
- **Tree-shaking**: The package is fully tree-shakeable, ensuring only the icons you use are included in your final bundle
|
|
238
|
+
- **Optimized SVGs**: All icons are optimized for size and performance
|
|
239
|
+
- **Code Splitting**: Icons can be easily code-split when using dynamic imports
|
|
240
|
+
|
|
241
|
+
## Troubleshooting
|
|
242
|
+
|
|
243
|
+
### Common Issues
|
|
244
|
+
|
|
245
|
+
1. **Icons not showing up?**
|
|
246
|
+
- Make sure you've installed both `@hugeicons/vue` and `@hugeicons/core-free-icons`
|
|
247
|
+
- Check that the icon names are correctly imported
|
|
248
|
+
|
|
249
|
+
2. **TypeScript errors?**
|
|
250
|
+
- Ensure your `tsconfig.json` includes the necessary type definitions
|
|
251
|
+
- Check that you're using the latest version of the package
|
|
252
|
+
|
|
253
|
+
3. **Bundle size concerns?**
|
|
254
|
+
- Use named imports instead of importing the entire icon set
|
|
255
|
+
- Implement code splitting for different sections of your app
|
|
256
|
+
|
|
257
|
+
## Browser Support
|
|
258
|
+
|
|
259
|
+
The library supports all modern browsers.
|
|
260
|
+
|
|
261
|
+
## Related Packages
|
|
262
|
+
|
|
263
|
+
- [@hugeicons/react](https://www.npmjs.com/package/@hugeicons/react) - React component
|
|
264
|
+
- [@hugeicons/svelte](https://www.npmjs.com/package/@hugeicons/svelte) - Svelte component
|
|
265
|
+
- [@hugeicons/angular](https://www.npmjs.com/package/@hugeicons/angular) - Angular component
|
|
266
|
+
- [@hugeicons/react-native](https://www.npmjs.com/package/@hugeicons/react-native) - React Native component
|
|
267
|
+
|
|
268
|
+
## Pro Version
|
|
269
|
+
|
|
270
|
+
> 🌟 **Want access to 36,000+ icons and 9 unique styles?**
|
|
271
|
+
> Check out our [Pro Version](https://hugeicons.com/pricing) and visit [docs.hugeicons.com](https://docs.hugeicons.com) for comprehensive documentation.
|
|
272
|
+
|
|
273
|
+
### Available Pro Styles
|
|
274
|
+
- **Stroke Styles**
|
|
275
|
+
- Stroke Rounded (`@hugeicons-pro/core-stroke-rounded`)
|
|
276
|
+
- Stroke Sharp (`@hugeicons-pro/core-stroke-sharp`)
|
|
277
|
+
- Stroke Standard (`@hugeicons-pro/core-stroke-standard`)
|
|
278
|
+
- **Solid Styles**
|
|
279
|
+
- Solid Rounded (`@hugeicons-pro/core-solid-rounded`)
|
|
280
|
+
- Solid Sharp (`@hugeicons-pro/core-solid-sharp`)
|
|
281
|
+
- Solid Standard (`@hugeicons-pro/core-solid-standard`)
|
|
282
|
+
- **Special Styles**
|
|
283
|
+
- Bulk Rounded (`@hugeicons-pro/core-bulk-rounded`)
|
|
284
|
+
- Duotone Rounded (`@hugeicons-pro/core-duotone-rounded`)
|
|
285
|
+
- Twotone Rounded (`@hugeicons-pro/core-twotone-rounded`)
|
|
286
|
+
|
|
287
|
+
## License
|
|
288
|
+
|
|
289
|
+
This project is licensed under the [MIT License](LICENSE.md).
|
|
290
|
+
|
|
291
|
+
## Related
|
|
292
|
+
|
|
293
|
+
- [@hugeicons/core-free-icons](https://www.npmjs.com/package/@hugeicons/core-free-icons) - Free icon package
|
|
294
|
+
- [HugeIcons Website](https://hugeicons.com) - Browse all available icons
|
|
295
|
+
|
|
296
|
+
## Changelog
|
|
297
|
+
|
|
298
|
+
### v1.1.0
|
|
299
|
+
- Added `absoluteStrokeWidth` prop for consistent stroke width scaling
|
|
300
|
+
- Improved stroke width handling by applying it at the SVG level
|
|
301
|
+
- Enhanced TypeScript types and documentation
|
|
302
|
+
|
|
303
|
+
### v1.0.0
|
|
304
|
+
- Initial release
|
|
305
|
+
- Basic icon rendering functionality
|
|
306
|
+
- Support for customization (size, color, alternate icons)
|
|
307
|
+
- Full TypeScript support
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _export_sfc = (sfc, props) => {
|
|
6
|
+
const target = sfc.__vccOpts || sfc;
|
|
7
|
+
for (const [key, val] of props) {
|
|
8
|
+
target[key] = val;
|
|
9
|
+
}
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.default = _export_sfc;
|
|
14
|
+
//# sourceMappingURL=_plugin-vue_export-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var HugeiconsIcon_vue_vue_type_script_lang = require('./HugeiconsIcon.vue2.js');
|
|
6
|
+
var vue = require('vue');
|
|
7
|
+
var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
|
|
8
|
+
|
|
9
|
+
const _hoisted_1 = ["width", "height", "color", "stroke-width"];
|
|
10
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
+
return vue.openBlock(), vue.createElementBlock("svg", vue.mergeProps({
|
|
12
|
+
width: _ctx.computedSize,
|
|
13
|
+
height: _ctx.computedSize,
|
|
14
|
+
viewBox: `0 0 24 24`,
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
fill: "none",
|
|
17
|
+
color: _ctx.color,
|
|
18
|
+
"stroke-width": _ctx.calculatedStrokeWidth,
|
|
19
|
+
stroke: "currentColor"
|
|
20
|
+
}, _ctx.$attrs), [
|
|
21
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
22
|
+
vue.Fragment,
|
|
23
|
+
null,
|
|
24
|
+
vue.renderList(_ctx.currentIcon, (element, index) => {
|
|
25
|
+
return vue.openBlock(), vue.createBlock(
|
|
26
|
+
vue.resolveDynamicComponent(element[0]),
|
|
27
|
+
vue.mergeProps({
|
|
28
|
+
key: index,
|
|
29
|
+
ref_for: true
|
|
30
|
+
}, _ctx.transformAttrs(element[1])),
|
|
31
|
+
null,
|
|
32
|
+
16
|
|
33
|
+
/* FULL_PROPS */
|
|
34
|
+
);
|
|
35
|
+
}),
|
|
36
|
+
128
|
|
37
|
+
/* KEYED_FRAGMENT */
|
|
38
|
+
))
|
|
39
|
+
], 16, _hoisted_1);
|
|
40
|
+
}
|
|
41
|
+
var HugeiconsIcon = /* @__PURE__ */ _pluginVue_exportHelper.default(HugeiconsIcon_vue_vue_type_script_lang.default, [["render", _sfc_render], ["__file", "/Users/mac/Documents/Projects/Hugeicons/monorepo/hugeicons/packages/vue/src/components/HugeiconsIcon.vue"]]);
|
|
42
|
+
|
|
43
|
+
exports.default = HugeiconsIcon;
|
|
44
|
+
//# sourceMappingURL=HugeiconsIcon.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HugeiconsIcon.vue.js","sources":["../../../src/components/HugeiconsIcon.vue"],"sourcesContent":["<template>\n <svg\n :width=\"computedSize\"\n :height=\"computedSize\"\n :viewBox=\"`0 0 24 24`\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n :color=\"color\"\n :stroke-width=\"calculatedStrokeWidth\"\n stroke=\"currentColor\"\n v-bind=\"$attrs\"\n >\n <template v-for=\"(element, index) in currentIcon\" :key=\"index\">\n <component\n :is=\"element[0]\"\n v-bind=\"transformAttrs(element[1])\"\n />\n </template>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType, computed } from 'vue';\n\nexport default defineComponent({\n name: 'HugeiconsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n required: true\n },\n size: {\n type: [Number, String],\n default: 24,\n validator(value: number | string) {\n const size = typeof value === 'string' ? parseInt(value, 10) : value;\n return !isNaN(size) && size > 0;\n }\n },\n strokeWidth: {\n type: Number,\n default: undefined\n },\n absoluteStrokeWidth: {\n type: Boolean,\n default: false\n },\n altIcon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n default: undefined\n },\n showAlt: {\n type: Boolean,\n default: false\n },\n color: {\n type: String,\n default: 'currentColor'\n }\n },\n setup(props) {\n const computedSize = computed(() => {\n const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;\n return !isNaN(size) && size > 0 ? size : 24;\n });\n\n const calculatedStrokeWidth = computed(() => {\n if (props.strokeWidth === undefined) return undefined;\n return props.absoluteStrokeWidth \n ? (props.strokeWidth * 24) / computedSize.value \n : props.strokeWidth;\n });\n\n const currentIcon = computed(() => {\n return props.altIcon && props.showAlt ? props.altIcon : props.icon;\n });\n\n const transformAttrs = (attrs: Record<string, any>) => {\n const result = { ...attrs };\n if (result.fillRule) {\n result['fill-rule'] = result.fillRule;\n delete result.fillRule;\n }\n return result;\n };\n\n return {\n computedSize,\n calculatedStrokeWidth,\n transformAttrs,\n currentIcon\n };\n }\n});\n</script> "],"names":["computedSize","_openBlock","_createElementBlock","_mergeProps","color","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","transformAttrs"],"mappings":";;;;;;;;;AAEU,SAAA,WAAA,CAAEA,IAAY,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;AACb,EAAA,OAAAC,aAAA,EAAc,EAAAC,sBAAA,CAAA,KAAA,EAAAC,cAAA,CAAA;AAAA,IACpB,OAAO,IAAE,CAAA,YAAA;AAAA,IACV,MAAM,EAAA,IAAA,CAAA,YAAA;AAAA,IACN,OAAK,EAAA,CAAA,SAAA,CAAA;AAAA,IACJ,KAAOC,EAAAA,4BAAAA;AAAAA,IACP,IAAA,EAAA,MAAA;AAAA,IACD,OAAM,IAAC,CAAA,KAAA;AAAA,IACO,cAAA,EAAA,IAAA,CAAA,qBAAA;AAAA,IAAA,MAAA,EAAA,cAAA;;mBAE0C,IAAK,CAAA,EAAAF,sBAAA;AAAA,MAAAG,YAAA;AAAA,MAAA,IAAA;AAAA,MAAAC,cAAA,CAAA,IAAA,CAAA,WAAA,EAAA,CAAA,OAAA,EAAA,KAAA,KAAA;AAZjE,QAAA,OAAAL,aAAA,EAAA,EAAAM,eAAA;AAAA,UAAAC,2BAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA;AAAA,UAAAL,cAAA,CAAA;AAAA,YAegBM,GAAAA,EAAAA,KAAAA;AAAAA,YAAAA,OAAAA,EAAAA,IAAAA;AAfhB,WAAA,EAAA,IAAA,CAAA,cAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,UAAA,IAAA;AAAA,UAAA,EAAA;AAAA;AAAA,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
var _sfc_main = vue.defineComponent({
|
|
8
|
+
name: 'HugeiconsIcon',
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: {
|
|
11
|
+
icon: {
|
|
12
|
+
type: Array ,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
type: [Number, String],
|
|
17
|
+
default: 24,
|
|
18
|
+
validator(value) {
|
|
19
|
+
const size = typeof value === 'string' ? parseInt(value, 10) : value;
|
|
20
|
+
return !isNaN(size) && size > 0;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
strokeWidth: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: undefined
|
|
26
|
+
},
|
|
27
|
+
absoluteStrokeWidth: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
altIcon: {
|
|
32
|
+
type: Array ,
|
|
33
|
+
default: undefined
|
|
34
|
+
},
|
|
35
|
+
showAlt: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
color: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'currentColor'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
setup(props) {
|
|
45
|
+
const computedSize = vue.computed(() => {
|
|
46
|
+
const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;
|
|
47
|
+
return !isNaN(size) && size > 0 ? size : 24;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const calculatedStrokeWidth = vue.computed(() => {
|
|
51
|
+
if (props.strokeWidth === undefined) return undefined;
|
|
52
|
+
return props.absoluteStrokeWidth
|
|
53
|
+
? (props.strokeWidth * 24) / computedSize.value
|
|
54
|
+
: props.strokeWidth;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const currentIcon = vue.computed(() => {
|
|
58
|
+
return props.altIcon && props.showAlt ? props.altIcon : props.icon;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const transformAttrs = (attrs) => {
|
|
62
|
+
const result = { ...attrs };
|
|
63
|
+
if (result.fillRule) {
|
|
64
|
+
result['fill-rule'] = result.fillRule;
|
|
65
|
+
delete result.fillRule;
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
computedSize,
|
|
72
|
+
calculatedStrokeWidth,
|
|
73
|
+
transformAttrs,
|
|
74
|
+
currentIcon
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
exports.default = _sfc_main;
|
|
80
|
+
//# sourceMappingURL=HugeiconsIcon.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HugeiconsIcon.vue2.js","sources":["../../../src/components/HugeiconsIcon.vue"],"sourcesContent":["<template>\n <svg\n :width=\"computedSize\"\n :height=\"computedSize\"\n :viewBox=\"`0 0 24 24`\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n :color=\"color\"\n :stroke-width=\"calculatedStrokeWidth\"\n stroke=\"currentColor\"\n v-bind=\"$attrs\"\n >\n <template v-for=\"(element, index) in currentIcon\" :key=\"index\">\n <component\n :is=\"element[0]\"\n v-bind=\"transformAttrs(element[1])\"\n />\n </template>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType, computed } from 'vue';\n\nexport default defineComponent({\n name: 'HugeiconsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n required: true\n },\n size: {\n type: [Number, String],\n default: 24,\n validator(value: number | string) {\n const size = typeof value === 'string' ? parseInt(value, 10) : value;\n return !isNaN(size) && size > 0;\n }\n },\n strokeWidth: {\n type: Number,\n default: undefined\n },\n absoluteStrokeWidth: {\n type: Boolean,\n default: false\n },\n altIcon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n default: undefined\n },\n showAlt: {\n type: Boolean,\n default: false\n },\n color: {\n type: String,\n default: 'currentColor'\n }\n },\n setup(props) {\n const computedSize = computed(() => {\n const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;\n return !isNaN(size) && size > 0 ? size : 24;\n });\n\n const calculatedStrokeWidth = computed(() => {\n if (props.strokeWidth === undefined) return undefined;\n return props.absoluteStrokeWidth \n ? (props.strokeWidth * 24) / computedSize.value \n : props.strokeWidth;\n });\n\n const currentIcon = computed(() => {\n return props.altIcon && props.showAlt ? props.altIcon : props.icon;\n });\n\n const transformAttrs = (attrs: Record<string, any>) => {\n const result = { ...attrs };\n if (result.fillRule) {\n result['fill-rule'] = result.fillRule;\n delete result.fillRule;\n }\n return result;\n };\n\n return {\n computedSize,\n calculatedStrokeWidth,\n transformAttrs,\n currentIcon\n };\n }\n});\n</script> "],"names":["defineComponent","computed"],"mappings":";;;;;;AAwBA,gBAAeA,mBAAe,CAAC;AAC7B,EAAA,IAAI,EAAE,eAAe;AACrB,EAAA,YAAY,EAAE,KAAK;AACnB,EAAA,KAAK,EAAE;IACL,IAAI,EAAE;MACJ,IAAI,EAAE,KAAM;MACZ,QAAQ,EAAE,IAAA;KACX;IACD,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;MACtB,OAAO,EAAE,EAAE;AACX,MAAA,SAAS,CAAC,KAAK,EAAmB;QAChC,MAAM,IAAA,GAAO,OAAO,UAAU,QAAA,GAAW,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAA,GAAI,KAAK,CAAA;QACpE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAE,IAAG,IAAK,GAAE,CAAC,CAAA;AACjC,OAAA;KACD;IACD,WAAW,EAAE;MACX,IAAI,EAAE,MAAM;AACZ,MAAA,OAAO,EAAE,SAAA;KACV;AACD,IAAA,mBAAmB,EAAE;MACnB,IAAI,EAAE,OAAO;MACb,OAAO,EAAE,KAAA;KACV;AACD,IAAA,OAAO,EAAE;MACP,IAAI,EAAE,KAAM;AACZ,MAAA,OAAO,EAAE,SAAA;KACV;AACD,IAAA,OAAO,EAAE;MACP,IAAI,EAAE,OAAO;MACb,OAAO,EAAE,KAAA;KACV;AACD,IAAA,KA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BAAqB;AACrB,MAAA,cAAc;MACd,WAAA;KACD,CAAA;AACH,GAAA;AACF,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var HugeiconsIcon = require('./components/HugeiconsIcon.vue.js');
|
|
6
|
+
|
|
7
|
+
const HugeiconsPlugin = {
|
|
8
|
+
install: (app) => {
|
|
9
|
+
app.component('HugeiconsIcon', HugeiconsIcon.default);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.HugeiconsIcon = HugeiconsIcon.default;
|
|
14
|
+
exports.HugeiconsPlugin = HugeiconsPlugin;
|
|
15
|
+
exports.default = HugeiconsPlugin;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport HugeiconsIcon from './components/HugeiconsIcon.vue';\n\nexport { default as HugeiconsIcon } from './components/HugeiconsIcon.vue';\nexport * from './types';\n\nexport const HugeiconsPlugin = {\n install: (app: App) => {\n app.component('HugeiconsIcon', HugeiconsIcon);\n }\n};\n\nexport default HugeiconsPlugin; "],"names":["HugeiconsIcon"],"mappings":";;;;;;AAMO,MAAM,kBAAkB;AAC/B,EAAE,OAAO,EAAE,CAAC,GAAG,KAAU;AACzB,IAAI,GAAG,CAAC,SAAS,CAAC,eAAe,EAAEA,qBAAa,CAAC,CAAA;AACjD,GAAE;AACF;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _sfc_main from './HugeiconsIcon.vue2.js';
|
|
2
|
+
import { openBlock, createElementBlock, mergeProps, Fragment, renderList, createBlock, resolveDynamicComponent } from 'vue';
|
|
3
|
+
import _export_sfc from '../_virtual/_plugin-vue_export-helper.js';
|
|
4
|
+
|
|
5
|
+
const _hoisted_1 = ["width", "height", "color", "stroke-width"];
|
|
6
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7
|
+
return openBlock(), createElementBlock("svg", mergeProps({
|
|
8
|
+
width: _ctx.computedSize,
|
|
9
|
+
height: _ctx.computedSize,
|
|
10
|
+
viewBox: `0 0 24 24`,
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
fill: "none",
|
|
13
|
+
color: _ctx.color,
|
|
14
|
+
"stroke-width": _ctx.calculatedStrokeWidth,
|
|
15
|
+
stroke: "currentColor"
|
|
16
|
+
}, _ctx.$attrs), [
|
|
17
|
+
(openBlock(true), createElementBlock(
|
|
18
|
+
Fragment,
|
|
19
|
+
null,
|
|
20
|
+
renderList(_ctx.currentIcon, (element, index) => {
|
|
21
|
+
return openBlock(), createBlock(
|
|
22
|
+
resolveDynamicComponent(element[0]),
|
|
23
|
+
mergeProps({
|
|
24
|
+
key: index,
|
|
25
|
+
ref_for: true
|
|
26
|
+
}, _ctx.transformAttrs(element[1])),
|
|
27
|
+
null,
|
|
28
|
+
16
|
|
29
|
+
/* FULL_PROPS */
|
|
30
|
+
);
|
|
31
|
+
}),
|
|
32
|
+
128
|
|
33
|
+
/* KEYED_FRAGMENT */
|
|
34
|
+
))
|
|
35
|
+
], 16, _hoisted_1);
|
|
36
|
+
}
|
|
37
|
+
var HugeiconsIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/mac/Documents/Projects/Hugeicons/monorepo/hugeicons/packages/vue/src/components/HugeiconsIcon.vue"]]);
|
|
38
|
+
|
|
39
|
+
export { HugeiconsIcon as default };
|
|
40
|
+
//# sourceMappingURL=HugeiconsIcon.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HugeiconsIcon.vue.js","sources":["../../../src/components/HugeiconsIcon.vue"],"sourcesContent":["<template>\n <svg\n :width=\"computedSize\"\n :height=\"computedSize\"\n :viewBox=\"`0 0 24 24`\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n :color=\"color\"\n :stroke-width=\"calculatedStrokeWidth\"\n stroke=\"currentColor\"\n v-bind=\"$attrs\"\n >\n <template v-for=\"(element, index) in currentIcon\" :key=\"index\">\n <component\n :is=\"element[0]\"\n v-bind=\"transformAttrs(element[1])\"\n />\n </template>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType, computed } from 'vue';\n\nexport default defineComponent({\n name: 'HugeiconsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n required: true\n },\n size: {\n type: [Number, String],\n default: 24,\n validator(value: number | string) {\n const size = typeof value === 'string' ? parseInt(value, 10) : value;\n return !isNaN(size) && size > 0;\n }\n },\n strokeWidth: {\n type: Number,\n default: undefined\n },\n absoluteStrokeWidth: {\n type: Boolean,\n default: false\n },\n altIcon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n default: undefined\n },\n showAlt: {\n type: Boolean,\n default: false\n },\n color: {\n type: String,\n default: 'currentColor'\n }\n },\n setup(props) {\n const computedSize = computed(() => {\n const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;\n return !isNaN(size) && size > 0 ? size : 24;\n });\n\n const calculatedStrokeWidth = computed(() => {\n if (props.strokeWidth === undefined) return undefined;\n return props.absoluteStrokeWidth \n ? (props.strokeWidth * 24) / computedSize.value \n : props.strokeWidth;\n });\n\n const currentIcon = computed(() => {\n return props.altIcon && props.showAlt ? props.altIcon : props.icon;\n });\n\n const transformAttrs = (attrs: Record<string, any>) => {\n const result = { ...attrs };\n if (result.fillRule) {\n result['fill-rule'] = result.fillRule;\n delete result.fillRule;\n }\n return result;\n };\n\n return {\n computedSize,\n calculatedStrokeWidth,\n transformAttrs,\n currentIcon\n };\n }\n});\n</script> "],"names":["computedSize","_openBlock","_createElementBlock","_mergeProps","color","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","transformAttrs"],"mappings":";;;;;AAEU,SAAA,WAAA,CAAEA,IAAY,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;AACb,EAAA,OAAAC,SAAA,EAAc,EAAAC,kBAAA,CAAA,KAAA,EAAAC,UAAA,CAAA;AAAA,IACpB,OAAO,IAAE,CAAA,YAAA;AAAA,IACV,MAAM,EAAA,IAAA,CAAA,YAAA;AAAA,IACN,OAAK,EAAA,CAAA,SAAA,CAAA;AAAA,IACJ,KAAOC,EAAAA,4BAAAA;AAAAA,IACP,IAAA,EAAA,MAAA;AAAA,IACD,OAAM,IAAC,CAAA,KAAA;AAAA,IACO,cAAA,EAAA,IAAA,CAAA,qBAAA;AAAA,IAAA,MAAA,EAAA,cAAA;;eAE0C,IAAK,CAAA,EAAAF,kBAAA;AAAA,MAAAG,QAAA;AAAA,MAAA,IAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,WAAA,EAAA,CAAA,OAAA,EAAA,KAAA,KAAA;AAZjE,QAAA,OAAAL,SAAA,EAAA,EAAAM,WAAA;AAAA,UAAAC,uBAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA;AAAA,UAAAL,UAAA,CAAA;AAAA,YAegBM,GAAAA,EAAAA,KAAAA;AAAAA,YAAAA,OAAAA,EAAAA,IAAAA;AAfhB,WAAA,EAAA,IAAA,CAAA,cAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,UAAA,IAAA;AAAA,UAAA,EAAA;AAAA;AAAA,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent, computed } from 'vue';
|
|
2
|
+
|
|
3
|
+
var _sfc_main = defineComponent({
|
|
4
|
+
name: 'HugeiconsIcon',
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
props: {
|
|
7
|
+
icon: {
|
|
8
|
+
type: Array ,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
size: {
|
|
12
|
+
type: [Number, String],
|
|
13
|
+
default: 24,
|
|
14
|
+
validator(value) {
|
|
15
|
+
const size = typeof value === 'string' ? parseInt(value, 10) : value;
|
|
16
|
+
return !isNaN(size) && size > 0;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
strokeWidth: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: undefined
|
|
22
|
+
},
|
|
23
|
+
absoluteStrokeWidth: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
altIcon: {
|
|
28
|
+
type: Array ,
|
|
29
|
+
default: undefined
|
|
30
|
+
},
|
|
31
|
+
showAlt: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'currentColor'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(props) {
|
|
41
|
+
const computedSize = computed(() => {
|
|
42
|
+
const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;
|
|
43
|
+
return !isNaN(size) && size > 0 ? size : 24;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const calculatedStrokeWidth = computed(() => {
|
|
47
|
+
if (props.strokeWidth === undefined) return undefined;
|
|
48
|
+
return props.absoluteStrokeWidth
|
|
49
|
+
? (props.strokeWidth * 24) / computedSize.value
|
|
50
|
+
: props.strokeWidth;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const currentIcon = computed(() => {
|
|
54
|
+
return props.altIcon && props.showAlt ? props.altIcon : props.icon;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const transformAttrs = (attrs) => {
|
|
58
|
+
const result = { ...attrs };
|
|
59
|
+
if (result.fillRule) {
|
|
60
|
+
result['fill-rule'] = result.fillRule;
|
|
61
|
+
delete result.fillRule;
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
computedSize,
|
|
68
|
+
calculatedStrokeWidth,
|
|
69
|
+
transformAttrs,
|
|
70
|
+
currentIcon
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export { _sfc_main as default };
|
|
76
|
+
//# sourceMappingURL=HugeiconsIcon.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HugeiconsIcon.vue2.js","sources":["../../../src/components/HugeiconsIcon.vue"],"sourcesContent":["<template>\n <svg\n :width=\"computedSize\"\n :height=\"computedSize\"\n :viewBox=\"`0 0 24 24`\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n :color=\"color\"\n :stroke-width=\"calculatedStrokeWidth\"\n stroke=\"currentColor\"\n v-bind=\"$attrs\"\n >\n <template v-for=\"(element, index) in currentIcon\" :key=\"index\">\n <component\n :is=\"element[0]\"\n v-bind=\"transformAttrs(element[1])\"\n />\n </template>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType, computed } from 'vue';\n\nexport default defineComponent({\n name: 'HugeiconsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n required: true\n },\n size: {\n type: [Number, String],\n default: 24,\n validator(value: number | string) {\n const size = typeof value === 'string' ? parseInt(value, 10) : value;\n return !isNaN(size) && size > 0;\n }\n },\n strokeWidth: {\n type: Number,\n default: undefined\n },\n absoluteStrokeWidth: {\n type: Boolean,\n default: false\n },\n altIcon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n default: undefined\n },\n showAlt: {\n type: Boolean,\n default: false\n },\n color: {\n type: String,\n default: 'currentColor'\n }\n },\n setup(props) {\n const computedSize = computed(() => {\n const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;\n return !isNaN(size) && size > 0 ? size : 24;\n });\n\n const calculatedStrokeWidth = computed(() => {\n if (props.strokeWidth === undefined) return undefined;\n return props.absoluteStrokeWidth \n ? (props.strokeWidth * 24) / computedSize.value \n : props.strokeWidth;\n });\n\n const currentIcon = computed(() => {\n return props.altIcon && props.showAlt ? props.altIcon : props.icon;\n });\n\n const transformAttrs = (attrs: Record<string, any>) => {\n const result = { ...attrs };\n if (result.fillRule) {\n result['fill-rule'] = result.fillRule;\n delete result.fillRule;\n }\n return result;\n };\n\n return {\n computedSize,\n calculatedStrokeWidth,\n transformAttrs,\n currentIcon\n };\n }\n});\n</script> "],"names":[],"mappings":";;AAwBA,gBAAe,eAAe,CAAC;AAC7B,EAAA,IAAI,EAAE,eAAe;AACrB,EAAA,YAAY,EAAE,KAAK;AACnB,EAAA,KAAK,EAAE;IACL,IAAI,EAAE;MACJ,IAAI,EAAE,KAAM;MACZ,QAAQ,EAAE,IAAA;KACX;IACD,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;MACtB,OAAO,EAAE,EAAE;AACX,MAAA,SAAS,CAAC,KAAK,EAAmB;QAChC,MAAM,IAAA,GAAO,OAAO,UAAU,QAAA,GAAW,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAA,GAAI,KAAK,CAAA;QACpE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAE,IAAG,IAAK,GAAE,CAAC,CAAA;AACjC,OAAA;KACD;IACD,WAAW,EAAE;MACX,IAAI,EAAE,MAAM;AACZ,MAAA,OAAO,EAAE,SAAA;KACV;AACD,IAAA,mBAAmB,EAAE;MACnB,IAAI,EAAE,OAAO;MACb,OAAO,EAAE,KAAA;KACV;AACD,IAAA,OAAO,EAAE;MACP,IAAI,EAAE,KAAM;AACZ,MAAA,OAAO,EAAE,SAAA;KACV;AACD,IAAA,OAAO,EAAE;MACP,IAAI,EAAE,OA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AAED,IAAA,OAAO;MACL,YAAY;AACZ,MAAA,qBAAqB;AACrB,MAAA,cAAc;MACd,WAAA;KACD,CAAA;AACH,GAAA;AACF,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import HugeiconsIcon from './components/HugeiconsIcon.vue.js';
|
|
2
|
+
|
|
3
|
+
const HugeiconsPlugin = {
|
|
4
|
+
install: (app) => {
|
|
5
|
+
app.component('HugeiconsIcon', HugeiconsIcon);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { HugeiconsIcon, HugeiconsPlugin, HugeiconsPlugin as default };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport HugeiconsIcon from './components/HugeiconsIcon.vue';\n\nexport { default as HugeiconsIcon } from './components/HugeiconsIcon.vue';\nexport * from './types';\n\nexport const HugeiconsPlugin = {\n install: (app: App) => {\n app.component('HugeiconsIcon', HugeiconsIcon);\n }\n};\n\nexport default HugeiconsPlugin; "],"names":[],"mappings":";;AAMO,MAAM,kBAAkB;AAC/B,EAAE,OAAO,EAAE,CAAC,GAAG,KAAU;AACzB,IAAI,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,aAAa,CAAC,CAAA;AACjD,GAAE;AACF;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
export { default as HugeiconsIcon } from './components/HugeiconsIcon.vue';
|
|
3
|
+
export { IconArray, IconElement } from './types.js';
|
|
4
|
+
|
|
5
|
+
declare const HugeiconsPlugin: {
|
|
6
|
+
install: (app: App) => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { HugeiconsPlugin, HugeiconsPlugin as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HugeiconsVue={},e.Vue)}(this,(function(e,t){"use strict";var o=t.defineComponent({name:"HugeiconsIcon",inheritAttrs:!1,props:{icon:{type:Array,required:!0},size:{type:[Number,String],default:24,validator(e){const t="string"==typeof e?parseInt(e,10):e;return!isNaN(t)&&t>0}},strokeWidth:{type:Number,default:void 0},absoluteStrokeWidth:{type:Boolean,default:!1},altIcon:{type:Array,default:void 0},showAlt:{type:Boolean,default:!1},color:{type:String,default:"currentColor"}},setup(e){const o=t.computed((()=>{const t="string"==typeof e.size?parseInt(e.size,10):e.size;return!isNaN(t)&&t>0?t:24})),r=t.computed((()=>{if(void 0!==e.strokeWidth)return e.absoluteStrokeWidth?24*e.strokeWidth/o.value:e.strokeWidth})),n=t.computed((()=>e.altIcon&&e.showAlt?e.altIcon:e.icon));return{computedSize:o,calculatedStrokeWidth:r,transformAttrs:e=>{const t={...e};return t.fillRule&&(t["fill-rule"]=t.fillRule,delete t.fillRule),t},currentIcon:n}}});const r=["width","height","color","stroke-width"];var n=((e,t)=>{const o=e.__vccOpts||e;for(const[e,r]of t)o[e]=r;return o})(o,[["render",function(e,o,n,i,c,s){return t.openBlock(),t.createElementBlock("svg",t.mergeProps({width:e.computedSize,height:e.computedSize,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",color:e.color,"stroke-width":e.calculatedStrokeWidth,stroke:"currentColor"},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.currentIcon,((o,r)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o[0]),t.mergeProps({key:r,ref_for:!0},e.transformAttrs(o[1])),null,16)))),128))],16,r)}],["__file","/Users/mac/Documents/Projects/Hugeicons/monorepo/hugeicons/packages/vue/src/components/HugeiconsIcon.vue"]]);const i={install:e=>{e.component("HugeiconsIcon",n)}};e.HugeiconsIcon=n,e.HugeiconsPlugin=i,e.default=i,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/HugeiconsIcon.vue","../../src/index.ts"],"sourcesContent":["<template>\n <svg\n :width=\"computedSize\"\n :height=\"computedSize\"\n :viewBox=\"`0 0 24 24`\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n :color=\"color\"\n :stroke-width=\"calculatedStrokeWidth\"\n stroke=\"currentColor\"\n v-bind=\"$attrs\"\n >\n <template v-for=\"(element, index) in currentIcon\" :key=\"index\">\n <component\n :is=\"element[0]\"\n v-bind=\"transformAttrs(element[1])\"\n />\n </template>\n </svg>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType, computed } from 'vue';\n\nexport default defineComponent({\n name: 'HugeiconsIcon',\n inheritAttrs: false,\n props: {\n icon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n required: true\n },\n size: {\n type: [Number, String],\n default: 24,\n validator(value: number | string) {\n const size = typeof value === 'string' ? parseInt(value, 10) : value;\n return !isNaN(size) && size > 0;\n }\n },\n strokeWidth: {\n type: Number,\n default: undefined\n },\n absoluteStrokeWidth: {\n type: Boolean,\n default: false\n },\n altIcon: {\n type: Array as PropType<[string, Record<string, any>][]>,\n default: undefined\n },\n showAlt: {\n type: Boolean,\n default: false\n },\n color: {\n type: String,\n default: 'currentColor'\n }\n },\n setup(props) {\n const computedSize = computed(() => {\n const size = typeof props.size === 'string' ? parseInt(props.size, 10) : props.size;\n return !isNaN(size) && size > 0 ? size : 24;\n });\n\n const calculatedStrokeWidth = computed(() => {\n if (props.strokeWidth === undefined) return undefined;\n return props.absoluteStrokeWidth \n ? (props.strokeWidth * 24) / computedSize.value \n : props.strokeWidth;\n });\n\n const currentIcon = computed(() => {\n return props.altIcon && props.showAlt ? props.altIcon : props.icon;\n });\n\n const transformAttrs = (attrs: Record<string, any>) => {\n const result = { ...attrs };\n if (result.fillRule) {\n result['fill-rule'] = result.fillRule;\n delete result.fillRule;\n }\n return result;\n };\n\n return {\n computedSize,\n calculatedStrokeWidth,\n transformAttrs,\n currentIcon\n };\n }\n});\n</script> ","import type { App } from 'vue';\nimport HugeiconsIcon from './components/HugeiconsIcon.vue';\n\nexport { default as HugeiconsIcon } from './components/HugeiconsIcon.vue';\nexport * from './types';\n\nexport const HugeiconsPlugin = {\n install: (app: App) => {\n app.component('HugeiconsIcon', HugeiconsIcon);\n }\n};\n\nexport default HugeiconsPlugin; "],"names":["_sfc_main","defineComponent","name","inheritAttrs","props","icon","type","Array","required","size","Number","String","default","validator","value","parseInt","isNaN","strokeWidth","undefined","absoluteStrokeWidth","Boolean","altIcon","showAlt","color","setup","computedSize","computed","calculatedStrokeWidth","currentIcon","transformAttrs","attrs","result","fillRule","_cache","$props","$setup","$data","$options","_openBlock","_createElementBlock","_mergeProps","width","_ctx","height","viewBox","xmlns","fill","stroke","createElementBlock","_Fragment","Fragment","_renderList","element","index","_createBlock","createBlock","_resolveDynamicComponent","HugeiconsPlugin","install","app","component","HugeiconsIcon"],"mappings":"iRAwBA,IAAAA,EAAeC,kBAAgB,CAC7BC,KAAM,gBACNC,cAAc,EACdC,MAAO,CACLC,KAAM,CACJC,KAAMC,MACNC,UAAU,GAEZC,KAAM,CACJH,KAAM,CAACI,OAAQC,QACfC,QAAS,GACT,SAAAC,CAAUC,GACR,MAAML,EAAwB,iBAAVK,EAAqBC,SAASD,EAAO,IAAMA,EAC/D,OAAQE,MAAMP,IAASA,EAAO,CAChC,GAEFQ,YAAa,CACXX,KAAMI,OACNE,aAASM,GAEXC,oBAAqB,CACnBb,KAAMc,QACNR,SAAS,GAEXS,QAAS,CACPf,KAAMC,MACNK,aAASM,GAEXI,QAAS,CACPhB,KAAMc,QACNR,SAAS,GAEXW,MAAO,CACLjB,KAAMK,OACNC,QAAS,iBAGb,KAAAY,CAAMpB,GACJ,MAAMqB,EAAeC,EAAAA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library https://hugeicons.com",
|
|
5
|
+
"homepage": "https://hugeicons.com",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"unpkg": "./dist/umd/index.js",
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"import": "./dist/esm/index.js",
|
|
18
|
+
"require": "./dist/cjs/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@rollup/plugin-commonjs": "^25.0.8",
|
|
23
|
+
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
24
|
+
"@rollup/plugin-sucrase": "^5.0.2",
|
|
25
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
26
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
27
|
+
"@types/node": "^20.0.0",
|
|
28
|
+
"@vitejs/plugin-vue": "^4.6.2",
|
|
29
|
+
"@vue/compiler-sfc": "^3.5.13",
|
|
30
|
+
"rollup": "^3.0.0",
|
|
31
|
+
"rollup-plugin-dts": "^5.3.1",
|
|
32
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
33
|
+
"tslib": "^2.6.0",
|
|
34
|
+
"typescript": "^5.7.3",
|
|
35
|
+
"vue": "^3.5.13"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"vue": "^2.6.0 || ^3.0.0"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"icons",
|
|
42
|
+
"vue-icons",
|
|
43
|
+
"ui-components",
|
|
44
|
+
"design-system",
|
|
45
|
+
"vector-icons",
|
|
46
|
+
"vue-component-library",
|
|
47
|
+
"web-icons",
|
|
48
|
+
"scalable-icons",
|
|
49
|
+
"customizable-icons",
|
|
50
|
+
"icon-library"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "pnpm clean && pnpm typecheck && pnpm build:bundles",
|
|
54
|
+
"build:bundles": "rollup -c ./rollup.config.mjs",
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"clean": "rm -rf dist"
|
|
57
|
+
}
|
|
58
|
+
}
|