@jobber/components-native 0.56.2 → 0.57.0

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 (96) hide show
  1. package/dist/package.json +4 -4
  2. package/dist/src/Button/Button.js +2 -2
  3. package/dist/src/Button/Button.style.js +2 -2
  4. package/dist/src/Card/Card.js +7 -8
  5. package/dist/src/InputCurrency/InputCurrency.js +16 -17
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
  8. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +6 -6
  9. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -2
  10. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -3
  11. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -4
  12. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +1 -1
  13. package/dist/types/src/FormField/FormField.d.ts +2 -2
  14. package/dist/types/src/FormatFile/FormatFile.d.ts +6 -6
  15. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +6 -6
  16. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +4 -4
  17. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +6 -6
  18. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +3 -3
  19. package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
  20. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +12 -12
  21. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +14 -14
  22. package/dist/types/src/InputPassword/InputPassword.d.ts +1 -1
  23. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +1 -1
  24. package/dist/types/src/Toast/Toast.d.ts +1 -1
  25. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
  26. package/jestSetup.js +2 -0
  27. package/package.json +4 -4
  28. package/src/ActionItem/ActionItem.tsx +2 -0
  29. package/src/ActionItem/ActionItemGroup.tsx +1 -0
  30. package/src/AutoLink/hooks/useCreateLinkedText.ts +1 -0
  31. package/src/AutoLink/hooks/useTokenGenerator.ts +1 -0
  32. package/src/BottomSheet/BottomSheet.tsx +3 -3
  33. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +3 -1
  34. package/src/Button/Button.style.ts +2 -2
  35. package/src/Button/Button.test.tsx +2 -2
  36. package/src/Button/Button.tsx +2 -2
  37. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -0
  38. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +7 -6
  39. package/src/Card/Card.tsx +31 -32
  40. package/src/Card/components/InternalCardHeader.tsx +1 -0
  41. package/src/Checkbox/CheckboxGroup.tsx +12 -2
  42. package/src/Chip/Chip.tsx +2 -0
  43. package/src/Content/Content.test.tsx +1 -0
  44. package/src/Content/Content.tsx +1 -0
  45. package/src/ContentOverlay/ContentOverlay.test.tsx +1 -0
  46. package/src/Divider/Divider.tsx +1 -0
  47. package/src/EmptyState/EmptyState.tsx +2 -2
  48. package/src/Flex/Flex.styles.tsx +1 -0
  49. package/src/Flex/Flex.test.tsx +2 -0
  50. package/src/Form/Form.test.tsx +19 -14
  51. package/src/Form/components/FormBody/FormBody.tsx +4 -3
  52. package/src/Form/components/FormCache/FormCache.tsx +5 -4
  53. package/src/Form/components/FormMessage/FormMessage.tsx +1 -0
  54. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -1
  55. package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +5 -5
  56. package/src/Form/context/AtlantisFormContext.tsx +1 -0
  57. package/src/Form/hooks/useFormViewRefs.ts +1 -0
  58. package/src/Form/hooks/useOfflineHandler.ts +1 -0
  59. package/src/Form/hooks/useScrollToError/useScrollToError.ts +2 -0
  60. package/src/FormField/FormField.test.tsx +6 -8
  61. package/src/FormField/FormField.tsx +2 -2
  62. package/src/FormatFile/FormatFile.tsx +15 -14
  63. package/src/FormatFile/components/FileView/FileView.tsx +9 -6
  64. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +4 -4
  65. package/src/FormatFile/components/MediaView/MediaView.tsx +15 -14
  66. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +3 -3
  67. package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -0
  68. package/src/Icon/Icon.tsx +1 -0
  69. package/src/InputCurrency/InputCurrency.tsx +40 -38
  70. package/src/InputCurrency/utils.ts +9 -0
  71. package/src/InputDate/InputDate.test.tsx +1 -0
  72. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -0
  73. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +12 -12
  74. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +14 -14
  75. package/src/InputNumber/InputNumber.tsx +8 -0
  76. package/src/InputPassword/InputPassword.test.tsx +1 -0
  77. package/src/InputPassword/InputPassword.tsx +2 -1
  78. package/src/InputPressable/InputPressable.test.tsx +1 -0
  79. package/src/InputSearch/InputSearch.tsx +1 -0
  80. package/src/InputText/context/InputAccessoriesProvider.test.tsx +6 -1
  81. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  82. package/src/InputTime/utils/index.ts +1 -0
  83. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
  84. package/src/Menu/utils.ts +1 -0
  85. package/src/ProgressBar/ProgressBarInner.tsx +1 -0
  86. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -0
  87. package/src/Select/components/SelectInternalPicker/utils.ts +1 -0
  88. package/src/StatusLabel/StatusLabel.tsx +1 -1
  89. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -0
  90. package/src/Text/Text.tsx +1 -0
  91. package/src/Toast/Toast.tsx +2 -1
  92. package/src/Typography/Typography.tsx +5 -0
  93. package/src/hooks/useAtlantisI18n/utils/dateFormatter.ts +1 -0
  94. package/src/hooks/useFormController.ts +2 -0
  95. package/src/utils/intl/capitalize.ts +1 -0
  96. 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;
@@ -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 {};
@@ -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;
@@ -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
  }
@@ -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 {
@@ -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.56.2",
3
+ "version": "0.57.0",
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.55.0",
40
- "@jobber/hooks": "^2.9.0",
39
+ "@jobber/design": "^0.55.1",
40
+ "@jobber/hooks": "^2.9.1",
41
41
  "@react-native-clipboard/clipboard": "^1.11.2",
42
42
  "@react-native-picker/picker": "^2.4.10",
43
43
  "autolinker": "^4.0.0",
@@ -84,5 +84,5 @@
84
84
  "react-native-reanimated": "^2.17.0",
85
85
  "react-native-safe-area-context": "^4.5.2"
86
86
  },
87
- "gitHead": "aa6fdf546cd601c5f13ca9c88c4b47ce3eae9b13"
87
+ "gitHead": "0efee497cd920eccd458d96cbb17e9cc67e3cc6b"
88
88
  }
@@ -116,6 +116,7 @@ function getActionIconColour(
116
116
  if (actionIconColour === "subtle") {
117
117
  return "interactiveSubtle";
118
118
  }
119
+
119
120
  return actionIconColour;
120
121
  }
121
122
 
@@ -127,5 +128,6 @@ function getActionIcon(icon: ActionIconNames): IconNames {
127
128
  } else if (icon === "editpencil") {
128
129
  return "edit";
129
130
  }
131
+
130
132
  return icon;
131
133
  }
@@ -29,6 +29,7 @@ function renderChildren(children: ActionItemElement | ActionItemElement[]) {
29
29
 
30
30
  return childArray.map((child, index) => {
31
31
  const isSubsequentChild = index !== 0;
32
+
32
33
  return (
33
34
  <View key={index}>
34
35
  {isSubsequentChild && (
@@ -21,6 +21,7 @@ export function useCreateLinkedText({
21
21
 
22
22
  const token = generateToken();
23
23
  matches[token] = match;
24
+
24
25
  return token;
25
26
  },
26
27
  });
@@ -4,6 +4,7 @@ import { v1 } from "react-native-uuid";
4
4
  export function useTokenGenerator(): [() => string, RegExp] {
5
5
  let counter = 0;
6
6
  const [identifier] = useState(v1());
7
+
7
8
  return [
8
9
  () => `@__ELEMENT-${identifier}-${counter++}__@`,
9
10
  new RegExp(`(@__ELEMENT-${identifier}-\\d+__@)`, "g"),
@@ -101,7 +101,7 @@ function BottomSheetInternal(
101
101
  }
102
102
  }
103
103
 
104
- function Header({ heading }: { heading: string }) {
104
+ function Header({ heading }: { readonly heading: string }) {
105
105
  return (
106
106
  <View style={styles.header}>
107
107
  <Heading level={"subtitle"}>{heading}</Heading>
@@ -113,8 +113,8 @@ function Footer({
113
113
  cancellable,
114
114
  onCancel,
115
115
  }: {
116
- cancellable: boolean;
117
- onCancel: () => void;
116
+ readonly cancellable: boolean;
117
+ readonly onCancel: () => void;
118
118
  }) {
119
119
  const insets = useSafeAreaInsets();
120
120
  const { t } = useAtlantisI18n();
@@ -14,8 +14,9 @@ export interface BottomSheetOptionProps {
14
14
  readonly textAlign?: TextAlign;
15
15
  readonly destructive?: boolean;
16
16
  readonly textTransform?: "none" | "capitalize";
17
- onPress: () => void;
17
+ readonly onPress: () => void;
18
18
  }
19
+
19
20
  export function BottomSheetOption({
20
21
  text,
21
22
  icon,
@@ -27,6 +28,7 @@ export function BottomSheetOption({
27
28
  }: BottomSheetOptionProps): JSX.Element {
28
29
  const destructiveColor = "critical";
29
30
  const textVariation = destructive ? destructiveColor : "subdued";
31
+
30
32
  return (
31
33
  <TouchableOpacity
32
34
  style={styles.bottomSheetOption}
@@ -79,8 +79,8 @@ export const styles = StyleSheet.create({
79
79
  },
80
80
 
81
81
  learning: {
82
- backgroundColor: tokens["color-informative"],
83
- borderColor: tokens["color-informative"],
82
+ backgroundColor: tokens["color-interactive--subtle"],
83
+ borderColor: tokens["color-interactive--subtle"],
84
84
  },
85
85
 
86
86
  destructive: {
@@ -78,7 +78,7 @@ describe("Button", () => {
78
78
  },
79
79
  ],
80
80
  ["destructive", { bgColor: tokens["color-destructive"] }],
81
- ["learning", { bgColor: tokens["color-informative"] }],
81
+ ["learning", { bgColor: tokens["color-interactive--subtle"] }],
82
82
  ])("renders a %s Button", (variation, { bgColor, borderColor }) => {
83
83
  const { buttonStyle } = renderButton(
84
84
  <Button label={variation} variation={variation} onPress={jest.fn()} />,
@@ -218,7 +218,7 @@ describe("Button", () => {
218
218
  variation: "learning",
219
219
  type: "secondary",
220
220
  });
221
- expect(iconColor).toBe(tokens["color-informative"]);
221
+ expect(iconColor).toBe(tokens["color-interactive--subtle"]);
222
222
  expect(textColor).toBe(iconColor);
223
223
  });
224
224
 
@@ -179,7 +179,7 @@ function getActionLabelVariation(
179
179
 
180
180
  switch (variation) {
181
181
  case "learning":
182
- return "learning";
182
+ return "subtle";
183
183
  case "destructive":
184
184
  return "destructive";
185
185
  case "cancel":
@@ -204,7 +204,7 @@ function getIconColorVariation(
204
204
 
205
205
  switch (variation) {
206
206
  case "learning":
207
- return "informative";
207
+ return "interactiveSubtle";
208
208
  case "destructive":
209
209
  return "destructive";
210
210
  case "cancel":
@@ -71,6 +71,7 @@ function getLoadingPattern({
71
71
  }: InternalButtonLoadingProps): string {
72
72
  if (variation === "cancel") return darkPattern;
73
73
  if (type === "primary") return lightPattern;
74
+
74
75
  return darkPattern;
75
76
  }
76
77
 
@@ -6,12 +6,12 @@ import { BottomSheetOption } from "../../../BottomSheet/components/BottomSheetOp
6
6
  import { BottomSheet, BottomSheetRef } from "../../../BottomSheet/BottomSheet";
7
7
 
8
8
  interface SecondaryActionSheetProps {
9
- actions: ButtonGroupSecondaryActionProps[];
10
- secondaryActionsRef: RefObject<BottomSheetRef>;
11
- showCancel?: boolean;
12
- heading?: string;
13
- onOpenBottomSheet?: () => void;
14
- onCloseBottomSheet?: () => void;
9
+ readonly actions: ButtonGroupSecondaryActionProps[];
10
+ readonly secondaryActionsRef: RefObject<BottomSheetRef>;
11
+ readonly showCancel?: boolean;
12
+ readonly heading?: string;
13
+ readonly onOpenBottomSheet?: () => void;
14
+ readonly onCloseBottomSheet?: () => void;
15
15
  }
16
16
 
17
17
  export function SecondaryActionSheet({
@@ -34,6 +34,7 @@ export function SecondaryActionSheet({
34
34
  <View>
35
35
  {actions.map((action, index) => {
36
36
  const { label, onPress, icon, iconColor, destructive } = action;
37
+
37
38
  return (
38
39
  <BottomSheetOption
39
40
  destructive={destructive}
package/src/Card/Card.tsx CHANGED
@@ -65,6 +65,7 @@ function getElevationStyle(elevation: elevationProp) {
65
65
  if (elevation === "none") {
66
66
  return undefined;
67
67
  }
68
+
68
69
  return styles[`${elevation}Elevation`];
69
70
  }
70
71
 
@@ -85,39 +86,37 @@ export function Card({
85
86
  testID={testID}
86
87
  >
87
88
  {header && (
88
- <>
89
- <InternalCardHeader
90
- onPress={header.onPress}
91
- testID={`${testID}Header`}
92
- collapsable={!!children}
93
- >
94
- <View style={styles.headerTitle}>
95
- <Typography
96
- color="heading"
97
- fontFamily="base"
98
- fontWeight="bold"
99
- size="default"
100
- lineHeight="base"
101
- accessibilityRole="header"
102
- >
103
- {header.title}
104
- </Typography>
105
- </View>
106
- <View style={styles.actionItem}>
107
- {!!header.actionItem?.label && (
108
- <View style={styles.actionLabel}>
109
- <ActionLabel type="cardTitle">
110
- {header.actionItem.label}
111
- </ActionLabel>
112
- </View>
113
- )}
89
+ <InternalCardHeader
90
+ onPress={header.onPress}
91
+ testID={`${testID}Header`}
92
+ collapsable={!!children}
93
+ >
94
+ <View style={styles.headerTitle}>
95
+ <Typography
96
+ color="heading"
97
+ fontFamily="base"
98
+ fontWeight="bold"
99
+ size="default"
100
+ lineHeight="base"
101
+ accessibilityRole="header"
102
+ >
103
+ {header.title}
104
+ </Typography>
105
+ </View>
106
+ <View style={styles.actionItem}>
107
+ {!!header.actionItem?.label && (
108
+ <View style={styles.actionLabel}>
109
+ <ActionLabel type="cardTitle">
110
+ {header.actionItem.label}
111
+ </ActionLabel>
112
+ </View>
113
+ )}
114
114
 
115
- {header.actionItem?.iconName && (
116
- <Icon name={header.actionItem.iconName} color="interactive" />
117
- )}
118
- </View>
119
- </InternalCardHeader>
120
- </>
115
+ {header.actionItem?.iconName && (
116
+ <Icon name={header.actionItem.iconName} color="interactive" />
117
+ )}
118
+ </View>
119
+ </InternalCardHeader>
121
120
  )}
122
121
  {children}
123
122
  {footer && (
@@ -16,6 +16,7 @@ export function InternalCardHeader({
16
16
  collapsable,
17
17
  }: InternalCardHeaderProps): JSX.Element {
18
18
  const conditionalChildStyling = collapsable ? undefined : styles.noChildren;
19
+
19
20
  if (onPress) {
20
21
  return (
21
22
  <Pressable