@mailstep/design-system 0.4.15 → 0.4.16
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/package.json +1 -1
- package/ui/Forms/Input/Input.js +1 -1
- package/ui/Forms/Input/styles.js +1 -1
- package/ui/index.es.js +2 -2
- package/ui/index.umd.js +2 -2
package/package.json
CHANGED
package/ui/Forms/Input/Input.js
CHANGED
|
@@ -60,5 +60,5 @@ export var Input = function (_a) {
|
|
|
60
60
|
onEnter === null || onEnter === void 0 ? void 0 : onEnter();
|
|
61
61
|
}
|
|
62
62
|
}, [onEnter]);
|
|
63
|
-
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [_jsxs(InputWrap, { children: [label && (_jsx(FieldLabel, { htmlFor: name, "$isInvalid": $isInvalid, children: label })), _jsxs(InputRow, { hasValue: !!value, "$isInvalid": $isInvalid, disabled: !!disabled, "$icon": icon, children: [_jsx(StyledInput, __assign({ autoFocus: autoFocus, className: "".concat(appearance, " ").concat(checkIconPlacement), type: type, name: name, "data-cy": "".concat(name, "Inp"), value: value, "$isInvalid": $isInvalid, "$isClearable": $isClearable, "$hasSuffix": $hasSuffix, disabled: disabled || isLoading, ref: ref, autoComplete: autoComplete, onKeyDown: handleKeyDown, big: big, onBlur: handleBlur, "$asTextArea": asTextArea }, rest)), icon && (_jsx(InputIcon, { right: showArrowsController ? false : iconPlacement === 'right', onClick: iconOnClick, children: _jsxs(Tooltip, { children: [_jsx(Icon, { icon: icon }), iconTooltip && _jsx("span", { children: iconTooltip })] }) })), showArrowsController && (_jsxs(IconsController, { children: [_jsx(IconWrapper, { onClick: onAddItem, children: _jsx(Icon, { icon: "goUp", fill: "gray1" }) }), _jsx(IconWrapper, { onClick: onRemoveItem, children: _jsx(Icon, { icon: "goDown", fill: "gray1" }) })] })), $isClearable && (_jsx(InputIcon, { right: true, onClick: onClear, children: _jsx(Icon, { icon: "deleteX", size: "16px", fill: "lightGray3" }) })), suffix && (_jsx(Suffix, { onClick: suffixOnClick, "$isPointer": !!suffixOnClick, "$isInvalid": $isInvalid, children: suffix })), isLoading && (_jsx(InputIcon, { right: true, children: _jsx(Spinner, { variant: "sm" }) }))] })] }), error && _jsx(ErrorMessage, { appearance: errorAppearance, children: error })] }));
|
|
63
|
+
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [_jsxs(InputWrap, { children: [label && (_jsx(FieldLabel, { htmlFor: name, "$isInvalid": $isInvalid, children: label })), _jsxs(InputRow, { hasValue: !!value, "$isInvalid": $isInvalid, disabled: !!disabled, "$icon": icon, children: [_jsx(StyledInput, __assign({ autoFocus: autoFocus, className: "".concat(appearance, " ").concat(checkIconPlacement), type: type, name: name, "data-cy": "".concat(name, "Inp"), value: value, "$isInvalid": $isInvalid, "$isClearable": $isClearable, "$hasSuffix": $hasSuffix, disabled: disabled || isLoading, ref: ref, autoComplete: autoComplete, onKeyDown: handleKeyDown, big: big, onBlur: handleBlur, "$asTextArea": asTextArea }, rest)), icon && (_jsx(InputIcon, { right: showArrowsController ? false : iconPlacement === 'right', onClick: iconOnClick, children: _jsxs(Tooltip, { children: [_jsx(Icon, { icon: icon }), iconTooltip && _jsx("span", { children: iconTooltip })] }) })), showArrowsController && (_jsxs(IconsController, { children: [_jsx(IconWrapper, { onClick: onAddItem, children: _jsx(Icon, { icon: "goUp", fill: "gray1" }) }), _jsx(IconWrapper, { onClick: onRemoveItem, children: _jsx(Icon, { icon: "goDown", fill: "gray1" }) })] })), $isClearable && (_jsx(InputIcon, { right: true, onClick: onClear, children: _jsx(Icon, { icon: "deleteX", size: "16px", fill: "lightGray3" }) })), suffix && !isLoading && (_jsx(Suffix, { onClick: suffixOnClick, "$isPointer": !!suffixOnClick, "$isInvalid": $isInvalid, children: suffix })), isLoading && (_jsx(InputIcon, { right: true, children: _jsx(Spinner, { variant: "sm" }) }))] })] }), error && _jsx(ErrorMessage, { appearance: errorAppearance, children: error })] }));
|
|
64
64
|
};
|
package/ui/Forms/Input/styles.js
CHANGED
|
@@ -34,7 +34,7 @@ export var StyledInput = styled.input.attrs(function (props) { return ({
|
|
|
34
34
|
? css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 30px;\n color: gray;\n font-weight: semiBold;\n padding: 0 0.5rem 0 1.25rem;\n "], ["\n font-size: 30px;\n color: gray;\n font-weight: semiBold;\n padding: 0 0.5rem 0 1.25rem;\n "]))) : '';
|
|
35
35
|
});
|
|
36
36
|
export var InputWrap = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
37
|
-
export var Suffix = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n font-size: 14px;\n font-weight: 700;\n height: 100%;\n width: 40px;\n padding: 2;\n color: typoPrimary;\n font-family: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n border: slim;\n border-top-right-radius: lg;\n border-bottom-right-radius: lg;\n border-left: none;\n\n ", ";\n\n input
|
|
37
|
+
export var Suffix = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: 0;\n font-size: 14px;\n font-weight: 700;\n height: 100%;\n width: 40px;\n padding: 2;\n color: typoPrimary;\n font-family: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n border: slim;\n border-top-right-radius: lg;\n border-bottom-right-radius: lg;\n border-left: none;\n\n ", ";\n\n input:focus ~ &,\n textarea:focus ~ & {\n border-color: blue2;\n }\n"], ["\n position: absolute;\n right: 0;\n top: 0;\n font-size: 14px;\n font-weight: 700;\n height: 100%;\n width: 40px;\n padding: 2;\n color: typoPrimary;\n font-family: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n border: slim;\n border-top-right-radius: lg;\n border-bottom-right-radius: lg;\n border-left: none;\n\n ", ";\n\n input:focus ~ &,\n textarea:focus ~ & {\n border-color: blue2;\n }\n"])), th('fonts.primary'), function (_a) {
|
|
38
38
|
var $isPointer = _a.$isPointer;
|
|
39
39
|
return $isPointer
|
|
40
40
|
? css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n cursor: pointer;\n "], ["\n cursor: pointer;\n "]))) : '';
|
package/ui/index.es.js
CHANGED
|
@@ -17608,7 +17608,7 @@ const nO = (e, t) => Object.entries(e).map(([r, n]) => `${n} ${r}`).join(", "),
|
|
|
17608
17608
|
cursor: pointer;
|
|
17609
17609
|
` : ""};
|
|
17610
17610
|
|
|
17611
|
-
input
|
|
17611
|
+
input:focus ~ &,
|
|
17612
17612
|
textarea:focus ~ & {
|
|
17613
17613
|
border-color: blue2;
|
|
17614
17614
|
}
|
|
@@ -17770,7 +17770,7 @@ const nO = (e, t) => Object.entries(e).map(([r, n]) => `${n} ${r}`).join(", "),
|
|
|
17770
17770
|
/* @__PURE__ */ f.jsx(m0, { onClick: S, children: /* @__PURE__ */ f.jsx(Te, { icon: "goDown", fill: "gray1" }) })
|
|
17771
17771
|
] }),
|
|
17772
17772
|
ne && /* @__PURE__ */ f.jsx(kt, { right: !0, onClick: V, children: /* @__PURE__ */ f.jsx(Te, { icon: "deleteX", size: "16px", fill: "lightGray3" }) }),
|
|
17773
|
-
p && /* @__PURE__ */ f.jsx(QO, { onClick: A, $isPointer: !!A, $isInvalid: te, children: p }),
|
|
17773
|
+
p && !h && /* @__PURE__ */ f.jsx(QO, { onClick: A, $isPointer: !!A, $isInvalid: te, children: p }),
|
|
17774
17774
|
h && /* @__PURE__ */ f.jsx(kt, { right: !0, children: /* @__PURE__ */ f.jsx(v3, { variant: "sm" }) })
|
|
17775
17775
|
] })
|
|
17776
17776
|
] }),
|
package/ui/index.umd.js
CHANGED
|
@@ -2297,7 +2297,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2297
2297
|
cursor: pointer;
|
|
2298
2298
|
`:""};
|
|
2299
2299
|
|
|
2300
|
-
input
|
|
2300
|
+
input:focus ~ &,
|
|
2301
2301
|
textarea:focus ~ & {
|
|
2302
2302
|
border-color: blue2;
|
|
2303
2303
|
}
|
|
@@ -2372,7 +2372,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2372
2372
|
display: block;
|
|
2373
2373
|
}
|
|
2374
2374
|
}
|
|
2375
|
-
`,PB=["text","number"],IB=({appearance:e="primary",type:t,name:r,label:n,value:i,icon:a,disabled:o,error:s,isInvalid:l=void 0,spaceAround:d=!1,inputRef:c,autoComplete:u,isLoading:h,className:g,suffix:p,suffixOnClick:A,errorAppearance:b,iconPlacement:m="left",iconOnClick:E,iconTooltip:x,big:k,showArrowsController:y=!1,onClear:W,alwaysShowClear:U,setNumber:N,onEnter:H,forceFocus:j=!1,autoFocus:Z=!1,onBlur:_,asTextArea:Y=!1,...te})=>{const re=l!==void 0?l:!!s,ie=!!W&&(!!i||U)&&!o&&!h,ge=!!p,le=y?"left":m,K=T.useCallback(()=>N&&N(M=>M+1),[N]),S=T.useCallback(()=>{N&&N(M=>M>1?M-1:1)},[N]),C=T.useRef(),B=c||C;T.useEffect(()=>{var M;j&&!o&&!h&&((M=B==null?void 0:B.current)==null||M.focus())},[o,j,h]);const z=T.useCallback(M=>{var P,I,D,Q,ee;_==null||_(M),j&&(((I=(P=M.relatedTarget)==null?void 0:P.tagName)==null?void 0:I.toLowerCase())!=="input"||!PB.includes((Q=(D=M.relatedTarget)==null?void 0:D.type)==null?void 0:Q.toLowerCase()))&&((ee=M.target)==null||ee.focus())},[j,_]),J=T.useCallback(M=>{M.key==="Enter"&&(H==null||H())},[H]);return f.jsxs(Xn,{spaceAround:d,className:g,children:[f.jsxs(EB,{children:[n&&f.jsx(Zo,{htmlFor:r,$isInvalid:re,children:n}),f.jsxs(xB,{hasValue:!!i,$isInvalid:re,disabled:!!o,$icon:a,children:[f.jsx(CB,{autoFocus:Z,className:`${e} ${le}`,type:t,name:r,"data-cy":`${r}Inp`,value:i,$isInvalid:re,$isClearable:ie,$hasSuffix:ge,disabled:o||h,ref:B,autoComplete:u,onKeyDown:J,big:k,onBlur:z,$asTextArea:Y,...te}),a&&f.jsx(Lt,{right:y?!1:m==="right",onClick:E,children:f.jsxs(kB,{children:[f.jsx(Oe,{icon:a}),x&&f.jsx("span",{children:x})]})}),y&&f.jsxs(wB,{children:[f.jsx(af,{onClick:K,children:f.jsx(Oe,{icon:"goUp",fill:"gray1"})}),f.jsx(af,{onClick:S,children:f.jsx(Oe,{icon:"goDown",fill:"gray1"})})]}),ie&&f.jsx(Lt,{right:!0,onClick:W,children:f.jsx(Oe,{icon:"deleteX",size:"16px",fill:"lightGray3"})}),p&&f.jsx(SB,{onClick:A,$isPointer:!!A,$isInvalid:re,children:p}),h&&f.jsx(Lt,{right:!0,children:f.jsx(ua,{variant:"sm"})})]})]}),s&&f.jsx(Yd,{appearance:b,children:s})]})},MB=V.div`
|
|
2375
|
+
`,PB=["text","number"],IB=({appearance:e="primary",type:t,name:r,label:n,value:i,icon:a,disabled:o,error:s,isInvalid:l=void 0,spaceAround:d=!1,inputRef:c,autoComplete:u,isLoading:h,className:g,suffix:p,suffixOnClick:A,errorAppearance:b,iconPlacement:m="left",iconOnClick:E,iconTooltip:x,big:k,showArrowsController:y=!1,onClear:W,alwaysShowClear:U,setNumber:N,onEnter:H,forceFocus:j=!1,autoFocus:Z=!1,onBlur:_,asTextArea:Y=!1,...te})=>{const re=l!==void 0?l:!!s,ie=!!W&&(!!i||U)&&!o&&!h,ge=!!p,le=y?"left":m,K=T.useCallback(()=>N&&N(M=>M+1),[N]),S=T.useCallback(()=>{N&&N(M=>M>1?M-1:1)},[N]),C=T.useRef(),B=c||C;T.useEffect(()=>{var M;j&&!o&&!h&&((M=B==null?void 0:B.current)==null||M.focus())},[o,j,h]);const z=T.useCallback(M=>{var P,I,D,Q,ee;_==null||_(M),j&&(((I=(P=M.relatedTarget)==null?void 0:P.tagName)==null?void 0:I.toLowerCase())!=="input"||!PB.includes((Q=(D=M.relatedTarget)==null?void 0:D.type)==null?void 0:Q.toLowerCase()))&&((ee=M.target)==null||ee.focus())},[j,_]),J=T.useCallback(M=>{M.key==="Enter"&&(H==null||H())},[H]);return f.jsxs(Xn,{spaceAround:d,className:g,children:[f.jsxs(EB,{children:[n&&f.jsx(Zo,{htmlFor:r,$isInvalid:re,children:n}),f.jsxs(xB,{hasValue:!!i,$isInvalid:re,disabled:!!o,$icon:a,children:[f.jsx(CB,{autoFocus:Z,className:`${e} ${le}`,type:t,name:r,"data-cy":`${r}Inp`,value:i,$isInvalid:re,$isClearable:ie,$hasSuffix:ge,disabled:o||h,ref:B,autoComplete:u,onKeyDown:J,big:k,onBlur:z,$asTextArea:Y,...te}),a&&f.jsx(Lt,{right:y?!1:m==="right",onClick:E,children:f.jsxs(kB,{children:[f.jsx(Oe,{icon:a}),x&&f.jsx("span",{children:x})]})}),y&&f.jsxs(wB,{children:[f.jsx(af,{onClick:K,children:f.jsx(Oe,{icon:"goUp",fill:"gray1"})}),f.jsx(af,{onClick:S,children:f.jsx(Oe,{icon:"goDown",fill:"gray1"})})]}),ie&&f.jsx(Lt,{right:!0,onClick:W,children:f.jsx(Oe,{icon:"deleteX",size:"16px",fill:"lightGray3"})}),p&&!h&&f.jsx(SB,{onClick:A,$isPointer:!!A,$isInvalid:re,children:p}),h&&f.jsx(Lt,{right:!0,children:f.jsx(ua,{variant:"sm"})})]})]}),s&&f.jsx(Yd,{appearance:b,children:s})]})},MB=V.div`
|
|
2376
2376
|
display: flex;
|
|
2377
2377
|
align-items: center;
|
|
2378
2378
|
height: auto;
|