diff --git a/components/page-editor/blocks/new-world.tsx b/components/page-editor/blocks/new-world.tsx new file mode 100644 index 0000000000..bcbe42c1d1 --- /dev/null +++ b/components/page-editor/blocks/new-world.tsx @@ -0,0 +1,1390 @@ +import type { ReactNode } from "react"; +import { + ArrowRight, + Award, + Calendar, + Check, + Clock, + Eye, + Heart, + Mail, + MapPin, + MessageSquare, + Phone, + Sparkles, + Star, + Tag, + Users, + type LucideIcon, +} from "lucide-react"; +import { InlineText } from "@/components/sites/inline-text"; +import { + NewWorldContactForm, + NewWorldLetterForm, +} from "@/components/sites/new-world-forms"; +import type { ComponentConfig } from "@/lib/page-editor/types"; +import type { SiteLinkMap } from "@/lib/sites/house-theme"; +import { storedWallClock } from "@/lib/sites/site-events"; +import { + LINK_HINT, + VOICE_HINT, + area, + arr, + block, + cls, + hrefOf, + image, + img, + rel, + str, + text, + type Common, + type Props, +} from "./midnight"; +import { + DAYS, + MONTHS, + clock, + eventHref, + spaceOf, + upcoming, +} from "./network-kit"; + +// ── The New World block family (LIVE-2055) ────────────────────────────────────────────────── +// New World's own sections, drawn from its design system (docs/design-systems/new-world; the reference is the zip's Web Theme.html, +// ui_kits/site/Sections.jsx and Blocks.jsx): the split hero with the "doors open this week" card and the neighbourhood strip, the +// numbers band, the story with its outlined numbers, the groups as a times list beside a feature card, the calendar with its week +// strip and date rows, the first-visit stepper, the regulars' words, the hosts, the ways in, the plans, the open spots, the gallery, +// the posts, how a first time goes, where to find us, the contact and letter forms, the questions, the tools and the closer. +// +// Server Components. Every look is the New World sheet's (components/sites/new-world-sections-css.ts), tokens only, scoped to +// [data-house-theme="new-world"], so these only ever dress the stand-alone site render (theme fence, ADR-1906). The kit's mixed +// registers come from the design's REG map: a block's Register is "auto" by default, which keeps the site's register except where the +// design turns a section to Commons (the regulars' words, the questions) or Stage (the closer); the owner can pin either. +// +// Live where the Space has the data: the hero card, the calendar and the open spots read the Space's upcoming events, the regulars' +// words read its reviews and the questions read its own answers; with none, each shows the rows the owner wrote. A list with no rows +// says so in its own words and never draws an empty box. + +const ICONS: Record = { + users: Users, + calendar: Calendar, + check: Check, + award: Award, + tag: Tag, + heart: Heart, + phone: Phone, + mail: Mail, + clock: Clock, + pin: MapPin, + message: MessageSquare, + star: Star, + sparkle: Sparkles, + eye: Eye, +}; +const ICON_NAMES = Object.keys(ICONS); + +function Icon({ name, tile = false, size = 16 }: { name: string; tile?: boolean; size?: number }) { + const Glyph = ICONS[name] ?? Sparkles; + const glyph =