feat: add radio group (#2572)

This commit is contained in:
Whitewater
2023-05-29 08:15:22 -07:00
committed by GitHub
parent 20cc082a02
commit 88eaaf9ce4
8 changed files with 198 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import { useState } from 'react';
import { Button } from '../ui/button/button';
import { DropdownButton } from '../ui/button/dropdown';
import type { ButtonProps } from '../ui/button/interface';
import { RadioButton, RadioButtonGroup } from '../ui/button/radio';
import { Menu } from '../ui/menu/menu';
import { toast } from '../ui/toast/toast';
@@ -91,6 +92,20 @@ Dropdown.args = {
onClickDropDown: () => toast('Click dropdown'),
};
export const RadioGroup: StoryFn = ({ ...props }) => {
return (
<RadioButtonGroup {...props}>
<RadioButton value="all">All</RadioButton>
<RadioButton value="page">Page</RadioButton>
<RadioButton value="edgeless">Edgeless</RadioButton>
</RadioButtonGroup>
);
};
RadioGroup.args = {
defaultValue: 'all',
onValueChange: (value: string) => toast(`Radio value: ${value}`),
};
export const Test: StoryFn<ButtonProps> = () => {
const [input, setInput] = useState('');
return (