@liner-fe/internal-icon 1.0.12 → 1.0.13
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/.ultra.cache.json +1 -1
- package/CHANGELOG.md +6 -0
- package/figma.json +1508 -539
- package/lib/index.js +19 -3
- package/package.json +1 -1
- package/src/generate-svg-files.ts +12 -4
- package/src/generate-tsx-components.ts +8 -1
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postcss@8.5.6_tsx@4.
|
|
4
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
var getFilename = /* @__PURE__ */ __name(() => fileURLToPath(import.meta.url), "getFilename");
|
|
@@ -25,11 +25,21 @@ var generateSvgFiles = /* @__PURE__ */ __name(() => {
|
|
|
25
25
|
if (!fs.existsSync(svgDir)) {
|
|
26
26
|
fs.mkdirSync(svgDir, { recursive: true });
|
|
27
27
|
}
|
|
28
|
-
Object.entries(figmaData).forEach(([iconName,
|
|
28
|
+
Object.entries(figmaData).forEach(([iconName, v]) => {
|
|
29
29
|
const iconDir = path2.join(svgDir, iconName);
|
|
30
30
|
if (!fs.existsSync(iconDir)) {
|
|
31
31
|
fs.mkdirSync(iconDir, { recursive: true });
|
|
32
32
|
}
|
|
33
|
+
const variants = {
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
default: v.default,
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
fill: v.fill,
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
thick: v.thick,
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
"fill-thick": v["fill-thick"]
|
|
42
|
+
};
|
|
33
43
|
Object.entries(variants).forEach(([variant, svgString]) => {
|
|
34
44
|
if (svgString && svgString.trim() !== "") {
|
|
35
45
|
const convertedSvg = convertToCurrentColor(svgString);
|
|
@@ -90,8 +100,14 @@ var generateTsxComponents = /* @__PURE__ */ __name(() => {
|
|
|
90
100
|
}
|
|
91
101
|
}
|
|
92
102
|
__name(ensureDirectoryExists, "ensureDirectoryExists");
|
|
93
|
-
function processSvgVariants(
|
|
103
|
+
function processSvgVariants(v) {
|
|
94
104
|
const variantSvgs = {};
|
|
105
|
+
const variants = {
|
|
106
|
+
default: v.default,
|
|
107
|
+
fill: v.fill,
|
|
108
|
+
thick: v.thick,
|
|
109
|
+
"fill-thick": v["fill-thick"]
|
|
110
|
+
};
|
|
95
111
|
Object.entries(variants).forEach(([variant, svgString]) => {
|
|
96
112
|
if (svgString && svgString.trim() !== "") {
|
|
97
113
|
variantSvgs[variant] = normalizeSvgAttributes(convertToCurrentColor(svgString));
|
package/package.json
CHANGED
|
@@ -17,17 +17,25 @@ export const generateSvgFiles = () => {
|
|
|
17
17
|
fs.mkdirSync(svgDir, { recursive: true });
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
Object.entries(figmaData).forEach(([iconName,
|
|
20
|
+
Object.entries(figmaData).forEach(([iconName, v]) => {
|
|
21
21
|
const iconDir = path.join(svgDir, iconName);
|
|
22
22
|
if (!fs.existsSync(iconDir)) {
|
|
23
23
|
fs.mkdirSync(iconDir, { recursive: true });
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const variants = {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
default: v.default,
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
fill: v.fill,
|
|
28
31
|
// @ts-ignore
|
|
32
|
+
thick: v.thick,
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
'fill-thick': v['fill-thick'],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
Object.entries(variants).forEach(([variant, svgString]) => {
|
|
29
38
|
if (svgString && svgString.trim() !== '') {
|
|
30
|
-
// @ts-ignore
|
|
31
39
|
const convertedSvg = convertToCurrentColor(svgString);
|
|
32
40
|
const optimizedSvg = optimizeSvg(convertedSvg);
|
|
33
41
|
|
|
@@ -74,9 +74,16 @@ export const generateTsxComponents = () => {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// SVG 변형 처리 함수
|
|
77
|
-
function processSvgVariants(
|
|
77
|
+
function processSvgVariants(v: Record<string, string>): Record<string, string> {
|
|
78
78
|
const variantSvgs = {};
|
|
79
79
|
|
|
80
|
+
const variants = {
|
|
81
|
+
default: v.default,
|
|
82
|
+
fill: v.fill,
|
|
83
|
+
thick: v.thick,
|
|
84
|
+
'fill-thick': v['fill-thick'],
|
|
85
|
+
};
|
|
86
|
+
|
|
80
87
|
Object.entries(variants).forEach(([variant, svgString]) => {
|
|
81
88
|
if (svgString && svgString.trim() !== '') {
|
|
82
89
|
// @ts-ignore
|