shadcn-zod-formkit 1.21.1 → 1.22.1

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
@@ -5602,8 +5602,8 @@ var FormFieldsGrid = ({
5602
5602
  const fieldCopy = { ...field, disabled: readOnly ? true : field.disabled };
5603
5603
  const renderUp = fieldCopy.childrenPosition !== "down" && isRenderableChild(fieldCopy.children);
5604
5604
  const renderDown = fieldCopy.childrenPosition === "down" && isRenderableChild(fieldCopy.children);
5605
- const dirClass = fieldCopy.direction === "row" ? "flex flex-row items-center gap-4" : "flex flex-col gap-2";
5606
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${dirClass} w-full`, children: [
5605
+ const dirClass = fieldCopy.direction === "row" ? "flex flex-col sm:flex-row sm:items-center sm:gap-x-4 gap-y-2 w-full flex-wrap" : "flex flex-col gap-2 w-full";
5606
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: dirClass, children: [
5607
5607
  renderUp && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fieldCopy.children }),
5608
5608
  InputFactory.create(fieldCopy, form, isPending),
5609
5609
  renderDown && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fieldCopy.children })
@@ -5611,22 +5611,22 @@ var FormFieldsGrid = ({
5611
5611
  };
5612
5612
  const renderColumn = (col) => {
5613
5613
  if (col.length === 0) return null;
5614
- const colDirection = isFieldProps(col[0]) && col[0].direction === "row" ? "flex flex-row gap-4" : "flex flex-col gap-2";
5615
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${colDirection} flex-1`, children: col.map((item, idx) => {
5616
- if (isFieldProps(item)) return renderField(item);
5614
+ const colDirection = isFieldProps(col[0]) && col[0].direction === "row" ? "flex flex-col sm:flex-row sm:items-center sm:gap-x-4 gap-y-2 w-full flex-wrap" : "flex flex-col gap-2 w-full";
5615
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: colDirection, children: col.map((item, idx) => {
5616
+ if (isFieldProps(item)) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-[200px]", children: renderField(item) }, idx);
5617
5617
  if (Array.isArray(item)) return renderColumn(item);
5618
5618
  return null;
5619
5619
  }) });
5620
5620
  };
5621
5621
  const renderRow = (row) => {
5622
5622
  if (row.length === 0) return null;
5623
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex flex-row gap-4 py-2", children: row.map((col, idx) => {
5623
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full flex flex-col sm:flex-row sm:gap-x-4 gap-y-2 py-2 flex-wrap gap-2`, children: row.map((col, idx) => {
5624
5624
  if (isFieldProps(col)) return renderColumn([col]);
5625
5625
  if (Array.isArray(col)) return renderColumn(col);
5626
5626
  return null;
5627
5627
  }) });
5628
5628
  };
5629
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full flex flex-col gap-4 ${className}`, children: fields.map((f, idx) => {
5629
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full flex flex-col ${gap} ${className}`, children: fields.map((f, idx) => {
5630
5630
  if (isFieldProps(f)) return /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderField(f) }, idx);
5631
5631
  if (Array.isArray(f)) return /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderRow(f) }, idx);
5632
5632
  return null;