@zonos/amino 5.1.48 → 5.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react"),o=require("styled-components"),r=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function u(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var s,d,l,h,g,p,b,m,f,x,k=u(o),v=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},w=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},y=k.default.span(s||(s=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),c.theme.radius6,c.theme.space8),_=k.default.button(d||(d=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n &.loading {\n color: transparent;\n }\n\n &[disabled] {\n cursor: not-allowed;\n .content {\n opacity: ",";\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n &.loading {\n color: transparent;\n }\n\n &[disabled] {\n cursor: not-allowed;\n .content {\n opacity: ",";\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.fontSizeBase,c.theme.space16,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.radius6);case"lg":case"xl":return"".concat(c.theme.radius10);default:return"".concat(c.theme.radius8)}}(n.size)}),c.theme.transition,(function(n){return function(n){switch(n){case"lg":case"xl":return 600;default:return 500}}(n.size)}),c.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.space4," ").concat(c.theme.space8);case"lg":case"xl":return"".concat(c.theme.space12," ").concat(c.theme.space24);default:return"".concat(c.theme.space8," ").concat(c.theme.space16)}}(n.size)}),(function(n){return n.fitContentWidth&&"fit-content"}),c.theme.space4,(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return n.outline?.6:1})),j=k.default(_)(l||(l=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.color)||n.outline?c.theme.primary:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.primary," inset"):c.theme.shadowButtonPrimary}),(function(n){return v(n.background)||n.outline?"transparent":c.theme.primary}),(function(n){return v(n.hoverBackground)||n.outline?c.theme.blue100:""}),(function(n){return n.outline?"":c.theme.buttonPrimaryHover}),(function(n){return n.outline?c.theme.blue200:c.theme.blue700}),c.theme.focusButton,(function(n){return n.outline?"transparent":c.theme.blue400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.blue400):""}),y,(function(n){return n.outline?"transparent":c.theme.primary})),R=k.default(_)(h||(h=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.color)||n.outline?c.theme.success:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success):c.theme.shadowButtonSuccess}),(function(n){return v(n.background)||n.outline?"transparent":c.theme.success}),(function(n){return v(n.hoverBackground)||n.outline?c.theme.green100:""}),(function(n){return n.outline?"":c.theme.buttonSuccessHover}),(function(n){return n.outline?c.theme.green200:c.theme.green700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.green400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.green400):""}),y,(function(n){return n.outline?"transparent":c.theme.success})),B=k.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.color)||c.theme.textColor}),(function(n){return n.outline?"transparent":v(n.background)||c.theme.surfaceColor}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.gray300," inset"):c.theme.shadowButtonStandard}),(function(n){return v(n.hoverBackground)||n.outline?c.theme.gray100:""}),(function(n){return n.outline?"":c.theme.buttonStandardHover}),(function(n){return n.outline?c.theme.gray200:c.theme.gray100}),c.theme.focusButtonStandard,y,(function(n){return n.outline?"transparent":c.theme.surfaceColor})),z=k.default(_)(p||(p=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.background)||n.outline?"transparent":c.theme.danger}),(function(n){return v(n.color)||n.outline?c.theme.danger:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger):c.theme.shadowButtonDanger}),(function(n){return v(n.hoverBackground)||n.outline?c.theme.red100:""}),(function(n){return n.outline?"":c.theme.buttonDangerHover}),(function(n){return n.outline?c.theme.red200:c.theme.red700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.red400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.red400):""}),y,(function(n){return n.outline?"transparent":c.theme.danger})),C=k.default(_)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.background)||n.outline?"transparent":c.theme.warning}),(function(n){return v(n.color)||n.outline?c.theme.warning:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning):c.theme.shadowButtonWarning}),(function(n){return v(n.hoverBackground)||n.outline?c.theme.orange100:""}),(function(n){return n.outline?"":c.theme.buttonWarningHover}),(function(n){return n.outline?c.theme.orange200:c.theme.orange700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.orange400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.orange400):""}),y,(function(n){return n.outline?"transparent":c.theme.warning})),O=k.default(_)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return v(n.background)||"none"}),(function(n){return v(n.color)||c.theme.textColorSecondary}),(function(n){return v(n.hoverBackground)||c.theme.gray100}),c.theme.gray200,c.theme.buttonFocusRing),T=k.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return v(n.color)||c.theme.primary}),(function(n){return v(n.hoverBackground)||c.theme.blue100}),c.theme.blue200,c.theme.buttonFocusRing),q=k.default(_)(x||(x=n.__makeTemplateObject(["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"])),(function(n){return n.href?c.theme.primary:c.theme.textColorSecondary}),(function(n){return n.href?c.theme.blue500:c.theme.gray700}),(function(n){return n.href?c.theme.blue300:c.theme.gray300})),S=_;exports.Button=function(o){var c=o.children,u=o.className,s=o.disabled,d=void 0!==s&&s,l=o.icon,h=o.iconRight,g=o.loading,p=void 0!==g&&g,b=o.loadingText,m=o.noRipple,f=void 0!==m&&m,x=o.size,k=void 0===x?"sm":x,v=o.spinnerColor,_=o.tag,I=o.themeOverride,G=o.type,F=void 0===G?"button":G,H=o.variant,N=void 0===H?"standard":H,W=n.__rest(o,["children","className","disabled","icon","iconRight","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type","variant"]),D=_||"button",E=function(n){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"content",children:!h&&l}),e.jsx("div",{className:"content text",children:c}),e.jsx("span",{className:"content",children:h&&l}),"plain"!==N&&"text"!==N&&p&&e.jsxs(y,{children:[e.jsx(i.Spinner,{color:n,size:w(k)}),b]})]})},P=["amino-button",u||"",l&&!c?"only-icon":"",h?"icon-right":"",l?"has-icon":"",p?"loading":"",I].filter(Boolean).join(" "),M=t.useRef(null),A=a.useRipple({disabled:d||p,rippleEnabled:!f&&!["plain","text"].includes(N),rippleRef:M}),J=A.getRippleHandlers,K=A.rippleEnabled,L={className:P,disabled:d||p,size:k},Q=n.__assign(n.__assign(n.__assign({type:F},L),W),J(W));switch(N){case"primary":return e.jsxs(j,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||Q.outline?"info":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"success":return e.jsxs(R,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||Q.outline?"success":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"warning":return e.jsxs(C,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||Q.outline?"warning":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"danger":return e.jsxs(z,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||Q.outline?"danger":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"subtle":return e.jsxs(O,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"link":return e.jsxs(T,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||"info"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"plain":return e.jsx(S,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:E(v)}));case"text":return e.jsx(q,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:E(v)}));default:return e.jsxs(B,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(v||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}))}};
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react"),o=require("styled-components"),r=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function u(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var s,d,l,h,g,b,p,m,f,x,v=u(o),k=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},w=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},y=v.default.span(s||(s=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),c.theme.radius6,c.theme.space8),_=v.default.button(d||(d=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &.loading .content {\n visibility: hidden;\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n .content {\n opacity: ",";\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &.loading .content {\n visibility: hidden;\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n .content {\n opacity: ",";\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.fontSizeBase,c.theme.space16,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.radius6);case"lg":case"xl":return"".concat(c.theme.radius10);default:return"".concat(c.theme.radius8)}}(n.size)}),c.theme.transition,(function(n){return function(n){switch(n){case"lg":case"xl":return 600;default:return 500}}(n.size)}),c.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.space4," ").concat(c.theme.space8);case"lg":case"xl":return"".concat(c.theme.space12," ").concat(c.theme.space24);default:return"".concat(c.theme.space8," ").concat(c.theme.space16)}}(n.size)}),(function(n){return n.fitContentWidth&&"fit-content"}),c.theme.space4,(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return n.outline?.6:1})),j=v.default(_)(l||(l=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||n.outline?c.theme.primary:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.primary," inset"):c.theme.shadowButtonPrimary}),(function(n){return k(n.background)||n.outline?"transparent":c.theme.primary}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.blue100:""}),(function(n){return n.outline?"":c.theme.buttonPrimaryHover}),(function(n){return n.outline?c.theme.blue200:c.theme.blue700}),c.theme.focusButton,(function(n){return n.outline?"transparent":c.theme.blue400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.blue400):""}),y,(function(n){return n.outline?"transparent":c.theme.primary})),R=v.default(_)(h||(h=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||n.outline?c.theme.success:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success):c.theme.shadowButtonSuccess}),(function(n){return k(n.background)||n.outline?"transparent":c.theme.success}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.green100:""}),(function(n){return n.outline?"":c.theme.buttonSuccessHover}),(function(n){return n.outline?c.theme.green200:c.theme.green700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.green400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.green400):""}),y,(function(n){return n.outline?"transparent":c.theme.success})),B=v.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||c.theme.textColor}),(function(n){return n.outline?"transparent":k(n.background)||c.theme.surfaceColor}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.gray300," inset"):c.theme.shadowButtonStandard}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.gray100:""}),(function(n){return n.outline?"":c.theme.buttonStandardHover}),(function(n){return n.outline?c.theme.gray200:c.theme.gray100}),c.theme.focusButtonStandard,y,(function(n){return n.outline?"transparent":c.theme.surfaceColor})),z=v.default(_)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.background)||n.outline?"transparent":c.theme.danger}),(function(n){return k(n.color)||n.outline?c.theme.danger:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger):c.theme.shadowButtonDanger}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.red100:""}),(function(n){return n.outline?"":c.theme.buttonDangerHover}),(function(n){return n.outline?c.theme.red200:c.theme.red700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.red400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.red400):""}),y,(function(n){return n.outline?"transparent":c.theme.danger})),C=v.default(_)(p||(p=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.background)||n.outline?"transparent":c.theme.warning}),(function(n){return k(n.color)||n.outline?c.theme.warning:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning):c.theme.shadowButtonWarning}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.orange100:""}),(function(n){return n.outline?"":c.theme.buttonWarningHover}),(function(n){return n.outline?c.theme.orange200:c.theme.orange700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.orange400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.orange400):""}),y,(function(n){return n.outline?"transparent":c.theme.warning})),O=v.default(_)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return k(n.background)||"none"}),(function(n){return k(n.color)||c.theme.textColorSecondary}),(function(n){return k(n.hoverBackground)||c.theme.gray100}),c.theme.gray200,c.theme.buttonFocusRing),T=v.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return k(n.color)||c.theme.primary}),(function(n){return k(n.hoverBackground)||c.theme.blue100}),c.theme.blue200,c.theme.buttonFocusRing),q=v.default(_)(x||(x=n.__makeTemplateObject(["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"])),(function(n){return n.href?c.theme.primary:c.theme.textColorSecondary}),(function(n){return n.href?c.theme.blue500:c.theme.gray700}),(function(n){return n.href?c.theme.blue300:c.theme.gray300})),S=_;exports.Button=function(o){var c=o.children,u=o.className,s=o.disabled,d=void 0!==s&&s,l=o.icon,h=o.iconRight,g=o.loading,b=void 0!==g&&g,p=o.loadingText,m=o.noRipple,f=void 0!==m&&m,x=o.size,v=void 0===x?"sm":x,k=o.spinnerColor,_=o.tag,I=o.themeOverride,G=o.type,F=void 0===G?"button":G,H=o.variant,N=void 0===H?"standard":H,W=n.__rest(o,["children","className","disabled","icon","iconRight","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type","variant"]),D=_||"button",E=function(n){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"content",children:!h&&l}),e.jsx("div",{className:"content text",children:c}),e.jsx("span",{className:"content",children:h&&l}),"plain"!==N&&"text"!==N&&b&&e.jsxs(y,{children:[e.jsx(i.Spinner,{color:n,size:w(v)}),p]})]})},P=["amino-button",u||"",l&&!c?"only-icon":"",h?"icon-right":"",l?"has-icon":"",b?"loading":"",I].filter(Boolean).join(" "),M=t.useRef(null),A=a.useRipple({disabled:d||b,rippleEnabled:!f&&!["plain","text"].includes(N),rippleRef:M}),J=A.getRippleHandlers,K=A.rippleEnabled,L={className:P,disabled:d||b,size:v},Q=n.__assign(n.__assign(n.__assign({type:F},L),W),J(W));switch(N){case"primary":return e.jsxs(j,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||Q.outline?"info":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"success":return e.jsxs(R,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||Q.outline?"success":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"warning":return e.jsxs(C,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||Q.outline?"warning":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"danger":return e.jsxs(z,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||Q.outline?"danger":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"subtle":return e.jsxs(O,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"link":return e.jsxs(T,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||"info"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"plain":return e.jsx(S,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:E(k)}));case"text":return e.jsx(q,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:E(k)}));default:return e.jsxs(B,n.__assign({as:D,tabIndex:"div"===D?0:void 0},Q,{children:[E(k||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}))}};
|