@rehagro/ui 1.0.10 → 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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +66 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -85
- 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
|
@@ -265,6 +265,8 @@ type CheckboxProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
265
265
|
label?: string;
|
|
266
266
|
/** Indeterminate state (partially checked) */
|
|
267
267
|
indeterminate?: boolean;
|
|
268
|
+
checked?: boolean;
|
|
269
|
+
defaultChecked?: boolean;
|
|
268
270
|
};
|
|
269
271
|
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
|
270
272
|
/** Checkbox size */
|
|
@@ -273,6 +275,8 @@ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTML
|
|
|
273
275
|
label?: string;
|
|
274
276
|
/** Indeterminate state (partially checked) */
|
|
275
277
|
indeterminate?: boolean;
|
|
278
|
+
checked?: boolean;
|
|
279
|
+
defaultChecked?: boolean;
|
|
276
280
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
277
281
|
|
|
278
282
|
type SelectSize = "sm" | "md" | "lg";
|
package/dist/index.d.ts
CHANGED
|
@@ -265,6 +265,8 @@ type CheckboxProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
265
265
|
label?: string;
|
|
266
266
|
/** Indeterminate state (partially checked) */
|
|
267
267
|
indeterminate?: boolean;
|
|
268
|
+
checked?: boolean;
|
|
269
|
+
defaultChecked?: boolean;
|
|
268
270
|
};
|
|
269
271
|
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
|
270
272
|
/** Checkbox size */
|
|
@@ -273,6 +275,8 @@ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTML
|
|
|
273
275
|
label?: string;
|
|
274
276
|
/** Indeterminate state (partially checked) */
|
|
275
277
|
indeterminate?: boolean;
|
|
278
|
+
checked?: boolean;
|
|
279
|
+
defaultChecked?: boolean;
|
|
276
280
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
277
281
|
|
|
278
282
|
type SelectSize = "sm" | "md" | "lg";
|
package/dist/index.js
CHANGED
|
@@ -1085,98 +1085,79 @@ var MinusIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1085
1085
|
fill: "none",
|
|
1086
1086
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1087
1087
|
"aria-hidden": "true",
|
|
1088
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1089
|
-
"path",
|
|
1090
|
-
{
|
|
1091
|
-
d: "M1 1H9",
|
|
1092
|
-
stroke: "currentColor",
|
|
1093
|
-
strokeWidth: "2",
|
|
1094
|
-
strokeLinecap: "round"
|
|
1095
|
-
}
|
|
1096
|
-
)
|
|
1088
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 1H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
1097
1089
|
}
|
|
1098
1090
|
);
|
|
1099
|
-
var Checkbox = React8.forwardRef(
|
|
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
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
children: [
|
|
1132
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1149
|
-
"span",
|
|
1150
|
-
{
|
|
1151
|
-
className: [
|
|
1152
|
-
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1153
|
-
"rh-border rh-border-border rh-rounded-xxs",
|
|
1154
|
-
"rh-transition-colors rh-duration-150",
|
|
1155
|
-
sizeClasses4[size],
|
|
1156
|
-
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1157
|
-
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1158
|
-
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
1159
|
-
].filter(Boolean).join(" "),
|
|
1160
|
-
"aria-hidden": "true",
|
|
1161
|
-
children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(MinusIcon, { className: iconSizeClasses2[size] }) : isChecked ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: iconSizeClasses2[size] }) : null
|
|
1162
|
-
}
|
|
1163
|
-
)
|
|
1164
|
-
] }),
|
|
1165
|
-
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(
|
|
1166
1140
|
"span",
|
|
1167
1141
|
{
|
|
1168
1142
|
className: [
|
|
1169
|
-
"rh-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
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
|
|
1173
1153
|
}
|
|
1174
1154
|
)
|
|
1175
|
-
]
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
);
|
|
1155
|
+
] }),
|
|
1156
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["rh-text-text", labelSizeClasses[size]].join(" "), children: label })
|
|
1157
|
+
]
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
});
|
|
1180
1161
|
var statusClasses2 = {
|
|
1181
1162
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
1182
1163
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|