@liner-fe/internal-icon 1.0.1 → 1.0.3
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 +12 -0
- package/README.md +1 -3
- package/figma.json +45 -1
- package/lib/index.js +28 -5
- package/package.json +1 -1
- package/src/generate-tsx-components.ts +34 -7
package/.ultra.cache.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":{"lib":"
|
|
1
|
+
{"files":{"lib":"1764914149225.7688","node_modules":"1764914134010.825","CHANGELOG.md":"23f80c764240f05db00818583dbdcd7e9bef94e7","README.md":"e0a89d4fcf5bddf1f816bfb20a928ddb301b8d2c","figma.json":"1c65dae980f3b2b3f57d08bd57fe2c021ebd12ec","package.json":"44f4e701d20a8a3c1071adfa805f4d370f044f16","src/generate-svg-files.ts":"18687c8c5c7766b988257f5bef3d296b86fefaa8","src/generate-tsx-components.ts":"ba97e0330300610e94ead0c872c4725120eb830b","src/index.ts":"9e03c9c45c92fc534262982bce233b91892c05f1","tsconfig.json":"298030567ca332304807fcdbb95d1218c9c0814f","tsup.config.ts":"4dc8bfd36076fff8fa1d84a48a072d40e6581810"},"deps":{}}
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/figma.json
CHANGED
|
@@ -1201,7 +1201,7 @@
|
|
|
1201
1201
|
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M41 38.5H7.00004V35.5H41V38.5Z\" fill=\"#1E1E1F\"/>\n<path d=\"M18.0616 9.05859L9.12113 17.999L18.0616 26.9395L15.9405 29.0605L6.98051 20.1016C5.81976 18.9405 5.82052 17.0574 6.98148 15.8965L15.9405 6.9375L18.0616 9.05859Z\" fill=\"#1E1E1F\"/>\n<path d=\"M41 25.5H22V22.5H41V25.5Z\" fill=\"#1E1E1F\"/>\n<path d=\"M41 12.5H22V9.5H41V12.5Z\" fill=\"#1E1E1F\"/>\n</svg>\n"
|
|
1202
1202
|
},
|
|
1203
1203
|
"numbered-list": {
|
|
1204
|
-
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path
|
|
1204
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M10.1602 26.3008C11.1 26.3008 11.9398 26.5077 12.6797 26.9209C13.4264 27.3276 14.0138 27.8975 14.4404 28.6309C14.867 29.3641 15.0801 30.2142 15.0801 31.1807C15.0801 31.894 14.9803 32.4876 14.7803 32.9609C14.5803 33.4276 14.283 33.8608 13.8896 34.2607C13.4964 34.654 13.0135 35.1008 12.4404 35.6006L9.22363 38.4209H15.0801V40.9805H5V38.6211L11.04 33.2607C11.4933 32.8608 11.8133 32.4842 12 32.1309C12.1867 31.7775 12.2803 31.4473 12.2803 31.1406C12.2803 30.7007 12.1897 30.3107 12.0098 29.9707C11.8298 29.6242 11.5765 29.3544 11.25 29.1611C10.9233 28.9611 10.5396 28.8604 10.0996 28.8604C9.63977 28.8604 9.23312 28.9674 8.87988 29.1807C8.53329 29.3873 8.26363 29.6642 8.07031 30.0107C7.87698 30.3507 7.78647 30.7211 7.7998 31.1211H5C5 30.1344 5.21706 29.2805 5.65039 28.5605C6.08371 27.8407 6.68675 27.2839 7.45996 26.8906C8.23329 26.4973 9.1335 26.3008 10.1602 26.3008Z\" fill=\"#1E1E1F\"/>\n<path d=\"M42 38.5H19V35.5H42V38.5Z\" fill=\"#1E1E1F\"/>\n<path d=\"M42 25.5H19V22.5H42V25.5Z\" fill=\"#1E1E1F\"/>\n<path d=\"M11.6797 21H8.90039V9.55957L6.2002 11.2197V8.21973L8.90039 6.59961H11.6797V21Z\" fill=\"#1E1E1F\"/>\n<path d=\"M42 12.5H19V9.5H42V12.5Z\" fill=\"#1E1E1F\"/>\n</svg>\n"
|
|
1205
1205
|
},
|
|
1206
1206
|
"color-kakaotalk": {
|
|
1207
1207
|
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"24\" cy=\"24\" r=\"20\" fill=\"#FEE500\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M24.0001 14.75C17.9246 14.75 13 18.4559 13 23.0265C13 25.8691 14.9047 28.375 17.8052 29.8654L16.5848 34.2077C16.477 34.5914 16.9275 34.8972 17.2735 34.6749L22.623 31.236C23.0745 31.2784 23.5332 31.3032 24.0001 31.3032C30.0751 31.3032 35 27.5974 35 23.0265C35 18.4559 30.0751 14.75 24.0001 14.75Z\" fill=\"black\"/>\n</svg>\n"
|
|
@@ -1275,5 +1275,49 @@
|
|
|
1275
1275
|
},
|
|
1276
1276
|
"color-csv": {
|
|
1277
1277
|
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M0 9C0 4.02944 4.02944 0 9 0H39C43.9706 0 48 4.02944 48 9V39C48 43.9706 43.9706 48 39 48H9C4.02944 48 0 43.9706 0 39V9Z\" fill=\"#8D959E\"/>\n<path d=\"M11.4336 17C12.505 17 13.4657 17.1968 14.3154 17.5908C15.1714 17.9849 15.8649 18.5583 16.3945 19.3096C16.9239 20.0607 17.2436 20.9567 17.3545 21.9971H14.1582C14.1089 21.5417 13.9708 21.1478 13.7431 20.8154C13.5153 20.4767 13.2072 20.2177 12.8193 20.0391C12.4375 19.8543 12.0031 19.7617 11.5166 19.7617C10.8577 19.7617 10.2915 19.9256 9.81736 20.252C9.34318 20.5783 8.9764 21.0492 8.71776 21.665C8.45915 22.2747 8.33006 23.011 8.33006 23.873C8.3301 24.7596 8.45918 25.5076 8.71776 26.1172C8.9764 26.7269 9.34318 27.1915 9.81736 27.5117C10.2915 27.8258 10.8488 27.9834 11.4892 27.9834C11.9694 27.9834 12.3942 27.897 12.7637 27.7246C13.1393 27.5522 13.4473 27.3118 13.6875 27.0039C13.9276 26.6899 14.0843 26.3141 14.1582 25.877L17.3545 25.9053C17.2682 26.7303 16.9789 27.5121 16.4863 28.251C15.9998 28.99 15.3224 29.5909 14.4541 30.0527C13.592 30.5145 12.5851 30.7451 11.4336 30.7451C10.2205 30.7451 9.13348 30.4745 8.17283 29.9326C7.2183 29.3907 6.46964 28.602 5.92772 27.5674C5.38595 26.533 5.11527 25.3014 5.11522 23.873C5.11522 22.432 5.3894 21.1938 5.93748 20.1592C6.49167 19.1247 7.2458 18.3395 8.20018 17.8037C9.1547 17.2679 10.2327 17 11.4336 17Z\" fill=\"white\"/>\n<path d=\"M24.3281 17C25.3442 17 26.2344 17.1727 26.998 17.5176C27.7678 17.8624 28.3625 18.3484 28.7812 18.9766C29.2062 19.6047 29.4216 20.332 29.4277 21.1572H26.4072C26.3764 20.8309 26.2775 20.5504 26.1113 20.3164C25.945 20.0824 25.7109 19.907 25.4092 19.79C25.1074 19.6669 24.7406 19.6045 24.3096 19.6045C23.8971 19.6045 23.5462 19.6607 23.2568 19.7715C22.9675 19.8823 22.7493 20.0364 22.6015 20.2334C22.4537 20.4305 22.3799 20.6583 22.3799 20.917C22.3676 21.3048 22.5305 21.6157 22.8691 21.8496C23.2078 22.0774 23.7065 22.2679 24.3652 22.4219L25.5293 22.6807C26.8716 22.9762 27.8848 23.4535 28.5683 24.1123C29.2519 24.7651 29.5999 25.6215 29.6123 26.6807C29.6123 27.5182 29.3995 28.2419 28.9746 28.8516C28.5497 29.4549 27.9433 29.9197 27.1553 30.2461C26.367 30.5663 25.4216 30.7266 24.3193 30.7266C23.1924 30.7266 22.2158 30.5575 21.3906 30.2188C20.5655 29.88 19.928 29.3717 19.4785 28.6943C19.0291 28.0108 18.7922 27.1641 18.7676 26.1543H21.7978C21.8286 26.5792 21.9478 26.9398 22.1572 27.2354C22.3665 27.5247 22.6534 27.7428 23.0166 27.8906C23.3799 28.0384 23.7992 28.1123 24.2734 28.1123C24.7167 28.1123 25.0988 28.0509 25.4189 27.9277C25.7389 27.8046 25.9822 27.6354 26.1484 27.4199C26.3208 27.2045 26.4071 26.955 26.4072 26.6719C26.4072 26.4194 26.3297 26.2004 26.1758 26.0156C26.0218 25.8309 25.7876 25.6706 25.4736 25.5352C25.1596 25.3997 24.7472 25.2732 24.2363 25.1562L22.832 24.8242C21.6312 24.5533 20.7134 24.1162 20.0791 23.5127C19.4448 22.9092 19.1279 22.1142 19.1279 21.1289C19.1279 20.3161 19.3496 19.5985 19.793 18.9766C20.2363 18.3547 20.8524 17.8712 21.6406 17.5264C22.4287 17.1755 23.3246 17 24.3281 17Z\" fill=\"white\"/>\n<path d=\"M37.1777 27.0498H37.2978L40.3281 17.1846H43.8564L39.3213 30.5605H35.1553L30.6289 17.1846H34.1484L37.1777 27.0498Z\" fill=\"white\"/>\n</svg>\n"
|
|
1278
|
+
},
|
|
1279
|
+
"table": {
|
|
1280
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M42.2041 9.01074C43.2128 9.113 44 9.96435 44 11V37C44 38.0357 43.2128 38.887 42.2041 38.9893L42 39H6C4.96435 39 4.113 38.2128 4.01074 37.2041L4 37V11C4 9.89543 4.89543 9 6 9H42L42.2041 9.01074ZM7 30V36H15.5V30H7ZM18.5 30V36H41V30H18.5ZM7 27H15.5V21H7V27ZM18.5 27H41V21H18.5V27ZM7 18H41V12H7V18Z\" fill=\"#1E1E1F\"/>\n</svg>\n"
|
|
1281
|
+
},
|
|
1282
|
+
"tex": {
|
|
1283
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M36.21 13.5723L35.7695 13.584C35.3489 13.5947 35.0603 13.6899 34.8926 13.7871C34.8393 13.818 34.8041 13.8448 34.7812 13.8652C34.8023 13.905 34.8241 13.9443 34.8389 13.9678L37.3818 18.0146L39.5977 14.5557C39.6425 14.481 39.669 14.4398 39.6943 14.3965C39.7174 14.357 39.7258 14.3381 39.7295 14.3291C39.7312 14.3249 39.7316 14.3227 39.7324 14.3174C39.7339 14.3077 39.7363 14.2857 39.7363 14.2393C39.7363 14.0102 39.5146 13.6042 38.7607 13.584L38.3213 13.5723V11.9414H44.6553V13.5781L44.209 13.584C43.2489 13.5955 42.6266 13.7835 42.2012 14.0293C41.7791 14.2732 41.514 14.5949 41.2988 14.9424L41.2939 14.9492L38.3252 19.543L42.9609 26.9844L43.1094 27.1904C43.2532 27.3677 43.3885 27.4612 43.5479 27.5215C43.7917 27.6137 44.1339 27.6474 44.7285 27.6475H45.6133V29.3379L45.1406 29.3145C44.1902 29.2665 43.1471 29.2412 42.1953 29.2412C41.3399 29.2412 39.7003 29.2423 38.9268 29.3125L38.4355 29.3574V27.6582L38.875 27.6475C39.3089 27.6367 39.6039 27.54 39.7744 27.4424C39.8228 27.4147 39.8559 27.3896 39.8789 27.3701C39.8738 27.3603 39.8677 27.3498 39.8623 27.3389L36.6455 22.2002L33.8105 26.6611C33.7709 26.727 33.741 26.773 33.7158 26.8164C33.6905 26.8601 33.6774 26.888 33.6689 26.9072C33.6591 26.9297 33.6533 26.9445 33.6533 26.9922C33.6534 27.1482 33.8151 27.6279 34.6504 27.6475L35.0918 27.6582V29.3145H31.0068L30.1162 35.5039L30.0605 35.8965H15.7051V34.1504H16.6973C17.1432 34.1504 17.4584 34.1324 17.6816 34.0957C17.9086 34.0584 17.9954 34.0086 18.0264 33.9834C18.0411 33.9714 18.0621 33.9516 18.0801 33.8623C18.102 33.7529 18.1064 33.6016 18.1064 33.3525V19.3955C18.1064 19.1459 18.102 18.9943 18.0801 18.8848C18.062 18.795 18.0411 18.7756 18.0264 18.7637C17.9954 18.7385 17.9085 18.6897 17.6816 18.6523C17.4584 18.6157 17.1432 18.5967 16.6973 18.5967H15.7051V16.8779H17.8867C17.8292 16.3708 17.7671 15.9397 17.6846 15.5723C17.5513 14.9793 17.3793 14.594 17.1504 14.3291C16.7018 13.8102 15.8912 13.5899 14.0186 13.5898C13.783 13.5898 13.5041 13.5897 13.251 13.5957C12.9961 13.6017 12.7996 13.6144 12.6992 13.6309C12.6696 13.6378 12.6535 13.6448 12.6465 13.6484V13.6514C12.6384 13.6744 12.6287 13.7193 12.623 13.8018C12.6174 13.885 12.6172 13.9825 12.6172 14.1084V26.9268C12.6172 27.1538 12.6199 27.2628 12.6406 27.3389C12.6505 27.3749 12.6594 27.3948 12.7139 27.4268C12.7971 27.4753 12.9694 27.5345 13.3145 27.5771C13.6522 27.6188 14.1175 27.6396 14.7588 27.6396H16.1982V29.3486L15.7158 29.3125C14.7239 29.2407 12.2021 29.2412 11.0557 29.2412C9.90973 29.2412 7.43673 29.2408 6.44434 29.3125L5.96191 29.3486V27.6396H7.39941C8.04093 27.6396 8.50683 27.6188 8.84473 27.5771C9.18925 27.5346 9.36094 27.4753 9.44434 27.4268C9.49916 27.3948 9.50773 27.3748 9.51758 27.3389C9.5383 27.2628 9.54297 27.1538 9.54297 26.9268V14.1084C9.54297 13.9629 9.54159 13.8594 9.53516 13.7754C9.53066 13.7173 9.52202 13.6852 9.51758 13.6689C9.49996 13.6607 9.46335 13.6451 9.39355 13.6318L9.38867 13.6309C9.30857 13.615 9.12436 13.602 8.87109 13.5957C8.63064 13.5898 8.36389 13.5898 8.14062 13.5898C6.25552 13.5899 5.43787 13.8105 4.98633 14.3301C4.75656 14.5949 4.58471 14.98 4.45117 15.5723C4.31727 16.1665 4.231 16.9261 4.14453 17.9092L4.10742 18.3262H2.61328L2.6543 17.8311L3.13281 11.9414H19L19.0371 12.3594L19.4238 16.8779H29.7441L30.5039 23.7842H29.0049L28.9639 23.3721C28.7736 21.4955 28.5298 20.3349 27.9736 19.623C27.4534 18.9574 26.5772 18.5968 24.8213 18.5967H21.8066C21.5359 18.5967 21.3601 18.6082 21.2441 18.6309C21.1845 18.6426 21.1539 18.6546 21.1406 18.6611C21.1364 18.6721 21.1297 18.6955 21.123 18.7383C21.1076 18.8391 21.1035 18.9829 21.1035 19.209V25.1406H22.748C23.8691 25.1406 24.2993 24.9293 24.5117 24.6318C24.6283 24.4683 24.7152 24.2302 24.7695 23.8701C24.8239 23.5095 24.8398 23.0605 24.8398 22.4961V22.0381H26.3301V30.0137H24.8398V29.5557C24.8398 28.9912 24.824 28.5402 24.7695 28.1768C24.7151 27.814 24.6275 27.5727 24.5098 27.4053C24.2961 27.1017 23.8657 26.8857 22.748 26.8857H21.1035V33.54C21.1035 33.7658 21.1076 33.908 21.123 34.0088C21.1297 34.0518 21.1374 34.0749 21.1416 34.0859C21.1554 34.0925 21.1859 34.1048 21.2441 34.1162C21.3601 34.1389 21.5359 34.1504 21.8066 34.1504H24.915C26.8586 34.1503 27.8249 33.6818 28.416 32.8525C28.9641 32.0836 29.2439 30.9443 29.502 29.3145H28.7578V27.6475H29.208C30.273 27.6475 30.9251 27.3884 31.3369 27.1074C31.7527 26.8236 31.9627 26.4933 32.1221 26.252L35.6787 20.6729L31.6611 14.2227L31.5273 14.0352C31.3976 13.8729 31.2746 13.7827 31.1211 13.7217C30.8866 13.6286 30.5388 13.584 29.917 13.584H29.0322V11.9141L29.5078 11.9414C30.3404 11.9891 31.7468 12.0127 32.4502 12.0127C33.3293 12.0127 34.969 12.0125 35.7188 11.9424L36.21 11.8965V13.5723Z\" fill=\"#1E1E1F\"/>\n</svg>\n"
|
|
1284
|
+
},
|
|
1285
|
+
"color-document": {
|
|
1286
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M0 9C0 4.02944 4.02944 0 9 0H39C43.9706 0 48 4.02944 48 9V39C48 43.9706 43.9706 48 39 48H9C4.02944 48 0 43.9706 0 39V9Z\" fill=\"#545454\"/>\n<path d=\"M32.9 37.0003H15.35C14.6044 37.0003 14 36.3959 14 35.6503V11.3502C14 10.6047 14.6044 10.0002 15.35 10.0002H22.7757V19.5022C22.7757 20.9934 23.9845 22.2022 25.4757 22.2022H34.25V35.6503C34.25 36.3959 33.6456 37.0003 32.9 37.0003Z\" fill=\"white\"/>\n<path d=\"M32.9905 19.5022L25.4757 11.4474V19.5022L32.9905 19.5022Z\" fill=\"white\"/>\n</svg>\n"
|
|
1287
|
+
},
|
|
1288
|
+
"color-research-with-agents": {
|
|
1289
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M24.4193 3C27.1806 3.00011 29.4193 5.23864 29.4193 8C29.4193 10.2387 27.9476 12.1333 25.9193 12.7705V25.1328L36.6253 31.3145C38.1914 29.8763 40.5693 29.5505 42.5081 30.6699C44.8994 32.0507 45.7188 35.1086 44.3382 37.5C42.9575 39.8914 39.8996 40.7106 37.5081 39.3301C35.5691 38.2106 34.6636 35.9885 35.1263 33.9131L24.4193 27.7305L13.7112 33.9131C14.174 35.9885 13.2694 38.2106 11.3304 39.3301C8.93897 40.7108 5.88106 39.8914 4.50031 37.5C3.1196 35.1085 3.93893 32.0506 6.33039 30.6699C8.26907 29.5507 10.6452 29.8776 12.2112 31.3154L22.9193 25.1328V12.7705C20.8907 12.1334 19.4193 10.2388 19.4193 8C19.4193 5.23858 21.6578 3 24.4193 3ZM10.5618 34C10.0096 33.0436 8.78688 32.7155 7.83039 33.2676C6.87382 33.8199 6.54573 35.0434 7.09797 36C7.65024 36.9566 8.87381 37.2847 9.83039 36.7324C10.787 36.1801 11.1141 34.9566 10.5618 34ZM41.0081 33.2676C40.0515 32.7153 38.828 33.0434 38.2757 34C37.7235 34.9566 38.0516 36.1802 39.0081 36.7324C39.9646 37.2844 41.1873 36.9563 41.7396 36C42.2918 35.0434 41.9647 33.8199 41.0081 33.2676ZM24.4193 6C23.3147 6 22.4193 6.89543 22.4193 8C22.4193 9.10457 23.3147 10 24.4193 10C25.5237 9.99989 26.4193 9.1045 26.4193 8C26.4193 6.8955 25.5237 6.00011 24.4193 6Z\" fill=\"#0C893B\"/>\n<path d=\"M8.42518 17.473C9.53378 15.5529 11.9894 14.8947 13.9096 16.0033C15.3701 16.8465 16.0983 18.469 15.8763 20.0423L24.4183 24.975L32.9594 20.0433C32.7371 18.4697 33.4664 16.8467 34.9271 16.0033C36.8473 14.8947 39.3029 15.5529 40.4115 17.473C41.5201 19.3932 40.862 21.8488 38.9418 22.9574C37.4811 23.8005 35.7119 23.6202 34.4603 22.641L25.9193 27.5726V37.4359C27.3931 38.0302 28.4339 39.473 28.434 41.1595C28.434 43.3767 26.6364 45.174 24.4193 45.1742C22.2021 45.1742 20.4047 43.3768 20.4047 41.1595C20.4048 39.4726 21.4451 38.029 22.9193 37.4349V27.5736L14.3763 22.641C13.1247 23.6201 11.3556 23.8006 9.8949 22.9574C7.97473 21.8488 7.31658 19.3932 8.42518 17.473Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n</svg>\n"
|
|
1290
|
+
},
|
|
1291
|
+
"color-search-with-citation": {
|
|
1292
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path opacity=\"0.7\" d=\"M25 21.002H4V42.002H25V21.002Z\" fill=\"#0C893B\" fill-opacity=\"0.7\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M25.3867 5.00488C33.4922 5.21004 40 11.845 40 20L39.9951 20.3867C39.9077 23.839 38.6532 27.0009 36.6123 29.4941L45.0303 37.9121L42.9092 40.0332L34.4902 31.6152C31.9047 33.7302 28.6009 35 25 35L24.6123 34.9951C16.6357 34.7928 10.2068 28.3634 10.0049 20.3867L10 20C10 11.7157 16.7157 5 25 5L25.3867 5.00488ZM25 8C18.3726 8 13 13.3726 13 20C13 26.6274 18.3726 32 25 32C31.6274 32 37 26.6274 37 20C37 13.3726 31.6274 8.00003 25 8Z\" fill=\"#0C893B\"/>\n</svg>\n"
|
|
1293
|
+
},
|
|
1294
|
+
"color-collaborate-with-team": {
|
|
1295
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M33.7822 21.7812C40.0254 21.7812 45.0869 26.8427 45.0869 33.0859V38.3027C45.0869 39.2632 44.3082 40.042 43.3477 40.042H31.7568C31.9695 39.5034 32.0869 38.9168 32.0869 38.3027V37.042H42.0869V33.0859C42.0869 28.4996 38.3686 24.7812 33.7822 24.7812H30.3047C30.0195 24.7813 29.7377 24.7952 29.46 24.8232C28.7837 23.8692 27.9937 23.0015 27.1094 22.2402C27.9445 21.9946 28.8194 21.8417 29.7227 21.7959L30.3047 21.7812H33.7822Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n<path d=\"M32.043 7C35.6447 7 38.5653 9.91974 38.5654 13.5215C38.5654 17.1233 35.6448 20.0439 32.043 20.0439C28.4412 20.0438 25.5215 17.1233 25.5215 13.5215C25.5216 9.91983 28.4413 7.00014 32.043 7Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n<path d=\"M17.7822 21.7812C24.0254 21.7812 29.0869 26.8427 29.0869 33.0859V38.3027C29.0869 39.2632 28.3082 40.042 27.3477 40.042H4.73926C3.77876 40.042 3 39.2632 3 38.3027V33.0859C3 26.8427 8.06147 21.7812 14.3047 21.7812H17.7822Z\" fill=\"#0C893B\"/>\n<path d=\"M16.043 7C19.6447 7 22.5653 9.91974 22.5654 13.5215C22.5654 17.1233 19.6448 20.0439 16.043 20.0439C12.4412 20.0438 9.52148 17.1233 9.52148 13.5215C9.52163 9.91983 12.4413 7.00014 16.043 7Z\" fill=\"#0C893B\"/>\n</svg>\n"
|
|
1296
|
+
},
|
|
1297
|
+
"file-download": {
|
|
1298
|
+
"default": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22.1318 3C22.6862 3.00012 23.2156 3.23041 23.5938 3.63574L37.4619 18.501C37.8074 18.8713 38 19.3588 38 19.8652V24H35V20.5771H25.001C23.0681 20.5771 21.5011 19.01 21.501 17.0771V6H11V40H24V43H10C8.89543 43 8 42.1046 8 41V5C8 3.89543 8.89543 3 10 3H22.1318ZM24.501 17.0771C24.5011 17.3532 24.7249 17.5771 25.001 17.5771H32.498L24.501 9.00586V17.0771Z\" fill=\"#1E1E1F\"/>\n<path d=\"M38 40.7568L42.3789 36.3789L44.5 38.5L39.0977 43.9023C37.7308 45.2692 35.5143 45.2692 34.1475 43.9023L28.7451 38.5L30.8662 36.3789L35 40.5127V29.2891H38V40.7568Z\" fill=\"#1E1E1F\"/>\n</svg>",
|
|
1299
|
+
"thick": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22.1318 3C22.6862 3.00012 23.2156 3.23041 23.5938 3.63574L37.4619 18.501C37.8074 18.8713 38 19.3588 38 19.8652V24H34V21.0771H25.001C22.7919 21.0771 21.0011 19.2862 21.001 17.0771V7H12V39H24V43H10C8.89543 43 8 42.1046 8 41V5C8 3.89543 8.89543 3 10 3H22.1318ZM25.001 17.0771H30.6631L25.001 11.0078V17.0771Z\" fill=\"#1E1E1F\"/>\n<path d=\"M38 38.8555L41.4033 35.4531L44.2314 38.2812L38.8291 43.6836C37.267 45.2457 34.734 45.2457 33.1719 43.6836L27.7686 38.2812L30.5977 35.4531L34 38.8555V29H38V38.8555Z\" fill=\"#1E1E1F\"/>\n</svg>"
|
|
1300
|
+
},
|
|
1301
|
+
"color-gift-box": {
|
|
1302
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M43.3691 12.6152C44.6012 12.6153 45.5996 13.5234 45.5996 14.6426V21.0605C45.5996 22.1797 44.6012 23.0879 43.3691 23.0879H42.1289V43.5732C42.1289 44.6923 41.1303 45.6004 39.8984 45.6006H8.10742C6.87531 45.6006 5.87598 44.6924 5.87598 43.5732V23.0879H4.63086C3.39879 23.0878 2.40039 22.1797 2.40039 21.0605V14.6426C2.40039 13.5234 3.39879 12.6153 4.63086 12.6152H43.3691Z\" fill=\"#FF9017\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M28.4122 3.074C31.0655 1.68208 34.4667 2.50863 35.9991 4.91872V4.91384C37.4336 7.17135 36.6427 10.0287 34.1251 11.7058C33.8435 11.8927 33.5236 12.0602 33.1446 12.2176C32.7416 12.386 32.3197 12.5173 31.8819 12.615H27.0645V45.5994H20.9356V12.615H16.0977C15.6647 12.5186 15.2467 12.3892 14.8477 12.2224C14.469 12.0651 14.1443 11.8975 13.8683 11.7107C11.3504 10.0335 10.5653 7.17633 12.0001 4.91872C13.5325 2.51357 16.9328 1.68213 19.586 3.074C20.9451 3.7873 22.6996 6.09427 23.9991 8.01735C25.2986 6.09919 27.0531 3.7873 28.4122 3.074ZM16.8087 5.6072C16.1048 5.6072 15.4225 5.9369 15.0489 6.52712C14.4371 7.49607 15.0868 8.5581 15.9532 9.13357C16.0022 9.16319 16.1103 9.2279 16.3155 9.31618C16.8081 9.51772 17.366 9.62082 17.9884 9.62087H20.9288C19.6132 7.69806 18.3464 6.13408 17.8155 5.85329C17.5016 5.68614 17.1497 5.60728 16.8087 5.6072ZM32.9395 6.52712C32.3818 5.64671 31.1412 5.34672 30.172 5.85329C29.6357 6.13908 28.3688 7.69813 27.0587 9.62087H30.004C30.6266 9.62085 31.1905 9.51783 31.6778 9.31618C31.8781 9.22766 31.9865 9.16307 32.0352 9.13357V9.13845C32.9013 8.5581 33.5563 7.49585 32.9395 6.52712Z\" fill=\"#14371B\"/>\n<g style=\"mix-blend-mode:overlay\" opacity=\"0.39\">\n<path d=\"M42.1299 23.0879V27.2539L11.8496 23.0928V23.0879H42.1299Z\" fill=\"#3C373F\"/>\n</g>\n</svg>\n"
|
|
1303
|
+
},
|
|
1304
|
+
"color-research-question": {
|
|
1305
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_999_11095)\">\n<path d=\"M29.7058 12.7487C35.6407 18.6839 35.6401 28.3065 29.7051 34.2416C24.8117 39.1349 17.4126 39.9928 11.6393 36.8173L3.43302 39.016L5.63237 30.8076C2.4616 25.0353 3.32095 17.64 8.2122 12.7487C14.1474 6.81357 23.7706 6.81357 29.7058 12.7487Z\" fill=\"#0C893B\" fill-opacity=\"0.4\"/>\n<path d=\"M29.2359 27.9208C29.7279 27.9208 30.1657 28.0762 30.5181 28.3896C30.8716 28.704 31.0552 29.1036 31.0552 29.5604C31.0552 30.0174 30.8716 30.4169 30.5181 30.7313C30.1657 31.0448 29.7279 31.2001 29.2359 31.2001C28.7438 31.2001 28.3051 31.0448 27.9527 30.7313C27.5995 30.417 27.4166 30.0171 27.4166 29.5604C27.4166 29.1038 27.5995 28.7039 27.9527 28.3896C28.3051 28.0761 28.7438 27.9208 29.2359 27.9208Z\" fill=\"#0C893B\"/>\n<path d=\"M29.3052 15.7997C30.7235 15.7997 31.9155 16.1558 32.8287 16.9091C33.7482 17.6677 34.1996 18.6789 34.1998 19.8944C34.1998 20.5888 34.0294 21.2352 33.6851 21.8241C33.3402 22.4141 32.7753 22.9872 32.024 23.5478L32.0201 23.5497C31.2413 24.1202 30.8741 24.5607 30.7701 24.8661C30.6361 25.2604 30.566 25.7055 30.566 26.204V26.662H27.521V26.204C27.5211 25.2836 27.6992 24.4938 28.0972 23.871C28.4722 23.2844 29.0344 22.7126 29.7613 22.1522L29.7642 22.1493L29.7671 22.1474C30.3266 21.7293 30.732 21.3402 30.9996 20.9833C31.2495 20.6496 31.3648 20.3104 31.3648 19.9569C31.3647 19.4911 31.1836 19.1276 30.8062 18.8319C30.425 18.5333 29.905 18.3642 29.2007 18.3642C28.5868 18.3642 28.0798 18.5046 27.6587 18.7685C27.2339 19.0347 26.9078 19.4108 26.6851 19.9149L26.5806 20.1522L26.5064 20.3192L26.3335 20.2616L23.7271 19.3866L23.8169 19.1854L23.9253 18.9413C24.3604 17.9628 25.0626 17.189 26.023 16.6308C26.9825 16.0731 28.0822 15.7998 29.3052 15.7997Z\" fill=\"#0C893B\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M18.2964 12.747C24.2316 6.81191 33.8545 6.81185 39.7896 12.747C44.681 17.6385 45.54 25.0342 42.3687 30.8065L44.5679 39.0165L36.3609 36.8163C30.5879 39.9905 23.1893 39.1328 18.2964 34.2401C12.3614 28.3051 12.3616 18.6822 18.2964 12.747ZM37.4429 14.6483C32.6642 10.1058 25.1067 10.179 20.4175 14.8681L20.1978 15.0937C15.7275 19.7966 15.728 27.1905 20.1988 31.8935L20.4185 32.1181C24.3421 36.0415 30.28 36.7362 34.9156 34.1874L35.9722 33.6054L40.3257 34.7724L39.1597 30.4179L39.7388 29.3622L39.9683 28.9237C42.2391 24.3579 41.4685 18.6682 37.6685 14.8681L37.4429 14.6483Z\" fill=\"#0C893B\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_999_11095\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n"
|
|
1306
|
+
},
|
|
1307
|
+
"color-citation": {
|
|
1308
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M6 36.4995V9.49951C6 7.56651 7.567 5.99951 9.5 5.99951H21.9277C22.7973 5.99951 23.6363 6.3234 24.2803 6.90771L31.8516 13.7778C32.5827 14.4412 33 15.3833 33 16.3706V20.4995H30V16.3706C30 16.2296 29.9404 16.0943 29.8359 15.9995L22.2637 9.12939C22.1717 9.04594 22.0519 8.99951 21.9277 8.99951H9.5C9.22386 8.99951 9 9.22337 9 9.49951V36.4995C9 36.7757 9.22386 36.9995 9.5 36.9995H17.5V39.9995H9.5C7.567 39.9995 6 38.4325 6 36.4995Z\" fill=\"#0C893B\"/>\n<path d=\"M28.9443 22.999C29.5272 22.9991 30 23.5587 30 24.248V33.0596C30 38.9351 24.8385 42 20.499 42V36.6953C23.928 36.3834 24.9043 34.5126 24.9053 34.3086H21.5547C20.9718 34.3084 20.499 33.7489 20.499 33.0596V24.248C20.499 23.5587 20.9718 22.9992 21.5547 22.999H28.9443Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n<path d=\"M40.9443 22.998C41.527 22.9984 41.9989 23.557 41.999 24.2461V33.0586C41.999 38.9341 36.8385 41.999 32.499 41.999V36.6943C35.9297 36.3823 36.9053 34.509 36.9053 34.3066H33.5547C32.9717 34.3066 32.499 33.748 32.499 33.0586V24.2461C32.4992 23.5568 32.9718 22.998 33.5547 22.998H40.9443Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n</svg>\n"
|
|
1309
|
+
},
|
|
1310
|
+
"color-summarize": {
|
|
1311
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M23.4277 5.5C24.2973 5.5 25.1363 5.82389 25.7803 6.4082L33.3516 13.2783C34.0827 13.9417 34.5 14.8838 34.5 15.8711V20H31.5V15.8711C31.5 15.7301 31.4404 15.5948 31.3359 15.5L23.7637 8.62988C23.6717 8.54643 23.5519 8.5 23.4277 8.5H11C10.7239 8.5 10.5 8.72386 10.5 9V36C10.5 36.2761 10.7239 36.5 11 36.5H21V39.5H11C9.067 39.5 7.5 37.933 7.5 36V9C7.5 7.067 9.067 5.5 11 5.5H23.4277Z\" fill=\"#0C893B\"/>\n<path d=\"M27 27.5H14V24.5H27V27.5Z\" fill=\"#0C893B\"/>\n<path d=\"M27 20.5H14V17.5H27V20.5Z\" fill=\"#0C893B\"/>\n<path d=\"M32.0529 24.7918C32.3599 23.8868 33.6399 23.8868 33.9469 24.7918L35.8236 30.3245C35.9171 30.6002 36.1262 30.8215 36.3962 30.9305L41.7028 33.0726C42.537 33.4094 42.537 34.5905 41.7028 34.9272L36.3962 37.0693C36.1262 37.1783 35.9171 37.3996 35.8236 37.6754L33.9469 43.208C33.6399 44.1131 32.3599 44.1131 32.0529 43.208L30.1763 37.6754C30.0827 37.3996 29.8736 37.1783 29.6036 37.0693L24.2971 34.9272C23.4628 34.5905 23.4628 33.4094 24.2971 33.0726L29.6036 30.9305C29.8736 30.8215 30.0827 30.6002 30.1763 30.3245L32.0529 24.7918Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n</svg>\n"
|
|
1312
|
+
},
|
|
1313
|
+
"color-compass": {
|
|
1314
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M40 24C40 15.1634 32.8366 8 24 8C15.1634 8 8 15.1634 8 24C8 32.8366 15.1634 40 24 40V43C13.5066 43 5 34.4934 5 24C5 13.5066 13.5066 5 24 5C34.4934 5 43 13.5066 43 24C43 34.4934 34.4934 43 24 43V40C32.8366 40 40 32.8366 40 24Z\" fill=\"#0C893B\"/>\n<path d=\"M33.4613 14.4753L30.5253 20.9421L27.7175 27.3487L21.3671 30.2814L14.9591 33.3436L17.8951 26.8768L20.703 20.4703L27.0533 17.5375L33.4613 14.4753Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n</svg>\n"
|
|
1315
|
+
},
|
|
1316
|
+
"color-complete": {
|
|
1317
|
+
"default": "<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M8.5 38.957H18.9551V41.957H5.5V28.708H8.5V38.957Z\" fill=\"#0C893B\"/>\n<path d=\"M41.6953 41.8887H28.2402V38.8887H38.6953V28.6396H41.6953V41.8887Z\" fill=\"#0C893B\"/>\n<path d=\"M19.1934 9.5H8.73828V19.749H5.73828V6.5H19.1934V9.5Z\" fill=\"#0C893B\"/>\n<path d=\"M41.6953 19.749H38.6953V9.5H28.2402V6.5H41.6953V19.749Z\" fill=\"#0C893B\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M23 14C28.5228 14 33 18.4772 33 24C33 29.5228 28.5228 34 23 34C17.4772 34 13 29.5228 13 24C13 18.4772 17.4772 14 23 14ZM22.0967 25.4844L19.0605 22.4482L16.9395 24.5693L20.3291 27.959C21.3042 28.9341 22.8855 28.9353 23.8623 27.9619L29.6748 22.1699L27.5566 20.0449L22.0967 25.4844Z\" fill=\"#0C893B\" fill-opacity=\"0.5\"/>\n</svg>\n"
|
|
1318
|
+
},
|
|
1319
|
+
"file-hashtag": {
|
|
1320
|
+
"default": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20.9199 15.8232H31.6387L34.2715 6H37.377L34.7441 15.8232H44.915L44.1104 18.8242L33.9404 18.8232L31.167 29.1768H41.3369L40.5322 32.1768H30.3633L27.7314 42H24.625L27.2568 32.1768H16.5391L13.9072 42H10.8008L13.4326 32.1768H3.2627L4.06641 29.1768H14.2363L17.0107 18.8232H6.84082L7.64453 15.8242L17.8145 15.8232L20.4473 6H23.5527L20.9199 15.8232ZM17.3428 29.1768H28.0605L30.835 18.8232H20.1162L17.3428 29.1768Z\" fill=\"#1E1E1F\"/>\n</svg>",
|
|
1321
|
+
"thick": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M21.5732 15.3232H31.2539L33.752 6H37.8936L35.3955 15.3232H45.0479L43.9756 19.3242H34.3232L31.8174 28.6748H41.4707L40.3984 32.6748H30.7451L28.2471 42H24.1055L26.6035 32.6748H16.9229L14.4248 42H10.2832L12.7812 32.6748L3.12891 32.6758L4.2002 28.6748H13.8535L16.3594 19.3242H6.70605L7.77832 15.3232H17.4316L19.9297 6H24.0713L21.5732 15.3232ZM20.501 19.3242L17.9951 28.6748H27.6758L30.1816 19.3242H20.501Z\" fill=\"#1E1E1F\"/>\n</svg>"
|
|
1278
1322
|
}
|
|
1279
1323
|
}
|
package/lib/index.js
CHANGED
|
@@ -100,6 +100,17 @@ var generateTsxComponents = /* @__PURE__ */ __name(() => {
|
|
|
100
100
|
return variantSvgs;
|
|
101
101
|
}
|
|
102
102
|
__name(processSvgVariants, "processSvgVariants");
|
|
103
|
+
function generateColorTsxComponent(componentName, defaultSvg) {
|
|
104
|
+
return `import React, { forwardRef } from 'react';
|
|
105
|
+
import { iconSizeMap } from '@liner-fe/design-token-primitive';
|
|
106
|
+
import { ColorIconProps } from '../../index';
|
|
107
|
+
|
|
108
|
+
export const Icon${componentName} = forwardRef<SVGSVGElement, ColorIconProps>(
|
|
109
|
+
({ size = 'm', className, ...props }, ref) => ${defaultSvg}
|
|
110
|
+
);
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
__name(generateColorTsxComponent, "generateColorTsxComponent");
|
|
103
114
|
function generateTsxComponent(componentName, variantSvgs, defaultSvg) {
|
|
104
115
|
return `import React, { forwardRef } from 'react';
|
|
105
116
|
import { iconSizeMap } from '@liner-fe/design-token-primitive';
|
|
@@ -127,13 +138,23 @@ export const Icon${componentName} = forwardRef<SVGSVGElement, IconProps>(
|
|
|
127
138
|
Object.entries(figmaData).forEach(([iconName, variants]) => {
|
|
128
139
|
const iconDir = path3.join(OUTPUT_DIR, iconName);
|
|
129
140
|
ensureDirectoryExists(iconDir);
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
141
|
+
const componentName = generateIconName(iconName);
|
|
142
|
+
if (componentName.startsWith("Color")) {
|
|
143
|
+
const tsxCode = generateColorTsxComponent(
|
|
144
|
+
componentName,
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
normalizeSvgAttributes(variants.default)
|
|
147
|
+
);
|
|
135
148
|
const filePath = path3.join(iconDir, "index.tsx");
|
|
136
149
|
fs2.writeFileSync(filePath, tsxCode);
|
|
150
|
+
} else {
|
|
151
|
+
const variantSvgs = processSvgVariants(variants);
|
|
152
|
+
if (Object.keys(variantSvgs).length > 0) {
|
|
153
|
+
const defaultSvg = variantSvgs.default || variantSvgs.thick || Object.values(variantSvgs)[0];
|
|
154
|
+
const tsxCode = generateTsxComponent(componentName, variantSvgs, defaultSvg);
|
|
155
|
+
const filePath = path3.join(iconDir, "index.tsx");
|
|
156
|
+
fs2.writeFileSync(filePath, tsxCode);
|
|
157
|
+
}
|
|
137
158
|
}
|
|
138
159
|
});
|
|
139
160
|
}
|
|
@@ -157,6 +178,8 @@ export type IconSizeKey = keyof typeof iconSizeMap;
|
|
|
157
178
|
|
|
158
179
|
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'fill' | 'name'> ${IconProps("size?: keyof typeof iconSizeMap;")}
|
|
159
180
|
|
|
181
|
+
export type ColorIconProps = Omit<IconProps, 'type' | 'fillType' | 'fill' | 'thick'>;
|
|
182
|
+
|
|
160
183
|
export type IconComponentType = React.ForwardRefExoticComponent<
|
|
161
184
|
Omit<IconProps, 'ref'> & React.RefAttributes<SVGSVGElement>
|
|
162
185
|
>;
|
package/package.json
CHANGED
|
@@ -87,6 +87,17 @@ export const generateTsxComponents = () => {
|
|
|
87
87
|
return variantSvgs;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
function generateColorTsxComponent(componentName: string, defaultSvg: string): string {
|
|
91
|
+
return `import React, { forwardRef } from 'react';
|
|
92
|
+
import { iconSizeMap } from '@liner-fe/design-token-primitive';
|
|
93
|
+
import { ColorIconProps } from '../../index';
|
|
94
|
+
|
|
95
|
+
export const Icon${componentName} = forwardRef<SVGSVGElement, ColorIconProps>(
|
|
96
|
+
({ size = 'm', className, ...props }, ref) => ${defaultSvg}
|
|
97
|
+
);
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
|
|
90
101
|
// TSX 컴포넌트 코드 생성 함수
|
|
91
102
|
function generateTsxComponent(
|
|
92
103
|
componentName: string,
|
|
@@ -124,18 +135,32 @@ export const Icon${componentName} = forwardRef<SVGSVGElement, IconProps>(
|
|
|
124
135
|
const iconDir = path.join(OUTPUT_DIR, iconName);
|
|
125
136
|
ensureDirectoryExists(iconDir);
|
|
126
137
|
|
|
127
|
-
|
|
128
|
-
const variantSvgs = processSvgVariants(variants);
|
|
138
|
+
const componentName = generateIconName(iconName);
|
|
129
139
|
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
140
|
+
if (componentName.startsWith('Color')) {
|
|
141
|
+
const tsxCode = generateColorTsxComponent(
|
|
142
|
+
componentName,
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
normalizeSvgAttributes(variants.default),
|
|
145
|
+
);
|
|
134
146
|
|
|
135
|
-
const tsxCode = generateTsxComponent(componentName, variantSvgs, defaultSvg);
|
|
136
147
|
const filePath = path.join(iconDir, 'index.tsx');
|
|
137
148
|
|
|
138
149
|
fs.writeFileSync(filePath, tsxCode);
|
|
150
|
+
} else {
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
const variantSvgs = processSvgVariants(variants);
|
|
153
|
+
|
|
154
|
+
if (Object.keys(variantSvgs).length > 0) {
|
|
155
|
+
const defaultSvg =
|
|
156
|
+
variantSvgs.default || variantSvgs.thick || Object.values(variantSvgs)[0];
|
|
157
|
+
|
|
158
|
+
const tsxCode = generateTsxComponent(componentName, variantSvgs, defaultSvg);
|
|
159
|
+
|
|
160
|
+
const filePath = path.join(iconDir, 'index.tsx');
|
|
161
|
+
|
|
162
|
+
fs.writeFileSync(filePath, tsxCode);
|
|
163
|
+
}
|
|
139
164
|
}
|
|
140
165
|
});
|
|
141
166
|
}
|
|
@@ -165,6 +190,8 @@ export type IconSizeKey = keyof typeof iconSizeMap;
|
|
|
165
190
|
|
|
166
191
|
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'fill' | 'name'> ${IconProps('size?: keyof typeof iconSizeMap;')}
|
|
167
192
|
|
|
193
|
+
export type ColorIconProps = Omit<IconProps, 'type' | 'fillType' | 'fill' | 'thick'>;
|
|
194
|
+
|
|
168
195
|
export type IconComponentType = React.ForwardRefExoticComponent<
|
|
169
196
|
Omit<IconProps, 'ref'> & React.RefAttributes<SVGSVGElement>
|
|
170
197
|
>;
|