-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2482 from innovaccer/develop
Develop
- Loading branch information
Showing
53 changed files
with
11,148 additions
and
5,752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
core/components/atoms/avatarGroup/AvatarGroupEmptyState.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import { Text } from '@/index'; | ||
|
||
export interface AvatarEmptyStateProps { | ||
/** | ||
* Specify height for empty state content | ||
*/ | ||
height?: string | number; | ||
/** | ||
* Describe title for empty state | ||
*/ | ||
title?: React.ReactText; | ||
/** | ||
* Specify description for empty state | ||
*/ | ||
description?: string; | ||
} | ||
|
||
export const AvatarGroupEmptyState = (props: AvatarEmptyStateProps) => { | ||
const { height, title, description } = props; | ||
return ( | ||
<div | ||
className="d-flex flex-column justify-content-center align-items-center" | ||
style={{ height: height ? (height as number) - 4 : '' }} | ||
data-test="DesignSystem-AvatarGroup--EmptyState" | ||
> | ||
{title && ( | ||
<Text className="text-align-center mb-3" weight="strong"> | ||
{title} | ||
</Text> | ||
)} | ||
{description && ( | ||
<Text className="text-align-center mb-6" weight="medium" size="small" appearance="subtle"> | ||
{description} | ||
</Text> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AvatarGroupEmptyState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import { Input } from '@/index'; | ||
import { InputProps } from '@/index.type'; | ||
import styles from '@css/components/avatarGroup.module.css'; | ||
import classNames from 'classnames'; | ||
|
||
export const AvatarGroupInput = (props: InputProps) => { | ||
const inputClassName = classNames({ | ||
'w-100': true, | ||
[styles['AvatarGroup-input']]: true, | ||
}); | ||
|
||
return ( | ||
<div className={styles['AvatarGroup-inputWrapper']}> | ||
<Input icon="search" className={inputClassName} data-test="DesignSystem-AvatarGroup--Input" {...props} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AvatarGroupInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as React from 'react'; | ||
import { Text, Avatar, Tooltip, Listbox } from '@/index'; | ||
import { AvatarData } from './AvatarGroup'; | ||
import classNames from 'classnames'; | ||
|
||
interface AvatarOptionItemProps { | ||
avatarData: AvatarData; | ||
} | ||
|
||
const AvatarOptionItem = (props: AvatarOptionItemProps) => { | ||
const { firstName = '', lastName = '', tooltipSuffix = '', disabled, image, icon, ...rest } = props.avatarData; | ||
const name = `${firstName} ${lastName} ${tooltipSuffix}`; | ||
const elementRef = React.useRef(null); | ||
|
||
const triggerClassName = classNames({ | ||
['cursor-not-allowed']: disabled, | ||
}); | ||
|
||
const itemClassName = classNames({ | ||
['AvatarGroup-listItem--disabled']: disabled, | ||
['cursor-default']: !disabled, | ||
}); | ||
|
||
return ( | ||
<Tooltip showOnTruncation={true} tooltip={name} elementRef={elementRef} triggerClass={triggerClassName}> | ||
<Listbox.Item | ||
disabled={disabled} | ||
className={itemClassName} | ||
tagName="li" | ||
data-test="DesignSystem-AvatarGroup--Item" | ||
> | ||
<Avatar firstName={firstName} lastName={lastName} className="mr-4" withTooltip={false} {...rest}> | ||
{image || icon} | ||
</Avatar> | ||
<Text ref={elementRef} data-test="DesignSystem-AvatarGroup--Text" className="ellipsis--noWrap"> | ||
{name} | ||
</Text> | ||
</Listbox.Item> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default AvatarOptionItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.