@zonos/amino 4.4.28 → 4.4.30
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-fe391a2e.js"),e=require("react/jsx-runtime"),r=require("react"),o=require("../spinner/Spinner.js"),t=require("../../styles/constants/theme.js"),a=require("styled-components"),i=require("./RippleGroup.js"),c=require("./useRipple.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(a),y=function(n){return"inherit"===n?"inherit":n?t.theme[n]:void 0},x=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"])),t.theme.radius4,t.theme.space8),_=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 {\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,")")}),t.theme.space16,t.theme.radius6,t.theme.transition,t.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(t.theme.space4," ").concat(t.theme.space8);case"lg":case"xl":return"".concat(t.theme.space12," ").concat(t.theme.space24);default:return"".concat(t.theme.space8," ").concat(t.theme.space16)}}(n.size)}),(function(n){return"var(--amino-size-".concat(n.size,")")}),t.theme.space8,t.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)||t.theme.primary}),(function(n){return y(n.color)||t.theme.gray0}),t.theme.blue400,t.theme.blue700,t.theme.gray0,x,t.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)||t.theme.textColor}),(function(n){return y(n.background)||t.theme.gray100}),t.theme.gray200,t.theme.blue100,t.theme.blue600,x,t.theme.gray100,t.theme.gray0,t.theme.gray1000,t.theme.gray900,t.theme.blue1000,t.theme.blue300,x,t.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)||t.theme.red600}),(function(n){return y(n.color)||t.theme.gray0}),t.theme.red400,t.theme.red700,x,t.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)||t.theme.orange600}),(function(n){return y(n.color)||t.theme.gray0}),t.theme.orange400,t.theme.orange700,x,t.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 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 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)||t.theme.textColor}),(function(n){return y(n.borderColor)||t.theme.gray200}),t.theme.gray0,t.theme.gray100,t.theme.gray200,t.theme.blue100,t.theme.blue600,t.theme.blue300,x,t.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)||t.theme.gray800}),t.theme.gray100,t.theme.blue100,t.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)||t.theme.gray800}),t.theme.gray400,t.theme.gray700,t.theme.gray1200),q=_,G=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)||t.theme.blue600}),t.theme.gray100,t.theme.blue100,t.theme.blue800,x,t.theme.gray0);exports.Button=function(t){var a=t.children,l=t.className,s=t.disabled,d=void 0!==s&&s,u=t.icon,g=t.iconRight,h=t.intent,b=void 0===h?"secondary":h,p=t.loading,m=void 0!==p&&p,f=t.loadingText,k=t.noRipple,v=void 0!==k&&k,y=t.size,_=void 0===y?"sm":y,N=t.spinnerColor,S=t.tag,B=t.themeOverride,E=t.type,F=void 0===E?"button":E,H=n.__rest(t,["children","className","disabled","icon","iconRight","intent","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type"]),M=S||"button",A=function(n){return e.jsxs(e.Fragment,{children:[!g&&u,a,g&&u,"plain"!==b&&m&&e.jsxs(x,{children:[e.jsx(o.Spinner,{color:n,size:16}),f]})]})},D=[l||"",u&&!a?"only-icon":"",g?"icon-right":"",u?"has-icon":"",m?"loading":"",B].filter(Boolean).join(" "),I=r.useRef(null),J=c.useRipple({disabled:d||m,rippleEnabled:!v&&!["plain","text"].includes(b),rippleRef:I}),K=J.getRippleHandlers,L=J.rippleEnabled,P={className:D,disabled:d||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(N||"white"),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"subtle":return e.jsxs(O,n.__assign({as:M},Q,{children:[A(N),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"outline":return e.jsxs(C,n.__assign({as:M},Q,{children:[A(N),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"warning":return e.jsxs(z,n.__assign({as:M},Q,{children:[A(N||"white"),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"danger":return e.jsxs(R,n.__assign({as:M},Q,{children:[A(N||"white"),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"text":return e.jsx(T,n.__assign({as:M},Q,{children:A(N)}));case"link":return e.jsxs(G,n.__assign({as:M},Q,{children:[A(N),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"plain":return e.jsx(q,n.__assign({as:M},Q,{children:A(N)}));default:return e.jsxs(w,n.__assign({as:M},Q,{children:[A(N),L&&e.jsx(i.RippleGroup,{ref:I})]}))}};
|
|
1
|
+
"use strict";var n=require("../../_tslib-fe391a2e.js"),e=require("react/jsx-runtime"),r=require("react"),o=require("../spinner/Spinner.js"),t=require("../../styles/constants/theme.js"),a=require("styled-components"),i=require("./RippleGroup.js"),c=require("./useRipple.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(a),y=function(n){return"inherit"===n?"inherit":n?t.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"])),t.theme.radius4,t.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,")")}),t.theme.space16,t.theme.radius6,t.theme.transition,t.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(t.theme.space4," ").concat(t.theme.space8);case"lg":case"xl":return"".concat(t.theme.space12," ").concat(t.theme.space24);default:return"".concat(t.theme.space8," ").concat(t.theme.space16)}}(n.size)}),(function(n){return"var(--amino-size-".concat(n.size,")")}),t.theme.space8,t.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)||t.theme.primary}),(function(n){return y(n.color)||t.theme.gray0}),(function(n){return y(n.hoverBackground)||t.theme.blue400}),t.theme.blue700,t.theme.gray0,x,t.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)||t.theme.textColor}),(function(n){return y(n.background)||t.theme.gray100}),(function(n){return y(n.hoverBackground)||t.theme.gray200}),t.theme.blue100,t.theme.blue600,x,t.theme.gray100,t.theme.gray0,t.theme.gray1000,(function(n){return y(n.hoverBackground)||t.theme.gray900}),t.theme.blue1000,t.theme.blue300,x,t.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)||t.theme.red600}),(function(n){return y(n.color)||t.theme.gray0}),(function(n){return y(n.hoverBackground)||t.theme.red400}),t.theme.red700,x,t.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)||t.theme.orange600}),(function(n){return y(n.color)||t.theme.gray0}),(function(n){return y(n.hoverBackground)||t.theme.orange400}),t.theme.orange700,x,t.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)||t.theme.textColor}),(function(n){return y(n.borderColor)||t.theme.gray200}),t.theme.gray0,t.theme.gray100,(function(n){return n.hoverBackground&&y(n.hoverBackground)}),t.theme.gray200,t.theme.blue100,t.theme.blue600,t.theme.blue300,x,t.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)||t.theme.gray800}),(function(n){return y(n.hoverBackground)||t.theme.gray100}),t.theme.blue100,t.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)||t.theme.gray800}),t.theme.gray400,t.theme.gray700,t.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)||t.theme.blue600}),(function(n){return y(n.hoverBackground)||t.theme.gray100}),t.theme.blue100,t.theme.blue800,x,t.theme.gray0);exports.Button=function(t){var a=t.children,l=t.className,d=t.disabled,s=void 0!==d&&d,u=t.icon,g=t.iconRight,h=t.intent,b=void 0===h?"secondary":h,p=t.loading,m=void 0!==p&&p,f=t.loadingText,k=t.noRipple,v=void 0!==k&&k,y=t.size,_=void 0===y?"sm":y,G=t.spinnerColor,N=t.tag,S=t.themeOverride,E=t.type,F=void 0===E?"button":E,H=n.__rest(t,["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,a,g&&u,"plain"!==b&&m&&e.jsxs(x,{children:[e.jsx(o.Spinner,{color:n,size:16}),f]})]})},D=[l||"",u&&!a?"only-icon":"",g?"icon-right":"",u?"has-icon":"",m?"loading":"",S].filter(Boolean).join(" "),I=r.useRef(null),J=c.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(i.RippleGroup,{ref:I})]}));case"subtle":return e.jsxs(O,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"outline":return e.jsxs(C,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"warning":return e.jsxs(z,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(i.RippleGroup,{ref:I})]}));case"danger":return e.jsxs(R,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(i.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(i.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(i.RippleGroup,{ref:I})]}))}};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-fe391a2e.js"),r=require("react"),t=require("zod"),u=require("../storage.js"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-fe391a2e.js"),r=require("react"),t=require("zod"),u=require("../storage.js"),n=require("./useStorage.js");require("swr"),require("./useSwr.js");var i=t.z.enum(["day","night","midnight"]);exports.useAminoTheme=function(t){var a=!!(null==t?void 0:t.root),o=e.__read(n.useStorage({defaultValue:function(){if("undefined"==typeof window)return"day";var e=u.getStorageItem({key:"amino:theme",schema:i,type:"local"});return null!=e?e:"day"}(),key:"amino:theme",type:"local"}),2),m=o[0],s=o[1];return r.useEffect((function(){a&&(document.documentElement.dataset.theme=m)}),[m,a]),{aminoTheme:m,setAminoTheme:s}};
|