shadcn-zod-formkit 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6,9 +6,11 @@ var lucideReact = require('lucide-react');
6
6
  var reactIcons = require('@radix-ui/react-icons');
7
7
  var classVarianceAuthority = require('class-variance-authority');
8
8
  var tailwindMerge = require('tailwind-merge');
9
+ var reactSlot = require('@radix-ui/react-slot');
10
+ var zustand = require('zustand');
9
11
  var reactHookForm = require('react-hook-form');
10
12
  var AccordionPrimitive = require('@radix-ui/react-accordion');
11
- var reactSlot = require('@radix-ui/react-slot');
13
+ var radixUi = require('radix-ui');
12
14
  var SeparatorPrimitive = require('@radix-ui/react-separator');
13
15
  var reactDayPicker = require('react-day-picker');
14
16
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
@@ -23,7 +25,6 @@ var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
23
25
  var ResizablePrimitive = require('react-resizable-panels');
24
26
  var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
25
27
  var SelectPrimitive = require('@radix-ui/react-select');
26
- var radixUi = require('radix-ui');
27
28
  var SliderPrimitive = require('@radix-ui/react-slider');
28
29
  var nextThemes = require('next-themes');
29
30
  var sonner = require('sonner');
@@ -31,7 +32,6 @@ var SwitchPrimitive = require('@radix-ui/react-switch');
31
32
  var TabsPrimitive = require('@radix-ui/react-tabs');
32
33
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
33
34
  var dateFns = require('date-fns');
34
- var zustand = require('zustand');
35
35
  var core = require('@dnd-kit/core');
36
36
  var sortable = require('@dnd-kit/sortable');
37
37
  var utilities = require('@dnd-kit/utilities');
@@ -9229,7 +9229,7 @@ var require_leaflet_src = __commonJS({
9229
9229
  // Amount of pixels to pan when pressing an arrow key.
9230
9230
  keyboardPanDelta: 80
9231
9231
  });
9232
- var Keyboard2 = Handler.extend({
9232
+ var Keyboard3 = Handler.extend({
9233
9233
  keyCodes: {
9234
9234
  left: [37],
9235
9235
  right: [39],
@@ -9347,7 +9347,7 @@ var require_leaflet_src = __commonJS({
9347
9347
  stop(e);
9348
9348
  }
9349
9349
  });
9350
- Map2.addInitHook("addHandler", "keyboard", Keyboard2);
9350
+ Map2.addInitHook("addHandler", "keyboard", Keyboard3);
9351
9351
  Map2.mergeOptions({
9352
9352
  // @section Mouse wheel options
9353
9353
  // @option scrollWheelZoom: Boolean|String = true
@@ -9565,7 +9565,7 @@ var require_leaflet_src = __commonJS({
9565
9565
  Map2.BoxZoom = BoxZoom;
9566
9566
  Map2.DoubleClickZoom = DoubleClickZoom;
9567
9567
  Map2.Drag = Drag;
9568
- Map2.Keyboard = Keyboard2;
9568
+ Map2.Keyboard = Keyboard3;
9569
9569
  Map2.ScrollWheelZoom = ScrollWheelZoom;
9570
9570
  Map2.TapHold = TapHold;
9571
9571
  Map2.TouchZoom = TouchZoom;
@@ -9868,6 +9868,486 @@ var CustomAlert = ({
9868
9868
  }
9869
9869
  );
9870
9870
  };
9871
+ var buttonVariants = classVarianceAuthority.cva(
9872
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9873
+ {
9874
+ variants: {
9875
+ variant: {
9876
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
9877
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
9878
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
9879
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
9880
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
9881
+ link: "text-primary underline-offset-4 hover:underline"
9882
+ },
9883
+ size: {
9884
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
9885
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
9886
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
9887
+ icon: "size-9",
9888
+ "icon-sm": "size-8",
9889
+ "icon-lg": "size-10"
9890
+ }
9891
+ },
9892
+ defaultVariants: {
9893
+ variant: "default",
9894
+ size: "default"
9895
+ }
9896
+ }
9897
+ );
9898
+ function Button({
9899
+ className,
9900
+ variant = "default",
9901
+ size = "default",
9902
+ asChild = false,
9903
+ ...props
9904
+ }) {
9905
+ const Comp = asChild ? reactSlot.Slot : "button";
9906
+ return /* @__PURE__ */ jsxRuntime.jsx(
9907
+ Comp,
9908
+ {
9909
+ "data-slot": "button",
9910
+ "data-variant": variant,
9911
+ "data-size": size,
9912
+ className: cn(buttonVariants({ variant, size, className })),
9913
+ ...props
9914
+ }
9915
+ );
9916
+ }
9917
+ function normalizeBorder(border, defaultWidth = 4) {
9918
+ if (!border) return null;
9919
+ if (typeof border === "string") {
9920
+ return { width: defaultWidth, color: border };
9921
+ }
9922
+ return { width: border.width ?? defaultWidth, color: border.color };
9923
+ }
9924
+ function generateBorderShadows(borders) {
9925
+ if (!borders) return "none";
9926
+ const shadows = [];
9927
+ const allBorder = normalizeBorder(borders.all);
9928
+ const left = normalizeBorder(borders.left) ?? allBorder;
9929
+ const right = normalizeBorder(borders.right) ?? allBorder;
9930
+ const top = normalizeBorder(borders.top) ?? allBorder;
9931
+ const bottom = normalizeBorder(borders.bottom) ?? allBorder;
9932
+ if (left?.color) {
9933
+ shadows.push(`inset ${left.width}px 0 0 0 ${left.color}`);
9934
+ }
9935
+ if (right?.color) {
9936
+ shadows.push(`inset -${right.width}px 0 0 0 ${right.color}`);
9937
+ }
9938
+ if (top?.color) {
9939
+ shadows.push(`inset 0 ${top.width}px 0 0 ${top.color}`);
9940
+ }
9941
+ if (bottom?.color) {
9942
+ shadows.push(`inset 0 -${bottom.width}px 0 0 ${bottom.color}`);
9943
+ }
9944
+ return shadows.length > 0 ? shadows.join(", ") : "none";
9945
+ }
9946
+ var Key = ({
9947
+ label,
9948
+ onClick,
9949
+ onDoubleClick,
9950
+ style,
9951
+ disabled = false,
9952
+ className,
9953
+ shortcut,
9954
+ children,
9955
+ withLabel = true,
9956
+ isActive = false,
9957
+ fontSize = "text-sm",
9958
+ icons,
9959
+ borders,
9960
+ // iconSize = 72,
9961
+ iconClassName = "w-8 h-8"
9962
+ }) => {
9963
+ let content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9964
+ withLabel && label,
9965
+ shortcut && ` (${shortcut})`
9966
+ ] });
9967
+ if (children) content = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
9968
+ const borderShadow = generateBorderShadows(borders);
9969
+ const hasBorders = borders && borderShadow !== "none";
9970
+ return /* @__PURE__ */ jsxRuntime.jsx(
9971
+ Button,
9972
+ {
9973
+ disabled,
9974
+ onDoubleClick,
9975
+ onClick: (e) => onClick?.(label ?? e.currentTarget.textContent ?? ""),
9976
+ style: {
9977
+ ...style,
9978
+ ...hasBorders && { boxShadow: borderShadow }
9979
+ },
9980
+ className: cn(
9981
+ // Base
9982
+ "shadow-md shadow-black/20",
9983
+ "flex flex-1 items-center justify-center rounded-lg h-full w-full",
9984
+ "font-mono font-bold transition-all duration-100",
9985
+ "active:scale-95",
9986
+ fontSize,
9987
+ // Estados base (soft UI)
9988
+ "border border-(--color-border)",
9989
+ "bg-(--color-secondary-soft) text-(--color-foreground)",
9990
+ // Hover
9991
+ "hover:bg-(--color-accent-soft)",
9992
+ // Active click (presionado)
9993
+ "active:bg-(--color-primary) active:text-(--color-primary-foreground)",
9994
+ // Estado activo (seleccionado)
9995
+ isActive && "bg-(--color-primary) text-(--color-primary-foreground) border-(--color-primary)",
9996
+ // Backspace especial
9997
+ // label === '⌫' &&
9998
+ // 'bg-(--color-destructive) text-white hover:opacity-90',
9999
+ // Overflow hidden para que los bordes respeten el border-radius
10000
+ "overflow-hidden",
10001
+ className
10002
+ ),
10003
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center items-center", children: [
10004
+ icons && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row justify-center text-3xl", children: icons.map((IconComponent, index) => /* @__PURE__ */ jsxRuntime.jsx(
10005
+ IconComponent,
10006
+ {
10007
+ className: iconClassName
10008
+ },
10009
+ index
10010
+ )) }),
10011
+ content
10012
+ ] })
10013
+ }
10014
+ );
10015
+ };
10016
+ var applyCase = (label, upper) => {
10017
+ if (!label || label.length !== 1 || !/[a-z]/.test(label)) return label;
10018
+ return upper ? label.toUpperCase() : label;
10019
+ };
10020
+ var letter = (l, isUpper, handleKey) => ({
10021
+ label: applyCase(l, isUpper),
10022
+ onClick: handleKey,
10023
+ className: "flex-1"
10024
+ });
10025
+
10026
+ // src/components/custom/keyboard/keyboard-base.tsx
10027
+ var BaseKeyboard = class {
10028
+ constructor() {
10029
+ }
10030
+ };
10031
+ var KeyboardBuilder = ({
10032
+ keys,
10033
+ withCard = false,
10034
+ className,
10035
+ keyFontSize: keyFontSize3
10036
+ }) => {
10037
+ const keyMap = React3.useMemo(() => {
10038
+ const map = /* @__PURE__ */ new Map();
10039
+ keys?.forEach((row) => {
10040
+ row.forEach((k) => {
10041
+ if (k.shortcut) {
10042
+ map.set(k.shortcut.toLowerCase(), k);
10043
+ }
10044
+ });
10045
+ });
10046
+ return map;
10047
+ }, [keys]);
10048
+ const triggerKey = React3.useCallback((pressedKey) => {
10049
+ const key = keyMap.get(pressedKey.toLowerCase());
10050
+ if (key && !key.disabled) {
10051
+ key.onClick?.(pressedKey);
10052
+ const keyboardEvent = new KeyboardEvent("keydown", {
10053
+ key: pressedKey,
10054
+ bubbles: true
10055
+ });
10056
+ window.dispatchEvent(keyboardEvent);
10057
+ }
10058
+ }, [keyMap]);
10059
+ React3.useEffect(() => {
10060
+ const handleKeyDown = (event) => {
10061
+ const active = document.activeElement;
10062
+ if (active instanceof HTMLInputElement || active instanceof HTMLTextAreaElement || active && active.getAttribute("contenteditable") === "true") {
10063
+ console.log("\u{1F680} ~ Ignorando tecla porque el foco est\xE1 en un input:", event.key);
10064
+ return;
10065
+ }
10066
+ triggerKey(event.key);
10067
+ event.preventDefault();
10068
+ };
10069
+ window.addEventListener("keydown", handleKeyDown);
10070
+ return () => {
10071
+ window.removeEventListener("keydown", handleKeyDown);
10072
+ };
10073
+ }, [triggerKey]);
10074
+ const content = /* @__PURE__ */ jsxRuntime.jsx(
10075
+ "div",
10076
+ {
10077
+ className: cn(
10078
+ `flex-1 grid grid-rows-${keys?.length} h-full`,
10079
+ className
10080
+ ),
10081
+ children: keys?.map((row, ri) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2 p-1 h-full", children: row.map((key, indx) => {
10082
+ const handleClick = () => {
10083
+ triggerKey(key.label ?? "");
10084
+ key.onClick?.(key.label ?? "");
10085
+ if (!key.shortcut) return;
10086
+ triggerKey(key.shortcut);
10087
+ };
10088
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10089
+ key.label == "" && !key.icons?.length && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${key.className}` }, indx),
10090
+ (key.label != "" || key.icons?.length) && /* @__PURE__ */ jsxRuntime.jsx(
10091
+ Key,
10092
+ {
10093
+ borders: {
10094
+ left: key.disabled ? "grey" : "",
10095
+ bottom: key.disabled ? "grey" : ""
10096
+ },
10097
+ label: key.label,
10098
+ onClick: handleClick,
10099
+ shortcut: key.shortcut,
10100
+ icons: key.icons,
10101
+ className: `${key.className} ${key.disabled ? "bg-muted-foreground h-full" : "h-full"}`,
10102
+ iconClassName: key.iconClassName,
10103
+ iconSize: key.iconSize,
10104
+ fontSize: keyFontSize3,
10105
+ isActive: key.isActive,
10106
+ disabled: key.disabled,
10107
+ children: key.children
10108
+ },
10109
+ indx
10110
+ )
10111
+ ] });
10112
+ }) }, ri))
10113
+ }
10114
+ );
10115
+ if (!withCard) return content;
10116
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full h-full m-0.5 p-1", className), children: content });
10117
+ };
10118
+
10119
+ // src/components/custom/keyboard/keyboard-types.ts
10120
+ var KeyboardTypes = /* @__PURE__ */ ((KeyboardTypes2) => {
10121
+ KeyboardTypes2["QWERTY"] = "qwerty";
10122
+ KeyboardTypes2["NUMBER"] = "number";
10123
+ KeyboardTypes2["QWERTY_NOT_CHARS"] = "qwerty_not_chars";
10124
+ return KeyboardTypes2;
10125
+ })(KeyboardTypes || {});
10126
+
10127
+ // src/components/custom/keyboard/providers/keyboard.store.ts
10128
+ var useKeyboardStore = zustand.create((set, get) => ({
10129
+ activeInput: null,
10130
+ inputs: {},
10131
+ type: "qwerty" /* QWERTY */,
10132
+ currentInputField: null,
10133
+ setCurrentInputField(inputField) {
10134
+ set({ currentInputField: inputField });
10135
+ console.log("Current Input Field set to:", inputField);
10136
+ },
10137
+ isOpen: false,
10138
+ setIsOpen() {
10139
+ set({ isOpen: !get().isOpen });
10140
+ },
10141
+ registerInput: (id, initialValue = "") => set((state) => ({
10142
+ inputs: {
10143
+ ...state.inputs,
10144
+ [id]: initialValue
10145
+ }
10146
+ })),
10147
+ unregisterInput: (id) => set((state) => {
10148
+ const newInputs = { ...state.inputs };
10149
+ delete newInputs[id];
10150
+ return { inputs: newInputs };
10151
+ }),
10152
+ focusInput: (id) => set({ activeInput: id }),
10153
+ write: (char) => set((state) => {
10154
+ let currentInputField = state.currentInputField;
10155
+ if (currentInputField && currentInputField.field) {
10156
+ currentInputField.field.value += char;
10157
+ set({ currentInputField });
10158
+ console.log("Updated currentInputField value:", state.currentInputField?.field?.value);
10159
+ }
10160
+ if (!state.activeInput) return state;
10161
+ const current = state.inputs[state.activeInput] || "";
10162
+ return {
10163
+ inputs: {
10164
+ ...state.inputs,
10165
+ [state.activeInput]: current + char
10166
+ }
10167
+ };
10168
+ }),
10169
+ backspace: () => set((state) => {
10170
+ if (!state.activeInput) return state;
10171
+ const current = state.inputs[state.activeInput] || "";
10172
+ return {
10173
+ inputs: {
10174
+ ...state.inputs,
10175
+ [state.activeInput]: current.slice(0, -1)
10176
+ }
10177
+ };
10178
+ }),
10179
+ clear: () => set((state) => {
10180
+ if (!state.activeInput) return state;
10181
+ return {
10182
+ inputs: {
10183
+ ...state.inputs,
10184
+ [state.activeInput]: ""
10185
+ }
10186
+ };
10187
+ }),
10188
+ setValue: (id, value) => set((state) => ({
10189
+ inputs: {
10190
+ ...state.inputs,
10191
+ [id]: value
10192
+ }
10193
+ }))
10194
+ }));
10195
+ var QwertyKeyboard = class extends BaseKeyboard {
10196
+ render() {
10197
+ return /* @__PURE__ */ jsxRuntime.jsx(KeyboardQwerty, {});
10198
+ }
10199
+ };
10200
+ var KeyboardQwerty = ({ onKeyPress, onEnter, keyFontSize: keyFontSize3 = "text-2xl", onDelete }) => {
10201
+ const [shiftMode, setShiftMode] = React3.useState("off");
10202
+ const [mode, setMode] = React3.useState("letters");
10203
+ const lastShiftPress = React3.useRef(0);
10204
+ const { currentInputField, write } = useKeyboardStore();
10205
+ const isUpper = shiftMode !== "off";
10206
+ const handleShift = () => {
10207
+ const now = Date.now();
10208
+ if (now - lastShiftPress.current < 300) {
10209
+ setShiftMode((prev) => prev === "caps" ? "off" : "caps");
10210
+ } else {
10211
+ setShiftMode((prev) => prev === "once" ? "off" : "once");
10212
+ }
10213
+ lastShiftPress.current = now;
10214
+ };
10215
+ const handleKey = (key) => {
10216
+ console.log("Key pressed:", key);
10217
+ const output = isUpper ? key.toUpperCase() : key;
10218
+ onKeyPress?.(output);
10219
+ write(output);
10220
+ if (shiftMode === "once") {
10221
+ setShiftMode("off");
10222
+ }
10223
+ };
10224
+ const handleCaps = () => {
10225
+ setShiftMode((prev) => prev === "caps" ? "off" : "caps");
10226
+ };
10227
+ const shiftLabel = shiftMode === "caps" ? lucideReact.ArrowBigUpDash : lucideReact.ArrowBigUp;
10228
+ const shiftActive = shiftMode !== "off";
10229
+ if (mode === "symbols") {
10230
+ const keys = [
10231
+ ["!", "@", "#", "$", "%", "^", "&", "*", "(", ")"],
10232
+ ["~", "`", "|", "\\", "/", "{", "}", "[", "]"],
10233
+ ["+", "=", "<", ">", "?", "'", '"', ":", ";"]
10234
+ ].map(
10235
+ (row) => row.map((k) => ({
10236
+ label: k,
10237
+ onClick: () => handleKey(k)
10238
+ }))
10239
+ );
10240
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
10241
+ KeyboardBuilder,
10242
+ {
10243
+ className: "w-full h-full",
10244
+ keyFontSize: keyFontSize3,
10245
+ keys: [
10246
+ ...keys,
10247
+ [
10248
+ { label: "ABC", onClick: () => setMode("letters"), className: "flex-[2]" },
10249
+ { label: " ", onClick: () => handleKey(" "), className: "flex-[4]" },
10250
+ { label: "Enter", onClick: onEnter, className: "flex-[2] bg-green-200 " }
10251
+ ]
10252
+ ]
10253
+ }
10254
+ ) });
10255
+ }
10256
+ const fila1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"].map((l) => letter(l, isUpper, handleKey));
10257
+ const fila2 = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"].map((l) => letter(l, isUpper, handleKey));
10258
+ const fila3 = ["a", "s", "d", "f", "g", "h", "j", "k", "l"].map((l) => letter(l, isUpper, handleKey));
10259
+ const fila4 = ["z", "x", "c", "v", "b", "n", "m"].map((l) => letter(l, isUpper, handleKey));
10260
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col", children: [
10261
+ currentInputField && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 h-full flex-1 flex flex-row text-2xl font-bold justify-center text-center items-center gap-2 rounded-xl border-2 transition-all outline-none border-amber-400 bg-amber-50 ", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
10262
+ " ",
10263
+ currentInputField.field?.value,
10264
+ " "
10265
+ ] }) }),
10266
+ /* @__PURE__ */ jsxRuntime.jsx(
10267
+ KeyboardBuilder,
10268
+ {
10269
+ className: "w-full h-full flex-3",
10270
+ keyFontSize: keyFontSize3,
10271
+ keys: [
10272
+ [
10273
+ { label: "esc", onClick: () => {
10274
+ }, className: "bg-red-200" },
10275
+ ...fila1
10276
+ ],
10277
+ [
10278
+ { label: "tab", onClick: () => {
10279
+ } },
10280
+ ...fila2
10281
+ // { icons:[Delete], onClick: backspace, className: 'text-xs' },
10282
+ ],
10283
+ [
10284
+ { label: "caps", onClick: handleCaps },
10285
+ ...fila3
10286
+ ],
10287
+ [
10288
+ {
10289
+ label: "",
10290
+ icons: [shiftLabel],
10291
+ onClick: handleShift,
10292
+ className: "flex-1",
10293
+ isActive: shiftActive
10294
+ },
10295
+ ...fila4,
10296
+ { label: ".", onClick: () => handleKey(".") },
10297
+ { label: "-", onClick: () => handleKey("-") },
10298
+ { label: "_", onClick: () => handleKey("_") }
10299
+ ],
10300
+ [
10301
+ { label: "?123", onClick: () => setMode("symbols"), className: "flex-[2]" },
10302
+ { label: " ", onClick: () => handleKey(" "), className: "flex-[4]" },
10303
+ { label: "Enter", onClick: onEnter, className: "flex-[2] bg-green-200" }
10304
+ ]
10305
+ ]
10306
+ }
10307
+ )
10308
+ ] });
10309
+ };
10310
+
10311
+ // src/components/custom/form/inputs/base/definitions.ts
10312
+ var flattenFields = (fields, onAnyFieldChange) => {
10313
+ const result = [];
10314
+ for (const field of fields) {
10315
+ if (Array.isArray(field)) {
10316
+ result.push(...flattenFields(field));
10317
+ } else if (field.fields) {
10318
+ result.push(...flattenFields(field.fields));
10319
+ } else {
10320
+ if (onAnyFieldChange) field.onAnyFieldChange = (data) => onAnyFieldChange(data);
10321
+ result.push(field);
10322
+ }
10323
+ }
10324
+ return result;
10325
+ };
10326
+ var TextInputType = /* @__PURE__ */ ((TextInputType2) => {
10327
+ TextInputType2["DEFAULT"] = "default";
10328
+ TextInputType2["NUMBER"] = "number";
10329
+ TextInputType2["EMAIL"] = "email";
10330
+ TextInputType2["PHONE"] = "phone";
10331
+ TextInputType2["PASSWORD"] = "password";
10332
+ return TextInputType2;
10333
+ })(TextInputType || {});
10334
+ var keyboardMap = {
10335
+ ["qwerty" /* QWERTY */]: QwertyKeyboard,
10336
+ ["qwerty_not_chars" /* QWERTY_NOT_CHARS */]: QwertyKeyboard,
10337
+ ["number" /* NUMBER */]: QwertyKeyboard
10338
+ };
10339
+ var KeyboardFactory = class {
10340
+ static create(typeKeyboard, input) {
10341
+ const inputKbType = input?.keyboardType;
10342
+ let keyboardType = typeKeyboard ?? "qwerty" /* QWERTY */;
10343
+ if (inputKbType) {
10344
+ if (inputKbType == "number" /* NUMBER */) keyboardType = "number" /* NUMBER */;
10345
+ }
10346
+ const keyboardClass = keyboardMap[keyboardType] ?? QwertyKeyboard;
10347
+ const instance = new keyboardClass();
10348
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: instance.render() });
10349
+ }
10350
+ };
9871
10351
 
9872
10352
  // src/components/custom/form/input-errors.ts
9873
10353
  var validationMessages = {
@@ -9938,30 +10418,6 @@ var isValidField = (input, form, defaultValue) => {
9938
10418
  return !fieldState.error && value !== void 0 && value !== "";
9939
10419
  };
9940
10420
 
9941
- // src/components/custom/form/inputs/base/definitions.ts
9942
- var flattenFields = (fields, onAnyFieldChange) => {
9943
- const result = [];
9944
- for (const field of fields) {
9945
- if (Array.isArray(field)) {
9946
- result.push(...flattenFields(field));
9947
- } else if (field.fields) {
9948
- result.push(...flattenFields(field.fields));
9949
- } else {
9950
- if (onAnyFieldChange) field.onAnyFieldChange = (data) => onAnyFieldChange(data);
9951
- result.push(field);
9952
- }
9953
- }
9954
- return result;
9955
- };
9956
- var TextInputType = /* @__PURE__ */ ((TextInputType2) => {
9957
- TextInputType2["DEFAULT"] = "default";
9958
- TextInputType2["NUMBER"] = "number";
9959
- TextInputType2["EMAIL"] = "email";
9960
- TextInputType2["PHONE"] = "phone";
9961
- TextInputType2["PASSWORD"] = "password";
9962
- return TextInputType2;
9963
- })(TextInputType || {});
9964
-
9965
10421
  // src/components/custom/form/inputs/base/input-types.ts
9966
10422
  var InputTypes = /* @__PURE__ */ ((InputTypes2) => {
9967
10423
  InputTypes2["HIDDEN"] = "hidden";
@@ -10108,7 +10564,166 @@ function AccordionContent({
10108
10564
  }
10109
10565
  );
10110
10566
  }
10111
- var badgeVariants = classVarianceAuthority.cva(
10567
+ function AlertDialog({
10568
+ ...props
10569
+ }) {
10570
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Root, { "data-slot": "alert-dialog", ...props });
10571
+ }
10572
+ function AlertDialogTrigger({
10573
+ ...props
10574
+ }) {
10575
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
10576
+ }
10577
+ function AlertDialogPortal({
10578
+ ...props
10579
+ }) {
10580
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.AlertDialog.Portal, { "data-slot": "alert-dialog-portal", ...props });
10581
+ }
10582
+ function AlertDialogOverlay({
10583
+ className,
10584
+ ...props
10585
+ }) {
10586
+ return /* @__PURE__ */ jsxRuntime.jsx(
10587
+ radixUi.AlertDialog.Overlay,
10588
+ {
10589
+ "data-slot": "alert-dialog-overlay",
10590
+ className: cn(
10591
+ "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
10592
+ className
10593
+ ),
10594
+ ...props
10595
+ }
10596
+ );
10597
+ }
10598
+ function AlertDialogContent({
10599
+ className,
10600
+ size = "default",
10601
+ ...props
10602
+ }) {
10603
+ return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
10604
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
10605
+ /* @__PURE__ */ jsxRuntime.jsx(
10606
+ radixUi.AlertDialog.Content,
10607
+ {
10608
+ "data-slot": "alert-dialog-content",
10609
+ "data-size": size,
10610
+ className: cn(
10611
+ "group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",
10612
+ className
10613
+ ),
10614
+ ...props
10615
+ }
10616
+ )
10617
+ ] });
10618
+ }
10619
+ function AlertDialogHeader({
10620
+ className,
10621
+ ...props
10622
+ }) {
10623
+ return /* @__PURE__ */ jsxRuntime.jsx(
10624
+ "div",
10625
+ {
10626
+ "data-slot": "alert-dialog-header",
10627
+ className: cn(
10628
+ "grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
10629
+ className
10630
+ ),
10631
+ ...props
10632
+ }
10633
+ );
10634
+ }
10635
+ function AlertDialogFooter({
10636
+ className,
10637
+ ...props
10638
+ }) {
10639
+ return /* @__PURE__ */ jsxRuntime.jsx(
10640
+ "div",
10641
+ {
10642
+ "data-slot": "alert-dialog-footer",
10643
+ className: cn(
10644
+ "flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
10645
+ className
10646
+ ),
10647
+ ...props
10648
+ }
10649
+ );
10650
+ }
10651
+ function AlertDialogTitle({
10652
+ className,
10653
+ ...props
10654
+ }) {
10655
+ return /* @__PURE__ */ jsxRuntime.jsx(
10656
+ radixUi.AlertDialog.Title,
10657
+ {
10658
+ "data-slot": "alert-dialog-title",
10659
+ className: cn(
10660
+ "text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
10661
+ className
10662
+ ),
10663
+ ...props
10664
+ }
10665
+ );
10666
+ }
10667
+ function AlertDialogDescription({
10668
+ className,
10669
+ ...props
10670
+ }) {
10671
+ return /* @__PURE__ */ jsxRuntime.jsx(
10672
+ radixUi.AlertDialog.Description,
10673
+ {
10674
+ "data-slot": "alert-dialog-description",
10675
+ className: cn("text-sm text-muted-foreground", className),
10676
+ ...props
10677
+ }
10678
+ );
10679
+ }
10680
+ function AlertDialogMedia({
10681
+ className,
10682
+ ...props
10683
+ }) {
10684
+ return /* @__PURE__ */ jsxRuntime.jsx(
10685
+ "div",
10686
+ {
10687
+ "data-slot": "alert-dialog-media",
10688
+ className: cn(
10689
+ "mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
10690
+ className
10691
+ ),
10692
+ ...props
10693
+ }
10694
+ );
10695
+ }
10696
+ function AlertDialogAction({
10697
+ className,
10698
+ variant = "default",
10699
+ size = "default",
10700
+ ...props
10701
+ }) {
10702
+ return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
10703
+ radixUi.AlertDialog.Action,
10704
+ {
10705
+ "data-slot": "alert-dialog-action",
10706
+ className: cn(className),
10707
+ ...props
10708
+ }
10709
+ ) });
10710
+ }
10711
+ function AlertDialogCancel({
10712
+ className,
10713
+ variant = "outline",
10714
+ size = "default",
10715
+ ...props
10716
+ }) {
10717
+ return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
10718
+ radixUi.AlertDialog.Cancel,
10719
+ {
10720
+ "data-slot": "alert-dialog-cancel",
10721
+ className: cn(className),
10722
+ ...props
10723
+ }
10724
+ ) });
10725
+ }
10726
+ var badgeVariants = classVarianceAuthority.cva(
10112
10727
  "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
10113
10728
  {
10114
10729
  variants: {
@@ -10225,52 +10840,6 @@ function ButtonGroupSeparator({
10225
10840
  }
10226
10841
  );
10227
10842
  }
10228
- var buttonVariants = classVarianceAuthority.cva(
10229
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
10230
- {
10231
- variants: {
10232
- variant: {
10233
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
10234
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
10235
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
10236
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
10237
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
10238
- link: "text-primary underline-offset-4 hover:underline"
10239
- },
10240
- size: {
10241
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
10242
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
10243
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
10244
- icon: "size-9",
10245
- "icon-sm": "size-8",
10246
- "icon-lg": "size-10"
10247
- }
10248
- },
10249
- defaultVariants: {
10250
- variant: "default",
10251
- size: "default"
10252
- }
10253
- }
10254
- );
10255
- function Button({
10256
- className,
10257
- variant = "default",
10258
- size = "default",
10259
- asChild = false,
10260
- ...props
10261
- }) {
10262
- const Comp = asChild ? reactSlot.Slot : "button";
10263
- return /* @__PURE__ */ jsxRuntime.jsx(
10264
- Comp,
10265
- {
10266
- "data-slot": "button",
10267
- "data-variant": variant,
10268
- "data-size": size,
10269
- className: cn(buttonVariants({ variant, size, className })),
10270
- ...props
10271
- }
10272
- );
10273
- }
10274
10843
  function Calendar({
10275
10844
  className,
10276
10845
  classNames,
@@ -11748,7 +12317,7 @@ function SheetOverlay({
11748
12317
  {
11749
12318
  "data-slot": "sheet-overlay",
11750
12319
  className: cn(
11751
- "fixed inset-0 z-50 bg-black/10 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
12320
+ "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
11752
12321
  className
11753
12322
  ),
11754
12323
  ...props
@@ -11768,29 +12337,21 @@ function SheetContent({
11768
12337
  radixUi.Dialog.Content,
11769
12338
  {
11770
12339
  "data-slot": "sheet-content",
11771
- "data-side": side,
11772
12340
  className: cn(
11773
- "fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
12341
+ "fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
12342
+ side === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
12343
+ side === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
12344
+ side === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
12345
+ side === "bottom" && "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
11774
12346
  className
11775
12347
  ),
11776
12348
  ...props,
11777
12349
  children: [
11778
12350
  children,
11779
- showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "sheet-close", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
11780
- Button,
11781
- {
11782
- variant: "ghost",
11783
- className: "absolute top-3 right-3",
11784
- size: "icon-sm",
11785
- children: [
11786
- /* @__PURE__ */ jsxRuntime.jsx(
11787
- lucideReact.XIcon,
11788
- {}
11789
- ),
11790
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
11791
- ]
11792
- }
11793
- ) })
12351
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Close, { className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
12352
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
12353
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
12354
+ ] })
11794
12355
  ]
11795
12356
  }
11796
12357
  )
@@ -11801,7 +12362,7 @@ function SheetHeader({ className, ...props }) {
11801
12362
  "div",
11802
12363
  {
11803
12364
  "data-slot": "sheet-header",
11804
- className: cn("flex flex-col gap-0.5 p-4", className),
12365
+ className: cn("flex flex-col gap-1.5 p-4", className),
11805
12366
  ...props
11806
12367
  }
11807
12368
  );
@@ -11824,10 +12385,7 @@ function SheetTitle({
11824
12385
  radixUi.Dialog.Title,
11825
12386
  {
11826
12387
  "data-slot": "sheet-title",
11827
- className: cn(
11828
- "font-heading text-base font-medium text-foreground",
11829
- className
11830
- ),
12388
+ className: cn("font-semibold text-foreground", className),
11831
12389
  ...props
11832
12390
  }
11833
12391
  );
@@ -12603,64 +13161,28 @@ var CurrencyInput = class extends BaseInput {
12603
13161
  }
12604
13162
  };
12605
13163
  var FieldCurrency = ({ form, input, isSubmitting }) => {
12606
- const groupConfig = input.inputGroupConfig;
12607
- input?.infoTooltip;
12608
- const autoValidate = groupConfig?.autoValidIcons;
13164
+ const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
13165
+ const setCurrentInputField = useKeyboardStore((state) => state.setCurrentInputField);
13166
+ const withKeyboard = input.withKeyboard;
13167
+ const autoValidate = input.inputGroupConfig?.autoValidIcons;
12609
13168
  const iconValidState = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { style: { color: "#00bf3e" } });
12610
13169
  const iconInvalidState = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { style: { color: "#ff8080" } });
12611
13170
  const iconLoadingState = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "animate-spin", style: { color: "#1e90ff" } });
12612
- const [isValid, setIsValid] = React3.useState(() => {
12613
- const value = form.getValues(input.name);
12614
- const fieldState = form.getFieldState(input.name);
12615
- return !fieldState.error && value !== void 0 && value !== "";
12616
- });
12617
- const defaultCurrencyFormat = {
12618
- style: "currency",
12619
- currency: "USD",
12620
- minimumFractionDigits: 2,
12621
- maximumFractionDigits: 2
12622
- };
12623
- const mask = input?.mask;
12624
- const currencyFormat = input?.currencyFormat ?? defaultCurrencyFormat;
12625
- const [rawValue, setRawValue] = React3.useState(form.getValues(input.name) ?? "");
12626
13171
  const formatter = React3.useMemo(() => {
12627
- return new Intl.NumberFormat("es-DO", currencyFormat);
12628
- }, [currencyFormat]);
12629
- const parseValue = (formatted) => {
12630
- const numeric = parseFloat(formatted.replace(/[^0-9.-]/g, ""));
13172
+ return new Intl.NumberFormat("es-DO", {
13173
+ style: "currency",
13174
+ currency: input?.currencyFormat?.currency ?? "USD",
13175
+ minimumFractionDigits: 2,
13176
+ maximumFractionDigits: 2
13177
+ });
13178
+ }, [input?.currencyFormat]);
13179
+ const parseValue = (val) => {
13180
+ const numeric = parseFloat(val.replace(/[^0-9.-]/g, ""));
12631
13181
  return isNaN(numeric) ? null : numeric;
12632
13182
  };
12633
- const formatValue = (value) => {
12634
- if (!value) return "";
12635
- const numeric = parseFloat(value.replace(/[^0-9.-]/g, ""));
12636
- if (isNaN(numeric)) return "";
12637
- if (typeof mask === "string") {
12638
- return mask.replace(/0+(?:[.,]0+)?/, formatter.format(numeric).replace(/[^\d.,]/g, ""));
12639
- }
12640
- if (mask instanceof RegExp) {
12641
- const valid = mask.test(value);
12642
- return valid ? value : rawValue;
12643
- }
12644
- return formatter.format(numeric);
12645
- };
12646
- const handleKeyDown = (e) => {
12647
- const allowedKeys = [
12648
- "Backspace",
12649
- "Delete",
12650
- "Tab",
12651
- "ArrowLeft",
12652
- "ArrowRight",
12653
- "Home",
12654
- "End"
12655
- ];
12656
- if (allowedKeys.includes(e.key)) return;
12657
- if (!/^[0-9.]$/.test(e.key)) {
12658
- e.preventDefault();
12659
- return;
12660
- }
12661
- if (e.key === "." && rawValue.includes(".")) {
12662
- e.preventDefault();
12663
- }
13183
+ const formatValue = (val) => {
13184
+ if (val === null || val === void 0) return "";
13185
+ return formatter.format(val);
12664
13186
  };
12665
13187
  return /* @__PURE__ */ jsxRuntime.jsx(
12666
13188
  FormField,
@@ -12668,44 +13190,55 @@ var FieldCurrency = ({ form, input, isSubmitting }) => {
12668
13190
  control: form.control,
12669
13191
  name: input.name,
12670
13192
  render: ({ field, fieldState }) => {
12671
- const validNow = !fieldState.error && field.value !== void 0 && field.value !== "";
12672
- if (validNow !== isValid) setIsValid(validNow);
12673
- return /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: input.className, children: [
12674
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: /* @__PURE__ */ jsxRuntime.jsx("b", { children: input.label }) }),
13193
+ const [displayValue, setDisplayValue] = React3.useState(() => {
13194
+ return field.value ? formatValue(field.value) : "";
13195
+ });
13196
+ const isValid = !fieldState.error && field.value !== void 0 && field.value !== "";
13197
+ return /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: `${input.withLateralLabel ? "flex items-center gap-2" : ""} ${input.className}`, children: [
13198
+ /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { className: `${input.withLateralLabel ? "w-32 text-right" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("b", { children: input.label }) }),
12675
13199
  /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { children: [
12676
- /* @__PURE__ */ jsxRuntime.jsxs(InputGroupAddon, { children: [
12677
- /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, { children: "$" }),
12678
- input.inputGroupConfig?.textLeft && /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, { children: input.inputGroupConfig.textLeft })
12679
- ] }),
13200
+ /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { children: /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, { children: "$" }) }),
12680
13201
  /* @__PURE__ */ jsxRuntime.jsx(
12681
13202
  InputGroupInput,
12682
13203
  {
12683
- ...field,
13204
+ ref: field.ref,
13205
+ name: field.name,
12684
13206
  disabled: input.disabled || isSubmitting,
12685
- placeholder: input.placeHolder ?? "0.00",
13207
+ placeholder: "0.00",
12686
13208
  inputMode: "decimal",
12687
- value: rawValue,
12688
- onKeyDown: handleKeyDown,
13209
+ value: displayValue,
13210
+ onFocus: (e) => {
13211
+ const raw = field.value ? String(field.value) : "";
13212
+ setDisplayValue(raw);
13213
+ setCurrentInputField({ input, field });
13214
+ },
12689
13215
  onChange: (e) => {
12690
- const newVal = e.target.value;
12691
- setRawValue(newVal);
12692
- const parsed = parseValue(newVal);
12693
- if (parsed !== null) field.onChange(parsed);
13216
+ const val = e.target.value;
13217
+ setDisplayValue(val);
13218
+ const parsed = parseValue(val);
13219
+ field.onChange(parsed);
12694
13220
  handleOnChage(parsed, input, field);
12695
13221
  },
12696
- onBlur: (e) => {
12697
- const formatted = formatValue(e.target.value);
12698
- setRawValue(formatted);
12699
- },
12700
- onFocus: (e) => {
12701
- const numeric = e.target.value.replace(/[^0-9.-]/g, "");
12702
- setRawValue(numeric);
13222
+ onBlur: () => {
13223
+ const formatted = formatValue(field.value);
13224
+ setDisplayValue(formatted);
12703
13225
  }
12704
13226
  }
12705
13227
  ),
12706
13228
  /* @__PURE__ */ jsxRuntime.jsxs(InputGroupAddon, { align: "inline-end", children: [
12707
- /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, { children: currencyFormat.currency }),
12708
- input.inputGroupConfig?.textRight && /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, { children: input.inputGroupConfig.textRight }),
13229
+ /* @__PURE__ */ jsxRuntime.jsx(InputGroupText, { children: input?.currencyFormat?.currency ?? "USD" }),
13230
+ withKeyboard && /* @__PURE__ */ jsxRuntime.jsx(
13231
+ "button",
13232
+ {
13233
+ type: "button",
13234
+ className: "text-2xl",
13235
+ onClick: () => {
13236
+ setIsOpen();
13237
+ setCurrentInputField({ input, field });
13238
+ },
13239
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Keyboard, {})
13240
+ }
13241
+ ),
12709
13242
  autoValidate && /* @__PURE__ */ jsxRuntime.jsx("div", { children: isSubmitting ? iconLoadingState : isValid ? iconValidState : iconInvalidState })
12710
13243
  ] })
12711
13244
  ] }) }),
@@ -13030,61 +13563,6 @@ var FieldFileMultiUpload = ({ input, form, isSubmitting }) => {
13030
13563
  );
13031
13564
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: formField });
13032
13565
  };
13033
- var useKeyboardStore = zustand.create((set, get) => ({
13034
- activeInput: null,
13035
- inputs: {},
13036
- isOpen: false,
13037
- setIsOpen() {
13038
- set({ isOpen: !get().isOpen });
13039
- },
13040
- registerInput: (id, initialValue = "") => set((state) => ({
13041
- inputs: {
13042
- ...state.inputs,
13043
- [id]: initialValue
13044
- }
13045
- })),
13046
- unregisterInput: (id) => set((state) => {
13047
- const newInputs = { ...state.inputs };
13048
- delete newInputs[id];
13049
- return { inputs: newInputs };
13050
- }),
13051
- focusInput: (id) => set({ activeInput: id }),
13052
- write: (char) => set((state) => {
13053
- if (!state.activeInput) return state;
13054
- const current = state.inputs[state.activeInput] || "";
13055
- return {
13056
- inputs: {
13057
- ...state.inputs,
13058
- [state.activeInput]: current + char
13059
- }
13060
- };
13061
- }),
13062
- backspace: () => set((state) => {
13063
- if (!state.activeInput) return state;
13064
- const current = state.inputs[state.activeInput] || "";
13065
- return {
13066
- inputs: {
13067
- ...state.inputs,
13068
- [state.activeInput]: current.slice(0, -1)
13069
- }
13070
- };
13071
- }),
13072
- clear: () => set((state) => {
13073
- if (!state.activeInput) return state;
13074
- return {
13075
- inputs: {
13076
- ...state.inputs,
13077
- [state.activeInput]: ""
13078
- }
13079
- };
13080
- }),
13081
- setValue: (id, value) => set((state) => ({
13082
- inputs: {
13083
- ...state.inputs,
13084
- [id]: value
13085
- }
13086
- }))
13087
- }));
13088
13566
  var TextInputGroup = class extends BaseInput {
13089
13567
  render() {
13090
13568
  const { input, form, isSubmitting } = this;
@@ -13100,9 +13578,9 @@ var FieldTextGroup = ({ form, input, isSubmitting }) => {
13100
13578
  name: input.name,
13101
13579
  render: ({ field }) => {
13102
13580
  setIsValid(isValidField(input, form));
13103
- return /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: input.className, children: [
13104
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: /* @__PURE__ */ jsxRuntime.jsx("b", { children: input.label }) }),
13105
- /* @__PURE__ */ jsxRuntime.jsx(FormControl, { className: "shadow-lg", children: CustomInputGroup({
13581
+ return /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: `${input.withLateralLabel ? "flex items-center gap-2 flex-row" : ""} ${input.className}`, children: [
13582
+ /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { className: `${input.withLateralLabel ? "text-right" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("b", { children: input.label }) }),
13583
+ /* @__PURE__ */ jsxRuntime.jsx(FormControl, { className: `shadow-lg ${input.withLateralLabel ? " text-right" : ""}`, children: CustomInputGroup({
13106
13584
  input,
13107
13585
  isSubmitting,
13108
13586
  field,
@@ -13143,8 +13621,9 @@ var CustomInputGroup = ({
13143
13621
  const [showPassword, setShowPassword] = React3.useState(false);
13144
13622
  const isPasswordField = input.keyboardType === "password" /* PASSWORD */;
13145
13623
  const isNumberField = input.keyboardType === "number" /* NUMBER */;
13146
- const showInputGroupAddons = iconsRight.length > 0 || textRight || autoValidate || infoTooltip || isPasswordField;
13624
+ const showInputGroupAddons = iconsRight.length > 0 || textRight || autoValidate || infoTooltip || isPasswordField || withKeyboard;
13147
13625
  const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
13626
+ const setCurrentInputField = useKeyboardStore((state) => state.setCurrentInputField);
13148
13627
  const applyMask = (value2, mask) => {
13149
13628
  if (!mask) return value2;
13150
13629
  if (typeof mask === "string") {
@@ -13214,6 +13693,7 @@ var CustomInputGroup = ({
13214
13693
  placeholder: input.placeHolder,
13215
13694
  disabled: input.disabled || isSubmitting,
13216
13695
  onBlur: field?.onBlur,
13696
+ onFocus: () => setCurrentInputField({ input, field }),
13217
13697
  name: field?.name,
13218
13698
  ref: field?.ref,
13219
13699
  type: isPasswordField && !showPassword ? "password" : isNumberField ? "number" : "text",
@@ -13223,6 +13703,7 @@ var CustomInputGroup = ({
13223
13703
  onChange(e);
13224
13704
  }
13225
13705
  let value2 = e.target.value;
13706
+ console.log("Valor raw del input:", value2);
13226
13707
  if (isNumberField) {
13227
13708
  const numConfig = input.inputNumberConfig;
13228
13709
  const cleanValue = value2.replace(/[^\d.-]/g, "");
@@ -13259,7 +13740,18 @@ var CustomInputGroup = ({
13259
13740
  children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 20 })
13260
13741
  }
13261
13742
  ),
13262
- withKeyboard && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "text-2xl", onClick: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Keyboard, {}) }),
13743
+ withKeyboard && /* @__PURE__ */ jsxRuntime.jsx(
13744
+ "button",
13745
+ {
13746
+ type: "button",
13747
+ className: "text-2xl",
13748
+ onClick: () => {
13749
+ setIsOpen();
13750
+ setCurrentInputField({ input, field });
13751
+ },
13752
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Keyboard, {})
13753
+ }
13754
+ ),
13263
13755
  autoValidate && /* @__PURE__ */ jsxRuntime.jsx("div", { children: isSubmitting ? iconLoadingState : isValid ? iconValidState : iconInvalidState })
13264
13756
  ] })
13265
13757
  ] });
@@ -14371,12 +14863,12 @@ function FieldTextArea({ form, input, isSubmitting }) {
14371
14863
  {
14372
14864
  control: form.control,
14373
14865
  name: input.name,
14374
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: "shadow-lg", children: [
14375
- /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { children: /* @__PURE__ */ jsxRuntime.jsx("b", { children: input.label }) }),
14866
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(FormItem, { className: `shadow-lg ${input.withLateralLabel ? "flex items-center gap-2" : ""} ${input.className}`, children: [
14867
+ /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { className: `${input.withLateralLabel ? "w-32 text-right" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("b", { children: input.label }) }),
14376
14868
  /* @__PURE__ */ jsxRuntime.jsx(FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
14377
14869
  Textarea,
14378
14870
  {
14379
- className: "min-w-[260px] bg-white",
14871
+ className: "min-w-[260px]",
14380
14872
  placeholder: input.placeHolder,
14381
14873
  ...field,
14382
14874
  onChange: (event) => {
@@ -16104,7 +16596,8 @@ var FormFieldsGrid = ({
16104
16596
  isPending,
16105
16597
  readOnly,
16106
16598
  className = "",
16107
- gap = "gap-2"
16599
+ gap = "gap-2",
16600
+ py = "py-1"
16108
16601
  }) => {
16109
16602
  const values = form.watch();
16110
16603
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full grid grid-cols-1 ${gap} ${className}`, children: fields.map((inputOrGroup, idx) => {
@@ -16116,7 +16609,7 @@ var FormFieldsGrid = ({
16116
16609
  return /* @__PURE__ */ jsxRuntime.jsx(
16117
16610
  "div",
16118
16611
  {
16119
- className: "w-full flex flex-row items-start gap-4 py-3",
16612
+ className: `w-full flex flex-row items-start gap-4 ${py}`,
16120
16613
  children: visibleFields.map((field, subIdx) => {
16121
16614
  const fieldCopy2 = {
16122
16615
  ...field,
@@ -16155,6 +16648,167 @@ var FormFieldsGrid = ({
16155
16648
  );
16156
16649
  }) });
16157
16650
  };
16651
+ var CustomSheet = ({ title = "", children, childrenHeader, isOpen, className, side = "bottom" }) => {
16652
+ const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
16653
+ const storeIsOpen = useKeyboardStore((state) => state.isOpen);
16654
+ const controlledIsOpen = typeof isOpen === "boolean" ? isOpen : storeIsOpen;
16655
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: controlledIsOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side, children: [
16656
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
16657
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: title }),
16658
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetDescription, { children: [
16659
+ childrenHeader,
16660
+ children
16661
+ ] })
16662
+ ] }),
16663
+ /* @__PURE__ */ jsxRuntime.jsx(SheetFooter, {})
16664
+ ] }) });
16665
+ };
16666
+ var DynamicDialog = ({
16667
+ trigger,
16668
+ title = "Are you absolutely sure?",
16669
+ description = "This action cannot be undone.",
16670
+ cancelText = "Cancel",
16671
+ actionText = "Confirmar",
16672
+ className = "bg-red-600 text-white font-bold",
16673
+ variant = "info",
16674
+ onAction,
16675
+ children,
16676
+ listBtnConfig = [],
16677
+ btnGroupDirection = "flex-end",
16678
+ submitBtnClass = "h-16",
16679
+ iconSize = "w-16 h-16",
16680
+ btnHeightClass = "h-16",
16681
+ showActionBtn = true
16682
+ }) => {
16683
+ const getVariantStyles = () => {
16684
+ switch (variant) {
16685
+ case "info":
16686
+ return {
16687
+ container: "!bg-blue-100 !text-blue-800 dark:!bg-blue-900 dark:!text-blue-200",
16688
+ border: "!border-blue-500/30 dark:!border-blue-300/30",
16689
+ media: "bg-blue-500/10 dark:bg-blue-300/10",
16690
+ action: "text-blue-200 bg-blue-500 dark:bg-blue-300",
16691
+ icon: "text-blue-500 dark:text-blue-300",
16692
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleWarning, { className: iconSize })
16693
+ };
16694
+ case "warning":
16695
+ return {
16696
+ container: "!bg-yellow-100 !text-yellow-800 dark:!bg-yellow-900 dark:!text-yellow-200",
16697
+ border: "!border-yellow-500/30 dark:!border-yellow-300/30",
16698
+ media: "bg-yellow-500/10 dark:bg-yellow-300/10",
16699
+ action: "text-yellow-200 bg-yellow-500 dark:bg-yellow-300",
16700
+ icon: "text-yellow-500 dark:text-yellow-300",
16701
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { className: iconSize })
16702
+ };
16703
+ case "error":
16704
+ case "delete":
16705
+ return {
16706
+ container: "!bg-red-100 !text-red-800 dark:!bg-red-900 dark:!text-red-200",
16707
+ border: "!border-red-500/30 dark:!border-red-300/30",
16708
+ media: "bg-red-500/10 dark:bg-red-300/10",
16709
+ action: "text-red-200 bg-red-500 dark:bg-red-300",
16710
+ icon: "text-red-500 dark:text-red-300",
16711
+ iconNode: variant === "delete" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: iconSize }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonX, { className: iconSize })
16712
+ };
16713
+ case "success":
16714
+ return {
16715
+ container: "!bg-green-100 !text-green-800 dark:!bg-green-900 dark:!text-green-200",
16716
+ border: "!border-green-500/30 dark:!border-green-300/30",
16717
+ media: "bg-green-500/10 dark:bg-green-300/10",
16718
+ action: "text-green-200 bg-green-500 dark:bg-green-300",
16719
+ icon: "text-green-500 dark:text-green-300",
16720
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: iconSize })
16721
+ };
16722
+ case "confirm":
16723
+ return {
16724
+ container: "!bg-purple-100 !text-purple-800 dark:!bg-purple-900 dark:!text-purple-200",
16725
+ border: "!border-purple-500/30 dark:!border-purple-300/30",
16726
+ media: "bg-purple-500/10 dark:bg-purple-300/10",
16727
+ action: "text-purple-200 bg-purple-500 dark:bg-purple-300",
16728
+ icon: "text-purple-500 dark:text-purple-300",
16729
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleQuestionMark, { className: iconSize })
16730
+ };
16731
+ }
16732
+ };
16733
+ const styles = getVariantStyles();
16734
+ console.log("onAction", onAction);
16735
+ return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialog, { children: [
16736
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", children: "Show Dialog" }) }),
16737
+ /* @__PURE__ */ jsxRuntime.jsxs(
16738
+ AlertDialogContent,
16739
+ {
16740
+ className: cn(
16741
+ "w-50 h-fit font-mono border-x-8",
16742
+ styles.container,
16743
+ styles.border
16744
+ ),
16745
+ children: [
16746
+ /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogHeader, { className: "justify-center w-full text-center", children: [
16747
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
16748
+ AlertDialogMedia,
16749
+ {
16750
+ className: cn(
16751
+ styles.media,
16752
+ "rounded-full flex items-center justify-center",
16753
+ iconSize
16754
+ // 🔥 ahora controla también el contenedor
16755
+ ),
16756
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.icon, children: styles.iconNode })
16757
+ }
16758
+ ) }),
16759
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDialogTitle, { className: "text-2xl", children: title }) }),
16760
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogDescription, { className: "text-xl text-center", children: description })
16761
+ ] }),
16762
+ children,
16763
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsxs(
16764
+ ButtonGroup,
16765
+ {
16766
+ className: "flex w-full",
16767
+ style: {
16768
+ justifyContent: btnGroupDirection,
16769
+ alignItems: "center"
16770
+ },
16771
+ children: [
16772
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogCancel, { className: cn("flex-1", btnHeightClass), children: cancelText }),
16773
+ listBtnConfig.map((btn, key) => /* @__PURE__ */ jsxRuntime.jsx(
16774
+ Button,
16775
+ {
16776
+ type: btn.btnType,
16777
+ size: "lg",
16778
+ className: cn(btnHeightClass, submitBtnClass),
16779
+ variant: btn.variant,
16780
+ onClick: btn.onClick,
16781
+ disabled: btn.disabled,
16782
+ children: btn.label
16783
+ },
16784
+ key
16785
+ )),
16786
+ onAction && showActionBtn && /* @__PURE__ */ jsxRuntime.jsx(
16787
+ AlertDialogAction,
16788
+ {
16789
+ onClick: (e) => {
16790
+ e.preventDefault();
16791
+ if (onAction) {
16792
+ onAction();
16793
+ }
16794
+ },
16795
+ className: cn(
16796
+ "flex-1",
16797
+ btnHeightClass,
16798
+ className,
16799
+ styles.action
16800
+ ),
16801
+ children: actionText
16802
+ }
16803
+ )
16804
+ ]
16805
+ }
16806
+ ) })
16807
+ ]
16808
+ }
16809
+ )
16810
+ ] });
16811
+ };
16158
16812
  var DynamicForm = ({
16159
16813
  formTitle,
16160
16814
  formSubTitle,
@@ -16183,9 +16837,13 @@ var DynamicForm = ({
16183
16837
  isWrapInWizard = false,
16184
16838
  totalSteps = 0,
16185
16839
  currentStep = 1,
16186
- submitBtnIcon = lucideReact.Save
16840
+ submitBtnIcon = lucideReact.Save,
16841
+ dialogTitle = "\xBFEst\xE1s seguro?",
16842
+ dialogDescription = "Esta acci\xF3n no se puede deshacer. \xBFDeseas continuar?",
16843
+ withConfirmDialog = false
16187
16844
  }) => {
16188
16845
  const [isPending, startTransition] = React3.useTransition();
16846
+ const currentInputField = useKeyboardStore((state) => state.currentInputField);
16189
16847
  const schema = React3.useMemo(() => {
16190
16848
  const allFields = flattenFields(fields, onAnyFieldChange);
16191
16849
  return getDynamicSchema(allFields, extraValidations);
@@ -16214,14 +16872,46 @@ var DynamicForm = ({
16214
16872
  const resp = { data, form };
16215
16873
  onClick(resp);
16216
16874
  };
16875
+ const withConfirm = /* @__PURE__ */ jsxRuntime.jsx(
16876
+ DynamicDialog,
16877
+ {
16878
+ trigger: /* @__PURE__ */ jsxRuntime.jsxs(
16879
+ Button,
16880
+ {
16881
+ variant: "secondary",
16882
+ size: "lg",
16883
+ type: "button",
16884
+ disabled: isPending,
16885
+ className: "flex items-center gap-3 w-full h-16 px-4 py-3 text-sm hover:bg-zinc-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
16886
+ children: [
16887
+ submitBtnLabel,
16888
+ (totalSteps == 0 || totalSteps == currentStep) && submitBtnIcon && React3__namespace.default.createElement(submitBtnIcon, { className: "h-5 w-5 mr-2" })
16889
+ ]
16890
+ }
16891
+ ),
16892
+ title: dialogTitle,
16893
+ description: dialogDescription,
16894
+ cancelText: "Cancelar",
16895
+ actionText: submitBtnLabel ?? "Procesar",
16896
+ variant: "warning",
16897
+ onAction: onClick ? handleClick : void 0
16898
+ }
16899
+ );
16217
16900
  const formBody = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16901
+ /* @__PURE__ */ jsxRuntime.jsx(
16902
+ CustomSheet,
16903
+ {
16904
+ children: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */) })
16905
+ }
16906
+ ),
16218
16907
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full grid grid-cols-1", children: [
16219
16908
  /* @__PURE__ */ jsxRuntime.jsx(
16220
16909
  FormFieldsGrid,
16221
16910
  {
16222
16911
  fields,
16223
16912
  form,
16224
- readOnly
16913
+ readOnly,
16914
+ gap: "gap-1"
16225
16915
  }
16226
16916
  ),
16227
16917
  children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-2 w-full h-full", children })
@@ -16245,7 +16935,7 @@ var DynamicForm = ({
16245
16935
  },
16246
16936
  key
16247
16937
  )),
16248
- !readOnly && withSubmitBtn && /* @__PURE__ */ jsxRuntime.jsx(
16938
+ !readOnly && withSubmitBtn && (withConfirmDialog ? withConfirm : /* @__PURE__ */ jsxRuntime.jsx(
16249
16939
  Button,
16250
16940
  {
16251
16941
  type: onClick ? "button" : "submit",
@@ -16261,7 +16951,7 @@ var DynamicForm = ({
16261
16951
  (totalSteps == 0 || totalSteps == currentStep) && submitBtnIcon && React3__namespace.default.createElement(submitBtnIcon, { className: "h-5 w-5 mr-2" })
16262
16952
  ] })
16263
16953
  }
16264
- )
16954
+ ))
16265
16955
  ] })
16266
16956
  ] });
16267
16957
  const formContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -16273,7 +16963,7 @@ var DynamicForm = ({
16273
16963
  formSubTitle && /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: formSubTitle })
16274
16964
  ] })
16275
16965
  ] }),
16276
- childrenHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-2 w-full h-full", children: childrenHeader })
16966
+ childrenHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-1 w-full h-full", children: childrenHeader })
16277
16967
  ] }),
16278
16968
  withErrorsAlert && errorAlertPosition === "up" && /* @__PURE__ */ jsxRuntime.jsx(
16279
16969
  FormErrorsAlert,
@@ -16309,7 +16999,7 @@ var FormWrapper = ({ form, handleSubmit, children, readOnly, debug, isWrapInWiza
16309
16999
  "form",
16310
17000
  {
16311
17001
  onSubmit: form.handleSubmit(handleSubmit),
16312
- className: `flex flex-col gap-2 ${readOnly ? "opacity-70 pointer-events-none select-none" : ""}`,
17002
+ className: `flex flex-col gap-1 ${readOnly ? "opacity-70 pointer-events-none select-none" : ""}`,
16313
17003
  children: [
16314
17004
  children,
16315
17005
  debug && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-4 p-3 bg-muted text-xs rounded", children: JSON.stringify(allValues, null, 2) })
@@ -16539,18 +17229,6 @@ var InputList = ({ handleAddInput, inputsTypes }) => {
16539
17229
  );
16540
17230
  }) });
16541
17231
  };
16542
- var CustomSheet = ({ title = "", children, childrenHeader, isOpen, className, side = "bottom" }) => {
16543
- const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
16544
- const storeIsOpen = useKeyboardStore((state) => state.isOpen);
16545
- const controlledIsOpen = typeof isOpen === "boolean" ? isOpen : storeIsOpen;
16546
- return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: controlledIsOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side, children: [
16547
- /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
16548
- /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: title }),
16549
- /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: childrenHeader })
16550
- ] }),
16551
- /* @__PURE__ */ jsxRuntime.jsx(SheetFooter, { children })
16552
- ] }) });
16553
- };
16554
17232
  var GenericFilter = ({
16555
17233
  filters = [],
16556
17234
  pagination,
@@ -16777,6 +17455,7 @@ exports.AlertDescription = AlertDescription;
16777
17455
  exports.AlertTitle = AlertTitle;
16778
17456
  exports.Badge = Badge;
16779
17457
  exports.BaseInput = BaseInput;
17458
+ exports.BaseKeyboard = BaseKeyboard;
16780
17459
  exports.Button = Button;
16781
17460
  exports.ButtonGroup = ButtonGroup;
16782
17461
  exports.ButtonGroupInput = ButtonGroupInput;
@@ -16873,7 +17552,12 @@ exports.InputOTPGroup = InputOTPGroup;
16873
17552
  exports.InputOTPSeparator = InputOTPSeparator;
16874
17553
  exports.InputOTPSlot = InputOTPSlot;
16875
17554
  exports.InputTypes = InputTypes;
17555
+ exports.Key = Key;
16876
17556
  exports.KeyValueListInput = KeyValueListInput;
17557
+ exports.KeyboardBuilder = KeyboardBuilder;
17558
+ exports.KeyboardFactory = KeyboardFactory;
17559
+ exports.KeyboardQwerty = KeyboardQwerty;
17560
+ exports.KeyboardTypes = KeyboardTypes;
16877
17561
  exports.Label = Label;
16878
17562
  exports.MultiSelectInput = MultiSelectInput;
16879
17563
  exports.NumberInput = NumberInput;
@@ -16882,6 +17566,7 @@ exports.Popover = Popover;
16882
17566
  exports.PopoverAnchor = PopoverAnchor;
16883
17567
  exports.PopoverContent = PopoverContent;
16884
17568
  exports.PopoverTrigger = PopoverTrigger;
17569
+ exports.QwertyKeyboard = QwertyKeyboard;
16885
17570
  exports.RadioGroup = RadioGroup;
16886
17571
  exports.RadioGroupInput = RadioGroupInput;
16887
17572
  exports.RadioGroupItem = RadioGroupItem;
@@ -16928,6 +17613,7 @@ exports.TooltipContent = TooltipContent;
16928
17613
  exports.TooltipProvider = TooltipProvider;
16929
17614
  exports.TooltipTrigger = TooltipTrigger;
16930
17615
  exports.WizardForm = WizardForm;
17616
+ exports.applyCase = applyCase;
16931
17617
  exports.badgeVariants = badgeVariants;
16932
17618
  exports.buttonGroupVariants = buttonGroupVariants;
16933
17619
  exports.buttonVariants = buttonVariants;
@@ -16943,10 +17629,12 @@ exports.getFieldLabel = getFieldLabel;
16943
17629
  exports.handleOnChage = handleOnChage;
16944
17630
  exports.inputFieldComp = inputFieldComp;
16945
17631
  exports.isValidField = isValidField;
17632
+ exports.letter = letter;
16946
17633
  exports.mockFields = mockFields;
16947
17634
  exports.useDynamicForm = useDynamicForm;
16948
17635
  exports.useFormField = useFormField;
16949
17636
  exports.useFormPersist = useFormPersist;
17637
+ exports.useKeyboardStore = useKeyboardStore;
16950
17638
  exports.validationMessages = validationMessages;
16951
17639
  //# sourceMappingURL=index.cjs.map
16952
17640
  //# sourceMappingURL=index.cjs.map