@hoddy-ui/next 2.0.3 → 2.0.4

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
@@ -689,64 +689,78 @@ var IconButton = ({
689
689
  /* @__PURE__ */ import_react8.default.createElement(IconComp, { style: { ...styles2.text, ...style }, name: icon, size })
690
690
  );
691
691
  };
692
- var Button = ({
693
- elevation = 0,
694
- onPress = () => {
695
- },
696
- disabled = false,
697
- title,
698
- loading,
699
- size = "normal",
700
- rounded = false,
701
- gutterBottom,
702
- style = {},
703
- fullWidth = false,
704
- translucent = false,
705
- color = "primary",
706
- variant = "contained",
707
- start,
708
- end
709
- }) => {
710
- const colors2 = useColors();
711
- const styles2 = import_react_native_size_matters6.ScaledSheet.create({
712
- con: {
713
- flexDirection: "row",
714
- alignItems: "center",
715
- alignSelf: "flex-start",
716
- justifyContent: "center",
717
- backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "2" : colors2.black[3] + "2" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
718
- borderRadius: rounded ? 30 : 10,
719
- elevation: variant === "text" ? 0 : elevation,
720
- paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
721
- paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
722
- borderColor: colors2[color].main,
723
- borderWidth: variant === "outlined" ? 1 : 0,
724
- shadowColor: "#000",
725
- shadowRadius: elevation,
726
- marginBottom: gutterBottom,
727
- shadowOffset: {
728
- height: elevation / 2,
729
- width: 0
692
+ var Button = (0, import_react8.forwardRef)(
693
+ ({
694
+ elevation = 0,
695
+ onPress = () => {
696
+ },
697
+ disabled = false,
698
+ title,
699
+ loading,
700
+ size = "normal",
701
+ rounded = false,
702
+ gutterBottom,
703
+ style = {},
704
+ fullWidth = false,
705
+ translucent = false,
706
+ color = "primary",
707
+ variant = "contained",
708
+ start,
709
+ end
710
+ }, ref) => {
711
+ const colors2 = useColors();
712
+ const styles2 = import_react_native_size_matters6.ScaledSheet.create({
713
+ con: {
714
+ flexDirection: "row",
715
+ alignItems: "center",
716
+ alignSelf: "flex-start",
717
+ justifyContent: "center",
718
+ backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "2" : colors2.black[3] + "2" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
719
+ borderRadius: rounded ? 30 : 10,
720
+ elevation: variant === "text" ? 0 : elevation,
721
+ paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
722
+ paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
723
+ borderColor: colors2[color].main,
724
+ borderWidth: variant === "outlined" ? 1 : 0,
725
+ shadowColor: "#000",
726
+ shadowRadius: elevation,
727
+ marginBottom: gutterBottom,
728
+ shadowOffset: {
729
+ height: elevation / 2,
730
+ width: 0
731
+ },
732
+ shadowOpacity: variant === "text" ? 0 : 0.3,
733
+ width: fullWidth ? "100%" : null,
734
+ ...style
730
735
  },
731
- shadowOpacity: variant === "text" ? 0 : 0.3,
732
- width: fullWidth ? "100%" : null,
733
- ...style
734
- },
735
- text: {
736
- color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
737
- fontWeight: variant === "outlined" ? "700" : "500",
738
- fontSize: size === "small" ? "12@ms" : "16@ms"
739
- }
740
- });
741
- return /* @__PURE__ */ import_react8.default.createElement(import_react_native8.TouchableOpacity, { onPress, disabled, style: styles2.con }, start, loading && /* @__PURE__ */ import_react8.default.createElement(
742
- import_react_native8.ActivityIndicator,
743
- {
744
- size: "small",
745
- color: colors2[color].text,
746
- style: { marginRight: 10 }
747
- }
748
- ), /* @__PURE__ */ import_react8.default.createElement(import_react_native8.Text, { style: styles2.text }, title), end);
749
- };
736
+ text: {
737
+ color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
738
+ fontWeight: variant === "outlined" ? "700" : "500",
739
+ fontSize: size === "small" ? "12@ms" : "16@ms"
740
+ }
741
+ });
742
+ return /* @__PURE__ */ import_react8.default.createElement(
743
+ import_react_native8.TouchableOpacity,
744
+ {
745
+ ref,
746
+ onPress,
747
+ disabled,
748
+ style: styles2.con
749
+ },
750
+ start,
751
+ loading && /* @__PURE__ */ import_react8.default.createElement(
752
+ import_react_native8.ActivityIndicator,
753
+ {
754
+ size: "small",
755
+ color: colors2[color].text,
756
+ style: { marginRight: 10 }
757
+ }
758
+ ),
759
+ /* @__PURE__ */ import_react8.default.createElement(import_react_native8.Text, { style: styles2.text }, title),
760
+ end
761
+ );
762
+ }
763
+ );
750
764
  var Button_default = Button;
751
765
 
752
766
  // ../src/Components/Checkbox.tsx