@artsy/palette-mobile 11.2.0 → 11.2.2

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,31 @@
1
+ # v11.2.2 (Thu Jun 29 2023)
2
+
3
+ :tada: This release contains work from a new contributor! :tada:
4
+
5
+ Thank you, Sultan Al-Maari ([@MrSltun](https://github.com/MrSltun)), for all your work!
6
+
7
+ #### 🐛 Bug Fix
8
+
9
+ - feat(CX-3748): Add private icon to Entity Header [#119](https://github.com/artsy/palette-mobile/pull/119) ([@MrSltun](https://github.com/MrSltun))
10
+
11
+ #### Authors: 1
12
+
13
+ - Sultan Al-Maari ([@MrSltun](https://github.com/MrSltun))
14
+
15
+ ---
16
+
17
+ # v11.2.1 (Mon Jun 26 2023)
18
+
19
+ #### 🐛 Bug Fix
20
+
21
+ - fix: indicator on android is not visible [#118](https://github.com/artsy/palette-mobile/pull/118) ([@gkartalis](https://github.com/gkartalis))
22
+
23
+ #### Authors: 1
24
+
25
+ - George Kartalis ([@gkartalis](https://github.com/gkartalis))
26
+
27
+ ---
28
+
1
29
  # v11.2.0 (Thu Jun 15 2023)
2
30
 
3
31
  #### 🚀 Enhancement
@@ -1,8 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { AvatarSize } from "../Avatar";
3
3
  import { FlexProps } from "../Flex";
4
- interface EntityHeaderProps extends FlexProps {
4
+ export interface EntityHeaderProps extends FlexProps {
5
5
  avatarSize?: AvatarSize;
6
+ /**
7
+ * @deprecated Use `RightButton` instead
8
+ */
6
9
  FollowButton?: JSX.Element;
7
10
  RightButton?: JSX.Element;
8
11
  imageUrl?: string;
@@ -10,6 +13,6 @@ interface EntityHeaderProps extends FlexProps {
10
13
  meta?: string | JSX.Element;
11
14
  name: string;
12
15
  smallVariant?: boolean;
16
+ displayPrivateIcon?: boolean;
13
17
  }
14
- export declare const EntityHeader: ({ avatarSize, FollowButton, RightButton, imageUrl, initials, meta, name, smallVariant, ...restProps }: EntityHeaderProps) => JSX.Element;
15
- export {};
18
+ export declare const EntityHeader: ({ avatarSize, FollowButton, RightButton, imageUrl, initials, meta, name, smallVariant, displayPrivateIcon, ...restProps }: EntityHeaderProps) => JSX.Element;
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EntityHeader = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const svgs_1 = require("../../svgs");
6
7
  const text_1 = require("../../utils/text");
7
8
  const Avatar_1 = require("../Avatar");
8
9
  const Flex_1 = require("../Flex");
9
10
  const Text_1 = require("../Text");
10
- const EntityHeader = ({ avatarSize = "xs", FollowButton, RightButton, imageUrl, initials, meta, name, smallVariant = false, ...restProps }) => {
11
+ const EntityHeader = ({ avatarSize = "xs", FollowButton, RightButton, imageUrl, initials, meta, name, smallVariant = false, displayPrivateIcon, ...restProps }) => {
11
12
  const rightButton = (RightButton || FollowButton) && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { ml: smallVariant ? 0.5 : 1, flexDirection: "row", alignItems: "center", justifyContent: "flex-end", children: RightButton || FollowButton }));
12
- const headerName = ((0, jsx_runtime_1.jsx)(Text_1.Text, { ellipsizeMode: "tail", numberOfLines: 1, variant: "sm", style: { flexShrink: 1 }, children: name }));
13
+ const headerName = ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { ellipsizeMode: "tail", numberOfLines: 1, variant: "sm", lineHeight: "18px", style: { flexShrink: 1 }, children: name }), displayPrivateIcon && (0, jsx_runtime_1.jsx)(svgs_1.LockIcon, { ml: "2px" })] }));
13
14
  const headerMeta = (0, react_1.useMemo)(() => {
14
15
  if (meta) {
15
16
  if ((0, react_1.isValidElement)(meta)) {
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: ({ avatarSize, FollowButton, RightButton, imageUrl, initials, meta, name, smallVariant, displayPrivateIcon, ...restProps }: import("./EntityHeader").EntityHeaderProps) => JSX.Element;
5
+ };
6
+ export default _default;
7
+ export declare const Initials: () => JSX.Element;
8
+ export declare const Image: () => JSX.Element;
9
+ export declare const VariantSmall: () => JSX.Element;
10
+ export declare const WithRightButton: () => JSX.Element;
11
+ export declare const WithPrivateIcon: () => JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithPrivateIcon = exports.WithRightButton = exports.VariantSmall = exports.Image = exports.Initials = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const EntityHeader_1 = require("./EntityHeader");
6
+ const Box_1 = require("../Box");
7
+ const Button_1 = require("../Button");
8
+ const Text_1 = require("../Text");
9
+ exports.default = {
10
+ title: "EntityHeader",
11
+ component: EntityHeader_1.EntityHeader,
12
+ };
13
+ const avatarSizes = ["xxs", "xs", "sm", "md"];
14
+ const Initials = () => {
15
+ return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", children: "Avatar Sizes" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { mx: 2, children: avatarSizes.map((size) => ((0, jsx_runtime_1.jsxs)(Box_1.Box, { mb: 1, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: size }), (0, jsx_runtime_1.jsx)(EntityHeader_1.EntityHeader, { name: "Artist Name", initials: "AN", meta: "Meta stuff", avatarSize: size })] }))) })] }));
16
+ };
17
+ exports.Initials = Initials;
18
+ const Image = () => {
19
+ return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", children: "Avatar Sizes" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { mx: 2, children: avatarSizes.map((size) => ((0, jsx_runtime_1.jsxs)(Box_1.Box, { mb: 1, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: size }), (0, jsx_runtime_1.jsx)(EntityHeader_1.EntityHeader, { imageUrl: "https://picsum.photos/200/200", name: "Artist Name", initials: "AN", meta: "Meta stuff", avatarSize: size })] }))) })] }));
20
+ };
21
+ exports.Image = Image;
22
+ const VariantSmall = () => {
23
+ return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", children: "Avatar Sizes" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { mx: 2, children: avatarSizes.map((size) => ((0, jsx_runtime_1.jsxs)(Box_1.Box, { mb: 1, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: size }), (0, jsx_runtime_1.jsx)(EntityHeader_1.EntityHeader, { imageUrl: "https://picsum.photos/200/200", name: "Artist Name", initials: "AN", meta: "Meta stuff", avatarSize: size, smallVariant: true })] }))) })] }));
24
+ };
25
+ exports.VariantSmall = VariantSmall;
26
+ const WithRightButton = () => {
27
+ return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", children: "Avatar Sizes" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { mx: 2, children: avatarSizes.map((size) => ((0, jsx_runtime_1.jsxs)(Box_1.Box, { mb: 1, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: size }), (0, jsx_runtime_1.jsx)(EntityHeader_1.EntityHeader, { imageUrl: "https://picsum.photos/200/200", name: "Artist Name", initials: "AN", meta: "Meta stuff", avatarSize: size, RightButton: (0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", children: "Right Button" }) })] }))) })] }));
28
+ };
29
+ exports.WithRightButton = WithRightButton;
30
+ const WithPrivateIcon = () => {
31
+ return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "md", children: "Avatar Sizes" }), (0, jsx_runtime_1.jsx)(Box_1.Box, { mx: 2, children: avatarSizes.map((size) => ((0, jsx_runtime_1.jsxs)(Box_1.Box, { mb: 1, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: size }), (0, jsx_runtime_1.jsx)(EntityHeader_1.EntityHeader, { imageUrl: "https://picsum.photos/200/200", name: "Artist Name", initials: "AN", meta: "Meta stuff", avatarSize: size, displayPrivateIcon: true })] }))) })] }));
32
+ };
33
+ exports.WithPrivateIcon = WithPrivateIcon;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TabsContainer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_native_1 = require("react-native");
5
6
  const react_native_collapsible_tab_view_1 = require("react-native-collapsible-tab-view");
6
7
  const useColor_1 = require("../../utils/hooks/useColor");
7
8
  const useSpace_1 = require("../../utils/hooks/useSpace");
@@ -11,6 +12,7 @@ const TAB_BAR_HEIGHT = 50;
11
12
  const TabsContainer = ({ children, indicators = [], initialTabName, renderHeader, tabScrollEnabled = false, onTabPress, ...tabContainerProps }) => {
12
13
  const space = (0, useSpace_1.useSpace)();
13
14
  const color = (0, useColor_1.useColor)();
15
+ const isIOS = react_native_1.Platform.OS === "ios";
14
16
  return ((0, jsx_runtime_1.jsx)(react_native_collapsible_tab_view_1.Tabs.Container, { ...tabContainerProps, renderHeader: renderHeader, headerContainerStyle: {
15
17
  shadowOpacity: 0,
16
18
  shadowRadius: 0,
@@ -34,7 +36,8 @@ const TabsContainer = ({ children, indicators = [], initialTabName, renderHeader
34
36
  }, contentContainerStyle: {}, activeColor: color("onBackground"), inactiveColor: color("onBackgroundMedium"), labelStyle: { marginTop: 0 }, indicatorStyle: {
35
37
  backgroundColor: color("onBackground"),
36
38
  height: 1,
37
- bottom: -1,
39
+ // on android this line breaks the active indicator and it is not visible
40
+ ...(isIOS && { bottom: -1 }),
38
41
  } }) }));
39
42
  }, children: children }));
40
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "react-native run-android",