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