import React from "react"; import { useCallback, useState } from "react"; import { createComponentTemplate } from "vibe-storybook-components"; import RadioButton from "../RadioButton"; import { clickRadioButtonPlaySuite, controlRadioButtonPlaySuite } from "./RadioButton.stories.interactions"; import "./RadioButton.stories.scss"; import Button from "../../Button/Button"; const radioButtonTemplate = createComponentTemplate(RadioButton); export default { title: "Inputs/RadioButton", component: RadioButton }; export const Overview = { render: radioButtonTemplate.bind({}), args: { text: "Selection" }, parameters: { docs: { liveEdit: { isEnabled: false } } } }; export const States = { render: () => ( <> ) }; export const RadioButtonInItemsList = { render: () => (
Inbox view options
), play: clickRadioButtonPlaySuite, name: "Radio button in items list" }; export const ControlledRadioButtons = { render: () => { const [selectedIndex, setSelectedIndex] = useState(0); const onClickCB = useCallback(() => { setSelectedIndex(prev => (prev + 1) % 3); }, [setSelectedIndex]); const onChange = useCallback(() => {}, []); return (
Controlled radio buttons
); }, play: controlRadioButtonPlaySuite, name: "Controlled Radio buttons" };