@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.mjs
CHANGED
|
@@ -741,30 +741,56 @@ var PRESET_COLORS = /* @__PURE__ */ new Set([
|
|
|
741
741
|
"info"
|
|
742
742
|
]);
|
|
743
743
|
var isPresetColor = (c) => PRESET_COLORS.has(c);
|
|
744
|
-
var
|
|
744
|
+
var variantBaseClasses = {
|
|
745
745
|
solid: {
|
|
746
|
-
primary: "rh-bg-primary rh-text-surface rh-border-primary
|
|
747
|
-
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary
|
|
748
|
-
danger: "rh-bg-danger rh-text-surface rh-border-danger
|
|
749
|
-
warning: "rh-bg-warning rh-text-surface rh-border-warning
|
|
750
|
-
success: "rh-bg-success rh-text-surface rh-border-success
|
|
751
|
-
info: "rh-bg-info rh-text-surface rh-border-info
|
|
746
|
+
primary: "rh-bg-primary rh-text-surface rh-border-primary",
|
|
747
|
+
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary",
|
|
748
|
+
danger: "rh-bg-danger rh-text-surface rh-border-danger",
|
|
749
|
+
warning: "rh-bg-warning rh-text-surface rh-border-warning",
|
|
750
|
+
success: "rh-bg-success rh-text-surface rh-border-success",
|
|
751
|
+
info: "rh-bg-info rh-text-surface rh-border-info"
|
|
752
752
|
},
|
|
753
753
|
outline: {
|
|
754
|
-
primary: "rh-bg-transparent rh-text-primary rh-border-primary
|
|
755
|
-
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary
|
|
756
|
-
danger: "rh-bg-transparent rh-text-danger rh-border-danger
|
|
757
|
-
warning: "rh-bg-transparent rh-text-warning rh-border-warning
|
|
758
|
-
success: "rh-bg-transparent rh-text-success rh-border-success
|
|
759
|
-
info: "rh-bg-transparent rh-text-info rh-border-info
|
|
754
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-primary",
|
|
755
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-secondary",
|
|
756
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-danger",
|
|
757
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-warning",
|
|
758
|
+
success: "rh-bg-transparent rh-text-success rh-border-success",
|
|
759
|
+
info: "rh-bg-transparent rh-text-info rh-border-info"
|
|
760
760
|
},
|
|
761
761
|
ghost: {
|
|
762
|
-
primary: "rh-bg-transparent rh-text-primary rh-border-transparent
|
|
763
|
-
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent
|
|
764
|
-
danger: "rh-bg-transparent rh-text-danger rh-border-transparent
|
|
765
|
-
warning: "rh-bg-transparent rh-text-warning rh-border-transparent
|
|
766
|
-
success: "rh-bg-transparent rh-text-success rh-border-transparent
|
|
767
|
-
info: "rh-bg-transparent rh-text-info rh-border-transparent
|
|
762
|
+
primary: "rh-bg-transparent rh-text-primary rh-border-transparent",
|
|
763
|
+
secondary: "rh-bg-transparent rh-text-secondary rh-border-transparent",
|
|
764
|
+
danger: "rh-bg-transparent rh-text-danger rh-border-transparent",
|
|
765
|
+
warning: "rh-bg-transparent rh-text-warning rh-border-transparent",
|
|
766
|
+
success: "rh-bg-transparent rh-text-success rh-border-transparent",
|
|
767
|
+
info: "rh-bg-transparent rh-text-info rh-border-transparent"
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
var variantHoverClasses = {
|
|
771
|
+
solid: {
|
|
772
|
+
primary: "hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
773
|
+
secondary: "hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
774
|
+
danger: "hover:rh-bg-danger-hover hover:rh-border-danger-hover",
|
|
775
|
+
warning: "hover:rh-bg-warning-hover hover:rh-border-warning-hover",
|
|
776
|
+
success: "hover:rh-bg-success-hover hover:rh-border-success-hover",
|
|
777
|
+
info: "hover:rh-bg-info-hover hover:rh-border-info-hover"
|
|
778
|
+
},
|
|
779
|
+
outline: {
|
|
780
|
+
primary: "hover:rh-bg-primary-subtle",
|
|
781
|
+
secondary: "hover:rh-bg-secondary-subtle",
|
|
782
|
+
danger: "hover:rh-bg-danger-subtle",
|
|
783
|
+
warning: "hover:rh-bg-warning-subtle",
|
|
784
|
+
success: "hover:rh-bg-success-subtle",
|
|
785
|
+
info: "hover:rh-bg-info-subtle"
|
|
786
|
+
},
|
|
787
|
+
ghost: {
|
|
788
|
+
primary: "hover:rh-bg-primary/10",
|
|
789
|
+
secondary: "hover:rh-bg-secondary/10",
|
|
790
|
+
danger: "hover:rh-bg-danger/10",
|
|
791
|
+
warning: "hover:rh-bg-warning/10",
|
|
792
|
+
success: "hover:rh-bg-success/10",
|
|
793
|
+
info: "hover:rh-bg-info/10"
|
|
768
794
|
}
|
|
769
795
|
};
|
|
770
796
|
function getArbitraryColorStyle(variant, color) {
|
|
@@ -828,7 +854,8 @@ var Button = forwardRef(function Button2({
|
|
|
828
854
|
"rh-border rh-font-display rh-font-medium",
|
|
829
855
|
"rh-transition-colors rh-duration-150",
|
|
830
856
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
831
|
-
preset
|
|
857
|
+
preset ? variantBaseClasses[variant][color] : "",
|
|
858
|
+
preset && !hasCustomHover ? variantHoverClasses[variant][color] : "",
|
|
832
859
|
!preset && !hasCustomHover ? "hover:rh-brightness-90" : "",
|
|
833
860
|
hasCustomHover ? "btn-custom-hover" : "",
|
|
834
861
|
sizeClasses[size],
|
|
@@ -885,7 +912,7 @@ var PRESET_COLORS2 = /* @__PURE__ */ new Set([
|
|
|
885
912
|
"info"
|
|
886
913
|
]);
|
|
887
914
|
var isPresetColor2 = (c) => PRESET_COLORS2.has(c);
|
|
888
|
-
var
|
|
915
|
+
var variantColorClasses = {
|
|
889
916
|
solid: {
|
|
890
917
|
primary: "rh-bg-primary rh-text-surface rh-border-primary hover:rh-bg-primary-hover hover:rh-border-primary-hover",
|
|
891
918
|
secondary: "rh-bg-secondary rh-text-surface rh-border-secondary hover:rh-bg-secondary-hover hover:rh-border-secondary-hover",
|
|
@@ -961,7 +988,7 @@ var IconButton = forwardRef(function IconButton2({
|
|
|
961
988
|
"rh-border rh-font-display",
|
|
962
989
|
"rh-transition-colors rh-duration-150",
|
|
963
990
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring focus-visible:rh-ring-offset-2",
|
|
964
|
-
preset ?
|
|
991
|
+
preset ? variantColorClasses[variant][color] : "hover:rh-brightness-90",
|
|
965
992
|
sizeClasses2[size],
|
|
966
993
|
radiusClasses2[radius],
|
|
967
994
|
isDisabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|