@rehagro/ui 1.0.33 → 1.0.34
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 +49 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -747,30 +747,56 @@ var PRESET_COLORS = /* @__PURE__ */ new Set([
|
|
|
747
747
|
"info"
|
|
748
748
|
]);
|
|
749
749
|
var isPresetColor = (c) => PRESET_COLORS.has(c);
|
|
750
|
-
var
|
|
750
|
+
var variantBaseClasses = {
|
|
751
751
|
solid: {
|
|
752
|
-
primary: "rh-bg-primary rh-text-surface rh-border-primary
|
|
753
|
-
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary
|
|
754
|
-
danger: "rh-bg-danger rh-text-surface rh-border-danger
|
|
755
|
-
warning: "rh-bg-warning rh-text-surface rh-border-warning
|
|
756
|
-
success: "rh-bg-success rh-text-surface rh-border-success
|
|
757
|
-
info: "rh-bg-info rh-text-surface rh-border-info
|
|
752
|
+
primary: "rh-bg-primary rh-text-surface rh-border-primary",
|
|
753
|
+
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary",
|
|
754
|
+
danger: "rh-bg-danger rh-text-surface rh-border-danger",
|
|
755
|
+
warning: "rh-bg-warning rh-text-surface rh-border-warning",
|
|
756
|
+
success: "rh-bg-success rh-text-surface rh-border-success",
|
|
757
|
+
info: "rh-bg-info rh-text-surface rh-border-info"
|
|
758
758
|
},
|
|
759
759
|
outline: {
|
|
760
|
-
primary: "rh-bg-transparent rh-text-primary rh-border-primary
|
|
761
|
-
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary
|
|
762
|
-
danger: "rh-bg-transparent rh-text-danger rh-border-danger
|
|
763
|
-
warning: "rh-bg-transparent rh-text-warning rh-border-warning
|
|
764
|
-
success: "rh-bg-transparent rh-text-success rh-border-success
|
|
765
|
-
info: "rh-bg-transparent rh-text-info rh-border-info
|
|
760
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-primary",
|
|
761
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary",
|
|
762
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-danger",
|
|
763
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-warning",
|
|
764
|
+
success: "rh-bg-transparent rh-text-success rh-border-success",
|
|
765
|
+
info: "rh-bg-transparent rh-text-info rh-border-info"
|
|
766
766
|
},
|
|
767
767
|
ghost: {
|
|
768
|
-
primary: "rh-bg-transparent rh-text-primary rh-border-transparent
|
|
769
|
-
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent
|
|
770
|
-
danger: "rh-bg-transparent rh-text-danger rh-border-transparent
|
|
771
|
-
warning: "rh-bg-transparent rh-text-warning rh-border-transparent
|
|
772
|
-
success: "rh-bg-transparent rh-text-success rh-border-transparent
|
|
773
|
-
info: "rh-bg-transparent rh-text-info rh-border-transparent
|
|
768
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-transparent",
|
|
769
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent",
|
|
770
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-transparent",
|
|
771
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-transparent",
|
|
772
|
+
success: "rh-bg-transparent rh-text-success rh-border-transparent",
|
|
773
|
+
info: "rh-bg-transparent rh-text-info rh-border-transparent"
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
var variantHoverClasses = {
|
|
777
|
+
solid: {
|
|
778
|
+
primary: "hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
779
|
+
secondary: "hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
780
|
+
danger: "hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
781
|
+
warning: "hover:rh-bg-warning-hover hover:rh-border-warning-hover",
|
|
782
|
+
success: "hover:rh-bg-success-hover hover:rh-border-success-hover",
|
|
783
|
+
info: "hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
784
|
+
},
|
|
785
|
+
outline: {
|
|
786
|
+
primary: "hover:rh-bg-primary-subtle",
|
|
787
|
+
secondary: "hover:rh-bg-secondary-subtle",
|
|
788
|
+
danger: "hover:rh-bg-danger-subtle",
|
|
789
|
+
warning: "hover:rh-bg-warning-subtle",
|
|
790
|
+
success: "hover:rh-bg-success-subtle",
|
|
791
|
+
info: "hover:rh-bg-info-subtle"
|
|
792
|
+
},
|
|
793
|
+
ghost: {
|
|
794
|
+
primary: "hover:rh-bg-primary/10",
|
|
795
|
+
secondary: "hover:rh-bg-secondary/10",
|
|
796
|
+
danger: "hover:rh-bg-danger/10",
|
|
797
|
+
warning: "hover:rh-bg-warning/10",
|
|
798
|
+
success: "hover:rh-bg-success/10",
|
|
799
|
+
info: "hover:rh-bg-info/10"
|
|
774
800
|
}
|
|
775
801
|
};
|
|
776
802
|
function getArbitraryColorStyle(variant, color) {
|
|
@@ -834,7 +860,8 @@ var Button = React9.forwardRef(function Button2({
|
|
|
834
860
|
"rh-border rh-font-display rh-font-medium",
|
|
835
861
|
"rh-transition-colors rh-duration-150",
|
|
836
862
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
837
|
-
preset
|
|
863
|
+
preset ? variantBaseClasses[variant][color] : "",
|
|
864
|
+
preset && !hasCustomHover ? variantHoverClasses[variant][color] : "",
|
|
838
865
|
!preset && !hasCustomHover ? "hover:rh-brightness-90" : "",
|
|
839
866
|
hasCustomHover ? "btn-custom-hover" : "",
|
|
840
867
|
sizeClasses[size],
|
|
@@ -891,7 +918,7 @@ var PRESET_COLORS2 = /* @__PURE__ */ new Set([
|
|
|
891
918
|
"info"
|
|
892
919
|
]);
|
|
893
920
|
var isPresetColor2 = (c) => PRESET_COLORS2.has(c);
|
|
894
|
-
var
|
|
921
|
+
var variantColorClasses = {
|
|
895
922
|
solid: {
|
|
896
923
|
primary: "rh-bg-primary rh-text-surface rh-border-primary hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
897
924
|
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
@@ -967,7 +994,7 @@ var IconButton = React9.forwardRef(function IconButton2({
|
|
|
967
994
|
"rh-border rh-font-display",
|
|
968
995
|
"rh-transition-colors rh-duration-150",
|
|
969
996
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
970
|
-
preset ?
|
|
997
|
+
preset ? variantColorClasses[variant][color] : "hover:rh-brightness-90",
|
|
971
998
|
sizeClasses2[size],
|
|
972
999
|
radiusClasses2[radius],
|
|
973
1000
|
isDisabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|