@kapiuara/ui 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +171 -11
  2. package/dist/components/chat/KapiChatThread.js +4 -4
  3. package/dist/components/chat/KapiComposer.js +8 -8
  4. package/dist/components/data/KapiDataTable.js +4 -4
  5. package/dist/components/data/KapiSparkline.d.ts +2 -1
  6. package/dist/components/data/KapiSparkline.js +29 -26
  7. package/dist/components/data/KapiTableFilter.js +6 -6
  8. package/dist/components/data/tableCells.d.ts +12 -1
  9. package/dist/components/data/tableCells.js +49 -51
  10. package/dist/components/data/useTableSelection.js +3 -3
  11. package/dist/components/display/KapiAnnotation.js +68 -63
  12. package/dist/components/display/KapiAvatar.d.ts +6 -4
  13. package/dist/components/display/KapiAvatar.js +33 -28
  14. package/dist/components/display/KapiCodeBlock.d.ts +48 -0
  15. package/dist/components/display/KapiCodeBlock.js +44 -0
  16. package/dist/components/display/KapiCommentComposer.js +6 -6
  17. package/dist/components/display/KapiDiff.d.ts +62 -0
  18. package/dist/components/display/KapiDiff.js +118 -0
  19. package/dist/components/display/KapiHighlight.d.ts +27 -0
  20. package/dist/components/display/KapiHighlight.js +21 -0
  21. package/dist/components/display/KapiIconTile.d.ts +2 -1
  22. package/dist/components/display/KapiIconTile.js +23 -21
  23. package/dist/components/display/KapiStat.d.ts +3 -2
  24. package/dist/components/display/KapiStat.js +32 -26
  25. package/dist/components/display/KapiTag.d.ts +4 -3
  26. package/dist/components/display/KapiTag.js +29 -24
  27. package/dist/components/display/KapiTimeline.d.ts +5 -2
  28. package/dist/components/display/KapiTimeline.js +31 -23
  29. package/dist/components/display/annotationLogic.d.ts +2 -1
  30. package/dist/components/display/annotationLogic.js +7 -6
  31. package/dist/components/display/codeBlockSlots.d.ts +10 -0
  32. package/dist/components/display/codeBlockSlots.js +13 -0
  33. package/dist/components/display/diffLogic.d.ts +58 -0
  34. package/dist/components/display/diffLogic.js +96 -0
  35. package/dist/components/display/diffSlots.d.ts +14 -0
  36. package/dist/components/display/diffSlots.js +17 -0
  37. package/dist/components/display/highlightLogic.d.ts +18 -0
  38. package/dist/components/display/highlightLogic.js +26 -0
  39. package/dist/components/display/highlightSlots.d.ts +5 -0
  40. package/dist/components/display/highlightSlots.js +8 -0
  41. package/dist/components/display/iconTileLogic.d.ts +2 -2
  42. package/dist/components/display/iconTileLogic.js +7 -6
  43. package/dist/components/display/index.d.ts +8 -0
  44. package/dist/components/display/statLogic.d.ts +2 -1
  45. package/dist/components/display/statLogic.js +7 -6
  46. package/dist/components/display/tagLogic.d.ts +2 -1
  47. package/dist/components/display/tagLogic.js +7 -6
  48. package/dist/components/display/timelineLogic.d.ts +20 -2
  49. package/dist/components/display/timelineLogic.js +10 -2
  50. package/dist/components/feedback/KapiFab.js +108 -108
  51. package/dist/components/feedback/KapiProgress.js +63 -54
  52. package/dist/components/feedback/KapiToastContainer.js +9 -9
  53. package/dist/components/feedback/KapiTour.js +12 -12
  54. package/dist/components/feedback/progressLogic.d.ts +2 -1
  55. package/dist/components/feedback/progressLogic.js +9 -8
  56. package/dist/components/inputs/KapiAutocomplete.d.ts +6 -0
  57. package/dist/components/inputs/KapiAutocomplete.js +86 -85
  58. package/dist/components/inputs/KapiChecklist.d.ts +7 -1
  59. package/dist/components/inputs/KapiChecklist.js +53 -52
  60. package/dist/components/inputs/KapiCopyButton.d.ts +40 -0
  61. package/dist/components/inputs/KapiCopyButton.js +35 -0
  62. package/dist/components/inputs/KapiDatePicker.d.ts +7 -1
  63. package/dist/components/inputs/KapiDatePicker.js +118 -116
  64. package/dist/components/inputs/KapiDateRangePicker.d.ts +7 -1
  65. package/dist/components/inputs/KapiDateRangePicker.js +136 -135
  66. package/dist/components/inputs/KapiFacetedSearch.js +5 -5
  67. package/dist/components/inputs/KapiField.d.ts +9 -1
  68. package/dist/components/inputs/KapiField.js +43 -42
  69. package/dist/components/inputs/KapiFileUpload.js +6 -6
  70. package/dist/components/inputs/KapiInput.d.ts +29 -1
  71. package/dist/components/inputs/KapiInput.js +74 -51
  72. package/dist/components/inputs/KapiMaskedInput.js +26 -26
  73. package/dist/components/inputs/KapiNumberStepper.d.ts +7 -1
  74. package/dist/components/inputs/KapiNumberStepper.js +24 -23
  75. package/dist/components/inputs/KapiPinInput.d.ts +72 -0
  76. package/dist/components/inputs/KapiPinInput.js +75 -0
  77. package/dist/components/inputs/KapiPropsForm.d.ts +34 -0
  78. package/dist/components/inputs/KapiPropsForm.js +78 -0
  79. package/dist/components/inputs/KapiRating.d.ts +7 -1
  80. package/dist/components/inputs/KapiRating.js +39 -38
  81. package/dist/components/inputs/KapiSearchChip.js +5 -5
  82. package/dist/components/inputs/KapiSegmented.d.ts +13 -5
  83. package/dist/components/inputs/KapiSegmented.js +81 -77
  84. package/dist/components/inputs/KapiSelect.d.ts +9 -1
  85. package/dist/components/inputs/KapiSelect.js +236 -233
  86. package/dist/components/inputs/KapiSlider.d.ts +10 -3
  87. package/dist/components/inputs/KapiSlider.js +67 -63
  88. package/dist/components/inputs/KapiTagInput.d.ts +7 -1
  89. package/dist/components/inputs/KapiTagInput.js +70 -69
  90. package/dist/components/inputs/KapiTextarea.d.ts +7 -1
  91. package/dist/components/inputs/KapiTextarea.js +51 -50
  92. package/dist/components/inputs/copyLogic.d.ts +1 -0
  93. package/dist/components/inputs/copyLogic.js +12 -0
  94. package/dist/components/inputs/fieldLogic.d.ts +23 -3
  95. package/dist/components/inputs/fieldLogic.js +18 -11
  96. package/dist/components/inputs/index.d.ts +8 -0
  97. package/dist/components/inputs/inputLogic.d.ts +16 -1
  98. package/dist/components/inputs/inputLogic.js +3 -3
  99. package/dist/components/inputs/ownField.d.ts +3 -1
  100. package/dist/components/inputs/ownField.js +28 -27
  101. package/dist/components/inputs/pinInputLogic.d.ts +34 -0
  102. package/dist/components/inputs/pinInputLogic.js +37 -0
  103. package/dist/components/inputs/propsFormLogic.d.ts +53 -0
  104. package/dist/components/inputs/propsFormLogic.js +11 -0
  105. package/dist/components/inputs/segmentedLogic.d.ts +7 -0
  106. package/dist/components/inputs/segmentedLogic.js +2 -2
  107. package/dist/components/layout/KapiAccessCard.d.ts +5 -1
  108. package/dist/components/layout/KapiAccessCard.js +43 -39
  109. package/dist/components/layout/KapiAccountMenu.js +7 -7
  110. package/dist/components/layout/KapiCollapse.d.ts +39 -0
  111. package/dist/components/layout/KapiCollapse.js +20 -0
  112. package/dist/components/layout/KapiContextSlot.js +4 -4
  113. package/dist/components/layout/KapiDivider.d.ts +11 -2
  114. package/dist/components/layout/KapiDivider.js +30 -24
  115. package/dist/components/layout/KapiGrid.js +2 -2
  116. package/dist/components/layout/KapiNotificationBell.js +10 -10
  117. package/dist/components/layout/KapiPageHeader.js +22 -22
  118. package/dist/components/layout/KapiRail.js +4 -4
  119. package/dist/components/layout/KapiRoot.d.ts +22 -2
  120. package/dist/components/layout/KapiRoot.js +33 -29
  121. package/dist/components/layout/KapiShell.d.ts +9 -1
  122. package/dist/components/layout/KapiShell.js +28 -27
  123. package/dist/components/layout/accessCardLogic.d.ts +8 -1
  124. package/dist/components/layout/accessCardLogic.js +11 -7
  125. package/dist/components/layout/index.d.ts +2 -0
  126. package/dist/components/locale/labelRegistry.d.ts +10 -0
  127. package/dist/components/navigation/KapiAccordion.js +9 -9
  128. package/dist/components/navigation/KapiContextPanel.js +12 -12
  129. package/dist/components/navigation/KapiNavBadge.d.ts +6 -3
  130. package/dist/components/navigation/KapiNavBadge.js +26 -22
  131. package/dist/components/navigation/KapiTabs.js +9 -9
  132. package/dist/components/navigation/KapiToc.d.ts +48 -0
  133. package/dist/components/navigation/KapiToc.js +66 -0
  134. package/dist/components/navigation/KapiTree.js +10 -10
  135. package/dist/components/navigation/index.d.ts +3 -0
  136. package/dist/components/navigation/tocLogic.d.ts +35 -0
  137. package/dist/components/navigation/tocLogic.js +11 -0
  138. package/dist/components/navigation/tocSlots.d.ts +8 -0
  139. package/dist/components/navigation/tocSlots.js +11 -0
  140. package/dist/components/overlays/KapiCommandPalette.js +6 -6
  141. package/dist/components/overlays/KapiContextMenu.js +5 -5
  142. package/dist/components/overlays/KapiMenuButton.js +7 -7
  143. package/dist/components/overlays/KapiModal.js +3 -3
  144. package/dist/components/overlays/KapiOffcanvas.js +24 -24
  145. package/dist/components/overlays/KapiPhotoView.js +10 -10
  146. package/dist/components/overlays/KapiPopover.js +6 -6
  147. package/dist/components/overlays/KapiShapeSheet.js +4 -4
  148. package/dist/components/overlays/KapiTooltip.js +18 -18
  149. package/dist/components/overlays/menuList.js +22 -22
  150. package/dist/components/slotCatalog.d.ts +33 -0
  151. package/dist/components/slotCatalog.js +18 -10
  152. package/dist/css/base.css +1 -1
  153. package/dist/css/components/display/KapiAnnotation.css +1 -1
  154. package/dist/css/components/display/KapiCodeBlock.css +1 -0
  155. package/dist/css/components/display/KapiDiff.css +1 -0
  156. package/dist/css/components/display/display.css +1 -1
  157. package/dist/css/components/feedback/feedback.css +1 -1
  158. package/dist/css/components/inputs/KapiPinInput.css +1 -0
  159. package/dist/css/components/inputs/KapiSelect.css +1 -1
  160. package/dist/css/components/inputs/inputsExtra.css +1 -1
  161. package/dist/css/components/layout/KapiAccessCard.css +1 -1
  162. package/dist/css/components/layout/KapiCollapse.css +1 -0
  163. package/dist/css/components/layout/KapiDivider.css +1 -1
  164. package/dist/css/components/navigation/KapiToc.css +1 -0
  165. package/dist/hooks/asyncResourceLogic.d.ts +11 -0
  166. package/dist/hooks/asyncResourceLogic.js +4 -0
  167. package/dist/hooks/index.d.ts +3 -0
  168. package/dist/hooks/toneFamilyLogic.d.ts +26 -2
  169. package/dist/hooks/toneFamilyLogic.js +19 -6
  170. package/dist/hooks/useAsyncResource.d.ts +45 -0
  171. package/dist/hooks/useAsyncResource.js +24 -0
  172. package/dist/hooks/useKapiTheme.d.ts +8 -1
  173. package/dist/hooks/useKapiTheme.js +57 -57
  174. package/dist/hooks/useToneFamilies.d.ts +14 -4
  175. package/dist/hooks/useToneFamilies.js +27 -23
  176. package/dist/index.js +221 -207
  177. package/dist/kapi.css +1 -1
  178. package/dist/kapi.layered.css +1 -1
  179. package/dist/logic.d.ts +41 -0
  180. package/dist/logic.js +42 -0
  181. package/package.json +13 -2
@@ -1,17 +1,21 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/inputsExtra.css";
3
- import { fieldControlProps as e, joinIds as t, resolveValidation as n } from "./fieldLogic.js";
4
- import { useOwnField as r } from "./ownField.js";
5
- import { resolveGroupSize as i } from "./inputGroupLogic.js";
6
- import { useKapiInputGroup as ee } from "./KapiInputGroup.js";
7
- import { hasAdornments as a, hasValue as o, inputBoxClasses as te, present as s } from "./inputLogic.js";
8
- import { useLabels as ne } from "../locale/KapiLocaleProvider.js";
3
+ import { useLabels as e } from "../locale/KapiLocaleProvider.js";
4
+ import { hasAdornments as t, hasValue as n, inputBoxClasses as r, present as i, tipoDeCampo as ee } from "./inputLogic.js";
5
+ import { fieldControlProps as te, joinIds as a, resolveFieldMessage as o } from "./fieldLogic.js";
6
+ import { useOwnField as s } from "./ownField.js";
7
+ import { resolveGroupSize as c } from "./inputGroupLogic.js";
8
+ import { useKapiInputGroup as ne } from "./KapiInputGroup.js";
9
9
  /* empty css */
10
- import { useId as re, useRef as c, useState as l } from "react";
11
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
12
- import { X as f } from "lucide-react";
10
+ import { useEffect as re, useId as ie, useRef as l, useState as u } from "react";
11
+ import { jsx as d, jsxs as ae } from "react/jsx-runtime";
12
+ import { Eye as oe, EyeOff as f, X as p } from "lucide-react";
13
13
  //#region src/components/inputs/KapiInput.tsx
14
- var p = { clear: "Limpiar" }, m = (e) => {
14
+ var m = {
15
+ clear: "Limpiar",
16
+ show: "Mostrar la contraseña",
17
+ hide: "Ocultar la contraseña"
18
+ }, se = (e) => {
15
19
  Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 }));
16
20
  }, h = ({ size: e = "md", status: t, num: n = !1, className: r = "" } = {}) => [
17
21
  "kapi-input",
@@ -20,104 +24,123 @@ var p = { clear: "Limpiar" }, m = (e) => {
20
24
  t && `kapi-input--${t}`,
21
25
  r
22
26
  ].filter(Boolean).join(" "), g = (g) => {
23
- let { size: ie, invalid: _, status: v, num: y, label: b, required: x, help: S, fieldClassName: C, className: w, multiline: T, id: ae, startIcon: E, endIcon: D, prefix: O, suffix: k, clearable: A, onClear: j, shortcut: M, labels: N, ref: P, ...F } = g, I = P, { invalid: L, status: R } = n(_, v), z = ne("input", p, N), B = i(ie, ee()?.size), V = !T && a({
27
+ let { size: _, invalid: v, status: y, num: ce, label: le, required: b, help: x, error: S, fieldClassName: C, className: w, multiline: T, id: ue, startIcon: E, endIcon: D, prefix: O, suffix: k, clearable: A, onClear: de, reveal: j, shortcut: M, labels: N, ref: P, ...F } = g, I = P, { invalid: L, status: R } = o(S, x, v, y), z = e("input", m, N), B = c(_, ne()?.size), V = !T && t({
24
28
  startIcon: E,
25
29
  endIcon: D,
26
30
  prefix: O,
27
31
  suffix: k,
28
32
  clearable: A,
33
+ reveal: j,
29
34
  shortcut: M
30
- }), H = c(null), U = F, [W, G] = l(() => o(U.defaultValue)), K = r({
31
- id: ae,
32
- label: b,
33
- help: S,
34
- required: x,
35
- invalid: _,
36
- status: v,
35
+ }), [H, U] = u(!1), W = l(null), G = F;
36
+ re(() => {
37
+ G.disabled && U(!1);
38
+ }, [G.disabled]);
39
+ let K = ee({
40
+ reveal: j,
41
+ revealed: H,
42
+ disabled: G.disabled
43
+ }), [fe, q] = u(() => n(G.defaultValue)), J = s({
44
+ id: ue,
45
+ label: le,
46
+ help: x,
47
+ error: S,
48
+ required: b,
49
+ invalid: v,
50
+ status: y,
37
51
  fieldClassName: C
38
- }), { controlId: q, helpId: J } = K, Y = re(), X = V && s(O) ? `${Y}-prefix` : void 0, Z = V && s(k) ? `${Y}-suffix` : void 0, Q = {
39
- ...e(K.outer, {
40
- id: q,
41
- describedBy: t(J, F["aria-describedby"], X, Z),
52
+ }), { controlId: pe, helpId: me } = J, Y = ie(), X = V && i(O) ? `${Y}-prefix` : void 0, Z = V && i(k) ? `${Y}-suffix` : void 0, Q = {
53
+ ...te(J.outer, {
54
+ id: pe,
55
+ describedBy: a(me, F["aria-describedby"], X, Z),
42
56
  invalid: L
43
57
  }),
44
- required: x,
58
+ required: b,
45
59
  className: V ? "kapi-inputbox__control" : h({
46
60
  size: B,
47
61
  status: R,
48
- num: y,
62
+ num: ce,
49
63
  className: w
50
64
  })
51
- }, oe = (e) => {
52
- H.current = e, typeof I == "function" ? I(e) : I && (I.current = e);
53
- }, $ = U.value === void 0 ? W : o(U.value), se = () => {
54
- let e = H.current;
55
- e && (m(e), G(!1), e.focus(), j?.());
56
- }, ce = T ? /* @__PURE__ */ u("textarea", {
65
+ }, he = (e) => {
66
+ W.current = e, typeof I == "function" ? I(e) : I && (I.current = e);
67
+ }, $ = G.value === void 0 ? fe : n(G.value), ge = () => {
68
+ let e = W.current;
69
+ e && (se(e), q(!1), e.focus(), de?.());
70
+ }, _e = T ? /* @__PURE__ */ d("textarea", {
57
71
  ref: I,
58
72
  ...F,
59
73
  ...Q
60
- }) : V ? /* @__PURE__ */ d("div", {
61
- className: te({
74
+ }) : V ? /* @__PURE__ */ ae("div", {
75
+ className: r({
62
76
  size: B,
63
77
  status: R,
64
- disabled: U.disabled,
78
+ disabled: G.disabled,
65
79
  className: w
66
80
  }),
67
81
  onMouseDown: (e) => {
68
- e.target === H.current || U.disabled || (e.preventDefault(), H.current?.focus());
82
+ e.target === W.current || G.disabled || (e.preventDefault(), W.current?.focus());
69
83
  },
70
84
  children: [
71
- s(E) && /* @__PURE__ */ u("span", {
85
+ i(E) && /* @__PURE__ */ d("span", {
72
86
  className: "kapi-inputbox__icon",
73
87
  "aria-hidden": "true",
74
88
  children: E
75
89
  }),
76
- s(O) && /* @__PURE__ */ u("span", {
90
+ i(O) && /* @__PURE__ */ d("span", {
77
91
  id: X,
78
92
  className: "kapi-inputbox__affix",
79
93
  children: O
80
94
  }),
81
- /* @__PURE__ */ u("input", {
82
- ref: oe,
83
- ...U,
95
+ /* @__PURE__ */ d("input", {
96
+ ref: he,
97
+ ...G,
84
98
  ...Q,
85
- "aria-keyshortcuts": U["aria-keyshortcuts"] ?? (M || void 0),
99
+ ...K ? { type: K } : {},
100
+ "aria-keyshortcuts": G["aria-keyshortcuts"] ?? (M || void 0),
86
101
  onChange: (e) => {
87
- G(o(e.target.value)), U.onChange?.(e);
102
+ q(n(e.target.value)), G.onChange?.(e);
88
103
  }
89
104
  }),
90
- s(k) && /* @__PURE__ */ u("span", {
105
+ i(k) && /* @__PURE__ */ d("span", {
91
106
  id: Z,
92
107
  className: "kapi-inputbox__affix",
93
108
  children: k
94
109
  }),
95
- A && $ && !U.disabled && !U.readOnly && /* @__PURE__ */ u("button", {
110
+ j && !G.disabled && /* @__PURE__ */ d("button", {
111
+ type: "button",
112
+ className: "kapi-inputbox__reveal",
113
+ "aria-label": H ? z.hide : z.show,
114
+ "aria-pressed": H,
115
+ onClick: () => U((e) => !e),
116
+ children: d(H ? f : oe, { "aria-hidden": "true" })
117
+ }),
118
+ A && $ && !G.disabled && !G.readOnly && /* @__PURE__ */ d("button", {
96
119
  type: "button",
97
120
  tabIndex: -1,
98
121
  className: "kapi-inputbox__clear",
99
122
  "aria-label": z.clear,
100
- onClick: se,
101
- children: /* @__PURE__ */ u(f, { "aria-hidden": "true" })
123
+ onClick: ge,
124
+ children: /* @__PURE__ */ d(p, { "aria-hidden": "true" })
102
125
  }),
103
- M && !$ && /* @__PURE__ */ u("kbd", {
126
+ M && !$ && /* @__PURE__ */ d("kbd", {
104
127
  className: "kapi-inputbox__kbd",
105
128
  "aria-hidden": "true",
106
129
  children: M
107
130
  }),
108
- s(D) && /* @__PURE__ */ u("span", {
131
+ i(D) && /* @__PURE__ */ d("span", {
109
132
  className: "kapi-inputbox__icon",
110
133
  "aria-hidden": "true",
111
134
  children: D
112
135
  })
113
136
  ]
114
- }) : /* @__PURE__ */ u("input", {
137
+ }) : /* @__PURE__ */ d("input", {
115
138
  ref: I,
116
- ...U,
139
+ ...G,
117
140
  ...Q
118
141
  });
119
- return K.wrap(ce);
142
+ return J.wrap(_e);
120
143
  };
121
144
  g.displayName = "KapiInput";
122
145
  //#endregion
123
- export { p as DEFAULT_INPUT_LABELS, g as KapiInput, h as inputClasses };
146
+ export { m as DEFAULT_INPUT_LABELS, g as KapiInput, h as inputClasses };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { assignRef as e } from "./fieldLogic.js";
3
- import { useLabels as t } from "../locale/KapiLocaleProvider.js";
4
- import { KapiInput as n } from "./KapiInput.js";
5
- import { useControllableState as r } from "../../hooks/useControllableState.js";
6
- import { activeElementOf as i } from "../../hooks/ownerDocument.js";
2
+ import { useLabels as e } from "../locale/KapiLocaleProvider.js";
3
+ import { activeElementOf as t } from "../../hooks/ownerDocument.js";
4
+ import { assignRef as n } from "./fieldLogic.js";
5
+ import { KapiInput as r } from "./KapiInput.js";
6
+ import { useControllableState as i } from "../../hooks/useControllableState.js";
7
7
  import { useFormReset as a } from "../../hooks/useFormReset.js";
8
8
  import { caretForSignificant as o, countSignificant as s, formatCuit as c, formatCurrency as l, formatDni as u, isValidCuit as d, maskCurrencyInput as f, onlyDigits as p, parseCurrency as m } from "./maskLogic.js";
9
9
  import { useCallback as h, useRef as g, useState as _ } from "react";
@@ -14,26 +14,26 @@ var x = (e, t, n) => e ? /* @__PURE__ */ y("input", {
14
14
  name: e,
15
15
  value: t,
16
16
  disabled: n
17
- }) : null, S = (t, n, r, a) => ({
18
- setRef: h((t) => {
19
- e(n, t), a?.(t);
20
- }, [n, a]),
21
- apply: (e, n) => {
22
- let a = e.target, c = a.selectionStart ?? a.value.length;
23
- if (r !== void 0 && p(a.value).length > r) {
24
- let e = Math.max(0, c - (a.value.length - n.length));
25
- return a.value = n, a.setSelectionRange(e, e), n;
17
+ }) : null, S = (e, r, i, a) => ({
18
+ setRef: h((e) => {
19
+ n(r, e), a?.(e);
20
+ }, [r, a]),
21
+ apply: (n, r) => {
22
+ let a = n.target, c = a.selectionStart ?? a.value.length;
23
+ if (i !== void 0 && p(a.value).length > i) {
24
+ let e = Math.max(0, c - (a.value.length - r.length));
25
+ return a.value = r, a.setSelectionRange(e, e), r;
26
26
  }
27
- let l = s(a.value, c), u = t(a.value);
28
- if (a.value = u, i(a) === a) {
27
+ let l = s(a.value, c), u = e(a.value);
28
+ if (a.value = u, t(a) === a) {
29
29
  let e = o(u, l);
30
30
  a.setSelectionRange(e, e);
31
31
  }
32
32
  return u;
33
33
  }
34
- }), C = ({ value: e, defaultValue: t = "", onValueChange: i, onChange: o, ref: s, name: c, disabled: l, placeholder: d = "12.345.678", ...f }) => {
35
- let [m, h, , g] = r(e, () => p(t, 8), i), _ = p(m, 8), { setRef: C, apply: w } = S(u, s, 8, a(g));
36
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(n, {
34
+ }), C = ({ value: e, defaultValue: t = "", onValueChange: n, onChange: o, ref: s, name: c, disabled: l, placeholder: d = "12.345.678", ...f }) => {
35
+ let [m, h, , g] = i(e, () => p(t, 8), n), _ = p(m, 8), { setRef: C, apply: w } = S(u, s, 8, a(g));
36
+ return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(r, {
37
37
  ...f,
38
38
  ref: C,
39
39
  disabled: l,
@@ -46,9 +46,9 @@ var x = (e, t, n) => e ? /* @__PURE__ */ y("input", {
46
46
  t !== _ && h(t), o?.(e);
47
47
  }
48
48
  }), x(c, _, l)] });
49
- }, w = { invalid: "CUIT inválido: revisa el dígito verificador" }, T = ({ value: e, defaultValue: i = "", onValueChange: o, onChange: s, invalidMessage: l, invalid: u, status: f, help: m, label: h, ref: g, name: _, disabled: C, placeholder: T = "20-12345678-9", ...E }) => {
50
- let D = t("cuitInput", w), [O, k, , A] = r(e, () => p(i, 11), o && ((e) => o(e, d(e)))), j = p(O, 11), M = a(A), N = j.length === 11 && !d(j), P = u !== void 0 || f !== void 0, F = h != null || !!m, { setRef: I, apply: L } = S(c, g, 11, M);
51
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(n, {
49
+ }, w = { invalid: "CUIT inválido: revisa el dígito verificador" }, T = ({ value: t, defaultValue: n = "", onValueChange: o, onChange: s, invalidMessage: l, invalid: u, status: f, help: m, label: h, ref: g, name: _, disabled: C, placeholder: T = "20-12345678-9", ...E }) => {
50
+ let D = e("cuitInput", w), [O, k, , A] = i(t, () => p(n, 11), o && ((e) => o(e, d(e)))), j = p(O, 11), M = a(A), N = j.length === 11 && !d(j), P = u !== void 0 || f !== void 0, F = h != null || !!m, { setRef: I, apply: L } = S(c, g, 11, M);
51
+ return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(r, {
52
52
  ...E,
53
53
  ref: I,
54
54
  disabled: C,
@@ -65,13 +65,13 @@ var x = (e, t, n) => e ? /* @__PURE__ */ y("input", {
65
65
  t !== j && k(t), s?.(e);
66
66
  }
67
67
  }), x(_, j, C)] });
68
- }, E = ({ value: e, defaultValue: t = null, onValueChange: r, onChange: i, onBlur: o, ref: s, name: c, disabled: u, placeholder: d = "$ 0,00", ...p }) => {
68
+ }, E = ({ value: e, defaultValue: t = null, onValueChange: n, onChange: i, onBlur: o, ref: s, name: c, disabled: u, placeholder: d = "$ 0,00", ...p }) => {
69
69
  let [h, C] = _(() => l(e === void 0 ? t : e)), w = g(m(h)), T = g(h), [E, D] = _(e);
70
70
  e !== void 0 && e !== E && (D(e), e !== m(h) && (C(l(e)), w.current = e));
71
71
  let O = a(() => {
72
72
  e === void 0 && (C(T.current), w.current = m(T.current));
73
73
  }), { setRef: k, apply: A } = S(f, s, void 0, O), j = m(h);
74
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(n, {
74
+ return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(r, {
75
75
  ...p,
76
76
  ref: k,
77
77
  disabled: u,
@@ -82,8 +82,8 @@ var x = (e, t, n) => e ? /* @__PURE__ */ y("input", {
82
82
  onChange: (e) => {
83
83
  let t = A(e, h);
84
84
  C(t);
85
- let n = m(t);
86
- n !== w.current && (w.current = n, r?.(n)), i?.(e);
85
+ let r = m(t);
86
+ r !== w.current && (w.current = r, n?.(r)), i?.(e);
87
87
  },
88
88
  onBlur: (e) => {
89
89
  C(l(m(h))), o?.(e);
@@ -29,6 +29,12 @@ export type KapiNumberStepperProps = Omit<InputHTMLAttributes<HTMLInputElement>,
29
29
  label?: ReactNode;
30
30
  /** Texto de ayuda o error bajo el control. */
31
31
  help?: ReactNode;
32
+ /**
33
+ * El motivo por el que el campo está mal. Reemplaza a `help` y lo marca inválido (rojo, ícono y
34
+ * `role="alert"`). Es lo que entregan las librerías de formularios: un mensaje, no un booleano.
35
+ * Un error que React no pinta (`true`, `""`, `null`) no marca nada. Gana sobre `invalid` y `status`.
36
+ */
37
+ error?: ReactNode | undefined;
32
38
  /** Clase del contenedor del control (`.kapi-stepper`, botones + input). `className` va al `<input>`. */
33
39
  fieldClassName?: string | undefined;
34
40
  /**
@@ -53,4 +59,4 @@ export type KapiNumberStepperLabels = {
53
59
  increase: string;
54
60
  };
55
61
  export declare const DEFAULT_NUMBER_STEPPER_LABELS: KapiNumberStepperLabels;
56
- export declare const KapiNumberStepper: ({ value: valueProp, defaultValue, onChange, min, max, step, size, invalid: invalidProp, status: statusProp, required, label, help, fieldClassName, wrapperClassName, labels, className, disabled, readOnly: readOnlyProp, id, ...rest }: KapiNumberStepperProps) => ReactNode;
62
+ export declare const KapiNumberStepper: ({ value: valueProp, defaultValue, onChange, min, max, step, size, invalid: invalidProp, status: statusProp, required, label, help, error, fieldClassName, wrapperClassName, labels, className, disabled, readOnly: readOnlyProp, id, ...rest }: KapiNumberStepperProps) => ReactNode;
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/inputsExtra.css";
3
- import { fieldControlProps as e, joinIds as t, resolveFieldClassName as n, resolveReadOnly as ee, resolveValidation as r } from "./fieldLogic.js";
4
- import { useOwnField as i } from "./ownField.js";
5
- import { useLabels as a } from "../locale/KapiLocaleProvider.js";
3
+ import { useLabels as e } from "../locale/KapiLocaleProvider.js";
4
+ import { fieldControlProps as t, joinIds as n, resolveFieldClassName as r, resolveFieldMessage as i, resolveReadOnly as a } from "./fieldLogic.js";
5
+ import { useOwnField as o } from "./ownField.js";
6
6
  /* empty css */
7
- import { inputClasses as o } from "./KapiInput.js";
8
- import { useControllableState as s } from "../../hooks/useControllableState.js";
9
- import { canDecrement as te, canIncrement as c, clampNumber as l, parseTypedNumber as u, snapToStep as d, stepValue as f } from "./numberStepLogic.js";
10
- import { useEffect as ne, useState as p } from "react";
7
+ import { inputClasses as s } from "./KapiInput.js";
8
+ import { useControllableState as ee } from "../../hooks/useControllableState.js";
9
+ import { canDecrement as c, canIncrement as te, clampNumber as l, parseTypedNumber as u, snapToStep as d, stepValue as ne } from "./numberStepLogic.js";
10
+ import { useEffect as f, useState as p } from "react";
11
11
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
12
  import { Minus as g, Plus as re } from "lucide-react";
13
13
  //#region src/components/inputs/KapiNumberStepper.tsx
@@ -18,25 +18,26 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
18
18
  ].filter(Boolean).join(" "), v = {
19
19
  decrease: "Disminuir",
20
20
  increase: "Aumentar"
21
- }, y = ({ value: y, defaultValue: b, onChange: x, min: S, max: C, step: w = 1, size: T = "md", invalid: E, status: D, required: O, label: k, help: A, fieldClassName: j, wrapperClassName: M, labels: N, className: P, disabled: F, readOnly: I, id: L, ...R }) => {
22
- let z = a("numberStepper", v, N), [B, V] = s(y, () => l(b ?? 0, {
21
+ }, y = ({ value: y, defaultValue: b, onChange: x, min: S, max: C, step: w = 1, size: T = "md", invalid: E, status: D, required: O, label: ie, help: k, error: A, fieldClassName: j, wrapperClassName: M, labels: N, className: P, disabled: F, readOnly: I, id: L, ...R }) => {
22
+ let z = e("numberStepper", v, N), [B, V] = ee(y, () => l(b ?? 0, {
23
23
  min: S,
24
24
  max: C,
25
25
  step: w
26
- }), x), { invalid: H, status: U } = r(E, D), W = i({
26
+ }), x), { invalid: H, status: U } = i(A, k, E, D), W = o({
27
27
  id: L,
28
- label: k,
29
- help: A,
28
+ label: ie,
29
+ help: k,
30
+ error: A,
30
31
  required: O,
31
32
  invalid: E,
32
33
  status: D,
33
34
  readOnly: I
34
- }), G = W.controlId ?? W.autoId, { helpId: K } = W, q = ee(I, W.field), J = {
35
+ }), G = W.controlId ?? W.autoId, { helpId: K } = W, q = a(I, W.field), J = {
35
36
  min: S,
36
37
  max: C,
37
38
  step: w
38
39
  }, [Y, X] = p(null);
39
- ne(() => X(null), [B]);
40
+ f(() => X(null), [B]);
40
41
  let Z = (e) => {
41
42
  let t = l(e, J);
42
43
  t !== B && V(t), X(null);
@@ -47,11 +48,11 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
47
48
  }, $ = (e) => {
48
49
  if (q) return;
49
50
  let t = Y === null ? null : u(Y), n = t === null ? B : d(t, J);
50
- Z(f(n, e, J));
51
- }, ie = /* @__PURE__ */ h("div", {
51
+ Z(ne(n, e, J));
52
+ }, ae = /* @__PURE__ */ h("div", {
52
53
  className: _({
53
54
  size: T,
54
- className: n(j, M)
55
+ className: r(j, M)
55
56
  }),
56
57
  children: [
57
58
  /* @__PURE__ */ m("button", {
@@ -59,7 +60,7 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
59
60
  className: "kapi-stepper__btn",
60
61
  "aria-label": z.decrease,
61
62
  tabIndex: -1,
62
- disabled: F || q || !te(B, J),
63
+ disabled: F || q || !c(B, J),
63
64
  onClick: () => $(-1),
64
65
  children: /* @__PURE__ */ m(g, {
65
66
  size: 15,
@@ -68,9 +69,9 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
68
69
  }),
69
70
  /* @__PURE__ */ m("input", {
70
71
  ...R,
71
- ...e(W.outer, {
72
+ ...t(W.outer, {
72
73
  id: G,
73
- describedBy: t(K, R["aria-describedby"]),
74
+ describedBy: n(K, R["aria-describedby"]),
74
75
  invalid: H
75
76
  }),
76
77
  required: O,
@@ -81,7 +82,7 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
81
82
  "aria-valuenow": B,
82
83
  "aria-valuemin": S,
83
84
  "aria-valuemax": C,
84
- className: o({
85
+ className: s({
85
86
  size: T,
86
87
  status: U,
87
88
  num: !0,
@@ -100,7 +101,7 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
100
101
  className: "kapi-stepper__btn",
101
102
  "aria-label": z.increase,
102
103
  tabIndex: -1,
103
- disabled: F || q || !c(B, J),
104
+ disabled: F || q || !te(B, J),
104
105
  onClick: () => $(1),
105
106
  children: /* @__PURE__ */ m(re, {
106
107
  size: 15,
@@ -109,7 +110,7 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
109
110
  })
110
111
  ]
111
112
  });
112
- return W.wrap(ie);
113
+ return W.wrap(ae);
113
114
  };
114
115
  //#endregion
115
116
  export { v as DEFAULT_NUMBER_STEPPER_LABELS, y as KapiNumberStepper, _ as stepperClasses };
@@ -0,0 +1,72 @@
1
+ import { type FocusEvent, type HTMLAttributes, type ReactNode, type Ref } from "react";
2
+ import type { KapiLabelsOverride } from "../labelsLogic.js";
3
+ import { type KapiFieldStatus } from "./fieldLogic.js";
4
+ import { type KapiPinInputType } from "./pinInputLogic.js";
5
+ export type KapiPinInputLabels = {
6
+ /** Nombre de cada caja. `{n}` es el número de caja y `{total}`, cuántas hay. */
7
+ digit: string;
8
+ };
9
+ export declare const DEFAULT_PIN_INPUT_LABELS: KapiPinInputLabels;
10
+ export type KapiPinInputProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "onBlur" | "defaultValue" | "children"> & {
11
+ /** `ref` a la PRIMERA caja, que es la que enfoca el campo. */
12
+ ref?: Ref<HTMLInputElement> | undefined;
13
+ /** Cuántas cajas. @default 6 */
14
+ length?: number | undefined;
15
+ /** Qué acepta cada caja. @default "numeric" */
16
+ type?: KapiPinInputType | undefined;
17
+ /** El código. Controlado. */
18
+ value?: string | undefined;
19
+ /** El código inicial, sin controlar. */
20
+ defaultValue?: string | undefined;
21
+ /** Avisa el código completo (las cajas unidas, sin los huecos). */
22
+ onChange?: ((value: string) => void) | undefined;
23
+ /** Avisa cuando se llenaron todas las cajas: el momento de enviar sin que aprieten un botón. */
24
+ onComplete?: ((value: string) => void) | undefined;
25
+ /**
26
+ * Oculta los caracteres, como una contraseña. Para un código que llega por SMS no va: verlo es
27
+ * parte de poder tipearlo bien.
28
+ */
29
+ mask?: boolean | undefined;
30
+ /**
31
+ * Deja que el teléfono ofrezca el código del SMS (`autocomplete="one-time-code"`). Va en la
32
+ * PRIMERA caja nada más, que es como lo espera el navegador; el reparto a las demás lo hace solo.
33
+ * @default true
34
+ */
35
+ oneTimeCode?: boolean | undefined;
36
+ /** Etiqueta del grupo. Con `label` o `help` se envuelve solo en un `KapiField`. */
37
+ label?: ReactNode | undefined;
38
+ /** Pista bajo las cajas. */
39
+ help?: ReactNode | undefined;
40
+ /** El motivo por el que está mal: reemplaza a `help` y lo marca inválido. Ver `KapiFieldProps`. */
41
+ error?: ReactNode | undefined;
42
+ /** Marca el grupo inválido. Sin esto, lo toma del `KapiField` que lo envuelve. */
43
+ invalid?: boolean | undefined;
44
+ /** Validación que no es error: `ok` o `pending`. */
45
+ status?: KapiFieldStatus | undefined;
46
+ /** Obligatorio. */
47
+ required?: boolean | undefined;
48
+ /** No se edita, pero se lee y se copia. */
49
+ readOnly?: boolean | undefined;
50
+ /** Deshabilitado. */
51
+ disabled?: boolean | undefined;
52
+ /** Enfoca la primera caja al montar. */
53
+ autoFocus?: boolean | undefined;
54
+ /** Para el envío nativo del `<form>`: emite un `<input type="hidden">` con el código. */
55
+ name?: string | undefined;
56
+ /** Se llama cuando el foco sale del grupo entero (moverse entre cajas no cuenta). */
57
+ onBlur?: ((event: FocusEvent<HTMLDivElement>) => void) | undefined;
58
+ /** Clase del contenedor del campo. */
59
+ fieldClassName?: string | undefined;
60
+ /** Textos propios. */
61
+ labels?: KapiLabelsOverride<KapiPinInputLabels> | undefined;
62
+ };
63
+ /**
64
+ * Un código en cajas, una por carácter: el segundo factor, el código del SMS, un PIN.
65
+ *
66
+ * NOMBRA CADA CAJA, y es el motivo por el que existe en vez de componerse a mano: seis `<input>`
67
+ * seguidos se anuncian como seis campos idénticos, así que cada uno lleva «Dígito 3 de 6» y el
68
+ * grupo entero lleva la etiqueta. Eso, el pegado desde cualquier caja y el Backspace que retrocede
69
+ * son justamente lo que cada app termina reescribiendo —y a veces olvidando— cuando compone esto
70
+ * con inputs sueltos.
71
+ */
72
+ export declare function KapiPinInput({ ref, length, type, value: valueProp, defaultValue, onChange, onComplete, mask, oneTimeCode, label, help, error, invalid, status, required, readOnly, disabled, autoFocus, name, onBlur, fieldClassName, className, id, labels, ...rest }: KapiPinInputProps): ReactNode;
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import "#kapi-css/components/inputs/KapiPinInput.css";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { useMergedRefs as t } from "../../hooks/mergeRefs.js";
5
+ import { useLabels as n } from "../locale/KapiLocaleProvider.js";
6
+ import { fieldControlProps as r } from "./fieldLogic.js";
7
+ import { useOwnField as i } from "./ownField.js";
8
+ import { useControllableState as a } from "../../hooks/useControllableState.js";
9
+ import { joinPin as o, pinAfterBackspace as s, pinAfterInput as c, pinAfterPaste as l, splitPin as u } from "./pinInputLogic.js";
10
+ /* empty css */
11
+ import { useRef as d } from "react";
12
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
13
+ //#region src/components/inputs/KapiPinInput.tsx
14
+ var m = { digit: "Dígito {n} de {total}" };
15
+ function h({ ref: h, length: g = 6, type: _ = "numeric", value: v, defaultValue: y, onChange: b, onComplete: x, mask: S, oneTimeCode: C = !0, label: w, help: T, error: E, invalid: D, status: O, required: k, readOnly: A, disabled: j, autoFocus: M, name: N, onBlur: P, fieldClassName: F, className: I, id: L, labels: R, ...z }) {
16
+ let B = n("pinInput", m, R), V = i({
17
+ id: L,
18
+ label: w,
19
+ help: T,
20
+ error: E,
21
+ required: k,
22
+ invalid: D,
23
+ status: O,
24
+ readOnly: A,
25
+ fieldClassName: F
26
+ }), [H, U] = a(v, y ?? "", b), W = d([]), G = t(h, (e) => {
27
+ W.current[0] = e;
28
+ }), K = u(H, g), q = ({ boxes: e, focus: t }) => {
29
+ let n = o(e);
30
+ U(n), W.current[t]?.focus(), W.current[t]?.select(), n.length === g && x?.(n);
31
+ }, J = (e) => (t) => {
32
+ A || j || (t.key === "Backspace" ? (t.preventDefault(), q(s(K, e))) : t.key === "ArrowLeft" && e > 0 ? (t.preventDefault(), W.current[e - 1]?.focus()) : t.key === "ArrowRight" && e < g - 1 && (t.preventDefault(), W.current[e + 1]?.focus()));
33
+ }, Y = (e) => (t) => {
34
+ A || j || (t.preventDefault(), q(l(K, e, t.clipboardData.getData("text"), _)));
35
+ }, X = r(V.field, {
36
+ id: L,
37
+ required: k,
38
+ invalid: D,
39
+ labelable: !1
40
+ });
41
+ return V.wrap(/* @__PURE__ */ p("div", {
42
+ ...z,
43
+ className: e("kapi-pin", I),
44
+ role: "group",
45
+ onBlur: (e) => {
46
+ e.currentTarget.contains(e.relatedTarget) || P?.(e);
47
+ },
48
+ ...X,
49
+ children: [K.map((e, t) => /* @__PURE__ */ f("input", {
50
+ ref: t === 0 ? G : (e) => {
51
+ W.current[t] = e;
52
+ },
53
+ className: "kapi-pin__box",
54
+ type: S ? "password" : "text",
55
+ inputMode: _ === "numeric" ? "numeric" : "text",
56
+ autoComplete: C && t === 0 ? "one-time-code" : "off",
57
+ "aria-label": B.digit.replace("{n}", String(t + 1)).replace("{total}", String(g)),
58
+ "aria-invalid": X["aria-invalid"],
59
+ value: e,
60
+ readOnly: A,
61
+ disabled: j,
62
+ autoFocus: M && t === 0,
63
+ onPaste: Y(t),
64
+ onKeyDown: J(t),
65
+ onChange: (e) => q(c(K, t, e.target.value, _)),
66
+ onFocus: (e) => e.currentTarget.select()
67
+ }, t)), N && /* @__PURE__ */ f("input", {
68
+ type: "hidden",
69
+ name: N,
70
+ value: j ? "" : H
71
+ })]
72
+ }));
73
+ }
74
+ //#endregion
75
+ export { m as DEFAULT_PIN_INPUT_LABELS, h as KapiPinInput };
@@ -0,0 +1,34 @@
1
+ import type { HTMLAttributes, Ref } from "react";
2
+ import { type KapiPropsFormField, type KapiPropsFormValues } from "./propsFormLogic.js";
3
+ export type { KapiPropsFormField, KapiPropsFormValue, KapiPropsFormValues } from "./propsFormLogic.js";
4
+ /** Atributos nativos (`id`, `style`, `data-*`…) van al `<div>` raíz. */
5
+ export type KapiPropsFormProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> & {
6
+ /** Ref al `<div>` raíz. */
7
+ ref?: Ref<HTMLDivElement> | undefined;
8
+ /** El esquema: qué campos hay y de qué tipo. Puede cambiar en vivo. */
9
+ fields: readonly KapiPropsFormField[];
10
+ /** Valores controlados, por nombre de campo. */
11
+ values?: KapiPropsFormValues | undefined;
12
+ /** Valores iniciales cuando el componente los maneja solo. */
13
+ defaultValues?: KapiPropsFormValues | undefined;
14
+ /** Avisa con TODOS los valores cada vez que uno cambia. */
15
+ onChange?: ((values: KapiPropsFormValues) => void) | undefined;
16
+ /** Marca en rojo los obligatorios vacíos. La app decide cuándo (al intentar guardar). */
17
+ showErrors?: boolean | undefined;
18
+ /** Deshabilita el formulario entero. @default false */
19
+ disabled?: boolean | undefined;
20
+ /** Ancho mínimo de cada campo, en px: debajo de eso la grilla pasa a una columna. @default 220 */
21
+ min?: number | undefined;
22
+ };
23
+ /**
24
+ * Formulario generado desde un esquema: el diálogo de "insertar bloque" de una wiki, la pantalla
25
+ * de configuración de un plugin, cualquier formulario que no se conoce al compilar.
26
+ *
27
+ * **El esquema puede cambiar en vivo** —viene del servidor, o de un tipo de bloque elegido en un
28
+ * menú— y los valores se acomodan solos: los campos que el esquema nuevo no declara se descartan y
29
+ * los que agrega entran con su inicial. Sin eso, cambiar de bloque manda campos del anterior.
30
+ *
31
+ * **`required` no valida: marca.** Quién decide si se puede guardar es la app, con
32
+ * `missingPropsFormFields`. La librería no tiene motor de validación y esto no lo cambia.
33
+ */
34
+ export declare function KapiPropsForm({ fields, values, defaultValues, onChange, showErrors, disabled, min, className, ...rest }: KapiPropsFormProps): import("react").JSX.Element;