diff --git a/packages/payload-plugin-json-form-builder/src/components/JsonFormClient.tsx b/packages/payload-plugin-json-form-builder/src/components/JsonFormClient.tsx index ed4f13ae..aa75dd6d 100644 --- a/packages/payload-plugin-json-form-builder/src/components/JsonFormClient.tsx +++ b/packages/payload-plugin-json-form-builder/src/components/JsonFormClient.tsx @@ -14,6 +14,7 @@ import { FieldLabel, GearIcon, ListViewIcon, + useCollapsible, useDrawerSlug, useField, useModal, @@ -46,6 +47,7 @@ export const JsonFormClient = ({ library, mayBuild, shares: offered, ...props }: const { setValue, showError, value } = useField({ path, validate }); const { openModal } = useModal(); const builderSlug = useDrawerSlug("json-builder"); + const { isWithinCollapsible } = useCollapsible(); const dropSlug = useDrawerSlug("json-form-drop"); const [dropping, setDropping] = useState(""); const build = () => openModal(builderSlug); @@ -67,27 +69,20 @@ export const JsonFormClient = ({ library, mayBuild, shares: offered, ...props }: return ( <> - {field.admin?.description ? ( -
- -
- ) : null} -
0 && "json-form--alarmed")}> -
-

+
0 && "json-form--alarmed" + )} + > +
+

-

+

json
- {mayBuild && !bare && ( - <> - - - - - - )} {mayBuild && !bare && (
)} + {mayBuild && !bare && ( + <> + + + + + + )}
{unfilled.length > 0 ? ( @@ -190,7 +193,7 @@ export const JsonFormClient = ({ library, mayBuild, shares: offered, ...props }: style={{ transform, transition, zIndex: isDragging ? 1 : undefined }} >
- + {field.admin?.description ? ( +
+ +
+ ) : null} {mayBuild && ( .json-form__add-row.btn:not(:only-child) { +.json-form__body > .json-form__actions:not(:only-child) { margin-top: var(--spacing-field, var(--base)); } .json-form__menu { @@ -791,7 +796,7 @@ body.json-builder-open { .json-form__said { - margin-block-end: calc(var(--base) * 0.6); + margin-block-start: calc(var(--base) * 0.6); } .json-builder__row {