@twreporter/react-components 8.20.1 → 8.21.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 +11 -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/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* cursor default while disabled ([301b3a5](https://github.com/twreporter/twreporter-npm-packages/commit/301b3a577e15a4be479686e8db35239d2fa55490))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [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
18
|
|
|
8
19
|
**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,
|
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.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": "a7d72ecffd859bfa778c70cb8b5b4b3419838fd4"
|
|
48
48
|
}
|