Added WIP IconButton component

refs https://github.com/TryGhost/Team/issues/3351
This commit is contained in:
Djordje Vlaisavljevic 2023-06-01 19:46:59 +01:00
parent e8d2ff0e98
commit 555ac95c31
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,18 @@
import type {Meta, StoryObj} from '@storybook/react';
import IconButton from './IconButton';
const meta = {
title: 'Global / Icon Button',
component: IconButton,
tags: ['autodocs']
} satisfies Meta<typeof IconButton>;
export default meta;
type Story = StoryObj<typeof IconButton>;
export const Default: Story = {
args: {
iconName: 'menu-horizontal'
}
};

View File

@ -0,0 +1,17 @@
import Icon from './Icon';
import React from 'react';
interface IconButtonProps {
iconName: string;
}
const IconButton: React.FC<IconButtonProps> = ({iconName}) => {
return (
<button aria-expanded="true" aria-haspopup="true" className="flex items-center rounded-sm bg-grey-100 px-2 py-1 text-grey-400 hover:text-grey-600" id="menu-button" type="button">
<span className="sr-only">Open menu</span>
<Icon color="grey-900" name={iconName} />
</button>
);
};
export default IconButton;