@twintag/twintag-form 1.6.2-beta.1 → 1.7.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.
Files changed (57) hide show
  1. package/.turbo/turbo-build.log +16 -16
  2. package/CHANGELOG.md +241 -221
  3. package/README.md +407 -407
  4. package/dev/index.css +32 -32
  5. package/dev/main.tsx +461 -460
  6. package/dist/common/button.d.ts +0 -1
  7. package/dist/common/form.d.ts +0 -1
  8. package/dist/common/icon.d.ts +0 -1
  9. package/dist/common/input.d.ts +0 -1
  10. package/dist/common/label.d.ts +0 -1
  11. package/dist/common/textarea.d.ts +0 -1
  12. package/dist/components/config.d.ts +0 -1
  13. package/dist/components/containers/accordion.d.ts +1 -2
  14. package/dist/components/containers/category.d.ts +0 -1
  15. package/dist/components/fields/checkbox.d.ts +0 -1
  16. package/dist/components/fields/file.d.ts +0 -1
  17. package/dist/components/fields/input.d.ts +0 -1
  18. package/dist/components/fields/radiogroup.d.ts +0 -1
  19. package/dist/components/fields/submit.d.ts +0 -1
  20. package/dist/components/fields/textarea.d.ts +0 -1
  21. package/dist/components/fields/toggle.d.ts +0 -1
  22. package/dist/components/fields/tri-toggle.d.ts +0 -1
  23. package/dist/components/form.d.ts +0 -1
  24. package/dist/components/input.d.ts +0 -1
  25. package/dist/components/label.d.ts +0 -1
  26. package/dist/components/provider.d.ts +1 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.ts +0 -1
  29. package/dist/index.js +1437 -1601
  30. package/dist/types/index.d.ts +0 -1
  31. package/dist/utils/data.d.ts +0 -1
  32. package/dist/utils/style.d.ts +0 -1
  33. package/dist/webcomponent.cjs +1 -1
  34. package/dist/webcomponent.js +1118 -1104
  35. package/lib/common/icon.tsx +2 -1
  36. package/lib/components/config.tsx +1 -0
  37. package/lib/components/containers/accordion.tsx +3 -2
  38. package/lib/components/containers/category.tsx +1 -1
  39. package/lib/components/fields/checkbox.tsx +3 -6
  40. package/lib/components/fields/date-picker.tsx +151 -154
  41. package/lib/components/fields/file.tsx +81 -84
  42. package/lib/components/fields/input.tsx +67 -70
  43. package/lib/components/fields/radiogroup.tsx +3 -6
  44. package/lib/components/fields/submit.tsx +1 -0
  45. package/lib/components/fields/textarea.tsx +69 -72
  46. package/lib/components/fields/toggle.tsx +3 -6
  47. package/lib/components/fields/tri-toggle.tsx +3 -4
  48. package/lib/components/input.tsx +2 -1
  49. package/lib/components/label.tsx +1 -0
  50. package/lib/components/provider.tsx +163 -162
  51. package/lib/components/renderer.tsx +2 -1
  52. package/lib/index.tsx +46 -45
  53. package/lib/types/index.ts +102 -102
  54. package/lib/webcomponent.ts +1 -2
  55. package/package.json +9 -10
  56. package/prettier.config.mjs +1 -17
  57. package/vite.config.ts +2 -1
@@ -1,5 +1,4 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
-
3
2
  import * as React from 'react';
4
3
  declare const buttonVariants: TVReturnType<{
5
4
  variant: {
@@ -2,7 +2,6 @@ import { ControllerProps, FieldPath, FieldValues, FormProviderProps, FieldError
2
2
  import { VariantProps, TVReturnType } from 'tailwind-variants';
3
3
  import { LabelProps } from '@radix-ui/react-label';
4
4
  import { SlotProps } from '@radix-ui/react-slot';
5
-
6
5
  import * as React from 'react';
7
6
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
8
7
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
-
3
2
  type Props = {
4
3
  name: string;
5
4
  className?: string;
@@ -1,5 +1,4 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
-
3
2
  import * as React from 'react';
4
3
  declare const inputVariants: TVReturnType<{
5
4
  variant: {
@@ -1,5 +1,4 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
-
3
2
  import * as React from 'react';
4
3
  import * as LabelPrimitive from '@radix-ui/react-label';
5
4
  declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps< TVReturnType<{
@@ -1,5 +1,4 @@
1
1
  import { VariantProps, TVReturnType } from 'tailwind-variants';
2
-
3
2
  import * as React from 'react';
4
3
  declare const Textarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & VariantProps< TVReturnType<{
5
4
  variant: {
@@ -1,6 +1,5 @@
1
1
  import { ElementType } from 'react';
2
2
  import { InputCompConfig } from '../types';
3
-
4
3
  export declare const Containers: Map<string, ElementType>;
5
4
  export declare const Inputs: Map<string, InputCompConfig>;
6
5
  export declare const components: Map<string, ElementType>;
@@ -1,7 +1,6 @@
1
1
  import { FC } from 'react';
2
- import { Props } from '../../types';
3
2
  import { WithChildren } from 'twintag-types/dom';
4
-
3
+ import { Props } from '../../types';
5
4
  type AccordionProps = Props<'accordion', 'item' | 'multiple' | 'single'> & WithChildren;
6
5
  declare const Accordion: FC<AccordionProps>;
7
6
  export { Accordion };
@@ -1,6 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  import { WithChildren } from 'twintag-types/dom';
3
-
4
3
  type Props = {
5
4
  label?: string;
6
5
  } & WithChildren;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_CHECKBOX_VALUE = false;
5
4
  export declare const Checkbox: FC<Props<'input'>>;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_FILE_VALUE = "";
5
4
  export declare const File: FC<Props<'input', 'file'>>;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_INPUT_VALUE = "";
5
4
  export declare const Input: FC<Props<'input', 'text'>>;
@@ -1,6 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_RADIOGROUP_VALUE = "";
5
4
  export declare const RadioGroup: FC<Props<'input'> & {
6
5
  items: Props<'input'>[];
@@ -1,4 +1,3 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const Submit: FC<Props>;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_TEXTAREA_VALUE = "";
5
4
  export declare const Textarea: FC<Props<'input', 'text'>>;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_TOGGLE_VALUE = false;
5
4
  export declare const Toggle: FC<Props<'input'>>;
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../../types';
3
-
4
3
  export declare const DEFAULT_TRI_TOGGLE_VALUE: null;
5
4
  export declare const TriToggle: FC<Props<'input'>>;
@@ -1,6 +1,5 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
2
  import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
3
-
4
3
  export declare const TwintagForm: ForwardRefExoticComponent<{
5
4
  defaultValues?: FieldValues;
6
5
  resetOnSubmit?: boolean;
@@ -1,4 +1,3 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../types';
3
-
4
3
  export declare const Input: FC<Props<'input'>>;
@@ -1,4 +1,3 @@
1
1
  import { FC } from 'react';
2
2
  import { Props } from '../types';
3
-
4
3
  export declare const Label: FC<Props>;
@@ -1,7 +1,6 @@
1
- import { ParsedJsonComponent, RawJsonComponent, TwintagFormContext } from '../types';
2
1
  import { WithChildren } from 'twintag-types/dom';
2
+ import { ParsedJsonComponent, RawJsonComponent, TwintagFormContext } from '../types';
3
3
  import { Context } from 'react';
4
-
5
4
  export declare const twintagFormContext: Context<TwintagFormContext>;
6
5
  export declare const useTwintagForm: () => TwintagFormContext;
7
6
  type Inputs = TwintagFormContext['inputs'];