@hero-design/rn 7.0.4 → 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 +26 -14
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +26 -14
- package/package.json +5 -3
- package/playground/components/Card.tsx +2 -2
- package/rollup.config.js +11 -2
- package/src/components/Badge/index.tsx +12 -6
- package/src/components/Card/index.tsx +16 -3
- package/src/components/Divider/StyledDivider.tsx +1 -1
- package/src/components/Divider/index.tsx +20 -2
- package/src/components/Icon/index.tsx +7 -7
- package/src/components/Typography/Text/{__test__ → __tests__}/StyledText.spec.tsx +0 -0
- package/src/components/Typography/Text/{__test__ → __tests__}/__snapshots__/StyledText.spec.tsx.snap +0 -0
- package/src/components/Typography/Text/{__test__ → __tests__}/index.spec.tsx +0 -0
- package/src/components/Typography/Text/index.tsx +13 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
- package/src/theme/components/divider.ts +2 -2
- package/types/src/components/Badge/index.d.ts +6 -6
- package/types/src/components/Card/index.d.ts +14 -1
- package/types/src/components/Divider/index.d.ts +11 -2
- package/types/src/components/Icon/index.d.ts +7 -7
- package/types/src/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
- package/types/src/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Typography/Text/index.d.ts +9 -1
- package/types/src/theme/components/divider.d.ts +1 -1
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$
|
|
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$
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
10110
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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$
|
|
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$
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
10119
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
|
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.
|
|
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
|
},
|
|
@@ -141,8 +141,8 @@ const MyLeaveCard = (props: ViewProps) => {
|
|
|
141
141
|
My Leave
|
|
142
142
|
</Typography.Text>
|
|
143
143
|
|
|
144
|
-
<View style={{ flexDirection: 'row' }}>
|
|
145
|
-
<Typography.Text fontWeight="semi-bold">Add /view</Typography.Text>
|
|
144
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
145
|
+
<Typography.Text fontWeight="semi-bold">Add / view</Typography.Text>
|
|
146
146
|
<Icon
|
|
147
147
|
icon="circle-add-outlined"
|
|
148
148
|
size="xsmall"
|
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
|
|
7
|
+
* Content of the Badge.
|
|
8
8
|
*/
|
|
9
9
|
content: string;
|
|
10
10
|
/**
|
|
11
|
-
* Visual intent color to apply to
|
|
11
|
+
* Visual intent color to apply to Badge.
|
|
12
12
|
*/
|
|
13
13
|
intent?: 'success' | 'warning' | 'danger' | 'info';
|
|
14
14
|
/**
|
|
15
|
-
* Addditional style
|
|
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
|
|
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.
|
|
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 = ({
|
|
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,
|
|
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
|
|
10
|
+
* Name of the Icon.
|
|
11
11
|
*/
|
|
12
12
|
icon: IconName;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Intent of the Icon.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
17
17
|
/**
|
|
18
|
-
* Size of the
|
|
18
|
+
* Size of the Icon.
|
|
19
19
|
*/
|
|
20
20
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Addditional style.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
style?: StyleProp<TextStyle>;
|
|
25
25
|
/**
|
|
26
26
|
* Testing id of the component.
|
|
27
27
|
*/
|
|
File without changes
|
package/src/components/Typography/Text/{__test__ → __tests__}/__snapshots__/StyledText.spec.tsx.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
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 = ({
|
|
@@ -13,11 +13,11 @@ const getDividerTheme = (theme: GlobalTheme) => {
|
|
|
13
13
|
xlarge: `${theme.space.xlarge}px`,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const borderWidths = {
|
|
17
17
|
default: `${theme.borderWidths.base}px`,
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
return { colors, space,
|
|
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
|
|
5
|
+
* Content of the Badge.
|
|
6
6
|
*/
|
|
7
7
|
content: string;
|
|
8
8
|
/**
|
|
9
|
-
* Visual intent color to apply to
|
|
9
|
+
* Visual intent color to apply to Badge.
|
|
10
10
|
*/
|
|
11
11
|
intent?: 'success' | 'warning' | 'danger' | 'info';
|
|
12
12
|
/**
|
|
13
|
-
* Addditional style
|
|
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 {
|
|
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
|
-
|
|
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,
|
|
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
|
|
6
|
+
* Name of the Icon.
|
|
7
7
|
*/
|
|
8
8
|
icon: IconName;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Intent of the Icon.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
13
13
|
/**
|
|
14
|
-
* Size of the
|
|
14
|
+
* Size of the Icon.
|
|
15
15
|
*/
|
|
16
16
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Addditional style.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
style?: StyleProp<TextStyle>;
|
|
21
21
|
/**
|
|
22
22
|
* Testing id of the component.
|
|
23
23
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|