@artsy/palette-mobile 13.0.26 → 13.0.28
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 +24 -0
- package/dist/elements/Banner/Banner.d.ts +28 -8
- package/dist/elements/Banner/Banner.js +25 -4
- package/dist/elements/Banner/Banner.stories.d.ts +7 -0
- package/dist/elements/Banner/Banner.stories.js +14 -0
- package/dist/svgs/FullWidthIcon.d.ts +3 -0
- package/dist/svgs/FullWidthIcon.js +11 -0
- package/dist/svgs/GridIcon.d.ts +3 -0
- package/dist/svgs/GridIcon.js +11 -0
- package/dist/svgs/index.d.ts +2 -0
- package/dist/svgs/index.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v13.0.28 (Fri Jan 12 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- feat: Update Banner Component [#172](https://github.com/artsy/palette-mobile/pull/172) ([@MrSltun](https://github.com/MrSltun))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Sultan Al-Maari ([@MrSltun](https://github.com/MrSltun))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v13.0.27 (Mon Dec 11 2023)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- feat: add grid and list icons [#171](https://github.com/artsy/palette-mobile/pull/171) ([@MounirDhahri](https://github.com/MounirDhahri))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Mounir Dhahri ([@MounirDhahri](https://github.com/MounirDhahri))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v13.0.26 (Fri Nov 24 2023)
|
|
2
26
|
|
|
3
27
|
#### 🐛 Bug Fix
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TextProps } from "react-native";
|
|
3
2
|
import { FlexProps } from "styled-system";
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
export type BannerVariant = keyof typeof BANNER_VARIANTS;
|
|
4
|
+
export interface BannerProps extends FlexProps {
|
|
6
5
|
text: string;
|
|
7
6
|
onClose?: () => void;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
titleStyle?: TextProps;
|
|
11
|
-
bodyTextStyle?: TextProps;
|
|
7
|
+
dismissable?: boolean;
|
|
8
|
+
variant?: BannerVariant;
|
|
12
9
|
}
|
|
13
|
-
export declare const Banner: ({
|
|
10
|
+
export declare const Banner: ({ text, onClose, dismissable, variant, ...restProps }: BannerProps) => JSX.Element;
|
|
11
|
+
declare const BANNER_VARIANTS: {
|
|
12
|
+
defaultLight: {
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
defaultDark: {
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
success: {
|
|
21
|
+
backgroundColor: string;
|
|
22
|
+
color: string;
|
|
23
|
+
};
|
|
24
|
+
error: {
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
color: string;
|
|
27
|
+
};
|
|
28
|
+
brand: {
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
color: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -4,12 +4,11 @@ exports.Banner = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
7
8
|
const svgs_1 = require("../../svgs");
|
|
8
|
-
const hooks_1 = require("../../utils/hooks");
|
|
9
9
|
const Flex_1 = require("../Flex");
|
|
10
10
|
const Text_1 = require("../Text");
|
|
11
|
-
const Banner = ({
|
|
12
|
-
const color = (0, hooks_1.useColor)();
|
|
11
|
+
const Banner = ({ text, onClose, dismissable = false, variant = "defaultLight", ...restProps }) => {
|
|
13
12
|
const [tempHeight, setTempHeight] = (0, react_1.useState)(undefined);
|
|
14
13
|
const scaleYAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
15
14
|
const handleClose = () => {
|
|
@@ -33,6 +32,28 @@ const Banner = ({ title, text, onClose, showCloseButton = false, containerStyle,
|
|
|
33
32
|
}),
|
|
34
33
|
},
|
|
35
34
|
],
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { backgroundColor:
|
|
35
|
+
}, children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { backgroundColor: BANNER_VARIANTS[variant].backgroundColor, ...restProps, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { px: 2, py: 1, flexDirection: "row", alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, alignItems: "center", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { textAlign: "center", variant: "xs", color: BANNER_VARIANTS[variant].color, children: text }) }), !!dismissable && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { children: (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { testID: "banner-close-button", onPress: handleClose, hitSlop: constants_1.DEFAULT_HIT_SLOP, children: (0, jsx_runtime_1.jsx)(svgs_1.CloseIcon, { fill: BANNER_VARIANTS[variant].color }) }) }))] }) }) }));
|
|
37
36
|
};
|
|
38
37
|
exports.Banner = Banner;
|
|
38
|
+
const BANNER_VARIANTS = {
|
|
39
|
+
defaultLight: {
|
|
40
|
+
backgroundColor: "black10",
|
|
41
|
+
color: "black100",
|
|
42
|
+
},
|
|
43
|
+
defaultDark: {
|
|
44
|
+
backgroundColor: "black100",
|
|
45
|
+
color: "white100",
|
|
46
|
+
},
|
|
47
|
+
success: {
|
|
48
|
+
backgroundColor: "green100",
|
|
49
|
+
color: "white100",
|
|
50
|
+
},
|
|
51
|
+
error: {
|
|
52
|
+
backgroundColor: "red100",
|
|
53
|
+
color: "white100",
|
|
54
|
+
},
|
|
55
|
+
brand: {
|
|
56
|
+
backgroundColor: "brand",
|
|
57
|
+
color: "white100",
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ text, onClose, dismissable, variant, ...restProps }: import("./Banner").BannerProps) => JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const States: () => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.States = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Banner_1 = require("./Banner");
|
|
6
|
+
const helpers_1 = require("../../storybook/helpers");
|
|
7
|
+
exports.default = {
|
|
8
|
+
title: "Banner",
|
|
9
|
+
component: Banner_1.Banner,
|
|
10
|
+
};
|
|
11
|
+
const States = () => {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(helpers_1.List, { contentContainerStyle: { alignItems: undefined }, children: [(0, jsx_runtime_1.jsx)(Banner_1.Banner, { text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Reiciendis quae\n natus assumenda distinctio, voluptatum magni. autem sunt." }), (0, jsx_runtime_1.jsx)(Banner_1.Banner, { dismissable: true, text: "Default Light", variant: "defaultLight" }), (0, jsx_runtime_1.jsx)(Banner_1.Banner, { dismissable: true, text: "Default Dark", variant: "defaultDark" }), (0, jsx_runtime_1.jsx)(Banner_1.Banner, { dismissable: true, text: "Success", variant: "success" }), (0, jsx_runtime_1.jsx)(Banner_1.Banner, { dismissable: true, text: "Error", variant: "error" }), (0, jsx_runtime_1.jsx)(Banner_1.Banner, { dismissable: true, text: "Brand", variant: "brand" })] }));
|
|
13
|
+
};
|
|
14
|
+
exports.States = States;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FullWidthIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Icon_1 = require("./Icon");
|
|
6
|
+
const hooks_1 = require("../utils/hooks");
|
|
7
|
+
const FullWidthIcon = ({ fill, ...restProps }) => {
|
|
8
|
+
const color = (0, hooks_1.useColor)();
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { ...restProps, viewBox: "0 0 28 28", children: (0, jsx_runtime_1.jsx)(Icon_1.Path, { d: "M5.7779 3C5.34835 3 5.00012 3.34822 5.00012 3.77778V16.2222C5.00012 16.6518 5.34835 17 5.7779 17H21.3335C21.763 17 22.1112 16.6518 22.1112 16.2222V3.77778C22.1112 3.34822 21.763 3 21.3335 3H5.7779ZM6.55568 15.4444V4.55556H20.5557V15.4444H6.55568ZM5.7779 18.7778C5.34835 18.7778 5.00012 19.126 5.00012 19.5555V24H6.55568V20.3333H20.5557V24H22.1112V19.5555C22.1112 19.126 21.763 18.7778 21.3335 18.7778H5.7779Z", fill: color(fill), fillRule: "evenodd", clipRule: "evenodd" }) }));
|
|
10
|
+
};
|
|
11
|
+
exports.FullWidthIcon = FullWidthIcon;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Icon_1 = require("./Icon");
|
|
6
|
+
const hooks_1 = require("../utils/hooks");
|
|
7
|
+
const GridIcon = ({ fill, ...restProps }) => {
|
|
8
|
+
const color = (0, hooks_1.useColor)();
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { ...restProps, viewBox: "0 0 28 28", children: (0, jsx_runtime_1.jsx)(Icon_1.Path, { d: "M5.4444 4.66669C5.01485 4.66669 4.66663 5.01491 4.66663 5.44446V12.2889C4.66663 12.7185 5.01485 13.0667 5.4444 13.0667H12.2888C12.7184 13.0667 13.0666 12.7185 13.0666 12.2889V5.44446C13.0666 5.01491 12.7184 4.66669 12.2888 4.66669H5.4444ZM6.22218 11.5111V6.22224H11.5111V11.5111H6.22218ZM5.44431 14.9332C5.01476 14.9332 4.66653 15.2814 4.66653 15.7109V22.5554C4.66653 22.9849 5.01476 23.3332 5.44431 23.3332H12.2888C12.7183 23.3332 13.0665 22.9849 13.0665 22.5554V15.7109C13.0665 15.2814 12.7183 14.9332 12.2888 14.9332H5.44431ZM6.22209 21.7776V16.4887H11.511V21.7776H6.22209ZM14.9333 5.44446C14.9333 5.01491 15.2816 4.66669 15.7111 4.66669H22.5556C22.9851 4.66669 23.3333 5.01491 23.3333 5.44446V12.2889C23.3333 12.7185 22.9851 13.0667 22.5556 13.0667H15.7111C15.2816 13.0667 14.9333 12.7185 14.9333 12.2889V5.44446ZM16.4889 6.22224V11.5111H21.7778V6.22224H16.4889ZM15.7111 14.9332C15.2816 14.9332 14.9333 15.2814 14.9333 15.7109V22.5554C14.9333 22.9849 15.2816 23.3332 15.7111 23.3332H22.5556C22.9851 23.3332 23.3333 22.9849 23.3333 22.5554V15.7109C23.3333 15.2814 22.9851 14.9332 22.5556 14.9332H15.7111ZM16.4889 21.7776V16.4887H21.7778V21.7776H16.4889Z", fill: color(fill), fillRule: "evenodd", clipRule: "evenodd" }) }));
|
|
10
|
+
};
|
|
11
|
+
exports.GridIcon = GridIcon;
|
package/dist/svgs/index.d.ts
CHANGED
|
@@ -51,8 +51,10 @@ export * from "./EyeOpenedIcon";
|
|
|
51
51
|
export * from "./FacebookIcon";
|
|
52
52
|
export * from "./FairIcon";
|
|
53
53
|
export * from "./FilterIcon";
|
|
54
|
+
export * from "./FullWidthIcon";
|
|
54
55
|
export * from "./GenomeIcon";
|
|
55
56
|
export * from "./GraphIcon";
|
|
57
|
+
export * from "./GridIcon";
|
|
56
58
|
export * from "./GuaranteeIcon";
|
|
57
59
|
export * from "./HeartFillIcon";
|
|
58
60
|
export * from "./HeartIcon";
|
package/dist/svgs/index.js
CHANGED
|
@@ -67,8 +67,10 @@ __exportStar(require("./EyeOpenedIcon"), exports);
|
|
|
67
67
|
__exportStar(require("./FacebookIcon"), exports);
|
|
68
68
|
__exportStar(require("./FairIcon"), exports);
|
|
69
69
|
__exportStar(require("./FilterIcon"), exports);
|
|
70
|
+
__exportStar(require("./FullWidthIcon"), exports);
|
|
70
71
|
__exportStar(require("./GenomeIcon"), exports);
|
|
71
72
|
__exportStar(require("./GraphIcon"), exports);
|
|
73
|
+
__exportStar(require("./GridIcon"), exports);
|
|
72
74
|
__exportStar(require("./GuaranteeIcon"), exports);
|
|
73
75
|
__exportStar(require("./HeartFillIcon"), exports);
|
|
74
76
|
__exportStar(require("./HeartIcon"), exports);
|