@oxyhq/bloom 0.3.12 → 0.5.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 +133 -90
- package/lib/commonjs/bottom-sheet/index.js +341 -98
- package/lib/commonjs/bottom-sheet/index.js.map +1 -1
- package/lib/commonjs/context-menu/index.js +18 -19
- package/lib/commonjs/context-menu/index.js.map +1 -1
- package/lib/commonjs/dialog/BloomDialogProvider.js +61 -0
- package/lib/commonjs/dialog/BloomDialogProvider.js.map +1 -0
- package/lib/commonjs/dialog/BloomDialogProvider.web.js +45 -0
- package/lib/commonjs/dialog/BloomDialogProvider.web.js.map +1 -0
- package/lib/commonjs/dialog/Dialog.js +197 -100
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +194 -84
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +149 -0
- package/lib/commonjs/dialog/SheetShell.js.map +1 -0
- package/lib/commonjs/dialog/alert-store.js +116 -0
- package/lib/commonjs/dialog/alert-store.js.map +1 -0
- package/lib/commonjs/dialog/alert.js +38 -0
- package/lib/commonjs/dialog/alert.js.map +1 -0
- package/lib/commonjs/dialog/context.js +10 -2
- package/lib/commonjs/dialog/context.js.map +1 -1
- package/lib/commonjs/dialog/index.js +8 -24
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +10 -20
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/index.js +101 -66
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +101 -66
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/menu/index.js +21 -23
- package/lib/commonjs/menu/index.js.map +1 -1
- package/lib/commonjs/select/index.js +26 -27
- package/lib/commonjs/select/index.js.map +1 -1
- package/lib/commonjs/toast/index.js +42 -13
- package/lib/commonjs/toast/index.js.map +1 -1
- package/lib/commonjs/toast/index.web.js +19 -15
- package/lib/commonjs/toast/index.web.js.map +1 -1
- package/lib/module/bottom-sheet/index.js +341 -98
- package/lib/module/bottom-sheet/index.js.map +1 -1
- package/lib/module/context-menu/index.js +15 -16
- package/lib/module/context-menu/index.js.map +1 -1
- package/lib/module/dialog/BloomDialogProvider.js +57 -0
- package/lib/module/dialog/BloomDialogProvider.js.map +1 -0
- package/lib/module/dialog/BloomDialogProvider.web.js +41 -0
- package/lib/module/dialog/BloomDialogProvider.web.js.map +1 -0
- package/lib/module/dialog/Dialog.js +199 -87
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +195 -70
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +143 -0
- package/lib/module/dialog/SheetShell.js.map +1 -0
- package/lib/module/dialog/alert-store.js +107 -0
- package/lib/module/dialog/alert-store.js.map +1 -0
- package/lib/module/dialog/alert.js +35 -0
- package/lib/module/dialog/alert.js.map +1 -0
- package/lib/module/dialog/context.js +10 -2
- package/lib/module/dialog/context.js.map +1 -1
- package/lib/module/dialog/index.js +3 -1
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +9 -7
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/module/index.js +2 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +2 -3
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/menu/index.js +11 -13
- package/lib/module/menu/index.js.map +1 -1
- package/lib/module/select/index.js +27 -28
- package/lib/module/select/index.js.map +1 -1
- package/lib/module/toast/index.js +41 -11
- package/lib/module/toast/index.js.map +1 -1
- package/lib/module/toast/index.web.js +18 -13
- package/lib/module/toast/index.web.js.map +1 -1
- package/lib/typescript/commonjs/__tests__/Dialog.test.d.ts +2 -0
- package/lib/typescript/commonjs/__tests__/Dialog.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts +47 -1
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.d.ts +4 -3
- package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.d.ts +27 -0
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.web.d.ts +15 -0
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/Dialog.d.ts +37 -10
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +26 -10
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts +31 -0
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/alert-store.d.ts +70 -0
- package/lib/typescript/commonjs/dialog/alert-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/alert.d.ts +27 -0
- package/lib/typescript/commonjs/dialog/alert.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/context.d.ts +7 -0
- package/lib/typescript/commonjs/dialog/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.d.ts +5 -2
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +5 -2
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +70 -15
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +3 -3
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.d.ts +4 -4
- package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/index.d.ts +32 -3
- package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/index.web.d.ts +14 -7
- package/lib/typescript/commonjs/toast/index.web.d.ts.map +1 -1
- package/lib/typescript/module/__tests__/Dialog.test.d.ts +2 -0
- package/lib/typescript/module/__tests__/Dialog.test.d.ts.map +1 -0
- package/lib/typescript/module/bottom-sheet/index.d.ts +47 -1
- package/lib/typescript/module/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.d.ts +4 -3
- package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/BloomDialogProvider.d.ts +27 -0
- package/lib/typescript/module/dialog/BloomDialogProvider.d.ts.map +1 -0
- package/lib/typescript/module/dialog/BloomDialogProvider.web.d.ts +15 -0
- package/lib/typescript/module/dialog/BloomDialogProvider.web.d.ts.map +1 -0
- package/lib/typescript/module/dialog/Dialog.d.ts +37 -10
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts +26 -10
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/SheetShell.d.ts +31 -0
- package/lib/typescript/module/dialog/SheetShell.d.ts.map +1 -0
- package/lib/typescript/module/dialog/alert-store.d.ts +70 -0
- package/lib/typescript/module/dialog/alert-store.d.ts.map +1 -0
- package/lib/typescript/module/dialog/alert.d.ts +27 -0
- package/lib/typescript/module/dialog/alert.d.ts.map +1 -0
- package/lib/typescript/module/dialog/context.d.ts +7 -0
- package/lib/typescript/module/dialog/context.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.d.ts +5 -2
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +5 -2
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +70 -15
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +3 -3
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.d.ts +4 -4
- package/lib/typescript/module/menu/index.d.ts.map +1 -1
- package/lib/typescript/module/select/index.d.ts.map +1 -1
- package/lib/typescript/module/toast/index.d.ts +32 -3
- package/lib/typescript/module/toast/index.d.ts.map +1 -1
- package/lib/typescript/module/toast/index.web.d.ts +14 -7
- package/lib/typescript/module/toast/index.web.d.ts.map +1 -1
- package/package.json +3 -14
- package/src/__tests__/BottomSheet.test.tsx +149 -2
- package/src/__tests__/Dialog.test.tsx +177 -0
- package/src/bottom-sheet/index.tsx +367 -83
- package/src/context-menu/index.tsx +12 -12
- package/src/dialog/BloomDialogProvider.tsx +61 -0
- package/src/dialog/BloomDialogProvider.web.tsx +46 -0
- package/src/dialog/Dialog.tsx +217 -64
- package/src/dialog/Dialog.web.tsx +240 -75
- package/src/dialog/SheetShell.tsx +154 -0
- package/src/dialog/alert-store.ts +126 -0
- package/src/dialog/alert.ts +42 -0
- package/src/dialog/context.ts +14 -3
- package/src/dialog/index.ts +14 -2
- package/src/dialog/index.web.ts +20 -8
- package/src/dialog/types.ts +73 -16
- package/src/index.ts +17 -3
- package/src/index.web.ts +17 -3
- package/src/menu/index.tsx +13 -17
- package/src/select/index.tsx +30 -30
- package/src/toast/index.tsx +55 -11
- package/src/toast/index.web.tsx +33 -13
- package/lib/commonjs/prompt/Prompt.js +0 -267
- package/lib/commonjs/prompt/Prompt.js.map +0 -1
- package/lib/commonjs/prompt/index.js +0 -61
- package/lib/commonjs/prompt/index.js.map +0 -1
- package/lib/module/prompt/Prompt.js +0 -250
- package/lib/module/prompt/Prompt.js.map +0 -1
- package/lib/module/prompt/index.js +0 -4
- package/lib/module/prompt/index.js.map +0 -1
- package/lib/typescript/commonjs/prompt/Prompt.d.ts +0 -42
- package/lib/typescript/commonjs/prompt/Prompt.d.ts.map +0 -1
- package/lib/typescript/commonjs/prompt/index.d.ts +0 -3
- package/lib/typescript/commonjs/prompt/index.d.ts.map +0 -1
- package/lib/typescript/module/prompt/Prompt.d.ts +0 -42
- package/lib/typescript/module/prompt/Prompt.d.ts.map +0 -1
- package/lib/typescript/module/prompt/index.d.ts +0 -3
- package/lib/typescript/module/prompt/index.d.ts.map +0 -1
- package/src/prompt/Prompt.tsx +0 -247
- package/src/prompt/index.ts +0 -13
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Imperative open/close handle returned by `useDialogControl`.
|
|
4
|
+
*
|
|
5
|
+
* Consumers receive an instance of `DialogControlProps`, which is a stable
|
|
6
|
+
* object whose `open`/`close` methods proxy to whichever `Dialog` instance
|
|
7
|
+
* has currently registered itself via the internal ref. Re-rendering the
|
|
8
|
+
* dialog under the same control does not break the handle.
|
|
9
|
+
*/
|
|
2
10
|
export type DialogControlRefProps = {
|
|
3
|
-
open: (
|
|
11
|
+
open: () => void;
|
|
4
12
|
close: (callback?: () => void) => void;
|
|
5
13
|
};
|
|
6
14
|
export type DialogControlProps = DialogControlRefProps & {
|
|
@@ -11,25 +19,72 @@ export type DialogContextProps = {
|
|
|
11
19
|
close: DialogControlProps['close'];
|
|
12
20
|
isWithinDialog: boolean;
|
|
13
21
|
};
|
|
14
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Color of a declarative `DialogAction`. Maps to bloom's theme palette:
|
|
24
|
+
*
|
|
25
|
+
* - `'default'` -> theme primary (filled CTA)
|
|
26
|
+
* - `'cancel'` -> theme secondary (auto-dismiss, no `onPress` required)
|
|
27
|
+
* - `'destructive'` -> theme negative
|
|
28
|
+
*/
|
|
29
|
+
export type DialogActionColor = 'default' | 'cancel' | 'destructive';
|
|
30
|
+
export type DialogAction = {
|
|
31
|
+
label: string;
|
|
32
|
+
onPress?: (e: GestureResponderEvent) => void;
|
|
33
|
+
color?: DialogActionColor;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Defaults to `true`. When `true`, the dialog closes (and runs the close
|
|
37
|
+
* animation) before `onPress` is invoked, which gives the surrounding
|
|
38
|
+
* screen transition a chance to start before the action's side effects
|
|
39
|
+
* (navigation, network, etc.) kick in. Set `false` to keep the dialog
|
|
40
|
+
* mounted (e.g. while an async confirmation is in flight).
|
|
41
|
+
*/
|
|
42
|
+
shouldCloseOnPress?: boolean;
|
|
43
|
+
testID?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Props accepted by the unified `<Dialog>` component.
|
|
47
|
+
*
|
|
48
|
+
* Three usage modes — pick whichever fits the call site:
|
|
49
|
+
*
|
|
50
|
+
* 1. **Declarative (`title` / `description` / `actions`).** Most common
|
|
51
|
+
* confirm/cancel surface. Bloom renders the title, description and
|
|
52
|
+
* action row for you.
|
|
53
|
+
*
|
|
54
|
+
* 2. **Custom children.** Pass any JSX as `children` and bloom renders it
|
|
55
|
+
* verbatim inside the dialog frame. Combine with `title` to keep the
|
|
56
|
+
* header consistent.
|
|
57
|
+
*
|
|
58
|
+
* 3. **Imperative `alert()`.** Bypass the JSX layer entirely — see the
|
|
59
|
+
* module-level `alert()` helper.
|
|
60
|
+
*/
|
|
61
|
+
export type DialogProps = React.PropsWithChildren<{
|
|
15
62
|
control: DialogControlProps;
|
|
63
|
+
/** Fires after the dialog has finished closing. */
|
|
16
64
|
onClose?: () => void;
|
|
17
65
|
testID?: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
66
|
+
/** Optional dialog header text. Rendered above `description` / `children`. */
|
|
67
|
+
title?: string;
|
|
68
|
+
/** Optional supporting copy, rendered below the title. */
|
|
69
|
+
description?: string;
|
|
21
70
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
71
|
+
* Optional action row. When provided, bloom renders the appropriate
|
|
72
|
+
* confirm/cancel/destructive buttons for you. Order is preserved.
|
|
73
|
+
*/
|
|
74
|
+
actions?: DialogAction[];
|
|
75
|
+
/**
|
|
76
|
+
* Style overrides applied to the inner content container on native (the
|
|
77
|
+
* floating bottom-sheet card) and to the modal panel on web.
|
|
25
78
|
*/
|
|
26
|
-
preventExpansion?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export type DialogInnerProps = React.PropsWithChildren<{
|
|
29
79
|
style?: StyleProp<ViewStyle>;
|
|
80
|
+
/** Accessibility label, applied to the dialog role on web. */
|
|
30
81
|
label?: string;
|
|
31
|
-
header?: React.ReactNode;
|
|
32
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
33
|
-
keyboardDismissMode?: ScrollViewProps['keyboardDismissMode'];
|
|
34
82
|
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Web-only options. Native uses bloom's `BottomSheet` underneath which has
|
|
85
|
+
* its own positioning model.
|
|
86
|
+
*/
|
|
87
|
+
export type DialogWebOptions = {
|
|
88
|
+
alignCenter?: boolean;
|
|
89
|
+
};
|
|
35
90
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAC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,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
|
|
@@ -9,8 +9,8 @@ export { useThrottledValue } from './hooks/useThrottledValue';
|
|
|
9
9
|
export * as Icons from './icons';
|
|
10
10
|
export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
|
|
11
11
|
export * from './portal';
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export { Dialog, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog';
|
|
13
|
+
export type { AlertButton, AlertButtonStyle, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog';
|
|
14
14
|
export * from './button';
|
|
15
15
|
export * from './grouped-buttons';
|
|
16
16
|
export * from './divider';
|
|
@@ -22,7 +22,7 @@ export * from './avatar';
|
|
|
22
22
|
export * from './loading';
|
|
23
23
|
export * as PromptInput from './prompt-input';
|
|
24
24
|
export * from './switch';
|
|
25
|
-
export
|
|
25
|
+
export { toast, type Toast } from './toast';
|
|
26
26
|
export * as Typography from './typography';
|
|
27
27
|
export * as Skeleton from './skeleton';
|
|
28
28
|
export * as Grid from './grid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;A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MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -9,8 +9,8 @@ export { useThrottledValue } from './hooks/useThrottledValue';
|
|
|
9
9
|
export * as Icons from './icons';
|
|
10
10
|
export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
|
|
11
11
|
export * from './portal/index.web';
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export { Dialog, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog/index.web';
|
|
13
|
+
export type { AlertButton, AlertButtonStyle, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog/index.web';
|
|
14
14
|
export * from './button';
|
|
15
15
|
export * from './grouped-buttons';
|
|
16
16
|
export * from './divider';
|
|
@@ -22,7 +22,7 @@ export * from './avatar';
|
|
|
22
22
|
export * from './loading';
|
|
23
23
|
export * as PromptInput from './prompt-input';
|
|
24
24
|
export * from './switch';
|
|
25
|
-
export
|
|
25
|
+
export { toast, type Toast } from './toast/index.web';
|
|
26
26
|
export * as Typography from './typography';
|
|
27
27
|
export * as Skeleton from './skeleton';
|
|
28
28
|
export * as Grid from './grid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAMA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAA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,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAGxD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import type { DialogControlProps } from '../dialog/types';
|
|
4
4
|
import { useMenuContext } from './context';
|
|
5
5
|
import type { GroupProps, ItemIconProps, ItemProps, ItemTextProps, TriggerProps } from './types';
|
|
6
|
-
export type { DialogControlProps as MenuControlProps } from '../dialog';
|
|
7
|
-
export { useDialogControl as useMenuControl } from '../dialog';
|
|
6
|
+
export type { DialogControlProps as MenuControlProps } from '../dialog/types';
|
|
7
|
+
export { useDialogControl as useMenuControl } from '../dialog/context';
|
|
8
8
|
export { useMenuContext };
|
|
9
9
|
export declare function Root({ children, control, }: React.PropsWithChildren<{
|
|
10
|
-
control?:
|
|
10
|
+
control?: DialogControlProps;
|
|
11
11
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare function Trigger({ children, label, role, hint, }: TriggerProps): React.ReactNode;
|
|
13
13
|
export declare function Outer({ children, showCancel, }: React.PropsWithChildren<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiF,MAAM,OAAO,CAAC;AACtG,OAAO,EAA+B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/men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,2CAgB3D;AAED,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,UAAU,2CAsCpD;AAED,wBAAgB,OAAO,SAEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,EAA0C,cAAc,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,SAAS,EAET,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,CAAC;AA8B1B,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,SAAS,2CAgB3E;AAMD,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,YAAY,yTAqCxD;AAMD,wBAAgB,SAAS,CAAC,EACxB,WAAW,EACX,QAAQ,EAAE,YAAkC,EAC5C,KAAK,GACN,EAAE,cAAc,2CAkBhB;AAaD,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,2CAGrC;AAMD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,KAAK,EACL,cAA0C,EAC1C,GAAG,KAAK,EACT,EAAE,YAAY,CAAC,CAAC,CAAC,2CAwBjB;AAkED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,SAAS,2CA2ChE;AAMD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,2CAc1D;AAMD,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,kBAAkB,2CAYxE;AAMD,wBAAgB,SAAS,4CAWxB"}
|
|
@@ -9,7 +9,8 @@ export type { ToastType, BaseToastOptions } from './types';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Direct access to the Sonner API. Use sparingly — `toast()` covers the
|
|
13
|
+
* common case and keeps the surface tied to bloom's themed look.
|
|
13
14
|
*/
|
|
14
15
|
export declare const api: ((message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
15
16
|
id?: string | number;
|
|
@@ -49,7 +50,35 @@ export declare const api: ((message: string, data?: Omit<import("sonner-native")
|
|
|
49
50
|
/**
|
|
50
51
|
* Show a toast notification.
|
|
51
52
|
*
|
|
52
|
-
* Pass a string for a simple text toast, or a React element for a custom
|
|
53
|
+
* Pass a string for a simple text toast, or a React element for a custom
|
|
54
|
+
* toast. The optional `options` argument accepts the standard Sonner
|
|
55
|
+
* options plus a bloom `type` (defaults to `'default'`).
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* toast('Saved');
|
|
59
|
+
* toast.success('Profile updated');
|
|
60
|
+
* toast.error('Network error', { duration: 5000 });
|
|
61
|
+
* toast.dismiss(id);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* Pre-typed variants (`toast.success`, `toast.error`, `toast.warning`,
|
|
65
|
+
* `toast.info`) are aliases for the corresponding `type`.
|
|
66
|
+
*/
|
|
67
|
+
export interface ToastFn {
|
|
68
|
+
(content: React.ReactNode, options?: BaseToastOptions): void;
|
|
69
|
+
success: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
70
|
+
error: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
71
|
+
warning: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
72
|
+
info: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
73
|
+
dismiss: (id?: string | number) => void;
|
|
74
|
+
}
|
|
75
|
+
export declare const toast: ToastFn;
|
|
76
|
+
/**
|
|
77
|
+
* Alias of `toast` kept for compatibility with the original 0.4.x surface
|
|
78
|
+
* where `show()` was the documented entry point. New code should prefer
|
|
79
|
+
* `toast()` directly.
|
|
53
80
|
*/
|
|
54
|
-
export declare
|
|
81
|
+
export declare const show: ToastFn;
|
|
82
|
+
/** Re-export the Toast function type so callers can refer to it. */
|
|
83
|
+
export type Toast = ToastFn;
|
|
55
84
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAY9C,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAY9C,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,WAAW,4CAE1B;AAUD;;;GAGG;AACH,eAAO,MAAM,GAAG;;;mCA8F+W,CAAC;;;gCAAqE,CAAC;;;iCAAsE,CAAC;;;mCAAwE,CAAC;;;0CAA+E,CAAC;;;;;;;;;mBA9GlqB,CAAC;mBACF,CAAC;iBAA4B,CAAC;;;mCA6GizB,CAAC;;;gBAAqD,CAAC;;CA9Fh3B,CAAC;AAwC1B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACpF,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACnF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACzC;AAYD,eAAO,MAAM,KAAK,EAAE,OAAmB,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,OAAmB,CAAC;AAEvC,oEAAoE;AACpE,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC"}
|
|
@@ -9,14 +9,21 @@ export type { ToastType, BaseToastOptions } from './types';
|
|
|
9
9
|
* component tree.
|
|
10
10
|
*/
|
|
11
11
|
export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* Access the full Sonner API
|
|
14
|
-
*/
|
|
12
|
+
/** Direct access to the underlying Sonner API. Use sparingly. */
|
|
15
13
|
export declare const api: typeof sonner;
|
|
16
14
|
/**
|
|
17
|
-
* Show a toast notification.
|
|
18
|
-
*
|
|
19
|
-
* Pass a string for a simple text toast, or a React element for a custom toast.
|
|
15
|
+
* Show a toast notification. Identical API to the native variant — see
|
|
16
|
+
* `./index.tsx` for the full usage docs.
|
|
20
17
|
*/
|
|
21
|
-
export
|
|
18
|
+
export interface ToastFn {
|
|
19
|
+
(content: React.ReactNode, options?: BaseToastOptions): void;
|
|
20
|
+
success: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
21
|
+
error: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
22
|
+
warning: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
23
|
+
info: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
24
|
+
dismiss: (id?: string | number) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const toast: ToastFn;
|
|
27
|
+
export declare const show: ToastFn;
|
|
28
|
+
export type Toast = ToastFn;
|
|
22
29
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,IAAI,MAAM,EAAW,MAAM,QAAQ,CAAC;AASlD,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,IAAI,MAAM,EAAW,MAAM,QAAQ,CAAC;AASlD,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,QAAQ,EA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
|
2
2
|
"name": "@oxyhq/bloom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -93,17 +93,6 @@
|
|
|
93
93
|
"default": "./lib/commonjs/dialog/index.js"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
-
"./prompt": {
|
|
97
|
-
"react-native": "./src/prompt/index.ts",
|
|
98
|
-
"import": {
|
|
99
|
-
"types": "./lib/typescript/module/prompt/index.d.ts",
|
|
100
|
-
"default": "./lib/module/prompt/index.js"
|
|
101
|
-
},
|
|
102
|
-
"require": {
|
|
103
|
-
"types": "./lib/typescript/commonjs/prompt/index.d.ts",
|
|
104
|
-
"default": "./lib/commonjs/prompt/index.js"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
96
|
"./button": {
|
|
108
97
|
"react-native": "./src/button/index.ts",
|
|
109
98
|
"import": {
|
|
@@ -553,7 +542,8 @@
|
|
|
553
542
|
"ui",
|
|
554
543
|
"components",
|
|
555
544
|
"dialog",
|
|
556
|
-
"
|
|
545
|
+
"alert",
|
|
546
|
+
"toast",
|
|
557
547
|
"button",
|
|
558
548
|
"theme",
|
|
559
549
|
"avatar",
|
|
@@ -562,7 +552,6 @@
|
|
|
562
552
|
"collapsible",
|
|
563
553
|
"error-boundary",
|
|
564
554
|
"prompt-input",
|
|
565
|
-
"toast",
|
|
566
555
|
"icons",
|
|
567
556
|
"typography",
|
|
568
557
|
"skeleton",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { createRef } from 'react';
|
|
2
|
-
import { Dimensions } from 'react-native';
|
|
3
|
-
import { render } from '@testing-library/react-native';
|
|
2
|
+
import { Dimensions, Text } from 'react-native';
|
|
3
|
+
import { act, render } from '@testing-library/react-native';
|
|
4
4
|
|
|
5
5
|
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
6
6
|
import BottomSheet, { type BottomSheetRef } from '../bottom-sheet';
|
|
@@ -106,4 +106,151 @@ describe('BottomSheet', () => {
|
|
|
106
106
|
unmount();
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
|
+
|
|
110
|
+
describe('scrollable prop', () => {
|
|
111
|
+
it('renders children directly when scrollable is false (no internal ScrollView wrap)', () => {
|
|
112
|
+
// When scrollable={false}, the screen owns its own scrolling primitive
|
|
113
|
+
// (FlatList, SectionList, etc.) so we must not wrap in Animated.ScrollView
|
|
114
|
+
// — that would nest a VirtualizedList inside a ScrollView and trigger
|
|
115
|
+
// the well-known RN warning + break windowing.
|
|
116
|
+
const ref = createRef<BottomSheetRef>();
|
|
117
|
+
const { UNSAFE_queryAllByType, getByText } = renderWithTheme(
|
|
118
|
+
<BottomSheet ref={ref} scrollable={false}>
|
|
119
|
+
<Text>Non-scrollable content</Text>
|
|
120
|
+
</BottomSheet>,
|
|
121
|
+
);
|
|
122
|
+
// Force-present so the sheet actually mounts its children.
|
|
123
|
+
act(() => {
|
|
124
|
+
ref.current?.present();
|
|
125
|
+
});
|
|
126
|
+
// Children render unconditionally — only the WRAPPING ScrollView is
|
|
127
|
+
// suppressed.
|
|
128
|
+
expect(getByText('Non-scrollable content')).toBeTruthy();
|
|
129
|
+
// No Animated.ScrollView host node should appear in the tree.
|
|
130
|
+
const scrollViewNodes = UNSAFE_queryAllByType('Animated.ScrollView' as never);
|
|
131
|
+
expect(scrollViewNodes.length).toBe(0);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('defaults to wrapping children in a ScrollView (backwards-compat)', () => {
|
|
135
|
+
const ref = createRef<BottomSheetRef>();
|
|
136
|
+
const { UNSAFE_queryAllByType, getByText } = renderWithTheme(
|
|
137
|
+
<BottomSheet ref={ref}>
|
|
138
|
+
<Text>Default content</Text>
|
|
139
|
+
</BottomSheet>,
|
|
140
|
+
);
|
|
141
|
+
act(() => {
|
|
142
|
+
ref.current?.present();
|
|
143
|
+
});
|
|
144
|
+
expect(getByText('Default content')).toBeTruthy();
|
|
145
|
+
// Default scrollable=true → Animated.ScrollView is present in the tree.
|
|
146
|
+
const scrollViewNodes = UNSAFE_queryAllByType('Animated.ScrollView' as never);
|
|
147
|
+
expect(scrollViewNodes.length).toBeGreaterThan(0);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe('manualActivation prop', () => {
|
|
152
|
+
it('renders without errors with manualActivation enabled', () => {
|
|
153
|
+
// manualActivation switches the body pan to the gorhom coordination
|
|
154
|
+
// model (manualActivation(true) + onTouchesMove gating). The whole pan
|
|
155
|
+
// pipeline must construct cleanly through the gesture-handler mock.
|
|
156
|
+
const ref = createRef<BottomSheetRef>();
|
|
157
|
+
const { unmount } = renderWithTheme(
|
|
158
|
+
<BottomSheet ref={ref} manualActivation>
|
|
159
|
+
<React.Fragment>Content</React.Fragment>
|
|
160
|
+
</BottomSheet>,
|
|
161
|
+
);
|
|
162
|
+
act(() => {
|
|
163
|
+
ref.current?.present();
|
|
164
|
+
});
|
|
165
|
+
unmount();
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe('dynamicBackdrop prop', () => {
|
|
170
|
+
it('renders without errors with dynamicBackdrop enabled', () => {
|
|
171
|
+
// iOS Photos-style backdrop dim — proportional to drag distance. The
|
|
172
|
+
// animated style closure must evaluate without throwing under the
|
|
173
|
+
// interpolate mock (which accepts and ignores the clamp arg).
|
|
174
|
+
const ref = createRef<BottomSheetRef>();
|
|
175
|
+
const { unmount } = renderWithTheme(
|
|
176
|
+
<BottomSheet ref={ref} dynamicBackdrop>
|
|
177
|
+
<React.Fragment>Dynamic content</React.Fragment>
|
|
178
|
+
</BottomSheet>,
|
|
179
|
+
);
|
|
180
|
+
act(() => {
|
|
181
|
+
ref.current?.present();
|
|
182
|
+
});
|
|
183
|
+
unmount();
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe('handleComponent prop', () => {
|
|
188
|
+
it('renders a custom handle when handleComponent is provided', () => {
|
|
189
|
+
const ref = createRef<BottomSheetRef>();
|
|
190
|
+
const { getByText } = renderWithTheme(
|
|
191
|
+
<BottomSheet
|
|
192
|
+
ref={ref}
|
|
193
|
+
handleComponent={() => <Text>Custom Handle</Text>}
|
|
194
|
+
>
|
|
195
|
+
<Text>Sheet body</Text>
|
|
196
|
+
</BottomSheet>,
|
|
197
|
+
);
|
|
198
|
+
act(() => {
|
|
199
|
+
ref.current?.present();
|
|
200
|
+
});
|
|
201
|
+
expect(getByText('Custom Handle')).toBeTruthy();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('suppresses handle entirely when showHandle is false (even with handleComponent)', () => {
|
|
205
|
+
// showHandle is the master switch — handleComponent is only consulted
|
|
206
|
+
// when showHandle is true. This preserves the existing API contract
|
|
207
|
+
// for consumers that opt out of the handle entirely.
|
|
208
|
+
const ref = createRef<BottomSheetRef>();
|
|
209
|
+
const { queryByText } = renderWithTheme(
|
|
210
|
+
<BottomSheet
|
|
211
|
+
ref={ref}
|
|
212
|
+
showHandle={false}
|
|
213
|
+
handleComponent={() => <Text>Should Not Appear</Text>}
|
|
214
|
+
>
|
|
215
|
+
<Text>Body</Text>
|
|
216
|
+
</BottomSheet>,
|
|
217
|
+
);
|
|
218
|
+
act(() => {
|
|
219
|
+
ref.current?.present();
|
|
220
|
+
});
|
|
221
|
+
expect(queryByText('Should Not Appear')).toBeNull();
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
describe('close generation tracking', () => {
|
|
226
|
+
it('re-opening the sheet after dismiss does not throw or get stuck', () => {
|
|
227
|
+
// Regression test for the "tap to open does nothing" bug: when the
|
|
228
|
+
// user dismisses and immediately re-opens, a stale runOnJS(finishClose)
|
|
229
|
+
// from the cancelled close cycle must NOT fire onDismiss on the new
|
|
230
|
+
// session. The closeGeneration counter guards this — finishClose
|
|
231
|
+
// checks that its captured generation still matches the live one.
|
|
232
|
+
const onDismiss = jest.fn();
|
|
233
|
+
const ref = createRef<BottomSheetRef>();
|
|
234
|
+
renderWithTheme(
|
|
235
|
+
<BottomSheet ref={ref} onDismiss={onDismiss}>
|
|
236
|
+
<React.Fragment>Content</React.Fragment>
|
|
237
|
+
</BottomSheet>,
|
|
238
|
+
);
|
|
239
|
+
// Open → close → open → close → open. Each present() bumps the
|
|
240
|
+
// generation; any in-flight close callback from a prior cycle no-ops.
|
|
241
|
+
act(() => {
|
|
242
|
+
ref.current?.present();
|
|
243
|
+
ref.current?.dismiss();
|
|
244
|
+
ref.current?.present();
|
|
245
|
+
ref.current?.dismiss();
|
|
246
|
+
ref.current?.present();
|
|
247
|
+
});
|
|
248
|
+
// The sequence does not throw and the sheet does not get stuck in a
|
|
249
|
+
// half-closed state. The fact that `present()` after `dismiss()`
|
|
250
|
+
// returns cleanly is itself the proof the generation guard works:
|
|
251
|
+
// without it, the stale dismiss callback would unmount the sheet
|
|
252
|
+
// mid-reopen and the next present() would have no effect.
|
|
253
|
+
expect(ref.current).not.toBeNull();
|
|
254
|
+
});
|
|
255
|
+
});
|
|
109
256
|
});
|