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.d.ts +3 -3
- package/lib/index.js +17 -7
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +17 -7
- 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,
|
|
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",
|
|
@@ -2223,7 +2228,8 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2223
2228
|
style: styles$l.buttonText
|
|
2224
2229
|
}
|
|
2225
2230
|
)
|
|
2226
|
-
))),
|
|
2231
|
+
))),
|
|
2232
|
+
subjectText && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.subContainer }, /* @__PURE__ */ React__default["default"].createElement(
|
|
2227
2233
|
reactNative.Pressable,
|
|
2228
2234
|
{
|
|
2229
2235
|
style: styles$l.button,
|
|
@@ -2238,7 +2244,7 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2238
2244
|
style: styles$l.subButtonText
|
|
2239
2245
|
}
|
|
2240
2246
|
)
|
|
2241
|
-
))
|
|
2247
|
+
)),
|
|
2242
2248
|
/* @__PURE__ */ React__default["default"].createElement(
|
|
2243
2249
|
Progress__namespace.Bar,
|
|
2244
2250
|
{
|
|
@@ -3811,7 +3817,7 @@ class ToastService {
|
|
|
3811
3817
|
setRef(ref) {
|
|
3812
3818
|
this.toastRef = ref;
|
|
3813
3819
|
}
|
|
3814
|
-
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 = {}) {
|
|
3815
3821
|
if (this.toastRef) {
|
|
3816
3822
|
this.toastRef.showToast(
|
|
3817
3823
|
message,
|
|
@@ -3819,7 +3825,11 @@ class ToastService {
|
|
|
3819
3825
|
isSuccess,
|
|
3820
3826
|
buttonText,
|
|
3821
3827
|
buttonAction,
|
|
3822
|
-
height
|
|
3828
|
+
height,
|
|
3829
|
+
subText,
|
|
3830
|
+
subTextPress,
|
|
3831
|
+
warning,
|
|
3832
|
+
tostContainerStyle
|
|
3823
3833
|
);
|
|
3824
3834
|
}
|
|
3825
3835
|
}
|