@umituz/react-native-bottom-sheet 1.0.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ümit UZ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # @umituz/react-native-bottom-sheet
2
+
3
+ Modern, performant bottom sheets for React Native with preset configurations, keyboard handling, and smooth animations.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @umituz/react-native-bottom-sheet
9
+ ```
10
+
11
+ ## Peer Dependencies
12
+
13
+ - `react` >= 18.2.0
14
+ - `react-native` >= 0.74.0
15
+ - `@gorhom/bottom-sheet` >= 5.0.0
16
+ - `react-native-gesture-handler` >= 2.16.0
17
+ - `react-native-reanimated` >= 3.10.0
18
+
19
+ ## Features
20
+
21
+ - ✅ Preset configurations (small, medium, large, full)
22
+ - ✅ Custom snap points (percentage, fixed, dynamic)
23
+ - ✅ Backdrop with tap-to-close
24
+ - ✅ Keyboard handling (interactive, fillParent, extend)
25
+ - ✅ Theme-aware colors
26
+ - ✅ Handle indicator
27
+ - ✅ Pan down to close
28
+ - ✅ Smooth animations with Reanimated v3
29
+ - ✅ Offline-compatible (100% client-side)
30
+
31
+ ## Usage
32
+
33
+ ### Basic Usage
34
+
35
+ ```tsx
36
+ import { BottomSheet, useBottomSheet } from '@umituz/react-native-bottom-sheet';
37
+
38
+ const MyScreen = () => {
39
+ const { sheetRef, open, close } = useBottomSheet();
40
+
41
+ return (
42
+ <>
43
+ <Button onPress={open}>Open Sheet</Button>
44
+ <BottomSheet
45
+ ref={sheetRef}
46
+ preset="medium"
47
+ onClose={() => console.log('Closed')}
48
+ >
49
+ <View>
50
+ <Text>Bottom Sheet Content</Text>
51
+ </View>
52
+ </BottomSheet>
53
+ </>
54
+ );
55
+ };
56
+ ```
57
+
58
+ ### Custom Snap Points
59
+
60
+ ```tsx
61
+ <BottomSheet
62
+ snapPoints={['25%', '50%', '90%']}
63
+ initialIndex={1}
64
+ enableBackdrop
65
+ >
66
+ <FilterForm />
67
+ </BottomSheet>
68
+ ```
69
+
70
+ ### Keyboard-Aware Sheet
71
+
72
+ ```tsx
73
+ <BottomSheet
74
+ preset="large"
75
+ keyboardBehavior="fillParent"
76
+ >
77
+ <CommentForm />
78
+ </BottomSheet>
79
+ ```
80
+
81
+ ## Presets
82
+
83
+ - `small`: 25% height
84
+ - `medium`: 50% height
85
+ - `large`: 75% height
86
+ - `full`: Multi-snap (25%, 50%, 90%)
87
+
88
+ ## API
89
+
90
+ ### Components
91
+
92
+ - `BottomSheet`: Main bottom sheet component
93
+
94
+ ### Hooks
95
+
96
+ - `useBottomSheet()`: Hook for managing bottom sheet state
97
+
98
+ ## License
99
+
100
+ MIT
101
+
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Bottom Sheet Domain - Entity
3
+ *
4
+ * Defines bottom sheet types, snap point configurations, and utilities.
5
+ * Provides a clean abstraction over @gorhom/bottom-sheet library.
6
+ *
7
+ * Features:
8
+ * - Snap point types (percentage, fixed, dynamic)
9
+ * - Pre-built configs (small, medium, large, full)
10
+ * - Backdrop configurations
11
+ * - Animation timing configs
12
+ * - Keyboard behavior options
13
+ *
14
+ * Architecture:
15
+ * - Domain Layer: Pure business logic, no UI dependencies
16
+ * - Factory pattern for config creation
17
+ * - Type-safe snap points and options
18
+ */
19
+ /**
20
+ * Snap point types for bottom sheet positioning
21
+ */
22
+ export type SnapPoint = string | number;
23
+ /**
24
+ * Keyboard behavior strategies
25
+ */
26
+ export type KeyboardBehavior = 'interactive' | 'fillParent' | 'extend';
27
+ /**
28
+ * Bottom sheet preset sizes
29
+ */
30
+ export type BottomSheetPreset = 'small' | 'medium' | 'large' | 'full';
31
+ /**
32
+ * Bottom sheet configuration interface
33
+ */
34
+ export interface BottomSheetConfig {
35
+ /**
36
+ * Snap points for the bottom sheet
37
+ * - Percentage: '25%', '50%', '75%'
38
+ * - Fixed: 200, 400, 600
39
+ * - Dynamic: 'CONTENT_HEIGHT'
40
+ */
41
+ snapPoints: SnapPoint[];
42
+ /**
43
+ * Initial snap point index (default: 0)
44
+ */
45
+ initialIndex?: number;
46
+ /**
47
+ * Enable backdrop (darkens background)
48
+ */
49
+ enableBackdrop?: boolean;
50
+ /**
51
+ * Backdrop appears at this snap index (default: 0)
52
+ */
53
+ backdropAppearsOnIndex?: number;
54
+ /**
55
+ * Backdrop disappears at this snap index (default: -1)
56
+ */
57
+ backdropDisappearsOnIndex?: number;
58
+ /**
59
+ * Keyboard behavior strategy
60
+ */
61
+ keyboardBehavior?: KeyboardBehavior;
62
+ /**
63
+ * Enable handle indicator (default: true)
64
+ */
65
+ enableHandleIndicator?: boolean;
66
+ /**
67
+ * Enable pan down to close (default: true)
68
+ */
69
+ enablePanDownToClose?: boolean;
70
+ /**
71
+ * Enable dynamic sizing
72
+ */
73
+ enableDynamicSizing?: boolean;
74
+ }
75
+ /**
76
+ * Backdrop configuration
77
+ */
78
+ export interface BackdropConfig {
79
+ appearsOnIndex: number;
80
+ disappearsOnIndex: number;
81
+ opacity?: number;
82
+ pressBehavior?: 'none' | 'close' | 'collapse';
83
+ }
84
+ /**
85
+ * Pre-built bottom sheet configurations
86
+ */
87
+ export declare const BOTTOM_SHEET_PRESETS: Record<BottomSheetPreset, BottomSheetConfig>;
88
+ /**
89
+ * Default bottom sheet configuration
90
+ */
91
+ export declare const DEFAULT_BOTTOM_SHEET_CONFIG: BottomSheetConfig;
92
+ /**
93
+ * Bottom sheet utilities
94
+ */
95
+ export declare const BottomSheetUtils: {
96
+ /**
97
+ * Create custom bottom sheet config
98
+ */
99
+ createConfig: (overrides: Partial<BottomSheetConfig>) => BottomSheetConfig;
100
+ /**
101
+ * Get preset configuration
102
+ */
103
+ getPreset: (preset: BottomSheetPreset) => BottomSheetConfig;
104
+ /**
105
+ * Validate snap points
106
+ */
107
+ validateSnapPoints: (snapPoints: SnapPoint[]) => boolean;
108
+ /**
109
+ * Create backdrop config
110
+ */
111
+ createBackdropConfig: (appearsOnIndex?: number, disappearsOnIndex?: number, opacity?: number) => BackdropConfig;
112
+ };
113
+ //# sourceMappingURL=BottomSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/BottomSheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,UAAU,EAAE,SAAS,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;CAC/C;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,iBAAiB,EAAE,iBAAiB,CAqC7E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,iBAUzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;8BACuB,OAAO,CAAC,iBAAiB,CAAC,KAAG,iBAAiB;IAOxE;;OAEG;wBACiB,iBAAiB,KAAG,iBAAiB;IAIzD;;OAEG;qCAC8B,SAAS,EAAE,KAAG,OAAO;IAgBtD;;OAEG;4CAEe,MAAM,sBACH,MAAM,YAChB,MAAM,KACd,cAAc;CAQlB,CAAC"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Bottom Sheet Domain - Entity
3
+ *
4
+ * Defines bottom sheet types, snap point configurations, and utilities.
5
+ * Provides a clean abstraction over @gorhom/bottom-sheet library.
6
+ *
7
+ * Features:
8
+ * - Snap point types (percentage, fixed, dynamic)
9
+ * - Pre-built configs (small, medium, large, full)
10
+ * - Backdrop configurations
11
+ * - Animation timing configs
12
+ * - Keyboard behavior options
13
+ *
14
+ * Architecture:
15
+ * - Domain Layer: Pure business logic, no UI dependencies
16
+ * - Factory pattern for config creation
17
+ * - Type-safe snap points and options
18
+ */
19
+ /**
20
+ * Pre-built bottom sheet configurations
21
+ */
22
+ export const BOTTOM_SHEET_PRESETS = {
23
+ small: {
24
+ snapPoints: ['25%'],
25
+ initialIndex: 0,
26
+ enableBackdrop: true,
27
+ backdropAppearsOnIndex: 0,
28
+ backdropDisappearsOnIndex: -1,
29
+ enableHandleIndicator: true,
30
+ enablePanDownToClose: true,
31
+ },
32
+ medium: {
33
+ snapPoints: ['50%'],
34
+ initialIndex: 0,
35
+ enableBackdrop: true,
36
+ backdropAppearsOnIndex: 0,
37
+ backdropDisappearsOnIndex: -1,
38
+ enableHandleIndicator: true,
39
+ enablePanDownToClose: true,
40
+ },
41
+ large: {
42
+ snapPoints: ['75%'],
43
+ initialIndex: 0,
44
+ enableBackdrop: true,
45
+ backdropAppearsOnIndex: 0,
46
+ backdropDisappearsOnIndex: -1,
47
+ enableHandleIndicator: true,
48
+ enablePanDownToClose: true,
49
+ },
50
+ full: {
51
+ snapPoints: ['25%', '50%', '90%'],
52
+ initialIndex: 1,
53
+ enableBackdrop: true,
54
+ backdropAppearsOnIndex: 2,
55
+ backdropDisappearsOnIndex: 1,
56
+ enableHandleIndicator: true,
57
+ enablePanDownToClose: true,
58
+ },
59
+ };
60
+ /**
61
+ * Default bottom sheet configuration
62
+ */
63
+ export const DEFAULT_BOTTOM_SHEET_CONFIG = {
64
+ snapPoints: ['50%'],
65
+ initialIndex: 0,
66
+ enableBackdrop: true,
67
+ backdropAppearsOnIndex: 0,
68
+ backdropDisappearsOnIndex: -1,
69
+ keyboardBehavior: 'interactive',
70
+ enableHandleIndicator: true,
71
+ enablePanDownToClose: true,
72
+ enableDynamicSizing: false,
73
+ };
74
+ /**
75
+ * Bottom sheet utilities
76
+ */
77
+ export const BottomSheetUtils = {
78
+ /**
79
+ * Create custom bottom sheet config
80
+ */
81
+ createConfig: (overrides) => {
82
+ return {
83
+ ...DEFAULT_BOTTOM_SHEET_CONFIG,
84
+ ...overrides,
85
+ };
86
+ },
87
+ /**
88
+ * Get preset configuration
89
+ */
90
+ getPreset: (preset) => {
91
+ return BOTTOM_SHEET_PRESETS[preset];
92
+ },
93
+ /**
94
+ * Validate snap points
95
+ */
96
+ validateSnapPoints: (snapPoints) => {
97
+ if (snapPoints.length === 0)
98
+ return false;
99
+ return snapPoints.every(point => {
100
+ if (typeof point === 'number')
101
+ return point > 0;
102
+ if (typeof point === 'string') {
103
+ if (point === 'CONTENT_HEIGHT')
104
+ return true;
105
+ if (point.endsWith('%')) {
106
+ const value = parseInt(point);
107
+ return value > 0 && value <= 100;
108
+ }
109
+ }
110
+ return false;
111
+ });
112
+ },
113
+ /**
114
+ * Create backdrop config
115
+ */
116
+ createBackdropConfig: (appearsOnIndex = 0, disappearsOnIndex = -1, opacity = 0.5) => {
117
+ return {
118
+ appearsOnIndex,
119
+ disappearsOnIndex,
120
+ opacity,
121
+ pressBehavior: 'close',
122
+ };
123
+ },
124
+ };
125
+ //# sourceMappingURL=BottomSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["../../../src/domain/entities/BottomSheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAkFH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiD;IAChF,KAAK,EAAE;QACL,UAAU,EAAE,CAAC,KAAK,CAAC;QACnB,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,IAAI;QACpB,sBAAsB,EAAE,CAAC;QACzB,yBAAyB,EAAE,CAAC,CAAC;QAC7B,qBAAqB,EAAE,IAAI;QAC3B,oBAAoB,EAAE,IAAI;KAC3B;IACD,MAAM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AAE;QAC1D,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,kBAAkB,EAAE,CAAC,UAAuB,EAAW,EAAE;QACvD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAE1C,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,OAAO,KAAK,GAAG,CAAC,CAAC;YAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,IAAI,KAAK,KAAK,gBAAgB;oBAAE,OAAO,IAAI,CAAC;gBAC5C,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBACxB,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;oBAC9B,OAAO,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC;gBACnC,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,oBAAoB,EAAE,CACpB,iBAAyB,CAAC,EAC1B,oBAA4B,CAAC,CAAC,EAC9B,UAAkB,GAAG,EACL,EAAE;QAClB,OAAO;YACL,cAAc;YACd,iBAAiB;YACjB,OAAO;YACP,aAAa,EAAE,OAAO;SACvB,CAAC;IACJ,CAAC;CACF,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Bottom Sheet Domain - Barrel Export
3
+ *
4
+ * Public API for the bottom-sheet domain.
5
+ * Provides modern, performant bottom sheets for React Native.
6
+ *
7
+ * Features:
8
+ * - Preset configurations (small, medium, large, full)
9
+ * - Custom snap points (percentage, fixed, dynamic)
10
+ * - Backdrop with tap-to-close
11
+ * - Keyboard handling (interactive, fillParent, extend)
12
+ * - Theme-aware colors
13
+ * - Handle indicator
14
+ * - Pan down to close
15
+ * - Smooth animations with Reanimated v3
16
+ * - Offline-compatible (100% client-side)
17
+ *
18
+ * Usage:
19
+ * ```tsx
20
+ * import { BottomSheet, useBottomSheet } from '@umituz/react-native-bottom-sheet';
21
+ *
22
+ * const MyScreen = () => {
23
+ * const { sheetRef, open, close } = useBottomSheet();
24
+ *
25
+ * return (
26
+ * <>
27
+ * <Button onPress={open}>Open Sheet</Button>
28
+ * <BottomSheet
29
+ * ref={sheetRef}
30
+ * preset="medium"
31
+ * onClose={() => console.log('Closed')}
32
+ * >
33
+ * <View>
34
+ * <Text>Bottom Sheet Content</Text>
35
+ * </View>
36
+ * </BottomSheet>
37
+ * </>
38
+ * );
39
+ * };
40
+ *
41
+ * // Custom snap points
42
+ * <BottomSheet
43
+ * snapPoints={['25%', '50%', '90%']}
44
+ * initialIndex={1}
45
+ * enableBackdrop
46
+ * >
47
+ * <FilterForm />
48
+ * </BottomSheet>
49
+ *
50
+ * // Keyboard-aware sheet
51
+ * <BottomSheet
52
+ * preset="large"
53
+ * keyboardBehavior="fillParent"
54
+ * >
55
+ * <CommentForm />
56
+ * </BottomSheet>
57
+ * ```
58
+ *
59
+ * Presets:
60
+ * - small: 25% height
61
+ * - medium: 50% height
62
+ * - large: 75% height
63
+ * - full: Multi-snap (25%, 50%, 90%)
64
+ *
65
+ * Technical:
66
+ * - Uses @gorhom/bottom-sheet library
67
+ * - Animated with react-native-reanimated v3
68
+ * - Gesture handling with react-native-gesture-handler
69
+ * - Zero backend dependencies
70
+ */
71
+ export type { BottomSheetConfig, BottomSheetPreset, SnapPoint, KeyboardBehavior, BackdropConfig, } from './domain/entities/BottomSheet';
72
+ export { BOTTOM_SHEET_PRESETS, DEFAULT_BOTTOM_SHEET_CONFIG, BottomSheetUtils, } from './domain/entities/BottomSheet';
73
+ export { BottomSheet, type BottomSheetProps, type BottomSheetRef, } from './presentation/components/BottomSheet';
74
+ export { useBottomSheet, type UseBottomSheetReturn, } from './presentation/hooks/useBottomSheet';
75
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAGH,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,qCAAqC,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Bottom Sheet Domain - Barrel Export
3
+ *
4
+ * Public API for the bottom-sheet domain.
5
+ * Provides modern, performant bottom sheets for React Native.
6
+ *
7
+ * Features:
8
+ * - Preset configurations (small, medium, large, full)
9
+ * - Custom snap points (percentage, fixed, dynamic)
10
+ * - Backdrop with tap-to-close
11
+ * - Keyboard handling (interactive, fillParent, extend)
12
+ * - Theme-aware colors
13
+ * - Handle indicator
14
+ * - Pan down to close
15
+ * - Smooth animations with Reanimated v3
16
+ * - Offline-compatible (100% client-side)
17
+ *
18
+ * Usage:
19
+ * ```tsx
20
+ * import { BottomSheet, useBottomSheet } from '@umituz/react-native-bottom-sheet';
21
+ *
22
+ * const MyScreen = () => {
23
+ * const { sheetRef, open, close } = useBottomSheet();
24
+ *
25
+ * return (
26
+ * <>
27
+ * <Button onPress={open}>Open Sheet</Button>
28
+ * <BottomSheet
29
+ * ref={sheetRef}
30
+ * preset="medium"
31
+ * onClose={() => console.log('Closed')}
32
+ * >
33
+ * <View>
34
+ * <Text>Bottom Sheet Content</Text>
35
+ * </View>
36
+ * </BottomSheet>
37
+ * </>
38
+ * );
39
+ * };
40
+ *
41
+ * // Custom snap points
42
+ * <BottomSheet
43
+ * snapPoints={['25%', '50%', '90%']}
44
+ * initialIndex={1}
45
+ * enableBackdrop
46
+ * >
47
+ * <FilterForm />
48
+ * </BottomSheet>
49
+ *
50
+ * // Keyboard-aware sheet
51
+ * <BottomSheet
52
+ * preset="large"
53
+ * keyboardBehavior="fillParent"
54
+ * >
55
+ * <CommentForm />
56
+ * </BottomSheet>
57
+ * ```
58
+ *
59
+ * Presets:
60
+ * - small: 25% height
61
+ * - medium: 50% height
62
+ * - large: 75% height
63
+ * - full: Multi-snap (25%, 50%, 90%)
64
+ *
65
+ * Technical:
66
+ * - Uses @gorhom/bottom-sheet library
67
+ * - Animated with react-native-reanimated v3
68
+ * - Gesture handling with react-native-gesture-handler
69
+ * - Zero backend dependencies
70
+ */
71
+ export { BOTTOM_SHEET_PRESETS, DEFAULT_BOTTOM_SHEET_CONFIG, BottomSheetUtils, } from './domain/entities/BottomSheet';
72
+ // Presentation Components
73
+ export { BottomSheet, } from './presentation/components/BottomSheet';
74
+ // Presentation Hooks
75
+ export { useBottomSheet, } from './presentation/hooks/useBottomSheet';
76
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAWH,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAEvC,0BAA0B;AAC1B,OAAO,EACL,WAAW,GAGZ,MAAM,uCAAuC,CAAC;AAE/C,qBAAqB;AACrB,OAAO,EACL,cAAc,GAEf,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Bottom Sheet Component
3
+ *
4
+ * Main bottom sheet wrapper using @gorhom/bottom-sheet library.
5
+ * Provides a clean, theme-aware API for bottom sheets across the app.
6
+ *
7
+ * Features:
8
+ * - Snap point support (percentage, fixed, dynamic)
9
+ * - Backdrop with tap-to-close
10
+ * - Keyboard handling (interactive, fillParent, extend)
11
+ * - Theme-aware colors
12
+ * - Handle indicator
13
+ * - Pan down to close
14
+ * - Smooth animations with Reanimated v3
15
+ *
16
+ * Usage:
17
+ * ```tsx
18
+ * const sheetRef = useRef<BottomSheetRef>(null);
19
+ *
20
+ * <BottomSheet
21
+ * ref={sheetRef}
22
+ * preset="medium"
23
+ * onClose={() => console.log('Closed')}
24
+ * >
25
+ * <View>
26
+ * <Text>Bottom Sheet Content</Text>
27
+ * </View>
28
+ * </BottomSheet>
29
+ * ```
30
+ */
31
+ import React from 'react';
32
+ import type { BottomSheetPreset, SnapPoint, KeyboardBehavior } from '../../domain/entities/BottomSheet';
33
+ /**
34
+ * Bottom sheet ref methods
35
+ */
36
+ export interface BottomSheetRef {
37
+ snapToIndex: (index: number) => void;
38
+ snapToPosition: (position: string | number) => void;
39
+ expand: () => void;
40
+ collapse: () => void;
41
+ close: () => void;
42
+ }
43
+ /**
44
+ * Bottom sheet component props
45
+ */
46
+ export interface BottomSheetProps {
47
+ /**
48
+ * Bottom sheet content
49
+ */
50
+ children: React.ReactNode;
51
+ /**
52
+ * Preset configuration (small, medium, large, full)
53
+ */
54
+ preset?: BottomSheetPreset;
55
+ /**
56
+ * Custom snap points (overrides preset)
57
+ */
58
+ snapPoints?: SnapPoint[];
59
+ /**
60
+ * Initial snap point index
61
+ */
62
+ initialIndex?: number;
63
+ /**
64
+ * Enable backdrop
65
+ */
66
+ enableBackdrop?: boolean;
67
+ /**
68
+ * Backdrop appears at this snap index
69
+ */
70
+ backdropAppearsOnIndex?: number;
71
+ /**
72
+ * Backdrop disappears at this snap index
73
+ */
74
+ backdropDisappearsOnIndex?: number;
75
+ /**
76
+ * Keyboard behavior strategy
77
+ */
78
+ keyboardBehavior?: KeyboardBehavior;
79
+ /**
80
+ * Enable handle indicator
81
+ */
82
+ enableHandleIndicator?: boolean;
83
+ /**
84
+ * Enable pan down to close
85
+ */
86
+ enablePanDownToClose?: boolean;
87
+ /**
88
+ * Enable dynamic sizing
89
+ */
90
+ enableDynamicSizing?: boolean;
91
+ /**
92
+ * Callback when sheet changes position
93
+ */
94
+ onChange?: (index: number) => void;
95
+ /**
96
+ * Callback when sheet closes
97
+ */
98
+ onClose?: () => void;
99
+ }
100
+ /**
101
+ * Bottom Sheet Component
102
+ *
103
+ * Modern, performant bottom sheet for React Native.
104
+ * Uses @gorhom/bottom-sheet with Reanimated v3.
105
+ */
106
+ export declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetRef>>;
107
+ //# sourceMappingURL=BottomSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/presentation/components/BottomSheet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAQhE,OAAO,KAAK,EAEV,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACpD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;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