@bigbinary/neetoui-rn 0.0.9 → 0.0.13
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 +12 -2
- package/lib/components/Button.js +10 -0
- package/lib/components/Container.js +17 -1
- package/lib/components/Typography/Body.js +9 -2
- package/lib/components/Typography/Callout.js +9 -2
- package/lib/components/Typography/Caption1.js +9 -2
- package/lib/components/Typography/Caption2.js +8 -1
- package/lib/components/Typography/Headline.js +9 -2
- package/lib/components/Typography/LargeTitle.js +8 -1
- package/lib/components/Typography/Title1.js +9 -2
- package/lib/components/Typography/Title2.js +9 -2
- package/lib/components/Typography/Title3.js +9 -2
- package/lib/components/Typography/Typography.js +28 -3
- package/lib/index.js +2 -0
- package/lib/theme/index.js +6 -2
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
[](https://app.netlify.com/sites/neetoui-rn/deploys)
|
|
2
|
+
[](https://app.netlify.com/sites/neetoui-rn-docs/deploys)
|
|
2
3
|
|
|
3
4
|
**NeetoUI-RN** is the library that drives the experience in all Neeto React
|
|
4
5
|
Native products built at [BigBinary](https://www.bigbinary.com).
|
|
@@ -28,15 +29,24 @@ You can use below commands for running storybook in different platforms:
|
|
|
28
29
|
| iOS: | `yarn ios` |
|
|
29
30
|
| Web | `yarn storybook-web` |
|
|
30
31
|
|
|
31
|
-
##
|
|
32
|
+
## Auto Publish to NPM
|
|
32
33
|
|
|
33
34
|
NeetoUI-RN version gets patched, auto-incremented and auto-published to npm on
|
|
34
35
|
new commit to master. You can checkout the `publish` workflow in git actions to
|
|
35
36
|
get a live update.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
## Building Storybook
|
|
39
|
+
|
|
40
|
+
Run `yarn build-react` to build storybook locally, this would create `dist`
|
|
38
41
|
folder with static files.
|
|
39
42
|
|
|
43
|
+
Run `yarn serve` to serve storybook locally.
|
|
44
|
+
|
|
45
|
+
## Building Component Documentation
|
|
46
|
+
|
|
47
|
+
Run `cd docs`, `yarn build` to build component documentation locally, this would
|
|
48
|
+
create `dist` folder with static files in `docs` folder.
|
|
49
|
+
|
|
40
50
|
## Documentation
|
|
41
51
|
|
|
42
52
|
Read the docs here.
|
package/lib/components/Button.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { flexbox, space, border, buttonStyle } from "styled-system";
|
|
3
3
|
import styled from "styled-components/native";
|
|
4
|
+
import propTypes from "@styled-system/prop-types";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
4
6
|
|
|
5
7
|
export const TouchableOpacity = styled.TouchableOpacity`
|
|
6
8
|
${flexbox}
|
|
@@ -18,3 +20,11 @@ Button.defaultProps = {
|
|
|
18
20
|
p: 15,
|
|
19
21
|
alignItems: "center",
|
|
20
22
|
};
|
|
23
|
+
|
|
24
|
+
Button.propTypes = {
|
|
25
|
+
...propTypes.flexbox,
|
|
26
|
+
...propTypes.space,
|
|
27
|
+
...propTypes.border,
|
|
28
|
+
...propTypes.buttonStyle,
|
|
29
|
+
children: PropTypes.node.isRequired,
|
|
30
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { flexbox, space, border, color, layout } from "styled-system";
|
|
2
3
|
import styled from "styled-components/native";
|
|
4
|
+
import propTypes from "@styled-system/prop-types";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
const View = styled.View`
|
|
5
8
|
${flexbox}
|
|
6
9
|
${space}
|
|
7
10
|
${border}
|
|
@@ -9,6 +12,19 @@ export const Container = styled.View`
|
|
|
9
12
|
${layout}
|
|
10
13
|
`;
|
|
11
14
|
|
|
15
|
+
export const Container = ({ children, ...rest }) => {
|
|
16
|
+
return <View {...rest}>{children}</View>;
|
|
17
|
+
};
|
|
18
|
+
|
|
12
19
|
Container.defaultProps = {
|
|
13
20
|
color: "background.default",
|
|
14
21
|
};
|
|
22
|
+
|
|
23
|
+
Container.propTypes = {
|
|
24
|
+
...propTypes.flexbox,
|
|
25
|
+
...propTypes.space,
|
|
26
|
+
...propTypes.border,
|
|
27
|
+
...propTypes.color,
|
|
28
|
+
...propTypes.layout,
|
|
29
|
+
children: PropTypes.node.isRequired,
|
|
30
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Body component is
|
|
9
|
+
* Body component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Body = ({ children, rest }) => {
|
|
31
|
+
export const Body = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="body" fontFamily="regular" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Body.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Callout component is
|
|
9
|
+
* Callout component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Callout = ({ children, rest }) => {
|
|
31
|
+
export const Callout = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="callout" fontFamily="bold" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Callout.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Caption1 component is
|
|
9
|
+
* Caption1 component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Caption1 = ({ children, rest }) => {
|
|
31
|
+
export const Caption1 = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="caption1" fontFamily="regular" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Caption1.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Caption2 component is
|
|
9
|
+
* Caption2 component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -33,3 +35,8 @@ export const Caption2 = ({ children, ...rest }) => {
|
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Caption2.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Headline component is
|
|
9
|
+
* Headline component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Headline = ({ children, rest }) => {
|
|
31
|
+
export const Headline = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="headline" fontFamily="bold" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Headline.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* LargeTitle component is
|
|
9
|
+
* LargeTitle component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -33,3 +35,8 @@ export const LargeTitle = ({ children, ...rest }) => {
|
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
LargeTitle.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Title1 component is
|
|
9
|
+
* Title1 component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Title1 = ({ children, rest }) => {
|
|
31
|
+
export const Title1 = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="title1" fontFamily="bold" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Title1.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Title2 component is
|
|
9
|
+
* Title2 component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Title2 = ({ children, rest }) => {
|
|
31
|
+
export const Title2 = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="title2" fontFamily="bold" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Title2.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
2
4
|
import { Typography } from "./Typography";
|
|
3
5
|
|
|
4
6
|
// @component-group Typography Components
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* Title3 component is
|
|
9
|
+
* Title3 component is built on top of typography component with default font family and font size.
|
|
8
10
|
*
|
|
9
11
|
* ## Usage
|
|
10
12
|
* ```js
|
|
@@ -26,10 +28,15 @@ import { Typography } from "./Typography";
|
|
|
26
28
|
* @extends StyledSystems props /styled-system
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
export const Title3 = ({ children, rest }) => {
|
|
31
|
+
export const Title3 = ({ children, ...rest }) => {
|
|
30
32
|
return (
|
|
31
33
|
<Typography fontSize="title3" fontFamily="regular" {...rest}>
|
|
32
34
|
{children}
|
|
33
35
|
</Typography>
|
|
34
36
|
);
|
|
35
37
|
};
|
|
38
|
+
|
|
39
|
+
Title3.propTypes = {
|
|
40
|
+
...Typography.propTypes,
|
|
41
|
+
children: PropTypes.node.isRequired,
|
|
42
|
+
};
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import styled from "styled-components/native";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
space,
|
|
5
|
+
layout,
|
|
6
|
+
flexbox,
|
|
7
|
+
typography,
|
|
8
|
+
color,
|
|
9
|
+
textStyle,
|
|
10
|
+
} from "styled-system";
|
|
11
|
+
import propTypes from "@styled-system/prop-types";
|
|
12
|
+
import PropTypes from "prop-types";
|
|
4
13
|
|
|
5
14
|
export const Text = styled.Text`
|
|
6
15
|
${space}
|
|
7
16
|
${layout}
|
|
17
|
+
${flexbox}
|
|
8
18
|
${typography}
|
|
9
19
|
${color}
|
|
10
20
|
${textStyle}
|
|
@@ -13,13 +23,14 @@ export const Text = styled.Text`
|
|
|
13
23
|
// @component-group Typography Components
|
|
14
24
|
|
|
15
25
|
/**
|
|
16
|
-
* Typography component is a primitive text component built on top of styled-system.
|
|
26
|
+
* Typography component is a primitive text component which is built on top of styled-system.
|
|
17
27
|
*
|
|
18
|
-
* This component supports below props categories from [styled-system ](/styled-system)
|
|
28
|
+
* This component supports below props categories from [styled-system ](/styled-system).
|
|
19
29
|
*
|
|
20
30
|
* <ul>
|
|
21
31
|
* <li>space</li>
|
|
22
32
|
* <li>layout</li>
|
|
33
|
+
* <li>flexbox</li>
|
|
23
34
|
* <li>typography</li>
|
|
24
35
|
* <li>color</li>
|
|
25
36
|
* <li>textStyle</li>
|
|
@@ -53,3 +64,17 @@ export const Text = styled.Text`
|
|
|
53
64
|
export const Typography = ({ children, ...rest }) => {
|
|
54
65
|
return <Text {...rest}>{children}</Text>;
|
|
55
66
|
};
|
|
67
|
+
|
|
68
|
+
Typography.propTypes = {
|
|
69
|
+
...propTypes.space,
|
|
70
|
+
...propTypes.layout,
|
|
71
|
+
...propTypes.flexbox,
|
|
72
|
+
...propTypes.typography,
|
|
73
|
+
...propTypes.color,
|
|
74
|
+
...propTypes.textStyle,
|
|
75
|
+
children: PropTypes.node.isRequired,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
Typography.defaultProps = {
|
|
79
|
+
color: "font.primary",
|
|
80
|
+
};
|
package/lib/index.js
ADDED
package/lib/theme/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const baseTheme = {
|
|
|
7
7
|
base: "#2F3941",
|
|
8
8
|
primary: "#1B1F23",
|
|
9
9
|
secondary: "#676767",
|
|
10
|
-
danger: "#
|
|
10
|
+
danger: "#FF6969",
|
|
11
11
|
},
|
|
12
12
|
background: {
|
|
13
13
|
default: "#FFFFFF",
|
|
@@ -25,7 +25,7 @@ const baseTheme = {
|
|
|
25
25
|
default: "#FFFFFF",
|
|
26
26
|
base: "#2F3941",
|
|
27
27
|
primary: "#E4E4E7",
|
|
28
|
-
danger: "#
|
|
28
|
+
danger: "#FF6969",
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
fonts: {
|
|
@@ -43,6 +43,7 @@ const baseTheme = {
|
|
|
43
43
|
regular: "Inter-Regular",
|
|
44
44
|
bold: "Inter-Bold",
|
|
45
45
|
},
|
|
46
|
+
lineHeights: [24],
|
|
46
47
|
fontSizes: {
|
|
47
48
|
largeTitle: moderateScale(32),
|
|
48
49
|
title1: moderateScale(24),
|
|
@@ -56,6 +57,9 @@ const baseTheme = {
|
|
|
56
57
|
},
|
|
57
58
|
};
|
|
58
59
|
|
|
60
|
+
//aliases
|
|
61
|
+
baseTheme.lineHeights.note = baseTheme.lineHeights[0] + "px";
|
|
62
|
+
|
|
59
63
|
export const theme = {
|
|
60
64
|
...baseTheme,
|
|
61
65
|
buttons: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neetoui-rn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "BigBinary",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,12 @@
|
|
|
41
41
|
]
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {},
|
|
44
|
-
"dependencies": {
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@styled-system/prop-types": "^5.1.5",
|
|
46
|
+
"react-native-size-matters": "^0.4.0",
|
|
47
|
+
"styled-components": "^5.3.3",
|
|
48
|
+
"styled-system": "^5.1.5"
|
|
49
|
+
},
|
|
45
50
|
"devDependencies": {
|
|
46
51
|
"@babel/core": "^7.12.9",
|
|
47
52
|
"@babel/runtime": "^7.12.5",
|
|
@@ -90,13 +95,10 @@
|
|
|
90
95
|
"react": "17.0.2",
|
|
91
96
|
"react-dom": "17.0.2",
|
|
92
97
|
"react-native": "0.66.2",
|
|
93
|
-
"react-native-size-matters": "^0.4.0",
|
|
94
98
|
"react-native-storybook-loader": "^2.0.4",
|
|
95
99
|
"react-native-web": "^0.17.5",
|
|
96
100
|
"react-test-renderer": "17.0.2",
|
|
97
101
|
"serve": "^13.0.2",
|
|
98
|
-
"styled-components": "^5.3.3",
|
|
99
|
-
"styled-system": "^5.1.5",
|
|
100
102
|
"url-loader": "^4.1.1",
|
|
101
103
|
"webpack": "^5.61.0",
|
|
102
104
|
"webpack-cli": "^4.9.1",
|