@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.mjs CHANGED
@@ -551,7 +551,7 @@ var Avatar_default = Avatar;
551
551
 
552
552
  // ../src/Components/Button.tsx
553
553
  import { Ionicons, MaterialIcons as MaterialIcons2 } from "@expo/vector-icons";
554
- import React8 from "react";
554
+ import React8, { forwardRef } from "react";
555
555
  import { ActivityIndicator, Text as Text2, TouchableOpacity as TouchableOpacity2 } from "react-native";
556
556
  import { ScaledSheet as ScaledSheet4, moderateScale as moderateScale2 } from "react-native-size-matters";
557
557
  var LinkButton = ({
@@ -628,64 +628,78 @@ var IconButton = ({
628
628
  /* @__PURE__ */ React8.createElement(IconComp, { style: { ...styles2.text, ...style }, name: icon, size })
629
629
  );
630
630
  };
631
- var Button = ({
632
- elevation = 0,
633
- onPress = () => {
634
- },
635
- disabled = false,
636
- title,
637
- loading,
638
- size = "normal",
639
- rounded = false,
640
- gutterBottom,
641
- style = {},
642
- fullWidth = false,
643
- translucent = false,
644
- color = "primary",
645
- variant = "contained",
646
- start,
647
- end
648
- }) => {
649
- const colors2 = useColors();
650
- const styles2 = ScaledSheet4.create({
651
- con: {
652
- flexDirection: "row",
653
- alignItems: "center",
654
- alignSelf: "flex-start",
655
- justifyContent: "center",
656
- 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,
657
- borderRadius: rounded ? 30 : 10,
658
- elevation: variant === "text" ? 0 : elevation,
659
- paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
660
- paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
661
- borderColor: colors2[color].main,
662
- borderWidth: variant === "outlined" ? 1 : 0,
663
- shadowColor: "#000",
664
- shadowRadius: elevation,
665
- marginBottom: gutterBottom,
666
- shadowOffset: {
667
- height: elevation / 2,
668
- width: 0
631
+ var Button = forwardRef(
632
+ ({
633
+ elevation = 0,
634
+ onPress = () => {
635
+ },
636
+ disabled = false,
637
+ title,
638
+ loading,
639
+ size = "normal",
640
+ rounded = false,
641
+ gutterBottom,
642
+ style = {},
643
+ fullWidth = false,
644
+ translucent = false,
645
+ color = "primary",
646
+ variant = "contained",
647
+ start,
648
+ end
649
+ }, ref) => {
650
+ const colors2 = useColors();
651
+ const styles2 = ScaledSheet4.create({
652
+ con: {
653
+ flexDirection: "row",
654
+ alignItems: "center",
655
+ alignSelf: "flex-start",
656
+ justifyContent: "center",
657
+ 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,
658
+ borderRadius: rounded ? 30 : 10,
659
+ elevation: variant === "text" ? 0 : elevation,
660
+ paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
661
+ paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
662
+ borderColor: colors2[color].main,
663
+ borderWidth: variant === "outlined" ? 1 : 0,
664
+ shadowColor: "#000",
665
+ shadowRadius: elevation,
666
+ marginBottom: gutterBottom,
667
+ shadowOffset: {
668
+ height: elevation / 2,
669
+ width: 0
670
+ },
671
+ shadowOpacity: variant === "text" ? 0 : 0.3,
672
+ width: fullWidth ? "100%" : null,
673
+ ...style
669
674
  },
670
- shadowOpacity: variant === "text" ? 0 : 0.3,
671
- width: fullWidth ? "100%" : null,
672
- ...style
673
- },
674
- text: {
675
- color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
676
- fontWeight: variant === "outlined" ? "700" : "500",
677
- fontSize: size === "small" ? "12@ms" : "16@ms"
678
- }
679
- });
680
- return /* @__PURE__ */ React8.createElement(TouchableOpacity2, { onPress, disabled, style: styles2.con }, start, loading && /* @__PURE__ */ React8.createElement(
681
- ActivityIndicator,
682
- {
683
- size: "small",
684
- color: colors2[color].text,
685
- style: { marginRight: 10 }
686
- }
687
- ), /* @__PURE__ */ React8.createElement(Text2, { style: styles2.text }, title), end);
688
- };
675
+ text: {
676
+ color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
677
+ fontWeight: variant === "outlined" ? "700" : "500",
678
+ fontSize: size === "small" ? "12@ms" : "16@ms"
679
+ }
680
+ });
681
+ return /* @__PURE__ */ React8.createElement(
682
+ TouchableOpacity2,
683
+ {
684
+ ref,
685
+ onPress,
686
+ disabled,
687
+ style: styles2.con
688
+ },
689
+ start,
690
+ loading && /* @__PURE__ */ React8.createElement(
691
+ ActivityIndicator,
692
+ {
693
+ size: "small",
694
+ color: colors2[color].text,
695
+ style: { marginRight: 10 }
696
+ }
697
+ ),
698
+ /* @__PURE__ */ React8.createElement(Text2, { style: styles2.text }, title),
699
+ end
700
+ );
701
+ }
702
+ );
689
703
  var Button_default = Button;
690
704
 
691
705
  // ../src/Components/Checkbox.tsx