@kystverket/styrbord 2.15.1 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,6 +65,32 @@ function App() {
65
65
  }
66
66
  ```
67
67
 
68
+ ### Favicon
69
+
70
+ Pakken har ferdige favicon-filer under `@kystverket/styrbord/favicon/`:
71
+
72
+ | Fil | Bruk |
73
+ | ---------------------- | ----------------------------------- |
74
+ | `favicon.svg` | Moderne nettlesere |
75
+ | `favicon.ico` | Reserve (16, 32 og 48 px) |
76
+ | `apple-touch-icon.png` | iOS, 180 px, uten avrundede hjørner |
77
+ | `icon-192.png` | Web app manifest |
78
+ | `icon-512.png` | Web app manifest |
79
+
80
+ Kopier filene til appens `public`-mappe, eller importer dem så bundleren gir dem en URL:
81
+
82
+ ```js
83
+ import faviconSvg from '@kystverket/styrbord/favicon/favicon.svg?url';
84
+ ```
85
+
86
+ ```html
87
+ <link rel="icon" href="/favicon.ico" sizes="32x32" />
88
+ <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
89
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
90
+ ```
91
+
92
+ PNG- og ICO-filene genereres fra `assets/favicon/favicon.svg` av `scripts/build-favicons.mjs` når pakken bygges.
93
+
68
94
  ## Design Tokens
69
95
 
70
96
  Styrbords design tokens hentes fra [@Kystverket/styrbord-tokens](https://github.com/Kystverket/styrbord-tokens).
Binary file
@@ -0,0 +1,14 @@
1
+ <svg width="180" height="180" viewBox="0 0 180 180" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="180" height="180" rx="34" fill="white"/>
3
+ <path d="M59.1567 105.847C59.1451 105.951 59.0987 106.044 59.0639 106.125C60.7922 105.905 62.2769 104.768 62.8337 103.075C63.2049 101.915 63.1121 100.685 62.5669 99.5947C62.4045 99.2699 62.1841 98.9799 61.9521 98.7015C61.4534 99.3627 60.2586 99.4207 59.7482 98.8987C59.4815 98.7827 57.9967 98.516 57.8807 97.762C57.8343 97.5416 57.8691 97.356 57.9271 97.1936C56.1988 97.414 54.7257 98.5508 54.1689 100.244C53.6469 101.845 54.0761 103.515 55.12 104.687C55.2128 104.455 55.3636 104.246 55.642 104.13C56.1408 103.921 56.628 104.362 57.15 104.304C58.0663 104.014 59.2379 104.594 59.1567 105.847Z" fill="#000667"/>
4
+ <path d="M73.146 135.043C72.3572 134.474 71.4409 134.173 70.4665 134.173C69.8633 134.173 69.2949 134.324 68.7498 134.544C69.0282 135.066 69.005 135.82 68.6338 136.191C68.367 136.469 68.2046 136.493 67.9842 136.887C67.7522 137.421 67.0794 138.047 66.7431 138.035C66.3951 138.07 66.1747 137.943 66.0007 137.769C65.6411 139.474 66.2675 141.318 67.7638 142.408C68.5526 142.977 69.4689 143.278 70.4433 143.278C71.1625 143.278 71.8584 143.104 72.4848 142.791C71.7192 142.316 72.276 141.202 72.74 140.692C73.146 140.007 73.7723 138.963 74.6191 139.103C74.7699 139.137 74.8627 139.195 74.9555 139.253C75.1411 137.676 74.5147 136.04 73.1344 135.031L73.146 135.043Z" fill="#000667"/>
5
+ <path d="M113.28 138.302C112.503 138.198 111.946 136.991 111.726 136.759C111.215 136.62 110.775 135.251 111.285 134.648C110.705 134.382 110.067 134.219 109.406 134.219C108.443 134.219 107.515 134.521 106.738 135.089C105.752 135.808 105.102 136.864 104.917 138.059C104.824 138.65 104.847 139.242 104.975 139.81C105.914 138.824 107.318 139.74 107.341 141.132L107.469 141.388C107.967 141.852 108.049 142.524 107.689 142.954C108.234 143.174 108.814 143.325 109.417 143.325C110.38 143.325 111.308 143.023 112.085 142.455C113.071 141.736 113.721 140.68 113.906 139.485C113.988 139.01 113.964 138.534 113.883 138.059C113.709 138.209 113.512 138.325 113.28 138.279V138.302Z" fill="#000667"/>
6
+ <path d="M76.0342 51.9438C76.6373 52.5122 76.7185 53.6026 76.3589 55.9689C77.0085 55.3309 78.2381 54.4493 79.2124 54.4493C79.3864 54.4493 79.5604 54.4841 79.7112 54.5421C80.558 54.8785 80.9755 55.7833 80.9987 57.2912C81.0219 58.37 80.674 59.1007 79.9896 59.4487C79.7692 59.5531 79.514 59.6111 79.2356 59.6111C78.5049 59.6111 77.6581 59.2399 77.0433 58.8919C77.0781 59.3095 77.2057 59.7851 77.5073 60.1795C78.1453 61.0031 79.6996 61.5018 81.6599 61.5018C82.0891 61.5018 82.5415 61.4786 83.0171 61.4322C85.6038 61.177 87.4365 60.3535 88.3296 59.0659C88.7124 58.5092 89.0372 57.6044 89.0024 56.7112C88.3296 57.3724 87.2161 58.1844 86.4737 58.1844C85.6153 58.1496 84.9658 57.5348 84.5018 56.3517C84.0494 55.1801 84.1306 54.0434 84.7106 53.5098C84.9426 53.301 85.2674 53.1966 85.6849 53.1966C86.5549 53.1966 87.6917 53.6606 88.5964 54.0434C88.55 53.8926 88.318 53.185 88.318 53.185C88.1672 52.6978 88.0048 52.3614 87.8657 52.083L87.6801 51.7351C87.4133 51.2479 87.0421 50.5751 87.4365 49.8443C87.7729 49.218 88.318 48.7888 88.9908 48.5684L88.202 45.3669L87.7265 45.2973C78.3773 43.7314 75.5818 45.4481 74.735 46.5965C73.5635 48.1972 74.2246 50.3315 74.735 51.4683C75.2686 51.5147 75.7442 51.6655 76.0458 51.9438H76.0342Z" fill="#000667"/>
7
+ <path d="M85.9634 80.8732C86.3694 81.6852 87.0305 82.3347 87.8193 82.7871L87.8773 82.2419C87.9585 81.1284 88.8864 80.27 90 80.27C91.1136 80.27 92.0415 81.1284 92.1227 82.2419L92.1923 82.7871C93.0159 82.3231 93.7002 81.6388 94.1062 80.792C93.8974 80.792 93.677 80.7572 93.4451 80.5948C92.9463 80.2816 92.6215 79.516 92.8883 78.8897C93.2363 78.1937 92.9927 77.2425 93.5494 76.7438C93.677 76.6394 93.8046 76.5814 93.9322 76.535C93.1435 75.1894 91.6935 74.2847 90.0232 74.2847C88.3529 74.2847 86.8333 75.2474 86.0562 76.651C86.207 76.6742 86.3578 76.7206 86.5318 76.8482C87.0305 77.2541 86.8449 78.0081 87.0653 78.5997C87.5641 79.5392 87.1001 80.8384 85.975 80.8616L85.9634 80.8732Z" fill="#000667"/>
8
+ <path d="M122.618 97.3792C122.629 97.4951 122.664 97.5995 122.618 97.7503C122.351 98.5391 121.098 98.7595 120.762 98.8755C120.286 99.3975 118.755 99.4323 118.419 98.4811C118.419 98.4463 118.419 98.4347 118.419 98.4115C118.024 98.7711 117.688 99.2003 117.433 99.6874C116.876 100.766 116.783 102.007 117.154 103.167C117.711 104.872 119.196 106.009 120.936 106.23C120.878 106.125 120.808 106.032 120.797 105.905C120.553 104.78 121.945 104.072 122.78 104.362C123.406 104.42 124.044 103.828 124.566 104.397C124.706 104.524 124.775 104.675 124.833 104.826C125.1 104.524 125.355 104.2 125.541 103.828C126.098 102.75 126.19 101.509 125.819 100.349C125.332 98.8407 124.102 97.7619 122.618 97.3792Z" fill="#000667"/>
9
+ <path d="M113.454 22.3768C100.555 17.505 89.9999 18.0154 89.9999 18.0154C89.9999 18.0154 79.4444 17.505 66.5342 22.3652C53.6355 27.2254 47.0586 32.538 47.0586 32.538V108.202C47.0586 133.906 60.4444 146.248 72.1715 153.382C81.6947 159.181 89.9999 162 89.9999 162C89.9999 162 98.3052 159.181 107.828 153.382C119.544 146.248 132.941 133.894 132.941 108.202V32.538C132.941 32.538 126.364 27.237 113.466 22.3652L113.454 22.3768ZM56.7558 52.1875C59.2265 48.7889 64.7594 47.6173 70.1648 47.3041C70.42 41.8176 80.3144 41.458 87.9468 42.9195C88.144 42.6759 88.4456 42.4787 88.8052 42.3511H88.7936L88.5732 40.7504C86.6941 40.1472 85.3369 38.4073 85.3369 36.331C85.3369 34.2547 86.7869 32.4104 88.7588 31.8536V27.8402H85.2789V25.3579H88.7588V22.2608H91.2411V25.3579H94.7209V27.8402H91.2411V31.8536C93.213 32.3988 94.6629 34.1851 94.6629 36.331C94.6629 38.4769 93.2942 40.1472 91.4267 40.7504L91.2063 42.3279C91.5543 42.4555 91.8559 42.6527 92.0531 42.9079C99.6855 41.4464 109.568 41.806 109.823 47.2925C115.229 47.6057 120.75 48.7773 123.233 52.1759C125.262 54.9714 122.316 57.7669 121.226 58.66C121.806 59.2516 121.945 60.0984 121.945 60.0984L113.582 71.5471C106.587 67.6844 98.5488 65.4805 89.9999 65.4805C81.4511 65.4805 73.4011 67.6844 66.4182 71.5471L58.0549 60.0984C58.0549 60.0984 58.1941 59.2516 58.7741 58.66C57.6837 57.7669 54.7491 54.9714 56.7674 52.1759L56.7558 52.1875ZM124.903 107.018C125.007 107.158 125.123 107.32 125.216 107.517C125.518 108.132 125.494 108.932 125.181 109.431C124.868 109.941 124.613 109.895 125.007 110.44C125.367 110.997 125.599 111.867 125.471 112.296L125.378 112.586C124.624 113.433 125.355 114.349 125.204 115.289C125.135 115.822 124.659 116.252 124.566 116.681C124.404 117.18 124.88 118.107 124.717 118.757C124.671 119.279 124.265 119.65 123.998 120.056C123.546 120.915 124.242 122.202 123.267 122.956C122.432 123.64 122.989 124.742 122.432 125.578C122.107 126.134 121.585 126.308 121.423 126.459C121.226 126.61 121.446 127.468 121.214 128.083C121.052 128.918 120.066 129.185 119.88 129.649C119.729 130.09 119.88 130.995 119.451 131.401C118.975 132.085 118.036 132.038 117.92 132.479C117.781 132.804 117.711 133.581 117.34 133.987C116.493 134.985 115.797 134.451 115.6 135.565C115.519 135.982 115.345 136.168 115.159 136.296C116.308 138.94 115.519 142.118 113.083 143.882C111.969 144.694 110.67 145.088 109.394 145.088C107.944 145.088 106.506 144.589 105.358 143.626C104.847 144.195 104.117 144.902 103.235 144.647C102.783 144.566 102.574 144.299 102.377 144.554C102.005 145.1 101.112 145.9 100.289 145.854C99.6275 145.645 98.9316 145.784 98.2704 146.352C97.47 146.863 96.8089 146.457 96.0665 146.422C95.5677 146.445 94.8833 147.153 94.315 147.234C93.6886 147.477 93.097 146.944 92.3778 146.932C91.8211 146.955 91.1831 147.512 90.6959 147.466C90.1855 147.57 89.6404 147.037 88.9908 147.013C88.2368 147.037 87.4713 147.593 86.9145 147.303C86.3461 147.222 86.0097 146.584 85.6501 146.607C85.2789 146.631 84.4206 147.083 83.8406 146.921C83.1794 146.886 82.8083 146.271 82.3559 146.213C81.8919 146.143 81.1495 146.607 80.5811 146.352C79.92 146.225 79.5836 145.471 79.0964 145.32C78.6092 145.146 77.8089 145.471 77.3217 145.181C76.7533 144.995 76.3937 144.322 75.9529 144.16C75.5934 143.986 74.9786 144.09 74.5494 143.812C74.445 143.754 74.3754 143.696 74.329 143.626C73.2039 144.531 71.8119 145.007 70.4084 145.007C69.1208 145.007 67.8333 144.612 66.7081 143.8C64.2722 142.037 63.4951 138.847 64.6434 136.203C64.6318 136.191 64.6202 136.18 64.597 136.168C64.0751 135.704 64.1215 135.008 63.7271 134.822C63.4139 134.637 62.7991 134.428 62.4743 134.034C62.0452 133.651 62.0103 132.792 61.8712 132.41C61.7784 132.05 61.1172 132.131 60.5836 131.644C59.9108 131.238 60.0384 130.217 59.8876 129.626C59.76 129.197 58.9829 129.057 58.7045 128.431C58.3681 127.944 58.4493 127.004 58.4261 126.633C58.4029 126.308 58.0201 126.366 57.6605 125.984C57.3706 125.717 57.185 125.322 57.0922 124.94C56.953 124.406 57.1618 123.884 56.953 123.536C56.8022 123.165 56.2802 122.875 56.1062 122.376C55.7814 121.808 56.0598 120.961 55.9206 120.404C55.8046 119.871 55.1434 119.465 55.0738 118.676C54.8883 117.933 55.3406 117.249 55.2014 116.75C54.9463 116.112 54.2619 115.126 54.7027 114.21C55.1086 113.317 54.2387 112.772 54.3083 111.821C54.3083 111.206 54.7607 110.463 54.9579 110.162C55.1898 109.883 54.3199 109.477 54.4011 108.422C54.3779 107.819 54.7375 107.274 54.981 106.902C52.6727 105.383 51.5592 102.471 52.4524 99.7223C53.3223 97.066 55.7814 95.3725 58.4377 95.3725C58.5885 95.3725 58.7509 95.3957 58.9133 95.4073C59.0873 94.9549 59.6324 94.6997 59.8412 94.3285C60.1428 93.8877 60.0152 93.1686 60.3632 92.693C60.5836 92.1942 61.4188 91.9738 61.7204 91.533C62.0219 91.1038 61.8712 90.3151 62.2771 89.8743C62.5323 89.3871 63.4487 89.2595 63.8199 88.9115C64.1911 88.5867 64.1215 87.8792 64.6666 87.45C65.0842 86.9512 65.9658 86.8468 66.279 86.6264C66.5574 86.4292 66.511 85.9189 66.8589 85.4549C67.2997 84.7125 68.4133 84.7241 68.8309 84.3761C69.1208 84.1441 69.2252 83.5526 69.6776 83.2278C70.1416 82.729 71.0696 82.7522 71.5219 82.4738C71.9743 82.2186 72.1251 81.5111 72.7747 81.2095C73.4011 80.8151 74.1202 80.9195 74.561 80.8267C75.4194 80.3047 76.0689 79.2143 77.1709 79.4579C78.0061 79.6203 78.3193 78.588 79.2936 78.3792C79.9084 78.2052 80.7319 78.4488 81.0451 78.53C81.5323 78.4372 81.7759 77.4512 82.7271 77.37C83.0518 77.254 83.4578 77.3584 83.829 77.4744C84.4554 74.6673 86.9609 72.5678 89.9651 72.5678C92.9694 72.5678 95.5213 74.7021 96.1245 77.5556C96.7625 77.4048 97.412 77.2192 98.05 77.5556C98.8968 77.8804 98.9084 78.6576 99.2331 78.53C99.5463 78.4488 100.393 78.2168 100.961 78.356C101.855 78.5068 102.261 79.6203 103.119 79.4579C103.629 79.4115 104.14 79.5391 104.604 79.8987C105.636 81.2675 106.112 80.5947 107.469 81.1631C108.072 81.4183 108.258 82.1606 108.745 82.4622C109.116 82.729 109.789 82.6942 110.229 82.9494C110.844 83.193 111.076 83.9933 111.436 84.3645C111.877 84.7589 112.932 84.7009 113.338 85.3505C113.814 85.8145 113.686 86.464 114.023 86.6612C114.371 86.8584 115.287 87.0324 115.646 87.4848C116.145 87.8908 116.076 88.5983 116.458 88.9231C116.841 89.2711 117.746 89.3987 118.001 89.8859C118.419 90.3383 118.233 91.1154 118.604 91.5678C118.86 91.9506 119.579 92.2174 119.857 92.6582C120.298 93.1918 120.135 93.9109 120.437 94.3401C120.646 94.7113 121.191 94.9781 121.365 95.4189C121.377 95.4537 121.388 95.4653 121.4 95.4885C121.423 95.4885 121.446 95.4885 121.469 95.4885C124.126 95.4885 126.596 97.182 127.455 99.8383C128.348 102.611 127.211 105.522 124.88 107.042L124.903 107.018Z" fill="#000667"/>
10
+ <path d="M107.306 61.7455H107.295C106.425 61.6759 105.752 60.69 105.253 59.6924C104.975 60.1912 104.778 60.864 104.928 61.5367C105.23 62.8823 107.086 64.2394 109.893 65.1906C111.366 65.6893 112.596 65.9329 113.558 65.9329C114.312 65.9329 114.892 65.7821 115.275 65.469C115.414 65.353 115.519 65.179 115.611 64.9934C115.333 65.0514 115.055 65.0746 114.788 65.0746C114.231 65.0746 113.744 64.9586 113.373 64.7266C112.723 64.3438 112.19 63.2882 112.828 61.6179C113.338 60.2956 114.127 59.9824 114.8 59.9476C115.472 59.9476 116.203 60.3884 117.003 61.2931C117.027 59.5532 117.189 58.3469 117.757 58.0105C118.024 57.8481 118.453 57.7553 118.894 57.7553C119.115 57.7553 119.381 57.7901 119.695 57.8597C120.205 57.1057 120.75 55.8994 120.344 54.6002C120.043 53.6607 118.465 51.2596 109.325 49.6124L109.035 49.5776C108.257 50.8768 107.364 51.6655 107.074 51.8975C107.689 52.3151 108.025 52.9879 108.025 53.8463C108.025 54.693 107.445 55.3542 106.784 56.1314L106.39 56.5953C106.761 56.5373 107.213 56.4909 107.677 56.4909C108.582 56.4909 109.209 56.6881 109.545 57.0593C110.171 57.7785 110.102 58.8224 109.325 60.2608C108.803 61.2351 108.165 61.7339 107.306 61.7339V61.7455Z" fill="#000667"/>
11
+ <path d="M61.0824 57.7553C61.5232 57.7553 61.9524 57.8481 62.2192 58.0105C62.7876 58.3585 62.9383 59.5648 62.9731 61.2931C63.7735 60.3884 64.5043 59.9476 65.1771 59.9476C65.8498 59.9824 66.6502 60.3072 67.149 61.6179C67.7869 63.2998 67.265 64.3438 66.6038 64.7266C66.2326 64.947 65.7338 65.0746 65.1887 65.0746C64.9219 65.0746 64.6435 65.0514 64.3651 64.9934C64.4579 65.179 64.5623 65.353 64.7015 65.469C65.0843 65.7705 65.6642 65.9329 66.4182 65.9329C67.381 65.9329 68.6105 65.6777 70.0836 65.1906C72.8907 64.251 74.7466 62.8823 75.0482 61.5367C75.199 60.8639 75.0018 60.1912 74.7234 59.6924C74.2131 60.69 73.5519 61.6759 72.6819 61.7455H72.6703C71.812 61.7455 71.174 61.2467 70.652 60.2724C69.8749 58.834 69.8053 57.7785 70.4316 57.0709C70.768 56.6881 71.3944 56.5025 72.2991 56.5025C72.7515 56.5025 73.2155 56.5489 73.5867 56.6069L73.1923 56.143C72.5311 55.3658 71.9628 54.693 71.9512 53.8579C71.9512 52.9995 72.2876 52.3267 72.9023 51.9091C72.6123 51.6771 71.7192 50.8884 70.942 49.5892L70.652 49.624C61.5116 51.2596 59.9341 53.6607 59.6325 54.6118C59.2265 55.911 59.7833 57.1057 60.2821 57.8713C60.5836 57.8017 60.862 57.7669 61.0824 57.7669V57.7553Z" fill="#000667"/>
12
+ <path d="M93.5144 58.1961C92.772 58.1961 91.6701 57.3841 90.9857 56.7229C90.9509 57.6161 91.2757 58.5208 91.6585 59.0776C92.5401 60.3652 94.3844 61.1887 96.9711 61.4439C97.4466 61.4903 97.899 61.5135 98.3282 61.5135C100.289 61.5135 101.843 61.0147 102.481 60.1912C102.782 59.7968 102.922 59.3212 102.945 58.9036C102.33 59.24 101.483 59.6228 100.753 59.6228C100.463 59.6228 100.219 59.5648 99.9985 59.4604C99.3026 59.1124 98.9662 58.3933 98.9778 57.3029C99.001 55.7834 99.4302 54.8902 100.265 54.5538C100.416 54.4958 100.579 54.461 100.764 54.461C101.738 54.461 102.956 55.331 103.618 55.9806C103.246 53.6259 103.339 52.5239 103.942 51.9555C104.232 51.6771 104.72 51.5148 105.253 51.48C105.752 50.3432 106.413 48.2089 105.253 46.6082C104.406 45.4482 101.611 43.7431 92.2617 45.309L91.7861 45.3786L90.9973 48.5801C91.6701 48.8005 92.2037 49.2296 92.5401 49.8444C92.946 50.5752 92.5749 51.248 92.2965 51.7351L92.1109 52.0831C91.9717 52.3615 91.8209 52.7095 91.6585 53.1851C91.6585 53.1851 91.4265 53.8926 91.3801 54.0434C92.2849 53.6607 93.4216 53.1967 94.2916 53.1967C94.7092 53.1967 95.0339 53.3011 95.2659 53.5099C95.8459 54.0434 95.9271 55.1802 95.4747 56.3517C95.0107 57.5349 94.3612 58.1497 93.5028 58.1845L93.5144 58.1961Z" fill="#000667"/>
13
+ <path d="M122.119 111.287C122.142 110.927 121.748 110.44 121.759 109.849C121.713 109.257 122.107 108.747 122.073 108.445C122.073 108.283 121.945 108.178 121.817 108.039C121.713 108.039 121.597 108.062 121.493 108.062C118.836 108.062 116.377 106.369 115.507 103.712C114.603 100.94 115.751 98.0171 118.082 96.5092C118.059 96.486 118.059 96.4628 118.036 96.4396C117.862 96.2424 117.56 95.9524 117.41 95.5928C117.154 95.1056 117.178 94.5604 116.922 94.2241C116.574 93.8065 115.658 93.1453 115.438 92.3333C115.217 91.5794 114.533 91.5214 113.907 90.7906C113.512 90.3382 113.419 89.7931 113.083 89.5379C112.259 89.0855 111.273 88.5983 110.983 87.5196L110.809 87.3688C110.554 87.2528 109.858 87.276 109.394 86.8932C108.884 86.5568 108.71 85.8608 108.408 85.6288C108.142 85.3504 107.527 85.4896 107.016 85.2461C106.309 85.0373 106.054 84.1557 105.717 83.8657C105.416 83.5641 104.615 83.8541 104.012 83.5409C103.165 83.2277 103.038 82.3694 102.493 82.4622C102.11 82.4622 101.576 82.5666 101.101 82.3694C100.579 82.2302 100.161 81.801 99.8479 81.5574C99.4883 81.221 98.862 81.5226 98.2472 81.4182C97.47 81.2674 97.0177 80.3743 96.2057 80.7106C96.1129 80.7454 96.0433 80.757 95.9737 80.7686C95.4053 82.5318 94.0946 83.9353 92.4011 84.6429L93.2478 91.939L107.689 92.7625C108.443 92.7857 109.661 92.9945 109.661 94.6416C109.661 96.0916 108.06 96.2192 107.898 96.2192L93.4914 97.3907L90.4755 90.605C90.29 90.1874 89.6984 90.1874 89.5128 90.605L86.4969 97.3907L72.0903 96.2192C71.9395 96.2192 70.3272 96.0916 70.3272 94.6416C70.3272 92.9945 71.5451 92.7973 72.2991 92.7625L86.7521 91.939L87.5989 84.6429C85.8937 83.9237 84.5714 82.4854 84.0262 80.6874C83.8522 80.6642 83.6898 80.641 83.5622 80.6526C83.2258 80.6874 82.9475 81.163 82.4719 81.3254C81.9267 81.6038 81.1843 81.3138 80.7668 81.4414C80.3492 81.569 79.9316 82.2186 79.2588 82.381C78.6788 82.6362 77.9597 82.381 77.6233 82.5086C77.2753 82.613 77.0433 83.3089 76.3473 83.5525C75.7442 83.8657 74.9438 83.5757 74.6422 83.8773C74.3058 84.1673 74.0506 85.0489 73.3431 85.2576C72.8443 85.5012 72.1831 85.3968 71.9627 85.478L71.8119 85.6172C71.6611 85.8608 71.4872 86.5568 70.9652 86.8932C70.478 87.2644 69.84 87.218 69.5384 87.5312C69.1441 87.8675 68.9121 88.6911 68.2625 88.9927C67.4157 89.3755 67.0213 89.6307 66.685 90.4658C65.757 91.765 65.2466 91.301 64.5043 93.0989C64.2607 93.5049 63.8663 93.7601 63.6343 94.0037C63.1471 94.4329 63.1587 95.3724 62.7411 95.964C62.2771 96.428 62.254 96.544 62.2887 96.718C64.3535 98.2955 65.3162 101.045 64.4695 103.643C63.5995 106.299 61.1404 107.993 58.4841 107.993C58.3217 107.993 58.1593 107.969 57.9969 107.958C57.6026 108.631 58.0317 108.932 58.0781 109.907C58.0781 110.498 57.6953 110.997 57.7185 111.345C57.7185 111.774 58.2521 112.528 58.1477 113.305C58.1245 113.874 57.7881 114.349 57.8113 114.639C57.7997 114.952 58.2521 115.312 58.3797 115.904C58.5769 116.472 58.2985 117.098 58.2405 117.551C58.1129 118.096 58.8901 118.467 59.1105 119.175C59.3889 119.847 58.9365 120.555 59.1569 120.984C59.2961 121.355 59.9108 121.761 60.0732 122.353C60.2472 122.782 60.108 123.223 60.1776 123.571C60.224 124.035 60.6184 124.336 60.9548 124.754C61.326 125.264 61.3028 126.157 61.5 126.61C61.7436 127.109 62.6831 127.677 62.8223 128.535C62.9499 128.93 63.0079 129.185 63.2399 129.429C63.8083 129.811 64.5971 130.925 64.7942 131.621C65.2466 132.073 66.4182 132.514 66.685 133.361C66.7662 133.512 66.8242 133.581 66.8938 133.628C67.9609 132.885 69.1905 132.468 70.4664 132.468C71.7423 132.468 73.0415 132.862 74.1666 133.674C76.4749 135.356 77.2753 138.302 76.3705 140.866C76.4401 140.935 76.5097 140.982 76.6721 141.005C77.4145 140.97 78.3773 141.875 78.8992 142.176C79.4328 142.327 80.268 142.211 80.9523 142.664C81.7063 143.29 82.1819 143.058 83.0983 143.116C83.7594 143.186 84.2814 143.696 84.7454 143.731C85.2094 143.766 85.8937 143.476 86.4389 143.592C86.9261 143.626 87.3553 144.021 87.7961 144.021C88.318 144.056 89.014 143.557 89.5708 143.696C90.0464 143.731 90.4523 144.148 90.8699 144.137C91.3687 144.172 91.9255 143.522 92.6214 143.592C93.1898 143.568 93.7002 144.009 94.083 143.986C94.547 144.009 95.0573 143.302 95.6837 143.244C96.3449 143.058 96.9249 143.487 97.2844 143.348C97.586 143.255 97.9688 142.756 98.5604 142.559C99.3144 142.223 100.08 142.524 100.44 142.374C100.776 142.281 101.101 141.77 101.611 141.585C102.11 141.341 102.771 141.538 103.096 141.399C103.374 141.202 103.455 141.063 103.502 140.982C102.562 138.407 103.363 135.437 105.694 133.744C106.808 132.932 108.107 132.537 109.383 132.537C110.624 132.537 111.83 132.943 112.874 133.639C112.99 133.616 113.083 133.558 113.164 133.361C113.315 133.048 113.663 132.549 114.104 132.259C115.588 131.667 115.101 130.554 116.331 129.695C116.969 129.278 116.888 128.57 117.375 127.77C117.7 127.259 118.187 127.027 118.338 126.621C118.535 126.157 118.488 125.288 118.894 124.754C119.219 124.267 119.683 124.104 119.718 123.791C119.776 123.571 119.613 123.211 119.671 122.782C119.671 122.04 120.483 121.425 120.681 120.984C120.866 120.625 120.553 120.103 120.634 119.581C120.623 118.873 121.411 118.328 121.562 117.864C121.713 117.493 121.342 116.924 121.388 116.344C121.377 115.567 122.015 115.034 122.015 114.651C121.968 114.21 121.435 113.328 121.771 112.4C121.91 111.971 122.107 111.635 122.096 111.345L122.119 111.287ZM73.3663 106.276H85.8821C85.8821 106.276 85.9865 106.241 86.0097 106.195L89.8724 94.2821C89.9072 94.1661 90.0812 94.1661 90.116 94.2821L93.9786 106.195C93.9786 106.195 94.0482 106.288 94.1062 106.288H106.622C106.75 106.288 106.796 106.438 106.703 106.52L96.5653 113.874C96.5653 113.874 96.4957 113.966 96.5189 114.024L100.393 125.937C100.428 126.053 100.3 126.157 100.196 126.088L90.0696 118.722C90.0696 118.722 89.9652 118.687 89.9188 118.722L79.7924 126.088C79.688 126.157 79.5488 126.065 79.5952 125.937L83.4694 114.024C83.4694 114.024 83.4694 113.908 83.423 113.874L73.2851 106.52C73.1807 106.45 73.2387 106.288 73.3663 106.288V106.276ZM105.242 130.275C100.59 133.709 95.2429 135.681 90 135.727C84.757 135.681 79.4096 133.709 74.7582 130.275C67.9609 125.253 66.1746 119.117 65.8382 117.69C65.8034 117.562 65.9426 117.458 66.0702 117.504L71.6611 119.871L69.376 120.903C69.376 120.903 73.0531 125.775 76.8229 128.037C80.6044 130.299 83.3998 130.774 85.6501 131.041C86.9725 131.192 87.8309 130.635 87.8309 129.498L87.5873 123.466L89.768 121.877C89.8956 121.784 90.0696 121.784 90.1972 121.877L92.3895 123.466L92.1459 129.498C92.1459 130.635 93.0042 131.192 94.3266 131.041C96.5885 130.786 99.384 130.31 103.154 128.037C106.935 125.775 110.601 120.903 110.601 120.903L108.316 119.871L113.907 117.504C114.034 117.446 114.162 117.551 114.139 117.69C113.802 119.117 112.016 125.264 105.219 130.275H105.242Z" fill="#000667"/>
14
+ </svg>
Binary file
Binary file
@@ -0,0 +1,15 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ColorSchemeToggleProps } from './ColorSchemeToggle.types';
3
+ /**
4
+ * Round 48 px button that switches between light and dark colour scheme. Shows a sun over the sea in
5
+ * light mode; in dark mode the sun sinks and a crescent moon and stars appear.
6
+ *
7
+ * Controlled: pair it with `useColorScheme`, which stores the choice and sets `data-color-scheme`
8
+ * on `<html>`. The accessible name describes the action ("Bytt til mørk modus") and changes with
9
+ * the state, so the button has no `aria-pressed`.
10
+ *
11
+ * @example
12
+ * const [colorScheme, setColorScheme] = useColorScheme();
13
+ * <ColorSchemeToggle colorScheme={colorScheme} onColorSchemeChange={setColorScheme} />
14
+ */
15
+ export declare function ColorSchemeToggle({ colorScheme, onColorSchemeChange, variant, className, style, onClick, ...rest }: ColorSchemeToggleProps): ReactElement;
@@ -0,0 +1,41 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import { ColorSchemeToggle } from '~/main';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof ColorSchemeToggle;
6
+ tags: string[];
7
+ args: {
8
+ colorScheme: "light";
9
+ onColorSchemeChange: () => void;
10
+ variant: "color";
11
+ };
12
+ argTypes: {
13
+ colorScheme: {
14
+ control: false;
15
+ };
16
+ onColorSchemeChange: {
17
+ control: false;
18
+ };
19
+ variant: {
20
+ control: "inline-radio";
21
+ options: string[];
22
+ };
23
+ };
24
+ parameters: {
25
+ docs: {
26
+ description: {
27
+ component: string;
28
+ };
29
+ };
30
+ };
31
+ };
32
+ export default meta;
33
+ type Story = StoryObj<typeof meta>;
34
+ export declare const Preview: Story;
35
+ export declare const Variants: Story;
36
+ export declare const AllStates: Story;
37
+ /**
38
+ * With `useColorScheme` the page follows the system until the user picks the other scheme. That choice
39
+ * survives a reload; picking what the system shows clears it and the page follows the system again.
40
+ */
41
+ export declare const WithHook: Story;
@@ -0,0 +1,16 @@
1
+ import type { ButtonHTMLAttributes, Ref } from 'react';
2
+ export type ColorScheme = 'light' | 'dark';
3
+ export type ColorSchemeToggleVariant = 'color' | 'mono';
4
+ export type ColorSchemeToggleProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'children' | 'onChange' | 'aria-label' | 'title'> & {
5
+ /** The colour scheme currently in use. The button shows a sun for `light` and a moon for `dark`. */
6
+ colorScheme: ColorScheme;
7
+ /** Called with the opposite scheme when the button is clicked. Not called if `onClick` prevents default. */
8
+ onColorSchemeChange: (next: ColorScheme) => void;
9
+ /**
10
+ * `color` draws sky, sea and a yellow sun. `mono` is a single-colour line icon in
11
+ * `primary-base-default` on `primary-surface-default`, and follows the page's colour scheme.
12
+ * @default 'color'
13
+ */
14
+ variant?: ColorSchemeToggleVariant;
15
+ ref?: Ref<HTMLButtonElement>;
16
+ };
@@ -0,0 +1,21 @@
1
+ import type { ColorScheme } from './ColorSchemeToggle.types';
2
+ export declare const COLOR_SCHEME_STORAGE_KEY = "styrbord-color-scheme";
3
+ /**
4
+ * Owns the page's colour scheme. By default the page follows the system setting
5
+ * (`prefers-color-scheme`): `<html>` gets `data-color-scheme="auto"` and the tokens switch in CSS, live.
6
+ * A choice that differs from the system is saved in `localStorage` under `styrbord-color-scheme` and
7
+ * set as `data-color-scheme="light|dark"`; choosing what the system shows clears it again.
8
+ * All components using the hook share one value.
9
+ *
10
+ * Returns the scheme in use (resolved from the system when following it), a setter, and whether the
11
+ * page is following the system.
12
+ *
13
+ * During server rendering and hydration the scheme is `light`. Render `<html data-color-scheme="auto">`
14
+ * so system users get the right scheme before JavaScript runs. Users with a stored choice need an
15
+ * inline script in `<head>` that applies it before first paint.
16
+ *
17
+ * @example
18
+ * const [colorScheme, setColorScheme] = useColorScheme();
19
+ * <ColorSchemeToggle colorScheme={colorScheme} onColorSchemeChange={setColorScheme} />
20
+ */
21
+ export declare function useColorScheme(): readonly [ColorScheme, (next: ColorScheme) => void, boolean];
@@ -1,8 +1,15 @@
1
+ import { type ReactElement } from 'react';
1
2
  type KyvSpinnerSize = 'sm' | 'md' | 'lg';
3
+ type KyvSpinnerVariant = 'scene' | 'outline';
2
4
  export interface KyvSpinnerProps {
3
5
  size?: KyvSpinnerSize;
6
+ /**
7
+ * `outline` (standard) er en strektegning på gjennomsiktig bakgrunn, i samme stil som fyr-ikonet.
8
+ * `scene` er en fargelagt scene med himmel, hav og øy, som skifter mellom dag og natt.
9
+ */
10
+ variant?: KyvSpinnerVariant;
4
11
  'aria-label'?: string;
5
12
  className?: string;
6
13
  }
7
- declare const KyvSpinner: ({ size, "aria-label": ariaLabel, className }: KyvSpinnerProps) => React.JSX.Element;
14
+ declare const KyvSpinner: ({ size, variant, "aria-label": ariaLabel, className, }: KyvSpinnerProps) => ReactElement;
8
15
  export default KyvSpinner;
@@ -1,7 +1,7 @@
1
1
  import type { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ size, "aria-label": ariaLabel, className }: import("./KyvSpinner").KyvSpinnerProps) => React.JSX.Element;
4
+ component: ({ size, variant, "aria-label": ariaLabel, className, }: import("./KyvSpinner").KyvSpinnerProps) => React.ReactElement;
5
5
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
6
6
  tags: string[];
7
7
  parameters: {
@@ -16,6 +16,10 @@ declare const meta: {
16
16
  control: "radio";
17
17
  options: string[];
18
18
  };
19
+ variant: {
20
+ control: "radio";
21
+ options: string[];
22
+ };
19
23
  };
20
24
  };
21
25
  export default meta;
@@ -24,3 +28,6 @@ export declare const Default: Story;
24
28
  export declare const Small: Story;
25
29
  export declare const Large: Story;
26
30
  export declare const AllSizes: Story;
31
+ export declare const DayAndNight: Story;
32
+ export declare const Scene: Story;
33
+ export declare const SceneDayAndNight: Story;
@@ -9,4 +9,9 @@ export interface LogoProps {
9
9
  height?: number;
10
10
  width?: number;
11
11
  }
12
+ /**
13
+ * `color="blue"` følger fargemodusen: i mørk modus vises den hvite tegningen i stedet, siden
14
+ * profilhåndboka krever den på mørk bakgrunn. Begge tegningene rendres, og CSS viser den som
15
+ * passer nærmeste `data-color-scheme` (se logo.module.css). `white` og `black` byttes aldri.
16
+ */
12
17
  export declare function Logo({ product, className, color, variant, alt, height, width, }: Readonly<LogoProps>): React.JSX.Element;
@@ -35,3 +35,19 @@ export declare const Pfsa: Story;
35
35
  export declare const Saksbehandling: Story;
36
36
  export declare const Selvbetjening: Story;
37
37
  export declare const SelvbetjeningEnglish: Story;
38
+ /**
39
+ * Faviconet er det blå skjoldet fra logoen på hvit bakgrunn med avrundede hjørner. Det er ikke en
40
+ * React-komponent, men ferdige filer i pakken under `@kystverket/styrbord/favicon/`: `favicon.svg`,
41
+ * `favicon.ico` (16, 32 og 48 px), `apple-touch-icon.png` (180 px, kvadratisk, siden iOS runder
42
+ * hjørnene selv) og `icon-192.png` / `icon-512.png` til web app manifest. Kopier dem til appens
43
+ * `public`-mappe og pek på dem fra `<head>`:
44
+ *
45
+ * ```html
46
+ * <link rel="icon" href="/favicon.ico" sizes="32x32" />
47
+ * <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
48
+ * <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
49
+ * ```
50
+ *
51
+ * Vist i 16, 32, 48 og 180 px.
52
+ */
53
+ export declare const Favicon: Story;
@@ -48,6 +48,9 @@ export { Logo } from './components/kystverket/Logo/Logo';
48
48
  export type { LogoProps, LogoVariant } from './components/kystverket/Logo/Logo';
49
49
  export { Search, SearchInput, SearchClear, SearchButton } from './components/kystverket/Search/Search';
50
50
  export type { SearchProps, SearchInputProps, SearchClearProps, SearchButtonProps, } from './components/kystverket/Search/Search.types';
51
+ export { ColorSchemeToggle } from './components/kystverket/ColorSchemeToggle/ColorSchemeToggle';
52
+ export type { ColorScheme, ColorSchemeToggleProps, ColorSchemeToggleVariant, } from './components/kystverket/ColorSchemeToggle/ColorSchemeToggle.types';
53
+ export { useColorScheme, COLOR_SCHEME_STORAGE_KEY } from './components/kystverket/ColorSchemeToggle/useColorScheme';
51
54
  export { Footer } from './components/kystverket/Footer/Footer';
52
55
  export type { FooterProps } from './components/kystverket/Footer/Footer';
53
56
  export { Header } from './components/kystverket/Header/Header';