@jamadd/react-native-template-ui 0.2.3 → 0.2.4
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.
|
@@ -5,20 +5,23 @@ import { interpolate, useAnimatedStyle, withTiming } from 'react-native-reanimat
|
|
|
5
5
|
import { scheduleOnRN } from 'react-native-worklets';
|
|
6
6
|
import { useAnimationSharedVal } from "../../../hooks/reanimated.js";
|
|
7
7
|
import { useInsetsStyle } from "../../../hooks/style.js";
|
|
8
|
-
import { OverlayDismissResultType, ToastDuration, ToastType } from "../../../utils/overlay/const.js";
|
|
9
|
-
import { overlayMaxWidthPercent } from "../../../utils/overlay/const.js";
|
|
8
|
+
import { OverlayDismissResultType, overlayMaxWidthPercent, ToastDuration, ToastType } from "../../../utils/overlay/const.js";
|
|
10
9
|
import ThemedText from "../../text/ThemedText.js";
|
|
11
10
|
import AnimatedThemedView from "../../view/AnimatedThemedView.js";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
12
|
const ThemedToast = ({
|
|
14
13
|
type = ToastType.Bottom,
|
|
15
14
|
duration = ToastDuration.Short,
|
|
15
|
+
onDismiss,
|
|
16
|
+
top: propsTop,
|
|
17
|
+
bottom: propsBottom,
|
|
18
|
+
left: propsLeft,
|
|
19
|
+
right: propsRight,
|
|
16
20
|
insetsPadding,
|
|
17
21
|
insetPaddingTop,
|
|
18
22
|
insetPaddingBottom,
|
|
19
23
|
insetPaddingLeft,
|
|
20
24
|
insetPaddingRight,
|
|
21
|
-
onDismiss,
|
|
22
25
|
text,
|
|
23
26
|
textVariant = 'textS',
|
|
24
27
|
textFontSize,
|
|
@@ -87,10 +90,10 @@ const ThemedToast = ({
|
|
|
87
90
|
clearTimeout(timeout);
|
|
88
91
|
};
|
|
89
92
|
}, [text]);
|
|
90
|
-
const top = [ToastType.Top, ToastType.TopLeft, ToastType.TopRight].includes(type) ? paddingTop : undefined;
|
|
91
|
-
const bottom = [ToastType.Bottom, ToastType.BottomLeft, ToastType.BottomRight].includes(type) ? paddingBottom : undefined;
|
|
92
|
-
const left = [ToastType.TopLeft, ToastType.BottomLeft].includes(type) ? paddingLeft : undefined;
|
|
93
|
-
const right = [ToastType.TopRight, ToastType.BottomRight].includes(type) ? paddingRight : undefined;
|
|
93
|
+
const top = [ToastType.Top, ToastType.TopLeft, ToastType.TopRight].includes(type) ? propsTop ?? paddingTop : undefined;
|
|
94
|
+
const bottom = [ToastType.Bottom, ToastType.BottomLeft, ToastType.BottomRight].includes(type) ? propsBottom ?? paddingBottom : undefined;
|
|
95
|
+
const left = [ToastType.TopLeft, ToastType.BottomLeft].includes(type) ? propsLeft ?? paddingLeft : undefined;
|
|
96
|
+
const right = [ToastType.TopRight, ToastType.BottomRight].includes(type) ? propsRight ?? paddingRight : undefined;
|
|
94
97
|
return /*#__PURE__*/_jsx(AnimatedThemedView, {
|
|
95
98
|
position: 'absolute',
|
|
96
99
|
top: top,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","interpolate","useAnimatedStyle","withTiming","scheduleOnRN","useAnimationSharedVal","useInsetsStyle","OverlayDismissResultType","
|
|
1
|
+
{"version":3,"names":["useEffect","interpolate","useAnimatedStyle","withTiming","scheduleOnRN","useAnimationSharedVal","useInsetsStyle","OverlayDismissResultType","overlayMaxWidthPercent","ToastDuration","ToastType","ThemedText","AnimatedThemedView","jsx","_jsx","ThemedToast","type","Bottom","duration","Short","onDismiss","top","propsTop","bottom","propsBottom","left","propsLeft","right","propsRight","insetsPadding","insetPaddingTop","insetPaddingBottom","insetPaddingLeft","insetPaddingRight","text","textVariant","textFontSize","textFontWeight","textColor","textStyle","textProps","props","showSharedVal","paddingTop","paddingBottom","paddingLeft","paddingRight","insets","animatedStyle","outputY","Top","TopLeft","TopRight","BottomLeft","BottomRight","opacity","value","transform","translateY","set","timeout","setTimeout","undefined","resultType","Toast","clearTimeout","includes","position","alignSelf","maxWidth","paddingVertical","paddingHorizontal","backgroundColor","style","children","numberOfLines","variant","fontSize","fontWeight","color"],"sourceRoot":"../../../../../src","sources":["components/overlay/toast/ThemedToast.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAiB,OAAO;AAC1C,SACEC,WAAW,EACXC,gBAAgB,EAChBC,UAAU,QACL,yBAAyB;AAChC,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,qBAAqB,QAAQ,8BAA2B;AACjE,SAASC,cAAc,QAAQ,yBAAsB;AAGrD,SACEC,wBAAwB,EACxBC,sBAAsB,EACtBC,aAAa,EACbC,SAAS,QACJ,iCAA8B;AACrC,OAAOC,UAAU,MAAM,0BAAuB;AAC9C,OAAOC,kBAAkB,MAAM,kCAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/D,MAAMC,WAAiC,GAAGA,CAAC;EACzCC,IAAI,GAAGN,SAAS,CAACO,MAAM;EACvBC,QAAQ,GAAGT,aAAa,CAACU,KAAK;EAC9BC,SAAS;EACTC,GAAG,EAAEC,QAAQ;EACbC,MAAM,EAAEC,WAAW;EACnBC,IAAI,EAAEC,SAAS;EACfC,KAAK,EAAEC,UAAU;EACjBC,aAAa;EACbC,eAAe;EACfC,kBAAkB;EAClBC,gBAAgB;EAChBC,iBAAiB;EACjBC,IAAI;EACJC,WAAW,GAAG,OAAO;EACrBC,YAAY;EACZC,cAAc;EACdC,SAAS,GAAG,aAAa;EACzBC,SAAS;EACTC,SAAS;EACT,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,aAAa,GAAGrC,qBAAqB,CAAC,CAAC;EAC7C,MAAM;IAAEsC,UAAU;IAAEC,aAAa;IAAEC,WAAW;IAAEC;EAAa,CAAC,GAC5DxC,cAAc,CAAC;IACbyC,MAAM,EAAE,IAAI;IACZlB,aAAa,EAAEA,aAAa,IAAI,GAAG;IACnCC,eAAe;IACfC,kBAAkB;IAClBC,gBAAgB;IAChBC;EACF,CAAC,CAAC;EACJ,MAAMe,aAAa,GAAG9C,gBAAgB,CAAC,MAAM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,UAAU,EAAEzC,cAAe;MAC3B0C,KAAK,EAAEzC,SAAU;MACjBmC,KAAK,EAAElC,SAAU;MAAA,GACbC,SAAS;MAAAkC,QAAA,EAEZxC;IAAI,CACK;EAAC,CACK,CAAC;AAEzB,CAAC;AAED,eAAenB,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemedToast.d.ts","sourceRoot":"","sources":["../../../../../../src/components/overlay/toast/ThemedToast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAS3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAW/D,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ThemedToast.d.ts","sourceRoot":"","sources":["../../../../../../src/components/overlay/toast/ThemedToast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAS3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAW/D,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyIrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamadd/react-native-template-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "React Native Template UI is a collection of UI components designed by JaMa D&D.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|