@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.mjs
CHANGED
|
@@ -1079,98 +1079,79 @@ var MinusIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
|
1079
1079
|
fill: "none",
|
|
1080
1080
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1081
1081
|
"aria-hidden": "true",
|
|
1082
|
-
children: /* @__PURE__ */ jsx(
|
|
1083
|
-
"path",
|
|
1084
|
-
{
|
|
1085
|
-
d: "M1 1H9",
|
|
1086
|
-
stroke: "currentColor",
|
|
1087
|
-
strokeWidth: "2",
|
|
1088
|
-
strokeLinecap: "round"
|
|
1089
|
-
}
|
|
1090
|
-
)
|
|
1082
|
+
children: /* @__PURE__ */ jsx("path", { d: "M1 1H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
1091
1083
|
}
|
|
1092
1084
|
);
|
|
1093
|
-
var Checkbox = forwardRef(
|
|
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
|
-
|
|
1125
|
-
children: [
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
/* @__PURE__ */ jsx(
|
|
1143
|
-
"span",
|
|
1144
|
-
{
|
|
1145
|
-
className: [
|
|
1146
|
-
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1147
|
-
"rh-border rh-border-border rh-rounded-xxs",
|
|
1148
|
-
"rh-transition-colors rh-duration-150",
|
|
1149
|
-
sizeClasses4[size],
|
|
1150
|
-
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1151
|
-
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1152
|
-
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
1153
|
-
].filter(Boolean).join(" "),
|
|
1154
|
-
"aria-hidden": "true",
|
|
1155
|
-
children: indeterminate ? /* @__PURE__ */ jsx(MinusIcon, { className: iconSizeClasses2[size] }) : isChecked ? /* @__PURE__ */ jsx(CheckIcon, { className: iconSizeClasses2[size] }) : null
|
|
1156
|
-
}
|
|
1157
|
-
)
|
|
1158
|
-
] }),
|
|
1159
|
-
label && /* @__PURE__ */ jsx(
|
|
1085
|
+
var Checkbox = forwardRef(function Checkbox2({
|
|
1086
|
+
size = "md",
|
|
1087
|
+
label,
|
|
1088
|
+
indeterminate = false,
|
|
1089
|
+
disabled,
|
|
1090
|
+
checked,
|
|
1091
|
+
defaultChecked,
|
|
1092
|
+
className = "",
|
|
1093
|
+
id,
|
|
1094
|
+
onChange,
|
|
1095
|
+
...rest
|
|
1096
|
+
}, ref) {
|
|
1097
|
+
const innerRef = React8.useRef(null);
|
|
1098
|
+
const inputId = id || React8.useId();
|
|
1099
|
+
React8.useImperativeHandle(ref, () => innerRef.current);
|
|
1100
|
+
React8.useEffect(() => {
|
|
1101
|
+
if (innerRef.current) {
|
|
1102
|
+
innerRef.current.indeterminate = indeterminate;
|
|
1103
|
+
}
|
|
1104
|
+
}, [indeterminate]);
|
|
1105
|
+
const isChecked = checked ?? innerRef.current?.checked ?? defaultChecked ?? false;
|
|
1106
|
+
const isActive = isChecked || indeterminate;
|
|
1107
|
+
return /* @__PURE__ */ jsxs(
|
|
1108
|
+
"label",
|
|
1109
|
+
{
|
|
1110
|
+
htmlFor: inputId,
|
|
1111
|
+
className: [
|
|
1112
|
+
"rh-inline-flex rh-items-center rh-gap-2 rh-font-sans rh-select-none",
|
|
1113
|
+
disabled ? "rh-cursor-not-allowed rh-opacity-50" : "rh-cursor-pointer",
|
|
1114
|
+
className
|
|
1115
|
+
].filter(Boolean).join(" "),
|
|
1116
|
+
children: [
|
|
1117
|
+
/* @__PURE__ */ jsxs("span", { className: "rh-relative rh-inline-flex rh-items-center rh-justify-center", children: [
|
|
1118
|
+
/* @__PURE__ */ jsx(
|
|
1119
|
+
"input",
|
|
1120
|
+
{
|
|
1121
|
+
ref: innerRef,
|
|
1122
|
+
id: inputId,
|
|
1123
|
+
type: "checkbox",
|
|
1124
|
+
disabled,
|
|
1125
|
+
checked,
|
|
1126
|
+
defaultChecked,
|
|
1127
|
+
"aria-checked": indeterminate ? "mixed" : void 0,
|
|
1128
|
+
onChange,
|
|
1129
|
+
className: "rh-peer rh-sr-only",
|
|
1130
|
+
...rest
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
/* @__PURE__ */ jsx(
|
|
1160
1134
|
"span",
|
|
1161
1135
|
{
|
|
1162
1136
|
className: [
|
|
1163
|
-
"rh-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1137
|
+
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1138
|
+
"rh-border rh-border-border rh-rounded-xxs",
|
|
1139
|
+
"rh-transition-colors rh-duration-150",
|
|
1140
|
+
sizeClasses4[size],
|
|
1141
|
+
isActive ? "rh-bg-primary rh-border-primary rh-text-surface" : "rh-bg-surface rh-text-transparent",
|
|
1142
|
+
!disabled && !isActive ? "hover:rh-border-primary" : "",
|
|
1143
|
+
"peer-focus-visible:rh-ring-2 peer-focus-visible:rh-ring-ring peer-focus-visible:rh-ring-offset-2"
|
|
1144
|
+
].filter(Boolean).join(" "),
|
|
1145
|
+
"aria-hidden": "true",
|
|
1146
|
+
children: indeterminate ? /* @__PURE__ */ jsx(MinusIcon, { className: iconSizeClasses2[size] }) : isChecked ? /* @__PURE__ */ jsx(CheckIcon, { className: iconSizeClasses2[size] }) : null
|
|
1167
1147
|
}
|
|
1168
1148
|
)
|
|
1169
|
-
]
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
);
|
|
1149
|
+
] }),
|
|
1150
|
+
label && /* @__PURE__ */ jsx("span", { className: ["rh-text-text", labelSizeClasses[size]].join(" "), children: label })
|
|
1151
|
+
]
|
|
1152
|
+
}
|
|
1153
|
+
);
|
|
1154
|
+
});
|
|
1174
1155
|
var statusClasses2 = {
|
|
1175
1156
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
1176
1157
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|