@artsy/palette-mobile 11.0.22 → 11.0.23

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v11.0.23 (Thu May 04 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - fix: no more implicit returns in reanimated hooks [#97](https://github.com/artsy/palette-mobile/pull/97) ([@brainbicycle](https://github.com/brainbicycle))
6
+
7
+ #### Authors: 1
8
+
9
+ - Brian Beckerle ([@brainbicycle](https://github.com/brainbicycle))
10
+
11
+ ---
12
+
1
13
  # v11.0.22 (Wed May 03 2023)
2
14
 
3
15
  :tada: This release contains work from a new contributor! :tada:
@@ -45,8 +45,12 @@ const Button = ({ children, disabled: disabledProp, haptic, icon, iconPosition =
45
45
  const [loading, setLoading, loadingV] = useStateWithProp(!!loadingProp);
46
46
  const [pressed, setPressed, pressedV] = useStateWithProp(!!testOnly_pressed);
47
47
  const pressAnimationProgress = (0, react_native_reanimated_1.useSharedValue)(0);
48
- (0, react_native_reanimated_1.useAnimatedReaction)(() => pressedV.value, (pressedVal) => {
49
- pressAnimationProgress.value = (0, react_native_reanimated_1.withTiming)(pressedVal, { duration: ANIMATION_DURATION });
48
+ (0, react_native_reanimated_1.useAnimatedReaction)(() => {
49
+ return pressedV.value;
50
+ }, (pressedVal) => {
51
+ return (pressAnimationProgress.value = (0, react_native_reanimated_1.withTiming)(pressedVal, {
52
+ duration: ANIMATION_DURATION,
53
+ }));
50
54
  });
51
55
  const textStyle = (0, Text_1.useTextStyleForPalette)(size === "small" ? "xs" : "sm");
52
56
  const [longestTextMeasurements, setLongestTextMeasurements] = (0, react_1.useState)({
@@ -34,7 +34,9 @@ const ProgressBar = ({ animationDuration = 200, backgroundColor = "black30", hei
34
34
  const color = (0, useColor_1.useColor)();
35
35
  const width = (0, react_native_reanimated_1.useSharedValue)("0%");
36
36
  const progress = clamp(unclampedProgress, 0, 100);
37
- const progressAnim = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({ width: width.value }));
37
+ const progressAnim = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
38
+ return { width: width.value };
39
+ });
38
40
  const [onCompletionCalled, setOnCompletionCalled] = (0, react_1.useState)(false);
39
41
  (0, react_1.useEffect)(() => {
40
42
  width.value = (0, react_native_reanimated_1.withTiming)(`${progress}%`, { duration: animationDuration });
@@ -42,7 +42,9 @@ const Text_1 = require("../Text");
42
42
  const Skeleton = ({ children }) => {
43
43
  const opacity = (0, react_native_reanimated_1.useSharedValue)(0.5);
44
44
  opacity.value = (0, react_native_reanimated_1.withRepeat)((0, react_native_reanimated_1.withTiming)(1, { duration: 1000, easing: react_native_reanimated_1.Easing.ease }), -1, true);
45
- const fadeLoopAnim = (0, react_native_reanimated_1.useAnimatedStyle)(() => ({ opacity: opacity.value }), []);
45
+ const fadeLoopAnim = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
46
+ return { opacity: opacity.value };
47
+ }, []);
46
48
  return (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: fadeLoopAnim, children: children });
47
49
  };
48
50
  exports.Skeleton = Skeleton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "11.0.22",
3
+ "version": "11.0.23",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "react-native run-android",