@jobber/components-native 0.54.4-JOB-88641.9 → 0.54.4-fix-inline.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/package.json +7 -7
  2. package/dist/src/ActionItem/ActionItem.js +1 -1
  3. package/dist/src/Banner/Banner.js +1 -1
  4. package/dist/src/Button/Button.js +2 -2
  5. package/dist/src/Button/Button.style.js +2 -2
  6. package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +3 -0
  7. package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
  8. package/dist/src/ButtonGroup/ButtonGroup.style.js +1 -1
  9. package/dist/src/Card/Card.js +7 -8
  10. package/dist/src/Disclosure/Disclosure.js +3 -3
  11. package/dist/src/Glimmer/Glimmer.js +42 -0
  12. package/dist/src/Glimmer/Glimmer.shape.style.js +16 -0
  13. package/dist/src/Glimmer/Glimmer.size.style.js +9 -0
  14. package/dist/src/Glimmer/Glimmer.style.js +20 -0
  15. package/dist/src/Glimmer/index.js +1 -0
  16. package/dist/src/InputCurrency/InputCurrency.js +16 -17
  17. package/dist/src/InputFieldWrapper/InputFieldWrapper.js +39 -18
  18. package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +38 -1
  19. package/dist/src/InputText/InputText.js +6 -3
  20. package/dist/src/Menu/Menu.js +20 -3
  21. package/dist/src/Menu/Menu.style.js +1 -1
  22. package/dist/src/Menu/utils.js +2 -7
  23. package/dist/src/index.js +6 -5
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
  26. package/dist/types/src/ButtonGroup/ButtonGroup.style.d.ts +1 -1
  27. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +6 -6
  28. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -2
  29. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -3
  30. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -4
  31. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +1 -1
  32. package/dist/types/src/FormField/FormField.d.ts +2 -2
  33. package/dist/types/src/FormatFile/FormatFile.d.ts +6 -6
  34. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +6 -6
  35. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +4 -4
  36. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +6 -6
  37. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +3 -3
  38. package/dist/types/src/Glimmer/Glimmer.d.ts +31 -0
  39. package/dist/types/src/Glimmer/Glimmer.shape.style.d.ts +14 -0
  40. package/dist/types/src/Glimmer/Glimmer.size.style.d.ts +17 -0
  41. package/dist/types/src/Glimmer/Glimmer.style.d.ts +18 -0
  42. package/dist/types/src/Glimmer/index.d.ts +1 -0
  43. package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
  44. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +19 -1
  45. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +34 -0
  46. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +12 -12
  47. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +14 -14
  48. package/dist/types/src/InputPassword/InputPassword.d.ts +1 -1
  49. package/dist/types/src/InputText/InputText.d.ts +6 -2
  50. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +1 -1
  51. package/dist/types/src/Toast/Toast.d.ts +1 -1
  52. package/dist/types/src/index.d.ts +6 -5
  53. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
  54. package/jestSetup.js +2 -0
  55. package/package.json +7 -7
  56. package/src/ActionItem/ActionItem.test.tsx +2 -2
  57. package/src/ActionItem/ActionItem.tsx +3 -1
  58. package/src/ActionItem/ActionItemGroup.tsx +1 -0
  59. package/src/AutoLink/hooks/useCreateLinkedText.ts +1 -0
  60. package/src/AutoLink/hooks/useTokenGenerator.ts +1 -0
  61. package/src/Banner/Banner.tsx +1 -1
  62. package/src/BottomSheet/BottomSheet.tsx +3 -3
  63. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +3 -1
  64. package/src/Button/Button.style.ts +2 -2
  65. package/src/Button/Button.test.tsx +2 -2
  66. package/src/Button/Button.tsx +2 -2
  67. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +4 -0
  68. package/src/ButtonGroup/ButtonGroup.style.ts +1 -1
  69. package/src/ButtonGroup/ButtonGroup.tsx +1 -0
  70. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +7 -6
  71. package/src/Card/Card.tsx +31 -32
  72. package/src/Card/components/InternalCardHeader.tsx +1 -0
  73. package/src/Checkbox/CheckboxGroup.tsx +12 -2
  74. package/src/Chip/Chip.tsx +2 -0
  75. package/src/Content/Content.test.tsx +1 -0
  76. package/src/Content/Content.tsx +1 -0
  77. package/src/ContentOverlay/ContentOverlay.test.tsx +1 -0
  78. package/src/Disclosure/Disclosure.tsx +3 -8
  79. package/src/Disclosure/__snapshots__/Disclosure.test.tsx.snap +18 -24
  80. package/src/Divider/Divider.tsx +1 -0
  81. package/src/EmptyState/EmptyState.tsx +2 -2
  82. package/src/Flex/Flex.styles.tsx +1 -0
  83. package/src/Flex/Flex.test.tsx +2 -0
  84. package/src/Form/Form.test.tsx +19 -14
  85. package/src/Form/components/FormBody/FormBody.tsx +4 -3
  86. package/src/Form/components/FormCache/FormCache.tsx +5 -4
  87. package/src/Form/components/FormMessage/FormMessage.tsx +1 -0
  88. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -1
  89. package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +5 -5
  90. package/src/Form/context/AtlantisFormContext.tsx +1 -0
  91. package/src/Form/hooks/useFormViewRefs.ts +1 -0
  92. package/src/Form/hooks/useOfflineHandler.ts +1 -0
  93. package/src/Form/hooks/useScrollToError/useScrollToError.ts +2 -0
  94. package/src/FormField/FormField.test.tsx +6 -8
  95. package/src/FormField/FormField.tsx +2 -2
  96. package/src/FormatFile/FormatFile.tsx +15 -14
  97. package/src/FormatFile/components/FileView/FileView.tsx +9 -6
  98. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +4 -4
  99. package/src/FormatFile/components/MediaView/MediaView.tsx +15 -14
  100. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +3 -3
  101. package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -0
  102. package/src/Glimmer/Glimmer.shape.style.ts +17 -0
  103. package/src/Glimmer/Glimmer.size.style.ts +10 -0
  104. package/src/Glimmer/Glimmer.style.ts +23 -0
  105. package/src/Glimmer/Glimmer.test.tsx +73 -0
  106. package/src/Glimmer/Glimmer.tsx +106 -0
  107. package/src/Glimmer/index.ts +1 -0
  108. package/src/Icon/Icon.tsx +1 -0
  109. package/src/Icon/__snapshots__/Icon.test.tsx.snap +89 -24
  110. package/src/InputCurrency/InputCurrency.tsx +40 -38
  111. package/src/InputCurrency/utils.ts +9 -0
  112. package/src/InputDate/InputDate.test.tsx +1 -0
  113. package/src/InputFieldWrapper/InputFieldWrapper.style.ts +46 -1
  114. package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +74 -0
  115. package/src/InputFieldWrapper/InputFieldWrapper.tsx +131 -64
  116. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -0
  117. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +12 -12
  118. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +14 -14
  119. package/src/InputNumber/InputNumber.tsx +8 -0
  120. package/src/InputPassword/InputPassword.test.tsx +1 -0
  121. package/src/InputPassword/InputPassword.tsx +2 -1
  122. package/src/InputPressable/InputPressable.test.tsx +1 -0
  123. package/src/InputSearch/InputSearch.tsx +1 -0
  124. package/src/InputText/InputText.test.tsx +11 -0
  125. package/src/InputText/InputText.tsx +27 -2
  126. package/src/InputText/context/InputAccessoriesProvider.test.tsx +6 -1
  127. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  128. package/src/InputTime/utils/index.ts +1 -0
  129. package/src/Menu/Menu.style.ts +1 -1
  130. package/src/Menu/Menu.tsx +23 -2
  131. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
  132. package/src/Menu/utils.ts +3 -7
  133. package/src/ProgressBar/ProgressBarInner.tsx +1 -0
  134. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -0
  135. package/src/Select/components/SelectInternalPicker/utils.ts +1 -0
  136. package/src/StatusLabel/StatusLabel.tsx +1 -1
  137. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -0
  138. package/src/Text/Text.tsx +1 -0
  139. package/src/Toast/Toast.tsx +2 -1
  140. package/src/Typography/Typography.tsx +5 -0
  141. package/src/hooks/useAtlantisI18n/utils/dateFormatter.ts +1 -0
  142. package/src/hooks/useFormController.ts +2 -0
  143. package/src/index.ts +6 -5
  144. package/src/utils/intl/capitalize.ts +1 -0
  145. package/src/utils/test/MockSafeAreaProvider.tsx +3 -3
@@ -8,6 +8,6 @@ export interface BottomSheetOptionProps {
8
8
  readonly textAlign?: TextAlign;
9
9
  readonly destructive?: boolean;
10
10
  readonly textTransform?: "none" | "capitalize";
11
- onPress: () => void;
11
+ readonly onPress: () => void;
12
12
  }
13
13
  export declare function BottomSheetOption({ text, icon, iconColor, textAlign, destructive, textTransform, onPress, }: BottomSheetOptionProps): JSX.Element;
@@ -3,11 +3,11 @@ export declare const styles: {
3
3
  width: string;
4
4
  flexDirection: "row";
5
5
  justifyContent: "flex-end";
6
+ gap: number;
6
7
  };
7
8
  button: {
8
9
  flexBasis: number;
9
10
  flexGrow: number;
10
- paddingRight: number;
11
11
  };
12
12
  moreButton: {
13
13
  flexBasis: number;
@@ -2,12 +2,12 @@ import { RefObject } from "react";
2
2
  import { ButtonGroupSecondaryActionProps } from "../../types";
3
3
  import { BottomSheetRef } from "../../../BottomSheet/BottomSheet";
4
4
  interface SecondaryActionSheetProps {
5
- actions: ButtonGroupSecondaryActionProps[];
6
- secondaryActionsRef: RefObject<BottomSheetRef>;
7
- showCancel?: boolean;
8
- heading?: string;
9
- onOpenBottomSheet?: () => void;
10
- onCloseBottomSheet?: () => void;
5
+ readonly actions: ButtonGroupSecondaryActionProps[];
6
+ readonly secondaryActionsRef: RefObject<BottomSheetRef>;
7
+ readonly showCancel?: boolean;
8
+ readonly heading?: string;
9
+ readonly onOpenBottomSheet?: () => void;
10
+ readonly onCloseBottomSheet?: () => void;
11
11
  }
12
12
  export declare function SecondaryActionSheet({ actions, secondaryActionsRef, heading, showCancel, onOpenBottomSheet, onCloseBottomSheet, }: SecondaryActionSheetProps): JSX.Element;
13
13
  export {};
@@ -6,8 +6,8 @@ interface CommonCheckboxGroupProps extends Omit<CheckboxProps, "onChange"> {
6
6
  /**
7
7
  * Checkbox items
8
8
  */
9
- children: CheckboxElement[];
10
- state?: CheckboxGroupState;
9
+ readonly children: CheckboxElement[];
10
+ readonly state?: CheckboxGroupState;
11
11
  onChange?(groupChecks: CheckboxGroupState): void;
12
12
  }
13
13
  interface ControlledCheckboxGroupProps extends CommonCheckboxGroupProps {
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { FormActionBarProps } from "../FormActionBar";
3
3
  interface FormBodyProps extends FormActionBarProps {
4
- children: JSX.Element;
5
- shouldRenderActionBar?: boolean;
6
- saveButtonOffset?: number;
4
+ readonly children: JSX.Element;
5
+ readonly shouldRenderActionBar?: boolean;
6
+ readonly saveButtonOffset?: number;
7
7
  }
8
8
  export declare function FormBody({ isFormSubmitting, submit, keyboardHeight, children, saveButtonLabel, renderStickySection, shouldRenderActionBar, secondaryActions, setSecondaryActionLoading, setSaveButtonHeight, saveButtonOffset, }: FormBodyProps): JSX.Element;
9
9
  export declare function useBottomPadding(): number;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { FieldValues } from "react-hook-form";
3
3
  interface FormCacheProps<T extends FieldValues> {
4
- localCacheId?: string | string[];
5
- localCacheKey?: string;
6
- localCacheExclude?: string[];
7
- setLocalCache: (data: T) => void;
4
+ readonly localCacheId?: string | string[];
5
+ readonly localCacheKey?: string;
6
+ readonly localCacheExclude?: string[];
7
+ readonly setLocalCache: (data: T) => void;
8
8
  }
9
9
  export declare function FormCache<T extends FieldValues>({ localCacheExclude, localCacheKey, setLocalCache, }: FormCacheProps<T>): JSX.Element;
10
10
  export {};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { FormBannerMessage } from "../../types";
3
3
  interface FormMessageBannerProps {
4
- bannerMessages?: FormBannerMessage[];
4
+ readonly bannerMessages?: FormBannerMessage[];
5
5
  }
6
6
  export declare function FormMessageBanner({ bannerMessages, }: FormMessageBannerProps): JSX.Element;
7
7
  export {};
@@ -4,7 +4,7 @@ interface FormFieldProps<T> {
4
4
  /**
5
5
  * Name of the field.
6
6
  */
7
- name: string;
7
+ readonly name: string;
8
8
  /**
9
9
  * The initial value of the form field.
10
10
  */
@@ -12,7 +12,7 @@ interface FormFieldProps<T> {
12
12
  /**
13
13
  * Children to render.
14
14
  */
15
- children: (field: ControllerRenderProps<FieldValues, string>, error?: FieldError) => React.ReactNode;
15
+ readonly children: (field: ControllerRenderProps<FieldValues, string>, error?: FieldError) => React.ReactNode;
16
16
  /**
17
17
  * Rules for returning an error when validations are violated.
18
18
  * WARNING: This component needs to be nested inside a FormProvider
@@ -5,7 +5,7 @@ export interface FormatFileProps<T> {
5
5
  /**
6
6
  * File upload details object. Can be a File or a FileUpload
7
7
  */
8
- file: T;
8
+ readonly file: T;
9
9
  /**
10
10
  * Accessibility label
11
11
  */
@@ -17,23 +17,23 @@ export interface FormatFileProps<T> {
17
17
  /**
18
18
  * A function which handles the onTap event.
19
19
  */
20
- onTap?: (file: T) => void;
20
+ readonly onTap?: (file: T) => void;
21
21
  /**
22
22
  * A function to be called on "Remove" Bottom Sheet Option press
23
23
  */
24
- onRemove?: () => void;
24
+ readonly onRemove?: () => void;
25
25
  /**
26
26
  * Handler for the "Preview" Bottom Sheet Option press
27
27
  */
28
- onPreviewPress?: (formattedFile: FormattedFile) => void;
28
+ readonly onPreviewPress?: (formattedFile: FormattedFile) => void;
29
29
  /**
30
30
  * A file type to show at Bottom Sheet options
31
31
  */
32
- bottomSheetOptionsSuffix?: BottomSheetOptionsSuffix;
32
+ readonly bottomSheetOptionsSuffix?: BottomSheetOptionsSuffix;
33
33
  /**
34
34
  * Uses a grid layout when multi-file upload is supported
35
35
  */
36
- styleInGrid?: boolean;
36
+ readonly styleInGrid?: boolean;
37
37
  /**
38
38
  * A reference to the element in the rendered output
39
39
  */
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { FormattedFile } from "../../types";
3
3
  interface FileViewProps {
4
- accessibilityLabel?: string;
5
- showOverlay: boolean;
6
- showError: boolean;
7
- file: FormattedFile;
8
- styleInGrid: boolean;
9
- onUploadComplete: () => void;
4
+ readonly accessibilityLabel?: string;
5
+ readonly showOverlay: boolean;
6
+ readonly showError: boolean;
7
+ readonly file: FormattedFile;
8
+ readonly styleInGrid: boolean;
9
+ readonly onUploadComplete: () => void;
10
10
  }
11
11
  export declare function FileView({ accessibilityLabel, styleInGrid, file, showOverlay, showError, onUploadComplete, }: FileViewProps): JSX.Element;
12
12
  export {};
@@ -2,10 +2,10 @@ import { RefObject } from "react";
2
2
  import { BottomSheetRef } from "../../../BottomSheet/BottomSheet";
3
3
  export type BottomSheetOptionsSuffix = "receipt" | "image" | "file" | "video";
4
4
  interface FormatFileBottomSheetProps {
5
- bottomSheetRef: RefObject<BottomSheetRef>;
6
- onPreviewPress?: () => void;
7
- onRemovePress?: () => void;
8
- bottomSheetOptionsSuffix?: BottomSheetOptionsSuffix;
5
+ readonly bottomSheetRef: RefObject<BottomSheetRef>;
6
+ readonly onPreviewPress?: () => void;
7
+ readonly onRemovePress?: () => void;
8
+ readonly bottomSheetOptionsSuffix?: BottomSheetOptionsSuffix;
9
9
  }
10
10
  export declare const FormatFileBottomSheet: ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }: FormatFileBottomSheetProps) => JSX.Element;
11
11
  export {};
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { FormattedFile } from "../../types";
3
3
  interface MediaViewProps {
4
- accessibilityLabel?: string;
5
- showOverlay: boolean;
6
- showError: boolean;
7
- file: FormattedFile;
8
- styleInGrid: boolean;
9
- onUploadComplete: () => void;
4
+ readonly accessibilityLabel?: string;
5
+ readonly showOverlay: boolean;
6
+ readonly showError: boolean;
7
+ readonly file: FormattedFile;
8
+ readonly styleInGrid: boolean;
9
+ readonly onUploadComplete: () => void;
10
10
  }
11
11
  export declare function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, }: MediaViewProps): JSX.Element;
12
12
  export {};
@@ -5,15 +5,15 @@ interface ProgressBarProps {
5
5
  /**
6
6
  * Upload progress value from 0 to 1
7
7
  */
8
- progress: number;
8
+ readonly progress: number;
9
9
  /**
10
10
  * Upload status
11
11
  */
12
- status: StatusCode;
12
+ readonly status: StatusCode;
13
13
  /**
14
14
  * Function to be called when the progress is finished
15
15
  */
16
- onComplete?: () => void;
16
+ readonly onComplete?: () => void;
17
17
  }
18
18
  export declare const ProgressBar: ({ progress, status, onComplete, }: ProgressBarProps) => JSX.Element;
19
19
  export {};
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import { sizeStyles } from "./Glimmer.size.style";
3
+ import { shapeStyles } from "./Glimmer.shape.style";
4
+ export type GlimmerShapes = keyof typeof shapeStyles;
5
+ export type GlimmerSizes = keyof typeof sizeStyles;
6
+ export type GlimmerTimings = "base" | "fast";
7
+ interface GlimmerProps {
8
+ /**
9
+ * Sets the size of the glimmer.
10
+ */
11
+ readonly shape?: GlimmerShapes;
12
+ /**
13
+ * Sets the shape of the glimmer.
14
+ *
15
+ * If you need a specific width, use the `width` prop.
16
+ */
17
+ readonly size?: GlimmerSizes;
18
+ /**
19
+ * Control how fast the shine moves from left to right. This is useful when
20
+ * the glimmer is used on smaller spaces.
21
+ */
22
+ readonly timing?: GlimmerTimings;
23
+ /**
24
+ * Adjust the width of the glimmer in px or % values.
25
+ */
26
+ readonly width?: number | `${number}%`;
27
+ }
28
+ export declare const GLIMMER_TEST_ID = "ATL-Glimmer";
29
+ export declare const GLIMMER_SHINE_TEST_ID = "ATL-Glimmer-Shine";
30
+ export declare function Glimmer({ width, shape, size, timing, }: GlimmerProps): JSX.Element;
31
+ export {};
@@ -0,0 +1,14 @@
1
+ export declare const shapeStyles: {
2
+ rectangle: {
3
+ width: string;
4
+ };
5
+ square: {
6
+ width: string;
7
+ aspectRatio: number;
8
+ };
9
+ circle: {
10
+ width: string;
11
+ aspectRatio: number;
12
+ borderRadius: number;
13
+ };
14
+ };
@@ -0,0 +1,17 @@
1
+ export declare const sizeStyles: {
2
+ small: {
3
+ height: number;
4
+ };
5
+ base: {
6
+ height: number;
7
+ };
8
+ large: {
9
+ height: number;
10
+ };
11
+ larger: {
12
+ height: number;
13
+ };
14
+ largest: {
15
+ height: number;
16
+ };
17
+ };
@@ -0,0 +1,18 @@
1
+ export declare const shineWidth: number;
2
+ export declare const styles: {
3
+ container: {
4
+ backgroundColor: string;
5
+ overflow: "hidden";
6
+ position: "relative";
7
+ width: string;
8
+ height: number;
9
+ borderRadius: number;
10
+ };
11
+ shine: {
12
+ position: "absolute";
13
+ top: number;
14
+ left: number;
15
+ width: number;
16
+ height: string;
17
+ };
18
+ };
@@ -0,0 +1 @@
1
+ export * from "./Glimmer";
@@ -24,9 +24,9 @@ export interface InputCurrencyProps extends Omit<InputTextProps, "keyboard" | "o
24
24
  */
25
25
  readonly maxLength?: number;
26
26
  onChange?(newValue?: number | string | undefined): void;
27
- value?: number;
28
- defaultValue?: number;
29
- keyboard?: "decimal-pad" | "numbers-and-punctuation";
27
+ readonly value?: number;
28
+ readonly defaultValue?: number;
29
+ readonly keyboard?: "decimal-pad" | "numbers-and-punctuation";
30
30
  }
31
31
  export declare const getInternalValue: (props: InputCurrencyProps, field: ControllerRenderProps<FieldValues, string>, formatNumber: (value: number, opts?: FormatNumberOptions | undefined) => string) => string;
32
32
  export declare function InputCurrency(props: InputCurrencyProps): JSX.Element;
@@ -59,5 +59,23 @@ export interface InputFieldWrapperProps {
59
59
  * Custom styling to override default style of the input field
60
60
  */
61
61
  readonly styleOverride?: InputFieldStyleOverride;
62
+ /**
63
+ * Add a toolbar below the input field for actions like rewriting the text.
64
+ */
65
+ readonly toolbar?: React.ReactNode;
66
+ /**
67
+ * Change the behaviour of when the toolbar becomes visible.
68
+ */
69
+ readonly toolbarVisibility?: "always" | "while-editing";
70
+ /**
71
+ * Show loading indicator.
72
+ */
73
+ readonly loading?: boolean;
74
+ /**
75
+ * Change the type of loading indicator to spinner or glimmer.
76
+ */
77
+ readonly loadingType?: "spinner" | "glimmer";
62
78
  }
63
- export declare function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, hasMiniLabel, hasValue, error, focused, children, onClear, showClearAction, styleOverride, }: InputFieldWrapperProps): JSX.Element;
79
+ export declare const INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID = "ATL-InputFieldWrapper-Glimmers";
80
+ export declare const INPUT_FIELD_WRAPPER_SPINNER_TEST_ID = "ATL-InputFieldWrapper-Spinner";
81
+ export declare function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, hasMiniLabel, hasValue, error, focused, children, onClear, showClearAction, styleOverride, toolbar, toolbarVisibility, loading, loadingType, }: InputFieldWrapperProps): JSX.Element;
@@ -11,6 +11,12 @@ export declare const styles: {
11
11
  borderStyle: "solid";
12
12
  borderWidth: number;
13
13
  borderRadius: number;
14
+ } | {
15
+ flexDirection: "column";
16
+ };
17
+ field: {
18
+ flexDirection: "row";
19
+ alignItems: "center";
14
20
  };
15
21
  inputContainer: {
16
22
  flexDirection: "row";
@@ -36,6 +42,7 @@ export declare const styles: {
36
42
  top: number;
37
43
  paddingTop: number;
38
44
  backgroundColor: string;
45
+ marginRight: number;
39
46
  maxHeight: number;
40
47
  zIndex: number;
41
48
  };
@@ -83,4 +90,31 @@ export declare const styles: {
83
90
  flexDirection: "row";
84
91
  zIndex: number;
85
92
  };
93
+ toolbar: {
94
+ flexBasis: string;
95
+ flexDirection: "row";
96
+ gap: number;
97
+ paddingBottom: number;
98
+ };
99
+ loadingSpinner: {
100
+ justifyContent: "center";
101
+ paddingRight: number;
102
+ };
103
+ loadingGlimmers: {
104
+ position: "absolute";
105
+ top: number;
106
+ bottom: number;
107
+ left: number;
108
+ right: number;
109
+ gap: number;
110
+ paddingTop: number;
111
+ paddingRight: number;
112
+ backgroundColor: string;
113
+ overflow: "hidden";
114
+ };
115
+ loadingGlimmersHasValue: {
116
+ top: number;
117
+ paddingTop: number;
118
+ bottom: number;
119
+ };
86
120
  };
@@ -2,22 +2,22 @@
2
2
  import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
3
  import { IconNames } from "@jobber/design";
4
4
  export interface PrefixLabelProps {
5
- focused: boolean;
6
- disabled?: boolean;
7
- hasMiniLabel: boolean;
8
- inputInvalid: boolean;
9
- label: string;
10
- styleOverride?: StyleProp<TextStyle>;
5
+ readonly focused: boolean;
6
+ readonly disabled?: boolean;
7
+ readonly hasMiniLabel: boolean;
8
+ readonly inputInvalid: boolean;
9
+ readonly label: string;
10
+ readonly styleOverride?: StyleProp<TextStyle>;
11
11
  }
12
12
  export declare const prefixLabelTestId = "ATL-InputFieldWrapper-PrefixLabel";
13
13
  export declare const prefixIconTestId = "ATL-InputFieldWrapper-PrefixIcon";
14
14
  export declare function PrefixLabel({ focused, disabled, hasMiniLabel, inputInvalid, label, styleOverride, }: PrefixLabelProps): JSX.Element;
15
15
  export interface PrefixIconProps {
16
- focused: boolean;
17
- disabled?: boolean;
18
- hasMiniLabel: boolean;
19
- inputInvalid?: boolean;
20
- icon: IconNames;
21
- styleOverride?: StyleProp<ViewStyle>;
16
+ readonly focused: boolean;
17
+ readonly disabled?: boolean;
18
+ readonly hasMiniLabel: boolean;
19
+ readonly inputInvalid?: boolean;
20
+ readonly icon: IconNames;
21
+ readonly styleOverride?: StyleProp<ViewStyle>;
22
22
  }
23
23
  export declare function PrefixIcon({ focused, disabled, inputInvalid, icon, }: PrefixIconProps): JSX.Element;
@@ -2,24 +2,24 @@
2
2
  import { StyleProp, TextStyle } from "react-native";
3
3
  import { IconNames } from "@jobber/design";
4
4
  export interface SuffixLabelProps {
5
- focused: boolean;
6
- disabled?: boolean;
7
- hasMiniLabel: boolean;
8
- inputInvalid?: boolean;
9
- label: string;
10
- hasLeftMargin?: boolean;
11
- styleOverride?: StyleProp<TextStyle>;
5
+ readonly focused: boolean;
6
+ readonly disabled?: boolean;
7
+ readonly hasMiniLabel: boolean;
8
+ readonly inputInvalid?: boolean;
9
+ readonly label: string;
10
+ readonly hasLeftMargin?: boolean;
11
+ readonly styleOverride?: StyleProp<TextStyle>;
12
12
  }
13
13
  export declare const suffixLabelTestId = "ATL-InputFieldWrapper-SuffixLabel";
14
14
  export declare const suffixIconTestId = "ATL-InputFieldWrapper-SuffixIcon";
15
15
  export declare function SuffixLabel({ focused, disabled, hasMiniLabel, inputInvalid, label, hasLeftMargin, styleOverride, }: SuffixLabelProps): JSX.Element;
16
16
  export interface SuffixIconProps {
17
- focused: boolean;
18
- disabled?: boolean;
19
- hasMiniLabel: boolean;
20
- inputInvalid?: boolean;
21
- icon: IconNames;
22
- hasLeftMargin?: boolean;
23
- onPress?: () => void;
17
+ readonly focused: boolean;
18
+ readonly disabled?: boolean;
19
+ readonly hasMiniLabel: boolean;
20
+ readonly inputInvalid?: boolean;
21
+ readonly icon: IconNames;
22
+ readonly hasLeftMargin?: boolean;
23
+ readonly onPress?: () => void;
24
24
  }
25
25
  export declare function SuffixIcon({ focused, disabled, inputInvalid, icon, hasLeftMargin, onPress, }: SuffixIconProps): JSX.Element;
@@ -7,5 +7,5 @@ export interface InputPasswordProps extends Omit<InputTextProps, "keyboard" | "s
7
7
  *
8
8
  * @default true
9
9
  */
10
- usePrivacyEye?: boolean;
10
+ readonly usePrivacyEye?: boolean;
11
11
  }
@@ -3,8 +3,8 @@ import { NativeSyntheticEvent, StyleProp, TextInput, TextInputFocusEventData, Te
3
3
  import { RegisterOptions } from "react-hook-form";
4
4
  import { IconNames } from "@jobber/design";
5
5
  import { Clearable } from "@jobber/hooks";
6
- import { InputFieldStyleOverride } from "../InputFieldWrapper/InputFieldWrapper";
7
- export interface InputTextProps {
6
+ import { InputFieldStyleOverride, InputFieldWrapperProps } from "../InputFieldWrapper/InputFieldWrapper";
7
+ export interface InputTextProps extends Pick<InputFieldWrapperProps, "toolbar" | "toolbarVisibility" | "loading" | "loadingType"> {
8
8
  /**
9
9
  * Highlights the field red and shows message below (if string) to indicate an error
10
10
  */
@@ -13,6 +13,10 @@ export interface InputTextProps {
13
13
  * Disable the input
14
14
  */
15
15
  readonly disabled?: boolean;
16
+ /**
17
+ * Makes the input read-only
18
+ */
19
+ readonly readonly?: boolean;
16
20
  /**
17
21
  * Name of the input.
18
22
  */
@@ -1,4 +1,4 @@
1
1
  import { ReactNode } from "react";
2
2
  export declare function InputAccessoriesProvider({ children, }: {
3
- children: ReactNode;
3
+ readonly children: ReactNode;
4
4
  }): JSX.Element;
@@ -6,7 +6,7 @@ export interface JobberToastProps {
6
6
  * Has effect only when the position is "bottom".
7
7
  * @default 40
8
8
  */
9
- bottomOffset?: number;
9
+ readonly bottomOffset?: number;
10
10
  }
11
11
  export declare function JobberToast({ bottomOffset }: JobberToastProps): JSX.Element;
12
12
  export interface ShowToastParams {
@@ -17,29 +17,30 @@ export * from "./Divider";
17
17
  export * from "./EmptyState";
18
18
  export * from "./ErrorMessageWrapper";
19
19
  export * from "./Flex";
20
- export * from "./FormatFile";
21
20
  export * from "./Form";
21
+ export * from "./FormatFile";
22
22
  export * from "./FormField";
23
+ export * from "./Glimmer";
23
24
  export * from "./Heading";
24
25
  export * from "./Icon";
25
26
  export * from "./IconButton";
26
- export * from "./InputFieldWrapper";
27
27
  export * from "./InputCurrency";
28
28
  export * from "./InputDate";
29
29
  export * from "./InputEmail";
30
+ export * from "./InputFieldWrapper";
30
31
  export * from "./InputNumber";
31
32
  export * from "./InputPassword";
32
33
  export * from "./InputPressable";
33
34
  export * from "./InputSearch";
34
- export * from "./InputTime";
35
35
  export * from "./InputText";
36
+ export * from "./InputTime";
36
37
  export * from "./Menu";
37
- export * from "./TextList";
38
- export * from "./ThumbnailList";
39
38
  export * from "./ProgressBar";
40
39
  export * from "./Select";
41
40
  export * from "./StatusLabel";
42
41
  export * from "./Switch";
43
42
  export * from "./Text";
43
+ export * from "./TextList";
44
+ export * from "./ThumbnailList";
44
45
  export * from "./Toast";
45
46
  export * from "./Typography";
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { EdgeInsets, Rect } from "react-native-safe-area-context";
3
3
  interface MockSafeAreaProviderProps {
4
- children: React.ReactNode;
5
- frame?: Rect;
6
- insets?: EdgeInsets;
4
+ readonly children: React.ReactNode;
5
+ readonly frame?: Rect;
6
+ readonly insets?: EdgeInsets;
7
7
  }
8
8
  export declare function MockSafeAreaProvider({ frame, insets, children, }: MockSafeAreaProviderProps): JSX.Element;
9
9
  export {};
package/jestSetup.js CHANGED
@@ -2,6 +2,7 @@ import React from "react";
2
2
 
3
3
  jest.mock("./dist/src/hooks", () => {
4
4
  const actualHooks = jest.requireActual("./dist/src/hooks");
5
+
5
6
  return { ...actualHooks, useIsScreenReaderEnabled: () => false };
6
7
  });
7
8
 
@@ -18,6 +19,7 @@ jest.mock("./dist/src/Button/components/InternalButtonLoading", () => {
18
19
  jest.mock("react-native-reanimated", () => {
19
20
  const reanimated = require("react-native-reanimated/mock");
20
21
  const timing = () => ({ start: () => undefined });
22
+
21
23
  return {
22
24
  ...reanimated,
23
25
  default: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.54.4-JOB-88641.9+2b196450",
3
+ "version": "0.54.4-fix-inline.3+c411f5fe",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "build:clean": "rm -rf ./dist"
37
37
  },
38
38
  "dependencies": {
39
- "@jobber/design": "^0.54.0",
40
- "@jobber/hooks": "^2.8.3",
39
+ "@jobber/design": "^0.54.1-fix-inline.3+c411f5fe",
40
+ "@jobber/hooks": "^2.8.4-fix-inline.5+c411f5fe",
41
41
  "@react-native-clipboard/clipboard": "^1.11.2",
42
42
  "@react-native-picker/picker": "^2.4.10",
43
43
  "autolinker": "^4.0.0",
@@ -49,7 +49,6 @@
49
49
  "react-native-modalize": "^2.0.13",
50
50
  "react-native-portalize": "^1.0.7",
51
51
  "react-native-safe-area-context": "^4.5.2",
52
- "react-native-svg": "^13.9.0",
53
52
  "react-native-toast-message": "^2.1.6",
54
53
  "react-native-uuid": "^1.4.9",
55
54
  "ts-xor": "^1.1.0"
@@ -81,8 +80,9 @@
81
80
  "react-native-modal-datetime-picker": " >=13.0.0",
82
81
  "react-native-modalize": "^2.0.13",
83
82
  "react-native-portalize": "^1.0.7",
84
- "react-native-reanimated": "^2.17.0",
85
- "react-native-safe-area-context": "^4.5.2"
83
+ "react-native-reanimated": "^2.0.0 || ^3.0.0",
84
+ "react-native-safe-area-context": "^4.5.2",
85
+ "react-native-svg": ">=12.0.0"
86
86
  },
87
- "gitHead": "2b19645000b8184e369222c31297e4b923a87fb0"
87
+ "gitHead": "c411f5fec260686086b5999611711c886133b5eb"
88
88
  }