@fuf-stack/uniform 0.0.2

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.
Files changed (112) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Form/Form.cjs +269 -0
  3. package/dist/Form/Form.cjs.map +1 -0
  4. package/dist/Form/Form.d.cts +34 -0
  5. package/dist/Form/Form.d.ts +34 -0
  6. package/dist/Form/Form.js +14 -0
  7. package/dist/Form/Form.js.map +1 -0
  8. package/dist/Form/index.cjs +269 -0
  9. package/dist/Form/index.cjs.map +1 -0
  10. package/dist/Form/index.d.cts +9 -0
  11. package/dist/Form/index.d.ts +9 -0
  12. package/dist/Form/index.js +15 -0
  13. package/dist/Form/index.js.map +1 -0
  14. package/dist/Form/subcomponents/FormContext.cjs +53 -0
  15. package/dist/Form/subcomponents/FormContext.cjs.map +1 -0
  16. package/dist/Form/subcomponents/FormContext.d.cts +20 -0
  17. package/dist/Form/subcomponents/FormContext.d.ts +20 -0
  18. package/dist/Form/subcomponents/FormContext.js +9 -0
  19. package/dist/Form/subcomponents/FormContext.js.map +1 -0
  20. package/dist/Form/subcomponents/FormDebugViewer.cjs +197 -0
  21. package/dist/Form/subcomponents/FormDebugViewer.cjs.map +1 -0
  22. package/dist/Form/subcomponents/FormDebugViewer.d.cts +10 -0
  23. package/dist/Form/subcomponents/FormDebugViewer.d.ts +10 -0
  24. package/dist/Form/subcomponents/FormDebugViewer.js +11 -0
  25. package/dist/Form/subcomponents/FormDebugViewer.js.map +1 -0
  26. package/dist/Grid/Grid.cjs +46 -0
  27. package/dist/Grid/Grid.cjs.map +1 -0
  28. package/dist/Grid/Grid.d.cts +17 -0
  29. package/dist/Grid/Grid.d.ts +17 -0
  30. package/dist/Grid/Grid.js +7 -0
  31. package/dist/Grid/Grid.js.map +1 -0
  32. package/dist/Grid/index.cjs +51 -0
  33. package/dist/Grid/index.cjs.map +1 -0
  34. package/dist/Grid/index.d.cts +7 -0
  35. package/dist/Grid/index.d.ts +7 -0
  36. package/dist/Grid/index.js +10 -0
  37. package/dist/Grid/index.js.map +1 -0
  38. package/dist/SubmitButton/SubmitButton.cjs +154 -0
  39. package/dist/SubmitButton/SubmitButton.cjs.map +1 -0
  40. package/dist/SubmitButton/SubmitButton.d.cts +24 -0
  41. package/dist/SubmitButton/SubmitButton.d.ts +24 -0
  42. package/dist/SubmitButton/SubmitButton.js +11 -0
  43. package/dist/SubmitButton/SubmitButton.js.map +1 -0
  44. package/dist/SubmitButton/index.cjs +159 -0
  45. package/dist/SubmitButton/index.cjs.map +1 -0
  46. package/dist/SubmitButton/index.d.cts +8 -0
  47. package/dist/SubmitButton/index.d.ts +8 -0
  48. package/dist/SubmitButton/index.js +14 -0
  49. package/dist/SubmitButton/index.js.map +1 -0
  50. package/dist/chunk-AV26PIKH.js +82 -0
  51. package/dist/chunk-AV26PIKH.js.map +1 -0
  52. package/dist/chunk-BJ36HK7L.js +42 -0
  53. package/dist/chunk-BJ36HK7L.js.map +1 -0
  54. package/dist/chunk-EDUZKOTL.js +41 -0
  55. package/dist/chunk-EDUZKOTL.js.map +1 -0
  56. package/dist/chunk-GATZOHQ6.js +1 -0
  57. package/dist/chunk-GATZOHQ6.js.map +1 -0
  58. package/dist/chunk-IQVKBQ7W.js +19 -0
  59. package/dist/chunk-IQVKBQ7W.js.map +1 -0
  60. package/dist/chunk-KY2KCXOO.js +16 -0
  61. package/dist/chunk-KY2KCXOO.js.map +1 -0
  62. package/dist/chunk-PMNBGDEZ.js +73 -0
  63. package/dist/chunk-PMNBGDEZ.js.map +1 -0
  64. package/dist/chunk-UMTFPEVF.js +34 -0
  65. package/dist/chunk-UMTFPEVF.js.map +1 -0
  66. package/dist/chunk-WIY7KIHU.js +22 -0
  67. package/dist/chunk-WIY7KIHU.js.map +1 -0
  68. package/dist/chunk-X4VXTRJB.js +74 -0
  69. package/dist/chunk-X4VXTRJB.js.map +1 -0
  70. package/dist/helpers/slugify.cjs +52 -0
  71. package/dist/helpers/slugify.cjs.map +1 -0
  72. package/dist/helpers/slugify.d.cts +5 -0
  73. package/dist/helpers/slugify.d.ts +5 -0
  74. package/dist/helpers/slugify.js +7 -0
  75. package/dist/helpers/slugify.js.map +1 -0
  76. package/dist/hooks/index.cjs +129 -0
  77. package/dist/hooks/index.cjs.map +1 -0
  78. package/dist/hooks/index.d.cts +4 -0
  79. package/dist/hooks/index.d.ts +4 -0
  80. package/dist/hooks/index.js +12 -0
  81. package/dist/hooks/index.js.map +1 -0
  82. package/dist/hooks/useFormContext/useFormContext.cjs +127 -0
  83. package/dist/hooks/useFormContext/useFormContext.cjs.map +1 -0
  84. package/dist/hooks/useFormContext/useFormContext.d.cts +40 -0
  85. package/dist/hooks/useFormContext/useFormContext.d.ts +40 -0
  86. package/dist/hooks/useFormContext/useFormContext.js +11 -0
  87. package/dist/hooks/useFormContext/useFormContext.js.map +1 -0
  88. package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.cjs +64 -0
  89. package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.cjs.map +1 -0
  90. package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.d.cts +9 -0
  91. package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.d.ts +9 -0
  92. package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.js +7 -0
  93. package/dist/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.js.map +1 -0
  94. package/dist/partials/FieldCopyTestIdButton/index.cjs +69 -0
  95. package/dist/partials/FieldCopyTestIdButton/index.cjs.map +1 -0
  96. package/dist/partials/FieldCopyTestIdButton/index.d.cts +6 -0
  97. package/dist/partials/FieldCopyTestIdButton/index.d.ts +6 -0
  98. package/dist/partials/FieldCopyTestIdButton/index.js +10 -0
  99. package/dist/partials/FieldCopyTestIdButton/index.js.map +1 -0
  100. package/dist/partials/FieldValidationError/FieldValidationError.cjs +87 -0
  101. package/dist/partials/FieldValidationError/FieldValidationError.cjs.map +1 -0
  102. package/dist/partials/FieldValidationError/FieldValidationError.d.cts +13 -0
  103. package/dist/partials/FieldValidationError/FieldValidationError.d.ts +13 -0
  104. package/dist/partials/FieldValidationError/FieldValidationError.js +8 -0
  105. package/dist/partials/FieldValidationError/FieldValidationError.js.map +1 -0
  106. package/dist/partials/FieldValidationError/index.cjs +90 -0
  107. package/dist/partials/FieldValidationError/index.cjs.map +1 -0
  108. package/dist/partials/FieldValidationError/index.d.cts +7 -0
  109. package/dist/partials/FieldValidationError/index.d.ts +7 -0
  110. package/dist/partials/FieldValidationError/index.js +11 -0
  111. package/dist/partials/FieldValidationError/index.js.map +1 -0
  112. package/package.json +70 -0
@@ -0,0 +1,64 @@
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/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx
31
+ var FieldCopyTestIdButton_exports = {};
32
+ __export(FieldCopyTestIdButton_exports, {
33
+ default: () => FieldCopyTestIdButton_default
34
+ });
35
+ module.exports = __toCommonJS(FieldCopyTestIdButton_exports);
36
+ var import_fa6 = require("react-icons/fa6");
37
+ var import_classnames = __toESM(require("classnames"), 1);
38
+ var import_Button = __toESM(require("@fuf-stack/pixels/Button"), 1);
39
+ var import_useLocalStorage = __toESM(require("@fuf-stack/pixels/hooks/useLocalStorage"), 1);
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var LOCALSTORAGE_DEBUG_KEY = "uniform:form-debug-enabled";
42
+ var TestIdDebug = ({ className = void 0, testId }) => {
43
+ const [debug] = (0, import_useLocalStorage.default)(LOCALSTORAGE_DEBUG_KEY, false);
44
+ const copyToClipboard = () => {
45
+ navigator.clipboard.writeText(testId).catch((err) => {
46
+ console.error("Error copying TestId to clipboard", err);
47
+ });
48
+ };
49
+ if (!debug) {
50
+ return null;
51
+ }
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ import_Button.default,
54
+ {
55
+ className: (0, import_classnames.default)(className, "pointer-events-auto"),
56
+ variant: "light",
57
+ onClick: copyToClipboard,
58
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa6.FaBullseye, {}),
59
+ size: "sm"
60
+ }
61
+ );
62
+ };
63
+ var FieldCopyTestIdButton_default = TestIdDebug;
64
+ //# sourceMappingURL=FieldCopyTestIdButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx"],"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA2B;AAE3B,wBAAe;AAEf,oBAAmB;AACnB,6BAA4B;AA2BhB;AApBZ,IAAM,yBAAyB;AAE/B,IAAM,cAAc,CAAC,EAAE,YAAY,QAAW,OAAO,MAAsB;AACzE,QAAM,CAAC,KAAK,QAAI,uBAAAA,SAAgB,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,cAAAC;AAAA,IAAA;AAAA,MACC,eAAW,kBAAAC,SAAG,WAAW,qBAAqB;AAAA,MAC9C,SAAQ;AAAA,MACR,SAAS;AAAA,MACT,MAAM,4CAAC,yBAAW;AAAA,MAClB,MAAK;AAAA;AAAA,EACP;AAEJ;AACA,IAAO,gCAAQ;","names":["useLocalStorage","Button","cn"]}
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface FormDebugProps {
4
+ className?: string;
5
+ testId: string;
6
+ }
7
+ declare const TestIdDebug: ({ className, testId }: FormDebugProps) => react_jsx_runtime.JSX.Element | null;
8
+
9
+ export { TestIdDebug as default };
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface FormDebugProps {
4
+ className?: string;
5
+ testId: string;
6
+ }
7
+ declare const TestIdDebug: ({ className, testId }: FormDebugProps) => react_jsx_runtime.JSX.Element | null;
8
+
9
+ export { TestIdDebug as default };
@@ -0,0 +1,7 @@
1
+ import {
2
+ FieldCopyTestIdButton_default
3
+ } from "../../chunk-UMTFPEVF.js";
4
+ export {
5
+ FieldCopyTestIdButton_default as default
6
+ };
7
+ //# sourceMappingURL=FieldCopyTestIdButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,69 @@
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/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");
43
+ var LOCALSTORAGE_DEBUG_KEY = "uniform:form-debug-enabled";
44
+ var TestIdDebug = ({ className = void 0, testId }) => {
45
+ const [debug] = (0, import_useLocalStorage.default)(LOCALSTORAGE_DEBUG_KEY, false);
46
+ const copyToClipboard = () => {
47
+ navigator.clipboard.writeText(testId).catch((err) => {
48
+ console.error("Error copying TestId to clipboard", err);
49
+ });
50
+ };
51
+ if (!debug) {
52
+ return null;
53
+ }
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ import_Button.default,
56
+ {
57
+ className: (0, import_classnames.default)(className, "pointer-events-auto"),
58
+ variant: "light",
59
+ onClick: copyToClipboard,
60
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa6.FaBullseye, {}),
61
+ size: "sm"
62
+ }
63
+ );
64
+ };
65
+ var FieldCopyTestIdButton_default = TestIdDebug;
66
+
67
+ // src/partials/FieldCopyTestIdButton/index.ts
68
+ var FieldCopyTestIdButton_default2 = FieldCopyTestIdButton_default;
69
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/index.ts","../../../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx"],"sourcesContent":["import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport default FieldCopyTestIdButton;\n","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,iBAA2B;AAE3B,wBAAe;AAEf,oBAAmB;AACnB,6BAA4B;AA2BhB;AApBZ,IAAM,yBAAyB;AAE/B,IAAM,cAAc,CAAC,EAAE,YAAY,QAAW,OAAO,MAAsB;AACzE,QAAM,CAAC,KAAK,QAAI,uBAAAC,SAAgB,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,cAAAC;AAAA,IAAA;AAAA,MACC,eAAW,kBAAAC,SAAG,WAAW,qBAAqB;AAAA,MAC9C,SAAQ;AAAA,MACR,SAAS;AAAA,MACT,MAAM,4CAAC,yBAAW;AAAA,MAClB,MAAK;AAAA;AAAA,EACP;AAEJ;AACA,IAAO,gCAAQ;;;ADnCf,IAAOC,iCAAQ;","names":["FieldCopyTestIdButton_default","useLocalStorage","Button","cn","FieldCopyTestIdButton_default"]}
@@ -0,0 +1,6 @@
1
+ import TestIdDebug from './FieldCopyTestIdButton.cjs';
2
+ import 'react/jsx-runtime';
3
+
4
+
5
+
6
+ export { TestIdDebug as default };
@@ -0,0 +1,6 @@
1
+ import TestIdDebug from './FieldCopyTestIdButton.js';
2
+ import 'react/jsx-runtime';
3
+
4
+
5
+
6
+ export { TestIdDebug as default };
@@ -0,0 +1,10 @@
1
+ import {
2
+ FieldCopyTestIdButton_default
3
+ } from "../../chunk-UMTFPEVF.js";
4
+
5
+ // src/partials/FieldCopyTestIdButton/index.ts
6
+ var FieldCopyTestIdButton_default2 = FieldCopyTestIdButton_default;
7
+ export {
8
+ FieldCopyTestIdButton_default2 as default
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport default FieldCopyTestIdButton;\n"],"mappings":";;;;;AAEA,IAAOA,iCAAQ;","names":["FieldCopyTestIdButton_default"]}
@@ -0,0 +1,87 @@
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/FieldValidationError.tsx
31
+ var FieldValidationError_exports = {};
32
+ __export(FieldValidationError_exports, {
33
+ default: () => FieldValidationError_default
34
+ });
35
+ module.exports = __toCommonJS(FieldValidationError_exports);
36
+
37
+ // src/helpers/slugify.ts
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
+ };
54
+
55
+ // src/partials/FieldValidationError/FieldValidationError.tsx
56
+ var import_jsx_runtime = require("react/jsx-runtime");
57
+ var FieldValidationError = ({
58
+ error,
59
+ testId = void 0
60
+ }) => {
61
+ if (!error) {
62
+ return null;
63
+ }
64
+ let tmp_errors = [];
65
+ if (typeof error === "object" && !(error instanceof Array)) {
66
+ const error_object = error;
67
+ Object.keys(error).forEach((key) => {
68
+ tmp_errors = [...tmp_errors, ...error_object[key]];
69
+ });
70
+ }
71
+ const errorArray = JSON.stringify(tmp_errors) !== "[]" ? tmp_errors : error;
72
+ const errorStrings = errorArray.map((e) => e.message);
73
+ const ariaString = `Error: ${errorStrings.join("\n")}`;
74
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ "ul",
76
+ {
77
+ "data-testid": slugify_default(testId || errorStrings.join()),
78
+ "aria-label": ariaString,
79
+ children: errorStrings.map((errorString, i) => (
80
+ // eslint-disable-next-line react/no-array-index-key
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: errorString }) }, `error_${i}`)
82
+ ))
83
+ }
84
+ );
85
+ };
86
+ var FieldValidationError_default = FieldValidationError;
87
+ //# sourceMappingURL=FieldValidationError.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/partials/FieldValidationError/FieldValidationError.tsx","../../../src/helpers/slugify.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport slugify from '../../helpers/slugify';\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 type { Options as SlugOptions } from 'slug';\n\nimport slug from 'slug';\n\nexport default (string: string, options?: SlugOptions) => {\n const replacement = options?.replacement || '_';\n return slug(string, {\n ...slug.defaults.modes.rfc3986,\n charmap: {\n ...slug.defaults.modes.rfc3986.charmap,\n // allow dots by default\n '.': '.',\n // convert hyphens to underscores (when replacement is not hyphen)\n ...(replacement !== '-' ? { '-': '_' } : {}),\n },\n replacement,\n ...(options || {}),\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,kBAAiB;AAEjB,IAAO,kBAAQ,CAAC,QAAgB,YAA0B;AACxD,QAAM,cAAc,SAAS,eAAe;AAC5C,aAAO,YAAAA,SAAK,QAAQ;AAAA,IAClB,GAAG,YAAAA,QAAK,SAAS,MAAM;AAAA,IACvB,SAAS;AAAA,MACP,GAAG,YAAAA,QAAK,SAAS,MAAM,QAAQ;AAAA;AAAA,MAE/B,KAAK;AAAA;AAAA,MAEL,GAAI,gBAAgB,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,GAAI,WAAW,CAAC;AAAA,EAClB,CAAC;AACH;;;ADwBU;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,gBAAQ,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;","names":["slug"]}
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldError } from 'react-hook-form';
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;
12
+
13
+ export { FieldValidationError as default };
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FieldError } from 'react-hook-form';
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;
12
+
13
+ export { FieldValidationError as default };
@@ -0,0 +1,8 @@
1
+ import {
2
+ FieldValidationError_default
3
+ } from "../../chunk-EDUZKOTL.js";
4
+ import "../../chunk-WIY7KIHU.js";
5
+ export {
6
+ FieldValidationError_default as default
7
+ };
8
+ //# sourceMappingURL=FieldValidationError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,90 @@
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);
36
+
37
+ // src/helpers/slugify.ts
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
+ };
54
+
55
+ // src/partials/FieldValidationError/FieldValidationError.tsx
56
+ var import_jsx_runtime = require("react/jsx-runtime");
57
+ var FieldValidationError = ({
58
+ error,
59
+ testId = void 0
60
+ }) => {
61
+ if (!error) {
62
+ return null;
63
+ }
64
+ let tmp_errors = [];
65
+ if (typeof error === "object" && !(error instanceof Array)) {
66
+ const error_object = error;
67
+ Object.keys(error).forEach((key) => {
68
+ tmp_errors = [...tmp_errors, ...error_object[key]];
69
+ });
70
+ }
71
+ const errorArray = JSON.stringify(tmp_errors) !== "[]" ? tmp_errors : error;
72
+ const errorStrings = errorArray.map((e) => e.message);
73
+ const ariaString = `Error: ${errorStrings.join("\n")}`;
74
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ "ul",
76
+ {
77
+ "data-testid": slugify_default(testId || errorStrings.join()),
78
+ "aria-label": ariaString,
79
+ children: errorStrings.map((errorString, i) => (
80
+ // eslint-disable-next-line react/no-array-index-key
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: errorString }) }, `error_${i}`)
82
+ ))
83
+ }
84
+ );
85
+ };
86
+ var FieldValidationError_default = FieldValidationError;
87
+
88
+ // src/partials/FieldValidationError/index.ts
89
+ var FieldValidationError_default2 = FieldValidationError_default;
90
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/partials/FieldValidationError/index.ts","../../../src/helpers/slugify.ts","../../../src/partials/FieldValidationError/FieldValidationError.tsx"],"sourcesContent":["import FieldValidationError from './FieldValidationError';\n\nexport default FieldValidationError;\n","import type { Options as SlugOptions } from 'slug';\n\nimport slug from 'slug';\n\nexport default (string: string, options?: SlugOptions) => {\n const replacement = options?.replacement || '_';\n return slug(string, {\n ...slug.defaults.modes.rfc3986,\n charmap: {\n ...slug.defaults.modes.rfc3986.charmap,\n // allow dots by default\n '.': '.',\n // convert hyphens to underscores (when replacement is not hyphen)\n ...(replacement !== '-' ? { '-': '_' } : {}),\n },\n replacement,\n ...(options || {}),\n });\n};\n","import type { FieldError } from 'react-hook-form';\n\nimport slugify from '../../helpers/slugify';\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACEA,kBAAiB;AAEjB,IAAO,kBAAQ,CAAC,QAAgB,YAA0B;AACxD,QAAM,cAAc,SAAS,eAAe;AAC5C,aAAO,YAAAC,SAAK,QAAQ;AAAA,IAClB,GAAG,YAAAA,QAAK,SAAS,MAAM;AAAA,IACvB,SAAS;AAAA,MACP,GAAG,YAAAA,QAAK,SAAS,MAAM,QAAQ;AAAA;AAAA,MAE/B,KAAK;AAAA;AAAA,MAEL,GAAI,gBAAgB,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC;AAAA,IAC5C;AAAA,IACA;AAAA,IACA,GAAI,WAAW,CAAC;AAAA,EAClB,CAAC;AACH;;;ACwBU;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,gBAAQ,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;;;AF/Cf,IAAOC,gCAAQ;","names":["FieldValidationError_default","slug","FieldValidationError_default"]}
@@ -0,0 +1,7 @@
1
+ import FieldValidationError from './FieldValidationError.cjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react-hook-form';
4
+
5
+
6
+
7
+ export { FieldValidationError as default };
@@ -0,0 +1,7 @@
1
+ import FieldValidationError from './FieldValidationError.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react-hook-form';
4
+
5
+
6
+
7
+ export { FieldValidationError as default };
@@ -0,0 +1,11 @@
1
+ import {
2
+ FieldValidationError_default
3
+ } from "../../chunk-EDUZKOTL.js";
4
+ import "../../chunk-WIY7KIHU.js";
5
+
6
+ // src/partials/FieldValidationError/index.ts
7
+ var FieldValidationError_default2 = FieldValidationError_default;
8
+ export {
9
+ FieldValidationError_default2 as default
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import FieldValidationError from './FieldValidationError';\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;AAEA,IAAOA,gCAAQ;","names":["FieldValidationError_default"]}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@fuf-stack/uniform",
3
+ "version": "0.0.2",
4
+ "description": "fuf react form library",
5
+ "author": "Hannes Tiede",
6
+ "homepage": "https://github.com/fuf-stack/uniform#readme",
7
+ "license": "MIT",
8
+ "type": "module",
9
+ "exports": {
10
+ "./": "./dist/"
11
+ },
12
+ "typesVersions": {
13
+ "*": {
14
+ "*": [
15
+ "./dist/*"
16
+ ]
17
+ }
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/fuf-stack/uniform.git",
28
+ "directory": "packages/uniform"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/fuf-stack/uniform/issues"
32
+ },
33
+ "dependencies": {
34
+ "@dnd-kit/core": "6.1.0",
35
+ "@dnd-kit/modifiers": "7.0.0",
36
+ "@dnd-kit/sortable": "8.0.0",
37
+ "@dnd-kit/utilities": "3.2.2",
38
+ "@nextui-org/button": "2.0.27",
39
+ "@nextui-org/checkbox": "2.0.25",
40
+ "@nextui-org/input": "2.1.17",
41
+ "@nextui-org/radio": "2.0.25",
42
+ "@nextui-org/select": "2.1.21",
43
+ "@nextui-org/switch": "2.0.25",
44
+ "@nextui-org/system": "2.0.15",
45
+ "@react-aria/visually-hidden": "3.8.10",
46
+ "react-icons": "5.0.1",
47
+ "classnames": "2.5.1",
48
+ "debug": "4.3.4",
49
+ "react": "18.2.0",
50
+ "react-dom": "18.2.0",
51
+ "react-hook-form": "7.51.0",
52
+ "react-select": "5.8.0",
53
+ "slug": "9.0.0",
54
+ "tailwind-variants": "0.1.20",
55
+ "@fuf-stack/pixels": "0.2.5",
56
+ "@fuf-stack/veto": "0.2.0"
57
+ },
58
+ "devDependencies": {
59
+ "@types/debug": "4.1.12",
60
+ "@types/react": "18.2.69",
61
+ "@types/react-dom": "18.2.22",
62
+ "@types/slug": "5.0.8",
63
+ "@repo/storybook-config": "0.0.1",
64
+ "@repo/vite-config": "0.0.1",
65
+ "@repo/tailwind-config": "0.0.1"
66
+ },
67
+ "scripts": {
68
+ "test": "vitest ./src"
69
+ }
70
+ }