beem-component 1.5.8 → 1.5.9
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/.babelrc +17 -0
- package/.eslintrc +62 -0
- package/.prettierrc +6 -0
- package/dist/components/Accordion/Accordion.js +31 -64
- package/dist/components/Accordion/Accordion.stories.js +29 -29
- package/dist/components/Avatars/avatars.js +31 -46
- package/dist/components/Avatars/avatars.stories.js +18 -18
- package/dist/components/BannerCard/bannerCard.stories.js +14 -14
- package/dist/components/BannerCard/bannerCards.js +30 -48
- package/dist/components/Buttons/Stories/basicbutton.stories.js +24 -24
- package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
- package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +17 -17
- package/dist/components/Buttons/buttonAlertIcons.js +28 -44
- package/dist/components/Buttons/buttonDropdown copy.js +15 -18
- package/dist/components/Buttons/buttonDropdown.js +2 -2
- package/dist/components/Buttons/buttonIconsOnly.js +35 -49
- package/dist/components/Buttons/buttons.js +75 -86
- package/dist/components/Cards/cards.js +15 -11
- package/dist/components/Cards/cards.stories.js +8 -8
- package/dist/components/ChatComponents/ChatBody/chatBody.js +80 -69
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +6 -6
- package/dist/components/ChatComponents/ChatBody/sessionDetails.js +9 -16
- package/dist/components/ChatComponents/ChatHeader/chatHeader.js +5 -7
- package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -3
- package/dist/components/ChatComponents/ColorPicker/colorPicker.js +5 -7
- package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
- package/dist/components/ChatComponents/ContactCards/contactCards.js +15 -12
- package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +3 -3
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +14 -10
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
- package/dist/components/ChatComponents/InfoTab/infoTab.js +11 -9
- package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +6 -6
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +5 -7
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +11 -9
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +15 -13
- package/dist/components/Chats/chat.js +41 -32
- package/dist/components/Chats/chatInput.js +18 -14
- package/dist/components/Chats/chatwrapper.js +20 -12
- package/dist/components/Checkbox/checkboxToggler.js +61 -0
- package/dist/components/Checkbox/checkboxToggler.stories.js +81 -0
- package/dist/components/Lists/listBox.js +14 -30
- package/dist/components/Lists/listBox.stories.js +12 -23
- package/dist/components/Lists/listHeader.stories.js +13 -13
- package/dist/components/Lists/listheader.js +12 -27
- package/dist/components/Lists/rowLabels.js +19 -30
- package/dist/components/Lists/rowLabels.stories.js +22 -25
- package/dist/components/Loader/loader.js +17 -31
- package/dist/components/Loader/loader.stories.js +13 -13
- package/dist/components/MainWrapper/index.js +5 -7
- package/dist/components/MessageCounter/MessageCounter.stories.js +14 -14
- package/dist/components/MessageCounter/messageCounter.js +16 -18
- package/dist/components/Modals/modal.js +37 -57
- package/dist/components/Modals/modals.stories.js +15 -28
- package/dist/components/NoteBar/noteBar.js +28 -57
- package/dist/components/NoteBar/noteBar.stories.js +17 -17
- package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
- package/dist/components/PerformanceIndicator/performanceIndicator.js +21 -34
- package/dist/components/Pills/pills.js +24 -56
- package/dist/components/Pills/pills.stories.js +21 -23
- package/dist/components/ProfileIcon/ProfileIcon.js +28 -29
- package/dist/components/ProfileIcon/profileIcon.stories.js +18 -18
- package/dist/components/ProgressBar/progressbar.js +15 -17
- package/dist/components/ProgressBar/progressbar.stories.js +8 -10
- package/dist/components/ProgressRing/progressRing.js +38 -54
- package/dist/components/ProgressRing/progressRing.stories.js +16 -16
- package/dist/components/RouteLink/link.js +8 -10
- package/dist/components/RouteLink/link.stories.js +3 -3
- package/dist/components/ScrollBar/scrollBar.js +19 -17
- package/dist/components/SuperFluid/Content/index.js +5 -7
- package/dist/components/SuperFluid/ContentTitle.js/index.js +14 -10
- package/dist/components/SuperFluid/SegmentCard/index.js +22 -13
- package/dist/components/Tabs/tabs.js +16 -35
- package/dist/components/Tabs/tabs.stories.js +19 -19
- package/dist/components/Tags/tags.js +33 -65
- package/dist/components/Tags/tags.stories.js +18 -18
- package/dist/components/breakpoints.js +3 -3
- package/dist/components/chatHeader.js +17 -11
- package/dist/components/checkbox.js +27 -26
- package/dist/components/colors.js +32 -30
- package/dist/components/contacts.js +39 -25
- package/dist/components/dropdown.js +29 -35
- package/dist/components/dropdownButton.js +50 -53
- package/dist/components/dropdownItems.js +26 -19
- package/dist/components/examples/App.js +2 -2
- package/dist/components/examples/InfoAccordion.js +2 -3
- package/dist/components/examples/chatBodyExample.js +1 -5
- package/dist/components/examples/selectExample.js +6 -20
- package/dist/components/globalStyles.js +1 -5
- package/dist/components/iconStyles.js +56 -58
- package/dist/components/index.js +27 -23
- package/dist/components/input.js +33 -36
- package/dist/components/logo.js +9 -16
- package/dist/components/navbar.js +24 -13
- package/dist/components/search.js +20 -21
- package/dist/components/typography.js +14 -14
- package/dist/components/wrapper.js +8 -8
- package/package.json +54 -31
- package/src/App.js +10 -7
- package/src/index.js +6 -8
- package/src/lib/components/Accordion/Accordion.js +32 -14
- package/src/lib/components/Accordion/Accordion.stories.js +31 -31
- package/src/lib/components/Avatars/avatars.js +33 -28
- package/src/lib/components/Avatars/avatars.stories.js +18 -18
- package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
- package/src/lib/components/BannerCard/bannerCards.js +18 -18
- package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
- package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
- package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
- package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
- package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
- package/src/lib/components/Buttons/buttons.js +70 -73
- package/src/lib/components/Cards/cards.js +2 -3
- package/src/lib/components/Cards/cards.stories.js +10 -10
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +46 -45
- package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
- package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
- package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
- package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
- package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
- package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
- package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
- package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
- package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
- package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
- package/src/lib/components/Lists/listBox.js +7 -7
- package/src/lib/components/Lists/listBox.stories.js +8 -11
- package/src/lib/components/Lists/listHeader.stories.js +13 -13
- package/src/lib/components/Lists/listheader.js +7 -7
- package/src/lib/components/Lists/rowLabels.js +6 -6
- package/src/lib/components/Lists/rowLabels.stories.js +18 -18
- package/src/lib/components/Loader/loader.js +13 -13
- package/src/lib/components/Loader/loader.stories.js +14 -14
- package/src/lib/components/MainWrapper/index.js +2 -2
- package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
- package/src/lib/components/MessageCounter/messageCounter.js +16 -16
- package/src/lib/components/Modals/modal.js +25 -23
- package/src/lib/components/Modals/modals.stories.js +9 -9
- package/src/lib/components/NoteBar/noteBar.js +20 -20
- package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
- package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
- package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
- package/src/lib/components/Pills/pills.js +16 -16
- package/src/lib/components/Pills/pills.stories.js +22 -23
- package/src/lib/components/ProfileIcon/ProfileIcon.js +50 -52
- package/src/lib/components/ProfileIcon/profileIcon.stories.js +22 -22
- package/src/lib/components/ProgressBar/progressbar.js +4 -5
- package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
- package/src/lib/components/ProgressRing/progressRing.js +25 -24
- package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
- package/src/lib/components/RouteLink/link.js +10 -8
- package/src/lib/components/RouteLink/link.stories.js +4 -4
- package/src/lib/components/ScrollBar/scrollBar.js +15 -14
- package/src/lib/components/SuperFluid/Content/index.js +2 -2
- package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
- package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
- package/src/lib/components/Tabs/tabs.js +11 -11
- package/src/lib/components/Tabs/tabs.stories.js +20 -20
- package/src/lib/components/Tags/tags.js +26 -24
- package/src/lib/components/Tags/tags.stories.js +19 -19
- package/src/lib/components/breakpoints.js +3 -3
- package/src/lib/components/checkbox.js +7 -6
- package/src/lib/components/colors.js +30 -28
- package/src/lib/components/dropdownButton.js +36 -39
- package/src/lib/components/examples/InfoAccordion.js +1 -1
- package/src/lib/components/globalStyles.js +2 -2
- package/src/lib/components/iconStyles.js +45 -48
- package/src/lib/components/index.js +47 -46
- package/src/lib/components/input.js +20 -20
- package/src/lib/components/text.js +1 -1
- package/src/lib/components/typography.js +14 -14
- package/src/reportWebVitals.js +1 -1
- package/babel.config.js +0 -12
- package/dist/components/checkboxToggler.js +0 -50
- package/src/lib/components/checkboxToggler.js +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
3
|
-
import PropTypes from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
BmPrimaryWhite,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
BmSecondaryRed,
|
|
11
11
|
BmSecondaryDarkGreen,
|
|
12
12
|
BmGrey400,
|
|
13
|
-
} from
|
|
14
|
-
import { BmButtonIcon } from
|
|
13
|
+
} from '../colors';
|
|
14
|
+
import { BmButtonIcon } from '../iconStyles';
|
|
15
15
|
|
|
16
16
|
const BeemButtonIcon = styled.button`
|
|
17
17
|
display: flex;
|
|
@@ -20,34 +20,32 @@ const BeemButtonIcon = styled.button`
|
|
|
20
20
|
justify-content: center;
|
|
21
21
|
background: ${({ variant, disabled, color }) => {
|
|
22
22
|
if (!disabled) {
|
|
23
|
-
if (variant ===
|
|
24
|
-
if (variant ===
|
|
25
|
-
if (variant ===
|
|
26
|
-
if (variant ===
|
|
27
|
-
if (variant ===
|
|
28
|
-
if (variant ===
|
|
29
|
-
if (variant ===
|
|
30
|
-
if (variant ===
|
|
31
|
-
return `${color
|
|
32
|
-
} else {
|
|
33
|
-
return `${BmGrey100}`;
|
|
23
|
+
if (variant === 'active') return `${BmPrimaryBlue}`;
|
|
24
|
+
if (variant === 'enabled') return `${BmGrey50}`;
|
|
25
|
+
if (variant === 'destructive') return `${BmSecondaryRed}`;
|
|
26
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
27
|
+
if (variant === 'neutral') return `${BmPrimaryWhite}`;
|
|
28
|
+
if (variant === 'primary') return `${color || BmPrimaryBlue}`;
|
|
29
|
+
if (variant === 'secondary') return `${BmPrimaryWhite}`;
|
|
30
|
+
if (variant === 'tertiary') return `${BmPrimaryWhite}`;
|
|
31
|
+
return `${color || BmPrimaryBlue}`;
|
|
34
32
|
}
|
|
33
|
+
return `${BmGrey100}`;
|
|
35
34
|
}};
|
|
36
35
|
border: 0.071rem solid
|
|
37
36
|
${({ variant, disabled, color }) => {
|
|
38
37
|
if (!disabled) {
|
|
39
|
-
if (variant ===
|
|
40
|
-
if (variant ===
|
|
41
|
-
if (variant ===
|
|
42
|
-
if (variant ===
|
|
43
|
-
if (variant ===
|
|
44
|
-
if (variant ===
|
|
45
|
-
if (variant ===
|
|
46
|
-
if (variant ===
|
|
47
|
-
return `${color
|
|
48
|
-
} else {
|
|
49
|
-
return `${BmGrey100}`;
|
|
38
|
+
if (variant === 'active') return `${BmPrimaryBlue}`;
|
|
39
|
+
if (variant === 'enabled') return `${BmGrey50}`;
|
|
40
|
+
if (variant === 'destructive') return `${BmSecondaryRed}`;
|
|
41
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
42
|
+
if (variant === 'neutral') return `${BmGrey400}`;
|
|
43
|
+
if (variant === 'primary') return `${color || BmPrimaryBlue}`;
|
|
44
|
+
if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
|
|
45
|
+
if (variant === 'tertiary') return `${BmPrimaryWhite}`;
|
|
46
|
+
return `${color || BmPrimaryBlue}`;
|
|
50
47
|
}
|
|
48
|
+
return `${BmGrey100}`;
|
|
51
49
|
}};
|
|
52
50
|
box-sizing: border-box;
|
|
53
51
|
border-radius: 0.25rem;
|
|
@@ -62,7 +60,13 @@ export const BmBtnIcon = (props) => {
|
|
|
62
60
|
const { variant, size, disabled, children, icon, color, ...rest } = props;
|
|
63
61
|
|
|
64
62
|
return (
|
|
65
|
-
<BeemButtonIcon
|
|
63
|
+
<BeemButtonIcon
|
|
64
|
+
color={color}
|
|
65
|
+
size={size}
|
|
66
|
+
variant={variant}
|
|
67
|
+
disabled={disabled}
|
|
68
|
+
{...rest}
|
|
69
|
+
>
|
|
66
70
|
{icon && (
|
|
67
71
|
<BmIconWrapper>
|
|
68
72
|
<BmButtonIcon
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import { darken } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { darken } from 'polished';
|
|
5
5
|
|
|
6
|
-
//TODO: Button Links Pending
|
|
6
|
+
// TODO: Button Links Pending
|
|
7
7
|
import {
|
|
8
8
|
BmPrimaryWhite,
|
|
9
9
|
BmPrimaryBlue,
|
|
@@ -14,30 +14,29 @@ import {
|
|
|
14
14
|
BmGrey50,
|
|
15
15
|
BmSecondaryGreen8,
|
|
16
16
|
BmSecondaryRed8,
|
|
17
|
-
} from
|
|
18
|
-
import { BmButtonIcon } from
|
|
19
|
-
import { h3, h4 } from
|
|
17
|
+
} from '../colors';
|
|
18
|
+
import { BmButtonIcon } from '../iconStyles';
|
|
19
|
+
import { h3, h4 } from '../text';
|
|
20
20
|
|
|
21
21
|
const ButtonText = styled.div`
|
|
22
22
|
${({ size }) => {
|
|
23
|
-
if (size ===
|
|
24
|
-
if (size ===
|
|
25
|
-
if (size ===
|
|
23
|
+
if (size === 'large') return `${h3}`;
|
|
24
|
+
if (size === 'medium') return `${h3}`;
|
|
25
|
+
if (size === 'small') return `${h4}`;
|
|
26
26
|
return `${h3}`;
|
|
27
27
|
}}
|
|
28
28
|
text-align: center;
|
|
29
29
|
color: ${({ variant, disabled, color }) => {
|
|
30
30
|
if (!disabled) {
|
|
31
|
-
if (variant ===
|
|
32
|
-
if (variant ===
|
|
33
|
-
if (variant ===
|
|
34
|
-
if (variant ===
|
|
35
|
-
if (variant ===
|
|
36
|
-
if (variant ===
|
|
31
|
+
if (variant === 'primary') return `${BmPrimaryWhite}`;
|
|
32
|
+
if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
|
|
33
|
+
if (variant === 'tertiary') return `${color || BmPrimaryBlue}`;
|
|
34
|
+
if (variant === 'destructive') return `${BmPrimaryWhite}`;
|
|
35
|
+
if (variant === 'success') return `${BmPrimaryWhite}`;
|
|
36
|
+
if (variant === 'neutral') return `${color || BmPrimaryBlue}`;
|
|
37
37
|
return `${BmPrimaryWhite}`;
|
|
38
|
-
} else {
|
|
39
|
-
return `${BmGrey400}`;
|
|
40
38
|
}
|
|
39
|
+
return `${BmGrey400}`;
|
|
41
40
|
}};
|
|
42
41
|
padding: 0rem;
|
|
43
42
|
`;
|
|
@@ -49,116 +48,114 @@ const BeemButton = styled.button`
|
|
|
49
48
|
align-items: center;
|
|
50
49
|
border-radius: 0.25rem;
|
|
51
50
|
padding: ${({ size }) => {
|
|
52
|
-
if (size ===
|
|
53
|
-
if (size ===
|
|
54
|
-
if (size ===
|
|
55
|
-
return
|
|
51
|
+
if (size === 'large') return '0.625rem 1.5rem';
|
|
52
|
+
if (size === 'medium') return '0.4375rem 1rem';
|
|
53
|
+
if (size === 'small') return '0.375rem 0.75rem';
|
|
54
|
+
return '0.625rem 1.5rem';
|
|
56
55
|
}};
|
|
57
56
|
background: ${({ variant, disabled, color }) => {
|
|
58
57
|
if (!disabled) {
|
|
59
|
-
if (variant ===
|
|
60
|
-
if (variant ===
|
|
61
|
-
if (variant ===
|
|
62
|
-
if (variant ===
|
|
63
|
-
if (variant ===
|
|
64
|
-
if (variant ===
|
|
65
|
-
return `${color
|
|
66
|
-
} else {
|
|
67
|
-
if (variant === "primary") return `${BmGrey100}`;
|
|
68
|
-
if (variant === "secondary") return "none";
|
|
69
|
-
if (variant === "tertiary") return "none";
|
|
70
|
-
return `${BmGrey100}`;
|
|
58
|
+
if (variant === 'primary') return `${color || BmPrimaryBlue}`;
|
|
59
|
+
if (variant === 'secondary') return 'none';
|
|
60
|
+
if (variant === 'tertiary') return 'none';
|
|
61
|
+
if (variant === 'destructive') return `${BmSecondaryRed}`;
|
|
62
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
63
|
+
if (variant === 'neutral') return `${BmPrimaryWhite}`;
|
|
64
|
+
return `${color || BmPrimaryBlue}`;
|
|
71
65
|
}
|
|
66
|
+
if (variant === 'primary') return `${BmGrey100}`;
|
|
67
|
+
if (variant === 'secondary') return 'none';
|
|
68
|
+
if (variant === 'tertiary') return 'none';
|
|
69
|
+
return `${BmGrey100}`;
|
|
72
70
|
}};
|
|
73
71
|
|
|
74
72
|
border: 0.071rem solid
|
|
75
73
|
${({ variant, disabled, color }) => {
|
|
76
74
|
if (!disabled) {
|
|
77
|
-
if (variant ===
|
|
78
|
-
if (variant ===
|
|
79
|
-
if (variant ===
|
|
80
|
-
if (variant ===
|
|
81
|
-
if (variant ===
|
|
82
|
-
if (variant ===
|
|
83
|
-
return `${color
|
|
84
|
-
} else {
|
|
85
|
-
if (variant === "primary") return `${BmGrey100}`;
|
|
86
|
-
if (variant === "secondary") return `${BmGrey400}`;
|
|
87
|
-
if (variant === "tertiary") return "transparent";
|
|
75
|
+
if (variant === 'primary') return `${color || BmPrimaryBlue}`;
|
|
76
|
+
if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
|
|
77
|
+
if (variant === 'tertiary') return 'transparent';
|
|
78
|
+
if (variant === 'destructive') return `${BmSecondaryRed}`;
|
|
79
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
80
|
+
if (variant === 'neutral') return `${BmGrey400}`;
|
|
81
|
+
return `${color || BmPrimaryBlue}`;
|
|
88
82
|
}
|
|
83
|
+
if (variant === 'primary') return `${BmGrey100}`;
|
|
84
|
+
if (variant === 'secondary') return `${BmGrey400}`;
|
|
85
|
+
if (variant === 'tertiary') return 'transparent';
|
|
89
86
|
}};
|
|
90
87
|
|
|
91
88
|
&:hover {
|
|
92
89
|
background: ${({ variant, disabled, color }) => {
|
|
93
90
|
if (!disabled) {
|
|
94
|
-
if (variant ===
|
|
95
|
-
return `${darken(0.1, color
|
|
96
|
-
if (variant ===
|
|
97
|
-
if (variant ===
|
|
98
|
-
if (variant ===
|
|
91
|
+
if (variant === 'primary')
|
|
92
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
93
|
+
if (variant === 'neutral') return `${BmGrey50}`;
|
|
94
|
+
if (variant === 'success') return `${BmSecondaryGreen8}`;
|
|
95
|
+
if (variant === 'destructive') return `${BmSecondaryRed8}`;
|
|
99
96
|
if (!variant) {
|
|
100
|
-
return `${darken(0.1, color
|
|
97
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
}};
|
|
104
101
|
border: 0.071rem solid
|
|
105
102
|
${({ variant, disabled, color }) => {
|
|
106
103
|
if (!disabled) {
|
|
107
|
-
if (variant ===
|
|
108
|
-
return `${darken(0.1, color
|
|
104
|
+
if (variant === 'secondary')
|
|
105
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
109
106
|
}
|
|
110
|
-
return
|
|
107
|
+
return 'none';
|
|
111
108
|
}};
|
|
112
109
|
}
|
|
113
110
|
&:active {
|
|
114
111
|
background: ${({ variant, disabled, color }) => {
|
|
115
112
|
if (!disabled) {
|
|
116
|
-
if (variant ===
|
|
117
|
-
return `${darken(0.1, color
|
|
118
|
-
if (variant ===
|
|
119
|
-
if (variant ===
|
|
120
|
-
if (variant ===
|
|
113
|
+
if (variant === 'primary')
|
|
114
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
115
|
+
if (variant === 'neutral') return `${BmGrey100}`;
|
|
116
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
117
|
+
if (variant === 'destructive') return `${BmSecondaryRed}`;
|
|
121
118
|
if (!variant) {
|
|
122
|
-
return `${darken(0.1, color
|
|
119
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
123
120
|
}
|
|
124
121
|
}
|
|
125
122
|
}};
|
|
126
123
|
box-shadow: ${({ variant, disabled }) => {
|
|
127
124
|
if (!disabled) {
|
|
128
125
|
if (
|
|
129
|
-
variant ===
|
|
130
|
-
variant ===
|
|
131
|
-
variant ===
|
|
126
|
+
variant === 'primary' ||
|
|
127
|
+
variant === 'success' ||
|
|
128
|
+
variant === 'destructive'
|
|
132
129
|
)
|
|
133
|
-
return
|
|
130
|
+
return 'inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)';
|
|
134
131
|
if (!variant) {
|
|
135
|
-
return
|
|
132
|
+
return 'inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)';
|
|
136
133
|
}
|
|
137
134
|
}
|
|
138
135
|
}};
|
|
139
136
|
border: 0.071rem solid
|
|
140
137
|
${({ variant, disabled, color }) => {
|
|
141
138
|
if (!disabled) {
|
|
142
|
-
if (variant ===
|
|
143
|
-
return `${darken(0.1, color
|
|
139
|
+
if (variant === 'secondary')
|
|
140
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
144
141
|
}
|
|
145
|
-
return
|
|
142
|
+
return 'none';
|
|
146
143
|
}};
|
|
147
144
|
}
|
|
148
145
|
|
|
149
146
|
&:hover ${ButtonText} {
|
|
150
147
|
color: ${({ variant, disabled, color }) => {
|
|
151
148
|
if (!disabled) {
|
|
152
|
-
if (variant ===
|
|
153
|
-
return `${darken(0.1, color
|
|
149
|
+
if (variant === 'secondary' || variant === 'tertiary')
|
|
150
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
154
151
|
}
|
|
155
152
|
}};
|
|
156
153
|
}
|
|
157
154
|
&:active ${ButtonText} {
|
|
158
155
|
color: ${({ variant, disabled, color }) => {
|
|
159
156
|
if (!disabled) {
|
|
160
|
-
if (variant ===
|
|
161
|
-
return `${darken(0.1, color
|
|
157
|
+
if (variant === 'secondary' || variant === 'tertiary')
|
|
158
|
+
return `${darken(0.1, color || BmPrimaryBlue)}`;
|
|
162
159
|
}
|
|
163
160
|
}};
|
|
164
161
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { BmGrey400, BmPrimaryWhite } from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { BmGrey400, BmPrimaryWhite } from '../colors';
|
|
3
3
|
|
|
4
4
|
const BmCard = styled.div`
|
|
5
5
|
display: flex;
|
|
@@ -14,7 +14,6 @@ const BmCard = styled.div`
|
|
|
14
14
|
justify-content: space-between;
|
|
15
15
|
margin-bottom: 0.5rem;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
17
|
`;
|
|
19
18
|
|
|
20
19
|
BmCard.Header = styled.div`
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { BmButton } from
|
|
7
|
-
import Image from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { text, boolean } from '@storybook/addon-knobs';
|
|
4
|
+
import BmCard from './cards';
|
|
5
|
+
import '../../../main.scss';
|
|
6
|
+
import { BmButton } from '../Buttons/buttons';
|
|
7
|
+
import Image from '../../assets/beem.jpeg';
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
component: BmCard,
|
|
11
|
-
title:
|
|
11
|
+
title: 'components/Card',
|
|
12
12
|
argTypes: {
|
|
13
13
|
children: {
|
|
14
|
-
description:
|
|
14
|
+
description: 'Accordion Title Text',
|
|
15
15
|
defaultValue: { summary: undefined },
|
|
16
16
|
},
|
|
17
17
|
},
|
|
@@ -19,9 +19,9 @@ export default {
|
|
|
19
19
|
export const BasicCardSample = () => {
|
|
20
20
|
return (
|
|
21
21
|
<div>
|
|
22
|
-
<BmCard disabled={boolean(
|
|
22
|
+
<BmCard disabled={boolean('disabled', false)}>
|
|
23
23
|
<BmCard.Header>
|
|
24
|
-
<h3>{text(
|
|
24
|
+
<h3>{text('children', 'Card Header')}</h3>
|
|
25
25
|
</BmCard.Header>
|
|
26
26
|
<BmCard.Body>Card Body</BmCard.Body>
|
|
27
27
|
<BmCard.Footer>Card Footer</BmCard.Footer>
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
1
|
+
/* eslint-disable react/display-name */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Done, DoneAll } from '@material-ui/icons';
|
|
4
|
+
import FilePresentIcon from '@mui/icons-material/FilePresent';
|
|
5
|
+
import DownloadIcon from '@mui/icons-material/Download';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import BmAvatar from '../../Avatars/avatars';
|
|
8
|
+
import { BmIcons } from '../../iconStyles';
|
|
9
|
+
import { SessionDetails } from './sessionDetails';
|
|
9
10
|
import {
|
|
10
11
|
BmPrimaryWhite,
|
|
11
12
|
BmPrimaryBlue,
|
|
12
13
|
BmPrimaryBlack,
|
|
13
14
|
BmSecondaryDarkGreen,
|
|
14
15
|
BmGrey200,
|
|
15
|
-
} from
|
|
16
|
+
} from '../../colors';
|
|
16
17
|
|
|
17
18
|
const BmChat = styled.div`
|
|
18
19
|
display: flex;
|
|
19
20
|
flex-direction: column;
|
|
20
21
|
height: 100%;
|
|
21
|
-
${
|
|
22
|
+
${'' /* border: 0.071rem solid ${BmGrey400}; */}
|
|
22
23
|
`;
|
|
23
24
|
|
|
24
25
|
BmChat.Body = styled.div`
|
|
@@ -33,13 +34,13 @@ BmChat.Body = styled.div`
|
|
|
33
34
|
const Details = styled.div`
|
|
34
35
|
display: flex;
|
|
35
36
|
justify-content: ${({ state }) => {
|
|
36
|
-
if (state ===
|
|
37
|
-
return
|
|
37
|
+
if (state === 'inbound') {
|
|
38
|
+
return 'flex-start';
|
|
38
39
|
}
|
|
39
|
-
if (state ===
|
|
40
|
-
return
|
|
40
|
+
if (state === 'outbound') {
|
|
41
|
+
return 'flex-end';
|
|
41
42
|
}
|
|
42
|
-
return
|
|
43
|
+
return 'row';
|
|
43
44
|
}};
|
|
44
45
|
> *:not(:last-child) {
|
|
45
46
|
margin-right: 1rem;
|
|
@@ -49,7 +50,7 @@ const Details = styled.div`
|
|
|
49
50
|
word-wrap: break-word !important;
|
|
50
51
|
margin: 0rem;
|
|
51
52
|
flex-grow: 1;
|
|
52
|
-
${
|
|
53
|
+
${'' /* border: 1px solid red; */}
|
|
53
54
|
`;
|
|
54
55
|
|
|
55
56
|
const MessageDetails = styled.div`
|
|
@@ -69,22 +70,22 @@ const Messages = styled.div`
|
|
|
69
70
|
padding: 0.5rem;
|
|
70
71
|
background: ${({ state }) => {
|
|
71
72
|
if (state) {
|
|
72
|
-
if (state ===
|
|
73
|
-
if (state ===
|
|
73
|
+
if (state === 'inbound') return `${BmPrimaryWhite}`;
|
|
74
|
+
if (state === 'outbound') return `${BmPrimaryBlue}`;
|
|
74
75
|
}
|
|
75
76
|
return `${BmPrimaryWhite}`;
|
|
76
77
|
}};
|
|
77
78
|
color: ${({ state }) => {
|
|
78
79
|
if (state) {
|
|
79
|
-
if (state ===
|
|
80
|
-
if (state ===
|
|
80
|
+
if (state === 'inbound') return `${BmPrimaryBlack}`;
|
|
81
|
+
if (state === 'outbound') return `${BmPrimaryWhite}`;
|
|
81
82
|
}
|
|
82
83
|
return `${BmPrimaryWhite}`;
|
|
83
84
|
}};
|
|
84
85
|
border-radius: ${({ state }) => {
|
|
85
86
|
if (state) {
|
|
86
|
-
if (state ===
|
|
87
|
-
if (state ===
|
|
87
|
+
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
88
|
+
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
88
89
|
}
|
|
89
90
|
return `${BmPrimaryWhite}`;
|
|
90
91
|
}};
|
|
@@ -104,10 +105,10 @@ const MessagesSubDetails = styled.div`
|
|
|
104
105
|
`;
|
|
105
106
|
|
|
106
107
|
const handleState = ({ session }) => {
|
|
107
|
-
if (session ===
|
|
108
|
+
if (session === 'bot') {
|
|
108
109
|
return <BmAvatar size="small" user="chatbot" />;
|
|
109
110
|
}
|
|
110
|
-
if (session ===
|
|
111
|
+
if (session === 'live') {
|
|
111
112
|
return <BmAvatar size="small" user="employee" />;
|
|
112
113
|
}
|
|
113
114
|
};
|
|
@@ -120,22 +121,22 @@ const FileAttachmentWrapper = styled.div`
|
|
|
120
121
|
padding: 1rem;
|
|
121
122
|
background: ${({ state }) => {
|
|
122
123
|
if (state) {
|
|
123
|
-
if (state ===
|
|
124
|
-
if (state ===
|
|
124
|
+
if (state === 'inbound') return `${BmPrimaryWhite}`;
|
|
125
|
+
if (state === 'outbound') return `${BmPrimaryBlue}`;
|
|
125
126
|
}
|
|
126
127
|
return `${BmPrimaryWhite}`;
|
|
127
128
|
}};
|
|
128
129
|
color: ${({ state }) => {
|
|
129
130
|
if (state) {
|
|
130
|
-
if (state ===
|
|
131
|
-
if (state ===
|
|
131
|
+
if (state === 'inbound') return `${BmPrimaryBlack}`;
|
|
132
|
+
if (state === 'outbound') return `${BmPrimaryWhite}`;
|
|
132
133
|
}
|
|
133
134
|
return `${BmPrimaryWhite}`;
|
|
134
135
|
}};
|
|
135
136
|
border-radius: ${({ state }) => {
|
|
136
137
|
if (state) {
|
|
137
|
-
if (state ===
|
|
138
|
-
if (state ===
|
|
138
|
+
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
139
|
+
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
139
140
|
}
|
|
140
141
|
return `${BmPrimaryWhite}`;
|
|
141
142
|
}};
|
|
@@ -152,14 +153,14 @@ const FileAttachmentWrapper = styled.div`
|
|
|
152
153
|
align-items: center;
|
|
153
154
|
color: ${({ state }) => {
|
|
154
155
|
if (state) {
|
|
155
|
-
if (state ===
|
|
156
|
-
if (state ===
|
|
156
|
+
if (state === 'inbound') return `${BmPrimaryBlue}`;
|
|
157
|
+
if (state === 'outbound') return `${BmPrimaryWhite}`;
|
|
157
158
|
}
|
|
158
159
|
return `${BmPrimaryWhite}`;
|
|
159
160
|
}};
|
|
160
161
|
}
|
|
161
|
-
${
|
|
162
|
-
${
|
|
162
|
+
${'' /* max-width: 100%; */}
|
|
163
|
+
${'' /* max-height: 100%; */}
|
|
163
164
|
`;
|
|
164
165
|
|
|
165
166
|
const BmFileAttachment = ({
|
|
@@ -178,21 +179,21 @@ const BmFileAttachment = ({
|
|
|
178
179
|
</FileAttachmentWrapper>
|
|
179
180
|
);
|
|
180
181
|
};
|
|
181
|
-
//Start of Component for Images
|
|
182
|
+
// Start of Component for Images
|
|
182
183
|
export const BmImageWrapper = styled.div`
|
|
183
184
|
display: flex;
|
|
184
185
|
flex-direction: column;
|
|
185
186
|
color: ${({ state }) => {
|
|
186
187
|
if (state) {
|
|
187
|
-
if (state ===
|
|
188
|
-
if (state ===
|
|
188
|
+
if (state === 'inbound') return `${BmPrimaryBlack}`;
|
|
189
|
+
if (state === 'outbound') return `${BmPrimaryWhite}`;
|
|
189
190
|
}
|
|
190
191
|
return `${BmPrimaryWhite}`;
|
|
191
192
|
}};
|
|
192
193
|
border-radius: ${({ state }) => {
|
|
193
194
|
if (state) {
|
|
194
|
-
if (state ===
|
|
195
|
-
if (state ===
|
|
195
|
+
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
196
|
+
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
196
197
|
}
|
|
197
198
|
return `${BmPrimaryWhite}`;
|
|
198
199
|
}};
|
|
@@ -200,7 +201,7 @@ export const BmImageWrapper = styled.div`
|
|
|
200
201
|
`;
|
|
201
202
|
|
|
202
203
|
export const BmImage = styled.img`
|
|
203
|
-
${
|
|
204
|
+
${'' /* Fix width */}
|
|
204
205
|
width: 100%;
|
|
205
206
|
object-fit: cover;
|
|
206
207
|
flex-grow: 1;
|
|
@@ -230,7 +231,7 @@ export const MessageState = styled.div`
|
|
|
230
231
|
}
|
|
231
232
|
`;
|
|
232
233
|
|
|
233
|
-
//End of Component for Images
|
|
234
|
+
// End of Component for Images
|
|
234
235
|
|
|
235
236
|
BmChat.Details = ({
|
|
236
237
|
children,
|
|
@@ -256,7 +257,7 @@ BmChat.Details = ({
|
|
|
256
257
|
<Details state={state} {...rest}>
|
|
257
258
|
{/* Adding for mobile */}
|
|
258
259
|
<MessageState>
|
|
259
|
-
{state ===
|
|
260
|
+
{state === 'inbound' && session && handleState({ state, session })}
|
|
260
261
|
</MessageState>
|
|
261
262
|
<MessageDetails>
|
|
262
263
|
{/* For Images */}
|
|
@@ -281,14 +282,14 @@ BmChat.Details = ({
|
|
|
281
282
|
)}
|
|
282
283
|
<MessagesSubDetails>
|
|
283
284
|
{displayTime && displayTime}
|
|
284
|
-
{status ===
|
|
285
|
+
{status === 'sent' && (
|
|
285
286
|
<BmIcons
|
|
286
287
|
icon={<DoneAll />}
|
|
287
288
|
color={`${BmSecondaryDarkGreen}`}
|
|
288
289
|
size="small"
|
|
289
290
|
/>
|
|
290
291
|
)}
|
|
291
|
-
{status ===
|
|
292
|
+
{status === 'failed' && (
|
|
292
293
|
<BmIcons
|
|
293
294
|
icon={<Done />}
|
|
294
295
|
color={`${BmPrimaryBlack}`}
|
|
@@ -298,7 +299,7 @@ BmChat.Details = ({
|
|
|
298
299
|
</MessagesSubDetails>
|
|
299
300
|
</MessageDetails>
|
|
300
301
|
<MessageState>
|
|
301
|
-
{state ===
|
|
302
|
+
{state === 'outbound' && session && handleState({ state, session })}
|
|
302
303
|
</MessageState>
|
|
303
304
|
</Details>
|
|
304
305
|
</>
|