@artsy/palette-mobile 13.2.35 → 13.2.37

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.
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ export interface ChipProps {
3
+ title: string;
4
+ subtitle?: string;
5
+ image?: string;
6
+ onPress?: () => void;
7
+ }
8
+ export declare const Chip: FC<ChipProps>;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAnimationState, View } from "moti";
3
+ import { useColor, useSpace } from "../../utils/hooks";
4
+ import { Flex } from "../Flex";
5
+ import { Image } from "../Image";
6
+ import { Text } from "../Text";
7
+ import { Touchable } from "../Touchable";
8
+ export const Chip = ({ image, title, subtitle, onPress }) => {
9
+ const color = useColor();
10
+ const space = useSpace();
11
+ const animatedState = useAnimationState({
12
+ from: { backgroundColor: color("black10") },
13
+ to: { backgroundColor: color("black5") },
14
+ });
15
+ const handleOnPressIn = () => {
16
+ animatedState.transitionTo("from");
17
+ };
18
+ const handleOnPressOut = () => {
19
+ animatedState.transitionTo("to");
20
+ };
21
+ return (_jsx(Touchable, { 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: {
22
+ flex: 1,
23
+ padding: space(1),
24
+ justifyContent: "center",
25
+ }, children: [!!subtitle && (_jsx(Text, { variant: "xs", color: "black60", selectable: false, children: subtitle })), _jsx(Text, { variant: "sm-display", selectable: false, children: title })] })] }) }));
26
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: import("react").FC<import("./Chip").ChipProps>;
5
+ };
6
+ export default _default;
7
+ export declare const Variations: () => JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Alert } from "react-native";
3
+ import { Chip } from "./Chip";
4
+ import { Flex } from "../Flex";
5
+ export default {
6
+ title: "Chip",
7
+ component: Chip,
8
+ };
9
+ export const Variations = () => {
10
+ return (_jsxs(Flex, { p: 2, justifyContent: "center", alignItems: "center", gap: 20, children: [_jsx(Chip, { title: "Only title" }), _jsx(Chip, { title: "Title and subtitle", subtitle: "Subtitle" }), _jsx(Chip, { title: "Title and image", image: "https://d32dm0rphc51dk.cloudfront.net/A983VUIZusVBKy420xP3ow/normalized.jpg" }), _jsx(Chip, { title: "Title, subtitle and image", subtitle: "Cow image", image: "https://d32dm0rphc51dk.cloudfront.net/A983VUIZusVBKy420xP3ow/normalized.jpg" }), _jsx(Chip, { title: "Press me", subtitle: "Pressing alerts something", onPress: () => Alert.alert("Pressed") })] }));
11
+ };
@@ -0,0 +1 @@
1
+ export * from "./Chip";
@@ -0,0 +1 @@
1
+ export * from "./Chip";
@@ -7,6 +7,7 @@ export * from "./BorderBox";
7
7
  export * from "./Box";
8
8
  export * from "./Button";
9
9
  export * from "./Checkbox";
10
+ export * from "./Chip";
10
11
  export * from "./ClassTheme";
11
12
  export * from "./Collapse";
12
13
  export * from "./CollapsibleMenuItem";
@@ -7,6 +7,7 @@ export * from "./BorderBox";
7
7
  export * from "./Box";
8
8
  export * from "./Button";
9
9
  export * from "./Checkbox";
10
+ export * from "./Chip";
10
11
  export * from "./ClassTheme";
11
12
  export * from "./Collapse";
12
13
  export * from "./CollapsibleMenuItem";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "13.2.35",
3
+ "version": "13.2.37",
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",
@@ -117,6 +117,7 @@
117
117
  "metro-react-native-babel-preset": "0.76.8",
118
118
  "nodemon": "^2.0.20",
119
119
  "prettier": "^2.8.8",
120
+ "pull-lock": "1.0.0",
120
121
  "react": "18.2.0",
121
122
  "react-dom": "18.2.0",
122
123
  "react-native": "0.73.9",
@@ -153,6 +154,10 @@
153
154
  },
154
155
  "author": "Pavlos Vinieratos <pvinis@gmail.com>",
155
156
  "license": "MIT",
157
+ "pull-lock": {
158
+ "ios/Podfile.lock": "echo \"🚨 New Podfile.lock detected!, you might need to run yarn install:all\" 🚨",
159
+ "yarn.lock": "yarn install"
160
+ },
156
161
  "lint-staged": {
157
162
  "*.@(md)": [
158
163
  "yarn prettier-write"