@jobber/components-native 0.73.3 → 0.74.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.
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { ProgressBarProps } from "./types";
3
- export declare function ProgressBar({ loading, total, current, inProgress, reverseTheme, header, variation, }: ProgressBarProps): JSX.Element;
3
+ export declare function ProgressBar({ loading, total, current, inProgress, reverseTheme, header, variation, size, }: ProgressBarProps): JSX.Element;
@@ -0,0 +1,11 @@
1
+ export declare const sizeStyles: {
2
+ smaller: {
3
+ height: number;
4
+ };
5
+ small: {
6
+ height: number;
7
+ };
8
+ base: {
9
+ height: number;
10
+ };
11
+ };
@@ -2,7 +2,6 @@ export declare const styles: {
2
2
  progressBarContainer: {
3
3
  marginTop: number;
4
4
  marginBottom: number;
5
- height: number;
6
5
  position: "relative";
7
6
  flexDirection: "row";
8
7
  };
@@ -31,4 +31,9 @@ export interface ProgressBarProps {
31
31
  * @default progress
32
32
  */
33
33
  readonly variation?: "progress" | "stepped";
34
+ /**
35
+ * Set the size of the progress bar
36
+ * @default base
37
+ */
38
+ readonly size?: "smaller" | "small" | "base";
34
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.73.3",
3
+ "version": "0.74.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -79,5 +79,5 @@
79
79
  "react-native-safe-area-context": "^4.5.2",
80
80
  "react-native-svg": ">=12.0.0"
81
81
  },
82
- "gitHead": "c222024abdad555a2180c6732f55b1a42f6cda94"
82
+ "gitHead": "f948ae04472c41f83586ec963321116721d680be"
83
83
  }
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import { RenderAPI, fireEvent, render } from "@testing-library/react-native";
3
- // eslint-disable-next-line no-restricted-imports
4
3
  import { Text, ViewStyle } from "react-native";
5
4
  import {
6
5
  InputFieldWrapper,
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import {
3
- // eslint-disable-next-line no-restricted-imports
4
3
  Text as RNText,
5
4
  StyleProp,
6
5
  TextStyle,
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import {
3
- // eslint-disable-next-line no-restricted-imports
4
3
  Text as RNText,
5
4
  StyleProp,
6
5
  TextStyle,
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import {
3
3
  Pressable,
4
- // eslint-disable-next-line no-restricted-imports
5
4
  Text as RNText,
6
5
  StyleProp,
7
6
  TextStyle,
@@ -3,7 +3,6 @@ import {
3
3
  InputAccessoryView,
4
4
  Keyboard,
5
5
  Platform,
6
- // eslint-disable-next-line no-restricted-imports
7
6
  Button as RNButton,
8
7
  View,
9
8
  useColorScheme,
@@ -0,0 +1,7 @@
1
+ import { StyleSheet } from "react-native";
2
+
3
+ export const sizeStyles = StyleSheet.create({
4
+ smaller: { height: 4 },
5
+ small: { height: 8 },
6
+ base: { height: 16 },
7
+ });
@@ -5,7 +5,6 @@ export const styles = StyleSheet.create({
5
5
  progressBarContainer: {
6
6
  marginTop: tokens["space-small"],
7
7
  marginBottom: tokens["space-small"],
8
- height: 20,
9
8
  position: "relative",
10
9
  flexDirection: "row",
11
10
  },
@@ -4,6 +4,7 @@ import { ProgressBarProps } from "./types";
4
4
  import { styles } from "./ProgressBar.style";
5
5
  import { ProgressBarInner, calculateWidth } from "./ProgressBarInner";
6
6
  import { ProgressBarStepped } from "./ProgressBarStepped";
7
+ import { sizeStyles } from "./ProgressBar.size.style";
7
8
  import { tokens } from "../utils/design";
8
9
  import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
9
10
 
@@ -15,6 +16,7 @@ export function ProgressBar({
15
16
  reverseTheme = false,
16
17
  header,
17
18
  variation = "progress",
19
+ size = "base",
18
20
  }: ProgressBarProps): JSX.Element {
19
21
  const { t } = useAtlantisI18n();
20
22
 
@@ -34,7 +36,7 @@ export function ProgressBar({
34
36
  inProgress={inProgress}
35
37
  />
36
38
  ) : (
37
- <View style={styles.progressBarContainer}>
39
+ <View style={[styles.progressBarContainer, sizeStyles[size]]}>
38
40
  <ProgressBarInner
39
41
  width={100}
40
42
  animationDuration={0}
@@ -8,13 +8,17 @@ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
8
8
  >
9
9
  <View
10
10
  style={
11
- {
12
- "flexDirection": "row",
13
- "height": 20,
14
- "marginBottom": 8,
15
- "marginTop": 8,
16
- "position": "relative",
17
- }
11
+ [
12
+ {
13
+ "flexDirection": "row",
14
+ "marginBottom": 8,
15
+ "marginTop": 8,
16
+ "position": "relative",
17
+ },
18
+ {
19
+ "height": 16,
20
+ },
21
+ ]
18
22
  }
19
23
  >
20
24
  <View
@@ -86,13 +90,17 @@ exports[`renders green CompletedProgress bar when 1 or more jobs is completed 1`
86
90
  >
87
91
  <View
88
92
  style={
89
- {
90
- "flexDirection": "row",
91
- "height": 20,
92
- "marginBottom": 8,
93
- "marginTop": 8,
94
- "position": "relative",
95
- }
93
+ [
94
+ {
95
+ "flexDirection": "row",
96
+ "marginBottom": 8,
97
+ "marginTop": 8,
98
+ "position": "relative",
99
+ },
100
+ {
101
+ "height": 16,
102
+ },
103
+ ]
96
104
  }
97
105
  >
98
106
  <View
@@ -38,4 +38,10 @@ export interface ProgressBarProps {
38
38
  * @default progress
39
39
  */
40
40
  readonly variation?: "progress" | "stepped";
41
+
42
+ /**
43
+ * Set the size of the progress bar
44
+ * @default base
45
+ */
46
+ readonly size?: "smaller" | "small" | "base";
41
47
  }
@@ -4,7 +4,6 @@ import {
4
4
  I18nManager,
5
5
  StyleProp,
6
6
  StyleSheet,
7
- // eslint-disable-next-line no-restricted-imports
8
7
  Text,
9
8
  TextProps,
10
9
  TextStyle,