From b1d853a48014545069b85738a8fba347c5ebf84d Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Wed, 20 Sep 2023 13:17:51 +0000 Subject: [PATCH] Chore: Remove withCenteredStory storybook decorators (#75154) --- .../components/Alert/InlineBanner.story.tsx | 2 - .../src/components/Alert/Toast.story.tsx | 2 - .../AutoSaveField/AutoSaveField.story.tsx | 2 - .../src/components/Badge/Badge.story.tsx | 2 - .../components/BarGauge/BarGauge.story.tsx | 2 - .../components/BigValue/BigValue.story.tsx | 2 - .../src/components/Button/Button.story.tsx | 2 - .../ButtonCascader/ButtonCascader.story.tsx | 3 -- .../src/components/Card/Card.story.tsx | 2 - .../components/Cascader/Cascader.story.tsx | 3 -- .../ClickOutsideWrapper.story.tsx | 12 ++--- .../ClipboardButton.internal.story.tsx | 2 - .../Collapse/CollapsableSection.story.tsx | 3 -- .../components/Collapse/Collapse.story.tsx | 3 -- .../ColorPicker/ColorPicker.story.tsx | 41 +++++++++-------- .../ColorPicker/ColorPickerPopover.story.tsx | 44 ++++++++++++------- .../ColorPicker/NamedColorsPalette.story.tsx | 3 -- .../ColorPicker/SpectrumPalette.story.tsx | 2 - .../ConfirmButton/ConfirmButton.story.tsx | 2 - .../ConfirmModal/ConfirmModal.story.tsx | 3 -- .../ContextMenu/ContextMenu.story.tsx | 2 - .../DatePicker/DatePicker.story.tsx | 2 - .../DatePickerWithInput.story.tsx | 3 -- .../DateTimePicker/DateTimePicker.story.tsx | 3 -- .../RelativeTimeRangePicker.story.tsx | 3 -- .../DateTimePickers/TimeOfDayPicker.story.tsx | 3 -- .../DateTimePickers/TimeRangeInput.story.tsx | 3 -- .../DateTimePickers/TimeRangePicker.story.tsx | 3 -- .../DateTimePickers/TimeZonePicker.story.tsx | 3 -- .../DateTimePickers/WeekStartPicker.story.tsx | 3 -- .../src/components/Divider/Divider.story.tsx | 3 -- .../src/components/Drawer/Drawer.story.tsx | 19 +++++--- .../Dropdown/ButtonSelect.internal.story.tsx | 3 -- .../components/Dropdown/Dropdown.story.tsx | 2 - .../EmptySearchResult.story.tsx | 3 -- .../ErrorBoundary/ErrorBoundary.story.tsx | 3 -- .../FileDropzone/FileDropzone.story.tsx | 3 -- .../FileDropzone/FileListItem.story.tsx | 3 -- .../FileUpload/FileUpload.story.tsx | 3 -- .../FilterPill/FilterPill.story.tsx | 3 -- .../components/Flex/Flex.internal.story.tsx | 2 - .../FormField/FormField.internal.story.tsx | 3 -- .../FormattedValueDisplay.story.tsx | 3 -- .../src/components/Forms/FieldArray.story.tsx | 3 +- .../src/components/Forms/FieldSet.story.tsx | 2 - .../src/components/Forms/Form.story.tsx | 3 +- .../Legacy/Input/Input.internal.story.tsx | 2 - .../Legacy/Select/Select.internal.story.tsx | 3 -- .../Graph/GraphWithLegend.internal.story.tsx | 3 -- .../src/components/Icon/Icon.story.tsx | 2 - .../IconButton/IconButton.story.tsx | 2 - .../InfoTooltip.internal.story.tsx | 3 -- .../InlineToast.internal.story.tsx | 2 - .../components/Input/AutoSizeInput.story.tsx | 2 - .../src/components/Input/Input.story.tsx | 2 - .../InteractiveTable.story.tsx | 3 -- .../src/components/Layout/Layout.story.tsx | 3 +- .../LoadingBar/LoadingBar.story.tsx | 2 - .../LoadingPlaceholder.story.tsx | 3 -- .../src/components/Modal/Modal.story.tsx | 2 - .../Monaco/CodeEditor.internal.story.tsx | 3 -- .../PageLayout/PageToolbar.story.tsx | 2 - .../Pagination/Pagination.story.tsx | 3 -- .../PanelChrome/PanelChrome.story.tsx | 2 - .../PanelContainer/PanelContainer.story.tsx | 3 -- .../PluginSignatureBadge.story.tsx | 3 -- .../QueryField/QueryField.story.tsx | 2 - .../RefreshPicker/RefreshPicker.story.tsx | 3 -- .../SecretFormField.internal.story.tsx | 3 -- .../SecretInput/SecretInput.story.tsx | 3 -- .../SecretTextArea/SecretTextArea.story.tsx | 3 -- .../src/components/Select/Select.story.tsx | 2 - .../Select/SelectPerf.internal.story.tsx | 2 - .../src/components/Spinner/Spinner.story.tsx | 3 -- .../components/Stack/Stack.internal.story.tsx | 3 -- .../StatsPicker/StatsPicker.story.tsx | 3 -- .../src/components/Switch/Switch.story.tsx | 2 - .../src/components/Table/Table.story.tsx | 2 - .../TableInputCSV.internal.story.tsx | 3 -- .../src/components/Tabs/Tabs.story.tsx | 2 - .../src/components/Tags/Tag.story.tsx | 3 -- .../src/components/Tags/TagList.story.tsx | 3 -- .../components/TagsInput/TagsInput.story.tsx | 2 - .../components/TextArea/TextArea.story.tsx | 3 -- .../components/Toggletip/Toggletip.story.tsx | 2 - .../ToolbarButton/ToolbarButton.story.tsx | 2 - .../ToolbarButton/ToolbarButtonRow.story.tsx | 2 - .../src/components/Tooltip/Tooltip.story.tsx | 2 - .../UnitPicker/UnitPicker.story.tsx | 3 -- .../ValuePicker/ValuePicker.story.tsx | 2 - .../components/VizLayout/VizLayout.story.tsx | 3 -- .../components/VizLegend/VizLegend.story.tsx | 3 -- .../src/utils/storybook/withCenteredStory.tsx | 13 ------ .../utils/useDelayedSwitch.internal.story.tsx | 2 - 94 files changed, 72 insertions(+), 285 deletions(-) delete mode 100644 packages/grafana-ui/src/utils/storybook/withCenteredStory.tsx diff --git a/packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx b/packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx index dd48858b8a4..1e13af573d6 100644 --- a/packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx +++ b/packages/grafana-ui/src/components/Alert/InlineBanner.story.tsx @@ -5,7 +5,6 @@ import React from 'react'; import { Alert, AlertVariant, VerticalGroup } from '@grafana/ui'; import { StoryExample } from '../../utils/storybook/StoryExample'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Alert.mdx'; @@ -14,7 +13,6 @@ const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; const meta: Meta = { title: 'Overlays/Alert/InlineBanner', component: Alert, - decorators: [withCenteredStory, withHorizontallyCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Alert/Toast.story.tsx b/packages/grafana-ui/src/components/Alert/Toast.story.tsx index dd06a387c9e..1352fe33256 100644 --- a/packages/grafana-ui/src/components/Alert/Toast.story.tsx +++ b/packages/grafana-ui/src/components/Alert/Toast.story.tsx @@ -5,7 +5,6 @@ import React from 'react'; import { Alert, AlertVariant, VerticalGroup } from '@grafana/ui'; import { StoryExample } from '../../utils/storybook/StoryExample'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Alert.mdx'; @@ -14,7 +13,6 @@ const severities: AlertVariant[] = ['error', 'warning', 'info', 'success']; const meta: Meta = { title: 'Overlays/Alert/Toast', component: Alert, - decorators: [withCenteredStory, withHorizontallyCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx b/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx index c665254f885..f44cfcdab37 100644 --- a/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx +++ b/packages/grafana-ui/src/components/AutoSaveField/AutoSaveField.story.tsx @@ -1,7 +1,6 @@ import { Story, Meta } from '@storybook/react'; import React, { useState } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Checkbox } from '../Forms/Checkbox'; import { RadioButtonGroup } from '../Forms/RadioButtonGroup/RadioButtonGroup'; import { Input } from '../Input/Input'; @@ -15,7 +14,6 @@ import mdx from './AutoSaveField.mdx'; const meta: Meta = { title: 'Forms/AutoSaveField', component: AutoSaveField, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Badge/Badge.story.tsx b/packages/grafana-ui/src/components/Badge/Badge.story.tsx index f21aa5a038b..5f742d8d51d 100644 --- a/packages/grafana-ui/src/components/Badge/Badge.story.tsx +++ b/packages/grafana-ui/src/components/Badge/Badge.story.tsx @@ -4,14 +4,12 @@ import React from 'react'; import { Badge } from '@grafana/ui'; import { iconOptions } from '../../utils/storybook/icons'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Badge.mdx'; const meta: Meta = { title: 'Data Display/Badge', component: Badge, - decorators: [withCenteredStory], parameters: { docs: { page: mdx }, }, diff --git a/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx b/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx index 5ecd90bf95a..0f8f153cee6 100644 --- a/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx +++ b/packages/grafana-ui/src/components/BarGauge/BarGauge.story.tsx @@ -5,7 +5,6 @@ import { VizOrientation, ThresholdsMode, Field, FieldType, getDisplayProcessor } import { BarGauge, BarGaugeDisplayMode } from '@grafana/ui'; import { useTheme2 } from '../../themes'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Props } from './BarGauge'; import mdx from './BarGauge.mdx'; @@ -13,7 +12,6 @@ import mdx from './BarGauge.mdx'; const meta: Meta = { title: 'Visualizations/BarGauge', component: BarGauge, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx b/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx index c304c28cab8..34bf52b4920 100644 --- a/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx +++ b/packages/grafana-ui/src/components/BigValue/BigValue.story.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { FieldSparkline, FieldType } from '@grafana/data'; import { useTheme2 } from '../../themes'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { BigValue, @@ -19,7 +18,6 @@ import mdx from './BigValue.mdx'; const meta: Meta = { title: 'Visualizations/BigValue', component: BigValue, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Button/Button.story.tsx b/packages/grafana-ui/src/components/Button/Button.story.tsx index 64e7362fb34..064b9f254ef 100644 --- a/packages/grafana-ui/src/components/Button/Button.story.tsx +++ b/packages/grafana-ui/src/components/Button/Button.story.tsx @@ -2,7 +2,6 @@ import { StoryFn } from '@storybook/react'; import React from 'react'; import { ComponentSize } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Card } from '../Card/Card'; import { HorizontalGroup, VerticalGroup } from '../Layout/Layout'; @@ -15,7 +14,6 @@ const sizes: ComponentSize[] = ['lg', 'md', 'sm']; export default { title: 'Buttons/Button', component: Button, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx b/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx index 951dab51772..4a80c5a4390 100644 --- a/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx +++ b/packages/grafana-ui/src/components/ButtonCascader/ButtonCascader.story.tsx @@ -3,12 +3,9 @@ import React from 'react'; import { ButtonCascader } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - const meta: Meta = { title: 'Forms/Cascader/ButtonCascader', component: ButtonCascader, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['className', 'value', 'fieldNames', 'loadData', 'onChange', 'onPopupVisibleChange'], diff --git a/packages/grafana-ui/src/components/Card/Card.story.tsx b/packages/grafana-ui/src/components/Card/Card.story.tsx index fc95ebfdb3d..f6904421394 100644 --- a/packages/grafana-ui/src/components/Card/Card.story.tsx +++ b/packages/grafana-ui/src/components/Card/Card.story.tsx @@ -1,7 +1,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Button } from '../Button'; import { IconButton } from '../IconButton/IconButton'; import { VerticalGroup } from '../Layout/Layout'; @@ -15,7 +14,6 @@ const logo = 'https://grafana.com/static/assets/img/apple-touch-icon.png'; const meta: Meta = { title: 'General/Card', component: Card, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx b/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx index 9aaf7b02539..9abfda616a3 100644 --- a/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx +++ b/packages/grafana-ui/src/components/Cascader/Cascader.story.tsx @@ -3,8 +3,6 @@ import React from 'react'; import { Cascader } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { CascaderOption } from './Cascader'; import mdx from './Cascader.mdx'; @@ -37,7 +35,6 @@ const options = [ const meta: Meta = { title: 'Forms/Cascader', component: Cascader, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx b/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx index fbad5f4875f..ec5273dae33 100644 --- a/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx +++ b/packages/grafana-ui/src/components/ClickOutsideWrapper/ClickOutsideWrapper.story.tsx @@ -2,15 +2,12 @@ import { action } from '@storybook/addon-actions'; import { Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { ClickOutsideWrapper } from './ClickOutsideWrapper'; import mdx from './ClickOutsideWrapper.mdx'; const meta: Meta = { title: 'Layout/ClickOutsideWrapper', component: ClickOutsideWrapper, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, @@ -20,8 +17,13 @@ const meta: Meta = { export const basic = () => { return ( - -
Container
+ { + action('Clicked outside!')(); + window.alert('Clicked outside!'); + }} + > +
Click outside this box!
); }; diff --git a/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.internal.story.tsx b/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.internal.story.tsx index cbd3573fa5e..1da5c63e556 100644 --- a/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.internal.story.tsx +++ b/packages/grafana-ui/src/components/ClipboardButton/ClipboardButton.internal.story.tsx @@ -1,7 +1,6 @@ import { Story, Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Field } from '../Forms/Field'; import { Input } from '../Input/Input'; @@ -11,7 +10,6 @@ import mdx from './ClipboardButton.mdx'; const meta: Meta = { title: 'Buttons/ClipboardButton', component: ClipboardButtonImpl, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Collapse/CollapsableSection.story.tsx b/packages/grafana-ui/src/components/Collapse/CollapsableSection.story.tsx index 5d7d1527436..5a63e515b4d 100644 --- a/packages/grafana-ui/src/components/Collapse/CollapsableSection.story.tsx +++ b/packages/grafana-ui/src/components/Collapse/CollapsableSection.story.tsx @@ -3,15 +3,12 @@ import { useArgs } from '@storybook/client-api'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { CollapsableSection, Props } from './CollapsableSection'; import mdx from './CollapsableSection.mdx'; const meta: Meta = { title: 'Layout/CollapsableSection', component: CollapsableSection, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Collapse/Collapse.story.tsx b/packages/grafana-ui/src/components/Collapse/Collapse.story.tsx index 3b0e5975bf4..b3bb559dd24 100644 --- a/packages/grafana-ui/src/components/Collapse/Collapse.story.tsx +++ b/packages/grafana-ui/src/components/Collapse/Collapse.story.tsx @@ -3,8 +3,6 @@ import { useArgs } from '@storybook/client-api'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { Collapse, ControlledCollapse } from './Collapse'; import mdx from './Collapse.mdx'; @@ -13,7 +11,6 @@ const EXCLUDED_PROPS = ['className', 'onToggle']; const meta: Meta = { title: 'Layout/Collapse', component: Collapse, - decorators: [withCenteredStory, withHorizontallyCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx index 178600c7a19..81579ec60c4 100644 --- a/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/ColorPicker.story.tsx @@ -5,9 +5,6 @@ import React from 'react'; import { SeriesColorPicker, ColorPicker, clearButtonStyles, useStyles2 } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; -import { renderComponentWithTheme } from '../../utils/storybook/withTheme'; - import mdx from './ColorPicker.mdx'; import { ColorPickerInput } from './ColorPickerInput'; @@ -18,7 +15,6 @@ const meta: Meta = { // https://github.com/storybookjs/storybook/issues/20782 // @ts-ignore subcomponents: { SeriesColorPicker, ColorPickerInput }, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, @@ -35,14 +31,19 @@ const meta: Meta = { export const Basic: StoryFn = ({ color, enableNamedColors }) => { const [, updateArgs] = useArgs(); - return renderComponentWithTheme(ColorPicker, { - enableNamedColors, - color, - onChange: (color: string) => { - action('Color changed')(color); - updateArgs({ color }); - }, - }); + + return ( +
+ { + action('Color changed')(color); + updateArgs({ color }); + }} + /> +
+ ); }; export const SeriesPicker: StoryFn = ({ color, enableNamedColors }) => { @@ -78,13 +79,15 @@ export const SeriesPicker: StoryFn = ({ color, enableN export const Input: StoryFn = ({ color }) => { const [, updateArgs] = useArgs(); return ( - { - action('Color changed')(color); - updateArgs({ color }); - }} - /> +
+ { + action('Color changed')(color); + updateArgs({ color }); + }} + /> +
); }; diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx index ff5ad44f881..70aae18a5b1 100644 --- a/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.story.tsx @@ -1,7 +1,7 @@ import { Meta } from '@storybook/react'; +import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; -import { renderComponentWithTheme } from '../../utils/storybook/withTheme'; +import { useTheme2 } from '../../themes'; import { ColorPickerPopover } from './ColorPickerPopover'; import { SeriesColorPickerPopover } from './SeriesColorPickerPopover'; @@ -13,25 +13,35 @@ const meta: Meta = { // https://github.com/storybookjs/storybook/issues/20782 // @ts-ignore subcomponents: { SeriesColorPickerPopover }, - decorators: [withCenteredStory], }; -export const basic = () => { - return renderComponentWithTheme(ColorPickerPopover, { - color: '#BC67E6', - onChange: (color: string) => { - console.log(color); - }, - }); +export const Basic = () => { + return ( +
+ { + console.log(color); + }} + /> +
+ ); }; -export const seriesColorPickerPopover = () => { - return renderComponentWithTheme(SeriesColorPickerPopover, { - color: '#BC67E6', - onChange: (color: string) => { - console.log(color); - }, - }); +export const SeriesColorPickerPopoverExample = () => { + const theme = useTheme2(); + + return ( +
+ { + console.log(color); + }} + /> +
+ ); }; export default meta; diff --git a/packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.story.tsx b/packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.story.tsx index 56b0ccda0e0..8f76f18b107 100644 --- a/packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.story.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.story.tsx @@ -1,15 +1,12 @@ import { Meta, Story } from '@storybook/react'; import React, { useState } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './ColorPicker.mdx'; import { NamedColorsPalette, NamedColorsPaletteProps } from './NamedColorsPalette'; const meta: Meta = { title: 'Pickers and Editors/ColorPicker/Palettes/NamedColorsPalette', component: NamedColorsPalette, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ColorPicker/SpectrumPalette.story.tsx b/packages/grafana-ui/src/components/ColorPicker/SpectrumPalette.story.tsx index cc5a91bab75..ab03ae9076f 100644 --- a/packages/grafana-ui/src/components/ColorPicker/SpectrumPalette.story.tsx +++ b/packages/grafana-ui/src/components/ColorPicker/SpectrumPalette.story.tsx @@ -2,7 +2,6 @@ import { action } from '@storybook/addon-actions'; import { useArgs } from '@storybook/client-api'; import { Meta, StoryFn } from '@storybook/react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { renderComponentWithTheme } from '../../utils/storybook/withTheme'; import mdx from './ColorPicker.mdx'; @@ -11,7 +10,6 @@ import SpectrumPalette from './SpectrumPalette'; const meta: Meta = { title: 'Pickers and Editors/ColorPicker/Palettes/SpectrumPalette', component: SpectrumPalette, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx index 0fe4dcec9ef..b6fabebc4b2 100644 --- a/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx +++ b/packages/grafana-ui/src/components/ConfirmButton/ConfirmButton.story.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { ConfirmButton } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Button } from '../Button'; import { Props } from './ConfirmButton'; @@ -14,7 +13,6 @@ import { DeleteButton } from './DeleteButton'; const meta: Meta = { title: 'Buttons/ConfirmButton', component: ConfirmButton, - decorators: [withCenteredStory], // SB7 has broken subcomponent types due to dropping support for the feature // https://github.com/storybookjs/storybook/issues/20782 // @ts-ignore diff --git a/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.story.tsx b/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.story.tsx index d819400d4e9..a44d142a2d8 100644 --- a/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.story.tsx +++ b/packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.story.tsx @@ -4,8 +4,6 @@ import React from 'react'; import { ConfirmModal } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './ConfirmModal.mdx'; const defaultExcludes = ['onConfirm', 'onDismiss', 'onAlternative']; @@ -13,7 +11,6 @@ const defaultExcludes = ['onConfirm', 'onDismiss', 'onAlternative']; const meta: Meta = { title: 'Overlays/ConfirmModal', component: ConfirmModal, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx b/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx index a28b51e737b..19888e4b5bf 100644 --- a/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx +++ b/packages/grafana-ui/src/components/ContextMenu/ContextMenu.story.tsx @@ -2,7 +2,6 @@ import { action } from '@storybook/addon-actions'; import { StoryFn, Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { IconButton } from '../IconButton/IconButton'; import { ContextMenu, ContextMenuProps } from './ContextMenu'; @@ -13,7 +12,6 @@ import { WithContextMenu, WithContextMenuProps } from './WithContextMenu'; const meta: Meta = { title: 'General/ContextMenu', component: ContextMenu, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx index d9b0b0437c9..da8d485f776 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DatePicker/DatePicker.story.tsx @@ -1,7 +1,6 @@ import { Meta } from '@storybook/react'; import React, { useState } from 'react'; -import { withCenteredStory } from '../../../utils/storybook/withCenteredStory'; import { Button } from '../../Button/Button'; import { DatePicker, DatePickerProps } from './DatePicker'; @@ -10,7 +9,6 @@ import mdx from './DatePicker.mdx'; const meta: Meta = { title: 'Pickers and Editors/TimePickers/Pickers And Editors/DatePicker', component: DatePicker, - decorators: [withCenteredStory], argTypes: { minDate: { control: 'date' }, }, diff --git a/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx index 0b5e10cb9dc..24a2986a617 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DatePickerWithInput/DatePickerWithInput.story.tsx @@ -3,8 +3,6 @@ import { useArgs } from '@storybook/client-api'; import { StoryFn, Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../../utils/storybook/withCenteredStory'; - import { DatePickerWithInput } from './DatePickerWithInput'; import mdx from './DatePickerWithInput.mdx'; @@ -18,7 +16,6 @@ minimumDate.setMonth(minimumDate.getMonth() - 1); const meta: Meta = { title: 'Pickers and Editors/TimePickers/DatePickerWithInput', component: DatePickerWithInput, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx index dd167ba421d..6a95f19ef89 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.story.tsx @@ -4,8 +4,6 @@ import React, { useState } from 'react'; import { dateTime, DateTime } from '@grafana/data'; -import { withCenteredStory } from '../../../utils/storybook/withCenteredStory'; - import { DateTimePicker } from './DateTimePicker'; import mdx from './DateTimePicker.mdx'; @@ -18,7 +16,6 @@ minimumDate.setDate(minimumDate.getDate() - 7); const meta: Meta = { title: 'Pickers and Editors/TimePickers/DateTimePicker', - decorators: [withCenteredStory], component: DateTimePicker, argTypes: { date: { diff --git a/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx index d5b53fcf6ad..7ca9a2b8096 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.story.tsx @@ -3,14 +3,11 @@ import { useArgs } from '@storybook/client-api'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../../utils/storybook/withCenteredStory'; - import { RelativeTimeRangePicker } from './RelativeTimeRangePicker'; const meta: Meta = { title: 'Pickers and Editors/TimePickers/RelativeTimeRangePicker', component: RelativeTimeRangePicker, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onChange'], diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx index 0eafc949236..9a8acd9f519 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeOfDayPicker.story.tsx @@ -6,12 +6,9 @@ import React from 'react'; import { dateTime } from '@grafana/data'; import { TimeOfDayPicker } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - const meta: Meta = { title: 'Pickers and Editors/TimePickers/TimeOfDayPicker', component: TimeOfDayPicker, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onChange'], diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx index 84e06e1b27b..8f86b358b82 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.story.tsx @@ -6,8 +6,6 @@ import React from 'react'; import { dateTime, DefaultTimeZone, isDateTime, TimeRange } from '@grafana/data'; import { TimeRangeInput } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './TimeRangeInput.mdx'; const now = dateTime(Date.now()); @@ -35,7 +33,6 @@ const nullRange = { const meta: Meta = { title: 'Pickers and Editors/TimePickers/TimeRangeInput', component: TimeRangeInput, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onChange', 'onChangeTimeZone'], diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx index 969d73de866..9c859bd25d0 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.story.tsx @@ -6,15 +6,12 @@ import React from 'react'; import { dateTime, DefaultTimeZone } from '@grafana/data'; import { TimeRangePicker } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - const to = dateTime(); const from = to.subtract(6, 'h'); const meta: Meta = { title: 'Pickers and Editors/TimePickers/TimeRangePicker', component: TimeRangePicker, - decorators: [withCenteredStory], args: { value: { from, diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx index 162fcf18642..d68e196a45c 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx @@ -5,12 +5,9 @@ import React from 'react'; import { TimeZonePicker } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - const meta: Meta = { title: 'Pickers and Editors/TimePickers/TimeZonePicker', component: TimeZonePicker, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['inputId', 'onChange', 'onBlur'], diff --git a/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx index 0e0026ccf77..8ea94a82f81 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.story.tsx @@ -5,12 +5,9 @@ import React from 'react'; import { WeekStartPicker } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - const meta: Meta = { title: 'Pickers and Editors/TimePickers/WeekStartPicker', component: WeekStartPicker, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onBlur', 'onChange', 'inputId'], diff --git a/packages/grafana-ui/src/components/Divider/Divider.story.tsx b/packages/grafana-ui/src/components/Divider/Divider.story.tsx index 9a0ffcd10a5..e48091dabca 100644 --- a/packages/grafana-ui/src/components/Divider/Divider.story.tsx +++ b/packages/grafana-ui/src/components/Divider/Divider.story.tsx @@ -1,15 +1,12 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { Divider } from './Divider'; import mdx from './Divider.mdx'; const meta: Meta = { title: 'General/Divider', component: Divider, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Drawer/Drawer.story.tsx b/packages/grafana-ui/src/components/Drawer/Drawer.story.tsx index 8428c1bb758..fd93008889f 100644 --- a/packages/grafana-ui/src/components/Drawer/Drawer.story.tsx +++ b/packages/grafana-ui/src/components/Drawer/Drawer.story.tsx @@ -3,14 +3,11 @@ import React, { useState } from 'react'; import { Button, Drawer, Tab, TabsBar } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './Drawer.mdx'; const meta: Meta = { title: 'Overlays/Drawer', component: Drawer, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, @@ -147,11 +144,21 @@ export const WithTabs: StoryFn = (args) => { const tabs = ( - setActiveTab('options')} /> { + ev?.preventDefault(); + setActiveTab('options'); + }} + /> + setActiveTab('changes')} + onChangeTab={(ev) => { + ev?.preventDefault(); + setActiveTab('changes'); + }} counter={10} /> diff --git a/packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx b/packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx index 202e5b13d90..b6f6dc9284b 100644 --- a/packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx +++ b/packages/grafana-ui/src/components/Dropdown/ButtonSelect.internal.story.tsx @@ -3,14 +3,11 @@ import { useArgs } from '@storybook/client-api'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { ButtonSelect } from './ButtonSelect'; const meta: Meta = { title: 'Forms/Select/ButtonSelect', component: ButtonSelect, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['className', 'onChange', 'tooltipContent'], diff --git a/packages/grafana-ui/src/components/Dropdown/Dropdown.story.tsx b/packages/grafana-ui/src/components/Dropdown/Dropdown.story.tsx index 44f4794688f..d991195e5da 100644 --- a/packages/grafana-ui/src/components/Dropdown/Dropdown.story.tsx +++ b/packages/grafana-ui/src/components/Dropdown/Dropdown.story.tsx @@ -2,7 +2,6 @@ import { Meta } from '@storybook/react'; import React from 'react'; import { StoryExample } from '../../utils/storybook/StoryExample'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Button } from '../Button'; import { IconButton } from '../IconButton/IconButton'; import { VerticalGroup } from '../Layout/Layout'; @@ -14,7 +13,6 @@ import mdx from './Dropdown.mdx'; const meta: Meta = { title: 'Overlays/Dropdown', component: Dropdown, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx b/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx index e13e69be9dd..108592394b5 100644 --- a/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx +++ b/packages/grafana-ui/src/components/EmptySearchResult/EmptySearchResult.story.tsx @@ -1,15 +1,12 @@ import { Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '@grafana/ui/src/utils/storybook/withCenteredStory'; - import { EmptySearchResult } from './EmptySearchResult'; import mdx from './EmptySearchResult.mdx'; const meta: Meta = { title: 'Visualizations/EmptySearchResult', component: EmptySearchResult, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx b/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx index 3b8e2f70a35..8b20cffae36 100644 --- a/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx +++ b/packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.story.tsx @@ -1,8 +1,6 @@ import { Meta } from '@storybook/react'; import React, { useState } from 'react'; -import { withCenteredStory } from '@grafana/ui/src/utils/storybook/withCenteredStory'; - import { Alert } from '../Alert/Alert'; import { Button } from '../Button'; @@ -13,7 +11,6 @@ import { ErrorWithStack } from './ErrorWithStack'; const meta: Meta = { title: 'General/ErrorBoundary', component: ErrorBoundary, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx b/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx index 2616b517b18..644155da2a8 100644 --- a/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx +++ b/packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx @@ -3,14 +3,11 @@ import React from 'react'; import { FileDropzone } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './FileDropzone.mdx'; const meta: Meta = { title: 'Forms/FileDropzone', component: FileDropzone, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx b/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx index dbeb9959a40..f814ba942d6 100644 --- a/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx +++ b/packages/grafana-ui/src/components/FileDropzone/FileListItem.story.tsx @@ -1,15 +1,12 @@ import { Meta, Story } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { FileListItem as FileListItemComponent, FileListItemProps } from './FileListItem'; import mdx from './FileListItem.mdx'; const meta: Meta = { title: 'Forms/FileListItem', component: FileListItemComponent, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx b/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx index afb4435c067..40a8ad73b07 100644 --- a/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx +++ b/packages/grafana-ui/src/components/FileUpload/FileUpload.story.tsx @@ -3,14 +3,11 @@ import React from 'react'; import { FileUpload } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './FileUpload.mdx'; const meta: Meta = { title: 'Forms/FileUpload', component: FileUpload, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx b/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx index 85f672724ad..aba8951b91c 100644 --- a/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx +++ b/packages/grafana-ui/src/components/FilterPill/FilterPill.story.tsx @@ -1,8 +1,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React, { useState } from 'react'; -import { withCenteredStory } from '@grafana/ui/src/utils/storybook/withCenteredStory'; - import { getAvailableIcons } from '../../types'; import { HorizontalGroup } from '../Layout/Layout'; @@ -12,7 +10,6 @@ import mdx from './FilterPill.mdx'; const meta: Meta = { title: 'General/FilterPill', component: FilterPill, - decorators: [withCenteredStory], argTypes: { icon: { control: { type: 'select', options: getAvailableIcons() } }, onClick: { action: 'Pill Clicked' }, diff --git a/packages/grafana-ui/src/components/Flex/Flex.internal.story.tsx b/packages/grafana-ui/src/components/Flex/Flex.internal.story.tsx index 2e933ced959..cad3c1bc4a5 100644 --- a/packages/grafana-ui/src/components/Flex/Flex.internal.story.tsx +++ b/packages/grafana-ui/src/components/Flex/Flex.internal.story.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { ThemeSpacingTokens } from '@grafana/data'; import { useTheme2 } from '../../themes'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Flex, JustifyContent, Wrap, Direction } from './Flex'; import mdx from './Flex.mdx'; @@ -29,7 +28,6 @@ const Item = ({ color, text, height }: { color: string; text?: string | number; const meta: Meta = { title: 'General/Layout/Flex', component: Flex, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx b/packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx index dccae770bb0..df7bd6c1bfb 100644 --- a/packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx +++ b/packages/grafana-ui/src/components/FormField/FormField.internal.story.tsx @@ -1,14 +1,11 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { FormField } from './FormField'; const meta: Meta = { title: 'Forms/Legacy/FormField', component: FormField, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['inputEl'], diff --git a/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx b/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx index 9a86702d3bf..60f322cc4da 100644 --- a/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx +++ b/packages/grafana-ui/src/components/FormattedValueDisplay/FormattedValueDisplay.story.tsx @@ -1,15 +1,12 @@ import { Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '@grafana/ui/src/utils/storybook/withCenteredStory'; - import { FormattedValueDisplay } from './FormattedValueDisplay'; import mdx from './FormattedValueDisplay.mdx'; const meta: Meta = { title: 'Visualizations/FormattedValueDisplay', component: FormattedValueDisplay, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Forms/FieldArray.story.tsx b/packages/grafana-ui/src/components/Forms/FieldArray.story.tsx index 1ca5cca9282..3a5f134d76b 100644 --- a/packages/grafana-ui/src/components/Forms/FieldArray.story.tsx +++ b/packages/grafana-ui/src/components/Forms/FieldArray.story.tsx @@ -4,7 +4,6 @@ import { FieldValues } from 'react-hook-form'; import { Form, Input, Button, HorizontalGroup } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { withStoryContainer } from '../../utils/storybook/withStoryContainer'; import { FieldArray } from './FieldArray'; @@ -13,7 +12,7 @@ import mdx from './FieldArray.mdx'; export default { title: 'Forms/FieldArray', component: FieldArray, - decorators: [withStoryContainer, withCenteredStory], + decorators: [withStoryContainer], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Forms/FieldSet.story.tsx b/packages/grafana-ui/src/components/Forms/FieldSet.story.tsx index 49299255858..716b4206d3c 100644 --- a/packages/grafana-ui/src/components/Forms/FieldSet.story.tsx +++ b/packages/grafana-ui/src/components/Forms/FieldSet.story.tsx @@ -3,7 +3,6 @@ import React from 'react'; import { Input, Form, FieldSet, Field } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Button } from '../Button'; import { Props } from './FieldSet'; @@ -12,7 +11,6 @@ import mdx from './FieldSet.mdx'; const meta: Meta = { title: 'Forms/FieldSet', component: FieldSet, - decorators: [withCenteredStory], args: { label: 'Default label', }, diff --git a/packages/grafana-ui/src/components/Forms/Form.story.tsx b/packages/grafana-ui/src/components/Forms/Form.story.tsx index 7e8e4172f6b..4ca3814521f 100644 --- a/packages/grafana-ui/src/components/Forms/Form.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Form.story.tsx @@ -16,14 +16,13 @@ import { RadioButtonGroup, } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { withStoryContainer } from '../../utils/storybook/withStoryContainer'; import mdx from './Form.mdx'; export default { title: 'Forms/Form', - decorators: [withStoryContainer, withCenteredStory], + decorators: [withStoryContainer], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx b/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx index 7949bfff55c..822bcf25a9d 100644 --- a/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Legacy/Input/Input.internal.story.tsx @@ -3,14 +3,12 @@ import { zip, fromPairs } from 'lodash'; import React, { useState } from 'react'; import { EventsWithValidation } from '../../../../utils'; -import { withCenteredStory } from '../../../../utils/storybook/withCenteredStory'; import { Input } from './Input'; const meta: Meta = { title: 'Forms/Legacy/Input', component: Input, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['inputRef', 'onBlur', 'onFocus', 'onChange'], diff --git a/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx b/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx index d198b8ad906..93be7bb5855 100644 --- a/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Legacy/Select/Select.internal.story.tsx @@ -5,14 +5,11 @@ import React, { useCallback } from 'react'; import { SelectableValue } from '@grafana/data'; -import { withCenteredStory } from '../../../../utils/storybook/withCenteredStory'; - import { Select, AsyncSelect as AsyncSelectComponent } from './Select'; const meta: Meta = { title: 'Forms/Legacy/Select', component: Select, - decorators: [withCenteredStory], parameters: { controls: { exclude: [ diff --git a/packages/grafana-ui/src/components/Graph/GraphWithLegend.internal.story.tsx b/packages/grafana-ui/src/components/Graph/GraphWithLegend.internal.story.tsx index 2e90760a9b2..0830b44f198 100644 --- a/packages/grafana-ui/src/components/Graph/GraphWithLegend.internal.story.tsx +++ b/packages/grafana-ui/src/components/Graph/GraphWithLegend.internal.story.tsx @@ -4,14 +4,11 @@ import React from 'react'; import { GraphSeriesXY, FieldType, dateTime, FieldColorModeId } from '@grafana/data'; import { LegendDisplayMode } from '@grafana/schema'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { GraphWithLegend, GraphWithLegendProps } from './GraphWithLegend'; export default { title: 'Visualizations/Graph/GraphWithLegend', component: GraphWithLegend, - decorator: [withCenteredStory], parameters: { controls: { exclude: ['className', 'ariaLabel', 'legendDisplayMode', 'series'], diff --git a/packages/grafana-ui/src/components/Icon/Icon.story.tsx b/packages/grafana-ui/src/components/Icon/Icon.story.tsx index 89adde740cd..67647a2336f 100644 --- a/packages/grafana-ui/src/components/Icon/Icon.story.tsx +++ b/packages/grafana-ui/src/components/Icon/Icon.story.tsx @@ -7,14 +7,12 @@ import { Input, Field, Icon } from '@grafana/ui'; import { useTheme2 } from '../../themes'; import { getAvailableIcons } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Icon.mdx'; const meta: Meta = { title: 'Docs overview/Icon', component: Icon, - decorators: [withCenteredStory], parameters: { options: { showPanel: false, diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx b/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx index 7dfd3a1f78b..db562ecb73b 100644 --- a/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx +++ b/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { useTheme2 } from '../../themes'; import { IconSize, IconName } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { HorizontalGroup, VerticalGroup } from '../Layout/Layout'; import { BasePropsWithTooltip, IconButton, IconButtonVariant, Props as IconButtonProps } from './IconButton'; @@ -20,7 +19,6 @@ const additionalExcludes = ['size', 'name', 'variant', 'iconType']; const meta: Meta = { title: 'Buttons/IconButton', component: IconButton, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.internal.story.tsx b/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.internal.story.tsx index 2cee39dbdcb..6d7219f6c3e 100644 --- a/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.internal.story.tsx +++ b/packages/grafana-ui/src/components/InfoTooltip/InfoTooltip.internal.story.tsx @@ -1,14 +1,11 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { InfoTooltip } from './InfoTooltip'; const meta: Meta = { title: 'Overlays/TooltipInternal', component: InfoTooltip, - decorators: [withCenteredStory], }; export const basic: StoryFn = () => This is the content of the tooltip; diff --git a/packages/grafana-ui/src/components/InlineToast/InlineToast.internal.story.tsx b/packages/grafana-ui/src/components/InlineToast/InlineToast.internal.story.tsx index 5e7284e4e1d..810cb65e070 100644 --- a/packages/grafana-ui/src/components/InlineToast/InlineToast.internal.story.tsx +++ b/packages/grafana-ui/src/components/InlineToast/InlineToast.internal.story.tsx @@ -1,7 +1,6 @@ import { Meta, Story } from '@storybook/react'; import React, { useState } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { ClipboardButton } from '../ClipboardButton/ClipboardButton'; import { Input } from '../Input/Input'; @@ -11,7 +10,6 @@ import mdx from './InlineToast.mdx'; const story: Meta = { title: 'InlineToast', component: InlineToastImpl, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Input/AutoSizeInput.story.tsx b/packages/grafana-ui/src/components/Input/AutoSizeInput.story.tsx index b7e646df2c3..9dfd9e68165 100644 --- a/packages/grafana-ui/src/components/Input/AutoSizeInput.story.tsx +++ b/packages/grafana-ui/src/components/Input/AutoSizeInput.story.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { Button, AutoSizeInput } from '@grafana/ui'; import { iconOptions } from '../../utils/storybook/icons'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './AutoSizeInput.mdx'; import { parseAccessory } from './storyUtils'; @@ -22,7 +21,6 @@ const prefixSuffixOpts = { const meta: Meta = { title: 'Forms/Input/AutoSizeInput', component: AutoSizeInput, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Input/Input.story.tsx b/packages/grafana-ui/src/components/Input/Input.story.tsx index f9c2eaa282d..890e6dd28d7 100644 --- a/packages/grafana-ui/src/components/Input/Input.story.tsx +++ b/packages/grafana-ui/src/components/Input/Input.story.tsx @@ -5,7 +5,6 @@ import { KeyValue } from '@grafana/data'; import { Field, Button, Input } from '@grafana/ui'; import { getAvailableIcons } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Input.mdx'; import { parseAccessory } from './storyUtils'; @@ -24,7 +23,6 @@ const prefixSuffixOpts = { const meta: Meta = { title: 'Forms/Input', component: Input, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/InteractiveTable/InteractiveTable.story.tsx b/packages/grafana-ui/src/components/InteractiveTable/InteractiveTable.story.tsx index 7911b18e520..49d814f7a01 100644 --- a/packages/grafana-ui/src/components/InteractiveTable/InteractiveTable.story.tsx +++ b/packages/grafana-ui/src/components/InteractiveTable/InteractiveTable.story.tsx @@ -3,8 +3,6 @@ import React, { useMemo } from 'react'; import { InteractiveTable, Column, CellProps, LinkButton } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { InteractiveTableHeaderTooltip } from './InteractiveTable'; import mdx from './InteractiveTable.mdx'; @@ -13,7 +11,6 @@ const EXCLUDED_PROPS = ['className', 'renderExpandedRow', 'getRowId']; const meta: Meta = { title: 'Experimental/InteractiveTable', component: InteractiveTable, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Layout/Layout.story.tsx b/packages/grafana-ui/src/components/Layout/Layout.story.tsx index 4b4e235f410..52d87e40964 100644 --- a/packages/grafana-ui/src/components/Layout/Layout.story.tsx +++ b/packages/grafana-ui/src/components/Layout/Layout.story.tsx @@ -3,7 +3,6 @@ import React from 'react'; import { Button, VerticalGroup, HorizontalGroup } from '@grafana/ui'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import { withStoryContainer } from '../../utils/storybook/withStoryContainer'; import { Layout, LayoutProps } from './Layout'; @@ -12,7 +11,7 @@ import mdx from './Layout.mdx'; export default { title: 'Layout/Groups', component: Layout, - decorators: [withStoryContainer, withCenteredStory, withHorizontallyCenteredStory], + decorators: [withStoryContainer], // SB7 has broken subcomponent types due to dropping support for the feature // https://github.com/storybookjs/storybook/issues/20782 // @ts-ignore diff --git a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx index 876aa57f7e0..56a850d709e 100644 --- a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx +++ b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx @@ -6,14 +6,12 @@ import { GrafanaTheme2 } from '@grafana/data'; import { LoadingBar, LoadingBarProps, useStyles2 } from '@grafana/ui'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './LoadingBar.mdx'; const meta: Meta = { title: 'General/LoadingBar', component: LoadingBar, - decorators: [withCenteredStory], parameters: { controls: {}, docs: { diff --git a/packages/grafana-ui/src/components/LoadingPlaceholder/LoadingPlaceholder.story.tsx b/packages/grafana-ui/src/components/LoadingPlaceholder/LoadingPlaceholder.story.tsx index 494e0fd1cc7..61126ffa12d 100644 --- a/packages/grafana-ui/src/components/LoadingPlaceholder/LoadingPlaceholder.story.tsx +++ b/packages/grafana-ui/src/components/LoadingPlaceholder/LoadingPlaceholder.story.tsx @@ -1,15 +1,12 @@ import { StoryFn, Meta } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { LoadingPlaceholder, LoadingPlaceholderProps } from './LoadingPlaceholder'; import mdx from './LoadingPlaceholder.mdx'; const meta: Meta = { title: 'General/LoadingPlaceholder', component: LoadingPlaceholder, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Modal/Modal.story.tsx b/packages/grafana-ui/src/components/Modal/Modal.story.tsx index 7dd81784b3a..6eb6d7eed51 100644 --- a/packages/grafana-ui/src/components/Modal/Modal.story.tsx +++ b/packages/grafana-ui/src/components/Modal/Modal.story.tsx @@ -6,14 +6,12 @@ import React, { useState } from 'react'; import { Button, Modal, ModalTabsHeader, TabContent } from '@grafana/ui'; import { getAvailableIcons } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Modal.mdx'; const meta: Meta = { title: 'Overlays/Modal', component: Modal, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Monaco/CodeEditor.internal.story.tsx b/packages/grafana-ui/src/components/Monaco/CodeEditor.internal.story.tsx index ed2e9568919..f1ae3fce9e7 100644 --- a/packages/grafana-ui/src/components/Monaco/CodeEditor.internal.story.tsx +++ b/packages/grafana-ui/src/components/Monaco/CodeEditor.internal.story.tsx @@ -2,15 +2,12 @@ import { action } from '@storybook/addon-actions'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { CodeEditor } from './CodeEditor'; import mdx from './CodeEditor.mdx'; const meta: Meta = { title: 'CodeEditor', component: CodeEditor, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/PageLayout/PageToolbar.story.tsx b/packages/grafana-ui/src/components/PageLayout/PageToolbar.story.tsx index 5e767d1ae91..0c736075d53 100644 --- a/packages/grafana-ui/src/components/PageLayout/PageToolbar.story.tsx +++ b/packages/grafana-ui/src/components/PageLayout/PageToolbar.story.tsx @@ -5,7 +5,6 @@ import React from 'react'; import { ToolbarButton, VerticalGroup } from '@grafana/ui'; import { StoryExample } from '../../utils/storybook/StoryExample'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { IconButton } from '../IconButton/IconButton'; import { PageToolbar } from './PageToolbar'; @@ -13,7 +12,6 @@ import { PageToolbar } from './PageToolbar'; const meta: Meta = { title: 'Layout/PageToolbar', component: PageToolbar, - decorators: [withCenteredStory], parameters: {}, }; diff --git a/packages/grafana-ui/src/components/Pagination/Pagination.story.tsx b/packages/grafana-ui/src/components/Pagination/Pagination.story.tsx index 31901ee4825..4164c069807 100644 --- a/packages/grafana-ui/src/components/Pagination/Pagination.story.tsx +++ b/packages/grafana-ui/src/components/Pagination/Pagination.story.tsx @@ -3,14 +3,11 @@ import React, { useState } from 'react'; import { Pagination } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './Pagination.mdx'; const meta: Meta = { title: 'Buttons/Pagination', component: Pagination, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx index a92fb4a676e..2b35367de8a 100644 --- a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx +++ b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.story.tsx @@ -8,7 +8,6 @@ import { LoadingState } from '@grafana/data'; import { Button, Icon, PanelChrome, PanelChromeProps, RadioButtonGroup } from '@grafana/ui'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { HorizontalGroup } from '../Layout/Layout'; import { Menu } from '../Menu/Menu'; @@ -20,7 +19,6 @@ const PANEL_HEIGHT = 150; const meta: Meta = { title: 'Visualizations/PanelChrome', component: PanelChrome, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['children'], diff --git a/packages/grafana-ui/src/components/PanelContainer/PanelContainer.story.tsx b/packages/grafana-ui/src/components/PanelContainer/PanelContainer.story.tsx index 82186e658cb..ed26a020a71 100644 --- a/packages/grafana-ui/src/components/PanelContainer/PanelContainer.story.tsx +++ b/packages/grafana-ui/src/components/PanelContainer/PanelContainer.story.tsx @@ -1,15 +1,12 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { PanelContainer } from './PanelContainer'; import mdx from './PanelContainer.mdx'; const meta: Meta = { title: 'General/PanelContainer', component: PanelContainer, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/PluginSignatureBadge/PluginSignatureBadge.story.tsx b/packages/grafana-ui/src/components/PluginSignatureBadge/PluginSignatureBadge.story.tsx index 05adea07ec7..075c5b1ff86 100644 --- a/packages/grafana-ui/src/components/PluginSignatureBadge/PluginSignatureBadge.story.tsx +++ b/packages/grafana-ui/src/components/PluginSignatureBadge/PluginSignatureBadge.story.tsx @@ -4,13 +4,10 @@ import React from 'react'; import { PluginSignatureStatus } from '@grafana/data'; import { PluginSignatureBadge } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './PluginSignatureBadge.mdx'; const meta: Meta = { title: 'Data Display/PluginSignatureBadge', - decorators: [withCenteredStory], component: PluginSignatureBadge, argTypes: { status: { diff --git a/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx b/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx index 93f52c02576..79923177a2a 100644 --- a/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx +++ b/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx @@ -2,14 +2,12 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { TypeaheadInput } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { QueryField, QueryFieldProps } from './QueryField'; const meta: Meta = { title: 'Data Source/QueryField', component: QueryField, - decorators: [withCenteredStory], parameters: { controls: { exclude: [ diff --git a/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.story.tsx b/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.story.tsx index fbe0b7ea697..036f6f5c4fb 100644 --- a/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.story.tsx +++ b/packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.story.tsx @@ -5,14 +5,11 @@ import React from 'react'; import { RefreshPicker } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './RefreshPicker.mdx'; const meta: Meta = { title: 'Pickers and Editors/RefreshPicker', component: RefreshPicker, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/SecretFormField/SecretFormField.internal.story.tsx b/packages/grafana-ui/src/components/SecretFormField/SecretFormField.internal.story.tsx index 7b4aa1a8806..dd0a5c6b089 100644 --- a/packages/grafana-ui/src/components/SecretFormField/SecretFormField.internal.story.tsx +++ b/packages/grafana-ui/src/components/SecretFormField/SecretFormField.internal.story.tsx @@ -3,14 +3,11 @@ import { useArgs } from '@storybook/client-api'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { SecretFormField } from './SecretFormField'; const meta: Meta = { title: 'Forms/SecretFormField', component: SecretFormField, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onChange', 'onReset'], diff --git a/packages/grafana-ui/src/components/SecretInput/SecretInput.story.tsx b/packages/grafana-ui/src/components/SecretInput/SecretInput.story.tsx index c50e5fd2d21..d83b007a1f8 100644 --- a/packages/grafana-ui/src/components/SecretInput/SecretInput.story.tsx +++ b/packages/grafana-ui/src/components/SecretInput/SecretInput.story.tsx @@ -1,15 +1,12 @@ import { StoryFn, Meta } from '@storybook/react'; import React, { useState, ChangeEvent } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { SecretInput } from './SecretInput'; import mdx from './SecretInput.mdx'; const meta: Meta = { title: 'Forms/SecretInput', component: SecretInput, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.story.tsx b/packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.story.tsx index c43bf0cc0d5..f48f09c3f2f 100644 --- a/packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.story.tsx +++ b/packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.story.tsx @@ -1,14 +1,11 @@ import { StoryFn, Meta } from '@storybook/react'; import React, { useState, ChangeEvent } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { SecretTextArea } from './SecretTextArea'; const meta: Meta = { title: 'Forms/SecretTextArea', component: SecretTextArea, - decorators: [withCenteredStory], parameters: { controls: { exclude: [ diff --git a/packages/grafana-ui/src/components/Select/Select.story.tsx b/packages/grafana-ui/src/components/Select/Select.story.tsx index 39e1eedba7f..2c8751b54ee 100644 --- a/packages/grafana-ui/src/components/Select/Select.story.tsx +++ b/packages/grafana-ui/src/components/Select/Select.story.tsx @@ -7,7 +7,6 @@ import { SelectableValue, toIconName } from '@grafana/data'; import { Icon, Select, AsyncSelect, MultiSelect, AsyncMultiSelect } from '@grafana/ui'; import { getAvailableIcons } from '../../types'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Select.mdx'; import { generateOptions, generateThousandsOfOptions } from './mockOptions'; @@ -16,7 +15,6 @@ import { SelectCommonProps } from './types'; const meta: Meta = { title: 'Forms/Select', component: Select, - decorators: [withCenteredStory, withHorizontallyCenteredStory], // SB7 has broken subcomponent types due to dropping support for the feature // https://github.com/storybookjs/storybook/issues/20782 // @ts-ignore diff --git a/packages/grafana-ui/src/components/Select/SelectPerf.internal.story.tsx b/packages/grafana-ui/src/components/Select/SelectPerf.internal.story.tsx index 10ae0a65769..93f20cdfe1c 100644 --- a/packages/grafana-ui/src/components/Select/SelectPerf.internal.story.tsx +++ b/packages/grafana-ui/src/components/Select/SelectPerf.internal.story.tsx @@ -4,14 +4,12 @@ import ReactSelect, { createFilter } from 'react-select'; import { SelectableValue } from '@grafana/data'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Label } from '../Forms/Label'; import { Select, VirtualizedSelect } from './Select'; const meta: Meta = { title: 'Forms/Select (Perf)', - decorators: [withCenteredStory, withHorizontallyCenteredStory], argTypes: { numberOfOptions: { defaultValue: 10_000, diff --git a/packages/grafana-ui/src/components/Spinner/Spinner.story.tsx b/packages/grafana-ui/src/components/Spinner/Spinner.story.tsx index 28966966036..31bc76c83a8 100644 --- a/packages/grafana-ui/src/components/Spinner/Spinner.story.tsx +++ b/packages/grafana-ui/src/components/Spinner/Spinner.story.tsx @@ -3,15 +3,12 @@ import React from 'react'; import { Spinner } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { Props } from './Spinner'; import mdx from './Spinner.mdx'; const meta: Meta = { title: 'Visualizations/Spinner', component: Spinner, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Stack/Stack.internal.story.tsx b/packages/grafana-ui/src/components/Stack/Stack.internal.story.tsx index 820aeed700d..44b564062e4 100644 --- a/packages/grafana-ui/src/components/Stack/Stack.internal.story.tsx +++ b/packages/grafana-ui/src/components/Stack/Stack.internal.story.tsx @@ -1,15 +1,12 @@ import { Meta, StoryFn } from '@storybook/react'; import React, { ReactNode } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { Stack } from './Stack'; import mdx from './Stack.mdx'; const meta: Meta = { title: 'General/Layout/Stack', component: Stack, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx b/packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx index ab9818be19b..149afab4640 100644 --- a/packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx +++ b/packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx @@ -4,8 +4,6 @@ import React, { PureComponent } from 'react'; import { StatsPicker } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - interface State { stats: string[]; } @@ -56,7 +54,6 @@ class WrapperWithState extends PureComponent { const meta: Meta = { title: 'Pickers and Editors/StatsPicker', component: StatsPicker, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onChange', 'stats', 'defaultStat', 'className'], diff --git a/packages/grafana-ui/src/components/Switch/Switch.story.tsx b/packages/grafana-ui/src/components/Switch/Switch.story.tsx index 3ab56b2e9d2..ee78fefe4ae 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.story.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.story.tsx @@ -3,7 +3,6 @@ import React, { useState, useCallback } from 'react'; import { InlineField, Switch, InlineSwitch } from '@grafana/ui'; -import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Field } from '../Forms/Field'; import { InlineFieldRow } from '../Forms/InlineFieldRow'; @@ -12,7 +11,6 @@ import mdx from './Switch.mdx'; const meta: Meta = { title: 'Forms/Switch', component: Switch, - decorators: [withCenteredStory, withHorizontallyCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Table/Table.story.tsx b/packages/grafana-ui/src/components/Table/Table.story.tsx index 42861538bfa..596e5baa134 100644 --- a/packages/grafana-ui/src/components/Table/Table.story.tsx +++ b/packages/grafana-ui/src/components/Table/Table.story.tsx @@ -18,7 +18,6 @@ import { Button, Table } from '@grafana/ui'; import { useTheme2 } from '../../themes'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; import { prepDataForStorybook } from '../../utils/storybook/data'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Table.mdx'; import { FooterItem, TableCellDisplayMode, TableCustomCellOptions } from './types'; @@ -26,7 +25,6 @@ import { FooterItem, TableCellDisplayMode, TableCustomCellOptions } from './type const meta: Meta = { title: 'Visualizations/Table', component: Table, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onColumnResize', 'onSortByChange', 'onCellFilterAdded', 'ariaLabel', 'data', 'initialSortBy'], diff --git a/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.internal.story.tsx b/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.internal.story.tsx index 6165a333fc5..f2fe55ed5d6 100644 --- a/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.internal.story.tsx +++ b/packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.internal.story.tsx @@ -4,14 +4,11 @@ import React from 'react'; import { DataFrame } from '@grafana/data'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { TableInputCSV } from './TableInputCSV'; const meta: Meta = { title: 'Forms/TableInputCSV', component: TableInputCSV, - decorators: [withCenteredStory], }; export const basic: StoryFn = () => { diff --git a/packages/grafana-ui/src/components/Tabs/Tabs.story.tsx b/packages/grafana-ui/src/components/Tabs/Tabs.story.tsx index 0f245028228..6952d3b3164 100644 --- a/packages/grafana-ui/src/components/Tabs/Tabs.story.tsx +++ b/packages/grafana-ui/src/components/Tabs/Tabs.story.tsx @@ -4,14 +4,12 @@ import React, { useState } from 'react'; import { TabsBar, Tab, TabContent, Counter as TabCounter } from '@grafana/ui'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { CounterProps } from './Counter'; import mdx from './TabsBar.mdx'; const meta: Meta = { title: 'Layout/Tabs', - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Tags/Tag.story.tsx b/packages/grafana-ui/src/components/Tags/Tag.story.tsx index 814109e24ba..47d74a6b831 100644 --- a/packages/grafana-ui/src/components/Tags/Tag.story.tsx +++ b/packages/grafana-ui/src/components/Tags/Tag.story.tsx @@ -2,15 +2,12 @@ import { action } from '@storybook/addon-actions'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { Tag } from './Tag'; import mdx from './Tag.mdx'; const meta: Meta = { title: 'Forms/Tags/Tag', component: Tag, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Tags/TagList.story.tsx b/packages/grafana-ui/src/components/Tags/TagList.story.tsx index 9eea65f6003..6178d8a6bbd 100644 --- a/packages/grafana-ui/src/components/Tags/TagList.story.tsx +++ b/packages/grafana-ui/src/components/Tags/TagList.story.tsx @@ -2,15 +2,12 @@ import { action } from '@storybook/addon-actions'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { TagList } from './TagList'; import mdx from './TagList.mdx'; const meta: Meta = { title: 'Forms/Tags/TagList', component: TagList, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/TagsInput/TagsInput.story.tsx b/packages/grafana-ui/src/components/TagsInput/TagsInput.story.tsx index 2e11d7eb648..b30cc06ed17 100644 --- a/packages/grafana-ui/src/components/TagsInput/TagsInput.story.tsx +++ b/packages/grafana-ui/src/components/TagsInput/TagsInput.story.tsx @@ -2,7 +2,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React, { useState } from 'react'; import { StoryExample } from '../../utils/storybook/StoryExample'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { VerticalGroup } from '../Layout/Layout'; import { TagsInput } from './TagsInput'; @@ -11,7 +10,6 @@ import mdx from './TagsInput.mdx'; const meta: Meta = { title: 'Forms/TagsInput', component: TagsInput, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/TextArea/TextArea.story.tsx b/packages/grafana-ui/src/components/TextArea/TextArea.story.tsx index 5016007a631..aaf90791668 100644 --- a/packages/grafana-ui/src/components/TextArea/TextArea.story.tsx +++ b/packages/grafana-ui/src/components/TextArea/TextArea.story.tsx @@ -3,14 +3,11 @@ import React from 'react'; import { TextArea } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import mdx from './TextArea.mdx'; const meta: Meta = { title: 'Forms/TextArea', component: TextArea, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['cols'], diff --git a/packages/grafana-ui/src/components/Toggletip/Toggletip.story.tsx b/packages/grafana-ui/src/components/Toggletip/Toggletip.story.tsx index 2f52a986975..406a8594fed 100644 --- a/packages/grafana-ui/src/components/Toggletip/Toggletip.story.tsx +++ b/packages/grafana-ui/src/components/Toggletip/Toggletip.story.tsx @@ -1,7 +1,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Button } from '../Button'; import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar'; import mdx from '../Toggletip/Toggletip.mdx'; @@ -11,7 +10,6 @@ import { Toggletip } from './Toggletip'; const meta: Meta = { title: 'Overlays/Toggletip', component: Toggletip, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ToolbarButton/ToolbarButton.story.tsx b/packages/grafana-ui/src/components/ToolbarButton/ToolbarButton.story.tsx index 7319dec030c..5710a680fc1 100644 --- a/packages/grafana-ui/src/components/ToolbarButton/ToolbarButton.story.tsx +++ b/packages/grafana-ui/src/components/ToolbarButton/ToolbarButton.story.tsx @@ -2,7 +2,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { ButtonGroup } from '../Button'; import { HorizontalGroup, VerticalGroup } from '../Layout/Layout'; @@ -13,7 +12,6 @@ import { ToolbarButtonRow } from './ToolbarButtonRow'; const meta: Meta = { title: 'Buttons/ToolbarButton', component: ToolbarButton, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/ToolbarButton/ToolbarButtonRow.story.tsx b/packages/grafana-ui/src/components/ToolbarButton/ToolbarButtonRow.story.tsx index ba7a60ff47f..df044b01c14 100644 --- a/packages/grafana-ui/src/components/ToolbarButton/ToolbarButtonRow.story.tsx +++ b/packages/grafana-ui/src/components/ToolbarButton/ToolbarButtonRow.story.tsx @@ -2,7 +2,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { DashboardStoryCanvas } from '../../utils/storybook/DashboardStoryCanvas'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { ToolbarButton } from './ToolbarButton'; import { ToolbarButtonRow } from './ToolbarButtonRow'; @@ -11,7 +10,6 @@ import mdx from './ToolbarButtonRow.mdx'; const meta: Meta = { title: 'Buttons/ToolbarButton/ToolbarButtonRow', component: ToolbarButtonRow, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/Tooltip/Tooltip.story.tsx b/packages/grafana-ui/src/components/Tooltip/Tooltip.story.tsx index 46f9de239b1..67ed60768ad 100644 --- a/packages/grafana-ui/src/components/Tooltip/Tooltip.story.tsx +++ b/packages/grafana-ui/src/components/Tooltip/Tooltip.story.tsx @@ -1,7 +1,6 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { Button } from '../Button'; import mdx from '../Tooltip/Tooltip.mdx'; @@ -10,7 +9,6 @@ import { Tooltip } from './Tooltip'; const meta: Meta = { title: 'Overlays/Tooltip', component: Tooltip, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/UnitPicker/UnitPicker.story.tsx b/packages/grafana-ui/src/components/UnitPicker/UnitPicker.story.tsx index 0d6885bd241..fdc6f406970 100644 --- a/packages/grafana-ui/src/components/UnitPicker/UnitPicker.story.tsx +++ b/packages/grafana-ui/src/components/UnitPicker/UnitPicker.story.tsx @@ -2,15 +2,12 @@ import { action } from '@storybook/addon-actions'; import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { UnitPicker, UnitPickerProps } from './UnitPicker'; import mdx from './UnitPicker.mdx'; const meta: Meta = { title: 'Pickers and Editors/UnitPicker', component: UnitPicker, - decorators: [withCenteredStory], parameters: { controls: { exclude: ['onChange', 'value'], diff --git a/packages/grafana-ui/src/components/ValuePicker/ValuePicker.story.tsx b/packages/grafana-ui/src/components/ValuePicker/ValuePicker.story.tsx index e2e33760e6c..06f0ac554bf 100644 --- a/packages/grafana-ui/src/components/ValuePicker/ValuePicker.story.tsx +++ b/packages/grafana-ui/src/components/ValuePicker/ValuePicker.story.tsx @@ -4,7 +4,6 @@ import React from 'react'; import { ValuePicker } from '@grafana/ui'; import { getAvailableIcons } from '../../types'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { generateOptions } from '../Select/mockOptions'; import mdx from './ValuePicker.mdx'; @@ -12,7 +11,6 @@ import mdx from './ValuePicker.mdx'; const meta: Meta = { title: 'Pickers and Editors/ValuePicker', component: ValuePicker, - decorators: [withCenteredStory], parameters: { docs: { page: mdx, diff --git a/packages/grafana-ui/src/components/VizLayout/VizLayout.story.tsx b/packages/grafana-ui/src/components/VizLayout/VizLayout.story.tsx index ae2bb392378..86ebf43ae56 100644 --- a/packages/grafana-ui/src/components/VizLayout/VizLayout.story.tsx +++ b/packages/grafana-ui/src/components/VizLayout/VizLayout.story.tsx @@ -1,14 +1,11 @@ import { Meta, Story } from '@storybook/react'; import React, { useEffect, useState } from 'react'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { VizLayout } from './VizLayout'; const meta: Meta = { title: 'Visualizations/VizLayout', component: VizLayout, - decorators: [withCenteredStory], parameters: { docs: {}, controls: { diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegend.story.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegend.story.tsx index 230027dc11e..60e0b9c166c 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegend.story.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegend.story.tsx @@ -5,14 +5,11 @@ import { DisplayValue, GrafanaTheme2 } from '@grafana/data'; import { LegendDisplayMode, LegendPlacement } from '@grafana/schema'; import { useTheme2, VizLegend } from '@grafana/ui'; -import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; - import { VizLegendItem } from './types'; const meta: Meta = { title: 'Visualizations/VizLegend', component: VizLegend, - decorators: [withCenteredStory], args: { containerWidth: '100%', seriesCount: 5, diff --git a/packages/grafana-ui/src/utils/storybook/withCenteredStory.tsx b/packages/grafana-ui/src/utils/storybook/withCenteredStory.tsx deleted file mode 100644 index bb8a5b5ce18..00000000000 --- a/packages/grafana-ui/src/utils/storybook/withCenteredStory.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { DecoratorFn } from '@storybook/react'; - -/** @deprecated Stories should not be centered on the page. This decorator now does nothing */ -export const withNotCenteredStory: DecoratorFn = (story) => story(); - -/** @deprecated Stories should not be centered on the page. This decorator now does nothing */ -export const withCenteredStory: DecoratorFn = (story) => story(); - -/** @deprecated Stories should not be centered on the page. This decorator now does nothing */ -export const withHorizontallyCenteredStory: DecoratorFn = (story) => story(); - -/** @deprecated Stories should not be centered on the page. This decorator now does nothing */ -export const withVerticallyCenteredStory: DecoratorFn = (story) => story(); diff --git a/packages/grafana-ui/src/utils/useDelayedSwitch.internal.story.tsx b/packages/grafana-ui/src/utils/useDelayedSwitch.internal.story.tsx index df5204f74b7..0d356cb2cbf 100644 --- a/packages/grafana-ui/src/utils/useDelayedSwitch.internal.story.tsx +++ b/packages/grafana-ui/src/utils/useDelayedSwitch.internal.story.tsx @@ -1,12 +1,10 @@ import { Story } from '@storybook/react'; import React from 'react'; -import { withCenteredStory } from './storybook/withCenteredStory'; import { useDelayedSwitch } from './useDelayedSwitch'; export default { title: 'useDelayedSwitch', - decorators: [withCenteredStory], }; export const Basic: Story = ({ value, delay, duration }) => {