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