@artsy/palette-mobile 13.0.33 → 13.0.34
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/constants.d.ts
CHANGED
|
@@ -7,3 +7,8 @@ export declare const DEFAULT_HIT_SLOP: {
|
|
|
7
7
|
left: number;
|
|
8
8
|
right: number;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Default active opacity for elements that use Palette's <Touchable />
|
|
12
|
+
*/
|
|
13
|
+
export declare let DEFAULT_ACTIVE_OPACITY: number;
|
|
14
|
+
export declare const setGlobalActiveOpacity: (opacity: number) => void;
|
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_HIT_SLOP = void 0;
|
|
3
|
+
exports.setGlobalActiveOpacity = exports.DEFAULT_ACTIVE_OPACITY = exports.DEFAULT_HIT_SLOP = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Touch area box for UI elements
|
|
6
6
|
*/
|
|
7
7
|
exports.DEFAULT_HIT_SLOP = { top: 20, bottom: 20, left: 20, right: 20 };
|
|
8
|
+
/**
|
|
9
|
+
* Default active opacity for elements that use Palette's <Touchable />
|
|
10
|
+
*/
|
|
11
|
+
exports.DEFAULT_ACTIVE_OPACITY = 0.8;
|
|
12
|
+
// Set things globally
|
|
13
|
+
const setGlobalActiveOpacity = (opacity) => {
|
|
14
|
+
exports.DEFAULT_ACTIVE_OPACITY = opacity;
|
|
15
|
+
};
|
|
16
|
+
exports.setGlobalActiveOpacity = setGlobalActiveOpacity;
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const react_native_1 = require("react-native");
|
|
10
10
|
const react_native_haptic_feedback_1 = __importDefault(require("react-native-haptic-feedback"));
|
|
11
|
+
const constants_1 = require("../../constants");
|
|
11
12
|
const useColor_1 = require("../../utils/hooks/useColor");
|
|
12
13
|
const Flex_1 = require("../Flex");
|
|
13
14
|
/**
|
|
@@ -28,6 +29,6 @@ const Touchable = ({ children, flex, haptic, noFeedback, onPress, underlayColor,
|
|
|
28
29
|
}
|
|
29
30
|
onPress(evt);
|
|
30
31
|
};
|
|
31
|
-
return noFeedback ? ((0, jsx_runtime_1.jsx)(react_native_1.TouchableWithoutFeedback, { ...props, onPress: onPressWrapped, children: inner })) : ((0, jsx_runtime_1.jsx)(react_native_1.TouchableHighlight, { underlayColor: underlayColor ?? "transparent", activeOpacity:
|
|
32
|
+
return noFeedback ? ((0, jsx_runtime_1.jsx)(react_native_1.TouchableWithoutFeedback, { ...props, onPress: onPressWrapped, children: inner })) : ((0, jsx_runtime_1.jsx)(react_native_1.TouchableHighlight, { underlayColor: underlayColor ?? "transparent", activeOpacity: constants_1.DEFAULT_ACTIVE_OPACITY, ...props, onPress: onPressWrapped, children: inner }));
|
|
32
33
|
};
|
|
33
34
|
exports.Touchable = Touchable;
|