shadcn-zod-formkit 3.9.1 → 3.9.2

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,
@@ -17180,15 +17183,17 @@ var DynamicSheetKeyboard = ({ currentInputField, children, input, className, chi
17180
17183
  KeyboardFactory.create(currentInputField?.input.keyboard ?? "qwerty" /* QWERTY */, input, children),
17181
17184
  " "
17182
17185
  ] });
17186
+ const { setCurrentInputField } = 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: true });
17192
17197
  };
17193
17198
  var DynamicForm = ({
17194
17199
  formTitle,