-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3237fac
commit 147a638
Showing
52 changed files
with
1,416 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { Card, CardBody, Alert } from 'oah-ui'; | ||
|
||
function Accent() { | ||
return ( | ||
<Card> | ||
<header>Alert Accent</header> | ||
<CardBody> | ||
<Alert accent="Danger" status="Success"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert accent="Primary" status="Danger"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert accent="Info" status="Primary"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert accent="Warning" status="Info"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert accent="Danger" status="Warning"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert accent="Disabled" status="Active"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert accent="Success" status="Disabled"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
</CardBody> | ||
</Card> | ||
); | ||
} | ||
|
||
export default Accent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export const alertProps = [ | ||
{ | ||
name: 'size', | ||
type: 'string', | ||
description: 'Size of the component, XXS | XS | SM | MD | LG | XL | XXL' | ||
}, | ||
{ | ||
name: 'status', | ||
type: 'string', | ||
description: | ||
'Field status (adds specific styles): Info, Success, Warning, Danger, Primary, Active, Disabled' | ||
}, | ||
{ | ||
name: 'accent', | ||
type: 'string', | ||
description: | ||
'Alert accent (color of the top border): Info, Success, Warning, Danger, Primary, Active, Disabled' | ||
}, | ||
{ | ||
name: 'outline', | ||
type: 'string', | ||
description: | ||
'Alert outline (color of the border): Info, Success, Warning, Danger, Primary, Active, Disabled' | ||
}, | ||
{ | ||
name: 'closable', | ||
type: 'boolean', | ||
description: 'Shows close icon' | ||
}, | ||
{ | ||
name: 'onClose()', | ||
type: 'function', | ||
description: 'Callback when close button clicked' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import { Card, CardBody, Alert } from 'oah-ui'; | ||
|
||
function Outline() { | ||
return ( | ||
<Card> | ||
<header>Alert Outline</header> | ||
<CardBody> | ||
{[ | ||
'Info', | ||
'Success', | ||
'Danger', | ||
'Primary', | ||
'Warning', | ||
'Disabled', | ||
'Active' | ||
].map(key => ( | ||
<Alert key={key} closable outline={key}> | ||
You have been successfully authenticated! | ||
</Alert> | ||
))} | ||
</CardBody> | ||
</Card> | ||
); | ||
} | ||
|
||
export default Outline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { Card, CardBody, Alert } from 'oah-ui'; | ||
|
||
function Accent() { | ||
return ( | ||
<Card> | ||
<header>Alert Size</header> | ||
<CardBody> | ||
<Alert status="Danger" size="XXS"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
<Alert status="Primary" size="SM"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
|
||
<Alert status="Success" size="XXL"> | ||
You have been successfully authenticated! | ||
</Alert> | ||
</CardBody> | ||
</Card> | ||
); | ||
} | ||
|
||
export default Accent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import { Card, CardBody, Alert } from 'oah-ui'; | ||
|
||
function Status() { | ||
return ( | ||
<Card> | ||
<header>Alert Status</header> | ||
<CardBody> | ||
{[ | ||
'Info', | ||
'Success', | ||
'Danger', | ||
'Primary', | ||
'Warning', | ||
'Disabled', | ||
'Active' | ||
].map(key => ( | ||
<Alert key={key} closable status={key}> | ||
You have been successfully authenticated! | ||
</Alert> | ||
))} | ||
</CardBody> | ||
</Card> | ||
); | ||
} | ||
|
||
export default Status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Alert | ||
|
||
Colored alerts could be simply configured by providing a `status` property: | ||
|
||
[Status](demo://Status.js) | ||
|
||
#Usage | ||
|
||
```js | ||
import { Alert } from 'oah-ui'; | ||
//or | ||
import Alert from 'oah-ui/Alert'; | ||
``` | ||
|
||
It is also possible to assign an `accent` property for a slight alert highlight | ||
|
||
[Accent](demo://Accent.js) | ||
|
||
And `outline` property: | ||
|
||
[Outline](demo://Outline.js) | ||
|
||
`size` property | ||
|
||
[Size](demo://Size.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const badgeProps = [ | ||
{ | ||
name: 'position', | ||
type: 'string', | ||
description: | ||
'Can be set to one of predefined positions: topRight, topLeft, bottomRight, bottomLeft, topStart, topEnd, bottomStart, bottomEnd' | ||
}, | ||
{ | ||
name: 'status', | ||
type: 'string', | ||
description: | ||
'(adds specific styles): Info, Success, Danger, Primary, Warning.' | ||
}, | ||
{ | ||
name: 'children', | ||
type: 'string', | ||
description: 'component content' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { Card, CardBody, Badge } from 'oah-ui'; | ||
|
||
function Example() { | ||
return ( | ||
<Card> | ||
<header style={{ position: 'relative' }}> | ||
<Badge status="Success" position="topRight"> | ||
New | ||
</Badge> | ||
<Badge status="Danger" position="bottomLeft"> | ||
+99 | ||
</Badge> | ||
</header> | ||
<CardBody>Card body.</CardBody> | ||
</Card> | ||
); | ||
} | ||
|
||
export default Example; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Badge | ||
|
||
Badge is a simple labeling component. It can be used to add additional information to any content or highlight unread items. | ||
|
||
Element is absolute positioned, so parent should be [positioned element](https://developer.mozilla.org/en-US/docs/Web/CSS/position). It means parent position should be set to anything except `static`, e.g. `relative`, `absolute`, `fixed`, or `sticky`. | ||
|
||
### Usage | ||
|
||
```js | ||
import { Badge } from 'oah-ui'; | ||
//or | ||
import Badge from 'oah-ui/Badge'; | ||
``` | ||
|
||
Badge with default position and status(color): | ||
|
||
```jsx | ||
<Badge>badge text</Badge> | ||
``` | ||
|
||
For example, badge can be placed into `Card` header: | ||
|
||
[Example](demo://Example.js) |
Oops, something went wrong.