-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(InviteAgents): new component (#1363)
- Loading branch information
1 parent
aa50666
commit f721eb7
Showing
13 changed files
with
694 additions
and
5 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
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
46 changes: 46 additions & 0 deletions
46
packages/react-components/src/components/InviteAgents/InviteAgents.mdx
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,46 @@ | ||
import { Meta, Title, Canvas, ArgTypes } from '@storybook/blocks'; | ||
import * as InviteAgentsStories from './InviteAgents.stories'; | ||
|
||
<Meta of={InviteAgentsStories} /> | ||
|
||
<Title>InviteAgents</Title> | ||
|
||
## Intro <a id="Intro" /> | ||
|
||
The `InviteAgents` component is used to display a list of invited agents and provide functionality to add more agents or set up a chatbot. | ||
|
||
<Canvas of={InviteAgentsStories.Default} /> | ||
|
||
### Example implementation | ||
|
||
```jsx | ||
import { InviteAgents } from '@livechat/design-system-react-components'; | ||
|
||
const agents = [ | ||
{ | ||
name: 'Alice', | ||
email: 'alice@example.com', | ||
status: 'available', | ||
avatar: 'https://via.placeholder.com/150', | ||
}, | ||
]; | ||
|
||
const onAddTeammateClick = () => {}; | ||
const onSetUpChatbotClick = () => {}; | ||
|
||
return ( | ||
<InviteAgents | ||
agents={agents} | ||
onAddTeammateClick={onAddTeammateClick} | ||
onSetUpChatbotClick={onSetUpChatbotClick} | ||
animatedInviteButton={true} | ||
tooltipArrowOffset={13} | ||
className="invite-agents" | ||
/> | ||
); | ||
|
||
``` | ||
|
||
## Component API <a id="ComponentAPI" /> | ||
|
||
<ArgTypes of={InviteAgentsStories.Default} sort="requiredFirst" /> |
125 changes: 125 additions & 0 deletions
125
packages/react-components/src/components/InviteAgents/InviteAgents.module.scss
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,125 @@ | ||
$base-class: 'invite-agents'; | ||
|
||
.#{$base-class} { | ||
display: flex; | ||
align-items: center; | ||
border: 1px solid transparent; | ||
border-radius: var(--radius-4); | ||
background-color: var(--surface-secondary-default); | ||
max-width: 260px; | ||
height: 32px; | ||
|
||
&:hover { | ||
border-color: var(--border-basic-secondary); | ||
} | ||
|
||
&--empty { | ||
border: 0; | ||
} | ||
|
||
&--only-unavailable { | ||
border-color: var(--action-negative-default); | ||
background-color: var(--surface-accent-ondark-negative-default); | ||
|
||
&:hover { | ||
border-color: var(--border-basic-negative); | ||
} | ||
} | ||
|
||
&__not-accepting { | ||
display: flex; | ||
gap: var(--spacing-2); | ||
align-items: center; | ||
margin-right: var(--spacing-2); | ||
margin-left: var(--spacing-2); | ||
cursor: pointer; | ||
color: var(--content-basic-primary); | ||
} | ||
|
||
&__tooltip { | ||
max-width: 260px; | ||
|
||
> div { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
> p { | ||
display: inline-flex; | ||
gap: var(--spacing-3); | ||
align-items: center; | ||
} | ||
} | ||
} | ||
|
||
&__tooltip-trigger { | ||
display: flex; | ||
gap: var(--spacing-2); | ||
align-items: center; | ||
cursor: pointer; | ||
padding-right: var(--spacing-2); | ||
padding-left: var(--spacing-1); | ||
} | ||
|
||
&__not-accepting-status-dot { | ||
display: inline-block; | ||
border: 1px solid var(--navbar-background); | ||
border-radius: 50%; | ||
background: var(--surface-accent-emphasis-high-negative); | ||
width: 10px; | ||
height: 10px; | ||
} | ||
|
||
&__avatar-container { | ||
display: flex; | ||
} | ||
|
||
&__avatar { | ||
position: relative; | ||
border: 1px solid var(--border-basic-tertiary); | ||
|
||
&:not(:first-child) { | ||
margin-left: -10px; | ||
} | ||
|
||
> div { | ||
border: 1px solid var(--border-basic-tertiary); | ||
} | ||
} | ||
|
||
&__available-agents-number { | ||
text-transform: uppercase; | ||
line-height: 20px; | ||
letter-spacing: 0.2px; | ||
color: var(--content-basic-secondary); | ||
font-size: 12px; | ||
font-weight: 500; | ||
font-style: normal; | ||
} | ||
|
||
&__invite-button { | ||
margin-right: -1px; | ||
border: 1px solid var(--content-basic-disabled); | ||
border-radius: 24px; | ||
background-color: var(--surface-primary-default); | ||
padding: 6px 12px; | ||
min-width: 0; | ||
height: 32px; | ||
color: var(--content-basic-primary); | ||
|
||
&--animated { | ||
margin-right: 4px; | ||
height: 24px; | ||
|
||
&[class*='--animated-label'][class*='--with-left-icon'] { | ||
padding-right: 3px; | ||
padding-left: 3px; | ||
|
||
&:hover, | ||
&:focus-visible { | ||
margin-right: -1px; | ||
height: 32px; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.