@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/src/Divider/Divider.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { horizontalStyles } from "./DividerHorizontal.style";
|
|
4
|
+
import { verticalStyles } from "./DividerVertical.style";
|
|
4
5
|
|
|
5
6
|
interface DividerProps {
|
|
6
7
|
/**
|
|
@@ -8,15 +9,32 @@ interface DividerProps {
|
|
|
8
9
|
*
|
|
9
10
|
* @default "base"
|
|
10
11
|
*/
|
|
11
|
-
readonly size?:
|
|
12
|
+
readonly size?: "base" | "large" | "larger" | "largest";
|
|
13
|
+
/**
|
|
14
|
+
* The direction of the divider
|
|
15
|
+
*
|
|
16
|
+
* @default "horizontal"
|
|
17
|
+
*/
|
|
18
|
+
readonly direction?: "horizontal" | "vertical";
|
|
19
|
+
/**
|
|
20
|
+
* Used to locate this view in end-to-end tests.
|
|
21
|
+
*/
|
|
22
|
+
readonly testID?: string;
|
|
12
23
|
}
|
|
13
24
|
|
|
14
|
-
export function Divider({
|
|
25
|
+
export function Divider({
|
|
26
|
+
size = "base",
|
|
27
|
+
direction = "horizontal",
|
|
28
|
+
testID = "Divider",
|
|
29
|
+
}: DividerProps): JSX.Element {
|
|
30
|
+
const directionalStyles =
|
|
31
|
+
direction === "horizontal" ? horizontalStyles : verticalStyles;
|
|
15
32
|
const style = [
|
|
16
|
-
|
|
17
|
-
size === "large" &&
|
|
18
|
-
size === "
|
|
33
|
+
directionalStyles.base,
|
|
34
|
+
size === "large" && directionalStyles.large,
|
|
35
|
+
size === "larger" && directionalStyles.larger,
|
|
36
|
+
size === "largest" && directionalStyles.largest,
|
|
19
37
|
];
|
|
20
38
|
|
|
21
|
-
return <View testID=
|
|
39
|
+
return <View testID={testID} style={style} />;
|
|
22
40
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { tokens } from "../utils/design";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const horizontalStyles = StyleSheet.create({
|
|
5
5
|
base: {
|
|
6
|
-
height:
|
|
6
|
+
height: 1,
|
|
7
7
|
margin: 0,
|
|
8
|
-
|
|
8
|
+
width: "auto",
|
|
9
9
|
borderBottomColor: tokens["color-border"],
|
|
10
|
+
borderBottomWidth: tokens["border-base"],
|
|
10
11
|
},
|
|
11
12
|
large: {
|
|
12
13
|
borderBottomWidth: tokens["border-thick"],
|
|
13
14
|
opacity: 0.875,
|
|
14
15
|
},
|
|
16
|
+
larger: {
|
|
17
|
+
borderBottomWidth: tokens["border-thicker"],
|
|
18
|
+
opacity: 0.625,
|
|
19
|
+
},
|
|
15
20
|
largest: {
|
|
16
|
-
borderBottomWidth: tokens["
|
|
21
|
+
borderBottomWidth: tokens["border-thickest"],
|
|
17
22
|
opacity: 0.375,
|
|
18
23
|
},
|
|
19
24
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { tokens } from "../utils/design";
|
|
3
|
+
|
|
4
|
+
export const verticalStyles = StyleSheet.create({
|
|
5
|
+
base: {
|
|
6
|
+
margin: 0,
|
|
7
|
+
height: "100%",
|
|
8
|
+
width: 1,
|
|
9
|
+
borderRightWidth: tokens["border-base"],
|
|
10
|
+
borderRightColor: tokens["color-border"],
|
|
11
|
+
},
|
|
12
|
+
large: {
|
|
13
|
+
borderRightWidth: tokens["border-thick"],
|
|
14
|
+
opacity: 0.875,
|
|
15
|
+
},
|
|
16
|
+
larger: {
|
|
17
|
+
borderRightWidth: tokens["border-thicker"],
|
|
18
|
+
opacity: 0.625,
|
|
19
|
+
},
|
|
20
|
+
largest: {
|
|
21
|
+
borderRightWidth: tokens["border-thickest"],
|
|
22
|
+
opacity: 0.375,
|
|
23
|
+
},
|
|
24
|
+
vertical: {
|
|
25
|
+
borderRightColor: tokens["color-border"],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -41,8 +41,6 @@ export function FormCache<T extends FieldValues>({
|
|
|
41
41
|
// https://github.com/react-hook-form/react-hook-form/issues/2978
|
|
42
42
|
setLocalCache(omit(formData, localCacheExclude));
|
|
43
43
|
} else {
|
|
44
|
-
// @ts-expect-error Typescript thinks that the FieldValues defined in useWatch is different
|
|
45
|
-
// from the one in useFormContext
|
|
46
44
|
setLocalCache(formData);
|
|
47
45
|
}
|
|
48
46
|
}, [formData, isDirty, localCacheExclude, setLocalCache, shouldExclude]);
|