@devseed-ui/button
Advanced tools
Comparing version 2.0.0 to 2.1.1
# @devseed-ui/button | ||
## 2.1.1 | ||
### Major Changes | ||
- Changeset test | ||
### Patch Changes | ||
- Updated dependencies [undefined] | ||
- @devseed-ui/base@2.1.1 | ||
- @devseed-ui/helpers@2.1.1 | ||
- @devseed-ui/theme@2.1.1 | ||
## 2.0.0 | ||
### Major Changes | ||
@@ -5,0 +19,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme"));else if("function"==typeof define&&define.amd)define(["react","prop-types","styled-components","polished","@devseed-ui/helpers","@devseed-ui/base","@devseed-ui/theme"],r);else{var t="object"==typeof exports?r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme")):r(e.react,e["prop-types"],e["styled-components"],e.polished,e["@devseed-ui/helpers"],e["@devseed-ui/base"],e["@devseed-ui/theme"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(global,(function(e,r,t,n,i,a,o){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(r){return e[r]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.buttonVariationBaseCss=y,r.buttonVariationActiveCss=v,r.buttonVariationHoverCss=x,r.buttonVariation=w,r.default=void 0;var n=c(t(1)),i=c(t(2)),a=function(e){if(e&&e.__esModule)return e;var r=d();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(t,i,a):t[i]=e[i]}}t.default=e,r&&r.set(e,t);return t}(t(3)),o=t(4),s=t(5),l=t(6),u=c(t(7));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function c(e){return e&&e.__esModule?e:{default:e}}function f(){return(f=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function p(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var m=n.default.forwardRef((function(e,r){var t=e.children,i=(e.active,e.hideText,e.size,e.variation,e.radius,e.type),a=e.element,o=p(e,["children","active","hideText","size","variation","radius","type","element"]),s="button"===a?i||"button":"";return n.default.createElement(a,f({ref:r},o,{type:s}),!!t&&n.default.createElement("span",null,t))}));m.propTypes={element:i.default.oneOfType([i.default.elementType,i.default.string]),type:i.default.string,children:i.default.node,active:i.default.bool,hideText:i.default.bool,size:i.default.string,variation:i.default.string,radius:i.default.string},m.defaultProps={element:"button",type:"button",size:"medium",radius:"rounded"};var b=(0,a.default)(m).withConfig({displayName:"src__Button",componentId:"sc-1eynjnw-0"})([""," user-select:none;display:inline-block;text-align:center;white-space:nowrap;vertical-align:middle;line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;background:none;text-shadow:none;border:0;font-family:",";font-weight:",";cursor:pointer;&,&:focus{outline:none;}&:hover{opacity:1;}"," &.active,&:active{z-index:2;transform:none;}&::before,&::after{font-size:1rem;}&::before{margin-right:0.375rem;}&::after{margin-left:0.375rem;}&::before,&::after,> *{vertical-align:top;display:inline-block;line-height:inherit !important;}> input[type=checkbox],> input[type=radio]{","}transition:background-color 0.24s ease 0s;"," "," "," "," "," ",""],(0,s.antialiased)(),(0,l.themeVal)("type.base.family"),(0,l.themeVal)("type.base.bold"),(function(e){return e.active?"&,":""}),(0,s.visuallyHidden)(),(function(e){return function(e){switch(e.variation){case"base-raised-light":return w(e.theme.type.base.color,"raised","light",e);case"base-raised-semidark":return w(e.theme.type.base.color,"raised","semidark",e);case"base-raised-dark":return w(e.theme.type.base.color,"raised","dark",e);case"primary-raised-light":return w(e.theme.color.primary,"raised","light",e);case"primary-raised-semidark":return w(e.theme.color.primary,"raised","semidark",e);case"primary-raised-dark":return w(e.theme.color.primary,"raised","dark",e);case"primary-plain":return w(e.theme.color.primary,"plain","light",e);case"danger-raised-light":return w(e.theme.color.danger,"raised","light",e);case"danger-raised-dark":return w(e.theme.color.danger,"raised","dark",e);case"danger-plain":return w(e.theme.color.danger,"plain","light",e);case"achromic-plain":return w("#fff","plain",null,e);case"achromic-glass":return w("#fff","glass",null,e);case"base-plain":default:return w(e.theme.color.base,"plain","light",e)}}(e)}),(function(e){return function(e){switch(e.size){case"small":return(0,a.css)(["line-height:1.25rem;font-size:0.875rem;padding:0.125rem 0.25rem;min-width:1.5rem;"]);case"large":return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.5rem 1.25rem;min-width:2.5rem;"]);case"xlarge":return(0,a.css)(["line-height:2rem;font-size:1rem;padding:0.5rem 1.5rem;min-width:3rem;"]);default:return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;"])}}(e)}),(function(e){return function(e){switch(e.radius){case"ellipsoid":return(0,a.css)(["border-radius:",";"],(0,l.themeVal)("shape.ellipsoid"));case"square":return(0,a.css)(["border-radius:0;"]);default:return(0,a.css)(["border-radius:",";"],(0,l.themeVal)("shape.rounded"))}}(e)}),(function(e){return e.hideText&&(0,a.css)(["padding-left:0;padding-right:0;&::before,&::after{margin:0;}> *{","}"],(0,s.visuallyHidden)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,s.disabled)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,s.disabled)())}));b.propTypes={children:i.default.node,active:i.default.bool,hideText:i.default.bool,variation:i.default.string,size:i.default.string,radius:i.default.string},b.defaultProps={theme:u.default.main};var h=b;function g(e,r,t,n){var i=n.theme,a=null,s=null,l=null,u=null,d=null;switch(r){case"raised":switch(t){case"light":a=e,s=(0,o.tint)(1,e),l=(0,o.tint)(.96,e),u=(0,o.tint)(.92,e),d=(0,o.rgba)(i.color.base,.16);break;case"semidark":a=e,s=(0,o.tint)(.88,e),l=(0,o.tint)(.84,e),u=(0,o.tint)(.8,e),d=(0,o.rgba)(i.color.base,.16);break;case"dark":a=(0,o.tint)(1,e),s=e,l=(0,o.shade)(.08,e),u=(0,o.shade)(.12,e),d=(0,o.rgba)(i.color.base,.24);break;default:console.error("Invalid brightness property for button raised")}break;case"glass":a=e,s=(0,o.rgba)(e,.16),l=(0,o.rgba)(e,.24),u=(0,o.rgba)(e,.32);break;case"plain":a=e,s=(0,o.rgba)(e,0),l=(0,o.rgba)(e,.08),u=(0,o.rgba)(e,.16);break;default:console.error("Invalid style property for button")}return{textColor:a,bgColor:s,bgColorHover:l,bgColorActive:u,shadowColor:d}}function y(e,r,t,n){var i=n.theme,s=g(e,r,t,{theme:i}),l=s.textColor,u=s.bgColor,d=s.shadowColor;return(0,a.css)(["background-color:",";&,&:visited{color:",";}",""],u,l,d&&(0,a.css)(["box-shadow:0 -1px 1px 0 ",",0 2px 6px 0 ",";"],(0,o.rgba)(i.color.base,.08),d))}function v(e,r,t,n){var i=g(e,r,t,{theme:n.theme}),o=i.bgColorActive,s=i.shadowColor;return(0,a.css)(["background-color:",";",""],o,s&&(0,a.css)(["box-shadow:inset 0 1px 2px 0 ",";"],s))}function x(e,r,t,n){var i=g(e,r,t,{theme:n.theme}).bgColorHover;return(0,a.css)(["background-color:",";"],i)}function w(e,r,t,n){return(0,a.css)([""," &:hover{","}"," &.active,&:active{","}"],y(e,r,t,n),x(e,r,t,n),(function(e){return e.active?"&, &:hover,":""}),v(e,r,t,n))}r.default=h},function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r){e.exports=t},function(e,r){e.exports=n},function(e,r){e.exports=i},function(e,r){e.exports=a},function(e,r){e.exports=o}])})); | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme"));else if("function"==typeof define&&define.amd)define(["react","prop-types","styled-components","polished","@devseed-ui/helpers","@devseed-ui/base","@devseed-ui/theme"],r);else{var t="object"==typeof exports?r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme")):r(e.react,e["prop-types"],e["styled-components"],e.polished,e["@devseed-ui/helpers"],e["@devseed-ui/base"],e["@devseed-ui/theme"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(global,(function(e,r,t,n,i,o,a){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(r){return e[r]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.buttonVariationBaseCss=v,r.buttonVariationActiveCss=x,r.buttonVariationHoverCss=w,r.buttonVariation=k,r.default=void 0;var i=f(t(1)),o=f(t(2)),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=c();if(r&&r.has(e))return r.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}t.default=e,r&&r.set(e,t);return t}(t(3)),s=t(4),u=t(5),l=t(6),d=f(t(7));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function f(e){return e&&e.__esModule?e:{default:e}}function p(){return(p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function b(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var m=i.default.forwardRef((function(e,r){var t=e.children,n=(e.active,e.hideText,e.size,e.variation,e.radius,e.type),o=e.element,a=b(e,["children","active","hideText","size","variation","radius","type","element"]),s="button"===o?n||"button":"";return i.default.createElement(o,p({ref:r},a,{type:s}),!!t&&i.default.createElement("span",null,t))}));m.propTypes={element:o.default.oneOfType([o.default.elementType,o.default.string]),type:o.default.string,children:o.default.node,active:o.default.bool,hideText:o.default.bool,size:o.default.string,variation:o.default.string,radius:o.default.string},m.defaultProps={element:"button",type:"button",size:"medium",radius:"rounded"};var h=(0,a.default)(m).withConfig({displayName:"src__Button",componentId:"sc-1eynjnw-0"})([""," user-select:none;display:inline-block;text-align:center;white-space:nowrap;vertical-align:middle;line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;background:none;text-shadow:none;border:0;font-family:",";font-weight:",";cursor:pointer;&,&:focus{outline:none;}&:hover{opacity:1;}"," &.active,&:active{z-index:2;transform:none;}&::before,&::after{font-size:1rem;}&::before{margin-right:0.375rem;}&::after{margin-left:0.375rem;}&::before,&::after,> *{vertical-align:top;display:inline-block;line-height:inherit !important;}> input[type=checkbox],> input[type=radio]{","}transition:background-color 0.24s ease 0s;"," "," "," "," "," ",""],(0,u.antialiased)(),(0,l.themeVal)("type.base.family"),(0,l.themeVal)("type.base.bold"),(function(e){return e.active?"&,":""}),(0,u.visuallyHidden)(),(function(e){return function(e){switch(e.variation){case"base-raised-light":return k(e.theme.type.base.color,"raised","light",e);case"base-raised-semidark":return k(e.theme.type.base.color,"raised","semidark",e);case"base-raised-dark":return k(e.theme.type.base.color,"raised","dark",e);case"primary-raised-light":return k(e.theme.color.primary,"raised","light",e);case"primary-raised-semidark":return k(e.theme.color.primary,"raised","semidark",e);case"primary-raised-dark":return k(e.theme.color.primary,"raised","dark",e);case"primary-plain":return k(e.theme.color.primary,"plain","light",e);case"danger-raised-light":return k(e.theme.color.danger,"raised","light",e);case"danger-raised-dark":return k(e.theme.color.danger,"raised","dark",e);case"danger-plain":return k(e.theme.color.danger,"plain","light",e);case"achromic-plain":return k("#fff","plain",null,e);case"achromic-glass":return k("#fff","glass",null,e);case"base-plain":default:return k(e.theme.color.base,"plain","light",e)}}(e)}),(function(e){return function(e){switch(e.size){case"small":return(0,a.css)(["line-height:1.25rem;font-size:0.875rem;padding:0.125rem 0.25rem;min-width:1.5rem;"]);case"large":return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.5rem 1.25rem;min-width:2.5rem;"]);case"xlarge":return(0,a.css)(["line-height:2rem;font-size:1rem;padding:0.5rem 1.5rem;min-width:3rem;"]);default:return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;"])}}(e)}),(function(e){return function(e){switch(e.radius){case"ellipsoid":return(0,a.css)(["border-radius:",";"],(0,l.themeVal)("shape.ellipsoid"));case"square":return(0,a.css)(["border-radius:0;"]);default:return(0,a.css)(["border-radius:",";"],(0,l.themeVal)("shape.rounded"))}}(e)}),(function(e){return e.hideText&&(0,a.css)(["padding-left:0;padding-right:0;&::before,&::after{margin:0;}> *{","}"],(0,u.visuallyHidden)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,u.disabled)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,u.disabled)())}));h.propTypes={children:o.default.node,active:o.default.bool,hideText:o.default.bool,variation:o.default.string,size:o.default.string,radius:o.default.string},h.defaultProps={theme:d.default.main};var y=h;function g(e,r,t,n){var i=n.theme,o=null,a=null,u=null,l=null,d=null;switch(r){case"raised":switch(t){case"light":o=e,a=(0,s.tint)(1,e),u=(0,s.tint)(.96,e),l=(0,s.tint)(.92,e),d=(0,s.rgba)(i.color.base,.16);break;case"semidark":o=e,a=(0,s.tint)(.88,e),u=(0,s.tint)(.84,e),l=(0,s.tint)(.8,e),d=(0,s.rgba)(i.color.base,.16);break;case"dark":o=(0,s.tint)(1,e),a=e,u=(0,s.shade)(.08,e),l=(0,s.shade)(.12,e),d=(0,s.rgba)(i.color.base,.24);break;default:console.error("Invalid brightness property for button raised")}break;case"glass":o=e,a=(0,s.rgba)(e,.16),u=(0,s.rgba)(e,.24),l=(0,s.rgba)(e,.32);break;case"plain":o=e,a=(0,s.rgba)(e,0),u=(0,s.rgba)(e,.08),l=(0,s.rgba)(e,.16);break;default:console.error("Invalid style property for button")}return{textColor:o,bgColor:a,bgColorHover:u,bgColorActive:l,shadowColor:d}}function v(e,r,t,n){var i=n.theme,o=g(e,r,t,{theme:i}),u=o.textColor,l=o.bgColor,d=o.shadowColor;return(0,a.css)(["background-color:",";&,&:visited{color:",";}",""],l,u,d&&(0,a.css)(["box-shadow:0 -1px 1px 0 ",",0 2px 6px 0 ",";"],(0,s.rgba)(i.color.base,.08),d))}function x(e,r,t,n){var i=g(e,r,t,{theme:n.theme}),o=i.bgColorActive,s=i.shadowColor;return(0,a.css)(["background-color:",";",""],o,s&&(0,a.css)(["box-shadow:inset 0 1px 2px 0 ",";"],s))}function w(e,r,t,n){var i=g(e,r,t,{theme:n.theme}).bgColorHover;return(0,a.css)(["background-color:",";"],i)}function k(e,r,t,n){return(0,a.css)([""," &:hover{","}"," &.active,&:active{","}"],v(e,r,t,n),w(e,r,t,n),(function(e){return e.active?"&, &:hover,":""}),x(e,r,t,n))}r.default=y},function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r){e.exports=t},function(e,r){e.exports=n},function(e,r){e.exports=i},function(e,r){e.exports=o},function(e,r){e.exports=a}])})); | ||
//# sourceMappingURL=index.node.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme"));else if("function"==typeof define&&define.amd)define(["react","prop-types","styled-components","polished","@devseed-ui/helpers","@devseed-ui/base","@devseed-ui/theme"],r);else{var t="object"==typeof exports?r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme")):r(e.react,e["prop-types"],e["styled-components"],e.polished,e["@devseed-ui/helpers"],e["@devseed-ui/base"],e["@devseed-ui/theme"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(window,(function(e,r,t,n,i,a,o){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(r){return e[r]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.buttonVariationBaseCss=y,r.buttonVariationActiveCss=v,r.buttonVariationHoverCss=x,r.buttonVariation=w,r.default=void 0;var n=c(t(1)),i=c(t(2)),a=function(e){if(e&&e.__esModule)return e;var r=d();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(t,i,a):t[i]=e[i]}}t.default=e,r&&r.set(e,t);return t}(t(3)),o=t(4),s=t(5),u=t(6),l=c(t(7));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function c(e){return e&&e.__esModule?e:{default:e}}function f(){return(f=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function p(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var m=n.default.forwardRef((function(e,r){var t=e.children,i=(e.active,e.hideText,e.size,e.variation,e.radius,e.type),a=e.element,o=p(e,["children","active","hideText","size","variation","radius","type","element"]),s="button"===a?i||"button":"";return n.default.createElement(a,f({ref:r},o,{type:s}),!!t&&n.default.createElement("span",null,t))}));m.propTypes={element:i.default.oneOfType([i.default.elementType,i.default.string]),type:i.default.string,children:i.default.node,active:i.default.bool,hideText:i.default.bool,size:i.default.string,variation:i.default.string,radius:i.default.string},m.defaultProps={element:"button",type:"button",size:"medium",radius:"rounded"};var b=(0,a.default)(m).withConfig({displayName:"src__Button",componentId:"sc-1eynjnw-0"})([""," user-select:none;display:inline-block;text-align:center;white-space:nowrap;vertical-align:middle;line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;background:none;text-shadow:none;border:0;font-family:",";font-weight:",";cursor:pointer;&,&:focus{outline:none;}&:hover{opacity:1;}"," &.active,&:active{z-index:2;transform:none;}&::before,&::after{font-size:1rem;}&::before{margin-right:0.375rem;}&::after{margin-left:0.375rem;}&::before,&::after,> *{vertical-align:top;display:inline-block;line-height:inherit !important;}> input[type=checkbox],> input[type=radio]{","}transition:background-color 0.24s ease 0s;"," "," "," "," "," ",""],(0,s.antialiased)(),(0,u.themeVal)("type.base.family"),(0,u.themeVal)("type.base.bold"),(function(e){return e.active?"&,":""}),(0,s.visuallyHidden)(),(function(e){return function(e){switch(e.variation){case"base-raised-light":return w(e.theme.type.base.color,"raised","light",e);case"base-raised-semidark":return w(e.theme.type.base.color,"raised","semidark",e);case"base-raised-dark":return w(e.theme.type.base.color,"raised","dark",e);case"primary-raised-light":return w(e.theme.color.primary,"raised","light",e);case"primary-raised-semidark":return w(e.theme.color.primary,"raised","semidark",e);case"primary-raised-dark":return w(e.theme.color.primary,"raised","dark",e);case"primary-plain":return w(e.theme.color.primary,"plain","light",e);case"danger-raised-light":return w(e.theme.color.danger,"raised","light",e);case"danger-raised-dark":return w(e.theme.color.danger,"raised","dark",e);case"danger-plain":return w(e.theme.color.danger,"plain","light",e);case"achromic-plain":return w("#fff","plain",null,e);case"achromic-glass":return w("#fff","glass",null,e);case"base-plain":default:return w(e.theme.color.base,"plain","light",e)}}(e)}),(function(e){return function(e){switch(e.size){case"small":return(0,a.css)(["line-height:1.25rem;font-size:0.875rem;padding:0.125rem 0.25rem;min-width:1.5rem;"]);case"large":return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.5rem 1.25rem;min-width:2.5rem;"]);case"xlarge":return(0,a.css)(["line-height:2rem;font-size:1rem;padding:0.5rem 1.5rem;min-width:3rem;"]);default:return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;"])}}(e)}),(function(e){return function(e){switch(e.radius){case"ellipsoid":return(0,a.css)(["border-radius:",";"],(0,u.themeVal)("shape.ellipsoid"));case"square":return(0,a.css)(["border-radius:0;"]);default:return(0,a.css)(["border-radius:",";"],(0,u.themeVal)("shape.rounded"))}}(e)}),(function(e){return e.hideText&&(0,a.css)(["padding-left:0;padding-right:0;&::before,&::after{margin:0;}> *{","}"],(0,s.visuallyHidden)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,s.disabled)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,s.disabled)())}));b.propTypes={children:i.default.node,active:i.default.bool,hideText:i.default.bool,variation:i.default.string,size:i.default.string,radius:i.default.string},b.defaultProps={theme:l.default.main};var h=b;function g(e,r,t,n){var i=n.theme,a=null,s=null,u=null,l=null,d=null;switch(r){case"raised":switch(t){case"light":a=e,s=(0,o.tint)(1,e),u=(0,o.tint)(.96,e),l=(0,o.tint)(.92,e),d=(0,o.rgba)(i.color.base,.16);break;case"semidark":a=e,s=(0,o.tint)(.88,e),u=(0,o.tint)(.84,e),l=(0,o.tint)(.8,e),d=(0,o.rgba)(i.color.base,.16);break;case"dark":a=(0,o.tint)(1,e),s=e,u=(0,o.shade)(.08,e),l=(0,o.shade)(.12,e),d=(0,o.rgba)(i.color.base,.24);break;default:console.error("Invalid brightness property for button raised")}break;case"glass":a=e,s=(0,o.rgba)(e,.16),u=(0,o.rgba)(e,.24),l=(0,o.rgba)(e,.32);break;case"plain":a=e,s=(0,o.rgba)(e,0),u=(0,o.rgba)(e,.08),l=(0,o.rgba)(e,.16);break;default:console.error("Invalid style property for button")}return{textColor:a,bgColor:s,bgColorHover:u,bgColorActive:l,shadowColor:d}}function y(e,r,t,n){var i=n.theme,s=g(e,r,t,{theme:i}),u=s.textColor,l=s.bgColor,d=s.shadowColor;return(0,a.css)(["background-color:",";&,&:visited{color:",";}",""],l,u,d&&(0,a.css)(["box-shadow:0 -1px 1px 0 ",",0 2px 6px 0 ",";"],(0,o.rgba)(i.color.base,.08),d))}function v(e,r,t,n){var i=g(e,r,t,{theme:n.theme}),o=i.bgColorActive,s=i.shadowColor;return(0,a.css)(["background-color:",";",""],o,s&&(0,a.css)(["box-shadow:inset 0 1px 2px 0 ",";"],s))}function x(e,r,t,n){var i=g(e,r,t,{theme:n.theme}).bgColorHover;return(0,a.css)(["background-color:",";"],i)}function w(e,r,t,n){return(0,a.css)([""," &:hover{","}"," &.active,&:active{","}"],y(e,r,t,n),x(e,r,t,n),(function(e){return e.active?"&, &:hover,":""}),v(e,r,t,n))}r.default=h},function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r){e.exports=t},function(e,r){e.exports=n},function(e,r){e.exports=i},function(e,r){e.exports=a},function(e,r){e.exports=o}])})); | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme"));else if("function"==typeof define&&define.amd)define(["react","prop-types","styled-components","polished","@devseed-ui/helpers","@devseed-ui/base","@devseed-ui/theme"],r);else{var t="object"==typeof exports?r(require("react"),require("prop-types"),require("styled-components"),require("polished"),require("@devseed-ui/helpers"),require("@devseed-ui/base"),require("@devseed-ui/theme")):r(e.react,e["prop-types"],e["styled-components"],e.polished,e["@devseed-ui/helpers"],e["@devseed-ui/base"],e["@devseed-ui/theme"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(window,(function(e,r,t,n,i,o,a){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(r){return e[r]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.buttonVariationBaseCss=v,r.buttonVariationActiveCss=x,r.buttonVariationHoverCss=w,r.buttonVariation=k,r.default=void 0;var i=f(t(1)),o=f(t(2)),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=c();if(r&&r.has(e))return r.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}t.default=e,r&&r.set(e,t);return t}(t(3)),s=t(4),u=t(5),l=t(6),d=f(t(7));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function f(e){return e&&e.__esModule?e:{default:e}}function p(){return(p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function m(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var b=i.default.forwardRef((function(e,r){var t=e.children,n=(e.active,e.hideText,e.size,e.variation,e.radius,e.type),o=e.element,a=m(e,["children","active","hideText","size","variation","radius","type","element"]),s="button"===o?n||"button":"";return i.default.createElement(o,p({ref:r},a,{type:s}),!!t&&i.default.createElement("span",null,t))}));b.propTypes={element:o.default.oneOfType([o.default.elementType,o.default.string]),type:o.default.string,children:o.default.node,active:o.default.bool,hideText:o.default.bool,size:o.default.string,variation:o.default.string,radius:o.default.string},b.defaultProps={element:"button",type:"button",size:"medium",radius:"rounded"};var h=(0,a.default)(b).withConfig({displayName:"src__Button",componentId:"sc-1eynjnw-0"})([""," user-select:none;display:inline-block;text-align:center;white-space:nowrap;vertical-align:middle;line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;background:none;text-shadow:none;border:0;font-family:",";font-weight:",";cursor:pointer;&,&:focus{outline:none;}&:hover{opacity:1;}"," &.active,&:active{z-index:2;transform:none;}&::before,&::after{font-size:1rem;}&::before{margin-right:0.375rem;}&::after{margin-left:0.375rem;}&::before,&::after,> *{vertical-align:top;display:inline-block;line-height:inherit !important;}> input[type=checkbox],> input[type=radio]{","}transition:background-color 0.24s ease 0s;"," "," "," "," "," ",""],(0,u.antialiased)(),(0,l.themeVal)("type.base.family"),(0,l.themeVal)("type.base.bold"),(function(e){return e.active?"&,":""}),(0,u.visuallyHidden)(),(function(e){return function(e){switch(e.variation){case"base-raised-light":return k(e.theme.type.base.color,"raised","light",e);case"base-raised-semidark":return k(e.theme.type.base.color,"raised","semidark",e);case"base-raised-dark":return k(e.theme.type.base.color,"raised","dark",e);case"primary-raised-light":return k(e.theme.color.primary,"raised","light",e);case"primary-raised-semidark":return k(e.theme.color.primary,"raised","semidark",e);case"primary-raised-dark":return k(e.theme.color.primary,"raised","dark",e);case"primary-plain":return k(e.theme.color.primary,"plain","light",e);case"danger-raised-light":return k(e.theme.color.danger,"raised","light",e);case"danger-raised-dark":return k(e.theme.color.danger,"raised","dark",e);case"danger-plain":return k(e.theme.color.danger,"plain","light",e);case"achromic-plain":return k("#fff","plain",null,e);case"achromic-glass":return k("#fff","glass",null,e);case"base-plain":default:return k(e.theme.color.base,"plain","light",e)}}(e)}),(function(e){return function(e){switch(e.size){case"small":return(0,a.css)(["line-height:1.25rem;font-size:0.875rem;padding:0.125rem 0.25rem;min-width:1.5rem;"]);case"large":return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.5rem 1.25rem;min-width:2.5rem;"]);case"xlarge":return(0,a.css)(["line-height:2rem;font-size:1rem;padding:0.5rem 1.5rem;min-width:3rem;"]);default:return(0,a.css)(["line-height:1.5rem;font-size:1rem;padding:0.25rem 0.75rem;min-width:2rem;"])}}(e)}),(function(e){return function(e){switch(e.radius){case"ellipsoid":return(0,a.css)(["border-radius:",";"],(0,l.themeVal)("shape.ellipsoid"));case"square":return(0,a.css)(["border-radius:0;"]);default:return(0,a.css)(["border-radius:",";"],(0,l.themeVal)("shape.rounded"))}}(e)}),(function(e){return e.hideText&&(0,a.css)(["padding-left:0;padding-right:0;&::before,&::after{margin:0;}> *{","}"],(0,u.visuallyHidden)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,u.disabled)())}),(function(e){return e.disabled&&(0,a.css)(["",""],(0,u.disabled)())}));h.propTypes={children:o.default.node,active:o.default.bool,hideText:o.default.bool,variation:o.default.string,size:o.default.string,radius:o.default.string},h.defaultProps={theme:d.default.main};var y=h;function g(e,r,t,n){var i=n.theme,o=null,a=null,u=null,l=null,d=null;switch(r){case"raised":switch(t){case"light":o=e,a=(0,s.tint)(1,e),u=(0,s.tint)(.96,e),l=(0,s.tint)(.92,e),d=(0,s.rgba)(i.color.base,.16);break;case"semidark":o=e,a=(0,s.tint)(.88,e),u=(0,s.tint)(.84,e),l=(0,s.tint)(.8,e),d=(0,s.rgba)(i.color.base,.16);break;case"dark":o=(0,s.tint)(1,e),a=e,u=(0,s.shade)(.08,e),l=(0,s.shade)(.12,e),d=(0,s.rgba)(i.color.base,.24);break;default:console.error("Invalid brightness property for button raised")}break;case"glass":o=e,a=(0,s.rgba)(e,.16),u=(0,s.rgba)(e,.24),l=(0,s.rgba)(e,.32);break;case"plain":o=e,a=(0,s.rgba)(e,0),u=(0,s.rgba)(e,.08),l=(0,s.rgba)(e,.16);break;default:console.error("Invalid style property for button")}return{textColor:o,bgColor:a,bgColorHover:u,bgColorActive:l,shadowColor:d}}function v(e,r,t,n){var i=n.theme,o=g(e,r,t,{theme:i}),u=o.textColor,l=o.bgColor,d=o.shadowColor;return(0,a.css)(["background-color:",";&,&:visited{color:",";}",""],l,u,d&&(0,a.css)(["box-shadow:0 -1px 1px 0 ",",0 2px 6px 0 ",";"],(0,s.rgba)(i.color.base,.08),d))}function x(e,r,t,n){var i=g(e,r,t,{theme:n.theme}),o=i.bgColorActive,s=i.shadowColor;return(0,a.css)(["background-color:",";",""],o,s&&(0,a.css)(["box-shadow:inset 0 1px 2px 0 ",";"],s))}function w(e,r,t,n){var i=g(e,r,t,{theme:n.theme}).bgColorHover;return(0,a.css)(["background-color:",";"],i)}function k(e,r,t,n){return(0,a.css)([""," &:hover{","}"," &.active,&:active{","}"],v(e,r,t,n),w(e,r,t,n),(function(e){return e.active?"&, &:hover,":""}),x(e,r,t,n))}r.default=y},function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r){e.exports=t},function(e,r){e.exports=n},function(e,r){e.exports=i},function(e,r){e.exports=o},function(e,r){e.exports=a}])})); | ||
//# sourceMappingURL=index.web.js.map |
{ | ||
"name": "@devseed-ui/button", | ||
"version": "2.0.0", | ||
"version": "2.1.1", | ||
"description": "devseed UI Kit Button", | ||
@@ -15,6 +15,6 @@ "browser": "./dist/index.web.js", | ||
"dependencies": { | ||
"@devseed-ui/base": "^2.0.0", | ||
"@devseed-ui/helpers": "^2.0.0", | ||
"@devseed-ui/theme": "^2.0.0" | ||
"@devseed-ui/base": "^2.1.1", | ||
"@devseed-ui/helpers": "^2.1.1", | ||
"@devseed-ui/theme": "^2.1.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88529
11
666
Updated@devseed-ui/base@^2.1.1
Updated@devseed-ui/helpers@^2.1.1
Updated@devseed-ui/theme@^2.1.1