@swr-data-lab/components 1.2.0 → 1.3.0

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.
@@ -0,0 +1,13 @@
1
+ <style>
2
+ /* Load SWR.de fonts for preview: */
3
+ @font-face {
4
+ font-family: 'SWR-VAR-Text';
5
+ src: url('https://www.swr.de/assets/fonts/swr_type/SWR_VAR_WEB/SWR-VAR-Text.woff2')
6
+ format('woff2');
7
+ }
8
+ @font-face {
9
+ font-family: 'SWR-VAR-Sans';
10
+ src: url('https://www.swr.de/assets/fonts/swr_type/SWR_VAR_WEB/SWR-VAR-Sans.woff2')
11
+ format('woff2');
12
+ }
13
+ </style>
package/package.json CHANGED
@@ -61,5 +61,5 @@
61
61
  "svelte": "./src/index.js"
62
62
  }
63
63
  },
64
- "version": "1.2.0"
64
+ "version": "1.3.0"
65
65
  }
@@ -169,7 +169,7 @@ Data should be provided as array of objects. Each object contains the informatio
169
169
  position: absolute;
170
170
  top: 100%;
171
171
  border: 1px solid currentColor;
172
- background: $reanimation-violetblue;
172
+ background: $color-violetblue;
173
173
  border-bottom-left-radius: $border-radius-input;
174
174
  border-bottom-right-radius: $border-radius-input;
175
175
  border-top: 0;
@@ -218,7 +218,7 @@ Data should be provided as array of objects. Each object contains the informatio
218
218
  }
219
219
  &:hover,
220
220
  &:focus {
221
- color: $orange;
221
+ color: $color-activeorange;
222
222
  cursor: pointer;
223
223
  }
224
224
  }
@@ -15,7 +15,7 @@
15
15
  @import '../styles/base.scss';
16
16
  .button {
17
17
  @extend %copy-bold;
18
- background: $reanimation-violet;
18
+ background: $color-violet;
19
19
  display: inline-flex;
20
20
  align-items: center;
21
21
  justify-self: flex-start;
@@ -0,0 +1,31 @@
1
+ <script context="module">
2
+ import Card from './Card.svelte';
3
+
4
+ export const meta = {
5
+ title: 'Input Components/Card',
6
+ component: Card
7
+ };
8
+ </script>
9
+
10
+ <script>
11
+ import { Story, Template } from '@storybook/addon-svelte-csf';
12
+ import {
13
+ userEvent,
14
+ within,
15
+ expect,
16
+ getByTestId,
17
+ getAllByLabelText,
18
+ getByText
19
+ } from '@storybook/test';
20
+ import { hasContext } from 'svelte';
21
+ import Input from '../Input/Input.svelte';
22
+
23
+ let component;
24
+ </script>
25
+
26
+ <Story name="Basic card">
27
+ <Card>
28
+ <h1>Any content</h1>
29
+ <p>can be added to a basic <code>Card</code> component.</p>
30
+ </Card>
31
+ </Story>
@@ -5,10 +5,11 @@
5
5
  <style lang="scss">
6
6
  @import '../styles/base.scss';
7
7
  .card {
8
+ @extend %copy;
8
9
  width: auto;
9
10
  max-width: $app-max-width;
10
11
  color: white;
11
- background: $reanimation-violetblue;
12
+ background: $color-violetblue;
12
13
  border-radius: $border-radius-container;
13
14
  margin: 0 1rem;
14
15
  padding: 1.5rem;
@@ -7,6 +7,6 @@
7
7
  :host {
8
8
  --swr-sans: #{$swr-sans};
9
9
  --swr-text: #{$swr-text};
10
- --orange: #{$orange};
10
+ --orange: #{$color-activeorange};
11
11
  }
12
12
  </style>
@@ -0,0 +1,60 @@
1
+ <script context="module">
2
+ import HighlightCard from './HighlightCard.svelte';
3
+
4
+ export const meta = {
5
+ title: 'Input Components/HighlightCard',
6
+ component: HighlightCard
7
+ };
8
+ </script>
9
+
10
+ <script>
11
+ import { Story, Template } from '@storybook/addon-svelte-csf';
12
+ import {
13
+ userEvent,
14
+ within,
15
+ expect,
16
+ getByTestId,
17
+ getAllByLabelText,
18
+ getByText
19
+ } from '@storybook/test';
20
+ import { hasContext } from 'svelte';
21
+
22
+ let component;
23
+ </script>
24
+
25
+ <Story name="Basic HighlightCard">
26
+ <HighlightCard
27
+ topline="Die letzte Großspende liegt bei"
28
+ highlight="375.000"
29
+ highlightSecondary="Euro"
30
+ subline="Der Betrag ging am 7. Januar von Dr. Kim Musterperson ein."
31
+ />
32
+ </Story>
33
+
34
+ <Story name="Basic HighlightCard">
35
+ <div class="columns">
36
+ <HighlightCard
37
+ topline="Im aktuellen Jahr wurden bisher"
38
+ highlight="375.000"
39
+ highlightSecondary="€"
40
+ subline="an Parteien gespendet."
41
+ />
42
+ <HighlightCard
43
+ topline="Die letzte Großspende liegt bei"
44
+ highlight="37.500"
45
+ highlightSecondary="€"
46
+ subline="Der Betrag ging am 7. Januar von Dr. Kim Musterperson ein."
47
+ />
48
+ </div>
49
+ </Story>
50
+
51
+ <style>
52
+ .columns {
53
+ display: flex;
54
+ margin-top: 2rem;
55
+ }
56
+
57
+ :global(.columns > *) {
58
+ flex: 1;
59
+ }
60
+ </style>
@@ -0,0 +1,64 @@
1
+ <script>
2
+ import Card from '../Card/Card.svelte';
3
+
4
+ export let topline = '';
5
+ export let highlight = '';
6
+ export let highlightSecondary = '';
7
+ export let subline = '';
8
+ export let alignCards = true;
9
+ export let maxWidth = '500px';
10
+ </script>
11
+
12
+ <Card>
13
+ <div class="card-wrapper">
14
+ {#if topline}
15
+ <div class="top">
16
+ {@html topline}
17
+ </div>
18
+ {/if}
19
+ <div class="middle">
20
+ <span class="underline">
21
+ {highlight}
22
+ </span>
23
+ {highlightSecondary}
24
+ </div>
25
+ <div class="bottom">
26
+ {@html subline}
27
+ </div>
28
+ </div>
29
+ </Card>
30
+
31
+ <style lang="scss">
32
+ @import '../styles/base.scss';
33
+
34
+ .card-wrapper {
35
+ display: flex;
36
+ flex-direction: column;
37
+ height: 100%;
38
+ min-height: 200px;
39
+ }
40
+
41
+ .top {
42
+ display: flex;
43
+ align-items: flex-end;
44
+ flex: 1;
45
+ }
46
+
47
+ .middle {
48
+ font-family: $swr-sans;
49
+ font-size: 60px;
50
+ font-weight: 700;
51
+ padding-bottom: 0.2em;
52
+ }
53
+
54
+ .bottom {
55
+ display: flex;
56
+ align-items: flex-start;
57
+ flex: 1;
58
+ }
59
+
60
+ .underline {
61
+ width: fit-content;
62
+ background: linear-gradient(to bottom, transparent 90%, $color-activeorange 90%);
63
+ }
64
+ </style>
@@ -0,0 +1,2 @@
1
+ import HighlightCard from './HighlightCard.svelte';
2
+ export default HighlightCard;
@@ -1,11 +1,10 @@
1
- $reanimation-black: #0c0c0c;
2
- $reanimation-violetblue: #1d0b40;
3
- $reanimation-violetblue-hover: #2d155d;
4
- $reanimation-violet: #5920c0;
5
- $reanimation-blue: #3053d9;
6
- $reanimation-warmgrey: #dbd5cd;
7
- $reanimation-activeorange: #ff3300;
8
- $orange: #ff3300;
1
+ $color-black: #0c0c0c;
2
+ $color-violetblue: #1d0b40;
3
+ $color-violetblue-hover: #2d155d;
4
+ $color-violet: #5920c0;
5
+ $color-blue: #3053d9;
6
+ $color-warmgrey: #dbd5cd;
7
+ $color-activeorange: #ff3300;
9
8
 
10
9
  $border-radius-container: 8px;
11
10
  $border-radius-input: 4px;