diff --git a/storybook/shared/box.js b/storybook/shared/box.js new file mode 100644 index 000000000..01da5f4e6 --- /dev/null +++ b/storybook/shared/box.js @@ -0,0 +1,71 @@ +// @flow +import * as React from 'react' +import { Grid, Col } from 'gymnast' +import type { Spacing } from '../../src/types' +import { + axonBlack, + axonGold, + nomuraGray, + bolt, + white, +} from '../../src/dev/colors' + +const typeMap = { + A: 1, + B: 2, + C: 3, + D: 4, + E: 5, +} + +export const colors = { + colors1: { + color: axonGold, + backgroundColor: axonBlack, + }, + colors2: { + color: bolt, + backgroundColor: nomuraGray, + }, + colors3: { + color: axonBlack, + backgroundColor: axonGold, + }, + colors4: { + color: nomuraGray, + backgroundColor: bolt, + }, + colors5: { + color: axonBlack, + backgroundColor: white, + }, +} + +type BoxProps = { + type: $Keys, + style?: Object, + children?: React.Node, + value?: string, + margin?: Spacing, +} + +export function Box({ + children, + style = {}, + type, + value = type, + ...props +}: BoxProps) { + return ( + + + {children || value} + + + ) +} diff --git a/storybook/shared/components.js b/storybook/shared/components.js deleted file mode 100644 index ef4c7b74c..000000000 --- a/storybook/shared/components.js +++ /dev/null @@ -1,112 +0,0 @@ -// @flow -import * as React from 'react' -import { - Col as GymnastCol, - Grid as GymnastGrid, - Layout as GymnastLayout, - Root, -} from 'gymnast' -import type { Spacing, Height } from '../../src/types' -import { - axonBlack, - axonGold, - nomuraGray, - bolt, - white, -} from '../../src/dev/colors' - -const typeMap = { - A: 1, - B: 2, - C: 3, - D: 4, - E: 5, -} - -const colors = { - colors1: { - color: axonGold, - backgroundColor: axonBlack, - }, - colors2: { - color: bolt, - backgroundColor: nomuraGray, - }, - colors3: { - color: axonBlack, - backgroundColor: axonGold, - }, - colors4: { - color: nomuraGray, - backgroundColor: bolt, - }, - colors5: { - color: axonBlack, - backgroundColor: white, - }, -} - -type Dev = 1 | 2 | 3 | 4 | 5 | void -type BoxProps = { - type: $Keys, - style?: Object, - children?: React.Node, - value?: string, - margin?: Spacing, -} -type Props = { - dev?: Dev, - style?: Object, -} - -function withDev(Component: *) { - return function WrappedDevMode({ dev, style = {}, ...props }: Props) { - return ( - - ) - } -} - -export const Col = withDev(GymnastCol) -export const Grid = withDev(GymnastGrid) -export const Layout = withDev(GymnastLayout) -export function Box({ - children, - margin, - style, - type, - value = type, - ...props -}: BoxProps) { - return ( - - - {children || value} - - - ) -} -export function RootLayout({ - height = 'parent', - ...props -}: { - height?: Height, -}) { - return ( - - - - ) -} diff --git a/storybook/shared/index.js b/storybook/shared/index.js index 9d4fdd0eb..b4282d1da 100644 --- a/storybook/shared/index.js +++ b/storybook/shared/index.js @@ -3,5 +3,5 @@ import loremIpsumTxt from './loremIpsum.txt' export { default as getMarginSelect } from './margin' export { default as getPositionSelect } from './position' -export * from './components' +export * from './box' export const loremIpsum = loremIpsumTxt diff --git a/storybook/stories/components/card/base.js b/storybook/stories/components/card/base.js index 4cfd8dcfc..59a592df7 100644 --- a/storybook/stories/components/card/base.js +++ b/storybook/stories/components/card/base.js @@ -1,66 +1,69 @@ // @flow import * as React from 'react' -import { Grid, Col, RootLayout } from '../../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { colors } from '../../../shared' export default () => ( - - - -

Consistent Padding

- + + + + +

Consistent Padding

+ - - - All around padding + + + All around padding + - - - - Full Bleed + + + Full Bleed + - - - -

Mixed Padding

-
- - - Padding + +

Mixed Padding

- - No padding - - - - - No padding - - - Padding - - - No padding - - + + + Padding + + + No padding + + - - - No padding - - - Padding - - - - - Padding - - - No padding - - -
-
+ + + No padding + + + Padding + + + No padding + + + + + + No padding + + + Padding + + + + + Padding + + + No padding + + + + + ) diff --git a/storybook/stories/components/card/composite.js b/storybook/stories/components/card/composite.js index 6d411c2e3..34beb09f8 100644 --- a/storybook/stories/components/card/composite.js +++ b/storybook/stories/components/card/composite.js @@ -1,118 +1,121 @@ // @flow import * as React from 'react' -import { RootLayout, Box, Grid, Col } from '../../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { Box, colors } from '../../../shared' export default () => ( - - - -

Composite Card

- + + + + +

Composite Card

+ - - - -

Card Title

-
- - - -

Section 1

- - - - Box 1 - - - Box 2 - - - Box 3 - - - Box 4 - - - Box 5 - - - Box 6 - - - -

Section 2

- - - - Box 1 - - - Box 2 - - Box 3 + + + +

Card Title

-
- - -

Subtitle here

+ + + +

Section 1

+ + + + Box 1 + + + Box 2 + + + Box 3 + + + Box 4 + + + Box 5 + + + Box 6 + + + +

Section 2

+ + + + Box 1 + + + Box 2 + + Box 3 +
- - - - -

Title

- - - test - -
- - - - Box 1 - - - - - Box 2 - - - - - Box 3 - - - - - Box 4 - - - - - Box 5 - - - - - Box 6 - - - - - Box 7 - - - - - Box 8 - - + + +

Subtitle here

+
+ + + + +

Title

+ + + test + +
+ + + + Box 1 + + + + + Box 2 + + + + + Box 3 + + + + + Box 4 + + + + + Box 5 + + + + + Box 6 + + + + + Box 7 + + + + + Box 8 + + +
-
- -
-
+ + + + ) diff --git a/storybook/stories/components/card/filter.js b/storybook/stories/components/card/filter.js index 4c597816a..579843816 100644 --- a/storybook/stories/components/card/filter.js +++ b/storybook/stories/components/card/filter.js @@ -1,12 +1,13 @@ // @flow import * as React from 'react' -import { RootLayout, loremIpsum, Grid, Col } from '../../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { loremIpsum, colors } from '../../../shared' export default () => { function ListItem({ index }: { index: number }) { return ( @@ -24,51 +25,53 @@ export default () => { } return ( - - - -

Filter List

- - - - - - -

Title

-
- - X + + + + +

Filter List

+ + + + + + +

Title

+
+ + X +
-
- - - Filter by... + + + Filter by... + + + + - - - - - - - - - - + + + + + + - -

{loremIpsum.substr(0, 100)}

-
- - - - - + +

{loremIpsum.substr(0, 100)}

+
+ + + + + +
-
- + +
-
-
+ + ) } diff --git a/storybook/stories/components/card/profile.js b/storybook/stories/components/card/profile.js index 8979fbda8..59d27a68e 100644 --- a/storybook/stories/components/card/profile.js +++ b/storybook/stories/components/card/profile.js @@ -1,75 +1,78 @@ // @flow import * as React from 'react' -import { RootLayout, Grid, Col } from '../../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { colors } from '../../../shared' export default () => ( - - - -

User Profile

- - + + - - Full Bleed + +

User Profile

- - - - -

Title

- - - Note - + + + Full Bleed + + + + + + +

Title

+ + + Note + - + + Text1 + + + Text2 + + + Text3 + + + Text4 + + + Text5 + + + + Text6 + + + Text7 + + + Text8 + + + Text9 + +
+
+ + Text1 - + Text2 - + Text3 - + Text4 - - Text5 - - - - Text6 - - - Text7 - - - Text8 - - - Text9 - -
- - - Text1 - - - Text2 - - - Text3 - - - Text4 - - - + +
-
-
+ + ) diff --git a/storybook/stories/components/header/app.js b/storybook/stories/components/header/app.js index e7a749c3b..004062eb2 100644 --- a/storybook/stories/components/header/app.js +++ b/storybook/stories/components/header/app.js @@ -1,31 +1,31 @@ // @flow import * as React from 'react' -import { Offset, Root } from 'gymnast' -import { Grid, Col, Layout } from '../../../shared' +import { Offset, Root, Grid, Col, Layout } from 'gymnast' +import { colors } from '../../../shared' import styles from '../../../shared/stories.css' export default () => ( - + - + Lorem - + ipsum - + dolor - + sit amet - + consectetur - + diff --git a/storybook/stories/components/header/basic.js b/storybook/stories/components/header/basic.js index ff029c094..a7d945ed2 100644 --- a/storybook/stories/components/header/basic.js +++ b/storybook/stories/components/header/basic.js @@ -1,30 +1,33 @@ // @flow import * as React from 'react' import { times } from 'lodash' +import { Root, Layout, Grid } from 'gymnast' import { number } from '@storybook/addon-knobs' -import { Box, Grid, RootLayout } from '../../../shared' +import { Box } from '../../../shared' export default () => { const items = number('Items', 6, { range: true, min: 1, max: 6 }) return ( - - - - -

Page Title

-
- - -
- - {times(items, i => ( - - ))} - - - - -
+ + + + + +

Page Title

+
+ + +
+ + {times(items, i => ( + + ))} + + + + +
+
) } diff --git a/storybook/stories/components/pagination/pagination.js b/storybook/stories/components/pagination/pagination.js index d6e639dc0..f0a8229da 100644 --- a/storybook/stories/components/pagination/pagination.js +++ b/storybook/stories/components/pagination/pagination.js @@ -1,31 +1,34 @@ // @flow import * as React from 'react' import { number } from '@storybook/addon-knobs' -import { RootLayout, Box, Grid } from '../../../shared' +import { Root, Layout, Grid } from 'gymnast' +import { Box } from '../../../shared' export default () => { const size = number('Size', 12, { range: true, min: 7, max: 12 }) return ( - - - - - - ... - - - - - - - - - ... - - - - - + + + + + + + ... + + + + + + + + + ... + + + + + + ) } diff --git a/storybook/stories/components/search/filters.js b/storybook/stories/components/search/filters.js index f04ac248d..e8586a97a 100644 --- a/storybook/stories/components/search/filters.js +++ b/storybook/stories/components/search/filters.js @@ -1,25 +1,26 @@ // @flow import * as React from 'react' -import { Grid, Col } from '../../../shared' +import { Col, Grid } from 'gymnast' +import { colors } from '../../../shared' import type { Size } from '../../../../src/types' export default function SearchFilters(props: { size?: Size }) { return ( - + Filter by - + Type 1 + - + Type 2 + - + Type 3 + - + Type 4 + diff --git a/storybook/stories/components/search/nav.js b/storybook/stories/components/search/nav.js index ced2f514c..8b2a639c0 100644 --- a/storybook/stories/components/search/nav.js +++ b/storybook/stories/components/search/nav.js @@ -1,11 +1,11 @@ // @flow import * as React from 'react' -import { Root } from 'gymnast' -import { Grid, Col, Layout } from '../../../shared' +import { Root, Grid, Col, Layout } from 'gymnast' +import { colors } from '../../../shared' export default function SearchNav() { return ( - + @@ -17,8 +17,7 @@ export default function SearchNav() { marginLeft={0} marginBottom={0} size="auto" - style={{ whiteSpace: 'nowrap' }} - dev={1} + style={{ whiteSpace: 'nowrap', ...colors.colors1 }} > Lorem @@ -26,31 +25,28 @@ export default function SearchNav() { size="auto" marginLeft={0} marginBottom={0} - dev={2} - style={{ whiteSpace: 'nowrap' }} + style={{ whiteSpace: 'nowrap', ...colors.colors2 }} > ipsum dolor sit amet - + First View  |   Second View diff --git a/storybook/stories/components/search/results.js b/storybook/stories/components/search/results.js index 4d92dd807..30158a3ed 100644 --- a/storybook/stories/components/search/results.js +++ b/storybook/stories/components/search/results.js @@ -1,8 +1,8 @@ // @flow import * as React from 'react' -import { type Size } from 'gymnast' +import { type Size, Grid, Col } from 'gymnast' import { times } from 'lodash' -import { Grid, Col } from '../../../shared' +import { colors } from '../../../shared' import styles from '../../../shared/stories.css' export default function SearchResults({ @@ -15,20 +15,20 @@ export default function SearchResults({ size?: Size, } = {}) { return ( - + - + < Page 1 of 12 - + > @@ -39,10 +39,10 @@ export default function SearchResults({ * Explicitly setting height to work around cross browser font height differences */} - + Orci tempus venenatis - + 1/6/2017 at 14:50 - 1700 Minor Ave @@ -52,10 +52,10 @@ export default function SearchResults({ - + status text ipsum - status sub lorem + status sub lorem diff --git a/storybook/stories/configProvider/columns.js b/storybook/stories/configProvider/columns.js index 4141150e9..4f69917c1 100644 --- a/storybook/stories/configProvider/columns.js +++ b/storybook/stories/configProvider/columns.js @@ -2,8 +2,8 @@ import * as React from 'react' import { times } from 'lodash' import { number } from '@storybook/addon-knobs' -import { ConfigProvider } from 'gymnast' -import { Grid } from '../../shared' +import { ConfigProvider, Grid } from 'gymnast' +import { colors } from '../../shared' export default function() { const columns = number('Columns', 10, { range: true, min: 1, max: 24 }) @@ -14,7 +14,12 @@ export default function() { {times(items, key => ( - + {key + 1} diff --git a/storybook/stories/configProvider/gutter.js b/storybook/stories/configProvider/gutter.js index 51d091796..78d615669 100644 --- a/storybook/stories/configProvider/gutter.js +++ b/storybook/stories/configProvider/gutter.js @@ -2,8 +2,8 @@ import * as React from 'react' import { times } from 'lodash' import { number } from '@storybook/addon-knobs' -import { ConfigProvider } from 'gymnast' -import { Grid, Col } from '../../shared' +import { ConfigProvider, Grid, Col } from 'gymnast' +import { colors } from '../../shared' export default function() { const gutter = number('Gutter', 2, { range: true, min: 1, max: 24 }) @@ -25,7 +25,7 @@ export default function() { {times(6, key => ( - Full Width + Full Width diff --git a/storybook/stories/configProvider/spacingAliases.js b/storybook/stories/configProvider/spacingAliases.js index 718baae21..2208aa9f7 100644 --- a/storybook/stories/configProvider/spacingAliases.js +++ b/storybook/stories/configProvider/spacingAliases.js @@ -1,8 +1,8 @@ // @flow import * as React from 'react' import { number } from '@storybook/addon-knobs' -import { ConfigProvider } from 'gymnast' -import { Grid } from '../../shared' +import { ConfigProvider, Grid } from 'gymnast' +import { colors } from '../../shared' export default function() { const base = number('base', 24, { range: true, min: 8, max: 24, step: 8 }) @@ -22,17 +22,17 @@ export default function() { return ( - - My margins are set using aliases! + + My margins are set using aliases! - - My paddings are set using aliases! + + My paddings are set using aliases! - - My margins are set using aliases! + + My margins are set using aliases! - - My paddings are set using aliases! + + My paddings are set using aliases! diff --git a/storybook/stories/examples/cards.js b/storybook/stories/examples/cards.js index efc88c6e2..0bc162b2f 100644 --- a/storybook/stories/examples/cards.js +++ b/storybook/stories/examples/cards.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react' -import { Root } from 'gymnast' -import { Box, Grid, Layout } from '../../shared' +import { Root, Grid, Layout } from 'gymnast' +import { Box, colors } from '../../shared' import styles from './layout.css' const SIZE = { @@ -13,14 +13,14 @@ const SIZE = { export default () => ( - +

Header

- + @@ -49,7 +49,7 @@ export default () => (
- +

Footer

diff --git a/storybook/stories/examples/holyGrail.js b/storybook/stories/examples/holyGrail.js index e1827eed6..2dacc2f65 100644 --- a/storybook/stories/examples/holyGrail.js +++ b/storybook/stories/examples/holyGrail.js @@ -1,8 +1,8 @@ // @flow import * as React from 'react' import { boolean } from '@storybook/addon-knobs' -import { Root } from 'gymnast' -import { loremIpsum, Grid, Layout } from '../../shared' +import { Root, Grid, Layout } from 'gymnast' +import { loremIpsum, colors } from '../../shared' import styles from './layout.css' export default () => { @@ -10,7 +10,7 @@ export default () => { return ( - +

Header

@@ -20,7 +20,7 @@ export default () => { - +

Nav

@@ -37,7 +37,7 @@ export default () => {
{includeText &&

{loremIpsum}

}
- +

Ads

@@ -45,7 +45,7 @@ export default () => {
- +

Footer

diff --git a/storybook/stories/examples/report.js b/storybook/stories/examples/report.js index 6c0fa544d..4c7456497 100644 --- a/storybook/stories/examples/report.js +++ b/storybook/stories/examples/report.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react' -import { Root } from 'gymnast' -import { loremIpsum, Grid, Layout, Col } from '../../shared' +import { Root, Grid, Layout, Col } from 'gymnast' +import { loremIpsum, colors } from '../../shared' import styles from './report.css' import { page } from './layout.css' @@ -16,7 +16,12 @@ function P(props) { function Li({ index }: { index: number }) { return (
  • - + Item {index}
  • @@ -32,7 +37,7 @@ function Card({ }): React.Element { return ( - + {children} @@ -43,42 +48,42 @@ export default function() { return ( - +

    Header

    - +

    Subheader

    - + Lorem - + ipsum - + dolor - + sit amet, consectetur - + sit amet @@ -86,7 +91,7 @@ export default function() {
    - + @@ -124,14 +129,19 @@ export default function() {

    {loremIpsum.substr(0, 250)}...

    - + Side bar
    - +

    Footer

    diff --git a/storybook/stories/examples/search.js b/storybook/stories/examples/search.js index bd12d78c4..03543240c 100644 --- a/storybook/stories/examples/search.js +++ b/storybook/stories/examples/search.js @@ -1,10 +1,10 @@ // @flow import * as React from 'react' -import { Root } from 'gymnast' +import { Root, Grid, Layout } from 'gymnast' import { number } from '@storybook/addon-knobs' import styles from './layout.css' -import { Grid, Layout } from '../../shared' +import { colors } from '../../shared' import Header from '../components/header/app' import SearchFilters from '../components/search/filters' import SearchNav from '../components/search/nav' @@ -22,7 +22,7 @@ export default () => { style={{ marginTop: 40 }} > - + @@ -30,7 +30,7 @@ export default () => { - +

    Footer

    diff --git a/storybook/stories/examples/twoSections.js b/storybook/stories/examples/twoSections.js index 92d9cfb93..d35b08b44 100644 --- a/storybook/stories/examples/twoSections.js +++ b/storybook/stories/examples/twoSections.js @@ -1,8 +1,8 @@ // @flow import * as React from 'react' import { boolean } from '@storybook/addon-knobs' -import { Root } from 'gymnast' -import { loremIpsum, Grid, Layout, Col } from '../../shared' +import { Root, Grid, Layout, Col } from 'gymnast' +import { loremIpsum, colors } from '../../shared' import styles from './layout.css' export default () => { @@ -10,7 +10,7 @@ export default () => { return ( - +

    Header

    @@ -18,7 +18,7 @@ export default () => {
    - + @@ -40,7 +40,7 @@ export default () => { - +

    Footer

    diff --git a/storybook/stories/grid/align.js b/storybook/stories/grid/align.js index c05a69794..2f25552b7 100644 --- a/storybook/stories/grid/align.js +++ b/storybook/stories/grid/align.js @@ -2,7 +2,8 @@ import * as React from 'react' import { times } from 'lodash' import { boolean, number } from '@storybook/addon-knobs' -import { RootLayout, Box, Grid, Col } from '../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { Box } from '../../shared' function ReferenceColumn({ height }: { height: number }) { return ( @@ -28,39 +29,45 @@ export default () => { }) return ( - - -

    Item Align

    - - - - - - - - - -

    Grid Align

    - - - - {times(items, i => )} + + + +

    Item Align

    + + + + + + + - - {times(items, i => )} + +

    Grid Align

    + + + + {times(items, i => )} + + + {times(items, i => )} + + + {times(items, i => )} + - - {times(items, i => )} - -
    -
    +
    +
    ) } diff --git a/storybook/stories/grid/autoflow.js b/storybook/stories/grid/autoflow.js index ddca1e1bc..b767b9f09 100644 --- a/storybook/stories/grid/autoflow.js +++ b/storybook/stories/grid/autoflow.js @@ -2,7 +2,8 @@ import * as React from 'react' import { times } from 'lodash' import { number, boolean } from '@storybook/addon-knobs' -import { Box, RootLayout, Grid, getMarginSelect } from '../../shared' +import { Grid, Root, Layout } from 'gymnast' +import { Box, getMarginSelect } from '../../shared' export default () => { const items = number('Items', 5, { range: true, min: 0, max: 100 }) @@ -12,31 +13,33 @@ export default () => { const margin = getMarginSelect() return ( - - - - - - - - {times(items, index => ( + + + + + + + - ))} - - + {times(items, index => ( + + ))} +
    +
    +
    ) } diff --git a/storybook/stories/grid/fit.js b/storybook/stories/grid/fit.js index e24c24252..34ec90f12 100644 --- a/storybook/stories/grid/fit.js +++ b/storybook/stories/grid/fit.js @@ -2,7 +2,8 @@ import * as React from 'react' import { times } from 'lodash' import { number } from '@storybook/addon-knobs' -import { RootLayout, Grid, Col } from '../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { colors } from '../../shared' type ItemProps = { text: string, @@ -10,7 +11,7 @@ type ItemProps = { const Item = ({ text, ...props }: ItemProps) => ( - + {text} @@ -21,15 +22,17 @@ export default () => { const fitItems = number('Fit Items', 1, { range: true, min: 0, max: 5 }) return ( - - - {times(autoItems, i => ( - - ))} - {times(fitItems, i => ( - - ))} - - + + + + {times(autoItems, i => ( + + ))} + {times(fitItems, i => ( + + ))} + + + ) } diff --git a/storybook/stories/grid/format.js b/storybook/stories/grid/format.js index 8fd9fcfb7..ff7253834 100644 --- a/storybook/stories/grid/format.js +++ b/storybook/stories/grid/format.js @@ -1,6 +1,7 @@ // @flow import * as React from 'react' -import { RootLayout, Box, Grid, Col } from '../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { Box } from '../../shared' const marginFormats = [ { @@ -36,20 +37,22 @@ const marginFormats = [ ] export default () => ( - - {marginFormats.map(({ margin, title, key }) => ( - - -

    {title}

    - - - {JSON.stringify(margin)} - - - - + + + {marginFormats.map(({ margin, title, key }) => ( + + +

    {title}

    + + + {JSON.stringify(margin)} + + + + +
    -
    - ))} -
    + ))} +
    +
    ) diff --git a/storybook/stories/grid/fraction.js b/storybook/stories/grid/fraction.js index eb566b737..9e5e4daa4 100644 --- a/storybook/stories/grid/fraction.js +++ b/storybook/stories/grid/fraction.js @@ -2,74 +2,77 @@ import * as React from 'react' import { times } from 'lodash' import { number } from '@storybook/addon-knobs' -import { RootLayout, Box, getMarginSelect, Grid, Col } from '../../shared' +import { Root, Layout, Grid, Col } from 'gymnast' +import { Box, getMarginSelect } from '../../shared' export default () => { const items = number('Items', 0, { range: true, min: 0, max: 5 }) const margin = getMarginSelect(undefined, 'Item') return ( - - -

    Auto Size

    - - {times(9, size => ( - - {times(size + items, i => ( + + + +

    Auto Size

    + + {times(9, size => ( + + {times(size + items, i => ( + + ))} + + ))} + + +

    8 - auto

    + + + + + + + +

    6 - 1/2 - 1/2

    + + + + + + + + +

    Custom

    + + + {times(items, index => ( + ))} + + + + {times(items, index => ( + ))} - ))} - - -

    8 - auto

    - - - - - - - -

    6 - 1/2 - 1/2

    - - - - - - - - -

    Custom

    - - - {times(items, index => ( - - ))} - - - - {times(items, index => ( - - ))} - -
    +
    +
    ) } diff --git a/storybook/stories/grid/justify.js b/storybook/stories/grid/justify.js index 7ab5ea287..b4ce7c90d 100644 --- a/storybook/stories/grid/justify.js +++ b/storybook/stories/grid/justify.js @@ -1,7 +1,8 @@ // @flow import * as React from 'react' import { number, select } from '@storybook/addon-knobs' -import { RootLayout, Box, Grid } from '../../shared' +import { Root, Layout, Grid } from 'gymnast' +import { Box } from '../../shared' const justifyType = { Default: undefined, @@ -24,22 +25,24 @@ export default () => { }) return ( - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + ) } diff --git a/storybook/stories/grid/margin.js b/storybook/stories/grid/margin.js index 32cad8b11..cb1d8f45a 100644 --- a/storybook/stories/grid/margin.js +++ b/storybook/stories/grid/margin.js @@ -2,7 +2,8 @@ import * as React from 'react' import { times } from 'lodash' import { boolean } from '@storybook/addon-knobs' -import { Box, RootLayout, getMarginSelect, Grid } from '../../shared' +import { Root, Layout, Grid } from 'gymnast' +import { Box, getMarginSelect } from '../../shared' export default () => { const itemMargin = getMarginSelect( @@ -24,16 +25,24 @@ export default () => { ) return ( - - - {times(6, getBox)} + + + + {times(6, getBox)} - {times(2, getBox)} - - {times(2, getBox)} + {times(2, getBox)} + + {times(2, getBox)} - {times(6, getBox)} - - + {times(6, getBox)} +
    +
    +
    ) } diff --git a/storybook/stories/grid/nested.js b/storybook/stories/grid/nested.js index 3ec92937a..38c985a92 100644 --- a/storybook/stories/grid/nested.js +++ b/storybook/stories/grid/nested.js @@ -2,14 +2,8 @@ import * as React from 'react' import { number, select } from '@storybook/addon-knobs' import { times } from 'lodash' -import { - Box, - Col, - getMarginSelect, - getPositionSelect, - Grid, - RootLayout, -} from '../../shared' +import { Root, Layout, Col, Grid } from 'gymnast' +import { Box, colors, getMarginSelect, getPositionSelect } from '../../shared' export default function() { const paddingMap = { @@ -27,40 +21,49 @@ export default function() { padding: paddingMap[select('Padding', paddingOptions)], ...getPositionSelect(), } - const height = { - height: 150, - } return ( - - -

    Nested Example

    - - - - - - - A + + + +

    Nested Example

    + + + + + + + A + -
    - - -

    With Overflow

    - - - - - {times(items, index => ( - - {`${(index * 2) % 12 + 2}`} - - ))} - - -
    + +

    With Overflow

    + + + + + {times(items, index => ( + + {`${(index * 2) % 12 + 2}`} + + ))} + + + +
    +
    ) } diff --git a/storybook/stories/grid/offset.js b/storybook/stories/grid/offset.js index eff676586..0252fe2b1 100644 --- a/storybook/stories/grid/offset.js +++ b/storybook/stories/grid/offset.js @@ -1,50 +1,52 @@ // @flow import * as React from 'react' import { number } from '@storybook/addon-knobs' -import { Offset } from 'gymnast' -import { Grid, RootLayout, Box } from '../../shared' +import { Root, Layout, Grid, Offset } from 'gymnast' +import { Box } from '../../shared' export default () => { const offset = number('Offset', 0, { range: true, min: 0, max: 11 }) return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + +
    +
    ) } diff --git a/storybook/stories/grid/padding.js b/storybook/stories/grid/padding.js index fa380623d..9edb6048e 100644 --- a/storybook/stories/grid/padding.js +++ b/storybook/stories/grid/padding.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react' -import type { Size } from '../../../src/types' -import { RootLayout, getMarginSelect, Grid, Col } from '../../shared' +import { type Size, Root, Layout, Grid, Col } from 'gymnast' +import { getMarginSelect, colors } from '../../shared' import { axonBlack, axonGold } from '../../../src/dev/colors' type HeadingProps = { @@ -34,109 +34,108 @@ export default () => { ) return ( - - - Default (No Padding) - - - {text} + + + + Default (No Padding) + + + {text} + - - - - Top Right Padding - Item Top Right Padding - - - {text} + + + Top Right Padding + Item Top Right Padding + + + {text} + - - - - {text} + + + {text} + - - - - All-sides Padding - Item All-sides Padding - - - {text} + + + All-sides Padding + Item All-sides Padding + + + {text} + - - - - {text} + + + {text} + - - - - Bottom Padding - Item Bottom Padding - - - {text} + + + Bottom Padding + Item Bottom Padding + + + {text} + - - - - {text} + + + {text} + - - - - Top-Right-Left Padding - Item Top-Right-Left Padding - - - {text} + + + Top-Right-Left Padding + Item Top-Right-Left Padding + + + {text} + - - - - {text} + + + {text} + - - + - - With Justify / Alignment - -

    Container Padding

    -
    - -

    Item Padding

    -
    - - - {text} + + With Justify / Alignment + +

    Container Padding

    +
    + +

    Item Padding

    -
    - + + {text} + + + - {text} + + {text} + - - -
    + + +
    ) } diff --git a/storybook/stories/grid/resolution.js b/storybook/stories/grid/resolution.js index cd6df64a9..279c764d4 100644 --- a/storybook/stories/grid/resolution.js +++ b/storybook/stories/grid/resolution.js @@ -1,6 +1,7 @@ // @flow import * as React from 'react' -import { Grid } from '../../shared' +import { Grid } from 'gymnast' +import { colors } from '../../shared' class Button extends React.Component<*, { counter: number }> { state = { counter: 0 } @@ -18,22 +19,22 @@ class Button extends React.Component<*, { counter: number }> { export default () => ( - + Only visible on small screens (< 600px)