beem-component 1.0.8 → 1.1.2
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/dist/assets/css/sidebar.css +58 -0
- package/dist/components/Buttons/buttonIconsOnly.js +1 -1
- package/dist/components/Buttons/buttons.js +1 -1
- package/dist/components/Cards/cards.js +1 -1
- package/dist/components/ChatBody/chatBody.js +6 -4
- package/dist/components/ChatHeader/chatHeader.js +4 -3
- package/dist/components/Chats/chat.js +2 -2
- package/dist/components/Chats/chatInput.js +1 -1
- package/dist/components/InfoTab/infoTab.js +4 -3
- package/dist/components/Lists/listBox.js +1 -1
- package/dist/components/Tags/tags.js +116 -0
- package/dist/components/Tags/tags.stories.js +62 -0
- package/dist/components/dropdown.js +1 -1
- package/dist/components/dropdownItems.js +1 -1
- package/dist/components/index.js +79 -1
- package/dist/components/input.js +1 -3
- package/dist/components/search.js +1 -1
- package/dist/components/tags.js +3 -3
- package/package.json +1 -1
- package/src/App.js +25 -81
- package/src/Chat.js +120 -0
- package/src/ChatHeader.js +19 -0
- package/src/CustomerInfo.js +46 -0
- package/src/SideBar.js +81 -0
- package/src/lib/assets/css/sidebar.css +58 -0
- package/src/lib/components/Buttons/buttonIconsOnly.js +1 -1
- package/src/lib/components/Buttons/buttons.js +1 -1
- package/src/lib/components/Cards/cards.js +1 -1
- package/src/lib/components/ChatBody/chatBody.js +5 -2
- package/src/lib/components/ChatBody/chatBody.stories.js +27 -27
- package/src/lib/components/ChatHeader/chatHeader.js +2 -2
- package/src/lib/components/Chats/chat.js +2 -2
- package/src/lib/components/Chats/chatInput.js +1 -1
- package/src/lib/components/InfoTab/infoTab.js +2 -2
- package/src/lib/components/Lists/listBox.js +1 -1
- package/src/lib/components/Tags/tags.js +109 -0
- package/src/lib/components/Tags/tags.stories.js +37 -0
- package/src/lib/components/dropdown.js +1 -1
- package/src/lib/components/dropdownItems.js +1 -1
- package/src/lib/components/index.js +33 -2
- package/src/lib/components/input.js +1 -2
- package/src/lib/components/search.js +1 -1
- package/src/lib/components/tags.js +4 -4
- package/storybook-static/main.3c8d8027.iframe.bundle.js +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { BmIcons } from "../iconStyles";
|
|
5
|
+
import {
|
|
6
|
+
BmPrimaryWhite,
|
|
7
|
+
BmSecondaryDarkGreen,
|
|
8
|
+
BmSecondaryRed,
|
|
9
|
+
BmPrimaryBlack,
|
|
10
|
+
BmGrey100,
|
|
11
|
+
BmGrey400,
|
|
12
|
+
BmPrimaryGold,
|
|
13
|
+
} from "../../components/colors";
|
|
14
|
+
|
|
15
|
+
const Color = ({ variant, color }) => {
|
|
16
|
+
if (variant === "success" || variant === "warning" || variant === "danger") {
|
|
17
|
+
return `${BmPrimaryWhite}`;
|
|
18
|
+
}
|
|
19
|
+
if (!variant && color) {
|
|
20
|
+
return color;
|
|
21
|
+
}
|
|
22
|
+
return `${BmPrimaryBlack}`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const BeemTag = styled.button`
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
padding: 0.214rem 0.571rem;
|
|
31
|
+
border-radius: 0.25rem;
|
|
32
|
+
background: ${({ variant }) => {
|
|
33
|
+
if (variant === "neutral") return `${BmGrey100}`;
|
|
34
|
+
if (variant === "success") return `${BmSecondaryDarkGreen}`;
|
|
35
|
+
if (variant === "warning") return `${BmPrimaryGold}`;
|
|
36
|
+
if (variant === "danger") return `${BmSecondaryRed}`;
|
|
37
|
+
if (variant === "light") return `${BmPrimaryWhite}`;
|
|
38
|
+
if (!variant) return `${BmGrey100}`;
|
|
39
|
+
}};
|
|
40
|
+
border: 0.071rem solid
|
|
41
|
+
${({ variant }) => {
|
|
42
|
+
if (variant === "neutral") return `${BmGrey100}`;
|
|
43
|
+
if (variant === "success") return `${BmSecondaryDarkGreen}`;
|
|
44
|
+
if (variant === "warning") return `${BmPrimaryGold}`;
|
|
45
|
+
if (variant === "danger") return `${BmSecondaryRed}`;
|
|
46
|
+
if (variant === "light") return `${BmGrey400}`;
|
|
47
|
+
return `${BmGrey100}`;
|
|
48
|
+
}};
|
|
49
|
+
> * {
|
|
50
|
+
color: ${({ variant, color }) => Color({ variant, color })};
|
|
51
|
+
text-transform: uppercase;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
> *:not(:last-child) {
|
|
55
|
+
margin-right: 0.5rem;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export const BmTag = (props) => {
|
|
60
|
+
const {
|
|
61
|
+
variant,
|
|
62
|
+
size,
|
|
63
|
+
disabled,
|
|
64
|
+
children,
|
|
65
|
+
leadingIcon,
|
|
66
|
+
trailingIcon,
|
|
67
|
+
color,
|
|
68
|
+
...rest
|
|
69
|
+
} = props;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<BeemTag
|
|
73
|
+
size={size}
|
|
74
|
+
variant={variant}
|
|
75
|
+
disabled={disabled}
|
|
76
|
+
children={children}
|
|
77
|
+
color={color}
|
|
78
|
+
{...rest}
|
|
79
|
+
>
|
|
80
|
+
{leadingIcon && (
|
|
81
|
+
<BmIcons
|
|
82
|
+
disabled={disabled}
|
|
83
|
+
icon={leadingIcon}
|
|
84
|
+
variant={variant}
|
|
85
|
+
color={Color({color, variant})}
|
|
86
|
+
size={size || 'small'}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
{children}
|
|
90
|
+
{trailingIcon && (
|
|
91
|
+
<BmIcons
|
|
92
|
+
icon={trailingIcon}
|
|
93
|
+
disabled={disabled}
|
|
94
|
+
color={Color({color, variant})}
|
|
95
|
+
size={size || 'small'}
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
</BeemTag>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
BmTag.propTypes = {
|
|
103
|
+
children: PropTypes.object,
|
|
104
|
+
trailingIcon: PropTypes.node,
|
|
105
|
+
leadingIcon: PropTypes.node,
|
|
106
|
+
color: PropTypes.string,
|
|
107
|
+
size: PropTypes.string,
|
|
108
|
+
variant: PropTypes.string,
|
|
109
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import { Favorite, Home, KeyboardArrowDown } from "@material-ui/icons";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { BmTag } from "./tags";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: BmTag,
|
|
8
|
+
title: "components/Tags",
|
|
9
|
+
argTypes: {
|
|
10
|
+
color: {
|
|
11
|
+
control: { type: "text" },
|
|
12
|
+
description: "Color of the Icons and Text, will work only if variant is not present",
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
options: ["xsmall", "small", "medium", "large", "xlarge"],
|
|
16
|
+
control: { type: "select" },
|
|
17
|
+
description: "Size of the icons",
|
|
18
|
+
defaultValue: { summary: "small" },
|
|
19
|
+
},
|
|
20
|
+
variant: {
|
|
21
|
+
options: ["success", "warning", "danger", "light", "neutral", undefined],
|
|
22
|
+
control: { type: "select" },
|
|
23
|
+
description: "Type of tag",
|
|
24
|
+
defaultValue: { summary: "neutral" },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const MainTab = (args) => <BmTag {...args} />;
|
|
30
|
+
|
|
31
|
+
export const Tabs = MainTab.bind({});
|
|
32
|
+
Tabs.args = {
|
|
33
|
+
children: <p>Tabs</p>,
|
|
34
|
+
leadingIcon: <Favorite />,
|
|
35
|
+
trailingIcon: <Favorite />,
|
|
36
|
+
variant: 'success',
|
|
37
|
+
};
|
|
@@ -13,7 +13,7 @@ const BmDropdownWrapper = styled.div`
|
|
|
13
13
|
padding: 0.5rem 1.143rem;
|
|
14
14
|
background: ${BmPrimaryWhite};
|
|
15
15
|
border: 0.071rem solid ${BmGrey400};
|
|
16
|
-
border-radius: 0.
|
|
16
|
+
border-radius: 0.25rem;
|
|
17
17
|
${'' /* box-shadow: inset 0.071rem 0rem 0rem #afafaf; */}
|
|
18
18
|
`;
|
|
19
19
|
|
|
@@ -17,7 +17,7 @@ export const BmButtonDropdownItem = styled.div`
|
|
|
17
17
|
background: ${BmPrimaryWhite};
|
|
18
18
|
border: 0.071rem solid ${BmGrey400};
|
|
19
19
|
box-shadow: 0rem 0.286rem 0.286rem rgba(0, 0, 0, 0.25);
|
|
20
|
-
border-radius: 0.
|
|
20
|
+
border-radius: 0.25rem;
|
|
21
21
|
z-index: 99999;
|
|
22
22
|
position: absolute;
|
|
23
23
|
cursor: pointer;
|
|
@@ -17,7 +17,7 @@ import { BmTab } from "./Tabs/tabs";
|
|
|
17
17
|
import * as BmColors from "./colors";
|
|
18
18
|
import { BmLoader } from "./Loader/loader";
|
|
19
19
|
import { BmCheckbox } from "./checkbox";
|
|
20
|
-
import { BmTag } from "
|
|
20
|
+
import { BmTag } from "../components/Tags/tags";
|
|
21
21
|
import {
|
|
22
22
|
BmTagIcon,
|
|
23
23
|
BmAvatarIcon,
|
|
@@ -38,6 +38,24 @@ import BmContactCard from "./ContactCards/contactCards";
|
|
|
38
38
|
import BmInfoTab from "./InfoTab/infoTab";
|
|
39
39
|
import BmCounter from "./MessageCounter/messageCounter";
|
|
40
40
|
|
|
41
|
+
//SuperFluid Components
|
|
42
|
+
import { BmContent } from "./SuperFluid/Content/index";
|
|
43
|
+
import {
|
|
44
|
+
BmContentFooter,
|
|
45
|
+
BmContentTitle,
|
|
46
|
+
BmFooterLeft,
|
|
47
|
+
BmFooterRight,
|
|
48
|
+
} from "./SuperFluid/ContentTitle.js/index.js";
|
|
49
|
+
import {
|
|
50
|
+
BmSegmentCard,
|
|
51
|
+
BmSegmentSelector,
|
|
52
|
+
BmSegment,
|
|
53
|
+
BmSegmentCheckBox,
|
|
54
|
+
BmSegmentCompleteContent,
|
|
55
|
+
BmSegmentCompleteIcon,
|
|
56
|
+
BmSegmentCreateContent,
|
|
57
|
+
} from "./SuperFluid/SegmentCard/index";
|
|
58
|
+
|
|
41
59
|
export {
|
|
42
60
|
BmAccordion,
|
|
43
61
|
BmAvatar,
|
|
@@ -57,11 +75,24 @@ export {
|
|
|
57
75
|
GlobalStyle,
|
|
58
76
|
MainWrapper,
|
|
59
77
|
BmLoader,
|
|
78
|
+
BmTag,
|
|
60
79
|
// Old components to be refactored
|
|
61
80
|
BmButtonDropDown,
|
|
62
81
|
BmCheckbox,
|
|
63
82
|
BmInput,
|
|
64
|
-
|
|
83
|
+
//Old SFL componets to be refactored
|
|
84
|
+
BmContent,
|
|
85
|
+
BmContentFooter,
|
|
86
|
+
BmContentTitle,
|
|
87
|
+
BmFooterLeft,
|
|
88
|
+
BmFooterRight,
|
|
89
|
+
BmSegmentCard,
|
|
90
|
+
BmSegmentSelector,
|
|
91
|
+
BmSegment,
|
|
92
|
+
BmSegmentCheckBox,
|
|
93
|
+
BmSegmentCompleteContent,
|
|
94
|
+
BmSegmentCompleteIcon,
|
|
95
|
+
BmSegmentCreateContent,
|
|
65
96
|
//Icons (Remove unused ones and check on the sizing for custom icons)
|
|
66
97
|
BmAvatarIcon,
|
|
67
98
|
BmIcons,
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
BmSecondaryRed15,
|
|
15
15
|
BmGrey100,
|
|
16
16
|
} from "./colors";
|
|
17
|
-
import { BmSuccessIcon, BmErrorIcon } from "./iconStyles";
|
|
18
17
|
|
|
19
18
|
const BmInputLabel = styled.div`
|
|
20
19
|
font-family: Open Sans;
|
|
@@ -77,7 +76,7 @@ const BmInputWrapper = styled.div`
|
|
|
77
76
|
flex-direction: center;
|
|
78
77
|
align-items: center;
|
|
79
78
|
height: 2.929rem;
|
|
80
|
-
border-radius: 0.
|
|
79
|
+
border-radius: 0.25rem;
|
|
81
80
|
padding: 0rem;
|
|
82
81
|
background: ${({ state }) => {
|
|
83
82
|
if (state) {
|
|
@@ -31,7 +31,7 @@ const BmSearchWrapper = styled.div`
|
|
|
31
31
|
background: ${BmPrimaryWhite};
|
|
32
32
|
border: 0.071rem solid ${BmGrey400};
|
|
33
33
|
box-sizing: border-box;
|
|
34
|
-
border-radius: 0.
|
|
34
|
+
border-radius: 0.25rem;
|
|
35
35
|
${"" /* height: 2.929rem; */}
|
|
36
36
|
padding: ${({ dropdown }) => {
|
|
37
37
|
if (dropdown === "yes") {
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
BmGrey100,
|
|
9
9
|
BmGrey400,
|
|
10
10
|
BmPrimaryGold,
|
|
11
|
-
} from "
|
|
12
|
-
import { BmTagIcon } from "
|
|
11
|
+
} from "../components/colors";
|
|
12
|
+
import { BmTagIcon } from "../components/iconStyles";
|
|
13
13
|
|
|
14
14
|
const BeemTag = styled.button`
|
|
15
15
|
display: flex;
|
|
16
16
|
flex-direction: row;
|
|
17
17
|
justify-content: center;
|
|
18
18
|
align-items: center;
|
|
19
|
-
border-radius: 0.
|
|
19
|
+
border-radius: 0.25rem;
|
|
20
20
|
height: ${({ size }) => {
|
|
21
21
|
if (size === "small") return "1.286rem";
|
|
22
22
|
if (size === "default") return "1.714rem";
|
|
@@ -45,7 +45,7 @@ const BeemTag = styled.button`
|
|
|
45
45
|
if (variant === "light") return `${BmGrey400}`;
|
|
46
46
|
return `${BmGrey100}`;
|
|
47
47
|
}};
|
|
48
|
-
border-radius: 0.
|
|
48
|
+
border-radius: 0.25rem;
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
51
|
const TagText = styled.p`
|