@matbea-ui/matbea-ui 0.2.0-dev.925901 → 0.2.0-dev.963809
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/matbea-ui.es.js
CHANGED
|
@@ -165,7 +165,6 @@ const StyledButton = styled.button `
|
|
|
165
165
|
const IconSlot = styled.span `
|
|
166
166
|
display: inline-flex;
|
|
167
167
|
align-items: center;
|
|
168
|
-
width: max-content;
|
|
169
168
|
justify-content: center;
|
|
170
169
|
line-height: 0;
|
|
171
170
|
${({ $iconOnly }) => $iconOnly &&
|
|
@@ -574,9 +573,8 @@ const StyledTypography = styled$1.span `
|
|
|
574
573
|
const Typography = ({ as = "span", forwardedAs, variant = "body-m-semibold", color, align, uppercase = false, truncate = false, inline = false, children, ...rest }) => (jsx(StyledTypography, { as: as, forwardedAs: forwardedAs, "$variant": variant, "$color": color, "$align": align, "$uppercase": uppercase, "$truncate": truncate, "$inline": inline, ...rest, children: children }));
|
|
575
574
|
|
|
576
575
|
const Icon = ({ size = 24, children, ...rest }) => {
|
|
577
|
-
return (jsx("svg", { style: {
|
|
578
|
-
|
|
579
|
-
height: size,
|
|
576
|
+
return (jsx("svg", { width: size, height: size, style: {
|
|
577
|
+
display: "inline-flex",
|
|
580
578
|
}, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: children }));
|
|
581
579
|
};
|
|
582
580
|
|
|
@@ -930,13 +928,14 @@ const Informer = ({ label, description, type, icon, }) => {
|
|
|
930
928
|
const Wrapper$1 = styled$1.div `
|
|
931
929
|
display: flex;
|
|
932
930
|
flex-direction: column;
|
|
933
|
-
gap:
|
|
931
|
+
gap: 4px;
|
|
934
932
|
width: 100%;
|
|
935
933
|
`;
|
|
936
934
|
const Label$2 = styled$1(Typography).attrs({
|
|
935
|
+
variant: "form-input",
|
|
937
936
|
forwardedAs: "label",
|
|
938
937
|
}) `
|
|
939
|
-
color: ${({ theme
|
|
938
|
+
color: ${({ theme }) => theme.colors.primary.darkBlue};
|
|
940
939
|
`;
|
|
941
940
|
const FieldContainer$1 = styled$1.div `
|
|
942
941
|
display: flex;
|
|
@@ -1009,7 +1008,7 @@ const ErrorText$1 = styled$1.span `
|
|
|
1009
1008
|
color: ${({ theme }) => theme.colors.accent.red};
|
|
1010
1009
|
`;
|
|
1011
1010
|
|
|
1012
|
-
const TextField = forwardRef(({ value, defaultValue, placeholder = "Text", label, error, disabled = false, icon, action, name, type = "text", onChange, onFocus, onBlur, className,
|
|
1011
|
+
const TextField = forwardRef(({ value, defaultValue, placeholder = "Text", label, error, disabled = false, icon, action, name, type = "text", onChange, onFocus, onBlur, className, }, ref) => {
|
|
1013
1012
|
const [focused, setFocused] = useState(false);
|
|
1014
1013
|
const hasError = Boolean(error);
|
|
1015
1014
|
const handleFocus = (evt) => {
|
|
@@ -1020,7 +1019,7 @@ const TextField = forwardRef(({ value, defaultValue, placeholder = "Text", label
|
|
|
1020
1019
|
setFocused(false);
|
|
1021
1020
|
onBlur?.(evt);
|
|
1022
1021
|
};
|
|
1023
|
-
return (jsxs(Wrapper$1, { className: className, children: [label &&
|
|
1022
|
+
return (jsxs(Wrapper$1, { className: className, children: [label && jsx(Label$2, { children: label }), jsxs(FieldContainer$1, { "$hasError": hasError, "$disabled": disabled, "data-state": hasError ? "error" : focused ? "active" : undefined, children: [icon && jsx(LeadingIcon$1, { children: icon }), jsx(Input, { ref: ref, type: type, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, disabled: disabled, onChange: onChange, onFocus: handleFocus, onBlur: handleBlur }), action && jsx(ActionSlot, { children: action })] }), error && jsx(ErrorText$1, { children: error })] }));
|
|
1024
1023
|
});
|
|
1025
1024
|
TextField.displayName = "TextField";
|
|
1026
1025
|
|