@jobber/components-native 0.54.4-JOB-88641.7 → 0.54.4-fix-inline.3
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 +7 -7
- package/dist/src/ActionItem/ActionItem.js +1 -1
- package/dist/src/Banner/Banner.js +2 -3
- package/dist/src/Banner/Banner.style.js +4 -2
- package/dist/src/Button/Button.js +2 -2
- package/dist/src/Button/Button.style.js +2 -2
- package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +3 -0
- package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/src/ButtonGroup/ButtonGroup.style.js +1 -1
- package/dist/src/Card/Card.js +7 -8
- package/dist/src/Disclosure/Disclosure.js +3 -3
- package/dist/src/Glimmer/Glimmer.js +42 -0
- package/dist/src/Glimmer/Glimmer.shape.style.js +16 -0
- package/dist/src/Glimmer/Glimmer.size.style.js +9 -0
- package/dist/src/Glimmer/Glimmer.style.js +20 -0
- package/dist/src/Glimmer/index.js +1 -0
- package/dist/src/InputCurrency/InputCurrency.js +16 -17
- package/dist/src/InputFieldWrapper/InputFieldWrapper.js +39 -18
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +38 -1
- package/dist/src/InputText/InputText.js +6 -3
- package/dist/src/Menu/Menu.js +20 -3
- package/dist/src/Menu/Menu.style.js +1 -1
- package/dist/src/Menu/utils.js +2 -7
- package/dist/src/index.js +6 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Banner/Banner.style.d.ts +4 -2
- package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
- package/dist/types/src/ButtonGroup/ButtonGroup.style.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/Glimmer/Glimmer.d.ts +31 -0
- package/dist/types/src/Glimmer/Glimmer.shape.style.d.ts +14 -0
- package/dist/types/src/Glimmer/Glimmer.size.style.d.ts +17 -0
- package/dist/types/src/Glimmer/Glimmer.style.d.ts +18 -0
- package/dist/types/src/Glimmer/index.d.ts +1 -0
- package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +19 -1
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +34 -0
- 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/InputText.d.ts +6 -2
- 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/index.d.ts +6 -5
- package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
- package/jestSetup.js +2 -0
- package/package.json +7 -7
- package/src/ActionItem/ActionItem.test.tsx +2 -2
- package/src/ActionItem/ActionItem.tsx +3 -1
- 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/Banner/Banner.style.ts +4 -2
- package/src/Banner/Banner.tsx +3 -3
- 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 +4 -0
- package/src/ButtonGroup/ButtonGroup.style.ts +1 -1
- package/src/ButtonGroup/ButtonGroup.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/Disclosure/Disclosure.tsx +3 -8
- package/src/Disclosure/__snapshots__/Disclosure.test.tsx.snap +18 -24
- 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/Glimmer/Glimmer.shape.style.ts +17 -0
- package/src/Glimmer/Glimmer.size.style.ts +10 -0
- package/src/Glimmer/Glimmer.style.ts +23 -0
- package/src/Glimmer/Glimmer.test.tsx +73 -0
- package/src/Glimmer/Glimmer.tsx +106 -0
- package/src/Glimmer/index.ts +1 -0
- package/src/Icon/Icon.tsx +1 -0
- package/src/Icon/__snapshots__/Icon.test.tsx.snap +89 -24
- 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/InputFieldWrapper.style.ts +46 -1
- package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +74 -0
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +131 -64
- 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/InputText.test.tsx +11 -0
- package/src/InputText/InputText.tsx +27 -2
- 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/Menu.style.ts +1 -1
- package/src/Menu/Menu.tsx +23 -2
- package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
- package/src/Menu/utils.ts +3 -7
- 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/index.ts +6 -5
- package/src/utils/intl/capitalize.ts +1 -0
- package/src/utils/test/MockSafeAreaProvider.tsx +3 -3
package/src/Menu/utils.ts
CHANGED
|
@@ -82,6 +82,7 @@ function getHorizontalPosition(
|
|
|
82
82
|
if (menuPositionHorizontal === "menuRight") {
|
|
83
83
|
getRightPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth);
|
|
84
84
|
}
|
|
85
|
+
|
|
85
86
|
if (menuPositionHorizontal === "menuLeft") {
|
|
86
87
|
getLeftPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth);
|
|
87
88
|
}
|
|
@@ -117,12 +118,7 @@ function getLeftPosition(
|
|
|
117
118
|
} else if (overflowRight) {
|
|
118
119
|
pos.right = 0;
|
|
119
120
|
} else {
|
|
120
|
-
pos.right =
|
|
121
|
-
windowWidth -
|
|
122
|
-
activatorLayout.x -
|
|
123
|
-
activatorLayout.width +
|
|
124
|
-
activatorLayout.width / 2 -
|
|
125
|
-
menuHorizontalPadding;
|
|
121
|
+
pos.right = windowWidth - activatorLayout.x - activatorLayout.width;
|
|
126
122
|
}
|
|
127
123
|
}
|
|
128
124
|
|
|
@@ -146,6 +142,6 @@ function getRightPosition(
|
|
|
146
142
|
} else if (overflowLeft) {
|
|
147
143
|
pos.left = 0;
|
|
148
144
|
} else {
|
|
149
|
-
pos.left = activatorLayout.x
|
|
145
|
+
pos.left = activatorLayout.x;
|
|
150
146
|
}
|
|
151
147
|
}
|
package/src/Text/Text.tsx
CHANGED
package/src/Toast/Toast.tsx
CHANGED
|
@@ -19,6 +19,7 @@ function DefaultToast({ text1 }: ToastConfigParams<string>): JSX.Element {
|
|
|
19
19
|
const { bottom } = useSafeAreaInsets();
|
|
20
20
|
const { t } = useAtlantisI18n();
|
|
21
21
|
const toastContainerStyles = [styles.container, { paddingBottom: bottom }];
|
|
22
|
+
|
|
22
23
|
return (
|
|
23
24
|
<View style={toastContainerStyles}>
|
|
24
25
|
<View style={styles.toast}>
|
|
@@ -48,7 +49,7 @@ export interface JobberToastProps {
|
|
|
48
49
|
* Has effect only when the position is "bottom".
|
|
49
50
|
* @default 40
|
|
50
51
|
*/
|
|
51
|
-
bottomOffset?: number;
|
|
52
|
+
readonly bottomOffset?: number;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
export function JobberToast({ bottomOffset }: JobberToastProps): JSX.Element {
|
|
@@ -207,6 +207,7 @@ function getFontStyle(
|
|
|
207
207
|
fontWeight,
|
|
208
208
|
)}`;
|
|
209
209
|
const fontStyling = styles[styleKey];
|
|
210
|
+
|
|
210
211
|
if (fontStyling) {
|
|
211
212
|
return fontStyling;
|
|
212
213
|
} else {
|
|
@@ -234,6 +235,7 @@ function getColorStyle(color?: TextColor, reverseTheme?: boolean) {
|
|
|
234
235
|
return styles.greyBlue;
|
|
235
236
|
}
|
|
236
237
|
const colorStyleKey = `${color}${reverseTheme ? "Reverse" : ""}`;
|
|
238
|
+
|
|
237
239
|
return styles[`${colorStyleKey}`];
|
|
238
240
|
}
|
|
239
241
|
|
|
@@ -248,10 +250,13 @@ function getSizeAndHeightStyle(
|
|
|
248
250
|
lineHeightOverwrite?: LineHeight,
|
|
249
251
|
) {
|
|
250
252
|
const fontSize = styles[`${textSize}Size`];
|
|
253
|
+
|
|
251
254
|
if (lineHeightOverwrite) {
|
|
252
255
|
const lineHeight = styles[`${lineHeightOverwrite}LineHeight`];
|
|
256
|
+
|
|
253
257
|
return StyleSheet.flatten([fontSize, lineHeight]);
|
|
254
258
|
}
|
|
259
|
+
|
|
255
260
|
return fontSize;
|
|
256
261
|
}
|
|
257
262
|
|
|
@@ -51,6 +51,7 @@ export function useFormController<T>({
|
|
|
51
51
|
// TODO: Add support for two-part identifiers (e.g. "property.province")
|
|
52
52
|
const fieldIdentifiers = fieldName.split(".");
|
|
53
53
|
let error: FieldError | undefined;
|
|
54
|
+
|
|
54
55
|
if (fieldIdentifiers.length === 3) {
|
|
55
56
|
const [section, item, identifier] = fieldIdentifiers;
|
|
56
57
|
error = errors[section]?.[item]?.[identifier];
|
|
@@ -64,5 +65,6 @@ export function useFormController<T>({
|
|
|
64
65
|
function useControlName(name?: string): UseControllerReturn["field"]["name"] {
|
|
65
66
|
const [identifier] = useState(v1());
|
|
66
67
|
const prefix = `generatedName--${identifier}`;
|
|
68
|
+
|
|
67
69
|
return `${name || prefix}` as const;
|
|
68
70
|
}
|
package/src/index.ts
CHANGED
|
@@ -17,29 +17,30 @@ export * from "./Divider";
|
|
|
17
17
|
export * from "./EmptyState";
|
|
18
18
|
export * from "./ErrorMessageWrapper";
|
|
19
19
|
export * from "./Flex";
|
|
20
|
-
export * from "./FormatFile";
|
|
21
20
|
export * from "./Form";
|
|
21
|
+
export * from "./FormatFile";
|
|
22
22
|
export * from "./FormField";
|
|
23
|
+
export * from "./Glimmer";
|
|
23
24
|
export * from "./Heading";
|
|
24
25
|
export * from "./Icon";
|
|
25
26
|
export * from "./IconButton";
|
|
26
|
-
export * from "./InputFieldWrapper";
|
|
27
27
|
export * from "./InputCurrency";
|
|
28
28
|
export * from "./InputDate";
|
|
29
29
|
export * from "./InputEmail";
|
|
30
|
+
export * from "./InputFieldWrapper";
|
|
30
31
|
export * from "./InputNumber";
|
|
31
32
|
export * from "./InputPassword";
|
|
32
33
|
export * from "./InputPressable";
|
|
33
34
|
export * from "./InputSearch";
|
|
34
|
-
export * from "./InputTime";
|
|
35
35
|
export * from "./InputText";
|
|
36
|
+
export * from "./InputTime";
|
|
36
37
|
export * from "./Menu";
|
|
37
|
-
export * from "./TextList";
|
|
38
|
-
export * from "./ThumbnailList";
|
|
39
38
|
export * from "./ProgressBar";
|
|
40
39
|
export * from "./Select";
|
|
41
40
|
export * from "./StatusLabel";
|
|
42
41
|
export * from "./Switch";
|
|
43
42
|
export * from "./Text";
|
|
43
|
+
export * from "./TextList";
|
|
44
|
+
export * from "./ThumbnailList";
|
|
44
45
|
export * from "./Toast";
|
|
45
46
|
export * from "./Typography";
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
} from "react-native-safe-area-context";
|
|
7
7
|
|
|
8
8
|
interface MockSafeAreaProviderProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
frame?: Rect;
|
|
11
|
-
insets?: EdgeInsets;
|
|
9
|
+
readonly children: React.ReactNode;
|
|
10
|
+
readonly frame?: Rect;
|
|
11
|
+
readonly insets?: EdgeInsets;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function MockSafeAreaProvider({
|