@zonos/amino 5.1.42 → 5.1.43
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,6 +1,11 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type MouseEvent, type ReactNode } from 'react';
|
|
2
2
|
import type { BaseProps } from "../../types/BaseProps";
|
|
3
3
|
export type CheckboxProps = Omit<ComponentPropsWithoutRef<'label'>, 'onClick' | 'onChange'> & BaseProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Don't stop propagation of the click event
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
allowPropagation?: boolean;
|
|
4
9
|
checked: boolean;
|
|
5
10
|
disabled?: boolean;
|
|
6
11
|
icon?: ReactNode;
|
|
@@ -10,4 +15,4 @@ export type CheckboxProps = Omit<ComponentPropsWithoutRef<'label'>, 'onClick' |
|
|
|
10
15
|
subtitle?: string;
|
|
11
16
|
onChange: (checked: boolean, event: MouseEvent<HTMLLabelElement>) => void;
|
|
12
17
|
};
|
|
13
|
-
export declare const Checkbox: ({ checked, className, disabled, icon, label, labelComponent, labelDescription, onChange, subtitle, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Checkbox: ({ allowPropagation, checked, className, disabled, icon, label, labelComponent, labelDescription, onChange, subtitle, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),i=require("clsx"),r=require("framer-motion"),a=require("styled-components"),o=require("../text/Text.js"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),i=require("clsx"),r=require("framer-motion"),a=require("styled-components"),o=require("../text/Text.js"),l=require("../../icons/CheckmarkIcon.js"),c=require("../../styles/constants/theme.js"),s=require("../../utils/getTestId.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../../icons/icon-base/_IconBase.js");var u,h,m,p,x,g,b,f=d(i),k=d(a),j=r.motion(l.CheckmarkIcon),y=k.default.div(u||(u=e.__makeTemplateObject(["\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n line-height: 16px;\n border-radius: ",";\n background: ",";\n border: ",";\n transition: all 150ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n box-shadow: ",";\n\n svg {\n color: ",";\n width: 16px;\n height: 16px;\n }\n"],["\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n line-height: 16px;\n border-radius: ",";\n background: ",";\n border: ",";\n transition: all 150ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n box-shadow: ",";\n\n svg {\n color: ",";\n width: 16px;\n height: 16px;\n }\n"])),c.theme.radius4,(function(e){return e.checked?c.theme.primary:c.theme.inputBackground}),(function(e){return e.checked?"none":"1.5px solid ".concat(c.theme.gray400)}),(function(e){return e.checked?c.theme.shadowButtonPrimary:"none"}),c.theme.gray0),_=k.default.div(h||(h=e.__makeTemplateObject(["\n margin-left: 8px;\n"],["\n margin-left: 8px;\n"]))),w=k.default(o.Text)(m||(m=e.__makeTemplateObject([""],[""]))),v=k.default.span(p||(p=e.__makeTemplateObject(["\n margin-left: 4px;\n color: ",";\n"],["\n margin-left: 4px;\n color: ",";\n"])),c.theme.gray600),T=k.default(o.Text)(x||(x=e.__makeTemplateObject(["\n margin-bottom: 0;\n"],["\n margin-bottom: 0;\n"]))),q=k.default.div(g||(g=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n line-height: 16px;\n\n svg {\n margin-right: 4px;\n }\n"],["\n display: flex;\n align-items: center;\n line-height: 16px;\n\n svg {\n margin-right: 4px;\n }\n"]))),C=k.default.label(b||(b=e.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n user-select: none;\n cursor: pointer;\n\n &.disabled {\n "," {\n background: ",";\n border: ",";\n &:active {\n box-shadow: none;\n }\n }\n "," {\n color: ",";\n }\n "," {\n color: ",";\n }\n "," {\n svg {\n opacity: 0.6;\n }\n }\n\n cursor: not-allowed;\n }\n"],["\n display: flex;\n flex-direction: row;\n user-select: none;\n cursor: pointer;\n\n &.disabled {\n "," {\n background: ",";\n border: ",";\n &:active {\n box-shadow: none;\n }\n }\n "," {\n color: ",";\n }\n "," {\n color: ",";\n }\n "," {\n svg {\n opacity: 0.6;\n }\n }\n\n cursor: not-allowed;\n }\n"])),y,(function(e){return e.checked?c.theme.blue200:""}),(function(e){return e.checked?"none":"1.5px solid ".concat(c.theme.gray300)}),T,c.theme.gray600,w,c.theme.gray400,q);exports.Checkbox=function(i){var a=i.allowPropagation,o=void 0!==a&&a,l=i.checked,c=void 0!==l&&l,d=i.className,u=i.disabled,h=i.icon,m=i.label,p=i.labelComponent,x=i.labelDescription,g=i.onChange,b=i.subtitle,k=e.__rest(i,["allowPropagation","checked","className","disabled","icon","label","labelComponent","labelDescription","onChange","subtitle"]),O=null==m?void 0:m.replace(/\s/g,"-").toLowerCase(),I=t.useMemo((function(){return s.getTestId({componentName:"checkbox",name:m})}),[m]);return n.jsxs(C,e.__assign({checked:c,className:f.default(d,"amino-input-wrapper",{disabled:u}),"data-testid":I,htmlFor:O,onClick:function(e){o||e.stopPropagation(),u||g(!c,e)}},k,{children:[n.jsx(y,{checked:c,id:O,children:n.jsx(r.AnimatePresence,{children:c&&n.jsx(j,{animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},initial:{opacity:0,scale:.5},transition:{duration:.35,ease:[.4,0,.2,1]}},"checkbox")})}),p||m&&n.jsxs(_,{children:[n.jsxs(q,{children:[h,n.jsxs(T,{type:"input-label",children:[m,x&&n.jsx(v,{children:x})]})]}),b&&n.jsx(w,{type:"subtitle",children:b})]})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),o=require("react-select"),i=require("styled-components"),s=require("../checkbox/Checkbox.js"),r=require("../help-text/HelpText.js"),a=require("../../icons/CheckCircleIcon.js"),c=require("../../icons/DoubleChevronIcon.js"),l=require("../../icons/RemoveCircleIcon.js"),u=require("../../icons/RemoveIcon.js"),d=require("../../styles/constants/theme.js"),p=require("../../utils/getTestId.js");function h(e){return e&&e.__esModule?e:{default:e}}require("clsx"),require("framer-motion"),require("../text/Text.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js");var m,g,f,_,x,b,v,j,y,k,T,z=h(o),C=h(i),O=function(e){switch(e){case"sm":return"".concat(d.theme.radius6);case"lg":return"".concat(d.theme.radius10);case"xl":return"".concat(d.theme.radius12);default:return"".concat(d.theme.radius8)}},w=function(t){return n.jsx(o.components.ClearIndicator,e.__assign({},t,{children:n.jsx(l.RemoveCircleIcon,{size:24})}))},I=function(t){return n.jsx(o.components.DropdownIndicator,e.__assign({},t,{children:n.jsx(c.DoubleChevronIcon,{size:24})}))},q=C.default.div(m||(m=e.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: ",";\n padding: 10px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: ",";\n padding: 10px;\n"])),d.theme.gray700),R=C.default.label(b||(b=e.__makeTemplateObject(["\n position: absolute;\n transition: ",";\n font-size: ",";\n line-height: ",";\n transform-origin: left top;\n left: calc("," - 2px);\n .has-icon & {\n left: calc("," + 2px);\n }\n top: calc(50% - "," / 2);\n .has-label & {\n & + div {\n align-self: flex-end;\n }\n }\n .has-value &,\n .is-focused & {\n top: calc("," + 3px);\n transform: scale(0.8);\n }\n\n /* Size modify */\n ","\n\n ","\n\n ","\n\n ","\n"],["\n position: absolute;\n transition: ",";\n font-size: ",";\n line-height: ",";\n transform-origin: left top;\n left: calc("," - 2px);\n .has-icon & {\n left: calc("," + 2px);\n }\n top: calc(50% - "," / 2);\n .has-label & {\n & + div {\n align-self: flex-end;\n }\n }\n .has-value &,\n .is-focused & {\n top: calc("," + 3px);\n transform: scale(0.8);\n }\n\n /* Size modify */\n ","\n\n ","\n\n ","\n\n ","\n"])),d.theme.transition,d.theme.fontSizeBase,d.theme.fontSizeBase,d.theme.space16,d.theme.space40,d.theme.fontSizeBase,d.theme.space8,(function(n){var t=n.$size;return"sm"===t&&i.css(g||(g=e.__makeTemplateObject(["\n .",".has-label & {\n & + div {\n margin-bottom: -6px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 2px;\n }\n "],["\n .",".has-label & {\n & + div {\n margin-bottom: -6px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 2px;\n }\n "])),t,t,t)}),(function(n){var t=n.$size;return"md"===t&&i.css(f||(f=e.__makeTemplateObject(["\n .",".has-label & {\n & + div {\n margin-bottom: -2px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 6px;\n }\n "],["\n .",".has-label & {\n & + div {\n margin-bottom: -2px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 6px;\n }\n "])),t,t,t)}),(function(n){var t=n.$size;return"lg"===t&&i.css(_||(_=e.__makeTemplateObject(["\n .",".has-value &,\n .",".is-focused & {\n top: 10px;\n }\n "],["\n .",".has-value &,\n .",".is-focused & {\n top: 10px;\n }\n "])),t,t)}),(function(n){var t=n.$size;return"xl"===t&&i.css(x||(x=e.__makeTemplateObject(["\n .",".has-label & {\n & + div {\n margin-bottom: 3px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 11px;\n }\n "],["\n .",".has-label & {\n & + div {\n margin-bottom: 3px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 11px;\n }\n "])),t,t,t)})),S=C.default.div(v||(v=e.__makeTemplateObject(["\n .react-select-control + div {\n z-index: 20;\n }\n\n &.has-error .react-select-control {\n box-shadow: ",";\n }\n"],["\n .react-select-control + div {\n z-index: 20;\n }\n\n &.has-error .react-select-control {\n box-shadow: ",";\n }\n"])),d.theme.glowError),L=C.default.strong(j||(j=e.__makeTemplateObject(["\n font-weight: 600;\n"],["\n font-weight: 600;\n"]))),M=function(t){var o=t.children,i=t.className,s=t.cx,r=t.getStyles,a=t.hasValue,c=t.innerProps,l=t.innerRef,u=t.isDisabled,d=t.isFocused,p=t.menuIsOpen,h=t.selectProps,m=h.icon,g=h.label,f=h.size,_=h.value;return n.jsxs("div",e.__assign({ref:l,className:s({control:!0,"control--is-disabled":u,"control--is-focused":d,"control--menu-is-open":p},[i,a?"has-value":"",m?"has-icon":"",d?"is-focused":"",g||Array.isArray(_)&&_.length>1?"has-label":"",f,"react-select-control"].join(" ")),style:r("control",t)},c,{children:[m&&n.jsx(q,{children:m}),n.jsxs(R,{$size:f,children:[g," ",Array.isArray(_)&&_.length>1&&n.jsxs(L,{children:["(",_.length," selected)"]})]}),o]}))},P=C.default.div(y||(y=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n color: ",";\n svg {\n margin-right: 4px;\n color: ",";\n }\n"],["\n display: flex;\n align-items: center;\n color: ",";\n svg {\n margin-right: 4px;\n color: ",";\n }\n"])),(function(e){return e.$color||"inherit"}),d.theme.gray1200),B=C.default.div(k||(k=e.__makeTemplateObject(["\n &:not(.is-disabled) {\n &.is-focused,\n &:hover {\n /* The styles are inlined on this component from emotion, so we must override */\n background-color: "," !important;\n }\n }\n"],["\n &:not(.is-disabled) {\n &.is-focused,\n &:hover {\n /* The styles are inlined on this component from emotion, so we must override */\n background-color: "," !important;\n }\n }\n"])),d.theme.gray100),D=C.default.div(T||(T=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),N=function(e){var t=e.children,o=e.color,i=e.icon;return n.jsxs(P,{$color:o,children:[i,t]})},V=function(t){var i=t.children,s=e.__rest(t,["children"]);return n.jsx(o.components.MultiValueLabel,e.__assign({},s,{children:n.jsx(N,{icon:s.data.icon,children:i})}))},$=function(t){var o=t.innerProps;return n.jsx("div",e.__assign({},o,{role:"button",children:n.jsx(u.RemoveIcon,{size:14})}))},W=function(t){var o=t.children,i=t.className,r=t.data,c=t.getStyles,l=t.innerProps,u=t.innerRef,d=t.isDisabled,p=t.isFocused,h=t.isSelected,m=t.selectProps,g=m,f=g.customOption,_=g.hasGroups,x=c("option",t),b=x.color,v=e.__rest(x,["color"]);_&&(v.paddingLeft=48);return n.jsx("div",e.__assign({ref:u},l,{children:n.jsx(B,{className:[i,p?"is-focused":"",d?"is-disabled":""].join(" "),style:v,children:m.isMulti?n.jsx(s.Checkbox,{checked:h,disabled:d,icon:r.icon,label:r.label,labelDescription:r.labelDescription,onChange:function(){}}):f?f(r.value):n.jsxs(D,{children:[n.jsx(N,{color:b,icon:r.icon,children:o}),h&&n.jsx(a.CheckCircleIcon,{color:"blue600",size:24})]})})}))},H={clearIndicator:function(n){return e.__assign(e.__assign({},n),{color:d.theme.gray700,paddingLeft:14,paddingRight:4})},control:function(n,t){var o=t.selectProps.size;return e.__assign(e.__assign({},n),{background:d.theme.inputBackground,borderColor:"".concat(d.theme.gray200),borderRadius:O(o),boxShadow:t.isFocused?"".concat(d.theme.glowBlue):"",color:d.theme.gray800,cursor:"pointer",flexWrap:"inherit",height:"var(--amino-size-".concat(o,")"),minHeight:"var(--amino-size-".concat(o,")")})},dropdownIndicator:function(n){return e.__assign(e.__assign({},n),{color:d.theme.gray900,paddingLeft:4,paddingRight:10})},group:function(n){return e.__assign(e.__assign({},n),{paddingBottom:0,paddingTop:0})},indicatorSeparator:function(n){return e.__assign(e.__assign({},n),{width:0})},input:function(n){return e.__assign(e.__assign({},n),{color:d.theme.textColor,opacity:.8})},menu:function(n){return e.__assign(e.__assign({},n),{background:d.theme.surfaceColor,borderRadius:12,boxShadow:d.theme.v3ShadowLarge,marginTop:4})},menuList:function(n){return e.__assign(e.__assign({},n),{paddingLeft:8,paddingRight:8,paddingTop:8})},multiValue:function(n){return e.__assign(e.__assign({},n),{alignItems:"center",background:d.theme.gray100,borderRadius:d.theme.radius4,fontWeight:600,maxHeight:20,minWidth:"inherit",paddingRight:2})},multiValueLabel:function(n){return e.__assign(e.__assign({},n),{color:d.theme.textColor})},option:function(n,t){return e.__assign(e.__assign({},n),{backgroundColor:"inherit",borderRadius:"8px",color:t.isSelected?d.theme.blue600:d.theme.textColor,cursor:"pointer",fontWeight:t.isSelected?500:400,paddingBottom:7,paddingLeft:8,paddingRight:12,paddingTop:7})},placeholder:function(n){return e.__assign(e.__assign({},n),{".has-label.is-focused &":{opacity:1},opacity:0})},singleValue:function(n){return e.__assign(e.__assign({},n),{color:d.theme.textColor,fontWeight:500})},valueContainer:function(n){return e.__assign(e.__assign({},n),{".has-icon &":{paddingLeft:0},flexWrap:"nowrap",padding:"unset",paddingLeft:12})}};exports.CheckboxOptionComponent=W,exports.StyledReactSelect=function(o){var i=o.closeOnOutsideScroll,s=void 0!==i&&i,a=o.components,c=o.customOption,l=o.error,u=o.hasGroups,d=o.helpText,h=o.icon,m=o.label,g=o.menuPosition,f=void 0===g?"fixed":g,_=o.placeholder,x=o.size,b=void 0===x?"xl":x,v=o.styles,j=e.__rest(o,["closeOnOutsideScroll","components","customOption","error","hasGroups","helpText","icon","label","menuPosition","placeholder","size","styles"]),y={customOption:c,hasGroups:u,icon:h,label:m,size:b},k=t.useMemo((function(){return p.getTestId({componentName:"select",name:m})}),[m]),T=t.useRef(null),C=t.useMemo((function(){return!!s&&function(e){var n,t,o;return!(e.target instanceof HTMLElement)||(null===(o=!(null===(t=null===(n=T.current)||void 0===n?void 0:n.menuListRef)||void 0===t?void 0:t.isEqualNode(e.target)))||void 0===o||o)}}),[s]);return n.jsxs(S,{className:[l?"has-error":""].join(" "),"data-testid":k,children:[n.jsx(z.default,e.__assign({ref:T,closeMenuOnScroll:C,components:e.__assign({ClearIndicator:w,Control:M,DropdownIndicator:I,MultiValueLabel:V,MultiValueRemove:$,Option:W},a),menuPosition:f,placeholder:_||"",styles:e.__assign(e.__assign({},v),H)},j,y)),n.jsx(r.HelpText,{error:l,helpText:d})]})};
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),o=require("react-select"),i=require("styled-components"),s=require("../checkbox/Checkbox.js"),r=require("../help-text/HelpText.js"),a=require("../../icons/CheckCircleIcon.js"),c=require("../../icons/DoubleChevronIcon.js"),l=require("../../icons/RemoveCircleIcon.js"),u=require("../../icons/RemoveIcon.js"),d=require("../../styles/constants/theme.js"),p=require("../../utils/getTestId.js");function h(e){return e&&e.__esModule?e:{default:e}}require("clsx"),require("framer-motion"),require("../text/Text.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js");var m,g,f,_,x,b,v,j,y,k,T,z=h(o),C=h(i),O=function(e){switch(e){case"sm":return"".concat(d.theme.radius6);case"lg":return"".concat(d.theme.radius10);case"xl":return"".concat(d.theme.radius12);default:return"".concat(d.theme.radius8)}},w=function(t){return n.jsx(o.components.ClearIndicator,e.__assign({},t,{children:n.jsx(l.RemoveCircleIcon,{size:24})}))},I=function(t){return n.jsx(o.components.DropdownIndicator,e.__assign({},t,{children:n.jsx(c.DoubleChevronIcon,{size:24})}))},q=C.default.div(m||(m=e.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: ",";\n padding: 10px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n color: ",";\n padding: 10px;\n"])),d.theme.gray700),R=C.default.label(b||(b=e.__makeTemplateObject(["\n position: absolute;\n transition: ",";\n font-size: ",";\n line-height: ",";\n transform-origin: left top;\n left: calc("," - 2px);\n .has-icon & {\n left: calc("," + 2px);\n }\n top: calc(50% - "," / 2);\n .has-label & {\n & + div {\n align-self: flex-end;\n }\n }\n .has-value &,\n .is-focused & {\n top: calc("," + 3px);\n transform: scale(0.8);\n }\n\n /* Size modify */\n ","\n\n ","\n\n ","\n\n ","\n"],["\n position: absolute;\n transition: ",";\n font-size: ",";\n line-height: ",";\n transform-origin: left top;\n left: calc("," - 2px);\n .has-icon & {\n left: calc("," + 2px);\n }\n top: calc(50% - "," / 2);\n .has-label & {\n & + div {\n align-self: flex-end;\n }\n }\n .has-value &,\n .is-focused & {\n top: calc("," + 3px);\n transform: scale(0.8);\n }\n\n /* Size modify */\n ","\n\n ","\n\n ","\n\n ","\n"])),d.theme.transition,d.theme.fontSizeBase,d.theme.fontSizeBase,d.theme.space16,d.theme.space40,d.theme.fontSizeBase,d.theme.space8,(function(n){var t=n.$size;return"sm"===t&&i.css(g||(g=e.__makeTemplateObject(["\n .",".has-label & {\n & + div {\n margin-bottom: -6px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 2px;\n }\n "],["\n .",".has-label & {\n & + div {\n margin-bottom: -6px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 2px;\n }\n "])),t,t,t)}),(function(n){var t=n.$size;return"md"===t&&i.css(f||(f=e.__makeTemplateObject(["\n .",".has-label & {\n & + div {\n margin-bottom: -2px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 6px;\n }\n "],["\n .",".has-label & {\n & + div {\n margin-bottom: -2px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 6px;\n }\n "])),t,t,t)}),(function(n){var t=n.$size;return"lg"===t&&i.css(_||(_=e.__makeTemplateObject(["\n .",".has-value &,\n .",".is-focused & {\n top: 10px;\n }\n "],["\n .",".has-value &,\n .",".is-focused & {\n top: 10px;\n }\n "])),t,t)}),(function(n){var t=n.$size;return"xl"===t&&i.css(x||(x=e.__makeTemplateObject(["\n .",".has-label & {\n & + div {\n margin-bottom: 3px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 11px;\n }\n "],["\n .",".has-label & {\n & + div {\n margin-bottom: 3px;\n }\n }\n .",".has-value &,\n .",".is-focused & {\n top: 11px;\n }\n "])),t,t,t)})),S=C.default.div(v||(v=e.__makeTemplateObject(["\n .react-select-control + div {\n z-index: 20;\n }\n\n &.has-error .react-select-control {\n box-shadow: ",";\n }\n"],["\n .react-select-control + div {\n z-index: 20;\n }\n\n &.has-error .react-select-control {\n box-shadow: ",";\n }\n"])),d.theme.glowError),L=C.default.strong(j||(j=e.__makeTemplateObject(["\n font-weight: 600;\n"],["\n font-weight: 600;\n"]))),P=function(t){var o=t.children,i=t.className,s=t.cx,r=t.getStyles,a=t.hasValue,c=t.innerProps,l=t.innerRef,u=t.isDisabled,d=t.isFocused,p=t.menuIsOpen,h=t.selectProps,m=h.icon,g=h.label,f=h.size,_=h.value;return n.jsxs("div",e.__assign({ref:l,className:s({control:!0,"control--is-disabled":u,"control--is-focused":d,"control--menu-is-open":p},[i,a?"has-value":"",m?"has-icon":"",d?"is-focused":"",g||Array.isArray(_)&&_.length>1?"has-label":"",f,"react-select-control"].join(" ")),style:r("control",t)},c,{children:[m&&n.jsx(q,{children:m}),n.jsxs(R,{$size:f,children:[g," ",Array.isArray(_)&&_.length>1&&n.jsxs(L,{children:["(",_.length," selected)"]})]}),o]}))},M=C.default.div(y||(y=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n color: ",";\n svg {\n margin-right: 4px;\n color: ",";\n }\n"],["\n display: flex;\n align-items: center;\n color: ",";\n svg {\n margin-right: 4px;\n color: ",";\n }\n"])),(function(e){return e.$color||"inherit"}),d.theme.gray1200),B=C.default.div(k||(k=e.__makeTemplateObject(["\n &:not(.is-disabled) {\n &.is-focused,\n &:hover {\n /* The styles are inlined on this component from emotion, so we must override */\n background-color: "," !important;\n }\n }\n"],["\n &:not(.is-disabled) {\n &.is-focused,\n &:hover {\n /* The styles are inlined on this component from emotion, so we must override */\n background-color: "," !important;\n }\n }\n"])),d.theme.gray100),D=C.default.div(T||(T=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),N=function(e){var t=e.children,o=e.color,i=e.icon;return n.jsxs(M,{$color:o,children:[i,t]})},V=function(t){var i=t.children,s=e.__rest(t,["children"]);return n.jsx(o.components.MultiValueLabel,e.__assign({},s,{children:n.jsx(N,{icon:s.data.icon,children:i})}))},$=function(t){var o=t.innerProps;return n.jsx("div",e.__assign({},o,{role:"button",children:n.jsx(u.RemoveIcon,{size:14})}))},W=function(t){var o=t.children,i=t.className,r=t.data,c=t.getStyles,l=t.innerProps,u=t.innerRef,d=t.isDisabled,p=t.isFocused,h=t.isSelected,m=t.selectProps,g=m,f=g.customOption,_=g.hasGroups,x=c("option",t),b=x.color,v=e.__rest(x,["color"]);_&&(v.paddingLeft=48);return n.jsx("div",e.__assign({ref:u},l,{children:n.jsx(B,{className:[i,p?"is-focused":"",d?"is-disabled":""].join(" "),style:v,children:m.isMulti?n.jsx(s.Checkbox,{allowPropagation:!0,checked:h,disabled:d,icon:r.icon,label:r.label,labelDescription:r.labelDescription,onChange:function(){}}):f?f(r.value):n.jsxs(D,{children:[n.jsx(N,{color:b,icon:r.icon,children:o}),h&&n.jsx(a.CheckCircleIcon,{color:"blue600",size:24})]})})}))},H={clearIndicator:function(n){return e.__assign(e.__assign({},n),{color:d.theme.gray700,paddingLeft:14,paddingRight:4})},control:function(n,t){var o=t.selectProps.size;return e.__assign(e.__assign({},n),{background:d.theme.inputBackground,borderColor:"".concat(d.theme.gray200),borderRadius:O(o),boxShadow:t.isFocused?"".concat(d.theme.glowBlue):"",color:d.theme.gray800,cursor:"pointer",flexWrap:"inherit",height:"var(--amino-size-".concat(o,")"),minHeight:"var(--amino-size-".concat(o,")")})},dropdownIndicator:function(n){return e.__assign(e.__assign({},n),{color:d.theme.gray900,paddingLeft:4,paddingRight:10})},group:function(n){return e.__assign(e.__assign({},n),{paddingBottom:0,paddingTop:0})},indicatorSeparator:function(n){return e.__assign(e.__assign({},n),{width:0})},input:function(n){return e.__assign(e.__assign({},n),{color:d.theme.textColor,opacity:.8})},menu:function(n){return e.__assign(e.__assign({},n),{background:d.theme.surfaceColor,borderRadius:12,boxShadow:d.theme.v3ShadowLarge,marginTop:4})},menuList:function(n){return e.__assign(e.__assign({},n),{paddingLeft:8,paddingRight:8,paddingTop:8})},multiValue:function(n){return e.__assign(e.__assign({},n),{alignItems:"center",background:d.theme.gray100,borderRadius:d.theme.radius4,fontWeight:600,maxHeight:20,minWidth:"inherit",paddingRight:2})},multiValueLabel:function(n){return e.__assign(e.__assign({},n),{color:d.theme.textColor})},option:function(n,t){return e.__assign(e.__assign({},n),{backgroundColor:"inherit",borderRadius:"8px",color:t.isSelected?d.theme.blue600:d.theme.textColor,cursor:"pointer",fontWeight:t.isSelected?500:400,paddingBottom:7,paddingLeft:8,paddingRight:12,paddingTop:7})},placeholder:function(n){return e.__assign(e.__assign({},n),{".has-label.is-focused &":{opacity:1},opacity:0})},singleValue:function(n){return e.__assign(e.__assign({},n),{color:d.theme.textColor,fontWeight:500})},valueContainer:function(n){return e.__assign(e.__assign({},n),{".has-icon &":{paddingLeft:0},flexWrap:"nowrap",padding:"unset",paddingLeft:12})}};exports.CheckboxOptionComponent=W,exports.StyledReactSelect=function(o){var i=o.closeOnOutsideScroll,s=void 0!==i&&i,a=o.components,c=o.customOption,l=o.error,u=o.hasGroups,d=o.helpText,h=o.icon,m=o.label,g=o.menuPosition,f=void 0===g?"fixed":g,_=o.placeholder,x=o.size,b=void 0===x?"xl":x,v=o.styles,j=e.__rest(o,["closeOnOutsideScroll","components","customOption","error","hasGroups","helpText","icon","label","menuPosition","placeholder","size","styles"]),y={customOption:c,hasGroups:u,icon:h,label:m,size:b},k=t.useMemo((function(){return p.getTestId({componentName:"select",name:m})}),[m]),T=t.useRef(null),C=t.useMemo((function(){return!!s&&function(e){var n,t,o;return!(e.target instanceof HTMLElement)||(null===(o=!(null===(t=null===(n=T.current)||void 0===n?void 0:n.menuListRef)||void 0===t?void 0:t.isEqualNode(e.target)))||void 0===o||o)}}),[s]);return n.jsxs(S,{className:[l?"has-error":""].join(" "),"data-testid":k,children:[n.jsx(z.default,e.__assign({ref:T,closeMenuOnScroll:C,components:e.__assign({ClearIndicator:w,Control:P,DropdownIndicator:I,MultiValueLabel:V,MultiValueRemove:$,Option:W},a),menuPosition:f,placeholder:_||"",styles:e.__assign(e.__assign({},v),H)},j,y)),n.jsx(r.HelpText,{error:l,helpText:d})]})};
|