@twintag/twintag-form 0.6.0 → 1.0.0-beta.0
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/.eslintrc.cjs +5 -0
- package/.turbo/turbo-build.log +14 -9
- package/.turbo/turbo-lint.log +4 -0
- package/CHANGELOG.md +6 -0
- package/README.md +87 -59
- package/dev/index.css +29 -0
- package/dev/main.tsx +163 -0
- package/dist/common/button.d.ts +137 -0
- package/dist/common/checkbox.d.ts +4 -0
- package/dist/common/form.d.ts +24 -0
- package/dist/common/input.d.ts +4 -0
- package/dist/common/label.d.ts +4 -0
- package/dist/common/radiogroup.d.ts +5 -0
- package/dist/common/switch.d.ts +4 -0
- package/dist/common/textarea.d.ts +4 -0
- package/dist/components/Input/checkbox.d.ts +2 -6
- package/dist/components/Input/file.d.ts +2 -6
- package/dist/components/Input/index.d.ts +2 -2
- package/dist/components/Input/radiogroup.d.ts +3 -0
- package/dist/components/Input/simple.d.ts +2 -6
- package/dist/components/Input/submit.d.ts +2 -6
- package/dist/components/Input/textarea.d.ts +2 -6
- package/dist/components/Input/toggle.d.ts +2 -6
- package/dist/components/Render/index.d.ts +7 -0
- package/dist/components/Render/useJson.d.ts +2 -0
- package/dist/components/{Label/index.d.ts → category.d.ts} +3 -4
- package/dist/components/form.d.ts +7 -0
- package/dist/components/index.d.ts +8 -4
- package/dist/index.d.ts +8 -9
- package/dist/provider.d.ts +8 -0
- package/dist/twintag-form.react.js +7930 -8119
- package/dist/twintag-form.webcomponent.js +2007 -1769
- package/dist/types/index.d.ts +33 -0
- package/index.html +13 -0
- package/lib/common/button.tsx +49 -0
- package/lib/common/checkbox.tsx +40 -0
- package/lib/common/form.tsx +192 -0
- package/lib/common/input.tsx +55 -0
- package/lib/common/label.tsx +26 -0
- package/lib/common/radiogroup.tsx +56 -0
- package/lib/common/switch.tsx +39 -0
- package/lib/common/textarea.tsx +53 -0
- package/lib/components/Input/checkbox.tsx +55 -42
- package/lib/components/Input/file.tsx +64 -72
- package/lib/components/Input/index.tsx +15 -15
- package/lib/components/Input/radiogroup.tsx +84 -0
- package/lib/components/Input/simple.tsx +50 -28
- package/lib/components/Input/submit.tsx +4 -13
- package/lib/components/Input/textarea.tsx +49 -27
- package/lib/components/Input/toggle.tsx +54 -45
- package/lib/components/Render/index.tsx +30 -0
- package/lib/components/Render/useJson.ts +76 -0
- package/lib/components/category.tsx +31 -0
- package/lib/components/form.tsx +75 -0
- package/lib/components/index.tsx +27 -4
- package/lib/index.tsx +24 -48
- package/lib/provider.tsx +36 -0
- package/lib/types/index.ts +37 -0
- package/lib/webcomponent.ts +6 -6
- package/package.json +18 -9
- package/prettier.config.mjs +26 -0
- package/tailwind.config.ts +43 -0
- package/tsconfig.json +14 -3
- package/twind.config.ts +4 -21
- package/vite.config.ts +1 -1
- package/dist/components/Category/__styles.d.ts +0 -29
- package/dist/components/Category/index.d.ts +0 -8
- package/dist/components/Form/index.d.ts +0 -12
- package/dist/components/Input/__props.d.ts +0 -10
- package/dist/components/Input/__styles.d.ts +0 -460
- package/dist/styles.d.ts +0 -487
- package/lib/__stories__/Form.stories.tsx +0 -141
- package/lib/components/Category/__styles.ts +0 -12
- package/lib/components/Category/index.tsx +0 -26
- package/lib/components/Form/index.tsx +0 -86
- package/lib/components/Input/__props.ts +0 -10
- package/lib/components/Input/__styles.ts +0 -132
- package/lib/components/Label/index.tsx +0 -24
- package/lib/styles.ts +0 -143
- package/tailwind.config.cjs +0 -8
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { checkboxStyle } from './__styles';
|
|
5
|
-
type Props = CommonProps<VariantProps<typeof checkboxStyle>['variant']>;
|
|
6
|
-
declare const Checkbox: FC<Props>;
|
|
7
|
-
export default Checkbox;
|
|
2
|
+
import type { Props } from '../../types';
|
|
3
|
+
export declare const Checkbox: FC<Props>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { fileStyle } from './__styles';
|
|
5
|
-
type Props = CommonProps<VariantProps<typeof fileStyle>['variant']>;
|
|
6
|
-
declare const File: FC<Props>;
|
|
7
|
-
export default File;
|
|
2
|
+
import type { Props } from '../../types';
|
|
3
|
+
export declare const File: FC<Props>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { simpleStyle } from './__styles';
|
|
5
|
-
type Props = CommonProps<VariantProps<typeof simpleStyle>['variant']>;
|
|
6
|
-
declare const Simple: FC<Props>;
|
|
7
|
-
export default Simple;
|
|
2
|
+
import type { Props } from '../../types';
|
|
3
|
+
export declare const Simple: FC<Props>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { submitStyle } from './__styles';
|
|
5
|
-
type Props = CommonProps<VariantProps<typeof submitStyle>['variant']>;
|
|
6
|
-
declare const Submit: FC<Props>;
|
|
7
|
-
export default Submit;
|
|
2
|
+
import type { Props } from '../../types';
|
|
3
|
+
export declare const Submit: FC<Props>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { simpleStyle } from './__styles';
|
|
5
|
-
type Props = CommonProps<VariantProps<typeof simpleStyle>['variant']>;
|
|
6
|
-
declare const Textarea: FC<Props>;
|
|
7
|
-
export default Textarea;
|
|
2
|
+
import type { Props } from '../../types';
|
|
3
|
+
export declare const Textarea: FC<Props>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
import { toggleStyle } from './__styles';
|
|
5
|
-
type Props = CommonProps<VariantProps<typeof toggleStyle>['variant']>;
|
|
6
|
-
declare const Toggle: FC<Props>;
|
|
7
|
-
export default Toggle;
|
|
2
|
+
import type { Props } from '../../types';
|
|
3
|
+
export declare const Toggle: FC<Props>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import type { WithChildren } from 'twintag-types/dom';
|
|
3
3
|
type Props = {
|
|
4
|
-
|
|
5
|
-
className?: string;
|
|
4
|
+
label?: string;
|
|
6
5
|
} & WithChildren;
|
|
7
|
-
declare const
|
|
8
|
-
export
|
|
6
|
+
declare const Category: FC<Props>;
|
|
7
|
+
export { Category };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import type { RawJsonComponent } from '../types';
|
|
3
|
+
export { Input } from './Input';
|
|
4
|
+
export { Category } from './category';
|
|
5
|
+
type Props = {
|
|
6
|
+
config: RawJsonComponent | RawJsonComponent[];
|
|
7
|
+
};
|
|
8
|
+
export declare const TwintagJsonRenderer: ({ config }: Props) => JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import type { RawJsonComponent } from '
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import type { RawJsonComponent } from './types';
|
|
4
|
+
import { TwintagFormProvider } from './provider';
|
|
4
5
|
type Props = {
|
|
5
6
|
config: RawJsonComponent[];
|
|
6
|
-
options?: {
|
|
7
|
-
variant?:
|
|
7
|
+
options?: Partial<{
|
|
8
|
+
variant?: ComponentProps<typeof TwintagFormProvider>['variant'];
|
|
8
9
|
resetOnSubmit?: boolean;
|
|
9
|
-
}
|
|
10
|
+
}>;
|
|
10
11
|
};
|
|
11
|
-
export declare const
|
|
12
|
-
validate?: (() => void) | undefined;
|
|
13
|
-
}>>;
|
|
12
|
+
export declare const Form: ({ config, options }: Props) => JSX.Element;
|
|
14
13
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
/// <reference types="react" />
|
|
4
|
+
import type { TwintagFormContext } from './types';
|
|
5
|
+
import type { WithChildren } from 'twintag-types/dom';
|
|
6
|
+
export declare const twintagFormContext: Context<TwintagFormContext>;
|
|
7
|
+
export declare const useTwintagForm: () => TwintagFormContext;
|
|
8
|
+
export declare const TwintagFormProvider: ({ children, variant, components, }: TwintagFormContext & WithChildren) => JSX.Element;
|