@artsy/palette-mobile 17.13.0 → 17.14.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,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useAnimationState, View } from "moti";
2
+ import { View } from "moti";
3
+ import { useState } from "react";
3
4
  import { useColor, useSpace } from "../../utils/hooks";
4
5
  import { Flex } from "../Flex";
5
6
  import { Image } from "../Image";
@@ -8,17 +9,18 @@ import { Touchable } from "../Touchable";
8
9
  export const Chip = ({ image, title, subtitle, onPress }) => {
9
10
  const color = useColor();
10
11
  const space = useSpace();
11
- const animatedState = useAnimationState({
12
- from: { backgroundColor: color("mono10") },
13
- to: { backgroundColor: color("mono5") },
14
- });
12
+ const [isPressed, setIsPressed] = useState(false);
13
+ const FROM_COLOR = color("mono10");
14
+ const TO_COLOR = color("mono5");
15
15
  const handleOnPressIn = () => {
16
- animatedState.transitionTo("from");
16
+ setIsPressed(true);
17
17
  };
18
18
  const handleOnPressOut = () => {
19
- animatedState.transitionTo("to");
19
+ setIsPressed(false);
20
20
  };
21
- return (_jsx(Touchable, { accessibilityRole: "button", accessibilityLabel: title, onPress: onPress, onPressIn: handleOnPressIn, onPressOut: handleOnPressOut, noFeedback: true, children: _jsxs(Flex, { flexDirection: "row", minWidth: 200, height: 70, overflow: "hidden", borderRadius: 5, children: [!!image && _jsx(Image, { src: image, width: 70, height: 70 }), _jsxs(View, { state: animatedState, style: {
21
+ return (_jsx(Touchable, { accessibilityRole: "button", accessibilityLabel: title, onPress: onPress, onPressIn: handleOnPressIn, onPressOut: handleOnPressOut, noFeedback: true, children: _jsxs(Flex, { flexDirection: "row", minWidth: 200, height: 70, overflow: "hidden", borderRadius: 5, children: [!!image && _jsx(Image, { src: image, width: 70, height: 70 }), _jsxs(View, { animate: {
22
+ backgroundColor: !isPressed ? TO_COLOR : FROM_COLOR,
23
+ }, style: {
22
24
  flex: 1,
23
25
  padding: space(1),
24
26
  justifyContent: "center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "17.13.0",
3
+ "version": "17.14.0",
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 --terminal terminal",