@nexub/react-native 2.1.0 → 2.3.0

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 (52) hide show
  1. package/README.md +3 -1
  2. package/lib/module/components/containers.js +13 -5
  3. package/lib/module/components/containers.js.map +1 -1
  4. package/lib/module/components/display.js +33 -0
  5. package/lib/module/components/display.js.map +1 -1
  6. package/lib/module/components/feedback.js +65 -45
  7. package/lib/module/components/feedback.js.map +1 -1
  8. package/lib/module/components/inputs.js +101 -55
  9. package/lib/module/components/inputs.js.map +1 -1
  10. package/lib/module/components/mobile.js +70 -63
  11. package/lib/module/components/mobile.js.map +1 -1
  12. package/lib/module/components/overlays.js +5 -2
  13. package/lib/module/components/overlays.js.map +1 -1
  14. package/lib/module/index.js +1 -0
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/module/patterns/home.js +201 -0
  17. package/lib/module/patterns/home.js.map +1 -0
  18. package/lib/module/patterns/index.js +1 -0
  19. package/lib/module/patterns/index.js.map +1 -1
  20. package/lib/module/primitives/Pressable.js +4 -2
  21. package/lib/module/primitives/Pressable.js.map +1 -1
  22. package/lib/module/theme/motion.js +60 -0
  23. package/lib/module/theme/motion.js.map +1 -0
  24. package/lib/typescript/components/containers.d.ts.map +1 -1
  25. package/lib/typescript/components/display.d.ts +7 -1
  26. package/lib/typescript/components/display.d.ts.map +1 -1
  27. package/lib/typescript/components/feedback.d.ts +4 -1
  28. package/lib/typescript/components/feedback.d.ts.map +1 -1
  29. package/lib/typescript/components/inputs.d.ts.map +1 -1
  30. package/lib/typescript/components/mobile.d.ts.map +1 -1
  31. package/lib/typescript/components/overlays.d.ts.map +1 -1
  32. package/lib/typescript/index.d.ts +2 -0
  33. package/lib/typescript/index.d.ts.map +1 -1
  34. package/lib/typescript/patterns/home.d.ts +50 -0
  35. package/lib/typescript/patterns/home.d.ts.map +1 -0
  36. package/lib/typescript/patterns/index.d.ts +2 -0
  37. package/lib/typescript/patterns/index.d.ts.map +1 -1
  38. package/lib/typescript/primitives/Pressable.d.ts.map +1 -1
  39. package/lib/typescript/theme/motion.d.ts +70 -0
  40. package/lib/typescript/theme/motion.d.ts.map +1 -0
  41. package/package.json +4 -4
  42. package/src/components/containers.tsx +17 -6
  43. package/src/components/display.tsx +31 -0
  44. package/src/components/feedback.tsx +23 -4
  45. package/src/components/inputs.tsx +59 -11
  46. package/src/components/mobile.tsx +8 -4
  47. package/src/components/overlays.tsx +4 -1
  48. package/src/index.ts +2 -0
  49. package/src/patterns/home.tsx +211 -0
  50. package/src/patterns/index.ts +2 -0
  51. package/src/primitives/Pressable.tsx +4 -1
  52. package/src/theme/motion.ts +83 -0
@@ -1 +1 @@
1
- {"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../../src/components/overlays.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAUL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAiBtB,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAK7C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,qHAAqH;IACrH,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,OAAqB,EACrB,KAAK,EACL,QAAQ,EACR,WAAkB,EAClB,MAAM,GACP,EAAE,gBAAgB,qBA6LlB;AAID,MAAM,WAAW,WAAW;IAC1B,KAAK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AAS,MAAM;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,+EAA+E;AAC/E,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,EACvC,KAAK,EACL,OAAO,EACP,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,WAAW,CAAC,CAAC,CAAC,qBA6EhB"}
@@ -4,6 +4,8 @@ export { nexubFonts, fontStyle } from './theme/fonts.js';
4
4
  export type { FontFamily, FontSource } from './theme/fonts.js';
5
5
  export { playHaptic } from './theme/haptics.js';
6
6
  export type { HapticToken } from './theme/haptics.js';
7
+ export { nxSpring, nxEnter, nxExit, nxLayout } from './theme/motion.js';
8
+ export type { SpringFamily, SpringSpeed, EnterKind, ExitKind } from './theme/motion.js';
7
9
  export { useControllableState } from './hooks/useControllableState.js';
8
10
  export { Text, Heading } from './primitives/Text.js';
9
11
  export type { TextProps, HeadingProps } from './primitives/Text.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,gBAAgB,GACjB,MAAM,0BAAuB,CAAC;AAC/B,YAAY,EACV,wBAAwB,E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AE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,0BAAuB,CAAC;AACtF,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,GAAG,EACH,aAAa,GACd,MAAM,wBAAqB,CAAC;AAC7B,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,kBAAkB,GACnB,MAAM,wBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,uBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,gBAAgB,GACjB,MAAM,0BAAuB,CAAC;AAC/B,YAAY,EACV,wBAAwB,EACxB,UAAU,EACV,KAAK,EACL,QAAQ,EACR,MAAM,EACN,cAAc,GACf,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAe,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAe,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAiB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAiB,CAAC;AACnD,OAAO,EAAE,QAAQ,E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W,EACX,YAAY,GACb,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,GAAG,EACH,aAAa,GACd,MAAM,wBAAqB,CAAC;AAC7B,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,kBAAkB,GACnB,MAAM,wBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,uBAAoB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import * as React from 'react';
2
+ import type { NativeIconProps } from '@nexub/icons/native';
3
+ import type { Transaction } from './money.js';
4
+ export interface QuickAction {
5
+ id: string;
6
+ label: string;
7
+ icon?: React.ComponentType<NativeIconProps>;
8
+ onPress: () => void;
9
+ }
10
+ export interface Insight {
11
+ id: string;
12
+ title: string;
13
+ body: string;
14
+ action?: {
15
+ label: string;
16
+ onPress: () => void;
17
+ };
18
+ }
19
+ export interface HomeScreenProps {
20
+ /** e.g. "Good morning, Mei". Leave out when the native header shows the title. */
21
+ greeting?: string;
22
+ balance: {
23
+ value: number;
24
+ currency: string;
25
+ label?: string;
26
+ };
27
+ /** Send, Add money, Request… Up to four fit one row. */
28
+ quickActions?: QuickAction[];
29
+ /** The latest few transactions. */
30
+ recent?: Transaction[];
31
+ onTransactionPress?: (t: Transaction) => void;
32
+ /** Shows "See all" beside Recent activity. */
33
+ onSeeAllActivity?: () => void;
34
+ insights?: Insight[];
35
+ onRefresh?: () => void;
36
+ refreshing?: boolean;
37
+ /** Copy overrides. */
38
+ labels?: Partial<{
39
+ totalBalance: string;
40
+ recentActivity: string;
41
+ seeAll: string;
42
+ insights: string;
43
+ }>;
44
+ }
45
+ /**
46
+ * Money-app home (Payub): balance hero with quick actions, recent activity,
47
+ * insights and pull-to-refresh. Web twin: `DashboardPage` in @nexub/patterns.
48
+ */
49
+ export declare function HomeScreen({ greeting, balance, quickActions, recent, onTransactionPress, onSeeAllActivity, insights, onRefresh, refreshing, labels, }: HomeScreenProps): React.JSX.Element;
50
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../../src/patterns/home.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAS3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,eAAe;IAC9B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,wDAAwD;IACxD,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtG;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,EACP,YAAiB,EACjB,MAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,QAAa,EACb,SAAS,EACT,UAAkB,EAClB,MAAM,GACP,EAAE,eAAe,qBAqJjB"}
@@ -1,3 +1,5 @@
1
+ export { HomeScreen } from './home.js';
2
+ export type { HomeScreenProps, QuickAction, Insight } from './home.js';
1
3
  export { AuthScreen, SignInScreen, VerifyCodeScreen, LockScreen } from './auth.js';
2
4
  export type { AuthScreenProps, SignInScreenProps, VerifyCodeScreenProps, LockScreenProps, } from './auth.js';
3
5
  export { FlowStep, AmountStep, ReviewStep, ActivityList, TransactionDetail, ResultScreen, } from './money.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAQ,CAAC;AAChF,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,GAChB,MAAM,WAAQ,CAAC;AAChB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAS,CAAC;AACjB,YAAY,EACV,aAAa,EACb,KAAK,EACL,eAAe,EACf,SAAS,EACT,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,MAAM,UAAO,CAAC;AACf,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,IAAI,EACJ,kBAAkB,EAClB,QAAQ,EACR,qBAAqB,GACtB,MAAM,UAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAQ,CAAC;AACpC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,WAAQ,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAQ,CAAC;AAChF,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,GAChB,MAAM,WAAQ,CAAC;AAChB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAS,CAAC;AACjB,YAAY,EACV,aAAa,EACb,KAAK,EACL,eAAe,EACf,SAAS,EACT,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,iBAA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Q,EACR,MAAM,EACN,UAAyB,EACzB,UAAiB,EACjB,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,GAAG,IAAI,EACR,EAAE,cAAc,qBA+ChB"}
1
+ {"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../src/primitives/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,KAAK,cAAc,IAAI,gBAAgB,EACvC,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAkB,CAAC;AACpD,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AAU7E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,UAAU,CAAC;IAClF,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0FAA0F;IAC1F,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC9B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAyB,EACzB,UAAiB,EACjB,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,GAAG,IAAI,EACR,EAAE,cAAc,qBA+ChB"}
@@ -0,0 +1,70 @@
1
+ import { FadeIn, FadeInDown, FadeInUp, FadeOut, LinearTransition, ReduceMotion, SlideOutLeft, ZoomIn, ZoomOut } from 'react-native-reanimated';
2
+ import { native } from '@nexub/tokens/native';
3
+ export type SpringFamily = keyof typeof native.motion.spring;
4
+ export type SpringSpeed = keyof (typeof native.motion.spring)['spatial'];
5
+ /** `withSpring` config for a spring token, honouring Reduce Motion. */
6
+ export declare function nxSpring(family?: SpringFamily, speed?: SpringSpeed): {
7
+ reduceMotion: ReduceMotion;
8
+ stiffness: 1400;
9
+ damping: 67.35;
10
+ mass: 1;
11
+ } | {
12
+ reduceMotion: ReduceMotion;
13
+ stiffness: 3800;
14
+ damping: 123.29;
15
+ mass: 1;
16
+ } | {
17
+ reduceMotion: ReduceMotion;
18
+ stiffness: 800;
19
+ damping: 39.6;
20
+ mass: 1;
21
+ } | {
22
+ reduceMotion: ReduceMotion;
23
+ stiffness: 700;
24
+ damping: 47.62;
25
+ mass: 1;
26
+ } | {
27
+ reduceMotion: ReduceMotion;
28
+ stiffness: 1600;
29
+ damping: 80;
30
+ mass: 1;
31
+ } | {
32
+ reduceMotion: ReduceMotion;
33
+ stiffness: 380;
34
+ damping: 31.19;
35
+ mass: 1;
36
+ } | {
37
+ reduceMotion: ReduceMotion;
38
+ stiffness: 300;
39
+ damping: 31.18;
40
+ mass: 1;
41
+ } | {
42
+ reduceMotion: ReduceMotion;
43
+ stiffness: 800;
44
+ damping: 56.57;
45
+ mass: 1;
46
+ } | {
47
+ reduceMotion: ReduceMotion;
48
+ stiffness: 200;
49
+ damping: 22.63;
50
+ mass: 1;
51
+ };
52
+ export type EnterKind = 'fade' | 'up' | 'down' | 'scale';
53
+ export type ExitKind = 'fade' | 'up' | 'down' | 'scale' | 'start' | 'end';
54
+ /**
55
+ * `entering` animation on the spatial spring.
56
+ * `up` rises into place (rows, toasts from below); `down` drops in (banners).
57
+ *
58
+ * ```tsx
59
+ * <Animated.View entering={nxEnter('up')} exiting={nxExit('down')} layout={nxLayout()} />
60
+ * ```
61
+ */
62
+ export declare function nxEnter(kind?: EnterKind, speed?: SpringSpeed): FadeIn | FadeInUp | FadeInDown | ZoomIn;
63
+ /**
64
+ * `exiting` animation on the effects spring: quicker than enter, no overshoot.
65
+ * `start` / `end` slide out toward that edge (swipe-to-delete), following RTL.
66
+ */
67
+ export declare function nxExit(kind?: ExitKind, speed?: SpringSpeed, rtl?: boolean): FadeOut | ZoomOut | SlideOutLeft;
68
+ /** `layout` transition: siblings glide to their new place on the spatial spring. */
69
+ export declare function nxLayout(speed?: SpringSpeed): LinearTransition;
70
+ //# sourceMappingURL=motion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../../src/theme/motion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,OAAO,EAGP,gBAAgB,EAChB,YAAY,EACZ,YAAY,EAEZ,MAAM,EACN,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAQ9C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;AAEzE,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,MAAM,GAAE,YAAwB,EAAE,KAAK,GAAE,WAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAExF;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;AACzD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAK1E;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,GAAE,SAAkB,EAAE,KAAK,GAAE,WAAuB,2CAQ/E;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,GAAE,QAAiB,EAAE,KAAK,GAAE,WAAoB,EAAE,GAAG,UAAQ,oCAcvF;AAED,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,KAAK,GAAE,WAAuB,oBAOtD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/react-native",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "React Native components for Nexub Design System — native chrome, Nexub content. Same tokens, brands and prop names as @nexub/react, for Expo and bare React Native apps.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/Nexub-AI/nexub-ds#readme",
@@ -63,9 +63,9 @@
63
63
  "@expo-google-fonts/inter": "^0.4.2",
64
64
  "@expo-google-fonts/plus-jakarta-sans": "^0.4.2",
65
65
  "lucide-react-native": "^1.64.0",
66
- "@nexub/core": "2.1.0",
67
- "@nexub/icons": "2.1.0",
68
- "@nexub/tokens": "2.1.0"
66
+ "@nexub/core": "2.3.0",
67
+ "@nexub/icons": "2.3.0",
68
+ "@nexub/tokens": "2.3.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "expo-glass-effect": ">=57.0.0",
@@ -6,12 +6,14 @@ import {
6
6
  type ViewProps,
7
7
  type ViewStyle,
8
8
  } from 'react-native';
9
+ import Animated, { LayoutAnimationConfig } from 'react-native-reanimated';
9
10
  import { Check, ChevronDown, ChevronRight } from '@nexub/icons/native';
10
11
  import { useControllableState } from '../hooks/useControllableState';
11
12
  import { Pressable } from '../primitives/Pressable';
12
13
  import { Surface, type SurfaceProps } from '../primitives/Surface';
13
14
  import { Text } from '../primitives/Text';
14
15
  import { useTheme } from '../theme/ThemeProvider';
16
+ import { nxEnter, nxExit, nxLayout } from '../theme/motion';
15
17
  import { Divider } from './display';
16
18
  import { disabledOpacity } from './shared';
17
19
 
@@ -261,12 +263,21 @@ export function ListSection({
261
263
  backgroundColor: roles['surface-container-lowest'],
262
264
  }}
263
265
  >
264
- {rows.map((row, i) => (
265
- <React.Fragment key={i}>
266
- {i > 0 && <Divider inset={inset} />}
267
- {row}
268
- </React.Fragment>
269
- ))}
266
+ {/* Rows added later grow in, removed rows fade out and the rest glide
267
+ into place. Rows present on first render don't animate. */}
268
+ <LayoutAnimationConfig skipEntering>
269
+ {rows.map((row, i) => (
270
+ <Animated.View
271
+ key={React.isValidElement(row) && row.key != null ? row.key : i}
272
+ entering={nxEnter('fade')}
273
+ exiting={nxExit('fade')}
274
+ layout={nxLayout()}
275
+ >
276
+ {i > 0 && <Divider inset={inset} />}
277
+ {row}
278
+ </Animated.View>
279
+ ))}
280
+ </LayoutAnimationConfig>
270
281
  </View>
271
282
  {footer && (
272
283
  <Text
@@ -7,15 +7,23 @@ import {
7
7
  type ViewProps,
8
8
  type ViewStyle,
9
9
  } from 'react-native';
10
+ import Animated, { LayoutAnimationConfig } from 'react-native-reanimated';
10
11
  import { moneyFormatter, type ToneValue } from '@nexub/core';
11
12
  import type { NativeIconProps } from '@nexub/icons/native';
12
13
  import { Text } from '../primitives/Text';
13
14
  import { useTheme } from '../theme/ThemeProvider';
15
+ import { nxEnter } from '../theme/motion';
14
16
  import { TONE_CONTAINERS, TONE_ROLES, TONE_TEXT } from './shared';
15
17
 
16
18
  // ─── Amount ──────────────────────────────────────────────────────────────────
17
19
 
18
20
  export interface AmountProps {
21
+ /**
22
+ * Animate value changes: the new figure rises in on the spatial spring.
23
+ * Wraps the text in a view, so leave it off when Amount sits inside other text.
24
+ * @default false
25
+ */
26
+ animate?: boolean;
19
27
  value: number;
20
28
  /** ISO 4217 code, e.g. 'USD', 'EUR', 'INR'. */
21
29
  currency: string;
@@ -45,8 +53,31 @@ export function Amount({
45
53
  size = 'md',
46
54
  tone = 'neutral',
47
55
  signDisplay,
56
+ animate = false,
48
57
  style,
49
58
  }: AmountProps) {
59
+ const figure = (
60
+ <AmountFigure value={value} currency={currency} locale={locale} size={size} tone={tone} signDisplay={signDisplay} style={style} />
61
+ );
62
+ if (!animate) return figure;
63
+ return (
64
+ <LayoutAnimationConfig skipEntering>
65
+ <Animated.View key={value} entering={nxEnter('up', 'fast')} style={{ alignSelf: 'flex-start' }}>
66
+ {figure}
67
+ </Animated.View>
68
+ </LayoutAnimationConfig>
69
+ );
70
+ }
71
+
72
+ function AmountFigure({
73
+ value,
74
+ currency,
75
+ locale,
76
+ size = 'md',
77
+ tone = 'neutral',
78
+ signDisplay,
79
+ style,
80
+ }: Omit<AmountProps, 'animate'>) {
50
81
  const theme = useTheme();
51
82
  const fmt = moneyFormatter(currency, locale ?? theme.locale, signDisplay ? { signDisplay } : {});
52
83
  const color = tone === 'auto' && value !== 0 ? (value > 0 ? 'success' : 'error') : 'on-surface';
@@ -12,6 +12,7 @@ import {
12
12
  import Animated, {
13
13
  FadeInDown,
14
14
  FadeOutDown,
15
+ ReduceMotion,
15
16
  useAnimatedStyle,
16
17
  useSharedValue,
17
18
  withRepeat,
@@ -31,6 +32,7 @@ import {
31
32
  import { Surface } from '../primitives/Surface';
32
33
  import { Text } from '../primitives/Text';
33
34
  import { useTheme } from '../theme/ThemeProvider';
35
+ import { nxEnter, nxExit, nxLayout } from '../theme/motion';
34
36
  import { Button, IconButton } from './actions';
35
37
  import { TONE_CONTAINERS, TONE_TEXT } from './shared';
36
38
 
@@ -67,7 +69,11 @@ export function Banner({
67
69
  const [bg, fg] = TONE_CONTAINERS[tone];
68
70
  const Glyph = TONE_ICON[tone] ?? Info;
69
71
  return (
70
- <View
72
+ // Drops in when shown, fades out when dismissed; content below glides up.
73
+ <Animated.View
74
+ entering={nxEnter('down')}
75
+ exiting={nxExit('fade')}
76
+ layout={nxLayout()}
71
77
  accessibilityRole={tone === 'danger' || tone === 'warning' ? 'alert' : 'summary'}
72
78
  style={[
73
79
  {
@@ -106,7 +112,7 @@ export function Banner({
106
112
  style={{ marginTop: -8, marginEnd: -8 }}
107
113
  />
108
114
  )}
109
- </View>
115
+ </Animated.View>
110
116
  );
111
117
  }
112
118
 
@@ -151,6 +157,8 @@ export function ToastProvider({ children, bottomOffset = 0 }: ToastProviderProps
151
157
  <ToastCtx.Provider value={show}>
152
158
  {children}
153
159
  {toast && (
160
+ // Reanimated's stock fade, as in 2.1.0. With the nxEnter/nxExit presets
161
+ // (spring or timed) iOS UI tests never found the toast on screen.
154
162
  <Animated.View
155
163
  key={toast.id}
156
164
  entering={FadeInDown}
@@ -410,12 +418,20 @@ export interface SkeletonProps {
410
418
  style?: StyleProp<ViewStyle>;
411
419
  }
412
420
 
413
- /** Loading placeholder. Pulses gently; static under Reduce Motion. Hidden from screen readers. */
421
+ /**
422
+ * Loading placeholder. Breathes between full and half opacity (a slow, calm
423
+ * shimmer); static under Reduce Motion. Hidden from screen readers.
424
+ */
414
425
  export function Skeleton({ width = '100%', height = 16, radius = 'field', style }: SkeletonProps) {
415
426
  const { roles, tokens, reducedMotion } = useTheme();
416
427
  const pulse = useSharedValue(1);
417
428
  React.useEffect(() => {
418
- if (!reducedMotion) pulse.value = withRepeat(withTiming(0.5, { duration: 900 }), -1, true);
429
+ if (reducedMotion) return;
430
+ pulse.value = withRepeat(
431
+ withTiming(0.5, { duration: SHIMMER_MS, reduceMotion: ReduceMotion.System }),
432
+ -1,
433
+ true,
434
+ );
419
435
  }, [reducedMotion, pulse]);
420
436
  const animated = useAnimatedStyle(() => ({ opacity: pulse.value }));
421
437
  return (
@@ -436,6 +452,9 @@ export function Skeleton({ width = '100%', height = 16, radius = 'field', style
436
452
  );
437
453
  }
438
454
 
455
+ // Half a skeleton breath, matching web's animate-pulse (2 s per cycle).
456
+ const SHIMMER_MS = 1000;
457
+
439
458
  // ─── EmptyState / ErrorState ─────────────────────────────────────────────────
440
459
 
441
460
  export interface EmptyStateProps extends ViewProps {
@@ -19,11 +19,18 @@ import {
19
19
  X,
20
20
  type NativeIconProps,
21
21
  } from '@nexub/icons/native';
22
+ import Animated, {
23
+ LayoutAnimationConfig,
24
+ useAnimatedStyle,
25
+ useSharedValue,
26
+ withSpring,
27
+ } from 'react-native-reanimated';
22
28
  import { useControllableState } from '../hooks/useControllableState';
23
29
  import { Pressable } from '../primitives/Pressable';
24
30
  import { Text } from '../primitives/Text';
25
31
  import { fontStyle } from '../theme/fonts';
26
32
  import { useHaptics, useTheme } from '../theme/ThemeProvider';
33
+ import { nxEnter, nxExit, nxLayout, nxSpring } from '../theme/motion';
27
34
  import { IconButton } from './actions';
28
35
  import { controlHeight, disabledOpacity, hitSlopFor } from './shared';
29
36
 
@@ -606,10 +613,26 @@ export function SegmentedControl<T extends string>({
606
613
  defaultValue: defaultValue ?? options[0]!.value,
607
614
  onChange: onValueChange,
608
615
  });
616
+ // The selected pill slides between segments on the spatial spring. Until the
617
+ // track is measured, the selected segment paints its own background.
618
+ const [trackWidth, setTrackWidth] = React.useState(0);
619
+ const index = Math.max(0, options.findIndex((o) => o.value === v));
620
+ const segment = trackWidth > 0 ? (trackWidth - 6) / options.length : 0;
621
+ const offset = useSharedValue(index * segment);
622
+ const measured = React.useRef(false);
623
+ React.useEffect(() => {
624
+ if (segment === 0) return;
625
+ const to = index * segment * (theme.dir === 'rtl' ? -1 : 1);
626
+ // First measure places the pill; later changes slide it.
627
+ offset.value = measured.current ? withSpring(to, nxSpring('spatial', 'default')) : to;
628
+ measured.current = true;
629
+ }, [index, segment, theme.dir, offset]);
630
+ const indicator = useAnimatedStyle(() => ({ transform: [{ translateX: offset.value }] }));
609
631
  return (
610
632
  <View
611
633
  accessibilityRole="tablist"
612
634
  accessibilityLabel={label}
635
+ onLayout={(e) => setTrackWidth(e.nativeEvent.layout.width)}
613
636
  style={[
614
637
  {
615
638
  flexDirection: 'row',
@@ -620,6 +643,24 @@ export function SegmentedControl<T extends string>({
620
643
  style,
621
644
  ]}
622
645
  >
646
+ {segment > 0 && (
647
+ <Animated.View
648
+ pointerEvents="none"
649
+ style={[
650
+ {
651
+ position: 'absolute',
652
+ top: 3,
653
+ bottom: 3,
654
+ start: 3,
655
+ width: segment,
656
+ borderRadius: tokens.shape.control,
657
+ backgroundColor: roles['surface-container-lowest'],
658
+ boxShadow: theme.elevation(1),
659
+ },
660
+ indicator,
661
+ ]}
662
+ />
663
+ )}
623
664
  {options.map((o) => {
624
665
  const on = o.value === v;
625
666
  return (
@@ -639,10 +680,11 @@ export function SegmentedControl<T extends string>({
639
680
  alignItems: 'center',
640
681
  justifyContent: 'center',
641
682
  },
642
- on && {
643
- backgroundColor: roles['surface-container-lowest'],
644
- boxShadow: theme.elevation(1),
645
- },
683
+ on &&
684
+ segment === 0 && {
685
+ backgroundColor: roles['surface-container-lowest'],
686
+ boxShadow: theme.elevation(1),
687
+ },
646
688
  ]}
647
689
  >
648
690
  <Text
@@ -790,7 +832,9 @@ export function Chip({
790
832
  const height = controlHeight(theme, 'sm');
791
833
  const fg = selected ? 'on-secondary-container' : 'on-surface-variant';
792
834
  return (
793
- <View
835
+ // Selecting grows the chip for its check: the width change glides.
836
+ <Animated.View
837
+ layout={nxLayout('fast')}
794
838
  style={[
795
839
  {
796
840
  flexDirection: 'row',
@@ -823,11 +867,15 @@ export function Chip({
823
867
  backgroundColor: selected ? roles['secondary-container'] : 'transparent',
824
868
  }}
825
869
  >
826
- {selected ? (
827
- <Check size="sm" color={roles[fg]} />
828
- ) : (
829
- Lead && <Lead size="sm" color={roles[fg]} />
830
- )}
870
+ <LayoutAnimationConfig skipEntering>
871
+ {selected ? (
872
+ <Animated.View key="check" entering={nxEnter('scale', 'fast')} exiting={nxExit('scale')}>
873
+ <Check size="sm" color={roles[fg]} />
874
+ </Animated.View>
875
+ ) : (
876
+ Lead && <Lead size="sm" color={roles[fg]} />
877
+ )}
878
+ </LayoutAnimationConfig>
831
879
  <Text variant="label-lg" color={fg}>
832
880
  {label}
833
881
  </Text>
@@ -841,7 +889,7 @@ export function Chip({
841
889
  style={{ position: 'absolute', end: 4, top: (height - controlHeight(theme, 'xs')) / 2 }}
842
890
  />
843
891
  )}
844
- </View>
892
+ </Animated.View>
845
893
  );
846
894
  }
847
895
 
@@ -25,6 +25,7 @@ import { Surface } from '../primitives/Surface';
25
25
  import { Text } from '../primitives/Text';
26
26
  import { fontStyle } from '../theme/fonts';
27
27
  import { useHaptics, useTheme, type RoleName } from '../theme/ThemeProvider';
28
+ import { nxExit, nxLayout, nxSpring } from '../theme/motion';
28
29
  import { Button, IconButton } from './actions';
29
30
  import { Banner } from './feedback';
30
31
  import { BottomSheet } from './overlays';
@@ -63,11 +64,10 @@ export function SwipeableRow({ label, onPress, actions, children, style }: Swipe
63
64
  const sign = dir === 'rtl' ? 1 : -1; // open = content moves toward the start edge
64
65
  const x = useSharedValue(0);
65
66
  const open = React.useRef(false);
66
- const spring = useTheme().tokens.motion.spring.spatial.default;
67
67
  const settle = (to: boolean) => {
68
68
  if (to !== open.current) play('snap');
69
69
  open.current = to;
70
- x.value = withSpring(to ? sign * width : 0, spring);
70
+ x.value = withSpring(to ? sign * width : 0, nxSpring('spatial', 'default'));
71
71
  };
72
72
  const responder = React.useMemo(
73
73
  () =>
@@ -96,7 +96,11 @@ export function SwipeableRow({ label, onPress, actions, children, style }: Swipe
96
96
  primary: ['primary', 'on-primary'],
97
97
  };
98
98
  return (
99
- <View
99
+ // Removed (e.g. swipe-to-delete): slides out toward the start edge while the
100
+ // rows below glide up. In a FlatList, pass nxLayout() as itemLayoutAnimation.
101
+ <Animated.View
102
+ exiting={nxExit('start', 'default', dir === 'rtl')}
103
+ layout={nxLayout()}
100
104
  style={[{ overflow: 'hidden' }, style]}
101
105
  // One screen-reader element for the row: its name, its tap, and every swipe action.
102
106
  accessible
@@ -152,7 +156,7 @@ export function SwipeableRow({ label, onPress, actions, children, style }: Swipe
152
156
  >
153
157
  {children}
154
158
  </Animated.View>
155
- </View>
159
+ </Animated.View>
156
160
  );
157
161
  }
158
162
 
@@ -24,8 +24,11 @@ import { useControllableState } from '../hooks/useControllableState';
24
24
  import { Pressable } from '../primitives/Pressable';
25
25
  import { Text } from '../primitives/Text';
26
26
  import { useHaptics, useTheme } from '../theme/ThemeProvider';
27
+ import { nxSpring } from '../theme/motion';
27
28
  import { ListItem, ListSection } from './containers';
28
29
 
30
+ const SHEET_SPRING = nxSpring('spatial', 'default');
31
+
29
32
  // ─── BottomSheet ─────────────────────────────────────────────────────────────
30
33
 
31
34
  export type SheetDetent = 'content' | number;
@@ -76,7 +79,7 @@ export function BottomSheet({
76
79
  const [visible, setVisible] = React.useState(open);
77
80
  const translate = useSharedValue(screen);
78
81
  const scrim = useSharedValue(0);
79
- const spring = tokens.motion.spring.spatial.default;
82
+ const spring = SHEET_SPRING;
80
83
  const height = heights[Math.min(index, heights.length - 1)]!;
81
84
  const tallest = heights[heights.length - 1]!;
82
85
 
package/src/index.ts CHANGED
@@ -20,6 +20,8 @@ export { nexubFonts, fontStyle } from './theme/fonts';
20
20
  export type { FontFamily, FontSource } from './theme/fonts';
21
21
  export { playHaptic } from './theme/haptics';
22
22
  export type { HapticToken } from './theme/haptics';
23
+ export { nxSpring, nxEnter, nxExit, nxLayout } from './theme/motion';
24
+ export type { SpringFamily, SpringSpeed, EnterKind, ExitKind } from './theme/motion';
23
25
  export { useControllableState } from './hooks/useControllableState';
24
26
 
25
27
  // Primitives