@spatial-elements/sveltekit 0.1.0-beta.1 → 1.0.0-beta.10

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 (129) hide show
  1. package/README.md +19 -9
  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 +150 -197
  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 +125 -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/SpatialCardGridSection.svelte +79 -0
  39. package/dist/spatial-element/SpatialCardGridSection.svelte.d.ts +11 -0
  40. package/dist/spatial-element/SpatialCardPresentation.svelte +311 -0
  41. package/dist/spatial-element/SpatialCardPresentation.svelte.d.ts +19 -0
  42. package/dist/spatial-element/SpatialCardSlot.svelte +33 -0
  43. package/dist/spatial-element/SpatialCardSlot.svelte.d.ts +8 -0
  44. package/dist/spatial-element/SpatialCarouselSection.svelte +752 -0
  45. package/dist/spatial-element/{CarouselSection.svelte.d.ts → SpatialCarouselSection.svelte.d.ts} +5 -5
  46. package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +12 -65
  47. package/dist/spatial-element/SpatialElementCard.svelte +54 -238
  48. package/dist/spatial-element/SpatialElementCard.svelte.d.ts +9 -0
  49. package/dist/spatial-element/SpatialElementHelp.svelte +292 -0
  50. package/dist/spatial-element/SpatialElementHelp.svelte.d.ts +6 -0
  51. package/dist/spatial-element/SpatialElementMediaRail.svelte +321 -52
  52. package/dist/spatial-element/SpatialElementMediaRail.svelte.d.ts +4 -1
  53. package/dist/spatial-element/SpatialElementNativeMedia.svelte +101 -0
  54. package/dist/spatial-element/SpatialElementNativeMedia.svelte.d.ts +9 -0
  55. package/dist/spatial-element/SpatialElementPage.svelte +150 -70
  56. package/dist/spatial-element/SpatialElementPage.svelte.d.ts +6 -3
  57. package/dist/spatial-element/SpatialElementStickyHeader.svelte +76 -104
  58. package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +3 -1
  59. package/dist/spatial-element/SpatialElementSummaryContent.svelte +185 -0
  60. package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +18 -0
  61. package/dist/spatial-element/SpatialElementSummaryPanel.svelte +48 -380
  62. package/dist/spatial-element/SpatialElementSummaryPanel.svelte.d.ts +2 -1
  63. package/dist/spatial-element/SpatialElementTabList.svelte +40 -17
  64. package/dist/spatial-element/SpatialElementTabList.svelte.d.ts +2 -1
  65. package/dist/spatial-element/SpatialElementTabs.svelte +61 -18
  66. package/dist/spatial-element/SpatialElementTabs.svelte.d.ts +3 -1
  67. package/dist/spatial-element/SpatialElementViewToggle.svelte +54 -0
  68. package/dist/spatial-element/SpatialElementViewToggle.svelte.d.ts +8 -0
  69. package/dist/spatial-element/SpatialIconButton.svelte +59 -0
  70. package/dist/spatial-element/SpatialIconButton.svelte.d.ts +14 -0
  71. package/dist/spatial-element/SpatialListPage.svelte +37 -8
  72. package/dist/spatial-element/SpatialListPage.svelte.d.ts +4 -1
  73. package/dist/spatial-element/SpatialMediaIndicator.svelte +16 -0
  74. package/dist/spatial-element/SpatialMediaIndicator.svelte.d.ts +26 -0
  75. package/dist/spatial-element/SpatialNavigationShell.svelte +136 -0
  76. package/dist/spatial-element/SpatialNavigationShell.svelte.d.ts +15 -0
  77. package/dist/spatial-element/SpatialSummaryHost.svelte +19 -0
  78. package/dist/spatial-element/SpatialSummaryHost.svelte.d.ts +9 -0
  79. package/dist/spatial-element/SpatialSummaryRoot.svelte +78 -0
  80. package/dist/spatial-element/SpatialSummaryRoot.svelte.d.ts +8 -0
  81. package/dist/spatial-element/SpatialSummarySlot.svelte +39 -0
  82. package/dist/spatial-element/SpatialSummarySlot.svelte.d.ts +9 -0
  83. package/dist/spatial-element/SpatialViewIcon.svelte +29 -0
  84. package/dist/spatial-element/SpatialViewIcon.svelte.d.ts +6 -0
  85. package/dist/spatial-element/brandContext.d.ts +1 -1
  86. package/dist/spatial-element/brandContext.js +1 -1
  87. package/dist/spatial-element/cardAppearanceFreeze.d.ts +5 -0
  88. package/dist/spatial-element/cardAppearanceFreeze.js +72 -0
  89. package/dist/spatial-element/carouselTextHit.d.ts +2 -0
  90. package/dist/spatial-element/carouselTextHit.js +17 -0
  91. package/dist/spatial-element/contentSidebars.d.ts +3 -0
  92. package/dist/spatial-element/contentSidebars.js +56 -0
  93. package/dist/spatial-element/index.d.ts +18 -3
  94. package/dist/spatial-element/index.js +11 -2
  95. package/dist/spatial-element/layout.generated.css +363 -0
  96. package/dist/spatial-element/messagesContext.d.ts +3 -0
  97. package/dist/spatial-element/messagesContext.js +10 -0
  98. package/dist/spatial-element/presentationBoxFreeze.d.ts +8 -0
  99. package/dist/spatial-element/presentationBoxFreeze.js +35 -0
  100. package/dist/spatial-element/spatialCardGrid.d.ts +12 -0
  101. package/dist/spatial-element/spatialCardGrid.js +1 -0
  102. package/dist/spatial-element/spatialPageContext.d.ts +4 -0
  103. package/dist/spatial-element/spatialPageContext.js +9 -0
  104. package/dist/spatial-element/spatialPresentationOwner.d.ts +6 -0
  105. package/dist/spatial-element/spatialPresentationOwner.js +2 -0
  106. package/dist/spatial-element/spatialSummary.d.ts +43 -0
  107. package/dist/spatial-element/spatialSummary.js +1 -0
  108. package/dist/spatial-element/spatialSummaryHost.svelte.d.ts +60 -0
  109. package/dist/spatial-element/spatialSummaryHost.svelte.js +233 -0
  110. package/dist/spatial-element/spatialThemeStyle.d.ts +3 -0
  111. package/dist/spatial-element/spatialThemeStyle.js +69 -0
  112. package/dist/spatial-element/truncatedTitle.d.ts +5 -0
  113. package/dist/spatial-element/truncatedTitle.js +28 -0
  114. package/dist/stage/ButtonGroup.svelte +151 -0
  115. package/dist/stage/ButtonGroup.svelte.d.ts +24 -0
  116. package/dist/stage/Panel.svelte +72 -14
  117. package/dist/stage/Panel.svelte.d.ts +14 -2
  118. package/dist/stage/Stage.svelte +405 -48
  119. package/dist/stage/Stage.svelte.d.ts +8 -1
  120. package/dist/stage/StageViewport.svelte +15 -2
  121. package/dist/stage/authoredStyle.d.ts +4 -0
  122. package/dist/stage/authoredStyle.js +17 -0
  123. package/dist/stage/buttonGroup.d.ts +9 -0
  124. package/dist/stage/buttonGroup.js +1 -0
  125. package/logo.svg +188 -0
  126. package/package.json +9 -6
  127. package/dist/spatial-element/CarouselSection.svelte +0 -350
  128. package/dist/spatial-element/ListSection.svelte +0 -30
  129. package/dist/spatial-element/ListSection.svelte.d.ts +0 -8
@@ -0,0 +1,185 @@
1
+ <script lang="ts">
2
+ import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
3
+ import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
4
+ import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
5
+ import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
6
+ import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
7
+ let { spatialElement, address, contentInset, heading = 'h3', element = $bindable() }: {
8
+ spatialElement: { id: string; eyebrow: string; title: string; features: SpatialElementFeature[]; action?: SpatialElementAction };
9
+ address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
10
+ contentInset: number;
11
+ heading?: 'h1' | 'h3';
12
+ element?: HTMLDivElement;
13
+ } = $props();
14
+ const catalogEndpoint = createCatalogEndpointAction();
15
+ </script>
16
+ <div bind:this={element} class="summary-presentation">
17
+ <div class="panel-copy">
18
+ {#if spatialElement.eyebrow}
19
+ <p
20
+ class="panel-kicker"
21
+ data-shared-role="eyebrow"
22
+ data-spatial-element-id={spatialElement.id}
23
+ use:catalogEndpoint={address('eyebrow')}
24
+ >
25
+ {spatialElement.eyebrow}
26
+ </p>
27
+ {/if}
28
+ <svelte:element this={heading} class="summary-title"
29
+ id={heading === 'h1' ? 'spatial-element-title' : undefined}
30
+ tabindex={heading === 'h1' ? -1 : undefined}
31
+ data-shared-role="title"
32
+ data-spatial-element-id={spatialElement.id}
33
+ use:catalogEndpoint={address('title')}
34
+ >
35
+ {spatialElement.title}
36
+ </svelte:element>
37
+ </div>
38
+
39
+ {#if spatialElement.features.length}<ul
40
+ class="feature-list"
41
+ aria-label="SpatialElement highlights"
42
+ use:catalogEndpoint={address('features')}
43
+ data-catalog-rich-shared="features"
44
+ data-catalog-semantic={JSON.stringify(spatialElement.features)}
45
+ >
46
+ {#each spatialElement.features as feature (feature.label)}
47
+ <li>
48
+ <span class="feature-content" data-catalog-secondary>
49
+ <span class="feature-marker" aria-hidden="true">{feature.marker ?? 'Link'}</span>
50
+ <span>{feature.label}</span>
51
+ </span>
52
+ </li>
53
+ {/each}
54
+ </ul>{/if}
55
+
56
+ {#if spatialElement.action}
57
+ {#if spatialElement.action.href}
58
+ <a
59
+ use:catalogEndpoint={address('primary-action')}
60
+ data-catalog-rich-shared="primary-action"
61
+ data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
62
+ class="spatial-element-action spatial-element-action-expanded"
63
+ href={spatialElement.action.href}
64
+ rel="external"
65
+ aria-label={spatialElement.action.ariaLabel}
66
+ >
67
+ <span class="spatial-element-action-surface" data-catalog-secondary>
68
+ <ShoppingCart
69
+ class="spatial-element-action-icon"
70
+ size={27}
71
+ strokeWidth={2}
72
+ aria-hidden="true"
73
+ />
74
+ <span class="spatial-element-action-label">{spatialElement.action.label}</span>
75
+ </span>
76
+ </a>
77
+ {:else}
78
+ <button
79
+ use:catalogEndpoint={address('primary-action')}
80
+ data-catalog-rich-shared="primary-action"
81
+ data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
82
+ class="spatial-element-action spatial-element-action-expanded"
83
+ type="button"
84
+ aria-label={spatialElement.action.ariaLabel}
85
+ >
86
+ <span class="spatial-element-action-surface" data-catalog-secondary>
87
+ <ShoppingCart
88
+ class="spatial-element-action-icon"
89
+ size={27}
90
+ strokeWidth={2}
91
+ aria-hidden="true"
92
+ />
93
+ <span class="spatial-element-action-label">{spatialElement.action.label}</span>
94
+ </span>
95
+ </button>
96
+ {/if}
97
+ {/if}
98
+ </div>
99
+ <style>
100
+ .summary-presentation {
101
+ position: relative;
102
+ box-sizing: border-box;
103
+ display: flex;
104
+ flex-direction: column;
105
+ gap: 20px;
106
+ /* The same live panel can leave a Section for the stage's detail layer. */
107
+ line-height: 24px;
108
+ pointer-events: auto;
109
+ }
110
+
111
+ .summary-title {
112
+ margin: 10px 0 0;
113
+ font-size: 24px;
114
+ font-weight: 780;
115
+ line-height: 1.16;
116
+ }
117
+
118
+ .panel-kicker {
119
+ margin: 0;
120
+ font-size: 14px;
121
+ font-weight: 720;
122
+ letter-spacing: 0.05em;
123
+ text-transform: uppercase;
124
+ }
125
+
126
+ .feature-list {
127
+ display: grid;
128
+ gap: 12px;
129
+ margin: 0;
130
+ padding: 0;
131
+ color: var(--spatial-element-body);
132
+ font-size: 16px;
133
+ list-style: none;
134
+ }
135
+
136
+ .feature-content {
137
+ display: flex;
138
+ align-items: baseline;
139
+ gap: 14px;
140
+ }
141
+
142
+ .feature-marker {
143
+ color: var(--spatial-element-accent);
144
+ font-weight: 800;
145
+ }
146
+
147
+ .spatial-element-action {
148
+ display: block;
149
+ box-sizing: border-box;
150
+ width: 100%;
151
+ min-height: 62px;
152
+ border: 0;
153
+ padding: 0;
154
+ color: inherit;
155
+ background: transparent;
156
+ text-decoration: none;
157
+ cursor: pointer;
158
+ }
159
+
160
+ .spatial-element-action-surface {
161
+ display: flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ gap: 10px;
165
+ box-sizing: border-box;
166
+ width: 100%;
167
+ min-height: 62px;
168
+ border-radius: 7px;
169
+ color: var(--spatial-element-on-accent);
170
+ background: var(--spatial-element-accent);
171
+ font:
172
+ 760 22px/1 system-ui,
173
+ sans-serif;
174
+ }
175
+
176
+ :global(.spatial-element-action-icon) {
177
+ flex: none;
178
+ }
179
+
180
+ .spatial-element-action-label {
181
+ white-space: normal;
182
+ }
183
+ @container spatial-summary (min-width: 420px) { .summary-title { font-size: 32px; } }
184
+
185
+ </style>
@@ -0,0 +1,18 @@
1
+ import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
2
+ import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
3
+ type $$ComponentProps = {
4
+ spatialElement: {
5
+ id: string;
6
+ eyebrow: string;
7
+ title: string;
8
+ features: SpatialElementFeature[];
9
+ action?: SpatialElementAction;
10
+ };
11
+ address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
12
+ contentInset: number;
13
+ heading?: 'h1' | 'h3';
14
+ element?: HTMLDivElement;
15
+ };
16
+ declare const SpatialElementSummaryContent: import("svelte").Component<$$ComponentProps, {}, "element">;
17
+ type SpatialElementSummaryContent = ReturnType<typeof SpatialElementSummaryContent>;
18
+ export default SpatialElementSummaryContent;
@@ -1,27 +1,51 @@
1
1
  <script lang="ts">
2
- import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
3
- import { ShoppingCart } from 'lucide-svelte';
2
+ import { resolveSpatialThemeRadii } from '@spatial-elements/core/spatial-element/spatialTheme';
3
+ import { onMount } from 'svelte';
4
+ import SpatialSummarySlot from './SpatialSummarySlot.svelte';
4
5
  import Panel from '../stage/Panel.svelte';
5
6
  import { useSpatialTheme } from './brandContext.js';
6
- import type { SpatialElementData } from '@spatial-elements/core/spatial-element/types';
7
- import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
8
-
9
- let { spatialElement }: { spatialElement: SpatialElementData } = $props();
10
- const theme = useSpatialTheme();
11
- const catalogEndpoint = createCatalogEndpointAction();
7
+ import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
8
+
9
+ let { spatialElement, nativeContent = false }: { spatialElement: SpatialElementData; nativeContent?: boolean } = $props();
10
+ const readTheme = useSpatialTheme();
11
+ const theme = $derived(readTheme());
12
+ const radii = $derived(resolveSpatialThemeRadii(theme));
13
+ const contentInset = $derived(theme.panelShape.contentInset ?? Math.max(16, Math.round(theme.panelShape.radius * 0.7)));
14
+ let presentation = $state<HTMLDivElement>(null!);
15
+ let panelHeight = $state<number>();
16
+
17
+ onMount(() => {
18
+ // The stage reparents the rendered content. Keep its layout placeholder in
19
+ // sync using untransformed content size, including wrapping and font loads.
20
+ // Explicit ownership transfers finish their reflow before revealing pixels.
21
+ // offsetHeight is untransformed, unlike the projected CSS3D bounding box.
22
+ const measureTransfer = () => { panelHeight = presentation.offsetHeight + contentInset * 2; };
23
+ measureTransfer();
24
+ presentation.addEventListener('spatial-summary-measure', measureTransfer);
25
+ const observer = new ResizeObserver(([entry]) => {
26
+ const height = entry.borderBoxSize?.[0]?.blockSize ?? presentation.offsetHeight;
27
+ panelHeight = Math.ceil(height + contentInset * 2);
28
+ });
29
+ observer.observe(presentation);
30
+ return () => { observer.disconnect(); presentation.removeEventListener('spatial-summary-measure', measureTransfer); };
31
+ });
12
32
  </script>
13
33
 
14
- <div class="spatial-element-aside">
34
+ <div class="spatial-element-aside" data-spatial-summary-aside style:--summary-panel-height={panelHeight === undefined ? undefined : `${panelHeight}px`}>
15
35
  <Panel
36
+ {nativeContent}
37
+ surface={nativeContent ? 'frosted' : undefined}
16
38
  catalogEndpoint={{
17
39
  brandId: theme.id,
18
40
  spatialElementId: spatialElement.id,
19
41
  slot: 'detail.summary',
20
42
  role: 'summary-surface'
21
43
  }}
44
+ pointerReactive={false}
45
+ focusReactive={!nativeContent}
22
46
  transitionGroup="shared"
23
47
  class="spatial-element-panel"
24
- shape={theme.panelShape}
48
+ shape={{ ...theme.panelShape, radius: radii.panel, contentInset }}
25
49
  theme={theme.panelTheme}
26
50
  contentClass="stage-panel-content spatial-element-content"
27
51
  aria-labelledby="spatial-element-title"
@@ -29,136 +53,27 @@
29
53
  data-shared-role="summary-surface"
30
54
  data-spatial-element-id={spatialElement.id}
31
55
  >
32
- <div class="summary-presentation">
33
- <div class="panel-copy">
34
- <p
35
- class="panel-kicker"
36
- data-shared-role="eyebrow"
37
- data-spatial-element-id={spatialElement.id}
38
- use:catalogEndpoint={{
39
- brandId: theme.id,
40
- spatialElementId: spatialElement.id,
41
- slot: 'detail.summary',
42
- role: 'eyebrow'
43
- }}
44
- >
45
- {spatialElement.eyebrow}
46
- </p>
47
- <h1
48
- id="spatial-element-title"
49
- tabindex="-1"
50
- data-shared-role="title"
51
- data-spatial-element-id={spatialElement.id}
52
- use:catalogEndpoint={{
53
- brandId: theme.id,
54
- spatialElementId: spatialElement.id,
55
- slot: 'detail.summary',
56
- role: 'title'
57
- }}
58
- >
59
- {spatialElement.title}
60
- </h1>
61
- </div>
62
-
63
- <ul
64
- class="feature-list"
65
- aria-label="SpatialElement highlights"
66
- use:catalogEndpoint={{
67
- brandId: theme.id,
68
- spatialElementId: spatialElement.id,
69
- slot: 'detail.summary',
70
- role: 'features'
71
- }}
72
- data-catalog-rich-shared="features"
73
- data-catalog-semantic={JSON.stringify(spatialElement.features)}
74
- >
75
- {#each spatialElement.features as feature (feature.label)}
76
- <li>
77
- <span class="feature-content" data-catalog-secondary>
78
- <span class="feature-marker" aria-hidden="true">{feature.marker ?? 'Link'}</span>
79
- <span>{feature.label}</span>
80
- </span>
81
- </li>
82
- {/each}
83
- </ul>
84
-
85
- {#if spatialElement.action.href}
86
- <a
87
- use:catalogEndpoint={{
88
- brandId: theme.id,
89
- spatialElementId: spatialElement.id,
90
- slot: 'detail.summary',
91
- role: 'primary-action'
92
- }}
93
- data-catalog-rich-shared="primary-action"
94
- data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
95
- class="spatial-element-action spatial-element-action-expanded"
96
- href={spatialElement.action.href}
97
- rel="external"
98
- aria-label={spatialElement.action.ariaLabel}
99
- >
100
- <span class="spatial-element-action-surface" data-catalog-secondary>
101
- <ShoppingCart
102
- class="spatial-element-action-icon"
103
- size={27}
104
- strokeWidth={2}
105
- aria-hidden="true"
106
- />
107
- <span class="spatial-element-action-label">{spatialElement.action.label}</span>
108
- </span>
109
- </a>
110
- {:else}
111
- <button
112
- use:catalogEndpoint={{
113
- brandId: theme.id,
114
- spatialElementId: spatialElement.id,
115
- slot: 'detail.summary',
116
- role: 'primary-action'
117
- }}
118
- data-catalog-rich-shared="primary-action"
119
- data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
120
- class="spatial-element-action spatial-element-action-expanded"
121
- type="button"
122
- aria-label={spatialElement.action.ariaLabel}
123
- >
124
- <span class="spatial-element-action-surface" data-catalog-secondary>
125
- <ShoppingCart
126
- class="spatial-element-action-icon"
127
- size={27}
128
- strokeWidth={2}
129
- aria-hidden="true"
130
- />
131
- <span class="spatial-element-action-label">{spatialElement.action.label}</span>
132
- </span>
133
- </button>
134
- {/if}
135
- </div>
56
+ <SpatialSummarySlot instanceKey={`detail:${theme.id}:${spatialElement.id}`} bind:element={presentation}
57
+ context={{ spatialElement, contentInset, heading: 'h1', mode: 'detail',
58
+ address: (role) => ({ brandId: theme.id, spatialElementId: spatialElement.id, slot: 'detail.summary', role }) }} />
136
59
  </Panel>
137
60
  </div>
138
61
 
139
62
  <style>
140
- @property --summary-feature-hover-progress {
141
- syntax: '<number>';
142
- inherits: false;
143
- initial-value: 0;
144
- }
145
-
146
- @property --summary-action-hover-progress {
147
- syntax: '<number>';
148
- inherits: false;
149
- initial-value: 0;
150
- }
151
-
152
63
  .spatial-element-aside {
153
- min-height: inherit;
64
+ position: relative;
65
+ min-width: 0;
66
+ width: var(--spatial-detail-summary-width);
67
+ margin-top: var(--spatial-detail-summary-gap);
68
+ margin-inline: auto;
154
69
  }
155
70
 
156
71
  :global(.spatial-element-panel) {
157
72
  position: relative;
158
- top: 0;
159
- width: min(494px, 100%);
160
- height: 504px;
161
- min-height: 504px;
73
+ width: 100%;
74
+ height: var(--summary-panel-height, auto);
75
+ max-height: var(--spatial-detail-summary-max-height);
76
+ min-height: 0;
162
77
  pointer-events: auto;
163
78
  }
164
79
 
@@ -167,257 +82,10 @@
167
82
  display: block;
168
83
  overflow: visible;
169
84
  color: color-mix(in srgb, var(--spatial-element-ink) 92%, transparent);
170
- transform-style: preserve-3d;
171
- }
172
-
173
- .summary-presentation {
174
- --summary-depth-progress: var(--stage-panel-pointer-proximity, 0);
175
- --summary-shadow-strength: var(--stage-panel-shadow-strength, 0.18);
176
- --summary-feature-depth: 40;
177
- --summary-feature-hover-depth: 48;
178
- --summary-eyebrow-depth: 60;
179
- --summary-title-depth: 96;
180
- --summary-action-depth: 76;
181
- --summary-action-hover-depth: 24;
182
-
183
- position: absolute;
184
- inset: 0;
185
- box-sizing: border-box;
186
- display: flex;
187
- flex-direction: column;
188
- justify-content: space-between;
189
- gap: 24px;
190
- pointer-events: auto;
191
- transform-style: preserve-3d;
192
- }
193
-
194
- .panel-copy {
195
- transform-style: preserve-3d;
196
- }
197
-
198
- .summary-presentation h1 {
199
- max-width: 390px;
200
- margin: 10px 0 0;
201
- font-size: clamp(30px, 3vw, 40px);
202
- font-weight: 780;
203
- line-height: 1.16;
204
- transform-origin: left center;
205
- will-change: transform;
206
- }
207
-
208
- .panel-kicker {
209
- margin: 0;
210
- font-size: 14px;
211
- font-weight: 720;
212
- letter-spacing: 0.05em;
213
- text-transform: uppercase;
214
- transform-origin: left center;
215
- will-change: transform;
216
- }
217
-
218
- .feature-list {
219
- display: grid;
220
- gap: 20px;
221
- margin: 0;
222
- padding: 0;
223
- color: var(--spatial-element-body);
224
- font-size: 18px;
225
- list-style: none;
226
- transform-style: preserve-3d;
227
- }
228
-
229
- .feature-list li {
230
- transform-style: preserve-3d;
231
- }
232
-
233
- .feature-content {
234
- --summary-feature-hover-progress: 0;
235
- --summary-feature-effective-depth: calc(
236
- var(--summary-feature-depth) * var(--summary-depth-progress) +
237
- var(--summary-feature-hover-depth) * var(--summary-feature-hover-progress)
238
- );
239
- --summary-feature-shadow-depth: calc(
240
- var(--summary-feature-depth) * var(--summary-depth-progress)
241
- );
242
-
243
- display: flex;
244
- align-items: baseline;
245
- gap: 14px;
246
- text-shadow:
247
- 0 calc(0.055px * var(--summary-feature-shadow-depth))
248
- calc(0.055px * var(--summary-feature-shadow-depth))
249
- rgb(
250
- 0 0 0 /
251
- calc(0.0168 * var(--summary-shadow-strength) * var(--summary-feature-shadow-depth))
252
- ),
253
- 0 calc(0.194px * var(--summary-feature-shadow-depth))
254
- calc(0.278px * var(--summary-feature-shadow-depth))
255
- rgb(
256
- 0 0 0 /
257
- calc(0.00936 * var(--summary-shadow-strength) * var(--summary-feature-shadow-depth))
258
- );
259
- transform: translateZ(calc(1px * var(--summary-feature-effective-depth)));
260
- transform-origin: left center;
261
- transition: --summary-feature-hover-progress 260ms cubic-bezier(0.22, 0.75, 0.25, 1);
262
- will-change: transform;
263
- }
264
-
265
- .feature-list li:hover .feature-content {
266
- --summary-feature-hover-progress: 1;
267
- }
268
-
269
- .feature-marker {
270
- color: var(--spatial-element-accent);
271
- font-weight: 800;
272
85
  }
273
86
 
274
- .spatial-element-action {
275
- display: block;
276
- box-sizing: border-box;
277
- width: 100%;
278
- min-height: 62px;
279
- border: 0;
280
- padding: 0;
281
- color: inherit;
282
- background: transparent;
283
- text-decoration: none;
284
- cursor: pointer;
285
- transform-style: preserve-3d;
286
- }
287
-
288
- .spatial-element-action:is(:hover, :focus-visible) .spatial-element-action-surface {
289
- --summary-action-hover-progress: 1;
290
- }
291
-
292
- .spatial-element-action-surface {
293
- --summary-action-hover-progress: 0;
294
-
295
- display: flex;
296
- align-items: center;
297
- justify-content: center;
298
- gap: 10px;
299
- box-sizing: border-box;
300
- width: 100%;
301
- min-height: 62px;
302
- border-radius: 7px;
303
- color: var(--spatial-element-on-accent);
304
- background: var(--spatial-element-accent);
305
- font:
306
- 760 22px/1 system-ui,
307
- sans-serif;
308
- transform-origin: center;
309
- transition: --summary-action-hover-progress 260ms cubic-bezier(0.22, 0.75, 0.25, 1);
310
- will-change: transform;
311
- }
312
-
313
- .panel-kicker {
314
- --summary-eyebrow-effective-depth: calc(
315
- var(--summary-eyebrow-depth) * var(--summary-depth-progress)
316
- );
317
-
318
- text-shadow:
319
- 0 calc(0.055px * var(--summary-eyebrow-effective-depth))
320
- calc(0.04px * var(--summary-eyebrow-effective-depth))
321
- rgb(
322
- 0 0 0 /
323
- calc(0.0134 * var(--summary-shadow-strength) * var(--summary-eyebrow-effective-depth))
324
- ),
325
- 0 calc(0.117px * var(--summary-eyebrow-effective-depth))
326
- calc(0.167px * var(--summary-eyebrow-effective-depth))
327
- rgb(
328
- 0 0 0 /
329
- calc(0.0074 * var(--summary-shadow-strength) * var(--summary-eyebrow-effective-depth))
330
- );
331
- transform: translateZ(calc(1px * var(--summary-eyebrow-effective-depth)));
332
- }
333
-
334
- .summary-presentation h1 {
335
- --summary-title-effective-depth: calc(
336
- var(--summary-title-depth) * var(--summary-depth-progress)
337
- );
338
-
339
- text-shadow:
340
- 0 calc(0.055px * var(--summary-title-effective-depth))
341
- calc(0.04px * var(--summary-title-effective-depth))
342
- rgb(
343
- 0 0 0 /
344
- calc(0.007 * var(--summary-shadow-strength) * var(--summary-title-effective-depth))
345
- ),
346
- 0 calc(0.156px * var(--summary-title-effective-depth))
347
- calc(0.203px * var(--summary-title-effective-depth))
348
- rgb(
349
- 0 0 0 /
350
- calc(0.0039 * var(--summary-shadow-strength) * var(--summary-title-effective-depth))
351
- );
352
- transform: translateZ(calc(1px * var(--summary-title-effective-depth)));
353
- }
354
-
355
- .spatial-element-action-surface {
356
- --summary-action-effective-depth: calc(
357
- var(--summary-action-depth) * var(--summary-depth-progress) +
358
- var(--summary-action-hover-depth) * var(--summary-action-hover-progress)
359
- );
360
-
361
- box-shadow:
362
- 0 calc(0.078px * var(--summary-action-effective-depth))
363
- calc(0.094px * var(--summary-action-effective-depth))
364
- rgb(
365
- 0 0 0 /
366
- calc(0.0105 * var(--summary-shadow-strength) * var(--summary-action-effective-depth))
367
- ),
368
- 0 calc(0.237px * var(--summary-action-effective-depth))
369
- calc(0.316px * var(--summary-action-effective-depth))
370
- rgb(
371
- 0 0 0 /
372
- calc(0.0068 * var(--summary-shadow-strength) * var(--summary-action-effective-depth))
373
- );
374
- transform: translateZ(calc(1px * var(--summary-action-effective-depth)));
375
- }
376
-
377
- :global(.spatial-element-action-icon) {
378
- flex: none;
379
- }
380
-
381
- .spatial-element-action-label {
382
- white-space: nowrap;
383
- }
384
-
385
- /* Zero-depth transforms still promote text to composited layers in Chromium.
386
- * Remove those layers while the complete panel is in its native DOM rest mode. */
387
- :global([data-stage-panel-render-mode='native']) .summary-presentation,
388
- :global([data-stage-panel-render-mode='native']) .panel-copy,
389
- :global([data-stage-panel-render-mode='native']) .feature-list,
390
- :global([data-stage-panel-render-mode='native']) .feature-list li,
391
- :global([data-stage-panel-render-mode='native']) .spatial-element-action {
392
- transform-style: flat;
393
- }
394
-
395
- :global([data-stage-panel-render-mode='native']) .panel-kicker,
396
- :global([data-stage-panel-render-mode='native']) .summary-presentation h1,
397
- :global([data-stage-panel-render-mode='native']) .feature-content,
398
- :global([data-stage-panel-render-mode='native']) .spatial-element-action-surface {
399
- transform: none;
400
- will-change: auto;
401
- }
402
-
403
- @media (prefers-reduced-motion: reduce) {
404
- .summary-presentation {
405
- --summary-depth-progress: 0;
406
- }
407
-
408
- .feature-content,
409
- .feature-list li:hover .feature-content,
410
- .spatial-element-action-surface,
411
- .spatial-element-action:is(:hover, :focus-visible) .spatial-element-action-surface {
412
- --summary-feature-hover-progress: 0;
413
- --summary-action-hover-progress: 0;
414
- transition: none;
415
- }
416
- }
417
87
 
418
- @media (max-width: 1100px) {
419
- :global(.spatial-element-panel) {
420
- top: auto;
421
- }
88
+ @media (min-width: 840px) {
89
+ .spatial-element-aside { position: absolute; top: 0; right: var(--spatial-detail-summary-right); margin: 0; }
422
90
  }
423
91
  </style>
@@ -1,6 +1,7 @@
1
- import type { SpatialElementData } from '@spatial-elements/core/spatial-element/types';
1
+ import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
2
2
  type $$ComponentProps = {
3
3
  spatialElement: SpatialElementData;
4
+ nativeContent?: boolean;
4
5
  };
5
6
  declare const SpatialElementSummaryPanel: import("svelte").Component<$$ComponentProps, {}, "">;
6
7
  type SpatialElementSummaryPanel = ReturnType<typeof SpatialElementSummaryPanel>;