@corva/ui 0.60.0-12 → 0.60.0-13

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";var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),r=require("react"),o=require("prop-types"),n=require("@material-ui/core"),a=require("@material-ui/icons"),i=require("chroma-js"),l=require("classnames"),s=require("validate-color"),c=require("./PaletteChromePicker/PaletteChromePicker.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=u(o),d=u(i),b=u(l),f=u(s),g={rgba:function(e){return"rgba(".concat(e.rgb.r,", ").concat(e.rgb.g,", ").concat(e.rgb.b,", ").concat(e.rgb.a,")")},rgb:function(e){return"rgb(".concat(e.rgb.r,", ").concat(e.rgb.g,", ").concat(e.rgb.b,")")},hex:function(e){return e.hex},rgba_rgb:function(e){return 1===e.rgb.a?g.rgb(e):g.rgba(e)},rgba_hex:function(e){return 1===e.rgb.a?g.hex(e):g.rgba(e)}},h=function(o){var i,l,s,c=o.label,u=o.value,p=o.converter,h=o.onChange,m=o.buttonClassName,x=o.popoverAnchorOrigin,v=o.popoverTransformOrigin,C=o.labelPosition,L=o.hideLabel,k=o.pickerComponent,y=o.classes,P=o.lensColor,T=o.enableTransparencyPalette,O=o["data-testid"],q=r.useState(null),R=q[0],_=q[1],j=r.useState("#03BCD4"),S=j[0],z=j[1],I=r.useRef();r.useEffect((function(){var e=null==u?void 0:u.trim();e&&f.default(e)?z(e):console.error("The color value(".concat(u,") is not valid, please check it."))}),[u]);return t.jsxs("div",e.__assign({className:b.default(y.root,(i={},i[y.topLabelRoot]="top"===C,i[y.rightLabelRoot]="right"===C,i))},{children:[!L&&t.jsx(n.InputLabel,e.__assign({className:b.default((l={},l[y.topLabel]="top"===C,l[y.rightLabel]="right"===C,l)),shrink:!0},{children:c})),t.jsx(n.IconButton,e.__assign({"data-testid":"".concat(O,"_icon_").concat(c),className:b.default(y.button,m,(s={},s[y.buttonTransparrent]=0===d.default(S).alpha(),s)),disableRipple:!0,style:{backgroundColor:S,color:P},onClick:function(e){_(e.currentTarget)}},{children:t.jsx(a.ColorLens,{fontSize:"small",className:y.colorLensIcon})})),t.jsx(n.Popover,e.__assign({id:"colors-popper",action:I,open:Boolean(R),anchorEl:R,onClose:function(){_(null)},anchorOrigin:x,transformOrigin:v},{children:t.jsx(k,{color:S,onChange:function(e){var t=g[p](e);z(t),h(t)},onSizeChange:function(){I.current&&I.current.updatePosition()},enableTransparencyPalette:T})}))]}))},m=p.default.shape({vertical:p.default.oneOfType([p.default.oneOf(["top","center","bottom"]),p.default.number]),horizontal:p.default.oneOfType([p.default.oneOf(["left","center","right"]),p.default.number])}),x={buttonClassName:p.default.string,label:p.default.string,value:p.default.string.isRequired,onChange:p.default.func.isRequired,converter:p.default.oneOf(Object.keys(g)),classes:p.default.shape({button:p.default.string.isRequired,root:p.default.string,topLabelRoot:p.default.string,rightLabelRoot:p.default.string,topLabel:p.default.string,rightLabel:p.default.string,buttonTransparrent:p.default.string,colorLensIcon:p.default.string}).isRequired,pickerComponent:p.default.elementType,labelPosition:p.default.oneOf(["top","right"]),popoverAnchorOrigin:m,popoverTransformOrigin:m,hideLabel:p.default.bool,lensColor:p.default.string,enableTransparencyPalette:p.default.bool,"data-testid":p.default.string};h.propTypes=x,h.defaultProps={label:"Color",buttonClassName:null,converter:"rgba_hex",pickerComponent:c,hideLabel:!1,popoverAnchorOrigin:{vertical:"bottom",horizontal:"left"},popoverTransformOrigin:{vertical:"top",horizontal:"left"},labelPosition:"top",lensColor:"#fff",enableTransparencyPalette:!1,"data-testid":"ColorPicker"};var v=n.withStyles({root:{position:"relative",display:"flex"},topLabelRoot:{flexDirection:"column"},rightLabelRoot:{flexDirection:"row-reverse",justifyContent:"flex-end",alignItems:"center"},button:{width:"36px",height:"24px",boxShadow:"0px 3px 6px rgba(0, 0, 0, 0.161)",borderRadius:"5px"},buttonTransparrent:{position:"relative",backgroundImage:"url(".concat("/static/media/39f55985e0da1489ad22264208b0493d.svg",")"),backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",display:"block",width:"100%",height:"3px",background:"#FF0000",transform:"rotate(148deg)",borderRadius:"2px"}},colorLensIcon:{position:"relative",zIndex:2},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}})(h);module.exports=v;
1
+ "use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),o=require("react"),r=require("prop-types"),a=require("@material-ui/core"),n=require("@material-ui/icons"),i=require("chroma-js"),l=require("classnames"),s=require("validate-color"),c=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var u=require("./PaletteChromePicker/PaletteChromePicker.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=p(r),b=p(i),f=p(l),g=p(s),h={rgba:function(e){return"rgba(".concat(e.rgb.r,", ").concat(e.rgb.g,", ").concat(e.rgb.b,", ").concat(e.rgb.a,")")},rgb:function(e){return"rgb(".concat(e.rgb.r,", ").concat(e.rgb.g,", ").concat(e.rgb.b,")")},hex:function(e){return e.hex},rgba_rgb:function(e){return 1===e.rgb.a?h.rgb(e):h.rgba(e)},rgba_hex:function(e){return 1===e.rgb.a?h.hex(e):h.rgba(e)}},m=function(r){var i,l,s,u=r.label,p=r.value,d=r.converter,m=r.onChange,x=r.buttonClassName,v=r.popoverAnchorOrigin,C=r.popoverTransformOrigin,L=r.labelPosition,T=r.hideLabel,P=r.pickerComponent,j=r.classes,k=r.lensColor,q=r.enableTransparencyPalette,y=r["data-testid"],_=r.tooltipProps,O=o.useState(null),R=O[0],S=O[1],z=o.useState("#03BCD4"),I=z[0],w=z[1],B=o.useRef();o.useEffect((function(){var e=null==p?void 0:p.trim();e&&g.default(e)?w(e):console.error("The color value(".concat(p,") is not valid, please check it."))}),[p]);return t.jsxs("div",e.__assign({className:f.default(j.root,(i={},i[j.topLabelRoot]="top"===L,i[j.rightLabelRoot]="right"===L,i))},{children:[!T&&t.jsx(a.InputLabel,e.__assign({className:f.default((l={},l[j.topLabel]="top"===L,l[j.rightLabel]="right"===L,l)),shrink:!0},{children:u})),t.jsx(c.Tooltip,e.__assign({title:_.title},_,{children:t.jsx(a.IconButton,e.__assign({"data-testid":"".concat(y,"_icon_").concat(u),className:f.default(j.button,x,(s={},s[j.buttonTransparrent]=0===b.default(I).alpha(),s)),disableRipple:!0,style:{backgroundColor:I,color:k},onClick:function(e){S(e.currentTarget)}},{children:t.jsx(n.ColorLens,{fontSize:"small",className:j.colorLensIcon})}))})),t.jsx(a.Popover,e.__assign({id:"colors-popper",action:B,open:Boolean(R),anchorEl:R,onClose:function(){S(null)},anchorOrigin:v,transformOrigin:C},{children:t.jsx(P,{color:I,onChange:function(e){var t=h[d](e);w(t),m(t)},onSizeChange:function(){B.current&&B.current.updatePosition()},enableTransparencyPalette:q})}))]}))},x=d.default.shape({vertical:d.default.oneOfType([d.default.oneOf(["top","center","bottom"]),d.default.number]),horizontal:d.default.oneOfType([d.default.oneOf(["left","center","right"]),d.default.number])}),v={buttonClassName:d.default.string,label:d.default.string,value:d.default.string.isRequired,onChange:d.default.func.isRequired,converter:d.default.oneOf(Object.keys(h)),classes:d.default.shape({button:d.default.string.isRequired,root:d.default.string,topLabelRoot:d.default.string,rightLabelRoot:d.default.string,topLabel:d.default.string,rightLabel:d.default.string,buttonTransparrent:d.default.string,colorLensIcon:d.default.string}).isRequired,pickerComponent:d.default.elementType,labelPosition:d.default.oneOf(["top","right"]),popoverAnchorOrigin:x,popoverTransformOrigin:x,tooltipProps:d.default.shape({title:d.default.string}),hideLabel:d.default.bool,lensColor:d.default.string,enableTransparencyPalette:d.default.bool,"data-testid":d.default.string};m.propTypes=v,m.defaultProps={label:"Color",buttonClassName:null,converter:"rgba_hex",pickerComponent:u,hideLabel:!1,popoverAnchorOrigin:{vertical:"bottom",horizontal:"left"},popoverTransformOrigin:{vertical:"top",horizontal:"left"},tooltipProps:{title:"Change color"},labelPosition:"top",lensColor:"#fff",enableTransparencyPalette:!1,"data-testid":"ColorPicker"};var C=a.withStyles({root:{position:"relative",display:"flex"},topLabelRoot:{flexDirection:"column"},rightLabelRoot:{flexDirection:"row-reverse",justifyContent:"flex-end",alignItems:"center"},button:{width:"36px",height:"24px",boxShadow:"0px 3px 6px rgba(0, 0, 0, 0.161)",borderRadius:"5px"},buttonTransparrent:{position:"relative",backgroundImage:"url(".concat("/static/media/39f55985e0da1489ad22264208b0493d.svg",")"),backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",display:"block",width:"100%",height:"3px",background:"#FF0000",transform:"rotate(148deg)",borderRadius:"2px"}},colorLensIcon:{position:"relative",zIndex:2},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}})(m);module.exports=C;
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":";;AA0LA,wBAuDsB"}
1
+ {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":";;AAoMA,wBAuDsB"}
@@ -1 +1 @@
1
- import{__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as a}from"react";import i from"prop-types";import{withStyles as l,InputLabel as c,IconButton as s,Popover as p}from"@material-ui/core";import{ColorLens as b}from"@material-ui/icons";import g from"chroma-js";import u from"classnames";import m from"validate-color";import d from"./PaletteChromePicker/PaletteChromePicker.js";var f={rgba:function(o){return"rgba(".concat(o.rgb.r,", ").concat(o.rgb.g,", ").concat(o.rgb.b,", ").concat(o.rgb.a,")")},rgb:function(o){return"rgb(".concat(o.rgb.r,", ").concat(o.rgb.g,", ").concat(o.rgb.b,")")},hex:function(o){return o.hex},rgba_rgb:function(o){return 1===o.rgb.a?f.rgb(o):f.rgba(o)},rgba_hex:function(o){return 1===o.rgb.a?f.hex(o):f.rgba(o)}},h=function(i){var l,d,h,v=i.label,x=i.value,C=i.converter,L=i.onChange,k=i.buttonClassName,T=i.popoverAnchorOrigin,O=i.popoverTransformOrigin,P=i.labelPosition,y=i.hideLabel,R=i.pickerComponent,z=i.classes,S=i.lensColor,I=i.enableTransparencyPalette,N=i["data-testid"],j=t(null),w=j[0],B=j[1],D=t("#03BCD4"),_=D[0],q=D[1],A=n();a((function(){var o=null==x?void 0:x.trim();o&&m(o)?q(o):console.error("The color value(".concat(x,") is not valid, please check it."))}),[x]);return e("div",o({className:u(z.root,(l={},l[z.topLabelRoot]="top"===P,l[z.rightLabelRoot]="right"===P,l))},{children:[!y&&r(c,o({className:u((d={},d[z.topLabel]="top"===P,d[z.rightLabel]="right"===P,d)),shrink:!0},{children:v})),r(s,o({"data-testid":"".concat(N,"_icon_").concat(v),className:u(z.button,k,(h={},h[z.buttonTransparrent]=0===g(_).alpha(),h)),disableRipple:!0,style:{backgroundColor:_,color:S},onClick:function(o){B(o.currentTarget)}},{children:r(b,{fontSize:"small",className:z.colorLensIcon})})),r(p,o({id:"colors-popper",action:A,open:Boolean(w),anchorEl:w,onClose:function(){B(null)},anchorOrigin:T,transformOrigin:O},{children:r(R,{color:_,onChange:function(o){var e=f[C](o);q(e),L(e)},onSizeChange:function(){A.current&&A.current.updatePosition()},enableTransparencyPalette:I})}))]}))},v=i.shape({vertical:i.oneOfType([i.oneOf(["top","center","bottom"]),i.number]),horizontal:i.oneOfType([i.oneOf(["left","center","right"]),i.number])}),x={buttonClassName:i.string,label:i.string,value:i.string.isRequired,onChange:i.func.isRequired,converter:i.oneOf(Object.keys(f)),classes:i.shape({button:i.string.isRequired,root:i.string,topLabelRoot:i.string,rightLabelRoot:i.string,topLabel:i.string,rightLabel:i.string,buttonTransparrent:i.string,colorLensIcon:i.string}).isRequired,pickerComponent:i.elementType,labelPosition:i.oneOf(["top","right"]),popoverAnchorOrigin:v,popoverTransformOrigin:v,hideLabel:i.bool,lensColor:i.string,enableTransparencyPalette:i.bool,"data-testid":i.string};h.propTypes=x,h.defaultProps={label:"Color",buttonClassName:null,converter:"rgba_hex",pickerComponent:d,hideLabel:!1,popoverAnchorOrigin:{vertical:"bottom",horizontal:"left"},popoverTransformOrigin:{vertical:"top",horizontal:"left"},labelPosition:"top",lensColor:"#fff",enableTransparencyPalette:!1,"data-testid":"ColorPicker"};var C=l({root:{position:"relative",display:"flex"},topLabelRoot:{flexDirection:"column"},rightLabelRoot:{flexDirection:"row-reverse",justifyContent:"flex-end",alignItems:"center"},button:{width:"36px",height:"24px",boxShadow:"0px 3px 6px rgba(0, 0, 0, 0.161)",borderRadius:"5px"},buttonTransparrent:{position:"relative",backgroundImage:"url(".concat("/static/media/39f55985e0da1489ad22264208b0493d.svg",")"),backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",display:"block",width:"100%",height:"3px",background:"#FF0000",transform:"rotate(148deg)",borderRadius:"2px"}},colorLensIcon:{position:"relative",zIndex:2},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}})(h);export{C as default};
1
+ import{__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as i}from"react";import a from"prop-types";import{withStyles as l,InputLabel as c,IconButton as s,Popover as p}from"@material-ui/core";import{ColorLens as b}from"@material-ui/icons";import g from"chroma-js";import u from"classnames";import m from"validate-color";import{Tooltip as h}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import d from"./PaletteChromePicker/PaletteChromePicker.js";var f={rgba:function(o){return"rgba(".concat(o.rgb.r,", ").concat(o.rgb.g,", ").concat(o.rgb.b,", ").concat(o.rgb.a,")")},rgb:function(o){return"rgb(".concat(o.rgb.r,", ").concat(o.rgb.g,", ").concat(o.rgb.b,")")},hex:function(o){return o.hex},rgba_rgb:function(o){return 1===o.rgb.a?f.rgb(o):f.rgba(o)},rgba_hex:function(o){return 1===o.rgb.a?f.hex(o):f.rgba(o)}},v=function(a){var l,d,v,x=a.label,C=a.value,T=a.converter,L=a.onChange,P=a.buttonClassName,k=a.popoverAnchorOrigin,O=a.popoverTransformOrigin,y=a.labelPosition,R=a.hideLabel,z=a.pickerComponent,S=a.classes,j=a.lensColor,I=a.enableTransparencyPalette,N=a["data-testid"],w=a.tooltipProps,B=t(null),D=B[0],_=B[1],q=t("#03BCD4"),A=q[0],F=q[1],E=n();i((function(){var o=null==C?void 0:C.trim();o&&m(o)?F(o):console.error("The color value(".concat(C,") is not valid, please check it."))}),[C]);return e("div",o({className:u(S.root,(l={},l[S.topLabelRoot]="top"===y,l[S.rightLabelRoot]="right"===y,l))},{children:[!R&&r(c,o({className:u((d={},d[S.topLabel]="top"===y,d[S.rightLabel]="right"===y,d)),shrink:!0},{children:x})),r(h,o({title:w.title},w,{children:r(s,o({"data-testid":"".concat(N,"_icon_").concat(x),className:u(S.button,P,(v={},v[S.buttonTransparrent]=0===g(A).alpha(),v)),disableRipple:!0,style:{backgroundColor:A,color:j},onClick:function(o){_(o.currentTarget)}},{children:r(b,{fontSize:"small",className:S.colorLensIcon})}))})),r(p,o({id:"colors-popper",action:E,open:Boolean(D),anchorEl:D,onClose:function(){_(null)},anchorOrigin:k,transformOrigin:O},{children:r(z,{color:A,onChange:function(o){var e=f[T](o);F(e),L(e)},onSizeChange:function(){E.current&&E.current.updatePosition()},enableTransparencyPalette:I})}))]}))},x=a.shape({vertical:a.oneOfType([a.oneOf(["top","center","bottom"]),a.number]),horizontal:a.oneOfType([a.oneOf(["left","center","right"]),a.number])}),C={buttonClassName:a.string,label:a.string,value:a.string.isRequired,onChange:a.func.isRequired,converter:a.oneOf(Object.keys(f)),classes:a.shape({button:a.string.isRequired,root:a.string,topLabelRoot:a.string,rightLabelRoot:a.string,topLabel:a.string,rightLabel:a.string,buttonTransparrent:a.string,colorLensIcon:a.string}).isRequired,pickerComponent:a.elementType,labelPosition:a.oneOf(["top","right"]),popoverAnchorOrigin:x,popoverTransformOrigin:x,tooltipProps:a.shape({title:a.string}),hideLabel:a.bool,lensColor:a.string,enableTransparencyPalette:a.bool,"data-testid":a.string};v.propTypes=C,v.defaultProps={label:"Color",buttonClassName:null,converter:"rgba_hex",pickerComponent:d,hideLabel:!1,popoverAnchorOrigin:{vertical:"bottom",horizontal:"left"},popoverTransformOrigin:{vertical:"top",horizontal:"left"},tooltipProps:{title:"Change color"},labelPosition:"top",lensColor:"#fff",enableTransparencyPalette:!1,"data-testid":"ColorPicker"};var T=l({root:{position:"relative",display:"flex"},topLabelRoot:{flexDirection:"column"},rightLabelRoot:{flexDirection:"row-reverse",justifyContent:"flex-end",alignItems:"center"},button:{width:"36px",height:"24px",boxShadow:"0px 3px 6px rgba(0, 0, 0, 0.161)",borderRadius:"5px"},buttonTransparrent:{position:"relative",backgroundImage:"url(".concat("/static/media/39f55985e0da1489ad22264208b0493d.svg",")"),backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",display:"block",width:"100%",height:"3px",background:"#FF0000",transform:"rotate(148deg)",borderRadius:"2px"}},colorLensIcon:{position:"relative",zIndex:2},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}})(v);export{T as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.60.0-12",
3
+ "version": "0.60.0-13",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"