react-flexr
Advanced tools
Comparing version 3.0.0-beta.1 to 3.0.0-beta.2
@@ -82,4 +82,4 @@ 'use strict'; | ||
var Cell = function (_Component) { | ||
(0, _inherits3.default)(Cell, _Component); | ||
var Cell = function (_React$Component) { | ||
(0, _inherits3.default)(Cell, _React$Component); | ||
@@ -164,12 +164,11 @@ function Cell() { | ||
return _react2.default.createElement( | ||
'div', | ||
(0, _extends3.default)({}, rest, { style: this.styles, className: classes }), | ||
children | ||
); | ||
return _react2.default.createElement('div', (0, _extends3.default)({}, rest, { style: this.styles, className: classes }), children); | ||
} | ||
}]); | ||
return Cell; | ||
}(_react.Component); | ||
}(_react2.default.Component); | ||
exports.default = Cell; | ||
Cell.propTypes = { | ||
@@ -187,3 +186,2 @@ grow: _propTypes2.default.oneOf([false, true, _propTypes2.default.number]), | ||
}; | ||
exports.default = Cell; | ||
module.exports = exports['default']; |
@@ -87,4 +87,4 @@ 'use strict'; | ||
var Grid = function (_Component) { | ||
(0, _inherits3.default)(Grid, _Component); | ||
var Grid = function (_React$Component) { | ||
(0, _inherits3.default)(Grid, _React$Component); | ||
@@ -122,12 +122,11 @@ function Grid() { | ||
return _react2.default.createElement( | ||
'div', | ||
(0, _extends3.default)({}, rest, { style: this.styles, className: classes }), | ||
wrappedChildren | ||
); | ||
return _react2.default.createElement('div', (0, _extends3.default)({}, rest, { style: this.styles, className: classes }), wrappedChildren); | ||
} | ||
}]); | ||
return Grid; | ||
}(_react.Component); | ||
}(_react2.default.Component); | ||
exports.default = Grid; | ||
Grid.propTypes = { | ||
@@ -138,3 +137,2 @@ gutter: _propTypes2.default.string, | ||
}; | ||
exports.default = Grid; | ||
module.exports = exports['default']; |
@@ -29,2 +29,4 @@ 'use strict'; | ||
var _react2 = _interopRequireDefault(_react); | ||
var _utils = require('./utils'); | ||
@@ -34,4 +36,4 @@ | ||
var HydrateSSR = function (_Component) { | ||
(0, _inherits3.default)(HydrateSSR, _Component); | ||
var HydrateSSR = function (_React$Component) { | ||
(0, _inherits3.default)(HydrateSSR, _React$Component); | ||
@@ -60,5 +62,5 @@ function HydrateSSR() { | ||
return HydrateSSR; | ||
}(_react.Component); | ||
}(_react2.default.Component); | ||
exports.default = HydrateSSR; | ||
module.exports = exports['default']; |
import stylesheet from './stylesheet'; | ||
import StyleSheet from 'stilr'; | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -43,24 +43,3 @@ import { | ||
export default class Cell extends Component { | ||
static propTypes = { | ||
grow: PropTypes.oneOf([false, true, PropTypes.number]), | ||
gutter: PropTypes.string, | ||
flex: PropTypes.bool, | ||
align: PropTypes.oneOf(['top', 'center', 'bottom']), | ||
size: (props, propName) => { | ||
const value = props[propName]; | ||
if ( | ||
value && | ||
!( | ||
typeof value === 'number' || | ||
(typeof value === 'string' && /^[0-9]+\/[0-9]+$/.test(value)) | ||
) | ||
) { | ||
return new Error( | ||
'Size should be a fraction (e.g. 1/6) or a number for fixed size' | ||
); | ||
} | ||
} | ||
}; | ||
export default class Cell extends React.Component { | ||
state = { | ||
@@ -147,8 +126,29 @@ breakpoints: getInitialBreakpoints() | ||
return ( | ||
<div {...rest} style={this.styles} className={classes}> | ||
{children} | ||
</div> | ||
return React.createElement( | ||
'div', | ||
{ ...rest, style: this.styles, className: classes }, | ||
children | ||
); | ||
} | ||
} | ||
Cell.propTypes = { | ||
grow: PropTypes.oneOf([false, true, PropTypes.number]), | ||
gutter: PropTypes.string, | ||
flex: PropTypes.bool, | ||
align: PropTypes.oneOf(['top', 'center', 'bottom']), | ||
size: (props, propName) => { | ||
const value = props[propName]; | ||
if ( | ||
value && | ||
!( | ||
typeof value === 'number' || | ||
(typeof value === 'string' && /^[0-9]+\/[0-9]+$/.test(value)) | ||
) | ||
) { | ||
return new Error( | ||
'Size should be a fraction (e.g. 1/6) or a number for fixed size' | ||
); | ||
} | ||
} | ||
}; |
import stylesheet from './stylesheet'; | ||
import StyleSheet from 'stilr'; | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -38,9 +38,3 @@ import { doubleUnit, vertical, horizontal, variables, assign } from './utils'; | ||
export default class Grid extends Component { | ||
static propTypes = { | ||
gutter: PropTypes.string, | ||
flexCells: PropTypes.bool, | ||
align: PropTypes.oneOf(['top', 'center', 'bottom']) | ||
}; | ||
export default class Grid extends React.Component { | ||
render() { | ||
@@ -85,8 +79,14 @@ const { | ||
return ( | ||
<div {...rest} style={this.styles} className={classes}> | ||
{wrappedChildren} | ||
</div> | ||
return React.createElement( | ||
'div', | ||
{ ...rest, style: this.styles, className: classes }, | ||
wrappedChildren | ||
); | ||
} | ||
} | ||
Grid.propTypes = { | ||
gutter: PropTypes.string, | ||
flexCells: PropTypes.bool, | ||
align: PropTypes.oneOf(['top', 'center', 'bottom']) | ||
}; |
@@ -1,5 +0,5 @@ | ||
import { Component } from 'react'; | ||
import React from 'react'; | ||
import { ssrWillHydrate, ssrDidHydrate } from './utils'; | ||
export default class HydrateSSR extends Component { | ||
export default class HydrateSSR extends React.Component { | ||
componentWillMount() { | ||
@@ -6,0 +6,0 @@ ssrWillHydrate(); |
{ | ||
"name": "react-flexr", | ||
"version": "3.0.0-beta.1", | ||
"version": "3.0.0-beta.2", | ||
"description": "React flexbox grid made simple.", | ||
"main": "dist", | ||
"main": "index.js", | ||
"module": "index.es.js", | ||
"jsnext:main": "index.es.js", | ||
"scripts": { | ||
@@ -13,6 +15,8 @@ "lint": "eslint lib/", | ||
"clean": "rm -rf ./dist", | ||
"bundle": "NODE_ENV=production rollup -c rollup.config.js", | ||
"dist": "NODE_ENV=production babel lib --out-dir dist --copy-files", | ||
"release": "np", | ||
"pre-release": "yarn lint && yarn test:src", | ||
"extract-styles": "make extract-styles", | ||
"build": "yarn clean && yarn dist && yarn test:build && yarn extract-styles" | ||
"build": "yarn clean && yarn dist && yarn test:build && yarn bundle && yarn extract-styles" | ||
}, | ||
@@ -32,2 +36,4 @@ "keywords": [ | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
@@ -37,2 +43,3 @@ "babel-plugin-transform-react-constant-elements": "^6.23.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
@@ -46,4 +53,10 @@ "babel-preset-react": "^6.24.1", | ||
"mocha": "^3.2.0", | ||
"np": "^3.0.4", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"react-hot-loader": "^3.1.3", | ||
"rollup": "^0.61.2", | ||
"rollup-plugin-babel": "^3.0.5", | ||
"rollup-plugin-commonjs": "^9.1.3", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"semver": "^5.4.1", | ||
@@ -56,16 +69,10 @@ "webpack": "^3.8.1", | ||
"prop-types": "^15.6.0", | ||
"react": ">=0.11.0", | ||
"stilr": "^1.2.1" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=0.11.0" | ||
}, | ||
"repository": "kodyl/react-flexr", | ||
"author": "Kodyl ApS", | ||
"contributors": [ | ||
{ | ||
"name": "Chris Kjær Sørensen" | ||
}, | ||
{ | ||
"name": "Daniel Juhl" | ||
} | ||
], | ||
"license": "MIT" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
290994
26
2114
31
- Removedreact@>=0.11.0