@jobber/components-native 0.54.4-JOB-88641.7 → 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 (148) 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 +2 -3
  4. package/dist/src/Banner/Banner.style.js +4 -2
  5. package/dist/src/Button/Button.js +2 -2
  6. package/dist/src/Button/Button.style.js +2 -2
  7. package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +3 -0
  8. package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
  9. package/dist/src/ButtonGroup/ButtonGroup.style.js +1 -1
  10. package/dist/src/Card/Card.js +7 -8
  11. package/dist/src/Disclosure/Disclosure.js +3 -3
  12. package/dist/src/Glimmer/Glimmer.js +42 -0
  13. package/dist/src/Glimmer/Glimmer.shape.style.js +16 -0
  14. package/dist/src/Glimmer/Glimmer.size.style.js +9 -0
  15. package/dist/src/Glimmer/Glimmer.style.js +20 -0
  16. package/dist/src/Glimmer/index.js +1 -0
  17. package/dist/src/InputCurrency/InputCurrency.js +16 -17
  18. package/dist/src/InputFieldWrapper/InputFieldWrapper.js +39 -18
  19. package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +38 -1
  20. package/dist/src/InputText/InputText.js +6 -3
  21. package/dist/src/Menu/Menu.js +20 -3
  22. package/dist/src/Menu/Menu.style.js +1 -1
  23. package/dist/src/Menu/utils.js +2 -7
  24. package/dist/src/index.js +6 -5
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/dist/types/src/Banner/Banner.style.d.ts +4 -2
  27. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
  28. package/dist/types/src/ButtonGroup/ButtonGroup.style.d.ts +1 -1
  29. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +6 -6
  30. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -2
  31. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -3
  32. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -4
  33. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +1 -1
  34. package/dist/types/src/FormField/FormField.d.ts +2 -2
  35. package/dist/types/src/FormatFile/FormatFile.d.ts +6 -6
  36. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +6 -6
  37. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +4 -4
  38. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +6 -6
  39. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +3 -3
  40. package/dist/types/src/Glimmer/Glimmer.d.ts +31 -0
  41. package/dist/types/src/Glimmer/Glimmer.shape.style.d.ts +14 -0
  42. package/dist/types/src/Glimmer/Glimmer.size.style.d.ts +17 -0
  43. package/dist/types/src/Glimmer/Glimmer.style.d.ts +18 -0
  44. package/dist/types/src/Glimmer/index.d.ts +1 -0
  45. package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
  46. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +19 -1
  47. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +34 -0
  48. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +12 -12
  49. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +14 -14
  50. package/dist/types/src/InputPassword/InputPassword.d.ts +1 -1
  51. package/dist/types/src/InputText/InputText.d.ts +6 -2
  52. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +1 -1
  53. package/dist/types/src/Toast/Toast.d.ts +1 -1
  54. package/dist/types/src/index.d.ts +6 -5
  55. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
  56. package/jestSetup.js +2 -0
  57. package/package.json +7 -7
  58. package/src/ActionItem/ActionItem.test.tsx +2 -2
  59. package/src/ActionItem/ActionItem.tsx +3 -1
  60. package/src/ActionItem/ActionItemGroup.tsx +1 -0
  61. package/src/AutoLink/hooks/useCreateLinkedText.ts +1 -0
  62. package/src/AutoLink/hooks/useTokenGenerator.ts +1 -0
  63. package/src/Banner/Banner.style.ts +4 -2
  64. package/src/Banner/Banner.tsx +3 -3
  65. package/src/BottomSheet/BottomSheet.tsx +3 -3
  66. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +3 -1
  67. package/src/Button/Button.style.ts +2 -2
  68. package/src/Button/Button.test.tsx +2 -2
  69. package/src/Button/Button.tsx +2 -2
  70. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +4 -0
  71. package/src/ButtonGroup/ButtonGroup.style.ts +1 -1
  72. package/src/ButtonGroup/ButtonGroup.tsx +1 -0
  73. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +7 -6
  74. package/src/Card/Card.tsx +31 -32
  75. package/src/Card/components/InternalCardHeader.tsx +1 -0
  76. package/src/Checkbox/CheckboxGroup.tsx +12 -2
  77. package/src/Chip/Chip.tsx +2 -0
  78. package/src/Content/Content.test.tsx +1 -0
  79. package/src/Content/Content.tsx +1 -0
  80. package/src/ContentOverlay/ContentOverlay.test.tsx +1 -0
  81. package/src/Disclosure/Disclosure.tsx +3 -8
  82. package/src/Disclosure/__snapshots__/Disclosure.test.tsx.snap +18 -24
  83. package/src/Divider/Divider.tsx +1 -0
  84. package/src/EmptyState/EmptyState.tsx +2 -2
  85. package/src/Flex/Flex.styles.tsx +1 -0
  86. package/src/Flex/Flex.test.tsx +2 -0
  87. package/src/Form/Form.test.tsx +19 -14
  88. package/src/Form/components/FormBody/FormBody.tsx +4 -3
  89. package/src/Form/components/FormCache/FormCache.tsx +5 -4
  90. package/src/Form/components/FormMessage/FormMessage.tsx +1 -0
  91. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -1
  92. package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +5 -5
  93. package/src/Form/context/AtlantisFormContext.tsx +1 -0
  94. package/src/Form/hooks/useFormViewRefs.ts +1 -0
  95. package/src/Form/hooks/useOfflineHandler.ts +1 -0
  96. package/src/Form/hooks/useScrollToError/useScrollToError.ts +2 -0
  97. package/src/FormField/FormField.test.tsx +6 -8
  98. package/src/FormField/FormField.tsx +2 -2
  99. package/src/FormatFile/FormatFile.tsx +15 -14
  100. package/src/FormatFile/components/FileView/FileView.tsx +9 -6
  101. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +4 -4
  102. package/src/FormatFile/components/MediaView/MediaView.tsx +15 -14
  103. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +3 -3
  104. package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -0
  105. package/src/Glimmer/Glimmer.shape.style.ts +17 -0
  106. package/src/Glimmer/Glimmer.size.style.ts +10 -0
  107. package/src/Glimmer/Glimmer.style.ts +23 -0
  108. package/src/Glimmer/Glimmer.test.tsx +73 -0
  109. package/src/Glimmer/Glimmer.tsx +106 -0
  110. package/src/Glimmer/index.ts +1 -0
  111. package/src/Icon/Icon.tsx +1 -0
  112. package/src/Icon/__snapshots__/Icon.test.tsx.snap +89 -24
  113. package/src/InputCurrency/InputCurrency.tsx +40 -38
  114. package/src/InputCurrency/utils.ts +9 -0
  115. package/src/InputDate/InputDate.test.tsx +1 -0
  116. package/src/InputFieldWrapper/InputFieldWrapper.style.ts +46 -1
  117. package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +74 -0
  118. package/src/InputFieldWrapper/InputFieldWrapper.tsx +131 -64
  119. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -0
  120. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +12 -12
  121. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +14 -14
  122. package/src/InputNumber/InputNumber.tsx +8 -0
  123. package/src/InputPassword/InputPassword.test.tsx +1 -0
  124. package/src/InputPassword/InputPassword.tsx +2 -1
  125. package/src/InputPressable/InputPressable.test.tsx +1 -0
  126. package/src/InputSearch/InputSearch.tsx +1 -0
  127. package/src/InputText/InputText.test.tsx +11 -0
  128. package/src/InputText/InputText.tsx +27 -2
  129. package/src/InputText/context/InputAccessoriesProvider.test.tsx +6 -1
  130. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  131. package/src/InputTime/utils/index.ts +1 -0
  132. package/src/Menu/Menu.style.ts +1 -1
  133. package/src/Menu/Menu.tsx +23 -2
  134. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
  135. package/src/Menu/utils.ts +3 -7
  136. package/src/ProgressBar/ProgressBarInner.tsx +1 -0
  137. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -0
  138. package/src/Select/components/SelectInternalPicker/utils.ts +1 -0
  139. package/src/StatusLabel/StatusLabel.tsx +1 -1
  140. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -0
  141. package/src/Text/Text.tsx +1 -0
  142. package/src/Toast/Toast.tsx +2 -1
  143. package/src/Typography/Typography.tsx +5 -0
  144. package/src/hooks/useAtlantisI18n/utils/dateFormatter.ts +1 -0
  145. package/src/hooks/useFormController.ts +2 -0
  146. package/src/index.ts +6 -5
  147. package/src/utils/intl/capitalize.ts +1 -0
  148. package/src/utils/test/MockSafeAreaProvider.tsx +3 -3
package/src/Menu/utils.ts CHANGED
@@ -82,6 +82,7 @@ function getHorizontalPosition(
82
82
  if (menuPositionHorizontal === "menuRight") {
83
83
  getRightPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth);
84
84
  }
85
+
85
86
  if (menuPositionHorizontal === "menuLeft") {
86
87
  getLeftPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth);
87
88
  }
@@ -117,12 +118,7 @@ function getLeftPosition(
117
118
  } else if (overflowRight) {
118
119
  pos.right = 0;
119
120
  } else {
120
- pos.right =
121
- windowWidth -
122
- activatorLayout.x -
123
- activatorLayout.width +
124
- activatorLayout.width / 2 -
125
- menuHorizontalPadding;
121
+ pos.right = windowWidth - activatorLayout.x - activatorLayout.width;
126
122
  }
127
123
  }
128
124
 
@@ -146,6 +142,6 @@ function getRightPosition(
146
142
  } else if (overflowLeft) {
147
143
  pos.left = 0;
148
144
  } else {
149
- pos.left = activatorLayout.x + activatorLayout.width / 2 - menuPadding;
145
+ pos.left = activatorLayout.x;
150
146
  }
151
147
  }
@@ -43,5 +43,6 @@ export function calculateWidth(total: number, current: number): number {
43
43
  const curr = Math.max(0, current);
44
44
 
45
45
  if (curr >= total) return 100;
46
+
46
47
  return (curr / total) * 100;
47
48
  }
@@ -12,6 +12,7 @@ export function SelectInternalPicker({
12
12
  onChange,
13
13
  }: SelectInternalPickerProps): JSX.Element {
14
14
  if (disabled) return <>{children}</>;
15
+
15
16
  if (isIOS14AndUp()) {
16
17
  return (
17
18
  <SelectPressable>
@@ -13,6 +13,7 @@ export function handlePress(onChange: SelectInternalPickerProps["onChange"]) {
13
13
  export function isIOS14AndUp(): boolean {
14
14
  if (Platform.OS === "ios") {
15
15
  const majorVersionIOS = parseInt(Platform.Version, 10);
16
+
16
17
  return majorVersionIOS >= 14;
17
18
  }
18
19
 
@@ -57,7 +57,7 @@ export function StatusLabel({
57
57
  }
58
58
 
59
59
  interface StatusLabelIconProps {
60
- status: StatusType;
60
+ readonly status: StatusType;
61
61
  }
62
62
 
63
63
  function StatusLabelIcon({ status }: StatusLabelIconProps) {
@@ -61,6 +61,7 @@ export function BaseSwitch({
61
61
  return tokens["color-surface--background"];
62
62
  }
63
63
  }
64
+
64
65
  return undefined; //use default iOS
65
66
  }
66
67
 
package/src/Text/Text.tsx CHANGED
@@ -147,5 +147,6 @@ function getFontWeight({
147
147
  }: Pick<TextProps, "level" | "emphasis">): BaseWeight {
148
148
  if (emphasis === "strong") return "semiBold";
149
149
  if (level === "textSupporting") return "medium";
150
+
150
151
  return "regular";
151
152
  }
@@ -19,6 +19,7 @@ function DefaultToast({ text1 }: ToastConfigParams<string>): JSX.Element {
19
19
  const { bottom } = useSafeAreaInsets();
20
20
  const { t } = useAtlantisI18n();
21
21
  const toastContainerStyles = [styles.container, { paddingBottom: bottom }];
22
+
22
23
  return (
23
24
  <View style={toastContainerStyles}>
24
25
  <View style={styles.toast}>
@@ -48,7 +49,7 @@ export interface JobberToastProps {
48
49
  * Has effect only when the position is "bottom".
49
50
  * @default 40
50
51
  */
51
- bottomOffset?: number;
52
+ readonly bottomOffset?: number;
52
53
  }
53
54
 
54
55
  export function JobberToast({ bottomOffset }: JobberToastProps): JSX.Element {
@@ -207,6 +207,7 @@ function getFontStyle(
207
207
  fontWeight,
208
208
  )}`;
209
209
  const fontStyling = styles[styleKey];
210
+
210
211
  if (fontStyling) {
211
212
  return fontStyling;
212
213
  } else {
@@ -234,6 +235,7 @@ function getColorStyle(color?: TextColor, reverseTheme?: boolean) {
234
235
  return styles.greyBlue;
235
236
  }
236
237
  const colorStyleKey = `${color}${reverseTheme ? "Reverse" : ""}`;
238
+
237
239
  return styles[`${colorStyleKey}`];
238
240
  }
239
241
 
@@ -248,10 +250,13 @@ function getSizeAndHeightStyle(
248
250
  lineHeightOverwrite?: LineHeight,
249
251
  ) {
250
252
  const fontSize = styles[`${textSize}Size`];
253
+
251
254
  if (lineHeightOverwrite) {
252
255
  const lineHeight = styles[`${lineHeightOverwrite}LineHeight`];
256
+
253
257
  return StyleSheet.flatten([fontSize, lineHeight]);
254
258
  }
259
+
255
260
  return fontSize;
256
261
  }
257
262
 
@@ -13,6 +13,7 @@ export function dateFormatter(
13
13
  { locale, timeZone }: DateFormatterOptions,
14
14
  ): string {
15
15
  const zonedTime = utcToZonedTime(date, timeZone);
16
+
16
17
  return format(zonedTime, dateTimeFormat, {
17
18
  locale: getDateFnsLocale(locale),
18
19
  });
@@ -51,6 +51,7 @@ export function useFormController<T>({
51
51
  // TODO: Add support for two-part identifiers (e.g. "property.province")
52
52
  const fieldIdentifiers = fieldName.split(".");
53
53
  let error: FieldError | undefined;
54
+
54
55
  if (fieldIdentifiers.length === 3) {
55
56
  const [section, item, identifier] = fieldIdentifiers;
56
57
  error = errors[section]?.[item]?.[identifier];
@@ -64,5 +65,6 @@ export function useFormController<T>({
64
65
  function useControlName(name?: string): UseControllerReturn["field"]["name"] {
65
66
  const [identifier] = useState(v1());
66
67
  const prefix = `generatedName--${identifier}`;
68
+
67
69
  return `${name || prefix}` as const;
68
70
  }
package/src/index.ts CHANGED
@@ -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";
@@ -2,5 +2,6 @@ export function capitalize(text: string): string {
2
2
  if (!text) {
3
3
  return "";
4
4
  }
5
+
5
6
  return text.charAt(0).toLocaleUpperCase("en-US") + text.slice(1);
6
7
  }
@@ -6,9 +6,9 @@ import {
6
6
  } from "react-native-safe-area-context";
7
7
 
8
8
  interface MockSafeAreaProviderProps {
9
- children: React.ReactNode;
10
- frame?: Rect;
11
- insets?: EdgeInsets;
9
+ readonly children: React.ReactNode;
10
+ readonly frame?: Rect;
11
+ readonly insets?: EdgeInsets;
12
12
  }
13
13
 
14
14
  export function MockSafeAreaProvider({