@goodhood-web/nebenan-base 3.0.0-development.63 → 3.0.0-development.65

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.
@@ -0,0 +1,4 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { DynamicFormProps } from './DynamicForm.types';
3
+ export declare function DynamicForm({ fields, onSubmit }: PropsWithChildren<DynamicFormProps>): import("react/jsx-runtime").JSX.Element;
4
+ export default DynamicForm;
@@ -0,0 +1,6 @@
1
+ import { FormField } from '../Wizard/Wizard.types';
2
+ export type DynamicFormProps = {
3
+ fields: FormField[];
4
+ id?: string;
5
+ onSubmit: (data: object) => void;
6
+ };
@@ -0,0 +1,2 @@
1
+ import { ButtonPrimaryProps } from '../../../../../ui/src/lib/Atoms/Buttons/ButtonPrimary/ButtonPrimary.types';
2
+ export default function FormSubmitButton(props: ButtonPrimaryProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { TextInputProps } from '../../../../../ui/src/lib/Atoms/Inputs/TextInput/TextInput.types';
3
+ export type FormTextInputProps = UseControllerProps & Partial<TextInputProps>;
4
+ export default function FormTextInput({ colorScheme, name, rules, size, }: FormTextInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { default as FormSubmitButton } from './FormSubmitButton';
2
+ import { default as FormTextInput } from './FormTextInput';
3
+ export { FormTextInput, FormSubmitButton };
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { FormProps } from './Form.types';
3
+ export default function Form({ children, initialValues, onSubmit, validationSchema, }: PropsWithChildren<FormProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ZodType } from 'zod';
2
+ export type FormProps = {
3
+ initialValues?: object;
4
+ onSubmit: (data: object) => void;
5
+ validationSchema?: ZodType<FormData>;
6
+ };
@@ -0,0 +1,3 @@
1
+ import { GridFormProps } from './GridForm.types';
2
+ export declare const GridForm: ({ children, ...props }: GridFormProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default GridForm;
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { FormProps } from '../Form/Form.types';
3
+ export type GridFormProps = PropsWithChildren<FormProps>;
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { WizardProps } from './Wizard.types';
3
+ export default function Wizard({ steps }: PropsWithChildren<WizardProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ import { GridItemProps } from '../../Grids/Grid/GridItem/GridItem.types';
3
+ import { FormTextInputProps } from '../Fields/FormTextInput';
4
+ export type StepField = {
5
+ id: string;
6
+ layout?: {
7
+ desktop?: GridItemProps['desktop'];
8
+ mobile?: GridItemProps['mobile'];
9
+ };
10
+ type: string;
11
+ };
12
+ export type TextField = StepField & FormTextInputProps & {
13
+ type: 'text';
14
+ };
15
+ export type SubmitField = StepField & {
16
+ type: 'submit';
17
+ };
18
+ export type SlotField = StepField & {
19
+ render: ({ key }: {
20
+ key: string;
21
+ }) => ReactNode;
22
+ type: 'slot';
23
+ };
24
+ export type NextField = StepField & {
25
+ type: 'next';
26
+ };
27
+ export type FormField = SubmitField | SlotField | TextField | NextField;
28
+ export type WizardStepT = {
29
+ fields: FormField[];
30
+ id: string;
31
+ onSubmit?: (data: object) => void;
32
+ };
33
+ export type WizardProps = {
34
+ steps: WizardStepT[];
35
+ };
@@ -0,0 +1,8 @@
1
+ type TWizardContext = {
2
+ next: () => void;
3
+ onSumbitStep: (data: object) => void;
4
+ previous: () => void;
5
+ };
6
+ export declare const WizardContext: import('react').Context<TWizardContext>;
7
+ export declare const WizardProvider: import('react').Provider<TWizardContext>;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import { default as Wizard } from './Wizard';
2
+ export * from './Wizard.types';
3
+ export { Wizard };
@@ -0,0 +1,5 @@
1
+ export declare const useWizard: () => {
2
+ next: () => void;
3
+ onSumbitStep: (data: object) => void;
4
+ previous: () => void;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { default as DynamicForm } from './DynamicForm/DynamicForm';
2
+ import { default as Form } from './Form/Form';
3
+ export { Form, DynamicForm };
4
+ export * from './Fields';
5
+ export * from './Wizard';
@@ -0,0 +1,3 @@
1
+ import { GridProps } from './Grid.types';
2
+ export declare const Grid: ({ children, spacing }: GridProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Grid;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const gridSpacing: string[];
3
+ export type TGridSpacing = (typeof gridSpacing)[number];
4
+ export type GridProps = {
5
+ children: ReactNode;
6
+ spacing?: TGridSpacing | {
7
+ x: TGridSpacing;
8
+ y: TGridSpacing;
9
+ };
10
+ };
@@ -0,0 +1,3 @@
1
+ import { GridItemProps } from './GridItem.types';
2
+ export declare const GridItem: ({ children, desktop, mobile }: GridItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default GridItem;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export type GridItemProps = {
3
+ children: ReactNode;
4
+ desktop?: number;
5
+ mobile?: number;
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/nebenan-base",
3
- "version": "3.0.0-development.63",
3
+ "version": "3.0.0-development.65",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",