Skip to content

Commit c51cf55

Browse files
fix(docs): fix dialog markup on dialog text content and button intendation (#6206)
## 📄 Description - Added `<p>`-tag around dialog content in stories, required for accessibility. - Separated `<button>`-tags to be on two different lines. --------- Co-authored-by: Alona Zherdetska <[email protected]>
1 parent 7302743 commit c51cf55

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.changeset/four-monkeys-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@swisspost/design-system-documentation': patch
3+
---
4+
5+
Improved `dialog` component accessibility by adding proper paragraph markup around text content.

packages/documentation/src/stories/components/dialog/dialog.stories.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ const getCloseButton = () => {
120120
};
121121

122122
const getControls = () => {
123-
return html`<button class="btn btn-primary">OK</button>
124-
<button class="btn btn-secondary">Cancel</button>`;
123+
return html`
124+
<button class="btn btn-primary">OK</button>
125+
<button class="btn btn-secondary">Cancel</button>
126+
`;
125127
};
126128

127129
const Template = {
@@ -148,7 +150,7 @@ const Template = {
148150
<form method="dialog" class="dialog-grid">
149151
${postDialogIcon}
150152
<h3 class="dialog-header">${args.title}</h3>
151-
<div class="dialog-body">${args.content}</div>
153+
<div class="dialog-body"><p>${args.content}</p></div>
152154
<div class="dialog-controls">${getControls()}</div>
153155
${postDialogCloseButton}
154156
</form>

0 commit comments

Comments
 (0)