@zonos/amino 5.1.51 → 5.1.52

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/all.d.ts CHANGED
@@ -9,6 +9,7 @@ import './components/avatar/UserAvatar';
9
9
  import './components/badge/Badge';
10
10
  import './components/banner/Banner';
11
11
  import './components/button/Button';
12
+ import './components/button/ButtonIcon';
12
13
  import './components/button/MenuButton';
13
14
  import './components/button/RippleGroup';
14
15
  import './components/button/useRipple';
@@ -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,v=u(o),k=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},w=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},y=v.default.span(s||(s=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),c.theme.radius6,c.theme.space8),_=v.default.button(d||(d=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &.loading .content {\n visibility: hidden;\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n opacity: ",";\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &.loading .content {\n visibility: hidden;\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n opacity: ",";\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.fontSizeBase,c.theme.space16,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.radius6);case"lg":case"xl":return"".concat(c.theme.radius10);default:return"".concat(c.theme.radius8)}}(n.size)}),c.theme.transition,(function(n){return function(n){switch(n){case"lg":case"xl":return 600;default:return 500}}(n.size)}),c.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.space4," ").concat(c.theme.space8);case"lg":case"xl":return"".concat(c.theme.space12," ").concat(c.theme.space24);default:return"".concat(c.theme.space8," ").concat(c.theme.space16)}}(n.size)}),(function(n){return n.fitContentWidth&&"fit-content"}),c.theme.space4,(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return n.outline?.6:1})),j=v.default(_)(l||(l=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||n.outline?c.theme.primary:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.primary," inset"):c.theme.shadowButtonPrimary}),(function(n){return k(n.background)||n.outline?"transparent":c.theme.primary}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.blue100:""}),(function(n){return n.outline?"":c.theme.buttonPrimaryHover}),(function(n){return n.outline?c.theme.blue200:c.theme.blue700}),c.theme.focusButton,(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.primary," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.primary})),B=v.default(_)(h||(h=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||n.outline?c.theme.success:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success):c.theme.shadowButtonSuccess}),(function(n){return k(n.background)||n.outline?"transparent":c.theme.success}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.green100:""}),(function(n){return n.outline?"":c.theme.buttonSuccessHover}),(function(n){return n.outline?c.theme.green200:c.theme.green700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.success})),R=v.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||c.theme.textColor}),(function(n){return n.outline?"transparent":k(n.background)||c.theme.surfaceColor}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.gray300," inset"):c.theme.shadowButtonStandard}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.gray100:""}),(function(n){return n.outline?"":c.theme.buttonStandardHover}),(function(n){return n.outline?c.theme.gray200:c.theme.gray100}),c.theme.focusButtonStandard,y,(function(n){return n.outline?"transparent":c.theme.surfaceColor})),z=v.default(_)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.background)||n.outline?"transparent":c.theme.danger}),(function(n){return k(n.color)||n.outline?c.theme.danger:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger):c.theme.shadowButtonDanger}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.red100:""}),(function(n){return n.outline?"":c.theme.buttonDangerHover}),(function(n){return n.outline?c.theme.red200:c.theme.red700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.danger})),C=v.default(_)(p||(p=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.background)||n.outline?"transparent":c.theme.warning}),(function(n){return k(n.color)||n.outline?c.theme.warning:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning):c.theme.shadowButtonWarning}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.orange100:""}),(function(n){return n.outline?"":c.theme.buttonWarningHover}),(function(n){return n.outline?c.theme.orange200:c.theme.orange700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.warning})),O=v.default(_)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return k(n.background)||"none"}),(function(n){return k(n.color)||c.theme.textColorSecondary}),(function(n){return k(n.hoverBackground)||c.theme.gray100}),c.theme.gray200,c.theme.buttonFocusRing),T=v.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return k(n.color)||c.theme.primary}),(function(n){return k(n.hoverBackground)||c.theme.blue100}),c.theme.blue200,c.theme.buttonFocusRing),q=v.default(_)(x||(x=n.__makeTemplateObject(["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"])),(function(n){return n.href?c.theme.primary:c.theme.textColorSecondary}),(function(n){return n.href?c.theme.blue500:c.theme.gray700}),(function(n){return n.href?c.theme.blue300:c.theme.gray300})),S=_;exports.Button=function(o){var c=o.children,u=o.className,s=o.disabled,d=void 0!==s&&s,l=o.icon,h=o.iconRight,g=o.loading,b=void 0!==g&&g,p=o.loadingText,m=o.noRipple,f=void 0!==m&&m,x=o.size,v=void 0===x?"sm":x,k=o.spinnerColor,_=o.tag,I=o.themeOverride,G=o.type,D=void 0===G?"button":G,F=o.variant,H=void 0===F?"standard":F,N=n.__rest(o,["children","className","disabled","icon","iconRight","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type","variant"]),W=_||"button",E=function(n){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"content",children:!h&&l}),e.jsx("div",{className:"content text",children:c}),e.jsx("span",{className:"content",children:h&&l}),"plain"!==H&&"text"!==H&&b&&e.jsxs(y,{children:[e.jsx(i.Spinner,{color:n,size:w(v)}),p]})]})},P=["amino-button",u||"",l&&!c?"only-icon":"",h?"icon-right":"",l?"has-icon":"",b?"loading":"",I].filter(Boolean).join(" "),M=t.useRef(null),A=a.useRipple({disabled:d||b,rippleEnabled:!f&&!["plain","text"].includes(H),rippleRef:M}),J=A.getRippleHandlers,K=A.rippleEnabled,L={className:P,disabled:d||b,size:v},Q=n.__assign(n.__assign(n.__assign({type:D},L),N),J(N));switch(H){case"primary":return e.jsxs(j,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"info":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"success":return e.jsxs(B,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"success":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"warning":return e.jsxs(C,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"warning":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"danger":return e.jsxs(z,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"danger":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"subtle":return e.jsxs(O,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"link":return e.jsxs(T,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||"info"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"plain":return e.jsx(S,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:E(k)}));case"text":return e.jsx(q,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:E(k)}));default:return e.jsxs(R,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}))}};
1
+ "use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react"),o=require("styled-components"),r=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function u(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var s,d,l,h,g,b,p,m,f,x,v=u(o),k=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},w=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},y=v.default.span(s||(s=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),c.theme.radius6,c.theme.space8),_=v.default.button(d||(d=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active:not([disabled]) {\n transform: scale(0.99);\n }\n\n &.loading .content {\n visibility: hidden;\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n opacity: ",";\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition:\n ",",\n visibility 0;\n font-weight: ",";\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n width: ",";\n text-shadow:\n 0px 2px 4px rgba(0, 0, 0, 0.02),\n 0px 1px 2px rgba(0, 0, 0, 0.04);\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n .text {\n padding: 0 ",";\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &.only-icon .text {\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n &:active:not([disabled]) {\n transform: scale(0.99);\n }\n\n &.loading .content {\n visibility: hidden;\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: 2px;\n margin-right: 0;\n opacity: 80%;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: 2px;\n margin-left: 0;\n opacity: 80%;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n opacity: ",";\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.fontSizeBase,c.theme.space16,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.radius6);case"lg":case"xl":return"".concat(c.theme.radius10);default:return"".concat(c.theme.radius8)}}(n.size)}),c.theme.transition,(function(n){return function(n){switch(n){case"lg":case"xl":return 600;default:return 500}}(n.size)}),c.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.space4," ").concat(c.theme.space8);case"lg":case"xl":return"".concat(c.theme.space12," ").concat(c.theme.space24);default:return"".concat(c.theme.space8," ").concat(c.theme.space16)}}(n.size)}),(function(n){return n.fitContentWidth&&"fit-content"}),c.theme.space4,(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return n.outline?.6:1})),j=v.default(_)(l||(l=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||n.outline?c.theme.primary:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.primary," inset"):c.theme.shadowButtonPrimary}),(function(n){return k(n.background)||n.outline?"transparent":c.theme.primary}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.blue100:""}),(function(n){return n.outline?"":c.theme.buttonPrimaryHover}),(function(n){return n.outline?c.theme.blue200:c.theme.blue700}),c.theme.focusButton,(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.primary," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.primary})),B=v.default(_)(h||(h=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||n.outline?c.theme.success:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success):c.theme.shadowButtonSuccess}),(function(n){return k(n.background)||n.outline?"transparent":c.theme.success}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.green100:""}),(function(n){return n.outline?"":c.theme.buttonSuccessHover}),(function(n){return n.outline?c.theme.green200:c.theme.green700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.success," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.success})),R=v.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n background: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.color)||c.theme.textColor}),(function(n){return n.outline?"transparent":k(n.background)||c.theme.surfaceColor}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.gray300," inset"):c.theme.shadowButtonStandard}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.gray100:""}),(function(n){return n.outline?"":c.theme.buttonStandardHover}),(function(n){return n.outline?c.theme.gray200:c.theme.gray100}),c.theme.focusButtonStandard,y,(function(n){return n.outline?"transparent":c.theme.surfaceColor})),z=v.default(_)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.background)||n.outline?"transparent":c.theme.danger}),(function(n){return k(n.color)||n.outline?c.theme.danger:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger):c.theme.shadowButtonDanger}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.red100:""}),(function(n){return n.outline?"":c.theme.buttonDangerHover}),(function(n){return n.outline?c.theme.red200:c.theme.red700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.danger," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.danger})),C=v.default(_)(p||(p=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n &:focus {\n box-shadow: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n box-shadow: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return k(n.background)||n.outline?"transparent":c.theme.warning}),(function(n){return k(n.color)||n.outline?c.theme.warning:c.theme.gray0}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning):c.theme.shadowButtonWarning}),(function(n){return k(n.hoverBackground)||n.outline?c.theme.orange100:""}),(function(n){return n.outline?"":c.theme.buttonWarningHover}),(function(n){return n.outline?c.theme.orange200:c.theme.orange700}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning," inset, ").concat(c.theme.buttonFocusRing):c.theme.focusButton}),(function(n){return n.outline?"transparent":c.theme.gray400}),(function(n){return n.outline?"0px 0px 0px 1px ".concat(c.theme.warning," inset"):c.theme.shadowButtonDisabled}),y,(function(n){return n.outline?"transparent":c.theme.warning})),O=v.default(_)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return k(n.background)||"none"}),(function(n){return k(n.color)||c.theme.textColorSecondary}),(function(n){return k(n.hoverBackground)||c.theme.gray100}),c.theme.gray200,c.theme.buttonFocusRing),T=v.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n box-shadow: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return k(n.color)||c.theme.primary}),(function(n){return k(n.hoverBackground)||c.theme.blue100}),c.theme.blue200,c.theme.buttonFocusRing),q=v.default(_)(x||(x=n.__makeTemplateObject(["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n }\n &[disabled] {\n color: ",";\n }\n &.loading {\n color: transparent;\n }\n"])),(function(n){return n.href?c.theme.primary:c.theme.textColorSecondary}),(function(n){return n.href?c.theme.blue500:c.theme.gray500}),(function(n){return n.href?c.theme.blue300:c.theme.gray300})),S=_;exports.Button=function(o){var c=o.children,u=o.className,s=o.disabled,d=void 0!==s&&s,l=o.icon,h=o.iconRight,g=o.loading,b=void 0!==g&&g,p=o.loadingText,m=o.noRipple,f=void 0!==m&&m,x=o.size,v=void 0===x?"sm":x,k=o.spinnerColor,_=o.tag,I=o.themeOverride,G=o.type,D=void 0===G?"button":G,F=o.variant,H=void 0===F?"standard":F,N=n.__rest(o,["children","className","disabled","icon","iconRight","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type","variant"]),W=_||"button",E=function(n){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"content",children:!h&&l}),e.jsx("div",{className:"content text",children:c}),e.jsx("span",{className:"content",children:h&&l}),"plain"!==H&&"text"!==H&&b&&e.jsxs(y,{children:[e.jsx(i.Spinner,{color:n,size:w(v)}),p]})]})},P=["amino-button",u||"",l&&!c?"only-icon":"",h?"icon-right":"",l?"has-icon":"",b?"loading":"",I].filter(Boolean).join(" "),M=t.useRef(null),A=a.useRipple({disabled:d||b,rippleEnabled:!f&&!["plain","text"].includes(H),rippleRef:M}),J=A.getRippleHandlers,K=A.rippleEnabled,L={className:P,disabled:d||b,size:v},Q=n.__assign(n.__assign(n.__assign({type:D},L),N),J(N));switch(H){case"primary":return e.jsxs(j,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"info":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"success":return e.jsxs(B,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"success":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"warning":return e.jsxs(C,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"warning":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"danger":return e.jsxs(z,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||Q.outline?"danger":"white"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"subtle":return e.jsxs(O,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"link":return e.jsxs(T,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||"info"),K&&e.jsx(r.RippleGroup,{ref:M})]}));case"plain":return e.jsx(S,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:E(k)}));case"text":return e.jsx(q,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:E(k)}));default:return e.jsxs(R,n.__assign({as:W,tabIndex:"div"===W?0:void 0},Q,{children:[E(k||"black"),K&&e.jsx(r.RippleGroup,{ref:M})]}))}};
@@ -0,0 +1,5 @@
1
+ import { Button } from "./Button";
2
+ /**
3
+ * A Button that is just an icon.
4
+ */
5
+ export declare const ButtonIcon: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
@@ -0,0 +1 @@
1
+ "use strict";var n=require("../../_tslib-ccfac372.js"),e=require("styled-components"),r=require("./Button.js"),a=require("../../styles/constants/theme.js");function t(n){return n&&n.__esModule?n:{default:n}}require("react/jsx-runtime"),require("react"),require("./RippleGroup.js"),require("framer-motion"),require("uuid"),require("./_Ripple.js"),require("./useRipple.js"),require("../spinner/Spinner.js");var o,i=t(e).default(r.Button)(o||(o=n.__makeTemplateObject(["\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n"],["\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n"])),a.theme.gray200,a.theme.gray800,a.theme.gray300,a.theme.gray400);exports.ButtonIcon=i;
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime");require("react");var i=require("styled-components"),t=require("../../animations/DropdownAnimation.js"),o=require("../../styles/constants/theme.js"),a=require("../../utils/hooks/useDropdown.js");function s(e){return e&&e.__esModule?e:{default:e}}require("@floating-ui/react");var r,l,d,u=s(i),c=u.default.div(r||(r=e.__makeTemplateObject(["\n position: relative;\n display: inline-flex;\n"],["\n position: relative;\n display: inline-flex;\n"]))),m=u.default.div(l||(l=e.__makeTemplateObject(["\n z-index: 10;\n"],["\n z-index: 10;\n"]))),f=u.default.div(d||(d=e.__makeTemplateObject(["\n background: ",";\n border-radius: ",";\n box-shadow: ",";\n animation: "," 250ms ease-in-out;\n animation-fill-mode: both;\n padding: ",";\n margin-top: ",";\n right: 0;\n min-width: 100%;\n width: max-content;\n"],["\n background: ",";\n border-radius: ",";\n box-shadow: ",";\n animation: "," 250ms ease-in-out;\n animation-fill-mode: both;\n padding: ",";\n margin-top: ",";\n right: 0;\n min-width: 100%;\n width: max-content;\n"])),o.theme.surfaceColor,o.theme.radius12,o.theme.v3ShadowLarge,t.DropdownAnimation,o.theme.space8,o.theme.space4);exports.MenuButton=function(i){var t=i.action,o=i.children,s=i.className,r=i.closeOnMouseLeave,l=void 0===r||r,d=i.closeOnSelect,u=void 0===d||d,h=a.useDropdown({offsetCrossAxis:0,offsetMainAxis:0}),p=h.floatingStyles,b=h.refs,v=h.setVisible,x=h.visibility,g=h.visible,w=h.wrapperRef,_=function(){u&&v(!1)};return n.jsxs(c,{ref:w,className:s,onMouseLeave:function(){l&&v(!1)},children:[n.jsx("div",{ref:b.setReference,onClick:function(e){e.stopPropagation(),v(!0)},onKeyDown:function(e){"Enter"===e.key&&v(!0)},role:"button",tabIndex:0,children:t}),n.jsx(m,{ref:b.setFloating,style:e.__assign(e.__assign({},p),{visibility:x}),children:g&&n.jsx(f,{onClick:_,onKeyDown:function(e){"Enter"===e.key&&_()},role:"button",tabIndex:-1,children:o})})]})};
1
+ "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime");require("react");var i=require("styled-components"),t=require("../../animations/DropdownAnimation.js"),o=require("../../styles/constants/theme.js"),a=require("../../utils/hooks/useDropdown.js");function s(e){return e&&e.__esModule?e:{default:e}}require("@floating-ui/react");var r,d,l,u=s(i),c=u.default.div(r||(r=e.__makeTemplateObject(["\n position: relative;\n display: inline-flex;\n"],["\n position: relative;\n display: inline-flex;\n"]))),m=u.default.div(d||(d=e.__makeTemplateObject(["\n z-index: 10;\n min-width: 100%;\n"],["\n z-index: 10;\n min-width: 100%;\n"]))),f=u.default.div(l||(l=e.__makeTemplateObject(["\n background: ",";\n border-radius: ",";\n box-shadow: ",";\n animation: "," 250ms ease-in-out;\n animation-fill-mode: both;\n padding: ",";\n margin-top: ",";\n right: 0;\n min-width: 100%;\n width: max-content;\n"],["\n background: ",";\n border-radius: ",";\n box-shadow: ",";\n animation: "," 250ms ease-in-out;\n animation-fill-mode: both;\n padding: ",";\n margin-top: ",";\n right: 0;\n min-width: 100%;\n width: max-content;\n"])),o.theme.surfaceColor,o.theme.radius12,o.theme.v3ShadowLarge,t.DropdownAnimation,o.theme.space8,o.theme.space4);exports.MenuButton=function(i){var t=i.action,o=i.children,s=i.className,r=i.closeOnMouseLeave,d=void 0===r||r,l=i.closeOnSelect,u=void 0===l||l,h=a.useDropdown({offsetCrossAxis:0,offsetMainAxis:0}),p=h.floatingStyles,b=h.refs,v=h.setVisible,x=h.visibility,w=h.visible,g=h.wrapperRef,_=function(){u&&v(!1)};return n.jsxs(c,{ref:g,className:s,onMouseLeave:function(){d&&v(!1)},children:[n.jsx("div",{ref:b.setReference,onClick:function(e){e.stopPropagation(),v(!0)},onKeyDown:function(e){"Enter"===e.key&&v(!0)},role:"button",tabIndex:0,children:t}),n.jsx(m,{ref:b.setFloating,style:e.__assign(e.__assign({},p),{visibility:x}),children:w&&n.jsx(f,{onClick:_,onKeyDown:function(e){"Enter"===e.key&&_()},role:"button",tabIndex:-1,children:o})})]})};
@@ -4,7 +4,7 @@ export type DialogProps = BaseDialogProps & {
4
4
  actions?: ReactNode;
5
5
  label?: ReactNode;
6
6
  leftActions?: ReactNode;
7
- subtitle?: string;
7
+ subtitle?: ReactNode;
8
8
  onClose: () => void;
9
9
  };
10
10
  export declare const Dialog: import("react").ForwardRefExoticComponent<import("../../types/BaseProps").BaseProps & {
@@ -22,6 +22,6 @@ export declare const Dialog: import("react").ForwardRefExoticComponent<import(".
22
22
  actions?: ReactNode;
23
23
  label?: ReactNode;
24
24
  leftActions?: ReactNode;
25
- subtitle?: string | undefined;
25
+ subtitle?: ReactNode;
26
26
  onClose: () => void;
27
27
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),a=require("../button/Button.js"),i=require("./BaseDialog.js"),l=require("../text/Text.js"),o=require("../../icons/RemoveCircleDuotoneIcon.js"),s=require("../../styles/constants/theme.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../../icons/icon-base/_IconBase.js");var c,u,p,f,m,h,g,x,b=d(r),j=b.default.div(c||(c=e.__makeTemplateObject(["\n padding: ",";\n padding-bottom: ",";\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n display: flex;\n flex-direction: column;\n gap: ",";\n"],["\n padding: ",";\n padding-bottom: ",";\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n display: flex;\n flex-direction: column;\n gap: ",";\n"])),s.theme.space24,s.theme.space16,s.theme.radius12,s.theme.radius12,s.theme.space12),y=b.default.div(u||(u=e.__makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n\n > :not(button) {\n margin: 0;\n flex-grow: 1;\n }\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n\n > :not(button) {\n margin: 0;\n flex-grow: 1;\n }\n"]))),v=b.default(a.Button)(p||(p=e.__makeTemplateObject(["\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n"],["\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n"])),s.theme.gray200,s.theme.gray800,s.theme.gray300,s.theme.gray400),_=b.default.div(f||(f=e.__makeTemplateObject(["\n flex-grow: 1;\n display: flex;\n"],["\n flex-grow: 1;\n display: flex;\n"]))),q=b.default(_)(m||(m=e.__makeTemplateObject(["\n justify-content: flex-start;\n display: flex;\n gap: ",";\n"],["\n justify-content: flex-start;\n display: flex;\n gap: ",";\n"])),s.theme.space8),k=b.default(_)(h||(h=e.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n gap: ",";\n"],["\n justify-content: flex-end;\n display: flex;\n gap: ",";\n"])),s.theme.space8),w=b.default.div(g||(g=e.__makeTemplateObject(["\n padding: ",";\n display: flex;\n align-items: center;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n\n & > div + div {\n margin-left: ",";\n }\n"],["\n padding: ",";\n display: flex;\n align-items: center;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n\n & > div + div {\n margin-left: ",";\n }\n"])),s.theme.space24,s.theme.radius12,s.theme.radius12,s.theme.space8),T=b.default.div(x||(x=e.__makeTemplateObject(["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"],["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"])),s.theme.space8,s.theme.space24),O=t.forwardRef((function(t,r){var a=t.actions,s=t.children,d=t.label,c=t.leftActions,u=t.onClose,p=t.subtitle,f=e.__rest(t,["actions","children","label","leftActions","onClose","subtitle"]);return n.jsxs(i.BaseDialog,e.__assign({},f,{onClose:u,children:[n.jsxs(j,{children:[n.jsxs(y,{children:[n.jsx(l.Text,{type:"title",children:d}),n.jsx(v,{icon:n.jsx(o.RemoveCircleDuotoneIcon,{size:24}),noRipple:!0,onClick:u,variant:"subtle"})]}),p&&n.jsx(l.Text,{type:"subtitle",children:p})]}),n.jsx(T,{ref:r,children:s}),(a||c)&&n.jsxs(w,{children:[c&&n.jsx(q,{children:c}),a&&n.jsx(k,{children:a})]})]}))}));exports.Dialog=O;
1
+ "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),i=require("styled-components"),r=require("../button/ButtonIcon.js"),a=require("./BaseDialog.js"),s=require("../text/Text.js"),l=require("../../icons/RemoveCircleDuotoneIcon.js"),o=require("../../styles/constants/theme.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../button/Button.js"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../../icons/icon-base/_IconBase.js");var u,c,p,f,m,x,g,b=d(i),j=b.default.div(u||(u=e.__makeTemplateObject(["\n padding: ",";\n padding-bottom: ",";\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n display: flex;\n flex-direction: column;\n gap: ",";\n"],["\n padding: ",";\n padding-bottom: ",";\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n display: flex;\n flex-direction: column;\n gap: ",";\n"])),o.theme.space24,o.theme.space16,o.theme.radius12,o.theme.radius12,o.theme.space12),h=b.default.div(c||(c=e.__makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n\n > :not(button) {\n margin: 0;\n flex-grow: 1;\n }\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n\n > :not(button) {\n margin: 0;\n flex-grow: 1;\n }\n"]))),_=b.default.div(p||(p=e.__makeTemplateObject(["\n flex-grow: 1;\n display: flex;\n"],["\n flex-grow: 1;\n display: flex;\n"]))),y=b.default(_)(f||(f=e.__makeTemplateObject(["\n justify-content: flex-start;\n display: flex;\n gap: ",";\n"],["\n justify-content: flex-start;\n display: flex;\n gap: ",";\n"])),o.theme.space8),q=b.default(_)(m||(m=e.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n gap: ",";\n"],["\n justify-content: flex-end;\n display: flex;\n gap: ",";\n"])),o.theme.space8),v=b.default.div(x||(x=e.__makeTemplateObject(["\n padding: ",";\n display: flex;\n align-items: center;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n\n & > div + div {\n margin-left: ",";\n }\n"],["\n padding: ",";\n display: flex;\n align-items: center;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n\n & > div + div {\n margin-left: ",";\n }\n"])),o.theme.space24,o.theme.radius12,o.theme.radius12,o.theme.space8),w=b.default.div(g||(g=e.__makeTemplateObject(["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"],["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"])),o.theme.space8,o.theme.space24),T=t.forwardRef((function(t,i){var o=t.actions,d=t.children,u=t.label,c=t.leftActions,p=t.onClose,f=t.subtitle,m=e.__rest(t,["actions","children","label","leftActions","onClose","subtitle"]);return n.jsxs(a.BaseDialog,e.__assign({},m,{onClose:p,children:[n.jsxs(j,{children:[n.jsxs(h,{children:[n.jsx(s.Text,{type:"title",children:u}),n.jsx(r.ButtonIcon,{icon:n.jsx(l.RemoveCircleDuotoneIcon,{size:24}),noRipple:!0,onClick:p,variant:"text"})]}),f&&n.jsx(s.Text,{type:"subtitle",children:f})]}),n.jsx(w,{ref:i,children:d}),(o||c)&&n.jsxs(v,{children:[c&&n.jsx(y,{children:c}),o&&n.jsx(q,{children:o})]})]}))}));exports.Dialog=T;
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),i=require("react-dropzone"),r=require("styled-components"),t=require("../avatar/ImageAvatar.js"),o=require("../button/Button.js"),a=require("../spinner/Spinner.js"),l=require("../text/Text.js"),s=require("../thumbnail/Thumbnail.js"),d=require("../../icons/FileDuotoneIcon.js"),c=require("../../icons/FileUploadDuotoneIcon.js"),u=require("../../icons/RemoveCircleDuotoneIcon.js"),p=require("../../styles/constants/theme.js");function m(e){return e&&e.__esModule?e:{default:e}}require("../avatar/AvatarBase.js"),require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../../icons/icon-base/_IconBase.js");var x,f,h,j,g,b,y,v,_,q=m(r),T=q.default.div(x||(x=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n opacity: ",";\n cursor: ",";\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n opacity: ",";\n cursor: ",";\n"])),p.theme.space16,(function(e){return e.$disabled?.5:1}),(function(e){return e.$disabled?"not-allowed":"auto"})),k=q.default.div(f||(f=e.__makeTemplateObject(["\n border: 2px dashed;\n border-color: ",";\n border-radius: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n"],["\n border: 2px dashed;\n border-color: ",";\n border-radius: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n"])),(function(e){return e.$error?p.theme.danger:p.theme.borderColor}),p.theme.radius12),I=q.default.div(h||(h=e.__makeTemplateObject(["\n padding: ",";\n outline: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: ",";\n width: 100%;\n height: 100%;\n"],["\n padding: ",";\n outline: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: ",";\n width: 100%;\n height: 100%;\n"])),p.theme.space16,p.theme.space12),O=q.default.div(j||(j=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n align-items: center;\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n align-items: center;\n"])),p.theme.space4),D=q.default.button(g||(g=e.__makeTemplateObject(["\n display: inline;\n"],["\n display: inline;\n"]))),F=q.default(o.Button)(b||(b=e.__makeTemplateObject(["\n margin-left: auto;\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n\n :active,\n :focus {\n outline: none;\n box-shadow: unset;\n }\n"],["\n margin-left: auto;\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n\n :active,\n :focus {\n outline: none;\n box-shadow: unset;\n }\n"])),p.theme.gray200,p.theme.gray800,p.theme.gray300,p.theme.gray400),z=q.default.div(y||(y=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n"])),p.theme.space4),R=q.default.div(v||(v=e.__makeTemplateObject(["\n border: ",";\n border-radius: ",";\n padding: ",";\n display: flex;\n justify-content: flex-start;\n gap: ",";\n"],["\n border: ",";\n border-radius: ",";\n padding: ",";\n display: flex;\n justify-content: flex-start;\n gap: ",";\n"])),p.theme.border,p.theme.space12,p.theme.space16,p.theme.space12),w=q.default.div(_||(_=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));exports.DropZone=function(r){var o=r.className,p=r.disabled,m=void 0!==p&&p,x=r.dropzoneOptions,f=r.error,h=void 0!==f&&f,j=r.helpText,g=r.instructionText,b=void 0===g?"Drop your file(s) here":g,y=r.loading,v=r.loadingText,_=void 0===v?"Uploading file(s)...":v,q=r.noIcon,C=void 0!==q&&q,U=r.onRemoveFile,$=r.uploadedFiles,B=x.maxFiles||0,A=i.useDropzone(e.__assign(e.__assign({},x),{disabled:m,noClick:!0,noKeyboard:!0})),N=A.getInputProps,P=A.getRootProps,S=A.open,G=0!==B&&$.length>=B;return n.jsx(T,{$disabled:m,className:o,children:y?n.jsx(k,{children:n.jsxs(I,{children:[n.jsx(a.Spinner,{}),n.jsx(l.Text,{color:"gray800",type:"label",children:_})]})}):n.jsxs(n.Fragment,{children:[!G&&n.jsx(k,{$error:h,children:n.jsxs(I,e.__assign({},P(),{role:void 0,children:[n.jsx("input",e.__assign({},N())),!C&&n.jsx(s.Thumbnail,{icon:n.jsx(c.FileUploadDuotoneIcon,{}),size:40}),n.jsxs(O,{children:[n.jsxs(l.Text,{type:"label",children:[b," or"," ",n.jsx(D,{disabled:m,onClick:S,type:"button",children:n.jsx(l.Text,{color:"blue600",type:"label",children:"browse"})})]}),j&&n.jsx(l.Text,{type:"caption",children:j})]})]}))}),!!$.length&&n.jsx(z,{children:$.map((function(e,i){return n.jsxs(R,{children:[e.imageUrl?n.jsx(t.ImageAvatar,{imageUrl:e.imageUrl,shape:"rounded"}):n.jsx(d.FileDuotoneIcon,{}),n.jsxs(w,{children:[n.jsx(l.Text,{color:"gray1200",type:"label",children:e.name}),e.size&&n.jsx(l.Text,{color:"gray700",type:"caption",children:e.size})]}),U&&n.jsx(F,{onClick:function(){return U(i)},children:n.jsx(u.RemoveCircleDuotoneIcon,{size:20})})]},e.name)}))})]})})};
1
+ "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),i=require("react-dropzone"),r=require("styled-components"),t=require("../avatar/ImageAvatar.js"),o=require("../button/ButtonIcon.js"),l=require("../spinner/Spinner.js"),a=require("../text/Text.js"),s=require("../thumbnail/Thumbnail.js"),d=require("../../icons/FileDuotoneIcon.js"),c=require("../../icons/FileUploadDuotoneIcon.js"),u=require("../../icons/RemoveCircleDuotoneIcon.js"),p=require("../../styles/constants/theme.js");function m(e){return e&&e.__esModule?e:{default:e}}require("../avatar/AvatarBase.js"),require("../button/Button.js"),require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../../icons/icon-base/_IconBase.js");var x,j,f,b,h,g,y,_,v,q=m(r),T=q.default.div(x||(x=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n opacity: ",";\n cursor: ",";\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n opacity: ",";\n cursor: ",";\n"])),p.theme.space16,(function(e){return e.$disabled?.5:1}),(function(e){return e.$disabled?"not-allowed":"auto"})),I=q.default.div(j||(j=e.__makeTemplateObject(["\n border: 2px dashed;\n border-color: ",";\n border-radius: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n"],["\n border: 2px dashed;\n border-color: ",";\n border-radius: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n"])),(function(e){return e.$error?p.theme.danger:p.theme.borderColor}),p.theme.radius12),k=q.default.div(f||(f=e.__makeTemplateObject(["\n padding: ",";\n outline: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: ",";\n width: 100%;\n height: 100%;\n"],["\n padding: ",";\n outline: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: ",";\n width: 100%;\n height: 100%;\n"])),p.theme.space16,p.theme.space12),O=q.default.div(b||(b=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n align-items: center;\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n align-items: center;\n"])),p.theme.space4),D=q.default.button(h||(h=e.__makeTemplateObject(["\n display: inline;\n"],["\n display: inline;\n"]))),F=q.default(o.ButtonIcon)(g||(g=e.__makeTemplateObject(["\n margin-left: auto;\n"],["\n margin-left: auto;\n"]))),z=q.default.div(y||(y=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n"])),p.theme.space4),R=q.default.div(_||(_=e.__makeTemplateObject(["\n border: ",";\n border-radius: ",";\n padding: ",";\n display: flex;\n justify-content: flex-start;\n gap: ",";\n"],["\n border: ",";\n border-radius: ",";\n padding: ",";\n display: flex;\n justify-content: flex-start;\n gap: ",";\n"])),p.theme.border,p.theme.space12,p.theme.space16,p.theme.space12),C=q.default.div(v||(v=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));exports.DropZone=function(r){var o=r.className,p=r.disabled,m=void 0!==p&&p,x=r.dropzoneOptions,j=r.error,f=void 0!==j&&j,b=r.helpText,h=r.instructionText,g=void 0===h?"Drop your file(s) here":h,y=r.loading,_=r.loadingText,v=void 0===_?"Uploading file(s)...":_,q=r.noIcon,U=void 0!==q&&q,B=r.onRemoveFile,$=r.uploadedFiles,w=x.maxFiles||0,A=i.useDropzone(e.__assign(e.__assign({},x),{disabled:m,noClick:!0,noKeyboard:!0})),N=A.getInputProps,P=A.getRootProps,S=A.open,G=0!==w&&$.length>=w;return n.jsx(T,{$disabled:m,className:o,children:y?n.jsx(I,{children:n.jsxs(k,{children:[n.jsx(l.Spinner,{}),n.jsx(a.Text,{color:"gray800",type:"label",children:v})]})}):n.jsxs(n.Fragment,{children:[!G&&n.jsx(I,{$error:f,children:n.jsxs(k,e.__assign({},P(),{role:void 0,children:[n.jsx("input",e.__assign({},N())),!U&&n.jsx(s.Thumbnail,{icon:n.jsx(c.FileUploadDuotoneIcon,{}),size:40}),n.jsxs(O,{children:[n.jsxs(a.Text,{type:"label",children:[g," or"," ",n.jsx(D,{disabled:m,onClick:S,type:"button",children:n.jsx(a.Text,{color:"blue600",type:"label",children:"browse"})})]}),b&&n.jsx(a.Text,{type:"caption",children:b})]})]}))}),!!$.length&&n.jsx(z,{children:$.map((function(e,i){return n.jsxs(R,{children:[e.imageUrl?n.jsx(t.ImageAvatar,{imageUrl:e.imageUrl,shape:"rounded"}):n.jsx(d.FileDuotoneIcon,{}),n.jsxs(C,{children:[n.jsx(a.Text,{color:"gray1200",type:"label",children:e.name}),e.size&&n.jsx(a.Text,{color:"gray700",type:"caption",children:e.size})]}),B&&n.jsx(F,{icon:n.jsx(u.RemoveCircleDuotoneIcon,{size:20}),onClick:function(){return B(i)},variant:"text"})]},e.name)}))})]})})};
@@ -1 +1 @@
1
- "use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react-dropzone"),r=require("styled-components"),o=require("../button/Button.js"),i=require("../text/Text.js"),a=require("../../icons/RemoveCircleDuotoneIcon.js"),s=require("../../styles/constants/theme.js");function l(n){return n&&n.__esModule?n:{default:n}}require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../../icons/icon-base/_IconBase.js");var c,d,u,p,f,m=l(r),x=m.default.div(c||(c=n.__makeTemplateObject(["\n display: flex;\n justify-content: flex-start;\n padding: "," ",";\n border-radius: ",";\n border: ",";\n border-color: ",";\n\n opacity: ",";\n cursor: ",";\n"],["\n display: flex;\n justify-content: flex-start;\n padding: "," ",";\n border-radius: ",";\n border: ",";\n border-color: ",";\n\n opacity: ",";\n cursor: ",";\n"])),s.theme.space8,s.theme.space12,s.theme.radius10,s.theme.border,(function(n){return n.error?s.theme.danger:s.theme.borderColor}),(function(n){return n.disabled?.5:1}),(function(n){return n.disabled?"not-allowed":"auto"})),g=m.default.div(d||(d=n.__makeTemplateObject(["\n outline: none;\n text-align: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n"],["\n outline: none;\n text-align: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n"]))),h=m.default.div(u||(u=n.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: ",";\n"])),s.theme.space12),y=m.default.div(p||(p=n.__makeTemplateObject(["\n display: flex;\n gap: ",";\n align-items: center;\n"],["\n display: flex;\n gap: ",";\n align-items: center;\n"])),s.theme.space4),j=m.default(o.Button)(f||(f=n.__makeTemplateObject(["\n margin-left: auto;\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n\n :active,\n :focus {\n outline: none;\n box-shadow: unset;\n }\n"],["\n margin-left: auto;\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n\n :active,\n :focus {\n outline: none;\n box-shadow: unset;\n }\n"])),s.theme.gray200,s.theme.gray800,s.theme.gray300,s.theme.gray400);exports.FileUpload=function(r){var s=r.className,l=r.disabled,c=void 0!==l&&l,d=r.dropzoneOptions,u=r.error,p=void 0!==u&&u,f=r.instructionText,m=void 0===f?"or drag your file here":f,b=r.loading,v=r.loadingText,_=void 0===v?"Uploading...":v,q=r.onRemoveFile,T=r.uploadedFile,k=t.useDropzone(n.__assign(n.__assign({},d),{disabled:c,multiple:!1,noClick:!0,noKeyboard:!0})),C=k.getInputProps,R=k.getRootProps,O=k.open,z=function(){return b?e.jsx(i.Text,{children:_}):T?function(){if(T){var n=T.name,t=T.size;return e.jsxs(y,{children:[e.jsx(i.Text,{color:"gray1200",type:"label",children:n}),t&&e.jsx(i.Text,{color:"gray700",type:"caption",children:t})]})}return null}():e.jsx(i.Text,{color:"gray600",children:m})};return e.jsxs(x,{className:s,disabled:c,error:p,children:[e.jsxs(g,n.__assign({},R(),{children:[e.jsx("input",n.__assign({},C())),e.jsxs(h,{children:[e.jsx(o.Button,{loading:b,onClick:O,spinnerColor:"black",children:"Browse"}),z()]})]})),q&&T&&e.jsx(j,{onClick:function(){return q()},children:e.jsx(a.RemoveCircleDuotoneIcon,{size:20})})]})};
1
+ "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react-dropzone"),r=require("styled-components"),i=require("../button/Button.js"),o=require("../button/ButtonIcon.js"),s=require("../text/Text.js"),l=require("../../icons/RemoveCircleDuotoneIcon.js"),a=require("../../styles/constants/theme.js");function u(e){return e&&e.__esModule?e:{default:e}}require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../../icons/icon-base/_IconBase.js");var c,d,p,m,f,x=u(r),j=x.default.div(c||(c=e.__makeTemplateObject(["\n display: flex;\n justify-content: flex-start;\n padding: "," ",";\n border-radius: ",";\n border: ",";\n border-color: ",";\n\n opacity: ",";\n cursor: ",";\n"],["\n display: flex;\n justify-content: flex-start;\n padding: "," ",";\n border-radius: ",";\n border: ",";\n border-color: ",";\n\n opacity: ",";\n cursor: ",";\n"])),a.theme.space8,a.theme.space12,a.theme.radius10,a.theme.border,(function(e){return e.error?a.theme.danger:a.theme.borderColor}),(function(e){return e.disabled?.5:1}),(function(e){return e.disabled?"not-allowed":"auto"})),g=x.default.div(d||(d=e.__makeTemplateObject(["\n outline: none;\n text-align: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n"],["\n outline: none;\n text-align: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n"]))),b=x.default.div(p||(p=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: ",";\n"])),a.theme.space12),y=x.default.div(m||(m=e.__makeTemplateObject(["\n display: flex;\n gap: ",";\n align-items: center;\n"],["\n display: flex;\n gap: ",";\n align-items: center;\n"])),a.theme.space4),_=x.default(o.ButtonIcon)(f||(f=e.__makeTemplateObject(["\n margin-left: auto;\n"],["\n margin-left: auto;\n"])));exports.FileUpload=function(r){var o=r.className,a=r.disabled,u=void 0!==a&&a,c=r.dropzoneOptions,d=r.error,p=void 0!==d&&d,m=r.instructionText,f=void 0===m?"or drag your file here":m,x=r.loading,h=r.loadingText,q=void 0===h?"Uploading...":h,v=r.onRemoveFile,T=r.uploadedFile,k=t.useDropzone(e.__assign(e.__assign({},c),{disabled:u,multiple:!1,noClick:!0,noKeyboard:!0})),C=k.getInputProps,R=k.getRootProps,B=k.open,I=function(){return x?n.jsx(s.Text,{children:q}):T?function(){if(T){var e=T.name,t=T.size;return n.jsxs(y,{children:[n.jsx(s.Text,{color:"gray1200",type:"label",children:e}),t&&n.jsx(s.Text,{color:"gray700",type:"caption",children:t})]})}return null}():n.jsx(s.Text,{color:"gray600",children:f})};return n.jsxs(j,{className:o,disabled:u,error:p,children:[n.jsxs(g,e.__assign({},R(),{children:[n.jsx("input",e.__assign({},C())),n.jsxs(b,{children:[n.jsx(i.Button,{loading:x,onClick:B,spinnerColor:"black",children:"Browse"}),I()]})]})),v&&T&&n.jsx(_,{icon:n.jsx(l.RemoveCircleDuotoneIcon,{size:20}),onClick:function(){return v()},variant:"text"})]})};
@@ -4,6 +4,6 @@ export type RestStateProps = {
4
4
  className?: string;
5
5
  icon?: string;
6
6
  label: string;
7
- subtitle?: string;
7
+ subtitle?: ReactNode;
8
8
  };
9
9
  export declare const RestState: ({ action, className, icon, label, subtitle, }: RestStateProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.1.51",
3
+ "version": "5.1.52",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",
@@ -1,9 +1,10 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { Intent } from "./Intent";
2
3
  export type ConfirmDialogOpts = {
3
4
  confirmText: string;
4
5
  dismissText: string;
5
6
  intent: Intent;
6
7
  label: string;
7
- subtitle?: string;
8
+ subtitle?: ReactNode;
8
9
  onConfirm: (ok: boolean) => void;
9
10
  };
@@ -1,6 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { type ExtendedRefs, type Placement } from '@floating-ui/react';
2
+ import { type ExtendedRefs, type Placement, type UseFloatingOptions } from '@floating-ui/react';
3
3
  type Params = {
4
+ /**
5
+ * Passed to `useFloating`.
6
+ * @link https://floating-ui.com/docs/useFloating
7
+ */
8
+ floatingOptions?: Partial<UseFloatingOptions>;
4
9
  /**
5
10
  * @default 0
6
11
  */
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react"),i=require("@floating-ui/react");exports.useDropdown=function(n){var o=null!=n?n:{},s=o.offsetCrossAxis,r=void 0===s?0:s,u=o.offsetMainAxis,a=void 0===u?0:u,l=o.placement,d=void 0===l?"bottom-start":l,f=e.__read(t.useState(!1),2),c=f[0],v=f[1],m=c?"visible":"hidden",p=t.useRef(null),b=i.useFloating({middleware:[i.shift(),i.offset({crossAxis:r,mainAxis:a})],placement:d,whileElementsMounted:i.autoUpdate}),g=b.floatingStyles,w=b.refs,x=t.useCallback((function(e){var t,i=e.target;c&&0===e.button&&((null===(t=null==p?void 0:p.current)||void 0===t?void 0:t.contains(i))||(e.preventDefault(),e.stopPropagation(),v(!1)))}),[c]);return t.useEffect((function(){return"undefined"!=typeof document&&document.addEventListener("mousedown",x),function(){"undefined"!=typeof document&&document.removeEventListener("mousedown",x)}}),[x]),{floatingStyles:g,refs:w,setVisible:v,visibility:m,visible:c,wrapperRef:p}};
1
+ "use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react"),i=require("@floating-ui/react");exports.useDropdown=function(n){var o=null!=n?n:{},s=o.floatingOptions,r=void 0===s?{}:s,u=o.offsetCrossAxis,a=void 0===u?0:u,l=o.offsetMainAxis,d=void 0===l?0:l,f=o.placement,c=void 0===f?"bottom-start":f,v=e.__read(t.useState(!1),2),m=v[0],p=v[1],b=m?"visible":"hidden",g=t.useRef(null),w=i.useFloating(e.__assign({middleware:[i.shift(),i.offset({crossAxis:a,mainAxis:d})],placement:c,whileElementsMounted:i.autoUpdate},r)),x=w.floatingStyles,y=w.refs,_=t.useCallback((function(e){var t,i=e.target;m&&0===e.button&&((null===(t=null==g?void 0:g.current)||void 0===t?void 0:t.contains(i))||(e.preventDefault(),e.stopPropagation(),p(!1)))}),[m]);return t.useEffect((function(){return"undefined"!=typeof document&&document.addEventListener("mousedown",_),function(){"undefined"!=typeof document&&document.removeEventListener("mousedown",_)}}),[_]),{floatingStyles:x,refs:y,setVisible:p,visibility:b,visible:m,wrapperRef:g}};