@jobber/components-native 0.56.2 → 0.57.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/dist/package.json +4 -4
- package/dist/src/Button/Button.js +2 -2
- package/dist/src/Button/Button.style.js +2 -2
- package/dist/src/Card/Card.js +7 -8
- package/dist/src/InputCurrency/InputCurrency.js +16 -17
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
- package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +6 -6
- package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -2
- package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -3
- package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -4
- package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +1 -1
- package/dist/types/src/FormField/FormField.d.ts +2 -2
- package/dist/types/src/FormatFile/FormatFile.d.ts +6 -6
- package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +6 -6
- package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +4 -4
- package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +6 -6
- package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +3 -3
- package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
- package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +12 -12
- package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +14 -14
- package/dist/types/src/InputPassword/InputPassword.d.ts +1 -1
- package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +1 -1
- package/dist/types/src/Toast/Toast.d.ts +1 -1
- package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
- package/jestSetup.js +2 -0
- package/package.json +4 -4
- package/src/ActionItem/ActionItem.tsx +2 -0
- package/src/ActionItem/ActionItemGroup.tsx +1 -0
- package/src/AutoLink/hooks/useCreateLinkedText.ts +1 -0
- package/src/AutoLink/hooks/useTokenGenerator.ts +1 -0
- package/src/BottomSheet/BottomSheet.tsx +3 -3
- package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +3 -1
- package/src/Button/Button.style.ts +2 -2
- package/src/Button/Button.test.tsx +2 -2
- package/src/Button/Button.tsx +2 -2
- package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -0
- package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +7 -6
- package/src/Card/Card.tsx +31 -32
- package/src/Card/components/InternalCardHeader.tsx +1 -0
- package/src/Checkbox/CheckboxGroup.tsx +12 -2
- package/src/Chip/Chip.tsx +2 -0
- package/src/Content/Content.test.tsx +1 -0
- package/src/Content/Content.tsx +1 -0
- package/src/ContentOverlay/ContentOverlay.test.tsx +1 -0
- package/src/Divider/Divider.tsx +1 -0
- package/src/EmptyState/EmptyState.tsx +2 -2
- package/src/Flex/Flex.styles.tsx +1 -0
- package/src/Flex/Flex.test.tsx +2 -0
- package/src/Form/Form.test.tsx +19 -14
- package/src/Form/components/FormBody/FormBody.tsx +4 -3
- package/src/Form/components/FormCache/FormCache.tsx +5 -4
- package/src/Form/components/FormMessage/FormMessage.tsx +1 -0
- package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -1
- package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +5 -5
- package/src/Form/context/AtlantisFormContext.tsx +1 -0
- package/src/Form/hooks/useFormViewRefs.ts +1 -0
- package/src/Form/hooks/useOfflineHandler.ts +1 -0
- package/src/Form/hooks/useScrollToError/useScrollToError.ts +2 -0
- package/src/FormField/FormField.test.tsx +6 -8
- package/src/FormField/FormField.tsx +2 -2
- package/src/FormatFile/FormatFile.tsx +15 -14
- package/src/FormatFile/components/FileView/FileView.tsx +9 -6
- package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +4 -4
- package/src/FormatFile/components/MediaView/MediaView.tsx +15 -14
- package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +3 -3
- package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -0
- package/src/Icon/Icon.tsx +1 -0
- package/src/InputCurrency/InputCurrency.tsx +40 -38
- package/src/InputCurrency/utils.ts +9 -0
- package/src/InputDate/InputDate.test.tsx +1 -0
- package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -0
- package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +12 -12
- package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +14 -14
- package/src/InputNumber/InputNumber.tsx +8 -0
- package/src/InputPassword/InputPassword.test.tsx +1 -0
- package/src/InputPassword/InputPassword.tsx +2 -1
- package/src/InputPressable/InputPressable.test.tsx +1 -0
- package/src/InputSearch/InputSearch.tsx +1 -0
- package/src/InputText/context/InputAccessoriesProvider.test.tsx +6 -1
- package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
- package/src/InputTime/utils/index.ts +1 -0
- package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
- package/src/Menu/utils.ts +1 -0
- package/src/ProgressBar/ProgressBarInner.tsx +1 -0
- package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -0
- package/src/Select/components/SelectInternalPicker/utils.ts +1 -0
- package/src/StatusLabel/StatusLabel.tsx +1 -1
- package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -0
- package/src/Text/Text.tsx +1 -0
- package/src/Toast/Toast.tsx +2 -1
- package/src/Typography/Typography.tsx +5 -0
- package/src/hooks/useAtlantisI18n/utils/dateFormatter.ts +1 -0
- package/src/hooks/useFormController.ts +2 -0
- package/src/utils/intl/capitalize.ts +1 -0
- package/src/utils/test/MockSafeAreaProvider.tsx +3 -3
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"build:clean": "rm -rf ./dist"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jobber/design": "^0.55.
|
|
40
|
-
"@jobber/hooks": "^2.9.
|
|
39
|
+
"@jobber/design": "^0.55.1",
|
|
40
|
+
"@jobber/hooks": "^2.9.1",
|
|
41
41
|
"@react-native-clipboard/clipboard": "^1.11.2",
|
|
42
42
|
"@react-native-picker/picker": "^2.4.10",
|
|
43
43
|
"autolinker": "^4.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"react-native-reanimated": "^2.17.0",
|
|
85
85
|
"react-native-safe-area-context": "^4.5.2"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "0efee497cd920eccd458d96cbb17e9cc67e3cc6b"
|
|
88
88
|
}
|
|
@@ -39,7 +39,7 @@ function getActionLabelVariation(variation, type) {
|
|
|
39
39
|
}
|
|
40
40
|
switch (variation) {
|
|
41
41
|
case "learning":
|
|
42
|
-
return "
|
|
42
|
+
return "subtle";
|
|
43
43
|
case "destructive":
|
|
44
44
|
return "destructive";
|
|
45
45
|
case "cancel":
|
|
@@ -57,7 +57,7 @@ function getIconColorVariation(variation, type, disabled) {
|
|
|
57
57
|
}
|
|
58
58
|
switch (variation) {
|
|
59
59
|
case "learning":
|
|
60
|
-
return "
|
|
60
|
+
return "interactiveSubtle";
|
|
61
61
|
case "destructive":
|
|
62
62
|
return "destructive";
|
|
63
63
|
case "cancel":
|
|
@@ -63,8 +63,8 @@ export const styles = StyleSheet.create({
|
|
|
63
63
|
borderColor: tokens["color-interactive"],
|
|
64
64
|
},
|
|
65
65
|
learning: {
|
|
66
|
-
backgroundColor: tokens["color-
|
|
67
|
-
borderColor: tokens["color-
|
|
66
|
+
backgroundColor: tokens["color-interactive--subtle"],
|
|
67
|
+
borderColor: tokens["color-interactive--subtle"],
|
|
68
68
|
},
|
|
69
69
|
destructive: {
|
|
70
70
|
backgroundColor: tokens["color-destructive"],
|
package/dist/src/Card/Card.js
CHANGED
|
@@ -16,14 +16,13 @@ export function Card({ header, footer, children, reportCardHeight: onCardHeightC
|
|
|
16
16
|
var _a, _b;
|
|
17
17
|
return (React.createElement(ErrorMessageWrapper, { message: error, wrapFor: "card" },
|
|
18
18
|
React.createElement(View, { onLayout: handleLayoutChange, style: [styles.container, getElevationStyle(elevation)], testID: testID },
|
|
19
|
-
header && (React.createElement(
|
|
20
|
-
React.createElement(
|
|
21
|
-
React.createElement(
|
|
22
|
-
|
|
23
|
-
React.createElement(View, { style: styles.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
((_b = header.actionItem) === null || _b === void 0 ? void 0 : _b.iconName) && (React.createElement(Icon, { name: header.actionItem.iconName, color: "interactive" })))))),
|
|
19
|
+
header && (React.createElement(InternalCardHeader, { onPress: header.onPress, testID: `${testID}Header`, collapsable: !!children },
|
|
20
|
+
React.createElement(View, { style: styles.headerTitle },
|
|
21
|
+
React.createElement(Typography, { color: "heading", fontFamily: "base", fontWeight: "bold", size: "default", lineHeight: "base", accessibilityRole: "header" }, header.title)),
|
|
22
|
+
React.createElement(View, { style: styles.actionItem },
|
|
23
|
+
!!((_a = header.actionItem) === null || _a === void 0 ? void 0 : _a.label) && (React.createElement(View, { style: styles.actionLabel },
|
|
24
|
+
React.createElement(ActionLabel, { type: "cardTitle" }, header.actionItem.label))),
|
|
25
|
+
((_b = header.actionItem) === null || _b === void 0 ? void 0 : _b.iconName) && (React.createElement(Icon, { name: header.actionItem.iconName, color: "interactive" }))))),
|
|
27
26
|
children,
|
|
28
27
|
footer && (React.createElement(Pressable, { testID: `${testID}Footer`, onPress: footer.onPress, style: ({ pressed }) => [
|
|
29
28
|
styles.footer,
|
|
@@ -73,21 +73,20 @@ export function InputCurrency(props) {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
const { t } = useAtlantisI18n();
|
|
76
|
-
return (React.createElement(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} }))));
|
|
76
|
+
return (React.createElement(InputText, Object.assign({}, props, { prefix: showCurrencySymbol ? { label: currencySymbol } : undefined, keyboard: getKeyboard(props), value: ((_a = props.value) === null || _a === void 0 ? void 0 : _a.toString()) || displayValue, defaultValue: (_b = props.defaultValue) === null || _b === void 0 ? void 0 : _b.toString(), onChangeText: handleChange, transform: {
|
|
77
|
+
output: val => {
|
|
78
|
+
return val === null || val === void 0 ? void 0 : val.split(floatSeparators.group).join("").replace(floatSeparators.decimal, ".");
|
|
79
|
+
},
|
|
80
|
+
}, validations: Object.assign({ pattern: {
|
|
81
|
+
value: NUMBER_VALIDATION_REGEX,
|
|
82
|
+
message: t("errors.notANumber"),
|
|
83
|
+
} }, props.validations), onBlur: () => {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
86
|
+
if (field.value === 0 ||
|
|
87
|
+
field.value === "" ||
|
|
88
|
+
field.value === undefined) {
|
|
89
|
+
setDisplayValue("0");
|
|
90
|
+
}
|
|
91
|
+
} })));
|
|
93
92
|
}
|