sag_components 1.0.131 → 1.0.132
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.
|
@@ -9,16 +9,25 @@ exports.default = exports.Button = void 0;
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
12
13
|
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
13
|
-
var _excluded = ["text", "shape", "size", "disabled", "radius", "textColor", "backgroundColor", "onClick"];
|
|
14
|
+
var _excluded = ["text", "fontFamily", "fontSize", "shape", "size", "height", "width", "disabled", "radius", "textColor", "backgroundColor", "borderColor", "hoverTextColor", "hoverBackgroundColor", "hoverBorderColor", "onClick"];
|
|
14
15
|
var Button = function Button(_ref) {
|
|
15
16
|
var text = _ref.text,
|
|
17
|
+
fontFamily = _ref.fontFamily,
|
|
18
|
+
fontSize = _ref.fontSize,
|
|
16
19
|
shape = _ref.shape,
|
|
17
20
|
size = _ref.size,
|
|
21
|
+
height = _ref.height,
|
|
22
|
+
width = _ref.width,
|
|
18
23
|
disabled = _ref.disabled,
|
|
19
24
|
radius = _ref.radius,
|
|
20
25
|
textColor = _ref.textColor,
|
|
21
26
|
backgroundColor = _ref.backgroundColor,
|
|
27
|
+
borderColor = _ref.borderColor,
|
|
28
|
+
hoverTextColor = _ref.hoverTextColor,
|
|
29
|
+
hoverBackgroundColor = _ref.hoverBackgroundColor,
|
|
30
|
+
hoverBorderColor = _ref.hoverBorderColor,
|
|
22
31
|
_onClick = _ref.onClick,
|
|
23
32
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
24
33
|
var getTextColor = function getTextColor() {
|
|
@@ -33,18 +42,48 @@ var Button = function Button(_ref) {
|
|
|
33
42
|
return textColor;
|
|
34
43
|
}
|
|
35
44
|
};
|
|
45
|
+
var theme = (0, _styles.createTheme)({
|
|
46
|
+
typography: {
|
|
47
|
+
"fontFamily": fontFamily,
|
|
48
|
+
"fontSize": fontSize
|
|
49
|
+
},
|
|
50
|
+
components: {
|
|
51
|
+
MuiButton: {
|
|
52
|
+
styleOverrides: {
|
|
53
|
+
root: function root(_ref2) {
|
|
54
|
+
var ownerState = _ref2.ownerState;
|
|
55
|
+
return {
|
|
56
|
+
"&:hover": {
|
|
57
|
+
backgroundColor: hoverBackgroundColor,
|
|
58
|
+
color: hoverTextColor,
|
|
59
|
+
borderColor: hoverBorderColor
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
36
67
|
return /*#__PURE__*/React.createElement(_Stack.default, {
|
|
37
68
|
direction: "row",
|
|
38
69
|
spacing: 2
|
|
70
|
+
}, /*#__PURE__*/React.createElement(_styles.ThemeProvider, {
|
|
71
|
+
theme: theme
|
|
39
72
|
}, /*#__PURE__*/React.createElement(_Button.default, {
|
|
40
73
|
sx: {
|
|
74
|
+
minHeight: height ? height : null,
|
|
75
|
+
maxHeight: height ? height : null,
|
|
76
|
+
minWidth: width ? width : null,
|
|
77
|
+
maxWidth: width ? width : null,
|
|
41
78
|
textTransform: "none",
|
|
42
79
|
borderRadius: radius * 0.05,
|
|
43
80
|
color: getTextColor(),
|
|
44
81
|
// shape === "contained" ? "white" : "black",
|
|
45
82
|
backgroundColor: {
|
|
46
83
|
backgroundColor: backgroundColor
|
|
47
|
-
}
|
|
84
|
+
},
|
|
85
|
+
borderColor: borderColor,
|
|
86
|
+
fontFamily: fontFamily
|
|
48
87
|
},
|
|
49
88
|
variant: shape,
|
|
50
89
|
size: size,
|
|
@@ -52,7 +91,7 @@ var Button = function Button(_ref) {
|
|
|
52
91
|
onClick: function onClick(event) {
|
|
53
92
|
_onClick(event);
|
|
54
93
|
}
|
|
55
|
-
}, text));
|
|
94
|
+
}, text)));
|
|
56
95
|
};
|
|
57
96
|
exports.Button = Button;
|
|
58
97
|
var _default = Button;
|
|
@@ -20,7 +20,7 @@ var ControlsContainer = _styledComponents.default.div(_templateObject || (_templ
|
|
|
20
20
|
exports.ControlsContainer = ControlsContainer;
|
|
21
21
|
var Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n border-radius: 12px;\n background: #ffffff;\n justify-content: center; \n flex-direction: column;\n flex-basis: 100%;\n padding: 0 16px;\n justify-content: space-between;\n"])));
|
|
22
22
|
exports.Controls = Controls;
|
|
23
|
-
var Title = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)([" \n font-weight: 600;\n font-size: 1rem; \n margin-left: 0.5rem;\n margin-top:
|
|
23
|
+
var Title = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)([" \n font-weight: 600;\n font-size: 1rem; \n margin-left: 0.5rem;\n margin-top: 15px;\n"])));
|
|
24
24
|
exports.Title = Title;
|
|
25
25
|
var ValueAndBenchmarkContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n align-items: baseline; \n margin-left: 0.5rem;\n"])));
|
|
26
26
|
exports.ValueAndBenchmarkContainer = ValueAndBenchmarkContainer;
|