@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.
- package/dist/Autocomplete/Autocomplete.svelte +237 -0
- package/dist/Autocomplete/Autocomplete.svelte.d.ts +34 -0
- package/dist/Autocomplete/index.d.ts +2 -0
- package/dist/Button/Button.svelte +38 -0
- package/dist/Button/Button.svelte.d.ts +10 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Caption/Caption.svelte +21 -0
- package/dist/Caption/Caption.svelte.d.ts +8 -0
- package/dist/Caption/index.js +2 -0
- package/dist/Card/Card.svelte +25 -0
- package/dist/Card/Card.svelte.d.ts +7 -0
- package/dist/Card/index.d.ts +2 -0
- package/dist/ChartFooter/ChartFooter.svelte +38 -0
- package/dist/ChartFooter/ChartFooter.svelte.d.ts +8 -0
- package/dist/ChartFooter/index.d.ts +2 -0
- package/{src → dist}/ChartHeader/ChartHeader.svelte +4 -12
- package/dist/ChartHeader/ChartHeader.svelte.d.ts +9 -0
- package/dist/ChartHeader/index.d.ts +2 -0
- package/{src → dist}/ChartList/ChartList.svelte +2 -16
- package/dist/ChartList/ChartList.svelte.d.ts +14 -0
- package/dist/ChartList/index.js +2 -0
- package/dist/Copy/Copy.svelte +21 -0
- package/dist/Copy/Copy.svelte.d.ts +8 -0
- package/dist/Copy/index.js +2 -0
- package/dist/DesignTokens/DesignTokens.svelte +58 -0
- package/dist/DesignTokens/DesignTokens.svelte.d.ts +7 -0
- package/dist/DesignTokens/Tokens.d.ts +26 -0
- package/dist/DesignTokens/Tokens.js +171 -0
- package/dist/DesignTokens/index.d.ts +8 -0
- package/{src → dist}/FormLabel/FormLabel.svelte +2 -9
- package/dist/FormLabel/FormLabel.svelte.d.ts +9 -0
- package/dist/FormLabel/index.js +2 -0
- package/{src → dist}/Headline/Headline.svelte +2 -7
- package/dist/Headline/Headline.svelte.d.ts +7 -0
- package/dist/Headline/index.js +2 -0
- package/dist/HighlightCard/HighlightCard.svelte +54 -0
- package/dist/HighlightCard/HighlightCard.svelte.d.ts +9 -0
- package/dist/HighlightCard/index.d.ts +2 -0
- package/dist/Input/Input.svelte +32 -0
- package/dist/Input/Input.svelte.d.ts +23 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Logotype/Logotype.svelte.d.ts +26 -0
- package/dist/Middot/Middot.svelte.d.ts +26 -0
- package/dist/Middot/index.d.ts +2 -0
- package/dist/Note/Note.svelte +28 -0
- package/dist/Note/Note.svelte.d.ts +7 -0
- package/dist/Note/index.js +2 -0
- package/dist/Select/Select.svelte +39 -0
- package/dist/Select/Select.svelte.d.ts +4 -0
- package/{src/Select/Select.types.ts → dist/Select/Select.types.d.ts} +1 -2
- package/dist/Select/Select.types.js +1 -0
- package/dist/Select/index.d.ts +2 -0
- package/dist/Switcher/Switcher.svelte +111 -0
- package/dist/Switcher/Switcher.svelte.d.ts +21 -0
- package/dist/Switcher/index.d.ts +2 -0
- package/dist/assets/close-circle.svg.svelte.d.ts +26 -0
- package/dist/assets/grow.svg.svelte.d.ts +26 -0
- package/dist/assets/hand-pointer.svg.svelte.d.ts +26 -0
- package/dist/assets/shrink.svg.svelte.d.ts +26 -0
- package/dist/assets/tap.svg.svelte.d.ts +26 -0
- package/dist/assets/times-circle-solid.svg.svelte.d.ts +26 -0
- package/dist/index.d.ts +29 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte +15 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte.d.ts +8 -0
- package/dist/maplibre/AttributionControl/index.d.ts +2 -0
- package/dist/maplibre/GeocoderControl/GeocoderAPIs.d.ts +6 -0
- package/dist/maplibre/GeocoderControl/GeocoderAPIs.js +40 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +25 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte.d.ts +27 -0
- package/dist/maplibre/GeocoderControl/index.d.ts +2 -0
- package/dist/maplibre/Map/FallbackStyle.d.ts +3 -0
- package/dist/maplibre/Map/FallbackStyle.js +15 -0
- package/dist/maplibre/Map/Map.svelte +91 -0
- package/dist/maplibre/Map/Map.svelte.d.ts +23 -0
- package/dist/maplibre/Map/index.d.ts +2 -0
- package/dist/maplibre/MapControl/MapControl.svelte +29 -0
- package/dist/maplibre/MapControl/MapControl.svelte.d.ts +11 -0
- package/dist/maplibre/MapControl/index.d.ts +2 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.d.ts +3 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.js +60 -0
- package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Admin.js +170 -0
- package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Buildings.js +21 -0
- package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Landuse.js +497 -0
- package/dist/maplibre/MapStyle/components/Natural.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Natural.js +1 -0
- package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +4 -0
- package/dist/maplibre/MapStyle/components/PlaceLabels.js +194 -0
- package/dist/maplibre/MapStyle/components/Roads.d.ts +8 -0
- package/dist/maplibre/MapStyle/components/Roads.js +2327 -0
- package/dist/maplibre/MapStyle/components/Transit.d.ts +7 -0
- package/dist/maplibre/MapStyle/components/Transit.js +499 -0
- package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Walking.js +1530 -0
- package/dist/maplibre/MapStyle/index.d.ts +2 -0
- package/dist/maplibre/MapStyle/tokens.d.ts +20 -0
- package/dist/maplibre/MapStyle/tokens.js +20 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte +9 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte.d.ts +12 -0
- package/dist/maplibre/NavigationControl/index.d.ts +2 -0
- package/dist/maplibre/ScaleControl/ScaleControl.svelte +9 -0
- package/dist/maplibre/ScaleControl/ScaleControl.svelte.d.ts +9 -0
- package/dist/maplibre/ScaleControl/index.d.ts +2 -0
- package/dist/maplibre/Source/MapSource.svelte +43 -0
- package/dist/maplibre/Source/MapSource.svelte.d.ts +13 -0
- package/dist/maplibre/Source/index.d.ts +2 -0
- package/dist/maplibre/Source/source.d.ts +28 -0
- package/dist/maplibre/Source/source.js +76 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte +46 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte.d.ts +25 -0
- package/dist/maplibre/Tooltip/index.d.ts +2 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte +73 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte.d.ts +21 -0
- package/dist/maplibre/VectorLayer/index.d.ts +2 -0
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte +13 -0
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte.d.ts +11 -0
- package/dist/maplibre/VectorTileSource/index.d.ts +2 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte +44 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte.d.ts +19 -0
- package/dist/maplibre/WithLinkLocation/index.d.ts +2 -0
- package/dist/maplibre/context.svelte.d.ts +33 -0
- package/dist/maplibre/context.svelte.js +73 -0
- package/{src/maplibre/types.ts → dist/maplibre/types.d.ts} +3 -5
- package/dist/maplibre/types.js +1 -0
- package/dist/maplibre/utils.d.ts +4 -0
- package/dist/maplibre/utils.js +34 -0
- package/dist/utils/formatDate.d.ts +5 -0
- package/dist/utils/formatNumber.d.ts +18 -0
- package/dist/utils/getColorsBetween.d.ts +9 -0
- package/dist/utils/getComparisonDiffs.d.ts +6 -0
- package/dist/utils/getEmbedContext.d.ts +7 -0
- package/dist/utils/getEmbedContext.js +27 -0
- package/dist/utils/getLaenderFromTopo.d.ts +10 -0
- package/dist/utils/getLaenderNicenameFromAgs.d.ts +7 -0
- package/dist/utils/isSvelteComponent.d.ts +7 -0
- package/dist/utils/prepareSophoraModel.d.ts +2 -0
- package/dist/utils/scrollIntoViewWithOffset.d.ts +7 -0
- package/dist/utils/slugify.d.ts +1 -0
- package/dist/utils/slugify.js +11 -0
- package/dist/utils/topoToGeo.d.ts +7 -0
- package/package.json +28 -7
- package/.storybook/blocks/Mermaid.jsx +0 -9
- package/.storybook/main.ts +0 -34
- package/.storybook/preview-head.html +0 -13
- package/.storybook/preview.ts +0 -47
- package/.storybook/vitest.setup.ts +0 -9
- package/src/Autocomplete/Autocomplete.stories.svelte +0 -61
- package/src/Autocomplete/Autocomplete.svelte +0 -237
- package/src/Button/Button.stories.svelte +0 -21
- package/src/Button/Button.svelte +0 -52
- package/src/Caption/Caption.stories.svelte +0 -24
- package/src/Caption/Caption.svelte +0 -29
- package/src/Card/Card.stories.svelte +0 -19
- package/src/Card/Card.svelte +0 -34
- package/src/ChartFooter/ChartFooter.stories.svelte +0 -32
- package/src/ChartFooter/ChartFooter.svelte +0 -46
- package/src/ChartHeader/ChartHeader.stories.svelte +0 -31
- package/src/ChartList/ChartList.stories.svelte +0 -48
- package/src/Copy/Copy.stories.svelte +0 -32
- package/src/Copy/Copy.svelte +0 -29
- package/src/DesignTokens/DesignTokens.svelte +0 -71
- package/src/DesignTokens/Tokens.ts +0 -186
- package/src/FormLabel/FormLabel.stories.svelte +0 -52
- package/src/Headline/Headline.stories.svelte +0 -17
- package/src/HighlightCard/HighlightCard.stories.svelte +0 -57
- package/src/HighlightCard/HighlightCard.svelte +0 -65
- package/src/Input/Input.svelte +0 -21
- package/src/Logotype/Logotype.stories.svelte +0 -16
- package/src/Middot/Middot.stories.svelte +0 -16
- package/src/Note/Note.stories.svelte +0 -23
- package/src/Note/Note.svelte +0 -38
- package/src/Select/Select.stories.svelte +0 -205
- package/src/Select/Select.svelte +0 -76
- package/src/Select/SelectStoriesTemplate.svelte +0 -31
- package/src/Switcher/Switcher.stories.svelte +0 -44
- package/src/Switcher/Switcher.svelte +0 -130
- package/src/maplibre/AttributionControl/AttributionControl.stories.svelte +0 -29
- package/src/maplibre/AttributionControl/AttributionControl.svelte +0 -45
- package/src/maplibre/GeocoderControl/GeocoderAPIs.ts +0 -49
- package/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte +0 -78
- package/src/maplibre/GeocoderControl/GeocoderControl.svelte +0 -211
- package/src/maplibre/Map/FallbackStyle.ts +0 -18
- package/src/maplibre/Map/Map.stories.svelte +0 -118
- package/src/maplibre/Map/Map.svelte +0 -287
- package/src/maplibre/MapControl/MapControl.stories.svelte +0 -56
- package/src/maplibre/MapControl/MapControl.svelte +0 -41
- package/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte +0 -41
- package/src/maplibre/MapStyle/SWRDataLabLight.ts +0 -72
- package/src/maplibre/MapStyle/components/Admin.ts +0 -173
- package/src/maplibre/MapStyle/components/Buildings.ts +0 -23
- package/src/maplibre/MapStyle/components/Landuse.ts +0 -499
- package/src/maplibre/MapStyle/components/Natural.ts +0 -1
- package/src/maplibre/MapStyle/components/PlaceLabels.ts +0 -199
- package/src/maplibre/MapStyle/components/Roads.ts +0 -2345
- package/src/maplibre/MapStyle/components/Transit.ts +0 -507
- package/src/maplibre/MapStyle/components/Walking.ts +0 -1538
- package/src/maplibre/MapStyle/tokens.ts +0 -21
- package/src/maplibre/NavigationControl/NavigationControl.stories.svelte +0 -39
- package/src/maplibre/NavigationControl/NavigationControl.svelte +0 -36
- package/src/maplibre/ScaleControl/ScaleControl.stories.svelte +0 -71
- package/src/maplibre/ScaleControl/ScaleControl.svelte +0 -25
- package/src/maplibre/Source/MapSource.stories.svelte +0 -9
- package/src/maplibre/Source/MapSource.svelte +0 -61
- package/src/maplibre/Source/source.ts +0 -89
- package/src/maplibre/Tooltip/Tooltip.stories.svelte +0 -192
- package/src/maplibre/Tooltip/Tooltip.svelte +0 -183
- package/src/maplibre/VectorLayer/VectorLayer.stories.svelte +0 -65
- package/src/maplibre/VectorLayer/VectorLayer.svelte +0 -146
- package/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte +0 -46
- package/src/maplibre/VectorTileSource/VectorTileSource.svelte +0 -24
- package/src/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +0 -29
- package/src/maplibre/WithLinkLocation/WithLinkLocation.svelte +0 -83
- package/src/maplibre/context.svelte.ts +0 -89
- package/src/maplibre/utils.ts +0 -52
- package/src/utils/getEmbedContext.js +0 -28
- package/src/utils/slugify.ts +0 -12
- package/static/favicon.png +0 -0
- package/svelte.config.js +0 -18
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -6
- package/vitest.workspace.ts +0 -32
- /package/{src → dist}/Autocomplete/index.js +0 -0
- /package/{src → dist}/Button/index.js +0 -0
- /package/{src/Caption/index.ts → dist/Caption/index.d.ts} +0 -0
- /package/{src → dist}/Card/index.js +0 -0
- /package/{src → dist}/ChartFooter/ChartFooter.mdx +0 -0
- /package/{src → dist}/ChartFooter/index.js +0 -0
- /package/{src → dist}/ChartHeader/ChartHeader.mdx +0 -0
- /package/{src → dist}/ChartHeader/index.js +0 -0
- /package/{src → dist}/ChartList/ChartList.mdx +0 -0
- /package/{src/ChartList/index.ts → dist/ChartList/index.d.ts} +0 -0
- /package/{src/Copy/index.ts → dist/Copy/index.d.ts} +0 -0
- /package/{src → dist}/DesignTokens/DesignTokens.mdx +0 -0
- /package/{src → dist}/DesignTokens/index.js +0 -0
- /package/{src → dist}/FormLabel/FormLabel.mdx +0 -0
- /package/{src/FormLabel/index.ts → dist/FormLabel/index.d.ts} +0 -0
- /package/{src/Headline/index.ts → dist/Headline/index.d.ts} +0 -0
- /package/{src → dist}/HighlightCard/index.js +0 -0
- /package/{src → dist}/Input/index.js +0 -0
- /package/{src → dist}/Intro.mdx +0 -0
- /package/{src → dist}/Logotype/Logotype.svelte +0 -0
- /package/{src → dist}/Middot/Middot.svelte +0 -0
- /package/{src → dist}/Middot/index.js +0 -0
- /package/{src/Note/index.ts → dist/Note/index.d.ts} +0 -0
- /package/{src → dist}/Select/Select.mdx +0 -0
- /package/{src → dist}/Select/index.js +0 -0
- /package/{src → dist}/Select/mock_data/jobs.json +0 -0
- /package/{src → dist}/Switcher/Switcher.mdx +0 -0
- /package/{src → dist}/Switcher/index.js +0 -0
- /package/{src → dist}/app.d.ts +0 -0
- /package/{src → dist}/app.html +0 -0
- /package/{src → dist}/assets/close-circle.svg.svelte +0 -0
- /package/{src → dist}/assets/grow.svg.svelte +0 -0
- /package/{src → dist}/assets/hand-pointer.svg.svelte +0 -0
- /package/{src → dist}/assets/shrink.svg.svelte +0 -0
- /package/{src → dist}/assets/tap.svg.svelte +0 -0
- /package/{src → dist}/assets/times-circle-solid.svg.svelte +0 -0
- /package/{src → dist}/index.js +0 -0
- /package/{src → dist}/maplibre/AttributionControl/index.js +0 -0
- /package/{src → dist}/maplibre/GeocoderControl/index.js +0 -0
- /package/{src → dist}/maplibre/Map/index.js +0 -0
- /package/{src → dist}/maplibre/MapControl/MapControl.mdx +0 -0
- /package/{src → dist}/maplibre/MapControl/index.js +0 -0
- /package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.mdx +0 -0
- /package/{src → dist}/maplibre/MapStyle/index.js +0 -0
- /package/{src → dist}/maplibre/Maplibre.mdx +0 -0
- /package/{src → dist}/maplibre/NavigationControl/index.js +0 -0
- /package/{src → dist}/maplibre/ScaleControl/index.js +0 -0
- /package/{src → dist}/maplibre/Source/index.js +0 -0
- /package/{src → dist}/maplibre/Tooltip/index.js +0 -0
- /package/{src → dist}/maplibre/VectorLayer/index.js +0 -0
- /package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.mdx +0 -0
- /package/{src → dist}/maplibre/VectorTileSource/index.js +0 -0
- /package/{src → dist}/maplibre/WithLinkLocation/WithLinkLocation.mdx +0 -0
- /package/{src → dist}/maplibre/WithLinkLocation/index.js +0 -0
- /package/{src → dist}/styles/base.scss +0 -0
- /package/{src → dist}/utils/formatDate.js +0 -0
- /package/{src → dist}/utils/formatNumber.js +0 -0
- /package/{src → dist}/utils/getColorsBetween.js +0 -0
- /package/{src → dist}/utils/getComparisonDiffs.js +0 -0
- /package/{src → dist}/utils/getLaenderFromTopo.js +0 -0
- /package/{src → dist}/utils/getLaenderNicenameFromAgs.js +0 -0
- /package/{src → dist}/utils/isSvelteComponent.js +0 -0
- /package/{src → dist}/utils/prepareSophoraModel.js +0 -0
- /package/{src → dist}/utils/scrollIntoViewWithOffset.js +0 -0
- /package/{src → dist}/utils/topoToGeo.js +0 -0
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { createEventDispatcher } from 'svelte';
|
|
3
|
-
import Circle from '../assets/times-circle-solid.svg.svelte';
|
|
4
|
-
import Caption from '../Caption/Caption.svelte';
|
|
5
|
-
|
|
6
|
-
export let data = [];
|
|
7
|
-
export let query: string = '';
|
|
8
|
-
export let placeholder: string = 'Platzhalter';
|
|
9
|
-
export let label: string;
|
|
10
|
-
export let name: string;
|
|
11
|
-
|
|
12
|
-
const sortData = (a, b) => {
|
|
13
|
-
return a.value.localeCompare(b.value);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
let listRef;
|
|
17
|
-
let inputRef;
|
|
18
|
-
let controlsRef;
|
|
19
|
-
const dispatch = createEventDispatcher();
|
|
20
|
-
const maxSuggestions = 100;
|
|
21
|
-
|
|
22
|
-
let highlightedItemIndex = -1;
|
|
23
|
-
$: suggestions = data.sort(sortData).slice(0, maxSuggestions);
|
|
24
|
-
$: isActive = false;
|
|
25
|
-
|
|
26
|
-
// Insert clicked item into search input,
|
|
27
|
-
// dispatch it as select event and close the dropdown
|
|
28
|
-
const handleItemClick = (index) => {
|
|
29
|
-
highlightedItemIndex = index;
|
|
30
|
-
setSelectedItem(suggestions[highlightedItemIndex]);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const setSelectedItem = (item) => {
|
|
34
|
-
query = item.value;
|
|
35
|
-
isActive = false;
|
|
36
|
-
dispatch('select', { item });
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// Register keyboard events
|
|
40
|
-
const handleKeyDown = (e) => {
|
|
41
|
-
if (e.key === 'ArrowDown') {
|
|
42
|
-
e.preventDefault();
|
|
43
|
-
highlightedItemIndex =
|
|
44
|
-
highlightedItemIndex < suggestions.length - 1 ? highlightedItemIndex + 1 : 0;
|
|
45
|
-
const target = listRef.querySelector(`ul li:nth-child(${highlightedItemIndex + 1})`);
|
|
46
|
-
target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
47
|
-
} else if (e.key === 'ArrowUp') {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
highlightedItemIndex =
|
|
50
|
-
highlightedItemIndex > 0 ? highlightedItemIndex - 1 : suggestions.length - 1;
|
|
51
|
-
const target = listRef.querySelector(`ul li:nth-child(${highlightedItemIndex + 1})`);
|
|
52
|
-
target.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
53
|
-
} else if (e.key === 'Enter') {
|
|
54
|
-
if (highlightedItemIndex > -1) {
|
|
55
|
-
setSelectedItem(suggestions[highlightedItemIndex]);
|
|
56
|
-
isActive = false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const handleClear = () => {
|
|
62
|
-
query = '';
|
|
63
|
-
inputRef.focus();
|
|
64
|
-
setSuggestions();
|
|
65
|
-
dispatch('select', {
|
|
66
|
-
item: null
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const setSuggestions = () => {
|
|
71
|
-
suggestions = data
|
|
72
|
-
.filter((el) => {
|
|
73
|
-
return el.value.toLowerCase().startsWith(query.toLowerCase());
|
|
74
|
-
})
|
|
75
|
-
.slice(0, maxSuggestions)
|
|
76
|
-
.sort(sortData);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// update dropdown list if input value changes
|
|
80
|
-
const handleInput = () => {
|
|
81
|
-
isActive = true;
|
|
82
|
-
if (query.length === 0) {
|
|
83
|
-
suggestions = data;
|
|
84
|
-
} else {
|
|
85
|
-
setSuggestions();
|
|
86
|
-
highlightedItemIndex = -1;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<!--
|
|
92
|
-
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.
|
|
93
|
-
|
|
94
|
-
Data should be provided as array of objects. Each object contains the information for a dropdown entry:
|
|
95
|
-
- **value** *string* the text that is displayed in the input. Has to be unique!
|
|
96
|
-
- **label** *string* | *svelte component* | *array of svelte component and props object* text, html or component displayed in the dropdown list
|
|
97
|
-
- **details** *object* extra data needed by selection handler
|
|
98
|
-
@component
|
|
99
|
-
-->
|
|
100
|
-
|
|
101
|
-
<div class="autocomplete" class:active={isActive}>
|
|
102
|
-
<label for={name}>{label}</label>
|
|
103
|
-
<input
|
|
104
|
-
type="text"
|
|
105
|
-
{name}
|
|
106
|
-
{placeholder}
|
|
107
|
-
autocomplete="off"
|
|
108
|
-
autocorrect="off"
|
|
109
|
-
autocapitalize="off"
|
|
110
|
-
data-testid="autocomplete-input"
|
|
111
|
-
bind:this={inputRef}
|
|
112
|
-
bind:value={query}
|
|
113
|
-
on:keydown={handleKeyDown}
|
|
114
|
-
on:input={handleInput}
|
|
115
|
-
on:focus={() => {
|
|
116
|
-
isActive = true;
|
|
117
|
-
}}
|
|
118
|
-
on:blur={(e) => {
|
|
119
|
-
if (listRef.contains(e.relatedTarget)) {
|
|
120
|
-
window.setTimeout(() => {
|
|
121
|
-
isActive = false;
|
|
122
|
-
}, 100);
|
|
123
|
-
} else if (!controlsRef.contains(e.relatedTarget)) {
|
|
124
|
-
isActive = false;
|
|
125
|
-
}
|
|
126
|
-
}}
|
|
127
|
-
/>
|
|
128
|
-
|
|
129
|
-
<ul tabindex="-1" bind:this={listRef}>
|
|
130
|
-
{#each suggestions as item, i (item.value)}
|
|
131
|
-
<li>
|
|
132
|
-
<button
|
|
133
|
-
class={`item ${i === highlightedItemIndex ? 'active' : ''}`}
|
|
134
|
-
tabindex="-1"
|
|
135
|
-
type="button"
|
|
136
|
-
on:click={(e) => {
|
|
137
|
-
e.preventDefault();
|
|
138
|
-
handleItemClick(i);
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<Caption>
|
|
142
|
-
{item.label}
|
|
143
|
-
</Caption>
|
|
144
|
-
</button>
|
|
145
|
-
</li>
|
|
146
|
-
{/each}
|
|
147
|
-
</ul>
|
|
148
|
-
<div class="controls" bind:this={controlsRef}>
|
|
149
|
-
<button type="button" on:click={handleClear} class="clear" class:active={query.length > 0}>
|
|
150
|
-
<Circle />
|
|
151
|
-
</button>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
|
|
155
|
-
<style lang="scss">
|
|
156
|
-
@use '../styles/base.scss';
|
|
157
|
-
|
|
158
|
-
.autocomplete {
|
|
159
|
-
position: relative;
|
|
160
|
-
display: block;
|
|
161
|
-
color: white;
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-flow: column;
|
|
164
|
-
|
|
165
|
-
input {
|
|
166
|
-
@extend %form-input;
|
|
167
|
-
width: auto;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
ul {
|
|
171
|
-
position: absolute;
|
|
172
|
-
top: 100%;
|
|
173
|
-
border: 1px solid currentColor;
|
|
174
|
-
background: var(--violet-dark-3);
|
|
175
|
-
border-bottom-left-radius: var(--br-small);
|
|
176
|
-
border-bottom-right-radius: var(--br-small);
|
|
177
|
-
border-top: 0;
|
|
178
|
-
left: 0;
|
|
179
|
-
right: 0;
|
|
180
|
-
max-height: 10rem;
|
|
181
|
-
overflow-y: scroll;
|
|
182
|
-
z-index: 1000;
|
|
183
|
-
opacity: 0;
|
|
184
|
-
transition: 100ms;
|
|
185
|
-
pointer-events: none;
|
|
186
|
-
&:empty {
|
|
187
|
-
box-shadow: none;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.item {
|
|
191
|
-
padding: 0.5em;
|
|
192
|
-
width: 100%;
|
|
193
|
-
background: transparent;
|
|
194
|
-
border: 0;
|
|
195
|
-
text-align: left;
|
|
196
|
-
color: currentColor;
|
|
197
|
-
border-bottom: 1px solid rgba(white, 0.25);
|
|
198
|
-
cursor: pointer;
|
|
199
|
-
&.active,
|
|
200
|
-
&:hover {
|
|
201
|
-
text-decoration: underline;
|
|
202
|
-
background-color: rgba(white, 0.05);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.clear {
|
|
208
|
-
position: absolute;
|
|
209
|
-
top: 50%;
|
|
210
|
-
right: 0.75rem;
|
|
211
|
-
width: 1.2rem;
|
|
212
|
-
height: 1.2rem;
|
|
213
|
-
background: transparent;
|
|
214
|
-
border: 0;
|
|
215
|
-
display: none;
|
|
216
|
-
color: white;
|
|
217
|
-
&.active {
|
|
218
|
-
display: block;
|
|
219
|
-
}
|
|
220
|
-
&:hover,
|
|
221
|
-
&:focus {
|
|
222
|
-
color: var(--red-base);
|
|
223
|
-
cursor: pointer;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
&.active {
|
|
227
|
-
ul {
|
|
228
|
-
opacity: 1;
|
|
229
|
-
pointer-events: all;
|
|
230
|
-
}
|
|
231
|
-
input {
|
|
232
|
-
border-bottom-right-radius: 0;
|
|
233
|
-
border-bottom-left-radius: 0;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
</style>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script context="module" lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Button from './Button.svelte';
|
|
4
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
5
|
-
|
|
6
|
-
const { Story } = defineMeta({
|
|
7
|
-
title: 'Form/Button',
|
|
8
|
-
component: Button
|
|
9
|
-
});
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Story name="Basic" asChild>
|
|
13
|
-
<DesignTokens>
|
|
14
|
-
<Button label="This is a button label"></Button>
|
|
15
|
-
</DesignTokens>
|
|
16
|
-
</Story>
|
|
17
|
-
<Story name="Disabled" asChild>
|
|
18
|
-
<DesignTokens>
|
|
19
|
-
<Button disabled label="This button is disabled"></Button>
|
|
20
|
-
</DesignTokens>
|
|
21
|
-
</Story>
|
package/src/Button/Button.svelte
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Copy from '../Copy/Copy.svelte';
|
|
3
|
-
|
|
4
|
-
interface ButtonProps {
|
|
5
|
-
label: string;
|
|
6
|
-
as?: 'button' | 'a';
|
|
7
|
-
href?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
onclick?: (e: MouseEvent) => any | void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const { as = 'button', label, href, disabled, onclick }: ButtonProps = $props();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
{#if as === 'a'}
|
|
16
|
-
<a class="button" class:disabled {href}>
|
|
17
|
-
<Copy weight="bold">
|
|
18
|
-
{label}
|
|
19
|
-
</Copy>
|
|
20
|
-
</a>
|
|
21
|
-
{:else}
|
|
22
|
-
<button class="button" {onclick} {disabled}>
|
|
23
|
-
<Copy weight="bold">
|
|
24
|
-
{label}
|
|
25
|
-
</Copy>
|
|
26
|
-
</button>
|
|
27
|
-
{/if}
|
|
28
|
-
|
|
29
|
-
<style lang="scss">
|
|
30
|
-
.button {
|
|
31
|
-
background: var(--violet-dark-3);
|
|
32
|
-
display: inline-flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-self: flex-start;
|
|
35
|
-
padding: 0.45em 1.25em;
|
|
36
|
-
color: white;
|
|
37
|
-
border: 1px solid rgba(white, 0.1);
|
|
38
|
-
box-shadow: 0px 0px 10px rgba(black, 0.05);
|
|
39
|
-
border-radius: var(--br-small);
|
|
40
|
-
text-shadow: 0px 0px 5px rgba(black, 0.05);
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
&:hover,
|
|
43
|
-
&:focus-visible {
|
|
44
|
-
text-decoration: underline;
|
|
45
|
-
text-underline-offset: 0.15em;
|
|
46
|
-
}
|
|
47
|
-
&.disabled,
|
|
48
|
-
&:disabled {
|
|
49
|
-
opacity: 0.5;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
</style>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
4
|
-
|
|
5
|
-
import Caption from './Caption.svelte';
|
|
6
|
-
|
|
7
|
-
const { Story } = defineMeta({
|
|
8
|
-
title: 'Typography/Caption',
|
|
9
|
-
component: Caption
|
|
10
|
-
});
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<Story name="Default" asChild>
|
|
14
|
-
<DesignTokens>
|
|
15
|
-
<Caption>Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen)</Caption>
|
|
16
|
-
</DesignTokens>
|
|
17
|
-
</Story>
|
|
18
|
-
<Story name="Bold" asChild>
|
|
19
|
-
<DesignTokens>
|
|
20
|
-
<Caption weight="bold">
|
|
21
|
-
Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen)
|
|
22
|
-
</Caption>
|
|
23
|
-
</DesignTokens>
|
|
24
|
-
</Story>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
interface CaptionProps {
|
|
5
|
-
weight?: 'regular' | 'bold';
|
|
6
|
-
children?: Snippet;
|
|
7
|
-
}
|
|
8
|
-
let { weight = 'regular', children }: CaptionProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div class={['container', weight]}>
|
|
12
|
-
{#if children}
|
|
13
|
-
{@render children()}
|
|
14
|
-
{/if}
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<style lang="scss">
|
|
18
|
-
.container {
|
|
19
|
-
font-family: var(--swr-sans);
|
|
20
|
-
font-size: var(--fs-small-2);
|
|
21
|
-
line-height: 1;
|
|
22
|
-
letter-spacing: 0.0045em;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.bold {
|
|
26
|
-
font-weight: 585;
|
|
27
|
-
letter-spacing: 0;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script context="module" lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Card from './Card.svelte';
|
|
4
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
5
|
-
|
|
6
|
-
const { Story } = defineMeta({
|
|
7
|
-
title: 'Display/Card/Base',
|
|
8
|
-
component: Card
|
|
9
|
-
});
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Story name="Basic card" asChild>
|
|
13
|
-
<DesignTokens>
|
|
14
|
-
<Card>
|
|
15
|
-
<h1>Any content</h1>
|
|
16
|
-
<p>can be added to a basic <code>Card</code> component.</p>
|
|
17
|
-
</Card>
|
|
18
|
-
</DesignTokens>
|
|
19
|
-
</Story>
|
package/src/Card/Card.svelte
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import Copy from '../Copy/Copy.svelte';
|
|
4
|
-
|
|
5
|
-
interface CardProps {
|
|
6
|
-
children?: Snippet;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let { children }: CardProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div class="card">
|
|
13
|
-
{#if children}
|
|
14
|
-
<Copy>
|
|
15
|
-
{@render children()}
|
|
16
|
-
</Copy>
|
|
17
|
-
{/if}
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<style lang="scss">
|
|
21
|
-
@use '../styles/base.scss';
|
|
22
|
-
|
|
23
|
-
.card {
|
|
24
|
-
color: white;
|
|
25
|
-
width: auto;
|
|
26
|
-
max-width: var(--app-max-width);
|
|
27
|
-
background: var(--violet-dark-5);
|
|
28
|
-
border-radius: var(--br-large);
|
|
29
|
-
padding: 1.5rem;
|
|
30
|
-
@media (min-width: base.$bp-m) {
|
|
31
|
-
padding: 2.5rem;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
4
|
-
|
|
5
|
-
import ChartFooter from './ChartFooter.svelte';
|
|
6
|
-
import Middot from '../Middot/Middot.svelte';
|
|
7
|
-
|
|
8
|
-
const { Story } = defineMeta({
|
|
9
|
-
title: 'Chart/ChartFooter',
|
|
10
|
-
component: ChartFooter
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<Story name="One-up" asChild>
|
|
15
|
-
<DesignTokens>
|
|
16
|
-
<ChartFooter layout="one-up">
|
|
17
|
-
Daten: <a href="#1">Zensus 2022</a>
|
|
18
|
-
(Durchschnittsmieten und Einwohnerzahlen),
|
|
19
|
-
<a href="#1">OpenStreetMap</a> (Kartenmaterial) <Middot /> In unserer Darstellung wurde das Zensusgitter
|
|
20
|
-
auf bewohnte Gebiete begrenzt.
|
|
21
|
-
</ChartFooter>
|
|
22
|
-
</DesignTokens>
|
|
23
|
-
</Story>
|
|
24
|
-
|
|
25
|
-
<Story name="Two-up" asChild>
|
|
26
|
-
<DesignTokens>
|
|
27
|
-
<ChartFooter layout="two-up">
|
|
28
|
-
Daten: <a href="#1">Zensus 2022</a>
|
|
29
|
-
(Durchschnittsmieten und Einwohnerzahlen)
|
|
30
|
-
</ChartFooter>
|
|
31
|
-
</DesignTokens>
|
|
32
|
-
</Story>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import Logotype from '../Logotype/Logotype.svelte';
|
|
4
|
-
import Note from '../Note/Note.svelte';
|
|
5
|
-
|
|
6
|
-
interface ChartFooterProps {
|
|
7
|
-
layout: 'one-up' | 'two-up';
|
|
8
|
-
children?: Snippet;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let { layout = 'one-up', children }: ChartFooterProps = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<footer class={`container ${layout}`}>
|
|
15
|
-
{#if children}
|
|
16
|
-
<Note>
|
|
17
|
-
{@render children()}
|
|
18
|
-
</Note>
|
|
19
|
-
{/if}
|
|
20
|
-
<Logotype />
|
|
21
|
-
</footer>
|
|
22
|
-
|
|
23
|
-
<style lang="scss">
|
|
24
|
-
@use '../styles/base.scss';
|
|
25
|
-
|
|
26
|
-
.container {
|
|
27
|
-
gap: 0.5rem;
|
|
28
|
-
:global(div) {
|
|
29
|
-
width: 100%;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
.one-up {
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-flow: column;
|
|
35
|
-
align-items: flex-start;
|
|
36
|
-
}
|
|
37
|
-
.two-up {
|
|
38
|
-
display: grid;
|
|
39
|
-
grid-template-columns: 1fr;
|
|
40
|
-
@media (min-width: base.$bp-s) {
|
|
41
|
-
grid-template-columns: 2.5fr 1fr;
|
|
42
|
-
align-items: last baseline;
|
|
43
|
-
justify-items: flex-end;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
4
|
-
import { expect } from 'storybook/test';
|
|
5
|
-
import ChartHeader from './ChartHeader.svelte';
|
|
6
|
-
|
|
7
|
-
const { Story } = defineMeta({
|
|
8
|
-
title: 'Chart/ChartHeader',
|
|
9
|
-
component: ChartHeader
|
|
10
|
-
});
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<Story
|
|
14
|
-
name="Default"
|
|
15
|
-
asChild
|
|
16
|
-
play={async ({ step }) => {
|
|
17
|
-
await step('Container has ID attribute derived from title prop', async () => {
|
|
18
|
-
const containerEl = document.querySelector('#mehr-uber-60-jahrige-in-allen-berufen');
|
|
19
|
-
expect(containerEl).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
}}
|
|
22
|
-
>
|
|
23
|
-
<DesignTokens>
|
|
24
|
-
<ChartHeader
|
|
25
|
-
title="Mehr über-60-Jährige in allen Berufen"
|
|
26
|
-
subtitle="Veränderung des Anteils der Beschäftigen über 60 Jahren in allen Berufsgruppen seit 2013 (Bundesweit)"
|
|
27
|
-
>
|
|
28
|
-
Arbitrary HTML content can go here
|
|
29
|
-
</ChartHeader>
|
|
30
|
-
</DesignTokens>
|
|
31
|
-
</Story>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { within, expect } from 'storybook/test';
|
|
4
|
-
|
|
5
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
6
|
-
|
|
7
|
-
import ChartList from './ChartList.svelte';
|
|
8
|
-
|
|
9
|
-
const { Story } = defineMeta({
|
|
10
|
-
title: 'Meta/ChartList',
|
|
11
|
-
component: ChartList
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const testCharts = [
|
|
15
|
-
{ title: 'Baden-Württemberg Loosers', slug: 'bw-loosers' },
|
|
16
|
-
{ title: 'Baden-Württemberg Winners', slug: 'bw-winners' },
|
|
17
|
-
{ title: 'Rheinland-Pfalz Loosers', slug: 'rp-loosers' },
|
|
18
|
-
{ title: 'Rheinland-Pfalz Winners', slug: 'rp-winners' }
|
|
19
|
-
];
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<Story
|
|
23
|
-
name="Default"
|
|
24
|
-
asChild
|
|
25
|
-
play={async ({ canvasElement, step }) => {
|
|
26
|
-
const canvas = within(canvasElement);
|
|
27
|
-
|
|
28
|
-
await step('Project title renders', async () => {
|
|
29
|
-
const titleEl = canvas.getByTestId('chartlist-project-title');
|
|
30
|
-
expect(titleEl).toHaveTextContent('Grafiken für p110: Wie sieht der Wald von morgen aus?');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
await step('All chart list items render', async () => {
|
|
34
|
-
testCharts.forEach((c) => {
|
|
35
|
-
const el = canvas.getByText(c.title);
|
|
36
|
-
expect(el).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<DesignTokens>
|
|
42
|
-
<ChartList
|
|
43
|
-
baseUrl="https://static.datenhub.net/apps/p110_wald-klimawandel/main"
|
|
44
|
-
charts={testCharts}
|
|
45
|
-
project="p110: Wie sieht der Wald von morgen aus?"
|
|
46
|
-
/>
|
|
47
|
-
</DesignTokens>
|
|
48
|
-
</Story>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import DesignTokens from '../DesignTokens/DesignTokens.svelte';
|
|
4
|
-
|
|
5
|
-
import Copy from './Copy.svelte';
|
|
6
|
-
|
|
7
|
-
const { Story } = defineMeta({
|
|
8
|
-
title: 'Typography/Copy',
|
|
9
|
-
component: Copy
|
|
10
|
-
});
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<Story name="Default" asChild>
|
|
14
|
-
<DesignTokens>
|
|
15
|
-
<Copy>
|
|
16
|
-
Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen), bedient derzeit
|
|
17
|
-
größtenteils Allergiegeplagte: "Wir gehen nahtlos von der Erkältungssaison in die Pollensaison
|
|
18
|
-
hinein. Wir merken definitiv eine Veränderung über die letzten Jahre: Die Pollensaison wird
|
|
19
|
-
länger, die Grippesaison wird länger und dadurch überlappt sich das Ganze."
|
|
20
|
-
</Copy>
|
|
21
|
-
</DesignTokens>
|
|
22
|
-
</Story>
|
|
23
|
-
<Story name="Bold" asChild>
|
|
24
|
-
<DesignTokens>
|
|
25
|
-
<Copy weight="bold">
|
|
26
|
-
Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen), bedient derzeit
|
|
27
|
-
größtenteils Allergiegeplagte: "Wir gehen nahtlos von der Erkältungssaison in die Pollensaison
|
|
28
|
-
hinein. Wir merken definitiv eine Veränderung über die letzten Jahre: Die Pollensaison wird
|
|
29
|
-
länger, die Grippesaison wird länger und dadurch überlappt sich das Ganze."
|
|
30
|
-
</Copy>
|
|
31
|
-
</DesignTokens>
|
|
32
|
-
</Story>
|
package/src/Copy/Copy.svelte
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
interface CopyProps {
|
|
5
|
-
weight?: 'regular' | 'bold';
|
|
6
|
-
children?: Snippet;
|
|
7
|
-
}
|
|
8
|
-
let { weight = 'regular', children }: CopyProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div class={['container', weight]}>
|
|
12
|
-
{#if children}
|
|
13
|
-
{@render children()}
|
|
14
|
-
{/if}
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<style lang="scss">
|
|
18
|
-
.container {
|
|
19
|
-
font-family: var(--swr-sans);
|
|
20
|
-
font-size: var(--fs-base);
|
|
21
|
-
letter-spacing: 0.005em;
|
|
22
|
-
line-height: 1.475;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.bold {
|
|
26
|
-
font-weight: 585;
|
|
27
|
-
letter-spacing: 0;
|
|
28
|
-
}
|
|
29
|
-
</style>
|