@twintag/twintag-form 0.2.0 → 0.3.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/.turbo/turbo-build.log +35 -27
- package/CHANGELOG.md +6 -0
- package/README.md +90 -87
- package/dist/index.es.js +6786 -6803
- package/dist/index.umd.js +43 -43
- package/dist/lib/__stories__/Form.stories.d.ts +7 -0
- package/dist/lib/__stories__/Form.stories.d.ts.map +1 -0
- package/dist/lib/components/Input/checkbox.d.ts +2 -2
- package/dist/lib/components/Input/checkbox.d.ts.map +1 -1
- package/dist/lib/components/Input/file.d.ts +2 -2
- package/dist/lib/components/Input/file.d.ts.map +1 -1
- package/dist/lib/components/Input/index.d.ts +2 -0
- package/dist/lib/components/Input/index.d.ts.map +1 -1
- package/dist/lib/components/Input/simple.d.ts +2 -2
- package/dist/lib/components/Input/simple.d.ts.map +1 -1
- package/dist/lib/components/Input/submit.d.ts +2 -2
- package/dist/lib/components/Input/submit.d.ts.map +1 -1
- package/dist/lib/components/Input/textarea.d.ts +2 -2
- package/dist/lib/components/Input/textarea.d.ts.map +1 -1
- package/dist/lib/components/Input/toggle.d.ts +2 -2
- package/dist/lib/components/Input/toggle.d.ts.map +1 -1
- package/dist/lib/components/Label/index.d.ts +9 -0
- package/dist/lib/components/Label/index.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts +5 -0
- package/dist/lib/components/index.d.ts.map +1 -0
- package/dist/lib/index.d.ts +6 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/styles.d.ts +1 -0
- package/dist/lib/styles.d.ts.map +1 -1
- package/dist/twind.config.d.ts.map +1 -1
- package/dist/webcomponent.es.js +6779 -6793
- package/dist/webcomponent.umd.js +43 -43
- package/lib/__stories__/Form.stories.tsx +38 -0
- package/lib/components/Form/index.tsx +1 -1
- package/lib/components/Input/checkbox.tsx +7 -4
- package/lib/components/Input/file.tsx +12 -5
- package/lib/components/Input/index.tsx +2 -2
- package/lib/components/Input/simple.tsx +10 -11
- package/lib/components/Input/submit.tsx +7 -5
- package/lib/components/Input/textarea.tsx +14 -11
- package/lib/components/Input/toggle.tsx +23 -18
- package/lib/components/Label/index.tsx +22 -0
- package/lib/components/index.tsx +5 -0
- package/lib/index.tsx +3 -3
- package/lib/styles.ts +12 -8
- package/package.json +2 -4
- package/scripts/build.js +5 -0
- package/tsconfig.json +1 -1
- package/twind.config.ts +5 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import TwintagForm from '../index';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<typeof TwintagForm>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TwintagForm>;
|
|
6
|
+
export declare const Example: Story;
|
|
7
|
+
//# sourceMappingURL=Form.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../lib/__stories__/Form.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,UAAU,CAAC;AAGnC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAOlC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
import type { CommonProps } from '
|
|
4
|
-
import { checkboxStyle } from '
|
|
3
|
+
import type { CommonProps } from '@twintag-form/types';
|
|
4
|
+
import { checkboxStyle } from '@twintag-form/styles';
|
|
5
5
|
type Props = CommonProps<VariantProps<typeof checkboxStyle>['variant']>;
|
|
6
6
|
declare const Checkbox: ({ useForm, label, bind, options }: Props) => JSX.Element;
|
|
7
7
|
export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,KAAK,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAExE,QAAA,MAAM,QAAQ,sCAAuC,KAAK,gBAoCzD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
import type { CommonProps } from '
|
|
4
|
-
import { fileStyle } from '
|
|
3
|
+
import type { CommonProps } from '@twintag-form/types';
|
|
4
|
+
import { fileStyle } from '@twintag-form/styles';
|
|
5
5
|
type Props = CommonProps<VariantProps<typeof fileStyle>['variant']>;
|
|
6
6
|
declare const File: ({ useForm, label, bind, options }: Props) => JSX.Element;
|
|
7
7
|
export default File;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/file.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/file.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,KAAK,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEpE,QAAA,MAAM,IAAI,sCAAuC,KAAK,gBAqErD,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/index.tsx"],"names":[],"mappings":";AAOA,eAAO,MAAM,MAAM,eAMS,CAAC;AAE7B,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,KAAK,yBAAqC,KAAK,gBAMpD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
import type { CommonProps } from '
|
|
4
|
-
import { simpleStyle } from '
|
|
3
|
+
import type { CommonProps } from '@twintag-form/types';
|
|
4
|
+
import { simpleStyle } from '@twintag-form/styles';
|
|
5
5
|
type Props = CommonProps<VariantProps<typeof simpleStyle>['variant']>;
|
|
6
6
|
declare const Simple: ({ useForm, label, bind, options }: Props) => JSX.Element;
|
|
7
7
|
export default Simple;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/simple.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/simple.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,KAAK,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEtE,QAAA,MAAM,MAAM,sCAAuC,KAAK,gBA0BvD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
import type { CommonProps } from '
|
|
4
|
-
import { submitStyle } from '
|
|
3
|
+
import type { CommonProps } from '@twintag-form/types';
|
|
4
|
+
import { submitStyle } from '@twintag-form/styles';
|
|
5
5
|
type Props = CommonProps<VariantProps<typeof submitStyle>['variant']>;
|
|
6
6
|
declare const Submit: ({ label, options }: Props) => JSX.Element;
|
|
7
7
|
export default Submit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/submit.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/submit.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,KAAK,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEtE,QAAA,MAAM,MAAM,uBAAwB,KAAK,gBAaxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
import type { CommonProps } from '
|
|
4
|
-
import { simpleStyle } from '
|
|
3
|
+
import type { CommonProps } from '@twintag-form/types';
|
|
4
|
+
import { simpleStyle } from '@twintag-form/styles';
|
|
5
5
|
type Props = CommonProps<VariantProps<typeof simpleStyle>['variant']>;
|
|
6
6
|
declare const Textarea: ({ useForm, label, bind, options }: Props) => JSX.Element;
|
|
7
7
|
export default Textarea;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,KAAK,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEtE,QAAA,MAAM,QAAQ,sCAAuC,KAAK,gBAyBzD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
import type { CommonProps } from '
|
|
4
|
-
import { toggleStyle } from '
|
|
3
|
+
import type { CommonProps } from '@twintag-form/types';
|
|
4
|
+
import { toggleStyle } from '@twintag-form/styles';
|
|
5
5
|
type Props = CommonProps<VariantProps<typeof toggleStyle>['variant']>;
|
|
6
6
|
declare const Toggle: ({ useForm, label, bind, options }: Props) => JSX.Element;
|
|
7
7
|
export default Toggle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../lib/components/Input/toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,KAAK,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEtE,QAAA,MAAM,MAAM,sCAAuC,KAAK,gBAuCvD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WithChildren } from 'twintag-types/dom';
|
|
3
|
+
type Props = {
|
|
4
|
+
required?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & WithChildren;
|
|
7
|
+
declare const Label: ({ className, required, children }: Props) => JSX.Element;
|
|
8
|
+
export default Label;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/Label/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,YAAY,CAAC;AAEjB,QAAA,MAAM,KAAK,sCAAuC,KAAK,gBAUtD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type Config = {
|
|
3
|
+
key?: number;
|
|
4
|
+
type?: any;
|
|
3
5
|
subtype?: string;
|
|
4
6
|
label?: string;
|
|
7
|
+
items?: any[];
|
|
5
8
|
bind?: string;
|
|
6
|
-
children?: ReactNode;
|
|
7
9
|
options?: Record<string, any>;
|
|
8
10
|
};
|
|
9
11
|
type Props = {
|
|
10
|
-
config:
|
|
12
|
+
config: Config[];
|
|
11
13
|
options?: {
|
|
12
14
|
variant?: string;
|
|
13
15
|
resetOnSubmit?: boolean;
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.tsx"],"names":[],"mappings":";AAOA,KAAK,MAAM,GAAG;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B,CAAC;AAuIF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,WAAW,wBAAyB,KAAK,gBAY9C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/dist/lib/styles.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const labelStyle: import("tailwind-variants").TVReturnType<import("tailwind-variants").TVVariantsDefault<undefined, "font-fftext text-label"> | {}, unknown, undefined, undefined, "font-fftext text-label", import("tailwind-variants/dist/config").TVConfig<import("tailwind-variants").TVVariantsDefault<undefined, "font-fftext text-label"> | {}, unknown>>;
|
|
1
2
|
export declare const checkboxStyle: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
variant: {
|
|
3
4
|
alpha: {
|
package/dist/lib/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../lib/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;YAmBxB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;YAwBpB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBtB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;YAWtB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../lib/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,gVAErB,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;YAmBxB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;YAwBpB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBtB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;YAWtB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twind.config.d.ts","sourceRoot":"","sources":["../twind.config.ts"],"names":[],"mappings":";;;AAMA,
|
|
1
|
+
{"version":3,"file":"twind.config.d.ts","sourceRoot":"","sources":["../twind.config.ts"],"names":[],"mappings":";;;AAMA,wBAoBG"}
|