@hugeicons/svelte 1.0.3 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,6 +1,27 @@
1
1
  # @hugeicons/svelte
2
2
 
3
3
 
4
+ ## 1.1.1
5
+
6
+ ### Patch Changes
7
+
8
+ - Added postinstall script to display welcome message and encourage community engagement
9
+ - Included scripts directory in published package files
10
+
11
+ ## 1.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - Added full SVG props support - component now accepts all standard SVG attributes and event handlers
16
+ - Added support for accessibility attributes (aria-label, aria-hidden, role, etc.)
17
+ - Added support for event handlers (onclick, onmouseenter, etc.)
18
+ - Props interface now extends SVGAttributes<SVGSVGElement> for full TypeScript support
19
+ - Added `prepare` script to auto-generate .svelte-kit/ directory after install
20
+
21
+ ### Deprecations
22
+
23
+ - `className` prop is deprecated - use `class` instead (both work for backward compatibility)
24
+
4
25
  ## 1.0.3
5
26
 
6
27
  ### Patch Changes
@@ -2,8 +2,9 @@
2
2
  import { onMount } from 'svelte';
3
3
  import type { IconSvgElement, HugeiconsProps } from '../create-hugeicon-singleton';
4
4
  import { createHugeiconSingleton } from '../create-hugeicon-singleton';
5
+ import type { SVGAttributes } from 'svelte/elements';
5
6
 
6
- interface Props {
7
+ interface Props extends SVGAttributes<SVGSVGElement> {
7
8
  icon: IconSvgElement;
8
9
  altIcon?: IconSvgElement;
9
10
  size?: string | number;
@@ -11,6 +12,10 @@
11
12
  absoluteStrokeWidth?: boolean;
12
13
  color?: string;
13
14
  showAlt?: boolean;
15
+ class?: string;
16
+ /**
17
+ * @deprecated Use `class` prop instead. This prop will be removed in a future version.
18
+ */
14
19
  className?: string;
15
20
  }
16
21
 
@@ -22,9 +27,14 @@
22
27
  absoluteStrokeWidth = false,
23
28
  color = 'currentColor',
24
29
  showAlt = false,
25
- className = ''
30
+ class: className = '',
31
+ className: legacyClassName = '',
32
+ ...restProps
26
33
  }: Props = $props();
27
34
 
35
+ // merge class and className for backward compatibility
36
+ const finalClassName = $derived(className || legacyClassName);
37
+
28
38
  let svgElement: SVGSVGElement;
29
39
  let hugeiconAction = $state<ReturnType<typeof createHugeiconSingleton>>();
30
40
  let cleanup = $state<{ update: (props: HugeiconsProps) => void; destroy: () => void }>();
@@ -36,7 +46,7 @@
36
46
  color,
37
47
  altIcon,
38
48
  showAlt,
39
- class: className
49
+ class: finalClassName
40
50
  });
41
51
 
42
52
  onMount(() => {
@@ -57,14 +67,15 @@
57
67
  });
58
68
  </script>
59
69
 
60
- <svg
70
+ <svg
61
71
  bind:this={svgElement}
62
72
  xmlns="http://www.w3.org/2000/svg"
63
73
  width={size}
64
74
  height={size}
65
75
  viewBox="0 0 24 24"
66
76
  fill="none"
67
- class={className}
77
+ class={finalClassName}
78
+ {...restProps}
68
79
  >
69
80
  <!-- SVG content will be managed by the action -->
70
81
  </svg>
@@ -1,5 +1,6 @@
1
1
  import type { IconSvgElement } from '../create-hugeicon-singleton';
2
- interface Props {
2
+ import type { SVGAttributes } from 'svelte/elements';
3
+ interface Props extends SVGAttributes<SVGSVGElement> {
3
4
  icon: IconSvgElement;
4
5
  altIcon?: IconSvgElement;
5
6
  size?: string | number;
@@ -7,6 +8,10 @@ interface Props {
7
8
  absoluteStrokeWidth?: boolean;
8
9
  color?: string;
9
10
  showAlt?: boolean;
11
+ class?: string;
12
+ /**
13
+ * @deprecated Use `class` prop instead. This prop will be removed in a future version.
14
+ */
10
15
  className?: string;
11
16
  }
12
17
  declare const HugeiconsIcon: import("svelte").Component<Props, {}, "">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hugeicons/svelte",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "Hugeicons Svelte Component Library https://hugeicons.com",
5
5
  "homepage": "https://hugeicons.com",
6
6
  "license": "MIT",
@@ -20,6 +20,7 @@
20
20
  "sideEffects": false,
21
21
  "files": [
22
22
  "dist",
23
+ "scripts",
23
24
  "CHANGELOG.md",
24
25
  "LICENSE.md",
25
26
  "PRO-LICENSE.md",
@@ -33,10 +34,12 @@
33
34
  "url": "https://github.com/hugeicons/svelte/issues"
34
35
  },
35
36
  "scripts": {
37
+ "prepare": "svelte-kit sync",
36
38
  "build": "vite build && pnpm run package",
37
39
  "package": "svelte-kit sync && svelte-package",
38
40
  "check": "svelte-check --tsconfig ./tsconfig.json",
39
41
  "prepublishOnly": "pnpm run build",
42
+ "postinstall": "node ./scripts/postinstall.cjs",
40
43
  "publish:beta": "pnpm build && npm publish --tag beta --no-git-checks",
41
44
  "publish:prod": "pnpm build && npm publish --no-git-checks"
42
45
  },
@@ -0,0 +1,29 @@
1
+ /* eslint-disable no-console */
2
+
3
+ const ANSI = {
4
+ reset: '\x1b[0m',
5
+ bold: '\x1b[1m',
6
+ cyan: '\x1b[36m',
7
+ };
8
+
9
+ const bold = (s) => `${ANSI.bold}${s}${ANSI.reset}`;
10
+ const cyan = (s) => `${ANSI.cyan}${s}${ANSI.reset}`;
11
+
12
+ const pkg = bold('@hugeicons/svelte');
13
+ const repoUrl = cyan('https://github.com/hugeicons/svelte');
14
+
15
+
16
+ const lines = [
17
+ '',
18
+ `Thanks for installing ${pkg}!`,
19
+ '',
20
+ 'If you love Hugeicons, please consider starring ⭐ the repo:',
21
+ '',
22
+ repoUrl,
23
+ '',
24
+ 'Happy building!',
25
+ '',
26
+ ];
27
+
28
+ console.log(lines.join('\n'));
29
+