@bouko/react 2.2.0 → 2.2.2

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.
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import { Button } from "../button";
5
5
  import { RowBox } from "../layout/flex";
6
- import CheckCircle from "./assets/check-circle.svg";
7
- import Spinner from "./assets/spinner.svg";
6
+ import CheckCircle from "../../assets/icons/check-circle.svg";
7
+ import Spinner from "../../assets/icons/spinner.svg";
8
8
  export default function FormFooter({ data, validator, submit, clear }) {
9
9
  const isValid = validator.safeParse(data).success;
10
10
  const [isLoading, setLoading] = useState(false);
@@ -10,12 +10,12 @@ type Props<T> = {
10
10
  id?: string;
11
11
  button?: string;
12
12
  fields: FormBuilderField<T>;
13
- validator: (x: Partial<T>) => ({
13
+ validator?: (x: Partial<T>) => ({
14
14
  success: boolean;
15
15
  });
16
16
  sound?: string;
17
17
  cancel?: boolean;
18
- submit: (data: Partial<T>) => Promise<void | never>;
18
+ submit: (data: T) => Promise<void | never>;
19
19
  };
20
20
  export declare function useSound(filename?: string): import("use-sound/dist/types").PlayFunction | undefined;
21
21
  export * from "./loaders";
@@ -24,4 +24,4 @@ type Item = {
24
24
  initial?: string;
25
25
  };
26
26
  export declare function mapIdToInitial<T>(arrays: Item[][]): Partial<T>;
27
- export declare function FormBuilder<T>({ fields, validator, button, styles, submit, cancel }: Props<T>): import("react/jsx-runtime").JSX.Element;
27
+ export declare function FormBuilder<T>({ fields, button, styles, submit, cancel }: Props<T>): import("react/jsx-runtime").JSX.Element;
@@ -27,7 +27,7 @@ export function mapIdToInitial(arrays) {
27
27
  }
28
28
  return result;
29
29
  }
30
- export function FormBuilder({ fields, validator, button, styles, submit, cancel = false }) {
30
+ export function FormBuilder({ fields, button, styles, submit, cancel = false }) {
31
31
  const initialShi = mapIdToInitial(fields);
32
32
  const { data, setField, clear } = useForm(initialShi);
33
33
  const isValid = true; // validator(data).success;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  "name": "@bouko/react",
4
4
 
5
- "version": "2.2.0",
5
+ "version": "2.2.2",
6
6
 
7
7
  "main": "./dist/index.js",
8
8