123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- import React from 'react';
- import styled from '@emotion/styled';
- import {withInfo} from '@storybook/addon-info';
- import Button from 'app/components/button';
- import ButtonBar from 'app/components/buttonBar';
- import Breadcrumbs from 'app/components/breadcrumbs';
- import * as Layout from 'app/components/layouts/thirds';
- import space from 'app/styles/space';
- const crumbs = [
- {
- label: 'Issues',
- to: '',
- },
- {
- label: 'List',
- to: '',
- },
- {
- label: 'Detail',
- to: '',
- },
- ];
- export default {
- title: 'Layouts/Thirds',
- };
- export const _6633Layout = withInfo('Two column layout with header & sidebar')(() => (
- <Container>
- <Layout.Header>
- <Layout.HeaderContent>
- <Layout.Title>Some heading content</Layout.Title>
- </Layout.HeaderContent>
- </Layout.Header>
- <Layout.Body>
- <Layout.Main>
- <h1>Content Region</h1>
- <p>Some text here</p>
- </Layout.Main>
- <Layout.Side>
- <h3>Sidebar content</h3>
- </Layout.Side>
- </Layout.Body>
- </Container>
- ));
- _6633Layout.story = {
- name: '66/33 layout',
- };
- export const _6633WithHeaderControls = withInfo('Two column layout with header actions')(
- () => (
- <Container>
- <Layout.Header>
- <Layout.HeaderContent>
- <Breadcrumbs crumbs={crumbs} />
- <Layout.Title>Some heading content</Layout.Title>
- </Layout.HeaderContent>
- <Layout.HeaderActions>
- <ButtonBar gap={1}>
- <Button>Save</Button>
- <Button>Delete</Button>
- <Button>Update</Button>
- </ButtonBar>
- </Layout.HeaderActions>
- </Layout.Header>
- <Layout.Body>
- <Layout.Main>
- <h1>Content Region</h1>
- <p>Some text here</p>
- </Layout.Main>
- <Layout.Side>
- <h3>Sidebar content</h3>
- </Layout.Side>
- </Layout.Body>
- </Container>
- )
- );
- _6633WithHeaderControls.story = {
- name: '66/33 with header controls',
- };
- export const _6633WithManyHeaderControls = withInfo(
- 'Two column layout with header controls'
- )(() => (
- <Container>
- <Layout.Header>
- <Layout.HeaderContent>
- <Breadcrumbs crumbs={crumbs} />
- <Layout.Title>Heading text</Layout.Title>
- </Layout.HeaderContent>
- <Layout.HeaderActions>
- <MarginedButtonBar gap={1}>
- <Button size="small">Save</Button>
- <Button size="small">Update</Button>
- </MarginedButtonBar>
- <ButtonBar gap={1}>
- <Button size="small">rollup</Button>
- <Button size="small">modify</Button>
- <Button size="small">create</Button>
- <Button size="small">update</Button>
- <Button size="small">delete</Button>
- </ButtonBar>
- </Layout.HeaderActions>
- </Layout.Header>
- <Layout.Body>
- <Layout.Main>
- <h1>Content Region</h1>
- <p>Some text here</p>
- </Layout.Main>
- <Layout.Side>
- <h3>Sidebar content</h3>
- </Layout.Side>
- </Layout.Body>
- </Container>
- ));
- _6633WithManyHeaderControls.story = {
- name: '66/33 with many header controls',
- };
- export const SingleColumnMode = withInfo('Single column mode so we can hide the sidebar')(
- () => (
- <Container>
- <Layout.Header>
- <Layout.HeaderContent>
- <Breadcrumbs crumbs={crumbs} />
- <Layout.Title>Some heading content</Layout.Title>
- </Layout.HeaderContent>
- <Layout.HeaderActions>
- <ButtonBar gap={1}>
- <Button size="small">clicker</Button>
- <Button size="small">clicker</Button>
- </ButtonBar>
- </Layout.HeaderActions>
- </Layout.Header>
- <Layout.Body>
- <Layout.Main fullWidth>
- <h1>Content Region</h1>
- <p>
- Some text here, that goes on and on. It should strecth the full width of the
- container, and have no space on the right.
- </p>
- </Layout.Main>
- </Layout.Body>
- </Container>
- )
- );
- SingleColumnMode.story = {
- name: 'single column mode',
- };
- const Container = styled('div')`
- background: ${p => p.theme.gray200};
- margin: ${space(2)};
- border: 1px solid ${p => p.theme.borderDark};
- `;
- const MarginedButtonBar = styled(ButtonBar)`
- margin-bottom: ${space(1)};
- `;
|