Skip to content

Commit 350643c

Browse files
authored
docs(Dialog): fix footer role (#6817)
Fixes #6781
1 parent 13f6fb1 commit 350643c

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

packages/main/src/components/Modals/Modals.stories.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Meta, StoryObj } from '@storybook/react';
2+
import { FlexBox, FlexBoxJustifyContent } from '@ui5/webcomponents-react';
23
import { MessageBoxType } from '../../enums/index.js';
3-
import { Bar, Button, MenuItem } from '../../webComponents/index.js';
4+
import { Button, MenuItem } from '../../webComponents/index.js';
45
import { Modals } from './index.js';
56

67
const meta = {
@@ -19,7 +20,11 @@ export const Dialog: Story = {
1920
const { close } = Modals.showDialog({
2021
headerText: 'Dialog Title',
2122
children: "I'm a Dialog!",
22-
footer: <Bar endContent={<Button onClick={() => close()}>Close</Button>} />
23+
footer: (
24+
<FlexBox justifyContent={FlexBoxJustifyContent.End} fitContainer style={{ paddingBlock: '0.25rem' }}>
25+
<Button onClick={() => close()}>Close</Button>{' '}
26+
</FlexBox>
27+
)
2328
});
2429
}}
2530
>

packages/main/src/webComponents/Dialog/Dialog.stories.tsx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { isChromatic } from '@sb/utils.js';
22
import type { Meta, StoryObj } from '@storybook/react';
3-
import BarDesign from '@ui5/webcomponents/dist/types/BarDesign.js';
4-
import settingsIcon from '@ui5/webcomponents-icons/dist/settings.js';
5-
import { clsx } from 'clsx';
3+
import { FlexBox, FlexBoxJustifyContent } from '@ui5/webcomponents-react';
64
import { useEffect, useState } from 'react';
7-
import { Bar, Button, Icon, List, ListItemStandard, Title } from '../index.js';
5+
import { Button, List, ListItemStandard } from '../index.js';
86
import { Dialog } from './index.js';
97

108
const meta = {
@@ -23,8 +21,7 @@ const meta = {
2321
</List>
2422
),
2523
headerText: 'Dialog Header',
26-
open: isChromatic,
27-
className: 'footerPartNoPadding'
24+
open: isChromatic
2825
},
2926
tags: ['package:@ui5/webcomponents']
3027
} satisfies Meta<typeof Dialog>;
@@ -55,18 +52,15 @@ export const Default: Story = {
5552
setDialogOpen(false);
5653
}}
5754
footer={
58-
<Bar
59-
design={BarDesign.Footer}
60-
endContent={
61-
<Button
62-
onClick={() => {
63-
setDialogOpen(false);
64-
}}
65-
>
66-
Close
67-
</Button>
68-
}
69-
/>
55+
<FlexBox justifyContent={FlexBoxJustifyContent.End} fitContainer style={{ paddingBlock: '0.25rem' }}>
56+
<Button
57+
onClick={() => {
58+
setDialogOpen(false);
59+
}}
60+
>
61+
Close
62+
</Button>
63+
</FlexBox>
7064
}
7165
/>
7266
</>

0 commit comments

Comments
 (0)