-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1520 from creative-commoners/pulls/2/storybook-docs
ENH Storybook documentation
- Loading branch information
Showing
45 changed files
with
3,218 additions
and
1,504 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
Large diffs are not rendered by default.
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
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,80 @@ | ||
import React from 'react'; | ||
import { jsxDecorator } from 'storybook-addon-jsx'; | ||
import { action } from '@storybook/addon-actions'; | ||
import BackButton from '../BackButton'; | ||
|
||
const colors = [ | ||
'primary', | ||
'secondary', | ||
'success', | ||
'info', | ||
'warning', | ||
'danger', | ||
'link', | ||
]; | ||
const sizes = ['sm', 'md', 'lg']; | ||
const icons = [ | ||
'', | ||
'search', | ||
'sync', | ||
'plus-circled', | ||
'cancel-circled', | ||
'check-mark', | ||
'edit', | ||
]; | ||
|
||
const onClick = (event) => { | ||
event.preventDefault(); | ||
return action('onClick')(event); | ||
}; | ||
onClick.toString = () => 'onClick'; | ||
|
||
export default { | ||
title: 'Admin/Buttons/BackButton', | ||
component: BackButton, | ||
decorators: [ | ||
jsxDecorator | ||
], | ||
tags: ['autodocs'], | ||
parameters: { | ||
docs: { | ||
description: { | ||
component: 'Generic Button component to allow users to return to a preview view. It displays a `<` icon and has an appropriate `aria-label.' | ||
}, | ||
canvas: { | ||
sourceState: 'shown', | ||
}, | ||
controls: { | ||
sort: 'alpha', | ||
} | ||
} | ||
}, | ||
argTypes: { | ||
children: { | ||
description: "If present, any nested content inside the button will apply to the `aria-label` attribute. Otherwise, the localised string 'Back' will be used.", | ||
control: 'text', | ||
table: { | ||
type: { summary: 'string' }, | ||
}, | ||
}, | ||
className: { | ||
control: 'text', | ||
table: { | ||
type: { summary: 'string' }, | ||
} | ||
}, | ||
onClick: { | ||
action: 'clicked', | ||
table: { | ||
type: { summary: 'function' }, | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export const _BackButton = (args) => <BackButton {...args}/>; | ||
_BackButton.args = { | ||
onClick, | ||
className: '', | ||
children: 'Back' | ||
}; |
Oops, something went wrong.