@nomos-ui/form 0.0.21 → 0.0.22

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.
@@ -1 +1 @@
1
- {"version":3,"file":"form-debug-info.d.ts","sourceRoot":"","sources":["../../src/components/form-debug-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAC1B,GAAG,YAAY,CAoBf"}
1
+ {"version":3,"file":"form-debug-info.d.ts","sourceRoot":"","sources":["../../src/components/form-debug-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAwBhD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAC1B,GAAG,YAAY,CAiBf"}
@@ -2,10 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = FormDebugInfo;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- function FormDebugInfo({ form, }) {
6
- ///@ts-ignore
7
- return process?.env?.NODE_ENV === "development" ||
5
+ function isDevelopment() {
6
+ try {
7
+ if (
8
+ ///@ts-ignore
9
+ typeof import.meta !== "undefined" &&
10
+ ///@ts-ignore
11
+ import.meta.env?.MODE === "development")
12
+ return true;
13
+ }
14
+ catch { }
15
+ try {
16
+ if (
8
17
  ///@ts-ignore
9
- import.meta?.env?.NODE_ENV === "development" ? ((0, jsx_runtime_1.jsxs)("details", { className: "", children: [(0, jsx_runtime_1.jsx)("summary", { className: "cursor-pointer text-sm text-gray-500", children: "Debug Info" }), (0, jsx_runtime_1.jsxs)("pre", { className: "text-xs bg-gray-100 p-4 rounded mt-2 overflow-auto", children: [(0, jsx_runtime_1.jsx)("strong", { children: "Form Errors:" }), JSON.stringify(form.formState.errors, null, 2), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("strong", { children: "Form Values:" }), JSON.stringify(form.watch(), null, 2)] })] })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}));
18
+ typeof process !== "undefined" &&
19
+ ///@ts-ignore
20
+ process.env?.NODE_ENV === "development")
21
+ return true;
22
+ }
23
+ catch { }
24
+ return false;
25
+ }
26
+ function FormDebugInfo({ form, }) {
27
+ if (!isDevelopment())
28
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
29
+ return ((0, jsx_runtime_1.jsxs)("details", { children: [(0, jsx_runtime_1.jsx)("summary", { className: "cursor-pointer text-sm text-gray-500", children: "Debug Info" }), (0, jsx_runtime_1.jsxs)("pre", { className: "text-xs bg-gray-100 p-4 rounded mt-2 overflow-auto", children: [(0, jsx_runtime_1.jsx)("strong", { children: "Form Errors:" }), JSON.stringify(form.formState.errors, null, 2), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("strong", { children: "Form Values:" }), JSON.stringify(form.watch(), null, 2)] })] }));
10
30
  }
11
31
  //# sourceMappingURL=form-debug-info.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-debug-info.js","sourceRoot":"","sources":["../../src/components/form-debug-info.tsx"],"names":[],"mappings":";;AAGA,gCAwBC;;AAxBD,SAAwB,aAAa,CAAC,EACpC,IAAI,GAGL;IACC,aAAa;IACb,OAAQ,OAAe,EAAE,GAAG,EAAE,QAAQ,KAAK,aAAa;QACtD,aAAa;QACZ,MAAM,CAAC,IAAY,EAAE,GAAG,EAAE,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,CACxD,qCAAS,SAAS,EAAC,EAAE,aACnB,oCAAS,SAAS,EAAC,sCAAsC,2BAE/C,EACV,iCAAK,SAAS,EAAC,oDAAoD,aACjE,8DAA6B,EAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAC/C,gCAAM,EACN,8DAA6B,EAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAClC,IACE,CACX,CAAC,CAAC,CAAC,CACF,kDAAK,CACN,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"form-debug-info.js","sourceRoot":"","sources":["../../src/components/form-debug-info.tsx"],"names":[],"mappings":";;AAyBA,gCAqBC;;AA3CD,SAAS,aAAa;IACpB,IAAI,CAAC;QACH;QACE,aAAa;QACb,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW;YAClC,aAAa;YACZ,MAAM,CAAC,IAAY,CAAC,GAAG,EAAE,IAAI,KAAK,aAAa;YAEhD,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACH;QACE,aAAa;QACb,OAAO,OAAO,KAAK,WAAW;YAC9B,aAAa;YACb,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,aAAa;YAEvC,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAwB,aAAa,CAAC,EACpC,IAAI,GAGL;IACC,IAAI,CAAC,aAAa,EAAE;QAAE,OAAO,kDAAK,CAAC;IAEnC,OAAO,CACL,gDACE,oCAAS,SAAS,EAAC,sCAAsC,2BAE/C,EACV,iCAAK,SAAS,EAAC,oDAAoD,aACjE,8DAA6B,EAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAC/C,gCAAM,EACN,8DAA6B,EAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAClC,IACE,CACX,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomos-ui/form",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "The Shadcn library for building robust React forms",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/exports/index.js",
@@ -19,7 +19,9 @@
19
19
  },
20
20
  "typesVersions": {
21
21
  "*": {
22
- "utils": ["./dist/exports/utils/index.d.ts"]
22
+ "utils": [
23
+ "./dist/exports/utils/index.d.ts"
24
+ ]
23
25
  }
24
26
  },
25
27
  "scripts": {
@@ -62,7 +64,11 @@
62
64
  "url": "https://github.com/uanela/nomos-ui/issues"
63
65
  },
64
66
  "homepage": "https://github.com/uanela/nomos-ui",
65
- "files": ["dist", "README.md", "LICENSE"],
67
+ "files": [
68
+ "dist",
69
+ "README.md",
70
+ "LICENSE"
71
+ ],
66
72
  "sideEffects": false,
67
73
  "packageManager": "pnpm@10.13.1",
68
74
  "dependencies": {