@zonos/amino 5.0.9 → 5.0.10
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"),r=require("react"),o=require("styled-components"),t=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function l(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var d,s,u,g,h,b,p,m,f,k,v=l(o),y=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},x=v.default.span(d||(d=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.radius4,c.theme.space8),_=v.default.button(s||(s=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\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 font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\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 font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space16,c.theme.radius6,c.theme.transition,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"var(--amino-size-".concat(n.size,")")}),c.theme.space8,c.theme.space8),j=v.default(_)(u||(u=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.primary}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.blue400}),c.theme.blue700,c.theme.gray0,x,c.theme.primary),w=v.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"],["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.background)||c.theme.gray100}),(function(n){return y(n.hoverBackground)||c.theme.gray200}),c.theme.blue100,c.theme.blue600,x,c.theme.gray100,c.theme.gray0,c.theme.gray1000,(function(n){return y(n.hoverBackground)||c.theme.gray900}),c.theme.blue1000,c.theme.blue300,x,c.theme.gray1000),R=v.default(_)(h||(h=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.red600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.red400}),c.theme.red700,x,c.theme.red600),z=v.default(_)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.orange600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.orange400}),c.theme.orange700,x,c.theme.orange600),C=v.default(_)(p||(p=n.__makeTemplateObject(["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.borderColor)||c.theme.gray200}),c.theme.gray0,c.theme.gray100,(function(n){return n.hoverBackground&&y(n.hoverBackground)}),c.theme.gray200,c.theme.blue100,c.theme.blue600,c.theme.blue300,x,c.theme.gray0),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 color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.background)||"none"}),(function(n){return y(n.color)||c.theme.gray800}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue600),T=v.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.color)||c.theme.gray800}),c.theme.gray400,c.theme.gray700,c.theme.gray1200),q=_,B=v.default(_)(k||(k=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.blue600}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue800,x,c.theme.gray0);exports.Button=function(o){var c=o.children,l=o.className,d=o.disabled,s=void 0!==d&&d,u=o.icon,g=o.iconRight,h=o.intent,b=void 0===h?"secondary":h,p=o.loading,m=void 0!==p&&p,f=o.loadingText,k=o.noRipple,v=void 0!==k&&k,y=o.size,_=void 0===y?"sm":y,G=o.spinnerColor,N=o.tag,S=o.themeOverride,E=o.type,F=void 0===E?"button":E,H=n.__rest(o,["children","className","disabled","icon","iconRight","intent","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type"]),M=N||"button",A=function(n){return e.jsxs(e.Fragment,{children:[!g&&u,c,g&&u,"plain"!==b&&m&&e.jsxs(x,{children:[e.jsx(i.Spinner,{color:n,size:16}),f]})]})},D=[l||"",u&&!c?"only-icon":"",g?"icon-right":"",u?"has-icon":"",m?"loading":"",S].filter(Boolean).join(" "),I=r.useRef(null),J=a.useRipple({disabled:s||m,rippleEnabled:!v&&!["plain","text"].includes(b),rippleRef:I}),K=J.getRippleHandlers,L=J.rippleEnabled,P={className:D,disabled:s||m,size:_},Q=n.__assign(n.__assign(n.__assign({type:F},P),H),K(H));switch(b){case"primary":return e.jsxs(j,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"subtle":return e.jsxs(O,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"outline":return e.jsxs(C,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"warning":return e.jsxs(z,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"danger":return e.jsxs(R,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"text":return e.jsx(T,n.__assign({as:M},Q,{children:A(G)}));case"link":return e.jsxs(B,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"plain":return e.jsx(q,n.__assign({as:M},Q,{children:A(G)}));default:return e.jsxs(w,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}))}};
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),r=require("react"),o=require("styled-components"),t=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function l(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var s,d,u,g,h,b,p,m,f,k,v=l(o),y=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},x=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},_=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.radius4,c.theme.space8),j=v.default.button(d||(d=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\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 font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\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: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\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 font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\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: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space16,c.theme.radius6,c.theme.transition,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"var(--amino-size-".concat(n.size,")")}),c.theme.space8,c.theme.space8),w=v.default(j)(u||(u=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.primary}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.blue400}),c.theme.blue700,c.theme.gray0,_,c.theme.primary),R=v.default(j)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"],["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.background)||c.theme.gray100}),(function(n){return y(n.hoverBackground)||c.theme.gray200}),c.theme.blue100,c.theme.blue600,_,c.theme.gray100,c.theme.gray0,c.theme.gray1000,(function(n){return y(n.hoverBackground)||c.theme.gray900}),c.theme.blue1000,c.theme.blue300,_,c.theme.gray1000),z=v.default(j)(h||(h=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.red600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.red400}),c.theme.red700,_,c.theme.red600),C=v.default(j)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.orange600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.orange400}),c.theme.orange700,_,c.theme.orange600),O=v.default(j)(p||(p=n.__makeTemplateObject(["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.borderColor)||c.theme.gray200}),c.theme.gray0,c.theme.gray100,(function(n){return n.hoverBackground&&y(n.hoverBackground)}),c.theme.gray200,c.theme.blue100,c.theme.blue600,c.theme.blue300,_,c.theme.gray0),T=v.default(j)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.background)||"none"}),(function(n){return y(n.color)||c.theme.gray800}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue600),q=v.default(j)(f||(f=n.__makeTemplateObject(["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.color)||c.theme.gray800}),c.theme.gray400,c.theme.gray700,c.theme.gray1200),B=j,G=v.default(j)(k||(k=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.blue600}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue800,_,c.theme.gray0);exports.Button=function(o){var c=o.children,l=o.className,s=o.disabled,d=void 0!==s&&s,u=o.icon,g=o.iconRight,h=o.intent,b=void 0===h?"secondary":h,p=o.loading,m=void 0!==p&&p,f=o.loadingText,k=o.noRipple,v=void 0!==k&&k,y=o.size,j=void 0===y?"sm":y,N=o.spinnerColor,S=o.tag,E=o.themeOverride,F=o.type,H=void 0===F?"button":F,M=n.__rest(o,["children","className","disabled","icon","iconRight","intent","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type"]),A=S||"button",D=function(n){return e.jsxs(e.Fragment,{children:[!g&&u,c,g&&u,"plain"!==b&&m&&e.jsxs(_,{children:[e.jsx(i.Spinner,{color:n,size:x(j)}),f]})]})},I=[l||"",u&&!c?"only-icon":"",g?"icon-right":"",u?"has-icon":"",m?"loading":"",E].filter(Boolean).join(" "),J=r.useRef(null),K=a.useRipple({disabled:d||m,rippleEnabled:!v&&!["plain","text"].includes(b),rippleRef:J}),L=K.getRippleHandlers,P=K.rippleEnabled,Q={className:I,disabled:d||m,size:j},U=n.__assign(n.__assign(n.__assign({type:H},Q),M),L(M));switch(b){case"primary":return e.jsxs(w,n.__assign({as:A},U,{children:[D(N||"white"),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"subtle":return e.jsxs(T,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"outline":return e.jsxs(O,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"warning":return e.jsxs(C,n.__assign({as:A},U,{children:[D(N||"white"),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"danger":return e.jsxs(z,n.__assign({as:A},U,{children:[D(N||"white"),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"text":return e.jsx(q,n.__assign({as:A},U,{children:D(N)}));case"link":return e.jsxs(G,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"plain":return e.jsx(B,n.__assign({as:A},U,{children:D(N)}));default:return e.jsxs(R,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}))}};
|
|
@@ -23,7 +23,7 @@ type FloatLabelInputType = {
|
|
|
23
23
|
/** Determines if the input is required for form validation */
|
|
24
24
|
required?: boolean;
|
|
25
25
|
size?: Size;
|
|
26
|
-
/** A short string displayed at the end of the input */
|
|
26
|
+
/** A short string displayed at the end of the input. Set to `null` to disable */
|
|
27
27
|
suffix?: ReactNode;
|
|
28
28
|
tabIndex?: number;
|
|
29
29
|
/** Determines input type (email, password, etc.) */
|
|
@@ -54,7 +54,7 @@ export declare const FloatLabelInput: import("react").ForwardRefExoticComponent<
|
|
|
54
54
|
/** Determines if the input is required for form validation */
|
|
55
55
|
required?: boolean | undefined;
|
|
56
56
|
size?: Size | undefined;
|
|
57
|
-
/** A short string displayed at the end of the input */
|
|
57
|
+
/** A short string displayed at the end of the input. Set to `null` to disable */
|
|
58
58
|
suffix?: ReactNode;
|
|
59
59
|
tabIndex?: number | undefined;
|
|
60
60
|
/** Determines input type (email, password, etc.) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=require("../../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),i=require("./_FloatLabelInput.js"),a=require("../../../icons/ChevronDownIcon.js"),o=require("../../../icons/ChevronUpIcon.js"),u=require("../../../styles/constants/theme.js");function s(n){return n&&n.__esModule?n:{default:n}}require("../../../utils/getTestId.js"),require("../../../icons/icon-base/_IconBase.js");var l,d,c,p,b=s(r),f=b.default.div(l||(l=n.__makeTemplateObject(["\n position: relative;\n width: 100%;\n"],["\n position: relative;\n width: 100%;\n"]))),v=b.default.div(d||(d=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n"],["\n display: flex;\n flex-direction: column;\n justify-content: center;\n"]))),h=b.default.button(c||(c=n.__makeTemplateObject(["\n padding: ",";\n border-radius: ",";\n transition: ",";\n\n &:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n &:active {\n background: rgba(0, 0, 0, 0.1);\n }\n &:focus {\n outline: none;\n }\n"],["\n padding: ",";\n border-radius: ",";\n transition: ",";\n\n &:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n &:active {\n background: rgba(0, 0, 0, 0.1);\n }\n &:focus {\n outline: none;\n }\n"])),u.theme.radius4,u.theme.radius4,u.theme.transition),x=b.default(i.FloatLabelInput)(p||(p=n.__makeTemplateObject(["\n && input {\n padding-right: ",";\n appearance: textfield;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n }\n }\n"],["\n && input {\n padding-right: ",";\n appearance: textfield;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n }\n }\n"])),u.theme.space40);exports.NumberInput=function(r){var i=r.autoFocus,u=r.className,s=r.disabled,l=r.error,d=r.inputMode,c=r.label,p=r.onChange,b=r.onKeyDown,m=r.pattern,j=r.placeholder,g=r.prefix,_=r.readOnly,k=r.required,w=r.suffix,y=r.tabIndex,q=r.value,I=n.__rest(r,["autoFocus","className","disabled","error","inputMode","label","onChange","onKeyDown","pattern","placeholder","prefix","readOnly","required","suffix","tabIndex","value"]),C=t.useRef(null);return e.jsx(f,{className:u,children:e.jsx(x,n.__assign({ref:C,"aria-label":c,autoFocus:i,disabled:s,error:l,inputMode:d,label:c,onChange:p,onKeyDown:b,pattern:m,placeholder:j,prefix:g,readOnly:_,required:k,suffix:null===w?null:w||e.jsxs(v,{children:[e.jsx(h,{onClick:function(){var n,e;null===(n=C.current)||void 0===n||n.stepUp(),null===(e=C.current)||void 0===e||e.dispatchEvent(new Event("input",{bubbles:!0}))},type:"button",children:e.jsx(o.ChevronUpIcon,{size:16})}),e.jsx(h,{onClick:function(){var n,e;null===(n=C.current)||void 0===n||n.stepDown(),null===(e=C.current)||void 0===e||e.dispatchEvent(new Event("input",{bubbles:!0}))},type:"button",children:e.jsx(a.ChevronDownIcon,{size:16})})]}),tabIndex:y,type:"number",value:q},I))})};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export type SpinnerColor = 'black' | 'white' | Exclude<Intent, 'default' | 'error'>;
|
|
1
|
+
export type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
|
|
3
2
|
export type SpinnerProps = {
|
|
4
3
|
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @default 'primary'
|
|
6
|
+
*/
|
|
5
7
|
color?: SpinnerColor;
|
|
8
|
+
/**
|
|
9
|
+
* @default 32
|
|
10
|
+
*/
|
|
6
11
|
size?: number;
|
|
7
12
|
};
|
|
8
|
-
export declare const Spinner: ({ className, color, size }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const Spinner: ({ className, color, size, }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("../../_tslib-ccfac372.js"),
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),r=require("styled-components"),t=require("../../styles/constants/theme.js");function s(n){return n&&n.__esModule?n:{default:n}}var i,a,o=s(r),c=o.default.div(i||(i=n.__makeTemplateObject(["\n position: relative;\n overflow: hidden;\n width: ","px;\n height: ","px;\n"],["\n position: relative;\n overflow: hidden;\n width: ","px;\n height: ","px;\n"])),(function(n){return n.size}),(function(n){return n.size})),k=o.default.svg(a||(a=n.__makeTemplateObject(["\n position: absolute;\n width: ","px;\n height: ","px;\n\n stroke: ",";\n\n circle.track {\n stroke: ",";\n }\n\n &.black {\n stroke: ",";\n\n circle.track {\n stroke: rgba(0, 0, 0, 0.3);\n }\n }\n &.white {\n stroke: ",";\n\n circle.track {\n stroke: rgba(255, 255, 255, 0.3);\n }\n }\n &.info {\n stroke: ",";\n }\n &.success {\n stroke: ",";\n }\n &.danger {\n stroke: ",";\n }\n &.warning {\n stroke: ",";\n }\n\n @keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n }\n\n @keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n }\n\n animation: rotate 2s linear infinite;\n\n circle:not(.track) {\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n }\n"],["\n position: absolute;\n width: ","px;\n height: ","px;\n\n stroke: ",";\n\n circle.track {\n stroke: ",";\n }\n\n &.black {\n stroke: ",";\n\n circle.track {\n stroke: rgba(0, 0, 0, 0.3);\n }\n }\n &.white {\n stroke: ",";\n\n circle.track {\n stroke: rgba(255, 255, 255, 0.3);\n }\n }\n &.info {\n stroke: ",";\n }\n &.success {\n stroke: ",";\n }\n &.danger {\n stroke: ",";\n }\n &.warning {\n stroke: ",";\n }\n\n @keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n }\n\n @keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n }\n\n animation: rotate 2s linear infinite;\n\n circle:not(.track) {\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n }\n"])),(function(n){return n.size}),(function(n){return n.size}),t.theme.blue600,t.theme.gray200,t.theme.gray1200,t.theme.gray0,t.theme.blue600,t.theme.green600,t.theme.red600,t.theme.orange600);exports.Spinner=function(n){var r=n.className,t=n.color,s=void 0===t?"primary":t,i=n.size,a=void 0===i?32:i;return e.jsx(c,{size:a,children:e.jsxs(k,{className:[r,s,"amino-spinner"].join(" "),size:a,viewBox:"0 0 50 50",children:[e.jsx("circle",{className:"track",cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20",strokeWidth:"5"}),e.jsx("circle",{cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20",strokeWidth:"5"})]})})};
|