@bufferapp/notifications
Advanced tools
Comparing version 1.9.3 to 1.9.4-beta-01
114
package.json
{ | ||
"name": "@bufferapp/notifications", | ||
"version": "1.9.3", | ||
"version": "1.9.4-beta-01", | ||
"description": "Display application notifications", | ||
"main": "index.js", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"lint": "eslint . --ignore-pattern coverage node_modules" | ||
"storybook": "start-storybook -p 9002", | ||
"lint": "eslint --ext .js test/ src/", | ||
"test": "npm run lint && jest", | ||
"test-watch": "jest --watch", | ||
"build": "babel src -d lib", | ||
"prepublish": "babel src -d lib" | ||
}, | ||
"author": "hharnisc@gmail.com", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"dependencies": { | ||
"@bufferapp/keywrapper": "0.2.0" | ||
"@bufferapp/keywrapper": "0.2.0", | ||
"uuid": "3.3.2" | ||
}, | ||
"devDependencies": { | ||
"eslint": "3.19.0" | ||
"@bufferapp/components": "3.0.2", | ||
"@storybook/core": "^3.4.11", | ||
"@storybook/react": "^3.4.11", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.3", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.6.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-export-extensions": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-react": "^6.24.1", | ||
"deep-freeze": "0.0.1", | ||
"eslint": "^5.3.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint-plugin-react": "7.11.1", | ||
"jest": "^23.5.0", | ||
"prettier": "^1.14.2", | ||
"react": "^16.5.2", | ||
"react-dom": "^16.5.2", | ||
"react-redux": "5.0.7", | ||
"storybook-addon-a11y": "^3.1.9" | ||
}, | ||
"peerDependencies": { | ||
"@bufferapp/components": "3.x", | ||
"react": "16.x", | ||
"react-dom": "16.x", | ||
"react-redux": "5.x" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { | ||
"node": "8" | ||
}, | ||
"browsers": "> 3%", | ||
"modules": false | ||
} | ||
], | ||
"react" | ||
], | ||
"plugins": [ | ||
"transform-class-properties", | ||
"transform-export-extensions", | ||
"transform-object-rest-spread" | ||
], | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"modules": "commonjs" | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
"transform-class-properties", | ||
"transform-export-extensions", | ||
"transform-object-rest-spread" | ||
] | ||
} | ||
} | ||
}, | ||
"eslintConfig": { | ||
"parser": "babel-eslint", | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"plugins": [ | ||
"prettier", | ||
"react" | ||
], | ||
"rules": { | ||
"prettier/prettier": [ | ||
2, | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"semi": false, | ||
"bracketSpacing": true | ||
} | ||
], | ||
"no-unused-vars": 2 | ||
} | ||
}, | ||
"jest": { | ||
"transformIgnorePatterns": [ | ||
"/node_modules(?!/@bufferapp/components)/" | ||
], | ||
"verbose": true | ||
}, | ||
"publishConfig": { | ||
@@ -17,0 +121,0 @@ "access": "public" |
@@ -1,55 +0,2 @@ | ||
# @bufferapp/notifications | ||
Create a notification that disappears after 5 seconds or when the user closes it. | ||
## Setup | ||
### Add Reducer And Middlware To Store | ||
```js | ||
import { | ||
createStore, | ||
combineReducers, | ||
applyMiddleware, | ||
} from 'redux'; | ||
import { middleware, reducer } from '@bufferapp/notifications'; | ||
const store = createStore( | ||
combineReducers({ | ||
notifications: reducer, // add notifications reducer under the `notifications` state tree | ||
}), | ||
{/* initial state */}, | ||
applyMiddleware(middleware), | ||
); | ||
``` | ||
### Add Notifications Within The React Redux Provider | ||
```js | ||
import { Provider } from 'react-redux'; | ||
import Notifications from '@bufferapp/notifications'; | ||
<Provider store={store}> | ||
<Notifications /> | ||
</Provider> | ||
``` | ||
## API | ||
### createNotification | ||
**notificationType** _string_ the type of notification to display, `success` or `error` controls the icon | ||
**message** _string_ the message to display on the notification | ||
```js | ||
import { actions } from '@bufferapp/notifications'; | ||
// dispatch the createNotification action with the redux store | ||
store.dispatch(actions.createNotification({ | ||
notificationType: 'success', | ||
message: 'Hooray! A notification appears!', | ||
})); | ||
``` | ||
# buffer-js-notifications | ||
Notifications for React + Redux applications |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19878
15
506
6
23
2
3
1
+ Addeduuid@3.3.2
+ Added@babel/runtime@7.26.0(transitive)
+ Added@bufferapp/components@3.6.3(transitive)
+ Added@bufferapp/react-keyframes@0.2.5(transitive)
+ Addeddom-scroll-into-view@1.0.1(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedinvariant@2.2.4(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedraf@3.4.0(transitive)
+ Addedreact@16.14.0(transitive)
+ Addedreact-autocomplete@1.7.2(transitive)
+ Addedreact-day-picker@7.2.3(transitive)
+ Addedreact-dom@16.14.0(transitive)
+ Addedreact-is@16.13.1(transitive)
+ Addedreact-lifecycles-compat@3.0.4(transitive)
+ Addedreact-redux@5.1.2(transitive)
+ Addedredux@4.2.1(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedscheduler@0.19.1(transitive)
+ Addeduuid@3.3.2(transitive)