From d7f76dcfa39982ed358fcd8a9b7d920a753ceeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Sch=C3=A4r?= <59233938+schaertim@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:22:39 +0200 Subject: [PATCH] chore(docs,components): make heading-level required and update docs (#3383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com> --- .changeset/tame-terms-push.md | 6 ++++++ .../components/post-accordion-item/post-accordion-item.tsx | 2 +- .../src/components/post-accordion/post-accordion.tsx | 2 +- packages/components/src/components/post-accordion/readme.md | 2 +- .../stories/components/accordion/accordion-item.stories.ts | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/tame-terms-push.md diff --git a/.changeset/tame-terms-push.md b/.changeset/tame-terms-push.md new file mode 100644 index 0000000000..402e20981e --- /dev/null +++ b/.changeset/tame-terms-push.md @@ -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. diff --git a/packages/components/src/components/post-accordion-item/post-accordion-item.tsx b/packages/components/src/components/post-accordion-item/post-accordion-item.tsx index f37be6652c..a6dcc2774c 100644 --- a/packages/components/src/components/post-accordion-item/post-accordion-item.tsx +++ b/packages/components/src/components/post-accordion-item/post-accordion-item.tsx @@ -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) { diff --git a/packages/components/src/components/post-accordion/post-accordion.tsx b/packages/components/src/components/post-accordion/post-accordion.tsx index 0138858388..04a597916e 100644 --- a/packages/components/src/components/post-accordion/post-accordion.tsx +++ b/packages/components/src/components/post-accordion/post-accordion.tsx @@ -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) { diff --git a/packages/components/src/components/post-accordion/readme.md b/packages/components/src/components/post-accordion/readme.md index b75987447c..c49a7e8859 100644 --- a/packages/components/src/components/post-accordion/readme.md +++ b/packages/components/src/components/post-accordion/readme.md @@ -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` | diff --git a/packages/documentation/src/stories/components/accordion/accordion-item.stories.ts b/packages/documentation/src/stories/components/accordion/accordion-item.stories.ts index c7a6a66647..b1063223b5 100644 --- a/packages/documentation/src/stories/components/accordion/accordion-item.stories.ts +++ b/packages/documentation/src/stories/components/accordion/accordion-item.stories.ts @@ -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, + } }, }, };