New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@leafygreen-ui/button

Package Overview
Dependencies
Maintainers
4
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/button - npm Package Compare versions

Comparing version 8.0.1 to 9.0.0

14

CHANGELOG.md
# @leafygreen-ui/button
## 9.0.0
### Major Changes
- 10bdc295: Adjusts `large` Button height from 45px to 48px
### Patch Changes
- Updated dependencies [c9a0d89f]
- Updated dependencies [9ee1d5fc]
- @leafygreen-ui/palette@3.1.0
- @leafygreen-ui/lib@6.1.1
- @leafygreen-ui/leafygreen-provider@2.0.2
## 8.0.1

@@ -4,0 +18,0 @@

2

dist/esm/index.js

@@ -1,2 +0,2 @@

import n from"react";import e from"prop-types";import{css as r,cx as t}from"@leafygreen-ui/emotion";import{uiColors as o}from"@leafygreen-ui/palette";import{useUsingKeyboardContext as a}from"@leafygreen-ui/leafygreen-provider";import{transparentize as i}from"polished";import c from"@leafygreen-ui/box";function l(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function u(){return(u=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n}).apply(this,arguments)}function d(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function s(n,e){if(null==n)return{};var r,t,o=function(n,e){if(null==n)return{};var r,t,o={},a=Object.keys(n);for(t=0;t<a.length;t++)r=a[t],e.indexOf(r)>=0||(o[r]=n[r]);return o}(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(t=0;t<a.length;t++)r=a[t],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(o[r]=n[r])}return o}function g(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var f,b,p,h;function x(){var n=g(["\n // Usually for this to take effect, you would need the element to be\n /* ￿positioned￿. Due to an obscure part of CSS spec, flex children */\n // respect z-index without the position property being set.\n //\n // https://www.w3.org/TR/css-flexbox-1/#painting\n z-index: 1;\n display: inline-flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n "]);return x=function(){return n},n}function m(){var n=g(["\n color: ",";\n border-color: ",";\n background-color: ",";\n background-image: none;\n box-shadow: none;\n pointer-events: none;\n"]);return m=function(){return n},n}function y(){var n=g(["\n position: relative;\n // Establishes the root element as a new stacking context\n // so that the z-index of the span within the button doesn't\n // appear above other elements on the page that it shouldn't.\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n align-items: stretch;\n font-family: Akzidenz, 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: normal;\n text-decoration: none;\n text-transform: none;\n transition: all 120ms ease;\n user-select: none;\n padding: 0;\n\n &:hover {\n text-decoration: none;\n }\n\n // We're using CSS pseudo elements here in order to\n // transition the gradients between button pseudo classes.\n &:before,\n &:after {\n content: '';\n transition: 0.15s opacity ease-in-out;\n opacity: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover {\n &:before {\n opacity: 1;\n }\n }\n\n &:active:after {\n opacity: 1;\n }\n }\n"]);return y=function(){return n},n}function k(){var n=g(["\n &:focus {\n text-decoration: none;\n\n &:not(:disabled):before {\n opacity: 1;\n }\n }\n"]);return k=function(){return n},n}function v(){var n=g(["\n margin-right: 8px;\n "]);return v=function(){return n},n}function w(){var n=g(["\n margin-right: 5px;\n "]);return w=function(){return n},n}function O(){var n=g(["\n margin-right: 4px;\n "]);return O=function(){return n},n}function j(){var n=g(["\n margin-right: 2px;\n "]);return j=function(){return n},n}function z(){var n=g(["\n padding: 0 20px;\n "]);return z=function(){return n},n}function S(){var n=g(["\n padding: 0 12px;\n "]);return S=function(){return n},n}function P(){var n=g(["\n padding: 0 10px;\n "]);return P=function(){return n},n}function N(){var n=g(["\n padding: 0 8px;\n "]);return N=function(){return n},n}function D(){var n=g(["\n height: 45px;\n font-size: 16px;\n "]);return D=function(){return n},n}function E(){var n=g(["\n height: 32px;\n font-size: 14px;\n "]);return E=function(){return n},n}function L(){var n=g(["\n height: 25px;\n font-size: 14px;\n "]);return L=function(){return n},n}function T(){var n=g(["\n height: 22px;\n font-size: 11px;\n text-transform: uppercase;\n font-weight: bold;\n "]);return T=function(){return n},n}function X(){var n=g(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return X=function(){return n},n}function I(){var n=g(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(#e45b26, #b63016);\n box-shadow: inset 0 -1px 0 0 ",";\n\n &:before {\n background-color: ",";\n background-image: linear-gradient(#e45b26, ",");\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#ad231b, #e45b26);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return I=function(){return n},n}function A(){var n=g(["\n color: ",";\n background-color: transparent;\n background-image: none;\n border: 1px solid ",";\n box-shadow: none;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover,\n &:active {\n border-color: #158242;\n color: ",";\n }\n }\n "]);return A=function(){return n},n}function C(){var n=g(["\n color: ",";\n border: 1px solid #158242;\n background-color: ",";\n background-image: linear-gradient(",", #18964c);\n box-shadow: inset 0 -1px 0 #158242;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return C=function(){return n},n}function H(){var n=g(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(",", #dde4e2);\n box-shadow: inset 0 -1px 0 ",",\n 0 1px 4px ",";\n }\n\n &:after {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(#dde4e2, ",");\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return H=function(){return n},n}var R={Default:"default",Primary:"primary",Info:"info",Danger:"danger",Dark:"dark"},B={XSmall:"xsmall",Small:"small",Normal:"normal",Large:"large"},K=(l(f={},R.Default,r(H(),o.gray.dark2,o.gray.light1,o.gray.light3,o.white,o.gray.light2,o.gray.light1,o.gray.light1,o.gray.light2,o.gray.light3,o.gray.light1,i(.9,o.black),o.gray.light1,o.gray.light3,o.gray.light3,i(.9,o.black),o.gray.dark2)),l(f,R.Primary,r(C(),o.white,o.green.base,o.green.base,i(.9,o.black),o.green.base,o.green.dark2,o.white)),l(f,R.Info,r(A(),o.green.base,o.green.base,i(.9,o.black),o.green.base,o.green.dark2,o.white)),l(f,R.Danger,r(I(),o.white,o.red.dark2,o.red.base,o.red.dark2,o.red.dark2,o.red.dark2,i(.9,o.black),o.red.dark2,o.red.dark2,o.red.dark2,o.white)),l(f,R.Dark,r(X(),o.white,o.gray.dark2,o.gray.dark1,o.gray.base,o.gray.dark1,o.gray.dark2,o.gray.base,o.gray.dark2,i(.9,o.black),o.gray.dark2,o.gray.dark1,o.gray.base,o.gray.dark2,o.white)),f),U=(l(b={},B.XSmall,r(T())),l(b,B.Small,r(L())),l(b,B.Normal,r(E())),l(b,B.Large,r(D())),b),W=(l(p={},B.XSmall,r(N())),l(p,B.Small,r(P())),l(p,B.Normal,r(S())),l(p,B.Large,r(z())),p),q=(l(h={},B.XSmall,r(j())),l(h,B.Small,r(O())),l(h,B.Normal,r(w())),l(h,B.Large,r(v())),h),F=r(k()),G=r(y()),J=r(m(),o.gray.base,o.gray.light1,o.gray.light2),M=n.forwardRef((function(e,o){var i=e.className,g=e.children,f=e.disabled,b=void 0!==f&&f,p=e.variant,h=void 0===p?R.Default:p,m=e.size,y=void 0===m?B.Normal:m,k=e.glyph,v=s(e,["className","children","disabled","variant","size","glyph"]),w=a().usingKeyboard,O=function(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){l(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({ref:o,className:t(G,U[y],K[h],l({},J,b),l({},F,w),i)},"string"!=typeof v.href&&{disabled:b},{"aria-disabled":b}),j=r(x()),z=k&&g?n.cloneElement(k,{className:t(l({},q[y],null!=k))}):k,S=n.createElement("span",{className:t(j,W[y])},z,g);return"string"==typeof v.href?n.createElement(c,u({as:"a"},O,v),S):n.createElement(c,u({as:"button",type:"button"},O,v),S)}));M.displayName="Button",M.propTypes={variant:e.oneOf(Object.values(R)),size:e.oneOf(Object.values(B)),className:e.string,children:e.node,disabled:e.bool,as:e.oneOfType([e.element,e.elementType,e.func]),href:e.string,glyph:e.element};export default M;export{B as Size,R as Variant};
import n from"react";import e from"prop-types";import{css as r,cx as t}from"@leafygreen-ui/emotion";import{uiColors as o}from"@leafygreen-ui/palette";import{useUsingKeyboardContext as a}from"@leafygreen-ui/leafygreen-provider";import{transparentize as i}from"polished";import c from"@leafygreen-ui/box";function l(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function u(){return(u=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n}).apply(this,arguments)}function d(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function s(n,e){if(null==n)return{};var r,t,o=function(n,e){if(null==n)return{};var r,t,o={},a=Object.keys(n);for(t=0;t<a.length;t++)r=a[t],e.indexOf(r)>=0||(o[r]=n[r]);return o}(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(t=0;t<a.length;t++)r=a[t],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(o[r]=n[r])}return o}function g(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var f,b,p,h;function x(){var n=g(["\n // Usually for this to take effect, you would need the element to be\n /* ￿positioned￿. Due to an obscure part of CSS spec, flex children */\n // respect z-index without the position property being set.\n //\n // https://www.w3.org/TR/css-flexbox-1/#painting\n z-index: 1;\n display: inline-flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n "]);return x=function(){return n},n}function m(){var n=g(["\n color: ",";\n border-color: ",";\n background-color: ",";\n background-image: none;\n box-shadow: none;\n pointer-events: none;\n"]);return m=function(){return n},n}function y(){var n=g(["\n position: relative;\n // Establishes the root element as a new stacking context\n // so that the z-index of the span within the button doesn't\n // appear above other elements on the page that it shouldn't.\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n align-items: stretch;\n font-family: Akzidenz, 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: normal;\n text-decoration: none;\n text-transform: none;\n transition: all 120ms ease;\n user-select: none;\n padding: 0;\n\n &:hover {\n text-decoration: none;\n }\n\n // We're using CSS pseudo elements here in order to\n // transition the gradients between button pseudo classes.\n &:before,\n &:after {\n content: '';\n transition: 0.15s opacity ease-in-out;\n opacity: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover {\n &:before {\n opacity: 1;\n }\n }\n\n &:active:after {\n opacity: 1;\n }\n }\n"]);return y=function(){return n},n}function k(){var n=g(["\n &:focus {\n text-decoration: none;\n\n &:not(:disabled):before {\n opacity: 1;\n }\n }\n"]);return k=function(){return n},n}function v(){var n=g(["\n margin-right: 8px;\n "]);return v=function(){return n},n}function w(){var n=g(["\n margin-right: 5px;\n "]);return w=function(){return n},n}function O(){var n=g(["\n margin-right: 4px;\n "]);return O=function(){return n},n}function j(){var n=g(["\n margin-right: 2px;\n "]);return j=function(){return n},n}function z(){var n=g(["\n padding: 0 20px;\n "]);return z=function(){return n},n}function S(){var n=g(["\n padding: 0 12px;\n "]);return S=function(){return n},n}function P(){var n=g(["\n padding: 0 10px;\n "]);return P=function(){return n},n}function N(){var n=g(["\n padding: 0 8px;\n "]);return N=function(){return n},n}function D(){var n=g(["\n height: 48px;\n font-size: 16px;\n "]);return D=function(){return n},n}function E(){var n=g(["\n height: 32px;\n font-size: 14px;\n "]);return E=function(){return n},n}function L(){var n=g(["\n height: 25px;\n font-size: 14px;\n "]);return L=function(){return n},n}function T(){var n=g(["\n height: 22px;\n font-size: 11px;\n text-transform: uppercase;\n font-weight: bold;\n "]);return T=function(){return n},n}function X(){var n=g(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return X=function(){return n},n}function I(){var n=g(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(#e45b26, #b63016);\n box-shadow: inset 0 -1px 0 0 ",";\n\n &:before {\n background-color: ",";\n background-image: linear-gradient(#e45b26, ",");\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#ad231b, #e45b26);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return I=function(){return n},n}function A(){var n=g(["\n color: ",";\n background-color: transparent;\n background-image: none;\n border: 1px solid ",";\n box-shadow: none;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover,\n &:active {\n border-color: #158242;\n color: ",";\n }\n }\n "]);return A=function(){return n},n}function C(){var n=g(["\n color: ",";\n border: 1px solid #158242;\n background-color: ",";\n background-image: linear-gradient(",", #18964c);\n box-shadow: inset 0 -1px 0 #158242;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return C=function(){return n},n}function H(){var n=g(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(",", #dde4e2);\n box-shadow: inset 0 -1px 0 ",",\n 0 1px 4px ",";\n }\n\n &:after {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(#dde4e2, ",");\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return H=function(){return n},n}var R={Default:"default",Primary:"primary",Info:"info",Danger:"danger",Dark:"dark"},B={XSmall:"xsmall",Small:"small",Normal:"normal",Large:"large"},K=(l(f={},R.Default,r(H(),o.gray.dark2,o.gray.light1,o.gray.light3,o.white,o.gray.light2,o.gray.light1,o.gray.light1,o.gray.light2,o.gray.light3,o.gray.light1,i(.9,o.black),o.gray.light1,o.gray.light3,o.gray.light3,i(.9,o.black),o.gray.dark2)),l(f,R.Primary,r(C(),o.white,o.green.base,o.green.base,i(.9,o.black),o.green.base,o.green.dark2,o.white)),l(f,R.Info,r(A(),o.green.base,o.green.base,i(.9,o.black),o.green.base,o.green.dark2,o.white)),l(f,R.Danger,r(I(),o.white,o.red.dark2,o.red.base,o.red.dark2,o.red.dark2,o.red.dark2,i(.9,o.black),o.red.dark2,o.red.dark2,o.red.dark2,o.white)),l(f,R.Dark,r(X(),o.white,o.gray.dark2,o.gray.dark1,o.gray.base,o.gray.dark1,o.gray.dark2,o.gray.base,o.gray.dark2,i(.9,o.black),o.gray.dark2,o.gray.dark1,o.gray.base,o.gray.dark2,o.white)),f),U=(l(b={},B.XSmall,r(T())),l(b,B.Small,r(L())),l(b,B.Normal,r(E())),l(b,B.Large,r(D())),b),W=(l(p={},B.XSmall,r(N())),l(p,B.Small,r(P())),l(p,B.Normal,r(S())),l(p,B.Large,r(z())),p),q=(l(h={},B.XSmall,r(j())),l(h,B.Small,r(O())),l(h,B.Normal,r(w())),l(h,B.Large,r(v())),h),F=r(k()),G=r(y()),J=r(m(),o.gray.base,o.gray.light1,o.gray.light2),M=n.forwardRef((function(e,o){var i=e.className,g=e.children,f=e.disabled,b=void 0!==f&&f,p=e.variant,h=void 0===p?R.Default:p,m=e.size,y=void 0===m?B.Normal:m,k=e.glyph,v=s(e,["className","children","disabled","variant","size","glyph"]),w=a().usingKeyboard,O=function(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){l(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({ref:o,className:t(G,U[y],K[h],l({},J,b),l({},F,w),i)},"string"!=typeof v.href&&{disabled:b},{"aria-disabled":b}),j=r(x()),z=k&&g?n.cloneElement(k,{className:t(l({},q[y],null!=k))}):k,S=n.createElement("span",{className:t(j,W[y])},z,g);return"string"==typeof v.href?n.createElement(c,u({as:"a"},O,v),S):n.createElement(c,u({as:"button",type:"button"},O,v),S)}));M.displayName="Button",M.propTypes={variant:e.oneOf(Object.values(R)),size:e.oneOf(Object.values(B)),className:e.string,children:e.node,disabled:e.bool,as:e.oneOfType([e.element,e.elementType,e.func]),href:e.string,glyph:e.element};export default M;export{B as Size,R as Variant};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/leafygreen-provider"),require("polished"),require("@leafygreen-ui/box")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@leafygreen-ui/emotion","@leafygreen-ui/palette","@leafygreen-ui/leafygreen-provider","polished","@leafygreen-ui/box"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self)["@leafygreen-ui/button"]={},n.React,n.PropTypes,n["@leafygreen-ui/emotion"],n["@leafygreen-ui/palette"],n["@leafygreen-ui/leafygreen-provider"],n.polished,n["@leafygreen-ui/box"])}(this,(function(n,e,r,o,t,a,i,l){"use strict";function u(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var s,c,d,f,g=u(e),p=u(r),b=u(l);function h(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function y(){return(y=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n}).apply(this,arguments)}function x(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,o)}return r}function m(n,e){if(null==n)return{};var r,o,t=function(n,e){if(null==n)return{};var r,o,t={},a=Object.keys(n);for(o=0;o<a.length;o++)r=a[o],e.indexOf(r)>=0||(t[r]=n[r]);return t}(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)r=a[o],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function k(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}function v(){var n=k(["\n // Usually for this to take effect, you would need the element to be\n /* ￿positioned￿. Due to an obscure part of CSS spec, flex children */\n // respect z-index without the position property being set.\n //\n // https://www.w3.org/TR/css-flexbox-1/#painting\n z-index: 1;\n display: inline-flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n "]);return v=function(){return n},n}function C(){var n=k(["\n color: ",";\n border-color: ",";\n background-color: ",";\n background-image: none;\n box-shadow: none;\n pointer-events: none;\n"]);return C=function(){return n},n}function w(){var n=k(["\n position: relative;\n // Establishes the root element as a new stacking context\n // so that the z-index of the span within the button doesn't\n // appear above other elements on the page that it shouldn't.\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n align-items: stretch;\n font-family: Akzidenz, 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: normal;\n text-decoration: none;\n text-transform: none;\n transition: all 120ms ease;\n user-select: none;\n padding: 0;\n\n &:hover {\n text-decoration: none;\n }\n\n // We're using CSS pseudo elements here in order to\n // transition the gradients between button pseudo classes.\n &:before,\n &:after {\n content: '';\n transition: 0.15s opacity ease-in-out;\n opacity: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover {\n &:before {\n opacity: 1;\n }\n }\n\n &:active:after {\n opacity: 1;\n }\n }\n"]);return w=function(){return n},n}function O(){var n=k(["\n &:focus {\n text-decoration: none;\n\n &:not(:disabled):before {\n opacity: 1;\n }\n }\n"]);return O=function(){return n},n}function j(){var n=k(["\n margin-right: 8px;\n "]);return j=function(){return n},n}function z(){var n=k(["\n margin-right: 5px;\n "]);return z=function(){return n},n}function P(){var n=k(["\n margin-right: 4px;\n "]);return P=function(){return n},n}function S(){var n=k(["\n margin-right: 2px;\n "]);return S=function(){return n},n}function N(){var n=k(["\n padding: 0 20px;\n "]);return N=function(){return n},n}function D(){var n=k(["\n padding: 0 12px;\n "]);return D=function(){return n},n}function E(){var n=k(["\n padding: 0 10px;\n "]);return E=function(){return n},n}function q(){var n=k(["\n padding: 0 8px;\n "]);return q=function(){return n},n}function T(){var n=k(["\n height: 45px;\n font-size: 16px;\n "]);return T=function(){return n},n}function L(){var n=k(["\n height: 32px;\n font-size: 14px;\n "]);return L=function(){return n},n}function X(){var n=k(["\n height: 25px;\n font-size: 14px;\n "]);return X=function(){return n},n}function I(){var n=k(["\n height: 22px;\n font-size: 11px;\n text-transform: uppercase;\n font-weight: bold;\n "]);return I=function(){return n},n}function R(){var n=k(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return R=function(){return n},n}function A(){var n=k(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(#e45b26, #b63016);\n box-shadow: inset 0 -1px 0 0 ",";\n\n &:before {\n background-color: ",";\n background-image: linear-gradient(#e45b26, ",");\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#ad231b, #e45b26);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return A=function(){return n},n}function H(){var n=k(["\n color: ",";\n background-color: transparent;\n background-image: none;\n border: 1px solid ",";\n box-shadow: none;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover,\n &:active {\n border-color: #158242;\n color: ",";\n }\n }\n "]);return H=function(){return n},n}function K(){var n=k(["\n color: ",";\n border: 1px solid #158242;\n background-color: ",";\n background-image: linear-gradient(",", #18964c);\n box-shadow: inset 0 -1px 0 #158242;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return K=function(){return n},n}function U(){var n=k(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(",", #dde4e2);\n box-shadow: inset 0 -1px 0 ",",\n 0 1px 4px ",";\n }\n\n &:after {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(#dde4e2, ",");\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return U=function(){return n},n}var _={Default:"default",Primary:"primary",Info:"info",Danger:"danger",Dark:"dark"},B={XSmall:"xsmall",Small:"small",Normal:"normal",Large:"large"},M=(h(s={},_.Default,o.css(U(),t.uiColors.gray.dark2,t.uiColors.gray.light1,t.uiColors.gray.light3,t.uiColors.white,t.uiColors.gray.light2,t.uiColors.gray.light1,t.uiColors.gray.light1,t.uiColors.gray.light2,t.uiColors.gray.light3,t.uiColors.gray.light1,i.transparentize(.9,t.uiColors.black),t.uiColors.gray.light1,t.uiColors.gray.light3,t.uiColors.gray.light3,i.transparentize(.9,t.uiColors.black),t.uiColors.gray.dark2)),h(s,_.Primary,o.css(K(),t.uiColors.white,t.uiColors.green.base,t.uiColors.green.base,i.transparentize(.9,t.uiColors.black),t.uiColors.green.base,t.uiColors.green.dark2,t.uiColors.white)),h(s,_.Info,o.css(H(),t.uiColors.green.base,t.uiColors.green.base,i.transparentize(.9,t.uiColors.black),t.uiColors.green.base,t.uiColors.green.dark2,t.uiColors.white)),h(s,_.Danger,o.css(A(),t.uiColors.white,t.uiColors.red.dark2,t.uiColors.red.base,t.uiColors.red.dark2,t.uiColors.red.dark2,t.uiColors.red.dark2,i.transparentize(.9,t.uiColors.black),t.uiColors.red.dark2,t.uiColors.red.dark2,t.uiColors.red.dark2,t.uiColors.white)),h(s,_.Dark,o.css(R(),t.uiColors.white,t.uiColors.gray.dark2,t.uiColors.gray.dark1,t.uiColors.gray.base,t.uiColors.gray.dark1,t.uiColors.gray.dark2,t.uiColors.gray.base,t.uiColors.gray.dark2,i.transparentize(.9,t.uiColors.black),t.uiColors.gray.dark2,t.uiColors.gray.dark1,t.uiColors.gray.base,t.uiColors.gray.dark2,t.uiColors.white)),s),V=(h(c={},B.XSmall,o.css(I())),h(c,B.Small,o.css(X())),h(c,B.Normal,o.css(L())),h(c,B.Large,o.css(T())),c),W=(h(d={},B.XSmall,o.css(q())),h(d,B.Small,o.css(E())),h(d,B.Normal,o.css(D())),h(d,B.Large,o.css(N())),d),F=(h(f={},B.XSmall,o.css(S())),h(f,B.Small,o.css(P())),h(f,B.Normal,o.css(z())),h(f,B.Large,o.css(j())),f),G=o.css(O()),J=o.css(w()),Q=o.css(C(),t.uiColors.gray.base,t.uiColors.gray.light1,t.uiColors.gray.light2),Y=g.default.forwardRef((function(n,e){var r=n.className,t=n.children,i=n.disabled,l=void 0!==i&&i,u=n.variant,s=void 0===u?_.Default:u,c=n.size,d=void 0===c?B.Normal:c,f=n.glyph,p=m(n,["className","children","disabled","variant","size","glyph"]),k=a.useUsingKeyboardContext().usingKeyboard,C=function(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){h(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({ref:e,className:o.cx(J,V[d],M[s],h({},Q,l),h({},G,k),r)},"string"!=typeof p.href&&{disabled:l},{"aria-disabled":l}),w=o.css(v()),O=f&&t?g.default.cloneElement(f,{className:o.cx(h({},F[d],null!=f))}):f,j=g.default.createElement("span",{className:o.cx(w,W[d])},O,t);return"string"==typeof p.href?g.default.createElement(b.default,y({as:"a"},C,p),j):g.default.createElement(b.default,y({as:"button",type:"button"},C,p),j)}));Y.displayName="Button",Y.propTypes={variant:p.default.oneOf(Object.values(_)),size:p.default.oneOf(Object.values(B)),className:p.default.string,children:p.default.node,disabled:p.default.bool,as:p.default.oneOfType([p.default.element,p.default.elementType,p.default.func]),href:p.default.string,glyph:p.default.element},n.Size=B,n.Variant=_,n.default=Y,Object.defineProperty(n,"__esModule",{value:!0})}));
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/leafygreen-provider"),require("polished"),require("@leafygreen-ui/box")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@leafygreen-ui/emotion","@leafygreen-ui/palette","@leafygreen-ui/leafygreen-provider","polished","@leafygreen-ui/box"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self)["@leafygreen-ui/button"]={},n.React,n.PropTypes,n["@leafygreen-ui/emotion"],n["@leafygreen-ui/palette"],n["@leafygreen-ui/leafygreen-provider"],n.polished,n["@leafygreen-ui/box"])}(this,(function(n,e,r,o,t,a,i,l){"use strict";function u(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var s,c,d,f,g=u(e),p=u(r),b=u(l);function h(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function y(){return(y=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n}).apply(this,arguments)}function x(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,o)}return r}function m(n,e){if(null==n)return{};var r,o,t=function(n,e){if(null==n)return{};var r,o,t={},a=Object.keys(n);for(o=0;o<a.length;o++)r=a[o],e.indexOf(r)>=0||(t[r]=n[r]);return t}(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)r=a[o],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function k(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}function v(){var n=k(["\n // Usually for this to take effect, you would need the element to be\n /* ￿positioned￿. Due to an obscure part of CSS spec, flex children */\n // respect z-index without the position property being set.\n //\n // https://www.w3.org/TR/css-flexbox-1/#painting\n z-index: 1;\n display: inline-flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n "]);return v=function(){return n},n}function C(){var n=k(["\n color: ",";\n border-color: ",";\n background-color: ",";\n background-image: none;\n box-shadow: none;\n pointer-events: none;\n"]);return C=function(){return n},n}function w(){var n=k(["\n position: relative;\n // Establishes the root element as a new stacking context\n // so that the z-index of the span within the button doesn't\n // appear above other elements on the page that it shouldn't.\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n align-items: stretch;\n font-family: Akzidenz, 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: normal;\n text-decoration: none;\n text-transform: none;\n transition: all 120ms ease;\n user-select: none;\n padding: 0;\n\n &:hover {\n text-decoration: none;\n }\n\n // We're using CSS pseudo elements here in order to\n // transition the gradients between button pseudo classes.\n &:before,\n &:after {\n content: '';\n transition: 0.15s opacity ease-in-out;\n opacity: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover {\n &:before {\n opacity: 1;\n }\n }\n\n &:active:after {\n opacity: 1;\n }\n }\n"]);return w=function(){return n},n}function O(){var n=k(["\n &:focus {\n text-decoration: none;\n\n &:not(:disabled):before {\n opacity: 1;\n }\n }\n"]);return O=function(){return n},n}function j(){var n=k(["\n margin-right: 8px;\n "]);return j=function(){return n},n}function z(){var n=k(["\n margin-right: 5px;\n "]);return z=function(){return n},n}function P(){var n=k(["\n margin-right: 4px;\n "]);return P=function(){return n},n}function S(){var n=k(["\n margin-right: 2px;\n "]);return S=function(){return n},n}function N(){var n=k(["\n padding: 0 20px;\n "]);return N=function(){return n},n}function D(){var n=k(["\n padding: 0 12px;\n "]);return D=function(){return n},n}function E(){var n=k(["\n padding: 0 10px;\n "]);return E=function(){return n},n}function q(){var n=k(["\n padding: 0 8px;\n "]);return q=function(){return n},n}function T(){var n=k(["\n height: 48px;\n font-size: 16px;\n "]);return T=function(){return n},n}function L(){var n=k(["\n height: 32px;\n font-size: 14px;\n "]);return L=function(){return n},n}function X(){var n=k(["\n height: 25px;\n font-size: 14px;\n "]);return X=function(){return n},n}function I(){var n=k(["\n height: 22px;\n font-size: 11px;\n text-transform: uppercase;\n font-weight: bold;\n "]);return I=function(){return n},n}function R(){var n=k(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return R=function(){return n},n}function A(){var n=k(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(#e45b26, #b63016);\n box-shadow: inset 0 -1px 0 0 ",";\n\n &:before {\n background-color: ",";\n background-image: linear-gradient(#e45b26, ",");\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 ",";\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#ad231b, #e45b26);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return A=function(){return n},n}function H(){var n=k(["\n color: ",";\n background-color: transparent;\n background-image: none;\n border: 1px solid ",";\n box-shadow: none;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:not(:disabled) {\n &:focus,\n &:hover,\n &:active {\n border-color: #158242;\n color: ",";\n }\n }\n "]);return H=function(){return n},n}function K(){var n=k(["\n color: ",";\n border: 1px solid #158242;\n background-color: ",";\n background-image: linear-gradient(",", #18964c);\n box-shadow: inset 0 -1px 0 #158242;\n\n &:before {\n background-color: #129f4c;\n background-image: linear-gradient(#129f4c, #148040);\n box-shadow: 0 1px 4px ",",\n inset 0 -1px 0 #158242;\n }\n\n &:after {\n background-color: ",";\n background-image: linear-gradient(#148040, #129f4c);\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return K=function(){return n},n}function U(){var n=k(["\n color: ",";\n border: 1px solid ",";\n background-color: ",";\n background-image: linear-gradient(\n ",",\n ","\n );\n box-shadow: inset 0 -1px 0 ",";\n\n &:before {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(",", #dde4e2);\n box-shadow: inset 0 -1px 0 ",",\n 0 1px 4px ",";\n }\n\n &:after {\n border-color: ",";\n background-color: ",";\n background-image: linear-gradient(#dde4e2, ",");\n box-shadow: inset 0 2px 2px ",";\n }\n\n &:focus,\n &:hover {\n color: ",";\n }\n "]);return U=function(){return n},n}var _={Default:"default",Primary:"primary",Info:"info",Danger:"danger",Dark:"dark"},B={XSmall:"xsmall",Small:"small",Normal:"normal",Large:"large"},M=(h(s={},_.Default,o.css(U(),t.uiColors.gray.dark2,t.uiColors.gray.light1,t.uiColors.gray.light3,t.uiColors.white,t.uiColors.gray.light2,t.uiColors.gray.light1,t.uiColors.gray.light1,t.uiColors.gray.light2,t.uiColors.gray.light3,t.uiColors.gray.light1,i.transparentize(.9,t.uiColors.black),t.uiColors.gray.light1,t.uiColors.gray.light3,t.uiColors.gray.light3,i.transparentize(.9,t.uiColors.black),t.uiColors.gray.dark2)),h(s,_.Primary,o.css(K(),t.uiColors.white,t.uiColors.green.base,t.uiColors.green.base,i.transparentize(.9,t.uiColors.black),t.uiColors.green.base,t.uiColors.green.dark2,t.uiColors.white)),h(s,_.Info,o.css(H(),t.uiColors.green.base,t.uiColors.green.base,i.transparentize(.9,t.uiColors.black),t.uiColors.green.base,t.uiColors.green.dark2,t.uiColors.white)),h(s,_.Danger,o.css(A(),t.uiColors.white,t.uiColors.red.dark2,t.uiColors.red.base,t.uiColors.red.dark2,t.uiColors.red.dark2,t.uiColors.red.dark2,i.transparentize(.9,t.uiColors.black),t.uiColors.red.dark2,t.uiColors.red.dark2,t.uiColors.red.dark2,t.uiColors.white)),h(s,_.Dark,o.css(R(),t.uiColors.white,t.uiColors.gray.dark2,t.uiColors.gray.dark1,t.uiColors.gray.base,t.uiColors.gray.dark1,t.uiColors.gray.dark2,t.uiColors.gray.base,t.uiColors.gray.dark2,i.transparentize(.9,t.uiColors.black),t.uiColors.gray.dark2,t.uiColors.gray.dark1,t.uiColors.gray.base,t.uiColors.gray.dark2,t.uiColors.white)),s),V=(h(c={},B.XSmall,o.css(I())),h(c,B.Small,o.css(X())),h(c,B.Normal,o.css(L())),h(c,B.Large,o.css(T())),c),W=(h(d={},B.XSmall,o.css(q())),h(d,B.Small,o.css(E())),h(d,B.Normal,o.css(D())),h(d,B.Large,o.css(N())),d),F=(h(f={},B.XSmall,o.css(S())),h(f,B.Small,o.css(P())),h(f,B.Normal,o.css(z())),h(f,B.Large,o.css(j())),f),G=o.css(O()),J=o.css(w()),Q=o.css(C(),t.uiColors.gray.base,t.uiColors.gray.light1,t.uiColors.gray.light2),Y=g.default.forwardRef((function(n,e){var r=n.className,t=n.children,i=n.disabled,l=void 0!==i&&i,u=n.variant,s=void 0===u?_.Default:u,c=n.size,d=void 0===c?B.Normal:c,f=n.glyph,p=m(n,["className","children","disabled","variant","size","glyph"]),k=a.useUsingKeyboardContext().usingKeyboard,C=function(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){h(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}({ref:e,className:o.cx(J,V[d],M[s],h({},Q,l),h({},G,k),r)},"string"!=typeof p.href&&{disabled:l},{"aria-disabled":l}),w=o.css(v()),O=f&&t?g.default.cloneElement(f,{className:o.cx(h({},F[d],null!=f))}):f,j=g.default.createElement("span",{className:o.cx(w,W[d])},O,t);return"string"==typeof p.href?g.default.createElement(b.default,y({as:"a"},C,p),j):g.default.createElement(b.default,y({as:"button",type:"button"},C,p),j)}));Y.displayName="Button",Y.propTypes={variant:p.default.oneOf(Object.values(_)),size:p.default.oneOf(Object.values(B)),className:p.default.string,children:p.default.node,disabled:p.default.bool,as:p.default.oneOfType([p.default.element,p.default.elementType,p.default.func]),href:p.default.string,glyph:p.default.element},n.Size=B,n.Variant=_,n.default=Y,Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map
{
"name": "@leafygreen-ui/button",
"version": "8.0.1",
"version": "9.0.0",
"description": "leafyGreen UI Kit Button",

@@ -23,4 +23,4 @@ "main": "./dist/index.js",

"dependencies": {
"@leafygreen-ui/lib": "^6.0.1",
"@leafygreen-ui/palette": "^3.0.1",
"@leafygreen-ui/lib": "^6.1.1",
"@leafygreen-ui/palette": "^3.1.0",
"@leafygreen-ui/box": "^3.0.1",

@@ -33,5 +33,5 @@ "lodash": "^4.17.20"

"peerDependencies": {
"@leafygreen-ui/leafygreen-provider": "^2.0.1"
"@leafygreen-ui/leafygreen-provider": "^2.0.2"
},
"gitHead": "dd71a2d404218ccec2e657df9c0263dc1c15b9e0"
}

@@ -58,16 +58,16 @@ # Button

| Prop | Type | Description | Default |
| ----------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `variant` | `'default'`, `'primary'`, `'info'`, `'danger'`, `'dark'` | Sets the style variant of the button. | `'default'` |
| `size` | `'xsmall'`, `'small'`, `'normal'`, `'large'` | Sets the size variant of the button. | `'normal'` |
| `children` | `node` | The content that will appear inside of the `<Button />` component. | `null` |
| `onClick` | `function` | The event handler function for the 'onclick' event. Receives the associated `event` object as the first argument. | |
| `className` | `string` | Adds a className to the class attribute. | `''` |
| `value` | `string` | Sets the HTML `value` attribute. | |
| `disabled` | `boolean` | Disabled the button | `false` |
| `as` | `React.ElementType` | Determines the root element. For example, `Link` or `a` tags can be supplied to replace `button` from being the DOM element that wraps the component. | `button` |
| `href` | `string` | If a href is supplied it will change the `as` value, such that the component renders inside of an `a` tag instead of inside of a `button` tag. | |
| Prop | Type | Description | Default |
| ----------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| `variant` | `'default'` \| `'primary'` \| `'info'` \| `'danger'` \| `'dark'` | Sets the style variant of the button. | `'default'` |
| `size` | `'xsmall'` \| `'small'` \| `'normal'` \| `'large'` | Sets the size variant of the button. | `'normal'` |
| `children` | `node` | The content that will appear inside of the `<Button />` component. | `null` |
| `onClick` | `function` | The event handler function for the 'onclick' event. Receives the associated `event` object as the first argument. | |
| `className` | `string` | Adds a className to the class attribute. | `''` |
| `value` | `string` | Sets the HTML `value` attribute. | |
| `disabled` | `boolean` | Disabled the button | `false` |
| `as` | `React.ElementType` | Determines the root element. For example, `Link` or `a` tags can be supplied to replace `button` from being the DOM element that wraps the component. | `button` |
| `href` | `string` | If a href is supplied it will change the `as` value, such that the component renders inside of an `a` tag instead of inside of a `button` tag. | |
| `glyph` | `React.ReactElement` | When supplied a rendered Icon, renders a button with the specified glyph on the left-side of the content, and adjusts Button padding accordingly. | |
| ... | `React.ComponentPropsWithRef<[as]>` | Any other properties will be spread on the root element | |
_Any other properties will be spread on the input element._
Note: In order to make this Component act as a submit button, the recommended approach is to pass `submit` as the `type` prop. Note it is also valid to pass `input` to the `as` prop, and the button's content's to the `value` prop -- in this case, do not supply children to the component.
_Note: In order to make this Component act as a submit button, the recommended approach is to pass `submit` as the `type` prop. Note it is also valid to pass `input` to the `as` prop, and the button's content's to the `value` prop -- in this case, do not supply children to the component._

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc