@corva/ui 0.75.0-6 → 0.75.0-7

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"),c=require("../../constants/notifications.js"),r=require("./Toast.styles.js"),l=require("../../icons/index.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d,_=u(i),I="NotificationPopup",m=((d={})[c.NOTIFICATION_VARIANTS.success]=l.CheckOneIcon,d[c.NOTIFICATION_VARIANTS.warning]=l.CautionIcon,d[c.NOTIFICATION_VARIANTS.error]=l.AttentionIcon,d[c.NOTIFICATION_VARIANTS.info]=l.InfoIcon,d[c.NOTIFICATION_VARIANTS.neutral]=l.PuzzleIcon,d);exports.PAGE_NAME=I,exports.Toast=function(i){var u,d=i.onDismissClick,p=i.toast,N=e.__rest(i,["onDismissClick","toast"]),f=p.alertLevel,T=p.autoHideDuration,g=void 0===T?3e3:T,A=p.content,C=p.hideIcon,j=p.icon,v=p.id,x=p.onClick,h=void 0===x?a.noop:x,O=p.onClose,b=void 0===O?a.noop:O,y=p.timestamp,k=p.title,q=p.tooltipProps,S=p.variant,F=void 0===S?"info":S;t.useEffect((function(){var e=setTimeout((function(){return d(v)}),g);return function(){return clearTimeout(e)}}),[]);var P=r.useStyles(),R=m[F];return s.jsx(n.Grow,e.__assign({appear:!0,in:!0},{children:s.jsx(n.SnackbarContent,e.__assign({classes:{root:_.default(P.main,!f&&P[F],f&&P.alertNotification,f&&P["alertLevels-".concat(f)]),action:P.actionContainer,message:P.messageContainer},"aria-describedby":"client-snackbar",message:s.jsx(n.Tooltip,e.__assign({},q,{title:A,classes:{tooltip:P.tooltip},placement:"bottom"},{children:s.jsxs("div",e.__assign({id:"client-snackbar",className:P.messageWrapper,onClick:h,"data-testid":"".concat(I,"_status_").concat(c.NOTIFICATION_VARIANTS[F])},{children:[!C&&s.jsx("div",e.__assign({className:P.iconWrapper},{children:j?t.cloneElement(j,{className:P.icon,nativeColor:"#fff"}):s.jsx(R,{fill:F===c.NOTIFICATION_VARIANTS.warning?"#000":"#fff",size:16,className:P.icon})})),s.jsxs("div",e.__assign({className:P.message},{children:[s.jsxs("div",e.__assign({className:P.messageTop},{children:[k&&s.jsx(n.Typography,e.__assign({"data-testid":"".concat(I,"_title"),variant:"subtitle2",className:_.default(P.title,(u={},u[P.alertTitle]=f,u))},{children:k})),y&&s.jsx(n.Typography,e.__assign({className:_.default(P.timestamp,!f&&P[F])},{children:y}))]})),s.jsx("div",e.__assign({className:_.default(P.messageContent,!f&&P[F])},{children:s.jsx(n.Typography,e.__assign({"data-testid":"".concat(I,"_content"),className:_.default(f?P.alertContent:P.content)},{children:A}))}))]}))]}))})),action:[s.jsx(o,e.__assign({"data-testid":"".concat(I,"_closeButton"),"aria-label":"Close",color:"inherit",onClick:function(){b(),d(v)},size:"small",iconType:"iconPark",tooltipProps:{title:"Close",classes:{tooltip:P.tooltip}},className:P.closeIconButton},{children:s.jsx(l.CloseSmallIcon,{size:24,fill:f?"#000":"#fff"})}),"close")]},N))}))};
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"),c=require("../../constants/notifications.js"),r=require("./Toast.styles.js"),l=require("../../icons/index.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d,_=u(i),I="NotificationPopup",m=((d={})[c.NOTIFICATION_VARIANTS.success]=l.CheckOneIcon,d[c.NOTIFICATION_VARIANTS.warning]=l.CautionIcon,d[c.NOTIFICATION_VARIANTS.error]=l.AttentionIcon,d[c.NOTIFICATION_VARIANTS.info]=l.InfoIcon,d[c.NOTIFICATION_VARIANTS.neutral]=l.PuzzleIcon,d);exports.PAGE_NAME=I,exports.Toast=function(i){var u,d=i.onDismissClick,f=i.toast,p=e.__rest(i,["onDismissClick","toast"]),N=f.alertLevel,T=f.autoHideDuration,g=void 0===T?3e3:T,A=f.content,C=f.hideIcon,j=f.icon,v=f.id,x=f.onClick,h=void 0===x?a.noop:x,O=f.onClose,b=void 0===O?a.noop:O,y=f.timestamp,k=f.title,q=f.tooltipProps,S=f.variant,F=void 0===S?"info":S;t.useEffect((function(){if(g!==1/0){var e=setTimeout((function(){return d(v)}),g);return function(){return clearTimeout(e)}}}),[]);var P=r.useStyles(),R=m[F];return s.jsx(n.Grow,e.__assign({appear:!0,in:!0},{children:s.jsx(n.SnackbarContent,e.__assign({classes:{root:_.default(P.main,!N&&P[F],N&&P.alertNotification,N&&P["alertLevels-".concat(N)]),action:P.actionContainer,message:P.messageContainer},"aria-describedby":"client-snackbar",message:s.jsx(n.Tooltip,e.__assign({},q,{title:A,classes:{tooltip:P.tooltip},placement:"bottom"},{children:s.jsxs("div",e.__assign({id:"client-snackbar",className:P.messageWrapper,onClick:h,"data-testid":"".concat(I,"_status_").concat(c.NOTIFICATION_VARIANTS[F])},{children:[!C&&s.jsx("div",e.__assign({className:P.iconWrapper},{children:j?t.cloneElement(j,{className:P.icon,nativeColor:"#fff"}):s.jsx(R,{fill:F===c.NOTIFICATION_VARIANTS.warning?"#000":"#fff",size:16,className:P.icon})})),s.jsxs("div",e.__assign({className:P.message},{children:[s.jsxs("div",e.__assign({className:P.messageTop},{children:[k&&s.jsx(n.Typography,e.__assign({"data-testid":"".concat(I,"_title"),variant:"subtitle2",className:_.default(P.title,(u={},u[P.alertTitle]=N,u))},{children:k})),y&&s.jsx(n.Typography,e.__assign({className:_.default(P.timestamp,!N&&P[F])},{children:y}))]})),s.jsx("div",e.__assign({className:_.default(P.messageContent,!N&&P[F])},{children:s.jsx(n.Typography,e.__assign({"data-testid":"".concat(I,"_content"),className:_.default(N?P.alertContent:P.content)},{children:A}))}))]}))]}))})),action:[s.jsx(o,e.__assign({"data-testid":"".concat(I,"_closeButton"),"aria-label":"Close",color:"inherit",onClick:function(){b(),d(v)},size:"small",iconType:"iconPark",tooltipProps:{title:"Close",classes:{tooltip:P.tooltip}},className:P.closeIconButton},{children:s.jsx(l.CloseSmallIcon,{size:24,fill:N?"#000":"#fff"})}),"close")]},p))}))};
@@ -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;AAYvC,eAAO,MAAM,SAAS,sBAAsB,CAAC;AAU7C,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,WA2HvE,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;AAYvC,eAAO,MAAM,SAAS,sBAAsB,CAAC;AAU7C,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,WA6HvE,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 a,cloneElement as s}from"react";import n from"classnames";import{noop as c}from"lodash";import{Grow as r,SnackbarContent as l,Tooltip as m,Typography as d}from"@material-ui/core";import p from"../IconButton/index.js";import{NOTIFICATION_VARIANTS as f}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="NotificationPopup",T=((k={})[f.success]=v,k[f.warning]=h,k[f.error]=C,k[f.info]=N,k[f.neutral]=b,k),_=function(v){var h,C=v.onDismissClick,N=v.toast,b=t(v,["onDismissClick","toast"]),k=N.alertLevel,_=N.autoHideDuration,x=void 0===_?3e3:_,P=N.content,y=N.hideIcon,z=N.icon,B=N.id,D=N.onClick,I=void 0===D?c:D,w=N.onClose,L=void 0===w?c:w,W=N.timestamp,H=N.title,q=N.tooltipProps,A=N.variant,E=void 0===A?"info":A;a((function(){var t=setTimeout((function(){return C(B)}),x);return function(){return clearTimeout(t)}}),[]);var F=u(),G=T[E];return e(r,i({appear:!0,in:!0},{children:e(l,i({classes:{root:n(F.main,!k&&F[E],k&&F.alertNotification,k&&F["alertLevels-".concat(k)]),action:F.actionContainer,message:F.messageContainer},"aria-describedby":"client-snackbar",message:e(m,i({},q,{title:P,classes:{tooltip:F.tooltip},placement:"bottom"},{children:o("div",i({id:"client-snackbar",className:F.messageWrapper,onClick:I,"data-testid":"".concat(j,"_status_").concat(f[E])},{children:[!y&&e("div",i({className:F.iconWrapper},{children:z?s(z,{className:F.icon,nativeColor:"#fff"}):e(G,{fill:E===f.warning?"#000":"#fff",size:16,className:F.icon})})),o("div",i({className:F.message},{children:[o("div",i({className:F.messageTop},{children:[H&&e(d,i({"data-testid":"".concat(j,"_title"),variant:"subtitle2",className:n(F.title,(h={},h[F.alertTitle]=k,h))},{children:H})),W&&e(d,i({className:n(F.timestamp,!k&&F[E])},{children:W}))]})),e("div",i({className:n(F.messageContent,!k&&F[E])},{children:e(d,i({"data-testid":"".concat(j,"_content"),className:n(k?F.alertContent:F.content)},{children:P}))}))]}))]}))})),action:[e(p,i({"data-testid":"".concat(j,"_closeButton"),"aria-label":"Close",color:"inherit",onClick:function(){L(),C(B)},size:"small",iconType:"iconPark",tooltipProps:{title:"Close",classes:{tooltip:F.tooltip}},className:F.closeIconButton},{children:e(g,{size:24,fill:k?"#000":"#fff"})}),"close")]},b))}))};export{j as PAGE_NAME,_ as Toast};
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 a,cloneElement as s}from"react";import n from"classnames";import{noop as c}from"lodash";import{Grow as r,SnackbarContent as l,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="NotificationPopup",T=((k={})[p.success]=v,k[p.warning]=h,k[p.error]=C,k[p.info]=N,k[p.neutral]=b,k),_=function(v){var h,C=v.onDismissClick,N=v.toast,b=t(v,["onDismissClick","toast"]),k=N.alertLevel,_=N.autoHideDuration,x=void 0===_?3e3:_,P=N.content,y=N.hideIcon,z=N.icon,B=N.id,D=N.onClick,I=void 0===D?c:D,w=N.onClose,L=void 0===w?c:w,W=N.timestamp,H=N.title,q=N.tooltipProps,A=N.variant,E=void 0===A?"info":A;a((function(){if(x!==1/0){var t=setTimeout((function(){return C(B)}),x);return function(){return clearTimeout(t)}}}),[]);var F=u(),G=T[E];return e(r,i({appear:!0,in:!0},{children:e(l,i({classes:{root:n(F.main,!k&&F[E],k&&F.alertNotification,k&&F["alertLevels-".concat(k)]),action:F.actionContainer,message:F.messageContainer},"aria-describedby":"client-snackbar",message:e(m,i({},q,{title:P,classes:{tooltip:F.tooltip},placement:"bottom"},{children:o("div",i({id:"client-snackbar",className:F.messageWrapper,onClick:I,"data-testid":"".concat(j,"_status_").concat(p[E])},{children:[!y&&e("div",i({className:F.iconWrapper},{children:z?s(z,{className:F.icon,nativeColor:"#fff"}):e(G,{fill:E===p.warning?"#000":"#fff",size:16,className:F.icon})})),o("div",i({className:F.message},{children:[o("div",i({className:F.messageTop},{children:[H&&e(d,i({"data-testid":"".concat(j,"_title"),variant:"subtitle2",className:n(F.title,(h={},h[F.alertTitle]=k,h))},{children:H})),W&&e(d,i({className:n(F.timestamp,!k&&F[E])},{children:W}))]})),e("div",i({className:n(F.messageContent,!k&&F[E])},{children:e(d,i({"data-testid":"".concat(j,"_content"),className:n(k?F.alertContent:F.content)},{children:P}))}))]}))]}))})),action:[e(f,i({"data-testid":"".concat(j,"_closeButton"),"aria-label":"Close",color:"inherit",onClick:function(){L(),C(B)},size:"small",iconType:"iconPark",tooltipProps:{title:"Close",classes:{tooltip:F.tooltip}},className:F.closeIconButton},{children:e(g,{size:24,fill:k?"#000":"#fff"})}),"close")]},b))}))};export{j as PAGE_NAME,_ as Toast};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.75.0-6",
3
+ "version": "0.75.0-7",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"