@artsy/palette-mobile 13.2.7 → 13.2.8

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,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { ViewStyle } from "react-native";
2
3
  import { Color } from "../../types";
3
4
  export interface ProgressBarProps {
4
5
  animationDuration?: number;
@@ -7,5 +8,6 @@ export interface ProgressBarProps {
7
8
  onCompletion?: () => void;
8
9
  progress: number;
9
10
  trackColor?: Color;
11
+ style?: ViewStyle;
10
12
  }
11
- export declare const ProgressBar: ({ animationDuration, backgroundColor, height, onCompletion, progress: unclampedProgress, trackColor, }: ProgressBarProps) => JSX.Element;
13
+ export declare const ProgressBar: ({ animationDuration, backgroundColor, height, onCompletion, progress: unclampedProgress, trackColor, style, }: ProgressBarProps) => JSX.Element;
@@ -27,11 +27,13 @@ exports.ProgressBar = void 0;
27
27
  const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  const react_1 = require("react");
29
29
  const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
30
+ const hooks_1 = require("../../utils/hooks");
30
31
  const useColor_1 = require("../../utils/hooks/useColor");
31
32
  const Flex_1 = require("../Flex");
32
33
  const clamp = (num, min, max) => Math.max(min, Math.min(num, max));
33
- const ProgressBar = ({ animationDuration = 200, backgroundColor = "black30", height = 2, onCompletion, progress: unclampedProgress, trackColor = "blue100", }) => {
34
+ const ProgressBar = ({ animationDuration = 200, backgroundColor = "black30", height = 2, onCompletion, progress: unclampedProgress, trackColor = "blue100", style, }) => {
34
35
  const color = (0, useColor_1.useColor)();
36
+ const space = (0, hooks_1.useSpace)();
35
37
  const width = (0, react_native_reanimated_1.useSharedValue)(0);
36
38
  const progress = clamp(unclampedProgress, 0, 100);
37
39
  const progressAnim = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
@@ -45,6 +47,10 @@ const ProgressBar = ({ animationDuration = 200, backgroundColor = "black30", hei
45
47
  setOnCompletionCalled(true);
46
48
  }
47
49
  }, [progress]);
48
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { width: "100%", backgroundColor: backgroundColor, my: 1, children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { testID: "progress-bar-track", style: [progressAnim, { height, backgroundColor: color(trackColor) }] }) }));
50
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { width: "10%", backgroundColor: backgroundColor, style: {
51
+ marginVertical: space(1),
52
+ width: "100%",
53
+ ...style,
54
+ }, children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { testID: "progress-bar-track", style: [progressAnim, { height, backgroundColor: color(trackColor) }] }) }));
49
55
  };
50
56
  exports.ProgressBar = ProgressBar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "13.2.7",
3
+ "version": "13.2.8",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "RCT_METRO_PORT=8082 react-native run-android --port 8082",