All blocks
Side Gallery
Editorial architectural monograph pairing a sticky left-hand project narrative, metadata list, metrics, and actions beside a vertical scrolling plate stack with a keyboard-navigable lightbox dialog.
Built withAspect RatioBadgeButtonData ListDialogGridHeadingIconIcon ButtonKbdSectionSeparatorStackStatTextToast
Archival Plates · 01–06
Select any plate to inspect in lightbox
Install
1npx stylexblocks add side-gallerySource
components/blocks/ui-sdk/side-gallery.tsx
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999import * as stylex from "@stylexjs/stylex";import { useCallback, useEffect, useMemo, useState } from "react";import { AspectRatio } from "#components/ui/ui-sdk/aspect-ratio.tsx";import { Badge } from "#components/ui/ui-sdk/badge.tsx";import { Button } from "#components/ui/ui-sdk/button.tsx";import { DataList } from "#components/ui/ui-sdk/data-list.tsx";import { Dialog } from "#components/ui/ui-sdk/dialog.tsx";import { Grid } from "#components/ui/ui-sdk/grid.tsx";import { Heading } from "#components/ui/ui-sdk/heading.tsx";import { Icon } from "#components/ui/ui-sdk/icon.tsx";import { IconButton } from "#components/ui/ui-sdk/icon-button.tsx";import { Kbd } from "#components/ui/ui-sdk/kbd.tsx";import { Section } from "#components/ui/ui-sdk/section.tsx";import { Separator } from "#components/ui/ui-sdk/separator.tsx";import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";import { Stat } from "#components/ui/ui-sdk/stat.tsx";import { Text } from "#components/ui/ui-sdk/text.tsx";import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";import { semanticRadii } from "@stylexblocks/ui/semantic-tokens/radii.stylex.ts";import { semanticShadows } from "@stylexblocks/ui/semantic-tokens/shadows.stylex.ts";import { accentPalette } from "@stylexblocks/ui/themes/palettes.ts";import { durations } from "@stylexblocks/ui/tokens/durations.stylex.ts";import { fontSizes } from "@stylexblocks/ui/tokens/font-sizes.stylex.ts";import { fontWeights } from "@stylexblocks/ui/tokens/font-weights.stylex.ts";import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";import { letterSpacings } from "@stylexblocks/ui/tokens/letter-spacings.stylex.ts";import { lineHeights } from "@stylexblocks/ui/tokens/line-heights.stylex.ts";import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";import type { StyleOverrideProps } from "#lib/recipe-props.ts";
export interface SideGalleryMetadataItem { label: string; value: string;}
export interface SideGalleryStat { value: string; unit?: string; label: string;}
export interface SideGalleryPlate { id: string; plate: string; title: string; caption: string; viewType: string; orientation: string; lighting: string; materials: string; exposure: string; notes: string; src: string; alt: string;}
const DEFAULT_METADATA: ReadonlyArray<SideGalleryMetadataItem> = [ { label: "Location", value: "Vals Valley, Graubünden" }, { label: "Elevation", value: "1,840 m ASL" }, { label: "Structure", value: "Valser quartzite & charred larch" }, { label: "Completed", value: "Autumn 2025" }, { label: "Typology", value: "High-altitude private refuge" },];
const DEFAULT_STATS: ReadonlyArray<SideGalleryStat> = [ { value: "1,840", unit: "m", label: "Altitude" }, { value: "420", unit: "m²", label: "Floor area" }, { value: "06", label: "Field plates" },];
const DEFAULT_PLATES: ReadonlyArray<SideGalleryPlate> = [ { id: "south-ridge-dawn", plate: "Plate 01", title: "South Ridge Elevation at Dawn", caption: "The upper charred-larch volume cantilevers six meters clear of the gneiss plinth as first light warms the eastern ridge.", viewType: "Exterior Elevation", orientation: "South-East · 138°", lighting: "06:40 Alpine Sunrise", materials: "Charred Alpine larch, split Valser quartzite", exposure: "90mm · f/11 · 1/60s · ISO 100", notes: "Positioned along a natural contour shelf, the house anchors into bedrock through a single quartzite retaining pier so snowmelt flows uninterrupted beneath the south terrace.", src: "/images/blocks/side-gallery/south-ridge-dawn.webp", alt: "Alpenhaus perched on a snow-dusted gneiss ridge at alpine sunrise, with warm hearth light glowing across its recessed ribbon window", }, { id: "cantilevered-larch-loggia", plate: "Plate 02", title: "Cantilevered Larch Loggia", caption: "Deep brushed-larch soffits shelter the recessed west loggia, cutting glare while framing glacial valley mist.", viewType: "Threshold & Loggia", orientation: "West-South-West · 244°", lighting: "15:15 Low Winter Sun", materials: "Brushed larch slats, honed gneiss paving, white oak", exposure: "45mm · f/8 · 1/125s · ISO 100", notes: "A 2.8-meter roof overhang moderates high summer sun while allowing low December light to reach twelve meters deep across the interior stone floor.", src: "/images/blocks/side-gallery/cantilevered-larch-loggia.webp", alt: "Interior view from a warm timber-lined alpine loggia looking out across misty blue peaks with diagonal afternoon sunlight on the stone floor", }, { id: "quartzite-entry-court", plate: "Plate 03", title: "Quartzite Entry Court & Rain Basin", caption: "Coursed local ashlar shields a sunken entry court where snowmelt collects in a shallow granite mirror basin.", viewType: "Arrival Sequence", orientation: "North-West · 312°", lighting: "11:20 High Overcast", materials: "Dry-jointed Valser quartzite, oiled red cedar, granite", exposure: "55mm · f/11 · 1/30s · ISO 100", notes: "Visitors descend along a wind-sheltered masonry wall before meeting the recessed cedar portal, softly illuminated from a concealed threshold wash.", src: "/images/blocks/side-gallery/quartzite-entry-court.webp", alt: "Coursed grey quartzite courtyard walls framing a recessed warm cedar entry door reflected in a dark granite rain basin", }, { id: "double-height-hearth-library", plate: "Plate 04", title: "Double-Height Hearth & Library", caption: "A board-formed chimney core and suspended steel firebox anchor the reading hall beside a tall corner peak aperture.", viewType: "Interior Section", orientation: "South · 184°", lighting: "13:05 Diffused Skylight", materials: "Lime plaster, board-formed concrete, blackened steel", exposure: "35mm · f/8 · 1/15s · ISO 200", notes: "Vertical timber millwork dampens reverberation across the five-meter ceiling while framing an unmediated vertical slice of the opposite glacier.", src: "/images/blocks/side-gallery/double-height-hearth-library.webp", alt: "Double-height alpine reading room with a suspended blackened-steel fireplace glowing beside timber bookshelves and a tall mountain window", }, { id: "thermal-bath-cloud-aperture", plate: "Plate 05", title: "Thermal Bath & Cloud Aperture", caption: "Carved into the lower stone plinth, the thermal chamber opens through a single ribbon slit to drifting cloudbanks.", viewType: "Lower Plinth", orientation: "East · 92°", lighting: "09:45 Valley Fog", materials: "Flamed dark gneiss, mineral plaster, spring water", exposure: "40mm · f/5.6 · 1/20s · ISO 400", notes: "Fed by a geothermal loop beneath the meadow, the still basin mirrors the narrow cloud aperture so water and horizon merge in fog.", src: "/images/blocks/side-gallery/thermal-bath-cloud-aperture.webp", alt: "Quiet subterranean stone thermal bath with rising vapor and a wide horizontal window opening onto alpine clouds and snow peaks", }, { id: "winter-dusk-north-meadow", plate: "Plate 06", title: "Winter Dusk from the North Meadow", caption: "At blue hour, rhythmic vertical mullions turn the dark timber pavilion into a quiet lantern above the snowfield.", viewType: "Site Context", orientation: "North · 08°", lighting: "17:50 Alpine Blue Hour", materials: "Charred larch cladding, triple-glazed low-iron glass", exposure: "75mm · f/8 · 4s · ISO 100", notes: "Deep interior reveals prevent upward light spill into the alpine night sky while casting a soft amber wash onto the immediate snow terrace.", src: "/images/blocks/side-gallery/winter-dusk-north-meadow.webp", alt: "Dark timber mountain house glowing warmly through vertical mullion windows over a snowy alpine meadow at twilight beneath a crescent moon", },];
const styles = stylex.create({ root: { backgroundColor: semanticColors.bg, color: semanticColors.fg, fontFamily: fonts.body, minHeight: "100%", paddingBlock: { default: spacing._12, "@media (max-width: 720px)": spacing._8, }, paddingInline: { default: spacing._8, "@media (max-width: 720px)": spacing._5, }, width: "100%", }, layout: { gap: { default: spacing._12, "@media (max-width: 1080px)": spacing._8, }, gridTemplateColumns: { default: "minmax(19rem, 26rem) minmax(0, 1fr)", "@media (max-width: 960px)": "minmax(0, 1fr)", }, marginInline: "auto", maxWidth: "82rem", width: "100%", }, // Sticky editorial narrative column narrativeRail: { position: { default: "sticky", "@media (max-width: 960px)": "static", }, top: { default: spacing._10, "@media (max-width: 960px)": "auto", }, }, copyBlock: { gap: spacing._3_5, }, headline: { marginBlock: 0, maxWidth: "15ch", textWrap: "balance", }, description: { maxWidth: "42ch", }, sectionKicker: { letterSpacing: letterSpacings.widest, textTransform: "uppercase", }, metadataList: { "--label-width": "6.5rem", gap: spacing._2_5, }, metadataItem: { alignItems: "baseline", justifyContent: "space-between", width: "100%", }, metadataValue: { color: semanticColors.fg, fontWeight: fontWeights.medium, justifyContent: "flex-end", textAlign: "right", }, statItem: { gap: spacing._0_5, }, colophon: { lineHeight: lineHeights.sm, }, // Right-hand scrolling plate stack galleryColumn: { gap: spacing._4, minWidth: 0, width: "100%", }, stackHeader: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: spacing._2, justifyContent: "space-between", marginBottom: 0, }, plateStack: { gap: spacing._7, width: "100%", }, plateFigure: { marginBlock: 0, marginInline: 0, width: "100%", }, plateButton: { "--plate-img-scale": { default: "1", ":hover": "1.028", ":focus-visible": "1.028", }, "--plate-inspect-opacity": { default: "0.78", ":hover": "1", ":focus-visible": "1", }, appearance: "none", backgroundColor: semanticColors.bgSurface, borderColor: { default: semanticColors.border, ":hover": semanticColors.borderEmphasized, ":focus-visible": semanticColors.accentBorder, }, borderRadius: semanticRadii.panelLg, borderStyle: "solid", borderWidth: "1px", boxShadow: { default: semanticShadows.xs, ":hover": semanticShadows.md, }, color: "inherit", cursor: "pointer", display: "flex", flexDirection: "column", fontFamily: "inherit", outlineColor: { default: null, ":focus-visible": semanticColors.accentFocusRing, }, outlineOffset: { default: null, ":focus-visible": "2px", }, outlineStyle: { default: null, ":focus-visible": "solid", }, outlineWidth: { default: null, ":focus-visible": "2px", }, overflow: "hidden", paddingBlock: 0, paddingInline: 0, textAlign: "left", transform: { default: "translateY(0px)", ":hover": "translateY(-2px)", }, transitionDuration: durations.moderate, transitionProperty: "border-color, box-shadow, transform", transitionTimingFunction: "cubic-bezier(0.2, 0, 0, 1)", width: "100%", }, plateFrame: { backgroundColor: semanticColors.bgMuted, }, plateImage: { display: "block", height: "100%", objectFit: "cover", transform: "scale(var(--plate-img-scale, 1))", transitionDuration: durations.slow, transitionProperty: "transform", transitionTimingFunction: "cubic-bezier(0.2, 0, 0, 1)", width: "100%", }, plateBadgeOverlay: { backgroundColor: semanticColors.bgOverlay, borderColor: semanticColors.borderSubtle, borderRadius: semanticRadii.indicatorSm, borderStyle: "solid", borderWidth: "1px", left: spacing._3_5, paddingBlock: spacing._1, paddingInline: spacing._2, position: "absolute", top: spacing._3_5, }, plateInspectChip: { backgroundColor: semanticColors.bgOverlay, borderColor: semanticColors.borderSubtle, borderRadius: semanticRadii.indicatorSm, borderStyle: "solid", borderWidth: "1px", color: semanticColors.fg, opacity: "var(--plate-inspect-opacity, 0.78)", paddingBlock: spacing._1, paddingInline: spacing._2, position: "absolute", right: spacing._3_5, top: spacing._3_5, transitionDuration: durations.fast, transitionProperty: "opacity", }, plateCaption: { paddingBlock: spacing._4, paddingInline: spacing._5, width: "100%", }, plateCaptionBody: { display: "block", maxWidth: "64ch", }, // Lightbox Dialog dialogContent: { borderColor: semanticColors.border, borderStyle: "solid", borderWidth: "1px", maxWidth: "min(56rem, calc(100vw - 2rem))", overflow: "hidden", width: "calc(100% - 2rem)", }, dialogHeader: { alignItems: "flex-start", display: "flex", gap: spacing._4, justifyContent: "space-between", paddingBlock: spacing._4, paddingInline: spacing._5, }, dialogCloseButton: { position: "static", right: "auto", top: "auto", }, dialogBody: { display: "flex", flexDirection: "column", gap: spacing._4, paddingBlock: 0, paddingInline: spacing._5, }, lightboxStage: { backgroundColor: semanticColors.bgMuted, borderColor: semanticColors.borderSubtle, borderRadius: semanticRadii.panel, borderStyle: "solid", borderWidth: "1px", maxHeight: "56dvh", }, lightboxImage: { display: "block", height: "100%", objectFit: "cover", width: "100%", }, lightboxMetaGrid: { gridTemplateColumns: { default: "minmax(0, 1.15fr) minmax(0, 1fr)", "@media (max-width: 700px)": "minmax(0, 1fr)", }, paddingBottom: spacing._4, }, lightboxNotes: { lineHeight: lineHeights.md, marginBlock: 0, }, lightboxDataList: { "--label-width": "5.5rem", gap: spacing._2, }, lightboxDataItem: { alignItems: "baseline", justifyContent: "space-between", width: "100%", }, lightboxDataValue: { color: semanticColors.fg, fontFamily: fonts.mono, fontSize: fontSizes.xs, fontVariantNumeric: "tabular-nums", justifyContent: "flex-end", textAlign: "right", }, dialogFooter: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: spacing._3, justifyContent: "space-between", paddingBlock: spacing._3_5, paddingInline: spacing._5, }, kbdHints: { display: { default: "inline-flex", "@media (max-width: 640px)": "none", }, }, counterText: { minWidth: "4.5rem", },});
export interface SideGalleryProps extends StyleOverrideProps { /** Optional eyebrow pill displayed above the monograph title. */ eyebrow?: string; /** Primary display heading for the monograph narrative. */ title?: string; /** Editorial project narrative copy. */ description?: string; /** Secondary curatorial note below the project statistics. */ colophon?: string; /** Label for the primary call-to-action button. */ primaryLabel?: string; /** Label for the secondary call-to-action button. */ secondaryLabel?: string; /** Project metadata rows rendered in the sticky sidebar DataList. */ metadata?: ReadonlyArray<SideGalleryMetadataItem>; /** Compact architectural metrics rendered below the metadata list. */ stats?: ReadonlyArray<SideGalleryStat>; /** Architectural plates rendered in the vertical right-hand gallery stack. */ plates?: ReadonlyArray<SideGalleryPlate>; /** Called when the primary CTA button is activated. */ onPrimaryAction?: () => void; /** Called when the secondary CTA button is activated. */ onSecondaryAction?: () => void; /** Called when a plate is opened in the lightbox dialog. */ onSelectPlate?: (plate: SideGalleryPlate) => void;}
/** * SideGallery — editorial split monograph pairing a sticky left-hand project * narrative, structured metadata list, architectural metrics, and actions * beside a vertical right-hand stack of captioned plates with a keyboard- * navigable lightbox dialog. */export function SideGallery({ eyebrow = "Monograph 12 · Graubünden", title = "Alpenhaus: Quiet shelter above the timberline", description = "Anchored to a south-facing gneiss ridge in the Vals Valley, this charred-larch and quartzite refuge frames shifting alpine weather through deep-set apertures and stepped stone terraces.", colophon = "Photographed on 4×5 field sheet film across winter solstice and autumn thaw.", primaryLabel = "Download dossier", secondaryLabel = "Inspect plate 01", metadata = DEFAULT_METADATA, stats = DEFAULT_STATS, plates = DEFAULT_PLATES, onPrimaryAction, onSecondaryAction, onSelectPlate, palette, style,}: SideGalleryProps) { const queue = useMemo(() => Toast.createToaster(), []); const [activeId, setActiveId] = useState<string | null>(null);
const activeIndex = useMemo( () => activeId === null ? -1 : plates.findIndex((plate) => plate.id === activeId), [activeId, plates], );
const activePlate = activeIndex >= 0 ? plates[activeIndex] : null;
const handleOpenPlate = useCallback( (plate: SideGalleryPlate) => { setActiveId(plate.id); onSelectPlate?.(plate); }, [onSelectPlate], );
const handleStep = useCallback( (delta: -1 | 1) => { if (plates.length <= 1 || activeIndex < 0) return; const nextIndex = (activeIndex + delta + plates.length) % plates.length; const nextPlate = plates[nextIndex]; if (nextPlate) { setActiveId(nextPlate.id); onSelectPlate?.(nextPlate); } }, [activeIndex, onSelectPlate, plates], );
const handlePrimary = useCallback(() => { onPrimaryAction?.(); queue.info("Monograph 12 dossier queued", { description: "Alpenhaus Vals — measured plans, sections, and 6 archival plates (PDF).", }); }, [onPrimaryAction, queue]);
const handleSecondary = useCallback(() => { onSecondaryAction?.(); const firstPlate = plates[0]; if (firstPlate) { handleOpenPlate(firstPlate); } }, [handleOpenPlate, onSecondaryAction, plates]);
useEffect(() => { if (!activePlate) return; const handleKeyDown = (event: KeyboardEvent) => { if (event.key === "ArrowLeft") { event.preventDefault(); handleStep(-1); } else if (event.key === "ArrowRight") { event.preventDefault(); handleStep(1); } }; window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown); }, [activePlate, handleStep]);
return ( <VStack gap="0" palette={palette} style={[styles.root, style]}> <Grid align="start" style={styles.layout}> {/* Sticky left-hand narrative, actions, metadata, and metrics */} <VStack render={<aside aria-label="Project monograph overview" />} gap="6" style={styles.narrativeRail} > <VStack render={<header />} align="start" style={styles.copyBlock}> {eyebrow ? ( <Badge variant="subtle" size="md"> {eyebrow} </Badge> ) : null} <Heading render={<h1 />} size="4xl" style={styles.headline}> {title} </Heading> <Text variant="muted" size="md" style={styles.description}> {description} </Text> </VStack>
<HStack wrap="wrap" gap="2.5"> <Button variant="solid" size="md" palette={accentPalette} onClick={handlePrimary} > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M10 3.75v8.5" /> <path d="M6.75 9.25 10 12.5l3.25-3.25" /> <path d="M4.25 15.75h11.5" /> </Icon> {primaryLabel} </Button>
<Button variant="surface" size="md" disabled={plates.length === 0} onClick={handleSecondary} > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M12.5 4.25h3.25V7.5" /> <path d="M7.5 15.75H4.25V12.5" /> <path d="M15.75 4.25 11.25 8.75" /> <path d="M4.25 15.75l4.5-4.5" /> </Icon> {secondaryLabel} </Button> </HStack>
<Separator decorative />
<VStack gap="4"> <Text variant="mono" size="2xs" tone="subtle" weight="medium" style={styles.sectionKicker} > Project Specifications </Text> <DataList.Root size="sm" orientation="horizontal" style={styles.metadataList} > {metadata.map((item) => ( <DataList.Item key={item.label} style={styles.metadataItem}> <DataList.ItemLabel>{item.label}</DataList.ItemLabel> <DataList.ItemValue style={styles.metadataValue}> {item.value} </DataList.ItemValue> </DataList.Item> ))} </DataList.Root> </VStack>
<Separator decorative />
<Grid columns="3" gap="4"> {stats.map((stat) => ( <Stat.Root key={stat.label} size="sm" style={styles.statItem}> <Stat.ValueText> {stat.value} {stat.unit ? <Stat.ValueUnit>{stat.unit}</Stat.ValueUnit> : null} </Stat.ValueText> <Stat.Label>{stat.label}</Stat.Label> </Stat.Root> ))} </Grid>
{colophon ? ( <Text variant="subtle" size="xs" style={styles.colophon}> {colophon} </Text> ) : null} </VStack>
{/* Right-hand vertical scrolling plate stack */} <Section.Root render={<main />} aria-label="Alpenhaus architectural plates" style={styles.galleryColumn} > <Section.Header style={styles.stackHeader}> <Text variant="mono" size="2xs" tone="subtle" weight="medium" style={styles.sectionKicker} > Archival Plates · 01–{String(plates.length).padStart(2, "0")} </Text> <Text variant="subtle" size="xs"> Select any plate to inspect in lightbox </Text> </Section.Header>
<Section.Body> <VStack style={styles.plateStack}> {plates.map((plate) => ( <article key={plate.id} {...stylex.props(styles.plateFigure)}> <button type="button" onClick={() => handleOpenPlate(plate)} aria-label={`Inspect ${plate.plate}: ${plate.title}`} {...stylex.props(styles.plateButton)} > <AspectRatio render={<span />} ratio="landscape" rounded="none" style={styles.plateFrame} > <img src={plate.src} alt={plate.alt} loading="lazy" {...stylex.props(styles.plateImage)} /> <Text render={<span />} variant="mono" size="2xs" tabular="true" style={styles.plateBadgeOverlay} > {plate.plate} </Text> <HStack render={<span aria-hidden="true" />} gap="1" style={styles.plateInspectChip} > <Icon size="xs" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" > <path d="M10 3h3v3" /> <path d="M6 13H3v-3" /> <path d="M13 3 9.25 6.75" /> <path d="M3 13l3.75-3.75" /> </Icon> <Text render={<span />} size="2xs" weight="medium"> Inspect </Text> </HStack> </AspectRatio>
<VStack render={<span />} gap="1.5" style={styles.plateCaption} > <HStack render={<span />} align="baseline" wrap="wrap" gap="2" justify="between" > <Text render={<span />} variant="label" size="md"> {plate.title} </Text> <Text render={<span />} variant="mono" size="xs" tone="subtle" tabular="true" > {plate.lighting} </Text> </HStack> <Text render={<span />} variant="muted" size="sm" style={styles.plateCaptionBody} > {plate.caption} </Text> </VStack> </button> </article> ))} </VStack> </Section.Body> </Section.Root> </Grid>
<Dialog.Root open={activePlate !== null} onOpenChange={(nextOpen) => { if (!nextOpen) setActiveId(null); }} size="xl" placement="center" > <Dialog.Backdrop /> <Dialog.Content style={styles.dialogContent}> {activePlate ? ( <> <Dialog.Header style={styles.dialogHeader}> <VStack gap="1.5"> <HStack wrap="wrap" gap="2"> <Badge variant="subtle" size="sm"> {activePlate.plate} </Badge> <Badge variant="outline" size="sm"> {activePlate.viewType} </Badge> </HStack> <Dialog.Title>{activePlate.title}</Dialog.Title> </VStack>
<Dialog.Close render={ <IconButton variant="ghost" size="sm" aria-label="Close plate lightbox" /> } style={styles.dialogCloseButton} > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M5 5l10 10" /> <path d="M15 5 5 15" /> </Icon> </Dialog.Close> </Dialog.Header>
<Dialog.Body style={styles.dialogBody}> <AspectRatio ratio="landscape" style={styles.lightboxStage}> <img src={activePlate.src} alt={activePlate.alt} {...stylex.props(styles.lightboxImage)} /> </AspectRatio>
<Grid gap="5" style={styles.lightboxMetaGrid}> <Dialog.Description style={styles.lightboxNotes}> {activePlate.notes} </Dialog.Description>
<DataList.Root size="sm" orientation="horizontal" style={styles.lightboxDataList} > <DataList.Item style={styles.lightboxDataItem}> <DataList.ItemLabel>Bearing</DataList.ItemLabel> <DataList.ItemValue style={styles.lightboxDataValue}> {activePlate.orientation} </DataList.ItemValue> </DataList.Item> <DataList.Item style={styles.lightboxDataItem}> <DataList.ItemLabel>Light</DataList.ItemLabel> <DataList.ItemValue style={styles.lightboxDataValue}> {activePlate.lighting} </DataList.ItemValue> </DataList.Item> <DataList.Item style={styles.lightboxDataItem}> <DataList.ItemLabel>Materials</DataList.ItemLabel> <DataList.ItemValue style={styles.lightboxDataValue}> {activePlate.materials} </DataList.ItemValue> </DataList.Item> <DataList.Item style={styles.lightboxDataItem}> <DataList.ItemLabel>Exposure</DataList.ItemLabel> <DataList.ItemValue style={styles.lightboxDataValue}> {activePlate.exposure} </DataList.ItemValue> </DataList.Item> </DataList.Root> </Grid> </Dialog.Body>
<Separator decorative />
<Dialog.Footer style={styles.dialogFooter}> <HStack gap="1.5" style={styles.kbdHints}> <Kbd size="sm">←</Kbd> <Kbd size="sm">→</Kbd> <Text render={<span />} variant="subtle" size="xs"> Navigate plates </Text> </HStack>
<HStack gap="2"> <Button variant="surface" size="sm" disabled={plates.length <= 1} onClick={() => handleStep(-1)} > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M12.5 5 7.5 10l5 5" /> </Icon> Previous </Button>
<Text render={<span aria-live="polite" />} variant="mono" size="xs" tone="muted" align="center" tabular="true" style={styles.counterText} > {String(activeIndex + 1).padStart(2, "0")} /{" "} {String(plates.length).padStart(2, "0")} </Text>
<Button variant="surface" size="sm" disabled={plates.length <= 1} onClick={() => handleStep(1)} > Next <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M7.5 5l5 5-5 5" /> </Icon> </Button> </HStack> </Dialog.Footer> </> ) : null} </Dialog.Content> </Dialog.Root>
<Toaster toaster={queue} /> </VStack> );}
Inspired by the Side Gallery template from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.).