-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add storybook links to components (#5694)
* Add storybook link * doc: Add Storybook link in doc
- Loading branch information
1 parent
bd56b84
commit 2ff8aa3
Showing
26 changed files
with
595 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Meta, Title, ArgTypes, Description } from '@storybook/blocks'; | ||
import { AppRoot } from './AppRoot'; | ||
|
||
<Meta title="Service/AppRoot" /> | ||
<Title>AppRoot</Title> | ||
|
||
<ArgTypes of={AppRoot} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { CanvasFullLayout, DisableCartesianParam } from '../../storybook/constants'; | ||
import { getAvatarUrl } from '../../testing/mock'; | ||
import { Image, ImageProps } from './Image'; | ||
|
||
const story: Meta<ImageProps> = { | ||
title: 'Blocks/Image', | ||
component: Image, | ||
parameters: { ...CanvasFullLayout, ...DisableCartesianParam }, | ||
}; | ||
|
||
export default story; | ||
|
||
type Story = StoryObj<ImageProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
src: getAvatarUrl('app_shorm_online'), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/vkui/src/components/ModalDismissButton/ModalDismissButton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { CanvasFullLayout, DisableCartesianParam } from '../../storybook/constants'; | ||
import { ModalDismissButton, ModalDismissButtonProps } from './ModalDismissButton'; | ||
|
||
const story: Meta<ModalDismissButtonProps> = { | ||
title: 'Modals/ModalDismissButton', | ||
component: ModalDismissButton, | ||
parameters: { ...CanvasFullLayout, ...DisableCartesianParam }, | ||
}; | ||
|
||
export default story; | ||
|
||
type Story = StoryObj<ModalDismissButtonProps>; | ||
|
||
export const Playground: Story = { | ||
decorators: [ | ||
(Component) => ( | ||
<div style={{ position: 'relative' }}> | ||
<Component /> | ||
</div> | ||
), | ||
], | ||
}; |
67 changes: 67 additions & 0 deletions
67
packages/vkui/src/components/ModalPageHeader/ModalPageHeader.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from 'react'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { Icon24Cancel, Icon24Done } from '@vkontakte/icons'; | ||
import { usePlatform } from '../../hooks/usePlatform'; | ||
import { Platform } from '../../lib/platform'; | ||
import { ModalWrapper } from '../../storybook/ModalWrapper'; | ||
import { withVKUILayout } from '../../storybook/VKUIDecorators'; | ||
import { CanvasFullLayout, DisableCartesianParam } from '../../storybook/constants'; | ||
import { Div } from '../Div/Div'; | ||
import { ModalPage } from '../ModalPage/ModalPage'; | ||
import { PanelHeaderButton } from '../PanelHeaderButton/PanelHeaderButton'; | ||
import { ModalPageHeader, ModalPageHeaderProps } from './ModalPageHeader'; | ||
|
||
const story: Meta<ModalPageHeaderProps> = { | ||
title: 'Modals/ModalPageHeader', | ||
component: ModalPageHeader, | ||
parameters: { ...CanvasFullLayout, ...DisableCartesianParam }, | ||
decorators: [withVKUILayout], | ||
}; | ||
|
||
export default story; | ||
|
||
type Story = StoryObj<ModalPageHeaderProps>; | ||
|
||
const MODAL_ID = 'MODAL_ID'; | ||
|
||
export const Example: Story = { | ||
render: function Render(args) { | ||
const platform = usePlatform(); | ||
|
||
return ( | ||
<ModalWrapper modalId={MODAL_ID}> | ||
<ModalPage | ||
id={MODAL_ID} | ||
header={ | ||
<ModalPageHeader | ||
before={ | ||
<React.Fragment> | ||
{(platform === Platform.ANDROID || platform === Platform.VKCOM) && ( | ||
<PanelHeaderButton> | ||
<Icon24Cancel /> | ||
</PanelHeaderButton> | ||
)} | ||
</React.Fragment> | ||
} | ||
after={ | ||
<React.Fragment> | ||
{(platform === Platform.ANDROID || platform === Platform.VKCOM) && ( | ||
<PanelHeaderButton> | ||
<Icon24Done /> | ||
</PanelHeaderButton> | ||
)} | ||
{platform === Platform.IOS && <PanelHeaderButton>Готово</PanelHeaderButton>} | ||
</React.Fragment> | ||
} | ||
{...args} | ||
> | ||
Заголовок модальной страницы | ||
</ModalPageHeader> | ||
} | ||
> | ||
<Div style={{ height: 1000 }}>Example</Div> | ||
</ModalPage> | ||
</ModalWrapper> | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.