Adds the shared gallery building blocks

A masonry photo grid that keeps the reading order (pure CSS, no measuring
in the browser), an accessible lightbox on Chakra's Dialog with wrap-around
browsing, keys, swipe and preloading, and a filter bar of toggle buttons.
They work on generic gallery items, so other pages can use them. The swipe
logic moves out of the hero into a shared hook; the hero behaves as before.
The rules behind them live in pure helpers with property-based tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 23:22:43 +01:00
co-authored by Claude Opus 5.5
parent e013f1436b
commit 18bf0311ef
38 changed files with 2392 additions and 43 deletions
+35
View File
@@ -0,0 +1,35 @@
import { defineRecipe } from '@chakra-ui/react';
// The buttons of a FilterBar: small caps in the eyebrow style, the chosen
// one in accent.deep with an underline (aria-pressed). ink.soft and
// accent.deep both reach 4.5:1 on paper; the 2px underline marks the choice
// for those who cannot tell the colours apart.
const filterControlRecipe = defineRecipe({
className: 'filter-control',
base: {
display: 'inline-flex',
alignItems: 'center',
// 44px touch target (BR-RWD-04)
minH: '44px',
px: 1,
bg: 'transparent',
textStyle: 'eyebrow',
color: 'ink.soft',
cursor: 'pointer',
textDecoration: 'underline',
textDecorationColor: 'transparent',
textDecorationThickness: '2px',
textUnderlineOffset: '0.55em',
transitionProperty: 'color, text-decoration-color',
transitionDuration: 'interaction',
transitionTimingFunction: 'smooth',
_hover: { color: 'ink' },
_pressed: {
color: 'accent.deep',
textDecorationColor: 'currentColor',
cursor: 'default',
},
},
});
export default filterControlRecipe;