@artsy/palette-mobile 13.2.6 → 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.
@@ -5,5 +5,5 @@ type FollowButtonProps = Omit<ButtonProps, "variant" | "size" | "longestText" |
5
5
  followCount?: number;
6
6
  longestText?: string;
7
7
  };
8
- export declare const FollowButton: ({ isFollowed, followCount, longestText, ...restProps }: FollowButtonProps) => JSX.Element;
8
+ export declare const FollowButton: ({ isFollowed, followCount, longestText, loading, ...restProps }: FollowButtonProps) => JSX.Element;
9
9
  export {};
@@ -6,7 +6,7 @@ const CheckIcon_1 = require("../../svgs/CheckIcon");
6
6
  const formatLargeNumber_1 = require("../../utils/formatLargeNumber");
7
7
  const Button_1 = require("../Button");
8
8
  const Text_1 = require("../Text");
9
- const FollowButton = ({ isFollowed, followCount, longestText, ...restProps }) => {
10
- return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { variant: isFollowed ? "outline" : "outlineGray", size: "small", longestText: longestText ? longestText : "Following", icon: isFollowed && (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, { fill: "black60", width: "16px", height: "16px" }), ...restProps, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: isFollowed ? "Following" : "Follow" }), !!followCount && followCount > 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", color: "black60", children: " " + (0, formatLargeNumber_1.formatLargeNumber)(followCount, 1) }) }))] }));
9
+ const FollowButton = ({ isFollowed, followCount, longestText, loading, ...restProps }) => {
10
+ return ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: isFollowed ? "outline" : "outlineGray", size: "small", longestText: longestText ? longestText : "Following", icon: isFollowed && !loading && (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, { fill: "black60", width: "16px", height: "16px" }), loading: loading, ...restProps, children: !loading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: isFollowed ? "Following" : "Follow" }), !!followCount && followCount > 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", color: "black60", children: " " + (0, formatLargeNumber_1.formatLargeNumber)(followCount, 1) }) }))] })) }));
11
11
  };
12
12
  exports.FollowButton = FollowButton;
@@ -5,5 +5,5 @@ type FollowButtonProps = Omit<ButtonProps, "variant" | "size" | "longestText" |
5
5
  followCount?: number;
6
6
  longestText?: string;
7
7
  };
8
- export declare const FollowButton: ({ isFollowed, followCount, longestText, ...restProps }: FollowButtonProps) => JSX.Element;
8
+ export declare const FollowButton: ({ isFollowed, followCount, longestText, loading, ...restProps }: FollowButtonProps) => JSX.Element;
9
9
  export {};
@@ -6,7 +6,7 @@ const CheckIcon_1 = require("../../svgs/CheckIcon");
6
6
  const formatLargeNumber_1 = require("../../utils/formatLargeNumber");
7
7
  const Button_1 = require("../Button");
8
8
  const Text_1 = require("../Text");
9
- const FollowButton = ({ isFollowed, followCount, longestText, ...restProps }) => {
10
- return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { variant: isFollowed ? "outline" : "outlineGray", size: "small", longestText: longestText ? longestText : "Following", icon: isFollowed && (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, { fill: "black60", width: "16px", height: "16px" }), ...restProps, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: isFollowed ? "Following" : "Follow" }), !!followCount && followCount > 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", color: "black60", children: " " + (0, formatLargeNumber_1.formatLargeNumber)(followCount, 1) }) }))] }));
9
+ const FollowButton = ({ isFollowed, followCount, longestText, loading, ...restProps }) => {
10
+ return ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: isFollowed ? "outline" : "outlineGray", size: "small", longestText: longestText ? longestText : "Following", icon: isFollowed && !loading && (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, { fill: "black60", width: "16px", height: "16px" }), loading: loading, ...restProps, children: !loading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: isFollowed ? "Following" : "Follow" }), !!followCount && followCount > 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", color: "black60", children: " " + (0, formatLargeNumber_1.formatLargeNumber)(followCount, 1) }) }))] })) }));
11
11
  };
12
12
  exports.FollowButton = FollowButton;
@@ -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.6",
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",