mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
feat: add radio group (#2572)
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user