@jobber/components-native 0.84.3 → 0.84.4-match-mobi-55ef4ec.7

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 (29) hide show
  1. package/dist/package.json +2 -2
  2. package/dist/src/StatusIndicator/StatusIndicator.js +11 -0
  3. package/dist/src/StatusIndicator/StatusIndicator.style.js +12 -0
  4. package/dist/src/StatusIndicator/StatusIndicator.type.js +1 -0
  5. package/dist/src/StatusIndicator/index.js +1 -0
  6. package/dist/src/StatusLabel/StatusLabel.js +6 -12
  7. package/dist/src/StatusLabel/StatusLabel.style.js +9 -13
  8. package/dist/src/index.js +1 -0
  9. package/dist/src/utils/meta/meta.json +1 -0
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/dist/types/src/StatusIndicator/StatusIndicator.d.ts +6 -0
  12. package/dist/types/src/StatusIndicator/StatusIndicator.style.d.ts +8 -0
  13. package/dist/types/src/StatusIndicator/StatusIndicator.type.d.ts +1 -0
  14. package/dist/types/src/StatusIndicator/index.d.ts +2 -0
  15. package/dist/types/src/StatusLabel/StatusLabel.d.ts +3 -3
  16. package/dist/types/src/StatusLabel/StatusLabel.style.d.ts +9 -10
  17. package/dist/types/src/index.d.ts +1 -0
  18. package/package.json +2 -2
  19. package/src/StatusIndicator/StatusIndicator.style.ts +14 -0
  20. package/src/StatusIndicator/StatusIndicator.test.tsx +42 -0
  21. package/src/StatusIndicator/StatusIndicator.tsx +23 -0
  22. package/src/StatusIndicator/StatusIndicator.type.ts +6 -0
  23. package/src/StatusIndicator/__snapshots__/StatusIndicator.test.tsx.snap +96 -0
  24. package/src/StatusIndicator/index.ts +2 -0
  25. package/src/StatusLabel/StatusLabel.style.ts +9 -16
  26. package/src/StatusLabel/StatusLabel.tsx +15 -28
  27. package/src/StatusLabel/__snapshots__/StatusLabel.test.tsx.snap +126 -105
  28. package/src/index.ts +1 -0
  29. package/src/utils/meta/meta.json +1 -0
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.84.3",
3
+ "version": "0.84.4-match-mobi-55ef4ec.7+55ef4ec91",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -85,5 +85,5 @@
85
85
  "react-native-safe-area-context": "^5.4.0",
86
86
  "react-native-svg": ">=12.0.0"
87
87
  },
88
- "gitHead": "35579c7a74222f56c1f6d00ae964f244886471b6"
88
+ "gitHead": "55ef4ec916758fd15610ded5298d293958e665fa"
89
89
  }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { useStyles } from "./StatusIndicator.style";
4
+ import { tokens } from "../utils/design";
5
+ export function StatusIndicator({ status }) {
6
+ const styles = useStyles();
7
+ return (React.createElement(View, { testID: `${status}Indicator`, style: [
8
+ styles.statusIndicator,
9
+ { backgroundColor: tokens[`color-${status}`] },
10
+ ] }));
11
+ }
@@ -0,0 +1,12 @@
1
+ import { buildThemedStyles } from "../AtlantisThemeContext";
2
+ export const useStyles = buildThemedStyles(tokens => {
3
+ const statusIndicatorDiameter = 8;
4
+ return {
5
+ statusIndicator: {
6
+ borderRadius: tokens["radius-circle"],
7
+ backgroundColor: tokens["color-success"],
8
+ width: statusIndicatorDiameter,
9
+ height: statusIndicatorDiameter,
10
+ },
11
+ };
12
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { StatusIndicator } from "./StatusIndicator";
@@ -1,23 +1,17 @@
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
  export function StatusLabel({ text, alignment = "end", status = "success", }) {
7
8
  const styles = useStyles();
8
9
  return (React.createElement(View, { style: [
9
10
  styles.statusLabelRow,
11
+ { backgroundColor: tokens[`color-${status}--surface`] },
10
12
  alignment === "start" && styles.labelTextStartAligned,
11
13
  ] },
12
14
  React.createElement(View, { style: styles.statusLabelText },
13
- React.createElement(Text, { align: alignment, level: "textSupporting", variation: "subdued" }, text)),
14
- React.createElement(View, { style: styles.innerPad }),
15
- React.createElement(StatusLabelIcon, { status: status, styles: styles })));
16
- }
17
- function StatusLabelIcon({ status, styles }) {
18
- const { tokens } = useAtlantisTheme();
19
- return (React.createElement(View, { testID: `${status}LabelIcon`, style: [
20
- styles.statusLabelIcon,
21
- { backgroundColor: tokens[`color-${status}`] },
22
- ] }));
15
+ React.createElement(Typography, { align: alignment, size: "smaller", fontWeight: "medium", color: `${status}OnSurface` }, text)),
16
+ React.createElement(StatusIndicator, { status: status })));
23
17
  }
@@ -1,29 +1,25 @@
1
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
2
- const statusLabelRadius = 3; // Needs to be hardcoded to 3 as this shouldn't change with the tokens
3
2
  export const useStyles = buildThemedStyles(tokens => {
4
- const statusLabelIconDiameter = tokens["space-base"] - tokens["space-smaller"]; //12px
5
- const indicatorOffset = tokens["space-smallest"] + tokens["space-minuscule"];
6
3
  return {
7
4
  statusLabelRow: {
8
5
  flexDirection: "row",
9
6
  justifyContent: "flex-end",
7
+ alignItems: "center",
10
8
  flexWrap: "nowrap",
9
+ flexGrow: 0,
10
+ flexShrink: 1,
11
+ gap: tokens["space-smaller"],
12
+ backgroundColor: tokens["color-success--surface"],
13
+ borderRadius: tokens["radius-large"],
14
+ paddingVertical: tokens["space-smaller"],
15
+ paddingHorizontal: tokens["space-small"],
11
16
  },
12
17
  statusLabelText: {
13
18
  flexShrink: 1,
14
- },
15
- statusLabelIcon: {
16
- borderRadius: statusLabelRadius,
17
- backgroundColor: tokens["color-success"],
18
- width: statusLabelIconDiameter,
19
- height: statusLabelIconDiameter,
20
- marginTop: indicatorOffset,
19
+ marginBottom: -1,
21
20
  },
22
21
  labelTextStartAligned: {
23
22
  flexDirection: "row-reverse",
24
23
  },
25
- innerPad: {
26
- width: tokens["space-small"],
27
- },
28
24
  };
29
25
  });
package/dist/src/index.js CHANGED
@@ -39,6 +39,7 @@ export * from "./Menu";
39
39
  export * from "./ProgressBar";
40
40
  export * from "./Select";
41
41
  export * from "./StatusLabel";
42
+ export * from "./StatusIndicator";
42
43
  export * from "./Switch";
43
44
  export * from "./Text";
44
45
  export * from "./TextList";
@@ -57,6 +57,7 @@
57
57
  "Option",
58
58
  "ProgressBar",
59
59
  "Select",
60
+ "StatusIndicator",
60
61
  "StatusLabel",
61
62
  "Switch",
62
63
  "Text",