/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Content components contain what the user sees on the screen and are * related to textual positioning. They are static and unstyled elements * used to help define the information architecture. * * @see https://github.com/brave/brave-ui/blob/master/docs/spec.md#content * * In this file: * --- * GridSystem (Grid and Column) * MediaContent * BoxedContent */ // Storybook requires import { storiesOf, addDecorator } from '@storybook/react' import { withKnobs, text, select } from '@storybook/addon-knobs' import { BetterVisualizer } from './storyUtil' // Components import * as React from 'react' import { Grid, Column } from '../components/gridSystem' addDecorator(withKnobs) // Globally adapt the story visualizer for this story addDecorator(BetterVisualizer) storiesOf('Content', module) .add('Grid Demonstration', () => { return (

A 12-column based grid for rapid prototyping

12/12 11/12 1/12 10/12 2/12 9/12 3/12 8/12 4/12 7/12 5/12 6/12 6/12
) }) .add('Grid Playground', () => { const options = {} Array.from({ length: 12 }, (v, i) => i + 1).forEach(size => Object.assign(options, { [size.toString()]: size }) ) const label1 = 'Column #1 size' const defaultValue1 = 3 const value1 = select(label1, options, defaultValue1) const label2 = 'Column #2 size' const defaultValue2 = 9 const value2 = select(label2, options, defaultValue2) return (

Playground! (see "knobs" for usage)

{`${value1}/12`} {`${value2}/12`}
) }) // TODO: mediaContent // TODO: boxedContent