@netlify/spark-ui 1.5.0 → 1.6.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/spark-ui",
3
3
  "description": "Assets, design tokens, components, and utilities",
4
- "version": "1.5.0",
4
+ "version": "1.6.0",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -0,0 +1,129 @@
1
+ ---
2
+ import { CallToActionProps } from '@utils/types';
3
+ import Eyebrow from './Eyebrow.astro';
4
+ import ActionLink from './ActionLink.astro';
5
+
6
+ interface Props {
7
+ id?: string;
8
+ class?: string;
9
+ isReversed?: boolean;
10
+ eyebrow?: string;
11
+ heading?: string;
12
+ text?: string;
13
+ list?: string[];
14
+ cta?: CallToActionProps;
15
+ mediaPattern?: 1 | 2;
16
+ }
17
+
18
+ const {
19
+ eyebrow,
20
+ heading,
21
+ text,
22
+ list,
23
+ cta,
24
+ isReversed,
25
+ mediaPattern = 1,
26
+ id,
27
+ class: className,
28
+ ...rest
29
+ } = Astro.props;
30
+ ---
31
+
32
+ <div
33
+ id={id}
34
+ class:list={['n-switchback n-sidebar-left', isReversed && 'n-switchback-reversed', className]}
35
+ data-theme="dark"
36
+ {...rest}
37
+ >
38
+ <div class="n-switchback-content n-flow">
39
+ {eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
40
+ {heading && <h3 class="n-switchback-heading h5">{heading}</h3>}
41
+ {text && <p class="text" set:html={text} />}
42
+ {
43
+ list && list.length > 0 && (
44
+ <ul data-list-variant="contained">
45
+ {list.map((item: string) => (
46
+ <li>{item}</li>
47
+ ))}
48
+ </ul>
49
+ )
50
+ }
51
+ {
52
+ cta && (
53
+ <div class="n-switchback-cta">
54
+ <ActionLink id={cta.id} href={cta.href}>
55
+ {cta.text}
56
+ </ActionLink>
57
+ </div>
58
+ )
59
+ }
60
+ </div>
61
+ {
62
+ Astro.slots.has('media') && (
63
+ <div class="n-switchback-media" data-switchback-media-pattern={mediaPattern}>
64
+ <slot name="media" />
65
+ </div>
66
+ )
67
+ }
68
+ </div>
69
+
70
+ <style>
71
+ .n-switchback {
72
+ --n-sidebar-size: 25rem;
73
+ --n-sidebar-min: 50%;
74
+ --n-sidebar-gap: 0;
75
+ overflow: hidden;
76
+ color: var(--color-text);
77
+ background: linear-gradient(
78
+ var(--n-switchback-gradient-angle, 101deg),
79
+ #0d1818 8.17%,
80
+ #0c2a2a 56.72%
81
+ );
82
+ border: 1px solid rgba(208, 255, 254, 0.2);
83
+ border-radius: var(--radius-m);
84
+ }
85
+
86
+ .n-switchback-reversed {
87
+ --n-switchback-gradient-angle: 248deg;
88
+ flex-direction: row-reverse;
89
+ }
90
+
91
+ .n-switchback-content {
92
+ padding: var(--space-l);
93
+ }
94
+
95
+ .n-switchback-heading {
96
+ color: var(--heading-text-color);
97
+ }
98
+
99
+ .n-switchback-media {
100
+ display: grid;
101
+ place-items: center;
102
+ padding: var(--space-xl);
103
+ background: var(--red-400);
104
+ min-height: 10rem;
105
+
106
+ :is(img, picture) {
107
+ max-width: 100%;
108
+ height: auto;
109
+ object-fit: cover;
110
+ }
111
+ }
112
+
113
+ /** Patterns */
114
+ [data-switchback-media-pattern='1'] {
115
+ background:
116
+ url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzY5IiBoZWlnaHQ9IjQ5MCIgdmlld0JveD0iMCAwIDc2OSA0OTAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjM4NC4zMjQiIHk9IjEwLjc1NDciIHdpZHRoPSIzMzEuMTY0IiBoZWlnaHQ9IjMzMS4xNjQiIHRyYW5zZm9ybT0icm90YXRlKDQ1IDM4NC4zMjQgMTAuNzU0NykiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3QgeD0iNjIxLjMyNCIgeT0iNy45MjI4NSIgd2lkdGg9IjQ3NCIgaGVpZ2h0PSI0NzQiIHRyYW5zZm9ybT0icm90YXRlKDkwIDYyMS4zMjQgNy45MjI4NSkiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3QgeD0iODU5LjEwMSIgeT0iMjQ0LjkyMyIgd2lkdGg9IjY3MS40MzYiIGhlaWdodD0iNjcxLjQzNiIgdHJhbnNmb3JtPSJyb3RhdGUoMTM1IDg1OS4xMDEgMjQ0LjkyMykiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3QgeD0iNTAxLjUwNCIgeT0iMTI3Ljc0MyIgd2lkdGg9IjIzNC4zNTkiIGhlaWdodD0iMjM0LjM1OSIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgNTAxLjUwNCAxMjcuNzQzKSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8cmVjdCB4PSI1MDEuMjk3IiB5PSIyNDQuOTIzIiB3aWR0aD0iMTY1LjQyMyIgaGVpZ2h0PSIxNjUuNDIzIiB0cmFuc2Zvcm09InJvdGF0ZSgxMzUgNTAxLjI5NyAyNDQuOTIzKSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8cmVjdCB4PSI0NDMuNTA0IiB5PSIzMDQuMTAzIiB3aWR0aD0iMTE4LjM2MSIgaGVpZ2h0PSIxMTguMzYxIiB0cmFuc2Zvcm09InJvdGF0ZSgtMTgwIDQ0My41MDQgMzA0LjEwMykiIHN0cm9rZT0id2hpdGUiLz4KPC9zdmc+Cg=='),
117
+ radial-gradient(circle at 50% 70%, var(--red-500) 0%, var(--purple-300) 100%);
118
+ background-size: cover;
119
+ background-position: center;
120
+ }
121
+
122
+ [data-switchback-media-pattern='2'] {
123
+ background:
124
+ repeating-linear-gradient(-30deg, var(--red-000) 0 1px, transparent 1px 150px),
125
+ radial-gradient(circle at 10% 70%, var(--blue-500) 0%, var(--teal-200) 100%);
126
+ background-size: cover;
127
+ background-position: center;
128
+ }
129
+ </style>
@@ -114,7 +114,14 @@ h3,
114
114
  h4,
115
115
  .h4 {
116
116
  font-size: var(--font-size-display-sm);
117
- font-weight: var(--font-weight-semibold);
117
+ font-weight: var(--font-weight-bold);
118
+ line-height: var(--line-height-heading);
119
+ }
120
+
121
+ h5,
122
+ .h5 {
123
+ font-size: var(--font-size-display-xs);
124
+ font-weight: var(--font-weight-bold);
118
125
  line-height: var(--line-height-heading);
119
126
  }
120
127
 
@@ -153,6 +160,23 @@ ol li::marker {
153
160
  }
154
161
  }
155
162
 
163
+ [data-list-variant='contained'] {
164
+ list-style: none;
165
+ padding: 0;
166
+ width: 100%;
167
+
168
+ li {
169
+ padding: var(--space-s);
170
+ border-radius: var(--radius-s);
171
+ border: 1px solid rgba(255, 255, 255, 0.2);
172
+ background: rgba(233, 235, 237, 0.1);
173
+ }
174
+
175
+ li + li {
176
+ margin-block-start: var(--space-s);
177
+ }
178
+ }
179
+
156
180
  /* Code */
157
181
  pre,
158
182
  code,
@@ -38,8 +38,8 @@
38
38
  }
39
39
  }
40
40
 
41
- .n-sidebar-first,
42
- .n-sidebar-last {
41
+ .n-sidebar-left,
42
+ .n-sidebar-right {
43
43
  display: flex;
44
44
  flex-wrap: wrap;
45
45
  flex-direction: var(--n-sidebar-direction, initial);
@@ -49,14 +49,14 @@
49
49
  var(--n-sidebar-column-gap, var(--n-sidebar-gap, var(--space-m)));
50
50
  }
51
51
 
52
- .n-sidebar-first > :first-child,
53
- .n-sidebar-last > :last-child {
52
+ .n-sidebar-left > :first-child,
53
+ .n-sidebar-right > :last-child {
54
54
  flex-basis: var(--n-sidebar-size, initial);
55
55
  flex-grow: 1;
56
56
  }
57
57
 
58
- .n-sidebar-first > :last-child,
59
- .n-sidebar-last > :first-child {
58
+ .n-sidebar-left > :last-child,
59
+ .n-sidebar-right > :first-child {
60
60
  flex-basis: 0;
61
61
  flex-grow: 999;
62
62
  min-inline-size: var(--n-sidebar-min, 60%);