lecom-ui 5.3.54 → 5.3.56
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.
|
@@ -13,7 +13,9 @@ const NumberControl = ({
|
|
|
13
13
|
required = false,
|
|
14
14
|
min = 0,
|
|
15
15
|
className = "",
|
|
16
|
-
|
|
16
|
+
labelClassName = "",
|
|
17
|
+
info = false,
|
|
18
|
+
labelPosition = "top"
|
|
17
19
|
}) => {
|
|
18
20
|
const handleIncrement = () => {
|
|
19
21
|
const current = parseInt(value, 10) || 0;
|
|
@@ -38,17 +40,18 @@ const NumberControl = ({
|
|
|
38
40
|
onChange(numbersOnly);
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
|
-
|
|
43
|
+
const labelElement = /* @__PURE__ */ React__default.createElement(
|
|
42
44
|
Typography,
|
|
43
45
|
{
|
|
44
46
|
variant: "body-medium-400",
|
|
45
47
|
textColor: "text-grey-950",
|
|
46
|
-
className: "flex items-center gap-1"
|
|
48
|
+
className: twMerge(clsx("flex items-center gap-1", labelClassName))
|
|
47
49
|
},
|
|
48
50
|
label,
|
|
49
51
|
required && /* @__PURE__ */ React__default.createElement("span", { className: "body-large-400 text-red-600" }, "*"),
|
|
50
52
|
info && /* @__PURE__ */ React__default.createElement(Info, { size: 12 })
|
|
51
|
-
)
|
|
53
|
+
);
|
|
54
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: twMerge(clsx("flex flex-col gap-1", className)) }, labelPosition === "top" && labelElement, /* @__PURE__ */ React__default.createElement(
|
|
52
55
|
Input,
|
|
53
56
|
{
|
|
54
57
|
value,
|
|
@@ -73,7 +76,7 @@ const NumberControl = ({
|
|
|
73
76
|
}
|
|
74
77
|
)
|
|
75
78
|
}
|
|
76
|
-
));
|
|
79
|
+
), labelPosition === "bottom" && labelElement);
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
export { NumberControl };
|
package/dist/index.d.ts
CHANGED
|
@@ -944,9 +944,11 @@ interface NumberControlProps {
|
|
|
944
944
|
required?: boolean;
|
|
945
945
|
min?: number;
|
|
946
946
|
className?: string;
|
|
947
|
+
labelClassName?: string;
|
|
947
948
|
info?: boolean;
|
|
949
|
+
labelPosition?: 'top' | 'bottom';
|
|
948
950
|
}
|
|
949
|
-
declare const NumberControl: ({ label, value, onChange, placeholder, required, min, className, info, }: NumberControlProps) => React__default.JSX.Element;
|
|
951
|
+
declare const NumberControl: ({ label, value, onChange, placeholder, required, min, className, labelClassName, info, labelPosition, }: NumberControlProps) => React__default.JSX.Element;
|
|
950
952
|
|
|
951
953
|
declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
|
|
952
954
|
declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|