@swr-data-lab/components 1.12.5 → 1.13.1

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 (332) hide show
  1. package/dist/Autocomplete/Autocomplete.stories.svelte.d.ts +27 -0
  2. package/dist/Autocomplete/Autocomplete.svelte +237 -0
  3. package/dist/Autocomplete/Autocomplete.svelte.d.ts +34 -0
  4. package/dist/Autocomplete/index.d.ts +2 -0
  5. package/dist/Button/Button.stories.svelte +19 -0
  6. package/dist/Button/Button.stories.svelte.d.ts +19 -0
  7. package/dist/Button/Button.svelte +38 -0
  8. package/dist/Button/Button.svelte.d.ts +10 -0
  9. package/dist/Button/index.d.ts +2 -0
  10. package/dist/Caption/Caption.stories.svelte.d.ts +27 -0
  11. package/dist/Caption/Caption.svelte +21 -0
  12. package/dist/Caption/Caption.svelte.d.ts +8 -0
  13. package/dist/Caption/index.js +2 -0
  14. package/dist/Card/Card.stories.svelte +17 -0
  15. package/dist/Card/Card.stories.svelte.d.ts +19 -0
  16. package/dist/Card/Card.svelte +25 -0
  17. package/dist/Card/Card.svelte.d.ts +7 -0
  18. package/dist/Card/index.d.ts +2 -0
  19. package/dist/ChartFooter/ChartFooter.stories.svelte.d.ts +27 -0
  20. package/dist/ChartFooter/ChartFooter.svelte +38 -0
  21. package/dist/ChartFooter/ChartFooter.svelte.d.ts +8 -0
  22. package/dist/ChartFooter/index.d.ts +2 -0
  23. package/dist/ChartHeader/ChartHeader.stories.svelte.d.ts +27 -0
  24. package/{src → dist}/ChartHeader/ChartHeader.svelte +4 -12
  25. package/dist/ChartHeader/ChartHeader.svelte.d.ts +9 -0
  26. package/dist/ChartHeader/index.d.ts +2 -0
  27. package/dist/ChartList/ChartList.mdx +13 -0
  28. package/dist/ChartList/ChartList.stories.svelte +48 -0
  29. package/dist/ChartList/ChartList.stories.svelte.d.ts +27 -0
  30. package/dist/ChartList/ChartList.svelte +103 -0
  31. package/dist/ChartList/ChartList.svelte.d.ts +14 -0
  32. package/dist/ChartList/index.d.ts +2 -0
  33. package/dist/ChartList/index.js +2 -0
  34. package/dist/Copy/Copy.stories.svelte.d.ts +27 -0
  35. package/dist/Copy/Copy.svelte +21 -0
  36. package/dist/Copy/Copy.svelte.d.ts +8 -0
  37. package/dist/Copy/index.js +2 -0
  38. package/dist/DesignTokens/DesignTokens.svelte +58 -0
  39. package/dist/DesignTokens/DesignTokens.svelte.d.ts +7 -0
  40. package/dist/DesignTokens/Tokens.d.ts +26 -0
  41. package/dist/DesignTokens/Tokens.js +171 -0
  42. package/dist/DesignTokens/index.d.ts +8 -0
  43. package/dist/FormLabel/FormLabel.stories.svelte.d.ts +27 -0
  44. package/{src → dist}/FormLabel/FormLabel.svelte +2 -9
  45. package/dist/FormLabel/FormLabel.svelte.d.ts +9 -0
  46. package/dist/FormLabel/index.js +2 -0
  47. package/dist/Headline/Headline.stories.svelte.d.ts +27 -0
  48. package/{src → dist}/Headline/Headline.svelte +2 -7
  49. package/dist/Headline/Headline.svelte.d.ts +7 -0
  50. package/dist/Headline/index.js +2 -0
  51. package/{src → dist}/HighlightCard/HighlightCard.stories.svelte +7 -9
  52. package/dist/HighlightCard/HighlightCard.stories.svelte.d.ts +19 -0
  53. package/dist/HighlightCard/HighlightCard.svelte +54 -0
  54. package/dist/HighlightCard/HighlightCard.svelte.d.ts +9 -0
  55. package/dist/HighlightCard/index.d.ts +2 -0
  56. package/dist/Input/Input.svelte +32 -0
  57. package/dist/Input/Input.svelte.d.ts +23 -0
  58. package/dist/Input/index.d.ts +2 -0
  59. package/dist/Intro.mdx +7 -0
  60. package/dist/Logotype/Logotype.stories.svelte +14 -0
  61. package/dist/Logotype/Logotype.stories.svelte.d.ts +19 -0
  62. package/dist/Logotype/Logotype.svelte.d.ts +26 -0
  63. package/dist/Middot/Middot.stories.svelte +14 -0
  64. package/dist/Middot/Middot.stories.svelte.d.ts +19 -0
  65. package/dist/Middot/Middot.svelte.d.ts +26 -0
  66. package/dist/Middot/index.d.ts +2 -0
  67. package/dist/Note/Note.stories.svelte.d.ts +27 -0
  68. package/dist/Note/Note.svelte +28 -0
  69. package/dist/Note/Note.svelte.d.ts +7 -0
  70. package/dist/Note/index.js +2 -0
  71. package/{src → dist}/Select/Select.stories.svelte +12 -15
  72. package/dist/Select/Select.stories.svelte.d.ts +19 -0
  73. package/dist/Select/Select.svelte +39 -0
  74. package/dist/Select/Select.svelte.d.ts +4 -0
  75. package/{src/Select/Select.types.ts → dist/Select/Select.types.d.ts} +1 -2
  76. package/dist/Select/Select.types.js +1 -0
  77. package/dist/Select/SelectStoriesTemplate.svelte.d.ts +15 -0
  78. package/dist/Select/index.d.ts +2 -0
  79. package/dist/Switcher/Switcher.stories.svelte.d.ts +27 -0
  80. package/dist/Switcher/Switcher.svelte +111 -0
  81. package/dist/Switcher/Switcher.svelte.d.ts +21 -0
  82. package/dist/Switcher/index.d.ts +2 -0
  83. package/{src → dist}/app.d.ts +1 -1
  84. package/dist/assets/close-circle.svg.svelte.d.ts +26 -0
  85. package/dist/assets/grow.svg.svelte.d.ts +26 -0
  86. package/dist/assets/hand-pointer.svg.svelte.d.ts +26 -0
  87. package/dist/assets/shrink.svg.svelte.d.ts +26 -0
  88. package/dist/assets/tap.svg.svelte.d.ts +26 -0
  89. package/dist/assets/times-circle-solid.svg.svelte.d.ts +26 -0
  90. package/dist/index.d.ts +29 -0
  91. package/{src → dist}/index.js +3 -0
  92. package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte +27 -0
  93. package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte.d.ts +19 -0
  94. package/dist/maplibre/AttributionControl/AttributionControl.svelte +15 -0
  95. package/dist/maplibre/AttributionControl/AttributionControl.svelte.d.ts +8 -0
  96. package/dist/maplibre/AttributionControl/index.d.ts +2 -0
  97. package/dist/maplibre/GeocoderControl/GeocoderAPIs.d.ts +6 -0
  98. package/dist/maplibre/GeocoderControl/GeocoderAPIs.js +40 -0
  99. package/{src → dist}/maplibre/GeocoderControl/GeocoderControl.stories.svelte +10 -14
  100. package/dist/maplibre/GeocoderControl/GeocoderControl.stories.svelte.d.ts +19 -0
  101. package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +25 -0
  102. package/dist/maplibre/GeocoderControl/GeocoderControl.svelte.d.ts +27 -0
  103. package/dist/maplibre/GeocoderControl/index.d.ts +2 -0
  104. package/dist/maplibre/Map/FallbackStyle.d.ts +3 -0
  105. package/dist/maplibre/Map/FallbackStyle.js +15 -0
  106. package/{src → dist}/maplibre/Map/Map.stories.svelte +19 -24
  107. package/dist/maplibre/Map/Map.stories.svelte.d.ts +19 -0
  108. package/dist/maplibre/Map/Map.svelte +91 -0
  109. package/dist/maplibre/Map/Map.svelte.d.ts +23 -0
  110. package/dist/maplibre/Map/index.d.ts +2 -0
  111. package/dist/maplibre/MapControl/MapControl.stories.svelte +46 -0
  112. package/dist/maplibre/MapControl/MapControl.stories.svelte.d.ts +19 -0
  113. package/dist/maplibre/MapControl/MapControl.svelte +29 -0
  114. package/dist/maplibre/MapControl/MapControl.svelte.d.ts +11 -0
  115. package/dist/maplibre/MapControl/index.d.ts +2 -0
  116. package/dist/maplibre/MapStyle/SWRDataLabLight.d.ts +3 -0
  117. package/dist/maplibre/MapStyle/SWRDataLabLight.js +60 -0
  118. package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.stories.svelte +10 -12
  119. package/dist/maplibre/MapStyle/SWRDataLabLight.stories.svelte.d.ts +18 -0
  120. package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -0
  121. package/dist/maplibre/MapStyle/components/Admin.js +170 -0
  122. package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -0
  123. package/dist/maplibre/MapStyle/components/Buildings.js +21 -0
  124. package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -0
  125. package/dist/maplibre/MapStyle/components/Landuse.js +497 -0
  126. package/dist/maplibre/MapStyle/components/Natural.d.ts +1 -0
  127. package/dist/maplibre/MapStyle/components/Natural.js +1 -0
  128. package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +4 -0
  129. package/dist/maplibre/MapStyle/components/PlaceLabels.js +194 -0
  130. package/dist/maplibre/MapStyle/components/Roads.d.ts +8 -0
  131. package/dist/maplibre/MapStyle/components/Roads.js +2327 -0
  132. package/dist/maplibre/MapStyle/components/Transit.d.ts +7 -0
  133. package/dist/maplibre/MapStyle/components/Transit.js +499 -0
  134. package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -0
  135. package/dist/maplibre/MapStyle/components/Walking.js +1530 -0
  136. package/dist/maplibre/MapStyle/index.d.ts +2 -0
  137. package/dist/maplibre/MapStyle/tokens.d.ts +20 -0
  138. package/dist/maplibre/MapStyle/tokens.js +20 -0
  139. package/{src → dist}/maplibre/NavigationControl/NavigationControl.stories.svelte +9 -11
  140. package/dist/maplibre/NavigationControl/NavigationControl.stories.svelte.d.ts +19 -0
  141. package/dist/maplibre/NavigationControl/NavigationControl.svelte +9 -0
  142. package/dist/maplibre/NavigationControl/NavigationControl.svelte.d.ts +12 -0
  143. package/dist/maplibre/NavigationControl/index.d.ts +2 -0
  144. package/{src → dist}/maplibre/ScaleControl/ScaleControl.stories.svelte +10 -13
  145. package/dist/maplibre/ScaleControl/ScaleControl.stories.svelte.d.ts +19 -0
  146. package/dist/maplibre/ScaleControl/ScaleControl.svelte +9 -0
  147. package/dist/maplibre/ScaleControl/ScaleControl.svelte.d.ts +9 -0
  148. package/dist/maplibre/ScaleControl/index.d.ts +2 -0
  149. package/dist/maplibre/Source/MapSource.stories.svelte +7 -0
  150. package/dist/maplibre/Source/MapSource.stories.svelte.d.ts +19 -0
  151. package/dist/maplibre/Source/MapSource.svelte +43 -0
  152. package/dist/maplibre/Source/MapSource.svelte.d.ts +13 -0
  153. package/dist/maplibre/Source/index.d.ts +2 -0
  154. package/dist/maplibre/Source/source.d.ts +28 -0
  155. package/dist/maplibre/Source/source.js +76 -0
  156. package/{src → dist}/maplibre/Tooltip/Tooltip.stories.svelte +17 -23
  157. package/dist/maplibre/Tooltip/Tooltip.stories.svelte.d.ts +19 -0
  158. package/dist/maplibre/Tooltip/Tooltip.svelte +46 -0
  159. package/dist/maplibre/Tooltip/Tooltip.svelte.d.ts +25 -0
  160. package/dist/maplibre/Tooltip/index.d.ts +2 -0
  161. package/{src → dist}/maplibre/VectorLayer/VectorLayer.stories.svelte +11 -14
  162. package/dist/maplibre/VectorLayer/VectorLayer.stories.svelte.d.ts +19 -0
  163. package/dist/maplibre/VectorLayer/VectorLayer.svelte +73 -0
  164. package/dist/maplibre/VectorLayer/VectorLayer.svelte.d.ts +21 -0
  165. package/dist/maplibre/VectorLayer/index.d.ts +2 -0
  166. package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.stories.svelte +11 -13
  167. package/dist/maplibre/VectorTileSource/VectorTileSource.stories.svelte.d.ts +19 -0
  168. package/dist/maplibre/VectorTileSource/VectorTileSource.svelte +13 -0
  169. package/dist/maplibre/VectorTileSource/VectorTileSource.svelte.d.ts +11 -0
  170. package/dist/maplibre/VectorTileSource/index.d.ts +2 -0
  171. package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +27 -0
  172. package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte.d.ts +19 -0
  173. package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte +44 -0
  174. package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte.d.ts +19 -0
  175. package/dist/maplibre/WithLinkLocation/index.d.ts +2 -0
  176. package/dist/maplibre/context.svelte.d.ts +33 -0
  177. package/dist/maplibre/context.svelte.js +73 -0
  178. package/{src/maplibre/types.ts → dist/maplibre/types.d.ts} +3 -5
  179. package/dist/maplibre/types.js +1 -0
  180. package/dist/maplibre/utils.d.ts +4 -0
  181. package/dist/maplibre/utils.js +34 -0
  182. package/dist/utils/formatDate.d.ts +5 -0
  183. package/dist/utils/formatDate.js +17 -0
  184. package/dist/utils/formatNumber.d.ts +18 -0
  185. package/{src → dist}/utils/formatNumber.js +5 -5
  186. package/dist/utils/getColorsBetween.d.ts +9 -0
  187. package/dist/utils/getColorsBetween.js +25 -0
  188. package/dist/utils/getComparisonDiffs.d.ts +6 -0
  189. package/dist/utils/getComparisonDiffs.js +9 -0
  190. package/dist/utils/getEmbedContext.d.ts +7 -0
  191. package/dist/utils/getEmbedContext.js +27 -0
  192. package/dist/utils/getLaenderFromTopo.d.ts +10 -0
  193. package/dist/utils/getLaenderFromTopo.js +35 -0
  194. package/dist/utils/getLaenderNicenameFromAgs.d.ts +7 -0
  195. package/dist/utils/getLaenderNicenameFromAgs.js +27 -0
  196. package/dist/utils/isSvelteComponent.d.ts +7 -0
  197. package/{src → dist}/utils/isSvelteComponent.js +1 -1
  198. package/dist/utils/prepareSophoraModel.d.ts +2 -0
  199. package/dist/utils/prepareSophoraModel.js +37 -0
  200. package/dist/utils/scrollIntoViewWithOffset.d.ts +7 -0
  201. package/{src → dist}/utils/scrollIntoViewWithOffset.js +3 -3
  202. package/dist/utils/slugify.d.ts +1 -0
  203. package/dist/utils/slugify.js +11 -0
  204. package/dist/utils/topoToGeo.d.ts +7 -0
  205. package/{src → dist}/utils/topoToGeo.js +2 -2
  206. package/package.json +30 -7
  207. package/.storybook/blocks/Mermaid.jsx +0 -9
  208. package/.storybook/main.ts +0 -34
  209. package/.storybook/preview-head.html +0 -13
  210. package/.storybook/preview.ts +0 -47
  211. package/.storybook/vitest.setup.ts +0 -9
  212. package/src/Autocomplete/Autocomplete.svelte +0 -237
  213. package/src/Button/Button.stories.svelte +0 -21
  214. package/src/Button/Button.svelte +0 -52
  215. package/src/Caption/Caption.svelte +0 -29
  216. package/src/Card/Card.stories.svelte +0 -19
  217. package/src/Card/Card.svelte +0 -34
  218. package/src/ChartFooter/ChartFooter.svelte +0 -46
  219. package/src/Copy/Copy.svelte +0 -29
  220. package/src/DesignTokens/DesignTokens.svelte +0 -71
  221. package/src/DesignTokens/Tokens.ts +0 -186
  222. package/src/HighlightCard/HighlightCard.svelte +0 -65
  223. package/src/Input/Input.svelte +0 -21
  224. package/src/Intro.mdx +0 -7
  225. package/src/Logotype/Logotype.stories.svelte +0 -16
  226. package/src/Middot/Middot.stories.svelte +0 -16
  227. package/src/Note/Note.svelte +0 -38
  228. package/src/Select/Select.svelte +0 -76
  229. package/src/Switcher/Switcher.svelte +0 -130
  230. package/src/maplibre/AttributionControl/AttributionControl.stories.svelte +0 -29
  231. package/src/maplibre/AttributionControl/AttributionControl.svelte +0 -45
  232. package/src/maplibre/GeocoderControl/GeocoderAPIs.ts +0 -49
  233. package/src/maplibre/GeocoderControl/GeocoderControl.svelte +0 -211
  234. package/src/maplibre/Map/FallbackStyle.ts +0 -18
  235. package/src/maplibre/Map/Map.svelte +0 -287
  236. package/src/maplibre/MapControl/MapControl.stories.svelte +0 -56
  237. package/src/maplibre/MapControl/MapControl.svelte +0 -41
  238. package/src/maplibre/MapStyle/SWRDataLabLight.ts +0 -72
  239. package/src/maplibre/MapStyle/components/Admin.ts +0 -173
  240. package/src/maplibre/MapStyle/components/Buildings.ts +0 -23
  241. package/src/maplibre/MapStyle/components/Landuse.ts +0 -499
  242. package/src/maplibre/MapStyle/components/Natural.ts +0 -1
  243. package/src/maplibre/MapStyle/components/PlaceLabels.ts +0 -199
  244. package/src/maplibre/MapStyle/components/Roads.ts +0 -2345
  245. package/src/maplibre/MapStyle/components/Transit.ts +0 -507
  246. package/src/maplibre/MapStyle/components/Walking.ts +0 -1538
  247. package/src/maplibre/MapStyle/tokens.ts +0 -21
  248. package/src/maplibre/NavigationControl/NavigationControl.svelte +0 -36
  249. package/src/maplibre/ScaleControl/ScaleControl.svelte +0 -25
  250. package/src/maplibre/Source/MapSource.stories.svelte +0 -9
  251. package/src/maplibre/Source/MapSource.svelte +0 -61
  252. package/src/maplibre/Source/source.ts +0 -89
  253. package/src/maplibre/Tooltip/Tooltip.svelte +0 -183
  254. package/src/maplibre/VectorLayer/VectorLayer.svelte +0 -142
  255. package/src/maplibre/VectorTileSource/VectorTileSource.svelte +0 -24
  256. package/src/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +0 -29
  257. package/src/maplibre/WithLinkLocation/WithLinkLocation.svelte +0 -83
  258. package/src/maplibre/context.svelte.ts +0 -89
  259. package/src/maplibre/utils.ts +0 -52
  260. package/src/utils/formatDate.js +0 -17
  261. package/src/utils/getColorsBetween.js +0 -25
  262. package/src/utils/getComparisonDiffs.js +0 -9
  263. package/src/utils/getEmbedContext.js +0 -28
  264. package/src/utils/getLaenderFromTopo.js +0 -35
  265. package/src/utils/getLaenderNicenameFromAgs.js +0 -27
  266. package/src/utils/prepareSophoraModel.js +0 -31
  267. package/src/utils/slugify.ts +0 -12
  268. package/static/favicon.png +0 -0
  269. package/svelte.config.js +0 -18
  270. package/tsconfig.json +0 -19
  271. package/vite.config.ts +0 -6
  272. package/vitest.workspace.ts +0 -32
  273. /package/{src → dist}/Autocomplete/Autocomplete.stories.svelte +0 -0
  274. /package/{src → dist}/Autocomplete/index.js +0 -0
  275. /package/{src → dist}/Button/index.js +0 -0
  276. /package/{src → dist}/Caption/Caption.stories.svelte +0 -0
  277. /package/{src/Caption/index.ts → dist/Caption/index.d.ts} +0 -0
  278. /package/{src → dist}/Card/index.js +0 -0
  279. /package/{src → dist}/ChartFooter/ChartFooter.mdx +0 -0
  280. /package/{src → dist}/ChartFooter/ChartFooter.stories.svelte +0 -0
  281. /package/{src → dist}/ChartFooter/index.js +0 -0
  282. /package/{src → dist}/ChartHeader/ChartHeader.mdx +0 -0
  283. /package/{src → dist}/ChartHeader/ChartHeader.stories.svelte +0 -0
  284. /package/{src → dist}/ChartHeader/index.js +0 -0
  285. /package/{src → dist}/Copy/Copy.stories.svelte +0 -0
  286. /package/{src/Copy/index.ts → dist/Copy/index.d.ts} +0 -0
  287. /package/{src → dist}/DesignTokens/DesignTokens.mdx +0 -0
  288. /package/{src → dist}/DesignTokens/index.js +0 -0
  289. /package/{src → dist}/FormLabel/FormLabel.mdx +0 -0
  290. /package/{src → dist}/FormLabel/FormLabel.stories.svelte +0 -0
  291. /package/{src/FormLabel/index.ts → dist/FormLabel/index.d.ts} +0 -0
  292. /package/{src → dist}/Headline/Headline.stories.svelte +0 -0
  293. /package/{src/Headline/index.ts → dist/Headline/index.d.ts} +0 -0
  294. /package/{src → dist}/HighlightCard/index.js +0 -0
  295. /package/{src → dist}/Input/index.js +0 -0
  296. /package/{src → dist}/Logotype/Logotype.svelte +0 -0
  297. /package/{src → dist}/Middot/Middot.svelte +0 -0
  298. /package/{src → dist}/Middot/index.js +0 -0
  299. /package/{src → dist}/Note/Note.stories.svelte +0 -0
  300. /package/{src/Note/index.ts → dist/Note/index.d.ts} +0 -0
  301. /package/{src → dist}/Select/Select.mdx +0 -0
  302. /package/{src → dist}/Select/SelectStoriesTemplate.svelte +0 -0
  303. /package/{src → dist}/Select/index.js +0 -0
  304. /package/{src → dist}/Select/mock_data/jobs.json +0 -0
  305. /package/{src → dist}/Switcher/Switcher.mdx +0 -0
  306. /package/{src → dist}/Switcher/Switcher.stories.svelte +0 -0
  307. /package/{src → dist}/Switcher/index.js +0 -0
  308. /package/{src → dist}/app.html +0 -0
  309. /package/{src → dist}/assets/close-circle.svg.svelte +0 -0
  310. /package/{src → dist}/assets/grow.svg.svelte +0 -0
  311. /package/{src → dist}/assets/hand-pointer.svg.svelte +0 -0
  312. /package/{src → dist}/assets/shrink.svg.svelte +0 -0
  313. /package/{src → dist}/assets/tap.svg.svelte +0 -0
  314. /package/{src → dist}/assets/times-circle-solid.svg.svelte +0 -0
  315. /package/{src → dist}/maplibre/AttributionControl/index.js +0 -0
  316. /package/{src → dist}/maplibre/GeocoderControl/index.js +0 -0
  317. /package/{src → dist}/maplibre/Map/index.js +0 -0
  318. /package/{src → dist}/maplibre/MapControl/MapControl.mdx +0 -0
  319. /package/{src → dist}/maplibre/MapControl/index.js +0 -0
  320. /package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.mdx +0 -0
  321. /package/{src → dist}/maplibre/MapStyle/index.js +0 -0
  322. /package/{src → dist}/maplibre/Maplibre.mdx +0 -0
  323. /package/{src → dist}/maplibre/NavigationControl/index.js +0 -0
  324. /package/{src → dist}/maplibre/ScaleControl/index.js +0 -0
  325. /package/{src → dist}/maplibre/Source/index.js +0 -0
  326. /package/{src → dist}/maplibre/Tooltip/index.js +0 -0
  327. /package/{src → dist}/maplibre/VectorLayer/index.js +0 -0
  328. /package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.mdx +0 -0
  329. /package/{src → dist}/maplibre/VectorTileSource/index.js +0 -0
  330. /package/{src → dist}/maplibre/WithLinkLocation/WithLinkLocation.mdx +0 -0
  331. /package/{src → dist}/maplibre/WithLinkLocation/index.js +0 -0
  332. /package/{src → dist}/styles/base.scss +0 -0
@@ -1,83 +0,0 @@
1
- <script lang="ts">
2
- import { onMount, setContext, type Snippet } from 'svelte';
3
- import { MaptilerGeocoderAPI } from '../GeocoderControl/GeocoderAPIs';
4
- import {
5
- type GeocodingCountry,
6
- type GeocodingLanguage,
7
- type GeocodingService,
8
- type Location
9
- } from '../types';
10
-
11
- import type {
12
- MaplibreGeocoderApi,
13
- MaplibreGeocoderApiConfig
14
- } from '@maplibre/maplibre-gl-geocoder';
15
-
16
- interface WithLinkLocationProps {
17
- service?: GeocodingService;
18
- /**
19
- * API key for selected geocoding `service`
20
- */
21
- key: string;
22
- /**
23
- * Limit search to one or more countries
24
- */
25
- countries?: GeocodingLanguage | GeocodingCountry[];
26
- languages?: GeocodingLanguage | GeocodingLanguage[];
27
- urlParameter?: string;
28
- children: Snippet;
29
- }
30
-
31
- const {
32
- key,
33
- service = 'maptiler',
34
- countries = 'de',
35
- languages = 'de',
36
- urlParameter = 'location',
37
- children
38
- }: WithLinkLocationProps = $props();
39
-
40
- const countriesArr = Array.isArray(countries) ? countries : [countries];
41
- const languagesArr = Array.isArray(languages) ? languages : [languages];
42
-
43
- let geocoder: MaplibreGeocoderApi;
44
- if (service === 'maptiler') {
45
- geocoder = new MaptilerGeocoderAPI(key);
46
- }
47
-
48
- let location: Location | boolean | undefined = $state();
49
-
50
- function bboxToArea(bbox: [number, number, number, number]) {
51
- return (bbox[2] - bbox[0]) * (bbox[3] - bbox[1]);
52
- }
53
-
54
- onMount(async () => {
55
- const params = new URLSearchParams(window.location.search);
56
- if (params.has(urlParameter)) {
57
- const config: MaplibreGeocoderApiConfig = {
58
- countries: countriesArr.join(','),
59
- language: languagesArr.join(','),
60
- query: params.get(urlParameter)?.toString(),
61
- limit: 1
62
- };
63
- const res = await geocoder.forwardGeocode(config);
64
- if (res.features[0].bbox && res.features[0].geometry.type === 'Point') {
65
- location = {
66
- lat: res.features[0].geometry.coordinates[1],
67
- lng: res.features[0].geometry.coordinates[0],
68
- zoom: 11 - bboxToArea(res.features[0].bbox) * 5.5
69
- };
70
- }
71
- } else {
72
- location = false;
73
- }
74
- });
75
-
76
- $effect.pre(() => {
77
- setContext('initialLocation', location);
78
- });
79
- </script>
80
-
81
- {#if location !== undefined}
82
- {@render children?.()}
83
- {/if}
@@ -1,89 +0,0 @@
1
- import type { Map as MapLibre, Marker, LayerSpecification } from 'maplibre-gl';
2
- import { getContext, setContext } from 'svelte';
3
-
4
- const MAP_CONTEXT_KEY = Symbol.for('map-context');
5
- const SOURCE_CONTEXT_KEY = Symbol.for('source-context');
6
- const LAYER_CONTEXT_KEY = Symbol.for('layer-context');
7
- const POPUP_TARGET_KEY = Symbol.for('popup-target');
8
-
9
- export class Box<T> {
10
- value = $state() as T;
11
-
12
- constructor(initialValue: T) {
13
- this.value = initialValue;
14
- }
15
- }
16
-
17
- export class MapContext {
18
- _map = $state(null) as MapLibre | null;
19
- minzoom = $state(0);
20
- maxzoom = $state(24);
21
- styleLoaded = $state(false);
22
- private _listener?: maplibregl.Listener = undefined;
23
-
24
- get map() {
25
- return this._map;
26
- }
27
-
28
- set map(value: maplibregl.Map | null) {
29
- // Unbind any old event listeners
30
- if (this._listener) {
31
- this._map?.off('styledata', this._listener);
32
- this._listener = undefined;
33
- }
34
- // Set new map instance and bind new event listeners
35
- this._map = value;
36
- if (this._map) {
37
- this._listener = this._onstyledata.bind(this);
38
- this._map.on('styledata', this._listener);
39
- }
40
- }
41
-
42
- private _onstyledata(e: maplibregl.MapStyleDataEvent) {
43
- this.styleLoaded = true;
44
- }
45
- }
46
-
47
- export class SourceContext {
48
- _source = $state();
49
- loaded = $state(false);
50
- minzoom = $state(0);
51
- maxzoom = $state(24);
52
-
53
- get source() {
54
- return this._source;
55
- }
56
- }
57
- export class LayerContext {
58
- layer = $state() as LayerSpecification;
59
- }
60
-
61
- export function setPopupTarget(value: Box<Marker | string | undefined>) {
62
- setContext(POPUP_TARGET_KEY, value);
63
- }
64
-
65
- export function getPopupTarget(): Box<Marker | string> | undefined {
66
- return getContext(POPUP_TARGET_KEY);
67
- }
68
-
69
- export function createMapContext(): MapContext {
70
- return setContext(MAP_CONTEXT_KEY, new MapContext());
71
- }
72
- export function getMapContext(): MapContext {
73
- return getContext(MAP_CONTEXT_KEY);
74
- }
75
-
76
- export function createSourceContext(): SourceContext {
77
- return setContext(SOURCE_CONTEXT_KEY, new SourceContext());
78
- }
79
- export function getSourceContext(): SourceContext {
80
- return getContext(SOURCE_CONTEXT_KEY);
81
- }
82
-
83
- export function getLayerContext(): LayerContext {
84
- return getContext(LAYER_CONTEXT_KEY);
85
- }
86
-
87
- export function setLayerContext(value: string) {
88
- setContext(LAYER_CONTEXT_KEY, value);
89
- }
@@ -1,52 +0,0 @@
1
- // Source: https://github.com/MIERUNE/svelte-maplibre-gl/blob/main/src/lib/maplibre/utils.ts
2
-
3
- import type { Evented, Listener, Map, MapLayerEventType, Popup } from 'maplibre-gl';
4
-
5
- export function resetEventListener(
6
- evented: Evented | null | undefined,
7
- type: string,
8
- listener: Listener | undefined
9
- ) {
10
- if (listener) {
11
- evented?.on(type, listener);
12
- }
13
- const prevListener = listener;
14
- return () => {
15
- if (prevListener) {
16
- evented?.off(type, prevListener);
17
- }
18
- };
19
- }
20
-
21
- export function resetLayerEventListener(
22
- map: Map | null,
23
- type: keyof MapLayerEventType,
24
- layer: string,
25
- listener: Listener | undefined
26
- ) {
27
- if (listener) {
28
- map?.on(type, layer, listener);
29
- }
30
- const prevListener = listener;
31
- return () => {
32
- if (prevListener) {
33
- map?.off(type, layer, prevListener);
34
- }
35
- };
36
- }
37
-
38
- export function resetPopupEventListener(
39
- popup: Popup | null,
40
- type: 'open' | 'close',
41
- listener: Listener | undefined
42
- ) {
43
- if (listener) {
44
- popup?.on(type, listener);
45
- }
46
- const prevListener = listener;
47
- return () => {
48
- if (prevListener) {
49
- popup?.off(type, prevListener);
50
- }
51
- };
52
- }
@@ -1,17 +0,0 @@
1
- import { timeFormat } from "d3-time-format"
2
-
3
- const formats = {
4
- dayMonthYear: "%-d.%-m.%Y",
5
- dayMonth: "%-d.%-m.",
6
- dayMonthYearShort: "%-d.%-m.%y",
7
- dayMonthHourMinute: "%-d.%-m., %-H.%M Uhr",
8
- dayMonthYearHourMinute: "%-d.%-m.%Y, %-H.%M Uhr",
9
- hourMinuteSophora: "%-H:%M Uhr",
10
- hourMinute: "%-H.%M",
11
- }
12
-
13
- const formatDate = ({ date, format = "dayMonthYear" }) => {
14
- return timeFormat(formats[format] || format)(new Date(date))
15
- }
16
-
17
- export default formatDate
@@ -1,25 +0,0 @@
1
- import Color from 'color';
2
- import { range } from 'd3-array';
3
-
4
- /**
5
- * Get color range of n colors
6
- * @param {*} from
7
- * @param {*} to
8
- * @param {*} props
9
- * @returns
10
- */
11
- const getColorsBetween = (from, to, props = { n: 1, includeFromTo: false }) => {
12
- const step = 1 / (props.n + 1);
13
- const fromColor = Color(from);
14
- const toColor = Color(to);
15
- const colorsBetween = range(1, props.n + 1)
16
- .map((i) => fromColor.mix(toColor, i * step))
17
- .map((c) => c.hex().toString());
18
- if (props.includeFromTo) {
19
- return [from, ...colorsBetween, to];
20
- } else {
21
- return colorsBetween;
22
- }
23
- };
24
-
25
- export default getColorsBetween;
@@ -1,9 +0,0 @@
1
- const getComparisonDiffs = (a, b) => {
2
- return {
3
- diff: a - b,
4
- diffRel: (a / b - 1) * 100,
5
- diffTag: a > b ? 'higher' : a === b ? 'equal' : 'smaller'
6
- };
7
- };
8
-
9
- export default getComparisonDiffs;
@@ -1,28 +0,0 @@
1
- /**
2
- * Get current url params or - if on production - params from embed url.
3
- * @param {object} embed root dom element
4
- * @returns {object} url params
5
- */
6
-
7
- const getEmbedContext = (target) => {
8
- let url;
9
- if (
10
- import.meta.env.DEV ||
11
- window.location.origin === 'https://d.swr.de' ||
12
- window.location.origin === 'https://static.datenhub.net' ||
13
- window.location.href.includes('apidata.googleusercontent.com') ||
14
- window.location.href.includes('storage.googleapis.com')
15
- ) {
16
- url = window.location.href;
17
- } else {
18
- const parent = target.parentNode || target.parentNode.parentNode;
19
- url = parent.dataset.url;
20
- }
21
- const data = {};
22
- for (const [key, value] of new URL(url).searchParams) {
23
- data[key] = value;
24
- }
25
- return data;
26
- };
27
-
28
- export default getEmbedContext;
@@ -1,35 +0,0 @@
1
- import { merge } from 'topojson-client';
2
- import { range } from 'd3-array';
3
-
4
- /**
5
- * Calc laender borders from kreis or gemeinden topojson
6
- * @param {object} topojson
7
- * @returns geojson
8
- */
9
- const getLaenderFromTopo = (topo) => {
10
- const states = [];
11
- const stateIds = range(1, 17).map((n) => String(n).padStart(2, '0'));
12
- const key = Object.keys(topo.objects)[0];
13
-
14
- stateIds.forEach((id) => {
15
- const state = {
16
- geometry: merge(
17
- topo,
18
- topo.objects[key].geometries.filter(
19
- (g) => g.properties.id && g.properties.id.startsWith(id)
20
- )
21
- ),
22
- id,
23
- type: 'Feature',
24
- properties: { id }
25
- };
26
- states.push(state);
27
- });
28
-
29
- return {
30
- type: 'FeatureCollection',
31
- features: states
32
- };
33
- };
34
-
35
- export default getLaenderFromTopo;
@@ -1,27 +0,0 @@
1
- const map = {
2
- "01": "Schleswig-Holstein",
3
- "02": "Hamburg",
4
- "03": "Niedersachsen",
5
- "04": "Bremen",
6
- "05": "Nordrhein-Westfalen",
7
- "06": "Hessen",
8
- "07": "Rheinland-Pfalz",
9
- "08": "Baden-Württemberg",
10
- "09": "Bayern",
11
- 10: "Saarland",
12
- 11: "Berlin",
13
- 12: "Brandenburg",
14
- 13: "Mecklenburg-Vorpommern",
15
- 14: "Sachsen",
16
- 15: "Sachsen-Anhalt",
17
- 16: "Thüringen",
18
- }
19
-
20
- /**
21
- * Get nicename for land ags
22
- * @param {string} ags
23
- * @returns {string} nicename
24
- */
25
- const getLaenderNicenameFromAgs = (ags) => map[ags]
26
-
27
- export default getLaenderNicenameFromAgs
@@ -1,31 +0,0 @@
1
- const SELECTORS = {
2
- showScrollUp: "a.back-to-top",
3
- showPlayerbar: "#playerbar",
4
- showSharing: ".sharing",
5
- showAuthors: ".meta-top .meta-authors",
6
- allowZoom: "meta[name=viewport]",
7
- }
8
-
9
- const IS_MOBILE = window.innerWidth < 768
10
-
11
- const prepareSophoraModel = (config) => {
12
- console.log("###SWRDATA### updating dom with following config: ", config)
13
- Object.entries(config).forEach(([k, v], _) => {
14
- const element = document.querySelector(SELECTORS[k])
15
- // show/hide elements
16
- if (k.startsWith("show")) {
17
- if ((v === "none" || (v === "mobile" && IS_MOBILE) || (v === "desktop" && !IS_MOBILE)) && element) {
18
- element.style.display = "none"
19
- element.style.visibility = "hidden"
20
- }
21
- }
22
- // enable/disable zoom
23
- if (k === "allowZoom") {
24
- if (!v && element) {
25
- element.setAttribute("content", "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0")
26
- }
27
- }
28
- })
29
- }
30
-
31
- export default prepareSophoraModel
@@ -1,12 +0,0 @@
1
- // Source: https://svelte.dev/playground/b130be5e485441a1842ae97e4ce4f244?version=5.20.0
2
-
3
- export default function slugify(str: string): string {
4
- return str
5
- .replace(/\s+/g, '-')
6
- .replace(/-+/g, '-')
7
- .trim()
8
- .normalize('NFKD')
9
- .replace(/[\u0300-\u036f]/g, '')
10
- .toLowerCase()
11
- .replace(/[^a-z0-9 -]/g, '')
12
- }
Binary file
package/svelte.config.js DELETED
@@ -1,18 +0,0 @@
1
- import adapter from '@sveltejs/adapter-auto';
2
- import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
3
-
4
- /** @type {import('@sveltejs/kit').Config} */
5
- const config = {
6
- // Consult https://kit.svelte.dev/docs/integrations#preprocessors
7
- // for more information about preprocessors
8
- preprocess: vitePreprocess(),
9
-
10
- kit: {
11
- // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
12
- // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
13
- // See https://kit.svelte.dev/docs/adapters for more information about adapters.
14
- adapter: adapter()
15
- }
16
- };
17
-
18
- export default config;
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "./.svelte-kit/tsconfig.json",
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "checkJs": true,
6
- "esModuleInterop": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "resolveJsonModule": true,
9
- "skipLibCheck": true,
10
- "sourceMap": true,
11
- "strict": true,
12
- "moduleResolution": "bundler"
13
- }
14
- // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
15
- // except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
16
- //
17
- // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
18
- // from the referenced tsconfig.json - TypeScript does not merge them in
19
- }
package/vite.config.ts DELETED
@@ -1,6 +0,0 @@
1
- import { sveltekit } from '@sveltejs/kit/vite';
2
- import { defineConfig } from 'vite';
3
-
4
- export default defineConfig({
5
- plugins: [sveltekit()]
6
- });
@@ -1,32 +0,0 @@
1
- import path from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
-
4
- import { defineWorkspace } from 'vitest/config';
5
-
6
- import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
7
-
8
- const dirname =
9
- typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
10
-
11
- // More info at: https://storybook.js.org/docs/writing-tests/test-addon
12
- export default defineWorkspace([
13
- 'vite.config.ts',
14
- {
15
- extends: 'vite.config.ts',
16
- plugins: [
17
- // The plugin will run tests for the stories defined in your Storybook config
18
- // See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
19
- storybookTest({ configDir: path.join(dirname, '.storybook') })
20
- ],
21
- test: {
22
- name: 'storybook',
23
- browser: {
24
- enabled: true,
25
- headless: true,
26
- name: 'chromium',
27
- provider: 'playwright'
28
- },
29
- setupFiles: ['.storybook/vitest.setup.ts']
30
- }
31
- }
32
- ]);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes