beem-component 1.0.5 → 1.0.6
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 +12 -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/Tabs/tabs.js +1 -1
- package/dist/components/Tabs/tabs.stories.js +2 -1
- package/dist/components/index.js +43 -3
- package/dist/components/sidebar.js +2 -4
- package/package.json +1 -1
- package/src/App.js +83 -10
- package/src/lib/assets/css/sidebar.css +12 -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 +58 -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/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 +15 -2
- package/src/lib/components/sidebar.js +3 -3
|
@@ -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,58 @@
|
|
|
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
|
+
`;
|
|
22
|
+
|
|
23
|
+
BmContactCard.Profile = styled.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
align-items: center;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
BmContactCard.Details = styled.div`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
flex-grow: 1;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
> *:not(:last-child) {
|
|
38
|
+
margin-bottom: 0.5rem;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
BmContactCard.SubDetails = styled.div`
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
> * {
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
align-items: flex-start;
|
|
51
|
+
}
|
|
52
|
+
${'' /* TODO */}
|
|
53
|
+
${'' /* > :last-child {
|
|
54
|
+
margin-left: auto;
|
|
55
|
+
} */}
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
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
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import BmCounter from "./messageCounter";
|
|
4
|
+
import { text, select } from "@storybook/addon-knobs";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: BmCounter,
|
|
8
|
+
title: "components/MessageCounter",
|
|
9
|
+
argTypes: {
|
|
10
|
+
size: {
|
|
11
|
+
options: ["small", "medium", "large"],
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
description: "Size of the counter (can also be custom example: 10px)",
|
|
14
|
+
defaultValue: { summary: "small" },
|
|
15
|
+
},
|
|
16
|
+
children: {
|
|
17
|
+
description: "Counter Text",
|
|
18
|
+
defaultValue: { summary: undefined },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const optionSize = {
|
|
24
|
+
small: "small",
|
|
25
|
+
medium: "medium",
|
|
26
|
+
large: "large",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const MessageCounter = () => {
|
|
30
|
+
return (
|
|
31
|
+
<BmCounter size={select("size", optionSize, "large")}>
|
|
32
|
+
{text("children", "00")}
|
|
33
|
+
</BmCounter>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { BmPrimaryWhite, BmPrimaryBlue } from "../colors";
|
|
4
|
+
import { h3, h4, p } from "../text";
|
|
5
|
+
|
|
6
|
+
const BmCounter = styled.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
color: ${BmPrimaryWhite};
|
|
12
|
+
width: ${({ size }) => {
|
|
13
|
+
if (size === "small") return "1.429rem";
|
|
14
|
+
if (size === "medium") return "1.714rem";
|
|
15
|
+
if (size === "large") return "2.286rem";
|
|
16
|
+
if (!size) return "1.429rem";
|
|
17
|
+
return size;
|
|
18
|
+
}};
|
|
19
|
+
height: ${({ size }) => {
|
|
20
|
+
if (size === "small") return "1.429rem";
|
|
21
|
+
if (size === "medium") return "1.714rem";
|
|
22
|
+
if (size === "large") return "2.286rem";
|
|
23
|
+
if (!size) return "1.429rem";
|
|
24
|
+
return size;
|
|
25
|
+
}};
|
|
26
|
+
${({ size }) => {
|
|
27
|
+
if (size === "large") return `${h3}`;
|
|
28
|
+
if (size === "medium") return `${h4}`;
|
|
29
|
+
if (size === "small") return `${p}`;
|
|
30
|
+
return `${p}`;
|
|
31
|
+
}}
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
text-align: center;
|
|
34
|
+
background: ${BmPrimaryBlue};
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
BmCounter.propTypes = {
|
|
38
|
+
children: PropTypes.string,
|
|
39
|
+
size: PropTypes.string,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default BmCounter;
|
|
File without changes
|
|
File without changes
|
|
@@ -106,11 +106,10 @@ const Avatarsize = (props) => {
|
|
|
106
106
|
if (props.size === "small") return "1.143rem !important";
|
|
107
107
|
if (props.size === "medium") return "1.429rem !important";
|
|
108
108
|
if (props.size === "large") return "2.286rem !important";
|
|
109
|
-
if(!props.size) return "2.286rem !important";
|
|
109
|
+
if (!props.size) return "2.286rem !important";
|
|
110
110
|
return props.size;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
|
|
114
113
|
const AvatarIcon = {
|
|
115
114
|
root: {
|
|
116
115
|
fill: (props) => props.color || `${BmPrimaryWhite}`,
|
|
@@ -236,4 +235,3 @@ export const CopyToClipBoard = withStyles(icon)((props) => {
|
|
|
236
235
|
</SvgIcon>
|
|
237
236
|
);
|
|
238
237
|
});
|
|
239
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BmAccordion from "./Accordion/Accordion";
|
|
2
|
-
import
|
|
2
|
+
import BmAvatar from "./Avatars/avatars";
|
|
3
3
|
import { BmAlertIcon } from "./Buttons/buttonAlertIcons";
|
|
4
4
|
import { BmBtnIcon } from "./Buttons/buttonIconsOnly";
|
|
5
5
|
import { BmButton } from "./Buttons/buttons";
|
|
@@ -26,9 +26,16 @@ import {
|
|
|
26
26
|
BmSupport,
|
|
27
27
|
CopyToClipBoard,
|
|
28
28
|
} from "./iconStyles";
|
|
29
|
-
import { BmNoteBar } from "./NoteBar
|
|
29
|
+
import { BmNoteBar } from "./NoteBar/noteBar";
|
|
30
30
|
import { MainWrapper } from "../components/MainWrapper";
|
|
31
31
|
|
|
32
|
+
//Chat Components
|
|
33
|
+
import BmChat from "../components/ChatBody/chatBody";
|
|
34
|
+
import { BmChatHeader } from "./ChatHeader/chatHeader";
|
|
35
|
+
import BmContactCard from "./ContactCards/contactCards";
|
|
36
|
+
import BmInfoTab from "./InfoTab/infoTab";
|
|
37
|
+
import BmCounter from "./MessageCounter/messageCounter";
|
|
38
|
+
|
|
32
39
|
export {
|
|
33
40
|
BmAccordion,
|
|
34
41
|
BmAvatar,
|
|
@@ -60,4 +67,10 @@ export {
|
|
|
60
67
|
BmQuickReplyIcon,
|
|
61
68
|
BmSupport,
|
|
62
69
|
CopyToClipBoard,
|
|
70
|
+
//Chat Components
|
|
71
|
+
BmChatHeader,
|
|
72
|
+
BmChat,
|
|
73
|
+
BmInfoTab,
|
|
74
|
+
BmContactCard,
|
|
75
|
+
BmCounter,
|
|
63
76
|
};
|