@jobber/components-native 0.84.4-match-mobi-accfa8a.9 → 0.84.4-match-mobi-3bb95e9.11

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.
@@ -8,7 +8,11 @@ interface StatusLabelProps {
8
8
  /**
9
9
  * Text to display
10
10
  */
11
- readonly text: string;
11
+ readonly text?: string;
12
+ /**
13
+ * Optional children for the status label's label
14
+ */
15
+ readonly children?: React.ReactNode;
12
16
  /**
13
17
  * Alignment of text and StatusIndicator
14
18
  */
@@ -18,5 +22,5 @@ interface StatusLabelProps {
18
22
  */
19
23
  readonly status?: StatusType;
20
24
  }
21
- export declare function StatusLabel({ text, alignment, status, }: StatusLabelProps): React.JSX.Element;
25
+ export declare function StatusLabel({ text, children, alignment, status, }: StatusLabelProps): React.JSX.Element;
22
26
  export {};
@@ -15,7 +15,6 @@ export declare const useStyles: () => {
15
15
  };
16
16
  statusLabelText: {
17
17
  flexShrink: number;
18
- marginBottom: number;
19
18
  };
20
19
  labelTextStartAligned: {
21
20
  flexDirection: "row-reverse";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.84.4-match-mobi-accfa8a.9+accfa8aef",
3
+ "version": "0.84.4-match-mobi-3bb95e9.11+3bb95e964",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -96,5 +96,5 @@
96
96
  "react-native-safe-area-context": "^5.4.0",
97
97
  "react-native-svg": ">=12.0.0"
98
98
  },
99
- "gitHead": "accfa8aefd00ea92526e90f81830b9a8691bdac7"
99
+ "gitHead": "3bb95e964be95042005c0b686e2d749294f3a3d5"
100
100
  }
@@ -13,12 +13,11 @@ export const useStyles = buildThemedStyles(tokens => {
13
13
  gap: tokens["space-smaller"],
14
14
  backgroundColor: tokens["color-success--surface"],
15
15
  borderRadius: tokens["radius-large"],
16
- paddingVertical: tokens["space-smaller"],
16
+ paddingVertical: tokens["space-smallest"] + tokens["space-minuscule"],
17
17
  paddingHorizontal: tokens["space-small"],
18
18
  },
19
19
  statusLabelText: {
20
20
  flexShrink: 1,
21
- marginBottom: -1,
22
21
  },
23
22
  labelTextStartAligned: {
24
23
  flexDirection: "row-reverse",
@@ -21,7 +21,12 @@ interface StatusLabelProps {
21
21
  /**
22
22
  * Text to display
23
23
  */
24
- readonly text: string;
24
+ readonly text?: string;
25
+
26
+ /**
27
+ * Optional children for the status label's label
28
+ */
29
+ readonly children?: React.ReactNode;
25
30
 
26
31
  /**
27
32
  * Alignment of text and StatusIndicator
@@ -36,6 +41,7 @@ interface StatusLabelProps {
36
41
 
37
42
  export function StatusLabel({
38
43
  text,
44
+ children,
39
45
  alignment = "end",
40
46
  status = "success",
41
47
  }: StatusLabelProps) {
@@ -49,16 +55,19 @@ export function StatusLabel({
49
55
  alignment === "start" && styles.labelTextStartAligned,
50
56
  ]}
51
57
  >
52
- <View style={styles.statusLabelText}>
53
- <Typography
54
- align={alignment}
55
- size="smaller"
56
- fontWeight="medium"
57
- color={`${status}OnSurface`}
58
- >
59
- {text}
60
- </Typography>
61
- </View>
58
+ {children && <View>{children}</View>}
59
+ {text && (
60
+ <View style={styles.statusLabelText}>
61
+ <Typography
62
+ align={alignment}
63
+ size="smaller"
64
+ fontWeight="medium"
65
+ color={`${status}OnSurface`}
66
+ >
67
+ {text}
68
+ </Typography>
69
+ </View>
70
+ )}
62
71
  <StatusIndicator status={status} />
63
72
  </View>
64
73
  );
@@ -16,7 +16,7 @@ exports[`StatusLabel alignment when alignment prop set to "end" should match sna
16
16
  "gap": 4,
17
17
  "justifyContent": "flex-end",
18
18
  "paddingHorizontal": 8,
19
- "paddingVertical": 4,
19
+ "paddingVertical": 3,
20
20
  },
21
21
  {
22
22
  "backgroundColor": "hsl(109, 28%, 92%)",
@@ -29,7 +29,6 @@ exports[`StatusLabel alignment when alignment prop set to "end" should match sna
29
29
  style={
30
30
  {
31
31
  "flexShrink": 1,
32
- "marginBottom": -1,
33
32
  }
34
33
  }
35
34
  >
@@ -99,7 +98,7 @@ exports[`StatusLabel alignment when alignment prop set to default ("start") shou
99
98
  "gap": 4,
100
99
  "justifyContent": "flex-end",
101
100
  "paddingHorizontal": 8,
102
- "paddingVertical": 4,
101
+ "paddingVertical": 3,
103
102
  },
104
103
  {
105
104
  "backgroundColor": "hsl(109, 28%, 92%)",
@@ -112,7 +111,6 @@ exports[`StatusLabel alignment when alignment prop set to default ("start") shou
112
111
  style={
113
112
  {
114
113
  "flexShrink": 1,
115
- "marginBottom": -1,
116
114
  }
117
115
  }
118
116
  >
@@ -182,7 +180,7 @@ exports[`StatusLabel status when status prop set to "critical" should match snap
182
180
  "gap": 4,
183
181
  "justifyContent": "flex-end",
184
182
  "paddingHorizontal": 8,
185
- "paddingVertical": 4,
183
+ "paddingVertical": 3,
186
184
  },
187
185
  {
188
186
  "backgroundColor": "hsl(7, 63%, 95%)",
@@ -195,7 +193,6 @@ exports[`StatusLabel status when status prop set to "critical" should match snap
195
193
  style={
196
194
  {
197
195
  "flexShrink": 1,
198
- "marginBottom": -1,
199
196
  }
200
197
  }
201
198
  >
@@ -265,7 +262,7 @@ exports[`StatusLabel status when status prop set to "inactive" should match snap
265
262
  "gap": 4,
266
263
  "justifyContent": "flex-end",
267
264
  "paddingHorizontal": 8,
268
- "paddingVertical": 4,
265
+ "paddingVertical": 3,
269
266
  },
270
267
  {
271
268
  "backgroundColor": "hsl(195, 12%, 94%)",
@@ -278,7 +275,6 @@ exports[`StatusLabel status when status prop set to "inactive" should match snap
278
275
  style={
279
276
  {
280
277
  "flexShrink": 1,
281
- "marginBottom": -1,
282
278
  }
283
279
  }
284
280
  >
@@ -348,7 +344,7 @@ exports[`StatusLabel status when status prop set to "informative" should match s
348
344
  "gap": 4,
349
345
  "justifyContent": "flex-end",
350
346
  "paddingHorizontal": 8,
351
- "paddingVertical": 4,
347
+ "paddingVertical": 3,
352
348
  },
353
349
  {
354
350
  "backgroundColor": "hsl(207, 87%, 94%)",
@@ -361,7 +357,6 @@ exports[`StatusLabel status when status prop set to "informative" should match s
361
357
  style={
362
358
  {
363
359
  "flexShrink": 1,
364
- "marginBottom": -1,
365
360
  }
366
361
  }
367
362
  >
@@ -431,7 +426,7 @@ exports[`StatusLabel status when status prop set to "warning" should match snaps
431
426
  "gap": 4,
432
427
  "justifyContent": "flex-end",
433
428
  "paddingHorizontal": 8,
434
- "paddingVertical": 4,
429
+ "paddingVertical": 3,
435
430
  },
436
431
  {
437
432
  "backgroundColor": "hsl(52, 64%, 89%)",
@@ -444,7 +439,6 @@ exports[`StatusLabel status when status prop set to "warning" should match snaps
444
439
  style={
445
440
  {
446
441
  "flexShrink": 1,
447
- "marginBottom": -1,
448
442
  }
449
443
  }
450
444
  >
@@ -514,7 +508,7 @@ exports[`StatusLabel status when status prop set to default ("success") should m
514
508
  "gap": 4,
515
509
  "justifyContent": "flex-end",
516
510
  "paddingHorizontal": 8,
517
- "paddingVertical": 4,
511
+ "paddingVertical": 3,
518
512
  },
519
513
  {
520
514
  "backgroundColor": "hsl(109, 28%, 92%)",
@@ -527,7 +521,6 @@ exports[`StatusLabel status when status prop set to default ("success") should m
527
521
  style={
528
522
  {
529
523
  "flexShrink": 1,
530
- "marginBottom": -1,
531
524
  }
532
525
  }
533
526
  >