@artsy/palette-mobile 0.2.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/README.md +8 -0
- package/dist/atoms/Box/Box.d.ts +9 -0
- package/dist/atoms/Box/Box.js +17 -0
- package/dist/atoms/Box/index.d.ts +1 -0
- package/dist/atoms/Box/index.js +17 -0
- package/dist/atoms/Spacer/Spacer.d.ts +10 -0
- package/dist/atoms/Spacer/Spacer.js +11 -0
- package/dist/atoms/Spacer/Spacer.stories.d.ts +9 -0
- package/dist/atoms/Spacer/Spacer.stories.js +12 -0
- package/dist/atoms/Spacer/index.d.ts +1 -0
- package/dist/atoms/Spacer/index.js +17 -0
- package/dist/atoms/index.d.ts +2 -0
- package/dist/atoms/index.js +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { View, ViewProps } from "react-native";
|
|
2
|
+
import { BackgroundProps, BorderProps, ColorProps, FlexboxProps, LayoutProps, PositionProps, SpaceProps, TextAlignProps } from "styled-system";
|
|
3
|
+
export interface BoxProps extends BackgroundProps, BorderProps, Omit<ColorProps, "color">, FlexboxProps, LayoutProps, PositionProps, SpaceProps, TextAlignProps, ViewProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const boxMixin: import("styled-system").styleFn;
|
|
6
|
+
/**
|
|
7
|
+
* Box is just a `View` with common styled-system props.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Box: import("styled-components").StyledComponent<typeof View, any, BoxProps, never>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Box = exports.boxMixin = void 0;
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const native_1 = __importDefault(require("styled-components/native"));
|
|
9
|
+
const styled_system_1 = require("styled-system");
|
|
10
|
+
exports.boxMixin = (0, styled_system_1.compose)(styled_system_1.background, styled_system_1.border, styled_system_1.color, styled_system_1.flexbox, styled_system_1.layout, styled_system_1.position, styled_system_1.space, styled_system_1.textAlign);
|
|
11
|
+
/**
|
|
12
|
+
* Box is just a `View` with common styled-system props.
|
|
13
|
+
*/
|
|
14
|
+
exports.Box = (0, native_1.default)(react_native_1.View) `
|
|
15
|
+
${exports.boxMixin}
|
|
16
|
+
`;
|
|
17
|
+
exports.Box.displayName = "Box";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Box";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Box"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HeightProps, SpaceProps, WidthProps } from "styled-system";
|
|
2
|
+
export interface SpacerProps extends SpaceProps, WidthProps, HeightProps {
|
|
3
|
+
x?: SpaceProps["ml"];
|
|
4
|
+
y?: SpaceProps["mt"];
|
|
5
|
+
}
|
|
6
|
+
/** Used to inject space where it's needed */
|
|
7
|
+
export declare const Spacer: {
|
|
8
|
+
({ x, y, ...props }: SpacerProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Spacer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Box_1 = require("../Box");
|
|
6
|
+
/** Used to inject space where it's needed */
|
|
7
|
+
const Spacer = ({ x, y, ...props }) => {
|
|
8
|
+
return (0, jsx_runtime_1.jsx)(Box_1.Box, { ml: x ?? props.ml, mt: y ?? props.mt, ...props });
|
|
9
|
+
};
|
|
10
|
+
exports.Spacer = Spacer;
|
|
11
|
+
exports.Spacer.displayName = "Spacer";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Vertical = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const Spacer_1 = require("./Spacer");
|
|
7
|
+
exports.default = {
|
|
8
|
+
title: "Spacer",
|
|
9
|
+
component: Spacer_1.Spacer,
|
|
10
|
+
};
|
|
11
|
+
const Vertical = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { backgroundColor: "red", width: 10, height: 10 } }), (0, jsx_runtime_1.jsx)(Spacer_1.Spacer, { y: 20 }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { backgroundColor: "red", width: 10, height: 10 } })] }));
|
|
12
|
+
exports.Vertical = Vertical;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Spacer";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Spacer"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Box"), exports);
|
|
18
|
+
__exportStar(require("./Spacer"), exports);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./atoms";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./atoms"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@artsy/palette-mobile",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Artsy's design system for React Native",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"install:all": "yarn install && yarn bundle-install && yarn pod-install",
|
|
7
|
+
"start": "react-native start",
|
|
8
|
+
"ios": "react-native run-ios",
|
|
9
|
+
"android": "react-native run-android",
|
|
10
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
11
|
+
"prestart": "sb-rn-get-stories",
|
|
12
|
+
"storybook-watcher": "sb-rn-watcher",
|
|
13
|
+
"bundle-install": "bundle install",
|
|
14
|
+
"pod-install": "cd ios && pod install && cd ..",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"build-lib": "tsc -p tsconfig.lib.json",
|
|
17
|
+
"build-lib:clean": "rimraf dist && yarn build-lib"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"react": "18.2.0",
|
|
21
|
+
"react-native": "0.69.5",
|
|
22
|
+
"styled-components": "^5.3.5",
|
|
23
|
+
"styled-system": "^5.1.5"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@babel/core": "^7.18.13",
|
|
27
|
+
"@babel/runtime": "^7.18.9",
|
|
28
|
+
"@react-native-async-storage/async-storage": "^1.17.10",
|
|
29
|
+
"@storybook/react-native": "^6.0.1-beta.7",
|
|
30
|
+
"@tsconfig/react-native": "^2.0.2",
|
|
31
|
+
"@types/jest": "^29.0.0",
|
|
32
|
+
"@types/react-native": "^0.69.6",
|
|
33
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
34
|
+
"@types/styled-components": "^5.1.26",
|
|
35
|
+
"@types/styled-components-react-native": "^5.1.3",
|
|
36
|
+
"@types/styled-system": "^5.1.15",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.36.1",
|
|
38
|
+
"@typescript-eslint/parser": "^5.36.1",
|
|
39
|
+
"babel-jest": "^29.0.1",
|
|
40
|
+
"eslint": "^8.23.0",
|
|
41
|
+
"eslint-config-prettier": "^8.5.0",
|
|
42
|
+
"eslint-import-resolver-typescript": "^3.5.0",
|
|
43
|
+
"eslint-plugin-import": "^2.26.0",
|
|
44
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
45
|
+
"jest": "^29.0.1",
|
|
46
|
+
"metro-react-native-babel-preset": "^0.72.1",
|
|
47
|
+
"react-native-safe-area-context": "^4.3.3",
|
|
48
|
+
"react-test-renderer": "^18.2.0",
|
|
49
|
+
"rimraf": "^3.0.2",
|
|
50
|
+
"typescript": "^4.8.2"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist"
|
|
54
|
+
],
|
|
55
|
+
"main": "dist/index.js",
|
|
56
|
+
"types": "dist/index.d.ts",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"license": "MIT"
|
|
61
|
+
}
|