@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.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
- function Checkbox2({
1095
- size = "md",
1096
- label,
1097
- indeterminate = false,
1098
- disabled,
1099
- checked,
1100
- defaultChecked,
1101
- className = "",
1102
- id,
1103
- onChange,
1104
- ...rest
1105
- }, ref) {
1106
- const innerRef = React8.useRef(null);
1107
- const inputId = id || React8.useId();
1108
- React8.useImperativeHandle(ref, () => innerRef.current);
1109
- React8.useEffect(() => {
1110
- if (innerRef.current) {
1111
- innerRef.current.indeterminate = indeterminate;
1112
- }
1113
- }, [indeterminate]);
1114
- const isChecked = checked ?? innerRef.current?.checked ?? defaultChecked ?? false;
1115
- const isActive = isChecked || indeterminate;
1116
- return /* @__PURE__ */ jsxs(
1117
- "label",
1118
- {
1119
- htmlFor: inputId,
1120
- className: [
1121
- "rh-inline-flex rh-items-center rh-gap-2 rh-font-sans rh-select-none",
1122
- disabled ? "rh-cursor-not-allowed rh-opacity-50" : "rh-cursor-pointer",
1123
- className
1124
- ].filter(Boolean).join(" "),
1125
- children: [
1126
- /* @__PURE__ */ jsxs("span", { className: "rh-relative rh-inline-flex rh-items-center rh-justify-center", children: [
1127
- /* @__PURE__ */ jsx(
1128
- "input",
1129
- {
1130
- ref: innerRef,
1131
- id: inputId,
1132
- type: "checkbox",
1133
- disabled,
1134
- checked,
1135
- defaultChecked,
1136
- "aria-checked": indeterminate ? "mixed" : void 0,
1137
- onChange,
1138
- className: "rh-peer rh-sr-only",
1139
- ...rest
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-text-text",
1164
- labelSizeClasses[size]
1165
- ].join(" "),
1166
- children: label
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"