-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STRIPES-893 align LayoutGrid with stripes-components (#37)
`<LayoutGrid>` types were still based on the old `react-flexbox-grid` implementation instead of the current local implementation. Refs STRIPES-893
- Loading branch information
Showing
8 changed files
with
82 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { FunctionComponent, ReactNode } from 'react'; | ||
|
||
import { ColumnSize } from './ColumnSize'; | ||
import { ViewportSize } from './ViewportSize'; | ||
|
||
export interface ColProps { | ||
xs?: ColumnSize, | ||
sm?: ColumnSize, | ||
md?: ColumnSize, | ||
lg?: ColumnSize, | ||
xl?: ColumnSize, | ||
xsOffset?: number, | ||
smOffset?: number, | ||
mdOffset?: number, | ||
lgOffset?: number, | ||
xlOffset?: number, | ||
first?: ViewportSize, | ||
last?: ViewportSize, | ||
/** Applies a custom class name */ | ||
className?: string, | ||
/** Change the tag name of the component (`div` by default) */ | ||
tagName?: string, | ||
/** The content of the `<Col>` */ | ||
children?: ReactNode, | ||
} | ||
|
||
declare const Col: FunctionComponent<ColProps>; | ||
export default Col; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ColumnSize = number | boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { FunctionComponent, ReactNode } from 'react'; | ||
|
||
export interface GridProps { | ||
/** whether to apply the container-fluid CSS class */ | ||
fluid?: boolean, | ||
/** Applies a custom class name */ | ||
className?: string, | ||
/** Change the tag name of the component (`div` by default) */ | ||
tagName?: string, | ||
/** The content of the `<Grid>` */ | ||
children?: ReactNode | ||
} | ||
|
||
declare const Grid: FunctionComponent<GridProps>; | ||
export default Grid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FunctionComponent, ReactNode } from 'react'; | ||
import { ViewportSize } from './ViewportSize'; | ||
|
||
export interface RowProps { | ||
reverse?: boolean, | ||
start?: ViewportSize, | ||
center?: ViewportSize, | ||
end?: ViewportSize, | ||
top?: ViewportSize, | ||
middle?: ViewportSize, | ||
bottom?: ViewportSize, | ||
around?: ViewportSize, | ||
between?: ViewportSize, | ||
/** Applies a custom class name */ | ||
className?: string, | ||
/** Change the tag name of the component (`div` by default) */ | ||
tagName?: string, | ||
/** The content of the `<Row>` */ | ||
children?: ReactNode | ||
} | ||
|
||
declare const Row: FunctionComponent<RowProps>; | ||
export default Row; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ViewportSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
/* eslint-disable max-classes-per-file */ | ||
import { Component, ReactNode } from 'react'; | ||
import { GridProps, RowProps, ColProps } from 'react-flexbox-grid'; | ||
|
||
export class Grid extends Component< | ||
GridProps & { | ||
children?: ReactNode; | ||
} | ||
> {} | ||
|
||
export class Row extends Component< | ||
RowProps & { | ||
children?: ReactNode; | ||
} | ||
> {} | ||
|
||
export class Col extends Component< | ||
ColProps & { | ||
children?: ReactNode; | ||
} | ||
> {} | ||
export { default as Col, ColProps } from './Col'; | ||
export { default as Grid, GridProps } from './Grid'; | ||
export { default as Row, RowProps } from './Row'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters