From 11f0f4ff2fe81d6755b6587c368284f0ea8f7b68 Mon Sep 17 00:00:00 2001 From: polinaboneva Date: Thu, 8 Dec 2022 18:24:53 +0200 Subject: [PATCH] moving the LoadingBar to core --- .../src/components/LoadingBar/LoadingBar.mdx | 22 -------- .../LoadingBar/LoadingBar.story.tsx | 56 ------------------- packages/grafana-ui/src/components/index.ts | 1 - .../components/LoadingBar/LoadingBar.tsx | 3 +- 4 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 packages/grafana-ui/src/components/LoadingBar/LoadingBar.mdx delete mode 100644 packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx rename {packages/grafana-ui/src => public/app/features/dashboard}/components/LoadingBar/LoadingBar.tsx (95%) diff --git a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.mdx b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.mdx deleted file mode 100644 index 563adb0662a..00000000000 --- a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.mdx +++ /dev/null @@ -1,22 +0,0 @@ -import { Meta, Preview, ArgsTable } from '@storybook/addon-docs/blocks'; -import { LoadingBar } from './LoadingBar'; - - - -# LoadingBar - -The LoadingBar is used as a simple loading slider animation in the top of its container. - - -
- -
-
- -```jsx -
- -
-``` - - diff --git a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx b/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx deleted file mode 100644 index f839a8d71a0..00000000000 --- a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.story.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { css } from '@emotion/css'; -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import React from 'react'; - -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: ComponentMeta = { - title: 'General/LoadingBar', - component: LoadingBar, - decorators: [withCenteredStory], - parameters: { - controls: {}, - docs: { - page: mdx, - }, - }, -}; - -const getStyles = (theme: GrafanaTheme2) => { - const { borderColor } = theme.components.panel; - - return { - container: css({ - label: 'placeholder-container', - width: '400px', - height: '200px', - border: `1px solid ${borderColor}`, - borderRadius: '3px', - }), - }; -}; - -export const Basic: ComponentStory = (args: LoadingBarProps) => { - const styles = useStyles2(getStyles); - - return ( - -
- -
-
- ); -}; - -Basic.args = { - width: '128px', - height: '2px', -}; - -export default meta; diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index f50b4610d48..8497191c78f 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -24,7 +24,6 @@ export { ButtonCascader } from './ButtonCascader/ButtonCascader'; export { InlineToast } from './InlineToast/InlineToast'; export { LoadingPlaceholder, type LoadingPlaceholderProps } from './LoadingPlaceholder/LoadingPlaceholder'; -export { LoadingBar, type LoadingBarProps } from './LoadingBar/LoadingBar'; export { ColorPicker, SeriesColorPicker } from './ColorPicker/ColorPicker'; export { ColorPickerInput } from './ColorPicker/ColorPickerInput'; export { SeriesColorPickerPopover, SeriesColorPickerPopoverWithTheme } from './ColorPicker/SeriesColorPickerPopover'; diff --git a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx b/public/app/features/dashboard/components/LoadingBar/LoadingBar.tsx similarity index 95% rename from packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx rename to public/app/features/dashboard/components/LoadingBar/LoadingBar.tsx index 0320a9c7ed4..1636e086c49 100644 --- a/packages/grafana-ui/src/components/LoadingBar/LoadingBar.tsx +++ b/public/app/features/dashboard/components/LoadingBar/LoadingBar.tsx @@ -2,8 +2,7 @@ import { css, keyframes } from '@emotion/css'; import React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; - -import { useStyles2 } from '../../themes'; +import { useStyles2 } from '@grafana/ui/src/themes'; /** * @internal