dhre-ui-kit 0.0.303 → 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.d.ts +3 -3
- package/lib/index.js +14 -5
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +14 -5
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
@@ -2148,8 +2148,10 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2148
2148
|
const [height, setHeight] = React.useState(72);
|
|
2149
2149
|
const [onSubBtnPress, setOnSubBtnPress] = React.useState(null);
|
|
2150
2150
|
const [subjectText, setSubjectText] = React.useState(null);
|
|
2151
|
+
const [warning, setWarning] = React.useState(false);
|
|
2152
|
+
const [toastStyle, setToastStyle] = React.useState();
|
|
2151
2153
|
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) => {
|
|
2154
|
+
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false, tostContainerStyle) => {
|
|
2153
2155
|
setMessage(toastMessage);
|
|
2154
2156
|
setIsSuccess(success);
|
|
2155
2157
|
setBtnText(buttonText);
|
|
@@ -2158,6 +2160,8 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2158
2160
|
setHeight(height2);
|
|
2159
2161
|
setSubjectText(subText);
|
|
2160
2162
|
setOnSubBtnPress(() => subTextPress);
|
|
2163
|
+
setWarning(warning2);
|
|
2164
|
+
setToastStyle(tostContainerStyle);
|
|
2161
2165
|
reactNative.Animated.timing(bottom, {
|
|
2162
2166
|
toValue: 20,
|
|
2163
2167
|
duration: 500,
|
|
@@ -2197,11 +2201,12 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2197
2201
|
styles$l.container,
|
|
2198
2202
|
{ bottom },
|
|
2199
2203
|
{ backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
|
|
2200
|
-
{ height: verticalScale(height) }
|
|
2204
|
+
{ height: verticalScale(height) },
|
|
2205
|
+
toastStyle
|
|
2201
2206
|
],
|
|
2202
2207
|
testID: "TOAST"
|
|
2203
2208
|
},
|
|
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 :
|
|
2209
|
+
/* @__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
2210
|
CustomTypography,
|
|
2206
2211
|
{
|
|
2207
2212
|
variant: "L2_REGULAR",
|
|
@@ -3812,7 +3817,7 @@ class ToastService {
|
|
|
3812
3817
|
setRef(ref) {
|
|
3813
3818
|
this.toastRef = ref;
|
|
3814
3819
|
}
|
|
3815
|
-
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72) {
|
|
3820
|
+
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false, tostContainerStyle = {}) {
|
|
3816
3821
|
if (this.toastRef) {
|
|
3817
3822
|
this.toastRef.showToast(
|
|
3818
3823
|
message,
|
|
@@ -3820,7 +3825,11 @@ class ToastService {
|
|
|
3820
3825
|
isSuccess,
|
|
3821
3826
|
buttonText,
|
|
3822
3827
|
buttonAction,
|
|
3823
|
-
height
|
|
3828
|
+
height,
|
|
3829
|
+
subText,
|
|
3830
|
+
subTextPress,
|
|
3831
|
+
warning,
|
|
3832
|
+
tostContainerStyle
|
|
3824
3833
|
);
|
|
3825
3834
|
}
|
|
3826
3835
|
}
|