@draftbit/core 43.3.4-f04c6f.2 → 43.4.2-9ce900.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/AccordionGroup.js +14 -28
- package/lib/commonjs/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js +4 -20
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Divider.js +3 -13
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +14 -3
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +25 -7
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +30 -10
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/commonjs/components/Stepper.js +9 -2
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +23 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mappings/{AccordionGroup.js → Accordion.js} +9 -2
- package/lib/commonjs/mappings/Accordion.js.map +1 -0
- package/lib/commonjs/mappings/AccordionItem.js +1 -1
- package/lib/commonjs/mappings/AccordionItem.js.map +1 -1
- package/lib/commonjs/mappings/CustomCode.js.map +1 -1
- package/lib/commonjs/mappings/FAB.js.map +1 -1
- package/lib/commonjs/mappings/Fetch.js.map +1 -1
- package/lib/commonjs/mappings/HeaderLarge.js.map +1 -1
- package/lib/commonjs/mappings/LinearGradient.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.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/Stepper.js +1 -2
- package/lib/commonjs/mappings/Stepper.js.map +1 -1
- package/lib/commonjs/mappings/Swiper.js +14 -0
- package/lib/commonjs/mappings/Swiper.js.map +1 -1
- package/lib/commonjs/mappings/TextArea.js +1 -3
- package/lib/commonjs/mappings/TextArea.js.map +1 -1
- package/lib/commonjs/mappings/ToggleButton.js.map +1 -1
- package/lib/commonjs/styles/overlay.js.map +1 -1
- package/lib/module/components/Accordion/AccordionGroup.js +13 -28
- package/lib/module/components/Accordion/AccordionGroup.js.map +1 -1
- package/lib/module/components/FAB.js +6 -2
- package/lib/module/components/FAB.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +10 -29
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -5
- package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/module/components/Stepper.js +9 -2
- package/lib/module/components/Stepper.js.map +1 -1
- package/lib/module/components/Swiper/Swiper.js +23 -1
- package/lib/module/components/Swiper/Swiper.js.map +1 -1
- package/lib/module/mappings/{AccordionGroup.js → Accordion.js} +9 -2
- package/lib/module/mappings/Accordion.js.map +1 -0
- package/lib/module/mappings/AccordionItem.js +1 -1
- package/lib/module/mappings/AccordionItem.js.map +1 -1
- package/lib/module/mappings/CheckboxGroup.js.map +1 -1
- package/lib/module/mappings/Container.js.map +1 -1
- package/lib/module/mappings/Stepper.js +1 -2
- package/lib/module/mappings/Stepper.js.map +1 -1
- package/lib/module/mappings/Swiper.js +15 -1
- package/lib/module/mappings/Swiper.js.map +1 -1
- package/lib/module/mappings/TextArea.js +1 -3
- package/lib/module/mappings/TextArea.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +5 -1
- package/lib/typescript/src/mappings/{AccordionGroup.d.ts → Accordion.d.ts} +7 -0
- package/lib/typescript/src/mappings/Swiper.d.ts +40 -0
- package/lib/typescript/src/mappings/TextArea.d.ts +0 -2
- package/package.json +3 -3
- package/src/components/Accordion/AccordionGroup.js +17 -37
- package/src/components/Accordion/AccordionGroup.tsx +36 -60
- package/src/components/FAB.js +1 -1
- package/src/components/FAB.tsx +6 -2
- package/src/components/Stepper.js +2 -2
- package/src/components/Stepper.tsx +4 -1
- package/src/components/Swiper/Swiper.js +9 -1
- package/src/components/Swiper/Swiper.tsx +16 -0
- package/src/mappings/{AccordionGroup.js → Accordion.js} +8 -1
- package/src/mappings/{AccordionGroup.ts → Accordion.ts} +8 -1
- package/src/mappings/AccordionItem.js +1 -1
- package/src/mappings/AccordionItem.ts +1 -1
- package/src/mappings/Stepper.js +0 -1
- package/src/mappings/Stepper.ts +0 -1
- package/src/mappings/Swiper.js +15 -1
- package/src/mappings/Swiper.ts +15 -0
- package/src/mappings/TextArea.js +0 -2
- package/src/mappings/TextArea.ts +0 -2
- package/lib/commonjs/mappings/AccordionGroup.js.map +0 -1
- package/lib/commonjs/mappings/DeprecatedButton.js +0 -111
- package/lib/commonjs/mappings/DeprecatedButton.js.map +0 -1
- package/lib/commonjs/mappings/DeprecatedFAB.js +0 -147
- package/lib/commonjs/mappings/DeprecatedFAB.js.map +0 -1
- package/lib/module/mappings/AccordionGroup.js.map +0 -1
- package/lib/module/mappings/DeprecatedButton.js +0 -102
- package/lib/module/mappings/DeprecatedButton.js.map +0 -1
- package/lib/module/mappings/DeprecatedFAB.js +0 -138
- package/lib/module/mappings/DeprecatedFAB.js.map +0 -1
- package/lib/typescript/src/mappings/DeprecatedButton.d.ts +0 -89
- package/lib/typescript/src/mappings/DeprecatedFAB.d.ts +0 -178
- package/src/mappings/DeprecatedButton.js +0 -106
- package/src/mappings/DeprecatedButton.ts +0 -115
- package/src/mappings/DeprecatedFAB.js +0 -146
- package/src/mappings/DeprecatedFAB.ts +0 -153
|
@@ -7,9 +7,13 @@ export interface SwiperProps {
|
|
|
7
7
|
timeout?: number;
|
|
8
8
|
prevTitle?: string;
|
|
9
9
|
nextTitle?: string;
|
|
10
|
+
prevTitleColor?: string;
|
|
11
|
+
nextTitleColor?: string;
|
|
10
12
|
dotsTouchable?: boolean;
|
|
13
|
+
dotColor?: string;
|
|
14
|
+
dotActiveColor?: string;
|
|
11
15
|
children: React.ReactNode;
|
|
12
16
|
style?: StyleProp<ViewStyle>;
|
|
13
17
|
}
|
|
14
|
-
declare const Swiper: ({ vertical, loop, timeout, from, prevTitle, nextTitle, dotsTouchable, children, style, }: SwiperProps) => JSX.Element;
|
|
18
|
+
declare const Swiper: ({ vertical, loop, timeout, from, prevTitle, nextTitle, prevTitleColor, nextTitleColor, dotsTouchable, dotColor, dotActiveColor, children, style, }: SwiperProps) => JSX.Element;
|
|
15
19
|
export default Swiper;
|
|
@@ -3,6 +3,13 @@ export declare const SEED_DATA: {
|
|
|
3
3
|
tag: string;
|
|
4
4
|
description: string;
|
|
5
5
|
category: string;
|
|
6
|
+
layout: {
|
|
7
|
+
paddingTop: number;
|
|
8
|
+
paddingRight: number;
|
|
9
|
+
paddingBottom: number;
|
|
10
|
+
paddingLeft: number;
|
|
11
|
+
fontSize: number;
|
|
12
|
+
};
|
|
6
13
|
props: {
|
|
7
14
|
openColor: {
|
|
8
15
|
group: string;
|
|
@@ -52,6 +52,46 @@ export declare const SEED_DATA: {
|
|
|
52
52
|
};
|
|
53
53
|
prevTitle: any;
|
|
54
54
|
nextTitle: any;
|
|
55
|
+
prevTitleColor: {
|
|
56
|
+
group: string;
|
|
57
|
+
label: string;
|
|
58
|
+
description: string;
|
|
59
|
+
editable: boolean;
|
|
60
|
+
required: boolean;
|
|
61
|
+
defaultValue: null;
|
|
62
|
+
formType: string;
|
|
63
|
+
propType: string;
|
|
64
|
+
};
|
|
65
|
+
nextTitleColor: {
|
|
66
|
+
group: string;
|
|
67
|
+
label: string;
|
|
68
|
+
description: string;
|
|
69
|
+
editable: boolean;
|
|
70
|
+
required: boolean;
|
|
71
|
+
defaultValue: null;
|
|
72
|
+
formType: string;
|
|
73
|
+
propType: string;
|
|
74
|
+
};
|
|
75
|
+
dotColor: {
|
|
76
|
+
group: string;
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
editable: boolean;
|
|
80
|
+
required: boolean;
|
|
81
|
+
defaultValue: null;
|
|
82
|
+
formType: string;
|
|
83
|
+
propType: string;
|
|
84
|
+
};
|
|
85
|
+
dotActiveColor: {
|
|
86
|
+
group: string;
|
|
87
|
+
label: string;
|
|
88
|
+
description: string;
|
|
89
|
+
editable: boolean;
|
|
90
|
+
required: boolean;
|
|
91
|
+
defaultValue: null;
|
|
92
|
+
formType: string;
|
|
93
|
+
propType: string;
|
|
94
|
+
};
|
|
55
95
|
dotsTouchable: {
|
|
56
96
|
label: string;
|
|
57
97
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.4.2-9ce900.0+9ce900f8",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^43.
|
|
44
|
+
"@draftbit/types": "^43.4.0",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.1.7",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
]
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "9ce900f8e33129c22987973847755c82ca77b67e"
|
|
83
83
|
}
|
|
@@ -2,63 +2,43 @@ import * as React from "react";
|
|
|
2
2
|
import { View, StyleSheet, Pressable, } from "react-native";
|
|
3
3
|
import Text from "../Text";
|
|
4
4
|
import { withTheme } from "../../theming";
|
|
5
|
+
import { extractStyles } from "../../utilities";
|
|
5
6
|
const AccordionGroup = ({ Icon, openColor, closedColor, caretColor, icon, iconSize = 24, style, label, children, expanded: expandedProp, theme, }) => {
|
|
6
7
|
const [expanded, setExpanded] = React.useState(expandedProp || false);
|
|
7
8
|
const handlePressAction = () => {
|
|
8
|
-
|
|
9
|
-
setExpanded(!expanded);
|
|
10
|
-
}
|
|
9
|
+
setExpanded(!expanded);
|
|
11
10
|
};
|
|
12
11
|
const expandedInternal = expandedProp !== undefined ? expandedProp : expanded;
|
|
13
12
|
const expandedColor = openColor || theme.colors.primary;
|
|
14
13
|
const collapsedColor = closedColor || theme.colors.primary;
|
|
15
14
|
const labelColor = expanded ? expandedColor : collapsedColor;
|
|
15
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
16
16
|
return (React.createElement(React.Fragment, null,
|
|
17
|
-
React.createElement(Pressable, { style: [
|
|
18
|
-
React.createElement(
|
|
19
|
-
|
|
20
|
-
React.createElement(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
? "MaterialIcons/keyboard-arrow-up"
|
|
31
|
-
: "MaterialIcons/keyboard-arrow-down", color: caretColor, size: 24 })))),
|
|
32
|
-
expandedInternal
|
|
33
|
-
? React.Children.map(children, (child) => {
|
|
34
|
-
if (React.isValidElement(child) &&
|
|
35
|
-
!child.props.left &&
|
|
36
|
-
!child.props.right) {
|
|
37
|
-
return React.cloneElement(child, {
|
|
38
|
-
style: child.props.style,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return child;
|
|
42
|
-
})
|
|
43
|
-
: null));
|
|
17
|
+
React.createElement(Pressable, { style: [styles.row, viewStyles], onPress: handlePressAction, accessibilityRole: "button" },
|
|
18
|
+
icon ? (React.createElement(Icon, { name: icon, size: iconSize, color: labelColor, style: styles.icon })) : null,
|
|
19
|
+
React.createElement(View, { style: styles.content },
|
|
20
|
+
React.createElement(Text, { selectable: false, style: [
|
|
21
|
+
{
|
|
22
|
+
color: labelColor,
|
|
23
|
+
},
|
|
24
|
+
textStyles,
|
|
25
|
+
] }, label)),
|
|
26
|
+
React.createElement(Icon, { name: expanded
|
|
27
|
+
? "MaterialIcons/keyboard-arrow-up"
|
|
28
|
+
: "MaterialIcons/keyboard-arrow-down", color: caretColor, size: 24 })),
|
|
29
|
+
expandedInternal ? children : null));
|
|
44
30
|
};
|
|
45
31
|
const styles = StyleSheet.create({
|
|
46
32
|
row: {
|
|
47
33
|
flexDirection: "row",
|
|
48
34
|
alignItems: "center",
|
|
49
35
|
},
|
|
50
|
-
label: {
|
|
51
|
-
fontSize: 16,
|
|
52
|
-
},
|
|
53
|
-
item: {
|
|
54
|
-
margin: 8,
|
|
55
|
-
},
|
|
56
36
|
content: {
|
|
57
37
|
flex: 1,
|
|
58
38
|
justifyContent: "center",
|
|
59
39
|
},
|
|
60
40
|
icon: {
|
|
61
|
-
|
|
41
|
+
marginRight: 8,
|
|
62
42
|
},
|
|
63
43
|
});
|
|
64
44
|
export default withTheme(AccordionGroup);
|
|
@@ -10,6 +10,7 @@ import Text from "../Text";
|
|
|
10
10
|
import { withTheme } from "../../theming";
|
|
11
11
|
import type { IconSlot } from "../../interfaces/Icon";
|
|
12
12
|
import type { Theme } from "../../styles/DefaultTheme";
|
|
13
|
+
import { extractStyles } from "../../utilities";
|
|
13
14
|
|
|
14
15
|
type Props = {
|
|
15
16
|
openColor: string;
|
|
@@ -42,9 +43,7 @@ const AccordionGroup = ({
|
|
|
42
43
|
);
|
|
43
44
|
|
|
44
45
|
const handlePressAction = () => {
|
|
45
|
-
|
|
46
|
-
setExpanded(!expanded);
|
|
47
|
-
}
|
|
46
|
+
setExpanded(!expanded);
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
const expandedInternal = expandedProp !== undefined ? expandedProp : expanded;
|
|
@@ -54,64 +53,47 @@ const AccordionGroup = ({
|
|
|
54
53
|
|
|
55
54
|
const labelColor = expanded ? expandedColor : collapsedColor;
|
|
56
55
|
|
|
56
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
57
|
+
|
|
57
58
|
return (
|
|
58
59
|
<>
|
|
59
60
|
<Pressable
|
|
60
|
-
style={[
|
|
61
|
+
style={[styles.row, viewStyles]}
|
|
61
62
|
onPress={handlePressAction}
|
|
62
63
|
accessibilityRole="button"
|
|
63
64
|
>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{label}
|
|
85
|
-
</Text>
|
|
86
|
-
</View>
|
|
87
|
-
<View style={[styles.item]}>
|
|
88
|
-
<Icon
|
|
89
|
-
name={
|
|
90
|
-
expanded
|
|
91
|
-
? "MaterialIcons/keyboard-arrow-up"
|
|
92
|
-
: "MaterialIcons/keyboard-arrow-down"
|
|
93
|
-
}
|
|
94
|
-
color={caretColor}
|
|
95
|
-
size={24}
|
|
96
|
-
/>
|
|
97
|
-
</View>
|
|
65
|
+
{icon ? (
|
|
66
|
+
<Icon
|
|
67
|
+
name={icon}
|
|
68
|
+
size={iconSize}
|
|
69
|
+
color={labelColor}
|
|
70
|
+
style={styles.icon}
|
|
71
|
+
/>
|
|
72
|
+
) : null}
|
|
73
|
+
<View style={styles.content}>
|
|
74
|
+
<Text
|
|
75
|
+
selectable={false}
|
|
76
|
+
style={[
|
|
77
|
+
{
|
|
78
|
+
color: labelColor,
|
|
79
|
+
},
|
|
80
|
+
textStyles,
|
|
81
|
+
]}
|
|
82
|
+
>
|
|
83
|
+
{label}
|
|
84
|
+
</Text>
|
|
98
85
|
</View>
|
|
86
|
+
<Icon
|
|
87
|
+
name={
|
|
88
|
+
expanded
|
|
89
|
+
? "MaterialIcons/keyboard-arrow-up"
|
|
90
|
+
: "MaterialIcons/keyboard-arrow-down"
|
|
91
|
+
}
|
|
92
|
+
color={caretColor}
|
|
93
|
+
size={24}
|
|
94
|
+
/>
|
|
99
95
|
</Pressable>
|
|
100
|
-
{expandedInternal
|
|
101
|
-
? React.Children.map(children, (child) => {
|
|
102
|
-
if (
|
|
103
|
-
React.isValidElement(child) &&
|
|
104
|
-
!child.props.left &&
|
|
105
|
-
!child.props.right
|
|
106
|
-
) {
|
|
107
|
-
return React.cloneElement(child, {
|
|
108
|
-
style: child.props.style,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return child;
|
|
113
|
-
})
|
|
114
|
-
: null}
|
|
96
|
+
{expandedInternal ? children : null}
|
|
115
97
|
</>
|
|
116
98
|
);
|
|
117
99
|
};
|
|
@@ -121,18 +103,12 @@ const styles = StyleSheet.create({
|
|
|
121
103
|
flexDirection: "row",
|
|
122
104
|
alignItems: "center",
|
|
123
105
|
},
|
|
124
|
-
label: {
|
|
125
|
-
fontSize: 16,
|
|
126
|
-
},
|
|
127
|
-
item: {
|
|
128
|
-
margin: 8,
|
|
129
|
-
},
|
|
130
106
|
content: {
|
|
131
107
|
flex: 1,
|
|
132
108
|
justifyContent: "center",
|
|
133
109
|
},
|
|
134
110
|
icon: {
|
|
135
|
-
|
|
111
|
+
marginRight: 8,
|
|
136
112
|
},
|
|
137
113
|
});
|
|
138
114
|
|
package/src/components/FAB.js
CHANGED
|
@@ -28,7 +28,7 @@ const FAB = ({ onPress, disabled, loading, iconName = "MaterialIcons/add", style
|
|
|
28
28
|
},
|
|
29
29
|
];
|
|
30
30
|
}, ...props },
|
|
31
|
-
React.createElement(View, null, loading ? (React.createElement(ActivityIndicator, { size: "small", color: color })) : (React.createElement(Icon, { name: iconName, size:
|
|
31
|
+
React.createElement(View, null, loading ? (React.createElement(ActivityIndicator, { style: size > 50 ? { marginTop: 2, marginLeft: 2 } : undefined, size: size <= 50 ? "small" : "large", color: color })) : (React.createElement(Icon, { name: iconName, size: size, color: color }))))));
|
|
32
32
|
};
|
|
33
33
|
const styles = StyleSheet.create({
|
|
34
34
|
button: {
|
package/src/components/FAB.tsx
CHANGED
|
@@ -77,9 +77,13 @@ const FAB: React.FC<Props> = ({
|
|
|
77
77
|
>
|
|
78
78
|
<View>
|
|
79
79
|
{loading ? (
|
|
80
|
-
<ActivityIndicator
|
|
80
|
+
<ActivityIndicator
|
|
81
|
+
style={size > 50 ? { marginTop: 2, marginLeft: 2 } : undefined}
|
|
82
|
+
size={size <= 50 ? "small" : "large"}
|
|
83
|
+
color={color}
|
|
84
|
+
/>
|
|
81
85
|
) : (
|
|
82
|
-
<Icon name={iconName} size={
|
|
86
|
+
<Icon name={iconName} size={size} color={color} />
|
|
83
87
|
)}
|
|
84
88
|
</View>
|
|
85
89
|
</Pressable>
|
|
@@ -37,7 +37,7 @@ const Stepper = ({ Icon, value, min, max, style, onChange, defaultValue, theme:
|
|
|
37
37
|
style,
|
|
38
38
|
borderRadius ? { borderRadius } : {},
|
|
39
39
|
] },
|
|
40
|
-
React.createElement(IconButton, { Icon: Icon, icon: "MaterialIcons/remove", onPress: handleMinus, size: iconSize, color: iconColor, disabled: stateValue === 0 }),
|
|
40
|
+
React.createElement(IconButton, { Icon: Icon, icon: "MaterialIcons/remove", onPress: handleMinus, size: iconSize, color: iconColor, disabled: stateValue === min, style: stateValue === min ? { opacity: 0.5 } : {} }),
|
|
41
41
|
React.createElement(Text, { style: [
|
|
42
42
|
typography.body1,
|
|
43
43
|
{
|
|
@@ -48,6 +48,6 @@ const Stepper = ({ Icon, value, min, max, style, onChange, defaultValue, theme:
|
|
|
48
48
|
},
|
|
49
49
|
typeStyle,
|
|
50
50
|
] }, value || stateValue),
|
|
51
|
-
React.createElement(IconButton, { Icon: Icon, icon: "MaterialIcons/add", onPress: handlePlus, size: iconSize, color: iconColor })));
|
|
51
|
+
React.createElement(IconButton, { Icon: Icon, icon: "MaterialIcons/add", onPress: handlePlus, size: iconSize, color: iconColor, disabled: stateValue === max, style: stateValue === max ? { opacity: 0.5 } : {} })));
|
|
52
52
|
};
|
|
53
53
|
export default withTheme(Stepper);
|
|
@@ -84,7 +84,8 @@ const Stepper: React.FC<Props> = ({
|
|
|
84
84
|
onPress={handleMinus}
|
|
85
85
|
size={iconSize}
|
|
86
86
|
color={iconColor}
|
|
87
|
-
disabled={stateValue ===
|
|
87
|
+
disabled={stateValue === min}
|
|
88
|
+
style={stateValue === min ? { opacity: 0.5 } : {}}
|
|
88
89
|
/>
|
|
89
90
|
<Text
|
|
90
91
|
style={[
|
|
@@ -106,6 +107,8 @@ const Stepper: React.FC<Props> = ({
|
|
|
106
107
|
onPress={handlePlus}
|
|
107
108
|
size={iconSize}
|
|
108
109
|
color={iconColor}
|
|
110
|
+
disabled={stateValue === max}
|
|
111
|
+
style={stateValue === max ? { opacity: 0.5 } : {}}
|
|
109
112
|
/>
|
|
110
113
|
</View>
|
|
111
114
|
);
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import SwiperComponent from "react-native-web-swiper";
|
|
4
|
-
const Swiper = ({ vertical = false, loop = false, timeout = 0, from = 0, prevTitle = "", nextTitle = "", dotsTouchable = true, children, style, }) => (React.createElement(View, { style: style },
|
|
4
|
+
const Swiper = ({ vertical = false, loop = false, timeout = 0, from = 0, prevTitle = "", nextTitle = "", prevTitleColor, nextTitleColor, dotsTouchable = true, dotColor, dotActiveColor, children, style, }) => (React.createElement(View, { style: style },
|
|
5
5
|
React.createElement(SwiperComponent, { from: from, loop: loop, timeout: timeout, vertical: vertical, controlsProps: {
|
|
6
6
|
prevTitle,
|
|
7
7
|
nextTitle,
|
|
8
|
+
prevTitleStyle: { color: prevTitleColor },
|
|
9
|
+
nextTitleStyle: { color: nextTitleColor },
|
|
8
10
|
dotsTouchable,
|
|
11
|
+
...(dotColor
|
|
12
|
+
? { dotProps: { badgeStyle: { backgroundColor: dotColor } } }
|
|
13
|
+
: {}),
|
|
14
|
+
...(dotActiveColor
|
|
15
|
+
? { dotActiveStyle: { backgroundColor: dotActiveColor } }
|
|
16
|
+
: {}),
|
|
9
17
|
} }, children)));
|
|
10
18
|
export default Swiper;
|
|
@@ -9,7 +9,11 @@ export interface SwiperProps {
|
|
|
9
9
|
timeout?: number;
|
|
10
10
|
prevTitle?: string;
|
|
11
11
|
nextTitle?: string;
|
|
12
|
+
prevTitleColor?: string;
|
|
13
|
+
nextTitleColor?: string;
|
|
12
14
|
dotsTouchable?: boolean;
|
|
15
|
+
dotColor?: string;
|
|
16
|
+
dotActiveColor?: string;
|
|
13
17
|
children: React.ReactNode;
|
|
14
18
|
style?: StyleProp<ViewStyle>;
|
|
15
19
|
}
|
|
@@ -21,7 +25,11 @@ const Swiper = ({
|
|
|
21
25
|
from = 0,
|
|
22
26
|
prevTitle = "",
|
|
23
27
|
nextTitle = "",
|
|
28
|
+
prevTitleColor,
|
|
29
|
+
nextTitleColor,
|
|
24
30
|
dotsTouchable = true,
|
|
31
|
+
dotColor,
|
|
32
|
+
dotActiveColor,
|
|
25
33
|
children,
|
|
26
34
|
style,
|
|
27
35
|
}: SwiperProps) => (
|
|
@@ -34,7 +42,15 @@ const Swiper = ({
|
|
|
34
42
|
controlsProps={{
|
|
35
43
|
prevTitle,
|
|
36
44
|
nextTitle,
|
|
45
|
+
prevTitleStyle: { color: prevTitleColor },
|
|
46
|
+
nextTitleStyle: { color: nextTitleColor },
|
|
37
47
|
dotsTouchable,
|
|
48
|
+
...(dotColor
|
|
49
|
+
? { dotProps: { badgeStyle: { backgroundColor: dotColor } } }
|
|
50
|
+
: {}),
|
|
51
|
+
...(dotActiveColor
|
|
52
|
+
? { dotActiveStyle: { backgroundColor: dotActiveColor } }
|
|
53
|
+
: {}),
|
|
38
54
|
}}
|
|
39
55
|
>
|
|
40
56
|
{children}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { COMPONENT_TYPES, createNumberProp, createIconProp, createTextProp, createStaticBoolProp, createColorProp, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
|
-
name: "Accordion
|
|
3
|
+
name: "Accordion",
|
|
4
4
|
tag: "AccordionGroup",
|
|
5
5
|
description: "An expandable container containing components",
|
|
6
6
|
category: COMPONENT_TYPES.container,
|
|
7
|
+
layout: {
|
|
8
|
+
paddingTop: 8,
|
|
9
|
+
paddingRight: 8,
|
|
10
|
+
paddingBottom: 8,
|
|
11
|
+
paddingLeft: 8,
|
|
12
|
+
fontSize: 16,
|
|
13
|
+
},
|
|
7
14
|
props: {
|
|
8
15
|
openColor: createColorProp({
|
|
9
16
|
label: "Open text color",
|
|
@@ -8,10 +8,17 @@ import {
|
|
|
8
8
|
} from "@draftbit/types";
|
|
9
9
|
|
|
10
10
|
export const SEED_DATA = {
|
|
11
|
-
name: "Accordion
|
|
11
|
+
name: "Accordion",
|
|
12
12
|
tag: "AccordionGroup",
|
|
13
13
|
description: "An expandable container containing components",
|
|
14
14
|
category: COMPONENT_TYPES.container,
|
|
15
|
+
layout: {
|
|
16
|
+
paddingTop: 8,
|
|
17
|
+
paddingRight: 8,
|
|
18
|
+
paddingBottom: 8,
|
|
19
|
+
paddingLeft: 8,
|
|
20
|
+
fontSize: 16,
|
|
21
|
+
},
|
|
15
22
|
props: {
|
|
16
23
|
openColor: createColorProp({
|
|
17
24
|
label: "Open text color",
|
|
@@ -9,7 +9,7 @@ export const SEED_DATA = {
|
|
|
9
9
|
name: "Accordion Item",
|
|
10
10
|
tag: "AccordionItem",
|
|
11
11
|
description: "Item to be used in Accordion",
|
|
12
|
-
category: COMPONENT_TYPES.
|
|
12
|
+
category: COMPONENT_TYPES.deprecated,
|
|
13
13
|
props: {
|
|
14
14
|
icon: createIconProp(),
|
|
15
15
|
label: createTextProp({
|
package/src/mappings/Stepper.js
CHANGED
package/src/mappings/Stepper.ts
CHANGED
package/src/mappings/Swiper.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, GROUPS, } from "@draftbit/types";
|
|
1
|
+
import { COMPONENT_TYPES, createBoolProp, createNumberProp, createTextProp, createColorProp, GROUPS, } from "@draftbit/types";
|
|
2
2
|
export const SEED_DATA = {
|
|
3
3
|
name: "Swiper",
|
|
4
4
|
tag: "Swiper",
|
|
@@ -37,6 +37,20 @@ export const SEED_DATA = {
|
|
|
37
37
|
label: "Next Title",
|
|
38
38
|
defaultValue: "",
|
|
39
39
|
}),
|
|
40
|
+
prevTitleColor: createColorProp({
|
|
41
|
+
label: "Previous Title Color",
|
|
42
|
+
}),
|
|
43
|
+
nextTitleColor: createColorProp({
|
|
44
|
+
label: "Next Title Color",
|
|
45
|
+
}),
|
|
46
|
+
dotColor: createColorProp({
|
|
47
|
+
label: "Dot Color",
|
|
48
|
+
defaultValue: "light",
|
|
49
|
+
}),
|
|
50
|
+
dotActiveColor: createColorProp({
|
|
51
|
+
label: "Dot Active Color",
|
|
52
|
+
defaultValue: "primary",
|
|
53
|
+
}),
|
|
40
54
|
dotsTouchable: createBoolProp({
|
|
41
55
|
group: GROUPS.basic,
|
|
42
56
|
label: "Dots Touchable",
|
package/src/mappings/Swiper.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createBoolProp,
|
|
4
4
|
createNumberProp,
|
|
5
5
|
createTextProp,
|
|
6
|
+
createColorProp,
|
|
6
7
|
GROUPS,
|
|
7
8
|
} from "@draftbit/types";
|
|
8
9
|
|
|
@@ -44,6 +45,20 @@ export const SEED_DATA = {
|
|
|
44
45
|
label: "Next Title",
|
|
45
46
|
defaultValue: "",
|
|
46
47
|
}),
|
|
48
|
+
prevTitleColor: createColorProp({
|
|
49
|
+
label: "Previous Title Color",
|
|
50
|
+
}),
|
|
51
|
+
nextTitleColor: createColorProp({
|
|
52
|
+
label: "Next Title Color",
|
|
53
|
+
}),
|
|
54
|
+
dotColor: createColorProp({
|
|
55
|
+
label: "Dot Color",
|
|
56
|
+
defaultValue: "light",
|
|
57
|
+
}),
|
|
58
|
+
dotActiveColor: createColorProp({
|
|
59
|
+
label: "Dot Active Color",
|
|
60
|
+
defaultValue: "primary",
|
|
61
|
+
}),
|
|
47
62
|
dotsTouchable: createBoolProp({
|
|
48
63
|
group: GROUPS.basic,
|
|
49
64
|
label: "Dots Touchable",
|
package/src/mappings/TextArea.js
CHANGED
package/src/mappings/TextArea.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["AccordionGroup.ts"],"names":["SEED_DATA","name","tag","description","category","COMPONENT_TYPES","container","props","openColor","label","closedColor","caretColor","iconSize","defaultValue","expanded","icon"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,iBADiB;AAEvBC,EAAAA,GAAG,EAAE,gBAFkB;AAGvBC,EAAAA,WAAW,EAAE,+CAHU;AAIvBC,EAAAA,QAAQ,EAAEC,uBAAgBC,SAJH;AAKvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,4BAAgB;AACzBC,MAAAA,KAAK,EAAE;AADkB,KAAhB,CADN;AAILC,IAAAA,WAAW,EAAE,4BAAgB;AAC3BD,MAAAA,KAAK,EAAE;AADoB,KAAhB,CAJR;AAOLE,IAAAA,UAAU,EAAE,4BAAgB;AAC1BF,MAAAA,KAAK,EAAE;AADmB,KAAhB,CAPP;AAULG,IAAAA,QAAQ,EAAE,6BAAiB;AACzBH,MAAAA,KAAK,EAAE,WADkB;AAEzBI,MAAAA,YAAY,EAAE;AAFW,KAAjB,CAVL;AAcLJ,IAAAA,KAAK,EAAE,2BAAe;AACpBA,MAAAA,KAAK,EAAE;AADa,KAAf,CAdF;AAiBLK,IAAAA,QAAQ,EAAE,iCAAqB;AAC7BL,MAAAA,KAAK,EAAE,UADsB;AAE7BN,MAAAA,WAAW,EAAE;AAFgB,KAArB,CAjBL;AAqBLY,IAAAA,IAAI,EAAE;AArBD;AALgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createNumberProp,\n createIconProp,\n createTextProp,\n createStaticBoolProp,\n createColorProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Accordion Group\",\n tag: \"AccordionGroup\",\n description: \"An expandable container containing components\",\n category: COMPONENT_TYPES.container,\n props: {\n openColor: createColorProp({\n label: \"Open text color\",\n }),\n closedColor: createColorProp({\n label: \"Closed text Color\",\n }),\n caretColor: createColorProp({\n label: \"Caret color\",\n }),\n iconSize: createNumberProp({\n label: \"Icon size\",\n defaultValue: 24,\n }),\n label: createTextProp({\n label: \"Label\",\n }),\n expanded: createStaticBoolProp({\n label: \"Expanded\",\n description: \"Whether the AccordionGroup should be expanded or not\",\n }),\n icon: createIconProp(),\n },\n};\n"]}
|