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
3
Versions
120
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 13.0.0 to 13.0.1

6

CHANGELOG.md
# @leafygreen-ui/button
## 13.0.1
### Patch Changes
- 686ecae: Disabling onClicks for Button components when as="a"
## 13.0.0

@@ -4,0 +10,0 @@

2

dist/esm/index.js

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

import n,{useRef as r,useEffect as e}from"react";import o from"prop-types";import a from"@leafygreen-ui/box";import{css as t,cx as l}from"@leafygreen-ui/emotion";import{registerRipple as i}from"@leafygreen-ui/ripple";import{useUsingKeyboardContext as c}from"@leafygreen-ui/leafygreen-provider";import{transparentize as d}from"polished";import{palette as s,uiColors as g}from"@leafygreen-ui/palette";import{fontFamilies as p}from"@leafygreen-ui/tokens";import{createDataProp as u}from"@leafygreen-ui/lib";import{jsx as b}from"@emotion/react";function h(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,o)}return e}function f(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?h(Object(e),!0).forEach((function(r){x(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):h(Object(e)).forEach((function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))}))}return n}function x(n,r,e){return r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function y(){return(y=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n}).apply(this,arguments)}function m(n,r){if(null==n)return{};var e,o,a=function(n,r){if(null==n)return{};var e,o,a={},t=Object.keys(n);for(o=0;o<t.length;o++)e=t[o],r.indexOf(e)>=0||(a[e]=n[e]);return a}(n,r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);for(o=0;o<t.length;o++)e=t[o],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(a[e]=n[e])}return a}function k(n,r){return r||(r=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(r)}}))}var w,v,O,D,P,j,z,G,S,B,N,F,M,q,E,I,L,X,C,R,T,Y,A,K,H,J,Q,U,V,W,Z,$,_,nn,rn,en,on,an,tn,ln,cn,dn,sn,gn,pn,un,bn,hn,fn,xn,yn={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},mn={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},kn="light",wn="dark",vn=function(n){return"\n 0 0 0 2px ".concat(n,", \n 0 0 0 4px ").concat(s.blue.light1,";\n")},On=t(w||(w=k(["\n // unset browser default\n appearance: none;\n padding: 0;\n margin: 0;\n background-color: transparent;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: stretch;\n transition: all 150ms ease-in-out;\n position: relative;\n text-decoration: none;\n cursor: pointer;\n z-index: 0;\n font-family: ",";\n border-radius: 6px;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n pointer-events: none;\n }\n\n &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),p.default),Dn=(x(I={},kn,(x(G={},yn.Default,t(v||(v=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),s.gray.light3,s.gray.base,s.gray.dark3,s.white,s.gray.light2)),x(G,yn.Primary,t(O||(O=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #00593f; // Not quite dark3\n border-color: #00593f; // Not quite dark3\n box-shadow: 0 0 0 3px ",";\n }\n "])),s.green.dark2,s.green.dark2,s.white,s.white,s.green.light2)),x(G,yn.PrimaryOutline,t(D||(D=k(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.green.dark2,s.green.dark2,d(.96,s.green.base),s.green.light2)),x(G,yn.Danger,t(P||(P=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #c82222; // not quite dark1\n border-color: #c82222; // not quite dark1\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.red.base,s.red.base,s.white,s.white,s.red.light3)),x(G,yn.DangerOutline,t(j||(j=k(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.red.light1,s.red.base,s.red.dark2,d(.96,s.red.base),s.red.base,g.red.light3)),x(G,yn.BaseGreen,t(z||(z=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.green.base,s.green.dark2,s.green.dark3,s.green.light2)),G)),x(I,wn,(x(E={},yn.Primary,t(S||(S=k(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.green.dark2,g.green.base,g.white,g.white,g.white,g.green.dark1,g.green.dark2)),x(E,yn.PrimaryOutline,t(B||(B=k(["\n border: 1px solid ",";\n color: #0ad05b;\n\n &:focus {\n color: #0ad05b;\n }\n\n &:hover,\n &:active {\n color: #0ad05b;\n background-color: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.green.base,g.green.base,g.green.dark2)),x(E,yn.Default,t(N||(N=k(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.gray.dark2,g.gray.base,g.white,g.white,g.white,g.gray.dark1,g.gray.base,g.gray.dark2)),x(E,yn.Danger,t(F||(F=k(["\n background-color: ",";\n border: 1px solid #f97216;\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.red.dark1,g.white,g.white,g.white,g.red.base,g.red.dark2)),x(E,yn.DangerOutline,t(M||(M=k(["\n border: 1px solid #f97216;\n color: #f97216;\n\n &:focus {\n color: #f97216;\n }\n\n &:hover,\n &:active {\n color: #f97216;\n background: rgba(249, 114, 22, 0.08);\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.red.dark2)),x(E,yn.BaseGreen,t(q||(q=k(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.green.dark2,g.green.base,g.white,g.white,g.white,g.green.dark1,g.green.dark2)),E)),I),Pn=(x(Z={},kn,(x(A={},yn.Default,t(L||(L=k(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),s.white,vn(s.white))),x(A,yn.Primary,t(X||(X=k(["\n &:focus {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),s.white,vn(s.white))),x(A,yn.PrimaryOutline,t(C||(C=k(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),d(.96,s.green.base),vn(s.white))),x(A,yn.Danger,t(R||(R=k(["\n &:focus {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),s.white,vn(s.white))),x(A,yn.DangerOutline,t(T||(T=k(["\n &:focus {\n color: ",";\n box-shadow: ",";\n }\n "])),g.red.dark2,vn(s.white))),x(A,yn.BaseGreen,t(Y||(Y=k(["\n &:focus {\n box-shadow: ",";\n }\n "])),vn(s.white))),A)),x(Z,wn,(x(W={},yn.Primary,t(K||(K=k(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),g.green.dark1,g.focus)),x(W,yn.PrimaryOutline,t(H||(H=k(["\n &:focus {\n background: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px #139fd7;\n }\n "])),g.green.dark1)),x(W,yn.Default,t(J||(J=k(["\n &:focus {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px #2f9fc5;\n }\n "])),g.gray.dark1)),x(W,yn.Danger,t(Q||(Q=k(["\n &:focus {\n background: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.red.base,g.focus)),x(W,yn.DangerOutline,t(U||(U=k(["\n &:focus {\n background: rgba(249, 114, 22, 0.08);\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px #019ee2;\n }\n "])))),x(W,yn.BaseGreen,t(V||(V=k(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),g.green.dark1,g.focus)),W)),Z),jn=(x(nn={},kn,t($||($=k(["\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n\n &:hover {\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n "])),s.gray.light2,s.gray.light1,s.gray.base,s.gray.light2,s.gray.light1,s.gray.base)),x(nn,wn,t(_||(_=k(["\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n\n &:hover {\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n }\n "])),g.gray.dark2,g.gray.base,g.gray.dark2,g.gray.base)),nn),zn=(x(tn={},mn.XSmall,t(rn||(rn=k(["\n height: 22px;\n text-transform: uppercase;\n font-size: 12px;\n line-height: 1em;\n font-weight: bold;\n letter-spacing: 0.4px;\n "])))),x(tn,mn.Small,t(en||(en=k(["\n height: 28px;\n "])))),x(tn,mn.Default,t(on||(on=k(["\n height: 36px;\n "])))),x(tn,mn.Large,t(an||(an=k(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),tn),Gn=(x(un={},kn,(x(dn={},14,t(ln||(ln=k(["\n font-size: 13px;\n font-weight: 500;\n "])))),x(dn,16,t(cn||(cn=k(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500;\n "])))),dn)),x(un,wn,(x(pn={},14,t(sn||(sn=k(["\n font-size: 14px;\n "])))),x(pn,16,t(gn||(gn=k(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n "])))),pn)),un),Sn=u("button");var Bn,Nn,Fn,Mn,qn,En,In,Ln,Xn,Cn,Rn,Tn,Yn,An,Kn,Hn,Jn,Qn,Un,Vn,Wn,Zn,$n,_n,nr,rr,er,or,ar,tr,lr,ir,cr,dr,sr,gr,pr,ur,br,hr,fr="#0AD05B",xr="#F97216",yr=(x(xn={},kn,(x(hn={},yn.Primary,s.green.dark1),x(hn,yn.PrimaryOutline,d(.76,s.green.base)),x(hn,yn.Default,s.gray.light2),x(hn,yn.Danger,s.red.light1),x(hn,yn.DangerOutline,d(.76,s.red.base)),x(hn,yn.BaseGreen,s.green.light1),hn)),x(xn,wn,(x(fn={},yn.Primary,fr),x(fn,yn.PrimaryOutline,d(.76,g.green.base)),x(fn,yn.Default,g.gray.base),x(fn,yn.Danger,xr),x(fn,yn.DangerOutline,d(.76,xr)),x(fn,yn.BaseGreen,fr),fn)),xn),mr=(x(Kn={},kn,(x(In={},yn.Default,t(Bn||(Bn=k(["\n color: ",";\n "])),s.gray.base)),x(In,yn.Primary,t(Nn||(Nn=k(["\n color: ",";\n "])),s.green.light2)),x(In,yn.PrimaryOutline,t(Fn||(Fn=k(["\n color: ",";\n "])),s.green.dark2)),x(In,yn.Danger,t(Mn||(Mn=k(["\n color: ",";\n "])),s.red.light3)),x(In,yn.DangerOutline,t(qn||(qn=k(["\n color: ",";\n "])),s.red.light1)),x(In,yn.BaseGreen,t(En||(En=k(["\n color: ",";\n "])),s.green.dark2)),In)),x(Kn,wn,(x(An={},yn.Primary,t(Ln||(Ln=k(["\n color: ",";\n "])),g.green.light2)),x(An,yn.PrimaryOutline,t(Xn||(Xn=k(["\n color: #13aa52;\n "])))),x(An,yn.Default,t(Cn||(Cn=k(["\n color: ",";\n "])),g.gray.light1)),x(An,yn.Danger,t(Rn||(Rn=k(["\n color: ",";\n "])),g.red.light3)),x(An,yn.DangerOutline,t(Tn||(Tn=k(["\n color: #f97216;\n "])))),x(An,yn.BaseGreen,t(Yn||(Yn=k(["\n color: ",";\n "])),g.gray.light1)),An)),Kn),kr=(x(tr={},kn,(x(Zn={},yn.Default,t(Hn||(Hn=k(["\n color: ",";\n "])),s.gray.dark1)),x(Zn,yn.Primary,t(Jn||(Jn=k(["\n color: ",";\n "])),s.green.light3)),x(Zn,yn.PrimaryOutline,t(Qn||(Qn=k(["\n color: ",";\n "])),s.green.dark2)),x(Zn,yn.Danger,t(Un||(Un=k(["\n color: ",";\n "])),s.red.light3)),x(Zn,yn.DangerOutline,t(Vn||(Vn=k(["\n color: ",";\n "])),s.red.light1)),x(Zn,yn.BaseGreen,t(Wn||(Wn=k(["\n color: ",";\n "])),s.green.dark2)),Zn)),x(tr,wn,(x(ar={},yn.Primary,t($n||($n=k(["\n color: ",";\n "])),g.white)),x(ar,yn.PrimaryOutline,t(_n||(_n=k(["\n color: #0ad05b;\n "])))),x(ar,yn.Default,t(nr||(nr=k(["\n color: ",";\n "])),g.white)),x(ar,yn.Danger,t(rr||(rr=k(["\n color: ",";\n "])),g.white)),x(ar,yn.DangerOutline,t(er||(er=k(["\n color: #f97216;\n "])))),x(ar,yn.BaseGreen,t(or||(or=k(["\n color: ",";\n "])),g.gray.light1)),ar)),tr),wr=t(lr||(lr=k(["\n ",":hover &,\n ",":active & {\n color: currentColor;\n } ;\n"])),Sn.selector,Sn.selector),vr=(x(gr={},mn.XSmall,t(ir||(ir=k(["\n height: 14px;\n width: 14px;\n "])))),x(gr,mn.Small,t(cr||(cr=k(["\n height: 16px;\n width: 16px;\n "])))),x(gr,mn.Default,t(dr||(dr=k(["\n height: 16px;\n width: 16px;\n "])))),x(gr,mn.Large,t(sr||(sr=k(["\n height: 20px;\n width: 20px;\n "])))),gr),Or=(x(br={},kn,t(pr||(pr=k(["\n color: ",";\n "])),s.gray.light2)),x(br,wn,t(ur||(ur=k(["\n color: ",";\n "])),g.gray.dark1)),br),Dr=t(hr||(hr=k(["\n color: ",";\n"])),s.gray.light1);function Pr(r){var e,o=r.glyph,a=r.variant,t=r.size,i=r.darkMode,c=r.disabled,d=r.isIconOnlyButton,s=r.className,g=!d&&{"aria-hidden":!0,role:"presentation"},p=i?wn:kn,u=d?kr:mr;return n.cloneElement(o,f({className:l(u[p][a],vr[t],(e={},x(e,Or[p],c),x(e,wr,d),x(e,Dr,!i&&c&&d),e),s)},g))}Pr.displayName="ButtonIcon";var jr,zr,Gr,Sr,Br,Nr,Fr,Mr,qr,Er,Ir,Lr,Xr=["variant","size","darkMode","baseFontSize","disabled","leftGlyph","rightGlyph","children","className"],Cr=t(jr||(jr=k(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 6px;\n"]))),Rr=t(zr||(zr=k(["\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n pointer-events: none;\n position: relative;\n z-index: 0;\n"]))),Tr=(x(Fr={},mn.XSmall,t(Gr||(Gr=k(["\n padding: 0 8px;\n gap: 6px;\n "])))),x(Fr,mn.Small,t(Sr||(Sr=k(["\n padding: 0 12px;\n gap: 6px;\n "])))),x(Fr,mn.Default,t(Br||(Br=k(["\n padding: 0 12px;\n gap: 6px;\n "])))),x(Fr,mn.Large,t(Nr||(Nr=k(["\n padding: 0 16px;\n gap: 8px;\n "])))),Fr),Yr=n.forwardRef((function(o,d){var s,g,u=o.variant,h=void 0===u?yn.Default:u,w=o.size,v=void 0===w?mn.Default:w,O=o.darkMode,D=void 0!==O&&O,P=o.baseFontSize,j=void 0===P?14:P,z=o.disabled,G=void 0!==z&&z,S=o.leftGlyph,B=o.rightGlyph,N=o.children,F=o.className,M=m(o,Xr),q=c().usingKeyboard,E=r(null);e((function(){var n,r=yr[D?wn:kn][h];return null!=E.current&&(n=i(E.current,{backgroundColor:r})),n}),[E,h,D]);var I,L=null!==(s=(S||B)&&!N)&&void 0!==s&&s,X=function(n){var r=n.variant,e=n.size,o=n.darkMode,a=n.baseFontSize,i=n.disabled,c=n.showFocus,d=o?wn:kn,s=Dn[d][r],g=Pn[d][r],u=zn[e],b=Gn[d][a];return l(On,s,x({},g,c),x({},jn[d],i),b,u,x({},t(bn||(bn=k(["\n // TODO: Refresh - remove this logic\n font-family: ",";\n border-radius: 4px;\n "])),p.default),"dark"===d))}({variant:h,size:v,darkMode:D,baseFontSize:j,disabled:G,showFocus:q}),C="string"==typeof M.href;(M.as&&"button"===M.as||!C&&!M.as)&&(I="button");var R=f(f(f({type:I,className:l(X,F),ref:d,as:function(n,r){return n&&!r?"a":"button"}(C,G)},"string"!=typeof M.href&&{disabled:G}),{},{"aria-disabled":G},Sn.prop),M),T={variant:h,size:v,darkMode:D,disabled:G,isIconOnlyButton:L},Y=b(n.Fragment,null,b("div",{className:l(Cr,x({},t(Mr||(Mr=k(["\n border-radius: 3px;\n "]))),D)),ref:E}),b("div",{className:l(Rr,Tr[v],(g={},x(g,t(qr||(qr=k(["\n justify-content: space-between;\n "]))),!!B&&D),x(g,t(Er||(Er=k(["\n font-family: ",";\n "])),p.legacy),D),g))},S&&b(Pr,y({glyph:S,className:t(Ir||(Ir=k(["\n justify-self: right;\n "])))},T)),N,B&&b(Pr,y({glyph:B,className:t(Lr||(Lr=k(["\n justify-self: left;\n "])))},T))));return b(a,R,Y)}));Yr.displayName="Button",Yr.propTypes={variant:o.oneOf(Object.values(yn)),darkMode:o.bool,baseFontSize:o.oneOf([14,16]),size:o.oneOf(Object.values(mn)),disabled:o.bool,leftGlyph:o.element,rightGlyph:o.element,href:o.string};export default Yr;export{mn as Size,yn as Variant};
import n,{useRef as r,useEffect as e}from"react";import o from"prop-types";import a from"@leafygreen-ui/box";import{css as t,cx as l}from"@leafygreen-ui/emotion";import{registerRipple as i}from"@leafygreen-ui/ripple";import{useUsingKeyboardContext as d}from"@leafygreen-ui/leafygreen-provider";import{transparentize as c}from"polished";import{palette as s,uiColors as g}from"@leafygreen-ui/palette";import{fontFamilies as p}from"@leafygreen-ui/tokens";import{createDataProp as u}from"@leafygreen-ui/lib";import{jsx as b}from"@emotion/react";function h(n,r){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),e.push.apply(e,o)}return e}function f(n){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?h(Object(e),!0).forEach((function(r){x(n,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):h(Object(e)).forEach((function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))}))}return n}function x(n,r,e){return r in n?Object.defineProperty(n,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[r]=e,n}function y(){return(y=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o])}return n}).apply(this,arguments)}function m(n,r){if(null==n)return{};var e,o,a=function(n,r){if(null==n)return{};var e,o,a={},t=Object.keys(n);for(o=0;o<t.length;o++)e=t[o],r.indexOf(e)>=0||(a[e]=n[e]);return a}(n,r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);for(o=0;o<t.length;o++)e=t[o],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(a[e]=n[e])}return a}function k(n,r){return r||(r=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(r)}}))}var w,v,O,D,P,j,z,G,S,B,N,F,M,q,E,I,L,X,C,R,T,Y,A,K,H,J,Q,U,V,W,Z,$,_,nn,rn,en,on,an,tn,ln,dn,cn,sn,gn,pn,un,bn,hn,fn,xn,yn={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},mn={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},kn="light",wn="dark",vn=function(n){return"\n 0 0 0 2px ".concat(n,", \n 0 0 0 4px ").concat(s.blue.light1,";\n")},On=t(w||(w=k(["\n // unset browser default\n appearance: none;\n padding: 0;\n margin: 0;\n background-color: transparent;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: stretch;\n transition: all 150ms ease-in-out;\n position: relative;\n text-decoration: none;\n cursor: pointer;\n z-index: 0;\n font-family: ",";\n border-radius: 6px;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n pointer-events: none;\n }\n\n &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),p.default),Dn=(x(I={},kn,(x(G={},yn.Default,t(v||(v=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),s.gray.light3,s.gray.base,s.gray.dark3,s.white,s.gray.light2)),x(G,yn.Primary,t(O||(O=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #00593f; // Not quite dark3\n border-color: #00593f; // Not quite dark3\n box-shadow: 0 0 0 3px ",";\n }\n "])),s.green.dark2,s.green.dark2,s.white,s.white,s.green.light2)),x(G,yn.PrimaryOutline,t(D||(D=k(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.green.dark2,s.green.dark2,c(.96,s.green.base),s.green.light2)),x(G,yn.Danger,t(P||(P=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #c82222; // not quite dark1\n border-color: #c82222; // not quite dark1\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.red.base,s.red.base,s.white,s.white,s.red.light3)),x(G,yn.DangerOutline,t(j||(j=k(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.red.light1,s.red.base,s.red.dark2,c(.96,s.red.base),s.red.base,g.red.light3)),x(G,yn.BaseGreen,t(z||(z=k(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),s.green.base,s.green.dark2,s.green.dark3,s.green.light2)),G)),x(I,wn,(x(E={},yn.Primary,t(S||(S=k(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.green.dark2,g.green.base,g.white,g.white,g.white,g.green.dark1,g.green.dark2)),x(E,yn.PrimaryOutline,t(B||(B=k(["\n border: 1px solid ",";\n color: #0ad05b;\n\n &:focus {\n color: #0ad05b;\n }\n\n &:hover,\n &:active {\n color: #0ad05b;\n background-color: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.green.base,g.green.base,g.green.dark2)),x(E,yn.Default,t(N||(N=k(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.gray.dark2,g.gray.base,g.white,g.white,g.white,g.gray.dark1,g.gray.base,g.gray.dark2)),x(E,yn.Danger,t(F||(F=k(["\n background-color: ",";\n border: 1px solid #f97216;\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.red.dark1,g.white,g.white,g.white,g.red.base,g.red.dark2)),x(E,yn.DangerOutline,t(M||(M=k(["\n border: 1px solid #f97216;\n color: #f97216;\n\n &:focus {\n color: #f97216;\n }\n\n &:hover,\n &:active {\n color: #f97216;\n background: rgba(249, 114, 22, 0.08);\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.red.dark2)),x(E,yn.BaseGreen,t(q||(q=k(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.green.dark2,g.green.base,g.white,g.white,g.white,g.green.dark1,g.green.dark2)),E)),I),Pn=(x(Z={},kn,(x(A={},yn.Default,t(L||(L=k(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),s.white,vn(s.white))),x(A,yn.Primary,t(X||(X=k(["\n &:focus {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),s.white,vn(s.white))),x(A,yn.PrimaryOutline,t(C||(C=k(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c(.96,s.green.base),vn(s.white))),x(A,yn.Danger,t(R||(R=k(["\n &:focus {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),s.white,vn(s.white))),x(A,yn.DangerOutline,t(T||(T=k(["\n &:focus {\n color: ",";\n box-shadow: ",";\n }\n "])),g.red.dark2,vn(s.white))),x(A,yn.BaseGreen,t(Y||(Y=k(["\n &:focus {\n box-shadow: ",";\n }\n "])),vn(s.white))),A)),x(Z,wn,(x(W={},yn.Primary,t(K||(K=k(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),g.green.dark1,g.focus)),x(W,yn.PrimaryOutline,t(H||(H=k(["\n &:focus {\n background: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px #139fd7;\n }\n "])),g.green.dark1)),x(W,yn.Default,t(J||(J=k(["\n &:focus {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px #2f9fc5;\n }\n "])),g.gray.dark1)),x(W,yn.Danger,t(Q||(Q=k(["\n &:focus {\n background: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),g.red.base,g.focus)),x(W,yn.DangerOutline,t(U||(U=k(["\n &:focus {\n background: rgba(249, 114, 22, 0.08);\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px #019ee2;\n }\n "])))),x(W,yn.BaseGreen,t(V||(V=k(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),g.green.dark1,g.focus)),W)),Z),jn=(x(nn={},kn,t($||($=k(["\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n\n &:hover {\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n "])),s.gray.light2,s.gray.light1,s.gray.base,s.gray.light2,s.gray.light1,s.gray.base)),x(nn,wn,t(_||(_=k(["\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n\n &:hover {\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n }\n "])),g.gray.dark2,g.gray.base,g.gray.dark2,g.gray.base)),nn),zn=(x(tn={},mn.XSmall,t(rn||(rn=k(["\n height: 22px;\n text-transform: uppercase;\n font-size: 12px;\n line-height: 1em;\n font-weight: bold;\n letter-spacing: 0.4px;\n "])))),x(tn,mn.Small,t(en||(en=k(["\n height: 28px;\n "])))),x(tn,mn.Default,t(on||(on=k(["\n height: 36px;\n "])))),x(tn,mn.Large,t(an||(an=k(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),tn),Gn=(x(un={},kn,(x(cn={},14,t(ln||(ln=k(["\n font-size: 13px;\n font-weight: 500;\n "])))),x(cn,16,t(dn||(dn=k(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500;\n "])))),cn)),x(un,wn,(x(pn={},14,t(sn||(sn=k(["\n font-size: 14px;\n "])))),x(pn,16,t(gn||(gn=k(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n "])))),pn)),un),Sn=u("button");var Bn,Nn,Fn,Mn,qn,En,In,Ln,Xn,Cn,Rn,Tn,Yn,An,Kn,Hn,Jn,Qn,Un,Vn,Wn,Zn,$n,_n,nr,rr,er,or,ar,tr,lr,ir,dr,cr,sr,gr,pr,ur,br,hr,fr="#0AD05B",xr="#F97216",yr=(x(xn={},kn,(x(hn={},yn.Primary,s.green.dark1),x(hn,yn.PrimaryOutline,c(.76,s.green.base)),x(hn,yn.Default,s.gray.light2),x(hn,yn.Danger,s.red.light1),x(hn,yn.DangerOutline,c(.76,s.red.base)),x(hn,yn.BaseGreen,s.green.light1),hn)),x(xn,wn,(x(fn={},yn.Primary,fr),x(fn,yn.PrimaryOutline,c(.76,g.green.base)),x(fn,yn.Default,g.gray.base),x(fn,yn.Danger,xr),x(fn,yn.DangerOutline,c(.76,xr)),x(fn,yn.BaseGreen,fr),fn)),xn),mr=(x(Kn={},kn,(x(In={},yn.Default,t(Bn||(Bn=k(["\n color: ",";\n "])),s.gray.base)),x(In,yn.Primary,t(Nn||(Nn=k(["\n color: ",";\n "])),s.green.light2)),x(In,yn.PrimaryOutline,t(Fn||(Fn=k(["\n color: ",";\n "])),s.green.dark2)),x(In,yn.Danger,t(Mn||(Mn=k(["\n color: ",";\n "])),s.red.light3)),x(In,yn.DangerOutline,t(qn||(qn=k(["\n color: ",";\n "])),s.red.light1)),x(In,yn.BaseGreen,t(En||(En=k(["\n color: ",";\n "])),s.green.dark2)),In)),x(Kn,wn,(x(An={},yn.Primary,t(Ln||(Ln=k(["\n color: ",";\n "])),g.green.light2)),x(An,yn.PrimaryOutline,t(Xn||(Xn=k(["\n color: #13aa52;\n "])))),x(An,yn.Default,t(Cn||(Cn=k(["\n color: ",";\n "])),g.gray.light1)),x(An,yn.Danger,t(Rn||(Rn=k(["\n color: ",";\n "])),g.red.light3)),x(An,yn.DangerOutline,t(Tn||(Tn=k(["\n color: #f97216;\n "])))),x(An,yn.BaseGreen,t(Yn||(Yn=k(["\n color: ",";\n "])),g.gray.light1)),An)),Kn),kr=(x(tr={},kn,(x(Zn={},yn.Default,t(Hn||(Hn=k(["\n color: ",";\n "])),s.gray.dark1)),x(Zn,yn.Primary,t(Jn||(Jn=k(["\n color: ",";\n "])),s.green.light3)),x(Zn,yn.PrimaryOutline,t(Qn||(Qn=k(["\n color: ",";\n "])),s.green.dark2)),x(Zn,yn.Danger,t(Un||(Un=k(["\n color: ",";\n "])),s.red.light3)),x(Zn,yn.DangerOutline,t(Vn||(Vn=k(["\n color: ",";\n "])),s.red.light1)),x(Zn,yn.BaseGreen,t(Wn||(Wn=k(["\n color: ",";\n "])),s.green.dark2)),Zn)),x(tr,wn,(x(ar={},yn.Primary,t($n||($n=k(["\n color: ",";\n "])),g.white)),x(ar,yn.PrimaryOutline,t(_n||(_n=k(["\n color: #0ad05b;\n "])))),x(ar,yn.Default,t(nr||(nr=k(["\n color: ",";\n "])),g.white)),x(ar,yn.Danger,t(rr||(rr=k(["\n color: ",";\n "])),g.white)),x(ar,yn.DangerOutline,t(er||(er=k(["\n color: #f97216;\n "])))),x(ar,yn.BaseGreen,t(or||(or=k(["\n color: ",";\n "])),g.gray.light1)),ar)),tr),wr=t(lr||(lr=k(["\n ",":hover &,\n ",":active & {\n color: currentColor;\n } ;\n"])),Sn.selector,Sn.selector),vr=(x(gr={},mn.XSmall,t(ir||(ir=k(["\n height: 14px;\n width: 14px;\n "])))),x(gr,mn.Small,t(dr||(dr=k(["\n height: 16px;\n width: 16px;\n "])))),x(gr,mn.Default,t(cr||(cr=k(["\n height: 16px;\n width: 16px;\n "])))),x(gr,mn.Large,t(sr||(sr=k(["\n height: 20px;\n width: 20px;\n "])))),gr),Or=(x(br={},kn,t(pr||(pr=k(["\n color: ",";\n "])),s.gray.light2)),x(br,wn,t(ur||(ur=k(["\n color: ",";\n "])),g.gray.dark1)),br),Dr=t(hr||(hr=k(["\n color: ",";\n"])),s.gray.light1);function Pr(r){var e,o=r.glyph,a=r.variant,t=r.size,i=r.darkMode,d=r.disabled,c=r.isIconOnlyButton,s=r.className,g=!c&&{"aria-hidden":!0,role:"presentation"},p=i?wn:kn,u=c?kr:mr;return n.cloneElement(o,f({className:l(u[p][a],vr[t],(e={},x(e,Or[p],d),x(e,wr,c),x(e,Dr,!i&&d&&c),e),s)},g))}Pr.displayName="ButtonIcon";var jr,zr,Gr,Sr,Br,Nr,Fr,Mr,qr,Er,Ir,Lr,Xr=["variant","size","darkMode","baseFontSize","disabled","leftGlyph","rightGlyph","children","className","as","type"],Cr=t(jr||(jr=k(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 6px;\n"]))),Rr=t(zr||(zr=k(["\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n pointer-events: none;\n position: relative;\n z-index: 0;\n"]))),Tr=(x(Fr={},mn.XSmall,t(Gr||(Gr=k(["\n padding: 0 8px;\n gap: 6px;\n "])))),x(Fr,mn.Small,t(Sr||(Sr=k(["\n padding: 0 12px;\n gap: 6px;\n "])))),x(Fr,mn.Default,t(Br||(Br=k(["\n padding: 0 12px;\n gap: 6px;\n "])))),x(Fr,mn.Large,t(Nr||(Nr=k(["\n padding: 0 16px;\n gap: 8px;\n "])))),Fr),Yr=n.forwardRef((function(o,c){var s,g,u=o.variant,h=void 0===u?yn.Default:u,w=o.size,v=void 0===w?mn.Default:w,O=o.darkMode,D=void 0!==O&&O,P=o.baseFontSize,j=void 0===P?14:P,z=o.disabled,G=void 0!==z&&z,S=o.leftGlyph,B=o.rightGlyph,N=o.children,F=o.className,M=o.as,q=o.type,E=m(o,Xr),I=d().usingKeyboard,L=r(null);e((function(){var n,r=yr[D?wn:kn][h];return null!=L.current&&(n=i(L.current,{backgroundColor:r})),n}),[L,h,D]);var X=null!==(s=(S||B)&&!N)&&void 0!==s&&s,C=function(n){var r=n.variant,e=n.size,o=n.darkMode,a=n.baseFontSize,i=n.disabled,d=n.showFocus,c=o?wn:kn,s=Dn[c][r],g=Pn[c][r],u=zn[e],b=Gn[c][a];return l(On,s,x({},g,d),x({},jn[c],i),b,u,x({},t(bn||(bn=k(["\n // TODO: Refresh - remove this logic\n font-family: ",";\n border-radius: 4px;\n "])),p.default),"dark"===c))}({variant:h,size:v,darkMode:D,baseFontSize:j,disabled:G,showFocus:I}),R=!(!E.href&&"a"!==M||G),T=f(f(f({type:R?void 0:q||"button",className:l(C,F),ref:c,as:R?"a":"button"},"string"!=typeof E.href&&{disabled:G}),{},{"aria-disabled":G},Sn.prop),E),Y={variant:h,size:v,darkMode:D,disabled:G,isIconOnlyButton:X},A=b(n.Fragment,null,b("div",{className:l(Cr,x({},t(Mr||(Mr=k(["\n border-radius: 3px;\n "]))),D)),ref:L}),b("div",{className:l(Rr,Tr[v],(g={},x(g,t(qr||(qr=k(["\n justify-content: space-between;\n "]))),!!B&&D),x(g,t(Er||(Er=k(["\n font-family: ",";\n "])),p.legacy),D),g))},S&&b(Pr,y({glyph:S,className:t(Ir||(Ir=k(["\n justify-self: right;\n "])))},Y)),N,B&&b(Pr,y({glyph:B,className:t(Lr||(Lr=k(["\n justify-self: left;\n "])))},Y))));return b(a,T,A)}));Yr.displayName="Button",Yr.propTypes={variant:o.oneOf(Object.values(yn)),darkMode:o.bool,baseFontSize:o.oneOf([14,16]),size:o.oneOf(Object.values(mn)),disabled:o.bool,leftGlyph:o.element,rightGlyph:o.element,href:o.string};export default Yr;export{mn as Size,yn as Variant};
//# sourceMappingURL=index.js.map

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("@leafygreen-ui/box"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/ripple"),require("@leafygreen-ui/leafygreen-provider"),require("polished"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/tokens"),require("@leafygreen-ui/lib"),require("@emotion/react")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@leafygreen-ui/box","@leafygreen-ui/emotion","@leafygreen-ui/ripple","@leafygreen-ui/leafygreen-provider","polished","@leafygreen-ui/palette","@leafygreen-ui/tokens","@leafygreen-ui/lib","@emotion/react"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/button"]={},e.React,e.PropTypes,e["@leafygreen-ui/box"],e["@leafygreen-ui/emotion"],e["@leafygreen-ui/ripple"],e["@leafygreen-ui/leafygreen-provider"],e.polished,e["@leafygreen-ui/palette"],e["@leafygreen-ui/tokens"],e["@leafygreen-ui/lib"],e.react)}(this,(function(e,n,r,o,a,t,l,s,i,c,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(n),f=d(r),b=d(o);function x(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function h(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?x(Object(r),!0).forEach((function(n){y(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function y(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function k(){return(k=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function w(e,n){if(null==e)return{};var r,o,a=function(e,n){if(null==e)return{};var r,o,a={},t=Object.keys(e);for(o=0;o<t.length;o++)r=t[o],n.indexOf(r)>=0||(a[r]=e[r]);return a}(e,n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(o=0;o<t.length;o++)r=t[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function m(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var v,O,C,D,P,j,z,G,S,q,B,N,F,M,E,R,T,I,L,X,K,Y,_,A,U,V,H,J,Q,W,Z,$,ee,ne,re,oe,ae,te,le,se,ie,ce,ue,pe,de,ge,fe,be,xe,he,ye={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},ke={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},we="light",me="dark",ve=function(e){return"\n 0 0 0 2px ".concat(e,", \n 0 0 0 4px ").concat(i.palette.blue.light1,";\n")},Oe=a.css(v||(v=m(["\n // unset browser default\n appearance: none;\n padding: 0;\n margin: 0;\n background-color: transparent;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: stretch;\n transition: all 150ms ease-in-out;\n position: relative;\n text-decoration: none;\n cursor: pointer;\n z-index: 0;\n font-family: ",";\n border-radius: 6px;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n pointer-events: none;\n }\n\n &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),c.fontFamilies.default),Ce=(y(R={},we,(y(G={},ye.Default,a.css(O||(O=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),i.palette.gray.light3,i.palette.gray.base,i.palette.gray.dark3,i.palette.white,i.palette.gray.light2)),y(G,ye.Primary,a.css(C||(C=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #00593f; // Not quite dark3\n border-color: #00593f; // Not quite dark3\n box-shadow: 0 0 0 3px ",";\n }\n "])),i.palette.green.dark2,i.palette.green.dark2,i.palette.white,i.palette.white,i.palette.green.light2)),y(G,ye.PrimaryOutline,a.css(D||(D=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.green.dark2,i.palette.green.dark2,s.transparentize(.96,i.palette.green.base),i.palette.green.light2)),y(G,ye.Danger,a.css(P||(P=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #c82222; // not quite dark1\n border-color: #c82222; // not quite dark1\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.red.base,i.palette.red.base,i.palette.white,i.palette.white,i.palette.red.light3)),y(G,ye.DangerOutline,a.css(j||(j=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.red.light1,i.palette.red.base,i.palette.red.dark2,s.transparentize(.96,i.palette.red.base),i.palette.red.base,i.uiColors.red.light3)),y(G,ye.BaseGreen,a.css(z||(z=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.green.base,i.palette.green.dark2,i.palette.green.dark3,i.palette.green.light2)),G)),y(R,me,(y(E={},ye.Primary,a.css(S||(S=m(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark2,i.uiColors.green.base,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.green.dark1,i.uiColors.green.dark2)),y(E,ye.PrimaryOutline,a.css(q||(q=m(["\n border: 1px solid ",";\n color: #0ad05b;\n\n &:focus {\n color: #0ad05b;\n }\n\n &:hover,\n &:active {\n color: #0ad05b;\n background-color: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.base,i.uiColors.green.base,i.uiColors.green.dark2)),y(E,ye.Default,a.css(B||(B=m(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.gray.dark2,i.uiColors.gray.base,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.gray.dark1,i.uiColors.gray.base,i.uiColors.gray.dark2)),y(E,ye.Danger,a.css(N||(N=m(["\n background-color: ",";\n border: 1px solid #f97216;\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.red.dark1,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.red.base,i.uiColors.red.dark2)),y(E,ye.DangerOutline,a.css(F||(F=m(["\n border: 1px solid #f97216;\n color: #f97216;\n\n &:focus {\n color: #f97216;\n }\n\n &:hover,\n &:active {\n color: #f97216;\n background: rgba(249, 114, 22, 0.08);\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.red.dark2)),y(E,ye.BaseGreen,a.css(M||(M=m(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark2,i.uiColors.green.base,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.green.dark1,i.uiColors.green.dark2)),E)),R),De=(y(Z={},we,(y(_={},ye.Default,a.css(T||(T=m(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),i.palette.white,ve(i.palette.white))),y(_,ye.Primary,a.css(I||(I=m(["\n &:focus {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),i.palette.white,ve(i.palette.white))),y(_,ye.PrimaryOutline,a.css(L||(L=m(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),s.transparentize(.96,i.palette.green.base),ve(i.palette.white))),y(_,ye.Danger,a.css(X||(X=m(["\n &:focus {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),i.palette.white,ve(i.palette.white))),y(_,ye.DangerOutline,a.css(K||(K=m(["\n &:focus {\n color: ",";\n box-shadow: ",";\n }\n "])),i.uiColors.red.dark2,ve(i.palette.white))),y(_,ye.BaseGreen,a.css(Y||(Y=m(["\n &:focus {\n box-shadow: ",";\n }\n "])),ve(i.palette.white))),_)),y(Z,me,(y(W={},ye.Primary,a.css(A||(A=m(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark1,i.uiColors.focus)),y(W,ye.PrimaryOutline,a.css(U||(U=m(["\n &:focus {\n background: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px #139fd7;\n }\n "])),i.uiColors.green.dark1)),y(W,ye.Default,a.css(V||(V=m(["\n &:focus {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px #2f9fc5;\n }\n "])),i.uiColors.gray.dark1)),y(W,ye.Danger,a.css(H||(H=m(["\n &:focus {\n background: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.red.base,i.uiColors.focus)),y(W,ye.DangerOutline,a.css(J||(J=m(["\n &:focus {\n background: rgba(249, 114, 22, 0.08);\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px #019ee2;\n }\n "])))),y(W,ye.BaseGreen,a.css(Q||(Q=m(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark1,i.uiColors.focus)),W)),Z),Pe=(y(ne={},we,a.css($||($=m(["\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n\n &:hover {\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n "])),i.palette.gray.light2,i.palette.gray.light1,i.palette.gray.base,i.palette.gray.light2,i.palette.gray.light1,i.palette.gray.base)),y(ne,me,a.css(ee||(ee=m(["\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n\n &:hover {\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n }\n "])),i.uiColors.gray.dark2,i.uiColors.gray.base,i.uiColors.gray.dark2,i.uiColors.gray.base)),ne),je=(y(le={},ke.XSmall,a.css(re||(re=m(["\n height: 22px;\n text-transform: uppercase;\n font-size: 12px;\n line-height: 1em;\n font-weight: bold;\n letter-spacing: 0.4px;\n "])))),y(le,ke.Small,a.css(oe||(oe=m(["\n height: 28px;\n "])))),y(le,ke.Default,a.css(ae||(ae=m(["\n height: 36px;\n "])))),y(le,ke.Large,a.css(te||(te=m(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),le),ze=(y(ge={},we,(y(ce={},14,a.css(se||(se=m(["\n font-size: 13px;\n font-weight: 500;\n "])))),y(ce,16,a.css(ie||(ie=m(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500;\n "])))),ce)),y(ge,me,(y(de={},14,a.css(ue||(ue=m(["\n font-size: 14px;\n "])))),y(de,16,a.css(pe||(pe=m(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n "])))),de)),ge),Ge=u.createDataProp("button");var Se,qe,Be,Ne,Fe,Me,Ee,Re,Te,Ie,Le,Xe,Ke,Ye,_e,Ae,Ue,Ve,He,Je,Qe,We,Ze,$e,en,nn,rn,on,an,tn,ln,sn,cn,un,pn,dn,gn,fn,bn,xn,hn=.76,yn="#0AD05B",kn="#F97216",wn=(y(he={},we,(y(be={},ye.Primary,i.palette.green.dark1),y(be,ye.PrimaryOutline,s.transparentize(hn,i.palette.green.base)),y(be,ye.Default,i.palette.gray.light2),y(be,ye.Danger,i.palette.red.light1),y(be,ye.DangerOutline,s.transparentize(hn,i.palette.red.base)),y(be,ye.BaseGreen,i.palette.green.light1),be)),y(he,me,(y(xe={},ye.Primary,yn),y(xe,ye.PrimaryOutline,s.transparentize(hn,i.uiColors.green.base)),y(xe,ye.Default,i.uiColors.gray.base),y(xe,ye.Danger,kn),y(xe,ye.DangerOutline,s.transparentize(hn,kn)),y(xe,ye.BaseGreen,yn),xe)),he),mn=(y(_e={},we,(y(Ee={},ye.Default,a.css(Se||(Se=m(["\n color: ",";\n "])),i.palette.gray.base)),y(Ee,ye.Primary,a.css(qe||(qe=m(["\n color: ",";\n "])),i.palette.green.light2)),y(Ee,ye.PrimaryOutline,a.css(Be||(Be=m(["\n color: ",";\n "])),i.palette.green.dark2)),y(Ee,ye.Danger,a.css(Ne||(Ne=m(["\n color: ",";\n "])),i.palette.red.light3)),y(Ee,ye.DangerOutline,a.css(Fe||(Fe=m(["\n color: ",";\n "])),i.palette.red.light1)),y(Ee,ye.BaseGreen,a.css(Me||(Me=m(["\n color: ",";\n "])),i.palette.green.dark2)),Ee)),y(_e,me,(y(Ye={},ye.Primary,a.css(Re||(Re=m(["\n color: ",";\n "])),i.uiColors.green.light2)),y(Ye,ye.PrimaryOutline,a.css(Te||(Te=m(["\n color: #13aa52;\n "])))),y(Ye,ye.Default,a.css(Ie||(Ie=m(["\n color: ",";\n "])),i.uiColors.gray.light1)),y(Ye,ye.Danger,a.css(Le||(Le=m(["\n color: ",";\n "])),i.uiColors.red.light3)),y(Ye,ye.DangerOutline,a.css(Xe||(Xe=m(["\n color: #f97216;\n "])))),y(Ye,ye.BaseGreen,a.css(Ke||(Ke=m(["\n color: ",";\n "])),i.uiColors.gray.light1)),Ye)),_e),vn=(y(tn={},we,(y(We={},ye.Default,a.css(Ae||(Ae=m(["\n color: ",";\n "])),i.palette.gray.dark1)),y(We,ye.Primary,a.css(Ue||(Ue=m(["\n color: ",";\n "])),i.palette.green.light3)),y(We,ye.PrimaryOutline,a.css(Ve||(Ve=m(["\n color: ",";\n "])),i.palette.green.dark2)),y(We,ye.Danger,a.css(He||(He=m(["\n color: ",";\n "])),i.palette.red.light3)),y(We,ye.DangerOutline,a.css(Je||(Je=m(["\n color: ",";\n "])),i.palette.red.light1)),y(We,ye.BaseGreen,a.css(Qe||(Qe=m(["\n color: ",";\n "])),i.palette.green.dark2)),We)),y(tn,me,(y(an={},ye.Primary,a.css(Ze||(Ze=m(["\n color: ",";\n "])),i.uiColors.white)),y(an,ye.PrimaryOutline,a.css($e||($e=m(["\n color: #0ad05b;\n "])))),y(an,ye.Default,a.css(en||(en=m(["\n color: ",";\n "])),i.uiColors.white)),y(an,ye.Danger,a.css(nn||(nn=m(["\n color: ",";\n "])),i.uiColors.white)),y(an,ye.DangerOutline,a.css(rn||(rn=m(["\n color: #f97216;\n "])))),y(an,ye.BaseGreen,a.css(on||(on=m(["\n color: ",";\n "])),i.uiColors.gray.light1)),an)),tn),On=a.css(ln||(ln=m(["\n ",":hover &,\n ",":active & {\n color: currentColor;\n } ;\n"])),Ge.selector,Ge.selector),Cn=(y(dn={},ke.XSmall,a.css(sn||(sn=m(["\n height: 14px;\n width: 14px;\n "])))),y(dn,ke.Small,a.css(cn||(cn=m(["\n height: 16px;\n width: 16px;\n "])))),y(dn,ke.Default,a.css(un||(un=m(["\n height: 16px;\n width: 16px;\n "])))),y(dn,ke.Large,a.css(pn||(pn=m(["\n height: 20px;\n width: 20px;\n "])))),dn),Dn=(y(bn={},we,a.css(gn||(gn=m(["\n color: ",";\n "])),i.palette.gray.light2)),y(bn,me,a.css(fn||(fn=m(["\n color: ",";\n "])),i.uiColors.gray.dark1)),bn),Pn=a.css(xn||(xn=m(["\n color: ",";\n"])),i.palette.gray.light1);function jn(e){var n,r=e.glyph,o=e.variant,t=e.size,l=e.darkMode,s=e.disabled,i=e.isIconOnlyButton,c=e.className,u=!i&&{"aria-hidden":!0,role:"presentation"},p=l?me:we,d=i?vn:mn;return g.default.cloneElement(r,h({className:a.cx(d[p][o],Cn[t],(n={},y(n,Dn[p],s),y(n,On,i),y(n,Pn,!l&&s&&i),n),c)},u))}jn.displayName="ButtonIcon";var zn,Gn,Sn,qn,Bn,Nn,Fn,Mn,En,Rn,Tn,In,Ln=["variant","size","darkMode","baseFontSize","disabled","leftGlyph","rightGlyph","children","className"],Xn=a.css(zn||(zn=m(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 6px;\n"]))),Kn=a.css(Gn||(Gn=m(["\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n pointer-events: none;\n position: relative;\n z-index: 0;\n"]))),Yn=(y(Fn={},ke.XSmall,a.css(Sn||(Sn=m(["\n padding: 0 8px;\n gap: 6px;\n "])))),y(Fn,ke.Small,a.css(qn||(qn=m(["\n padding: 0 12px;\n gap: 6px;\n "])))),y(Fn,ke.Default,a.css(Bn||(Bn=m(["\n padding: 0 12px;\n gap: 6px;\n "])))),y(Fn,ke.Large,a.css(Nn||(Nn=m(["\n padding: 0 16px;\n gap: 8px;\n "])))),Fn),_n=g.default.forwardRef((function(e,r){var o,s,i=e.variant,u=void 0===i?ye.Default:i,d=e.size,f=void 0===d?ke.Default:d,x=e.darkMode,v=void 0!==x&&x,O=e.baseFontSize,C=void 0===O?14:O,D=e.disabled,P=void 0!==D&&D,j=e.leftGlyph,z=e.rightGlyph,G=e.children,S=e.className,q=w(e,Ln),B=l.useUsingKeyboardContext().usingKeyboard,N=n.useRef(null);n.useEffect((function(){var e,n=wn[v?me:we][u];return null!=N.current&&(e=t.registerRipple(N.current,{backgroundColor:n})),e}),[N,u,v]);var F,M=null!==(o=(j||z)&&!G)&&void 0!==o&&o,E=function(e){var n=e.variant,r=e.size,o=e.darkMode,t=e.baseFontSize,l=e.disabled,s=e.showFocus,i=o?me:we,u=Ce[i][n],p=De[i][n],d=je[r],g=ze[i][t];return a.cx(Oe,u,y({},p,s),y({},Pe[i],l),g,d,y({},a.css(fe||(fe=m(["\n // TODO: Refresh - remove this logic\n font-family: ",";\n border-radius: 4px;\n "])),c.fontFamilies.default),"dark"===i))}({variant:u,size:f,darkMode:v,baseFontSize:C,disabled:P,showFocus:B}),R="string"==typeof q.href;(q.as&&"button"===q.as||!R&&!q.as)&&(F="button");var T=h(h(h({type:F,className:a.cx(E,S),ref:r,as:function(e,n){return e&&!n?"a":"button"}(R,P)},"string"!=typeof q.href&&{disabled:P}),{},{"aria-disabled":P},Ge.prop),q),I={variant:u,size:f,darkMode:v,disabled:P,isIconOnlyButton:M},L=p.jsx(g.default.Fragment,null,p.jsx("div",{className:a.cx(Xn,y({},a.css(Mn||(Mn=m(["\n border-radius: 3px;\n "]))),v)),ref:N}),p.jsx("div",{className:a.cx(Kn,Yn[f],(s={},y(s,a.css(En||(En=m(["\n justify-content: space-between;\n "]))),!!z&&v),y(s,a.css(Rn||(Rn=m(["\n font-family: ",";\n "])),c.fontFamilies.legacy),v),s))},j&&p.jsx(jn,k({glyph:j,className:a.css(Tn||(Tn=m(["\n justify-self: right;\n "])))},I)),G,z&&p.jsx(jn,k({glyph:z,className:a.css(In||(In=m(["\n justify-self: left;\n "])))},I))));return p.jsx(b.default,T,L)}));_n.displayName="Button",_n.propTypes={variant:f.default.oneOf(Object.values(ye)),darkMode:f.default.bool,baseFontSize:f.default.oneOf([14,16]),size:f.default.oneOf(Object.values(ke)),disabled:f.default.bool,leftGlyph:f.default.element,rightGlyph:f.default.element,href:f.default.string},e.Size=ke,e.Variant=ye,e.default=_n,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("@leafygreen-ui/box"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/ripple"),require("@leafygreen-ui/leafygreen-provider"),require("polished"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/tokens"),require("@leafygreen-ui/lib"),require("@emotion/react")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@leafygreen-ui/box","@leafygreen-ui/emotion","@leafygreen-ui/ripple","@leafygreen-ui/leafygreen-provider","polished","@leafygreen-ui/palette","@leafygreen-ui/tokens","@leafygreen-ui/lib","@emotion/react"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/button"]={},e.React,e.PropTypes,e["@leafygreen-ui/box"],e["@leafygreen-ui/emotion"],e["@leafygreen-ui/ripple"],e["@leafygreen-ui/leafygreen-provider"],e.polished,e["@leafygreen-ui/palette"],e["@leafygreen-ui/tokens"],e["@leafygreen-ui/lib"],e.react)}(this,(function(e,n,r,o,a,t,l,s,i,c,p,u){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(n),f=d(r),b=d(o);function x(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function h(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?x(Object(r),!0).forEach((function(n){y(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function y(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function k(){return(k=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function w(e,n){if(null==e)return{};var r,o,a=function(e,n){if(null==e)return{};var r,o,a={},t=Object.keys(e);for(o=0;o<t.length;o++)r=t[o],n.indexOf(r)>=0||(a[r]=e[r]);return a}(e,n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(o=0;o<t.length;o++)r=t[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function m(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var v,O,C,D,P,j,z,G,S,q,B,N,F,M,E,R,T,I,L,X,K,Y,_,A,U,V,H,J,Q,W,Z,$,ee,ne,re,oe,ae,te,le,se,ie,ce,pe,ue,de,ge,fe,be,xe,he,ye={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},ke={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},we="light",me="dark",ve=function(e){return"\n 0 0 0 2px ".concat(e,", \n 0 0 0 4px ").concat(i.palette.blue.light1,";\n")},Oe=a.css(v||(v=m(["\n // unset browser default\n appearance: none;\n padding: 0;\n margin: 0;\n background-color: transparent;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: stretch;\n transition: all 150ms ease-in-out;\n position: relative;\n text-decoration: none;\n cursor: pointer;\n z-index: 0;\n font-family: ",";\n border-radius: 6px;\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n pointer-events: none;\n }\n\n &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),c.fontFamilies.default),Ce=(y(R={},we,(y(G={},ye.Default,a.css(O||(O=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),i.palette.gray.light3,i.palette.gray.base,i.palette.gray.dark3,i.palette.white,i.palette.gray.light2)),y(G,ye.Primary,a.css(C||(C=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #00593f; // Not quite dark3\n border-color: #00593f; // Not quite dark3\n box-shadow: 0 0 0 3px ",";\n }\n "])),i.palette.green.dark2,i.palette.green.dark2,i.palette.white,i.palette.white,i.palette.green.light2)),y(G,ye.PrimaryOutline,a.css(D||(D=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.green.dark2,i.palette.green.dark2,s.transparentize(.96,i.palette.green.base),i.palette.green.light2)),y(G,ye.Danger,a.css(P||(P=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: #c82222; // not quite dark1\n border-color: #c82222; // not quite dark1\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.red.base,i.palette.red.base,i.palette.white,i.palette.white,i.palette.red.light3)),y(G,ye.DangerOutline,a.css(j||(j=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.red.light1,i.palette.red.base,i.palette.red.dark2,s.transparentize(.96,i.palette.red.base),i.palette.red.base,i.uiColors.red.light3)),y(G,ye.BaseGreen,a.css(z||(z=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.palette.green.base,i.palette.green.dark2,i.palette.green.dark3,i.palette.green.light2)),G)),y(R,me,(y(E={},ye.Primary,a.css(S||(S=m(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark2,i.uiColors.green.base,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.green.dark1,i.uiColors.green.dark2)),y(E,ye.PrimaryOutline,a.css(q||(q=m(["\n border: 1px solid ",";\n color: #0ad05b;\n\n &:focus {\n color: #0ad05b;\n }\n\n &:hover,\n &:active {\n color: #0ad05b;\n background-color: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.base,i.uiColors.green.base,i.uiColors.green.dark2)),y(E,ye.Default,a.css(B||(B=m(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.gray.dark2,i.uiColors.gray.base,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.gray.dark1,i.uiColors.gray.base,i.uiColors.gray.dark2)),y(E,ye.Danger,a.css(N||(N=m(["\n background-color: ",";\n border: 1px solid #f97216;\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.red.dark1,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.red.base,i.uiColors.red.dark2)),y(E,ye.DangerOutline,a.css(F||(F=m(["\n border: 1px solid #f97216;\n color: #f97216;\n\n &:focus {\n color: #f97216;\n }\n\n &:hover,\n &:active {\n color: #f97216;\n background: rgba(249, 114, 22, 0.08);\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.red.dark2)),y(E,ye.BaseGreen,a.css(M||(M=m(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark2,i.uiColors.green.base,i.uiColors.white,i.uiColors.white,i.uiColors.white,i.uiColors.green.dark1,i.uiColors.green.dark2)),E)),R),De=(y(Z={},we,(y(_={},ye.Default,a.css(T||(T=m(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),i.palette.white,ve(i.palette.white))),y(_,ye.Primary,a.css(I||(I=m(["\n &:focus {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),i.palette.white,ve(i.palette.white))),y(_,ye.PrimaryOutline,a.css(L||(L=m(["\n &:focus {\n background-color: ",";\n box-shadow: ",";\n }\n "])),s.transparentize(.96,i.palette.green.base),ve(i.palette.white))),y(_,ye.Danger,a.css(X||(X=m(["\n &:focus {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),i.palette.white,ve(i.palette.white))),y(_,ye.DangerOutline,a.css(K||(K=m(["\n &:focus {\n color: ",";\n box-shadow: ",";\n }\n "])),i.uiColors.red.dark2,ve(i.palette.white))),y(_,ye.BaseGreen,a.css(Y||(Y=m(["\n &:focus {\n box-shadow: ",";\n }\n "])),ve(i.palette.white))),_)),y(Z,me,(y(W={},ye.Primary,a.css(A||(A=m(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark1,i.uiColors.focus)),y(W,ye.PrimaryOutline,a.css(U||(U=m(["\n &:focus {\n background: rgba(10, 208, 91, 0.08);\n border: 1px solid ",";\n box-shadow: 0px 0px 0px 3px #139fd7;\n }\n "])),i.uiColors.green.dark1)),y(W,ye.Default,a.css(V||(V=m(["\n &:focus {\n background-color: ",";\n box-shadow: 0px 0px 0px 3px #2f9fc5;\n }\n "])),i.uiColors.gray.dark1)),y(W,ye.Danger,a.css(H||(H=m(["\n &:focus {\n background: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.red.base,i.uiColors.focus)),y(W,ye.DangerOutline,a.css(J||(J=m(["\n &:focus {\n background: rgba(249, 114, 22, 0.08);\n border: 1px solid #f97216;\n box-shadow: 0px 0px 0px 3px #019ee2;\n }\n "])))),y(W,ye.BaseGreen,a.css(Q||(Q=m(["\n &:focus {\n background: ",";\n box-shadow: 0px 4px 4px rgba(0, 124, 173, 0.4),\n 0px 0px 0px 3px ",";\n }\n "])),i.uiColors.green.dark1,i.uiColors.focus)),W)),Z),Pe=(y(ne={},we,a.css($||($=m(["\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n\n &:hover {\n background-color: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n "])),i.palette.gray.light2,i.palette.gray.light1,i.palette.gray.base,i.palette.gray.light2,i.palette.gray.light1,i.palette.gray.base)),y(ne,me,a.css(ee||(ee=m(["\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n\n &:hover {\n background: rgba(61, 79, 88, 0.3);\n border: 1px solid ",";\n color: ",";\n cursor: not-allowed;\n }\n "])),i.uiColors.gray.dark2,i.uiColors.gray.base,i.uiColors.gray.dark2,i.uiColors.gray.base)),ne),je=(y(le={},ke.XSmall,a.css(re||(re=m(["\n height: 22px;\n text-transform: uppercase;\n font-size: 12px;\n line-height: 1em;\n font-weight: bold;\n letter-spacing: 0.4px;\n "])))),y(le,ke.Small,a.css(oe||(oe=m(["\n height: 28px;\n "])))),y(le,ke.Default,a.css(ae||(ae=m(["\n height: 36px;\n "])))),y(le,ke.Large,a.css(te||(te=m(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),le),ze=(y(ge={},we,(y(ce={},14,a.css(se||(se=m(["\n font-size: 13px;\n font-weight: 500;\n "])))),y(ce,16,a.css(ie||(ie=m(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500;\n "])))),ce)),y(ge,me,(y(de={},14,a.css(pe||(pe=m(["\n font-size: 14px;\n "])))),y(de,16,a.css(ue||(ue=m(["\n font-size: 16px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n "])))),de)),ge),Ge=p.createDataProp("button");var Se,qe,Be,Ne,Fe,Me,Ee,Re,Te,Ie,Le,Xe,Ke,Ye,_e,Ae,Ue,Ve,He,Je,Qe,We,Ze,$e,en,nn,rn,on,an,tn,ln,sn,cn,pn,un,dn,gn,fn,bn,xn,hn=.76,yn="#0AD05B",kn="#F97216",wn=(y(he={},we,(y(be={},ye.Primary,i.palette.green.dark1),y(be,ye.PrimaryOutline,s.transparentize(hn,i.palette.green.base)),y(be,ye.Default,i.palette.gray.light2),y(be,ye.Danger,i.palette.red.light1),y(be,ye.DangerOutline,s.transparentize(hn,i.palette.red.base)),y(be,ye.BaseGreen,i.palette.green.light1),be)),y(he,me,(y(xe={},ye.Primary,yn),y(xe,ye.PrimaryOutline,s.transparentize(hn,i.uiColors.green.base)),y(xe,ye.Default,i.uiColors.gray.base),y(xe,ye.Danger,kn),y(xe,ye.DangerOutline,s.transparentize(hn,kn)),y(xe,ye.BaseGreen,yn),xe)),he),mn=(y(_e={},we,(y(Ee={},ye.Default,a.css(Se||(Se=m(["\n color: ",";\n "])),i.palette.gray.base)),y(Ee,ye.Primary,a.css(qe||(qe=m(["\n color: ",";\n "])),i.palette.green.light2)),y(Ee,ye.PrimaryOutline,a.css(Be||(Be=m(["\n color: ",";\n "])),i.palette.green.dark2)),y(Ee,ye.Danger,a.css(Ne||(Ne=m(["\n color: ",";\n "])),i.palette.red.light3)),y(Ee,ye.DangerOutline,a.css(Fe||(Fe=m(["\n color: ",";\n "])),i.palette.red.light1)),y(Ee,ye.BaseGreen,a.css(Me||(Me=m(["\n color: ",";\n "])),i.palette.green.dark2)),Ee)),y(_e,me,(y(Ye={},ye.Primary,a.css(Re||(Re=m(["\n color: ",";\n "])),i.uiColors.green.light2)),y(Ye,ye.PrimaryOutline,a.css(Te||(Te=m(["\n color: #13aa52;\n "])))),y(Ye,ye.Default,a.css(Ie||(Ie=m(["\n color: ",";\n "])),i.uiColors.gray.light1)),y(Ye,ye.Danger,a.css(Le||(Le=m(["\n color: ",";\n "])),i.uiColors.red.light3)),y(Ye,ye.DangerOutline,a.css(Xe||(Xe=m(["\n color: #f97216;\n "])))),y(Ye,ye.BaseGreen,a.css(Ke||(Ke=m(["\n color: ",";\n "])),i.uiColors.gray.light1)),Ye)),_e),vn=(y(tn={},we,(y(We={},ye.Default,a.css(Ae||(Ae=m(["\n color: ",";\n "])),i.palette.gray.dark1)),y(We,ye.Primary,a.css(Ue||(Ue=m(["\n color: ",";\n "])),i.palette.green.light3)),y(We,ye.PrimaryOutline,a.css(Ve||(Ve=m(["\n color: ",";\n "])),i.palette.green.dark2)),y(We,ye.Danger,a.css(He||(He=m(["\n color: ",";\n "])),i.palette.red.light3)),y(We,ye.DangerOutline,a.css(Je||(Je=m(["\n color: ",";\n "])),i.palette.red.light1)),y(We,ye.BaseGreen,a.css(Qe||(Qe=m(["\n color: ",";\n "])),i.palette.green.dark2)),We)),y(tn,me,(y(an={},ye.Primary,a.css(Ze||(Ze=m(["\n color: ",";\n "])),i.uiColors.white)),y(an,ye.PrimaryOutline,a.css($e||($e=m(["\n color: #0ad05b;\n "])))),y(an,ye.Default,a.css(en||(en=m(["\n color: ",";\n "])),i.uiColors.white)),y(an,ye.Danger,a.css(nn||(nn=m(["\n color: ",";\n "])),i.uiColors.white)),y(an,ye.DangerOutline,a.css(rn||(rn=m(["\n color: #f97216;\n "])))),y(an,ye.BaseGreen,a.css(on||(on=m(["\n color: ",";\n "])),i.uiColors.gray.light1)),an)),tn),On=a.css(ln||(ln=m(["\n ",":hover &,\n ",":active & {\n color: currentColor;\n } ;\n"])),Ge.selector,Ge.selector),Cn=(y(dn={},ke.XSmall,a.css(sn||(sn=m(["\n height: 14px;\n width: 14px;\n "])))),y(dn,ke.Small,a.css(cn||(cn=m(["\n height: 16px;\n width: 16px;\n "])))),y(dn,ke.Default,a.css(pn||(pn=m(["\n height: 16px;\n width: 16px;\n "])))),y(dn,ke.Large,a.css(un||(un=m(["\n height: 20px;\n width: 20px;\n "])))),dn),Dn=(y(bn={},we,a.css(gn||(gn=m(["\n color: ",";\n "])),i.palette.gray.light2)),y(bn,me,a.css(fn||(fn=m(["\n color: ",";\n "])),i.uiColors.gray.dark1)),bn),Pn=a.css(xn||(xn=m(["\n color: ",";\n"])),i.palette.gray.light1);function jn(e){var n,r=e.glyph,o=e.variant,t=e.size,l=e.darkMode,s=e.disabled,i=e.isIconOnlyButton,c=e.className,p=!i&&{"aria-hidden":!0,role:"presentation"},u=l?me:we,d=i?vn:mn;return g.default.cloneElement(r,h({className:a.cx(d[u][o],Cn[t],(n={},y(n,Dn[u],s),y(n,On,i),y(n,Pn,!l&&s&&i),n),c)},p))}jn.displayName="ButtonIcon";var zn,Gn,Sn,qn,Bn,Nn,Fn,Mn,En,Rn,Tn,In,Ln=["variant","size","darkMode","baseFontSize","disabled","leftGlyph","rightGlyph","children","className","as","type"],Xn=a.css(zn||(zn=m(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 6px;\n"]))),Kn=a.css(Gn||(Gn=m(["\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n pointer-events: none;\n position: relative;\n z-index: 0;\n"]))),Yn=(y(Fn={},ke.XSmall,a.css(Sn||(Sn=m(["\n padding: 0 8px;\n gap: 6px;\n "])))),y(Fn,ke.Small,a.css(qn||(qn=m(["\n padding: 0 12px;\n gap: 6px;\n "])))),y(Fn,ke.Default,a.css(Bn||(Bn=m(["\n padding: 0 12px;\n gap: 6px;\n "])))),y(Fn,ke.Large,a.css(Nn||(Nn=m(["\n padding: 0 16px;\n gap: 8px;\n "])))),Fn),_n=g.default.forwardRef((function(e,r){var o,s,i=e.variant,p=void 0===i?ye.Default:i,d=e.size,f=void 0===d?ke.Default:d,x=e.darkMode,v=void 0!==x&&x,O=e.baseFontSize,C=void 0===O?14:O,D=e.disabled,P=void 0!==D&&D,j=e.leftGlyph,z=e.rightGlyph,G=e.children,S=e.className,q=e.as,B=e.type,N=w(e,Ln),F=l.useUsingKeyboardContext().usingKeyboard,M=n.useRef(null);n.useEffect((function(){var e,n=wn[v?me:we][p];return null!=M.current&&(e=t.registerRipple(M.current,{backgroundColor:n})),e}),[M,p,v]);var E=null!==(o=(j||z)&&!G)&&void 0!==o&&o,R=function(e){var n=e.variant,r=e.size,o=e.darkMode,t=e.baseFontSize,l=e.disabled,s=e.showFocus,i=o?me:we,p=Ce[i][n],u=De[i][n],d=je[r],g=ze[i][t];return a.cx(Oe,p,y({},u,s),y({},Pe[i],l),g,d,y({},a.css(fe||(fe=m(["\n // TODO: Refresh - remove this logic\n font-family: ",";\n border-radius: 4px;\n "])),c.fontFamilies.default),"dark"===i))}({variant:p,size:f,darkMode:v,baseFontSize:C,disabled:P,showFocus:F}),T=!(!N.href&&"a"!==q||P),I=h(h(h({type:T?void 0:B||"button",className:a.cx(R,S),ref:r,as:T?"a":"button"},"string"!=typeof N.href&&{disabled:P}),{},{"aria-disabled":P},Ge.prop),N),L={variant:p,size:f,darkMode:v,disabled:P,isIconOnlyButton:E},X=u.jsx(g.default.Fragment,null,u.jsx("div",{className:a.cx(Xn,y({},a.css(Mn||(Mn=m(["\n border-radius: 3px;\n "]))),v)),ref:M}),u.jsx("div",{className:a.cx(Kn,Yn[f],(s={},y(s,a.css(En||(En=m(["\n justify-content: space-between;\n "]))),!!z&&v),y(s,a.css(Rn||(Rn=m(["\n font-family: ",";\n "])),c.fontFamilies.legacy),v),s))},j&&u.jsx(jn,k({glyph:j,className:a.css(Tn||(Tn=m(["\n justify-self: right;\n "])))},L)),G,z&&u.jsx(jn,k({glyph:z,className:a.css(In||(In=m(["\n justify-self: left;\n "])))},L))));return u.jsx(b.default,I,X)}));_n.displayName="Button",_n.propTypes={variant:f.default.oneOf(Object.values(ye)),darkMode:f.default.bool,baseFontSize:f.default.oneOf([14,16]),size:f.default.oneOf(Object.values(ke)),disabled:f.default.bool,leftGlyph:f.default.element,rightGlyph:f.default.element,href:f.default.string},e.Size=ke,e.Variant=ye,e.default=_n,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map

@@ -35,4 +35,6 @@ /// <reference types="react" />

href?: string;
type?: JSX.IntrinsicElements['button']['type'];
as?: keyof JSX.IntrinsicElements;
}
export { Variant, Size, Mode, FontSize, ButtonProps };
//# sourceMappingURL=types.d.ts.map
{
"name": "@leafygreen-ui/button",
"version": "13.0.0",
"version": "13.0.1",
"description": "leafyGreen UI Kit Button",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -91,3 +91,3 @@ # Button

| `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` |
| `as` | `'a' \| 'button'` | Determines the root element. An `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. | |

@@ -94,0 +94,0 @@ | `leftGlyph` | `React.ReactElement` | Glyph that will appear to the left of text, if there is text provided via the children prop. If no children are supplied to the component, passing an Icon here will render the button as an icon-only button. | |

@@ -41,4 +41,6 @@ const Variant = {

href?: string;
type?: JSX.IntrinsicElements['button']['type'];
as?: keyof JSX.IntrinsicElements;
}
export { Variant, Size, Mode, FontSize, ButtonProps };

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

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