'use client' /** * Internal demo route for the journey onboarding primitives (PR B). * Auth-free via the /sandbox middleware exemption; view logged out. * * A gallery, not the product flow: it exercises JourneyOrb (all states, * travel, monogram morph), JourneyTrack (answers, jump-back), Question + * ChipRow (fly-to-orb ghost), YearBand, JourneyDatePicker and * AddressFields, with demo data only. NO TIC calls are made from this * page: the lookup budget is untouched. Swedish-only by design (internal * surface); the real flow (PR C) is fully i18n'd. */ import { useRef, useState } from 'react' import JourneyOrb, { type OrbState } from '@/components/onboarding/journey/JourneyOrb' import JourneyTrack from '@/components/onboarding/journey/JourneyTrack' import Question from '@/components/onboarding/journey/Question' import ChipRow from '@/components/onboarding/journey/ChipRow' import YearBand from '@/components/onboarding/journey/YearBand' import JourneyDatePicker from '@/components/onboarding/journey/JourneyDatePicker' import AddressFields from '@/components/onboarding/journey/AddressFields' import '@/components/onboarding/journey/journey.css' const ORB_STATES: OrbState[] = ['listening', 'searching', 'thinking', 'working', 'shaping', 'check'] const STATION_FRACS = [0.07, 0.285, 0.5, 0.715, 0.93] type Panel = 'chips' | 'band' | 'date' | 'address' export default function JourneySandboxPage() { const bandRef = useRef(null) const [orbState, setOrbState] = useState('listening') const [active, setActive] = useState(1) const [morph, setMorph] = useState(null) const [panel, setPanel] = useState('chips') const [bandSpan, setBandSpan] = useState<[number, number] | null>([0, 11]) const [bandLabel, setBandLabel] = useState('1 januari – 31 december') const [pickedDate, setPickedDate] = useState(null) const [address, setAddress] = useState(null) const answers: (string | null)[] = [ 'Nordvik Bygg & Konsult AB', active > 1 ? 'Kalenderår' : null, active > 2 ? 'Kvartalsvis' : null, active > 3 ? 'Faktureringsmetoden' : null, null, ] return (
/sandbox/journey · primitivgalleri · inga TIC-anrop {ORB_STATES.map((s) => ( ))}
setActive(i)} orbLabel={orbState} >
Nordvik Bygg & Konsult AB
Aktiebolag · Malmö · F-skatt · Momsregistrerat
{panel === 'chips' && ( { if (k === 'other') setPanel('band') else if (k === 'first') setPanel('date') else setActive((a) => Math.min(a + 1, 4)) }} flyTargetRef={bandRef} flyTargetFrac={STATION_FRACS[active]} /> )} {panel === 'band' && (
{['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'].map((n, i) => ( ))}
)} {panel === 'date' && ( { setPickedDate(d) setPanel('address') }} /> {pickedDate ?

Valt: {pickedDate}

: null}
)} {panel === 'address' && ( Tryck Enter när du är klar } skipLabel="Lägg till senare" onSubmit={(v) => { setAddress(v.city ?? v.addressLine1 ?? '(hoppade över)') setPanel('chips') }} /> {address ?

Sparat: {address}

: null}
)}
) }