@jobber/components-native 0.74.1-node22-3bf0edd.11 → 0.75.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/dist/package.json +2 -2
- package/dist/src/Disclosure/Disclosure.js +2 -2
- package/dist/src/Divider/Divider.js +9 -6
- package/dist/src/Divider/{Divider.style.js → DividerHorizontal.style.js} +9 -4
- package/dist/src/Divider/DividerVertical.style.js +26 -0
- package/dist/src/Form/components/FormCache/FormCache.js +0 -2
- package/dist/src/FormatFile/components/_mocks/mockFiles.js +1 -1
- package/dist/src/Heading/Heading.js +2 -2
- package/dist/src/Text/Text.js +2 -2
- package/dist/src/Typography/Typography.js +2 -4
- package/dist/src/utils/test/wait.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/ActionLabel/ActionLabel.d.ts +0 -1
- package/dist/types/src/ActivityIndicator/ActivityIndicator.d.ts +0 -1
- package/dist/types/src/AtlantisContext/AtlantisContext.d.ts +0 -1
- package/dist/types/src/AutoLink/AutoLink.d.ts +0 -1
- package/dist/types/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.d.ts +0 -1
- package/dist/types/src/AutoLink/components/Link/Link.d.ts +0 -1
- package/dist/types/src/Banner/Banner.d.ts +0 -1
- package/dist/types/src/Banner/components/BannerIcon/BannerIcon.d.ts +0 -1
- package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +0 -1
- package/dist/types/src/Button/Button.d.ts +0 -1
- package/dist/types/src/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/dist/types/src/ButtonGroup/ButtonGroupAction.d.ts +0 -1
- package/dist/types/src/Checkbox/Checkbox.d.ts +0 -1
- package/dist/types/src/Checkbox/CheckboxGroup.d.ts +0 -1
- package/dist/types/src/Chip/Chip.d.ts +0 -1
- package/dist/types/src/ContentOverlay/ContentOverlay.d.ts +3 -2
- package/dist/types/src/Divider/Divider.d.ts +12 -4
- package/dist/types/src/Divider/{Divider.style.d.ts → DividerHorizontal.style.d.ts} +7 -2
- package/dist/types/src/Divider/DividerVertical.style.d.ts +24 -0
- package/dist/types/src/EmptyState/EmptyState.d.ts +0 -1
- package/dist/types/src/ErrorMessageWrapper/context/ErrorMessageContext.d.ts +0 -1
- package/dist/types/src/Form/Form.d.ts +0 -1
- package/dist/types/src/Form/components/FormActionBar/FormActionBar.d.ts +0 -1
- package/dist/types/src/Form/components/FormBody/FormBody.d.ts +0 -1
- package/dist/types/src/Form/components/FormCache/FormCache.d.ts +0 -1
- package/dist/types/src/Form/components/FormErrorBanner/FormErrorBanner.d.ts +0 -1
- package/dist/types/src/Form/components/FormMask/FormMask.d.ts +0 -1
- package/dist/types/src/Form/components/FormMessage/FormMessage.d.ts +0 -2
- package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +0 -1
- package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +0 -1
- package/dist/types/src/Form/components/FormSaveButton/FormSaveButton.d.ts +0 -1
- package/dist/types/src/Form/context/AtlantisFormContext.d.ts +0 -1
- package/dist/types/src/FormatFile/FormatFile.d.ts +0 -1
- package/dist/types/src/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +0 -1
- package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +0 -1
- package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +0 -1
- package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +0 -2
- package/dist/types/src/FormatFile/components/_mocks/mockFiles.d.ts +4 -4
- package/dist/types/src/FormatFile/context/FormatFileContext.d.ts +0 -1
- package/dist/types/src/Glimmer/Glimmer.d.ts +0 -1
- package/dist/types/src/Heading/Heading.d.ts +0 -1
- package/dist/types/src/Icon/Icon.d.ts +0 -1
- package/dist/types/src/InputCurrency/InputCurrency.d.ts +0 -1
- package/dist/types/src/InputDate/InputDate.d.ts +0 -1
- package/dist/types/src/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +0 -1
- package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +0 -1
- package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +0 -1
- package/dist/types/src/InputSearch/components/FilterButton.d.ts +0 -1
- package/dist/types/src/InputText/context/InputAccessoriesContext.d.ts +0 -1
- package/dist/types/src/InputTime/InputTime.d.ts +0 -1
- package/dist/types/src/Menu/Menu.d.ts +0 -1
- package/dist/types/src/Menu/components/MenuOption/MenuOption.d.ts +0 -1
- package/dist/types/src/Menu/components/Overlay/Overlay.d.ts +0 -1
- package/dist/types/src/Menu/types.d.ts +0 -1
- package/dist/types/src/ProgressBar/ProgressBar.d.ts +0 -1
- package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +0 -1
- package/dist/types/src/ProgressBar/ProgressBarStepped.d.ts +0 -1
- package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +0 -1
- package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +0 -1
- package/dist/types/src/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +0 -1
- package/dist/types/src/Select/components/SelectPressable/SelectPressable.d.ts +0 -1
- package/dist/types/src/StatusLabel/StatusLabel.d.ts +0 -1
- package/dist/types/src/Switch/Switch.d.ts +0 -1
- package/dist/types/src/Switch/components/BaseSwitch/BaseSwitch.d.ts +0 -1
- package/dist/types/src/Text/Text.d.ts +0 -1
- package/dist/types/src/TextList/TextList.d.ts +0 -1
- package/dist/types/src/ThumbnailList/ThumbnailList.d.ts +0 -1
- package/dist/types/src/Toast/Toast.d.ts +0 -1
- package/package.json +2 -2
- package/src/Divider/Divider.test.tsx +58 -19
- package/src/Divider/Divider.tsx +25 -7
- package/src/Divider/{Divider.style.ts → DividerHorizontal.style.ts} +9 -4
- package/src/Divider/DividerVertical.style.ts +27 -0
- package/src/Form/components/FormCache/FormCache.tsx +0 -2
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"react-native-safe-area-context": "^4.5.2",
|
|
80
80
|
"react-native-svg": ">=12.0.0"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "621a745c5403d89930eca6ab091bc64ad8c8f5e4"
|
|
83
83
|
}
|
|
@@ -9,8 +9,8 @@ const ReanimatedView = Reanimated.View;
|
|
|
9
9
|
const ReanimatedScrollView = Reanimated.ScrollView;
|
|
10
10
|
export function Disclosure({ content, header, open, onToggle, isEmpty, animationDuration = tokens["timing-slowest"], }) {
|
|
11
11
|
return (React.createElement(View, { style: styles.container },
|
|
12
|
-
React.createElement(DisclosureHeader,
|
|
13
|
-
React.createElement(DisclosureContent,
|
|
12
|
+
React.createElement(DisclosureHeader, { header, onToggle, isEmpty, open, animationDuration }),
|
|
13
|
+
React.createElement(DisclosureContent, { content, open, animationDuration })));
|
|
14
14
|
}
|
|
15
15
|
function DisclosureHeader({ header, onToggle, isEmpty, open, animationDuration, }) {
|
|
16
16
|
const rotateZ = useSharedValue(0);
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { horizontalStyles } from "./DividerHorizontal.style";
|
|
4
|
+
import { verticalStyles } from "./DividerVertical.style";
|
|
5
|
+
export function Divider({ size = "base", direction = "horizontal", testID = "Divider", }) {
|
|
6
|
+
const directionalStyles = direction === "horizontal" ? horizontalStyles : verticalStyles;
|
|
5
7
|
const style = [
|
|
6
|
-
|
|
7
|
-
size === "large" &&
|
|
8
|
-
size === "
|
|
8
|
+
directionalStyles.base,
|
|
9
|
+
size === "large" && directionalStyles.large,
|
|
10
|
+
size === "larger" && directionalStyles.larger,
|
|
11
|
+
size === "largest" && directionalStyles.largest,
|
|
9
12
|
];
|
|
10
|
-
return React.createElement(View, { testID:
|
|
13
|
+
return React.createElement(View, { testID: testID, style: style });
|
|
11
14
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { tokens } from "../utils/design";
|
|
3
|
-
export const
|
|
3
|
+
export const horizontalStyles = StyleSheet.create({
|
|
4
4
|
base: {
|
|
5
|
-
height:
|
|
5
|
+
height: 1,
|
|
6
6
|
margin: 0,
|
|
7
|
-
|
|
7
|
+
width: "auto",
|
|
8
8
|
borderBottomColor: tokens["color-border"],
|
|
9
|
+
borderBottomWidth: tokens["border-base"],
|
|
9
10
|
},
|
|
10
11
|
large: {
|
|
11
12
|
borderBottomWidth: tokens["border-thick"],
|
|
12
13
|
opacity: 0.875,
|
|
13
14
|
},
|
|
15
|
+
larger: {
|
|
16
|
+
borderBottomWidth: tokens["border-thicker"],
|
|
17
|
+
opacity: 0.625,
|
|
18
|
+
},
|
|
14
19
|
largest: {
|
|
15
|
-
borderBottomWidth: tokens["
|
|
20
|
+
borderBottomWidth: tokens["border-thickest"],
|
|
16
21
|
opacity: 0.375,
|
|
17
22
|
},
|
|
18
23
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { tokens } from "../utils/design";
|
|
3
|
+
export const verticalStyles = StyleSheet.create({
|
|
4
|
+
base: {
|
|
5
|
+
margin: 0,
|
|
6
|
+
height: "100%",
|
|
7
|
+
width: 1,
|
|
8
|
+
borderRightWidth: tokens["border-base"],
|
|
9
|
+
borderRightColor: tokens["color-border"],
|
|
10
|
+
},
|
|
11
|
+
large: {
|
|
12
|
+
borderRightWidth: tokens["border-thick"],
|
|
13
|
+
opacity: 0.875,
|
|
14
|
+
},
|
|
15
|
+
larger: {
|
|
16
|
+
borderRightWidth: tokens["border-thicker"],
|
|
17
|
+
opacity: 0.625,
|
|
18
|
+
},
|
|
19
|
+
largest: {
|
|
20
|
+
borderRightWidth: tokens["border-thickest"],
|
|
21
|
+
opacity: 0.375,
|
|
22
|
+
},
|
|
23
|
+
vertical: {
|
|
24
|
+
borderRightColor: tokens["color-border"],
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -25,8 +25,6 @@ export function FormCache({ localCacheExclude, localCacheKey, setLocalCache, })
|
|
|
25
25
|
setLocalCache(omit(formData, localCacheExclude));
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
// @ts-expect-error Typescript thinks that the FieldValues defined in useWatch is different
|
|
29
|
-
// from the one in useFormContext
|
|
30
28
|
setLocalCache(formData);
|
|
31
29
|
}
|
|
32
30
|
}, [formData, isDirty, localCacheExclude, setLocalCache, shouldExclude]);
|
|
@@ -59,7 +59,7 @@ export const FILE_MOCK_VIDEO = {
|
|
|
59
59
|
fileName: "some_file.mp4",
|
|
60
60
|
fileSize: 1,
|
|
61
61
|
contentType: "video",
|
|
62
|
-
url: undefined,
|
|
62
|
+
url: undefined, //undefined to prevent thumbnail errors
|
|
63
63
|
thumbnailUrl: "path/to/fileThumbnail.mp4",
|
|
64
64
|
};
|
|
65
65
|
export const FILE_MOCK_FILE = {
|
|
@@ -10,11 +10,11 @@ export const HEADING_MAX_SCALED_FONT_SIZE = {
|
|
|
10
10
|
export function Heading({ children, level, variation = "heading", reverseTheme = false, align, maxLines = "unlimited", allowFontScaling = true, selectable, }) {
|
|
11
11
|
const headingStyle = getHeadingStyle(level, variation);
|
|
12
12
|
const accessibilityRole = "header";
|
|
13
|
-
return (React.createElement(Typography, Object.assign({},
|
|
13
|
+
return (React.createElement(Typography, Object.assign({}, headingStyle, { accessibilityRole,
|
|
14
14
|
reverseTheme,
|
|
15
15
|
align,
|
|
16
16
|
maxLines,
|
|
17
|
-
allowFontScaling
|
|
17
|
+
allowFontScaling, maxFontScaleSize: HEADING_MAX_SCALED_FONT_SIZE[level], selectable: selectable }), children));
|
|
18
18
|
}
|
|
19
19
|
function getHeadingStyle(level = "heading", variation) {
|
|
20
20
|
const headingLevelToStyle = {
|
package/dist/src/Text/Text.js
CHANGED
|
@@ -18,7 +18,7 @@ export const TEXT_MAX_SCALED_FONT_SIZES = {
|
|
|
18
18
|
};
|
|
19
19
|
export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, underline, selectable, }) {
|
|
20
20
|
const accessibilityRole = "text";
|
|
21
|
-
return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable, underline: underline },
|
|
21
|
+
return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable, underline: underline }, levelStyles[level], { allowFontScaling,
|
|
22
22
|
align,
|
|
23
23
|
adjustsFontSizeToFit,
|
|
24
24
|
accessibilityRole,
|
|
@@ -26,7 +26,7 @@ export function Text({ level = "text", variation = "base", emphasis, allowFontSc
|
|
|
26
26
|
maxLines,
|
|
27
27
|
strikeThrough,
|
|
28
28
|
italic,
|
|
29
|
-
hideFromScreenReader })
|
|
29
|
+
hideFromScreenReader }), children));
|
|
30
30
|
}
|
|
31
31
|
function getFontWeight({ level, emphasis, }) {
|
|
32
32
|
if (emphasis === "strong")
|
|
@@ -43,12 +43,10 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
|
|
|
43
43
|
}
|
|
44
44
|
: { accessibilityRole };
|
|
45
45
|
return (React.createElement(TypographyGestureDetector, null,
|
|
46
|
-
React.createElement(Text, Object.assign({
|
|
47
|
-
allowFontScaling,
|
|
46
|
+
React.createElement(Text, Object.assign({ allowFontScaling,
|
|
48
47
|
adjustsFontSizeToFit,
|
|
49
48
|
style,
|
|
50
|
-
numberOfLines: numberOfLinesForNativeText,
|
|
51
|
-
}, accessibilityProps, { maxFontSizeMultiplier: getScaleMultiplier(maxFontScaleSize, sizeAndHeight.fontSize), selectable: selectable, selectionColor: tokens["color-brand--highlight"] }), text)));
|
|
49
|
+
numberOfLines: numberOfLinesForNativeText }, accessibilityProps, { maxFontSizeMultiplier: getScaleMultiplier(maxFontScaleSize, sizeAndHeight.fontSize), selectable: selectable, selectionColor: tokens["color-brand--highlight"] }), text)));
|
|
52
50
|
}
|
|
53
51
|
function getScaleMultiplier(maxFontScaleSize = 0, size = 1) {
|
|
54
52
|
if (maxFontScaleSize === 0)
|
|
@@ -17,8 +17,8 @@ import { act } from "react-test-renderer";
|
|
|
17
17
|
* to get the mock result of the query
|
|
18
18
|
* @param milliseconds time to wait in milliseconds
|
|
19
19
|
*/
|
|
20
|
-
export function wait(
|
|
21
|
-
return __awaiter(this,
|
|
20
|
+
export function wait() {
|
|
21
|
+
return __awaiter(this, arguments, void 0, function* (milliseconds = 0) {
|
|
22
22
|
yield new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
23
23
|
});
|
|
24
24
|
}
|