import { expect, userEvent, within } from "storybook/test"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { type ReactNode, useRef, useState } from "react"; import { animationDurationsMs } from "../../animationDurationsMs"; import { ReducedMotionContext } from "../../core/ReducedMotionContext"; import { Button } from "../actions/Button"; import { InfoMessage } from "../feedback/Message"; import { Text } from "../primitives/Text"; import { View } from "../primitives/View"; import { Story } from "../story-components/Story"; import { Box } from "./Box"; import { PresenceList, PresenceOne } from "./Presence"; // Pure NativeWind v5 CSS animations — no animation library. Presence keeps the // outgoing child mounted for `exitDurationMs` (the framework's // `animationDurationsMs.slide`, matching the slide-in / slide-out keyframes) so // the previous content slides out to the right while the new one slides in from // the left with a rotateY flip. // PresenceOne merges the animation classes onto a single style-forwarding child // via cloneElement — no wrapper View. The cloned card is `absolute inset-0`, so // the outgoing and incoming cards overlap inside the sized, clipped container and // cross over each other during the swap. function PresenceOneDemo(): ReactNode { const [gameNumber, setGameNumber] = useState(1); return ( Game {gameNumber}