@twreporter/react-components 8.20.1 → 8.21.0-rc.1
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 +22 -0
- package/lib/button/components/iconButton.js +5 -2
- package/lib/button/components/iconWithTextButton.js +5 -2
- package/lib/button/components/pillButton.js +5 -2
- package/lib/button/components/textButton.js +5 -2
- package/lib/button/components/toggleButton.js +8 -2
- package/lib/button/utils/theme.js +16 -16
- package/lib/input/utils/theme.js +1 -1
- package/package.json +4 -4
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.21.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.21.0-rc.0...@twreporter/react-components@8.21.0-rc.1) (2023-11-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* use design guideline color in article page ([5d38172](https://github.com/twreporter/twreporter-npm-packages/commit/5d381721915792919d827d5b3a39785aac3b70bf))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [8.21.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.20.1...@twreporter/react-components@8.21.0-rc.0) (2023-11-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* cursor default while disabled ([301b3a5](https://github.com/twreporter/twreporter-npm-packages/commit/301b3a577e15a4be479686e8db35239d2fa55490))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [8.20.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.20.1-rc.0...@twreporter/react-components@8.20.1) (2023-10-30)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @twreporter/react-components
|
|
@@ -36,7 +36,9 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
36
36
|
var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
37
37
|
displayName: "iconButton__ButtonContainer",
|
|
38
38
|
componentId: "sc-1v7s35n-0"
|
|
39
|
-
})(["cursor:
|
|
39
|
+
})(["cursor:", ";display:flex;svg{width:24px;height:24px;background-color:", ";}", ""], function (props) {
|
|
40
|
+
return props.disabled ? 'default' : 'pointer';
|
|
41
|
+
}, function (props) {
|
|
40
42
|
return props.color;
|
|
41
43
|
}, _mediaQuery["default"].desktopAndAbove(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:hover svg {\n background-color: ", ";\n }\n "])), function (props) {
|
|
42
44
|
return props.hoverColor;
|
|
@@ -62,7 +64,8 @@ var IconButton = function IconButton(_ref) {
|
|
|
62
64
|
|
|
63
65
|
return /*#__PURE__*/_react["default"].createElement(ButtonContainer, _extends({
|
|
64
66
|
color: color,
|
|
65
|
-
hoverColor: hoverColor
|
|
67
|
+
hoverColor: hoverColor,
|
|
68
|
+
disabled: disabled
|
|
66
69
|
}, props), iconComponent);
|
|
67
70
|
};
|
|
68
71
|
|
|
@@ -28,7 +28,9 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
28
28
|
var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
29
29
|
displayName: "iconWithTextButton__ButtonContainer",
|
|
30
30
|
componentId: "sc-1f9d1q4-0"
|
|
31
|
-
})(["cursor:
|
|
31
|
+
})(["cursor:", ";display:flex;flex-direction:column;align-items:center;color:", ";svg{width:24px;height:24px;background-color:", ";}", ""], function (props) {
|
|
32
|
+
return props.disabled ? 'default' : 'pointer';
|
|
33
|
+
}, function (props) {
|
|
32
34
|
return props.color;
|
|
33
35
|
}, function (props) {
|
|
34
36
|
return props.color;
|
|
@@ -66,7 +68,8 @@ var IconWithTextButton = function IconWithTextButton(_ref) {
|
|
|
66
68
|
|
|
67
69
|
return /*#__PURE__*/_react["default"].createElement(ButtonContainer, {
|
|
68
70
|
color: color,
|
|
69
|
-
hoverColor: hoverColor
|
|
71
|
+
hoverColor: hoverColor,
|
|
72
|
+
disabled: disabled
|
|
70
73
|
}, iconComponent, /*#__PURE__*/_react["default"].createElement(StyledP3, {
|
|
71
74
|
text: text,
|
|
72
75
|
weight: _paragraph.P3.Weight.NORMAL,
|
|
@@ -44,7 +44,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
44
44
|
var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
45
45
|
displayName: "pillButton__ButtonContainer",
|
|
46
46
|
componentId: "xa7tsy-0"
|
|
47
|
-
})(["width:fit-content;display:flex;align-items:center;border-radius:40px;background-color:", ";border-color:", ";border-style:solid;border-width:1.5px;color:", ";padding:", ";cursor:
|
|
47
|
+
})(["width:fit-content;display:flex;align-items:center;border-radius:40px;background-color:", ";border-color:", ";border-style:solid;border-width:1.5px;color:", ";padding:", ";cursor:", ";svg{height:", ";width:", ";background-color:", ";}&:hover{color:", ";background-color:", ";border-color:", ";svg{background-color:", ";}}"], function (props) {
|
|
48
48
|
return props.type === _enums.Type.PRIMARY ? props.bgColor : 'transparent';
|
|
49
49
|
}, function (props) {
|
|
50
50
|
return props.bgColor;
|
|
@@ -52,6 +52,8 @@ var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
52
52
|
return props.color;
|
|
53
53
|
}, function (props) {
|
|
54
54
|
return props.padding;
|
|
55
|
+
}, function (props) {
|
|
56
|
+
return props.disabled ? 'default' : 'pointer';
|
|
55
57
|
}, function (props) {
|
|
56
58
|
return props.iconSize;
|
|
57
59
|
}, function (props) {
|
|
@@ -147,7 +149,8 @@ var PillButton = function PillButton(_ref) {
|
|
|
147
149
|
bgColor: bgColor,
|
|
148
150
|
iconSize: iconSize,
|
|
149
151
|
hoverColor: hoverColor,
|
|
150
|
-
hoverBgColor: hoverBgColor
|
|
152
|
+
hoverBgColor: hoverBgColor,
|
|
153
|
+
disabled: disabled
|
|
151
154
|
}, props), /*#__PURE__*/_react["default"].createElement(RelativeParent, null, /*#__PURE__*/_react["default"].createElement(HideOnLoading, {
|
|
152
155
|
show: !loading
|
|
153
156
|
}, leftIconJSX, textJSX, rightIconJSX), /*#__PURE__*/_react["default"].createElement(Loader, {
|
|
@@ -42,7 +42,9 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
42
42
|
var ButtonContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
43
43
|
displayName: "textButton__ButtonContainer",
|
|
44
44
|
componentId: "sc-1lwyrq5-0"
|
|
45
|
-
})(["cursor:
|
|
45
|
+
})(["cursor:", ";display:flex;align-items:center;color:", ";svg{height:", ";width:", ";background-color:", ";}", ""], function (props) {
|
|
46
|
+
return props.disabled ? 'default' : 'pointer';
|
|
47
|
+
}, function (props) {
|
|
46
48
|
return props.color;
|
|
47
49
|
}, function (props) {
|
|
48
50
|
return props.iconSize;
|
|
@@ -111,7 +113,8 @@ var TextButton = function TextButton(_ref) {
|
|
|
111
113
|
return /*#__PURE__*/_react["default"].createElement(ButtonContainer, _extends({
|
|
112
114
|
color: color,
|
|
113
115
|
hoverColor: hoverColor,
|
|
114
|
-
iconSize: iconSize
|
|
116
|
+
iconSize: iconSize,
|
|
117
|
+
disabled: disabled
|
|
115
118
|
}, props), size === _sharedEnum.Size.L ? /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
116
119
|
isLeft: true
|
|
117
120
|
}, leftIconComponent) : leftIconComponent, textJSX, size === _sharedEnum.Size.L ? /*#__PURE__*/_react["default"].createElement(IconContainer, null, rightIconComponent) : rightIconComponent);
|
|
@@ -19,6 +19,8 @@ var _excluded = ["value", "labelOn", "labelOff", "disabled", "onChange"];
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
22
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
25
|
|
|
24
26
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -36,7 +38,9 @@ var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
36
38
|
var Label = /*#__PURE__*/_styledComponents["default"].label.withConfig({
|
|
37
39
|
displayName: "toggleButton__Label",
|
|
38
40
|
componentId: "sc-183g3tk-2"
|
|
39
|
-
})(["display:flex;align-items:center;gap:10px;cursor:
|
|
41
|
+
})(["display:flex;align-items:center;gap:10px;cursor:", ";"], function (props) {
|
|
42
|
+
return props.disabled ? 'default' : 'pointer';
|
|
43
|
+
});
|
|
40
44
|
|
|
41
45
|
var Switch = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
42
46
|
displayName: "toggleButton__Switch",
|
|
@@ -71,7 +75,9 @@ var ToggleButton = function ToggleButton(_ref) {
|
|
|
71
75
|
|
|
72
76
|
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ColorP2, {
|
|
73
77
|
text: value ? labelOn : labelOff
|
|
74
|
-
}), /*#__PURE__*/_react["default"].createElement(Label,
|
|
78
|
+
}), /*#__PURE__*/_react["default"].createElement(Label, _extends({
|
|
79
|
+
disabled: disabled
|
|
80
|
+
}, props), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
75
81
|
type: "checkbox",
|
|
76
82
|
disabled: disabled,
|
|
77
83
|
checked: value,
|
|
@@ -37,7 +37,7 @@ var getFilledPillButtonTheme = function getFilledPillButtonTheme(theme, disabled
|
|
|
37
37
|
case _theme.THEME.photography:
|
|
38
38
|
return {
|
|
39
39
|
color: _color.colorPhoto.dark,
|
|
40
|
-
bgColor: _color.colorSupportive.
|
|
40
|
+
bgColor: _color.colorSupportive.pastel,
|
|
41
41
|
hoverColor: _color.colorGrayscale.white,
|
|
42
42
|
hoverBgColor: _color.colorSupportive.heavy
|
|
43
43
|
};
|
|
@@ -117,8 +117,8 @@ var getOutlinePillButtonTheme = function getOutlinePillButtonTheme(theme, disabl
|
|
|
117
117
|
switch (theme) {
|
|
118
118
|
case _theme.THEME.photography:
|
|
119
119
|
return {
|
|
120
|
-
color: _color.colorSupportive.
|
|
121
|
-
bgColor: _color.colorSupportive.
|
|
120
|
+
color: _color.colorSupportive.pastel,
|
|
121
|
+
bgColor: _color.colorSupportive.pastel,
|
|
122
122
|
hoverColor: _color.colorSupportive.heavy,
|
|
123
123
|
hoverBgColor: _color.colorSupportive.heavy
|
|
124
124
|
};
|
|
@@ -180,13 +180,13 @@ var getPrimaryIconButtonTheme = function getPrimaryIconButtonTheme(theme, isActi
|
|
|
180
180
|
case _theme.THEME.photography:
|
|
181
181
|
return {
|
|
182
182
|
color: _color.colorGrayscale.white,
|
|
183
|
-
hoverColor: _color.colorSupportive.
|
|
183
|
+
hoverColor: _color.colorSupportive.pastel
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
case "".concat(_theme.THEME.photography, "-active"):
|
|
187
187
|
return {
|
|
188
|
-
color: _color.colorSupportive.
|
|
189
|
-
hoverColor: _color.colorSupportive.
|
|
188
|
+
color: _color.colorSupportive.pastel,
|
|
189
|
+
hoverColor: _color.colorSupportive.pastel
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
case _theme.THEME.transparent:
|
|
@@ -232,13 +232,13 @@ var getSecondaryIconButtonTheme = function getSecondaryIconButtonTheme(theme, is
|
|
|
232
232
|
case _theme.THEME.photography:
|
|
233
233
|
return {
|
|
234
234
|
color: _color.colorGrayscale.gray400,
|
|
235
|
-
hoverColor: _color.colorSupportive.
|
|
235
|
+
hoverColor: _color.colorSupportive.pastel
|
|
236
236
|
};
|
|
237
237
|
|
|
238
238
|
case "".concat(_theme.THEME.photography, "-active"):
|
|
239
239
|
return {
|
|
240
|
-
color: _color.colorSupportive.
|
|
241
|
-
hoverColor: _color.colorSupportive.
|
|
240
|
+
color: _color.colorSupportive.pastel,
|
|
241
|
+
hoverColor: _color.colorSupportive.pastel
|
|
242
242
|
};
|
|
243
243
|
|
|
244
244
|
case _theme.THEME.transparent:
|
|
@@ -284,13 +284,13 @@ var getIconWithTextButtonTheme = function getIconWithTextButtonTheme(theme, isAc
|
|
|
284
284
|
case _theme.THEME.photography:
|
|
285
285
|
return {
|
|
286
286
|
color: _color.colorGrayscale.gray200,
|
|
287
|
-
hoverColor: _color.colorSupportive.
|
|
287
|
+
hoverColor: _color.colorSupportive.pastel
|
|
288
288
|
};
|
|
289
289
|
|
|
290
290
|
case "".concat(_theme.THEME.photography, "-active"):
|
|
291
291
|
return {
|
|
292
|
-
color: _color.colorSupportive.
|
|
293
|
-
hoverColor: _color.colorSupportive.
|
|
292
|
+
color: _color.colorSupportive.pastel,
|
|
293
|
+
hoverColor: _color.colorSupportive.pastel
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
case _theme.THEME.transparent:
|
|
@@ -327,7 +327,7 @@ var getPrimaryTextButtonTheme = function getPrimaryTextButtonTheme(theme, style)
|
|
|
327
327
|
case _theme.THEME.photography:
|
|
328
328
|
return {
|
|
329
329
|
color: _color.colorGrayscale.white,
|
|
330
|
-
hoverColor: _color.colorSupportive.
|
|
330
|
+
hoverColor: _color.colorSupportive.pastel
|
|
331
331
|
};
|
|
332
332
|
|
|
333
333
|
case _theme.THEME.transparent:
|
|
@@ -369,7 +369,7 @@ var getSecondaryTextButtonTheme = function getSecondaryTextButtonTheme(theme, st
|
|
|
369
369
|
case _theme.THEME.photography:
|
|
370
370
|
return {
|
|
371
371
|
color: _color.colorGrayscale.gray400,
|
|
372
|
-
hoverColor: _color.colorSupportive.
|
|
372
|
+
hoverColor: _color.colorSupportive.pastel
|
|
373
373
|
};
|
|
374
374
|
|
|
375
375
|
case _theme.THEME.transparent:
|
|
@@ -435,8 +435,8 @@ var getActiveTextButtonTheme = function getActiveTextButtonTheme(theme, style) {
|
|
|
435
435
|
switch (theme) {
|
|
436
436
|
case _theme.THEME.photography:
|
|
437
437
|
return {
|
|
438
|
-
color: _color.colorSupportive.
|
|
439
|
-
hoverColor: _color.colorSupportive.
|
|
438
|
+
color: _color.colorSupportive.pastel,
|
|
439
|
+
hoverColor: _color.colorSupportive.pastel
|
|
440
440
|
};
|
|
441
441
|
|
|
442
442
|
case _theme.THEME.transparent:
|
package/lib/input/utils/theme.js
CHANGED
|
@@ -16,7 +16,7 @@ var selectThemeStyle = function selectThemeStyle(theme) {
|
|
|
16
16
|
bgColor: _color.colorOpacity['white_0.8'],
|
|
17
17
|
focusBgColor: _color.colorGrayscale.gray100,
|
|
18
18
|
desktopBgColor: _color.colorGrayscale.gray100,
|
|
19
|
-
borderColor: _color.colorSupportive.
|
|
19
|
+
borderColor: _color.colorSupportive.pastel,
|
|
20
20
|
color: _color.colorGrayscale.gray800,
|
|
21
21
|
focusColor: _color.colorGrayscale.gray500,
|
|
22
22
|
placeholderColor: _color.colorGrayscale.gray800
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.21.0-rc.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"chromatic": "npx chromatic --exit-zero-on-changes"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@twreporter/core": "^1.13.0",
|
|
19
|
-
"@twreporter/redux": "^7.8.0",
|
|
18
|
+
"@twreporter/core": "^1.13.1-rc.0",
|
|
19
|
+
"@twreporter/redux": "^7.8.1-rc.0",
|
|
20
20
|
"fontfaceobserver-es": "^3.3.3",
|
|
21
21
|
"hoist-non-react-statics": "^2.3.1",
|
|
22
22
|
"lodash": "^4.0.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"babel-loader": "^8.2.4",
|
|
45
45
|
"chromatic": "^6.5.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "aa00452ea5c3557c71865aa121dfa630f84e6a04"
|
|
48
48
|
}
|