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