mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(component): add storybook (#5079)
This commit is contained in:
13
packages/frontend/component/src/ui/switch/switch.stories.tsx
Normal file
13
packages/frontend/component/src/ui/switch/switch.stories.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Switch, type SwitchProps } from '.';
|
||||
|
||||
export default {
|
||||
title: 'UI/Switch',
|
||||
component: Switch,
|
||||
} satisfies Meta<typeof Switch>;
|
||||
|
||||
const Template: StoryFn<SwitchProps> = args => <Switch {...args} />;
|
||||
|
||||
export const Default: StoryFn<SwitchProps> = Template.bind(undefined);
|
||||
Default.args = {};
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
|
||||
import * as styles from './index.css';
|
||||
|
||||
type SwitchProps = Omit<HTMLAttributes<HTMLLabelElement>, 'onChange'> & {
|
||||
export type SwitchProps = Omit<HTMLAttributes<HTMLLabelElement>, 'onChange'> & {
|
||||
checked?: boolean;
|
||||
onChange?: (checked: boolean) => void;
|
||||
children?: ReactNode;
|
||||
|
||||
Reference in New Issue
Block a user