@hugeicons/svelte 1.0.2 → 1.0.3

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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # @hugeicons/svelte
2
+
3
+
4
+ ## 1.0.3
5
+
6
+ ### Patch Changes
7
+
8
+ - Added "How It Works" section explaining the rendering library concept
9
+ - Standardized documentation structure across all framework packages
10
+ - Updated icon counts to 4,600+ free / 46,000+ pro
11
+ - Updated docs URL to hugeicons.com/docs
12
+
13
+ ## 1.0.0
14
+
15
+ ### Major Changes
16
+
17
+ - Initial release
18
+ - Basic icon rendering functionality
19
+ - Support for customization (size, color, alternate icons)
20
+ - Full TypeScript support
21
+ - Svelte 5 runes support
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Hugeicons
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/PRO-LICENSE.md ADDED
@@ -0,0 +1,14 @@
1
+ # Hugeicons Pro License
2
+
3
+ **Full license:** https://hugeicons.com/license-agreement
4
+
5
+ ## Summary
6
+
7
+ Pro icon packs (`@hugeicons-pro/*`) require a valid Hugeicons Pro license.
8
+
9
+ * One seat per user who directly uses and accesses icons
10
+ * Cannot redistribute source files (License Key, SVG, fonts, Figma files, etc.—see the license for details)
11
+ * Cannot create competing icon products
12
+ * See more in the license page
13
+
14
+ For complete terms, seats, refunds, and legal details, see the full license above.
package/README.md CHANGED
@@ -1,25 +1,36 @@
1
- ![31c9262e-aeea-4403-9086-3c8b88885cab](https://github.com/hugeicons/hugeicons-react/assets/130147052/ff91f2f0-095a-4c6d-8942-3af4759f9021)
1
+ ![Hugeicons Logo](https://raw.githubusercontent.com/hugeicons/react/main/assets/logo.png)
2
2
 
3
3
  # @hugeicons/svelte
4
4
 
5
- > HugeIcons Pro Svelte Component Library - Beautiful and customizable icons for your Svelte applications
5
+ > Hugeicons Svelte rendering library for fast, customizable icons with TypeScript and tree-shaking support
6
6
 
7
- ## What is HugeIcons?
7
+ ## What is Hugeicons?
8
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.
9
+ Hugeicons is a large icon set for modern web and mobile apps. The free package includes 4,600+ Stroke Rounded icons. The Pro package provides 46,000+ icons across 10 styles.
10
+
11
+ ## How It Works
12
+
13
+ This package (`@hugeicons/svelte`) is a **rendering library** - it provides the `HugeiconsIcon` component that displays icons in your Svelte app. The icons themselves come from separate icon packages:
14
+
15
+ - **Free icons**: `@hugeicons/core-free-icons` (4,600+ icons)
16
+ - **Pro icons**: `@hugeicons-pro/core-*` packages (46,000+ icons, requires license)
10
17
 
11
18
  ### 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
19
+ - **4,600+ Free Icons**: Stroke Rounded set for unlimited personal and commercial projects
20
+ - **46,000+ Pro Icons, 10 Styles**: Stroke, Solid, Bulk, Duotone, and Twotone families for sharp, rounded, and standard needs with richer variants
21
+ - **Pixel Perfect Grid**: Built on a 24x24 grid for crisp rendering at any size
14
22
  - **Customizable**: Easily adjust colors, sizes, and styles to match your design needs
23
+ - **Tree Shaking Ready**: Named exports keep bundles lean in modern bundlers
15
24
  - **Regular Updates**: New icons added regularly to keep up with evolving design trends
16
25
 
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
26
 
19
- ![a40aa766-1b04-4a2a-a2e6-0ec3c492b96a](https://github.com/hugeicons/hugeicons-react/assets/130147052/f82c0e0e-60ae-4617-802f-812cdc7a58da)
27
+ > **Looking for Pro Icons?** Check out our docs at [hugeicons.com/docs](https://hugeicons.com/docs) for detailed information about pro icons, styles, and advanced usage.
28
+
29
+ ![Hugeicons Icons](https://raw.githubusercontent.com/hugeicons/react/main/assets/icons.png)
20
30
 
21
31
  ## Table of Contents
22
- - [What is HugeIcons?](#what-is-hugeicons)
32
+ - [What is Hugeicons?](#what-is-hugeicons)
33
+ - [How It Works](#how-it-works)
23
34
  - [Features](#features)
24
35
  - [Installation](#installation)
25
36
  - [Usage](#usage)
@@ -27,7 +38,7 @@ HugeIcons is a comprehensive icon library designed for modern web and mobile app
27
38
  - [Examples](#examples)
28
39
  - [Basic Usage](#basic-usage)
29
40
  - [Custom Size and Color](#custom-size-and-color)
30
- - [Interactive Examples](#interactive-examples)
41
+ - [More examples and patterns](#more-examples-and-patterns)
31
42
  - [Performance](#performance)
32
43
  - [Troubleshooting](#troubleshooting)
33
44
  - [Browser Support](#browser-support)
@@ -38,12 +49,12 @@ HugeIcons is a comprehensive icon library designed for modern web and mobile app
38
49
 
39
50
  ## Features
40
51
 
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
52
+ - Customizable colors, sizes, and stroke width
53
+ - TypeScript support with full type definitions
54
+ - Tree shakeable for optimal bundle size
55
+ - Multiple bundle formats (ESM, CJS, UMD)
56
+ - Svelte 5 with runes support
57
+ - Alternate icon support for dynamic interactions
47
58
 
48
59
  ## Installation
49
60
 
@@ -81,14 +92,14 @@ bun add @hugeicons/svelte @hugeicons/core-free-icons
81
92
 
82
93
  | Prop | Type | Default | Description |
83
94
  |------|------|---------|-------------|
84
- | `icon` | `IconType` | Required | The main icon to display |
85
- | `altIcon` | `IconType` | - | Alternative icon that can be used for states, interactions, animations, or dynamic icon swapping |
95
+ | `icon` | `IconSvgElement` | Required | The main icon to display |
96
+ | `altIcon` | `IconSvgElement` | - | Alternative icon for states, interactions, or dynamic icon swapping |
86
97
  | `showAlt` | `boolean` | `false` | When true, displays the altIcon instead of the main icon |
87
- | `size` | `number` | `24` | Icon size in pixels |
98
+ | `size` | `number \| string` | `24` | Icon size in pixels |
88
99
  | `color` | `string` | `currentColor` | Icon color (CSS color value) |
89
- | `strokeWidth` | `number` | `1.5` | Width of the icon strokes (works with stroke-style icons) |
90
- | `absoluteStrokeWidth` | `boolean` | `false` | When true, strokeWidth will be absolute and won't scale with the icon size |
91
- | `class` | `string` | - | Additional CSS classes |
100
+ | `strokeWidth` | `number` | - | Width of the icon strokes |
101
+ | `absoluteStrokeWidth` | `boolean` | `false` | When true, the stroke width will be scaled relative to the icon size |
102
+ | `className` | `string` | - | Additional CSS classes |
92
103
 
93
104
  ## Examples
94
105
 
@@ -96,10 +107,10 @@ bun add @hugeicons/svelte @hugeicons/core-free-icons
96
107
  ```svelte
97
108
  <script>
98
109
  import { HugeiconsIcon } from '@hugeicons/svelte';
99
- import { SearchIcon } from '@hugeicons/core-free-icons';
110
+ import { Video01Icon } from '@hugeicons/core-free-icons';
100
111
  </script>
101
112
 
102
- <HugeiconsIcon icon={SearchIcon} />
113
+ <HugeiconsIcon icon={Video01Icon} />
103
114
  ```
104
115
 
105
116
  ### Custom Size and Color
@@ -116,67 +127,10 @@ bun add @hugeicons/svelte @hugeicons/core-free-icons
116
127
  />
117
128
  ```
118
129
 
119
- ### Interactive Examples
120
-
121
- #### Search Bar with Clear Button
122
- ```svelte
123
- <script>
124
- import { HugeiconsIcon } from '@hugeicons/svelte';
125
- import { SearchIcon, CloseCircleIcon } from '@hugeicons/core-free-icons';
126
-
127
- let value = '';
128
- </script>
129
-
130
- <div>
131
- <input
132
- type="text"
133
- bind:value
134
- placeholder="Search..."
135
- />
136
- <HugeiconsIcon
137
- icon={SearchIcon}
138
- altIcon={CloseCircleIcon}
139
- showAlt={value.length > 0}
140
- on:click={() => value.length > 0 && (value = '')}
141
- />
142
- </div>
143
- ```
144
-
145
- #### Theme Toggle
146
- ```svelte
147
- <script>
148
- import { HugeiconsIcon } from '@hugeicons/svelte';
149
- import { SunIcon, MoonIcon } from '@hugeicons/core-free-icons';
150
-
151
- let isDark = false;
152
- </script>
153
-
154
- <button on:click={() => isDark = !isDark}>
155
- <HugeiconsIcon
156
- icon={SunIcon}
157
- altIcon={MoonIcon}
158
- showAlt={isDark}
159
- />
160
- </button>
161
- ```
162
-
163
- #### Menu Toggle
164
- ```svelte
165
- <script>
166
- import { HugeiconsIcon } from '@hugeicons/svelte';
167
- import { MenuIcon, CancelIcon } from '@hugeicons/core-free-icons';
168
-
169
- let isOpen = false;
170
- </script>
130
+ ### More examples and patterns
171
131
 
172
- <button on:click={() => isOpen = !isOpen}>
173
- <HugeiconsIcon
174
- icon={MenuIcon}
175
- altIcon={CancelIcon}
176
- showAlt={isOpen}
177
- />
178
- </button>
179
- ```
132
+ - Examples: https://hugeicons.com/docs/integrations/svelte/examples
133
+ - Best practices: https://hugeicons.com/docs/integrations/svelte/best-practices
180
134
 
181
135
  ## Performance
182
136
 
@@ -213,8 +167,8 @@ The library supports all modern browsers.
213
167
 
214
168
  ## Pro Version
215
169
 
216
- > 🌟 **Want access to 36,000+ icons and 9 unique styles?**
217
- > Check out our [Pro Version](https://hugeicons.com/pricing) and visit [docs.hugeicons.com](https://docs.hugeicons.com) for comprehensive documentation.
170
+ > **Want access to 46,000+ icons and 10 unique styles?**
171
+ > Check out our [Pro Version](https://hugeicons.com/pricing) and visit our [docs](https://hugeicons.com/docs) for detailed documentation.
218
172
 
219
173
  ### Available Pro Styles
220
174
  - **Stroke Styles**
@@ -228,13 +182,22 @@ The library supports all modern browsers.
228
182
  - **Special Styles**
229
183
  - Bulk Rounded (`@hugeicons-pro/core-bulk-rounded`)
230
184
  - Duotone Rounded (`@hugeicons-pro/core-duotone-rounded`)
185
+ - Duotone Standard (`@hugeicons-pro/core-duotone-standard`)
231
186
  - Twotone Rounded (`@hugeicons-pro/core-twotone-rounded`)
232
187
 
233
188
  ## License
234
189
 
235
- This project is licensed under the [MIT License](LICENSE.md).
190
+ The code in this package (`@hugeicons/svelte`) is licensed under the MIT License.
191
+
192
+ This package only provides rendering utilities. It does not include or grant any rights to Hugeicons icon assets. Using Pro icon styles requires a valid Hugeicons Pro license.
193
+
194
+ Hugeicons icon packs are licensed separately:
195
+ - **Free icon packs**: use the license included with the specific free icon package you install.
196
+ - **Pro icon packs (`@hugeicons-pro/*`)**: require a paid Hugeicons Pro license and are governed by the Hugeicons Pro Terms (see [Pro License](PRO-LICENSE.md).).
197
+
236
198
 
237
199
  ## Related
238
200
 
201
+ - [Changelog](CHANGELOG.md) - Version history and release notes
239
202
  - [@hugeicons/core-free-icons](https://www.npmjs.com/package/@hugeicons/core-free-icons) - Free icon package
240
- - [HugeIcons Website](https://hugeicons.com) - Browse all available icons
203
+ - [Hugeicons Website](https://hugeicons.com) - Browse all available icons
@@ -1,42 +1,70 @@
1
- <script lang="ts">import { onMount } from 'svelte';
2
- import { createHugeiconSingleton } from '../create-hugeicon-singleton';
3
- let props = $props();
4
- let svgElement;
5
- let hugeiconAction = $state();
6
- let cleanup = $state();
7
- const propsForUpdate = $derived({
8
- size: props.size ?? 24,
9
- strokeWidth: props.strokeWidth,
10
- absoluteStrokeWidth: props.absoluteStrokeWidth ?? false,
11
- color: props.color ?? 'currentColor',
12
- altIcon: props.altIcon,
13
- showAlt: props.showAlt ?? false,
14
- class: props.className ?? ''
15
- });
16
- onMount(() => {
17
- if (!svgElement)
18
- return;
19
- hugeiconAction = createHugeiconSingleton('HugeiconsIcon', props.icon);
20
- cleanup = hugeiconAction.render(svgElement, propsForUpdate);
21
- return () => {
22
- cleanup?.destroy();
23
- };
24
- });
25
- $effect(() => {
26
- if (hugeiconAction && svgElement && cleanup) {
27
- cleanup.update(propsForUpdate);
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import type { IconSvgElement, HugeiconsProps } from '../create-hugeicon-singleton';
4
+ import { createHugeiconSingleton } from '../create-hugeicon-singleton';
5
+
6
+ interface Props {
7
+ icon: IconSvgElement;
8
+ altIcon?: IconSvgElement;
9
+ size?: string | number;
10
+ strokeWidth?: number;
11
+ absoluteStrokeWidth?: boolean;
12
+ color?: string;
13
+ showAlt?: boolean;
14
+ className?: string;
28
15
  }
29
- });
16
+
17
+ let {
18
+ icon,
19
+ altIcon,
20
+ size = 24,
21
+ strokeWidth,
22
+ absoluteStrokeWidth = false,
23
+ color = 'currentColor',
24
+ showAlt = false,
25
+ className = ''
26
+ }: Props = $props();
27
+
28
+ let svgElement: SVGSVGElement;
29
+ let hugeiconAction = $state<ReturnType<typeof createHugeiconSingleton>>();
30
+ let cleanup = $state<{ update: (props: HugeiconsProps) => void; destroy: () => void }>();
31
+
32
+ const propsForUpdate = $derived({
33
+ size,
34
+ strokeWidth,
35
+ absoluteStrokeWidth,
36
+ color,
37
+ altIcon,
38
+ showAlt,
39
+ class: className
40
+ });
41
+
42
+ onMount(() => {
43
+ if (!svgElement) return;
44
+
45
+ hugeiconAction = createHugeiconSingleton('HugeiconsIcon', icon);
46
+ cleanup = hugeiconAction.render(svgElement, propsForUpdate);
47
+
48
+ return () => {
49
+ cleanup?.destroy();
50
+ };
51
+ });
52
+
53
+ $effect(() => {
54
+ if (hugeiconAction && svgElement && cleanup) {
55
+ cleanup.update(propsForUpdate);
56
+ }
57
+ });
30
58
  </script>
31
59
 
32
60
  <svg
33
61
  bind:this={svgElement}
34
62
  xmlns="http://www.w3.org/2000/svg"
35
- width={props.size ?? 24}
36
- height={props.size ?? 24}
63
+ width={size}
64
+ height={size}
37
65
  viewBox="0 0 24 24"
38
66
  fill="none"
39
- class={props.className}
67
+ class={className}
40
68
  >
41
69
  <!-- SVG content will be managed by the action -->
42
- </svg>
70
+ </svg>
@@ -1,5 +1,5 @@
1
1
  import type { IconSvgElement } from '../create-hugeicon-singleton';
2
- type $$ComponentProps = {
2
+ interface Props {
3
3
  icon: IconSvgElement;
4
4
  altIcon?: IconSvgElement;
5
5
  size?: string | number;
@@ -8,7 +8,7 @@ type $$ComponentProps = {
8
8
  color?: string;
9
9
  showAlt?: boolean;
10
10
  className?: string;
11
- };
12
- declare const HugeiconsIcon: import("svelte").Component<$$ComponentProps, {}, "">;
11
+ }
12
+ declare const HugeiconsIcon: import("svelte").Component<Props, {}, "">;
13
13
  type HugeiconsIcon = ReturnType<typeof HugeiconsIcon>;
14
14
  export default HugeiconsIcon;
@@ -1,10 +1,3 @@
1
- const defaultAttributes = {
2
- xmlns: 'http://www.w3.org/2000/svg',
3
- width: 24,
4
- height: 24,
5
- viewBox: '0 0 24 24',
6
- fill: 'none',
7
- };
8
1
  const camelToKebab = (str) => {
9
2
  return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
10
3
  };
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@hugeicons/svelte",
3
- "version": "1.0.2",
4
- "description": "Hugeicons component library for Svelte",
3
+ "version": "1.0.3",
4
+ "description": "Hugeicons Svelte Component Library https://hugeicons.com",
5
+ "homepage": "https://hugeicons.com",
6
+ "license": "MIT",
5
7
  "type": "module",
6
8
  "main": "./dist/index.umd.js",
7
9
  "module": "./dist/index.es.js",
@@ -10,42 +12,59 @@
10
12
  "exports": {
11
13
  ".": {
12
14
  "types": "./dist/index.d.ts",
15
+ "svelte": "./dist/index.js",
13
16
  "import": "./dist/index.js",
14
- "require": "./dist/index.umd.js",
15
- "svelte": "./dist/index.js"
17
+ "require": "./dist/index.umd.js"
16
18
  }
17
19
  },
20
+ "sideEffects": false,
18
21
  "files": [
19
- "dist"
22
+ "dist",
23
+ "CHANGELOG.md",
24
+ "LICENSE.md",
25
+ "PRO-LICENSE.md",
26
+ "README.md"
20
27
  ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/hugeicons/svelte.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/hugeicons/svelte/issues"
34
+ },
21
35
  "scripts": {
22
36
  "build": "vite build && pnpm run package",
23
37
  "package": "svelte-kit sync && svelte-package",
24
38
  "check": "svelte-check --tsconfig ./tsconfig.json",
25
- "prepublishOnly": "pnpm run build"
39
+ "prepublishOnly": "pnpm run build",
40
+ "publish:beta": "pnpm build && npm publish --tag beta --no-git-checks",
41
+ "publish:prod": "pnpm build && npm publish --no-git-checks"
26
42
  },
27
43
  "peerDependencies": {
28
44
  "svelte": "^5.0.0"
29
45
  },
30
46
  "devDependencies": {
31
47
  "@sveltejs/adapter-auto": "^4.0.0",
32
- "@sveltejs/kit": "^2.0.0",
33
- "@sveltejs/package": "^2.2.5",
34
- "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
35
- "@tsconfig/svelte": "^5.0.2",
48
+ "@sveltejs/kit": "^2.15.0",
49
+ "@sveltejs/package": "^2.3.0",
50
+ "@sveltejs/vite-plugin-svelte": "^5.0.0",
51
+ "@tsconfig/svelte": "^5.0.4",
36
52
  "svelte": "^5.0.0",
37
- "svelte-check": "^3.6.3",
38
- "svelte-preprocess": "^6.0.3",
39
- "tslib": "^2.6.2",
40
- "typescript": "^5.3.3",
41
- "vite": "^5.0.10"
53
+ "svelte-check": "^4.0.0",
54
+ "tslib": "^2.8.0",
55
+ "typescript": "^5.7.0",
56
+ "vite": "^6.0.0"
42
57
  },
43
58
  "keywords": [
59
+ "hugeicons",
44
60
  "svelte",
45
61
  "icons",
46
- "hugeicons",
47
- "components"
62
+ "svelte-icons",
63
+ "svg-icons",
64
+ "svg",
65
+ "vector-icons",
66
+ "icon-library",
67
+ "typescript"
48
68
  ],
49
- "author": "Hugeicons",
50
- "license": "MIT"
51
- }
69
+ "author": "Hugeicons"
70
+ }