@hero-design/rn 7.0.2 → 7.0.5

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/es/index.js CHANGED
@@ -8130,7 +8130,7 @@ Processor$1["default"] = Processor$1;
8130
8130
  Root$2.registerProcessor(Processor$1);
8131
8131
  Document$1.registerProcessor(Processor$1);
8132
8132
 
8133
- var _excluded$1 = ["inputs"],
8133
+ var _excluded$3 = ["inputs"],
8134
8134
  _excluded2 = ["inputId"];
8135
8135
 
8136
8136
  var Declaration$1 = declaration;
@@ -8147,7 +8147,7 @@ function fromJSON$1(json, inputs) {
8147
8147
  });
8148
8148
 
8149
8149
  var ownInputs = json.inputs,
8150
- defaults = _objectWithoutProperties$1(json, _excluded$1);
8150
+ defaults = _objectWithoutProperties$1(json, _excluded$3);
8151
8151
 
8152
8152
  if (ownInputs) {
8153
8153
  inputs = [];
@@ -9983,13 +9983,13 @@ var getDividerTheme = function getDividerTheme(theme) {
9983
9983
  large: "".concat(theme.space.large, "px"),
9984
9984
  xlarge: "".concat(theme.space.xlarge, "px")
9985
9985
  };
9986
- var borderWiths = {
9986
+ var borderWidths = {
9987
9987
  "default": "".concat(theme.borderWidths.base, "px")
9988
9988
  };
9989
9989
  return {
9990
9990
  colors: colors,
9991
9991
  space: space,
9992
- borderWiths: borderWiths
9992
+ borderWidths: borderWidths
9993
9993
  };
9994
9994
  };
9995
9995
 
@@ -10100,17 +10100,21 @@ var StyledText$1 = styled(Text$1)(_templateObject3$2 || (_templateObject3$2 = _t
10100
10100
  });
10101
10101
  });
10102
10102
 
10103
+ var _excluded$2 = ["content", "intent", "style", "testID"];
10104
+
10103
10105
  var Badge = function Badge(_ref) {
10104
10106
  var content = _ref.content,
10105
10107
  _ref$intent = _ref.intent,
10106
10108
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
10107
10109
  style = _ref.style,
10108
- testID = _ref.testID;
10109
- return /*#__PURE__*/React.createElement(StyledView, {
10110
- testID: testID,
10110
+ testID = _ref.testID,
10111
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
10112
+
10113
+ return /*#__PURE__*/React.createElement(StyledView, _extends$1({
10111
10114
  themeIntent: intent,
10112
- style: style
10113
- }, /*#__PURE__*/React.createElement(StyledText$1, {
10115
+ style: style,
10116
+ testID: testID
10117
+ }, nativeProps), /*#__PURE__*/React.createElement(StyledText$1, {
10114
10118
  themeIntent: intent
10115
10119
  }, content));
10116
10120
  };
@@ -10131,7 +10135,7 @@ var Card = function Card(props) {
10131
10135
  var _templateObject$2, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11, _templateObject12, _templateObject13;
10132
10136
  var StyledDivider = styled(View)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n max-width: 100%;\n\n ", "\n\n ", "\n"])), function (_ref) {
10133
10137
  var theme = _ref.theme;
10134
- return theme.__hd__.divider.borderWiths["default"];
10138
+ return theme.__hd__.divider.borderWidths["default"];
10135
10139
  }, function (_ref2) {
10136
10140
  var theme = _ref2.theme;
10137
10141
  return theme.__hd__.divider.colors["default"];
@@ -10183,13 +10187,21 @@ var StyledDivider = styled(View)(_templateObject$2 || (_templateObject$2 = _tagg
10183
10187
  }
10184
10188
  });
10185
10189
 
10190
+ var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
10191
+
10186
10192
  var Divider = function Divider(_ref) {
10187
10193
  var marginHorizontal = _ref.marginHorizontal,
10188
- marginVertical = _ref.marginVertical;
10189
- return /*#__PURE__*/React.createElement(StyledDivider, {
10194
+ marginVertical = _ref.marginVertical,
10195
+ style = _ref.style,
10196
+ testID = _ref.testID,
10197
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
10198
+
10199
+ return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({
10190
10200
  themeMarginHorizontal: marginHorizontal,
10191
- themeMarginVertical: marginVertical
10192
- });
10201
+ themeMarginVertical: marginVertical,
10202
+ style: style,
10203
+ testID: testID
10204
+ }, nativeProps));
10193
10205
  };
10194
10206
 
10195
10207
  var dist = {};
Binary file
package/lib/index.js CHANGED
@@ -8139,7 +8139,7 @@ Processor$1["default"] = Processor$1;
8139
8139
  Root$2.registerProcessor(Processor$1);
8140
8140
  Document$1.registerProcessor(Processor$1);
8141
8141
 
8142
- var _excluded$1 = ["inputs"],
8142
+ var _excluded$3 = ["inputs"],
8143
8143
  _excluded2 = ["inputId"];
8144
8144
 
8145
8145
  var Declaration$1 = declaration;
@@ -8156,7 +8156,7 @@ function fromJSON$1(json, inputs) {
8156
8156
  });
8157
8157
 
8158
8158
  var ownInputs = json.inputs,
8159
- defaults = _objectWithoutProperties$1(json, _excluded$1);
8159
+ defaults = _objectWithoutProperties$1(json, _excluded$3);
8160
8160
 
8161
8161
  if (ownInputs) {
8162
8162
  inputs = [];
@@ -9992,13 +9992,13 @@ var getDividerTheme = function getDividerTheme(theme) {
9992
9992
  large: "".concat(theme.space.large, "px"),
9993
9993
  xlarge: "".concat(theme.space.xlarge, "px")
9994
9994
  };
9995
- var borderWiths = {
9995
+ var borderWidths = {
9996
9996
  "default": "".concat(theme.borderWidths.base, "px")
9997
9997
  };
9998
9998
  return {
9999
9999
  colors: colors,
10000
10000
  space: space,
10001
- borderWiths: borderWiths
10001
+ borderWidths: borderWidths
10002
10002
  };
10003
10003
  };
10004
10004
 
@@ -10109,17 +10109,21 @@ var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$2 || (_templateObj
10109
10109
  });
10110
10110
  });
10111
10111
 
10112
+ var _excluded$2 = ["content", "intent", "style", "testID"];
10113
+
10112
10114
  var Badge = function Badge(_ref) {
10113
10115
  var content = _ref.content,
10114
10116
  _ref$intent = _ref.intent,
10115
10117
  intent = _ref$intent === void 0 ? 'info' : _ref$intent,
10116
10118
  style = _ref.style,
10117
- testID = _ref.testID;
10118
- return /*#__PURE__*/React__default["default"].createElement(StyledView, {
10119
- testID: testID,
10119
+ testID = _ref.testID,
10120
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
10121
+
10122
+ return /*#__PURE__*/React__default["default"].createElement(StyledView, _extends$1({
10120
10123
  themeIntent: intent,
10121
- style: style
10122
- }, /*#__PURE__*/React__default["default"].createElement(StyledText$1, {
10124
+ style: style,
10125
+ testID: testID
10126
+ }, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledText$1, {
10123
10127
  themeIntent: intent
10124
10128
  }, content));
10125
10129
  };
@@ -10140,7 +10144,7 @@ var Card = function Card(props) {
10140
10144
  var _templateObject$2, _templateObject2$2, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11, _templateObject12, _templateObject13;
10141
10145
  var StyledDivider = styled(require$$0$1.View)(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n max-width: 100%;\n\n ", "\n\n ", "\n"])), function (_ref) {
10142
10146
  var theme = _ref.theme;
10143
- return theme.__hd__.divider.borderWiths["default"];
10147
+ return theme.__hd__.divider.borderWidths["default"];
10144
10148
  }, function (_ref2) {
10145
10149
  var theme = _ref2.theme;
10146
10150
  return theme.__hd__.divider.colors["default"];
@@ -10192,13 +10196,21 @@ var StyledDivider = styled(require$$0$1.View)(_templateObject$2 || (_templateObj
10192
10196
  }
10193
10197
  });
10194
10198
 
10199
+ var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
10200
+
10195
10201
  var Divider = function Divider(_ref) {
10196
10202
  var marginHorizontal = _ref.marginHorizontal,
10197
- marginVertical = _ref.marginVertical;
10198
- return /*#__PURE__*/React__default["default"].createElement(StyledDivider, {
10203
+ marginVertical = _ref.marginVertical,
10204
+ style = _ref.style,
10205
+ testID = _ref.testID,
10206
+ nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
10207
+
10208
+ return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({
10199
10209
  themeMarginHorizontal: marginHorizontal,
10200
- themeMarginVertical: marginVertical
10201
- });
10210
+ themeMarginVertical: marginVertical,
10211
+ style: style,
10212
+ testID: testID
10213
+ }, nativeProps));
10202
10214
  };
10203
10215
 
10204
10216
  var dist = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.0.2",
3
+ "version": "7.0.5",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -9,7 +9,8 @@
9
9
  "lint": "eslint src playground --ext .js,.jsx,.ts,.tsx --ignore-path ../../.gitignore",
10
10
  "type-check": "tsc --noEmit",
11
11
  "dev": "expo start",
12
- "test": "jest --runInBand --watch",
12
+ "test": "jest --runInBand",
13
+ "test:watch": "jest --runInBand --watch",
13
14
  "test:ci": "jest --runInBand --logHeapUsage",
14
15
  "build:js": "rollup -c",
15
16
  "build:types": "tsc --noEmit false --emitDeclarationOnly",
@@ -17,7 +18,7 @@
17
18
  "publish:npm": "yarn publish --access public"
18
19
  },
19
20
  "dependencies": {
20
- "@hero-design/colors": "7.0.2",
21
+ "@hero-design/colors": "7.0.5",
21
22
  "styled-components": "6.0.0-alpha.5"
22
23
  },
23
24
  "peerDependencies": {
@@ -67,6 +68,7 @@
67
68
  "react-native-vector-icons": "^9.1.0",
68
69
  "react-test-renderer": "17.0.2",
69
70
  "rollup": "^2.68.0",
71
+ "rollup-plugin-copy": "^3.4.0",
70
72
  "ts-jest": "^27.0.7",
71
73
  "typescript": "^4.5.5"
72
74
  },
@@ -1,51 +1,237 @@
1
- import React from 'react';
2
- import { View } from 'react-native';
3
- import { Card, useTheme } from '../../src/index';
1
+ import React, { ComponentProps } from 'react';
2
+ import { View, ViewProps, StyleSheet } from 'react-native';
3
+ import { palette } from '@hero-design/colors';
4
+ import { Card, useTheme, Typography, Icon, Divider } from '../../src/index';
4
5
 
5
- const CardPlayground = () => {
6
+ const TextBox = (props: ViewProps) => (
7
+ <View
8
+ style={{
9
+ flex: 1,
10
+ justifyContent: 'flex-end',
11
+ }}
12
+ {...props}
13
+ />
14
+ );
15
+
16
+ const Screen = View;
17
+ type DashboardCardProps = ViewProps & {
18
+ icon: ComponentProps<typeof Icon>['icon'];
19
+ title: string;
20
+ subtitle: string;
21
+ };
22
+
23
+ const DashboardCard = ({
24
+ style,
25
+ icon,
26
+ title,
27
+ subtitle,
28
+ }: DashboardCardProps) => (
29
+ <Card testID="inductionContent" style={style}>
30
+ <View style={{ flex: 1, alignItems: 'flex-end' }}>
31
+ <Icon icon={icon} />
32
+ </View>
33
+ <TextBox>
34
+ <Typography.Text fontSize="xlarge" fontWeight="semi-bold">
35
+ {title}
36
+ </Typography.Text>
37
+ <Typography.Text fontSize="medium">{subtitle}</Typography.Text>
38
+ </TextBox>
39
+ </Card>
40
+ );
41
+
42
+ const InductionCard = (props: ViewProps) => (
43
+ <DashboardCard
44
+ icon="file-verified"
45
+ title="Induction Content"
46
+ subtitle="2 files to acknowledge"
47
+ {...props}
48
+ />
49
+ );
50
+ const PoliciesCard = (props: ViewProps) => (
51
+ <DashboardCard
52
+ icon="file-secured"
53
+ title="Policies"
54
+ subtitle="1 to acknowledge"
55
+ {...props}
56
+ />
57
+ );
58
+
59
+ const CertificationsCard = (props: ViewProps) => (
60
+ <DashboardCard
61
+ icon="file-certified"
62
+ title="Certification"
63
+ subtitle="1 to update"
64
+ {...props}
65
+ />
66
+ );
67
+
68
+ const Payslip = (props: ViewProps) => {
6
69
  const theme = useTheme();
70
+ const { style, ...otherProps } = props;
7
71
  return (
8
- <View
9
- style={{
10
- flex: 1,
11
- marginVertical: theme.space.xxxxlarge,
12
- marginHorizontal: theme.space.xxxxlarge,
13
- }}
72
+ <Card
73
+ {...otherProps}
74
+ style={StyleSheet.flatten([
75
+ {
76
+ flexDirection: 'row',
77
+ alignItems: 'stretch',
78
+ backgroundColor: palette.greyLight75,
79
+ },
80
+ style,
81
+ ])}
14
82
  >
15
- <Card
83
+ <View>
84
+ <View
85
+ style={{
86
+ padding: theme.space.small,
87
+ backgroundColor: '#C0ECE6',
88
+ borderRadius: 999,
89
+ alignContent: 'stretch',
90
+ }}
91
+ >
92
+ <Icon icon="coin" />
93
+ </View>
94
+ </View>
95
+ <View style={{ flex: 1, marginLeft: theme.space.small }}>
96
+ <Typography.Text fontSize="large" fontWeight="semi-bold">
97
+ Rosters
98
+ </Typography.Text>
99
+ <Typography.Text fontSize="medium">3 shifts this week</Typography.Text>
100
+ </View>
101
+ <View
16
102
  style={{
17
- flex: 1,
18
- backgroundColor: theme.colors.backgroundDark,
19
- padding: theme.space.medium,
103
+ alignItems: 'center',
104
+ alignContent: 'center',
105
+ justifyContent: 'center',
20
106
  }}
21
107
  >
22
- <Card
23
- style={{ flex: 1, backgroundColor: theme.colors.backgroundLight }}
24
- />
25
- <Card
26
- style={{ flex: 1, backgroundColor: theme.colors.infoBackground }}
27
- />
28
- <Card style={{ flex: 1, backgroundColor: theme.colors.primaryLight }} />
29
- </Card>
30
-
31
- <Card
108
+ <Icon icon="arrow-right" />
109
+ </View>
110
+ </Card>
111
+ );
112
+ };
113
+
114
+ const MyLeaveCard = (props: ViewProps) => {
115
+ const theme = useTheme();
116
+ const { style, ...otherProps } = props;
117
+ return (
118
+ <Card
119
+ {...otherProps}
120
+ style={StyleSheet.flatten([
121
+ {
122
+ backgroundColor: palette.greyLight90,
123
+ paddingBottom: 0,
124
+ paddingTop: 0,
125
+ paddingRight: 0,
126
+ paddingLeft: 0,
127
+ },
128
+ style,
129
+ ])}
130
+ >
131
+ <View
132
+ testID="header"
32
133
  style={{
33
- flex: 1,
34
- backgroundColor: theme.colors.backgroundDark,
35
- padding: theme.space.medium,
134
+ marginHorizontal: theme.space.small,
135
+ marginTop: theme.space.small,
136
+ justifyContent: 'space-between',
36
137
  flexDirection: 'row',
37
- marginTop: theme.space.large,
38
138
  }}
39
139
  >
40
- <Card
41
- style={{ flex: 1, backgroundColor: theme.colors.backgroundLight }}
42
- />
43
- <Card
44
- style={{ flex: 1, backgroundColor: theme.colors.infoBackground }}
45
- />
46
- <Card style={{ flex: 1, backgroundColor: theme.colors.primaryLight }} />
47
- </Card>
48
- </View>
140
+ <Typography.Text fontSize="large" fontWeight="semi-bold">
141
+ My Leave
142
+ </Typography.Text>
143
+
144
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
145
+ <Typography.Text fontWeight="semi-bold">Add / view</Typography.Text>
146
+ <Icon
147
+ icon="circle-add-outlined"
148
+ size="xsmall"
149
+ style={{ margin: theme.space.xxsmall }}
150
+ />
151
+ </View>
152
+ </View>
153
+ <Divider marginVertical="small" />
154
+ <View testID="content" style={{ margin: theme.space.small }}>
155
+ <Typography.Text fontSize="medium" fontWeight="semi-bold">
156
+ Leave Balances
157
+ </Typography.Text>
158
+ <View
159
+ testID="listItem1"
160
+ style={{ flexDirection: 'row', justifyContent: 'space-between' }}
161
+ >
162
+ <Typography.Text>Jury Duty</Typography.Text>
163
+ <Typography.Text fontWeight="semi-bold">12.06 hrs</Typography.Text>
164
+ </View>
165
+ <View
166
+ testID="listItem1"
167
+ style={{ flexDirection: 'row', justifyContent: 'space-between' }}
168
+ >
169
+ <Typography.Text>Annual Leave</Typography.Text>
170
+ <Typography.Text fontWeight="semi-bold">12.06 hrs</Typography.Text>
171
+ </View>
172
+ <View
173
+ testID="listItem1"
174
+ style={{ flexDirection: 'row', justifyContent: 'space-between' }}
175
+ >
176
+ <Typography.Text>Values Champion Award</Typography.Text>
177
+ <Typography.Text fontWeight="semi-bold">12.06 hrs</Typography.Text>
178
+ </View>
179
+ <View
180
+ testID="listItem1"
181
+ style={{ flexDirection: 'row', justifyContent: 'space-between' }}
182
+ >
183
+ <Typography.Text>Family and Domestic</Typography.Text>
184
+ <Typography.Text fontWeight="semi-bold">12.06 hrs</Typography.Text>
185
+ </View>
186
+ </View>
187
+ </Card>
188
+ );
189
+ };
190
+
191
+ const CardPlayground = () => {
192
+ const theme = useTheme();
193
+ return (
194
+ <Screen>
195
+ <View style={{ flexDirection: 'row', height: 250 }}>
196
+ <View style={{ flex: 1 }}>
197
+ <InductionCard
198
+ style={{
199
+ flex: 1,
200
+ margin: theme.space.small,
201
+ backgroundColor: theme.colors.primaryLight,
202
+ }}
203
+ />
204
+ </View>
205
+ <View style={{ flex: 1 }}>
206
+ <PoliciesCard
207
+ style={{
208
+ flex: 1,
209
+ backgroundColor: palette.dodgerBlueLight75,
210
+ margin: theme.space.small,
211
+ }}
212
+ testID="policies"
213
+ />
214
+ <CertificationsCard
215
+ style={{
216
+ flex: 1,
217
+ margin: theme.space.small,
218
+ backgroundColor: palette.dodgerBlueLight75,
219
+ }}
220
+ testID="certifications"
221
+ />
222
+ </View>
223
+ </View>
224
+ <Payslip
225
+ style={{
226
+ margin: theme.space.small,
227
+ }}
228
+ />
229
+ <MyLeaveCard
230
+ style={{
231
+ margin: theme.space.small,
232
+ }}
233
+ />
234
+ </Screen>
49
235
  );
50
236
  };
51
237
 
package/rollup.config.js CHANGED
@@ -4,6 +4,7 @@ import { babel } from '@rollup/plugin-babel';
4
4
  import typescript from '@rollup/plugin-typescript';
5
5
  import json from '@rollup/plugin-json';
6
6
  import replace from '@rollup/plugin-replace';
7
+ import copy from 'rollup-plugin-copy';
7
8
 
8
9
  import pkg from './package.json';
9
10
 
@@ -23,13 +24,21 @@ export default {
23
24
  ],
24
25
  external: ['react', 'react-native'],
25
26
  plugins: [
26
- replace(({
27
+ replace({
27
28
  'process.env.NODE_ENV': JSON.stringify('production'),
28
- })),
29
+ }),
29
30
  nodeResolve({ extensions, browser: true }),
30
31
  commonjs(),
31
32
  json(),
32
33
  typescript(),
33
34
  babel({ extensions, babelHelpers: 'bundled' }),
35
+ copy({
36
+ targets: [
37
+ {
38
+ src: 'assets/fonts/hero-icons.ttf',
39
+ dest: 'lib/assets/fonts',
40
+ },
41
+ ],
42
+ }),
34
43
  ],
35
44
  };
@@ -1,18 +1,18 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
1
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
2
2
  import React, { ReactElement } from 'react';
3
3
  import { StyledView, StyledText } from './StyledBadge';
4
4
 
5
- interface BadgeProps {
5
+ interface BadgeProps extends ViewProps {
6
6
  /**
7
- * Content of the `Badge`.
7
+ * Content of the Badge.
8
8
  */
9
9
  content: string;
10
10
  /**
11
- * Visual intent color to apply to `Badge`.
11
+ * Visual intent color to apply to Badge.
12
12
  */
13
13
  intent?: 'success' | 'warning' | 'danger' | 'info';
14
14
  /**
15
- * Addditional style to be applied for `Badge`.
15
+ * Addditional style.
16
16
  */
17
17
  style?: StyleProp<ViewStyle>;
18
18
  /**
@@ -26,8 +26,14 @@ const Badge = ({
26
26
  intent = 'info',
27
27
  style,
28
28
  testID,
29
+ ...nativeProps
29
30
  }: BadgeProps): ReactElement => (
30
- <StyledView testID={testID} themeIntent={intent} style={style}>
31
+ <StyledView
32
+ themeIntent={intent}
33
+ style={style}
34
+ testID={testID}
35
+ {...nativeProps}
36
+ >
31
37
  <StyledText themeIntent={intent}>{content}</StyledText>
32
38
  </StyledView>
33
39
  );
@@ -1,8 +1,21 @@
1
- import React from 'react';
2
- import { ViewProps } from 'react-native';
1
+ import React, { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
3
  import { StyledCard } from './StyledCard';
4
4
 
5
- interface CardProps extends ViewProps {}
5
+ interface CardProps extends ViewProps {
6
+ /**
7
+ * Card's content.
8
+ */
9
+ children?: ReactNode;
10
+ /**
11
+ * Addditional style.
12
+ */
13
+ style?: StyleProp<ViewStyle>;
14
+ /**
15
+ * Testing id of the component.
16
+ */
17
+ testID?: string;
18
+ }
6
19
 
7
20
  const Card = (props: CardProps): JSX.Element => <StyledCard {...props} />;
8
21
 
@@ -8,7 +8,7 @@ const StyledDivider = styled(View)<{
8
8
  themeMarginVertical?: MarginSize;
9
9
  }>`
10
10
  border-bottom-width: ${({ theme }) =>
11
- theme.__hd__.divider.borderWiths.default};
11
+ theme.__hd__.divider.borderWidths.default};
12
12
  border-bottom-color: ${({ theme }) => theme.__hd__.divider.colors.default};
13
13
  max-width: 100%;
14
14
 
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
2
3
  import { StyledDivider } from './StyledDivider';
3
4
 
4
- interface DividerProps {
5
+ interface DividerProps extends ViewProps {
5
6
  /**
6
7
  * Horizontal margin size. There is no margin by default.
7
8
  */
@@ -10,12 +11,29 @@ interface DividerProps {
10
11
  * Vertical margin size. There is no margin by default.
11
12
  */
12
13
  marginVertical?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
14
+ /**
15
+ * Addditional style.
16
+ */
17
+ style?: StyleProp<ViewStyle>;
18
+ /**
19
+ * Testing id of the component.
20
+ */
21
+ testID?: string;
13
22
  }
14
23
 
15
- const Divider = ({ marginHorizontal, marginVertical }: DividerProps) => (
24
+ const Divider = ({
25
+ marginHorizontal,
26
+ marginVertical,
27
+ style,
28
+ testID,
29
+ ...nativeProps
30
+ }: DividerProps) => (
16
31
  <StyledDivider
17
32
  themeMarginHorizontal={marginHorizontal}
18
33
  themeMarginVertical={marginVertical}
34
+ style={style}
35
+ testID={testID}
36
+ {...nativeProps}
19
37
  />
20
38
  );
21
39
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
2
+ import { StyleProp, TextStyle } from 'react-native';
3
3
  import IconList from './IconList';
4
4
  import HeroIcon from './HeroIcon';
5
5
 
@@ -7,21 +7,21 @@ type IconName = typeof IconList[number];
7
7
 
8
8
  interface IconProps {
9
9
  /**
10
- * Name of the `Icon`.
10
+ * Name of the Icon.
11
11
  */
12
12
  icon: IconName;
13
13
  /**
14
- * Addditional style to be applied for `Icon`.
14
+ * Intent of the Icon.
15
15
  */
16
- style?: StyleProp<ViewStyle>;
16
+ intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
17
17
  /**
18
- * Size of the `Icon`.
18
+ * Size of the Icon.
19
19
  */
20
20
  size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
21
21
  /**
22
- * Intent of the `Icon`.
22
+ * Addditional style.
23
23
  */
24
- intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
24
+ style?: StyleProp<TextStyle>;
25
25
  /**
26
26
  * Testing id of the component.
27
27
  */
@@ -1,5 +1,9 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { TextProps as NativeTextProps } from 'react-native';
2
+ import {
3
+ TextProps as NativeTextProps,
4
+ StyleProp,
5
+ TextStyle,
6
+ } from 'react-native';
3
7
  import { StyledText } from './StyledText';
4
8
 
5
9
  interface TextProps extends NativeTextProps {
@@ -19,6 +23,14 @@ interface TextProps extends NativeTextProps {
19
23
  * Visual intent color to apply to the text.
20
24
  */
21
25
  intent?: 'body' | 'subdued';
26
+ /**
27
+ * Addditional style.
28
+ */
29
+ style?: StyleProp<TextStyle>;
30
+ /**
31
+ * Testing id of the component.
32
+ */
33
+ testID?: string;
22
34
  }
23
35
 
24
36
  const Text = ({
@@ -39,7 +39,7 @@ Object {
39
39
  },
40
40
  },
41
41
  "divider": Object {
42
- "borderWiths": Object {
42
+ "borderWidths": Object {
43
43
  "default": "1px",
44
44
  },
45
45
  "colors": Object {
@@ -13,11 +13,11 @@ const getDividerTheme = (theme: GlobalTheme) => {
13
13
  xlarge: `${theme.space.xlarge}px`,
14
14
  };
15
15
 
16
- const borderWiths = {
16
+ const borderWidths = {
17
17
  default: `${theme.borderWidths.base}px`,
18
18
  };
19
19
 
20
- return { colors, space, borderWiths };
20
+ return { colors, space, borderWidths };
21
21
  };
22
22
 
23
23
  export default getDividerTheme;
@@ -1,16 +1,16 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
1
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
2
2
  import { ReactElement } from 'react';
3
- interface BadgeProps {
3
+ interface BadgeProps extends ViewProps {
4
4
  /**
5
- * Content of the `Badge`.
5
+ * Content of the Badge.
6
6
  */
7
7
  content: string;
8
8
  /**
9
- * Visual intent color to apply to `Badge`.
9
+ * Visual intent color to apply to Badge.
10
10
  */
11
11
  intent?: 'success' | 'warning' | 'danger' | 'info';
12
12
  /**
13
- * Addditional style to be applied for `Badge`.
13
+ * Addditional style.
14
14
  */
15
15
  style?: StyleProp<ViewStyle>;
16
16
  /**
@@ -18,5 +18,5 @@ interface BadgeProps {
18
18
  */
19
19
  testID?: string;
20
20
  }
21
- declare const Badge: ({ content, intent, style, testID, }: BadgeProps) => ReactElement;
21
+ declare const Badge: ({ content, intent, style, testID, ...nativeProps }: BadgeProps) => ReactElement;
22
22
  export default Badge;
@@ -1,5 +1,18 @@
1
- import { ViewProps } from 'react-native';
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
2
3
  interface CardProps extends ViewProps {
4
+ /**
5
+ * Card's content.
6
+ */
7
+ children?: ReactNode;
8
+ /**
9
+ * Addditional style.
10
+ */
11
+ style?: StyleProp<ViewStyle>;
12
+ /**
13
+ * Testing id of the component.
14
+ */
15
+ testID?: string;
3
16
  }
4
17
  declare const Card: (props: CardProps) => JSX.Element;
5
18
  export default Card;
@@ -1,4 +1,5 @@
1
- interface DividerProps {
1
+ import { StyleProp, ViewStyle, ViewProps } from 'react-native';
2
+ interface DividerProps extends ViewProps {
2
3
  /**
3
4
  * Horizontal margin size. There is no margin by default.
4
5
  */
@@ -7,6 +8,14 @@ interface DividerProps {
7
8
  * Vertical margin size. There is no margin by default.
8
9
  */
9
10
  marginVertical?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
11
+ /**
12
+ * Addditional style.
13
+ */
14
+ style?: StyleProp<ViewStyle>;
15
+ /**
16
+ * Testing id of the component.
17
+ */
18
+ testID?: string;
10
19
  }
11
- declare const Divider: ({ marginHorizontal, marginVertical }: DividerProps) => JSX.Element;
20
+ declare const Divider: ({ marginHorizontal, marginVertical, style, testID, ...nativeProps }: DividerProps) => JSX.Element;
12
21
  export default Divider;
@@ -1,23 +1,23 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
1
+ import { StyleProp, TextStyle } from 'react-native';
2
2
  import IconList from './IconList';
3
3
  declare type IconName = typeof IconList[number];
4
4
  interface IconProps {
5
5
  /**
6
- * Name of the `Icon`.
6
+ * Name of the Icon.
7
7
  */
8
8
  icon: IconName;
9
9
  /**
10
- * Addditional style to be applied for `Icon`.
10
+ * Intent of the Icon.
11
11
  */
12
- style?: StyleProp<ViewStyle>;
12
+ intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
13
13
  /**
14
- * Size of the `Icon`.
14
+ * Size of the Icon.
15
15
  */
16
16
  size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
17
17
  /**
18
- * Intent of the `Icon`.
18
+ * Addditional style.
19
19
  */
20
- intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
20
+ style?: StyleProp<TextStyle>;
21
21
  /**
22
22
  * Testing id of the component.
23
23
  */
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { TextProps as NativeTextProps } from 'react-native';
2
+ import { TextProps as NativeTextProps, StyleProp, TextStyle } from 'react-native';
3
3
  interface TextProps extends NativeTextProps {
4
4
  /**
5
5
  * Text content.
@@ -17,6 +17,14 @@ interface TextProps extends NativeTextProps {
17
17
  * Visual intent color to apply to the text.
18
18
  */
19
19
  intent?: 'body' | 'subdued';
20
+ /**
21
+ * Addditional style.
22
+ */
23
+ style?: StyleProp<TextStyle>;
24
+ /**
25
+ * Testing id of the component.
26
+ */
27
+ testID?: string;
20
28
  }
21
29
  declare const Text: ({ children, fontSize, fontWeight, intent, ...nativeProps }: TextProps) => JSX.Element;
22
30
  export default Text;
@@ -10,7 +10,7 @@ declare const getDividerTheme: (theme: GlobalTheme) => {
10
10
  large: string;
11
11
  xlarge: string;
12
12
  };
13
- borderWiths: {
13
+ borderWidths: {
14
14
  default: string;
15
15
  };
16
16
  };