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.d.ts CHANGED
@@ -379,10 +379,10 @@ interface ToastProps {
379
379
  warningIcon: React$1.ReactElement;
380
380
  }
381
381
  interface ToastRef {
382
- showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null) => void;
382
+ showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean, tostContainerStyle?: ViewStyle) => void;
383
383
  }
384
384
  interface ToastRef {
385
- showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null) => void;
385
+ showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean, tostContainerStyle?: ViewStyle) => void;
386
386
  }
387
387
  interface ToastServiceInterface {
388
388
  setRef: (ref: ToastRef | null) => void;
@@ -679,7 +679,7 @@ declare const CustomSwitchBtn: ({ value, onValueChange, disabled, activeText, ac
679
679
  declare class ToastService implements ToastServiceInterface {
680
680
  private toastRef;
681
681
  setRef(ref: ToastRef | null): void;
682
- showToast(message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number): void;
682
+ showToast(message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean, tostContainerStyle?: ViewStyle): void;
683
683
  }
684
684
  declare const toastService: ToastService;
685
685
 
package/lib/index.js CHANGED
@@ -2127,8 +2127,7 @@ const styles$l = reactNative.StyleSheet.create({
2127
2127
  color: "#fff"
2128
2128
  },
2129
2129
  subContainer: {
2130
- paddingHorizontal: horizontalScale(12),
2131
- marginTop: verticalScale(8)
2130
+ paddingHorizontal: horizontalScale(12)
2132
2131
  },
2133
2132
  subButtonText: {
2134
2133
  textDecorationLine: "underline",
@@ -2148,8 +2147,10 @@ const Toast = React__default["default"].forwardRef(
2148
2147
  const [height, setHeight] = React.useState(72);
2149
2148
  const [onSubBtnPress, setOnSubBtnPress] = React.useState(null);
2150
2149
  const [subjectText, setSubjectText] = React.useState(null);
2150
+ const [warning, setWarning] = React.useState(false);
2151
+ const [toastStyle, setToastStyle] = React.useState();
2151
2152
  const bottom = React.useRef(new reactNative.Animated.Value(-80)).current;
2152
- const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null) => {
2153
+ const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false, tostContainerStyle) => {
2153
2154
  setMessage(toastMessage);
2154
2155
  setIsSuccess(success);
2155
2156
  setBtnText(buttonText);
@@ -2158,6 +2159,8 @@ const Toast = React__default["default"].forwardRef(
2158
2159
  setHeight(height2);
2159
2160
  setSubjectText(subText);
2160
2161
  setOnSubBtnPress(() => subTextPress);
2162
+ setWarning(warning2);
2163
+ setToastStyle(tostContainerStyle);
2161
2164
  reactNative.Animated.timing(bottom, {
2162
2165
  toValue: 20,
2163
2166
  duration: 500,
@@ -2197,11 +2200,12 @@ const Toast = React__default["default"].forwardRef(
2197
2200
  styles$l.container,
2198
2201
  { bottom },
2199
2202
  { backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
2200
- { height: verticalScale(height) }
2203
+ { height: verticalScale(height) },
2204
+ toastStyle
2201
2205
  ],
2202
2206
  testID: "TOAST"
2203
2207
  },
2204
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.toastContainer }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.innerContainer }, /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : errorIcon ? errorIcon : warningIcon), /* @__PURE__ */ React__default["default"].createElement(
2208
+ /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.toastContainer }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.innerContainer }, /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : warning ? warningIcon : errorIcon), /* @__PURE__ */ React__default["default"].createElement(
2205
2209
  CustomTypography,
2206
2210
  {
2207
2211
  variant: "L2_REGULAR",
@@ -3812,7 +3816,7 @@ class ToastService {
3812
3816
  setRef(ref) {
3813
3817
  this.toastRef = ref;
3814
3818
  }
3815
- showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72) {
3819
+ showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false, tostContainerStyle = {}) {
3816
3820
  if (this.toastRef) {
3817
3821
  this.toastRef.showToast(
3818
3822
  message,
@@ -3820,7 +3824,11 @@ class ToastService {
3820
3824
  isSuccess,
3821
3825
  buttonText,
3822
3826
  buttonAction,
3823
- height
3827
+ height,
3828
+ subText,
3829
+ subTextPress,
3830
+ warning,
3831
+ tostContainerStyle
3824
3832
  );
3825
3833
  }
3826
3834
  }