@bigbinary/neetoui-rn 0.0.12 → 0.0.16

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 CHANGED
@@ -1,6 +1,5 @@
1
- [![Netlify Status](https://api.netlify.com/api/v1/badges/1772e21c-61b9-4100-9b2e-9b0d1ce6a210/deploy-status)](https://app.netlify.com/sites/neetoui-rn/deploys) [![Netlify Status](https://api.netlify.com/api/v1/badges/717761ba-353e-4417-9860-86e49b78ac36/deploy-status)](https://app.netlify.com/sites/neetoui-rn-docs/deploys)
2
-
3
-
1
+ [![Netlify Status](https://api.netlify.com/api/v1/badges/1772e21c-61b9-4100-9b2e-9b0d1ce6a210/deploy-status)](https://app.netlify.com/sites/neetoui-rn/deploys)
2
+ [![Netlify Status](https://api.netlify.com/api/v1/badges/717761ba-353e-4417-9860-86e49b78ac36/deploy-status)](https://app.netlify.com/sites/neetoui-rn-docs/deploys)
4
3
 
5
4
  **NeetoUI-RN** is the library that drives the experience in all Neeto React
6
5
  Native products built at [BigBinary](https://www.bigbinary.com).
@@ -11,6 +10,18 @@ Native products built at [BigBinary](https://www.bigbinary.com).
11
10
  yarn add @bigbinary/neetoui-rn
12
11
  ```
13
12
 
13
+ To link the library, run:
14
+
15
+ ```sh
16
+ react-native link
17
+ ```
18
+
19
+ or
20
+
21
+ ```sh
22
+ npx react-native link
23
+ ```
24
+
14
25
  ## Development
15
26
 
16
27
  Install all the dependencies by executing following command.
@@ -43,11 +54,10 @@ folder with static files.
43
54
 
44
55
  Run `yarn serve` to serve storybook locally.
45
56
 
57
+ ## Building Component Documentation
46
58
 
47
- ## Building Component Documentation
48
-
49
- Run `cd docs`, `yarn build` to build component documentation locally, this would create `dist`
50
- folder with static files in `docs` folder.
59
+ Run `cd docs`, `yarn build` to build component documentation locally, this would
60
+ create `dist` folder with static files in `docs` folder.
51
61
 
52
62
  ## Documentation
53
63
 
Binary file
Binary file
@@ -17,7 +17,7 @@ export const Container = ({ children, ...rest }) => {
17
17
  };
18
18
 
19
19
  Container.defaultProps = {
20
- color: "background.default",
20
+ color: "background.primary",
21
21
  };
22
22
 
23
23
  Container.propTypes = {
@@ -1,19 +1,27 @@
1
1
  import * as React from "react";
2
2
  import styled from "styled-components/native";
3
- import { space, layout, typography, color, textStyle } from "styled-system";
3
+ import {
4
+ space,
5
+ layout,
6
+ flexbox,
7
+ typography,
8
+ color,
9
+ textStyle,
10
+ position,
11
+ } from "styled-system";
4
12
  import propTypes from "@styled-system/prop-types";
5
13
  import PropTypes from "prop-types";
6
14
 
7
15
  export const Text = styled.Text`
16
+ ${textStyle}
8
17
  ${space}
9
18
  ${layout}
19
+ ${flexbox}
10
20
  ${typography}
11
21
  ${color}
12
- ${textStyle}
22
+ ${position}
13
23
  `;
14
24
 
15
- // @component-group Typography Components
16
-
17
25
  /**
18
26
  * Typography component is a primitive text component which is built on top of styled-system.
19
27
  *
@@ -22,15 +30,20 @@ export const Text = styled.Text`
22
30
  * <ul>
23
31
  * <li>space</li>
24
32
  * <li>layout</li>
33
+ * <li>flexbox</li>
25
34
  * <li>typography</li>
26
35
  * <li>color</li>
27
36
  * <li>textStyle</li>
28
37
  * </ul>
29
38
  *
30
39
  * <div class="screenshots">
31
- * <img src="screenshots/typography-all.png" />
32
- * <img src="screenshots/typography-colors.png" />
33
- * <img src="screenshots/typography-fonts.png" />
40
+ * <img src="screenshots/typography/fontsizes.png" />
41
+ * <img src="screenshots/typography/textstyles.png" />
42
+ * </div>
43
+ *
44
+ * <div class="screenshots">
45
+ * <img src="screenshots/typography/fontsizes.png" />
46
+ * <img src="screenshots/typography/textstyles.png" />
34
47
  * </div>
35
48
  *
36
49
  * ## Usage
@@ -59,6 +72,7 @@ export const Typography = ({ children, ...rest }) => {
59
72
  Typography.propTypes = {
60
73
  ...propTypes.space,
61
74
  ...propTypes.layout,
75
+ ...propTypes.flexbox,
62
76
  ...propTypes.typography,
63
77
  ...propTypes.color,
64
78
  ...propTypes.textStyle,
@@ -66,5 +80,5 @@ Typography.propTypes = {
66
80
  };
67
81
 
68
82
  Typography.defaultProps = {
69
- color: "font.primary",
83
+ textStyle: "defaultTextStyle",
70
84
  };
@@ -1,13 +1,3 @@
1
1
  export { Button } from "./Button";
2
2
  export { Container } from "./Container";
3
-
4
- export { Typography } from "./Typography/Typography";
5
- export { LargeTitle } from "./Typography/LargeTitle";
6
- export { Title1 } from "./Typography/Title1";
7
- export { Title2 } from "./Typography/Title2";
8
- export { Title3 } from "./Typography/Title3";
9
- export { Headline } from "./Typography/Headline";
10
- export { Body } from "./Typography/Body";
11
- export { Callout } from "./Typography/Callout";
12
- export { Caption1 } from "./Typography/Caption1";
13
- export { Caption2 } from "./Typography/Caption2";
3
+ export { Typography } from "./Typography";
@@ -1,63 +1,92 @@
1
- import { moderateScale } from "react-native-size-matters";
1
+ const defaultColors = {
2
+ white: "#ffffff",
3
+ black: "#000000",
4
+ base: "#2f3941",
5
+ danger: "#ff6969",
6
+ };
2
7
 
3
- const baseTheme = {
4
- colors: {
5
- font: {
6
- default: "#FFFFFF",
7
- base: "#2F3941",
8
- primary: "#1B1F23",
9
- secondary: "#676767",
10
- danger: "#FE295C",
11
- },
12
- background: {
13
- default: "#FFFFFF",
14
- base: "#2F3941",
15
- primary: "#E4E4E7",
16
- secondary: "#E9EBED",
17
- },
18
- card: {
19
- default: "#FFFFFF",
20
- base: "#2F3941",
21
- primary: "#F8F9F9",
22
- secondary: "#E9EBED",
23
- },
24
- border: {
25
- default: "#FFFFFF",
26
- base: "#2F3941",
27
- primary: "#E4E4E7",
28
- danger: "#FE295C",
29
- },
8
+ const greyVarients = {
9
+ grey: "#828282",
10
+ grey100: "#f8f9f9",
11
+ grey200: "#e9ebed",
12
+ grey300: "#d8dcde",
13
+ grey400: "#c2c8cc",
14
+ grey500: "#87929d",
15
+ grey600: "#68737d",
16
+ grey800: "#2f3941",
17
+ };
18
+
19
+ const colors = {
20
+ font: {
21
+ primary: "#1b1f23",
22
+ secondary: "#828282",
23
+ ...defaultColors,
24
+ ...greyVarients,
25
+ },
26
+ background: {
27
+ primary: "#ffffff",
28
+ secondary: "#e4e4e7",
29
+ ...defaultColors,
30
+ ...greyVarients,
31
+ },
32
+ border: {
33
+ primary: "#e4e4e7",
34
+ ...greyVarients,
35
+ ...defaultColors,
30
36
  },
37
+ };
38
+
39
+ const baseTheme = {
40
+ colors,
31
41
  fonts: {
32
42
  // We can add below commented fonts later as follows. Also add font faces in index.web.js for the web.
33
43
  // https://www.bigbinary.com/learn-react-native/adding-custom-fonats
34
44
 
35
- // thin: "Inter-Thin",
36
- // extraLight: "Inter-ExtraLight",
37
- // light: "Inter-Light",
38
- // medium: "Inter-Medium",
39
- // semiBold: "Inter-SemiBold",
40
- // extraBold: "Inter-ExtraBold",
41
- // black: "Inter-Black",
45
+ // inter100: "Inter-Thin",
46
+ // inter200: "Inter-ExtraLight",
47
+ // inter300: "Inter-Light",
48
+ // inter500: "Inter-Medium",
49
+ // inter600: "Inter-SemiBold",
50
+ // inter800: "Inter-ExtraBold",
51
+ // inter900: "Inter-Black",
42
52
 
43
- regular: "Inter-Regular",
44
- bold: "Inter-Bold",
53
+ inter400: "Inter-Regular",
54
+ inter700: "Inter-Bold",
45
55
  },
56
+ lineHeights: [24],
46
57
  fontSizes: {
47
- largeTitle: moderateScale(32),
48
- title1: moderateScale(24),
49
- title2: moderateScale(18),
50
- title3: moderateScale(18),
51
- headline: moderateScale(14),
52
- body: moderateScale(14),
53
- callout: moderateScale(12),
54
- caption1: moderateScale(12),
55
- caption2: moderateScale(10),
58
+ xs: 10,
59
+ s: 12,
60
+ m: 14,
61
+ l: 18,
62
+ xl: 24,
63
+ xxl: 32,
56
64
  },
57
65
  };
58
66
 
67
+ //aliases
68
+ baseTheme.lineHeights.note = baseTheme.lineHeights[0] + "px";
69
+
59
70
  export const theme = {
60
71
  ...baseTheme,
72
+ textStyles: {
73
+ defaultTextStyle: {
74
+ color: baseTheme.colors.font.primary,
75
+ },
76
+ header: {
77
+ color: baseTheme.colors.font.primary,
78
+ fontSize: baseTheme.fontSizes.l,
79
+ fontFamily: baseTheme.fonts.inter700,
80
+ },
81
+ body: {
82
+ color: baseTheme.colors.font.primary,
83
+ fontSize: baseTheme.fontSizes.m,
84
+ },
85
+ subtext: {
86
+ color: baseTheme.colors.font.primary,
87
+ fontSize: baseTheme.fontSizes.s,
88
+ },
89
+ },
61
90
  buttons: {
62
91
  primary: {
63
92
  color: baseTheme.colors.white,
@@ -68,7 +97,7 @@ export const theme = {
68
97
  backgroundColor: baseTheme.colors.white,
69
98
  },
70
99
  disabled: {
71
- color: baseTheme.colors.white,
100
+ color: "#00FF00",
72
101
  backgroundColor: baseTheme.colors.grey,
73
102
  },
74
103
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "0.0.12",
3
+ "version": "0.0.16",
4
4
  "main": "lib/index.js",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
@@ -26,7 +26,9 @@
26
26
  "web": "yarn prestart && webpack serve --mode=development --config webpack.config.js"
27
27
  },
28
28
  "files": [
29
- "lib"
29
+ "lib",
30
+ "react-native.config.js",
31
+ "assets"
30
32
  ],
31
33
  "husky": {
32
34
  "hooks": {
@@ -43,7 +45,6 @@
43
45
  "peerDependencies": {},
44
46
  "dependencies": {
45
47
  "@styled-system/prop-types": "^5.1.5",
46
- "react-native-size-matters": "^0.4.0",
47
48
  "styled-components": "^5.3.3",
48
49
  "styled-system": "^5.1.5"
49
50
  },
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ project: {
3
+ ios: {},
4
+ android: {},
5
+ },
6
+ assets: ["./assets/fonts/"],
7
+ dependency: {
8
+ assets: ["./assets/fonts/"],
9
+ },
10
+ };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Body component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Body, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Body>
20
- * This is basic example of Body
21
- * </Body>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Body = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="body" fontFamily="regular" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Body.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Callout component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Callout, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Callout>
20
- * This is basic example of Callout
21
- * </Callout>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Callout = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="callout" fontFamily="bold" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Callout.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Caption1 component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Caption1, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Caption1>
20
- * This is basic example of Caption1
21
- * </Caption1>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Caption1 = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="caption1" fontFamily="regular" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Caption1.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Caption2 component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Caption2, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Caption2>
20
- * This is basic example of Caption2
21
- * </Caption2>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Caption2 = ({ children, ...rest }) => {
32
- return (
33
- <Typography fontSize="caption2" fontFamily="regular" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Caption2.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Headline component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Headline, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Headline>
20
- * This is basic example of Headline
21
- * </Headline>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Headline = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="headline" fontFamily="bold" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Headline.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * LargeTitle component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { LargeTitle, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <LargeTitle>
20
- * This is basic example of LargeTitle
21
- * </LargeTitle>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const LargeTitle = ({ children, ...rest }) => {
32
- return (
33
- <Typography fontSize="largeTitle" fontFamily="bold" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- LargeTitle.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Title1 component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Title1, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Title1>
20
- * This is basic example of Title1
21
- * </Title1>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Title1 = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="title1" fontFamily="bold" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Title1.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Title2 component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Title2, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Title2>
20
- * This is basic example of Title2
21
- * </Title2>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Title2 = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="title2" fontFamily="bold" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Title2.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- import { Typography } from "./Typography";
5
-
6
- // @component-group Typography Components
7
-
8
- /**
9
- * Title3 component is built on top of typography component with default font family and font size.
10
- *
11
- * ## Usage
12
- * ```js
13
- * import * as React from 'react';
14
- * import { Title3, Container } from '@bigbinary/neetoui-rn';
15
- *
16
- * export default function Main() {
17
- * return (
18
- * <Container>
19
- * <Title3>
20
- * This is basic example of Title3
21
- * </Title3>
22
- * </Container>
23
- * );
24
- * }
25
- *
26
- * ```
27
- *
28
- * @extends StyledSystems props /styled-system
29
- */
30
-
31
- export const Title3 = ({ children, rest }) => {
32
- return (
33
- <Typography fontSize="title3" fontFamily="regular" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Title3.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };