Socket
Socket
Sign inDemoInstall

react-hook-popup

Package Overview
Dependencies
3
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5-alpha.3 to 0.0.5-alpha.4

dist/components/Alert/alert.css

1

dist/components/index.d.ts
export { SnackBar, SnackBarProps } from './Snackbar';
export { Alert, AlertProps } from './Alert';

4

dist/components/index.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc