@bigbinary/neetoui-rn 0.0.15 → 0.0.19

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.
@@ -1,30 +1,74 @@
1
1
  import * as React from "react";
2
- import { flexbox, space, border, buttonStyle } from "styled-system";
2
+ import {
3
+ flexbox,
4
+ space,
5
+ border,
6
+ buttonStyle,
7
+ color,
8
+ layout,
9
+ } from "styled-system";
3
10
  import styled from "styled-components/native";
4
11
  import propTypes from "@styled-system/prop-types";
5
- import PropTypes from "prop-types";
12
+ import { Typography } from "@components";
6
13
 
7
14
  export const TouchableOpacity = styled.TouchableOpacity`
15
+ ${buttonStyle}
8
16
  ${flexbox}
9
17
  ${space}
10
18
  ${border}
11
- ${buttonStyle}
19
+ ${layout}
20
+ ${color}
12
21
  `;
13
22
 
14
- export const Button = ({ children, ...rest }) => {
15
- return <TouchableOpacity {...rest}>{children}</TouchableOpacity>;
23
+ export const Button = ({
24
+ RightIcon,
25
+ LeftIcon,
26
+ fontFamily,
27
+ color,
28
+ fontSize,
29
+ ...rest
30
+ }) => {
31
+ const { disabled } = rest;
32
+ let style = rest.style || {};
33
+ if (disabled) {
34
+ style = { ...style, opacity: 0.5 };
35
+ }
36
+ return (
37
+ <TouchableOpacity
38
+ flexDirection="row"
39
+ disabled={disabled}
40
+ {...rest}
41
+ style={style}
42
+ >
43
+ {RightIcon && <RightIcon />}
44
+ <Typography
45
+ textAlign="center"
46
+ mx={1}
47
+ color={color}
48
+ fontFamily={fontFamily || "inter700"}
49
+ fontSize={fontSize || "s"}
50
+ textStyle={rest.variant}
51
+ >
52
+ {rest.label}
53
+ </Typography>
54
+ {LeftIcon && <LeftIcon />}
55
+ </TouchableOpacity>
56
+ );
16
57
  };
17
58
 
18
59
  Button.defaultProps = {
19
- variant: "primary",
20
- p: 15,
60
+ variant: "solid",
61
+ p: 12,
21
62
  alignItems: "center",
63
+ justifyContent: "center",
64
+ borderRadius: 2,
22
65
  };
23
66
 
24
67
  Button.propTypes = {
68
+ ...propTypes.buttonStyle,
25
69
  ...propTypes.flexbox,
26
70
  ...propTypes.space,
27
71
  ...propTypes.border,
28
- ...propTypes.buttonStyle,
29
- children: PropTypes.node.isRequired,
72
+ ...propTypes.layout,
73
+ ...propTypes.color,
30
74
  };
@@ -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,10 +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 { Body } from "./Typography/Body";
9
- export { Caption1 } from "./Typography/Caption1";
10
- export { Caption2 } from "./Typography/Caption2";
3
+ export { Typography } from "./Typography";
@@ -55,15 +55,12 @@ const baseTheme = {
55
55
  },
56
56
  lineHeights: [24],
57
57
  fontSizes: {
58
- largeTitle: 32,
59
- title1: 24,
60
- title2: 18,
61
- title3: 18,
62
- headline: 14,
63
- body: 14,
64
- callout: 12,
65
- caption1: 12,
66
- caption2: 10,
58
+ xs: 10,
59
+ s: 12,
60
+ m: 14,
61
+ l: 18,
62
+ xl: 24,
63
+ xxl: 32,
67
64
  },
68
65
  };
69
66
 
@@ -72,18 +69,47 @@ baseTheme.lineHeights.note = baseTheme.lineHeights[0] + "px";
72
69
 
73
70
  export const theme = {
74
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
+
90
+ // buttonTextStyles
91
+ solid: {
92
+ color: baseTheme.colors.font.white,
93
+ },
94
+ inverse: {
95
+ color: baseTheme.colors.font.base,
96
+ },
97
+ text: {
98
+ color: baseTheme.colors.font.base,
99
+ },
100
+ },
75
101
  buttons: {
76
- primary: {
77
- color: baseTheme.colors.white,
78
- backgroundColor: baseTheme.colors.grey800,
102
+ solid: {
103
+ backgroundColor: baseTheme.colors.background.base,
79
104
  },
80
- secondary: {
81
- color: baseTheme.colors.grey800,
105
+ inverse: {
106
+ border: 2,
107
+ borderColor: baseTheme.colors.white,
82
108
  backgroundColor: baseTheme.colors.white,
83
109
  },
84
- disabled: {
85
- color: baseTheme.colors.white,
86
- backgroundColor: baseTheme.colors.grey,
110
+ text: {
111
+ color: baseTheme.colors.grey800,
112
+ backgroundColor: baseTheme.colors.white,
87
113
  },
88
114
  },
89
115
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "0.0.15",
3
+ "version": "0.0.19",
4
4
  "main": "lib/index.js",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
@@ -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" {...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
- * 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" {...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" {...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
- * 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" {...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" {...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" {...rest}>
34
- {children}
35
- </Typography>
36
- );
37
- };
38
-
39
- Title2.propTypes = {
40
- ...Typography.propTypes,
41
- children: PropTypes.node.isRequired,
42
- };