0.0.1 • Published 7 years ago

@inthepocket/itp-rcc-alert v0.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

ITP Alert component

Usage

$ npm install @inthepocket/itp-rcc-alert

Import (Typescript)

import { default as Alert } from '@inthepocket/itp-rcc-alert';

Import (ES)

import Alert from '@inthepocket/itp-rcc-alert';

JSX

<Alert>
  <p>Alert content</p>
</Alert>

API documentation

Alert

<Alert>
  <p>Alert content</p>
</Alert>
PropertyDescriptionTypeDefaultRequired
dismissButtonAriaLabelARIA label text for dismiss button (requires hasDismissButton to be true)string'Dismiss'No
dismissIconIcon for dismiss button (requires hasDismissButton to be true)string / ReactNode×No
hasDismissButtonShow dismiss buttonBooleanfalseNo
onDismissDismiss button click handler (requires hasDismissButton to be true)FunctionnullaNo
prefixCssPrefix for css classNamesstring'alert'No
stylesimported css module (if passed, prefixed classNames will be disabled), see styles propertyobjectnullNo
type'default', 'success', 'danger', 'warning' or 'info'string'primary'No

Styles property

PropertyDescriptionTypeDefaultRequired
alertstring-Yes
buttonstring-No
dismissButtonstring-No
typeDangerstring-No
typeDefaultstring-No
typeInfostring-No
typeSuccessstring-No
typeWarningstring-No

The css module should look like this:

.alert          { ... }
.button         { ... }
.dismissButton  { ... }
.typeDanger     { ... }
.typeDefault    { ... }
.typeInfo       { ... }
.typeSuccess    { ... }
.typeWarning    { ... }

Development

Installation

$ npm install

Test

$ npm run test

Build

Compiles the TypeScript source to ES5.

$ npm run build