button icon
This commit is contained in:
1 parent
175034bbcc
commit
cc591f854f
2 files changed
+42
-1
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { FC } from 'react';
|
||||
import { IconBaseProps } from './base';
|
||||
import { createAppUseStyles } from 'styles/theme';
|
||||
|
||||
export interface ButtonIconStyleProps {
|
||||
}
|
||||
export interface ButtonIconProps extends IconBaseProps, ButtonIconStyleProps {
|
||||
children: FC<IconBaseProps>;
|
||||
}
|
||||
const useButtonIconStyles = createAppUseStyles(theme => ({
|
||||
buttonIcon: {
|
||||
borderRadius: "100%",
|
||||
backgroundColor: theme.primary,
|
||||
borderColor: theme.primaryAccent,
|
||||
borderWidth: 1,
|
||||
borderStyle: "groove",
|
||||
padding: "0.25em",
|
||||
"&:hover": {
|
||||
backgroundColor: theme.primaryAccent,
|
||||
cursor: 'pointer',
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
export const ButtonIcon: FC<ButtonIconProps> = props => <props.children
|
||||
className={useButtonIconStyles({}).classes.buttonIcon}
|
||||
/>
|
||||
@@ -1,8 +1,9 @@
|
||||
import { ComponentStory } from "@storybook/react";
|
||||
import { usePageTheme } from "styles/page";
|
||||
import { IconBase } from "./base";
|
||||
import { PencilIcon, CheckMarkIcon, TrashIcon, InfoIcon } from ".";
|
||||
import { PencilIcon, CheckMarkIcon, TrashIcon, InfoIcon, ArrowIcon } from ".";
|
||||
import { AddIcon } from './index';
|
||||
import { ButtonIcon } from "./ButtonIcons";
|
||||
|
||||
export default {
|
||||
title: 'Icons',
|
||||
@@ -24,3 +25,15 @@ IconList.args = {
|
||||
size: 2,
|
||||
color: 'red'
|
||||
}
|
||||
|
||||
|
||||
export const ButtonIconExample: ComponentStory<typeof IconBase> = (args) => {
|
||||
const { classes } = usePageTheme({});
|
||||
return <div className={classes.page}>
|
||||
<ButtonIcon {...args}>{ArrowIcon}</ButtonIcon>
|
||||
</div>
|
||||
}
|
||||
ButtonIconExample.args = {
|
||||
size: 2,
|
||||
color: 'red'
|
||||
}
|
||||
Reference in new issue
Block a user