@rehagro/ui 1.0.9 → 1.0.11
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 +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +82 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -89
- package/dist/index.mjs.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +3 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -211,9 +211,12 @@ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAt
|
|
|
211
211
|
type TextInputStatus = "default" | "error";
|
|
212
212
|
type TextInputSize = "sm" | "md" | "lg";
|
|
213
213
|
type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
214
|
+
type TextInputLabelWeight = "normal" | "medium" | "semibold" | "bold";
|
|
214
215
|
type TextInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
215
216
|
/** Label text displayed above the input */
|
|
216
217
|
label?: string;
|
|
218
|
+
/** Label font weight */
|
|
219
|
+
labelWeight?: TextInputLabelWeight;
|
|
217
220
|
/** Subtitle displayed next to the label */
|
|
218
221
|
subtitle?: string;
|
|
219
222
|
/** Validation status */
|
|
@@ -234,6 +237,8 @@ type TextInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"
|
|
|
234
237
|
declare const TextInput: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
235
238
|
/** Label text displayed above the input */
|
|
236
239
|
label?: string;
|
|
240
|
+
/** Label font weight */
|
|
241
|
+
labelWeight?: TextInputLabelWeight;
|
|
237
242
|
/** Subtitle displayed next to the label */
|
|
238
243
|
subtitle?: string;
|
|
239
244
|
/** Validation status */
|
|
@@ -260,6 +265,8 @@ type CheckboxProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
260
265
|
label?: string;
|
|
261
266
|
/** Indeterminate state (partially checked) */
|
|
262
267
|
indeterminate?: boolean;
|
|
268
|
+
checked?: boolean;
|
|
269
|
+
defaultChecked?: boolean;
|
|
263
270
|
};
|
|
264
271
|
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
|
265
272
|
/** Checkbox size */
|
|
@@ -268,6 +275,8 @@ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTML
|
|
|
268
275
|
label?: string;
|
|
269
276
|
/** Indeterminate state (partially checked) */
|
|
270
277
|
indeterminate?: boolean;
|
|
278
|
+
checked?: boolean;
|
|
279
|
+
defaultChecked?: boolean;
|
|
271
280
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
272
281
|
|
|
273
282
|
type SelectSize = "sm" | "md" | "lg";
|
|
@@ -614,6 +623,8 @@ type TableProps<T> = Omit<React$1.HTMLAttributes<HTMLTableElement>, "children">
|
|
|
614
623
|
stickyHeader?: boolean;
|
|
615
624
|
/** Custom header row style */
|
|
616
625
|
headerStyle?: React$1.CSSProperties;
|
|
626
|
+
/** Custom header text class (overrides default rh-text-text-muted) */
|
|
627
|
+
headerTextClassName?: string;
|
|
617
628
|
};
|
|
618
629
|
declare const Table: <T>(props: TableProps<T> & {
|
|
619
630
|
ref?: React$1.ForwardedRef<HTMLTableElement>;
|
package/dist/index.d.ts
CHANGED
|
@@ -211,9 +211,12 @@ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAt
|
|
|
211
211
|
type TextInputStatus = "default" | "error";
|
|
212
212
|
type TextInputSize = "sm" | "md" | "lg";
|
|
213
213
|
type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
214
|
+
type TextInputLabelWeight = "normal" | "medium" | "semibold" | "bold";
|
|
214
215
|
type TextInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
215
216
|
/** Label text displayed above the input */
|
|
216
217
|
label?: string;
|
|
218
|
+
/** Label font weight */
|
|
219
|
+
labelWeight?: TextInputLabelWeight;
|
|
217
220
|
/** Subtitle displayed next to the label */
|
|
218
221
|
subtitle?: string;
|
|
219
222
|
/** Validation status */
|
|
@@ -234,6 +237,8 @@ type TextInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"
|
|
|
234
237
|
declare const TextInput: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
235
238
|
/** Label text displayed above the input */
|
|
236
239
|
label?: string;
|
|
240
|
+
/** Label font weight */
|
|
241
|
+
labelWeight?: TextInputLabelWeight;
|
|
237
242
|
/** Subtitle displayed next to the label */
|
|
238
243
|
subtitle?: string;
|
|
239
244
|
/** Validation status */
|
|
@@ -260,6 +265,8 @@ type CheckboxProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
260
265
|
label?: string;
|
|
261
266
|
/** Indeterminate state (partially checked) */
|
|
262
267
|
indeterminate?: boolean;
|
|
268
|
+
checked?: boolean;
|
|
269
|
+
defaultChecked?: boolean;
|
|
263
270
|
};
|
|
264
271
|
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
|
265
272
|
/** Checkbox size */
|
|
@@ -268,6 +275,8 @@ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTML
|
|
|
268
275
|
label?: string;
|
|
269
276
|
/** Indeterminate state (partially checked) */
|
|
270
277
|
indeterminate?: boolean;
|
|
278
|
+
checked?: boolean;
|
|
279
|
+
defaultChecked?: boolean;
|
|
271
280
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
272
281
|
|
|
273
282
|
type SelectSize = "sm" | "md" | "lg";
|
|
@@ -614,6 +623,8 @@ type TableProps<T> = Omit<React$1.HTMLAttributes<HTMLTableElement>, "children">
|
|
|
614
623
|
stickyHeader?: boolean;
|
|
615
624
|
/** Custom header row style */
|
|
616
625
|
headerStyle?: React$1.CSSProperties;
|
|
626
|
+
/** Custom header text class (overrides default rh-text-text-muted) */
|
|
627
|
+
headerTextClassName?: string;
|
|
617
628
|
};
|
|
618
629
|
declare const Table: <T>(props: TableProps<T> & {
|
|
619
630
|
ref?: React$1.ForwardedRef<HTMLTableElement>;
|
package/dist/index.js
CHANGED
|
@@ -940,8 +940,15 @@ var helperStatusClasses = {
|
|
|
940
940
|
default: "rh-text-text-muted",
|
|
941
941
|
error: "rh-text-danger"
|
|
942
942
|
};
|
|
943
|
+
var labelWeightClasses = {
|
|
944
|
+
normal: "rh-font-normal",
|
|
945
|
+
medium: "rh-font-medium",
|
|
946
|
+
semibold: "rh-font-semibold",
|
|
947
|
+
bold: "rh-font-bold"
|
|
948
|
+
};
|
|
943
949
|
var TextInput = React8.forwardRef(function TextInput2({
|
|
944
950
|
label,
|
|
951
|
+
labelWeight = "medium",
|
|
945
952
|
subtitle,
|
|
946
953
|
status = "default",
|
|
947
954
|
size = "md",
|
|
@@ -962,7 +969,7 @@ var TextInput = React8.forwardRef(function TextInput2({
|
|
|
962
969
|
className: ["rh-flex rh-flex-col rh-gap-[0.5rem] rh-font-sans", wrapperClassName].filter(Boolean).join(" "),
|
|
963
970
|
children: [
|
|
964
971
|
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
965
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
972
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${labelWeightClasses[labelWeight]} rh-text-text`, children: label }),
|
|
966
973
|
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
|
|
967
974
|
] }),
|
|
968
975
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1078,98 +1085,79 @@ var MinusIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1078
1085
|
fill: "none",
|
|
1079
1086
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1080
1087
|
"aria-hidden": "true",
|
|
1081
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1082
|
-
"path",
|
|
1083
|
-
{
|
|
1084
|
-
d: "M1 1H9",
|
|
1085
|
-
stroke: "currentColor",
|
|
1086
|
-
strokeWidth: "2",
|
|
1087
|
-
strokeLinecap: "round"
|
|
1088
|
-
}
|
|
1089
|
-
)
|
|
1088
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
1090
1089
|
}
|
|
1091
1090
|
);
|
|
1092
|
-
var Checkbox = React8.forwardRef(
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
children: [
|
|
1125
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1142
|
-
"span",
|
|
1143
|
-
{
|
|
1144
|
-
className: [
|
|
1145
|
-
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1146
|
-
"rh-border rh-border-border rh-rounded-xxs",
|
|
1147
|
-
"rh-transition-colors rh-duration-150",
|
|
1148
|
-
sizeClasses4[size],
|
|
1149
|
-
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1150
|
-
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1151
|
-
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
1152
|
-
].filter(Boolean).join(" "),
|
|
1153
|
-
"aria-hidden": "true",
|
|
1154
|
-
children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(MinusIcon, { className: iconSizeClasses2[size] }) : isChecked ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: iconSizeClasses2[size] }) : null
|
|
1155
|
-
}
|
|
1156
|
-
)
|
|
1157
|
-
] }),
|
|
1158
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1091
|
+
var Checkbox = React8.forwardRef(function Checkbox2({
|
|
1092
|
+
size = "md",
|
|
1093
|
+
label,
|
|
1094
|
+
indeterminate = false,
|
|
1095
|
+
disabled,
|
|
1096
|
+
checked,
|
|
1097
|
+
defaultChecked,
|
|
1098
|
+
className = "",
|
|
1099
|
+
id,
|
|
1100
|
+
onChange,
|
|
1101
|
+
...rest
|
|
1102
|
+
}, ref) {
|
|
1103
|
+
const innerRef = React8__default.default.useRef(null);
|
|
1104
|
+
const inputId = id || React8__default.default.useId();
|
|
1105
|
+
React8__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
1106
|
+
React8__default.default.useEffect(() => {
|
|
1107
|
+
if (innerRef.current) {
|
|
1108
|
+
innerRef.current.indeterminate = indeterminate;
|
|
1109
|
+
}
|
|
1110
|
+
}, [indeterminate]);
|
|
1111
|
+
const isChecked = checked ?? innerRef.current?.checked ?? defaultChecked ?? false;
|
|
1112
|
+
const isActive = isChecked || indeterminate;
|
|
1113
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1114
|
+
"label",
|
|
1115
|
+
{
|
|
1116
|
+
htmlFor: inputId,
|
|
1117
|
+
className: [
|
|
1118
|
+
"rh-inline-flex rh-items-center rh-gap-2 rh-font-sans rh-select-none",
|
|
1119
|
+
disabled ? "rh-cursor-not-allowed rh-opacity-50" : "rh-cursor-pointer",
|
|
1120
|
+
className
|
|
1121
|
+
].filter(Boolean).join(" "),
|
|
1122
|
+
children: [
|
|
1123
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-relative rh-inline-flex rh-items-center rh-justify-center", children: [
|
|
1124
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1125
|
+
"input",
|
|
1126
|
+
{
|
|
1127
|
+
ref: innerRef,
|
|
1128
|
+
id: inputId,
|
|
1129
|
+
type: "checkbox",
|
|
1130
|
+
disabled,
|
|
1131
|
+
checked,
|
|
1132
|
+
defaultChecked,
|
|
1133
|
+
"aria-checked": indeterminate ? "mixed" : void 0,
|
|
1134
|
+
onChange,
|
|
1135
|
+
className: "rh-peer rh-sr-only",
|
|
1136
|
+
...rest
|
|
1137
|
+
}
|
|
1138
|
+
),
|
|
1139
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1159
1140
|
"span",
|
|
1160
1141
|
{
|
|
1161
1142
|
className: [
|
|
1162
|
-
"rh-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1143
|
+
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1144
|
+
"rh-border rh-border-border rh-rounded-xxs",
|
|
1145
|
+
"rh-transition-colors rh-duration-150",
|
|
1146
|
+
sizeClasses4[size],
|
|
1147
|
+
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1148
|
+
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1149
|
+
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
1150
|
+
].filter(Boolean).join(" "),
|
|
1151
|
+
"aria-hidden": "true",
|
|
1152
|
+
children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(MinusIcon, { className: iconSizeClasses2[size] }) : isChecked ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: iconSizeClasses2[size] }) : null
|
|
1166
1153
|
}
|
|
1167
1154
|
)
|
|
1168
|
-
]
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
);
|
|
1155
|
+
] }),
|
|
1156
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["rh-text-text", labelSizeClasses[size]].join(" "), children: label })
|
|
1157
|
+
]
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
});
|
|
1173
1161
|
var statusClasses2 = {
|
|
1174
1162
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
1175
1163
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
@@ -2072,6 +2060,7 @@ var TagInput = React8.forwardRef(
|
|
|
2072
2060
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2073
2061
|
"div",
|
|
2074
2062
|
{
|
|
2063
|
+
onClick: disabled ? void 0 : handleAddClick,
|
|
2075
2064
|
className: [
|
|
2076
2065
|
"rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
|
|
2077
2066
|
"rh-border rh-bg-surface rh-font-sans",
|
|
@@ -2079,7 +2068,7 @@ var TagInput = React8.forwardRef(
|
|
|
2079
2068
|
statusClasses3[status],
|
|
2080
2069
|
radiusClasses5[radius],
|
|
2081
2070
|
sizeClasses9[size],
|
|
2082
|
-
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "",
|
|
2071
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2083
2072
|
className
|
|
2084
2073
|
].filter(Boolean).join(" "),
|
|
2085
2074
|
children: [
|
|
@@ -2099,7 +2088,10 @@ var TagInput = React8.forwardRef(
|
|
|
2099
2088
|
"button",
|
|
2100
2089
|
{
|
|
2101
2090
|
type: "button",
|
|
2102
|
-
onClick: () =>
|
|
2091
|
+
onClick: (e) => {
|
|
2092
|
+
e.stopPropagation();
|
|
2093
|
+
handleRemoveTag(tag.value);
|
|
2094
|
+
},
|
|
2103
2095
|
disabled,
|
|
2104
2096
|
className: [
|
|
2105
2097
|
"rh-flex rh-items-center rh-justify-center",
|
|
@@ -2620,6 +2612,7 @@ function TableInner({
|
|
|
2620
2612
|
loadingContent,
|
|
2621
2613
|
stickyHeader = false,
|
|
2622
2614
|
headerStyle,
|
|
2615
|
+
headerTextClassName,
|
|
2623
2616
|
className = "",
|
|
2624
2617
|
...rest
|
|
2625
2618
|
}, ref) {
|
|
@@ -2679,7 +2672,7 @@ function TableInner({
|
|
|
2679
2672
|
className: [
|
|
2680
2673
|
sizeClasses12[size].header,
|
|
2681
2674
|
alignClasses[column.align || "left"],
|
|
2682
|
-
|
|
2675
|
+
`rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
|
|
2683
2676
|
stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
|
|
2684
2677
|
column.sortable ? "rh-cursor-pointer rh-select-none hover:rh-text-text" : ""
|
|
2685
2678
|
].filter(Boolean).join(" "),
|