@cloudflare/component-button 3.0.3 → 3.1.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 +33 -0
- package/dist/IconTextButton.d.ts +1 -0
- package/es/IconTextButton.js +7 -2
- package/lib/IconTextButton.js +8 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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
|
+
# [3.1.0](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.0.5...@cloudflare/component-button@3.1.0) (2022-03-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **stratus:** A11Y-106 conflicting files ([19209dc](http://stash.cfops.it:7999/fe/stratus/commits/19209dc))
|
|
12
|
+
* **stratus:** A11Y-106 merge conflicting file ([940a252](http://stash.cfops.it:7999/fe/stratus/commits/940a252))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **stratus:** UI-5116 added iconPosition to IconTextButton ([99fea39](http://stash.cfops.it:7999/fe/stratus/commits/99fea39))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [3.0.5](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.0.4...@cloudflare/component-button@3.0.5) (2022-03-23)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [3.0.4](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.0.3...@cloudflare/component-button@3.0.4) (2022-03-23)
|
|
32
|
+
|
|
33
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [3.0.3](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.0.2...@cloudflare/component-button@3.0.3) (2022-03-22)
|
|
7
40
|
|
|
8
41
|
**Note:** Version bump only for package @cloudflare/component-button
|
package/dist/IconTextButton.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IconType } from '@cloudflare/component-icon';
|
|
|
3
3
|
declare type IconTextButtonProps = {
|
|
4
4
|
onClick: (e: React.MouseEvent<any>) => void;
|
|
5
5
|
iconType: IconType;
|
|
6
|
+
iconPosition?: 'left' | 'right';
|
|
6
7
|
};
|
|
7
8
|
declare const IconTextButton: React.FC<IconTextButtonProps>;
|
|
8
9
|
export default IconTextButton;
|
package/es/IconTextButton.js
CHANGED
|
@@ -10,14 +10,19 @@ const IconTextWrapper = createStyledComponent(() => ({
|
|
|
10
10
|
const IconTextButton = ({
|
|
11
11
|
onClick,
|
|
12
12
|
iconType,
|
|
13
|
+
iconPosition = 'left',
|
|
13
14
|
children
|
|
14
15
|
}) => /*#__PURE__*/React.createElement(TextButton, {
|
|
15
16
|
type: "button",
|
|
16
17
|
onClick: onClick
|
|
17
|
-
}, /*#__PURE__*/React.createElement(IconTextWrapper, null, /*#__PURE__*/React.createElement(Icon, {
|
|
18
|
+
}, /*#__PURE__*/React.createElement(IconTextWrapper, null, iconPosition === 'left' && /*#__PURE__*/React.createElement(Icon, {
|
|
18
19
|
type: iconType,
|
|
19
20
|
mr: 1,
|
|
20
21
|
label: iconType
|
|
21
|
-
}), children
|
|
22
|
+
}), children, iconPosition === 'right' && /*#__PURE__*/React.createElement(Icon, {
|
|
23
|
+
type: iconType,
|
|
24
|
+
ml: 1,
|
|
25
|
+
label: iconType
|
|
26
|
+
})));
|
|
22
27
|
|
|
23
28
|
export default IconTextButton;
|
package/lib/IconTextButton.js
CHANGED
|
@@ -25,15 +25,21 @@ var IconTextWrapper = (0, _styleContainer.createStyledComponent)(function () {
|
|
|
25
25
|
var IconTextButton = function IconTextButton(_ref) {
|
|
26
26
|
var onClick = _ref.onClick,
|
|
27
27
|
iconType = _ref.iconType,
|
|
28
|
+
_ref$iconPosition = _ref.iconPosition,
|
|
29
|
+
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
28
30
|
children = _ref.children;
|
|
29
31
|
return /*#__PURE__*/_react.default.createElement(_TextButton.default, {
|
|
30
32
|
type: "button",
|
|
31
33
|
onClick: onClick
|
|
32
|
-
}, /*#__PURE__*/_react.default.createElement(IconTextWrapper, null, /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(IconTextWrapper, null, iconPosition === 'left' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
33
35
|
type: iconType,
|
|
34
36
|
mr: 1,
|
|
35
37
|
label: iconType
|
|
36
|
-
}), children
|
|
38
|
+
}), children, iconPosition === 'right' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
39
|
+
type: iconType,
|
|
40
|
+
ml: 1,
|
|
41
|
+
label: iconType
|
|
42
|
+
})));
|
|
37
43
|
};
|
|
38
44
|
|
|
39
45
|
var _default = IconTextButton;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-button",
|
|
3
3
|
"description": "Cloudflare Button Component",
|
|
4
|
-
"version": "3.0
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "James Kyle <jkyle@cloudflare.com>",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@cloudflare/component-icon": "^7.0.
|
|
16
|
-
"@cloudflare/style-const": "^5.2.
|
|
17
|
-
"@cloudflare/style-container": "^7.7.
|
|
15
|
+
"@cloudflare/component-icon": "^7.0.5",
|
|
16
|
+
"@cloudflare/style-const": "^5.2.17",
|
|
17
|
+
"@cloudflare/style-container": "^7.7.8",
|
|
18
18
|
"polished": "^4.1.4",
|
|
19
19
|
"prop-types": "^15.6.0"
|
|
20
20
|
},
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"test-coverage": "stratus test --coverage",
|
|
33
33
|
"test-watch": "stratus test --watch"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "f8b1efedfe36a620b3ea17dc59c6168cf2a2ef13"
|
|
36
36
|
}
|