cloudmr-ux 1.1.6 → 1.1.7

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/index.css CHANGED
@@ -1,42 +1,4 @@
1
1
  /* src/CmrComponents/CmrButton/CmrButton.css */
2
- .cmr-button {
3
- background-color: #580F8B !important;
4
- color: white !important;
5
- padding-top: 0.375rem !important;
6
- padding-bottom: 0.375rem !important;
7
- padding-right: 0.75rem !important;
8
- padding-left: 0.75rem !important;
9
- border: 2px solid #580F8B !important;
10
- border-radius: 4px !important;
11
- text-align: center !important;
12
- font-family: "Source Sans 3", sans-serif !important;
13
- font-size: 14.4px !important;
14
- line-height: 1.5 !important;
15
- font-weight: 400 !important;
16
- }
17
- .cmr-button:hover {
18
- background-color: #390063 !important;
19
- }
20
- .cmr-button.outlined {
21
- background-color: transparent !important;
22
- border: 2px solid #580F8B !important;
23
- color: #580F8B !important;
24
- }
25
- .cmr-button.outlined:hover {
26
- background-color: #580F8B !important;
27
- color: white !important;
28
- }
29
- .cmr-button.Mui-disabled {
30
- background-color: #ced4da !important;
31
- color: #999 !important;
32
- border: 2px solid #ced4da !important;
33
- cursor: not-allowed !important;
34
- }
35
- .cmr-button.Mui-disabled:hover {
36
- background-color: #ced4da !important;
37
- color: #999 !important;
38
- }
39
-
40
2
  /* src/CmrComponents/CmrCheckbox/CmrCheckbox.css */
41
3
  .cmr-label {
42
4
  font-size: 14.4px;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonProps, SxProps as SxProps$1, Theme as Theme$1 } from '@mui/material';
3
- import { SxProps, Theme } from '@mui/material/styles';
2
+ import { ButtonProps, SxProps, Theme } from '@mui/material';
4
3
  import React, { ReactNode, ChangeEvent, CSSProperties, FC } from 'react';
5
4
  import { SizeType } from 'antd/lib/config-provider/SizeContext';
6
5
  import { CollapsibleType } from 'antd/es/collapse/CollapsePanel';
@@ -8,9 +7,7 @@ import { ExpandIconPosition } from 'antd/es/collapse/Collapse';
8
7
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
9
8
  import { DataGridProps } from '@mui/x-data-grid';
10
9
 
11
- declare const CmrButton: (props: ButtonProps & {
12
- sx?: SxProps<Theme>;
13
- }) => react_jsx_runtime.JSX.Element;
10
+ declare const CmrButton: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
14
11
 
15
12
  interface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
16
13
  defaultValue?: string;
@@ -114,7 +111,7 @@ interface CMRUploadProps extends React.HTMLAttributes<HTMLDivElement> {
114
111
  } | undefined>);
115
112
  onUploadProgressUpdate?: (loaded: number, total: number) => void | undefined;
116
113
  onUploaded: (res: AxiosResponse, file: File) => Promise<void> | void;
117
- sx?: SxProps$1<Theme$1> | undefined;
114
+ sx?: SxProps<Theme> | undefined;
118
115
  rest?: any;
119
116
  fileExtension?: string;
120
117
  uploadStarted?: () => void;
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
33
  CMRUpload: () => Upload_default,
34
- CmrButton: () => CmrButton,
34
+ CmrButton: () => CmrButton_default,
35
35
  CmrCheckbox: () => Checkbox_default,
36
36
  CmrCollapse: () => Collapse_default,
37
37
  CmrConfirmation: () => CmrConfirmation,
@@ -53,43 +53,10 @@ module.exports = __toCommonJS(src_exports);
53
53
  var import_material = require("@mui/material");
54
54
  var import_jsx_runtime = require("react/jsx-runtime");
55
55
  var CmrButton = (props) => {
56
- const { children, onClick, variant = "contained", disabled = false, sx, ...rest } = props;
57
- const baseSx = {
58
- boxShadow: "none",
59
- "&:hover": {
60
- boxShadow: "none"
61
- }
62
- };
63
- let combinedSx;
64
- if (Array.isArray(sx)) {
65
- combinedSx = [baseSx, ...sx];
66
- } else if (typeof sx === "function") {
67
- combinedSx = (theme) => ({
68
- ...baseSx,
69
- ...sx(theme)
70
- });
71
- } else if (typeof sx === "object" && sx !== null) {
72
- combinedSx = {
73
- ...baseSx,
74
- ...sx
75
- };
76
- } else {
77
- combinedSx = baseSx;
78
- }
79
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
- import_material.Button,
81
- {
82
- onClick,
83
- ...rest,
84
- className: `cmr-button ${variant}`,
85
- style: { textTransform: "none" },
86
- variant,
87
- disabled,
88
- sx: combinedSx,
89
- children
90
- }
91
- );
56
+ const { children, onClick, ...rest } = props;
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { onClick, ...rest, style: { ...props.style, textTransform: "none" }, children });
92
58
  };
59
+ var CmrButton_default = CmrButton;
93
60
 
94
61
  // src/CmrComponents/CmrCheckbox/CmrCheckbox.tsx
95
62
  var import_material2 = require("@mui/material");
@@ -839,8 +806,8 @@ function CmrNameDialog(props) {
839
806
  }
840
807
  ) }),
841
808
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_DialogActions2.default, { children: [
842
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
843
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
809
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton_default, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
810
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CmrButton_default, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
844
811
  ] })
845
812
  ]
846
813
  }
@@ -887,8 +854,8 @@ function CmrConfirmation({
887
854
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogContent3.default, { sx: { width }, children: [
888
855
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_DialogContentText2.default, { alignContent: "center", children: message }),
889
856
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_DialogActions3.default, { className: "mt-4", children: [
890
- cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
891
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
857
+ cancellable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
858
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
892
859
  ] })
893
860
  ] })
894
861
  ] });
@@ -1005,8 +972,8 @@ function CmrEditConfirmation({
1005
972
  }
1006
973
  ) }),
1007
974
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_DialogActions5.default, { children: [
1008
- cancellable && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CmrButton, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: "Cancel" }),
1009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CmrButton, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
975
+ cancellable && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: "Cancel" }),
976
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
1010
977
  ] })
1011
978
  ] })
1012
979
  ] });
package/dist/index.mjs CHANGED
@@ -2,43 +2,10 @@
2
2
  import { Button } from "@mui/material";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var CmrButton = (props) => {
5
- const { children, onClick, variant = "contained", disabled = false, sx, ...rest } = props;
6
- const baseSx = {
7
- boxShadow: "none",
8
- "&:hover": {
9
- boxShadow: "none"
10
- }
11
- };
12
- let combinedSx;
13
- if (Array.isArray(sx)) {
14
- combinedSx = [baseSx, ...sx];
15
- } else if (typeof sx === "function") {
16
- combinedSx = (theme) => ({
17
- ...baseSx,
18
- ...sx(theme)
19
- });
20
- } else if (typeof sx === "object" && sx !== null) {
21
- combinedSx = {
22
- ...baseSx,
23
- ...sx
24
- };
25
- } else {
26
- combinedSx = baseSx;
27
- }
28
- return /* @__PURE__ */ jsx(
29
- Button,
30
- {
31
- onClick,
32
- ...rest,
33
- className: `cmr-button ${variant}`,
34
- style: { textTransform: "none" },
35
- variant,
36
- disabled,
37
- sx: combinedSx,
38
- children
39
- }
40
- );
5
+ const { children, onClick, ...rest } = props;
6
+ return /* @__PURE__ */ jsx(Button, { onClick, ...rest, style: { ...props.style, textTransform: "none" }, children });
41
7
  };
8
+ var CmrButton_default = CmrButton;
42
9
 
43
10
  // src/CmrComponents/CmrCheckbox/CmrCheckbox.tsx
44
11
  import { Checkbox } from "@mui/material";
@@ -794,8 +761,8 @@ function CmrNameDialog(props) {
794
761
  }
795
762
  ) }),
796
763
  /* @__PURE__ */ jsxs7(DialogActions2, { children: [
797
- /* @__PURE__ */ jsx11(CmrButton, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
798
- /* @__PURE__ */ jsx11(CmrButton, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
764
+ /* @__PURE__ */ jsx11(CmrButton_default, { variant: "outlined", onClick: handleClose, children: "Cancel" }),
765
+ /* @__PURE__ */ jsx11(CmrButton_default, { variant: "contained", color: "primary", onClick: handleConfirm, children: "Confirm" })
799
766
  ] })
800
767
  ]
801
768
  }
@@ -842,8 +809,8 @@ function CmrConfirmation({
842
809
  /* @__PURE__ */ jsxs8(DialogContent3, { sx: { width }, children: [
843
810
  /* @__PURE__ */ jsx12(DialogContentText2, { alignContent: "center", children: message }),
844
811
  /* @__PURE__ */ jsxs8(DialogActions3, { className: "mt-4", children: [
845
- cancellable && /* @__PURE__ */ jsx12(CmrButton, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
846
- /* @__PURE__ */ jsx12(CmrButton, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
812
+ cancellable && /* @__PURE__ */ jsx12(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: cancelText }),
813
+ /* @__PURE__ */ jsx12(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: confirmText })
847
814
  ] })
848
815
  ] })
849
816
  ] });
@@ -960,8 +927,8 @@ function CmrEditConfirmation({
960
927
  }
961
928
  ) }),
962
929
  /* @__PURE__ */ jsxs10(DialogActions5, { children: [
963
- cancellable && /* @__PURE__ */ jsx14(CmrButton, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: "Cancel" }),
964
- /* @__PURE__ */ jsx14(CmrButton, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
930
+ cancellable && /* @__PURE__ */ jsx14(CmrButton_default, { variant: "outlined", color: "inherit", sx: { color: "#333" }, onClick: handleCancel, children: "Cancel" }),
931
+ /* @__PURE__ */ jsx14(CmrButton_default, { variant: "contained", color, onClick: handleConfirm, children: "Confirm" })
965
932
  ] })
966
933
  ] })
967
934
  ] });
@@ -1109,7 +1076,7 @@ var CmrTable_default = CmrTable;
1109
1076
  var CmrTable2 = CmrTable_default;
1110
1077
  export {
1111
1078
  Upload_default as CMRUpload,
1112
- CmrButton,
1079
+ CmrButton_default as CmrButton,
1113
1080
  Checkbox_default as CmrCheckbox,
1114
1081
  Collapse_default as CmrCollapse,
1115
1082
  CmrConfirmation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudmr-ux",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "author": "erosmontin@gmail.com",
5
5
  "license": "MIT",
6
6
  "repository": "erosmontin/cloudmr-ux",