@swr-data-lab/components 2.31.3 → 2.32.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.
@@ -46,6 +46,7 @@ const rules = [
46
46
  --color-logoFill: var(--logoFill-light);
47
47
  --color-pageFill: var(--pageFill-light);
48
48
  --color-surfaceFill: var(--surfaceFill-light);
49
+ --color-surfaceHover: var(--surfaceHover-light);
49
50
  --color-surfaceBorder: var(--surfaceBorder-light);
50
51
  --color-dropShadow: var(--dropShadow-light);
51
52
  }
@@ -54,6 +55,7 @@ const rules = [
54
55
  --color-pageFill: var(--pageFill-dark);
55
56
  --color-surfaceFill: var(--surfaceFill-dark);
56
57
  --color-surfaceBorder: var(--surfaceBorder-dark);
58
+ --color-surfaceHover: var(--surfaceHover-dark);
57
59
  --color-textPrimary: var(--textPrimary-dark);
58
60
  --color-textSecondary: var(--textSecondary-dark);
59
61
  --color-textSecondaryHover: var(--textSecondaryHover-dark);
@@ -164,6 +164,10 @@ const semantics = {
164
164
  dark: '#222325',
165
165
  light: '#ffffff'
166
166
  },
167
+ surfaceHover: {
168
+ dark: '#0d0d0e',
169
+ light: '#ebebeb'
170
+ },
167
171
  raisedSurfaceFill: {
168
172
  dark: '#393a3b',
169
173
  light: '#ffffff'
@@ -1,15 +1,19 @@
1
1
  <script lang="ts">import SwrLogo from './SwrLogo.svg.svelte';
2
2
  import GridInspector from './GridInspector.svelte';
3
- import Copy from '../Copy/Copy.svelte';
4
3
  import DesignTokens from '../DesignTokens/DesignTokens.svelte';
5
- import { text } from '@sveltejs/kit';
6
- let { showHeader = true, showNav = true, showArticleHeader = true, showPlayer = true, eyebrow = 'Wärmewende in Ihrer Gemeinde', title = 'Baden-Württemberg heizt noch größtenteils fossil', intro = 'Fast drei Viertel der privaten Heizungen in Baden-Württemberg liefen 2022 noch mit Öl und Gas. In Neubauten werden inzwischen überwiegend Wärmepumpen eingebaut, doch es gibt regionale Unterschiede.', showBreadcrumbs = true, showGrid = false, paragraphsAbove = 0, paragraphsBelow = 0, children } = $props();
4
+ import Copy from '../Copy/Copy.svelte';
5
+ let { theme = 'light', showHeader = true, showNav = true, showArticleHeader = true, showPlayer = true, eyebrow = 'Wärmewende in Ihrer Gemeinde', title = 'Baden-Württemberg heizt noch größtenteils fossil', intro = 'Fast drei Viertel der privaten Heizungen in Baden-Württemberg liefen 2022 noch mit Öl und Gas. In Neubauten werden inzwischen überwiegend Wärmepumpen eingebaut, doch es gibt regionale Unterschiede.', showBreadcrumbs = true, showGrid = false, paragraphsAbove = 0, paragraphsBelow = 0, children } = $props();
7
6
  const date = new Date();
8
7
  let articleEl = $state();
9
8
  </script>
10
9
 
11
- <DesignTokens>
12
- <div class="container">
10
+ <DesignTokens {theme}>
11
+ <div
12
+ class="container"
13
+ style={theme === 'light'
14
+ ? '--blue: hsl(221, 75%, 46%); --blue-light: hsl(221, 100%, 95%)'
15
+ : '--blue: hsl(220, 22%, 51%); --blue-light: hsl(219, 22%, 18%)'}
16
+ >
13
17
  {#if showHeader}
14
18
  <header>
15
19
  <div class="header-inner">
@@ -114,9 +118,8 @@ let articleEl = $state();
114
118
  }
115
119
 
116
120
  .container {
117
- --blue: hsl(221, 75%, 46%);
118
- --blue-light: hsl(221, 100%, 95%);
119
121
  color: var(--blue);
122
+ background: var(--color-pageFill);
120
123
  font-family: "SWR-VAR-Sans", sans-serif;
121
124
  }
122
125
 
@@ -1,5 +1,6 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  interface DevContainerProps {
3
+ theme: 'light' | 'dark' | 'auto';
3
4
  showHeader?: boolean;
4
5
  showNav?: boolean;
5
6
  showPlayer?: boolean;
@@ -50,9 +50,6 @@ ul {
50
50
  flex-flow: row;
51
51
  }
52
52
  }
53
- ul:focus-within, ul:active {
54
- outline: 2px solid var(--blue-light-2);
55
- }
56
53
 
57
54
  li {
58
55
  display: contents;
@@ -69,7 +66,7 @@ input {
69
66
 
70
67
  .small label {
71
68
  font-size: var(--fs-small-1);
72
- height: 2.25em;
69
+ height: 2em;
73
70
  padding: 0 0.65em;
74
71
  }
75
72
 
@@ -85,7 +82,8 @@ label {
85
82
  color: currentColor;
86
83
  position: relative;
87
84
  transition: var(--fast);
88
- text-underline-offset: 0.2em;
85
+ text-underline-offset: 0.1em;
86
+ border-right: 1px solid var(--color-textSecondary);
89
87
  height: 2.25em;
90
88
  }
91
89
  @media (min-width: 425px) {
@@ -104,8 +102,9 @@ label {
104
102
  }
105
103
  label:hover, label:focus-visible {
106
104
  text-decoration: underline;
105
+ text-decoration-color: var(--color-textSecondary);
107
106
  }
108
107
  .is-selected label {
109
- background: var(--color-textSecondary);
108
+ background: var(--color-surfaceHover);
110
109
  font-weight: 700;
111
110
  }</style>
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": "2.31.3",
4
+ "version": "2.32.0",
5
5
  "author": "SWR Data Lab",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",