Skip to content

Commit

Permalink
chore(docs,components): make heading-level required and update docs (#…
Browse files Browse the repository at this point in the history
…3383)

Co-authored-by: Alizé Debray <[email protected]>
  • Loading branch information
schaertim and alizedebray authored Sep 18, 2024
1 parent ea78298 commit d7f76dc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/tame-terms-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-documentation': major
'@swisspost/design-system-components': major
---

Made the heading-level property required for the accordion and removed it from the accordion-item docs.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class PostAccordionItem {
* Defines the hierarchical level of the accordion item header within the headings structure.
* @deprecated set the `heading-level` property on the parent `post-accordion` instead.
*/
@Prop() readonly headingLevel?: HeadingLevel = 2;
@Prop() readonly headingLevel?: HeadingLevel;

@Watch('headingLevel')
validateHeadingLevel(newValue = this.headingLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class PostAccordion {
/**
* Defines the hierarchical level of the `post-accordion-item` headers within the headings structure.
*/
@Prop() readonly headingLevel?: HeadingLevel;
@Prop() readonly headingLevel!: HeadingLevel;

@Watch('headingLevel')
validateHeadingLevel(newValue = this.headingLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

| Property | Attribute | Description | Type | Default |
| -------------- | --------------- | -------------------------------------------------------------------------------------------------- | ---------------------------- | ----------- |
| `headingLevel` | `heading-level` | Defines the hierarchical level of the `post-accordion-item` headers within the headings structure. | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `undefined` |
| `headingLevel` _(required)_ | `heading-level` | Defines the hierarchical level of the `post-accordion-item` headers within the headings structure. | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `undefined` |
| `multiple` | `multiple` | If `true`, multiple `post-accordion-item` can be open at the same time. | `boolean` | `false` |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const meta: Meta = {
headingLevel: {
name: 'heading-level',
control: false, // disable the control since it is not usable on the story
table: {
disable:true,
}
},
},
};
Expand Down

0 comments on commit d7f76dc

Please sign in to comment.