cloudmr-ux 0.1.0 → 1.0.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.
- package/README.md +24 -28
- package/dist/index.975ef6c8.js +75418 -0
- package/dist/index.975ef6c8.js.map +1 -0
- package/dist/index.css +159 -10
- package/dist/index.d.ts +40 -1
- package/dist/index.db9ed22c.css +171 -0
- package/dist/index.db9ed22c.css.map +1 -0
- package/dist/index.html +13 -0
- package/dist/index.js +135 -6
- package/dist/index.mjs +136 -5
- package/package.json +39 -33
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
import { Button } from "@mui/material";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var CmrButton = (props) => {
|
|
5
|
-
const { children, onClick, ...rest } = props;
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
+
const { children, onClick, variant = "contained", disabled = false, ...rest } = props;
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Button,
|
|
8
|
+
{
|
|
9
|
+
onClick,
|
|
10
|
+
...rest,
|
|
11
|
+
className: `cmr-button ${variant}`,
|
|
12
|
+
style: { textTransform: "none" },
|
|
13
|
+
variant,
|
|
14
|
+
disabled,
|
|
15
|
+
sx: {
|
|
16
|
+
boxShadow: "none",
|
|
17
|
+
// Removes the shadow on the button by default
|
|
18
|
+
"&:hover": {
|
|
19
|
+
boxShadow: "none"
|
|
20
|
+
// Removes the shadow on hover as well
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
7
26
|
};
|
|
8
27
|
|
|
9
28
|
// src/CmrComponents/CmrCheckbox/CmrCheckbox.tsx
|
|
@@ -18,13 +37,125 @@ var CmrCheckbox = (props) => {
|
|
|
18
37
|
disabled: props.disabled,
|
|
19
38
|
style: props.style,
|
|
20
39
|
className: props.className,
|
|
21
|
-
control: /* @__PURE__ */ jsx2(
|
|
40
|
+
control: /* @__PURE__ */ jsx2(
|
|
41
|
+
Checkbox,
|
|
42
|
+
{
|
|
43
|
+
style: props.style,
|
|
44
|
+
checked: props.checked,
|
|
45
|
+
defaultChecked,
|
|
46
|
+
onChange
|
|
47
|
+
}
|
|
48
|
+
),
|
|
22
49
|
label: /* @__PURE__ */ jsx2("span", { className: "cmr-label", style: { paddingRight: 0, color: "var(--bs-card-color)" }, children: props.children }),
|
|
23
|
-
labelPlacement: "
|
|
50
|
+
labelPlacement: "end"
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/CmrComponents/CmrInput/CmrInput.tsx
|
|
56
|
+
import { Input } from "antd";
|
|
57
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
58
|
+
var CmrInput = (props) => {
|
|
59
|
+
const { defaultValue, id, maxLength, size, value, type, prefix, bordered, onChange, onPressEnter, ...rest } = props;
|
|
60
|
+
return /* @__PURE__ */ jsx3(
|
|
61
|
+
Input,
|
|
62
|
+
{
|
|
63
|
+
defaultValue,
|
|
64
|
+
id,
|
|
65
|
+
maxLength,
|
|
66
|
+
size,
|
|
67
|
+
value,
|
|
68
|
+
type,
|
|
69
|
+
prefix,
|
|
70
|
+
onChange,
|
|
71
|
+
onPressEnter,
|
|
72
|
+
...rest,
|
|
73
|
+
className: "cmr-input"
|
|
24
74
|
}
|
|
25
75
|
);
|
|
26
76
|
};
|
|
77
|
+
|
|
78
|
+
// src/CmrComponents/CmrRadioGroup/CmrRadioGroup.tsx
|
|
79
|
+
import { useState } from "react";
|
|
80
|
+
import {
|
|
81
|
+
Radio,
|
|
82
|
+
RadioGroup,
|
|
83
|
+
FormControl,
|
|
84
|
+
FormControlLabel as FormControlLabel2,
|
|
85
|
+
FormLabel
|
|
86
|
+
} from "@mui/material";
|
|
87
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
88
|
+
var CmrRadioGroup = ({
|
|
89
|
+
options,
|
|
90
|
+
groupLabel,
|
|
91
|
+
defaultValue,
|
|
92
|
+
onChange
|
|
93
|
+
}) => {
|
|
94
|
+
const [selectedValue, setSelectedValue] = useState(defaultValue || "");
|
|
95
|
+
const handleChange = (event) => {
|
|
96
|
+
const newValue = event.target.value;
|
|
97
|
+
setSelectedValue(newValue);
|
|
98
|
+
if (onChange) {
|
|
99
|
+
onChange(newValue);
|
|
100
|
+
} else {
|
|
101
|
+
console.log("Selected Radio Value:", newValue);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return /* @__PURE__ */ jsx4("div", { className: "cmr-radio-label", children: /* @__PURE__ */ jsxs(FormControl, { component: "fieldset", children: [
|
|
105
|
+
groupLabel && /* @__PURE__ */ jsx4(FormLabel, { component: "legend", children: groupLabel }),
|
|
106
|
+
/* @__PURE__ */ jsx4(RadioGroup, { value: selectedValue, onChange: handleChange, children: options.map((option) => /* @__PURE__ */ jsx4(
|
|
107
|
+
FormControlLabel2,
|
|
108
|
+
{
|
|
109
|
+
value: option.value,
|
|
110
|
+
control: /* @__PURE__ */ jsx4(Radio, { disabled: option.disabled }),
|
|
111
|
+
label: option.label,
|
|
112
|
+
sx: {
|
|
113
|
+
"& .MuiTypography-root": {
|
|
114
|
+
fontSize: "14.4px",
|
|
115
|
+
fontFamily: '"Source Sans 3", sans-serif'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
option.value
|
|
120
|
+
)) })
|
|
121
|
+
] }) });
|
|
122
|
+
};
|
|
123
|
+
var CmrRadioGroup_default = CmrRadioGroup;
|
|
124
|
+
|
|
125
|
+
// src/CmrComponents/CmrSelect/CmrSelect.tsx
|
|
126
|
+
import { useState as useState2 } from "react";
|
|
127
|
+
import { Select, MenuItem, FormControl as FormControl2, InputLabel } from "@mui/material";
|
|
128
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
129
|
+
var CmrSelect = ({ options, label, disabled }) => {
|
|
130
|
+
const [selectedValue, setSelectedValue] = useState2("");
|
|
131
|
+
const handleChange = (event) => {
|
|
132
|
+
setSelectedValue(event.target.value);
|
|
133
|
+
console.log("Selected Value:", event.target.value);
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ jsxs2(FormControl2, { className: "dropdown-select", sx: {
|
|
136
|
+
minWidth: 200,
|
|
137
|
+
// Minimum width for the dropdown
|
|
138
|
+
maxWidth: 400,
|
|
139
|
+
// Optional: Maximum width for the dropdown
|
|
140
|
+
width: "auto"
|
|
141
|
+
// Allow auto-resizing based on content
|
|
142
|
+
}, disabled, children: [
|
|
143
|
+
/* @__PURE__ */ jsx5(InputLabel, { className: "dropdown-label", children: label }),
|
|
144
|
+
/* @__PURE__ */ jsx5(Select, { value: selectedValue, onChange: handleChange, label, MenuProps: {
|
|
145
|
+
classes: { paper: "custom-dropdown" }
|
|
146
|
+
// Apply the class to the dropdown menu
|
|
147
|
+
}, children: options.map((option) => /* @__PURE__ */ jsx5(MenuItem, { value: option.value, children: option.label }, option.value)) })
|
|
148
|
+
] });
|
|
149
|
+
};
|
|
150
|
+
var CmrSelect_default = CmrSelect;
|
|
151
|
+
|
|
152
|
+
// src/CmrTable/CmrTable.tsx
|
|
153
|
+
import { DataGrid } from "@mui/x-data-grid";
|
|
154
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
27
155
|
export {
|
|
28
156
|
CmrButton,
|
|
29
|
-
CmrCheckbox
|
|
157
|
+
CmrCheckbox,
|
|
158
|
+
CmrInput,
|
|
159
|
+
CmrRadioGroup_default as CmrRadioGroup,
|
|
160
|
+
CmrSelect_default as CmrSelect
|
|
30
161
|
};
|
package/package.json
CHANGED
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cloudmr-ux",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"author": "erosmontin",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "erosmontin/cloudmr-ux",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.esm.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsup src/index.ts --format cjs,esm --dts"
|
|
15
|
-
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"react": "^18.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "cloudmr-ux",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"author": "erosmontin@gmail.com",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "erosmontin/cloudmr-ux",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.esm.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --external react,react-dom"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": "^18.0.0",
|
|
18
|
+
"react-dom": "^18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"process": "^0.11.10",
|
|
22
|
+
"react": "^18.0.0",
|
|
23
|
+
"react-dom": "^18.0.0",
|
|
24
|
+
"tsup": "^6.7.0",
|
|
25
|
+
"typescript": "^5.6.3"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@emotion/react": "^11.14.0",
|
|
29
|
+
"@emotion/styled": "^11.14.0",
|
|
30
|
+
"@mui/icons-material": "^5.14.1",
|
|
31
|
+
"@mui/material": "^5.14.2",
|
|
32
|
+
"@mui/x-data-grid": "^6.10.1",
|
|
33
|
+
"antd": "^5.22.1",
|
|
34
|
+
"css-loader": "^7.1.2",
|
|
35
|
+
"sass": "^1.81.0",
|
|
36
|
+
"sass-loader": "^16.0.3",
|
|
37
|
+
"style-loader": "^4.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|