dhre-ui-kit 0.0.304 → 0.0.306
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 +10 -13
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +10 -13
- 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, warning?: boolean
|
|
382
|
+
showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean) => 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, warning?: boolean
|
|
385
|
+
showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean) => 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, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean
|
|
682
|
+
showToast(message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean): void;
|
|
683
683
|
}
|
|
684
684
|
declare const toastService: ToastService;
|
|
685
685
|
|
package/lib/index.js
CHANGED
|
@@ -2127,7 +2127,7 @@ const styles$l = reactNative.StyleSheet.create({
|
|
|
2127
2127
|
color: "#fff"
|
|
2128
2128
|
},
|
|
2129
2129
|
subContainer: {
|
|
2130
|
-
paddingHorizontal: horizontalScale(
|
|
2130
|
+
paddingHorizontal: horizontalScale(20),
|
|
2131
2131
|
marginTop: verticalScale(8)
|
|
2132
2132
|
},
|
|
2133
2133
|
subButtonText: {
|
|
@@ -2146,12 +2146,13 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2146
2146
|
const [onBtnPress, setOnBtnPress] = React.useState(null);
|
|
2147
2147
|
const [progress, setProgress] = React.useState(0);
|
|
2148
2148
|
const [height, setHeight] = React.useState(72);
|
|
2149
|
-
const [onSubBtnPress, setOnSubBtnPress] = React.useState(
|
|
2149
|
+
const [onSubBtnPress, setOnSubBtnPress] = React.useState(
|
|
2150
|
+
null
|
|
2151
|
+
);
|
|
2150
2152
|
const [subjectText, setSubjectText] = React.useState(null);
|
|
2151
2153
|
const [warning, setWarning] = React.useState(false);
|
|
2152
|
-
const [toastStyle, setToastStyle] = React.useState();
|
|
2153
2154
|
const bottom = React.useRef(new reactNative.Animated.Value(-80)).current;
|
|
2154
|
-
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false
|
|
2155
|
+
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false) => {
|
|
2155
2156
|
setMessage(toastMessage);
|
|
2156
2157
|
setIsSuccess(success);
|
|
2157
2158
|
setBtnText(buttonText);
|
|
@@ -2161,7 +2162,6 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2161
2162
|
setSubjectText(subText);
|
|
2162
2163
|
setOnSubBtnPress(() => subTextPress);
|
|
2163
2164
|
setWarning(warning2);
|
|
2164
|
-
setToastStyle(tostContainerStyle);
|
|
2165
2165
|
reactNative.Animated.timing(bottom, {
|
|
2166
2166
|
toValue: 20,
|
|
2167
2167
|
duration: 500,
|
|
@@ -2201,8 +2201,7 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2201
2201
|
styles$l.container,
|
|
2202
2202
|
{ bottom },
|
|
2203
2203
|
{ backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
|
|
2204
|
-
{ height: verticalScale(height) }
|
|
2205
|
-
toastStyle
|
|
2204
|
+
{ height: verticalScale(height) }
|
|
2206
2205
|
],
|
|
2207
2206
|
testID: "TOAST"
|
|
2208
2207
|
},
|
|
@@ -2228,8 +2227,7 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2228
2227
|
style: styles$l.buttonText
|
|
2229
2228
|
}
|
|
2230
2229
|
)
|
|
2231
|
-
))
|
|
2232
|
-
subjectText && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.subContainer }, /* @__PURE__ */ React__default["default"].createElement(
|
|
2230
|
+
)), subjectText && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.subContainer }, /* @__PURE__ */ React__default["default"].createElement(
|
|
2233
2231
|
reactNative.Pressable,
|
|
2234
2232
|
{
|
|
2235
2233
|
style: styles$l.button,
|
|
@@ -2244,7 +2242,7 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2244
2242
|
style: styles$l.subButtonText
|
|
2245
2243
|
}
|
|
2246
2244
|
)
|
|
2247
|
-
)),
|
|
2245
|
+
))),
|
|
2248
2246
|
/* @__PURE__ */ React__default["default"].createElement(
|
|
2249
2247
|
Progress__namespace.Bar,
|
|
2250
2248
|
{
|
|
@@ -3817,7 +3815,7 @@ class ToastService {
|
|
|
3817
3815
|
setRef(ref) {
|
|
3818
3816
|
this.toastRef = ref;
|
|
3819
3817
|
}
|
|
3820
|
-
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false
|
|
3818
|
+
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false) {
|
|
3821
3819
|
if (this.toastRef) {
|
|
3822
3820
|
this.toastRef.showToast(
|
|
3823
3821
|
message,
|
|
@@ -3828,8 +3826,7 @@ class ToastService {
|
|
|
3828
3826
|
height,
|
|
3829
3827
|
subText,
|
|
3830
3828
|
subTextPress,
|
|
3831
|
-
warning
|
|
3832
|
-
tostContainerStyle
|
|
3829
|
+
warning
|
|
3833
3830
|
);
|
|
3834
3831
|
}
|
|
3835
3832
|
}
|