import type { Meta, StoryObj } from '@storybook/react' import { useCallback, useState } from 'react' import { css } from '../../../styled-system/css' import { PracticeHelpOverlay } from './PracticeHelpOverlay' const meta: Meta = { title: 'Practice/PracticeHelpOverlay', component: PracticeHelpOverlay, parameters: { layout: 'centered', }, tags: ['autodocs'], } export default meta type Story = StoryObj /** * Interactive demo showing the help overlay with time-based escalation */ function InteractiveDemo() { const [currentValue, setCurrentValue] = useState(13) const [targetValue] = useState(33) // 13 + 20 const [completed, setCompleted] = useState(false) const handleTargetReached = useCallback(() => { setCompleted(true) console.log('Target reached!') // After celebration, could reset or advance setTimeout(() => { setCompleted(false) setCurrentValue(33) }, 1000) }, []) return (

Progressive Help Overlay Demo

Just the abacus with arrows. Bead tooltip appears after 3s (debug timing).

Tooltip uses same system as TutorialPlayer.

{/* Simulating how it appears in ActiveSession - with "Adding: +20" badge above */}
Adding: +20
{!completed && ( )}
{completed && (
🎉

Target Reached!

)}
) } export const Interactive: Story = { render: () => , } /** * Shows just the abacus overlay without any surrounding UI */ function MinimalDemo() { return (

Minimal: Just the Abacus

) } export const Minimal: Story = { render: () => , } // Static examples export const Simple: Story = { args: { currentValue: 0, targetValue: 5, columns: 3, debugTiming: true, }, } export const TwoDigit: Story = { args: { currentValue: 23, targetValue: 68, columns: 3, debugTiming: true, }, } export const ThreeDigit: Story = { args: { currentValue: 123, targetValue: 456, columns: 3, debugTiming: true, }, } export const ProductionTiming: Story = { args: { currentValue: 13, targetValue: 33, columns: 3, debugTiming: false, // Use production timing (10s for tooltip) }, parameters: { docs: { description: { story: 'Uses production timing: Bead tooltip at 10s', }, }, }, }