@corva/ui 0.28.0-10 → 0.28.0-11

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
- import e from"@babel/runtime/helpers/defineProperty";import{jsxs as a,jsx as i}from"react/jsx-runtime";import{withStyles as l,Grid as r,Typography as t,Switch as o}from"@material-ui/core";import{forwardRef as s}from"react";import c from"prop-types";import n from"classnames";import d from"./style.css.js";var b=s((function(l,s){var c,b,m=l.title,p=l.leftLabel,h=l.rightLabel,f=l.checked,g=l.onChange,u=l.disabled,L=l.classes,k=l.size,D=l.className,w=p&&h;return a("div",{className:D,children:[m&&i("div",{className:d.switchControlTitle,children:m}),a(r,{component:"label",container:!0,alignItems:"center",spacing:0,children:[p&&i(r,{item:!0,children:i(t,{variant:"body2",className:n(L.label,"small"===k&&L.labelSmall,!f&&!u&&L.activeLabel,u&&L.disabledLabel),children:p})}),i(r,{item:!0,children:i(o,{ref:s,checked:f,onChange:g,color:"primary",disabled:u,classes:{root:L.root,switchBase:n((c={},e(c,L.switchBase,w||f&&!u),e(c,L.switchBaseDisabled,u&&(w||f)),e(c,L.switchBaseDisabledNoLabels,!w&&u&&!f),c)),track:n((b={},e(b,L.track,w||f&&!u),e(b,L.trackDisabled,u&&(w||f)),e(b,L.trackDisabledNoLabels,!w&&u&&!f),b))},size:k})}),h&&i(r,{item:!0,children:i(t,{variant:"body2",className:n(L.label,"small"===k&&L.labelSmall,f&&!u&&L.activeLabel,u&&L.disabledLabel),children:h})})]})]})}));b.propTypes={title:c.string,leftLabel:c.string,rightLabel:c.string,checked:c.bool.isRequired,onChange:c.func.isRequired,disabled:c.bool,classes:c.shape({}).isRequired,size:c.string,className:c.string},b.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:""};var m=l({root:{width:60,height:40,padding:13,"&.MuiSwitch-sizeSmall":{width:52,height:36,padding:13},"& .MuiSwitch-switchBase":{padding:10}},switchBase:{padding:10,color:"#03BCD4","&.MuiIconButton-root:hover":{backgroundColor:"rgba(3, 188, 212, 0.08)"}},switchBaseDisabled:{color:"#196069 !important"},track:{backgroundColor:"#196069 !important",opacity:"1 !important",border:"none"},trackDisabled:{backgroundColor:"#223D40 !important",opacity:"1 !important",border:"none"},switchBaseDisabledNoLabels:{color:"#545454 !important"},trackDisabledNoLabels:{backgroundColor:"#3D3D3D !important",opacity:"1 !important",border:"none"},label:{display:"flex",justifyContent:"center",flexDirection:"column",fontSize:"16px",lineHeight:"22px",color:"#bdbdbd",margin:"8px 0px",cursor:"pointer"},labelSmall:{fontSize:"14px",lineHeight:"20px"},disabledLabel:{cursor:"default",color:"#616161"},activeLabel:{color:"#ffffff"}})(b);export default m;
1
+ import e from"@babel/runtime/helpers/defineProperty";import{jsxs as t,jsx as r}from"react/jsx-runtime";import{withStyles as a,Grid as i,Typography as o,Switch as l}from"@material-ui/core";import{forwardRef as s}from"react";import c from"@babel/runtime/helpers/objectWithoutProperties";import n from"prop-types";import b from"classnames";import d from"./style.css.js";function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function m(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?p(Object(a),!0).forEach((function(r){e(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):p(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var h=s((function(a,s){var n,p,h=a.title,f=a.leftLabel,u=a.rightLabel,g=a.checked,y=a.onChange,w=a.disabled,D=a.classes,k=a.size,O=a.className,L=a.customClasses,j=f&&u,v=L.root,C=L.track,B=L.switchBase,N=c(L,["root","track","switchBase"]);return t("div",{className:O,children:[h&&r("div",{className:d.switchControlTitle,children:h}),t(i,{component:"label",container:!0,alignItems:"center",spacing:0,children:[f&&r(i,{item:!0,children:r(o,{variant:"body2",className:b(D.label,"small"===k&&D.labelSmall,!g&&!w&&D.activeLabel,w&&D.disabledLabel),children:f})}),r(i,{item:!0,children:r(l,{ref:s,checked:g,onChange:y,color:"primary",disabled:w,classes:m({root:b(D.root,v),switchBase:b((n={},e(n,D.switchBase,j||g&&!w),e(n,D.switchBaseDisabled,w&&(j||g)),e(n,D.switchBaseDisabledNoLabels,!j&&w&&!g),n),B),track:b((p={},e(p,D.track,j||g&&!w),e(p,D.trackDisabled,w&&(j||g)),e(p,D.trackDisabledNoLabels,!j&&w&&!g),p),C)},N),size:k})}),u&&r(i,{item:!0,children:r(o,{variant:"body2",className:b(D.label,"small"===k&&D.labelSmall,g&&!w&&D.activeLabel,w&&D.disabledLabel),children:u})})]})]})}));h.propTypes={title:n.string,leftLabel:n.string,rightLabel:n.string,checked:n.bool.isRequired,onChange:n.func.isRequired,disabled:n.bool,classes:n.shape({}).isRequired,size:n.string,className:n.string,customClasses:n.shape()},h.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:"",customClasses:{}};var f=a({root:{width:60,height:40,padding:13,"&.MuiSwitch-sizeSmall":{width:52,height:36,padding:13},"& .MuiSwitch-switchBase":{padding:10}},switchBase:{padding:10,color:"#03BCD4","&.MuiIconButton-root:hover":{backgroundColor:"rgba(3, 188, 212, 0.08)"}},switchBaseDisabled:{color:"#196069 !important"},track:{backgroundColor:"#196069 !important",opacity:"1 !important",border:"none"},trackDisabled:{backgroundColor:"#223D40 !important",opacity:"1 !important",border:"none"},switchBaseDisabledNoLabels:{color:"#545454 !important"},trackDisabledNoLabels:{backgroundColor:"#3D3D3D !important",opacity:"1 !important",border:"none"},label:{display:"flex",justifyContent:"center",flexDirection:"column",fontSize:"16px",lineHeight:"22px",color:"#bdbdbd",margin:"8px 0px",cursor:"pointer"},labelSmall:{fontSize:"14px",lineHeight:"20px"},disabledLabel:{cursor:"default",color:"#616161"},activeLabel:{color:"#ffffff"}})(h);export default f;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "0.28.0-10",
3
+ "version": "0.28.0-11",
4
4
  "description": "Shared components/utils for Corva ui projects",
5
5
  "keywords": [
6
6
  "corva-ui"