beem-component 1.3.9 → 1.4.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/dist/components/ProgressRing/progressRing.js +1 -2
- package/dist/components/Tabs/tabs.js +4 -2
- package/dist/components/Tabs/tabs.stories.js +21 -2
- package/package.json +1 -1
- package/src/App.js +2 -3
- package/src/lib/components/ProgressRing/progressRing.js +1 -1
- package/src/lib/components/Tabs/tabs.js +3 -2
- package/src/lib/components/Tabs/tabs.stories.js +17 -3
|
@@ -126,8 +126,7 @@ var BmProgressRing = function BmProgressRing(props) {
|
|
|
126
126
|
var circleRef = (0, _react.useRef)(null);
|
|
127
127
|
var size = props.size,
|
|
128
128
|
progress = props.progress,
|
|
129
|
-
variant = props.variant
|
|
130
|
-
children = props.children;
|
|
129
|
+
variant = props.variant;
|
|
131
130
|
var initialMeasure = measurement(size);
|
|
132
131
|
circumference = initialMeasure.circumference;
|
|
133
132
|
radius = initialMeasure.radius;
|
|
@@ -31,10 +31,11 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
31
31
|
|
|
32
32
|
var BmTabWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 1rem;\n background: ", ";\n box-shadow: ", ";\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n ", "\n\n &:hover {\n box-shadow: ", ";\n }\n"])), _colors.BmPrimaryWhite, function (_ref) {
|
|
33
33
|
var state = _ref.state,
|
|
34
|
-
disabled = _ref.disabled
|
|
34
|
+
disabled = _ref.disabled,
|
|
35
|
+
stateColor = _ref.stateColor;
|
|
35
36
|
|
|
36
37
|
if (state === "active" && !disabled) {
|
|
37
|
-
return "inset 0px -3px 0px ".concat(_colors.BmPrimaryBlue);
|
|
38
|
+
return "inset 0px -3px 0px ".concat(stateColor ? stateColor : _colors.BmPrimaryBlue);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
return "none";
|
|
@@ -86,6 +87,7 @@ BmTab.propTypes = {
|
|
|
86
87
|
leadingIcon: _propTypes.default.node,
|
|
87
88
|
state: _propTypes.default.string,
|
|
88
89
|
color: _propTypes.default.string,
|
|
90
|
+
stateColor: _propTypes.default.string,
|
|
89
91
|
size: _propTypes.default.string,
|
|
90
92
|
disabled: _propTypes.default.bool
|
|
91
93
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.DisabledTab = exports.BasicTab = void 0;
|
|
6
|
+
exports.default = exports.DisabledTab = exports.ColoredTab = exports.BasicTab = void 0;
|
|
7
7
|
|
|
8
8
|
var _icons = require("@material-ui/icons");
|
|
9
9
|
|
|
@@ -31,6 +31,15 @@ var _default = {
|
|
|
31
31
|
},
|
|
32
32
|
description: "State of the Tabs (optional)"
|
|
33
33
|
},
|
|
34
|
+
stateColor: {
|
|
35
|
+
control: {
|
|
36
|
+
type: "text"
|
|
37
|
+
},
|
|
38
|
+
description: "Color of the active state",
|
|
39
|
+
defaultValue: {
|
|
40
|
+
summary: "primary blue"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
34
43
|
size: {
|
|
35
44
|
options: ["small", "medium", "large"],
|
|
36
45
|
control: {
|
|
@@ -59,7 +68,7 @@ BasicTab.args = {
|
|
|
59
68
|
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
|
|
60
69
|
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.KeyboardArrowDown, null),
|
|
61
70
|
disabled: false,
|
|
62
|
-
state:
|
|
71
|
+
state: "active"
|
|
63
72
|
};
|
|
64
73
|
var DisabledTab = MainTab.bind({});
|
|
65
74
|
exports.DisabledTab = DisabledTab;
|
|
@@ -68,4 +77,14 @@ DisabledTab.args = {
|
|
|
68
77
|
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
|
|
69
78
|
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.KeyboardArrowDown, null),
|
|
70
79
|
disabled: true
|
|
80
|
+
};
|
|
81
|
+
var ColoredTab = MainTab.bind({});
|
|
82
|
+
exports.ColoredTab = ColoredTab;
|
|
83
|
+
ColoredTab.args = {
|
|
84
|
+
children: /*#__PURE__*/_react.default.createElement("h3", null, "Tabs"),
|
|
85
|
+
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
|
|
86
|
+
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.KeyboardArrowDown, null),
|
|
87
|
+
disabled: false,
|
|
88
|
+
state: "active",
|
|
89
|
+
stateColor: "red"
|
|
71
90
|
};
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "../src/main.scss";
|
|
3
|
-
import {
|
|
4
|
-
BmAccordion,
|
|
5
|
-
} from "./lib/components";
|
|
3
|
+
import { BmAccordion, BmTab } from "./lib/components";
|
|
6
4
|
import { GlobalStyle } from "./lib/components/globalStyles";
|
|
7
5
|
import "./lib/assets/css/sidebar.scss";
|
|
8
6
|
|
|
@@ -16,6 +14,7 @@ export const App = () => {
|
|
|
16
14
|
<p>Hello</p>
|
|
17
15
|
</BmAccordion.Title>
|
|
18
16
|
</BmAccordion>
|
|
17
|
+
<BmTab state="active" stateColor="red">Hello</BmTab>
|
|
19
18
|
{/* </MainWrapper> */}
|
|
20
19
|
</>
|
|
21
20
|
);
|
|
@@ -88,7 +88,7 @@ const Text = styled.text`
|
|
|
88
88
|
const BmProgressRing = (props) => {
|
|
89
89
|
const [offset, setOffset] = useState(0);
|
|
90
90
|
const circleRef = useRef(null);
|
|
91
|
-
const { size, progress, variant
|
|
91
|
+
const { size, progress, variant } = props;
|
|
92
92
|
|
|
93
93
|
const initialMeasure = measurement(size);
|
|
94
94
|
|
|
@@ -11,9 +11,9 @@ const BmTabWrapper = styled.div`
|
|
|
11
11
|
align-items: center;
|
|
12
12
|
padding: 1rem;
|
|
13
13
|
background: ${BmPrimaryWhite};
|
|
14
|
-
box-shadow: ${({ state, disabled }) => {
|
|
14
|
+
box-shadow: ${({ state, disabled, stateColor }) => {
|
|
15
15
|
if (state === "active" && !disabled) {
|
|
16
|
-
return `inset 0px -3px 0px ${BmPrimaryBlue}`;
|
|
16
|
+
return `inset 0px -3px 0px ${stateColor ? stateColor : BmPrimaryBlue}`;
|
|
17
17
|
}
|
|
18
18
|
return "none";
|
|
19
19
|
}};
|
|
@@ -86,6 +86,7 @@ BmTab.propTypes = {
|
|
|
86
86
|
leadingIcon: PropTypes.node,
|
|
87
87
|
state: PropTypes.string,
|
|
88
88
|
color: PropTypes.string,
|
|
89
|
+
stateColor: PropTypes.string,
|
|
89
90
|
size: PropTypes.string,
|
|
90
91
|
disabled: PropTypes.bool,
|
|
91
92
|
};
|
|
@@ -16,6 +16,11 @@ export default {
|
|
|
16
16
|
control: { type: "select" },
|
|
17
17
|
description: "State of the Tabs (optional)",
|
|
18
18
|
},
|
|
19
|
+
stateColor: {
|
|
20
|
+
control: { type: "text" },
|
|
21
|
+
description: "Color of the active state",
|
|
22
|
+
defaultValue: { summary: "primary blue" },
|
|
23
|
+
},
|
|
19
24
|
size: {
|
|
20
25
|
options: ["small", "medium", "large"],
|
|
21
26
|
control: { type: "select" },
|
|
@@ -23,8 +28,7 @@ export default {
|
|
|
23
28
|
defaultValue: { summary: "large" },
|
|
24
29
|
},
|
|
25
30
|
disabled: {
|
|
26
|
-
description:
|
|
27
|
-
"Disabled tab",
|
|
31
|
+
description: "Disabled tab",
|
|
28
32
|
},
|
|
29
33
|
},
|
|
30
34
|
};
|
|
@@ -37,7 +41,7 @@ BasicTab.args = {
|
|
|
37
41
|
leadingIcon: <Favorite />,
|
|
38
42
|
trailingIcon: <KeyboardArrowDown />,
|
|
39
43
|
disabled: false,
|
|
40
|
-
state:
|
|
44
|
+
state: "active",
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
export const DisabledTab = MainTab.bind({});
|
|
@@ -47,3 +51,13 @@ DisabledTab.args = {
|
|
|
47
51
|
trailingIcon: <KeyboardArrowDown />,
|
|
48
52
|
disabled: true,
|
|
49
53
|
};
|
|
54
|
+
|
|
55
|
+
export const ColoredTab = MainTab.bind({});
|
|
56
|
+
ColoredTab.args = {
|
|
57
|
+
children: <h3>Tabs</h3>,
|
|
58
|
+
leadingIcon: <Favorite />,
|
|
59
|
+
trailingIcon: <KeyboardArrowDown />,
|
|
60
|
+
disabled: false,
|
|
61
|
+
state: "active",
|
|
62
|
+
stateColor: "red",
|
|
63
|
+
};
|