@axenstudio/axen-form 0.1.4 → 0.1.5

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 (78) hide show
  1. package/dist/fields/AutocompleteField/AutocompleteField.cjs +10 -2
  2. package/dist/fields/AutocompleteField/AutocompleteField.d.ts +1 -1
  3. package/dist/fields/AutocompleteField/AutocompleteField.d.ts.map +1 -1
  4. package/dist/fields/AutocompleteField/AutocompleteField.js +10 -2
  5. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.cjs +11 -0
  6. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.d.ts +1 -1
  7. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.d.ts.map +1 -1
  8. package/dist/fields/AutocompleteMultiField/AutocompleteMultiField.js +11 -0
  9. package/dist/fields/AutocompletePredictField/AutocompletePredictField.cjs +10 -2
  10. package/dist/fields/AutocompletePredictField/AutocompletePredictField.d.ts +1 -1
  11. package/dist/fields/AutocompletePredictField/AutocompletePredictField.d.ts.map +1 -1
  12. package/dist/fields/AutocompletePredictField/AutocompletePredictField.js +10 -2
  13. package/dist/fields/DateField/DateField.cjs +26 -19
  14. package/dist/fields/DateField/DateField.d.ts +1 -1
  15. package/dist/fields/DateField/DateField.d.ts.map +1 -1
  16. package/dist/fields/DateField/DateField.js +27 -20
  17. package/dist/fields/DateTimeField/DateTimeField.cjs +26 -19
  18. package/dist/fields/DateTimeField/DateTimeField.d.ts +1 -1
  19. package/dist/fields/DateTimeField/DateTimeField.d.ts.map +1 -1
  20. package/dist/fields/DateTimeField/DateTimeField.js +27 -20
  21. package/dist/fields/EmailField/EmailField.cjs +24 -39
  22. package/dist/fields/EmailField/EmailField.d.ts +1 -1
  23. package/dist/fields/EmailField/EmailField.d.ts.map +1 -1
  24. package/dist/fields/EmailField/EmailField.js +25 -40
  25. package/dist/fields/NumberField/NumberField.cjs +21 -5
  26. package/dist/fields/NumberField/NumberField.d.ts +1 -1
  27. package/dist/fields/NumberField/NumberField.d.ts.map +1 -1
  28. package/dist/fields/NumberField/NumberField.js +21 -5
  29. package/dist/fields/PasswordField/PasswordField.cjs +12 -3
  30. package/dist/fields/PasswordField/PasswordField.d.ts +1 -1
  31. package/dist/fields/PasswordField/PasswordField.d.ts.map +1 -1
  32. package/dist/fields/PasswordField/PasswordField.js +12 -3
  33. package/dist/fields/PhoneField/PhoneField.cjs +25 -18
  34. package/dist/fields/PhoneField/PhoneField.d.ts +1 -1
  35. package/dist/fields/PhoneField/PhoneField.d.ts.map +1 -1
  36. package/dist/fields/PhoneField/PhoneField.js +26 -19
  37. package/dist/fields/TextField/TextField.cjs +23 -16
  38. package/dist/fields/TextField/TextField.d.ts +1 -1
  39. package/dist/fields/TextField/TextField.d.ts.map +1 -1
  40. package/dist/fields/TextField/TextField.js +24 -17
  41. package/dist/fields/TimeField/TimeField.cjs +24 -17
  42. package/dist/fields/TimeField/TimeField.d.ts +1 -1
  43. package/dist/fields/TimeField/TimeField.d.ts.map +1 -1
  44. package/dist/fields/TimeField/TimeField.js +25 -18
  45. package/dist/fields/defaultPlaceholders.cjs +19 -0
  46. package/dist/fields/defaultPlaceholders.d.ts +3 -0
  47. package/dist/fields/defaultPlaceholders.d.ts.map +1 -0
  48. package/dist/fields/defaultPlaceholders.js +19 -0
  49. package/dist/fields/fieldBase.module.css +60 -36
  50. package/dist/fields/fieldBase.module.css.cjs +24 -15
  51. package/dist/fields/fieldBase.module.css.js +24 -15
  52. package/dist/fields/fieldUtils.d.ts +1 -1
  53. package/dist/fields/fieldUtils.d.ts.map +1 -1
  54. package/dist/fields/iconUtils.cjs +9 -0
  55. package/dist/fields/iconUtils.d.ts +9 -0
  56. package/dist/fields/iconUtils.d.ts.map +1 -0
  57. package/dist/fields/iconUtils.js +9 -0
  58. package/dist/fields/icons.cjs +111 -0
  59. package/dist/fields/icons.d.ts +6 -0
  60. package/dist/fields/icons.d.ts.map +1 -0
  61. package/dist/fields/icons.js +111 -0
  62. package/dist/index.cjs +8 -0
  63. package/dist/index.d.ts +5 -1
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +8 -0
  66. package/dist/react/AxenForm.cjs +54 -7
  67. package/dist/react/AxenForm.d.ts.map +1 -1
  68. package/dist/react/AxenForm.js +54 -7
  69. package/dist/react/fieldGroup.module.css +22 -0
  70. package/dist/react/fieldGroup.module.css.cjs +11 -0
  71. package/dist/react/fieldGroup.module.css.js +11 -0
  72. package/dist/tokens/themes.css +31 -0
  73. package/dist/tokens/tokens.css +6 -4
  74. package/dist/types.cjs +6 -0
  75. package/dist/types.d.ts +22 -2
  76. package/dist/types.d.ts.map +1 -1
  77. package/dist/types.js +6 -0
  78. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const icons = require("./icons.cjs");
4
+ function resolveFieldIcon(icon, fieldType) {
5
+ if (icon === false) return null;
6
+ if (icon != null) return icon;
7
+ return icons.defaultIcons[fieldType] ?? null;
8
+ }
9
+ exports.resolveFieldIcon = resolveFieldIcon;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Resolve the icon for a field.
4
+ * - `undefined` → use default icon for the field type
5
+ * - `false` → no icon
6
+ * - `ReactNode` → custom icon
7
+ */
8
+ export declare function resolveFieldIcon(icon: ReactNode | false | undefined, fieldType: string): ReactNode | null;
9
+ //# sourceMappingURL=iconUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconUtils.d.ts","sourceRoot":"","sources":["../../src/fields/iconUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,EACnC,SAAS,EAAE,MAAM,GAChB,SAAS,GAAG,IAAI,CAIlB"}
@@ -0,0 +1,9 @@
1
+ import { defaultIcons } from "./icons.js";
2
+ function resolveFieldIcon(icon, fieldType) {
3
+ if (icon === false) return null;
4
+ if (icon != null) return icon;
5
+ return defaultIcons[fieldType] ?? null;
6
+ }
7
+ export {
8
+ resolveFieldIcon
9
+ };
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const svg = (d) => /* @__PURE__ */ jsxRuntime.jsx(
5
+ "svg",
6
+ {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: "18",
9
+ height: "18",
10
+ viewBox: "0 0 24 24",
11
+ fill: "none",
12
+ stroke: "currentColor",
13
+ strokeWidth: "2",
14
+ strokeLinecap: "round",
15
+ strokeLinejoin: "round",
16
+ "aria-hidden": "true",
17
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d })
18
+ }
19
+ );
20
+ const svgMulti = (...paths) => /* @__PURE__ */ jsxRuntime.jsx(
21
+ "svg",
22
+ {
23
+ xmlns: "http://www.w3.org/2000/svg",
24
+ width: "18",
25
+ height: "18",
26
+ viewBox: "0 0 24 24",
27
+ fill: "none",
28
+ stroke: "currentColor",
29
+ strokeWidth: "2",
30
+ strokeLinecap: "round",
31
+ strokeLinejoin: "round",
32
+ "aria-hidden": "true",
33
+ children: paths.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx("path", { d }, { key: i }.key))
34
+ }
35
+ );
36
+ const TextIcon = svgMulti("M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", "M15 5l4 4");
37
+ const EmailIcon = svgMulti(
38
+ "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",
39
+ "M22 6l-10 7L2 6"
40
+ );
41
+ const LockIcon = svgMulti(
42
+ "M19 11H5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2z",
43
+ "M7 11V7a5 5 0 0 1 10 0v4"
44
+ );
45
+ const PhoneIcon = svg(
46
+ "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"
47
+ );
48
+ const NumberIcon = svgMulti("M4 9h16", "M4 15h16", "M10 3L8 21", "M16 3l-2 18");
49
+ const CurrencyIcon = svgMulti("M12 1v22", "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6");
50
+ const CalendarIcon = svgMulti(
51
+ "M19 4H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z",
52
+ "M16 2v4",
53
+ "M8 2v4",
54
+ "M3 10h18"
55
+ );
56
+ const ClockIcon = /* @__PURE__ */ jsxRuntime.jsxs(
57
+ "svg",
58
+ {
59
+ xmlns: "http://www.w3.org/2000/svg",
60
+ width: "18",
61
+ height: "18",
62
+ viewBox: "0 0 24 24",
63
+ fill: "none",
64
+ stroke: "currentColor",
65
+ strokeWidth: "2",
66
+ strokeLinecap: "round",
67
+ strokeLinejoin: "round",
68
+ "aria-hidden": "true",
69
+ children: [
70
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
71
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 6v6l4 2" })
72
+ ]
73
+ }
74
+ );
75
+ const SearchIcon = /* @__PURE__ */ jsxRuntime.jsxs(
76
+ "svg",
77
+ {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ width: "18",
80
+ height: "18",
81
+ viewBox: "0 0 24 24",
82
+ fill: "none",
83
+ stroke: "currentColor",
84
+ strokeWidth: "2",
85
+ strokeLinecap: "round",
86
+ strokeLinejoin: "round",
87
+ "aria-hidden": "true",
88
+ children: [
89
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
90
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 21l-4.35-4.35" })
91
+ ]
92
+ }
93
+ );
94
+ svgMulti(
95
+ "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",
96
+ "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
97
+ );
98
+ const defaultIcons = {
99
+ text: TextIcon,
100
+ email: EmailIcon,
101
+ password: LockIcon,
102
+ phone: PhoneIcon,
103
+ number: NumberIcon,
104
+ currency: CurrencyIcon,
105
+ date: CalendarIcon,
106
+ time: ClockIcon,
107
+ datetime: CalendarIcon,
108
+ autocomplete: SearchIcon,
109
+ "autocomplete-predict": SearchIcon
110
+ };
111
+ exports.defaultIcons = defaultIcons;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { BuiltInFieldType } from '../types';
3
+ /** Link / URL icon */
4
+ export declare const LinkIcon: import("react/jsx-runtime").JSX.Element;
5
+ export declare const defaultIcons: Partial<Record<BuiltInFieldType, ReactNode>>;
6
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/fields/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAsHjD,sBAAsB;AACtB,eAAO,MAAM,QAAQ,yCAGpB,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAYrE,CAAC"}
@@ -0,0 +1,111 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const svg = (d) => /* @__PURE__ */ jsx(
3
+ "svg",
4
+ {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: "18",
7
+ height: "18",
8
+ viewBox: "0 0 24 24",
9
+ fill: "none",
10
+ stroke: "currentColor",
11
+ strokeWidth: "2",
12
+ strokeLinecap: "round",
13
+ strokeLinejoin: "round",
14
+ "aria-hidden": "true",
15
+ children: /* @__PURE__ */ jsx("path", { d })
16
+ }
17
+ );
18
+ const svgMulti = (...paths) => /* @__PURE__ */ jsx(
19
+ "svg",
20
+ {
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ width: "18",
23
+ height: "18",
24
+ viewBox: "0 0 24 24",
25
+ fill: "none",
26
+ stroke: "currentColor",
27
+ strokeWidth: "2",
28
+ strokeLinecap: "round",
29
+ strokeLinejoin: "round",
30
+ "aria-hidden": "true",
31
+ children: paths.map((d, i) => /* @__PURE__ */ jsx("path", { d }, { key: i }.key))
32
+ }
33
+ );
34
+ const TextIcon = svgMulti("M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", "M15 5l4 4");
35
+ const EmailIcon = svgMulti(
36
+ "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",
37
+ "M22 6l-10 7L2 6"
38
+ );
39
+ const LockIcon = svgMulti(
40
+ "M19 11H5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2z",
41
+ "M7 11V7a5 5 0 0 1 10 0v4"
42
+ );
43
+ const PhoneIcon = svg(
44
+ "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"
45
+ );
46
+ const NumberIcon = svgMulti("M4 9h16", "M4 15h16", "M10 3L8 21", "M16 3l-2 18");
47
+ const CurrencyIcon = svgMulti("M12 1v22", "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6");
48
+ const CalendarIcon = svgMulti(
49
+ "M19 4H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z",
50
+ "M16 2v4",
51
+ "M8 2v4",
52
+ "M3 10h18"
53
+ );
54
+ const ClockIcon = /* @__PURE__ */ jsxs(
55
+ "svg",
56
+ {
57
+ xmlns: "http://www.w3.org/2000/svg",
58
+ width: "18",
59
+ height: "18",
60
+ viewBox: "0 0 24 24",
61
+ fill: "none",
62
+ stroke: "currentColor",
63
+ strokeWidth: "2",
64
+ strokeLinecap: "round",
65
+ strokeLinejoin: "round",
66
+ "aria-hidden": "true",
67
+ children: [
68
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
69
+ /* @__PURE__ */ jsx("path", { d: "M12 6v6l4 2" })
70
+ ]
71
+ }
72
+ );
73
+ const SearchIcon = /* @__PURE__ */ jsxs(
74
+ "svg",
75
+ {
76
+ xmlns: "http://www.w3.org/2000/svg",
77
+ width: "18",
78
+ height: "18",
79
+ viewBox: "0 0 24 24",
80
+ fill: "none",
81
+ stroke: "currentColor",
82
+ strokeWidth: "2",
83
+ strokeLinecap: "round",
84
+ strokeLinejoin: "round",
85
+ "aria-hidden": "true",
86
+ children: [
87
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
88
+ /* @__PURE__ */ jsx("path", { d: "M21 21l-4.35-4.35" })
89
+ ]
90
+ }
91
+ );
92
+ svgMulti(
93
+ "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",
94
+ "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
95
+ );
96
+ const defaultIcons = {
97
+ text: TextIcon,
98
+ email: EmailIcon,
99
+ password: LockIcon,
100
+ phone: PhoneIcon,
101
+ number: NumberIcon,
102
+ currency: CurrencyIcon,
103
+ date: CalendarIcon,
104
+ time: ClockIcon,
105
+ datetime: CalendarIcon,
106
+ autocomplete: SearchIcon,
107
+ "autocomplete-predict": SearchIcon
108
+ };
109
+ export {
110
+ defaultIcons
111
+ };
package/dist/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const types = require("./types.cjs");
3
4
  const dateUtils = require("./core/dateUtils.cjs");
4
5
  const formStore = require("./core/formStore.cjs");
5
6
  const numberUtils = require("./core/numberUtils.cjs");
@@ -38,7 +39,11 @@ const Divider = require("./layout/Divider/Divider.cjs");
38
39
  const Grid = require("./layout/Grid/Grid.cjs");
39
40
  const Spacer = require("./layout/Spacer/Spacer.cjs");
40
41
  const Stack = require("./layout/Stack/Stack.cjs");
42
+ const defaultPlaceholders = require("./fields/defaultPlaceholders.cjs");
41
43
  const fieldUtils = require("./fields/fieldUtils.cjs");
44
+ const icons = require("./fields/icons.cjs");
45
+ const iconUtils = require("./fields/iconUtils.cjs");
46
+ exports.isFieldGroup = types.isFieldGroup;
42
47
  exports.formatDateLocale = dateUtils.formatDateLocale;
43
48
  exports.formatDateTimeLocale = dateUtils.formatDateTimeLocale;
44
49
  exports.formatTimeLocale = dateUtils.formatTimeLocale;
@@ -93,7 +98,10 @@ exports.Divider = Divider.Divider;
93
98
  exports.Grid = Grid.Grid;
94
99
  exports.Spacer = Spacer.Spacer;
95
100
  exports.Stack = Stack.Stack;
101
+ exports.defaultPlaceholders = defaultPlaceholders.defaultPlaceholders;
96
102
  exports.ariaProps = fieldUtils.ariaProps;
97
103
  exports.cx = fieldUtils.cx;
98
104
  exports.helperId = fieldUtils.helperId;
99
105
  exports.labelId = fieldUtils.labelId;
106
+ exports.defaultIcons = icons.defaultIcons;
107
+ exports.resolveFieldIcon = iconUtils.resolveFieldIcon;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export type { ArrayFieldConfig, ArrayHelpers, AutocompleteOption, AxenFormProps, AxenFormRef, BoxProps, Breakpoint, BuiltInFieldType, DividerProps, FieldComponentProps, FieldConfig, FieldOption, FieldTypeComponentMap, FormApi, FormConfig, GridProps, GridSize, PayloadConfig, SpacerProps, StackProps, ValidationAdapter, } from './types';
1
+ export type { ArrayFieldConfig, ArrayHelpers, AutocompleteOption, AxenFormProps, AxenFormRef, BoxProps, Breakpoint, BuiltInFieldType, DividerProps, FieldComponentProps, FieldConfig, FieldGroupConfig, FieldOption, FieldTypeComponentMap, FormApi, FormConfig, GridProps, GridSize, PayloadConfig, SpacerProps, StackProps, ValidationAdapter, } from './types';
2
+ export { isFieldGroup } from './types';
2
3
  export { formatDateLocale, formatDateTimeLocale, formatTimeLocale, getDefaultLocale, toISODateString, toISODateTimeLocalString, toISOTimeString, } from './core/dateUtils';
3
4
  export { createFormStore } from './core/formStore';
4
5
  export { calculateCursorPosition, formatNumber, getDecimalSeparator, getGroupSeparator, stripNonNumeric, } from './core/numberUtils';
@@ -38,5 +39,8 @@ export { Divider } from './layout/Divider/Divider';
38
39
  export { Grid } from './layout/Grid/Grid';
39
40
  export { Spacer } from './layout/Spacer/Spacer';
40
41
  export { Stack } from './layout/Stack/Stack';
42
+ export { defaultPlaceholders } from './fields/defaultPlaceholders';
41
43
  export { ariaProps, cx, helperId, labelId } from './fields/fieldUtils';
44
+ export { defaultIcons } from './fields/icons';
45
+ export { resolveFieldIcon } from './fields/iconUtils';
42
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @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M,sCAAsC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isFieldGroup } from "./types.js";
1
2
  import { formatDateLocale, formatDateTimeLocale, formatTimeLocale, getDefaultLocale, toISODateString, toISODateTimeLocalString, toISOTimeString } from "./core/dateUtils.js";
2
3
  import { createFormStore } from "./core/formStore.js";
3
4
  import { calculateCursorPosition, formatNumber, getDecimalSeparator, getGroupSeparator, stripNonNumeric } from "./core/numberUtils.js";
@@ -36,7 +37,10 @@ import { Divider } from "./layout/Divider/Divider.js";
36
37
  import { Grid } from "./layout/Grid/Grid.js";
37
38
  import { Spacer } from "./layout/Spacer/Spacer.js";
38
39
  import { Stack } from "./layout/Stack/Stack.js";
40
+ import { defaultPlaceholders } from "./fields/defaultPlaceholders.js";
39
41
  import { ariaProps, cx, helperId, labelId } from "./fields/fieldUtils.js";
42
+ import { defaultIcons } from "./fields/icons.js";
43
+ import { resolveFieldIcon } from "./fields/iconUtils.js";
40
44
  export {
41
45
  AutocompleteField,
42
46
  AutocompleteMultiField,
@@ -71,6 +75,8 @@ export {
71
75
  createFormStore,
72
76
  cx,
73
77
  defaultComponentMap,
78
+ defaultIcons,
79
+ defaultPlaceholders,
74
80
  formatDateLocale,
75
81
  formatDateTimeLocale,
76
82
  formatNumber,
@@ -81,10 +87,12 @@ export {
81
87
  getGroupSeparator,
82
88
  getStrippedFields,
83
89
  helperId,
90
+ isFieldGroup,
84
91
  labelId,
85
92
  mapPayload,
86
93
  pathToString,
87
94
  pickFields,
95
+ resolveFieldIcon,
88
96
  set,
89
97
  simpleValidator,
90
98
  stripNonNumeric,
@@ -4,9 +4,13 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const payloadUtils = require("../core/payloadUtils.cjs");
6
6
  const defaultComponentMap = require("../fields/defaultComponentMap.cjs");
7
+ const defaultPlaceholders = require("../fields/defaultPlaceholders.cjs");
7
8
  ;/* empty css */
8
9
  ;/* empty css */
10
+ ;/* empty css */
11
+ const types = require("../types.cjs");
9
12
  const FormContext = require("./FormContext.cjs");
13
+ const fieldGroup_module = require("./fieldGroup.module.css.cjs");
10
14
  const gridCell_module = require("./gridCell.module.css.cjs");
11
15
  const useAxenForm = require("./useAxenForm.cjs");
12
16
  const useField = require("./useField.cjs");
@@ -22,6 +26,7 @@ function AxenFormInner(props, ref) {
22
26
  gap = "1rem",
23
27
  className,
24
28
  disabled,
29
+ theme,
25
30
  validateOnChange,
26
31
  validateOnBlur,
27
32
  children
@@ -69,8 +74,50 @@ function AxenFormInner(props, ref) {
69
74
  }),
70
75
  [columns, gap]
71
76
  );
72
- return /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: formApi.handleSubmit, className, noValidate: true, children: [
73
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: config.fields.map((fieldConfig) => /* @__PURE__ */ jsxRuntime.jsx(
77
+ return /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
78
+ "form",
79
+ {
80
+ onSubmit: formApi.handleSubmit,
81
+ className,
82
+ noValidate: true,
83
+ ...theme ? { "data-axen-theme": theme } : void 0,
84
+ children: [
85
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: gridStyle, children: config.fields.map((item) => {
86
+ if (types.isFieldGroup(item)) {
87
+ return /* @__PURE__ */ jsxRuntime.jsx(
88
+ AxenFieldGroup,
89
+ {
90
+ group: item,
91
+ disabled,
92
+ formApi
93
+ },
94
+ item.group
95
+ );
96
+ }
97
+ return /* @__PURE__ */ jsxRuntime.jsx(
98
+ AxenFieldRenderer,
99
+ {
100
+ config: item,
101
+ disabled,
102
+ formApi
103
+ },
104
+ item.name
105
+ );
106
+ }) }),
107
+ children
108
+ ]
109
+ }
110
+ ) });
111
+ }
112
+ const AxenForm = react.forwardRef(AxenFormInner);
113
+ function AxenFieldGroup({
114
+ group,
115
+ disabled,
116
+ formApi
117
+ }) {
118
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: fieldGroup_module.default.fieldGroup, children: [
119
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: fieldGroup_module.default.groupLabel, children: group.group }),
120
+ group.fields.map((fieldConfig) => /* @__PURE__ */ jsxRuntime.jsx(
74
121
  AxenFieldRenderer,
75
122
  {
76
123
  config: fieldConfig,
@@ -78,11 +125,9 @@ function AxenFormInner(props, ref) {
78
125
  formApi
79
126
  },
80
127
  fieldConfig.name
81
- )) }),
82
- children
83
- ] }) });
128
+ ))
129
+ ] });
84
130
  }
85
- const AxenForm = react.forwardRef(AxenFormInner);
86
131
  function AxenFieldRenderer({
87
132
  config,
88
133
  disabled,
@@ -98,6 +143,7 @@ function AxenFieldRenderer({
98
143
  }
99
144
  const showError = touched && !!error;
100
145
  const helperText = showError ? error : config.helperText;
146
+ const placeholder = config.placeholder ?? defaultPlaceholders.defaultPlaceholders[config.type];
101
147
  const { className: colClassName, style: colStyle } = resolveColSpan(config.colSpan);
102
148
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: colClassName, style: colStyle, children: /* @__PURE__ */ jsxRuntime.jsx(
103
149
  Component,
@@ -109,12 +155,13 @@ function AxenFieldRenderer({
109
155
  error: showError,
110
156
  helperText,
111
157
  label: config.label,
112
- placeholder: config.placeholder,
158
+ placeholder,
113
159
  disabled: disabled || config.disabled,
114
160
  readOnly: config.readOnly,
115
161
  required: config.required,
116
162
  options: config.options,
117
163
  form: formApi,
164
+ icon: config.icon,
118
165
  ...config.fieldProps ?? {},
119
166
  min: config.min,
120
167
  max: config.max,
@@ -1 +1 @@
1
- {"version":3,"file":"AxenForm.d.ts","sourceRoot":"","sources":["../../src/react/AxenForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,qBAAqB,CAAC;AAC7B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAsC,MAAM,UAAU,CAAC;AAgG/F,eAAO,MAAM,QAAQ,EAAgC,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3F,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAAE,KACnF,SAAS,CAAC"}
1
+ {"version":3,"file":"AxenForm.d.ts","sourceRoot":"","sources":["../../src/react/AxenForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,qBAAqB,CAAC;AAC7B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAIZ,MAAM,UAAU,CAAC;AAoHlB,eAAO,MAAM,QAAQ,EAAgC,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3F,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAAE,KACnF,SAAS,CAAC"}
@@ -2,9 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useMemo, useImperativeHandle } from "react";
3
3
  import { mapPayload } from "../core/payloadUtils.js";
4
4
  import { defaultComponentMap } from "../fields/defaultComponentMap.js";
5
+ import { defaultPlaceholders } from "../fields/defaultPlaceholders.js";
5
6
  /* empty css */
6
7
  /* empty css */
8
+ /* empty css */
9
+ import { isFieldGroup } from "../types.js";
7
10
  import { FormContext, useFormContext } from "./FormContext.js";
11
+ import groupStyles from "./fieldGroup.module.css.js";
8
12
  import gridStyles from "./gridCell.module.css.js";
9
13
  import { useAxenForm } from "./useAxenForm.js";
10
14
  import { useField } from "./useField.js";
@@ -20,6 +24,7 @@ function AxenFormInner(props, ref) {
20
24
  gap = "1rem",
21
25
  className,
22
26
  disabled,
27
+ theme,
23
28
  validateOnChange,
24
29
  validateOnBlur,
25
30
  children
@@ -67,8 +72,50 @@ function AxenFormInner(props, ref) {
67
72
  }),
68
73
  [columns, gap]
69
74
  );
70
- return /* @__PURE__ */ jsx(FormContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs("form", { onSubmit: formApi.handleSubmit, className, noValidate: true, children: [
71
- /* @__PURE__ */ jsx("div", { style: gridStyle, children: config.fields.map((fieldConfig) => /* @__PURE__ */ jsx(
75
+ return /* @__PURE__ */ jsx(FormContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs(
76
+ "form",
77
+ {
78
+ onSubmit: formApi.handleSubmit,
79
+ className,
80
+ noValidate: true,
81
+ ...theme ? { "data-axen-theme": theme } : void 0,
82
+ children: [
83
+ /* @__PURE__ */ jsx("div", { style: gridStyle, children: config.fields.map((item) => {
84
+ if (isFieldGroup(item)) {
85
+ return /* @__PURE__ */ jsx(
86
+ AxenFieldGroup,
87
+ {
88
+ group: item,
89
+ disabled,
90
+ formApi
91
+ },
92
+ item.group
93
+ );
94
+ }
95
+ return /* @__PURE__ */ jsx(
96
+ AxenFieldRenderer,
97
+ {
98
+ config: item,
99
+ disabled,
100
+ formApi
101
+ },
102
+ item.name
103
+ );
104
+ }) }),
105
+ children
106
+ ]
107
+ }
108
+ ) });
109
+ }
110
+ const AxenForm = forwardRef(AxenFormInner);
111
+ function AxenFieldGroup({
112
+ group,
113
+ disabled,
114
+ formApi
115
+ }) {
116
+ return /* @__PURE__ */ jsxs("div", { className: groupStyles.fieldGroup, children: [
117
+ /* @__PURE__ */ jsx("div", { className: groupStyles.groupLabel, children: group.group }),
118
+ group.fields.map((fieldConfig) => /* @__PURE__ */ jsx(
72
119
  AxenFieldRenderer,
73
120
  {
74
121
  config: fieldConfig,
@@ -76,11 +123,9 @@ function AxenFormInner(props, ref) {
76
123
  formApi
77
124
  },
78
125
  fieldConfig.name
79
- )) }),
80
- children
81
- ] }) });
126
+ ))
127
+ ] });
82
128
  }
83
- const AxenForm = forwardRef(AxenFormInner);
84
129
  function AxenFieldRenderer({
85
130
  config,
86
131
  disabled,
@@ -96,6 +141,7 @@ function AxenFieldRenderer({
96
141
  }
97
142
  const showError = touched && !!error;
98
143
  const helperText = showError ? error : config.helperText;
144
+ const placeholder = config.placeholder ?? defaultPlaceholders[config.type];
99
145
  const { className: colClassName, style: colStyle } = resolveColSpan(config.colSpan);
100
146
  return /* @__PURE__ */ jsx("div", { className: colClassName, style: colStyle, children: /* @__PURE__ */ jsx(
101
147
  Component,
@@ -107,12 +153,13 @@ function AxenFieldRenderer({
107
153
  error: showError,
108
154
  helperText,
109
155
  label: config.label,
110
- placeholder: config.placeholder,
156
+ placeholder,
111
157
  disabled: disabled || config.disabled,
112
158
  readOnly: config.readOnly,
113
159
  required: config.required,
114
160
  options: config.options,
115
161
  form: formApi,
162
+ icon: config.icon,
116
163
  ...config.fieldProps ?? {},
117
164
  min: config.min,
118
165
  max: config.max,
@@ -0,0 +1,22 @@
1
+ /* ═══════════════════════════════════════════════
2
+ axen-form Field Group / Section Styles
3
+ ═══════════════════════════════════════════════ */
4
+
5
+ ._fieldGroup_1864u_5 {
6
+ display: contents; /* Inherit parent grid flow */
7
+ }
8
+
9
+ ._groupLabel_1864u_9 {
10
+ grid-column: 1 / -1;
11
+ font-size: var(--axen-font-size-md, 1rem);
12
+ font-weight: var(--axen-font-weight-bold, 600);
13
+ color: var(--axen-color-primary, #1976d2);
14
+ padding-bottom: var(--axen-space-xs, 0.25rem);
15
+ border-bottom: 2px solid var(--axen-color-primary-light, #e3f2fd);
16
+ margin-top: var(--axen-space-md, 1rem);
17
+ margin-bottom: var(--axen-space-xs, 0.25rem);
18
+ }
19
+
20
+ ._fieldGroup_1864u_5:first-child > ._groupLabel_1864u_9 {
21
+ margin-top: 0;
22
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const fieldGroup = "_fieldGroup_1864u_5";
4
+ const groupLabel = "_groupLabel_1864u_9";
5
+ const groupStyles = {
6
+ fieldGroup,
7
+ groupLabel
8
+ };
9
+ exports.default = groupStyles;
10
+ exports.fieldGroup = fieldGroup;
11
+ exports.groupLabel = groupLabel;
@@ -0,0 +1,11 @@
1
+ const fieldGroup = "_fieldGroup_1864u_5";
2
+ const groupLabel = "_groupLabel_1864u_9";
3
+ const groupStyles = {
4
+ fieldGroup,
5
+ groupLabel
6
+ };
7
+ export {
8
+ groupStyles as default,
9
+ fieldGroup,
10
+ groupLabel
11
+ };