-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(aspect-ratio): update aspect ratio docs for v11 (#10636)
* docs(grid): scope storybook styles * docs(aspect-ratio): update aspect ratio docs for v11 * docs(react): update storybook classes for next
- Loading branch information
Showing
4 changed files
with
117 additions
and
11 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
96 changes: 96 additions & 0 deletions
96
packages/react/src/components/AspectRatio/next/AspectRatio.stories.js
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,96 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2018 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import '../AspectRatio-story.scss'; | ||
|
||
import React from 'react'; | ||
import { Grid, Column } from '../../Grid'; | ||
import { AspectRatio } from '../'; | ||
import mdx from '../AspectRatio.mdx'; | ||
|
||
export default { | ||
title: 'Components/AspectRatio', | ||
component: AspectRatio, | ||
decorators: [ | ||
(Story) => ( | ||
<div className="aspect-ratio-story"> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
parameters: { | ||
docs: { | ||
page: mdx, | ||
}, | ||
}, | ||
}; | ||
|
||
export const AspectRatioStory = () => { | ||
return ( | ||
<Grid> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio="1x1">Content</AspectRatio> | ||
</Column> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio="1x1">Content</AspectRatio> | ||
</Column> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio="1x1">Content</AspectRatio> | ||
</Column> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio="1x1">Content</AspectRatio> | ||
</Column> | ||
</Grid> | ||
); | ||
}; | ||
|
||
AspectRatioStory.storyName = 'AspectRatio'; | ||
|
||
export const Playground = { | ||
argTypes: { | ||
as: { | ||
control: { | ||
type: null, | ||
}, | ||
}, | ||
children: { | ||
control: { | ||
type: null, | ||
}, | ||
}, | ||
className: { | ||
control: { | ||
type: null, | ||
}, | ||
}, | ||
ratio: { | ||
control: { | ||
type: 'select', | ||
}, | ||
defaultValue: '1x1', | ||
options: ['16x9', '9x16', '2x1', '1x2', '4x3', '3x4', '1x1'], | ||
}, | ||
}, | ||
render: ({ ratio }) => { | ||
return ( | ||
<Grid> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio={ratio}>Content</AspectRatio> | ||
</Column> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio={ratio}>Content</AspectRatio> | ||
</Column> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio={ratio}>Content</AspectRatio> | ||
</Column> | ||
<Column sm={1} md={2} lg={4}> | ||
<AspectRatio ratio={ratio}>Content</AspectRatio> | ||
</Column> | ||
</Grid> | ||
); | ||
}, | ||
}; |
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