@jobber/components-native 0.12.0 → 0.14.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 (35) hide show
  1. package/dist/src/Chip/Chip.js +43 -0
  2. package/dist/src/Chip/Chip.style.js +32 -0
  3. package/dist/src/Chip/index.js +1 -0
  4. package/dist/src/ProgressBar/ProgressBar.js +21 -0
  5. package/dist/src/ProgressBar/ProgressBar.style.js +24 -0
  6. package/dist/src/ProgressBar/ProgressBarInner.js +29 -0
  7. package/dist/src/ProgressBar/index.js +1 -0
  8. package/dist/src/ProgressBar/messages.js +13 -0
  9. package/dist/src/ProgressBar/types.js +1 -0
  10. package/dist/src/index.js +2 -0
  11. package/dist/tsconfig.tsbuildinfo +1 -1
  12. package/dist/types/src/Chip/Chip.d.ts +45 -0
  13. package/dist/types/src/Chip/Chip.style.d.ts +29 -0
  14. package/dist/types/src/Chip/index.d.ts +2 -0
  15. package/dist/types/src/ProgressBar/ProgressBar.d.ts +3 -0
  16. package/dist/types/src/ProgressBar/ProgressBar.style.d.ts +22 -0
  17. package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +9 -0
  18. package/dist/types/src/ProgressBar/index.d.ts +2 -0
  19. package/dist/types/src/ProgressBar/messages.d.ts +12 -0
  20. package/dist/types/src/ProgressBar/types.d.ts +28 -0
  21. package/dist/types/src/index.d.ts +2 -0
  22. package/package.json +2 -2
  23. package/src/Chip/Chip.style.ts +34 -0
  24. package/src/Chip/Chip.test.tsx +133 -0
  25. package/src/Chip/Chip.tsx +142 -0
  26. package/src/Chip/index.ts +2 -0
  27. package/src/ProgressBar/ProgressBar.style.ts +25 -0
  28. package/src/ProgressBar/ProgressBar.test.tsx +41 -0
  29. package/src/ProgressBar/ProgressBar.tsx +58 -0
  30. package/src/ProgressBar/ProgressBarInner.tsx +47 -0
  31. package/src/ProgressBar/__snapshots__/ProgressBar.test.tsx.snap +138 -0
  32. package/src/ProgressBar/index.tsx +2 -0
  33. package/src/ProgressBar/messages.ts +14 -0
  34. package/src/ProgressBar/types.ts +34 -0
  35. package/src/index.ts +2 -0
@@ -0,0 +1,138 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
4
+ <View
5
+ accessibilityLabel="0 of 0 complete, 1 in progress"
6
+ accessibilityRole="progressbar"
7
+ accessible={true}
8
+ >
9
+ <View
10
+ style={
11
+ {
12
+ "flexDirection": "row",
13
+ "height": 20,
14
+ "marginBottom": 8,
15
+ "marginTop": 8,
16
+ "position": "relative",
17
+ }
18
+ }
19
+ >
20
+ <View
21
+ style={
22
+ [
23
+ {
24
+ "backgroundColor": "rgba(255,255,255,0.3)",
25
+ "borderRadius": 100,
26
+ "height": "100%",
27
+ "left": 0,
28
+ "position": "absolute",
29
+ "top": 0,
30
+ "width": "100%",
31
+ },
32
+ {
33
+ "backgroundColor": "rgb(244, 244, 244)",
34
+ "width": "100%",
35
+ },
36
+ ]
37
+ }
38
+ />
39
+ <View
40
+ style={
41
+ [
42
+ {
43
+ "backgroundColor": "rgba(255,255,255,0.3)",
44
+ "borderRadius": 100,
45
+ "height": "100%",
46
+ "left": 0,
47
+ "position": "absolute",
48
+ "top": 0,
49
+ "width": "100%",
50
+ },
51
+ {
52
+ "backgroundColor": "rgb(60, 162, 224)",
53
+ "width": "0%",
54
+ },
55
+ ]
56
+ }
57
+ />
58
+ <View
59
+ style={
60
+ [
61
+ {
62
+ "backgroundColor": "rgba(255,255,255,0.3)",
63
+ "borderRadius": 100,
64
+ "height": "100%",
65
+ "left": 0,
66
+ "position": "absolute",
67
+ "top": 0,
68
+ "width": "100%",
69
+ },
70
+ {
71
+ "backgroundColor": "rgb(125, 176, 14)",
72
+ "width": "0%",
73
+ },
74
+ ]
75
+ }
76
+ />
77
+ </View>
78
+ </View>
79
+ `;
80
+
81
+ exports[`renders green CompletedProgress bar when 1 or more jobs is completed 1`] = `
82
+ <View
83
+ accessibilityLabel="1 of 2 complete"
84
+ accessibilityRole="progressbar"
85
+ accessible={true}
86
+ >
87
+ <View
88
+ style={
89
+ {
90
+ "flexDirection": "row",
91
+ "height": 20,
92
+ "marginBottom": 8,
93
+ "marginTop": 8,
94
+ "position": "relative",
95
+ }
96
+ }
97
+ >
98
+ <View
99
+ style={
100
+ [
101
+ {
102
+ "backgroundColor": "rgba(255,255,255,0.3)",
103
+ "borderRadius": 100,
104
+ "height": "100%",
105
+ "left": 0,
106
+ "position": "absolute",
107
+ "top": 0,
108
+ "width": "100%",
109
+ },
110
+ {
111
+ "backgroundColor": "rgb(244, 244, 244)",
112
+ "width": "100%",
113
+ },
114
+ ]
115
+ }
116
+ />
117
+ <View
118
+ style={
119
+ [
120
+ {
121
+ "backgroundColor": "rgba(255,255,255,0.3)",
122
+ "borderRadius": 100,
123
+ "height": "100%",
124
+ "left": 0,
125
+ "position": "absolute",
126
+ "top": 0,
127
+ "width": "100%",
128
+ },
129
+ {
130
+ "backgroundColor": "rgb(125, 176, 14)",
131
+ "width": "50%",
132
+ },
133
+ ]
134
+ }
135
+ />
136
+ </View>
137
+ </View>
138
+ `;
@@ -0,0 +1,2 @@
1
+ export { ProgressBar } from "./ProgressBar";
2
+ export type { ProgressBarProps } from "./types";
@@ -0,0 +1,14 @@
1
+ import { defineMessages } from "react-intl";
2
+
3
+ export const messages = defineMessages({
4
+ complete: {
5
+ id: "complete",
6
+ defaultMessage: "{current} of {total} complete",
7
+ description: "Progress bar accessibilityLabel for current/total",
8
+ },
9
+ inProgress: {
10
+ id: "inProgress",
11
+ defaultMessage: "{inProgress} in progress",
12
+ description: "Progress bar accessibilityLabel for inProgress/total",
13
+ },
14
+ });
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from "react";
2
+
3
+ export interface ProgressBarProps {
4
+ /**
5
+ * The total number of items to be completed
6
+ */
7
+ readonly total: number;
8
+
9
+ /**
10
+ * The number of items that are currently completed
11
+ */
12
+ readonly current: number;
13
+
14
+ /**
15
+ * The number of items in progress (not completed, but to be less than the total)
16
+ */
17
+ readonly inProgress?: number;
18
+
19
+ /**
20
+ * If the progress bar is loading, the progress indicators aren't rendered on the screen
21
+ */
22
+ readonly loading?: boolean;
23
+
24
+ /**
25
+ * If the amountFormatted and totalAmountFormatted text needs to appear more visibile because of the
26
+ * background, for example
27
+ */
28
+ readonly reverseTheme?: boolean;
29
+
30
+ /**
31
+ * Component to render above the progress bar.
32
+ */
33
+ readonly header?: ReactNode;
34
+ }
package/src/index.ts CHANGED
@@ -11,4 +11,6 @@ export * from "./StatusLabel";
11
11
  export * from "./AtlantisContext";
12
12
  export * from "./Button";
13
13
  export * from "./InputFieldWrapper";
14
+ export * from "./ProgressBar";
14
15
  export * from "./Heading";
16
+ export * from "./Chip";