Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/app/components/hero/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Hero = () => {
<h1 className={style.headline}>React-FlexBox-Grid</h1>
</Row>
<Row className={style.description} center="xs">
<code>React(CSS-Modules(flexboxgrid.css));</code>
<code>React(CSS-Modules(flexboxgrid2.css));</code>
</Row>
<Row center="xs">
<Button url="https://github.com/roylee0704/react-flexbox-grid">Github</Button>
Expand Down
2 changes: 1 addition & 1 deletion doc/app/components/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Home = () => (
<Grid fluid className={home.wrap}>
<Section
title="Responsive"
description="Responsive modifiers enable specifying different column sizes, offsets, alignment and distribution at xs, sm, md & lg viewport widths.">
description="Responsive modifiers enable specifying different column sizes, offsets, alignment and distribution at xs, sm, md, lg & xl viewport widths.">
<Row>
<Box type="row" xs={12} sm={3} md={2} lg={1} />
<Box type="row" xs={6} sm={6} md={8} lg={10} />
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react-component"
],
"dependencies": {
"flexboxgrid": "^6.3.0",
"flexboxgrid2": "^7.0.0-alpha7",
"prop-types": "^15.5.8"
},
"devDependencies": {
Expand All @@ -48,7 +48,6 @@
"expect": "^1.13.0",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^0.8.2",
"flexboxgrid": "^6.3.0",
"isparta": "^4.0.0",
"jsdom": "^7.0.2",
"karma": "^1.6.0",
Expand Down
4 changes: 3 additions & 1 deletion react-flexbox-grid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import {Component} from 'react';

declare namespace __ReactFlexboxGrid {
type ViewportSizeType = 'xs' | 'sm' | 'md' | 'lg';
type ViewportSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type ColumnSizeType = number | boolean;

export interface GridProps {
Expand Down Expand Up @@ -34,10 +34,12 @@ declare namespace __ReactFlexboxGrid {
readonly sm?: ColumnSizeType,
readonly md?: ColumnSizeType,
readonly lg?: ColumnSizeType,
readonly xl?: ColumnSizeType,
readonly xsOffset?: number,
readonly smOffset?: number,
readonly mdOffset?: number,
readonly lgOffset?: number,
readonly xlOffset?: number,
readonly first?: ViewportSizeType,
readonly last?: ViewportSizeType,
readonly className?: string,
Expand Down
2 changes: 1 addition & 1 deletion src/classNames.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styles from 'flexboxgrid/dist/flexboxgrid.css';
import styles from 'flexboxgrid2/flexboxgrid2.css';

export default function getClass(className) {
return (styles && styles[className]) ? styles[className] : className;
Expand Down
6 changes: 5 additions & 1 deletion src/components/Col.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const propTypes = {
sm: ColumnSizeType,
md: ColumnSizeType,
lg: ColumnSizeType,
xl: ColumnSizeType,
xsOffset: PropTypes.number,
smOffset: PropTypes.number,
mdOffset: PropTypes.number,
lgOffset: PropTypes.number,
xlOffset: PropTypes.number,
first: ViewportSizeType,
last: ViewportSizeType,
className: PropTypes.string,
Expand All @@ -25,10 +27,12 @@ const classMap = {
sm: 'col-sm',
md: 'col-md',
lg: 'col-lg',
xl: 'col-xl',
xsOffset: 'col-xs-offset',
smOffset: 'col-sm-offset',
mdOffset: 'col-md-offset',
lgOffset: 'col-lg-offset'
lgOffset: 'col-lg-offset',
xlOffset: 'col-xl-offset'
};

function isInteger(value) {
Expand Down
2 changes: 1 addition & 1 deletion src/types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';

export const ColumnSizeType = PropTypes.oneOfType([PropTypes.number, PropTypes.bool]);
export const ViewportSizeType = PropTypes.oneOf(['xs', 'sm', 'md', 'lg']);
export const ViewportSizeType = PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']);
2 changes: 1 addition & 1 deletion test/classNames.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import expect from 'expect';
import style from 'flexboxgrid';
import style from 'flexboxgrid2';
import getClass from '../src/classNames';

describe('classNames lookups', () => {
Expand Down
10 changes: 6 additions & 4 deletions test/components/Col.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ import expect from 'expect';
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import Col, { getColumnProps } from '../../src/components/Col';
import style from 'flexboxgrid';
import style from 'flexboxgrid2';

const renderer = TestUtils.createRenderer();

describe('Col', () => {
it('Should add classes equals to props', () => {
renderer.render(<Col xs={12} sm={8} md={6} lg={4} />);
renderer.render(<Col xs={12} sm={8} md={6} lg={4} xl={2} />);
const { type, props: { className } } = renderer.getRenderOutput();
expect(type).toBe('div');
expect(className).toContain(style['col-xs-12']);
expect(className).toContain(style['col-sm-8']);
expect(className).toContain(style['col-md-6']);
expect(className).toContain(style['col-lg-4']);
expect(className).toContain(style['col-xl-2']);
});

it('Computes the column properties', () => {
Expand All @@ -38,16 +39,17 @@ describe('Col', () => {
});

it('Should support auto-width', () => {
renderer.render(<Col xs sm md lg />);
renderer.render(<Col xs sm md lg xl />);
const { className } = renderer.getRenderOutput().props;
expect(className).toContain(style['col-xs']);
expect(className).toContain(style['col-sm']);
expect(className).toContain(style['col-md']);
expect(className).toContain(style['col-lg']);
expect(className).toContain(style['col-xl']);
});

it('Should support custom tag name', () => {
renderer.render(<Col xs sm md lg tagName="li" />);
renderer.render(<Col xs sm md lg xl tagName="li" />);

expect(renderer.getRenderOutput().type).toBe('li');
});
Expand Down
2 changes: 1 addition & 1 deletion test/components/Grid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import expect from 'expect';
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import Grid from '../../src/components/Grid';
import style from 'flexboxgrid';
import style from 'flexboxgrid2';

const renderer = TestUtils.createRenderer();

Expand Down
2 changes: 1 addition & 1 deletion test/components/Row.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import expect from 'expect';
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import Row, { getRowProps } from '../../src/components/Row';
import style from 'flexboxgrid';
import style from 'flexboxgrid2';

const renderer = TestUtils.createRenderer();

Expand Down
12 changes: 9 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2173,9 +2173,11 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"

flexboxgrid@^6.3.0:
version "6.3.1"
resolved "https://registry.yarnpkg.com/flexboxgrid/-/flexboxgrid-6.3.1.tgz#e99898afc07b7047722bb81a958a5fba4d4e20fd"
flexboxgrid2@^7.0.0-alpha7:
version "7.0.0-alpha7"
resolved "https://registry.yarnpkg.com/flexboxgrid2/-/flexboxgrid2-7.0.0-alpha7.tgz#758f16b40506439cb0b727de085058f2e53523a1"
dependencies:
normalize.css "^7.0.0"

for-in@^0.1.5:
version "0.1.6"
Expand Down Expand Up @@ -3644,6 +3646,10 @@ normalize-url@^1.4.0:
query-string "^4.1.0"
sort-keys "^1.0.0"

normalize.css@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-7.0.0.tgz#abfb1dd82470674e0322b53ceb1aaf412938e4bf"

"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f"
Expand Down