@twreporter/react-components 8.9.0 → 8.10.0-rc.0
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/CHANGELOG.md +16 -0
- package/lib/button/components/iconWithTextButton.js +17 -4
- package/lib/button/stories/iconWithTextButton.stories.js +4 -2
- package/lib/button/utils/theme.js +1 -1
- package/lib/snack-bar/components/snack-bar.js +54 -0
- package/lib/snack-bar/index.js +21 -0
- package/lib/snack-bar/stories/snackBar.stories.js +28 -0
- package/lib/snack-bar/utils/theme.js +31 -0
- package/lib/text/headline.js +65 -49
- package/lib/text/paragraph.js +28 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.10.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.9.0...@twreporter/react-components@8.10.0-rc.0) (2022-06-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* adjustment style & animation ([1694069](https://github.com/twreporter/twreporter-npm-packages/commit/1694069e769e685b6ec892e0d736111023c1319a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add article tool bar & snackbar component ([942328d](https://github.com/twreporter/twreporter-npm-packages/commit/942328d7f9175a39bf74f3650f148e29e5d12274))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.9.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.9.0-rc.6...@twreporter/react-components@8.9.0) (2022-06-07)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @twreporter/react-components
|
|
@@ -36,6 +36,15 @@ var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
36
36
|
return props.hoverColor;
|
|
37
37
|
}));
|
|
38
38
|
|
|
39
|
+
var StyledP4 = /*#__PURE__*/(0, _styledComponents["default"])(_paragraph.P4).withConfig({
|
|
40
|
+
displayName: "iconWithTextButton__StyledP4",
|
|
41
|
+
componentId: "sc-1f9d1q4-1"
|
|
42
|
+
})(["max-height:", ";opacity:", ";transition:opacity 100ms;"], function (props) {
|
|
43
|
+
return props.hideText ? '0px' : 'none';
|
|
44
|
+
}, function (props) {
|
|
45
|
+
return props.hideText ? '0' : '1';
|
|
46
|
+
});
|
|
47
|
+
|
|
39
48
|
var IconWithTextButton = function IconWithTextButton(_ref) {
|
|
40
49
|
var _ref$text = _ref.text,
|
|
41
50
|
text = _ref$text === void 0 ? '' : _ref$text,
|
|
@@ -45,7 +54,9 @@ var IconWithTextButton = function IconWithTextButton(_ref) {
|
|
|
45
54
|
_ref$disabled = _ref.disabled,
|
|
46
55
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
47
56
|
_ref$active = _ref.active,
|
|
48
|
-
active = _ref$active === void 0 ? false : _ref$active
|
|
57
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
58
|
+
_ref$hideText = _ref.hideText,
|
|
59
|
+
hideText = _ref$hideText === void 0 ? false : _ref$hideText;
|
|
49
60
|
|
|
50
61
|
var _getIconWithTextButto = (0, _theme.getIconWithTextButtonTheme)(theme, active, disabled),
|
|
51
62
|
color = _getIconWithTextButto.color,
|
|
@@ -54,9 +65,10 @@ var IconWithTextButton = function IconWithTextButton(_ref) {
|
|
|
54
65
|
return /*#__PURE__*/_react["default"].createElement(ButtonContainer, {
|
|
55
66
|
color: color,
|
|
56
67
|
hoverColor: hoverColor
|
|
57
|
-
}, iconComponent, /*#__PURE__*/_react["default"].createElement(
|
|
68
|
+
}, iconComponent, /*#__PURE__*/_react["default"].createElement(StyledP4, {
|
|
58
69
|
text: text,
|
|
59
|
-
weight: "bold"
|
|
70
|
+
weight: "bold",
|
|
71
|
+
hideText: hideText
|
|
60
72
|
}));
|
|
61
73
|
};
|
|
62
74
|
|
|
@@ -65,7 +77,8 @@ IconWithTextButton.propTypes = {
|
|
|
65
77
|
iconComponent: _propTypes["default"].element.isRequired,
|
|
66
78
|
theme: _propTypes["default"].oneOf(['normal', 'photography', 'transparent', 'index']),
|
|
67
79
|
disabled: _propTypes["default"].bool,
|
|
68
|
-
active: _propTypes["default"].bool
|
|
80
|
+
active: _propTypes["default"].bool,
|
|
81
|
+
hideText: _propTypes["default"].bool
|
|
69
82
|
};
|
|
70
83
|
var _default = IconWithTextButton;
|
|
71
84
|
exports["default"] = _default;
|
|
@@ -32,7 +32,8 @@ iconWithTextButton.args = {
|
|
|
32
32
|
}),
|
|
33
33
|
theme: 'normal',
|
|
34
34
|
disabled: false,
|
|
35
|
-
active: false
|
|
35
|
+
active: false,
|
|
36
|
+
hideText: false
|
|
36
37
|
};
|
|
37
38
|
var shareButton = Template.bind({});
|
|
38
39
|
exports.shareButton = shareButton;
|
|
@@ -41,5 +42,6 @@ shareButton.args = {
|
|
|
41
42
|
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
42
43
|
theme: 'normal',
|
|
43
44
|
disabled: false,
|
|
44
|
-
active: false
|
|
45
|
+
active: false,
|
|
46
|
+
hideText: false
|
|
45
47
|
};
|
|
@@ -229,7 +229,7 @@ var getIconWithTextButtonTheme = function getIconWithTextButtonTheme(theme, isAc
|
|
|
229
229
|
switch (switchKey) {
|
|
230
230
|
case 'photography':
|
|
231
231
|
return {
|
|
232
|
-
color: _color.colorGrayscale.
|
|
232
|
+
color: _color.colorGrayscale.gray200,
|
|
233
233
|
hoverColor: _color.colorSupportive.main
|
|
234
234
|
};
|
|
235
235
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../utils/theme");
|
|
15
|
+
|
|
16
|
+
var _paragraph = require("../../text/paragraph");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
// util
|
|
21
|
+
// component
|
|
22
|
+
var SnackBarContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
23
|
+
displayName: "snack-bar__SnackBarContainer",
|
|
24
|
+
componentId: "roennm-0"
|
|
25
|
+
})(["width:fit-content;padding:8px 16px;box-shadow:0px 0px 24px rgba(0,0,0,0.1);border-radius:4px;display:flex;align-items:center;color:", ";background-color:", ";"], function (props) {
|
|
26
|
+
return props.color;
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return props.bgColor;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var SnackBar = function SnackBar(_ref) {
|
|
32
|
+
var _ref$text = _ref.text,
|
|
33
|
+
text = _ref$text === void 0 ? '' : _ref$text,
|
|
34
|
+
_ref$theme = _ref.theme,
|
|
35
|
+
theme = _ref$theme === void 0 ? 'normal' : _ref$theme;
|
|
36
|
+
|
|
37
|
+
var _getSnackBarTheme = (0, _theme.getSnackBarTheme)(theme),
|
|
38
|
+
color = _getSnackBarTheme.color,
|
|
39
|
+
bgColor = _getSnackBarTheme.bgColor;
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(SnackBarContainer, {
|
|
42
|
+
color: color,
|
|
43
|
+
bgColor: bgColor
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement(_paragraph.P3, {
|
|
45
|
+
text: text
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
SnackBar.propTypes = {
|
|
50
|
+
text: _propTypes["default"].string,
|
|
51
|
+
theme: _propTypes["default"].oneOf(['normal', 'photography', 'transparent', 'index'])
|
|
52
|
+
};
|
|
53
|
+
var _default = SnackBar;
|
|
54
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SnackBar", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _snackBar["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports["default"] = void 0;
|
|
13
|
+
|
|
14
|
+
var _snackBar = _interopRequireDefault(require("./components/snack-bar"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
var _default = {
|
|
19
|
+
SnackBar: _snackBar["default"]
|
|
20
|
+
};
|
|
21
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.snackBar = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _snackBar = _interopRequireDefault(require("../components/snack-bar"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Snack Bar',
|
|
16
|
+
component: _snackBar["default"]
|
|
17
|
+
};
|
|
18
|
+
exports["default"] = _default;
|
|
19
|
+
|
|
20
|
+
var snackBar = function snackBar(props) {
|
|
21
|
+
return /*#__PURE__*/_react["default"].createElement(_snackBar["default"], props);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.snackBar = snackBar;
|
|
25
|
+
snackBar.args = {
|
|
26
|
+
text: '系統作業文字',
|
|
27
|
+
theme: 'normal'
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.getSnackBarTheme = void 0;
|
|
7
|
+
|
|
8
|
+
var _color = require("@twreporter/core/lib/constants/color");
|
|
9
|
+
|
|
10
|
+
var getSnackBarTheme = function getSnackBarTheme(theme) {
|
|
11
|
+
switch (theme) {
|
|
12
|
+
case 'photography':
|
|
13
|
+
return {
|
|
14
|
+
color: _color.colorGrayscale.gray800,
|
|
15
|
+
bgColor: _color.colorGrayscale.gray200
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
case 'normal':
|
|
19
|
+
default:
|
|
20
|
+
return {
|
|
21
|
+
color: _color.colorGrayscale.white,
|
|
22
|
+
bgColor: _color.colorGrayscale.gray800
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.getSnackBarTheme = getSnackBarTheme;
|
|
28
|
+
var _default = {
|
|
29
|
+
getSnackBarTheme: getSnackBarTheme
|
|
30
|
+
};
|
|
31
|
+
exports["default"] = _default;
|
package/lib/text/headline.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -11,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
9
|
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
11
|
|
|
14
|
-
var _styledComponents =
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
13
|
|
|
16
14
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
17
15
|
|
|
@@ -19,55 +17,49 @@ var _font = require("@twreporter/core/lib/constants/font");
|
|
|
19
17
|
|
|
20
18
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
21
19
|
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
21
|
|
|
28
22
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
29
23
|
|
|
30
|
-
var
|
|
24
|
+
var DefaultContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
25
|
+
displayName: "headline__DefaultContainer",
|
|
26
|
+
componentId: "axdp97-0"
|
|
27
|
+
})(["font-weight:", ";"], _font.fontWeight.bold);
|
|
31
28
|
|
|
32
|
-
var H1Container = /*#__PURE__*/_styledComponents["default"].
|
|
29
|
+
var H1Container = /*#__PURE__*/(0, _styledComponents["default"])(DefaultContainer).withConfig({
|
|
33
30
|
displayName: "headline__H1Container",
|
|
34
|
-
componentId: "axdp97-
|
|
35
|
-
})(["
|
|
31
|
+
componentId: "axdp97-1"
|
|
32
|
+
})(["line-height:125%;font-size:36px;font-family:", ";", ""], function (props) {
|
|
36
33
|
return props.type === 'default' ? _font.fontFamily["default"] : _font.fontFamily.title;
|
|
37
34
|
}, _mediaQuery["default"].tabletAndBelow(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 32px;\n "]))));
|
|
38
|
-
|
|
39
|
-
var H2Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
35
|
+
var H2Container = /*#__PURE__*/(0, _styledComponents["default"])(DefaultContainer).withConfig({
|
|
40
36
|
displayName: "headline__H2Container",
|
|
41
|
-
componentId: "axdp97-
|
|
42
|
-
})(["
|
|
37
|
+
componentId: "axdp97-2"
|
|
38
|
+
})(["line-height:125%;font-size:32px;font-family:", ";", ""], function (props) {
|
|
43
39
|
return props.type === 'default' ? _font.fontFamily["default"] : _font.fontFamily.title;
|
|
44
40
|
}, _mediaQuery["default"].tabletAndBelow(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 24px;\n "]))));
|
|
45
|
-
|
|
46
|
-
var H3Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
41
|
+
var H3Container = /*#__PURE__*/(0, _styledComponents["default"])(DefaultContainer).withConfig({
|
|
47
42
|
displayName: "headline__H3Container",
|
|
48
|
-
componentId: "axdp97-
|
|
49
|
-
})(["
|
|
43
|
+
componentId: "axdp97-3"
|
|
44
|
+
})(["line-height:150%;font-size:28px;font-family:", ";", ""], function (props) {
|
|
50
45
|
return props.type === 'default' ? _font.fontFamily["default"] : _font.fontFamily.title;
|
|
51
46
|
}, _mediaQuery["default"].tabletAndBelow(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 20px;\n "]))));
|
|
52
|
-
|
|
53
|
-
var H4Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
47
|
+
var H4Container = /*#__PURE__*/(0, _styledComponents["default"])(DefaultContainer).withConfig({
|
|
54
48
|
displayName: "headline__H4Container",
|
|
55
|
-
componentId: "axdp97-
|
|
56
|
-
})(["
|
|
49
|
+
componentId: "axdp97-4"
|
|
50
|
+
})(["line-height:150%;font-size:22px;font-family:", ";", ""], function (props) {
|
|
57
51
|
return props.type === 'default' ? _font.fontFamily["default"] : _font.fontFamily.title;
|
|
58
52
|
}, _mediaQuery["default"].tabletAndBelow(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: 18px;\n "]))));
|
|
59
|
-
|
|
60
|
-
var H5Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
53
|
+
var H5Container = /*#__PURE__*/(0, _styledComponents["default"])(DefaultContainer).withConfig({
|
|
61
54
|
displayName: "headline__H5Container",
|
|
62
|
-
componentId: "axdp97-
|
|
63
|
-
})(["
|
|
55
|
+
componentId: "axdp97-5"
|
|
56
|
+
})(["line-height:150%;font-size:18px;font-family:", ";", ""], function (props) {
|
|
64
57
|
return props.type === 'default' ? _font.fontFamily["default"] : _font.fontFamily.title;
|
|
65
58
|
}, _mediaQuery["default"].tabletAndBelow(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: 16px;\n "]))));
|
|
66
|
-
|
|
67
|
-
var H6Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
59
|
+
var H6Container = /*#__PURE__*/(0, _styledComponents["default"])(DefaultContainer).withConfig({
|
|
68
60
|
displayName: "headline__H6Container",
|
|
69
|
-
componentId: "axdp97-
|
|
70
|
-
})(["
|
|
61
|
+
componentId: "axdp97-6"
|
|
62
|
+
})(["line-height:150%;font-size:16px;font-family:", ";", ""], function (props) {
|
|
71
63
|
return props.type === 'default' ? _font.fontFamily["default"] : _font.fontFamily.title;
|
|
72
64
|
}, _mediaQuery["default"].tabletAndBelow(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: 14px;\n "]))));
|
|
73
65
|
|
|
@@ -75,96 +67,120 @@ var H1 = function H1(_ref) {
|
|
|
75
67
|
var _ref$text = _ref.text,
|
|
76
68
|
text = _ref$text === void 0 ? '' : _ref$text,
|
|
77
69
|
_ref$type = _ref.type,
|
|
78
|
-
type = _ref$type === void 0 ? 'default' : _ref$type
|
|
70
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
71
|
+
_ref$className = _ref.className,
|
|
72
|
+
className = _ref$className === void 0 ? '' : _ref$className;
|
|
79
73
|
return /*#__PURE__*/_react["default"].createElement(H1Container, {
|
|
80
|
-
type: type
|
|
74
|
+
type: type,
|
|
75
|
+
className: className
|
|
81
76
|
}, text);
|
|
82
77
|
};
|
|
83
78
|
|
|
84
79
|
exports.H1 = H1;
|
|
85
80
|
H1.propTypes = {
|
|
86
81
|
text: _propTypes["default"].string,
|
|
87
|
-
type: _propTypes["default"].oneOf(['default', 'article'])
|
|
82
|
+
type: _propTypes["default"].oneOf(['default', 'article']),
|
|
83
|
+
className: _propTypes["default"].string
|
|
88
84
|
};
|
|
89
85
|
|
|
90
86
|
var H2 = function H2(_ref2) {
|
|
91
87
|
var _ref2$text = _ref2.text,
|
|
92
88
|
text = _ref2$text === void 0 ? '' : _ref2$text,
|
|
93
89
|
_ref2$type = _ref2.type,
|
|
94
|
-
type = _ref2$type === void 0 ? 'default' : _ref2$type
|
|
90
|
+
type = _ref2$type === void 0 ? 'default' : _ref2$type,
|
|
91
|
+
_ref2$className = _ref2.className,
|
|
92
|
+
className = _ref2$className === void 0 ? '' : _ref2$className;
|
|
95
93
|
return /*#__PURE__*/_react["default"].createElement(H2Container, {
|
|
96
|
-
type: type
|
|
94
|
+
type: type,
|
|
95
|
+
className: className
|
|
97
96
|
}, text);
|
|
98
97
|
};
|
|
99
98
|
|
|
100
99
|
exports.H2 = H2;
|
|
101
100
|
H2.propTypes = {
|
|
102
101
|
text: _propTypes["default"].string,
|
|
103
|
-
type: _propTypes["default"].oneOf(['default', 'article'])
|
|
102
|
+
type: _propTypes["default"].oneOf(['default', 'article']),
|
|
103
|
+
className: _propTypes["default"].string
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
var H3 = function H3(_ref3) {
|
|
107
107
|
var _ref3$text = _ref3.text,
|
|
108
108
|
text = _ref3$text === void 0 ? '' : _ref3$text,
|
|
109
109
|
_ref3$type = _ref3.type,
|
|
110
|
-
type = _ref3$type === void 0 ? 'default' : _ref3$type
|
|
110
|
+
type = _ref3$type === void 0 ? 'default' : _ref3$type,
|
|
111
|
+
_ref3$className = _ref3.className,
|
|
112
|
+
className = _ref3$className === void 0 ? '' : _ref3$className;
|
|
111
113
|
return /*#__PURE__*/_react["default"].createElement(H3Container, {
|
|
112
|
-
type: type
|
|
114
|
+
type: type,
|
|
115
|
+
className: className
|
|
113
116
|
}, text);
|
|
114
117
|
};
|
|
115
118
|
|
|
116
119
|
exports.H3 = H3;
|
|
117
120
|
H3.propTypes = {
|
|
118
121
|
text: _propTypes["default"].string,
|
|
119
|
-
type: _propTypes["default"].oneOf(['default', 'article'])
|
|
122
|
+
type: _propTypes["default"].oneOf(['default', 'article']),
|
|
123
|
+
className: _propTypes["default"].string
|
|
120
124
|
};
|
|
121
125
|
|
|
122
126
|
var H4 = function H4(_ref4) {
|
|
123
127
|
var _ref4$text = _ref4.text,
|
|
124
128
|
text = _ref4$text === void 0 ? '' : _ref4$text,
|
|
125
129
|
_ref4$type = _ref4.type,
|
|
126
|
-
type = _ref4$type === void 0 ? 'default' : _ref4$type
|
|
130
|
+
type = _ref4$type === void 0 ? 'default' : _ref4$type,
|
|
131
|
+
_ref4$className = _ref4.className,
|
|
132
|
+
className = _ref4$className === void 0 ? '' : _ref4$className;
|
|
127
133
|
return /*#__PURE__*/_react["default"].createElement(H4Container, {
|
|
128
|
-
type: type
|
|
134
|
+
type: type,
|
|
135
|
+
className: className
|
|
129
136
|
}, text);
|
|
130
137
|
};
|
|
131
138
|
|
|
132
139
|
exports.H4 = H4;
|
|
133
140
|
H4.propTypes = {
|
|
134
141
|
text: _propTypes["default"].string,
|
|
135
|
-
type: _propTypes["default"].oneOf(['default', 'article'])
|
|
142
|
+
type: _propTypes["default"].oneOf(['default', 'article']),
|
|
143
|
+
className: _propTypes["default"].string
|
|
136
144
|
};
|
|
137
145
|
|
|
138
146
|
var H5 = function H5(_ref5) {
|
|
139
147
|
var _ref5$text = _ref5.text,
|
|
140
148
|
text = _ref5$text === void 0 ? '' : _ref5$text,
|
|
141
149
|
_ref5$type = _ref5.type,
|
|
142
|
-
type = _ref5$type === void 0 ? 'default' : _ref5$type
|
|
150
|
+
type = _ref5$type === void 0 ? 'default' : _ref5$type,
|
|
151
|
+
_ref5$className = _ref5.className,
|
|
152
|
+
className = _ref5$className === void 0 ? '' : _ref5$className;
|
|
143
153
|
return /*#__PURE__*/_react["default"].createElement(H5Container, {
|
|
144
|
-
type: type
|
|
154
|
+
type: type,
|
|
155
|
+
className: className
|
|
145
156
|
}, text);
|
|
146
157
|
};
|
|
147
158
|
|
|
148
159
|
exports.H5 = H5;
|
|
149
160
|
H5.propTypes = {
|
|
150
161
|
text: _propTypes["default"].string,
|
|
151
|
-
type: _propTypes["default"].oneOf(['default', 'article'])
|
|
162
|
+
type: _propTypes["default"].oneOf(['default', 'article']),
|
|
163
|
+
className: _propTypes["default"].string
|
|
152
164
|
};
|
|
153
165
|
|
|
154
166
|
var H6 = function H6(_ref6) {
|
|
155
167
|
var _ref6$text = _ref6.text,
|
|
156
168
|
text = _ref6$text === void 0 ? '' : _ref6$text,
|
|
157
169
|
_ref6$type = _ref6.type,
|
|
158
|
-
type = _ref6$type === void 0 ? 'default' : _ref6$type
|
|
170
|
+
type = _ref6$type === void 0 ? 'default' : _ref6$type,
|
|
171
|
+
_ref6$className = _ref6.className,
|
|
172
|
+
className = _ref6$className === void 0 ? '' : _ref6$className;
|
|
159
173
|
return /*#__PURE__*/_react["default"].createElement(H6Container, {
|
|
160
|
-
type: type
|
|
174
|
+
type: type,
|
|
175
|
+
className: className
|
|
161
176
|
}, text);
|
|
162
177
|
};
|
|
163
178
|
|
|
164
179
|
exports.H6 = H6;
|
|
165
180
|
H6.propTypes = {
|
|
166
181
|
text: _propTypes["default"].string,
|
|
167
|
-
type: _propTypes["default"].oneOf(['default', 'article'])
|
|
182
|
+
type: _propTypes["default"].oneOf(['default', 'article']),
|
|
183
|
+
className: _propTypes["default"].string
|
|
168
184
|
};
|
|
169
185
|
var _default = {
|
|
170
186
|
H1: H1,
|
package/lib/text/paragraph.js
CHANGED
|
@@ -43,64 +43,80 @@ var P1 = function P1(_ref) {
|
|
|
43
43
|
var _ref$text = _ref.text,
|
|
44
44
|
text = _ref$text === void 0 ? '' : _ref$text,
|
|
45
45
|
_ref$weight = _ref.weight,
|
|
46
|
-
weight = _ref$weight === void 0 ? 'normal' : _ref$weight
|
|
46
|
+
weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
|
|
47
|
+
_ref$className = _ref.className,
|
|
48
|
+
className = _ref$className === void 0 ? '' : _ref$className;
|
|
47
49
|
return /*#__PURE__*/_react["default"].createElement(P1Container, {
|
|
48
|
-
weight: weight
|
|
50
|
+
weight: weight,
|
|
51
|
+
className: className
|
|
49
52
|
}, text);
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
exports.P1 = P1;
|
|
53
56
|
P1.propTypes = {
|
|
54
57
|
text: _propTypes["default"].string,
|
|
55
|
-
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold'])
|
|
58
|
+
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold']),
|
|
59
|
+
className: _propTypes["default"].string
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
var P2 = function P2(_ref2) {
|
|
59
63
|
var _ref2$text = _ref2.text,
|
|
60
64
|
text = _ref2$text === void 0 ? '' : _ref2$text,
|
|
61
65
|
_ref2$weight = _ref2.weight,
|
|
62
|
-
weight = _ref2$weight === void 0 ? 'normal' : _ref2$weight
|
|
66
|
+
weight = _ref2$weight === void 0 ? 'normal' : _ref2$weight,
|
|
67
|
+
_ref2$className = _ref2.className,
|
|
68
|
+
className = _ref2$className === void 0 ? '' : _ref2$className;
|
|
63
69
|
return /*#__PURE__*/_react["default"].createElement(P2Container, {
|
|
64
|
-
weight: weight
|
|
70
|
+
weight: weight,
|
|
71
|
+
className: className
|
|
65
72
|
}, text);
|
|
66
73
|
};
|
|
67
74
|
|
|
68
75
|
exports.P2 = P2;
|
|
69
76
|
P2.propTypes = {
|
|
70
77
|
text: _propTypes["default"].string,
|
|
71
|
-
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold'])
|
|
78
|
+
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold']),
|
|
79
|
+
className: _propTypes["default"].string
|
|
72
80
|
};
|
|
73
81
|
|
|
74
82
|
var P3 = function P3(_ref3) {
|
|
75
83
|
var _ref3$text = _ref3.text,
|
|
76
84
|
text = _ref3$text === void 0 ? '' : _ref3$text,
|
|
77
85
|
_ref3$weight = _ref3.weight,
|
|
78
|
-
weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight
|
|
86
|
+
weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
|
|
87
|
+
_ref3$className = _ref3.className,
|
|
88
|
+
className = _ref3$className === void 0 ? '' : _ref3$className;
|
|
79
89
|
return /*#__PURE__*/_react["default"].createElement(P3Container, {
|
|
80
|
-
weight: weight
|
|
90
|
+
weight: weight,
|
|
91
|
+
className: className
|
|
81
92
|
}, text);
|
|
82
93
|
};
|
|
83
94
|
|
|
84
95
|
exports.P3 = P3;
|
|
85
96
|
P3.propTypes = {
|
|
86
97
|
text: _propTypes["default"].string,
|
|
87
|
-
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold'])
|
|
98
|
+
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold']),
|
|
99
|
+
className: _propTypes["default"].string
|
|
88
100
|
};
|
|
89
101
|
|
|
90
102
|
var P4 = function P4(_ref4) {
|
|
91
103
|
var _ref4$text = _ref4.text,
|
|
92
104
|
text = _ref4$text === void 0 ? '' : _ref4$text,
|
|
93
105
|
_ref4$weight = _ref4.weight,
|
|
94
|
-
weight = _ref4$weight === void 0 ? 'normal' : _ref4$weight
|
|
106
|
+
weight = _ref4$weight === void 0 ? 'normal' : _ref4$weight,
|
|
107
|
+
_ref4$className = _ref4.className,
|
|
108
|
+
className = _ref4$className === void 0 ? '' : _ref4$className;
|
|
95
109
|
return /*#__PURE__*/_react["default"].createElement(P4Container, {
|
|
96
|
-
weight: weight
|
|
110
|
+
weight: weight,
|
|
111
|
+
className: className
|
|
97
112
|
}, text);
|
|
98
113
|
};
|
|
99
114
|
|
|
100
115
|
exports.P4 = P4;
|
|
101
116
|
P4.propTypes = {
|
|
102
117
|
text: _propTypes["default"].string,
|
|
103
|
-
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold'])
|
|
118
|
+
weight: _propTypes["default"].oneOf(['extraLight', 'normal', 'bold']),
|
|
119
|
+
className: _propTypes["default"].string
|
|
104
120
|
};
|
|
105
121
|
var _default = {
|
|
106
122
|
P1: P1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0-rc.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"babel-loader": "^8.2.4",
|
|
45
45
|
"chromatic": "^6.5.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9cc4e642f326544d628a042ae83496476d150b8d"
|
|
48
48
|
}
|