-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(components): sub in storybook for styleguidist (#7549)
Co-authored-by: Mike Cousins <[email protected]>
- Loading branch information
Showing
111 changed files
with
5,093 additions
and
4,435 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
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
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,13 @@ | ||
'use strict' | ||
|
||
const { baseConfig } = require('@opentrons/webpack-config') | ||
|
||
module.exports = { | ||
webpackFinal: config => ({ | ||
...config, | ||
module: { ...config.module, rules: baseConfig.module.rules }, | ||
plugins: [...config.plugins, ...baseConfig.plugins], | ||
}), | ||
stories: ['../components/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
} |
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,17 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
} | ||
|
||
import React from 'react' | ||
|
||
import { GlobalStyle } from '../app/src/atoms/GlobalStyle' | ||
|
||
// Global decorator to apply the styles to all stories | ||
export const decorators = [ | ||
Story => ( | ||
<> | ||
<GlobalStyle /> | ||
<Story /> | ||
</> | ||
), | ||
] |
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
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
import * as React from 'react' | ||
import { AlertItem } from './AlertItem' | ||
|
||
import type { Story, Meta } from '@storybook/react' | ||
|
||
export default { | ||
title: 'Library/Molecules/AlertItem', | ||
component: AlertItem, | ||
argTypes: { onCloseClick: { action: 'clicked' } }, | ||
} as Meta | ||
|
||
const Template: Story<React.ComponentProps<typeof AlertItem>> = args => ( | ||
<AlertItem {...args} /> | ||
) | ||
|
||
export const Basic = Template.bind({}) | ||
Basic.args = { | ||
type: 'success', | ||
title: 'good job!', | ||
} | ||
|
||
export const OverriddenIcon = Template.bind({}) | ||
OverriddenIcon.args = { | ||
type: 'info', | ||
title: 'Alert with overridden icon', | ||
icon: { name: 'pause-circle' }, | ||
} | ||
|
||
export const Stackable: Story< | ||
React.ComponentProps<typeof AlertItem> | ||
> = args => ( | ||
<div> | ||
<Template {...args} type="warning" title={'Warning with close button'} /> | ||
<Template | ||
{...args} | ||
onCloseClick={undefined} | ||
type="warning" | ||
title={'Warning with no close button'} | ||
/> | ||
<Template {...args} type="warning" title={'Warning with no children'} /> | ||
<Template | ||
{...args} | ||
type="warning" | ||
title={'Warning with React Node children'} | ||
> | ||
<p>Some additional info</p> | ||
</Template> | ||
</div> | ||
) |
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
Oops, something went wrong.