@artsy/palette-mobile 17.13.0 → 17.15.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.
- package/dist/elements/Chip/Chip.js +10 -8
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
12
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
13
|
+
const FROM_COLOR = color("mono10");
|
|
14
|
+
const TO_COLOR = color("mono5");
|
|
15
15
|
const handleOnPressIn = () => {
|
|
16
|
-
|
|
16
|
+
setIsPressed(true);
|
|
17
17
|
};
|
|
18
18
|
const handleOnPressOut = () => {
|
|
19
|
-
|
|
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, {
|
|
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.
|
|
3
|
+
"version": "17.15.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",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"react-native-haptic-feedback": "1.14.0",
|
|
131
131
|
"react-native-linear-gradient": "2.6.2",
|
|
132
132
|
"react-native-reanimated": "^3.16.7",
|
|
133
|
-
"react-native-safe-area-context": "4.
|
|
133
|
+
"react-native-safe-area-context": "5.4.1",
|
|
134
134
|
"react-native-svg": "15.10.1",
|
|
135
135
|
"react-test-renderer": "18.3.1",
|
|
136
136
|
"rimraf": "4.1.2",
|