-
Notifications
You must be signed in to change notification settings - Fork 86
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(form): allow form-footer content to be responsive #6974
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
/* eslint-disable no-console */ | ||
import React, { useState } from "react"; | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
import { allModes } from "../../../.storybook/modes"; | ||
import isChromatic from "../../../.storybook/isChromatic"; | ||
import generateStyledSystemProps from "../../../.storybook/utils/styled-system-props"; | ||
|
||
|
@@ -36,11 +35,6 @@ const meta: Meta<typeof Form> = { | |
}, | ||
parameters: { | ||
controls: { disable: true }, | ||
chromatic: { | ||
modes: { | ||
desktop: allModes.chromatic, | ||
}, | ||
}, | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
|
@@ -94,7 +88,7 @@ export const WithFullWidthButtons: Story = () => ( | |
onSubmit={() => console.log("submit")} | ||
stickyFooter | ||
leftSideButtons={ | ||
<Button mb={3} onClick={() => console.log("cancel")} fullWidth> | ||
<Button onClick={() => console.log("cancel")} fullWidth> | ||
Cancel | ||
</Button> | ||
} | ||
|
@@ -179,6 +173,9 @@ export const WithErrorsSummary: Story = () => ( | |
</Form> | ||
); | ||
WithErrorsSummary.storyName = "With Errors Summary"; | ||
WithErrorsSummary.parameters = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment: it looks like this is creating issues with the storybook build and therefore chromatic isn't building https://github.com/Sage/carbon/actions/runs/11030962735/job/30636704240 |
||
chromatic: { viewports: [1200, 900, 320] }, | ||
}; | ||
|
||
export const WithWarningsSummary: Story = () => ( | ||
<Form | ||
|
@@ -197,6 +194,9 @@ export const WithWarningsSummary: Story = () => ( | |
</Form> | ||
); | ||
WithWarningsSummary.storyName = "With Warnings Summary"; | ||
WithWarningsSummary.parameters = { | ||
chromatic: { viewports: [1200, 900, 320] }, | ||
}; | ||
|
||
export const WithBothErrorsAndWarningsSummary: Story = () => ( | ||
<Form | ||
|
@@ -217,16 +217,17 @@ export const WithBothErrorsAndWarningsSummary: Story = () => ( | |
); | ||
WithBothErrorsAndWarningsSummary.storyName = | ||
"With Both Errors and Warnings Summary"; | ||
WithBothErrorsAndWarningsSummary.parameters = { | ||
chromatic: { viewports: [1200, 900, 320] }, | ||
}; | ||
|
||
export const WithAdditionalButtons: Story = () => ( | ||
<Form | ||
onSubmit={() => console.log("submit")} | ||
leftSideButtons={ | ||
<> | ||
<Button onClick={() => console.log("cancel")}>Other</Button> | ||
<Button onClick={() => console.log("cancel")} ml={2}> | ||
Cancel | ||
</Button> | ||
<Button onClick={() => console.log("cancel")}>Cancel</Button> | ||
</> | ||
} | ||
saveButton={ | ||
|
@@ -237,9 +238,7 @@ export const WithAdditionalButtons: Story = () => ( | |
rightSideButtons={ | ||
<> | ||
<Button onClick={() => console.log("cancel")}>Reset</Button> | ||
<Button onClick={() => console.log("cancel")} ml={2}> | ||
Other | ||
</Button> | ||
<Button onClick={() => console.log("cancel")}>Other</Button> | ||
</> | ||
} | ||
> | ||
|
@@ -254,9 +253,7 @@ export const WithButtonsAlignedToTheLeft: Story = () => ( | |
leftSideButtons={ | ||
<> | ||
<Button onClick={() => console.log("cancel")}>Other</Button> | ||
<Button onClick={() => console.log("cancel")} ml={2}> | ||
Cancel | ||
</Button> | ||
<Button onClick={() => console.log("cancel")}>Cancel</Button> | ||
</> | ||
} | ||
saveButton={ | ||
|
@@ -267,9 +264,7 @@ export const WithButtonsAlignedToTheLeft: Story = () => ( | |
rightSideButtons={ | ||
<> | ||
<Button onClick={() => console.log("cancel")}>Reset</Button> | ||
<Button onClick={() => console.log("cancel")} ml={2}> | ||
Other | ||
</Button> | ||
<Button onClick={() => console.log("cancel")}>Other</Button> | ||
</> | ||
} | ||
buttonAlignment="left" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,7 +162,7 @@ test("form summary and footer have correct styles when the `fullWidthButtons` pr | |
}); | ||
|
||
// for coverage: stickyFooter prop styles are covered by Chromatic and Playwright | ||
test("has the corrrect styles when the `stickyFooter` prop is set", () => { | ||
test("has the correct styles when the `stickyFooter` prop is set", () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
render( | ||
<Form | ||
aria-label="form-example" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: just a tiny typo - nothing major :)