Skip to content

Commit

Permalink
docs(Dialog): fix footer role (#6817)
Browse files Browse the repository at this point in the history
Fixes #6781
  • Loading branch information
Lukas742 authored Jan 14, 2025
1 parent 13f6fb1 commit 350643c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
9 changes: 7 additions & 2 deletions packages/main/src/components/Modals/Modals.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import { FlexBox, FlexBoxJustifyContent } from '@ui5/webcomponents-react';
import { MessageBoxType } from '../../enums/index.js';
import { Bar, Button, MenuItem } from '../../webComponents/index.js';
import { Button, MenuItem } from '../../webComponents/index.js';
import { Modals } from './index.js';

const meta = {
Expand All @@ -19,7 +20,11 @@ export const Dialog: Story = {
const { close } = Modals.showDialog({
headerText: 'Dialog Title',
children: "I'm a Dialog!",
footer: <Bar endContent={<Button onClick={() => close()}>Close</Button>} />
footer: (
<FlexBox justifyContent={FlexBoxJustifyContent.End} fitContainer style={{ paddingBlock: '0.25rem' }}>
<Button onClick={() => close()}>Close</Button>{' '}
</FlexBox>
)
});
}}
>
Expand Down
30 changes: 12 additions & 18 deletions packages/main/src/webComponents/Dialog/Dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { isChromatic } from '@sb/utils.js';
import type { Meta, StoryObj } from '@storybook/react';
import BarDesign from '@ui5/webcomponents/dist/types/BarDesign.js';
import settingsIcon from '@ui5/webcomponents-icons/dist/settings.js';
import { clsx } from 'clsx';
import { FlexBox, FlexBoxJustifyContent } from '@ui5/webcomponents-react';
import { useEffect, useState } from 'react';
import { Bar, Button, Icon, List, ListItemStandard, Title } from '../index.js';
import { Button, List, ListItemStandard } from '../index.js';
import { Dialog } from './index.js';

const meta = {
Expand All @@ -23,8 +21,7 @@ const meta = {
</List>
),
headerText: 'Dialog Header',
open: isChromatic,
className: 'footerPartNoPadding'
open: isChromatic
},
tags: ['package:@ui5/webcomponents']
} satisfies Meta<typeof Dialog>;
Expand Down Expand Up @@ -55,18 +52,15 @@ export const Default: Story = {
setDialogOpen(false);
}}
footer={
<Bar
design={BarDesign.Footer}
endContent={
<Button
onClick={() => {
setDialogOpen(false);
}}
>
Close
</Button>
}
/>
<FlexBox justifyContent={FlexBoxJustifyContent.End} fitContainer style={{ paddingBlock: '0.25rem' }}>
<Button
onClick={() => {
setDialogOpen(false);
}}
>
Close
</Button>
</FlexBox>
}
/>
</>
Expand Down

0 comments on commit 350643c

Please sign in to comment.