import React, { useState } from 'react' import { type Meta, type StoryObj } from '@storybook/react' import * as ICONS from '~components/IconV1' import { Text } from '~components/Text' import { Tag } from '~components/__next__/Tag' import { AddIcon } from '../index' import styles from './icon.module.scss' const meta = { title: 'Components/Icon/Icon components (deprecated)', component: AddIcon, args: { role: 'presentation', }, argTypes: { 'role': { options: ['presentation', 'img'], control: { type: 'radio' }, }, 'aria-label': { control: 'text', if: { arg: 'role', eq: 'img' } }, }, tags: ['!dev'], } satisfies Meta export default meta type Story = StoryObj export const Playground: Story = { parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, } export const ApplyColour: Story = { render: (args) => (
), } const ReferenceButton = ({ icon, iconName, }: { icon: JSX.Element iconName: string }): JSX.Element => { const [copied, setCopied] = useState(false) const handleCopy = (): void => { navigator.clipboard.writeText(`<${iconName} role="presentation" />`) setCopied(true) setTimeout(() => setCopied(false), 1000) } return (
  • ) } /** * Deprecated icons will still exist in as a React component but have been removed from the assets folder * This will remove them from the documentation but give us time to remove them in the next major */ const deprecatedList: string[] = ['ThumbsUpIcon', 'ThumbsDownIcon'] export const Reference: Story = { render: () => (
      {Object.keys(ICONS) .filter((iconName) => !deprecatedList.includes(iconName)) .map((iconName) => { const icon = ICONS[iconName as keyof typeof ICONS]({ role: 'presentation', }) return })}
    ), }