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.
@@ -13,4 +13,6 @@ export declare function NumberInput(props: {
13
13
  };
14
14
  dataTestid: string;
15
15
  readonly?: boolean;
16
+ color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
17
+ autofocus?: boolean;
16
18
  }): import("react").JSX.Element;
@@ -1,59 +1,55 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { TextField as n, useTheme as r } from "@mui/material";
3
- import { useEffect as i, useRef as a, useState as o } from "react";
4
- //#region src/NumberInput.js
5
- function s(s) {
6
- let c = "NumberInput", l = r(), [u, d] = o(""), f = a(null);
7
- return i(() => {
8
- let e = f.current;
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 !== s.value) {
12
+ if (t && t.value !== o.value) {
13
13
  let e = t.value;
14
- s.checkValue(e, d), s.onChange(e);
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
- s.value,
22
- s.onChange,
23
- s.errorMessage,
24
- s.sh,
25
- s
26
- ]), console.log(`error: ${u}`), t("div", { children: [e(n, {
27
- "data-testid": `${c}.Textfield.${s.dataTestid}`,
28
- focused: !0,
29
- color: "secondary",
30
- label: s.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: s.value,
33
- sx: { width: "150px" },
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: l.palette.primary.main
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
- s.checkValue(t, d), s.onChange(t);
48
+ o.checkValue(t, l), o.onChange(t);
45
49
  },
46
- error: !!u,
47
- helperText: u
48
- }), e(n, {
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 { s as NumberInput };
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.7",
5
+ "version": "0.1.0",
6
6
  "description": "A sample theme for the Frame project",
7
7
  "type": "module",
8
- "main": "./dist/index.cjs.js",
9
- "module": "./dist/index.es.js",
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/index.es.js"
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.3.1"
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.3.1",
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.3.0",
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.0.4",
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.3",
50
- "globals": "^17.7.0",
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.68.0",
53
+ "typescript-eslint": "^8.69.0",
54
54
  "vite": "^8.2.0",
55
- "vite-plugin-dts": "^5.0.3"
55
+ "vite-plugin-dts": "^5.1.0"
56
56
  }
57
57
  }