@zonos/amino 5.5.8 → 5.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=require("../../../tslib.es6-5672428a.js"),e=require("react/jsx-runtime"),l=require("react"),o=require("clsx"),t=require("../../../styles/constants/theme.js"),n=require("../../../utils/getTestId.js"),i=require("../../../style-inject.es-d4ddeae4.js");function _(a){return a&&a.__esModule?a:{default:a}}var r=_(o),u="Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq",p="Amino__FloatLabelInput-module__inputDecorator--U80eQ",m="Amino__FloatLabelInput-module__inputPrefix--ixjzG",d="Amino__FloatLabelInput-module__inputSuffix--uzCo-",s="Amino__FloatLabelInput-module__inputValuePrefix--55sKk",b="Amino__FloatLabelInput-module__aminoInput--obs5G",L="Amino__FloatLabelInput-module__floatingLabel--7yHkN";i.styleInject('.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq{align-items:center;background:var(--amino-input-background);border-radius:var(--amino-float-label-input-border-radius);display:flex;flex-direction:row;position:relative;width:100%}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputDecorator--U80eQ{align-items:center;background:#0000;display:flex;flex-basis:50px;font-size:var(--amino-font-size-s);font-weight:700;justify-content:center;line-height:var(--amino-font-size-s);padding:0 6px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputDecorator--U80eQ.Amino__FloatLabelInput-module__inputPrefix--ixjzG{border-bottom-left-radius:var(--amino-radius-6);border-top-left-radius:var(--amino-radius-6)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputDecorator--U80eQ.Amino__FloatLabelInput-module__inputSuffix--uzCo-{border-bottom-right-radius:var(--amino-radius-6);border-top-right-radius:var(--amino-radius-6);order:3}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{align-items:center;color:var(--amino-gray-800);display:flex;order:2;padding-left:8px;white-space:nowrap}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G{background:var(--amino-input-background);border:0;border-radius:var(--amino-float-label-input-border-radius);box-sizing:border-box;font-weight:500;height:var(--amino-float-label-input-height);order:2;outline:none;padding:0 var(--amino-space-16);position:relative;transition:var(--amino-transition);width:100%}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G :-internal-autofill-selected{border-radius:var(--amino-radius-6) 0 0 var(--amino-radius-6)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G :-internal-autofill-selected+label+div{background-color:#e8f0fe}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G::placeholder{opacity:0;transition:var(--amino-transition)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G:-moz-autofill,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G:-webkit-autofill{background-color:var(--amino-input-background);color:var(--amino-text-color)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN{display:block;max-height:0;order:1;pointer-events:none}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{color:var(--amino-gray-800);content:inherit;display:inline-block;filter:blur(0);font-size:var(--amino-font-size-base);line-height:var(--amino-font-size-base);margin-left:var(--amino-space-16);position:absolute;top:calc(50% - var(--amino-font-size-base)/2);transform-origin:left top;transition:var(--amino-transition);z-index:1}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN:after{border-radius:var(--amino-float-label-input-border-radius);bottom:0;content:"";left:0;position:absolute;right:0;top:0}.disabled .Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN{pointer-events:inherit}.disabled .Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN:after{cursor:not-allowed;z-index:1}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.no-border):has(input:focus){box-shadow:var(--amino-glow-blue)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.no-border).has-error,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.no-border).has-error:has(input:focus){box-shadow:var(--amino-glow-error)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-content .Amino__FloatLabelInput-module__aminoInput--obs5G::placeholder,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:focus-within .Amino__FloatLabelInput-module__aminoInput--obs5G::placeholder{opacity:var(--amino-opacity-disabled)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-content .Amino__FloatLabelInput-module__aminoInput--obs5G+.Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:focus-within .Amino__FloatLabelInput-module__aminoInput--obs5G+.Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:11px;transform:scale(.8)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-value-prefix .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-left:var(--amino-space-8)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.has-label)::placeholder{opacity:var(--amino-opacity-disabled)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding:var(--amino-space-16) var(--amino-space-4) var(--amino-space-8) var(--amino-space-16)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{align-items:flex-end;padding-bottom:11px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label.has-input-prefix .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-left:0}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label.has-input-prefix .Amino__FloatLabelInput-module__aminoInput--obs5G+.Amino__FloatLabelInput-module__floatingLabel--7yHkN span{margin-left:0}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-bottom:0;padding-top:13px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label.has-content .Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label:focus-within .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:2px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{margin-bottom:-1px;padding-bottom:0}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-top:20px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label.has-content .Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label:focus-within .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:6px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{padding-bottom:4px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-top:20px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label.has-content .Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label:focus-within .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:6px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{padding-bottom:10px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.xl.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-bottom:2px}');var I=function(a){switch(a){case"sm":return"".concat(t.theme.radius6);case"lg":return"".concat(t.theme.radius10);case"xl":return"".concat(t.theme.radius12);default:return"".concat(t.theme.radius8)}},c=l.forwardRef((function(o,t){var i=o.autoFocus,_=o.className,c=o.disabled,f=o.error,F=o.id,A=o.inputMode,h=o.label,y=o.noBorder,g=void 0!==y&&y,x=o.onChange,j=o.onKeyDown,v=o.pattern,H=o.placeholder,q=o.prefix,E=o.readOnly,W=o.required,k=o.size,N=void 0===k?"xl":k,w=o.suffix,G=o.tabIndex,z=o.type,P=o.value,K=o.valuePrefix,D=a.__rest(o,["autoFocus","className","disabled","error","id","inputMode","label","noBorder","onChange","onKeyDown","pattern","placeholder","prefix","readOnly","required","size","suffix","tabIndex","type","value","valuePrefix"]),V=l.useId(),C=l.useMemo((function(){return n.getTestId({componentName:"input",name:h})}),[h]),M=!!P||!!K,Q=F||V;return e.jsxs("label",{className:r.default(u,N,g&&"no-border",f&&"has-error",h&&"has-label",M&&"has-content",q&&"has-input-prefix",K&&"has-value-prefix",_),htmlFor:Q,style:{"--amino-float-label-input-border-radius":I(N),"--amino-float-label-input-height":"calc(var(--amino-size-".concat(N,") - 2px)")},children:[q&&e.jsx("div",{className:r.default(p,m),children:q}),K&&e.jsx("div",{className:s,children:K}),e.jsx("input",a.__assign({ref:t,"aria-label":h,autoFocus:i,className:r.default(b),"data-testid":C,disabled:c,id:Q,inputMode:A,onChange:x,onKeyDown:j,pattern:v,placeholder:H,readOnly:E,required:W,tabIndex:G,type:z||"text",value:P||""},D)),e.jsx("div",{className:L,children:e.jsx("span",{children:h})}),w&&e.jsx("div",{className:r.default(p,d),children:w})]})}));exports.FloatLabelInput=c,exports.getFloatLabelRadius=I;
|
|
1
|
+
"use strict";var a=require("../../../tslib.es6-5672428a.js"),e=require("react/jsx-runtime"),l=require("react"),o=require("clsx"),t=require("../../../styles/constants/theme.js"),n=require("../../../utils/getTestId.js"),i=require("../../../style-inject.es-d4ddeae4.js");function _(a){return a&&a.__esModule?a:{default:a}}var r=_(o),u="Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq",p="Amino__FloatLabelInput-module__inputDecorator--U80eQ",m="Amino__FloatLabelInput-module__inputPrefix--ixjzG",d="Amino__FloatLabelInput-module__inputSuffix--uzCo-",s="Amino__FloatLabelInput-module__inputValuePrefix--55sKk",b="Amino__FloatLabelInput-module__aminoInput--obs5G",L="Amino__FloatLabelInput-module__floatingLabel--7yHkN";i.styleInject('.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq{align-items:center;background:var(--amino-input-background);border-radius:var(--amino-float-label-input-border-radius);display:flex;flex-direction:row;position:relative;width:100%}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputDecorator--U80eQ{align-items:center;background:#0000;display:flex;flex-basis:50px;font-size:var(--amino-font-size-s);font-weight:700;justify-content:center;line-height:var(--amino-font-size-s);padding:0 6px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputDecorator--U80eQ.Amino__FloatLabelInput-module__inputPrefix--ixjzG{border-bottom-left-radius:var(--amino-radius-6);border-top-left-radius:var(--amino-radius-6)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputDecorator--U80eQ.Amino__FloatLabelInput-module__inputSuffix--uzCo-{border-bottom-right-radius:var(--amino-radius-6);border-top-right-radius:var(--amino-radius-6);order:3}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{align-items:center;color:var(--amino-gray-800);display:flex;order:2;padding-left:8px;white-space:nowrap}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G{background:var(--amino-input-background);border:0;border-radius:var(--amino-float-label-input-border-radius);box-sizing:border-box;font-weight:500;height:var(--amino-float-label-input-height);order:2;outline:none;padding:0 var(--amino-space-16);position:relative;transition:var(--amino-transition);width:100%}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G :-internal-autofill-selected{border-radius:var(--amino-radius-6) 0 0 var(--amino-radius-6)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G :-internal-autofill-selected+label+div{background-color:#e8f0fe}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G::placeholder{opacity:0;transition:var(--amino-transition)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G:-moz-autofill,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__aminoInput--obs5G:-webkit-autofill{background-color:var(--amino-input-background);color:var(--amino-text-color)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN{display:block;max-height:0;order:1;pointer-events:none}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{color:var(--amino-gray-800);content:inherit;display:inline-block;filter:blur(0);font-size:var(--amino-font-size-base);line-height:var(--amino-font-size-base);margin-left:var(--amino-space-16);position:absolute;top:calc(50% - var(--amino-font-size-base)/2);transform-origin:left top;transition:var(--amino-transition);z-index:1}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN:after{border-radius:var(--amino-float-label-input-border-radius);bottom:0;content:"";left:0;position:absolute;right:0;top:0}.disabled .Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN{pointer-events:inherit}.disabled .Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq .Amino__FloatLabelInput-module__floatingLabel--7yHkN:after{cursor:not-allowed;z-index:1}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.no-border):has(input:focus){box-shadow:var(--amino-glow-blue)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.no-border).has-error,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.no-border).has-error:has(input:focus){box-shadow:var(--amino-glow-error)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-content .Amino__FloatLabelInput-module__aminoInput--obs5G::placeholder,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:focus-within .Amino__FloatLabelInput-module__aminoInput--obs5G::placeholder{opacity:var(--amino-opacity-disabled)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-content .Amino__FloatLabelInput-module__aminoInput--obs5G~.Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:focus-within .Amino__FloatLabelInput-module__aminoInput--obs5G~.Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:11px;transform:scale(.8)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-value-prefix .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-left:var(--amino-space-8)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq:not(.has-label)::placeholder{opacity:var(--amino-opacity-disabled)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding:var(--amino-space-16) var(--amino-space-4) var(--amino-space-8) var(--amino-space-16)}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{align-items:flex-end;padding-bottom:11px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label.has-input-prefix .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-left:0}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.has-label.has-input-prefix .Amino__FloatLabelInput-module__aminoInput--obs5G~.Amino__FloatLabelInput-module__floatingLabel--7yHkN span{margin-left:0}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-bottom:0;padding-top:13px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label.has-content .Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label:focus-within .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:2px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.sm.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{margin-bottom:-1px;padding-bottom:0}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-top:20px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label.has-content .Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label:focus-within .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:6px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.md.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{padding-bottom:4px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-top:20px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label.has-content .Amino__FloatLabelInput-module__floatingLabel--7yHkN span,.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label:focus-within .Amino__FloatLabelInput-module__floatingLabel--7yHkN span{top:6px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.lg.has-label .Amino__FloatLabelInput-module__inputValuePrefix--55sKk{padding-bottom:10px}.Amino__FloatLabelInput-module__styledLabelWrapper--EmjHq.xl.has-label .Amino__FloatLabelInput-module__aminoInput--obs5G{padding-bottom:2px}');var I=function(a){switch(a){case"sm":return"".concat(t.theme.radius6);case"lg":return"".concat(t.theme.radius10);case"xl":return"".concat(t.theme.radius12);default:return"".concat(t.theme.radius8)}},c=l.forwardRef((function(o,t){var i=o.autoFocus,_=o.className,c=o.disabled,f=o.error,F=o.id,A=o.inputMode,h=o.label,y=o.noBorder,g=void 0!==y&&y,x=o.onChange,j=o.onKeyDown,v=o.pattern,H=o.placeholder,q=o.prefix,E=o.readOnly,W=o.required,k=o.size,N=void 0===k?"xl":k,w=o.suffix,G=o.tabIndex,z=o.type,P=o.value,K=o.valuePrefix,D=a.__rest(o,["autoFocus","className","disabled","error","id","inputMode","label","noBorder","onChange","onKeyDown","pattern","placeholder","prefix","readOnly","required","size","suffix","tabIndex","type","value","valuePrefix"]),V=l.useId(),C=l.useMemo((function(){return n.getTestId({componentName:"input",name:h})}),[h]),M=!!P||!!K,Q=F||V;return e.jsxs("label",{className:r.default(u,N,g&&"no-border",f&&"has-error",h&&"has-label",M&&"has-content",q&&"has-input-prefix",K&&"has-value-prefix",_),htmlFor:Q,style:{"--amino-float-label-input-border-radius":I(N),"--amino-float-label-input-height":"calc(var(--amino-size-".concat(N,") - 2px)")},children:[q&&e.jsx("div",{className:r.default(p,m),children:q}),K&&e.jsx("div",{className:s,children:K}),e.jsx("input",a.__assign({ref:t,"aria-label":h,autoFocus:i,className:r.default(b),"data-testid":C,disabled:c,id:Q,inputMode:A,onChange:x,onKeyDown:j,pattern:v,placeholder:H,readOnly:E,required:W,tabIndex:G,type:z||"text",value:P||""},D)),e.jsx("div",{className:L,children:e.jsx("span",{children:h})}),w&&e.jsx("div",{className:r.default(p,d),children:w})]})}));exports.FloatLabelInput=c,exports.getFloatLabelRadius=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-5672428a.js"),t=require("react/jsx-runtime"),l=require("react"),o=require("react-intersection-observer"),n=require("react-select"),i=require("clsx"),a=require("../checkbox/Checkbox.js"),c=require("../help-text/HelpText.js"),s=require("../../icons/CheckCircleIcon.js"),r=require("../../icons/DoubleChevronIcon.js"),d=require("../../icons/RemoveCircleIcon.js"),_=require("../../icons/RemoveIcon.js"),u=require("../../styles/constants/theme.js"),m=require("../../utils/getTestId.js"),S=require("../../style-inject.es-d4ddeae4.js");function p(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../text/Text.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js");var y=p(n),h=p(i),g={iconWrapper:"Amino__StyledReactSelect-module__iconWrapper--o6af4",styledFloatedLabel:"Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB",hasIcon:"Amino__StyledReactSelect-module__hasIcon--ua8Qm",hasLabel:"Amino__StyledReactSelect-module__hasLabel--2uysz",hasValue:"Amino__StyledReactSelect-module__hasValue--QzRR6",isFocused:"Amino__StyledReactSelect-module__isFocused--cvHNw",sm:"Amino__StyledReactSelect-module__sm--uRxwS",md:"Amino__StyledReactSelect-module__md--05qsU",lg:"Amino__StyledReactSelect-module__lg--iGesU",xl:"Amino__StyledReactSelect-module__xl--4TfG5",isDisabled:"Amino__StyledReactSelect-module__isDisabled--WwkVj",styledSelectWrapper:"Amino__StyledReactSelect-module__styledSelectWrapper--s0t-S",reactSelectControl:"Amino__StyledReactSelect-module__reactSelectControl--0sbFa",hasError:"Amino__StyledReactSelect-module__hasError--DJ10C",strongLabel:"Amino__StyledReactSelect-module__strongLabel--iF71N",checkboxOptionIconWrapper:"Amino__StyledReactSelect-module__checkboxOptionIconWrapper--Q91uF",styledSelectOptionWrapper:"Amino__StyledReactSelect-module__styledSelectOptionWrapper--RNcU9",selectedSingleOptionWrapper:"Amino__StyledReactSelect-module__selectedSingleOptionWrapper--0Yd8x"};S.styleInject(".Amino__StyledReactSelect-module__iconWrapper--o6af4{align-items:center;color:var(--amino-gray-700);display:flex;height:24px;justify-content:space-evenly;margin-left:var(--amino-space-8);margin-right:-2px;width:24px}.Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{font-size:var(--amino-font-size-base);left:14px;line-height:var(--amino-font-size-base);position:absolute;top:calc(50% - var(--amino-font-size-base)/2);transform-origin:left top;transition:var(--amino-transition)}.Amino__StyledReactSelect-module__hasIcon--ua8Qm .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{left:44px}.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{align-self:flex-end}.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:11px;transform:scale(.8)}.Amino__StyledReactSelect-module__sm--uRxwS.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{margin-bottom:-6px}.Amino__StyledReactSelect-module__sm--uRxwS.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__sm--uRxwS.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:2px}.Amino__StyledReactSelect-module__md--05qsU.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{margin-bottom:-2px}.Amino__StyledReactSelect-module__md--05qsU.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__md--05qsU.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:6px}.Amino__StyledReactSelect-module__lg--iGesU.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__lg--iGesU.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:10px}.Amino__StyledReactSelect-module__xl--4TfG5.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{margin-bottom:3px}.Amino__StyledReactSelect-module__xl--4TfG5.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__xl--4TfG5.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:11px}.Amino__StyledReactSelect-module__isDisabled--WwkVj{opacity:var(--amino-opacity-disabled)}.Amino__StyledReactSelect-module__styledSelectWrapper--s0t-S .Amino__StyledReactSelect-module__reactSelectControl--0sbFa+div{z-index:20}.Amino__StyledReactSelect-module__styledSelectWrapper--s0t-S.Amino__StyledReactSelect-module__hasError--DJ10C .Amino__StyledReactSelect-module__reactSelectControl--0sbFa{box-shadow:var(--amino-shadow-select-error)!important}.Amino__StyledReactSelect-module__strongLabel--iF71N{font-weight:600}.Amino__StyledReactSelect-module__checkboxOptionIconWrapper--Q91uF{align-items:center;color:var(--amino-styled-react-select-color);display:flex}.Amino__StyledReactSelect-module__checkboxOptionIconWrapper--Q91uF svg{color:var(--amino-gray-1000);margin-right:4px}.Amino__StyledReactSelect-module__styledSelectOptionWrapper--RNcU9:not(.Amino__StyledReactSelect-module__isDisabled--WwkVj).Amino__StyledReactSelect-module__isFocused--cvHNw,.Amino__StyledReactSelect-module__styledSelectOptionWrapper--RNcU9:not(.Amino__StyledReactSelect-module__isDisabled--WwkVj):hover{background-color:var(--amino-gray-100)!important}.Amino__StyledReactSelect-module__selectedSingleOptionWrapper--0Yd8x{align-items:center;display:flex;justify-content:space-between}");var R=function(e){switch(e){case"sm":return"".concat(u.theme.radius6);case"lg":case"xl":return"".concat(u.theme.radius10);default:return"".concat(u.theme.radius8)}},b=function(l){return t.jsx(n.components.ClearIndicator,e.__assign({},l,{children:t.jsx(d.RemoveCircleIcon,{size:24})}))},x=function(l){return t.jsx(n.components.DropdownIndicator,e.__assign({},l,{children:t.jsx(r.DoubleChevronIcon,{size:24})}))},f=function(l){var o=l.children,n=l.className,i=l.getStyles,a=l.hasValue,c=l.innerProps,s=l.innerRef,r=l.isDisabled,d=l.isFocused,_=l.selectProps,u=_.icon,m=_.label,S=_.size,p=_.value;return t.jsxs("div",e.__assign({ref:s,className:h.default([n,a&&g.hasValue,u&&g.hasIcon,d&&g.isFocused,r&&g.isDisabled,m||Array.isArray(p)&&p.length>1?g.hasLabel:"",S&&g[S],g.reactSelectControl,"react-select-control"]),style:i("control",l)},c,{children:[u&&t.jsx("div",{className:g.iconWrapper,children:u}),t.jsxs("div",{className:g.styledFloatedLabel,children:[m," ",Array.isArray(p)&&p.length>1&&t.jsxs("strong",{className:g.strongLabel,children:["(",p.length," selected)"]})]}),o]}))},A=function(e){var l=e.children,o=e.color,n=e.icon;return t.jsxs("div",{className:g.checkboxOptionIconWrapper,style:{"--amino-styled-react-select-color":o||"inherit"},children:[n,l]})},v=function(l){var o=l.children,i=e.__rest(l,["children"]);return t.jsx(n.components.MultiValueLabel,e.__assign({},i,{children:t.jsx(A,{icon:i.data.icon,children:o})}))},j=function(l){var o=l.innerProps;return t.jsx("div",e.__assign({},o,{role:"button",children:t.jsx(_.RemoveIcon,{size:14})}))},z=function(l){var n=l.children,i=l.className,c=l.data,r=l.getStyles,d=l.innerProps,_=l.innerRef,u=l.isDisabled,m=l.isFocused,S=l.isSelected,p=l.selectProps,y=o.useInView({fallbackInView:!0,triggerOnce:!0}),h=y.inView,R=y.ref,b=p,x=b.customOption,f=b.hasGroups,v=r("option",l),j=v.color,z=e.__rest(v,["color"]);f&&(z.paddingLeft=48);return t.jsx("div",e.__assign({ref:_},d,{children:t.jsx("div",{className:[i,g.styledSelectOptionWrapper,m&&g.isFocused,u&&g.isDisabled].join(" "),style:z,children:p.isMulti?t.jsx(a.Checkbox,{checked:S,disabled:u,icon:c.icon,label:c.label,labelDescription:c.labelDescription,onChange:function(){}}):x?x(c.value):t.jsxs("div",{ref:R,className:g.selectedSingleOptionWrapper,children:[h&&t.jsx(A,{color:j,icon:c.icon,children:n}),S&&t.jsx(s.CheckCircleIcon,{color:"blue600",size:24})]})})}))},L={clearIndicator:function(t){return e.__assign(e.__assign({},t),{color:u.theme.gray700,paddingLeft:14,paddingRight:4})},control:function(t,l){var o=l.selectProps.size;return e.__assign(e.__assign({},t),{backgroundColor:u.theme.raisedSurfaceColor,borderColor:"unset",borderRadius:R(o),borderWidth:0,boxShadow:l.isFocused?"".concat(u.theme.shadowSelectActive):"".concat(u.theme.shadowSelectBase),color:u.theme.gray800,cursor:"pointer",flexWrap:"inherit",height:"var(--amino-size-".concat(o,")"),minHeight:"var(--amino-size-".concat(o,")")})},dropdownIndicator:function(t){return e.__assign(e.__assign({},t),{color:u.theme.gray900,paddingLeft:4,paddingRight:10})},group:function(t){return e.__assign(e.__assign({},t),{paddingBottom:0,paddingTop:0})},indicatorSeparator:function(t){return e.__assign(e.__assign({},t),{width:0})},input:function(t){return e.__assign(e.__assign({},t),{color:u.theme.textColor,opacity:.8})},menu:function(t){return e.__assign(e.__assign({},t),{background:u.theme.surfaceColor,borderRadius:12,boxShadow:u.theme.v3ShadowLarge,marginTop:4})},menuList:function(t){return e.__assign(e.__assign({},t),{paddingLeft:8,paddingRight:8,paddingTop:8})},multiValue:function(t){return e.__assign(e.__assign({},t),{alignItems:"center",background:u.theme.gray100,borderRadius:u.theme.radius4,fontWeight:600,maxHeight:20,minWidth:"inherit",paddingRight:2})},multiValueLabel:function(t){return e.__assign(e.__assign({},t),{color:u.theme.textColor})},option:function(t,l){return e.__assign(e.__assign({},t),{backgroundColor:"inherit",borderRadius:"8px",color:l.isSelected?u.theme.blue600:u.theme.textColor,cursor:"pointer",fontWeight:l.isSelected?500:400,paddingBottom:7,paddingLeft:8,paddingRight:12,paddingTop:7})},placeholder:function(t){return e.__assign(e.__assign({},t),{".has-label.is-focused &":{opacity:1},opacity:0})},singleValue:function(t){return e.__assign(e.__assign({},t),{color:u.theme.textColor,fontWeight:500})},valueContainer:function(t){return e.__assign(e.__assign({},t),{".has-icon &":{paddingLeft:0},flexWrap:"nowrap",padding:"unset",paddingLeft:12})}};exports.CheckboxOptionComponent=z,exports.StyledReactSelect=function(o){var n=o.closeOnOutsideScroll,i=void 0!==n&&n,a=o.components,s=o.customOption,r=o.error,d=o.hasGroups,_=o.helpText,u=o.icon,S=o.label,p=o.menuPosition,R=void 0===p?"fixed":p,A=o.placeholder,F=o.size,w=void 0===F?"xl":F,C=o.style,D=e.__rest(o,["closeOnOutsideScroll","components","customOption","error","hasGroups","helpText","icon","label","menuPosition","placeholder","size","style"]),W={customOption:s,hasGroups:d,icon:u,label:S,size:w},I=l.useMemo((function(){return m.getTestId({componentName:"select",name:S})}),[S]),U=l.useRef(null),O=l.useMemo((function(){return!!i&&function(e){var t,l;return!(e.target instanceof HTMLElement)||!(null===(l=null===(t=U.current)||void 0===t?void 0:t.menuListRef)||void 0===l?void 0:l.isEqualNode(e.target))}}),[i]);return t.jsxs("div",{className:h.default(g.styledSelectWrapper,r&&g.hasError),"data-testid":I,children:[t.jsx(y.default,e.__assign({ref:U,closeMenuOnScroll:O,components:e.__assign({ClearIndicator:b,Control:f,DropdownIndicator:x,MultiValueLabel:v,MultiValueRemove:j,Option:z},a),menuPosition:R,placeholder:A||"",styles:e.__assign(e.__assign({},C),L)},D,W)),t.jsx(c.HelpText,{error:r,helpText:_})]})};
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-5672428a.js"),t=require("react/jsx-runtime"),l=require("react"),o=require("react-intersection-observer"),i=require("react-select"),n=require("clsx"),a=require("../checkbox/Checkbox.js"),c=require("../help-text/HelpText.js"),s=require("../../icons/CheckCircleIcon.js"),r=require("../../icons/DoubleChevronIcon.js"),d=require("../../icons/RemoveCircleIcon.js"),_=require("../../icons/RemoveIcon.js"),u=require("../../styles/constants/theme.js"),m=require("../../utils/getTestId.js"),S=require("../../style-inject.es-d4ddeae4.js");function p(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../text/Text.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js");var y=p(i),g=p(n),h={iconWrapper:"Amino__StyledReactSelect-module__iconWrapper--o6af4",styledFloatedLabel:"Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB",hasIcon:"Amino__StyledReactSelect-module__hasIcon--ua8Qm",hasLabel:"Amino__StyledReactSelect-module__hasLabel--2uysz",hasValue:"Amino__StyledReactSelect-module__hasValue--QzRR6",isFocused:"Amino__StyledReactSelect-module__isFocused--cvHNw",sm:"Amino__StyledReactSelect-module__sm--uRxwS",md:"Amino__StyledReactSelect-module__md--05qsU",lg:"Amino__StyledReactSelect-module__lg--iGesU",xl:"Amino__StyledReactSelect-module__xl--4TfG5",isDisabled:"Amino__StyledReactSelect-module__isDisabled--WwkVj",styledSelectWrapper:"Amino__StyledReactSelect-module__styledSelectWrapper--s0t-S",reactSelectControl:"Amino__StyledReactSelect-module__reactSelectControl--0sbFa",hasError:"Amino__StyledReactSelect-module__hasError--DJ10C",strongLabel:"Amino__StyledReactSelect-module__strongLabel--iF71N",checkboxOptionIconWrapper:"Amino__StyledReactSelect-module__checkboxOptionIconWrapper--Q91uF",styledSelectOptionWrapper:"Amino__StyledReactSelect-module__styledSelectOptionWrapper--RNcU9",selectedSingleOptionWrapper:"Amino__StyledReactSelect-module__selectedSingleOptionWrapper--0Yd8x"};S.styleInject(".Amino__StyledReactSelect-module__iconWrapper--o6af4{align-items:center;color:var(--amino-gray-700);display:flex;height:24px;justify-content:space-evenly;margin-left:var(--amino-space-8);margin-right:-2px;width:24px}.Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{font-size:var(--amino-font-size-base);left:14px;line-height:var(--amino-font-size-base);position:absolute;top:calc(50% - var(--amino-font-size-base)/2);transform-origin:left top;transition:var(--amino-transition)}.Amino__StyledReactSelect-module__hasIcon--ua8Qm .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{left:44px}.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{align-self:flex-end}.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:11px;transform:scale(.8)}.Amino__StyledReactSelect-module__sm--uRxwS.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{margin-bottom:-6px}.Amino__StyledReactSelect-module__sm--uRxwS.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__sm--uRxwS.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:2px}.Amino__StyledReactSelect-module__md--05qsU.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{margin-bottom:-2px}.Amino__StyledReactSelect-module__md--05qsU.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__md--05qsU.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:6px}.Amino__StyledReactSelect-module__lg--iGesU.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__lg--iGesU.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:10px}.Amino__StyledReactSelect-module__xl--4TfG5.Amino__StyledReactSelect-module__hasLabel--2uysz .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB+div{margin-bottom:3px}.Amino__StyledReactSelect-module__xl--4TfG5.Amino__StyledReactSelect-module__hasValue--QzRR6 .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB,.Amino__StyledReactSelect-module__xl--4TfG5.Amino__StyledReactSelect-module__isFocused--cvHNw .Amino__StyledReactSelect-module__styledFloatedLabel--zUtDB{top:11px}.Amino__StyledReactSelect-module__isDisabled--WwkVj{opacity:var(--amino-opacity-disabled)}.Amino__StyledReactSelect-module__styledSelectWrapper--s0t-S .Amino__StyledReactSelect-module__reactSelectControl--0sbFa+div{z-index:20}.Amino__StyledReactSelect-module__styledSelectWrapper--s0t-S.Amino__StyledReactSelect-module__hasError--DJ10C .Amino__StyledReactSelect-module__reactSelectControl--0sbFa{box-shadow:var(--amino-shadow-select-error)!important}.Amino__StyledReactSelect-module__strongLabel--iF71N{font-weight:600}.Amino__StyledReactSelect-module__checkboxOptionIconWrapper--Q91uF{align-items:center;color:var(--amino-styled-react-select-color);display:flex}.Amino__StyledReactSelect-module__checkboxOptionIconWrapper--Q91uF svg{color:var(--amino-gray-1000);margin-right:4px}.Amino__StyledReactSelect-module__styledSelectOptionWrapper--RNcU9:not(.Amino__StyledReactSelect-module__isDisabled--WwkVj).Amino__StyledReactSelect-module__isFocused--cvHNw,.Amino__StyledReactSelect-module__styledSelectOptionWrapper--RNcU9:not(.Amino__StyledReactSelect-module__isDisabled--WwkVj):hover{background-color:var(--amino-gray-100)!important}.Amino__StyledReactSelect-module__selectedSingleOptionWrapper--0Yd8x{align-items:center;display:flex;justify-content:space-between}");var v=function(e){switch(e){case"sm":return"".concat(u.theme.radius6);case"lg":case"xl":return"".concat(u.theme.radius10);default:return"".concat(u.theme.radius8)}},R=function(l){return t.jsx(i.components.ClearIndicator,e.__assign({},l,{children:t.jsx(d.RemoveCircleIcon,{size:24})}))},b=function(l){return t.jsx(i.components.DropdownIndicator,e.__assign({},l,{children:t.jsx(r.DoubleChevronIcon,{size:24})}))},x=function(l){var o=l.children,i=l.className,n=l.getStyles,a=l.hasValue,c=l.innerProps,s=l.innerRef,r=l.isDisabled,d=l.isFocused,_=l.selectProps,u=_.icon,m=_.label,S=_.size,p=_.value;return t.jsxs("div",e.__assign({ref:s,className:g.default([i,a&&h.hasValue,u&&h.hasIcon,d&&h.isFocused,r&&h.isDisabled,m||Array.isArray(p)&&p.length>1?h.hasLabel:"",S&&h[S],h.reactSelectControl,"react-select-control"]),style:n("control",l)},c,{children:[u&&t.jsx("div",{className:h.iconWrapper,children:u}),t.jsxs("div",{className:h.styledFloatedLabel,children:[m," ",Array.isArray(p)&&p.length>1&&t.jsxs("strong",{className:h.strongLabel,children:["(",p.length," selected)"]})]}),o]}))},f=function(e){var l=e.children,o=e.color,i=e.icon;return t.jsxs("div",{className:h.checkboxOptionIconWrapper,style:{"--amino-styled-react-select-color":o||"inherit"},children:[i,l]})},A=function(l){var o=l.children,n=e.__rest(l,["children"]);return t.jsx(i.components.MultiValueLabel,e.__assign({},n,{children:t.jsx(f,{icon:n.data.icon,children:o})}))},j=function(l){var o=l.innerProps;return t.jsx("div",e.__assign({},o,{role:"button",children:t.jsx(_.RemoveIcon,{size:14})}))},L=function(l){var i=l.children,n=l.className,c=l.data,r=l.getStyles,d=l.innerProps,_=l.innerRef,u=l.isDisabled,m=l.isFocused,S=l.isSelected,p=l.selectProps,y=o.useInView({fallbackInView:!0,triggerOnce:!0}),g=y.inView,v=y.ref,R=p,b=R.customOption,x=R.hasGroups,A=r("option",l),j=A.color,L=e.__rest(A,["color"]);x&&(L.paddingLeft=48);return t.jsx("div",e.__assign({ref:_},d,{children:t.jsx("div",{className:[n,h.styledSelectOptionWrapper,m&&h.isFocused,u&&h.isDisabled].join(" "),style:L,children:p.isMulti?t.jsx(a.Checkbox,{checked:S,disabled:u,icon:c.icon,label:c.label,labelDescription:c.labelDescription,onChange:function(){}}):b?b(c.value):t.jsxs("div",{ref:v,className:h.selectedSingleOptionWrapper,children:[g&&t.jsx(f,{color:j,icon:c.icon,children:i}),S&&t.jsx(s.CheckCircleIcon,{color:"blue600",size:24})]})})}))};exports.CheckboxOptionComponent=L,exports.StyledReactSelect=function(o){var i=o.closeOnOutsideScroll,n=void 0!==i&&i,a=o.components,s=o.customOption,r=o.error,d=o.hasGroups,_=o.helpText,S=o.icon,p=o.label,f=o.menuPosition,z=void 0===f?"fixed":f,F=o.placeholder,w=o.size,C=void 0===w?"xl":w,D=o.style,W=e.__rest(o,["closeOnOutsideScroll","components","customOption","error","hasGroups","helpText","icon","label","menuPosition","placeholder","size","style"]),I={customOption:s,hasGroups:d,icon:S,label:p,size:C},U=l.useMemo((function(){return m.getTestId({componentName:"select",name:p})}),[p]),O=l.useRef(null),q=l.useMemo((function(){return!!n&&function(e){var t,l;return!(e.target instanceof HTMLElement)||!(null===(l=null===(t=O.current)||void 0===t?void 0:t.menuListRef)||void 0===l?void 0:l.isEqualNode(e.target))}}),[n]),V=W.styles,k=e.__rest(W,["styles"]),N=function(t){return{clearIndicator:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{color:u.theme.gray700,paddingLeft:14,paddingRight:4}),null===(i=null==t?void 0:t.clearIndicator)||void 0===i?void 0:i.call(t,l,o))},control:function(l,o){var i,n=o.selectProps.size;return e.__assign(e.__assign(e.__assign({},l),{backgroundColor:u.theme.raisedSurfaceColor,borderColor:"unset",borderRadius:v(n),borderWidth:0,boxShadow:o.isFocused?"".concat(u.theme.shadowSelectActive):"".concat(u.theme.shadowSelectBase),color:u.theme.gray800,cursor:"pointer",flexWrap:"inherit",height:"var(--amino-size-".concat(n,")"),minHeight:"var(--amino-size-".concat(n,")")}),null===(i=null==t?void 0:t.control)||void 0===i?void 0:i.call(t,l,o))},dropdownIndicator:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{color:u.theme.gray900,paddingLeft:4,paddingRight:10}),null===(i=null==t?void 0:t.dropdownIndicator)||void 0===i?void 0:i.call(t,l,o))},group:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{paddingBottom:0,paddingTop:0}),null===(i=null==t?void 0:t.group)||void 0===i?void 0:i.call(t,l,o))},indicatorSeparator:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{width:0}),null===(i=null==t?void 0:t.indicatorSeparator)||void 0===i?void 0:i.call(t,l,o))},input:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{color:u.theme.textColor,opacity:.8}),null===(i=null==t?void 0:t.input)||void 0===i?void 0:i.call(t,l,o))},menu:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{background:u.theme.surfaceColor,borderRadius:12,boxShadow:u.theme.v3ShadowLarge,marginTop:4}),null===(i=null==t?void 0:t.menu)||void 0===i?void 0:i.call(t,l,o))},menuList:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{paddingLeft:8,paddingRight:8,paddingTop:8}),null===(i=null==t?void 0:t.menuList)||void 0===i?void 0:i.call(t,l,o))},multiValue:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{alignItems:"center",background:u.theme.gray100,borderRadius:u.theme.radius4,fontWeight:600,maxHeight:20,minWidth:"inherit",paddingRight:2}),null===(i=null==t?void 0:t.multiValue)||void 0===i?void 0:i.call(t,l,o))},multiValueLabel:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{color:u.theme.textColor}),null===(i=null==t?void 0:t.multiValueLabel)||void 0===i?void 0:i.call(t,l,o))},option:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{backgroundColor:"inherit",borderRadius:"8px",color:o.isSelected?u.theme.blue600:u.theme.textColor,cursor:"pointer",fontWeight:o.isSelected?500:400,paddingBottom:7,paddingLeft:8,paddingRight:12,paddingTop:7}),null===(i=null==t?void 0:t.option)||void 0===i?void 0:i.call(t,l,o))},placeholder:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{".has-label.is-focused &":{opacity:1},opacity:0}),null===(i=null==t?void 0:t.placeholder)||void 0===i?void 0:i.call(t,l,o))},singleValue:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{color:u.theme.textColor,fontWeight:500}),null===(i=null==t?void 0:t.singleValue)||void 0===i?void 0:i.call(t,l,o))},valueContainer:function(l,o){var i;return e.__assign(e.__assign(e.__assign({},l),{".has-icon &":{paddingLeft:0},flexWrap:"nowrap",padding:"unset",paddingLeft:12}),null===(i=null==t?void 0:t.valueContainer)||void 0===i?void 0:i.call(t,l,o))}}}(V);return t.jsxs("div",{className:g.default(h.styledSelectWrapper,r&&h.hasError),"data-testid":U,children:[t.jsx(y.default,e.__assign({ref:O,closeMenuOnScroll:q,components:e.__assign({ClearIndicator:R,Control:x,DropdownIndicator:b,MultiValueLabel:A,MultiValueRemove:j,Option:L},a),menuPosition:z,placeholder:F||"",styles:e.__assign(e.__assign({},D),N)},k,I)),t.jsx(c.HelpText,{error:r,helpText:_})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),l=require("react"),o=require("clsx"),i=require("../checkbox/Checkbox.js"),t=require("../table/TableRowCollapse.js"),r=require("../tooltip/Tooltip.js"),n=require("../../style-inject.es-d4ddeae4.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../../tslib.es6-5672428a.js"),require("framer-motion"),require("../help-text/HelpText.js"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js"),require("../button/Button.js"),require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../collapse/Collapse.js"),require("@mui/material/Collapse"),require("../table/TableCell.js"),require("../table/TableRow.js"),require("../../icons/ChevronUpIcon.js"),require("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var a=d(l),m=d(o),s="Amino_SimpleTableRow-module__styledTr--7wqmD",u="Amino_SimpleTableRow-module__bordered--F4nVy",c="Amino_SimpleTableRow-module__collapsed--1b0eu",_="Amino_SimpleTableRow-module__withHover--lsi66",p="Amino_SimpleTableRow-module__clickable--cwD9E",
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("react"),o=require("clsx"),i=require("../checkbox/Checkbox.js"),t=require("../table/TableRowCollapse.js"),r=require("../tooltip/Tooltip.js"),n=require("../../style-inject.es-d4ddeae4.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../../tslib.es6-5672428a.js"),require("framer-motion"),require("../help-text/HelpText.js"),require("../text/Text.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js"),require("../button/Button.js"),require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../collapse/Collapse.js"),require("@mui/material/Collapse"),require("../table/TableCell.js"),require("../table/TableRow.js"),require("../../icons/ChevronUpIcon.js"),require("@mui/material/styles"),require("@mui/material/Tooltip"),require("../flex/Flex.js");var a=d(l),m=d(o),s="Amino_SimpleTableRow-module__styledTr--7wqmD",u="Amino_SimpleTableRow-module__bordered--F4nVy",c="Amino_SimpleTableRow-module__collapsed--1b0eu",_="Amino_SimpleTableRow-module__withHover--lsi66",p="Amino_SimpleTableRow-module__clickable--cwD9E",w="Amino_SimpleTableRow-module__noPadding--r2KPc",b="Amino_SimpleTableRow-module__allowTextWrap--jGjMo",h="Amino_SimpleTableRow-module__shouldTruncate--DUSAV",T="Amino_SimpleTableRow-module__hasContent--wJBWQ";n.styleInject(".Amino_SimpleTableRow-module__styledTr--7wqmD{height:48px}.Amino_SimpleTableRow-module__styledTr--7wqmD.Amino_SimpleTableRow-module__bordered--F4nVy:nth-last-child(2).Amino_SimpleTableRow-module__collapsed--1b0eu td:first-child{border-bottom-left-radius:12px}.Amino_SimpleTableRow-module__styledTr--7wqmD.Amino_SimpleTableRow-module__bordered--F4nVy:nth-last-child(2).Amino_SimpleTableRow-module__collapsed--1b0eu td:last-child{border-bottom-right-radius:12px}.Amino_SimpleTableRow-module__styledTr--7wqmD.Amino_SimpleTableRow-module__withHover--lsi66:hover{background-color:var(--amino-hover-color)}.Amino_SimpleTableRow-module__styledTr--7wqmD.Amino_SimpleTableRow-module__clickable--cwD9E{cursor:pointer}.Amino_SimpleTableRow-module__styledTr--7wqmD:not(:hover) .row-hover-show{visibility:collapse}.Amino_SimpleTableRow-module__styledTr--7wqmD>td{border-bottom:var(--amino-border-subtle);padding:0}.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child{display:block;height:100%;padding:12px;white-space:nowrap;width:100%}.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child.tooltip-wrapper{padding:0}.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child.tooltip-wrapper>a,.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child.tooltip-wrapper>span{display:block;height:100%;overflow:hidden;padding:12px;text-overflow:ellipsis;width:100%}.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child.Amino_SimpleTableRow-module__noPadding--r2KPc{padding:0}.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child.Amino_SimpleTableRow-module__allowTextWrap--jGjMo{white-space:normal}.Amino_SimpleTableRow-module__styledTr--7wqmD>td>:first-child:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTableRow-module__styledTr--7wqmD>td.Amino_SimpleTableRow-module__shouldTruncate--DUSAV{max-width:var(--amino-cell-min-width);min-width:var(--amino-cell-min-width)}.Amino_SimpleTableRow-module__styledTr--7wqmD>td.Amino_SimpleTableRow-module__shouldTruncate--DUSAV>:first-child{overflow:hidden;text-overflow:ellipsis}.Amino_SimpleTableRow-module__styledTr--7wqmD:not(.Amino_SimpleTableRow-module__collapsed--1b0eu) td{border-bottom:var(--amino-border-subtle)}.Amino_SimpleTableRow-module__styledTr--7wqmD.Amino_SimpleTableRow-module__collapsed--1b0eu.Amino_SimpleTableRow-module__hasContent--wJBWQ+tr>td{border:0}.Amino_SimpleTableRow-module__styledTr--7wqmD.Amino_SimpleTableRow-module__collapsed--1b0eu.Amino_SimpleTableRow-module__hasContent--wJBWQ+tr>td>:first-child{padding:0}");var v=800;exports.SimpleTableRow=function(o){var n,d,R=o.bordered,x=o.collapsible,S=o.CustomLinkComponent,q=o.getRowLink,A=o.headers,y=o.index,f=o.item,j=o.noHoverBackground,g=o.onRowClick,C=o.onRowHover,D=o.rowKey,k=o.selectable,W=l.useRef(null),N=function(l){var o=f[l.key],i=function(o){var i=a.default.Children.toArray(o).some((function(e){return!!a.default.isValidElement(e)&&/row-hover-show|cell-hover-show/.test(e.props.className)})),t=m.default("truncate"===l.textWrapMethod&&!i&&h),n={"--amino-cell-min-width":"".concat(l.minWidth||0,"px")},d=m.default(l.noPadding&&w,"normal"===l.textWrapMethod&&b),s={textAlign:l.align||"start"},u=function(e){switch(e){case"center":return"bottom";case"end":return"bottom-end";default:return"bottom-start"}}(l.align);if(q&&!(null==k?void 0:k.anySelected)&&!l.disabledLink){var c=S||"a";return e.jsx("td",{className:t,style:n,children:e.jsx(r.Tooltip,{disabled:"truncate"!==l.textWrapMethod,enterDelay:v,enterNextDelay:v,placement:u,subtitle:o,children:e.jsx(c,{className:d,href:q(f),style:s,children:o})})})}return e.jsx("td",{className:t,style:n,children:e.jsx(r.Tooltip,{disabled:"truncate"!==l.textWrapMethod,enterDelay:v,enterNextDelay:v,placement:u,subtitle:o,children:e.jsx("span",{className:d,style:s,children:o})})})};return l.renderCustom?e.jsx(e.Fragment,{children:i(l.renderCustom(o,f))}):e.jsx(e.Fragment,{children:i(String(o))})},F=function(){var o,t,r;return e.jsxs(e.Fragment,{children:[(null==k?void 0:k.enabled)&&e.jsx("td",{ref:W,children:(null===(o=null==k?void 0:k.renderCustomRowCheckbox)||void 0===o?void 0:o.call(k,f,y))||e.jsx(i.Checkbox,{checked:(null===(t=null==k?void 0:k.isRowChecked)||void 0===t?void 0:t.call(k,f,y))||!1,disabled:(null===(r=null==k?void 0:k.isRowCheckboxDisabled)||void 0===r?void 0:r.call(k,f,y))||!1,onChange:function(e){var l;return null===(l=null==k?void 0:k.onRowCheckboxChange)||void 0===l?void 0:l.call(k,e,f,y)}})}),A.map((function(o){return e.jsx(l.Fragment,{children:N(o)},o.key)}))]})};if((null==x?void 0:x.enabled)&&(null===(n=x.collapseContent)||void 0===n?void 0:n.length)){var M=x.collapseContent,I=x.expandedItemKeys,V=x.toggleItem,B=!I.includes(D),H=null===(d=null==M?void 0:M.find((function(e){return e.key===D})))||void 0===d?void 0:d.content;return e.jsx(t.TableRowCollapse,{className:m.default(s,!j&&_,B&&c,H&&T,R&&u),collapsed:B,onToggleCollapse:function(){V(D),null==g||g(f)},rowContent:F(),children:H},D)}var P=!!g||!!(null==k?void 0:k.anySelected)&&!!(null==k?void 0:k.onRowCheckboxChange);return e.jsx("tr",{className:m.default(s,P&&p,!j&&_,R&&u),onClick:function(e){var l,o,i,t;(null==k?void 0:k.anySelected)||(null===(l=W.current)||void 0===l?void 0:l.contains(e.target))?(null===(o=null==k?void 0:k.isRowCheckboxDisabled)||void 0===o?void 0:o.call(k,f,y))||(e.preventDefault(),null===(i=null==k?void 0:k.onRowCheckboxChange)||void 0===i||i.call(k,!(null===(t=null==k?void 0:k.isRowChecked)||void 0===t?void 0:t.call(k,f,y)),f,y)):null==g||g(f)},onMouseEnter:function(){return null==C?void 0:C(f)},children:F()},D)};
|