@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.
Files changed (133) hide show
  1. package/README.md +18 -13
  2. package/dist/catalog/ScrollNavigationBridge.svelte +172 -47
  3. package/dist/catalog/ScrollNavigationBridge.svelte.d.ts +9 -2
  4. package/dist/catalog/catalogNavigation.js +3 -2
  5. package/dist/catalog/catalogSummaryTransfer.d.ts +16 -0
  6. package/dist/catalog/catalogSummaryTransfer.js +79 -0
  7. package/dist/catalog/catalogTransition.css +58 -3
  8. package/dist/catalog/interruptedPresentation.d.ts +10 -0
  9. package/dist/catalog/interruptedPresentation.js +29 -0
  10. package/dist/catalog/presentationCleanup.d.ts +4 -0
  11. package/dist/catalog/presentationCleanup.js +20 -0
  12. package/dist/catalog/stagedCatalogNavigation.d.ts +44 -0
  13. package/dist/catalog/stagedCatalogNavigation.js +403 -0
  14. package/dist/catalog/stagedDomReveal.d.ts +8 -0
  15. package/dist/catalog/stagedDomReveal.js +76 -0
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +3 -0
  18. package/dist/spatial-element/BrandStageShell.svelte +52 -71
  19. package/dist/spatial-element/BrandStageShell.svelte.d.ts +31 -4
  20. package/dist/spatial-element/CarouselSpatialElement.svelte +152 -200
  21. package/dist/spatial-element/CarouselSpatialElement.svelte.d.ts +5 -1
  22. package/dist/spatial-element/ContentBlock.svelte +7 -0
  23. package/dist/spatial-element/ContentBlock.svelte.d.ts +9 -0
  24. package/dist/spatial-element/ContentGrid.svelte +7 -0
  25. package/dist/spatial-element/ContentGrid.svelte.d.ts +8 -0
  26. package/dist/spatial-element/ContentPage.svelte +51 -55
  27. package/dist/spatial-element/ContentPage.svelte.d.ts +14 -3
  28. package/dist/spatial-element/InteractionGesture.svelte +39 -0
  29. package/dist/spatial-element/InteractionGesture.svelte.d.ts +7 -0
  30. package/dist/spatial-element/OverflowControls.svelte +129 -0
  31. package/dist/spatial-element/OverflowControls.svelte.d.ts +9 -0
  32. package/dist/spatial-element/PointerHint.svelte +80 -0
  33. package/dist/spatial-element/PointerHint.svelte.d.ts +3 -0
  34. package/dist/spatial-element/Section.svelte +25 -106
  35. package/dist/spatial-element/Section.svelte.d.ts +1 -0
  36. package/dist/spatial-element/SectionSurfaceGroup.svelte +8 -0
  37. package/dist/spatial-element/SectionSurfaceGroup.svelte.d.ts +8 -0
  38. package/dist/spatial-element/SpaceMouseControl.svelte +159 -0
  39. package/dist/spatial-element/SpaceMouseControl.svelte.d.ts +7 -0
  40. package/dist/spatial-element/SpaceMouseIcon.svelte +12 -0
  41. package/dist/spatial-element/SpaceMouseIcon.svelte.d.ts +26 -0
  42. package/dist/spatial-element/SpatialCardGridSection.svelte +79 -0
  43. package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
  44. package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
  45. package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
  46. package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
  47. package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
  48. package/dist/spatial-element/SpatialCarouselSection.svelte +754 -0
  49. package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
  50. package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
  51. package/dist/spatial-element/SpatialElementCard.svelte +54 -238
  52. package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
  53. package/dist/spatial-element/SpatialElementHelp.svelte +300 -0
  54. package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
  55. package/dist/spatial-element/SpatialElementMediaRail.svelte +322 -52
  56. package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
  57. package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
  58. package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
  59. package/dist/spatial-element/SpatialElementPage.svelte +156 -71
  60. package/dist/spatial-element/SpatialElementPage.svelte.d.ts +10 -3
  61. package/dist/spatial-element/SpatialElementStickyHeader.svelte +89 -105
  62. package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +6 -1
  63. package/dist/spatial-element/SpatialElementSummaryContent.svelte +198 -0
  64. package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +23 -0
  65. package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
  66. package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
  67. package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
  68. package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
  69. package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
  70. package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
  71. package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
  72. package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
  73. package/dist/spatial-element/SpatialIconButton.svelte +66 -0
  74. package/dist/spatial-element/SpatialIconButton.svelte.d.ts +17 -0
  75. package/dist/spatial-element/SpatialListPage.svelte +37 -8
  76. package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
  77. package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
  78. package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
  79. package/dist/spatial-element/SpatialNavigationShell.svelte +138 -0
  80. package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
  81. package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
  82. package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
  83. package/dist/spatial-element/SpatialSummaryRoot.svelte +80 -0
  84. package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
  85. package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
  86. package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
  87. package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
  88. package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
  89. package/dist/spatial-element/brandContext.d.ts +1 -1
  90. package/dist/spatial-element/brandContext.js +1 -1
  91. package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
  92. package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
  93. package/dist/spatial-element/carouselTextHit.d.ts +2 -0
  94. package/dist/spatial-element/carouselTextHit.js +17 -0
  95. package/dist/spatial-element/contentSidebars.d.ts +3 -0
  96. package/dist/spatial-element/contentSidebars.js +56 -0
  97. package/dist/spatial-element/index.d.ts +19 -3
  98. package/dist/spatial-element/index.js +12 -2
  99. package/dist/spatial-element/layout.generated.css +363 -0
  100. package/dist/spatial-element/messagesContext.d.ts +3 -0
  101. package/dist/spatial-element/messagesContext.js +10 -0
  102. package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
  103. package/dist/spatial-element/presentationBoxFreeze.js +35 -0
  104. package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
  105. package/dist/spatial-element/spatialCardGrid.js +1 -0
  106. package/dist/spatial-element/spatialPageContext.d.ts +4 -0
  107. package/dist/spatial-element/spatialPageContext.js +9 -0
  108. package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
  109. package/dist/spatial-element/spatialPresentationOwner.js +2 -0
  110. package/dist/spatial-element/spatialSummary.d.ts +43 -0
  111. package/dist/spatial-element/spatialSummary.js +1 -0
  112. package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
  113. package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
  114. package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
  115. package/dist/spatial-element/spatialThemeStyle.js +69 -0
  116. package/dist/spatial-element/truncatedTitle.d.ts +5 -0
  117. package/dist/spatial-element/truncatedTitle.js +28 -0
  118. package/dist/stage/ButtonGroup.svelte +152 -0
  119. package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
  120. package/dist/stage/Panel.svelte +72 -14
  121. package/dist/stage/Panel.svelte.d.ts +14 -2
  122. package/dist/stage/Stage.svelte +471 -51
  123. package/dist/stage/Stage.svelte.d.ts +8 -1
  124. package/dist/stage/StageViewport.svelte +15 -2
  125. package/dist/stage/authoredStyle.d.ts +4 -0
  126. package/dist/stage/authoredStyle.js +17 -0
  127. package/dist/stage/buttonGroup.d.ts +9 -0
  128. package/dist/stage/buttonGroup.js +1 -0
  129. package/logo.svg +225 -0
  130. package/package.json +9 -6
  131. package/dist/spatial-element/CarouselSection.svelte +0 -350
  132. package/dist/spatial-element/ListSection.svelte +0 -30
  133. package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
@@ -1,12 +1,16 @@
1
1
  <script lang="ts">
2
- import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
2
+ import { catalogViewLink } from '@spatial-elements/core/catalog/catalogViewLink';
3
+ import { focusCatalogLink } from '@spatial-elements/core/catalog/catalogActivationFocus';
4
+ import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
5
+ import SpatialSummarySlot from './SpatialSummarySlot.svelte';
3
6
  import { getContext } from 'svelte';
4
7
  import { getCssPanelBoxShadow } from '@spatial-elements/core/stage/panelShadow';
8
+ import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
5
9
  import type { SpatialListItem } from '@spatial-elements/core/spatial-element/types';
6
10
  import { CATALOG_ITEMS, type CatalogItems } from '@spatial-elements/core/catalog/catalogItems';
7
11
  import { carouselKey } from '@spatial-elements/core/catalog/carouselSelection';
8
12
  import { carouselPose, carouselResident } from '@spatial-elements/core/catalog/catalogPose';
9
- import type { CarouselPresentation } from '@spatial-elements/core/catalog/catalogPose';
13
+ import type { CarouselLayout, CarouselPresentation, CarouselEmphasis } from '@spatial-elements/core/catalog/catalogPose';
10
14
  import { useCatalogNavigation } from '../catalog/catalogNavigation.js';
11
15
  import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
12
16
  import {
@@ -20,29 +24,40 @@
20
24
  spatialElement,
21
25
  sectionId,
22
26
  presentation,
27
+ layout,
23
28
  index,
24
29
  count,
25
30
  phase,
31
+ emphasis,
32
+ focus,
26
33
  windowPhase,
27
34
  selected,
28
35
  interactive,
29
- onselect
36
+ onselect,
37
+ canActivate
30
38
  }: {
31
39
  spatialElement: SpatialListItem;
32
40
  sectionId: string;
33
41
  presentation?: CarouselPresentation;
42
+ layout: CarouselLayout;
34
43
  index: number;
35
44
  count: number;
36
45
  phase: number;
46
+ emphasis?: CarouselEmphasis;
47
+ focus: number;
37
48
  windowPhase: number;
38
49
  selected: boolean;
39
50
  interactive: boolean;
40
51
  onselect: () => void;
52
+ canActivate: () => boolean;
41
53
  } = $props();
42
54
  const items = getContext<CatalogItems | undefined>(CATALOG_ITEMS);
43
55
  const endpoints = getContext<CatalogEndpointRegistry | undefined>(CATALOG_ENDPOINTS);
44
56
  const sections = getContext<CatalogSections | undefined>(CATALOG_SECTIONS);
45
- const brand = useSpatialTheme();
57
+ const readTheme = useSpatialTheme();
58
+ const brand = $derived(readTheme());
59
+ const radii = $derived(resolveSpatialThemeRadii(brand));
60
+ const contentInset = $derived(brand.panelShape.contentInset ?? Math.max(16, Math.round(brand.panelShape.radius * 0.7)));
46
61
  const catalogEndpoint = createCatalogEndpointAction();
47
62
  function address(role: CatalogEndpointRole) {
48
63
  return interactive &&
@@ -69,8 +84,11 @@
69
84
  return () => clearTimeout(timer);
70
85
  });
71
86
  const occurrence = $derived(JSON.stringify([sectionId, carouselKey(spatialElement)]));
72
- const pose = $derived(carouselPose(index, phase, count, presentation));
73
- const resident = $derived(carouselResident(index, windowPhase, count));
87
+ const tooltip = $derived(spatialElement.title);
88
+ const pose = $derived(carouselPose(index, phase, count, presentation, layout, emphasis, focus));
89
+ const compact = $derived(layout.framing?.compact ?? false);
90
+ const modelFrameSize = $derived(layout.framing ? Math.min(layout.framing.fit.width, layout.framing.fit.height) : Math.min(layout.width, layout.height));
91
+ const resident = $derived(carouselResident(index, windowPhase, count, presentation, layout));
74
92
  function activate(event: MouseEvent) {
75
93
  endpoints?.prefer(brand.id, spatialElement.id, occurrence, 'carousel.front');
76
94
  sections?.activate({
@@ -79,19 +97,20 @@
79
97
  occurrence,
80
98
  slot: 'carousel.front'
81
99
  });
82
- (event.currentTarget as HTMLElement).focus({ preventScroll: true });
100
+ focusCatalogLink(event.currentTarget as HTMLAnchorElement, event);
83
101
  }
84
102
  $effect(() => {
85
103
  if (!interactive || !resident) return;
86
104
  return items?.register({
87
105
  ...spatialElement,
88
106
  occurrence,
89
- pose: { kind: 'carousel', read: () => carouselPose(index, phase, count, presentation) }
107
+ pose: { kind: 'carousel', read: () => carouselPose(index, phase, count, presentation, layout, emphasis, focus) }
90
108
  });
91
109
  });
92
110
  </script>
93
111
 
94
112
  <article
113
+ id={`carousel-${sectionId}-${index}`}
95
114
  use:catalogEndpoint={address('container')}
96
115
  class="carousel-spatial-element"
97
116
  class:selected
@@ -104,8 +123,8 @@
104
123
  data-carousel-surface={brand.panelTheme.surface ?? 'glass'}
105
124
  data-carousel-theme={JSON.stringify({
106
125
  ...brand.panelTheme,
107
- radius: brand.panelShape.radius,
108
- tintOpacity: Math.min(brand.panelTheme.tintOpacity ?? 0.28, 0.72)
126
+ radius: radii.panel,
127
+ tintOpacity: Math.max(0, Math.min(brand.panelTheme.tintOpacity ?? 0.28, 1))
109
128
  })}
110
129
  data-catalog-occurrence={occurrence}
111
130
  >
@@ -115,29 +134,57 @@
115
134
  data-catalog-geometry
116
135
  data-spatial-element-id={spatialElement.id}
117
136
  data-catalog-occurrence={occurrence}
137
+ style={interactive
138
+ ? `--carousel-poster-x:${pose.x * 100}%;--carousel-poster-y:${pose.y * 100}%;--carousel-poster-width:${pose.size * modelFrameSize}px;--carousel-poster-opacity:${pose.opacity}`
139
+ : undefined}
118
140
  >
119
- <button
141
+ <div data-carousel-fit-anchor aria-hidden="true"></div>
142
+ <a
143
+ use:mouseHover
144
+ use:catalogViewLink={{ spatialElementId: spatialElement.id, targetPresentation: spatialElement.targetPresentation }}
120
145
  draggable="false"
121
146
  class="spatial-element-target"
147
+ title={tooltip}
122
148
  hidden={interactive && !pose.visible}
123
- aria-label={`Select ${spatialElement.eyebrow}`}
124
- aria-pressed={selected}
125
- onclick={onselect}
126
- style={interactive
127
- ? `left:${(pose.x - 0.19 * Math.cos(pose.yaw)) * 100}%;top:${pose.y * 100}%;width:${pose.size * 100}%;max-width:${pose.size * 480}px;z-index:${Math.round(1300 + pose.depth)}`
128
- : undefined}
149
+ href={href(spatialElement.href)}
150
+ role={interactive && !selected ? 'button' : undefined}
151
+ aria-label={interactive && !selected ? `Select ${tooltip}` : `More information: ${tooltip}`}
152
+ aria-pressed={interactive && !selected ? false : undefined}
153
+ aria-busy={selected && busy || undefined}
154
+ data-catalog-focus-key={`catalog-geometry:${occurrence}`}
155
+ onpointerenter={() => { if (selected) prepare(spatialElement); }}
156
+ onfocus={() => { if (selected) prepare(spatialElement); }}
157
+ onpointerdown={() => { if (selected) prepare(spatialElement); }}
158
+ onkeydown={(event) => {
159
+ if (interactive && !selected && event.key === ' ') {
160
+ event.preventDefault();
161
+ event.currentTarget.click();
162
+ }
163
+ }}
164
+ onclick={(event) => {
165
+ if (!canActivate()) { event.preventDefault(); return; }
166
+ if (interactive && !selected) { event.preventDefault(); onselect(); return; }
167
+ activate(event);
168
+ }}
169
+ style:z-index={interactive ? Math.max(1, Math.round(1200 / (1 + Math.max(0, -pose.depth) / 1000))) : undefined}
129
170
  >
130
- {#if spatialElement.stage?.fallbackImage}<img
171
+ {#if !spatialElement.fallbackImage}<span>{spatialElement.eyebrow}</span>{/if}
172
+ </a>
173
+ {#if spatialElement.fallbackImage}<img
174
+ hidden={interactive && !pose.visible}
175
+ class="spatial-element-poster"
131
176
  draggable="false"
132
- src={spatialElement.stage.fallbackImage}
177
+ src={spatialElement.fallbackImage}
133
178
  alt={`${brand.name} ${spatialElement.title}`}
179
+ style:--carousel-depth-blur={interactive && pose.blur ? `blur(${pose.blur}px)` : 'blur(0px)'}
134
180
  width="320"
135
181
  height="320"
136
- />{:else}<span>{spatialElement.eyebrow}</span>{/if}
137
- </button>
182
+ />{/if}
138
183
  </div>
139
184
  <div
140
185
  class="summary"
186
+ class:has-eyebrow={Boolean(spatialElement.eyebrow)}
187
+ style:--summary-content-inset={`${contentInset}px`}
141
188
  hidden={interactive && pose.panelOpacity < 0.001}
142
189
  inert={interactive && !selected}
143
190
  aria-hidden={interactive && !selected}
@@ -149,118 +196,80 @@
149
196
  : typeof brand.panelTheme.tint === 'object'
150
197
  ? brand.panelTheme.tint.getStyle()
151
198
  : (brand.panelTheme.tint ?? '#ffffff')}
152
- style:--carousel-panel-tint-opacity={Math.min(brand.panelTheme.tintOpacity ?? 0.28, 0.72) *
199
+ style:--carousel-panel-tint-opacity={Math.max(0, Math.min(brand.panelTheme.tintOpacity ?? 0.28, 1)) *
153
200
  100 +
154
201
  '%'}
155
- style:--carousel-panel-blur={(brand.panelTheme.backdropBlur ?? 5) + 'px'}
156
- style:--carousel-panel-radius={brand.panelShape.radius + 'px'}
202
+ style:--carousel-panel-backdrop={brand.panelTheme.surface === 'solid' ? 'none' : `blur(${Math.max(0, Math.min(brand.panelTheme.backdropBlur ?? 5, 100))}px)`}
203
+ style:--carousel-focus-blur={interactive && pose.panelOpacity < 1 ? `blur(${(1 - pose.panelOpacity) * 6}px)` : 'none'}
204
+ style:--carousel-panel-radius={radii.panel + 'px'}
157
205
  use:catalogEndpoint={address('summary-surface')}
158
206
  >
159
- <p class="eyebrow" use:catalogEndpoint={address('eyebrow')}>{spatialElement.eyebrow}</p>
160
- <h3 use:catalogEndpoint={address('title')}>{spatialElement.title}</h3>
161
- <ul
162
- use:catalogEndpoint={address('features')}
163
- data-catalog-rich-shared="features"
164
- data-catalog-semantic={JSON.stringify(
165
- spatialElement.summary?.features ?? spatialElement.features.map((label) => ({ label }))
166
- )}
167
- >
168
- {#each spatialElement.summary?.features ?? spatialElement.features.map( (label) => ({ label }) ) as feature, index (index)}<li
169
- >
170
- {feature.label}
171
- </li>{/each}
172
- </ul>
173
- {#if spatialElement.summary?.action}
174
- {@const action = spatialElement.summary.action}
175
- {#if action.href}<a
176
- use:catalogEndpoint={address('primary-action')}
177
- data-catalog-rich-shared="primary-action"
178
- data-catalog-semantic={catalogActionSemantic(action)}
179
- class="action"
180
- href={action.href}
181
- rel="external"
182
- aria-label={action.ariaLabel}>{action.label}</a
183
- >
184
- {:else}<button
185
- class="action"
186
- aria-label={action.ariaLabel}
187
- use:catalogEndpoint={address('primary-action')}
188
- data-catalog-rich-shared="primary-action"
189
- data-catalog-semantic={catalogActionSemantic(action)}>{action.label}</button
190
- >{/if}
191
- {/if}
192
- <a
193
- data-catalog-focus-key={`catalog:${JSON.stringify([brand.id, spatialElement.id, occurrence, 'carousel.front'])}`}
194
- aria-busy={busy || undefined}
195
- onclick={(event) => {
196
- endpoints?.prefer(brand.id, spatialElement.id, occurrence, 'carousel.front');
197
- sections?.activate({
198
- brandId: brand.id,
199
- spatialElementId: spatialElement.id,
200
- occurrence,
201
- slot: 'carousel.front'
202
- });
203
- event.currentTarget.focus({ preventScroll: true });
204
- }}
205
- class="information"
206
- href={href(spatialElement.href)}
207
- onpointerenter={() => prepare(spatialElement)}
208
- onfocus={() => prepare(spatialElement)}
209
- onpointerdown={() => prepare(spatialElement)}
210
- >More information<span class="sr-only">: {spatialElement.title}</span></a
211
- >
212
- {#if spatialElement.summary?.sectionLink}
213
- <a
214
- class="information"
215
- href={href(spatialElement.summary.sectionLink.href)}
216
- onclick={activate}
217
- data-catalog-focus-key={`catalog-section:${occurrence}`}
218
- >{spatialElement.summary.sectionLink.label}</a
219
- >
220
- {/if}
207
+ <SpatialSummarySlot instanceKey={`carousel:${brand.id}:${occurrence}`}
208
+ context={{ spatialElement: { id: spatialElement.id, brandId: brand.id, eyebrow: spatialElement.eyebrow, title: spatialElement.title,
209
+ features: spatialElement.summary?.features ?? spatialElement.features.map((label) => ({ label })), action: spatialElement.summary?.action },
210
+ contentInset, heading: 'h3', mode: 'carousel', address,
211
+ carousel: { item: spatialElement, occurrence, compact } }} />
221
212
  </div>
222
213
  </article>
223
214
 
224
215
  <style>
225
216
  .carousel-spatial-element {
226
- display: grid;
227
- grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
228
- gap: 32px;
229
- align-items: center;
230
- margin-bottom: 24px;
217
+ display: block;
218
+ position: relative;
219
+ min-width: 0;
220
+ height: calc(var(--spatial-carousel-title-reserve) + var(--spatial-carousel-fit-height));
221
+ min-height: 0;
222
+ padding: 0;
223
+ box-sizing: border-box;
224
+ scroll-snap-align: start;
225
+ scroll-snap-stop: always;
226
+ scroll-margin-top: 100px;
231
227
  }
232
228
  .interactive {
233
- position: absolute;
234
- inset: 0;
229
+ grid-area: 1 / 1;
235
230
  pointer-events: none;
236
231
  }
237
232
  .spatial-element-visual {
238
- height: var(--carousel-height, 560px);
239
- position: relative;
240
- display: grid;
233
+ position: absolute;
234
+ inset: 0;
235
+ display: block;
241
236
  place-items: center;
242
- touch-action: pan-y;
237
+ touch-action: manipulation;
243
238
  }
244
- .interactive {
245
- display: block;
246
- margin: 0;
239
+ .interactive .spatial-element-visual {
240
+ /* The native rail owns horizontal panning; vertical page scroll and zoom stay native. */
241
+ touch-action: manipulation;
247
242
  }
248
243
  .interactive[hidden] {
249
244
  /* Keep known summary dimensions measurable without painting or registering GPU actors. */
250
- display: block;
245
+ display: grid;
251
246
  visibility: hidden;
252
247
  }
253
248
  .interactive .summary {
254
- position: absolute;
255
- left: 0;
256
- top: 0;
257
- width: 40%;
258
- box-sizing: border-box;
259
249
  z-index: 1400;
260
250
  transform-origin: 0 0;
261
- transform: translate(150%, 24px);
251
+ }
252
+ /* Keep only the selected source's compositing layers ready before navigation.
253
+ * Promoting its rounded/frosted surface at the click can compile a new browser
254
+ * raster shader during motion even when all WebGPU passes are already warm. */
255
+ .interactive.selected .summary,
256
+ .interactive.selected .summary :global(.spatial-summary-island) {
257
+ will-change: transform;
258
+ }
259
+ .spatial-element-target,
260
+ .spatial-element-poster {
261
+ position: absolute;
262
+ left: var(--carousel-poster-x, calc(var(--spatial-carousel-fit-left) + var(--spatial-carousel-fit-width) / 2));
263
+ top: var(--carousel-poster-y, calc(var(--spatial-carousel-title-reserve) + var(--spatial-carousel-fit-height) / 2));
264
+ width: var(--carousel-poster-width, calc(min(var(--spatial-carousel-fit-width), var(--spatial-carousel-fit-height)) * 0.82));
265
+ max-width: none;
266
+ transform: translate(-50%, -50%);
267
+ aspect-ratio: 1;
262
268
  }
263
269
  .spatial-element-target {
270
+ display: block;
271
+ color: inherit;
272
+ text-decoration: none;
264
273
  border: none;
265
274
  background: transparent;
266
275
  cursor: pointer;
@@ -268,121 +277,64 @@
268
277
  padding: 0;
269
278
  aspect-ratio: 1;
270
279
  }
271
- .interactive .spatial-element-target {
272
- position: absolute;
273
- transform: translate(-50%, -50%);
274
- }
275
280
  .spatial-element-target[hidden] {
276
281
  display: none;
277
282
  }
278
283
  .spatial-element-target:focus-visible {
279
284
  outline: 2px solid var(--spatial-element-accent);
280
285
  outline-offset: 4px;
281
- border-radius: 12px;
286
+ border-radius: var(--spatial-element-control-radius);
287
+ }
288
+ /* Enhanced geometry already has a silhouette focus outline in the renderer. */
289
+ .interactive:global([data-catalog-model-ready]) .spatial-element-target:focus-visible {
290
+ outline: none;
282
291
  }
283
292
  img {
284
- width: 100%;
285
- height: 100%;
293
+ opacity: var(--carousel-poster-opacity, 1);
294
+ height: auto;
295
+ pointer-events: none;
286
296
  object-fit: contain;
297
+ filter: var(--carousel-hover-blur, var(--carousel-depth-blur, blur(0px))) var(--carousel-hover-shadow, drop-shadow(0 0 0 transparent));
298
+ transition: filter 180ms ease, opacity 240ms ease;
287
299
  }
288
- .carousel-spatial-element:global([data-catalog-model-ready]) img {
300
+ .spatial-element-target:global([data-mouse-hover]) + img,
301
+ .spatial-element-target:focus-visible + img {
302
+ --carousel-hover-blur: blur(0px);
303
+ --carousel-hover-shadow: drop-shadow(0 0 3px var(--spatial-element-accent));
304
+ }
305
+ .interactive:global([data-catalog-model-ready]) img {
289
306
  opacity: 0;
307
+ /* The GPU replaces the poster in this frame. Fading it would draw a second
308
+ product beneath the moving model when a return transition releases it. */
309
+ transition: filter 180ms ease;
290
310
  }
291
311
  .summary {
292
- position: relative;
312
+ position: absolute;
313
+ left: var(--spatial-carousel-summary-left);
314
+ top: calc(var(--spatial-carousel-title-reserve) - var(--spatial-carousel-compact-height));
315
+ width: var(--spatial-carousel-summary-width);
316
+ height: var(--spatial-carousel-compact-height);
317
+ min-height: 0;
318
+ margin: 0;
319
+ --spatial-carousel-compact-height: 40px;
320
+ box-sizing: border-box;
293
321
 
294
322
  border-radius: var(--carousel-panel-radius, 14px);
295
- padding: 28px;
323
+ padding: 0;
296
324
 
297
- color: var(--spatial-element-ink);
325
+ color: color-mix(in srgb, var(--spatial-element-ink) 92%, transparent);
298
326
  pointer-events: auto;
299
327
  }
300
- .summary::before {
301
- content: '';
302
- position: absolute;
303
- inset: 0;
304
- border-radius: inherit;
305
- background: color-mix(
306
- in srgb,
307
- var(--carousel-panel-tint, white) var(--carousel-panel-tint-opacity, 65%),
308
- transparent
309
- );
310
- border: 1px solid color-mix(in srgb, var(--spatial-element-accent) 12%, transparent);
311
- backdrop-filter: blur(var(--carousel-panel-blur, 5px));
312
- box-shadow: var(--carousel-panel-shadow);
313
- opacity: var(--carousel-panel-opacity, 1);
314
- pointer-events: none;
315
- }
316
- .summary > :global(*) {
317
- position: relative;
318
- opacity: var(--carousel-panel-opacity, 1);
319
- }
320
- :global([data-carousel-glass-ready]) .summary::before {
321
- visibility: hidden;
322
- }
323
328
  .summary[hidden] {
324
329
  display: block;
325
330
  visibility: hidden;
326
331
  }
327
- .eyebrow {
328
- font-weight: 720;
329
- font-size: 13px;
330
- }
331
- h3 {
332
- font-size: clamp(24px, 2.5vw, 36px);
333
- line-height: 1.15;
334
- margin: 12px 0 28px;
335
- }
336
- ul {
337
- padding-left: 20px;
338
- line-height: 1.6;
339
- }
340
- li {
341
- margin: 12px 0;
342
- }
343
- .action {
344
- display: block;
345
- width: 100%;
346
- box-sizing: border-box;
347
- padding: 14px;
348
- margin-top: 24px;
349
- border: 0;
350
- border-radius: 8px;
351
- background: var(--spatial-element-accent);
352
- color: white;
353
- text-align: center;
354
- text-decoration: none;
355
- font: inherit;
356
- font-weight: 650;
357
- }
358
- .information {
359
- display: inline-block;
360
- margin-top: 20px;
361
- color: var(--spatial-element-accent);
362
- }
363
- .information[aria-busy='true'] {
364
- opacity: 0.55;
365
- cursor: progress;
366
- }
367
- .sr-only {
368
- position: absolute;
369
- width: 1px;
370
- height: 1px;
371
- padding: 0;
372
- margin: -1px;
373
- overflow: hidden;
374
- clip-path: inset(50%);
375
- white-space: nowrap;
376
- }
377
- @container (max-width: 700px) {
378
- .interactive .summary {
379
- width: 92%;
380
- }
332
+ .has-eyebrow { --spatial-carousel-compact-height: 66px; }
333
+ [data-carousel-fit-anchor] { position: absolute; left: var(--spatial-carousel-fit-left); top: var(--spatial-carousel-title-reserve); width: var(--spatial-carousel-fit-width); height: var(--spatial-carousel-fit-height); pointer-events: none; }
334
+ @media (min-width: 840px) {
335
+ .summary { top: calc(var(--spatial-carousel-fit-height) / 2); height: auto; max-height: var(--spatial-carousel-fit-height); padding: 0; transform: translateY(-50%); }
381
336
  }
382
- @media (max-width: 850px) {
383
- .carousel-spatial-element {
384
- grid-template-columns: 1fr;
385
- gap: 12px;
386
- }
337
+ @media (prefers-reduced-motion: reduce) {
338
+ img { transition: none; }
387
339
  }
388
340
  </style>
@@ -1,16 +1,20 @@
1
1
  import type { SpatialListItem } from '@spatial-elements/core/spatial-element/types';
2
- import type { CarouselPresentation } from '@spatial-elements/core/catalog/catalogPose';
2
+ import type { CarouselLayout, CarouselPresentation, CarouselEmphasis } from '@spatial-elements/core/catalog/catalogPose';
3
3
  type $$ComponentProps = {
4
4
  spatialElement: SpatialListItem;
5
5
  sectionId: string;
6
6
  presentation?: CarouselPresentation;
7
+ layout: CarouselLayout;
7
8
  index: number;
8
9
  count: number;
9
10
  phase: number;
11
+ emphasis?: CarouselEmphasis;
12
+ focus: number;
10
13
  windowPhase: number;
11
14
  selected: boolean;
12
15
  interactive: boolean;
13
16
  onselect: () => void;
17
+ canActivate: () => boolean;
14
18
  };
15
19
  declare const CarouselSpatialElement: import("svelte").Component<$$ComponentProps, {}, "">;
16
20
  type CarouselSpatialElement = ReturnType<typeof CarouselSpatialElement>;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { ContentBlock as Shared } from '@page-sections/svelte';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+ let { children, class: className = '', ...rest }: Omit<HTMLAttributes<HTMLDivElement>, 'children'> & { children?: Snippet; span?: import('@page-sections/core').ContentSpan; } = $props();
6
+ </script>
7
+ <Shared {...rest} class={['spatial-content-block', className].join(' ')}>{@render children?.()}</Shared>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
4
+ children?: Snippet;
5
+ span?: import('@page-sections/core').ContentSpan;
6
+ };
7
+ declare const ContentBlock: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ContentBlock = ReturnType<typeof ContentBlock>;
9
+ export default ContentBlock;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { ContentGrid as Shared } from '@page-sections/svelte';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+ let { children, class: className = '', ...rest }: Omit<HTMLAttributes<HTMLDivElement>, 'children'> & { children?: Snippet; } = $props();
6
+ </script>
7
+ <Shared {...rest} class={['spatial-content-grid spatial-grid-scope ps-grid-scope', className].join(' ')}>{@render children?.()}</Shared>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
4
+ children?: Snippet;
5
+ };
6
+ declare const ContentGrid: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type ContentGrid = ReturnType<typeof ContentGrid>;
8
+ export default ContentGrid;