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

feat(components): add a heading-level property to the post-accordion #3067

Merged
merged 9 commits into from
May 15, 2024

Conversation

alizedebray
Copy link
Contributor

No description provided.

@alizedebray alizedebray requested a review from a team as a code owner May 6, 2024 16:34
@alizedebray alizedebray requested review from oliverschuerch and removed request for a team May 6, 2024 16:34
Copy link

changeset-bot bot commented May 6, 2024

🦋 Changeset detected

Latest commit: 38267c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@swisspost/design-system-components Minor
@swisspost/design-system-components-angular Minor
@swisspost/design-system-components-react Minor
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-documentation Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles Minor
@swisspost/design-system-intranet-header Minor
@swisspost/design-system-icons Minor
@swisspost/design-system-migrations Minor
@swisspost/design-system-demo Patch
@swisspost/internet-header Patch
@swisspost/design-system-intranet-header-workspace Patch
@swisspost/design-system-intranet-header-showcase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented May 6, 2024

Related Previews

/**
* Defines the hierarchical level of the `post-accordion-item` headers within the headings structure.
*/
@Prop() readonly headingLevel?: HeadingLevel;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not make it required to avoid a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a default value here? I mean, there was a default value (2), when we had the prop on the post-accordion-item.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The post-accordion-item still has a default value that will be used if the property is not defined on the post-accordion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sence, our would it be better to get the default value allways from the post-accordion component?

post-accordion headingLevel (default value of 2, not required)
post-accordion-item headingLevel (no default value, required)

Would this make more sence? Would it be a breaking change? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the default title level from the post-accordion element would be a drastic change in my opinion.
We can always add a default to the post-accordion too, but that would be difficult to maintain because the two defaults need to be in sync. Also, it wouldn't fit this idea.

/**
* Defines the hierarchical level of the `post-accordion-item` headers within the headings structure.
*/
@Prop() readonly headingLevel?: HeadingLevel;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a default value here? I mean, there was a default value (2), when we had the prop on the post-accordion-item.

Base automatically changed from 3065-update-accordion-documentation to main May 14, 2024 07:02
@alizedebray alizedebray linked an issue May 14, 2024 that may be closed by this pull request
@alizedebray alizedebray force-pushed the 2576-add-heading-level-property-on-post-accordion branch from 4712175 to 0831bc8 Compare May 14, 2024 11:38
Comment on lines 21 to 25
'Defines the hierarchical level of the accordion item header within the headings structure.' +
'<span className="mb-mini alert alert-warning alert-sm">' +
'<code>heading-level</code> on <code>post-accordion-item</code> is deprecated. ' +
'Set it directly on the parent <code>post-accordion</code>.' +
'</span>',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this description into the component file (as jsdoc block) or is there a problem with the alert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I had to add some custom logic but the deprecation message is now linked to the jsDocs

Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@alizedebray alizedebray merged commit c14c338 into main May 15, 2024
9 checks passed
@alizedebray alizedebray deleted the 2576-add-heading-level-property-on-post-accordion branch May 15, 2024 08:11
alizedebray added a commit that referenced this pull request May 23, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @swisspost/design-system-components@7.1.0

### Minor Changes

- Added a `heading-level` property on the `post-accordion` component to
set the heading level of all `post-accordion-item` children at once. (by
[@alizedebray](https://github.com/alizedebray) with
[#3067](#3067))

### Patch Changes

- Merged the card-control, checkbox-card and radio button card docs
pages and updated the choice-card-control styles. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2847](#2847))

- Fixed high-contrast-mode for card-control component. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2995](#2995))

- Fixed the `post-accordion-item` chevron no longer rotating. (by
[@alizedebray](https://github.com/alizedebray) with
[#3081](#3081))

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0

## @swisspost/design-system-components-angular@7.1.0

### Minor Changes

- Added a `heading-level` property on the `post-accordion` component to
set the heading level of all `post-accordion-item` children at once. (by
[@alizedebray](https://github.com/alizedebray) with
[#3067](#3067))

## @swisspost/design-system-icons@7.1.0

### Minor Changes

- Added icon number 2585. (by
[@swisspost-bot](https://github.com/swisspost-bot) with
[#3018](#3018))

- Added icons number 2586, 2587 and 2588. (by
[@swisspost-bot](https://github.com/swisspost-bot) with
[#3077](#3077))

## @swisspost/design-system-styles@7.1.0

### Minor Changes

- Added the option for a Button animation to the left. (by
[@davidritter-dotcom](https://github.com/davidritter-dotcom) with
[#2865](#2865))

### Patch Changes

- Fixed missing chevron in valid and invalid select entries. (by
[@alizedebray](https://github.com/alizedebray) with
[#3075](#3075))

- Updated popover styles. - Removed popover `min-width` and updated
`max-width`.

    -   Simplyfied popover arrow size definition.
- Removed `:focus` selector fom `.text-auto` utility class (by
[@imagoiq](https://github.com/imagoiq) with
[#2926](#2926))

- Merged the card-control, checkbox-card and radio button card docs
pages and updated the choice-card-control styles. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2847](#2847))

- Fixed high-contrast-mode for card-control component. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2995](#2995))

- Added missing focus ring on checkbox and radio button groups. (by
[@alizedebray](https://github.com/alizedebray) with
[#3063](#3063))

## @swisspost/internet-header@1.13.10

### Patch Changes

- Fixed display issue with long user/company names being cut off in the
user dropdown. (by [@alizedebray](https://github.com/alizedebray) with
[#3071](#3071))
-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0

## @swisspost/design-system-intranet-header@7.1.0

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0

## @swisspost/design-system-migrations@7.1.0



## @swisspost/design-system-components-react@7.1.0

### Minor Changes

- Added a `heading-level` property on the `post-accordion` component to
set the heading level of all `post-accordion-item` children at once. (by
[@alizedebray](https://github.com/alizedebray) with
[#3067](#3067))

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-components@7.1.0

## @swisspost/design-system-documentation@5.1.0

### Minor Changes

- Added the option for a Button animation to the left. (by
[@davidritter-dotcom](https://github.com/davidritter-dotcom) with
[#2865](#2865))

### Patch Changes

- Updated storybook version to 8 (by
[@renovate](https://github.com/apps/renovate) with
[#2797](#2797))

- Updated the post-accordion documentation: explicitly set the
`collapsed` property to `true`, simplified `collapsed` property usage
examples, and corrected misnamed `close-others` property to `multiple`.
(by [@alizedebray](https://github.com/alizedebray) with
[#3066](#3066))

- Merged the card-control, checkbox-card and radio button card docs
pages and updated the choice-card-control styles. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2847](#2847))

- Fixed high-contrast-mode for card-control component. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2995](#2995))

- Fixed the product card border missing in the documentation page. (by
[@alizedebray](https://github.com/alizedebray) with
[#3057](#3057))

-   Updated dependencies:
    -   @swisspost/design-system-icons@7.1.0
    -   @swisspost/design-system-styles@7.1.0
    -   @swisspost/internet-header@1.13.10
    -   @swisspost/design-system-components@7.1.0
    -   @swisspost/design-system-components-react@7.1.0

## @swisspost/design-system-components-angular-workspace@1.1.1

### Patch Changes

- Merged the card-control, checkbox-card and radio button card docs
pages and updated the choice-card-control styles. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2847](#2847))

- Fixed high-contrast-mode for card-control component. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#2995](#2995))

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0
    -   @swisspost/design-system-components@7.1.0

## @swisspost/design-system-demo@7.3.1

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0
    -   @swisspost/design-system-intranet-header@7.1.0
    -   @swisspost/design-system-migrations@7.1.0

## @swisspost/design-system-intranet-header-workspace@3.0.13

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0

## @swisspost/design-system-intranet-header-showcase@1.0.1

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-intranet-header@7.1.0

## @swisspost/design-system-nextjs-integration@0.1.5

### Patch Changes

-   Updated dependencies:
    -   @swisspost/design-system-styles@7.1.0
    -   @swisspost/internet-header@1.13.10
    -   @swisspost/design-system-components-react@7.1.0

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alizé Debray <alize.debray@post.ch>
Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add heading-level property on post-accordion
3 participants