shadcn-zod-formkit 3.3.0 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6,30 +6,32 @@ 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');
14
+ var SeparatorPrimitive = require('@radix-ui/react-separator');
12
15
  var reactDayPicker = require('react-day-picker');
13
16
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
14
17
  var reactColorPalette = require('react-color-palette');
15
18
  var PopoverPrimitive = require('@radix-ui/react-popover');
16
19
  require('react-color-palette/css');
20
+ var cmdk = require('cmdk');
17
21
  var DialogPrimitive = require('@radix-ui/react-dialog');
18
22
  var LabelPrimitive = require('@radix-ui/react-label');
19
- var SeparatorPrimitive = require('@radix-ui/react-separator');
20
23
  var inputOtp = require('input-otp');
21
24
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
22
25
  var ResizablePrimitive = require('react-resizable-panels');
23
26
  var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
24
27
  var SelectPrimitive = require('@radix-ui/react-select');
28
+ var SliderPrimitive = require('@radix-ui/react-slider');
25
29
  var nextThemes = require('next-themes');
26
30
  var sonner = require('sonner');
27
31
  var SwitchPrimitive = require('@radix-ui/react-switch');
32
+ var TabsPrimitive = require('@radix-ui/react-tabs');
28
33
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
29
- var cmdk = require('cmdk');
30
34
  var dateFns = require('date-fns');
31
- var TabsPrimitive = require('@radix-ui/react-tabs');
32
- var SliderPrimitive = require('@radix-ui/react-slider');
33
35
  var core = require('@dnd-kit/core');
34
36
  var sortable = require('@dnd-kit/sortable');
35
37
  var utilities = require('@dnd-kit/utilities');
@@ -58,19 +60,19 @@ function _interopNamespace(e) {
58
60
 
59
61
  var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
60
62
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
63
+ var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
61
64
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
62
65
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
63
66
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
64
67
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
65
- var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
66
68
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
67
69
  var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrimitive);
68
70
  var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
69
71
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
72
+ var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
70
73
  var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
71
- var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
72
74
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
73
- var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
75
+ var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
74
76
  var z2__default = /*#__PURE__*/_interopDefault(z2);
75
77
 
76
78
  var __create = Object.create;
@@ -8752,12 +8754,12 @@ var require_leaflet_src = __commonJS({
8752
8754
  toBack(layer._container);
8753
8755
  }
8754
8756
  };
8755
- var create = Browser.vml ? vmlCreate : svgCreate;
8757
+ var create2 = Browser.vml ? vmlCreate : svgCreate;
8756
8758
  var SVG = Renderer.extend({
8757
8759
  _initContainer: function() {
8758
- this._container = create("svg");
8760
+ this._container = create2("svg");
8759
8761
  this._container.setAttribute("pointer-events", "none");
8760
- this._rootGroup = create("g");
8762
+ this._rootGroup = create2("g");
8761
8763
  this._container.appendChild(this._rootGroup);
8762
8764
  },
8763
8765
  _destroyContainer: function() {
@@ -8784,7 +8786,7 @@ var require_leaflet_src = __commonJS({
8784
8786
  },
8785
8787
  // methods below are called by vector layers implementations
8786
8788
  _initPath: function(layer) {
8787
- var path = layer._path = create("path");
8789
+ var path = layer._path = create2("path");
8788
8790
  if (layer.options.className) {
8789
8791
  addClass(path, layer.options.className);
8790
8792
  }
@@ -8919,7 +8921,7 @@ var require_leaflet_src = __commonJS({
8919
8921
  function rectangle(latLngBounds, options) {
8920
8922
  return new Rectangle(latLngBounds, options);
8921
8923
  }
8922
- SVG.create = create;
8924
+ SVG.create = create2;
8923
8925
  SVG.pointsToPath = pointsToPath;
8924
8926
  GeoJSON.geometryToLayer = geometryToLayer;
8925
8927
  GeoJSON.coordsToLatLng = coordsToLatLng;
@@ -9227,7 +9229,7 @@ var require_leaflet_src = __commonJS({
9227
9229
  // Amount of pixels to pan when pressing an arrow key.
9228
9230
  keyboardPanDelta: 80
9229
9231
  });
9230
- var Keyboard = Handler.extend({
9232
+ var Keyboard2 = Handler.extend({
9231
9233
  keyCodes: {
9232
9234
  left: [37],
9233
9235
  right: [39],
@@ -9345,7 +9347,7 @@ var require_leaflet_src = __commonJS({
9345
9347
  stop(e);
9346
9348
  }
9347
9349
  });
9348
- Map2.addInitHook("addHandler", "keyboard", Keyboard);
9350
+ Map2.addInitHook("addHandler", "keyboard", Keyboard2);
9349
9351
  Map2.mergeOptions({
9350
9352
  // @section Mouse wheel options
9351
9353
  // @option scrollWheelZoom: Boolean|String = true
@@ -9563,7 +9565,7 @@ var require_leaflet_src = __commonJS({
9563
9565
  Map2.BoxZoom = BoxZoom;
9564
9566
  Map2.DoubleClickZoom = DoubleClickZoom;
9565
9567
  Map2.Drag = Drag;
9566
- Map2.Keyboard = Keyboard;
9568
+ Map2.Keyboard = Keyboard2;
9567
9569
  Map2.ScrollWheelZoom = ScrollWheelZoom;
9568
9570
  Map2.TapHold = TapHold;
9569
9571
  Map2.TouchZoom = TouchZoom;
@@ -9866,6 +9868,486 @@ var CustomAlert = ({
9866
9868
  }
9867
9869
  );
9868
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
+ };
9869
10351
 
9870
10352
  // src/components/custom/form/input-errors.ts
9871
10353
  var validationMessages = {
@@ -9936,30 +10418,6 @@ var isValidField = (input, form, defaultValue) => {
9936
10418
  return !fieldState.error && value !== void 0 && value !== "";
9937
10419
  };
9938
10420
 
9939
- // src/components/custom/form/inputs/base/definitions.ts
9940
- var flattenFields = (fields, onAnyFieldChange) => {
9941
- const result = [];
9942
- for (const field of fields) {
9943
- if (Array.isArray(field)) {
9944
- result.push(...flattenFields(field));
9945
- } else if (field.fields) {
9946
- result.push(...flattenFields(field.fields));
9947
- } else {
9948
- if (onAnyFieldChange) field.onAnyFieldChange = (data) => onAnyFieldChange(data);
9949
- result.push(field);
9950
- }
9951
- }
9952
- return result;
9953
- };
9954
- var TextInputType = /* @__PURE__ */ ((TextInputType2) => {
9955
- TextInputType2["DEFAULT"] = "default";
9956
- TextInputType2["NUMBER"] = "number";
9957
- TextInputType2["EMAIL"] = "email";
9958
- TextInputType2["PHONE"] = "phone";
9959
- TextInputType2["PASSWORD"] = "password";
9960
- return TextInputType2;
9961
- })(TextInputType || {});
9962
-
9963
10421
  // src/components/custom/form/inputs/base/input-types.ts
9964
10422
  var InputTypes = /* @__PURE__ */ ((InputTypes2) => {
9965
10423
  InputTypes2["HIDDEN"] = "hidden";
@@ -10106,80 +10564,278 @@ function AccordionContent({
10106
10564
  }
10107
10565
  );
10108
10566
  }
10109
- var badgeVariants = classVarianceAuthority.cva(
10110
- "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",
10111
- {
10112
- variants: {
10113
- variant: {
10114
- default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
10115
- secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
10116
- destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
10117
- outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
10118
- }
10119
- },
10120
- defaultVariants: {
10121
- variant: "default"
10122
- }
10123
- }
10124
- );
10125
- function Badge({
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({
10126
10583
  className,
10127
- variant,
10128
- asChild = false,
10129
10584
  ...props
10130
10585
  }) {
10131
- const Comp = asChild ? reactSlot.Slot : "span";
10132
10586
  return /* @__PURE__ */ jsxRuntime.jsx(
10133
- Comp,
10587
+ radixUi.AlertDialog.Overlay,
10134
10588
  {
10135
- "data-slot": "badge",
10136
- className: cn(badgeVariants({ variant }), className),
10137
- ...props
10138
- }
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
+ }
10139
10596
  );
10140
10597
  }
10141
- var buttonVariants = classVarianceAuthority.cva(
10142
- "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",
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(
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",
10143
10728
  {
10144
10729
  variants: {
10145
10730
  variant: {
10146
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
10147
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
10148
- 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",
10149
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
10150
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
10151
- link: "text-primary underline-offset-4 hover:underline"
10152
- },
10153
- size: {
10154
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
10155
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
10156
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
10157
- icon: "size-9",
10158
- "icon-sm": "size-8",
10159
- "icon-lg": "size-10"
10731
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
10732
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
10733
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
10734
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
10160
10735
  }
10161
10736
  },
10162
10737
  defaultVariants: {
10163
- variant: "default",
10164
- size: "default"
10738
+ variant: "default"
10165
10739
  }
10166
10740
  }
10167
10741
  );
10168
- function Button({
10742
+ function Badge({
10169
10743
  className,
10170
- variant = "default",
10171
- size = "default",
10744
+ variant,
10172
10745
  asChild = false,
10173
10746
  ...props
10174
10747
  }) {
10175
- const Comp = asChild ? reactSlot.Slot : "button";
10748
+ const Comp = asChild ? reactSlot.Slot : "span";
10176
10749
  return /* @__PURE__ */ jsxRuntime.jsx(
10177
10750
  Comp,
10178
10751
  {
10179
- "data-slot": "button",
10180
- "data-variant": variant,
10181
- "data-size": size,
10182
- className: cn(buttonVariants({ variant, size, className })),
10752
+ "data-slot": "badge",
10753
+ className: cn(badgeVariants({ variant }), className),
10754
+ ...props
10755
+ }
10756
+ );
10757
+ }
10758
+ function Separator({
10759
+ className,
10760
+ orientation: orientation2 = "horizontal",
10761
+ decorative = true,
10762
+ ...props
10763
+ }) {
10764
+ return /* @__PURE__ */ jsxRuntime.jsx(
10765
+ SeparatorPrimitive__namespace.Root,
10766
+ {
10767
+ "data-slot": "separator",
10768
+ decorative,
10769
+ orientation: orientation2,
10770
+ className: cn(
10771
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
10772
+ className
10773
+ ),
10774
+ ...props
10775
+ }
10776
+ );
10777
+ }
10778
+ var buttonGroupVariants = classVarianceAuthority.cva(
10779
+ "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
10780
+ {
10781
+ variants: {
10782
+ orientation: {
10783
+ horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
10784
+ vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
10785
+ }
10786
+ },
10787
+ defaultVariants: {
10788
+ orientation: "horizontal"
10789
+ }
10790
+ }
10791
+ );
10792
+ function ButtonGroup({
10793
+ className,
10794
+ orientation: orientation2,
10795
+ ...props
10796
+ }) {
10797
+ return /* @__PURE__ */ jsxRuntime.jsx(
10798
+ "div",
10799
+ {
10800
+ role: "group",
10801
+ "data-slot": "button-group",
10802
+ "data-orientation": orientation2,
10803
+ className: cn(buttonGroupVariants({ orientation: orientation2 }), className),
10804
+ ...props
10805
+ }
10806
+ );
10807
+ }
10808
+ function ButtonGroupText({
10809
+ className,
10810
+ asChild = false,
10811
+ ...props
10812
+ }) {
10813
+ const Comp = asChild ? reactSlot.Slot : "div";
10814
+ return /* @__PURE__ */ jsxRuntime.jsx(
10815
+ Comp,
10816
+ {
10817
+ className: cn(
10818
+ "bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
10819
+ className
10820
+ ),
10821
+ ...props
10822
+ }
10823
+ );
10824
+ }
10825
+ function ButtonGroupSeparator({
10826
+ className,
10827
+ orientation: orientation2 = "vertical",
10828
+ ...props
10829
+ }) {
10830
+ return /* @__PURE__ */ jsxRuntime.jsx(
10831
+ Separator,
10832
+ {
10833
+ "data-slot": "button-group-separator",
10834
+ orientation: orientation2,
10835
+ className: cn(
10836
+ "bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
10837
+ className
10838
+ ),
10183
10839
  ...props
10184
10840
  }
10185
10841
  );
@@ -10657,48 +11313,182 @@ function DialogDescription({
10657
11313
  }
10658
11314
  );
10659
11315
  }
10660
- function Label({
11316
+ function Command({
10661
11317
  className,
10662
11318
  ...props
10663
11319
  }) {
10664
11320
  return /* @__PURE__ */ jsxRuntime.jsx(
10665
- LabelPrimitive__namespace.Root,
11321
+ cmdk.Command,
10666
11322
  {
10667
- "data-slot": "label",
11323
+ "data-slot": "command",
10668
11324
  className: cn(
10669
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
11325
+ "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
10670
11326
  className
10671
11327
  ),
10672
11328
  ...props
10673
11329
  }
10674
11330
  );
10675
11331
  }
10676
- function Separator({
11332
+ function CommandDialog({
11333
+ title = "Command Palette",
11334
+ description = "Search for a command to run...",
11335
+ children,
10677
11336
  className,
10678
- orientation: orientation2 = "horizontal",
10679
- decorative = true,
11337
+ showCloseButton = true,
10680
11338
  ...props
10681
11339
  }) {
10682
- return /* @__PURE__ */ jsxRuntime.jsx(
10683
- SeparatorPrimitive__namespace.Root,
10684
- {
10685
- "data-slot": "separator",
10686
- decorative,
10687
- orientation: orientation2,
10688
- className: cn(
10689
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
10690
- className
10691
- ),
10692
- ...props
10693
- }
10694
- );
10695
- }
10696
- function FieldSet({ className, ...props }) {
10697
- return /* @__PURE__ */ jsxRuntime.jsx(
10698
- "fieldset",
10699
- {
10700
- "data-slot": "field-set",
10701
- className: cn(
11340
+ return /* @__PURE__ */ jsxRuntime.jsxs(Dialog, { ...props, children: [
11341
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { className: "sr-only", children: [
11342
+ /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: title }),
11343
+ /* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: description })
11344
+ ] }),
11345
+ /* @__PURE__ */ jsxRuntime.jsx(
11346
+ DialogContent,
11347
+ {
11348
+ className: cn("overflow-hidden p-0", className),
11349
+ showCloseButton,
11350
+ children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
11351
+ }
11352
+ )
11353
+ ] });
11354
+ }
11355
+ function CommandInput({
11356
+ className,
11357
+ ...props
11358
+ }) {
11359
+ return /* @__PURE__ */ jsxRuntime.jsxs(
11360
+ "div",
11361
+ {
11362
+ "data-slot": "command-input-wrapper",
11363
+ className: "flex h-9 items-center gap-2 border-b px-3",
11364
+ children: [
11365
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
11366
+ /* @__PURE__ */ jsxRuntime.jsx(
11367
+ cmdk.Command.Input,
11368
+ {
11369
+ "data-slot": "command-input",
11370
+ className: cn(
11371
+ "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
11372
+ className
11373
+ ),
11374
+ ...props
11375
+ }
11376
+ )
11377
+ ]
11378
+ }
11379
+ );
11380
+ }
11381
+ function CommandList({
11382
+ className,
11383
+ ...props
11384
+ }) {
11385
+ return /* @__PURE__ */ jsxRuntime.jsx(
11386
+ cmdk.Command.List,
11387
+ {
11388
+ "data-slot": "command-list",
11389
+ className: cn(
11390
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
11391
+ className
11392
+ ),
11393
+ ...props
11394
+ }
11395
+ );
11396
+ }
11397
+ function CommandEmpty({
11398
+ ...props
11399
+ }) {
11400
+ return /* @__PURE__ */ jsxRuntime.jsx(
11401
+ cmdk.Command.Empty,
11402
+ {
11403
+ "data-slot": "command-empty",
11404
+ className: "py-6 text-center text-sm",
11405
+ ...props
11406
+ }
11407
+ );
11408
+ }
11409
+ function CommandGroup({
11410
+ className,
11411
+ ...props
11412
+ }) {
11413
+ return /* @__PURE__ */ jsxRuntime.jsx(
11414
+ cmdk.Command.Group,
11415
+ {
11416
+ "data-slot": "command-group",
11417
+ className: cn(
11418
+ "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
11419
+ className
11420
+ ),
11421
+ ...props
11422
+ }
11423
+ );
11424
+ }
11425
+ function CommandSeparator({
11426
+ className,
11427
+ ...props
11428
+ }) {
11429
+ return /* @__PURE__ */ jsxRuntime.jsx(
11430
+ cmdk.Command.Separator,
11431
+ {
11432
+ "data-slot": "command-separator",
11433
+ className: cn("bg-border -mx-1 h-px", className),
11434
+ ...props
11435
+ }
11436
+ );
11437
+ }
11438
+ function CommandItem({
11439
+ className,
11440
+ ...props
11441
+ }) {
11442
+ return /* @__PURE__ */ jsxRuntime.jsx(
11443
+ cmdk.Command.Item,
11444
+ {
11445
+ "data-slot": "command-item",
11446
+ className: cn(
11447
+ "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11448
+ className
11449
+ ),
11450
+ ...props
11451
+ }
11452
+ );
11453
+ }
11454
+ function CommandShortcut({
11455
+ className,
11456
+ ...props
11457
+ }) {
11458
+ return /* @__PURE__ */ jsxRuntime.jsx(
11459
+ "span",
11460
+ {
11461
+ "data-slot": "command-shortcut",
11462
+ className: cn(
11463
+ "text-muted-foreground ml-auto text-xs tracking-widest",
11464
+ className
11465
+ ),
11466
+ ...props
11467
+ }
11468
+ );
11469
+ }
11470
+ function Label({
11471
+ className,
11472
+ ...props
11473
+ }) {
11474
+ return /* @__PURE__ */ jsxRuntime.jsx(
11475
+ LabelPrimitive__namespace.Root,
11476
+ {
11477
+ "data-slot": "label",
11478
+ className: cn(
11479
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
11480
+ className
11481
+ ),
11482
+ ...props
11483
+ }
11484
+ );
11485
+ }
11486
+ function FieldSet({ className, ...props }) {
11487
+ return /* @__PURE__ */ jsxRuntime.jsx(
11488
+ "fieldset",
11489
+ {
11490
+ "data-slot": "field-set",
11491
+ className: cn(
10702
11492
  "flex flex-col gap-6",
10703
11493
  "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
10704
11494
  className
@@ -11510,81 +12300,353 @@ function SelectScrollDownButton({
11510
12300
  }
11511
12301
  );
11512
12302
  }
11513
- var Toaster = ({ ...props }) => {
11514
- const { theme = "system" } = nextThemes.useTheme();
11515
- return /* @__PURE__ */ jsxRuntime.jsx(
11516
- sonner.Toaster,
11517
- {
11518
- theme,
11519
- className: "toaster group",
11520
- style: {
11521
- "--normal-bg": "var(--popover)",
11522
- "--normal-text": "var(--popover-foreground)",
11523
- "--normal-border": "var(--border)"
11524
- },
11525
- ...props
11526
- }
11527
- );
11528
- };
11529
- function Switch({
12303
+ function Sheet({ ...props }) {
12304
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Root, { "data-slot": "sheet", ...props });
12305
+ }
12306
+ function SheetPortal({
12307
+ ...props
12308
+ }) {
12309
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Portal, { "data-slot": "sheet-portal", ...props });
12310
+ }
12311
+ function SheetOverlay({
11530
12312
  className,
11531
12313
  ...props
11532
12314
  }) {
11533
12315
  return /* @__PURE__ */ jsxRuntime.jsx(
11534
- SwitchPrimitive__namespace.Root,
12316
+ radixUi.Dialog.Overlay,
11535
12317
  {
11536
- "data-slot": "switch",
12318
+ "data-slot": "sheet-overlay",
11537
12319
  className: cn(
11538
- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
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",
11539
12321
  className
11540
12322
  ),
11541
- ...props,
11542
- children: /* @__PURE__ */ jsxRuntime.jsx(
11543
- SwitchPrimitive__namespace.Thumb,
11544
- {
11545
- "data-slot": "switch-thumb",
11546
- className: cn(
11547
- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
11548
- )
11549
- }
11550
- )
12323
+ ...props
11551
12324
  }
11552
12325
  );
11553
12326
  }
11554
- function TooltipProvider({
11555
- delayDuration = 0,
12327
+ function SheetContent({
12328
+ className,
12329
+ children,
12330
+ side = "right",
12331
+ showCloseButton = true,
11556
12332
  ...props
11557
12333
  }) {
12334
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
12335
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
12336
+ /* @__PURE__ */ jsxRuntime.jsxs(
12337
+ radixUi.Dialog.Content,
12338
+ {
12339
+ "data-slot": "sheet-content",
12340
+ className: cn(
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",
12346
+ className
12347
+ ),
12348
+ ...props,
12349
+ children: [
12350
+ children,
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
+ ] })
12355
+ ]
12356
+ }
12357
+ )
12358
+ ] });
12359
+ }
12360
+ function SheetHeader({ className, ...props }) {
11558
12361
  return /* @__PURE__ */ jsxRuntime.jsx(
11559
- TooltipPrimitive__namespace.Provider,
12362
+ "div",
11560
12363
  {
11561
- "data-slot": "tooltip-provider",
11562
- delayDuration,
12364
+ "data-slot": "sheet-header",
12365
+ className: cn("flex flex-col gap-1.5 p-4", className),
11563
12366
  ...props
11564
12367
  }
11565
12368
  );
11566
12369
  }
11567
- function Tooltip({
12370
+ function SheetFooter({ className, ...props }) {
12371
+ return /* @__PURE__ */ jsxRuntime.jsx(
12372
+ "div",
12373
+ {
12374
+ "data-slot": "sheet-footer",
12375
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
12376
+ ...props
12377
+ }
12378
+ );
12379
+ }
12380
+ function SheetTitle({
12381
+ className,
11568
12382
  ...props
11569
12383
  }) {
11570
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { "data-slot": "tooltip", ...props }) });
12384
+ return /* @__PURE__ */ jsxRuntime.jsx(
12385
+ radixUi.Dialog.Title,
12386
+ {
12387
+ "data-slot": "sheet-title",
12388
+ className: cn("font-semibold text-foreground", className),
12389
+ ...props
12390
+ }
12391
+ );
11571
12392
  }
11572
- function TooltipTrigger({
12393
+ function SheetDescription({
12394
+ className,
11573
12395
  ...props
11574
12396
  }) {
11575
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { "data-slot": "tooltip-trigger", ...props });
12397
+ return /* @__PURE__ */ jsxRuntime.jsx(
12398
+ radixUi.Dialog.Description,
12399
+ {
12400
+ "data-slot": "sheet-description",
12401
+ className: cn("text-sm text-muted-foreground", className),
12402
+ ...props
12403
+ }
12404
+ );
11576
12405
  }
11577
- function TooltipContent({
12406
+ function Slider({
11578
12407
  className,
11579
- sideOffset = 0,
11580
- children,
12408
+ defaultValue,
12409
+ value,
12410
+ min = 0,
12411
+ max = 100,
11581
12412
  ...props
11582
12413
  }) {
11583
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
11584
- TooltipPrimitive__namespace.Content,
12414
+ const _values = React3__namespace.useMemo(
12415
+ () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
12416
+ [value, defaultValue, min, max]
12417
+ );
12418
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12419
+ SliderPrimitive__namespace.Root,
11585
12420
  {
11586
- "data-slot": "tooltip-content",
11587
- sideOffset,
12421
+ "data-slot": "slider",
12422
+ defaultValue,
12423
+ value,
12424
+ min,
12425
+ max,
12426
+ className: cn(
12427
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
12428
+ className
12429
+ ),
12430
+ ...props,
12431
+ children: [
12432
+ /* @__PURE__ */ jsxRuntime.jsx(
12433
+ SliderPrimitive__namespace.Track,
12434
+ {
12435
+ "data-slot": "slider-track",
12436
+ className: cn(
12437
+ "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
12438
+ ),
12439
+ children: /* @__PURE__ */ jsxRuntime.jsx(
12440
+ SliderPrimitive__namespace.Range,
12441
+ {
12442
+ "data-slot": "slider-range",
12443
+ className: cn(
12444
+ "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
12445
+ )
12446
+ }
12447
+ )
12448
+ }
12449
+ ),
12450
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(
12451
+ SliderPrimitive__namespace.Thumb,
12452
+ {
12453
+ "data-slot": "slider-thumb",
12454
+ className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
12455
+ },
12456
+ index
12457
+ ))
12458
+ ]
12459
+ }
12460
+ );
12461
+ }
12462
+ var Toaster = ({ ...props }) => {
12463
+ const { theme = "system" } = nextThemes.useTheme();
12464
+ return /* @__PURE__ */ jsxRuntime.jsx(
12465
+ sonner.Toaster,
12466
+ {
12467
+ theme,
12468
+ className: "toaster group",
12469
+ style: {
12470
+ "--normal-bg": "var(--popover)",
12471
+ "--normal-text": "var(--popover-foreground)",
12472
+ "--normal-border": "var(--border)"
12473
+ },
12474
+ ...props
12475
+ }
12476
+ );
12477
+ };
12478
+ function Stepper({ steps, currentStep, clickable = false, onStepClick }) {
12479
+ const handleStepClick = (stepNumber) => {
12480
+ if (clickable && onStepClick) {
12481
+ onStepClick(stepNumber);
12482
+ }
12483
+ };
12484
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-4 items-center justify-around", children: steps.map((step, index) => {
12485
+ const stepNumber = index + 1;
12486
+ const isCompleted = stepNumber < currentStep;
12487
+ const isCurrent = stepNumber === currentStep;
12488
+ const isUpcoming = stepNumber > currentStep;
12489
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center", children: [
12490
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
12491
+ /* @__PURE__ */ jsxRuntime.jsx(
12492
+ "div",
12493
+ {
12494
+ onClick: () => handleStepClick(stepNumber),
12495
+ className: cn(
12496
+ "flex size-10 items-center shadow-lg justify-center rounded-full border-2 transition-all duration-300",
12497
+ isCompleted && "border-primary bg-primary text-primary-foreground",
12498
+ isCurrent && "border-primary bg-background text-primary scale-110",
12499
+ isUpcoming && "border-muted-foreground/60 bg-background border-b text-muted-foreground",
12500
+ clickable && "cursor-pointer hover:scale-125 hover:shadow-xl",
12501
+ !clickable && "cursor-default"
12502
+ ),
12503
+ children: isCompleted ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-5" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold", children: stepNumber })
12504
+ }
12505
+ ),
12506
+ step.title && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 text-center", children: [
12507
+ /* @__PURE__ */ jsxRuntime.jsx(
12508
+ "p",
12509
+ {
12510
+ className: cn(
12511
+ "text-sm font-medium transition-colors",
12512
+ (isCompleted || isCurrent) && "text-foreground",
12513
+ isUpcoming && "text-muted-foreground"
12514
+ ),
12515
+ children: step.title
12516
+ }
12517
+ ),
12518
+ step.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground max-w-[120px]", children: step.description })
12519
+ ] })
12520
+ ] }),
12521
+ index < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-2 flex-1 mb-8", children: /* @__PURE__ */ jsxRuntime.jsx(
12522
+ "div",
12523
+ {
12524
+ className: cn(
12525
+ "h-0.5 w-full transition-all duration-300",
12526
+ stepNumber < currentStep ? "bg-primary" : "bg-muted-foreground/30"
12527
+ )
12528
+ }
12529
+ ) })
12530
+ ] }, index);
12531
+ }) }) });
12532
+ }
12533
+ function Switch({
12534
+ className,
12535
+ ...props
12536
+ }) {
12537
+ return /* @__PURE__ */ jsxRuntime.jsx(
12538
+ SwitchPrimitive__namespace.Root,
12539
+ {
12540
+ "data-slot": "switch",
12541
+ className: cn(
12542
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
12543
+ className
12544
+ ),
12545
+ ...props,
12546
+ children: /* @__PURE__ */ jsxRuntime.jsx(
12547
+ SwitchPrimitive__namespace.Thumb,
12548
+ {
12549
+ "data-slot": "switch-thumb",
12550
+ className: cn(
12551
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
12552
+ )
12553
+ }
12554
+ )
12555
+ }
12556
+ );
12557
+ }
12558
+ function Tabs({
12559
+ className,
12560
+ ...props
12561
+ }) {
12562
+ return /* @__PURE__ */ jsxRuntime.jsx(
12563
+ TabsPrimitive__namespace.Root,
12564
+ {
12565
+ "data-slot": "tabs",
12566
+ className: cn("flex flex-col gap-2", className),
12567
+ ...props
12568
+ }
12569
+ );
12570
+ }
12571
+ function TabsList({
12572
+ className,
12573
+ ...props
12574
+ }) {
12575
+ return /* @__PURE__ */ jsxRuntime.jsx(
12576
+ TabsPrimitive__namespace.List,
12577
+ {
12578
+ "data-slot": "tabs-list",
12579
+ className: cn(
12580
+ "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
12581
+ className
12582
+ ),
12583
+ ...props
12584
+ }
12585
+ );
12586
+ }
12587
+ function TabsTrigger({
12588
+ className,
12589
+ ...props
12590
+ }) {
12591
+ return /* @__PURE__ */ jsxRuntime.jsx(
12592
+ TabsPrimitive__namespace.Trigger,
12593
+ {
12594
+ "data-slot": "tabs-trigger",
12595
+ className: cn(
12596
+ "data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
12597
+ className
12598
+ ),
12599
+ ...props
12600
+ }
12601
+ );
12602
+ }
12603
+ function TabsContent({
12604
+ className,
12605
+ ...props
12606
+ }) {
12607
+ return /* @__PURE__ */ jsxRuntime.jsx(
12608
+ TabsPrimitive__namespace.Content,
12609
+ {
12610
+ "data-slot": "tabs-content",
12611
+ className: cn("flex-1 outline-none", className),
12612
+ ...props
12613
+ }
12614
+ );
12615
+ }
12616
+ function TooltipProvider({
12617
+ delayDuration = 0,
12618
+ ...props
12619
+ }) {
12620
+ return /* @__PURE__ */ jsxRuntime.jsx(
12621
+ TooltipPrimitive__namespace.Provider,
12622
+ {
12623
+ "data-slot": "tooltip-provider",
12624
+ delayDuration,
12625
+ ...props
12626
+ }
12627
+ );
12628
+ }
12629
+ function Tooltip({
12630
+ ...props
12631
+ }) {
12632
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { "data-slot": "tooltip", ...props }) });
12633
+ }
12634
+ function TooltipTrigger({
12635
+ ...props
12636
+ }) {
12637
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { "data-slot": "tooltip-trigger", ...props });
12638
+ }
12639
+ function TooltipContent({
12640
+ className,
12641
+ sideOffset = 0,
12642
+ children,
12643
+ ...props
12644
+ }) {
12645
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
12646
+ TooltipPrimitive__namespace.Content,
12647
+ {
12648
+ "data-slot": "tooltip-content",
12649
+ sideOffset,
11588
12650
  className: cn(
11589
12651
  "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
11590
12652
  className
@@ -11741,71 +12803,6 @@ var AccordionGroupedSwitches = ({ form, input, groups = [], onChange, isSubmitti
11741
12803
  input.name
11742
12804
  );
11743
12805
  };
11744
- var buttonGroupVariants = classVarianceAuthority.cva(
11745
- "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
11746
- {
11747
- variants: {
11748
- orientation: {
11749
- horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
11750
- vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
11751
- }
11752
- },
11753
- defaultVariants: {
11754
- orientation: "horizontal"
11755
- }
11756
- }
11757
- );
11758
- function ButtonGroup({
11759
- className,
11760
- orientation: orientation2,
11761
- ...props
11762
- }) {
11763
- return /* @__PURE__ */ jsxRuntime.jsx(
11764
- "div",
11765
- {
11766
- role: "group",
11767
- "data-slot": "button-group",
11768
- "data-orientation": orientation2,
11769
- className: cn(buttonGroupVariants({ orientation: orientation2 }), className),
11770
- ...props
11771
- }
11772
- );
11773
- }
11774
- function ButtonGroupText({
11775
- className,
11776
- asChild = false,
11777
- ...props
11778
- }) {
11779
- const Comp = asChild ? reactSlot.Slot : "div";
11780
- return /* @__PURE__ */ jsxRuntime.jsx(
11781
- Comp,
11782
- {
11783
- className: cn(
11784
- "bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
11785
- className
11786
- ),
11787
- ...props
11788
- }
11789
- );
11790
- }
11791
- function ButtonGroupSeparator({
11792
- className,
11793
- orientation: orientation2 = "vertical",
11794
- ...props
11795
- }) {
11796
- return /* @__PURE__ */ jsxRuntime.jsx(
11797
- Separator,
11798
- {
11799
- "data-slot": "button-group-separator",
11800
- orientation: orientation2,
11801
- className: cn(
11802
- "bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
11803
- className
11804
- ),
11805
- ...props
11806
- }
11807
- );
11808
- }
11809
12806
  var ButtonGroupInput = class extends BaseInput {
11810
12807
  render() {
11811
12808
  const { input, form, isSubmitting } = this;
@@ -12046,168 +13043,14 @@ var ColorComp = React3__namespace.default.forwardRef(
12046
13043
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
12047
13044
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4 border border-border rounded-sm", style: { backgroundColor: color.hex, width: 20, height: 20 } }),
12048
13045
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: color.hex })
12049
- ] })
12050
- }
12051
- ) }),
12052
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-3", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(reactColorPalette.ColorPicker, { color, onChange: handlePickerChange, hideInput }) })
12053
- ] })
12054
- ] });
12055
- }
12056
- );
12057
- function Command({
12058
- className,
12059
- ...props
12060
- }) {
12061
- return /* @__PURE__ */ jsxRuntime.jsx(
12062
- cmdk.Command,
12063
- {
12064
- "data-slot": "command",
12065
- className: cn(
12066
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
12067
- className
12068
- ),
12069
- ...props
12070
- }
12071
- );
12072
- }
12073
- function CommandDialog({
12074
- title = "Command Palette",
12075
- description = "Search for a command to run...",
12076
- children,
12077
- className,
12078
- showCloseButton = true,
12079
- ...props
12080
- }) {
12081
- return /* @__PURE__ */ jsxRuntime.jsxs(Dialog, { ...props, children: [
12082
- /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { className: "sr-only", children: [
12083
- /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: title }),
12084
- /* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: description })
12085
- ] }),
12086
- /* @__PURE__ */ jsxRuntime.jsx(
12087
- DialogContent,
12088
- {
12089
- className: cn("overflow-hidden p-0", className),
12090
- showCloseButton,
12091
- children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
12092
- }
12093
- )
12094
- ] });
12095
- }
12096
- function CommandInput({
12097
- className,
12098
- ...props
12099
- }) {
12100
- return /* @__PURE__ */ jsxRuntime.jsxs(
12101
- "div",
12102
- {
12103
- "data-slot": "command-input-wrapper",
12104
- className: "flex h-9 items-center gap-2 border-b px-3",
12105
- children: [
12106
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
12107
- /* @__PURE__ */ jsxRuntime.jsx(
12108
- cmdk.Command.Input,
12109
- {
12110
- "data-slot": "command-input",
12111
- className: cn(
12112
- "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
12113
- className
12114
- ),
12115
- ...props
12116
- }
12117
- )
12118
- ]
12119
- }
12120
- );
12121
- }
12122
- function CommandList({
12123
- className,
12124
- ...props
12125
- }) {
12126
- return /* @__PURE__ */ jsxRuntime.jsx(
12127
- cmdk.Command.List,
12128
- {
12129
- "data-slot": "command-list",
12130
- className: cn(
12131
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
12132
- className
12133
- ),
12134
- ...props
12135
- }
12136
- );
12137
- }
12138
- function CommandEmpty({
12139
- ...props
12140
- }) {
12141
- return /* @__PURE__ */ jsxRuntime.jsx(
12142
- cmdk.Command.Empty,
12143
- {
12144
- "data-slot": "command-empty",
12145
- className: "py-6 text-center text-sm",
12146
- ...props
12147
- }
12148
- );
12149
- }
12150
- function CommandGroup({
12151
- className,
12152
- ...props
12153
- }) {
12154
- return /* @__PURE__ */ jsxRuntime.jsx(
12155
- cmdk.Command.Group,
12156
- {
12157
- "data-slot": "command-group",
12158
- className: cn(
12159
- "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
12160
- className
12161
- ),
12162
- ...props
12163
- }
12164
- );
12165
- }
12166
- function CommandSeparator({
12167
- className,
12168
- ...props
12169
- }) {
12170
- return /* @__PURE__ */ jsxRuntime.jsx(
12171
- cmdk.Command.Separator,
12172
- {
12173
- "data-slot": "command-separator",
12174
- className: cn("bg-border -mx-1 h-px", className),
12175
- ...props
12176
- }
12177
- );
12178
- }
12179
- function CommandItem({
12180
- className,
12181
- ...props
12182
- }) {
12183
- return /* @__PURE__ */ jsxRuntime.jsx(
12184
- cmdk.Command.Item,
12185
- {
12186
- "data-slot": "command-item",
12187
- className: cn(
12188
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
12189
- className
12190
- ),
12191
- ...props
12192
- }
12193
- );
12194
- }
12195
- function CommandShortcut({
12196
- className,
12197
- ...props
12198
- }) {
12199
- return /* @__PURE__ */ jsxRuntime.jsx(
12200
- "span",
12201
- {
12202
- "data-slot": "command-shortcut",
12203
- className: cn(
12204
- "text-muted-foreground ml-auto text-xs tracking-widest",
12205
- className
12206
- ),
12207
- ...props
12208
- }
12209
- );
12210
- }
13046
+ ] })
13047
+ }
13048
+ ) }),
13049
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-3", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(reactColorPalette.ColorPicker, { color, onChange: handlePickerChange, hideInput }) })
13050
+ ] })
13051
+ ] });
13052
+ }
13053
+ );
12211
13054
  var ComboboxInput = class extends BaseInput {
12212
13055
  render() {
12213
13056
  const { input, form, isSubmitting } = this;
@@ -12789,6 +13632,7 @@ var CustomInputGroup = ({
12789
13632
  isValid,
12790
13633
  autoCapitalize = "none"
12791
13634
  }) => {
13635
+ const withKeyboard = input.withKeyboard;
12792
13636
  const groupConfig = input.inputGroupConfig;
12793
13637
  const infoTooltip = input?.infoTooltip;
12794
13638
  const autoValidate = groupConfig?.autoValidIcons ?? input.zodType ? true : false;
@@ -12803,6 +13647,8 @@ var CustomInputGroup = ({
12803
13647
  const isPasswordField = input.keyboardType === "password" /* PASSWORD */;
12804
13648
  const isNumberField = input.keyboardType === "number" /* NUMBER */;
12805
13649
  const showInputGroupAddons = iconsRight.length > 0 || textRight || autoValidate || infoTooltip || isPasswordField;
13650
+ const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
13651
+ const setCurrentInputField = useKeyboardStore((state) => state.setCurrentInputField);
12806
13652
  const applyMask = (value2, mask) => {
12807
13653
  if (!mask) return value2;
12808
13654
  if (typeof mask === "string") {
@@ -12872,6 +13718,7 @@ var CustomInputGroup = ({
12872
13718
  placeholder: input.placeHolder,
12873
13719
  disabled: input.disabled || isSubmitting,
12874
13720
  onBlur: field?.onBlur,
13721
+ onFocus: () => setCurrentInputField({ input, field }),
12875
13722
  name: field?.name,
12876
13723
  ref: field?.ref,
12877
13724
  type: isPasswordField && !showPassword ? "password" : isNumberField ? "number" : "text",
@@ -12917,6 +13764,18 @@ var CustomInputGroup = ({
12917
13764
  children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 20 })
12918
13765
  }
12919
13766
  ),
13767
+ withKeyboard && /* @__PURE__ */ jsxRuntime.jsx(
13768
+ "button",
13769
+ {
13770
+ type: "button",
13771
+ className: "text-2xl",
13772
+ onClick: () => {
13773
+ setIsOpen();
13774
+ setCurrentInputField({ input, field });
13775
+ },
13776
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Keyboard, {})
13777
+ }
13778
+ ),
12920
13779
  autoValidate && /* @__PURE__ */ jsxRuntime.jsx("div", { children: isSubmitting ? iconLoadingState : isValid ? iconValidState : iconInvalidState })
12921
13780
  ] })
12922
13781
  ] });
@@ -13342,64 +14201,6 @@ var FieldRepeater = ({ form, input, isSubmitting }) => {
13342
14201
  }
13343
14202
  );
13344
14203
  };
13345
- function Tabs({
13346
- className,
13347
- ...props
13348
- }) {
13349
- return /* @__PURE__ */ jsxRuntime.jsx(
13350
- TabsPrimitive__namespace.Root,
13351
- {
13352
- "data-slot": "tabs",
13353
- className: cn("flex flex-col gap-2", className),
13354
- ...props
13355
- }
13356
- );
13357
- }
13358
- function TabsList({
13359
- className,
13360
- ...props
13361
- }) {
13362
- return /* @__PURE__ */ jsxRuntime.jsx(
13363
- TabsPrimitive__namespace.List,
13364
- {
13365
- "data-slot": "tabs-list",
13366
- className: cn(
13367
- "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
13368
- className
13369
- ),
13370
- ...props
13371
- }
13372
- );
13373
- }
13374
- function TabsTrigger({
13375
- className,
13376
- ...props
13377
- }) {
13378
- return /* @__PURE__ */ jsxRuntime.jsx(
13379
- TabsPrimitive__namespace.Trigger,
13380
- {
13381
- "data-slot": "tabs-trigger",
13382
- className: cn(
13383
- "data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
13384
- className
13385
- ),
13386
- ...props
13387
- }
13388
- );
13389
- }
13390
- function TabsContent({
13391
- className,
13392
- ...props
13393
- }) {
13394
- return /* @__PURE__ */ jsxRuntime.jsx(
13395
- TabsPrimitive__namespace.Content,
13396
- {
13397
- "data-slot": "tabs-content",
13398
- className: cn("flex-1 outline-none", className),
13399
- ...props
13400
- }
13401
- );
13402
- }
13403
14204
  var RepeaterTabsInput = class extends BaseInput {
13404
14205
  render() {
13405
14206
  const { input, form, isSubmitting } = this;
@@ -13686,62 +14487,6 @@ var FieldSimpleCheckList = ({ input, value, onChange, isSubmitting }) => {
13686
14487
  ] });
13687
14488
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: formField });
13688
14489
  };
13689
- function Slider({
13690
- className,
13691
- defaultValue,
13692
- value,
13693
- min = 0,
13694
- max = 100,
13695
- ...props
13696
- }) {
13697
- const _values = React3__namespace.useMemo(
13698
- () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
13699
- [value, defaultValue, min, max]
13700
- );
13701
- return /* @__PURE__ */ jsxRuntime.jsxs(
13702
- SliderPrimitive__namespace.Root,
13703
- {
13704
- "data-slot": "slider",
13705
- defaultValue,
13706
- value,
13707
- min,
13708
- max,
13709
- className: cn(
13710
- "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
13711
- className
13712
- ),
13713
- ...props,
13714
- children: [
13715
- /* @__PURE__ */ jsxRuntime.jsx(
13716
- SliderPrimitive__namespace.Track,
13717
- {
13718
- "data-slot": "slider-track",
13719
- className: cn(
13720
- "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
13721
- ),
13722
- children: /* @__PURE__ */ jsxRuntime.jsx(
13723
- SliderPrimitive__namespace.Range,
13724
- {
13725
- "data-slot": "slider-range",
13726
- className: cn(
13727
- "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
13728
- )
13729
- }
13730
- )
13731
- }
13732
- ),
13733
- Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(
13734
- SliderPrimitive__namespace.Thumb,
13735
- {
13736
- "data-slot": "slider-thumb",
13737
- className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
13738
- },
13739
- index
13740
- ))
13741
- ]
13742
- }
13743
- );
13744
- }
13745
14490
  var SliderInput = class extends BaseInput {
13746
14491
  render() {
13747
14492
  const { input, form, isSubmitting } = this;
@@ -15926,6 +16671,167 @@ var FormFieldsGrid = ({
15926
16671
  );
15927
16672
  }) });
15928
16673
  };
16674
+ var CustomSheet = ({ title = "", children, childrenHeader, isOpen, className, side = "bottom" }) => {
16675
+ const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
16676
+ const storeIsOpen = useKeyboardStore((state) => state.isOpen);
16677
+ const controlledIsOpen = typeof isOpen === "boolean" ? isOpen : storeIsOpen;
16678
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: controlledIsOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side, children: [
16679
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
16680
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: title }),
16681
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetDescription, { children: [
16682
+ childrenHeader,
16683
+ children
16684
+ ] })
16685
+ ] }),
16686
+ /* @__PURE__ */ jsxRuntime.jsx(SheetFooter, {})
16687
+ ] }) });
16688
+ };
16689
+ var DynamicDialog = ({
16690
+ trigger,
16691
+ title = "Are you absolutely sure?",
16692
+ description = "This action cannot be undone.",
16693
+ cancelText = "Cancel",
16694
+ actionText = "Confirmar",
16695
+ className = "bg-red-600 text-white font-bold",
16696
+ variant = "info",
16697
+ onAction,
16698
+ children,
16699
+ listBtnConfig = [],
16700
+ btnGroupDirection = "flex-end",
16701
+ submitBtnClass = "h-16",
16702
+ iconSize = "w-16 h-16",
16703
+ btnHeightClass = "h-16",
16704
+ showActionBtn = true
16705
+ }) => {
16706
+ const getVariantStyles = () => {
16707
+ switch (variant) {
16708
+ case "info":
16709
+ return {
16710
+ container: "!bg-blue-100 !text-blue-800 dark:!bg-blue-900 dark:!text-blue-200",
16711
+ border: "!border-blue-500/30 dark:!border-blue-300/30",
16712
+ media: "bg-blue-500/10 dark:bg-blue-300/10",
16713
+ action: "text-blue-200 bg-blue-500 dark:bg-blue-300",
16714
+ icon: "text-blue-500 dark:text-blue-300",
16715
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleWarning, { className: iconSize })
16716
+ };
16717
+ case "warning":
16718
+ return {
16719
+ container: "!bg-yellow-100 !text-yellow-800 dark:!bg-yellow-900 dark:!text-yellow-200",
16720
+ border: "!border-yellow-500/30 dark:!border-yellow-300/30",
16721
+ media: "bg-yellow-500/10 dark:bg-yellow-300/10",
16722
+ action: "text-yellow-200 bg-yellow-500 dark:bg-yellow-300",
16723
+ icon: "text-yellow-500 dark:text-yellow-300",
16724
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { className: iconSize })
16725
+ };
16726
+ case "error":
16727
+ case "delete":
16728
+ return {
16729
+ container: "!bg-red-100 !text-red-800 dark:!bg-red-900 dark:!text-red-200",
16730
+ border: "!border-red-500/30 dark:!border-red-300/30",
16731
+ media: "bg-red-500/10 dark:bg-red-300/10",
16732
+ action: "text-red-200 bg-red-500 dark:bg-red-300",
16733
+ icon: "text-red-500 dark:text-red-300",
16734
+ iconNode: variant === "delete" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: iconSize }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonX, { className: iconSize })
16735
+ };
16736
+ case "success":
16737
+ return {
16738
+ container: "!bg-green-100 !text-green-800 dark:!bg-green-900 dark:!text-green-200",
16739
+ border: "!border-green-500/30 dark:!border-green-300/30",
16740
+ media: "bg-green-500/10 dark:bg-green-300/10",
16741
+ action: "text-green-200 bg-green-500 dark:bg-green-300",
16742
+ icon: "text-green-500 dark:text-green-300",
16743
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: iconSize })
16744
+ };
16745
+ case "confirm":
16746
+ return {
16747
+ container: "!bg-purple-100 !text-purple-800 dark:!bg-purple-900 dark:!text-purple-200",
16748
+ border: "!border-purple-500/30 dark:!border-purple-300/30",
16749
+ media: "bg-purple-500/10 dark:bg-purple-300/10",
16750
+ action: "text-purple-200 bg-purple-500 dark:bg-purple-300",
16751
+ icon: "text-purple-500 dark:text-purple-300",
16752
+ iconNode: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleQuestionMark, { className: iconSize })
16753
+ };
16754
+ }
16755
+ };
16756
+ const styles = getVariantStyles();
16757
+ console.log("onAction", onAction);
16758
+ return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialog, { children: [
16759
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", children: "Show Dialog" }) }),
16760
+ /* @__PURE__ */ jsxRuntime.jsxs(
16761
+ AlertDialogContent,
16762
+ {
16763
+ className: cn(
16764
+ "w-50 h-fit font-mono border-x-8",
16765
+ styles.container,
16766
+ styles.border
16767
+ ),
16768
+ children: [
16769
+ /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogHeader, { className: "justify-center w-full text-center", children: [
16770
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
16771
+ AlertDialogMedia,
16772
+ {
16773
+ className: cn(
16774
+ styles.media,
16775
+ "rounded-full flex items-center justify-center",
16776
+ iconSize
16777
+ // 🔥 ahora controla también el contenedor
16778
+ ),
16779
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.icon, children: styles.iconNode })
16780
+ }
16781
+ ) }),
16782
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDialogTitle, { className: "text-2xl", children: title }) }),
16783
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogDescription, { className: "text-xl text-center", children: description })
16784
+ ] }),
16785
+ children,
16786
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsxs(
16787
+ ButtonGroup,
16788
+ {
16789
+ className: "flex w-full",
16790
+ style: {
16791
+ justifyContent: btnGroupDirection,
16792
+ alignItems: "center"
16793
+ },
16794
+ children: [
16795
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogCancel, { className: cn("flex-1", btnHeightClass), children: cancelText }),
16796
+ listBtnConfig.map((btn, key) => /* @__PURE__ */ jsxRuntime.jsx(
16797
+ Button,
16798
+ {
16799
+ type: btn.btnType,
16800
+ size: "lg",
16801
+ className: cn(btnHeightClass, submitBtnClass),
16802
+ variant: btn.variant,
16803
+ onClick: btn.onClick,
16804
+ disabled: btn.disabled,
16805
+ children: btn.label
16806
+ },
16807
+ key
16808
+ )),
16809
+ onAction && showActionBtn && /* @__PURE__ */ jsxRuntime.jsx(
16810
+ AlertDialogAction,
16811
+ {
16812
+ onClick: (e) => {
16813
+ e.preventDefault();
16814
+ if (onAction) {
16815
+ onAction();
16816
+ }
16817
+ },
16818
+ className: cn(
16819
+ "flex-1",
16820
+ btnHeightClass,
16821
+ className,
16822
+ styles.action
16823
+ ),
16824
+ children: actionText
16825
+ }
16826
+ )
16827
+ ]
16828
+ }
16829
+ ) })
16830
+ ]
16831
+ }
16832
+ )
16833
+ ] });
16834
+ };
15929
16835
  var DynamicForm = ({
15930
16836
  formTitle,
15931
16837
  formSubTitle,
@@ -15954,9 +16860,13 @@ var DynamicForm = ({
15954
16860
  isWrapInWizard = false,
15955
16861
  totalSteps = 0,
15956
16862
  currentStep = 1,
15957
- submitBtnIcon = lucideReact.Save
16863
+ submitBtnIcon = lucideReact.Save,
16864
+ dialogTitle = "\xBFEst\xE1s seguro?",
16865
+ dialogDescription = "Esta acci\xF3n no se puede deshacer. \xBFDeseas continuar?",
16866
+ withConfirmDialog = false
15958
16867
  }) => {
15959
16868
  const [isPending, startTransition] = React3.useTransition();
16869
+ const currentInputField = useKeyboardStore((state) => state.currentInputField);
15960
16870
  const schema = React3.useMemo(() => {
15961
16871
  const allFields = flattenFields(fields, onAnyFieldChange);
15962
16872
  return getDynamicSchema(allFields, extraValidations);
@@ -15985,7 +16895,38 @@ var DynamicForm = ({
15985
16895
  const resp = { data, form };
15986
16896
  onClick(resp);
15987
16897
  };
16898
+ const withConfirm = /* @__PURE__ */ jsxRuntime.jsx(
16899
+ DynamicDialog,
16900
+ {
16901
+ trigger: /* @__PURE__ */ jsxRuntime.jsxs(
16902
+ Button,
16903
+ {
16904
+ variant: "secondary",
16905
+ size: "lg",
16906
+ type: "button",
16907
+ disabled: isPending,
16908
+ 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",
16909
+ children: [
16910
+ submitBtnLabel,
16911
+ (totalSteps == 0 || totalSteps == currentStep) && submitBtnIcon && React3__namespace.default.createElement(submitBtnIcon, { className: "h-5 w-5 mr-2" })
16912
+ ]
16913
+ }
16914
+ ),
16915
+ title: dialogTitle,
16916
+ description: dialogDescription,
16917
+ cancelText: "Cancelar",
16918
+ actionText: submitBtnLabel ?? "Procesar",
16919
+ variant: "warning",
16920
+ onAction: onClick ? handleClick : void 0
16921
+ }
16922
+ );
15988
16923
  const formBody = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16924
+ /* @__PURE__ */ jsxRuntime.jsx(
16925
+ CustomSheet,
16926
+ {
16927
+ children: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */) })
16928
+ }
16929
+ ),
15989
16930
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full grid grid-cols-1", children: [
15990
16931
  /* @__PURE__ */ jsxRuntime.jsx(
15991
16932
  FormFieldsGrid,
@@ -16016,7 +16957,7 @@ var DynamicForm = ({
16016
16957
  },
16017
16958
  key
16018
16959
  )),
16019
- !readOnly && withSubmitBtn && /* @__PURE__ */ jsxRuntime.jsx(
16960
+ !readOnly && withSubmitBtn && (withConfirmDialog ? withConfirm : /* @__PURE__ */ jsxRuntime.jsx(
16020
16961
  Button,
16021
16962
  {
16022
16963
  type: onClick ? "button" : "submit",
@@ -16032,7 +16973,7 @@ var DynamicForm = ({
16032
16973
  (totalSteps == 0 || totalSteps == currentStep) && submitBtnIcon && React3__namespace.default.createElement(submitBtnIcon, { className: "h-5 w-5 mr-2" })
16033
16974
  ] })
16034
16975
  }
16035
- )
16976
+ ))
16036
16977
  ] })
16037
16978
  ] });
16038
16979
  const formContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -16088,61 +17029,6 @@ var FormWrapper = ({ form, handleSubmit, children, readOnly, debug, isWrapInWiza
16088
17029
  }
16089
17030
  ) });
16090
17031
  };
16091
- function Stepper({ steps, currentStep, clickable = false, onStepClick }) {
16092
- const handleStepClick = (stepNumber) => {
16093
- if (clickable && onStepClick) {
16094
- onStepClick(stepNumber);
16095
- }
16096
- };
16097
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-4 items-center justify-around", children: steps.map((step, index) => {
16098
- const stepNumber = index + 1;
16099
- const isCompleted = stepNumber < currentStep;
16100
- const isCurrent = stepNumber === currentStep;
16101
- const isUpcoming = stepNumber > currentStep;
16102
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center", children: [
16103
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
16104
- /* @__PURE__ */ jsxRuntime.jsx(
16105
- "div",
16106
- {
16107
- onClick: () => handleStepClick(stepNumber),
16108
- className: cn(
16109
- "flex size-10 items-center shadow-lg justify-center rounded-full border-2 transition-all duration-300",
16110
- isCompleted && "border-primary bg-primary text-primary-foreground",
16111
- isCurrent && "border-primary bg-background text-primary scale-110",
16112
- isUpcoming && "border-muted-foreground/60 bg-background border-b text-muted-foreground",
16113
- clickable && "cursor-pointer hover:scale-125 hover:shadow-xl",
16114
- !clickable && "cursor-default"
16115
- ),
16116
- children: isCompleted ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-5" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold", children: stepNumber })
16117
- }
16118
- ),
16119
- step.title && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 text-center", children: [
16120
- /* @__PURE__ */ jsxRuntime.jsx(
16121
- "p",
16122
- {
16123
- className: cn(
16124
- "text-sm font-medium transition-colors",
16125
- (isCompleted || isCurrent) && "text-foreground",
16126
- isUpcoming && "text-muted-foreground"
16127
- ),
16128
- children: step.title
16129
- }
16130
- ),
16131
- step.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground max-w-[120px]", children: step.description })
16132
- ] })
16133
- ] }),
16134
- index < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-2 flex-1 mb-8", children: /* @__PURE__ */ jsxRuntime.jsx(
16135
- "div",
16136
- {
16137
- className: cn(
16138
- "h-0.5 w-full transition-all duration-300",
16139
- stepNumber < currentStep ? "bg-primary" : "bg-muted-foreground/30"
16140
- )
16141
- }
16142
- ) })
16143
- ] }, index);
16144
- }) }) });
16145
- }
16146
17032
  var WizardForm = ({
16147
17033
  fields,
16148
17034
  record,
@@ -16591,6 +17477,7 @@ exports.AlertDescription = AlertDescription;
16591
17477
  exports.AlertTitle = AlertTitle;
16592
17478
  exports.Badge = Badge;
16593
17479
  exports.BaseInput = BaseInput;
17480
+ exports.BaseKeyboard = BaseKeyboard;
16594
17481
  exports.Button = Button;
16595
17482
  exports.ButtonGroup = ButtonGroup;
16596
17483
  exports.ButtonGroupInput = ButtonGroupInput;
@@ -16623,6 +17510,7 @@ exports.CommandShortcut = CommandShortcut;
16623
17510
  exports.CurrencyInput = CurrencyInput;
16624
17511
  exports.CustomAlert = CustomAlert;
16625
17512
  exports.CustomInputGroup = CustomInputGroup;
17513
+ exports.CustomSheet = CustomSheet;
16626
17514
  exports.DateInput = DateInput;
16627
17515
  exports.DateTimeInput = DateTimeInput;
16628
17516
  exports.Dialog = Dialog;
@@ -16686,7 +17574,12 @@ exports.InputOTPGroup = InputOTPGroup;
16686
17574
  exports.InputOTPSeparator = InputOTPSeparator;
16687
17575
  exports.InputOTPSlot = InputOTPSlot;
16688
17576
  exports.InputTypes = InputTypes;
17577
+ exports.Key = Key;
16689
17578
  exports.KeyValueListInput = KeyValueListInput;
17579
+ exports.KeyboardBuilder = KeyboardBuilder;
17580
+ exports.KeyboardFactory = KeyboardFactory;
17581
+ exports.KeyboardQwerty = KeyboardQwerty;
17582
+ exports.KeyboardTypes = KeyboardTypes;
16690
17583
  exports.Label = Label;
16691
17584
  exports.MultiSelectInput = MultiSelectInput;
16692
17585
  exports.NumberInput = NumberInput;
@@ -16695,6 +17588,7 @@ exports.Popover = Popover;
16695
17588
  exports.PopoverAnchor = PopoverAnchor;
16696
17589
  exports.PopoverContent = PopoverContent;
16697
17590
  exports.PopoverTrigger = PopoverTrigger;
17591
+ exports.QwertyKeyboard = QwertyKeyboard;
16698
17592
  exports.RadioGroup = RadioGroup;
16699
17593
  exports.RadioGroupInput = RadioGroupInput;
16700
17594
  exports.RadioGroupItem = RadioGroupItem;
@@ -16741,6 +17635,7 @@ exports.TooltipContent = TooltipContent;
16741
17635
  exports.TooltipProvider = TooltipProvider;
16742
17636
  exports.TooltipTrigger = TooltipTrigger;
16743
17637
  exports.WizardForm = WizardForm;
17638
+ exports.applyCase = applyCase;
16744
17639
  exports.badgeVariants = badgeVariants;
16745
17640
  exports.buttonGroupVariants = buttonGroupVariants;
16746
17641
  exports.buttonVariants = buttonVariants;
@@ -16756,10 +17651,12 @@ exports.getFieldLabel = getFieldLabel;
16756
17651
  exports.handleOnChage = handleOnChage;
16757
17652
  exports.inputFieldComp = inputFieldComp;
16758
17653
  exports.isValidField = isValidField;
17654
+ exports.letter = letter;
16759
17655
  exports.mockFields = mockFields;
16760
17656
  exports.useDynamicForm = useDynamicForm;
16761
17657
  exports.useFormField = useFormField;
16762
17658
  exports.useFormPersist = useFormPersist;
17659
+ exports.useKeyboardStore = useKeyboardStore;
16763
17660
  exports.validationMessages = validationMessages;
16764
17661
  //# sourceMappingURL=index.cjs.map
16765
17662
  //# sourceMappingURL=index.cjs.map