frame.theme 0.0.7 → 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 +33 -37
- package/package.json +13 -13
package/dist/NumberInput.d.ts
CHANGED
package/dist/frame.theme.js
CHANGED
|
@@ -1,59 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region src/NumberInput.
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
return
|
|
8
|
-
let e =
|
|
1
|
+
import { TextField as e, useTheme as t } from "@mui/material";
|
|
2
|
+
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/NumberInput.tsx
|
|
5
|
+
function o(o) {
|
|
6
|
+
let s = t(), [c, l] = i(""), u = r(null);
|
|
7
|
+
return n(() => {
|
|
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,17 +2,17 @@
|
|
|
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
|
-
"main": "./dist/
|
|
9
|
-
"module": "./dist/
|
|
8
|
+
"main": "./dist/frame.theme.js",
|
|
9
|
+
"module": "./dist/frame.theme.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"require": "./dist/index.cjs.js",
|
|
14
13
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/
|
|
14
|
+
"import": "./dist/frame.theme.js",
|
|
15
|
+
"default": "./dist/frame.theme.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
@@ -29,29 +29,29 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@emotion/react": "^11.14.0",
|
|
31
31
|
"@emotion/styled": "^11.14.1",
|
|
32
|
-
"@mui/material": "^9.
|
|
32
|
+
"@mui/material": "^9.4.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@emotion/react": "^11.14.0",
|
|
36
36
|
"@emotion/styled": "^11.14.1",
|
|
37
|
-
"@mui/material": "^9.
|
|
37
|
+
"@mui/material": "^9.4.0",
|
|
38
38
|
"react": "^19.2.8",
|
|
39
39
|
"react-dom": "^19.2.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@eslint/js": "^10.0.1",
|
|
43
|
-
"@types/node": "^26.
|
|
43
|
+
"@types/node": "^26.4.1",
|
|
44
44
|
"@types/react": "^19.2.17",
|
|
45
45
|
"@types/react-dom": "^19.2.5",
|
|
46
|
-
"@vitejs/plugin-react": "^6.
|
|
46
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
47
47
|
"eslint": "^10.9.1",
|
|
48
48
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
49
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
50
|
-
"globals": "^17.
|
|
49
|
+
"eslint-plugin-react-refresh": "^0.5.5",
|
|
50
|
+
"globals": "^17.12.0",
|
|
51
51
|
"tsup": "^8.5.1",
|
|
52
52
|
"typescript": "~6.0.2",
|
|
53
|
-
"typescript-eslint": "^8.
|
|
53
|
+
"typescript-eslint": "^8.69.0",
|
|
54
54
|
"vite": "^8.2.0",
|
|
55
|
-
"vite-plugin-dts": "^5.0
|
|
55
|
+
"vite-plugin-dts": "^5.1.0"
|
|
56
56
|
}
|
|
57
57
|
}
|