fix(block): display correct header spacing when heading or description are present#9924
Conversation
driskull
left a comment
There was a problem hiding this comment.
Changes look good, just missing a few things 👍
| } | ||
|
|
||
| :host([heading]), | ||
| :host([description]) { |
There was a problem hiding this comment.
[description] would also be an issue here because it isn't reflected either. Should this css be removed?
|
|
||
| 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.
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}> |
| @apply justify-start; | ||
| } | ||
|
|
||
| .header-padding { |
There was a problem hiding this comment.
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. |
driskull
left a comment
There was a problem hiding this comment.
@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.
jcfranco
left a comment
There was a problem hiding this comment.
Once we have screenshot test coverage, this is good to merge! 🚀
| @apply justify-start; | ||
| } | ||
|
|
||
| .header--present { |
There was a problem hiding this comment.
Nitpick: I believe we use .<part>--has-text in other components for similar contexts.
| 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.
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.
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.
@jcfranco Should I create a follow up issue to add a screenshot test?
🤖 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/calcite-components@2.11.0...@esri/calcite-components@2.11.1) (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/calcite-components-angular@2.11.0...@esri/calcite-components-angular@2.11.1) (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/calcite-components-react@2.11.0...@esri/calcite-components-react@2.11.1) (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/calcite-components@2.11.0...@esri/calcite-components@2.11.1) (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/calcite-components-angular@2.11.0...@esri/calcite-components-angular@2.11.1) (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/calcite-components-react@2.11.0...@esri/calcite-components-react@2.11.1) (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/calcite-components@2.11.0...@esri/calcite-components@2.11.1) (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/calcite-components-angular@2.11.0...@esri/calcite-components-angular@2.11.1) (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/calcite-components-react@2.11.0...@esri/calcite-components-react@2.11.1) (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 <calcite-admin@esri.com>
Related Issue: #9920
Summary
Update
blockcomponent to display correct header spacing whenheadingordescriptionproperties are present.