@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,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ControllerProps,
|
|
1
|
+
import type { ReactElement, RefObject } from "react";
|
|
2
|
+
import type { ControllerProps, DefaultValues, FieldPath, FieldValues, Mode, UseFormReturn } from "react-hook-form";
|
|
3
3
|
import type { IconNames } from "@jobber/design";
|
|
4
4
|
import type { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
5
|
-
export type FormValues<T> =
|
|
5
|
+
export type FormValues<T> = T;
|
|
6
6
|
export type FormErrors = FormNetworkErrors | FormUserErrors;
|
|
7
7
|
export type FormBannerMessage = FormWarningMessage | FormNoticeMessage;
|
|
8
8
|
export declare enum FormSubmitErrorType {
|
|
@@ -37,7 +37,7 @@ interface FormNoticeMessage {
|
|
|
37
37
|
message: string;
|
|
38
38
|
}
|
|
39
39
|
export type FormRef<T extends FieldValues = FieldValues> = (UseFormReturn<T> & {
|
|
40
|
-
scrollViewRef?: RefObject<KeyboardAwareScrollView>;
|
|
40
|
+
scrollViewRef?: RefObject<KeyboardAwareScrollView | null>;
|
|
41
41
|
saveButtonHeight?: number;
|
|
42
42
|
messageBannerHeight?: number;
|
|
43
43
|
}) | undefined;
|
|
@@ -81,7 +81,7 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
|
|
|
81
81
|
* The initial values of the form inputs
|
|
82
82
|
* This should be available as soon as initialLoading is set to false
|
|
83
83
|
*/
|
|
84
|
-
initialValues?:
|
|
84
|
+
initialValues?: DefaultValues<T>;
|
|
85
85
|
/**
|
|
86
86
|
* When the validation should happen.
|
|
87
87
|
* Possible values are "onBlur", "onChange", "onSubmit", "onTouched", and "all".
|
|
@@ -97,7 +97,7 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
|
|
|
97
97
|
/**
|
|
98
98
|
* ref object to access react hook form methods and state
|
|
99
99
|
*/
|
|
100
|
-
formRef?:
|
|
100
|
+
formRef?: RefObject<FormRef<T> | undefined>;
|
|
101
101
|
/**
|
|
102
102
|
* Label to be displayed for the save button
|
|
103
103
|
*/
|
|
@@ -106,7 +106,7 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
|
|
|
106
106
|
* @deprecated use `secondaryAction` instead.
|
|
107
107
|
* Override default save button in the sticky section of the form with another element.
|
|
108
108
|
*/
|
|
109
|
-
renderStickySection?: (onSubmit: () => void, label: string | undefined, isSubmitting: boolean) =>
|
|
109
|
+
renderStickySection?: (onSubmit: () => void, label: string | undefined, isSubmitting: boolean) => ReactElement;
|
|
110
110
|
/**
|
|
111
111
|
* Adding a key will save a local copy of the form data that will be used to
|
|
112
112
|
* recover values when the app is backgrounded or has crashed.
|
|
@@ -131,6 +131,12 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
|
|
|
131
131
|
* If a user opens the same form the data will only be loaded if the `localCacheId` matches
|
|
132
132
|
*/
|
|
133
133
|
localCacheId?: string | string[];
|
|
134
|
+
/**
|
|
135
|
+
* If true, the local cache will be removed when the user navigates away from
|
|
136
|
+
* the dirty form even when offline. By default, cache is only removed on back when online.
|
|
137
|
+
* Defaults to false.
|
|
138
|
+
*/
|
|
139
|
+
UNSAFE_allowDiscardLocalCacheWhenOffline?: boolean;
|
|
134
140
|
/**
|
|
135
141
|
* Secondary Action for ButtonGroup
|
|
136
142
|
*/
|
|
@@ -20,5 +20,5 @@ interface FormFieldProps<T> {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly validations?: RegisterOptions;
|
|
22
22
|
}
|
|
23
|
-
export declare function FormField<T>({ name, children, defaultValue: value, validations, }: FormFieldProps<T>): JSX.Element;
|
|
23
|
+
export declare function FormField<T>({ name, children, defaultValue: value, validations, }: FormFieldProps<T>): React.JSX.Element;
|
|
24
24
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { BottomSheetOptionsSuffix } from "./components/FormatFileBottomSheet";
|
|
2
3
|
import type { CreateThumbnail, File, FileUpload, FormattedFile } from "./types";
|
|
3
4
|
export interface FormatFileProps<T> {
|
|
@@ -43,4 +44,4 @@ export interface FormatFileProps<T> {
|
|
|
43
44
|
readonly showFileTypeIndicator?: boolean;
|
|
44
45
|
readonly createThumbnail?: CreateThumbnail;
|
|
45
46
|
}
|
|
46
|
-
export declare function FormatFile<T extends File | FileUpload>({ file, accessibilityLabel, accessibilityHint, onTap, onRemove, bottomSheetOptionsSuffix, styleInGrid, testID, showFileTypeIndicator, createThumbnail, onPreviewPress, }: FormatFileProps<T>): JSX.Element;
|
|
47
|
+
export declare function FormatFile<T extends File | FileUpload>({ file, accessibilityLabel, accessibilityHint, onTap, onRemove, bottomSheetOptionsSuffix, styleInGrid, testID, showFileTypeIndicator, createThumbnail, onPreviewPress, }: FormatFileProps<T>): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function ErrorIcon(): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { FormattedFile } from "../../types";
|
|
2
3
|
interface FileViewProps {
|
|
3
4
|
readonly accessibilityLabel?: string;
|
|
@@ -7,5 +8,5 @@ interface FileViewProps {
|
|
|
7
8
|
readonly styleInGrid: boolean;
|
|
8
9
|
readonly onUploadComplete: () => void;
|
|
9
10
|
}
|
|
10
|
-
export declare function FileView({ accessibilityLabel, styleInGrid, file, showOverlay, showError, onUploadComplete, }: FileViewProps): JSX.Element;
|
|
11
|
+
export declare function FileView({ accessibilityLabel, styleInGrid, file, showOverlay, showError, onUploadComplete, }: FileViewProps): React.JSX.Element;
|
|
11
12
|
export {};
|
package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import type { BottomSheetRef } from "../../../BottomSheet/BottomSheet";
|
|
3
4
|
export type BottomSheetOptionsSuffix = "receipt" | "image" | "file" | "video";
|
|
4
5
|
interface FormatFileBottomSheetProps {
|
|
5
|
-
readonly bottomSheetRef: RefObject<BottomSheetRef>;
|
|
6
|
+
readonly bottomSheetRef: RefObject<BottomSheetRef | null>;
|
|
6
7
|
readonly onPreviewPress?: () => void;
|
|
7
8
|
readonly onRemovePress?: () => void;
|
|
8
9
|
readonly bottomSheetOptionsSuffix?: BottomSheetOptionsSuffix;
|
|
9
10
|
}
|
|
10
|
-
export declare const FormatFileBottomSheet: ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }: FormatFileBottomSheetProps) => JSX.Element;
|
|
11
|
+
export declare const FormatFileBottomSheet: ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }: FormatFileBottomSheetProps) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { FormattedFile } from "../../types";
|
|
2
3
|
interface MediaViewProps {
|
|
3
4
|
readonly accessibilityLabel?: string;
|
|
@@ -7,5 +8,5 @@ interface MediaViewProps {
|
|
|
7
8
|
readonly styleInGrid: boolean;
|
|
8
9
|
readonly onUploadComplete: () => void;
|
|
9
10
|
}
|
|
10
|
-
export declare function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, }: MediaViewProps): JSX.Element;
|
|
11
|
+
export declare function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, }: MediaViewProps): React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { StatusCode } from "../../types";
|
|
2
3
|
interface ProgressBarProps {
|
|
3
4
|
/**
|
|
@@ -13,5 +14,5 @@ interface ProgressBarProps {
|
|
|
13
14
|
*/
|
|
14
15
|
readonly onComplete?: () => void;
|
|
15
16
|
}
|
|
16
|
-
export declare const ProgressBar: ({ progress, status, onComplete, }: ProgressBarProps) => JSX.Element;
|
|
17
|
+
export declare const ProgressBar: ({ progress, status, onComplete, }: ProgressBarProps) => React.JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { TextAlign, TextColor, TruncateLength, TypographyProps } from "../Typography";
|
|
2
3
|
type HeadingColor = Extract<TextColor, "text" | "subdued" | "heading">;
|
|
3
4
|
export type HeadingLevel = "title" | "subtitle" | "heading" | "subHeading";
|
|
4
5
|
interface HeadingProps<T extends HeadingLevel> extends Pick<TypographyProps<"base">, "selectable"> {
|
|
5
6
|
/**
|
|
6
|
-
* Text to display.
|
|
7
|
+
* Text to display. Supports nesting text elements.
|
|
7
8
|
*/
|
|
8
|
-
readonly children:
|
|
9
|
+
readonly children: React.ReactNode;
|
|
9
10
|
/**
|
|
10
11
|
* The type of heading, e.g., "Title"
|
|
11
12
|
*/
|
|
@@ -33,5 +34,5 @@ interface HeadingProps<T extends HeadingLevel> extends Pick<TypographyProps<"bas
|
|
|
33
34
|
readonly allowFontScaling?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export declare const HEADING_MAX_SCALED_FONT_SIZE: Record<HeadingLevel, number>;
|
|
36
|
-
export declare function Heading<T extends HeadingLevel = "heading">({ children, level, variation, reverseTheme, align, maxLines, allowFontScaling, selectable, }: HeadingProps<T>): JSX.Element;
|
|
37
|
+
export declare function Heading<T extends HeadingLevel = "heading">({ children, level, variation, reverseTheme, align, maxLines, allowFontScaling, selectable, }: HeadingProps<T>): React.JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { IconColorNames, IconNames, IconSizes } from "@jobber/design";
|
|
2
3
|
export interface IconProps {
|
|
3
4
|
/** The icon to show. */
|
|
@@ -22,4 +23,4 @@ export interface IconProps {
|
|
|
22
23
|
*/
|
|
23
24
|
readonly testID?: string;
|
|
24
25
|
}
|
|
25
|
-
export declare function Icon({ name, color, size, customColor, testID, }: IconProps): JSX.Element;
|
|
26
|
+
export declare function Icon({ name, color, size, customColor, testID, }: IconProps): React.JSX.Element;
|
|
@@ -31,5 +31,5 @@ interface IconButtonProps {
|
|
|
31
31
|
*/
|
|
32
32
|
readonly testID?: string;
|
|
33
33
|
}
|
|
34
|
-
export declare function IconButton({ badge, name, color, customColor, onPress, accessibilityLabel, testID, }: IconButtonProps): JSX.Element;
|
|
34
|
+
export declare function IconButton({ badge, name, color, customColor, onPress, accessibilityLabel, testID, }: IconButtonProps): React.JSX.Element;
|
|
35
35
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { FormatNumberOptions } from "react-intl";
|
|
2
3
|
import type { ControllerRenderProps, FieldValues } from "react-hook-form";
|
|
3
4
|
import type { InputTextProps } from "../InputText";
|
|
@@ -28,4 +29,4 @@ export interface InputCurrencyProps extends Omit<InputTextProps, "keyboard" | "o
|
|
|
28
29
|
readonly keyboard?: "decimal-pad" | "numbers-and-punctuation";
|
|
29
30
|
}
|
|
30
31
|
export declare const getInternalValue: (props: InputCurrencyProps, field: ControllerRenderProps<FieldValues, string>, formatNumber: (value: number, opts?: FormatNumberOptions | undefined) => string) => string;
|
|
31
|
-
export declare function InputCurrency(props: InputCurrencyProps): JSX.Element;
|
|
32
|
+
export declare function InputCurrency(props: InputCurrencyProps): React.JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { UseControllerProps } from "react-hook-form";
|
|
2
3
|
import type { XOR } from "ts-xor";
|
|
3
4
|
import type { Clearable } from "@jobber/hooks";
|
|
4
5
|
import type { InputFieldWrapperProps } from "../InputFieldWrapper";
|
|
5
|
-
|
|
6
|
+
import type { InputPressableProps } from "../InputPressable/InputPressable";
|
|
7
|
+
interface BaseInputDateProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">, Pick<InputPressableProps, "showMiniLabel"> {
|
|
6
8
|
/**
|
|
7
9
|
* Defaulted to "always" so user can clear the dates whenever there's a value.
|
|
8
10
|
*/
|
|
@@ -70,5 +72,5 @@ export type InputDateProps = XOR<FormControlledInputDate, DevControlledInputDate
|
|
|
70
72
|
/**
|
|
71
73
|
* Allow users to select a date using the device date picker.
|
|
72
74
|
*/
|
|
73
|
-
export declare function InputDate(props: InputDateProps): JSX.Element;
|
|
75
|
+
export declare function InputDate(props: InputDateProps): React.JSX.Element;
|
|
74
76
|
export {};
|
|
@@ -26,7 +26,14 @@ export interface InputFieldWrapperProps {
|
|
|
26
26
|
* Text that goes below the input to help the user understand the input
|
|
27
27
|
*/
|
|
28
28
|
readonly assistiveText?: string;
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Controls how the placeholder text is displayed.
|
|
31
|
+
* - normal: the placeholder text will be displayed in the normal placeholder position
|
|
32
|
+
* - mini: the placeholder text will float above the input value
|
|
33
|
+
* - hidden: the placeholder text will not be displayed
|
|
34
|
+
* @default "normal"
|
|
35
|
+
*/
|
|
36
|
+
readonly placeholderMode?: "normal" | "mini" | "hidden";
|
|
30
37
|
readonly hasValue?: boolean;
|
|
31
38
|
/**
|
|
32
39
|
* Symbol to display before the text input
|
|
@@ -78,4 +85,4 @@ export interface InputFieldWrapperProps {
|
|
|
78
85
|
}
|
|
79
86
|
export declare const INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID = "ATL-InputFieldWrapper-Glimmers";
|
|
80
87
|
export declare const INPUT_FIELD_WRAPPER_SPINNER_TEST_ID = "ATL-InputFieldWrapper-Spinner";
|
|
81
|
-
export declare function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix,
|
|
88
|
+
export declare function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, placeholderMode, hasValue, error, focused, children, onClear, showClearAction, styleOverride, toolbar, toolbarVisibility, loading, loadingType, }: InputFieldWrapperProps): React.JSX.Element;
|
|
@@ -23,6 +23,7 @@ export declare const useStyles: () => {
|
|
|
23
23
|
right: number;
|
|
24
24
|
bottom: number;
|
|
25
25
|
left: number;
|
|
26
|
+
zIndex: number;
|
|
26
27
|
};
|
|
27
28
|
miniLabel: {
|
|
28
29
|
top: number;
|
|
@@ -30,7 +31,6 @@ export declare const useStyles: () => {
|
|
|
30
31
|
backgroundColor: string;
|
|
31
32
|
marginRight: number;
|
|
32
33
|
maxHeight: number;
|
|
33
|
-
zIndex: number;
|
|
34
34
|
};
|
|
35
35
|
miniLabelShowClearAction: {
|
|
36
36
|
backgroundColor: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
interface ClearActionProps {
|
|
2
3
|
/**
|
|
3
4
|
* Press handler
|
|
@@ -5,5 +6,5 @@ interface ClearActionProps {
|
|
|
5
6
|
readonly onPress: () => void;
|
|
6
7
|
readonly hasMarginRight?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function ClearAction({ onPress, hasMarginRight, }: ClearActionProps): JSX.Element;
|
|
9
|
+
export declare function ClearAction({ onPress, hasMarginRight, }: ClearActionProps): React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
3
|
import type { IconNames } from "@jobber/design";
|
|
3
4
|
export interface PrefixLabelProps {
|
|
4
5
|
readonly focused: boolean;
|
|
5
6
|
readonly disabled?: boolean;
|
|
6
|
-
readonly
|
|
7
|
+
readonly miniLabelActive: boolean;
|
|
7
8
|
readonly inputInvalid: boolean;
|
|
8
9
|
readonly label: string;
|
|
9
10
|
readonly styleOverride?: StyleProp<TextStyle>;
|
|
10
11
|
}
|
|
11
12
|
export declare const prefixLabelTestId = "ATL-InputFieldWrapper-PrefixLabel";
|
|
12
13
|
export declare const prefixIconTestId = "ATL-InputFieldWrapper-PrefixIcon";
|
|
13
|
-
export declare function PrefixLabel({ focused, disabled,
|
|
14
|
+
export declare function PrefixLabel({ focused, disabled, miniLabelActive, inputInvalid, label, styleOverride, }: PrefixLabelProps): React.JSX.Element;
|
|
14
15
|
export interface PrefixIconProps {
|
|
15
16
|
readonly focused: boolean;
|
|
16
17
|
readonly disabled?: boolean;
|
|
17
|
-
readonly hasMiniLabel: boolean;
|
|
18
18
|
readonly inputInvalid?: boolean;
|
|
19
19
|
readonly icon: IconNames;
|
|
20
20
|
readonly styleOverride?: StyleProp<ViewStyle>;
|
|
21
21
|
}
|
|
22
|
-
export declare function PrefixIcon({ focused, disabled, inputInvalid, icon, }: PrefixIconProps): JSX.Element;
|
|
22
|
+
export declare function PrefixIcon({ focused, disabled, inputInvalid, icon, }: PrefixIconProps): React.JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { StyleProp, TextStyle } from "react-native";
|
|
2
3
|
import type { IconNames } from "@jobber/design";
|
|
3
4
|
export interface SuffixLabelProps {
|
|
4
5
|
readonly focused: boolean;
|
|
5
6
|
readonly disabled?: boolean;
|
|
6
|
-
readonly
|
|
7
|
+
readonly miniLabelActive: boolean;
|
|
7
8
|
readonly inputInvalid?: boolean;
|
|
8
9
|
readonly label: string;
|
|
9
10
|
readonly hasLeftMargin?: boolean;
|
|
@@ -11,14 +12,13 @@ export interface SuffixLabelProps {
|
|
|
11
12
|
}
|
|
12
13
|
export declare const suffixLabelTestId = "ATL-InputFieldWrapper-SuffixLabel";
|
|
13
14
|
export declare const suffixIconTestId = "ATL-InputFieldWrapper-SuffixIcon";
|
|
14
|
-
export declare function SuffixLabel({ focused, disabled,
|
|
15
|
+
export declare function SuffixLabel({ focused, disabled, miniLabelActive, inputInvalid, label, hasLeftMargin, styleOverride, }: SuffixLabelProps): React.JSX.Element;
|
|
15
16
|
export interface SuffixIconProps {
|
|
16
17
|
readonly focused: boolean;
|
|
17
18
|
readonly disabled?: boolean;
|
|
18
|
-
readonly hasMiniLabel: boolean;
|
|
19
19
|
readonly inputInvalid?: boolean;
|
|
20
20
|
readonly icon: IconNames;
|
|
21
21
|
readonly hasLeftMargin?: boolean;
|
|
22
22
|
readonly onPress?: () => void;
|
|
23
23
|
}
|
|
24
|
-
export declare function SuffixIcon({ focused, disabled, inputInvalid, icon, hasLeftMargin, onPress, }: SuffixIconProps): JSX.Element;
|
|
24
|
+
export declare function SuffixIcon({ focused, disabled, inputInvalid, icon, hasLeftMargin, onPress, }: SuffixIconProps): React.JSX.Element;
|
|
@@ -39,6 +39,14 @@ export interface InputPressableProps {
|
|
|
39
39
|
* Indicates the current selection is invalid
|
|
40
40
|
*/
|
|
41
41
|
readonly invalid?: boolean | string;
|
|
42
|
+
/**
|
|
43
|
+
* Controls the visibility of the mini label that appears inside the input
|
|
44
|
+
* when a value is entered. By default, the placeholder text moves up to
|
|
45
|
+
* become a mini label. Set to false to disable this behavior.
|
|
46
|
+
*
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
readonly showMiniLabel?: boolean;
|
|
42
50
|
/**
|
|
43
51
|
* Callback that is called when the text input is focused
|
|
44
52
|
* @param event
|
|
@@ -79,5 +87,5 @@ export interface InputPressableProps {
|
|
|
79
87
|
}
|
|
80
88
|
export type InputPressableRef = NativeText;
|
|
81
89
|
export declare const InputPressable: React.ForwardRefExoticComponent<InputPressableProps & React.RefAttributes<NativeText>>;
|
|
82
|
-
export declare function InputPressableInternal({ value, placeholder, disabled, invalid, error, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable, onClear, focused, }: InputPressableProps, ref: Ref<InputPressableRef>): JSX.Element;
|
|
90
|
+
export declare function InputPressableInternal({ value, placeholder, disabled, invalid, error, showMiniLabel, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable, onClear, focused, }: InputPressableProps, ref: Ref<InputPressableRef>): React.JSX.Element;
|
|
83
91
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { InputTextProps, InputTextRef } from "../InputText";
|
|
3
3
|
export declare const InputSearch: React.ForwardRefExoticComponent<InputSearchProps & React.RefAttributes<InputTextRef>>;
|
|
4
|
-
export interface InputSearchProps extends Pick<InputTextProps, "accessibilityHint" | "accessibilityLabel" | "autoFocus" | "placeholder" | "prefix"> {
|
|
4
|
+
export interface InputSearchProps extends Pick<InputTextProps, "accessibilityHint" | "accessibilityLabel" | "autoFocus" | "placeholder" | "prefix" | "showMiniLabel"> {
|
|
5
5
|
/**
|
|
6
6
|
* A callback function that handles the update of the new value of the property value.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
interface FilterButtonProps {
|
|
2
3
|
readonly accessibilityLabel: string;
|
|
3
4
|
readonly onClick: () => void;
|
|
4
5
|
}
|
|
5
|
-
export declare function FilterButton({ accessibilityLabel, onClick, }: FilterButtonProps): JSX.Element;
|
|
6
|
+
export declare function FilterButton({ accessibilityLabel, onClick, }: FilterButtonProps): React.JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SyntheticEvent } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import type {
|
|
3
|
+
import type { FocusEvent, StyleProp, TextInputProps, TextStyle } from "react-native";
|
|
4
4
|
import { TextInput } from "react-native";
|
|
5
5
|
import type { RegisterOptions } from "react-hook-form";
|
|
6
6
|
import type { IconNames } from "@jobber/design";
|
|
@@ -31,6 +31,14 @@ export interface InputTextProps extends Pick<InputFieldWrapperProps, "toolbar" |
|
|
|
31
31
|
* Text that helps the user understand the input
|
|
32
32
|
*/
|
|
33
33
|
readonly assistiveText?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Controls the visibility of the mini label that appears inside the input
|
|
36
|
+
* when a value is entered. By default, the placeholder text moves up to
|
|
37
|
+
* become a mini label. Set to false to disable this behavior.
|
|
38
|
+
*
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
readonly showMiniLabel?: boolean;
|
|
34
42
|
/**
|
|
35
43
|
* Determines what keyboard is shown
|
|
36
44
|
*/
|
|
@@ -65,7 +73,7 @@ export interface InputTextProps extends Pick<InputFieldWrapperProps, "toolbar" |
|
|
|
65
73
|
* Callback that is called when the text input is focused
|
|
66
74
|
* @param event
|
|
67
75
|
*/
|
|
68
|
-
readonly onFocus?: (event?:
|
|
76
|
+
readonly onFocus?: (event?: FocusEvent) => void;
|
|
69
77
|
/**
|
|
70
78
|
* Callback that is called when the text input is blurred
|
|
71
79
|
*/
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { UseControllerProps } from "react-hook-form";
|
|
2
3
|
import type { XOR } from "ts-xor";
|
|
3
4
|
import type { Clearable } from "@jobber/hooks";
|
|
4
5
|
import type { InputFieldWrapperProps } from "../InputFieldWrapper";
|
|
5
|
-
|
|
6
|
+
import type { InputPressableProps } from "../InputPressable/InputPressable";
|
|
7
|
+
interface InputTimeBaseProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">, Pick<InputPressableProps, "showMiniLabel"> {
|
|
6
8
|
/**
|
|
7
9
|
* Defaulted to "always" so user can clear the time whenever there's a value.
|
|
8
10
|
*/
|
|
@@ -57,5 +59,5 @@ interface InputTimeDevControlled extends InputTimeBaseProps {
|
|
|
57
59
|
readonly onChange: (value?: Date) => void;
|
|
58
60
|
}
|
|
59
61
|
export type InputTimeProps = XOR<InputTimeFormControlled, InputTimeDevControlled>;
|
|
60
|
-
export declare function InputTime(props: InputTimeProps): JSX.Element;
|
|
62
|
+
export declare function InputTime(props: InputTimeProps): React.JSX.Element;
|
|
61
63
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { MenuOptionInternalProps } from "../../types";
|
|
2
|
-
export declare function MenuOption({ label, icon, iconColor, textAlign, destructive, textTransform, onPress, setOpen, }: MenuOptionInternalProps): JSX.Element;
|
|
3
|
+
export declare function MenuOption({ label, icon, iconColor, textAlign, destructive, textTransform, onPress, setOpen, }: MenuOptionInternalProps): React.JSX.Element;
|
|
@@ -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
|
export interface MenuOptionProps {
|
|
4
5
|
readonly label: string;
|
|
@@ -12,9 +13,13 @@ export interface MenuOptionProps {
|
|
|
12
13
|
export interface MenuOptionInternalProps extends MenuOptionProps {
|
|
13
14
|
setOpen: (bool: boolean) => void;
|
|
14
15
|
}
|
|
16
|
+
export interface CustomActivatorProps {
|
|
17
|
+
readonly onPress?: () => void;
|
|
18
|
+
readonly onLongPress?: () => void;
|
|
19
|
+
}
|
|
15
20
|
export interface MenuProps {
|
|
16
21
|
readonly menuOptions?: MenuOptionProps[];
|
|
17
|
-
readonly customActivator?:
|
|
22
|
+
readonly customActivator?: ReactElement<CustomActivatorProps>;
|
|
18
23
|
}
|
|
19
24
|
export interface OverlayProp {
|
|
20
25
|
setOpen: (bool: boolean) => void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { ProgressBarProps } from "./types";
|
|
2
|
-
export declare function ProgressBar({ loading, total, current, inProgress, reverseTheme, header, variation, size, }: ProgressBarProps): JSX.Element;
|
|
3
|
+
export declare function ProgressBar({ loading, total, current, inProgress, reverseTheme, header, variation, size, }: ProgressBarProps): React.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
interface ProgressBarInnerProps {
|
|
2
3
|
readonly width: number;
|
|
3
4
|
readonly animationDuration?: number;
|
|
4
5
|
readonly color?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function ProgressBarInner({ width, color, }: ProgressBarInnerProps): JSX.Element;
|
|
7
|
+
export declare function ProgressBarInner({ width, color, }: ProgressBarInnerProps): React.JSX.Element;
|
|
7
8
|
export declare function calculateWidth(total: number, current: number): number;
|
|
8
9
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import type { RegisterOptions } from "react-hook-form";
|
|
3
4
|
export interface SelectOption {
|
|
4
5
|
/**
|
|
@@ -69,5 +70,5 @@ export interface SelectProps {
|
|
|
69
70
|
*/
|
|
70
71
|
readonly testID?: string;
|
|
71
72
|
}
|
|
72
|
-
export declare function Select({ value, defaultValue, onChange, children, placeholder, label, assistiveText, disabled, invalid, validations, accessibilityLabel, name, testID, }: SelectProps): JSX.Element;
|
|
73
|
-
export declare function Option({ children }: SelectOption): JSX.Element;
|
|
73
|
+
export declare function Select({ value, defaultValue, onChange, children, placeholder, label, assistiveText, disabled, invalid, validations, accessibilityLabel, name, testID, }: SelectProps): React.JSX.Element;
|
|
74
|
+
export declare function Option({ children }: SelectOption): React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { SelectInternalPickerProps } from "../../types";
|
|
2
3
|
type SelectDefaultPickerProps = SelectInternalPickerProps;
|
|
3
|
-
export declare function SelectDefaultPicker({ children, options, disabled, onChange, }: SelectDefaultPickerProps): JSX.Element;
|
|
4
|
+
export declare function SelectDefaultPicker({ children, options, disabled, onChange, }: SelectDefaultPickerProps): React.JSX.Element;
|
|
4
5
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { SelectInternalPickerProps } from "../../types";
|
|
2
3
|
type SelectDefaultPickerProps = SelectInternalPickerProps;
|
|
3
|
-
export declare function SelectDefaultPicker({ children, options, onChange, }: SelectDefaultPickerProps): JSX.Element;
|
|
4
|
+
export declare function SelectDefaultPicker({ children, options, onChange, }: SelectDefaultPickerProps): React.JSX.Element;
|
|
4
5
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { SelectInternalPickerProps } from "../../types";
|
|
2
|
-
export declare function SelectInternalPicker({ children, options, disabled, onChange, }: SelectInternalPickerProps): JSX.Element;
|
|
3
|
+
export declare function SelectInternalPicker({ children, options, disabled, onChange, }: SelectInternalPickerProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { PressableProps } from "react-native";
|
|
2
3
|
import type { SelectInternalPickerProps } from "../../types";
|
|
3
4
|
type SelectPressableProps = Pick<SelectInternalPickerProps, "children"> & Pick<PressableProps, "onPress">;
|
|
@@ -6,5 +7,5 @@ type SelectPressableProps = Pick<SelectInternalPickerProps, "children"> & Pick<P
|
|
|
6
7
|
* screen-reader is being used to avoid screen-readers from ignoring the press
|
|
7
8
|
* on the MenuView
|
|
8
9
|
*/
|
|
9
|
-
export declare function SelectPressable({ children, onPress
|
|
10
|
+
export declare function SelectPressable({ children, onPress }: SelectPressableProps): React.JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export type StatusType = "success" | "warning" | "critical" | "inactive" | "informative";
|
|
2
3
|
export interface StatusLabelType {
|
|
3
4
|
readonly statusLabel: string;
|
|
@@ -17,5 +18,5 @@ interface StatusLabelProps {
|
|
|
17
18
|
*/
|
|
18
19
|
readonly status?: StatusType;
|
|
19
20
|
}
|
|
20
|
-
export declare function StatusLabel({ text, alignment, status, }: StatusLabelProps): JSX.Element;
|
|
21
|
+
export declare function StatusLabel({ text, alignment, status, }: StatusLabelProps): React.JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { XOR } from "ts-xor";
|
|
2
3
|
import type { BaseSwitchProps } from "./components/BaseSwitch";
|
|
3
4
|
interface WithLabelProps extends BaseSwitchProps {
|
|
@@ -11,5 +12,5 @@ interface WithLabelProps extends BaseSwitchProps {
|
|
|
11
12
|
readonly description?: string;
|
|
12
13
|
}
|
|
13
14
|
export type SwitchProps = XOR<BaseSwitchProps, WithLabelProps>;
|
|
14
|
-
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
15
|
+
export declare function Switch(props: SwitchProps): React.JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export interface BaseSwitchProps {
|
|
2
3
|
/**
|
|
3
4
|
* Value of the switch
|
|
@@ -24,4 +25,4 @@ export interface BaseSwitchProps {
|
|
|
24
25
|
*/
|
|
25
26
|
readonly name?: string;
|
|
26
27
|
}
|
|
27
|
-
export declare function BaseSwitch({ value, defaultValue, onValueChange, disabled, accessibilityLabel, name, }: BaseSwitchProps): JSX.Element;
|
|
28
|
+
export declare function BaseSwitch({ value, defaultValue, onValueChange, disabled, accessibilityLabel, name, }: BaseSwitchProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { OnTextLayoutEvent, TextAlign, TextVariation, TruncateLength, TypographyProps } from "../Typography";
|
|
2
3
|
import type { TypographyUnsafeStyle } from "../Typography/Typography";
|
|
3
4
|
export interface TextProps extends Pick<TypographyProps<"base">, "maxFontScaleSize" | "selectable"> {
|
|
@@ -31,9 +32,9 @@ export interface TextProps extends Pick<TypographyProps<"base">, "maxFontScaleSi
|
|
|
31
32
|
*/
|
|
32
33
|
readonly align?: TextAlign;
|
|
33
34
|
/**
|
|
34
|
-
* Text to display
|
|
35
|
+
* Text to display. Supports nesting text elements.
|
|
35
36
|
*/
|
|
36
|
-
readonly children?:
|
|
37
|
+
readonly children?: React.ReactNode;
|
|
37
38
|
/**
|
|
38
39
|
* Reverse theme for better display on dark background
|
|
39
40
|
*/
|
|
@@ -73,4 +74,4 @@ export interface TextProps extends Pick<TypographyProps<"base">, "maxFontScaleSi
|
|
|
73
74
|
}
|
|
74
75
|
export type TextLevel = "text" | "textSupporting";
|
|
75
76
|
export declare const TEXT_MAX_SCALED_FONT_SIZES: Record<TextLevel, number>;
|
|
76
|
-
export declare function Text({ level, variation, emphasis, allowFontScaling, adjustsFontSizeToFit, maxLines, align, children, reverseTheme, strikeThrough, italic, hideFromScreenReader, maxFontScaleSize, UNSAFE_style, underline, selectable, onTextLayout, }: TextProps): JSX.Element;
|
|
77
|
+
export declare function Text({ level, variation, emphasis, allowFontScaling, adjustsFontSizeToFit, maxLines, align, children, reverseTheme, strikeThrough, italic, hideFromScreenReader, maxFontScaleSize, UNSAFE_style, underline, selectable, onTextLayout, }: TextProps): React.JSX.Element;
|