@twreporter/react-components 8.19.1-rc.0 → 8.20.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
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.20.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.19.1-rc.1...@twreporter/react-components@8.20.0-rc.0) (2023-10-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add `loading` props for PillButton ([6ded8f1](https://github.com/twreporter/twreporter-npm-packages/commit/6ded8f193777b384933f27fbd925b7daf372b0c9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [8.19.1-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.19.1-rc.0...@twreporter/react-components@8.19.1-rc.1) (2023-10-01)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* remove click effect when link disabled on mobile ([09899d9](https://github.com/twreporter/twreporter-npm-packages/commit/09899d91ae54b2a153cbff17fe860122287ffd0a))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [8.19.1-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.19.0...@twreporter/react-components@8.19.1-rc.0) (2023-09-28)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @twreporter/react-components
|
|
@@ -45,7 +45,7 @@ var LinkContainer = /*#__PURE__*/(0, _styledComponents["default"])(_customizedLi
|
|
|
45
45
|
}, function (props) {
|
|
46
46
|
return style.color[props.type];
|
|
47
47
|
}, function (props) {
|
|
48
|
-
return props.disabled ? "\n opacity: 0.5;\n cursor: auto;\n " : "\n &:hover {\n text-decoration-line: underline;\n }\n
|
|
48
|
+
return props.disabled ? "\n opacity: 0.5;\n cursor: auto;\n -webkit-tap-highlight-color: transparent;\n " : "\n &:hover {\n text-decoration-line: underline;\n }\n ";
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
var LinkButton = function LinkButton(_ref) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
11
|
|
|
10
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
|
|
12
|
-
var _styledComponents =
|
|
14
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
15
|
|
|
14
16
|
var _paragraph = require("../../text/paragraph");
|
|
15
17
|
|
|
@@ -23,7 +25,13 @@ var _sharedEnum = require("../../shared-enum");
|
|
|
23
25
|
|
|
24
26
|
var _theme2 = require("@twreporter/core/lib/constants/theme");
|
|
25
27
|
|
|
26
|
-
var
|
|
28
|
+
var _color = require("@twreporter/core/lib/constants/color");
|
|
29
|
+
|
|
30
|
+
var _excluded = ["text", "leftIconComponent", "rightIconComponent", "size", "theme", "type", "style", "disabled", "loading"];
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
27
35
|
|
|
28
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
37
|
|
|
@@ -65,6 +73,31 @@ var IconContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
65
73
|
componentId: "xa7tsy-1"
|
|
66
74
|
})(["display:flex;align-items:center;&:first-child{margin-right:4px;}&:last-child{margin-left:4px;}"]);
|
|
67
75
|
|
|
76
|
+
var HideOnLoading = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
77
|
+
displayName: "pillButton__HideOnLoading",
|
|
78
|
+
componentId: "xa7tsy-2"
|
|
79
|
+
})(["opacity:", ";"], function (props) {
|
|
80
|
+
return props.show ? 1 : 0;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var RelativeParent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
84
|
+
displayName: "pillButton__RelativeParent",
|
|
85
|
+
componentId: "xa7tsy-3"
|
|
86
|
+
})(["position:relative;display:flex;align-items:center;justify-content:center;"]);
|
|
87
|
+
|
|
88
|
+
var spin = /*#__PURE__*/(0, _styledComponents.keyframes)(["0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}"]);
|
|
89
|
+
|
|
90
|
+
var Loader = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
|
91
|
+
displayName: "pillButton__Loader",
|
|
92
|
+
componentId: "xa7tsy-4"
|
|
93
|
+
})(["position:absolute;opacity:", ";width:", "px;height:", "px;border:2px solid ", ";border-top-color:", ";border-radius:50%;display:inline-block;box-sizing:border-box;animation:", " 1s linear infinite;"], function (props) {
|
|
94
|
+
return props.show ? 1 : 0;
|
|
95
|
+
}, function (props) {
|
|
96
|
+
return props.size;
|
|
97
|
+
}, function (props) {
|
|
98
|
+
return props.size;
|
|
99
|
+
}, _color.colorGrayscale.gray400, _color.colorGrayscale.gray600, spin);
|
|
100
|
+
|
|
68
101
|
var PillButton = function PillButton(_ref) {
|
|
69
102
|
var _ref$text = _ref.text,
|
|
70
103
|
text = _ref$text === void 0 ? '' : _ref$text,
|
|
@@ -82,6 +115,8 @@ var PillButton = function PillButton(_ref) {
|
|
|
82
115
|
style = _ref$style === void 0 ? _enums.Style.BRAND : _ref$style,
|
|
83
116
|
_ref$disabled = _ref.disabled,
|
|
84
117
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
118
|
+
_ref$loading = _ref.loading,
|
|
119
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
85
120
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
86
121
|
|
|
87
122
|
var themeFunc = type === _enums.Type.PRIMARY ? _theme.getFilledPillButtonTheme : _theme.getOutlinePillButtonTheme;
|
|
@@ -113,7 +148,12 @@ var PillButton = function PillButton(_ref) {
|
|
|
113
148
|
iconSize: iconSize,
|
|
114
149
|
hoverColor: hoverColor,
|
|
115
150
|
hoverBgColor: hoverBgColor
|
|
116
|
-
}, props),
|
|
151
|
+
}, props), /*#__PURE__*/_react["default"].createElement(RelativeParent, null, /*#__PURE__*/_react["default"].createElement(HideOnLoading, {
|
|
152
|
+
show: !loading
|
|
153
|
+
}, leftIconJSX, textJSX, rightIconJSX), /*#__PURE__*/_react["default"].createElement(Loader, {
|
|
154
|
+
show: loading,
|
|
155
|
+
size: size === _sharedEnum.Size.S ? 18 : 24
|
|
156
|
+
})));
|
|
117
157
|
};
|
|
118
158
|
|
|
119
159
|
PillButton.propTypes = {
|
|
@@ -124,7 +164,8 @@ PillButton.propTypes = {
|
|
|
124
164
|
theme: _propTypes["default"].oneOf(Object.values(_theme2.THEME)),
|
|
125
165
|
type: _propTypes["default"].oneOf(Object.values(_enums.Type)),
|
|
126
166
|
style: _propTypes["default"].oneOf(Object.values(_enums.Style)),
|
|
127
|
-
disabled: _propTypes["default"].bool
|
|
167
|
+
disabled: _propTypes["default"].bool,
|
|
168
|
+
loading: _propTypes["default"].bool
|
|
128
169
|
};
|
|
129
170
|
PillButton.THEME = _theme2.THEME;
|
|
130
171
|
PillButton.Type = _enums.Type;
|
|
@@ -56,7 +56,8 @@ pillButton.args = {
|
|
|
56
56
|
theme: _pillButton["default"].THEME.normal,
|
|
57
57
|
style: _pillButton["default"].Style.BRAND,
|
|
58
58
|
type: _pillButton["default"].Type.PRIMARY,
|
|
59
|
-
disabled: false
|
|
59
|
+
disabled: false,
|
|
60
|
+
loading: false
|
|
60
61
|
};
|
|
61
62
|
pillButton.parameters = {
|
|
62
63
|
controls: {
|
|
@@ -79,7 +80,8 @@ toggleIconDisplay.args = {
|
|
|
79
80
|
theme: _pillButton["default"].THEME.normal,
|
|
80
81
|
style: _pillButton["default"].Style.BRAND,
|
|
81
82
|
type: _pillButton["default"].Type.PRIMARY,
|
|
82
|
-
disabled: false
|
|
83
|
+
disabled: false,
|
|
84
|
+
loading: false
|
|
83
85
|
};
|
|
84
86
|
toggleIconDisplay.parameters = {
|
|
85
87
|
controls: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.20.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": "7ed51c66628809d7ae701604d42d12cbb5dedbcc"
|
|
48
48
|
}
|