@artsy/palette-mobile 13.0.31 → 13.0.33
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/elements/BorderBox/BorderBox.d.ts +1 -1
- package/dist/elements/Screen/StickySubHeader.d.ts +1 -0
- package/dist/elements/Screen/StickySubHeader.js +20 -9
- package/dist/elements/Screen/hooks/useListenForScreenScroll.d.ts +1 -1
- package/dist/elements/Screen/index.d.ts +2 -2
- package/dist/elements/Separator/Separator.d.ts +1 -1
- package/dist/elements/Separator/Separator.stories.d.ts +1 -1
- package/dist/elements/Separator/ShadowSeparator.d.ts +1 -1
- package/dist/elements/Tabs/Tabs.d.ts +3 -3
- package/package.json +2 -2
|
@@ -9,4 +9,4 @@ export interface BorderBoxProps extends FlexProps, BorderProps, SpaceProps<Spaci
|
|
|
9
9
|
* A `View` or `div` (depending on the platform) that has a common border
|
|
10
10
|
* and padding set by default
|
|
11
11
|
*/
|
|
12
|
-
export declare const BorderBox: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").BoxProps & import("react").RefAttributes<import("react-native").View>>, any, BorderBoxProps, never>;
|
|
12
|
+
export declare const BorderBox: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").BoxProps & import("react").RefAttributes<import("react-native/types").View>>, any, BorderBoxProps, never>;
|
|
@@ -3,22 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StickySubHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const moti_1 = require("moti");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const ScreenScrollContext_1 = require("./ScreenScrollContext");
|
|
7
8
|
const constants_1 = require("./constants");
|
|
9
|
+
const hooks_1 = require("../../utils/hooks");
|
|
8
10
|
const Flex_1 = require("../Flex");
|
|
9
11
|
const Separator_1 = require("../Separator");
|
|
10
12
|
const Text_1 = require("../Text");
|
|
11
|
-
const STICKY_BAR_HEIGHT =
|
|
12
|
-
const StickySubHeader = ({ title, children }) => {
|
|
13
|
+
const STICKY_BAR_HEIGHT = 52;
|
|
14
|
+
const StickySubHeader = ({ title, subTitle, children }) => {
|
|
13
15
|
const { currentScrollY, scrollYOffset = 0 } = (0, ScreenScrollContext_1.useScreenScrollContext)();
|
|
16
|
+
const space = (0, hooks_1.useSpace)();
|
|
17
|
+
const [stickyBarHeight, setStickyHeaderHeight] = (0, react_1.useState)(null);
|
|
14
18
|
const visible = currentScrollY >= constants_1.NAVBAR_HEIGHT + scrollYOffset ? false : true;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const handleLayout = (event) => {
|
|
20
|
+
setStickyHeaderHeight(event.nativeEvent.layout.height);
|
|
21
|
+
};
|
|
22
|
+
// The styles are kept in a variable to make sure they're always in sync with the hidden text component
|
|
23
|
+
const styles = {
|
|
24
|
+
paddingVertical: space(1),
|
|
25
|
+
paddingHorizontal: space(2),
|
|
26
|
+
};
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { children: [stickyBarHeight === null && ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { onLayout: (event) => handleLayout(event), position: "absolute", backgroundColor: "white100", zIndex: -1000, style: styles, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg-display", color: "white100", children: title }), !!subTitle && ((0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", mt: 0.5, color: "white100", children: subTitle }))] })), (0, jsx_runtime_1.jsx)(moti_1.MotiView, { animate: {
|
|
28
|
+
height: visible ? stickyBarHeight || undefined : 0,
|
|
29
|
+
transform: [{ translateY: visible ? 0 : -(stickyBarHeight || STICKY_BAR_HEIGHT) }],
|
|
30
|
+
}, style: styles, transition: {
|
|
20
31
|
type: "timing",
|
|
21
|
-
duration:
|
|
22
|
-
}, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg-display",
|
|
32
|
+
duration: 100,
|
|
33
|
+
}, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { style: { height: stickyBarHeight }, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg-display", children: title }), subTitle && ((0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", mt: 0.5, children: subTitle }))] }) }), children, (0, jsx_runtime_1.jsx)(Separator_1.Separator, { borderColor: "black10" })] }));
|
|
23
34
|
};
|
|
24
35
|
exports.StickySubHeader = StickySubHeader;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const useListenForScreenScroll: () => {
|
|
2
|
-
scrollHandler: (event: import("react-native").NativeSyntheticEvent<import("react-native").NativeScrollEvent>) => void;
|
|
2
|
+
scrollHandler: (event: import("react-native/types").NativeSyntheticEvent<import("react-native/types").NativeScrollEvent>) => void;
|
|
3
3
|
};
|
|
@@ -16,10 +16,10 @@ export declare const Screen: import("react").FC<import("./ScreenBase").ScreenBas
|
|
|
16
16
|
ScreenScrollContextProvider: import("react").FC<{
|
|
17
17
|
children?: import("react").ReactNode;
|
|
18
18
|
}>;
|
|
19
|
-
ScrollView: import("react").FC<import("react-native").ScrollViewProps>;
|
|
19
|
+
ScrollView: import("react").FC<import("react-native/types").ScrollViewProps>;
|
|
20
20
|
StickySubHeader: import("react").FC<import("./StickySubHeader").StickySubHeaderProps>;
|
|
21
21
|
useListenForScreenScroll: () => {
|
|
22
|
-
scrollHandler: (event: import("react-native").NativeSyntheticEvent<import("react-native").NativeScrollEvent>) => void;
|
|
22
|
+
scrollHandler: (event: import("react-native/types").NativeSyntheticEvent<import("react-native/types").NativeScrollEvent>) => void;
|
|
23
23
|
};
|
|
24
24
|
useScreenScrollContext: () => import("./ScreenScrollContext").ScreenScrollContextProps;
|
|
25
25
|
};
|
|
@@ -5,4 +5,4 @@ export interface SeparatorProps extends SpaceProps, WidthProps, BorderProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* A horizontal divider whose width and spacing can be adjusted
|
|
7
7
|
*/
|
|
8
|
-
export declare const Separator: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, SeparatorProps, never>;
|
|
8
|
+
export declare const Separator: import("styled-components").StyledComponent<typeof import("react-native/types").View, import("styled-components").DefaultTheme, SeparatorProps, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, import("./Separator").SeparatorProps, never>;
|
|
4
|
+
component: import("styled-components").StyledComponent<typeof import("react-native/types").View, import("styled-components").DefaultTheme, import("./Separator").SeparatorProps, never>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const Styled: () => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ShadowSeparator: import("styled-components").StyledComponent<typeof import("react-native").View, any, import("./Separator").SeparatorProps, never>;
|
|
1
|
+
export declare const ShadowSeparator: import("styled-components").StyledComponent<typeof import("react-native/types").View, any, import("./Separator").SeparatorProps, never>;
|
|
@@ -11,9 +11,9 @@ export declare const Tabs: import("react").FC<import("./TabsContainer").TabsCont
|
|
|
11
11
|
startMounted?: boolean | undefined;
|
|
12
12
|
children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
13
13
|
}>;
|
|
14
|
-
ScrollView: import("react").FC<import("react-native").ScrollViewProps>;
|
|
15
|
-
SectionList: <T_1>(p: import("react-native").SectionListProps<T_1, import("react-native").DefaultSectionT> & {
|
|
16
|
-
ref?: ((instance: import("react-native").SectionList<T_1, import("react-native").DefaultSectionT> | null) => void) | import("react").RefObject<import("react-native").SectionList<T_1, import("react-native").DefaultSectionT>> | null | undefined;
|
|
14
|
+
ScrollView: import("react").FC<import("react-native/types").ScrollViewProps>;
|
|
15
|
+
SectionList: <T_1>(p: import("react-native/types").SectionListProps<T_1, import("react-native/types").DefaultSectionT> & {
|
|
16
|
+
ref?: ((instance: import("react-native/types").SectionList<T_1, import("react-native/types").DefaultSectionT> | null) => void) | import("react").RefObject<import("react-native/types").SectionList<T_1, import("react-native/types").DefaultSectionT>> | null | undefined;
|
|
17
17
|
}) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
18
18
|
SubTabBar: import("react").FC<{
|
|
19
19
|
children?: import("react").ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette-mobile",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.33",
|
|
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",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"react-native-linear-gradient": "2.6.2",
|
|
125
125
|
"react-native-reanimated": "^3.3.0",
|
|
126
126
|
"react-native-safe-area-context": "4.5.0",
|
|
127
|
-
"react-native-svg": "
|
|
127
|
+
"react-native-svg": "14.1.0",
|
|
128
128
|
"react-test-renderer": "18.2.0",
|
|
129
129
|
"rimraf": "4.1.2",
|
|
130
130
|
"rn-flipper-async-storage-advanced": "1.0.4",
|