@fuf-stack/uniform 0.2.3 → 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/dist/Form/index.cjs +3 -5
- package/dist/Form/index.js +2 -4
- package/dist/Grid/index.cjs +2 -4
- package/dist/Grid/index.js +1 -3
- package/dist/Input/index.cjs +13 -0
- package/dist/Input/index.d.cts +8 -0
- package/dist/Input/index.d.ts +8 -0
- package/dist/Input/index.js +13 -0
- package/dist/Input-B_rP1h4X.d.cts +27 -0
- package/dist/Input-B_rP1h4X.d.ts +27 -0
- package/dist/SubmitButton/index.cjs +3 -5
- package/dist/SubmitButton/index.js +2 -4
- package/dist/{chunk-DBNZWU3T.cjs → chunk-22AA557I.cjs} +5 -12
- package/dist/chunk-22AA557I.cjs.map +1 -0
- package/dist/chunk-2O53LMR3.cjs +79 -0
- package/dist/chunk-2O53LMR3.cjs.map +1 -0
- package/dist/chunk-3DMR7T4D.js +79 -0
- package/dist/chunk-3DMR7T4D.js.map +1 -0
- package/dist/{chunk-UFEO2WD4.cjs → chunk-4BELEHDQ.cjs} +21 -28
- package/dist/chunk-4BELEHDQ.cjs.map +1 -0
- package/dist/chunk-4MEKDDB2.js +20 -0
- package/dist/{chunk-YNN5AVDW.js.map → chunk-4MEKDDB2.js.map} +1 -1
- package/dist/{chunk-YMSVB2DX.js → chunk-6XKDXQ4A.js} +20 -27
- package/dist/{chunk-YMSVB2DX.js.map → chunk-6XKDXQ4A.js.map} +1 -1
- package/dist/{chunk-BQTJHSDU.js → chunk-BCMPSLSG.js} +7 -14
- package/dist/{chunk-BQTJHSDU.js.map → chunk-BCMPSLSG.js.map} +1 -1
- package/dist/{chunk-ZWSYKQT7.js → chunk-DBLODROX.js} +4 -10
- package/dist/{chunk-ZWSYKQT7.js.map → chunk-DBLODROX.js.map} +1 -1
- package/dist/{chunk-WT2BR5B5.js → chunk-FNVT6LS4.js} +4 -11
- package/dist/{chunk-WT2BR5B5.js.map → chunk-FNVT6LS4.js.map} +1 -1
- package/dist/{chunk-HW65ROPB.cjs → chunk-QTL5FREE.cjs} +4 -10
- package/dist/chunk-QTL5FREE.cjs.map +1 -0
- package/dist/{chunk-73CQ3KWD.js → chunk-TEJGV6NC.js} +4 -10
- package/dist/{chunk-73CQ3KWD.js.map → chunk-TEJGV6NC.js.map} +1 -1
- package/dist/{chunk-AAESGATO.cjs → chunk-WQRM7G4C.cjs} +8 -15
- package/dist/chunk-WQRM7G4C.cjs.map +1 -0
- package/dist/{chunk-RU72JRAY.cjs → chunk-XUKBLFTR.cjs} +5 -11
- package/dist/chunk-XUKBLFTR.cjs.map +1 -0
- package/dist/chunk-ZPFKVKGV.cjs +20 -0
- package/dist/chunk-ZPFKVKGV.cjs.map +1 -0
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/hooks/index.cjs +2 -4
- package/dist/hooks/index.js +1 -3
- package/dist/index.cjs +11 -9
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -12
- package/dist/partials/FieldCopyTestIdButton/index.cjs +2 -4
- package/dist/partials/FieldCopyTestIdButton/index.js +1 -3
- package/dist/partials/FieldValidationError/index.cjs +2 -4
- package/dist/partials/FieldValidationError/index.js +1 -3
- package/package.json +19 -10
- package/dist/chunk-AAESGATO.cjs.map +0 -1
- package/dist/chunk-AT5DS6MS.cjs +0 -31
- package/dist/chunk-DBNZWU3T.cjs.map +0 -1
- package/dist/chunk-HW65ROPB.cjs.map +0 -1
- package/dist/chunk-LAHYQUKQ.cjs +0 -27
- package/dist/chunk-LAHYQUKQ.cjs.map +0 -1
- package/dist/chunk-LMMDXQ4L.cjs +0 -3170
- package/dist/chunk-LMMDXQ4L.cjs.map +0 -1
- package/dist/chunk-LQ2VYIYD.js +0 -31
- package/dist/chunk-RBXONCYN.js +0 -3170
- package/dist/chunk-RBXONCYN.js.map +0 -1
- package/dist/chunk-RU72JRAY.cjs.map +0 -1
- package/dist/chunk-UFEO2WD4.cjs.map +0 -1
- package/dist/chunk-YNN5AVDW.js +0 -27
- /package/dist/{chunk-AT5DS6MS.cjs.map → Input/index.cjs.map} +0 -0
- /package/dist/{chunk-LQ2VYIYD.js.map → Input/index.js.map} +0 -0
package/dist/helpers/index.cjs
CHANGED
package/dist/helpers/index.js
CHANGED
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkWQRM7G4Ccjs = require('../chunk-WQRM7G4C.cjs');
|
|
5
5
|
require('../chunk-BBB4FEY6.cjs');
|
|
6
|
-
require('../chunk-LMMDXQ4L.cjs');
|
|
7
|
-
require('../chunk-AT5DS6MS.cjs');
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
|
|
11
|
-
exports.recursiveFieldKeySearch =
|
|
9
|
+
exports.recursiveFieldKeySearch = _chunkWQRM7G4Ccjs.recursiveFieldKeySearch; exports.useFormContext = _chunkWQRM7G4Ccjs.useFormContext;
|
|
12
10
|
//# sourceMappingURL=index.cjs.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recursiveFieldKeySearch,
|
|
3
3
|
useFormContext
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-BCMPSLSG.js";
|
|
5
5
|
import "../chunk-V46BHM2U.js";
|
|
6
|
-
import "../chunk-RBXONCYN.js";
|
|
7
|
-
import "../chunk-LQ2VYIYD.js";
|
|
8
6
|
export {
|
|
9
7
|
recursiveFieldKeySearch,
|
|
10
8
|
useFormContext
|
package/dist/index.cjs
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4BELEHDQcjs = require('./chunk-4BELEHDQ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkZPFKVKGVcjs = require('./chunk-ZPFKVKGV.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk2O53LMR3cjs = require('./chunk-2O53LMR3.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkQTL5FREEcjs = require('./chunk-QTL5FREE.cjs');
|
|
12
13
|
|
|
13
|
-
var _chunkAAESGATOcjs = require('./chunk-AAESGATO.cjs');
|
|
14
14
|
|
|
15
|
+
var _chunkXUKBLFTRcjs = require('./chunk-XUKBLFTR.cjs');
|
|
15
16
|
|
|
16
|
-
var _chunkDBNZWU3Tcjs = require('./chunk-DBNZWU3T.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkWQRM7G4Ccjs = require('./chunk-WQRM7G4C.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkBBB4FEY6cjs = require('./chunk-BBB4FEY6.cjs');
|
|
23
|
-
require('./chunk-LMMDXQ4L.cjs');
|
|
24
|
-
require('./chunk-AT5DS6MS.cjs');
|
|
25
23
|
|
|
26
24
|
|
|
25
|
+
var _chunk22AA557Icjs = require('./chunk-22AA557I.cjs');
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
|
|
@@ -31,5 +30,8 @@ require('./chunk-AT5DS6MS.cjs');
|
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
exports.FieldCopyTestIdButton = _chunk22AA557Icjs.FieldCopyTestIdButton_default; exports.FieldValidationError = _chunkQTL5FREEcjs.FieldValidationError_default; exports.Form = _chunk4BELEHDQcjs.Form_default; exports.Grid = _chunkZPFKVKGVcjs.Grid_default; exports.Input = _chunk2O53LMR3cjs.Input_default; exports.SubmitButton = _chunkXUKBLFTRcjs.SubmitButton_default; exports.recursiveFieldKeySearch = _chunkWQRM7G4Ccjs.recursiveFieldKeySearch; exports.slugify = _chunkBBB4FEY6cjs.slugify; exports.useFormContext = _chunkWQRM7G4Ccjs.useFormContext;
|
|
35
37
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -2,6 +2,7 @@ export { F as Form, a as FormProps } from './Form-Bv0R3QNk.cjs';
|
|
|
2
2
|
export { G as Grid, a as GridProps } from './Grid-DF3L9NF3.cjs';
|
|
3
3
|
export { slugify } from './helpers/index.cjs';
|
|
4
4
|
export { recursiveFieldKeySearch, useFormContext } from './hooks/index.cjs';
|
|
5
|
+
export { I as Input, a as InputProps } from './Input-B_rP1h4X.cjs';
|
|
5
6
|
export { F as FieldCopyTestIdButton, a as FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton-D-z1usqE.cjs';
|
|
6
7
|
export { F as FieldValidationError, a as FieldValidationErrorProps } from './FieldValidationError-BSXedjCA.cjs';
|
|
7
8
|
export { S as SubmitButton, a as SubmitButtonProps } from './SubmitButton-BEp_zzwf.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { F as Form, a as FormProps } from './Form-Bv0R3QNk.js';
|
|
|
2
2
|
export { G as Grid, a as GridProps } from './Grid-DF3L9NF3.js';
|
|
3
3
|
export { slugify } from './helpers/index.js';
|
|
4
4
|
export { recursiveFieldKeySearch, useFormContext } from './hooks/index.js';
|
|
5
|
+
export { I as Input, a as InputProps } from './Input-B_rP1h4X.js';
|
|
5
6
|
export { F as FieldCopyTestIdButton, a as FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton-D-z1usqE.js';
|
|
6
7
|
export { F as FieldValidationError, a as FieldValidationErrorProps } from './FieldValidationError-BSXedjCA.js';
|
|
7
8
|
export { S as SubmitButton, a as SubmitButtonProps } from './SubmitButton-BEp_zzwf.js';
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Form_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6XKDXQ4A.js";
|
|
4
4
|
import {
|
|
5
5
|
Grid_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4MEKDDB2.js";
|
|
7
|
+
import {
|
|
8
|
+
Input_default
|
|
9
|
+
} from "./chunk-3DMR7T4D.js";
|
|
10
|
+
import {
|
|
11
|
+
FieldValidationError_default
|
|
12
|
+
} from "./chunk-DBLODROX.js";
|
|
7
13
|
import {
|
|
8
14
|
SubmitButton_default
|
|
9
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TEJGV6NC.js";
|
|
10
16
|
import {
|
|
11
17
|
recursiveFieldKeySearch,
|
|
12
18
|
useFormContext
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
FieldCopyTestIdButton_default
|
|
16
|
-
} from "./chunk-WT2BR5B5.js";
|
|
17
|
-
import {
|
|
18
|
-
FieldValidationError_default
|
|
19
|
-
} from "./chunk-ZWSYKQT7.js";
|
|
19
|
+
} from "./chunk-BCMPSLSG.js";
|
|
20
20
|
import {
|
|
21
21
|
slugify
|
|
22
22
|
} from "./chunk-V46BHM2U.js";
|
|
23
|
-
import
|
|
24
|
-
|
|
23
|
+
import {
|
|
24
|
+
FieldCopyTestIdButton_default
|
|
25
|
+
} from "./chunk-FNVT6LS4.js";
|
|
25
26
|
export {
|
|
26
27
|
FieldCopyTestIdButton_default as FieldCopyTestIdButton,
|
|
27
28
|
FieldValidationError_default as FieldValidationError,
|
|
28
29
|
Form_default as Form,
|
|
29
30
|
Grid_default as Grid,
|
|
31
|
+
Input_default as Input,
|
|
30
32
|
SubmitButton_default as SubmitButton,
|
|
31
33
|
recursiveFieldKeySearch,
|
|
32
34
|
slugify,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-LMMDXQ4L.cjs');
|
|
6
|
-
require('../../chunk-AT5DS6MS.cjs');
|
|
4
|
+
var _chunk22AA557Icjs = require('../../chunk-22AA557I.cjs');
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
|
|
10
|
-
exports.FieldCopyTestIdButton =
|
|
8
|
+
exports.FieldCopyTestIdButton = _chunk22AA557Icjs.FieldCopyTestIdButton_default; exports.default = _chunk22AA557Icjs.FieldCopyTestIdButton_default2;
|
|
11
9
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldCopyTestIdButton_default,
|
|
3
3
|
FieldCopyTestIdButton_default2
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-RBXONCYN.js";
|
|
6
|
-
import "../../chunk-LQ2VYIYD.js";
|
|
4
|
+
} from "../../chunk-FNVT6LS4.js";
|
|
7
5
|
export {
|
|
8
6
|
FieldCopyTestIdButton_default as FieldCopyTestIdButton,
|
|
9
7
|
FieldCopyTestIdButton_default2 as default
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkQTL5FREEcjs = require('../../chunk-QTL5FREE.cjs');
|
|
5
5
|
require('../../chunk-BBB4FEY6.cjs');
|
|
6
|
-
require('../../chunk-LMMDXQ4L.cjs');
|
|
7
|
-
require('../../chunk-AT5DS6MS.cjs');
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
|
|
11
|
-
exports.FieldValidationError =
|
|
9
|
+
exports.FieldValidationError = _chunkQTL5FREEcjs.FieldValidationError_default; exports.default = _chunkQTL5FREEcjs.FieldValidationError_default2;
|
|
12
10
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldValidationError_default,
|
|
3
3
|
FieldValidationError_default2
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-DBLODROX.js";
|
|
5
5
|
import "../../chunk-V46BHM2U.js";
|
|
6
|
-
import "../../chunk-RBXONCYN.js";
|
|
7
|
-
import "../../chunk-LQ2VYIYD.js";
|
|
8
6
|
export {
|
|
9
7
|
FieldValidationError_default as FieldValidationError,
|
|
10
8
|
FieldValidationError_default2 as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuf-stack/uniform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "fuf react form library",
|
|
5
5
|
"author": "Hannes Tiede",
|
|
6
6
|
"homepage": "https://github.com/fuf-stack/uniform#readme",
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"require": "./dist/hooks/index.cjs",
|
|
37
37
|
"types": "./dist/hooks/index.d.ts"
|
|
38
38
|
},
|
|
39
|
+
"./Input": {
|
|
40
|
+
"import": "./dist/Input/index.js",
|
|
41
|
+
"require": "./dist/Input/index.cjs",
|
|
42
|
+
"types": "./dist/Input/index.d.ts"
|
|
43
|
+
},
|
|
39
44
|
"./partials/FieldCopyTestIdButton": {
|
|
40
45
|
"import": "./dist/partials/FieldCopyTestIdButton/index.js",
|
|
41
46
|
"require": "./dist/partials/FieldCopyTestIdButton/index.cjs",
|
|
@@ -66,6 +71,10 @@
|
|
|
66
71
|
"bugs": {
|
|
67
72
|
"url": "https://github.com/fuf-stack/uniform/issues"
|
|
68
73
|
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"react": ">=18",
|
|
76
|
+
"react-dom": ">=18"
|
|
77
|
+
},
|
|
69
78
|
"dependencies": {
|
|
70
79
|
"@dnd-kit/core": "6.1.0",
|
|
71
80
|
"@dnd-kit/modifiers": "7.0.0",
|
|
@@ -78,27 +87,27 @@
|
|
|
78
87
|
"@nextui-org/select": "2.1.27",
|
|
79
88
|
"@nextui-org/switch": "2.0.28",
|
|
80
89
|
"@nextui-org/system": "2.1.2",
|
|
81
|
-
"@react-aria/visually-hidden": "3.8.
|
|
82
|
-
"react-icons": "5.
|
|
90
|
+
"@react-aria/visually-hidden": "3.8.11",
|
|
91
|
+
"react-icons": "5.2.0",
|
|
83
92
|
"classnames": "2.5.1",
|
|
84
93
|
"react-hook-form": "7.51.3",
|
|
85
94
|
"react-select": "5.8.0",
|
|
86
95
|
"slug": "9.0.0",
|
|
87
96
|
"tailwind-variants": "0.2.1",
|
|
88
|
-
"@fuf-stack/
|
|
89
|
-
"@fuf-stack/
|
|
97
|
+
"@fuf-stack/veto": "0.2.1",
|
|
98
|
+
"@fuf-stack/pixels": "0.5.7"
|
|
90
99
|
},
|
|
91
100
|
"devDependencies": {
|
|
92
101
|
"@types/debug": "4.1.12",
|
|
93
|
-
"@types/react": "18.3.
|
|
102
|
+
"@types/react": "18.3.1",
|
|
94
103
|
"@types/react-dom": "18.3.0",
|
|
95
104
|
"@types/slug": "5.0.8",
|
|
96
|
-
"react": "18.3.
|
|
97
|
-
"react-dom": "18.3.
|
|
105
|
+
"react": "18.3.1",
|
|
106
|
+
"react-dom": "18.3.1",
|
|
98
107
|
"@repo/storybook-config": "0.0.1",
|
|
99
|
-
"@repo/
|
|
108
|
+
"@repo/vite-config": "0.0.1",
|
|
100
109
|
"@repo/tsup-config": "0.0.1",
|
|
101
|
-
"@repo/
|
|
110
|
+
"@repo/tailwind-config": "0.0.1"
|
|
102
111
|
},
|
|
103
112
|
"scripts": {
|
|
104
113
|
"build": "tsup --config node_modules/@repo/tsup-config/config.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useFormContext/useFormContext.ts","../src/Form/subcomponents/FormContext.tsx"],"names":["import_react","React"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,gBAA2B;AAC3B,SAAS,kBAAkB,0BAA0B;;;ACDrD,mBAAkB;AAqBZ;AApBN,SAAS,gBAAgB,wBAAwB;AAE1C,IAAM,0BAA0B,aAAAC,QAAM,cAE3C,MAAS;AASX,IAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA,aAAa;AAAA,EACb,GAAG;AACL,MAAyB;AACvB,SACE,4CAAC,wBAAwB,UAAxB,EAAiC,OAAO,YACvC,sDAAC,oBAAkB,GAAG,eAAgB,UAAS,GACjD;AAEJ;AAEA,IAAO,sBAAQ;;;ADnBf,IAAM,2BAA2B,CAAC,WAAgC;AAChE,MAAI,QAAQ,MAAM,WAAW;AAC3B,QAAI,QAAQ,MAAM,WAAW,MAAM,aAAa,eAAe;AAC7D,aAAO,QAAQ,MAAM,WAAW,MAAM,aAAa;AAAA,IACrD;AACA,WAAO,yBAAyB,QAAQ,MAAM,SAAS;AAAA,EACzD;AACA,SAAO;AACT;AAGO,IAAM,0BAA0B,CACrC,QACA,SACmB;AACnB,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI;AAG3B,MAAI,gBAAgB;AAEpB,MAAI,QAAQ,MAAM,aAAa,eAAe;AAE5C,oBAAgB,OAAO,OAAO;AAAA,EAChC,WAAW,QAAQ,MAAM,aAAa,cAAc;AAElD,WAAO,wBAAwB,OAAO,MAAM,QAAQ,IAAI;AAAA,EAC1D;AAGA,MAAI,eAAe,MAAM,aAAa,mBAAmB;AACvD,YACG,cAAc,KAAK,MAAM,SACtB,wBAAwB,cAAc,KAAK,KAAK,QAAQ,IAAI,IAC5D,wBAAwB,cAAc,KAAK,MAAM,IAAI,OACxD,cAAc,KAAK,OAAO,SACvB,wBAAwB,cAAc,KAAK,MAAM,QAAQ,IAAI,IAC7D,wBAAwB,cAAc,KAAK,OAAO,IAAI;AAAA,EAE9D;AAIA,QAAM,QAAQ,eAAe,SAAS,eAAe,SAAS;AAE9D,MAAI,SAAS,MAAM,OAAO,GAAG;AAE3B,QAAI,KAAK,WAAW,GAAG;AAErB,aACE,MAAM,OAAO,GAAG,MAAM,aAAa,iBACnC,yBAAyB,MAAM,OAAO,CAAC;AAAA,IAE3C;AACA,WAAO,wBAAwB,MAAM,OAAO,GAAG,IAAI;AAAA,EACrD;AAEA,SAAO;AACT;AAGO,IAAM,iBAAiB,MAAM;AAClC,QAAM;AAAA;AAAA;AAAA,IAGJ;AAAA,IACA,eAAe;AAAA,IACf,GAAG;AAAA,EACL,IAAI,mBAAmB;AACvB,QAAM,iBAAa,0BAAW,uBAAuB;AAGrD,QAAM,gBAAgB,CAAC,MAAc,WAAoB;AACvD,UAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,IAAI;AACvE,UAAM,WACH,cAAc,wBAAwB,WAAW,QAAQ,SAAS,KACnE;AACF,UAAM,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,MAAM,SAAS;AAC5D,WAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA;AAAA,MACA;AAAA,MACA,QAAQ,QAAQ,UAAU,IAAI;AAAA,IAChC;AAAA,EACF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF","sourcesContent":["import type { VetoSchema } from '@fuf-stack/veto';\nimport type { FieldError } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { ValidationSchemaContext } from '../../Form/subcomponents/FormContext';\nimport { slugify } from '../../helpers';\n\n// FIX: This fixes the problem that the innerType is not checked for optionals...\nconst recursiveSearchInnerType = (schema: VetoSchema): boolean => {\n if (schema?._def?.innerType) {\n if (schema?._def?.innerType?._def?.typeName === 'ZodOptional') {\n return schema?._def?.innerType?._def?.typeName !== 'ZodOptional';\n }\n return recursiveSearchInnerType(schema?._def?.innerType);\n }\n return true;\n};\n\n// TODO: Fix problem \".optional().nullable()\" is required, \".nullable().optional()\" is not required...\nexport const recursiveFieldKeySearch = (\n schema: VetoSchema,\n path: string[],\n): boolean | null => {\n const [current, ...rest] = path;\n // ignore optionals on the path to the desired field\n\n let currentSchema = schema;\n\n if (schema?._def?.typeName === 'ZodOptional') {\n // @ts-expect-error not sure here\n currentSchema = schema.unwrap();\n } else if (schema?._def?.typeName === 'ZodEffects') {\n // in case of an effect, unwrap the effect and call with schema (clould be optional) and complete path.\n return recursiveFieldKeySearch(schema._def?.schema, path);\n }\n\n // TODO: This needs further investigation. It is nor yet completely clear how to handle intersections!\n if (currentSchema?._def?.typeName === 'ZodIntersection') {\n return (\n (currentSchema._def.left?.schema\n ? recursiveFieldKeySearch(currentSchema._def.left.schema, path)\n : recursiveFieldKeySearch(currentSchema._def.left, path)) ||\n (currentSchema._def.right?.schema\n ? recursiveFieldKeySearch(currentSchema._def.right.schema, path)\n : recursiveFieldKeySearch(currentSchema._def.right, path))\n );\n }\n\n // get shape of an object or objects of an array\n // @ts-expect-error not sure here\n const shape = currentSchema?.shape ?? currentSchema?.element?.shape; // ??\n\n if (shape && shape[current]) {\n // currentSchema?._def.schema.unwrap()?.shape;\n if (rest.length === 0) {\n // At the end of the path check if the field is optional or required\n return (\n shape[current]?._def?.typeName !== 'ZodOptional' &&\n recursiveSearchInnerType(shape[current])\n );\n }\n return recursiveFieldKeySearch(shape[current], rest);\n }\n\n return null; // field not found\n};\n\n/** TODO: add description */\nexport const useFormContext = () => {\n const {\n // https://react-hook-form.com/docs/useform/getfieldstate\n // for getFieldState a subscription to formState properties is needed!\n formState,\n getFieldState: getFieldStateOrig,\n ...otherMethods\n } = useHookFormContext();\n const validation = useContext(ValidationSchemaContext);\n\n // update getFieldState\n const getFieldState = (name: string, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n const required =\n (validation && recursiveFieldKeySearch(validation.schema, fieldPath)) ||\n false;\n const { error, ...rest } = getFieldStateOrig(name, formState);\n return {\n ...rest,\n error: error as FieldError[] | undefined, // TODO: change to correct type @Hannes ;)\n required,\n testId: slugify(testId || name),\n };\n };\n\n return {\n ...otherMethods,\n getFieldState,\n validation,\n formState,\n };\n};\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { FormProviderProps as HookFormProviderProps } from 'react-hook-form';\n\nimport React from 'react';\nimport { FormProvider as HookFormProvider } from 'react-hook-form';\n\nexport const ValidationSchemaContext = React.createContext<\n VetoInstance | undefined\n>(undefined);\n\ninterface FormProviderProps\n extends HookFormProviderProps<Record<string, any>, any, undefined> {\n /** veto validation schema */\n validation?: VetoInstance;\n}\n\n/** Provides the veto validation context to the form */\nconst FormProvider = ({\n children,\n validation = undefined,\n ...hookFormProps\n}: FormProviderProps) => {\n return (\n <ValidationSchemaContext.Provider value={validation}>\n <HookFormProvider {...hookFormProps}>{children}</HookFormProvider>\n </ValidationSchemaContext.Provider>\n );\n};\n\nexport default FormProvider;\n"]}
|
package/dist/chunk-AT5DS6MS.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.__commonJS = __commonJS; exports.__toESM = __toESM;
|
|
31
|
-
//# sourceMappingURL=chunk-AT5DS6MS.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../src/partials/FieldCopyTestIdButton/index.ts"],"names":["FieldCopyTestIdButton_default"],"mappings":";;;;;;;;AAkCY;AAlCZ,SAAS,kBAAkB;AAE3B,OAAO,QAAQ;AAEf,SAAS,QAAQ,uBAAuB;AAOxC,IAAM,yBAAyB;AAE/B,IAAM,wBAAwB,CAAC;AAAA,EAC7B,YAAY;AAAA,EACZ;AACF,MAAkC;AAChC,QAAM,CAAC,KAAK,IAAI,gBAAgB,wBAAwB,KAAK;AAE7D,QAAM,kBAAkB,MAAM;AAC5B,cAAU,UAAU,UAAU,MAAM,EAAE,MAAM,CAAC,QAAQ;AACnD,cAAQ,MAAM,qCAAqC,GAAG;AAAA,IACxD,CAAC;AAAA,EACH;AAEA,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,qBAAqB;AAAA,MAC9C,SAAQ;AAAA,MACR,SAAS;AAAA,MACT,MAAM,4CAAC,cAAW;AAAA,MAClB,MAAK;AAAA;AAAA,EACP;AAEJ;AACA,IAAO,gCAAQ;;;ACjCf,IAAOA,iCAAQ","sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport cn from 'classnames';\n\nimport { Button, useLocalStorage } from '@fuf-stack/pixels';\n\nexport interface FieldCopyTestIdButtonProps {\n className?: string;\n testId: string;\n}\n\nconst LOCALSTORAGE_DEBUG_KEY = 'uniform:form-debug-enabled';\n\nconst FieldCopyTestIdButton = ({\n className = undefined,\n testId,\n}: FieldCopyTestIdButtonProps) => {\n const [debug] = useLocalStorage(LOCALSTORAGE_DEBUG_KEY, false);\n\n const copyToClipboard = () => {\n navigator.clipboard.writeText(testId).catch((err) => {\n console.error('Error copying TestId to clipboard', err);\n });\n };\n\n if (!debug) {\n return null;\n }\n\n return (\n <Button\n className={cn(className, 'pointer-events-auto')}\n variant=\"light\"\n onClick={copyToClipboard}\n icon={<FaBullseye />}\n size=\"sm\"\n />\n );\n};\nexport default FieldCopyTestIdButton;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport type { FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton';\n\nexport { FieldCopyTestIdButton };\n\nexport default FieldCopyTestIdButton;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"names":["FieldValidationError_default"],"mappings":";;;;;;;;;;;AA0CU;AA9BV,IAAM,uBAAuB,CAAC;AAAA,EAC5B;AAAA,EACA,SAAS;AACX,MAAiC;AAC/B,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,MAAI,aAA2B,CAAC;AAEhC,MAAI,OAAO,UAAU,YAAY,EAAE,iBAAiB,QAAQ;AAC1D,UAAM,eAAe;AACrB,WAAO,KAAK,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAClC,mBAAa,CAAC,GAAG,YAAY,GAAG,aAAa,GAAG,CAAC;AAAA,IACnD,CAAC;AAAA,EACH;AAEA,QAAM,aACJ,KAAK,UAAU,UAAU,MAAM,OAAO,aAAc;AACtD,QAAM,eAAyB,WAAW,IAAI,CAAC,MAAM,EAAE,OAAO;AAC9D,QAAM,aAAa,UAAU,aAAa,KAAK,IAAI,CAAC;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,QAAQ,UAAU,aAAa,KAAK,CAAC;AAAA,MAClD,cAAY;AAAA,MAEX,uBAAa,IAAI,CAAC,aAAqB;AAAA;AAAA,QAEtC,4CAAC,QACC,sDAAC,SAAK,uBAAY,KADX,SAAS,CAAC,EAEnB;AAAA,OACD;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,+BAAQ;;;AC3Cf,IAAOA,gCAAQ","sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport { slugify } from '../../helpers';\n\nexport interface FieldValidationErrorProps {\n error: FieldError[] | Record<string, FieldError[]>;\n testId?: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n error,\n testId = undefined,\n}: FieldValidationErrorProps) => {\n if (!error) {\n return null;\n }\n\n let tmp_errors: FieldError[] = [];\n\n if (typeof error === 'object' && !(error instanceof Array)) {\n const error_object = error as Record<string, FieldError[]>;\n Object.keys(error).forEach((key) => {\n tmp_errors = [...tmp_errors, ...error_object[key]];\n });\n }\n\n const errorArray: FieldError[] =\n JSON.stringify(tmp_errors) !== '[]' ? tmp_errors : (error as FieldError[]);\n const errorStrings: string[] = errorArray.map((e) => e.message) as string[];\n const ariaString = `Error: ${errorStrings.join('\\n')}`;\n\n return (\n <ul\n data-testid={slugify(testId || errorStrings.join())}\n aria-label={ariaString} // TODO: ist das richtig @Hannes?\n >\n {errorStrings.map((errorString: string, i: number) => (\n // eslint-disable-next-line react/no-array-index-key\n <li key={`error_${i}`}>\n <div>{errorString}</div>\n </li>\n ))}\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"]}
|
package/dist/chunk-LAHYQUKQ.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
var _chunkLMMDXQ4Lcjs = require('./chunk-LMMDXQ4L.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkAT5DS6MScjs = require('./chunk-AT5DS6MS.cjs');
|
|
7
|
-
|
|
8
|
-
// src/Grid/Grid.tsx
|
|
9
|
-
var import_jsx_runtime = _chunkAT5DS6MScjs.__toESM.call(void 0, _chunkLMMDXQ4Lcjs.require_jsx_runtime.call(void 0, ), 1);
|
|
10
|
-
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
11
|
-
var Grid = ({
|
|
12
|
-
children = null,
|
|
13
|
-
className = void 0,
|
|
14
|
-
testId = void 0
|
|
15
|
-
}) => {
|
|
16
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: _classnames2.default.call(void 0, "grid gap-6", className), "data-testid": testId, children });
|
|
17
|
-
};
|
|
18
|
-
var Grid_default = Grid;
|
|
19
|
-
|
|
20
|
-
// src/Grid/index.ts
|
|
21
|
-
var Grid_default2 = Grid_default;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
exports.Grid_default = Grid_default; exports.Grid_default2 = Grid_default2;
|
|
27
|
-
//# sourceMappingURL=chunk-LAHYQUKQ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Grid/Grid.tsx","../src/Grid/index.ts"],"names":["Grid_default"],"mappings":";;;;;;;;AAsBI;AApBJ,OAAO,QAAQ;AAcf,IAAM,OAAO,CAAC;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AACX,MAAiB;AACf,SACE,4CAAC,SAAI,WAAW,GAAG,cAAc,SAAS,GAAG,eAAa,QACvD,UACH;AAEJ;AAEA,IAAO,eAAQ;;;ACtBf,IAAOA,gBAAQ","sourcesContent":["import type { ReactNode } from 'react';\n\nimport cn from 'classnames';\n\nexport interface GridProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Defines the default grid for form components\n */\nconst Grid = ({\n children = null,\n className = undefined,\n testId = undefined,\n}: GridProps) => {\n return (\n <div className={cn('grid gap-6', className)} data-testid={testId}>\n {children}\n </div>\n );\n};\n\nexport default Grid;\n","import Grid from './Grid';\n\nexport type { GridProps } from './Grid';\n\nexport { Grid };\n\nexport default Grid;\n"]}
|