@webority-technologies/mobile-ui 0.0.1 → 0.0.3
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 +2 -1
- package/lib/commonjs/components/AuthedImage/AuthedImage.js +225 -0
- package/lib/commonjs/components/AuthedImage/authedImageCache.js +253 -0
- package/lib/commonjs/components/AuthedImage/index.js +45 -0
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +10 -4
- package/lib/commonjs/components/Drawer/Drawer.js +6 -3
- package/lib/commonjs/components/ErrorBoundary/ErrorBoundary.js +136 -0
- package/lib/commonjs/components/ErrorBoundary/index.js +27 -0
- package/lib/commonjs/components/ErrorBoundary/useErrorHandler.js +24 -0
- package/lib/commonjs/components/ErrorBoundary/withErrorBoundary.js +28 -0
- package/lib/commonjs/components/FilePicker/FilePicker.js +1 -1
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +14 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +13 -0
- package/lib/commonjs/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/commonjs/components/Input/Input.js +6 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +62 -13
- package/lib/commonjs/components/LoaderOverlay/LoaderOverlay.js +203 -0
- package/lib/commonjs/components/LoaderOverlay/index.js +25 -0
- package/lib/commonjs/components/Markdown/Markdown.js +274 -0
- package/lib/commonjs/components/Markdown/index.js +13 -0
- package/lib/commonjs/components/Markdown/parse.js +229 -0
- package/lib/commonjs/components/OTPInput/OTPInput.js +5 -0
- package/lib/commonjs/components/OptionSheet/OptionSheet.js +3 -3
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/commonjs/components/Radio/Radio.js +9 -0
- package/lib/commonjs/components/Rating/Rating.js +5 -0
- package/lib/commonjs/components/RichTextEditor/RichTextEditor.js +311 -0
- package/lib/commonjs/components/RichTextEditor/index.js +20 -0
- package/lib/commonjs/components/RichTextEditor/markdownActions.js +213 -0
- package/lib/commonjs/components/SearchBar/SearchBar.js +7 -0
- package/lib/commonjs/components/Select/Select.js +1 -1
- package/lib/commonjs/components/Skeleton/Skeleton.js +17 -36
- package/lib/commonjs/components/Slider/Slider.js +21 -5
- package/lib/commonjs/components/Swipeable/Swipeable.js +5 -2
- package/lib/commonjs/components/TimePicker/TimePicker.js +11 -0
- package/lib/commonjs/components/index.js +230 -141
- package/lib/commonjs/form/FormContext.js +13 -1
- package/lib/commonjs/form/useField.js +13 -1
- package/lib/commonjs/theme/Gradient.js +44 -41
- package/lib/commonjs/theme/index.js +24 -2
- package/lib/commonjs/utils/hapticUtils.js +38 -18
- package/lib/module/components/AuthedImage/AuthedImage.js +221 -0
- package/lib/module/components/AuthedImage/authedImageCache.js +239 -0
- package/lib/module/components/AuthedImage/index.js +5 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +10 -4
- package/lib/module/components/Drawer/Drawer.js +6 -3
- package/lib/module/components/ErrorBoundary/ErrorBoundary.js +130 -0
- package/lib/module/components/ErrorBoundary/index.js +6 -0
- package/lib/module/components/ErrorBoundary/useErrorHandler.js +20 -0
- package/lib/module/components/ErrorBoundary/withErrorBoundary.js +23 -0
- package/lib/module/components/FilePicker/FilePicker.js +1 -1
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +14 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +13 -0
- package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/module/components/Input/Input.js +6 -0
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +63 -14
- package/lib/module/components/LoaderOverlay/LoaderOverlay.js +196 -0
- package/lib/module/components/LoaderOverlay/index.js +4 -0
- package/lib/module/components/Markdown/Markdown.js +268 -0
- package/lib/module/components/Markdown/index.js +4 -0
- package/lib/module/components/Markdown/parse.js +223 -0
- package/lib/module/components/OTPInput/OTPInput.js +5 -0
- package/lib/module/components/OptionSheet/OptionSheet.js +3 -3
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/Radio/Radio.js +9 -0
- package/lib/module/components/Rating/Rating.js +5 -0
- package/lib/module/components/RichTextEditor/RichTextEditor.js +306 -0
- package/lib/module/components/RichTextEditor/index.js +5 -0
- package/lib/module/components/RichTextEditor/markdownActions.js +207 -0
- package/lib/module/components/SearchBar/SearchBar.js +7 -0
- package/lib/module/components/Select/Select.js +1 -1
- package/lib/module/components/Skeleton/Skeleton.js +17 -36
- package/lib/module/components/Slider/Slider.js +21 -5
- package/lib/module/components/Swipeable/Swipeable.js +5 -2
- package/lib/module/components/TimePicker/TimePicker.js +11 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/form/FormContext.js +13 -1
- package/lib/module/form/useField.js +13 -1
- package/lib/module/theme/Gradient.js +41 -38
- package/lib/module/theme/index.js +17 -1
- package/lib/module/utils/hapticUtils.js +37 -18
- package/lib/typescript/commonjs/components/AuthedImage/AuthedImage.d.ts +22 -0
- package/lib/typescript/commonjs/components/AuthedImage/authedImageCache.d.ts +48 -0
- package/lib/typescript/commonjs/components/AuthedImage/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +1 -3
- package/lib/typescript/commonjs/components/Card/Card.d.ts +1 -2
- package/lib/typescript/commonjs/components/ErrorBoundary/ErrorBoundary.d.ts +38 -0
- package/lib/typescript/commonjs/components/ErrorBoundary/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/ErrorBoundary/useErrorHandler.d.ts +9 -0
- package/lib/typescript/commonjs/components/ErrorBoundary/withErrorBoundary.d.ts +9 -0
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +15 -0
- package/lib/typescript/commonjs/components/LoaderOverlay/LoaderOverlay.d.ts +25 -0
- package/lib/typescript/commonjs/components/LoaderOverlay/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Markdown/Markdown.d.ts +29 -0
- package/lib/typescript/commonjs/components/Markdown/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Markdown/parse.d.ts +58 -0
- package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +8 -1
- package/lib/typescript/commonjs/components/RichTextEditor/RichTextEditor.d.ts +48 -0
- package/lib/typescript/commonjs/components/RichTextEditor/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/RichTextEditor/markdownActions.d.ts +35 -0
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +1 -1
- package/lib/typescript/commonjs/components/index.d.ts +10 -0
- package/lib/typescript/commonjs/form/FormContext.d.ts +13 -3
- package/lib/typescript/commonjs/theme/Gradient.d.ts +18 -3
- package/lib/typescript/commonjs/theme/index.d.ts +16 -1
- package/lib/typescript/commonjs/theme/types.d.ts +2 -2
- package/lib/typescript/commonjs/utils/hapticUtils.d.ts +4 -0
- package/lib/typescript/module/components/AuthedImage/AuthedImage.d.ts +22 -0
- package/lib/typescript/module/components/AuthedImage/authedImageCache.d.ts +48 -0
- package/lib/typescript/module/components/AuthedImage/index.d.ts +5 -0
- package/lib/typescript/module/components/Button/Button.d.ts +1 -3
- package/lib/typescript/module/components/Card/Card.d.ts +1 -2
- package/lib/typescript/module/components/ErrorBoundary/ErrorBoundary.d.ts +38 -0
- package/lib/typescript/module/components/ErrorBoundary/index.d.ts +5 -0
- package/lib/typescript/module/components/ErrorBoundary/useErrorHandler.d.ts +9 -0
- package/lib/typescript/module/components/ErrorBoundary/withErrorBoundary.d.ts +9 -0
- package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +15 -0
- package/lib/typescript/module/components/LoaderOverlay/LoaderOverlay.d.ts +25 -0
- package/lib/typescript/module/components/LoaderOverlay/index.d.ts +3 -0
- package/lib/typescript/module/components/Markdown/Markdown.d.ts +29 -0
- package/lib/typescript/module/components/Markdown/index.d.ts +3 -0
- package/lib/typescript/module/components/Markdown/parse.d.ts +58 -0
- package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +8 -1
- package/lib/typescript/module/components/RichTextEditor/RichTextEditor.d.ts +48 -0
- package/lib/typescript/module/components/RichTextEditor/index.d.ts +5 -0
- package/lib/typescript/module/components/RichTextEditor/markdownActions.d.ts +35 -0
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +1 -1
- package/lib/typescript/module/components/index.d.ts +10 -0
- package/lib/typescript/module/form/FormContext.d.ts +13 -3
- package/lib/typescript/module/theme/Gradient.d.ts +18 -3
- package/lib/typescript/module/theme/index.d.ts +16 -1
- package/lib/typescript/module/theme/types.d.ts +2 -2
- package/lib/typescript/module/utils/hapticUtils.d.ts +4 -0
- package/package.json +20 -13
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import * as Haptics from 'expo-haptics';
|
|
3
4
|
import { Platform, Vibration } from 'react-native';
|
|
4
5
|
let hapticImpl = null;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enableVibrateFallback: true
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
} catch {
|
|
19
|
-
// Ignored: not installed; fall back to Vibration on Android, no-op on iOS.
|
|
20
|
-
}
|
|
21
|
-
};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Only what a test or the showcase injected. The default is expo-haptics, which
|
|
9
|
+
* this module imports directly: `expo` is a required peer, so the 48 components
|
|
10
|
+
* that fire haptics get them without any app wiring anything.
|
|
11
|
+
*
|
|
12
|
+
* The Vibration fallback below is now only the FAILURE path — a device whose
|
|
13
|
+
* haptic engine is disabled rejects, and Android still gets something.
|
|
14
|
+
*/
|
|
15
|
+
|
|
22
16
|
const fallback = type => {
|
|
23
17
|
if (Platform.OS === 'android') {
|
|
24
18
|
const map = {
|
|
@@ -33,8 +27,23 @@ const fallback = type => {
|
|
|
33
27
|
Vibration.vibrate(map[type] ?? 10);
|
|
34
28
|
}
|
|
35
29
|
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* expo-haptics, which splits what this module treats as one vocabulary across
|
|
33
|
+
* three functions. The promises are deliberately swallowed: the seam is
|
|
34
|
+
* synchronous, a device with the engine disabled rejects, and an unhandled
|
|
35
|
+
* rejection from a button press must never become a crash.
|
|
36
|
+
*/
|
|
37
|
+
const EXPO_HANDLERS = {
|
|
38
|
+
selection: () => Haptics.selectionAsync(),
|
|
39
|
+
impactLight: () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light),
|
|
40
|
+
impactMedium: () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),
|
|
41
|
+
impactHeavy: () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy),
|
|
42
|
+
notificationSuccess: () => Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),
|
|
43
|
+
notificationWarning: () => Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning),
|
|
44
|
+
notificationError: () => Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error)
|
|
45
|
+
};
|
|
36
46
|
export const triggerHaptic = (type = 'selection') => {
|
|
37
|
-
tryLoadOptional();
|
|
38
47
|
if (hapticImpl) {
|
|
39
48
|
try {
|
|
40
49
|
hapticImpl(type);
|
|
@@ -43,8 +52,18 @@ export const triggerHaptic = (type = 'selection') => {
|
|
|
43
52
|
/* ignore */
|
|
44
53
|
}
|
|
45
54
|
}
|
|
55
|
+
const handler = EXPO_HANDLERS[type];
|
|
56
|
+
if (handler) {
|
|
57
|
+
handler().catch(() => fallback(type));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
46
60
|
fallback(type);
|
|
47
61
|
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Replace the haptic backend. Intended for TESTS and for the showcase; an app
|
|
65
|
+
* gets expo-haptics without wiring anything. Pass `null` to restore it.
|
|
66
|
+
*/
|
|
48
67
|
export const setHapticImplementation = impl => {
|
|
49
68
|
hapticImpl = impl;
|
|
50
69
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ImageProps } from 'react-native';
|
|
3
|
+
export interface AuthedImageProps extends Omit<ImageProps, 'source' | 'onError'> {
|
|
4
|
+
uri: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
/** Attach the stored bearer token. Default true. */
|
|
7
|
+
authenticated?: boolean;
|
|
8
|
+
/** Cache lifetime. Default 7 days. */
|
|
9
|
+
ttlMs?: number;
|
|
10
|
+
placeholder?: React.ReactNode;
|
|
11
|
+
fallback?: React.ReactNode;
|
|
12
|
+
onLoadStart?: () => void;
|
|
13
|
+
onLoadEnd?: () => void;
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
/** Override the key derived from `uri`. */
|
|
16
|
+
cacheKey?: string;
|
|
17
|
+
testID?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const AuthedImage: React.FC<AuthedImageProps>;
|
|
20
|
+
export { AuthedImage };
|
|
21
|
+
export default AuthedImage;
|
|
22
|
+
//# sourceMappingURL=AuthedImage.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const DEFAULT_TTL_MS: number;
|
|
2
|
+
export interface AuthedImageCacheMeta {
|
|
3
|
+
fetchedAt: number;
|
|
4
|
+
bytes: number;
|
|
5
|
+
contentType: string;
|
|
6
|
+
lastAccessedAt: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CachedImage {
|
|
9
|
+
dataUri: string;
|
|
10
|
+
meta: AuthedImageCacheMeta;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Ceiling for the total stored size of cached images. Exceeding it evicts the
|
|
14
|
+
* least recently used entries. An image cache with no ceiling grows until the
|
|
15
|
+
* OS reclaims the app's storage, which is the defect this replaces.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAuthedImageCacheLimit: (bytes: number) => void;
|
|
18
|
+
export declare const getAuthedImageCacheLimit: () => number;
|
|
19
|
+
/**
|
|
20
|
+
* Hex only by construction, so it is always a safe storage key segment.
|
|
21
|
+
*/
|
|
22
|
+
export declare const deriveCacheKey: (uri: string, override?: string) => string;
|
|
23
|
+
export declare const readEntry: (cacheKey: string) => Promise<CachedImage | null>;
|
|
24
|
+
export declare const isFresh: (meta: AuthedImageCacheMeta, ttlMs: number, now?: number) => boolean;
|
|
25
|
+
export declare const touchEntry: (cacheKey: string, meta: AuthedImageCacheMeta) => Promise<void>;
|
|
26
|
+
export declare const clearAuthedImageCache: () => Promise<void>;
|
|
27
|
+
export declare const authedImageCacheStats: () => Promise<{
|
|
28
|
+
entries: number;
|
|
29
|
+
bytes: number;
|
|
30
|
+
}>;
|
|
31
|
+
export interface FetchOptions {
|
|
32
|
+
uri: string;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
authenticated: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface InFlightFetch {
|
|
37
|
+
promise: Promise<CachedImage>;
|
|
38
|
+
controller: AbortController;
|
|
39
|
+
waiters: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Two mounts of the same image share one request. The controller is aborted
|
|
43
|
+
* only when the last waiter releases, so one unmount cannot cancel the fetch
|
|
44
|
+
* another mount is still waiting on.
|
|
45
|
+
*/
|
|
46
|
+
export declare const acquireFetch: (cacheKey: string, options: FetchOptions) => InFlightFetch;
|
|
47
|
+
export declare const releaseFetch: (cacheKey: string, entry: InFlightFetch) => void;
|
|
48
|
+
//# sourceMappingURL=authedImageCache.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { AuthedImageProps } from './AuthedImage';
|
|
2
|
+
export { AuthedImage, default } from './AuthedImage';
|
|
3
|
+
export type { AuthedImageCacheMeta } from './authedImageCache';
|
|
4
|
+
export { authedImageCacheStats, clearAuthedImageCache, getAuthedImageCacheLimit, setAuthedImageCacheLimit } from './authedImageCache';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -25,9 +25,7 @@ export interface ButtonProps extends Omit<PressableProps, 'style' | 'children'>
|
|
|
25
25
|
rounded?: boolean;
|
|
26
26
|
/**
|
|
27
27
|
* Optional gradient background. Pass either a key from `theme.gradients`
|
|
28
|
-
* (e.g. `"primary"`) or a `GradientDefinition` literal.
|
|
29
|
-
* `react-native-linear-gradient` to be installed; without it the button
|
|
30
|
-
* falls back to flat colour with a dev warning.
|
|
28
|
+
* (e.g. `"primary"`) or a `GradientDefinition` literal.
|
|
31
29
|
*/
|
|
32
30
|
gradient?: string | GradientDefinition;
|
|
33
31
|
style?: StyleProp<ViewStyle>;
|
|
@@ -28,8 +28,7 @@ export interface CardProps extends Omit<PressableProps, 'style' | 'children'> {
|
|
|
28
28
|
/**
|
|
29
29
|
* Optional gradient background. Pass a key from `theme.gradients` or a
|
|
30
30
|
* literal `GradientDefinition`. Layered behind the card's content so
|
|
31
|
-
* existing variant/elevation/radius continue to work.
|
|
32
|
-
* `react-native-linear-gradient` to be installed.
|
|
31
|
+
* existing variant/elevation/radius continue to work.
|
|
33
32
|
*/
|
|
34
33
|
gradient?: string | GradientDefinition;
|
|
35
34
|
onPress?: (event: GestureResponderEvent) => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ErrorBoundaryInfo {
|
|
3
|
+
componentStack: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ErrorBoundaryProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Custom fallback. Receives the error and a reset callback. Defaults to a themed EmptyState with a retry action. */
|
|
8
|
+
fallback?: React.ReactNode | ((error: Error, reset: () => void) => React.ReactNode);
|
|
9
|
+
/** Called on every caught error, after the error is recorded to the Logger. */
|
|
10
|
+
onError?: (error: Error, info: ErrorBoundaryInfo) => void;
|
|
11
|
+
/** Changing any value in this array resets the boundary. Standard escape hatch for route changes. */
|
|
12
|
+
resetKeys?: unknown[];
|
|
13
|
+
/** Called when the boundary resets, however it was triggered. */
|
|
14
|
+
onReset?: () => void;
|
|
15
|
+
/** Title and message for the default fallback. */
|
|
16
|
+
title?: string;
|
|
17
|
+
message?: string;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
interface ErrorBoundaryState {
|
|
21
|
+
error: Error | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Catches render errors in its subtree and shows a themed fallback instead of
|
|
25
|
+
* a white screen. Mount this once near the navigation root per the fleet
|
|
26
|
+
* convention, and optionally again around any subtree that should recover
|
|
27
|
+
* independently (a single failed card should not blank the whole screen).
|
|
28
|
+
*/
|
|
29
|
+
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
30
|
+
state: ErrorBoundaryState;
|
|
31
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
32
|
+
componentDidUpdate(prevProps: ErrorBoundaryProps): void;
|
|
33
|
+
componentDidCatch(error: Error, info: ErrorBoundaryInfo): void;
|
|
34
|
+
reset: () => void;
|
|
35
|
+
render(): React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { ErrorBoundaryInfo, ErrorBoundaryProps } from './ErrorBoundary';
|
|
2
|
+
export { ErrorBoundary } from './ErrorBoundary';
|
|
3
|
+
export { useErrorHandler } from './useErrorHandler';
|
|
4
|
+
export { withErrorBoundary } from './withErrorBoundary';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a stable callback for surfacing an error caught outside React's
|
|
3
|
+
* render/commit cycle (an async callback, a rejected promise, a native event
|
|
4
|
+
* handler) to the nearest ErrorBoundary. React only catches synchronous
|
|
5
|
+
* render errors on its own; re-throwing during a state update is the
|
|
6
|
+
* documented way to route an async error into that same path.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useErrorHandler: () => ((error: unknown) => void);
|
|
9
|
+
//# sourceMappingURL=useErrorHandler.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ErrorBoundaryProps } from './ErrorBoundary';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a component in an `ErrorBoundary`. Prefer this over hand-wrapping a
|
|
5
|
+
* screen at every call site when the same fallback/reset behaviour applies
|
|
6
|
+
* everywhere that component is rendered.
|
|
7
|
+
*/
|
|
8
|
+
export declare const withErrorBoundary: <P extends object>(Component: React.ComponentType<P>, boundaryProps?: Omit<ErrorBoundaryProps, "children">) => React.ComponentType<P>;
|
|
9
|
+
//# sourceMappingURL=withErrorBoundary.d.ts.map
|
package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ScrollViewProps } from 'react-native';
|
|
3
3
|
import { ScrollView } from 'react-native';
|
|
4
|
+
export type SafeAreaEdge = 'top' | 'bottom' | 'left' | 'right';
|
|
4
5
|
export interface KeyboardAwareScrollViewProps extends ScrollViewProps {
|
|
5
6
|
/** Gap kept between the focused field and the top of the keyboard. Default 24. */
|
|
6
7
|
extraScrollHeight?: number;
|
|
7
8
|
/** Disable the keyboard-following behaviour (still a normal ScrollView). Default false. */
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
/** Safe-area edges to pad. Default ['bottom']. */
|
|
11
|
+
safeAreaEdges?: SafeAreaEdge[];
|
|
12
|
+
/** Standard RefreshControl pass-through convenience. Ignored when `refreshControl` is set. */
|
|
13
|
+
refreshing?: boolean;
|
|
14
|
+
onRefresh?: () => void;
|
|
15
|
+
/** iOS keyboard animation duration to match when scrolling. Default 250. */
|
|
16
|
+
keyboardOpeningTime?: number;
|
|
17
|
+
/** Adds the extra bottom inset a tab bar needs. Default false. */
|
|
18
|
+
viewIsInsideTabBar?: boolean;
|
|
19
|
+
/** Scroll back to a fixed offset when the keyboard hides. */
|
|
20
|
+
resetScrollToCoords?: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
9
24
|
}
|
|
10
25
|
/**
|
|
11
26
|
* A ScrollView that keeps the focused input visible above the keyboard — no
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const loader: {
|
|
3
|
+
show: (message?: string) => void;
|
|
4
|
+
hide: () => void;
|
|
5
|
+
wrap: <T>(work: Promise<T> | (() => Promise<T>), message?: string) => Promise<T>;
|
|
6
|
+
isVisible: () => boolean;
|
|
7
|
+
reset: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const useLoader: () => typeof loader;
|
|
10
|
+
export interface LoaderOverlayProps {
|
|
11
|
+
/**
|
|
12
|
+
* Replaces the default themed spinner. Lets an app supply a Lottie or brand
|
|
13
|
+
* animation without the library taking that dependency.
|
|
14
|
+
*/
|
|
15
|
+
renderIndicator?: (message?: string) => React.ReactNode;
|
|
16
|
+
/** Overlay dim colour override; defaults to a themed scrim. */
|
|
17
|
+
backdropColor?: string;
|
|
18
|
+
/** Delay before the overlay actually appears, so a fast request never flashes it. Default 150ms. */
|
|
19
|
+
showDelayMs?: number;
|
|
20
|
+
/** Once visible, stay visible at least this long, so it never flickers. Default 400ms. */
|
|
21
|
+
minVisibleMs?: number;
|
|
22
|
+
testID?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const LoaderOverlay: React.FC<LoaderOverlayProps>;
|
|
25
|
+
//# sourceMappingURL=LoaderOverlay.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
export interface MarkdownProps {
|
|
4
|
+
/** The markdown source. An empty or missing string renders nothing. */
|
|
5
|
+
children?: string;
|
|
6
|
+
/** Called instead of Linking.openURL when a link is pressed. */
|
|
7
|
+
onLinkPress?: (href: string) => void;
|
|
8
|
+
/**
|
|
9
|
+
* When true, renders the component as its authored skeleton placeholder shape.
|
|
10
|
+
* The placeholder mirrors the real layout's footprint so the UI doesn't reflow
|
|
11
|
+
* when data arrives. Use this while the data driving the component is being fetched.
|
|
12
|
+
*/
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
/** Applied to every text block, so a caller can set the base size or colour. */
|
|
16
|
+
textStyle?: StyleProp<TextStyle>;
|
|
17
|
+
testID?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders a small, deliberate subset of markdown using the theme's own type
|
|
21
|
+
* scale and colours, with no dependency.
|
|
22
|
+
*
|
|
23
|
+
* It exists because Expo has no markdown module and the alternative on npm has
|
|
24
|
+
* not shipped since 2022. What it covers is what our content contains: release
|
|
25
|
+
* notes, help text and descriptions written by people. Nested lists, tables and
|
|
26
|
+
* inline HTML are out of scope on purpose — see parse.ts.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Markdown: React.FC<MarkdownProps>;
|
|
29
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A deliberately small CommonMark subset, parsed without a dependency.
|
|
3
|
+
*
|
|
4
|
+
* The scope is what our own content actually contains — release notes, help
|
|
5
|
+
* text, descriptions written by people in a web editor — not a spec-complete
|
|
6
|
+
* renderer. Nested lists, tables, footnotes, HTML blocks and reference links
|
|
7
|
+
* are out of scope on purpose: supporting them means a parser nobody here can
|
|
8
|
+
* maintain, and content that needs them is a sign it should not be markdown.
|
|
9
|
+
*
|
|
10
|
+
* Kept separate from the component so the grammar can be tested as data, with
|
|
11
|
+
* no rendering involved.
|
|
12
|
+
*/
|
|
13
|
+
export type InlineNode = {
|
|
14
|
+
type: 'text';
|
|
15
|
+
value: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'strong';
|
|
18
|
+
children: InlineNode[];
|
|
19
|
+
} | {
|
|
20
|
+
type: 'em';
|
|
21
|
+
children: InlineNode[];
|
|
22
|
+
} | {
|
|
23
|
+
type: 'code';
|
|
24
|
+
value: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'strike';
|
|
27
|
+
children: InlineNode[];
|
|
28
|
+
} | {
|
|
29
|
+
type: 'link';
|
|
30
|
+
href: string;
|
|
31
|
+
children: InlineNode[];
|
|
32
|
+
};
|
|
33
|
+
export type BlockNode = {
|
|
34
|
+
type: 'heading';
|
|
35
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
36
|
+
children: InlineNode[];
|
|
37
|
+
} | {
|
|
38
|
+
type: 'paragraph';
|
|
39
|
+
children: InlineNode[];
|
|
40
|
+
} | {
|
|
41
|
+
type: 'listItem';
|
|
42
|
+
ordered: boolean;
|
|
43
|
+
index: number;
|
|
44
|
+
depth: number;
|
|
45
|
+
children: InlineNode[];
|
|
46
|
+
} | {
|
|
47
|
+
type: 'quote';
|
|
48
|
+
children: InlineNode[];
|
|
49
|
+
} | {
|
|
50
|
+
type: 'codeBlock';
|
|
51
|
+
value: string;
|
|
52
|
+
language?: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'rule';
|
|
55
|
+
};
|
|
56
|
+
export declare const parseInline: (input: string) => InlineNode[];
|
|
57
|
+
export declare const parseMarkdown: (source: string) => BlockNode[];
|
|
58
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -30,7 +30,14 @@ export interface OptionSheetProps {
|
|
|
30
30
|
title?: string;
|
|
31
31
|
options: ReadonlyArray<unknown>;
|
|
32
32
|
labelOf: (option: unknown) => string;
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Named `getValue`, not `valueOf`. Every object literal inherits
|
|
35
|
+
* `Object.prototype.valueOf`, so a prop of that name makes even
|
|
36
|
+
* `{ open: false }` fail to satisfy `Partial<OptionSheetProps>`, which poisons
|
|
37
|
+
* any wrapper or props-merge over this component. Its siblings labelOf,
|
|
38
|
+
* disabledOf and iconOf are safe; only this one collides.
|
|
39
|
+
*/
|
|
40
|
+
getValue: (option: unknown) => SelectValue;
|
|
34
41
|
disabledOf: (option: unknown) => boolean;
|
|
35
42
|
descriptionOf: (option: unknown) => string | undefined;
|
|
36
43
|
iconOf: (option: unknown) => React.ReactNode;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextInput as RNTextInput, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HapticType } from '../../utils';
|
|
4
|
+
import type { MarkdownAction } from './markdownActions';
|
|
5
|
+
export interface RichTextEditorProps {
|
|
6
|
+
/** The markdown source. Controlled, like any other input. */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** Fires with the full markdown source after typing or a toolbar action. */
|
|
9
|
+
onChangeText?: (text: string) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Which toolbar actions to show, in the order given. Defaults to the full
|
|
13
|
+
* set the paired `<Markdown>` renderer can read.
|
|
14
|
+
*/
|
|
15
|
+
actions?: MarkdownAction[];
|
|
16
|
+
/** Blocks typing and every toolbar action, and dims the editor. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* When true, renders the component as its authored skeleton placeholder shape.
|
|
20
|
+
* The placeholder mirrors the real layout's footprint so the UI doesn't reflow
|
|
21
|
+
* when data arrives. Use this while the data driving the component is being fetched.
|
|
22
|
+
*/
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
/** Minimum height of the text area in pixels. Default 160. */
|
|
25
|
+
minHeight?: number;
|
|
26
|
+
autoFocus?: boolean;
|
|
27
|
+
accessibilityLabel?: string;
|
|
28
|
+
/** Haptic feedback for toolbar presses. Pass false to disable; pass a HapticType to override. */
|
|
29
|
+
haptic?: HapticType | false;
|
|
30
|
+
/** Style for the outer bordered box. */
|
|
31
|
+
style?: StyleProp<ViewStyle>;
|
|
32
|
+
/** Style for the toolbar row. */
|
|
33
|
+
toolbarStyle?: StyleProp<ViewStyle>;
|
|
34
|
+
/** Style for the multiline TextInput. */
|
|
35
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
36
|
+
testID?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A markdown editor: a themed multiline field plus a toolbar that wraps the
|
|
40
|
+
* current selection in the markers our own `<Markdown>` renderer reads back.
|
|
41
|
+
*
|
|
42
|
+
* Deliberately NOT a WYSIWYG surface. Rich-text-on-RN means a WebView, which is
|
|
43
|
+
* exactly what replacing the stale `react-native-pell-rich-editor` was meant to
|
|
44
|
+
* escape: markdown in, markdown out, one plain TextInput, no bridge.
|
|
45
|
+
*/
|
|
46
|
+
export declare const RichTextEditor: React.ForwardRefExoticComponent<RichTextEditorProps & React.RefAttributes<RNTextInput>>;
|
|
47
|
+
export default RichTextEditor;
|
|
48
|
+
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { BlockMarkdownAction, EditorSelection, EditorState, InlineMarkdownAction, MarkdownAction } from './markdownActions';
|
|
2
|
+
export { applyMarkdownAction } from './markdownActions';
|
|
3
|
+
export type { RichTextEditorProps } from './RichTextEditor';
|
|
4
|
+
export { RichTextEditor } from './RichTextEditor';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text transforms behind the editor's toolbar, kept out of the component so
|
|
3
|
+
* the behaviour people actually notice — toggling bold OFF again, and where the
|
|
4
|
+
* caret lands when nothing is selected — can be tested as data, with no
|
|
5
|
+
* rendering involved. Same split as Markdown/parse.ts.
|
|
6
|
+
*
|
|
7
|
+
* The output targets our own `<Markdown>` renderer, so the vocabulary is the
|
|
8
|
+
* subset that parser reads: `**`, `*`, `~~`, backtick, `[](…)`, `#`, `##`,
|
|
9
|
+
* `- `, `1. `, `> `. Nothing here emits anything that renderer would show as
|
|
10
|
+
* literal text.
|
|
11
|
+
*/
|
|
12
|
+
export interface EditorSelection {
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
}
|
|
16
|
+
export interface EditorState {
|
|
17
|
+
text: string;
|
|
18
|
+
selection: EditorSelection;
|
|
19
|
+
}
|
|
20
|
+
export type InlineMarkdownAction = 'bold' | 'italic' | 'strikethrough' | 'code' | 'link';
|
|
21
|
+
export type BlockMarkdownAction = 'heading1' | 'heading2' | 'bulletList' | 'numberedList' | 'quote';
|
|
22
|
+
export type MarkdownAction = InlineMarkdownAction | BlockMarkdownAction;
|
|
23
|
+
/** Selection as given can be reversed, unset, or past the end after an edit. */
|
|
24
|
+
export declare const normalizeSelection: (selection: EditorSelection, length: number) => EditorSelection;
|
|
25
|
+
/**
|
|
26
|
+
* Applies one toolbar action to the current text + selection and returns the
|
|
27
|
+
* next pair. Pure: the caller owns the state.
|
|
28
|
+
*
|
|
29
|
+
* Wrapping applies to the selection; with nothing selected the markers are
|
|
30
|
+
* inserted and the caret lands between them. Applying an action to text that
|
|
31
|
+
* already carries it removes it instead of stacking a second copy — which is
|
|
32
|
+
* the half people notice immediately when it is missing.
|
|
33
|
+
*/
|
|
34
|
+
export declare const applyMarkdownAction: (state: EditorState, action: MarkdownAction) => EditorState;
|
|
35
|
+
//# sourceMappingURL=markdownActions.d.ts.map
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - A View with the base color and `overflow: hidden` + radius gives the
|
|
11
11
|
* placeholder its shape.
|
|
12
12
|
* - For `animation: 'shimmer'`, an Animated.View carrying a 3-stop
|
|
13
|
-
*
|
|
13
|
+
* linear gradient (transparent → highlight → transparent) translates
|
|
14
14
|
* across the box. The radius clips it to the right outline automatically.
|
|
15
15
|
* - For `animation: 'pulse'`, a full-fill Animated.View fades its opacity
|
|
16
16
|
* between 0 and 0.6. Cheap and useful for tiny shapes where a sweep
|
|
@@ -6,6 +6,8 @@ export type { AppBarAction, AppBarProps, AppBarVariant } from './AppBar';
|
|
|
6
6
|
export { AppBar } from './AppBar';
|
|
7
7
|
export type { AsyncBlockProps } from './AsyncBlock';
|
|
8
8
|
export { AsyncBlock } from './AsyncBlock';
|
|
9
|
+
export type { AuthedImageCacheMeta, AuthedImageProps } from './AuthedImage';
|
|
10
|
+
export { AuthedImage, authedImageCacheStats, clearAuthedImageCache, getAuthedImageCacheLimit, setAuthedImageCacheLimit } from './AuthedImage';
|
|
9
11
|
export type { AutocompleteProps } from './Autocomplete';
|
|
10
12
|
export { Autocomplete } from './Autocomplete';
|
|
11
13
|
export type { AvatarGroupOverflowVariant, AvatarGroupProps, AvatarGroupSpacing, AvatarImageProps, AvatarProps, AvatarShape, AvatarSize, AvatarStatus } from './Avatar';
|
|
@@ -48,6 +50,8 @@ export type { DrawerProps, DrawerRef, DrawerSide } from './Drawer';
|
|
|
48
50
|
export { Drawer } from './Drawer';
|
|
49
51
|
export type { EmptyStateAction, EmptyStateProps, EmptyStateSize } from './EmptyState';
|
|
50
52
|
export { EmptyState } from './EmptyState';
|
|
53
|
+
export type { ErrorBoundaryInfo, ErrorBoundaryProps } from './ErrorBoundary';
|
|
54
|
+
export { ErrorBoundary, useErrorHandler, withErrorBoundary } from './ErrorBoundary';
|
|
51
55
|
export type { FilePickerFile, FilePickerFileState, FilePickerFileStatus, FilePickerLabels, FilePickerProps, FilePickerRef, FilePickerSource, FilePickerTriggerState, FilePickerVariant, PickedFileInput } from './FilePicker';
|
|
52
56
|
export { FilePicker, formatFileSize } from './FilePicker';
|
|
53
57
|
export type { FloatingActionButtonGroupAction, FloatingActionButtonGroupProps, FloatingActionButtonPosition, FloatingActionButtonProps, FloatingActionButtonSize, FloatingActionButtonTone } from './FloatingActionButton';
|
|
@@ -70,6 +74,10 @@ export type { KeyboardToolbarProps } from './KeyboardToolbar';
|
|
|
70
74
|
export { KeyboardToolbar } from './KeyboardToolbar';
|
|
71
75
|
export type { ListItemProps, ListItemSize } from './ListItem';
|
|
72
76
|
export { ListItem } from './ListItem';
|
|
77
|
+
export type { LoaderOverlayProps } from './LoaderOverlay';
|
|
78
|
+
export { LoaderOverlay, loader, useLoader } from './LoaderOverlay';
|
|
79
|
+
export type { MarkdownProps } from './Markdown';
|
|
80
|
+
export { Markdown } from './Markdown';
|
|
73
81
|
export type { ModalPresentation, ModalProps } from './Modal';
|
|
74
82
|
export { MODAL_DISMISS_GRACE_MS, Modal } from './Modal';
|
|
75
83
|
export type { NumberInputProps, NumberInputRef, NumberInputSize, NumberInputVariant } from './NumberInput';
|
|
@@ -88,6 +96,8 @@ export type { RatingProps, RatingSize, RatingTone } from './Rating';
|
|
|
88
96
|
export { Rating } from './Rating';
|
|
89
97
|
export type { RepeaterProps, RepeaterRenderArgs } from './Repeater';
|
|
90
98
|
export { Repeater } from './Repeater';
|
|
99
|
+
export type { BlockMarkdownAction, EditorSelection, EditorState, InlineMarkdownAction, MarkdownAction, RichTextEditorProps } from './RichTextEditor';
|
|
100
|
+
export { applyMarkdownAction, RichTextEditor } from './RichTextEditor';
|
|
91
101
|
export type { SearchBarProps, SearchBarSize, SearchBarVariant } from './SearchBar';
|
|
92
102
|
export { SearchBar } from './SearchBar';
|
|
93
103
|
export type { SegmentedControlProps, SegmentedControlSize, SegmentedControlTone } from './SegmentedControl';
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FormApi, FormValues } from './types';
|
|
3
|
-
export interface FormProps {
|
|
3
|
+
export interface FormProps<Values extends FormValues = FormValues> {
|
|
4
4
|
/** The object returned by {@link useForm}. */
|
|
5
|
-
form: FormApi<
|
|
5
|
+
form: FormApi<Values>;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Provides a {@link useForm} instance to descendants so `<FormField name>`,
|
|
10
10
|
* {@link useField} and {@link useFieldArray} can bind by name.
|
|
11
|
+
*
|
|
12
|
+
* Generic in `Values`, and it has to be. `FormApi` is invariant in `Values`
|
|
13
|
+
* because `setValues` accepts a `(prev: Values) => Values`, so a
|
|
14
|
+
* `FormApi<MyValues>` is not assignable to a `FormApi<FormValues>`. While the
|
|
15
|
+
* prop was declared at the base type, `useForm<MyValues>()` could not be handed
|
|
16
|
+
* to `<Form>` by ANY consumer, which is most of the reason to type a form at
|
|
17
|
+
* all. Untyped callers are unaffected: `Values` defaults to `FormValues`.
|
|
11
18
|
*/
|
|
12
|
-
export declare const Form:
|
|
19
|
+
export declare const Form: {
|
|
20
|
+
<Values extends FormValues = FormValues>({ form, children }: FormProps<Values>): React.ReactElement;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
13
23
|
/** Read the surrounding form. Throws if there is no `<Form>` ancestor. */
|
|
14
24
|
export declare function useFormContext<Values extends FormValues = FormValues>(): FormApi<Values>;
|
|
15
25
|
/** Read the surrounding form, or null when there is no `<Form>` ancestor. */
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { LinearGradientValue, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import type { GradientDefinition } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Render a linear gradient with React Native's own `experimental_backgroundImage`
|
|
6
|
+
* style prop. `GradientDefinition` keeps its vector-based `start`/`end` shape,
|
|
7
|
+
* which is translated to a CSS angle here.
|
|
8
|
+
*/
|
|
9
|
+
type GradientVector = {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* CSS gradient angles are measured clockwise from "to top", while the vectors
|
|
15
|
+
* live in a y-down 0..1 space, so the y delta is negated before the atan2.
|
|
16
|
+
*/
|
|
17
|
+
export declare const gradientAngle: (start?: GradientVector, end?: GradientVector) => number;
|
|
18
|
+
export declare const toBackgroundImage: (gradient: GradientDefinition) => LinearGradientValue;
|
|
4
19
|
export interface GradientProps {
|
|
5
20
|
gradient: GradientDefinition;
|
|
6
21
|
style?: StyleProp<ViewStyle>;
|
|
7
22
|
children?: React.ReactNode;
|
|
8
23
|
}
|
|
9
24
|
export declare const Gradient: React.FC<GradientProps>;
|
|
10
|
-
export
|
|
25
|
+
export {};
|
|
11
26
|
//# sourceMappingURL=Gradient.d.ts.map
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { ColorMode, Theme, ThemeOverrides } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Set the override object for a mode (defaults to the active one).
|
|
4
|
+
*
|
|
5
|
+
* REPLACES that mode's overrides; it does not accumulate them. Calling
|
|
6
|
+
* `setTheme({ colors })` and then `setTheme({ spacing })` leaves ONLY the
|
|
7
|
+
* spacing override live — the colours silently revert to the base theme. Pass
|
|
8
|
+
* one complete override object per mode, or merge them yourself before calling:
|
|
9
|
+
*
|
|
10
|
+
* setTheme({ ...myColors, ...mySpacing });
|
|
11
|
+
*
|
|
12
|
+
* This is deliberate (one override object per mode, last call wins) and is
|
|
13
|
+
* pinned by a test. Do not "fix" it to merge without treating that as the
|
|
14
|
+
* behaviour change it is: an app relying on replace to CLEAR a previous
|
|
15
|
+
* override would silently keep it.
|
|
16
|
+
*/
|
|
2
17
|
export declare const setTheme: (overrides: ThemeOverrides, mode?: ColorMode) => void;
|
|
3
18
|
export declare const setColorMode: (mode: ColorMode) => void;
|
|
4
19
|
export declare const getColorMode: () => ColorMode;
|
|
@@ -7,7 +22,7 @@ export declare const resetTheme: () => void;
|
|
|
7
22
|
export declare const subscribeTheme: (callback: () => void) => (() => void);
|
|
8
23
|
export { createAnimatedValue, setNativeValue } from './animatedValue';
|
|
9
24
|
export type { GradientProps } from './Gradient';
|
|
10
|
-
export { Gradient,
|
|
25
|
+
export { Gradient, gradientAngle, toBackgroundImage } from './Gradient';
|
|
11
26
|
export { mergeTheme } from './merge';
|
|
12
27
|
export type { ColorSchemePreference, ThemeProviderProps } from './ThemeContext';
|
|
13
28
|
export { ThemeProvider, useTheme, useThemeMode } from './ThemeContext';
|