Skip to content

Commit 2ddc0fa

Browse files
authored
chore: optimize icon exports (#552)
1 parent 51444ba commit 2ddc0fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+482
-350
lines changed

.changeset/stale-rabbits-double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Optimize icon exports.

.size-limit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ module.exports = [
2626
path: './dist/es/index.js',
2727
webpack: true,
2828
import: '{ Button }',
29-
limit: '38 kB',
29+
limit: '22 kB',
3030
},
3131
{
3232
name: 'Tree shaking (just an Icon)',
3333
path: './dist/es/index.js',
3434
webpack: true,
3535
import: '{ AiIcon }',
36-
limit: '28 kB',
36+
limit: '11 kB',
3737
},
3838
];

src/icons/AiIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
export const AiIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const AiIcon = wrapIcon(
4+
'AiIcon',
25
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">
36
<path
47
fill="currentColor"
58
fillRule="evenodd"
69
d="M9.704 3.88a.6.6 0 0 1-1.2 0V1.468a.6.6 0 0 1 1.2 0V3.88ZM8.662 6.454a.625.625 0 0 1 .884.884l-7.468 7.468a.625.625 0 1 1-.884-.884l7.468-7.468Zm.442 6.47a.6.6 0 0 0 .6-.6V9.912a.6.6 0 0 0-1.2 0v2.412a.6.6 0 0 0 .6.6ZM6.088 6.296a.6.6 0 0 1 0 1.2H3.676a.6.6 0 1 1 0-1.2h2.412Zm9.044.6a.6.6 0 0 0-.6-.6H12.12a.6.6 0 1 0 0 1.2h2.412a.6.6 0 0 0 .6-.6ZM11.66 5.188a.6.6 0 1 1-.848-.849l1.705-1.705a.6.6 0 1 1 .849.848L11.66 5.188Zm-4.264 0a.6.6 0 0 0 0-.849L5.69 2.634a.6.6 0 1 0-.848.848l1.705 1.706a.6.6 0 0 0 .849 0Zm5.97 5.122a.6.6 0 1 1-.848.848l-1.706-1.705a.6.6 0 0 1 .849-.849l1.705 1.706Z"
710
clipRule="evenodd"
811
/>
9-
</svg>
12+
</svg>,
1013
);

src/icons/AreaChartIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const AreaChartIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const AreaChartIcon = wrapIcon(
4+
'AreaChartIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -12,5 +15,5 @@ export const AreaChartIcon = (
1215
d="M13.4 7.048V13.4H2.6v-2.269l4.332-2.976L8.58 9.77a.6.6 0 0 0 .76.067l4.06-2.79Zm1.2-1.149V1.982a.6.6 0 0 0-.94-.495L9.068 4.643 7.42 3.026a.6.6 0 0 0-.76-.067L2.6 5.75V2a.6.6 0 0 0-1.2 0v12a.6.6 0 0 0 .6.6h12a.6.6 0 0 0 .588-.72.6.6 0 0 0 .012-.12V5.9Zm-1.2-.307L9.068 8.569 7.42 6.952a.6.6 0 0 0-.76-.066L2.6 9.676V7.204l4.332-2.977L8.58 5.845a.6.6 0 0 0 .76.067l4.06-2.79v2.47Z"
1316
clipRule="evenodd"
1417
/>
15-
</svg>
18+
</svg>,
1619
);

src/icons/BackwardIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const BackwardIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const BackwardIcon = wrapIcon(
4+
'BackwardIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -12,5 +15,5 @@ export const BackwardIcon = (
1215
d="M7.688 2.304a.65.65 0 1 1 .92.92L3.83 8l4.776 4.777a.65.65 0 1 1-.92.919L2.453 8.46a.65.65 0 0 1 0-.92zm4.94 0a.65.65 0 0 1 .92.92L8.772 8l4.776 4.777a.65.65 0 0 1-.92.919L7.394 8.46a.65.65 0 0 1 0-.92z"
1316
clipRule="evenodd"
1417
/>
15-
</svg>
18+
</svg>,
1619
);

src/icons/BarChartIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const BarChartIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const BarChartIcon = wrapIcon(
4+
'BarChartIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -12,5 +15,5 @@ export const BarChartIcon = (
1215
d="M2 1.4a.6.6 0 0 1 .6.6v11.4H14a.6.6 0 1 1 0 1.2H2a.6.6 0 0 1-.6-.6V2a.6.6 0 0 1 .6-.6Zm2.4 9.225V8.3a.7.7 0 0 1 1.4 0v2.6a.7.7 0 1 1-1.4 0v-.275ZM7.2 6.3V10.9a.7.7 0 1 0 1.4 0V6.3a.7.7 0 1 0-1.4 0Zm2.8 4.325V8.3a.7.7 0 1 1 1.4 0v2.6a.7.7 0 1 1-1.4 0v-.275ZM12.8 3.3V10.9a.7.7 0 1 0 1.4 0V3.3a.7.7 0 1 0-1.4 0Z"
1316
clipRule="evenodd"
1417
/>
15-
</svg>
18+
</svg>,
1619
);

src/icons/BellFilledIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const BellFilledIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const BellFilledIcon = wrapIcon(
4+
'BellFilledIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -12,5 +15,5 @@ export const BellFilledIcon = (
1215
d="M4.592 1.772A4.8 4.8 0 0 1 8 .35a4.8 4.8 0 0 1 3.408 1.422c.736.742 1.097 1.63 1.292 2.526.166.762.218 1.572.267 2.323l.022.34c.12 1.76.327 3.128 1.624 4a.65.65 0 0 1-.363 1.189H1.75a.65.65 0 0 1-.363-1.19c1.297-.87 1.504-2.239 1.624-3.999l.022-.34c.049-.75.1-1.56.267-2.323.195-.897.556-1.784 1.292-2.526M8 14.7c-.794 0-1.35-.584-1.35-1.2h-1.3C5.35 14.928 6.585 16 8 16s2.65-1.072 2.65-2.5h-1.3c0 .616-.556 1.2-1.35 1.2"
1316
clipRule="evenodd"
1417
/>
15-
</svg>
18+
</svg>,
1619
);

src/icons/BellIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const BellIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const BellIcon = wrapIcon(
4+
'BellIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -16,5 +19,5 @@ export const BellIcon = (
1619
fill="currentColor"
1720
d="M8 14.7c-.794 0-1.35-.584-1.35-1.2h-1.3C5.35 14.928 6.585 16 8 16s2.65-1.072 2.65-2.5h-1.3c0 .616-.556 1.2-1.35 1.2"
1821
/>
19-
</svg>
22+
</svg>,
2023
);

src/icons/BooleanIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const BooleanIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const BooleanIcon = wrapIcon(
4+
'BooleanIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -12,5 +15,5 @@ export const BooleanIcon = (
1215
d="M12.427 1.013 4.195 15.001H2.833l8.232-13.988h1.362ZM.04 2.964V1.821H5.25v1.143H3.292V8H1.997V2.964H.04Zm11.736 5.038v6.2h1.238v-2.22h2.591v-1.144h-2.59V9.145h2.868V8.002h-4.107Z"
1316
clipRule="evenodd"
1417
/>
15-
</svg>
18+
</svg>,
1619
);

src/icons/CalendarEditIcon.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const CalendarEditIcon = (
1+
import { wrapIcon } from './wrap-icon';
2+
3+
export const CalendarEditIcon = wrapIcon(
4+
'CalendarEditIcon',
25
<svg
36
xmlns="http://www.w3.org/2000/svg"
47
width="16"
@@ -12,5 +15,5 @@ export const CalendarEditIcon = (
1215
d="M4.70474 1.98261V0.995119C4.70474 0.636134 4.99576 0.345118 5.35474 0.345118C5.71373 0.345118 6.00474 0.636133 6.00474 0.995119V1.98261H10.0047V0.995119C10.0047 0.636134 10.2958 0.345118 10.6547 0.345118C11.0137 0.345118 11.3047 0.636133 11.3047 0.995119V1.98261C11.8122 1.9826 12.2321 1.98267 12.5746 2.01066C12.9317 2.03983 13.2614 2.10253 13.5715 2.26055C14.0513 2.50502 14.4414 2.89512 14.6859 3.37494C14.8439 3.68506 14.9066 4.01474 14.9358 4.37177C14.9744 4.84498 14.9702 5.32199 14.9659 5.79772C14.9647 5.93939 14.9634 6.08095 14.9633 6.22227C14.9633 6.77499 14.5149 7.22289 13.9622 7.22227L2.33629 7.20919V11.3164C2.33629 11.8592 2.33679 12.2272 2.36001 12.5114C2.38262 12.788 2.42345 12.9276 2.47253 13.0239C2.59237 13.2591 2.7836 13.4503 3.0188 13.5702C3.11511 13.6192 3.25467 13.6601 3.5313 13.6827C3.81552 13.7059 4.18351 13.7064 4.72629 13.7064H6.27801C6.637 13.7064 6.92801 13.9974 6.92801 14.3564C6.92801 14.7154 6.637 15.0064 6.27801 15.0064H4.69952C4.19022 15.0064 3.76888 15.0064 3.42544 14.9784C3.06841 14.9492 2.73873 14.8865 2.42861 14.7285C1.9488 14.484 1.5587 14.0939 1.31422 13.6141C1.15621 13.304 1.0935 12.9743 1.06433 12.6172C1.03627 12.2738 1.03628 11.8525 1.03629 11.3432V11.3431V5.64585V5.64584C1.03628 5.13654 1.03627 4.7152 1.06433 4.37177C1.0935 4.01474 1.15621 3.68506 1.31422 3.37494C1.5587 2.89512 1.9488 2.50502 2.42861 2.26055C2.73873 2.10253 3.06841 2.03983 3.42544 2.01066C3.76888 1.9826 4.19023 1.9826 4.69954 1.98261H4.70474ZM13.6638 5.67261V6.02193L2.33629 6.00919V5.67261C2.33629 5.12984 2.33679 4.76185 2.36001 4.47763C2.38262 4.20099 2.42345 4.06144 2.47253 3.96512C2.59237 3.72992 2.7836 3.5387 3.0188 3.41885C3.11511 3.36978 3.25467 3.32894 3.5313 3.30634C3.81552 3.28312 4.18351 3.28261 4.72629 3.28261H11.2738C11.8166 3.28261 12.1846 3.28312 12.4688 3.30634C12.7454 3.32894 12.885 3.36978 12.9813 3.41885C13.2165 3.5387 13.4077 3.72992 13.5276 3.96513C13.5766 4.06144 13.6175 4.201 13.6401 4.47763C13.6633 4.76185 13.6638 5.12984 13.6638 5.67261ZM13.5399 9.68673C13.536 9.68283 13.5296 9.68283 13.5257 9.68673L9.65988 13.5526C9.658 13.5545 9.65695 13.557 9.65695 13.5597V14.6725C9.65695 14.6781 9.66143 14.6825 9.66695 14.6825H10.7798C10.7825 14.6825 10.785 14.6815 10.7869 14.6796L14.6528 10.8138C14.6567 10.8098 14.6567 10.8035 14.6528 10.7996L13.5399 9.68673ZM15.572 9.88037L14.4591 8.76749C13.9475 8.25587 13.1181 8.25594 12.6065 8.76749L8.74064 12.6333C8.49496 12.879 8.35695 13.2122 8.35695 13.5597V14.6725C8.35695 15.396 8.94345 15.9825 9.66695 15.9825L10.7798 15.9825C11.1273 15.9825 11.4605 15.8445 11.7061 15.5988L15.572 11.733C16.0836 11.2214 16.0836 10.392 15.572 9.88037Z"
1316
clipRule="evenodd"
1417
/>
15-
</svg>
18+
</svg>,
1619
);

0 commit comments

Comments
 (0)