@swr-data-lab/components 1.11.0 → 1.11.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/package.json CHANGED
@@ -63,7 +63,7 @@
63
63
  "svelte": "./src/index.js"
64
64
  }
65
65
  },
66
- "version": "1.11.0",
66
+ "version": "1.11.2",
67
67
  "overrides": {
68
68
  "storybook": "$storybook"
69
69
  }
@@ -6,7 +6,8 @@
6
6
  import Autocomplete from './Autocomplete.svelte';
7
7
 
8
8
  const { Story } = defineMeta({
9
- title: 'Deprecated/Autocomplete'
9
+ title: 'Deprecated/Autocomplete',
10
+ component: Autocomplete
10
11
  });
11
12
 
12
13
  const testData = ['Apples', 'Oranges', 'Pears', 'Peaches', 'Bananas'].map((el) => {
@@ -20,7 +21,7 @@
20
21
 
21
22
  <Story
22
23
  name="Basic"
23
- tags={['autodocs']}
24
+ asChild
24
25
  play={async ({ canvasElement, step }) => {
25
26
  const canvas = within(canvasElement);
26
27
  const input = canvas.getByTestId('autocomplete-input');
@@ -4,16 +4,17 @@
4
4
  import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: 'Form/Button'
7
+ title: 'Form/Button',
8
+ component: Button
8
9
  });
9
10
  </script>
10
11
 
11
- <Story name="Basic">
12
+ <Story name="Basic" asChild>
12
13
  <DesignTokens>
13
14
  <Button label="This is a button label"></Button>
14
15
  </DesignTokens>
15
16
  </Story>
16
- <Story name="Disabled">
17
+ <Story name="Disabled" asChild>
17
18
  <DesignTokens>
18
19
  <Button disabled label="This button is disabled"></Button>
19
20
  </DesignTokens>
@@ -5,16 +5,17 @@
5
5
  import Caption from './Caption.svelte';
6
6
 
7
7
  const { Story } = defineMeta({
8
- title: 'Typography/Caption'
8
+ title: 'Typography/Caption',
9
+ component: Caption
9
10
  });
10
11
  </script>
11
12
 
12
- <Story name="Default">
13
+ <Story name="Default" asChild>
13
14
  <DesignTokens>
14
15
  <Caption>Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen)</Caption>
15
16
  </DesignTokens>
16
17
  </Story>
17
- <Story name="Bold">
18
+ <Story name="Bold" asChild>
18
19
  <DesignTokens>
19
20
  <Caption weight="bold">
20
21
  Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen)
@@ -4,11 +4,12 @@
4
4
  import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: 'Display/Card/Base'
7
+ title: 'Display/Card/Base',
8
+ component: Card
8
9
  });
9
10
  </script>
10
11
 
11
- <Story name="Basic card">
12
+ <Story name="Basic card" asChild>
12
13
  <DesignTokens>
13
14
  <Card>
14
15
  <h1>Any content</h1>
@@ -6,11 +6,12 @@
6
6
  import Middot from '../Middot/Middot.svelte';
7
7
 
8
8
  const { Story } = defineMeta({
9
- title: 'Chart/ChartFooter'
9
+ title: 'Chart/ChartFooter',
10
+ component: ChartFooter
10
11
  });
11
12
  </script>
12
13
 
13
- <Story name="One-up" tags={['autodocs']}>
14
+ <Story name="One-up" asChild>
14
15
  <DesignTokens>
15
16
  <ChartFooter layout="one-up">
16
17
  Daten: <a href="#1">Zensus 2022</a>
@@ -21,7 +22,7 @@
21
22
  </DesignTokens>
22
23
  </Story>
23
24
 
24
- <Story name="Two-up">
25
+ <Story name="Two-up" asChild>
25
26
  <DesignTokens>
26
27
  <ChartFooter layout="two-up">
27
28
  Daten: <a href="#1">Zensus 2022</a>
@@ -5,12 +5,14 @@
5
5
  import ChartHeader from './ChartHeader.svelte';
6
6
 
7
7
  const { Story } = defineMeta({
8
- title: 'Chart/ChartHeader'
8
+ title: 'Chart/ChartHeader',
9
+ component: ChartHeader
9
10
  });
10
11
  </script>
11
12
 
12
13
  <Story
13
14
  name="Default"
15
+ asChild
14
16
  play={async ({ step }) => {
15
17
  await step('Container has ID attribute derived from title prop', async () => {
16
18
  const containerEl = document.querySelector('#mehr-uber-60-jahrige-in-allen-berufen');
@@ -5,11 +5,12 @@
5
5
  import Copy from './Copy.svelte';
6
6
 
7
7
  const { Story } = defineMeta({
8
- title: 'Typography/Copy'
8
+ title: 'Typography/Copy',
9
+ component: Copy
9
10
  });
10
11
  </script>
11
12
 
12
- <Story name="Default">
13
+ <Story name="Default" asChild>
13
14
  <DesignTokens>
14
15
  <Copy>
15
16
  Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen), bedient derzeit
@@ -19,7 +20,7 @@
19
20
  </Copy>
20
21
  </DesignTokens>
21
22
  </Story>
22
- <Story name="Bold">
23
+ <Story name="Bold" asChild>
23
24
  <DesignTokens>
24
25
  <Copy weight="bold">
25
26
  Björn Schittenhelm, Apotheker aus Holzgerlingen (Kreis Böblingen), bedient derzeit
@@ -8,6 +8,6 @@ import * as FormLabelStories from './FormLabel.stories.svelte';
8
8
 
9
9
  Standard form label. The `htmlFor` prop is required to semantically link the label to the form element it describes.
10
10
 
11
- <Controls />
11
+ <Controls />
12
12
 
13
13
  <Stories/>
@@ -1,4 +1,4 @@
1
- <script context="module">
1
+ <script module>
2
2
  import { defineMeta } from '@storybook/addon-svelte-csf';
3
3
  import { userEvent, within, expect } from 'storybook/test';
4
4
 
@@ -8,11 +8,12 @@
8
8
  import Select from '../Select/Select.svelte';
9
9
 
10
10
  const { Story } = defineMeta({
11
- title: 'Form/Label'
11
+ title: 'Form/Label',
12
+ component: FormLabel
12
13
  });
13
14
  </script>
14
15
 
15
- <Story name="Default">
16
+ <Story name="Default" asChild>
16
17
  <DesignTokens>
17
18
  <FormLabel htmlFor="">Deine Gemeinde</FormLabel>
18
19
  </DesignTokens>
@@ -20,6 +21,7 @@
20
21
 
21
22
  <Story
22
23
  name="With Select"
24
+ asChild
23
25
  play={async ({ canvasElement, step }) => {
24
26
  const canvas = within(canvasElement);
25
27
  const label = canvas.getByTestId('label-container');
@@ -5,11 +5,12 @@
5
5
  import Headline from './Headline.svelte';
6
6
 
7
7
  const { Story } = defineMeta({
8
- title: 'Typography/Headline'
8
+ title: 'Typography/Headline',
9
+ component: Headline
9
10
  });
10
11
  </script>
11
12
 
12
- <Story name="Default">
13
+ <Story name="Default" asChild>
13
14
  <DesignTokens>
14
15
  <Headline>Baden-Württemberg heizt überdurchschnittlich viel mit Wärmepumpe</Headline>
15
16
  </DesignTokens>
@@ -4,11 +4,12 @@
4
4
  import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: 'Display/Card/HighlightCard'
7
+ title: 'Display/Card/HighlightCard',
8
+ component: HighlightCard
8
9
  });
9
10
  </script>
10
11
 
11
- <Story name="Basic HighlightCard">
12
+ <Story name="Basic HighlightCard" asChild>
12
13
  <DesignTokens>
13
14
  <HighlightCard
14
15
  topline="Die letzte Großspende liegt bei"
@@ -19,7 +20,7 @@
19
20
  </DesignTokens>
20
21
  </Story>
21
22
 
22
- <Story name="Multiple HighlightCards">
23
+ <Story name="Multiple HighlightCards" asChild>
23
24
  <DesignTokens>
24
25
  <div class="highlight-cards">
25
26
  <HighlightCard
@@ -4,11 +4,12 @@
4
4
  import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: 'Chart/Logotype'
7
+ title: 'Chart/Logotype',
8
+ component: Logotype
8
9
  });
9
10
  </script>
10
11
 
11
- <Story name="Basic">
12
+ <Story name="Basic" asChild>
12
13
  <DesignTokens>
13
14
  <Logotype></Logotype>
14
15
  </DesignTokens>
@@ -4,11 +4,12 @@
4
4
  import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: 'Chart/Middot'
7
+ title: 'Chart/Middot',
8
+ component: Middot
8
9
  });
9
10
  </script>
10
11
 
11
- <Story name="Basic">
12
+ <Story name="Basic" asChild>
12
13
  <DesignTokens>
13
14
  <Middot></Middot>
14
15
  </DesignTokens>
@@ -6,11 +6,12 @@
6
6
  import Note from './Note.svelte';
7
7
 
8
8
  const { Story } = defineMeta({
9
- title: 'Typography/Note'
9
+ title: 'Typography/Note',
10
+ component: Note
10
11
  });
11
12
  </script>
12
13
 
13
- <Story name="Default">
14
+ <Story name="Default" asChild>
14
15
  <DesignTokens>
15
16
  <Note>
16
17
  Daten: <a href="#1">Zensus 2022</a>
@@ -6,7 +6,8 @@
6
6
  import jobsData from './mock_data/jobs.json';
7
7
 
8
8
  const { Story } = defineMeta({
9
- title: 'Form/Select'
9
+ title: 'Form/Select',
10
+ component: Select
10
11
  });
11
12
  </script>
12
13
 
@@ -18,6 +19,7 @@
18
19
 
19
20
  <Story
20
21
  name="Simple"
22
+ asChild
21
23
  play={async ({ canvasElement, step }) => {
22
24
  const canvas = within(canvasElement);
23
25
  const select = canvas.getByLabelText('Select');
@@ -59,7 +61,7 @@
59
61
  />
60
62
  </Story>
61
63
 
62
- <Story name="Grouped">
64
+ <Story name="Grouped" asChild>
63
65
  <StoryTemplate
64
66
  bind:selectedItem
65
67
  args={{
@@ -76,6 +78,7 @@
76
78
 
77
79
  <Story
78
80
  name="Grouped (group header selectable)"
81
+ asChild
79
82
  play={async ({ canvasElement, step }) => {
80
83
  const canvas = within(canvasElement);
81
84
  const select = canvas.getByLabelText('Select');
@@ -123,6 +126,7 @@
123
126
 
124
127
  <Story
125
128
  name="Custom items"
129
+ asChild
126
130
  play={async ({ canvasElement, step }) => {
127
131
  const canvas = within(canvasElement);
128
132
  const select = canvas.getByLabelText('Berufe');
@@ -5,11 +5,12 @@
5
5
  import { userEvent, within, expect } from 'storybook/test';
6
6
 
7
7
  const { Story } = defineMeta({
8
- title: 'Form/Switcher'
8
+ title: 'Form/Switcher',
9
+ component: Switcher
9
10
  });
10
11
  </script>
11
12
 
12
- <Story name="Two Options">
13
+ <Story name="Two Options" asChild>
13
14
  <DesignTokens>
14
15
  <Switcher options={['Option A', 'Option B']} value="Option A" size="default" label="Label" />
15
16
  </DesignTokens>
@@ -17,6 +18,7 @@
17
18
 
18
19
  <Story
19
20
  name="Four Options"
21
+ asChild
20
22
  play={async ({ canvasElement, step }) => {
21
23
  const canvas = within(canvasElement);
22
24
  await step('Clicking selects the expected option', async () => {
package/src/index.js CHANGED
@@ -9,3 +9,4 @@ export { tokens as tokens } from './DesignTokens/index.js';
9
9
  export { default as ChartHeader } from './ChartHeader/ChartHeader.svelte';
10
10
  export { default as ChartFooter } from './ChartFooter/ChartFooter.svelte';
11
11
  export { default as Middot } from './Middot/Middot.svelte';
12
+ export { default as FormLabel } from './FormLabel/FormLabel.svelte';