shadcn-zod-formkit 3.9.1 → 3.9.3

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
@@ -12101,7 +12101,7 @@ var useKeyboardStore = zustand.create((set, get) => ({
12101
12101
  set({ onEnter });
12102
12102
  },
12103
12103
  setCurrentInputField(inputField) {
12104
- set({ currentInputField: inputField, isInputRequired: true });
12104
+ set({ currentInputField: inputField, isInputRequired: inputField ? true : false });
12105
12105
  },
12106
12106
  setIsOpen(open) {
12107
12107
  if (!open) set({ value: "" });
@@ -12221,11 +12221,14 @@ var useKeyboardStore = zustand.create((set, get) => ({
12221
12221
  }
12222
12222
  }))
12223
12223
  }));
12224
- var CustomSheet = ({ title = "", children, childrenHeader, isOpen, className, side = "bottom" }) => {
12224
+ var CustomSheet = ({ title = "", children, childrenHeader, isOpen, className, side = "bottom", isDynamic }) => {
12225
12225
  const setIsOpen = useKeyboardStore((state) => state.setIsOpen);
12226
+ const setIsOpenDynamic = useKeyboardStore((state) => state.setIsOpenDynamic);
12226
12227
  const storeIsOpen = useKeyboardStore((state) => state.isOpen);
12228
+ const storeIsOpenDynamic = useKeyboardStore((state) => state.isOpenDynamic);
12227
12229
  const controlledIsOpen = typeof isOpen === "boolean" ? isOpen : storeIsOpen;
12228
- return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: controlledIsOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsx(SheetContent, { side, className, children: /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
12230
+ const open = isDynamic ? storeIsOpenDynamic : controlledIsOpen;
12231
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open, onOpenChange: isDynamic ? setIsOpenDynamic : setIsOpen, children: /* @__PURE__ */ jsxRuntime.jsx(SheetContent, { side, className, children: /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
12229
12232
  /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: title }),
12230
12233
  /* @__PURE__ */ jsxRuntime.jsxs(SheetDescription, { children: [
12231
12234
  childrenHeader,
@@ -12780,7 +12783,7 @@ var KeyboardQwerty = ({ onKeyPress, onEnter, keyFontSize = "text-2xl", onDelete,
12780
12783
  }, className: "bg-red-200 text-xs", style: { backgroundColor: "#faba005e" } };
12781
12784
  const btnEsc = { label: "esc", onClick: () => {
12782
12785
  setIsOpen(false);
12783
- }, className: "", style: { backgroundColor: "#ffc0c0" } };
12786
+ }, className: "", style: { backgroundColor: "#ffc0c05e" } };
12784
12787
  const btnEnter = { label: "Enter", onClick: onEnter, className: "flex-[2] bg-green-200", style: { backgroundColor: "#008f003d" } };
12785
12788
  if (mode === "symbols") {
12786
12789
  const keys = [
@@ -17174,21 +17177,23 @@ var FormFieldsGrid = ({
17174
17177
  );
17175
17178
  }) });
17176
17179
  };
17177
- var DynamicSheetKeyboard = ({ currentInputField, children, input, className, childClassName, keyFontSize = "text-base" }) => {
17180
+ var DynamicSheetKeyboard = ({ currentInputField, children, input, className, childClassName, keyFontSize = "text-base", isDynamic = false }) => {
17178
17181
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17179
17182
  " ",
17180
17183
  KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */, input, children),
17181
17184
  " "
17182
17185
  ] });
17186
+ const { setCurrentInputField, isOpenDynamic } = useKeyboardStore();
17183
17187
  const [container, setContainer] = React3.useState(content);
17184
17188
  React3.useEffect(() => {
17189
+ if (!currentInputField) setCurrentInputField(null);
17185
17190
  setContainer(/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17186
17191
  " ",
17187
17192
  KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */, input, children, childClassName, keyFontSize),
17188
17193
  " "
17189
17194
  ] }));
17190
17195
  }, [children]);
17191
- return /* @__PURE__ */ jsxRuntime.jsx(CustomSheet, { children: container, className });
17196
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomSheet, { children: container, className, isDynamic });
17192
17197
  };
17193
17198
  var DynamicForm = ({
17194
17199
  formTitle,