@draftbit/core 44.1.12-e30b54.2 → 44.1.13-2d7ff5.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/lib/commonjs/Provider.js.map +1 -1
- package/lib/commonjs/components/Accordion/AccordionItem.js +21 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +53 -49
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +59 -0
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -0
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +92 -0
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -0
- package/lib/commonjs/components/Picker/PickerComponent.web.js +59 -0
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -0
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/mappings/CircleImage.js.map +1 -1
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js +1 -1
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/mappings/SafeAreaView.js.map +1 -1
- package/lib/commonjs/mappings/TextArea.js.map +1 -1
- package/lib/module/components/Justification.js +1 -1
- package/lib/module/components/Picker/Picker.js +55 -49
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +41 -0
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -0
- package/lib/module/components/Picker/PickerComponent.ios.js +69 -0
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -0
- package/lib/module/components/Picker/PickerComponent.web.js +41 -0
- package/lib/module/components/Picker/PickerComponent.web.js.map +1 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/mappings/Banner.js.map +1 -1
- package/lib/module/mappings/KeyboardAwareScrollView.js +1 -1
- package/lib/module/mappings/KeyboardAwareScrollView.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerComponent.android.d.ts +13 -0
- package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +13 -0
- package/lib/typescript/src/components/Picker/PickerComponent.web.d.ts +13 -0
- package/package.json +3 -3
- package/src/components/Picker/Picker.js +40 -20
- package/src/components/Picker/Picker.tsx +56 -18
- package/src/components/Picker/PickerComponent.android.js +20 -0
- package/src/components/Picker/PickerComponent.android.tsx +59 -0
- package/src/components/Picker/PickerComponent.ios.js +43 -0
- package/src/components/Picker/PickerComponent.ios.tsx +89 -0
- package/src/components/Picker/PickerComponent.web.js +20 -0
- package/src/components/Picker/PickerComponent.web.tsx +59 -0
- package/src/mappings/KeyboardAwareScrollView.js +1 -1
- package/src/mappings/KeyboardAwareScrollView.ts +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, Dimensions } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
5
|
+
|
|
6
|
+
import type { IconSlot } from "../../interfaces/Icon";
|
|
7
|
+
|
|
8
|
+
import { PickerOption } from "./Picker";
|
|
9
|
+
|
|
10
|
+
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
11
|
+
|
|
12
|
+
interface PickerComponentProps {
|
|
13
|
+
Icon: IconSlot["Icon"];
|
|
14
|
+
androidPickerRef: React.RefObject<any>;
|
|
15
|
+
togglePickerVisible: () => void;
|
|
16
|
+
pickerOptions: PickerOption[];
|
|
17
|
+
internalValue: string | undefined;
|
|
18
|
+
handleValueChange: (newValue: string, itemIndex: number) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const PickerComponent: React.FC<PickerComponentProps> = ({
|
|
22
|
+
androidPickerRef,
|
|
23
|
+
togglePickerVisible,
|
|
24
|
+
pickerOptions,
|
|
25
|
+
internalValue,
|
|
26
|
+
handleValueChange,
|
|
27
|
+
}) => {
|
|
28
|
+
return (
|
|
29
|
+
<NativePicker
|
|
30
|
+
selectedValue={internalValue}
|
|
31
|
+
onValueChange={handleValueChange}
|
|
32
|
+
style={styles.nonIosPicker}
|
|
33
|
+
ref={androidPickerRef}
|
|
34
|
+
onBlur={togglePickerVisible}
|
|
35
|
+
>
|
|
36
|
+
{(pickerOptions as unknown as PickerOption[]).map((option) => (
|
|
37
|
+
<NativePicker.Item
|
|
38
|
+
label={option.label}
|
|
39
|
+
value={option.value}
|
|
40
|
+
key={option.value}
|
|
41
|
+
/>
|
|
42
|
+
))}
|
|
43
|
+
</NativePicker>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
nonIosPicker: {
|
|
49
|
+
opacity: 0,
|
|
50
|
+
position: "absolute",
|
|
51
|
+
top: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
right: 0,
|
|
54
|
+
bottom: 0,
|
|
55
|
+
width: "100%",
|
|
56
|
+
maxWidth: deviceWidth,
|
|
57
|
+
maxHeight: deviceHeight,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, StyleSheet, Dimensions } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
5
|
+
import Portal from "../Portal/Portal";
|
|
6
|
+
import Button from "../DeprecatedButton";
|
|
7
|
+
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
8
|
+
export const PickerComponent = ({ Icon, togglePickerVisible, pickerOptions, internalValue, handleValueChange, }) => {
|
|
9
|
+
return (React.createElement(Portal, null,
|
|
10
|
+
React.createElement(View, { style: styles.iosPicker },
|
|
11
|
+
React.createElement(SafeAreaView, { style: styles.iosSafeArea },
|
|
12
|
+
React.createElement(Button, { Icon: Icon, type: "text", onPress: togglePickerVisible, style: styles.iosButton }, "Close"),
|
|
13
|
+
React.createElement(NativePicker, { style: styles.iosNativePicker, selectedValue: internalValue, onValueChange: handleValueChange }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value }))))))));
|
|
14
|
+
};
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
iosPicker: {
|
|
17
|
+
position: "absolute",
|
|
18
|
+
bottom: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
right: 0,
|
|
21
|
+
flexDirection: "row",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
width: deviceWidth,
|
|
24
|
+
maxWidth: deviceWidth,
|
|
25
|
+
maxHeight: deviceHeight,
|
|
26
|
+
backgroundColor: "green", // TODO
|
|
27
|
+
// backgroundColor: "rgba(255, 255, 255, 1)",
|
|
28
|
+
},
|
|
29
|
+
iosSafeArea: {
|
|
30
|
+
backgroundColor: "yellow",
|
|
31
|
+
// backgroundColor: "white",// TODO
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
width: deviceWidth,
|
|
34
|
+
maxWidth: deviceWidth,
|
|
35
|
+
},
|
|
36
|
+
iosButton: {
|
|
37
|
+
alignSelf: "flex-end",
|
|
38
|
+
},
|
|
39
|
+
iosNativePicker: {
|
|
40
|
+
//backgroundColor: "white",// TODO
|
|
41
|
+
backgroundColor: "red",
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, StyleSheet, Dimensions } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
5
|
+
|
|
6
|
+
import type { IconSlot } from "../../interfaces/Icon";
|
|
7
|
+
import Portal from "../Portal/Portal";
|
|
8
|
+
import Button from "../DeprecatedButton";
|
|
9
|
+
import { PickerOption } from "./Picker";
|
|
10
|
+
|
|
11
|
+
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
12
|
+
|
|
13
|
+
interface PickerComponentProps {
|
|
14
|
+
Icon: IconSlot["Icon"];
|
|
15
|
+
androidPickerRef: React.RefObject<any>;
|
|
16
|
+
togglePickerVisible: () => void;
|
|
17
|
+
pickerOptions: PickerOption[];
|
|
18
|
+
internalValue: string | undefined;
|
|
19
|
+
handleValueChange: (newValue: string, itemIndex: number) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const PickerComponent: React.FC<PickerComponentProps> = ({
|
|
23
|
+
Icon,
|
|
24
|
+
togglePickerVisible,
|
|
25
|
+
pickerOptions,
|
|
26
|
+
internalValue,
|
|
27
|
+
handleValueChange,
|
|
28
|
+
}) => {
|
|
29
|
+
return (
|
|
30
|
+
<Portal>
|
|
31
|
+
<View style={styles.iosPicker}>
|
|
32
|
+
<SafeAreaView style={styles.iosSafeArea}>
|
|
33
|
+
<Button
|
|
34
|
+
Icon={Icon}
|
|
35
|
+
type="text"
|
|
36
|
+
onPress={togglePickerVisible}
|
|
37
|
+
style={styles.iosButton}
|
|
38
|
+
>
|
|
39
|
+
{"Close"}
|
|
40
|
+
</Button>
|
|
41
|
+
|
|
42
|
+
<NativePicker
|
|
43
|
+
style={styles.iosNativePicker}
|
|
44
|
+
selectedValue={internalValue}
|
|
45
|
+
onValueChange={handleValueChange}
|
|
46
|
+
>
|
|
47
|
+
{(pickerOptions as unknown as PickerOption[]).map((option) => (
|
|
48
|
+
<NativePicker.Item
|
|
49
|
+
label={option.label}
|
|
50
|
+
value={option.value}
|
|
51
|
+
key={option.value}
|
|
52
|
+
/>
|
|
53
|
+
))}
|
|
54
|
+
</NativePicker>
|
|
55
|
+
</SafeAreaView>
|
|
56
|
+
</View>
|
|
57
|
+
</Portal>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const styles = StyleSheet.create({
|
|
62
|
+
iosPicker: {
|
|
63
|
+
position: "absolute",
|
|
64
|
+
bottom: 0,
|
|
65
|
+
left: 0,
|
|
66
|
+
right: 0,
|
|
67
|
+
flexDirection: "row",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
width: deviceWidth, // TODO
|
|
70
|
+
maxWidth: deviceWidth,
|
|
71
|
+
maxHeight: deviceHeight,
|
|
72
|
+
backgroundColor: "green", // TODO
|
|
73
|
+
// backgroundColor: "rgba(255, 255, 255, 1)",
|
|
74
|
+
},
|
|
75
|
+
iosSafeArea: {
|
|
76
|
+
backgroundColor: "yellow",
|
|
77
|
+
// backgroundColor: "white",// TODO
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
width: deviceWidth,
|
|
80
|
+
maxWidth: deviceWidth,
|
|
81
|
+
},
|
|
82
|
+
iosButton: {
|
|
83
|
+
alignSelf: "flex-end",
|
|
84
|
+
},
|
|
85
|
+
iosNativePicker: {
|
|
86
|
+
//backgroundColor: "white",// TODO
|
|
87
|
+
backgroundColor: "red",
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, Dimensions } from "react-native";
|
|
3
|
+
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
4
|
+
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
5
|
+
export const PickerComponent = ({ androidPickerRef, togglePickerVisible, pickerOptions, internalValue, handleValueChange, }) => {
|
|
6
|
+
return (React.createElement(NativePicker, { selectedValue: internalValue, onValueChange: handleValueChange, style: styles.nonIosPicker, ref: androidPickerRef, onBlur: togglePickerVisible }, pickerOptions.map((option) => (React.createElement(NativePicker.Item, { label: option.label, value: option.value, key: option.value })))));
|
|
7
|
+
};
|
|
8
|
+
const styles = StyleSheet.create({
|
|
9
|
+
nonIosPicker: {
|
|
10
|
+
opacity: 0,
|
|
11
|
+
position: "absolute",
|
|
12
|
+
top: 0,
|
|
13
|
+
left: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
bottom: 0,
|
|
16
|
+
width: "100%",
|
|
17
|
+
maxWidth: deviceWidth,
|
|
18
|
+
maxHeight: deviceHeight,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, Dimensions } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
5
|
+
|
|
6
|
+
import type { IconSlot } from "../../interfaces/Icon";
|
|
7
|
+
|
|
8
|
+
import { PickerOption } from "./Picker";
|
|
9
|
+
|
|
10
|
+
const { width: deviceWidth, height: deviceHeight } = Dimensions.get("screen");
|
|
11
|
+
|
|
12
|
+
interface PickerComponentProps {
|
|
13
|
+
Icon: IconSlot["Icon"];
|
|
14
|
+
androidPickerRef: React.RefObject<any>;
|
|
15
|
+
togglePickerVisible: () => void;
|
|
16
|
+
pickerOptions: PickerOption[];
|
|
17
|
+
internalValue: string | undefined;
|
|
18
|
+
handleValueChange: (newValue: string, itemIndex: number) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const PickerComponent: React.FC<PickerComponentProps> = ({
|
|
22
|
+
androidPickerRef,
|
|
23
|
+
togglePickerVisible,
|
|
24
|
+
pickerOptions,
|
|
25
|
+
internalValue,
|
|
26
|
+
handleValueChange,
|
|
27
|
+
}) => {
|
|
28
|
+
return (
|
|
29
|
+
<NativePicker
|
|
30
|
+
selectedValue={internalValue}
|
|
31
|
+
onValueChange={handleValueChange}
|
|
32
|
+
style={styles.nonIosPicker}
|
|
33
|
+
ref={androidPickerRef}
|
|
34
|
+
onBlur={togglePickerVisible}
|
|
35
|
+
>
|
|
36
|
+
{(pickerOptions as unknown as PickerOption[]).map((option) => (
|
|
37
|
+
<NativePicker.Item
|
|
38
|
+
label={option.label}
|
|
39
|
+
value={option.value}
|
|
40
|
+
key={option.value}
|
|
41
|
+
/>
|
|
42
|
+
))}
|
|
43
|
+
</NativePicker>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
nonIosPicker: {
|
|
49
|
+
opacity: 0,
|
|
50
|
+
position: "absolute",
|
|
51
|
+
top: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
right: 0,
|
|
54
|
+
bottom: 0,
|
|
55
|
+
width: "100%",
|
|
56
|
+
maxWidth: deviceWidth,
|
|
57
|
+
maxHeight: deviceHeight,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
@@ -40,7 +40,7 @@ export const SEED_DATA = {
|
|
|
40
40
|
defaultValue: true,
|
|
41
41
|
}),
|
|
42
42
|
keyboardShouldPersistTaps: createTextEnumProp({
|
|
43
|
-
label: "Allow Touch Events
|
|
43
|
+
label: "Allow Touch Events",
|
|
44
44
|
description: "Allows touch events on visible components to be processed while the keyboard is open",
|
|
45
45
|
defaultValue: "never",
|
|
46
46
|
options: ["never", "always"],
|
|
@@ -51,7 +51,7 @@ export const SEED_DATA = {
|
|
|
51
51
|
defaultValue: true,
|
|
52
52
|
}),
|
|
53
53
|
keyboardShouldPersistTaps: createTextEnumProp({
|
|
54
|
-
label: "Allow Touch Events
|
|
54
|
+
label: "Allow Touch Events",
|
|
55
55
|
description:
|
|
56
56
|
"Allows touch events on visible components to be processed while the keyboard is open",
|
|
57
57
|
defaultValue: "never",
|