@twreporter/react-components 8.9.0 → 8.10.0-rc.2
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 +39 -0
- package/lib/bookmark-list/index.js +129 -170
- 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 +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,45 @@
|
|
|
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.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.10.0-rc.1...@twreporter/react-components@8.10.0-rc.2) (2022-06-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* new bookmark should be fetched when mount ([9bb438f](https://github.com/twreporter/twreporter-npm-packages/commit/9bb438f81bd321fee47f55c872589091d8db8be6))
|
|
12
|
+
* remove redundant code ([7468cfa](https://github.com/twreporter/twreporter-npm-packages/commit/7468cfab10a51d092548191d14ab7eeb7839c871))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [8.10.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.10.0-rc.0...@twreporter/react-components@8.10.0-rc.1) (2022-06-14)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* bookmark should fetch upstream when page mount ([defb7b8](https://github.com/twreporter/twreporter-npm-packages/commit/defb7b8ae26cb4179dfb59c4392472e6bebe7906))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# [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)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* adjustment style & animation ([1694069](https://github.com/twreporter/twreporter-npm-packages/commit/1694069e769e685b6ec892e0d736111023c1319a))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* add article tool bar & snackbar component ([942328d](https://github.com/twreporter/twreporter-npm-packages/commit/942328d7f9175a39bf74f3650f148e29e5d12274))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
6
45
|
# [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
46
|
|
|
8
47
|
**Note:** Version bump only for package @twreporter/react-components
|
|
@@ -13,7 +13,7 @@ var _CSSTransition = _interopRequireDefault(require("react-transition-group/CSST
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
16
|
-
var _react =
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
19
|
|
|
@@ -39,31 +39,25 @@ var _get = _interopRequireDefault(require("lodash/get"));
|
|
|
39
39
|
|
|
40
40
|
var _map = _interopRequireDefault(require("lodash/map"));
|
|
41
41
|
|
|
42
|
+
var _slice = _interopRequireDefault(require("lodash/slice"));
|
|
43
|
+
|
|
42
44
|
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); }
|
|
43
45
|
|
|
44
46
|
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; }
|
|
45
47
|
|
|
46
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
47
49
|
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
51
|
-
|
|
52
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
53
|
-
|
|
54
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
50
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
55
51
|
|
|
56
|
-
function
|
|
52
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
57
53
|
|
|
58
|
-
function
|
|
54
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
59
55
|
|
|
60
|
-
function
|
|
56
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
61
57
|
|
|
62
|
-
function
|
|
58
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
63
59
|
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
60
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
67
61
|
|
|
68
62
|
var _twreporterRedux$acti = _redux["default"].actions,
|
|
69
63
|
deleteSingleBookmark = _twreporterRedux$acti.deleteSingleBookmark,
|
|
@@ -72,7 +66,8 @@ var reduxStatePropKeys = _redux["default"].reduxStateFields;
|
|
|
72
66
|
var _ = {
|
|
73
67
|
findIndex: _findIndex["default"],
|
|
74
68
|
get: _get["default"],
|
|
75
|
-
map: _map["default"]
|
|
69
|
+
map: _map["default"],
|
|
70
|
+
slice: _slice["default"]
|
|
76
71
|
};
|
|
77
72
|
var defaultLimit = 5;
|
|
78
73
|
var defaultSort = 'created_at';
|
|
@@ -109,167 +104,131 @@ var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
109
104
|
componentId: "w84xlj-1"
|
|
110
105
|
})(["", ""], reactTransitionCSS);
|
|
111
106
|
|
|
112
|
-
var BookmarkList =
|
|
113
|
-
|
|
107
|
+
var BookmarkList = function BookmarkList(_ref) {
|
|
108
|
+
var _ref$releaseBranch = _ref.releaseBranch,
|
|
109
|
+
releaseBranch = _ref$releaseBranch === void 0 ? _releaseBranch["default"].master : _ref$releaseBranch,
|
|
110
|
+
bookmarks = _ref.bookmarks,
|
|
111
|
+
total = _ref.total,
|
|
112
|
+
getMultipleBookmarks = _ref.getMultipleBookmarks,
|
|
113
|
+
deleteSingleBookmark = _ref.deleteSingleBookmark,
|
|
114
|
+
isAuthed = _ref.isAuthed,
|
|
115
|
+
jwt = _ref.jwt,
|
|
116
|
+
userID = _ref.userID;
|
|
117
|
+
|
|
118
|
+
var _useState = (0, _react.useState)(false),
|
|
119
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
120
|
+
showConfirmation = _useState2[0],
|
|
121
|
+
setShowConfirmation = _useState2[1];
|
|
122
|
+
|
|
123
|
+
var _useState3 = (0, _react.useState)(),
|
|
124
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
125
|
+
idToBeDeleted = _useState4[0],
|
|
126
|
+
setIdToBeDeleted = _useState4[1];
|
|
127
|
+
|
|
128
|
+
var _useState5 = (0, _react.useState)(total <= defaultLimit ? total : defaultLimit),
|
|
129
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
130
|
+
numberToShow = _useState6[0],
|
|
131
|
+
setNumberToShow = _useState6[1];
|
|
132
|
+
|
|
133
|
+
var _useState7 = (0, _react.useState)(bookmarks),
|
|
134
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
135
|
+
bookmarkToShow = _useState8[0],
|
|
136
|
+
setBookmarkToShow = _useState8[1];
|
|
137
|
+
|
|
138
|
+
var _defaultBodyOverflow = 'scroll';
|
|
139
|
+
(0, _react.useEffect)(function () {
|
|
140
|
+
// check authorization
|
|
141
|
+
// redirect to singin page if user has not been authorized
|
|
142
|
+
if (!isAuthed || !jwt) {
|
|
143
|
+
var currentHref = typeof window === 'undefined' ? '' : window.location.href;
|
|
144
|
+
window.location.href = (0, _signInHref.getSignInHref)(currentHref);
|
|
145
|
+
} // set overflow value
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
_defaultBodyOverflow = _.get(document, 'body.style.overflow', _defaultBodyOverflow); // check bookmark update
|
|
149
|
+
|
|
150
|
+
var offset = 0;
|
|
151
|
+
getMultipleBookmarks(jwt, userID, offset, defaultLimit, defaultSort);
|
|
152
|
+
}, []);
|
|
153
|
+
(0, _react.useEffect)(function () {
|
|
154
|
+
document.body.style.overflow = showConfirmation ? 'hidden' : _defaultBodyOverflow;
|
|
155
|
+
}, [showConfirmation]);
|
|
156
|
+
(0, _react.useEffect)(function () {
|
|
157
|
+
setBookmarkToShow(_.slice(bookmarks, 0, numberToShow));
|
|
158
|
+
}, [numberToShow, bookmarks]);
|
|
159
|
+
(0, _react.useEffect)(function () {
|
|
160
|
+
if (total - numberToShow < defaultLimit) {
|
|
161
|
+
setNumberToShow(total);
|
|
162
|
+
}
|
|
163
|
+
}, [total]);
|
|
114
164
|
|
|
115
|
-
var
|
|
165
|
+
var loadMoreBookmarks = function loadMoreBookmarks() {
|
|
166
|
+
var nextNumberToShow = numberToShow + defaultLimit < total ? numberToShow + defaultLimit : total;
|
|
116
167
|
|
|
117
|
-
|
|
118
|
-
|
|
168
|
+
if (total === bookmarks.length) {
|
|
169
|
+
setNumberToShow(nextNumberToShow);
|
|
170
|
+
} else if (numberToShow < total) {
|
|
171
|
+
var offset = numberToShow;
|
|
172
|
+
getMultipleBookmarks(jwt, userID, offset, defaultLimit, defaultSort);
|
|
173
|
+
setNumberToShow(nextNumberToShow);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
119
176
|
|
|
120
|
-
|
|
177
|
+
var hideComfirmation = function hideComfirmation() {
|
|
178
|
+
setShowConfirmation(false);
|
|
179
|
+
};
|
|
121
180
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
idToBeDeleted: null
|
|
126
|
-
};
|
|
127
|
-
_this.loadMoreBookmarks = _this.loadMoreBookmarks.bind(_assertThisInitialized(_this));
|
|
128
|
-
_this.handleDeleteButtonClicked = _this.handleDeleteButtonClicked.bind(_assertThisInitialized(_this));
|
|
129
|
-
_this.hideComfirmation = _this.hideComfirmation.bind(_assertThisInitialized(_this));
|
|
130
|
-
_this.handleDeletingConfirmed = _this.handleDeletingConfirmed.bind(_assertThisInitialized(_this));
|
|
131
|
-
_this._defaultBodyOverflow = 'scroll';
|
|
132
|
-
return _this;
|
|
133
|
-
}
|
|
181
|
+
var showComfirmation = function showComfirmation() {
|
|
182
|
+
setShowConfirmation(true);
|
|
183
|
+
};
|
|
134
184
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var offset = 0;
|
|
148
|
-
|
|
149
|
-
_getMultipleBookmarks(jwt, userID, offset, defaultLimit, defaultSort);
|
|
150
|
-
}
|
|
151
|
-
} // Redirect to singin page if user has not been authorized
|
|
152
|
-
|
|
153
|
-
}, {
|
|
154
|
-
key: "checkAuthorization",
|
|
155
|
-
value: function checkAuthorization() {
|
|
156
|
-
var _this$props2 = this.props,
|
|
157
|
-
isAuthed = _this$props2.isAuthed,
|
|
158
|
-
jwt = _this$props2.jwt;
|
|
159
|
-
|
|
160
|
-
if (!isAuthed || !jwt) {
|
|
161
|
-
var currentHref = typeof window === 'undefined' ? '' : window.location.href;
|
|
162
|
-
window.location.href = (0, _signInHref.getSignInHref)(currentHref);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
key: "loadMoreBookmarks",
|
|
167
|
-
value: function loadMoreBookmarks() {
|
|
168
|
-
var _this$props3 = this.props,
|
|
169
|
-
total = _this$props3.total,
|
|
170
|
-
bookmarks = _this$props3.bookmarks,
|
|
171
|
-
jwt = _this$props3.jwt,
|
|
172
|
-
userID = _this$props3.userID,
|
|
173
|
-
getMultipleBookmarks = _this$props3.getMultipleBookmarks;
|
|
174
|
-
var offset = bookmarks.length;
|
|
175
|
-
|
|
176
|
-
if (offset < total) {
|
|
177
|
-
getMultipleBookmarks(jwt, userID, offset, defaultLimit, defaultSort);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}, {
|
|
181
|
-
key: "handleDeleteButtonClicked",
|
|
182
|
-
value: function handleDeleteButtonClicked(bookmarkID) {
|
|
183
|
-
this.setRecordToBeDeleted(bookmarkID);
|
|
184
|
-
this.showConfirmation();
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "setRecordToBeDeleted",
|
|
188
|
-
value: function setRecordToBeDeleted(bookmarkID) {
|
|
189
|
-
this.setState({
|
|
190
|
-
idToBeDeleted: bookmarkID
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}, {
|
|
194
|
-
key: "handleDeletingConfirmed",
|
|
195
|
-
value: function handleDeletingConfirmed() {
|
|
196
|
-
this.hideComfirmation();
|
|
197
|
-
var idToBeDeleted = this.state.idToBeDeleted;
|
|
198
|
-
|
|
199
|
-
if (typeof idToBeDeleted === 'number') {
|
|
200
|
-
var _this$props4 = this.props,
|
|
201
|
-
jwt = _this$props4.jwt,
|
|
202
|
-
userID = _this$props4.userID,
|
|
203
|
-
_deleteSingleBookmark = _this$props4.deleteSingleBookmark;
|
|
204
|
-
|
|
205
|
-
_deleteSingleBookmark(jwt, userID, idToBeDeleted);
|
|
206
|
-
} else {
|
|
207
|
-
console.error("Deleting bookmark failed. Bookmark id should be a number, but is ".concat(idToBeDeleted)); // eslint-disable-line no-console
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
this.setRecordToBeDeleted(null);
|
|
211
|
-
}
|
|
212
|
-
}, {
|
|
213
|
-
key: "hideComfirmation",
|
|
214
|
-
value: function hideComfirmation() {
|
|
215
|
-
var _this2 = this;
|
|
216
|
-
|
|
217
|
-
this.setState({
|
|
218
|
-
showConfirmation: false
|
|
219
|
-
}, function () {
|
|
220
|
-
document.body.style.overflow = _this2._defaultBodyOverflow;
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}, {
|
|
224
|
-
key: "showConfirmation",
|
|
225
|
-
value: function showConfirmation() {
|
|
226
|
-
this.setState({
|
|
227
|
-
showConfirmation: true
|
|
228
|
-
}, function () {
|
|
229
|
-
document.body.style.overflow = 'hidden';
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}, {
|
|
233
|
-
key: "render",
|
|
234
|
-
value: function render() {
|
|
235
|
-
var _this$props5 = this.props,
|
|
236
|
-
isAuthed = _this$props5.isAuthed,
|
|
237
|
-
jwt = _this$props5.jwt;
|
|
238
|
-
if (!isAuthed || !jwt) return /*#__PURE__*/_react["default"].createElement(_redirectToSignIn["default"], null, "\u60A8\u5C1A\u672A\u767B\u5165\uFF0C\u5C07\u8DF3\u8F49\u81F3\u767B\u5165\u9801");
|
|
239
|
-
var _this$props6 = this.props,
|
|
240
|
-
bookmarks = _this$props6.bookmarks,
|
|
241
|
-
total = _this$props6.total,
|
|
242
|
-
releaseBranch = _this$props6.releaseBranch;
|
|
243
|
-
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(_bookmarks["default"], {
|
|
244
|
-
bookmarks: bookmarks,
|
|
245
|
-
handleDelete: this.handleDeleteButtonClicked,
|
|
246
|
-
total: total,
|
|
247
|
-
releaseBranch: releaseBranch
|
|
248
|
-
}), /*#__PURE__*/_react["default"].createElement(MoreContainer, {
|
|
249
|
-
hasMore: bookmarks.length < total
|
|
250
|
-
}, /*#__PURE__*/_react["default"].createElement(_more["default"], {
|
|
251
|
-
loadMore: this.loadMoreBookmarks
|
|
252
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, text.loadMore))), /*#__PURE__*/_react["default"].createElement(_CSSTransition["default"], {
|
|
253
|
-
classNames: transitionName,
|
|
254
|
-
"in": this.state.showConfirmation,
|
|
255
|
-
timeout: {
|
|
256
|
-
enter: transitionDuration.enter,
|
|
257
|
-
exit: transitionDuration.leave
|
|
258
|
-
},
|
|
259
|
-
mountOnEnter: true,
|
|
260
|
-
unmountOnExit: true
|
|
261
|
-
}, /*#__PURE__*/_react["default"].createElement(_confirmation["default"], {
|
|
262
|
-
onCancel: this.hideComfirmation,
|
|
263
|
-
onConfirm: this.handleDeletingConfirmed,
|
|
264
|
-
content: text.dialog.content,
|
|
265
|
-
confirm: text.dialog.confirm,
|
|
266
|
-
cancel: text.dialog.cancel
|
|
267
|
-
})));
|
|
185
|
+
var handleDeleteButtonClicked = function handleDeleteButtonClicked(bookmarkID) {
|
|
186
|
+
setIdToBeDeleted(bookmarkID);
|
|
187
|
+
showComfirmation();
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
var handleDeletingConfirmed = function handleDeletingConfirmed() {
|
|
191
|
+
hideComfirmation();
|
|
192
|
+
|
|
193
|
+
if (typeof idToBeDeleted === 'number') {
|
|
194
|
+
deleteSingleBookmark(jwt, userID, idToBeDeleted);
|
|
195
|
+
} else {
|
|
196
|
+
console.error("Deleting bookmark failed. Bookmark id should be a number, but is ".concat(idToBeDeleted)); // eslint-disable-line no-console
|
|
268
197
|
}
|
|
269
|
-
}]);
|
|
270
198
|
|
|
271
|
-
|
|
272
|
-
}
|
|
199
|
+
setIdToBeDeleted(null);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
if (!isAuthed || !jwt) {
|
|
203
|
+
return /*#__PURE__*/_react["default"].createElement(_redirectToSignIn["default"], null, "\u60A8\u5C1A\u672A\u767B\u5165\uFF0C\u5C07\u8DF3\u8F49\u81F3\u767B\u5165\u9801");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(_bookmarks["default"], {
|
|
207
|
+
bookmarks: bookmarkToShow,
|
|
208
|
+
handleDelete: handleDeleteButtonClicked,
|
|
209
|
+
total: total,
|
|
210
|
+
releaseBranch: releaseBranch
|
|
211
|
+
}), /*#__PURE__*/_react["default"].createElement(MoreContainer, {
|
|
212
|
+
hasMore: numberToShow < total
|
|
213
|
+
}, /*#__PURE__*/_react["default"].createElement(_more["default"], {
|
|
214
|
+
loadMore: loadMoreBookmarks
|
|
215
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, text.loadMore))), /*#__PURE__*/_react["default"].createElement(_CSSTransition["default"], {
|
|
216
|
+
classNames: transitionName,
|
|
217
|
+
"in": showConfirmation,
|
|
218
|
+
timeout: {
|
|
219
|
+
enter: transitionDuration.enter,
|
|
220
|
+
exit: transitionDuration.leave
|
|
221
|
+
},
|
|
222
|
+
mountOnEnter: true,
|
|
223
|
+
unmountOnExit: true
|
|
224
|
+
}, /*#__PURE__*/_react["default"].createElement(_confirmation["default"], {
|
|
225
|
+
onCancel: hideComfirmation,
|
|
226
|
+
onConfirm: handleDeletingConfirmed,
|
|
227
|
+
content: text.dialog.content,
|
|
228
|
+
confirm: text.dialog.confirm,
|
|
229
|
+
cancel: text.dialog.cancel
|
|
230
|
+
})));
|
|
231
|
+
};
|
|
273
232
|
|
|
274
233
|
BookmarkList.propTypes = {
|
|
275
234
|
releaseBranch: _propTypes2["default"].releaseBranch,
|
|
@@ -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.2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@twreporter/core": "^1.4.1",
|
|
19
|
-
"@twreporter/redux": "^7.2.
|
|
19
|
+
"@twreporter/redux": "^7.2.2-rc.0",
|
|
20
20
|
"hoist-non-react-statics": "^2.3.1",
|
|
21
21
|
"lodash": "^4.0.0",
|
|
22
22
|
"memoize-one": "^5.0.5",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"babel-loader": "^8.2.4",
|
|
45
45
|
"chromatic": "^6.5.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "e09f2e6df336ce4eb476ad56c5353a96f32159ac"
|
|
48
48
|
}
|