@rdicons/core 0.1.0 → 0.2.0
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/browser.d.cts +2 -1
- package/dist/browser.d.ts +2 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/dist/browser.d.cts
CHANGED
|
@@ -31,4 +31,5 @@ declare function downloadFile(data: Blob | string, filename: string, mime?: stri
|
|
|
31
31
|
/** Copy text to the clipboard, with a fallback for older/insecure contexts. */
|
|
32
32
|
declare function copyText(text: string): Promise<boolean>;
|
|
33
33
|
|
|
34
|
-
export { IMAGE_TYPES, MAX_IMAGE_BYTES, MAX_SVG_BYTES,
|
|
34
|
+
export { IMAGE_TYPES, MAX_IMAGE_BYTES, MAX_SVG_BYTES, copyText, downloadFile, prepareSvgUpload, readImageSize, resizeRasterToPng, svgToPngBlob };
|
|
35
|
+
export type { PreparedSvg };
|
package/dist/browser.d.ts
CHANGED
|
@@ -31,4 +31,5 @@ declare function downloadFile(data: Blob | string, filename: string, mime?: stri
|
|
|
31
31
|
/** Copy text to the clipboard, with a fallback for older/insecure contexts. */
|
|
32
32
|
declare function copyText(text: string): Promise<boolean>;
|
|
33
33
|
|
|
34
|
-
export { IMAGE_TYPES, MAX_IMAGE_BYTES, MAX_SVG_BYTES,
|
|
34
|
+
export { IMAGE_TYPES, MAX_IMAGE_BYTES, MAX_SVG_BYTES, copyText, downloadFile, prepareSvgUpload, readImageSize, resizeRasterToPng, svgToPngBlob };
|
|
35
|
+
export type { PreparedSvg };
|
package/dist/index.cjs
CHANGED
|
@@ -178,6 +178,7 @@ function propsString(o = {}) {
|
|
|
178
178
|
if (o.color) p.push(`color="${o.color}"`);
|
|
179
179
|
if (o.strokeWidth != null) p.push(`strokeWidth={${o.strokeWidth}}`);
|
|
180
180
|
if (o.animate) p.push(o.animate === "hover" ? "animate" : `animate="${o.animate}"`);
|
|
181
|
+
if (o.animate && o.speed && o.speed !== 1) p.push(`speed={${o.speed}}`);
|
|
181
182
|
return p.length ? " " + p.join(" ") : "";
|
|
182
183
|
}
|
|
183
184
|
function componentName(icon) {
|
package/dist/index.d.cts
CHANGED
|
@@ -96,6 +96,8 @@ interface UseOptions {
|
|
|
96
96
|
strokeWidth?: number | null;
|
|
97
97
|
/** when the icon has an animation: the trigger to show in the React snippet (hover is written as plain `animate`) */
|
|
98
98
|
animate?: 'hover' | 'parent' | 'play' | 'loop';
|
|
99
|
+
/** animation speed; 2 is twice as fast. Left out when 1 or when the icon is not animated */
|
|
100
|
+
speed?: number;
|
|
99
101
|
}
|
|
100
102
|
interface Snippet {
|
|
101
103
|
id: string;
|
|
@@ -122,4 +124,5 @@ declare function importLines(icons: Pick<IconRef, 's' | 'n' | 'c'>[]): {
|
|
|
122
124
|
statement: string;
|
|
123
125
|
}[];
|
|
124
126
|
|
|
125
|
-
export { BRAND,
|
|
127
|
+
export { BRAND, assignComponentNames, buildSvg, cliFlags, componentName, fileName, hexToHsv, hsvToHex, importLines, isLight, libPackage, nativeStrokeWidth, normalizeHex, propsString, snippetsFor, supportsStrokeWidth, svgToJsx, toPascalCase };
|
|
128
|
+
export type { CustomizeOptions, HSV, IconData, IconRef, Snippet, UseOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,8 @@ interface UseOptions {
|
|
|
96
96
|
strokeWidth?: number | null;
|
|
97
97
|
/** when the icon has an animation: the trigger to show in the React snippet (hover is written as plain `animate`) */
|
|
98
98
|
animate?: 'hover' | 'parent' | 'play' | 'loop';
|
|
99
|
+
/** animation speed; 2 is twice as fast. Left out when 1 or when the icon is not animated */
|
|
100
|
+
speed?: number;
|
|
99
101
|
}
|
|
100
102
|
interface Snippet {
|
|
101
103
|
id: string;
|
|
@@ -122,4 +124,5 @@ declare function importLines(icons: Pick<IconRef, 's' | 'n' | 'c'>[]): {
|
|
|
122
124
|
statement: string;
|
|
123
125
|
}[];
|
|
124
126
|
|
|
125
|
-
export { BRAND,
|
|
127
|
+
export { BRAND, assignComponentNames, buildSvg, cliFlags, componentName, fileName, hexToHsv, hsvToHex, importLines, isLight, libPackage, nativeStrokeWidth, normalizeHex, propsString, snippetsFor, supportsStrokeWidth, svgToJsx, toPascalCase };
|
|
128
|
+
export type { CustomizeOptions, HSV, IconData, IconRef, Snippet, UseOptions };
|
package/dist/index.js
CHANGED
|
@@ -135,6 +135,7 @@ function propsString(o = {}) {
|
|
|
135
135
|
if (o.color) p.push(`color="${o.color}"`);
|
|
136
136
|
if (o.strokeWidth != null) p.push(`strokeWidth={${o.strokeWidth}}`);
|
|
137
137
|
if (o.animate) p.push(o.animate === "hover" ? "animate" : `animate="${o.animate}"`);
|
|
138
|
+
if (o.animate && o.speed && o.speed !== 1) p.push(`speed={${o.speed}}`);
|
|
138
139
|
return p.length ? " " + p.join(" ") : "";
|
|
139
140
|
}
|
|
140
141
|
function componentName(icon) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdicons/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Framework-free helpers behind rdicons: recolor icons, change stroke and size, convert SVG to JSX, export PNG.",
|
|
5
5
|
"keywords": ["icons", "svg", "svg-to-jsx", "svg-to-png", "icon-customizer", "rdicons"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dompurify": "^3.4.17"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"tsup": "^
|
|
39
|
+
"tsup": "^9.0.0",
|
|
40
40
|
"typescript": "^5.6.0"
|
|
41
41
|
}
|
|
42
42
|
}
|