@bsara/react-layouts
Advanced tools
Comparing version 1.0.0-beta.10 to 1.0.0-beta.11
{ | ||
"name": "@bsara/react-layouts", | ||
"version": "1.0.0-beta.10", | ||
"version": "1.0.0-beta.11", | ||
"description": "A collection of generic, reusable layout components", | ||
@@ -23,3 +23,6 @@ "authors": [ | ||
"files": [ | ||
"*Layout/*", | ||
"*Layout.js", | ||
"dist/*", | ||
"src/*.js", | ||
"src/**/*.json", | ||
"src/**/*Layout.js", | ||
@@ -29,3 +32,3 @@ "src/**/*Layout.css" | ||
"scripts": { | ||
"clean:dist": "rm -rf ./*Layout/", | ||
"clean:dist": "rm -rf ./dist/*", | ||
"clean": "rm -rf ./build", | ||
@@ -35,3 +38,3 @@ "build:styles": "npx postcss ./src/**/*Layout.css --map -b ./src -d ./build", | ||
"build": "npm run clean && npm run build:styles && npm run build:scripts", | ||
"dist:copyBuild": "cp -r ./build/* ./ && find . -name '*Layout*.map' -exec sed -i 's/\\.\\.\\/\\.\\.\\/src/\\.\\.\\/src/' {} \\;", | ||
"dist:copyBuild": "cp -r ./build/* ./dist/", | ||
"dist": "npm run build && npm run clean:dist && npm run dist:copyBuild", | ||
@@ -55,3 +58,3 @@ "sb": "npm run storybook", | ||
"@bsara/stylelint-config": "^1.2.1", | ||
"@storybook/react": "^3.3.13", | ||
"@storybook/react": "^3.4.0", | ||
"autoprefixer": "^7.1.6", | ||
@@ -72,3 +75,3 @@ "babel-cli": "^6.26.0", | ||
"postcss-nesting": "^4.2.1", | ||
"react-dom": "^16.2.0", | ||
"react-dom": "^16.3.1", | ||
"stylelint": "^8.2.0" | ||
@@ -78,5 +81,5 @@ }, | ||
"babel-plugin-react-css-modules": "^3.3.3", | ||
"prop-types": ">=15.6.0", | ||
"react": ">=16.2.0" | ||
"prop-types": "^15.6.1", | ||
"react": "^16.3.1" | ||
} | ||
} |
@@ -23,2 +23,4 @@ | ||
import { pickGlobalHtmlAttirbuteProps } from '../utils'; | ||
import './GridLayout.css'; | ||
@@ -28,14 +30,8 @@ | ||
// eslint-disable-next-line react/require-optimization | ||
export default class GridLayout extends React.Component { | ||
render() { | ||
const elementProps = Object.assign({}, this.props); | ||
delete elementProps.domRef; | ||
return ( | ||
<div {...elementProps} styleName="grid-layout" className={elementProps.className} ref={this.props.domRef}> | ||
{this.props.children} | ||
</div> | ||
); | ||
} | ||
export default function GridLayout(props) { | ||
return ( | ||
<div {...pickGlobalHtmlAttirbuteProps(props)} styleName="grid-layout" className={props.className} ref={props.domRef}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
@@ -45,15 +41,6 @@ | ||
GridLayout.propTypes = { | ||
id: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.string | ||
]), | ||
className: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.arrayOf(PropTypes.string) | ||
]), | ||
style: PropTypes.object, | ||
domRef: PropTypes.func | ||
id: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ]), | ||
className: PropTypes.string, | ||
style: PropTypes.object, | ||
domRef: PropTypes.func | ||
}; |
@@ -23,2 +23,4 @@ | ||
import { pickGlobalHtmlAttirbuteProps } from '../utils'; | ||
import './LinearLayout.css'; | ||
@@ -28,24 +30,10 @@ | ||
// eslint-disable-next-line react/require-optimization | ||
export default class LinearLayout extends React.Component { | ||
render() { | ||
const { | ||
children, | ||
className, | ||
domRef, | ||
direction | ||
} = this.props; | ||
export default function LinearLayout(props) { | ||
const isDirectionVertical = (props.direction === 'v' || props.direction === 'vert' || props.direction === 'vertical'); | ||
const elementProps = Object.assign({}, this.props); | ||
delete elementProps.domRef; | ||
delete elementProps.direction; | ||
const isDirectionVertical = (direction === 'v' || direction === 'vert' || direction === 'vertical'); | ||
return ( | ||
<div {...elementProps} styleName={`linear-layout ${isDirectionVertical ? 'linear-layout-vertical' : 'linear-layout-horizontal'}`} className={className} ref={domRef}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
return ( | ||
<div {...pickGlobalHtmlAttirbuteProps(props)} styleName={`linear-layout ${isDirectionVertical ? 'linear-layout-vertical' : 'linear-layout-horizontal'}`} className={props.className} ref={props.domRef}> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
@@ -55,16 +43,8 @@ | ||
LinearLayout.propTypes = { | ||
id: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.string | ||
]), | ||
id: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ]), | ||
className: PropTypes.string, | ||
style: PropTypes.object, | ||
domRef: PropTypes.func, | ||
className: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.arrayOf(PropTypes.string) | ||
]), | ||
style: PropTypes.object, | ||
domRef: PropTypes.func, | ||
direction: PropTypes.oneOf([ 'h', 'horiz', 'horizontal', 'v', 'vert', 'vertical' ]) | ||
}; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
26
38115
488
1
+ Addedreact@16.14.0(transitive)
- Removedreact@18.3.1(transitive)
Updatedprop-types@^15.6.1
Updatedreact@^16.3.1