Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89cba595a7 | ||
|
|
02456263e0 | ||
|
|
a00f3134a5 | ||
|
|
d1e2c48641 | ||
|
|
b2d0708a51 | ||
|
|
2a8e43aff0 | ||
|
|
a9d1b7e23d | ||
|
|
8f5ebc425c | ||
|
|
809a6d2a45 | ||
|
|
5d34943550 | ||
|
|
f81cf0034b | ||
|
|
76a68e4629 | ||
|
|
53fb2905fd | ||
|
|
a1a8ba85bb | ||
|
|
72e8c23ecd | ||
|
|
d584c93c21 | ||
|
|
0e51cf1595 | ||
|
|
a9556e4901 | ||
|
|
505a7caeaa | ||
|
|
161eb6ad3c | ||
|
|
5d393395d3 | ||
|
|
ac1b23751d | ||
|
|
d9a095dea4 | ||
|
|
3dab196131 | ||
|
|
7f73379a7c | ||
|
|
abda804f39 | ||
|
|
b9858daaab | ||
|
|
0807bbe045 | ||
|
|
0269306a15 | ||
|
|
be3fcd7a70 | ||
|
|
4921d70e32 | ||
|
|
bef34677cd | ||
|
|
2e393282c9 | ||
|
|
ecfff506b9 | ||
|
|
87161a14a5 | ||
|
|
b1893f4ef6 | ||
|
|
fa5244e544 | ||
|
|
d0e18dab3e | ||
|
|
e4d8d28253 | ||
|
|
77e5de20c8 | ||
|
|
17ea00ef3c | ||
|
|
04975203b7 | ||
|
|
2ad4148057 | ||
|
|
5b23d0a963 | ||
|
|
987d118b0b | ||
|
|
a380c95899 | ||
|
|
fe60bd2490 | ||
|
|
ba27560096 | ||
|
|
dcca52d3b2 | ||
|
|
e04eccc868 | ||
|
|
5266d14dac | ||
|
|
4477c02512 | ||
|
|
d55d438ef0 | ||
|
|
70135edf3a | ||
|
|
2ac03a16d4 | ||
|
|
31c83d9d12 | ||
|
|
0c34dde9e8 | ||
|
|
f1794e755a | ||
|
|
87f2094890 | ||
|
|
0963fe20b7 | ||
|
|
19fbe0bde7 | ||
|
|
06a995eebb | ||
|
|
71938d06a2 | ||
|
|
e81ddbdb4b | ||
|
|
89356a9824 | ||
|
|
d3759f9ee1 | ||
|
|
8b041ece8f | ||
|
|
63e60ec44c | ||
|
|
4350c67e44 | ||
|
|
b4ade9d887 | ||
|
|
b63d12b0e4 | ||
|
|
d09ddb6404 | ||
|
|
1c3f59def5 | ||
|
|
fdd70c6607 | ||
|
|
d38cbac770 | ||
|
|
30f23ae9f5 | ||
|
|
707325863d | ||
|
|
5688365fb3 | ||
|
|
9862cec6e8 | ||
|
|
b18e5a9228 | ||
|
|
c1450932cb | ||
|
|
0a299f7118 | ||
|
|
51efbde09f | ||
|
|
eea9396f11 | ||
|
|
35e276a33d | ||
|
|
2586fb26b2 | ||
|
|
c6ed6b629e | ||
|
|
d5a55f8541 | ||
|
|
26aac36334 | ||
|
|
50fe570566 | ||
|
|
fa5e7659fc | ||
|
|
3b85413a05 | ||
|
|
302481846e | ||
|
|
8e22a3dcd1 | ||
|
|
077168dac9 | ||
|
|
e4debc5ecb | ||
|
|
de8b11e892 | ||
|
|
64bbbf997b | ||
|
|
c7f561ce41 | ||
|
|
116d250255 | ||
|
|
49b727ca0d | ||
|
|
811a814ef9 | ||
|
|
54d5a17c13 | ||
|
|
fccc260627 | ||
|
|
f946a3ee3a | ||
|
|
d582e6208e | ||
|
|
625d54fdad | ||
|
|
841fb96543 | ||
|
|
9dab13aef7 | ||
|
|
df6d6f8aeb | ||
|
|
875bfd8300 | ||
|
|
cb640b6208 | ||
|
|
6a032e54cd | ||
|
|
a3902ce3bb | ||
|
|
8237f1ccaa | ||
|
|
90bd5e911e | ||
|
|
8297018cb5 | ||
|
|
0f8ade3867 | ||
|
|
7f7f346af4 | ||
|
|
1b7e8aac04 | ||
|
|
8d36e66a21 | ||
|
|
8369c36e88 | ||
|
|
2e5b6e0d31 | ||
|
|
2752ad19b2 | ||
|
|
b4e942b34f | ||
|
|
1e33313473 | ||
|
|
45c04dda6c | ||
|
|
b1235589bb | ||
|
|
e2fbb3e5fb | ||
|
|
90aee31ff7 | ||
|
|
b3ddc6e77f | ||
|
|
871ad4b97a | ||
|
|
24d92f8f1d | ||
|
|
06fa4a528d | ||
|
|
3992b01883 | ||
|
|
909a6cf1c4 | ||
|
|
cdd0623792 | ||
|
|
0fd63998b9 | ||
|
|
7466383539 | ||
|
|
31ea9450b6 | ||
|
|
e70bf214b8 | ||
|
|
fb46c75128 | ||
|
|
4b2ed58009 | ||
|
|
c86778cc7b | ||
|
|
99bb8f64f6 | ||
|
|
3691e75d77 | ||
|
|
3904e85e61 | ||
|
|
4fcee649df | ||
|
|
e4bf096aaf | ||
|
|
cdb0d80cde | ||
|
|
e358a4f418 | ||
|
|
0f6c84f976 | ||
|
|
63788874db | ||
|
|
ac450cbd28 | ||
|
|
2ffcb6a012 | ||
|
|
998b9207f3 | ||
|
|
c290bea476 | ||
|
|
f2ed84a256 | ||
|
|
7f3f55c94e | ||
|
|
ffcf9f9034 | ||
|
|
6116bc2627 | ||
|
|
b7c9bb024a | ||
|
|
8c412f6748 | ||
|
|
53ce49e929 | ||
|
|
b27268f7db | ||
|
|
2c1b968bff | ||
|
|
3342166f7f | ||
|
|
72f09369de | ||
|
|
6e7ff0defc | ||
|
|
193e7f565a | ||
|
|
65bcbb4777 | ||
|
|
98975ec0f5 | ||
|
|
2e9b493a05 | ||
|
|
8f1f7fe9f3 | ||
|
|
93b4fa449b | ||
|
|
ee16638d07 | ||
|
|
2e76547a79 | ||
|
|
d7b25e79aa | ||
|
|
e0efa5f28d | ||
|
|
1b98f9d99f | ||
|
|
3bb4ba919f | ||
|
|
9cf31324ff | ||
|
|
1af1b48afb | ||
|
|
86ef073aca | ||
|
|
33193e3749 | ||
|
|
9d2dc11e08 | ||
|
|
44da0e40c5 | ||
|
|
cafe8e6541 | ||
|
|
66858926cc | ||
|
|
c37b691dd5 | ||
|
|
0e3ba9922c | ||
|
|
36992fc01b | ||
|
|
5f2aab6cbe | ||
|
|
fd90487afc | ||
|
|
06b9b1fc59 | ||
|
|
0dfccdf016 | ||
|
|
69e0817503 | ||
|
|
19629000ca | ||
|
|
d13cd3333c | ||
|
|
20c396d8d7 | ||
|
|
b6903a0ad8 | ||
|
|
8d898d7170 | ||
|
|
7dd69094d1 | ||
|
|
e79e5cd235 | ||
|
|
86a051ca63 | ||
|
|
28d0338ee0 | ||
|
|
3ec9271e83 | ||
|
|
19dd66469c | ||
|
|
43d61fe909 | ||
|
|
1038a7f682 | ||
|
|
947091adf7 | ||
|
|
728aa746a0 | ||
|
|
32da247bc1 | ||
|
|
f21bb0f097 | ||
|
|
e6a5af1a96 | ||
|
|
36a0c6b103 | ||
|
|
e63653cbe1 | ||
|
|
4ca8139f77 | ||
|
|
24caaad7d9 | ||
|
|
8c2a507fcf | ||
|
|
c76f2a2556 | ||
|
|
0d7f507677 | ||
|
|
b3155d9603 | ||
|
|
9139a01e18 | ||
|
|
0541db0f28 | ||
|
|
200678a619 | ||
|
|
66556ea45c | ||
|
|
b1c23f8dee | ||
|
|
81f2fc1a84 | ||
|
|
1543daa010 | ||
|
|
500d15fec0 | ||
|
|
a30dfb2886 | ||
|
|
f16c5fb13d | ||
|
|
a134c76d50 | ||
|
|
6753d715e2 | ||
|
|
c3722987c5 | ||
|
|
7f96d8c725 | ||
|
|
7666f2d97a | ||
|
|
b73bb075fd | ||
|
|
486ae96765 | ||
|
|
eca4c14f05 | ||
|
|
3dbc0c8263 | ||
|
|
81edbf2387 | ||
|
|
cb0b2124ec | ||
|
|
eef739789f | ||
|
|
98fa89ea57 | ||
|
|
107c075d88 | ||
|
|
2f3effb33f | ||
|
|
c580023063 | ||
|
|
0f77aaf2db | ||
|
|
cc7291248f | ||
|
|
81d9ff1995 | ||
|
|
71c7d80e54 | ||
|
|
95cd90d790 | ||
|
|
c0fb92b87f | ||
|
|
9de2a0760e | ||
|
|
38efaa1e8f | ||
|
|
502d1f7077 | ||
|
|
01b0de6e80 | ||
|
|
7d8e33e12c | ||
|
|
1069d8b4ab | ||
|
|
9992cc07a3 | ||
|
|
3aed6eee31 | ||
|
|
c470b85c34 | ||
|
|
3a2ab6ec27 | ||
|
|
63eee58f89 | ||
|
|
0642e2112b | ||
|
|
e6973d0c55 | ||
|
|
7668a3cf62 | ||
|
|
cfddc2e642 | ||
|
|
1cef0acb10 | ||
|
|
c5e4047206 | ||
|
|
63c9ee02a5 | ||
|
|
2e7fe14315 | ||
|
|
f61e47c698 | ||
|
|
922f43387b | ||
|
|
73526e40b8 | ||
|
|
7ce073d3fe | ||
|
|
1b07d10212 | ||
|
|
8983749600 | ||
|
|
fa8d76e20c | ||
|
|
91fa34ebc7 | ||
|
|
14fd26b38f | ||
|
|
2301be8f6c | ||
|
|
94cf9b52b6 | ||
|
|
00e7012192 | ||
|
|
2204753a37 | ||
|
|
cd791f735c | ||
|
|
b9c65a794d | ||
|
|
b16eed45a3 | ||
|
|
ed44918e29 | ||
|
|
51a431e6ad | ||
|
|
dab04ff606 | ||
|
|
1c6540e770 | ||
|
|
02eabdf6c5 | ||
|
|
5a2e8e9bf4 | ||
|
|
5c8f2468be | ||
|
|
0d757ad96a | ||
|
|
e80b5acb0c | ||
|
|
41bf08cee2 | ||
|
|
3c3ce88192 | ||
|
|
8c0f457f23 | ||
|
|
bc14bfea99 | ||
|
|
8af821f5b8 | ||
|
|
32cb024b42 | ||
|
|
c386872443 | ||
|
|
4c95d03958 | ||
|
|
8a54bf0a71 | ||
|
|
159ceef81e | ||
|
|
c9068ed4c0 | ||
|
|
acab74d2b9 | ||
|
|
3d7ed854c7 | ||
|
|
46afd68218 | ||
|
|
6342807b26 | ||
|
|
03f5914ecf | ||
|
|
f97439c703 | ||
|
|
352c80b8b6 | ||
|
|
cecdb9c0cd | ||
|
|
052f07b103 | ||
|
|
5f31f277db | ||
|
|
793288593c | ||
|
|
bc637cc951 | ||
|
|
993a314eb6 | ||
|
|
5b7fc526bc | ||
|
|
dfb62b67e0 | ||
|
|
b85a855b7e | ||
|
|
57abf83ec5 | ||
|
|
a9eba9ddb4 | ||
|
|
1286103494 | ||
|
|
b9cd35bf20 | ||
|
|
cc15712e03 | ||
|
|
8afeb4c6c9 | ||
|
|
ccb3e41441 | ||
|
|
b74a92328c | ||
|
|
b01be99602 | ||
|
|
279de8512c | ||
|
|
6f1b29a40a | ||
|
|
a76a78c568 | ||
|
|
2207229f25 | ||
|
|
eaee160c88 | ||
|
|
b4c51b089a | ||
|
|
db473aeb45 | ||
|
|
ce43527435 | ||
|
|
174d2ec88d | ||
|
|
7152cfd6c2 | ||
|
|
9e254846f5 | ||
|
|
a1142adfe5 | ||
|
|
2d0f3aa119 | ||
|
|
587e450cdf | ||
|
|
e48b0305d5 | ||
|
|
ecd4406c42 | ||
|
|
fa1c145f94 | ||
|
|
062ca67692 | ||
|
|
0615f89ef8 | ||
|
|
67c8bf0565 | ||
|
|
f0d22ccc26 | ||
|
|
65e1cfabfe | ||
|
|
ac4fbbf247 | ||
|
|
1be0c8eb21 | ||
|
|
f57e4988b0 | ||
|
|
0df64cf8b8 | ||
|
|
444dc18700 | ||
|
|
aacebf599d | ||
|
|
8839341860 | ||
|
|
1557658d90 | ||
|
|
070faa8453 | ||
|
|
020dcf93b7 | ||
|
|
96e62cc26d | ||
|
|
c8b64b1e99 | ||
|
|
0320bf2926 | ||
|
|
668aacae7e | ||
|
|
8fee03af6d | ||
|
|
ce43b6c4af | ||
|
|
38c00319ce | ||
|
|
c67103ae33 | ||
|
|
30b2b9cdf5 | ||
|
|
ced468a360 | ||
|
|
354195d163 | ||
|
|
a3b73a5e3a | ||
|
|
bb6b8c122e | ||
|
|
3d036a08a3 | ||
|
|
1d5e097556 | ||
|
|
94bc599203 | ||
|
|
55fcc4b9f2 | ||
|
|
9f77b8c7a2 | ||
|
|
6398aa0a11 | ||
|
|
1c4399400f | ||
|
|
d1e210990f | ||
|
|
8ac5362c7c | ||
|
|
2542b5ac73 | ||
|
|
510232d6a1 | ||
|
|
2466debdaa | ||
|
|
c4dd4a24aa | ||
|
|
a3ae03e507 | ||
|
|
c14a19435c | ||
|
|
4c700e2beb | ||
|
|
373aad41d5 | ||
|
|
1326c53ae9 | ||
|
|
ce2a55406f | ||
|
|
af5f4019d3 | ||
|
|
81086f94bb | ||
|
|
7baec40185 | ||
|
|
a41f237f74 | ||
|
|
9ca5040457 | ||
|
|
aae7600497 | ||
|
|
b847b3b9c0 | ||
|
|
d8a17ea0db | ||
|
|
c9f08cd1c7 | ||
|
|
5611991490 | ||
|
|
7f24e5ebeb | ||
|
|
b4b6b75c0e | ||
|
|
5c1c6e195f | ||
|
|
12ccf40284 | ||
|
|
d6757c5228 | ||
|
|
367d7f8b30 | ||
|
|
6157a6123d | ||
|
|
7b3a8ae0bb | ||
|
|
b2cb08e0f1 | ||
|
|
50301e6afb | ||
|
|
266411cdc4 | ||
|
|
7e6c9d2106 | ||
|
|
d7b0171f9a | ||
|
|
cef8b5e20e | ||
|
|
34c7f7c0ad | ||
|
|
f293988f4f | ||
|
|
0ad2529e1d | ||
|
|
437946f7f3 | ||
|
|
b5edd7b8b2 | ||
|
|
52ccef83d3 | ||
|
|
6b324459ee | ||
|
|
33e9d3a125 | ||
|
|
6020525ad2 | ||
|
|
b3a147bb89 | ||
|
|
03bea5cfb4 | ||
|
|
3b3e212517 | ||
|
|
bf2f7059d1 | ||
|
|
803641b5ef | ||
|
|
cb0f2b789f | ||
|
|
696575a925 | ||
|
|
c96037ff3f | ||
|
|
76f4f6d90b | ||
|
|
76799e6d2a | ||
|
|
685c09df15 | ||
|
|
e8e8216f35 | ||
|
|
5c9a238abf | ||
|
|
54dde87b47 | ||
|
|
92c579228e | ||
|
|
e080c27251 | ||
|
|
f3e720c129 | ||
|
|
b9e6dd787e | ||
|
|
d00a1db48e | ||
|
|
500bd26e56 | ||
|
|
73bc0a596a | ||
|
|
02e6c71099 | ||
|
|
1445bbd4a9 | ||
|
|
c0e2a0498b | ||
|
|
c493761abc | ||
|
|
4c07e02372 | ||
|
|
354665f069 | ||
|
|
43b4fff014 | ||
|
|
c14505fb28 | ||
|
|
7f4291e460 | ||
|
|
f8a367a1c8 | ||
|
|
c1bcd61d5a | ||
|
|
9a9aca0ae0 | ||
|
|
fad3fc4580 | ||
|
|
2c36419fd7 | ||
|
|
812b488515 | ||
|
|
bd3a98905f | ||
|
|
3a226bac77 | ||
|
|
29f812aaaf | ||
|
|
7d3dd41f59 | ||
|
|
422bda7983 | ||
|
|
e7f12e3df4 | ||
|
|
28eb1260d5 | ||
|
|
9dc22085ee | ||
|
|
3d8457d5df | ||
|
|
c41d08a4fe | ||
|
|
0e737a1aa8 | ||
|
|
7bb0d7b232 | ||
|
|
29a6c8b996 | ||
|
|
0f4438f581 | ||
|
|
1c5211c47c | ||
|
|
b0b67d51dd | ||
|
|
1c5942ad96 | ||
|
|
c635b65d75 | ||
|
|
a15a2f0f89 | ||
|
|
1a80387c54 | ||
|
|
bea74662db | ||
|
|
fcfe309839 | ||
|
|
918c27f1fd | ||
|
|
8f6706e1b4 | ||
|
|
ab0f7cab07 | ||
|
|
4d16d6b5bb | ||
|
|
080520c272 | ||
|
|
3d1d7b1287 | ||
|
|
92bf42fc66 | ||
|
|
38e75af977 | ||
|
|
978d7f0520 | ||
|
|
10ca108e3e | ||
|
|
c6238c8a36 | ||
|
|
8bb5ff94c8 | ||
|
|
fec5d9b436 | ||
|
|
6f97fcc1b4 | ||
|
|
7c5116b1cb | ||
|
|
fbd6f853f2 | ||
|
|
31127430b1 | ||
|
|
b6849aa02d | ||
|
|
ffe501d0dc | ||
|
|
9bc7938f97 | ||
|
|
61874d3b39 | ||
|
|
fb6e291605 | ||
|
|
a73cef8b2f | ||
|
|
bd1f3c3ac6 | ||
|
|
012ed970ba | ||
|
|
1dce831baf | ||
|
|
c9a11ad2a3 | ||
|
|
1c88d96cc5 | ||
|
|
c3bfea5f59 | ||
|
|
008e2f7b03 | ||
|
|
62d54535fb | ||
|
|
08b5f4bb35 | ||
|
|
d705685298 | ||
|
|
d1ac8c42ee | ||
|
|
d5ba02861e | ||
|
|
d982853a2e | ||
|
|
fb6d42d137 | ||
|
|
067b24e63c | ||
|
|
aa0a39cd64 | ||
|
|
f1671ec6d8 | ||
|
|
778b255877 | ||
|
|
ed67d22986 | ||
|
|
390c852c39 | ||
|
|
13de75de47 | ||
|
|
a0a8897378 | ||
|
|
380ec72221 | ||
|
|
9b4a4b954f | ||
|
|
326c9dd81b | ||
|
|
d2e6437909 | ||
|
|
9349388777 | ||
|
|
5747efba6b | ||
|
|
c4db612a9d | ||
|
|
7df2f7befd | ||
|
|
13ea94f9b5 | ||
|
|
48b2e9b0e1 | ||
|
|
8e38047d13 | ||
|
|
1c2d8da629 | ||
|
|
6b805f730d | ||
|
|
a0999bd081 | ||
|
|
06f5d659d5 | ||
|
|
9a52be8470 | ||
|
|
35140e77df | ||
|
|
69915ed0dd | ||
|
|
6e2105337d | ||
|
|
956429f1ad | ||
|
|
14d1506df8 | ||
|
|
562c3c741c | ||
|
|
17318fe08b | ||
|
|
49627a90ba | ||
|
|
578d69a225 | ||
|
|
3e57401ce2 | ||
|
|
5c1c55ae80 | ||
|
|
48f3ee95c8 | ||
|
|
bac49870cb | ||
|
|
6c55058ddb | ||
|
|
19785fe226 | ||
|
|
18077c9d67 | ||
|
|
492c353fc2 | ||
|
|
515171c79d | ||
|
|
3f40e8029b | ||
|
|
76023ce723 | ||
|
|
93726208ff | ||
|
|
7ad59e353d | ||
|
|
922709e245 | ||
|
|
bd216dde19 | ||
|
|
b115bd818d | ||
|
|
3704a4cd96 | ||
|
|
5c3c73d018 | ||
|
|
6deac15c5b | ||
|
|
0ac5b04974 | ||
|
|
fc21b101f4 | ||
|
|
c8fc36825c | ||
|
|
14ce50bf97 | ||
|
|
9b63a6feb7 | ||
|
|
981eb235b1 | ||
|
|
2e6e62cf53 | ||
|
|
dde00c6bc4 | ||
|
|
e39ff078f6 | ||
|
|
77408f5692 | ||
|
|
9372f1fea6 | ||
|
|
323844cfdb | ||
|
|
ea63242596 | ||
|
|
664476d0b0 | ||
|
|
477f0030c4 | ||
|
|
75dc3c43db | ||
|
|
27896db5ac | ||
|
|
1d7104884b | ||
|
|
44f9dc1811 | ||
|
|
3d3cf46c05 | ||
|
|
7e7f38836a | ||
|
|
88db44afdd | ||
|
|
895c105206 | ||
|
|
d2227c5eae | ||
|
|
551b297539 | ||
|
|
9d629213d5 | ||
|
|
04978c04e2 | ||
|
|
6811b241e9 | ||
|
|
a70f28bc9f | ||
|
|
27a9c6b31c | ||
|
|
57a7bf240f | ||
|
|
a40523f14c | ||
|
|
ecb4b80683 | ||
|
|
23c9854d29 | ||
|
|
5dc30d9e0f | ||
|
|
e7a1db1c17 | ||
|
|
9872f60ce0 | ||
|
|
aca3e9a719 | ||
|
|
22eea91a55 | ||
|
|
69c7bd60a5 | ||
|
|
98fc13fc18 | ||
|
|
4e74154999 | ||
|
|
a40ac013f5 | ||
|
|
8e62748989 | ||
|
|
e2780c7c6e | ||
|
|
53e3c78808 | ||
|
|
81ccbc395e | ||
|
|
28d6455924 | ||
|
|
871c99cf4e | ||
|
|
44bd2831be | ||
|
|
0cb62293fd | ||
|
|
a1c65c6d7f | ||
|
|
f3b69b69b7 | ||
|
|
135798c6b0 | ||
|
|
5731ff45b3 | ||
|
|
f5b6c84c16 | ||
|
|
de828a101b | ||
|
|
5ec497e683 | ||
|
|
04e8cb177b | ||
|
|
481023a921 | ||
|
|
92ab37d6e3 | ||
|
|
01a4a40a0b | ||
|
|
d99d7f98b9 | ||
|
|
ae79781ab8 | ||
|
|
302f359bc3 | ||
|
|
7eec94b5da | ||
|
|
2a5eabe57e | ||
|
|
eee60a605e | ||
|
|
40c199df51 | ||
|
|
76925c32a0 | ||
|
|
be4aa89313 | ||
|
|
44f008b186 | ||
|
|
6b3b1843bd | ||
|
|
23db7f2706 | ||
|
|
ec005a4189 | ||
|
|
641c23b36d | ||
|
|
f7328566b9 | ||
|
|
2731a29800 | ||
|
|
0ed84eda47 | ||
|
|
ee92c0d751 | ||
|
|
081c8d0a11 | ||
|
|
b3d8f8fdc5 | ||
|
|
56f96afd28 | ||
|
|
fff5250117 | ||
|
|
b7acf31666 | ||
|
|
e20e26ed12 | ||
|
|
46ee9fa8d9 | ||
|
|
7d4cf1feb1 | ||
|
|
d4ccb8fde3 | ||
|
|
98339dfbfd | ||
|
|
591f013dd4 | ||
|
|
0dbe98229f | ||
|
|
0b1f3fdeae | ||
|
|
560be6a5df | ||
|
|
aa72d6fec2 | ||
|
|
0ee2a4164b | ||
|
|
1b9e40b929 | ||
|
|
7cbd168631 | ||
|
|
e97eb07752 | ||
|
|
3ee6c3bcf4 | ||
|
|
cb0b555bc1 | ||
|
|
c0495b65b5 | ||
|
|
d0f58770cd | ||
|
|
27a2783818 | ||
|
|
72428feb5e | ||
|
|
5b93cea14a | ||
|
|
8e795df52e | ||
|
|
0e7420f8ea | ||
|
|
c049ea8c0e | ||
|
|
5207819363 | ||
|
|
79374c08b2 | ||
|
|
2c6fc5c518 | ||
|
|
b9a275fb20 | ||
|
|
8883ee097d | ||
|
|
fdef4e5413 | ||
|
|
53235d66fe | ||
|
|
e30f3a0ec1 | ||
|
|
328d9634c6 | ||
|
|
fbdff5a85f | ||
|
|
f04825c271 | ||
|
|
5b7e2fce4d | ||
|
|
1bfc8b2a85 | ||
|
|
60ff95fa23 | ||
|
|
e070ec1ef0 | ||
|
|
1bf167605e | ||
|
|
7674fec8df | ||
|
|
b097c7bd9b | ||
|
|
c70ea64a57 | ||
|
|
ef16b52d29 | ||
|
|
db728285fe | ||
|
|
772637d41e | ||
|
|
10f9abe49a | ||
|
|
8a083404dd | ||
|
|
d56de3378b |
@@ -0,0 +1,32 @@
|
||||
name: 🐛 Bug Report
|
||||
description: Report a bug in the ion-icon component. Incorrect icons should use the "Incorrect Icon" template instead.
|
||||
labels: ['triage']
|
||||
title: 'bug: '
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Current Behavior
|
||||
description: A clear description of what the bug is and how it manifests.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: A clear description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: Please explain the steps required to duplicate this issue.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Code Reproduction URL
|
||||
description: Please provide an application with the minimum code required to reproduce the issue. This is the best way to ensure this issue is triaged quickly. Issues without a code reproduction may be closed if the Ionic Team cannot reproduce the issue you are reporting.
|
||||
placeholder: https://github.com/...
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Information
|
||||
description: List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc.
|
||||
@@ -0,0 +1,23 @@
|
||||
name: 💡 Feature Request
|
||||
description: Suggest a new feature for the ion-icon component. Icon requests should use the "Icon Request" template instead.
|
||||
labels: ['triage']
|
||||
title: 'feat: '
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe Problem
|
||||
description: A clear and concise description of what the problem is. Ex. I am always frustrated when [...]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe Preferred Solution
|
||||
description: A clear and concise description of what you want to happen.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe Alternatives
|
||||
description: A clear and concise description of any alternative solutions or features you have considered.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Information
|
||||
description: Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,19 @@
|
||||
name: 🚀 Icon Request
|
||||
description: Request a new icon
|
||||
labels: ['triage']
|
||||
title: 'icon request: '
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the Icon
|
||||
description: A clear and concise description of the icon you would like added.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Links to Examples
|
||||
description: Add links to any examples of the icon in other libraries that you like.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Information
|
||||
description: Add any other context about the icon request here.
|
||||
@@ -0,0 +1,17 @@
|
||||
name: 😒 Incorrect Icon
|
||||
description: Report an incorrect icon
|
||||
labels: ['triage']
|
||||
title: 'incorrect icon: '
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the Issue
|
||||
description: A clear description of what is wrong with the icon. Please include any relevant screenshots.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
description: A clear description of what the icon should look like. Please include any relevant screenshots.
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,105 @@
|
||||
triage:
|
||||
label: triage
|
||||
dryRun: false
|
||||
|
||||
closeAndLock:
|
||||
labels:
|
||||
- label: 'ionitron: support'
|
||||
message: >
|
||||
Thanks for the issue! This issue appears to be a support request. We use this issue tracker exclusively for
|
||||
bug reports and feature requests. Please use our [forum](https://forum.ionicframework.com/) for help or
|
||||
questions about Ionicons.
|
||||
|
||||
|
||||
Thank you for using Ionicons!
|
||||
- label: 'ionitron: missing template'
|
||||
message: >
|
||||
Thanks for the issue! It appears that you have not filled out the provided issue template. We use this issue
|
||||
template in order to gather more information and further assist you. Please create a new issue and ensure the
|
||||
template is fully filled out.
|
||||
|
||||
|
||||
Thank you for using Ionicons!
|
||||
close: true
|
||||
lock: true
|
||||
dryRun: false
|
||||
|
||||
comment:
|
||||
labels:
|
||||
- label: 'help wanted'
|
||||
message: >
|
||||
This issue has been labeled as `help wanted`. This label is added to issues
|
||||
that we believe would be good for contributors.
|
||||
|
||||
|
||||
If you'd like to work on this issue, please comment here letting us know that
|
||||
you would like to submit a pull request for it. This helps us to keep track of
|
||||
the pull request and make sure there isn't duplicated effort.
|
||||
|
||||
|
||||
For a guide on how to create a pull request and test this project locally to see
|
||||
your changes, see our [contributing documentation](https://github.com/ionic-team/ionicons/blob/main/.github/CONTRIBUTING.md#creating-a-pull-request).
|
||||
|
||||
|
||||
Thank you!
|
||||
- label: 'ionitron: needs reproduction'
|
||||
message: >
|
||||
Thanks for the issue! This issue has been labeled as `needs reproduction`. This label is added to issues that
|
||||
need a code reproduction.
|
||||
|
||||
|
||||
Please reproduce this issue and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a
|
||||
reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
|
||||
|
||||
|
||||
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was
|
||||
not enough for our team to reproduce the issue.
|
||||
- label: 'community feedback wanted'
|
||||
message: >
|
||||
This issue has been labeled as `community feedback wanted`. This label is added to issues that we would like to hear from the community on before moving forward with any final decision on the feature request.
|
||||
|
||||
|
||||
If the requested feature is something you would find useful for your applications, please react to the original post with 👍 (`+1`). If you would like to provide an additional use case for the feature, please post a comment.
|
||||
|
||||
|
||||
The team will review this feedback and make a final decision. Any decision will be posted on this thread, but please note that we may ultimately decide not to pursue this feature.
|
||||
|
||||
|
||||
Thank you!
|
||||
dryRun: false
|
||||
|
||||
noReply:
|
||||
days: 14
|
||||
maxIssuesPerRun: 100
|
||||
label: 'needs: reply'
|
||||
responseLabel: triage
|
||||
exemptProjects: true
|
||||
exemptMilestones: true
|
||||
message: >
|
||||
Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still
|
||||
an issue with the latest version of Ionicons, please create a new issue and ensure the
|
||||
template is fully filled out.
|
||||
|
||||
|
||||
Thank you for using Ionicons!
|
||||
close: true
|
||||
lock: true
|
||||
dryRun: false
|
||||
|
||||
noReproduction:
|
||||
days: 14
|
||||
maxIssuesPerRun: 100
|
||||
label: 'ionitron: needs reproduction'
|
||||
responseLabel: triage
|
||||
exemptProjects: true
|
||||
exemptMilestones: true
|
||||
message: >
|
||||
Thanks for the issue! This issue is being closed due to the lack of a code reproduction. If this is still
|
||||
an issue with the latest version of Ionicons, please create a new issue and ensure the
|
||||
template is fully filled out.
|
||||
|
||||
|
||||
Thank you for using Ionicons!
|
||||
close: true
|
||||
lock: true
|
||||
dryRun: false
|
||||
@@ -0,0 +1,34 @@
|
||||
name: 'Build Ionicons'
|
||||
description: 'Build Ionicons'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
# Checkout the latest commit in this branch
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Cache Node Modules
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: node-modules
|
||||
with:
|
||||
path: ./node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}-v1
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
shell: bash
|
||||
- name: Build
|
||||
run: npm run build
|
||||
shell: bash
|
||||
- uses: ./.github/workflows/actions/upload-archive
|
||||
with:
|
||||
name: ionicons-build
|
||||
output: IoniconsBuild.zip
|
||||
paths: dist components icons www
|
||||
- uses: ./.github/workflows/actions/upload-archive
|
||||
with:
|
||||
name: ionicons-src
|
||||
output: IoniconsSrc.zip
|
||||
paths: src
|
||||
@@ -0,0 +1,19 @@
|
||||
name: 'Archive Download'
|
||||
description: 'Downloads and decompresses an archive from a previous job'
|
||||
inputs:
|
||||
path:
|
||||
description: 'Input archive name'
|
||||
filename:
|
||||
description: 'Input file name'
|
||||
name:
|
||||
description: 'Archive name'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.name }}
|
||||
path: ${{ inputs.path }}
|
||||
- name: Exract Archive
|
||||
run: unzip -q -o ${{ inputs.path }}/${{ inputs.filename }}
|
||||
shell: bash
|
||||
@@ -0,0 +1,63 @@
|
||||
name: 'Release'
|
||||
description: 'Releases a package'
|
||||
inputs:
|
||||
version:
|
||||
description: 'The type of version to release.'
|
||||
tag:
|
||||
description: 'The tag to publish to on NPM.'
|
||||
working-directory:
|
||||
description: 'The directory of the package.'
|
||||
folder:
|
||||
default: './'
|
||||
description: 'A folder containing a package.json file.'
|
||||
createRelease:
|
||||
description: 'Create a release on GitHub.'
|
||||
default: 'false'
|
||||
ghToken:
|
||||
description: 'The GitHub authentication token required to create a release.'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
- name: Install latest npm
|
||||
run: npm install -g npm@latest
|
||||
shell: bash
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
- name: Set Git User
|
||||
run: |
|
||||
git config user.name ionitron
|
||||
git config user.email hi@ionicframework.com
|
||||
shell: bash
|
||||
- name: Update Version
|
||||
id: update_version
|
||||
run: |
|
||||
npm version ${{ inputs.version }}
|
||||
echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
- name: Run Build
|
||||
run: npm run build
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
- name: Publish to NPM
|
||||
run: npm publish ${{ inputs.folder }} --tag ${{ inputs.tag }} --provenance
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
|
||||
- name: Create Release
|
||||
if: ${{ inputs.createRelease == 'true' }}
|
||||
run: |
|
||||
git remote set-url origin https://${GH_TOKEN}:x-oauth-basic@github.com/ionic-team/ionicons.git
|
||||
git remote -v
|
||||
git push origin main --tags
|
||||
gh release create "v$VERSION" --title "v$VERSION" --generate-notes
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ inputs.ghToken }}
|
||||
VERSION: ${{ env.VERSION }}
|
||||
@@ -0,0 +1,84 @@
|
||||
name: 'Test E2E'
|
||||
description: 'Test E2E'
|
||||
inputs:
|
||||
shard:
|
||||
description: 'Playwright Test Shard (ex: 2)'
|
||||
totalShards:
|
||||
description: 'Playwright total number of test shards (ex: 4)'
|
||||
update:
|
||||
description: 'Whether or not to update the reference snapshots'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Cache Node Modules
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: node-modules
|
||||
with:
|
||||
path: ./node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}-v1
|
||||
- uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
name: ionicons-build
|
||||
path: .
|
||||
filename: IoniconsBuild.zip
|
||||
- uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
name: ionicons-src
|
||||
path: .
|
||||
filename: IoniconsSrc.zip
|
||||
- name: Install Playwright Dependencies
|
||||
run: npx playwright install && npx playwright install-deps
|
||||
shell: bash
|
||||
- name: Test
|
||||
if: inputs.update != 'true'
|
||||
run: npx playwright test --shard=${{ inputs.shard }}/${{ inputs.totalShards }}
|
||||
shell: bash
|
||||
- name: Test and Update
|
||||
id: test-and-update
|
||||
if: inputs.update == 'true'
|
||||
# Keep track of the files that were
|
||||
# changed so they can be correctly restored
|
||||
# in the combine step.
|
||||
# To do this, we move only the changed files
|
||||
# to a separate directory, while preserving the
|
||||
# directory structure of the source.
|
||||
# When, we create and archive of these results
|
||||
# so that the combine step can simply
|
||||
# unzip and move the changed files into place.
|
||||
# We have extra logic added so that job runners
|
||||
# that do not have any new screenshots do not create
|
||||
# an unnecessary .zip.
|
||||
run: |
|
||||
npx playwright test --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
|
||||
git add src/\*.png --force
|
||||
mkdir updated-screenshots
|
||||
rsync -R --progress $(git diff --name-only --cached) updated-screenshots
|
||||
if [ "$(ls -A updated-screenshots)" ]; then
|
||||
echo "hasUpdatedScreenshots=$(echo 'true')" >> $GITHUB_OUTPUT
|
||||
cd updated-screenshots
|
||||
ls
|
||||
zip -q -r ../UpdatedScreenshots-${{ inputs.shard }}-${{ inputs.totalShards }}.zip ./
|
||||
fi
|
||||
shell: bash
|
||||
- name: Archive Updated Screenshots
|
||||
if: inputs.update == 'true' && steps.test-and-update.outputs.hasUpdatedScreenshots == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: updated-screenshots-${{ inputs.shard }}-${{ inputs.totalShards }}
|
||||
path: UpdatedScreenshots-${{ inputs.shard }}-${{ inputs.totalShards }}.zip
|
||||
- name: Archive Test Results
|
||||
# The always() ensures that this step
|
||||
# runs even if the previous step fails.
|
||||
# We want the test results to be archived
|
||||
# even if the test fails in the previous
|
||||
# step, otherwise there would be no way
|
||||
# to debug these tests.
|
||||
if: always()
|
||||
uses: ./.github/workflows/actions/upload-archive
|
||||
with:
|
||||
name: test-results-${{ inputs.shard }}-${{ inputs.totalShards }}
|
||||
output: TestResults-${{ inputs.shard }}-${{ inputs.totalShards }}.zip
|
||||
paths: playwright-report
|
||||
@@ -0,0 +1,22 @@
|
||||
name: 'Test Spec'
|
||||
description: 'Test Spec'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Cache Node Modules
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: node-modules
|
||||
with:
|
||||
path: ./node_modules
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package-lock.json') }}-v1
|
||||
- uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
name: ionicons-build
|
||||
path: .
|
||||
filename: IoniconsBuild.zip
|
||||
- name: Test
|
||||
run: npm run test.spec -- --ci
|
||||
shell: bash
|
||||
@@ -0,0 +1,38 @@
|
||||
name: 'Update Reference Screenshots'
|
||||
description: 'Update Reference Screenshots'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./artifacts
|
||||
- name: Extract Archives
|
||||
# This finds all .zip files in the ./artifacts
|
||||
# directory, including nested directories.
|
||||
# It then unzips every .zip to the root directory
|
||||
run: |
|
||||
find . -type f -name 'UpdatedScreenshots-*.zip' -exec unzip -q -o -d ../ {} \;
|
||||
shell: bash
|
||||
working-directory: ./artifacts
|
||||
- name: Push Screenshots
|
||||
# Configure user as Ionitron
|
||||
# and push only the changed .png snapshots
|
||||
# to the remote branch.
|
||||
# Screenshots are in .gitignore
|
||||
# to prevent local screenshots from getting
|
||||
# pushed to Git. As a result, we need --force
|
||||
# here so that CI generated screenshots can
|
||||
# get added to git. Screenshot ground truths
|
||||
# should only be added via this CI process.
|
||||
run: |
|
||||
git config user.name ionitron
|
||||
git config user.email hi@ionicframework.com
|
||||
git add src/\*.png --force
|
||||
git commit -m "chore(): add updated snapshots"
|
||||
git push
|
||||
shell: bash
|
||||
@@ -0,0 +1,19 @@
|
||||
name: 'Archive Upload'
|
||||
description: 'Compresses and uploads an archive to be reused across jobs'
|
||||
inputs:
|
||||
paths:
|
||||
description: 'Paths to files or directories to archive'
|
||||
output:
|
||||
description: 'Output file name'
|
||||
name:
|
||||
description: 'Archive name'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Create Archive
|
||||
run: zip -q -r ${{ inputs.output }} ${{ inputs.paths }}
|
||||
shell: bash
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.name }}
|
||||
path: ${{ inputs.output }}
|
||||
@@ -0,0 +1,43 @@
|
||||
name: 'Dev Release'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
create-dev-hash:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
dev-hash: ${{ steps.create-dev-hash.outputs.DEV_HASH }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Dependencies
|
||||
run: npm ci --no-package-lock
|
||||
shell: bash
|
||||
- id: create-dev-hash
|
||||
name: Create Dev Hash
|
||||
run: |
|
||||
echo "DEV_HASH=$(node ./scripts/bump-version.js)-dev.1$(date +%s).1$(git log -1 --format=%H | cut -c 1-7)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
release-ionicons:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [create-dev-hash]
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Publish to NPM
|
||||
uses: ./.github/workflows/actions/publish-npm
|
||||
with:
|
||||
tag: dev
|
||||
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
|
||||
working-directory: './'
|
||||
createRelease: 'false'
|
||||
|
||||
get-build:
|
||||
name: Get your dev build!
|
||||
runs-on: ubuntu-latest
|
||||
needs: [create-dev-hash, release-ionicons]
|
||||
steps:
|
||||
- run: echo ${{ needs.create-dev-hash.outputs.dev-hash }}
|
||||
@@ -0,0 +1,28 @@
|
||||
name: 'Production Release'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
required: false
|
||||
type: string
|
||||
description: npm version (major, minor, or patch)
|
||||
|
||||
jobs:
|
||||
release-ionicons:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.IONITRON_TOKEN }}
|
||||
- name: Publish to NPM
|
||||
uses: ./.github/workflows/actions/publish-npm
|
||||
with:
|
||||
tag: latest
|
||||
version: ${{ inputs.version }}
|
||||
working-directory: './'
|
||||
createRelease: true
|
||||
ghToken: ${{ secrets.IONITRON_TOKEN }}
|
||||
@@ -0,0 +1,37 @@
|
||||
name: 'Release Orchestrator'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release-type:
|
||||
description: 'Release type'
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- dev
|
||||
- production
|
||||
version:
|
||||
description: 'Version for production releases'
|
||||
required: false
|
||||
type: choice
|
||||
options:
|
||||
- patch
|
||||
- minor
|
||||
- major
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
run-dev:
|
||||
if: ${{ inputs.release-type == 'dev' }}
|
||||
uses: ./.github/workflows/dev-release.yml
|
||||
secrets: inherit
|
||||
|
||||
run-production:
|
||||
if: ${{ inputs.release-type == 'production' }}
|
||||
uses: ./.github/workflows/production-release.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
@@ -0,0 +1,52 @@
|
||||
name: 'Update Reference Screenshots'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/workflows/actions/build-core
|
||||
|
||||
test-e2e:
|
||||
strategy:
|
||||
# This ensures that all screenshot shard
|
||||
# failures are reported so the dev can
|
||||
# review everything at once.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Divide the tests into n buckets
|
||||
# and run those buckets in parallel.
|
||||
# To increase the number of shards,
|
||||
# add new items to the shard array
|
||||
# and change the value of totalShards
|
||||
# to be the length of the shard array.
|
||||
shard: [1, 2, 3]
|
||||
totalShards: [3]
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/workflows/actions/test-e2e
|
||||
with:
|
||||
shard: ${{ matrix.shard }}
|
||||
totalShards: ${{ matrix.totalShards }}
|
||||
update: true
|
||||
|
||||
update-reference-screenshots:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-e2e]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# Normally, we could just push with the
|
||||
# default GITHUB_TOKEN, but that will
|
||||
# not cause the build workflow
|
||||
# to re-run. We use Ionitron's
|
||||
# Personal Access Token instead
|
||||
# to allow for this build workflow
|
||||
# to run when the screenshots are pushed.
|
||||
with:
|
||||
token: ${{ secrets.IONITRON_TOKEN }}
|
||||
- uses: ./.github/workflows/actions/update-reference-screenshots
|
||||
@@ -0,0 +1,73 @@
|
||||
name: 'Validation'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ['**']
|
||||
push:
|
||||
branches: ['main']
|
||||
|
||||
# When pushing a new commit we should
|
||||
# cancel the previous test run to not
|
||||
# consume more runners than we need to.
|
||||
concurrency:
|
||||
group: ${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
# Checkout the latest commit in this branch
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: ./.github/workflows/actions/build-core
|
||||
|
||||
test-spec:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/workflows/actions/test-spec
|
||||
|
||||
test-e2e:
|
||||
strategy:
|
||||
# This ensures that all screenshot shard
|
||||
# failures are reported so the dev can
|
||||
# review everything at once.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Divide the tests into n buckets
|
||||
# and run those buckets in parallel.
|
||||
# To increase the number of shards,
|
||||
# add new items to the shard array
|
||||
# and change the value of totalShards
|
||||
# to be the length of the shard array.
|
||||
shard: [1, 2, 3]
|
||||
totalShards: [3]
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/workflows/actions/test-e2e
|
||||
with:
|
||||
shard: ${{ matrix.shard }}
|
||||
totalShards: ${{ matrix.totalShards }}
|
||||
|
||||
# Screenshots are required to pass
|
||||
# in order for the branch to be merge
|
||||
# eligible. However, the screenshot tests
|
||||
# are run on n runners where n can change
|
||||
# over time. The verify-screenshots step allows
|
||||
# us to have a required status check for screenshot
|
||||
# results without having to manually add each
|
||||
# matrix run in the branch protection rules
|
||||
# Source: https://github.community/t/status-check-for-a-matrix-jobs/127354
|
||||
verify-e2e:
|
||||
if: ${{ always() }}
|
||||
needs: test-e2e
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check build matrix status
|
||||
if: ${{ needs.test-e2e.result != 'success' }}
|
||||
run: exit 1
|
||||
@@ -1,2 +1,27 @@
|
||||
_site
|
||||
*.swp
|
||||
*~
|
||||
*.sw[mnpcod]
|
||||
*.log
|
||||
*.lock
|
||||
*.tmp
|
||||
*.tmp.*
|
||||
log.txt
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
.idea/
|
||||
.versions/
|
||||
.vscode/
|
||||
/components/
|
||||
node_modules/
|
||||
tmp/
|
||||
dist/
|
||||
icons/
|
||||
.DS_Store
|
||||
scripts/*.js
|
||||
!scripts/install-loader.js
|
||||
|
||||
www/
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/playwright/.cache/
|
||||
/src/**/*-snapshots
|
||||
*.tgz
|
||||
@@ -0,0 +1 @@
|
||||
src/components.d.ts
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"jsxSingleQuote": false,
|
||||
"quoteProps": "consistent",
|
||||
"printWidth": 120,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "all",
|
||||
"useTabs": false
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Change Log
|
||||
|
||||
Please see https://github.com/ionic-team/ionicons/releases
|
||||
@@ -0,0 +1,11 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of the Ionicons project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
|
||||
|
||||
Communication through any of Ionic's channels (GitHub, Slack, Forum, IRC, mailing lists, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Ionicons project to do the same.
|
||||
|
||||
If any member of the community violates this code of conduct, the maintainers of the Ionicons project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
|
||||
|
||||
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [hi@ionicframework.com](mailto:hi@ionicframework.com).
|
||||
@@ -0,0 +1,196 @@
|
||||
# Contributing to Ionicons
|
||||
|
||||
Thank you for your interest in contributing to Ionicons! :tada:
|
||||
|
||||
This document outlines the guidelines and processes for contributing to this project.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Code of Conduct](#code-of-conduct)
|
||||
- [Getting Started](#getting-started)
|
||||
* [Prerequisites](#prerequisites)
|
||||
* [Environment Setup](#environment-setup)
|
||||
- [Development Workflow](#development-workflow)
|
||||
* [Branch Strategy](#branch-strategy)
|
||||
* [Component Modifications](#component-modifications)
|
||||
* [Testing](#testing)
|
||||
* [Code Style](#code-style)
|
||||
* [Building](#building)
|
||||
- [Submitting Issues](#submitting-issues)
|
||||
- [Submitting Pull Requests](#submitting-pull-requests)
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Please read our [Contributor Code of Conduct](./CODE_OF_CONDUCT.md) for information on our rules of conduct. By contributing to Ionicons, you agree to abide by its terms.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Node.js](https://nodejs.org/) (LTS version recommended)
|
||||
- [npm](https://www.npmjs.com/) (comes with Node.js)
|
||||
- Git
|
||||
|
||||
### Environment Setup
|
||||
|
||||
1. We recommend using [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) to manage Node.js versions:
|
||||
- For macOS/Linux: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash`
|
||||
- For Windows: Use [nvm-windows](https://github.com/coreybutler/nvm-windows)
|
||||
- Install and use the LTS version: `nvm install --lts && nvm use --lts`
|
||||
|
||||
Alternatively, you can [download the installer](https://nodejs.org/) for the LTS version of Node.js directly.
|
||||
|
||||
2. Fork the repository on GitHub
|
||||
3. Clone your fork locally:
|
||||
```bash
|
||||
git clone https://github.com/YOUR-USERNAME/ionicons.git
|
||||
cd ionicons
|
||||
```
|
||||
4. Add the original repository as an upstream remote:
|
||||
```bash
|
||||
git remote add upstream https://github.com/ionic-team/ionicons.git
|
||||
```
|
||||
5. Create a new branch from `main` for your change:
|
||||
```bash
|
||||
git checkout -b your-feature-branch
|
||||
```
|
||||
6. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
7. Run the initial build:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
8. If desired, [modify the Icon Component](#component-modifications)
|
||||
9. Or, modify and preview the site
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Branch Strategy
|
||||
|
||||
- Always create a new branch from `main` for your changes:
|
||||
```bash
|
||||
git checkout main
|
||||
git pull upstream main
|
||||
git checkout -b your-feature-branch
|
||||
```
|
||||
|
||||
### Component Modifications
|
||||
|
||||
If you're modifying the `ion-icon` component:
|
||||
|
||||
1. Navigate to `src/components/` directory and open the `icon` component to modify
|
||||
2. Make your changes to the component code
|
||||
3. Test your changes locally with `npm start`
|
||||
4. Run the full test suite: `npm run test.spec` for unit tests and `npm run test.e2e` for E2E tests
|
||||
5. All PRs that change component behavior must include tests covering the changes
|
||||
|
||||
### Testing
|
||||
|
||||
Tests are crucial for maintaining confidence in changes. All PRs that modify component behavior must include tests covering those changes.
|
||||
|
||||
#### Local Development & Previewing
|
||||
|
||||
To preview component changes during development:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
This starts the dev server with live-reloading. The test landing page displays all available test pages.
|
||||
|
||||
Test pages are organized in `src/components/icon/test/` with individual folders for each test scenario.
|
||||
|
||||
#### Unit Tests
|
||||
|
||||
Run Jest tests for component logic:
|
||||
|
||||
```bash
|
||||
npm run test.spec
|
||||
```
|
||||
|
||||
#### E2E Tests
|
||||
|
||||
Run Playwright tests to generate visual regression snapshots and verify component behavior:
|
||||
|
||||
```bash
|
||||
npm run test.e2e
|
||||
```
|
||||
|
||||
View the HTML report after tests complete:
|
||||
|
||||
```bash
|
||||
npx playwright show-report
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
> All E2E test navigation URLs must include a trailing slash (e.g., `/icon/test/basic/` not `/icon/test/basic`). The trailing slash ensures proper directory routing, correct timing for script initialization, and consistent page loading across browsers.
|
||||
|
||||
##### Updating Snapshots
|
||||
|
||||
To update visual regression snapshots with new baselines:
|
||||
|
||||
```bash
|
||||
npm run test.e2e -- --update-snapshots
|
||||
```
|
||||
|
||||
Or for a specific test:
|
||||
|
||||
```bash
|
||||
npm run test.e2e -- src/components/icon/test/basic/icon.e2e.ts --update-snapshots
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Updating snapshots locally updates your gitignored screenshot files for local testing. To update the official repository snapshots, run the "Update Reference Screenshots" GitHub action with your development branch selected.
|
||||
|
||||
### Code Style
|
||||
|
||||
- This project uses Prettier for code formatting
|
||||
- Run `npm run prettier` to format your code before submitting
|
||||
|
||||
### Building
|
||||
|
||||
- Run `npm run build` to build the complete package
|
||||
- Run `npm run build.files` to rebuild only the SVG icon files
|
||||
|
||||
## Submitting Issues
|
||||
|
||||
Please submit issues for:
|
||||
- Bug reports
|
||||
- Feature requests
|
||||
- General questions about the project
|
||||
|
||||
When creating issues:
|
||||
|
||||
1. If you have a question about using Ionicons, please ask on the [Ionic Forum](http://forum.ionicframework.com/) or in the [Ionic Discord](https://ionic.link/discord).
|
||||
|
||||
2. It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
|
||||
|
||||
3. The issue list of this repository is exclusively for bug reports and feature requests. Non-conforming issues will be closed immediately.
|
||||
|
||||
4. Check if a similar issue already exists by searching through [existing issues](https://github.com/ionic-team/ionicons/issues?utf8=%E2%9C%93&q=is%3Aissue). You can search through existing issues to see if there is a similar one reported. Include closed issues as it may have been closed with a solution.
|
||||
|
||||
5. Use the provided issue templates and clearly describe:
|
||||
- Expected behavior
|
||||
- Actual behavior
|
||||
- Steps to reproduce (for bugs)
|
||||
- Browser/device information when relevant
|
||||
|
||||
6. [Create a new issue](https://github.com/ionic-team/ionicons/issues/new/choose) that thoroughly explains the problem.
|
||||
|
||||
## Submitting Pull Requests
|
||||
|
||||
1. Before submitting a Pull Request (PR), please:
|
||||
- Create an issue first to discuss the proposed changes
|
||||
- Comment on an existing issue mentioning you'd like to work on it
|
||||
- Look for issues labeled with [`help wanted`](https://github.com/ionic-team/ionicons/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) if you're new to the project
|
||||
|
||||
2. Creating the PR:
|
||||
- Update your fork to the latest upstream main
|
||||
- Make your changes in a new git branch
|
||||
- Follow the code style of the project
|
||||
- Include relevant tests
|
||||
- Make sure all tests pass: `npm test`
|
||||
- Update documentation if needed
|
||||
- [Create a new pull request](https://github.com/ionic-team/ionicons/compare) with the `main` branch as the base.
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Ionic (http://ionic.io/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "ionicons",
|
||||
"version": "1.2.2",
|
||||
"homepage": "https://github.com/driftyco/ionicons",
|
||||
"authors": [
|
||||
"Ben Sperry <ben@drifty.com>",
|
||||
"Adam Bradley <adam@drifty.com>",
|
||||
"Max Lynch <max@drifty.com>"
|
||||
],
|
||||
"description": "Ionicons - free and beautiful icons from the creators of Ionic Framework",
|
||||
"main": ["ionicons.css", "fonts/*"],
|
||||
"keywords": [ "fonts", "icon font", "icons", "ionic", "web font"],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "ionicons",
|
||||
"repo": "driftyco/ionicons",
|
||||
"description": "The premium icon font for Ionic Framework.",
|
||||
"version": "v1.2.2",
|
||||
"license": "MIT",
|
||||
"styles": [
|
||||
"ionicons.css"
|
||||
],
|
||||
"fonts": [
|
||||
"fonts/ionicons.eot",
|
||||
"fonts/ionicons.svg",
|
||||
"fonts/ionicons.ttf",
|
||||
"fonts/ionicons.woff"
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 248 KiB |
@@ -0,0 +1,20 @@
|
||||
import path from 'path';
|
||||
import url from 'url';
|
||||
|
||||
import { createJestStencilPreset } from 'jest-stencil-runner';
|
||||
|
||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
||||
|
||||
export default createJestStencilPreset({
|
||||
rootDir: __dirname,
|
||||
// Add any additional Jest configuration here
|
||||
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.{ts,tsx}',
|
||||
'!src/**/*.d.ts',
|
||||
],
|
||||
testMatch: [
|
||||
'**/__tests__/**/*.(ts|tsx|js)',
|
||||
'**/*.(test|spec).(ts|tsx|js)'
|
||||
]
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
const Stencil = require('@stencil/core');
|
||||
Stencil.Build.isBrowser = true;
|
||||
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"name": "ionicons",
|
||||
"version": "8.1.1",
|
||||
"description": "Premium icons for Ionic.",
|
||||
"files": [
|
||||
"components/",
|
||||
"dist/",
|
||||
"icons/"
|
||||
],
|
||||
"main": "./dist/index.cjs.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "dist/types/index.d.ts",
|
||||
"unpkg": "dist/ionicons/ionicons.esm.js",
|
||||
"jsdelivr": "dist/ionicons/ionicons.esm.js",
|
||||
"collection": "dist/collection/collection-manifest.json",
|
||||
"collection:main": "dist/collection/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/types/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs.js"
|
||||
},
|
||||
"./loader": {
|
||||
"types": "./dist/loader/index.d.ts",
|
||||
"import": "./dist/loader/index.js",
|
||||
"require": "./dist/loader/index.cjs.js"
|
||||
},
|
||||
"./components": {
|
||||
"types": "./components/index.d.ts",
|
||||
"import": "./components/index.js"
|
||||
},
|
||||
"./components/ion-icon.js": {
|
||||
"types": "./components/ion-icon.d.ts",
|
||||
"import": "./components/ion-icon.js"
|
||||
},
|
||||
"./icons": {
|
||||
"types": "./icons/index.d.ts",
|
||||
"import": "./icons/index.mjs",
|
||||
"require": "./icons/index.js"
|
||||
},
|
||||
"./dist/ionicons.json": {
|
||||
"default": "./dist/ionicons.json"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-s clean build.*",
|
||||
"build.files": "tsx scripts/build.ts",
|
||||
"build.component": "stencil build",
|
||||
"build.collection": "tsx scripts/collection-copy.ts",
|
||||
"clean": "rimraf dist components icons www",
|
||||
"lint": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"./src/**/*.{html,ts,tsx,js,jsx,scss}\"",
|
||||
"prettier.dry-run": "npm run prettier -- --list-different",
|
||||
"start": "run-s build.files && stencil build --dev --watch --serve",
|
||||
"test": "run-s test.spec test.e2e",
|
||||
"test.spec": "jest",
|
||||
"test.e2e": "playwright test",
|
||||
"test.e2e.install": "playwright install && playwright install-deps"
|
||||
},
|
||||
"dependencies": {
|
||||
"@stencil/core": "^4.43.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@axe-core/playwright": "^4.12.1",
|
||||
"@playwright/test": "^1.61.1",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^22.15.3",
|
||||
"@types/svgo": "^3.0.0",
|
||||
"fs-extra": "^11.3.0",
|
||||
"jest": "^30.0.4",
|
||||
"jest-cli": "^30.0.4",
|
||||
"jest-stencil-runner": "^0.0.20",
|
||||
"npm-run-all2": "^8.0.4",
|
||||
"prettier": "^3.6.2",
|
||||
"puppeteer": "^24.12.0",
|
||||
"rimraf": "^6.0.1",
|
||||
"semver": "^7.7.2",
|
||||
"serve": "^14.2.4",
|
||||
"svgo": "4.0.0",
|
||||
"tsx": "^4.20.3",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"keywords": [
|
||||
"icon pack",
|
||||
"ionic",
|
||||
"icon",
|
||||
"svg",
|
||||
"mobile",
|
||||
"web component",
|
||||
"component",
|
||||
"custom element",
|
||||
"material design",
|
||||
"ios"
|
||||
],
|
||||
"homepage": "http://ionicons.com/",
|
||||
"author": {
|
||||
"name": "Ben Sperry",
|
||||
"web": "https://twitter.com/benjsperry"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Adam Bradley",
|
||||
"web": "http://twitter.com/adamdbradley"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ionic-team/ionicons.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ionic-team/ionicons/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"sideEffects": [
|
||||
"icons/imports/"
|
||||
],
|
||||
"web-types": "dist/ionic.web-types.json"
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||
import { devices, expect } from '@playwright/test';
|
||||
|
||||
const projects: PlaywrightTestConfig['projects'] = [
|
||||
{
|
||||
/**
|
||||
* This is really just desktop Firefox
|
||||
* but with a mobile viewport.
|
||||
*/
|
||||
name: 'Mobile Firefox',
|
||||
use: {
|
||||
browserName: 'firefox',
|
||||
/**
|
||||
* This is the Pixel 5 configuration.
|
||||
* We can't use devices['Pixel 5']
|
||||
* because the "isMobile" option is
|
||||
* not supported on Firefox.
|
||||
*/
|
||||
viewport: {
|
||||
width: 393,
|
||||
height: 727
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Mobile Chrome',
|
||||
use: {
|
||||
browserName: 'chromium',
|
||||
...devices['Pixel 5']
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Mobile Safari',
|
||||
use: {
|
||||
browserName: 'webkit',
|
||||
...devices['iPhone 12']
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
*/
|
||||
const config: PlaywrightTestConfig = {
|
||||
testMatch: '*.e2e.ts',
|
||||
expect: {
|
||||
/**
|
||||
* Maximum time expect() should wait for the condition to be met.
|
||||
* For example in `await expect(locator).toHaveText();`
|
||||
*/
|
||||
timeout: 5000,
|
||||
|
||||
/**
|
||||
* Configure screenshot comparison settings
|
||||
* to be more tolerant of minor visual differences
|
||||
*/
|
||||
toHaveScreenshot: {
|
||||
// Increase the threshold to allow for small font rendering differences
|
||||
// This sets the maximum allowed ratio of pixels that can be different
|
||||
maxDiffPixelRatio: 0.02, // Allow up to 2% of pixels to be different
|
||||
|
||||
// Alternatively, you can use absolute pixel count
|
||||
// maxDiffPixels: 100, // Allow up to 100 pixels to be different
|
||||
|
||||
// Add a threshold for per-pixel difference to handle anti-aliasing
|
||||
threshold: 0.2, // Default is 0.1
|
||||
}
|
||||
},
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: 'html',
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
||||
actionTimeout: 0,
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
// baseURL: 'http://localhost:3000',
|
||||
|
||||
/**
|
||||
* All failed tests should create
|
||||
* a trace file for easier debugging.
|
||||
*
|
||||
* See https://playwright.dev/docs/trace-viewer
|
||||
*/
|
||||
trace: 'retain-on-failure',
|
||||
baseURL: 'http://localhost:3333',
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects,
|
||||
webServer: {
|
||||
command: 'serve www -p 3333',
|
||||
port: 3333,
|
||||
reuseExistingServer: !process.env.CI
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1,39 +1,150 @@
|
||||
# Ionicons
|
||||
|
||||
[Ionicons](http://ionicons.com/) is a completely open-source icon set with 1,300 icons crafted for web, iOS, Android, and desktop apps. Ionicons was built for [Ionic Framework](https://ionicframework.com/), so icons have both Material Design and iOS versions.
|
||||
|
||||
|
||||
The premium icon font for [Ionic Framework](http://ionicframework.com/). Designed by [@helloimben](https://twitter.com/helloimben).
|
||||
|
||||
Visit [ionicons.com](http://ionicons.com) and check out the search feature, which has keywords identifying common icon names and styles. For example, if you search for “arrow” we call up every icon that could possibly be used as an arrow. We’ve also included each icon’s class name for easy copy/pasting when you’re developing!
|
||||
Note: All brand icons are trademarks of their respective owners. The use of these trademarks does not indicate endorsement of the trademark holder by Ionic, nor vice versa.
|
||||
|
||||
We intend for this icon pack to be used with [Ionic](http://ionicframework.com/), but it’s by no means limited to it. Use them wherever you see fit, personal or commercial. They are free to use and licensed under [MIT](http://opensource.org/licenses/MIT).
|
||||
|
||||
|
||||
## Getting Started
|
||||
## Contributing
|
||||
|
||||
1. Download and extract the font pack
|
||||
2. Copy the `ionicons.css` to your project
|
||||
3. Copy the `font` folder to your project
|
||||
4. Ensure the font urls within `ionicons.css` properly reference the `font` path within your project.
|
||||
5. Include a reference to the `ionicons.css` file from every webpage you need to use it.
|
||||
|
||||
Or install with [component](https://github.com/component/component):
|
||||
|
||||
$ component install driftyco/ionicons
|
||||
|
||||
Or perhaps you're known to use [bower](http://bower.io/)?
|
||||
|
||||
$ bower install ionicons
|
||||
Thanks for your interest in contributing! Read up on our guidelines for
|
||||
[contributing](https://github.com/ionic-team/ionicons/blob/main/CONTRIBUTING.md)
|
||||
and then look through our issues with a [help wanted](https://github.com/ionic-team/ionicons/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
|
||||
label.
|
||||
|
||||
|
||||
## HTML Example
|
||||
## Using the Web Component
|
||||
|
||||
You can use [ionicons.com](http://ionicons.com) to easily find the icon you want to use. Once you've copied the desired icon's CSS classname, simply add the icon's classname to an HTML element.
|
||||
The Ionicons Web Component is an easy and performant way to use Ionicons in your app. The component will dynamically load an SVG for each icon, so your app is only requesting the icons that you need.
|
||||
|
||||
<i class="icon-home"></i>
|
||||
Also note that only visible icons are loaded, and icons that are "below the fold" and hidden from the user's view do not make fetch requests for the svg resource.
|
||||
|
||||
### Installation
|
||||
|
||||
If you're using [Ionic Framework](https://ionicframework.com/), Ionicons is packaged by default, so no installation is necessary. Want to use Ionicons without Ionic Framework? Place the following `<script>` near the end of your page, right before the closing `</body>` tag, to enable them.
|
||||
|
||||
```html
|
||||
<script type="module" src="https://esm.sh/ionicons@latest/loader"></script>
|
||||
<script nomodule src="https://esm.sh/ionicons@latest/loader"></script>
|
||||
```
|
||||
|
||||
you can replace `latest` to pick any version of Ionicon, e.g.:
|
||||
|
||||
```html
|
||||
<script type="module" src="https://esm.sh/ionicons@8.0.0/loader"></script>
|
||||
<script nomodule src="https://esm.sh/ionicons@8.0.0/loader"></script>
|
||||
```
|
||||
|
||||
### Basic usage
|
||||
|
||||
To use a built-in icon from the Ionicons package, populate the `name` attribute on the ion-icon component:
|
||||
|
||||
```html
|
||||
<ion-icon name="heart"></ion-icon>
|
||||
```
|
||||
|
||||
### Custom icons
|
||||
|
||||
To use a custom SVG, provide its url in the `src` attribute to request the external SVG file. The `src` attribute works the same as `<img src="...">` in that the url must be accessible from the webpage that's making a request for the image. Additionally, the external file can only be a valid svg and does not allow scripts or events within the svg element.
|
||||
|
||||
```html
|
||||
<ion-icon src="/path/to/external/file.svg"></ion-icon>
|
||||
```
|
||||
|
||||
#### Custom Asset Path
|
||||
|
||||
If you have a different set of icons you would like to load or if the Ionicon icons are hosted on a different page or path, you can set the asset url from which Ionicons pulls the icons via:
|
||||
|
||||
```ts
|
||||
import { setAssetPath, addIcons } from 'ionicons';
|
||||
import { add, logoIonic, save } from 'ionicons/icons';
|
||||
|
||||
// set root path for loading icons to "<root>/public/svg"
|
||||
setAssetPath(`${window.location.origin}/public/svg/`);
|
||||
|
||||
// only load specific icons
|
||||
addIcons({ add, logoIonic, save });
|
||||
```
|
||||
|
||||
This allows the use of named icons like this:
|
||||
|
||||
```html
|
||||
<!-- now pulls the svg from "<root>/public/svg/heart.svg" -->
|
||||
<ion-icon name="heart"></ion-icon>
|
||||
```
|
||||
|
||||
## Variants
|
||||
Each app icon in Ionicons has a `filled`, `outline` and `sharp` variant. These different variants are provided to make your app feel native to a variety of platforms. The filled variant uses the default name without a suffix. Note: Logo icons do not have outline or sharp variants.
|
||||
|
||||
```html
|
||||
<ion-icon name="heart"></ion-icon> <!--filled-->
|
||||
<ion-icon name="heart-outline"></ion-icon> <!--outline-->
|
||||
<ion-icon name="heart-sharp"></ion-icon> <!--sharp-->
|
||||
```
|
||||
|
||||
### Platform specificity
|
||||
When using icons in Ionic Framework you can specify different icons per platform. Use the `md` and `ios` attributes and provide the platform-specific icon/variant name.
|
||||
|
||||
```html
|
||||
<ion-icon ios="heart-outline" md="heart-sharp"></ion-icon>
|
||||
```
|
||||
|
||||
## Size
|
||||
|
||||
To specify the icon size, you can use the size attribute for our pre-defined font sizes.
|
||||
|
||||
```html
|
||||
<ion-icon size="small"></ion-icon>
|
||||
<ion-icon size="large"></ion-icon>
|
||||
```
|
||||
|
||||
Or you can set a specific size by applying the `font-size` CSS property on the `ion-icon` component. It's recommended to use pixel sizes that are a multiple of 8 (8, 16, 32, 64, etc.)
|
||||
|
||||
```css
|
||||
ion-icon {
|
||||
font-size: 64px;
|
||||
}
|
||||
```
|
||||
|
||||
## Color
|
||||
|
||||
Specify the icon color by applying the `color` CSS property on the `ion-icon` component.
|
||||
|
||||
```css
|
||||
ion-icon {
|
||||
color: blue;
|
||||
}
|
||||
```
|
||||
|
||||
## Stroke width
|
||||
When using an `outline` icon variant it is possible to adjust the stroke width, for improved visual balance relative to the icon's size or relative to the width of adjacent text. You can set a specific size by applying the `--ionicon-stroke-width` CSS custom property to the `ion-icon` component. The default value is 32px.
|
||||
|
||||
```html
|
||||
<ion-icon name="heart-outline"></ion-icon>
|
||||
```
|
||||
|
||||
```css
|
||||
ion-icon {
|
||||
--ionicon-stroke-width: 16px;
|
||||
}
|
||||
```
|
||||
|
||||
## Migrating from v4
|
||||
|
||||
See the [5.0 release notes](https://github.com/ionic-team/ionicons/releases/tag/5.0.0) for a list of icon deletions/renames.
|
||||
|
||||
## License
|
||||
|
||||
Ionicons is licensed under the [MIT license](http://opensource.org/licenses/MIT).
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
* [Ionicons Homepage](http://ionicons.com/)
|
||||
* [Ionic Framework](https://ionicframework.com/)
|
||||
* [Ionic Discord](https://ionic.link/discord)
|
||||
* [Ionic Forum](https://forum.ionicframework.com/)
|
||||
* [Stencil](https://stenciljs.com/)
|
||||
* [Capacitor](https://capacitorjs.com/)
|
||||
|
||||
@@ -0,0 +1,421 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import { optimize } from 'svgo';
|
||||
|
||||
import { webComponentPassPlugins, sourcePassPlugins } from './plugins';
|
||||
import { reservedKeywords } from './constants';
|
||||
import pkgData from '../package.json' with { type: 'json' };
|
||||
import type { SvgData } from './types';
|
||||
|
||||
async function build(rootDir: string) {
|
||||
try {
|
||||
const srcDir = path.join(rootDir, 'src');
|
||||
const srcSvgDir = path.join(srcDir, 'svg');
|
||||
const iconDir = path.join(rootDir, 'icons');
|
||||
const distDir = path.join(rootDir, 'dist');
|
||||
const distIoniconsDir = path.join(distDir, 'ionicons');
|
||||
const distSvgDir = path.join(distDir, 'svg');
|
||||
const optimizedSvgDir = path.join(distIoniconsDir, 'svg');
|
||||
|
||||
/**
|
||||
* Create the directories first, then empty them
|
||||
* This ensures they exist before we try to write files to them
|
||||
*/
|
||||
await Promise.all([
|
||||
fs.ensureDir(iconDir),
|
||||
fs.ensureDir(distDir),
|
||||
fs.ensureDir(distSvgDir),
|
||||
fs.ensureDir(optimizedSvgDir),
|
||||
fs.ensureDir(distIoniconsDir),
|
||||
]);
|
||||
|
||||
/**
|
||||
* Empty the directories
|
||||
*/
|
||||
await Promise.all([
|
||||
fs.emptyDir(iconDir),
|
||||
fs.emptyDir(distDir),
|
||||
fs.emptyDir(distSvgDir),
|
||||
fs.emptyDir(optimizedSvgDir),
|
||||
fs.emptyDir(distIoniconsDir),
|
||||
]);
|
||||
|
||||
const version = pkgData.version as string;
|
||||
const srcSvgData = await getSvgs(srcSvgDir, distSvgDir, optimizedSvgDir);
|
||||
await optimizeSvgs(srcSvgData);
|
||||
await Promise.all([
|
||||
createDataJson(version, srcDir, distDir, srcSvgData),
|
||||
createIconPackage(version, iconDir, srcSvgData),
|
||||
]);
|
||||
|
||||
const svgSymbolsContent = await createSvgSymbols(version, distDir, srcSvgData);
|
||||
|
||||
await createCheatsheet(version, rootDir, distDir, svgSymbolsContent, srcSvgData);
|
||||
await createWebTypes(version, rootDir, distDir, srcSvgData);
|
||||
await copyToTesting(rootDir, distDir, srcSvgData);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
async function optimizeSvgs(srcSvgData: SvgData[]) {
|
||||
await Promise.all(
|
||||
srcSvgData.map(async (svgData) => {
|
||||
return optimizeSvg(svgData);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async function optimizeSvg(svgData: SvgData) {
|
||||
const srcSvgContent = await fs.readFile(svgData.srcFilePath, 'utf8');
|
||||
|
||||
const optimizedSvg = await optimize(srcSvgContent, { path: svgData.srcFilePath });
|
||||
const webComponentSvg = await optimize(optimizedSvg.data, {
|
||||
path: svgData.srcFilePath,
|
||||
plugins: webComponentPassPlugins,
|
||||
});
|
||||
const sourceSvg = await optimize(optimizedSvg.data, {
|
||||
path: svgData.srcFilePath,
|
||||
plugins: sourcePassPlugins,
|
||||
});
|
||||
|
||||
// Ensure directories exist before writing files
|
||||
await Promise.all([
|
||||
fs.ensureDir(path.dirname(svgData.optimizedFilePath)),
|
||||
fs.ensureDir(path.dirname(svgData.distSvgFilePath)),
|
||||
]);
|
||||
|
||||
svgData.optimizedSvgContent = webComponentSvg.data;
|
||||
await Promise.all([
|
||||
fs.writeFile(svgData.optimizedFilePath, svgData.optimizedSvgContent),
|
||||
fs.writeFile(svgData.distSvgFilePath, sourceSvg.data),
|
||||
]);
|
||||
}
|
||||
|
||||
async function copyToTesting(rootDir: string, distDir: string, srcSvgData: SvgData[]) {
|
||||
const testDir = path.join(rootDir, 'www');
|
||||
const testBuildDir = path.join(testDir, 'build');
|
||||
const testSvgDir = path.join(testBuildDir, 'svg');
|
||||
const cheatsheetDir = path.join(testDir, 'icon', 'test', 'cheatsheet');
|
||||
const version = (await fs.readJson(path.join(rootDir, 'package.json'))).version;
|
||||
|
||||
// Ensure all directories exist
|
||||
await Promise.all([
|
||||
fs.ensureDir(testDir),
|
||||
fs.ensureDir(testBuildDir),
|
||||
fs.ensureDir(testSvgDir),
|
||||
fs.ensureDir(cheatsheetDir),
|
||||
]);
|
||||
|
||||
await Promise.all(
|
||||
srcSvgData
|
||||
.filter((svgData): svgData is SvgData & { optimizedSvgContent: string } => Boolean(svgData.optimizedSvgContent))
|
||||
.map(async (svgData) => {
|
||||
const testSvgFilePath = path.join(testSvgDir, svgData.fileName);
|
||||
await fs.writeFile(testSvgFilePath, svgData.optimizedSvgContent);
|
||||
}),
|
||||
);
|
||||
|
||||
const wwwCheatsheetFilePath = path.join(cheatsheetDir, 'index.html');
|
||||
const srcIndexFilePath = path.join(rootDir, 'src', 'components', 'icon', 'test', 'index.html');
|
||||
const testIndexFilePath = path.join(testDir, 'index.html');
|
||||
|
||||
await fs.copyFile(srcIndexFilePath, testIndexFilePath);
|
||||
|
||||
// Generate the cheatsheet with placeholders filled in
|
||||
const svgSymbolsContent = await fs.readFile(path.join(distDir, 'ionicons.symbols.svg'), 'utf8');
|
||||
const c = srcSvgData.map(
|
||||
(svgData) =>
|
||||
`<a href="/svg/${svgData.fileName}"><svg><use href="#${svgData.iconName}" xlink:href="#${svgData.iconName}"/></svg></a>`,
|
||||
);
|
||||
c.push(svgSymbolsContent);
|
||||
|
||||
const cheatsheetTemplate = await fs.readFile(path.join(rootDir, 'scripts', 'cheatsheet-template.html'), 'utf8');
|
||||
const cheatsheetHtml = cheatsheetTemplate
|
||||
.replace(/{{version}}/g, version)
|
||||
.replace(/{{count}}/g, srcSvgData.length.toString())
|
||||
.replace(/{{content}}/g, c.join('\n'));
|
||||
|
||||
await fs.writeFile(wwwCheatsheetFilePath, cheatsheetHtml);
|
||||
}
|
||||
|
||||
async function createSvgSymbols(version: string, distDir: string, srcSvgData: SvgData[]) {
|
||||
srcSvgData = srcSvgData.sort((a, b) => {
|
||||
if (a.iconName < b.iconName) return -1;
|
||||
if (a.iconName > b.iconName) return 1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
const symbolsSvgFilePath = path.join(distDir, 'ionicons.symbols.svg');
|
||||
|
||||
const lines = [
|
||||
`<svg data-ionicons="${version}" style="display:none">`,
|
||||
`<style>`,
|
||||
`.ionicon {`,
|
||||
` fill: currentColor;`,
|
||||
` stroke: currentColor;`,
|
||||
`}`,
|
||||
`.ionicon-fill-none {`,
|
||||
` fill: none;`,
|
||||
`}`,
|
||||
`.ionicon-stroke-width {`,
|
||||
` stroke-width: 32px;`,
|
||||
`}`,
|
||||
`</style>`,
|
||||
];
|
||||
|
||||
srcSvgData
|
||||
.filter((svgData): svgData is SvgData & { optimizedSvgContent: string } => Boolean(svgData.optimizedSvgContent))
|
||||
.forEach((svgData) => {
|
||||
const svg = svgData.optimizedSvgContent
|
||||
.replace(`<svg xmlns="http://www.w3.org/2000/svg"`, `<symbol id="${svgData.iconName}"`)
|
||||
.replace(`</svg>`, `</symbol>`);
|
||||
lines.push(svg);
|
||||
});
|
||||
|
||||
lines.push(`</svg>`, ``);
|
||||
|
||||
const content = lines.join('\n');
|
||||
await fs.writeFile(symbolsSvgFilePath, content);
|
||||
return content;
|
||||
}
|
||||
|
||||
async function createCheatsheet(
|
||||
version: string,
|
||||
rootDir: string,
|
||||
distDir: string,
|
||||
svgSymbolsContent: string,
|
||||
srcSvgData: SvgData[],
|
||||
) {
|
||||
const CheatsheetTmpFilePath = path.join(rootDir, 'scripts', 'cheatsheet-template.html');
|
||||
const distCheatsheetFilePath = path.join(distDir, 'cheatsheet.html');
|
||||
|
||||
const c = srcSvgData.map(
|
||||
(svgData) =>
|
||||
`<a href="/svg/${svgData.fileName}"><svg><use href="#${svgData.iconName}" xlink:href="#${svgData.iconName}"/></svg></a>`,
|
||||
);
|
||||
|
||||
c.push(svgSymbolsContent);
|
||||
|
||||
const html = (await fs.readFile(CheatsheetTmpFilePath, 'utf8'))
|
||||
.replace(/{{version}}/g, version)
|
||||
.replace(/{{count}}/g, srcSvgData.length.toString())
|
||||
.replace(/{{content}}/g, c.join('\n'));
|
||||
|
||||
await fs.writeFile(distCheatsheetFilePath, html);
|
||||
}
|
||||
|
||||
async function createWebTypes(version: string, rootDir: string, distDir: string, srcSvgData: SvgData[]) {
|
||||
const srcWebTypeFilePath = path.join(rootDir, 'src/ionicons.web-types.json');
|
||||
const distWebTypesFilePath = path.join(distDir, 'ionicons.web-types.json');
|
||||
const webTypes = JSON.parse(await fs.readFile(srcWebTypeFilePath, 'utf8'));
|
||||
|
||||
webTypes.version = version;
|
||||
|
||||
const icons = webTypes.contributions.html.ionicons;
|
||||
for (let data of srcSvgData) {
|
||||
icons.push({
|
||||
name: data.iconName,
|
||||
icon: 'dist/svg/' + data.fileName,
|
||||
});
|
||||
}
|
||||
|
||||
const jsonStr = JSON.stringify(webTypes, null, 2) + '\n';
|
||||
await fs.writeFile(distWebTypesFilePath, jsonStr);
|
||||
}
|
||||
|
||||
async function getSvgs(srcSvgDir: string, distSvgDir: string, optimizedSvgDir: string): Promise<SvgData[]> {
|
||||
const svgFiles = (await fs.readdir(srcSvgDir)).filter((fileName) => {
|
||||
return !fileName.startsWith('.') && fileName.endsWith('.svg');
|
||||
});
|
||||
|
||||
const svgData = await Promise.all(
|
||||
svgFiles.map(async (fileName) => {
|
||||
// fileName: airplane-outline.svg
|
||||
|
||||
if (fileName.toLowerCase() !== fileName) {
|
||||
throw new Error(`svg filename "${fileName}" must be all lowercase`);
|
||||
}
|
||||
|
||||
// srcFilePath: /src/svg/airplane-outline.svg
|
||||
const srcFilePath = path.join(srcSvgDir, fileName);
|
||||
|
||||
// srcFilePath: /src/svg/airplane-outline.svg
|
||||
const distSvgFilePath = path.join(distSvgDir, fileName);
|
||||
|
||||
// optimizedFilePath: /dist/ionicons/svg/airplane-outline.svg
|
||||
const optimizedFilePath = path.join(optimizedSvgDir, fileName);
|
||||
|
||||
const dotSplit = fileName.split('.');
|
||||
if (dotSplit.length > 2) {
|
||||
throw new Error(`svg filename "${fileName}" cannot contain more than one period`);
|
||||
}
|
||||
|
||||
// iconName: airplane-outline
|
||||
const iconName = dotSplit[0];
|
||||
|
||||
if (reservedKeywords.has(iconName)) {
|
||||
throw new Error(`svg icon name "${iconName}" is a reserved JavaScript keyword`);
|
||||
}
|
||||
|
||||
// fileNameMjs: airplane-outline.mjs
|
||||
const fileNameMjs = iconName + '.mjs';
|
||||
|
||||
// fileNameCjs: airplane-outline.mjs
|
||||
const fileNameCjs = iconName + '.js';
|
||||
|
||||
// exportName: airplaneOutline
|
||||
const exportName = camelize(iconName);
|
||||
|
||||
const title = toTitleCase(
|
||||
fileName.replace('.svg', '').replace('-outline', '').replace('-sharp', '').replace(/-/g, ' '),
|
||||
);
|
||||
|
||||
return {
|
||||
fileName,
|
||||
title,
|
||||
srcFilePath,
|
||||
distSvgFilePath,
|
||||
srcSvgContent: await fs.readFile(srcFilePath, 'utf8'),
|
||||
optimizedFilePath,
|
||||
iconName,
|
||||
fileNameMjs,
|
||||
fileNameCjs,
|
||||
exportName,
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
return svgData.sort((a, b) => {
|
||||
if (a.exportName < b.exportName) return -1;
|
||||
if (a.exportName > b.exportName) return 1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
async function createIconPackage(version: string, iconDir: string, srcSvgData: SvgData[]) {
|
||||
await Promise.all([
|
||||
createEsmIcons(version, iconDir, srcSvgData),
|
||||
createCjsIcons(version, iconDir, srcSvgData),
|
||||
createDtsIcons(version, iconDir, srcSvgData),
|
||||
]);
|
||||
}
|
||||
|
||||
async function createEsmIcons(version: string, iconDir: string, srcSvgData: SvgData[]) {
|
||||
const iconEsmFilePath = path.join(iconDir, 'index.mjs');
|
||||
|
||||
const o = [`/* Ionicons v${version}, ES Modules */`, ``];
|
||||
|
||||
srcSvgData.forEach((svgData) => {
|
||||
o.push(`export const ${svgData.exportName} = ${getDataUrl(svgData)}`);
|
||||
});
|
||||
|
||||
await fs.writeFile(iconEsmFilePath, o.join('\n') + '\n');
|
||||
}
|
||||
|
||||
async function createCjsIcons(version: string, iconDir: string, srcSvgData: SvgData[]) {
|
||||
const iconCjsFilePath = path.join(iconDir, 'index.js');
|
||||
|
||||
const o = [`/* Ionicons v${version}, CommonJS */`, ``];
|
||||
|
||||
srcSvgData.forEach((svgData) => {
|
||||
o.push(`exports.${svgData.exportName} = ${getDataUrl(svgData)}`);
|
||||
});
|
||||
|
||||
await fs.writeFile(iconCjsFilePath, o.join('\n') + '\n');
|
||||
}
|
||||
|
||||
async function createDtsIcons(version: string, iconDir: string, srcSvgData: SvgData[]) {
|
||||
const iconDtsFilePath = path.join(iconDir, 'index.d.ts');
|
||||
|
||||
const o = [`/* Ionicons v${version}, Types */`, ``];
|
||||
|
||||
srcSvgData.forEach((svgData) => {
|
||||
o.push(`export declare var ${svgData.exportName}: string;`);
|
||||
});
|
||||
|
||||
await fs.writeFile(iconDtsFilePath, o.join('\n') + '\n');
|
||||
}
|
||||
|
||||
function getDataUrl(svgData: SvgData) {
|
||||
let svg = svgData.optimizedSvgContent;
|
||||
|
||||
if (!svg) {
|
||||
throw new Error(`oh no! no optimized SVG content! ${svgData.fileName}`);
|
||||
}
|
||||
|
||||
if (svg.includes(`'`)) {
|
||||
throw new Error(`oh no! no single quotes allowed! ${svgData.fileName}`);
|
||||
}
|
||||
if (svg.includes(`\n`) || svg.includes(`\r`)) {
|
||||
throw new Error(`oh no! no new lines allowed! ${svgData.fileName}`);
|
||||
}
|
||||
svg = svg.replace(/"/g, "'");
|
||||
return `"data:image/svg+xml;utf8,${svg}"`;
|
||||
}
|
||||
|
||||
async function createDataJson(version: string, srcDir: string, distDir: string, srcSvgData: SvgData[]) {
|
||||
const srcDataJsonPath = path.join(srcDir, 'data.json');
|
||||
const distDataJsonPath = path.join(distDir, 'ionicons.json');
|
||||
|
||||
const data = await fs.readJson(srcDataJsonPath).catch(() => ({}));
|
||||
data.icons = data.icons || [];
|
||||
|
||||
// add new icons
|
||||
srcSvgData.forEach((svgData) => {
|
||||
if (!data.icons.some((i) => i.name === svgData.iconName)) {
|
||||
data.icons.push({
|
||||
name: svgData.iconName,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// remove dead icons
|
||||
data.icons = data.icons.filter((dataIcon) => {
|
||||
return srcSvgData.some((svgData) => dataIcon.name === svgData.iconName);
|
||||
});
|
||||
|
||||
// sort
|
||||
data.icons = data.icons.sort((a, b) => {
|
||||
if (a.name < b.name) return -1;
|
||||
if (a.name > b.name) return 1;
|
||||
return 0;
|
||||
});
|
||||
data.icons.forEach((icon) => {
|
||||
icon.tags = icon.tags || icon.name.split('-');
|
||||
icon.tags = icon.tags.sort();
|
||||
});
|
||||
|
||||
const srcJsonStr = JSON.stringify(data, null, 2) + '\n';
|
||||
await fs.writeFile(srcDataJsonPath, srcJsonStr);
|
||||
|
||||
const distJsonData = {
|
||||
name: 'ionicons',
|
||||
version,
|
||||
icons: data.icons,
|
||||
};
|
||||
const distJsonStr = JSON.stringify(distJsonData, null, 2) + '\n';
|
||||
await fs.writeFile(distDataJsonPath, distJsonStr);
|
||||
}
|
||||
|
||||
function camelize(text: string) {
|
||||
let words = text.split(/[-_]/g); // ok one simple regexp.
|
||||
return words[0].toLowerCase() + words.slice(1).map(upFirst).join('');
|
||||
}
|
||||
|
||||
function upFirst(word: string) {
|
||||
return word[0].toUpperCase() + word.toLowerCase().slice(1);
|
||||
}
|
||||
|
||||
function toTitleCase(str: string) {
|
||||
const s = str.trim().toLowerCase().split(' ');
|
||||
for (var i = 0; i < s.length; i++) {
|
||||
s[i] = s[i].charAt(0).toUpperCase() + s[i].slice(1);
|
||||
}
|
||||
return s.join(' ');
|
||||
}
|
||||
|
||||
// let's do this
|
||||
build(path.join(__dirname, '..'));
|
||||
@@ -0,0 +1,10 @@
|
||||
const semver = require('semver');
|
||||
|
||||
const getDevVersion = () => {
|
||||
const originalVersion = require('../package.json').version;
|
||||
const baseVersion = semver.inc(originalVersion, 'patch');
|
||||
|
||||
return baseVersion;
|
||||
}
|
||||
|
||||
console.log(getDevVersion());
|
||||
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Ionicons {{version}} Cheatsheet</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Ionicons {{version}} Cheatsheet</h1>
|
||||
<h3>{{count}} icons</h3>
|
||||
|
||||
{{content}}
|
||||
</main>
|
||||
</body>
|
||||
|
||||
<style>
|
||||
svg {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
@@ -0,0 +1,44 @@
|
||||
import fs from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
|
||||
async function collectionCopy(rootDir: string) {
|
||||
// move optimized svgs to correct collection location
|
||||
const optimizedSrc = join(rootDir, 'dist', 'ionicons', 'svg');
|
||||
const collectionDest = join(rootDir, 'dist', 'collection', 'components', 'icon', 'svg');
|
||||
await fs.copy(optimizedSrc, collectionDest);
|
||||
|
||||
// we don't to copy the src svgs to collection
|
||||
await fs.remove(join(rootDir, 'dist', 'collection', 'svg'));
|
||||
// We don't want to copy the test svg assets to collection
|
||||
await fs.remove(join(rootDir, 'dist', 'collection', 'components', 'test'));
|
||||
|
||||
const cePackageDir = join(rootDir, 'components');
|
||||
const cePackageJsonPath = join(cePackageDir, 'package.json');
|
||||
const ceCjsPath = join(cePackageDir, 'index.cjs.js');
|
||||
|
||||
const emptyCjs = `/*empty cjs*/`;
|
||||
await fs.writeFile(ceCjsPath, emptyCjs);
|
||||
|
||||
const cePackageJson = {
|
||||
name: 'ionicons/components',
|
||||
description: 'Ionicons custom element.',
|
||||
main: './index.cjs.js',
|
||||
module: './index.js',
|
||||
types: './index.d.ts',
|
||||
private: true,
|
||||
};
|
||||
await fs.writeFile(cePackageJsonPath, JSON.stringify(cePackageJson, null, 2));
|
||||
|
||||
// this is temporary!!!!
|
||||
// removing the `type` from the d.ts export
|
||||
// to make it easier for users migrating between
|
||||
// of older versions of angular and typescript
|
||||
// to the newer verisons, where the `type` keyword
|
||||
// is used. This is a megahack, no doubt.
|
||||
const typesDist = join(rootDir, 'dist', 'types', 'index.d.ts');
|
||||
let types = await fs.readFile(typesDist, 'utf8');
|
||||
types = types.replace('export type', 'export');
|
||||
await fs.writeFile(typesDist, types);
|
||||
}
|
||||
|
||||
collectionCopy(join(__dirname, '..'));
|
||||
@@ -0,0 +1,52 @@
|
||||
// https://mathiasbynens.be/notes/reserved-keywords
|
||||
export const reservedKeywords = new Set([
|
||||
'do',
|
||||
'if',
|
||||
'in',
|
||||
'for',
|
||||
'let',
|
||||
'new',
|
||||
'try',
|
||||
'var',
|
||||
'case',
|
||||
'else',
|
||||
'enum',
|
||||
'eval',
|
||||
'null',
|
||||
'this',
|
||||
'true',
|
||||
'void',
|
||||
'with',
|
||||
'await',
|
||||
'break',
|
||||
'catch',
|
||||
'class',
|
||||
'const',
|
||||
'false',
|
||||
'super',
|
||||
'throw',
|
||||
'while',
|
||||
'yield',
|
||||
'delete',
|
||||
'export',
|
||||
'import',
|
||||
'public',
|
||||
'return',
|
||||
'static',
|
||||
'switch',
|
||||
'typeof',
|
||||
'default',
|
||||
'extends',
|
||||
'finally',
|
||||
'package',
|
||||
'private',
|
||||
'continue',
|
||||
'debugger',
|
||||
'function',
|
||||
'arguments',
|
||||
'interface',
|
||||
'protected',
|
||||
'implements',
|
||||
'instanceof',
|
||||
'constructor',
|
||||
]);
|
||||
@@ -0,0 +1,87 @@
|
||||
import { PluginConfig } from 'svgo';
|
||||
|
||||
const setRootIoniconClass: PluginConfig = {
|
||||
name: 'addClassesToSVGElement',
|
||||
params: {
|
||||
className: 'ionicon',
|
||||
},
|
||||
};
|
||||
|
||||
const addFillNoneCss: PluginConfig = {
|
||||
name: 'addFillNoneCss',
|
||||
fn: () => ({
|
||||
element: {
|
||||
enter: (element) => {
|
||||
if (element.attributes.fill) {
|
||||
if (element.attributes.fill === 'none') {
|
||||
element.attributes.class = [...(element.attributes.class?.split(' ') || []), 'ionicon-fill-none'].join(' ');
|
||||
}
|
||||
delete element.attributes.fill;
|
||||
}
|
||||
if (element.attributes.stroke) {
|
||||
delete element.attributes.stroke;
|
||||
}
|
||||
if (
|
||||
element.attributes['stroke-width'] &&
|
||||
(element.attributes['stroke-width'] === '32px' || element.attributes['stroke-width'] === '32')
|
||||
) {
|
||||
delete element.attributes['stroke-width'];
|
||||
element.attributes.class = [...(element.attributes.class?.split(' ') || []), 'ionicon-stroke-width'].join(
|
||||
' ',
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
const forceCurrentColor: PluginConfig = {
|
||||
name: 'forceCurrentColor',
|
||||
fn: () => ({
|
||||
element: {
|
||||
enter: (element) => {
|
||||
const attr = element.attributes.stroke || element.attributes.fill;
|
||||
const attrName = element.attributes.stroke ? 'stroke' : element.attributes.fill ? 'fill' : undefined;
|
||||
|
||||
if (attrName) {
|
||||
if (attr === '#000' || attr === 'currentColor') {
|
||||
element.attributes[attrName] = 'currentColor';
|
||||
} else if (attr !== 'none') {
|
||||
throw new Error(`invalid "${attrName}" value: ${element.attributes[attrName]}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
const validatePlugin: PluginConfig = {
|
||||
name: 'validate',
|
||||
fn: () => ({
|
||||
element: {
|
||||
enter: (element) => {
|
||||
if (element.attributes.style) {
|
||||
console.warn(
|
||||
`Inline style attributed detected: <${element.name} style="${element.attributes.style}">...</${element.name}>`,
|
||||
);
|
||||
}
|
||||
if (element.name === 'style') {
|
||||
console.warn('Inline style element detected');
|
||||
}
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
const basePlugins: PluginConfig[] = [
|
||||
'removeStyleElement',
|
||||
'convertStyleToAttrs',
|
||||
'removeScripts',
|
||||
'removeDimensions',
|
||||
setRootIoniconClass,
|
||||
validatePlugin,
|
||||
];
|
||||
|
||||
export const webComponentPassPlugins: PluginConfig[] = [...basePlugins, addFillNoneCss];
|
||||
|
||||
export const sourcePassPlugins: PluginConfig[] = [...basePlugins, forceCurrentColor];
|
||||
@@ -0,0 +1,38 @@
|
||||
# Development and Build Scripts
|
||||
|
||||
## Updating Icons
|
||||
|
||||
The `src/svg` directory is the single source of truth for svgs. They should not already be optimized and can be the original svg export straight out of an svg editor. A build step before releasing will optimize the source svgs (remove comments, reduce the size, etc) and ensure they'll work within `ion-icon`.
|
||||
|
||||
## Build Locally
|
||||
|
||||
After an svg has been updated, added or deleted from the `src/svg` directory, run:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
The build command will optimize all of the icons and generate the files to be distributed. After the build command, all of the optimized svgs are saved in `dist/ionicons/svg`. Additionally the `dist` directory contains the distribution files for the `ion-icon` web component.
|
||||
|
||||
## Svg Symbols Cheatsheet
|
||||
|
||||
After a build, a new `www/cheatsheet.html` file will be created. This version uses svg symbols rather than `ion-icon`.
|
||||
|
||||
## ion-icon Component Preview
|
||||
|
||||
To see the `ion-icon` component in action, run:
|
||||
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
## Release Steps
|
||||
|
||||
Releases are automated via GitHub Actions. To trigger a release:
|
||||
|
||||
1. Go to the [Release Orchestrator](https://github.com/ionic-team/ionicons/actions/workflows/release-orchestrator.yml) workflow
|
||||
2. Click "Run workflow"
|
||||
3. Select the release type:
|
||||
- **dev** — Creates a pre-release with a timestamp-based version (e.g., `8.0.14-dev.11784821417.1c794397`)
|
||||
- **production** — Creates a semver release; select `patch`, `minor`, or `major`
|
||||
4. The workflow will build, publish to NPM, and create a GitHub release (for production releases)
|
||||
@@ -0,0 +1,53 @@
|
||||
import { PluginConfig } from 'svgo';
|
||||
|
||||
export interface SvgData {
|
||||
/**
|
||||
* airplane-outline.svg
|
||||
*/
|
||||
fileName: string;
|
||||
|
||||
/**
|
||||
* airplane
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* /src/svg/airplane-outline.svg
|
||||
*/
|
||||
srcFilePath: string;
|
||||
|
||||
/**
|
||||
* /dist/ionicons/svg/airplane-outline.svg
|
||||
*/
|
||||
optimizedFilePath: string;
|
||||
|
||||
/**
|
||||
* /dist/svg/airplane-outline.svg
|
||||
*/
|
||||
distSvgFilePath: string;
|
||||
|
||||
/**
|
||||
* optimized svg content
|
||||
*/
|
||||
optimizedSvgContent?: string;
|
||||
|
||||
/**
|
||||
* airplane-outline
|
||||
*/
|
||||
iconName: string;
|
||||
|
||||
/**
|
||||
* airplane-outline.mjs
|
||||
*/
|
||||
fileNameMjs: string;
|
||||
|
||||
/**
|
||||
* airplane-outline.js
|
||||
*/
|
||||
fileNameCjs: string;
|
||||
|
||||
/**
|
||||
* airplaneOutline
|
||||
*/
|
||||
exportName: string;
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
/**
|
||||
* This is an autogenerated file created by the Stencil compiler.
|
||||
* It contains typing information for all components that exist in this project.
|
||||
*/
|
||||
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
|
||||
export namespace Components {
|
||||
interface IonIcon {
|
||||
/**
|
||||
* The color to use for the background of the item.
|
||||
*/
|
||||
"color"?: string;
|
||||
/**
|
||||
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
|
||||
*/
|
||||
"flipRtl"?: boolean;
|
||||
/**
|
||||
* A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property.
|
||||
*/
|
||||
"icon"?: any;
|
||||
/**
|
||||
* Specifies which icon to use on `ios` mode.
|
||||
*/
|
||||
"ios"?: string;
|
||||
/**
|
||||
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
|
||||
* @default false
|
||||
*/
|
||||
"lazy": boolean;
|
||||
/**
|
||||
* Specifies which icon to use on `md` mode.
|
||||
*/
|
||||
"md"?: string;
|
||||
/**
|
||||
* The mode determines which platform styles to use.
|
||||
* @default getIonMode()
|
||||
*/
|
||||
"mode": string;
|
||||
/**
|
||||
* Specifies which icon to use from the built-in set of icons.
|
||||
*/
|
||||
"name"?: string;
|
||||
/**
|
||||
* When `true`, SVG content, including SVG `data:` URLs, is checked before it renders. SVGs with `<script>` elements, attributes that start with `on` (like `onclick`), `javascript:` URLs, or non-SVG elements aren't rendered, and `<foreignObject>` elements are removed. Only set this to `false` for SVG content from a trusted source.
|
||||
* @default true
|
||||
*/
|
||||
"sanitize": boolean;
|
||||
/**
|
||||
* The size of the icon. Available options are: `"small"` and `"large"`.
|
||||
*/
|
||||
"size"?: string;
|
||||
/**
|
||||
* Specifies the exact `src` of an SVG file to use.
|
||||
*/
|
||||
"src"?: string;
|
||||
}
|
||||
}
|
||||
declare global {
|
||||
interface HTMLIonIconElement extends Components.IonIcon, HTMLStencilElement {
|
||||
}
|
||||
var HTMLIonIconElement: {
|
||||
prototype: HTMLIonIconElement;
|
||||
new (): HTMLIonIconElement;
|
||||
};
|
||||
interface HTMLElementTagNameMap {
|
||||
"ion-icon": HTMLIonIconElement;
|
||||
}
|
||||
}
|
||||
declare namespace LocalJSX {
|
||||
interface IonIcon {
|
||||
/**
|
||||
* The color to use for the background of the item.
|
||||
*/
|
||||
"color"?: string;
|
||||
/**
|
||||
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
|
||||
*/
|
||||
"flipRtl"?: boolean;
|
||||
/**
|
||||
* A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property.
|
||||
*/
|
||||
"icon"?: any;
|
||||
/**
|
||||
* Specifies which icon to use on `ios` mode.
|
||||
*/
|
||||
"ios"?: string;
|
||||
/**
|
||||
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
|
||||
* @default false
|
||||
*/
|
||||
"lazy"?: boolean;
|
||||
/**
|
||||
* Specifies which icon to use on `md` mode.
|
||||
*/
|
||||
"md"?: string;
|
||||
/**
|
||||
* The mode determines which platform styles to use.
|
||||
* @default getIonMode()
|
||||
*/
|
||||
"mode"?: string;
|
||||
/**
|
||||
* Specifies which icon to use from the built-in set of icons.
|
||||
*/
|
||||
"name"?: string;
|
||||
/**
|
||||
* When `true`, SVG content, including SVG `data:` URLs, is checked before it renders. SVGs with `<script>` elements, attributes that start with `on` (like `onclick`), `javascript:` URLs, or non-SVG elements aren't rendered, and `<foreignObject>` elements are removed. Only set this to `false` for SVG content from a trusted source.
|
||||
* @default true
|
||||
*/
|
||||
"sanitize"?: boolean;
|
||||
/**
|
||||
* The size of the icon. Available options are: `"small"` and `"large"`.
|
||||
*/
|
||||
"size"?: string;
|
||||
/**
|
||||
* Specifies the exact `src` of an SVG file to use.
|
||||
*/
|
||||
"src"?: string;
|
||||
}
|
||||
|
||||
interface IonIconAttributes {
|
||||
"mode": string;
|
||||
"color": string;
|
||||
"ios": string;
|
||||
"md": string;
|
||||
"flipRtl": boolean;
|
||||
"name": string;
|
||||
"src": string;
|
||||
"icon": string;
|
||||
"size": string;
|
||||
"lazy": boolean;
|
||||
"sanitize": boolean;
|
||||
}
|
||||
|
||||
interface IntrinsicElements {
|
||||
"ion-icon": Omit<IonIcon, keyof IonIconAttributes> & { [K in keyof IonIcon & keyof IonIconAttributes]?: IonIcon[K] } & { [K in keyof IonIcon & keyof IonIconAttributes as `attr:${K}`]?: IonIconAttributes[K] } & { [K in keyof IonIcon & keyof IonIconAttributes as `prop:${K}`]?: IonIcon[K] };
|
||||
}
|
||||
}
|
||||
export { LocalJSX as JSX };
|
||||
declare module "@stencil/core" {
|
||||
export namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
"ion-icon": LocalJSX.IntrinsicElements["ion-icon"] & JSXBase.HTMLAttributes<HTMLIonIconElement>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 512 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>
|
||||
|
After Width: | Height: | Size: 227 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 4H5C3.34 4 2 5.34 2 7v8c0 1.66 1.34 3 3 3l-1 1v1h1l2-2.03L9 18v-5H4V5.98L13 6v2h2V7c0-1.66-1.34-3-3-3zM5 14c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm15.57-4.34c-.14-.4-.52-.66-.97-.66h-7.19c-.46 0-.83.26-.98.66L10 13.77l.01 5.51c0 .38.31.72.69.72h.62c.38 0 .68-.38.68-.76V18h8v1.24c0 .38.31.76.69.76h.61c.38 0 .69-.34.69-.72l.01-1.37v-4.14l-1.43-4.11zm-8.16.34h7.19l1.03 3h-9.25l1.03-3zM12 16c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm8 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/><path fill="none" d="M0 0h24v24H0z"/></svg>
|
||||
|
After Width: | Height: | Size: 641 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><defs><path id="a" d="M24 0v24H0V0h24z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path d="M10.08 10.86c.05-.33.16-.62.3-.87s.34-.46.59-.62c.24-.15.54-.22.91-.23.23.01.44.05.63.13.2.09.38.21.52.36s.25.33.34.53.13.42.14.64h1.79c-.02-.47-.11-.9-.28-1.29s-.4-.73-.7-1.01-.66-.5-1.08-.66-.88-.23-1.39-.23c-.65 0-1.22.11-1.7.34s-.88.53-1.2.92-.56.84-.71 1.36S8 11.29 8 11.87v.27c0 .58.08 1.12.23 1.64s.39.97.71 1.35.72.69 1.2.91 1.05.34 1.7.34c.47 0 .91-.08 1.32-.23s.77-.36 1.08-.63.56-.58.74-.94.29-.74.3-1.15h-1.79c-.01.21-.06.4-.15.58s-.21.33-.36.46-.32.23-.52.3c-.19.07-.39.09-.6.1-.36-.01-.66-.08-.89-.23-.25-.16-.45-.37-.59-.62s-.25-.55-.3-.88-.08-.67-.08-1v-.27c0-.35.03-.68.08-1.01zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" clip-path="url(#b)"/></svg>
|
||||
|
After Width: | Height: | Size: 1000 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>
|
||||
|
After Width: | Height: | Size: 292 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z"/></svg>
|
||||
|
After Width: | Height: | Size: 369 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><script>alert('got ya')</script><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 544 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><script>alert('got ya')</script><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 544 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6z"/><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 12c0-2.61 1.67-4.83 4-5.65V4.26C3.55 5.15 1 8.27 1 12s2.55 6.85 6 7.74v-2.09c-2.33-.82-4-3.04-4-5.65z"/></svg>
|
||||
|
After Width: | Height: | Size: 372 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm0 14H5V8h14v10z"/><path fill="none" d="M0 0h24v24H0z"/></svg>
|
||||
|
After Width: | Height: | Size: 233 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 6V4h-4v2h4zM4 8v11h16V8H4zm16-2c1.11 0 2 .89 2 2v11c0 1.11-.89 2-2 2H4c-1.11 0-2-.89-2-2l.01-11c0-1.11.88-2 1.99-2h4V4c0-1.11.89-2 2-2h4c1.11 0 2 .89 2 2v2h4z"/><path fill="none" d="M0 0h24v24H0z"/></svg>
|
||||
|
After Width: | Height: | Size: 340 B |
@@ -0,0 +1,161 @@
|
||||
:host {
|
||||
display: inline-block;
|
||||
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
|
||||
font-size: 1em;
|
||||
|
||||
contain: layout style;
|
||||
|
||||
fill: currentColor;
|
||||
|
||||
box-sizing: content-box !important;
|
||||
}
|
||||
|
||||
:host .ionicon {
|
||||
stroke: currentColor;
|
||||
}
|
||||
|
||||
.ionicon-fill-none {
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.ionicon-stroke-width {
|
||||
stroke-width: var(--ionicon-stroke-width, 32px);
|
||||
}
|
||||
|
||||
.icon-inner {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ionicon,
|
||||
svg {
|
||||
display: block;
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Slotted Content
|
||||
* -----------------------------------------------------------
|
||||
*/
|
||||
|
||||
::slotted(*) {
|
||||
font-size: inherit !important;
|
||||
}
|
||||
|
||||
/* Icon RTL
|
||||
* -----------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Safari <16.4 incorrectly reports
|
||||
* that it supports :dir(rtl) when it does not.
|
||||
* This @supports statement lets us target
|
||||
* WebKit browsers to apply the RTL fallback.
|
||||
* -webkit-named-image only exists on WebKit.
|
||||
* For WebKit browsers that do support :dir(rtl)
|
||||
* (i.e. Safari >= 16.4) then the :dir(rtl)
|
||||
* code farther down on the page will take
|
||||
* effect and override this fallback.
|
||||
*/
|
||||
@supports (background: -webkit-named-image(i)) {
|
||||
:host(.icon-rtl) .icon-inner {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fallback for browsers that support
|
||||
* neither :host-context nor :dir.
|
||||
* The icon will not react to dir
|
||||
* changes, but it will at least
|
||||
* respect the dir on component load.
|
||||
*/
|
||||
@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])) {
|
||||
:host(.icon-rtl) .icon-inner {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/* :host-context is supported in chromium; :dir is supported in safari & firefox */
|
||||
:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
@supports selector(:dir(rtl)) {
|
||||
:host(.flip-rtl:dir(rtl)) .icon-inner {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
/**
|
||||
* This is needed for WebKit otherwise the fallback
|
||||
* will always cause the icon to be flipped if the document
|
||||
* loads in RTL.
|
||||
*/
|
||||
:host(.flip-rtl:dir(ltr)) .icon-inner {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Icon Sizes
|
||||
* -----------------------------------------------------------
|
||||
*/
|
||||
|
||||
:host(.icon-small) {
|
||||
font-size: 1.125rem !important;
|
||||
}
|
||||
|
||||
:host(.icon-large) {
|
||||
font-size: 2rem !important;
|
||||
}
|
||||
|
||||
/* Icon Colors
|
||||
* -----------------------------------------------------------
|
||||
*/
|
||||
|
||||
:host(.ion-color) {
|
||||
color: var(--ion-color-base) !important;
|
||||
}
|
||||
|
||||
:host(.ion-color-primary) {
|
||||
--ion-color-base: var(--ion-color-primary, #3880ff);
|
||||
}
|
||||
|
||||
:host(.ion-color-secondary) {
|
||||
--ion-color-base: var(--ion-color-secondary, #0cd1e8);
|
||||
}
|
||||
|
||||
:host(.ion-color-tertiary) {
|
||||
--ion-color-base: var(--ion-color-tertiary, #f4a942);
|
||||
}
|
||||
|
||||
:host(.ion-color-success) {
|
||||
--ion-color-base: var(--ion-color-success, #10dc60);
|
||||
}
|
||||
|
||||
:host(.ion-color-warning) {
|
||||
--ion-color-base: var(--ion-color-warning, #ffce00);
|
||||
}
|
||||
|
||||
:host(.ion-color-danger) {
|
||||
--ion-color-base: var(--ion-color-danger, #f14141);
|
||||
}
|
||||
|
||||
:host(.ion-color-light) {
|
||||
--ion-color-base: var(--ion-color-light, #f4f5f8);
|
||||
}
|
||||
|
||||
:host(.ion-color-medium) {
|
||||
--ion-color-base: var(--ion-color-medium, #989aa2);
|
||||
}
|
||||
|
||||
:host(.ion-color-dark) {
|
||||
--ion-color-base: var(--ion-color-dark, #222428);
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';
|
||||
import { getCacheKey, getSvgContent, ioniconContent } from './request';
|
||||
import { getName, getUrl, inheritAttributes, isRTL } from './utils';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-icon',
|
||||
assetsDirs: ['svg'],
|
||||
styleUrl: 'icon.css',
|
||||
shadow: true,
|
||||
})
|
||||
export class Icon {
|
||||
private io?: IntersectionObserver;
|
||||
private iconName: string | null = null;
|
||||
private inheritedAttributes: { [k: string]: any } = {};
|
||||
private didLoadIcon = false;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@State() private svgContent?: string;
|
||||
@State() private isVisible = false;
|
||||
|
||||
/**
|
||||
* The mode determines which platform styles to use.
|
||||
*/
|
||||
@Prop({ mutable: true }) mode = getIonMode();
|
||||
|
||||
/**
|
||||
* The color to use for the background of the item.
|
||||
*/
|
||||
@Prop() color?: string;
|
||||
|
||||
/**
|
||||
* Specifies which icon to use on `ios` mode.
|
||||
*/
|
||||
@Prop() ios?: string;
|
||||
|
||||
/**
|
||||
* Specifies which icon to use on `md` mode.
|
||||
*/
|
||||
@Prop() md?: string;
|
||||
|
||||
/**
|
||||
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
|
||||
*/
|
||||
@Prop() flipRtl?: boolean;
|
||||
|
||||
/**
|
||||
* Specifies which icon to use from the built-in set of icons.
|
||||
*/
|
||||
@Prop({ reflect: true }) name?: string;
|
||||
|
||||
/**
|
||||
* Specifies the exact `src` of an SVG file to use.
|
||||
*/
|
||||
@Prop() src?: string;
|
||||
|
||||
/**
|
||||
* A combination of both `name` and `src`. If a `src` url is detected
|
||||
* it will set the `src` property. Otherwise it assumes it's a built-in named
|
||||
* SVG and set the `name` property.
|
||||
*/
|
||||
@Prop() icon?: any;
|
||||
|
||||
/**
|
||||
* The size of the icon.
|
||||
* Available options are: `"small"` and `"large"`.
|
||||
*/
|
||||
@Prop() size?: string;
|
||||
|
||||
/**
|
||||
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
|
||||
* Default, `false`.
|
||||
*/
|
||||
@Prop() lazy = false;
|
||||
|
||||
/**
|
||||
* When `true`, SVG content, including SVG `data:` URLs, is checked before it
|
||||
* renders. SVGs with `<script>` elements, attributes that start with `on`
|
||||
* (like `onclick`), `javascript:` URLs, or non-SVG elements aren't rendered,
|
||||
* and `<foreignObject>` elements are removed. Only set this to `false` for
|
||||
* SVG content from a trusted source.
|
||||
* @default true
|
||||
*/
|
||||
@Prop() sanitize = true;
|
||||
|
||||
componentWillLoad() {
|
||||
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
/**
|
||||
* purposely do not return the promise here because loading
|
||||
* the svg file should not hold up loading the app
|
||||
* only load the svg if it's visible
|
||||
*/
|
||||
this.waitUntilVisible(this.el, '50px', () => {
|
||||
this.isVisible = true;
|
||||
this.loadIcon();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the icon after the component has finished rendering.
|
||||
*/
|
||||
componentDidLoad() {
|
||||
/**
|
||||
* Addresses an Angular issue where property values are assigned after the 'connectedCallback' but prior to the registration of watchers.
|
||||
* This enhancement ensures the loading of an icon when the component has finished rendering and the icon has yet to apply the SVG data.
|
||||
* This modification pertains to the usage of Angular's binding syntax:
|
||||
* `<ion-icon [name]="myIconName"></ion-icon>`
|
||||
*/
|
||||
if (!this.didLoadIcon) {
|
||||
this.loadIcon();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect the IntersectionObserver.
|
||||
*/
|
||||
disconnectedCallback() {
|
||||
if (this.io) {
|
||||
this.io.disconnect();
|
||||
this.io = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait until the icon is visible in the viewport.
|
||||
* @param el - The element to observe.
|
||||
* @param rootMargin - The root margin of the observer.
|
||||
* @param cb - The callback to call when the element is visible.
|
||||
*/
|
||||
private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {
|
||||
/**
|
||||
* IntersectionObserver is a browser API that allows you to observe
|
||||
* the visibility of an element relative to a root element. It is
|
||||
* supported in all modern browsers, except IE and when server-side
|
||||
* rendering.
|
||||
*/
|
||||
const hasIntersectionObserverSupport = Boolean(
|
||||
Build.isBrowser && this.lazy && typeof window !== 'undefined' && window.IntersectionObserver,
|
||||
);
|
||||
|
||||
/**
|
||||
* browser doesn't support IntersectionObserver
|
||||
* so just fallback to always show it
|
||||
*/
|
||||
if (!hasIntersectionObserverSupport) {
|
||||
return cb();
|
||||
}
|
||||
|
||||
const io = (this.io = new window.IntersectionObserver(
|
||||
(data: IntersectionObserverEntry[]) => {
|
||||
if (data[0].isIntersecting) {
|
||||
io.disconnect();
|
||||
this.io = undefined;
|
||||
cb();
|
||||
}
|
||||
},
|
||||
{ rootMargin },
|
||||
));
|
||||
|
||||
io.observe(el);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch for changes to the icon name, src, icon, ios, or md properties.
|
||||
* When a change is detected, the icon will be loaded.
|
||||
*/
|
||||
@Watch('name')
|
||||
@Watch('src')
|
||||
@Watch('icon')
|
||||
@Watch('ios')
|
||||
@Watch('md')
|
||||
loadIcon() {
|
||||
if (Build.isBrowser && this.isVisible) {
|
||||
const url = getUrl(this);
|
||||
|
||||
if (url) {
|
||||
const cacheKey = getCacheKey(url, this.sanitize);
|
||||
if (ioniconContent.has(cacheKey)) {
|
||||
// sync if it's already loaded
|
||||
this.svgContent = ioniconContent.get(cacheKey);
|
||||
} else {
|
||||
// async if it hasn't been loaded
|
||||
getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(cacheKey)));
|
||||
}
|
||||
this.didLoadIcon = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { flipRtl, iconName, inheritedAttributes, el } = this;
|
||||
const mode = this.mode || 'md';
|
||||
|
||||
/**
|
||||
* we have designated that arrows & chevrons should automatically flip (unless flip-rtl
|
||||
* is set to false) because "back" is left in ltr and right in rtl, and "forward" is the opposite
|
||||
*/
|
||||
const shouldAutoFlip = iconName
|
||||
? (iconName.includes('arrow') || iconName.includes('chevron')) && flipRtl !== false
|
||||
: false;
|
||||
|
||||
/**
|
||||
* if shouldBeFlippable is true, the icon should change direction when `dir` changes
|
||||
*/
|
||||
const shouldBeFlippable = flipRtl || shouldAutoFlip;
|
||||
|
||||
return (
|
||||
<Host
|
||||
role="img"
|
||||
class={{
|
||||
[mode]: true,
|
||||
...createColorClasses(this.color),
|
||||
[`icon-${this.size}`]: !!this.size,
|
||||
'flip-rtl': shouldBeFlippable,
|
||||
'icon-rtl': shouldBeFlippable && isRTL(el),
|
||||
}}
|
||||
{...inheritedAttributes}
|
||||
>
|
||||
{Build.isBrowser && this.svgContent ? (
|
||||
<div class="icon-inner" innerHTML={this.svgContent}></div>
|
||||
) : (
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
)}
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mode of the document.
|
||||
* @returns The mode of the document.
|
||||
*/
|
||||
const getIonMode = () =>
|
||||
(Build.isBrowser && typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
|
||||
|
||||
/**
|
||||
* Create color classes for the icon.
|
||||
* @param color - The color of the icon.
|
||||
* @returns The color classes for the icon.
|
||||
*/
|
||||
const createColorClasses = (color: string | undefined) => {
|
||||
return color
|
||||
? {
|
||||
'ion-color': true,
|
||||
[`ion-color-${color}`]: true,
|
||||
}
|
||||
: null;
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
# ion-icon
|
||||
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Attribute | Description | Type | Default |
|
||||
| ---------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | -------------- |
|
||||
| `color` | `color` | The color to use for the background of the item. | `string \| undefined` | `undefined` |
|
||||
| `flipRtl` | `flip-rtl` | Specifies whether the icon should horizontally flip when `dir` is `"rtl"`. | `boolean \| undefined` | `undefined` |
|
||||
| `icon` | `icon` | A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property. | `any` | `undefined` |
|
||||
| `ios` | `ios` | Specifies which icon to use on `ios` mode. | `string \| undefined` | `undefined` |
|
||||
| `lazy` | `lazy` | If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`. | `boolean` | `false` |
|
||||
| `md` | `md` | Specifies which icon to use on `md` mode. | `string \| undefined` | `undefined` |
|
||||
| `mode` | `mode` | The mode determines which platform styles to use. | `string` | `getIonMode()` |
|
||||
| `name` | `name` | Specifies which icon to use from the built-in set of icons. | `string \| undefined` | `undefined` |
|
||||
| `sanitize` | `sanitize` | When `true`, SVG content, including SVG `data:` URLs, is checked before it renders. SVGs with `<script>` elements, attributes that start with `on` (like `onclick`), `javascript:` URLs, or non-SVG elements aren't rendered, and `<foreignObject>` elements are removed. Only set this to `false` for SVG content from a trusted source. | `boolean` | `true` |
|
||||
| `size` | `size` | The size of the icon. Available options are: `"small"` and `"large"`. | `string \| undefined` | `undefined` |
|
||||
| `src` | `src` | Specifies the exact `src` of an SVG file to use. | `string \| undefined` | `undefined` |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
*Built with [StencilJS](https://stenciljs.com/)*
|
||||
@@ -0,0 +1,111 @@
|
||||
import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';
|
||||
|
||||
export const ioniconContent = new Map<string, string>();
|
||||
const requests = new Map<string, Promise<any>>();
|
||||
|
||||
let parser: DOMParser;
|
||||
|
||||
/**
|
||||
* Unsanitized content gets its own key so it's never served to an icon that
|
||||
* sanitizes.
|
||||
*/
|
||||
export const getCacheKey = (url: string, sanitize: boolean) =>
|
||||
`${sanitize !== false ? 'sanitized' : 'unsanitized'}:${url}`;
|
||||
|
||||
/**
|
||||
* Warns when the whole icon is rejected so it doesn't silently render nothing.
|
||||
*/
|
||||
const sanitizeSvg = (url: string, svgContent: string) =>
|
||||
validateContent(svgContent, () => {
|
||||
const source = url.length > 100 ? `${url.slice(0, 100)}...` : url;
|
||||
console.warn(
|
||||
`[Ionicons Warning]: The SVG from "${source}" was not rendered because it failed sanitization. Only set sanitize="false" for SVG content from a trusted source.`,
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Safely fallback to an empty svg
|
||||
*/
|
||||
function safeFallback(cacheKey: string) {
|
||||
const svg = '';
|
||||
ioniconContent.set(cacheKey, svg);
|
||||
return svg;
|
||||
}
|
||||
|
||||
export const getSvgContent = (url: string, sanitize: boolean): Promise<string> => {
|
||||
const cacheKey = getCacheKey(url, sanitize);
|
||||
/**
|
||||
* See if we already have a request for this url
|
||||
*/
|
||||
const req = requests.get(cacheKey);
|
||||
if (req) {
|
||||
return req;
|
||||
}
|
||||
|
||||
if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
|
||||
/**
|
||||
* If the url is a data url of an svg, then try to parse it
|
||||
* with the DOMParser. This works with content security policies enabled.
|
||||
*/
|
||||
if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
|
||||
return Promise.resolve(getSvgByUrl(url, sanitize));
|
||||
}
|
||||
|
||||
return fetchSvg(url, sanitize);
|
||||
}
|
||||
|
||||
return Promise.resolve(safeFallback(cacheKey));
|
||||
};
|
||||
|
||||
function getSvgByUrl(url: string, sanitize: boolean): string {
|
||||
if (!parser) {
|
||||
/**
|
||||
* Create an instance of the DOM parser. This creates a single
|
||||
* parser instance for the entire app, which is more efficient.
|
||||
*/
|
||||
parser = new DOMParser();
|
||||
}
|
||||
const doc = parser.parseFromString(url, 'text/html');
|
||||
const svg = doc.querySelector('svg');
|
||||
if (svg) {
|
||||
const svgContent = sanitize !== false ? sanitizeSvg(url, svg.outerHTML) : svg.outerHTML;
|
||||
ioniconContent.set(getCacheKey(url, sanitize), svgContent);
|
||||
return svgContent;
|
||||
}
|
||||
|
||||
throw new Error(`Could not parse svg from ${url}`);
|
||||
}
|
||||
|
||||
function fetchSvg(url: string, sanitize: boolean): Promise<string> {
|
||||
const cacheKey = getCacheKey(url, sanitize);
|
||||
/**
|
||||
* We don't already have a request
|
||||
*/
|
||||
const req = fetch(url)
|
||||
.then((rsp) => {
|
||||
/**
|
||||
* When fetching from a file:// URL, some browsers return
|
||||
* a 0 status code even when the request succeeds so don't
|
||||
* rely on rsp.ok as the only signal of success.
|
||||
*/
|
||||
return rsp
|
||||
.text()
|
||||
.then((svgContent) => {
|
||||
if (svgContent && sanitize !== false) {
|
||||
svgContent = sanitizeSvg(url, svgContent);
|
||||
}
|
||||
|
||||
const svg = svgContent || '';
|
||||
ioniconContent.set(cacheKey, svg);
|
||||
return svg;
|
||||
})
|
||||
.catch(() => safeFallback(cacheKey));
|
||||
})
|
||||
.catch(() => safeFallback(cacheKey));
|
||||
|
||||
/**
|
||||
* Cache for the same requests
|
||||
*/
|
||||
requests.set(cacheKey, req);
|
||||
return req;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
# this gitignore file is used as a placeholder
|
||||
# for this directory. The directory itself will
|
||||
# contain files generated during a build step.
|
||||
!.gitignore
|
||||
@@ -0,0 +1,15 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
import { AxeBuilder } from '@axe-core/playwright';
|
||||
|
||||
test.describe('icon: a11y', () => {
|
||||
test('should pass accessibility checks', async ({ page }) => {
|
||||
await page.goto(`/icon/test/a11y/`);
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const results = await new AxeBuilder({ page }).analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - Accessibility</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Accessibility</h1>
|
||||
|
||||
<h2>SVG icon with aria-label</h2>
|
||||
<ion-icon name="cellular" aria-label="Mobile data"></ion-icon>
|
||||
|
||||
<h2>Button with aria-label and SVG icon</h2>
|
||||
<button aria-label="Mobile data">
|
||||
<ion-icon name="cellular" aria-hidden="true"></ion-icon>
|
||||
</button>
|
||||
|
||||
<h2>SVG icon with aria-hidden</h2>
|
||||
<ion-icon name="cellular" aria-hidden="true"></ion-icon>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2>Font icon with aria-label</h2>
|
||||
<ion-icon aria-label="Mobile data">
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
|
||||
<h2>Button with aria-label and font icon</h2>
|
||||
<button aria-label="Mobile data">
|
||||
<ion-icon aria-hidden="true">
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
</button>
|
||||
|
||||
<h2>Font icon with aria-hidden</h2>
|
||||
<ion-icon aria-hidden="true">
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
ion-icon {
|
||||
font-size: 32px;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('icon: basic', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/icon/test/basic/`);
|
||||
|
||||
// Wait for all SVGs to be lazily loaded before taking screenshots
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await expect(page).toHaveScreenshot(`icon-basic.png`, { fullPage: true });
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 68 KiB |
@@ -0,0 +1,101 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - Basic</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Basic</h1>
|
||||
|
||||
<h2>Default</h2>
|
||||
<ion-icon name="cellular"></ion-icon>
|
||||
<ion-icon name="at"></ion-icon>
|
||||
<ion-icon name="call"></ion-icon>
|
||||
<ion-icon name="football"></ion-icon>
|
||||
<ion-icon name="analytics"></ion-icon>
|
||||
<ion-icon name="grid"></ion-icon>
|
||||
<ion-icon name="funnel"></ion-icon>
|
||||
<ion-icon name="watch"></ion-icon>
|
||||
<ion-icon name="add-circle-outline"></ion-icon>
|
||||
|
||||
<h2>Mode from html ios mode attribute</h2>
|
||||
<ion-icon md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<ion-icon md="logo-android" ios="logo-apple"></ion-icon>
|
||||
|
||||
<h2>Mode set on icon</h2>
|
||||
<ion-icon mode="ios" md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<ion-icon mode="md" md="logo-android" ios="logo-apple"></ion-icon>
|
||||
|
||||
<h2>Colors</h2>
|
||||
<ion-icon color="primary" name="cellular"></ion-icon>
|
||||
<ion-icon color="secondary" name="at"></ion-icon>
|
||||
<ion-icon color="tertiary" name="call"></ion-icon>
|
||||
<ion-icon color="success" name="football"></ion-icon>
|
||||
<ion-icon color="warning" name="analytics"></ion-icon>
|
||||
<ion-icon color="danger" name="grid"></ion-icon>
|
||||
<ion-icon color="light" name="funnel"></ion-icon>
|
||||
<ion-icon color="medium" name="watch"></ion-icon>
|
||||
<ion-icon color="dark" name="toggle"></ion-icon>
|
||||
|
||||
<h2>Stroke width</h2>
|
||||
<ion-icon name="heart-outline" style="--ionicon-stroke-width: 8px"></ion-icon>
|
||||
|
||||
<h2>Font size</h2>
|
||||
<ion-icon name="book" style="font-size: 50px"></ion-icon>
|
||||
<ion-icon src="../../assets/bug_report.svg" style="font-size: 50px"></ion-icon>
|
||||
|
||||
<h2>Custom SVGs</h2>
|
||||
<ion-icon src="../../assets/bug_report.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/chat.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/commute.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/copyright.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/done_all.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/lock_open.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/toll.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon src="../../assets/work_outline.svg"></ion-icon>
|
||||
|
||||
<h2>Custom SVGs: colors</h2>
|
||||
<ion-icon color="primary" src="../../assets/bug_report.svg"></ion-icon>
|
||||
<ion-icon color="secondary" src="../../assets/chat.svg"></ion-icon>
|
||||
<ion-icon color="tertiary" src="../../assets/commute.svg"></ion-icon>
|
||||
<ion-icon color="success" src="../../assets/copyright.svg"></ion-icon>
|
||||
<ion-icon color="warning" src="../../assets/done_all.svg"></ion-icon>
|
||||
<ion-icon color="danger" src="../../assets/lock_open.svg"></ion-icon>
|
||||
<ion-icon color="light" src="../../assets/toll.svg"></ion-icon>
|
||||
<ion-icon color="medium" src="../../assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon color="dark" src="../../assets/work_outline.svg"></ion-icon>
|
||||
|
||||
<h2>Custom CSS</h2>
|
||||
<ion-icon class="custom" name="grid"></ion-icon>
|
||||
<ion-icon class="custom" name="funnel"></ion-icon>
|
||||
<ion-icon class="custom" name="watch"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-react"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-javascript"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-angular"></ion-icon>
|
||||
<ion-icon class="custom" src="../../assets/done_all.svg"></ion-icon>
|
||||
<ion-icon class="custom" src="../../assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon class="custom" src="../../assets/work_outline.svg"></ion-icon>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
ion-icon {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.custom {
|
||||
stroke: red;
|
||||
fill: blue;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('icon: csp', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/icon/test/csp');
|
||||
});
|
||||
|
||||
test('should load svg', async ({ page }) => {
|
||||
const svg = page.locator('ion-icon#icon-usage svg');
|
||||
await expect(svg).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'none'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/*; img-src 'self'; connect-src 'self'; font-src https://fonts.gstatic.com/*'"
|
||||
/>
|
||||
<title>Icon - Content Security Policy</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Content Security Policy</h1>
|
||||
|
||||
<h2>Default</h2>
|
||||
<ion-icon src="/assets/chat.svg"></ion-icon>
|
||||
<ion-icon name="add"></ion-icon>
|
||||
|
||||
<ion-icon
|
||||
id="icon-usage"
|
||||
icon="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'><title>Watch</title><rect x='136' y='136' width='240' height='240' rx='8' ry='8'/><path d='M384 96h-48V16H176v80h-48a32 32 0 00-32 32v256a32 32 0 0032 32h48v80h160v-80h48a32 32 0 0032-32V128a32 32 0 00-32-32zm8 272a24 24 0 01-24 24H144a24 24 0 01-24-24V144a24 24 0 0124-24h224a24 24 0 0124 24z'/></svg>"
|
||||
>
|
||||
</ion-icon>
|
||||
|
||||
<ion-icon
|
||||
class="custom"
|
||||
icon="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'><title>Watch</title><rect x='136' y='136' width='240' height='240' rx='8' ry='8'/><path d='M384 96h-48V16H176v80h-48a32 32 0 00-32 32v256a32 32 0 0032 32h48v80h160v-80h48a32 32 0 0032-32V128a32 32 0 00-32-32zm8 272a24 24 0 01-24 24H144a24 24 0 01-24-24V144a24 24 0 0124-24h224a24 24 0 0124 24z'/></svg>"
|
||||
>
|
||||
</ion-icon>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
<style>
|
||||
ion-icon {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.custom {
|
||||
stroke: red;
|
||||
fill: goldenrod;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
@@ -0,0 +1,16 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('icon: dynamic type', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(`/icon/test/dynamic-type/`);
|
||||
});
|
||||
|
||||
test('should scale text on larger font sizes', async ({ page }) => {
|
||||
// Wait for all SVGs to be lazily loaded before taking screenshots
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const main = page.locator('main');
|
||||
await expect(main).toHaveScreenshot(`icon-dynamic-type.png`);
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,45 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - Dynamic Type</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Dynamic Type</h1>
|
||||
|
||||
<h2>Default Icons</h2>
|
||||
<ion-icon name="star"></ion-icon>
|
||||
<ion-icon name="star" size="small"></ion-icon>
|
||||
<ion-icon name="star" size="large"></ion-icon>
|
||||
|
||||
<h2>Font Icons</h2>
|
||||
<ion-icon>
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
<ion-icon size="small">
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
<ion-icon size="large">
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
html {
|
||||
font-size: 28px;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
class TestHeader extends HTMLElement {
|
||||
connectedCallback() {
|
||||
const header = document.createElement('header');
|
||||
header.innerHTML = `
|
||||
<a href="/" class="back-button">
|
||||
<ion-icon name="arrow-back" aria-hidden="true"></ion-icon>
|
||||
Back
|
||||
</a>
|
||||
`;
|
||||
this.appendChild(header);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('test-header', TestHeader);
|
||||
@@ -0,0 +1,202 @@
|
||||
import { newSpecPage } from 'jest-stencil-runner';
|
||||
import { Icon } from '../icon';
|
||||
|
||||
describe('icon', () => {
|
||||
describe('basic rendering', () => {
|
||||
it('renders', async () => {
|
||||
const { root } = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: '<ion-icon></ion-icon>',
|
||||
});
|
||||
expect(root).toEqualHtml(`
|
||||
<ion-icon class="md" role="img">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
|
||||
it('renders rtl with aria-hidden', async () => {
|
||||
const { root } = await newSpecPage({
|
||||
components: [Icon],
|
||||
direction: 'rtl',
|
||||
html: `<ion-icon name="chevron-forward" aria-hidden="true"></ion-icon>`,
|
||||
});
|
||||
|
||||
expect(root).toEqualHtml(`
|
||||
<ion-icon class="md flip-rtl icon-rtl" name="chevron-forward" role="img" aria-hidden="true">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
|
||||
it('renders custom aria-label', async () => {
|
||||
const { root } = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `<ion-icon name="star" aria-label="custom label"></ion-icon>`,
|
||||
});
|
||||
|
||||
expect(root).toEqualHtml(`
|
||||
<ion-icon class="md" name="star" role="img" aria-label="custom label">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('dynamic rendering', () => {
|
||||
it('renders custom label after changing source', async () => {
|
||||
const page = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `<ion-icon name="chevron-forward" aria-label="custom label"></ion-icon>`,
|
||||
});
|
||||
|
||||
const icon = page.root;
|
||||
|
||||
expect(icon).toEqualHtml(`
|
||||
<ion-icon class="flip-rtl md" name="chevron-forward" role="img" aria-label="custom label">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
</ion-icon>
|
||||
`);
|
||||
|
||||
if (icon) {
|
||||
icon.name = 'trash';
|
||||
}
|
||||
await page.waitForChanges();
|
||||
|
||||
expect(icon).toEqualHtml(`
|
||||
<ion-icon class="md" name="trash" role="img" aria-label="custom label">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('svg rendering scenarios', () => {
|
||||
it('svgContent=true: renders svg without slot', async () => {
|
||||
const page = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `<ion-icon aria-hidden="true" part="close-icon" class="close-icon"></ion-icon>`,
|
||||
});
|
||||
|
||||
const icon = page.root as any;
|
||||
const instance = page.rootInstance as any;
|
||||
instance.svgContent = '<svg><circle cx="50" cy="50" r="40"/></svg>';
|
||||
await page.waitForChanges();
|
||||
|
||||
const shadowRoot = icon.shadowRoot;
|
||||
const iconInner = shadowRoot?.querySelector('.icon-inner');
|
||||
|
||||
// Should have no slot
|
||||
const slot = iconInner?.querySelector('slot');
|
||||
expect(slot).toBeNull();
|
||||
|
||||
// SVG should be a direct child of icon-inner,
|
||||
// not nested in another div
|
||||
expect(iconInner?.children.length).toBe(1);
|
||||
const firstChild = iconInner?.children[0];
|
||||
expect((firstChild as any)?.tagName?.toLowerCase()).toBe('svg');
|
||||
expect(firstChild?.querySelector('circle')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('svgContent=false: renders slot for custom content', async () => {
|
||||
const page = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `<ion-icon aria-hidden="true" part="close-icon" class="close-icon"></ion-icon>`,
|
||||
});
|
||||
|
||||
const icon = page.root as any;
|
||||
const shadowRoot = icon.shadowRoot;
|
||||
const iconInner = shadowRoot?.querySelector('.icon-inner');
|
||||
const slot = iconInner?.querySelector('slot');
|
||||
const svg = iconInner?.querySelector('svg');
|
||||
|
||||
expect(slot).not.toBeNull();
|
||||
expect(svg).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('slotted content', () => {
|
||||
it('renders slotted font icon (Font Awesome)', async () => {
|
||||
const { root } = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `
|
||||
<ion-icon>
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
`,
|
||||
});
|
||||
expect(root).toEqualHtml(`
|
||||
<ion-icon class="md" role="img">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
|
||||
it('renders slotted font icon with color', async () => {
|
||||
const { root } = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `
|
||||
<ion-icon color="primary">
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
`,
|
||||
});
|
||||
expect(root).toEqualHtml(`
|
||||
<ion-icon class="md ion-color ion-color-primary" color="primary" role="img">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
|
||||
it('renders slotted font icon with custom style', async () => {
|
||||
const { root } = await newSpecPage({
|
||||
components: [Icon],
|
||||
html: `
|
||||
<ion-icon style="font-size: 48px">
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
`,
|
||||
});
|
||||
expect(root).toEqualHtml(`
|
||||
<ion-icon class="md" role="img" style="font-size: 48px">
|
||||
<mock:shadow-root>
|
||||
<div class="icon-inner">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</mock:shadow-root>
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon Tests</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="./icon/test/styles.css" />
|
||||
<script src="./icon/test/header.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<h1>Icon Tests</h1>
|
||||
<p>Select a test category to view the icon component tests.</p>
|
||||
|
||||
<div class="grid">
|
||||
<a href="/icon/test/a11y/" class="card">
|
||||
<h3>Accessibility</h3>
|
||||
<p>ARIA labels and accessible icon patterns</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/basic/" class="card">
|
||||
<h3>Basic</h3>
|
||||
<p>Default SVG icons, modes, colors, sizes, and custom SVGs</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/cheatsheet/" class="card">
|
||||
<h3>Cheatsheet</h3>
|
||||
<p>Visual reference of all available ionicons</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/csp/" class="card">
|
||||
<h3>Content Security Policy</h3>
|
||||
<p>SVG content loading with Content Security Policy</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/dynamic-type/" class="card">
|
||||
<h3>Dynamic Type</h3>
|
||||
<p>Font size scaling and dynamic text sizing behavior</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/rtl/" class="card">
|
||||
<h3>RTL</h3>
|
||||
<p>Right-to-left text direction and icon flipping behavior</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/sanitization/" class="card">
|
||||
<h3>Sanitization</h3>
|
||||
<p>SVG content sanitization and security</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/size/" class="card">
|
||||
<h3>Size</h3>
|
||||
<p>Size prop with small and large variants for native and slotted icons</p>
|
||||
</a>
|
||||
|
||||
<a href="/icon/test/slotted/" class="card">
|
||||
<h3>Slotted Content</h3>
|
||||
<p>Font Awesome, Material, Phosphor, Bootstrap, and custom SVGs</p>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,60 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('icon: rtl', () => {
|
||||
test('some icons should flip when rtl', async ({ page }) => {
|
||||
await page.goto(`/icon/test/rtl/`);
|
||||
|
||||
const autoflip = page.locator('.auto-flip-chevrons [name=chevron-forward] .icon-inner');
|
||||
const unflip = page.locator('.un-flip-chevrons [name=chevron-forward] .icon-inner');
|
||||
await expect(autoflip).not.toHaveCSS('transform', /matrix\(-1/);
|
||||
await expect(unflip).not.toHaveCSS('transform', /matrix\(-1/);
|
||||
|
||||
await page.evaluate(() => {
|
||||
document.dir = 'rtl';
|
||||
});
|
||||
|
||||
await expect(autoflip).toHaveCSS('transform', /matrix\(-1/);
|
||||
await expect(unflip).not.toHaveCSS('transform', /matrix\(-1/);
|
||||
|
||||
// Wait for all SVGs to be lazily loaded before taking screenshots
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await expect(page).toHaveScreenshot(`icon-rtl.png`);
|
||||
});
|
||||
|
||||
test('arrows should flip if dir changes on the element', async ({ page }) => {
|
||||
await page.goto(`/icon/test/rtl/`);
|
||||
|
||||
const autoflip = page.locator('.auto-flip-chevrons [name=chevron-forward] .icon-inner');
|
||||
const unflip = page.locator('.un-flip-chevrons [name=chevron-forward] .icon-inner');
|
||||
await expect(autoflip).not.toHaveCSS('transform', /matrix\(-1/);
|
||||
await expect(unflip).not.toHaveCSS('transform', /matrix\(-1/);
|
||||
|
||||
const autoflipEl = await page.$('.auto-flip-chevrons [name=chevron-forward]');
|
||||
const unflipEl = await page.$('.un-flip-chevrons [name=chevron-forward]');
|
||||
await autoflipEl!.evaluate((node) => node.setAttribute('dir', 'rtl'));
|
||||
await unflipEl!.evaluate((node) => node.setAttribute('dir', 'rtl'));
|
||||
|
||||
await expect(autoflip).toHaveCSS('transform', /matrix\(-1/);
|
||||
await expect(unflip).not.toHaveCSS('transform', /matrix\(-1/);
|
||||
});
|
||||
|
||||
test('icon should reassess flipping when name changes', async ({ page }) => {
|
||||
await page.goto(`/icon/test/rtl/`);
|
||||
|
||||
await page.evaluate(() => {
|
||||
document.dir = 'rtl';
|
||||
});
|
||||
|
||||
const iconLoc = page.locator('.auto-flip-chevrons ion-icon:nth-child(2)');
|
||||
await expect(iconLoc).toHaveAttribute('name', 'chevron-forward');
|
||||
await expect(iconLoc).toHaveClass(/flip-rtl/);
|
||||
|
||||
const iconEl = await page.$('.auto-flip-chevrons ion-icon:nth-child(2)');
|
||||
await iconEl!.evaluate((node) => node.setAttribute('name', 'brush'));
|
||||
|
||||
await expect(iconLoc).toHaveAttribute('name', 'brush');
|
||||
await expect(iconLoc).not.toHaveClass(/flip-rtl/);
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 34 KiB |
@@ -0,0 +1,72 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - RTL</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - RTL</h1>
|
||||
|
||||
<h2>Default: Non-arrows</h2>
|
||||
<ion-icon name="cut"></ion-icon>
|
||||
<ion-icon name="call"></ion-icon>
|
||||
<ion-icon name="checkbox"></ion-icon>
|
||||
<ion-icon name="brush"></ion-icon>
|
||||
|
||||
<h2>Flip: Non-arrows</h2>
|
||||
<ion-icon name="cut" flip-rtl></ion-icon>
|
||||
<ion-icon name="call" flip-rtl></ion-icon>
|
||||
<ion-icon name="checkbox" flip-rtl></ion-icon>
|
||||
<ion-icon name="brush" flip-rtl></ion-icon>
|
||||
|
||||
<h2>Auto Flip: arrows</h2>
|
||||
<ion-icon name="arrow-up"></ion-icon>
|
||||
<ion-icon name="arrow-forward"></ion-icon>
|
||||
<ion-icon name="arrow-down"></ion-icon>
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
|
||||
<h2>Un-flip: arrows</h2>
|
||||
<ion-icon name="arrow-up" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-forward" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-down" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-back" flip-rtl="false"></ion-icon>
|
||||
|
||||
<h2>Auto Flip: chevrons</h2>
|
||||
<div class="auto-flip-chevrons">
|
||||
<ion-icon name="chevron-up"></ion-icon>
|
||||
<ion-icon name="chevron-forward"></ion-icon>
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
<ion-icon name="chevron-back"></ion-icon>
|
||||
</div>
|
||||
|
||||
<h2>Un-flip: chevrons</h2>
|
||||
<div class="un-flip-chevrons">
|
||||
<ion-icon name="chevron-up" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-forward" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-down" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-back" flip-rtl="false"></ion-icon>
|
||||
</div>
|
||||
|
||||
<h2>Auto Flip, RTL on components</h2>
|
||||
<ion-icon name="arrow-up" dir="rtl" flip-rtl></ion-icon>
|
||||
<ion-icon name="arrow-forward" dir="rtl" flip-rtl></ion-icon>
|
||||
<ion-icon name="arrow-down" dir="rtl" flip-rtl></ion-icon>
|
||||
<ion-icon name="arrow-back" dir="rtl" flip-rtl></ion-icon>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
ion-icon {
|
||||
font-size: 32px;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,284 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import type { E2EPage } from '@utils/test/playwright';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
/**
|
||||
* An SVG whose handler pushes `label` to `window.xssFired` if it ever runs.
|
||||
*/
|
||||
const imageOnErrorSvg = (label: string) =>
|
||||
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><image href="x" onerror="window.xssFired.push('${label}')"/></svg>`;
|
||||
|
||||
const utf8DataUrl = (svg: string) => `data:image/svg+xml;utf8,${svg}`;
|
||||
|
||||
/**
|
||||
* Sets `sanitize` before `src` so the icon loads with the intended setting.
|
||||
*/
|
||||
const addIcon = (page: E2EPage, id: string, src: string, sanitize?: boolean) =>
|
||||
page.evaluate(
|
||||
([id, src, sanitize]) => {
|
||||
const icon = document.createElement('ion-icon') as any;
|
||||
icon.id = id;
|
||||
if (sanitize !== undefined) {
|
||||
icon.sanitize = sanitize;
|
||||
}
|
||||
icon.src = src;
|
||||
document.body.appendChild(icon);
|
||||
},
|
||||
[id, src, sanitize] as const,
|
||||
);
|
||||
|
||||
/**
|
||||
* Waits for the unsanitized control icon's handler to fire. Any `data:` URL
|
||||
* payload added before it has had at least as long to fire.
|
||||
*/
|
||||
const waitForControl = (page: E2EPage) => page.waitForFunction(() => (window as any).xssFired.includes('control'));
|
||||
|
||||
const getFired = (page: E2EPage) => page.evaluate(() => (window as any).xssFired as string[]);
|
||||
|
||||
test.describe('icon: sanitization', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/icon/test/sanitization/`);
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const main = page.locator('main');
|
||||
await expect(main).toHaveScreenshot(`icon-sanitization.png`);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('icon: sanitization: unsafe content', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.setContent(`<script>window.xssFired = [];</script>`);
|
||||
});
|
||||
|
||||
test('should not run handlers from a utf8 svg data url', async ({ page }) => {
|
||||
await addIcon(page, 'attack', utf8DataUrl(imageOnErrorSvg('attack')));
|
||||
await addIcon(page, 'control', utf8DataUrl(imageOnErrorSvg('control')), false);
|
||||
await waitForControl(page);
|
||||
|
||||
expect(await getFired(page)).not.toContain('attack');
|
||||
await expect(page.locator('#attack .icon-inner svg')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('should render a clean utf8 svg data url', async ({ page }) => {
|
||||
const clean = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/></svg>`;
|
||||
await addIcon(page, 'clean', utf8DataUrl(clean));
|
||||
|
||||
await expect(page.locator('#clean .icon-inner svg path')).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('should warn when an svg is rejected', async ({ page }) => {
|
||||
const warnings: string[] = [];
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() === 'warning') {
|
||||
warnings.push(msg.text());
|
||||
}
|
||||
});
|
||||
|
||||
await addIcon(page, 'attack', utf8DataUrl(imageOnErrorSvg('attack')));
|
||||
|
||||
await expect.poll(() => warnings.some((warning) => warning.includes('[Ionicons Warning]'))).toBe(true);
|
||||
});
|
||||
|
||||
test('should not warn about sanitizing when the response is not an svg', async ({ page }) => {
|
||||
const warnings: string[] = [];
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() === 'warning') {
|
||||
warnings.push(msg.text());
|
||||
}
|
||||
});
|
||||
await page.route('**/missing.svg', (route) =>
|
||||
route.fulfill({ status: 404, contentType: 'text/html', body: '<html><body>Not found</body></html>' }),
|
||||
);
|
||||
await page.route('**/rejected.svg', (route) =>
|
||||
route.fulfill({ contentType: 'image/svg+xml', body: imageOnErrorSvg('attack') }),
|
||||
);
|
||||
|
||||
const missingLoaded = page.waitForResponse('**/missing.svg');
|
||||
await addIcon(page, 'missing', '/missing.svg');
|
||||
await missingLoaded;
|
||||
// This takes the same fetch and sanitize steps, so once it warns the 404 has been handled
|
||||
await addIcon(page, 'rejected', '/rejected.svg');
|
||||
await expect.poll(() => warnings.some((warning) => warning.includes('rejected.svg'))).toBe(true);
|
||||
|
||||
expect(warnings.filter((warning) => warning.includes('missing.svg'))).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('should not run handlers from a fetched svg while sanitizing it', async ({ page }) => {
|
||||
await page.route('**/xss/*.svg', (route) => {
|
||||
const label = route.request().url().includes('control') ? 'control' : 'attack';
|
||||
route.fulfill({
|
||||
contentType: 'image/svg+xml',
|
||||
body: `<img src="x" onerror="window.xssFired.push('${label}')">${imageOnErrorSvg(label)}`,
|
||||
});
|
||||
});
|
||||
|
||||
// Fetches resolve independently, so let the attack load before the control starts
|
||||
const attackLoaded = page.waitForResponse('**/xss/attack.svg');
|
||||
await addIcon(page, 'attack', '/xss/attack.svg');
|
||||
await attackLoaded;
|
||||
await addIcon(page, 'control', '/xss/control.svg', false);
|
||||
await waitForControl(page);
|
||||
|
||||
expect(await getFired(page)).not.toContain('attack');
|
||||
await expect(page.locator('#attack .icon-inner svg')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('should reject a fetched svg with more than one root svg', async ({ page }) => {
|
||||
await page.route('**/xss/*.svg', (route) => {
|
||||
const label = route.request().url().includes('control') ? 'control' : 'attack';
|
||||
route.fulfill({
|
||||
contentType: 'image/svg+xml',
|
||||
body: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/></svg>${imageOnErrorSvg(label)}`,
|
||||
});
|
||||
});
|
||||
|
||||
const attackLoaded = page.waitForResponse('**/xss/attack.svg');
|
||||
await addIcon(page, 'attack', '/xss/attack.svg');
|
||||
await attackLoaded;
|
||||
await addIcon(page, 'control', '/xss/control.svg', false);
|
||||
await waitForControl(page);
|
||||
|
||||
expect(await getFired(page)).not.toContain('attack');
|
||||
await expect(page.locator('#attack .icon-inner svg')).toHaveCount(0);
|
||||
});
|
||||
|
||||
const htmlInSvgPayloads = [
|
||||
{
|
||||
name: 'noscript',
|
||||
inner: `<desc><noscript><p title="</noscript><img src=x onerror=top.xssFired.push('attack')>"></p></noscript></desc>`,
|
||||
},
|
||||
{
|
||||
name: 'template',
|
||||
inner: `<desc><template><img src="x" onerror="top.xssFired.push('attack')"></template></desc>`,
|
||||
},
|
||||
];
|
||||
|
||||
htmlInSvgPayloads.forEach(({ name, inner }) => {
|
||||
test(`should reject an svg containing an html ${name} element`, async ({ page }) => {
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${inner}<path d="M0 0h24v24H0z"/></svg>`;
|
||||
await addIcon(page, 'attack', utf8DataUrl(svg));
|
||||
await addIcon(page, 'control', utf8DataUrl(imageOnErrorSvg('control')), false);
|
||||
await waitForControl(page);
|
||||
|
||||
expect(await getFired(page)).not.toContain('attack');
|
||||
await expect(page.locator('#attack .icon-inner svg')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
|
||||
const foreignObjectPayloads = [
|
||||
{
|
||||
name: 'iframe srcdoc',
|
||||
inner: `<iframe xmlns="http://www.w3.org/1999/xhtml" srcdoc="<script>top.xssFired.push('attack')</script>"></iframe>`,
|
||||
},
|
||||
{
|
||||
name: 'iframe javascript: src',
|
||||
inner: `<iframe xmlns="http://www.w3.org/1999/xhtml" src="javascript:top.xssFired.push('attack')"></iframe>`,
|
||||
},
|
||||
];
|
||||
|
||||
foreignObjectPayloads.forEach(({ name, inner }) => {
|
||||
test(`should remove a foreignObject containing an ${name}`, async ({ page }) => {
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><foreignObject width="24" height="24">${inner}</foreignObject><path d="M0 0h24v24H0z"/></svg>`;
|
||||
await addIcon(page, 'attack', utf8DataUrl(svg));
|
||||
await addIcon(page, 'control', utf8DataUrl(imageOnErrorSvg('control')), false);
|
||||
await waitForControl(page);
|
||||
|
||||
expect(await getFired(page)).not.toContain('attack');
|
||||
await expect(page.locator('#attack .icon-inner svg path')).toHaveCount(1);
|
||||
await expect(page.locator('#attack .icon-inner svg > :not(path)')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
|
||||
test('should render an illustrator export that uses a switch with a foreignObject', async ({ page }) => {
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><switch><foreignObject requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" x="0" y="0" width="1" height="1"><i:pgfRef xlink:href="#adobe_illustrator_pgf"></i:pgfRef></foreignObject><g i:extraneous="self"><path d="M0 0h24v24H0z"/></g></switch></svg>`;
|
||||
await addIcon(page, 'illustrator', utf8DataUrl(svg));
|
||||
|
||||
await expect(page.locator('#illustrator .icon-inner svg path')).toHaveCount(1);
|
||||
});
|
||||
|
||||
const javascriptUrlPayloads = [
|
||||
{ name: 'an anchor href', inner: `<a href="javascript:top.xssFired.push('attack')"><path d="M0 0h24v24H0z"/></a>` },
|
||||
{
|
||||
name: 'an obfuscated xlink:href',
|
||||
inner: `<a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href=" JaVa	ScRiPt:top.xssFired.push('attack')"><path d="M0 0h24v24H0z"/></a>`,
|
||||
},
|
||||
{
|
||||
name: 'an animate element',
|
||||
inner: `<a><animate attributeName="href" values="https://ionic.io;javascript:top.xssFired.push('attack')"/><path d="M0 0h24v24H0z"/></a>`,
|
||||
},
|
||||
{
|
||||
name: 'a set element',
|
||||
inner: `<a><set attributeName="href" to="javascript:top.xssFired.push('attack')"/><path d="M0 0h24v24H0z"/></a>`,
|
||||
},
|
||||
];
|
||||
|
||||
javascriptUrlPayloads.forEach(({ name, inner }) => {
|
||||
test(`should reject an svg with a javascript: url in ${name}`, async ({ page }) => {
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${inner}</svg>`;
|
||||
await addIcon(page, 'attack', utf8DataUrl(svg));
|
||||
await addIcon(page, 'control', utf8DataUrl(imageOnErrorSvg('control')), false);
|
||||
await waitForControl(page);
|
||||
|
||||
await expect(page.locator('#attack .icon-inner svg')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
|
||||
test('should not reuse unsanitized content cached for the same data url', async ({ page }) => {
|
||||
const shared = utf8DataUrl(imageOnErrorSvg('shared'));
|
||||
|
||||
await addIcon(page, 'unsanitized', shared, false);
|
||||
await page.waitForFunction(() => (window as any).xssFired.includes('shared'));
|
||||
|
||||
await addIcon(page, 'sanitized', shared);
|
||||
await addIcon(page, 'control', utf8DataUrl(imageOnErrorSvg('control')), false);
|
||||
await waitForControl(page);
|
||||
|
||||
await expect(page.locator('#sanitized .icon-inner svg')).toHaveCount(0);
|
||||
expect((await getFired(page)).filter((label) => label === 'shared')).toHaveLength(1);
|
||||
});
|
||||
|
||||
test('should not reuse sanitized content cached for the same data url', async ({ page }) => {
|
||||
const shared = utf8DataUrl(imageOnErrorSvg('shared'));
|
||||
|
||||
await addIcon(page, 'sanitized', shared);
|
||||
await addIcon(page, 'unsanitized', shared, false);
|
||||
|
||||
await expect(page.locator('#unsanitized .icon-inner svg')).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('should not let a src forge the unsanitized cache key', async ({ page }) => {
|
||||
const shared = utf8DataUrl(imageOnErrorSvg('shared'));
|
||||
|
||||
await addIcon(page, 'unsanitized', shared, false);
|
||||
await page.waitForFunction(() => (window as any).xssFired.includes('shared'));
|
||||
|
||||
await addIcon(page, 'sanitized', `unsanitized:${shared}`);
|
||||
await addIcon(page, 'control', utf8DataUrl(imageOnErrorSvg('control')), false);
|
||||
await waitForControl(page);
|
||||
|
||||
await expect(page.locator('#sanitized .icon-inner svg')).toHaveCount(0);
|
||||
expect((await getFired(page)).filter((label) => label === 'shared')).toHaveLength(1);
|
||||
});
|
||||
|
||||
test('should not reuse an unsanitized in-flight fetch for the same url', async ({ page }) => {
|
||||
await page.route('**/xss/*.svg', (route) => {
|
||||
const label = route.request().url().includes('control') ? 'control' : 'shared';
|
||||
// Sanitizing drops the <img> sibling and keeps the clean <svg>
|
||||
route.fulfill({
|
||||
contentType: 'image/svg+xml',
|
||||
body: `<img src="x" onerror="window.xssFired.push('${label}')"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/></svg>`,
|
||||
});
|
||||
});
|
||||
|
||||
await addIcon(page, 'unsanitized', '/xss/shared.svg', false);
|
||||
await addIcon(page, 'sanitized', '/xss/shared.svg');
|
||||
await addIcon(page, 'control', '/xss/control.svg', false);
|
||||
await waitForControl(page);
|
||||
await page.waitForFunction(() => (window as any).xssFired.includes('shared'));
|
||||
|
||||
await expect(page.locator('#sanitized .icon-inner svg path')).toHaveCount(1);
|
||||
await expect(page.locator('#sanitized .icon-inner img')).toHaveCount(0);
|
||||
expect((await getFired(page)).filter((label) => label === 'shared')).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,37 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - Sanitization</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Sanitization</h1>
|
||||
|
||||
<h2>Sanitized (shouldn't show)</h2>
|
||||
<ion-icon src="/icon/assets/sanitize.svg"></ion-icon>
|
||||
|
||||
<h2>Not Sanitized (should show)</h2>
|
||||
<ion-icon sanitize="false" src="/icon/assets/no-sanitize.svg"></ion-icon>
|
||||
|
||||
<h2>Base64 URL</h2>
|
||||
<ion-icon
|
||||
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDBWMHoiLz48cGF0aCBkPSJNMjAgMkg0Yy0xLjEgMC0yIC45LTIgMnYxOGw0LTRoMTRjMS4xIDAgMi0uOSAyLTJWNGMwLTEuMS0uOS0yLTItMnptMCAxNEg2bC0yIDJWNGgxNnYxMnoiLz48L3N2Zz4="
|
||||
></ion-icon>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
ion-icon {
|
||||
font-size: 32px;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('icon: size', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(`/icon/test/size/`);
|
||||
});
|
||||
|
||||
test('should scale the icon based on the size property', async ({ page }) => {
|
||||
// Wait for all SVGs to be lazily loaded before taking screenshots
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const main = page.locator('main');
|
||||
await expect(main).toHaveScreenshot(`icon-size.png`);
|
||||
});
|
||||
|
||||
test('size prop should apply correct font-size to SVG icons', async ({ page }) => {
|
||||
// Wait for all SVGs to be lazily loaded
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const icons = page.locator('ion-icon[name="heart"]');
|
||||
|
||||
// Default size is 16px, small is 18px, large is 32px
|
||||
expect(await icons.nth(0).evaluate((el) => window.getComputedStyle(el).fontSize)).toBe('16px');
|
||||
expect(await icons.nth(1).evaluate((el) => window.getComputedStyle(el).fontSize)).toBe('18px');
|
||||
expect(await icons.nth(2).evaluate((el) => window.getComputedStyle(el).fontSize)).toBe('32px');
|
||||
});
|
||||
|
||||
test('size prop should apply correct font-size to font icons', async ({ page }) => {
|
||||
// Wait for document fonts to be ready
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
|
||||
const icons = page.locator('ion-icon:not([name])');
|
||||
|
||||
// Default size is 16px, small is 18px, large is 32px
|
||||
expect(await icons.nth(0).evaluate((el) => window.getComputedStyle(el).fontSize)).toBe('16px');
|
||||
expect(await icons.nth(1).evaluate((el) => window.getComputedStyle(el).fontSize)).toBe('18px');
|
||||
expect(await icons.nth(2).evaluate((el) => window.getComputedStyle(el).fontSize)).toBe('32px');
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,39 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - Size</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Size</h1>
|
||||
|
||||
<h2>Default Icons</h2>
|
||||
<ion-icon name="heart"></ion-icon>
|
||||
<ion-icon name="heart" size="small"></ion-icon>
|
||||
<ion-icon name="heart" size="large"></ion-icon>
|
||||
|
||||
<h2>Font Icons</h2>
|
||||
<ion-icon>
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon size="small">
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon size="large">
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('icon: slotted', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/icon/test/slotted/`);
|
||||
|
||||
// Wait for all SVGs to be lazily loaded before taking screenshots
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await expect(page).toHaveScreenshot(`icon-slotted.png`, { fullPage: true });
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 68 KiB |
@@ -0,0 +1,310 @@
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Icon - Slotted Content</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
<link rel="stylesheet" href="../styles.css" />
|
||||
<script src="../header.js"></script>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" />
|
||||
<!-- Material Icons -->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
|
||||
<!-- Phosphor Icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/fill/style.css"
|
||||
/>
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<test-header></test-header>
|
||||
|
||||
<main>
|
||||
<h1>Icon - Slotted Content</h1>
|
||||
|
||||
<div class="grid">
|
||||
<div class="grid-item">
|
||||
<h2>Material Icons</h2>
|
||||
<ion-icon>
|
||||
<span class="material-icons">home</span>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<span class="material-icons">favorite</span>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<span class="material-icons">star</span>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<span class="material-icons">person</span>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<span class="material-icons">settings</span>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon color="primary">
|
||||
<span class="material-icons">home</span>
|
||||
</ion-icon>
|
||||
<ion-icon color="secondary">
|
||||
<span class="material-icons">favorite</span>
|
||||
</ion-icon>
|
||||
<ion-icon color="success">
|
||||
<span class="material-icons">star</span>
|
||||
</ion-icon>
|
||||
<ion-icon color="warning">
|
||||
<span class="material-icons">warning</span>
|
||||
</ion-icon>
|
||||
<ion-icon color="danger">
|
||||
<span class="material-icons">delete</span>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon style="font-size: 24px">
|
||||
<span class="material-icons">home</span>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 36px">
|
||||
<span class="material-icons">favorite</span>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 48px">
|
||||
<span class="material-icons">star</span>
|
||||
</ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="grid-item">
|
||||
<h2>Phosphor Icons</h2>
|
||||
<ion-icon>
|
||||
<i class="ph-fill ph-house"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="ph-fill ph-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="ph-fill ph-star"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="ph-fill ph-user"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="ph-fill ph-gear"></i>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon color="primary">
|
||||
<i class="ph-fill ph-house"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="secondary">
|
||||
<i class="ph-fill ph-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="success">
|
||||
<i class="ph-fill ph-star"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="warning">
|
||||
<i class="ph-fill ph-warning"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="danger">
|
||||
<i class="ph-fill ph-trash"></i>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon style="font-size: 24px">
|
||||
<i class="ph-fill ph-house"></i>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 36px">
|
||||
<i class="ph-fill ph-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 48px">
|
||||
<i class="ph-fill ph-star"></i>
|
||||
</ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="grid-item">
|
||||
<h2>Font Awesome Icons</h2>
|
||||
<ion-icon>
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="fa fa-user"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="fa fa-cog"></i>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon color="primary">
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="secondary">
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="success">
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="warning">
|
||||
<i class="fa fa-exclamation-triangle"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="danger">
|
||||
<i class="fa fa-trash"></i>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon style="font-size: 24px">
|
||||
<i class="fa fa-home"></i>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 36px">
|
||||
<i class="fa fa-heart"></i>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 48px">
|
||||
<i class="fa fa-star"></i>
|
||||
</ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="grid-item">
|
||||
<h2>Bootstrap Icons</h2>
|
||||
<ion-icon>
|
||||
<i class="bi bi-house-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="bi bi-heart-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="bi bi-star-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="bi bi-person-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<i class="bi bi-gear-fill"></i>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon color="primary">
|
||||
<i class="bi bi-house-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="secondary">
|
||||
<i class="bi bi-heart-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="success">
|
||||
<i class="bi bi-star-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="warning">
|
||||
<i class="bi bi-exclamation-triangle-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon color="danger">
|
||||
<i class="bi bi-trash-fill"></i>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon style="font-size: 24px">
|
||||
<i class="bi bi-house-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 36px">
|
||||
<i class="bi bi-heart-fill"></i>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 48px">
|
||||
<i class="bi bi-star-fill"></i>
|
||||
</ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="grid-item">
|
||||
<h2>Custom Slotted SVG</h2>
|
||||
<ion-icon>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
<ion-icon>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon color="primary">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
<ion-icon color="success">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
<ion-icon color="danger">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
|
||||
<br />
|
||||
|
||||
<ion-icon style="font-size: 24px">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 36px">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
<ion-icon style="font-size: 48px">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
||||
/>
|
||||
</svg>
|
||||
</ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
ion-icon {
|
||||
font-size: 32px;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||