@artsy/palette-mobile 14.0.8 → 14.0.10

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,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import isArray from "lodash/isArray";
3
3
  import isString from "lodash/isString";
4
- import { useCallback, useRef, useState } from "react";
4
+ import { useCallback, useMemo, useRef, useState } from "react";
5
5
  import { TextInput } from "react-native";
6
6
  import { DEFAULT_HIT_SLOP } from "../../constants";
7
7
  import { ArrowLeftIcon, MagnifyingGlassIcon } from "../../svgs";
@@ -41,12 +41,15 @@ export const RoundSearchInput = ({ value, placeholder, onLeftIconPress, ...rest
41
41
  if (value && __DEV__) {
42
42
  throw new Error("Avoid controlled inputs and use the defaultValue prop instead");
43
43
  }
44
- const inputStyles = {
45
- flex: 1,
46
- height: SEARCH_INPUT_CONTAINER_HEIGHT,
47
- fontFamily: theme.theme.fonts.sans.regular,
48
- fontSize: 16,
49
- };
44
+ const inputStyles = useMemo(() => {
45
+ return {
46
+ flex: 1,
47
+ height: SEARCH_INPUT_CONTAINER_HEIGHT,
48
+ fontFamily: theme.theme.fonts.sans.regular,
49
+ fontSize: 16,
50
+ lineHeight: 20,
51
+ };
52
+ }, []);
50
53
  const renderAndroidPlaceholderMeasuringHack = useCallback(() => {
51
54
  if (!isArray(placeholder)) {
52
55
  return null;
@@ -84,13 +87,7 @@ export const RoundSearchInput = ({ value, placeholder, onLeftIconPress, ...rest
84
87
  ref.current?.blur();
85
88
  setIsFocused(false);
86
89
  onLeftIconPress?.();
87
- }, hitSlop: DEFAULT_HIT_SLOP, haptic: "impactLight", children: !isFocused ? (_jsx(MagnifyingGlassIcon, { fill: "black60", width: ICON_SIZE, height: ICON_SIZE, style: {
88
- transform: [
89
- {
90
- scaleX: -1,
91
- },
92
- ],
93
- } })) : (_jsx(ArrowLeftIcon, { long: true, fill: "black60", width: ICON_SIZE, height: ICON_SIZE })) }) })] }));
90
+ }, hitSlop: DEFAULT_HIT_SLOP, haptic: "impactLight", children: !isFocused ? (_jsx(MagnifyingGlassIcon, { fill: "black60", width: ICON_SIZE, height: ICON_SIZE })) : (_jsx(ArrowLeftIcon, { long: true, fill: "black60", width: ICON_SIZE, height: ICON_SIZE })) }) })] }));
94
91
  };
95
92
  export const SEARCH_INPUT_CONTAINER_HEIGHT = 48;
96
93
  const CONTAINER_HORIZONTAL_PADDING = 16;
@@ -3,5 +3,5 @@ import { Icon, Path } from "./Icon";
3
3
  import { useColor } from "../utils/hooks";
4
4
  export const MagnifyingGlassIcon = ({ fill, ...restProps }) => {
5
5
  const color = useColor();
6
- return (_jsx(Icon, { ...restProps, viewBox: "0 0 18 18", children: _jsx(Path, { d: "M11.5 3a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7zm0-1A4.5 4.5 0 1 0 16 6.5 4.49 4.49 0 0 0 11.5 2zM9.442 9.525l-.88-.88L2.06 15.06l.88.88 6.502-6.415z", fill: color(fill ?? "onBackgroundHigh"), fillRule: "nonzero" }) }));
6
+ return (_jsx(Icon, { ...restProps, viewBox: "0 0 24 24", children: _jsx(Path, { fillRule: "evenodd", clipRule: "evenodd", fill: color(fill ?? "onBackgroundHigh"), d: "M19.6 21L13.3 14.7C12.8 15.1 12.225 15.4167 11.575 15.65C10.925 15.8833 10.2333 16 9.5 16C7.68333 16 6.14583 15.3708 4.8875 14.1125C3.62917 12.8542 3 11.3167 3 9.5C3 7.68333 3.62917 6.14583 4.8875 4.8875C6.14583 3.62917 7.68333 3 9.5 3C11.3167 3 12.8542 3.62917 14.1125 4.8875C15.3708 6.14583 16 7.68333 16 9.5C16 10.2333 15.8833 10.925 15.65 11.575C15.4167 12.225 15.1 12.8 14.7 13.3L21 19.6L19.6 21ZM9.5 14C10.75 14 11.8125 13.5625 12.6875 12.6875C13.5625 11.8125 14 10.75 14 9.5C14 8.25 13.5625 7.1875 12.6875 6.3125C11.8125 5.4375 10.75 5 9.5 5C8.25 5 7.1875 5.4375 6.3125 6.3125C5.4375 7.1875 5 8.25 5 9.5C5 10.75 5.4375 11.8125 6.3125 12.6875C7.1875 13.5625 8.25 14 9.5 14Z" }) }));
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "14.0.8",
3
+ "version": "14.0.10",
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",
@@ -124,7 +124,7 @@
124
124
  "react-native-device-info": "10.3.0",
125
125
  "react-native-haptic-feedback": "1.14.0",
126
126
  "react-native-linear-gradient": "2.6.2",
127
- "react-native-reanimated": "3.16.1",
127
+ "react-native-reanimated": "3.16.3",
128
128
  "react-native-safe-area-context": "4.11.1",
129
129
  "react-native-svg": "14.1.0",
130
130
  "react-test-renderer": "18.3.1",