@twintag/twintag-form 1.4.0-beta.1 → 1.4.0-beta.3
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +12 -0
- package/README.md +8 -4
- package/dev/main.tsx +453 -233
- package/dist/components/config.d.ts +2 -2
- package/dist/components/containers/accordion.d.ts +2 -4
- package/dist/components/fields/checkbox.d.ts +1 -1
- package/dist/components/fields/date-picker.d.ts +1 -1
- package/dist/components/fields/file.d.ts +1 -1
- package/dist/components/fields/input.d.ts +1 -1
- package/dist/components/fields/radiogroup.d.ts +3 -1
- package/dist/components/fields/textarea.d.ts +1 -1
- package/dist/components/fields/toggle.d.ts +1 -1
- package/dist/components/fields/tri-toggle.d.ts +1 -1
- package/dist/components/provider.d.ts +3 -3
- package/dist/twintag-form.react.js +1637 -1624
- package/dist/types/index.d.ts +37 -22
- package/dist/utils/data.d.ts +5 -1
- package/index.html +1 -0
- package/lib/components/config.tsx +2 -2
- package/lib/components/containers/accordion.tsx +33 -14
- package/lib/components/fields/checkbox.tsx +1 -1
- package/lib/components/fields/date-picker.tsx +5 -1
- package/lib/components/fields/file.tsx +83 -83
- package/lib/components/fields/input.tsx +1 -1
- package/lib/components/fields/radiogroup.tsx +5 -1
- package/lib/components/fields/textarea.tsx +1 -1
- package/lib/components/fields/toggle.tsx +1 -1
- package/lib/components/fields/tri-toggle.tsx +1 -1
- package/lib/components/provider.tsx +163 -159
- package/lib/index.tsx +41 -41
- package/lib/types/index.ts +82 -49
- package/lib/utils/data.ts +5 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { InputCompConfig } from '../types';
|
|
3
3
|
|
|
4
|
-
export declare const Inputs: Map<string,
|
|
4
|
+
export declare const Inputs: Map<string, InputCompConfig>;
|
|
5
5
|
export declare const Containers: Map<string, ElementType>;
|
|
6
6
|
export declare const components: Map<string, ElementType>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { Props } from '../../types';
|
|
1
2
|
import { WithChildren } from 'twintag-types/dom';
|
|
2
3
|
import { FC } from 'react';
|
|
3
4
|
|
|
4
|
-
type AccordionProps =
|
|
5
|
-
subtype?: 'item' | 'multiple' | 'single';
|
|
6
|
-
label?: string;
|
|
7
|
-
} & WithChildren;
|
|
5
|
+
type AccordionProps = Props<'accordion', 'item' | 'multiple' | 'single'> & WithChildren;
|
|
8
6
|
declare const Accordion: FC<AccordionProps>;
|
|
9
7
|
export { Accordion };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RawJsonComponent, TwintagFormContext,
|
|
1
|
+
import { ParsedJsonComponent, RawJsonComponent, TwintagFormContext, InputCompConfig } from '../types';
|
|
2
2
|
import { WithChildren } from 'twintag-types/dom';
|
|
3
3
|
import { Context, ElementType, ReactNode } from 'react';
|
|
4
4
|
|
|
@@ -6,14 +6,14 @@ export declare const twintagFormContext: Context<TwintagFormContext>;
|
|
|
6
6
|
export declare const useTwintagForm: () => TwintagFormContext;
|
|
7
7
|
type Components = TwintagFormContext['components'];
|
|
8
8
|
type Inputs = TwintagFormContext['inputs'];
|
|
9
|
-
export declare const getResetValues: (config:
|
|
9
|
+
export declare const getResetValues: (config: ParsedJsonComponent | ParsedJsonComponent[], inputs: Map<string, InputCompConfig>) => {
|
|
10
10
|
[k: string]: unknown;
|
|
11
11
|
};
|
|
12
12
|
export declare const TwintagFormProvider: ({ variant, size, inputs, components, config, children, }: {
|
|
13
13
|
config: RawJsonComponent | RawJsonComponent[];
|
|
14
14
|
variant: TwintagFormContext['variant'];
|
|
15
15
|
size: TwintagFormContext['size'];
|
|
16
|
-
inputs: Map<string,
|
|
16
|
+
inputs: Map<string, InputCompConfig>;
|
|
17
17
|
components: Map<string, ElementType>;
|
|
18
18
|
} & {
|
|
19
19
|
children?: ReactNode;
|