viconic-react-icons 1.0.6 → 1.0.7
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/dist/index.js +8 -3
- package/dist/index.mjs +8 -3
- package/index.d.ts +6 -0
- package/package.json +1 -1
- package/src/index.jsx +9 -3
package/dist/index.js
CHANGED
|
@@ -1934,20 +1934,25 @@ var import_react = __toESM(require("react"));
|
|
|
1934
1934
|
})();
|
|
1935
1935
|
|
|
1936
1936
|
// src/index.jsx
|
|
1937
|
-
var ViconicIcon = ({ name, className, style, ...props }) => {
|
|
1937
|
+
var ViconicIcon = ({ name, className, style, size, color, ...props }) => {
|
|
1938
1938
|
const iconRef = (0, import_react.useRef)(null);
|
|
1939
1939
|
(0, import_react.useEffect)(() => {
|
|
1940
1940
|
if (window.CopyIcons && iconRef.current) {
|
|
1941
1941
|
window.CopyIcons.forceProcess(iconRef.current);
|
|
1942
1942
|
}
|
|
1943
|
-
}, [name, className]);
|
|
1943
|
+
}, [name, className, size, color, style]);
|
|
1944
|
+
const combinedStyle = {
|
|
1945
|
+
...size ? { fontSize: size } : {},
|
|
1946
|
+
...color ? { color } : {},
|
|
1947
|
+
...style
|
|
1948
|
+
};
|
|
1944
1949
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
1945
1950
|
"viconic-icon",
|
|
1946
1951
|
{
|
|
1947
1952
|
ref: iconRef,
|
|
1948
1953
|
icon: name,
|
|
1949
1954
|
class: className,
|
|
1950
|
-
style,
|
|
1955
|
+
style: combinedStyle,
|
|
1951
1956
|
...props
|
|
1952
1957
|
}
|
|
1953
1958
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -1900,20 +1900,25 @@ import React, { useEffect, useRef } from "react";
|
|
|
1900
1900
|
})();
|
|
1901
1901
|
|
|
1902
1902
|
// src/index.jsx
|
|
1903
|
-
var ViconicIcon = ({ name, className, style, ...props }) => {
|
|
1903
|
+
var ViconicIcon = ({ name, className, style, size, color, ...props }) => {
|
|
1904
1904
|
const iconRef = useRef(null);
|
|
1905
1905
|
useEffect(() => {
|
|
1906
1906
|
if (window.CopyIcons && iconRef.current) {
|
|
1907
1907
|
window.CopyIcons.forceProcess(iconRef.current);
|
|
1908
1908
|
}
|
|
1909
|
-
}, [name, className]);
|
|
1909
|
+
}, [name, className, size, color, style]);
|
|
1910
|
+
const combinedStyle = {
|
|
1911
|
+
...size ? { fontSize: size } : {},
|
|
1912
|
+
...color ? { color } : {},
|
|
1913
|
+
...style
|
|
1914
|
+
};
|
|
1910
1915
|
return /* @__PURE__ */ React.createElement(
|
|
1911
1916
|
"viconic-icon",
|
|
1912
1917
|
{
|
|
1913
1918
|
ref: iconRef,
|
|
1914
1919
|
icon: name,
|
|
1915
1920
|
class: className,
|
|
1916
|
-
style,
|
|
1921
|
+
style: combinedStyle,
|
|
1917
1922
|
...props
|
|
1918
1923
|
}
|
|
1919
1924
|
);
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,12 @@ export interface ViconicIconProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
4
4
|
/** The unique icon ID (e.g., 'lucide:activity', 'h2:0'). Required. */
|
|
5
5
|
name: string;
|
|
6
6
|
|
|
7
|
+
/** Optional icon size, CSS format (e.g., '24px', '1.5rem'). Translates to style.fontSize */
|
|
8
|
+
size?: string | number;
|
|
9
|
+
|
|
10
|
+
/** Optional icon color, CSS color value. Translates to style.color */
|
|
11
|
+
color?: string;
|
|
12
|
+
|
|
7
13
|
style?: React.CSSProperties;
|
|
8
14
|
}
|
|
9
15
|
|
package/package.json
CHANGED
package/src/index.jsx
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import './copyicons-smart-loader.js';
|
|
3
3
|
|
|
4
|
-
export const ViconicIcon = ({ name, className, style, ...props }) => {
|
|
4
|
+
export const ViconicIcon = ({ name, className, style, size, color, ...props }) => {
|
|
5
5
|
const iconRef = useRef(null);
|
|
6
6
|
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
if (window.CopyIcons && iconRef.current) {
|
|
9
9
|
window.CopyIcons.forceProcess(iconRef.current);
|
|
10
10
|
}
|
|
11
|
-
}, [name, className]);
|
|
11
|
+
}, [name, className, size, color, style]);
|
|
12
|
+
|
|
13
|
+
const combinedStyle = {
|
|
14
|
+
...(size ? { fontSize: size } : {}),
|
|
15
|
+
...(color ? { color: color } : {}),
|
|
16
|
+
...style
|
|
17
|
+
};
|
|
12
18
|
|
|
13
19
|
return (
|
|
14
20
|
<viconic-icon
|
|
15
21
|
ref={iconRef}
|
|
16
22
|
icon={name}
|
|
17
23
|
class={className}
|
|
18
|
-
style={
|
|
24
|
+
style={combinedStyle}
|
|
19
25
|
{...props}
|
|
20
26
|
></viconic-icon>
|
|
21
27
|
);
|