dhre-ui-kit 0.0.303 → 0.0.305

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/lib/index.mjs CHANGED
@@ -2090,8 +2090,7 @@ const styles$l = StyleSheet.create({
2090
2090
  color: "#fff"
2091
2091
  },
2092
2092
  subContainer: {
2093
- paddingHorizontal: horizontalScale(12),
2094
- marginTop: verticalScale(8)
2093
+ paddingHorizontal: horizontalScale(12)
2095
2094
  },
2096
2095
  subButtonText: {
2097
2096
  textDecorationLine: "underline",
@@ -2111,8 +2110,10 @@ const Toast = React.forwardRef(
2111
2110
  const [height, setHeight] = useState(72);
2112
2111
  const [onSubBtnPress, setOnSubBtnPress] = useState(null);
2113
2112
  const [subjectText, setSubjectText] = useState(null);
2113
+ const [warning, setWarning] = useState(false);
2114
+ const [toastStyle, setToastStyle] = useState();
2114
2115
  const bottom = useRef(new Animated.Value(-80)).current;
2115
- const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null) => {
2116
+ const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false, tostContainerStyle) => {
2116
2117
  setMessage(toastMessage);
2117
2118
  setIsSuccess(success);
2118
2119
  setBtnText(buttonText);
@@ -2121,6 +2122,8 @@ const Toast = React.forwardRef(
2121
2122
  setHeight(height2);
2122
2123
  setSubjectText(subText);
2123
2124
  setOnSubBtnPress(() => subTextPress);
2125
+ setWarning(warning2);
2126
+ setToastStyle(tostContainerStyle);
2124
2127
  Animated.timing(bottom, {
2125
2128
  toValue: 20,
2126
2129
  duration: 500,
@@ -2160,11 +2163,12 @@ const Toast = React.forwardRef(
2160
2163
  styles$l.container,
2161
2164
  { bottom },
2162
2165
  { backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
2163
- { height: verticalScale(height) }
2166
+ { height: verticalScale(height) },
2167
+ toastStyle
2164
2168
  ],
2165
2169
  testID: "TOAST"
2166
2170
  },
2167
- /* @__PURE__ */ React.createElement(View, { style: styles$l.toastContainer }, /* @__PURE__ */ React.createElement(View, { style: styles$l.innerContainer }, /* @__PURE__ */ React.createElement(Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : errorIcon ? errorIcon : warningIcon), /* @__PURE__ */ React.createElement(
2171
+ /* @__PURE__ */ React.createElement(View, { style: styles$l.toastContainer }, /* @__PURE__ */ React.createElement(View, { style: styles$l.innerContainer }, /* @__PURE__ */ React.createElement(Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : warning ? warningIcon : errorIcon), /* @__PURE__ */ React.createElement(
2168
2172
  CustomTypography,
2169
2173
  {
2170
2174
  variant: "L2_REGULAR",
@@ -3775,7 +3779,7 @@ class ToastService {
3775
3779
  setRef(ref) {
3776
3780
  this.toastRef = ref;
3777
3781
  }
3778
- showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72) {
3782
+ showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false, tostContainerStyle = {}) {
3779
3783
  if (this.toastRef) {
3780
3784
  this.toastRef.showToast(
3781
3785
  message,
@@ -3783,7 +3787,11 @@ class ToastService {
3783
3787
  isSuccess,
3784
3788
  buttonText,
3785
3789
  buttonAction,
3786
- height
3790
+ height,
3791
+ subText,
3792
+ subTextPress,
3793
+ warning,
3794
+ tostContainerStyle
3787
3795
  );
3788
3796
  }
3789
3797
  }