@twreporter/react-components 8.9.0-rc.4 → 8.9.0-rc.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/CHANGELOG.md +11 -0
- package/lib/bookmark-list/empty-guide.js +2 -3
- package/lib/button/components/iconButton.js +1 -1
- package/lib/button/components/iconWithTextButton.js +1 -1
- package/lib/button/components/pillButton.js +3 -9
- package/lib/button/stories/pillButton.stories.js +15 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.9.0-rc.5](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.9.0-rc.4...@twreporter/react-components@8.9.0-rc.5) (2022-05-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add pillButton iconComponent prop & fix empty bookmark style ([54f0e52](https://github.com/twreporter/twreporter-npm-packages/commit/54f0e52b97eb97616bbb83864810acc80101647e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [8.9.0-rc.4](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.9.0-rc.3...@twreporter/react-components@8.9.0-rc.4) (2022-05-27)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -45,7 +45,7 @@ var ButtonContainer = /*#__PURE__*/_styledComponents["default"].a.withConfig({
|
|
|
45
45
|
var GuideContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
46
46
|
displayName: "empty-guide__GuideContainer",
|
|
47
47
|
componentId: "sc-1y7u9aq-3"
|
|
48
|
-
})(["display:flex;align-items:
|
|
48
|
+
})(["display:flex;align-items:baseline;color:", ";svg{background-color:", ";width:18px;height:18px;margin:0 4px;transform:translateY(3px);}"], _color.colorGrayscale.gray600, _color.colorGrayscale.gray600);
|
|
49
49
|
|
|
50
50
|
var EmptyGuide = function EmptyGuide(_ref) {
|
|
51
51
|
var _ref$releaseBranch = _ref.releaseBranch,
|
|
@@ -70,8 +70,7 @@ var EmptyGuide = function EmptyGuide(_ref) {
|
|
|
70
70
|
href: homepageUrl
|
|
71
71
|
}, /*#__PURE__*/_react["default"].createElement(_button.PillButton, {
|
|
72
72
|
text: "\u958B\u59CB\u63A2\u7D22",
|
|
73
|
-
size: "L"
|
|
74
|
-
releaseBranch: releaseBranch
|
|
73
|
+
size: "L"
|
|
75
74
|
})));
|
|
76
75
|
};
|
|
77
76
|
|
|
@@ -53,7 +53,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
IconButton.propTypes = {
|
|
56
|
-
iconComponent: _propTypes["default"].
|
|
56
|
+
iconComponent: _propTypes["default"].element.isRequired,
|
|
57
57
|
theme: _propTypes["default"].oneOf(['normal', 'photography', 'transparent', 'index']),
|
|
58
58
|
type: _propTypes["default"].oneOf(['primary', 'secondary']),
|
|
59
59
|
disabled: _propTypes["default"].bool,
|
|
@@ -62,7 +62,7 @@ var IconWithTextButton = function IconWithTextButton(_ref) {
|
|
|
62
62
|
|
|
63
63
|
IconWithTextButton.propTypes = {
|
|
64
64
|
text: _propTypes["default"].string,
|
|
65
|
-
iconComponent: _propTypes["default"].
|
|
65
|
+
iconComponent: _propTypes["default"].element.isRequired,
|
|
66
66
|
theme: _propTypes["default"].oneOf(['normal', 'photography', 'transparent', 'index']),
|
|
67
67
|
disabled: _propTypes["default"].bool,
|
|
68
68
|
active: _propTypes["default"].bool
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
-
var _icon = require("../../icon");
|
|
15
|
-
|
|
16
14
|
var _paragraph = require("../../text/paragraph");
|
|
17
15
|
|
|
18
16
|
var _theme = require("../utils/theme");
|
|
@@ -52,14 +50,13 @@ var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
52
50
|
var PillButton = function PillButton(_ref) {
|
|
53
51
|
var _ref$text = _ref.text,
|
|
54
52
|
text = _ref$text === void 0 ? '' : _ref$text,
|
|
53
|
+
iconComponent = _ref.iconComponent,
|
|
55
54
|
_ref$size = _ref.size,
|
|
56
55
|
size = _ref$size === void 0 ? 'S' : _ref$size,
|
|
57
56
|
_ref$theme = _ref.theme,
|
|
58
57
|
theme = _ref$theme === void 0 ? 'normal' : _ref$theme,
|
|
59
58
|
_ref$type = _ref.type,
|
|
60
59
|
type = _ref$type === void 0 ? 'primary' : _ref$type,
|
|
61
|
-
_ref$withIcon = _ref.withIcon,
|
|
62
|
-
withIcon = _ref$withIcon === void 0 ? false : _ref$withIcon,
|
|
63
60
|
_ref$disabled = _ref.disabled,
|
|
64
61
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
65
62
|
var themeFunc = type === 'primary' ? _theme.getFilledPillButtonTheme : _theme.getOutlinePillButtonTheme;
|
|
@@ -74,9 +71,6 @@ var PillButton = function PillButton(_ref) {
|
|
|
74
71
|
padding = _getSizeStyle.padding,
|
|
75
72
|
iconSize = _getSizeStyle.iconSize;
|
|
76
73
|
|
|
77
|
-
var iconJSX = withIcon ? /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
78
|
-
direction: "right"
|
|
79
|
-
}) : '';
|
|
80
74
|
var textJSX = size === 'S' ? /*#__PURE__*/_react["default"].createElement(_paragraph.P2, {
|
|
81
75
|
text: text,
|
|
82
76
|
weight: "bold"
|
|
@@ -92,15 +86,15 @@ var PillButton = function PillButton(_ref) {
|
|
|
92
86
|
iconSize: iconSize,
|
|
93
87
|
hoverColor: hoverColor,
|
|
94
88
|
hoverBgColor: hoverBgColor
|
|
95
|
-
}, textJSX,
|
|
89
|
+
}, textJSX, iconComponent);
|
|
96
90
|
};
|
|
97
91
|
|
|
98
92
|
PillButton.propTypes = {
|
|
93
|
+
iconComponent: _propTypes["default"].element,
|
|
99
94
|
text: _propTypes["default"].string,
|
|
100
95
|
size: _propTypes["default"].oneOf(['S', 'L']),
|
|
101
96
|
theme: _propTypes["default"].oneOf(['transparent', 'normal', 'photography', 'index']),
|
|
102
97
|
type: _propTypes["default"].oneOf(['primary', 'secondary']),
|
|
103
|
-
withIcon: _propTypes["default"].bool,
|
|
104
98
|
disabled: _propTypes["default"].bool
|
|
105
99
|
};
|
|
106
100
|
var _default = PillButton;
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.pillButton = exports["default"] = void 0;
|
|
6
|
+
exports.withArrowIcon = exports.pillButton = exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
10
|
var _pillButton = _interopRequireDefault(require("../components/pillButton"));
|
|
11
11
|
|
|
12
|
+
var _icon = require("../../icon");
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
15
|
|
|
14
16
|
var _default = {
|
|
@@ -28,6 +30,17 @@ pillButton.args = {
|
|
|
28
30
|
size: 'S',
|
|
29
31
|
theme: 'normal',
|
|
30
32
|
type: 'primary',
|
|
31
|
-
|
|
33
|
+
disabled: false
|
|
34
|
+
};
|
|
35
|
+
var withArrowIcon = Template.bind({});
|
|
36
|
+
exports.withArrowIcon = withArrowIcon;
|
|
37
|
+
withArrowIcon.args = {
|
|
38
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
39
|
+
direction: "right"
|
|
40
|
+
}),
|
|
41
|
+
text: '文字',
|
|
42
|
+
size: 'S',
|
|
43
|
+
theme: 'normal',
|
|
44
|
+
type: 'primary',
|
|
32
45
|
disabled: false
|
|
33
46
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "8.9.0-rc.
|
|
3
|
+
"version": "8.9.0-rc.5",
|
|
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": "8f2a6d0a3f503a52ac691f18e8e0ce78bb5b0026"
|
|
48
48
|
}
|