@nomos-ui/form 0.0.22 → 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;AAwBhD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAC1B,GAAG,YAAY,CAiBf"}
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,29 +2,8 @@
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 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 (
17
- ///@ts-ignore
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())
5
+ function FormDebugInfo({ form, environment, }) {
6
+ if (environment !== "development")
28
7
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
29
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)] })] }));
30
9
  }
@@ -1 +1 @@
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"}
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.22",
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",