Skip to content

Commit 4360b5c

Browse files
authored
docs: fix Dialog stories and usage table width (#4546)
1 parent 645acac commit 4360b5c

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.storybook/components/Import.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ImportStatement = ({ moduleName, packageName }: ImportStatementProp
1616
return (
1717
<pre
1818
style={{
19-
display: 'block',
19+
display: 'contents',
2020
overflowX: 'auto',
2121
padding: '0px',
2222
background: 'white',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ValueState } from '../../enums/ValueState.js';
1010
import { Bar } from '../../webComponents/Bar/index.js';
1111
import { Button } from '../../webComponents/Button/index.js';
1212
// todo replace once `createPortal` is supported
13-
import { Dialog } from '../../webComponents/Dialog/Dialog.stories.js';
13+
import { Dialog } from '../../webComponents/Dialog/CodeGen.js';
1414
import { Link } from '../../webComponents/Link/index.js';
1515
// todo replace once `createPortal` is supported
1616
import { ResponsivePopover } from '../../webComponents/ResponsivePopover/CodeGen.js';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React, { forwardRef } from 'react';
2+
import { createPortal } from 'react-dom';
3+
import { Dialog as OriginalDialog, DialogDomRef, DialogPropTypes } from './index';
4+
5+
// todo remove once portals are supported inline, or general popovers are supported w/o having to mount them to the body
6+
export const Dialog = forwardRef<DialogDomRef, DialogPropTypes>((args, ref) =>
7+
createPortal(<OriginalDialog {...args} ref={ref} />, document.body)
8+
);
9+
10+
Dialog.displayName = 'Dialog';

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { isChromatic } from '@sb/utils';
22
import type { Meta, StoryObj } from '@storybook/react';
33
import settingsIcon from '@ui5/webcomponents-icons/dist/settings.js';
4-
import React, { forwardRef, useEffect, useState } from 'react';
5-
import { createPortal } from 'react-dom';
4+
import React, { useEffect, useState } from 'react';
65
import { BarDesign } from '../../enums';
7-
import { Bar, Button, DialogDomRef, DialogPropTypes, Icon, List, StandardListItem, Title } from '../index.js';
6+
import { Bar, Button, Icon, List, StandardListItem, Title } from '../index.js';
7+
import { Dialog } from './CodeGen';
88
import { Dialog as OriginalDialog } from './index';
99

1010
const meta = {
@@ -21,13 +21,6 @@ const meta = {
2121
}
2222
} satisfies Meta<typeof OriginalDialog>;
2323

24-
// todo remove once portals are supported inline, or general popovers are supported w/o having to mount them to the body
25-
export const Dialog = forwardRef<DialogDomRef, DialogPropTypes>((args, ref) =>
26-
createPortal(<OriginalDialog {...args} ref={ref} />, document.body)
27-
);
28-
29-
Dialog.displayName = 'Dialog';
30-
3124
export default meta;
3225
type Story = StoryObj<typeof meta>;
3326

0 commit comments

Comments
 (0)