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