(_p: ToggleGroupExampleProps = {})
| 18 | export const toggleGroupExampleControls = [] as const; |
| 19 | |
| 20 | export const ToggleGroupExampleScene = (_p: ToggleGroupExampleProps = {}) => { |
| 21 | // Cursor: park → ease to "Yearly" → click → ease to "Monthly" → click. |
| 22 | const cursorStyle = useCursorPath([ |
| 23 | { at: 0, x: 80, y: 60 }, |
| 24 | { at: 32, x: YEARLY_X, y: TOGGLE_Y, duration: 28 }, |
| 25 | { at: 44, x: YEARLY_X, y: TOGGLE_Y, click: true, duration: 0 }, |
| 26 | { at: 80, x: MONTHLY_X, y: TOGGLE_Y, duration: 20 }, |
| 27 | { at: 90, x: MONTHLY_X, y: TOGGLE_Y, click: true, duration: 0 }, |
| 28 | ]); |
| 29 | |
| 30 | // Toggle: starts on "Monthly", slides to "Yearly" on first click, back on second. |
| 31 | const toggleStyle = useToggleGroupTransition([ |
| 32 | { at: 46, state: "Yearly", duration: 14 }, |
| 33 | { at: 92, state: "Monthly", duration: 14 }, |
| 34 | ]); |
| 35 | |
| 36 | return ( |
| 37 | <div style={{ position: "relative", width: "100%", height: "100%" }}> |
| 38 | {/* ToggleGroup renders position:absolute;inset:0 — it centers itself. */} |
| 39 | <ToggleGroup style={toggleStyle} /> |
| 40 | <Cursor style={cursorStyle} variant="pointer" /> |
| 41 | </div> |
| 42 | ); |
| 43 | }; |
| 44 | |
| 45 | export const toggleGroupExampleCode = ( |
| 46 | _values: Record<string, unknown> = {}, |
nothing calls this directly
no test coverage detected