Skip to content

Commit

Permalink
Layout Update
Browse files Browse the repository at this point in the history
  • Loading branch information
kwehhh committed Oct 10, 2021
1 parent 729e32a commit 70857ca
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ A React based reusable component library.
- React ^16.8

### Getting Started
1. Install `npm install https://github.com/UnfocusedDrive/nurvus-design-system.git#main`, or add `"@nurvus/ui": "git+https://github.com/UnfocusedDrive/nurvus-design-system.git#main",` to `package.json` dependencies.
1. NPM INSTALL Install `npm install https://github.com/UnfocusedDrive/nurvus-design-system.git#main`

Manual Install: Or as alternative, add `"@nurvus/ui": "git+https://github.com/UnfocusedDrive/nurvus-design-system.git#main",` to `package.json` dependencies.

## Contribute
### Getting Started
Expand Down
10 changes: 9 additions & 1 deletion src/components/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ import CONSTANT from '../../constants.js';
import './Layout.scss';

export default function Layout(props) {
const { className, itemDisplay, ...restProps } = props;
const {
alignItems,
className,
display = 'block',
itemDisplay,
...restProps
} = props;

return (
<div
className={ classNames(`${CONSTANT.CLASS_PREFIX}`, 'layout', className) }
data-align-items={ alignItems }
data-display={ display }
data-item-display={ itemDisplay }
{ ...restProps }
/>
Expand Down
32 changes: 32 additions & 0 deletions src/components/Layout/Layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Basic Example
```jsx
import { Button, Layout, Title } from '@nurvus/ui';
import AddIcon from '@material-ui/icons/Add';
import FileCopyIcon from '@material-ui/icons/FileCopy';
import RemoveRedEyeIcon from '@material-ui/icons/RemoveRedEye';
import LockOpenIcon from '@material-ui/icons/LockOpen';

<Layout>
<Title level={ 3 }>Layers</Title>
<Button>
<AddIcon />
</Button>
</Layout>
```

Horizontal Example
```jsx
import { Button, Layout, Title } from '@nurvus/ui';
import AddIcon from '@material-ui/icons/Add';
import FileCopyIcon from '@material-ui/icons/FileCopy';
import RemoveRedEyeIcon from '@material-ui/icons/RemoveRedEye';
import LockOpenIcon from '@material-ui/icons/LockOpen';

<Layout display="flex" alignItems="center">
<Title level={ 3 }>Layers</Title>
<Button>
<AddIcon />
</Button>
</Layout>
```

34 changes: 29 additions & 5 deletions src/components/Layout/Layout.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
@import "../../styles/variables.scss";

.#{$cls-prefix}.layout {
&[data-item-display="block"] {
> * {
display: block;

//
// DISPLAY
//
&[data-display="block"] {
display: block;

> * + * {
margin-top: $spacing-medium;
}
}

&[data-display="flex"] {
display: flex;

> * + * {
margin-left: $spacing-medium;
}
}

> * + * {
margin-top: 20px;
// CHILDREN / ITEMS

&[data-align-items="center"] {
align-items: center;
}

//
// ITEM DISPLAY
//
&[data-item-display="block"] {
> * {
display: block;
}
}
}
2 changes: 2 additions & 0 deletions src/components/Title/Title.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

.#{$cls-prefix}.title {
// color: $white;
// CSS reset
margin: 0;

@at-root {
h1#{&} {
Expand Down
1 change: 1 addition & 0 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $cls-prefix: nurvus;

// Sizes
$border-radius: 4px;
$spacing-medium: 20px;

// Colors
$green-1: #4db391;
Expand Down

0 comments on commit 70857ca

Please sign in to comment.