@artsy/palette-mobile 17.27.0 → 17.28.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import RNPopover from "react-native-popover-view";
|
|
3
|
-
|
|
3
|
+
import { PopoverProps as RNPopoverProps } from "react-native-popover-view/dist/Types";
|
|
4
|
+
interface PopoverProps extends Omit<RNPopoverProps, "placement"> {
|
|
4
5
|
children?: React.ReactElement;
|
|
5
6
|
variant?: PopoverVariant;
|
|
6
7
|
title?: React.ReactElement;
|
|
@@ -13,6 +14,6 @@ interface PopoverProps {
|
|
|
13
14
|
noCloseIcon?: boolean;
|
|
14
15
|
visible?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare const Popover: ({ variant, children, visible, onOpenComplete, onPressOutside, onDismiss, onCloseComplete, placement, title, content, noCloseIcon, }: PopoverProps) => JSX.Element;
|
|
17
|
+
export declare const Popover: ({ variant, children, visible, onOpenComplete, onPressOutside, onDismiss, onCloseComplete, placement, title, content, noCloseIcon, ...rest }: PopoverProps) => JSX.Element;
|
|
17
18
|
export type PopoverVariant = "light" | "dark";
|
|
18
19
|
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Platform, StatusBar } from "react-native";
|
|
3
2
|
import RNPopover from "react-native-popover-view";
|
|
4
3
|
import { Easing } from "react-native-reanimated";
|
|
5
4
|
import { CloseIcon } from "../../svgs";
|
|
6
5
|
import { useColor } from "../../utils/hooks";
|
|
7
6
|
import { Flex } from "../Flex";
|
|
8
7
|
import { Touchable } from "../Touchable";
|
|
9
|
-
export const Popover = ({ variant = "dark", children, visible, onOpenComplete, onPressOutside, onDismiss, onCloseComplete, placement = "top", title, content, noCloseIcon, }) => {
|
|
8
|
+
export const Popover = ({ variant = "dark", children, visible, onOpenComplete, onPressOutside, onDismiss, onCloseComplete, placement = "top", title, content, noCloseIcon, ...rest }) => {
|
|
10
9
|
const color = useColor();
|
|
11
10
|
const DROP_SHADOW = {
|
|
12
11
|
shadowColor: color("mono100"),
|
|
@@ -30,10 +29,8 @@ export const Popover = ({ variant = "dark", children, visible, onOpenComplete, o
|
|
|
30
29
|
},
|
|
31
30
|
};
|
|
32
31
|
const style = POPOVER_VARIANTS[variant];
|
|
33
|
-
return (_jsx(RNPopover, { backgroundStyle: { opacity: 0.5, backgroundColor: color("mono100") }, popoverStyle: [{ backgroundColor: style.backgroundColor }, style.shadow], from: children, isVisible: visible,
|
|
34
|
-
// this is required to make sure that the popover is positioned correctly on android
|
|
35
|
-
verticalOffset: Platform.OS === "android" ? -(StatusBar.currentHeight ?? 0) : 0, onCloseComplete: onCloseComplete, onOpenComplete: onOpenComplete, onRequestClose: onPressOutside, placement: placement, arrowSize: { height: 11, width: 22 }, animationConfig: {
|
|
32
|
+
return (_jsx(RNPopover, { 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, arrowSize: { height: 11, width: 22 }, animationConfig: {
|
|
36
33
|
duration: 400,
|
|
37
34
|
easing: Easing.out(Easing.exp),
|
|
38
|
-
}, children: _jsxs(Flex, { backgroundColor: POPOVER_VARIANTS[variant].backgroundColor, p: 1, children: [_jsxs(Flex, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [title ? title : _jsx(Flex, {}), !noCloseIcon && (_jsx(Touchable, { onPress: onDismiss, accessibilityRole: "button", "aria-label": "Dismiss popover", children: _jsx(Flex, { ml: 0.5, children: _jsx(CloseIcon, { width: 18, height: 18, fill: style.fill }) }) }))] }), content] }) }));
|
|
35
|
+
}, ...rest, children: _jsxs(Flex, { backgroundColor: POPOVER_VARIANTS[variant].backgroundColor, p: 1, children: [_jsxs(Flex, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [title ? title : _jsx(Flex, {}), !noCloseIcon && (_jsx(Touchable, { onPress: onDismiss, accessibilityRole: "button", "aria-label": "Dismiss popover", children: _jsx(Flex, { ml: 0.5, children: _jsx(CloseIcon, { width: 18, height: 18, fill: style.fill }) }) }))] }), content] }) }));
|
|
39
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette-mobile",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.28.0",
|
|
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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-native-blurhash": "^2.1.1",
|
|
46
46
|
"react-native-collapsible-tab-view": "^8.0.1",
|
|
47
47
|
"react-native-pager-view": "6.5.0",
|
|
48
|
-
"react-native-popover-view": "^
|
|
48
|
+
"react-native-popover-view": "^6.1.0",
|
|
49
49
|
"react-spring": "8.0.23",
|
|
50
50
|
"styled-system": "^5.1.5"
|
|
51
51
|
},
|