@zonos/amino 5.1.17 → 5.1.18
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.
- package/components/button/Button.js +1 -1
- package/components/text/Text.d.ts +3 -3
- package/components/text/Text.js +1 -1
- package/package.json +1 -1
- package/theme.css +17 -9
|
@@ -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,b,p,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: 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 ",",\n visibility 0;\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 width: ",";\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 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: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\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: 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 ",",\n visibility 0;\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 width: ",";\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 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: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\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.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 n.fitContentWidth&&"fit-content"}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space8,c.theme.space8,(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(_)(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 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(_)(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 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,b=void 0!==g&&g,p=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",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(k)}),p]})]})},P=[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: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,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\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 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: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\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\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 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: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\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"}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space8,c.theme.space8,(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(_)(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 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(_)(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 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,b=void 0!==g&&g,p=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",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(k)}),p]})]})},P=[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: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})]}))}};
|
|
@@ -7,13 +7,13 @@ export declare const textOptions: readonly [{
|
|
|
7
7
|
readonly size: "3xl";
|
|
8
8
|
readonly tag: "h2";
|
|
9
9
|
readonly type: "page-header";
|
|
10
|
-
readonly weight:
|
|
10
|
+
readonly weight: 700;
|
|
11
11
|
}, {
|
|
12
12
|
readonly label: "Header (2XL) · 28px (1.75rem)";
|
|
13
13
|
readonly size: "2xl";
|
|
14
14
|
readonly tag: "h3";
|
|
15
15
|
readonly type: "header";
|
|
16
|
-
readonly weight:
|
|
16
|
+
readonly weight: 600;
|
|
17
17
|
}, {
|
|
18
18
|
readonly label: "Description Header (2XL) · 28px (1.75rem)";
|
|
19
19
|
readonly size: "2xl";
|
|
@@ -25,7 +25,7 @@ export declare const textOptions: readonly [{
|
|
|
25
25
|
readonly size: "xl";
|
|
26
26
|
readonly tag: "h4";
|
|
27
27
|
readonly type: "title";
|
|
28
|
-
readonly weight:
|
|
28
|
+
readonly weight: 600;
|
|
29
29
|
}, {
|
|
30
30
|
readonly label: "Bold Subheader (L) • 18px (1.125rem)";
|
|
31
31
|
readonly size: "l";
|
package/components/text/Text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react/jsx-runtime"),i=require("styled-components"),a=require("../../styles/constants/theme.js");function s(e){return e&&e.__esModule?e:{default:e}}var n,r,l,h=s(i),o=h.default.span(n||(n=e.__makeTemplateObject(["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"],["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"])),a.theme.fontSizeS,a.theme.gray900),p=h.default.span(r||(r=e.__makeTemplateObject(["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"],["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"])),a.theme.gray1200,a.theme.fontSans,a.theme.space8),g=[{label:"Page Header (3XL) · 34px (2.125rem)",size:"3xl",tag:"h2",type:"page-header",weight:
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react/jsx-runtime"),i=require("styled-components"),a=require("../../styles/constants/theme.js");function s(e){return e&&e.__esModule?e:{default:e}}var n,r,l,h=s(i),o=h.default.span(n||(n=e.__makeTemplateObject(["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"],["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"])),a.theme.fontSizeS,a.theme.gray900),p=h.default.span(r||(r=e.__makeTemplateObject(["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"],["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"])),a.theme.gray1200,a.theme.fontSans,a.theme.space8),g=[{label:"Page Header (3XL) · 34px (2.125rem)",size:"3xl",tag:"h2",type:"page-header",weight:700},{label:"Header (2XL) · 28px (1.75rem)",size:"2xl",tag:"h3",type:"header",weight:600},{label:"Description Header (2XL) · 28px (1.75rem)",size:"2xl",tag:"h3",type:"description-header",weight:700},{label:"Title (XL) • 22px (1.375rem)",size:"xl",tag:"h4",type:"title",weight:600},{label:"Bold Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",type:"bold-subheader",weight:700},{label:"Semi Bold Subheader (L / H4) • 18px (1.125rem)",size:"l",tag:"h5",type:"semi-bold-subheader",weight:600},{label:"Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",type:"subheader",weight:500},{label:"Bold Label (Base) • 14px (.875rem)",size:"base",tag:"span",type:"bold-label",weight:700},{label:"Label (Base) • 14px (.875rem)",size:"base",tag:"span",type:"label",weight:500},{label:"Body (Base) • 14px (.875rem)",size:"base",tag:"span",type:"body",weight:400},{label:"Small header (S) • 12px (.75rem)",size:"s",tag:"span",type:"small-header",weight:600},{label:"Caption (S) • 12px (.75rem)",size:"s",tag:"span",type:"caption",weight:400},{label:"Hint text (XS) • 10px (.625rem)",size:"xs",tag:"span",type:"hint-text",weight:400}],c=e.__read(g,13),d=c[0],u=c[1],z=c[2],b=c[3],f=c[4],m=c[5],x=c[6],w=c[7],y=c[8],U=c[9],W=c[10],S=c[11],_=c[12],v=h.default.h1(l||(l=e.__makeTemplateObject(["\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n margin: 0;\n color: ",";\n text-transform: ",";\n\n svg {\n display: inline-block;\n vertical-align: middle;\n }\n"],["\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n margin: 0;\n color: ",";\n text-transform: ",";\n\n svg {\n display: inline-block;\n vertical-align: middle;\n }\n"])),(function(e){return"var(--amino-font-size-".concat(e.fontSize||e.size,")")}),(function(e){return e.fontWeight}),(function(e){return"var(--amino-line-height-".concat(e.lineHeight||e.size,")")}),(function(e){return e.color&&a.theme[e.color]}),(function(e){return e.isUppercase&&"uppercase"}));exports.Text=function(e){var i=e.children,a=e.className,s=e.color,n=e.fontSize,r=e.fontWeight,l=e.isUppercase,h=e.lineHeight,g=e.tag,c=e.title,j=function(e){var r=e.as,l=e.fontWeight,o=e.isUppercase,p=e.size;return t.jsx(v,{as:r,className:a,color:s,fontSize:n,fontWeight:l,isUppercase:!!o,lineHeight:h,size:p,title:c,children:i})};switch(e.type){case"page-header":return j({as:g||d.tag,fontWeight:r||d.weight,isUppercase:l,size:d.size});case"header":return j({as:g||u.tag,fontWeight:r||u.weight,isUppercase:l,size:u.size});case"description-header":return j({as:g||z.tag,fontWeight:r||z.weight,isUppercase:l,size:z.size});case"title":return j({as:g||b.tag,fontWeight:r||b.weight,isUppercase:l,size:b.size});case"bold-subheader":return j({as:g||f.tag,fontWeight:r||f.weight,isUppercase:l,size:f.size});case"semi-bold-subheader":return j({as:g||m.tag,fontWeight:r||m.weight,isUppercase:l,size:m.size});case"subheader":return j({as:g||x.tag,fontWeight:r||x.weight,isUppercase:l,size:x.size});case"bold-label":return j({as:g||w.tag,fontWeight:r||w.weight,isUppercase:l,size:w.size});case"label":return j({as:g||y.tag,fontWeight:r||y.weight,isUppercase:l,size:y.size});case"small-header":return j({as:g||W.tag,fontWeight:r||W.weight,isUppercase:"boolean"!=typeof l||l,size:W.size});case"caption":return j({as:g||S.tag,fontWeight:r||S.weight,isUppercase:l,size:S.size});case"hint-text":return j({as:g||_.tag,fontWeight:r||_.weight,isUppercase:l,size:_.size});case"subtitle":return t.jsx(o,{className:a,title:c,children:i});case"input-label":return t.jsx(p,{className:a,title:c,children:i});default:return j({as:g||U.tag,fontWeight:r||U.weight,isUppercase:l,size:U.size})}},exports.textOptions=g,exports.textOthers=["code","subtitle","small-header","input-label"];
|
package/package.json
CHANGED
package/theme.css
CHANGED
|
@@ -382,17 +382,25 @@
|
|
|
382
382
|
inset 0px 2px 4px rgba(0, 0, 0, 0.24),
|
|
383
383
|
inset 0px 0px 0px 0.5px rgba(0, 0, 0, 0.24),
|
|
384
384
|
inset 0px 0px 8px rgba(0, 0, 0, 0.16);
|
|
385
|
-
--amino-shadow-button-primary: 0px
|
|
386
|
-
0px
|
|
387
|
-
|
|
388
|
-
0px
|
|
385
|
+
--amino-shadow-button-primary: 0px 0px 0px 1px #000,
|
|
386
|
+
0px -1px 1px 0px rgba(0, 0, 0, 0.2) inset,
|
|
387
|
+
0px 0px 0px 1px rgba(255, 255, 255, 0.08) inset,
|
|
388
|
+
0px 1px 3px 0px rgba(95, 146, 246, 0.4);
|
|
389
|
+
--amino-shadow-button-success: 0px 0px 0px 1px #000,
|
|
390
|
+
0px -1px 1px 0px rgba(0, 0, 0, 0.2) inset,
|
|
391
|
+
0px 0px 0px 1px rgba(255, 255, 255, 0.08) inset,
|
|
389
392
|
0px 1px 3px 0px rgba(86, 199, 111, 0.6);
|
|
390
|
-
--amino-shadow-button-danger: 0px
|
|
391
|
-
0px 1px
|
|
392
|
-
|
|
393
|
-
0px 1px 3px 0px rgba(
|
|
393
|
+
--amino-shadow-button-danger: 0px 0px 0px 1px #000,
|
|
394
|
+
0px -1px 1px 0px rgba(0, 0, 0, 0.2) inset,
|
|
395
|
+
0px 0px 0px 1px rgba(255, 255, 255, 0.08) inset,
|
|
396
|
+
0px 1px 3px 0px rgba(249, 92, 103, 0.6);
|
|
397
|
+
--amino-shadow-button-warning: 0px 0px 0px 1px #000,
|
|
398
|
+
0px -1px 1px 0px rgba(0, 0, 0, 0.2) inset,
|
|
399
|
+
0px 0px 0px 1px rgba(255, 255, 255, 0.08) inset,
|
|
400
|
+
0px 1px 3px 0px rgba(248, 140, 83, 0.6);
|
|
394
401
|
--amino-button-focus-ring: 0 0 0 2px var(--amino-blue-600);
|
|
395
|
-
--amino-shadow-button-standard: 0px
|
|
402
|
+
--amino-shadow-button-standard: 0px 0px 0px 1px #000,
|
|
403
|
+
0px -1px 1px 0px rgba(0, 0, 0, 0.4) inset,
|
|
396
404
|
0px 0px 2px 1px rgba(255, 255, 255, 0.08) inset,
|
|
397
405
|
0px 1px 3px 0px rgba(0, 0, 0, 0.8),
|
|
398
406
|
0px 0px 0px 1px rgba(148, 150, 158, 0.12) inset;
|