@nexub/react-native 0.0.0-stage → 2.2.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.
- package/README.md +113 -2
- package/lib/module/components/actions.js +222 -0
- package/lib/module/components/actions.js.map +1 -0
- package/lib/module/components/containers.js +300 -0
- package/lib/module/components/containers.js.map +1 -0
- package/lib/module/components/display.js +299 -0
- package/lib/module/components/display.js.map +1 -0
- package/lib/module/components/feedback.js +484 -0
- package/lib/module/components/feedback.js.map +1 -0
- package/lib/module/components/inputs.js +792 -0
- package/lib/module/components/inputs.js.map +1 -0
- package/lib/module/components/mobile.js +818 -0
- package/lib/module/components/mobile.js.map +1 -0
- package/lib/module/components/overlays.js +421 -0
- package/lib/module/components/overlays.js.map +1 -0
- package/lib/module/components/shared.js +57 -0
- package/lib/module/components/shared.js.map +1 -0
- package/lib/module/hooks/useControllableState.js +23 -0
- package/lib/module/hooks/useControllableState.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/patterns/app.js +709 -0
- package/lib/module/patterns/app.js.map +1 -0
- package/lib/module/patterns/auth.js +224 -0
- package/lib/module/patterns/auth.js.map +1 -0
- package/lib/module/patterns/home.js +201 -0
- package/lib/module/patterns/home.js.map +1 -0
- package/lib/module/patterns/index.js +8 -0
- package/lib/module/patterns/index.js.map +1 -0
- package/lib/module/patterns/money.js +419 -0
- package/lib/module/patterns/money.js.map +1 -0
- package/lib/module/primitives/Icon.js +17 -0
- package/lib/module/primitives/Icon.js.map +1 -0
- package/lib/module/primitives/Layout.js +79 -0
- package/lib/module/primitives/Layout.js.map +1 -0
- package/lib/module/primitives/Pressable.js +79 -0
- package/lib/module/primitives/Pressable.js.map +1 -0
- package/lib/module/primitives/ScreenContainer.js +58 -0
- package/lib/module/primitives/ScreenContainer.js.map +1 -0
- package/lib/module/primitives/Surface.js +57 -0
- package/lib/module/primitives/Surface.js.map +1 -0
- package/lib/module/primitives/Text.js +70 -0
- package/lib/module/primitives/Text.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +127 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/fonts.js +56 -0
- package/lib/module/theme/fonts.js.map +1 -0
- package/lib/module/theme/haptics.js +56 -0
- package/lib/module/theme/haptics.js.map +1 -0
- package/lib/module/theme/motion.js +89 -0
- package/lib/module/theme/motion.js.map +1 -0
- package/lib/module/theme/navigation.js +99 -0
- package/lib/module/theme/navigation.js.map +1 -0
- package/lib/typescript/components/actions.d.ts +53 -0
- package/lib/typescript/components/actions.d.ts.map +1 -0
- package/lib/typescript/components/containers.d.ts +59 -0
- package/lib/typescript/components/containers.d.ts.map +1 -0
- package/lib/typescript/components/display.d.ts +68 -0
- package/lib/typescript/components/display.d.ts.map +1 -0
- package/lib/typescript/components/feedback.d.ts +96 -0
- package/lib/typescript/components/feedback.d.ts.map +1 -0
- package/lib/typescript/components/inputs.d.ts +141 -0
- package/lib/typescript/components/inputs.d.ts.map +1 -0
- package/lib/typescript/components/mobile.d.ts +173 -0
- package/lib/typescript/components/mobile.d.ts.map +1 -0
- package/lib/typescript/components/overlays.d.ts +74 -0
- package/lib/typescript/components/overlays.d.ts.map +1 -0
- package/lib/typescript/components/shared.d.ts +20 -0
- package/lib/typescript/components/shared.d.ts.map +1 -0
- package/lib/typescript/hooks/useControllableState.d.ts +6 -0
- package/lib/typescript/hooks/useControllableState.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +39 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/patterns/app.d.ts +139 -0
- package/lib/typescript/patterns/app.d.ts.map +1 -0
- package/lib/typescript/patterns/auth.d.ts +54 -0
- package/lib/typescript/patterns/auth.d.ts.map +1 -0
- package/lib/typescript/patterns/home.d.ts +50 -0
- package/lib/typescript/patterns/home.d.ts.map +1 -0
- package/lib/typescript/patterns/index.d.ts +9 -0
- package/lib/typescript/patterns/index.d.ts.map +1 -0
- package/lib/typescript/patterns/money.d.ts +106 -0
- package/lib/typescript/patterns/money.d.ts.map +1 -0
- package/lib/typescript/primitives/Icon.d.ts +12 -0
- package/lib/typescript/primitives/Icon.d.ts.map +1 -0
- package/lib/typescript/primitives/Layout.d.ts +26 -0
- package/lib/typescript/primitives/Layout.d.ts.map +1 -0
- package/lib/typescript/primitives/Pressable.d.ts +21 -0
- package/lib/typescript/primitives/Pressable.d.ts.map +1 -0
- package/lib/typescript/primitives/ScreenContainer.d.ts +25 -0
- package/lib/typescript/primitives/ScreenContainer.d.ts.map +1 -0
- package/lib/typescript/primitives/Surface.d.ts +23 -0
- package/lib/typescript/primitives/Surface.d.ts.map +1 -0
- package/lib/typescript/primitives/Text.d.ts +21 -0
- package/lib/typescript/primitives/Text.d.ts.map +1 -0
- package/lib/typescript/theme/ThemeProvider.d.ts +69 -0
- package/lib/typescript/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/theme/fonts.d.ts +25 -0
- package/lib/typescript/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/theme/haptics.d.ts +3 -0
- package/lib/typescript/theme/haptics.d.ts.map +1 -0
- package/lib/typescript/theme/motion.d.ts +79 -0
- package/lib/typescript/theme/motion.d.ts.map +1 -0
- package/lib/typescript/theme/navigation.d.ts +158 -0
- package/lib/typescript/theme/navigation.d.ts.map +1 -0
- package/package.json +138 -3
- package/src/components/actions.tsx +259 -0
- package/src/components/containers.tsx +352 -0
- package/src/components/display.tsx +345 -0
- package/src/components/feedback.tsx +541 -0
- package/src/components/inputs.tsx +899 -0
- package/src/components/mobile.tsx +883 -0
- package/src/components/overlays.tsx +488 -0
- package/src/components/shared.ts +54 -0
- package/src/hooks/useControllableState.ts +27 -0
- package/src/index.ts +177 -0
- package/src/patterns/app.tsx +715 -0
- package/src/patterns/auth.tsx +266 -0
- package/src/patterns/home.tsx +211 -0
- package/src/patterns/index.ts +59 -0
- package/src/patterns/money.tsx +458 -0
- package/src/primitives/Icon.tsx +15 -0
- package/src/primitives/Layout.tsx +71 -0
- package/src/primitives/Pressable.tsx +97 -0
- package/src/primitives/ScreenContainer.tsx +65 -0
- package/src/primitives/Surface.tsx +75 -0
- package/src/primitives/Text.tsx +79 -0
- package/src/theme/ThemeProvider.tsx +210 -0
- package/src/theme/fonts.ts +52 -0
- package/src/theme/haptics.ts +57 -0
- package/src/theme/motion.ts +105 -0
- package/src/theme/navigation.ts +68 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type NativeIconProps } from '@nexub/icons/native';
|
|
3
|
+
import { type SwipeAction } from '../components/mobile.js';
|
|
4
|
+
export interface FlowStepProps {
|
|
5
|
+
/** 1-based. */
|
|
6
|
+
step: number;
|
|
7
|
+
total: number;
|
|
8
|
+
title: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
footer: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** One step of a multi-step flow: progress, title, content, sticky primary action. */
|
|
13
|
+
export declare function FlowStep({ step, total, title, children, footer }: FlowStepProps): React.JSX.Element;
|
|
14
|
+
export interface Quote {
|
|
15
|
+
fee: number;
|
|
16
|
+
/** Units of `to` per unit of `from`. */
|
|
17
|
+
rate: number;
|
|
18
|
+
/** e.g. "In seconds", "By Friday". */
|
|
19
|
+
arrives: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AmountStepProps {
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
/** Available balance in `from`. */
|
|
25
|
+
balance: number;
|
|
26
|
+
/** Quote for an amount (fees and rate shown before anything else, like Wise). */
|
|
27
|
+
quote: (amount: number) => Quote;
|
|
28
|
+
onContinue: (amount: number) => void;
|
|
29
|
+
step?: number;
|
|
30
|
+
total?: number;
|
|
31
|
+
}
|
|
32
|
+
/** Amount entry with the fee, rate and arrival shown live. */
|
|
33
|
+
export declare function AmountStep({ from, to, balance, quote, onContinue, step, total, }: AmountStepProps): React.JSX.Element;
|
|
34
|
+
export interface ReviewRow {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ReviewStepProps {
|
|
39
|
+
rows: ReviewRow[];
|
|
40
|
+
/** "Confirm and send". */
|
|
41
|
+
confirmLabel: string;
|
|
42
|
+
onConfirm: () => void;
|
|
43
|
+
/** Biometric confirmation, named: "Confirm with Face ID". Shown as the hint under the button. */
|
|
44
|
+
confirmHint?: string;
|
|
45
|
+
loading?: boolean;
|
|
46
|
+
step?: number;
|
|
47
|
+
total?: number;
|
|
48
|
+
}
|
|
49
|
+
/** Summary before money moves: every number visible, one confirming action. */
|
|
50
|
+
export declare function ReviewStep({ rows, confirmLabel, onConfirm, confirmHint, loading, step, total, }: ReviewStepProps): React.JSX.Element;
|
|
51
|
+
export interface Transaction {
|
|
52
|
+
id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
subtitle?: string;
|
|
55
|
+
/** Negative = money out. */
|
|
56
|
+
amount: number;
|
|
57
|
+
currency: string;
|
|
58
|
+
date: Date;
|
|
59
|
+
status?: 'pending' | 'failed';
|
|
60
|
+
/** Avatar image URL. */
|
|
61
|
+
image?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ActivityListProps {
|
|
64
|
+
transactions: Transaction[];
|
|
65
|
+
onPress?: (t: Transaction) => void;
|
|
66
|
+
onRefresh?: () => void;
|
|
67
|
+
refreshing?: boolean;
|
|
68
|
+
onEndReached?: () => void;
|
|
69
|
+
/** Swipe actions per row (also accessibility actions). */
|
|
70
|
+
actions?: (t: Transaction) => SwipeAction[];
|
|
71
|
+
header?: React.ReactElement;
|
|
72
|
+
empty?: React.ReactElement;
|
|
73
|
+
}
|
|
74
|
+
/** Transactions grouped by day, with pull-to-refresh, paging and swipe actions (web ActivityFeed). */
|
|
75
|
+
export declare function ActivityList({ transactions, onPress, onRefresh, refreshing, onEndReached, actions, header, empty, }: ActivityListProps): React.JSX.Element;
|
|
76
|
+
export interface TransactionDetailProps {
|
|
77
|
+
transaction: Transaction;
|
|
78
|
+
/** Extra rows: reference, account, category… */
|
|
79
|
+
rows?: ReviewRow[];
|
|
80
|
+
actions?: React.ReactNode;
|
|
81
|
+
}
|
|
82
|
+
/** One transaction: hero amount, status, summary rows (web InfoList). */
|
|
83
|
+
export declare function TransactionDetail({ transaction: t, rows, actions }: TransactionDetailProps): React.JSX.Element;
|
|
84
|
+
export interface ResultScreenProps {
|
|
85
|
+
/** @default 'success' */
|
|
86
|
+
kind?: 'success' | 'error' | 'offline' | 'maintenance' | 'update';
|
|
87
|
+
title: string;
|
|
88
|
+
description?: string;
|
|
89
|
+
/** Hero figure (e.g. the amount sent). */
|
|
90
|
+
amount?: {
|
|
91
|
+
value: number;
|
|
92
|
+
currency: string;
|
|
93
|
+
};
|
|
94
|
+
primary: {
|
|
95
|
+
label: string;
|
|
96
|
+
onPress: () => void;
|
|
97
|
+
};
|
|
98
|
+
secondary?: {
|
|
99
|
+
label: string;
|
|
100
|
+
onPress: () => void;
|
|
101
|
+
};
|
|
102
|
+
icon?: React.ComponentType<NativeIconProps>;
|
|
103
|
+
}
|
|
104
|
+
/** Full-screen outcome: success, error, offline, maintenance, or "update required". */
|
|
105
|
+
export declare function ResultScreen({ kind, title, description, amount, primary, secondary, icon, }: ResultScreenProps): React.JSX.Element;
|
|
106
|
+
//# sourceMappingURL=money.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../src/patterns/money.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtF,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,yBAAsB,CAAC;AAO9B,MAAM,WAAW,aAAa;IAC5B,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EA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OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,IAAS,EAAE,OAAO,EAAE,EAAE,sBAAsB,qBAwC/F;AAID,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAChD,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACnD,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;CAC7C;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,EAC3B,IAAgB,EAChB,KAAK,EACL,WAAW,EACX,MAAM,EACN,OAAO,EACP,SAAS,EACT,IAAI,GACL,EAAE,iBAAiB,qBAuDnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { NativeIconProps } from '@nexub/icons/native';
|
|
3
|
+
import { type RoleName } from '../theme/ThemeProvider.js';
|
|
4
|
+
export interface IconProps extends Omit<NativeIconProps, 'color'> {
|
|
5
|
+
/** An icon from `@nexub/icons/native`, e.g. `Search`. */
|
|
6
|
+
icon: React.ComponentType<NativeIconProps>;
|
|
7
|
+
/** Colour role. @default 'on-surface-variant' */
|
|
8
|
+
color?: RoleName;
|
|
9
|
+
}
|
|
10
|
+
/** An `@nexub/icons/native` icon coloured by a role. Decorative unless `label` is set. */
|
|
11
|
+
export declare function Icon({ icon: Glyph, color, ...rest }: IconProps): React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AAEjE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IAC/D,yDAAyD;IACzD,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAC3C,iDAAiD;IACjD,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,0FAA0F;AAC1F,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAA4B,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,qBAErF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ViewProps, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { NativeTokens } from '@nexub/tokens/native';
|
|
4
|
+
import { type RoleName } from '../theme/ThemeProvider.js';
|
|
5
|
+
import type { ShapeName } from './Surface.js';
|
|
6
|
+
export type Space = keyof NativeTokens['spacing'];
|
|
7
|
+
export interface BoxProps extends ViewProps {
|
|
8
|
+
/** Padding on every side (spacing token). */
|
|
9
|
+
padding?: Space;
|
|
10
|
+
/** Horizontal padding (start + end, so RTL is free). */
|
|
11
|
+
paddingX?: Space;
|
|
12
|
+
paddingY?: Space;
|
|
13
|
+
/** Gap between children. */
|
|
14
|
+
gap?: Space;
|
|
15
|
+
background?: RoleName;
|
|
16
|
+
radius?: ShapeName;
|
|
17
|
+
align?: ViewStyle['alignItems'];
|
|
18
|
+
justify?: ViewStyle['justifyContent'];
|
|
19
|
+
flex?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function Box({ style, ...props }: BoxProps): React.JSX.Element;
|
|
22
|
+
/** Children in a column. @default gap '3' */
|
|
23
|
+
export declare function Stack({ gap, style, ...props }: BoxProps): React.JSX.Element;
|
|
24
|
+
/** Children in a row that wraps, centred on the cross axis. @default gap '2' */
|
|
25
|
+
export declare function Inline({ gap, align, style, ...props }: BoxProps): React.JSX.Element;
|
|
26
|
+
//# sourceMappingURL=Layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../src/primitives/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAW,CAAC;AAE3C,MAAM,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;AAElD,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,4BAA4B;IAC5B,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA4BD,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,qBAEhD;AAED,6CAA6C;AAC7C,wBAAgB,KAAK,CAAC,EAAE,GAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,qBAE7D;AAED,gFAAgF;AAChF,wBAAgB,MAAM,CAAC,EAAE,GAAS,EAAE,KAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,qBAWhF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type PressableProps as RNPressableProps, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticToken } from '../theme/haptics.js';
|
|
4
|
+
import { type RoleName } from '../theme/ThemeProvider.js';
|
|
5
|
+
export interface PressableProps extends Omit<RNPressableProps, 'style' | 'children'> {
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Haptic played on press (Apple: not for plain taps — toggles, selections, outcomes). */
|
|
9
|
+
haptic?: HapticToken;
|
|
10
|
+
/** On-colour of the state layer, or false for none. @default 'on-surface' */
|
|
11
|
+
stateLayer?: RoleName | false;
|
|
12
|
+
/** Press-scale target, or false for none. @default 0.97 */
|
|
13
|
+
pressScale?: number | false;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The base of every Nexub control: a state layer (on-colour at the pressed
|
|
17
|
+
* opacity) and a 0.97 press-scale on the spatial-fast spring. No ripple.
|
|
18
|
+
* Reduce Motion is honoured by Reanimated (ReduceMotion.System).
|
|
19
|
+
*/
|
|
20
|
+
export declare function Pressable({ style, children, haptic, stateLayer, pressScale, disabled, onPress, onPressIn, onPressOut, ...rest }: PressableProps): React.JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ScrollViewProps, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type Edge } from 'react-native-safe-area-context';
|
|
4
|
+
import { type RoleName } from '../theme/ThemeProvider.js';
|
|
5
|
+
import type { Space } from './Layout.js';
|
|
6
|
+
export interface ScreenContainerProps extends Omit<ScrollViewProps, 'contentContainerStyle'> {
|
|
7
|
+
/** Scrolls (and lets a native large title collapse). @default true */
|
|
8
|
+
scroll?: boolean;
|
|
9
|
+
/** Safe-area edges to pad. A native header already covers 'top'. @default ['left', 'right', 'bottom'] */
|
|
10
|
+
edges?: Edge[];
|
|
11
|
+
/** @default 'surface' */
|
|
12
|
+
background?: RoleName;
|
|
13
|
+
/** Content padding. @default '4' */
|
|
14
|
+
padding?: Space;
|
|
15
|
+
/** Gap between children. @default '4' */
|
|
16
|
+
gap?: Space;
|
|
17
|
+
contentStyle?: ViewStyle;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The root of every screen: background, edge-to-edge safe-area insets and
|
|
21
|
+
* content padding. With `scroll`, iOS adjusts insets itself
|
|
22
|
+
* (contentInsetAdjustmentBehavior) so native large titles collapse.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ScreenContainer({ scroll, edges, background, padding, gap, contentStyle, children, style, ...rest }: ScreenContainerProps): React.JSX.Element;
|
|
25
|
+
//# sourceMappingURL=ScreenContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenContainer.d.ts","sourceRoot":"","sources":["../../../src/primitives/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAU,CAAC;AAEtC,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC;IAC1F,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yGAAyG;IACzG,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,yBAAyB;IACzB,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,oCAAoC;IACpC,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAa,EACb,KAAmC,EACnC,UAAsB,EACtB,OAAa,EACb,GAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,IAAI,EACR,EAAE,oBAAoB,qBA6BtB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ViewProps } from 'react-native';
|
|
3
|
+
import type { NativeTokens } from '@nexub/tokens/native';
|
|
4
|
+
import { type ElevationLevel, type RoleName } from '../theme/ThemeProvider.js';
|
|
5
|
+
export type SurfaceTone = Extract<RoleName, `surface${string}`>;
|
|
6
|
+
export type ShapeName = keyof NativeTokens['shape'];
|
|
7
|
+
export interface SurfaceProps extends ViewProps {
|
|
8
|
+
/** Tonal tier. @default 'surface' */
|
|
9
|
+
tone?: SurfaceTone;
|
|
10
|
+
/** @default 0 */
|
|
11
|
+
elevation?: ElevationLevel;
|
|
12
|
+
/** 'glass' is for the control layer only (bars, floating controls), never content. @default 'solid' */
|
|
13
|
+
material?: 'solid' | 'glass';
|
|
14
|
+
/** Corner radius: a shape token or dp. */
|
|
15
|
+
radius?: ShapeName | number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A tonal surface. `material="glass"` is native Liquid Glass on iOS 26+, and
|
|
19
|
+
* `surface-elevated` + hairline elsewhere, or whenever glass is 'off' (user
|
|
20
|
+
* setting or Reduce Transparency).
|
|
21
|
+
*/
|
|
22
|
+
export declare function Surface({ tone, elevation, material, radius, style, ...rest }: SurfaceProps): React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=Surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../src/primitives/Surface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AAYtF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,UAAU,MAAM,EAAE,CAAC,CAAC;AAChE,MAAM,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;AAEpD,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,qCAAqC;IACrC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,iBAAiB;IACjB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,uGAAuG;IACvG,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAgB,EAChB,SAAa,EACb,QAAkB,EAClB,MAAM,EACN,KAAK,EACL,GAAG,IAAI,EACR,EAAE,YAAY,qBAiCd"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type TextProps as RNTextProps } from 'react-native';
|
|
3
|
+
import type { NativeTypeRole } from '@nexub/tokens/native';
|
|
4
|
+
import { type FontFamily } from '../theme/fonts.js';
|
|
5
|
+
import { type RoleName } from '../theme/ThemeProvider.js';
|
|
6
|
+
export interface TextProps extends RNTextProps {
|
|
7
|
+
/** Type role. @default 'body-md' */
|
|
8
|
+
variant?: NativeTypeRole;
|
|
9
|
+
/** Colour role. @default 'on-surface' */
|
|
10
|
+
color?: RoleName;
|
|
11
|
+
/** Tabular figures, for numbers that line up. */
|
|
12
|
+
tabular?: boolean;
|
|
13
|
+
/** Overrides the role's family (e.g. 'mono' for codes). */
|
|
14
|
+
family?: FontFamily;
|
|
15
|
+
}
|
|
16
|
+
export declare function Text({ variant, color, tabular, family, style, ...rest }: TextProps): React.JSX.Element;
|
|
17
|
+
export interface HeadingProps extends TextProps {
|
|
18
|
+
}
|
|
19
|
+
/** Text announced as a heading. @default variant 'headline-sm' */
|
|
20
|
+
export declare function Heading({ variant, ...rest }: HeadingProps): React.JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/primitives/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkB,KAAK,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,mBAAgB,CAAC;AAC5D,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AA4BjE,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,oCAAoC;IACpC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,wBAAgB,IAAI,CAAC,EACnB,OAAmB,EACnB,KAAoB,EACpB,OAAO,EACP,MAAM,EACN,KAAK,EACL,GAAG,IAAI,EACR,EAAE,SAAS,qBAqBX;AAED,MAAM,WAAW,YAAa,SAAQ,SAAS;CAAG;AAElD,kEAAkE;AAClE,wBAAgB,OAAO,CAAC,EAAE,OAAuB,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY,qBAEzE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { native, type NativeRoles } from '@nexub/tokens/native';
|
|
3
|
+
import { type ContrastLevel, type Direction, type GlassMode, type NexubMessages, type Product } from '@nexub/core';
|
|
4
|
+
import { type HapticToken } from './haptics.js';
|
|
5
|
+
import type { FontSource } from './fonts.js';
|
|
6
|
+
export type Scheme = 'light' | 'dark';
|
|
7
|
+
export type Roles = {
|
|
8
|
+
-readonly [K in keyof NativeRoles]: string;
|
|
9
|
+
};
|
|
10
|
+
export type RoleName = keyof Roles;
|
|
11
|
+
export type ElevationLevel = 0 | 1 | 2 | 3;
|
|
12
|
+
export interface NexubTheme {
|
|
13
|
+
scheme: Scheme;
|
|
14
|
+
contrast: ContrastLevel;
|
|
15
|
+
product: Product | undefined;
|
|
16
|
+
/** Colour roles, already resolved for scheme, contrast, product and seed. */
|
|
17
|
+
roles: Roles;
|
|
18
|
+
/** Every native token (spacing, shape, size, type, state, motion). */
|
|
19
|
+
tokens: typeof native;
|
|
20
|
+
/** `boxShadow` for an elevation level, undefined for 0. */
|
|
21
|
+
elevation: (level: ElevationLevel) => string | undefined;
|
|
22
|
+
/** Effective glass: 'off' when the user has Reduce Transparency on. */
|
|
23
|
+
glass: GlassMode;
|
|
24
|
+
reducedMotion: boolean;
|
|
25
|
+
haptics: boolean;
|
|
26
|
+
fonts: FontSource;
|
|
27
|
+
locale: string;
|
|
28
|
+
dir: Direction;
|
|
29
|
+
messages: NexubMessages;
|
|
30
|
+
}
|
|
31
|
+
export interface NexubNativeProviderProps {
|
|
32
|
+
/** @default 'system' */
|
|
33
|
+
scheme?: Scheme | 'system';
|
|
34
|
+
/** 'system' = iOS Increase Contrast / Android high-contrast text → 'high'. @default 'system' */
|
|
35
|
+
contrast?: ContrastLevel | 'system';
|
|
36
|
+
/** Product brand: remaps the tertiary role family. */
|
|
37
|
+
product?: Product;
|
|
38
|
+
/** White-label seed colour (#rgb / #rrggbb); regenerates the `seedTarget` family. */
|
|
39
|
+
seed?: string;
|
|
40
|
+
/** @default 'primary' */
|
|
41
|
+
seedTarget?: 'primary' | 'tertiary';
|
|
42
|
+
/** Glass intensity (the app persists the user's choice). @default 'balanced' */
|
|
43
|
+
glass?: GlassMode;
|
|
44
|
+
/** Haptics on/off (user setting). @default true */
|
|
45
|
+
haptics?: boolean;
|
|
46
|
+
/** 'nexub' needs `nexubFonts` loaded; 'system' uses the platform font. @default 'nexub' */
|
|
47
|
+
fonts?: FontSource;
|
|
48
|
+
/** BCP 47 locale for Intl formatting. @default 'en' */
|
|
49
|
+
locale?: string;
|
|
50
|
+
/** @default derived from `locale` */
|
|
51
|
+
dir?: Direction;
|
|
52
|
+
/** Overrides for the default English strings. */
|
|
53
|
+
messages?: Partial<NexubMessages>;
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Theme, accessibility preferences, locale and strings for every
|
|
58
|
+
* @nexub/react-native component. Wrap the app once, inside the safe-area provider.
|
|
59
|
+
*/
|
|
60
|
+
export declare function NexubNativeProvider({ scheme: schemeProp, contrast: contrastProp, product, seed, seedTarget, glass, haptics, fonts, locale, dir, messages, children, }: NexubNativeProviderProps): React.JSX.Element;
|
|
61
|
+
/** The active theme. Throws outside NexubNativeProvider. */
|
|
62
|
+
export declare function useTheme(): NexubTheme;
|
|
63
|
+
/** Shorthand for `useTheme().roles`. */
|
|
64
|
+
export declare const useRoles: () => Roles;
|
|
65
|
+
/** The active strings: defaults merged with the provider's overrides. */
|
|
66
|
+
export declare const useNexubMessages: () => NexubMessages;
|
|
67
|
+
/** Plays a semantic haptic, unless the user turned haptics off. */
|
|
68
|
+
export declare function useHaptics(): (token: HapticToken) => void;
|
|
69
|
+
//# sourceMappingURL=ThemeProvider.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E,WAAW,KAAK,IAAI,CAGzD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const nexubFonts: {
|
|
2
|
+
Inter_400Regular: number;
|
|
3
|
+
Inter_500Medium: number;
|
|
4
|
+
Inter_600SemiBold: number;
|
|
5
|
+
Inter_700Bold: number;
|
|
6
|
+
PlusJakartaSans_600SemiBold: number;
|
|
7
|
+
PlusJakartaSans_700Bold: number;
|
|
8
|
+
PlusJakartaSans_800ExtraBold: number;
|
|
9
|
+
GeistMono_400Regular: number;
|
|
10
|
+
};
|
|
11
|
+
export type FontFamily = 'sans' | 'display' | 'mono';
|
|
12
|
+
export type FontSource = 'nexub' | 'system';
|
|
13
|
+
/**
|
|
14
|
+
* Style for a family + weight. With static files the weight lives in the file
|
|
15
|
+
* name, so `fontWeight` is only set for the system font (Android picks the
|
|
16
|
+
* wrong file when both are set).
|
|
17
|
+
*/
|
|
18
|
+
export declare function fontStyle(family: FontFamily, weight: number, source: FontSource): {
|
|
19
|
+
fontWeight: "400";
|
|
20
|
+
fontFamily?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
fontFamily: string | undefined;
|
|
23
|
+
fontWeight?: undefined;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/theme/fonts.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU;;;;;;;;;CAStB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAiB5C;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;gBACd,KAAK;;;;;EAGtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.d.ts","sourceRoot":"","sources":["../../../src/theme/haptics.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GACrB,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAqBrF,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CA6BnD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
* Settle time of a spring token (ms): when it is within 0.1% of rest. The
|
|
56
|
+
* same rule @nexub/tokens uses for the CSS spring durations.
|
|
57
|
+
*/
|
|
58
|
+
export declare function springSettleMs({ stiffness, damping, mass }: {
|
|
59
|
+
stiffness: number;
|
|
60
|
+
damping: number;
|
|
61
|
+
mass: number;
|
|
62
|
+
}): number;
|
|
63
|
+
/**
|
|
64
|
+
* `entering` animation, timed to the spatial spring.
|
|
65
|
+
* `up` rises into place (rows, toasts from below); `down` drops in (banners).
|
|
66
|
+
*
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <Animated.View entering={nxEnter('up')} exiting={nxExit('down')} layout={nxLayout()} />
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function nxEnter(kind?: EnterKind, speed?: SpringSpeed): FadeIn | FadeInUp | FadeInDown | ZoomIn;
|
|
72
|
+
/**
|
|
73
|
+
* `exiting` animation, timed to the effects spring: quicker than enter.
|
|
74
|
+
* `start` / `end` slide out toward that edge (swipe-to-delete), following RTL.
|
|
75
|
+
*/
|
|
76
|
+
export declare function nxExit(kind?: ExitKind, speed?: SpringSpeed, rtl?: boolean): FadeOut | ZoomOut | SlideOutLeft;
|
|
77
|
+
/** `layout` transition: siblings glide to their new place on the spatial spring. */
|
|
78
|
+
export declare function nxLayout(speed?: SpringSpeed): LinearTransition;
|
|
79
|
+
//# 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,EAEL,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;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,UAahH;AAUD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,GAAE,SAAkB,EAAE,KAAK,GAAE,WAAuB,2CAK/E;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,GAAE,QAAiB,EAAE,KAAK,GAAE,WAAoB,EAAE,GAAG,UAAQ,oCAWvF;AAED,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,KAAK,GAAE,WAAuB,oBAOtD"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { type NexubTheme } from './ThemeProvider.js';
|
|
2
|
+
/** Native stack `screenOptions`: large titles on a surface-coloured native header, Nexub type and tint. */
|
|
3
|
+
export declare function nexubStackOptions(theme: NexubTheme): {
|
|
4
|
+
headerLargeTitle: boolean;
|
|
5
|
+
headerTransparent: boolean;
|
|
6
|
+
headerShadowVisible: boolean;
|
|
7
|
+
headerLargeTitleShadowVisible: boolean;
|
|
8
|
+
headerTintColor: string;
|
|
9
|
+
headerStyle: {
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
};
|
|
12
|
+
headerTitleStyle: {
|
|
13
|
+
fontWeight: "400";
|
|
14
|
+
fontFamily?: undefined;
|
|
15
|
+
color: string;
|
|
16
|
+
} | {
|
|
17
|
+
fontFamily: string | undefined;
|
|
18
|
+
fontWeight?: undefined;
|
|
19
|
+
color: string;
|
|
20
|
+
};
|
|
21
|
+
headerLargeTitleStyle: {
|
|
22
|
+
fontWeight: "400";
|
|
23
|
+
fontFamily?: undefined;
|
|
24
|
+
color: string;
|
|
25
|
+
} | {
|
|
26
|
+
fontFamily: string | undefined;
|
|
27
|
+
fontWeight?: undefined;
|
|
28
|
+
color: string;
|
|
29
|
+
};
|
|
30
|
+
contentStyle: {
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** React Navigation `theme` (also Expo Router's ThemeProvider). */
|
|
35
|
+
export declare function nexubNavigationTheme(theme: NexubTheme): {
|
|
36
|
+
dark: boolean;
|
|
37
|
+
colors: {
|
|
38
|
+
primary: string;
|
|
39
|
+
background: string;
|
|
40
|
+
card: string;
|
|
41
|
+
text: string;
|
|
42
|
+
border: string;
|
|
43
|
+
notification: string;
|
|
44
|
+
};
|
|
45
|
+
fonts: {
|
|
46
|
+
regular: {
|
|
47
|
+
fontFamily: string;
|
|
48
|
+
fontWeight: "400";
|
|
49
|
+
};
|
|
50
|
+
medium: {
|
|
51
|
+
fontFamily: string;
|
|
52
|
+
fontWeight: "400";
|
|
53
|
+
};
|
|
54
|
+
bold: {
|
|
55
|
+
fontFamily: string;
|
|
56
|
+
fontWeight: "400";
|
|
57
|
+
};
|
|
58
|
+
heavy: {
|
|
59
|
+
fontFamily: string;
|
|
60
|
+
fontWeight: "400";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/** Colours for native tab bars (Expo Router NativeTabs / react-native-bottom-tabs). */
|
|
65
|
+
export declare function nexubTabsOptions(theme: NexubTheme): {
|
|
66
|
+
tintColor: string;
|
|
67
|
+
inactiveTintColor: string;
|
|
68
|
+
backgroundColor: string;
|
|
69
|
+
badgeBackgroundColor: string;
|
|
70
|
+
labelStyle: {
|
|
71
|
+
fontSize: number;
|
|
72
|
+
fontWeight: "400";
|
|
73
|
+
fontFamily?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
fontSize: number;
|
|
76
|
+
fontFamily: string | undefined;
|
|
77
|
+
fontWeight?: undefined;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
/** All three for the current theme: `const nav = useNexubNavigation()`. */
|
|
81
|
+
export declare function useNexubNavigation(): {
|
|
82
|
+
stack: {
|
|
83
|
+
headerLargeTitle: boolean;
|
|
84
|
+
headerTransparent: boolean;
|
|
85
|
+
headerShadowVisible: boolean;
|
|
86
|
+
headerLargeTitleShadowVisible: boolean;
|
|
87
|
+
headerTintColor: string;
|
|
88
|
+
headerStyle: {
|
|
89
|
+
backgroundColor: string;
|
|
90
|
+
};
|
|
91
|
+
headerTitleStyle: {
|
|
92
|
+
fontWeight: "400";
|
|
93
|
+
fontFamily?: undefined;
|
|
94
|
+
color: string;
|
|
95
|
+
} | {
|
|
96
|
+
fontFamily: string | undefined;
|
|
97
|
+
fontWeight?: undefined;
|
|
98
|
+
color: string;
|
|
99
|
+
};
|
|
100
|
+
headerLargeTitleStyle: {
|
|
101
|
+
fontWeight: "400";
|
|
102
|
+
fontFamily?: undefined;
|
|
103
|
+
color: string;
|
|
104
|
+
} | {
|
|
105
|
+
fontFamily: string | undefined;
|
|
106
|
+
fontWeight?: undefined;
|
|
107
|
+
color: string;
|
|
108
|
+
};
|
|
109
|
+
contentStyle: {
|
|
110
|
+
backgroundColor: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
theme: {
|
|
114
|
+
dark: boolean;
|
|
115
|
+
colors: {
|
|
116
|
+
primary: string;
|
|
117
|
+
background: string;
|
|
118
|
+
card: string;
|
|
119
|
+
text: string;
|
|
120
|
+
border: string;
|
|
121
|
+
notification: string;
|
|
122
|
+
};
|
|
123
|
+
fonts: {
|
|
124
|
+
regular: {
|
|
125
|
+
fontFamily: string;
|
|
126
|
+
fontWeight: "400";
|
|
127
|
+
};
|
|
128
|
+
medium: {
|
|
129
|
+
fontFamily: string;
|
|
130
|
+
fontWeight: "400";
|
|
131
|
+
};
|
|
132
|
+
bold: {
|
|
133
|
+
fontFamily: string;
|
|
134
|
+
fontWeight: "400";
|
|
135
|
+
};
|
|
136
|
+
heavy: {
|
|
137
|
+
fontFamily: string;
|
|
138
|
+
fontWeight: "400";
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
tabs: {
|
|
143
|
+
tintColor: string;
|
|
144
|
+
inactiveTintColor: string;
|
|
145
|
+
backgroundColor: string;
|
|
146
|
+
badgeBackgroundColor: string;
|
|
147
|
+
labelStyle: {
|
|
148
|
+
fontSize: number;
|
|
149
|
+
fontWeight: "400";
|
|
150
|
+
fontFamily?: undefined;
|
|
151
|
+
} | {
|
|
152
|
+
fontSize: number;
|
|
153
|
+
fontFamily: string | undefined;
|
|
154
|
+
fontWeight?: undefined;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/theme/navigation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,oBAAiB,CAAC;AAE5D,2GAA2G;AAC3G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAelD;AAED,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU;;;;;;;;;;;;;wBAMlB,KAAK;;;;wBAAL,KAAK;;;;wBAAL,KAAK;;;;wBAAL,KAAK;;;EAexC;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU;;;;;;;;;;;;;;EASjD;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA9BE,KAAK;;;;4BAAL,KAAK;;;;4BAAL,KAAK;;;;4BAAL,KAAK;;;;;;;;;;;;;;;;;;;EAqCxC"}
|