@artsy/palette-mobile 8.3.0 → 8.5.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/dist/atoms/Box/Box.stories.d.ts +4 -1
- package/dist/atoms/Box/Box.stories.js +7 -1
- package/dist/atoms/Flex/Flex.d.ts +2 -4
- package/dist/atoms/Flex/Flex.js +2 -2
- package/dist/elements/BorderBox/BorderBox.d.ts +1 -4
- package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.js +1 -3
- package/dist/space.stories.d.ts +6 -0
- package/dist/space.stories.js +17 -0
- package/package.json +4 -3
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { BoxProps } from "../Box";
|
|
2
4
|
declare const _default: {
|
|
3
5
|
title: string;
|
|
4
|
-
component: import("styled-components").StyledComponent<typeof
|
|
6
|
+
component: import("styled-components").StyledComponent<typeof View, any, BoxProps, never>;
|
|
5
7
|
};
|
|
6
8
|
export default _default;
|
|
7
9
|
export declare const Styled: () => JSX.Element;
|
|
10
|
+
export declare const RegularViewProps: () => JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Styled = void 0;
|
|
3
|
+
exports.RegularViewProps = exports.Styled = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const storybookHelpers_1 = require("../../storybookHelpers");
|
|
6
7
|
const Box_1 = require("../Box");
|
|
7
8
|
exports.default = {
|
|
@@ -26,3 +27,8 @@ const Styled = () => ((0, jsx_runtime_1.jsx)(storybookHelpers_1.List, { style: {
|
|
|
26
27
|
// TextAlignProps
|
|
27
28
|
textAlign: "center" }) }));
|
|
28
29
|
exports.Styled = Styled;
|
|
30
|
+
const RegularViewProps = () => {
|
|
31
|
+
const r = (0, react_1.useRef)(null);
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.Box, { px: 1, backgroundColor: "red100", onLayout: (e) => console.log(e.nativeEvent.layout), ref: r }));
|
|
33
|
+
};
|
|
34
|
+
exports.RegularViewProps = RegularViewProps;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { View } from "react-native";
|
|
2
3
|
import { BoxProps } from "../Box";
|
|
3
4
|
export type FlexProps = BoxProps;
|
|
4
|
-
export declare const Flex:
|
|
5
|
-
({ backgroundColor, ...restProps }: FlexProps): JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
5
|
+
export declare const Flex: import("react").ForwardRefExoticComponent<BoxProps & import("react").RefAttributes<View>>;
|
package/dist/atoms/Flex/Flex.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Flex = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const Box_1 = require("../Box");
|
|
6
|
-
|
|
7
|
-
exports.Flex = Flex;
|
|
7
|
+
exports.Flex = (0, react_1.forwardRef)(({ backgroundColor, ...restProps }, ref) => ((0, jsx_runtime_1.jsx)(Box_1.Box, { backgroundColor: backgroundColor ?? "transparent", ...restProps, ref: ref })));
|
|
8
8
|
exports.Flex.displayName = "Flex";
|
|
@@ -9,7 +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<
|
|
13
|
-
({ backgroundColor, ...restProps }: import("../../atoms").BoxProps): JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
}, any, BorderBoxProps, never>;
|
|
12
|
+
export declare const BorderBox: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../atoms").BoxProps & import("react").RefAttributes<import("react-native").View>>, any, BorderBoxProps, never>;
|
|
@@ -39,9 +39,7 @@ exports.CollapsibleMenuItem = (0, react_1.forwardRef)(({ children, overtitle, ti
|
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
41
|
}), [isOpen]);
|
|
42
|
-
return (
|
|
43
|
-
// @ts-expect-error
|
|
44
|
-
(0, jsx_runtime_1.jsxs)(atoms_1.Flex, { ref: componentRef, collapsable: false, children: [(0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, { onPress: () => {
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(atoms_1.Flex, { ref: componentRef, collapsable: false, children: [(0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, { onPress: () => {
|
|
45
43
|
setIsOpen(!isOpen);
|
|
46
44
|
isOpen ? onCollapse?.() : onExpand?.();
|
|
47
45
|
}, disabled: disabled, children: [!!overtitle && ((0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "sm", color: disabled ? "black30" : "black100", children: overtitle })), (0, jsx_runtime_1.jsxs)(atoms_1.Flex, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "lg", color: disabled ? "black30" : "black100", style: { maxWidth: "90%" }, children: title }), (0, jsx_runtime_1.jsxs)(atoms_1.Flex, { flexDirection: "row", alignItems: "center", children: [!!isCompleted && ((0, jsx_runtime_1.jsx)(svgs_1.CheckCircleIcon, { fill: "green100", height: 24, width: 24, style: { marginRight: 5 } })), (0, jsx_runtime_1.jsx)(svgs_1.ChevronIcon, { direction: isOpen ? "up" : "down", fill: disabled ? "black30" : "black60" })] })] })] }), (0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { opened: isOpen, children: children })] }));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpacingUnits = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
const storybookHelpers_1 = require("./storybookHelpers");
|
|
7
|
+
const SpaceLine = ({ space: theSpace }) => {
|
|
8
|
+
const space = (0, _1.useSpace)();
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(_1.Box, { children: [(0, jsx_runtime_1.jsx)(_1.Box, { width: space(theSpace), borderBottomWidth: 1, borderColor: "black", marginBottom: "4px" }), (0, jsx_runtime_1.jsx)(_1.Text, { color: "black", children: typeof theSpace === "string"
|
|
10
|
+
? `${theSpace}`
|
|
11
|
+
: `${theSpace} ${_1.bullet} ${space(theSpace)}px` })] }));
|
|
12
|
+
};
|
|
13
|
+
exports.default = {
|
|
14
|
+
title: "space",
|
|
15
|
+
};
|
|
16
|
+
const SpacingUnits = () => ((0, jsx_runtime_1.jsxs)(storybookHelpers_1.List, { style: { marginLeft: 50 }, contentContainerStyle: { alignItems: "flex-start" }, children: [(0, jsx_runtime_1.jsx)(SpaceLine, { space: 0.5 }), (0, jsx_runtime_1.jsx)(SpaceLine, { space: 1 }), (0, jsx_runtime_1.jsx)(SpaceLine, { space: 2 }), (0, jsx_runtime_1.jsx)(SpaceLine, { space: 4 }), (0, jsx_runtime_1.jsx)(SpaceLine, { space: 6 }), (0, jsx_runtime_1.jsx)(SpaceLine, { space: 12 })] }));
|
|
17
|
+
exports.SpacingUnits = SpacingUnits;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"description": "Artsy's design system for React Native",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"android": "react-native run-android",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"events": "^3.3.0",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"react-nanny": "^2.15.0",
|
|
36
|
-
"styled-components": "^5.3.6",
|
|
37
36
|
"styled-system": "^5.1.5"
|
|
38
37
|
},
|
|
39
38
|
"peerDependenciesComments": [
|
|
@@ -45,7 +44,8 @@
|
|
|
45
44
|
"react-native-haptic-feedback": "*",
|
|
46
45
|
"react-native-linear-gradient": "*",
|
|
47
46
|
"react-native-reanimated": "*",
|
|
48
|
-
"react-native-svg": "*"
|
|
47
|
+
"react-native-svg": "*",
|
|
48
|
+
"styled-components": ">= 5"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@artsy/auto-config": "1.2.0",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"react-test-renderer": "18.2.0",
|
|
103
103
|
"rimraf": "4.1.2",
|
|
104
104
|
"rn-flipper-async-storage-advanced": "1.0.4",
|
|
105
|
+
"styled-components": "^5.3.6",
|
|
105
106
|
"typescript": "4.9.5"
|
|
106
107
|
},
|
|
107
108
|
"files": [
|