mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 09:12:03 +00:00
Compare commits
882
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d116c3a27 | ||
|
|
1c5e06438c | ||
|
|
0790797340 | ||
|
|
e8b5b44f28 | ||
|
|
0ff40cecbf | ||
|
|
dcb4d2ca4b | ||
|
|
70d88ef3b0 | ||
|
|
40da0e4113 | ||
|
|
61ffd8a08f | ||
|
|
a201abc29b | ||
|
|
e505506655 | ||
|
|
d02e9db739 | ||
|
|
996f49cd82 | ||
|
|
e582380724 | ||
|
|
2d8b66fa4c | ||
|
|
3c544d2771 | ||
|
|
b575816e73 | ||
|
|
71d30afab1 | ||
|
|
d488b83738 | ||
|
|
c6952576ff | ||
|
|
1c5db8dacf | ||
|
|
ac1e69b342 | ||
|
|
a10285a50d | ||
|
|
2843a6cc56 | ||
|
|
ac3187de75 | ||
|
|
647b749535 | ||
|
|
2c7e86503f | ||
|
|
4abe46455a | ||
|
|
8893b5c82d | ||
|
|
19b16fff75 | ||
|
|
2f1974d7bf | ||
|
|
b07972d7dd | ||
|
|
f962bc7816 | ||
|
|
0cba7a93b8 | ||
|
|
a7ce61f840 | ||
|
|
35e8da7811 | ||
|
|
8953185f80 | ||
|
|
43b0301d7c | ||
|
|
d77b766a56 | ||
|
|
98c06b0be2 | ||
|
|
61b84e14fb | ||
|
|
edbbc53cdb | ||
|
|
5c78776941 | ||
|
|
70eeb24b38 | ||
|
|
2b98dd9c15 | ||
|
|
84946d4d4d | ||
|
|
ce7af9dd13 | ||
|
|
b769d21d7c | ||
|
|
241b2e678f | ||
|
|
c3e7bc0ada | ||
|
|
90ae03a7fc | ||
|
|
51b62cca7b | ||
|
|
b2213e934f | ||
|
|
7702c65275 | ||
|
|
176e78bc56 | ||
|
|
4f510eaade | ||
|
|
2e712e77fa | ||
|
|
30fca8acdd | ||
|
|
8119d93ca9 | ||
|
|
d81e67c374 | ||
|
|
43463444b8 | ||
|
|
c0929a534d | ||
|
|
859eac8ccb | ||
|
|
34a1e090e2 | ||
|
|
37e195d8b1 | ||
|
|
df5c36012b | ||
|
|
abdc99850c | ||
|
|
fa90f48e83 | ||
|
|
90ad65d6d7 | ||
|
|
1a34754be1 | ||
|
|
15f056cc27 | ||
|
|
f15312a9d7 | ||
|
|
c23cb8445a | ||
|
|
3c97e0f1ea | ||
|
|
abdeb6f0fe | ||
|
|
9e940aa91a | ||
|
|
b92fe88d3f | ||
|
|
4d9ddc3a73 | ||
|
|
c565f3ca91 | ||
|
|
5f1fb0a4a1 | ||
|
|
b6d98c557c | ||
|
|
6ac97aeb34 | ||
|
|
94e69ea7a8 | ||
|
|
c0dc296073 | ||
|
|
28954f8ce6 | ||
|
|
6976156c1a | ||
|
|
0303d5f1d4 | ||
|
|
bd320ca815 | ||
|
|
11c0cf3771 | ||
|
|
e395c113af | ||
|
|
da0a5f409b | ||
|
|
81ff1098ab | ||
|
|
79773ff44b | ||
|
|
1e7633e692 | ||
|
|
ba22ba7b70 | ||
|
|
ccedba0132 | ||
|
|
2dbc5125d6 | ||
|
|
bdf83d447f | ||
|
|
da9445389e | ||
|
|
c0601bb510 | ||
|
|
e20df992ec | ||
|
|
d42200b61f | ||
|
|
4e5f422693 | ||
|
|
2c77e103f9 | ||
|
|
45e9e5f564 | ||
|
|
6b1f9f1560 | ||
|
|
eb50604788 | ||
|
|
5ca140d4f7 | ||
|
|
7943489380 | ||
|
|
82cdd68d00 | ||
|
|
76af311b63 | ||
|
|
b624bff400 | ||
|
|
d5ab822973 | ||
|
|
c8b230fc1c | ||
|
|
d35f7326d7 | ||
|
|
eb07f63d12 | ||
|
|
df42875d41 | ||
|
|
404274003c | ||
|
|
fc9c5170b9 | ||
|
|
dc2f1958ff | ||
|
|
fc9196ad6f | ||
|
|
9cfc03fe6b | ||
|
|
9b8ed2d985 | ||
|
|
728dd2ead3 | ||
|
|
71fbe7d7f2 | ||
|
|
2a4447b6e7 | ||
|
|
aaad005455 | ||
|
|
3bb4a2e36f | ||
|
|
f346a4694c | ||
|
|
51c0883255 | ||
|
|
45e67d5b50 | ||
|
|
6739d29074 | ||
|
|
189858a9d7 | ||
|
|
f1731730fa | ||
|
|
1b37aad4dc | ||
|
|
323018a935 | ||
|
|
7b6e5f2e60 | ||
|
|
5557fc2ef0 | ||
|
|
6c07afe963 | ||
|
|
ac217adaa6 | ||
|
|
5c50658036 | ||
|
|
8ab100dfb3 | ||
|
|
3ac20c695c | ||
|
|
218707905e | ||
|
|
72f1ab0c85 | ||
|
|
2c57117098 | ||
|
|
f6ba5e1219 | ||
|
|
1c53160a2a | ||
|
|
22527c073f | ||
|
|
5b41ecac4c | ||
|
|
14e07e4ca6 | ||
|
|
cd1c93f9d4 | ||
|
|
545864553f | ||
|
|
3b2f10fb91 | ||
|
|
bec7d5945f | ||
|
|
f32bd408a2 | ||
|
|
7ba8c466f4 | ||
|
|
bede18133c | ||
|
|
81e65cc0ab | ||
|
|
5acdbe33c1 | ||
|
|
727999ba72 | ||
|
|
7ad82450b4 | ||
|
|
a72e965785 | ||
|
|
e3fd48728b | ||
|
|
89c3603765 | ||
|
|
03f7034fca | ||
|
|
527ba00287 | ||
|
|
b3831f0b1c | ||
|
|
0549ad19b6 | ||
|
|
7d1095fd96 | ||
|
|
acb1d0b955 | ||
|
|
4fc51e00b5 | ||
|
|
796bb5225f | ||
|
|
9ff2830297 | ||
|
|
d40939458a | ||
|
|
310974b3c3 | ||
|
|
73b30a8ea7 | ||
|
|
790e70a90d | ||
|
|
4114cecd93 | ||
|
|
797f48a9fb | ||
|
|
13d3007293 | ||
|
|
bcfd6747d9 | ||
|
|
122bbf0090 | ||
|
|
c0cb5a02b3 | ||
|
|
b60d047b95 | ||
|
|
98dbc155fe | ||
|
|
87f194c1dc | ||
|
|
7f73315264 | ||
|
|
66badd5df5 | ||
|
|
7360426aef | ||
|
|
b71d407396 | ||
|
|
ca7c4964a2 | ||
|
|
5e078db3fd | ||
|
|
eb32b0a80b | ||
|
|
b56f83bf50 | ||
|
|
1399f6f084 | ||
|
|
1cf90c1753 | ||
|
|
c027c2e464 | ||
|
|
92dd582d68 | ||
|
|
b55bfac1c3 | ||
|
|
bb302bbbd6 | ||
|
|
55005c80f3 | ||
|
|
27e6423b54 | ||
|
|
de2dcdcc15 | ||
|
|
12e95d063a | ||
|
|
643ae3bc15 | ||
|
|
21a842d419 | ||
|
|
73f5f9fbfd | ||
|
|
527fe4f0c1 | ||
|
|
1a9214e328 | ||
|
|
8c0b2363e0 | ||
|
|
e7a62a9082 | ||
|
|
494566e604 | ||
|
|
1c492fda56 | ||
|
|
9691ac4713 | ||
|
|
7174bbe7bf | ||
|
|
62f36da5e7 | ||
|
|
9ec5133ba2 | ||
|
|
0a7906187f | ||
|
|
28f2a3f532 | ||
|
|
f5d404b925 | ||
|
|
05955acaf7 | ||
|
|
55362f3ea7 | ||
|
|
28f8f7a408 | ||
|
|
6778e902f3 | ||
|
|
92566d5750 | ||
|
|
6911913748 | ||
|
|
7f3e96ae01 | ||
|
|
19791c0339 | ||
|
|
6d38b7bbdd | ||
|
|
936e794e2f | ||
|
|
6a00fca823 | ||
|
|
500eecc43d | ||
|
|
2ac73a7812 | ||
|
|
451dacb14a | ||
|
|
e6228c103d | ||
|
|
572d913718 | ||
|
|
c0cd0dd66f | ||
|
|
613e20eb12 | ||
|
|
4bf0506362 | ||
|
|
5997db2b38 | ||
|
|
f5d3ed8eee | ||
|
|
5c00b91dfb | ||
|
|
9f18063fe5 | ||
|
|
b037114863 | ||
|
|
e47521d6e5 | ||
|
|
61357fb40a | ||
|
|
5678d4cf10 | ||
|
|
d403c09b1a | ||
|
|
5b82182fda | ||
|
|
6246c1d311 | ||
|
|
04ad4d09b2 | ||
|
|
65ddd4bd18 | ||
|
|
deff5b25b2 | ||
|
|
31e60deea8 | ||
|
|
847142dc72 | ||
|
|
a5b3ad81a7 | ||
|
|
fe1ac779bf | ||
|
|
8bb5b8f7b9 | ||
|
|
064b2fc612 | ||
|
|
dcf5cfc06b | ||
|
|
ff97e7f3f8 | ||
|
|
9e1165de0a | ||
|
|
812573ac43 | ||
|
|
5f340eba49 | ||
|
|
703e7e3ab5 | ||
|
|
b42101f6f1 | ||
|
|
8b0c4d8f59 | ||
|
|
6ab84e581f | ||
|
|
42f3a298a2 | ||
|
|
e49922d3fe | ||
|
|
fc06e8f7b4 | ||
|
|
0273b42fb4 | ||
|
|
0873fe6520 | ||
|
|
fdcf502a64 | ||
|
|
aebb22bf1b | ||
|
|
4529e64c6e | ||
|
|
01395e65ba | ||
|
|
21dd0450e7 | ||
|
|
ffac16cb05 | ||
|
|
98177d0cd3 | ||
|
|
2c5be718e6 | ||
|
|
019d92dd7b | ||
|
|
5b72afbb93 | ||
|
|
56348cdddf | ||
|
|
973d79ee99 | ||
|
|
5bfb912531 | ||
|
|
27e3dfee07 | ||
|
|
20b2bf6f89 | ||
|
|
4b870986c8 | ||
|
|
8fcf079359 | ||
|
|
54f8b07956 | ||
|
|
9bc251e694 | ||
|
|
e2a9d027dc | ||
|
|
22dfd8e603 | ||
|
|
53d1947311 | ||
|
|
d4e7c47772 | ||
|
|
e191dffdf8 | ||
|
|
7e0ee60d47 | ||
|
|
4ecaeb9d04 | ||
|
|
8e5c554431 | ||
|
|
727be0a98b | ||
|
|
4c2e44ced1 | ||
|
|
2fd1dd443f | ||
|
|
a6c3391237 | ||
|
|
5ede88a188 | ||
|
|
2785593d20 | ||
|
|
a37c743547 | ||
|
|
6f0e18c3cf | ||
|
|
bdfaa54e81 | ||
|
|
595796af6c | ||
|
|
f51d43c06a | ||
|
|
8c81ae46e0 | ||
|
|
c85b34e86f | ||
|
|
fc46b5a97b | ||
|
|
c7fcf57fdf | ||
|
|
560d8bd1e8 | ||
|
|
7a53de186e | ||
|
|
4feb798b25 | ||
|
|
c713b469f0 | ||
|
|
676392a5c4 | ||
|
|
c049e08555 | ||
|
|
d8c898db8c | ||
|
|
8a1ef5e7e2 | ||
|
|
d64da78d8b | ||
|
|
293594235a | ||
|
|
a54d97591e | ||
|
|
dc2e7fb766 | ||
|
|
53df42df22 | ||
|
|
21da657eb0 | ||
|
|
52d2d5f41d | ||
|
|
ff2515fabb | ||
|
|
5b9840524c | ||
|
|
0d6ddfd95e | ||
|
|
0394e819ba | ||
|
|
5d57586dc1 | ||
|
|
e8d012b82d | ||
|
|
4e90102efd | ||
|
|
02c55aaa0f | ||
|
|
8d4ee29d78 | ||
|
|
23066e9503 | ||
|
|
67fc9ad560 | ||
|
|
8fe5c88eba | ||
|
|
1fbcf78745 | ||
|
|
83dc3236e8 | ||
|
|
7503c7fa7f | ||
|
|
e668181690 | ||
|
|
353dff3da5 | ||
|
|
a11993a155 | ||
|
|
7b53b7670f | ||
|
|
0aaa0c4e10 | ||
|
|
ea5e1f768c | ||
|
|
e6b16e9b31 | ||
|
|
1029d42163 | ||
|
|
fba5140d8b | ||
|
|
fe72f32dbb | ||
|
|
6a0890b42b | ||
|
|
320f45a775 | ||
|
|
3feb2283a4 | ||
|
|
c3b416a3cb | ||
|
|
36fba1a33b | ||
|
|
a9e080f892 | ||
|
|
0dc8eb7a1e | ||
|
|
70fd78c926 | ||
|
|
dbc5e7dc07 | ||
|
|
4b0b8e4ae4 | ||
|
|
57e7e1ecc4 | ||
|
|
9534fe2540 | ||
|
|
44683d38f1 | ||
|
|
23c976e5d2 | ||
|
|
9ea823d630 | ||
|
|
65c65a6637 | ||
|
|
ef2a2a9c49 | ||
|
|
3f63fd7fb6 | ||
|
|
6fe9788444 | ||
|
|
10c6545885 | ||
|
|
2e76272a35 | ||
|
|
803a7a4d0f | ||
|
|
d8b7e69788 | ||
|
|
097ef18910 | ||
|
|
bb081354fc | ||
|
|
edc08c6f8a | ||
|
|
fc3577baf4 | ||
|
|
f02250ab75 | ||
|
|
1af80dcc1b | ||
|
|
373f40d968 | ||
|
|
75609e1b09 | ||
|
|
ea9bb63d0a | ||
|
|
a148b08eb5 | ||
|
|
1ca7e746e1 | ||
|
|
535ed17d36 | ||
|
|
8df1bc26a0 | ||
|
|
1b15ab146a | ||
|
|
0868b7d716 | ||
|
|
618d8d3de1 | ||
|
|
e9831b4e2a | ||
|
|
b0aa3ce0e7 | ||
|
|
4fa62f5d64 | ||
|
|
350e929bd2 | ||
|
|
64d178ea36 | ||
|
|
cb3decf3bd | ||
|
|
d66d009fe8 | ||
|
|
5974a77140 | ||
|
|
68b4444bb1 | ||
|
|
fc7d16b64b | ||
|
|
08a893c29a | ||
|
|
8d181e7a92 | ||
|
|
ab1c0849f4 | ||
|
|
96098e532f | ||
|
|
0b14ef50e9 | ||
|
|
262f8bf5d2 | ||
|
|
f18a2dde8f | ||
|
|
2e48c97b50 | ||
|
|
8bf2b8f322 | ||
|
|
ceb7b231b5 | ||
|
|
f7f304b33d | ||
|
|
151484afd3 | ||
|
|
7ae6969b35 | ||
|
|
65cfd8b459 | ||
|
|
3c9405b718 | ||
|
|
48b347e814 | ||
|
|
59de2d7992 | ||
|
|
0166c17985 | ||
|
|
57b1de13a9 | ||
|
|
52104b0f23 | ||
|
|
564a6b4b90 | ||
|
|
d43a4bfbdb | ||
|
|
1e647bffc6 | ||
|
|
986c43ead3 | ||
|
|
ea4fffdeba | ||
|
|
c14e9c346b | ||
|
|
d3dd96d2d4 | ||
|
|
b5fd3dd734 | ||
|
|
6979811e67 | ||
|
|
82ab82889d | ||
|
|
0b978693d6 | ||
|
|
feabc168d7 | ||
|
|
759c12eeef | ||
|
|
e3bc4f99a0 | ||
|
|
8c31007854 | ||
|
|
cf80626256 | ||
|
|
cbcfecbe72 | ||
|
|
a1ae58d041 | ||
|
|
a6cf7c1f25 | ||
|
|
a31a969863 | ||
|
|
19504b0d32 | ||
|
|
920a037b47 | ||
|
|
568f55e4be | ||
|
|
53cbedf041 | ||
|
|
cb356c23dc | ||
|
|
8f76acc776 | ||
|
|
d0269a84c0 | ||
|
|
e36206197d | ||
|
|
5e6bb7e016 | ||
|
|
15ed6b0f2f | ||
|
|
16142657ec | ||
|
|
a5b50f4cef | ||
|
|
796b7ac49f | ||
|
|
9bafc3e218 | ||
|
|
72c04454e5 | ||
|
|
dc4ad88427 | ||
|
|
00ecf7c67c | ||
|
|
83f8127570 | ||
|
|
b6017ea5cf | ||
|
|
b96036d14a | ||
|
|
d0fafb41b3 | ||
|
|
ddf8f65499 | ||
|
|
31aa6243ef | ||
|
|
afca0f481a | ||
|
|
2ffc2c22dc | ||
|
|
d8100c1589 | ||
|
|
a4cce95171 | ||
|
|
01ab8e5741 | ||
|
|
dd1a961dd2 | ||
|
|
11520ce468 | ||
|
|
20c8f9204b | ||
|
|
0074bfd5fb | ||
|
|
a0504f4e57 | ||
|
|
7bcac33423 | ||
|
|
a6feaea201 | ||
|
|
9c6cf8c811 | ||
|
|
592e0ccae9 | ||
|
|
f2f44ad2d7 | ||
|
|
322077fff8 | ||
|
|
5eaf729cc4 | ||
|
|
f285477a6c | ||
|
|
16f693cee9 | ||
|
|
2a7198e02b | ||
|
|
98b4f4e76a | ||
|
|
cf397f2522 | ||
|
|
7f1305c639 | ||
|
|
5964775a8e | ||
|
|
f1ea4ee1e0 | ||
|
|
cc24357a9e | ||
|
|
53406e54a9 | ||
|
|
39faa2b945 | ||
|
|
02e5978664 | ||
|
|
fa20f601df | ||
|
|
132ee94235 | ||
|
|
fa5aa175ab | ||
|
|
cf8833c885 | ||
|
|
a37f42b28a | ||
|
|
b8e797bc92 | ||
|
|
c248cb2a57 | ||
|
|
2a748c7903 | ||
|
|
2f2cbc16ca | ||
|
|
c0b8928ece | ||
|
|
50fe0e785b | ||
|
|
b2d31aed46 | ||
|
|
9fdf2cd4df | ||
|
|
02aa151153 | ||
|
|
a472fc4793 | ||
|
|
fdab54742f | ||
|
|
53230c1d67 | ||
|
|
d6dfdff964 | ||
|
|
2feb10005c | ||
|
|
1994f3ec97 | ||
|
|
e4b6237e1b | ||
|
|
a326f5ab57 | ||
|
|
a1d18dbb6c | ||
|
|
409ce29179 | ||
|
|
08c8a07e94 | ||
|
|
701ca3f285 | ||
|
|
e874406491 | ||
|
|
b1516dad35 | ||
|
|
9bd629ca87 | ||
|
|
960246f2f3 | ||
|
|
e07467b66c | ||
|
|
23259595b3 | ||
|
|
5151313833 | ||
|
|
45977bf71d | ||
|
|
e8007328db | ||
|
|
92f0fee402 | ||
|
|
d347deb05f | ||
|
|
f138652789 | ||
|
|
ec81f52cfc | ||
|
|
f9aecb4242 | ||
|
|
d9352982d4 | ||
|
|
328f33c913 | ||
|
|
67fd406396 | ||
|
|
41320584a3 | ||
|
|
ac838681f1 | ||
|
|
3f17539e17 | ||
|
|
633856677f | ||
|
|
5aa3026561 | ||
|
|
90eb056b1c | ||
|
|
581c26953e | ||
|
|
0b0d87a5db | ||
|
|
7ef1be47b7 | ||
|
|
dde30617e3 | ||
|
|
609678667f | ||
|
|
180ecd89bf | ||
|
|
635b0859b8 | ||
|
|
10cbe105bc | ||
|
|
f97eed8396 | ||
|
|
119d9df7b5 | ||
|
|
846d18cd23 | ||
|
|
833c35cbbc | ||
|
|
08353f50b5 | ||
|
|
fba81fb4eb | ||
|
|
9d9c6e9bfa | ||
|
|
4dad81714f | ||
|
|
8e9135149b | ||
|
|
852b53d6b9 | ||
|
|
ede1f5858a | ||
|
|
ad9e7165bb | ||
|
|
77302a30b8 | ||
|
|
0ef12ef601 | ||
|
|
4174f9a7b4 | ||
|
|
608f158d70 | ||
|
|
34d41ecc78 | ||
|
|
7e62365a60 | ||
|
|
8565f410a1 | ||
|
|
46d70820df | ||
|
|
67e66ffe02 | ||
|
|
e19bf67b33 | ||
|
|
97c5f60e91 | ||
|
|
ea5293c28d | ||
|
|
6a58efa9a9 | ||
|
|
c95f33679e | ||
|
|
b52a5e02a0 | ||
|
|
ab3ef0d34b | ||
|
|
69798f6ee2 | ||
|
|
ee14586beb | ||
|
|
82470ba669 | ||
|
|
6286f0e8e6 | ||
|
|
3c08651df2 | ||
|
|
e6d55fdcd6 | ||
|
|
8c445f020c | ||
|
|
78a76bac5d | ||
|
|
75b334af61 | ||
|
|
5d98c50b80 | ||
|
|
27803fd37c | ||
|
|
1bdb7e3777 | ||
|
|
20bcc28cb0 | ||
|
|
f43ec5c48c | ||
|
|
40f0b3340d | ||
|
|
1f023a84be | ||
|
|
f170a2201c | ||
|
|
7df8ee5dd3 | ||
|
|
713ccfb2eb | ||
|
|
99c35f4aed | ||
|
|
981f41c047 | ||
|
|
330e7867e1 | ||
|
|
82ed5ff3f0 | ||
|
|
17cf7f4ac2 | ||
|
|
decd2bac2a | ||
|
|
0a13a225c1 | ||
|
|
69a7dc76d9 | ||
|
|
433687a967 | ||
|
|
febf6543b9 | ||
|
|
aa506975b4 | ||
|
|
cb3201a788 | ||
|
|
0f70394cf4 | ||
|
|
b26cb5ef51 | ||
|
|
d66e6c7c94 | ||
|
|
48ed9934e6 | ||
|
|
dec60f90b4 | ||
|
|
9aa756b76e | ||
|
|
50573701ef | ||
|
|
79509fc900 | ||
|
|
976083c4c1 | ||
|
|
b95fc33649 | ||
|
|
57ca52a5de | ||
|
|
03fe9dec02 | ||
|
|
5af875d981 | ||
|
|
e452a003c1 | ||
|
|
651757a5f1 | ||
|
|
7d064772ad | ||
|
|
dd92454d05 | ||
|
|
c43611c06c | ||
|
|
1e580ae25e | ||
|
|
dcef32d47f | ||
|
|
7e311cef06 | ||
|
|
051b11d035 | ||
|
|
b6900e2da4 | ||
|
|
841ed3529e | ||
|
|
71bde5a24c | ||
|
|
e48f29153b | ||
|
|
7960fbb256 | ||
|
|
02268671f3 | ||
|
|
6486beb4a3 | ||
|
|
017e8f6217 | ||
|
|
c57ae5fd05 | ||
|
|
cdd2fb3cd2 | ||
|
|
82d9372289 | ||
|
|
248c9bbf64 | ||
|
|
00cef8cedf | ||
|
|
12a0a4baaa | ||
|
|
f4a02ee052 | ||
|
|
b9ae29f7e4 | ||
|
|
cad7341208 | ||
|
|
82e7036142 | ||
|
|
a531474076 | ||
|
|
616f0ac391 | ||
|
|
c021865342 | ||
|
|
8fc2d63815 | ||
|
|
0d4ce0107a | ||
|
|
3e9c8e9fc3 | ||
|
|
d7ba63fdde | ||
|
|
917abc8b9c | ||
|
|
95f0da7140 | ||
|
|
81b479eb11 | ||
|
|
ab084c93a6 | ||
|
|
5634f955ff | ||
|
|
ed3c7b9ad3 | ||
|
|
dc440b356f | ||
|
|
84fe0fba63 | ||
|
|
ab0c3432e6 | ||
|
|
23f70d4ae0 | ||
|
|
d59eda2dcd | ||
|
|
1c55312a1e | ||
|
|
2bfbe6f5b1 | ||
|
|
02ba20c315 | ||
|
|
ba3666a0e6 | ||
|
|
c5be69a9fb | ||
|
|
f0f74b87a4 | ||
|
|
fc81812ff8 | ||
|
|
83762fd85e | ||
|
|
6a1b3c387e | ||
|
|
8c40785bc1 | ||
|
|
965ba7c3d0 | ||
|
|
d94ace2aee | ||
|
|
db2f776f42 | ||
|
|
d2959f0bb5 | ||
|
|
0a40b4054f | ||
|
|
5f65cfc5b7 | ||
|
|
8010a117f1 | ||
|
|
4adaa8ee18 | ||
|
|
2ebe2735bb | ||
|
|
d94a0e9c78 | ||
|
|
4ea393ecdc | ||
|
|
5179b09e67 | ||
|
|
619b6b5459 | ||
|
|
9ea0384254 | ||
|
|
b224ef6810 | ||
|
|
4e7766789c | ||
|
|
e2b31808c0 | ||
|
|
58df6f75aa | ||
|
|
0a48a4ed17 | ||
|
|
c093e6668e | ||
|
|
933119ea56 | ||
|
|
4a2afb9b79 | ||
|
|
0081a2c224 | ||
|
|
ad34640601 | ||
|
|
f7df3e5b08 | ||
|
|
eba46bf4cd | ||
|
|
cc227e775f | ||
|
|
4bee31771d | ||
|
|
dd9f88d886 | ||
|
|
e6d82ad04b | ||
|
|
9e7a926fe9 | ||
|
|
ef79af2b4a | ||
|
|
fae51638b1 | ||
|
|
8983650075 | ||
|
|
7777df7b7d | ||
|
|
a8d726d6a5 | ||
|
|
4baad26b5f | ||
|
|
c548ba399e | ||
|
|
d4be8674e8 | ||
|
|
1989371a68 | ||
|
|
0b4909dd85 | ||
|
|
7bffd4020e | ||
|
|
7034f8faa2 | ||
|
|
de6961cb1d | ||
|
|
baf905d76c | ||
|
|
373810f5f4 | ||
|
|
19a9fa7034 | ||
|
|
6a06999761 | ||
|
|
1c13cb1728 | ||
|
|
9662155dde | ||
|
|
e91e307177 | ||
|
|
225e882eae | ||
|
|
77c4833c42 | ||
|
|
fbced203b1 | ||
|
|
fff3d22f1a | ||
|
|
c5689ab543 | ||
|
|
d1edf960e6 | ||
|
|
64ec281fb2 | ||
|
|
9c9174d3a6 | ||
|
|
51dcf4f60a | ||
|
|
f3929075e3 | ||
|
|
943a39d30d | ||
|
|
85518226c6 | ||
|
|
6a7f14e71c | ||
|
|
9b3efc6e1f | ||
|
|
b6d65ad805 | ||
|
|
7ab5e10f57 | ||
|
|
6f3aa4690f | ||
|
|
f4ff216e45 | ||
|
|
01a6f250da | ||
|
|
1ccc97d8e5 | ||
|
|
ed2537dc58 | ||
|
|
16b7176fe3 | ||
|
|
f2eab3f636 | ||
|
|
00747ac364 | ||
|
|
ad3f7e174c | ||
|
|
4708688b02 | ||
|
|
940e1255f1 | ||
|
|
c8b041154e | ||
|
|
7da8246ce3 | ||
|
|
38bccf08eb | ||
|
|
ed817bf04c | ||
|
|
4f8d6f8fa1 | ||
|
|
d13b7b19c9 | ||
|
|
2e7535037c | ||
|
|
5b8290e77e | ||
|
|
a19cad1bce | ||
|
|
8b8e59349b | ||
|
|
f87d020db2 | ||
|
|
91cb70c5a3 | ||
|
|
eda041ec74 | ||
|
|
d875804d2b | ||
|
|
6b77a04e12 | ||
|
|
3f18280557 | ||
|
|
1b9c7b90ff | ||
|
|
1ef6ebafd4 | ||
|
|
058969c0f0 | ||
|
|
8f43b09205 | ||
|
|
155c556fea | ||
|
|
151ec81036 | ||
|
|
c5d52a4c9a | ||
|
|
6ef57ee106 | ||
|
|
dd2167dab5 | ||
|
|
0c179d92af | ||
|
|
abace10750 | ||
|
|
03949990b1 | ||
|
|
bdb777df0c | ||
|
|
5d2ed071e1 | ||
|
|
e152c92bf4 | ||
|
|
840b4dddd3 | ||
|
|
136ab3aa97 | ||
|
|
6b9ecd239a | ||
|
|
0b8f9a9d4b | ||
|
|
4611a9e806 | ||
|
|
fe19e8390e | ||
|
|
9a91e9b3d2 | ||
|
|
147fb90550 | ||
|
|
4007711cf3 | ||
|
|
c4259221c1 | ||
|
|
45ffd93728 | ||
|
|
346e45b153 | ||
|
|
8f1e628f8d | ||
|
|
2807bc28e8 | ||
|
|
2c2db2e657 | ||
|
|
2734b90d0f | ||
|
|
88e8a71412 | ||
|
|
e1222ac0e1 | ||
|
|
43251ae7c3 | ||
|
|
eeb9f5ab71 | ||
|
|
c148d01d16 | ||
|
|
c83c410078 | ||
|
|
ef166f1184 | ||
|
|
c1baf84e74 | ||
|
|
031a8dc639 | ||
|
|
31a37c5f70 | ||
|
|
a353175d9c | ||
|
|
1800ef9dda | ||
|
|
1419955277 | ||
|
|
ffdb9e1f4a | ||
|
|
0826fcf332 | ||
|
|
b53acac3dc | ||
|
|
c47048cc2d | ||
|
|
1fb51c159a | ||
|
|
7596f3f5dc | ||
|
|
21179b08d7 | ||
|
|
4f437d4e15 | ||
|
|
4aa0312095 | ||
|
|
15636896bd | ||
|
|
431864c317 | ||
|
|
31098d64a8 | ||
|
|
8a156988fc | ||
|
|
df704ee2ec | ||
|
|
17f4c35e77 | ||
|
|
3a112a31ea | ||
|
|
3d12dba46b | ||
|
|
7a75d45c7e | ||
|
|
279b61f5c1 | ||
|
|
c6c886184c | ||
|
|
fe6bc395c2 | ||
|
|
c8f8e59d78 | ||
|
|
ef6c597021 | ||
|
|
bc5df7f004 | ||
|
|
1fcc39c2aa | ||
|
|
92febc6e0c | ||
|
|
caa4a41df2 | ||
|
|
e6dfbb7a4f | ||
|
|
d59f8970cc | ||
|
|
d631913e77 | ||
|
|
28f994a757 | ||
|
|
e1b383122c | ||
|
|
f47cfdcb9e | ||
|
|
dc3a09b0c0 | ||
|
|
594a2df49b | ||
|
|
bf41d8f181 | ||
|
|
0345b8d045 | ||
|
|
ff89d6e4e8 | ||
|
|
dea62ab969 | ||
|
|
25dbcce053 | ||
|
|
3e0e9ad15c | ||
|
|
bfd929a324 | ||
|
|
50922a3206 | ||
|
|
2817353f8e | ||
|
|
1f3dca06d7 | ||
|
|
e586812ddf | ||
|
|
05fc7c6ab7 | ||
|
|
ad9381b169 | ||
|
|
adfdfceef3 | ||
|
|
d7c7ed36f4 | ||
|
|
de5890947b | ||
|
|
08d9780c97 | ||
|
|
d627093560 | ||
|
|
6f3126857a | ||
|
|
731cae82c3 | ||
|
|
3440d2f0f7 | ||
|
|
49c3be36a8 | ||
|
|
00370a1f61 | ||
|
|
a171f9b312 | ||
|
|
d05f495d6c | ||
|
|
c2df47b776 | ||
|
|
e8ee773bd8 | ||
|
|
7f7475eae5 |
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# Changesets
|
||||
|
||||
For versjonering bruker vi løsningen [Changesets](https://github.com/changesets/changesets) for [versjonering](https://semver.org/) og publisering av pakker.
|
||||
|
||||
## Howto
|
||||
|
||||
- For å lage en ny versjons-entry: `yarn changeset`
|
||||
- Velg pakkene som skal versjoneres med `arrowkeys` + `Space`
|
||||
|
||||
`🦋 Which packages would you like to include?`
|
||||
|
||||
Trykk `Space` for å velge pakkene som skal versjoneres, for så trykke `Enter` for å gå videre.
|
||||
|
||||
`🦋 Which packages should have a major bump?`
|
||||
|
||||
Trykk `Enter` for å gå videre _*eller*_ velg pakkene som skal marjor-bumpes med `arrowkeys` + `Space`
|
||||
|
||||
`🦋 Which packages should have a minor bump?`
|
||||
|
||||
Trykk `Enter` for å gå videre _*eller*_ velg pakkene som skal marjor-bumpes med `arrowkeys` + `Space`
|
||||
|
||||
Hvis du ikke velger major eller minor, så blir pakkene få en patch-bump
|
||||
|
||||
- Commit og push.
|
||||
|
||||
## Fixed versjonering
|
||||
|
||||
Alle base-pakkene våre har `fixed versjonering`. Dette tilsier at en bump på en av disse vil bumpe alle til samme versjon
|
||||
|
||||
```sh
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"@navikt/ds-tailwind",
|
||||
"@navikt/ds-css-internal",
|
||||
"@navikt/ds-react-internal",
|
||||
"@navikt/ds-codemod"
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
|
||||
"changelog": ["@changesets/changelog-github", { "repo": "navikt/aksel" }],
|
||||
"commit": false,
|
||||
"fixed": [
|
||||
[
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"@navikt/ds-tailwind",
|
||||
"@navikt/ds-css-internal",
|
||||
"@navikt/ds-react-internal",
|
||||
"@navikt/ds-codemod"
|
||||
]
|
||||
],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": ["shadow-dom", "aksel.nav.no", "@navikt/ds-navno"],
|
||||
|
||||
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||
"updateInternalDependents": "always"
|
||||
}
|
||||
}
|
||||
@@ -3,25 +3,12 @@ name: Bug Report
|
||||
about: Meld inn bugs eller feil
|
||||
title: "[BUG]"
|
||||
labels: "bug \U0001F41B"
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## Hvilken av tjenestene våre gjelder det?
|
||||
## Hva er feilen/problemet?
|
||||
|
||||
<!--
|
||||
Sett en x i type pakke det gjelder:
|
||||
- [x] type
|
||||
-->
|
||||
|
||||
- [ ] `Komponenter`
|
||||
- [ ] `Stiler`
|
||||
- [ ] `Ikoner`
|
||||
- [ ] `Annet`
|
||||
|
||||
## Beskriv feilen/problemet
|
||||
|
||||
<!--
|
||||
> Beskriv hva slags problem(er) som oppstår
|
||||
|
||||
> Hva forventet du skulle oppstå?
|
||||
@@ -31,7 +18,7 @@ assignees: ''
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Steg for å reprodusere problemet
|
||||
## Steg for å reprodusere problemet (valgfri)
|
||||
|
||||
<!--
|
||||
1. Steg en
|
||||
@@ -41,11 +28,11 @@ assignees: ''
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Eksempel/Tilleggsinformasjon
|
||||
## Eksempel/Tilleggsinformasjon (valgfri)
|
||||
|
||||
<!--
|
||||
Screenshots eller kodesnippets
|
||||
Legg gjerne ved ekstrainfo som nettleser, desktop/mobil etc
|
||||
Legg gjerne ved ekstrainfo som nettleser eller desktop/mobil hvis det er relevant.
|
||||
-->
|
||||
|
||||
```
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Foreslå noe nytt for designsystemet
|
||||
about: Foreslå noe nytt!
|
||||
title: "[NEW]"
|
||||
labels: new ✨
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## Beskriv forespørselen
|
||||
## Hva?
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Hvilken funksjon vil dette har for bruker?
|
||||
## Hva løser dette?
|
||||
|
||||
(skriv her.)
|
||||
|
||||
## Eksempler/Tilleggsinformasjon
|
||||
## Eksempler/Info
|
||||
|
||||
<!--
|
||||
Del gjerne eksempel av lignende løsninger som er i bruk idag, URL/Screenshots etc.
|
||||
Del gjerne eksempel av lignende løsninger som er i bruk idag, URL/Screenshots etc.
|
||||
Link gjerne til relaterte issues her også.
|
||||
-->
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
name: Ny komponent
|
||||
description: Send et ønske om en eller flere nye komponenter
|
||||
title: "[Ny komponent]: "
|
||||
labels: ["nytt ✨", "forespørsel 🥰", "komponenter 🧩"]
|
||||
assignees:
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Takk for at du bidrar inn i Aksel!
|
||||
- type: input
|
||||
id: title
|
||||
attributes:
|
||||
label: Navn på komponent
|
||||
description: Hva er navnet på komponenten du ønsker deg?
|
||||
placeholder: eks. datepicker
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: examples
|
||||
attributes:
|
||||
label: Eksempel på komponenten
|
||||
description: Send en lenke til eksempler på komponenten
|
||||
@@ -0,0 +1,24 @@
|
||||
name: Nytt ikon
|
||||
description: Send et ønske om et eller flere nye ikoner
|
||||
title: "[Nytt ikon]: "
|
||||
labels: ["nytt ✨", "ikoner 🖼", "forespørsel 🥰"]
|
||||
assignees:
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Takk for at du bidrar inn i Aksel!
|
||||
- type: input
|
||||
id: title
|
||||
attributes:
|
||||
label: Navn på ikonet
|
||||
description: Hva er navnet på ikonet du ønsker deg?
|
||||
placeholder: eks. send
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: examples
|
||||
attributes:
|
||||
label: Eksempel på ikonet
|
||||
description: Send en lenke til eksempler på ikonet
|
||||
@@ -0,0 +1,16 @@
|
||||
name: Innspill til komponent
|
||||
description: Send inn innspill til komponent
|
||||
title: "[Innspill til komponent]: "
|
||||
labels: ["forespørsel 🥰", "komponenter 🧩", "nytt ✨", "beta 🧪"]
|
||||
assignees:
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Takk for at du bidrar inn i Aksel!
|
||||
- type: textarea
|
||||
id: feeback
|
||||
attributes:
|
||||
label: Tilbakemelding
|
||||
description: Beskriv hvilke tilbakemeldinger du har til komponenten
|
||||
@@ -0,0 +1,16 @@
|
||||
name: Innspill til ikon
|
||||
description: Send inn innspill til ikon
|
||||
title: "[Tilbakemelding på ikon]: "
|
||||
labels: ["forespørsel 🥰", "ikoner 🖼️"]
|
||||
assignees:
|
||||
- olejorgenbakken
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Takk for at du bidrar inn i Aksel!
|
||||
- type: textarea
|
||||
id: feeback
|
||||
attributes:
|
||||
label: Tilbakemelding
|
||||
description: Beskriv hvilke tilbakemeldinger du har til ikonet
|
||||
@@ -0,0 +1,105 @@
|
||||
name: Deploy aksel.dev.nav.no
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- next
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
|
||||
jobs:
|
||||
snyk-monitor:
|
||||
name: monitor dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
continue-on-error: true
|
||||
uses: snyk/actions/node@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: monitor
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
snyk-test:
|
||||
name: analyze dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
uses: snyk/actions/node@master
|
||||
continue-on-error: true
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: test
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
build_and_deploy:
|
||||
name: Build and deploy to dev-gcp
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
packages: "write"
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
- uses: actions/checkout@v3
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
echo "USE_CDN_ASSETS=true" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-dev-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dev-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Build application
|
||||
run: |
|
||||
yarn boot
|
||||
yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Upload static files to NAV CDN
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./aksel.nav.no/website/.next/static
|
||||
destination: "/website/_next"
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get complete tag
|
||||
run: echo "TAG=DEV-$( date +%s )" >> $GITHUB_ENV
|
||||
- name: Create docker image tags
|
||||
run: echo "DOCKER_TAG=${{ env.IMAGE }}:${{ env.TAG }}" >> $GITHUB_ENV
|
||||
- name: Build docker image
|
||||
run: docker build -t ${{ env.DOCKER_TAG }} . -f aksel.nav.no/Dockerfile
|
||||
- name: Push docker image
|
||||
run: |
|
||||
docker push ${{ env.DOCKER_TAG }}
|
||||
|
||||
- name: Deploy to dev-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
env:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-dev.yaml
|
||||
CLUSTER: dev-gcp
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
@@ -0,0 +1,148 @@
|
||||
name: Deploy aksel.nav.no
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
|
||||
jobs:
|
||||
snyk-monitor:
|
||||
name: monitor dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
continue-on-error: true
|
||||
uses: snyk/actions/node@master
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: monitor
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
snyk-test:
|
||||
name: analyze dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Snyk to check for vulnerabilities
|
||||
uses: snyk/actions/node@master
|
||||
continue-on-error: true
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
command: test
|
||||
args: --org=designsystemet --severity-threshold=high
|
||||
sync_data_with_sanity:
|
||||
name: Update component data
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
- uses: actions/checkout@v3
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-prod-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-prod-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Run docgen
|
||||
run: |
|
||||
yarn boot
|
||||
yarn docgen
|
||||
|
||||
- name: Update sanity sync
|
||||
run: yarn workspace aksel.nav.no sanity:update
|
||||
|
||||
build_and_deploy:
|
||||
name: Build and deploy to prod-gcp
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: "write"
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
- uses: actions/checkout@v3
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
echo "USE_CDN_ASSETS=true" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-prod-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-prod-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Build packages
|
||||
run: yarn boot
|
||||
|
||||
- name: Tests
|
||||
run: yarn workspace aksel.nav.no test
|
||||
|
||||
- name: Build application
|
||||
run: yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Upload static files to NAV CDN
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./aksel.nav.no/website/.next/static
|
||||
destination: "/website/_next"
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get complete tag
|
||||
run: echo "TAG=$( date +%s )" >> $GITHUB_ENV
|
||||
- name: Create docker image tags
|
||||
run: echo "DOCKER_TAG=${{ env.IMAGE }}:${{ env.TAG }}" >> $GITHUB_ENV
|
||||
- name: Build docker image
|
||||
run: docker build -t ${{ env.DOCKER_TAG }} . -f aksel.nav.no/Dockerfile
|
||||
- name: Wait for e2e-tests to succeed
|
||||
uses: lewagon/wait-on-check-action@v1.2.0
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
check-name: "Smoketest Aksel"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
wait-interval: 10
|
||||
- name: Push docker image
|
||||
run: |
|
||||
docker push ${{ env.DOCKER_TAG }}
|
||||
|
||||
- name: Deploy to prod-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
env:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-prod.yaml
|
||||
CLUSTER: prod-gcp
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
@@ -0,0 +1,41 @@
|
||||
name: Redeploy image to for aksel.nav.no
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Docker image tag"
|
||||
required: true
|
||||
default: ""
|
||||
dry:
|
||||
description: "Dry-run"
|
||||
required: true
|
||||
default: "false"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
|
||||
jobs:
|
||||
redeploy:
|
||||
name: Redeploy image
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
- uses: actions/checkout@v3
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # Use commit-sha1 instead of tag for security concerns
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Create docker image tag
|
||||
run: echo "DOCKER_TAG=${{ env.IMAGE }}:${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
||||
- name: Deploy to prod-gcp
|
||||
uses: nais/deploy/actions/deploy@master
|
||||
env:
|
||||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
|
||||
RESOURCE: aksel.nav.no/nais-prod.yaml
|
||||
CLUSTER: prod-gcp
|
||||
IMAGE: ${{ env.DOCKER_TAG }}
|
||||
DRY_RUN: ${{ github.event.inputs.dry }}
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Backup sanity dateset to gcp
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# 12.00 every 3 days
|
||||
- cron: "0 0 */3 * *"
|
||||
jobs:
|
||||
execute:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Required to retrieve git history
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-build-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-
|
||||
- name: Install dependencies
|
||||
run: cd aksel.nav.no/website && yarn
|
||||
|
||||
- name: Export dataset
|
||||
run: cd aksel.nav.no/website && SANITY_PREVIEW_TOKEN=${{secrets.SANITY_DATASET_EDITOR_TOKEN}} yarn backup
|
||||
- name: Upload GCP bucket
|
||||
uses: "google-github-actions/auth@v0"
|
||||
with:
|
||||
credentials_json: "${{ secrets.gcp_credentials_prod }}"
|
||||
- uses: "google-github-actions/upload-cloud-storage@v0"
|
||||
with:
|
||||
path: ./aksel.nav.no/website
|
||||
destination: "aksel-website-prod/backups"
|
||||
glob: "backup-*.tar.gz"
|
||||
@@ -1,99 +0,0 @@
|
||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
||||
|
||||
name: Build -> Test -> Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Required to retrieve git history
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Boot
|
||||
run: yarn boot
|
||||
- name: Eslint and Stylelint
|
||||
run: yarn lint
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
publish-npm:
|
||||
needs: test-build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
if: github.event_name == 'push' && contains(github.event.head_commit.message, '[fix]') || contains(github.event.head_commit.message, '[feature]') || contains(github.event.head_commit.message, '[breaking]')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: "0"
|
||||
token: ${{secrets.GIT_REPO}}
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
registry-url: https://registry.npmjs.org
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Boot
|
||||
run: yarn boot
|
||||
- name: Generate docs
|
||||
run: yarn docgen
|
||||
- name: Setup github connection for auth
|
||||
run: |
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git remote set-url origin https://github-actions[bot]:$NAV_DS_TOKEN@github.com/$GITHUB_REPOSITORY.git
|
||||
env:
|
||||
NAV_DS_TOKEN: ${{secrets.GIT_REPO}}
|
||||
|
||||
- name: Update changed packages with PATCH
|
||||
if: "contains(github.event.head_commit.message, '[fix]')"
|
||||
run: yarn lerna version patch --include-merged-tags --yes
|
||||
- name: Update changed packages with MINOR
|
||||
if: "contains(github.event.head_commit.message, '[feature]')"
|
||||
run: yarn lerna version minor --include-merged-tags --yes
|
||||
- name: Update changed packages with MAJOR
|
||||
if: "contains(github.event.head_commit.message, '[breaking]')"
|
||||
run: yarn lerna version major --include-merged-tags --yes
|
||||
- name: Publish to NPM registry
|
||||
run: yarn lerna publish --no-verify-access from-package --yes
|
||||
|
||||
- name: Create a .npmrc file for the github package repository
|
||||
uses: FerLuisxd/create-npmrc@3
|
||||
with:
|
||||
org_name: navikt
|
||||
env:
|
||||
AUTH_TOKEN: ${{secrets.GIT_REPO}}
|
||||
- name: Publish to Github registry
|
||||
run: |
|
||||
yarn lerna publish --registry https://npm.pkg.github.com from-package --yes
|
||||
@@ -1,46 +1,59 @@
|
||||
name: Chromatic
|
||||
name: Visual Regression Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches:
|
||||
- "main"
|
||||
paths:
|
||||
- "@navikt/**"
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [main, next]
|
||||
paths:
|
||||
- "@navikt/**"
|
||||
|
||||
jobs:
|
||||
chromatic-pr:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
visual_regression_test:
|
||||
name: "visual regression test (chromatic)"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v1
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
id: node-cache
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Boot
|
||||
key: ${{ runner.os }}-visual-regression-test-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-visual-regression-test-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Build packages
|
||||
run: yarn boot
|
||||
- name: run chromatic
|
||||
|
||||
- name: Chromatic
|
||||
uses: chromaui/action@v1
|
||||
id: chromatic_tests
|
||||
continue-on-error: true
|
||||
with:
|
||||
autoAcceptChanges: "main"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectToken: x3xqdfgkujg
|
||||
exitZeroOnChanges: false
|
||||
buildScriptName: "build:storybook"
|
||||
env:
|
||||
STORYBOOK_GITHUB_SHA: ${{ github.sha }}
|
||||
|
||||
- name: replace storybook url
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
uses: frabert/replace-string-action@v2.0
|
||||
id: storybook_url
|
||||
with:
|
||||
@@ -49,78 +62,43 @@ jobs:
|
||||
replace-with: ""
|
||||
|
||||
- name: Get commit sha
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
|
||||
- name: Find Comment
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
|
||||
uses: peter-evans/find-comment@v1
|
||||
id: fc
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
comment-author: "github-actions[bot]"
|
||||
body-includes: Chromatic build-output
|
||||
body-includes: github-comment-finder
|
||||
|
||||
- name: Create or update comment
|
||||
if: steps.chromatic_tests.outcome == 'success'
|
||||
if: steps.chromatic_tests.outcome == 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
Chromatic build-output:
|
||||
### [<img id="github-comment-finder" src="https://raw.githubusercontent.com/storybookjs/brand/main/logo/logo-storybook-inverse.svg" height="32"/>](${{steps.storybook_url.outputs.replaced}})
|
||||
|
||||
- :clipboard: [Review](${{steps.chromatic_tests.outputs.url}})
|
||||
- :tada: [Storybook preview](${{steps.storybook_url.outputs.replaced}})
|
||||
- :white_check_mark: SUCCESS :white_check_mark:
|
||||
|
||||
commit: `${{ steps.vars.outputs.sha_short }}`
|
||||
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories
|
||||
edit-mode: replace
|
||||
|
||||
- name: Create or update failed comment
|
||||
if: steps.chromatic_tests.outcome != 'success'
|
||||
if: steps.chromatic_tests.outcome != 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
**Chromatic build-output**:
|
||||
### [<img id="github-comment-finder" src="https://raw.githubusercontent.com/storybookjs/brand/main/logo/logo-storybook-inverse.svg" height="32"/>](${{steps.storybook_url.outputs.replaced}})
|
||||
|
||||
- :clipboard: [Review](${{steps.chromatic_tests.outputs.url}})
|
||||
- :tada: [Storybook preview](${{steps.storybook_url.outputs.replaced}})
|
||||
- :no_entry_sign: FAILED :no_entry_sign:, review endringer.
|
||||
### [Endringer til review](${{steps.chromatic_tests.outputs.url}}): ${{steps.chromatic_tests.outputs.changeCount}}
|
||||
|
||||
commit: `${{ steps.vars.outputs.sha_short }}`
|
||||
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories
|
||||
edit-mode: replace
|
||||
|
||||
chromatic-push:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name == 'push'"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: install
|
||||
if: steps.node-cache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
- name: postinstall
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Boot
|
||||
run: yarn boot
|
||||
- name: run chromatic
|
||||
uses: chromaui/action@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectToken: x3xqdfgkujg
|
||||
autoAcceptChanges: true
|
||||
@@ -0,0 +1,44 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- next
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Validate build"
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-test-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-test
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Boot (build packages)
|
||||
run: yarn boot
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
|
||||
- name: Test
|
||||
run: yarn test
|
||||
@@ -0,0 +1,55 @@
|
||||
name: E2E / Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [main, next]
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
pull_request:
|
||||
branches: [main, next]
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
jobs:
|
||||
playwright:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.30.0-focal
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-e2e-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-e2e-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Build packages
|
||||
run: |
|
||||
yarn boot
|
||||
|
||||
- name: Build application
|
||||
run: yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: yarn workspace website e2e:ci-full
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: aksel.nav.no/website/playwright-report/
|
||||
retention-days: 10
|
||||
@@ -0,0 +1,30 @@
|
||||
name: "push-to-cdn"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
paths:
|
||||
- "fonts/**"
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: "read"
|
||||
id-token: "write"
|
||||
|
||||
steps:
|
||||
- uses: "actions/checkout@v3"
|
||||
|
||||
- id: upload
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-team-name: aksel
|
||||
source: ./fonts
|
||||
destination: "" # uploads folder to team root
|
||||
|
||||
- run: echo uploaded file ${{ steps.upload.outputs.uploaded }}
|
||||
shell: bash
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Release packages"
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.13.0
|
||||
cache: yarn
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-prod-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-prod
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Create release Pull Request or publish to NPM
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: yarn version
|
||||
publish: yarn release
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
|
||||
- name: Creating .npmrc
|
||||
run: |
|
||||
cat << EOF > "$HOME/.npmrc"
|
||||
@navikt:registry=https://npm.pkg.github.com
|
||||
//npm.pkg.github.com/:_authToken=$NPM_TOKEN
|
||||
EOF
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.GIT_REPO }}
|
||||
|
||||
- name: Publish to GPR
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
id: changesets-gpr
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
publish: yarn changeset publish
|
||||
createGithubReleases: false
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GIT_REPO }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION }}
|
||||
@@ -0,0 +1,49 @@
|
||||
name: Smoketest aksel.nav.no
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "aksel.nav.no/**"
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/navikt/aksel
|
||||
|
||||
jobs:
|
||||
smoketest:
|
||||
name: Smoketest Aksel
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.30.0-focal
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
- uses: actions/checkout@v3
|
||||
- name: add tokens to .env
|
||||
run: |
|
||||
echo "SANITY_WRITE_KEY=${{ secrets.SANITY_FEEDBACK_WRITE_KEY }}" >> aksel.nav.no/website/.env
|
||||
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PREVIEW_TOKEN=${{ secrets.SANITY_PREVIEW_TOKEN }}" >> aksel.nav.no/website/.env
|
||||
echo "SANITY_PRIVATE_NO_DRAFTS=${{ secrets.SANITY_PRIVATE_NO_DRAFTS }}" >> aksel.nav.no/website/.env
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-prod-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-prod-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: build packages
|
||||
run: |
|
||||
yarn boot
|
||||
|
||||
- name: Build application
|
||||
run: yarn workspace aksel.nav.no build:next
|
||||
|
||||
- name: E2E smoketest
|
||||
run: yarn workspace website e2e:ci
|
||||
@@ -1,20 +1,20 @@
|
||||
name: Update Icons
|
||||
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: 0 0 * * *
|
||||
# schedule:
|
||||
# - cron: 0 0 * * *
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update Icons
|
||||
run: yarn update:icons
|
||||
run: yarn workspace @navikt/ds-icons update
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
@@ -39,4 +39,4 @@ jobs:
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
signoff: false
|
||||
delete-branch: true
|
||||
title: "[FIX] Ikonsynk Figma"
|
||||
title: "Ikonsynk Figma"
|
||||
@@ -7,12 +7,12 @@ jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Node-modules cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
id: node-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
if: steps.node-cache.outputs.cache-hit == 'true'
|
||||
run: yarn postinstall
|
||||
- name: Update tokens
|
||||
run: yarn update:tokens
|
||||
run: yarn workspace @navikt/ds-tokens update
|
||||
env:
|
||||
FIGMA_TOKEN: ${{ secrets.FIGMA_IKONER_API }}
|
||||
- name: Create Pull Request
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: figma-tokens-sync
|
||||
delete-branch: true
|
||||
title: "[FEATURE] Tokens sync Figma"
|
||||
title: "Tokens sync Figma"
|
||||
commit-message: "Tokens synket fra figma"
|
||||
committer: GitHub <noreply@github.com>
|
||||
signoff: false
|
||||
+28
-3
@@ -107,8 +107,8 @@ utilities/**/css
|
||||
|
||||
*/static/*.zip
|
||||
*/static/png
|
||||
@navikt/core/icons/NAV-ikonpakke-png.zip
|
||||
@navikt/core/icons/NAV-ikonpakke-svg.zip
|
||||
@navikt/icons/NAV-ikonpakke-png.zip
|
||||
@navikt/icons/NAV-ikonpakke-svg.zip
|
||||
*/**/NAV-ikonpakke-png.zip
|
||||
*/**/NAV-ikonpakke-svg.zip
|
||||
|
||||
@@ -116,6 +116,7 @@ react-docgen.json
|
||||
react-docgen-docs.json
|
||||
cjs
|
||||
esm
|
||||
@navikt/community/navno/css
|
||||
.vercel
|
||||
_docs.json
|
||||
|
||||
@@ -125,4 +126,28 @@ _docs.json
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
!.yarn/versions
|
||||
*/icons/src
|
||||
*/icons/png
|
||||
*/core/icons
|
||||
/storybook-static
|
||||
|
||||
# Aksel.nav.no
|
||||
.next
|
||||
!*/website/lib/
|
||||
!*/website/public/
|
||||
!aksel.nav.no/**/*.d.ts
|
||||
!*/sanity/lib/
|
||||
!*/sanity/static/
|
||||
out
|
||||
videos
|
||||
sanity/scripts/renameField.js
|
||||
tmp.json
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/playwright/.cache/
|
||||
playwright-report/
|
||||
/test-results/
|
||||
backup-*.tar.gz
|
||||
sitemap-urls.json
|
||||
*.tar.gz
|
||||
+12
-6
@@ -1,10 +1,12 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
if [ -z "$husky_skip_init" ]; then
|
||||
debug () {
|
||||
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
|
||||
if [ "$HUSKY_DEBUG" = "1" ]; then
|
||||
echo "husky (debug) - $1"
|
||||
fi
|
||||
}
|
||||
|
||||
readonly hook_name="$(basename "$0")"
|
||||
readonly hook_name="$(basename -- "$0")"
|
||||
debug "starting $hook_name..."
|
||||
|
||||
if [ "$HUSKY" = "0" ]; then
|
||||
@@ -17,14 +19,18 @@ if [ -z "$husky_skip_init" ]; then
|
||||
. ~/.huskyrc
|
||||
fi
|
||||
|
||||
export readonly husky_skip_init=1
|
||||
readonly husky_skip_init=1
|
||||
export husky_skip_init
|
||||
sh -e "$0" "$@"
|
||||
exitCode="$?"
|
||||
|
||||
if [ $exitCode != 0 ]; then
|
||||
echo "husky - $hook_name hook exited with code $exitCode (error)"
|
||||
exit $exitCode
|
||||
fi
|
||||
|
||||
exit 0
|
||||
if [ $exitCode = 127 ]; then
|
||||
echo "husky - command not found in PATH=$PATH"
|
||||
fi
|
||||
|
||||
exit $exitCode
|
||||
fi
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname $0)/_/husky.sh"
|
||||
|
||||
yarn pretty-quick --staged
|
||||
yarn pretty-quick --staged && yarn lint-staged
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname $0)/_/husky.sh"
|
||||
|
||||
yarn lint
|
||||
@@ -0,0 +1,2 @@
|
||||
**/nais-dev.yaml
|
||||
**/nais-prod.yaml
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Meta, Canvas } from "@storybook/addon-docs";
|
||||
|
||||
<Meta title="ds-react(deprecated)/intro" />
|
||||
|
||||
# Utdaterte pakker
|
||||
|
||||
På sikt vil komponentene under bli flyttet ut av ds-react eller erstattes av andre komponenter
|
||||
|
||||
- PageHeader -> @navikt/ds-react-navno
|
||||
- MicroCard -> @navikt/ds-react-navno
|
||||
|
||||
- StepIndicator -> Horisontal `<Stepper />`
|
||||
@@ -0,0 +1,33 @@
|
||||
import { loadCsf } from "@storybook/csf-tools";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
module.exports = (indexers) => {
|
||||
const csfIndexer = async (fileName: string, opts) => {
|
||||
const code = readFileSync(fileName, "utf-8").toString();
|
||||
return loadCsf(code, { ...opts, fileName }).parse();
|
||||
};
|
||||
|
||||
const exampleIndexer = async (fileName: string, opts) => {
|
||||
let code = readFileSync(fileName, "utf-8").toString();
|
||||
|
||||
code = code.replace("export const args =", "const args =");
|
||||
|
||||
code += `\nexport default { title: "Eksempler/${fileName
|
||||
.split("pages/eksempler/")[1]
|
||||
.replace(".tsx", "")}" };\n`;
|
||||
|
||||
return loadCsf(code, { ...opts, fileName }).parse();
|
||||
};
|
||||
|
||||
return [
|
||||
...(indexers || []),
|
||||
{
|
||||
test: /(stories|story)\.[tj]sx?$/,
|
||||
indexer: csfIndexer,
|
||||
},
|
||||
{
|
||||
test: /pages\/eksempler\/|(".+")|(.+.tsx)$/,
|
||||
indexer: exampleIndexer,
|
||||
},
|
||||
];
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Meta, Canvas } from "@storybook/addon-docs";
|
||||
|
||||
<Meta title="Intro" />
|
||||
|
||||
# Aksel, NAVs designsystem
|
||||
|
||||
- [Dokumentasjon](https://aksel.nav.no/komponenter)
|
||||
|
||||
### Core
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-react @navikt/ds-css
|
||||
```
|
||||
|
||||
### Interne-flater
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-react-internal @navikt/ds-css-internal
|
||||
```
|
||||
|
||||
### Ikoner
|
||||
|
||||
```bash
|
||||
yarn add @navikt/ds-icons
|
||||
```
|
||||
|
||||
### Bruk
|
||||
|
||||
```jsx
|
||||
import { Heading } from "@navikt/ds-react";
|
||||
import "@navikt/ds-css";
|
||||
|
||||
<Heading level="1" size="xlarge">
|
||||
Sidetitel
|
||||
</Heading>;
|
||||
```
|
||||
@@ -15,3 +15,17 @@
|
||||
.rowgap[data-theme="dark"] {
|
||||
background-color: #262626;
|
||||
}
|
||||
|
||||
.rowgap-wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.css-warning {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
border-radius: 6px;
|
||||
padding: 1.5rem;
|
||||
background-color: var(--a-surface-warning-subtle);
|
||||
border: 1px solid var(--a-border-warning);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
const storyIndexers = require("./indexer");
|
||||
|
||||
const path = require("path");
|
||||
const { mergeConfig } = require("vite");
|
||||
|
||||
module.exports = {
|
||||
storyIndexers,
|
||||
devServer: {
|
||||
stats: "errors-only",
|
||||
},
|
||||
staticDirs: ["./public"],
|
||||
|
||||
stories: () => [
|
||||
"../@navikt/**/*.stories.@(js|jsx|ts|tsx|mdx)",
|
||||
"./*.stories.mdx",
|
||||
...(process.env.STORYBOOK_STORIES === "all"
|
||||
? [
|
||||
"../aksel.nav.no/website/components/**/*.stories.tsx",
|
||||
"../aksel.nav.no/website/pages/eksempler/**/*.tsx",
|
||||
]
|
||||
: []),
|
||||
],
|
||||
addons: [
|
||||
"@storybook/addon-a11y",
|
||||
"@whitespace/storybook-addon-html",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
loaderOptions: {
|
||||
injectStoryParameters: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "@storybook/addon-essentials",
|
||||
options: {
|
||||
actions: false,
|
||||
controls: {
|
||||
hideNoControlsWarning: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
framework: {
|
||||
name: "@storybook/react-vite",
|
||||
options: {},
|
||||
},
|
||||
features: {
|
||||
storyStoreV7: true,
|
||||
},
|
||||
docs: {
|
||||
autodocs: "tag",
|
||||
},
|
||||
typescript: {
|
||||
check: false,
|
||||
checkOptions: {},
|
||||
reactDocgen: false,
|
||||
},
|
||||
async viteFinal(config) {
|
||||
return mergeConfig(config, {
|
||||
define: { "process.env": {} },
|
||||
resolve: {
|
||||
alias: [
|
||||
/*
|
||||
// Example
|
||||
{
|
||||
find: "@components",
|
||||
replacement: path.resolve(__dirname, "./src/components"),
|
||||
}, */
|
||||
{
|
||||
find: "components",
|
||||
replacement: path.resolve(
|
||||
__dirname,
|
||||
"../aksel.nav.no/website/components"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -1,57 +0,0 @@
|
||||
const getStories = () => {
|
||||
return process.env.stories
|
||||
? [`../@navikt/**/${process.env.stories}.stories.@(js|jsx|ts|tsx|mdx)`]
|
||||
: ["../@navikt/**/*.stories.@(js|jsx|ts|tsx|mdx)"];
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
webpackFinal: async (config, { configType }) => {
|
||||
config.devServer = {
|
||||
stats: "errors-only",
|
||||
};
|
||||
return config;
|
||||
},
|
||||
devServer: {
|
||||
stats: "errors-only",
|
||||
},
|
||||
stories: () => [...getStories(), "./*.stories.mdx"],
|
||||
addons: [
|
||||
"@storybook/addon-docs",
|
||||
"@storybook/addon-a11y",
|
||||
{
|
||||
name: "@storybook/addon-storysource",
|
||||
options: {
|
||||
loaderOptions: {
|
||||
injectStoryParameters: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "@storybook/addon-essentials",
|
||||
options: {
|
||||
actions: false,
|
||||
controls: {
|
||||
hideNoControlsWarning: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
features: {
|
||||
storyStoreV7: true,
|
||||
},
|
||||
core: {
|
||||
builder: {
|
||||
name: "webpack5",
|
||||
options: {
|
||||
lazyCompilation: false,
|
||||
fsCache: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
framework: "@storybook/react",
|
||||
typescript: {
|
||||
check: false,
|
||||
checkOptions: {},
|
||||
reactDocgen: false,
|
||||
},
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import { addons } from "@storybook/addons";
|
||||
import NavTheme from "./theme.js";
|
||||
import AkselTheme from "./theme.js";
|
||||
|
||||
addons.setConfig({
|
||||
theme: NavTheme,
|
||||
theme: AkselTheme,
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
<script>
|
||||
window.global = window;
|
||||
</script>
|
||||
@@ -1,16 +0,0 @@
|
||||
import "@navikt/ds-css/index.css";
|
||||
import "@navikt/ds-css-internal/index.css";
|
||||
import "./layout.css";
|
||||
|
||||
export const parameters = {
|
||||
/* actions: { argTypesRegex: "^on[A-Z].*" }, */
|
||||
options: {
|
||||
storySort: {
|
||||
method: "",
|
||||
order: ["ds-icons", "ds-react", ["Default"]],
|
||||
locales: "",
|
||||
},
|
||||
},
|
||||
viewMode: "docs",
|
||||
layout: "centered",
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
import "@navikt/ds-css/index.css";
|
||||
import "@navikt/ds-css-internal/index.css";
|
||||
import "./layout.css";
|
||||
|
||||
export const parameters = {
|
||||
options: {
|
||||
storySort: {
|
||||
method: "",
|
||||
order: ["Intro", "ds-react", ["form"], ["Default"], "ds-icons"],
|
||||
locales: "",
|
||||
},
|
||||
},
|
||||
layout: "centered",
|
||||
backgrounds: {
|
||||
values: [
|
||||
{
|
||||
name: "Canvas",
|
||||
value: "#ffffff",
|
||||
},
|
||||
{
|
||||
name: "Darkmode",
|
||||
value: "#262626",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const globalTypes = {
|
||||
theme: {
|
||||
name: "Theme",
|
||||
description: "Global theme for components",
|
||||
toolbar: {
|
||||
icon: "circlehollow",
|
||||
items: [
|
||||
{ value: "light", icon: "circlehollow", title: "light" },
|
||||
{ value: "dark", icon: "circle", title: "dark" },
|
||||
],
|
||||
showName: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const withTheme = (StoryFn, context) => {
|
||||
const foundCss =
|
||||
context.parameters.fileName.startsWith("./@navikt") &&
|
||||
document.querySelector('[data-vite-dev-id$="dist/tw.css"]');
|
||||
return (
|
||||
<div
|
||||
data-theme={context.parameters.theme || context.globals.theme || "light"}
|
||||
lang="no"
|
||||
id="root"
|
||||
>
|
||||
{foundCss && (
|
||||
<div className="css-warning">
|
||||
OBS! Ser ut som CSS fra aksel.nav.no er lastet. Refresh siden!
|
||||
</div>
|
||||
)}
|
||||
<StoryFn />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const decorators = [withTheme];
|
||||
@@ -0,0 +1,38 @@
|
||||
<svg
|
||||
width="119"
|
||||
height="26"
|
||||
viewBox="0 0 119 26"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M56.9682 23.3413L48.1959 1.94542C47.9106 1.30354 47.2687 0.839966 46.5199 0.839966C45.8067 0.839966 45.1292 1.30354 44.8795 1.94542L36.1072 23.3413C36.0359 23.5196 36.0002 23.6623 36.0002 23.7692C36.0002 24.3398 36.4638 24.839 37.07 24.839C37.498 24.839 37.9259 24.5537 38.0685 24.1615L40.1724 18.8838H52.903L55.0069 24.1615C55.1496 24.5537 55.5418 24.839 56.0054 24.839C56.6116 24.839 57.0752 24.3398 57.0752 23.7692C57.0752 23.5909 57.0039 23.4483 56.9682 23.3413ZM40.9213 17.0295L46.5199 2.9439L52.1541 17.0295H40.9213Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M75.0623 23.2343L68.1086 15.3179L74.884 8.93474C75.0623 8.75645 75.1693 8.50683 75.1693 8.29287C75.1693 7.82929 74.8127 7.40137 74.3135 7.40137C74.0995 7.40137 73.8855 7.47269 73.7072 7.61533L63.4729 17.3148V1.76712C63.4729 1.26788 63.045 0.839966 62.5457 0.839966C62.0465 0.839966 61.6186 1.26788 61.6186 1.76712V23.9119C61.6186 24.4111 62.0465 24.839 62.5457 24.839C63.045 24.839 63.4729 24.4111 63.4729 23.9119V19.5614L66.6823 16.5303L73.6003 24.5181C73.7786 24.732 74.0282 24.839 74.3491 24.839C74.884 24.839 75.2763 24.4111 75.2763 23.8762C75.2763 23.6266 75.205 23.4126 75.0623 23.2343Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M79.0353 22.9491C80.747 24.5181 82.6726 25.16 85.1331 25.16C89.448 25.16 91.5876 22.8777 91.5876 20.0963C91.5876 16.4233 88.2712 15.6031 85.3114 14.8543C82.9222 14.2481 80.7113 13.7132 80.7113 11.7519C80.7113 9.96888 82.3517 8.64947 85.0262 8.64947C86.9518 8.64947 88.5565 9.327 89.6619 10.3968C89.7689 10.5038 89.9829 10.6108 90.1612 10.6108C90.6247 10.6108 90.9813 10.2185 90.9813 9.79058C90.9813 9.5053 90.8744 9.327 90.6961 9.1487C89.4123 7.93627 87.5937 7.08043 85.0262 7.08043C81.1392 7.08043 78.8927 9.22002 78.8927 11.8589C78.8927 15.2109 82.0664 15.9597 84.9548 16.6729C87.4154 17.3148 89.7689 17.9567 89.7689 20.1676C89.7689 22.1645 88.0572 23.5909 85.1688 23.5909C83.0649 23.5909 81.3532 22.7708 80.1408 21.6296C79.9981 21.487 79.8198 21.4157 79.6059 21.4157C79.1066 21.4157 78.7144 21.8079 78.7144 22.3072C78.7144 22.5568 78.857 22.8064 79.0353 22.9491Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M95.2069 16.1024C95.2069 21.4157 98.8086 25.16 103.837 25.16C106.404 25.16 108.365 24.3398 110.077 22.8421C110.255 22.6638 110.362 22.4855 110.362 22.2359C110.362 21.7723 110.041 21.4513 109.614 21.4513C109.435 21.4513 109.257 21.487 109.15 21.594C107.688 22.9134 105.941 23.5553 103.979 23.5553C99.914 23.5553 97.4179 20.4529 97.2396 16.7086H110.541C111.254 16.7086 111.646 16.3163 111.646 15.6745C111.646 11.2526 108.758 7.08043 103.516 7.08043C98.7373 7.08043 95.2069 11.11 95.2069 16.1024ZM103.48 8.68513C107.795 8.68513 109.72 12.3224 109.756 15.2465H97.2396C97.3822 12.2511 99.4148 8.68513 103.48 8.68513Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M117.365 24.839C117.865 24.839 118.293 24.4111 118.293 23.9119V1.76712C118.293 1.26788 117.865 0.839966 117.365 0.839966C116.866 0.839966 116.438 1.26788 116.438 1.76712V23.9119C116.438 24.4111 116.866 24.839 117.365 24.839Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M0.292684 8.54331C-0.0977248 8.15267 -0.0975372 7.5195 0.293103 7.1291L5.44967 1.97558C5.47463 1.95063 5.4999 1.92606 5.52546 1.90187L5.52289 1.8993C6.03155 1.39065 6.65771 1.07111 7.314 0.9407C7.59976 0.874273 7.89433 0.839967 8.19243 0.839967L20.12 0.839966C22.2629 0.839967 24 2.5771 24 4.71997V16.6435C24 16.9198 23.9705 17.1931 23.9133 17.4591C23.7914 18.1347 23.4693 18.7813 22.9471 19.3035L22.9458 19.3022C22.9189 19.3309 22.8915 19.3592 22.8636 19.3871L17.7071 24.5435C17.3166 24.934 16.6834 24.934 16.2929 24.5435C15.9024 24.153 15.9024 23.5198 16.2929 23.1293L21.4494 17.9728C21.6986 17.7236 21.8706 17.4116 21.9501 17.074C22.0233 16.6182 21.8843 16.1349 21.5329 15.7835L9.06289 3.31352C8.70098 2.95161 8.20044 2.81283 7.73221 2.89716C7.40619 2.97949 7.10531 3.14852 6.86347 3.39021L1.7069 8.54373C1.31626 8.93414 0.683092 8.93395 0.292684 8.54331ZM11.4178 2.83997L22 13.4222V4.71997C22 3.68167 21.1583 2.83997 20.12 2.83997L11.4178 2.83997Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M0.292893 24.5435C-0.0976311 24.153 -0.0976311 23.5198 0.292893 23.1293L9.29289 14.1293C9.68342 13.7388 10.3166 13.7388 10.7071 14.1293C11.0976 14.5198 11.0976 15.153 10.7071 15.5435L1.70711 24.5435C1.31658 24.934 0.683417 24.934 0.292893 24.5435Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.4 KiB |
+17
-1
@@ -1,6 +1,22 @@
|
||||
import { create } from "@storybook/theming";
|
||||
import logoUrl from "./public/logo.svg";
|
||||
|
||||
export default create({
|
||||
brandImage: logoUrl,
|
||||
base: "light",
|
||||
brandTitle: "NAV Designsystem",
|
||||
// Typography
|
||||
fontBase: '"Source Sans Pro", sans-serif',
|
||||
fontCode: "monospace",
|
||||
|
||||
// Text colors
|
||||
textColor: "#262626",
|
||||
textInverseColor: "rgba(255,255,255,0.9)",
|
||||
|
||||
colorSecondary: "rgba(0, 36, 58, 1)",
|
||||
colorPrimary: "rgba(153, 196, 221, 1)",
|
||||
|
||||
barTextColor: "rgba(0, 91, 130, 1)",
|
||||
barSelectedColor: "rgba(0, 36, 58, 1)",
|
||||
|
||||
brandTitle: "Aksel",
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = (baseConfig) => {
|
||||
baseConfig.config.module.rules.push({
|
||||
test: /\.css$/,
|
||||
use: ["style-loader", "css-loader"],
|
||||
include: [
|
||||
path.resolve(__dirname, "../node_modules/@navikt/core/css/index.css"),
|
||||
],
|
||||
});
|
||||
baseConfig.config.resolve.alias = {
|
||||
...baseConfig.config.resolve.alias,
|
||||
"./normalize.css": path.resolve(
|
||||
__dirname,
|
||||
"../node_modules/normalize.css/normalize.css"
|
||||
),
|
||||
"./@navikt/ds-tokens": path.resolve(
|
||||
__dirname,
|
||||
"../node_modules/@navikt/ds-tokens/dist/tokens.css"
|
||||
),
|
||||
};
|
||||
|
||||
return baseConfig.config;
|
||||
};
|
||||
@@ -1,3 +1,5 @@
|
||||
enableImmutableInstalls: false
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
*.d.ts
|
||||
*.js
|
||||
bin/*.js
|
||||
*.js.map
|
||||
!transforms/**/__testfixtures__/**/*.js
|
||||
!transforms/**/tests/**/*.output.js
|
||||
!transforms/**/tests/**/*.input.js
|
||||
transforms/**/tests/**/*.test.js
|
||||
!jest.config.js
|
||||
@@ -0,0 +1,125 @@
|
||||
# @navikt/ds-codemod
|
||||
|
||||
## 2.6.1
|
||||
|
||||
## 2.6.0
|
||||
|
||||
## 2.5.1
|
||||
|
||||
## 2.5.0
|
||||
|
||||
## 2.4.3
|
||||
|
||||
## 2.4.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#1823](https://github.com/navikt/aksel/pull/1823) [`a7ce61f84`](https://github.com/navikt/aksel/commit/a7ce61f840e5bfaafc4f70e550167fe0095555b8) Thanks [@kschieren](https://github.com/kschieren)! - added support for nested lists
|
||||
|
||||
## 2.4.1
|
||||
|
||||
## 2.4.0
|
||||
|
||||
## 2.3.1
|
||||
|
||||
## 2.3.0
|
||||
|
||||
## 2.2.0
|
||||
|
||||
## 2.1.7
|
||||
|
||||
## 2.1.6
|
||||
|
||||
## 2.1.5
|
||||
|
||||
## 2.1.4
|
||||
|
||||
## 2.1.3
|
||||
|
||||
## 2.1.2
|
||||
|
||||
## 2.1.1
|
||||
|
||||
## 2.1.0
|
||||
|
||||
## 2.0.18
|
||||
|
||||
## 2.0.17
|
||||
|
||||
## 2.0.16
|
||||
|
||||
## 2.0.15
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
## 2.0.12
|
||||
|
||||
## 2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
## 2.0.2
|
||||
|
||||
## 2.0.1
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- [`6b96e4833`](https://github.com/navikt/aksel/commit/6b96e48330c2e013a1acee85cefccd9ccc1aece4) Thanks [@KenAJoh](https://github.com/KenAJoh)! - v2: Tokens update and font-loading
|
||||
|
||||
## 1.5.10
|
||||
|
||||
## 1.5.9
|
||||
|
||||
## 1.5.8
|
||||
|
||||
## 1.5.7
|
||||
|
||||
## 1.5.6
|
||||
|
||||
## 1.5.5
|
||||
|
||||
## 1.5.4
|
||||
|
||||
## 1.5.3
|
||||
|
||||
## 1.5.2
|
||||
|
||||
## 1.5.1
|
||||
|
||||
## 1.5.0
|
||||
|
||||
## 1.4.4
|
||||
|
||||
## 1.4.3
|
||||
|
||||
## 1.4.2
|
||||
|
||||
## 1.4.1
|
||||
|
||||
## 1.4.0
|
||||
|
||||
## 1.3.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [`40f0b3340`](https://github.com/navikt/aksel/commit/40f0b3340d01bf85fecc04f2f3a8e8b2acf996f1) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Bump for latest-tag
|
||||
|
||||
## 1.3.38
|
||||
@@ -0,0 +1,170 @@
|
||||
# Aksel Codemods
|
||||
|
||||
Collection of Codemods for easier migration between breaking changes in NAVs designsystem-packages.
|
||||
|
||||
## Usage
|
||||
|
||||
Codemod runs code-transformations programmatically in your project. This helps when migrating breaking changes without spending hours doing it manually.
|
||||
|
||||
NOTE: This codemod only supports fairly "default" usage of components. Components used with dynamic imports, styled-components, non-default imports (ex `import * as DS from "@navikt/ds-react"` or `from "@navikt/ds-react/cjs"`) can lead to bugs when using codemod.
|
||||
|
||||
```javascript
|
||||
npx @navikt/ds-codemod <migration> <path>
|
||||
```
|
||||
|
||||
migraton - name of migraton, see available migraton below.
|
||||
|
||||
path - files or directory to transform
|
||||
|
||||
```sh
|
||||
--dry Do a dry-run, no code will be edited
|
||||
--print Prints the changed output for comparison
|
||||
--force Runs even if there are uncommited changes (use with caution)
|
||||
```
|
||||
|
||||
## V1 -> V2
|
||||
|
||||
V2.0.0 updated the token-prefix of all tokens + names of all semantic-colors. The migrations below helps when migrating from the formats css, scss, less and js.
|
||||
|
||||
### css-tokens (--navds format)
|
||||
|
||||
`npx @navikt/ds-codemod v2/css src`
|
||||
|
||||
When having redefined a token, you will need to manually find and replace these instances after the codemod-run. A global search for `--v2-migration__` will show all found instances where you had redefined a token.
|
||||
|
||||
```diff
|
||||
.example{
|
||||
- color: var(--navds-global-color-gray-900);
|
||||
+ color: var(--a-gray-900);
|
||||
|
||||
- --navds-semantic-color-text: red;
|
||||
+ --v2-migration__navds-semantic-color-text: red;
|
||||
}
|
||||
```
|
||||
|
||||
### sass/scss-tokens ($navds format)
|
||||
|
||||
`npx @navikt/ds-codemod v2/sass src`
|
||||
|
||||
```diff
|
||||
.example{
|
||||
- color: $navds-global-color-gray-900;
|
||||
+ color: $a-gray-900;
|
||||
}
|
||||
```
|
||||
|
||||
### less-tokens (@navds format)
|
||||
|
||||
`npx @navikt/ds-codemod v2/less src`
|
||||
|
||||
```diff
|
||||
.example{
|
||||
- color: @navds-global-color-gray-900;
|
||||
+ color: @a-gray-900;
|
||||
}
|
||||
```
|
||||
|
||||
### js-tokens
|
||||
|
||||
`npx @navikt/ds-codemod v2/js src`
|
||||
|
||||
```diff
|
||||
|
||||
- import { NavdsGlobalColorGray900 } from "@navikt/ds-tokens";
|
||||
+ import { AGray900 } from "@navikt/ds-tokens";
|
||||
|
||||
const styled = styled.p`
|
||||
- color: ${NavdsGlobalColorGray900};
|
||||
+ color: ${AGray900};
|
||||
`
|
||||
```
|
||||
|
||||
## Beta (0.19.x) -> v1
|
||||
|
||||
`npx @navikt/ds-codemod v1/preset src`
|
||||
|
||||
### preset
|
||||
|
||||
Combines all avaliable codemods for migrating from beta -> v1. This transform should only be ran once.
|
||||
|
||||
Includes these transforms
|
||||
|
||||
- v1/tabs
|
||||
- v1/chat
|
||||
- v1/pagination
|
||||
|
||||
### tabs
|
||||
|
||||
`npx @navikt/ds-codemod v1/tabs src`
|
||||
|
||||
```diff
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
- loop
|
||||
+ iconPosition="left"
|
||||
>
|
||||
<Tabs.List
|
||||
- loop
|
||||
>
|
||||
<Tabs.Tab
|
||||
value="logg"
|
||||
label="logg"
|
||||
- iconPosition="left"
|
||||
/>
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
```
|
||||
|
||||
### chat
|
||||
|
||||
`npx @navikt/ds-codemodmod v1/chat src`
|
||||
|
||||
```diff
|
||||
-<SpeechBubble
|
||||
+<Chat
|
||||
- illustration={<Illustration />}
|
||||
- topText="Ola Normann 01.01.21 14:00"
|
||||
- illustrationBgColor="blue"
|
||||
+ avatar={<Illustration />}
|
||||
+ name="Ola Normann 01.01.21 14:00"
|
||||
+ avatarBgColor="blue"
|
||||
backgroundColor="red"
|
||||
>
|
||||
- <SpeechBubble.Bubble>
|
||||
+ <Chat.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
- </SpeechBubble.Bubble>
|
||||
+ </Chat.Bubble>
|
||||
-</SpeechBubble>
|
||||
+</Chat>
|
||||
```
|
||||
|
||||
### pagination
|
||||
|
||||
`npx @navikt/ds-codemod v1/pagination src`
|
||||
|
||||
This codemod should only be ran once, since the size-scale will keep decreasing for each subsequent iteration.
|
||||
|
||||
```diff
|
||||
-<Pagiation />
|
||||
+<Pagiation size="small"/>
|
||||
|
||||
-<Pagiation size="medium"/>
|
||||
+<Pagiation size="small"/>
|
||||
|
||||
-<Pagiation size="small"/>
|
||||
+<Pagiation size="xsmall"/>
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/navikt/aksel/blob/main/LICENCE)
|
||||
|
||||
#
|
||||
|
||||
Inspired by both MUI and NEXT
|
||||
|
||||
- [NEXT](https://nextjs.org/docs/advanced-features/codemods)
|
||||
- [MUI](https://github.com/mui/material-ui/tree/master/packages/mui-codemod)
|
||||
@@ -0,0 +1,36 @@
|
||||
import meow, { AnyFlags } from "meow";
|
||||
|
||||
import { migrate } from "./migrate";
|
||||
import { cliConfig } from "./config";
|
||||
|
||||
const help = `
|
||||
Usage
|
||||
$ npx @navikt/ds-codemod ${cliConfig.args
|
||||
.map((arg) => `<${arg.name}>`)
|
||||
.join(" ")}
|
||||
${cliConfig.args.map((arg) => `${arg.name}\t${arg.description}`).join("\n ")}
|
||||
Options
|
||||
${Object.entries(cliConfig.flags)
|
||||
.map(([name, val]: [string, any]) => `--${name}\t${val.description}`)
|
||||
.join("\n ")}
|
||||
`;
|
||||
|
||||
const { input, flags } = meow({
|
||||
description: cliConfig.description,
|
||||
flags: Object.fromEntries(
|
||||
Object.entries(cliConfig.flags).map(
|
||||
([name, flag]: [string, any]): [string, AnyFlags] => [
|
||||
name,
|
||||
{
|
||||
alias: flag.alias,
|
||||
type: flag.type,
|
||||
},
|
||||
]
|
||||
)
|
||||
),
|
||||
help,
|
||||
});
|
||||
|
||||
export async function run() {
|
||||
await migrate(input[0], input[1], flags);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
const createCLIConfig = (config: any) => config;
|
||||
|
||||
export const cliConfig = createCLIConfig({
|
||||
description: "Migrations for NAV designsystem solutions",
|
||||
args: [
|
||||
{
|
||||
name: "migration",
|
||||
description:
|
||||
"One of the choices from https://github.com/navikt/aksel/blob/main/%40navikt/codemod/README.md",
|
||||
},
|
||||
{
|
||||
name: "path",
|
||||
description:
|
||||
"Files or directory to transform. Can be a glob like src/**.css",
|
||||
},
|
||||
],
|
||||
flags: {
|
||||
dry: {
|
||||
alias: "d",
|
||||
description: "Dry run, no changes will be made to files",
|
||||
type: "boolean",
|
||||
},
|
||||
print: {
|
||||
alias: "p",
|
||||
description: "Print transformed files",
|
||||
type: "boolean",
|
||||
},
|
||||
force: {
|
||||
alias: "f",
|
||||
description: "Forcibly run migrations without checking git-changes",
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const DS_MIGRATION_COMMENT =
|
||||
"ds-codemod: Unable to migrate the following expression. Please upgrade manually.";
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const { run } = require("./cli");
|
||||
|
||||
run();
|
||||
@@ -0,0 +1,140 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
import * as jscodeshift from "jscodeshift/src/Runner";
|
||||
import chalk from "chalk";
|
||||
import isGitClean from "is-git-clean";
|
||||
import globby from "globby";
|
||||
|
||||
export interface MigrateOptions {
|
||||
dry?: boolean;
|
||||
print?: boolean;
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
const migrationsMap = [
|
||||
{
|
||||
name: "v1/preset: Runs all codemods for beta to v1 migration",
|
||||
value: "v1/preset",
|
||||
path: "v1.0.0/preset",
|
||||
},
|
||||
{
|
||||
name: "v1/pagination: Fixes breaking API-changes from <Pagination /> component",
|
||||
value: "v1/pagination",
|
||||
path: "v1.0.0/pagination",
|
||||
},
|
||||
{
|
||||
name: "v1/tabs: Fixes breaking API-changes from <Tabs /> component",
|
||||
value: "v1/tabs",
|
||||
path: "v1.0.0/tabs",
|
||||
},
|
||||
{
|
||||
name: "v1/chat: Fixes breaking API-changes from <SpeechBubble /> (now <Chat/>) component",
|
||||
value: "v1/chat",
|
||||
path: "v1.0.0/chat",
|
||||
},
|
||||
{
|
||||
name: "v2/css: Fixes css-variables",
|
||||
value: "v2/css",
|
||||
path: "v2.0.0/update-css-tokens/update-css-tokens",
|
||||
},
|
||||
{
|
||||
name: "v2/js: Fixes js-variables",
|
||||
value: "v2/js",
|
||||
path: "v2.0.0/update-js-tokens/update-js-tokens",
|
||||
},
|
||||
{
|
||||
name: "v2/sass: Fixes sass-variables",
|
||||
value: "v2/sass",
|
||||
path: "v2.0.0/update-sass-tokens/update-sass-tokens",
|
||||
},
|
||||
{
|
||||
name: "v2/less: Fixes less-variables",
|
||||
value: "v2/less",
|
||||
path: "v2.0.0/update-less-tokens/update-less-tokens",
|
||||
},
|
||||
];
|
||||
|
||||
export async function migrate(
|
||||
migration: string,
|
||||
files: string,
|
||||
options: MigrateOptions = {}
|
||||
) {
|
||||
const foundMigration = migrationsMap.find((x) => x.value === migration);
|
||||
const migrationFile = path.join(
|
||||
__dirname,
|
||||
`../transforms/${foundMigration.path}.js`
|
||||
);
|
||||
|
||||
try {
|
||||
if (!fs.existsSync(migrationFile)) {
|
||||
throw new Error(`No migration found for ${migration}`);
|
||||
}
|
||||
|
||||
if (!files) throw new Error(`No path provided for migration`);
|
||||
|
||||
if (!options.dry) {
|
||||
checkGitStatus(options.force);
|
||||
}
|
||||
|
||||
const filepaths = globby.sync(files, { cwd: process.cwd() });
|
||||
|
||||
if (filepaths.length === 0) {
|
||||
throw new Error(`No files found for ${files}`);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(chalk.green("Running migration:"), migration);
|
||||
|
||||
await jscodeshift.run(migrationFile, filepaths, {
|
||||
babel: true,
|
||||
ignorePattern: [
|
||||
"**/node_modules/**",
|
||||
"**/.next/**",
|
||||
"**/build/**",
|
||||
"**/dist/**",
|
||||
],
|
||||
extensions: "tsx,ts,jsx,js",
|
||||
parser: "tsx",
|
||||
verbose: 2,
|
||||
runInBand: true,
|
||||
silent: false,
|
||||
stdin: false,
|
||||
...options,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export function checkGitStatus(force?: boolean) {
|
||||
let clean = false;
|
||||
let errorMessage = "Unable to determine if git directory is clean";
|
||||
try {
|
||||
clean = isGitClean.sync(process.cwd());
|
||||
errorMessage = "Git directory is not clean";
|
||||
} catch (err: any) {
|
||||
if (err && err.stderr && err.stderr.indexOf("Not a git repository") >= 0) {
|
||||
clean = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!clean) {
|
||||
/* eslint-disable no-console */
|
||||
if (force) {
|
||||
console.log(`WARNING: ${errorMessage}. Forcibly continuing.`);
|
||||
} else {
|
||||
console.log("Thank you for using @navikt/ds-codemod!");
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
"\nBut before we continue, please stash or commit your git changes."
|
||||
)
|
||||
);
|
||||
console.log(
|
||||
"\nYou may use the --force flag to override this safety check."
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { deleteSync } from "del";
|
||||
|
||||
deleteSync([
|
||||
"utils/**/*.js",
|
||||
"bin/**/*.js",
|
||||
"transforms/**/*.js",
|
||||
"!transforms/**/__testfixtures__",
|
||||
"!transforms/**/tests/*.input.*",
|
||||
"!transforms/**/tests/*.output.*",
|
||||
]);
|
||||
@@ -0,0 +1,8 @@
|
||||
const customJestConfig = {
|
||||
testMatch: ["**/__tests__/**/*.js", "**/tests/*.test.js"],
|
||||
verbose: true,
|
||||
rootDir: "./transforms",
|
||||
};
|
||||
|
||||
// createJestConfig is exported in this way to ensure that next/jest can load the Next.js config which is async
|
||||
module.exports = customJestConfig;
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "@navikt/ds-codemod",
|
||||
"version": "2.6.1",
|
||||
"description": "Aksel codemods for NAVs designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"react",
|
||||
"codemod",
|
||||
"jscodeshift"
|
||||
],
|
||||
"files": [
|
||||
"transforms/**/*.js",
|
||||
"utils/**/*.js",
|
||||
"bin/*.js",
|
||||
"lib/**/*.js",
|
||||
"lib/cra-to-next/gitignore",
|
||||
"tokens-map.mjs"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "yarn clean && tsc -p tsconfig.json",
|
||||
"dev": "yarn clean && tsc --watch -p tsconfig.json",
|
||||
"start": "./bin/cli.js",
|
||||
"test": "yarn build && jest",
|
||||
"test:watch": "jest --watch",
|
||||
"clean": "node clean.mjs"
|
||||
},
|
||||
"bin": "./bin/ds-codemod.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/navikt/aksel.git",
|
||||
"directory": "@navikt/codemod"
|
||||
},
|
||||
"homepage": "https://github.com/navikt/aksel/tree/main/@navikt/codemod",
|
||||
"dependencies": {
|
||||
"chalk": "4.1.0",
|
||||
"cheerio": "1.0.0-rc.9",
|
||||
"execa": "4.0.3",
|
||||
"globby": "11.0.1",
|
||||
"inquirer": "7.3.3",
|
||||
"is-git-clean": "1.1.0",
|
||||
"jest": "^29.0.0",
|
||||
"jscodeshift": "0.13.1",
|
||||
"jscodeshift-add-imports": "1.0.10",
|
||||
"lodash": "4.17.21",
|
||||
"meow": "7.0.1",
|
||||
"prettier": "2.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/jscodeshift": "0.11.5",
|
||||
"@types/react": "^18.0.0",
|
||||
"del": "7.0.0",
|
||||
"typescript": "^4.8.0"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
/* prettier-ignore */
|
||||
const tokens = [
|
||||
["--navds-semantic-color-text-inverted", "--a-text-on-inverted"],
|
||||
["--navds-semantic-color-text-muted", "--a-text-subtle"],
|
||||
["--navds-semantic-color-text", "--a-text-default"],
|
||||
["--navds-semantic-color-feedback-danger-text", "--a-text-danger"],
|
||||
["--navds-semantic-color-link-visited", "--a-text-visited"],
|
||||
["--navds-semantic-color-link", "--a-text-action"],
|
||||
["--navds-spacing-32", "--a-spacing-32"],
|
||||
["--navds-spacing-24", "--a-spacing-24"],
|
||||
["--navds-spacing-20", "--a-spacing-20"],
|
||||
["--navds-spacing-18", "--a-spacing-18"],
|
||||
["--navds-spacing-16", "--a-spacing-16"],
|
||||
["--navds-spacing-14", "--a-spacing-14"],
|
||||
["--navds-spacing-12", "--a-spacing-12"],
|
||||
["--navds-spacing-11", "--a-spacing-11"],
|
||||
["--navds-spacing-10", "--a-spacing-10"],
|
||||
["--navds-spacing-9", "--a-spacing-9"],
|
||||
["--navds-spacing-8", "--a-spacing-8"],
|
||||
["--navds-spacing-7", "--a-spacing-7"],
|
||||
["--navds-spacing-6", "--a-spacing-6"],
|
||||
["--navds-spacing-5", "--a-spacing-5"],
|
||||
["--navds-spacing-4", "--a-spacing-4"],
|
||||
["--navds-spacing-3", "--a-spacing-3"],
|
||||
["--navds-spacing-2", "--a-spacing-2"],
|
||||
["--navds-spacing-1", "--a-spacing-1"],
|
||||
["--navds-global-color-purple-900", "--a-purple-900"],
|
||||
["--navds-global-color-purple-800", "--a-purple-800"],
|
||||
["--navds-global-color-purple-700", "--a-purple-700"],
|
||||
["--navds-global-color-purple-600", "--a-purple-600"],
|
||||
["--navds-global-color-purple-500", "--a-purple-500"],
|
||||
["--navds-global-color-purple-400", "--a-purple-400"],
|
||||
["--navds-global-color-purple-300", "--a-purple-300"],
|
||||
["--navds-global-color-purple-200", "--a-purple-200"],
|
||||
["--navds-global-color-purple-100", "--a-purple-100"],
|
||||
["--navds-global-color-purple-50", "--a-purple-50"],
|
||||
["--navds-global-color-orange-900", "--a-orange-900"],
|
||||
["--navds-global-color-orange-800", "--a-orange-800"],
|
||||
["--navds-global-color-orange-700", "--a-orange-700"],
|
||||
["--navds-global-color-orange-600", "--a-orange-600"],
|
||||
["--navds-global-color-orange-500", "--a-orange-500"],
|
||||
["--navds-global-color-orange-400", "--a-orange-400"],
|
||||
["--navds-global-color-orange-300", "--a-orange-300"],
|
||||
["--navds-global-color-orange-200", "--a-orange-200"],
|
||||
["--navds-global-color-orange-100", "--a-orange-100"],
|
||||
["--navds-global-color-orange-50", "--a-orange-50"],
|
||||
["--navds-global-color-limegreen-900", "--a-limegreen-900"],
|
||||
["--navds-global-color-limegreen-800", "--a-limegreen-800"],
|
||||
["--navds-global-color-limegreen-700", "--a-limegreen-700"],
|
||||
["--navds-global-color-limegreen-600", "--a-limegreen-600"],
|
||||
["--navds-global-color-limegreen-500", "--a-limegreen-500"],
|
||||
["--navds-global-color-limegreen-400", "--a-limegreen-400"],
|
||||
["--navds-global-color-limegreen-300", "--a-limegreen-300"],
|
||||
["--navds-global-color-limegreen-200", "--a-limegreen-200"],
|
||||
["--navds-global-color-limegreen-100", "--a-limegreen-100"],
|
||||
["--navds-global-color-limegreen-50", "--a-limegreen-50"],
|
||||
["--navds-global-color-lightblue-900", "--a-lightblue-900"],
|
||||
["--navds-global-color-lightblue-800", "--a-lightblue-800"],
|
||||
["--navds-global-color-lightblue-700", "--a-lightblue-700"],
|
||||
["--navds-global-color-lightblue-600", "--a-lightblue-600"],
|
||||
["--navds-global-color-lightblue-500", "--a-lightblue-500"],
|
||||
["--navds-global-color-lightblue-400", "--a-lightblue-400"],
|
||||
["--navds-global-color-lightblue-300", "--a-lightblue-300"],
|
||||
["--navds-global-color-lightblue-200", "--a-lightblue-200"],
|
||||
["--navds-global-color-lightblue-100", "--a-lightblue-100"],
|
||||
["--navds-global-color-lightblue-50", "--a-lightblue-50"],
|
||||
["--navds-global-color-green-900", "--a-green-900"],
|
||||
["--navds-global-color-green-800", "--a-green-800"],
|
||||
["--navds-global-color-green-700", "--a-green-700"],
|
||||
["--navds-global-color-green-600", "--a-green-600"],
|
||||
["--navds-global-color-green-500", "--a-green-500"],
|
||||
["--navds-global-color-green-400", "--a-green-400"],
|
||||
["--navds-global-color-green-300", "--a-green-300"],
|
||||
["--navds-global-color-green-200", "--a-green-200"],
|
||||
["--navds-global-color-green-100", "--a-green-100"],
|
||||
["--navds-global-color-green-50", "--a-green-50"],
|
||||
["--navds-global-color-deepblue-900", "--a-deepblue-900"],
|
||||
["--navds-global-color-deepblue-800", "--a-deepblue-800"],
|
||||
["--navds-global-color-deepblue-700", "--a-deepblue-700"],
|
||||
["--navds-global-color-deepblue-600", "--a-deepblue-600"],
|
||||
["--navds-global-color-deepblue-500", "--a-deepblue-500"],
|
||||
["--navds-global-color-deepblue-400", "--a-deepblue-400"],
|
||||
["--navds-global-color-deepblue-300", "--a-deepblue-300"],
|
||||
["--navds-global-color-deepblue-200", "--a-deepblue-200"],
|
||||
["--navds-global-color-deepblue-100", "--a-deepblue-100"],
|
||||
["--navds-global-color-deepblue-50", "--a-deepblue-50"],
|
||||
["--navds-global-color-red-900", "--a-red-900"],
|
||||
["--navds-global-color-red-800", "--a-red-800"],
|
||||
["--navds-global-color-red-700", "--a-red-700"],
|
||||
["--navds-global-color-red-600", "--a-red-600"],
|
||||
["--navds-global-color-red-500", "--a-red-500"],
|
||||
["--navds-global-color-red-400", "--a-red-400"],
|
||||
["--navds-global-color-red-300", "--a-red-300"],
|
||||
["--navds-global-color-red-200", "--a-red-200"],
|
||||
["--navds-global-color-red-100", "--a-red-100"],
|
||||
["--navds-global-color-red-50", "--a-red-50"],
|
||||
["--navds-global-color-blue-900", "--a-blue-900"],
|
||||
["--navds-global-color-blue-800", "--a-blue-800"],
|
||||
["--navds-global-color-blue-700", "--a-blue-700"],
|
||||
["--navds-global-color-blue-600", "--a-blue-600"],
|
||||
["--navds-global-color-blue-500", "--a-blue-500"],
|
||||
["--navds-global-color-blue-400", "--a-blue-400"],
|
||||
["--navds-global-color-blue-300", "--a-blue-300"],
|
||||
["--navds-global-color-blue-200", "--a-blue-200"],
|
||||
["--navds-global-color-blue-100", "--a-blue-100"],
|
||||
["--navds-global-color-blue-50", "--a-blue-50"],
|
||||
["--navds-global-color-gray-900", "--a-gray-900"],
|
||||
["--navds-global-color-gray-800", "--a-gray-800"],
|
||||
["--navds-global-color-gray-700", "--a-gray-700"],
|
||||
["--navds-global-color-gray-600", "--a-gray-600"],
|
||||
["--navds-global-color-gray-500", "--a-gray-500"],
|
||||
["--navds-global-color-gray-400", "--a-gray-400"],
|
||||
["--navds-global-color-gray-300", "--a-gray-300"],
|
||||
["--navds-global-color-gray-200", "--a-gray-200"],
|
||||
["--navds-global-color-gray-100", "--a-gray-100"],
|
||||
["--navds-global-color-gray-50", "--a-gray-50"],
|
||||
["--navds-global-color-nav-red", "--a-nav-red"],
|
||||
["--navds-global-color-white", "--a-white"],
|
||||
["--navds-global-color-transparent", "--a-transparent"],
|
||||
["--navds-border-radius-full", "--a-border-radius-full"],
|
||||
["--navds-border-radius-xlarge", "--a-border-radius-xlarge"],
|
||||
["--navds-border-radius-large", "--a-border-radius-large"],
|
||||
["--navds-border-radius-medium", "--a-border-radius-medium"],
|
||||
["--navds-border-radius-small", "--a-border-radius-small"],
|
||||
["--navds-z-index-tooltip", "--a-z-index-tooltip"],
|
||||
["--navds-z-index-focus", "--a-z-index-focus"],
|
||||
["--navds-z-index-popover", "--a-z-index-popover"],
|
||||
["--navds-z-index-modal", "--a-z-index-modal"],
|
||||
["--navds-font-weight-regular", "--a-font-weight-regular"],
|
||||
["--navds-font-weight-bold", "--a-font-weight-bold"],
|
||||
["--navds-font-size-small", "--a-font-size-small"],
|
||||
["--navds-font-size-medium", "--a-font-size-medium"],
|
||||
["--navds-font-size-large", "--a-font-size-large"],
|
||||
["--navds-font-size-xlarge", "--a-font-size-xlarge"],
|
||||
["--navds-font-size-heading-xsmall", "--a-font-size-heading-xsmall"],
|
||||
["--navds-font-size-heading-small", "--a-font-size-heading-small"],
|
||||
["--navds-font-size-heading-medium", "--a-font-size-heading-medium"],
|
||||
["--navds-font-size-heading-large", "--a-font-size-heading-large"],
|
||||
["--navds-font-size-heading-xlarge", "--a-font-size-heading-xlarge"],
|
||||
["--navds-font-size-heading-2xlarge", "--a-font-size-heading-2xlarge"],
|
||||
["--navds-font-line-height-medium", "--a-font-line-height-medium"],
|
||||
["--navds-font-line-height-large", "--a-font-line-height-large"],
|
||||
["--navds-font-line-height-xlarge", "--a-font-line-height-xlarge"],
|
||||
["--navds-font-line-height-heading-xsmall","--a-font-line-height-heading-xsmall"],
|
||||
["--navds-font-line-height-heading-small","--a-font-line-height-heading-small"],
|
||||
["--navds-font-line-height-heading-medium","--a-font-line-height-heading-medium"],
|
||||
["--navds-font-line-height-heading-large","--a-font-line-height-heading-large"],
|
||||
["--navds-font-line-height-heading-xlarge","--a-font-line-height-heading-xlarge"],
|
||||
["--navds-font-line-height-heading-2xlarge","--a-font-line-height-heading-2xlarge"],
|
||||
["--navds-font-family", "--a-font-family"],
|
||||
|
||||
["--navds-semantic-color-feedback-info-icon", "--a-icon-info"],
|
||||
["--navds-semantic-color-feedback-warning-icon", "--a-icon-warning"],
|
||||
["--navds-semantic-color-feedback-danger-icon", "--a-icon-danger"],
|
||||
["--navds-semantic-color-feedback-success-icon", "--a-icon-success"],
|
||||
|
||||
["--navds-semantic-color-feedback-info-background", "--a-surface-info-subtle"],
|
||||
["--navds-semantic-color-feedback-warning-background", "--a-surface-warning-subtle"],
|
||||
["--navds-semantic-color-interaction-danger-selected", "--a-surface-danger-active"],
|
||||
["--navds-semantic-color-interaction-danger-hover", "--a-surface-danger-hover"],
|
||||
["--navds-semantic-color-interaction-danger", "--a-surface-danger"],
|
||||
["--navds-semantic-color-feedback-danger-background", "--a-surface-danger-subtle"],
|
||||
["--navds-semantic-color-feedback-success-background", "--a-surface-success-subtle"],
|
||||
["--navds-semantic-color-interaction-primary-hover-subtle","--a-surface-action-subtle-hover"],
|
||||
["--navds-semantic-color-interaction-primary-selected","--a-surface-action-selected"],
|
||||
["--navds-semantic-color-interaction-primary-hover","--a-surface-action-hover"],
|
||||
["--navds-semantic-color-interaction-primary", "--a-surface-action"],
|
||||
["--navds-semantic-color-canvas-background-inverted", "--a-surface-inverted"],
|
||||
["--navds-semantic-color-component-background-inverted", "--a-surface-inverted"],
|
||||
["--navds-semantic-color-component-background-alternate", "--a-surface-subtle"],
|
||||
["--navds-semantic-color-component-background-light", "--a-surface-default"],
|
||||
["--navds-semantic-color-canvas-background-light", "--a-bg-default"],
|
||||
["--navds-semantic-color-canvas-background", "--a-bg-subtle"],
|
||||
["--navds-semantic-color-border-inverted", "--a-border-on-inverted"],
|
||||
["--navds-semantic-color-border-muted", "--a-border-default"],
|
||||
["--navds-semantic-color-border", "--a-border-strong"],
|
||||
["--navds-semantic-color-focus-inverted", "--a-border-focus-on-inverted"],
|
||||
["--navds-semantic-color-focus", "--a-border-focus"],
|
||||
["--navds-semantic-color-feedback-info-border", "--a-border-info"],
|
||||
["--navds-semantic-color-feedback-warning-border", "--a-border-warning"],
|
||||
["--navds-semantic-color-feedback-danger-border", "--a-border-danger"],
|
||||
["--navds-semantic-color-feedback-success-border", "--a-border-success"],
|
||||
["--navds-semantic-color-divider", "--a-border-divider"],
|
||||
["--navds-shadow-focus-inverted", "--a-shadow-focus-inverted"],
|
||||
["--navds-shadow-focus", "--a-shadow-focus"],
|
||||
["--navds-shadow-xsmall", "--a-shadow-xsmall"],
|
||||
["--navds-shadow-small", "--a-shadow-small"],
|
||||
["--navds-shadow-medium", "--a-shadow-medium"],
|
||||
["--navds-shadow-large", "--a-shadow-large"],
|
||||
["--navds-shadow-xlarge", "--a-shadow-xlarge"],
|
||||
|
||||
/* Components */
|
||||
["--navds-modal-color-overlay", "--a-surface-backdrop"],
|
||||
["--navds-accordion-color-border", "--a-border-strong"],
|
||||
["--navds-accordion-color-text-hover", "--a-surface-action"],
|
||||
["--navds-accordion-color-border-hover", "--a-surface-action"],
|
||||
["--navds-accordion-color-background-open", "--a-surface-action-subtle"],
|
||||
["--navds-alert-color-error-border", "--a-border-danger"],
|
||||
["--navds-alert-color-error-background", "--a-surface-danger-subtle"],
|
||||
["--navds-alert-color-warning-border", "--a-border-warning"],
|
||||
["--navds-alert-color-warning-background", "--a-surface-warning-subtle"],
|
||||
["--navds-alert-color-info-border", "--a-border-info"],
|
||||
["--navds-alert-color-info-background", "--a-surface-info-subtle"],
|
||||
["--navds-alert-color-success-border", "--a-border-success"],
|
||||
["--navds-alert-color-success-background", "--a-surface-success-subtle"],
|
||||
["--navds-alert-color-border", "--a-border-default"],
|
||||
["--navds-chat-color-avatar-background", "--a-bg-subtle"],
|
||||
["--navds-chat-color-background", "--a-bg-subtle"],
|
||||
["--navds-chat-color-avatar", "--a-text-default"],
|
||||
["--navds-guide-panel-color-illustration-background", "--a-surface-action-subtle"],
|
||||
["--navds-guide-panel-color-background", "--a-surface-default"],
|
||||
["--navds-guide-panel-color-border", "--a-border-action"],
|
||||
["--navds-error-summary-color-background", "--a-surface-default"],
|
||||
["--navds-error-summary-color-border", "--a-border-danger"],
|
||||
["--navds-confirmation-panel-color-background-checked", "--a-surface-success-subtle"],
|
||||
["--navds-confirmation-panel-color-background-error", "--a-surface-danger-subtle"],
|
||||
["--navds-confirmation-panel-color-border-checked", "--a-border-success"],
|
||||
["--navds-confirmation-panel-color-border-error", "--a-border-danger"],
|
||||
["--navds-confirmation-panel-color-background", "--a-surface-warning-subtle"],
|
||||
["--navds-confirmation-panel-color-border", "--a-border-warning"],
|
||||
["--navds-radio-checkbox-color-background-hover", "--a-surface-action-subtle"],
|
||||
["--navds-radio-checkbox-color-background-checked", "--a-surface-action"],
|
||||
["--navds-radio-checkbox-color-shadow-hover", "--a-surface-action"],
|
||||
["--navds-radio-checkbox-color-shadow-checked", "--a-surface-action"],
|
||||
["--navds-radio-checkbox-color-shadow-error", "--a-surface-danger"],
|
||||
["--navds-radio-checkbox-color-label-hover", "--a-surface-action"],
|
||||
["--navds-radio-checkbox-color-background", "--a-surface-default"],
|
||||
["--navds-radio-checkbox-color-text", "--a-text-default"],
|
||||
["--navds-radio-checkbox-color-shadow", "--a-border-strong"],
|
||||
["--navds-select-color-border-hover", "--a-surface-action"],
|
||||
["--navds-select-color-border-error", "--a-surface-danger"],
|
||||
["--navds-select-color-shadow-error", "--a-surface-danger"],
|
||||
["--navds-select-color-border-disabled","--a-gray-400"],
|
||||
["--navds-select-color-background-disabled", "--a-surface-subtle"],
|
||||
["--navds-switch-color-label-hover", "--a-surface-action"],
|
||||
["--navds-select-color-background", "--a-surface-default"],
|
||||
["--navds-select-color-border", "--a-border-strong"],
|
||||
["--navds-switch-color-label", "--a-text-default"],
|
||||
["--navds-switch-color-track-background-hover-checked", "--a-icon-success"],
|
||||
["--navds-switch-color-track-shadow-inner-focus", "--a-surface-default"],
|
||||
["--navds-switch-color-track-background-checked", "--a-border-success"],
|
||||
["--navds-switch-color-track-background-hover", "--a-surface-neutral-hover"],
|
||||
["--navds-switch-color-track-background", "--a-surface-neutral"],
|
||||
["--navds-switch-color-thumb-icon-checked", "--a-border-success"],
|
||||
["--navds-switch-color-thumb-loader-checked", "--a-border-success"],
|
||||
["--navds-switch-color-thumb-icon", "--a-icon-subtle"],
|
||||
["--navds-switch-color-thumb", "--a-surface-default"],
|
||||
["--navds-textarea-color-counter-text-error", "--a-surface-danger"],
|
||||
["--navds-textarea-color-border-hover", "--a-surface-action"],
|
||||
["--navds-textarea-color-border-error", "--a-surface-danger"],
|
||||
["--navds-textarea-color-shadow-error", "--a-surface-danger"],
|
||||
["--navds-textarea-color-counter-text", "--a-text-subtle"],
|
||||
["--navds-textarea-color-text-disabled", "--a-text-default"],
|
||||
["--navds-textarea-color-border-disabled", "--a-gray-400"],
|
||||
["--navds-textarea-color-background-disabled", "--a-surface-subtle"],
|
||||
["--navds-textarea-color-background", "--a-surface-default"],
|
||||
["--navds-textarea-color-border", "--a-border-strong"],
|
||||
["--navds-help-text-color-popover-background", "--a-surface-info-subtle"],
|
||||
["--navds-help-text-color-background-hover", "--a-surface-action"],
|
||||
["--navds-help-text-color-background-focus", "--a-surface-action"],
|
||||
["--navds-help-text-color-shadow-hover", "--a-surface-action"],
|
||||
["--navds-help-text-color-hover", "--a-surface-default"],
|
||||
["--navds-help-text-color-focus", "--a-surface-default"],
|
||||
["--navds-help-text-color", "--a-surface-action"],
|
||||
["--navds-link-color-text-focus", "--a-text-on-action"],
|
||||
["--navds-link-color-text-active", "--a-text-on-action"],
|
||||
["--navds-link-color-text", "--a-text-action"],
|
||||
["--navds-link-color-icon", "--a-icon-action"],
|
||||
["--navds-link-color-icon-focus", "--a-icon-on-action"],
|
||||
["--navds-link-color-background-focus", "--a-border-focus"],
|
||||
["--navds-link-color-background-active", "--a-border-focus"],
|
||||
["--navds-link-color-on-info-background", "--a-text-default"],
|
||||
["--navds-link-color-on-error-background", "--a-text-default"],
|
||||
["--navds-loader-color-neutral-foreground", "--a-border-default"],
|
||||
["--navds-loader-color-interaction-foreground", "--a-surface-action"],
|
||||
["--navds-loader-color-inverted-foreground", "--a-surface-default"],
|
||||
["--navds-loader-color-transparent-background", "--a-surface-transparent"],
|
||||
["--navds-loader-color-foreground", "--a-border-default"],
|
||||
["--navds-loader-color-background", "--a-surface-active"],
|
||||
["--navds-modal-color-background", "--a-surface-default"],
|
||||
["--navds-pagination-color-text-selected", "--a-text-on-action"],
|
||||
["--navds-pagination-color-background-selected", "--a-surface-action-selected"],
|
||||
["--navds-popover-color-background", "--a-surface-default"],
|
||||
["--navds-popover-color-border", "--a-border-default"],
|
||||
["--navds-tag-color-info-background", "--a-surface-info-subtle"],
|
||||
["--navds-tag-color-info-border", "--a-border-info"],
|
||||
["--navds-tag-color-warning-background", "--a-surface-warning-subtle"],
|
||||
["--navds-tag-color-warning-border", "--a-border-warning"],
|
||||
["--navds-tag-color-success-background", "--a-surface-success-subtle"],
|
||||
["--navds-tag-color-success-border", "--a-border-success"],
|
||||
["--navds-tag-color-error-background", "--a-surface-danger-subtle"],
|
||||
["--navds-tag-color-error-border", "--a-border-danger"],
|
||||
["--navds-tag-color-border", "--a-border-default"],
|
||||
["--navds-tag-color-background", "--a-surface-subtle"],
|
||||
["--navds-toggle-group-color-background-hover", "--a-surface-action-subtle"],
|
||||
["--navds-toggle-group-color-text-hover", "--a-surface-action"],
|
||||
["--navds-toggle-group-color-background-pressed", "--a-surface-action-selected"],
|
||||
["--navds-toggle-group-color-text-pressed", "--a-text-on-action"],
|
||||
["--navds-toggle-group-color-background", "--a-surface-default"],
|
||||
["--navds-toggle-group-color-text", "--a-text-default"],
|
||||
["--navds-toggle-group-color-border", "--a-border-divider"],
|
||||
["--navds-panel-color-background", "--a-surface-default"],
|
||||
["--navds-panel-color-border", "--a-border-default"],
|
||||
["--navds-link-panel-color-border-hover", "--a-surface-action"],
|
||||
["--navds-link-panel-color-title-hover", "--a-text-action"],
|
||||
["--navds-link-panel-color-text", "--a-text-default"],
|
||||
["--navds-table-row-color-background-selected-hover", "--a-surface-action-subtle-hover"],
|
||||
["--navds-table-row-color-background-hover", "--a-bg-subtle"],
|
||||
["--navds-table-row-color-background-selected", "--a-surface-action-subtle"],
|
||||
["--navds-table-row-color-background-zebra", "--a-surface-subtle"],
|
||||
["--navds-table-cell-color-border-hover", "--a-border-strong"],
|
||||
["--navds-table-cell-color-border", "--a-border-default"],
|
||||
|
||||
["--navds-button-color-primary-background-hover", "--a-surface-action-hover"],
|
||||
["--navds-button-color-primary-background-active", "--a-surface-action-active"],
|
||||
["--navds-button-color-primary-border-focus", "--a-surface-default"],
|
||||
["--navds-button-color-primary-text", "--a-text-on-action"],
|
||||
["--navds-button-color-primary-background", "--a-surface-action"],
|
||||
["--navds-button-color-secondary-border-focus-active-hover", "--a-surface-default"],
|
||||
["--navds-button-color-secondary-text-hover", "--a-text-action"],
|
||||
["--navds-button-color-secondary-text-active", "--a-text-on-action"],
|
||||
["--navds-button-color-secondary-background-hover", "--a-surface-action-subtle-hover"],
|
||||
["--navds-button-color-secondary-background-active", "--a-surface-action-active"],
|
||||
["--navds-button-color-secondary-border", "--a-border-action"],
|
||||
["--navds-button-color-secondary-text", "--a-text-action"],
|
||||
["--navds-button-color-secondary-background", "--a-surface-default"],
|
||||
["--navds-button-color-tertiary-background-hover", "--a-surface-action-subtle-hover"],
|
||||
["--navds-button-color-tertiary-border-focus", "--a-border-action"],
|
||||
["--navds-button-color-tertiary-border-active", "--a-surface-default"],
|
||||
["--navds-button-color-tertiary-background-active", "--a-surface-action-active"],
|
||||
["--navds-button-color-tertiary-text-active", "--a-text-on-action"],
|
||||
["--navds-button-color-tertiary-text", "--a-text-action"],
|
||||
["--navds-button-color-danger-background-hover", "--a-surface-danger-hover"],
|
||||
["--navds-button-color-danger-background-active", "--a-surface-danger-active"],
|
||||
["--navds-button-color-danger-border-focus", "--a-surface-default"],
|
||||
["--navds-button-color-danger-background", "--a-surface-danger"],
|
||||
["--navds-button-color-danger-text", "--a-text-on-danger"],
|
||||
["--navds-error-message-color-text", "--a-text-danger"],
|
||||
["--navds-search-color-border-hover", "--a-border-action"],
|
||||
["--navds-search-color-clear-hover", "--a-text-action"],
|
||||
["--navds-search-color-border-error", "--a-border-danger"],
|
||||
["--navds-search-color-text", "--a-text-default"],
|
||||
["--navds-search-color-border", "--a-border-default"],
|
||||
["--navds-text-field-color-border-hover", "--a-border-action"],
|
||||
["--navds-text-field-color-border-error", "--a-border-danger"],
|
||||
["--navds-text-field-color-shadow-error", "--a-border-danger"],
|
||||
["--navds-text-field-color-border-disabled", "--a-gray-400"],
|
||||
["--navds-text-field-color-background-disabled", "--a-surface-subtle"],
|
||||
["--navds-text-field-color-placeholder-text", "--a-text-subtle"],
|
||||
["--navds-text-field-color-text-disabled", "--a-text-default"],
|
||||
["--navds-text-field-color-text", "--a-text-default"],
|
||||
["--navds-text-field-color-background", "--a-surface-default"],
|
||||
["--navds-text-field-color-border", "--a-border-default"],
|
||||
|
||||
["--navds-dropdown-menu-color", "--a-text-default"],
|
||||
["--navdsi-dropdown-item-color-text", "--a-text-action"],
|
||||
["--navdsi-dropdown-item-color-background-hover", "--a-surface-action-subtle-hover"],
|
||||
["--navdsi-dropdown-item-color-background-active", "--a-surface-action-active"],
|
||||
["--navds-dropdown-item-color-focus", "--a-border-focus"],
|
||||
["--navdsi-header-color-text", "--a-text-on-inverted"],
|
||||
["--navdsi-header-color-background", "--a-surface-inverted"],
|
||||
["--navdsi-header-color-border", "--a-gray-600"],
|
||||
["--navdsi-header-color-hover", "--a-surface-inverted-hover"],
|
||||
["--navdsi-header-color-active", "--a-surface-inverted-active"],
|
||||
["--navds-button-icon-adjustment", "--ac-button-icon-margin"]
|
||||
]
|
||||
|
||||
module.exports = { tokens };
|
||||
@@ -0,0 +1,18 @@
|
||||
import renameProps from "../../utils/rename-props";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
const j = api.jscodeshift;
|
||||
const root = j(file.source);
|
||||
|
||||
const printOptions = options.printOptions;
|
||||
|
||||
return renameProps({
|
||||
root,
|
||||
componentName: options.component,
|
||||
props: { [options.from]: options.to },
|
||||
}).toSource(printOptions);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { check } from "../../../utils/check";
|
||||
|
||||
const migration = "rename-prop";
|
||||
const fixtures = ["rename"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
options: {
|
||||
component: "SpeechBubble",
|
||||
from: "illustration",
|
||||
to: "avatar",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<SpeechBubble illustration={<Illustration />}>
|
||||
<div />
|
||||
</SpeechBubble>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<SpeechBubble avatar={<Illustration />}>
|
||||
<div />
|
||||
</SpeechBubble>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import { SpeechBubble, Button } from "@navikt/ds-react";
|
||||
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<SpeechBubble
|
||||
illustration={<Illustration />}
|
||||
topText="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
illustrationBgColor="blue"
|
||||
{...testProps}
|
||||
>
|
||||
<SpeechBubble.Bubble {...testProps}>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
||||
labore nisi ut.
|
||||
</SpeechBubble.Bubble>
|
||||
</SpeechBubble>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Chat, Button } from "@navikt/ds-react";
|
||||
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<Chat
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
{...testProps}
|
||||
>
|
||||
<Chat.Bubble {...testProps}>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
||||
labore nisi ut.
|
||||
</Chat.Bubble>
|
||||
</Chat>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Chat, Button } from "@navikt/ds-react";
|
||||
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<Chat
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
>
|
||||
<Chat.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
||||
labore nisi ut.
|
||||
</Chat.Bubble>
|
||||
</Chat>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Chat, Button } from "@navikt/ds-react";
|
||||
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<Chat
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
>
|
||||
<Chat.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
||||
labore nisi ut.
|
||||
</Chat.Bubble>
|
||||
</Chat>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { SpeechBubble, Button } from "@navikt/ds-react";
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<div>
|
||||
<SpeechBubble
|
||||
illustration={<Illustration />}
|
||||
topText="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
illustrationBgColor="blue"
|
||||
>
|
||||
<SpeechBubble.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</SpeechBubble.Bubble>
|
||||
</SpeechBubble>
|
||||
<SpeechBubble
|
||||
illustration={<Illustration />}
|
||||
topText="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
illustrationBgColor="blue"
|
||||
>
|
||||
<SpeechBubble.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</SpeechBubble.Bubble>
|
||||
<SpeechBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</SpeechBubble.Bubble>
|
||||
</SpeechBubble>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Chat, Button } from "@navikt/ds-react";
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<div>
|
||||
<Chat
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
>
|
||||
<Chat.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</Chat.Bubble>
|
||||
</Chat>
|
||||
<Chat
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
>
|
||||
<Chat.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</Chat.Bubble>
|
||||
<Chat.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</Chat.Bubble>
|
||||
</Chat>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { SpeechBubble as DsBubble, Button } from "@navikt/ds-react";
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<div>
|
||||
<DsBubble
|
||||
illustration={<Illustration />}
|
||||
topText="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
illustrationBgColor="blue"
|
||||
>
|
||||
<DsBubble.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</DsBubble.Bubble>
|
||||
</DsBubble>
|
||||
<DsBubble
|
||||
illustration={<Illustration />}
|
||||
topText="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
illustrationBgColor="blue"
|
||||
>
|
||||
<DsBubble.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</DsBubble.Bubble>
|
||||
</DsBubble>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Chat as DsBubble, Button } from "@navikt/ds-react";
|
||||
/* eslint-disable react/jsx-no-undef */
|
||||
export const Page = () => {
|
||||
return (
|
||||
<div>
|
||||
<DsBubble
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
>
|
||||
<DsBubble.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</DsBubble.Bubble>
|
||||
</DsBubble>
|
||||
<DsBubble
|
||||
avatar={<Illustration />}
|
||||
name="Ola Normann 01.01.21 14:00"
|
||||
backgroundColor="red"
|
||||
avatarBgColor="blue"
|
||||
>
|
||||
<DsBubble.Bubble>
|
||||
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Eu fugiat esse fugiat Lorem culpa nulla mollit tempor incididunt aute
|
||||
do.
|
||||
</DsBubble.Bubble>
|
||||
<DsBubble.Bubble>
|
||||
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
||||
laboris labore nisi ut.
|
||||
</DsBubble.Bubble>
|
||||
</DsBubble>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Pagination, Button } from "@navikt/ds-react";
|
||||
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination
|
||||
size="small"
|
||||
onPageChange={setPage}
|
||||
data-version="v1"
|
||||
{...testProps}
|
||||
/>
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination onPageChange={setPage} />
|
||||
<Pagination size="small" onPageChange={setPage} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Pagination, Button } from "@navikt/ds-react";
|
||||
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination
|
||||
size="small"
|
||||
onPageChange={setPage}
|
||||
data-version="v1"
|
||||
{...testProps}
|
||||
/>
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Pagination as DsPagination, Button } from "@navikt/ds-react";
|
||||
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<DsPagination onPageChange={setPage} />
|
||||
<DsPagination size="medium" onPageChange={setPage} />
|
||||
<DsPagination size="small" onPageChange={setPage} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Pagination as DsPagination, Button } from "@navikt/ds-react";
|
||||
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<DsPagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<DsPagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<DsPagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Pagination, Button } from "@navikt/ds-react";
|
||||
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination onPageChange={setPage} />
|
||||
<Pagination size="medium" onPageChange={setPage} />
|
||||
<Pagination size="small" onPageChange={setPage} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Pagination, Button } from "@navikt/ds-react";
|
||||
|
||||
export const Demo = () => {
|
||||
return (
|
||||
<div>
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="small" onPageChange={setPage} data-version="v1" />
|
||||
<Pagination size="xsmall" onPageChange={setPage} data-version="v1" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Tabs } from "@navikt/ds-react";
|
||||
|
||||
const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<div>
|
||||
<Tabs defaultValue="logg" onChange={(x) => console.log(x)} {...testProps}>
|
||||
<Tabs.List loop={false} {...testProps}>
|
||||
<Tabs.Tab value="logg" iconPosition={props.left} label="logg" {...testProps}/>
|
||||
<Tabs.Tab value="logg2" iconPosition="top" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
<Tabs defaultValue="logg" onChange={(x) => console.log(x)}>
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="logg" label="logg" />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Tabs } from "@navikt/ds-react";
|
||||
|
||||
const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<div>
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
{...testProps}
|
||||
loop={false}
|
||||
iconPosition={props.left}>
|
||||
<Tabs.List {...testProps}>
|
||||
<Tabs.Tab value="logg" label="logg" {...testProps} />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
<Tabs defaultValue="logg" onChange={(x) => console.log(x)}>
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="logg" label="logg" />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Tabs } from "@navikt/ds-react";
|
||||
|
||||
const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
loop
|
||||
iconPosition="left">
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="logg" label="logg" />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Tabs } from "@navikt/ds-react";
|
||||
|
||||
const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
loop
|
||||
iconPosition="left">
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="logg" label="logg" />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Tabs } from "@navikt/ds-react";
|
||||
|
||||
const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<Tabs defaultValue="logg" onChange={(x) => console.log(x)}>
|
||||
<Tabs.List loop>
|
||||
<Tabs.Tab value="logg" iconPosition="left" label="logg" />
|
||||
<Tabs.Tab value="logg2" iconPosition="top" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Tabs } from "@navikt/ds-react";
|
||||
|
||||
const TabComp = () => {
|
||||
return (
|
||||
/* prettier-ignore */
|
||||
<Tabs
|
||||
defaultValue="logg"
|
||||
onChange={(x) => console.log(x)}
|
||||
loop
|
||||
iconPosition="left">
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="logg" label="logg" />
|
||||
<Tabs.Tab value="logg2" label="logg2medlangtekst" />
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="logg">TabPanel for Logg-tab</Tabs.Panel>
|
||||
<Tabs.Panel value="logg2">TabPanel for Inbox-tab</Tabs.Panel>
|
||||
</Tabs>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
export {};
|
||||
|
||||
jest.autoMockOff();
|
||||
const defineTest = require("jscodeshift/dist/testUtils").defineTest;
|
||||
|
||||
const tests = ["props", "complete", "idempotent", "renamed"];
|
||||
|
||||
for (const test of tests) {
|
||||
defineTest(__dirname, "chat", null, `chat/${test}`);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export {};
|
||||
|
||||
jest.autoMockOff();
|
||||
const defineTest = require("jscodeshift/dist/testUtils").defineTest;
|
||||
|
||||
const tests = ["size", "import", "idempotent"];
|
||||
|
||||
for (const test of tests) {
|
||||
defineTest(__dirname, "pagination", null, `pagination/${test}`);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export {};
|
||||
|
||||
jest.autoMockOff();
|
||||
const defineTest = require("jscodeshift/dist/testUtils").defineTest;
|
||||
|
||||
const tests = ["props", "idempotent", "complete"];
|
||||
|
||||
for (const test of tests) {
|
||||
defineTest(__dirname, "tabs", null, `tabs/${test}`);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import renameProps from "../../utils/rename-props";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
const j = api.jscodeshift;
|
||||
let localName = "SpeechBubble";
|
||||
|
||||
const root = j(file.source);
|
||||
|
||||
/* Finds and replaces import from SpeechBubble -> Chat */
|
||||
root
|
||||
.find(j.ImportDeclaration)
|
||||
.filter((path) => path.node.source.value === "@navikt/ds-react")
|
||||
.forEach((imp) => {
|
||||
imp.value.specifiers.forEach((x) => {
|
||||
if (x.imported.name === "SpeechBubble") {
|
||||
if (x.local.name !== x.imported.name) {
|
||||
localName = x.local.name;
|
||||
x.imported.name = "Chat";
|
||||
} else {
|
||||
x.imported.name = "Chat";
|
||||
x.local.name = "Chat";
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (j(file.source).findJSXElements(localName)) {
|
||||
renameProps({
|
||||
root,
|
||||
componentName: localName,
|
||||
props: {
|
||||
illustrationBgColor: "avatarBgColor",
|
||||
illustration: "avatar",
|
||||
topText: "name",
|
||||
},
|
||||
});
|
||||
|
||||
/* Find and replace name of all <SpeechBubble />*/
|
||||
const compRoot = root.find(j.JSXElement, {
|
||||
openingElement: { name: { name: localName } },
|
||||
});
|
||||
|
||||
compRoot.forEach((x) => {
|
||||
if (localName !== "SpeechBubble") return;
|
||||
x.node.openingElement.name.name = "Chat";
|
||||
x.node.closingElement.name.name = "Chat";
|
||||
});
|
||||
|
||||
/* Need to handle dot-notations differently */
|
||||
const child = root.find(j.JSXElement);
|
||||
|
||||
child.forEach((x) => {
|
||||
if (
|
||||
x.value.openingElement.name.type === "JSXMemberExpression" &&
|
||||
x.value.openingElement.name.object.name === "SpeechBubble"
|
||||
) {
|
||||
x.value.openingElement.name.object.name = "Chat";
|
||||
x.value.closingElement.name.object.name = "Chat";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return root.toSource(options.printOptions);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
const j = api.jscodeshift;
|
||||
let localName = "Pagination";
|
||||
|
||||
const root = j(file.source);
|
||||
|
||||
function addMigrationTag(node) {
|
||||
const attributes = node.openingElement.attributes;
|
||||
const isMigrated = attributes.find(
|
||||
(node) =>
|
||||
node.type === "JSXAttribute" &&
|
||||
node.name.name === "data-version" &&
|
||||
node.value.value === "v1"
|
||||
);
|
||||
|
||||
if (!isMigrated) {
|
||||
attributes.push(
|
||||
j.jsxAttribute(j.jsxIdentifier("data-version"), j.literal("v1"))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* https://github.com/mui/material-ui/blob/master/packages/mui-codemod/src/v5.0.0/variant-prop.js */
|
||||
function addExplicitStandardProp(node) {
|
||||
const attributes = node.openingElement.attributes;
|
||||
const variant = attributes.find(
|
||||
(node) => node.type === "JSXAttribute" && node.name.name === "size"
|
||||
);
|
||||
|
||||
if (!variant) {
|
||||
attributes.unshift(
|
||||
j.jsxAttribute(j.jsxIdentifier("size"), j.literal("small"))
|
||||
);
|
||||
addMigrationTag(node);
|
||||
}
|
||||
}
|
||||
|
||||
/* Finds locally used name for Pagination */
|
||||
root
|
||||
.find(j.ImportDeclaration)
|
||||
.filter((path) => path.node.source.value === "@navikt/ds-react")
|
||||
.forEach((imp) => {
|
||||
imp.value.specifiers.forEach((x) => {
|
||||
if (
|
||||
x.imported.name === "Pagination" &&
|
||||
x.local.name !== x.imported.name
|
||||
) {
|
||||
localName = x.local.name;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (j(file.source).findJSXElements(localName)) {
|
||||
root.findJSXElements(`${localName}`).forEach((parent) => {
|
||||
const skip = !!parent.value.openingElement?.attributes.find(
|
||||
(x) => x.name.name === "data-version" && x.value.value === "v1"
|
||||
);
|
||||
|
||||
parent.value.openingElement?.attributes.forEach((x, index) => {
|
||||
let didUpdate = false;
|
||||
if (x.name?.name === "size" && x.type === "JSXAttribute" && !skip) {
|
||||
/* addExplicitStandardProp */
|
||||
if (x.value.value === "medium") {
|
||||
x.value = j.literal("small");
|
||||
didUpdate = true;
|
||||
} else if (x.value.value === "small") {
|
||||
x.value = j.literal("xsmall");
|
||||
didUpdate = true;
|
||||
}
|
||||
|
||||
didUpdate && addMigrationTag(parent.value);
|
||||
}
|
||||
});
|
||||
addExplicitStandardProp(parent.value);
|
||||
});
|
||||
}
|
||||
|
||||
return root.toSource(options.printOptions);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import transformTabs from "./tabs";
|
||||
import transformChat from "./chat";
|
||||
import transformPagination from "./pagination";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
file.source = transformTabs(file, api, options);
|
||||
file.source = transformChat(file, api, options);
|
||||
file.source = transformPagination(file, api, options);
|
||||
|
||||
return file.source;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import renameProps from "../../utils/rename-props";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api, options) {
|
||||
const j = api.jscodeshift;
|
||||
let localName = "Tabs";
|
||||
let iconPositionProp = null;
|
||||
|
||||
const root = j(file.source);
|
||||
|
||||
/* Finds used name for Tabs component */
|
||||
root
|
||||
.find(j.ImportDeclaration)
|
||||
.filter((path) => path.node.source.value === "@navikt/ds-react")
|
||||
.forEach((imp) => {
|
||||
imp.value.specifiers.forEach((x) => {
|
||||
if (x.imported.name === "Tabs" && x.local.name !== x.imported.name) {
|
||||
localName = x.local.name;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (j(file.source).findJSXElements(localName)) {
|
||||
renameProps({
|
||||
root,
|
||||
componentName: `${localName}.List`,
|
||||
props: {
|
||||
loop: "null",
|
||||
},
|
||||
});
|
||||
|
||||
root.findJSXElements(`${localName}`).forEach((parent) => {
|
||||
parent.value.children.forEach((el) => {
|
||||
const openingEl = el.openingElement;
|
||||
if (openingEl?.name && openingEl.name.type === "JSXMemberExpression") {
|
||||
if (
|
||||
openingEl.name.object.name === localName &&
|
||||
openingEl.name.property.name === "List"
|
||||
) {
|
||||
/* Move loop-prop */
|
||||
el.openingElement.attributes.forEach((x, index) => {
|
||||
if (x.name?.name === "loop" && x.type === "JSXAttribute") {
|
||||
parent.value.openingElement.attributes.push(x);
|
||||
delete el.openingElement.attributes[index];
|
||||
}
|
||||
});
|
||||
|
||||
/* Find and move iconPosition-prop to <Tabs/> */
|
||||
el.children.forEach((tab) => {
|
||||
const tabEl = tab.openingElement;
|
||||
if (tabEl?.name && tabEl.name.type === "JSXMemberExpression") {
|
||||
if (
|
||||
tabEl.name.object.name === localName &&
|
||||
tabEl.name.property.name === "Tab"
|
||||
) {
|
||||
tabEl?.attributes.forEach((x, index) => {
|
||||
if (
|
||||
x.name?.name === "iconPosition" &&
|
||||
x.type === "JSXAttribute"
|
||||
) {
|
||||
if (!iconPositionProp) {
|
||||
iconPositionProp = x;
|
||||
}
|
||||
delete tabEl.attributes[index];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
iconPositionProp &&
|
||||
parent.value.openingElement.attributes.push(iconPositionProp);
|
||||
iconPositionProp = null;
|
||||
});
|
||||
}
|
||||
|
||||
return root.toSource(options.printOptions);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
.test {
|
||||
color: var(--navds-global-color-blue-100);
|
||||
color: var(--navds-global-color-red-100);
|
||||
|
||||
--navds-global-color-red-100: var(--navds-global-color-green-100);
|
||||
--navds-global-color-blue-100: red;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
const StyledDiv = styled`
|
||||
--navds-global-color-red-100: var(--navds-global-color-green-100);
|
||||
--navds-global-color-blue-100: red;
|
||||
|
||||
.test{
|
||||
color: var(--navds-global-color-blue-100);
|
||||
}
|
||||
`;
|
||||
|
||||
<style>
|
||||
{`
|
||||
.test{
|
||||
color: var(--navds-global-color-blue-100);
|
||||
}
|
||||
`}
|
||||
</style>;
|
||||
@@ -0,0 +1,7 @@
|
||||
.test {
|
||||
color: var(--a-blue-100);
|
||||
color: var(--a-red-100);
|
||||
|
||||
--v2-migration__navds-global-color-red-100: var(--a-green-100);
|
||||
--v2-migration__navds-global-color-blue-100: red;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
const StyledDiv = styled`
|
||||
--v2-migration__navds-global-color-red-100: var(--a-green-100);
|
||||
--v2-migration__navds-global-color-blue-100: red;
|
||||
|
||||
.test{
|
||||
color: var(--a-blue-100);
|
||||
}
|
||||
`;
|
||||
|
||||
<style>
|
||||
{`
|
||||
.test{
|
||||
color: var(--a-blue-100);
|
||||
}
|
||||
`}
|
||||
</style>;
|
||||
@@ -0,0 +1,18 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-css-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
});
|
||||
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "css",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { tokens } from "../../../tokens-map.mjs";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api) {
|
||||
let src = file.source;
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
const rgx = new RegExp("(" + `${tok[0]}:` + ")", "gm");
|
||||
src = src.replace(rgx, `--v2-migration${tok[0].replace("--", "__")}:`);
|
||||
});
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
const rgx = new RegExp("(" + tok[0] + ")", "gm");
|
||||
src = src.replace(rgx, tok[1]);
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
NavdsGlobalColorBlue400 as abc132,
|
||||
NavdsGlobalColorGray100,
|
||||
NavdsGlobalColorGray400,
|
||||
NavdsSemanticColorLink,
|
||||
} from "@navikt/ds-tokens/dist/tokens";
|
||||
import { BodyShort } from "@navikt/ds-react";
|
||||
|
||||
const StyledNavLink = styled(NavLink)`
|
||||
border-bottom: 5px solid white;
|
||||
color: inherit;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
:hover {
|
||||
border-bottom: 5px solid ${abc132};
|
||||
p {
|
||||
color: ${NavdsSemanticColorLink};
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
background-color: ${NavdsGlobalColorGray100};
|
||||
border-bottom: 5px solid ${NavdsSemanticColorLink};
|
||||
|
||||
.typo-normal {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledLenketekst = styled(BodyShort)`
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
`;
|
||||
|
||||
const StyledTekst = styled(BodyShort)`
|
||||
border-bottom: 5px solid white;
|
||||
color: ${NavdsGlobalColorGray400};
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
`;
|
||||
|
||||
const Fane = ({ side, behandlingId, index, deaktivert }) => {
|
||||
const { gåTilUrl } = useApp();
|
||||
const fanenavn = side.navn;
|
||||
return (
|
||||
<>
|
||||
{deaktivert && (
|
||||
<StyledTekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledTekst>
|
||||
)}
|
||||
{!deaktivert && (
|
||||
<StyledNavLink
|
||||
key={side.navn}
|
||||
to={`/behandling/${behandlingId}/${side.href}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
gåTilUrl(`/behandling/${behandlingId}/${side.href}`);
|
||||
}}
|
||||
>
|
||||
<StyledLenketekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledLenketekst>
|
||||
</StyledNavLink>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Fane;
|
||||
@@ -0,0 +1,88 @@
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
ABlue400,
|
||||
AGray100,
|
||||
AGray400,
|
||||
ATextAction,
|
||||
} from "@navikt/ds-tokens/dist/tokens";
|
||||
import { BodyShort } from "@navikt/ds-react";
|
||||
|
||||
const StyledNavLink = styled(NavLink)`
|
||||
border-bottom: 5px solid white;
|
||||
color: inherit;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
:hover {
|
||||
border-bottom: 5px solid ${ABlue400};
|
||||
p {
|
||||
color: ${ATextAction};
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
background-color: ${AGray100};
|
||||
border-bottom: 5px solid ${ATextAction};
|
||||
|
||||
.typo-normal {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledLenketekst = styled(BodyShort)`
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
`;
|
||||
|
||||
const StyledTekst = styled(BodyShort)`
|
||||
border-bottom: 5px solid white;
|
||||
color: ${AGray400};
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
`;
|
||||
|
||||
const Fane = ({ side, behandlingId, index, deaktivert }) => {
|
||||
const { gåTilUrl } = useApp();
|
||||
const fanenavn = side.navn;
|
||||
return (
|
||||
<>
|
||||
{deaktivert && (
|
||||
<StyledTekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledTekst>
|
||||
)}
|
||||
{!deaktivert && (
|
||||
<StyledNavLink
|
||||
key={side.navn}
|
||||
to={`/behandling/${behandlingId}/${side.href}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
gåTilUrl(`/behandling/${behandlingId}/${side.href}`);
|
||||
}}
|
||||
>
|
||||
<StyledLenketekst size={"small"}>
|
||||
{index + 1}. {fanenavn}
|
||||
</StyledLenketekst>
|
||||
</StyledNavLink>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Fane;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-js-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "js",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import type { JSCodeshift } from "jscodeshift";
|
||||
import {
|
||||
getImportSpecifier,
|
||||
getImportSpecifierName,
|
||||
renameImportSpecifier,
|
||||
} from "../../../utils/imports";
|
||||
import { translateToken } from "../../../utils/translate-token";
|
||||
import { tokens } from "../../../tokens-map.mjs";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file: JSCodeshift, api) {
|
||||
let src = file.source;
|
||||
|
||||
const j = api.jscodeshift as JSCodeshift;
|
||||
|
||||
let root = j(file.source);
|
||||
|
||||
const jsImport = root.find(j.ImportDeclaration).filter((x) => {
|
||||
return ["@navikt/ds-tokens/dist/tokens"].includes(
|
||||
x.node.source.value as string
|
||||
);
|
||||
});
|
||||
|
||||
if (!jsImport) {
|
||||
return src;
|
||||
}
|
||||
|
||||
tokens.forEach((x) => {
|
||||
const name = translateToken(x[0], "js");
|
||||
const out = translateToken(x[1], "js");
|
||||
|
||||
let foundName: string = "";
|
||||
|
||||
getImportSpecifier(j, root, name, "@navikt/ds-tokens/dist/tokens").forEach(
|
||||
(x) => (foundName = x.node.imported.name)
|
||||
);
|
||||
|
||||
if (name === foundName) {
|
||||
const localName =
|
||||
getImportSpecifierName(
|
||||
j,
|
||||
root,
|
||||
name,
|
||||
"@navikt/ds-tokens/dist/tokens"
|
||||
) || name;
|
||||
|
||||
renameImportSpecifier(
|
||||
j,
|
||||
root,
|
||||
name,
|
||||
out,
|
||||
"@navikt/ds-tokens/dist/tokens"
|
||||
);
|
||||
|
||||
let code = root.toSource();
|
||||
|
||||
const rgx = new RegExp("(" + localName + ")", "gm");
|
||||
code = code.replace(rgx, out);
|
||||
root = j(code);
|
||||
}
|
||||
});
|
||||
|
||||
return root.toSource();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
.filtersMenu {
|
||||
box-shadow: @navds-global-color-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: @navds-global-color-green-100;
|
||||
border: 1px solid @navds-global-color-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
border: 1px solid @navds-semantic-color-link;
|
||||
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: @navds-semantic-color-link;
|
||||
}
|
||||
|
||||
background-color: @navds-global-color-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
.filtersMenu {
|
||||
box-shadow: @a-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: @a-green-100;
|
||||
border: 1px solid @a-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
border: 1px solid @a-text-action;
|
||||
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: @a-text-action;
|
||||
}
|
||||
|
||||
background-color: @a-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-less-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "less",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { translateToken } from "../../../utils/translate-token";
|
||||
import { tokens } from "../../../tokens-map.mjs";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api) {
|
||||
let src = file.source;
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
const lessToken = translateToken(tok[0], "less");
|
||||
|
||||
const rgx = new RegExp("(\\" + lessToken + ")", "gm");
|
||||
src = src.replace(rgx, translateToken(tok[1], "less"));
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
.filtersMenu {
|
||||
box-shadow: common.$navds-global-color-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: common.$navds-global-color-green-100;
|
||||
border: 1px solid common.$navds-global-color-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
&:global(.navds-link-panel) {
|
||||
border: 1px solid common.$navds-semantic-color-link;
|
||||
}
|
||||
|
||||
:global {
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: common.$navds-semantic-color-link;
|
||||
}
|
||||
}
|
||||
|
||||
background-color: common.$navds-global-color-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
.filtersMenu {
|
||||
box-shadow: common.$a-blue-200 inset 0 0 0 8px;
|
||||
border-radius: 0.2em;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.filterExplanationHighlight {
|
||||
background-color: common.$a-green-100;
|
||||
border: 1px solid common.$a-green-500;
|
||||
transition: all 0.4s linear;
|
||||
}
|
||||
|
||||
.lenkepanelNavno {
|
||||
&:global(.navds-link-panel) {
|
||||
border: 1px solid common.$a-text-action;
|
||||
}
|
||||
|
||||
:global {
|
||||
.navds-link-panel__content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.navds-link-panel__title,
|
||||
.navds-link-panel__chevron {
|
||||
color: common.$a-text-action;
|
||||
}
|
||||
}
|
||||
|
||||
background-color: common.$a-gray-600;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { check } from "../../../../utils/check";
|
||||
|
||||
const migration = "update-sass-tokens";
|
||||
const fixtures = ["complete"];
|
||||
|
||||
for (const fixture of fixtures) {
|
||||
check(__dirname, {
|
||||
fixture,
|
||||
migration,
|
||||
extension: "scss",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { translateToken } from "../../../utils/translate-token";
|
||||
import { tokens } from "../../../tokens-map.mjs";
|
||||
|
||||
/**
|
||||
* @param {import('jscodeshift').FileInfo} file
|
||||
* @param {import('jscodeshift').API} api
|
||||
*/
|
||||
export default function transformer(file, api) {
|
||||
let src = file.source;
|
||||
|
||||
tokens.forEach((tok) => {
|
||||
const scssToken = translateToken(tok[0], "scss");
|
||||
|
||||
const rgx = new RegExp("(\\" + scssToken + ")", "gm");
|
||||
src = src.replace(rgx, translateToken(tok[1], "scss"));
|
||||
});
|
||||
|
||||
return src;
|
||||
}
|
||||
Loaded 100 of 1696 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user