@opengov/form-renderer 0.0.1-beta5 → 0.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/lib.js +1862 -8465
- package/dist/lib.umd.cjs +40 -77
- package/dist/src/index.d.ts +1 -0
- package/dist/stories/FormRenderer.stories.d.ts +12 -5
- package/package.json +8 -27
- package/dist/FormProvider.d.ts +0 -19
- package/dist/LayoutContext.d.ts +0 -14
- package/dist/fields/Checkbox.d.ts +0 -3
- package/dist/fields/DateInput.d.ts +0 -3
- package/dist/fields/FormFieldLabel.d.ts +0 -8
- package/dist/fields/NumberInput.d.ts +0 -3
- package/dist/fields/Select.d.ts +0 -7
- package/dist/fields/TextInput.d.ts +0 -4
- package/dist/fields/types.d.ts +0 -8
- package/dist/index.d.ts +0 -9
- package/dist/stories/Compound.d.ts +0 -0
- package/dist/stories/WithDefaultValues.d.ts +0 -0
- /package/dist/{index.test.d.ts → src/index.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function FormRenderer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as FormRenderer } from '../src';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof FormRenderer;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
3
12
|
export default meta;
|
|
4
13
|
type Story = StoryObj<typeof meta>;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const WithDefaultValues: Story;
|
|
7
|
-
export declare const UsingReactHookForms: Story;
|
|
14
|
+
export declare const Basic: Story;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengov/form-renderer",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "OpenGov Smart Forms form renderer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
|
-
"main": "./dist/lib.umd.
|
|
10
|
-
"module": "./dist/lib.
|
|
9
|
+
"main": "./dist/lib.umd.js",
|
|
10
|
+
"module": "./dist/lib.mjs",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"import": "./dist/lib.
|
|
13
|
+
"import": "./dist/lib.mjs",
|
|
14
14
|
"require": "./dist/lib.umd.cjs"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"types": "dist/
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"test": "jest",
|
|
20
20
|
"lint": "eslint .",
|
|
@@ -22,28 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"author": "OpenGov",
|
|
24
24
|
"license": "UNLICENSED",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
|
|
27
|
-
"@mdi/react": "^1.6.1",
|
|
28
|
-
"@mui/icons-material": "^6.1.1",
|
|
29
|
-
"date-fns": "^4.1.0"
|
|
30
|
-
},
|
|
25
|
+
"dependencies": {},
|
|
26
|
+
"devDependencies": {},
|
|
31
27
|
"peerDependencies": {
|
|
32
|
-
"
|
|
33
|
-
"@mui/x-date-pickers": ">= 7.0.0",
|
|
34
|
-
"@opengov/capital-mui-theme": ">= 32.0.0",
|
|
35
|
-
"react": ">= 16.8.0",
|
|
36
|
-
"react-dom": ">= 16.8.0",
|
|
37
|
-
"react-hook-form": ">= 7.0.0"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@emotion/react": "^11.13.3",
|
|
41
|
-
"@emotion/styled": "^11.13.0",
|
|
42
|
-
"@mui/material": "^6.1.1",
|
|
43
|
-
"@mui/x-date-pickers": "^7.22.0",
|
|
44
|
-
"@opengov/capital-mui-theme": "^36.0.0-beta.1",
|
|
45
|
-
"react": "^18.3.1",
|
|
46
|
-
"react-dom": "^18.3.1",
|
|
47
|
-
"react-hook-form": "^7.53.1"
|
|
28
|
+
"react": "^18.3.1"
|
|
48
29
|
}
|
|
49
30
|
}
|
package/dist/FormProvider.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { LayoutState } from './LayoutContext';
|
|
3
|
-
import { SxProps } from '@mui/material';
|
|
4
|
-
interface FormShellProps {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
onSubmit: (data: any) => void;
|
|
7
|
-
layout?: LayoutState;
|
|
8
|
-
sx?: SxProps;
|
|
9
|
-
}
|
|
10
|
-
export declare function FormShell({ children, onSubmit, layout, sx }: FormShellProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
interface FormProviderProps {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
onSubmit?: (data: any) => void;
|
|
14
|
-
layout?: LayoutState;
|
|
15
|
-
formOptions?: any;
|
|
16
|
-
sx?: SxProps;
|
|
17
|
-
}
|
|
18
|
-
declare function FormProvider({ children, onSubmit, layout, formOptions, sx }: FormProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export default FormProvider;
|
package/dist/LayoutContext.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
export interface LayoutState {
|
|
3
|
-
}
|
|
4
|
-
interface FormLayoutContextProps {
|
|
5
|
-
layout: LayoutState;
|
|
6
|
-
}
|
|
7
|
-
declare const FormLayoutContext: React.Context<FormLayoutContextProps | undefined>;
|
|
8
|
-
interface FormLayoutProviderProps {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
layout?: LayoutState;
|
|
11
|
-
}
|
|
12
|
-
export declare const FormLayoutProvider: React.FC<FormLayoutProviderProps>;
|
|
13
|
-
export declare const useFormLayout: () => LayoutState;
|
|
14
|
-
export default FormLayoutContext;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface FormFieldLabelProps {
|
|
2
|
-
children: React.ReactNode;
|
|
3
|
-
internal: boolean;
|
|
4
|
-
required: boolean;
|
|
5
|
-
helpText?: string;
|
|
6
|
-
}
|
|
7
|
-
export default function FormFieldLabel({ children, internal, required, helpText }: FormFieldLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
package/dist/fields/Select.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GeneralInputProps } from './types';
|
|
2
|
-
export default function SelectInput({ name, label, options, sx, disabled, rules, ...rest }: GeneralInputProps & {
|
|
3
|
-
options: Array<{
|
|
4
|
-
displayValue: string;
|
|
5
|
-
key: string;
|
|
6
|
-
}>;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/fields/types.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as Checkbox } from './fields/Checkbox';
|
|
2
|
-
import { default as DateInput } from './fields/DateInput';
|
|
3
|
-
import { default as TextInput } from './fields/TextInput';
|
|
4
|
-
import { default as NumberInput } from './fields/NumberInput';
|
|
5
|
-
import { default as Select } from './fields/Select';
|
|
6
|
-
import { default as FormFieldLabel } from './fields/FormFieldLabel';
|
|
7
|
-
import { default as FormProvider } from './FormProvider';
|
|
8
|
-
export { FormProvider, FormFieldLabel, Checkbox, DateInput, TextInput, NumberInput, Select };
|
|
9
|
-
export default function FormRenderer(): import("react/jsx-runtime").JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|