@rehagro/ui 1.0.6 → 1.0.8

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.js CHANGED
@@ -619,6 +619,10 @@ function RehagroProvider({ theme, toastPosition, children }) {
619
619
  vars[config.var] = value;
620
620
  }
621
621
  }
622
+ if (!theme.ring && theme.primary) {
623
+ const triplet = toRgbTriplet(theme.primary);
624
+ if (triplet) vars["--rh-ring"] = triplet;
625
+ }
622
626
  return vars;
623
627
  }, [theme]);
624
628
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-root", style, children: /* @__PURE__ */ jsxRuntime.jsx(ToastProvider, { position: toastPosition, children }) });
@@ -909,8 +913,8 @@ var IconButton = React8.forwardRef(function IconButton2({
909
913
  );
910
914
  });
911
915
  var statusClasses = {
912
- default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
913
- error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
916
+ default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring",
917
+ error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger"
914
918
  };
915
919
  var sizeClasses3 = {
916
920
  sm: "rh-h-input-sm rh-text-sm rh-px-input-x-sm",
@@ -936,113 +940,101 @@ var helperStatusClasses = {
936
940
  default: "rh-text-text-muted",
937
941
  error: "rh-text-danger"
938
942
  };
939
- var TextInput = React8.forwardRef(
940
- function TextInput2({
941
- label,
942
- subtitle,
943
- status = "default",
944
- size = "md",
945
- radius = "xs",
946
- leftIcon,
947
- rightIcon,
948
- helperText,
949
- disabled,
950
- className = "",
951
- wrapperClassName = "",
952
- id,
953
- ...rest
954
- }, ref) {
955
- const inputId = id || React8__default.default.useId();
956
- return /* @__PURE__ */ jsxRuntime.jsxs(
957
- "div",
958
- {
959
- className: [
960
- "rh-flex rh-flex-col rh-gap-1 rh-font-sans",
961
- wrapperClassName
962
- ].filter(Boolean).join(" "),
963
- children: [
964
- label && /* @__PURE__ */ jsxRuntime.jsxs(
965
- "label",
966
- {
967
- htmlFor: inputId,
968
- className: "rh-flex rh-items-baseline rh-gap-1",
969
- children: [
970
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
971
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
972
- ]
973
- }
974
- ),
975
- /* @__PURE__ */ jsxRuntime.jsxs(
976
- "div",
977
- {
978
- className: [
979
- "rh-flex rh-items-center rh-gap-2",
980
- "rh-border rh-bg-surface rh-font-sans",
981
- "rh-transition-colors rh-duration-150",
982
- statusClasses[status],
983
- radiusClasses3[radius],
984
- sizeClasses3[size],
985
- disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "",
986
- className
987
- ].filter(Boolean).join(" "),
988
- children: [
989
- leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
990
- "span",
991
- {
992
- className: [
993
- "rh-inline-flex rh-shrink-0 rh-text-text-muted",
994
- iconSizeClasses[size]
995
- ].join(" "),
996
- "aria-hidden": "true",
997
- children: leftIcon
998
- }
999
- ),
1000
- /* @__PURE__ */ jsxRuntime.jsx(
1001
- "input",
1002
- {
1003
- ref,
1004
- id: inputId,
1005
- disabled,
1006
- "aria-invalid": status === "error" || void 0,
1007
- "aria-describedby": helperText ? `${inputId}-helper` : void 0,
1008
- className: [
1009
- "rh-flex-1 rh-bg-transparent rh-outline-none",
1010
- "rh-text-text placeholder:rh-text-text-muted",
1011
- disabled ? "rh-cursor-not-allowed" : ""
1012
- ].filter(Boolean).join(" "),
1013
- ...rest
1014
- }
1015
- ),
1016
- rightIcon && /* @__PURE__ */ jsxRuntime.jsx(
1017
- "span",
1018
- {
1019
- className: [
1020
- "rh-inline-flex rh-shrink-0 rh-text-text-muted",
1021
- iconSizeClasses[size]
1022
- ].join(" "),
1023
- "aria-hidden": "true",
1024
- children: rightIcon
1025
- }
1026
- )
1027
- ]
1028
- }
1029
- ),
1030
- helperText && /* @__PURE__ */ jsxRuntime.jsx(
1031
- "span",
1032
- {
1033
- id: `${inputId}-helper`,
1034
- className: [
1035
- "rh-flex rh-items-center rh-gap-1 rh-text-xs",
1036
- helperStatusClasses[status]
1037
- ].join(" "),
1038
- children: helperText
1039
- }
1040
- )
1041
- ]
1042
- }
1043
- );
1044
- }
1045
- );
943
+ var TextInput = React8.forwardRef(function TextInput2({
944
+ label,
945
+ subtitle,
946
+ status = "default",
947
+ size = "md",
948
+ radius = "xs",
949
+ leftIcon,
950
+ rightIcon,
951
+ helperText,
952
+ disabled,
953
+ className = "",
954
+ wrapperClassName = "",
955
+ id,
956
+ ...rest
957
+ }, ref) {
958
+ const inputId = id || React8__default.default.useId();
959
+ return /* @__PURE__ */ jsxRuntime.jsxs(
960
+ "div",
961
+ {
962
+ className: ["rh-flex rh-flex-col rh-gap-[0.5rem] rh-font-sans", wrapperClassName].filter(Boolean).join(" "),
963
+ children: [
964
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
965
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
966
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-text-text-muted", children: subtitle })
967
+ ] }),
968
+ /* @__PURE__ */ jsxRuntime.jsxs(
969
+ "div",
970
+ {
971
+ className: [
972
+ "rh-flex rh-items-center rh-gap-2",
973
+ "rh-border rh-bg-surface rh-font-sans",
974
+ "rh-transition-colors rh-duration-150",
975
+ statusClasses[status],
976
+ radiusClasses3[radius],
977
+ sizeClasses3[size],
978
+ disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "",
979
+ className
980
+ ].filter(Boolean).join(" "),
981
+ children: [
982
+ leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
983
+ "span",
984
+ {
985
+ className: [
986
+ "rh-inline-flex rh-shrink-0 rh-text-text-muted",
987
+ iconSizeClasses[size]
988
+ ].join(" "),
989
+ "aria-hidden": "true",
990
+ children: leftIcon
991
+ }
992
+ ),
993
+ /* @__PURE__ */ jsxRuntime.jsx(
994
+ "input",
995
+ {
996
+ ref,
997
+ id: inputId,
998
+ disabled,
999
+ "aria-invalid": status === "error" || void 0,
1000
+ "aria-describedby": helperText ? `${inputId}-helper` : void 0,
1001
+ className: [
1002
+ "rh-flex-1 rh-bg-transparent rh-outline-none",
1003
+ "rh-text-text placeholder:rh-text-text-muted",
1004
+ disabled ? "rh-cursor-not-allowed" : ""
1005
+ ].filter(Boolean).join(" "),
1006
+ ...rest
1007
+ }
1008
+ ),
1009
+ rightIcon && /* @__PURE__ */ jsxRuntime.jsx(
1010
+ "span",
1011
+ {
1012
+ className: [
1013
+ "rh-inline-flex rh-shrink-0 rh-text-text-muted",
1014
+ iconSizeClasses[size]
1015
+ ].join(" "),
1016
+ "aria-hidden": "true",
1017
+ children: rightIcon
1018
+ }
1019
+ )
1020
+ ]
1021
+ }
1022
+ ),
1023
+ helperText && /* @__PURE__ */ jsxRuntime.jsx(
1024
+ "span",
1025
+ {
1026
+ id: `${inputId}-helper`,
1027
+ className: [
1028
+ "rh-flex rh-items-center rh-gap-1 rh-text-xs",
1029
+ helperStatusClasses[status]
1030
+ ].join(" "),
1031
+ children: helperText
1032
+ }
1033
+ )
1034
+ ]
1035
+ }
1036
+ );
1037
+ });
1046
1038
  var sizeClasses4 = {
1047
1039
  sm: "rh-h-4 rh-w-4",
1048
1040
  md: "rh-h-5 rh-w-5",