@netlify/spark-ui 1.20.1 → 1.22.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.20.1",
4
+ "version": "1.22.0",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -36,6 +36,7 @@
36
36
  "./analytics": "./packages/analytics/index.ts"
37
37
  },
38
38
  "dependencies": {
39
+ "@astro-community/astro-embed-youtube": "^0.5.10",
39
40
  "@kapaai/react-sdk": "^0.9.0",
40
41
  "@preact/preset-vite": "^2.10.1",
41
42
  "@shikijs/transformers": "^3.3.0",
@@ -137,7 +137,7 @@ const isExternal =
137
137
  }
138
138
 
139
139
  .n-card-link {
140
- --ntl-flow-space: var(--ntl-space-l);
140
+ --ntl-flow-space: var(--ntl-space-m);
141
141
  align-self: flex-start;
142
142
  }
143
143
 
@@ -21,7 +21,7 @@ const {
21
21
  id,
22
22
  eyebrow,
23
23
  heading,
24
- headingLevel = 2,
24
+ headingLevel = '2',
25
25
  headingMaxWidth,
26
26
  text,
27
27
  textMaxWidth,
@@ -0,0 +1,71 @@
1
+ ---
2
+ import { YouTube } from '@astro-community/astro-embed-youtube';
3
+
4
+ interface Props {
5
+ id: string;
6
+ title?: string;
7
+ poster?: string;
8
+ params?: string;
9
+ class?: string;
10
+ }
11
+
12
+ const { id, title, poster, params, class: className, ...rest } = Astro.props;
13
+ ---
14
+
15
+ <div class:list={['n-youtube-video', className]} {...rest}>
16
+ <YouTube {id} {title} {poster} {params} />
17
+ </div>
18
+
19
+ <style>
20
+ .n-youtube-video {
21
+ position: relative;
22
+ border-radius: var(--ntl-radius-xl);
23
+ overflow: hidden;
24
+ width: 100%;
25
+ aspect-ratio: 16 / 9;
26
+ }
27
+
28
+ .n-youtube-video :global(lite-youtube) {
29
+ max-width: 100%;
30
+ }
31
+
32
+ /* Suppress the default YouTube SVG icon */
33
+ .n-youtube-video :global(.lyt-playbtn) {
34
+ background-image: none;
35
+ }
36
+
37
+ /* Circle background */
38
+ .n-youtube-video :global(.lyt-playbtn)::after {
39
+ content: '';
40
+ position: absolute;
41
+ top: 50%;
42
+ left: 50%;
43
+ transform: translate(-50%, -50%);
44
+ z-index: 1;
45
+ width: 4rem;
46
+ height: 4rem;
47
+ border-radius: 50%;
48
+ background-color: var(--n-youtube-video-btn-bg, var(--ntl-neutral-800));
49
+ opacity: 0.5;
50
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
51
+ pointer-events: none;
52
+ }
53
+
54
+ /* Play icon — mask-image lets background-color be CSS-variable-driven */
55
+ .n-youtube-video :global(.lyt-playbtn)::before {
56
+ content: '';
57
+ position: absolute;
58
+ top: 50%;
59
+ left: 50%;
60
+ transform: translate(-50%, calc(-50% + 1px));
61
+ z-index: 2;
62
+ width: 2rem;
63
+ height: 2rem;
64
+ background-color: var(--n-youtube-video-icon-color, var(--ntl-neutral-000));
65
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M187.2 100.9C174.8 94.1 159.8 94.4 147.6 101.6C135.4 108.8 128 121.9 128 136L128 504C128 518.1 135.5 531.2 147.6 538.4C159.7 545.6 174.8 545.9 187.2 539.1L523.2 355.1C536 348.1 544 334.6 544 320C544 305.4 536 291.9 523.2 284.9L187.2 100.9z'/%3E%3C/svg%3E");
66
+ mask-repeat: no-repeat;
67
+ mask-position: center;
68
+ mask-size: contain;
69
+ pointer-events: none;
70
+ }
71
+ </style>
@@ -2,6 +2,17 @@
2
2
 
3
3
  Build a marketing landing page using Netlify Spark UI. Follow these guidelines strictly.
4
4
 
5
+ ## Template Reference
6
+
7
+ Before building, read the template pages under `docs/src/content/docs/templates/`. They contain complete, working examples of full landing pages and individual sections with recommended layouts and usage patterns:
8
+
9
+ - `docs/src/content/docs/templates/page.mdx` — Full landing page example showing a recommended section order and composition
10
+ - `docs/src/content/docs/templates/cards.mdx` — Cards section layout and usage patterns
11
+ - `docs/src/content/docs/templates/switchback.mdx` — Switchback section layout and usage patterns
12
+ - `docs/src/content/docs/templates/tabbed-content.mdx` — Tabbed content section layout and usage patterns
13
+
14
+ Treat these templates as the authoritative reference for structure and layout decisions. Where template examples differ from or extend the guidelines below, prefer the template.
15
+
5
16
  ## Page Structure
6
17
 
7
18
  Wrap every section in `<PageSection>` (props: `spaceTop`, `spaceBottom`, `theme`). Use this order (include only what fits the request):