@spatial-elements/sveltekit 0.1.0-beta.2 → 1.0.0-beta.11
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/README.md +18 -13
- package/dist/catalog/ScrollNavigationBridge.svelte +172 -47
- package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +9 -2
- package/dist/catalog/catalogNavigation.js +3 -2
- package/dist/catalog/catalogSummaryTransfer.d.ts +16 -0
- package/dist/catalog/catalogSummaryTransfer.js +79 -0
- package/dist/catalog/catalogTransition.css +58 -3
- package/dist/catalog/interruptedPresentation.d.ts +10 -0
- package/dist/catalog/interruptedPresentation.js +29 -0
- package/dist/catalog/presentationCleanup.d.ts +4 -0
- package/dist/catalog/presentationCleanup.js +20 -0
- package/dist/catalog/stagedCatalogNavigation.d.ts +44 -0
- package/dist/catalog/stagedCatalogNavigation.js +403 -0
- package/dist/catalog/stagedDomReveal.d.ts +8 -0
- package/dist/catalog/stagedDomReveal.js +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/spatial-element/BrandStageShell.svelte +52 -71
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +31 -4
- package/dist/spatial-element/CarouselSpatialElement.svelte +152 -200
- package/dist/spatial-element/CarouselSpatialElement.svelte.d.ts +5 -1
- package/dist/spatial-element/ContentBlock.svelte +7 -0
- package/dist/spatial-element/ContentBlock.svelte.d.ts +9 -0
- package/dist/spatial-element/ContentGrid.svelte +7 -0
- package/dist/spatial-element/ContentGrid.svelte.d.ts +8 -0
- package/dist/spatial-element/ContentPage.svelte +51 -55
- package/dist/spatial-element/ContentPage.svelte.d.ts +14 -3
- package/dist/spatial-element/InteractionGesture.svelte +39 -0
- package/dist/spatial-element/InteractionGesture.svelte.d.ts +7 -0
- package/dist/spatial-element/OverflowControls.svelte +129 -0
- package/dist/spatial-element/OverflowControls.svelte.d.ts +9 -0
- package/dist/spatial-element/PointerHint.svelte +80 -0
- package/dist/spatial-element/PointerHint.svelte.d.ts +3 -0
- package/dist/spatial-element/Section.svelte +25 -106
- package/dist/spatial-element/Section.svelte.d.ts +1 -0
- package/dist/spatial-element/SectionSurfaceGroup.svelte +8 -0
- package/dist/spatial-element/SectionSurfaceGroup.svelte.d.ts +8 -0
- package/dist/spatial-element/SpaceMouseControl.svelte +159 -0
- package/dist/spatial-element/SpaceMouseControl.svelte.d.ts +7 -0
- package/dist/spatial-element/SpaceMouseIcon.svelte +12 -0
- package/dist/spatial-element/SpaceMouseIcon.svelte.d.ts +26 -0
- package/dist/spatial-element/SpatialCardGridSection.svelte +79 -0
- package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
- package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
- package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
- package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
- package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialCarouselSection.svelte +754 -0
- package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
- package/dist/spatial-element/SpatialElementCard.svelte +54 -238
- package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialElementHelp.svelte +300 -0
- package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
- package/dist/spatial-element/SpatialElementMediaRail.svelte +322 -52
- package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
- package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
- package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialElementPage.svelte +156 -71
- package/dist/spatial-element/SpatialElementPage.svelte.d.ts +10 -3
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +89 -105
- package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +6 -1
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +198 -0
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +23 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
- package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
- package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
- package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
- package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
- package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialIconButton.svelte +66 -0
- package/dist/spatial-element/SpatialIconButton.svelte.d.ts +17 -0
- package/dist/spatial-element/SpatialListPage.svelte +37 -8
- package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
- package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
- package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte +138 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
- package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
- package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialSummaryRoot.svelte +80 -0
- package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
- package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
- package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
- package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
- package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
- package/dist/spatial-element/brandContext.d.ts +1 -1
- package/dist/spatial-element/brandContext.js +1 -1
- package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
- package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
- package/dist/spatial-element/carouselTextHit.d.ts +2 -0
- package/dist/spatial-element/carouselTextHit.js +17 -0
- package/dist/spatial-element/contentSidebars.d.ts +3 -0
- package/dist/spatial-element/contentSidebars.js +56 -0
- package/dist/spatial-element/index.d.ts +19 -3
- package/dist/spatial-element/index.js +12 -2
- package/dist/spatial-element/layout.generated.css +363 -0
- package/dist/spatial-element/messagesContext.d.ts +3 -0
- package/dist/spatial-element/messagesContext.js +10 -0
- package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
- package/dist/spatial-element/presentationBoxFreeze.js +35 -0
- package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
- package/dist/spatial-element/spatialCardGrid.js +1 -0
- package/dist/spatial-element/spatialPageContext.d.ts +4 -0
- package/dist/spatial-element/spatialPageContext.js +9 -0
- package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
- package/dist/spatial-element/spatialPresentationOwner.js +2 -0
- package/dist/spatial-element/spatialSummary.d.ts +43 -0
- package/dist/spatial-element/spatialSummary.js +1 -0
- package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
- package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
- package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
- package/dist/spatial-element/spatialThemeStyle.js +69 -0
- package/dist/spatial-element/truncatedTitle.d.ts +5 -0
- package/dist/spatial-element/truncatedTitle.js +28 -0
- package/dist/stage/ButtonGroup.svelte +152 -0
- package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
- package/dist/stage/Panel.svelte +72 -14
- package/dist/stage/Panel.svelte.d.ts +14 -2
- package/dist/stage/Stage.svelte +471 -51
- package/dist/stage/Stage.svelte.d.ts +8 -1
- package/dist/stage/StageViewport.svelte +15 -2
- package/dist/stage/authoredStyle.d.ts +4 -0
- package/dist/stage/authoredStyle.js +17 -0
- package/dist/stage/buttonGroup.d.ts +9 -0
- package/dist/stage/buttonGroup.js +1 -0
- package/logo.svg +225 -0
- package/package.json +9 -6
- package/dist/spatial-element/CarouselSection.svelte +0 -350
- package/dist/spatial-element/ListSection.svelte +0 -30
- package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
2
4
|
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
+
import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
|
|
6
|
+
import './layout.generated.css';
|
|
5
7
|
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
6
8
|
const catalogEndpoint = createCatalogEndpointAction();
|
|
7
|
-
import type {
|
|
9
|
+
import type { SpatialElementSectionNavigationItem } from '@spatial-elements/core/spatial-element/types';
|
|
8
10
|
|
|
9
11
|
let {
|
|
10
|
-
|
|
11
|
-
spatialElement,
|
|
12
|
-
sections
|
|
12
|
+
spatialElement, headerDetails, actionIcon
|
|
13
13
|
}: {
|
|
14
14
|
activeSectionId?: string;
|
|
15
|
+
headerDetails?: Snippet;
|
|
16
|
+
actionIcon?: Snippet;
|
|
15
17
|
spatialElement: SpatialElementData;
|
|
16
18
|
sections: SpatialElementSectionNavigationItem[];
|
|
17
19
|
} = $props();
|
|
@@ -52,7 +54,9 @@
|
|
|
52
54
|
></a>
|
|
53
55
|
|
|
54
56
|
<div class="sticky-header-layout">
|
|
57
|
+
<div class="sticky-header-content" class:has-details={!!headerDetails}>
|
|
55
58
|
<div class="sticky-header-copy">
|
|
59
|
+
{#if spatialElement.eyebrow}
|
|
56
60
|
<p
|
|
57
61
|
class="sticky-header-kicker"
|
|
58
62
|
use:catalogEndpoint={{
|
|
@@ -64,6 +68,7 @@
|
|
|
64
68
|
>
|
|
65
69
|
{spatialElement.eyebrow}
|
|
66
70
|
</p>
|
|
71
|
+
{/if}
|
|
67
72
|
<p
|
|
68
73
|
class="sticky-header-title"
|
|
69
74
|
use:catalogEndpoint={{
|
|
@@ -77,39 +82,45 @@
|
|
|
77
82
|
</p>
|
|
78
83
|
</div>
|
|
79
84
|
|
|
80
|
-
{#if
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
85
|
+
{#if headerDetails}<div class="sticky-header-details">{@render headerDetails()}</div>{/if}
|
|
86
|
+
</div>
|
|
87
|
+
{#if spatialElement.action}
|
|
88
|
+
{#if spatialElement.action.href}
|
|
89
|
+
<a
|
|
90
|
+
class="sticky-header-action"
|
|
91
|
+
data-spatial-element-dock-action
|
|
92
|
+
use:catalogEndpoint={{
|
|
93
|
+
brandId: spatialElement.brandId,
|
|
94
|
+
spatialElementId: spatialElement.id,
|
|
95
|
+
slot: 'detail.dock',
|
|
96
|
+
role: 'primary-action'
|
|
97
|
+
}}
|
|
98
|
+
data-catalog-rich-shared="primary-action"
|
|
99
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
100
|
+
href={spatialElement.action.href}
|
|
101
|
+
rel="external"
|
|
102
|
+
aria-label={spatialElement.action.ariaLabel ?? spatialElement.action.label}
|
|
103
|
+
>
|
|
104
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart size={29} strokeWidth={2} aria-hidden="true" />{/if}
|
|
105
|
+
</a>
|
|
106
|
+
{:else}
|
|
107
|
+
<button
|
|
108
|
+
use:catalogEndpoint={{
|
|
109
|
+
brandId: spatialElement.brandId,
|
|
110
|
+
spatialElementId: spatialElement.id,
|
|
111
|
+
slot: 'detail.dock',
|
|
112
|
+
role: 'primary-action'
|
|
113
|
+
}}
|
|
114
|
+
data-catalog-rich-shared="primary-action"
|
|
115
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
116
|
+
class="sticky-header-action"
|
|
117
|
+
data-spatial-element-dock-action
|
|
118
|
+
type="button"
|
|
119
|
+
aria-label={spatialElement.action.ariaLabel ?? spatialElement.action.label}
|
|
120
|
+
>
|
|
121
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart size={29} strokeWidth={2} aria-hidden="true" />{/if}
|
|
122
|
+
</button>
|
|
123
|
+
{/if}
|
|
113
124
|
{/if}
|
|
114
125
|
</div>
|
|
115
126
|
|
|
@@ -120,7 +131,7 @@
|
|
|
120
131
|
aria-hidden="true"
|
|
121
132
|
inert
|
|
122
133
|
>
|
|
123
|
-
|
|
134
|
+
<!-- The controller moves the existing live tab list here when it docks. -->
|
|
124
135
|
</div>
|
|
125
136
|
</header>
|
|
126
137
|
|
|
@@ -131,20 +142,15 @@
|
|
|
131
142
|
border-radius: inherit;
|
|
132
143
|
pointer-events: none;
|
|
133
144
|
}
|
|
134
|
-
@media (max-width: 1100px) {
|
|
135
|
-
.sticky-header-summary-surface {
|
|
136
|
-
right: 66px;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
145
|
.spatial-element-sticky-header {
|
|
140
146
|
position: fixed;
|
|
141
147
|
/* SpatialElementDockController portals this element outside the translated document. */
|
|
142
|
-
top:
|
|
143
|
-
left:
|
|
148
|
+
top: 0;
|
|
149
|
+
left: 0;
|
|
144
150
|
z-index: 20;
|
|
145
151
|
box-sizing: border-box;
|
|
146
|
-
width:
|
|
147
|
-
height:
|
|
152
|
+
width: 100%;
|
|
153
|
+
height: var(--spatial-detail-dock-height);
|
|
148
154
|
border: 0;
|
|
149
155
|
border-radius: var(--spatial-element-panel-radius);
|
|
150
156
|
visibility: hidden;
|
|
@@ -165,7 +171,7 @@
|
|
|
165
171
|
position: fixed;
|
|
166
172
|
z-index: 4;
|
|
167
173
|
display: block;
|
|
168
|
-
border-radius: var(--spatial-element-
|
|
174
|
+
border-radius: var(--spatial-element-control-radius);
|
|
169
175
|
background: transparent;
|
|
170
176
|
cursor: pointer;
|
|
171
177
|
}
|
|
@@ -176,17 +182,18 @@
|
|
|
176
182
|
}
|
|
177
183
|
|
|
178
184
|
.spatial-element-sticky-tabs {
|
|
179
|
-
--spatial-element-tabs-dock-top-radius: var(--spatial-element-
|
|
180
|
-
--spatial-element-tabs-dock-bottom-radius: var(--spatial-element-
|
|
185
|
+
--spatial-element-tabs-dock-top-radius: var(--spatial-element-control-radius);
|
|
186
|
+
--spatial-element-tabs-dock-bottom-radius: var(--spatial-element-control-radius);
|
|
181
187
|
|
|
182
188
|
position: fixed;
|
|
183
189
|
z-index: 19;
|
|
184
190
|
box-sizing: border-box;
|
|
185
|
-
height:
|
|
191
|
+
height: var(--spatial-detail-submenu-height);
|
|
186
192
|
padding: 0;
|
|
187
193
|
border: 0;
|
|
188
|
-
border-radius: var(--spatial-element-tabs-dock-top-radius)
|
|
189
|
-
var(--spatial-element-tabs-dock-
|
|
194
|
+
border-radius: var(--spatial-element-tabs-dock-top-radius)
|
|
195
|
+
var(--spatial-element-tabs-dock-top-radius) var(--spatial-element-tabs-dock-bottom-radius)
|
|
196
|
+
var(--spatial-element-tabs-dock-bottom-radius);
|
|
190
197
|
overflow: clip;
|
|
191
198
|
opacity: 0;
|
|
192
199
|
visibility: hidden;
|
|
@@ -209,7 +216,8 @@
|
|
|
209
216
|
.spatial-element-sticky-header::before,
|
|
210
217
|
.spatial-element-sticky-tabs::before {
|
|
211
218
|
background: rgb(
|
|
212
|
-
var(--spatial-element-docked-panel-tint-rgb) /
|
|
219
|
+
var(--spatial-element-docked-panel-tint-rgb) /
|
|
220
|
+
var(--spatial-element-docked-panel-tint-opacity)
|
|
213
221
|
);
|
|
214
222
|
box-shadow: inset 0 0 0 1px
|
|
215
223
|
rgb(0 0 0 / calc(var(--spatial-element-docked-panel-shadow-strength) * 0.18));
|
|
@@ -249,13 +257,13 @@
|
|
|
249
257
|
display: grid;
|
|
250
258
|
position: relative;
|
|
251
259
|
z-index: 3;
|
|
252
|
-
grid-template-columns: minmax(0, 1fr)
|
|
260
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
253
261
|
align-items: center;
|
|
254
262
|
gap: 16px;
|
|
255
263
|
box-sizing: border-box;
|
|
256
264
|
width: 100%;
|
|
257
265
|
height: 100%;
|
|
258
|
-
padding:
|
|
266
|
+
padding: 8px 16px 8px var(--spatial-element-sticky-minimap-reserve, 96px);
|
|
259
267
|
opacity: var(--spatial-element-sticky-header-progress, 0);
|
|
260
268
|
}
|
|
261
269
|
|
|
@@ -264,9 +272,12 @@
|
|
|
264
272
|
z-index: 1;
|
|
265
273
|
}
|
|
266
274
|
|
|
275
|
+
.sticky-header-content { display: flex; align-items: center; gap: 16px; min-width: 0; }
|
|
276
|
+
.sticky-header-details { flex: none; }
|
|
267
277
|
.sticky-header-copy {
|
|
278
|
+
flex: 1;
|
|
268
279
|
display: grid;
|
|
269
|
-
gap:
|
|
280
|
+
gap: 0;
|
|
270
281
|
min-width: 0;
|
|
271
282
|
}
|
|
272
283
|
|
|
@@ -277,75 +288,48 @@
|
|
|
277
288
|
}
|
|
278
289
|
|
|
279
290
|
.sticky-header-kicker {
|
|
280
|
-
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
text-overflow: ellipsis;
|
|
293
|
+
white-space: nowrap;
|
|
294
|
+
font-size: 14px;
|
|
281
295
|
font-weight: 400;
|
|
282
|
-
line-height:
|
|
296
|
+
line-height: 20px;
|
|
283
297
|
}
|
|
284
298
|
|
|
285
299
|
.sticky-header-title {
|
|
286
300
|
overflow: hidden;
|
|
287
301
|
font-size: 24px;
|
|
288
|
-
font-weight:
|
|
289
|
-
line-height:
|
|
302
|
+
font-weight: 600;
|
|
303
|
+
line-height: 32px;
|
|
290
304
|
text-overflow: ellipsis;
|
|
291
305
|
white-space: nowrap;
|
|
292
306
|
}
|
|
293
307
|
|
|
294
308
|
.sticky-header-action {
|
|
309
|
+
visibility: hidden;
|
|
295
310
|
display: grid;
|
|
296
311
|
place-items: center;
|
|
297
|
-
width:
|
|
298
|
-
height:
|
|
312
|
+
width: 54px;
|
|
313
|
+
height: 54px;
|
|
299
314
|
padding: 0;
|
|
300
315
|
border: 0;
|
|
301
|
-
border-radius:
|
|
316
|
+
border-radius: var(--spatial-element-control-radius);
|
|
302
317
|
color: var(--spatial-element-on-accent);
|
|
303
318
|
background: var(--spatial-element-accent);
|
|
304
319
|
text-decoration: none;
|
|
305
320
|
cursor: pointer;
|
|
306
321
|
}
|
|
322
|
+
.spatial-element-sticky-header:global([data-action-active]) .sticky-header-action { visibility: visible; }
|
|
307
323
|
|
|
308
|
-
@media (
|
|
309
|
-
.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
width: calc(100vw - 16px);
|
|
313
|
-
height: 72px;
|
|
314
|
-
border-radius: min(var(--spatial-element-panel-radius), 14px);
|
|
315
|
-
}
|
|
316
|
-
|
|
324
|
+
@media (width < 840px) {
|
|
325
|
+
.sticky-header-content.has-details { display: grid; gap: 2px; }
|
|
326
|
+
.has-details .sticky-header-kicker { display: none; }
|
|
327
|
+
.has-details .sticky-header-title { font-size: 14px; line-height: 18px; }
|
|
317
328
|
.sticky-header-layout {
|
|
318
|
-
grid-template-columns: minmax(0, 1fr) 48px;
|
|
319
329
|
gap: 8px;
|
|
320
|
-
padding:
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.sticky-header-copy {
|
|
324
|
-
gap: 2px;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.sticky-header-kicker {
|
|
328
|
-
font-size: 13px;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.sticky-header-title {
|
|
332
|
-
font-size: 17px;
|
|
333
|
-
font-weight: 600;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.sticky-header-action {
|
|
337
|
-
width: 48px;
|
|
338
|
-
height: 48px;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
@media (max-width: 460px) {
|
|
343
|
-
.sticky-header-kicker {
|
|
344
|
-
font-size: 12px;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.sticky-header-title {
|
|
348
|
-
font-size: 15px;
|
|
330
|
+
padding-right: 8px;
|
|
349
331
|
}
|
|
332
|
+
.sticky-header-title { font-size: 18px; line-height: 24px; }
|
|
333
|
+
.spatial-element-sticky-tabs { display: none; }
|
|
350
334
|
}
|
|
351
335
|
</style>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
3
|
+
import './layout.generated.css';
|
|
4
|
+
import type { SpatialElementSectionNavigationItem } from '@spatial-elements/core/spatial-element/types';
|
|
2
5
|
type $$ComponentProps = {
|
|
3
6
|
activeSectionId?: string;
|
|
7
|
+
headerDetails?: Snippet;
|
|
8
|
+
actionIcon?: Snippet;
|
|
4
9
|
spatialElement: SpatialElementData;
|
|
5
10
|
sections: SpatialElementSectionNavigationItem[];
|
|
6
11
|
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
4
|
+
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
5
|
+
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
6
|
+
import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
|
|
7
|
+
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
8
|
+
let { spatialElement, address, contentInset, heading = 'h3', leading, beforeAction, actionIcon, element = $bindable() }: {
|
|
9
|
+
spatialElement: { id: string; eyebrow: string; title: string; features: SpatialElementFeature[]; action?: SpatialElementAction };
|
|
10
|
+
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
11
|
+
contentInset: number;
|
|
12
|
+
heading?: 'h1' | 'h3';
|
|
13
|
+
leading?: Snippet;
|
|
14
|
+
/** Optional content above the CTA, for example a price and quantity field. */
|
|
15
|
+
beforeAction?: Snippet;
|
|
16
|
+
actionIcon?: Snippet;
|
|
17
|
+
element?: HTMLDivElement;
|
|
18
|
+
} = $props();
|
|
19
|
+
const catalogEndpoint = createCatalogEndpointAction();
|
|
20
|
+
</script>
|
|
21
|
+
<div bind:this={element} class="summary-presentation">
|
|
22
|
+
{#if leading}<div use:catalogEndpoint={address('leading')}
|
|
23
|
+
data-catalog-rich-shared="leading" data-catalog-semantic={spatialElement.id}>
|
|
24
|
+
{@render leading()}
|
|
25
|
+
</div>{/if}
|
|
26
|
+
<div class="panel-copy">
|
|
27
|
+
{#if spatialElement.eyebrow}
|
|
28
|
+
<p
|
|
29
|
+
class="panel-kicker"
|
|
30
|
+
data-shared-role="eyebrow"
|
|
31
|
+
data-spatial-element-id={spatialElement.id}
|
|
32
|
+
use:catalogEndpoint={address('eyebrow')}
|
|
33
|
+
>
|
|
34
|
+
{spatialElement.eyebrow}
|
|
35
|
+
</p>
|
|
36
|
+
{/if}
|
|
37
|
+
<svelte:element this={heading} class="summary-title"
|
|
38
|
+
id={heading === 'h1' ? 'spatial-element-title' : undefined}
|
|
39
|
+
tabindex={heading === 'h1' ? -1 : undefined}
|
|
40
|
+
data-shared-role="title"
|
|
41
|
+
data-spatial-element-id={spatialElement.id}
|
|
42
|
+
use:catalogEndpoint={address('title')}
|
|
43
|
+
>
|
|
44
|
+
{spatialElement.title}
|
|
45
|
+
</svelte:element>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{#if spatialElement.features.length}<ul
|
|
49
|
+
class="feature-list"
|
|
50
|
+
aria-label="SpatialElement highlights"
|
|
51
|
+
use:catalogEndpoint={address('features')}
|
|
52
|
+
data-catalog-rich-shared="features"
|
|
53
|
+
data-catalog-semantic={JSON.stringify(spatialElement.features)}
|
|
54
|
+
>
|
|
55
|
+
{#each spatialElement.features as feature (feature.label)}
|
|
56
|
+
<li>
|
|
57
|
+
<span class="feature-content" data-catalog-secondary>
|
|
58
|
+
<span class="feature-marker" aria-hidden="true">{feature.marker ?? 'Link'}</span>
|
|
59
|
+
<span>{feature.label}</span>
|
|
60
|
+
</span>
|
|
61
|
+
</li>
|
|
62
|
+
{/each}
|
|
63
|
+
</ul>{/if}
|
|
64
|
+
|
|
65
|
+
{#if beforeAction}<div use:catalogEndpoint={address('action-details')}
|
|
66
|
+
data-catalog-rich-shared="action-details" data-catalog-semantic={spatialElement.id}>
|
|
67
|
+
{@render beforeAction()}
|
|
68
|
+
</div>{/if}
|
|
69
|
+
{#if spatialElement.action}
|
|
70
|
+
{#if spatialElement.action.href}
|
|
71
|
+
<a
|
|
72
|
+
use:catalogEndpoint={address('primary-action')}
|
|
73
|
+
data-catalog-rich-shared="primary-action"
|
|
74
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
75
|
+
class="spatial-element-action spatial-element-action-expanded"
|
|
76
|
+
href={spatialElement.action.href}
|
|
77
|
+
rel="external"
|
|
78
|
+
aria-label={spatialElement.action.ariaLabel}
|
|
79
|
+
>
|
|
80
|
+
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
81
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart
|
|
82
|
+
class="spatial-element-action-icon"
|
|
83
|
+
size={27}
|
|
84
|
+
strokeWidth={2}
|
|
85
|
+
aria-hidden="true"
|
|
86
|
+
/>{/if}
|
|
87
|
+
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
88
|
+
</span>
|
|
89
|
+
</a>
|
|
90
|
+
{:else}
|
|
91
|
+
<button
|
|
92
|
+
use:catalogEndpoint={address('primary-action')}
|
|
93
|
+
data-catalog-rich-shared="primary-action"
|
|
94
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
95
|
+
class="spatial-element-action spatial-element-action-expanded"
|
|
96
|
+
type="button"
|
|
97
|
+
aria-label={spatialElement.action.ariaLabel}
|
|
98
|
+
>
|
|
99
|
+
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
100
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart
|
|
101
|
+
class="spatial-element-action-icon"
|
|
102
|
+
size={27}
|
|
103
|
+
strokeWidth={2}
|
|
104
|
+
aria-hidden="true"
|
|
105
|
+
/>{/if}
|
|
106
|
+
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
107
|
+
</span>
|
|
108
|
+
</button>
|
|
109
|
+
{/if}
|
|
110
|
+
{/if}
|
|
111
|
+
</div>
|
|
112
|
+
<style>
|
|
113
|
+
.summary-presentation {
|
|
114
|
+
position: relative;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
gap: 20px;
|
|
119
|
+
/* The same live panel can leave a Section for the stage's detail layer. */
|
|
120
|
+
line-height: 24px;
|
|
121
|
+
pointer-events: auto;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.summary-title {
|
|
125
|
+
margin: 10px 0 0;
|
|
126
|
+
font-size: 24px;
|
|
127
|
+
font-weight: 780;
|
|
128
|
+
line-height: 1.16;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.panel-kicker {
|
|
132
|
+
margin: 0;
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
font-weight: 720;
|
|
135
|
+
letter-spacing: 0.05em;
|
|
136
|
+
text-transform: uppercase;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.feature-list {
|
|
140
|
+
display: grid;
|
|
141
|
+
gap: 12px;
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 0;
|
|
144
|
+
color: var(--spatial-element-body);
|
|
145
|
+
font-size: 16px;
|
|
146
|
+
list-style: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.feature-content {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: baseline;
|
|
152
|
+
gap: 14px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.feature-marker {
|
|
156
|
+
color: var(--spatial-element-accent);
|
|
157
|
+
font-weight: 800;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.spatial-element-action {
|
|
161
|
+
display: block;
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
width: 100%;
|
|
164
|
+
min-height: 54px;
|
|
165
|
+
border: 0;
|
|
166
|
+
padding: 0;
|
|
167
|
+
color: inherit;
|
|
168
|
+
background: transparent;
|
|
169
|
+
text-decoration: none;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.spatial-element-action-surface {
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
gap: 10px;
|
|
178
|
+
box-sizing: border-box;
|
|
179
|
+
width: 100%;
|
|
180
|
+
min-height: 54px;
|
|
181
|
+
border-radius: var(--spatial-element-control-radius, 7px);
|
|
182
|
+
color: var(--spatial-element-on-accent);
|
|
183
|
+
background: var(--spatial-element-accent);
|
|
184
|
+
font:
|
|
185
|
+
760 22px/1 system-ui,
|
|
186
|
+
sans-serif;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:global(.spatial-element-action-icon) {
|
|
190
|
+
flex: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.spatial-element-action-label {
|
|
194
|
+
white-space: normal;
|
|
195
|
+
}
|
|
196
|
+
@container spatial-summary (min-width: 420px) { .summary-title { font-size: 32px; } }
|
|
197
|
+
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
3
|
+
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
spatialElement: {
|
|
6
|
+
id: string;
|
|
7
|
+
eyebrow: string;
|
|
8
|
+
title: string;
|
|
9
|
+
features: SpatialElementFeature[];
|
|
10
|
+
action?: SpatialElementAction;
|
|
11
|
+
};
|
|
12
|
+
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
13
|
+
contentInset: number;
|
|
14
|
+
heading?: 'h1' | 'h3';
|
|
15
|
+
leading?: Snippet;
|
|
16
|
+
/** Optional content above the CTA, for example a price and quantity field. */
|
|
17
|
+
beforeAction?: Snippet;
|
|
18
|
+
actionIcon?: Snippet;
|
|
19
|
+
element?: HTMLDivElement;
|
|
20
|
+
};
|
|
21
|
+
declare const SpatialElementSummaryContent: import("svelte").Component<$$ComponentProps, {}, "element">;
|
|
22
|
+
type SpatialElementSummaryContent = ReturnType<typeof SpatialElementSummaryContent>;
|
|
23
|
+
export default SpatialElementSummaryContent;
|