Skip to content

Commit

Permalink
docs(Notification): Document Notification component in Styleguidist
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcabrera committed Jul 20, 2017
1 parent d00d74b commit 440b737
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/Notification/Notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const ErrorIcon = () => (
<i className="icon icon-core-exclamation-point-circle c-notification__icon" />
);

/**
* A banner to highlight important notices.
*/
const Notification = ({ className, variant, children, ...rest }) => {
if (className) {
warn('Notification', 'Custom CSS classes are deprecated. This component does not support custom styling.');
Expand Down Expand Up @@ -37,13 +40,23 @@ const Notification = ({ className, variant, children, ...rest }) => {
};

Notification.propTypes = {
/**
* (DEPRECATED) Additional css classes
*/
className: PropTypes.string,
/**
* Adds a background color variation to the component
*/
variant: PropTypes.oneOf([
'instructional',
'branded',
'success',
'error'
]),
/**
* Content to be displayed within the Notification banner. Can be text, any HTML element,
* or any component.
*/
children: PropTypes.node.isRequired
};

Expand Down
38 changes: 38 additions & 0 deletions src/components/Notification/Notification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

## Minimal usage

```
<Notification>Lorem ipsum dolor sit amer.</Notification>
```
## Branded

```
<Notification variant="branded">Lorem ipsum dolor sit amer.</Notification>
```

## Success

Use to denote a successful transaction.

```
<Notification variant="success">Lorem ipsum dolor sit amer.</Notification>
```

## Error

Use to denote an error or a failed transaction.

```
<Notification variant="error">
<p>Looks like our registration system is temporarily down. You'll need to come back another time to register for My Account.</p>
<p>Lorem ipsum dolor sit amer.</p>
</Notification>
```

## Instructional

This is the same styling as default.

```
<Notification variant="instructional">Lorem ipsum dolor sit amer.</Notification>
```

0 comments on commit 440b737

Please sign in to comment.