mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* chore(storybook): run yarn dlx storybook@latest upgrade * chore(storybook): remove storybook/blocks patch * chore(yarn): clean up storybook dependencies * feat(storybook): migrate to v8 config via migration codemods * refactor(storybook): update stories to use v8 types via codemod * refactor(storybook): update stories to use preview-api instead of client-api * refactor(storybook): replace mdx usage of ArgsTable with PureArgsTable * refactor(storybook): migrate remaining mdx files to v8 storybook/blocks api * refactor(storybook): clean up mdx imports and blocks component names * chore(storybook): clean up typescript configuration * fix(frontend): align types/react versions across monorepo so grafana ui can be built * fix(storybook): pub back react-docgen-typescript and use ArgTypes so props tables work * chore(storybook): patch blocks package to expose Preview component * revert(storybook): revert changes related to using Canvas component in mdx files * Storybook upgrade: Fix icon typing (#87793) fix iconOptions typing * refactor(storybook): prefer as const over asserting types * revert(storybook): put back correct case in box.mdx --------- Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
40 lines
778 B
TypeScript
40 lines
778 B
TypeScript
import { Meta, StoryFn } from '@storybook/react';
|
|
import React from 'react';
|
|
|
|
import { Badge } from '@grafana/ui';
|
|
|
|
import { iconOptions } from '../../utils/storybook/icons';
|
|
|
|
import mdx from './Badge.mdx';
|
|
|
|
const meta: Meta<typeof Badge> = {
|
|
title: 'Data Display/Badge',
|
|
component: Badge,
|
|
parameters: {
|
|
docs: { page: mdx },
|
|
},
|
|
argTypes: {
|
|
icon: {
|
|
options: Object.keys(iconOptions),
|
|
control: {
|
|
type: 'select',
|
|
labels: iconOptions,
|
|
},
|
|
},
|
|
color: { control: 'select' },
|
|
text: { control: 'text' },
|
|
},
|
|
};
|
|
|
|
const Template: StoryFn<typeof Badge> = (args) => <Badge {...args} />;
|
|
|
|
export const Basic = Template.bind({});
|
|
|
|
Basic.args = {
|
|
text: 'Badge label',
|
|
color: 'blue',
|
|
icon: 'rocket',
|
|
};
|
|
|
|
export default meta;
|