autoforma 1.0.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/.github/workflows/npm_test.yml +27 -0
- package/.nvmrc +1 -0
- package/.prettierrc.mjs +35 -0
- package/.storybook/main.ts +17 -0
- package/.storybook/preview.tsx +18 -0
- package/.storybook/vitest.setup.ts +9 -0
- package/.stylelintignore +1 -0
- package/.stylelintrc.json +28 -0
- package/.yarn/releases/yarn-4.9.1.cjs +948 -0
- package/.yarnrc.yml +3 -0
- package/README.md +157 -0
- package/eslint.config.js +11 -0
- package/index.html +16 -0
- package/package.json +87 -0
- package/postcss.config.cjs +14 -0
- package/src/components/AutoForm.tsx +201 -0
- package/src/components/FieldRender.tsx +217 -0
- package/src/components/fields/ArrayField.tsx +59 -0
- package/src/components/fields/CheckField.tsx +23 -0
- package/src/components/fields/DateField.tsx +26 -0
- package/src/components/fields/DateTimeField.tsx +26 -0
- package/src/components/fields/NumberField.tsx +20 -0
- package/src/components/fields/ObjectField.tsx +41 -0
- package/src/components/fields/SelectField.tsx +23 -0
- package/src/components/fields/TextAreaField.tsx +25 -0
- package/src/components/fields/TextField.tsx +20 -0
- package/src/components/fields/TimeField.tsx +32 -0
- package/src/favicon.svg +1 -0
- package/src/index.ts +3 -0
- package/src/stories/AutoForm.stories.tsx +473 -0
- package/src/stories/Fields.stories.tsx +190 -0
- package/src/theme.ts +5 -0
- package/src/types/custom-render.ts +22 -0
- package/src/types/field.ts +32 -0
- package/src/types/form.ts +8 -0
- package/src/vite-env.d.ts +1 -0
- package/storybook-static/assets/AutoForm-CEr4m2za.js +53 -0
- package/storybook-static/assets/AutoForm.stories-CtOmRKOV.js +164 -0
- package/storybook-static/assets/Color-YHDXOIA2-pc5-Ao7n.js +1 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-D-_1VvMG.js +575 -0
- package/storybook-static/assets/Fields.stories-CoRkpMbJ.js +29 -0
- package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
- package/storybook-static/assets/entry-preview-CkHoqRUh.js +2 -0
- package/storybook-static/assets/entry-preview-docs-hFR7sEJd.js +46 -0
- package/storybook-static/assets/get-contrast-color-Db6nT3bs.js +1 -0
- package/storybook-static/assets/iframe-CzpwBD2i.js +211 -0
- package/storybook-static/assets/index-B8rYRX2K.js +1 -0
- package/storybook-static/assets/index-BQQLSK9g.js +1 -0
- package/storybook-static/assets/index-CXQShRbs.js +8 -0
- package/storybook-static/assets/index-D4lIrffr.js +9 -0
- package/storybook-static/assets/index-Domkg0jQ.js +240 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/index-DsJinFGm.js +9 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
- package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
- package/storybook-static/assets/preview-BOfrPh1e.js +2 -0
- package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
- package/storybook-static/assets/preview-C2Qr78FS.js +4 -0
- package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
- package/storybook-static/assets/preview-DD_OYowb.js +1 -0
- package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
- package/storybook-static/assets/preview-DioFdWiE.css +1 -0
- package/storybook-static/assets/preview-Dyg8NwXV.js +1 -0
- package/storybook-static/assets/react-18-Dhjvimrl.js +25 -0
- package/storybook-static/assets/test-utils--_O2wM1y.js +9 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +666 -0
- package/storybook-static/index.html +181 -0
- package/storybook-static/index.json +1 -0
- 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 +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +331 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +51 -0
- package/storybook-static/sb-addons/docs-11/manager-bundle.js +242 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +402 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/onboarding-8/manager-bundle.js +127 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-experimental-addon-test-10/manager-bundle.js +223 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- 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 +1051 -0
- package/storybook-static/sb-manager/globals-runtime.js +41591 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/test-utils/index.ts +5 -0
- package/test-utils/render.tsx +11 -0
- package/text +64 -0
- package/tsconfig.json +25 -0
- package/vite.config.mjs +19 -0
- package/vitest.setup.mjs +29 -0
- package/vitest.shims.d.ts +1 -0
- package/vitest.workspace.js +30 -0
|
@@ -0,0 +1,27 @@
|
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v22.11.0
|
package/.prettierrc.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|