@jobber/components-native 0.91.1 → 0.91.2
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/ActionItem/ActionItemGroup.js +1 -1
- package/dist/src/AutoLink/components/Link/Link.js +1 -1
- package/dist/src/ErrorMessageWrapper/context/ErrorMessageProvider.js +1 -1
- package/dist/src/Form/components/FormMessageBanner/FormMessageBanner.js +1 -1
- package/dist/src/Select/components/SelectPressable/SelectPressable.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/ActionItem/ActionItem.d.ts +2 -1
- package/dist/types/src/ActionItem/ActionItemGroup.d.ts +2 -1
- package/dist/types/src/ActionItem/components/ActionItemContainer.d.ts +2 -1
- package/dist/types/src/ActionLabel/ActionLabel.d.ts +1 -1
- package/dist/types/src/ActivityIndicator/ActivityIndicator.d.ts +2 -1
- package/dist/types/src/AutoLink/AutoLink.d.ts +2 -1
- package/dist/types/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.d.ts +2 -1
- package/dist/types/src/AutoLink/components/Link/Link.d.ts +2 -1
- package/dist/types/src/Banner/Banner.d.ts +2 -1
- package/dist/types/src/Banner/components/BannerIcon/BannerIcon.d.ts +2 -1
- package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +2 -1
- package/dist/types/src/Button/Button.d.ts +2 -1
- package/dist/types/src/Button/components/InternalButtonLoading/InternalButtonLoading.d.ts +1 -1
- package/dist/types/src/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/types/src/ButtonGroup/ButtonGroupAction.d.ts +4 -3
- package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +2 -1
- package/dist/types/src/Card/Card.d.ts +2 -1
- package/dist/types/src/Card/components/InternalCardHeader.d.ts +2 -1
- package/dist/types/src/Checkbox/Checkbox.d.ts +2 -1
- package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/types/src/Chip/Chip.d.ts +2 -1
- package/dist/types/src/Content/Content.d.ts +2 -1
- package/dist/types/src/Disclosure/Disclosure.d.ts +1 -1
- package/dist/types/src/Divider/Divider.d.ts +2 -1
- package/dist/types/src/EmptyState/EmptyState.d.ts +2 -1
- package/dist/types/src/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +2 -1
- package/dist/types/src/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +2 -1
- package/dist/types/src/Flex/Flex.d.ts +2 -1
- package/dist/types/src/Form/Form.d.ts +2 -1
- package/dist/types/src/Form/components/FormActionBar/FormActionBar.d.ts +3 -2
- package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -2
- package/dist/types/src/Form/components/FormCache/FormCache.d.ts +2 -1
- package/dist/types/src/Form/components/FormErrorBanner/FormErrorBanner.d.ts +2 -1
- package/dist/types/src/Form/components/FormMask/FormMask.d.ts +2 -1
- package/dist/types/src/Form/components/FormMessage/FormMessage.d.ts +2 -1
- package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +2 -1
- package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +2 -1
- package/dist/types/src/Form/components/FormSaveButton/FormSaveButton.d.ts +2 -1
- package/dist/types/src/Form/types.d.ts +2 -2
- package/dist/types/src/FormField/FormField.d.ts +1 -1
- package/dist/types/src/FormatFile/FormatFile.d.ts +2 -1
- package/dist/types/src/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -1
- package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +2 -1
- package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +2 -1
- package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +2 -1
- package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/types/src/Heading/Heading.d.ts +1 -1
- package/dist/types/src/Icon/Icon.d.ts +2 -1
- package/dist/types/src/IconButton/IconButton.d.ts +1 -1
- package/dist/types/src/InputCurrency/InputCurrency.d.ts +2 -1
- package/dist/types/src/InputDate/InputDate.d.ts +2 -1
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +1 -1
- package/dist/types/src/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +2 -1
- package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +3 -2
- package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +3 -2
- package/dist/types/src/InputPressable/InputPressable.d.ts +1 -1
- package/dist/types/src/InputSearch/components/FilterButton.d.ts +2 -1
- package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +2 -1
- package/dist/types/src/InputTime/InputTime.d.ts +2 -1
- package/dist/types/src/Menu/Menu.d.ts +2 -1
- package/dist/types/src/Menu/components/MenuOption/MenuOption.d.ts +2 -1
- package/dist/types/src/Menu/components/Overlay/Overlay.d.ts +2 -1
- package/dist/types/src/Menu/types.d.ts +2 -1
- package/dist/types/src/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +2 -1
- package/dist/types/src/Select/Select.d.ts +3 -2
- package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +2 -1
- package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +2 -1
- package/dist/types/src/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +2 -1
- package/dist/types/src/Select/components/SelectPressable/SelectPressable.d.ts +2 -1
- package/dist/types/src/StatusLabel/StatusLabel.d.ts +2 -1
- package/dist/types/src/Switch/Switch.d.ts +2 -1
- package/dist/types/src/Switch/components/BaseSwitch/BaseSwitch.d.ts +2 -1
- package/dist/types/src/Text/Text.d.ts +1 -1
- package/dist/types/src/TextList/TextList.d.ts +2 -1
- package/dist/types/src/ThumbnailList/ThumbnailList.d.ts +2 -1
- package/dist/types/src/Toast/Toast.d.ts +2 -1
- package/dist/types/src/Typography/Typography.d.ts +1 -1
- package/dist/types/src/Typography/TypographyGestureDetector.d.ts +2 -1
- package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +1 -1
- package/package.json +2 -2
- package/src/ActionItem/ActionItem.tsx +1 -1
- package/src/ActionItem/ActionItemGroup.tsx +1 -3
- package/src/ActionItem/components/ActionItemContainer.tsx +1 -1
- package/src/ActionLabel/ActionLabel.tsx +1 -1
- package/src/ActivityIndicator/ActivityIndicator.tsx +1 -3
- package/src/AutoLink/AutoLink.tsx +1 -1
- package/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.tsx +1 -1
- package/src/AutoLink/components/Link/Link.tsx +1 -5
- package/src/Banner/Banner.tsx +2 -2
- package/src/Banner/components/BannerIcon/BannerIcon.tsx +1 -1
- package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +1 -1
- package/src/Button/Button.tsx +1 -1
- package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -1
- package/src/ButtonGroup/ButtonGroup.tsx +1 -1
- package/src/ButtonGroup/ButtonGroupAction.tsx +4 -4
- package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +1 -1
- package/src/Card/Card.tsx +1 -1
- package/src/Card/components/InternalCardHeader.tsx +1 -1
- package/src/Checkbox/Checkbox.tsx +2 -2
- package/src/Checkbox/CheckboxGroup.test.tsx +1 -1
- package/src/Checkbox/CheckboxGroup.tsx +2 -2
- package/src/Chip/Chip.tsx +1 -1
- package/src/Content/Content.tsx +1 -1
- package/src/ContentOverlay/ContentOverlay.tsx +1 -1
- package/src/Disclosure/Disclosure.tsx +1 -1
- package/src/Divider/Divider.tsx +1 -1
- package/src/EmptyState/EmptyState.tsx +1 -1
- package/src/ErrorMessageWrapper/ErrorMessageWrapper.tsx +1 -1
- package/src/ErrorMessageWrapper/context/ErrorMessageProvider.tsx +1 -3
- package/src/Flex/Flex.tsx +2 -2
- package/src/Form/Form.test.tsx +2 -2
- package/src/Form/Form.tsx +1 -1
- package/src/Form/components/FormActionBar/FormActionBar.tsx +3 -3
- package/src/Form/components/FormBody/FormBody.tsx +3 -3
- package/src/Form/components/FormCache/FormCache.tsx +1 -1
- package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +1 -1
- package/src/Form/components/FormMask/FormMask.tsx +1 -1
- package/src/Form/components/FormMessage/FormMessage.tsx +1 -1
- package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx +1 -1
- package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -3
- package/src/Form/components/FormSaveButton/FormSaveButton.tsx +1 -1
- package/src/Form/types.ts +2 -2
- package/src/FormField/FormField.tsx +1 -1
- package/src/FormatFile/FormatFile.tsx +3 -3
- package/src/FormatFile/components/ErrorIcon/ErrorIcon.tsx +1 -1
- package/src/FormatFile/components/FileView/FileView.tsx +1 -1
- package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +1 -1
- package/src/FormatFile/components/MediaView/MediaView.tsx +1 -1
- package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/Heading/Heading.tsx +1 -1
- package/src/Icon/Icon.tsx +1 -1
- package/src/IconButton/IconButton.tsx +1 -1
- package/src/InputCurrency/InputCurrency.tsx +1 -1
- package/src/InputDate/InputDate.tsx +2 -2
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +1 -1
- package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -1
- package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +2 -2
- package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +2 -2
- package/src/InputPassword/InputPassword.tsx +1 -1
- package/src/InputPressable/InputPressable.tsx +1 -1
- package/src/InputSearch/components/FilterButton.tsx +1 -1
- package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
- package/src/InputTime/InputTime.tsx +2 -2
- package/src/Menu/Menu.tsx +1 -1
- package/src/Menu/components/MenuOption/MenuOption.tsx +1 -1
- package/src/Menu/components/Overlay/Overlay.tsx +1 -1
- package/src/Menu/types.ts +2 -1
- package/src/ProgressBar/ProgressBar.tsx +1 -1
- package/src/ProgressBar/ProgressBarInner.tsx +1 -1
- package/src/Select/Select.tsx +2 -2
- package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +1 -1
- package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.tsx +1 -1
- package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -1
- package/src/Select/components/SelectPressable/SelectPressable.tsx +1 -4
- package/src/StatusLabel/StatusLabel.tsx +1 -1
- package/src/Switch/Switch.tsx +1 -1
- package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -1
- package/src/Text/Text.tsx +1 -1
- package/src/TextList/TextList.tsx +1 -1
- package/src/ThumbnailList/ThumbnailList.tsx +1 -1
- package/src/Toast/Toast.tsx +2 -2
- package/src/Typography/Typography.tsx +1 -1
- package/src/Typography/TypographyGestureDetector.tsx +1 -3
- package/src/utils/test/MockSafeAreaProvider.tsx +1 -1
|
@@ -34,7 +34,7 @@ export function ErrorMessageWrapper({
|
|
|
34
34
|
message,
|
|
35
35
|
wrapFor = "default",
|
|
36
36
|
children,
|
|
37
|
-
}: ErrorMessageWrapperProps)
|
|
37
|
+
}: ErrorMessageWrapperProps) {
|
|
38
38
|
const errorMessageContext = useErrorMessageContext();
|
|
39
39
|
const register = errorMessageContext?.register;
|
|
40
40
|
const unregister = errorMessageContext?.unregister;
|
|
@@ -13,9 +13,7 @@ interface ErrorMessageProviderProps {
|
|
|
13
13
|
readonly children: ReactNode;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function ErrorMessageProvider({
|
|
17
|
-
children,
|
|
18
|
-
}: ErrorMessageProviderProps): JSX.Element {
|
|
16
|
+
export function ErrorMessageProvider({ children }: ErrorMessageProviderProps) {
|
|
19
17
|
const [elements, setElements] = useState<
|
|
20
18
|
ErrorMessageContextProps["elements"]
|
|
21
19
|
>({});
|
package/src/Flex/Flex.tsx
CHANGED
|
@@ -11,7 +11,7 @@ export function Flex({
|
|
|
11
11
|
align = "center",
|
|
12
12
|
gap = "base",
|
|
13
13
|
children,
|
|
14
|
-
}: PropsWithChildren<FlexProps>)
|
|
14
|
+
}: PropsWithChildren<FlexProps>) {
|
|
15
15
|
if (template.length === 1) {
|
|
16
16
|
console.warn("Please use <Content /> component for a stacked layout");
|
|
17
17
|
}
|
|
@@ -54,7 +54,7 @@ function Row({
|
|
|
54
54
|
align = "center",
|
|
55
55
|
gap = "base",
|
|
56
56
|
children,
|
|
57
|
-
}: PropsWithChildren<FlexProps>)
|
|
57
|
+
}: PropsWithChildren<FlexProps>) {
|
|
58
58
|
return (
|
|
59
59
|
<View testID="ATL-Flex-Row" style={[styles.row, { alignItems: align }]}>
|
|
60
60
|
{Children.map(children, (child, index) => (
|
package/src/Form/Form.test.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { type ReactElement } from "react";
|
|
2
2
|
import { act, fireEvent, render, waitFor } from "@testing-library/react-native";
|
|
3
3
|
import { Alert, Keyboard } from "react-native";
|
|
4
4
|
import { Host } from "react-native-portalize";
|
|
@@ -94,7 +94,7 @@ interface FormTestProps {
|
|
|
94
94
|
onSubmit: () => void,
|
|
95
95
|
label: string | undefined,
|
|
96
96
|
isSubmitting: boolean,
|
|
97
|
-
) =>
|
|
97
|
+
) => ReactElement;
|
|
98
98
|
readonly initialLoading?: boolean;
|
|
99
99
|
readonly initialValues?: FormFields;
|
|
100
100
|
readonly bannerMessages?: FormBannerMessage[];
|
package/src/Form/Form.tsx
CHANGED
|
@@ -34,7 +34,7 @@ import { ErrorMessageProvider } from "../ErrorMessageWrapper";
|
|
|
34
34
|
export function Form<T extends FieldValues, S>({
|
|
35
35
|
initialLoading,
|
|
36
36
|
...rest
|
|
37
|
-
}: FormProps<T, S>)
|
|
37
|
+
}: FormProps<T, S>) {
|
|
38
38
|
const child = initialLoading ? <FormMask /> : <InternalForm {...rest} />;
|
|
39
39
|
|
|
40
40
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { type ReactElement } from "react";
|
|
2
2
|
import type { LayoutChangeEvent } from "react-native";
|
|
3
3
|
import { StyleSheet } from "react-native";
|
|
4
4
|
import Reanimated from "react-native-reanimated";
|
|
@@ -18,7 +18,7 @@ export interface FormActionBarProps {
|
|
|
18
18
|
onSubmit: () => void,
|
|
19
19
|
label: string | undefined,
|
|
20
20
|
isSubmitting: boolean,
|
|
21
|
-
) =>
|
|
21
|
+
) => ReactElement;
|
|
22
22
|
readonly secondaryActions?: SecondaryActionProp[];
|
|
23
23
|
readonly setSecondaryActionLoading?: (bool: boolean) => void;
|
|
24
24
|
}
|
|
@@ -32,7 +32,7 @@ export function FormActionBar({
|
|
|
32
32
|
setSaveButtonHeight,
|
|
33
33
|
secondaryActions,
|
|
34
34
|
setSecondaryActionLoading,
|
|
35
|
-
}: FormActionBarProps)
|
|
35
|
+
}: FormActionBarProps) {
|
|
36
36
|
const styles = useStyles();
|
|
37
37
|
|
|
38
38
|
const buttonStyle = StyleSheet.flatten([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
1
|
+
import React, { type ReactElement, useMemo } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { useStyles } from "./FormBody.style";
|
|
4
4
|
import { useScreenInformation } from "../../hooks/useScreenInformation";
|
|
@@ -7,7 +7,7 @@ import { FormActionBar } from "../FormActionBar";
|
|
|
7
7
|
import { tokens } from "../../../utils/design";
|
|
8
8
|
|
|
9
9
|
interface FormBodyProps extends FormActionBarProps {
|
|
10
|
-
readonly children:
|
|
10
|
+
readonly children: ReactElement;
|
|
11
11
|
readonly shouldRenderActionBar?: boolean;
|
|
12
12
|
readonly saveButtonOffset?: number;
|
|
13
13
|
}
|
|
@@ -24,7 +24,7 @@ export function FormBody({
|
|
|
24
24
|
setSecondaryActionLoading,
|
|
25
25
|
setSaveButtonHeight,
|
|
26
26
|
saveButtonOffset,
|
|
27
|
-
}: FormBodyProps)
|
|
27
|
+
}: FormBodyProps) {
|
|
28
28
|
const paddingBottom = useBottomPadding();
|
|
29
29
|
const fullViewPadding = useMemo(() => ({ paddingBottom }), [paddingBottom]);
|
|
30
30
|
const styles = useStyles();
|
|
@@ -14,7 +14,7 @@ export function FormCache<T extends FieldValues>({
|
|
|
14
14
|
localCacheExclude,
|
|
15
15
|
localCacheKey,
|
|
16
16
|
setLocalCache,
|
|
17
|
-
}: FormCacheProps<T>)
|
|
17
|
+
}: FormCacheProps<T>) {
|
|
18
18
|
const { control, formState } = useFormContext<T>();
|
|
19
19
|
const { isDirty } = formState;
|
|
20
20
|
|
|
@@ -4,7 +4,7 @@ import { useStyles } from "./FormMask.style";
|
|
|
4
4
|
import { ActivityIndicator } from "../../../ActivityIndicator";
|
|
5
5
|
import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
|
|
6
6
|
|
|
7
|
-
export function FormMask()
|
|
7
|
+
export function FormMask() {
|
|
8
8
|
const { t } = useAtlantisI18n();
|
|
9
9
|
const styles = useStyles();
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ let close: (() => void) | undefined;
|
|
|
17
17
|
* message to the user. Use `FormMessage.close()` to close the most
|
|
18
18
|
* recent message.
|
|
19
19
|
*/
|
|
20
|
-
export const FormMessage = ()
|
|
20
|
+
export const FormMessage = () => {
|
|
21
21
|
const [data, setData] = useState<FormMessageData[]>([]);
|
|
22
22
|
|
|
23
23
|
open = useCallback(
|
package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx
CHANGED
|
@@ -15,7 +15,7 @@ interface FormMessageProps {
|
|
|
15
15
|
export function InternalFormMessage({
|
|
16
16
|
data,
|
|
17
17
|
onRequestClose,
|
|
18
|
-
}: FormMessageProps)
|
|
18
|
+
}: FormMessageProps) {
|
|
19
19
|
const { t } = useAtlantisI18n();
|
|
20
20
|
const styles = useStyles();
|
|
21
21
|
const emptyStateData: EmptyStateProps = useMemo(() => {
|
|
@@ -8,9 +8,7 @@ interface FormMessageBannerProps {
|
|
|
8
8
|
readonly bannerMessages?: FormBannerMessage[];
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function FormMessageBanner({
|
|
12
|
-
bannerMessages,
|
|
13
|
-
}: FormMessageBannerProps): JSX.Element {
|
|
11
|
+
export function FormMessageBanner({ bannerMessages }: FormMessageBannerProps) {
|
|
14
12
|
return (
|
|
15
13
|
<>
|
|
16
14
|
{bannerMessages?.map((message, index) => (
|
|
@@ -13,7 +13,7 @@ export function FormSaveButton({
|
|
|
13
13
|
setSecondaryActionLoading,
|
|
14
14
|
onOpenBottomSheet,
|
|
15
15
|
onCloseBottomSheet,
|
|
16
|
-
}: FormSaveButtonProps)
|
|
16
|
+
}: FormSaveButtonProps) {
|
|
17
17
|
const { t } = useAtlantisI18n();
|
|
18
18
|
const formContext = useFormContext();
|
|
19
19
|
const buttonActions = useButtonGroupAction(secondaryActions);
|
package/src/Form/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MutableRefObject, RefObject } from "react";
|
|
1
|
+
import type { MutableRefObject, ReactElement, RefObject } from "react";
|
|
2
2
|
import type {
|
|
3
3
|
ControllerProps,
|
|
4
4
|
DefaultValues,
|
|
@@ -142,7 +142,7 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
|
|
|
142
142
|
onSubmit: () => void,
|
|
143
143
|
label: string | undefined,
|
|
144
144
|
isSubmitting: boolean,
|
|
145
|
-
) =>
|
|
145
|
+
) => ReactElement;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Adding a key will save a local copy of the form data that will be used to
|
|
@@ -88,7 +88,7 @@ function FormatFileContent({
|
|
|
88
88
|
styleInGrid,
|
|
89
89
|
onUploadComplete,
|
|
90
90
|
isMedia,
|
|
91
|
-
}: FormatFileContentProps)
|
|
91
|
+
}: FormatFileContentProps) {
|
|
92
92
|
const styles = useStyles();
|
|
93
93
|
|
|
94
94
|
return (
|
|
@@ -204,7 +204,7 @@ export function FormatFile<T extends File | FileUpload>({
|
|
|
204
204
|
showFileTypeIndicator = true,
|
|
205
205
|
createThumbnail,
|
|
206
206
|
onPreviewPress,
|
|
207
|
-
}: FormatFileProps<T>)
|
|
207
|
+
}: FormatFileProps<T>) {
|
|
208
208
|
const onTapModified = onTap ? () => onTap(file) : () => undefined;
|
|
209
209
|
|
|
210
210
|
const formattedFile = parseFile(file, showFileTypeIndicator);
|
|
@@ -236,7 +236,7 @@ function FormatFileInternal({
|
|
|
236
236
|
onPreviewPress,
|
|
237
237
|
testID,
|
|
238
238
|
createThumbnail: createThumbnailProp,
|
|
239
|
-
}: FormatFileInternalProps)
|
|
239
|
+
}: FormatFileInternalProps) {
|
|
240
240
|
const [showOverlay, setShowOverlay] = useState<boolean>(
|
|
241
241
|
file.status !== StatusCode.Completed,
|
|
242
242
|
);
|
|
@@ -20,7 +20,7 @@ export const FormatFileBottomSheet = ({
|
|
|
20
20
|
onPreviewPress,
|
|
21
21
|
onRemovePress,
|
|
22
22
|
bottomSheetOptionsSuffix,
|
|
23
|
-
}: FormatFileBottomSheetProps)
|
|
23
|
+
}: FormatFileBottomSheetProps) => {
|
|
24
24
|
const { t } = useAtlantisI18n();
|
|
25
25
|
|
|
26
26
|
const handlePress = (onPressAction: () => void) => {
|
|
@@ -27,7 +27,7 @@ export function MediaView({
|
|
|
27
27
|
file,
|
|
28
28
|
styleInGrid,
|
|
29
29
|
onUploadComplete,
|
|
30
|
-
}: MediaViewProps)
|
|
30
|
+
}: MediaViewProps) {
|
|
31
31
|
const { t } = useAtlantisI18n();
|
|
32
32
|
const { useCreateThumbnail } = useAtlantisFormatFileContext();
|
|
33
33
|
const { thumbnail, error } = useCreateThumbnail(file);
|
|
@@ -22,7 +22,7 @@ export const ProgressBar = ({
|
|
|
22
22
|
progress,
|
|
23
23
|
status,
|
|
24
24
|
onComplete,
|
|
25
|
-
}: ProgressBarProps)
|
|
25
|
+
}: ProgressBarProps) => {
|
|
26
26
|
const barWidth = useRef(new Animated.Value(0)).current;
|
|
27
27
|
const progressPercentage = barWidth.interpolate({
|
|
28
28
|
inputRange: [0, 1],
|
package/src/Heading/Heading.tsx
CHANGED
|
@@ -71,7 +71,7 @@ export function Heading<T extends HeadingLevel = "heading">({
|
|
|
71
71
|
maxLines = "unlimited",
|
|
72
72
|
allowFontScaling = true,
|
|
73
73
|
selectable,
|
|
74
|
-
}: HeadingProps<T>)
|
|
74
|
+
}: HeadingProps<T>) {
|
|
75
75
|
const headingStyle = getHeadingStyle(level, variation);
|
|
76
76
|
const accessibilityRole = "header";
|
|
77
77
|
|
package/src/Icon/Icon.tsx
CHANGED
|
@@ -130,7 +130,7 @@ const computeDisplayFromNumericInput = (
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
export function InputCurrency(props: InputCurrencyProps)
|
|
133
|
+
export function InputCurrency(props: InputCurrencyProps) {
|
|
134
134
|
const {
|
|
135
135
|
showCurrencySymbol = true,
|
|
136
136
|
maxDecimalPlaces = 5,
|
|
@@ -111,7 +111,7 @@ const display = Platform.OS === "ios" ? "inline" : "default";
|
|
|
111
111
|
/**
|
|
112
112
|
* Allow users to select a date using the device date picker.
|
|
113
113
|
*/
|
|
114
|
-
export function InputDate(props: InputDateProps)
|
|
114
|
+
export function InputDate(props: InputDateProps) {
|
|
115
115
|
if (props.name) {
|
|
116
116
|
return (
|
|
117
117
|
<FormField<Date>
|
|
@@ -152,7 +152,7 @@ function InternalInputDate({
|
|
|
152
152
|
onChange,
|
|
153
153
|
accessibilityLabel,
|
|
154
154
|
accessibilityHint,
|
|
155
|
-
}: InputDateProps)
|
|
155
|
+
}: InputDateProps) {
|
|
156
156
|
const [showPicker, setShowPicker] = useState(false);
|
|
157
157
|
const { t, locale, formatDate } = useAtlantisI18n();
|
|
158
158
|
|
|
@@ -138,7 +138,7 @@ export function InputFieldWrapper({
|
|
|
138
138
|
toolbarVisibility = "while-editing",
|
|
139
139
|
loading = false,
|
|
140
140
|
loadingType = "spinner",
|
|
141
|
-
}: InputFieldWrapperProps)
|
|
141
|
+
}: InputFieldWrapperProps) {
|
|
142
142
|
fieldAffixRequiredPropsCheck([prefix, suffix]);
|
|
143
143
|
const handleClear = onClear ?? noopClear;
|
|
144
144
|
warnIfClearActionWithNoOnClear(onClear, showClearAction);
|
|
@@ -27,7 +27,7 @@ export function PrefixLabel({
|
|
|
27
27
|
inputInvalid,
|
|
28
28
|
label,
|
|
29
29
|
styleOverride,
|
|
30
|
-
}: PrefixLabelProps)
|
|
30
|
+
}: PrefixLabelProps) {
|
|
31
31
|
const styles = useStyles();
|
|
32
32
|
const typographyStyles = useTypographyStyles();
|
|
33
33
|
|
|
@@ -80,7 +80,7 @@ export function PrefixIcon({
|
|
|
80
80
|
disabled,
|
|
81
81
|
inputInvalid,
|
|
82
82
|
icon,
|
|
83
|
-
}: PrefixIconProps)
|
|
83
|
+
}: PrefixIconProps) {
|
|
84
84
|
const styles = useStyles();
|
|
85
85
|
const { tokens } = useAtlantisTheme();
|
|
86
86
|
|
|
@@ -29,7 +29,7 @@ export function SuffixLabel({
|
|
|
29
29
|
label,
|
|
30
30
|
hasLeftMargin = true,
|
|
31
31
|
styleOverride,
|
|
32
|
-
}: SuffixLabelProps)
|
|
32
|
+
}: SuffixLabelProps) {
|
|
33
33
|
const styles = useStyles();
|
|
34
34
|
const typographyStyles = useTypographyStyles();
|
|
35
35
|
|
|
@@ -86,7 +86,7 @@ export function SuffixIcon({
|
|
|
86
86
|
icon,
|
|
87
87
|
hasLeftMargin = false,
|
|
88
88
|
onPress,
|
|
89
|
-
}: SuffixIconProps)
|
|
89
|
+
}: SuffixIconProps) {
|
|
90
90
|
const styles = useStyles();
|
|
91
91
|
const { tokens } = useAtlantisTheme();
|
|
92
92
|
|
|
@@ -23,7 +23,7 @@ export interface InputPasswordProps
|
|
|
23
23
|
function InputPasswordInternal(
|
|
24
24
|
{ usePrivacyEye = true, ...props }: InputPasswordProps,
|
|
25
25
|
ref: Ref<InputTextRef>,
|
|
26
|
-
)
|
|
26
|
+
) {
|
|
27
27
|
const { t } = useAtlantisI18n();
|
|
28
28
|
const [passwordHidden, setPasswordHidden] = useState(true);
|
|
29
29
|
const [privacyEye, setPrivacyEye] = useState<IconNames>("eye");
|
|
@@ -99,7 +99,7 @@ function formatInvalidState(
|
|
|
99
99
|
return Boolean(error);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export function InputTime(props: InputTimeProps)
|
|
102
|
+
export function InputTime(props: InputTimeProps) {
|
|
103
103
|
if (props.name) {
|
|
104
104
|
return (
|
|
105
105
|
<FormField name={props.name} validations={props.validations}>
|
|
@@ -134,7 +134,7 @@ function InternalInputTime({
|
|
|
134
134
|
showMiniLabel = true,
|
|
135
135
|
onChange,
|
|
136
136
|
showIcon = true,
|
|
137
|
-
}: InputTimeProps)
|
|
137
|
+
}: InputTimeProps) {
|
|
138
138
|
const [showPicker, setShowPicker] = useState(false);
|
|
139
139
|
const { t, formatTime } = useAtlantisI18n();
|
|
140
140
|
const { timeZone, timeFormat } = useAtlantisContext();
|
package/src/Menu/Menu.tsx
CHANGED
|
@@ -20,7 +20,7 @@ import { useAtlantisContext } from "../AtlantisContext";
|
|
|
20
20
|
import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
|
|
21
21
|
import { useAtlantisTheme } from "../AtlantisThemeContext";
|
|
22
22
|
|
|
23
|
-
export function Menu({ menuOptions, customActivator }: MenuProps)
|
|
23
|
+
export function Menu({ menuOptions, customActivator }: MenuProps) {
|
|
24
24
|
const [open, setOpen] = useState<boolean>(false);
|
|
25
25
|
const [menuPosition, setMenuPosition] = useState<object>();
|
|
26
26
|
const activatorLayout = useRef<LayoutRectangle>();
|
|
@@ -17,7 +17,7 @@ export function MenuOption({
|
|
|
17
17
|
textTransform = "capitalize",
|
|
18
18
|
onPress,
|
|
19
19
|
setOpen,
|
|
20
|
-
}: MenuOptionInternalProps)
|
|
20
|
+
}: MenuOptionInternalProps) {
|
|
21
21
|
const destructiveColor = "destructive";
|
|
22
22
|
const textVariation = destructive ? destructiveColor : "heading";
|
|
23
23
|
const styles = useStyles();
|
|
@@ -3,7 +3,7 @@ import { Pressable, View } from "react-native";
|
|
|
3
3
|
import { useStyles } from "./Overlay.style";
|
|
4
4
|
import type { OverlayProp } from "../../types";
|
|
5
5
|
|
|
6
|
-
export function Overlay({ setOpen }: OverlayProp)
|
|
6
|
+
export function Overlay({ setOpen }: OverlayProp) {
|
|
7
7
|
const styles = useStyles();
|
|
8
8
|
|
|
9
9
|
return (
|
package/src/Menu/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IconColorNames, IconNames } from "@jobber/design";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
2
3
|
import type { TextAlign } from "../Typography";
|
|
3
4
|
|
|
4
5
|
export interface MenuOptionProps {
|
|
@@ -17,7 +18,7 @@ export interface MenuOptionInternalProps extends MenuOptionProps {
|
|
|
17
18
|
|
|
18
19
|
export interface MenuProps {
|
|
19
20
|
readonly menuOptions?: MenuOptionProps[];
|
|
20
|
-
readonly customActivator?:
|
|
21
|
+
readonly customActivator?: ReactElement;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export interface OverlayProp {
|
|
@@ -14,7 +14,7 @@ export function ProgressBarInner({
|
|
|
14
14
|
width,
|
|
15
15
|
// animationDuration = 0,
|
|
16
16
|
color,
|
|
17
|
-
}: ProgressBarInnerProps)
|
|
17
|
+
}: ProgressBarInnerProps) {
|
|
18
18
|
// Animation breaking on Android
|
|
19
19
|
// const [animatedOpacity] = useTiming({
|
|
20
20
|
// duration: animationDuration,
|
package/src/Select/Select.tsx
CHANGED
|
@@ -110,7 +110,7 @@ export function Select({
|
|
|
110
110
|
accessibilityLabel,
|
|
111
111
|
name,
|
|
112
112
|
testID,
|
|
113
|
-
}: SelectProps)
|
|
113
|
+
}: SelectProps) {
|
|
114
114
|
const { field, error } = useFormController({
|
|
115
115
|
name,
|
|
116
116
|
validations,
|
|
@@ -243,6 +243,6 @@ function getTestID(testID?: string): string {
|
|
|
243
243
|
return "ATL-Select";
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
export function Option({ children }: SelectOption)
|
|
246
|
+
export function Option({ children }: SelectOption) {
|
|
247
247
|
return <>{children}</>;
|
|
248
248
|
}
|
|
@@ -19,7 +19,7 @@ export function SelectDefaultPicker({
|
|
|
19
19
|
children,
|
|
20
20
|
options,
|
|
21
21
|
onChange,
|
|
22
|
-
}: SelectDefaultPickerProps)
|
|
22
|
+
}: SelectDefaultPickerProps) {
|
|
23
23
|
const [show, setShow] = useState(false);
|
|
24
24
|
const { t } = useAtlantisI18n();
|
|
25
25
|
const selectedLanguage = options.find(option => option.isActive);
|
|
@@ -12,7 +12,7 @@ export function SelectDefaultPicker({
|
|
|
12
12
|
options,
|
|
13
13
|
disabled,
|
|
14
14
|
onChange,
|
|
15
|
-
}: SelectDefaultPickerProps)
|
|
15
|
+
}: SelectDefaultPickerProps) {
|
|
16
16
|
const selectedItem = options.find(option => option.isActive);
|
|
17
17
|
const pickerRef = useRef<Picker<string>>(null);
|
|
18
18
|
const { tokens } = useAtlantisTheme();
|
|
@@ -13,10 +13,7 @@ type SelectPressableProps = Pick<SelectInternalPickerProps, "children"> &
|
|
|
13
13
|
* screen-reader is being used to avoid screen-readers from ignoring the press
|
|
14
14
|
* on the MenuView
|
|
15
15
|
*/
|
|
16
|
-
export function SelectPressable({
|
|
17
|
-
children,
|
|
18
|
-
onPress,
|
|
19
|
-
}: SelectPressableProps): JSX.Element {
|
|
16
|
+
export function SelectPressable({ children, onPress }: SelectPressableProps) {
|
|
20
17
|
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
21
18
|
const styles = useStyles();
|
|
22
19
|
if (isScreenReaderEnabled) return <>{children}</>;
|
package/src/Switch/Switch.tsx
CHANGED
|
@@ -20,7 +20,7 @@ interface WithLabelProps extends BaseSwitchProps {
|
|
|
20
20
|
|
|
21
21
|
export type SwitchProps = XOR<BaseSwitchProps, WithLabelProps>;
|
|
22
22
|
|
|
23
|
-
export function Switch(props: SwitchProps)
|
|
23
|
+
export function Switch(props: SwitchProps) {
|
|
24
24
|
const switchProps: SwitchProps = {
|
|
25
25
|
...props,
|
|
26
26
|
accessibilityLabel: props.accessibilityLabel || props.label,
|