@draftbit/core 46.11.1-a58bd6.2 → 46.11.1-c64d65.2
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/lib/commonjs/components/Checkbox/CheckboxGroup.js +3 -16
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -22
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js +57 -18
- package/lib/commonjs/components/TabView/TabView.js +14 -7
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/NativeBase/Layout.js +1 -1
- package/lib/commonjs/mappings/NativeBase/Layout.js.map +1 -1
- package/lib/commonjs/mappings/Table.js +3 -3
- package/lib/commonjs/mappings/Table.js.map +1 -1
- package/lib/module/components/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/module/components/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/module/components/Banner.js +23 -4
- package/lib/module/components/Banner.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.tsx.tmp +120 -0
- package/lib/module/components/BottomSheet/BottomSheetComponent.tsx.tmp +895 -0
- package/lib/module/components/Card.js.map +1 -1
- package/lib/module/components/CircleImage.js +15 -1
- package/lib/module/components/CircleImage.js.map +1 -1
- package/lib/module/components/Container.js +16 -4
- package/lib/module/components/Container.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +9 -13
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/module/components/DeckSwiper/index.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +21 -3
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Portal/PortalHost.js +44 -14
- package/lib/module/components/Portal/PortalHost.js.map +1 -1
- package/lib/module/components/ProgressCircle.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +23 -5
- package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/module/components/RadioButton/index.js.map +1 -1
- package/lib/module/components/Row.js.map +1 -1
- package/lib/module/components/RowBodyIcon.js.map +1 -1
- package/lib/module/components/Swiper/SwiperItem.js.map +1 -1
- package/lib/module/components/Touchable.web.js.map +1 -1
- package/lib/module/components/YoutubePlayer/YoutubePlayerProps.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mappings/AccordionItem.js.map +1 -1
- package/lib/module/mappings/AudioPlayer.js.map +1 -1
- package/lib/module/mappings/CardInline.js.map +1 -1
- package/lib/module/mappings/DeckSwiper.js.map +1 -1
- package/lib/module/mappings/Divider.js.map +1 -1
- package/lib/module/mappings/FlashList.js.map +1 -1
- package/lib/module/mappings/NativeBase/Layout.js +1 -1
- package/lib/module/mappings/NativeBase/Layout.js.map +1 -1
- package/lib/module/mappings/ProgressIndicator.js.map +1 -1
- package/lib/module/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/module/mappings/Table.js +3 -3
- package/lib/module/mappings/Table.js.map +1 -1
- package/lib/module/styles/shadow.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +3 -5
- package/src/components/BottomSheet/BottomSheet.tsx.tmp +120 -0
- package/src/components/BottomSheet/BottomSheetComponent.tsx.tmp +895 -0
- package/{lib/module/components/BottomSheet/index.js → src/components/BottomSheet/index.ts.tmp} +0 -1
- package/src/index.js +0 -1
- package/src/index.tsx +0 -2
- package/src/mappings/NativeBase/Layout.js +1 -1
- package/src/mappings/NativeBase/Layout.ts +1 -1
- package/src/mappings/Table.js +3 -3
- package/src/mappings/Table.ts +3 -3
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +0 -89
- package/lib/commonjs/components/BottomSheet/BottomSheet.js.map +0 -1
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +0 -424
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +0 -1
- package/lib/commonjs/components/BottomSheet/index.js +0 -14
- package/lib/commonjs/components/BottomSheet/index.js.map +0 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +0 -81
- package/lib/module/components/BottomSheet/BottomSheet.js.map +0 -1
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -430
- package/lib/module/components/BottomSheet/BottomSheetComponent.js.map +0 -1
- package/lib/module/components/BottomSheet/index.js.map +0 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +0 -20
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +0 -170
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +0 -1
- package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -2
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +0 -1
- package/src/components/BottomSheet/BottomSheet.js +0 -56
- package/src/components/BottomSheet/BottomSheetComponent.js +0 -437
- /package/{src/components/BottomSheet/BottomSheet.tsx → lib/commonjs/components/BottomSheet/BottomSheet.tsx.tmp} +0 -0
- /package/{src/components/BottomSheet/BottomSheetComponent.tsx → lib/commonjs/components/BottomSheet/BottomSheetComponent.tsx.tmp} +0 -0
- /package/{src/components/BottomSheet/index.js → lib/commonjs/components/BottomSheet/index.ts.tmp} +0 -0
- /package/{src/components/BottomSheet/index.ts → lib/module/components/BottomSheet/index.ts.tmp} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
View,
|
|
5
|
+
StyleProp,
|
|
6
|
+
ViewStyle,
|
|
7
|
+
ScrollViewProps,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
|
|
10
|
+
import BottomSheetComponent from "./BottomSheetComponent";
|
|
11
|
+
import type { Theme } from "../../styles/DefaultTheme";
|
|
12
|
+
import { withTheme } from "../../theming";
|
|
13
|
+
|
|
14
|
+
export interface BottomSheetProps extends ScrollViewProps {
|
|
15
|
+
snapPoints?: (string | number)[];
|
|
16
|
+
initialSnapIndex?: number;
|
|
17
|
+
showHandle?: boolean;
|
|
18
|
+
handleColor?: string;
|
|
19
|
+
topBorderRadius?: number;
|
|
20
|
+
borderWidth?: number;
|
|
21
|
+
borderColor?: string;
|
|
22
|
+
onSettle?: (index: number) => void;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
theme: Theme;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const BottomSheet: React.FC<React.PropsWithChildren<BottomSheetProps>> = ({
|
|
28
|
+
theme,
|
|
29
|
+
snapPoints = ["10%", "50%", "80%"],
|
|
30
|
+
initialSnapIndex = 0,
|
|
31
|
+
showHandle = true,
|
|
32
|
+
handleColor = theme.colors.divider,
|
|
33
|
+
topBorderRadius = 20,
|
|
34
|
+
borderWidth = 1,
|
|
35
|
+
borderColor = theme.colors.divider,
|
|
36
|
+
onSettle,
|
|
37
|
+
style,
|
|
38
|
+
children,
|
|
39
|
+
...rest
|
|
40
|
+
}) => {
|
|
41
|
+
const backgroundColor =
|
|
42
|
+
(style as ViewStyle)?.backgroundColor || theme.colors.background;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View style={styles.parentContainer} pointerEvents="box-none">
|
|
46
|
+
<BottomSheetComponent
|
|
47
|
+
componentType="ScrollView"
|
|
48
|
+
snapPoints={snapPoints}
|
|
49
|
+
initialSnapIndex={initialSnapIndex}
|
|
50
|
+
renderHandle={() => (
|
|
51
|
+
<>
|
|
52
|
+
{showHandle && (
|
|
53
|
+
<View
|
|
54
|
+
style={[
|
|
55
|
+
styles.handleContainer,
|
|
56
|
+
{
|
|
57
|
+
backgroundColor,
|
|
58
|
+
borderTopLeftRadius: topBorderRadius,
|
|
59
|
+
borderTopRightRadius: topBorderRadius,
|
|
60
|
+
},
|
|
61
|
+
]}
|
|
62
|
+
>
|
|
63
|
+
<View
|
|
64
|
+
style={[styles.handle, { backgroundColor: handleColor }]}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
)}
|
|
68
|
+
</>
|
|
69
|
+
)}
|
|
70
|
+
contentContainerStyle={[styles.contentContainerStyle, style]}
|
|
71
|
+
containerStyle={StyleSheet.flatten([
|
|
72
|
+
styles.containerStyle,
|
|
73
|
+
{
|
|
74
|
+
backgroundColor,
|
|
75
|
+
borderTopLeftRadius: topBorderRadius,
|
|
76
|
+
borderTopRightRadius: topBorderRadius,
|
|
77
|
+
borderWidth,
|
|
78
|
+
borderColor,
|
|
79
|
+
},
|
|
80
|
+
])}
|
|
81
|
+
onSettle={onSettle}
|
|
82
|
+
{...rest}
|
|
83
|
+
>
|
|
84
|
+
{children}
|
|
85
|
+
</BottomSheetComponent>
|
|
86
|
+
</View>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const styles = StyleSheet.create({
|
|
91
|
+
//Render on top of everything
|
|
92
|
+
parentContainer: {
|
|
93
|
+
position: "absolute",
|
|
94
|
+
left: 0,
|
|
95
|
+
right: 0,
|
|
96
|
+
top: 0,
|
|
97
|
+
bottom: 0,
|
|
98
|
+
zIndex: 10,
|
|
99
|
+
overflow: "hidden",
|
|
100
|
+
},
|
|
101
|
+
contentContainerStyle: {
|
|
102
|
+
paddingHorizontal: 16,
|
|
103
|
+
paddingVertical: 10,
|
|
104
|
+
},
|
|
105
|
+
containerStyle: {
|
|
106
|
+
flex: 1,
|
|
107
|
+
overflow: "hidden",
|
|
108
|
+
},
|
|
109
|
+
handleContainer: {
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
paddingVertical: 20,
|
|
112
|
+
},
|
|
113
|
+
handle: {
|
|
114
|
+
width: 40,
|
|
115
|
+
height: 2,
|
|
116
|
+
borderRadius: 4,
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export default withTheme(BottomSheet);
|