@matbea-ui/matbea-ui 0.2.0-dev.204250 → 0.2.0-dev.263306
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 +35 -18
- package/dist/matbea-ui.cjs.js.map +1 -1
- package/dist/matbea-ui.es.js +35 -18
- package/dist/matbea-ui.es.js.map +1 -1
- package/dist/types/index.d.ts +6 -4
- package/package.json +1 -1
package/dist/matbea-ui.es.js
CHANGED
|
@@ -165,6 +165,7 @@ const StyledButton = styled.button `
|
|
|
165
165
|
const IconSlot = styled.span `
|
|
166
166
|
display: inline-flex;
|
|
167
167
|
align-items: center;
|
|
168
|
+
width: max-content;
|
|
168
169
|
justify-content: center;
|
|
169
170
|
line-height: 0;
|
|
170
171
|
${({ $iconOnly }) => $iconOnly &&
|
|
@@ -573,7 +574,10 @@ const StyledTypography = styled$1.span `
|
|
|
573
574
|
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 }));
|
|
574
575
|
|
|
575
576
|
const Icon = ({ size = 24, children, ...rest }) => {
|
|
576
|
-
return (jsx("svg", {
|
|
577
|
+
return (jsx("svg", { style: {
|
|
578
|
+
width: size,
|
|
579
|
+
height: size,
|
|
580
|
+
}, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: children }));
|
|
577
581
|
};
|
|
578
582
|
|
|
579
583
|
const LogoAbankIcon = (props) => (jsxs(Icon, { ...props, children: [jsxs("g", { "clip-path": "url(#clip0_348_2416)", children: [jsx("circle", { cx: "12", cy: "12", r: "12", fill: "#F5F5F5" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.2589 7.98674C7.53128 8.31962 6.81257 6.30884 6.3125 3.00224C10.4015 2.97341 12.2754 3.18291 12.1754 5.99132C12.1172 6.06513 12.0622 6.1397 12.0098 6.2162C11.4594 5.19946 10.2518 4.30843 7.75728 3.83024C9.57266 4.44681 10.9399 5.69495 11.3993 7.37362C11.3396 7.57351 11.2938 7.77724 11.2589 7.98674ZM11.6388 9.04691C11.7904 7.71881 12.2529 6.60021 13.4042 5.75569C13.9803 5.33323 14.7726 5.87101 13.9469 6.35919C12.9495 6.94771 11.9955 8.32385 11.8459 9.03922C11.7783 9.05701 11.7076 9.05963 11.6388 9.04691Z", fill: "#007F2D" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.1018 9.30787C11.3545 9.34554 11.565 9.36169 11.7693 9.35131C11.9775 9.33977 12.1888 9.30057 12.4427 9.2283C13.9274 8.80469 15.8889 9.07146 17.153 9.96942C18.7727 11.1192 19.2064 13.078 18.9161 15.0273C18.5672 17.3706 16.2785 21.9634 13.3339 20.8202C12.9703 20.6795 12.6144 20.5638 12.2178 20.5773C11.803 20.5911 11.6383 20.7249 11.0328 20.8717C7.71099 21.6751 5.31607 17.1969 5.0389 14.5514C4.86058 12.8447 5.28079 11.1964 6.6023 10.1797C7.7513 9.2948 9.69848 8.96729 11.1018 9.30787Z", fill: "#65B32E" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_348_2416", children: jsx("rect", { width: "24", height: "24", fill: "white" }) }) })] }));
|
|
@@ -926,14 +930,13 @@ const Informer = ({ label, description, type, icon, }) => {
|
|
|
926
930
|
const Wrapper$1 = styled$1.div `
|
|
927
931
|
display: flex;
|
|
928
932
|
flex-direction: column;
|
|
929
|
-
gap:
|
|
933
|
+
gap: 12px;
|
|
930
934
|
width: 100%;
|
|
931
935
|
`;
|
|
932
936
|
const Label$2 = styled$1(Typography).attrs({
|
|
933
|
-
variant: "form-input",
|
|
934
937
|
forwardedAs: "label",
|
|
935
938
|
}) `
|
|
936
|
-
color: ${({ theme }) => theme.colors.primary.darkBlue};
|
|
939
|
+
color: ${({ theme, $color }) => $color || theme.colors.primary.darkBlue};
|
|
937
940
|
`;
|
|
938
941
|
const FieldContainer$1 = styled$1.div `
|
|
939
942
|
display: flex;
|
|
@@ -1006,7 +1009,7 @@ const ErrorText$1 = styled$1.span `
|
|
|
1006
1009
|
color: ${({ theme }) => theme.colors.accent.red};
|
|
1007
1010
|
`;
|
|
1008
1011
|
|
|
1009
|
-
const TextField = forwardRef(({ value, defaultValue, placeholder = "Text", label, error, disabled = false, icon, action, name, type = "text", onChange, onFocus, onBlur, className, }, ref) => {
|
|
1012
|
+
const TextField = forwardRef(({ value, defaultValue, placeholder = "Text", label, error, disabled = false, icon, action, name, type = "text", onChange, onFocus, onBlur, className, labelVariant, labelColor, }, ref) => {
|
|
1010
1013
|
const [focused, setFocused] = useState(false);
|
|
1011
1014
|
const hasError = Boolean(error);
|
|
1012
1015
|
const handleFocus = (evt) => {
|
|
@@ -1017,7 +1020,7 @@ const TextField = forwardRef(({ value, defaultValue, placeholder = "Text", label
|
|
|
1017
1020
|
setFocused(false);
|
|
1018
1021
|
onBlur?.(evt);
|
|
1019
1022
|
};
|
|
1020
|
-
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 })] }));
|
|
1023
|
+
return (jsxs(Wrapper$1, { className: className, children: [label && (jsx(Label$2, { variant: labelVariant || "form-input", "$color": labelColor, 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 })] }));
|
|
1021
1024
|
});
|
|
1022
1025
|
TextField.displayName = "TextField";
|
|
1023
1026
|
|
|
@@ -2697,10 +2700,24 @@ const StyledProvider = ({ children }) => {
|
|
|
2697
2700
|
};
|
|
2698
2701
|
|
|
2699
2702
|
const breakpoints = {
|
|
2700
|
-
mobile: {
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2703
|
+
mobile: {
|
|
2704
|
+
max: 576,
|
|
2705
|
+
referenceWidth: 375,
|
|
2706
|
+
},
|
|
2707
|
+
tablet: {
|
|
2708
|
+
min: 576,
|
|
2709
|
+
max: 1024,
|
|
2710
|
+
referenceWidth: 768,
|
|
2711
|
+
},
|
|
2712
|
+
desktop: {
|
|
2713
|
+
min: 1024,
|
|
2714
|
+
max: 1920,
|
|
2715
|
+
referenceWidth: 1440,
|
|
2716
|
+
},
|
|
2717
|
+
wide: {
|
|
2718
|
+
min: 1920,
|
|
2719
|
+
referenceWidth: 1920,
|
|
2720
|
+
},
|
|
2704
2721
|
};
|
|
2705
2722
|
const GlobalStyles = createGlobalStyle `
|
|
2706
2723
|
:root {
|
|
@@ -2708,31 +2725,31 @@ const GlobalStyles = createGlobalStyle `
|
|
|
2708
2725
|
--adaptive-vh: 1vh;
|
|
2709
2726
|
}
|
|
2710
2727
|
|
|
2711
|
-
/* Mobile */
|
|
2728
|
+
/* Mobile: scale = 1 на 375px, меньше → уменьшается */
|
|
2712
2729
|
@media (max-width: ${breakpoints.mobile.max}px) {
|
|
2713
2730
|
:root {
|
|
2714
|
-
--adaptive-scale: ${breakpoints.mobile.
|
|
2731
|
+
--adaptive-scale: min(1, calc(100vw / ${breakpoints.mobile.referenceWidth}px));
|
|
2715
2732
|
}
|
|
2716
2733
|
}
|
|
2717
2734
|
|
|
2718
|
-
/* Tablet */
|
|
2735
|
+
/* Tablet: scale = 1 на 768px, меньше → уменьшается */
|
|
2719
2736
|
@media (min-width: ${breakpoints.tablet.min}px) and (max-width: ${breakpoints.tablet.max}px) {
|
|
2720
2737
|
:root {
|
|
2721
|
-
--adaptive-scale: ${breakpoints.tablet.
|
|
2738
|
+
--adaptive-scale: min(1, calc(100vw / ${breakpoints.tablet.referenceWidth}px));
|
|
2722
2739
|
}
|
|
2723
2740
|
}
|
|
2724
2741
|
|
|
2725
|
-
/* Desktop */
|
|
2742
|
+
/* Desktop: scale = 1 на 1440px, меньше → уменьшается */
|
|
2726
2743
|
@media (min-width: ${breakpoints.desktop.min}px) and (max-width: ${breakpoints.desktop.max}px) {
|
|
2727
2744
|
:root {
|
|
2728
|
-
--adaptive-scale: ${breakpoints.desktop.
|
|
2745
|
+
--adaptive-scale: min(1, calc(100vw / ${breakpoints.desktop.referenceWidth}px));
|
|
2729
2746
|
}
|
|
2730
2747
|
}
|
|
2731
2748
|
|
|
2732
|
-
/* Wide */
|
|
2749
|
+
/* Wide: scale = 1 на 1920px, меньше → уменьшается */
|
|
2733
2750
|
@media (min-width: ${breakpoints.wide.min}px) {
|
|
2734
2751
|
:root {
|
|
2735
|
-
--adaptive-scale: ${breakpoints.wide.
|
|
2752
|
+
--adaptive-scale: min(1, calc(100vw / ${breakpoints.wide.referenceWidth}px));
|
|
2736
2753
|
}
|
|
2737
2754
|
}
|
|
2738
2755
|
|