import { DemoStory } from '../../demo/demo-types'; import { RadialProgress, RadialProgressProps } from './radial-progress'; import { Button, ButtonSize } from '../../components/button'; export const radialProgressDemo: DemoStory = { id: 'radial-progress', text: 'Radial Progress', args: { color: '#0a74c9', trackColor: '#e0e0e0', value: 75, size: ButtonSize.Large, }, argTypes: { color: { control: 'color', description: 'Progress ring color' }, trackColor: { control: 'color', description: 'Background track ring color' }, value: { control: 'number', description: 'Current completion percentage' }, size: { control: 'select', options: Object.values(ButtonSize), description: 'Component pixel size mapping' }, }, render: (args) => { // We will demonstrate both declarative props scaling and hook-driven animations const hookData = { onProgress: null as any }; let simValue = 0; // Simulate real-world downloading / progressing every 100ms const startSimulation = () => { simValue = 0; const interval = setInterval(() => { simValue += 5; if (hookData.onProgress) { hookData.onProgress(simValue); } if (simValue >= 100) clearInterval(interval); }, 100); }; return (

Declarative Value & Dynamic Sizes

Hook-Driven Realtime Animation

Click the button below to simulate loading

); }, code: `import { RadialProgress } from 'lupine.components/component-pool'; import { ButtonSize } from 'lupine.components/src/components/button.tsx'; // 1. Static declarative rendering // 2. Reactivity with hooks const progressHook = {}; // Later triggering the hook update progressHook.onProgress(100); `, };