diff --git a/packages/react/src/components/Tag/Tag-story.js b/packages/react/src/components/Tag/Tag-story.js deleted file mode 100644 index b591767f0e80..000000000000 --- a/packages/react/src/components/Tag/Tag-story.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Copyright IBM Corp. 2016, 2018 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React from 'react'; -import { withKnobs, select, text, boolean } from '@storybook/addon-knobs'; -import { Carbon, Compass, Tag as TagIcon } from '@carbon/icons-react'; -import Tag, { types as typesList } from '../Tag'; -import TagSkeleton from '../Tag/Tag.Skeleton'; -import { action } from '@storybook/addon-actions'; -import mdx from './Tag.mdx'; - -const icons = { - 'Carbon (Carbon16 from `@carbon/icons-react`)': 'Carbon16', - 'Compass (Compass16 from `@carbon/icons-react`)': 'Compass16', - 'Tag (Tag16 from `@carbon/icons-react`)': 'Tag16', -}; - -const iconMap = { - Carbon, - Compass, - TagIcon, -}; - -const sizes = { - 'Small (sm)': 'sm', - 'Medium (md) - default': undefined, -}; - -const props = { - regular: () => ({ - type: select( - 'Tag type (type)', - typesList.reduce( - (acc, type) => ({ - ...acc, - [`${type} (${type})`]: type, - }), - { - Default: undefined, - } - ) - ), - disabled: boolean('Disabled (disabled)', false), - size: select('Field size (size)', sizes, undefined) || undefined, - title: text('Title (title)', 'Clear Filter'), - }), - filter() { - return { - ...this.regular(), - onClick: action('onClick'), - onClose: action('onClose'), - }; - }, - icon() { - return { - ...this.regular(), - renderIcon: iconMap[select('Icon (icon)', icons, 'Tag16')], - }; - }, -}; - -export default { - title: 'Components/Tag', - component: Tag, - decorators: [withKnobs], - subcomponents: { - TagSkeleton, - }, - parameters: { - docs: { - page: mdx, - }, - }, -}; - -export const _Default = () => ( - <> - - {text('Content (children)', 'This is a tag')} - - - This is an interactive tag - - -); - -_Default.parameters = { - info: { - text: ` - Tags are used for items that need to be labeled, categorized, or organized using keywords that describe them. - The example below shows how the Tag component can be used. Each type has a default message describing the type, - but a custom message can also be applied. - `, - }, -}; - -export const Filter = () => ( - - {text('Content (children)', 'This is a tag')} - -); - -Filter.parameters = { - info: { - text: ` - Tags are used for items that need to be labeled, categorized, or organized using keywords that describe them. - The example below shows how the Tag component can be used. Each type has a default message describing the type, - but a custom message can also be applied. - `, - }, -}; - -export const CustomIcon = () => ( - - {text('Content (children)', 'This is a tag')} - -); - -CustomIcon.parameters = { - info: { - text: ` - Tags are used for items that need to be labeled, categorized, or organized using keywords that describe them. - The example below shows how the Tag component can be used. Each type has a default message describing the type, - but a custom message can also be applied. - `, - }, -}; - -export const AllTags = () => ( - <> - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - - {'Tag content'} - - -); - -export const Skeleton = () => ( -
- - -
-); - -Skeleton.storyName = 'skeleton'; - -Skeleton.parameters = { - info: { - text: ` - Placeholder skeleton state to use when content is loading. - `, - }, -}; diff --git a/packages/react/src/components/Tag/next/Tag.stories.js b/packages/react/src/components/Tag/Tag.stories.js similarity index 98% rename from packages/react/src/components/Tag/next/Tag.stories.js rename to packages/react/src/components/Tag/Tag.stories.js index 740288d923da..205b0d21b092 100644 --- a/packages/react/src/components/Tag/next/Tag.stories.js +++ b/packages/react/src/components/Tag/Tag.stories.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { default as Tag } from '../'; +import { default as Tag } from '../Tag'; export default { title: 'Components/Tag',