Skip to content

Commit d234463

Browse files
feat: Expose disableFooterPaddings on container (#3541)
1 parent f06998b commit d234463

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

pages/container/simple.page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ export default function SimpleContainers() {
8585
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Phasellus tincidunt suscipit varius. Nullam dui
8686
tortor, mollis vitae molestie sed, malesuada.
8787
</Container>
88+
<Container disableFooterPaddings={true} footer="Spaceless container footer">
89+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Phasellus tincidunt suscipit varius. Nullam dui
90+
tortor, mollis vitae molestie sed, malesuada.
91+
</Container>
8892
<div>
8993
<Container variant="stacked" header="Stacked Container 1">
9094
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Phasellus tincidunt suscipit varius. Nullam dui

src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6923,6 +6923,15 @@ exports[`Documenter definition for container matches the snapshot: container 1`]
69236923
"optional": true,
69246924
"type": "boolean",
69256925
},
6926+
{
6927+
"description": "Determines whether the container footer has padding. If \`true\`, removes the default padding from the footer.",
6928+
"name": "disableFooterPaddings",
6929+
"optional": true,
6930+
"systemTags": [
6931+
"core",
6932+
],
6933+
"type": "boolean",
6934+
},
69266935
{
69276936
"defaultValue": "false",
69286937
"description": "Determines whether the container header has padding. If \`true\`, removes the default padding from the header.",

src/container/interfaces.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ export interface ContainerProps extends BaseComponentProps {
6767
*/
6868
footer?: React.ReactNode;
6969

70+
/**
71+
* Determines whether the container footer has padding. If `true`, removes the default padding from the footer.
72+
* @awsuiSystem core
73+
*/
74+
disableFooterPaddings?: boolean;
75+
7076
/**
7177
* Specify a container variant with one of the following:
7278
* * `default` - Use this variant in standalone context.

src/container/internal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import styles from './styles.css.js';
2121
import testStyles from './test-classes/styles.css.js';
2222

2323
export interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {
24+
disableFooterPaddings?: boolean;
2425
__stickyHeader?: boolean;
2526
__stickyOffset?: number;
2627
__mobileStickyOffset?: number;
2728
__disableFooterDivider?: boolean;
28-
__disableFooterPaddings?: boolean;
2929
__hiddenContent?: boolean;
3030
__headerRef?: React.RefObject<HTMLDivElement>;
3131
__fullPage?: boolean;
@@ -62,14 +62,14 @@ export default function InternalContainer({
6262
variant = 'default',
6363
disableHeaderPaddings = false,
6464
disableContentPaddings = false,
65+
disableFooterPaddings = false,
6566
fitHeight,
6667
media,
6768
__stickyOffset,
6869
__mobileStickyOffset,
6970
__stickyHeader = false,
7071
__internalRootRef = null,
7172
__disableFooterDivider = false,
72-
__disableFooterPaddings = false,
7373
__hiddenContent = false,
7474
__headerRef,
7575
__fullPage = false,
@@ -180,7 +180,7 @@ export default function InternalContainer({
180180
<div
181181
className={clsx(styles.footer, {
182182
[styles['with-divider']]: !__disableFooterDivider,
183-
[styles['with-paddings']]: !__disableFooterPaddings,
183+
[styles['with-paddings']]: !disableFooterPaddings,
184184
})}
185185
>
186186
{footer}

src/table/internal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ const InternalTable = React.forwardRef(
489489
}
490490
disableHeaderPaddings={true}
491491
disableContentPaddings={true}
492+
disableFooterPaddings={true}
492493
variant={toContainerVariant(computedVariant)}
493-
__disableFooterPaddings={true}
494494
__disableFooterDivider={true}
495495
__disableStickyMobile={false}
496496
footer={

0 commit comments

Comments
 (0)