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
6
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 20.0.0 to 20.0.1

10

CHANGELOG.md
# @leafygreen-ui/button
## 20.0.1
### Patch Changes
- 82e320ed4: Add focus styles to to override any global button styles
- Updated dependencies [2e8a572db]
- Updated dependencies [4ccc353e7]
- Updated dependencies [4ccc353e7]
- @leafygreen-ui/lib@10.2.1
## 20.0.0

@@ -4,0 +14,0 @@

2

dist/esm/index.js

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

import n,{useRef as e,useEffect as r}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{useDarkMode as i}from"@leafygreen-ui/leafygreen-provider";import{transitionDuration as c,fontFamilies as d,typeScales as g,BaseFontSize as s}from"@leafygreen-ui/tokens";import{registerRipple as b}from"@leafygreen-ui/ripple";import{createUniqueClassName as u,Theme as p,getTheme as h}from"@leafygreen-ui/lib";import{palette as f}from"@leafygreen-ui/palette";import{transparentize as x,mix as y}from"polished";function k(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){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){v(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function v(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function w(){return w=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},w.apply(this,arguments)}function O(n,e){if(null==n)return{};var r,o,a=function(n,e){if(null==n)return{};var r,o,a={},t=Object.keys(n);for(o=0;o<t.length;o++)r=t[o],e.indexOf(r)>=0||(a[r]=n[r]);return a}(n,e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);for(o=0;o<t.length;o++)r=t[o],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(a[r]=n[r])}return a}function D(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var P,j,z,G,B,S,N,M,E,L,q,F,C,I,X,H,R,T,Y,A,J,K,Q,U,V,W,Z,$,_,nn,en,rn,on,an,tn,ln,cn,dn,gn,sn,bn,un,pn,hn,fn,xn,yn,kn,mn,vn,wn=u("button"),On={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},Dn={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},Pn={Body1:13,Body2:16},jn=(v(X={},p.Light,(v(N={},On.Default,t(P||(P=D(["\n color: ",";\n "])),f.gray.base)),v(N,On.Primary,t(j||(j=D(["\n color: ",";\n "])),f.green.light2)),v(N,On.PrimaryOutline,t(z||(z=D(["\n color: ",";\n "])),f.green.dark2)),v(N,On.Danger,t(G||(G=D(["\n color: ",";\n "])),f.red.light3)),v(N,On.DangerOutline,t(B||(B=D(["\n color: ",";\n "])),f.red.light1)),v(N,On.BaseGreen,t(S||(S=D(["\n color: ",";\n "])),f.green.dark2)),N)),v(X,p.Dark,(v(I={},On.Default,t(M||(M=D(["\n color: ",";\n "])),f.gray.light2)),v(I,On.Primary,t(E||(E=D(["\n color: ",";\n "])),f.green.light2)),v(I,On.PrimaryOutline,t(L||(L=D(["\n color: ",";\n "])),f.green.base)),v(I,On.Danger,t(q||(q=D(["\n color: ",";\n "])),f.red.light2)),v(I,On.DangerOutline,t(F||(F=D(["\n color: ",";\n "])),f.red.light1)),v(I,On.BaseGreen,t(C||(C=D(["\n color: ",";\n "])),f.green.dark2)),I)),X),zn=(v(nn={},p.Light,(v(K={},On.Default,t(H||(H=D(["\n color: ",";\n "])),f.black)),v(K,On.Primary,t(R||(R=D(["\n color: ",";\n "])),f.white)),v(K,On.PrimaryOutline,t(T||(T=D(["\n color: ",";\n "])),f.green.dark2)),v(K,On.Danger,t(Y||(Y=D(["\n color: ",";\n "])),f.white)),v(K,On.DangerOutline,t(A||(A=D(["\n color: ",";\n "])),f.red.base)),v(K,On.BaseGreen,t(J||(J=D(["\n color: ",";\n "])),f.green.dark3)),K)),v(nn,p.Dark,(v(_={},On.Default,t(Q||(Q=D(["\n color: ",";\n "])),f.white)),v(_,On.Primary,t(U||(U=D(["\n color: ",";\n "])),f.white)),v(_,On.PrimaryOutline,t(V||(V=D(["\n color: ",";\n "])),f.green.base)),v(_,On.Danger,t(W||(W=D(["\n color: ",";\n "])),f.white)),v(_,On.DangerOutline,t(Z||(Z=D(["\n color: ",";\n "])),f.red.light1)),v(_,On.BaseGreen,t($||($=D(["\n color: ",";\n "])),f.green.dark3)),_)),nn),Gn=t(en||(en=D(["\n ."," {\n &:hover,\n &:active {\n color: currentColor;\n }\n }\n"])),wn),Bn=(v(ln={},Dn.XSmall,t(rn||(rn=D(["\n height: 14px;\n width: 14px;\n "])))),v(ln,Dn.Small,t(on||(on=D(["\n height: 16px;\n width: 16px;\n "])))),v(ln,Dn.Default,t(an||(an=D(["\n height: 16px;\n width: 16px;\n "])))),v(ln,Dn.Large,t(tn||(tn=D(["\n height: 20px;\n width: 20px;\n "])))),ln),Sn=(v(gn={},p.Light,t(cn||(cn=D(["\n color: ",";\n "])),f.gray.light1)),v(gn,p.Dark,t(dn||(dn=D(["\n color: ",";\n "])),f.gray.dark1)),gn),Nn=t(sn||(sn=D(["\n color: ",";\n"])),f.gray.dark2);function Mn(e){var r,o=e.glyph,a=e.variant,t=e.size,i=e.darkMode,c=e.disabled,d=e.isIconOnlyButton,g=e.className,s=!d&&{"aria-hidden":!0,role:"presentation"},b=h(i),u=d?zn:jn;return n.cloneElement(o,m({className:l(u[b][a],Bn[t],(r={},v(r,Gn,d),v(r,Sn[b],c),v(r,Nn,c&&d&&i),r),g)},s))}Mn.displayName="ButtonIcon";var En,Ln,qn,Fn,Cn,In,Xn,Hn,Rn,Tn,Yn,An,Jn,Kn,Qn,Un,Vn,Wn,Zn,$n,_n,ne,ee,re,oe,ae,te,le,ie,ce,de,ge,se,be,ue,pe,he,fe,xe,ye,ke,me,ve,we,Oe,De=(v(pn={},p.Light,(v(bn={},On.Default,f.gray.light2),v(bn,On.Primary,f.green.dark1),v(bn,On.PrimaryOutline,x(.76,f.green.base)),v(bn,On.Danger,f.red.light1),v(bn,On.DangerOutline,x(.76,f.red.base)),v(bn,On.BaseGreen,f.green.light1),bn)),v(pn,p.Dark,(v(un={},On.Default,f.gray.base),v(un,On.Primary,f.green.dark1),v(un,On.PrimaryOutline,x(.76,f.green.base)),v(un,On.Danger,f.red.dark2),v(un,On.DangerOutline,x(.76,f.red.light1)),v(un,On.BaseGreen,f.green.dark1),un)),pn),Pe=t(hn||(hn=D(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 5px;\n"]))),je=t(fn||(fn=D(["\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"]))),ze=(v(vn={},Dn.XSmall,t(xn||(xn=D(["\n padding: 0 7px; // 8px - 1px border\n gap: 6px;\n "])))),v(vn,Dn.Small,t(yn||(yn=D(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),v(vn,Dn.Default,t(kn||(kn=D(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),v(vn,Dn.Large,t(mn||(mn=D(["\n padding: 0 15px; // 16px - 1px border\n gap: 8px;\n "])))),vn),Ge=function(o){var a,c=o.rightGlyph,d=o.leftGlyph,g=o.darkMode,s=o.disabled,u=void 0!==s&&s,p=o.variant,h=void 0===p?On.Default:p,f=o.size,x=void 0===f?Dn.Default:f,y=o.children,k=i(g),m=k.darkMode,O=k.theme,P=e(null);r((function(){var n,e=De[O][h];return null==P.current||u||(n=b(P.current,{backgroundColor:e})),n}),[P,h,m,u,O]);var j=null!==(a=(d||c)&&!y)&&void 0!==a&&a,z={variant:h,size:x,darkMode:m,disabled:u,isIconOnlyButton:j};return n.createElement(n.Fragment,null,n.createElement("div",{className:l(Pe),ref:P}),n.createElement("div",{className:l(je,ze[x],v({},t(En||(En=D(["\n justify-content: space-between;\n "]))),!!c&&m))},d&&n.createElement(Mn,w({glyph:d,className:t(Ln||(Ln=D(["\n justify-self: right;\n "])))},z)),y,c&&n.createElement(Mn,w({glyph:c,className:t(qn||(qn=D(["\n justify-self: left;\n "])))},z))))},Be=function(n){return"\n 0 0 0 2px ".concat(n,", \n 0 0 0 4px ").concat(f.blue.light1,";\n")},Se=t(Fn||(Fn=D(["\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 ","ms 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 &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),c.default,d.default),Ne=(v(Zn={},p.Light,(v(Yn={},On.Default,t(Cn||(Cn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),f.gray.light3,f.gray.base,f.black,f.black,f.white,f.gray.light2)),v(Yn,On.Primary,t(In||(In=D(["\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 "])),f.green.dark2,f.green.dark2,f.white,f.white,f.green.light2)),v(Yn,On.PrimaryOutline,t(Xn||(Xn=D(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.green.dark2,f.green.dark2,f.green.dark2,x(.96,f.green.base),f.green.light2)),v(Yn,On.Danger,t(Hn||(Hn=D(["\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 "])),f.red.base,f.red.base,f.white,f.white,f.red.light3)),v(Yn,On.DangerOutline,t(Rn||(Rn=D(["\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 "])),f.red.light1,f.red.base,f.red.dark2,x(.96,f.red.base),f.red.base,f.red.light3)),v(Yn,On.BaseGreen,t(Tn||(Tn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.green.base,f.green.dark2,f.green.dark3,f.green.dark3,y(.96,f.green.base,f.green.dark3),f.green.light2)),Yn)),v(Zn,p.Dark,(v(Wn={},On.Default,t(An||(An=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n border-color: ",";\n color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.gray.dark2,f.gray.base,f.white,f.white,f.gray.dark1,f.gray.base,f.white,f.gray.dark2)),v(Wn,On.Primary,t(Jn||(Jn=D(["\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: #00593f; // Off palette\n box-shadow: 0 0 0 3px ",";\n }\n "])),f.green.dark2,f.green.base,f.white,f.white,f.white,f.green.dark3)),v(Wn,On.PrimaryOutline,t(Kn||(Kn=D(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.green.base,f.green.base,f.green.base,f.green.base,x(.96,f.green.base),f.green.base,f.green.dark3)),v(Wn,On.Danger,t(Qn||(Qn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n border-color: ",";\n color: ",";\n background-color: #c82222; // Off palette\n box-shadow: 0px 0px 0px 3px ","; // yes, yellow\n }\n "])),f.red.base,f.red.light1,f.white,f.white,f.red.light1,f.white,f.yellow.dark3)),v(Wn,On.DangerOutline,t(Un||(Un=D(["\n border-color: ",";\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 ","; // yes, yellow\n }\n "])),f.red.light1,f.red.light1,f.red.light1,f.red.light1,x(.96,f.red.base),f.yellow.dark3)),v(Wn,On.BaseGreen,t(Vn||(Vn=D(["\n background-color: ",";\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 "])),f.green.base,f.green.dark2,f.green.dark3,f.green.dark3,y(.96,f.green.base,f.green.light3),f.green.dark2,f.green.dark3)),Wn)),Zn),Me=(v(be={},p.Light,(v(ae={},On.Default,t($n||($n=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.white,Be(f.white))),v(ae,On.Primary,t(_n||(_n=D(["\n &:focus-visible {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),f.white,Be(f.white))),v(ae,On.PrimaryOutline,t(ne||(ne=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),x(.96,f.green.base),Be(f.white))),v(ae,On.Danger,t(ee||(ee=D(["\n &:focus-visible {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),f.white,Be(f.white))),v(ae,On.DangerOutline,t(re||(re=D(["\n &:focus-visible {\n color: ",";\n box-shadow: ",";\n }\n "])),f.red.dark2,Be(f.white))),v(ae,On.BaseGreen,t(oe||(oe=D(["\n &:focus-visible {\n box-shadow: ",";\n }\n "])),Be(f.white))),ae)),v(be,p.Dark,(v(se={},On.Default,t(te||(te=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.gray.dark1,Be(f.black))),v(se,On.Primary,t(le||(le=D(["\n &:focus-visible {\n background-color: #00593f; // Off palette\n box-shadow: ",";\n }\n "])),Be(f.black))),v(se,On.PrimaryOutline,t(ie||(ie=D(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),x(.96,f.green.base),f.green.base,Be(f.black))),v(se,On.Danger,t(ce||(ce=D(["\n &:focus-visible {\n background-color: #c82222; // Off palette\n box-shadow: ",";\n }\n "])),Be(f.black))),v(se,On.DangerOutline,t(de||(de=D(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),x(.96,f.red.base),f.red.light1,Be(f.black))),v(se,On.BaseGreen,t(ge||(ge=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.green.base,Be(f.black))),se)),be),Ee=(v(he={},p.Light,t(ue||(ue=D(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),f.gray.light2,f.gray.light1,f.gray.base,Be(f.white))),v(he,p.Dark,t(pe||(pe=D(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),f.gray.dark3,f.gray.dark1,f.gray.dark1,Be(f.black))),he),Le=(v(me={},Dn.XSmall,t(fe||(fe=D(["\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 "])))),v(me,Dn.Small,t(xe||(xe=D(["\n height: 28px;\n "])))),v(me,Dn.Default,t(ye||(ye=D(["\n height: 36px;\n "])))),v(me,Dn.Large,t(ke||(ke=D(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),me),qe=(v(Oe={},s.Body1,t(ve||(ve=D(["\n font-size: ","px;\n line-height: ","px;\n font-weight: 500; // Medium\n "])),g.body1.fontSize,g.body1.lineHeight)),v(Oe,s.Body2,t(we||(we=D(["\n font-size: ","px;\n line-height: ","px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500; // Medium\n "])),g.body2.fontSize,g.body2.lineHeight)),Oe);var Fe=["variant","size","darkMode","baseFontSize","disabled","onClick","leftGlyph","rightGlyph","children","className","as","type"],Ce=n.forwardRef((function(e,r){var o=e.variant,t=void 0===o?On.Default:o,c=e.size,d=void 0===c?Dn.Default:c,g=e.darkMode,b=e.baseFontSize,u=void 0===b?s.Body1:b,p=e.disabled,f=void 0!==p&&p,x=e.onClick,y=e.leftGlyph,k=e.rightGlyph,w=e.children,D=e.className,P=e.as,j=e.type,z=O(e,Fe),G=i(g).darkMode,B=function(n){var e=n.variant,r=n.size,o=n.darkMode,a=n.baseFontSize,t=n.disabled,i=h(o),c=Ne[i][e],d=Me[i][e];return l(Se,c,qe[a],Le[r],v({},d,!t),v({},Ee[i],t))}({variant:t,size:d,darkMode:G,baseFontSize:u,disabled:f}),S=!(!z.href&&"a"!==P||f),N=m({type:S?void 0:j||"button",className:l(wn,B,D),ref:r,as:P||(S?"a":"button"),"aria-disabled":f,onClick:f?void 0:x,href:f?void 0:z.href},z),M={rightGlyph:k,leftGlyph:y,darkMode:G,disabled:f,variant:t,size:d};return n.createElement(a,N,n.createElement(Ge,M,w))}));Ce.displayName="Button",Ce.propTypes={variant:o.oneOf(Object.values(On)),baseFontSize:o.oneOf(Object.values(s)),size:o.oneOf(Object.values(Dn)),darkMode:o.bool,disabled:o.bool,leftGlyph:o.element,rightGlyph:o.element,href:o.string};export{Pn as FontSize,Dn as Size,On as Variant,Ce as default};
import n,{useRef as e,useEffect as r}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{useDarkMode as i}from"@leafygreen-ui/leafygreen-provider";import{transitionDuration as c,fontFamilies as d,typeScales as g,BaseFontSize as s}from"@leafygreen-ui/tokens";import{registerRipple as b}from"@leafygreen-ui/ripple";import{createUniqueClassName as u,Theme as h,getTheme as p}from"@leafygreen-ui/lib";import{palette as f}from"@leafygreen-ui/palette";import{transparentize as y,mix as k}from"polished";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){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){v(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}function v(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function w(){return w=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},w.apply(this,arguments)}function O(n,e){if(null==n)return{};var r,o,a=function(n,e){if(null==n)return{};var r,o,a={},t=Object.keys(n);for(o=0;o<t.length;o++)r=t[o],e.indexOf(r)>=0||(a[r]=n[r]);return a}(n,e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);for(o=0;o<t.length;o++)r=t[o],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(a[r]=n[r])}return a}function D(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var P,j,z,G,B,S,N,M,E,L,q,F,C,I,X,H,R,T,Y,A,J,K,Q,U,V,W,Z,$,_,nn,en,rn,on,an,tn,ln,cn,dn,gn,sn,bn,un,hn,pn,fn,yn,kn,xn,mn,vn,wn=u("button"),On={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},Dn={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},Pn={Body1:13,Body2:16},jn=(v(X={},h.Light,(v(N={},On.Default,t(P||(P=D(["\n color: ",";\n "])),f.gray.base)),v(N,On.Primary,t(j||(j=D(["\n color: ",";\n "])),f.green.light2)),v(N,On.PrimaryOutline,t(z||(z=D(["\n color: ",";\n "])),f.green.dark2)),v(N,On.Danger,t(G||(G=D(["\n color: ",";\n "])),f.red.light3)),v(N,On.DangerOutline,t(B||(B=D(["\n color: ",";\n "])),f.red.light1)),v(N,On.BaseGreen,t(S||(S=D(["\n color: ",";\n "])),f.green.dark2)),N)),v(X,h.Dark,(v(I={},On.Default,t(M||(M=D(["\n color: ",";\n "])),f.gray.light2)),v(I,On.Primary,t(E||(E=D(["\n color: ",";\n "])),f.green.light2)),v(I,On.PrimaryOutline,t(L||(L=D(["\n color: ",";\n "])),f.green.base)),v(I,On.Danger,t(q||(q=D(["\n color: ",";\n "])),f.red.light2)),v(I,On.DangerOutline,t(F||(F=D(["\n color: ",";\n "])),f.red.light1)),v(I,On.BaseGreen,t(C||(C=D(["\n color: ",";\n "])),f.green.dark2)),I)),X),zn=(v(nn={},h.Light,(v(K={},On.Default,t(H||(H=D(["\n color: ",";\n "])),f.black)),v(K,On.Primary,t(R||(R=D(["\n color: ",";\n "])),f.white)),v(K,On.PrimaryOutline,t(T||(T=D(["\n color: ",";\n "])),f.green.dark2)),v(K,On.Danger,t(Y||(Y=D(["\n color: ",";\n "])),f.white)),v(K,On.DangerOutline,t(A||(A=D(["\n color: ",";\n "])),f.red.base)),v(K,On.BaseGreen,t(J||(J=D(["\n color: ",";\n "])),f.green.dark3)),K)),v(nn,h.Dark,(v(_={},On.Default,t(Q||(Q=D(["\n color: ",";\n "])),f.white)),v(_,On.Primary,t(U||(U=D(["\n color: ",";\n "])),f.white)),v(_,On.PrimaryOutline,t(V||(V=D(["\n color: ",";\n "])),f.green.base)),v(_,On.Danger,t(W||(W=D(["\n color: ",";\n "])),f.white)),v(_,On.DangerOutline,t(Z||(Z=D(["\n color: ",";\n "])),f.red.light1)),v(_,On.BaseGreen,t($||($=D(["\n color: ",";\n "])),f.green.dark3)),_)),nn),Gn=t(en||(en=D(["\n ."," {\n &:hover,\n &:active {\n color: currentColor;\n }\n }\n"])),wn),Bn=(v(ln={},Dn.XSmall,t(rn||(rn=D(["\n height: 14px;\n width: 14px;\n "])))),v(ln,Dn.Small,t(on||(on=D(["\n height: 16px;\n width: 16px;\n "])))),v(ln,Dn.Default,t(an||(an=D(["\n height: 16px;\n width: 16px;\n "])))),v(ln,Dn.Large,t(tn||(tn=D(["\n height: 20px;\n width: 20px;\n "])))),ln),Sn=(v(gn={},h.Light,t(cn||(cn=D(["\n color: ",";\n "])),f.gray.light1)),v(gn,h.Dark,t(dn||(dn=D(["\n color: ",";\n "])),f.gray.dark1)),gn),Nn=t(sn||(sn=D(["\n color: ",";\n"])),f.gray.dark2);function Mn(e){var r,o=e.glyph,a=e.variant,t=e.size,i=e.darkMode,c=e.disabled,d=e.isIconOnlyButton,g=e.className,s=!d&&{"aria-hidden":!0,role:"presentation"},b=p(i),u=d?zn:jn;return n.cloneElement(o,m({className:l(u[b][a],Bn[t],(r={},v(r,Gn,d),v(r,Sn[b],c),v(r,Nn,c&&d&&i),r),g)},s))}Mn.displayName="ButtonIcon";var En,Ln,qn,Fn,Cn,In,Xn,Hn,Rn,Tn,Yn,An,Jn,Kn,Qn,Un,Vn,Wn,Zn,$n,_n,ne,ee,re,oe,ae,te,le,ie,ce,de,ge,se,be,ue,he,pe,fe,ye,ke,xe,me,ve,we,Oe,De=(v(hn={},h.Light,(v(bn={},On.Default,f.gray.light2),v(bn,On.Primary,f.green.dark1),v(bn,On.PrimaryOutline,y(.76,f.green.base)),v(bn,On.Danger,f.red.light1),v(bn,On.DangerOutline,y(.76,f.red.base)),v(bn,On.BaseGreen,f.green.light1),bn)),v(hn,h.Dark,(v(un={},On.Default,f.gray.base),v(un,On.Primary,f.green.dark1),v(un,On.PrimaryOutline,y(.76,f.green.base)),v(un,On.Danger,f.red.dark2),v(un,On.DangerOutline,y(.76,f.red.light1)),v(un,On.BaseGreen,f.green.dark1),un)),hn),Pe=t(pn||(pn=D(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 5px;\n"]))),je=t(fn||(fn=D(["\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"]))),ze=(v(vn={},Dn.XSmall,t(yn||(yn=D(["\n padding: 0 7px; // 8px - 1px border\n gap: 6px;\n "])))),v(vn,Dn.Small,t(kn||(kn=D(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),v(vn,Dn.Default,t(xn||(xn=D(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),v(vn,Dn.Large,t(mn||(mn=D(["\n padding: 0 15px; // 16px - 1px border\n gap: 8px;\n "])))),vn),Ge=function(o){var a,c=o.rightGlyph,d=o.leftGlyph,g=o.darkMode,s=o.disabled,u=void 0!==s&&s,h=o.variant,p=void 0===h?On.Default:h,f=o.size,y=void 0===f?Dn.Default:f,k=o.children,x=i(g),m=x.darkMode,O=x.theme,P=e(null);r((function(){var n,e=De[O][p];return null==P.current||u||(n=b(P.current,{backgroundColor:e})),n}),[P,p,m,u,O]);var j=null!==(a=(d||c)&&!k)&&void 0!==a&&a,z={variant:p,size:y,darkMode:m,disabled:u,isIconOnlyButton:j};return n.createElement(n.Fragment,null,n.createElement("div",{className:l(Pe),ref:P}),n.createElement("div",{className:l(je,ze[y],v({},t(En||(En=D(["\n justify-content: space-between;\n "]))),!!c&&m))},d&&n.createElement(Mn,w({glyph:d,className:t(Ln||(Ln=D(["\n justify-self: right;\n "])))},z)),k,c&&n.createElement(Mn,w({glyph:c,className:t(qn||(qn=D(["\n justify-self: left;\n "])))},z))))},Be=function(n){return"\n 0 0 0 2px ".concat(n,", \n 0 0 0 4px ").concat(f.blue.light1,";\n")},Se=t(Fn||(Fn=D(["\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 ","ms 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 &:focus-visible {\n outline: none;\n }\n\n &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),c.default,d.default),Ne=(v(Zn={},h.Light,(v(Yn={},On.Default,t(Cn||(Cn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n // needed to override any global button styles\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),f.gray.light3,f.gray.base,f.black,f.black,f.black,f.white,f.gray.light2)),v(Yn,On.Primary,t(In||(In=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\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 "])),f.green.dark2,f.green.dark2,f.white,f.white,f.white,f.green.light2)),v(Yn,On.PrimaryOutline,t(Xn||(Xn=D(["\n background-color: transparent;\n border-color: ",";\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 "])),f.green.dark2,f.green.dark2,f.green.dark2,f.green.dark2,y(.96,f.green.base),f.green.light2)),v(Yn,On.Danger,t(Hn||(Hn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\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 "])),f.red.base,f.red.base,f.white,f.white,f.white,f.red.light3)),v(Yn,On.DangerOutline,t(Rn||(Rn=D(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.red.light1,f.red.base,f.red.base,f.red.dark2,y(.96,f.red.base),f.red.base,f.red.light3)),v(Yn,On.BaseGreen,t(Tn||(Tn=D(["\n background-color: ",";\n border-color: ",";\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 "])),f.green.base,f.green.dark2,f.green.dark3,f.green.dark3,f.green.dark3,k(.96,f.green.base,f.green.dark3),f.green.light2)),Yn)),v(Zn,h.Dark,(v(Wn={},On.Default,t(An||(An=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n border-color: ",";\n color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.gray.dark2,f.gray.base,f.white,f.white,f.gray.dark1,f.gray.base,f.white,f.gray.dark2)),v(Wn,On.Primary,t(Jn||(Jn=D(["\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: #00593f; // Off palette\n box-shadow: 0 0 0 3px ",";\n }\n "])),f.green.dark2,f.green.base,f.white,f.white,f.white,f.green.dark3)),v(Wn,On.PrimaryOutline,t(Kn||(Kn=D(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.green.base,f.green.base,f.green.base,f.green.base,y(.96,f.green.base),f.green.base,f.green.dark3)),v(Wn,On.Danger,t(Qn||(Qn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n border-color: ",";\n color: ",";\n background-color: #c82222; // Off palette\n box-shadow: 0px 0px 0px 3px ","; // yes, yellow\n }\n "])),f.red.base,f.red.light1,f.white,f.white,f.red.light1,f.white,f.yellow.dark3)),v(Wn,On.DangerOutline,t(Un||(Un=D(["\n border-color: ",";\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 ","; // yes, yellow\n }\n "])),f.red.light1,f.red.light1,f.red.light1,f.red.light1,y(.96,f.red.base),f.yellow.dark3)),v(Wn,On.BaseGreen,t(Vn||(Vn=D(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),f.green.base,f.green.dark2,f.green.dark3,f.green.dark3,f.green.dark3,k(.96,f.green.base,f.green.light3),f.green.dark2,f.green.dark3)),Wn)),Zn),Me=(v(be={},h.Light,(v(ae={},On.Default,t($n||($n=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.white,Be(f.white))),v(ae,On.Primary,t(_n||(_n=D(["\n &:focus-visible {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),f.white,Be(f.white))),v(ae,On.PrimaryOutline,t(ne||(ne=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),y(.96,f.green.base),Be(f.white))),v(ae,On.Danger,t(ee||(ee=D(["\n &:focus-visible {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),f.white,Be(f.white))),v(ae,On.DangerOutline,t(re||(re=D(["\n &:focus-visible {\n color: ",";\n box-shadow: ",";\n }\n "])),f.red.dark2,Be(f.white))),v(ae,On.BaseGreen,t(oe||(oe=D(["\n &:focus-visible {\n box-shadow: ",";\n }\n "])),Be(f.white))),ae)),v(be,h.Dark,(v(se={},On.Default,t(te||(te=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.gray.dark1,Be(f.black))),v(se,On.Primary,t(le||(le=D(["\n &:focus-visible {\n background-color: #00593f; // Off palette\n box-shadow: ",";\n }\n "])),Be(f.black))),v(se,On.PrimaryOutline,t(ie||(ie=D(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),y(.96,f.green.base),f.green.base,Be(f.black))),v(se,On.Danger,t(ce||(ce=D(["\n &:focus-visible {\n background-color: #c82222; // Off palette\n box-shadow: ",";\n }\n "])),Be(f.black))),v(se,On.DangerOutline,t(de||(de=D(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),y(.96,f.red.base),f.red.light1,Be(f.black))),v(se,On.BaseGreen,t(ge||(ge=D(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.green.base,Be(f.black))),se)),be),Ee=(v(pe={},h.Light,t(ue||(ue=D(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),f.gray.light2,f.gray.light1,f.gray.base,Be(f.white))),v(pe,h.Dark,t(he||(he=D(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),f.gray.dark3,f.gray.dark1,f.gray.dark1,Be(f.black))),pe),Le=(v(me={},Dn.XSmall,t(fe||(fe=D(["\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 "])))),v(me,Dn.Small,t(ye||(ye=D(["\n height: 28px;\n "])))),v(me,Dn.Default,t(ke||(ke=D(["\n height: 36px;\n "])))),v(me,Dn.Large,t(xe||(xe=D(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),me),qe=(v(Oe={},s.Body1,t(ve||(ve=D(["\n font-size: ","px;\n line-height: ","px;\n font-weight: 500; // Medium\n "])),g.body1.fontSize,g.body1.lineHeight)),v(Oe,s.Body2,t(we||(we=D(["\n font-size: ","px;\n line-height: ","px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500; // Medium\n "])),g.body2.fontSize,g.body2.lineHeight)),Oe);var Fe=["variant","size","darkMode","baseFontSize","disabled","onClick","leftGlyph","rightGlyph","children","className","as","type"],Ce=n.forwardRef((function(e,r){var o=e.variant,t=void 0===o?On.Default:o,c=e.size,d=void 0===c?Dn.Default:c,g=e.darkMode,b=e.baseFontSize,u=void 0===b?s.Body1:b,h=e.disabled,f=void 0!==h&&h,y=e.onClick,k=e.leftGlyph,x=e.rightGlyph,w=e.children,D=e.className,P=e.as,j=e.type,z=O(e,Fe),G=i(g).darkMode,B=function(n){var e=n.variant,r=n.size,o=n.darkMode,a=n.baseFontSize,t=n.disabled,i=p(o),c=Ne[i][e],d=Me[i][e];return l(Se,c,qe[a],Le[r],v({},d,!t),v({},Ee[i],t))}({variant:t,size:d,darkMode:G,baseFontSize:u,disabled:f}),S=!(!z.href&&"a"!==P||f),N=m({type:S?void 0:j||"button",className:l(wn,B,D),ref:r,as:P||(S?"a":"button"),"aria-disabled":f,onClick:f?void 0:y,href:f?void 0:z.href},z),M={rightGlyph:x,leftGlyph:k,darkMode:G,disabled:f,variant:t,size:d};return n.createElement(a,N,n.createElement(Ge,M,w))}));Ce.displayName="Button",Ce.propTypes={variant:o.oneOf(Object.values(On)),baseFontSize:o.oneOf(Object.values(s)),size:o.oneOf(Object.values(Dn)),darkMode:o.bool,disabled:o.bool,leftGlyph:o.element,rightGlyph:o.element,href:o.string};export{Pn as FontSize,Dn as Size,On as Variant,Ce as default};
//# 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/leafygreen-provider"),require("@leafygreen-ui/tokens"),require("@leafygreen-ui/ripple"),require("@leafygreen-ui/lib"),require("@leafygreen-ui/palette"),require("polished")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@leafygreen-ui/box","@leafygreen-ui/emotion","@leafygreen-ui/leafygreen-provider","@leafygreen-ui/tokens","@leafygreen-ui/ripple","@leafygreen-ui/lib","@leafygreen-ui/palette","polished"],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/leafygreen-provider"],e["@leafygreen-ui/tokens"],e["@leafygreen-ui/ripple"],e["@leafygreen-ui/lib"],e["@leafygreen-ui/palette"],e.polished)}(this,(function(e,n,t,r,a,o,l,i,s,c,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(n),u=d(t),b=d(r);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){y(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function y(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function x(){return x=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},x.apply(this,arguments)}function k(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function m(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var v,w,O,D,z,P,j,S,B,G,T,q,M,N,E,F,L,C,I,R,X,H,_,U,V,Y,A,J,K,Q,W,Z,$,ee,ne,te,re,ae,oe,le,ie,se,ce,pe,de,ge,ue,be,he,fe,ye=s.createUniqueClassName("button"),xe={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},ke={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},me=(y(E={},s.Theme.Light,(y(j={},xe.Default,a.css(v||(v=m(["\n color: ",";\n "])),c.palette.gray.base)),y(j,xe.Primary,a.css(w||(w=m(["\n color: ",";\n "])),c.palette.green.light2)),y(j,xe.PrimaryOutline,a.css(O||(O=m(["\n color: ",";\n "])),c.palette.green.dark2)),y(j,xe.Danger,a.css(D||(D=m(["\n color: ",";\n "])),c.palette.red.light3)),y(j,xe.DangerOutline,a.css(z||(z=m(["\n color: ",";\n "])),c.palette.red.light1)),y(j,xe.BaseGreen,a.css(P||(P=m(["\n color: ",";\n "])),c.palette.green.dark2)),j)),y(E,s.Theme.Dark,(y(N={},xe.Default,a.css(S||(S=m(["\n color: ",";\n "])),c.palette.gray.light2)),y(N,xe.Primary,a.css(B||(B=m(["\n color: ",";\n "])),c.palette.green.light2)),y(N,xe.PrimaryOutline,a.css(G||(G=m(["\n color: ",";\n "])),c.palette.green.base)),y(N,xe.Danger,a.css(T||(T=m(["\n color: ",";\n "])),c.palette.red.light2)),y(N,xe.DangerOutline,a.css(q||(q=m(["\n color: ",";\n "])),c.palette.red.light1)),y(N,xe.BaseGreen,a.css(M||(M=m(["\n color: ",";\n "])),c.palette.green.dark2)),N)),E),ve=(y(Q={},s.Theme.Light,(y(H={},xe.Default,a.css(F||(F=m(["\n color: ",";\n "])),c.palette.black)),y(H,xe.Primary,a.css(L||(L=m(["\n color: ",";\n "])),c.palette.white)),y(H,xe.PrimaryOutline,a.css(C||(C=m(["\n color: ",";\n "])),c.palette.green.dark2)),y(H,xe.Danger,a.css(I||(I=m(["\n color: ",";\n "])),c.palette.white)),y(H,xe.DangerOutline,a.css(R||(R=m(["\n color: ",";\n "])),c.palette.red.base)),y(H,xe.BaseGreen,a.css(X||(X=m(["\n color: ",";\n "])),c.palette.green.dark3)),H)),y(Q,s.Theme.Dark,(y(K={},xe.Default,a.css(_||(_=m(["\n color: ",";\n "])),c.palette.white)),y(K,xe.Primary,a.css(U||(U=m(["\n color: ",";\n "])),c.palette.white)),y(K,xe.PrimaryOutline,a.css(V||(V=m(["\n color: ",";\n "])),c.palette.green.base)),y(K,xe.Danger,a.css(Y||(Y=m(["\n color: ",";\n "])),c.palette.white)),y(K,xe.DangerOutline,a.css(A||(A=m(["\n color: ",";\n "])),c.palette.red.light1)),y(K,xe.BaseGreen,a.css(J||(J=m(["\n color: ",";\n "])),c.palette.green.dark3)),K)),Q),we=a.css(W||(W=m(["\n ."," {\n &:hover,\n &:active {\n color: currentColor;\n }\n }\n"])),ye),Oe=(y(te={},ke.XSmall,a.css(Z||(Z=m(["\n height: 14px;\n width: 14px;\n "])))),y(te,ke.Small,a.css($||($=m(["\n height: 16px;\n width: 16px;\n "])))),y(te,ke.Default,a.css(ee||(ee=m(["\n height: 16px;\n width: 16px;\n "])))),y(te,ke.Large,a.css(ne||(ne=m(["\n height: 20px;\n width: 20px;\n "])))),te),De=(y(oe={},s.Theme.Light,a.css(re||(re=m(["\n color: ",";\n "])),c.palette.gray.light1)),y(oe,s.Theme.Dark,a.css(ae||(ae=m(["\n color: ",";\n "])),c.palette.gray.dark1)),oe),ze=a.css(le||(le=m(["\n color: ",";\n"])),c.palette.gray.dark2);function Pe(e){var n,t=e.glyph,r=e.variant,o=e.size,l=e.darkMode,i=e.disabled,c=e.isIconOnlyButton,p=e.className,d=!c&&{"aria-hidden":!0,role:"presentation"},u=s.getTheme(l),b=c?ve:me;return g.default.cloneElement(t,f({className:a.cx(b[u][r],Oe[o],(n={},y(n,we,c),y(n,De[u],i),y(n,ze,i&&c&&l),n),p)},d))}Pe.displayName="ButtonIcon";var je,Se,Be,Ge,Te,qe,Me,Ne,Ee,Fe,Le,Ce,Ie,Re,Xe,He,_e,Ue,Ve,Ye,Ae,Je,Ke,Qe,We,Ze,$e,en,nn,tn,rn,an,on,ln,sn,cn,pn,dn,gn,un,bn,hn,fn,yn,xn,kn=.76,mn=(y(ce={},s.Theme.Light,(y(ie={},xe.Default,c.palette.gray.light2),y(ie,xe.Primary,c.palette.green.dark1),y(ie,xe.PrimaryOutline,p.transparentize(kn,c.palette.green.base)),y(ie,xe.Danger,c.palette.red.light1),y(ie,xe.DangerOutline,p.transparentize(kn,c.palette.red.base)),y(ie,xe.BaseGreen,c.palette.green.light1),ie)),y(ce,s.Theme.Dark,(y(se={},xe.Default,c.palette.gray.base),y(se,xe.Primary,c.palette.green.dark1),y(se,xe.PrimaryOutline,p.transparentize(kn,c.palette.green.base)),y(se,xe.Danger,c.palette.red.dark2),y(se,xe.DangerOutline,p.transparentize(kn,c.palette.red.light1)),y(se,xe.BaseGreen,c.palette.green.dark1),se)),ce),vn=a.css(pe||(pe=m(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 5px;\n"]))),wn=a.css(de||(de=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"]))),On=(y(fe={},ke.XSmall,a.css(ge||(ge=m(["\n padding: 0 7px; // 8px - 1px border\n gap: 6px;\n "])))),y(fe,ke.Small,a.css(ue||(ue=m(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),y(fe,ke.Default,a.css(be||(be=m(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),y(fe,ke.Large,a.css(he||(he=m(["\n padding: 0 15px; // 16px - 1px border\n gap: 8px;\n "])))),fe),Dn=function(e){var t,r=e.rightGlyph,l=e.leftGlyph,s=e.darkMode,c=e.disabled,p=void 0!==c&&c,d=e.variant,u=void 0===d?xe.Default:d,b=e.size,h=void 0===b?ke.Default:b,f=e.children,k=o.useDarkMode(s),v=k.darkMode,w=k.theme,O=n.useRef(null);n.useEffect((function(){var e,n=mn[w][u];return null==O.current||p||(e=i.registerRipple(O.current,{backgroundColor:n})),e}),[O,u,v,p,w]);var D=null!==(t=(l||r)&&!f)&&void 0!==t&&t,z={variant:u,size:h,darkMode:v,disabled:p,isIconOnlyButton:D};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:a.cx(vn),ref:O}),g.default.createElement("div",{className:a.cx(wn,On[h],y({},a.css(je||(je=m(["\n justify-content: space-between;\n "]))),!!r&&v))},l&&g.default.createElement(Pe,x({glyph:l,className:a.css(Se||(Se=m(["\n justify-self: right;\n "])))},z)),f,r&&g.default.createElement(Pe,x({glyph:r,className:a.css(Be||(Be=m(["\n justify-self: left;\n "])))},z))))},zn=function(e){return"\n 0 0 0 2px ".concat(e,", \n 0 0 0 4px ").concat(c.palette.blue.light1,";\n")},Pn=a.css(Ge||(Ge=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 ","ms 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 &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),l.transitionDuration.default,l.fontFamilies.default),jn=(y(Ve={},s.Theme.Light,(y(Le={},xe.Default,a.css(Te||(Te=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),c.palette.gray.light3,c.palette.gray.base,c.palette.black,c.palette.black,c.palette.white,c.palette.gray.light2)),y(Le,xe.Primary,a.css(qe||(qe=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 "])),c.palette.green.dark2,c.palette.green.dark2,c.palette.white,c.palette.white,c.palette.green.light2)),y(Le,xe.PrimaryOutline,a.css(Me||(Me=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.green.dark2,c.palette.green.dark2,c.palette.green.dark2,p.transparentize(.96,c.palette.green.base),c.palette.green.light2)),y(Le,xe.Danger,a.css(Ne||(Ne=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 "])),c.palette.red.base,c.palette.red.base,c.palette.white,c.palette.white,c.palette.red.light3)),y(Le,xe.DangerOutline,a.css(Ee||(Ee=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 "])),c.palette.red.light1,c.palette.red.base,c.palette.red.dark2,p.transparentize(.96,c.palette.red.base),c.palette.red.base,c.palette.red.light3)),y(Le,xe.BaseGreen,a.css(Fe||(Fe=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.green.base,c.palette.green.dark2,c.palette.green.dark3,c.palette.green.dark3,p.mix(.96,c.palette.green.base,c.palette.green.dark3),c.palette.green.light2)),Le)),y(Ve,s.Theme.Dark,(y(Ue={},xe.Default,a.css(Ce||(Ce=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n border-color: ",";\n color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.gray.dark2,c.palette.gray.base,c.palette.white,c.palette.white,c.palette.gray.dark1,c.palette.gray.base,c.palette.white,c.palette.gray.dark2)),y(Ue,xe.Primary,a.css(Ie||(Ie=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: #00593f; // Off palette\n box-shadow: 0 0 0 3px ",";\n }\n "])),c.palette.green.dark2,c.palette.green.base,c.palette.white,c.palette.white,c.palette.white,c.palette.green.dark3)),y(Ue,xe.PrimaryOutline,a.css(Re||(Re=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.green.base,c.palette.green.base,c.palette.green.base,c.palette.green.base,p.transparentize(.96,c.palette.green.base),c.palette.green.base,c.palette.green.dark3)),y(Ue,xe.Danger,a.css(Xe||(Xe=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n border-color: ",";\n color: ",";\n background-color: #c82222; // Off palette\n box-shadow: 0px 0px 0px 3px ","; // yes, yellow\n }\n "])),c.palette.red.base,c.palette.red.light1,c.palette.white,c.palette.white,c.palette.red.light1,c.palette.white,c.palette.yellow.dark3)),y(Ue,xe.DangerOutline,a.css(He||(He=m(["\n border-color: ",";\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 ","; // yes, yellow\n }\n "])),c.palette.red.light1,c.palette.red.light1,c.palette.red.light1,c.palette.red.light1,p.transparentize(.96,c.palette.red.base),c.palette.yellow.dark3)),y(Ue,xe.BaseGreen,a.css(_e||(_e=m(["\n background-color: ",";\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 "])),c.palette.green.base,c.palette.green.dark2,c.palette.green.dark3,c.palette.green.dark3,p.mix(.96,c.palette.green.base,c.palette.green.light3),c.palette.green.dark2,c.palette.green.dark3)),Ue)),Ve),Sn=(y(ln={},s.Theme.Light,(y(Ze={},xe.Default,a.css(Ye||(Ye=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c.palette.white,zn(c.palette.white))),y(Ze,xe.Primary,a.css(Ae||(Ae=m(["\n &:focus-visible {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),c.palette.white,zn(c.palette.white))),y(Ze,xe.PrimaryOutline,a.css(Je||(Je=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),p.transparentize(.96,c.palette.green.base),zn(c.palette.white))),y(Ze,xe.Danger,a.css(Ke||(Ke=m(["\n &:focus-visible {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),c.palette.white,zn(c.palette.white))),y(Ze,xe.DangerOutline,a.css(Qe||(Qe=m(["\n &:focus-visible {\n color: ",";\n box-shadow: ",";\n }\n "])),c.palette.red.dark2,zn(c.palette.white))),y(Ze,xe.BaseGreen,a.css(We||(We=m(["\n &:focus-visible {\n box-shadow: ",";\n }\n "])),zn(c.palette.white))),Ze)),y(ln,s.Theme.Dark,(y(on={},xe.Default,a.css($e||($e=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c.palette.gray.dark1,zn(c.palette.black))),y(on,xe.Primary,a.css(en||(en=m(["\n &:focus-visible {\n background-color: #00593f; // Off palette\n box-shadow: ",";\n }\n "])),zn(c.palette.black))),y(on,xe.PrimaryOutline,a.css(nn||(nn=m(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),p.transparentize(.96,c.palette.green.base),c.palette.green.base,zn(c.palette.black))),y(on,xe.Danger,a.css(tn||(tn=m(["\n &:focus-visible {\n background-color: #c82222; // Off palette\n box-shadow: ",";\n }\n "])),zn(c.palette.black))),y(on,xe.DangerOutline,a.css(rn||(rn=m(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),p.transparentize(.96,c.palette.red.base),c.palette.red.light1,zn(c.palette.black))),y(on,xe.BaseGreen,a.css(an||(an=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c.palette.green.base,zn(c.palette.black))),on)),ln),Bn=(y(pn={},s.Theme.Light,a.css(sn||(sn=m(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),c.palette.gray.light2,c.palette.gray.light1,c.palette.gray.base,zn(c.palette.white))),y(pn,s.Theme.Dark,a.css(cn||(cn=m(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),c.palette.gray.dark3,c.palette.gray.dark1,c.palette.gray.dark1,zn(c.palette.black))),pn),Gn=(y(hn={},ke.XSmall,a.css(dn||(dn=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(hn,ke.Small,a.css(gn||(gn=m(["\n height: 28px;\n "])))),y(hn,ke.Default,a.css(un||(un=m(["\n height: 36px;\n "])))),y(hn,ke.Large,a.css(bn||(bn=m(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),hn),Tn=(y(xn={},l.BaseFontSize.Body1,a.css(fn||(fn=m(["\n font-size: ","px;\n line-height: ","px;\n font-weight: 500; // Medium\n "])),l.typeScales.body1.fontSize,l.typeScales.body1.lineHeight)),y(xn,l.BaseFontSize.Body2,a.css(yn||(yn=m(["\n font-size: ","px;\n line-height: ","px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500; // Medium\n "])),l.typeScales.body2.fontSize,l.typeScales.body2.lineHeight)),xn);var qn=["variant","size","darkMode","baseFontSize","disabled","onClick","leftGlyph","rightGlyph","children","className","as","type"],Mn=g.default.forwardRef((function(e,n){var t=e.variant,r=void 0===t?xe.Default:t,i=e.size,c=void 0===i?ke.Default:i,p=e.darkMode,d=e.baseFontSize,u=void 0===d?l.BaseFontSize.Body1:d,h=e.disabled,x=void 0!==h&&h,m=e.onClick,v=e.leftGlyph,w=e.rightGlyph,O=e.children,D=e.className,z=e.as,P=e.type,j=k(e,qn),S=o.useDarkMode(p).darkMode,B=function(e){var n=e.variant,t=e.size,r=e.darkMode,o=e.baseFontSize,l=e.disabled,i=s.getTheme(r),c=jn[i][n],p=Sn[i][n],d=Gn[t],g=Tn[o];return a.cx(Pn,c,g,d,y({},p,!l),y({},Bn[i],l))}({variant:r,size:c,darkMode:S,baseFontSize:u,disabled:x}),G=!(!j.href&&"a"!==z||x),T=f({type:G?void 0:P||"button",className:a.cx(ye,B,D),ref:n,as:z||(G?"a":"button"),"aria-disabled":x,onClick:x?void 0:m,href:x?void 0:j.href},j),q={rightGlyph:w,leftGlyph:v,darkMode:S,disabled:x,variant:r,size:c};return g.default.createElement(b.default,T,g.default.createElement(Dn,q,O))}));Mn.displayName="Button",Mn.propTypes={variant:u.default.oneOf(Object.values(xe)),baseFontSize:u.default.oneOf(Object.values(l.BaseFontSize)),size:u.default.oneOf(Object.values(ke)),darkMode:u.default.bool,disabled:u.default.bool,leftGlyph:u.default.element,rightGlyph:u.default.element,href:u.default.string},e.FontSize={Body1:13,Body2:16},e.Size=ke,e.Variant=xe,e.default=Mn,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/leafygreen-provider"),require("@leafygreen-ui/tokens"),require("@leafygreen-ui/ripple"),require("@leafygreen-ui/lib"),require("@leafygreen-ui/palette"),require("polished")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@leafygreen-ui/box","@leafygreen-ui/emotion","@leafygreen-ui/leafygreen-provider","@leafygreen-ui/tokens","@leafygreen-ui/ripple","@leafygreen-ui/lib","@leafygreen-ui/palette","polished"],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/leafygreen-provider"],e["@leafygreen-ui/tokens"],e["@leafygreen-ui/ripple"],e["@leafygreen-ui/lib"],e["@leafygreen-ui/palette"],e.polished)}(this,(function(e,n,t,r,a,o,l,i,s,c,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=d(n),u=d(t),b=d(r);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){y(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function y(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function x(){return x=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},x.apply(this,arguments)}function k(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function m(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}var v,w,O,D,z,P,j,S,B,G,T,q,M,N,E,F,L,C,I,R,X,H,_,U,V,Y,A,J,K,Q,W,Z,$,ee,ne,te,re,ae,oe,le,ie,se,ce,pe,de,ge,ue,be,fe,he,ye=s.createUniqueClassName("button"),xe={Default:"default",Primary:"primary",PrimaryOutline:"primaryOutline",Danger:"danger",DangerOutline:"dangerOutline",BaseGreen:"baseGreen"},ke={XSmall:"xsmall",Small:"small",Default:"default",Large:"large"},me=(y(E={},s.Theme.Light,(y(j={},xe.Default,a.css(v||(v=m(["\n color: ",";\n "])),c.palette.gray.base)),y(j,xe.Primary,a.css(w||(w=m(["\n color: ",";\n "])),c.palette.green.light2)),y(j,xe.PrimaryOutline,a.css(O||(O=m(["\n color: ",";\n "])),c.palette.green.dark2)),y(j,xe.Danger,a.css(D||(D=m(["\n color: ",";\n "])),c.palette.red.light3)),y(j,xe.DangerOutline,a.css(z||(z=m(["\n color: ",";\n "])),c.palette.red.light1)),y(j,xe.BaseGreen,a.css(P||(P=m(["\n color: ",";\n "])),c.palette.green.dark2)),j)),y(E,s.Theme.Dark,(y(N={},xe.Default,a.css(S||(S=m(["\n color: ",";\n "])),c.palette.gray.light2)),y(N,xe.Primary,a.css(B||(B=m(["\n color: ",";\n "])),c.palette.green.light2)),y(N,xe.PrimaryOutline,a.css(G||(G=m(["\n color: ",";\n "])),c.palette.green.base)),y(N,xe.Danger,a.css(T||(T=m(["\n color: ",";\n "])),c.palette.red.light2)),y(N,xe.DangerOutline,a.css(q||(q=m(["\n color: ",";\n "])),c.palette.red.light1)),y(N,xe.BaseGreen,a.css(M||(M=m(["\n color: ",";\n "])),c.palette.green.dark2)),N)),E),ve=(y(Q={},s.Theme.Light,(y(H={},xe.Default,a.css(F||(F=m(["\n color: ",";\n "])),c.palette.black)),y(H,xe.Primary,a.css(L||(L=m(["\n color: ",";\n "])),c.palette.white)),y(H,xe.PrimaryOutline,a.css(C||(C=m(["\n color: ",";\n "])),c.palette.green.dark2)),y(H,xe.Danger,a.css(I||(I=m(["\n color: ",";\n "])),c.palette.white)),y(H,xe.DangerOutline,a.css(R||(R=m(["\n color: ",";\n "])),c.palette.red.base)),y(H,xe.BaseGreen,a.css(X||(X=m(["\n color: ",";\n "])),c.palette.green.dark3)),H)),y(Q,s.Theme.Dark,(y(K={},xe.Default,a.css(_||(_=m(["\n color: ",";\n "])),c.palette.white)),y(K,xe.Primary,a.css(U||(U=m(["\n color: ",";\n "])),c.palette.white)),y(K,xe.PrimaryOutline,a.css(V||(V=m(["\n color: ",";\n "])),c.palette.green.base)),y(K,xe.Danger,a.css(Y||(Y=m(["\n color: ",";\n "])),c.palette.white)),y(K,xe.DangerOutline,a.css(A||(A=m(["\n color: ",";\n "])),c.palette.red.light1)),y(K,xe.BaseGreen,a.css(J||(J=m(["\n color: ",";\n "])),c.palette.green.dark3)),K)),Q),we=a.css(W||(W=m(["\n ."," {\n &:hover,\n &:active {\n color: currentColor;\n }\n }\n"])),ye),Oe=(y(te={},ke.XSmall,a.css(Z||(Z=m(["\n height: 14px;\n width: 14px;\n "])))),y(te,ke.Small,a.css($||($=m(["\n height: 16px;\n width: 16px;\n "])))),y(te,ke.Default,a.css(ee||(ee=m(["\n height: 16px;\n width: 16px;\n "])))),y(te,ke.Large,a.css(ne||(ne=m(["\n height: 20px;\n width: 20px;\n "])))),te),De=(y(oe={},s.Theme.Light,a.css(re||(re=m(["\n color: ",";\n "])),c.palette.gray.light1)),y(oe,s.Theme.Dark,a.css(ae||(ae=m(["\n color: ",";\n "])),c.palette.gray.dark1)),oe),ze=a.css(le||(le=m(["\n color: ",";\n"])),c.palette.gray.dark2);function Pe(e){var n,t=e.glyph,r=e.variant,o=e.size,l=e.darkMode,i=e.disabled,c=e.isIconOnlyButton,p=e.className,d=!c&&{"aria-hidden":!0,role:"presentation"},u=s.getTheme(l),b=c?ve:me;return g.default.cloneElement(t,h({className:a.cx(b[u][r],Oe[o],(n={},y(n,we,c),y(n,De[u],i),y(n,ze,i&&c&&l),n),p)},d))}Pe.displayName="ButtonIcon";var je,Se,Be,Ge,Te,qe,Me,Ne,Ee,Fe,Le,Ce,Ie,Re,Xe,He,_e,Ue,Ve,Ye,Ae,Je,Ke,Qe,We,Ze,$e,en,nn,tn,rn,an,on,ln,sn,cn,pn,dn,gn,un,bn,fn,hn,yn,xn,kn=.76,mn=(y(ce={},s.Theme.Light,(y(ie={},xe.Default,c.palette.gray.light2),y(ie,xe.Primary,c.palette.green.dark1),y(ie,xe.PrimaryOutline,p.transparentize(kn,c.palette.green.base)),y(ie,xe.Danger,c.palette.red.light1),y(ie,xe.DangerOutline,p.transparentize(kn,c.palette.red.base)),y(ie,xe.BaseGreen,c.palette.green.light1),ie)),y(ce,s.Theme.Dark,(y(se={},xe.Default,c.palette.gray.base),y(se,xe.Primary,c.palette.green.dark1),y(se,xe.PrimaryOutline,p.transparentize(kn,c.palette.green.base)),y(se,xe.Danger,c.palette.red.dark2),y(se,xe.DangerOutline,p.transparentize(kn,c.palette.red.light1)),y(se,xe.BaseGreen,c.palette.green.dark1),se)),ce),vn=a.css(pe||(pe=m(["\n overflow: hidden;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 5px;\n"]))),wn=a.css(de||(de=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"]))),On=(y(he={},ke.XSmall,a.css(ge||(ge=m(["\n padding: 0 7px; // 8px - 1px border\n gap: 6px;\n "])))),y(he,ke.Small,a.css(ue||(ue=m(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),y(he,ke.Default,a.css(be||(be=m(["\n padding: 0 11px; // 12px - 1px border\n gap: 6px;\n "])))),y(he,ke.Large,a.css(fe||(fe=m(["\n padding: 0 15px; // 16px - 1px border\n gap: 8px;\n "])))),he),Dn=function(e){var t,r=e.rightGlyph,l=e.leftGlyph,s=e.darkMode,c=e.disabled,p=void 0!==c&&c,d=e.variant,u=void 0===d?xe.Default:d,b=e.size,f=void 0===b?ke.Default:b,h=e.children,k=o.useDarkMode(s),v=k.darkMode,w=k.theme,O=n.useRef(null);n.useEffect((function(){var e,n=mn[w][u];return null==O.current||p||(e=i.registerRipple(O.current,{backgroundColor:n})),e}),[O,u,v,p,w]);var D=null!==(t=(l||r)&&!h)&&void 0!==t&&t,z={variant:u,size:f,darkMode:v,disabled:p,isIconOnlyButton:D};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:a.cx(vn),ref:O}),g.default.createElement("div",{className:a.cx(wn,On[f],y({},a.css(je||(je=m(["\n justify-content: space-between;\n "]))),!!r&&v))},l&&g.default.createElement(Pe,x({glyph:l,className:a.css(Se||(Se=m(["\n justify-self: right;\n "])))},z)),h,r&&g.default.createElement(Pe,x({glyph:r,className:a.css(Be||(Be=m(["\n justify-self: left;\n "])))},z))))},zn=function(e){return"\n 0 0 0 2px ".concat(e,", \n 0 0 0 4px ").concat(c.palette.blue.light1,";\n")},Pn=a.css(Ge||(Ge=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 ","ms 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 &:focus-visible {\n outline: none;\n }\n\n &:active,\n &:focus,\n &:hover {\n text-decoration: none;\n }\n"])),l.transitionDuration.default,l.fontFamilies.default),jn=(y(Ve={},s.Theme.Light,(y(Le={},xe.Default,a.css(Te||(Te=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n // needed to override any global button styles\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n box-shadow: 0 0 0 3px ",";\n }\n "])),c.palette.gray.light3,c.palette.gray.base,c.palette.black,c.palette.black,c.palette.black,c.palette.white,c.palette.gray.light2)),y(Le,xe.Primary,a.css(qe||(qe=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\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 "])),c.palette.green.dark2,c.palette.green.dark2,c.palette.white,c.palette.white,c.palette.white,c.palette.green.light2)),y(Le,xe.PrimaryOutline,a.css(Me||(Me=m(["\n background-color: transparent;\n border-color: ",";\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 "])),c.palette.green.dark2,c.palette.green.dark2,c.palette.green.dark2,c.palette.green.dark2,p.transparentize(.96,c.palette.green.base),c.palette.green.light2)),y(Le,xe.Danger,a.css(Ne||(Ne=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\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 "])),c.palette.red.base,c.palette.red.base,c.palette.white,c.palette.white,c.palette.white,c.palette.red.light3)),y(Le,xe.DangerOutline,a.css(Ee||(Ee=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.red.light1,c.palette.red.base,c.palette.red.base,c.palette.red.dark2,p.transparentize(.96,c.palette.red.base),c.palette.red.base,c.palette.red.light3)),y(Le,xe.BaseGreen,a.css(Fe||(Fe=m(["\n background-color: ",";\n border-color: ",";\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 "])),c.palette.green.base,c.palette.green.dark2,c.palette.green.dark3,c.palette.green.dark3,c.palette.green.dark3,p.mix(.96,c.palette.green.base,c.palette.green.dark3),c.palette.green.light2)),Le)),y(Ve,s.Theme.Dark,(y(Ue={},xe.Default,a.css(Ce||(Ce=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n background-color: ",";\n border-color: ",";\n color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.gray.dark2,c.palette.gray.base,c.palette.white,c.palette.white,c.palette.gray.dark1,c.palette.gray.base,c.palette.white,c.palette.gray.dark2)),y(Ue,xe.Primary,a.css(Ie||(Ie=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: #00593f; // Off palette\n box-shadow: 0 0 0 3px ",";\n }\n "])),c.palette.green.dark2,c.palette.green.base,c.palette.white,c.palette.white,c.palette.white,c.palette.green.dark3)),y(Ue,xe.PrimaryOutline,a.css(Re||(Re=m(["\n background-color: transparent;\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.green.base,c.palette.green.base,c.palette.green.base,c.palette.green.base,p.transparentize(.96,c.palette.green.base),c.palette.green.base,c.palette.green.dark3)),y(Ue,xe.Danger,a.css(Xe||(Xe=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n border-color: ",";\n color: ",";\n background-color: #c82222; // Off palette\n box-shadow: 0px 0px 0px 3px ","; // yes, yellow\n }\n "])),c.palette.red.base,c.palette.red.light1,c.palette.white,c.palette.white,c.palette.red.light1,c.palette.white,c.palette.yellow.dark3)),y(Ue,xe.DangerOutline,a.css(He||(He=m(["\n border-color: ",";\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 ","; // yes, yellow\n }\n "])),c.palette.red.light1,c.palette.red.light1,c.palette.red.light1,c.palette.red.light1,p.transparentize(.96,c.palette.red.base),c.palette.yellow.dark3)),y(Ue,xe.BaseGreen,a.css(_e||(_e=m(["\n background-color: ",";\n border-color: ",";\n color: ",";\n\n &:focus {\n color: ",";\n }\n\n &:hover,\n &:active {\n color: ",";\n background-color: ",";\n border-color: ",";\n box-shadow: 0px 0px 0px 3px ",";\n }\n "])),c.palette.green.base,c.palette.green.dark2,c.palette.green.dark3,c.palette.green.dark3,c.palette.green.dark3,p.mix(.96,c.palette.green.base,c.palette.green.light3),c.palette.green.dark2,c.palette.green.dark3)),Ue)),Ve),Sn=(y(ln={},s.Theme.Light,(y(Ze={},xe.Default,a.css(Ye||(Ye=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c.palette.white,zn(c.palette.white))),y(Ze,xe.Primary,a.css(Ae||(Ae=m(["\n &:focus-visible {\n color: ",";\n background-color: #00593f; // Not quite dark3\n box-shadow: ",";\n }\n "])),c.palette.white,zn(c.palette.white))),y(Ze,xe.PrimaryOutline,a.css(Je||(Je=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),p.transparentize(.96,c.palette.green.base),zn(c.palette.white))),y(Ze,xe.Danger,a.css(Ke||(Ke=m(["\n &:focus-visible {\n color: ",";\n background-color: #c82222; // not quite dark1\n box-shadow: ",";\n }\n "])),c.palette.white,zn(c.palette.white))),y(Ze,xe.DangerOutline,a.css(Qe||(Qe=m(["\n &:focus-visible {\n color: ",";\n box-shadow: ",";\n }\n "])),c.palette.red.dark2,zn(c.palette.white))),y(Ze,xe.BaseGreen,a.css(We||(We=m(["\n &:focus-visible {\n box-shadow: ",";\n }\n "])),zn(c.palette.white))),Ze)),y(ln,s.Theme.Dark,(y(on={},xe.Default,a.css($e||($e=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c.palette.gray.dark1,zn(c.palette.black))),y(on,xe.Primary,a.css(en||(en=m(["\n &:focus-visible {\n background-color: #00593f; // Off palette\n box-shadow: ",";\n }\n "])),zn(c.palette.black))),y(on,xe.PrimaryOutline,a.css(nn||(nn=m(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),p.transparentize(.96,c.palette.green.base),c.palette.green.base,zn(c.palette.black))),y(on,xe.Danger,a.css(tn||(tn=m(["\n &:focus-visible {\n background-color: #c82222; // Off palette\n box-shadow: ",";\n }\n "])),zn(c.palette.black))),y(on,xe.DangerOutline,a.css(rn||(rn=m(["\n &:focus-visible {\n background-color: ",";\n border-color: ",";\n box-shadow: ",";\n }\n "])),p.transparentize(.96,c.palette.red.base),c.palette.red.light1,zn(c.palette.black))),y(on,xe.BaseGreen,a.css(an||(an=m(["\n &:focus-visible {\n background-color: ",";\n box-shadow: ",";\n }\n "])),c.palette.green.base,zn(c.palette.black))),on)),ln),Bn=(y(pn={},s.Theme.Light,a.css(sn||(sn=m(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),c.palette.gray.light2,c.palette.gray.light1,c.palette.gray.base,zn(c.palette.white))),y(pn,s.Theme.Dark,a.css(cn||(cn=m(["\n &,\n &:hover {\n background-color: ",";\n border-color: ",";\n color: ",";\n cursor: not-allowed;\n }\n\n &:focus {\n box-shadow: ",";\n }\n "])),c.palette.gray.dark3,c.palette.gray.dark1,c.palette.gray.dark1,zn(c.palette.black))),pn),Gn=(y(fn={},ke.XSmall,a.css(dn||(dn=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(fn,ke.Small,a.css(gn||(gn=m(["\n height: 28px;\n "])))),y(fn,ke.Default,a.css(un||(un=m(["\n height: 36px;\n "])))),y(fn,ke.Large,a.css(bn||(bn=m(["\n height: 48px;\n font-size: 18px;\n line-height: 24px;\n "])))),fn),Tn=(y(xn={},l.BaseFontSize.Body1,a.css(hn||(hn=m(["\n font-size: ","px;\n line-height: ","px;\n font-weight: 500; // Medium\n "])),l.typeScales.body1.fontSize,l.typeScales.body1.lineHeight)),y(xn,l.BaseFontSize.Body2,a.css(yn||(yn=m(["\n font-size: ","px;\n line-height: ","px;\n // Pixel pushing for optical alignment purposes\n transform: translateY(1px);\n font-weight: 500; // Medium\n "])),l.typeScales.body2.fontSize,l.typeScales.body2.lineHeight)),xn);var qn=["variant","size","darkMode","baseFontSize","disabled","onClick","leftGlyph","rightGlyph","children","className","as","type"],Mn=g.default.forwardRef((function(e,n){var t=e.variant,r=void 0===t?xe.Default:t,i=e.size,c=void 0===i?ke.Default:i,p=e.darkMode,d=e.baseFontSize,u=void 0===d?l.BaseFontSize.Body1:d,f=e.disabled,x=void 0!==f&&f,m=e.onClick,v=e.leftGlyph,w=e.rightGlyph,O=e.children,D=e.className,z=e.as,P=e.type,j=k(e,qn),S=o.useDarkMode(p).darkMode,B=function(e){var n=e.variant,t=e.size,r=e.darkMode,o=e.baseFontSize,l=e.disabled,i=s.getTheme(r),c=jn[i][n],p=Sn[i][n],d=Gn[t],g=Tn[o];return a.cx(Pn,c,g,d,y({},p,!l),y({},Bn[i],l))}({variant:r,size:c,darkMode:S,baseFontSize:u,disabled:x}),G=!(!j.href&&"a"!==z||x),T=h({type:G?void 0:P||"button",className:a.cx(ye,B,D),ref:n,as:z||(G?"a":"button"),"aria-disabled":x,onClick:x?void 0:m,href:x?void 0:j.href},j),q={rightGlyph:w,leftGlyph:v,darkMode:S,disabled:x,variant:r,size:c};return g.default.createElement(b.default,T,g.default.createElement(Dn,q,O))}));Mn.displayName="Button",Mn.propTypes={variant:u.default.oneOf(Object.values(xe)),baseFontSize:u.default.oneOf(Object.values(l.BaseFontSize)),size:u.default.oneOf(Object.values(ke)),darkMode:u.default.bool,disabled:u.default.bool,leftGlyph:u.default.element,rightGlyph:u.default.element,href:u.default.string},e.FontSize={Body1:13,Body2:16},e.Size=ke,e.Variant=xe,e.default=Mn,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map
{
"name": "@leafygreen-ui/button",
"version": "20.0.0",
"version": "20.0.1",
"description": "leafyGreen UI Kit Button",

@@ -25,3 +25,3 @@ "main": "./dist/index.js",

"@leafygreen-ui/emotion": "^4.0.3",
"@leafygreen-ui/lib": "^10.1.0",
"@leafygreen-ui/lib": "^10.2.1",
"@leafygreen-ui/palette": "^3.4.7",

@@ -28,0 +28,0 @@ "@leafygreen-ui/ripple": "^1.1.8",

@@ -37,3 +37,4 @@ import { mix, transparentize } from 'polished';

&:focus {
&:focus,
&:focus-visible {
outline: none;

@@ -56,2 +57,7 @@ }

// needed to override any global button styles
&:focus {
color: ${palette.black};
}
&:hover,

@@ -70,2 +76,6 @@ &:active {

&:focus {
color: ${palette.white};
}
&:hover,

@@ -85,2 +95,6 @@ &:active {

&:focus {
color: ${palette.green.dark2};
}
&:hover,

@@ -99,2 +113,6 @@ &:active {

&:focus {
color: ${palette.white};
}
&:hover,

@@ -114,2 +132,6 @@ &:active {

&:focus {
color: ${palette.red.base};
}
&:hover,

@@ -129,2 +151,6 @@ &:active {

&:focus {
color: ${palette.green.dark3};
}
&:hover,

@@ -230,2 +256,6 @@ &:active {

&:focus {
color: ${palette.green.dark3};
}
&:hover,

@@ -232,0 +262,0 @@ &:active {

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