Skip to content

feat: Expose disableFooterPaddings on container #3541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pages/container/simple.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export default function SimpleContainers() {
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Phasellus tincidunt suscipit varius. Nullam dui
tortor, mollis vitae molestie sed, malesuada.
</Container>
<Container disableFooterPaddings={true} footer="Spaceless container footer">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Phasellus tincidunt suscipit varius. Nullam dui
tortor, mollis vitae molestie sed, malesuada.
</Container>
<div>
<Container variant="stacked" header="Stacked Container 1">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Phasellus tincidunt suscipit varius. Nullam dui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6904,6 +6904,15 @@ exports[`Documenter definition for container matches the snapshot: container 1`]
"optional": true,
"type": "boolean",
},
{
"description": "Determines whether the container footer has padding. If \`true\`, removes the default padding from the footer.",
"name": "disableFooterPaddings",
"optional": true,
"systemTags": [
"core",
],
"type": "boolean",
},
{
"defaultValue": "false",
"description": "Determines whether the container header has padding. If \`true\`, removes the default padding from the header.",
Expand Down
6 changes: 6 additions & 0 deletions src/container/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export interface ContainerProps extends BaseComponentProps {
*/
footer?: React.ReactNode;

/**
* Determines whether the container footer has padding. If `true`, removes the default padding from the footer.
* @awsuiSystem core
*/
disableFooterPaddings?: boolean;

/**
* Specify a container variant with one of the following:
* * `default` - Use this variant in standalone context.
Expand Down
6 changes: 3 additions & 3 deletions src/container/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import styles from './styles.css.js';
import testStyles from './test-classes/styles.css.js';

export interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {
disableFooterPaddings?: boolean;
__stickyHeader?: boolean;
__stickyOffset?: number;
__mobileStickyOffset?: number;
__disableFooterDivider?: boolean;
__disableFooterPaddings?: boolean;
__hiddenContent?: boolean;
__headerRef?: React.RefObject<HTMLDivElement>;
__fullPage?: boolean;
Expand Down Expand Up @@ -63,14 +63,14 @@ export default function InternalContainer({
variant = 'default',
disableHeaderPaddings = false,
disableContentPaddings = false,
disableFooterPaddings = false,
fitHeight,
media,
__stickyOffset,
__mobileStickyOffset,
__stickyHeader = false,
__internalRootRef = null,
__disableFooterDivider = false,
__disableFooterPaddings = false,
__hiddenContent = false,
__headerRef,
__fullPage = false,
Expand Down Expand Up @@ -181,7 +181,7 @@ export default function InternalContainer({
<div
className={clsx(styles.footer, {
[styles['with-divider']]: !__disableFooterDivider,
[styles['with-paddings']]: !__disableFooterPaddings,
[styles['with-paddings']]: !disableFooterPaddings,
})}
>
{footer}
Expand Down
2 changes: 1 addition & 1 deletion src/table/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ const InternalTable = React.forwardRef(
}
disableHeaderPaddings={true}
disableContentPaddings={true}
disableFooterPaddings={true}
variant={toContainerVariant(computedVariant)}
__disableFooterPaddings={true}
__disableFooterDivider={true}
__disableStickyMobile={false}
footer={
Expand Down
Loading