@fuf-stack/uniform 0.0.2 → 0.0.4
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 +5 -263
- package/dist/Form/index.cjs.map +1 -1
- package/dist/Form/index.d.cts +3 -2
- package/dist/Form/index.d.ts +3 -2
- package/dist/Form/index.js +6 -10
- package/dist/Form/index.js.map +1 -1
- package/dist/{Form/Form.d.cts → Form-Bv0R3QNk.d.cts} +1 -6
- package/dist/{Form/Form.d.ts → Form-Bv0R3QNk.d.ts} +1 -6
- package/dist/Grid/index.cjs +5 -47
- package/dist/Grid/index.cjs.map +1 -1
- package/dist/Grid/index.d.cts +3 -2
- package/dist/Grid/index.d.ts +3 -2
- package/dist/Grid/index.js +4 -5
- package/dist/Grid/index.js.map +1 -1
- package/dist/{Grid/Grid.d.cts → Grid-DF3L9NF3.d.cts} +1 -1
- package/dist/{Grid/Grid.d.ts → Grid-DF3L9NF3.d.ts} +1 -1
- package/dist/SubmitButton/index.cjs +15 -129
- package/dist/SubmitButton/index.cjs.map +1 -1
- package/dist/SubmitButton/index.d.cts +22 -6
- package/dist/SubmitButton/index.d.ts +22 -6
- package/dist/SubmitButton/index.js +37 -6
- package/dist/SubmitButton/index.js.map +1 -1
- package/dist/{chunk-KY2KCXOO.js → chunk-4MEKDDB2.js} +6 -2
- package/dist/chunk-4MEKDDB2.js.map +1 -0
- package/dist/chunk-BBB4FEY6.cjs +22 -0
- package/dist/chunk-BBB4FEY6.cjs.map +1 -0
- package/dist/{chunk-PMNBGDEZ.js → chunk-BCMPSLSG.js} +21 -7
- package/dist/chunk-BCMPSLSG.js.map +1 -0
- package/dist/{chunk-AV26PIKH.js → chunk-BQUVQMFA.js} +79 -3
- package/dist/chunk-BQUVQMFA.js.map +1 -0
- package/dist/chunk-II57W3V2.cjs +158 -0
- package/dist/chunk-II57W3V2.cjs.map +1 -0
- package/dist/{chunk-WIY7KIHU.js → chunk-V46BHM2U.js} +4 -4
- package/dist/chunk-V46BHM2U.js.map +1 -0
- package/dist/chunk-WQRM7G4C.cjs +87 -0
- package/dist/chunk-WQRM7G4C.cjs.map +1 -0
- package/dist/chunk-ZPFKVKGV.cjs +20 -0
- package/dist/chunk-ZPFKVKGV.cjs.map +1 -0
- package/dist/helpers/index.cjs +7 -0
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.cts +5 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.js +7 -0
- package/dist/hooks/index.cjs +4 -123
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +40 -4
- package/dist/hooks/index.d.ts +40 -4
- package/dist/hooks/index.js +2 -4
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +13 -0
- package/dist/partials/FieldCopyTestIdButton/index.cjs +14 -47
- package/dist/partials/FieldCopyTestIdButton/index.cjs.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +6 -3
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +6 -3
- package/dist/partials/FieldCopyTestIdButton/index.js +29 -3
- package/dist/partials/FieldCopyTestIdButton/index.js.map +1 -1
- package/dist/partials/FieldValidationError/index.cjs +9 -56
- package/dist/partials/FieldValidationError/index.cjs.map +1 -1
- package/dist/partials/FieldValidationError/index.d.cts +10 -4
- package/dist/partials/FieldValidationError/index.d.ts +10 -4
- package/dist/partials/FieldValidationError/index.js +35 -3
- package/dist/partials/FieldValidationError/index.js.map +1 -1
- package/package.json +45 -10
- package/dist/Form/Form.cjs +0 -269
- package/dist/Form/Form.cjs.map +0 -1
- package/dist/Form/Form.js +0 -14
- package/dist/Form/subcomponents/FormContext.cjs +0 -53
- package/dist/Form/subcomponents/FormContext.cjs.map +0 -1
- package/dist/Form/subcomponents/FormContext.d.cts +0 -20
- package/dist/Form/subcomponents/FormContext.d.ts +0 -20
- package/dist/Form/subcomponents/FormContext.js +0 -9
- package/dist/Form/subcomponents/FormDebugViewer.cjs +0 -197
- package/dist/Form/subcomponents/FormDebugViewer.cjs.map +0 -1
- package/dist/Form/subcomponents/FormDebugViewer.d.cts +0 -10
- package/dist/Form/subcomponents/FormDebugViewer.d.ts +0 -10
- package/dist/Form/subcomponents/FormDebugViewer.js +0 -11
- package/dist/Form/subcomponents/FormDebugViewer.js.map +0 -1
- package/dist/Grid/Grid.cjs +0 -46
- package/dist/Grid/Grid.cjs.map +0 -1
- package/dist/Grid/Grid.js +0 -7
- package/dist/Grid/Grid.js.map +0 -1
- package/dist/SubmitButton/SubmitButton.cjs +0 -154
- package/dist/SubmitButton/SubmitButton.cjs.map +0 -1
- package/dist/SubmitButton/SubmitButton.d.cts +0 -24
- package/dist/SubmitButton/SubmitButton.d.ts +0 -24
- package/dist/SubmitButton/SubmitButton.js +0 -11
- package/dist/SubmitButton/SubmitButton.js.map +0 -1
- package/dist/chunk-AV26PIKH.js.map +0 -1
- package/dist/chunk-BJ36HK7L.js +0 -42
- package/dist/chunk-BJ36HK7L.js.map +0 -1
- package/dist/chunk-EDUZKOTL.js +0 -41
- package/dist/chunk-EDUZKOTL.js.map +0 -1
- package/dist/chunk-GATZOHQ6.js +0 -1
- package/dist/chunk-GATZOHQ6.js.map +0 -1
- package/dist/chunk-IQVKBQ7W.js +0 -19
- package/dist/chunk-IQVKBQ7W.js.map +0 -1
- package/dist/chunk-KY2KCXOO.js.map +0 -1
- package/dist/chunk-PMNBGDEZ.js.map +0 -1
- package/dist/chunk-UMTFPEVF.js +0 -34
- package/dist/chunk-UMTFPEVF.js.map +0 -1
- package/dist/chunk-WIY7KIHU.js.map +0 -1
- package/dist/chunk-X4VXTRJB.js +0 -74
- package/dist/chunk-X4VXTRJB.js.map +0 -1
- package/dist/helpers/slugify.cjs +0 -52
- package/dist/helpers/slugify.cjs.map +0 -1
- package/dist/helpers/slugify.d.cts +0 -5
- package/dist/helpers/slugify.d.ts +0 -5
- package/dist/helpers/slugify.js +0 -7
- package/dist/helpers/slugify.js.map +0 -1
- package/dist/hooks/useFormContext/useFormContext.cjs +0 -127
- package/dist/hooks/useFormContext/useFormContext.cjs.map +0 -1
- package/dist/hooks/useFormContext/useFormContext.d.cts +0 -40
- package/dist/hooks/useFormContext/useFormContext.d.ts +0 -40
- package/dist/hooks/useFormContext/useFormContext.js +0 -11
- package/dist/hooks/useFormContext/useFormContext.js.map +0 -1
- package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.cjs +0 -64
- package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.cjs.map +0 -1
- package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.d.cts +0 -9
- package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.d.ts +0 -9
- package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.js +0 -7
- package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.js.map +0 -1
- package/dist/partials/FieldValidationError/FieldValidationError.cjs +0 -87
- package/dist/partials/FieldValidationError/FieldValidationError.cjs.map +0 -1
- package/dist/partials/FieldValidationError/FieldValidationError.d.cts +0 -13
- package/dist/partials/FieldValidationError/FieldValidationError.d.ts +0 -13
- package/dist/partials/FieldValidationError/FieldValidationError.js +0 -8
- package/dist/partials/FieldValidationError/FieldValidationError.js.map +0 -1
- /package/dist/{Form/Form.js.map → helpers/index.js.map} +0 -0
- /package/dist/{Form/subcomponents/FormContext.js.map → index.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Form_default
|
|
3
|
+
} from "./chunk-BQUVQMFA.js";
|
|
4
|
+
import {
|
|
5
|
+
Grid_default
|
|
6
|
+
} from "./chunk-4MEKDDB2.js";
|
|
7
|
+
import "./chunk-BCMPSLSG.js";
|
|
8
|
+
import "./chunk-V46BHM2U.js";
|
|
9
|
+
export {
|
|
10
|
+
Form_default as Form,
|
|
11
|
+
Grid_default as Grid
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,48 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/partials/FieldCopyTestIdButton/index.ts
|
|
31
|
-
var FieldCopyTestIdButton_exports = {};
|
|
32
|
-
__export(FieldCopyTestIdButton_exports, {
|
|
33
|
-
default: () => FieldCopyTestIdButton_default2
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(FieldCopyTestIdButton_exports);
|
|
36
|
-
|
|
37
|
-
// src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx
|
|
38
|
-
var import_fa6 = require("react-icons/fa6");
|
|
39
|
-
var import_classnames = __toESM(require("classnames"), 1);
|
|
40
|
-
var import_Button = __toESM(require("@fuf-stack/pixels/Button"), 1);
|
|
41
|
-
var import_useLocalStorage = __toESM(require("@fuf-stack/pixels/hooks/useLocalStorage"), 1);
|
|
42
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx
|
|
2
|
+
var _fa6 = require('react-icons/fa6');
|
|
3
|
+
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
4
|
+
var _Button = require('@fuf-stack/pixels/Button'); var _Button2 = _interopRequireDefault(_Button);
|
|
5
|
+
var _useLocalStorage = require('@fuf-stack/pixels/hooks/useLocalStorage'); var _useLocalStorage2 = _interopRequireDefault(_useLocalStorage);
|
|
6
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
43
7
|
var LOCALSTORAGE_DEBUG_KEY = "uniform:form-debug-enabled";
|
|
44
8
|
var TestIdDebug = ({ className = void 0, testId }) => {
|
|
45
|
-
const [debug] = (0,
|
|
9
|
+
const [debug] = _useLocalStorage2.default.call(void 0, LOCALSTORAGE_DEBUG_KEY, false);
|
|
46
10
|
const copyToClipboard = () => {
|
|
47
11
|
navigator.clipboard.writeText(testId).catch((err) => {
|
|
48
12
|
console.error("Error copying TestId to clipboard", err);
|
|
@@ -51,13 +15,13 @@ var TestIdDebug = ({ className = void 0, testId }) => {
|
|
|
51
15
|
if (!debug) {
|
|
52
16
|
return null;
|
|
53
17
|
}
|
|
54
|
-
return /* @__PURE__ */ (0,
|
|
55
|
-
|
|
18
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
19
|
+
_Button2.default,
|
|
56
20
|
{
|
|
57
|
-
className: (0,
|
|
21
|
+
className: _classnames2.default.call(void 0, className, "pointer-events-auto"),
|
|
58
22
|
variant: "light",
|
|
59
23
|
onClick: copyToClipboard,
|
|
60
|
-
icon: /* @__PURE__ */ (0,
|
|
24
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa6.FaBullseye, {}),
|
|
61
25
|
size: "sm"
|
|
62
26
|
}
|
|
63
27
|
);
|
|
@@ -66,4 +30,7 @@ var FieldCopyTestIdButton_default = TestIdDebug;
|
|
|
66
30
|
|
|
67
31
|
// src/partials/FieldCopyTestIdButton/index.ts
|
|
68
32
|
var FieldCopyTestIdButton_default2 = FieldCopyTestIdButton_default;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.default = FieldCopyTestIdButton_default2;
|
|
69
36
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/
|
|
1
|
+
{"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../../../src/partials/FieldCopyTestIdButton/index.ts"],"names":["FieldCopyTestIdButton_default"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,OAAO,QAAQ;AAEf,OAAO,YAAY;AACnB,OAAO,qBAAqB;AA2BhB;AApBZ,IAAM,yBAAyB;AAE/B,IAAM,cAAc,CAAC,EAAE,YAAY,QAAW,OAAO,MAAsB;AACzE,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,oBAAC,cAAW;AAAA,MAClB,MAAK;AAAA;AAAA,EACP;AAEJ;AACA,IAAO,gCAAQ;;;ACnCf,IAAOA,iCAAQ","sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport cn from 'classnames';\n\nimport Button from '@fuf-stack/pixels/Button';\nimport useLocalStorage from '@fuf-stack/pixels/hooks/useLocalStorage';\n\ninterface FormDebugProps {\n className?: string;\n testId: string;\n}\n\nconst LOCALSTORAGE_DEBUG_KEY = 'uniform:form-debug-enabled';\n\nconst TestIdDebug = ({ className = undefined, testId }: FormDebugProps) => {\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 TestIdDebug;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport default FieldCopyTestIdButton;\n"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import 'react/jsx-runtime';
|
|
3
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
2
|
|
|
3
|
+
interface FormDebugProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
testId: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TestIdDebug: ({ className, testId }: FormDebugProps) => react_jsx_runtime.JSX.Element | null;
|
|
5
8
|
|
|
6
9
|
export { TestIdDebug as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import 'react/jsx-runtime';
|
|
3
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
2
|
|
|
3
|
+
interface FormDebugProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
testId: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TestIdDebug: ({ className, testId }: FormDebugProps) => react_jsx_runtime.JSX.Element | null;
|
|
5
8
|
|
|
6
9
|
export { TestIdDebug as default };
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx
|
|
2
|
+
import { FaBullseye } from "react-icons/fa6";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import Button from "@fuf-stack/pixels/Button";
|
|
5
|
+
import useLocalStorage from "@fuf-stack/pixels/hooks/useLocalStorage";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var LOCALSTORAGE_DEBUG_KEY = "uniform:form-debug-enabled";
|
|
8
|
+
var TestIdDebug = ({ className = void 0, testId }) => {
|
|
9
|
+
const [debug] = useLocalStorage(LOCALSTORAGE_DEBUG_KEY, false);
|
|
10
|
+
const copyToClipboard = () => {
|
|
11
|
+
navigator.clipboard.writeText(testId).catch((err) => {
|
|
12
|
+
console.error("Error copying TestId to clipboard", err);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
if (!debug) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Button,
|
|
20
|
+
{
|
|
21
|
+
className: cn(className, "pointer-events-auto"),
|
|
22
|
+
variant: "light",
|
|
23
|
+
onClick: copyToClipboard,
|
|
24
|
+
icon: /* @__PURE__ */ jsx(FaBullseye, {}),
|
|
25
|
+
size: "sm"
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
var FieldCopyTestIdButton_default = TestIdDebug;
|
|
4
30
|
|
|
5
31
|
// src/partials/FieldCopyTestIdButton/index.ts
|
|
6
32
|
var FieldCopyTestIdButton_default2 = FieldCopyTestIdButton_default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport default FieldCopyTestIdButton;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../../../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport cn from 'classnames';\n\nimport Button from '@fuf-stack/pixels/Button';\nimport useLocalStorage from '@fuf-stack/pixels/hooks/useLocalStorage';\n\ninterface FormDebugProps {\n className?: string;\n testId: string;\n}\n\nconst LOCALSTORAGE_DEBUG_KEY = 'uniform:form-debug-enabled';\n\nconst TestIdDebug = ({ className = undefined, testId }: FormDebugProps) => {\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 TestIdDebug;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport default FieldCopyTestIdButton;\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,OAAO,QAAQ;AAEf,OAAO,YAAY;AACnB,OAAO,qBAAqB;AA2BhB;AApBZ,IAAM,yBAAyB;AAE/B,IAAM,cAAc,CAAC,EAAE,YAAY,QAAW,OAAO,MAAsB;AACzE,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,oBAAC,cAAW;AAAA,MAClB,MAAK;AAAA;AAAA,EACP;AAEJ;AACA,IAAO,gCAAQ;;;ACnCf,IAAOA,iCAAQ;","names":["FieldCopyTestIdButton_default"]}
|
|
@@ -1,59 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/partials/FieldValidationError/index.ts
|
|
31
|
-
var FieldValidationError_exports = {};
|
|
32
|
-
__export(FieldValidationError_exports, {
|
|
33
|
-
default: () => FieldValidationError_default2
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(FieldValidationError_exports);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
36
2
|
|
|
37
|
-
|
|
38
|
-
var import_slug = __toESM(require("slug"), 1);
|
|
39
|
-
var slugify_default = (string, options) => {
|
|
40
|
-
const replacement = options?.replacement || "_";
|
|
41
|
-
return (0, import_slug.default)(string, {
|
|
42
|
-
...import_slug.default.defaults.modes.rfc3986,
|
|
43
|
-
charmap: {
|
|
44
|
-
...import_slug.default.defaults.modes.rfc3986.charmap,
|
|
45
|
-
// allow dots by default
|
|
46
|
-
".": ".",
|
|
47
|
-
// convert hyphens to underscores (when replacement is not hyphen)
|
|
48
|
-
...replacement !== "-" ? { "-": "_" } : {}
|
|
49
|
-
},
|
|
50
|
-
replacement,
|
|
51
|
-
...options || {}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
3
|
+
var _chunkBBB4FEY6cjs = require('../../chunk-BBB4FEY6.cjs');
|
|
54
4
|
|
|
55
5
|
// src/partials/FieldValidationError/FieldValidationError.tsx
|
|
56
|
-
var
|
|
6
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
57
7
|
var FieldValidationError = ({
|
|
58
8
|
error,
|
|
59
9
|
testId = void 0
|
|
@@ -71,14 +21,14 @@ var FieldValidationError = ({
|
|
|
71
21
|
const errorArray = JSON.stringify(tmp_errors) !== "[]" ? tmp_errors : error;
|
|
72
22
|
const errorStrings = errorArray.map((e) => e.message);
|
|
73
23
|
const ariaString = `Error: ${errorStrings.join("\n")}`;
|
|
74
|
-
return /* @__PURE__ */ (0,
|
|
24
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
75
25
|
"ul",
|
|
76
26
|
{
|
|
77
|
-
"data-testid":
|
|
27
|
+
"data-testid": _chunkBBB4FEY6cjs.slugify.call(void 0, testId || errorStrings.join()),
|
|
78
28
|
"aria-label": ariaString,
|
|
79
29
|
children: errorStrings.map((errorString, i) => (
|
|
80
30
|
// eslint-disable-next-line react/no-array-index-key
|
|
81
|
-
/* @__PURE__ */ (0,
|
|
31
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: errorString }) }, `error_${i}`)
|
|
82
32
|
))
|
|
83
33
|
}
|
|
84
34
|
);
|
|
@@ -87,4 +37,7 @@ var FieldValidationError_default = FieldValidationError;
|
|
|
87
37
|
|
|
88
38
|
// src/partials/FieldValidationError/index.ts
|
|
89
39
|
var FieldValidationError_default2 = FieldValidationError_default;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.default = FieldValidationError_default2;
|
|
90
43
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/partials/FieldValidationError/
|
|
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,oBAAC,QACC,8BAAC,SAAK,uBAAY,KADX,SAAS,CAAC,EAEnB;AAAA,OACD;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,+BAAQ;;;AC/Cf,IAAOA,gCAAQ","sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport { slugify } from '../../helpers';\n\ninterface 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 default FieldValidationError;\n"]}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import 'react
|
|
3
|
-
import 'react-hook-form';
|
|
4
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FieldError } from 'react-hook-form';
|
|
5
3
|
|
|
4
|
+
interface FieldValidationErrorProps {
|
|
5
|
+
error: FieldError[] | Record<string, FieldError[]>;
|
|
6
|
+
testId?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders a validation error of a field
|
|
10
|
+
*/
|
|
11
|
+
declare const FieldValidationError: ({ error, testId, }: FieldValidationErrorProps) => react_jsx_runtime.JSX.Element | null;
|
|
6
12
|
|
|
7
13
|
export { FieldValidationError as default };
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import 'react
|
|
3
|
-
import 'react-hook-form';
|
|
4
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FieldError } from 'react-hook-form';
|
|
5
3
|
|
|
4
|
+
interface FieldValidationErrorProps {
|
|
5
|
+
error: FieldError[] | Record<string, FieldError[]>;
|
|
6
|
+
testId?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders a validation error of a field
|
|
10
|
+
*/
|
|
11
|
+
declare const FieldValidationError: ({ error, testId, }: FieldValidationErrorProps) => react_jsx_runtime.JSX.Element | null;
|
|
6
12
|
|
|
7
13
|
export { FieldValidationError as default };
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
|
|
2
|
+
slugify
|
|
3
|
+
} from "../../chunk-V46BHM2U.js";
|
|
4
|
+
|
|
5
|
+
// src/partials/FieldValidationError/FieldValidationError.tsx
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var FieldValidationError = ({
|
|
8
|
+
error,
|
|
9
|
+
testId = void 0
|
|
10
|
+
}) => {
|
|
11
|
+
if (!error) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
let tmp_errors = [];
|
|
15
|
+
if (typeof error === "object" && !(error instanceof Array)) {
|
|
16
|
+
const error_object = error;
|
|
17
|
+
Object.keys(error).forEach((key) => {
|
|
18
|
+
tmp_errors = [...tmp_errors, ...error_object[key]];
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const errorArray = JSON.stringify(tmp_errors) !== "[]" ? tmp_errors : error;
|
|
22
|
+
const errorStrings = errorArray.map((e) => e.message);
|
|
23
|
+
const ariaString = `Error: ${errorStrings.join("\n")}`;
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"ul",
|
|
26
|
+
{
|
|
27
|
+
"data-testid": slugify(testId || errorStrings.join()),
|
|
28
|
+
"aria-label": ariaString,
|
|
29
|
+
children: errorStrings.map((errorString, i) => (
|
|
30
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
31
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("div", { children: errorString }) }, `error_${i}`)
|
|
32
|
+
))
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
var FieldValidationError_default = FieldValidationError;
|
|
5
37
|
|
|
6
38
|
// src/partials/FieldValidationError/index.ts
|
|
7
39
|
var FieldValidationError_default2 = FieldValidationError_default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import FieldValidationError from './FieldValidationError';\n\nexport default FieldValidationError;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/partials/FieldValidationError/FieldValidationError.tsx","../../../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport { slugify } from '../../helpers';\n\ninterface 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 default FieldValidationError;\n"],"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,oBAAC,QACC,8BAAC,SAAK,uBAAY,KADX,SAAS,CAAC,EAEnB;AAAA,OACD;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,+BAAQ;;;AC/Cf,IAAOA,gCAAQ;","names":["FieldValidationError_default"]}
|
package/package.json
CHANGED
|
@@ -1,19 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuf-stack/uniform",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "fuf react form library",
|
|
5
5
|
"author": "Hannes Tiede",
|
|
6
6
|
"homepage": "https://github.com/fuf-stack/uniform#readme",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"type": "module",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"module": "./dist/index.cjs",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.cjs",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./Form": {
|
|
19
|
+
"import": "./dist/Form/index.js",
|
|
20
|
+
"require": "./dist/Form/index.cjs",
|
|
21
|
+
"types": "./dist/Form/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./Grid": {
|
|
24
|
+
"import": "./dist/Grid/index.js",
|
|
25
|
+
"require": "./dist/Grid/index.cjs",
|
|
26
|
+
"types": "./dist/Grid/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./helpers": {
|
|
29
|
+
"import": "./dist/helpers/index.js",
|
|
30
|
+
"require": "./dist/helpers/index.cjs",
|
|
31
|
+
"types": "./dist/helpers/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./hooks": {
|
|
34
|
+
"import": "./dist/hooks/index.js",
|
|
35
|
+
"require": "./dist/hooks/index.cjs",
|
|
36
|
+
"types": "./dist/hooks/index.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./partials/FieldCopyTestIdButton": {
|
|
39
|
+
"import": "./dist/partials/FieldCopyTestIdButton/index.js",
|
|
40
|
+
"require": "./dist/partials/FieldCopyTestIdButton/index.cjs",
|
|
41
|
+
"types": "./dist/partials/FieldCopyTestIdButton/index.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./partials/FieldValidationError": {
|
|
44
|
+
"import": "./dist/partials/FieldValidationError/index.js",
|
|
45
|
+
"require": "./dist/partials/FieldValidationError/index.cjs",
|
|
46
|
+
"types": "./dist/partials/FieldValidationError/index.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"./SubmitButton": {
|
|
49
|
+
"import": "./dist/SubmitButton/index.js",
|
|
50
|
+
"require": "./dist/SubmitButton/index.cjs",
|
|
51
|
+
"types": "./dist/SubmitButton/index.d.ts"
|
|
17
52
|
}
|
|
18
53
|
},
|
|
19
54
|
"files": [
|
|
@@ -61,8 +96,8 @@
|
|
|
61
96
|
"@types/react-dom": "18.2.22",
|
|
62
97
|
"@types/slug": "5.0.8",
|
|
63
98
|
"@repo/storybook-config": "0.0.1",
|
|
64
|
-
"@repo/
|
|
65
|
-
"@repo/
|
|
99
|
+
"@repo/tailwind-config": "0.0.1",
|
|
100
|
+
"@repo/vite-config": "0.0.1"
|
|
66
101
|
},
|
|
67
102
|
"scripts": {
|
|
68
103
|
"test": "vitest ./src"
|