@nomos-ui/form 0.0.21 → 0.0.23

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,6 +1,7 @@
1
1
  import { type ReactElement } from "react";
2
2
  import { UseFormReturn } from "react-hook-form";
3
- export default function FormDebugInfo({ form, }: {
3
+ export default function FormDebugInfo({ form, environment, }: {
4
4
  form: UseFormReturn<any>;
5
+ environment?: string;
5
6
  }): ReactElement;
6
7
  //# sourceMappingURL=form-debug-info.d.ts.map
@@ -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;AAEhD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,YAAY,CAiBf"}
@@ -2,10 +2,9 @@
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" ||
8
- ///@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, {}));
5
+ function FormDebugInfo({ form, environment, }) {
6
+ if (environment !== "development")
7
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
8
+ 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
9
  }
11
10
  //# 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":";;AAGA,gCAuBC;;AAvBD,SAAwB,aAAa,CAAC,EACpC,IAAI,EACJ,WAAW,GAIZ;IACC,IAAI,WAAW,KAAK,aAAa;QAAE,OAAO,kDAAK,CAAC;IAEhD,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.23",
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": {