@draftbit/core 46.10.3-e89832.2 → 46.10.3-fb35c9.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/AnimatedCircularProgress.js +1 -12
- package/lib/commonjs/components/AvatarEdit.js +4 -15
- package/lib/commonjs/components/Banner.js +4 -23
- package/lib/commonjs/components/Button.js +10 -33
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
- package/lib/commonjs/components/DeprecatedButton.js +3 -20
- package/lib/commonjs/components/Divider.js +1 -14
- package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
- package/lib/commonjs/components/Layout.js +19 -40
- package/lib/commonjs/components/NumberInput.js +3 -12
- package/lib/commonjs/components/Picker/PickerComponent.android.js +3 -20
- package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/RadioButton/RadioButton.js +2 -13
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +2 -15
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +5 -23
- package/lib/commonjs/components/ScreenContainer.js +6 -24
- package/lib/commonjs/components/Shadow.js +2 -15
- package/lib/commonjs/components/Slider.js +4 -21
- package/lib/commonjs/components/StarRating.js +4 -23
- package/lib/commonjs/components/StepIndicator.js +18 -57
- package/lib/commonjs/components/Surface.js +2 -14
- package/lib/commonjs/components/TabView/TabView.js +7 -13
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +61 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/components/Text.js +4 -50
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/ToggleButton.js +2 -15
- package/lib/commonjs/components/Touchable.js +2 -15
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +19 -28
- package/lib/commonjs/mappings/NativeBase/Layout.js +108 -0
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/commonjs/utilities.js +2 -1
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +3 -0
- package/lib/module/index.js +1 -4
- package/lib/module/mappings/NativeBase/Layout.js +101 -0
- package/lib/module/mappings/Table.js +133 -0
- package/lib/typescript/src/components/Table/Table.d.ts +19 -0
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
- package/lib/typescript/src/components/{DeprecatedCardWrapper.d.ts → Table/TableRow.d.ts} +7 -8
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +4 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +133 -0
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -0
- package/lib/typescript/src/mappings/{CardBlock.d.ts → Table.d.ts} +129 -81
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Table/Table.js +93 -0
- package/src/components/Table/Table.tsx +176 -0
- package/src/components/Table/TableCell.js +31 -0
- package/src/components/Table/TableCell.tsx +63 -0
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +3 -0
- package/src/components/Table/index.tsx +3 -0
- package/src/index.js +1 -4
- package/src/index.tsx +2 -4
- package/src/mappings/NativeBase/Layout.js +124 -0
- package/src/mappings/NativeBase/Layout.ts +145 -0
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/components/Container.js +0 -104
- package/lib/commonjs/components/DeprecatedCardWrapper.js +0 -40
- package/lib/commonjs/components/DeprecatedFAB.js +0 -157
- package/lib/commonjs/components/ProgressIndicator.js +0 -55
- package/lib/commonjs/components/ResizeMode.js +0 -5
- package/lib/commonjs/components/Row.js +0 -73
- package/lib/commonjs/components/RowBodyIcon.js +0 -45
- package/lib/commonjs/components/RowHeadlineImageCaption.js +0 -45
- package/lib/commonjs/components/RowHeadlineImageIcon.js +0 -51
- package/lib/commonjs/mappings/CardBlock.js +0 -126
- package/lib/commonjs/mappings/CardContainer.js +0 -108
- package/lib/commonjs/mappings/CardContainerRating.js +0 -130
- package/lib/commonjs/mappings/CardContainerShortImage.js +0 -124
- package/lib/commonjs/mappings/CardInline.js +0 -59
- package/lib/commonjs/mappings/Container.js +0 -37
- package/lib/commonjs/mappings/ProgressIndicator.js +0 -188
- package/lib/module/components/Container.js +0 -83
- package/lib/module/components/DeprecatedCardWrapper.js +0 -32
- package/lib/module/components/DeprecatedFAB.js +0 -147
- package/lib/module/components/ProgressIndicator.js +0 -45
- package/lib/module/components/ResizeMode.js +0 -1
- package/lib/module/components/Row.js +0 -63
- package/lib/module/components/RowBodyIcon.js +0 -35
- package/lib/module/components/RowHeadlineImageCaption.js +0 -35
- package/lib/module/components/RowHeadlineImageIcon.js +0 -41
- package/lib/module/mappings/CardBlock.js +0 -119
- package/lib/module/mappings/CardContainer.js +0 -101
- package/lib/module/mappings/CardContainerRating.js +0 -123
- package/lib/module/mappings/CardContainerShortImage.js +0 -117
- package/lib/module/mappings/CardInline.js +0 -52
- package/lib/module/mappings/Container.js +0 -30
- package/lib/module/mappings/ProgressIndicator.js +0 -181
- package/lib/typescript/src/components/Container.d.ts +0 -21
- package/lib/typescript/src/components/Container.d.ts.map +0 -1
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts.map +0 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +0 -56
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +0 -1
- package/lib/typescript/src/components/ProgressIndicator.d.ts +0 -24
- package/lib/typescript/src/components/ProgressIndicator.d.ts.map +0 -1
- package/lib/typescript/src/components/ResizeMode.d.ts +0 -2
- package/lib/typescript/src/components/ResizeMode.d.ts.map +0 -1
- package/lib/typescript/src/components/Row.d.ts +0 -21
- package/lib/typescript/src/components/Row.d.ts.map +0 -1
- package/lib/typescript/src/components/RowBodyIcon.d.ts +0 -16
- package/lib/typescript/src/components/RowBodyIcon.d.ts.map +0 -1
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +0 -16
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts.map +0 -1
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +0 -18
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardBlock.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainer.d.ts +0 -102
- package/lib/typescript/src/mappings/CardContainer.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainerRating.d.ts +0 -108
- package/lib/typescript/src/mappings/CardContainerRating.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts +0 -139
- package/lib/typescript/src/mappings/CardContainerShortImage.d.ts.map +0 -1
- package/lib/typescript/src/mappings/CardInline.d.ts +0 -62
- package/lib/typescript/src/mappings/CardInline.d.ts.map +0 -1
- package/lib/typescript/src/mappings/Container.d.ts +0 -55
- package/lib/typescript/src/mappings/Container.d.ts.map +0 -1
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts +0 -181
- package/lib/typescript/src/mappings/ProgressIndicator.d.ts.map +0 -1
- package/src/components/Container.js +0 -43
- package/src/components/Container.tsx +0 -116
- package/src/components/DeprecatedCardWrapper.js +0 -18
- package/src/components/DeprecatedCardWrapper.tsx +0 -46
- package/src/components/DeprecatedFAB.js +0 -114
- package/src/components/DeprecatedFAB.tsx +0 -231
- package/src/components/ProgressIndicator.js +0 -27
- package/src/components/ProgressIndicator.tsx +0 -71
- package/src/components/ResizeMode.js +0 -1
- package/src/components/ResizeMode.ts +0 -7
- package/src/components/Row.js +0 -48
- package/src/components/Row.tsx +0 -108
- package/src/components/RowBodyIcon.js +0 -8
- package/src/components/RowBodyIcon.tsx +0 -47
- package/src/components/RowHeadlineImageCaption.js +0 -12
- package/src/components/RowHeadlineImageCaption.tsx +0 -49
- package/src/components/RowHeadlineImageIcon.js +0 -14
- package/src/components/RowHeadlineImageIcon.tsx +0 -61
- package/src/mappings/CardBlock.js +0 -123
- package/src/mappings/CardBlock.ts +0 -136
- package/src/mappings/CardContainer.js +0 -104
- package/src/mappings/CardContainer.ts +0 -116
- package/src/mappings/CardContainerRating.js +0 -126
- package/src/mappings/CardContainerRating.ts +0 -137
- package/src/mappings/CardContainerShortImage.js +0 -120
- package/src/mappings/CardContainerShortImage.ts +0 -130
- package/src/mappings/CardInline.js +0 -52
- package/src/mappings/CardInline.ts +0 -61
- package/src/mappings/Container.js +0 -30
- package/src/mappings/Container.ts +0 -41
- package/src/mappings/ProgressIndicator.js +0 -181
- package/src/mappings/ProgressIndicator.ts +0 -190
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
ActivityIndicator,
|
|
4
|
-
View,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
StyleProp,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
TextStyle,
|
|
9
|
-
Pressable,
|
|
10
|
-
PressableProps,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
import color from "color";
|
|
13
|
-
import Config from "./Config";
|
|
14
|
-
import Text from "./Text";
|
|
15
|
-
import Elevation from "./Elevation";
|
|
16
|
-
import { withTheme } from "../theming";
|
|
17
|
-
|
|
18
|
-
import type { Theme } from "../styles/DefaultTheme";
|
|
19
|
-
import type { IconSlot } from "../interfaces/Icon";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A floating action button represents the primary action in an application.
|
|
23
|
-
*
|
|
24
|
-
* <div class="screenshots">
|
|
25
|
-
* <img src="screenshots/fab-1.png" />
|
|
26
|
-
* <img src="screenshots/fab-2.png" />
|
|
27
|
-
* </div>
|
|
28
|
-
*
|
|
29
|
-
* ## Usage
|
|
30
|
-
* ```js
|
|
31
|
-
* import * as React from 'react';
|
|
32
|
-
* import { StyleSheet } from 'react-native';
|
|
33
|
-
* import { FAB } from '@draftbit/ui';
|
|
34
|
-
*
|
|
35
|
-
* const MyComponent = () => (
|
|
36
|
-
* <FAB
|
|
37
|
-
* style={styles.fab}
|
|
38
|
-
* type="outline"
|
|
39
|
-
* icon="add"
|
|
40
|
-
* onPress={() => console.log('Pressed')}
|
|
41
|
-
* />
|
|
42
|
-
* );
|
|
43
|
-
*
|
|
44
|
-
* const styles = StyleSheet.create({
|
|
45
|
-
* fab: {
|
|
46
|
-
* position: 'absolute',
|
|
47
|
-
* margin: 16,
|
|
48
|
-
* right: 0,
|
|
49
|
-
* bottom: 0,
|
|
50
|
-
* },
|
|
51
|
-
* })
|
|
52
|
-
*
|
|
53
|
-
* export default MyComponent;
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
type Props = {
|
|
58
|
-
disabled?: boolean;
|
|
59
|
-
type?: "solid" | "extended" | "outline" | "fixed" | "standard";
|
|
60
|
-
loading?: boolean;
|
|
61
|
-
icon?: string;
|
|
62
|
-
color?: string;
|
|
63
|
-
label?: string;
|
|
64
|
-
onPress: () => void;
|
|
65
|
-
elevation?: number;
|
|
66
|
-
theme: Theme;
|
|
67
|
-
style?: StyleProp<ViewStyle>;
|
|
68
|
-
} & PressableProps &
|
|
69
|
-
IconSlot;
|
|
70
|
-
|
|
71
|
-
const FAB: React.FC<React.PropsWithChildren<Props>> = ({
|
|
72
|
-
Icon,
|
|
73
|
-
icon,
|
|
74
|
-
disabled = false,
|
|
75
|
-
type = "solid",
|
|
76
|
-
loading = false,
|
|
77
|
-
color: colorOverride,
|
|
78
|
-
label,
|
|
79
|
-
onPress,
|
|
80
|
-
elevation = 0,
|
|
81
|
-
style,
|
|
82
|
-
theme: { colors, disabledOpacity, roundness, typography },
|
|
83
|
-
...rest
|
|
84
|
-
}) => {
|
|
85
|
-
let backgroundColor, borderColor, textColor, borderWidth;
|
|
86
|
-
const buttonColor = colorOverride || colors.primary;
|
|
87
|
-
|
|
88
|
-
if (type === "standard" || type === "extended" || type === "fixed") {
|
|
89
|
-
backgroundColor = buttonColor;
|
|
90
|
-
|
|
91
|
-
if (disabled) {
|
|
92
|
-
textColor = color(colors.surface).alpha(disabledOpacity).rgb().string();
|
|
93
|
-
} else {
|
|
94
|
-
textColor = colors.surface;
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
backgroundColor = "transparent";
|
|
98
|
-
|
|
99
|
-
if (disabled) {
|
|
100
|
-
textColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
101
|
-
} else {
|
|
102
|
-
textColor = buttonColor;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (type === "outline") {
|
|
107
|
-
if (disabled) {
|
|
108
|
-
borderColor = color(buttonColor).alpha(disabledOpacity).rgb().string();
|
|
109
|
-
} else {
|
|
110
|
-
borderColor = buttonColor;
|
|
111
|
-
}
|
|
112
|
-
borderWidth = StyleSheet.hairlineWidth;
|
|
113
|
-
} else {
|
|
114
|
-
borderColor = "transparent";
|
|
115
|
-
borderWidth = 0;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const buttonStyle: StyleProp<ViewStyle> = {
|
|
119
|
-
backgroundColor,
|
|
120
|
-
borderColor,
|
|
121
|
-
borderWidth,
|
|
122
|
-
borderRadius: roundness,
|
|
123
|
-
alignItems: "center",
|
|
124
|
-
justifyContent: "center",
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const buttonStyles: StyleProp<ViewStyle>[] = [styles.button, buttonStyle];
|
|
128
|
-
|
|
129
|
-
const contentStyle: StyleProp<ViewStyle>[] = [styles.content];
|
|
130
|
-
|
|
131
|
-
const textStyle: StyleProp<TextStyle> = {
|
|
132
|
-
textAlign: "center",
|
|
133
|
-
color: textColor,
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const iconStyle: StyleProp<ViewStyle>[] = [
|
|
137
|
-
styles.icon,
|
|
138
|
-
{
|
|
139
|
-
width: Config.buttonIconSize,
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
|
-
|
|
143
|
-
if (type === "standard" || type === "outline") {
|
|
144
|
-
buttonStyle.width = Config.FABSize;
|
|
145
|
-
buttonStyle.height = Config.FABSize;
|
|
146
|
-
buttonStyle.borderRadius = Config.FABBorderRadius;
|
|
147
|
-
|
|
148
|
-
contentStyle.push({
|
|
149
|
-
width: Config.FABSize,
|
|
150
|
-
height: Config.FABSize,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (type === "extended" || type === "fixed") {
|
|
155
|
-
iconStyle.push({
|
|
156
|
-
marginLeft: 16,
|
|
157
|
-
marginRight: -8,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
textStyle.margin = 16;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (type === "fixed") {
|
|
164
|
-
buttonStyles.push({
|
|
165
|
-
height: Config.FABFixedHeight,
|
|
166
|
-
alignSelf: "stretch",
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<Elevation style={[{ elevation }, style]}>
|
|
172
|
-
<Pressable
|
|
173
|
-
{...rest}
|
|
174
|
-
onPress={onPress}
|
|
175
|
-
accessibilityState={{ disabled }}
|
|
176
|
-
accessibilityRole="button"
|
|
177
|
-
disabled={disabled || loading}
|
|
178
|
-
style={buttonStyles}
|
|
179
|
-
>
|
|
180
|
-
<View style={styles.content}>
|
|
181
|
-
{icon && loading !== true ? (
|
|
182
|
-
<View style={iconStyle}>
|
|
183
|
-
<Icon
|
|
184
|
-
name={icon}
|
|
185
|
-
size={Config.buttonIconSize}
|
|
186
|
-
color={textColor}
|
|
187
|
-
/>
|
|
188
|
-
</View>
|
|
189
|
-
) : null}
|
|
190
|
-
{loading ? (
|
|
191
|
-
<ActivityIndicator
|
|
192
|
-
size="small"
|
|
193
|
-
color={textColor}
|
|
194
|
-
style={iconStyle}
|
|
195
|
-
/>
|
|
196
|
-
) : null}
|
|
197
|
-
{label ? (
|
|
198
|
-
<Text numberOfLines={1} style={[textStyle, typography.button]}>
|
|
199
|
-
{label}
|
|
200
|
-
</Text>
|
|
201
|
-
) : null}
|
|
202
|
-
</View>
|
|
203
|
-
</Pressable>
|
|
204
|
-
</Elevation>
|
|
205
|
-
);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const styles = StyleSheet.create({
|
|
209
|
-
button: {
|
|
210
|
-
borderStyle: "solid",
|
|
211
|
-
},
|
|
212
|
-
content: {
|
|
213
|
-
flexDirection: "row",
|
|
214
|
-
alignItems: "center",
|
|
215
|
-
justifyContent: "center",
|
|
216
|
-
},
|
|
217
|
-
icon: {
|
|
218
|
-
alignItems: "center",
|
|
219
|
-
justifyContent: "center",
|
|
220
|
-
width: Config.buttonIconSize,
|
|
221
|
-
},
|
|
222
|
-
fixed: {
|
|
223
|
-
left: 0,
|
|
224
|
-
right: 0,
|
|
225
|
-
bottom: 0,
|
|
226
|
-
height: 64,
|
|
227
|
-
borderRadius: 0,
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
export default withTheme(FAB);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import StepIndicator from "./StepIndicator";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
const ProgressIndicator = ({ numberOfSteps, currentStep, currentStepStrokeWidth = 3, stepStrokeCurrentColor = "primary", stepIndicatorSize, currentStepIndicatorSize, stepIndicatorCurrentColor, stepIndicatorLabelCurrentColor, stepIndicatorLabelFontSize = 12, stepNumberFinishedColor = "strongInverse", stepNumberUnfinishedColor = "primary", unfinishedColor = "light", finishedColor = "primary", theme, }) => {
|
|
5
|
-
const currentPosition = currentStep - 1;
|
|
6
|
-
return (React.createElement(StepIndicator, { stepCount: numberOfSteps, currentPosition: currentPosition, customStyles: {
|
|
7
|
-
stepIndicatorSize,
|
|
8
|
-
currentStepIndicatorSize: currentStepIndicatorSize
|
|
9
|
-
? currentStepIndicatorSize
|
|
10
|
-
: stepIndicatorSize,
|
|
11
|
-
stepStrokeFinishedColor: finishedColor,
|
|
12
|
-
stepStrokeUnFinishedColor: unfinishedColor,
|
|
13
|
-
separatorFinishedColor: finishedColor,
|
|
14
|
-
separatorUnFinishedColor: unfinishedColor,
|
|
15
|
-
stepIndicatorFinishedColor: finishedColor,
|
|
16
|
-
stepIndicatorUnFinishedColor: unfinishedColor,
|
|
17
|
-
currentStepStrokeWidth,
|
|
18
|
-
stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
|
|
19
|
-
stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
|
|
20
|
-
stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
|
|
21
|
-
stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
|
|
22
|
-
stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
|
|
23
|
-
stepIndicatorLabelFontSize,
|
|
24
|
-
labelFontFamily: theme.typography.body1.fontFamily,
|
|
25
|
-
} }));
|
|
26
|
-
};
|
|
27
|
-
export default withTheme(ProgressIndicator);
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import StepIndicator from "./StepIndicator";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
import themeT from "../styles/DefaultTheme";
|
|
5
|
-
import { colorTypes } from "@draftbit/types";
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
numberOfSteps: number;
|
|
9
|
-
currentStep: number;
|
|
10
|
-
currentStepStrokeWidth?: number;
|
|
11
|
-
stepStrokeCurrentColor?: colorTypes;
|
|
12
|
-
stepIndicatorSize?: number;
|
|
13
|
-
currentStepIndicatorSize?: number;
|
|
14
|
-
stepIndicatorCurrentColor?: colorTypes;
|
|
15
|
-
stepIndicatorLabelCurrentColor?: colorTypes;
|
|
16
|
-
stepIndicatorLabelFontSize?: number;
|
|
17
|
-
stepNumberFinishedColor?: colorTypes;
|
|
18
|
-
stepNumberUnfinishedColor?: colorTypes;
|
|
19
|
-
unfinishedColor?: colorTypes;
|
|
20
|
-
finishedColor?: colorTypes;
|
|
21
|
-
theme: typeof themeT;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const ProgressIndicator: React.FC<React.PropsWithChildren<Props>> = ({
|
|
25
|
-
numberOfSteps,
|
|
26
|
-
currentStep,
|
|
27
|
-
currentStepStrokeWidth = 3,
|
|
28
|
-
stepStrokeCurrentColor = "primary",
|
|
29
|
-
stepIndicatorSize,
|
|
30
|
-
currentStepIndicatorSize,
|
|
31
|
-
stepIndicatorCurrentColor,
|
|
32
|
-
stepIndicatorLabelCurrentColor,
|
|
33
|
-
stepIndicatorLabelFontSize = 12,
|
|
34
|
-
stepNumberFinishedColor = "strongInverse",
|
|
35
|
-
stepNumberUnfinishedColor = "primary",
|
|
36
|
-
unfinishedColor = "light",
|
|
37
|
-
finishedColor = "primary",
|
|
38
|
-
theme,
|
|
39
|
-
}) => {
|
|
40
|
-
const currentPosition = currentStep - 1;
|
|
41
|
-
return (
|
|
42
|
-
<StepIndicator
|
|
43
|
-
stepCount={numberOfSteps}
|
|
44
|
-
currentPosition={currentPosition}
|
|
45
|
-
customStyles={{
|
|
46
|
-
stepIndicatorSize,
|
|
47
|
-
currentStepIndicatorSize: currentStepIndicatorSize
|
|
48
|
-
? currentStepIndicatorSize
|
|
49
|
-
: stepIndicatorSize,
|
|
50
|
-
stepStrokeFinishedColor: finishedColor,
|
|
51
|
-
stepStrokeUnFinishedColor: unfinishedColor,
|
|
52
|
-
separatorFinishedColor: finishedColor,
|
|
53
|
-
separatorUnFinishedColor: unfinishedColor,
|
|
54
|
-
stepIndicatorFinishedColor: finishedColor,
|
|
55
|
-
stepIndicatorUnFinishedColor: unfinishedColor,
|
|
56
|
-
currentStepStrokeWidth,
|
|
57
|
-
stepStrokeCurrentColor:
|
|
58
|
-
stepStrokeCurrentColor || stepIndicatorCurrentColor,
|
|
59
|
-
stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
|
|
60
|
-
stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
|
|
61
|
-
stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
|
|
62
|
-
stepIndicatorLabelCurrentColor:
|
|
63
|
-
stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
|
|
64
|
-
stepIndicatorLabelFontSize,
|
|
65
|
-
labelFontFamily: theme.typography.body1.fontFamily,
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export default withTheme(ProgressIndicator);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/components/Row.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, Text, Image, StyleSheet, } from "react-native";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
import Config from "./Config";
|
|
5
|
-
const Row = ({ titleTypeStyle, titleColor, subtitleTypeStyle, subtitleColor, title, subtitle, multilineSubtitle, image, right, style, }) => {
|
|
6
|
-
return (React.createElement(View, { style: [styles.container, { padding: 16 }, style] },
|
|
7
|
-
React.createElement(View, { style: styles.leftContainer },
|
|
8
|
-
image && (React.createElement(Image, { source: typeof image === "string" ? { uri: image } : image, style: {
|
|
9
|
-
marginRight: 12,
|
|
10
|
-
width: subtitle
|
|
11
|
-
? Config.rowMultiLineImageSize
|
|
12
|
-
: Config.rowSingleLineImageSize,
|
|
13
|
-
height: subtitle
|
|
14
|
-
? Config.rowMultiLineImageSize
|
|
15
|
-
: Config.rowSingleLineImageSize,
|
|
16
|
-
} })),
|
|
17
|
-
React.createElement(View, { style: styles.textContainer },
|
|
18
|
-
React.createElement(Text, { style: [
|
|
19
|
-
titleTypeStyle,
|
|
20
|
-
{
|
|
21
|
-
color: titleColor,
|
|
22
|
-
},
|
|
23
|
-
], numberOfLines: 1 }, title),
|
|
24
|
-
subtitle ? (React.createElement(Text, { style: [
|
|
25
|
-
subtitleTypeStyle,
|
|
26
|
-
{
|
|
27
|
-
color: subtitleColor,
|
|
28
|
-
marginTop: 4,
|
|
29
|
-
},
|
|
30
|
-
], numberOfLines: multilineSubtitle ? undefined : 1 }, subtitle)) : null)),
|
|
31
|
-
right && right()));
|
|
32
|
-
};
|
|
33
|
-
const styles = StyleSheet.create({
|
|
34
|
-
leftContainer: {
|
|
35
|
-
flexDirection: "row",
|
|
36
|
-
flex: 1,
|
|
37
|
-
},
|
|
38
|
-
container: {
|
|
39
|
-
flexDirection: "row",
|
|
40
|
-
justifyContent: "space-between",
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
},
|
|
43
|
-
textContainer: {
|
|
44
|
-
flex: 1,
|
|
45
|
-
justifyContent: "center",
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
export default withTheme(Row);
|
package/src/components/Row.tsx
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
Image,
|
|
6
|
-
ImageSourcePropType,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
StyleProp,
|
|
9
|
-
TextStyle,
|
|
10
|
-
ViewStyle,
|
|
11
|
-
} from "react-native";
|
|
12
|
-
import { withTheme } from "../theming";
|
|
13
|
-
import Config from "./Config";
|
|
14
|
-
import theme from "../styles/DefaultTheme";
|
|
15
|
-
|
|
16
|
-
type Props = {
|
|
17
|
-
titleTypeStyle?: StyleProp<TextStyle>;
|
|
18
|
-
titleColor?: string;
|
|
19
|
-
subtitleTypeStyle?: StyleProp<TextStyle>;
|
|
20
|
-
subtitleColor?: string;
|
|
21
|
-
title?: string;
|
|
22
|
-
subtitle?: string;
|
|
23
|
-
multilineSubtitle?: boolean;
|
|
24
|
-
image?: string | ImageSourcePropType;
|
|
25
|
-
right?: () => React.ReactNode;
|
|
26
|
-
style?: StyleProp<ViewStyle>;
|
|
27
|
-
theme: typeof theme;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const Row: React.FC<React.PropsWithChildren<Props>> = ({
|
|
31
|
-
titleTypeStyle,
|
|
32
|
-
titleColor,
|
|
33
|
-
subtitleTypeStyle,
|
|
34
|
-
subtitleColor,
|
|
35
|
-
title,
|
|
36
|
-
subtitle,
|
|
37
|
-
multilineSubtitle,
|
|
38
|
-
image,
|
|
39
|
-
right,
|
|
40
|
-
style,
|
|
41
|
-
}) => {
|
|
42
|
-
return (
|
|
43
|
-
<View style={[styles.container, { padding: 16 }, style]}>
|
|
44
|
-
<View style={styles.leftContainer}>
|
|
45
|
-
{image && (
|
|
46
|
-
<Image
|
|
47
|
-
source={typeof image === "string" ? { uri: image } : image}
|
|
48
|
-
style={{
|
|
49
|
-
marginRight: 12,
|
|
50
|
-
width: subtitle
|
|
51
|
-
? Config.rowMultiLineImageSize
|
|
52
|
-
: Config.rowSingleLineImageSize,
|
|
53
|
-
height: subtitle
|
|
54
|
-
? Config.rowMultiLineImageSize
|
|
55
|
-
: Config.rowSingleLineImageSize,
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
58
|
-
)}
|
|
59
|
-
<View style={styles.textContainer}>
|
|
60
|
-
<Text
|
|
61
|
-
style={[
|
|
62
|
-
titleTypeStyle,
|
|
63
|
-
{
|
|
64
|
-
color: titleColor,
|
|
65
|
-
},
|
|
66
|
-
]}
|
|
67
|
-
numberOfLines={1}
|
|
68
|
-
>
|
|
69
|
-
{title}
|
|
70
|
-
</Text>
|
|
71
|
-
{subtitle ? (
|
|
72
|
-
<Text
|
|
73
|
-
style={[
|
|
74
|
-
subtitleTypeStyle,
|
|
75
|
-
{
|
|
76
|
-
color: subtitleColor,
|
|
77
|
-
marginTop: 4,
|
|
78
|
-
},
|
|
79
|
-
]}
|
|
80
|
-
numberOfLines={multilineSubtitle ? undefined : 1}
|
|
81
|
-
>
|
|
82
|
-
{subtitle}
|
|
83
|
-
</Text>
|
|
84
|
-
) : null}
|
|
85
|
-
</View>
|
|
86
|
-
</View>
|
|
87
|
-
{right && right()}
|
|
88
|
-
</View>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const styles = StyleSheet.create({
|
|
93
|
-
leftContainer: {
|
|
94
|
-
flexDirection: "row",
|
|
95
|
-
flex: 1,
|
|
96
|
-
},
|
|
97
|
-
container: {
|
|
98
|
-
flexDirection: "row",
|
|
99
|
-
justifyContent: "space-between",
|
|
100
|
-
alignItems: "center",
|
|
101
|
-
},
|
|
102
|
-
textContainer: {
|
|
103
|
-
flex: 1,
|
|
104
|
-
justifyContent: "center",
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
export default withTheme(Row);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { withTheme } from "../theming";
|
|
3
|
-
import Row from "./Row";
|
|
4
|
-
import Config from "./Config";
|
|
5
|
-
const RowBodyIcon = ({ Icon, title, subtitle, icon, style, theme: { colors, typography }, }) => {
|
|
6
|
-
return (React.createElement(Row, { titleTypeStyle: typography.body1, titleColor: colors.medium, subtitleTypeStyle: typography.subtitle2, subtitleColor: colors.light, title: title, subtitle: subtitle, right: () => (React.createElement(Icon, { name: icon, size: Config.rowSingleLineIconSize, color: colors.light, style: { marginLeft: 16 } })), style: style }));
|
|
7
|
-
};
|
|
8
|
-
export default withTheme(RowBodyIcon);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { withTheme } from "../theming";
|
|
3
|
-
import type { Theme } from "../styles/DefaultTheme";
|
|
4
|
-
import type { IconSlot } from "../interfaces/Icon";
|
|
5
|
-
|
|
6
|
-
import Row from "./Row";
|
|
7
|
-
import Config from "./Config";
|
|
8
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
title?: string;
|
|
12
|
-
subtitle?: string;
|
|
13
|
-
icon: string;
|
|
14
|
-
style?: StyleProp<ViewStyle>;
|
|
15
|
-
theme: Theme;
|
|
16
|
-
} & IconSlot;
|
|
17
|
-
|
|
18
|
-
const RowBodyIcon: React.FC<React.PropsWithChildren<Props>> = ({
|
|
19
|
-
Icon,
|
|
20
|
-
title,
|
|
21
|
-
subtitle,
|
|
22
|
-
icon,
|
|
23
|
-
style,
|
|
24
|
-
theme: { colors, typography },
|
|
25
|
-
}) => {
|
|
26
|
-
return (
|
|
27
|
-
<Row
|
|
28
|
-
titleTypeStyle={typography.body1}
|
|
29
|
-
titleColor={colors.medium}
|
|
30
|
-
subtitleTypeStyle={typography.subtitle2}
|
|
31
|
-
subtitleColor={colors.light}
|
|
32
|
-
title={title}
|
|
33
|
-
subtitle={subtitle}
|
|
34
|
-
right={() => (
|
|
35
|
-
<Icon
|
|
36
|
-
name={icon}
|
|
37
|
-
size={Config.rowSingleLineIconSize}
|
|
38
|
-
color={colors.light}
|
|
39
|
-
style={{ marginLeft: 16 }}
|
|
40
|
-
/>
|
|
41
|
-
)}
|
|
42
|
-
style={style}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default withTheme(RowBodyIcon);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Text } from "react-native";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
import Row from "./Row";
|
|
5
|
-
const RowHeadlineImageCaption = ({ title, subtitle, caption, image, style, theme: { colors, typography }, }) => {
|
|
6
|
-
return (React.createElement(Row, { titleTypeStyle: typography.headline6, titleColor: colors.strong, subtitleTypeStyle: typography.body2, subtitleColor: colors.medium, title: title, subtitle: subtitle, image: image, right: () => (React.createElement(Text, { style: {
|
|
7
|
-
...typography.caption,
|
|
8
|
-
color: colors.strong,
|
|
9
|
-
marginLeft: 16,
|
|
10
|
-
} }, caption)), style: style }));
|
|
11
|
-
};
|
|
12
|
-
export default withTheme(RowHeadlineImageCaption);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Text, ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { withTheme } from "../theming";
|
|
4
|
-
import Row from "./Row";
|
|
5
|
-
import theme from "../styles/DefaultTheme";
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
title?: string;
|
|
9
|
-
subtitle?: string;
|
|
10
|
-
caption?: string;
|
|
11
|
-
image: string | ImageSourcePropType;
|
|
12
|
-
style?: StyleProp<ViewStyle>;
|
|
13
|
-
theme: typeof theme;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const RowHeadlineImageCaption: React.FC<React.PropsWithChildren<Props>> = ({
|
|
17
|
-
title,
|
|
18
|
-
subtitle,
|
|
19
|
-
caption,
|
|
20
|
-
image,
|
|
21
|
-
style,
|
|
22
|
-
theme: { colors, typography },
|
|
23
|
-
}) => {
|
|
24
|
-
return (
|
|
25
|
-
<Row
|
|
26
|
-
titleTypeStyle={typography.headline6}
|
|
27
|
-
titleColor={colors.strong}
|
|
28
|
-
subtitleTypeStyle={typography.body2}
|
|
29
|
-
subtitleColor={colors.medium}
|
|
30
|
-
title={title}
|
|
31
|
-
subtitle={subtitle}
|
|
32
|
-
image={image}
|
|
33
|
-
right={() => (
|
|
34
|
-
<Text
|
|
35
|
-
style={{
|
|
36
|
-
...typography.caption,
|
|
37
|
-
color: colors.strong,
|
|
38
|
-
marginLeft: 16,
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
{caption}
|
|
42
|
-
</Text>
|
|
43
|
-
)}
|
|
44
|
-
style={style}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default withTheme(RowHeadlineImageCaption);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { withTheme } from "../theming";
|
|
3
|
-
import Row from "./Row";
|
|
4
|
-
import Config from "./Config";
|
|
5
|
-
const RowHeadlineImageIcon = ({ Icon, icon, title, image, subtitle, multilineSubtitle = false, style, theme: { colors, typography }, }) => {
|
|
6
|
-
return (React.createElement(Row, { titleTypeStyle: typography.headline6, titleColor: colors.strong, subtitleTypeStyle: typography.body2, subtitleColor: colors.medium, title: title, subtitle: subtitle, multilineSubtitle: multilineSubtitle, image: image, right: () => (React.createElement(Icon, { name: icon, size: multilineSubtitle
|
|
7
|
-
? Config.rowMultiLineIconSize
|
|
8
|
-
: Config.rowSingleLineIconSize, color: colors.light, style: {
|
|
9
|
-
marginLeft: 16,
|
|
10
|
-
alignSelf: multilineSubtitle ? "flex-start" : "center",
|
|
11
|
-
marginTop: multilineSubtitle ? 4 : 0,
|
|
12
|
-
} })), style: style }));
|
|
13
|
-
};
|
|
14
|
-
export default withTheme(RowHeadlineImageIcon);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { withTheme } from "../theming";
|
|
3
|
-
import type { Theme } from "../styles/DefaultTheme";
|
|
4
|
-
import type { IconSlot } from "../interfaces/Icon";
|
|
5
|
-
|
|
6
|
-
import Row from "./Row";
|
|
7
|
-
import Config from "./Config";
|
|
8
|
-
import { ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
title?: string;
|
|
12
|
-
image: string | ImageSourcePropType;
|
|
13
|
-
subtitle?: string;
|
|
14
|
-
multilineSubtitle?: boolean;
|
|
15
|
-
icon: string;
|
|
16
|
-
style?: StyleProp<ViewStyle>;
|
|
17
|
-
theme: Theme;
|
|
18
|
-
} & IconSlot;
|
|
19
|
-
|
|
20
|
-
const RowHeadlineImageIcon: React.FC<React.PropsWithChildren<Props>> = ({
|
|
21
|
-
Icon,
|
|
22
|
-
icon,
|
|
23
|
-
title,
|
|
24
|
-
image,
|
|
25
|
-
subtitle,
|
|
26
|
-
multilineSubtitle = false,
|
|
27
|
-
style,
|
|
28
|
-
theme: { colors, typography },
|
|
29
|
-
}) => {
|
|
30
|
-
return (
|
|
31
|
-
<Row
|
|
32
|
-
titleTypeStyle={typography.headline6}
|
|
33
|
-
titleColor={colors.strong}
|
|
34
|
-
subtitleTypeStyle={typography.body2}
|
|
35
|
-
subtitleColor={colors.medium}
|
|
36
|
-
title={title}
|
|
37
|
-
subtitle={subtitle}
|
|
38
|
-
multilineSubtitle={multilineSubtitle}
|
|
39
|
-
image={image}
|
|
40
|
-
right={() => (
|
|
41
|
-
<Icon
|
|
42
|
-
name={icon}
|
|
43
|
-
size={
|
|
44
|
-
multilineSubtitle
|
|
45
|
-
? Config.rowMultiLineIconSize
|
|
46
|
-
: Config.rowSingleLineIconSize
|
|
47
|
-
}
|
|
48
|
-
color={colors.light}
|
|
49
|
-
style={{
|
|
50
|
-
marginLeft: 16,
|
|
51
|
-
alignSelf: multilineSubtitle ? "flex-start" : "center",
|
|
52
|
-
marginTop: multilineSubtitle ? 4 : 0,
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
)}
|
|
56
|
-
style={style}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export default withTheme(RowHeadlineImageIcon);
|