@jobber/components-native 0.84.4-JOB-138679-b1552ab.68 → 0.84.4-match-mobi-accfa8a.9

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 (83) hide show
  1. package/dist/package.json +5 -3
  2. package/dist/src/BottomSheet/BottomSheet.js +58 -32
  3. package/dist/src/BottomSheet/BottomSheet.style.js +8 -9
  4. package/dist/src/BottomSheet/hooks/useBottomSheetBackHandler.js +26 -0
  5. package/dist/src/Chip/Chip.js +12 -1
  6. package/dist/src/Chip/Chip.style.js +1 -1
  7. package/dist/src/Content/ContentHorizontal.style.js +15 -0
  8. package/dist/src/Content/ContentSpaceAround.style.js +15 -0
  9. package/dist/src/Content/ContentVertical.style.js +15 -0
  10. package/dist/src/InputText/InputText.js +2 -2
  11. package/dist/src/ProgressBar/ProgressBar.js +10 -6
  12. package/dist/src/ProgressBar/ProgressBarInner.js +3 -12
  13. package/dist/src/ProgressBar/ProgressBarStepped.js +7 -2
  14. package/dist/src/StatusIndicator/StatusIndicator.js +11 -0
  15. package/dist/src/StatusIndicator/StatusIndicator.style.js +12 -0
  16. package/dist/src/StatusIndicator/StatusIndicator.type.js +1 -0
  17. package/dist/src/StatusIndicator/index.js +1 -0
  18. package/dist/src/StatusLabel/StatusLabel.js +6 -12
  19. package/dist/src/StatusLabel/StatusLabel.style.js +10 -13
  20. package/dist/src/hooks/useFormController.js +1 -1
  21. package/dist/src/index.js +1 -0
  22. package/dist/src/utils/meta/meta.json +1 -0
  23. package/dist/tsconfig.build.tsbuildinfo +1 -1
  24. package/dist/types/src/BottomSheet/BottomSheet.d.ts +7 -3
  25. package/dist/types/src/BottomSheet/BottomSheet.style.d.ts +7 -14
  26. package/dist/types/src/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
  27. package/dist/types/src/Content/Content.d.ts +1 -1
  28. package/dist/types/src/Content/ContentHorizontal.style.d.ts +15 -0
  29. package/dist/types/src/Content/ContentSpaceAround.style.d.ts +15 -0
  30. package/dist/types/src/Content/ContentVertical.style.d.ts +15 -0
  31. package/dist/types/src/Form/context/types.d.ts +2 -2
  32. package/dist/types/src/Form/hooks/useInternalForm.d.ts +2 -2
  33. package/dist/types/src/InputText/InputText.d.ts +1 -1
  34. package/dist/types/src/Menu/types.d.ts +1 -1
  35. package/dist/types/src/ProgressBar/ProgressBar.d.ts +1 -1
  36. package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +4 -1
  37. package/dist/types/src/ProgressBar/ProgressBarStepped.d.ts +3 -1
  38. package/dist/types/src/ProgressBar/types.d.ts +20 -0
  39. package/dist/types/src/StatusIndicator/StatusIndicator.d.ts +6 -0
  40. package/dist/types/src/StatusIndicator/StatusIndicator.style.d.ts +8 -0
  41. package/dist/types/src/StatusIndicator/StatusIndicator.type.d.ts +1 -0
  42. package/dist/types/src/StatusIndicator/index.d.ts +2 -0
  43. package/dist/types/src/StatusLabel/StatusLabel.d.ts +3 -3
  44. package/dist/types/src/StatusLabel/StatusLabel.style.d.ts +10 -10
  45. package/dist/types/src/index.d.ts +1 -0
  46. package/package.json +5 -3
  47. package/src/BottomSheet/BottomSheet.stories.tsx +128 -0
  48. package/src/BottomSheet/BottomSheet.style.ts +7 -14
  49. package/src/BottomSheet/BottomSheet.test.tsx +19 -24
  50. package/src/BottomSheet/BottomSheet.tsx +112 -93
  51. package/src/BottomSheet/hooks/useBottomSheetBackHandler.test.ts +90 -0
  52. package/src/BottomSheet/hooks/useBottomSheetBackHandler.ts +41 -0
  53. package/src/Checkbox/Checkbox.test.tsx +118 -1
  54. package/src/Chip/Chip.style.ts +1 -1
  55. package/src/Chip/Chip.tsx +19 -1
  56. package/src/Content/Content.tsx +6 -1
  57. package/src/Content/ContentHorizontal.style.ts +20 -0
  58. package/src/Content/ContentSpaceAround.style.ts +20 -0
  59. package/src/Content/ContentVertical.style.ts +20 -0
  60. package/src/Form/context/types.ts +2 -2
  61. package/src/Form/hooks/useInternalForm.ts +2 -2
  62. package/src/InputText/InputText.test.tsx +115 -1
  63. package/src/InputText/InputText.tsx +3 -3
  64. package/src/Menu/types.ts +1 -1
  65. package/src/ProgressBar/ProgressBar.test.tsx +109 -0
  66. package/src/ProgressBar/ProgressBar.tsx +17 -1
  67. package/src/ProgressBar/ProgressBarInner.tsx +7 -10
  68. package/src/ProgressBar/ProgressBarStepped.tsx +12 -1
  69. package/src/ProgressBar/__snapshots__/ProgressBar.test.tsx.snap +14 -0
  70. package/src/ProgressBar/types.ts +22 -0
  71. package/src/StatusIndicator/StatusIndicator.style.ts +14 -0
  72. package/src/StatusIndicator/StatusIndicator.test.tsx +42 -0
  73. package/src/StatusIndicator/StatusIndicator.tsx +23 -0
  74. package/src/StatusIndicator/StatusIndicator.type.ts +6 -0
  75. package/src/StatusIndicator/__snapshots__/StatusIndicator.test.tsx.snap +96 -0
  76. package/src/StatusIndicator/index.ts +2 -0
  77. package/src/StatusLabel/StatusLabel.style.ts +10 -16
  78. package/src/StatusLabel/StatusLabel.tsx +15 -28
  79. package/src/StatusLabel/__snapshots__/StatusLabel.test.tsx.snap +133 -105
  80. package/src/ThumbnailList/__snapshots__/ThumbnailList.test.tsx.snap +199 -1
  81. package/src/hooks/useFormController.ts +1 -1
  82. package/src/index.ts +1 -0
  83. package/src/utils/meta/meta.json +1 -0
@@ -0,0 +1,96 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`StatusIndicator status when status prop set to "critical" should match snapshot 1`] = `
4
+ <View
5
+ style={
6
+ [
7
+ {
8
+ "backgroundColor": "hsl(107, 58%, 33%)",
9
+ "borderRadius": 100,
10
+ "height": 8,
11
+ "width": 8,
12
+ },
13
+ {
14
+ "backgroundColor": "hsl(6, 64%, 51%)",
15
+ },
16
+ ]
17
+ }
18
+ testID="criticalIndicator"
19
+ />
20
+ `;
21
+
22
+ exports[`StatusIndicator status when status prop set to "inactive" should match snapshot 1`] = `
23
+ <View
24
+ style={
25
+ [
26
+ {
27
+ "backgroundColor": "hsl(107, 58%, 33%)",
28
+ "borderRadius": 100,
29
+ "height": 8,
30
+ "width": 8,
31
+ },
32
+ {
33
+ "backgroundColor": "hsl(198, 25%, 33%)",
34
+ },
35
+ ]
36
+ }
37
+ testID="inactiveIndicator"
38
+ />
39
+ `;
40
+
41
+ exports[`StatusIndicator status when status prop set to "informative" should match snapshot 1`] = `
42
+ <View
43
+ style={
44
+ [
45
+ {
46
+ "backgroundColor": "hsl(107, 58%, 33%)",
47
+ "borderRadius": 100,
48
+ "height": 8,
49
+ "width": 8,
50
+ },
51
+ {
52
+ "backgroundColor": "hsl(207, 79%, 57%)",
53
+ },
54
+ ]
55
+ }
56
+ testID="informativeIndicator"
57
+ />
58
+ `;
59
+
60
+ exports[`StatusIndicator status when status prop set to "warning" should match snapshot 1`] = `
61
+ <View
62
+ style={
63
+ [
64
+ {
65
+ "backgroundColor": "hsl(107, 58%, 33%)",
66
+ "borderRadius": 100,
67
+ "height": 8,
68
+ "width": 8,
69
+ },
70
+ {
71
+ "backgroundColor": "hsl(51, 64%, 49%)",
72
+ },
73
+ ]
74
+ }
75
+ testID="warningIndicator"
76
+ />
77
+ `;
78
+
79
+ exports[`StatusIndicator status when status prop set to default ("success") should match snapshot 1`] = `
80
+ <View
81
+ style={
82
+ [
83
+ {
84
+ "backgroundColor": "hsl(107, 58%, 33%)",
85
+ "borderRadius": 100,
86
+ "height": 8,
87
+ "width": 8,
88
+ },
89
+ {
90
+ "backgroundColor": "hsl(107, 58%, 33%)",
91
+ },
92
+ ]
93
+ }
94
+ testID="successIndicator"
95
+ />
96
+ `;
@@ -0,0 +1,2 @@
1
+ export { StatusIndicator } from "./StatusIndicator";
2
+ export type { StatusIndicatorProps } from "./StatusIndicator";
@@ -1,33 +1,27 @@
1
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
2
2
 
3
- const statusLabelRadius = 3; // Needs to be hardcoded to 3 as this shouldn't change with the tokens
4
-
5
3
  export const useStyles = buildThemedStyles(tokens => {
6
- const statusLabelIconDiameter =
7
- tokens["space-base"] - tokens["space-smaller"]; //12px
8
- const indicatorOffset = tokens["space-smallest"] + tokens["space-minuscule"];
9
-
10
4
  return {
11
5
  statusLabelRow: {
12
6
  flexDirection: "row",
13
7
  justifyContent: "flex-end",
8
+ alignItems: "center",
9
+ alignSelf: "flex-start",
14
10
  flexWrap: "nowrap",
11
+ flexGrow: 0,
12
+ flexShrink: 1,
13
+ gap: tokens["space-smaller"],
14
+ backgroundColor: tokens["color-success--surface"],
15
+ borderRadius: tokens["radius-large"],
16
+ paddingVertical: tokens["space-smaller"],
17
+ paddingHorizontal: tokens["space-small"],
15
18
  },
16
19
  statusLabelText: {
17
20
  flexShrink: 1,
18
- },
19
- statusLabelIcon: {
20
- borderRadius: statusLabelRadius,
21
- backgroundColor: tokens["color-success"],
22
- width: statusLabelIconDiameter,
23
- height: statusLabelIconDiameter,
24
- marginTop: indicatorOffset,
21
+ marginBottom: -1,
25
22
  },
26
23
  labelTextStartAligned: {
27
24
  flexDirection: "row-reverse",
28
25
  },
29
- innerPad: {
30
- width: tokens["space-small"],
31
- },
32
26
  };
33
27
  });
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
2
  import { View } from "react-native";
3
3
  import { useStyles } from "./StatusLabel.style";
4
- import { Text } from "../Text";
5
- import { useAtlantisTheme } from "../AtlantisThemeContext";
4
+ import { Typography } from "../Typography";
5
+ import { StatusIndicator } from "../StatusIndicator";
6
+ import { tokens } from "../utils/design";
6
7
 
7
8
  export type StatusType =
8
9
  | "success"
@@ -18,17 +19,17 @@ export interface StatusLabelType {
18
19
 
19
20
  interface StatusLabelProps {
20
21
  /**
21
- * Text to display.
22
+ * Text to display
22
23
  */
23
24
  readonly text: string;
24
25
 
25
26
  /**
26
- * Alignment of text
27
+ * Alignment of text and StatusIndicator
27
28
  */
28
29
  readonly alignment?: "start" | "end";
29
30
 
30
31
  /**
31
- * Status color of the square beside text
32
+ * Status color of label container, label, and StatusIndicator
32
33
  */
33
34
  readonly status?: StatusType;
34
35
  }
@@ -44,35 +45,21 @@ export function StatusLabel({
44
45
  <View
45
46
  style={[
46
47
  styles.statusLabelRow,
48
+ { backgroundColor: tokens[`color-${status}--surface`] },
47
49
  alignment === "start" && styles.labelTextStartAligned,
48
50
  ]}
49
51
  >
50
52
  <View style={styles.statusLabelText}>
51
- <Text align={alignment} level="textSupporting" variation="subdued">
53
+ <Typography
54
+ align={alignment}
55
+ size="smaller"
56
+ fontWeight="medium"
57
+ color={`${status}OnSurface`}
58
+ >
52
59
  {text}
53
- </Text>
60
+ </Typography>
54
61
  </View>
55
- <View style={styles.innerPad} />
56
- <StatusLabelIcon status={status} styles={styles} />
62
+ <StatusIndicator status={status} />
57
63
  </View>
58
64
  );
59
65
  }
60
-
61
- interface StatusLabelIconProps {
62
- readonly status: StatusType;
63
- readonly styles: ReturnType<typeof useStyles>;
64
- }
65
-
66
- function StatusLabelIcon({ status, styles }: StatusLabelIconProps) {
67
- const { tokens } = useAtlantisTheme();
68
-
69
- return (
70
- <View
71
- testID={`${status}LabelIcon`}
72
- style={[
73
- styles.statusLabelIcon,
74
- { backgroundColor: tokens[`color-${status}`] },
75
- ]}
76
- />
77
- );
78
- }