Skip to content

Commit 4384ec1

Browse files
committed
fix: resolved spacing issues
1 parent aa05ffe commit 4384ec1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/module/src/FieldBuilder/FieldBuilder.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export const FieldBuilder: FunctionComponent<FieldBuilderProps> = ({
219219
return rows.map((_, index) => {
220220
const rowNumber = index + 1;
221221
const rowGroupId = `${fieldBuilderIdPrefix}-row-${index}`;
222+
const topPaddingClass = index > 0 ? 'pf-v6-u-pt-0' : '';
222223

223224
// Call the user's render prop function to get the React nodes for this row's cells.
224225
const rowContent = children({
@@ -245,21 +246,21 @@ export const FieldBuilder: FunctionComponent<FieldBuilderProps> = ({
245246
{/* First column cell */}
246247
<Td
247248
dataLabel={String(firstColumnLabel)}
248-
className={secondColumnLabel ? "pf-m-width-40" : "pf-m-width-80"}
249+
className={`${secondColumnLabel ? 'pf-m-width-40' : 'pf-m-width-80'} ${topPaddingClass}`.trim()}
249250
>
250251
{cells[0]}
251252
</Td>
252253
{/* Second column cell (if two-column layout) */}
253254
{secondColumnLabel && (
254255
<Td
255256
dataLabel={String(secondColumnLabel)}
256-
className="pf-m-width-40"
257+
className={`pf-m-width-40 ${topPaddingClass}`.trim()}
257258
>
258259
{cells[1] || <div />}
259260
</Td>
260261
)}
261262
{/* Remove button column */}
262-
<Td className="pf-m-width-20">
263+
<Td className={`pf-m-width-20 ${topPaddingClass}`.trim()}>
263264
<Button
264265
variant="plain"
265266
aria-label={removeButtonAriaLabel ? removeButtonAriaLabel(rowNumber, rowGroupLabelPrefix) : `Remove ${rowGroupLabelPrefix.toLowerCase()} ${rowNumber}`}
@@ -295,16 +296,17 @@ export const FieldBuilder: FunctionComponent<FieldBuilderProps> = ({
295296
'--pf-v6-c-table--cell--first-last-child--PaddingInline': '0 1rem 0 0',
296297
'--pf-v6-c-table--cell--PaddingBlockStart': 'var(--pf-t--global--spacer--sm)',
297298
'--pf-v6-c-table--cell--PaddingBlockEnd': 'var(--pf-t--global--spacer--sm)',
298-
'--pf-v6-c-table__thead--cell--PaddingBlockEnd': 'var(--pf-t--global--spacer--sm)'
299+
'--pf-v6-c-table__thead--cell--PaddingBlockEnd': '0',
300+
299301
} as React.CSSProperties}
300302
>
301303
<Thead>
302304
<Tr>
303-
<Th className={secondColumnLabel ? "pf-m-width-40" : "pf-m-width-80"}>
305+
<Th className={secondColumnLabel ? "pf-m-width-40" : "pf-m-width-80"} style={{ paddingBottom: 0 }}>
304306
{firstColumnLabel}
305307
</Th>
306308
{secondColumnLabel && (
307-
<Th className="pf-m-width-40">
309+
<Th className="pf-m-width-40" style={{ paddingBottom: 0 }}>
308310
{secondColumnLabel}
309311
</Th>
310312
)}
@@ -317,7 +319,8 @@ export const FieldBuilder: FunctionComponent<FieldBuilderProps> = ({
317319
</Table>
318320

319321
{/* The "Add" button for creating a new row */}
320-
<FlexItem className="pf-v6-u-mt-sm">
322+
<FlexItem className="pf-v6-u-mt-0">
323+
{/* <FlexItem className="pf-v6-u-mt-sm"> */}
321324
<Button
322325
ref={addButtonRef}
323326
variant="link"

0 commit comments

Comments
 (0)