react-hook-popup
Advanced tools
Comparing version 0.0.5-alpha.3 to 0.0.5-alpha.4
export { SnackBar, SnackBarProps } from './Snackbar'; | ||
export { Alert, AlertProps } from './Alert'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SnackBar = void 0; | ||
exports.Alert = exports.SnackBar = void 0; | ||
var Snackbar_1 = require("./Snackbar"); | ||
Object.defineProperty(exports, "SnackBar", { enumerable: true, get: function () { return Snackbar_1.SnackBar; } }); | ||
var Alert_1 = require("./Alert"); | ||
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return Alert_1.Alert; } }); |
import React from 'react'; | ||
import './snackbar.scss'; | ||
import './snackbar.css'; | ||
export interface SnackBarProps { | ||
@@ -4,0 +4,0 @@ handleClose: () => void; |
@@ -24,3 +24,3 @@ "use strict"; | ||
var react_1 = __importStar(require("react")); | ||
require("./snackbar.scss"); | ||
require("./snackbar.css"); | ||
var DEFAULT_VARIANT = 'info'; | ||
@@ -33,4 +33,6 @@ var DEFAULT_TIMEOUT = 4000; | ||
}, []); | ||
return react_1.default.createElement("div", { className: "rhp-snackbar " + variant }, children); | ||
return (react_1.default.createElement("div", { className: "rhp-snackbar rhp-snackbar--" + variant }, | ||
children, | ||
react_1.default.createElement("span", { onClick: handleClose, className: "rhp-snackbar__close-button" }, "\u2715"))); | ||
}; | ||
exports.SnackBar = SnackBar; |
@@ -8,3 +8,3 @@ import { SnackBarProps } from '../components'; | ||
} | ||
export declare function useSnackBar({ key, variant, timeout }?: UseSnackBarOptions): PopupMethods; | ||
export declare function useSnackBar({ key, variant, timeout, }?: UseSnackBarOptions): PopupMethods; | ||
export {}; |
@@ -12,4 +12,4 @@ "use strict"; | ||
function useSnackBar(_a) { | ||
var _b = _a === void 0 ? {} : _a, key = _b.key, variant = _b.variant, timeout = _b.timeout; | ||
return usePopup_1.usePopup(key || DEFAULT_KEY, function (_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.key, key = _c === void 0 ? DEFAULT_KEY : _c, variant = _b.variant, timeout = _b.timeout; | ||
return usePopup_1.usePopup(key + "-" + variant, function (_a) { | ||
var message = _a.message, handleClose = _a.handleClose; | ||
@@ -16,0 +16,0 @@ return (react_1.default.createElement(components_1.SnackBar, { variant: variant, timeout: timeout, handleClose: handleClose }, message)); |
export { PopupProvider } from './PopupProvider'; | ||
export { usePopup } from './hooks/usePopup'; | ||
export { useSnackBar } from './hooks/useSnackBar'; | ||
export { useAlert } from './hooks/useAlert'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.usePopup = exports.PopupProvider = void 0; | ||
exports.useAlert = exports.useSnackBar = exports.usePopup = exports.PopupProvider = void 0; | ||
var PopupProvider_1 = require("./PopupProvider"); | ||
@@ -8,1 +8,5 @@ Object.defineProperty(exports, "PopupProvider", { enumerable: true, get: function () { return PopupProvider_1.PopupProvider; } }); | ||
Object.defineProperty(exports, "usePopup", { enumerable: true, get: function () { return usePopup_1.usePopup; } }); | ||
var useSnackBar_1 = require("./hooks/useSnackBar"); | ||
Object.defineProperty(exports, "useSnackBar", { enumerable: true, get: function () { return useSnackBar_1.useSnackBar; } }); | ||
var useAlert_1 = require("./hooks/useAlert"); | ||
Object.defineProperty(exports, "useAlert", { enumerable: true, get: function () { return useAlert_1.useAlert; } }); |
@@ -5,4 +5,4 @@ "use strict"; | ||
exports.consts = { | ||
CONTEXT_ERROR_MESSAGE: 'An error has occured with the react-hook-popup library', | ||
CONTEXT_ERROR_MESSAGE: 'In order to use react-hook-popup hooks, you must wrap your application in <PopupProvider>', | ||
UNFOUND_POPUP: function (key) { return "Attempted to act on a non-existing popup with key: " + key; }, | ||
}; |
{ | ||
"name": "react-hook-popup", | ||
"version": "0.0.5-alpha.3", | ||
"version": "0.0.5-alpha.4", | ||
"description": "Easily manage popups like alerts and modals in React with a single hook", | ||
@@ -19,4 +19,4 @@ "homepage": "https://github.com/aidanjw1/react-hook-popup#readme", | ||
"build:ts": "tsc", | ||
"build:sass": "sass src/:dist/", | ||
"build-cleanup": "rm -r dist/web_modules && rm -r dist/sass && rm -r dist/__snowpack__", | ||
"build:sass": "sass --no-source-map src/:dist/", | ||
"clean": "rm -r dist", | ||
"typecheck": "tsc --noEmit", | ||
@@ -23,0 +23,0 @@ "test": "npm run typecheck && jest", |
Sorry, the diff of this file is not supported yet
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
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
22334
34
470
0