blue-react 11.0.2 → 11.0.3
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.
|
@@ -17,7 +17,8 @@ import { useEffect, useState } from "react";
|
|
|
17
17
|
import clsx from "clsx";
|
|
18
18
|
import { getPhrase } from "./shared.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
-
function getButtonVariantClass(variant,
|
|
20
|
+
function getButtonVariantClass(variant, buttonColor) {
|
|
21
|
+
var color = buttonColor || "secondary";
|
|
21
22
|
switch (variant) {
|
|
22
23
|
case "soft":
|
|
23
24
|
return "blue-btn-soft-".concat(color);
|
|
@@ -26,7 +27,7 @@ function getButtonVariantClass(variant, color) {
|
|
|
26
27
|
case "outline":
|
|
27
28
|
return "btn-outline-".concat(color);
|
|
28
29
|
case "link":
|
|
29
|
-
return "btn-link link-".concat(color
|
|
30
|
+
return "btn-link".concat(buttonColor !== undefined ? " link-".concat(color) : "");
|
|
30
31
|
case "menu-item":
|
|
31
32
|
return "blue-menu-item";
|
|
32
33
|
default:
|
|
@@ -39,8 +40,7 @@ export default function Button(_ref) {
|
|
|
39
40
|
type = _ref.type,
|
|
40
41
|
_ref$variant = _ref.variant,
|
|
41
42
|
variant = _ref$variant === void 0 ? "soft" : _ref$variant,
|
|
42
|
-
|
|
43
|
-
color = _ref$color === void 0 ? "secondary" : _ref$color,
|
|
43
|
+
color = _ref.color,
|
|
44
44
|
sm = _ref.sm,
|
|
45
45
|
lg = _ref.lg,
|
|
46
46
|
iconBefore = _ref.iconBefore,
|
|
@@ -67,7 +67,7 @@ export default function Button(_ref) {
|
|
|
67
67
|
var variantClass = getButtonVariantClass(variant, color);
|
|
68
68
|
return /*#__PURE__*/_jsx(Comp, _objectSpread(_objectSpread({
|
|
69
69
|
type: Comp === "button" && type === undefined ? "button" : type,
|
|
70
|
-
className: clsx("btn", _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, variantClass, !success), "btn-success", success), "btn-sm", sm), "btn-lg", lg), "icon-link", busyProp || iconBefore !==
|
|
70
|
+
className: clsx("btn", _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, variantClass, !success), "btn-success", success), "btn-sm", sm), "btn-lg", lg), "icon-link", busyProp || iconBefore !== undefined || iconAfter !== undefined), "active", active), className)
|
|
71
71
|
}, props), {}, {
|
|
72
72
|
children: busyProp ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
73
73
|
children: [/*#__PURE__*/_jsx("span", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blue-react",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.3",
|
|
4
4
|
"description": "Blue React Components",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@popperjs/core": "^2.11.5",
|
|
38
|
-
"blue-web": "^1.
|
|
38
|
+
"blue-web": "^1.21.1",
|
|
39
39
|
"bootstrap": "~5.3.3",
|
|
40
40
|
"clsx": "^1.1.1"
|
|
41
41
|
},
|