@symply.io/basic-components 1.3.0 → 1.3.1
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.
@@ -13,6 +13,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import Fab from "@mui/material/Fab";
|
14
14
|
import Grid from "@mui/material/Grid";
|
15
15
|
import Button from "@mui/material/Button";
|
16
|
+
import IconButton from "@mui/material/IconButton";
|
16
17
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
17
18
|
import ThemeProvider from "@mui/material/styles/ThemeProvider";
|
18
19
|
import MenuButtonGroup from "../MenuButtonGroup";
|
@@ -28,10 +29,14 @@ function HeaderButtons(props) {
|
|
28
29
|
var _a = button.variant, variant = _a === void 0 ? "contained" : _a, text = button.text, onClick = button.onClick, color = button.color, size = button.size, startIcon = button.startIcon, endIcon = button.endIcon, disabled = button.disabled;
|
29
30
|
return (_jsx(Grid, __assign({ item: true, xs: isLessThanSm ? 12 : undefined, style: { textAlign: "end" } }, { children: _jsx(Button, __assign({ fullWidth: isLessThanSm, variant: variant, onClick: onClick, color: color, size: isLessThanSm ? "small" : size, startIcon: startIcon, endIcon: endIcon, disabled: disabled }, { children: text })) }), text));
|
30
31
|
}
|
31
|
-
case HeaderButtonCategory.
|
32
|
+
case HeaderButtonCategory.FabButton: {
|
32
33
|
var title = button.title, onClick = button.onClick, color = button.color, _b = button.size, size = _b === void 0 ? "medium" : _b, icon = button.icon, disabled = button.disabled, variant = button.variant;
|
33
34
|
return (_jsx(Grid, __assign({ item: true, style: { textAlign: "end" } }, { children: _jsx(Fab, __assign({ onClick: onClick, color: color, title: title, size: isLessThanSm ? "small" : size, disabled: disabled, variant: variant }, { children: icon })) }), title));
|
34
35
|
}
|
36
|
+
case HeaderButtonCategory.IconButton: {
|
37
|
+
var title = button.title, onClick = button.onClick, color = button.color, _c = button.size, size = _c === void 0 ? "medium" : _c, icon = button.icon, disabled = button.disabled;
|
38
|
+
return (_jsx(Grid, __assign({ item: true, style: { textAlign: "end" } }, { children: _jsx(IconButton, __assign({ onClick: onClick, color: color, title: title, size: isLessThanSm ? "small" : size, disabled: disabled }, { children: icon })) }), title));
|
39
|
+
}
|
35
40
|
case HeaderButtonCategory.MenuButton: {
|
36
41
|
var btns = button.buttons, buttonText = button.buttonText, disabled = button.disabled, variant = button.variant, size = button.size;
|
37
42
|
return (_jsx(Grid, __assign({ item: true, xs: isLessThanSm ? 12 : undefined, style: { textAlign: "end" } }, { children: _jsx(MenuButtonGroup, { size: isLessThanSm ? "small" : size, variant: variant, buttons: btns, buttonText: buttonText, disabled: disabled }) }), buttonText));
|
@@ -6,7 +6,8 @@ import { MenuButtonGroupProps } from "../MenuButtonGroup";
|
|
6
6
|
export declare enum HeaderButtonCategory {
|
7
7
|
IconButton = "icon",
|
8
8
|
TextButton = "text",
|
9
|
-
MenuButton = "menu"
|
9
|
+
MenuButton = "menu",
|
10
|
+
FabButton = "fab"
|
10
11
|
}
|
11
12
|
interface HeaderTextButtonProps {
|
12
13
|
text: string;
|
@@ -24,13 +25,22 @@ interface HeaderIconButtonProps {
|
|
24
25
|
icon: ReactElement;
|
25
26
|
disabled?: boolean;
|
26
27
|
type: HeaderButtonCategory.IconButton;
|
27
|
-
variant?: FabProps["variant"];
|
28
28
|
color?: IconButtonProps["color"];
|
29
29
|
size?: IconButtonProps["size"];
|
30
30
|
onClick: IconButtonProps["onClick"];
|
31
31
|
}
|
32
|
+
interface HeaderFabButtonProps {
|
33
|
+
title: string;
|
34
|
+
icon: ReactElement;
|
35
|
+
disabled?: boolean;
|
36
|
+
type: HeaderButtonCategory.FabButton;
|
37
|
+
variant?: FabProps["variant"];
|
38
|
+
color?: FabProps["color"];
|
39
|
+
size?: FabProps["size"];
|
40
|
+
onClick: FabProps["onClick"];
|
41
|
+
}
|
32
42
|
declare type HeaderMenuButtonProps = {
|
33
43
|
type: HeaderButtonCategory.MenuButton;
|
34
44
|
} & MenuButtonGroupProps;
|
35
|
-
export declare type HeaderButtonProps = HeaderTextButtonProps | HeaderIconButtonProps | HeaderMenuButtonProps;
|
45
|
+
export declare type HeaderButtonProps = HeaderFabButtonProps | HeaderTextButtonProps | HeaderIconButtonProps | HeaderMenuButtonProps;
|
36
46
|
export {};
|
@@ -3,4 +3,5 @@ export var HeaderButtonCategory;
|
|
3
3
|
HeaderButtonCategory["IconButton"] = "icon";
|
4
4
|
HeaderButtonCategory["TextButton"] = "text";
|
5
5
|
HeaderButtonCategory["MenuButton"] = "menu";
|
6
|
+
HeaderButtonCategory["FabButton"] = "fab";
|
6
7
|
})(HeaderButtonCategory || (HeaderButtonCategory = {}));
|
@@ -41,13 +41,13 @@ var ToastPrompt = function (props) {
|
|
41
41
|
backgroundColor: green[600]
|
42
42
|
},
|
43
43
|
error: {
|
44
|
-
backgroundColor: red[
|
44
|
+
backgroundColor: red["A400"]
|
45
45
|
},
|
46
46
|
info: {
|
47
47
|
backgroundColor: blue[600]
|
48
48
|
},
|
49
49
|
warning: {
|
50
|
-
backgroundColor: amber[
|
50
|
+
backgroundColor: amber[500]
|
51
51
|
}
|
52
52
|
};
|
53
53
|
var Transition = function (args) {
|
@@ -70,6 +70,7 @@ var ToastPrompt = function (props) {
|
|
70
70
|
},
|
71
71
|
_a) }), "aria-describedby": "Toast", message: _jsxs(Typography, __assign({ id: "Toast", component: "span", sx: {
|
72
72
|
fontSize: 14,
|
73
|
+
fontWeight: 500,
|
73
74
|
display: "flex",
|
74
75
|
alignItems: "center"
|
75
76
|
} }, { children: [variant ? (_jsx(Icon, { sx: {
|