@swr-data-lab/components 1.13.0 → 1.13.2

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.
Files changed (288) hide show
  1. package/dist/Autocomplete/Autocomplete.svelte +237 -0
  2. package/dist/Autocomplete/Autocomplete.svelte.d.ts +34 -0
  3. package/dist/Autocomplete/index.d.ts +2 -0
  4. package/dist/Button/Button.svelte +38 -0
  5. package/dist/Button/Button.svelte.d.ts +10 -0
  6. package/dist/Button/index.d.ts +2 -0
  7. package/dist/Caption/Caption.svelte +21 -0
  8. package/dist/Caption/Caption.svelte.d.ts +8 -0
  9. package/dist/Caption/index.js +2 -0
  10. package/dist/Card/Card.svelte +25 -0
  11. package/dist/Card/Card.svelte.d.ts +7 -0
  12. package/dist/Card/index.d.ts +2 -0
  13. package/dist/ChartFooter/ChartFooter.svelte +38 -0
  14. package/dist/ChartFooter/ChartFooter.svelte.d.ts +8 -0
  15. package/dist/ChartFooter/index.d.ts +2 -0
  16. package/{src → dist}/ChartHeader/ChartHeader.svelte +4 -12
  17. package/dist/ChartHeader/ChartHeader.svelte.d.ts +9 -0
  18. package/dist/ChartHeader/index.d.ts +2 -0
  19. package/{src → dist}/ChartList/ChartList.svelte +2 -16
  20. package/dist/ChartList/ChartList.svelte.d.ts +14 -0
  21. package/dist/ChartList/index.js +2 -0
  22. package/dist/Copy/Copy.svelte +21 -0
  23. package/dist/Copy/Copy.svelte.d.ts +8 -0
  24. package/dist/Copy/index.js +2 -0
  25. package/dist/DesignTokens/DesignTokens.svelte +58 -0
  26. package/dist/DesignTokens/DesignTokens.svelte.d.ts +7 -0
  27. package/dist/DesignTokens/Tokens.d.ts +26 -0
  28. package/dist/DesignTokens/Tokens.js +171 -0
  29. package/dist/DesignTokens/index.d.ts +8 -0
  30. package/{src → dist}/FormLabel/FormLabel.svelte +2 -9
  31. package/dist/FormLabel/FormLabel.svelte.d.ts +9 -0
  32. package/dist/FormLabel/index.js +2 -0
  33. package/{src → dist}/Headline/Headline.svelte +2 -7
  34. package/dist/Headline/Headline.svelte.d.ts +7 -0
  35. package/dist/Headline/index.js +2 -0
  36. package/dist/HighlightCard/HighlightCard.svelte +54 -0
  37. package/dist/HighlightCard/HighlightCard.svelte.d.ts +9 -0
  38. package/dist/HighlightCard/index.d.ts +2 -0
  39. package/dist/Input/Input.svelte +32 -0
  40. package/dist/Input/Input.svelte.d.ts +23 -0
  41. package/dist/Input/index.d.ts +2 -0
  42. package/dist/Logotype/Logotype.svelte.d.ts +26 -0
  43. package/dist/Middot/Middot.svelte.d.ts +26 -0
  44. package/dist/Middot/index.d.ts +2 -0
  45. package/dist/Note/Note.svelte +28 -0
  46. package/dist/Note/Note.svelte.d.ts +7 -0
  47. package/dist/Note/index.js +2 -0
  48. package/dist/Select/Select.svelte +39 -0
  49. package/dist/Select/Select.svelte.d.ts +4 -0
  50. package/{src/Select/Select.types.ts → dist/Select/Select.types.d.ts} +1 -2
  51. package/dist/Select/Select.types.js +1 -0
  52. package/dist/Select/index.d.ts +2 -0
  53. package/dist/Switcher/Switcher.svelte +111 -0
  54. package/dist/Switcher/Switcher.svelte.d.ts +21 -0
  55. package/dist/Switcher/index.d.ts +2 -0
  56. package/dist/assets/close-circle.svg.svelte.d.ts +26 -0
  57. package/dist/assets/grow.svg.svelte.d.ts +26 -0
  58. package/dist/assets/hand-pointer.svg.svelte.d.ts +26 -0
  59. package/dist/assets/shrink.svg.svelte.d.ts +26 -0
  60. package/dist/assets/tap.svg.svelte.d.ts +26 -0
  61. package/dist/assets/times-circle-solid.svg.svelte.d.ts +26 -0
  62. package/dist/index.d.ts +29 -0
  63. package/dist/maplibre/AttributionControl/AttributionControl.svelte +15 -0
  64. package/dist/maplibre/AttributionControl/AttributionControl.svelte.d.ts +8 -0
  65. package/dist/maplibre/AttributionControl/index.d.ts +2 -0
  66. package/dist/maplibre/GeocoderControl/GeocoderAPIs.d.ts +6 -0
  67. package/dist/maplibre/GeocoderControl/GeocoderAPIs.js +40 -0
  68. package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +25 -0
  69. package/dist/maplibre/GeocoderControl/GeocoderControl.svelte.d.ts +27 -0
  70. package/dist/maplibre/GeocoderControl/index.d.ts +2 -0
  71. package/dist/maplibre/Map/FallbackStyle.d.ts +3 -0
  72. package/dist/maplibre/Map/FallbackStyle.js +15 -0
  73. package/dist/maplibre/Map/Map.svelte +91 -0
  74. package/dist/maplibre/Map/Map.svelte.d.ts +23 -0
  75. package/dist/maplibre/Map/index.d.ts +2 -0
  76. package/dist/maplibre/MapControl/MapControl.svelte +29 -0
  77. package/dist/maplibre/MapControl/MapControl.svelte.d.ts +11 -0
  78. package/dist/maplibre/MapControl/index.d.ts +2 -0
  79. package/dist/maplibre/MapStyle/SWRDataLabLight.d.ts +3 -0
  80. package/dist/maplibre/MapStyle/SWRDataLabLight.js +60 -0
  81. package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -0
  82. package/dist/maplibre/MapStyle/components/Admin.js +170 -0
  83. package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -0
  84. package/dist/maplibre/MapStyle/components/Buildings.js +21 -0
  85. package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -0
  86. package/dist/maplibre/MapStyle/components/Landuse.js +497 -0
  87. package/dist/maplibre/MapStyle/components/Natural.d.ts +1 -0
  88. package/dist/maplibre/MapStyle/components/Natural.js +1 -0
  89. package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +4 -0
  90. package/dist/maplibre/MapStyle/components/PlaceLabels.js +194 -0
  91. package/dist/maplibre/MapStyle/components/Roads.d.ts +8 -0
  92. package/dist/maplibre/MapStyle/components/Roads.js +2327 -0
  93. package/dist/maplibre/MapStyle/components/Transit.d.ts +7 -0
  94. package/dist/maplibre/MapStyle/components/Transit.js +499 -0
  95. package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -0
  96. package/dist/maplibre/MapStyle/components/Walking.js +1530 -0
  97. package/dist/maplibre/MapStyle/index.d.ts +2 -0
  98. package/dist/maplibre/MapStyle/tokens.d.ts +20 -0
  99. package/dist/maplibre/MapStyle/tokens.js +20 -0
  100. package/dist/maplibre/NavigationControl/NavigationControl.svelte +9 -0
  101. package/dist/maplibre/NavigationControl/NavigationControl.svelte.d.ts +12 -0
  102. package/dist/maplibre/NavigationControl/index.d.ts +2 -0
  103. package/dist/maplibre/ScaleControl/ScaleControl.svelte +9 -0
  104. package/dist/maplibre/ScaleControl/ScaleControl.svelte.d.ts +9 -0
  105. package/dist/maplibre/ScaleControl/index.d.ts +2 -0
  106. package/dist/maplibre/Source/MapSource.svelte +43 -0
  107. package/dist/maplibre/Source/MapSource.svelte.d.ts +13 -0
  108. package/dist/maplibre/Source/index.d.ts +2 -0
  109. package/dist/maplibre/Source/source.d.ts +28 -0
  110. package/dist/maplibre/Source/source.js +76 -0
  111. package/dist/maplibre/Tooltip/Tooltip.svelte +46 -0
  112. package/dist/maplibre/Tooltip/Tooltip.svelte.d.ts +25 -0
  113. package/dist/maplibre/Tooltip/index.d.ts +2 -0
  114. package/dist/maplibre/VectorLayer/VectorLayer.svelte +73 -0
  115. package/dist/maplibre/VectorLayer/VectorLayer.svelte.d.ts +21 -0
  116. package/dist/maplibre/VectorLayer/index.d.ts +2 -0
  117. package/dist/maplibre/VectorTileSource/VectorTileSource.svelte +13 -0
  118. package/dist/maplibre/VectorTileSource/VectorTileSource.svelte.d.ts +11 -0
  119. package/dist/maplibre/VectorTileSource/index.d.ts +2 -0
  120. package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte +44 -0
  121. package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte.d.ts +19 -0
  122. package/dist/maplibre/WithLinkLocation/index.d.ts +2 -0
  123. package/dist/maplibre/context.svelte.d.ts +33 -0
  124. package/dist/maplibre/context.svelte.js +73 -0
  125. package/{src/maplibre/types.ts → dist/maplibre/types.d.ts} +3 -5
  126. package/dist/maplibre/types.js +1 -0
  127. package/dist/maplibre/utils.d.ts +4 -0
  128. package/dist/maplibre/utils.js +34 -0
  129. package/dist/utils/formatDate.d.ts +5 -0
  130. package/dist/utils/formatNumber.d.ts +18 -0
  131. package/dist/utils/getColorsBetween.d.ts +9 -0
  132. package/dist/utils/getComparisonDiffs.d.ts +6 -0
  133. package/dist/utils/getEmbedContext.d.ts +7 -0
  134. package/dist/utils/getEmbedContext.js +27 -0
  135. package/dist/utils/getLaenderFromTopo.d.ts +10 -0
  136. package/dist/utils/getLaenderNicenameFromAgs.d.ts +7 -0
  137. package/dist/utils/isSvelteComponent.d.ts +7 -0
  138. package/dist/utils/prepareSophoraModel.d.ts +2 -0
  139. package/dist/utils/scrollIntoViewWithOffset.d.ts +7 -0
  140. package/dist/utils/slugify.d.ts +1 -0
  141. package/dist/utils/slugify.js +11 -0
  142. package/dist/utils/topoToGeo.d.ts +7 -0
  143. package/package.json +28 -7
  144. package/.storybook/blocks/Mermaid.jsx +0 -9
  145. package/.storybook/main.ts +0 -34
  146. package/.storybook/preview-head.html +0 -13
  147. package/.storybook/preview.ts +0 -47
  148. package/.storybook/vitest.setup.ts +0 -9
  149. package/src/Autocomplete/Autocomplete.stories.svelte +0 -61
  150. package/src/Autocomplete/Autocomplete.svelte +0 -237
  151. package/src/Button/Button.stories.svelte +0 -21
  152. package/src/Button/Button.svelte +0 -52
  153. package/src/Caption/Caption.stories.svelte +0 -24
  154. package/src/Caption/Caption.svelte +0 -29
  155. package/src/Card/Card.stories.svelte +0 -19
  156. package/src/Card/Card.svelte +0 -34
  157. package/src/ChartFooter/ChartFooter.stories.svelte +0 -32
  158. package/src/ChartFooter/ChartFooter.svelte +0 -46
  159. package/src/ChartHeader/ChartHeader.stories.svelte +0 -31
  160. package/src/ChartList/ChartList.stories.svelte +0 -48
  161. package/src/Copy/Copy.stories.svelte +0 -32
  162. package/src/Copy/Copy.svelte +0 -29
  163. package/src/DesignTokens/DesignTokens.svelte +0 -71
  164. package/src/DesignTokens/Tokens.ts +0 -186
  165. package/src/FormLabel/FormLabel.stories.svelte +0 -52
  166. package/src/Headline/Headline.stories.svelte +0 -17
  167. package/src/HighlightCard/HighlightCard.stories.svelte +0 -57
  168. package/src/HighlightCard/HighlightCard.svelte +0 -65
  169. package/src/Input/Input.svelte +0 -21
  170. package/src/Logotype/Logotype.stories.svelte +0 -16
  171. package/src/Middot/Middot.stories.svelte +0 -16
  172. package/src/Note/Note.stories.svelte +0 -23
  173. package/src/Note/Note.svelte +0 -38
  174. package/src/Select/Select.stories.svelte +0 -205
  175. package/src/Select/Select.svelte +0 -76
  176. package/src/Select/SelectStoriesTemplate.svelte +0 -31
  177. package/src/Switcher/Switcher.stories.svelte +0 -44
  178. package/src/Switcher/Switcher.svelte +0 -130
  179. package/src/maplibre/AttributionControl/AttributionControl.stories.svelte +0 -29
  180. package/src/maplibre/AttributionControl/AttributionControl.svelte +0 -45
  181. package/src/maplibre/GeocoderControl/GeocoderAPIs.ts +0 -49
  182. package/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte +0 -78
  183. package/src/maplibre/GeocoderControl/GeocoderControl.svelte +0 -211
  184. package/src/maplibre/Map/FallbackStyle.ts +0 -18
  185. package/src/maplibre/Map/Map.stories.svelte +0 -118
  186. package/src/maplibre/Map/Map.svelte +0 -287
  187. package/src/maplibre/MapControl/MapControl.stories.svelte +0 -56
  188. package/src/maplibre/MapControl/MapControl.svelte +0 -41
  189. package/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte +0 -41
  190. package/src/maplibre/MapStyle/SWRDataLabLight.ts +0 -72
  191. package/src/maplibre/MapStyle/components/Admin.ts +0 -173
  192. package/src/maplibre/MapStyle/components/Buildings.ts +0 -23
  193. package/src/maplibre/MapStyle/components/Landuse.ts +0 -499
  194. package/src/maplibre/MapStyle/components/Natural.ts +0 -1
  195. package/src/maplibre/MapStyle/components/PlaceLabels.ts +0 -199
  196. package/src/maplibre/MapStyle/components/Roads.ts +0 -2345
  197. package/src/maplibre/MapStyle/components/Transit.ts +0 -507
  198. package/src/maplibre/MapStyle/components/Walking.ts +0 -1538
  199. package/src/maplibre/MapStyle/tokens.ts +0 -21
  200. package/src/maplibre/NavigationControl/NavigationControl.stories.svelte +0 -39
  201. package/src/maplibre/NavigationControl/NavigationControl.svelte +0 -36
  202. package/src/maplibre/ScaleControl/ScaleControl.stories.svelte +0 -71
  203. package/src/maplibre/ScaleControl/ScaleControl.svelte +0 -25
  204. package/src/maplibre/Source/MapSource.stories.svelte +0 -9
  205. package/src/maplibre/Source/MapSource.svelte +0 -61
  206. package/src/maplibre/Source/source.ts +0 -89
  207. package/src/maplibre/Tooltip/Tooltip.stories.svelte +0 -192
  208. package/src/maplibre/Tooltip/Tooltip.svelte +0 -183
  209. package/src/maplibre/VectorLayer/VectorLayer.stories.svelte +0 -65
  210. package/src/maplibre/VectorLayer/VectorLayer.svelte +0 -146
  211. package/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte +0 -46
  212. package/src/maplibre/VectorTileSource/VectorTileSource.svelte +0 -24
  213. package/src/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +0 -29
  214. package/src/maplibre/WithLinkLocation/WithLinkLocation.svelte +0 -83
  215. package/src/maplibre/context.svelte.ts +0 -89
  216. package/src/maplibre/utils.ts +0 -52
  217. package/src/utils/getEmbedContext.js +0 -28
  218. package/src/utils/slugify.ts +0 -12
  219. package/static/favicon.png +0 -0
  220. package/svelte.config.js +0 -18
  221. package/tsconfig.json +0 -19
  222. package/vite.config.ts +0 -6
  223. package/vitest.workspace.ts +0 -32
  224. /package/{src → dist}/Autocomplete/index.js +0 -0
  225. /package/{src → dist}/Button/index.js +0 -0
  226. /package/{src/Caption/index.ts → dist/Caption/index.d.ts} +0 -0
  227. /package/{src → dist}/Card/index.js +0 -0
  228. /package/{src → dist}/ChartFooter/ChartFooter.mdx +0 -0
  229. /package/{src → dist}/ChartFooter/index.js +0 -0
  230. /package/{src → dist}/ChartHeader/ChartHeader.mdx +0 -0
  231. /package/{src → dist}/ChartHeader/index.js +0 -0
  232. /package/{src → dist}/ChartList/ChartList.mdx +0 -0
  233. /package/{src/ChartList/index.ts → dist/ChartList/index.d.ts} +0 -0
  234. /package/{src/Copy/index.ts → dist/Copy/index.d.ts} +0 -0
  235. /package/{src → dist}/DesignTokens/DesignTokens.mdx +0 -0
  236. /package/{src → dist}/DesignTokens/index.js +0 -0
  237. /package/{src → dist}/FormLabel/FormLabel.mdx +0 -0
  238. /package/{src/FormLabel/index.ts → dist/FormLabel/index.d.ts} +0 -0
  239. /package/{src/Headline/index.ts → dist/Headline/index.d.ts} +0 -0
  240. /package/{src → dist}/HighlightCard/index.js +0 -0
  241. /package/{src → dist}/Input/index.js +0 -0
  242. /package/{src → dist}/Intro.mdx +0 -0
  243. /package/{src → dist}/Logotype/Logotype.svelte +0 -0
  244. /package/{src → dist}/Middot/Middot.svelte +0 -0
  245. /package/{src → dist}/Middot/index.js +0 -0
  246. /package/{src/Note/index.ts → dist/Note/index.d.ts} +0 -0
  247. /package/{src → dist}/Select/Select.mdx +0 -0
  248. /package/{src → dist}/Select/index.js +0 -0
  249. /package/{src → dist}/Select/mock_data/jobs.json +0 -0
  250. /package/{src → dist}/Switcher/Switcher.mdx +0 -0
  251. /package/{src → dist}/Switcher/index.js +0 -0
  252. /package/{src → dist}/app.d.ts +0 -0
  253. /package/{src → dist}/app.html +0 -0
  254. /package/{src → dist}/assets/close-circle.svg.svelte +0 -0
  255. /package/{src → dist}/assets/grow.svg.svelte +0 -0
  256. /package/{src → dist}/assets/hand-pointer.svg.svelte +0 -0
  257. /package/{src → dist}/assets/shrink.svg.svelte +0 -0
  258. /package/{src → dist}/assets/tap.svg.svelte +0 -0
  259. /package/{src → dist}/assets/times-circle-solid.svg.svelte +0 -0
  260. /package/{src → dist}/index.js +0 -0
  261. /package/{src → dist}/maplibre/AttributionControl/index.js +0 -0
  262. /package/{src → dist}/maplibre/GeocoderControl/index.js +0 -0
  263. /package/{src → dist}/maplibre/Map/index.js +0 -0
  264. /package/{src → dist}/maplibre/MapControl/MapControl.mdx +0 -0
  265. /package/{src → dist}/maplibre/MapControl/index.js +0 -0
  266. /package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.mdx +0 -0
  267. /package/{src → dist}/maplibre/MapStyle/index.js +0 -0
  268. /package/{src → dist}/maplibre/Maplibre.mdx +0 -0
  269. /package/{src → dist}/maplibre/NavigationControl/index.js +0 -0
  270. /package/{src → dist}/maplibre/ScaleControl/index.js +0 -0
  271. /package/{src → dist}/maplibre/Source/index.js +0 -0
  272. /package/{src → dist}/maplibre/Tooltip/index.js +0 -0
  273. /package/{src → dist}/maplibre/VectorLayer/index.js +0 -0
  274. /package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.mdx +0 -0
  275. /package/{src → dist}/maplibre/VectorTileSource/index.js +0 -0
  276. /package/{src → dist}/maplibre/WithLinkLocation/WithLinkLocation.mdx +0 -0
  277. /package/{src → dist}/maplibre/WithLinkLocation/index.js +0 -0
  278. /package/{src → dist}/styles/base.scss +0 -0
  279. /package/{src → dist}/utils/formatDate.js +0 -0
  280. /package/{src → dist}/utils/formatNumber.js +0 -0
  281. /package/{src → dist}/utils/getColorsBetween.js +0 -0
  282. /package/{src → dist}/utils/getComparisonDiffs.js +0 -0
  283. /package/{src → dist}/utils/getLaenderFromTopo.js +0 -0
  284. /package/{src → dist}/utils/getLaenderNicenameFromAgs.js +0 -0
  285. /package/{src → dist}/utils/isSvelteComponent.js +0 -0
  286. /package/{src → dist}/utils/prepareSophoraModel.js +0 -0
  287. /package/{src → dist}/utils/scrollIntoViewWithOffset.js +0 -0
  288. /package/{src → dist}/utils/topoToGeo.js +0 -0
@@ -0,0 +1,237 @@
1
+ <script lang="ts">import { createEventDispatcher } from 'svelte';
2
+ import Circle from '../assets/times-circle-solid.svg.svelte';
3
+ import Caption from '../Caption/Caption.svelte';
4
+ export let data = [];
5
+ export let query = '';
6
+ export let placeholder = 'Platzhalter';
7
+ export let label;
8
+ export let name;
9
+ const sortData = (a, b) => {
10
+ return a.value.localeCompare(b.value);
11
+ };
12
+ let listRef;
13
+ let inputRef;
14
+ let controlsRef;
15
+ const dispatch = createEventDispatcher();
16
+ const maxSuggestions = 100;
17
+ let highlightedItemIndex = -1;
18
+ $: suggestions = data.sort(sortData).slice(0, maxSuggestions);
19
+ $: isActive = false;
20
+ // Insert clicked item into search input,
21
+ // dispatch it as select event and close the dropdown
22
+ const handleItemClick = (index) => {
23
+ highlightedItemIndex = index;
24
+ setSelectedItem(suggestions[highlightedItemIndex]);
25
+ };
26
+ const setSelectedItem = (item) => {
27
+ query = item.value;
28
+ isActive = false;
29
+ dispatch('select', { item });
30
+ };
31
+ // Register keyboard events
32
+ const handleKeyDown = (e) => {
33
+ if (e.key === 'ArrowDown') {
34
+ e.preventDefault();
35
+ highlightedItemIndex =
36
+ highlightedItemIndex < suggestions.length - 1 ? highlightedItemIndex + 1 : 0;
37
+ const target = listRef.querySelector(`ul li:nth-child(${highlightedItemIndex + 1})`);
38
+ target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
39
+ }
40
+ else if (e.key === 'ArrowUp') {
41
+ e.preventDefault();
42
+ highlightedItemIndex =
43
+ highlightedItemIndex > 0 ? highlightedItemIndex - 1 : suggestions.length - 1;
44
+ const target = listRef.querySelector(`ul li:nth-child(${highlightedItemIndex + 1})`);
45
+ target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
46
+ }
47
+ else if (e.key === 'Enter') {
48
+ if (highlightedItemIndex > -1) {
49
+ setSelectedItem(suggestions[highlightedItemIndex]);
50
+ isActive = false;
51
+ }
52
+ }
53
+ };
54
+ const handleClear = () => {
55
+ query = '';
56
+ inputRef.focus();
57
+ setSuggestions();
58
+ dispatch('select', {
59
+ item: null
60
+ });
61
+ };
62
+ const setSuggestions = () => {
63
+ suggestions = data
64
+ .filter((el) => {
65
+ return el.value.toLowerCase().startsWith(query.toLowerCase());
66
+ })
67
+ .slice(0, maxSuggestions)
68
+ .sort(sortData);
69
+ };
70
+ // update dropdown list if input value changes
71
+ const handleInput = () => {
72
+ isActive = true;
73
+ if (query.length === 0) {
74
+ suggestions = data;
75
+ }
76
+ else {
77
+ setSuggestions();
78
+ highlightedItemIndex = -1;
79
+ }
80
+ };
81
+ </script>
82
+
83
+ <!--
84
+ This component is used to display a list of suggestions for a given query. If an item is clicked or the enter key is pressed, the selected item will be returned by a custom select event.
85
+
86
+ Data should be provided as array of objects. Each object contains the information for a dropdown entry:
87
+ - **value** *string* the text that is displayed in the input. Has to be unique!
88
+ - **label** *string* | *svelte component* | *array of svelte component and props object* text, html or component displayed in the dropdown list
89
+ - **details** *object* extra data needed by selection handler
90
+ @component
91
+ -->
92
+
93
+ <div class="autocomplete" class:active={isActive}>
94
+ <label for={name}>{label}</label>
95
+ <input
96
+ type="text"
97
+ {name}
98
+ {placeholder}
99
+ autocomplete="off"
100
+ autocorrect="off"
101
+ autocapitalize="off"
102
+ data-testid="autocomplete-input"
103
+ bind:this={inputRef}
104
+ bind:value={query}
105
+ on:keydown={handleKeyDown}
106
+ on:input={handleInput}
107
+ on:focus={() => {
108
+ isActive = true;
109
+ }}
110
+ on:blur={(e) => {
111
+ if (listRef.contains(e.relatedTarget)) {
112
+ window.setTimeout(() => {
113
+ isActive = false;
114
+ }, 100);
115
+ } else if (!controlsRef.contains(e.relatedTarget)) {
116
+ isActive = false;
117
+ }
118
+ }}
119
+ />
120
+
121
+ <ul tabindex="-1" bind:this={listRef}>
122
+ {#each suggestions as item, i (item.value)}
123
+ <li>
124
+ <button
125
+ class={`item ${i === highlightedItemIndex ? 'active' : ''}`}
126
+ tabindex="-1"
127
+ type="button"
128
+ on:click={(e) => {
129
+ e.preventDefault();
130
+ handleItemClick(i);
131
+ }}
132
+ >
133
+ <Caption>
134
+ {item.label}
135
+ </Caption>
136
+ </button>
137
+ </li>
138
+ {/each}
139
+ </ul>
140
+ <div class="controls" bind:this={controlsRef}>
141
+ <button type="button" on:click={handleClear} class="clear" class:active={query.length > 0}>
142
+ <Circle />
143
+ </button>
144
+ </div>
145
+ </div>
146
+
147
+ <style>.autocomplete input {
148
+ font-family: var(--swr-sans);
149
+ font-size: 1.1rem;
150
+ line-height: 1.45;
151
+ letter-spacing: 0.0045em;
152
+ height: 2.5em;
153
+ width: 100%;
154
+ border: 1px solid currentColor;
155
+ border-radius: var(--br-small);
156
+ background: transparent;
157
+ padding: 0 0.5em;
158
+ padding-top: 0.1em;
159
+ color: currentColor;
160
+ margin: 0;
161
+ display: block;
162
+ text-size-adjust: none;
163
+ }
164
+ .autocomplete input:focus-visible {
165
+ outline: 4px solid rgba(255, 255, 255, 0.4);
166
+ }
167
+
168
+ .autocomplete {
169
+ position: relative;
170
+ display: block;
171
+ color: white;
172
+ display: flex;
173
+ flex-flow: column;
174
+ }
175
+ .autocomplete input {
176
+ width: auto;
177
+ }
178
+ .autocomplete ul {
179
+ position: absolute;
180
+ top: 100%;
181
+ border: 1px solid currentColor;
182
+ background: var(--violet-dark-3);
183
+ border-bottom-left-radius: var(--br-small);
184
+ border-bottom-right-radius: var(--br-small);
185
+ border-top: 0;
186
+ left: 0;
187
+ right: 0;
188
+ max-height: 10rem;
189
+ overflow-y: scroll;
190
+ z-index: 1000;
191
+ opacity: 0;
192
+ transition: 100ms;
193
+ pointer-events: none;
194
+ }
195
+ .autocomplete ul:empty {
196
+ box-shadow: none;
197
+ }
198
+ .autocomplete ul .item {
199
+ padding: 0.5em;
200
+ width: 100%;
201
+ background: transparent;
202
+ border: 0;
203
+ text-align: left;
204
+ color: currentColor;
205
+ border-bottom: 1px solid rgba(255, 255, 255, 0.25);
206
+ cursor: pointer;
207
+ }
208
+ .autocomplete ul .item.active, .autocomplete ul .item:hover {
209
+ text-decoration: underline;
210
+ background-color: rgba(255, 255, 255, 0.05);
211
+ }
212
+ .autocomplete .clear {
213
+ position: absolute;
214
+ top: 50%;
215
+ right: 0.75rem;
216
+ width: 1.2rem;
217
+ height: 1.2rem;
218
+ background: transparent;
219
+ border: 0;
220
+ display: none;
221
+ color: white;
222
+ }
223
+ .autocomplete .clear.active {
224
+ display: block;
225
+ }
226
+ .autocomplete .clear:hover, .autocomplete .clear:focus {
227
+ color: var(--red-base);
228
+ cursor: pointer;
229
+ }
230
+ .autocomplete.active ul {
231
+ opacity: 1;
232
+ pointer-events: all;
233
+ }
234
+ .autocomplete.active input {
235
+ border-bottom-right-radius: 0;
236
+ border-bottom-left-radius: 0;
237
+ }</style>
@@ -0,0 +1,34 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ /**
15
+ * This component is used to display a list of suggestions for a given query. If an item is clicked or the enter key is pressed, the selected item will be returned by a custom select event.
16
+ *
17
+ * Data should be provided as array of objects. Each object contains the information for a dropdown entry:
18
+ * - **value** *string* the text that is displayed in the input. Has to be unique!
19
+ * - **label** *string* | *svelte component* | *array of svelte component and props object* text, html or component displayed in the dropdown list
20
+ * - **details** *object* extra data needed by selection handler
21
+ */
22
+ declare const Autocomplete: $$__sveltets_2_IsomorphicComponent<{
23
+ data?: any[];
24
+ query?: string;
25
+ placeholder?: string;
26
+ label: string;
27
+ name: string;
28
+ }, {
29
+ select: CustomEvent<any>;
30
+ } & {
31
+ [evt: string]: CustomEvent<any>;
32
+ }, {}, {}, string>;
33
+ type Autocomplete = InstanceType<typeof Autocomplete>;
34
+ export default Autocomplete;
@@ -0,0 +1,2 @@
1
+ export default Autocomplete;
2
+ import Autocomplete from './Autocomplete.svelte';
@@ -0,0 +1,38 @@
1
+ <script lang="ts">import Copy from '../Copy/Copy.svelte';
2
+ const { as = 'button', label, href, disabled, onclick } = $props();
3
+ </script>
4
+
5
+ {#if as === 'a'}
6
+ <a class="button" class:disabled {href}>
7
+ <Copy weight="bold">
8
+ {label}
9
+ </Copy>
10
+ </a>
11
+ {:else}
12
+ <button class="button" {onclick} {disabled}>
13
+ <Copy weight="bold">
14
+ {label}
15
+ </Copy>
16
+ </button>
17
+ {/if}
18
+
19
+ <style>.button {
20
+ background: var(--violet-dark-3);
21
+ display: inline-flex;
22
+ align-items: center;
23
+ justify-self: flex-start;
24
+ padding: 0.45em 1.25em;
25
+ color: white;
26
+ border: 1px solid rgba(255, 255, 255, 0.1);
27
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.05);
28
+ border-radius: var(--br-small);
29
+ text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.05);
30
+ text-decoration: none;
31
+ }
32
+ .button:hover, .button:focus-visible {
33
+ text-decoration: underline;
34
+ text-underline-offset: 0.15em;
35
+ }
36
+ .button.disabled, .button:disabled {
37
+ opacity: 0.5;
38
+ }</style>
@@ -0,0 +1,10 @@
1
+ interface ButtonProps {
2
+ label: string;
3
+ as?: 'button' | 'a';
4
+ href?: string;
5
+ disabled?: boolean;
6
+ onclick?: (e: MouseEvent) => any | void;
7
+ }
8
+ declare const Button: import("svelte").Component<ButtonProps, {}, "">;
9
+ type Button = ReturnType<typeof Button>;
10
+ export default Button;
@@ -0,0 +1,2 @@
1
+ export default Button;
2
+ import Button from './Button.svelte';
@@ -0,0 +1,21 @@
1
+ <script lang="ts">let { weight = 'regular', children } = $props();
2
+ export {};
3
+ </script>
4
+
5
+ <div class={['container', weight]}>
6
+ {#if children}
7
+ {@render children()}
8
+ {/if}
9
+ </div>
10
+
11
+ <style>.container {
12
+ font-family: var(--swr-sans);
13
+ font-size: var(--fs-small-2);
14
+ line-height: 1;
15
+ letter-spacing: 0.0045em;
16
+ }
17
+
18
+ .bold {
19
+ font-weight: 585;
20
+ letter-spacing: 0;
21
+ }</style>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface CaptionProps {
3
+ weight?: 'regular' | 'bold';
4
+ children?: Snippet;
5
+ }
6
+ declare const Caption: import("svelte").Component<CaptionProps, {}, "">;
7
+ type Caption = ReturnType<typeof Caption>;
8
+ export default Caption;
@@ -0,0 +1,2 @@
1
+ import Caption from './Caption.svelte';
2
+ export default Caption;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">import Copy from '../Copy/Copy.svelte';
2
+ let { children } = $props();
3
+ </script>
4
+
5
+ <div class="card">
6
+ {#if children}
7
+ <Copy>
8
+ {@render children()}
9
+ </Copy>
10
+ {/if}
11
+ </div>
12
+
13
+ <style>.card {
14
+ color: white;
15
+ width: auto;
16
+ max-width: var(--app-max-width);
17
+ background: var(--violet-dark-5);
18
+ border-radius: var(--br-large);
19
+ padding: 1.5rem;
20
+ }
21
+ @media (min-width: 768px) {
22
+ .card {
23
+ padding: 2.5rem;
24
+ }
25
+ }</style>
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface CardProps {
3
+ children?: Snippet;
4
+ }
5
+ declare const Card: import("svelte").Component<CardProps, {}, "">;
6
+ type Card = ReturnType<typeof Card>;
7
+ export default Card;
@@ -0,0 +1,2 @@
1
+ export default Card;
2
+ import Card from './Card.svelte';
@@ -0,0 +1,38 @@
1
+ <script lang="ts">import Logotype from '../Logotype/Logotype.svelte';
2
+ import Note from '../Note/Note.svelte';
3
+ let { layout = 'one-up', children } = $props();
4
+ </script>
5
+
6
+ <footer class={`container ${layout}`}>
7
+ {#if children}
8
+ <Note>
9
+ {@render children()}
10
+ </Note>
11
+ {/if}
12
+ <Logotype />
13
+ </footer>
14
+
15
+ <style>.container {
16
+ gap: 0.5rem;
17
+ }
18
+ .container :global(div) {
19
+ width: 100%;
20
+ }
21
+
22
+ .one-up {
23
+ display: flex;
24
+ flex-flow: column;
25
+ align-items: flex-start;
26
+ }
27
+
28
+ .two-up {
29
+ display: grid;
30
+ grid-template-columns: 1fr;
31
+ }
32
+ @media (min-width: 425px) {
33
+ .two-up {
34
+ grid-template-columns: 2.5fr 1fr;
35
+ align-items: last baseline;
36
+ justify-items: flex-end;
37
+ }
38
+ }</style>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface ChartFooterProps {
3
+ layout: 'one-up' | 'two-up';
4
+ children?: Snippet;
5
+ }
6
+ declare const ChartFooter: import("svelte").Component<ChartFooterProps, {}, "">;
7
+ type ChartFooter = ReturnType<typeof ChartFooter>;
8
+ export default ChartFooter;
@@ -0,0 +1,2 @@
1
+ export default ChartFooter;
2
+ import ChartFooter from './ChartFooter.svelte';
@@ -1,15 +1,7 @@
1
- <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
- import Headline from '../Headline/Headline.svelte';
4
- import Copy from '../Copy/Copy.svelte';
5
- import slugify from '../utils/slugify';
6
-
7
- interface ChartHeaderProps {
8
- title: string;
9
- subtitle?: string;
10
- children?: Snippet;
11
- }
12
- let { title, subtitle, children }: ChartHeaderProps = $props();
1
+ <script lang="ts">import Headline from '../Headline/Headline.svelte';
2
+ import Copy from '../Copy/Copy.svelte';
3
+ import slugify from '../utils/slugify';
4
+ let { title, subtitle, children } = $props();
13
5
  </script>
14
6
 
15
7
  <header class="container" id={slugify(title)}>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface ChartHeaderProps {
3
+ title: string;
4
+ subtitle?: string;
5
+ children?: Snippet;
6
+ }
7
+ declare const ChartHeader: import("svelte").Component<ChartHeaderProps, {}, "">;
8
+ type ChartHeader = ReturnType<typeof ChartHeader>;
9
+ export default ChartHeader;
@@ -0,0 +1,2 @@
1
+ export default ChartHeader;
2
+ import ChartHeader from './ChartHeader.svelte';
@@ -1,19 +1,5 @@
1
- <script lang="ts">
2
- import { dev } from '$app/environment';
3
-
4
- type ProjectPrefix = 'p' | 't';
5
- type ProjectIdentifier = `${ProjectPrefix}${number}: ${string}`;
6
-
7
- interface ChartSpec {
8
- title: string;
9
- slug: string;
10
- }
11
- interface ChartListProps {
12
- project?: ProjectIdentifier;
13
- charts?: ChartSpec[];
14
- baseUrl?: string;
15
- }
16
- let { project, charts, baseUrl }: ChartListProps = $props();
1
+ <script lang="ts">import { dev } from '$app/environment';
2
+ let { project, charts, baseUrl } = $props();
17
3
  </script>
18
4
 
19
5
  <main>
@@ -0,0 +1,14 @@
1
+ type ProjectPrefix = 'p' | 't';
2
+ type ProjectIdentifier = `${ProjectPrefix}${number}: ${string}`;
3
+ interface ChartSpec {
4
+ title: string;
5
+ slug: string;
6
+ }
7
+ interface ChartListProps {
8
+ project?: ProjectIdentifier;
9
+ charts?: ChartSpec[];
10
+ baseUrl?: string;
11
+ }
12
+ declare const ChartList: import("svelte").Component<ChartListProps, {}, "">;
13
+ type ChartList = ReturnType<typeof ChartList>;
14
+ export default ChartList;
@@ -0,0 +1,2 @@
1
+ import ChartList from './ChartList.svelte';
2
+ export default ChartList;
@@ -0,0 +1,21 @@
1
+ <script lang="ts">let { weight = 'regular', children } = $props();
2
+ export {};
3
+ </script>
4
+
5
+ <div class={['container', weight]}>
6
+ {#if children}
7
+ {@render children()}
8
+ {/if}
9
+ </div>
10
+
11
+ <style>.container {
12
+ font-family: var(--swr-sans);
13
+ font-size: var(--fs-base);
14
+ letter-spacing: 0.005em;
15
+ line-height: 1.475;
16
+ }
17
+
18
+ .bold {
19
+ font-weight: 585;
20
+ letter-spacing: 0;
21
+ }</style>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface CopyProps {
3
+ weight?: 'regular' | 'bold';
4
+ children?: Snippet;
5
+ }
6
+ declare const Copy: import("svelte").Component<CopyProps, {}, "">;
7
+ type Copy = ReturnType<typeof Copy>;
8
+ export default Copy;
@@ -0,0 +1,2 @@
1
+ import Copy from './Copy.svelte';
2
+ export default Copy;
@@ -0,0 +1,58 @@
1
+ <script lang="ts">import { shades } from './Tokens';
2
+ let { children } = $props();
3
+ const rules = [
4
+ ...Object.keys(shades).map((key) => {
5
+ return Object.entries(shades[key])
6
+ .map(([shade, value]) => {
7
+ const [ldb, index] = shade.split(/(\d+)/);
8
+ return ldb === 'base'
9
+ ? `--${key}-${ldb}: ${value}`
10
+ : `--${key}-${ldb}-${index}: ${value}`;
11
+ })
12
+ .join(';');
13
+ })
14
+ ];
15
+ </script>
16
+
17
+ <div class="container" style={rules.join(';')}>
18
+ {#if children}
19
+ {@render children()}
20
+ {/if}
21
+ </div>
22
+
23
+ <style>:global(*) {
24
+ margin: 0;
25
+ padding: 0;
26
+ }
27
+
28
+ .container {
29
+ display: contents;
30
+ --fast: 150ms;
31
+ --slow: 300ms;
32
+ --app-max-width: 40rem;
33
+ --br-large: 8px;
34
+ --br-small: 4px;
35
+ --input-height: 2.5rem;
36
+ --swr-text: "SWR-VAR-Text", sans-serif;
37
+ --swr-sans: "SWR-VAR-Sans", sans-serif;
38
+ --fs-small-3: 0.75rem;
39
+ --fs-small-2: 0.875rem;
40
+ --fs-small-1: 1rem;
41
+ --fs-base: 1.125rem;
42
+ --fs-large-1: 1.25rem;
43
+ --fs-large-2: 1.5rem;
44
+ --fs-large-3: 1.75rem;
45
+ --fs-large-4: 2.25rem;
46
+ }
47
+ @media (min-width: 768px) {
48
+ .container {
49
+ --fs-small-3: 0.75rem;
50
+ --fs-small-2: 0.875rem;
51
+ --fs-small-1: 1rem;
52
+ --fs-base: 1.25rem;
53
+ --fs-large-1: 1.5rem;
54
+ --fs-large-2: 2rem;
55
+ --fs-large-3: 2.5rem;
56
+ --fs-large-4: 3.5rem;
57
+ }
58
+ }</style>
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface DesignTokensProps {
3
+ children?: Snippet;
4
+ }
5
+ declare const DesignTokens: import("svelte").Component<DesignTokensProps, {}, "">;
6
+ type DesignTokens = ReturnType<typeof DesignTokens>;
7
+ export default DesignTokens;
@@ -0,0 +1,26 @@
1
+ interface ColourMap {
2
+ [index: string]: ColourPalette | ColourList;
3
+ }
4
+ interface ColourPalette {
5
+ [index: string]: string;
6
+ }
7
+ interface ColourList {
8
+ [index: number]: string;
9
+ }
10
+ declare const shades: ColourMap;
11
+ declare const scales: ColourMap;
12
+ declare const typography: {
13
+ wide: {
14
+ sizes: {
15
+ 'fs-small-3': string;
16
+ 'fs-small-2': string;
17
+ 'fs-small-1': string;
18
+ 'fs-base': string;
19
+ 'fs-large-1': string;
20
+ 'fs-large-2': string;
21
+ 'fs-large-3': string;
22
+ 'fs-large-4': string;
23
+ };
24
+ };
25
+ };
26
+ export { shades, scales, typography };