@rehagro/ui 1.0.40 → 1.0.42
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/index.d.mts +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +37 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -11
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +24 -1
- package/dist/native.d.ts +24 -1
- package/dist/native.js +118 -0
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +118 -1
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -833,6 +833,7 @@ var Button = forwardRef(function Button2({
|
|
|
833
833
|
size = "md",
|
|
834
834
|
radius = "sm",
|
|
835
835
|
color = "primary",
|
|
836
|
+
textColor,
|
|
836
837
|
hoverColor,
|
|
837
838
|
hoverStyle,
|
|
838
839
|
loading = false,
|
|
@@ -853,8 +854,9 @@ var Button = forwardRef(function Button2({
|
|
|
853
854
|
"--btn-hover-border": hoverStyle.borderColor,
|
|
854
855
|
"--btn-hover-color": hoverStyle.color
|
|
855
856
|
} : {};
|
|
856
|
-
|
|
857
|
-
|
|
857
|
+
const textStyle = textColor ? { color: textColor } : {};
|
|
858
|
+
return { ...style, ...baseStyle, ...textStyle, ...hoverVars };
|
|
859
|
+
}, [preset, color, variant, hoverColor, hoverStyle, style, textColor]);
|
|
858
860
|
const hasCustomHover = Boolean(hoverStyle);
|
|
859
861
|
return /* @__PURE__ */ jsxs(
|
|
860
862
|
"button",
|
|
@@ -1083,6 +1085,7 @@ var labelWeightClasses = {
|
|
|
1083
1085
|
semibold: "rh-font-semibold",
|
|
1084
1086
|
bold: "rh-font-bold"
|
|
1085
1087
|
};
|
|
1088
|
+
var getSubtitleClassName = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1086
1089
|
var TextInput = forwardRef(function TextInput2({
|
|
1087
1090
|
label,
|
|
1088
1091
|
labelWeight = "medium",
|
|
@@ -1099,7 +1102,8 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
1099
1102
|
id,
|
|
1100
1103
|
...rest
|
|
1101
1104
|
}, ref) {
|
|
1102
|
-
const
|
|
1105
|
+
const generatedId = React9.useId();
|
|
1106
|
+
const inputId = id || generatedId;
|
|
1103
1107
|
const [isHelperDismissed, setIsHelperDismissed] = React9.useState(false);
|
|
1104
1108
|
const { onChange, ...inputProps } = rest;
|
|
1105
1109
|
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
@@ -1110,7 +1114,7 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
1110
1114
|
children: [
|
|
1111
1115
|
label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
1112
1116
|
/* @__PURE__ */ jsx("span", { className: `rh-text-sm ${labelWeightClasses[labelWeight]} rh-text-text`, children: label }),
|
|
1113
|
-
subtitle && /* @__PURE__ */ jsx("span", { className:
|
|
1117
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName(subtitle)}`, children: subtitle })
|
|
1114
1118
|
] }),
|
|
1115
1119
|
/* @__PURE__ */ jsxs(
|
|
1116
1120
|
"div",
|
|
@@ -1508,6 +1512,7 @@ var optionSizeClasses = {
|
|
|
1508
1512
|
md: "rh-px-input-x-md rh-py-2 rh-text-sm",
|
|
1509
1513
|
lg: "rh-px-input-x-lg rh-py-2.5 rh-text-base"
|
|
1510
1514
|
};
|
|
1515
|
+
var getSubtitleClassName2 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1511
1516
|
var ChevronIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
1512
1517
|
"svg",
|
|
1513
1518
|
{
|
|
@@ -1719,7 +1724,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1719
1724
|
children: [
|
|
1720
1725
|
label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
1721
1726
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
1722
|
-
subtitle && /* @__PURE__ */ jsx("span", { className:
|
|
1727
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName2(subtitle)}`, children: subtitle })
|
|
1723
1728
|
] }),
|
|
1724
1729
|
/* @__PURE__ */ jsxs(
|
|
1725
1730
|
"button",
|
|
@@ -2540,9 +2545,30 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
2540
2545
|
}
|
|
2541
2546
|
);
|
|
2542
2547
|
});
|
|
2543
|
-
var
|
|
2548
|
+
var THICKNESS_MAP = {
|
|
2549
|
+
xs: 2,
|
|
2550
|
+
sm: 4,
|
|
2551
|
+
md: 8,
|
|
2552
|
+
lg: 12,
|
|
2553
|
+
xl: 16
|
|
2554
|
+
};
|
|
2555
|
+
function resolveThickness(thickness) {
|
|
2556
|
+
if (typeof thickness === "number") return thickness;
|
|
2557
|
+
return THICKNESS_MAP[thickness];
|
|
2558
|
+
}
|
|
2559
|
+
var ProgressBar = forwardRef(function ProgressBar2({
|
|
2560
|
+
value,
|
|
2561
|
+
label,
|
|
2562
|
+
variant = "inline",
|
|
2563
|
+
thickness = "sm",
|
|
2564
|
+
showPercentage = true,
|
|
2565
|
+
barColor,
|
|
2566
|
+
bgColor,
|
|
2567
|
+
className = ""
|
|
2568
|
+
}, ref) {
|
|
2544
2569
|
const clampedValue = Math.min(100, Math.max(0, value));
|
|
2545
|
-
|
|
2570
|
+
const heightPx = resolveThickness(thickness);
|
|
2571
|
+
if (variant === "stacked") {
|
|
2546
2572
|
return /* @__PURE__ */ jsxs(
|
|
2547
2573
|
"div",
|
|
2548
2574
|
{
|
|
@@ -2559,8 +2585,8 @@ var ProgressBar = forwardRef(function ProgressBar2({ value, label, size = "sm",
|
|
|
2559
2585
|
/* @__PURE__ */ jsx(
|
|
2560
2586
|
"div",
|
|
2561
2587
|
{
|
|
2562
|
-
className: "rh-w-full rh-
|
|
2563
|
-
style: { backgroundColor: bgColor || "#E5E7EB" },
|
|
2588
|
+
className: "rh-w-full rh-rounded-[40px] rh-overflow-hidden",
|
|
2589
|
+
style: { backgroundColor: bgColor || "#E5E7EB", height: heightPx },
|
|
2564
2590
|
children: /* @__PURE__ */ jsx(
|
|
2565
2591
|
"div",
|
|
2566
2592
|
{
|
|
@@ -2586,8 +2612,8 @@ var ProgressBar = forwardRef(function ProgressBar2({ value, label, size = "sm",
|
|
|
2586
2612
|
/* @__PURE__ */ jsx(
|
|
2587
2613
|
"div",
|
|
2588
2614
|
{
|
|
2589
|
-
className: "rh-flex-1 rh-
|
|
2590
|
-
style: { backgroundColor: bgColor || "#E5E7EB" },
|
|
2615
|
+
className: "rh-flex-1 rh-rounded-[40px] rh-overflow-hidden",
|
|
2616
|
+
style: { backgroundColor: bgColor || "#E5E7EB", height: heightPx },
|
|
2591
2617
|
children: /* @__PURE__ */ jsx(
|
|
2592
2618
|
"div",
|
|
2593
2619
|
{
|