2022-08-18 18:30:19 +02:00
import React from 'react' ;
import {
COLORS ,
SIZES ,
DISPLAY ,
ALIGN _ITEMS ,
TEXT _COLORS ,
BACKGROUND _COLORS ,
BORDER _COLORS ,
} from '../../../helpers/constants/design-system' ;
import Box from '../../ui/box/box' ;
import README from './README.mdx' ;
import { AvatarToken } from './avatar-token' ;
export default {
title : 'Components/ComponentLibrary/AvatarToken' ,
id : _ _filename ,
component : AvatarToken ,
parameters : {
docs : {
page : README ,
} ,
} ,
argTypes : {
size : {
control : 'select' ,
options : Object . values ( SIZES ) ,
} ,
color : {
options : Object . values ( TEXT _COLORS ) ,
control : 'select' ,
} ,
backgroundColor : {
options : Object . values ( BACKGROUND _COLORS ) ,
control : 'select' ,
} ,
borderColor : {
options : Object . values ( BORDER _COLORS ) ,
control : 'select' ,
} ,
tokenName : {
control : 'text' ,
} ,
tokenImageUrl : {
control : 'text' ,
} ,
showHalo : {
control : 'boolean' ,
} ,
} ,
args : {
tokenName : 'ast' ,
tokenImageUrl : './AST.png' ,
size : SIZES . MD ,
showHalo : false ,
} ,
} ;
const Template = ( args ) => {
return < AvatarToken { ... args } / > ;
} ;
export const DefaultStory = Template . bind ( { } ) ;
DefaultStory . storyName = 'Default' ;
export const Size = ( args ) => (
< Box display = { DISPLAY . FLEX } alignItems = { ALIGN _ITEMS . BASELINE } gap = { 1 } >
< AvatarToken { ... args } size = { SIZES . XS } / >
< AvatarToken { ... args } size = { SIZES . SM } / >
< AvatarToken { ... args } size = { SIZES . MD } / >
< AvatarToken { ... args } size = { SIZES . LG } / >
< AvatarToken { ... args } size = { SIZES . XL } / >
< / B o x >
) ;
2022-09-12 17:32:09 +02:00
export const TokenName = Template . bind ( { } ) ;
TokenName . args = {
2022-08-18 18:30:19 +02:00
tokenImageUrl : '' ,
} ;
2022-09-12 17:32:09 +02:00
export const TokenImageUrl = Template . bind ( { } ) ;
2022-08-18 18:30:19 +02:00
2022-09-12 17:32:09 +02:00
export const ShowHalo = Template . bind ( { } ) ;
ShowHalo . args = {
2022-08-18 18:30:19 +02:00
showHalo : true ,
} ;
export const ColorBackgroundColorAndBorderColor = ( args ) => (
< Box display = { DISPLAY . FLEX } gap = { 1 } >
< AvatarToken
{ ... args }
backgroundColor = { COLORS . GOERLI }
borderColor = { COLORS . GOERLI }
tokenName = "G"
color = { COLORS . PRIMARY _INVERSE } // TODO: This will have to be added to the BaseAvatar component as a prop so we can change the color of the text and to the base avatar
/ >
2022-09-14 20:26:45 +02:00
< AvatarToken
{ ... args }
backgroundColor = { COLORS . SEPOLIA }
borderColor = { COLORS . SEPOLIA }
tokenName = "G"
color = { COLORS . PRIMARY _INVERSE } // TODO: This will have to be added to the BaseAvatar component as a prop so we can change the color of the text and to the base avatar
/ >
2022-08-18 18:30:19 +02:00
< / B o x >
) ;
ColorBackgroundColorAndBorderColor . args = {
tokenImageUrl : '' ,
} ;