|
|
@ -1,4 +1,3 @@ |
|
|
|
import { select } from '@storybook/addon-knobs'; |
|
|
|
|
|
|
|
import React, { useState } from 'react'; |
|
|
|
import React, { useState } from 'react'; |
|
|
|
import { |
|
|
|
import { |
|
|
|
COLORS, |
|
|
|
COLORS, |
|
|
@ -12,9 +11,17 @@ import Callout from './callout'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
title: 'Components/UI/Callout', |
|
|
|
title: 'Components/UI/Callout', |
|
|
|
id: __filename, |
|
|
|
id: __filename, |
|
|
|
|
|
|
|
argTypes: { |
|
|
|
|
|
|
|
severity: { |
|
|
|
|
|
|
|
control: { |
|
|
|
|
|
|
|
type: 'select', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
options: Object.values(SEVERITIES), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const PersistentCallout = () => ( |
|
|
|
export const PersistentCallout = (args) => ( |
|
|
|
<Box borderColor={COLORS.UI2} padding={[8, 0, 0, 0]}> |
|
|
|
<Box borderColor={COLORS.UI2} padding={[8, 0, 0, 0]}> |
|
|
|
<Box margin={2}> |
|
|
|
<Box margin={2}> |
|
|
|
<Typography variant={TYPOGRAPHY.H4}>This is your private key:</Typography> |
|
|
|
<Typography variant={TYPOGRAPHY.H4}>This is your private key:</Typography> |
|
|
@ -22,13 +29,11 @@ export const PersistentCallout = () => ( |
|
|
|
some seed words that are super important and probably deserve a callout |
|
|
|
some seed words that are super important and probably deserve a callout |
|
|
|
</Typography> |
|
|
|
</Typography> |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
<Callout severity={select('severity', SEVERITIES, SEVERITIES.WARNING)}> |
|
|
|
<Callout {...args}>Always back up your private key!</Callout> |
|
|
|
Always back up your private key! |
|
|
|
|
|
|
|
</Callout> |
|
|
|
|
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
export const DismissibleCallout = () => { |
|
|
|
export const DismissibleCallout = (args) => { |
|
|
|
const [dismissed, setDismissed] = useState(false); |
|
|
|
const [dismissed, setDismissed] = useState(false); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Box borderColor={COLORS.UI2} padding={[8, 0, 0, 0]}> |
|
|
|
<Box borderColor={COLORS.UI2} padding={[8, 0, 0, 0]}> |
|
|
@ -42,10 +47,7 @@ export const DismissibleCallout = () => { |
|
|
|
</Typography> |
|
|
|
</Typography> |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
{!dismissed && ( |
|
|
|
{!dismissed && ( |
|
|
|
<Callout |
|
|
|
<Callout {...args} dismiss={() => setDismissed(true)}> |
|
|
|
severity={select('severity', SEVERITIES, SEVERITIES.WARNING)} |
|
|
|
|
|
|
|
dismiss={() => setDismissed(true)} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
Always back up your private key! |
|
|
|
Always back up your private key! |
|
|
|
</Callout> |
|
|
|
</Callout> |
|
|
|
)} |
|
|
|
)} |
|
|
|