@team-monolith/cds 1.70.2 → 1.70.3
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/dist/components/Input.js
CHANGED
|
@@ -65,12 +65,20 @@ const SIZE_TO_FONT_STYLES = (size) => ({
|
|
|
65
65
|
/**
|
|
66
66
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=26-10284&t=HnIfxpf8uR6WmzMW-0)
|
|
67
67
|
*/
|
|
68
|
+
// eslint-disable-next-line react/display-name, @typescript-eslint/no-explicit-any
|
|
68
69
|
const Input = React.forwardRef((props, ref) => {
|
|
69
|
-
const { label, hintText, hintIcon,
|
|
70
|
+
const { label, hintText, hintIcon,
|
|
71
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
72
|
+
className, color, size, placeholder, disabled, startIcon, startLabel, endLabel, endIcon, inputProps, inputRef, fullWidth, onChange, onClear, defaultValue, value } = props,
|
|
73
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
74
|
+
other = __rest(props, ["label", "hintText", "hintIcon", "className", "color", "size", "placeholder", "disabled", "startIcon", "startLabel", "endLabel", "endIcon", "inputProps", "inputRef", "fullWidth", "onChange", "onClear", "defaultValue", "value"]);
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
70
76
|
const { className: _className } = props, inputBaseProps = __rest(props, ["className"]);
|
|
71
77
|
return (_jsxs(InputWrapper, Object.assign({ className: props.className, size: props.size, fullWidth: props.fullWidth, ref: ref }, other, { children: [label ? (_jsxs(Label, Object.assign({ disabled: props.disabled }, { children: [label, " ", _jsx(InputBase, Object.assign({}, inputBaseProps))] }))) : (_jsx(InputBase, Object.assign({}, inputBaseProps))), hintText && (_jsxs(Hint, Object.assign({ color: props.color, disabled: props.disabled }, { children: [hintIcon, hintText] })))] })));
|
|
72
78
|
});
|
|
73
|
-
const InputWrapper = styled
|
|
79
|
+
const InputWrapper = styled("span", {
|
|
80
|
+
shouldForwardProp: (prop) => prop !== "fullWidth",
|
|
81
|
+
}) `
|
|
74
82
|
display: flex;
|
|
75
83
|
flex-direction: column;
|
|
76
84
|
gap: 8px;
|
|
@@ -99,7 +99,9 @@ export function InputBase(props) {
|
|
|
99
99
|
const { className, color, size, disabled = false, startIcon, startLabel, endLabel, endIcon, fullWidth = false, onClear, } = props;
|
|
100
100
|
return (_jsxs(InputContainer, Object.assign({ className: className, disabled: disabled, color: color, inputSize: size, fullWidth: fullWidth }, { children: [startIcon, startLabel && _jsx("span", { children: startLabel }), _jsx(InputComponent, Object.assign({}, props)), endLabel && _jsx("span", { children: endLabel }), endIcon, onClear && (_jsx(ClearButton, Object.assign({ type: "button", onClick: onClear, disabled: disabled, tabIndex: -1 }, { children: _jsx(CloseCircleFillIcon, {}) })))] })));
|
|
101
101
|
}
|
|
102
|
-
const InputContainer = styled
|
|
102
|
+
const InputContainer = styled("div", {
|
|
103
|
+
shouldForwardProp: (prop) => !["inputSize", "fullWidth"].includes(prop),
|
|
104
|
+
})(({ theme, color, inputSize, disabled, fullWidth }) => css `
|
|
103
105
|
display: flex;
|
|
104
106
|
align-items: center;
|
|
105
107
|
gap: 16px;
|