import React from 'react'; import { Meta, Story } from '@storybook/react'; import Grid, { IGridProps } from './Grid'; export default { title: 'Layout/Grid', component: Grid, parameters: { docs: { description: { component: Grid.peek.description, }, }, }, } as Meta; /* Grid Columns */ export const GridColumns: Story = (args) => { const gridStyle = { half: { background: '#0089c4' }, quarter: { background: '#f7403a' }, third: { background: '#3fa516', color: '#f3f3f3' }, full: { background: '#333333', color: '#f3f3f3' }, auto: { background: '#999999', color: '#f3f3f3' }, flexdefault: { background: '#feb209' }, sharedStyles: { margin: 0, padding: 0, color: '#f3f3f3', }, vertical: { height: '100px' }, }; const fillCells = (count: any) => { const cells: any = []; for (let i = 0; i < count; i++) { cells.push(

auto

); } return cells; }; return (

full

2

{fillCells(12 - 2)}

3

{fillCells(12 - 3)}

4

{fillCells(12 - 4)}

5

{fillCells(12 - 5)}

6

{fillCells(12 - 6)}

7

{fillCells(12 - 7)}

8

{fillCells(12 - 8)}

9

{fillCells(12 - 9)}

10

{fillCells(12 - 10)}

11

{fillCells(12 - 11)}
); }; /* Gutterless Grid */ export const GutterlessGrid: Story = (args) => { const gridStyle = { half: { background: '#0089c4' }, quarter: { background: '#f7403a' }, third: { background: '#3fa516', color: '#f3f3f3' }, full: { background: '#333333', color: '#f3f3f3' }, auto: { background: '#999999', color: '#f3f3f3' }, flexdefault: { background: '#feb209' }, sharedStyles: { margin: 0, padding: 0, color: '#f3f3f3', }, vertical: { height: '100px' }, }; const fillCells = (count: any) => { const cells: any = []; for (let i = 0; i < count; i++) { cells.push(

auto

); } return cells; }; return (

gutterless half

gutterless quarter {fillCells(1)}

gutterless quarter

gutterless quarter

gutterless half

); }; /* Horizontal Multiline Grid */ export const HorizontalMultilineGrid: Story = (args) => { const gridStyle = { half: { background: '#0089c4' }, quarter: { background: '#f7403a' }, third: { background: '#3fa516', color: '#f3f3f3' }, full: { background: '#333333', color: '#f3f3f3' }, auto: { background: '#999999', color: '#f3f3f3' }, flexdefault: { background: '#feb209' }, sharedStyles: { margin: 0, padding: 0, color: '#f3f3f3', }, vertical: { height: '100px' }, }; return (

half

half

half

full

third

third

third

third

quarter

quarter

quarter

); }; /* Offset Cells */ export const OffsetCells: Story = (args) => { const gridStyle = { half: { background: '#0089c4' }, quarter: { background: '#f7403a' }, third: { background: '#3fa516', color: '#f3f3f3' }, full: { background: '#333333', color: '#f3f3f3' }, auto: { background: '#999999', color: '#f3f3f3' }, flexdefault: { background: '#feb209' }, sharedStyles: { margin: 0, padding: 0, color: '#f3f3f3', textAlign: 'center', }, vertical: { height: '100px' }, }; return (

half with offset half

quarter with offset quarter

third with offset third

); }; /* Vertical Multiline Grid */ export const VerticalMultilineGrid: Story = (args) => { const gridStyle = { half: { background: '#0089c4' }, quarter: { background: '#f7403a' }, third: { background: '#3fa516', color: '#f3f3f3' }, full: { background: '#333333', color: '#f3f3f3' }, auto: { background: '#999999', color: '#f3f3f3' }, flexdefault: { background: '#feb209' }, sharedStyles: { margin: 0, padding: 0, color: '#f3f3f3', }, vertical: { height: '200px' }, verticalSharedStyles: { margin: 0, padding: 0, color: '#f3f3f3', flex: 1, }, }; return (

half

half

half

full

third

third

third

third

quarter

quarter

quarter

); };