-
{this.renderDialogContent(handleSubmit, form)}
+
{this.renderDialogContent(handleSubmit, form)}
);
};
diff --git a/src/stories/SizeContext.tsx b/src/stories/SizeContext.tsx
new file mode 100644
index 0000000..d226847
--- /dev/null
+++ b/src/stories/SizeContext.tsx
@@ -0,0 +1,10 @@
+import React from 'react';
+
+const SizeContext = React.createContext<'s' | 'm' | 'l'>('m');
+
+export const SizeProvider = SizeContext.Provider;
+
+export function useSize() {
+ const size = React.useContext(SizeContext);
+ return {size};
+}
diff --git a/src/stories/dialog/00_Base_controls.stories.tsx b/src/stories/dialog/00_Base_controls.stories.tsx
index 56c98cd..f71a417 100644
--- a/src/stories/dialog/00_Base_controls.stories.tsx
+++ b/src/stories/dialog/00_Base_controls.stories.tsx
@@ -8,6 +8,7 @@ import {MultiTextControlProps} from '../../dialog/MultiTextControl/MultiTextCont
import {EditableListProps} from '../../dialog/EditableList/EditableList';
import {EditableManyListsProps} from '../../dialog/EditableManyLists/EditableManyLists';
import {SelectControlProps} from '../../dialog/SelectControl/SelectControl';
+import {useSize} from '../SizeContext';
class DialogWithSelectStories extends Component {
state = {
@@ -88,6 +89,7 @@ function DialogDemo({
}}
onClose={onClose ?? (() => {})}
visible
+ {...useSize()}
onAdd={onAdd}
initialValues={{
plain: 'Some text for "plain" control',
diff --git a/src/stories/dialog/01_One_tab.stories.tsx b/src/stories/dialog/01_One_tab.stories.tsx
index 7bc65ac..0a95fb9 100644
--- a/src/stories/dialog/01_One_tab.stories.tsx
+++ b/src/stories/dialog/01_One_tab.stories.tsx
@@ -3,6 +3,7 @@ import {DFDialog} from '../../dialog/Dialog/Dialog';
import {StoryFn, Meta} from '@storybook/react';
import {FormApi} from '../../index';
import {Button} from '@gravity-ui/uikit';
+import {useSize} from '../SizeContext';
interface FormValues {
firstName: string;
@@ -66,6 +67,7 @@ function DialogDemo({
headerProps={{
title: 'One tab',
}}
+ {...useSize()}
onClose={onClose ?? (() => {})}
visible
onAdd={onAdd}
diff --git a/src/stories/dialog/02_Several_tabs.stories.tsx b/src/stories/dialog/02_Several_tabs.stories.tsx
index ce72530..5587d46 100644
--- a/src/stories/dialog/02_Several_tabs.stories.tsx
+++ b/src/stories/dialog/02_Several_tabs.stories.tsx
@@ -3,6 +3,7 @@ import {DFDialog} from '../../dialog/Dialog/Dialog';
import {StoryFn, Meta} from '@storybook/react';
import {FormApi} from '../../index';
import {Button} from '@gravity-ui/uikit';
+import {useSize} from '../SizeContext';
interface FormValues {
general: {
@@ -84,6 +85,7 @@ function DialogDemo({
headerProps={{
title: 'Several tabs',
}}
+ {...useSize()}
onClose={onClose ?? (() => {})}
visible
onAdd={onAdd}
diff --git a/src/stories/dialog/03_Sections.stories.tsx b/src/stories/dialog/03_Sections.stories.tsx
index bd9bab6..63f7ebe 100644
--- a/src/stories/dialog/03_Sections.stories.tsx
+++ b/src/stories/dialog/03_Sections.stories.tsx
@@ -3,6 +3,7 @@ import {DFDialog} from '../../dialog/Dialog/Dialog';
import {StoryFn, Meta} from '@storybook/react';
import {FormApi} from '../../index';
import {Button} from '@gravity-ui/uikit';
+import {useSize} from '../SizeContext';
interface FormValues {
firstName: string;
@@ -66,6 +67,7 @@ function DialogDemo({
headerProps={{
title: 'Group of fields',
}}
+ {...useSize()}
onClose={onClose ?? (() => {})}
visible
onAdd={onAdd}
diff --git a/src/stories/dialog/04_Visibility_condition.stories.tsx b/src/stories/dialog/04_Visibility_condition.stories.tsx
index 16dd934..4cbfa24 100644
--- a/src/stories/dialog/04_Visibility_condition.stories.tsx
+++ b/src/stories/dialog/04_Visibility_condition.stories.tsx
@@ -3,6 +3,7 @@ import {DeepPartial, DFDialog} from '../../dialog/Dialog/Dialog';
import {StoryFn, Meta} from '@storybook/react';
import {FormApi} from '../../index';
import {Button} from '@gravity-ui/uikit';
+import {useSize} from '../SizeContext';
interface FormValues {
general: {
@@ -86,6 +87,7 @@ function DialogDemo({
headerProps={{
title: 'Visibility contdition',
}}
+ {...useSize()}
onClose={onClose ?? (() => {})}
visible
onAdd={onAdd}
diff --git a/src/stories/dialog/05_Extras_and_linked_fields.stories.tsx b/src/stories/dialog/05_Extras_and_linked_fields.stories.tsx
index 12d8aa7..a8016e6 100644
--- a/src/stories/dialog/05_Extras_and_linked_fields.stories.tsx
+++ b/src/stories/dialog/05_Extras_and_linked_fields.stories.tsx
@@ -3,6 +3,7 @@ import {DFDialog} from '../../dialog/Dialog/Dialog';
import {StoryFn, Meta} from '@storybook/react';
import {FormApi} from '../../index';
import {Button} from '@gravity-ui/uikit';
+import {useSize} from '../SizeContext';
interface FormValues {
type: Array