Socket
Socket
Sign inDemoInstall

@bsara/react-layouts

Package Overview
Dependencies
340
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-beta.15 to 1.0.0-beta.16

19

dist/GridLayout/GridLayout.js

@@ -8,18 +8,7 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -46,3 +35,3 @@

'div',
_extends({}, (0, _utils.pickGlobalHtmlAttirbuteProps)(props), { className: (props.className ? props.className + ' ' : '') + 'rl-aef45beb', ref: props.domRef }),
_extends({}, (0, _utils.pickGlobalHtmlAttributeProps)(props), { className: (props.className ? props.className + ' ' : '') + 'rl-aef45beb', ref: props.domRef }),
props.children

@@ -49,0 +38,0 @@ );

@@ -8,18 +8,7 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -59,5 +48,9 @@

'div',
_extends({}, (0, _utils.pickGlobalHtmlAttirbuteProps)(props), { ref: props.domRef, className: (props.className ? props.className + ' ' : '') + (0, _getClassName3.default)('linear-layout ' + (isDirectionVertical ? 'linear-layout-vertical' : 'linear-layout-horizontal'), _styleModuleImportMap)
}),
props.children
null,
_react2.default.createElement(
'div',
_extends({}, (0, _utils.pickGlobalHtmlAttributeProps)(props), { ref: props.domRef, className: (props.className ? props.className + ' ' : '') + (0, _getClassName3.default)('linear-layout ' + (isDirectionVertical ? 'linear-layout-vertical' : 'linear-layout-horizontal'), _styleModuleImportMap)
}),
props.children
)
);

@@ -64,0 +57,0 @@ }

@@ -6,20 +6,9 @@ 'use strict';

});
exports.pickGlobalHtmlAttirbuteProps = pickGlobalHtmlAttirbuteProps;
exports.pickGlobalHtmlAttributeProps = pickGlobalHtmlAttributeProps;
/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -31,3 +20,3 @@

function pickGlobalHtmlAttirbuteProps(obj) {
function pickGlobalHtmlAttributeProps(obj) {
var newObj = {};

@@ -34,0 +23,0 @@

@@ -1,17 +0,6 @@

/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -18,0 +7,0 @@ 'use strict';

@@ -1,17 +0,6 @@

/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -18,0 +7,0 @@ 'use strict';

{
"name": "@bsara/react-layouts",
"version": "1.0.0-beta.15",
"version": "1.0.0-beta.16",
"description": "A collection of generic, reusable layout components",

@@ -9,6 +9,6 @@ "authors": [

"license": "ISC",
"homepage": "https://github.com/bsara/react-layouts#readme",
"repository": "bsara/react-layouts",
"homepage": "https://gitlab.com/bsara/react-layouts#readme",
"repository": "gitlab:bsara/react-layouts",
"bugs": {
"url": "https://github.com/bsara/react-layouts/issues"
"url": "https://gitlab.com/bsara/react-layouts/issues"
},

@@ -41,2 +41,3 @@ "keywords": [

"storybook": "npx start-storybook -p 9800 -c .storybook",
"generate:pages": "npx build-storybook -c .storybook -o ./.pages",
"l": "npm run lint",

@@ -57,7 +58,7 @@ "lint": "npm run lint:scripts && npm run lint:styles",

"@bsara/stylelint-config": "^1.2.1",
"@storybook/react": "^3.4.0",
"autoprefixer": "^7.1.6",
"@storybook/react": "^3.4.8",
"autoprefixer": "^9.0.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-preset-es2015": "^6.24.1",

@@ -68,16 +69,19 @@ "babel-preset-es2016": "^6.24.1",

"eslint": "^4.4.1",
"extract-text-webpack-plugin": "^3.0.2",
"npm-scripts-versioning": "^1.0.0-beta.8",
"postcss-cli": "^4.1.1",
"postcss-discard-comments": "^2.0.4",
"postcss-modules": "^1.1.0",
"postcss-discard-comments": "^4.0.0",
"postcss-loader": "^2.1.6",
"postcss-modules": "^1.2.0",
"postcss-nested": "^3.0.0",
"postcss-nesting": "^4.2.1",
"react-dom": "^16.3.1",
"postcss-nesting": "^6.0.0",
"react-dom": "^16.4.1",
"style-loader": "^0.21.0",
"stylelint": "^8.2.0"
},
"dependencies": {
"babel-plugin-react-css-modules": "^3.3.3",
"prop-types": "^15.6.1",
"react": "^16.3.1"
"babel-plugin-react-css-modules": "^3.4.2",
"prop-types": "^15.6.2",
"react": "^16.4.1"
}
}

@@ -6,10 +6,9 @@ # @bsara/react-layouts [![NPM Package](https://img.shields.io/npm/v/@bsara/react-layouts.svg?style=flat-square)][npm]

[Storybook](https://bsara.gitlab.io/react-layouts)
> **NOTE:** Package is still being alpha tested! A full readme will be added when the first stable release is ready.
[Changelog](https://gitlab.com/bsara/react-layouts/blob/master/CHANGELOG.md)
[Changelog](https://github.com/bsara/react-layouts/blob/master/CHANGELOG.md)
# Install

@@ -24,15 +23,271 @@

# API
# Usage
## LinearLayout
> **NOTE:** Package is still being alpha tested! A full readme will be added when the first stable release is ready.
> A layout that arranges children either horizontally in a single column or vertically in
> a single row.
```javascript
import GridLayout from '@bsara/react-layouts/GridLayout';
At it's core, this component is basically a [CSS flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
As such, all CSS flexbox properties are valid when styling a `LinearLayout`. This also
means that this component is NOT supported in browsers that do not support CSS flexbox
without appropriate polyfills.
Some sensible CSS defaults have been set and some CSS custom properties have been provided
as a convenience *(see the documented CSS custom properties below for more details)*.
### Props
> Any prop that is acceptable by a `div` component is acceptable by a `LinearLayout`
> component.
- **direction** `?String` - *Default = `"horizontal"`*
The direction to arrange the component's children.
Possible values:
- `"horizontal"`
- `"horiz"`
- `"h"`
- `"vertical"`
- `"vert`
- `"v"`
- **domRef** `?Function`
TODO: Description
### Immediate Children CSS Custom Properties
- **--linear-layout-item-gap** `Same types as any "margin" CSS property`
TODO: Description
- **--linear-layout-item-size** `Same types as "width" or "height" CSS properties`
TODO: Description
- **--linear-layout-item-min-size** `Same types as "min-width" or "min-height" CSS properties`
TODO: Description
- **--linear-layout-item-max-size** `Same types as "max-width" or "max-height" CSS properties`
TODO: Description
### Examples
[Storybook Examples](https://bsara.gitlab.io/react-layouts?selectedKind=LinearLayout)
**MyLinearLayoutComponent.jsx**
```jsx
import React from 'react';
import LinearLayout from '@bsara/react-layouts/LinearLayout';
import './MyLinearLayoutComponent.css';
export default function MyLinearLayoutComponent(props) {
return (
<LinearLayout {...props} className="layout" direction="horizontal">
<a>Anchor 0</a>
<a>Anchor 1</a>
<a>Anchor 2</a>
<LinearLayout className="sub-layout" direction="vertical">
<a>Sub Anchor 0</a>
<a>Sub Anchor 1</a>
<a>Sub Anchor 2</a>
</LinearLayout>
</LinearLayout>
);
}
```
**MyLinearLayoutComponent.css**
```css
.layout {
--linear-layout-item-gap: 5px;
}
.sub-layout > * {
--linear-layout-item-gap: 10px;
}
```
**Output (Text Representation)**
```txt
The component above will lay out it's children similar to the following:
|----------|----------|----------|----------------|
| Anchor 0 | Anchor 1 | Anchor 2 ||--------------||
| | | || Sub Anchor 0 ||
| | | ||--------------||
| | | || Sub Anchor 1 ||
| | | ||--------------||
| | | || Sub Anchor 2 ||
| | | ||--------------||
|----------|----------|----------|----------------|
```
## GridLayout
> A layout that places its children in a rectangular grid.
This layout is basically a [CSS grid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout).
As such, all CSS grid properties are valid when styling a `GridLayout`. This also means
that this component is NOT supported in browsers that do not support CSS grid without
appropriate polyfills.
Some sensible CSS defaults have been set and some CSS custom properties have been provided
as a convenience *(see the documented CSS custom properties below for more details)*.
### Props
> Any prop that is acceptable by a `div` component is acceptable by a `GridLayout`
> component.
- **domRef** `?Function`
TODO: Description
### CSS Custom Properties
- **--grid-row-count** `?Number`
TODO: Description
- **--grid-column-count** `?Number`
TODO: Description
### Immediate Children CSS Custom Properties
- **--grid-row-span** `?Number`
TODO: Description
- **--grid-column-span** `?Number`
TODO: Description
- **--grid-item-size** *`Same types as "width" or "height" CSS properties`*
TODO: Description
- **--grid-item-min-size** *`Same types as "min-width" or "min-height" CSS properties`*
TODO: Description
- **--grid-item-max-size** *`Same types as "max-width" or "max-height" CSS properties`*
TODO: Description
- **--grid-item-width** *`Same types as "width" CSS property`*
TODO: Description
- **--grid-item-min-width** *`Same types as "min-width" CSS property`*
TODO: Description
- **--grid-item-max-width** *`Same types as "max-width" CSS property`*
TODO: Description
- **--grid-item-height** *`Same types as "height" CSS property`*
TODO: Description
- **--grid-item-min-height** *`Same types as "min-height" CSS property`*
TODO: Description
- **--grid-item-max-height** *`Same types as "max-height" CSS property`*
TODO: Description
### Examples
[Storybook Examples](https://bsara.gitlab.io/react-layouts?selectedKind=GridLayout)
**MyGridLayoutComponent.jsx**
```jsx
import React from 'react';
import GridLayout from '@bsara/react-layouts/GridLayout';
import './MyGridLayoutComponent.css';
export default function MyGridLayoutComponent(props) {
return (
<GridLayout {...props} className="layout">
<span className="cell0-0">Item 0.0</span>
<span className="cell0-1">Item 0.1</span>
<span>Item 1.1</span>
<span>Item 1.2</span>
</GridLayout>
);
}
```
**MyGridLayoutComponent.css**
```css
.layout {
--grid-column-count: 3;
}
.cell0-0 {
--grid-row-span: 2;
}
.cell0-1 {
--grid-column-span: 2;
}
```
**Output (Text Representation)**
```txt
The component above will lay out it's children similar to the following:
|----------|---------------------|
| Item 0.0 | Item 0.1 |
| |----------|----------|
| | Item 1.1 | Item 1.2 |
|----------|----------|----------|
```
<br/>
<br/>
# License

@@ -59,3 +314,3 @@

[bsara-home]: http://bsara.pro/
[license]: https://github.com/bsara/react-layouts/blob/master/LICENSE "License"
[license]: https://gitlab.com/bsara/react-layouts/blob/master/LICENSE "License"
[npm]: https://www.npmjs.com/package/@bsara/react-layouts "NPM Package: react-layouts"
/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -23,3 +12,3 @@

import { pickGlobalHtmlAttirbuteProps } from '../utils';
import { pickGlobalHtmlAttributeProps } from '../utils';

@@ -32,3 +21,3 @@ import './GridLayout.css';

return (
<div {...pickGlobalHtmlAttirbuteProps(props)} styleName="grid-layout" className={props.className} ref={props.domRef}>
<div {...pickGlobalHtmlAttributeProps(props)} styleName="grid-layout" className={props.className} ref={props.domRef}>
{props.children}

@@ -35,0 +24,0 @@ </div>

/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -23,3 +12,3 @@

import { pickGlobalHtmlAttirbuteProps } from '../utils';
import { pickGlobalHtmlAttributeProps } from '../utils';

@@ -34,4 +23,6 @@ import './LinearLayout.css';

return (
<div {...pickGlobalHtmlAttirbuteProps(props)} styleName={`linear-layout ${isDirectionVertical ? 'linear-layout-vertical' : 'linear-layout-horizontal'}`} className={props.className} ref={props.domRef}>
{props.children}
<div>
<div {...pickGlobalHtmlAttributeProps(props)} styleName={`linear-layout ${isDirectionVertical ? 'linear-layout-vertical' : 'linear-layout-horizontal'}`} className={props.className} ref={props.domRef}>
{props.children}
</div>
</div>

@@ -38,0 +29,0 @@ );

/**
* ISC License (ISC)
/**!
* @bsara/react-layouts v1.0.0-beta.16
*
* Copyright (c) 2018, Brandon D. Sara (https://bsara.pro/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* Licensed under the ISC license (https://gitlab.com/bsara/react-each/blob/master/LICENSE)
*/

@@ -50,3 +39,3 @@

export function pickGlobalHtmlAttirbuteProps(obj) {
export function pickGlobalHtmlAttributeProps(obj) {
const newObj = {};

@@ -53,0 +42,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc