dhre-ui-kit 0.0.302 → 0.0.304

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
@@ -2111,8 +2111,10 @@ const Toast = React.forwardRef(
2111
2111
  const [height, setHeight] = useState(72);
2112
2112
  const [onSubBtnPress, setOnSubBtnPress] = useState(null);
2113
2113
  const [subjectText, setSubjectText] = useState(null);
2114
+ const [warning, setWarning] = useState(false);
2115
+ const [toastStyle, setToastStyle] = useState();
2114
2116
  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) => {
2117
+ const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false, tostContainerStyle) => {
2116
2118
  setMessage(toastMessage);
2117
2119
  setIsSuccess(success);
2118
2120
  setBtnText(buttonText);
@@ -2121,6 +2123,8 @@ const Toast = React.forwardRef(
2121
2123
  setHeight(height2);
2122
2124
  setSubjectText(subText);
2123
2125
  setOnSubBtnPress(() => subTextPress);
2126
+ setWarning(warning2);
2127
+ setToastStyle(tostContainerStyle);
2124
2128
  Animated.timing(bottom, {
2125
2129
  toValue: 20,
2126
2130
  duration: 500,
@@ -2160,11 +2164,12 @@ const Toast = React.forwardRef(
2160
2164
  styles$l.container,
2161
2165
  { bottom },
2162
2166
  { backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
2163
- { height: verticalScale(height) }
2167
+ { height: verticalScale(height) },
2168
+ toastStyle
2164
2169
  ],
2165
2170
  testID: "TOAST"
2166
2171
  },
2167
- /* @__PURE__ */ React.createElement(View, null, /* @__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(
2172
+ /* @__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
2173
  CustomTypography,
2169
2174
  {
2170
2175
  variant: "L2_REGULAR",
@@ -2186,7 +2191,8 @@ const Toast = React.forwardRef(
2186
2191
  style: styles$l.buttonText
2187
2192
  }
2188
2193
  )
2189
- ))), subjectText && /* @__PURE__ */ React.createElement(View, { style: styles$l.subContainer }, /* @__PURE__ */ React.createElement(
2194
+ ))),
2195
+ subjectText && /* @__PURE__ */ React.createElement(View, { style: styles$l.subContainer }, /* @__PURE__ */ React.createElement(
2190
2196
  Pressable,
2191
2197
  {
2192
2198
  style: styles$l.button,
@@ -2201,7 +2207,7 @@ const Toast = React.forwardRef(
2201
2207
  style: styles$l.subButtonText
2202
2208
  }
2203
2209
  )
2204
- ))),
2210
+ )),
2205
2211
  /* @__PURE__ */ React.createElement(
2206
2212
  Progress.Bar,
2207
2213
  {
@@ -3774,7 +3780,7 @@ class ToastService {
3774
3780
  setRef(ref) {
3775
3781
  this.toastRef = ref;
3776
3782
  }
3777
- showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72) {
3783
+ showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false, tostContainerStyle = {}) {
3778
3784
  if (this.toastRef) {
3779
3785
  this.toastRef.showToast(
3780
3786
  message,
@@ -3782,7 +3788,11 @@ class ToastService {
3782
3788
  isSuccess,
3783
3789
  buttonText,
3784
3790
  buttonAction,
3785
- height
3791
+ height,
3792
+ subText,
3793
+ subTextPress,
3794
+ warning,
3795
+ tostContainerStyle
3786
3796
  );
3787
3797
  }
3788
3798
  }