Skip to content

Commit

Permalink
chore: move flex property types to the common
Browse files Browse the repository at this point in the history
  • Loading branch information
ej9x committed Oct 2, 2018
1 parent 3a9a1e8 commit 0fce6bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/atoms/FlexLayout/FlexLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import React from 'react';

import { FlexLayoutTag } from './FlexLayout.theme';
import type { PropSizes } from '../../types';

type PropLayout = 'start' | 'end' | 'between' | 'around' | 'center'
import type { PropSizes, PropLayout, PropLayoutStretch } from '../../types';

/**
* @prop {*} justifyContent css justify-content rule
Expand All @@ -21,9 +19,9 @@ type PropLayout = 'start' | 'end' | 'between' | 'around' | 'center'
*/
export type FlexLayoutCommonProps = {|
children: React$Node,
justifyContent?: PropLayout | 'stretch',
justifyContent?: PropLayoutStretch,
alignContent?: PropLayout,
alignItems?: PropLayout | 'stretch',
alignItems?: PropLayoutStretch,
gap?: PropSizes,
offsetX?: PropSizes,
offsetY?: PropSizes,
Expand Down
5 changes: 5 additions & 0 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

export type PropSizes = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';

export type PropLayout = 'start' | 'end' | 'between' | 'around' | 'center';

export type PropLayoutStretch = PropLayout | 'stretch';


export type Theme<ThemeProps> = {
[string]: {
modifiers: { [$Keys<ThemeProps>]: Object },
Expand Down

0 comments on commit 0fce6bf

Please sign in to comment.