viconic-react-icons 1.0.4 → 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 CHANGED
@@ -222,7 +222,7 @@ var import_react = __toESM(require("react"));
222
222
  apiBase: (((_a = window.CONFIG) == null ? void 0 : _a.API_BASE) || ((_b = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _b.apiBase) || "https://api.viconic.io.vn").replace(/\/$/, ""),
223
223
  // Batch API for Iconify-style loading (by-prefix endpoint)
224
224
  batchApiBase: (((_c = window.CONFIG) == null ? void 0 : _c.BATCH_API_BASE) || ((_d = window.CONFIG) == null ? void 0 : _d.API_BASE) || ((_e = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _e.batchApiBase) || "https://api.viconic.io.vn").replace(/\/$/, ""),
225
- cdnDomain: ((_f = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _f.cdnDomain) || ((_g = window.CONFIG) == null ? void 0 : _g.CDN_DOMAIN) || "pub-1f6e5603f8674e37b76ceac17e995ec3.r2.dev",
225
+ cdnDomain: ((_f = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _f.cdnDomain) || ((_g = window.CONFIG) == null ? void 0 : _g.CDN_DOMAIN) || "cdn.viconic.io.vn",
226
226
  // Custom domain for R2 CDN via Cloudflare edge (HTTP/2, edge cache)
227
227
  cdnCustomDomain: ((_h = window.CONFIG) == null ? void 0 : _h.CDN_CUSTOM_DOMAIN) || ((_i = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _i.cdnCustomDomain) || "",
228
228
  observe: (currentScript == null ? void 0 : currentScript.hasAttribute("data-observe")) ?? false,
@@ -1615,7 +1615,7 @@ var import_react = __toESM(require("react"));
1615
1615
  line-height: 1;
1616
1616
  width: 1em;
1617
1617
  height: 1em;
1618
- opacity: 0;
1618
+
1619
1619
  }
1620
1620
  :where(viconic-icon).svg-loaded {
1621
1621
  display: inline-flex !important;
@@ -1623,7 +1623,7 @@ var import_react = __toESM(require("react"));
1623
1623
  justify-content: center;
1624
1624
  background: none !important;
1625
1625
  background-color: transparent !important;
1626
- opacity: 1;
1626
+
1627
1627
  }
1628
1628
  :where(viconic-icon).svg-loaded:not(.ci-multicolor) svg {
1629
1629
  width: 1em;
@@ -1634,21 +1634,21 @@ var import_react = __toESM(require("react"));
1634
1634
  width: 1em;
1635
1635
  height: 1em;
1636
1636
  }
1637
- @keyframes ci-appear { from { opacity: 0; } to { opacity: 1; } }
1638
- :where(viconic-icon).svg-loaded:not(.cache-hit) { animation: ci-appear 0.12s ease-out; }
1639
- :where(viconic-icon).cache-hit { opacity: 1 !important; animation: none !important; }
1640
- i.cache-hit { animation: none !important; }
1637
+ to { } }
1638
+
1639
+
1640
+
1641
1641
  /* --- ANIMATION COMMENTED OUT START ---
1642
1642
  @keyframes ci-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
1643
- @keyframes ci-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
1643
+ @keyframes ci-pulse { 0%, 100% { } 50% { opacity: 0.4; } }
1644
1644
  @keyframes ci-bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-0.4em); } 60% { transform: translateY(-0.2em); } }
1645
1645
  @keyframes ci-shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-0.1em); } 20%, 40%, 60%, 80% { transform: translateX(0.1em); } }
1646
1646
  @keyframes ci-flip { 0%, 100% { transform: perspective(400px) rotateY(0deg); } 50% { transform: perspective(400px) rotateY(180deg); } }
1647
1647
  @keyframes ci-heartbeat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.25); } 28% { transform: scale(1); } 42% { transform: scale(1.25); } 70% { transform: scale(1); } }
1648
- @keyframes ci-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
1648
+ @keyframes ci-fade { 0%, 100% { } 50% { opacity: 0.3; } }
1649
1649
  @keyframes ci-wobble { 0%, 100% { transform: rotate(0deg); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(8deg); } 45% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } 75% { transform: rotate(-2deg); } }
1650
1650
  @keyframes ci-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.3em); } }
1651
- @keyframes ci-trace { 0% { fill-opacity: 0; stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: var(--path-len, 400); } 50%, 60% { fill-opacity: 0; stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } 100% { fill-opacity: 1; stroke: var(--trace-end-stroke, transparent); stroke-width: var(--trace-end-stroke-width, 0); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } }
1651
+ @keyframes ci-trace { 0% { fill- stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: var(--path-len, 400); } 50%, 60% { fill- stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } 100% { fill- stroke: var(--trace-end-stroke, transparent); stroke-width: var(--trace-end-stroke-width, 0); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } }
1652
1652
  :where(viconic-icon)[animate="spin"] { animation: ci-spin 1.5s linear infinite !important; }
1653
1653
  :where(viconic-icon)[animate="pulse"] { animation: ci-pulse 2s ease-in-out infinite !important; }
1654
1654
  :where(viconic-icon)[animate="bounce"] { animation: ci-bounce 1s ease infinite !important; }
@@ -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
@@ -188,7 +188,7 @@ import React, { useEffect, useRef } from "react";
188
188
  apiBase: (((_a = window.CONFIG) == null ? void 0 : _a.API_BASE) || ((_b = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _b.apiBase) || "https://api.viconic.io.vn").replace(/\/$/, ""),
189
189
  // Batch API for Iconify-style loading (by-prefix endpoint)
190
190
  batchApiBase: (((_c = window.CONFIG) == null ? void 0 : _c.BATCH_API_BASE) || ((_d = window.CONFIG) == null ? void 0 : _d.API_BASE) || ((_e = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _e.batchApiBase) || "https://api.viconic.io.vn").replace(/\/$/, ""),
191
- cdnDomain: ((_f = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _f.cdnDomain) || ((_g = window.CONFIG) == null ? void 0 : _g.CDN_DOMAIN) || "pub-1f6e5603f8674e37b76ceac17e995ec3.r2.dev",
191
+ cdnDomain: ((_f = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _f.cdnDomain) || ((_g = window.CONFIG) == null ? void 0 : _g.CDN_DOMAIN) || "cdn.viconic.io.vn",
192
192
  // Custom domain for R2 CDN via Cloudflare edge (HTTP/2, edge cache)
193
193
  cdnCustomDomain: ((_h = window.CONFIG) == null ? void 0 : _h.CDN_CUSTOM_DOMAIN) || ((_i = currentScript == null ? void 0 : currentScript.dataset) == null ? void 0 : _i.cdnCustomDomain) || "",
194
194
  observe: (currentScript == null ? void 0 : currentScript.hasAttribute("data-observe")) ?? false,
@@ -1581,7 +1581,7 @@ import React, { useEffect, useRef } from "react";
1581
1581
  line-height: 1;
1582
1582
  width: 1em;
1583
1583
  height: 1em;
1584
- opacity: 0;
1584
+
1585
1585
  }
1586
1586
  :where(viconic-icon).svg-loaded {
1587
1587
  display: inline-flex !important;
@@ -1589,7 +1589,7 @@ import React, { useEffect, useRef } from "react";
1589
1589
  justify-content: center;
1590
1590
  background: none !important;
1591
1591
  background-color: transparent !important;
1592
- opacity: 1;
1592
+
1593
1593
  }
1594
1594
  :where(viconic-icon).svg-loaded:not(.ci-multicolor) svg {
1595
1595
  width: 1em;
@@ -1600,21 +1600,21 @@ import React, { useEffect, useRef } from "react";
1600
1600
  width: 1em;
1601
1601
  height: 1em;
1602
1602
  }
1603
- @keyframes ci-appear { from { opacity: 0; } to { opacity: 1; } }
1604
- :where(viconic-icon).svg-loaded:not(.cache-hit) { animation: ci-appear 0.12s ease-out; }
1605
- :where(viconic-icon).cache-hit { opacity: 1 !important; animation: none !important; }
1606
- i.cache-hit { animation: none !important; }
1603
+ to { } }
1604
+
1605
+
1606
+
1607
1607
  /* --- ANIMATION COMMENTED OUT START ---
1608
1608
  @keyframes ci-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
1609
- @keyframes ci-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
1609
+ @keyframes ci-pulse { 0%, 100% { } 50% { opacity: 0.4; } }
1610
1610
  @keyframes ci-bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-0.4em); } 60% { transform: translateY(-0.2em); } }
1611
1611
  @keyframes ci-shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-0.1em); } 20%, 40%, 60%, 80% { transform: translateX(0.1em); } }
1612
1612
  @keyframes ci-flip { 0%, 100% { transform: perspective(400px) rotateY(0deg); } 50% { transform: perspective(400px) rotateY(180deg); } }
1613
1613
  @keyframes ci-heartbeat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.25); } 28% { transform: scale(1); } 42% { transform: scale(1.25); } 70% { transform: scale(1); } }
1614
- @keyframes ci-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
1614
+ @keyframes ci-fade { 0%, 100% { } 50% { opacity: 0.3; } }
1615
1615
  @keyframes ci-wobble { 0%, 100% { transform: rotate(0deg); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(8deg); } 45% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } 75% { transform: rotate(-2deg); } }
1616
1616
  @keyframes ci-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.3em); } }
1617
- @keyframes ci-trace { 0% { fill-opacity: 0; stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: var(--path-len, 400); } 50%, 60% { fill-opacity: 0; stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } 100% { fill-opacity: 1; stroke: var(--trace-end-stroke, transparent); stroke-width: var(--trace-end-stroke-width, 0); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } }
1617
+ @keyframes ci-trace { 0% { fill- stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: var(--path-len, 400); } 50%, 60% { fill- stroke: currentColor; stroke-width: var(--trace-stroke-width, 1px); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } 100% { fill- stroke: var(--trace-end-stroke, transparent); stroke-width: var(--trace-end-stroke-width, 0); stroke-dasharray: var(--path-len, 400); stroke-dashoffset: 0; } }
1618
1618
  :where(viconic-icon)[animate="spin"] { animation: ci-spin 1.5s linear infinite !important; }
1619
1619
  :where(viconic-icon)[animate="pulse"] { animation: ci-pulse 2s ease-in-out infinite !important; }
1620
1620
  :where(viconic-icon)[animate="bounce"] { animation: ci-bounce 1s ease infinite !important; }
@@ -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
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "viconic-react-icons",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "Viconic Smart Icons loader for React",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
+ "files": [
8
+ "dist",
9
+ "src",
10
+ "index.d.ts"
11
+ ],
7
12
  "scripts": {
8
13
  "build": "tsup src/index.jsx --format cjs,esm --external react"
9
14
  },
@@ -19,6 +24,7 @@
19
24
  "license": "MIT",
20
25
  "types": "index.d.ts",
21
26
  "devDependencies": {
27
+ "tsup": "^8.5.1",
22
28
  "typescript": "^5.9.3"
23
29
  }
24
30
  }
@@ -168,7 +168,7 @@
168
168
  apiBase: (window.CONFIG?.API_BASE || currentScript?.dataset?.apiBase || 'https://api.viconic.io.vn').replace(/\/$/, ''),
169
169
  // Batch API for Iconify-style loading (by-prefix endpoint)
170
170
  batchApiBase: (window.CONFIG?.BATCH_API_BASE || window.CONFIG?.API_BASE || currentScript?.dataset?.batchApiBase || 'https://api.viconic.io.vn').replace(/\/$/, ''),
171
- cdnDomain: currentScript?.dataset?.cdnDomain || window.CONFIG?.CDN_DOMAIN || 'pub-1f6e5603f8674e37b76ceac17e995ec3.r2.dev',
171
+ cdnDomain: currentScript?.dataset?.cdnDomain || window.CONFIG?.CDN_DOMAIN || 'cdn.viconic.io.vn',
172
172
  // Custom domain for R2 CDN via Cloudflare edge (HTTP/2, edge cache)
173
173
  cdnCustomDomain: window.CONFIG?.CDN_CUSTOM_DOMAIN || currentScript?.dataset?.cdnCustomDomain || '',
174
174
  observe: currentScript?.hasAttribute('data-observe') ?? false,
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={style}
24
+ style={combinedStyle}
19
25
  {...props}
20
26
  ></viconic-icon>
21
27
  );