@cloudflare/component-button 3.1.14 → 3.1.17
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 +24 -0
- package/dist/Button.d.ts +2 -0
- package/es/Button.js +11 -3
- package/lib/Button.js +11 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.17](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.1.16...@cloudflare/component-button@3.1.17) (2022-05-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.1.16](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.1.15...@cloudflare/component-button@3.1.16) (2022-05-03)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.1.15](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.1.14...@cloudflare/component-button@3.1.15) (2022-04-29)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [3.1.14](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@3.1.13...@cloudflare/component-button@3.1.14) (2022-04-29)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @cloudflare/component-button
|
package/dist/Button.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ declare type Props = {
|
|
|
106
106
|
iconType?: IconType;
|
|
107
107
|
iconLabel?: string;
|
|
108
108
|
iconSize?: number;
|
|
109
|
+
iconPosition?: 'left' | 'right';
|
|
109
110
|
ariaLabel?: string;
|
|
110
111
|
stretch?: boolean;
|
|
111
112
|
noWrapText?: boolean;
|
|
@@ -132,6 +133,7 @@ declare const _default: React.ComponentType<{
|
|
|
132
133
|
iconType?: IconType | undefined;
|
|
133
134
|
iconLabel?: string | undefined;
|
|
134
135
|
iconSize?: number | undefined;
|
|
136
|
+
iconPosition?: "right" | "left" | undefined;
|
|
135
137
|
noWrapText?: boolean | undefined;
|
|
136
138
|
p?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
|
|
137
139
|
color?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
package/es/Button.js
CHANGED
|
@@ -250,6 +250,8 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
250
250
|
iconType = props.iconType,
|
|
251
251
|
iconLabel = props.iconLabel,
|
|
252
252
|
iconSize = props.iconSize,
|
|
253
|
+
_props$iconPosition = props.iconPosition,
|
|
254
|
+
iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition,
|
|
253
255
|
form = props.form,
|
|
254
256
|
tabIndex = props.tabIndex,
|
|
255
257
|
ariaLabel = props.ariaLabel;
|
|
@@ -266,11 +268,17 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
266
268
|
tabIndex: tabIndex,
|
|
267
269
|
ref: ref,
|
|
268
270
|
"aria-label": ariaLabel
|
|
269
|
-
}), iconType && /*#__PURE__*/React.createElement(Icon, {
|
|
271
|
+
}), iconType && iconPosition === 'left' && /*#__PURE__*/React.createElement(Icon, {
|
|
270
272
|
size: iconSize,
|
|
271
273
|
type: iconType,
|
|
272
|
-
label: iconLabel || false
|
|
273
|
-
|
|
274
|
+
label: iconLabel || false,
|
|
275
|
+
mr: 1
|
|
276
|
+
}), children, iconType && iconPosition === 'right' && /*#__PURE__*/React.createElement(Icon, {
|
|
277
|
+
size: iconSize,
|
|
278
|
+
type: iconType,
|
|
279
|
+
label: iconLabel || false,
|
|
280
|
+
ml: 1
|
|
281
|
+
}));
|
|
274
282
|
});
|
|
275
283
|
Button.propTypes = {
|
|
276
284
|
onClick: PropTypes.func,
|
package/lib/Button.js
CHANGED
|
@@ -269,6 +269,8 @@ var Button = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
269
269
|
iconType = props.iconType,
|
|
270
270
|
iconLabel = props.iconLabel,
|
|
271
271
|
iconSize = props.iconSize,
|
|
272
|
+
_props$iconPosition = props.iconPosition,
|
|
273
|
+
iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition,
|
|
272
274
|
form = props.form,
|
|
273
275
|
tabIndex = props.tabIndex,
|
|
274
276
|
ariaLabel = props.ariaLabel;
|
|
@@ -287,11 +289,17 @@ var Button = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
287
289
|
tabIndex: tabIndex,
|
|
288
290
|
ref: ref,
|
|
289
291
|
"aria-label": ariaLabel
|
|
290
|
-
}), iconType && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
292
|
+
}), iconType && iconPosition === 'left' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
291
293
|
size: iconSize,
|
|
292
294
|
type: iconType,
|
|
293
|
-
label: iconLabel || false
|
|
294
|
-
|
|
295
|
+
label: iconLabel || false,
|
|
296
|
+
mr: 1
|
|
297
|
+
}), children, iconType && iconPosition === 'right' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
298
|
+
size: iconSize,
|
|
299
|
+
type: iconType,
|
|
300
|
+
label: iconLabel || false,
|
|
301
|
+
ml: 1
|
|
302
|
+
}));
|
|
295
303
|
});
|
|
296
304
|
|
|
297
305
|
Button.propTypes = {
|
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.1.
|
|
4
|
+
"version": "3.1.17",
|
|
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.1.
|
|
16
|
-
"@cloudflare/style-const": "^5.2.
|
|
17
|
-
"@cloudflare/style-container": "^7.8.
|
|
15
|
+
"@cloudflare/component-icon": "^7.1.8",
|
|
16
|
+
"@cloudflare/style-const": "^5.2.30",
|
|
17
|
+
"@cloudflare/style-container": "^7.8.13",
|
|
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": "4bfa1504713e2d11ebff83cc2a900c05d09e7df8"
|
|
36
36
|
}
|