@evlop/native-components 1.0.253 → 1.0.255

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.
Files changed (45) hide show
  1. package/README.md +456 -0
  2. package/dist/cjs/src/Actionable.d.ts +1 -1
  3. package/dist/cjs/src/Actionable.d.ts.map +1 -1
  4. package/dist/cjs/src/Actionable.js +2 -163
  5. package/dist/cjs/src/Actionable.js.map +1 -1
  6. package/dist/cjs/src/Button.d.ts +3 -0
  7. package/dist/cjs/src/Button.d.ts.map +1 -1
  8. package/dist/cjs/src/Button.js +35 -26
  9. package/dist/cjs/src/Button.js.map +1 -1
  10. package/dist/cjs/src/hooks/index.d.ts +2 -0
  11. package/dist/cjs/src/hooks/index.d.ts.map +1 -0
  12. package/dist/cjs/src/hooks/index.js +18 -0
  13. package/dist/cjs/src/hooks/index.js.map +1 -0
  14. package/dist/cjs/src/hooks/useAnimatedPress.d.ts +56 -0
  15. package/dist/cjs/src/hooks/useAnimatedPress.d.ts.map +1 -0
  16. package/dist/cjs/src/hooks/useAnimatedPress.js +168 -0
  17. package/dist/cjs/src/hooks/useAnimatedPress.js.map +1 -0
  18. package/dist/cjs/src/utils/index.d.ts +1 -0
  19. package/dist/cjs/src/utils/index.d.ts.map +1 -1
  20. package/dist/cjs/src/utils/index.js +1 -0
  21. package/dist/cjs/src/utils/index.js.map +1 -1
  22. package/dist/cjs/src/utils/pushNotification.d.ts +13 -0
  23. package/dist/cjs/src/utils/pushNotification.d.ts.map +1 -0
  24. package/dist/cjs/src/utils/pushNotification.js +21 -0
  25. package/dist/cjs/src/utils/pushNotification.js.map +1 -0
  26. package/dist/cjs/src/utils/pushNotification.native.d.ts +19 -0
  27. package/dist/cjs/src/utils/pushNotification.native.d.ts.map +1 -0
  28. package/dist/cjs/src/utils/pushNotification.native.js +113 -0
  29. package/dist/cjs/src/utils/pushNotification.native.js.map +1 -0
  30. package/dist/types/main.ai.d.ts +3 -1
  31. package/dist/types/src/Actionable.d.ts +1 -1
  32. package/dist/types/src/Actionable.d.ts.map +1 -1
  33. package/dist/types/src/Button.d.ts +3 -0
  34. package/dist/types/src/Button.d.ts.map +1 -1
  35. package/dist/types/src/hooks/index.d.ts +2 -0
  36. package/dist/types/src/hooks/index.d.ts.map +1 -0
  37. package/dist/types/src/hooks/useAnimatedPress.d.ts +56 -0
  38. package/dist/types/src/hooks/useAnimatedPress.d.ts.map +1 -0
  39. package/dist/types/src/utils/index.d.ts +1 -0
  40. package/dist/types/src/utils/index.d.ts.map +1 -1
  41. package/dist/types/src/utils/pushNotification.d.ts +13 -0
  42. package/dist/types/src/utils/pushNotification.d.ts.map +1 -0
  43. package/dist/types/src/utils/pushNotification.native.d.ts +19 -0
  44. package/dist/types/src/utils/pushNotification.native.d.ts.map +1 -0
  45. package/package.json +3 -1
@@ -2,7 +2,7 @@ import { Action } from '@evlop/commons';
2
2
  import React from 'react';
3
3
  import { PressableProps } from 'react-native';
4
4
  import { HapticType } from './utils/haptic';
5
- declare type EffectType = 'none' | 'shrink' | 'dim' | 'shrink-dim' | 'push-down' | 'gentle-shrink' | 'tilt' | 'bounce' | 'squeeze' | 'pop' | 'wobble';
5
+ import { EffectType } from './hooks/useAnimatedPress';
6
6
  export interface BaseActionableProps extends PressableProps {
7
7
  pressEffect?: EffectType;
8
8
  hapticFeedback?: HapticType;
@@ -1 +1 @@
1
- {"version":3,"file":"Actionable.d.ts","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAA8C,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAyB,MAAM,gBAAgB,CAAC;AAInE,aAAK,UAAU,GACT,MAAM,GACN,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,WAAW,GACX,eAAe,GACf,MAAM,GACN,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,CAAC;AAEf,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAmLD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAsBnE,CAAA;;;;;;;;;;AAED,wBAImB"}
1
+ {"version":3,"file":"Actionable.d.ts","sourceRoot":"","sources":["../../../src/Actionable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2B,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAA8C,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAyB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAoB,MAAM,0BAA0B,CAAC;AAIxE,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAWD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAsBnE,CAAA;;;;;;;;;;AAED,wBAImB"}
@@ -2,6 +2,7 @@ import { Action, Color, IconIdentifier, Theme } from '@evlop/commons';
2
2
  import React from 'react';
3
3
  import { TextStyle, ViewProps } from 'react-native';
4
4
  import { BackgroundColorProps, BorderProps, FontSizeProps, FontWeightProps, LayoutProps, SpaceProps } from 'styled-system';
5
+ import { EffectType } from './hooks/useAnimatedPress';
5
6
  declare type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
6
7
  export interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, FontSizeProps<Theme>, LayoutProps<Theme>, SpaceProps<Theme>, BackgroundColorProps<Theme>, BorderProps<Theme> {
7
8
  disabled?: boolean;
@@ -15,6 +16,8 @@ export interface BaseButtonProps extends ViewProps, FontWeightProps<Theme>, Font
15
16
  action?: Action;
16
17
  icon?: IconIdentifier;
17
18
  iconPosition?: 'left' | 'right';
19
+ iconSize?: number;
20
+ pressEffect?: EffectType;
18
21
  }
19
22
  export declare const BaseButton: React.FC<BaseButtonProps>;
20
23
  declare const ButtonWithSettings: (props: BaseButtonProps & {
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAgC,MAAM,gBAAgB,CAAC;AAEpG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAgC,SAAS,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;AAExF,OAAO,EAAmB,oBAAoB,EAAU,WAAW,EAAE,aAAa,EAAE,eAAe,EAAU,WAAW,EAAS,UAAU,EAAuB,MAAM,eAAe,CAAC;AAWxL,aAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,eAAgB,SAAQ,SAAS,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC;IACtL,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,q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AAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,qBAAqB,GAAG,OAAO,CAAC;IACnF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B;AAyHD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiEhD,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;;;;;;uBAIV,CAAC;AAEf,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './useAnimatedPress';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { Animated } from 'react-native';
2
+ export declare type EffectType = 'none' | 'shrink' | 'dim' | 'shrink-dim' | 'push-down' | 'gentle-shrink' | 'tilt' | 'bounce' | 'squeeze' | 'pop' | 'wobble';
3
+ export declare const useAnimatedPress: (effect: EffectType) => {
4
+ handlePressIn?: undefined;
5
+ handlePressOut?: undefined;
6
+ animatedStyle?: undefined;
7
+ } | {
8
+ handlePressIn: () => void;
9
+ handlePressOut: () => void;
10
+ animatedStyle: {
11
+ opacity: Animated.AnimatedInterpolation<string | number>;
12
+ transform?: undefined;
13
+ } | {
14
+ transform: {
15
+ scale: Animated.AnimatedInterpolation<string | number>;
16
+ }[];
17
+ opacity: Animated.AnimatedInterpolation<string | number>;
18
+ } | {
19
+ transform: ({
20
+ scale: Animated.AnimatedInterpolation<string | number>;
21
+ translateY?: undefined;
22
+ } | {
23
+ translateY: Animated.AnimatedInterpolation<string | number>;
24
+ scale?: undefined;
25
+ })[];
26
+ opacity?: undefined;
27
+ } | {
28
+ transform: ({
29
+ scale: Animated.AnimatedInterpolation<string | number>;
30
+ rotateZ?: undefined;
31
+ perspective?: undefined;
32
+ } | {
33
+ rotateZ: Animated.AnimatedInterpolation<string | number>;
34
+ scale?: undefined;
35
+ perspective?: undefined;
36
+ } | {
37
+ perspective: Animated.AnimatedInterpolation<string | number>;
38
+ scale?: undefined;
39
+ rotateZ?: undefined;
40
+ })[];
41
+ opacity?: undefined;
42
+ } | {
43
+ transform: ({
44
+ scaleX: Animated.AnimatedInterpolation<string | number>;
45
+ scaleY?: undefined;
46
+ } | {
47
+ scaleY: Animated.AnimatedInterpolation<string | number>;
48
+ scaleX?: undefined;
49
+ })[];
50
+ opacity?: undefined;
51
+ } | {
52
+ opacity?: undefined;
53
+ transform?: undefined;
54
+ };
55
+ };
56
+ //# sourceMappingURL=useAnimatedPress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedPress.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAnimatedPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,oBAAY,UAAU,GAChB,MAAM,GACN,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,WAAW,GACX,eAAe,GACf,MAAM,GACN,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,CAAC;AAEf,eAAO,MAAM,gBAAgB,WAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKlD,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './haptic';
2
+ export * from './pushNotification';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Action } from "@evlop/commons";
2
+ interface TriggerPushNotificationOptions {
3
+ id?: string;
4
+ title?: string;
5
+ body?: string;
6
+ image?: string;
7
+ action?: Action;
8
+ sendAt?: Date;
9
+ }
10
+ export declare function triggerPushNotification({ id, title, body, image, action, sendAt }: TriggerPushNotificationOptions): Promise<void>;
11
+ export declare function cancelTriggerPushNotification(id: string): Promise<void>;
12
+ export {};
13
+ //# sourceMappingURL=pushNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pushNotification.d.ts","sourceRoot":"","sources":["../../../../src/utils/pushNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,UAAU,8BAA8B;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,8BAA8B,iBAAI;AAE5H,wBAAsB,6BAA6B,CAAC,EAAE,EAAE,MAAM,iBAAI"}
@@ -0,0 +1,19 @@
1
+ import { Action } from '@evlop/commons';
2
+ interface TriggerPushNotificationOptions {
3
+ id?: string;
4
+ title?: string;
5
+ body?: string;
6
+ image?: string;
7
+ action?: Action;
8
+ sendAt?: Date;
9
+ }
10
+ export declare const triggerPushNotification: ({ id: notificationId, title: notificationTitle, body: notificationBody, image: notificationImageUrl, action, sendAt }: TriggerPushNotificationOptions) => Promise<void>;
11
+ interface CancelTriggerPushNotificationOptions {
12
+ id: string;
13
+ /**
14
+ * If true, cancel the scheduled notification. If false, cancel the displayed notification. (default: false) */
15
+ scheduled?: boolean;
16
+ }
17
+ export declare const cancelTriggerPushNotification: ({ id, scheduled }: CancelTriggerPushNotificationOptions) => Promise<void>;
18
+ export {};
19
+ //# sourceMappingURL=pushNotification.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pushNotification.native.d.ts","sourceRoot":"","sources":["../../../../src/utils/pushNotification.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIxC,UAAU,8BAA8B;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,IAAI,CAAC;CACf;AAED,eAAO,MAAM,uBAAuB,0HAAiI,8BAA8B,kBAmElM,CAAA;AAED,UAAU,oCAAoC;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX;mHAC+G;IAC/G,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,6BAA6B,sBAA6B,oCAAoC,kBAO1G,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/native-components",
3
- "version": "1.0.253",
3
+ "version": "1.0.255",
4
4
  "description": "",
5
5
  "main": "dist/cjs/main.js",
6
6
  "types": "dist/types/main.d.ts",
@@ -21,6 +21,7 @@
21
21
  "license": "ISC",
22
22
  "peerDependencies": {
23
23
  "@evlop/commons": "^1.0.137",
24
+ "@notifee/react-native": "^9.1.8",
24
25
  "@react-navigation/elements": "^2.9.3",
25
26
  "i18next": "^21.8.9",
26
27
  "lodash": "^4.17.15",
@@ -41,6 +42,7 @@
41
42
  },
42
43
  "devDependencies": {
43
44
  "@evlop/commons": "^1.0.369",
45
+ "@notifee/react-native": "*",
44
46
  "@react-navigation/elements": "*",
45
47
  "@react-navigation/native": "^7.1.17",
46
48
  "@types/lodash": "^4.14.178",