autoforma 1.0.0 → 1.0.1
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/dist/index.cjs.js +70 -0
- package/dist/index.es.js +13532 -0
- package/dist/src/components/AutoForm.d.ts +18 -0
- package/dist/src/components/FieldRender.d.ts +16 -0
- package/dist/src/components/fields/ArrayField.d.ts +13 -0
- package/dist/src/components/fields/CheckField.d.ts +7 -0
- package/dist/src/components/fields/DateField.d.ts +6 -0
- package/dist/src/components/fields/DateTimeField.d.ts +6 -0
- package/dist/src/components/fields/NumberField.d.ts +6 -0
- package/dist/src/components/fields/ObjectField.d.ts +9 -0
- package/dist/src/components/fields/SelectField.d.ts +10 -0
- package/dist/src/components/fields/TextAreaField.d.ts +6 -0
- package/dist/src/components/fields/TextField.d.ts +6 -0
- package/dist/src/components/fields/TimeField.d.ts +6 -0
- package/{src/index.ts → dist/src/index.d.ts} +2 -3
- package/dist/src/stories/AutoForm.stories.d.ts +9 -0
- package/dist/src/stories/Fields.stories.d.ts +12 -0
- package/dist/src/theme.d.ts +141 -0
- package/dist/src/types/custom-render.d.ts +11 -0
- package/dist/src/types/field.d.ts +30 -0
- package/dist/src/types/form.d.ts +7 -0
- package/{test-utils/index.ts → dist/test-utils/index.d.ts} +1 -2
- package/dist/test-utils/render.d.ts +1 -0
- package/package.json +9 -3
- package/.github/workflows/npm_test.yml +0 -27
- package/.nvmrc +0 -1
- package/.prettierrc.mjs +0 -35
- package/.storybook/main.ts +0 -17
- package/.storybook/preview.tsx +0 -18
- package/.storybook/vitest.setup.ts +0 -9
- package/.stylelintignore +0 -1
- package/.stylelintrc.json +0 -28
- package/.yarn/releases/yarn-4.9.1.cjs +0 -948
- package/.yarnrc.yml +0 -3
- package/eslint.config.js +0 -11
- package/index.html +0 -16
- package/postcss.config.cjs +0 -14
- package/src/favicon.svg +0 -1
- package/src/stories/AutoForm.stories.tsx +0 -473
- package/src/stories/Fields.stories.tsx +0 -190
- package/src/theme.ts +0 -5
- package/src/vite-env.d.ts +0 -1
- package/storybook-static/assets/AutoForm-CEr4m2za.js +0 -53
- package/storybook-static/assets/AutoForm.stories-CtOmRKOV.js +0 -164
- package/storybook-static/assets/Color-YHDXOIA2-pc5-Ao7n.js +0 -1
- package/storybook-static/assets/DocsRenderer-CFRXHY34-D-_1VvMG.js +0 -575
- package/storybook-static/assets/Fields.stories-CoRkpMbJ.js +0 -29
- package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +0 -1
- package/storybook-static/assets/entry-preview-CkHoqRUh.js +0 -2
- package/storybook-static/assets/entry-preview-docs-hFR7sEJd.js +0 -46
- package/storybook-static/assets/get-contrast-color-Db6nT3bs.js +0 -1
- package/storybook-static/assets/iframe-CzpwBD2i.js +0 -211
- package/storybook-static/assets/index-B8rYRX2K.js +0 -1
- package/storybook-static/assets/index-BQQLSK9g.js +0 -1
- package/storybook-static/assets/index-CXQShRbs.js +0 -8
- package/storybook-static/assets/index-D4lIrffr.js +0 -9
- package/storybook-static/assets/index-Domkg0jQ.js +0 -240
- package/storybook-static/assets/index-DrFu-skq.js +0 -6
- package/storybook-static/assets/index-DsJinFGm.js +0 -9
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +0 -9
- package/storybook-static/assets/preview-B8lJiyuQ.js +0 -34
- package/storybook-static/assets/preview-BBWR9nbA.js +0 -1
- package/storybook-static/assets/preview-BOfrPh1e.js +0 -2
- package/storybook-static/assets/preview-BWzBA1C2.js +0 -396
- package/storybook-static/assets/preview-C2Qr78FS.js +0 -4
- package/storybook-static/assets/preview-CvbIS5ZJ.js +0 -1
- package/storybook-static/assets/preview-DD_OYowb.js +0 -1
- package/storybook-static/assets/preview-DGUiP6tS.js +0 -7
- package/storybook-static/assets/preview-DioFdWiE.css +0 -1
- package/storybook-static/assets/preview-Dyg8NwXV.js +0 -1
- package/storybook-static/assets/react-18-Dhjvimrl.js +0 -25
- package/storybook-static/assets/test-utils--_O2wM1y.js +0 -9
- package/storybook-static/favicon.svg +0 -1
- package/storybook-static/iframe.html +0 -666
- package/storybook-static/index.html +0 -181
- package/storybook-static/index.json +0 -1
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +0 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +0 -331
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +0 -51
- package/storybook-static/sb-addons/docs-11/manager-bundle.js +0 -242
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -12
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +0 -402
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/onboarding-8/manager-bundle.js +0 -127
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/storybook-static/sb-addons/storybook-experimental-addon-test-10/manager-bundle.js +0 -223
- package/storybook-static/sb-common-assets/favicon.svg +0 -1
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +0 -1051
- package/storybook-static/sb-manager/globals-runtime.js +0 -41591
- package/storybook-static/sb-manager/globals.js +0 -48
- package/storybook-static/sb-manager/runtime.js +0 -12048
- package/test-utils/render.tsx +0 -11
- package/text +0 -64
- package/tsconfig.json +0 -25
- package/vite.config.mjs +0 -19
- package/vitest.setup.mjs +0 -29
- package/vitest.shims.d.ts +0 -1
- package/vitest.workspace.js +0 -30
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormValidateInput } from '@mantine/form';
|
|
3
|
+
import { FieldRenderCustomRender } from '../types/custom-render';
|
|
4
|
+
import { FieldSchema } from '../types/field';
|
|
5
|
+
export interface AutoFormProps {
|
|
6
|
+
values?: Record<string, any>;
|
|
7
|
+
schema: FieldSchema[];
|
|
8
|
+
onSubmit: (values: Record<string, any>) => void;
|
|
9
|
+
container: (Form: React.ReactNode, onSubmit: VoidFunction, readOnly?: true) => React.ReactNode;
|
|
10
|
+
fieldContainer?: (field: React.ReactNode, fieldSchema: FieldSchema) => React.ReactNode;
|
|
11
|
+
customRender?: FieldRenderCustomRender;
|
|
12
|
+
validate?: FormValidateInput<Record<string, any>>;
|
|
13
|
+
readOnly?: true;
|
|
14
|
+
onFieldChange?: (name: string, value: any, values: Record<string, any>) => Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
export declare const validateRequiredFields: (schema: FieldSchema[], values: Record<string, any>, parentPath?: string) => Record<string, string>;
|
|
17
|
+
declare const AutoForm: React.FC<AutoFormProps>;
|
|
18
|
+
export default AutoForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FieldRenderCustomRender } from '../types/custom-render';
|
|
3
|
+
import { ArrayFieldOptions, FieldSchema } from '../types/field';
|
|
4
|
+
interface FieldRenderProps {
|
|
5
|
+
field: FieldSchema;
|
|
6
|
+
value: any;
|
|
7
|
+
error?: React.ReactNode | Record<string, React.ReactNode>;
|
|
8
|
+
onChange: (name: string, value: any) => void;
|
|
9
|
+
formValues: Record<string, any>;
|
|
10
|
+
fieldContainer?: (field: React.ReactNode, fieldSchema: FieldSchema) => React.ReactNode;
|
|
11
|
+
customRender?: FieldRenderCustomRender;
|
|
12
|
+
readOnly?: true;
|
|
13
|
+
}
|
|
14
|
+
export declare function getArrayOptions(name: string, onChange: (name: string, value: any) => void, value: Record<string, any>[]): ArrayFieldOptions;
|
|
15
|
+
declare const FieldRender: React.FC<FieldRenderProps>;
|
|
16
|
+
export default FieldRender;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseFieldProps, FieldSchema } from '../../types/field';
|
|
3
|
+
interface ArrayFieldProps extends BaseFieldProps<Record<string, any>[]> {
|
|
4
|
+
fields: FieldSchema[];
|
|
5
|
+
options: {
|
|
6
|
+
addElement: (val: Record<string, any>) => void;
|
|
7
|
+
replaceElement: (index: number, val: Record<string, any>) => void;
|
|
8
|
+
removeElement: (index: number) => void;
|
|
9
|
+
};
|
|
10
|
+
error?: Record<string, React.ReactNode>;
|
|
11
|
+
}
|
|
12
|
+
declare const ArrayField: React.FC<ArrayFieldProps>;
|
|
13
|
+
export default ArrayField;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseFieldProps, FieldSchema } from '../../types/field';
|
|
3
|
+
interface ObjectFieldProps extends BaseFieldProps<Record<string, any>> {
|
|
4
|
+
fields: FieldSchema[];
|
|
5
|
+
formValues: Record<string, any>;
|
|
6
|
+
error?: Record<string, React.ReactNode>;
|
|
7
|
+
}
|
|
8
|
+
declare const ObjectField: React.FC<ObjectFieldProps>;
|
|
9
|
+
export default ObjectField;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseFieldProps } from '../../types/field';
|
|
3
|
+
interface SelectFieldProps extends BaseFieldProps<string> {
|
|
4
|
+
data: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
declare const SelectField: React.FC<SelectFieldProps>;
|
|
10
|
+
export default SelectField;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export type { AutoFormProps } from './components/AutoForm';
|
|
1
|
+
export { default as AutoForm } from './components/AutoForm';
|
|
2
|
+
export type { AutoFormProps } from './components/AutoForm';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as AutoForm } from '../components/AutoForm';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<typeof AutoForm>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AutoForm>;
|
|
6
|
+
export declare const Standard: Story;
|
|
7
|
+
export declare const ReadOnly: Story;
|
|
8
|
+
export declare const FormValidation: Story;
|
|
9
|
+
export declare const CustomizedForm: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as AutoForm } from '../components/AutoForm';
|
|
3
|
+
declare const meta: Meta<typeof AutoForm>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AutoForm>;
|
|
6
|
+
export declare const TextField: Story;
|
|
7
|
+
export declare const NumberField: Story;
|
|
8
|
+
export declare const SelectField: Story;
|
|
9
|
+
export declare const CheckField: Story;
|
|
10
|
+
export declare const DateField: Story;
|
|
11
|
+
export declare const ArrayField: Story;
|
|
12
|
+
export declare const ObjectField: Story;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export declare const theme: {
|
|
2
|
+
focusRing?: "auto" | "always" | "never" | undefined;
|
|
3
|
+
scale?: number | undefined;
|
|
4
|
+
fontSmoothing?: boolean | undefined;
|
|
5
|
+
white?: string | undefined;
|
|
6
|
+
black?: string | undefined;
|
|
7
|
+
colors?: {
|
|
8
|
+
[x: string & {}]: import('@mantine/core').MantineColorsTuple | undefined;
|
|
9
|
+
red?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
10
|
+
dark?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
11
|
+
gray?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
12
|
+
pink?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
13
|
+
grape?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
14
|
+
violet?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
15
|
+
indigo?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
16
|
+
blue?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
17
|
+
cyan?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
18
|
+
green?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
19
|
+
lime?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
20
|
+
yellow?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
21
|
+
orange?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
22
|
+
teal?: import('@mantine/core').MantineColorsTuple | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
primaryShade?: import('@mantine/core').MantineColorShade | {
|
|
25
|
+
light?: import('@mantine/core').MantineColorShade | undefined;
|
|
26
|
+
dark?: import('@mantine/core').MantineColorShade | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
primaryColor?: string | undefined;
|
|
29
|
+
variantColorResolver?: import('@mantine/core').VariantColorsResolver | undefined;
|
|
30
|
+
autoContrast?: boolean | undefined;
|
|
31
|
+
luminanceThreshold?: number | undefined;
|
|
32
|
+
fontFamily?: string | undefined;
|
|
33
|
+
fontFamilyMonospace?: string | undefined;
|
|
34
|
+
headings?: {
|
|
35
|
+
fontFamily?: string | undefined;
|
|
36
|
+
fontWeight?: string | undefined;
|
|
37
|
+
textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
|
|
38
|
+
sizes?: {
|
|
39
|
+
h1?: {
|
|
40
|
+
fontSize?: string | undefined;
|
|
41
|
+
fontWeight?: string | undefined;
|
|
42
|
+
lineHeight?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
h2?: {
|
|
45
|
+
fontSize?: string | undefined;
|
|
46
|
+
fontWeight?: string | undefined;
|
|
47
|
+
lineHeight?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
h3?: {
|
|
50
|
+
fontSize?: string | undefined;
|
|
51
|
+
fontWeight?: string | undefined;
|
|
52
|
+
lineHeight?: string | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
h4?: {
|
|
55
|
+
fontSize?: string | undefined;
|
|
56
|
+
fontWeight?: string | undefined;
|
|
57
|
+
lineHeight?: string | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
h5?: {
|
|
60
|
+
fontSize?: string | undefined;
|
|
61
|
+
fontWeight?: string | undefined;
|
|
62
|
+
lineHeight?: string | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
h6?: {
|
|
65
|
+
fontSize?: string | undefined;
|
|
66
|
+
fontWeight?: string | undefined;
|
|
67
|
+
lineHeight?: string | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
radius?: {
|
|
72
|
+
[x: string & {}]: string | undefined;
|
|
73
|
+
xs?: string | undefined;
|
|
74
|
+
sm?: string | undefined;
|
|
75
|
+
md?: string | undefined;
|
|
76
|
+
lg?: string | undefined;
|
|
77
|
+
xl?: string | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
defaultRadius?: import('@mantine/core').MantineRadius | undefined;
|
|
80
|
+
spacing?: {
|
|
81
|
+
[x: number]: string | undefined;
|
|
82
|
+
[x: string & {}]: string | undefined;
|
|
83
|
+
xs?: string | undefined;
|
|
84
|
+
sm?: string | undefined;
|
|
85
|
+
md?: string | undefined;
|
|
86
|
+
lg?: string | undefined;
|
|
87
|
+
xl?: string | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
fontSizes?: {
|
|
90
|
+
[x: string & {}]: string | undefined;
|
|
91
|
+
xs?: string | undefined;
|
|
92
|
+
sm?: string | undefined;
|
|
93
|
+
md?: string | undefined;
|
|
94
|
+
lg?: string | undefined;
|
|
95
|
+
xl?: string | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
lineHeights?: {
|
|
98
|
+
[x: string & {}]: string | undefined;
|
|
99
|
+
xs?: string | undefined;
|
|
100
|
+
sm?: string | undefined;
|
|
101
|
+
md?: string | undefined;
|
|
102
|
+
lg?: string | undefined;
|
|
103
|
+
xl?: string | undefined;
|
|
104
|
+
} | undefined;
|
|
105
|
+
breakpoints?: {
|
|
106
|
+
[x: string & {}]: string | undefined;
|
|
107
|
+
xs?: string | undefined;
|
|
108
|
+
sm?: string | undefined;
|
|
109
|
+
md?: string | undefined;
|
|
110
|
+
lg?: string | undefined;
|
|
111
|
+
xl?: string | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
shadows?: {
|
|
114
|
+
[x: string & {}]: string | undefined;
|
|
115
|
+
xs?: string | undefined;
|
|
116
|
+
sm?: string | undefined;
|
|
117
|
+
md?: string | undefined;
|
|
118
|
+
lg?: string | undefined;
|
|
119
|
+
xl?: string | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
respectReducedMotion?: boolean | undefined;
|
|
122
|
+
cursorType?: "default" | "pointer" | undefined;
|
|
123
|
+
defaultGradient?: {
|
|
124
|
+
from?: string | undefined;
|
|
125
|
+
to?: string | undefined;
|
|
126
|
+
deg?: number | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
activeClassName?: string | undefined;
|
|
129
|
+
focusClassName?: string | undefined;
|
|
130
|
+
components?: {
|
|
131
|
+
[x: string]: {
|
|
132
|
+
classNames?: any;
|
|
133
|
+
styles?: any;
|
|
134
|
+
vars?: any;
|
|
135
|
+
defaultProps?: any;
|
|
136
|
+
} | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
other?: {
|
|
139
|
+
[x: string]: any;
|
|
140
|
+
} | undefined;
|
|
141
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArrayFieldOptions, FieldSchema } from './field';
|
|
2
|
+
export type FieldRenderCustomRender = (field: FieldSchema, value: any, error: React.ReactNode | Record<string, React.ReactNode>, onChange: (name: string, value: any) => void, formValues: Record<string, any>, options?: ArrayFieldOptions, readOnly?: true) => React.ReactNode;
|
|
3
|
+
export interface CustomFieldRender {
|
|
4
|
+
field: FieldSchema;
|
|
5
|
+
value: any;
|
|
6
|
+
error: React.ReactNode | Record<string, React.ReactNode>;
|
|
7
|
+
onChange: (name: string, value: any) => void;
|
|
8
|
+
formValues: Record<string, any>;
|
|
9
|
+
options?: ArrayFieldOptions;
|
|
10
|
+
readOnly?: true;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type FieldType = 'text' | 'number' | 'object' | 'array' | 'check' | 'select' | 'textarea' | 'date' | 'datetime' | 'time';
|
|
2
|
+
export interface FieldSchema {
|
|
3
|
+
name: string;
|
|
4
|
+
type: FieldType;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
extra?: Record<string, any>;
|
|
9
|
+
disabled?: (values: Record<string, any>) => boolean | boolean;
|
|
10
|
+
visible?: (values: Record<string, any>) => boolean | boolean;
|
|
11
|
+
initialValue?: any;
|
|
12
|
+
required?: true;
|
|
13
|
+
readOnly?: true;
|
|
14
|
+
fields?: FieldSchema[];
|
|
15
|
+
data?: {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
export interface BaseFieldProps<T> {
|
|
21
|
+
name: string;
|
|
22
|
+
value: T;
|
|
23
|
+
onChange: (name: string, value: T | null) => void;
|
|
24
|
+
readOnly?: true;
|
|
25
|
+
}
|
|
26
|
+
export type ArrayFieldOptions = {
|
|
27
|
+
addElement: (value: Record<string, any>) => void;
|
|
28
|
+
replaceElement: (index: number, val: Record<string, any>) => void;
|
|
29
|
+
removeElement: (index: number) => void;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function render(ui: React.ReactNode): import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoforma",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"homepage": "http://sajinael98.github.io/AutoForma",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -83,5 +83,11 @@
|
|
|
83
83
|
"extends": [
|
|
84
84
|
"plugin:storybook/recommended"
|
|
85
85
|
]
|
|
86
|
-
}
|
|
87
|
-
|
|
86
|
+
},
|
|
87
|
+
"files": [
|
|
88
|
+
"dist",
|
|
89
|
+
"src/components",
|
|
90
|
+
"src/types",
|
|
91
|
+
"README.md"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: npm test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- '**'
|
|
7
|
-
|
|
8
|
-
concurrency:
|
|
9
|
-
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
|
10
|
-
cancel-in-progress: true
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
test_pull_request:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v3
|
|
17
|
-
- uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version-file: '.nvmrc'
|
|
20
|
-
cache: 'yarn'
|
|
21
|
-
cache-dependency-path: '**/yarn.lock'
|
|
22
|
-
- name: Install dependencies
|
|
23
|
-
run: yarn
|
|
24
|
-
- name: Run build
|
|
25
|
-
run: npm run build
|
|
26
|
-
- name: Run tests
|
|
27
|
-
run: npm test
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v22.11.0
|
package/.prettierrc.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */
|
|
2
|
-
const config = {
|
|
3
|
-
printWidth: 100,
|
|
4
|
-
singleQuote: true,
|
|
5
|
-
trailingComma: 'es5',
|
|
6
|
-
plugins: ['@ianvs/prettier-plugin-sort-imports'],
|
|
7
|
-
importOrder: [
|
|
8
|
-
'.*styles.css$',
|
|
9
|
-
'',
|
|
10
|
-
'dayjs',
|
|
11
|
-
'^react$',
|
|
12
|
-
'^next$',
|
|
13
|
-
'^next/.*$',
|
|
14
|
-
'<BUILTIN_MODULES>',
|
|
15
|
-
'<THIRD_PARTY_MODULES>',
|
|
16
|
-
'^@mantine/(.*)$',
|
|
17
|
-
'^@mantinex/(.*)$',
|
|
18
|
-
'^@mantine-tests/(.*)$',
|
|
19
|
-
'^@docs/(.*)$',
|
|
20
|
-
'^@/.*$',
|
|
21
|
-
'^../(?!.*.css$).*$',
|
|
22
|
-
'^./(?!.*.css$).*$',
|
|
23
|
-
'\\.css$',
|
|
24
|
-
],
|
|
25
|
-
overrides: [
|
|
26
|
-
{
|
|
27
|
-
files: '*.mdx',
|
|
28
|
-
options: {
|
|
29
|
-
printWidth: 70,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default config;
|
package/.storybook/main.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from '@storybook/react-vite';
|
|
2
|
-
|
|
3
|
-
const config: StorybookConfig = {
|
|
4
|
-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
5
|
-
addons: [
|
|
6
|
-
'@storybook/addon-essentials',
|
|
7
|
-
'@storybook/addon-onboarding',
|
|
8
|
-
'@chromatic-com/storybook',
|
|
9
|
-
'@storybook/experimental-addon-test',
|
|
10
|
-
'@storybook/addon-docs',
|
|
11
|
-
],
|
|
12
|
-
framework: {
|
|
13
|
-
name: '@storybook/react-vite',
|
|
14
|
-
options: {},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export default config;
|
package/.storybook/preview.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Preview } from '@storybook/react';
|
|
3
|
-
import { MantineProvider } from '@mantine/core';
|
|
4
|
-
|
|
5
|
-
import '@mantine/core/styles.css';
|
|
6
|
-
import '@mantine/dates/styles.css';
|
|
7
|
-
|
|
8
|
-
const preview: Preview = {
|
|
9
|
-
decorators: [
|
|
10
|
-
(Story) => (
|
|
11
|
-
<MantineProvider>
|
|
12
|
-
<Story />
|
|
13
|
-
</MantineProvider>
|
|
14
|
-
),
|
|
15
|
-
],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default preview;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { beforeAll } from 'vitest';
|
|
2
|
-
import { setProjectAnnotations } from '@storybook/react';
|
|
3
|
-
import * as projectAnnotations from './preview';
|
|
4
|
-
|
|
5
|
-
// This is an important step to apply the right configuration when testing your stories.
|
|
6
|
-
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
|
|
7
|
-
const project = setProjectAnnotations([projectAnnotations]);
|
|
8
|
-
|
|
9
|
-
beforeAll(project.beforeAll);
|
package/.stylelintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dist
|
package/.stylelintrc.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["stylelint-config-standard-scss"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"custom-property-pattern": null,
|
|
5
|
-
"selector-class-pattern": null,
|
|
6
|
-
"scss/no-duplicate-mixins": null,
|
|
7
|
-
"declaration-empty-line-before": null,
|
|
8
|
-
"declaration-block-no-redundant-longhand-properties": null,
|
|
9
|
-
"alpha-value-notation": null,
|
|
10
|
-
"custom-property-empty-line-before": null,
|
|
11
|
-
"property-no-vendor-prefix": null,
|
|
12
|
-
"color-function-notation": null,
|
|
13
|
-
"length-zero-no-unit": null,
|
|
14
|
-
"selector-not-notation": null,
|
|
15
|
-
"no-descending-specificity": null,
|
|
16
|
-
"comment-empty-line-before": null,
|
|
17
|
-
"scss/at-mixin-pattern": null,
|
|
18
|
-
"scss/at-rule-no-unknown": null,
|
|
19
|
-
"value-keyword-case": null,
|
|
20
|
-
"media-feature-range-notation": null,
|
|
21
|
-
"selector-pseudo-class-no-unknown": [
|
|
22
|
-
true,
|
|
23
|
-
{
|
|
24
|
-
"ignorePseudoClasses": ["global"]
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|