@hero-design/rn 7.0.3 → 7.0.6
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 +28 -14
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +28 -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/components/Card/StyledCard.d.ts +3 -0
- package/types/components/Card/__tests__/Card.spec.d.ts +1 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
- package/types/components/Card/index.d.ts +5 -0
- package/types/components/Divider/StyledDivider.d.ts +7 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
- package/types/components/Divider/index.d.ts +12 -0
- package/types/index.d.ts +4 -3
- 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/types/theme/__tests__/index.spec.d.ts +1 -0
- package/types/theme/components/card.d.ts +10 -0
- package/types/theme/components/divider.d.ts +17 -0
- package/types/theme/global/borders.d.ts +4 -0
- package/types/theme/global/colors.d.ts +2 -0
- package/types/theme/global/index.d.ts +5 -0
- package/types/theme/index.d.ts +4 -2
- package/types/theme/colors.d.ts +0 -24
- package/types/theme/components/demoStyle.d.ts +0 -11
- package/types/theme/space.d.ts +0 -12
- package/types/theme/typography.d.ts +0 -21
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 = [];
|
|
@@ -9780,6 +9780,7 @@ var palette = {
|
|
|
9780
9780
|
greenDark30: '#017d6d',
|
|
9781
9781
|
greenDark75: '#002d27',
|
|
9782
9782
|
greenLight30: '#4dcaba',
|
|
9783
|
+
greenLight75: '#c0ece6',
|
|
9783
9784
|
greenLight90: '#e6f7f5',
|
|
9784
9785
|
grey: '#a3a6ac',
|
|
9785
9786
|
greyDark15: '#8b8d92',
|
|
@@ -9819,6 +9820,7 @@ var palette = {
|
|
|
9819
9820
|
redDark15: '#bd2d09',
|
|
9820
9821
|
redDark30: '#9b2508',
|
|
9821
9822
|
redDark75: '#380d03',
|
|
9823
|
+
redLight15: '#e35330',
|
|
9822
9824
|
redLight30: '#e87254',
|
|
9823
9825
|
redLight60: '#f2ae9d',
|
|
9824
9826
|
redLight75: '#f7cdc2',
|
|
@@ -9983,13 +9985,13 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
9983
9985
|
large: "".concat(theme.space.large, "px"),
|
|
9984
9986
|
xlarge: "".concat(theme.space.xlarge, "px")
|
|
9985
9987
|
};
|
|
9986
|
-
var
|
|
9988
|
+
var borderWidths = {
|
|
9987
9989
|
"default": "".concat(theme.borderWidths.base, "px")
|
|
9988
9990
|
};
|
|
9989
9991
|
return {
|
|
9990
9992
|
colors: colors,
|
|
9991
9993
|
space: space,
|
|
9992
|
-
|
|
9994
|
+
borderWidths: borderWidths
|
|
9993
9995
|
};
|
|
9994
9996
|
};
|
|
9995
9997
|
|
|
@@ -10100,17 +10102,21 @@ var StyledText$1 = styled(Text$1)(_templateObject3$2 || (_templateObject3$2 = _t
|
|
|
10100
10102
|
});
|
|
10101
10103
|
});
|
|
10102
10104
|
|
|
10105
|
+
var _excluded$2 = ["content", "intent", "style", "testID"];
|
|
10106
|
+
|
|
10103
10107
|
var Badge = function Badge(_ref) {
|
|
10104
10108
|
var content = _ref.content,
|
|
10105
10109
|
_ref$intent = _ref.intent,
|
|
10106
10110
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
10107
10111
|
style = _ref.style,
|
|
10108
|
-
testID = _ref.testID
|
|
10109
|
-
|
|
10110
|
-
|
|
10112
|
+
testID = _ref.testID,
|
|
10113
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
10114
|
+
|
|
10115
|
+
return /*#__PURE__*/React.createElement(StyledView, _extends$1({
|
|
10111
10116
|
themeIntent: intent,
|
|
10112
|
-
style: style
|
|
10113
|
-
|
|
10117
|
+
style: style,
|
|
10118
|
+
testID: testID
|
|
10119
|
+
}, nativeProps), /*#__PURE__*/React.createElement(StyledText$1, {
|
|
10114
10120
|
themeIntent: intent
|
|
10115
10121
|
}, content));
|
|
10116
10122
|
};
|
|
@@ -10131,7 +10137,7 @@ var Card = function Card(props) {
|
|
|
10131
10137
|
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
10138
|
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
10139
|
var theme = _ref.theme;
|
|
10134
|
-
return theme.__hd__.divider.
|
|
10140
|
+
return theme.__hd__.divider.borderWidths["default"];
|
|
10135
10141
|
}, function (_ref2) {
|
|
10136
10142
|
var theme = _ref2.theme;
|
|
10137
10143
|
return theme.__hd__.divider.colors["default"];
|
|
@@ -10183,13 +10189,21 @@ var StyledDivider = styled(View)(_templateObject$2 || (_templateObject$2 = _tagg
|
|
|
10183
10189
|
}
|
|
10184
10190
|
});
|
|
10185
10191
|
|
|
10192
|
+
var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
10193
|
+
|
|
10186
10194
|
var Divider = function Divider(_ref) {
|
|
10187
10195
|
var marginHorizontal = _ref.marginHorizontal,
|
|
10188
|
-
marginVertical = _ref.marginVertical
|
|
10189
|
-
|
|
10196
|
+
marginVertical = _ref.marginVertical,
|
|
10197
|
+
style = _ref.style,
|
|
10198
|
+
testID = _ref.testID,
|
|
10199
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
10200
|
+
|
|
10201
|
+
return /*#__PURE__*/React.createElement(StyledDivider, _extends$1({
|
|
10190
10202
|
themeMarginHorizontal: marginHorizontal,
|
|
10191
|
-
themeMarginVertical: marginVertical
|
|
10192
|
-
|
|
10203
|
+
themeMarginVertical: marginVertical,
|
|
10204
|
+
style: style,
|
|
10205
|
+
testID: testID
|
|
10206
|
+
}, nativeProps));
|
|
10193
10207
|
};
|
|
10194
10208
|
|
|
10195
10209
|
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 = [];
|
|
@@ -9789,6 +9789,7 @@ var palette = {
|
|
|
9789
9789
|
greenDark30: '#017d6d',
|
|
9790
9790
|
greenDark75: '#002d27',
|
|
9791
9791
|
greenLight30: '#4dcaba',
|
|
9792
|
+
greenLight75: '#c0ece6',
|
|
9792
9793
|
greenLight90: '#e6f7f5',
|
|
9793
9794
|
grey: '#a3a6ac',
|
|
9794
9795
|
greyDark15: '#8b8d92',
|
|
@@ -9828,6 +9829,7 @@ var palette = {
|
|
|
9828
9829
|
redDark15: '#bd2d09',
|
|
9829
9830
|
redDark30: '#9b2508',
|
|
9830
9831
|
redDark75: '#380d03',
|
|
9832
|
+
redLight15: '#e35330',
|
|
9831
9833
|
redLight30: '#e87254',
|
|
9832
9834
|
redLight60: '#f2ae9d',
|
|
9833
9835
|
redLight75: '#f7cdc2',
|
|
@@ -9992,13 +9994,13 @@ var getDividerTheme = function getDividerTheme(theme) {
|
|
|
9992
9994
|
large: "".concat(theme.space.large, "px"),
|
|
9993
9995
|
xlarge: "".concat(theme.space.xlarge, "px")
|
|
9994
9996
|
};
|
|
9995
|
-
var
|
|
9997
|
+
var borderWidths = {
|
|
9996
9998
|
"default": "".concat(theme.borderWidths.base, "px")
|
|
9997
9999
|
};
|
|
9998
10000
|
return {
|
|
9999
10001
|
colors: colors,
|
|
10000
10002
|
space: space,
|
|
10001
|
-
|
|
10003
|
+
borderWidths: borderWidths
|
|
10002
10004
|
};
|
|
10003
10005
|
};
|
|
10004
10006
|
|
|
@@ -10109,17 +10111,21 @@ var StyledText$1 = styled(require$$0$1.Text)(_templateObject3$2 || (_templateObj
|
|
|
10109
10111
|
});
|
|
10110
10112
|
});
|
|
10111
10113
|
|
|
10114
|
+
var _excluded$2 = ["content", "intent", "style", "testID"];
|
|
10115
|
+
|
|
10112
10116
|
var Badge = function Badge(_ref) {
|
|
10113
10117
|
var content = _ref.content,
|
|
10114
10118
|
_ref$intent = _ref.intent,
|
|
10115
10119
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
10116
10120
|
style = _ref.style,
|
|
10117
|
-
testID = _ref.testID
|
|
10118
|
-
|
|
10119
|
-
|
|
10121
|
+
testID = _ref.testID,
|
|
10122
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
10123
|
+
|
|
10124
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledView, _extends$1({
|
|
10120
10125
|
themeIntent: intent,
|
|
10121
|
-
style: style
|
|
10122
|
-
|
|
10126
|
+
style: style,
|
|
10127
|
+
testID: testID
|
|
10128
|
+
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledText$1, {
|
|
10123
10129
|
themeIntent: intent
|
|
10124
10130
|
}, content));
|
|
10125
10131
|
};
|
|
@@ -10140,7 +10146,7 @@ var Card = function Card(props) {
|
|
|
10140
10146
|
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
10147
|
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
10148
|
var theme = _ref.theme;
|
|
10143
|
-
return theme.__hd__.divider.
|
|
10149
|
+
return theme.__hd__.divider.borderWidths["default"];
|
|
10144
10150
|
}, function (_ref2) {
|
|
10145
10151
|
var theme = _ref2.theme;
|
|
10146
10152
|
return theme.__hd__.divider.colors["default"];
|
|
@@ -10192,13 +10198,21 @@ var StyledDivider = styled(require$$0$1.View)(_templateObject$2 || (_templateObj
|
|
|
10192
10198
|
}
|
|
10193
10199
|
});
|
|
10194
10200
|
|
|
10201
|
+
var _excluded$1 = ["marginHorizontal", "marginVertical", "style", "testID"];
|
|
10202
|
+
|
|
10195
10203
|
var Divider = function Divider(_ref) {
|
|
10196
10204
|
var marginHorizontal = _ref.marginHorizontal,
|
|
10197
|
-
marginVertical = _ref.marginVertical
|
|
10198
|
-
|
|
10205
|
+
marginVertical = _ref.marginVertical,
|
|
10206
|
+
style = _ref.style,
|
|
10207
|
+
testID = _ref.testID,
|
|
10208
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
10209
|
+
|
|
10210
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledDivider, _extends$1({
|
|
10199
10211
|
themeMarginHorizontal: marginHorizontal,
|
|
10200
|
-
themeMarginVertical: marginVertical
|
|
10201
|
-
|
|
10212
|
+
themeMarginVertical: marginVertical,
|
|
10213
|
+
style: style,
|
|
10214
|
+
testID: testID
|
|
10215
|
+
}, nativeProps));
|
|
10202
10216
|
};
|
|
10203
10217
|
|
|
10204
10218
|
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.6",
|
|
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.6",
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
declare type MarginSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
3
|
+
declare const StyledDivider: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {
|
|
4
|
+
themeMarginHorizontal?: MarginSize | undefined;
|
|
5
|
+
themeMarginVertical?: MarginSize | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
export { StyledDivider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface DividerProps {
|
|
2
|
+
/**
|
|
3
|
+
* Horizontal margin size. There is no margin by default.
|
|
4
|
+
*/
|
|
5
|
+
marginHorizontal?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
6
|
+
/**
|
|
7
|
+
* Vertical margin size. There is no margin by default.
|
|
8
|
+
*/
|
|
9
|
+
marginVertical?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
10
|
+
}
|
|
11
|
+
declare const Divider: ({ marginHorizontal, marginVertical }: DividerProps) => JSX.Element;
|
|
12
|
+
export default Divider;
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ThemeProvider, useTheme } from '
|
|
1
|
+
import { ThemeProvider, useTheme } from 'styled-components-native';
|
|
2
2
|
import theme, { getTheme } from './theme';
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import Divider from './components/Divider';
|
|
4
|
+
import Card from './components/Card';
|
|
5
|
+
export { theme, getTheme, useTheme, ThemeProvider, Divider, Card };
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
declare const getDividerTheme: (theme: GlobalTheme) => {
|
|
3
|
+
colors: {
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
space: {
|
|
7
|
+
xsmall: string;
|
|
8
|
+
small: string;
|
|
9
|
+
medium: string;
|
|
10
|
+
large: string;
|
|
11
|
+
xlarge: string;
|
|
12
|
+
};
|
|
13
|
+
borderWiths: {
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default getDividerTheme;
|
|
@@ -16,9 +16,11 @@ declare const systemPalette: {
|
|
|
16
16
|
warningDark: string;
|
|
17
17
|
warningBackground: string;
|
|
18
18
|
platformBackground: string;
|
|
19
|
+
backgroundLight: string;
|
|
19
20
|
backgroundDark: string;
|
|
20
21
|
text: string;
|
|
21
22
|
disabledText: string;
|
|
22
23
|
invertedText: string;
|
|
24
|
+
outline: string;
|
|
23
25
|
};
|
|
24
26
|
export { palette, systemPalette };
|
|
@@ -16,10 +16,12 @@ declare const globalTheme: {
|
|
|
16
16
|
warningDark: string;
|
|
17
17
|
warningBackground: string;
|
|
18
18
|
platformBackground: string;
|
|
19
|
+
backgroundLight: string;
|
|
19
20
|
backgroundDark: string;
|
|
20
21
|
text: string;
|
|
21
22
|
disabledText: string;
|
|
22
23
|
invertedText: string;
|
|
24
|
+
outline: string;
|
|
23
25
|
};
|
|
24
26
|
space: {
|
|
25
27
|
xxsmall: number;
|
|
@@ -52,6 +54,9 @@ declare const globalTheme: {
|
|
|
52
54
|
small: number;
|
|
53
55
|
xsmall: number;
|
|
54
56
|
};
|
|
57
|
+
borderWidths: {
|
|
58
|
+
base: number;
|
|
59
|
+
};
|
|
55
60
|
};
|
|
56
61
|
declare type GlobalTheme = typeof globalTheme;
|
|
57
62
|
export { GlobalTheme };
|
package/types/theme/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { GlobalTheme } from './global';
|
|
2
|
-
import
|
|
2
|
+
import getDividerTheme from './components/divider';
|
|
3
|
+
import getCardTheme from './components/card';
|
|
3
4
|
declare type Theme = GlobalTheme & {
|
|
4
5
|
__hd__: {
|
|
5
|
-
|
|
6
|
+
divider: ReturnType<typeof getDividerTheme>;
|
|
7
|
+
card: ReturnType<typeof getCardTheme>;
|
|
6
8
|
};
|
|
7
9
|
};
|
|
8
10
|
declare const getTheme: (theme?: GlobalTheme) => Theme;
|
package/types/theme/colors.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { palette } from '@hero-design/colors';
|
|
2
|
-
declare const systemPalette: {
|
|
3
|
-
primary: string;
|
|
4
|
-
primaryLight: string;
|
|
5
|
-
info: string;
|
|
6
|
-
infoLight: string;
|
|
7
|
-
infoBackground: string;
|
|
8
|
-
success: string;
|
|
9
|
-
successDark: string;
|
|
10
|
-
successLight: string;
|
|
11
|
-
successBackground: string;
|
|
12
|
-
danger: string;
|
|
13
|
-
dangerLight: string;
|
|
14
|
-
dangerBackground: string;
|
|
15
|
-
warning: string;
|
|
16
|
-
warningDark: string;
|
|
17
|
-
warningBackground: string;
|
|
18
|
-
platformBackground: string;
|
|
19
|
-
backgroundDark: string;
|
|
20
|
-
text: string;
|
|
21
|
-
disabledText: string;
|
|
22
|
-
invertedText: string;
|
|
23
|
-
};
|
|
24
|
-
export { palette, systemPalette };
|
package/types/theme/space.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
declare const fontSizes: {
|
|
2
|
-
xlarge: number;
|
|
3
|
-
large: number;
|
|
4
|
-
medium: number;
|
|
5
|
-
small: number;
|
|
6
|
-
xsmall: number;
|
|
7
|
-
};
|
|
8
|
-
declare const fontWeights: {
|
|
9
|
-
light: number;
|
|
10
|
-
regular: number;
|
|
11
|
-
semiBold: number;
|
|
12
|
-
bold: number;
|
|
13
|
-
};
|
|
14
|
-
declare const lineHeights: {
|
|
15
|
-
xlarge: number;
|
|
16
|
-
large: number;
|
|
17
|
-
medium: number;
|
|
18
|
-
small: number;
|
|
19
|
-
xsmall: number;
|
|
20
|
-
};
|
|
21
|
-
export { fontSizes, fontWeights, lineHeights };
|