@spunto/brand-kit 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/home/check.ts +6 -0
- package/src/home/editions/foyer.json +346 -15
- package/src/home/editions.ts +1 -1
- package/src/home/guide.ts +3 -2
- package/src/home/home.tsx +6 -2
- package/src/home/products/foyer.ts +18 -7
- package/src/home/showcase/catalog.ts +33 -1
- package/src/home/showcase/foyer/book.tsx +149 -0
- package/src/home/showcase/foyer/pantry.tsx +159 -0
- package/src/home/showcase/foyer/parts.tsx +226 -0
- package/src/home/showcase/foyer/phone.tsx +256 -0
- package/src/home/showcase/foyer/sample.ts +174 -0
- package/src/home/showcase/foyer/week.tsx +204 -0
- package/src/home/showcase/stage.tsx +11 -7
- package/src/home/showcase/view.tsx +8 -0
- package/src/home/types.ts +3 -0
|
@@ -114,22 +114,24 @@ export function useStage(lengths: readonly number[], still: number) {
|
|
|
114
114
|
|
|
115
115
|
const vars = (v: Record<string, string | number>) => v as CSSProperties
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
/** `board`: the drawing's width in design pixels — 920 for an app's window, narrower for a phone (a hero's column).
|
|
118
|
+
`bare`: no panel around it, only the glow — a device that stands on the page by itself. */
|
|
119
|
+
export function Stage({ stageRef, colors, night, height, label, board = BOARD, bare, children }: { stageRef: RefObject<HTMLDivElement | null>; colors: StageColors; night: boolean; height: number; label: string; board?: number; bare?: boolean; children: ReactNode }) {
|
|
118
120
|
// On paper the screen sits in a panel of the product's field; on a field-coloured band, in a lighter pane of it.
|
|
119
|
-
const panel = night ? hexAlpha("#ffffff", 0.07) : colors.field
|
|
121
|
+
const panel = bare ? "transparent" : night ? hexAlpha("#ffffff", 0.07) : colors.field
|
|
120
122
|
return (
|
|
121
123
|
<div ref={stageRef} data-showcase-stage role="img" aria-label={label} style={{ position: "relative", containerType: "inline-size", ...vars({ "--p": 0.5 }) }}>
|
|
122
124
|
<div
|
|
123
125
|
aria-hidden
|
|
124
126
|
style={{
|
|
125
127
|
// Never taller than most of the screen it is read on: the board then sits centred in a wider panel.
|
|
126
|
-
...vars({ "--u": `clamp(${MIN_U}px, calc(100cqi / ${
|
|
128
|
+
...vars({ "--u": `clamp(${MIN_U}px, calc(100cqi / ${board}), calc(84vh / ${height}))` }),
|
|
127
129
|
position: "relative",
|
|
128
130
|
height: u(height),
|
|
129
131
|
overflow: "hidden",
|
|
130
132
|
borderRadius: 8,
|
|
131
133
|
background: panel,
|
|
132
|
-
border: night ? "1px solid rgba(255,255,255,0.12)" : "none",
|
|
134
|
+
border: night && !bare ? "1px solid rgba(255,255,255,0.12)" : "none",
|
|
133
135
|
color: INK,
|
|
134
136
|
fontFamily: FONT.sans,
|
|
135
137
|
fontSize: u(12),
|
|
@@ -143,7 +145,9 @@ export function Stage({ stageRef, colors, night, height, label, children }: { st
|
|
|
143
145
|
style={{
|
|
144
146
|
position: "absolute",
|
|
145
147
|
inset: "-20%",
|
|
146
|
-
background:
|
|
148
|
+
background: bare
|
|
149
|
+
? `radial-gradient(34% 38% at 50% 50%, ${hexAlpha(colors.signal, 0.3)}, transparent 72%)`
|
|
150
|
+
: `radial-gradient(42% 46% at 78% 22%, ${hexAlpha(colors.signal, night ? 0.2 : 0.34)}, transparent 70%), radial-gradient(40% 50% at 12% 92%, ${hexAlpha(colors.signal, night ? 0.1 : 0.16)}, transparent 70%)`,
|
|
147
151
|
transform: "translateY(calc((var(--p) - 0.5) * 12%))",
|
|
148
152
|
}}
|
|
149
153
|
/>
|
|
@@ -152,10 +156,10 @@ export function Stage({ stageRef, colors, night, height, label, children }: { st
|
|
|
152
156
|
position: "absolute",
|
|
153
157
|
top: 0,
|
|
154
158
|
left: 0,
|
|
155
|
-
width: u(
|
|
159
|
+
width: u(board),
|
|
156
160
|
height: "100%",
|
|
157
161
|
// Room to spare: centred. Too narrow: the scroll pans from the board's left edge to its right one.
|
|
158
|
-
transform: `translateX(calc(max(0px, 100cqi - ${u(
|
|
162
|
+
transform: `translateX(calc(max(0px, 100cqi - ${u(board)}) * 0.5 + min(0px, 100cqi - ${u(board)}) * clamp(0, (var(--p) - 0.32) * 2.8, 1)))`,
|
|
159
163
|
}}
|
|
160
164
|
>
|
|
161
165
|
{children}
|
|
@@ -12,6 +12,10 @@ import { DriveScreen } from "./desktop/drive"
|
|
|
12
12
|
import { HandoffScreen } from "./desktop/handoff"
|
|
13
13
|
import { LauncherScreen } from "./desktop/launcher"
|
|
14
14
|
import { WallScreen } from "./desktop/wall"
|
|
15
|
+
import { BookScreen } from "./foyer/book"
|
|
16
|
+
import { PantryScreen } from "./foyer/pantry"
|
|
17
|
+
import { PhoneScreen } from "./foyer/phone"
|
|
18
|
+
import { WeekScreen } from "./foyer/week"
|
|
15
19
|
import type { StageColors } from "./stage"
|
|
16
20
|
|
|
17
21
|
/* The client half of a `showcase` section: the home (drawn on the server) hands a screen's id and what
|
|
@@ -28,6 +32,10 @@ const SCREENS: Record<ShowcaseScreenId, (props: ScreenProps) => ReactNode> = {
|
|
|
28
32
|
"desktop-drive": DriveScreen,
|
|
29
33
|
"desktop-handoff": HandoffScreen,
|
|
30
34
|
"desktop-launcher": LauncherScreen,
|
|
35
|
+
"foyer-phone": PhoneScreen,
|
|
36
|
+
"foyer-week": WeekScreen,
|
|
37
|
+
"foyer-pantry": PantryScreen,
|
|
38
|
+
"foyer-book": BookScreen,
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
export function ShowcaseScreen({ screen, locale, product, theme, palette, label }: { screen: ShowcaseScreenId; locale: "en" | "fr"; product: BrandProductId; theme: BrandTheme; palette?: BrandPalette; label: string }) {
|
package/src/home/types.ts
CHANGED
|
@@ -39,6 +39,9 @@ export type HomeSection =
|
|
|
39
39
|
illustration?: IllustrationId
|
|
40
40
|
/** A 3D module beside (split) or under (centered) the copy — or behind it (band). Takes the illustration's place. */
|
|
41
41
|
scene?: Module3DRef
|
|
42
|
+
/** A screen of the product, playing beside (split) or under (centered) the copy — a narrow one, drawn for a
|
|
43
|
+
column (`foyer-phone`). Takes the illustration's and the scene's place; not in a band. */
|
|
44
|
+
screen?: ShowcaseScreenId
|
|
42
45
|
})
|
|
43
46
|
| (Base & {
|
|
44
47
|
kind: "facts"
|