diff --git a/packages/grafana-ui/src/components/Forms/Form.story.tsx b/packages/grafana-ui/src/components/Forms/Form.story.tsx index 3145308f490..b6d8749e875 100644 --- a/packages/grafana-ui/src/components/Forms/Form.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Form.story.tsx @@ -16,7 +16,7 @@ import Forms from './index'; import mdx from './Form.mdx'; import { ValidateResult } from 'react-hook-form'; import { boolean } from '@storybook/addon-knobs'; -import { TextArea } from './TextArea/TextArea'; +import { TextArea } from '../TextArea/TextArea'; export default { title: 'Forms/Example forms', diff --git a/packages/grafana-ui/src/components/Forms/index.ts b/packages/grafana-ui/src/components/Forms/index.ts index 418a562387a..898e31c40c6 100644 --- a/packages/grafana-ui/src/components/Forms/index.ts +++ b/packages/grafana-ui/src/components/Forms/index.ts @@ -5,8 +5,8 @@ import { RadioButtonGroup } from './RadioButtonGroup/RadioButtonGroup'; import { Form } from './Form'; import { Field } from './Field'; import { Legend } from './Legend'; -import { TextArea } from './TextArea/TextArea'; import { Checkbox } from './Checkbox'; +import { TextArea } from '../TextArea/TextArea'; const Forms = { RadioButtonGroup, @@ -15,9 +15,9 @@ const Forms = { Form, Field, InputControl, - TextArea, Checkbox, Legend, + TextArea, }; export default Forms; diff --git a/packages/grafana-ui/src/components/Forms/TextArea/TextArea.mdx b/packages/grafana-ui/src/components/TextArea/TextArea.mdx similarity index 100% rename from packages/grafana-ui/src/components/Forms/TextArea/TextArea.mdx rename to packages/grafana-ui/src/components/TextArea/TextArea.mdx diff --git a/packages/grafana-ui/src/components/Forms/TextArea/TextArea.story.tsx b/packages/grafana-ui/src/components/TextArea/TextArea.story.tsx similarity index 94% rename from packages/grafana-ui/src/components/Forms/TextArea/TextArea.story.tsx rename to packages/grafana-ui/src/components/TextArea/TextArea.story.tsx index 7ae3d56f962..f81bb6c931c 100644 --- a/packages/grafana-ui/src/components/Forms/TextArea/TextArea.story.tsx +++ b/packages/grafana-ui/src/components/TextArea/TextArea.story.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { TextArea } from './TextArea'; -import { withCenteredStory } from '../../../utils/storybook/withCenteredStory'; +import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { boolean, number, select, text } from '@storybook/addon-knobs'; import mdx from './TextArea.mdx'; diff --git a/packages/grafana-ui/src/components/Forms/TextArea/TextArea.tsx b/packages/grafana-ui/src/components/TextArea/TextArea.tsx similarity index 90% rename from packages/grafana-ui/src/components/Forms/TextArea/TextArea.tsx rename to packages/grafana-ui/src/components/TextArea/TextArea.tsx index d65f3ba0ecd..a45690ef3a6 100644 --- a/packages/grafana-ui/src/components/Forms/TextArea/TextArea.tsx +++ b/packages/grafana-ui/src/components/TextArea/TextArea.tsx @@ -1,9 +1,9 @@ import React, { HTMLProps } from 'react'; import { GrafanaTheme } from '@grafana/data'; import { css, cx } from 'emotion'; -import { stylesFactory, useTheme } from '../../../themes'; -import { getFocusStyle, inputSizes, sharedInputStyle } from '../commonStyles'; -import { FormInputSize } from '../types'; +import { stylesFactory, useTheme } from '../../themes'; +import { getFocusStyle, inputSizes, sharedInputStyle } from '../Forms/commonStyles'; +import { FormInputSize } from '../Forms/types'; export interface Props extends Omit, 'size'> { /** Show an invalid state around the input */ diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index 7082bb230ad..fac68ac4275 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -138,6 +138,7 @@ export { RadioButtonGroup } from './Forms/RadioButtonGroup/RadioButtonGroup'; export { Input } from './Input/Input'; export { Switch } from './Forms/Switch'; +export { TextArea } from './TextArea/TextArea'; // Legacy forms diff --git a/public/app/features/dashboard/components/PanelEditor/PanelOptionsTab.tsx b/public/app/features/dashboard/components/PanelEditor/PanelOptionsTab.tsx index cb98c3421f3..f471b67f08f 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelOptionsTab.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelOptionsTab.tsx @@ -1,7 +1,7 @@ import React, { FC, useMemo } from 'react'; import { PanelModel, DashboardModel } from '../../state'; import { SelectableValue, PanelPlugin, FieldConfigSource, PanelData } from '@grafana/data'; -import { Forms, Switch, Select, DataLinksInlineEditor, Input } from '@grafana/ui'; +import { Forms, Switch, Select, DataLinksInlineEditor, Input, TextArea } from '@grafana/ui'; import { OptionsGroup } from './OptionsGroup'; import { getPanelLinksVariableSuggestions } from '../../../panel/panellinks/link_srv'; import { getVariables } from '../../../variables/state/selectors'; @@ -45,7 +45,7 @@ export const PanelOptionsTab: FC = ({ onPanelConfigChange('title', e.currentTarget.value)} /> - onPanelConfigChange('description', e.currentTarget.value)} /> diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx index 0b280feab1a..d6cbbb5a576 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; -import { Forms, Button, HorizontalGroup } from '@grafana/ui'; +import { Forms, Button, HorizontalGroup, TextArea } from '@grafana/ui'; import { e2e } from '@grafana/e2e'; import { SaveDashboardFormProps } from '../types'; @@ -50,12 +50,7 @@ export const SaveDashboardForm: React.FC = ({ dashboard, )} {(hasVariableChanged || hasTimeChanged) &&
} - +