|
| 1 | +import type { ComponentStory, ComponentMeta } from '@storybook/react'; |
| 2 | +import React from 'react'; |
| 3 | + |
| 4 | +import { |
| 5 | + Contextualbar, |
| 6 | + ContextualbarAction, |
| 7 | + ContextualbarActions, |
| 8 | + ContextualbarButton, |
| 9 | + ContextualbarContent, |
| 10 | + ContextualbarEmptyContent, |
| 11 | + ContextualbarFooter, |
| 12 | + ContextualbarHeader, |
| 13 | + ContextualbarSkeleton, |
| 14 | + ContextualbarTitle, |
| 15 | +} from '.'; |
| 16 | +import { Button, ButtonGroup, IconButton, Box } from '..'; |
| 17 | + |
| 18 | +export default { |
| 19 | + title: 'Containers/Contextualbar', |
| 20 | + component: Contextualbar, |
| 21 | + parameters: { |
| 22 | + docs: { |
| 23 | + description: { |
| 24 | + component: `The \`Contextualbar\` has the purpose to persist and input information about the scope of the related page. |
| 25 | + `, |
| 26 | + }, |
| 27 | + }, |
| 28 | + }, |
| 29 | + decorators: [ |
| 30 | + (storyFn) => ( |
| 31 | + <Box width='x400' elevation='2'> |
| 32 | + {storyFn()} |
| 33 | + </Box> |
| 34 | + ), |
| 35 | + ], |
| 36 | +} as ComponentMeta<typeof Contextualbar>; |
| 37 | + |
| 38 | +export const Default: ComponentStory<typeof Contextualbar> = () => ( |
| 39 | + <Contextualbar position='static' height='x540'> |
| 40 | + <ContextualbarHeader> |
| 41 | + <ContextualbarAction name='chevron-right' /> |
| 42 | + <ContextualbarAction title='Back' name='arrow-back' /> |
| 43 | + <ContextualbarTitle>Contextualbar Title</ContextualbarTitle> |
| 44 | + <ContextualbarActions> |
| 45 | + <ContextualbarAction |
| 46 | + title='Title' |
| 47 | + name='new-window' |
| 48 | + onClick={() => {}} |
| 49 | + /> |
| 50 | + <ContextualbarAction |
| 51 | + name='add-user' |
| 52 | + onClick={() => console.log('close')} |
| 53 | + /> |
| 54 | + </ContextualbarActions> |
| 55 | + </ContextualbarHeader> |
| 56 | + <ContextualbarContent>Contextualbar Content</ContextualbarContent> |
| 57 | + <ContextualbarFooter> |
| 58 | + <ButtonGroup> |
| 59 | + <ContextualbarButton width='full' secondary> |
| 60 | + Cancel |
| 61 | + </ContextualbarButton> |
| 62 | + <Button width='full' primary> |
| 63 | + Save |
| 64 | + </Button> |
| 65 | + <IconButton icon='menu' /> |
| 66 | + </ButtonGroup> |
| 67 | + </ContextualbarFooter> |
| 68 | + </Contextualbar> |
| 69 | +); |
| 70 | + |
| 71 | +export const Skeleton: ComponentStory<typeof Contextualbar> = () => ( |
| 72 | + <ContextualbarSkeleton position='static' height='x540' /> |
| 73 | +); |
| 74 | + |
| 75 | +export const Empty: ComponentStory<typeof Contextualbar> = () => ( |
| 76 | + <Contextualbar position='static' height='x540'> |
| 77 | + <ContextualbarHeader> |
| 78 | + <ContextualbarAction name='chevron-right' /> |
| 79 | + <ContextualbarTitle>Contextualbar Empty</ContextualbarTitle> |
| 80 | + <ContextualbarActions> |
| 81 | + <ContextualbarAction |
| 82 | + title='Title' |
| 83 | + name='new-window' |
| 84 | + onClick={() => {}} |
| 85 | + /> |
| 86 | + </ContextualbarActions> |
| 87 | + </ContextualbarHeader> |
| 88 | + <ContextualbarEmptyContent /> |
| 89 | + <ContextualbarFooter>Footer</ContextualbarFooter> |
| 90 | + </Contextualbar> |
| 91 | +); |
0 commit comments