@corva/ui 0.75.0-rc.0 → 0.76.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),s=require("react/jsx-runtime"),t=require("react"),i=require("classnames"),a=require("lodash"),n=require("@material-ui/core"),o=require("../IconButton/index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),s=require("react/jsx-runtime"),t=require("react"),i=require("classnames"),a=require("lodash"),n=require("@material-ui/core"),o=require("../IconButton/index.js"),l=require("../../constants/notifications.js"),r=require("./Toast.styles.js"),c=require("../../icons/index.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d,I=u(i),_=((d={})[l.NOTIFICATION_VARIANTS.success]=c.CheckOneIcon,d[l.NOTIFICATION_VARIANTS.warning]=c.CautionIcon,d[l.NOTIFICATION_VARIANTS.error]=c.AttentionIcon,d[l.NOTIFICATION_VARIANTS.info]=c.InfoIcon,d[l.NOTIFICATION_VARIANTS.neutral]=c.PuzzleIcon,d);exports.Toast=function(i){var u,d=i.onDismissClick,m=i.toast,f=e.__rest(i,["onDismissClick","toast"]),p=m.alertLevel,N=m.autoHideDuration,T=void 0===N?3e3:N,g=m.content,C=m.hideIcon,j=m.icon,A=m.id,v=m.onClick,x=void 0===v?a.noop:v,h=m.onClose,O=void 0===h?a.noop:h,b=m.timestamp,y=m.title,q=m.tooltipProps,S=m.variant,k=void 0===S?"info":S;t.useEffect((function(){if(T!==1/0){var e=setTimeout((function(){return d(A)}),T);return function(){return clearTimeout(e)}}}),[]);var F=r.useStyles(),R=_[k];return s.jsx(n.Grow,e.__assign({appear:!0,in:!0},{children:s.jsx(n.SnackbarContent,e.__assign({classes:{root:I.default(F.main,!p&&F[k],p&&F.alertNotification,p&&F["alertLevels-".concat(p)]),action:F.actionContainer,message:F.messageContainer},"aria-describedby":"client-snackbar","data-testid":"notificationPopup_".concat(l.NOTIFICATION_VARIANTS[k]),message:s.jsx(n.Tooltip,e.__assign({},q,{title:g,classes:{tooltip:F.tooltip},placement:"bottom"},{children:s.jsxs("div",e.__assign({id:"client-snackbar",className:F.messageWrapper,onClick:x},{children:[!C&&s.jsx("div",e.__assign({className:F.iconWrapper},{children:j?t.cloneElement(j,{className:F.icon,nativeColor:"#fff"}):s.jsx(R,{fill:k===l.NOTIFICATION_VARIANTS.warning?"#000":"#fff",size:16,className:F.icon})})),s.jsxs("div",e.__assign({className:F.message},{children:[s.jsxs("div",e.__assign({className:F.messageTop},{children:[y&&s.jsx(n.Typography,e.__assign({"data-testid":"title",variant:"subtitle2",className:I.default(F.title,(u={},u[F.alertTitle]=p,u))},{children:y})),b&&s.jsx(n.Typography,e.__assign({className:I.default(F.timestamp,!p&&F[k])},{children:b}))]})),s.jsx("div",e.__assign({className:I.default(F.messageContent,!p&&F[k])},{children:s.jsx(n.Typography,e.__assign({"data-testid":"content",className:I.default(p?F.alertContent:F.content)},{children:g}))}))]}))]}))})),action:[s.jsx(o,e.__assign({"data-testid":"closeButton","aria-label":"Close",color:"inherit",onClick:function(){O(),d(A)},size:"small",tooltipProps:{title:"Close",classes:{tooltip:F.tooltip}},className:F.closeIconButton},{children:s.jsx(c.CloseSmallIcon,{size:24,fill:p?"#000":"#fff"})}),"close")]},f))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/Toast.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/Toast.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoBvC,UAAU,UAAU;IAClB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,wCAAyC,UAAU,KAAG,WA4HvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as t,__assign as i}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useEffect as
|
|
1
|
+
import{__rest as t,__assign as i}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useEffect as s,cloneElement as a}from"react";import n from"classnames";import{noop as r}from"lodash";import{Grow as l,SnackbarContent as c,Tooltip as m,Typography as d}from"@material-ui/core";import f from"../IconButton/index.js";import{NOTIFICATION_VARIANTS as p}from"../../constants/notifications.js";import{useStyles as u}from"./Toast.styles.js";import{CheckOneIcon as v,CautionIcon as h,AttentionIcon as C,InfoIcon as N,PuzzleIcon as b,CloseSmallIcon as g}from"../../icons/index.js";var k,j=((k={})[p.success]=v,k[p.warning]=h,k[p.error]=C,k[p.info]=N,k[p.neutral]=b,k),T=function(v){var h,C=v.onDismissClick,N=v.toast,b=t(v,["onDismissClick","toast"]),k=N.alertLevel,T=N.autoHideDuration,x=void 0===T?3e3:T,z=N.content,B=N.hideIcon,D=N.icon,I=N.id,P=N.onClick,w=void 0===P?r:P,y=N.onClose,L=void 0===y?r:y,W=N.timestamp,_=N.title,H=N.tooltipProps,q=N.variant,A=void 0===q?"info":q;s((function(){if(x!==1/0){var t=setTimeout((function(){return C(I)}),x);return function(){return clearTimeout(t)}}}),[]);var E=u(),F=j[A];return e(l,i({appear:!0,in:!0},{children:e(c,i({classes:{root:n(E.main,!k&&E[A],k&&E.alertNotification,k&&E["alertLevels-".concat(k)]),action:E.actionContainer,message:E.messageContainer},"aria-describedby":"client-snackbar","data-testid":"notificationPopup_".concat(p[A]),message:e(m,i({},H,{title:z,classes:{tooltip:E.tooltip},placement:"bottom"},{children:o("div",i({id:"client-snackbar",className:E.messageWrapper,onClick:w},{children:[!B&&e("div",i({className:E.iconWrapper},{children:D?a(D,{className:E.icon,nativeColor:"#fff"}):e(F,{fill:A===p.warning?"#000":"#fff",size:16,className:E.icon})})),o("div",i({className:E.message},{children:[o("div",i({className:E.messageTop},{children:[_&&e(d,i({"data-testid":"title",variant:"subtitle2",className:n(E.title,(h={},h[E.alertTitle]=k,h))},{children:_})),W&&e(d,i({className:n(E.timestamp,!k&&E[A])},{children:W}))]})),e("div",i({className:n(E.messageContent,!k&&E[A])},{children:e(d,i({"data-testid":"content",className:n(k?E.alertContent:E.content)},{children:z}))}))]}))]}))})),action:[e(f,i({"data-testid":"closeButton","aria-label":"Close",color:"inherit",onClick:function(){L(),C(I)},size:"small",tooltipProps:{title:"Close",classes:{tooltip:E.tooltip}},className:E.closeIconButton},{children:e(g,{size:24,fill:k?"#000":"#fff"})}),"close")]},b))}))};export{T as Toast};
|