dhre-ui-kit 0.0.300 → 0.0.301
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 -2
- package/lib/index.js +31 -3
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +31 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -2088,11 +2088,20 @@ const styles$l = StyleSheet.create({
|
|
|
2088
2088
|
buttonText: {
|
|
2089
2089
|
textDecorationLine: "underline",
|
|
2090
2090
|
color: "#fff"
|
|
2091
|
+
},
|
|
2092
|
+
subContainer: {
|
|
2093
|
+
paddingHorizontal: horizontalScale(12),
|
|
2094
|
+
marginTop: verticalScale(8)
|
|
2095
|
+
},
|
|
2096
|
+
subButtonText: {
|
|
2097
|
+
textDecorationLine: "underline",
|
|
2098
|
+
color: "#fff",
|
|
2099
|
+
textDecorationColor: "#fff"
|
|
2091
2100
|
}
|
|
2092
2101
|
});
|
|
2093
2102
|
|
|
2094
2103
|
const Toast = React.forwardRef(
|
|
2095
|
-
({ sucessIcon, errorIcon }, ref) => {
|
|
2104
|
+
({ sucessIcon, errorIcon, warningIcon }, ref) => {
|
|
2096
2105
|
const [visible, setVisible] = useState(false);
|
|
2097
2106
|
const [message, setMessage] = useState("");
|
|
2098
2107
|
const [isSuccess, setIsSuccess] = useState(true);
|
|
@@ -2100,14 +2109,18 @@ const Toast = React.forwardRef(
|
|
|
2100
2109
|
const [onBtnPress, setOnBtnPress] = useState(null);
|
|
2101
2110
|
const [progress, setProgress] = useState(0);
|
|
2102
2111
|
const [height, setHeight] = useState(72);
|
|
2112
|
+
const [onSubBtnPress, setOnSubBtnPress] = useState(null);
|
|
2113
|
+
const [subjectText, setSubjectText] = useState(null);
|
|
2103
2114
|
const bottom = useRef(new Animated.Value(-80)).current;
|
|
2104
|
-
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72) => {
|
|
2115
|
+
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null) => {
|
|
2105
2116
|
setMessage(toastMessage);
|
|
2106
2117
|
setIsSuccess(success);
|
|
2107
2118
|
setBtnText(buttonText);
|
|
2108
2119
|
setOnBtnPress(() => buttonAction);
|
|
2109
2120
|
setVisible(true);
|
|
2110
2121
|
setHeight(height2);
|
|
2122
|
+
setSubjectText(subText);
|
|
2123
|
+
setOnSubBtnPress(() => subTextPress);
|
|
2111
2124
|
Animated.timing(bottom, {
|
|
2112
2125
|
toValue: 20,
|
|
2113
2126
|
duration: 500,
|
|
@@ -2151,7 +2164,7 @@ const Toast = React.forwardRef(
|
|
|
2151
2164
|
],
|
|
2152
2165
|
testID: "TOAST"
|
|
2153
2166
|
},
|
|
2154
|
-
/* @__PURE__ */ React.createElement(View, { style: styles$l.toastContainer }, /* @__PURE__ */ React.createElement(View, { style: styles$l.innerContainer }, /* @__PURE__ */ React.createElement(Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : errorIcon), /* @__PURE__ */ React.createElement(
|
|
2167
|
+
/* @__PURE__ */ React.createElement(View, { style: styles$l.toastContainer }, /* @__PURE__ */ React.createElement(View, { style: styles$l.innerContainer }, /* @__PURE__ */ React.createElement(Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : warningIcon ? warningIcon : errorIcon), /* @__PURE__ */ React.createElement(
|
|
2155
2168
|
CustomTypography,
|
|
2156
2169
|
{
|
|
2157
2170
|
variant: "L2_REGULAR",
|
|
@@ -2173,6 +2186,21 @@ const Toast = React.forwardRef(
|
|
|
2173
2186
|
style: styles$l.buttonText
|
|
2174
2187
|
}
|
|
2175
2188
|
)
|
|
2189
|
+
)), subjectText && /* @__PURE__ */ React.createElement(View, { style: styles$l.subContainer }, /* @__PURE__ */ React.createElement(
|
|
2190
|
+
Pressable,
|
|
2191
|
+
{
|
|
2192
|
+
style: styles$l.button,
|
|
2193
|
+
onPress: onSubBtnPress || void 0,
|
|
2194
|
+
testID: "TOAST-BTN"
|
|
2195
|
+
},
|
|
2196
|
+
/* @__PURE__ */ React.createElement(
|
|
2197
|
+
CustomTypography,
|
|
2198
|
+
{
|
|
2199
|
+
variant: "L2_BOLD",
|
|
2200
|
+
text: subjectText,
|
|
2201
|
+
style: styles$l.subButtonText
|
|
2202
|
+
}
|
|
2203
|
+
)
|
|
2176
2204
|
))),
|
|
2177
2205
|
/* @__PURE__ */ React.createElement(
|
|
2178
2206
|
Progress.Bar,
|