@artsy/palette-mobile 11.0.40 → 11.1.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v11.1.0 (Thu Jun 15 2023)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - feat(screen): Make FloatingHeader more customizable [#116](https://github.com/artsy/palette-mobile/pull/116) ([@damassi](https://github.com/damassi))
6
+
7
+ #### Authors: 1
8
+
9
+ - Christopher Pappas ([@damassi](https://github.com/damassi))
10
+
11
+ ---
12
+
13
+ # v11.0.41 (Thu Jun 15 2023)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - fix(screen): fix centering on non-animated title [#115](https://github.com/artsy/palette-mobile/pull/115) ([@damassi](https://github.com/damassi))
18
+
19
+ #### Authors: 1
20
+
21
+ - Christopher Pappas ([@damassi](https://github.com/damassi))
22
+
23
+ ---
24
+
1
25
  # v11.0.40 (Fri Jun 09 2023)
2
26
 
3
27
  #### 🐛 Bug Fix
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- export interface FloatingHeaderProps {
2
+ import { FlexProps } from "../Flex";
3
+ export interface FloatingHeaderProps extends FlexProps {
3
4
  onBack?: () => void;
4
5
  rightElements?: React.ReactNode;
5
6
  }
6
- export declare const FloatingHeader: ({ onBack, rightElements }: FloatingHeaderProps) => JSX.Element;
7
+ export declare const FloatingHeader: React.FC<FloatingHeaderProps>;
@@ -7,8 +7,8 @@ const constants_1 = require("./constants");
7
7
  const BackButton_1 = require("../BackButton");
8
8
  const Flex_1 = require("../Flex");
9
9
  const Spacer_1 = require("../Spacer");
10
- const FloatingHeader = ({ onBack, rightElements }) => {
10
+ const FloatingHeader = ({ onBack, rightElements, ...flexProps }) => {
11
11
  const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
12
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { position: "absolute", pointerEvents: "box-none", top: insets.top, left: 0, right: 0, zIndex: constants_1.ZINDEX.floatingHeader, px: 1, py: 1, flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(BackButton_1.BackButtonWithBackground, { onPress: onBack }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1 }), rightElements && ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { x: 1 }), rightElements] }))] }));
12
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { position: "absolute", pointerEvents: "box-none", top: insets.top, left: 0, right: 0, zIndex: constants_1.ZINDEX.floatingHeader, px: 1, py: 1, flexDirection: "row", alignItems: "center", ...flexProps, children: [(0, jsx_runtime_1.jsx)(BackButton_1.BackButtonWithBackground, { onPress: onBack }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1 }), rightElements && ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { x: 1 }), rightElements] }))] }));
13
13
  };
14
14
  exports.FloatingHeader = FloatingHeader;
@@ -53,7 +53,7 @@ const Header = ({ animated = false, hideLeftElements, hideRightElements, hideTit
53
53
  return null;
54
54
  }
55
55
  if (!animated) {
56
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, justifySelf: "stretch", ...titleProps, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "sm-display", numberOfLines: 1, children: title }) }));
56
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, flexDirection: "row", children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", width: "100%", ...titleProps, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "sm-display", numberOfLines: 1, children: title }) }) }));
57
57
  }
58
58
  // Show / hide the title to avoid rerenders, which retrigger the animation
59
59
  const display = scrollY < constants_1.NAVBAR_HEIGHT ? "none" : "flex";
@@ -9,7 +9,7 @@ export declare const Screen: import("react").FC<import("./ScreenBase").ScreenBas
9
9
  Body: import("react").FC<import("./Body").BodyProps>;
10
10
  BottomView: import("react").FC<import("./BottomView").BottomViewProps>;
11
11
  FlatList: typeof ScreenFlatList;
12
- FloatingHeader: ({ onBack, rightElements }: import("./FloatingHeader").FloatingHeaderProps) => JSX.Element;
12
+ FloatingHeader: import("react").FC<import("./FloatingHeader").FloatingHeaderProps>;
13
13
  FullWidthDivider: import("react").FC<import("..").BoxProps>;
14
14
  FullWidthItem: import("react").FC<import("..").BoxProps>;
15
15
  Header: import("react").FC<import("./Header").HeaderProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "11.0.40",
3
+ "version": "11.1.0",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "react-native run-android",