beem-component 1.0.4 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.js +3 -0
- package/dist/assets/css/sidebar.css +22 -0
- package/dist/components/Avatars/avatars.js +4 -3
- package/dist/components/Avatars/avatars.stories.js +3 -3
- package/dist/components/Buttons/buttonDropdown copy.js +158 -0
- package/dist/components/Buttons/buttonDropdown.js +30 -0
- package/dist/components/Buttons/buttonIconsOnly.js +1 -1
- package/dist/components/Buttons/buttons.js +1 -1
- package/dist/components/Cards/cards.js +5 -28
- package/dist/components/Cards/cards.stories.js +0 -4
- package/dist/components/ChatBody/chatBody.js +138 -0
- package/dist/components/ChatBody/chatBody.stories.js +65 -0
- package/dist/components/ChatHeader/chatHeader.js +20 -0
- package/dist/components/ChatHeader/chatHeader.stories.js +29 -0
- package/dist/components/ContactCards/contactCards.js +34 -0
- package/dist/components/ContactCards/contactCards.stories.js +41 -0
- package/dist/components/InfoTab/infoTab.js +23 -0
- package/dist/components/InfoTab/infoTab.stories.js +49 -0
- package/dist/components/MessageCounter/MessageCounter.stories.js +52 -0
- package/dist/components/MessageCounter/messageCounter.js +49 -0
- package/dist/components/{NoteBar.js → NoteBar}/noteBar.js +0 -0
- package/dist/components/{NoteBar.js → NoteBar}/noteBar.stories.js +0 -0
- package/dist/components/RouteLink/link.js +6 -1
- package/dist/components/Tabs/tabs.js +1 -1
- package/dist/components/Tabs/tabs.stories.js +2 -1
- package/dist/components/index.js +60 -4
- package/dist/components/sidebar.js +2 -4
- package/package.json +2 -1
- package/src/App.js +83 -8
- package/src/lib/assets/css/sidebar.css +22 -0
- package/src/lib/components/Avatars/avatars.js +3 -1
- package/src/lib/components/Avatars/avatars.stories.js +1 -1
- package/src/lib/components/Buttons/buttonDropdown copy.js +147 -0
- package/src/lib/components/Buttons/buttonDropdown.js +13 -0
- package/src/lib/components/Buttons/buttonIconsOnly.js +1 -1
- package/src/lib/components/Buttons/buttons.js +4 -4
- package/src/lib/components/Cards/cards.js +6 -39
- package/src/lib/components/Cards/cards.stories.js +1 -3
- package/src/lib/components/ChatBody/chatBody.js +145 -0
- package/src/lib/components/ChatBody/chatBody.stories.js +48 -0
- package/src/lib/components/ChatHeader/chatHeader.js +16 -0
- package/src/lib/components/ChatHeader/chatHeader.stories.js +19 -0
- package/src/lib/components/ContactCards/contactCards.js +59 -0
- package/src/lib/components/ContactCards/contactCards.stories.js +34 -0
- package/src/lib/components/InfoTab/infoTab.js +28 -0
- package/src/lib/components/InfoTab/infoTab.stories.js +47 -0
- package/src/lib/components/MessageCounter/MessageCounter.stories.js +35 -0
- package/src/lib/components/MessageCounter/messageCounter.js +42 -0
- package/src/lib/components/{NoteBar.js → NoteBar}/noteBar.js +0 -0
- package/src/lib/components/{NoteBar.js → NoteBar}/noteBar.stories.js +0 -0
- package/src/lib/components/RouteLink/link.js +4 -3
- package/src/lib/components/Tabs/tabs.js +1 -1
- package/src/lib/components/Tabs/tabs.stories.js +1 -0
- package/src/lib/components/iconStyles.js +1 -3
- package/src/lib/components/index.js +23 -6
- package/src/lib/components/sidebar.js +3 -3
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { KeyboardArrowDown } from "@material-ui/icons";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { BmBtnIcon } from "./buttonIconsOnly";
|
|
5
|
+
import { BmButton } from "./buttons";
|
|
6
|
+
import {
|
|
7
|
+
BmPrimaryWhite,
|
|
8
|
+
BmPrimaryBlue,
|
|
9
|
+
BmSecondaryRed,
|
|
10
|
+
BmSecondaryDarkGreen,
|
|
11
|
+
BmGrey400,
|
|
12
|
+
BmGrey100,
|
|
13
|
+
BmSecondaryCyan,
|
|
14
|
+
BmGrey50,
|
|
15
|
+
BmSecondaryGreen8,
|
|
16
|
+
BmSecondaryRed8,
|
|
17
|
+
} from "../colors";
|
|
18
|
+
|
|
19
|
+
const ButtonDropdownWrapper = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
&:hover {
|
|
22
|
+
background: ${({ variant, disabled }) => {
|
|
23
|
+
if (!disabled) {
|
|
24
|
+
if (variant === "primary") return `${BmSecondaryCyan}`;
|
|
25
|
+
if (variant === "neutral") return `${BmGrey50}`;
|
|
26
|
+
if (variant === "success") return `${BmSecondaryGreen8}`;
|
|
27
|
+
if (variant === "destructive") return `${BmSecondaryRed8}`;
|
|
28
|
+
if (!variant) {
|
|
29
|
+
return `${BmSecondaryCyan}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}};
|
|
33
|
+
border: 0.071rem solid
|
|
34
|
+
${({ variant, disabled }) => {
|
|
35
|
+
if (!disabled) {
|
|
36
|
+
if (variant === "secondary") return `${BmSecondaryCyan}`;
|
|
37
|
+
}
|
|
38
|
+
return "none";
|
|
39
|
+
}};
|
|
40
|
+
}
|
|
41
|
+
&:active {
|
|
42
|
+
background: ${({ variant, disabled }) => {
|
|
43
|
+
if (!disabled) {
|
|
44
|
+
if (variant === "primary") return `${BmPrimaryBlue}`;
|
|
45
|
+
if (variant === "neutral") return `${BmGrey100}`;
|
|
46
|
+
if (variant === "success") return `${BmSecondaryDarkGreen}`;
|
|
47
|
+
if (variant === "destructive") return `${BmSecondaryRed}`;
|
|
48
|
+
if (!variant) {
|
|
49
|
+
return `${BmPrimaryBlue}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}};
|
|
53
|
+
box-shadow: ${({ variant, disabled }) => {
|
|
54
|
+
if (!disabled) {
|
|
55
|
+
if (
|
|
56
|
+
variant === "primary" ||
|
|
57
|
+
variant === "success" ||
|
|
58
|
+
variant === "destructive"
|
|
59
|
+
)
|
|
60
|
+
return "inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)";
|
|
61
|
+
if (!variant) {
|
|
62
|
+
return "inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}};
|
|
66
|
+
border: 0.071rem solid
|
|
67
|
+
${({ variant, disabled }) => {
|
|
68
|
+
if (!disabled) {
|
|
69
|
+
if (variant === "secondary") return `${BmPrimaryBlue}`;
|
|
70
|
+
}
|
|
71
|
+
return "none";
|
|
72
|
+
}};
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
const Dropdown = styled(BmBtnIcon)`
|
|
77
|
+
background: ${({ variant, disabled }) => {
|
|
78
|
+
if (!disabled) {
|
|
79
|
+
if (variant === "primary") return `${BmPrimaryBlue}`;
|
|
80
|
+
if (variant === "secondary") return "none";
|
|
81
|
+
if (variant === "tertiary") return "none";
|
|
82
|
+
if (variant === "destructive") return `${BmSecondaryRed}`;
|
|
83
|
+
if (variant === "success") return `${BmSecondaryDarkGreen}`;
|
|
84
|
+
if (variant === "neutral") return `${BmPrimaryWhite}`;
|
|
85
|
+
return `${BmPrimaryBlue}`;
|
|
86
|
+
} else {
|
|
87
|
+
if (variant === "primary") return `${BmGrey100}`;
|
|
88
|
+
if (variant === "secondary") return "none";
|
|
89
|
+
if (variant === "tertiary") return "none";
|
|
90
|
+
return `${BmGrey100}`;
|
|
91
|
+
}
|
|
92
|
+
}};
|
|
93
|
+
border: 0.0625rem solid
|
|
94
|
+
${({ variant, disabled }) => {
|
|
95
|
+
if (!disabled) {
|
|
96
|
+
if (variant === "primary") return `${BmPrimaryBlue}`;
|
|
97
|
+
if (variant === "secondary") return `${BmPrimaryBlue}`;
|
|
98
|
+
if (variant === "tertiary") return "transparent";
|
|
99
|
+
if (variant === "destructive") return `${BmSecondaryRed}`;
|
|
100
|
+
if (variant === "success") return `${BmSecondaryDarkGreen}`;
|
|
101
|
+
if (variant === "neutral") return `${BmGrey400}`;
|
|
102
|
+
return `${BmPrimaryBlue}`;
|
|
103
|
+
} else {
|
|
104
|
+
if (variant === "primary") return `${BmGrey100}`;
|
|
105
|
+
if (variant === "secondary") return `${BmGrey400}`;
|
|
106
|
+
if (variant === "tertiary") return "transparent";
|
|
107
|
+
}
|
|
108
|
+
}};
|
|
109
|
+
|
|
110
|
+
border-left: 0.071rem solid
|
|
111
|
+
${({ variant, disabled }) => {
|
|
112
|
+
if (!disabled) {
|
|
113
|
+
if (variant === "primary") return `${BmPrimaryWhite}`;
|
|
114
|
+
if (variant === "secondary") return `${BmPrimaryBlue}`;
|
|
115
|
+
if (variant === "tertiary") return "transparent";
|
|
116
|
+
if (variant === "destructive") return `${BmSecondaryRed}`;
|
|
117
|
+
if (variant === "success") return `${BmSecondaryDarkGreen}`;
|
|
118
|
+
if (variant === "neutral") return `${BmGrey400}`;
|
|
119
|
+
return `${BmPrimaryWhite}`;
|
|
120
|
+
} else {
|
|
121
|
+
if (variant === "primary") return `${BmGrey400}`;
|
|
122
|
+
if (variant === "secondary") return `${BmGrey400}`;
|
|
123
|
+
if (variant === "tertiary") return "transparent";
|
|
124
|
+
}
|
|
125
|
+
}};
|
|
126
|
+
border-top-left-radius: 0.071rem;
|
|
127
|
+
border-bottom-left-radius: 0.071rem;
|
|
128
|
+
padding: 0rem;
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
export const Button = styled(BmButton)`
|
|
132
|
+
border-top-right-radius: 0.071rem;
|
|
133
|
+
border-bottom-right-radius: 0.071rem;
|
|
134
|
+
border-radius: none;
|
|
135
|
+
border-right: none;
|
|
136
|
+
`;
|
|
137
|
+
|
|
138
|
+
export const BmButtonDropDown = ({ children, ...rest }) => {
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
<ButtonDropdownWrapper {...rest}>
|
|
142
|
+
<Button {...rest}>{children}</Button>
|
|
143
|
+
<Dropdown {...rest} icon={<KeyboardArrowDown />} />
|
|
144
|
+
</ButtonDropdownWrapper>
|
|
145
|
+
</>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Home, KeyboardArrowDown } from "@material-ui/icons";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { BmBtnIcon } from "./buttonIconsOnly";
|
|
4
|
+
import { BmButton } from "./buttons";
|
|
5
|
+
|
|
6
|
+
export const BmButtonDropdown = ({ children }) => {
|
|
7
|
+
return (
|
|
8
|
+
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
9
|
+
<BmButton>{children}</BmButton>
|
|
10
|
+
<BmButton leadingIcon={<KeyboardArrowDown />}></BmButton>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
|
|
4
|
+
//TODO: Button Links Pending
|
|
5
5
|
import {
|
|
6
6
|
BmPrimaryWhite,
|
|
7
7
|
BmPrimaryBlue,
|
|
@@ -71,7 +71,7 @@ const BeemButton = styled.button`
|
|
|
71
71
|
}
|
|
72
72
|
}};
|
|
73
73
|
|
|
74
|
-
border: 0.
|
|
74
|
+
border: 0.071rem solid
|
|
75
75
|
${({ variant, disabled }) => {
|
|
76
76
|
if (!disabled) {
|
|
77
77
|
if (variant === "primary") return `${BmPrimaryBlue}`;
|
|
@@ -100,7 +100,7 @@ const BeemButton = styled.button`
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}};
|
|
103
|
-
border: 0.
|
|
103
|
+
border: 0.071rem solid
|
|
104
104
|
${({ variant, disabled }) => {
|
|
105
105
|
if (!disabled) {
|
|
106
106
|
if (variant === "secondary") return `${BmSecondaryCyan}`;
|
|
@@ -133,7 +133,7 @@ const BeemButton = styled.button`
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}};
|
|
136
|
-
border: 0.
|
|
136
|
+
border: 0.071rem solid
|
|
137
137
|
${({ variant, disabled }) => {
|
|
138
138
|
if (!disabled) {
|
|
139
139
|
if (variant === "secondary") return `${BmPrimaryBlue}`;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import styled from "styled-components";
|
|
3
|
-
import {
|
|
4
|
-
BmGrey400,
|
|
5
|
-
BmPrimaryBlack,
|
|
6
|
-
BmPrimaryWhite,
|
|
7
|
-
BmPrimaryBlue,
|
|
8
|
-
} from "../colors";
|
|
2
|
+
import { BmGrey400, BmPrimaryWhite } from "../colors";
|
|
9
3
|
|
|
10
|
-
|
|
4
|
+
const BmCard = styled.div`
|
|
11
5
|
display: flex;
|
|
12
6
|
flex-direction: column;
|
|
13
7
|
background: ${BmPrimaryWhite};
|
|
14
|
-
border: 0.
|
|
8
|
+
border: 0.071rem solid ${BmGrey400};
|
|
15
9
|
border-radius: 0.21875rem;
|
|
16
10
|
`;
|
|
17
11
|
|
|
18
12
|
BmCard.Header = styled.div`
|
|
19
13
|
display: flex;
|
|
20
14
|
flex-direction: row;
|
|
15
|
+
justify-content: space-between;
|
|
21
16
|
padding: 1rem 1rem 0rem 1rem;
|
|
22
17
|
`;
|
|
23
18
|
|
|
@@ -30,41 +25,13 @@ BmCard.Body = styled.div`
|
|
|
30
25
|
padding: 0rem 1rem;
|
|
31
26
|
`;
|
|
32
27
|
|
|
33
|
-
export const CardTitleText = styled.h3`
|
|
34
|
-
color: ${BmPrimaryBlack};
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
export const BmCardBodyText = styled.h1`
|
|
38
|
-
display: flex;
|
|
39
|
-
color: ${BmPrimaryBlack};
|
|
40
|
-
align-items: center;
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
export const BmCardBodyImg = styled.div`
|
|
44
|
-
display: flex;
|
|
45
|
-
background: ${BmPrimaryBlue};
|
|
46
|
-
height: 3rem;
|
|
47
|
-
width: 3rem;
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
28
|
BmCard.Footer = styled.div`
|
|
51
29
|
display: flex;
|
|
52
30
|
flex-direction: row;
|
|
53
31
|
justify-content: space-between;
|
|
54
|
-
border-top: 0.
|
|
32
|
+
border-top: 0.071rem solid ${BmGrey400};
|
|
55
33
|
padding: 1rem;
|
|
56
34
|
align-items: center;
|
|
57
35
|
`;
|
|
58
36
|
|
|
59
|
-
export
|
|
60
|
-
display: flex;
|
|
61
|
-
color: ${BmPrimaryBlack};
|
|
62
|
-
align-items: center;
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
export const BmCardDetails = styled.div`
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
`;
|
|
69
|
-
|
|
70
|
-
export default BmCard;
|
|
37
|
+
export default BmCard;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
2
|
import React from "react";
|
|
3
3
|
import BmCard from "./cards";
|
|
4
|
-
import { text, boolean
|
|
4
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
5
5
|
import "../../../main.scss";
|
|
6
|
-
import { Favorite, Home } from "@material-ui/icons";
|
|
7
6
|
import { BmButton } from "../Buttons/buttons";
|
|
8
|
-
import { BmTag } from "../tags";
|
|
9
7
|
import Image from "../../assets/beem.jpeg";
|
|
10
8
|
|
|
11
9
|
export default {
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Done, DoneAll } from "@material-ui/icons";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import BmAvatar from "../Avatars/avatars";
|
|
5
|
+
import { BmIcons } from "../iconStyles";
|
|
6
|
+
import {
|
|
7
|
+
BmGrey400,
|
|
8
|
+
BmGrey50,
|
|
9
|
+
BmPrimaryWhite,
|
|
10
|
+
BmPrimaryBlue,
|
|
11
|
+
BmPrimaryBlack,
|
|
12
|
+
BmSecondaryDarkGreen,
|
|
13
|
+
} from "../colors";
|
|
14
|
+
|
|
15
|
+
const BmChat = styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
${"" /* border: 0.071rem solid ${BmGrey400}; */}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
BmChat.Body = styled.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
padding: 0rem 1.5rem;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
const Details = styled.div`
|
|
28
|
+
display: flex;
|
|
29
|
+
${"" /* align-items: center; */}
|
|
30
|
+
justify-content: ${({ state }) => {
|
|
31
|
+
if (state === "inbound") {
|
|
32
|
+
return "flex-start";
|
|
33
|
+
}
|
|
34
|
+
if (state === "outbound") {
|
|
35
|
+
return "flex-end";
|
|
36
|
+
}
|
|
37
|
+
return "row";
|
|
38
|
+
}};
|
|
39
|
+
> *:not(:last-child) {
|
|
40
|
+
margin-right: 1rem;
|
|
41
|
+
}
|
|
42
|
+
overflow-wrap: break-word !important;
|
|
43
|
+
word-wrap: break-word !important;
|
|
44
|
+
margin: 0rem;
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const MessageDetails = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
max-width: 50%;
|
|
51
|
+
> * {
|
|
52
|
+
margin-top: 0.5rem;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const Messages = styled.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: center;
|
|
60
|
+
padding: 1.143rem;
|
|
61
|
+
background: ${({ state }) => {
|
|
62
|
+
if (state) {
|
|
63
|
+
if (state === "inbound") return `${BmPrimaryWhite}`;
|
|
64
|
+
if (state === "outbound") return `${BmPrimaryBlue}`;
|
|
65
|
+
}
|
|
66
|
+
return `${BmPrimaryWhite}`;
|
|
67
|
+
}};
|
|
68
|
+
color: ${({ state }) => {
|
|
69
|
+
if (state) {
|
|
70
|
+
if (state === "inbound") return `${BmPrimaryBlack}`;
|
|
71
|
+
if (state === "outbound") return `${BmPrimaryWhite}`;
|
|
72
|
+
}
|
|
73
|
+
return `${BmPrimaryWhite}`;
|
|
74
|
+
}};
|
|
75
|
+
border-radius: ${({ state }) => {
|
|
76
|
+
if (state) {
|
|
77
|
+
if (state === "inbound") return "0.21875rem 0.21875rem 0.21875rem 0rem";
|
|
78
|
+
if (state === "outbound") return "0.21875rem 0.21875rem 0rem 0.21875rem";
|
|
79
|
+
}
|
|
80
|
+
return `${BmPrimaryWhite}`;
|
|
81
|
+
}};
|
|
82
|
+
border: 0.071rem solid ${BmGrey400};
|
|
83
|
+
word-break: break-all;
|
|
84
|
+
margin: 0rem;
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
const MessagesSubDetails = styled.div`
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: row;
|
|
90
|
+
align-items: center;
|
|
91
|
+
> *:not(:last-child) {
|
|
92
|
+
margin-right: 0.5rem;
|
|
93
|
+
}
|
|
94
|
+
margin-top: 0.5rem;
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
const handleState = ({ session }) => {
|
|
98
|
+
if (session === "bot") {
|
|
99
|
+
return <BmAvatar size="small" user="chatbot" />;
|
|
100
|
+
}
|
|
101
|
+
if (session === "live") {
|
|
102
|
+
return <BmAvatar size="small" user="employee" />;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
BmChat.Details = ({
|
|
107
|
+
children,
|
|
108
|
+
state,
|
|
109
|
+
displayTime,
|
|
110
|
+
status,
|
|
111
|
+
session,
|
|
112
|
+
...rest
|
|
113
|
+
}) => {
|
|
114
|
+
return (
|
|
115
|
+
<Details state={state} {...rest}>
|
|
116
|
+
{state === "inbound" && session && handleState({ state, session })}
|
|
117
|
+
<MessageDetails>
|
|
118
|
+
<Messages state={state}>{children}</Messages>
|
|
119
|
+
<MessagesSubDetails>
|
|
120
|
+
{displayTime && displayTime}
|
|
121
|
+
{status === "sent" && (
|
|
122
|
+
<BmIcons icon={<DoneAll />} color={`${BmSecondaryDarkGreen}`} size="small" />
|
|
123
|
+
)}
|
|
124
|
+
{status === "failed" && <BmIcons icon={<Done />} color={`${BmPrimaryBlack}`} size="small" />}
|
|
125
|
+
</MessagesSubDetails>
|
|
126
|
+
</MessageDetails>
|
|
127
|
+
{state === "outbound" && session && handleState({ state, session })}
|
|
128
|
+
</Details>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
BmChat.Footer = styled.div`
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: row;
|
|
135
|
+
border-top: 0.071rem solid ${BmGrey400};
|
|
136
|
+
padding: 0.5rem 0rem;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
background: ${BmGrey50};
|
|
140
|
+
> *:not(:last-child) {
|
|
141
|
+
margin-right: 0.5rem;
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
export default BmChat;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import BmChat from "./chatBody";
|
|
4
|
+
import { BmIcons } from "../iconStyles";
|
|
5
|
+
import EmojiEmotionsIcon from "@mui/icons-material/EmojiEmotions";
|
|
6
|
+
import AttachFileIcon from "@mui/icons-material/AttachFile";
|
|
7
|
+
import QuickreplyIcon from "@mui/icons-material/Quickreply";
|
|
8
|
+
import SendIcon from "@mui/icons-material/Send";
|
|
9
|
+
import BmAvatar from "../Avatars/avatars";
|
|
10
|
+
import { DoneAll } from "@material-ui/icons";
|
|
11
|
+
import { BmInput } from "../input";
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
component: BmChat,
|
|
15
|
+
title: "components/Chat/ChatBody",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const ChatBody = () => {
|
|
19
|
+
return (
|
|
20
|
+
<BmChat>
|
|
21
|
+
<BmChat.Body>
|
|
22
|
+
<BmChat.Details
|
|
23
|
+
state="inbound"
|
|
24
|
+
session="bot"
|
|
25
|
+
displayTime={<p>12:00pm</p>}
|
|
26
|
+
status="sent"
|
|
27
|
+
>
|
|
28
|
+
<p>Inbound</p>
|
|
29
|
+
</BmChat.Details>
|
|
30
|
+
<BmChat.Details
|
|
31
|
+
state="outbound"
|
|
32
|
+
session="live"
|
|
33
|
+
displayTime={<p>10:00am</p>}
|
|
34
|
+
status="failed"
|
|
35
|
+
>
|
|
36
|
+
<p>Outbound</p>
|
|
37
|
+
</BmChat.Details>
|
|
38
|
+
</BmChat.Body>
|
|
39
|
+
<BmChat.Footer>
|
|
40
|
+
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
41
|
+
<BmIcons icon={<AttachFileIcon />} size="xlarge" />
|
|
42
|
+
<BmIcons icon={<QuickreplyIcon />} size="xlarge" />
|
|
43
|
+
<BmInput placeholder="Enter Message" />
|
|
44
|
+
<BmIcons icon={<SendIcon />} size="xlarge" />
|
|
45
|
+
</BmChat.Footer>
|
|
46
|
+
</BmChat>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BmGrey400 } from "../colors";
|
|
3
|
+
|
|
4
|
+
export const BmChatHeader = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
border: 0.071rem solid ${BmGrey400};
|
|
9
|
+
padding: 1rem;
|
|
10
|
+
> *:not(:last-child) {
|
|
11
|
+
margin-right: 0.5rem;
|
|
12
|
+
}
|
|
13
|
+
button {
|
|
14
|
+
margin-left: auto;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BmButton } from "../Buttons/buttons";
|
|
4
|
+
import { BmChatHeader } from "./chatHeader";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: BmChatHeader,
|
|
8
|
+
title: "components/Chat/ChatHeader",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ChatHeader = () => {
|
|
12
|
+
return (
|
|
13
|
+
<BmChatHeader>
|
|
14
|
+
<h2>Contact Name</h2>
|
|
15
|
+
<p>Last seen: 00:00</p>
|
|
16
|
+
<BmButton size="medium">End Session</BmButton>
|
|
17
|
+
</BmChatHeader>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BmGrey100 } from "../colors";
|
|
3
|
+
|
|
4
|
+
export const BmContactCard = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
> *:not(:last-child) {
|
|
9
|
+
margin-right: 1rem;
|
|
10
|
+
}
|
|
11
|
+
&:hover {
|
|
12
|
+
background: ${BmGrey100};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
${({ active }) =>
|
|
16
|
+
active &&
|
|
17
|
+
`
|
|
18
|
+
background: ${BmGrey100};
|
|
19
|
+
`}
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
padding: 1rem 1.5rem;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
BmContactCard.Profile = styled.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: center;
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
BmContactCard.Details = styled.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
> *:not(:last-child) {
|
|
39
|
+
margin-bottom: 0.5rem;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
BmContactCard.SubDetails = styled.div`
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
> * {
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
}
|
|
53
|
+
${'' /* TODO */}
|
|
54
|
+
${'' /* > :last-child {
|
|
55
|
+
margin-left: auto;
|
|
56
|
+
} */}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export default BmContactCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import BmContactCard from "./contactCards";
|
|
4
|
+
import BmAvatar from "../Avatars/avatars";
|
|
5
|
+
import BmCounter from "../MessageCounter/messageCounter";
|
|
6
|
+
import { BmTag } from "../tags";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
component: { BmContactCard, BmAvatar, BmTag, BmCounter },
|
|
10
|
+
title: "components/ContactCard",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const ContactCard = () => {
|
|
14
|
+
return (
|
|
15
|
+
<BmContactCard>
|
|
16
|
+
<BmContactCard.Profile>
|
|
17
|
+
<BmAvatar user="chatbot" size="medium" />
|
|
18
|
+
</BmContactCard.Profile>
|
|
19
|
+
<BmContactCard.Details>
|
|
20
|
+
<BmContactCard.SubDetails>
|
|
21
|
+
<h3>Contact Names</h3>
|
|
22
|
+
</BmContactCard.SubDetails>
|
|
23
|
+
<BmContactCard.SubDetails>
|
|
24
|
+
<p>Message text</p>
|
|
25
|
+
<BmCounter>10</BmCounter>
|
|
26
|
+
</BmContactCard.SubDetails>
|
|
27
|
+
<BmContactCard.SubDetails>
|
|
28
|
+
<BmTag variant="success">label</BmTag>
|
|
29
|
+
<p>10:00 am</p>
|
|
30
|
+
</BmContactCard.SubDetails>
|
|
31
|
+
</BmContactCard.Details>
|
|
32
|
+
</BmContactCard>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BmGrey400 } from "../colors";
|
|
3
|
+
|
|
4
|
+
const BmInfoTab = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
padding: 1.5rem;
|
|
8
|
+
border: 0.071rem solid ${BmGrey400};
|
|
9
|
+
> *:not(:last-child) {
|
|
10
|
+
margin-bottom: 1rem;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
BmInfoTab.Content = styled.div`
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
BmInfoTab.Tabs = styled.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
>*:not(:first-child) {
|
|
24
|
+
margin-top: 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export default BmInfoTab;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import BmInfoTab from "./infoTab";
|
|
4
|
+
import { BmTag } from "../tags";
|
|
5
|
+
import { BmBtnIcon } from "../Buttons/buttonIconsOnly";
|
|
6
|
+
import { MoreVert, Phone } from "@material-ui/icons";
|
|
7
|
+
import { BmIcons } from "../iconStyles";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
component: BmInfoTab,
|
|
11
|
+
title: "components/InfoTab",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const InfoTab = () => {
|
|
15
|
+
return (
|
|
16
|
+
<div style={{ maxWidth: "30%" }}>
|
|
17
|
+
<BmInfoTab>
|
|
18
|
+
<BmInfoTab.Content>
|
|
19
|
+
<h2>Contact Name</h2>
|
|
20
|
+
<BmIcons icon={<MoreVert />} />
|
|
21
|
+
</BmInfoTab.Content>
|
|
22
|
+
<BmInfoTab.Content>
|
|
23
|
+
<BmInfoTab.Tabs>
|
|
24
|
+
<BmBtnIcon icon={<Phone />} />
|
|
25
|
+
<h4>Call</h4>
|
|
26
|
+
</BmInfoTab.Tabs>
|
|
27
|
+
<BmInfoTab.Tabs>
|
|
28
|
+
<BmBtnIcon icon={<Phone />} />
|
|
29
|
+
<h4>Call</h4>
|
|
30
|
+
</BmInfoTab.Tabs>
|
|
31
|
+
<BmInfoTab.Tabs>
|
|
32
|
+
<BmBtnIcon icon={<Phone />} />
|
|
33
|
+
<h4>Call</h4>
|
|
34
|
+
</BmInfoTab.Tabs>
|
|
35
|
+
<BmInfoTab.Tabs>
|
|
36
|
+
<BmBtnIcon icon={<Phone />} />
|
|
37
|
+
<h4>Call</h4>
|
|
38
|
+
</BmInfoTab.Tabs>
|
|
39
|
+
<BmInfoTab.Tabs>
|
|
40
|
+
<BmBtnIcon icon={<Phone />} />
|
|
41
|
+
<h4>Call</h4>
|
|
42
|
+
</BmInfoTab.Tabs>
|
|
43
|
+
</BmInfoTab.Content>
|
|
44
|
+
</BmInfoTab>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|