@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
@@ -6,7 +6,7 @@ import { Text } from "../Text";
6
6
 
7
7
  describe("ActionItem", () => {
8
8
  const pressHandler = jest.fn();
9
- const defaultActionIcon = "arrowRight";
9
+ const defaultActionIcon = "longArrowRight";
10
10
 
11
11
  beforeEach(() => {
12
12
  jest.resetAllMocks();
@@ -63,7 +63,7 @@ describe("ActionItem", () => {
63
63
  expect(queryByTestId(defaultActionIcon)).toBeFalsy();
64
64
  });
65
65
 
66
- it("should display arrowRight icon when edit name is used", () => {
66
+ it("should display longArrowRight icon when edit name is used", () => {
67
67
  const iconName = "edit";
68
68
  const { getByTestId } = render(
69
69
  <ActionItem onPress={pressHandler} actionIcon={iconName} />,
@@ -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
 
@@ -123,9 +124,10 @@ type ActionIconNames = IconNames | "editpencil";
123
124
 
124
125
  function getActionIcon(icon: ActionIconNames): IconNames {
125
126
  if (icon === "edit") {
126
- return "arrowRight";
127
+ return "longArrowRight";
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"),
@@ -44,7 +44,7 @@ export function Banner({
44
44
 
45
45
  {action && (
46
46
  <RNText>
47
- {shouldFlow && <Typography> | </Typography>}
47
+ {shouldFlow && <Typography color="subdued"> | </Typography>}
48
48
  <ActionLabel align="start">{action.label}</ActionLabel>
49
49
  </RNText>
50
50
  )}
@@ -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":
@@ -21,6 +21,9 @@ const imageWidth = 96;
21
21
  const offset = PixelRatio.roundToNearestPixel(imageWidth / PixelRatio.get());
22
22
  const leftOffset = -1 * offset;
23
23
 
24
+ // looks like deprecation for FlatList in reanimated is cascading down to other exports
25
+ // This is not createAnimatedComponent(FlatList), we are fine
26
+ // eslint-disable-next-line import/no-deprecated
24
27
  const AnimatedImage = Animated.createAnimatedComponent(ImageBackground);
25
28
 
26
29
  function InternalButtonLoadingInternal({
@@ -71,6 +74,7 @@ function getLoadingPattern({
71
74
  }: InternalButtonLoadingProps): string {
72
75
  if (variation === "cancel") return darkPattern;
73
76
  if (type === "primary") return lightPattern;
77
+
74
78
  return darkPattern;
75
79
  }
76
80
 
@@ -6,11 +6,11 @@ export const styles = StyleSheet.create({
6
6
  width: "100%",
7
7
  flexDirection: "row",
8
8
  justifyContent: "flex-end",
9
+ gap: tokens["space-small"],
9
10
  },
10
11
  button: {
11
12
  flexBasis: tokens["space-largest"],
12
13
  flexGrow: 1,
13
- paddingRight: tokens["space-smaller"],
14
14
  },
15
15
  moreButton: {
16
16
  flexBasis: tokens["space-largest"],
@@ -86,6 +86,7 @@ export function ButtonGroup({
86
86
  {secondaryActions.length > 0 && (
87
87
  <View style={styles.moreButton}>
88
88
  <Button
89
+ type="secondary"
89
90
  icon={"more"}
90
91
  accessibilityLabel={t("more")}
91
92
  onPress={handlePress(openBottomSheet)}
@@ -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
@@ -17,9 +17,9 @@ interface CommonCheckboxGroupProps extends Omit<CheckboxProps, "onChange"> {
17
17
  /**
18
18
  * Checkbox items
19
19
  */
20
- children: CheckboxElement[];
20
+ readonly children: CheckboxElement[];
21
21
 
22
- state?: CheckboxGroupState;
22
+ readonly state?: CheckboxGroupState;
23
23
 
24
24
  onChange?(groupChecks: CheckboxGroupState): void;
25
25
  }
@@ -38,6 +38,7 @@ export type CheckboxGroupProps = XOR<
38
38
  UncontrolledCheckboxGroupProps,
39
39
  ControlledCheckboxGroupProps
40
40
  >;
41
+
41
42
  export function CheckboxGroup({
42
43
  children,
43
44
  state,
@@ -57,6 +58,7 @@ export function CheckboxGroup({
57
58
  </CheckboxGroupInternal>
58
59
  );
59
60
  }
61
+
60
62
  if (name) {
61
63
  return (
62
64
  <FormField name={name}>
@@ -114,6 +116,7 @@ function CheckboxGroupInternal({
114
116
  ): React.ReactElement<CheckboxProps> {
115
117
  const name = throwErrorIfItHasNoName(checkbox.props.name);
116
118
  const childDisabled = disabled || checkbox.props.disabled;
119
+
117
120
  const childrenHandleChange = (checked: boolean) => {
118
121
  const childrenNextValue = {
119
122
  ...actualCheckedValues.childrenChecked,
@@ -126,6 +129,7 @@ function CheckboxGroupInternal({
126
129
  parentChecked: parentNextValue,
127
130
  });
128
131
  };
132
+
129
133
  return React.cloneElement(checkbox, {
130
134
  onChange: childrenHandleChange,
131
135
  checked: actualCheckedValues.childrenChecked[name],
@@ -141,6 +145,7 @@ function CheckboxGroupInternal({
141
145
  }
142
146
 
143
147
  const name = throwErrorIfItHasNoName(child.props.name);
148
+
144
149
  return {
145
150
  ...childCheckboxObject,
146
151
  [name]: cloneChildCheckbox(child),
@@ -153,9 +158,11 @@ function CheckboxGroupInternal({
153
158
  childName: string,
154
159
  ): boolean {
155
160
  const currentCheckbox = checkboxObject[childName];
161
+
156
162
  if (currentCheckbox?.props?.disabled) {
157
163
  return acc;
158
164
  }
165
+
159
166
  return acc && value;
160
167
  }
161
168
 
@@ -174,6 +181,7 @@ function CheckboxGroupInternal({
174
181
  actualCheckedValues.childrenChecked,
175
182
  (acc, currentCheckboxValue, childName) => {
176
183
  const currentCheckbox = checkboxObject[childName];
184
+
177
185
  return currentCheckbox?.props?.disabled
178
186
  ? {
179
187
  ...acc,
@@ -215,11 +223,13 @@ function throwErrorIfItHasNoName(name?: string): string {
215
223
  "You must provide a name to checkboxes in a checkbox group",
216
224
  );
217
225
  }
226
+
218
227
  return name;
219
228
  }
220
229
 
221
230
  function checkIndeterminateStatus(checkedValues: CheckboxGroupState): boolean {
222
231
  const checkedValuesAsArray = Object.values(checkedValues.childrenChecked);
232
+
223
233
  if (checkedValuesAsArray.length === 1) {
224
234
  return false;
225
235
  }
package/src/Chip/Chip.tsx CHANGED
@@ -97,9 +97,11 @@ export function Chip({
97
97
 
98
98
  const accessibilityState = useMemo(() => {
99
99
  const checkableRoles = ["radio", "switch", "togglebutton", "checkbox"];
100
+
100
101
  if (checkableRoles.includes(accessibilityRole)) {
101
102
  return { checked: isActive };
102
103
  }
104
+
103
105
  return {};
104
106
  }, [accessibilityRole, isActive]);
105
107
 
@@ -39,6 +39,7 @@ function setupContent(
39
39
  const parentView = container.getByLabelText("contentView");
40
40
  const contentView = getContentComponent(parentView);
41
41
  const contentChildren = getContentChildren(contentView);
42
+
42
43
  return { ...container, parentView, contentView, contentChildren };
43
44
  }
44
45
 
@@ -56,6 +56,7 @@ export function Content({
56
56
  // In order to get spacing between the children, we apply the child spacing on each of
57
57
  // the children except for the first (top) child
58
58
  const childStyle = index !== 0 ? [childContainerStyle] : [];
59
+
59
60
  return (
60
61
  <View key={index} style={[styles.childWrapper, ...childStyle]}>
61
62
  {child}
@@ -14,6 +14,7 @@ import { Content } from "../Content";
14
14
  import { Text } from "../Text";
15
15
 
16
16
  jest.unmock("../hooks/useIsScreenReaderEnabled");
17
+
17
18
  function fireLayoutEvent(childrenContent: ReactTestInstance) {
18
19
  fireEvent(childrenContent, "onLayout", {
19
20
  nativeEvent: {
@@ -1,10 +1,5 @@
1
1
  import React, { useState } from "react";
2
- import {
3
- LayoutChangeEvent,
4
- ScrollView,
5
- TouchableOpacity,
6
- View,
7
- } from "react-native";
2
+ import { LayoutChangeEvent, TouchableOpacity, View } from "react-native";
8
3
  import Reanimated, {
9
4
  Easing,
10
5
  useAnimatedStyle,
@@ -16,8 +11,8 @@ import { styles } from "./Disclosure.style";
16
11
  import { tokens } from "../utils/design";
17
12
  import { Icon } from "../Icon";
18
13
 
19
- const ReanimatedView = Reanimated.createAnimatedComponent(View);
20
- const ReanimatedScrollView = Reanimated.createAnimatedComponent(ScrollView);
14
+ const ReanimatedView = Reanimated.View;
15
+ const ReanimatedScrollView = Reanimated.ScrollView;
21
16
 
22
17
  interface DisclosureProps {
23
18
  /**
@@ -117,18 +117,16 @@ exports[`renders a Disclosure with a header and a content when open is true 1`]
117
117
  </View>
118
118
  </View>
119
119
  <RCTScrollView
120
+ collapsable={false}
120
121
  scrollEnabled={false}
122
+ scrollEventThrottle={0.0001}
121
123
  showsHorizontalScrollIndicator={false}
122
124
  showsVerticalScrollIndicator={false}
123
125
  style={
124
- [
125
- {
126
- "paddingTop": 8,
127
- },
128
- {
129
- "height": 100,
130
- },
131
- ]
126
+ {
127
+ "height": 100,
128
+ "paddingTop": 8,
129
+ }
132
130
  }
133
131
  >
134
132
  <View>
@@ -290,18 +288,16 @@ exports[`renders a Disclosure with a header and with a content of size 0 when cl
290
288
  </View>
291
289
  </View>
292
290
  <RCTScrollView
291
+ collapsable={false}
293
292
  scrollEnabled={false}
293
+ scrollEventThrottle={0.0001}
294
294
  showsHorizontalScrollIndicator={false}
295
295
  showsVerticalScrollIndicator={false}
296
296
  style={
297
- [
298
- {
299
- "paddingTop": 8,
300
- },
301
- {
302
- "height": 0,
303
- },
304
- ]
297
+ {
298
+ "height": 0,
299
+ "paddingTop": 8,
300
+ }
305
301
  }
306
302
  >
307
303
  <View>
@@ -431,18 +427,16 @@ exports[`should not render the caret when the Disclosure is empty 1`] = `
431
427
  </View>
432
428
  </View>
433
429
  <RCTScrollView
430
+ collapsable={false}
434
431
  scrollEnabled={false}
432
+ scrollEventThrottle={0.0001}
435
433
  showsHorizontalScrollIndicator={false}
436
434
  showsVerticalScrollIndicator={false}
437
435
  style={
438
- [
439
- {
440
- "paddingTop": 8,
441
- },
442
- {
443
- "height": 0,
444
- },
445
- ]
436
+ {
437
+ "height": 0,
438
+ "paddingTop": 8,
439
+ }
446
440
  }
447
441
  >
448
442
  <View>
@@ -17,5 +17,6 @@ export function Divider({ size = "base" }: DividerProps): JSX.Element {
17
17
  size === "large" && styles.large,
18
18
  size === "largest" && styles.largest,
19
19
  ];
20
+
20
21
  return <View testID="Divider" style={style} />;
21
22
  }
@@ -15,8 +15,8 @@ interface Action {
15
15
  }
16
16
 
17
17
  interface ButtonAction {
18
- action?: Action;
19
- type: ButtonType;
18
+ readonly action?: Action;
19
+ readonly type: ButtonType;
20
20
  }
21
21
 
22
22
  function ButtonAction({ action, type }: ButtonAction) {
@@ -24,6 +24,7 @@ export const gapStyles = StyleSheet.create(
24
24
  if (space !== "none") paddingLeft = tokens[`space-${space}`];
25
25
 
26
26
  gapObj[space] = { paddingLeft };
27
+
27
28
  return gapObj;
28
29
  }, {} as Record<Spacing, ViewStyle>),
29
30
  );
@@ -17,6 +17,7 @@ function getContentComponent(parentView: ReactTestInstance) {
17
17
  function getFlexCol(flexRow: ReactTestInstance) {
18
18
  return flexRow.children as ReactTestInstance[];
19
19
  }
20
+
20
21
  function setUp(props?: FlexProps) {
21
22
  const container = render(
22
23
  <View accessibilityLabel="contentView">
@@ -33,6 +34,7 @@ function setUp(props?: FlexProps) {
33
34
  );
34
35
  const flexRow = container.getAllByTestId("ATL-Flex-Row");
35
36
  const flexCol = getFlexCol(flexRow[0]);
37
+
36
38
  return { ...container, contentView, flexRow, flexCol };
37
39
  }
38
40
 
@@ -16,6 +16,7 @@ import { InputText } from "../InputText";
16
16
  jest.mock("lodash/debounce", () => {
17
17
  return jest.fn(fn => {
18
18
  fn.cancel = jest.fn();
19
+
19
20
  return fn;
20
21
  });
21
22
  });
@@ -83,24 +84,24 @@ interface FormFields {
83
84
  }
84
85
 
85
86
  interface FormTestProps {
86
- onSubmit: jest.Mock;
87
- sendBannerErrors?: boolean;
88
- sendNetworkErrors?: boolean;
89
- saveLabel?: string;
90
- renderStickySection?: (
87
+ readonly onSubmit: jest.Mock;
88
+ readonly sendBannerErrors?: boolean;
89
+ readonly sendNetworkErrors?: boolean;
90
+ readonly saveLabel?: string;
91
+ readonly renderStickySection?: (
91
92
  onSubmit: () => void,
92
93
  label: string | undefined,
93
94
  isSubmitting: boolean,
94
95
  ) => JSX.Element;
95
- initialLoading?: boolean;
96
- initialValues?: FormFields;
97
- bannerMessages?: FormBannerMessage[];
98
- localCacheKey?: string;
99
- localCacheExclude?: string[];
100
- localCacheId?: string[] | string;
101
- onBeforeSubmit?: jest.Mock;
102
- renderFooter?: React.ReactNode;
103
- saveButtonOffset?: number;
96
+ readonly initialLoading?: boolean;
97
+ readonly initialValues?: FormFields;
98
+ readonly bannerMessages?: FormBannerMessage[];
99
+ readonly localCacheKey?: string;
100
+ readonly localCacheExclude?: string[];
101
+ readonly localCacheId?: string[] | string;
102
+ readonly onBeforeSubmit?: jest.Mock;
103
+ readonly renderFooter?: React.ReactNode;
104
+ readonly saveButtonOffset?: number;
104
105
  }
105
106
 
106
107
  function FormTest(props: FormTestProps) {
@@ -124,9 +125,11 @@ function MockForm({
124
125
  saveButtonOffset,
125
126
  }: FormTestProps) {
126
127
  const formErrors: FormBannerErrors = {};
128
+
127
129
  if (sendBannerErrors) {
128
130
  formErrors.bannerError = bannerError;
129
131
  }
132
+
130
133
  if (sendNetworkErrors) {
131
134
  formErrors.networkError = "Ouch";
132
135
  }
@@ -408,6 +411,7 @@ describe("Form", () => {
408
411
  errorType: FormSubmitErrorType.NetworkError,
409
412
  }),
410
413
  );
414
+
411
415
  const setup = () => {
412
416
  const view = render(
413
417
  <FormTest sendNetworkErrors={true} onSubmit={mockSubmit} />,
@@ -421,6 +425,7 @@ describe("Form", () => {
421
425
  newValue,
422
426
  );
423
427
  fireEvent.press(getByLabelText(saveButtonText));
428
+
424
429
  return view;
425
430
  };
426
431