@raketa-builder/next-form 1.7.0 → 1.8.1

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/Fieldset.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { __objRest, __spreadValues } from './chunk-ORMEWXMH.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import 'react';
4
3
  import { cn } from '@raketa-builder/ui';
5
4
  import slugify from './utils/slugify';
6
5
 
package/dist/Form.js CHANGED
@@ -7,8 +7,10 @@ const Form = (_a) => {
7
7
  var _b = _a, { children, defaultValues = {}, onSubmit } = _b, rest = __objRest(_b, ["children", "defaultValues", "onSubmit"]);
8
8
  const [state, setState] = React.useState({ submitting: false, errors: {} });
9
9
  const setErrors = (errors) => {
10
- let newErrors = {};
11
- errors.map((error) => newErrors[error.key] = error.message);
10
+ const newErrors = {};
11
+ errors.forEach((error) => {
12
+ newErrors[error.key] = error.message;
13
+ });
12
14
  if (state.submitting) {
13
15
  setState({
14
16
  submitting: false,
@@ -1,6 +1,5 @@
1
1
  import { __objRest, __spreadValues } from './chunk-ORMEWXMH.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import 'react';
4
3
  import { cn } from '@raketa-builder/ui';
5
4
  import slugify from './utils/slugify';
6
5
 
@@ -18,7 +17,7 @@ const Link = (_c) => {
18
17
  return /* @__PURE__ */ jsx("a", __spreadValues({ className: cn("r-reset", "r-next-form-nav-link", className) }, rest));
19
18
  };
20
19
  const FormNavigation = ({ sections, children }) => /* @__PURE__ */ jsxs(Wrapper, { children: [
21
- sections.map((section, idx) => /* @__PURE__ */ jsx(Link, { href: `#${slugify(section)}`, children: section }, `${section}-${idx}`)),
20
+ sections.map((section, idx) => /* @__PURE__ */ jsx(Link, { href: `#${slugify(section)}`, children: section }, `${idx}-${section}`)),
22
21
  children
23
22
  ] });
24
23
  var FormNavigation_default = FormNavigation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/next-form",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -9,7 +9,7 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": {
12
- "types": "./dist/index.d.js",
12
+ "types": "./dist/index.d.ts",
13
13
  "default": "./dist/index.js"
14
14
  }
15
15
  },
@@ -27,15 +27,17 @@
27
27
  "scripts": {
28
28
  "build": "tsup",
29
29
  "dev": "tsup --watch",
30
- "format": "prettier --write .",
31
- "lint": "biome lint --max-diagnostics=5000 ."
30
+ "format": "prettier --ignore-path ../../.prettierignore --write .",
31
+ "format:check": "prettier --ignore-path ../../.prettierignore --check .",
32
+ "lint": "biome lint --write --max-diagnostics=5000 .",
33
+ "lint:check": "biome lint --max-diagnostics=5000 ."
32
34
  },
33
35
  "peerDependencies": {
34
36
  "react": ">=19.1.0 && <=19.3.0",
35
37
  "react-dom": ">=19.1.0 && <=19.3.0"
36
38
  },
37
39
  "dependencies": {
38
- "@raketa-builder/ui": "1.6.8"
40
+ "@raketa-builder/ui": "1.8.1"
39
41
  },
40
42
  "devDependencies": {
41
43
  "@biomejs/biome": "2.1.2",