@fairys/pc-valtio-form-basic 0.0.12

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/README.md ADDED
File without changes
package/esm/form.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { FairysPCValtioFormItem, FairysPCValtioFormHideItem, FairysPCValtioFormItemBase } from './form.item';
2
+ import { useFairysValtioFormInstance, useFairysValtioFormInstanceContext, useFairysValtioFormInstanceContextState, useFairysValtioFormInstanceContextHideState } from '@fairys/valtio-form-basic';
3
+ import type { FairysValtioFormAttrsProps, MObject } from '@fairys/valtio-form-basic';
4
+ export * from '@fairys/valtio-form-basic';
5
+ export * from './form.item';
6
+ export * from './layout';
7
+ export interface FairysPCValtioFormProps<T extends MObject<T> = object> extends FairysValtioFormAttrsProps<T> {
8
+ }
9
+ export declare function FairysPCValtioForm<T extends MObject<T> = object>(props: FairysPCValtioFormProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export declare namespace FairysPCValtioForm {
11
+ var useForm: typeof useFairysValtioFormInstance;
12
+ var useFormState: typeof useFairysValtioFormInstanceContextState;
13
+ var useFormHideState: typeof useFairysValtioFormInstanceContextHideState;
14
+ var useFormInstance: typeof useFairysValtioFormInstanceContext;
15
+ var FormItemBase: typeof FairysPCValtioFormItemBase;
16
+ var FormItem: typeof FairysPCValtioFormItem;
17
+ var FormHideItem: typeof FairysPCValtioFormHideItem;
18
+ }
@@ -0,0 +1,16 @@
1
+ /**表单项*/
2
+ import type { FairysValtioFormItemAttrsProps, MObject } from '@fairys/valtio-form-basic';
3
+ export interface FairysPCValtioFormItemProps<T extends MObject<T> = object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FairysValtioFormItemAttrsProps {
4
+ /**是否使用控制隐藏的表单项*/
5
+ isHide?: boolean;
6
+ /**是否使用无样式表单项*/
7
+ noStyle?: boolean;
8
+ }
9
+ /**普通表单项*/
10
+ export declare function FairysPCValtioFormItemBase<T extends MObject<T> = object>(props: Omit<FairysPCValtioFormItemProps<T>, 'isHide' | 'noStyle'>): import("react/jsx-runtime").JSX.Element;
11
+ /**控制隐藏的表单项*/
12
+ export declare function FairysPCValtioFormHideItem<T extends MObject<T> = object>(props: Omit<FairysPCValtioFormItemProps<T>, 'isHide' | 'noStyle'>): import("react/jsx-runtime").JSX.Element;
13
+ /**无样式表单项*/
14
+ export declare function FairysPCValtioFormItemNoStyle<T extends MObject<T> = object>(props: Omit<FairysPCValtioFormItemProps<T>, 'isHide' | 'noStyle'>): import("react/jsx-runtime").JSX.Element;
15
+ /**表单项基础组件(根据isHide和noStyle判断是否使用控制隐藏的表单项和无样式表单项)*/
16
+ export declare function FairysPCValtioFormItem<T extends MObject<T> = object>(props: FairysPCValtioFormItemProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,77 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { FairysValtioFormParentAttrsContext, useFairysValtioFormInstanceContextHideState, useFairysValtioFormItemAttrs, useFairysValtioFormItemNoStyleAttrs } from "@fairys/valtio-form-basic";
4
+ function FairysPCValtioFormItemBase(props) {
5
+ const { label, extra, helpText } = props;
6
+ const { itemClassName, itemStyle, containerClassName, itemLabelClassName, itemLabelStyle, itemBodyClassName, itemBodyStyle, itemInputClassName, itemExtraClassName, errorClassName, helpClassName, isInvalid, children, error, formAttrsNameInstance, id } = useFairysValtioFormItemAttrs(props);
7
+ return /*#__PURE__*/ jsxs("div", {
8
+ className: itemClassName,
9
+ style: itemStyle,
10
+ children: [
11
+ /*#__PURE__*/ jsxs("div", {
12
+ className: containerClassName,
13
+ children: [
14
+ label ? /*#__PURE__*/ jsx("label", {
15
+ htmlFor: id,
16
+ className: itemLabelClassName,
17
+ style: itemLabelStyle,
18
+ children: label
19
+ }) : /*#__PURE__*/ jsx(Fragment, {}),
20
+ /*#__PURE__*/ jsxs("div", {
21
+ className: itemBodyClassName,
22
+ style: itemBodyStyle,
23
+ children: [
24
+ /*#__PURE__*/ jsx(FairysValtioFormParentAttrsContext.Provider, {
25
+ value: formAttrsNameInstance,
26
+ children: /*#__PURE__*/ jsx("div", {
27
+ className: itemInputClassName,
28
+ children: children
29
+ })
30
+ }),
31
+ extra ? /*#__PURE__*/ jsx("div", {
32
+ className: itemExtraClassName,
33
+ children: extra
34
+ }) : /*#__PURE__*/ jsx(Fragment, {})
35
+ ]
36
+ })
37
+ ]
38
+ }),
39
+ helpText ? /*#__PURE__*/ jsx("div", {
40
+ className: helpClassName,
41
+ children: helpText
42
+ }) : /*#__PURE__*/ jsx(Fragment, {}),
43
+ isInvalid ? /*#__PURE__*/ jsx("div", {
44
+ className: errorClassName,
45
+ children: error
46
+ }) : /*#__PURE__*/ jsx(Fragment, {})
47
+ ]
48
+ });
49
+ }
50
+ function FairysPCValtioFormHideItem(props) {
51
+ const [state] = useFairysValtioFormInstanceContextHideState();
52
+ const isHide = state[props.name];
53
+ if (isHide) return /*#__PURE__*/ jsx(Fragment, {});
54
+ return /*#__PURE__*/ jsx(FairysPCValtioFormItemBase, {
55
+ ...props
56
+ });
57
+ }
58
+ function FairysPCValtioFormItemNoStyle(props) {
59
+ const { children, formAttrsNameInstance } = useFairysValtioFormItemNoStyleAttrs(props);
60
+ return /*#__PURE__*/ jsx(FairysValtioFormParentAttrsContext.Provider, {
61
+ value: formAttrsNameInstance,
62
+ children: children
63
+ });
64
+ }
65
+ function FairysPCValtioFormItem(props) {
66
+ const { isHide, noStyle, ...rest } = props;
67
+ if (isHide) return /*#__PURE__*/ jsx(FairysPCValtioFormHideItem, {
68
+ ...rest
69
+ });
70
+ if (noStyle) return /*#__PURE__*/ jsx(FairysPCValtioFormItemNoStyle, {
71
+ ...rest
72
+ });
73
+ return /*#__PURE__*/ jsx(FairysPCValtioFormItemBase, {
74
+ ...rest
75
+ });
76
+ }
77
+ export { FairysPCValtioFormHideItem, FairysPCValtioFormItem, FairysPCValtioFormItemBase, FairysPCValtioFormItemNoStyle };
package/esm/form.js ADDED
@@ -0,0 +1,30 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { FairysPCValtioFormLayout } from "./layout.js";
3
+ import { FairysPCValtioFormHideItem, FairysPCValtioFormItem, FairysPCValtioFormItemBase } from "./form.item.js";
4
+ import { FairysValtioFormInstanceContext, useFairysValtioForm, useFairysValtioFormInstance, useFairysValtioFormInstanceContext, useFairysValtioFormInstanceContextHideState, useFairysValtioFormInstanceContextState } from "@fairys/valtio-form-basic";
5
+ export * from "@fairys/valtio-form-basic";
6
+ export * from "./form.item.js";
7
+ export * from "./layout.js";
8
+ function FairysPCValtioForm(props) {
9
+ const { formInstance, children, colCount = 4, labelMode = 'top', errorLayout = 'bottom-left', itemBorderType = 'none', platform = 'pc', ...rest } = useFairysValtioForm(props);
10
+ return /*#__PURE__*/ jsx(FairysValtioFormInstanceContext.Provider, {
11
+ value: formInstance,
12
+ children: /*#__PURE__*/ jsx(FairysPCValtioFormLayout, {
13
+ ...rest,
14
+ colCount: colCount,
15
+ labelMode: labelMode,
16
+ itemBorderType: itemBorderType,
17
+ errorLayout: errorLayout,
18
+ platform: platform,
19
+ children: children
20
+ })
21
+ });
22
+ }
23
+ FairysPCValtioForm.useForm = useFairysValtioFormInstance;
24
+ FairysPCValtioForm.useFormState = useFairysValtioFormInstanceContextState;
25
+ FairysPCValtioForm.useFormHideState = useFairysValtioFormInstanceContextHideState;
26
+ FairysPCValtioForm.useFormInstance = useFairysValtioFormInstanceContext;
27
+ FairysPCValtioForm.FormItemBase = FairysPCValtioFormItemBase;
28
+ FairysPCValtioForm.FormItem = FairysPCValtioFormItem;
29
+ FairysPCValtioForm.FormHideItem = FairysPCValtioFormHideItem;
30
+ export { FairysPCValtioForm };
package/esm/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './form';
package/esm/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./form.js";
@@ -0,0 +1,4 @@
1
+ import type { FairysValtioFormLayoutAttrsProps } from '@fairys/valtio-form-basic';
2
+ export interface FairysPCValtioFormLayoutProps extends FairysValtioFormLayoutAttrsProps {
3
+ }
4
+ export declare function FairysPCValtioFormLayout(props: FairysPCValtioFormLayoutProps): import("react/jsx-runtime").JSX.Element;
package/esm/layout.js ADDED
@@ -0,0 +1,36 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { FairysValtioFormLayoutContext, useFairysValtioFormLayoutAttrs } from "@fairys/valtio-form-basic";
4
+ function FairysPCValtioFormLayout(props) {
5
+ const { children, title, extra } = props;
6
+ const { formLayoutInstance, layoutName, layoutStyle, headerName, headerStyle, headerTitleName, headerExtraName, bodyName, bodyStyle } = useFairysValtioFormLayoutAttrs(props);
7
+ return /*#__PURE__*/ jsx(FairysValtioFormLayoutContext.Provider, {
8
+ value: formLayoutInstance,
9
+ children: /*#__PURE__*/ jsxs("div", {
10
+ className: layoutName,
11
+ style: layoutStyle,
12
+ children: [
13
+ title || extra ? /*#__PURE__*/ jsxs("div", {
14
+ style: headerStyle,
15
+ className: headerName,
16
+ children: [
17
+ /*#__PURE__*/ jsx("div", {
18
+ className: headerTitleName,
19
+ children: title
20
+ }),
21
+ /*#__PURE__*/ jsx("div", {
22
+ className: headerExtraName,
23
+ children: extra
24
+ })
25
+ ]
26
+ }) : /*#__PURE__*/ jsx(Fragment, {}),
27
+ /*#__PURE__*/ jsx("div", {
28
+ className: bodyName,
29
+ style: bodyStyle,
30
+ children: children
31
+ })
32
+ ]
33
+ })
34
+ });
35
+ }
36
+ export { FairysPCValtioFormLayout };
package/lib/index.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __webpack_modules__ = {
3
+ "./form": function(module) {
4
+ module.exports = require("./form.js");
5
+ }
6
+ };
7
+ var __webpack_module_cache__ = {};
8
+ function __webpack_require__(moduleId) {
9
+ var cachedModule = __webpack_module_cache__[moduleId];
10
+ if (void 0 !== cachedModule) return cachedModule.exports;
11
+ var module = __webpack_module_cache__[moduleId] = {
12
+ exports: {}
13
+ };
14
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
15
+ return module.exports;
16
+ }
17
+ (()=>{
18
+ __webpack_require__.n = (module)=>{
19
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
20
+ __webpack_require__.d(getter, {
21
+ a: getter
22
+ });
23
+ return getter;
24
+ };
25
+ })();
26
+ (()=>{
27
+ __webpack_require__.d = (exports1, definition)=>{
28
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
29
+ enumerable: true,
30
+ get: definition[key]
31
+ });
32
+ };
33
+ })();
34
+ (()=>{
35
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
36
+ })();
37
+ (()=>{
38
+ __webpack_require__.r = (exports1)=>{
39
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
40
+ value: 'Module'
41
+ });
42
+ Object.defineProperty(exports1, '__esModule', {
43
+ value: true
44
+ });
45
+ };
46
+ })();
47
+ var __webpack_exports__ = {};
48
+ (()=>{
49
+ __webpack_require__.r(__webpack_exports__);
50
+ var _form__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./form");
51
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
52
+ for(var __WEBPACK_IMPORT_KEY__ in _form__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
53
+ return _form__WEBPACK_IMPORTED_MODULE_0__[key];
54
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
55
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
56
+ })();
57
+ for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
58
+ Object.defineProperty(exports, '__esModule', {
59
+ value: true
60
+ });
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@fairys/pc-valtio-form-basic",
3
+ "author": "SunLxy <1011771396@qq.com>",
4
+ "description": "pc表单框架组件",
5
+ "homepage": "https://github.com/autumn-fairy-tales/valtio-form-basic",
6
+ "version": "0.0.12",
7
+ "main": "lib/index.js",
8
+ "types": "esm/index.d.ts",
9
+ "module": "esm/index.js",
10
+ "license": "ISC",
11
+ "scripts": {
12
+ "build": "carefrees-rslib build ",
13
+ "watch": "carefrees-rslib build --watch"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/autumn-fairy-tales/valtio-form-basic.git",
21
+ "directory": "packages/pc-valtio-form"
22
+ },
23
+ "files": [
24
+ "src",
25
+ "esm"
26
+ ],
27
+ "dependencies": {
28
+ "@fairys/valtio-form-basic": "^0.0.12"
29
+ },
30
+ "devDependencies": {
31
+ "@types/react": "~18.2.21",
32
+ "react": "^18.0.0"
33
+ }
34
+ }
@@ -0,0 +1,101 @@
1
+ /**表单项*/
2
+
3
+ import { Fragment } from 'react';
4
+ import type { FairysValtioFormItemAttrsProps, MObject } from '@fairys/valtio-form-basic';
5
+ import {
6
+ useFairysValtioFormItemAttrs,
7
+ useFairysValtioFormInstanceContextHideState,
8
+ useFairysValtioFormItemNoStyleAttrs,
9
+ FairysValtioFormParentAttrsContext,
10
+ } from '@fairys/valtio-form-basic';
11
+
12
+ export interface FairysPCValtioFormItemProps<T extends MObject<T> = object>
13
+ extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
14
+ FairysValtioFormItemAttrsProps {
15
+ /**是否使用控制隐藏的表单项*/
16
+ isHide?: boolean;
17
+ /**是否使用无样式表单项*/
18
+ noStyle?: boolean;
19
+ }
20
+
21
+ /**普通表单项*/
22
+ export function FairysPCValtioFormItemBase<T extends MObject<T> = object>(
23
+ props: Omit<FairysPCValtioFormItemProps<T>, 'isHide' | 'noStyle'>,
24
+ ) {
25
+ const { label, extra, helpText } = props;
26
+ const {
27
+ itemClassName,
28
+ itemStyle,
29
+ containerClassName,
30
+ itemLabelClassName,
31
+ itemLabelStyle,
32
+ itemBodyClassName,
33
+ itemBodyStyle,
34
+ itemInputClassName,
35
+ itemExtraClassName,
36
+ errorClassName,
37
+ helpClassName,
38
+ isInvalid,
39
+ children,
40
+ error,
41
+ formAttrsNameInstance,
42
+ id,
43
+ } = useFairysValtioFormItemAttrs(props);
44
+
45
+ return (
46
+ <div className={itemClassName} style={itemStyle}>
47
+ <div className={containerClassName}>
48
+ {label ? (
49
+ <label htmlFor={id} className={itemLabelClassName} style={itemLabelStyle}>
50
+ {label}
51
+ </label>
52
+ ) : (
53
+ <Fragment />
54
+ )}
55
+ <div className={itemBodyClassName} style={itemBodyStyle}>
56
+ <FairysValtioFormParentAttrsContext.Provider value={formAttrsNameInstance}>
57
+ <div className={itemInputClassName}>{children}</div>
58
+ </FairysValtioFormParentAttrsContext.Provider>
59
+ {extra ? <div className={itemExtraClassName}>{extra}</div> : <Fragment />}
60
+ </div>
61
+ </div>
62
+ {helpText ? <div className={helpClassName}>{helpText}</div> : <Fragment />}
63
+ {isInvalid ? <div className={errorClassName}>{error}</div> : <Fragment />}
64
+ </div>
65
+ );
66
+ }
67
+ /**控制隐藏的表单项*/
68
+ export function FairysPCValtioFormHideItem<T extends MObject<T> = object>(
69
+ props: Omit<FairysPCValtioFormItemProps<T>, 'isHide' | 'noStyle'>,
70
+ ) {
71
+ const [state] = useFairysValtioFormInstanceContextHideState();
72
+ const isHide = state[props.name];
73
+ if (isHide) {
74
+ return <Fragment />;
75
+ }
76
+ return <FairysPCValtioFormItemBase<T> {...props} />;
77
+ }
78
+
79
+ /**无样式表单项*/
80
+ export function FairysPCValtioFormItemNoStyle<T extends MObject<T> = object>(
81
+ props: Omit<FairysPCValtioFormItemProps<T>, 'isHide' | 'noStyle'>,
82
+ ) {
83
+ const { children, formAttrsNameInstance } = useFairysValtioFormItemNoStyleAttrs(props);
84
+ return (
85
+ <FairysValtioFormParentAttrsContext.Provider value={formAttrsNameInstance}>
86
+ {children}
87
+ </FairysValtioFormParentAttrsContext.Provider>
88
+ );
89
+ }
90
+
91
+ /**表单项基础组件(根据isHide和noStyle判断是否使用控制隐藏的表单项和无样式表单项)*/
92
+ export function FairysPCValtioFormItem<T extends MObject<T> = object>(props: FairysPCValtioFormItemProps<T>) {
93
+ const { isHide, noStyle, ...rest } = props;
94
+ if (isHide) {
95
+ return <FairysPCValtioFormHideItem<T> {...rest} />;
96
+ }
97
+ if (noStyle) {
98
+ return <FairysPCValtioFormItemNoStyle<T> {...rest} />;
99
+ }
100
+ return <FairysPCValtioFormItemBase<T> {...rest} />;
101
+ }
package/src/form.tsx ADDED
@@ -0,0 +1,56 @@
1
+ import { FairysPCValtioFormLayout } from './layout';
2
+ import { FairysPCValtioFormItem, FairysPCValtioFormHideItem, FairysPCValtioFormItemBase } from './form.item';
3
+ import {
4
+ useFairysValtioForm,
5
+ FairysValtioFormInstanceContext,
6
+ useFairysValtioFormInstance,
7
+ useFairysValtioFormInstanceContext,
8
+ useFairysValtioFormInstanceContextState,
9
+ useFairysValtioFormInstanceContextHideState,
10
+ } from '@fairys/valtio-form-basic';
11
+ import type { FairysValtioFormAttrsProps, MObject } from '@fairys/valtio-form-basic';
12
+ export * from '@fairys/valtio-form-basic';
13
+ export * from './form.item';
14
+ export * from './layout';
15
+ export interface FairysPCValtioFormProps<T extends MObject<T> = object> extends FairysValtioFormAttrsProps<T> {}
16
+
17
+ export function FairysPCValtioForm<T extends MObject<T> = object>(props: FairysPCValtioFormProps<T>) {
18
+ const {
19
+ formInstance,
20
+ children,
21
+ colCount = 4,
22
+ labelMode = 'top',
23
+ errorLayout = 'bottom-left',
24
+ itemBorderType = 'none',
25
+ platform = 'pc',
26
+ ...rest
27
+ } = useFairysValtioForm(props);
28
+ return (
29
+ <FairysValtioFormInstanceContext.Provider value={formInstance}>
30
+ <FairysPCValtioFormLayout
31
+ {...rest}
32
+ colCount={colCount}
33
+ labelMode={labelMode}
34
+ itemBorderType={itemBorderType}
35
+ errorLayout={errorLayout}
36
+ platform={platform}
37
+ >
38
+ {children}
39
+ </FairysPCValtioFormLayout>
40
+ </FairysValtioFormInstanceContext.Provider>
41
+ );
42
+ }
43
+ /**初始化实例*/
44
+ FairysPCValtioForm.useForm = useFairysValtioFormInstance;
45
+ /**获取状态*/
46
+ FairysPCValtioForm.useFormState = useFairysValtioFormInstanceContextState;
47
+ /**获取隐藏状态*/
48
+ FairysPCValtioForm.useFormHideState = useFairysValtioFormInstanceContextHideState;
49
+ /**获取上下文实例*/
50
+ FairysPCValtioForm.useFormInstance = useFairysValtioFormInstanceContext;
51
+ /**表单项基础组件*/
52
+ FairysPCValtioForm.FormItemBase = FairysPCValtioFormItemBase;
53
+ /**表单项*/
54
+ FairysPCValtioForm.FormItem = FairysPCValtioFormItem;
55
+ /**隐藏表单想*/
56
+ FairysPCValtioForm.FormHideItem = FairysPCValtioFormHideItem;
package/src/index.tsx ADDED
@@ -0,0 +1 @@
1
+ export * from './form';
package/src/layout.tsx ADDED
@@ -0,0 +1,38 @@
1
+ import { Fragment } from 'react';
2
+ import type { FairysValtioFormLayoutAttrsProps } from '@fairys/valtio-form-basic';
3
+ import { FairysValtioFormLayoutContext, useFairysValtioFormLayoutAttrs } from '@fairys/valtio-form-basic';
4
+ export interface FairysPCValtioFormLayoutProps extends FairysValtioFormLayoutAttrsProps { }
5
+
6
+ export function FairysPCValtioFormLayout(props: FairysPCValtioFormLayoutProps) {
7
+ const { children, title, extra } = props;
8
+
9
+ const {
10
+ formLayoutInstance,
11
+ layoutName,
12
+ layoutStyle,
13
+ headerName,
14
+ headerStyle,
15
+ headerTitleName,
16
+ headerExtraName,
17
+ bodyName,
18
+ bodyStyle,
19
+ } = useFairysValtioFormLayoutAttrs(props);
20
+
21
+ return (
22
+ <FairysValtioFormLayoutContext.Provider value={formLayoutInstance}>
23
+ <div className={layoutName} style={layoutStyle}>
24
+ {title || extra ? (
25
+ <div style={headerStyle} className={headerName}>
26
+ <div className={headerTitleName}>{title}</div>
27
+ <div className={headerExtraName}>{extra}</div>
28
+ </div>
29
+ ) : (
30
+ <Fragment />
31
+ )}
32
+ <div className={bodyName} style={bodyStyle}>
33
+ {children}
34
+ </div>
35
+ </div>
36
+ </FairysValtioFormLayoutContext.Provider>
37
+ );
38
+ }