@artsy/palette-mobile 24.17.0 → 24.18.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.
|
@@ -34,9 +34,7 @@ var react_native_reanimated_1 = require("react-native-reanimated");
|
|
|
34
34
|
var hooks_1 = require("../../utils/hooks");
|
|
35
35
|
var Flex_1 = require("../Flex");
|
|
36
36
|
var Touchable_1 = require("../Touchable");
|
|
37
|
-
|
|
38
|
-
// includes the status bar and react-native-popover-view must not add StatusBar.currentHeight to it.
|
|
39
|
-
var IS_ANDROID_EDGE_TO_EDGE = react_native_1.Platform.OS === "android" && Number(react_native_1.Platform.Version) >= 35;
|
|
37
|
+
var IS_ANDROID = react_native_1.Platform.OS === "android";
|
|
40
38
|
var Popover = function (_a) {
|
|
41
39
|
var _b = _a.variant, variant = _b === void 0 ? "dark" : _b, children = _a.children, visible = _a.visible, onOpenComplete = _a.onOpenComplete, onPressOutside = _a.onPressOutside, onDismiss = _a.onDismiss, onCloseComplete = _a.onCloseComplete, _c = _a.placement, placement = _c === void 0 ? "top" : _c, title = _a.title, content = _a.content, noCloseIcon = _a.noCloseIcon, rest = __rest(_a, ["variant", "children", "visible", "onOpenComplete", "onPressOutside", "onDismiss", "onCloseComplete", "placement", "title", "content", "noCloseIcon"]);
|
|
42
40
|
var color = (0, hooks_1.useColor)();
|
|
@@ -62,7 +60,7 @@ var Popover = function (_a) {
|
|
|
62
60
|
},
|
|
63
61
|
};
|
|
64
62
|
var style = POPOVER_VARIANTS[variant];
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(react_native_popover_view_1.default, __assign({ backgroundStyle: { opacity: 0.5, backgroundColor: color("mono100") }, popoverStyle: [{ backgroundColor: style.backgroundColor }, style.shadow], from: children, isVisible: visible, onCloseComplete: onCloseComplete, onOpenComplete: onOpenComplete, onRequestClose: onPressOutside, placement: placement, statusBarTranslucent: !
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(react_native_popover_view_1.default, __assign({ backgroundStyle: { opacity: 0.5, backgroundColor: color("mono100") }, popoverStyle: [{ backgroundColor: style.backgroundColor }, style.shadow], from: children, isVisible: visible, onCloseComplete: onCloseComplete, onOpenComplete: onOpenComplete, onRequestClose: onPressOutside, placement: placement, statusBarTranslucent: !IS_ANDROID, arrowSize: { height: 11, width: 22 }, animationConfig: {
|
|
66
64
|
duration: 400,
|
|
67
65
|
easing: react_native_reanimated_1.Easing.out(react_native_reanimated_1.Easing.exp),
|
|
68
66
|
} }, rest, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { backgroundColor: POPOVER_VARIANTS[variant].backgroundColor, p: 1, children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [title ? title : (0, jsx_runtime_1.jsx)(Flex_1.Flex, {}), !noCloseIcon && ((0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { onPress: onDismiss, accessibilityRole: "button", "aria-label": "Dismiss popover", children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { ml: 0.5, children: (0, jsx_runtime_1.jsx)(native_1.CloseIcon, { width: 18, height: 18, fill: style.fill }) }) }))] }), content] }) })));
|