mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storybook: Use bare specifier @grafana/ui in public stories (#26563)
This commit is contained in:
parent
e6a027d905
commit
c654e2bfda
@ -110,6 +110,8 @@ module.exports = ({ config, mode }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config.resolve.extensions.push('.ts', '.tsx', '.mdx');
|
config.resolve.extensions.push('.ts', '.tsx', '.mdx');
|
||||||
|
config.resolve.alias = config.resolve.alias || {};
|
||||||
|
config.resolve.alias['@grafana/ui'] = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
config.stats = {
|
config.stats = {
|
||||||
warningsFilter: /export .* was not found in/,
|
warningsFilter: /export .* was not found in/,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { boolean, text, select } from '@storybook/addon-knobs';
|
import { boolean, text, select } from '@storybook/addon-knobs';
|
||||||
import { Badge, BadgeColor } from './Badge';
|
import { Badge, BadgeColor } from '@grafana/ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Data Display/Badge',
|
title: 'Data Display/Badge',
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { number, text } from '@storybook/addon-knobs';
|
import { number, text } from '@storybook/addon-knobs';
|
||||||
import { BarGauge, Props, BarGaugeDisplayMode } from './BarGauge';
|
import { BarGauge, BarGaugeDisplayMode } from '@grafana/ui';
|
||||||
import { VizOrientation, ThresholdsMode, Field, FieldType, getDisplayProcessor } from '@grafana/data';
|
import { VizOrientation, ThresholdsMode, Field, FieldType, getDisplayProcessor } from '@grafana/data';
|
||||||
|
import { Props } from './BarGauge';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
|
import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { text, select, number, color } from '@storybook/addon-knobs';
|
import { text, select, number, color } from '@storybook/addon-knobs';
|
||||||
import { BigValue, BigValueColorMode, BigValueGraphMode, BigValueTextMode } from './BigValue';
|
import { BigValue, BigValueColorMode, BigValueGraphMode, BigValueTextMode } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
|
import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { select, text, boolean } from '@storybook/addon-knobs';
|
import { select, text, boolean } from '@storybook/addon-knobs';
|
||||||
import { Button, ButtonVariant } from './Button';
|
import { Button, ButtonVariant } from '@grafana/ui';
|
||||||
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { getIconKnob } from '../../utils/storybook/knobs';
|
import { getIconKnob } from '../../utils/storybook/knobs';
|
||||||
import mdx from './Button.mdx';
|
import mdx from './Button.mdx';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withKnobs, text, boolean, object } from '@storybook/addon-knobs';
|
import { withKnobs, text, boolean, object } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { ButtonCascader } from './ButtonCascader';
|
import { ButtonCascader } from '@grafana/ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Forms/Cascader/ButtonCascader',
|
title: 'Forms/Cascader/ButtonCascader',
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { text } from '@storybook/addon-knobs';
|
import { text } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { Cascader } from './Cascader';
|
import { Cascader } from '@grafana/ui';
|
||||||
// import { Button } from '../Button';
|
|
||||||
import mdx from './Cascader.mdx';
|
import mdx from './Cascader.mdx';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { boolean } from '@storybook/addon-knobs';
|
import { boolean } from '@storybook/addon-knobs';
|
||||||
import { SeriesColorPicker, ColorPicker } from './ColorPicker';
|
import { SeriesColorPicker, ColorPicker } from '@grafana/ui';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { text, boolean, select } from '@storybook/addon-knobs';
|
import { text, boolean, select } from '@storybook/addon-knobs';
|
||||||
import { ConfirmButton } from './ConfirmButton';
|
import { ConfirmButton } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { Button } from '../Button';
|
import { Button } from '../Button';
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { text, boolean, select } from '@storybook/addon-knobs';
|
import { text, boolean, select } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { ConfirmModal } from './ConfirmModal';
|
import { ConfirmModal } from '@grafana/ui';
|
||||||
import mdx from './ConfirmModal.mdx';
|
import mdx from './ConfirmModal.mdx';
|
||||||
|
|
||||||
const getKnobs = () => {
|
const getKnobs = () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { text } from '@storybook/addon-knobs';
|
import { text } from '@storybook/addon-knobs';
|
||||||
import { Drawer } from './Drawer';
|
import { Drawer } from '@grafana/ui';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import mdx from './Drawer.mdx';
|
import mdx from './Drawer.mdx';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { FileUpload } from './FileUpload';
|
import { FileUpload } from '@grafana/ui';
|
||||||
import mdx from './FileUpload.mdx';
|
import mdx from './FileUpload.mdx';
|
||||||
import { useSize } from '../../utils/storybook/useSize';
|
import { useSize } from '../../utils/storybook/useSize';
|
||||||
import { ComponentSize } from '../../types/size';
|
import { ComponentSize } from '../../types/size';
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import React, { useState, useCallback } from 'react';
|
import React, { useState, useCallback } from 'react';
|
||||||
import { boolean, number, text } from '@storybook/addon-knobs';
|
import { boolean, number, text } from '@storybook/addon-knobs';
|
||||||
import { Field } from './Field';
|
import { Field, Input, Switch } from '@grafana/ui';
|
||||||
import { Input } from '../Input/Input';
|
|
||||||
import { Switch } from '../Switch/Switch';
|
|
||||||
import mdx from './Field.mdx';
|
import mdx from './Field.mdx';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { FieldSet } from './FieldSet';
|
import { Input, Form, FieldSet, Field } from '@grafana/ui';
|
||||||
import { Form } from './Form';
|
|
||||||
import { Field } from './Field';
|
|
||||||
import { Input } from '../Input/Input';
|
|
||||||
import mdx from './FieldSet.mdx';
|
import mdx from './FieldSet.mdx';
|
||||||
import { Button } from '../Button';
|
import { Button } from '../Button';
|
||||||
|
|
||||||
|
@ -1,22 +1,23 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Legend } from './Legend';
|
|
||||||
|
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { withStoryContainer } from '../../utils/storybook/withStoryContainer';
|
import { withStoryContainer } from '../../utils/storybook/withStoryContainer';
|
||||||
import { Field } from './Field';
|
|
||||||
import { Input } from '../Input/Input';
|
|
||||||
import { Button } from '../Button';
|
|
||||||
import { Form } from './Form';
|
|
||||||
import { Switch } from '../Switch/Switch';
|
|
||||||
import { Checkbox } from './Checkbox';
|
|
||||||
|
|
||||||
import { RadioButtonGroup } from './RadioButtonGroup/RadioButtonGroup';
|
|
||||||
import { Select } from '../Select/Select';
|
|
||||||
import { InputControl } from '../InputControl';
|
|
||||||
import mdx from './Form.mdx';
|
import mdx from './Form.mdx';
|
||||||
import { ValidateResult } from 'react-hook-form';
|
import { ValidateResult } from 'react-hook-form';
|
||||||
import { boolean } from '@storybook/addon-knobs';
|
import { boolean } from '@storybook/addon-knobs';
|
||||||
import { TextArea } from '../TextArea/TextArea';
|
import {
|
||||||
|
Field,
|
||||||
|
Legend,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
Form,
|
||||||
|
Switch,
|
||||||
|
Checkbox,
|
||||||
|
Select,
|
||||||
|
InputControl,
|
||||||
|
TextArea,
|
||||||
|
RadioButtonGroup,
|
||||||
|
} from '@grafana/ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Forms/Example forms',
|
title: 'Forms/Example forms',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { text } from '@storybook/addon-knobs';
|
import { text } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
import { Legend } from './Legend';
|
import { Legend } from '@grafana/ui';
|
||||||
import mdx from './Legend.mdx';
|
import mdx from './Legend.mdx';
|
||||||
|
|
||||||
const getKnobs = () => {
|
const getKnobs = () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Graph } from './Graph';
|
import { Graph } from '@grafana/ui';
|
||||||
import Chart from '../Chart';
|
import Chart from '../Chart';
|
||||||
import { dateTime, ArrayVector, FieldType, GraphSeriesXY, FieldColorMode } from '@grafana/data';
|
import { dateTime, ArrayVector, FieldType, GraphSeriesXY, FieldColorMode } from '@grafana/data';
|
||||||
import { select } from '@storybook/addon-knobs';
|
import { select } from '@storybook/addon-knobs';
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import React, { ChangeEvent, useState } from 'react';
|
import React, { ChangeEvent, useState } from 'react';
|
||||||
import { css } from 'emotion';
|
import { css } from 'emotion';
|
||||||
|
|
||||||
import { Input } from '../Input/Input';
|
import { Input, Field, Icon } from '@grafana/ui';
|
||||||
import { Field } from '../Forms/Field';
|
|
||||||
import { Icon } from './Icon';
|
|
||||||
import { getAvailableIcons, IconName } from '../../types';
|
import { getAvailableIcons, IconName } from '../../types';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { useTheme, selectThemeVariant } from '../../themes';
|
import { useTheme, selectThemeVariant } from '../../themes';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { css } from 'emotion';
|
import { css } from 'emotion';
|
||||||
import { IconButton } from './IconButton';
|
import { IconButton } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { useTheme } from '../../themes/ThemeContext';
|
import { useTheme } from '../../themes/ThemeContext';
|
||||||
import { GrafanaTheme } from '@grafana/data';
|
import { GrafanaTheme } from '@grafana/data';
|
||||||
@ -33,7 +33,7 @@ export const simple = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function renderScenario(surface: string, theme: GrafanaTheme, sizes: IconSize[], icons: IconName[]) {
|
function renderScenario(surface: string, theme: GrafanaTheme, sizes: IconSize[], icons: IconName[]) {
|
||||||
let bg: string = 'red';
|
let bg = 'red';
|
||||||
|
|
||||||
switch (surface) {
|
switch (surface) {
|
||||||
case 'dashboard':
|
case 'dashboard':
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { number } from '@storybook/addon-knobs';
|
import { number } from '@storybook/addon-knobs';
|
||||||
import { InfoBox } from './InfoBox';
|
import { InfoBox, FeatureInfoBox } from '@grafana/ui';
|
||||||
import { FeatureInfoBox } from './FeatureInfoBox';
|
|
||||||
import { FeatureState } from '@grafana/data';
|
import { FeatureState } from '@grafana/data';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { boolean, text, select, number } from '@storybook/addon-knobs';
|
import { boolean, text, select, number } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { Input } from './Input';
|
|
||||||
import { Button } from '../Button';
|
|
||||||
import mdx from './Input.mdx';
|
import mdx from './Input.mdx';
|
||||||
import { getAvailableIcons, IconName } from '../../types';
|
import { getAvailableIcons, IconName } from '../../types';
|
||||||
import { KeyValue } from '@grafana/data';
|
import { KeyValue } from '@grafana/data';
|
||||||
import { Icon } from '../Icon/Icon';
|
import { Field, Icon, Button, Input } from '@grafana/ui';
|
||||||
import { Field } from '../Forms/Field';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Forms/Input',
|
title: 'Forms/Input',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { VerticalGroup, HorizontalGroup, Layout } from './Layout';
|
import { Layout } from './Layout';
|
||||||
import { Button } from '../Button';
|
import { Button, VerticalGroup, HorizontalGroup } from '@grafana/ui';
|
||||||
import { withStoryContainer } from '../../utils/storybook/withStoryContainer';
|
import { withStoryContainer } from '../../utils/storybook/withStoryContainer';
|
||||||
import { select } from '@storybook/addon-knobs';
|
import { select } from '@storybook/addon-knobs';
|
||||||
import mdx from './Layout.mdx';
|
import mdx from './Layout.mdx';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { LegendList, LegendPlacement, LegendItem, LegendTable, generateLegendItems } from './Legend';
|
import { generateLegendItems } from './Legend';
|
||||||
|
import { LegendList, LegendPlacement, LegendItem, LegendTable } from '@grafana/ui';
|
||||||
import { number, select, text } from '@storybook/addon-knobs';
|
import { number, select, text } from '@storybook/addon-knobs';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { GraphLegendListItem, GraphLegendTableRow, GraphLegendItemProps } from '../Graph/GraphLegendItem';
|
import { GraphLegendListItem, GraphLegendTableRow, GraphLegendItemProps } from '../Graph/GraphLegendItem';
|
||||||
|
@ -3,10 +3,7 @@ import { oneLineTrim } from 'common-tags';
|
|||||||
import { text, boolean } from '@storybook/addon-knobs';
|
import { text, boolean } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { Modal } from './Modal';
|
import { Modal, Icon, TabContent, ModalTabsHeader } from '@grafana/ui';
|
||||||
import { Icon } from '../Icon/Icon';
|
|
||||||
import { ModalTabsHeader } from './ModalTabsHeader';
|
|
||||||
import { TabContent } from '../Tabs/TabContent';
|
|
||||||
import mdx from './Modal.mdx';
|
import mdx from './Modal.mdx';
|
||||||
|
|
||||||
const getKnobs = () => {
|
const getKnobs = () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { number } from '@storybook/addon-knobs';
|
import { number } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { Pagination } from './Pagination';
|
import { Pagination } from '@grafana/ui';
|
||||||
import mdx from './Pagination.mdx';
|
import mdx from './Pagination.mdx';
|
||||||
|
|
||||||
export const WithPages = () => {
|
export const WithPages = () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { number, object, select } from '@storybook/addon-knobs';
|
import { number, object, select } from '@storybook/addon-knobs';
|
||||||
import { PieChart, PieChartType } from './PieChart';
|
import { PieChart, PieChartType } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { QueryField } from './QueryField';
|
import { QueryField } from '@grafana/ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Data Source/QueryField',
|
title: 'Data Source/QueryField',
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { RefreshPicker } from './RefreshPicker';
|
import { RefreshPicker } from '@grafana/ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Pickers and Editors/RefreshPicker',
|
title: 'Pickers and Editors/RefreshPicker',
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { Segment } from './';
|
import { Segment, Icon } from '@grafana/ui';
|
||||||
import { Icon } from '../Icon/Icon';
|
|
||||||
|
|
||||||
const AddButton = (
|
const AddButton = (
|
||||||
<a className="gf-form-label query-part">
|
<a className="gf-form-label query-part">
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { SelectableValue } from '@grafana/data';
|
import { SelectableValue } from '@grafana/data';
|
||||||
import { SegmentAsync } from './';
|
import { SegmentAsync, Icon } from '@grafana/ui';
|
||||||
import { Icon } from '../Icon/Icon';
|
|
||||||
|
|
||||||
const AddButton = (
|
const AddButton = (
|
||||||
<a className="gf-form-label query-part">
|
<a className="gf-form-label query-part">
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { SegmentInput } from '.';
|
import { SegmentInput, Icon } from '@grafana/ui';
|
||||||
import { Icon } from '../Icon/Icon';
|
|
||||||
|
|
||||||
const SegmentFrame = ({ children }: any) => (
|
const SegmentFrame = ({ children }: any) => (
|
||||||
<>
|
<>
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Select, AsyncSelect, MultiSelect, AsyncMultiSelect } from './Select';
|
|
||||||
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { SelectableValue } from '@grafana/data';
|
import { SelectableValue } from '@grafana/data';
|
||||||
|
import { Icon, Button, ButtonSelect, Select, AsyncSelect, MultiSelect, AsyncMultiSelect } from '@grafana/ui';
|
||||||
import { getAvailableIcons, IconName } from '../../types';
|
import { getAvailableIcons, IconName } from '../../types';
|
||||||
import { select, boolean, number } from '@storybook/addon-knobs';
|
import { select, boolean, number } from '@storybook/addon-knobs';
|
||||||
import { Icon } from '../Icon/Icon';
|
|
||||||
import { Button } from '../Button';
|
|
||||||
import { ButtonSelect } from './ButtonSelect';
|
|
||||||
import { getIconKnob } from '../../utils/storybook/knobs';
|
import { getIconKnob } from '../../utils/storybook/knobs';
|
||||||
import kebabCase from 'lodash/kebabCase';
|
import kebabCase from 'lodash/kebabCase';
|
||||||
import { generateOptions } from './mockOptions';
|
import { generateOptions } from './mockOptions';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Slider } from './Slider';
|
import { Slider } from '@grafana/ui';
|
||||||
import { select, number, boolean } from '@storybook/addon-knobs';
|
import { select, number, boolean } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from '@grafana/ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Visualizations/Spinner',
|
title: 'Visualizations/Spinner',
|
||||||
|
@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
|
|||||||
|
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { StatsPicker } from './StatsPicker';
|
import { StatsPicker } from '@grafana/ui';
|
||||||
import { text, boolean } from '@storybook/addon-knobs';
|
import { text, boolean } from '@storybook/addon-knobs';
|
||||||
|
|
||||||
const getKnobs = () => {
|
const getKnobs = () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useCallback } from 'react';
|
import React, { useState, useCallback } from 'react';
|
||||||
import { boolean } from '@storybook/addon-knobs';
|
import { boolean } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { Switch } from './Switch';
|
import { Switch } from '@grafana/ui';
|
||||||
import mdx from './Switch.mdx';
|
import mdx from './Switch.mdx';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { merge } from 'lodash';
|
import { merge } from 'lodash';
|
||||||
import { Table } from './Table';
|
import { Table } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { number } from '@storybook/addon-knobs';
|
import { number } from '@storybook/addon-knobs';
|
||||||
import { useTheme } from '../../themes';
|
import { useTheme } from '../../themes';
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { TabsBar } from './TabsBar';
|
import { TabsBar, Tab, TabContent } from '@grafana/ui';
|
||||||
import { Tab } from './Tab';
|
|
||||||
import { TabContent } from './TabContent';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Layout/Tabs',
|
title: 'Layout/Tabs',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { Tag } from './Tag';
|
import { Tag } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import mdx from './Tag.mdx';
|
import mdx from './Tag.mdx';
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { TagsInput } from './TagsInput';
|
import { TagsInput } from '@grafana/ui';
|
||||||
|
|
||||||
const mockTags = ['Some', 'Tags', 'With', 'This', 'New', 'Component'];
|
const mockTags = ['Some', 'Tags', 'With', 'This', 'New', 'Component'];
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TextArea } from './TextArea';
|
import { TextArea } from '@grafana/ui';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { boolean, number, text } from '@storybook/addon-knobs';
|
import { boolean, number, text } from '@storybook/addon-knobs';
|
||||||
import mdx from './TextArea.mdx';
|
import mdx from './TextArea.mdx';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { TimeOfDayPicker } from './TimeOfDayPicker';
|
import { TimeOfDayPicker } from '@grafana/ui';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { dateTime } from '@grafana/data';
|
import { dateTime } from '@grafana/data';
|
||||||
|
@ -3,7 +3,7 @@ import { action } from '@storybook/addon-actions';
|
|||||||
import { dateTime, TimeFragment } from '@grafana/data';
|
import { dateTime, TimeFragment } from '@grafana/data';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { TimeRangeInput } from './TimeRangeInput';
|
import { TimeRangeInput } from '@grafana/ui';
|
||||||
import mdx from './TimeRangeInput.mdx';
|
import mdx from './TimeRangeInput.mdx';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { TimeRangePicker } from './TimeRangePicker';
|
import { TimeRangePicker } from '@grafana/ui';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { TimeFragment, dateTime } from '@grafana/data';
|
import { TimeFragment, dateTime } from '@grafana/data';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
|
|
||||||
import { TimeZonePicker } from './TimeZonePicker';
|
import { TimeZonePicker } from '@grafana/ui';
|
||||||
import { UseState } from '../../utils/storybook/UseState';
|
import { UseState } from '../../utils/storybook/UseState';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { UnitPicker } from './UnitPicker';
|
import { UnitPicker } from '@grafana/ui';
|
||||||
import mdx from './UnitPicker.mdx';
|
import mdx from './UnitPicker.mdx';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { text } from '@storybook/addon-knobs';
|
import { text } from '@storybook/addon-knobs';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { ValuePicker } from './ValuePicker';
|
import { ValuePicker } from '@grafana/ui';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { generateOptions } from '../Select/mockOptions';
|
import { generateOptions } from '../Select/mockOptions';
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"declarationDir": "dist",
|
"declarationDir": "dist",
|
||||||
"outDir": "compiled",
|
"outDir": "compiled",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@grafana/slate-react": ["slate-react"]
|
"@grafana/slate-react": ["slate-react"],
|
||||||
|
"@grafana/ui": ["."]
|
||||||
},
|
},
|
||||||
"rootDirs": [".", "stories"],
|
"rootDirs": [".", "stories"],
|
||||||
"typeRoots": ["node_modules/@types"]
|
"typeRoots": ["node_modules/@types"]
|
||||||
|
Loading…
Reference in New Issue
Block a user