@swr-data-lab/components 1.13.1 → 1.13.3

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 (72) hide show
  1. package/package.json +2 -4
  2. package/dist/Autocomplete/Autocomplete.stories.svelte +0 -61
  3. package/dist/Autocomplete/Autocomplete.stories.svelte.d.ts +0 -27
  4. package/dist/Button/Button.stories.svelte +0 -19
  5. package/dist/Button/Button.stories.svelte.d.ts +0 -19
  6. package/dist/Caption/Caption.stories.svelte +0 -24
  7. package/dist/Caption/Caption.stories.svelte.d.ts +0 -27
  8. package/dist/Card/Card.stories.svelte +0 -17
  9. package/dist/Card/Card.stories.svelte.d.ts +0 -19
  10. package/dist/ChartFooter/ChartFooter.mdx +0 -17
  11. package/dist/ChartFooter/ChartFooter.stories.svelte +0 -32
  12. package/dist/ChartFooter/ChartFooter.stories.svelte.d.ts +0 -27
  13. package/dist/ChartHeader/ChartHeader.mdx +0 -16
  14. package/dist/ChartHeader/ChartHeader.stories.svelte +0 -31
  15. package/dist/ChartHeader/ChartHeader.stories.svelte.d.ts +0 -27
  16. package/dist/ChartList/ChartList.mdx +0 -13
  17. package/dist/ChartList/ChartList.stories.svelte +0 -48
  18. package/dist/ChartList/ChartList.stories.svelte.d.ts +0 -27
  19. package/dist/Copy/Copy.stories.svelte +0 -32
  20. package/dist/Copy/Copy.stories.svelte.d.ts +0 -27
  21. package/dist/DesignTokens/DesignTokens.mdx +0 -110
  22. package/dist/FormLabel/FormLabel.mdx +0 -13
  23. package/dist/FormLabel/FormLabel.stories.svelte +0 -52
  24. package/dist/FormLabel/FormLabel.stories.svelte.d.ts +0 -27
  25. package/dist/Headline/Headline.stories.svelte +0 -17
  26. package/dist/Headline/Headline.stories.svelte.d.ts +0 -27
  27. package/dist/HighlightCard/HighlightCard.stories.svelte +0 -55
  28. package/dist/HighlightCard/HighlightCard.stories.svelte.d.ts +0 -19
  29. package/dist/Intro.mdx +0 -7
  30. package/dist/Logotype/Logotype.stories.svelte +0 -14
  31. package/dist/Logotype/Logotype.stories.svelte.d.ts +0 -19
  32. package/dist/Middot/Middot.stories.svelte +0 -14
  33. package/dist/Middot/Middot.stories.svelte.d.ts +0 -19
  34. package/dist/Note/Note.stories.svelte +0 -23
  35. package/dist/Note/Note.stories.svelte.d.ts +0 -27
  36. package/dist/Select/Select.mdx +0 -25
  37. package/dist/Select/Select.stories.svelte +0 -202
  38. package/dist/Select/Select.stories.svelte.d.ts +0 -19
  39. package/dist/Select/SelectStoriesTemplate.svelte +0 -31
  40. package/dist/Select/SelectStoriesTemplate.svelte.d.ts +0 -15
  41. package/dist/Switcher/Switcher.mdx +0 -13
  42. package/dist/Switcher/Switcher.stories.svelte +0 -44
  43. package/dist/Switcher/Switcher.stories.svelte.d.ts +0 -27
  44. package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte +0 -27
  45. package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte.d.ts +0 -19
  46. package/dist/maplibre/GeocoderControl/GeocoderControl.stories.svelte +0 -74
  47. package/dist/maplibre/GeocoderControl/GeocoderControl.stories.svelte.d.ts +0 -19
  48. package/dist/maplibre/Map/Map.stories.svelte +0 -113
  49. package/dist/maplibre/Map/Map.stories.svelte.d.ts +0 -19
  50. package/dist/maplibre/MapControl/MapControl.mdx +0 -12
  51. package/dist/maplibre/MapControl/MapControl.stories.svelte +0 -46
  52. package/dist/maplibre/MapControl/MapControl.stories.svelte.d.ts +0 -19
  53. package/dist/maplibre/MapStyle/SWRDataLabLight.mdx +0 -86
  54. package/dist/maplibre/MapStyle/SWRDataLabLight.stories.svelte +0 -39
  55. package/dist/maplibre/MapStyle/SWRDataLabLight.stories.svelte.d.ts +0 -18
  56. package/dist/maplibre/Maplibre.mdx +0 -91
  57. package/dist/maplibre/NavigationControl/NavigationControl.stories.svelte +0 -37
  58. package/dist/maplibre/NavigationControl/NavigationControl.stories.svelte.d.ts +0 -19
  59. package/dist/maplibre/ScaleControl/ScaleControl.stories.svelte +0 -68
  60. package/dist/maplibre/ScaleControl/ScaleControl.stories.svelte.d.ts +0 -19
  61. package/dist/maplibre/Source/MapSource.stories.svelte +0 -7
  62. package/dist/maplibre/Source/MapSource.stories.svelte.d.ts +0 -19
  63. package/dist/maplibre/Tooltip/Tooltip.stories.svelte +0 -186
  64. package/dist/maplibre/Tooltip/Tooltip.stories.svelte.d.ts +0 -19
  65. package/dist/maplibre/VectorLayer/VectorLayer.stories.svelte +0 -62
  66. package/dist/maplibre/VectorLayer/VectorLayer.stories.svelte.d.ts +0 -19
  67. package/dist/maplibre/VectorTileSource/VectorTileSource.mdx +0 -19
  68. package/dist/maplibre/VectorTileSource/VectorTileSource.stories.svelte +0 -44
  69. package/dist/maplibre/VectorTileSource/VectorTileSource.stories.svelte.d.ts +0 -19
  70. package/dist/maplibre/WithLinkLocation/WithLinkLocation.mdx +0 -11
  71. package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +0 -27
  72. package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte.d.ts +0 -19
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swr-data-lab/components",
3
3
  "description": "SWR Data Lab component library",
4
- "version": "1.13.1",
4
+ "version": "1.13.3",
5
5
  "author": "SWR Data Lab",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -81,9 +81,7 @@
81
81
  ]
82
82
  },
83
83
  "files": [
84
- "./dist",
85
- "!./dist/**/*.test.*",
86
- "!./dist/**/*.stories.*"
84
+ "dist/"
87
85
  ],
88
86
  "sideEffects": [
89
87
  "**/*.css"
@@ -1,61 +0,0 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { userEvent, within, expect } from 'storybook/test';
4
- import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
-
6
- import Autocomplete from './Autocomplete.svelte';
7
-
8
- const { Story } = defineMeta({
9
- title: 'Deprecated/Autocomplete',
10
- component: Autocomplete
11
- });
12
-
13
- const testData = ['Apples', 'Oranges', 'Pears', 'Peaches', 'Bananas'].map((el) => {
14
- return {
15
- value: el,
16
- label: el,
17
- details: {}
18
- };
19
- });
20
- </script>
21
-
22
- <Story
23
- name="Basic"
24
- asChild
25
- play={async ({ canvasElement, step }) => {
26
- const canvas = within(canvasElement);
27
- const input = canvas.getByTestId('autocomplete-input');
28
- await step('Select using the mouse', async () => {
29
- await userEvent.click(input);
30
- expect(input).toHaveFocus();
31
- await userEvent.keyboard('ba');
32
- const bananasOption = canvas.getByText('Bananas');
33
- await userEvent.click(bananasOption);
34
- expect(input).toHaveValue('Bananas');
35
- });
36
- await userEvent.clear(input);
37
- await step('Select using the keyboard', async () => {
38
- await userEvent.click(input);
39
- expect(input).toHaveFocus();
40
- await userEvent.keyboard('ap');
41
- await userEvent.keyboard('{ArrowDown}');
42
- await userEvent.keyboard('{Enter}');
43
- expect(input).toHaveValue('Apples');
44
- });
45
- await userEvent.clear(input);
46
- }}
47
- >
48
- <DesignTokens>
49
- <div class="container">
50
- <Autocomplete label="" name="test" data={testData} query="" placeholder="Select a fruit"
51
- ></Autocomplete>
52
- </div>
53
- </DesignTokens>
54
- </Story>
55
-
56
- <style>
57
- .container {
58
- background: var(--violet-dark-5);
59
- padding: 5%;
60
- }
61
- </style>
@@ -1,27 +0,0 @@
1
- export default Autocomplete;
2
- type Autocomplete = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const Autocomplete: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- import Autocomplete from './Autocomplete.svelte';
15
- 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> {
16
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
- $$bindings?: Bindings;
18
- } & Exports;
19
- (internal: unknown, props: {
20
- $$events?: Events;
21
- $$slots?: Slots;
22
- }): Exports & {
23
- $set?: any;
24
- $on?: any;
25
- };
26
- z_$$bindings?: Bindings;
27
- }
@@ -1,19 +0,0 @@
1
- <script context="module" lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
2
- import Button from './Button.svelte';
3
- import DesignTokens from '../DesignTokens/DesignTokens.svelte';
4
- const { Story } = defineMeta({
5
- title: 'Form/Button',
6
- component: Button
7
- });
8
- </script>
9
-
10
- <Story name="Basic" asChild>
11
- <DesignTokens>
12
- <Button label="This is a button label"></Button>
13
- </DesignTokens>
14
- </Story>
15
- <Story name="Disabled" asChild>
16
- <DesignTokens>
17
- <Button disabled label="This button is disabled"></Button>
18
- </DesignTokens>
19
- </Story>
@@ -1,19 +0,0 @@
1
- import Button from './Button.svelte';
2
- 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> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const Button: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
- [evt: string]: CustomEvent<any>;
17
- }, {}, {}, string>;
18
- type Button = InstanceType<typeof Button>;
19
- export default Button;
@@ -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,27 +0,0 @@
1
- export default Caption;
2
- type Caption = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const Caption: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- import Caption from './Caption.svelte';
15
- 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> {
16
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
- $$bindings?: Bindings;
18
- } & Exports;
19
- (internal: unknown, props: {
20
- $$events?: Events;
21
- $$slots?: Slots;
22
- }): Exports & {
23
- $set?: any;
24
- $on?: any;
25
- };
26
- z_$$bindings?: Bindings;
27
- }
@@ -1,17 +0,0 @@
1
- <script context="module" lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
2
- import Card from './Card.svelte';
3
- import DesignTokens from '../DesignTokens/DesignTokens.svelte';
4
- const { Story } = defineMeta({
5
- title: 'Display/Card/Base',
6
- component: Card
7
- });
8
- </script>
9
-
10
- <Story name="Basic card" asChild>
11
- <DesignTokens>
12
- <Card>
13
- <h1>Any content</h1>
14
- <p>can be added to a basic <code>Card</code> component.</p>
15
- </Card>
16
- </DesignTokens>
17
- </Story>
@@ -1,19 +0,0 @@
1
- import Card from './Card.svelte';
2
- 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> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const Card: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
- [evt: string]: CustomEvent<any>;
17
- }, {}, {}, string>;
18
- type Card = InstanceType<typeof Card>;
19
- export default Card;
@@ -1,17 +0,0 @@
1
- import { Story, Meta, Primary, Controls, Stories } from '@storybook/addon-docs/blocks';
2
-
3
- import * as ChartFooterStories from './ChartFooter.stories.svelte';
4
-
5
- <Meta of={ChartFooterStories}/>
6
-
7
- # Chart Footer
8
-
9
- Standard chart footer.
10
-
11
- - Nest arbitrary HTML inside component to render your notes
12
- - Use `one-up` layout unless your footnotes fit two lines or fewer.
13
- - Use `<Middot/>` to separate sentences
14
-
15
- <Controls />
16
-
17
- <Stories/>
@@ -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,27 +0,0 @@
1
- export default ChartFooter;
2
- type ChartFooter = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const ChartFooter: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- import ChartFooter from './ChartFooter.svelte';
15
- 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> {
16
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
- $$bindings?: Bindings;
18
- } & Exports;
19
- (internal: unknown, props: {
20
- $$events?: Events;
21
- $$slots?: Slots;
22
- }): Exports & {
23
- $set?: any;
24
- $on?: any;
25
- };
26
- z_$$bindings?: Bindings;
27
- }
@@ -1,16 +0,0 @@
1
- import { Story, Meta, Primary, Controls, Stories } from '@storybook/addon-docs/blocks';
2
-
3
- import * as ChartHeaderStories from './ChartHeader.stories.svelte';
4
-
5
- <Meta of={ChartHeaderStories}/>
6
-
7
- # Chart header
8
-
9
- Standard chart header.
10
-
11
- - The slugified `title` is set as the header element's `id` attribute (useful for linking to interactives from in-article table of contents)
12
- - Any nested HTML will render under the description (useful for i.e colour keys and interactives controls).
13
-
14
- <Controls />
15
-
16
- <Stories/>
@@ -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,27 +0,0 @@
1
- export default ChartHeader;
2
- type ChartHeader = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const ChartHeader: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- import ChartHeader from './ChartHeader.svelte';
15
- 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> {
16
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
- $$bindings?: Bindings;
18
- } & Exports;
19
- (internal: unknown, props: {
20
- $$events?: Events;
21
- $$slots?: Slots;
22
- }): Exports & {
23
- $set?: any;
24
- $on?: any;
25
- };
26
- z_$$bindings?: Bindings;
27
- }
@@ -1,13 +0,0 @@
1
- import { Story, Meta, Primary, Controls, Stories } from '@storybook/addon-docs/blocks';
2
-
3
- import * as ChartListStories from './ChartList.stories.svelte';
4
-
5
- <Meta of={ChartListStories} />
6
-
7
- # Chart List
8
-
9
- Utility component for displaying a list of charts with associated embed URLs during development (typically on the `/` route of your Svelte project).
10
-
11
- <Stories />
12
-
13
- <Controls />
@@ -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,27 +0,0 @@
1
- export default ChartList;
2
- type ChartList = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const ChartList: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- import ChartList from './ChartList.svelte';
15
- 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> {
16
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
- $$bindings?: Bindings;
18
- } & Exports;
19
- (internal: unknown, props: {
20
- $$events?: Events;
21
- $$slots?: Slots;
22
- }): Exports & {
23
- $set?: any;
24
- $on?: any;
25
- };
26
- z_$$bindings?: Bindings;
27
- }
@@ -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>
@@ -1,27 +0,0 @@
1
- export default Copy;
2
- type Copy = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const Copy: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- import Copy from './Copy.svelte';
15
- 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> {
16
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
- $$bindings?: Bindings;
18
- } & Exports;
19
- (internal: unknown, props: {
20
- $$events?: Events;
21
- $$slots?: Slots;
22
- }): Exports & {
23
- $set?: any;
24
- $on?: any;
25
- };
26
- z_$$bindings?: Bindings;
27
- }
@@ -1,110 +0,0 @@
1
- import { Title, Story, ColorPalette, ColorItem, Meta, Typeset, Canvas } from '@storybook/addon-docs/blocks';
2
- import { shades, scales, typography } from "./Tokens"
3
-
4
- import * as HeadlineStories from "../Headline/Headline.stories.svelte"
5
- import * as CopyStories from "../Copy/Copy.stories.svelte"
6
- import * as CaptionStories from "../Caption/Caption.stories.svelte"
7
- import * as NoteStories from "../Note/Note.stories.svelte"
8
-
9
- <Meta title='Design Tokens'/>
10
-
11
- # Design Tokens
12
-
13
- ## Table of Contents
14
-
15
- - [Usage](#usage)
16
- - [Web](#web)
17
- - [Figma](#figma)
18
- - [Typography](#typography)
19
- - [Sizes](#sizes)
20
- - [Styles](#styles)
21
- - [Colours](#colours)
22
- - [Shades](#shades)
23
- - [Linear scales](#linear-scales)
24
- - [Categorical Scales](#categorical-scales)
25
- - [Divergent Scales](#divergent-scales)
26
-
27
- ## Usage
28
-
29
- ### Web
30
-
31
- The `<DesignTokens>` component makes colours, type sizes and other design tokens available to its children as CSS variables.
32
-
33
- ```html
34
- <script>
35
- import DesignTokens from "@swr-data-lab/components"
36
- </script>
37
-
38
- <DesignTokens>
39
- <p>I'm a sample paragraph</p>
40
- </DesignTokens>
41
-
42
- <style>
43
- p {
44
- color: var(--violet-dark-1) // this works
45
- }
46
- </style>
47
- ```
48
-
49
- You can also import `tokens` directly to use them in Javascript:
50
-
51
- ```jsx
52
- import tokens from "@swr-data-lab/components"
53
- import { scaleThreshold } from 'd3-scale';
54
- const sampleScale = scaleThreshold([0, 10], tokens.scales.red_blue);
55
- ```
56
-
57
- ### Figma
58
-
59
- The tokens on this page are available as a [Figma library](https://www.figma.com/design/Wrd7uUV3GxpNXXkM5ozuHk/Datalab-Design-Tokens?node-id=0-1&t=iOqDxhuMdvEyY8VK-1). This is enabled by default for any file in the [SWR Data Lab team](https://www.figma.com/files/1125823985461580916/team/1415988138343592768).
60
-
61
-
62
- ## Typography
63
-
64
- Type sizes and paragraph styles are designed to match the typography on [swr.de](https://www.swr.de/). **Styles** come with built-in settings for `line-height`, `letter-spacing`, etc. and should be preferred over using **sizes** directly.
65
-
66
- ### Styles
67
- #### H2
68
- <Canvas of={HeadlineStories.Default}/>
69
-
70
- #### Copy
71
- <Canvas of={CopyStories.Default}/>
72
-
73
- #### Caption
74
- <Canvas of={CaptionStories.Default}/>
75
-
76
- #### Note
77
- <Canvas of={NoteStories.Default}/>
78
-
79
- ### Sizes
80
- <Typeset fontWeight={600} fontFamily='SWR-VAR-Text' sampleText='Pollenflug in BW: Was Heuschnupfengeplagte jetzt wissen sollten' fontSizes={Object.entries(typography.wide.sizes).map(([key, size]) => {
81
- return size
82
- }).reverse()}/>
83
-
84
-
85
- ## Colours
86
- ### Shades
87
- <ColorPalette>
88
- {["violet", "plum", "pink", "red", "orange", "yellow", "apple" , "forest","teal", "blue", "gray"].map((el, i) => {
89
- return(
90
- <ColorItem
91
- title={`${el.split("")[0].toUpperCase()}${el.slice(1)}`}
92
- colors={shades[el]}
93
- />
94
- )
95
- })}
96
- </ColorPalette>
97
-
98
- ### Linear Scales
99
- ### Categorical Scales
100
- ### Divergent Scales
101
-
102
- <ColorPalette>
103
- {["red_blue", "red_violet", "red_forest", "red_apple", "red_teal", "violet_teal", "violet_orange", "blue_pink", "teal_pink", "forest_plum", "apple_plum", "orange_blue", "orange_teal"].map((el, _) => {
104
- return(<ColorItem
105
- title={`${el.split("_").map(c => {return c[0].toUpperCase() + c.slice(1)}).join("/")}`}
106
- subtitle={el}
107
- colors={scales[el]}
108
- />)
109
- })}
110
- </ColorPalette>