@artsy/palette-mobile 19.11.0 → 19.12.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.
|
@@ -24,7 +24,7 @@ var DisplayState;
|
|
|
24
24
|
})(DisplayState || (DisplayState = {}));
|
|
25
25
|
export const Button = ({ children, disabled, haptic, icon, iconPosition = "left", loading, longestText, onPress, size = "large", variant = "fillDark", testOnly_state, testID, textVariant, hitSlop, ...rest }) => {
|
|
26
26
|
const textVariantBySize = size === "small" ? "xs" : "sm";
|
|
27
|
-
const textStyle = useTextStyleForPalette(textVariant ?? textVariantBySize);
|
|
27
|
+
const textStyle = { fontSize: useTextStyleForPalette(textVariant ?? textVariantBySize).fontSize };
|
|
28
28
|
const [innerDisplayState, setInnerDisplayState] = useState(DisplayState.Enabled);
|
|
29
29
|
const [longestTextMeasurements, setLongestTextMeasurements] = useState({
|
|
30
30
|
width: 0,
|
|
@@ -3,13 +3,13 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { Pressable } from "react-native";
|
|
4
4
|
import Haptic from "react-native-haptic-feedback";
|
|
5
5
|
import Animated, { interpolateColor, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming, } from "react-native-reanimated";
|
|
6
|
-
import { useColorsForVariantAndState } from "./colors";
|
|
7
6
|
import { MeasuredView } from "../../elements/MeasuredView";
|
|
8
7
|
import { Box } from "../Box";
|
|
9
8
|
import { Flex } from "../Flex";
|
|
10
9
|
import { Spacer } from "../Spacer";
|
|
11
10
|
import { Spinner } from "../Spinner";
|
|
12
11
|
import { Text, useTextStyleForPalette } from "../Text";
|
|
12
|
+
import { useColorsForVariantAndState } from "./colors";
|
|
13
13
|
const ANIMATION_DURATION = 150;
|
|
14
14
|
export const Button = ({ children, disabled: disabledProp, haptic, icon, iconPosition = "left", loading: loadingProp, block, longestText, onPress, size = "large", variant = "fillDark", testOnly_pressed, testID, hitSlop, ...restProps }) => {
|
|
15
15
|
const [disabled, setDisabled, disabledV] = useStateWithProp(!!disabledProp);
|
|
@@ -23,7 +23,7 @@ export const Button = ({ children, disabled: disabledProp, haptic, icon, iconPos
|
|
|
23
23
|
duration: ANIMATION_DURATION,
|
|
24
24
|
}));
|
|
25
25
|
});
|
|
26
|
-
const textStyle = useTextStyleForPalette(size === "small" ? "xs" : "sm");
|
|
26
|
+
const textStyle = { fontSize: useTextStyleForPalette(size === "small" ? "xs" : "sm").fontSize };
|
|
27
27
|
const [longestTextMeasurements, setLongestTextMeasurements] = useState({
|
|
28
28
|
width: 0,
|
|
29
29
|
height: 0,
|