@spatial-elements/sveltekit 1.0.0-beta.10 → 1.0.0-beta.12
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/dist/spatial-element/BrandStageShell.svelte +1 -1
- package/dist/spatial-element/BrandStageShell.svelte.d.ts +1 -1
- package/dist/spatial-element/CarouselSpatialElement.svelte +3 -4
- package/dist/spatial-element/OverflowControls.svelte +5 -1
- package/dist/spatial-element/SpaceMouseControl.svelte +168 -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/SpatialCarouselSection.svelte +4 -2
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte +26 -2
- package/dist/spatial-element/SpatialElementBreadcrumbs.svelte.d.ts +1 -0
- package/dist/spatial-element/SpatialElementHelp.svelte +18 -10
- package/dist/spatial-element/SpatialElementMediaRail.svelte +14 -5
- package/dist/spatial-element/SpatialElementPage.svelte +19 -6
- package/dist/spatial-element/SpatialElementPage.svelte.d.ts +5 -0
- package/dist/spatial-element/SpatialElementStickyHeader.svelte +28 -8
- package/dist/spatial-element/SpatialElementStickyHeader.svelte.d.ts +3 -0
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +35 -8
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +5 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +3 -1
- package/dist/spatial-element/SpatialIconButton.svelte +19 -5
- package/dist/spatial-element/SpatialIconButton.svelte.d.ts +3 -0
- package/dist/spatial-element/SpatialNavigationShell.svelte +9 -4
- package/dist/spatial-element/SpatialSummaryRoot.svelte +6 -4
- package/dist/spatial-element/SpatialViewIcon.svelte +1 -1
- package/dist/spatial-element/headerFields.css +21 -0
- package/dist/spatial-element/index.d.ts +1 -0
- package/dist/spatial-element/index.js +1 -0
- package/dist/spatial-element/layout.generated.css +8 -7
- package/dist/stage/ButtonGroup.svelte +2 -1
- package/dist/stage/Panel.svelte +6 -0
- package/dist/stage/Stage.svelte +73 -7
- package/logo.svg +90 -53
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
3
4
|
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
4
5
|
import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
|
|
@@ -8,9 +9,11 @@
|
|
|
8
9
|
import type { SpatialElementSectionNavigationItem } from '@spatial-elements/core/spatial-element/types';
|
|
9
10
|
|
|
10
11
|
let {
|
|
11
|
-
spatialElement,
|
|
12
|
+
spatialElement, headerDetails, actionIcon
|
|
12
13
|
}: {
|
|
13
14
|
activeSectionId?: string;
|
|
15
|
+
headerDetails?: Snippet;
|
|
16
|
+
actionIcon?: Snippet;
|
|
14
17
|
spatialElement: SpatialElementData;
|
|
15
18
|
sections: SpatialElementSectionNavigationItem[];
|
|
16
19
|
} = $props();
|
|
@@ -25,6 +28,7 @@
|
|
|
25
28
|
<header
|
|
26
29
|
class="spatial-element-sticky-header"
|
|
27
30
|
data-spatial-element-sticky-header
|
|
31
|
+
data-spatial-element-handoff-header
|
|
28
32
|
data-catalog-transition-dom="enter"
|
|
29
33
|
aria-label="Current element"
|
|
30
34
|
aria-hidden="true"
|
|
@@ -51,6 +55,7 @@
|
|
|
51
55
|
></a>
|
|
52
56
|
|
|
53
57
|
<div class="sticky-header-layout">
|
|
58
|
+
<div class="sticky-header-content" class:has-details={!!headerDetails}>
|
|
54
59
|
<div class="sticky-header-copy">
|
|
55
60
|
{#if spatialElement.eyebrow}
|
|
56
61
|
<p
|
|
@@ -78,6 +83,8 @@
|
|
|
78
83
|
</p>
|
|
79
84
|
</div>
|
|
80
85
|
|
|
86
|
+
{#if headerDetails}<div class="sticky-header-details">{@render headerDetails()}</div>{/if}
|
|
87
|
+
</div>
|
|
81
88
|
{#if spatialElement.action}
|
|
82
89
|
{#if spatialElement.action.href}
|
|
83
90
|
<a
|
|
@@ -95,7 +102,7 @@
|
|
|
95
102
|
rel="external"
|
|
96
103
|
aria-label={spatialElement.action.ariaLabel ?? spatialElement.action.label}
|
|
97
104
|
>
|
|
98
|
-
<ShoppingCart size={29} strokeWidth={2} aria-hidden="true" />
|
|
105
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart size={29} strokeWidth={2} aria-hidden="true" />{/if}
|
|
99
106
|
</a>
|
|
100
107
|
{:else}
|
|
101
108
|
<button
|
|
@@ -112,7 +119,7 @@
|
|
|
112
119
|
type="button"
|
|
113
120
|
aria-label={spatialElement.action.ariaLabel ?? spatialElement.action.label}
|
|
114
121
|
>
|
|
115
|
-
<ShoppingCart size={29} strokeWidth={2} aria-hidden="true" />
|
|
122
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart size={29} strokeWidth={2} aria-hidden="true" />{/if}
|
|
116
123
|
</button>
|
|
117
124
|
{/if}
|
|
118
125
|
{/if}
|
|
@@ -146,7 +153,7 @@
|
|
|
146
153
|
width: 100%;
|
|
147
154
|
height: var(--spatial-detail-dock-height);
|
|
148
155
|
border: 0;
|
|
149
|
-
border-radius:
|
|
156
|
+
border-radius: 0;
|
|
150
157
|
visibility: hidden;
|
|
151
158
|
background: transparent;
|
|
152
159
|
box-shadow: none;
|
|
@@ -266,7 +273,10 @@
|
|
|
266
273
|
z-index: 1;
|
|
267
274
|
}
|
|
268
275
|
|
|
276
|
+
.sticky-header-content { container: spatial-header / inline-size; display: flex; align-items: center; gap: 16px; min-width: 0; }
|
|
277
|
+
.sticky-header-details { flex: none; }
|
|
269
278
|
.sticky-header-copy {
|
|
279
|
+
flex: 1;
|
|
270
280
|
display: grid;
|
|
271
281
|
gap: 0;
|
|
272
282
|
min-width: 0;
|
|
@@ -297,11 +307,10 @@
|
|
|
297
307
|
}
|
|
298
308
|
|
|
299
309
|
.sticky-header-action {
|
|
300
|
-
visibility: hidden;
|
|
301
310
|
display: grid;
|
|
302
311
|
place-items: center;
|
|
303
|
-
width:
|
|
304
|
-
height:
|
|
312
|
+
width: 54px;
|
|
313
|
+
height: 54px;
|
|
305
314
|
padding: 0;
|
|
306
315
|
border: 0;
|
|
307
316
|
border-radius: var(--spatial-element-control-radius);
|
|
@@ -310,8 +319,10 @@
|
|
|
310
319
|
text-decoration: none;
|
|
311
320
|
cursor: pointer;
|
|
312
321
|
}
|
|
313
|
-
.spatial-element-sticky-header:global([data-action-active]) .sticky-header-action { visibility: visible; }
|
|
314
322
|
|
|
323
|
+
@media (1600px <= width < 2300px) {
|
|
324
|
+
.spatial-element-sticky-header { border-radius: 0 0 var(--spatial-element-panel-radius) var(--spatial-element-panel-radius); }
|
|
325
|
+
}
|
|
315
326
|
@media (width < 840px) {
|
|
316
327
|
.sticky-header-layout {
|
|
317
328
|
gap: 8px;
|
|
@@ -320,4 +331,13 @@
|
|
|
320
331
|
.sticky-header-title { font-size: 18px; line-height: 24px; }
|
|
321
332
|
.spatial-element-sticky-tabs { display: none; }
|
|
322
333
|
}
|
|
334
|
+
@container spatial-header (max-width: 479px) {
|
|
335
|
+
.sticky-header-details :global([data-spatial-element-header-field='quantity']) { display: none; }
|
|
336
|
+
}
|
|
337
|
+
@container spatial-header (max-width: 359px) {
|
|
338
|
+
.sticky-header-details { display: none; }
|
|
339
|
+
}
|
|
340
|
+
@media (width < 600px) {
|
|
341
|
+
.sticky-header-details { display: none; }
|
|
342
|
+
}
|
|
323
343
|
</style>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
2
3
|
import './layout.generated.css';
|
|
3
4
|
import type { SpatialElementSectionNavigationItem } from '@spatial-elements/core/spatial-element/types';
|
|
4
5
|
type $$ComponentProps = {
|
|
5
6
|
activeSectionId?: string;
|
|
7
|
+
headerDetails?: Snippet;
|
|
8
|
+
actionIcon?: Snippet;
|
|
6
9
|
spatialElement: SpatialElementData;
|
|
7
10
|
sections: SpatialElementSectionNavigationItem[];
|
|
8
11
|
};
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
2
3
|
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
3
4
|
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
4
5
|
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
5
6
|
import ShoppingCart from 'lucide-svelte/icons/shopping-cart';
|
|
6
7
|
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
7
|
-
let { spatialElement, address, contentInset, heading = 'h3', element = $bindable() }: {
|
|
8
|
+
let { spatialElement, address, contentInset, heading = 'h3', leading, beforeAction, actionIcon, element = $bindable() }: {
|
|
8
9
|
spatialElement: { id: string; eyebrow: string; title: string; features: SpatialElementFeature[]; action?: SpatialElementAction };
|
|
9
10
|
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
10
11
|
contentInset: number;
|
|
11
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;
|
|
12
17
|
element?: HTMLDivElement;
|
|
13
18
|
} = $props();
|
|
14
19
|
const catalogEndpoint = createCatalogEndpointAction();
|
|
15
20
|
</script>
|
|
16
21
|
<div bind:this={element} class="summary-presentation">
|
|
22
|
+
{#if leading}<div class="summary-leading" use:catalogEndpoint={address('leading')}
|
|
23
|
+
data-catalog-rich-shared="leading" data-catalog-semantic={spatialElement.id}>
|
|
24
|
+
{@render leading()}
|
|
25
|
+
</div>{/if}
|
|
17
26
|
<div class="panel-copy">
|
|
18
27
|
{#if spatialElement.eyebrow}
|
|
19
28
|
<p
|
|
@@ -53,6 +62,11 @@
|
|
|
53
62
|
{/each}
|
|
54
63
|
</ul>{/if}
|
|
55
64
|
|
|
65
|
+
{#if beforeAction || spatialElement.action}<div class="summary-commerce">
|
|
66
|
+
{#if beforeAction}<div use:catalogEndpoint={address('action-details')}
|
|
67
|
+
data-catalog-rich-shared="action-details" data-catalog-semantic={spatialElement.id}>
|
|
68
|
+
{@render beforeAction()}
|
|
69
|
+
</div>{/if}
|
|
56
70
|
{#if spatialElement.action}
|
|
57
71
|
{#if spatialElement.action.href}
|
|
58
72
|
<a
|
|
@@ -65,12 +79,12 @@
|
|
|
65
79
|
aria-label={spatialElement.action.ariaLabel}
|
|
66
80
|
>
|
|
67
81
|
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
68
|
-
<ShoppingCart
|
|
82
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart
|
|
69
83
|
class="spatial-element-action-icon"
|
|
70
84
|
size={27}
|
|
71
85
|
strokeWidth={2}
|
|
72
86
|
aria-hidden="true"
|
|
73
|
-
/>
|
|
87
|
+
/>{/if}
|
|
74
88
|
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
75
89
|
</span>
|
|
76
90
|
</a>
|
|
@@ -84,17 +98,18 @@
|
|
|
84
98
|
aria-label={spatialElement.action.ariaLabel}
|
|
85
99
|
>
|
|
86
100
|
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
87
|
-
<ShoppingCart
|
|
101
|
+
{#if actionIcon}{@render actionIcon()}{:else}<ShoppingCart
|
|
88
102
|
class="spatial-element-action-icon"
|
|
89
103
|
size={27}
|
|
90
104
|
strokeWidth={2}
|
|
91
105
|
aria-hidden="true"
|
|
92
|
-
/>
|
|
106
|
+
/>{/if}
|
|
93
107
|
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
94
108
|
</span>
|
|
95
109
|
</button>
|
|
96
110
|
{/if}
|
|
97
111
|
{/if}
|
|
112
|
+
</div>{/if}
|
|
98
113
|
</div>
|
|
99
114
|
<style>
|
|
100
115
|
.summary-presentation {
|
|
@@ -114,6 +129,8 @@
|
|
|
114
129
|
font-weight: 780;
|
|
115
130
|
line-height: 1.16;
|
|
116
131
|
}
|
|
132
|
+
.summary-commerce { display: grid; gap: 20px; min-width: 0; align-content: start; }
|
|
133
|
+
.summary-leading, .panel-copy { min-width: 0; }
|
|
117
134
|
|
|
118
135
|
.panel-kicker {
|
|
119
136
|
margin: 0;
|
|
@@ -148,7 +165,7 @@
|
|
|
148
165
|
display: block;
|
|
149
166
|
box-sizing: border-box;
|
|
150
167
|
width: 100%;
|
|
151
|
-
min-height:
|
|
168
|
+
min-height: 54px;
|
|
152
169
|
border: 0;
|
|
153
170
|
padding: 0;
|
|
154
171
|
color: inherit;
|
|
@@ -164,8 +181,8 @@
|
|
|
164
181
|
gap: 10px;
|
|
165
182
|
box-sizing: border-box;
|
|
166
183
|
width: 100%;
|
|
167
|
-
min-height:
|
|
168
|
-
border-radius: 7px;
|
|
184
|
+
min-height: 54px;
|
|
185
|
+
border-radius: var(--spatial-element-control-radius, 7px);
|
|
169
186
|
color: var(--spatial-element-on-accent);
|
|
170
187
|
background: var(--spatial-element-accent);
|
|
171
188
|
font:
|
|
@@ -181,5 +198,15 @@
|
|
|
181
198
|
white-space: normal;
|
|
182
199
|
}
|
|
183
200
|
@container spatial-summary (min-width: 420px) { .summary-title { font-size: 32px; } }
|
|
201
|
+
@container spatial-summary (min-width: 500px) {
|
|
202
|
+
.feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
203
|
+
.summary-commerce { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
|
|
204
|
+
}
|
|
205
|
+
@container spatial-summary (min-width: 900px) {
|
|
206
|
+
.summary-presentation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
|
|
207
|
+
.summary-leading, .panel-copy { grid-column: 1 / -1; }
|
|
208
|
+
.feature-list { grid-column: span 2; }
|
|
209
|
+
.summary-commerce { grid-column: 3; grid-template-columns: minmax(0, 1fr); }
|
|
210
|
+
}
|
|
184
211
|
|
|
185
212
|
</style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
1
2
|
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
2
3
|
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
3
4
|
type $$ComponentProps = {
|
|
@@ -11,6 +12,10 @@ type $$ComponentProps = {
|
|
|
11
12
|
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
12
13
|
contentInset: number;
|
|
13
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;
|
|
14
19
|
element?: HTMLDivElement;
|
|
15
20
|
};
|
|
16
21
|
declare const SpatialElementSummaryContent: import("svelte").Component<$$ComponentProps, {}, "element">;
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
// sync using untransformed content size, including wrapping and font loads.
|
|
20
20
|
// Explicit ownership transfers finish their reflow before revealing pixels.
|
|
21
21
|
// offsetHeight is untransformed, unlike the projected CSS3D bounding box.
|
|
22
|
-
const measureTransfer = () => { panelHeight = presentation.offsetHeight + contentInset * 2; };
|
|
22
|
+
const measureTransfer = () => { if (!presentation.getClientRects().length) return; panelHeight = presentation.offsetHeight + contentInset * 2; };
|
|
23
23
|
measureTransfer();
|
|
24
24
|
presentation.addEventListener('spatial-summary-measure', measureTransfer);
|
|
25
25
|
const observer = new ResizeObserver(([entry]) => {
|
|
26
|
+
// CSS3D culling sets display:none; this is not a content resize.
|
|
27
|
+
if (!presentation.getClientRects().length) return;
|
|
26
28
|
const height = entry.borderBoxSize?.[0]?.blockSize ?? presentation.offsetHeight;
|
|
27
29
|
panelHeight = Math.ceil(height + contentInset * 2);
|
|
28
30
|
});
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
import Panel from '../stage/Panel.svelte';
|
|
6
6
|
import { useSpatialTheme } from './brandContext.js';
|
|
7
7
|
|
|
8
|
-
let { label, children, onclick, expanded, controls, focusAnchor, enabled = true, element = $bindable() }: {
|
|
8
|
+
let { label, children, onclick, pressed, busy, expanded, controls, focusAnchor, wide = false, enabled = true, element = $bindable() }: {
|
|
9
9
|
label: string;
|
|
10
10
|
children: Snippet;
|
|
11
11
|
onclick: (event: MouseEvent) => void;
|
|
12
|
+
pressed?: boolean;
|
|
13
|
+
busy?: boolean;
|
|
12
14
|
expanded?: boolean;
|
|
13
15
|
controls?: string;
|
|
14
16
|
focusAnchor?: HTMLElement;
|
|
17
|
+
wide?: boolean;
|
|
15
18
|
enabled?: boolean;
|
|
16
19
|
element?: HTMLButtonElement;
|
|
17
20
|
} = $props();
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
const radii = $derived(resolveSpatialThemeRadii(theme));
|
|
21
24
|
</script>
|
|
22
25
|
|
|
23
|
-
<div class="icon-frame">
|
|
26
|
+
<div class="icon-frame" class:wide data-spatial-control={label}>
|
|
24
27
|
<Panel
|
|
25
28
|
class="spatial-icon-panel"
|
|
26
29
|
shape={{ radius: radii.control, contentInset: 0 }}
|
|
@@ -34,8 +37,8 @@
|
|
|
34
37
|
<button bind:this={element} use:mouseHover type="button" {onclick} aria-label={label} title={label}
|
|
35
38
|
disabled={!enabled}
|
|
36
39
|
style:visibility={enabled ? 'visible' : 'hidden'}
|
|
37
|
-
aria-expanded={expanded} aria-controls={controls} aria-haspopup={controls ? 'dialog' : undefined}
|
|
38
|
-
class="spatial-icon-button">
|
|
40
|
+
aria-pressed={pressed} aria-busy={busy || undefined} aria-expanded={expanded} aria-controls={controls} aria-haspopup={controls ? 'dialog' : undefined}
|
|
41
|
+
class="spatial-icon-button" class:wide>
|
|
39
42
|
{@render children()}
|
|
40
43
|
</button>
|
|
41
44
|
</Panel>
|
|
@@ -43,17 +46,28 @@
|
|
|
43
46
|
|
|
44
47
|
<style>
|
|
45
48
|
.icon-frame { width: 40px; height: 40px; flex: 0 0 40px; }
|
|
49
|
+
.icon-frame.wide { width: 104px; flex-basis: 104px; }
|
|
50
|
+
.icon-frame.wide :global(.spatial-icon-panel), .spatial-icon-button.wide { width: 104px; }
|
|
46
51
|
/* The renderer moves panel contents into its projection layer; retain the anchor size. */
|
|
47
52
|
.icon-frame :global(.spatial-icon-panel) { width: 40px; height: 40px; }
|
|
48
53
|
.spatial-icon-button {
|
|
49
54
|
box-sizing: border-box; display: grid; place-items: center; width: 40px; height: 40px;
|
|
50
55
|
padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); background: transparent;
|
|
56
|
+
font: inherit; font-size: 13px;
|
|
51
57
|
color: var(--spatial-element-ink); cursor: pointer; touch-action: manipulation;
|
|
52
58
|
transition: background-color 180ms ease;
|
|
53
59
|
}
|
|
54
60
|
.spatial-icon-button:global([data-mouse-hover]):hover {
|
|
55
61
|
background: color-mix(in srgb, var(--spatial-element-body) 8%, transparent);
|
|
56
62
|
}
|
|
63
|
+
.spatial-icon-button[aria-pressed="true"] { color: var(--spatial-element-accent); background: var(--ps-selection, var(--ps-section-muted, #eeeeee)); }
|
|
64
|
+
/* Busy remains operable so a pending device search can be cancelled. */
|
|
65
|
+
.spatial-icon-button[aria-busy="true"] { color: var(--spatial-element-accent); background: var(--ps-selection, var(--ps-section-muted, #eeeeee)); }
|
|
66
|
+
.spatial-icon-button[aria-busy="true"] :global(svg) { animation: searching 1.2s ease-in-out infinite; }
|
|
67
|
+
@keyframes searching { 50% { opacity: 0.35; } }
|
|
57
68
|
.spatial-icon-button:focus-visible { outline: 2px solid var(--spatial-element-accent); outline-offset: 3px; }
|
|
58
|
-
@media (prefers-reduced-motion: reduce) {
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
.spatial-icon-button { transition: none; }
|
|
71
|
+
.spatial-icon-button[aria-busy="true"] :global(svg) { animation: none; opacity: 0.6; }
|
|
72
|
+
}
|
|
59
73
|
</style>
|
|
@@ -3,9 +3,12 @@ type $$ComponentProps = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
children: Snippet;
|
|
5
5
|
onclick: (event: MouseEvent) => void;
|
|
6
|
+
pressed?: boolean;
|
|
7
|
+
busy?: boolean;
|
|
6
8
|
expanded?: boolean;
|
|
7
9
|
controls?: string;
|
|
8
10
|
focusAnchor?: HTMLElement;
|
|
11
|
+
wide?: boolean;
|
|
9
12
|
enabled?: boolean;
|
|
10
13
|
element?: HTMLButtonElement;
|
|
11
14
|
};
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
const stageContext = getContext<StageContext | undefined>(STAGE_CONTEXT_KEY);
|
|
16
16
|
const readTheme = useSpatialTheme();
|
|
17
17
|
const theme = $derived(readTheme());
|
|
18
|
-
$effect(() => { void theme; void fixedDetail; stageContext?.updatePanelAppearance?.(); });
|
|
18
|
+
$effect(() => { void theme; void fixedDetail; void edgeToEdge; stageContext?.updatePanelAppearance?.(); });
|
|
19
19
|
const radii = $derived(resolveSpatialThemeRadii(theme));
|
|
20
20
|
let rack: HTMLDivElement;
|
|
21
21
|
let stage: HTMLElement | undefined;
|
|
22
22
|
let enhancedScroll = false;
|
|
23
23
|
let satellitesVisible = false;
|
|
24
24
|
let fixedDetail = $state(false);
|
|
25
|
+
let edgeToEdge = $state(true);
|
|
25
26
|
|
|
26
27
|
function position(scrollY = getStageVisualScrollPosition().scrollY) {
|
|
27
28
|
if (!rack) return;
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
const previousMode = `${enhancedScroll}/${fixedDetail}`;
|
|
37
38
|
enhancedScroll = stage.classList.contains('stage-virtual-scroll-active');
|
|
38
39
|
satellitesVisible = window.innerWidth >= layoutTokens.layoutMinWidths.xl;
|
|
40
|
+
edgeToEdge = !satellitesVisible;
|
|
39
41
|
fixedDetail = getComputedStyle(rack).getPropertyValue('--spatial-shell-fixed').trim() === '1';
|
|
40
42
|
position();
|
|
41
43
|
if (previousMode !== `${enhancedScroll}/${fixedDetail}`) window.dispatchEvent(new Event(STAGE_PANEL_LAYOUT_EVENT));
|
|
@@ -97,9 +99,9 @@
|
|
|
97
99
|
getNativeContent: () => true, getVisible: () => role === 'menu' || satellitesVisible,
|
|
98
100
|
getMinimapOptions: () => undefined, getMinimapDockProgress: () => 0,
|
|
99
101
|
getMinimapModelScale: () => 1, getMinimapModelTop: () => undefined,
|
|
100
|
-
getSurface: () =>
|
|
102
|
+
getSurface: () => theme.panelTheme.surface ?? 'frosted',
|
|
101
103
|
getSurfaceOpacity: () => 1,
|
|
102
|
-
getOptions: () => ({ ...theme.panelTheme, radius: role === 'menu' ? radii.panel : radii.control })
|
|
104
|
+
getOptions: () => ({ ...theme.panelTheme, radius: role === 'menu' ? (edgeToEdge ? 0 : radii.panel) : radii.control })
|
|
103
105
|
});
|
|
104
106
|
});
|
|
105
107
|
const stop = subscribeStageScrollFrame(frame => position(frame.scrollY), STAGE_SCROLL_PRIORITY.virtualDocument + 1);
|
|
@@ -114,7 +116,7 @@
|
|
|
114
116
|
</script>
|
|
115
117
|
|
|
116
118
|
<div class="spatial-shell-track" style:--ps-sticky-range={`${spatialLayoutTokens.menu.scrollThreshold}px`} data-spatial-navigation-shell>
|
|
117
|
-
<div bind:this={rack} class="spatial-shell-rack" data-stage-scroll-shell data-catalog-shell data-spatial-navigation-glass={
|
|
119
|
+
<div bind:this={rack} class="spatial-shell-rack" data-stage-scroll-shell data-catalog-shell data-spatial-navigation-glass={theme.panelTheme.surface === 'glass' ? '' : undefined}>
|
|
118
120
|
{#if navigation}{@render navigation()}{:else}<Navigation {menu} {items} {brand} {tools} {left} {right} />{/if}
|
|
119
121
|
</div>
|
|
120
122
|
</div>
|
|
@@ -131,6 +133,9 @@
|
|
|
131
133
|
backdrop-filter: blur(var(--spatial-element-panel-backdrop-blur));
|
|
132
134
|
box-shadow: var(--spatial-element-panel-box-shadow);
|
|
133
135
|
}
|
|
136
|
+
.spatial-shell-rack :global(.header) { border-radius: var(--spatial-element-panel-radius); }
|
|
137
|
+
.spatial-shell-rack :global(.satellite) { border-radius: var(--spatial-element-control-radius); }
|
|
134
138
|
:global(.stage-virtual-scroll-active) .spatial-shell-rack { position: relative; transform: translateY(var(--spatial-shell-scroll-compensation, 0px)); }
|
|
135
139
|
[data-spatial-navigation-glass] :global([data-stage-panel-bound]) { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
|
|
140
|
+
@media (width < 1600px) { .spatial-shell-rack :global(.header) { border-radius: 0; } }
|
|
136
141
|
</style>
|
|
@@ -54,17 +54,19 @@
|
|
|
54
54
|
max-height: max(0px, calc(var(--spatial-detail-summary-max-height, 100000px) - var(--spatial-summary-content-inset, 0px) * 2 - var(--spatial-summary-height-reserve, 0px)));
|
|
55
55
|
overflow: auto; overscroll-behavior: auto;
|
|
56
56
|
}
|
|
57
|
-
:global(.spatial-summary-island[data-presentation-mode='carousel']) { height: 100%; border-radius: var(--carousel-panel-radius, 14px);
|
|
57
|
+
:global(.spatial-summary-island[data-presentation-mode='carousel']) { height: 100%; border-radius: var(--carousel-panel-radius, 14px); }
|
|
58
|
+
/* Fade paint owners, not the backdrop ancestor. Theme opacity must not isolate the canvas. */
|
|
59
|
+
:global(.spatial-summary-island[data-presentation-mode='carousel']) > * { opacity: var(--carousel-panel-opacity, 1); filter: var(--carousel-focus-blur, none); }
|
|
58
60
|
.spatial-summary-surface {
|
|
59
61
|
position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--carousel-panel-tint, white) var(--carousel-panel-tint-opacity, 65%), transparent);
|
|
60
|
-
border: 1px solid color-mix(in srgb, var(--spatial-element-accent) 12%, transparent); backdrop-filter:
|
|
62
|
+
border: 1px solid color-mix(in srgb, var(--spatial-element-accent) 12%, transparent); backdrop-filter: var(--carousel-panel-backdrop, blur(5px)); box-shadow: var(--carousel-panel-shadow); pointer-events: none;
|
|
61
63
|
}
|
|
62
64
|
.spatial-summary-surface[hidden] { display: none; }
|
|
63
65
|
:global([data-carousel-glass-ready]) .spatial-summary-surface,
|
|
64
66
|
:global([data-spatial-presentation-glass]) .spatial-summary-surface { visibility: hidden; }
|
|
65
|
-
.compact-copy { position: relative;
|
|
67
|
+
.compact-copy { position: relative; box-sizing: border-box; padding: 8px 52px 8px 12px; }
|
|
66
68
|
.compact-copy p { height: 26px; margin: 0; font-size: 12px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
67
|
-
.compact-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp:
|
|
69
|
+
.compact-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 1; height: 24px; margin: 0; overflow: hidden; font-size: 18px; line-height: 24px; }
|
|
68
70
|
.full-summary, .section-information { display: none; }
|
|
69
71
|
.information { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 40px; height: 40px; margin: 0; color: var(--spatial-element-accent); pointer-events: auto; }
|
|
70
72
|
.information svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
26
|
-
stroke-width="1.
|
|
26
|
+
stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-spatial-view-icon={kind}>
|
|
27
27
|
{#each kind === 'detail' ? detail : fullscreen as path}<path d={path} />{/each}
|
|
28
28
|
<rect x="1" y="2" width="22" height="20" rx="2" />
|
|
29
29
|
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Keep the space reserved so revealing order controls never shifts the title. */
|
|
2
|
+
[data-spatial-element-handoff-header] :is([data-spatial-element-header-field], [data-spatial-element-dock-action]) {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
visibility: hidden;
|
|
5
|
+
transform: translateY(4px);
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
|
|
8
|
+
}
|
|
9
|
+
[data-spatial-element-handoff-header] :is([data-spatial-element-header-field], [data-spatial-element-dock-action])[data-header-field-visible] {
|
|
10
|
+
opacity: 1;
|
|
11
|
+
visibility: visible;
|
|
12
|
+
transform: none;
|
|
13
|
+
pointer-events: auto;
|
|
14
|
+
transition-delay: 0s;
|
|
15
|
+
}
|
|
16
|
+
@media (prefers-reduced-motion: reduce) {
|
|
17
|
+
[data-spatial-element-handoff-header] :is([data-spatial-element-header-field], [data-spatial-element-dock-action]) {
|
|
18
|
+
transition: none;
|
|
19
|
+
transform: none;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as BrandStageShell } from './BrandStageShell.svelte';
|
|
2
|
+
export { default as SpatialElementSummaryContent } from './SpatialElementSummaryContent.svelte';
|
|
2
3
|
export type { SpatialSummaryContext, SpatialSummarySnippet } from './spatialSummary.js';
|
|
3
4
|
export { defaultSpatialMessages, resolveSpatialMessages, type SpatialMessages, type SpatialMessagesInput } from '@spatial-elements/core/spatial-element/messages';
|
|
4
5
|
export { default as SpatialElementPage } from './SpatialElementPage.svelte';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as BrandStageShell } from './BrandStageShell.svelte';
|
|
2
|
+
export { default as SpatialElementSummaryContent } from './SpatialElementSummaryContent.svelte';
|
|
2
3
|
export { defaultSpatialMessages, resolveSpatialMessages } from '@spatial-elements/core/spatial-element/messages';
|
|
3
4
|
export { default as SpatialElementPage } from './SpatialElementPage.svelte';
|
|
4
5
|
export { default as SpatialListPage } from './SpatialListPage.svelte';
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
transform: translateY(var(--spatial-pane-fixed-compensation, 0px));
|
|
280
280
|
}
|
|
281
281
|
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-heading {
|
|
282
|
-
display: block; box-sizing: border-box; position: fixed; z-index: 3;
|
|
282
|
+
display: block; box-sizing: border-box; padding-block: 4px; position: fixed; z-index: 3;
|
|
283
283
|
top: var(--spatial-pane-top); left: var(--spatial-pane-left); width: var(--spatial-pane-width); height: 86px;
|
|
284
284
|
border-radius: var(--spatial-element-panel-radius) var(--spatial-element-panel-radius) 0 0;
|
|
285
285
|
background: color-mix(in srgb, var(--spatial-pane-tint) var(--spatial-pane-tint-opacity), transparent);
|
|
@@ -288,12 +288,13 @@
|
|
|
288
288
|
box-shadow: 0 4px 10px rgb(0 0 0 / 0.08);
|
|
289
289
|
transform: translateY(var(--spatial-pane-fixed-compensation, 0px));
|
|
290
290
|
}
|
|
291
|
-
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title-row { display: flex; align-items: center; gap: 16px; height:
|
|
292
|
-
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-heading .breadcrumbs { width: 100%; }
|
|
293
|
-
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-
|
|
294
|
-
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-
|
|
295
|
-
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-
|
|
296
|
-
.stage [data-spatial-element-root]:not([data-spatial-detail-flow])
|
|
291
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title-row { display: flex; align-items: center; gap: 16px; height: 100%; margin-top: -24px; padding-inline: 16px; }
|
|
292
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-heading .breadcrumbs { width: 100%; height: 24px; --ps-breadcrumb-height: 24px; padding-inline: 16px; }
|
|
293
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-copy { padding-top: 24px; display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
|
|
294
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-order { flex: none; }
|
|
295
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-title { min-width: 0; flex: 0 1 auto; margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
296
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; margin: 0; font-size: 14px; line-height: 20px; white-space: nowrap; }
|
|
297
|
+
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-action { display: grid; place-items: center; flex: none; width: 54px; height: 54px; padding: 0; border: 0; border-radius: var(--spatial-element-control-radius); color: var(--spatial-element-on-accent); background: var(--spatial-element-accent); cursor: pointer; }
|
|
297
298
|
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-cover { display: block; position: fixed; z-index: 2; left: var(--spatial-pane-left); width: var(--spatial-pane-width); background: var(--stage-page-background, var(--spatial-element-background)); pointer-events: none; transform: translateY(var(--spatial-pane-fixed-compensation, 0px)); }
|
|
298
299
|
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-cover-top { top: 0; height: var(--spatial-pane-body-top); }
|
|
299
300
|
.stage [data-spatial-element-root]:not([data-spatial-detail-flow]) .spatial-element-pane-cover-bottom { top: calc(100svh - var(--spatial-pane-bottom)); height: var(--spatial-pane-bottom); }
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
width: max-content;
|
|
107
107
|
height: 40px;
|
|
108
108
|
border-radius: var(--control-radius);
|
|
109
|
+
overflow: clip;
|
|
109
110
|
}
|
|
110
111
|
button {
|
|
111
112
|
box-sizing: border-box;
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
width: 40px;
|
|
132
133
|
padding: 0;
|
|
133
134
|
}
|
|
134
|
-
button { border-radius:
|
|
135
|
+
button { border-radius: 0; }
|
|
135
136
|
.button-group:global([data-mouse-hover]) button:enabled:hover {
|
|
136
137
|
background: color-mix(in srgb, var(--spatial-element-body, currentColor) 8%, transparent);
|
|
137
138
|
}
|
package/dist/stage/Panel.svelte
CHANGED
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
getMinimapDockProgress,
|
|
99
99
|
getMinimapModelScale,
|
|
100
100
|
getMinimapModelTop,
|
|
101
|
+
getMinimapModelCenterY,
|
|
101
102
|
getMinimapModelLeft,
|
|
102
103
|
getSurface: () => resolvedSurface,
|
|
103
104
|
getSurfaceOpacity,
|
|
@@ -177,6 +178,11 @@
|
|
|
177
178
|
return Number.isFinite(value) ? value : undefined;
|
|
178
179
|
}
|
|
179
180
|
|
|
181
|
+
function getMinimapModelCenterY() {
|
|
182
|
+
const value = Number.parseFloat(frameElement?.dataset.stageMinimapModelCenterY ?? "");
|
|
183
|
+
return Number.isFinite(value) ? value : undefined;
|
|
184
|
+
}
|
|
185
|
+
|
|
180
186
|
function getMinimapModelLeft() {
|
|
181
187
|
const value = Number.parseFloat(frameElement?.dataset.stageMinimapModelLeft ?? '');
|
|
182
188
|
return Number.isFinite(value) ? value : undefined;
|