frame.theme 0.0.8 → 0.1.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/NumberInput.d.ts +2 -0
- package/dist/frame.theme.js +29 -33
- package/package.json +1 -1
package/dist/NumberInput.d.ts
CHANGED
package/dist/frame.theme.js
CHANGED
|
@@ -1,59 +1,55 @@
|
|
|
1
1
|
import { TextField as e, useTheme as t } from "@mui/material";
|
|
2
2
|
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
-
import { jsx as a
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
4
|
//#region src/NumberInput.tsx
|
|
5
|
-
function
|
|
6
|
-
let
|
|
5
|
+
function o(o) {
|
|
6
|
+
let s = t(), [c, l] = i(""), u = r(null);
|
|
7
7
|
return n(() => {
|
|
8
|
-
let e =
|
|
8
|
+
let e = u.current;
|
|
9
9
|
if (!e) return;
|
|
10
10
|
let t = (e) => {
|
|
11
11
|
let t = e.target;
|
|
12
|
-
if (t && t.value !==
|
|
12
|
+
if (t && t.value !== o.value) {
|
|
13
13
|
let e = t.value;
|
|
14
|
-
|
|
14
|
+
o.checkValue(e, l), o.onChange(e);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
return e.addEventListener("input", t), e.addEventListener("change", t), () => {
|
|
18
18
|
e.removeEventListener("input", t), e.removeEventListener("change", t);
|
|
19
19
|
};
|
|
20
20
|
}, [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]),
|
|
27
|
-
"data-testid":
|
|
28
|
-
|
|
29
|
-
color: "
|
|
30
|
-
label:
|
|
21
|
+
o.value,
|
|
22
|
+
o.onChange,
|
|
23
|
+
o.errorMessage,
|
|
24
|
+
o.sh,
|
|
25
|
+
o
|
|
26
|
+
]), /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(e, {
|
|
27
|
+
"data-testid": `NumberInput.Textfield.${o.dataTestid}`,
|
|
28
|
+
autoFocus: o.autofocus ?? !1,
|
|
29
|
+
color: o.color ?? "warning",
|
|
30
|
+
label: o.label,
|
|
31
31
|
variant: "filled",
|
|
32
|
-
value:
|
|
33
|
-
sx: {
|
|
32
|
+
value: o.value,
|
|
33
|
+
sx: {
|
|
34
|
+
width: "150px",
|
|
35
|
+
"& .MuiInputLabel-root": { color: !c && o.value ? "lightgreen" : "white" }
|
|
36
|
+
},
|
|
37
|
+
type: "text",
|
|
34
38
|
slotProps: {
|
|
39
|
+
htmlInput: { inputMode: "decimal" },
|
|
35
40
|
input: { style: {
|
|
36
41
|
color: "white",
|
|
37
|
-
backgroundColor:
|
|
42
|
+
backgroundColor: s.palette.primary.main
|
|
38
43
|
} },
|
|
39
44
|
formHelperText: { sx: { whiteSpace: "pre-line" } }
|
|
40
45
|
},
|
|
41
|
-
type: "number",
|
|
42
46
|
onChange: (e) => {
|
|
43
47
|
let t = e.target.value;
|
|
44
|
-
|
|
48
|
+
o.checkValue(t, l), o.onChange(t);
|
|
45
49
|
},
|
|
46
|
-
error: !!
|
|
47
|
-
helperText:
|
|
48
|
-
})
|
|
49
|
-
"data-testid": `${c}.Textfield.${s.dataTestid}.filled.success`,
|
|
50
|
-
focused: !0,
|
|
51
|
-
color: "success",
|
|
52
|
-
label: "Filled success",
|
|
53
|
-
variant: "filled",
|
|
54
|
-
value: s.value,
|
|
55
|
-
type: "number"
|
|
56
|
-
})] });
|
|
50
|
+
error: !!c,
|
|
51
|
+
helperText: c
|
|
52
|
+
}) });
|
|
57
53
|
}
|
|
58
54
|
//#endregion
|
|
59
|
-
export {
|
|
55
|
+
export { o as NumberInput };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "frame.theme",
|
|
3
3
|
"author": "Christian Todd <Christian.Todd@rodenstock.com>",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
-
"version": "0.0
|
|
5
|
+
"version": "0.1.0",
|
|
6
6
|
"description": "A sample theme for the Frame project",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/frame.theme.js",
|