Skip to content
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

fix(Modal): ensure Modal has rounded bottom corners on larger viewports #4582

Merged
merged 2 commits into from
Jan 20, 2025
Merged
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
12 changes: 12 additions & 0 deletions packages/orbit-components/src/Modal/Modal.ct-story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ export function ModalVisualNoHeaderNoFooter({ isMobileFullPage = false }) {
</Modal>
);
}

export function ModalVisualHeaderOnly({ isMobileFullPage = false }) {
return (
<Modal onClose={() => {}} size={SIZES.NORMAL} isMobileFullPage={isMobileFullPage}>
<ModalHeader
title="Normal header"
illustration={<Illustration name="AppKiwi" size="small" />}
description="Lorem ispum dolor sit amet"
/>
</Modal>
);
}
13 changes: 13 additions & 0 deletions packages/orbit-components/src/Modal/Modal.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ModalVisualDefaultStory,
ModalVisualMobileHeader,
ModalVisualNoHeaderNoFooter,
ModalVisualHeaderOnly,
} from "./Modal.ct-story";
import { SIZES } from "./consts";

Expand Down Expand Up @@ -43,4 +44,16 @@ test.describe("visual Modal", () => {

await expect(component).toHaveScreenshot();
});

test("ModalVisualHeaderOnly", async ({ mount }) => {
const component = await mount(<ModalVisualHeaderOnly />);

await expect(component).toHaveScreenshot();
});

test("ModalVisualHeaderOnly isMobileFullPage", async ({ mount }) => {
const component = await mount(<ModalVisualHeaderOnly isMobileFullPage />);

await expect(component).toHaveScreenshot();
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions packages/orbit-components/src/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,45 @@ export const WithItinerary: Story = {
},
};

export const WithModalHeaderOnly: Story = {
render: args => {
const { Container, onClose } = useModal();
return (
<Container>
<Modal onClose={onClose} {...args}>
<ModalHeader
title="Enjoy something to eat while you fly"
illustration={<Illustration name="BaggageDrop" size="small" />}
description="Select a flight below to see the menu (where available)"
/>
</Modal>
</Container>
);
},

args: {
mobileHeader: true,
},

parameters: {
info: "An example of a modal with a header only. Check Orbit.Kiwi for more detailed design guidelines.",
controls: {
exclude: [
"size",
DSil marked this conversation as resolved.
Show resolved Hide resolved
"fixedFooter",
"title",
"autoFocus",
"isMobileFullPage",
"preventOverlayClose",
"hasCloseButton",
"disableAnimation",
"labelClose",
"lockScrolling",
],
},
},
};

type PlaygroundStoryProps = ModalPropsAndCustomArgs & { header: boolean; footer: boolean };
export const Playground: StoryObj<PlaygroundStoryProps> = {
render: ({
Expand Down
1 change: 1 addition & 0 deletions packages/orbit-components/src/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ const Modal = React.forwardRef<Instance, Props>(
"lm:relative lm:bottom-auto lm:pb-0",
"lm:[&_.orbit-modal-section:last-of-type]:pb-1000 lm:[&_.orbit-modal-section:last-of-type:after]:content-none lm:[&_.orbit-modal-section:last-of-type]:mb-[var(--orbit-modal-footer-height,0px)]",
"lm:[&_.orbit-modal-mobile-header]:w-[calc(var(--orbit-modal-width)-48px-theme(spacing.1000))]",
"lm:[&:has(.orbit-modal-header-container:last-child)]:pb-1000",
footerHeight && "lm:[&_.orbit-modal-section]:rounded-b-none",
!hasModalSection &&
"[&_.orbit-modal-header-container]:mb-800 lm:[&_.orbit-modal-header-container]:mb-[var(--orbit-modal-footer-height,0px)]",
Expand Down
Loading