@toptal/picasso-notification 2.0.16 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-package/src/Notification/Notification.d.ts +1 -1
- package/dist-package/src/Notification/Notification.d.ts.map +1 -1
- package/dist-package/src/Notification/Notification.js +22 -26
- package/dist-package/src/Notification/Notification.js.map +1 -1
- package/dist-package/src/NotificationActions/NotificationActions.d.ts.map +1 -1
- package/dist-package/src/NotificationActions/NotificationActions.js +1 -7
- package/dist-package/src/NotificationActions/NotificationActions.js.map +1 -1
- package/dist-package/src/NotificationCompound/index.d.ts +1 -1
- package/dist-package/src/use-notification/use-notifications.d.ts.map +1 -1
- package/dist-package/src/use-notification/use-notifications.js +2 -11
- package/dist-package/src/use-notification/use-notifications.js.map +1 -1
- package/package.json +9 -8
- package/src/Notification/Notification.tsx +36 -43
- package/src/Notification/__snapshots__/test.tsx.snap +16 -20
- package/src/NotificationActions/NotificationActions.tsx +0 -11
- package/src/NotificationActions/__snapshots__/test.tsx.snap +18 -22
- package/src/use-notification/__snapshots__/test.tsx.snap +114 -126
- package/src/use-notification/use-notifications.tsx +6 -14
- package/dist-package/src/Notification/styles.d.ts +0 -4
- package/dist-package/src/Notification/styles.d.ts.map +0 -1
- package/dist-package/src/Notification/styles.js +0 -73
- package/dist-package/src/Notification/styles.js.map +0 -1
- package/dist-package/src/NotificationActions/styles.d.ts +0 -3
- package/dist-package/src/NotificationActions/styles.d.ts.map +0 -1
- package/dist-package/src/NotificationActions/styles.js +0 -2
- package/dist-package/src/NotificationActions/styles.js.map +0 -1
- package/dist-package/src/use-notification/styles.d.ts +0 -3
- package/dist-package/src/use-notification/styles.d.ts.map +0 -1
- package/dist-package/src/use-notification/styles.js +0 -12
- package/dist-package/src/use-notification/styles.js.map +0 -1
- package/src/Notification/styles.ts +0 -85
- package/src/NotificationActions/styles.ts +0 -1
- package/src/use-notification/styles.ts +0 -13
|
@@ -21,6 +21,6 @@ export interface PrivateProps extends StandardProps, HTMLAttributes<HTMLDivEleme
|
|
|
21
21
|
}
|
|
22
22
|
/** `elevated` and `icon` props are omitted from the public declaration, since they're only for internal use */
|
|
23
23
|
export declare type PublicProps = Omit<PrivateProps, 'elevated' | 'icon'>;
|
|
24
|
-
export declare const Notification: React.ForwardRefExoticComponent<PrivateProps & React.RefAttributes<
|
|
24
|
+
export declare const Notification: React.ForwardRefExoticComponent<PrivateProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
25
|
export default Notification;
|
|
26
26
|
//# sourceMappingURL=Notification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../src/Notification/Notification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,KAAmC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../src/Notification/Notification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,KAAmC,MAAM,OAAO,CAAA;AACvD,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAcpE,oBAAY,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE9D,MAAM,WAAW,YACf,SAAQ,aAAa,EACnB,cAAc,CAAC,cAAc,CAAC;IAChC,uCAAuC;IACvC,QAAQ,EAAE,SAAS,CAAA;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACxD,oCAAoC;IACpC,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,gDAAgD;IAChD,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED,+GAA+G;AAC/G,oBAAY,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,MAAM,CAAC,CAAA;AAsEjE,eAAO,MAAM,YAAY,qFAwCxB,CAAA;AASD,eAAe,YAAY,CAAA"}
|
|
@@ -10,55 +10,51 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef, cloneElement } from 'react';
|
|
13
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
14
|
-
import { SnackbarContent } from '@material-ui/core';
|
|
15
|
-
import cx from 'classnames';
|
|
16
|
-
import capitalize from '@material-ui/core/utils/capitalize';
|
|
17
13
|
import { CloseMinor16, ExclamationSolid16, ExclamationSolid24, CheckSolid24, Info24, } from '@toptal/picasso-icons';
|
|
18
14
|
import { Container } from '@toptal/picasso-container';
|
|
19
15
|
import { ButtonCircular } from '@toptal/picasso-button';
|
|
20
16
|
import { Typography } from '@toptal/picasso-typography';
|
|
21
|
-
import
|
|
17
|
+
import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge';
|
|
18
|
+
import { capitalize } from '@toptal/picasso-utils';
|
|
22
19
|
const renderNotificationCloseButton = ({ onClose, testIds }) => (React.createElement(ButtonCircular, { "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.closeButton, onClick: onClose,
|
|
23
20
|
// TODO: [FX-5219] need to avoid such customization
|
|
24
21
|
className: 'absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent', icon: React.createElement(CloseMinor16, { color: 'darkGrey' }) }));
|
|
25
|
-
const renderNotificationIcon = ({ icon, variant
|
|
26
|
-
const iconProps = {
|
|
27
|
-
className: classes === null || classes === void 0 ? void 0 : classes.icon,
|
|
28
|
-
};
|
|
22
|
+
const renderNotificationIcon = ({ icon, variant = 'yellow' }) => {
|
|
29
23
|
// TODO: these are Icons required circular Icon bg color definitions, all Icons should be white on that color
|
|
30
24
|
// Missing the following: https://github.com/toptal/picasso/issues/253
|
|
31
25
|
switch (variant) {
|
|
32
26
|
case 'red':
|
|
33
|
-
return React.createElement(ExclamationSolid24,
|
|
27
|
+
return React.createElement(ExclamationSolid24, { color: 'red' });
|
|
34
28
|
case 'yellow':
|
|
35
|
-
return React.createElement(ExclamationSolid16,
|
|
29
|
+
return React.createElement(ExclamationSolid16, { color: 'yellow' });
|
|
36
30
|
case 'green':
|
|
37
|
-
return React.createElement(CheckSolid24,
|
|
31
|
+
return React.createElement(CheckSolid24, { color: 'green' });
|
|
38
32
|
default: {
|
|
39
|
-
const infoProps =
|
|
33
|
+
const infoProps = { color: 'grey' };
|
|
40
34
|
return icon ? cloneElement(icon, infoProps) : React.createElement(Info24, Object.assign({}, infoProps));
|
|
41
35
|
}
|
|
42
36
|
}
|
|
43
37
|
};
|
|
44
38
|
const renderNotificationContent = (props) => {
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
const { children, onClose, variant, testIds } = props;
|
|
40
|
+
return (React.createElement(Container, { flex: true, className: 'flex w-full my-0 mx-auto p-0 max-w-[75em] min-w-0', "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.content },
|
|
41
|
+
React.createElement(Container, { flex: true, alignItems: 'center', className: twJoin('min-w-[1.5em] mr-[1em]', variant === 'yellow'
|
|
42
|
+
? 'h-[1em] min-w-[1em] mt-[2px] basis-0'
|
|
43
|
+
: 'h-[1.5em] basis-[1.5em]') }, renderNotificationIcon(props)),
|
|
44
|
+
React.createElement(Typography, { size: variant === 'yellow' ? 'small' : 'medium', color: 'black', className: twJoin('break-words min-w-0', variant === 'yellow' ? '!mt-0' : '!mt-[1px]'), as: 'div' }, children),
|
|
50
45
|
onClose && renderNotificationCloseButton(props)));
|
|
51
46
|
};
|
|
52
|
-
const useStyles = makeStyles(styles, {
|
|
53
|
-
name: 'Notification',
|
|
54
|
-
});
|
|
55
47
|
export const Notification = forwardRef(function Notification(props, ref) {
|
|
56
48
|
const { className, variant, elevated, testIds, 'data-testid': dataTestId } = props, rest = __rest(props, ["className", "variant", "elevated", "testIds", 'data-testid']);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
const classByVariant = {
|
|
50
|
+
notificationRed: 'bg-red-100',
|
|
51
|
+
notificationGreen: 'bg-green-100',
|
|
52
|
+
notificationWhite: 'bg-white px-[1.5em] pt-[1.5625em] pb-[1.5em]',
|
|
53
|
+
notificationYellow: 'bg-yellow-100 px-[1em] py-[1.5em] sm:p-[1.5em] lg:px-[130px] lg:py-[1.5em]',
|
|
54
|
+
};
|
|
55
|
+
return (React.createElement("div", Object.assign({}, rest, { className: twMerge('relative w-full flex flex-nowrap items-start shadow-[none] rounded-[none] pt-[1.5em] pb-[1.5625em] pr-[2.5em] pl-[1.5em] transition-shadow duration-300', elevated && 'shadow-3 rounded-sm', variant
|
|
56
|
+
? classByVariant[`notification${capitalize(variant)}`]
|
|
57
|
+
: classByVariant.notificationYellow, className), "data-testid": dataTestId || (testIds === null || testIds === void 0 ? void 0 : testIds.notification), ref: ref, role: 'alert' }), renderNotificationContent(Object.assign({}, props))));
|
|
62
58
|
});
|
|
63
59
|
Notification.defaultProps = {
|
|
64
60
|
elevated: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../../src/Notification/Notification.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEv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AE,UAAU,KAEvB,KAAK,EADJ,IAAI,UACL,KAAK,EAPH,8DAOL,CAAQ,CAAA;IAET,MAAM,cAAc,GAAY;QAC9B,eAAe,EAAE,YAAY;QAC7B,iBAAiB,EAAE,cAAc;QACjC,iBAAiB,EAAE,8CAA8C;QACjE,kBAAkB,EAChB,4EAA4E;KAC/E,CAAA;IAED,OAAO,CACL,6CACM,IAAI,IACR,SAAS,EAAE,OAAO,CAChB,yJAAyJ,EACzJ,QAAQ,IAAI,qBAAqB,EACjC,OAAO;YACL,CAAC,CAAC,cAAc,CAAC,eAAe,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACtD,CAAC,CAAC,cAAc,CAAC,kBAAkB,EACrC,SAAS,CACV,iBACY,UAAU,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAA,EAChD,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,KAEX,yBAAyB,mBACrB,KAAK,EACR,CACE,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,YAAY,CAAC,YAAY,GAAG;IAC1B,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,QAAQ;CAClB,CAAA;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA;AAEzC,eAAe,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationActions.d.ts","sourceRoot":"","sources":["../../../src/NotificationActions/NotificationActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAqB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"NotificationActions.d.ts","sourceRoot":"","sources":["../../../src/NotificationActions/NotificationActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3E,eAAO,MAAM,mBAAmB,8EAiB/B,CAAA;AAMD,eAAe,mBAAmB,CAAA"}
|
|
@@ -10,16 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
14
13
|
import { Container } from '@toptal/picasso-container';
|
|
15
|
-
import styles from './styles';
|
|
16
|
-
const useStyles = makeStyles(styles, {
|
|
17
|
-
name: 'PicassoNotificationActions',
|
|
18
|
-
});
|
|
19
14
|
export const NotificationActions = forwardRef(function NotificationActions(props, ref) {
|
|
20
15
|
const { children, className, style } = props, rest = __rest(props, ["children", "className", "style"]);
|
|
21
|
-
|
|
22
|
-
return (React.createElement(Container, Object.assign({}, rest, { classes: classes, className: className, style: style, top: 'xsmall', flex: true, ref: ref }), children));
|
|
16
|
+
return (React.createElement(Container, Object.assign({}, rest, { className: className, style: style, top: 'xsmall', flex: true, ref: ref }), children));
|
|
23
17
|
});
|
|
24
18
|
NotificationActions.defaultProps = {};
|
|
25
19
|
NotificationActions.displayName = 'NotificationActions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationActions.js","sourceRoot":"","sources":["../../../src/NotificationActions/NotificationActions.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NotificationActions.js","sourceRoot":"","sources":["../../../src/NotificationActions/NotificationActions.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAIrD,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAC3C,SAAS,mBAAmB,CAAC,KAAK,EAAE,GAAG;IACrC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA/C,kCAAuC,CAAQ,CAAA;IAErD,OAAO,CACL,oBAAC,SAAS,oBACJ,IAAI,IACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAC,QAAQ,EACZ,IAAI,QACJ,GAAG,EAAE,GAAG,KAEP,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACF,CAAA;AAED,mBAAmB,CAAC,YAAY,GAAG,EAAE,CAAA;AAErC,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA;AAEvD,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const NotificationCompound: import("react").ForwardRefExoticComponent<import("../Notification").PrivateProps & import("react").RefAttributes<
|
|
2
|
+
export declare const NotificationCompound: import("react").ForwardRefExoticComponent<import("../Notification").PrivateProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
3
3
|
Actions: import("react").ForwardRefExoticComponent<import("../NotificationActions/NotificationActions").Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-notifications.d.ts","sourceRoot":"","sources":["../../../src/use-notification/use-notifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,KAA2C,MAAM,OAAO,CAAA;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"use-notifications.d.ts","sourceRoot":"","sources":["../../../src/use-notification/use-notifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,KAA2C,MAAM,OAAO,CAAA;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AA4C9C,eAAO,MAAM,gBAAgB;yBAkCb,SAAS,SAAS,YAAY,YAAY,aAAa;wBAAvD,SAAS,SAAS,YAAY,YAAY,aAAa;2BAAvD,SAAS,SAAS,YAAY,YAAY,aAAa;sCA7B3C,kBAAkB,YAAY,aAAa;;CAsDtE,CAAA"}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import React, { forwardRef, useMemo, useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { twJoin } from '@toptal/picasso-tailwind-merge';
|
|
3
3
|
import { useSnackbar } from 'notistack';
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
5
4
|
import { Notification as PicassoNotification } from '../Notification';
|
|
6
|
-
import styles from './styles';
|
|
7
5
|
const defaultPosition = {
|
|
8
6
|
vertical: 'top',
|
|
9
7
|
horizontal: 'right',
|
|
10
8
|
};
|
|
11
|
-
const useStyles = makeStyles(styles, {
|
|
12
|
-
name: 'PicassoNotification',
|
|
13
|
-
});
|
|
14
9
|
const StyledNotification =
|
|
15
10
|
// eslint-disable-next-line react/display-name
|
|
16
11
|
forwardRef(function Notification(props, ref) {
|
|
17
12
|
const { content, icon, key, onClose, variant = 'white' } = props;
|
|
18
|
-
|
|
19
|
-
return (React.createElement(PicassoNotification, { variant: variant, elevated: true, icon: icon, key: key, onClose: onClose, className: cx({
|
|
20
|
-
[classes.generalNotification]: variant === 'white',
|
|
21
|
-
[classes.formNotification]: variant !== 'white',
|
|
22
|
-
}), ref: ref }, content));
|
|
13
|
+
return (React.createElement(PicassoNotification, { variant: variant, elevated: true, icon: icon, key: key, onClose: onClose, className: twJoin('max-w-full', variant === 'white' ? 'w-[27.5em]' : `w-[20em]`), ref: ref }, content));
|
|
23
14
|
});
|
|
24
15
|
export const useNotifications = () => {
|
|
25
16
|
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-notifications.js","sourceRoot":"","sources":["../../../src/use-notification/use-notifications.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-notifications.js","sourceRoot":"","sources":["../../../src/use-notification/use-notifications.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAKvC,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErE,MAAM,eAAe,GAAmB;IACtC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,OAAO;CACpB,CAAA;AAUD,MAAM,kBAAkB;AACtB,8CAA8C;AAC9C,UAAU,CAAwB,SAAS,YAAY,CAAC,KAAK,EAAE,GAAG;IAChE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,KAAK,CAAA;IAEhE,OAAO,CACL,oBAAC,mBAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,QACR,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,CACf,YAAY,EACZ,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAChD,EACD,GAAG,EAAE,GAAG,IAEP,OA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CAAC,eAAe,CAAC,CAClB,CAAA;IAED,OAAO;QACL,SAAS,EAAE,OAAO,CAChB,GAAG,EAAE,CAAC,sBAAsB,CAAC,KAAK,CAAC,EACnC,CAAC,sBAAsB,CAAC,CACzB;QACD,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,sBAAsB,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC;QAC3E,WAAW,EAAE,OAAO,CAClB,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EACrC,CAAC,sBAAsB,CAAC,CACzB;QACD,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC;QAC/D,iBAAiB,EAAE,aAAa;KACjC,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-notification",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Toptal UI components library - Notification",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@toptal/picasso-button": "
|
|
26
|
-
"@toptal/picasso-container": "
|
|
27
|
-
"@toptal/picasso-icons": "1.
|
|
25
|
+
"@toptal/picasso-button": "3.0.1",
|
|
26
|
+
"@toptal/picasso-container": "2.0.0",
|
|
27
|
+
"@toptal/picasso-icons": "1.6.0",
|
|
28
28
|
"@toptal/picasso-shared": "15.0.0",
|
|
29
|
-
"@toptal/picasso-typography": "
|
|
29
|
+
"@toptal/picasso-typography": "3.0.0",
|
|
30
30
|
"@toptal/picasso-utils": "1.0.3",
|
|
31
31
|
"classnames": "^2.5.1",
|
|
32
32
|
"notistack": "3.0.1"
|
|
@@ -36,16 +36,17 @@
|
|
|
36
36
|
"**/styles.js"
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@
|
|
39
|
+
"@toptal/picasso-tailwind-merge": "^1.0.1",
|
|
40
40
|
"@toptal/picasso-provider": "*",
|
|
41
|
-
"
|
|
41
|
+
"@toptal/picasso-tailwind": ">=2.7",
|
|
42
42
|
"react": ">=16.12.0 < 19.0.0"
|
|
43
43
|
},
|
|
44
44
|
"exports": {
|
|
45
45
|
".": "./dist-package/src/index.js"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@toptal/picasso-
|
|
48
|
+
"@toptal/picasso-tailwind-merge": "1.2.0",
|
|
49
|
+
"@toptal/picasso-provider": "5.0.0",
|
|
49
50
|
"@toptal/picasso-test-utils": "1.1.1"
|
|
50
51
|
},
|
|
51
52
|
"files": [
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { ReactNode, MouseEvent, ReactElement, HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef, cloneElement } from 'react'
|
|
3
|
-
import type {
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
|
-
import { SnackbarContent } from '@material-ui/core'
|
|
6
|
-
import cx from 'classnames'
|
|
7
|
-
import capitalize from '@material-ui/core/utils/capitalize'
|
|
8
|
-
import type { StandardProps } from '@toptal/picasso-shared'
|
|
3
|
+
import type { Classes, StandardProps } from '@toptal/picasso-shared'
|
|
9
4
|
import {
|
|
10
5
|
CloseMinor16,
|
|
11
6
|
ExclamationSolid16,
|
|
@@ -16,8 +11,8 @@ import {
|
|
|
16
11
|
import { Container } from '@toptal/picasso-container'
|
|
17
12
|
import { ButtonCircular } from '@toptal/picasso-button'
|
|
18
13
|
import { Typography } from '@toptal/picasso-typography'
|
|
19
|
-
|
|
20
|
-
import
|
|
14
|
+
import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge'
|
|
15
|
+
import { capitalize } from '@toptal/picasso-utils'
|
|
21
16
|
|
|
22
17
|
export type VariantType = 'red' | 'green' | 'white' | 'yellow'
|
|
23
18
|
|
|
@@ -54,25 +49,21 @@ const renderNotificationCloseButton = ({ onClose, testIds }: PrivateProps) => (
|
|
|
54
49
|
/>
|
|
55
50
|
)
|
|
56
51
|
|
|
57
|
-
const renderNotificationIcon = ({ icon, variant
|
|
58
|
-
const iconProps = {
|
|
59
|
-
className: classes?.icon,
|
|
60
|
-
}
|
|
61
|
-
|
|
52
|
+
const renderNotificationIcon = ({ icon, variant = 'yellow' }: PrivateProps) => {
|
|
62
53
|
// TODO: these are Icons required circular Icon bg color definitions, all Icons should be white on that color
|
|
63
54
|
// Missing the following: https://github.com/toptal/picasso/issues/253
|
|
64
55
|
switch (variant) {
|
|
65
56
|
case 'red':
|
|
66
|
-
return <ExclamationSolid24
|
|
57
|
+
return <ExclamationSolid24 color='red' />
|
|
67
58
|
|
|
68
59
|
case 'yellow':
|
|
69
|
-
return <ExclamationSolid16
|
|
60
|
+
return <ExclamationSolid16 color='yellow' />
|
|
70
61
|
|
|
71
62
|
case 'green':
|
|
72
|
-
return <CheckSolid24
|
|
63
|
+
return <CheckSolid24 color='green' />
|
|
73
64
|
|
|
74
65
|
default: {
|
|
75
|
-
const infoProps = {
|
|
66
|
+
const infoProps = { color: 'grey' as const }
|
|
76
67
|
|
|
77
68
|
return icon ? cloneElement(icon, infoProps) : <Info24 {...infoProps} />
|
|
78
69
|
}
|
|
@@ -80,22 +71,22 @@ const renderNotificationIcon = ({ icon, variant, classes }: PrivateProps) => {
|
|
|
80
71
|
}
|
|
81
72
|
|
|
82
73
|
const renderNotificationContent = (props: PrivateProps) => {
|
|
83
|
-
const {
|
|
84
|
-
|
|
85
|
-
const capitalizedVariant = capitalize(variant as string)
|
|
74
|
+
const { children, onClose, variant, testIds } = props
|
|
86
75
|
|
|
87
76
|
return (
|
|
88
77
|
<Container
|
|
89
78
|
flex
|
|
90
|
-
className=
|
|
79
|
+
className='flex w-full my-0 mx-auto p-0 max-w-[75em] min-w-0'
|
|
91
80
|
data-testid={testIds?.content}
|
|
92
81
|
>
|
|
93
82
|
<Container
|
|
94
83
|
flex
|
|
95
84
|
alignItems='center'
|
|
96
|
-
className={
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
className={twJoin(
|
|
86
|
+
'min-w-[1.5em] mr-[1em]',
|
|
87
|
+
variant === 'yellow'
|
|
88
|
+
? 'h-[1em] min-w-[1em] mt-[2px] basis-0'
|
|
89
|
+
: 'h-[1.5em] basis-[1.5em]'
|
|
99
90
|
)}
|
|
100
91
|
>
|
|
101
92
|
{renderNotificationIcon(props)}
|
|
@@ -103,7 +94,7 @@ const renderNotificationContent = (props: PrivateProps) => {
|
|
|
103
94
|
<Typography
|
|
104
95
|
size={variant === 'yellow' ? 'small' : 'medium'}
|
|
105
96
|
color='black'
|
|
106
|
-
className={
|
|
97
|
+
className={twJoin(
|
|
107
98
|
'break-words min-w-0',
|
|
108
99
|
variant === 'yellow' ? '!mt-0' : '!mt-[1px]'
|
|
109
100
|
)}
|
|
@@ -116,11 +107,7 @@ const renderNotificationContent = (props: PrivateProps) => {
|
|
|
116
107
|
)
|
|
117
108
|
}
|
|
118
109
|
|
|
119
|
-
const
|
|
120
|
-
name: 'Notification',
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
export const Notification = forwardRef<HTMLElement, PrivateProps>(
|
|
110
|
+
export const Notification = forwardRef<HTMLDivElement, PrivateProps>(
|
|
124
111
|
function Notification(props, ref) {
|
|
125
112
|
const {
|
|
126
113
|
className,
|
|
@@ -131,27 +118,33 @@ export const Notification = forwardRef<HTMLElement, PrivateProps>(
|
|
|
131
118
|
...rest
|
|
132
119
|
} = props
|
|
133
120
|
|
|
134
|
-
const
|
|
121
|
+
const classByVariant: Classes = {
|
|
122
|
+
notificationRed: 'bg-red-100',
|
|
123
|
+
notificationGreen: 'bg-green-100',
|
|
124
|
+
notificationWhite: 'bg-white px-[1.5em] pt-[1.5625em] pb-[1.5em]',
|
|
125
|
+
notificationYellow:
|
|
126
|
+
'bg-yellow-100 px-[1em] py-[1.5em] sm:p-[1.5em] lg:px-[130px] lg:py-[1.5em]',
|
|
127
|
+
}
|
|
135
128
|
|
|
136
129
|
return (
|
|
137
|
-
<
|
|
130
|
+
<div
|
|
138
131
|
{...rest}
|
|
139
|
-
className={
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
[
|
|
144
|
-
|
|
145
|
-
classes.notification,
|
|
132
|
+
className={twMerge(
|
|
133
|
+
'relative w-full flex flex-nowrap items-start shadow-[none] rounded-[none] pt-[1.5em] pb-[1.5625em] pr-[2.5em] pl-[1.5em] transition-shadow duration-300',
|
|
134
|
+
elevated && 'shadow-3 rounded-sm',
|
|
135
|
+
variant
|
|
136
|
+
? classByVariant[`notification${capitalize(variant)}`]
|
|
137
|
+
: classByVariant.notificationYellow,
|
|
146
138
|
className
|
|
147
139
|
)}
|
|
148
140
|
data-testid={dataTestId || testIds?.notification}
|
|
149
|
-
|
|
141
|
+
ref={ref}
|
|
142
|
+
role='alert'
|
|
143
|
+
>
|
|
144
|
+
{renderNotificationContent({
|
|
150
145
|
...props,
|
|
151
|
-
classes,
|
|
152
146
|
})}
|
|
153
|
-
|
|
154
|
-
/>
|
|
147
|
+
</div>
|
|
155
148
|
)
|
|
156
149
|
}
|
|
157
150
|
)
|
|
@@ -6,33 +6,29 @@ exports[`Notification renders 1`] = `
|
|
|
6
6
|
class="Picasso-root"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
class="
|
|
9
|
+
class="relative w-full flex flex-nowrap items-start shadow-[none] rounded-[none] transition-shadow duration-300 bg-yellow px-[1em] py-[1.5em] sm:p-[1.5em] lg:px-[130px] lg:py-[1.5em]"
|
|
10
10
|
role="alert"
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
13
|
-
class="
|
|
13
|
+
class="flex w-full my-0 mx-auto p-0 max-w min-w"
|
|
14
14
|
>
|
|
15
15
|
<div
|
|
16
|
-
class="
|
|
16
|
+
class="items-center flex mr-[1em] h-[1em] min-w mt-[2px] basis-0"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
class="
|
|
18
|
+
<svg
|
|
19
|
+
class="PicassoSvgExclamationSolid16-root PicassoSvgExclamationSolid16-yellow"
|
|
20
|
+
style="min-width: 16px; min-height: 16px;"
|
|
21
|
+
viewBox="0 0 16 16"
|
|
20
22
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</div>
|
|
31
|
-
<div
|
|
32
|
-
class="m-0 text-sm text-black font-regular break-words min-w !mt-0"
|
|
33
|
-
>
|
|
34
|
-
test example string
|
|
35
|
-
</div>
|
|
23
|
+
<path
|
|
24
|
+
d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm0 11a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm0-8a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0V4a1 1 0 0 0-1-1Z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
class="m-0 text-sm text-black font-regular break-words min-w !mt-0"
|
|
30
|
+
>
|
|
31
|
+
test example string
|
|
36
32
|
</div>
|
|
37
33
|
</div>
|
|
38
34
|
</div>
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
3
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
6
4
|
import { Container } from '@toptal/picasso-container'
|
|
7
5
|
|
|
8
|
-
import styles from './styles'
|
|
9
|
-
|
|
10
6
|
export interface Props extends BaseProps, HTMLAttributes<HTMLDivElement> {}
|
|
11
7
|
|
|
12
|
-
const useStyles = makeStyles<Theme>(styles, {
|
|
13
|
-
name: 'PicassoNotificationActions',
|
|
14
|
-
})
|
|
15
|
-
|
|
16
8
|
export const NotificationActions = forwardRef<HTMLDivElement, Props>(
|
|
17
9
|
function NotificationActions(props, ref) {
|
|
18
10
|
const { children, className, style, ...rest } = props
|
|
19
11
|
|
|
20
|
-
const classes = useStyles()
|
|
21
|
-
|
|
22
12
|
return (
|
|
23
13
|
<Container
|
|
24
14
|
{...rest}
|
|
25
|
-
classes={classes}
|
|
26
15
|
className={className}
|
|
27
16
|
style={style}
|
|
28
17
|
top='xsmall'
|
|
@@ -6,37 +6,33 @@ exports[`NotificationActions renders 1`] = `
|
|
|
6
6
|
class="Picasso-root"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
class="
|
|
9
|
+
class="relative w-full flex flex-nowrap items-start shadow-[none] rounded-[none] transition-shadow duration-300 bg-yellow px-[1em] py-[1.5em] sm:p-[1.5em] lg:px-[130px] lg:py-[1.5em]"
|
|
10
10
|
role="alert"
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
13
|
-
class="
|
|
13
|
+
class="flex w-full my-0 mx-auto p-0 max-w min-w"
|
|
14
14
|
>
|
|
15
15
|
<div
|
|
16
|
-
class="
|
|
16
|
+
class="items-center flex mr-[1em] h-[1em] min-w mt-[2px] basis-0"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
19
|
-
class="
|
|
18
|
+
<svg
|
|
19
|
+
class="PicassoSvgExclamationSolid16-root PicassoSvgExclamationSolid16-yellow"
|
|
20
|
+
style="min-width: 16px; min-height: 16px;"
|
|
21
|
+
viewBox="0 0 16 16"
|
|
20
22
|
>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</div>
|
|
23
|
+
<path
|
|
24
|
+
d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm0 11a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm0-8a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0V4a1 1 0 0 0-1-1Z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
class="m-0 text-sm text-black font-regular break-words min-w !mt-0"
|
|
30
|
+
>
|
|
31
|
+
The time zone in your profile is set to (UTC -08:00) America - Los
|
|
31
32
|
<div
|
|
32
|
-
class="
|
|
33
|
+
class="mt-2 flex"
|
|
33
34
|
>
|
|
34
|
-
|
|
35
|
-
<div
|
|
36
|
-
class="PicassoContainer-topxsmallMargin PicassoContainer-flex"
|
|
37
|
-
>
|
|
38
|
-
Test
|
|
39
|
-
</div>
|
|
35
|
+
Test
|
|
40
36
|
</div>
|
|
41
37
|
</div>
|
|
42
38
|
</div>
|
|
@@ -14,7 +14,7 @@ exports[`useNotifications error notification render 1`] = `
|
|
|
14
14
|
type="button"
|
|
15
15
|
>
|
|
16
16
|
<span
|
|
17
|
-
class="
|
|
17
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
18
18
|
>
|
|
19
19
|
Show Error
|
|
20
20
|
</span>
|
|
@@ -28,7 +28,7 @@ exports[`useNotifications error notification render 1`] = `
|
|
|
28
28
|
type="button"
|
|
29
29
|
>
|
|
30
30
|
<span
|
|
31
|
-
class="
|
|
31
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
32
32
|
>
|
|
33
33
|
Show Info
|
|
34
34
|
</span>
|
|
@@ -42,7 +42,7 @@ exports[`useNotifications error notification render 1`] = `
|
|
|
42
42
|
type="button"
|
|
43
43
|
>
|
|
44
44
|
<span
|
|
45
|
-
class="
|
|
45
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
46
46
|
>
|
|
47
47
|
Show Success
|
|
48
48
|
</span>
|
|
@@ -62,57 +62,53 @@ exports[`useNotifications error notification render 1`] = `
|
|
|
62
62
|
class="notistack-Snackbar go3963613292"
|
|
63
63
|
>
|
|
64
64
|
<div
|
|
65
|
-
class="
|
|
65
|
+
class="relative flex flex-nowrap items-start pt-[1.5em] pb-[1.5625em] pr-[2.5em] pl-[1.5em] transition-shadow duration-300 shadow-3 rounded-sm bg-red max-w w-[20em]"
|
|
66
66
|
role="alert"
|
|
67
67
|
style="webkit-transform: none; transform: none; webkit-transition: -webkit-transform 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms; transition: transform 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;"
|
|
68
68
|
>
|
|
69
69
|
<div
|
|
70
|
-
class="
|
|
70
|
+
class="flex w-full my-0 mx-auto p-0 max-w min-w"
|
|
71
71
|
>
|
|
72
72
|
<div
|
|
73
|
-
class="
|
|
73
|
+
class="items-center flex min-w mr-[1em] h-[1.5em] basis-[1.5em]"
|
|
74
74
|
>
|
|
75
|
-
<
|
|
76
|
-
class="
|
|
75
|
+
<svg
|
|
76
|
+
class="PicassoSvgExclamationSolid24-root PicassoSvgExclamationSolid24-red"
|
|
77
|
+
style="min-width: 24px; min-height: 24px;"
|
|
78
|
+
viewBox="0 0 24 24"
|
|
79
|
+
>
|
|
80
|
+
<path
|
|
81
|
+
d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0Zm0 16a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm0-10a1 1 0 0 0-1 1v7a1 1 0 0 0 2 0V7a1 1 0 0 0-1-1Z"
|
|
82
|
+
/>
|
|
83
|
+
</svg>
|
|
84
|
+
</div>
|
|
85
|
+
<div
|
|
86
|
+
class="m-0 text-md text-black font-regular break-words min-w !mt-[1px]"
|
|
87
|
+
>
|
|
88
|
+
Error message
|
|
89
|
+
</div>
|
|
90
|
+
<button
|
|
91
|
+
aria-disabled="false"
|
|
92
|
+
class="base-Button text-lg inline-flex items-center justify-center select-none appearance-none m-0 normal-case align-middle transition-colors duration-350 ease-out shrink-0 outline-none [&+&]:ml-4 cursor-pointer rounded-full w-[1.5em] text-white visited:text-white focus-visible:shadow-[0_0_0_3px_rgba(32,78,207,0.48)] absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent"
|
|
93
|
+
data-component-type="button"
|
|
94
|
+
role="button"
|
|
95
|
+
tabindex="0"
|
|
96
|
+
type="button"
|
|
97
|
+
>
|
|
98
|
+
<span
|
|
99
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
77
100
|
>
|
|
78
101
|
<svg
|
|
79
|
-
class="
|
|
80
|
-
style="min-width:
|
|
81
|
-
viewBox="0 0
|
|
102
|
+
class="PicassoSvgCloseMinor16-root text-[1.2em] flex-1 PicassoSvgCloseMinor16-darkGrey"
|
|
103
|
+
style="min-width: 16px; min-height: 16px;"
|
|
104
|
+
viewBox="0 0 16 16"
|
|
82
105
|
>
|
|
83
106
|
<path
|
|
84
|
-
d="
|
|
107
|
+
d="m8.707 8 3.5 3.5-.707.707-3.5-3.5-3.5 3.5-.707-.707 3.5-3.5-3.5-3.5.707-.707 3.5 3.5 3.5-3.5.707.707-3.5 3.5Z"
|
|
85
108
|
/>
|
|
86
109
|
</svg>
|
|
87
|
-
</
|
|
88
|
-
|
|
89
|
-
class="m-0 text-md text-black font-regular break-words min-w !mt-[1px]"
|
|
90
|
-
>
|
|
91
|
-
Error message
|
|
92
|
-
</div>
|
|
93
|
-
<button
|
|
94
|
-
aria-disabled="false"
|
|
95
|
-
class="base-Button text-lg inline-flex items-center justify-center select-none appearance-none m-0 normal-case align-middle transition-colors duration-350 ease-out shrink-0 outline-none [&+&]:ml-4 cursor-pointer rounded-full w-[1.5em] text-white visited:text-white focus-visible:shadow-[0_0_0_3px_rgba(32,78,207,0.48)] absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent"
|
|
96
|
-
data-component-type="button"
|
|
97
|
-
role="button"
|
|
98
|
-
tabindex="0"
|
|
99
|
-
type="button"
|
|
100
|
-
>
|
|
101
|
-
<span
|
|
102
|
-
class="PicassoContainer-centerAlignItems PicassoContainer-flex PicassoContainer-inline font-semibold whitespace-nowrap text-button"
|
|
103
|
-
>
|
|
104
|
-
<svg
|
|
105
|
-
class="PicassoSvgCloseMinor16-root text-[1.2em] flex-1 PicassoSvgCloseMinor16-darkGrey"
|
|
106
|
-
style="min-width: 16px; min-height: 16px;"
|
|
107
|
-
viewBox="0 0 16 16"
|
|
108
|
-
>
|
|
109
|
-
<path
|
|
110
|
-
d="m8.707 8 3.5 3.5-.707.707-3.5-3.5-3.5 3.5-.707-.707 3.5-3.5-3.5-3.5.707-.707 3.5 3.5 3.5-3.5.707.707-3.5 3.5Z"
|
|
111
|
-
/>
|
|
112
|
-
</svg>
|
|
113
|
-
</span>
|
|
114
|
-
</button>
|
|
115
|
-
</div>
|
|
110
|
+
</span>
|
|
111
|
+
</button>
|
|
116
112
|
</div>
|
|
117
113
|
</div>
|
|
118
114
|
</div>
|
|
@@ -137,7 +133,7 @@ exports[`useNotifications info notification render 1`] = `
|
|
|
137
133
|
type="button"
|
|
138
134
|
>
|
|
139
135
|
<span
|
|
140
|
-
class="
|
|
136
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
141
137
|
>
|
|
142
138
|
Show Error
|
|
143
139
|
</span>
|
|
@@ -151,7 +147,7 @@ exports[`useNotifications info notification render 1`] = `
|
|
|
151
147
|
type="button"
|
|
152
148
|
>
|
|
153
149
|
<span
|
|
154
|
-
class="
|
|
150
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
155
151
|
>
|
|
156
152
|
Show Info
|
|
157
153
|
</span>
|
|
@@ -165,7 +161,7 @@ exports[`useNotifications info notification render 1`] = `
|
|
|
165
161
|
type="button"
|
|
166
162
|
>
|
|
167
163
|
<span
|
|
168
|
-
class="
|
|
164
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
169
165
|
>
|
|
170
166
|
Show Success
|
|
171
167
|
</span>
|
|
@@ -185,60 +181,56 @@ exports[`useNotifications info notification render 1`] = `
|
|
|
185
181
|
class="notistack-Snackbar go3963613292"
|
|
186
182
|
>
|
|
187
183
|
<div
|
|
188
|
-
class="
|
|
184
|
+
class="relative flex flex-nowrap items-start transition-shadow duration-300 shadow-3 rounded-sm bg-white px-[1.5em] pt-[1.5625em] pb-[1.5em] max-w w-[27.5em]"
|
|
189
185
|
role="alert"
|
|
190
186
|
style="webkit-transform: none; transform: none; webkit-transition: -webkit-transform 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms; transition: transform 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;"
|
|
191
187
|
>
|
|
192
188
|
<div
|
|
193
|
-
class="
|
|
189
|
+
class="flex w-full my-0 mx-auto p-0 max-w min-w"
|
|
194
190
|
>
|
|
195
191
|
<div
|
|
196
|
-
class="
|
|
192
|
+
class="items-center flex min-w mr-[1em] h-[1.5em] basis-[1.5em]"
|
|
193
|
+
>
|
|
194
|
+
<svg
|
|
195
|
+
class="PicassoSvgInfo24-root PicassoSvgInfo24-grey"
|
|
196
|
+
fill="none"
|
|
197
|
+
style="min-width: 24px; min-height: 24px;"
|
|
198
|
+
viewBox="0 0 24 24"
|
|
199
|
+
>
|
|
200
|
+
<path
|
|
201
|
+
clip-rule="evenodd"
|
|
202
|
+
d="M11.5 22C17.299 22 22 17.299 22 11.5S17.299 1 11.5 1 1 5.701 1 11.5 5.701 22 11.5 22Zm0-1a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM12 9v7h1v1h-3v-1h1v-6h-1V9h2Zm0-2V6h-1v1h1Z"
|
|
203
|
+
fill-rule="evenodd"
|
|
204
|
+
/>
|
|
205
|
+
</svg>
|
|
206
|
+
</div>
|
|
207
|
+
<div
|
|
208
|
+
class="m-0 text-md text-black font-regular break-words min-w !mt-[1px]"
|
|
209
|
+
>
|
|
210
|
+
Info message
|
|
211
|
+
</div>
|
|
212
|
+
<button
|
|
213
|
+
aria-disabled="false"
|
|
214
|
+
class="base-Button text-lg inline-flex items-center justify-center select-none appearance-none m-0 normal-case align-middle transition-colors duration-350 ease-out shrink-0 outline-none [&+&]:ml-4 cursor-pointer rounded-full w-[1.5em] text-white visited:text-white focus-visible:shadow-[0_0_0_3px_rgba(32,78,207,0.48)] absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent"
|
|
215
|
+
data-component-type="button"
|
|
216
|
+
role="button"
|
|
217
|
+
tabindex="0"
|
|
218
|
+
type="button"
|
|
197
219
|
>
|
|
198
|
-
<
|
|
199
|
-
class="
|
|
220
|
+
<span
|
|
221
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
200
222
|
>
|
|
201
223
|
<svg
|
|
202
|
-
class="
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
viewBox="0 0 24 24"
|
|
224
|
+
class="PicassoSvgCloseMinor16-root text-[1.2em] flex-1 PicassoSvgCloseMinor16-darkGrey"
|
|
225
|
+
style="min-width: 16px; min-height: 16px;"
|
|
226
|
+
viewBox="0 0 16 16"
|
|
206
227
|
>
|
|
207
228
|
<path
|
|
208
|
-
|
|
209
|
-
d="M11.5 22C17.299 22 22 17.299 22 11.5S17.299 1 11.5 1 1 5.701 1 11.5 5.701 22 11.5 22Zm0-1a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM12 9v7h1v1h-3v-1h1v-6h-1V9h2Zm0-2V6h-1v1h1Z"
|
|
210
|
-
fill-rule="evenodd"
|
|
229
|
+
d="m8.707 8 3.5 3.5-.707.707-3.5-3.5-3.5 3.5-.707-.707 3.5-3.5-3.5-3.5.707-.707 3.5 3.5 3.5-3.5.707.707-3.5 3.5Z"
|
|
211
230
|
/>
|
|
212
231
|
</svg>
|
|
213
|
-
</
|
|
214
|
-
|
|
215
|
-
class="m-0 text-md text-black font-regular break-words min-w !mt-[1px]"
|
|
216
|
-
>
|
|
217
|
-
Info message
|
|
218
|
-
</div>
|
|
219
|
-
<button
|
|
220
|
-
aria-disabled="false"
|
|
221
|
-
class="base-Button text-lg inline-flex items-center justify-center select-none appearance-none m-0 normal-case align-middle transition-colors duration-350 ease-out shrink-0 outline-none [&+&]:ml-4 cursor-pointer rounded-full w-[1.5em] text-white visited:text-white focus-visible:shadow-[0_0_0_3px_rgba(32,78,207,0.48)] absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent"
|
|
222
|
-
data-component-type="button"
|
|
223
|
-
role="button"
|
|
224
|
-
tabindex="0"
|
|
225
|
-
type="button"
|
|
226
|
-
>
|
|
227
|
-
<span
|
|
228
|
-
class="PicassoContainer-centerAlignItems PicassoContainer-flex PicassoContainer-inline font-semibold whitespace-nowrap text-button"
|
|
229
|
-
>
|
|
230
|
-
<svg
|
|
231
|
-
class="PicassoSvgCloseMinor16-root text-[1.2em] flex-1 PicassoSvgCloseMinor16-darkGrey"
|
|
232
|
-
style="min-width: 16px; min-height: 16px;"
|
|
233
|
-
viewBox="0 0 16 16"
|
|
234
|
-
>
|
|
235
|
-
<path
|
|
236
|
-
d="m8.707 8 3.5 3.5-.707.707-3.5-3.5-3.5 3.5-.707-.707 3.5-3.5-3.5-3.5.707-.707 3.5 3.5 3.5-3.5.707.707-3.5 3.5Z"
|
|
237
|
-
/>
|
|
238
|
-
</svg>
|
|
239
|
-
</span>
|
|
240
|
-
</button>
|
|
241
|
-
</div>
|
|
232
|
+
</span>
|
|
233
|
+
</button>
|
|
242
234
|
</div>
|
|
243
235
|
</div>
|
|
244
236
|
</div>
|
|
@@ -263,7 +255,7 @@ exports[`useNotifications success notification render 1`] = `
|
|
|
263
255
|
type="button"
|
|
264
256
|
>
|
|
265
257
|
<span
|
|
266
|
-
class="
|
|
258
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
267
259
|
>
|
|
268
260
|
Show Error
|
|
269
261
|
</span>
|
|
@@ -277,7 +269,7 @@ exports[`useNotifications success notification render 1`] = `
|
|
|
277
269
|
type="button"
|
|
278
270
|
>
|
|
279
271
|
<span
|
|
280
|
-
class="
|
|
272
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
281
273
|
>
|
|
282
274
|
Show Info
|
|
283
275
|
</span>
|
|
@@ -291,7 +283,7 @@ exports[`useNotifications success notification render 1`] = `
|
|
|
291
283
|
type="button"
|
|
292
284
|
>
|
|
293
285
|
<span
|
|
294
|
-
class="
|
|
286
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
295
287
|
>
|
|
296
288
|
Show Success
|
|
297
289
|
</span>
|
|
@@ -311,57 +303,53 @@ exports[`useNotifications success notification render 1`] = `
|
|
|
311
303
|
class="notistack-Snackbar go3963613292"
|
|
312
304
|
>
|
|
313
305
|
<div
|
|
314
|
-
class="
|
|
306
|
+
class="relative flex flex-nowrap items-start pt-[1.5em] pb-[1.5625em] pr-[2.5em] pl-[1.5em] transition-shadow duration-300 shadow-3 rounded-sm bg-green max-w w-[20em]"
|
|
315
307
|
role="alert"
|
|
316
308
|
style="webkit-transform: none; transform: none; webkit-transition: -webkit-transform 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms; transition: transform 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;"
|
|
317
309
|
>
|
|
318
310
|
<div
|
|
319
|
-
class="
|
|
311
|
+
class="flex w-full my-0 mx-auto p-0 max-w min-w"
|
|
320
312
|
>
|
|
321
313
|
<div
|
|
322
|
-
class="
|
|
314
|
+
class="items-center flex min-w mr-[1em] h-[1.5em] basis-[1.5em]"
|
|
323
315
|
>
|
|
324
|
-
<
|
|
325
|
-
class="
|
|
316
|
+
<svg
|
|
317
|
+
class="PicassoSvgCheckSolid24-root PicassoSvgCheckSolid24-green"
|
|
318
|
+
style="min-width: 24px; min-height: 24px;"
|
|
319
|
+
viewBox="0 0 24 24"
|
|
320
|
+
>
|
|
321
|
+
<path
|
|
322
|
+
d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0Zm4.034 7.667-5.895 5.91-1.933-1.942-1.373 1.379 1.934 1.942 1.372 1.377 7.267-7.289-1.372-1.377Z"
|
|
323
|
+
/>
|
|
324
|
+
</svg>
|
|
325
|
+
</div>
|
|
326
|
+
<div
|
|
327
|
+
class="m-0 text-md text-black font-regular break-words min-w !mt-[1px]"
|
|
328
|
+
>
|
|
329
|
+
Success message
|
|
330
|
+
</div>
|
|
331
|
+
<button
|
|
332
|
+
aria-disabled="false"
|
|
333
|
+
class="base-Button text-lg inline-flex items-center justify-center select-none appearance-none m-0 normal-case align-middle transition-colors duration-350 ease-out shrink-0 outline-none [&+&]:ml-4 cursor-pointer rounded-full w-[1.5em] text-white visited:text-white focus-visible:shadow-[0_0_0_3px_rgba(32,78,207,0.48)] absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent"
|
|
334
|
+
data-component-type="button"
|
|
335
|
+
role="button"
|
|
336
|
+
tabindex="0"
|
|
337
|
+
type="button"
|
|
338
|
+
>
|
|
339
|
+
<span
|
|
340
|
+
class="items-center inline-flex font-semibold whitespace-nowrap text-button"
|
|
326
341
|
>
|
|
327
342
|
<svg
|
|
328
|
-
class="
|
|
329
|
-
style="min-width:
|
|
330
|
-
viewBox="0 0
|
|
343
|
+
class="PicassoSvgCloseMinor16-root text-[1.2em] flex-1 PicassoSvgCloseMinor16-darkGrey"
|
|
344
|
+
style="min-width: 16px; min-height: 16px;"
|
|
345
|
+
viewBox="0 0 16 16"
|
|
331
346
|
>
|
|
332
347
|
<path
|
|
333
|
-
d="
|
|
348
|
+
d="m8.707 8 3.5 3.5-.707.707-3.5-3.5-3.5 3.5-.707-.707 3.5-3.5-3.5-3.5.707-.707 3.5 3.5 3.5-3.5.707.707-3.5 3.5Z"
|
|
334
349
|
/>
|
|
335
350
|
</svg>
|
|
336
|
-
</
|
|
337
|
-
|
|
338
|
-
class="m-0 text-md text-black font-regular break-words min-w !mt-[1px]"
|
|
339
|
-
>
|
|
340
|
-
Success message
|
|
341
|
-
</div>
|
|
342
|
-
<button
|
|
343
|
-
aria-disabled="false"
|
|
344
|
-
class="base-Button text-lg inline-flex items-center justify-center select-none appearance-none m-0 normal-case align-middle transition-colors duration-350 ease-out shrink-0 outline-none [&+&]:ml-4 cursor-pointer rounded-full w-[1.5em] text-white visited:text-white focus-visible:shadow-[0_0_0_3px_rgba(32,78,207,0.48)] absolute right-[0.5em] top-[0.75em] bg-transparent border-none p-0 h-[1em] hover:bg-transparent active:bg-transparent"
|
|
345
|
-
data-component-type="button"
|
|
346
|
-
role="button"
|
|
347
|
-
tabindex="0"
|
|
348
|
-
type="button"
|
|
349
|
-
>
|
|
350
|
-
<span
|
|
351
|
-
class="PicassoContainer-centerAlignItems PicassoContainer-flex PicassoContainer-inline font-semibold whitespace-nowrap text-button"
|
|
352
|
-
>
|
|
353
|
-
<svg
|
|
354
|
-
class="PicassoSvgCloseMinor16-root text-[1.2em] flex-1 PicassoSvgCloseMinor16-darkGrey"
|
|
355
|
-
style="min-width: 16px; min-height: 16px;"
|
|
356
|
-
viewBox="0 0 16 16"
|
|
357
|
-
>
|
|
358
|
-
<path
|
|
359
|
-
d="m8.707 8 3.5 3.5-.707.707-3.5-3.5-3.5 3.5-.707-.707 3.5-3.5-3.5-3.5.707-.707 3.5 3.5 3.5-3.5.707.707-3.5 3.5Z"
|
|
360
|
-
/>
|
|
361
|
-
</svg>
|
|
362
|
-
</span>
|
|
363
|
-
</button>
|
|
364
|
-
</div>
|
|
351
|
+
</span>
|
|
352
|
+
</button>
|
|
365
353
|
</div>
|
|
366
354
|
</div>
|
|
367
355
|
</div>
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type { ReactNode, ReactElement } from 'react'
|
|
2
2
|
import React, { forwardRef, useMemo, useCallback } from 'react'
|
|
3
|
-
import
|
|
3
|
+
import { twJoin } from '@toptal/picasso-tailwind-merge'
|
|
4
4
|
import type { OptionsObject } from 'notistack'
|
|
5
5
|
import { useSnackbar } from 'notistack'
|
|
6
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
7
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
8
6
|
import type { SnackbarOrigin } from '@material-ui/core/Snackbar'
|
|
9
7
|
import type { BaseProps } from '@toptal/picasso-shared'
|
|
10
8
|
|
|
11
9
|
import type { VariantType } from '../Notification'
|
|
12
10
|
import { Notification as PicassoNotification } from '../Notification'
|
|
13
|
-
import styles from './styles'
|
|
14
11
|
|
|
15
12
|
const defaultPosition: SnackbarOrigin = {
|
|
16
13
|
vertical: 'top',
|
|
@@ -25,15 +22,10 @@ interface Props extends BaseProps {
|
|
|
25
22
|
variant?: VariantType
|
|
26
23
|
}
|
|
27
24
|
|
|
28
|
-
const useStyles = makeStyles<Theme>(styles, {
|
|
29
|
-
name: 'PicassoNotification',
|
|
30
|
-
})
|
|
31
|
-
|
|
32
25
|
const StyledNotification =
|
|
33
26
|
// eslint-disable-next-line react/display-name
|
|
34
|
-
forwardRef<
|
|
27
|
+
forwardRef<HTMLDivElement, Props>(function Notification(props, ref) {
|
|
35
28
|
const { content, icon, key, onClose, variant = 'white' } = props
|
|
36
|
-
const classes = useStyles()
|
|
37
29
|
|
|
38
30
|
return (
|
|
39
31
|
<PicassoNotification
|
|
@@ -42,10 +34,10 @@ const StyledNotification =
|
|
|
42
34
|
icon={icon}
|
|
43
35
|
key={key}
|
|
44
36
|
onClose={onClose}
|
|
45
|
-
className={
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
className={twJoin(
|
|
38
|
+
'max-w-full',
|
|
39
|
+
variant === 'white' ? 'w-[27.5em]' : `w-[20em]`
|
|
40
|
+
)}
|
|
49
41
|
ref={ref}
|
|
50
42
|
>
|
|
51
43
|
{content}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Theme } from '@material-ui/core/styles';
|
|
2
|
-
declare const _default: ({ palette: { red, green, yellow, common }, shadows, breakpoints: { down }, sizes: { borderRadius }, }: Theme) => import("@material-ui/styles").StyleRules<{}, "notification" | "notificationShadow" | "roundedBorders" | "notificationRed" | "notificationGreen" | "notificationWhite" | "notificationYellow" | "iconWrapper" | "iconWrapperYellow">;
|
|
3
|
-
export default _default;
|
|
4
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Notification/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;gIAgClD,KAAK;AALR,wBAyDI"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createStyles } from '@material-ui/core/styles';
|
|
2
|
-
import { breakpointsList as breakpoints, PicassoProvider, } from '@toptal/picasso-provider';
|
|
3
|
-
import { rem } from '@toptal/picasso-shared';
|
|
4
|
-
PicassoProvider.override(({ layout, breakpoints: { down } }) => ({
|
|
5
|
-
MuiSnackbarContent: {
|
|
6
|
-
message: {
|
|
7
|
-
display: 'flex',
|
|
8
|
-
maxWidth: layout.contentWidth,
|
|
9
|
-
padding: 0,
|
|
10
|
-
width: '100%',
|
|
11
|
-
minWidth: 0,
|
|
12
|
-
margin: '0 auto',
|
|
13
|
-
[down(breakpoints.xl)]: {
|
|
14
|
-
maxWidth: 'unset',
|
|
15
|
-
},
|
|
16
|
-
'& > div': {
|
|
17
|
-
width: '100%',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
}));
|
|
22
|
-
export default ({ palette: { red, green, yellow, common }, shadows, breakpoints: { down }, sizes: { borderRadius }, }) => createStyles({
|
|
23
|
-
notification: {
|
|
24
|
-
alignItems: 'start',
|
|
25
|
-
borderRadius: 0,
|
|
26
|
-
flexWrap: 'nowrap',
|
|
27
|
-
maxWidth: 'initial',
|
|
28
|
-
position: 'relative',
|
|
29
|
-
width: '100%',
|
|
30
|
-
boxShadow: 'none',
|
|
31
|
-
padding: '1.5em 2.5em 1.5625em 1.5em',
|
|
32
|
-
},
|
|
33
|
-
notificationShadow: {
|
|
34
|
-
boxShadow: shadows[3],
|
|
35
|
-
},
|
|
36
|
-
roundedBorders: {
|
|
37
|
-
borderRadius: borderRadius.small,
|
|
38
|
-
},
|
|
39
|
-
notificationRed: {
|
|
40
|
-
background: red.lighter,
|
|
41
|
-
},
|
|
42
|
-
notificationGreen: {
|
|
43
|
-
background: green.lighter,
|
|
44
|
-
},
|
|
45
|
-
notificationWhite: {
|
|
46
|
-
background: common.white,
|
|
47
|
-
padding: '1.5625em 1.5em 1.5em',
|
|
48
|
-
},
|
|
49
|
-
notificationYellow: {
|
|
50
|
-
background: yellow.lighter,
|
|
51
|
-
padding: `1.5em ${rem('130px')}`,
|
|
52
|
-
[down(breakpoints.lg)]: {
|
|
53
|
-
padding: '1.5em',
|
|
54
|
-
},
|
|
55
|
-
[down(breakpoints.sm)]: {
|
|
56
|
-
padding: '1.5em 1em',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
// Content Icon
|
|
60
|
-
iconWrapper: {
|
|
61
|
-
flexBasis: '1.5em',
|
|
62
|
-
marginRight: '1em',
|
|
63
|
-
minWidth: '1.5em',
|
|
64
|
-
height: '1.5em',
|
|
65
|
-
},
|
|
66
|
-
iconWrapperYellow: {
|
|
67
|
-
flexBasis: 'unset',
|
|
68
|
-
minWidth: '1em',
|
|
69
|
-
height: '1em',
|
|
70
|
-
marginTop: '2px',
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/Notification/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EACL,eAAe,IAAI,WAAW,EAC9B,eAAe,GAChB,MAAM,0BAA0B,CA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,UAAU,EAAE,MAAM,CAAC,KAAK;QACxB,OAAO,EAAE,sBAAsB;KAChC;IACD,kBAAkB,EAAE;QAClB,UAAU,EAAE,MAAM,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE;QAChC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE;YACtB,OAAO,EAAE,OAAO;SACjB;QACD,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE;YACtB,OAAO,EAAE,WAAW;SACrB;KACF;IAED,eAAe;IACf,WAAW,EAAE;QACX,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,OAAO;KAChB;IACD,iBAAiB,EAAE;QACjB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,KAAK;KACjB;CACF,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/NotificationActions/styles.ts"],"names":[],"mappings":";AAAA,wBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/NotificationActions/styles.ts"],"names":[],"mappings":"AAAA,eAAe,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/use-notification/styles.ts"],"names":[],"mappings":";AAEA,wBAUI"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createStyles } from '@material-ui/core/styles';
|
|
2
|
-
export default () => createStyles({
|
|
3
|
-
formNotification: {
|
|
4
|
-
width: '20em',
|
|
5
|
-
maxWidth: '100%',
|
|
6
|
-
},
|
|
7
|
-
generalNotification: {
|
|
8
|
-
width: '27.5em',
|
|
9
|
-
maxWidth: '100%',
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/use-notification/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,GAAG,EAAE,CAClB,YAAY,CAAC;IACX,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,MAAM;KACjB;IACD,mBAAmB,EAAE;QACnB,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,MAAM;KACjB;CACF,CAAC,CAAA"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
2
|
-
import { createStyles } from '@material-ui/core/styles'
|
|
3
|
-
import {
|
|
4
|
-
breakpointsList as breakpoints,
|
|
5
|
-
PicassoProvider,
|
|
6
|
-
} from '@toptal/picasso-provider'
|
|
7
|
-
import { rem } from '@toptal/picasso-shared'
|
|
8
|
-
|
|
9
|
-
PicassoProvider.override(({ layout, breakpoints: { down } }: Theme) => ({
|
|
10
|
-
MuiSnackbarContent: {
|
|
11
|
-
message: {
|
|
12
|
-
display: 'flex',
|
|
13
|
-
maxWidth: layout.contentWidth,
|
|
14
|
-
padding: 0,
|
|
15
|
-
width: '100%',
|
|
16
|
-
minWidth: 0,
|
|
17
|
-
margin: '0 auto',
|
|
18
|
-
[down(breakpoints.xl)]: {
|
|
19
|
-
maxWidth: 'unset',
|
|
20
|
-
},
|
|
21
|
-
'& > div': {
|
|
22
|
-
width: '100%',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
}))
|
|
27
|
-
|
|
28
|
-
export default ({
|
|
29
|
-
palette: { red, green, yellow, common },
|
|
30
|
-
shadows,
|
|
31
|
-
breakpoints: { down },
|
|
32
|
-
sizes: { borderRadius },
|
|
33
|
-
}: Theme) =>
|
|
34
|
-
createStyles({
|
|
35
|
-
notification: {
|
|
36
|
-
alignItems: 'start',
|
|
37
|
-
borderRadius: 0,
|
|
38
|
-
flexWrap: 'nowrap',
|
|
39
|
-
maxWidth: 'initial',
|
|
40
|
-
position: 'relative',
|
|
41
|
-
width: '100%',
|
|
42
|
-
boxShadow: 'none',
|
|
43
|
-
padding: '1.5em 2.5em 1.5625em 1.5em',
|
|
44
|
-
},
|
|
45
|
-
notificationShadow: {
|
|
46
|
-
boxShadow: shadows[3],
|
|
47
|
-
},
|
|
48
|
-
roundedBorders: {
|
|
49
|
-
borderRadius: borderRadius.small,
|
|
50
|
-
},
|
|
51
|
-
notificationRed: {
|
|
52
|
-
background: red.lighter,
|
|
53
|
-
},
|
|
54
|
-
notificationGreen: {
|
|
55
|
-
background: green.lighter,
|
|
56
|
-
},
|
|
57
|
-
notificationWhite: {
|
|
58
|
-
background: common.white,
|
|
59
|
-
padding: '1.5625em 1.5em 1.5em',
|
|
60
|
-
},
|
|
61
|
-
notificationYellow: {
|
|
62
|
-
background: yellow.lighter,
|
|
63
|
-
padding: `1.5em ${rem('130px')}`,
|
|
64
|
-
[down(breakpoints.lg)]: {
|
|
65
|
-
padding: '1.5em',
|
|
66
|
-
},
|
|
67
|
-
[down(breakpoints.sm)]: {
|
|
68
|
-
padding: '1.5em 1em',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
// Content Icon
|
|
73
|
-
iconWrapper: {
|
|
74
|
-
flexBasis: '1.5em',
|
|
75
|
-
marginRight: '1em',
|
|
76
|
-
minWidth: '1.5em',
|
|
77
|
-
height: '1.5em',
|
|
78
|
-
},
|
|
79
|
-
iconWrapperYellow: {
|
|
80
|
-
flexBasis: 'unset',
|
|
81
|
-
minWidth: '1em',
|
|
82
|
-
height: '1em',
|
|
83
|
-
marginTop: '2px',
|
|
84
|
-
},
|
|
85
|
-
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default () => ({})
|