@artsy/palette-mobile 14.0.7 → 14.0.9
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.
|
@@ -89,7 +89,7 @@ export const Button = ({ children, disabled, haptic, icon, iconPosition = "left"
|
|
|
89
89
|
textDecorationLine: springProps.textDecorationLine,
|
|
90
90
|
},
|
|
91
91
|
textStyle,
|
|
92
|
-
], textAlign: "center", children: children }), iconPosition === "right" && !!icon && (_jsxs(_Fragment, { children: [_jsx(Spacer, { x: 0.5 }), icon] }))] }), displayState === DisplayState.Loading && (_jsx(SpinnerContainer, { children: _jsx(Spinner, { size: size, color: to.loaderColor
|
|
92
|
+
], textAlign: "center", children: children }), iconPosition === "right" && !!icon && (_jsxs(_Fragment, { children: [_jsx(Spacer, { x: 0.5 }), icon] }))] }), displayState === DisplayState.Loading && (_jsx(SpinnerContainer, { children: _jsx(Spinner, { size: size, color: to.loaderColor }) }))] }) }) }) })) }));
|
|
93
93
|
};
|
|
94
94
|
const useStyleForVariantAndState = (variant, state) => {
|
|
95
95
|
const color = useColor();
|
|
@@ -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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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,
|
|
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
|
|
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