@jobber/components-native 0.84.4-JOB-124066-166e539.11 → 0.84.4-JOB-138679-b1552ab.68
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 +24 -15
- package/dist/src/ActionItem/ActionItemGroup.js +1 -1
- package/dist/src/AutoLink/components/Link/Link.js +1 -1
- package/dist/src/Banner/Banner.js +2 -0
- package/dist/src/Banner/components/BannerIcon/BannerIcon.style.js +3 -0
- package/dist/src/BottomSheet/BottomSheet.js +2 -2
- package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/src/ContentOverlay/ContentOverlay.js +5 -7
- package/dist/src/ContentOverlay/UNSAFE_WrappedModalize.js +23 -0
- package/dist/src/ErrorMessageWrapper/context/ErrorMessageProvider.js +1 -1
- package/dist/src/Form/Form.js +5 -2
- package/dist/src/Form/components/FormCache/FormCache.js +1 -0
- package/dist/src/Form/components/FormMessageBanner/FormMessageBanner.js +1 -1
- package/dist/src/Form/context/AtlantisFormContext.js +1 -0
- package/dist/src/Form/hooks/useInternalForm.js +6 -3
- package/dist/src/FormatFile/components/MediaView/MediaView.js +22 -5
- package/dist/src/FormatFile/utils/createUseCreateThumbnail.js +1 -1
- package/dist/src/InputCurrency/InputCurrency.js +42 -30
- package/dist/src/InputDate/InputDate.js +2 -2
- package/dist/src/InputEmail/InputEmail.js +12 -4
- package/dist/src/InputFieldWrapper/InputFieldWrapper.js +14 -12
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +1 -1
- package/dist/src/InputFieldWrapper/components/Prefix/Prefix.js +5 -2
- package/dist/src/InputFieldWrapper/components/Suffix/Suffix.js +5 -2
- package/dist/src/InputNumber/InputNumber.js +10 -4
- package/dist/src/InputPressable/InputPressable.js +20 -8
- package/dist/src/InputPressable/InputPressable.style.js +3 -0
- package/dist/src/InputSearch/InputSearch.js +1 -1
- package/dist/src/InputText/InputText.js +22 -11
- package/dist/src/InputText/InputText.style.js +4 -0
- package/dist/src/InputTime/InputTime.js +2 -2
- package/dist/src/Menu/Menu.js +2 -2
- package/dist/src/Select/Select.style.js +1 -0
- package/dist/src/Select/components/SelectPressable/SelectPressable.js +1 -1
- package/dist/src/Switch/components/BaseSwitch/BaseSwitch.js +7 -1
- package/dist/src/Typography/Typography.js +16 -5
- package/dist/src/hooks/useAtlantisI18n/locales/en.json +1 -0
- package/dist/src/hooks/useAtlantisI18n/locales/es.json +1 -0
- package/dist/src/hooks/useFormController.js +5 -14
- package/dist/tsconfig.build.json +7 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.json +4 -6
- 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 +4 -3
- 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/Banner/components/BannerIcon/BannerIcon.style.d.ts +3 -0
- package/dist/types/src/Banner/types.d.ts +1 -1
- package/dist/types/src/BottomSheet/BottomSheet.d.ts +1 -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 +3 -2
- 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/ContentOverlay/ContentOverlay.d.ts +1 -1
- package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +3 -0
- 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/ErrorMessageWrapper/context/types.d.ts +1 -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 +4 -3
- 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/context/AtlantisFormContext.d.ts +2 -1
- package/dist/types/src/Form/context/types.d.ts +3 -2
- package/dist/types/src/Form/hooks/useFormViewRefs.d.ts +2 -2
- package/dist/types/src/Form/hooks/useInternalForm.d.ts +5 -5
- package/dist/types/src/Form/types.d.ts +13 -7
- 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 +3 -2
- 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 +4 -3
- 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 +4 -2
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +9 -2
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.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 +4 -4
- package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +4 -4
- package/dist/types/src/InputPressable/InputPressable.d.ts +9 -1
- package/dist/types/src/InputPressable/InputPressable.style.d.ts +3 -0
- package/dist/types/src/InputSearch/InputSearch.d.ts +1 -1
- package/dist/types/src/InputSearch/components/FilterButton.d.ts +2 -1
- package/dist/types/src/InputText/InputText.d.ts +10 -2
- package/dist/types/src/InputText/InputText.style.d.ts +4 -0
- package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +2 -1
- package/dist/types/src/InputTime/InputTime.d.ts +4 -2
- 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 +6 -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 +4 -3
- 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 +3 -3
- package/dist/types/src/Typography/TypographyGestureDetector.d.ts +2 -1
- package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +1 -1
- package/package.json +24 -15
- 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.test.tsx +12 -0
- package/src/ActionLabel/ActionLabel.tsx +3 -3
- package/src/ActionLabel/__snapshots__/ActionLabel.test.tsx.snap +66 -0
- package/src/ActivityIndicator/ActivityIndicator.tsx +1 -3
- package/src/AtlantisContext/AtlantisContext.test.tsx +1 -1
- package/src/AtlantisThemeContext/AtlantisThemeContext.test.tsx +5 -5
- package/src/AutoLink/AutoLink.test.tsx +2 -4
- 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.test.tsx +12 -0
- package/src/Banner/Banner.tsx +4 -2
- package/src/Banner/components/BannerIcon/BannerIcon.style.ts +3 -0
- package/src/Banner/components/BannerIcon/BannerIcon.tsx +1 -1
- package/src/Banner/types.ts +1 -1
- package/src/BottomSheet/BottomSheet.test.tsx +17 -17
- package/src/BottomSheet/BottomSheet.tsx +4 -3
- package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +1 -1
- package/src/Button/Button.tsx +1 -1
- package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -2
- package/src/ButtonGroup/ButtonGroup.test.tsx +13 -11
- package/src/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/ButtonGroup/ButtonGroupAction.tsx +4 -4
- package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +2 -2
- 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 +3 -7
- 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.test.tsx +34 -27
- package/src/ContentOverlay/ContentOverlay.tsx +7 -7
- package/src/ContentOverlay/UNSAFE_WrappedModalize.tsx +41 -0
- package/src/ContentOverlay/hooks/useKeyboardVisibility.test.ts +7 -7
- package/src/ContentOverlay/hooks/useViewLayoutHeight.test.ts +1 -1
- package/src/Disclosure/Disclosure.tsx +1 -1
- package/src/Divider/Divider.tsx +1 -1
- package/src/EmptyState/EmptyState.test.tsx +29 -42
- package/src/EmptyState/EmptyState.tsx +1 -1
- package/src/ErrorMessageWrapper/ErrorMessageWrapper.tsx +1 -1
- package/src/ErrorMessageWrapper/context/ErrorMessageProvider.tsx +3 -5
- package/src/ErrorMessageWrapper/context/types.ts +1 -1
- package/src/Flex/Flex.tsx +2 -2
- package/src/Form/Form.test.tsx +145 -2
- package/src/Form/Form.tsx +8 -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 +5 -4
- package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +1 -1
- package/src/Form/components/FormMask/FormMask.tsx +1 -1
- package/src/Form/components/FormMessage/FormMessage.test.tsx +40 -27
- 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.test.tsx +2 -2
- package/src/Form/components/FormSaveButton/FormSaveButton.tsx +1 -1
- package/src/Form/context/AtlantisFormContext.test.tsx +1 -1
- package/src/Form/context/AtlantisFormContext.tsx +1 -0
- package/src/Form/context/types.ts +3 -2
- package/src/Form/hooks/useFormViewRefs.ts +4 -5
- package/src/Form/hooks/useInternalForm.ts +12 -4
- package/src/Form/hooks/useScrollToError/useScrollToError.test.tsx +2 -1
- package/src/Form/types.ts +14 -8
- package/src/FormField/FormField.tsx +1 -1
- package/src/FormatFile/FormatFile.test.tsx +21 -21
- 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.test.tsx +14 -14
- package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +2 -2
- package/src/FormatFile/components/MediaView/MediaView.test.tsx +283 -0
- package/src/FormatFile/components/MediaView/MediaView.tsx +28 -7
- package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -1
- package/src/Glimmer/Glimmer.test.tsx +2 -2
- package/src/Heading/Heading.test.tsx +13 -0
- package/src/Heading/Heading.tsx +3 -3
- package/src/Heading/__snapshots__/Heading.test.tsx.snap +65 -0
- package/src/Icon/Icon.tsx +1 -1
- package/src/Icon/__snapshots__/Icon.test.tsx.snap +7 -0
- package/src/IconButton/IconButton.tsx +1 -1
- package/src/InputCurrency/InputCurrency.tsx +72 -58
- package/src/InputDate/InputDate.tsx +7 -3
- package/src/InputEmail/InputEmail.tsx +15 -8
- package/src/InputFieldWrapper/InputFieldWrapper.style.ts +1 -1
- package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +48 -1
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +39 -29
- package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -1
- package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +8 -16
- package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +8 -6
- package/src/InputFieldWrapper/components/Suffix/Suffix.test.tsx +2 -4
- package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +8 -6
- package/src/InputNumber/InputNumber.tsx +11 -7
- package/src/InputPassword/InputPassword.tsx +1 -1
- package/src/InputPressable/InputPressable.style.ts +4 -0
- package/src/InputPressable/InputPressable.test.tsx +75 -1
- package/src/InputPressable/InputPressable.tsx +34 -8
- package/src/InputSearch/InputSearch.tsx +2 -1
- package/src/InputSearch/components/FilterButton.tsx +1 -1
- package/src/InputText/InputText.style.ts +5 -0
- package/src/InputText/InputText.test.tsx +75 -0
- package/src/InputText/InputText.tsx +34 -17
- package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
- package/src/InputTime/InputTime.tsx +7 -3
- package/src/Menu/Menu.tsx +3 -3
- package/src/Menu/components/MenuOption/MenuOption.tsx +1 -1
- package/src/Menu/components/Overlay/Overlay.tsx +1 -1
- package/src/Menu/types.ts +7 -1
- package/src/ProgressBar/ProgressBar.tsx +1 -1
- package/src/ProgressBar/ProgressBarInner.tsx +1 -1
- package/src/Select/Select.style.ts +1 -0
- 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 +8 -2
- package/src/Text/Text.test.tsx +10 -0
- package/src/Text/Text.tsx +3 -3
- package/src/Text/__snapshots__/Text.test.tsx.snap +66 -0
- package/src/TextList/TextList.tsx +1 -1
- package/src/ThumbnailList/ThumbnailList.test.tsx +5 -5
- package/src/ThumbnailList/ThumbnailList.tsx +1 -1
- package/src/Toast/Toast.tsx +2 -2
- package/src/Typography/Typography.test.tsx +61 -0
- package/src/Typography/Typography.tsx +25 -9
- package/src/Typography/TypographyGestureDetector.tsx +1 -3
- package/src/Typography/__snapshots__/Typography.test.tsx.snap +222 -0
- package/src/hooks/useAtlantisI18n/locales/en.json +1 -0
- package/src/hooks/useAtlantisI18n/locales/es.json +1 -0
- package/src/hooks/useFormController.ts +6 -13
- package/src/utils/test/MockSafeAreaProvider.tsx +1 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { Spacing } from "../Content";
|
|
2
3
|
import type { TextLevel } from "../Text";
|
|
3
4
|
interface TextListProps {
|
|
@@ -25,5 +26,5 @@ interface TextListProps {
|
|
|
25
26
|
*/
|
|
26
27
|
readonly childSpacing?: Spacing;
|
|
27
28
|
}
|
|
28
|
-
export declare function TextList({ items, childSpacing, emphasis, level, spacing, }: TextListProps): JSX.Element;
|
|
29
|
+
export declare function TextList({ items, childSpacing, emphasis, level, spacing, }: TextListProps): React.JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { ThumbnailListProps } from "./types";
|
|
2
3
|
import type { File } from "../FormatFile";
|
|
3
4
|
export declare const filterImages: (files: File[]) => File[];
|
|
4
|
-
export declare function ThumbnailList({ files, rowCount, handleOpenFile, createThumbnail, }: ThumbnailListProps): JSX.Element;
|
|
5
|
+
export declare function ThumbnailList({ files, rowCount, handleOpenFile, createThumbnail, }: ThumbnailListProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { ToastPosition } from "react-native-toast-message";
|
|
2
3
|
export interface JobberToastProps {
|
|
3
4
|
/**
|
|
@@ -7,7 +8,7 @@ export interface JobberToastProps {
|
|
|
7
8
|
*/
|
|
8
9
|
readonly bottomOffset?: number;
|
|
9
10
|
}
|
|
10
|
-
export declare function JobberToast({ bottomOffset }: JobberToastProps): JSX.Element;
|
|
11
|
+
export declare function JobberToast({ bottomOffset }: JobberToastProps): React.JSX.Element;
|
|
11
12
|
export interface ShowToastParams {
|
|
12
13
|
/**
|
|
13
14
|
* Message to be displayed in the toast
|
|
@@ -24,9 +24,9 @@ export interface TypographyProps<T extends FontFamily> {
|
|
|
24
24
|
*/
|
|
25
25
|
readonly size?: TextSize;
|
|
26
26
|
/**
|
|
27
|
-
* Text to display
|
|
27
|
+
* Text to display. Supports nesting text elements.
|
|
28
28
|
*/
|
|
29
|
-
readonly children?:
|
|
29
|
+
readonly children?: React.ReactNode;
|
|
30
30
|
/**
|
|
31
31
|
* The maximum amount of lines the text can occupy before being truncated with "...".
|
|
32
32
|
* Uses predefined string values that correspond to a doubling scale for the amount of lines.
|
|
@@ -105,7 +105,7 @@ export interface TypographyUnsafeStyle {
|
|
|
105
105
|
textStyle?: StyleProp<TextStyle>;
|
|
106
106
|
}
|
|
107
107
|
export declare const Typography: React.MemoExoticComponent<typeof InternalTypography>;
|
|
108
|
-
declare function InternalTypography<T extends FontFamily = "base">({ fontFamily, fontStyle, fontWeight, transform, color, align, size, children, maxLines, allowFontScaling, maxFontScaleSize, adjustsFontSizeToFit, lineHeight, letterSpacing, reverseTheme, hideFromScreenReader, accessibilityRole, strikeThrough, underline, UNSAFE_style, selectable, onTextLayout, }: TypographyProps<T>): JSX.Element;
|
|
108
|
+
declare function InternalTypography<T extends FontFamily = "base">({ fontFamily, fontStyle, fontWeight, transform, color, align, size, children, maxLines, allowFontScaling, maxFontScaleSize, adjustsFontSizeToFit, lineHeight, letterSpacing, reverseTheme, hideFromScreenReader, accessibilityRole, strikeThrough, underline, UNSAFE_style, selectable, onTextLayout, }: TypographyProps<T>): React.JSX.Element;
|
|
109
109
|
export type FontFamily = "base" | "display";
|
|
110
110
|
export type FontStyle = "regular" | "italic";
|
|
111
111
|
export type FontWeight = "regular" | "medium" | "bold" | "semiBold" | "extraBold" | "black";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
+
import React from "react";
|
|
2
3
|
/**
|
|
3
4
|
* This is a workaround suggested by react-native-gesture-handler to prevent
|
|
4
5
|
* accidental highlighting of text in Android devices
|
|
5
6
|
* https://github.com/software-mansion/react-native-gesture-handler/issues/1372
|
|
6
7
|
*/
|
|
7
|
-
export declare function TypographyGestureDetector(props: PropsWithChildren<unknown>): JSX.Element;
|
|
8
|
+
export declare function TypographyGestureDetector(props: PropsWithChildren<unknown>): React.JSX.Element;
|
|
@@ -5,5 +5,5 @@ interface MockSafeAreaProviderProps {
|
|
|
5
5
|
readonly frame?: Rect;
|
|
6
6
|
readonly insets?: EdgeInsets;
|
|
7
7
|
}
|
|
8
|
-
export declare function MockSafeAreaProvider({ frame, insets, children, }: MockSafeAreaProviderProps): JSX.Element;
|
|
8
|
+
export declare function MockSafeAreaProvider({ frame, insets, children, }: MockSafeAreaProviderProps): React.JSX.Element;
|
|
9
9
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.84.4-JOB-
|
|
3
|
+
"version": "0.84.4-JOB-138679-b1552ab.68+b1552ab31",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"build": "npm run build:clean && npm run compile",
|
|
33
33
|
"bootstrap": "npm run build",
|
|
34
34
|
"prepack": "npm run build",
|
|
35
|
-
"compile": "tsc -
|
|
35
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
36
36
|
"build:clean": "rm -rf ./dist",
|
|
37
37
|
"storybook": "storybook dev -p 6008 --disable-telemetry",
|
|
38
|
-
"build
|
|
38
|
+
"storybook:build": "storybook build --disable-telemetry"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@react-native-clipboard/clipboard": "^1.11.2",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"autolinker": "^4.0.0",
|
|
44
44
|
"deepmerge": "^4.2.2",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
|
-
"react-hook-form": "^7.
|
|
47
|
-
"react-intl": "^
|
|
46
|
+
"react-hook-form": "^7.52.0",
|
|
47
|
+
"react-intl": "^7.1.11",
|
|
48
48
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
49
49
|
"react-native-modalize": "^2.0.13",
|
|
50
50
|
"react-native-portalize": "^1.0.7",
|
|
@@ -53,18 +53,27 @@
|
|
|
53
53
|
"ts-xor": "^1.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
+
"@react-native-community/datetimepicker": "^8.4.5",
|
|
57
|
+
"@react-native/babel-preset": "^0.81.1",
|
|
56
58
|
"@storybook/addon-a11y": "^9.1.2",
|
|
57
59
|
"@storybook/react": "^9.1.2",
|
|
58
60
|
"@storybook/react-native-web-vite": "^9.1.2",
|
|
59
|
-
"@testing-library/
|
|
60
|
-
"@testing-library/react-native": "^12.0.1",
|
|
61
|
+
"@testing-library/react-native": "^13.3.3",
|
|
61
62
|
"@types/lodash.chunk": "^4.2.7",
|
|
62
63
|
"@types/lodash.debounce": "^4.0.7",
|
|
63
64
|
"@types/lodash.identity": "^3.0.7",
|
|
64
|
-
"@types/react": "^18.0.28",
|
|
65
65
|
"@types/react-native-uuid": "^1.4.0",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"@types/react-test-renderer": "19.1.0",
|
|
67
|
+
"date-fns": "^2.30.0",
|
|
68
|
+
"date-fns-tz": "^2.0.0",
|
|
69
|
+
"react-native": "^0.82.1",
|
|
70
|
+
"react-native-gesture-handler": "^2.29.1",
|
|
71
|
+
"react-native-modal-datetime-picker": "^18.0.0",
|
|
72
|
+
"react-native-reanimated": "^3.7.1",
|
|
73
|
+
"react-native-safe-area-context": "^5.4.0",
|
|
74
|
+
"react-native-svg": "^15.1.0",
|
|
75
|
+
"react-native-web": "^0.20.0",
|
|
76
|
+
"react-test-renderer": "^19.1.1",
|
|
68
77
|
"storybook": "^9.1.2"
|
|
69
78
|
},
|
|
70
79
|
"peerDependencies": {
|
|
@@ -73,10 +82,10 @@
|
|
|
73
82
|
"@react-native-community/datetimepicker": ">=6.7.0",
|
|
74
83
|
"date-fns": "^2.30.0",
|
|
75
84
|
"date-fns-tz": "^2.0.0",
|
|
76
|
-
"react": "^
|
|
77
|
-
"react-intl": "^6
|
|
78
|
-
"react-native": ">=0.
|
|
79
|
-
"react-native-gesture-handler": ">=2.
|
|
85
|
+
"react": "^19",
|
|
86
|
+
"react-intl": "^6 || ^7",
|
|
87
|
+
"react-native": ">=0.79.5",
|
|
88
|
+
"react-native-gesture-handler": ">=2.22.0",
|
|
80
89
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
81
90
|
"react-native-modal-datetime-picker": " >=13.0.0",
|
|
82
91
|
"react-native-modalize": "^2.0.13",
|
|
@@ -85,5 +94,5 @@
|
|
|
85
94
|
"react-native-safe-area-context": "^5.4.0",
|
|
86
95
|
"react-native-svg": ">=12.0.0"
|
|
87
96
|
},
|
|
88
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "b1552ab319204ce883046ea2c22d875952746675"
|
|
89
98
|
}
|
|
@@ -18,9 +18,7 @@ interface ActionItemGroupProps {
|
|
|
18
18
|
readonly children: ActionItemElement | ActionItemElement[];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function ActionItemGroup({
|
|
22
|
-
children,
|
|
23
|
-
}: ActionItemGroupProps): JSX.Element {
|
|
21
|
+
export function ActionItemGroup({ children }: ActionItemGroupProps) {
|
|
24
22
|
return <View>{renderChildren(children)}</View>;
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -117,6 +117,18 @@ describe("ActionLabel", () => {
|
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
});
|
|
120
|
+
|
|
121
|
+
it("supports nested inline content", () => {
|
|
122
|
+
const { Text } = require("../Text");
|
|
123
|
+
const { getByText, toJSON } = render(
|
|
124
|
+
<ActionLabel>
|
|
125
|
+
Before <Text variation="interactive">Inner</Text> After
|
|
126
|
+
</ActionLabel>,
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
expect(getByText("Inner")).toBeDefined();
|
|
130
|
+
expect(toJSON()).toMatchSnapshot();
|
|
131
|
+
});
|
|
120
132
|
});
|
|
121
133
|
|
|
122
134
|
function getStyleObject(el: ReactTestInstance) {
|
|
@@ -12,9 +12,9 @@ type ActionLabelType = "default" | "cardTitle";
|
|
|
12
12
|
|
|
13
13
|
interface ActionLabelProps {
|
|
14
14
|
/**
|
|
15
|
-
* Text to display
|
|
15
|
+
* Text to display. Supports nesting text elements.
|
|
16
16
|
*/
|
|
17
|
-
readonly children?:
|
|
17
|
+
readonly children?: React.ReactNode;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Set the display text to disabled color
|
|
@@ -43,7 +43,7 @@ export function ActionLabel({
|
|
|
43
43
|
type = "default",
|
|
44
44
|
disabled = false,
|
|
45
45
|
align = "center",
|
|
46
|
-
}: ActionLabelProps)
|
|
46
|
+
}: ActionLabelProps) {
|
|
47
47
|
return (
|
|
48
48
|
<Typography
|
|
49
49
|
color={getColor(variation, disabled)}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`ActionLabel supports nested inline content 1`] = `
|
|
4
|
+
<Text
|
|
5
|
+
accessibilityRole="text"
|
|
6
|
+
adjustsFontSizeToFit={false}
|
|
7
|
+
allowFontScaling={true}
|
|
8
|
+
maxFontSizeMultiplier={1.125}
|
|
9
|
+
selectable={false}
|
|
10
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
11
|
+
style={
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
"fontFamily": "inter-semibold",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"color": "hsl(107, 58%, 33%)",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"textAlign": "center",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"fontSize": 16,
|
|
24
|
+
"lineHeight": 18,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"letterSpacing": 0,
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
>
|
|
32
|
+
Before
|
|
33
|
+
<Text
|
|
34
|
+
accessibilityRole="text"
|
|
35
|
+
adjustsFontSizeToFit={false}
|
|
36
|
+
allowFontScaling={true}
|
|
37
|
+
collapsable={false}
|
|
38
|
+
maxFontSizeMultiplier={3.125}
|
|
39
|
+
selectable={true}
|
|
40
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
41
|
+
style={
|
|
42
|
+
[
|
|
43
|
+
{
|
|
44
|
+
"fontFamily": "inter-regular",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"color": "hsl(107, 58%, 33%)",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"textAlign": "left",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"fontSize": 16,
|
|
54
|
+
"lineHeight": 20,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"letterSpacing": 0,
|
|
58
|
+
},
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
Inner
|
|
63
|
+
</Text>
|
|
64
|
+
After
|
|
65
|
+
</Text>
|
|
66
|
+
`;
|
|
@@ -3,9 +3,7 @@ import type { ActivityIndicatorProps } from "react-native";
|
|
|
3
3
|
import { ActivityIndicator } from "react-native";
|
|
4
4
|
import { useAtlantisTheme } from "../AtlantisThemeContext";
|
|
5
5
|
|
|
6
|
-
export function JobberActivityIndicator(
|
|
7
|
-
props: ActivityIndicatorProps,
|
|
8
|
-
): JSX.Element {
|
|
6
|
+
export function JobberActivityIndicator(props: ActivityIndicatorProps) {
|
|
9
7
|
const { tokens } = useAtlantisTheme();
|
|
10
8
|
|
|
11
9
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { renderHook } from "@testing-library/react-
|
|
4
|
+
import { renderHook } from "@testing-library/react-native";
|
|
5
5
|
import type { AtlantisContextProps } from "./AtlantisContext";
|
|
6
6
|
import {
|
|
7
7
|
AtlantisContext,
|
|
@@ -51,24 +51,24 @@ describe("ThemeContext", () => {
|
|
|
51
51
|
expect(result.current.tokens).toEqual(expectedLightTokens);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
it("updates the theme and tokens", () => {
|
|
54
|
+
it("updates the theme and tokens", async () => {
|
|
55
55
|
const { result } = renderHook(useAtlantisTheme, {
|
|
56
56
|
wrapper: (props: AtlantisThemeContextProviderProps) => (
|
|
57
57
|
<Wrapper {...props} />
|
|
58
58
|
),
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
act(() => result.current.setTheme("dark"));
|
|
61
|
+
await act(async () => result.current.setTheme("dark"));
|
|
62
62
|
expect(result.current.theme).toBe("dark");
|
|
63
63
|
expect(result.current.tokens).toEqual(expectedDarkTokens);
|
|
64
64
|
|
|
65
|
-
act(() => result.current.setTheme("light"));
|
|
65
|
+
await act(async () => result.current.setTheme("light"));
|
|
66
66
|
expect(result.current.theme).toBe("light");
|
|
67
67
|
expect(result.current.tokens).toEqual(expectedLightTokens);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
describe("when theme is forced for provider", () => {
|
|
71
|
-
it("ignores updates to the global theme", () => {
|
|
71
|
+
it("ignores updates to the global theme", async () => {
|
|
72
72
|
const { result } = renderHook(useAtlantisTheme, {
|
|
73
73
|
wrapper: (props: AtlantisThemeContextProviderProps) => (
|
|
74
74
|
<WrapperWithOverride {...props} dangerouslyOverrideTheme="light" />
|
|
@@ -76,7 +76,7 @@ describe("ThemeContext", () => {
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
// Update the global theme
|
|
79
|
-
act(() => result.current.setTheme("dark"));
|
|
79
|
+
await act(async () => result.current.setTheme("dark"));
|
|
80
80
|
|
|
81
81
|
// This hook shouldn't be affected by it because it's set to the light theme
|
|
82
82
|
expect(result.current.theme).toBe("light");
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { fireEvent, render } from "@testing-library/react-native";
|
|
3
|
+
import { Linking } from "react-native";
|
|
3
4
|
import { copyTextToClipboard } from "./clipboard";
|
|
4
5
|
import { AutoLink } from "./AutoLink";
|
|
5
6
|
|
|
6
|
-
const mockOpenUrl = jest.
|
|
7
|
-
jest.mock("react-native/Libraries/Linking/Linking", () => ({
|
|
8
|
-
openURL: mockOpenUrl,
|
|
9
|
-
}));
|
|
7
|
+
const mockOpenUrl = jest.spyOn(Linking, "openURL").mockImplementation();
|
|
10
8
|
|
|
11
9
|
jest.mock("./clipboard", () => {
|
|
12
10
|
return {
|
|
@@ -11,7 +11,7 @@ export function AutoLink({
|
|
|
11
11
|
bottomTabsVisible = true,
|
|
12
12
|
selectable = true,
|
|
13
13
|
...rest
|
|
14
|
-
}: AutoLinkProps)
|
|
14
|
+
}: AutoLinkProps) {
|
|
15
15
|
const { splitText, matches } = useCreateLinkedText({ text, ...rest });
|
|
16
16
|
const { tokens } = useAtlantisTheme();
|
|
17
17
|
|
|
@@ -8,11 +8,7 @@ interface LinkProps {
|
|
|
8
8
|
readonly onLongPress?: () => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function Link({
|
|
12
|
-
children,
|
|
13
|
-
onPress,
|
|
14
|
-
onLongPress,
|
|
15
|
-
}: LinkProps): JSX.Element {
|
|
11
|
+
export function Link({ children, onPress, onLongPress }: LinkProps) {
|
|
16
12
|
return (
|
|
17
13
|
<RNText onPress={onPress} onLongPress={onLongPress}>
|
|
18
14
|
<Text variation="interactive">{children}</Text>
|
|
@@ -35,6 +35,18 @@ describe("Banner", () => {
|
|
|
35
35
|
expect(getByText("Notice me")).toBeDefined();
|
|
36
36
|
expect(icon.props.children.props.name).toBe("starburst");
|
|
37
37
|
});
|
|
38
|
+
|
|
39
|
+
it("renders a success Banner", () => {
|
|
40
|
+
const { getByText, getByTestId } = render(
|
|
41
|
+
<Banner type="success">
|
|
42
|
+
<Text>Your import is complete</Text>
|
|
43
|
+
</Banner>,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const icon = getByTestId("ATL-Banner-Icon");
|
|
47
|
+
expect(getByText("Your import is complete")).toBeDefined();
|
|
48
|
+
expect(icon.props.children.props.name).toBe("checkmark");
|
|
49
|
+
});
|
|
38
50
|
});
|
|
39
51
|
|
|
40
52
|
describe("Children", () => {
|
package/src/Banner/Banner.tsx
CHANGED
|
@@ -18,7 +18,7 @@ export function Banner({
|
|
|
18
18
|
type,
|
|
19
19
|
children,
|
|
20
20
|
icon,
|
|
21
|
-
}: BannerProps)
|
|
21
|
+
}: BannerProps) {
|
|
22
22
|
const bannerIcon = icon || getBannerIcon(type);
|
|
23
23
|
|
|
24
24
|
const shouldFlow =
|
|
@@ -60,7 +60,7 @@ export function Banner({
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
function BannerChildren({ children }: PropsWithChildren)
|
|
63
|
+
function BannerChildren({ children }: PropsWithChildren) {
|
|
64
64
|
if (!children) return <></>;
|
|
65
65
|
|
|
66
66
|
if (children && typeof children === "string") {
|
|
@@ -97,5 +97,7 @@ function getBannerIcon(type: BannerTypes): IconNames | undefined {
|
|
|
97
97
|
return "help";
|
|
98
98
|
case "error":
|
|
99
99
|
return "alert";
|
|
100
|
+
case "success":
|
|
101
|
+
return "checkmark";
|
|
100
102
|
}
|
|
101
103
|
}
|
|
@@ -10,7 +10,7 @@ export interface BannerIconProps {
|
|
|
10
10
|
readonly type: BannerTypes;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function BannerIcon({ icon, type }: BannerIconProps)
|
|
13
|
+
export function BannerIcon({ icon, type }: BannerIconProps) {
|
|
14
14
|
const styles = useStyles();
|
|
15
15
|
|
|
16
16
|
return (
|
package/src/Banner/types.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { IconNames } from "@jobber/design";
|
|
|
2
2
|
import type { ReactElement } from "react";
|
|
3
3
|
import type { StyleProp, ViewStyle } from "react-native";
|
|
4
4
|
|
|
5
|
-
export type BannerTypes = "error" | "warning" | "notice";
|
|
5
|
+
export type BannerTypes = "error" | "warning" | "notice" | "success";
|
|
6
6
|
|
|
7
7
|
export interface BannerStyleProps {
|
|
8
8
|
/**
|
|
@@ -43,42 +43,42 @@ function setup({
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
it("renders a BottomSheet", async () => {
|
|
46
|
-
const {
|
|
46
|
+
const { findByText } = setup({});
|
|
47
47
|
|
|
48
48
|
await waitForUntestableRender(
|
|
49
49
|
"Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
act(() => {
|
|
52
|
+
await act(async () => {
|
|
53
53
|
ref.current?.open();
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
expect(
|
|
56
|
+
expect(await findByText("BottomSheet")).toBeDefined();
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it("renders a BottomSheet with a header", async () => {
|
|
60
60
|
const header = "Hello this is header";
|
|
61
|
-
const {
|
|
61
|
+
const { findByText } = setup({ heading: header });
|
|
62
62
|
|
|
63
63
|
await waitForUntestableRender(
|
|
64
64
|
"Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
-
act(() => {
|
|
67
|
+
await act(async () => {
|
|
68
68
|
ref.current?.open();
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
expect(
|
|
71
|
+
expect(await findByText(header)).toBeDefined();
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
it("BottomSheet can be closed with the cancel action", async () => {
|
|
75
|
-
const {
|
|
75
|
+
const { findByLabelText, queryByText } = setup({ showCancel: true });
|
|
76
76
|
|
|
77
|
-
act(() => {
|
|
77
|
+
await act(async () => {
|
|
78
78
|
ref.current?.open();
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
fireEvent.press(
|
|
81
|
+
fireEvent.press(await findByLabelText("Cancel"));
|
|
82
82
|
|
|
83
83
|
await waitFor(() => {
|
|
84
84
|
expect(queryByText("BottomSheet")).toBeNull();
|
|
@@ -93,7 +93,7 @@ describe("when loading is provided and true", () => {
|
|
|
93
93
|
"Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
|
|
94
94
|
);
|
|
95
95
|
|
|
96
|
-
act(() => {
|
|
96
|
+
await act(async () => {
|
|
97
97
|
ref.current?.open();
|
|
98
98
|
});
|
|
99
99
|
|
|
@@ -104,25 +104,25 @@ describe("when loading is provided and true", () => {
|
|
|
104
104
|
it("calls onClose when BottomSheet is closed", async () => {
|
|
105
105
|
setup({});
|
|
106
106
|
|
|
107
|
-
act(() => {
|
|
107
|
+
await act(async () => {
|
|
108
108
|
ref.current?.open();
|
|
109
109
|
ref.current?.close();
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
await waitFor(() => {
|
|
113
|
-
expect(mockOnClose).
|
|
113
|
+
expect(mockOnClose).toHaveBeenCalledTimes(1);
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
it("calls onOpen when BottomSheet is opened", async () => {
|
|
118
118
|
setup({});
|
|
119
119
|
|
|
120
|
-
act(() => {
|
|
120
|
+
await act(async () => {
|
|
121
121
|
ref.current?.open();
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
await waitFor(() => {
|
|
125
|
-
expect(mockOnOpen).
|
|
125
|
+
expect(mockOnOpen).toHaveBeenCalledTimes(1);
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -132,17 +132,17 @@ describe("when there is a screen reader enabled", () => {
|
|
|
132
132
|
.spyOn(AccessibilityInfo, "isScreenReaderEnabled")
|
|
133
133
|
.mockImplementation(() => Promise.resolve(true));
|
|
134
134
|
|
|
135
|
-
const {
|
|
135
|
+
const { findByLabelText, queryByText } = setup({});
|
|
136
136
|
|
|
137
137
|
await waitForUntestableRender(
|
|
138
138
|
"Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
|
|
139
139
|
);
|
|
140
140
|
|
|
141
|
-
act(() => {
|
|
141
|
+
await act(async () => {
|
|
142
142
|
ref.current?.open();
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
fireEvent.press(
|
|
145
|
+
fireEvent.press(await findByLabelText("Cancel"));
|
|
146
146
|
|
|
147
147
|
await waitFor(() => {
|
|
148
148
|
expect(queryByText("BottomSheet")).toBeNull();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode, Ref, RefObject } from "react";
|
|
2
2
|
import React, { forwardRef, useState } from "react";
|
|
3
|
-
import { Modalize } from "react-native-modalize";
|
|
3
|
+
import type { Modalize } from "react-native-modalize";
|
|
4
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
5
5
|
import { Keyboard, View } from "react-native";
|
|
6
6
|
import { BottomSheetOption } from "./components/BottomSheetOption";
|
|
7
7
|
import { useStyles } from "./BottomSheet.style";
|
|
8
|
+
import { UNSAFE_WrappedModalize } from "../ContentOverlay/UNSAFE_WrappedModalize";
|
|
8
9
|
import { useIsScreenReaderEnabled } from "../hooks";
|
|
9
10
|
import { Divider } from "../Divider";
|
|
10
11
|
import { Heading } from "../Heading";
|
|
@@ -61,7 +62,7 @@ function BottomSheetInternal(
|
|
|
61
62
|
return (
|
|
62
63
|
<>
|
|
63
64
|
{open && <Overlay styles={styles} />}
|
|
64
|
-
<
|
|
65
|
+
<UNSAFE_WrappedModalize
|
|
65
66
|
ref={ref}
|
|
66
67
|
adjustToContentHeight={true}
|
|
67
68
|
modalStyle={styles.modal}
|
|
@@ -90,7 +91,7 @@ function BottomSheetInternal(
|
|
|
90
91
|
>
|
|
91
92
|
{children}
|
|
92
93
|
</View>
|
|
93
|
-
</
|
|
94
|
+
</UNSAFE_WrappedModalize>
|
|
94
95
|
</>
|
|
95
96
|
);
|
|
96
97
|
|
|
@@ -25,7 +25,7 @@ export function BottomSheetOption({
|
|
|
25
25
|
destructive,
|
|
26
26
|
textTransform = "capitalize",
|
|
27
27
|
onPress,
|
|
28
|
-
}: BottomSheetOptionProps)
|
|
28
|
+
}: BottomSheetOptionProps) {
|
|
29
29
|
const destructiveColor = "destructive";
|
|
30
30
|
const textVariation = destructive ? destructiveColor : "subdued";
|
|
31
31
|
const styles = useStyles();
|