@draftbit/core 44.2.3-c421ea.2 → 46.0.1-125de2.1
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/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/components/AnimatedCircularProgress.js.map +1 -1
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/AvatarEdit.js.map +1 -1
- package/lib/commonjs/components/Banner.js.map +1 -1
- package/lib/commonjs/components/Card.js.map +1 -1
- package/lib/commonjs/components/CardBlock.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/CardContainerRating.js.map +1 -1
- package/lib/commonjs/components/CardContainerShortImage.js.map +1 -1
- package/lib/commonjs/components/CardInline.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +1 -3
- package/lib/commonjs/components/Carousel.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/components/CircleImage.js.map +1 -1
- package/lib/commonjs/components/CircularProgress.js.map +1 -1
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +3 -3
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
- package/lib/commonjs/components/Divider.js.map +1 -1
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/HeaderLarge.js.map +1 -1
- package/lib/commonjs/components/HeaderMedium.js.map +1 -1
- package/lib/commonjs/components/HeaderOverline.js.map +1 -1
- package/lib/commonjs/components/IconButton.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +3 -3
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +2 -2
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +2 -2
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/Portal/Portal.js.map +1 -1
- package/lib/commonjs/components/ProgressCircle.js.map +1 -1
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/components/Surface.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js.map +1 -1
- package/lib/commonjs/interfaces/Icon.js.map +1 -1
- package/lib/commonjs/mappings/KeyboardAvoidingView.js +2 -2
- package/lib/commonjs/mappings/KeyboardAvoidingView.js.map +1 -1
- package/lib/module/Provider.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/AnimatedCircularProgress.js.map +1 -1
- package/lib/module/components/AspectRatio.js.map +1 -1
- package/lib/module/components/AvatarEdit.js.map +1 -1
- package/lib/module/components/Banner.js.map +1 -1
- package/lib/module/components/Card.js.map +1 -1
- package/lib/module/components/CardBlock.js.map +1 -1
- package/lib/module/components/CardContainer.js.map +1 -1
- package/lib/module/components/CardContainerRating.js.map +1 -1
- package/lib/module/components/CardContainerShortImage.js.map +1 -1
- package/lib/module/components/CardInline.js.map +1 -1
- package/lib/module/components/Carousel.js +1 -3
- package/lib/module/components/Carousel.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/CircleImage.js.map +1 -1
- package/lib/module/components/CircularProgress.js.map +1 -1
- package/lib/module/components/Container.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/DatePicker/DatePickerComponent.js.map +1 -1
- package/lib/module/components/DatePicker/DatePickerComponent.web.js +3 -3
- package/lib/module/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/module/components/DeprecatedButton.js.map +1 -1
- package/lib/module/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/module/components/DeprecatedFAB.js.map +1 -1
- package/lib/module/components/Divider.js.map +1 -1
- package/lib/module/components/Elevation.js.map +1 -1
- package/lib/module/components/FAB.js.map +1 -1
- package/lib/module/components/FieldSearchBarFull.js.map +1 -1
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/HeaderLarge.js.map +1 -1
- package/lib/module/components/HeaderMedium.js.map +1 -1
- package/lib/module/components/HeaderOverline.js.map +1 -1
- package/lib/module/components/IconButton.js.map +1 -1
- package/lib/module/components/Picker/Picker.js +3 -3
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +2 -2
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +2 -2
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.web.js +2 -2
- package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/module/components/Portal/Portal.js.map +1 -1
- package/lib/module/components/ProgressCircle.js.map +1 -1
- package/lib/module/components/ProgressIndicator.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButton.js +1 -1
- package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/module/components/RadioButton/RadioButtonRow.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/RowHeadlineImageCaption.js.map +1 -1
- package/lib/module/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/module/components/StarRating.js.map +1 -1
- package/lib/module/components/Stepper.js +1 -1
- package/lib/module/components/Stepper.js.map +1 -1
- package/lib/module/components/Surface.js.map +1 -1
- package/lib/module/components/Swiper/Swiper.js.map +1 -1
- package/lib/module/components/ToggleButton.js.map +1 -1
- package/lib/module/interfaces/Icon.js.map +1 -1
- package/lib/module/mappings/KeyboardAvoidingView.js +2 -2
- package/lib/module/mappings/KeyboardAvoidingView.js.map +1 -1
- package/lib/typescript/src/components/Accordion/AccordionGroup.d.ts +2 -3022
- package/lib/typescript/src/components/Accordion/AccordionItem.d.ts +2 -3010
- package/lib/typescript/src/components/ActionSheet/ActionSheetCancel.d.ts +1 -1
- package/lib/typescript/src/components/ActionSheet/ActionSheetItem.d.ts +1 -1
- package/lib/typescript/src/components/AnimatedCircularProgress.d.ts +1 -1
- package/lib/typescript/src/components/AspectRatio.d.ts +1 -1
- package/lib/typescript/src/components/AvatarEdit.d.ts +2 -2
- package/lib/typescript/src/components/Banner.d.ts +2 -2
- package/lib/typescript/src/components/Card.d.ts +2 -2
- package/lib/typescript/src/components/CardBlock.d.ts +2 -2
- package/lib/typescript/src/components/CardContainer.d.ts +2 -2
- package/lib/typescript/src/components/CardContainerRating.d.ts +2 -2
- package/lib/typescript/src/components/CardContainerShortImage.d.ts +2 -2
- package/lib/typescript/src/components/CardInline.d.ts +2 -2
- package/lib/typescript/src/components/Carousel.d.ts +4 -7
- package/lib/typescript/src/components/CircleImage.d.ts +1 -1
- package/lib/typescript/src/components/Container.d.ts +2 -2
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +2 -2
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.d.ts +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedCardWrapper.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/Divider.d.ts +2 -2
- package/lib/typescript/src/components/Elevation.d.ts +2 -2
- package/lib/typescript/src/components/FAB.d.ts +2 -2
- package/lib/typescript/src/components/FieldSearchBarFull.d.ts +2 -2
- package/lib/typescript/src/components/Header.d.ts +2 -2
- package/lib/typescript/src/components/HeaderLarge.d.ts +2 -2
- package/lib/typescript/src/components/HeaderMedium.d.ts +2 -2
- package/lib/typescript/src/components/HeaderOverline.d.ts +2 -2
- package/lib/typescript/src/components/IconButton.d.ts +2 -2
- package/lib/typescript/src/components/ProgressCircle.d.ts +2 -2
- package/lib/typescript/src/components/ProgressIndicator.d.ts +2 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonFieldGroup.d.ts +2 -2
- package/lib/typescript/src/components/Row.d.ts +2 -2
- package/lib/typescript/src/components/RowBodyIcon.d.ts +2 -2
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +2 -2
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +2 -2
- package/lib/typescript/src/components/Slider.d.ts +2 -3032
- package/lib/typescript/src/components/StarRating.d.ts +2 -2
- package/lib/typescript/src/components/Surface.d.ts +2 -2
- package/lib/typescript/src/components/Switch.d.ts +2 -3018
- package/lib/typescript/src/components/ToggleButton.d.ts +2 -2
- package/lib/typescript/src/interfaces/Icon.d.ts +1 -3
- package/package.json +4 -4
- package/src/Provider.tsx +1 -0
- package/src/components/ActionSheet/ActionSheetCancel.tsx +1 -1
- package/src/components/ActionSheet/ActionSheetItem.js +1 -1
- package/src/components/ActionSheet/ActionSheetItem.tsx +6 -1
- package/src/components/AnimatedCircularProgress.tsx +1 -1
- package/src/components/AspectRatio.tsx +1 -1
- package/src/components/AvatarEdit.tsx +1 -1
- package/src/components/Banner.tsx +1 -1
- package/src/components/Card.tsx +1 -1
- package/src/components/CardBlock.tsx +1 -1
- package/src/components/CardContainer.tsx +1 -1
- package/src/components/CardContainerRating.tsx +1 -1
- package/src/components/CardContainerShortImage.tsx +1 -1
- package/src/components/CardInline.tsx +1 -1
- package/src/components/Carousel.tsx +2 -1
- package/src/components/Checkbox/Checkbox.tsx +76 -77
- package/src/components/CircleImage.tsx +1 -1
- package/src/components/CircularProgress.tsx +1 -0
- package/src/components/Container.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +1 -1
- package/src/components/DatePicker/DatePickerComponent.tsx +1 -1
- package/src/components/DeprecatedButton.tsx +1 -1
- package/src/components/DeprecatedCardWrapper.tsx +1 -1
- package/src/components/DeprecatedFAB.tsx +1 -1
- package/src/components/Divider.tsx +1 -1
- package/src/components/Elevation.tsx +6 -1
- package/src/components/FAB.tsx +1 -1
- package/src/components/FieldSearchBarFull.tsx +1 -1
- package/src/components/Header.tsx +1 -1
- package/src/components/HeaderLarge.tsx +1 -1
- package/src/components/HeaderMedium.tsx +1 -1
- package/src/components/HeaderOverline.tsx +1 -1
- package/src/components/IconButton.tsx +1 -1
- package/src/components/Portal/Portal.tsx +1 -0
- package/src/components/ProgressCircle.tsx +2 -1
- package/src/components/ProgressIndicator.tsx +1 -1
- package/src/components/RadioButton/RadioButtonFieldGroup.tsx +1 -1
- package/src/components/Row.tsx +1 -1
- package/src/components/RowBodyIcon.tsx +1 -1
- package/src/components/RowHeadlineImageCaption.tsx +1 -1
- package/src/components/RowHeadlineImageIcon.tsx +1 -1
- package/src/components/StarRating.tsx +2 -2
- package/src/components/Surface.tsx +1 -1
- package/src/components/Swiper/Swiper.tsx +1 -0
- package/src/components/ToggleButton.tsx +1 -1
- package/src/interfaces/Icon.ts +1 -1
- package/src/mappings/KeyboardAvoidingView.js +2 -2
- package/src/mappings/KeyboardAvoidingView.ts +2 -2
|
@@ -18,7 +18,7 @@ declare type Props = {
|
|
|
18
18
|
style?: StyleProp<ViewStyle>;
|
|
19
19
|
theme: Theme;
|
|
20
20
|
} & IconSlot;
|
|
21
|
-
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<Props
|
|
21
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
22
22
|
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
23
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props
|
|
23
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
24
24
|
export default _default;
|
|
@@ -8,9 +8,7 @@ import React from "react";
|
|
|
8
8
|
import { ViewProps, StyleProp, ImageStyle } from "react-native";
|
|
9
9
|
import { Subtract } from "utility-types";
|
|
10
10
|
declare type Props = {
|
|
11
|
-
name: string
|
|
12
|
-
uri: string;
|
|
13
|
-
};
|
|
11
|
+
name: string;
|
|
14
12
|
color?: string;
|
|
15
13
|
size: number;
|
|
16
14
|
style?: StyleProp<ImageStyle>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "46.0.1-125de2.1+125de214",
|
|
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": "^
|
|
44
|
+
"@draftbit/types": "^46.0.0",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"lodash.isnumber": "^3.0.3",
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
|
-
"react-native-modal-datetime-picker": "^13.
|
|
55
|
+
"react-native-modal-datetime-picker": "^13.1.2",
|
|
56
56
|
"react-native-typography": "^1.4.1",
|
|
57
57
|
"react-native-web-swiper": "^2.2.3"
|
|
58
58
|
},
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
]
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "125de214a9b4bfa36ceb9f4903fcb2b6403bccfe"
|
|
82
82
|
}
|
package/src/Provider.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text, StyleSheet, TouchableOpacity, } from "react-native";
|
|
3
3
|
import { extractStyles } from "../../utilities";
|
|
4
|
-
const ActionSheetItem = ({ label, style, color, onPress }) => {
|
|
4
|
+
const ActionSheetItem = ({ label, style, color, onPress, }) => {
|
|
5
5
|
const { textStyles, viewStyles } = extractStyles(style);
|
|
6
6
|
return (React.createElement(TouchableOpacity, { activeOpacity: 0.7, style: [styles.wrapper, viewStyles], onPress: onPress },
|
|
7
7
|
React.createElement(Text, { style: [styles.label, textStyles, { color }] }, label)));
|
|
@@ -16,7 +16,12 @@ type Props = {
|
|
|
16
16
|
onPress?: () => void;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const ActionSheetItem: React.FC<Props
|
|
19
|
+
const ActionSheetItem: React.FC<React.PropsWithChildren<Props>> = ({
|
|
20
|
+
label,
|
|
21
|
+
style,
|
|
22
|
+
color,
|
|
23
|
+
onPress,
|
|
24
|
+
}) => {
|
|
20
25
|
const { textStyles, viewStyles } = extractStyles(style);
|
|
21
26
|
return (
|
|
22
27
|
<TouchableOpacity
|
|
@@ -20,7 +20,7 @@ type Props = {
|
|
|
20
20
|
onAnimationComplete?: Animated.EndCallback | undefined;
|
|
21
21
|
} & CircularProgressProps;
|
|
22
22
|
|
|
23
|
-
const AnimatedCircularProgress: React.FC<Props
|
|
23
|
+
const AnimatedCircularProgress: React.FC<React.PropsWithChildren<Props>> = ({
|
|
24
24
|
duration = 500,
|
|
25
25
|
easing = Easing.out(Easing.ease),
|
|
26
26
|
fill,
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
style?: StyleProp<ViewStyle>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const AspectRatio: React.FC<Props
|
|
15
|
+
const AspectRatio: React.FC<React.PropsWithChildren<Props>> = (props) => {
|
|
16
16
|
const [layout, setLayout] = React.useState<LayoutRectangle | null>(null);
|
|
17
17
|
const { aspectRatio = 1, ...inputStyle } =
|
|
18
18
|
StyleSheet.flatten(props.style) || {};
|
package/src/components/Card.tsx
CHANGED
|
@@ -17,6 +17,7 @@ type Props = {
|
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
style?: StyleProp<ViewStyle>;
|
|
19
19
|
dotColor?: string;
|
|
20
|
+
theme: any;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
function Pager({
|
|
@@ -54,7 +55,7 @@ function Carousel({
|
|
|
54
55
|
dotColor = "strong",
|
|
55
56
|
style,
|
|
56
57
|
...rest
|
|
57
|
-
}: Props) {
|
|
58
|
+
}: React.PropsWithChildren<Props>) {
|
|
58
59
|
const [index, setIndex] = React.useState(0);
|
|
59
60
|
|
|
60
61
|
const length = React.Children.count(children);
|
|
@@ -27,94 +27,93 @@ export interface CheckboxProps {
|
|
|
27
27
|
style?: StyleProp<ViewStyle>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const Checkbox: React.FC<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
const Checkbox: React.FC<
|
|
31
|
+
CheckboxProps & TouchableHighlightProps & IconSlot
|
|
32
|
+
> = ({
|
|
33
|
+
Icon,
|
|
34
|
+
status,
|
|
35
|
+
disabled = false,
|
|
36
|
+
onPress,
|
|
37
|
+
onCheck,
|
|
38
|
+
onUncheck,
|
|
39
|
+
color,
|
|
40
|
+
uncheckedColor,
|
|
41
|
+
defaultValue,
|
|
42
|
+
checkedIcon = "MaterialCommunityIcons/checkbox-marked",
|
|
43
|
+
uncheckedIcon = "MaterialCommunityIcons/checkbox-blank-outline",
|
|
44
|
+
size = 24,
|
|
45
|
+
style,
|
|
46
|
+
...rest
|
|
47
|
+
}) => {
|
|
48
|
+
const [internalValue, setInternalValue] = React.useState<boolean>(
|
|
49
|
+
status || defaultValue || false
|
|
50
|
+
);
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
if (status != null) {
|
|
54
|
+
setInternalValue(status);
|
|
55
|
+
}
|
|
56
|
+
}, [status]);
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| boolean
|
|
61
|
-
| undefined;
|
|
58
|
+
// This special logic is to handle weird APIs like Airtable that return
|
|
59
|
+
// true or undefined for a boolean
|
|
60
|
+
const previousDefaultValue = usePrevious(defaultValue) as boolean | undefined;
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
if (defaultValue !== previousDefaultValue) {
|
|
64
|
+
setInternalValue(Boolean(defaultValue));
|
|
65
|
+
}
|
|
66
|
+
}, [defaultValue, previousDefaultValue]);
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
const { colors } = useTheme();
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
const checkboxColor = internalValue
|
|
71
|
+
? color || colors.primary
|
|
72
|
+
: uncheckedColor || colors.primary;
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
const handlePress = () => {
|
|
75
|
+
const newValue = !internalValue;
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
setInternalValue(newValue);
|
|
78
|
+
onPress?.(newValue);
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (newValue) {
|
|
81
|
+
onCheck?.();
|
|
82
|
+
}
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
if (!newValue) {
|
|
85
|
+
onUncheck?.();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
return (
|
|
90
|
+
<Touchable
|
|
91
|
+
{...rest}
|
|
92
|
+
onPress={handlePress}
|
|
93
|
+
disabled={disabled}
|
|
94
|
+
accessibilityState={{ disabled }}
|
|
95
|
+
accessibilityRole="button"
|
|
96
|
+
accessibilityLiveRegion="polite"
|
|
97
|
+
style={[styles.container, style, { width: size, height: size }]}
|
|
98
|
+
>
|
|
99
|
+
<Icon
|
|
100
|
+
style={styles.icon}
|
|
101
|
+
name={internalValue ? checkedIcon : uncheckedIcon}
|
|
102
|
+
size={size}
|
|
103
|
+
color={checkboxColor}
|
|
104
|
+
/>
|
|
105
|
+
<View style={[StyleSheet.absoluteFill, styles.fillContainer]}>
|
|
106
|
+
<View
|
|
107
|
+
style={[
|
|
108
|
+
styles.fill,
|
|
109
|
+
{ opacity: disabled ? 0.5 : 1 },
|
|
110
|
+
{ borderColor: checkboxColor },
|
|
111
|
+
]}
|
|
105
112
|
/>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{ opacity: disabled ? 0.5 : 1 },
|
|
111
|
-
{ borderColor: checkboxColor },
|
|
112
|
-
]}
|
|
113
|
-
/>
|
|
114
|
-
</View>
|
|
115
|
-
</Touchable>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
113
|
+
</View>
|
|
114
|
+
</Touchable>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
118
117
|
|
|
119
118
|
const styles = StyleSheet.create({
|
|
120
119
|
container: {
|
|
@@ -4,7 +4,7 @@ import DateTimePicker from "@react-native-community/datetimepicker";
|
|
|
4
4
|
import DateTimePickerModal from "react-native-modal-datetime-picker";
|
|
5
5
|
import { DatePickerComponentProps as Props } from "./DatePickerComponentType";
|
|
6
6
|
|
|
7
|
-
const DatePickerComponent: React.FC<Props
|
|
7
|
+
const DatePickerComponent: React.FC<React.PropsWithChildren<Props>> = ({
|
|
8
8
|
value,
|
|
9
9
|
onChange,
|
|
10
10
|
mode,
|
|
@@ -17,7 +17,12 @@ type Props = {
|
|
|
17
17
|
} & ViewProps;
|
|
18
18
|
|
|
19
19
|
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
20
|
-
const Elevation: React.FC<Props
|
|
20
|
+
const Elevation: React.FC<React.PropsWithChildren<Props>> = ({
|
|
21
|
+
style,
|
|
22
|
+
theme,
|
|
23
|
+
children,
|
|
24
|
+
...rest
|
|
25
|
+
}) => {
|
|
21
26
|
const { elevation = 4, borderRadius: radius } =
|
|
22
27
|
StyleSheet.flatten(style) || {};
|
|
23
28
|
const { colors } = theme;
|
package/src/components/FAB.tsx
CHANGED
|
@@ -18,7 +18,7 @@ type Props = {
|
|
|
18
18
|
theme: typeof themeT;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const ProgressCircle: React.FC<Props
|
|
21
|
+
const ProgressCircle: React.FC<React.PropsWithChildren<Props>> = ({
|
|
22
22
|
progress = 0.5,
|
|
23
23
|
style,
|
|
24
24
|
color = "primary",
|
|
@@ -47,6 +47,7 @@ const ProgressCircle: React.FC<Props> = ({
|
|
|
47
47
|
lineCap={strokeCap}
|
|
48
48
|
style={style}
|
|
49
49
|
>
|
|
50
|
+
{/* @ts-ignore */}
|
|
50
51
|
{(fill) =>
|
|
51
52
|
showsText ? (
|
|
52
53
|
<Text
|
package/src/components/Row.tsx
CHANGED