@twreporter/react-components 8.9.0-rc.3 → 8.9.0-rc.4
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/iconButton.js +63 -0
- package/lib/button/components/iconWithTextButton.js +71 -0
- package/lib/button/index.js +19 -1
- package/lib/button/stories/iconButton.stories.js +45 -0
- package/lib/button/stories/iconWithTextButton.stories.js +45 -0
- package/lib/button/utils/theme.js +161 -2
- package/lib/icon/index.js +13 -1
- package/lib/icon/stories/printer.stories.js +39 -0
- 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.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
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* address code review ([a0d5515](https://github.com/twreporter/twreporter-npm-packages/commit/a0d5515c4f1e8c11cbd1bd23880d4302af37b816))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add IconButton, IconWithTextButton, Printer components ([819f246](https://github.com/twreporter/twreporter-npm-packages/commit/819f2461e0235826333544cae0d6e3a6115a1f8d))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.9.0-rc.3](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.9.0-rc.2...@twreporter/react-components@8.9.0-rc.3) (2022-05-25)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../utils/theme");
|
|
15
|
+
|
|
16
|
+
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
17
|
+
|
|
18
|
+
var _templateObject;
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
23
|
+
|
|
24
|
+
var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
25
|
+
displayName: "iconButton__ButtonContainer",
|
|
26
|
+
componentId: "sc-1v7s35n-0"
|
|
27
|
+
})(["cursor:pointer;display:flex;svg{width:24px;height:24px;background-color:", ";}", ""], function (props) {
|
|
28
|
+
return props.color;
|
|
29
|
+
}, _mediaQuery["default"].desktopAndAbove(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:hover svg {\n background-color: ", ";\n }\n "])), function (props) {
|
|
30
|
+
return props.hoverColor;
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
var IconButton = function IconButton(_ref) {
|
|
34
|
+
var iconComponent = _ref.iconComponent,
|
|
35
|
+
_ref$theme = _ref.theme,
|
|
36
|
+
theme = _ref$theme === void 0 ? 'normal' : _ref$theme,
|
|
37
|
+
_ref$type = _ref.type,
|
|
38
|
+
type = _ref$type === void 0 ? 'primary' : _ref$type,
|
|
39
|
+
_ref$disabled = _ref.disabled,
|
|
40
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
41
|
+
_ref$active = _ref.active,
|
|
42
|
+
active = _ref$active === void 0 ? false : _ref$active;
|
|
43
|
+
var themeFunc = type === 'primary' ? _theme.getPrimaryIconButtonTheme : _theme.getSecondaryIconButtonTheme;
|
|
44
|
+
|
|
45
|
+
var _themeFunc = themeFunc(theme, active, disabled),
|
|
46
|
+
color = _themeFunc.color,
|
|
47
|
+
hoverColor = _themeFunc.hoverColor;
|
|
48
|
+
|
|
49
|
+
return /*#__PURE__*/_react["default"].createElement(ButtonContainer, {
|
|
50
|
+
color: color,
|
|
51
|
+
hoverColor: hoverColor
|
|
52
|
+
}, iconComponent);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
IconButton.propTypes = {
|
|
56
|
+
iconComponent: _propTypes["default"].elementType.isRequired,
|
|
57
|
+
theme: _propTypes["default"].oneOf(['normal', 'photography', 'transparent', 'index']),
|
|
58
|
+
type: _propTypes["default"].oneOf(['primary', 'secondary']),
|
|
59
|
+
disabled: _propTypes["default"].bool,
|
|
60
|
+
active: _propTypes["default"].bool
|
|
61
|
+
};
|
|
62
|
+
var _default = IconButton;
|
|
63
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../utils/theme");
|
|
15
|
+
|
|
16
|
+
var _paragraph = require("../../text/paragraph");
|
|
17
|
+
|
|
18
|
+
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
19
|
+
|
|
20
|
+
var _templateObject;
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
+
|
|
26
|
+
var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
27
|
+
displayName: "iconWithTextButton__ButtonContainer",
|
|
28
|
+
componentId: "sc-1f9d1q4-0"
|
|
29
|
+
})(["cursor:pointer;display:flex;flex-direction:column;align-items:center;color:", ";svg{width:24px;height:24px;background-color:", ";}", ""], function (props) {
|
|
30
|
+
return props.color;
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.color;
|
|
33
|
+
}, _mediaQuery["default"].desktopAndAbove(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:hover {\n color: ", ";\n svg {\n background-color: ", ";\n }\n }\n "])), function (props) {
|
|
34
|
+
return props.hoverColor;
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.hoverColor;
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
var IconWithTextButton = function IconWithTextButton(_ref) {
|
|
40
|
+
var _ref$text = _ref.text,
|
|
41
|
+
text = _ref$text === void 0 ? '' : _ref$text,
|
|
42
|
+
iconComponent = _ref.iconComponent,
|
|
43
|
+
_ref$theme = _ref.theme,
|
|
44
|
+
theme = _ref$theme === void 0 ? 'normal' : _ref$theme,
|
|
45
|
+
_ref$disabled = _ref.disabled,
|
|
46
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
47
|
+
_ref$active = _ref.active,
|
|
48
|
+
active = _ref$active === void 0 ? false : _ref$active;
|
|
49
|
+
|
|
50
|
+
var _getIconWithTextButto = (0, _theme.getIconWithTextButtonTheme)(theme, active, disabled),
|
|
51
|
+
color = _getIconWithTextButto.color,
|
|
52
|
+
hoverColor = _getIconWithTextButto.hoverColor;
|
|
53
|
+
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement(ButtonContainer, {
|
|
55
|
+
color: color,
|
|
56
|
+
hoverColor: hoverColor
|
|
57
|
+
}, iconComponent, /*#__PURE__*/_react["default"].createElement(_paragraph.P4, {
|
|
58
|
+
text: text,
|
|
59
|
+
weight: "bold"
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
IconWithTextButton.propTypes = {
|
|
64
|
+
text: _propTypes["default"].string,
|
|
65
|
+
iconComponent: _propTypes["default"].elementType.isRequired,
|
|
66
|
+
theme: _propTypes["default"].oneOf(['normal', 'photography', 'transparent', 'index']),
|
|
67
|
+
disabled: _propTypes["default"].bool,
|
|
68
|
+
active: _propTypes["default"].bool
|
|
69
|
+
};
|
|
70
|
+
var _default = IconWithTextButton;
|
|
71
|
+
exports["default"] = _default;
|
package/lib/button/index.js
CHANGED
|
@@ -9,13 +9,31 @@ Object.defineProperty(exports, "PillButton", {
|
|
|
9
9
|
return _pillButton["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "IconButton", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _iconButton["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "IconWithTextButton", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _iconWithTextButton["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
12
24
|
exports["default"] = void 0;
|
|
13
25
|
|
|
14
26
|
var _pillButton = _interopRequireDefault(require("./components/pillButton"));
|
|
15
27
|
|
|
28
|
+
var _iconButton = _interopRequireDefault(require("./components/iconButton"));
|
|
29
|
+
|
|
30
|
+
var _iconWithTextButton = _interopRequireDefault(require("./components/iconWithTextButton"));
|
|
31
|
+
|
|
16
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
33
|
|
|
18
34
|
var _default = {
|
|
19
|
-
PillButton: _pillButton["default"]
|
|
35
|
+
PillButton: _pillButton["default"],
|
|
36
|
+
IconButton: _iconButton["default"],
|
|
37
|
+
IconWithTextButton: _iconWithTextButton["default"]
|
|
20
38
|
};
|
|
21
39
|
exports["default"] = _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shareButton = exports.iconButton = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _iconButton = _interopRequireDefault(require("../components/iconButton"));
|
|
11
|
+
|
|
12
|
+
var _icon = require("../../icon");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: 'Button/Icon Button',
|
|
18
|
+
component: _iconButton["default"]
|
|
19
|
+
};
|
|
20
|
+
exports["default"] = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/_react["default"].createElement(_iconButton["default"], args);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var iconButton = Template.bind({});
|
|
27
|
+
exports.iconButton = iconButton;
|
|
28
|
+
iconButton.args = {
|
|
29
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
30
|
+
direction: "down"
|
|
31
|
+
}),
|
|
32
|
+
theme: 'normal',
|
|
33
|
+
type: 'primary',
|
|
34
|
+
disabled: false,
|
|
35
|
+
active: false
|
|
36
|
+
};
|
|
37
|
+
var shareButton = Template.bind({});
|
|
38
|
+
exports.shareButton = shareButton;
|
|
39
|
+
shareButton.args = {
|
|
40
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
41
|
+
theme: 'normal',
|
|
42
|
+
type: 'primary',
|
|
43
|
+
disabled: false,
|
|
44
|
+
active: false
|
|
45
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shareButton = exports.iconWithTextButton = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _iconWithTextButton = _interopRequireDefault(require("../components/iconWithTextButton"));
|
|
11
|
+
|
|
12
|
+
var _icon = require("../../icon");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: 'Button/Icon With Text Button',
|
|
18
|
+
component: _iconWithTextButton["default"]
|
|
19
|
+
};
|
|
20
|
+
exports["default"] = _default;
|
|
21
|
+
|
|
22
|
+
var Template = function Template(args) {
|
|
23
|
+
return /*#__PURE__*/_react["default"].createElement(_iconWithTextButton["default"], args);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var iconWithTextButton = Template.bind({});
|
|
27
|
+
exports.iconWithTextButton = iconWithTextButton;
|
|
28
|
+
iconWithTextButton.args = {
|
|
29
|
+
text: '文字',
|
|
30
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
31
|
+
direction: "down"
|
|
32
|
+
}),
|
|
33
|
+
theme: 'normal',
|
|
34
|
+
disabled: false,
|
|
35
|
+
active: false
|
|
36
|
+
};
|
|
37
|
+
var shareButton = Template.bind({});
|
|
38
|
+
exports.shareButton = shareButton;
|
|
39
|
+
shareButton.args = {
|
|
40
|
+
text: '分享',
|
|
41
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
42
|
+
theme: 'normal',
|
|
43
|
+
disabled: false,
|
|
44
|
+
active: false
|
|
45
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.getOutlinePillButtonTheme = exports.getFilledPillButtonTheme = void 0;
|
|
6
|
+
exports["default"] = exports.getIconWithTextButtonTheme = exports.getSecondaryIconButtonTheme = exports.getPrimaryIconButtonTheme = exports.getOutlinePillButtonTheme = exports.getFilledPillButtonTheme = void 0;
|
|
7
7
|
|
|
8
8
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
9
9
|
|
|
@@ -111,8 +111,167 @@ var getOutlinePillButtonTheme = function getOutlinePillButtonTheme(theme, disabl
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
exports.getOutlinePillButtonTheme = getOutlinePillButtonTheme;
|
|
114
|
+
|
|
115
|
+
var getPrimaryIconButtonTheme = function getPrimaryIconButtonTheme(theme, isActive, isDisabled) {
|
|
116
|
+
if (isDisabled) {
|
|
117
|
+
return {
|
|
118
|
+
color: _color.colorGrayscale.gray400,
|
|
119
|
+
hoverColor: _color.colorGrayscale.gray400
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var switchKey = isActive ? "".concat(theme, "-active") : theme;
|
|
124
|
+
|
|
125
|
+
switch (switchKey) {
|
|
126
|
+
case 'photography':
|
|
127
|
+
return {
|
|
128
|
+
color: _color.colorGrayscale.white,
|
|
129
|
+
hoverColor: _color.colorSupportive.main
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
case 'photography-active':
|
|
133
|
+
return {
|
|
134
|
+
color: _color.colorSupportive.main,
|
|
135
|
+
hoverColor: _color.colorSupportive.main
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
case 'transparent':
|
|
139
|
+
return {
|
|
140
|
+
color: _color.colorGrayscale.white,
|
|
141
|
+
hoverColor: _color.colorGrayscale.gray200
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
case 'transparent-active':
|
|
145
|
+
return {
|
|
146
|
+
color: _color.colorGrayscale.white,
|
|
147
|
+
hoverColor: _color.colorGrayscale.white
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
case 'normal-active':
|
|
151
|
+
return {
|
|
152
|
+
color: _color.colorBrand.heavy,
|
|
153
|
+
hoverColor: _color.colorBrand.heavy
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
case 'normal':
|
|
157
|
+
default:
|
|
158
|
+
return {
|
|
159
|
+
color: _color.colorGrayscale.gray600,
|
|
160
|
+
hoverColor: _color.colorGrayscale.gray800
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
exports.getPrimaryIconButtonTheme = getPrimaryIconButtonTheme;
|
|
166
|
+
|
|
167
|
+
var getSecondaryIconButtonTheme = function getSecondaryIconButtonTheme(theme, isActive, isDisabled) {
|
|
168
|
+
if (isDisabled) {
|
|
169
|
+
return {
|
|
170
|
+
color: _color.colorGrayscale.gray400,
|
|
171
|
+
hoverColor: _color.colorGrayscale.gray400
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var switchKey = isActive ? "".concat(theme, "-active") : theme;
|
|
176
|
+
|
|
177
|
+
switch (switchKey) {
|
|
178
|
+
case 'photography':
|
|
179
|
+
return {
|
|
180
|
+
color: _color.colorGrayscale.gray400,
|
|
181
|
+
hoverColor: _color.colorSupportive.main
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
case 'photography-active':
|
|
185
|
+
return {
|
|
186
|
+
color: _color.colorSupportive.main,
|
|
187
|
+
hoverColor: _color.colorSupportive.main
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
case 'transparent':
|
|
191
|
+
return {
|
|
192
|
+
color: _color.colorGrayscale.gray600,
|
|
193
|
+
hoverColor: _color.colorGrayscale.white
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
case 'transparent-active':
|
|
197
|
+
return {
|
|
198
|
+
color: _color.colorGrayscale.gray600,
|
|
199
|
+
hoverColor: _color.colorGrayscale.gray600
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
case 'normal-active':
|
|
203
|
+
return {
|
|
204
|
+
color: _color.colorBrand.heavy,
|
|
205
|
+
hoverColor: _color.colorBrand.heavy
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
case 'normal':
|
|
209
|
+
default:
|
|
210
|
+
return {
|
|
211
|
+
color: _color.colorGrayscale.gray400,
|
|
212
|
+
hoverColor: _color.colorGrayscale.gray600
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
exports.getSecondaryIconButtonTheme = getSecondaryIconButtonTheme;
|
|
218
|
+
|
|
219
|
+
var getIconWithTextButtonTheme = function getIconWithTextButtonTheme(theme, isActive, isDisabled) {
|
|
220
|
+
if (isDisabled) {
|
|
221
|
+
return {
|
|
222
|
+
color: _color.colorGrayscale.gray400,
|
|
223
|
+
hoverColor: _color.colorGrayscale.gray400
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
var switchKey = isActive ? "".concat(theme, "-active") : theme;
|
|
228
|
+
|
|
229
|
+
switch (switchKey) {
|
|
230
|
+
case 'photography':
|
|
231
|
+
return {
|
|
232
|
+
color: _color.colorGrayscale.gray100,
|
|
233
|
+
hoverColor: _color.colorSupportive.main
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
case 'photography-active':
|
|
237
|
+
return {
|
|
238
|
+
color: _color.colorSupportive.main,
|
|
239
|
+
hoverColor: _color.colorSupportive.main
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
case 'transparent':
|
|
243
|
+
return {
|
|
244
|
+
color: _color.colorGrayscale.gray100,
|
|
245
|
+
hoverColor: _color.colorGrayscale.gray200
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
case 'transparent-active':
|
|
249
|
+
return {
|
|
250
|
+
color: _color.colorGrayscale.white,
|
|
251
|
+
hoverColor: _color.colorGrayscale.white
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
case 'normal-active':
|
|
255
|
+
return {
|
|
256
|
+
color: _color.colorBrand.heavy,
|
|
257
|
+
hoverColor: _color.colorBrand.heavy
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
case 'normal':
|
|
261
|
+
default:
|
|
262
|
+
return {
|
|
263
|
+
color: _color.colorGrayscale.gray600,
|
|
264
|
+
hoverColor: _color.colorBrand.heavy
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
exports.getIconWithTextButtonTheme = getIconWithTextButtonTheme;
|
|
114
270
|
var _default = {
|
|
115
271
|
getFilledPillButtonTheme: getFilledPillButtonTheme,
|
|
116
|
-
getOutlinePillButtonTheme: getOutlinePillButtonTheme
|
|
272
|
+
getOutlinePillButtonTheme: getOutlinePillButtonTheme,
|
|
273
|
+
getPrimaryIconButtonTheme: getPrimaryIconButtonTheme,
|
|
274
|
+
getSecondaryIconButtonTheme: getSecondaryIconButtonTheme,
|
|
275
|
+
getIconWithTextButtonTheme: getIconWithTextButtonTheme
|
|
117
276
|
};
|
|
118
277
|
exports["default"] = _default;
|
package/lib/icon/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.Line = exports.Youtube = exports.Twitter = exports.Medium = exports.Instagram = exports.Facebook = exports.Loading = exports.Copy = exports.Topic = exports.Article = exports.Clock = exports.Text = exports.Share = exports.Home = exports.Member = exports.Search = exports.Cross = exports.Hamburger = exports.Bookmark = exports.Arrow = exports.Icon = void 0;
|
|
6
|
+
exports["default"] = exports.Line = exports.Youtube = exports.Twitter = exports.Medium = exports.Instagram = exports.Facebook = exports.Printer = exports.Loading = exports.Copy = exports.Topic = exports.Article = exports.Clock = exports.Text = exports.Share = exports.Home = exports.Member = exports.Search = exports.Cross = exports.Hamburger = exports.Bookmark = exports.Arrow = exports.Icon = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -212,6 +212,17 @@ Loading.propTypes = {
|
|
|
212
212
|
releaseBranch: _propTypes2["default"].releaseBranch
|
|
213
213
|
};
|
|
214
214
|
|
|
215
|
+
var Printer = function Printer(args) {
|
|
216
|
+
return /*#__PURE__*/_react["default"].createElement(Icon, _extends({
|
|
217
|
+
filename: "printer"
|
|
218
|
+
}, args));
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
exports.Printer = Printer;
|
|
222
|
+
Printer.propTypes = {
|
|
223
|
+
releaseBranch: _propTypes2["default"].releaseBranch
|
|
224
|
+
};
|
|
225
|
+
|
|
215
226
|
var Facebook = function Facebook(args) {
|
|
216
227
|
return /*#__PURE__*/_react["default"].createElement(Icon, _extends({
|
|
217
228
|
filename: "facebook"
|
|
@@ -290,6 +301,7 @@ var _default = {
|
|
|
290
301
|
Instagram: Instagram,
|
|
291
302
|
Line: Line,
|
|
292
303
|
Loading: Loading,
|
|
304
|
+
Printer: Printer,
|
|
293
305
|
Medium: Medium,
|
|
294
306
|
Member: Member,
|
|
295
307
|
Search: Search,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.printer = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _index = require("../index");
|
|
11
|
+
|
|
12
|
+
var _releaseBranch = _interopRequireDefault(require("@twreporter/core/lib/constants/release-branch"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var master = _releaseBranch["default"].master,
|
|
17
|
+
staging = _releaseBranch["default"].staging,
|
|
18
|
+
preview = _releaseBranch["default"].preview,
|
|
19
|
+
release = _releaseBranch["default"].release;
|
|
20
|
+
var _default = {
|
|
21
|
+
title: 'Icon/Printer',
|
|
22
|
+
component: _index.Printer,
|
|
23
|
+
argTypes: {
|
|
24
|
+
releaseBranch: {
|
|
25
|
+
defaultValue: master,
|
|
26
|
+
options: [master, staging, preview, release],
|
|
27
|
+
control: {
|
|
28
|
+
type: 'radio'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports["default"] = _default;
|
|
34
|
+
|
|
35
|
+
var printer = function printer(args) {
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement(_index.Printer, args);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.printer = printer;
|
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.4",
|
|
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": "6cb23fc834f432e3b1a45decaf5ff5a7b7f77400"
|
|
48
48
|
}
|