Skip to content

Commit

Permalink
feat: ✨ added avatar basic theme to context with active and away status
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-B-06 committed Oct 27, 2021
1 parent 12bfd2c commit 14e23ed
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/theme/defaultTheme/avatar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
export const avatar = {
base: 'relative items-center rounded-full justify-center bg-gray-100',
size: {
'xs': 'h-4 w-4',
'sm': 'h-5 w-5',
'md': 'h-6 w-6',
'lg': 'h-7 w-7',
'xl': 'h-8 w-8',
'2xl': 'h-10 w-10',
'3xl': 'h-12 w-12',
},
image: 'rounded-full w-full h-full',
initials: {
base: 'text-center uppercase text-gray-500',
size: {
'xs': 'text-xs',
'sm': 'text-cxs',
'md': 'text-sm',
'lg': 'text-sm',
'xl': 'text-base',
'2xl': 'text-lg',
'3xl': 'text-xl',
},
},
status: {
active: {
base: 'absolute bg-green-500 shadow-sm border-white rounded-full bottom-0 right-0',
size: {
'xs': 'h-[5px] w-[5px] border',
'sm': 'h-1.5 w-1.5 border',
'md': 'h-[7px] w-[7px] border',
'lg': 'h-2 w-2 border',
'xl': 'h-[10px] w-[10px] border-2',
'2xl': 'h-[12px] w-[12px] border-2',
'3xl': 'h-[13px] w-[13px] border-2',
},
},
away: {
base: 'absolute shadow-sm border-white rounded-full bg-white',
innerBox: {
base: 'rounded-full w-full h-full border-gray-500',
size: {
'xs': { borderWidth: 1.3 },
'sm': { borderWidth: 1.5 },
'md': { borderWidth: 1.5 },
'lg': { borderWidth: 2 },
'xl': { borderWidth: 2 },
'2xl': { borderWidth: 2 },
'3xl': { borderWidth: 2 },
},
},
position: {
'xs': { right: 0, bottom: -0.5 },
'sm': { right: -0.5, bottom: -0.5 },
'md': { right: -0.5, bottom: -0.5 },
'lg': { right: -0.5, bottom: -0.5 },
'xl': { right: -2, bottom: -2 },
'2xl': { right: -0.5, bottom: -1 },
'3xl': { right: -0.5, bottom: -1 },
},
size: {
'xs': 'h-1.5 w-1.5 border',
'sm': 'h-[7px] w-[7px] border',
'md': 'h-2 w-2 border',
'lg': 'h-[9px] w-[9px] border',
'xl': 'h-[12px] w-[12px] border-2',
'2xl': 'h-[14px] w-[14px] border-2',
'3xl': 'h-[15px] w-[15px] border-2',
},
},
},
};
2 changes: 2 additions & 0 deletions src/theme/defaultTheme/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { avatar } from './avatar';
import { badge } from './badge';
import { progress } from './progress';
import { switchTheme } from './switch';
Expand All @@ -6,6 +7,7 @@ const extendedTheme = {
badge,
switchTheme,
progress,
avatar,
};

export default extendedTheme;

0 comments on commit 14e23ed

Please sign in to comment.