-
Notifications
You must be signed in to change notification settings - Fork 77
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(block): display correct header spacing when heading or description are present #9924
fix(block): display correct header spacing when heading or description are present #9924
Conversation
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.
Changes look good, just missing a few things 👍
@@ -194,7 +198,6 @@ calcite-action-menu { | |||
} | |||
} | |||
|
|||
:host([heading]), | |||
:host([description]) { |
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.
[description] would also be an issue here because it isn't reflected either. Should this css be removed?
@@ -416,7 +416,7 @@ export class Block | |||
const toggleLabel = open ? messages.collapse : messages.expand; | |||
|
|||
const headerContent = ( | |||
<header class={CSS.header} id={IDS.header}> | |||
<header class={{ [CSS.header]: true, [CSS.headerPadding]: !!heading }} id={IDS.header}> |
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.
should this be !!(heading || description)
?
<header class={{ [CSS.header]: true, [CSS.headerPadding]: !!heading }} id={IDS.header}> | |
<header class={{ [CSS.header]: true, [CSS.headerPadding]: !!(heading || description) }} id={IDS.header}> |
@@ -23,6 +23,10 @@ | |||
@apply justify-start; | |||
} | |||
|
|||
.header-padding { |
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.
nitpick: maybe this should be named something like .header--present
or .header--enabled
?
@driskull I noticed that if I update the |
@aPreciado88 no, we don't want to reflect all properties. In cases where the property is just content , we don't want to reflect. https://github.com/Esri/calcite-design-system/tree/dev/packages/calcite-components/conventions#reflecting-to-attributes |
…esent' of github.com:Esri/calcite-design-system into aPreciado88/9920-spacing-not-honored-when-heading-is-present
@driskull I updated with the requested changes. |
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.
@aPreciado88 can we add a e2e test that checks for the css class when a heading or description is present via their properties?
Changes look good to me. Lets wait for @jcfranco to review before merging.
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.
Once we have screenshot test coverage, this is good to merge! 🚀
@@ -23,6 +23,10 @@ | |||
@apply justify-start; | |||
} | |||
|
|||
.header--present { |
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.
Nitpick: I believe we use .<part>--has-text
in other components for similar contexts.
@@ -323,6 +323,29 @@ describe("calcite-block", () => { | |||
const actionAssignedSlot = await page.$eval("calcite-action", (action) => action.assignedSlot.name); | |||
expect(actionAssignedSlot).toBe(SLOTS.headerMenuActions); | |||
}); | |||
|
|||
it("applies correct header spacing when heading or description properties are present", async () => { |
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.
This is fine for now until we add extra checks to ensure styles use reflected props. After that, we should rely on screenshot tests. From the assertion perspective, it is not guaranteed that changes in the CSS class will be detected by this test, meaning its implementation could change without causing a test failure. cc @driskull
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.
Agreed.
This is a sufficient test for now but ideally a screenshot test should be the real test.
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.
@jcfranco Should I create a follow up issue to add a screenshot test?
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.
…n are present (#9924) **Related Issue:** [#9920](#9920) ## Summary Update `block` component to display correct header spacing when `heading` or `description` properties are present. --------- Co-authored-by: Matt Driscoll <[email protected]>
…n are present (#9924) **Related Issue:** [#9920](#9920) ## Summary Update `block` component to display correct header spacing when `heading` or `description` properties are present. --------- Co-authored-by: Matt Driscoll <[email protected]>
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 2.11.1</summary> ## [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) ### Bug Fixes * **block:** Display correct header spacing when heading or description are present ([#9924](#9924)) ([d8f1077](d8f1077)) * **panel, flow-item:** Fix header padding regression ([#9936](#9936)) ([90e9368](90e9368)) </details> <details><summary>@esri/calcite-components-angular: 2.11.1</summary> ## [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) ### Miscellaneous Chores * **@esri/calcite-components-angular:** Synchronize components versions ### Dependencies * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^2.11.0 to ^2.11.1 </details> <details><summary>@esri/calcite-components-react: 2.11.1</summary> ## [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) ### Miscellaneous Chores * **@esri/calcite-components-react:** Synchronize components versions ### Dependencies * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^2.11.0 to ^2.11.1 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 2.11.1</summary> [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) * **block:** Display correct header spacing when heading or description are present ([#9924](#9924)) ([d8f1077](d8f1077)) * **panel, flow-item:** Fix header padding regression ([#9936](#9936)) ([90e9368](90e9368)) </details> <details><summary>@esri/calcite-components-angular: 2.11.1</summary> [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) * **@esri/calcite-components-angular:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^2.11.0 to ^2.11.1 </details> <details><summary>@esri/calcite-components-react: 2.11.1</summary> [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) * **@esri/calcite-components-react:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^2.11.0 to ^2.11.1 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
**Related Issue:** #9952 ## Summary Cherry-pick the release commit from `main`. --- <details><summary>@esri/calcite-components: 2.11.1</summary> [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) * **block:** Display correct header spacing when heading or description are present ([#9924](#9924)) ([d8f1077](d8f1077)) * **panel, flow-item:** Fix header padding regression ([#9936](#9936)) ([90e9368](90e9368)) </details> <details><summary>@esri/calcite-components-angular: 2.11.1</summary> [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) * **@esri/calcite-components-angular:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^2.11.0 to ^2.11.1 </details> <details><summary>@esri/calcite-components-react: 2.11.1</summary> [2.11.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected]) (2024-08-02) * **@esri/calcite-components-react:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^2.11.0 to ^2.11.1 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Calcite Admin <[email protected]>
Related Issue: #9920
Summary
Update
block
component to display correct header spacing whenheading
ordescription
properties are present.