@bigbinary/neetoui-rn 0.0.13 → 0.0.17

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
@@ -10,6 +10,18 @@ Native products built at [BigBinary](https://www.bigbinary.com).
10
10
  yarn add @bigbinary/neetoui-rn
11
11
  ```
12
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
+
13
25
  ## Development
14
26
 
15
27
  Install all the dependencies by executing following command.
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 = {
@@ -7,21 +7,21 @@ import {
7
7
  typography,
8
8
  color,
9
9
  textStyle,
10
+ position,
10
11
  } from "styled-system";
11
12
  import propTypes from "@styled-system/prop-types";
12
13
  import PropTypes from "prop-types";
13
14
 
14
15
  export const Text = styled.Text`
16
+ ${textStyle}
15
17
  ${space}
16
18
  ${layout}
17
19
  ${flexbox}
18
20
  ${typography}
19
21
  ${color}
20
- ${textStyle}
22
+ ${position}
21
23
  `;
22
24
 
23
- // @component-group Typography Components
24
-
25
25
  /**
26
26
  * Typography component is a primitive text component which is built on top of styled-system.
27
27
  *
@@ -37,9 +37,13 @@ export const Text = styled.Text`
37
37
  * </ul>
38
38
  *
39
39
  * <div class="screenshots">
40
- * <img src="screenshots/typography-all.png" />
41
- * <img src="screenshots/typography-colors.png" />
42
- * <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" />
43
47
  * </div>
44
48
  *
45
49
  * ## Usage
@@ -76,5 +80,5 @@ Typography.propTypes = {
76
80
  };
77
81
 
78
82
  Typography.defaultProps = {
79
- color: "font.primary",
83
+ textStyle: "defaultTextStyle",
80
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,59 +1,66 @@
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: "#FF6969",
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: "#FF6969",
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
  },
46
56
  lineHeights: [24],
47
57
  fontSizes: {
48
- largeTitle: moderateScale(32),
49
- title1: moderateScale(24),
50
- title2: moderateScale(18),
51
- title3: moderateScale(18),
52
- headline: moderateScale(14),
53
- body: moderateScale(14),
54
- callout: moderateScale(12),
55
- caption1: moderateScale(12),
56
- caption2: moderateScale(10),
58
+ xs: 10,
59
+ s: 12,
60
+ m: 14,
61
+ l: 18,
62
+ xl: 24,
63
+ xxl: 32,
57
64
  },
58
65
  };
59
66
 
@@ -62,6 +69,24 @@ baseTheme.lineHeights.note = baseTheme.lineHeights[0] + "px";
62
69
 
63
70
  export const theme = {
64
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
+ },
65
90
  buttons: {
66
91
  primary: {
67
92
  color: baseTheme.colors.white,
@@ -72,7 +97,7 @@ export const theme = {
72
97
  backgroundColor: baseTheme.colors.white,
73
98
  },
74
99
  disabled: {
75
- color: baseTheme.colors.white,
100
+ color: "#00FF00",
76
101
  backgroundColor: baseTheme.colors.grey,
77
102
  },
78
103
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "0.0.13",
3
+ "version": "0.0.17",
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
- };