@spark-web/button 1.5.1 → 1.5.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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @spark-web/button
|
|
2
2
|
|
|
3
|
+
## 1.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#451](https://github.com/brighte-labs/spark-web/pull/451)
|
|
8
|
+
[`02b6077`](https://github.com/brighte-labs/spark-web/commit/02b60775c2ea8e2f2c3ef27c5d4030e1b343fb92)
|
|
9
|
+
Thanks [@michtntbrighte](https://github.com/michtntbrighte)! - Fix button
|
|
10
|
+
loading and disabled state
|
|
11
|
+
|
|
3
12
|
## 1.5.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -397,8 +397,6 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
397
397
|
_useButtonStyles2 = _slicedToArray(_useButtonStyles, 2),
|
|
398
398
|
boxProps = _useButtonStyles2[0],
|
|
399
399
|
buttonStyles = _useButtonStyles2[1];
|
|
400
|
-
var isDisabled = disabled || loading;
|
|
401
|
-
var isLoading = loading && !disabled;
|
|
402
400
|
var variant = variants[prominence][tone];
|
|
403
401
|
return /*#__PURE__*/jsxRuntime.jsxs(BaseButton, _objectSpread(_objectSpread({}, boxProps), {}, {
|
|
404
402
|
"aria-controls": ariaControls,
|
|
@@ -407,17 +405,17 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
407
405
|
"aria-label": props.label,
|
|
408
406
|
className: css.css(buttonStyles),
|
|
409
407
|
data: data,
|
|
410
|
-
disabled:
|
|
408
|
+
disabled: loading || disabled,
|
|
411
409
|
id: id,
|
|
412
410
|
onClick: onClick,
|
|
413
411
|
ref: forwardedRef,
|
|
414
412
|
type: type,
|
|
415
413
|
children: [resolveButtonChildren(_objectSpread(_objectSpread({}, props), {}, {
|
|
416
|
-
isLoading:
|
|
414
|
+
isLoading: loading,
|
|
417
415
|
prominence: prominence,
|
|
418
416
|
size: size,
|
|
419
417
|
tone: tone
|
|
420
|
-
})),
|
|
418
|
+
})), loading && /*#__PURE__*/jsxRuntime.jsx(Loading, {
|
|
421
419
|
tone: variant === null || variant === void 0 ? void 0 : variant.textTone
|
|
422
420
|
})]
|
|
423
421
|
}));
|
|
@@ -397,8 +397,6 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
397
397
|
_useButtonStyles2 = _slicedToArray(_useButtonStyles, 2),
|
|
398
398
|
boxProps = _useButtonStyles2[0],
|
|
399
399
|
buttonStyles = _useButtonStyles2[1];
|
|
400
|
-
var isDisabled = disabled || loading;
|
|
401
|
-
var isLoading = loading && !disabled;
|
|
402
400
|
var variant = variants[prominence][tone];
|
|
403
401
|
return /*#__PURE__*/jsxRuntime.jsxs(BaseButton, _objectSpread(_objectSpread({}, boxProps), {}, {
|
|
404
402
|
"aria-controls": ariaControls,
|
|
@@ -407,17 +405,17 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
407
405
|
"aria-label": props.label,
|
|
408
406
|
className: css.css(buttonStyles),
|
|
409
407
|
data: data,
|
|
410
|
-
disabled:
|
|
408
|
+
disabled: loading || disabled,
|
|
411
409
|
id: id,
|
|
412
410
|
onClick: onClick,
|
|
413
411
|
ref: forwardedRef,
|
|
414
412
|
type: type,
|
|
415
413
|
children: [resolveButtonChildren(_objectSpread(_objectSpread({}, props), {}, {
|
|
416
|
-
isLoading:
|
|
414
|
+
isLoading: loading,
|
|
417
415
|
prominence: prominence,
|
|
418
416
|
size: size,
|
|
419
417
|
tone: tone
|
|
420
|
-
})),
|
|
418
|
+
})), loading && /*#__PURE__*/jsxRuntime.jsx(Loading, {
|
|
421
419
|
tone: variant === null || variant === void 0 ? void 0 : variant.textTone
|
|
422
420
|
})]
|
|
423
421
|
}));
|
|
@@ -393,8 +393,6 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
393
393
|
_useButtonStyles2 = _slicedToArray(_useButtonStyles, 2),
|
|
394
394
|
boxProps = _useButtonStyles2[0],
|
|
395
395
|
buttonStyles = _useButtonStyles2[1];
|
|
396
|
-
var isDisabled = disabled || loading;
|
|
397
|
-
var isLoading = loading && !disabled;
|
|
398
396
|
var variant = variants[prominence][tone];
|
|
399
397
|
return /*#__PURE__*/jsxs(BaseButton, _objectSpread(_objectSpread({}, boxProps), {}, {
|
|
400
398
|
"aria-controls": ariaControls,
|
|
@@ -403,17 +401,17 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
403
401
|
"aria-label": props.label,
|
|
404
402
|
className: css(buttonStyles),
|
|
405
403
|
data: data,
|
|
406
|
-
disabled:
|
|
404
|
+
disabled: loading || disabled,
|
|
407
405
|
id: id,
|
|
408
406
|
onClick: onClick,
|
|
409
407
|
ref: forwardedRef,
|
|
410
408
|
type: type,
|
|
411
409
|
children: [resolveButtonChildren(_objectSpread(_objectSpread({}, props), {}, {
|
|
412
|
-
isLoading:
|
|
410
|
+
isLoading: loading,
|
|
413
411
|
prominence: prominence,
|
|
414
412
|
size: size,
|
|
415
413
|
tone: tone
|
|
416
|
-
})),
|
|
414
|
+
})), loading && /*#__PURE__*/jsx(Loading, {
|
|
417
415
|
tone: variant === null || variant === void 0 ? void 0 : variant.textTone
|
|
418
416
|
})]
|
|
419
417
|
}));
|