beem-component 1.5.6 → 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/assets/fb.png +0 -0
- package/dist/assets/insta.png +0 -0
- package/dist/assets/wa.png +0 -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 +4 -4
- 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 +38 -57
- package/dist/components/Modals/modals.stories.js +38 -29
- 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 +96 -0
- package/dist/components/ProfileIcon/profileIcon.stories.js +82 -0
- 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 +137 -0
- package/dist/components/examples/InfoAccordion.js +23 -0
- package/dist/components/examples/chatBodyExample.js +68 -0
- package/dist/components/examples/selectExample.js +63 -0
- package/dist/components/globalStyles.js +1 -5
- package/dist/components/iconStyles.js +56 -58
- package/dist/components/index.js +35 -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/text.js +15 -6
- package/dist/components/typography.js +14 -14
- package/dist/components/wrapper.js +8 -8
- package/package.json +54 -30
- package/src/App.js +31 -175
- package/src/index.js +6 -8
- package/src/lib/assets/fb.png +0 -0
- package/src/lib/assets/insta.png +0 -0
- package/src/lib/assets/wa.png +0 -0
- 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 +33 -23
- package/src/lib/components/Modals/modals.stories.js +34 -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 +76 -0
- package/src/lib/components/ProfileIcon/profileIcon.stories.js +57 -0
- 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/App.js +181 -0
- package/src/{InfoAccordion.js → lib/components/examples/InfoAccordion.js} +1 -1
- package/src/{App1.js → lib/components/examples/chatBodyExample.js} +2 -2
- package/src/{App copy.js → lib/components/examples/selectExample.js} +0 -0
- package/src/lib/components/globalStyles.js +4 -5
- package/src/lib/components/iconStyles.js +45 -48
- package/src/lib/components/index.js +48 -45
- package/src/lib/components/input.js +20 -20
- package/src/lib/components/text.js +17 -3
- 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/dist/components/example.js +0 -47
- package/dist/components/sidebar.js +0 -32
- package/dist/components/tabs.js +0 -106
- package/dist/components/tags.js +0 -100
- package/dist/images/azam.png +0 -0
- package/dist/images/azam1.png +0 -0
- package/src/ChatHeader.js +0 -22
- package/src/CustomerInfo.js +0 -46
- package/src/MainChat.js +0 -41
- package/src/SideBar.js +0 -81
- package/src/lib/components/checkboxToggler.js +0 -19
- package/src/lib/components/example.js +0 -30
- package/src/lib/components/sidebar.js +0 -33
- package/src/lib/components/tabs.js +0 -123
- package/src/lib/components/tags.js +0 -101
- package/src/lib/images/azam.png +0 -0
- package/src/lib/images/azam1.png +0 -0
- package/src/list.scss +0 -4
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import {
|
|
5
|
+
BmGrey400,
|
|
6
|
+
BmSecondaryDarkGreen,
|
|
7
|
+
BmGrey200,
|
|
8
|
+
BmBgGrey38,
|
|
9
|
+
} from '../colors';
|
|
10
|
+
|
|
11
|
+
const CheckBoxWrapper = styled.div`
|
|
12
|
+
position: relative;
|
|
13
|
+
align-items: center;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
> *:not(:last-child) {
|
|
17
|
+
margin-right: 0.5rem;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const CheckBoxLabel = styled.label`
|
|
21
|
+
align-items: center;
|
|
22
|
+
display: flex;
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 3rem;
|
|
25
|
+
height: 1.25rem;
|
|
26
|
+
border-radius: 1.25rem;
|
|
27
|
+
background: ${(props) => (props.disabled ? BmGrey400 : BmBgGrey38)};
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
&::after {
|
|
30
|
+
content: '';
|
|
31
|
+
display: block;
|
|
32
|
+
border-radius: 100%;
|
|
33
|
+
width: 1.75rem;
|
|
34
|
+
height: 1.75rem;
|
|
35
|
+
background: ${BmGrey200};
|
|
36
|
+
transition: 0.2s;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const Label = styled.label`
|
|
41
|
+
align-items: center;
|
|
42
|
+
display: flex;
|
|
43
|
+
position: relative;
|
|
44
|
+
`;
|
|
45
|
+
const CheckBox = styled.input`
|
|
46
|
+
opacity: 0;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
${({ checked, disabled }) =>
|
|
49
|
+
!disabled &&
|
|
50
|
+
checked !== undefined &&
|
|
51
|
+
checked === true &&
|
|
52
|
+
`
|
|
53
|
+
&:checked + ${CheckBoxLabel} {
|
|
54
|
+
background: ${BmSecondaryDarkGreen};
|
|
55
|
+
&::after {
|
|
56
|
+
content: '';
|
|
57
|
+
display: block;
|
|
58
|
+
width: 1.75rem;
|
|
59
|
+
height: 1.75rem;
|
|
60
|
+
margin-left: 1.25rem;
|
|
61
|
+
transition: 0.2s;
|
|
62
|
+
} `}
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const BmCheckboxToggle = ({ checked, onChange, disabled, label }) => {
|
|
67
|
+
return (
|
|
68
|
+
<CheckBoxWrapper>
|
|
69
|
+
<Label htmlFor={label} disabled={disabled}>
|
|
70
|
+
{label}
|
|
71
|
+
</Label>
|
|
72
|
+
<CheckBox
|
|
73
|
+
id={label || 'checkbox'}
|
|
74
|
+
type="checkbox"
|
|
75
|
+
checked={checked}
|
|
76
|
+
onChange={() => onChange && onChange(!checked)}
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
hidden
|
|
79
|
+
/>
|
|
80
|
+
<CheckBoxLabel htmlFor={label || 'checkbox'} disabled={disabled} />
|
|
81
|
+
</CheckBoxWrapper>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
BmCheckboxToggle.propTypes = {
|
|
86
|
+
checked: PropTypes.bool.isRequired,
|
|
87
|
+
label: PropTypes.object,
|
|
88
|
+
onChange: PropTypes.func.isRequired,
|
|
89
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { BmCheckboxToggle } from './checkboxToggler';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: BmCheckboxToggle,
|
|
7
|
+
title: 'components/CheckboxToggler',
|
|
8
|
+
argTypes: {
|
|
9
|
+
label: {
|
|
10
|
+
description: 'Label (optional))',
|
|
11
|
+
defaultValue: { summary: undefined },
|
|
12
|
+
},
|
|
13
|
+
checked: {
|
|
14
|
+
description:
|
|
15
|
+
'If true, the checkbox is set to checked. If false, it is not checked.',
|
|
16
|
+
defaultValue: { summary: undefined },
|
|
17
|
+
control: { type: 'boolean' },
|
|
18
|
+
},
|
|
19
|
+
onChange: {
|
|
20
|
+
description: 'Invoked when the user clicks or drags the toggler.',
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
description: 'for disabling the checkbox toggler',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const Sample = () => {
|
|
28
|
+
const [checked, setChecked] = useState(false);
|
|
29
|
+
return (
|
|
30
|
+
<BmCheckboxToggle
|
|
31
|
+
checked={checked}
|
|
32
|
+
onChange={() => setChecked(!checked)}
|
|
33
|
+
label={<h4>Field Label</h4>}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const DisabledToggler = () => {
|
|
39
|
+
const [checked, setChecked] = useState(false);
|
|
40
|
+
return (
|
|
41
|
+
<BmCheckboxToggle
|
|
42
|
+
checked={checked}
|
|
43
|
+
onChange={() => setChecked(!checked)}
|
|
44
|
+
label={<h4>Field Label</h4>}
|
|
45
|
+
disabled
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from
|
|
2
|
-
import styled from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { BmGrey400, BmPrimaryWhite } from '../colors';
|
|
5
5
|
|
|
6
6
|
const show = (isOpen) => {
|
|
7
7
|
if (isOpen !== undefined) {
|
|
@@ -16,7 +16,7 @@ const show = (isOpen) => {
|
|
|
16
16
|
margin-top: 0.5rem`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return 'flex';
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const BmListBoxWrapper = styled.div`
|
|
@@ -40,9 +40,9 @@ export const BmListBox = ({ children, showList, setShowList, ...rest }) => {
|
|
|
40
40
|
setShowList(false);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
document.addEventListener(
|
|
43
|
+
document.addEventListener('mousedown', checkIfClickedOutside);
|
|
44
44
|
return () => {
|
|
45
|
-
document.removeEventListener(
|
|
45
|
+
document.removeEventListener('mousedown', checkIfClickedOutside);
|
|
46
46
|
};
|
|
47
47
|
}, [setShowList, showList]);
|
|
48
48
|
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React, { useState } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { BmRowLabel } from
|
|
6
|
-
import { BmButton } from
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { KeyboardArrowRight } from '@material-ui/icons';
|
|
4
|
+
import { BmListBox } from './listBox';
|
|
5
|
+
import { BmRowLabel } from './rowLabels';
|
|
6
|
+
import { BmButton } from '../Buttons/buttons';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
component: BmListBox,
|
|
10
|
-
title:
|
|
10
|
+
title: 'components/Lists/ListBox',
|
|
11
11
|
argTypes: {
|
|
12
12
|
showList: {
|
|
13
|
-
description:
|
|
14
|
-
"Used for handling the display of listbox",
|
|
13
|
+
description: 'Used for handling the display of listbox',
|
|
15
14
|
},
|
|
16
15
|
setShowList: {
|
|
17
|
-
description:
|
|
18
|
-
"Function for handling the display of listbox",
|
|
16
|
+
description: 'Function for handling the display of listbox',
|
|
19
17
|
},
|
|
20
|
-
|
|
21
18
|
},
|
|
22
19
|
};
|
|
23
20
|
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Favorite } from '@material-ui/icons';
|
|
4
|
+
import { BmListHeader } from './listheader';
|
|
5
|
+
import '../../../main.scss';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
component: BmListHeader,
|
|
9
|
-
title:
|
|
10
|
-
|
|
9
|
+
title: 'components/Lists/ListHeader',
|
|
10
|
+
argTypes: {
|
|
11
11
|
size: {
|
|
12
|
-
options: [
|
|
13
|
-
control: { type:
|
|
14
|
-
description:
|
|
15
|
-
defaultValue: { summary:
|
|
12
|
+
options: ['small', 'medium', 'large'],
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
description: 'Size of the trailing icon',
|
|
15
|
+
defaultValue: { summary: 'large' },
|
|
16
16
|
},
|
|
17
17
|
trailingIcon: {
|
|
18
|
-
description:
|
|
18
|
+
description: 'Material-UI Icon(optional)',
|
|
19
19
|
defaultValue: { summary: undefined },
|
|
20
20
|
},
|
|
21
21
|
color: {
|
|
22
|
-
description:
|
|
22
|
+
description: 'Color of the Icon and Border',
|
|
23
23
|
},
|
|
24
24
|
children: {
|
|
25
|
-
description:
|
|
25
|
+
description: 'List header text',
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { BmPrimaryBlack, BmPrimaryBlue } from '../colors';
|
|
5
|
+
import { BmIcons } from '../iconStyles';
|
|
6
6
|
|
|
7
7
|
export const Container = styled.div`
|
|
8
8
|
display: flex;
|
|
@@ -11,7 +11,7 @@ export const Container = styled.div`
|
|
|
11
11
|
padding: 0rem 1rem 1rem 1rem;
|
|
12
12
|
border-bottom: 0.125rem solid
|
|
13
13
|
${({ color }) => {
|
|
14
|
-
return color
|
|
14
|
+
return color || `${BmPrimaryBlue}`;
|
|
15
15
|
}};
|
|
16
16
|
`;
|
|
17
17
|
|
|
@@ -29,7 +29,7 @@ export const BmListHeader = ({
|
|
|
29
29
|
<BmIcons
|
|
30
30
|
icon={trailingIcon}
|
|
31
31
|
color={color || `${BmPrimaryBlack}`}
|
|
32
|
-
size={size ||
|
|
32
|
+
size={size || 'large'}
|
|
33
33
|
/>
|
|
34
34
|
)}
|
|
35
35
|
</Container>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { BmGrey100, BmPrimaryBlack, BmPrimaryWhite } from '../colors';
|
|
5
|
+
import { BmIcons } from '../iconStyles';
|
|
6
6
|
|
|
7
7
|
export const Container = styled.div`
|
|
8
8
|
display: flex;
|
|
@@ -74,7 +74,7 @@ export const BmRowLabel = ({
|
|
|
74
74
|
<BmIcons
|
|
75
75
|
icon={trailingIcon}
|
|
76
76
|
color={color || `${BmPrimaryBlack}}`}
|
|
77
|
-
size={size ||
|
|
77
|
+
size={size || 'small'}
|
|
78
78
|
/>
|
|
79
79
|
)}
|
|
80
80
|
</RightContainer>
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Favorite, KeyboardArrowRight } from '@material-ui/icons';
|
|
4
|
+
import { BmRowLabel } from './rowLabels';
|
|
5
|
+
import '../../../main.scss';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
component: BmRowLabel,
|
|
9
|
-
title:
|
|
10
|
-
|
|
9
|
+
title: 'components/Lists/RowLabels',
|
|
10
|
+
argTypes: {
|
|
11
11
|
size: {
|
|
12
|
-
options: [
|
|
13
|
-
control: { type:
|
|
14
|
-
description:
|
|
15
|
-
defaultValue: { summary:
|
|
12
|
+
options: ['small', 'medium', 'large'],
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
description: 'Size of the icons',
|
|
15
|
+
defaultValue: { summary: 'small' },
|
|
16
16
|
},
|
|
17
17
|
trailingIcon: {
|
|
18
|
-
description:
|
|
18
|
+
description: 'Material-UI Icon(optional)',
|
|
19
19
|
defaultValue: { summary: undefined },
|
|
20
20
|
},
|
|
21
21
|
leadingIcon: {
|
|
22
|
-
description:
|
|
22
|
+
description: 'Material-UI Icon(optional)',
|
|
23
23
|
defaultValue: { summary: undefined },
|
|
24
24
|
},
|
|
25
25
|
color: {
|
|
26
|
-
description:
|
|
26
|
+
description: 'Color of the Icons',
|
|
27
27
|
},
|
|
28
28
|
children: {
|
|
29
|
-
description:
|
|
29
|
+
description: 'Row Label text',
|
|
30
30
|
},
|
|
31
31
|
label: {
|
|
32
|
-
description:
|
|
32
|
+
description: 'Label Text',
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
};
|
|
@@ -52,8 +52,8 @@ LabelIcons.args = {
|
|
|
52
52
|
...TextLabel.args,
|
|
53
53
|
trailingIcon: <KeyboardArrowRight />,
|
|
54
54
|
leadingIcon: <Favorite />,
|
|
55
|
-
size:
|
|
55
|
+
size: 'large',
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
//TODO: add checkbox button example
|
|
59
|
-
//TODO: size not working
|
|
58
|
+
// TODO: add checkbox button example
|
|
59
|
+
// TODO: size not working
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import Proptypes from 'prop-types';
|
|
3
|
-
import CircularProgress from
|
|
4
|
-
import styled from
|
|
5
|
-
import { withStyles } from
|
|
3
|
+
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
6
6
|
import {
|
|
7
7
|
BmPrimaryBlue,
|
|
8
8
|
BmSecondaryDarkGreen,
|
|
9
9
|
BmSecondaryRed,
|
|
10
10
|
BmPrimaryGold,
|
|
11
|
-
} from
|
|
11
|
+
} from '../colors';
|
|
12
12
|
|
|
13
13
|
const style = {
|
|
14
14
|
colorPrimary: {
|
|
15
15
|
color: ({ type }) => {
|
|
16
|
-
if (type ===
|
|
17
|
-
if (type ===
|
|
18
|
-
if (type ===
|
|
16
|
+
if (type === 'success') return `${BmSecondaryDarkGreen}`;
|
|
17
|
+
if (type === 'warning') return `${BmPrimaryGold}`;
|
|
18
|
+
if (type === 'error') return `${BmSecondaryRed}`;
|
|
19
19
|
return `${BmPrimaryBlue}`;
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const BmLoader = withStyles(style)(({ size, ...rest }) => {
|
|
25
|
-
let defaultSize = size ||
|
|
25
|
+
let defaultSize = size || '2.286rem';
|
|
26
26
|
if (size) {
|
|
27
|
-
if (size ===
|
|
28
|
-
if (size ===
|
|
29
|
-
if (size ===
|
|
27
|
+
if (size === 'large') defaultSize = '2.286rem';
|
|
28
|
+
if (size === 'medium') defaultSize = '1.714rem';
|
|
29
|
+
if (size === 'small') defaultSize = '1.429rem';
|
|
30
30
|
}
|
|
31
31
|
return <CircularProgress action size={defaultSize} {...rest} />;
|
|
32
32
|
});
|
|
@@ -40,4 +40,4 @@ export const Loader = styled.div`
|
|
|
40
40
|
BmLoader.propTypes = {
|
|
41
41
|
size: Proptypes.string,
|
|
42
42
|
type: Proptypes.string,
|
|
43
|
-
}
|
|
43
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BmLoader } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmLoader } from './loader';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
component: BmLoader,
|
|
7
|
-
title:
|
|
7
|
+
title: 'components/Loader',
|
|
8
8
|
argTypes: {
|
|
9
9
|
size: {
|
|
10
|
-
options: [
|
|
11
|
-
control: { type:
|
|
12
|
-
description:
|
|
13
|
-
defaultValue: { summary:
|
|
10
|
+
options: ['small', 'medium', 'large'],
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
description: 'Size of the loader (Can also be predefined e.g. 10px)',
|
|
13
|
+
defaultValue: { summary: 'large' },
|
|
14
14
|
},
|
|
15
15
|
type: {
|
|
16
|
-
options: [
|
|
17
|
-
control: { type:
|
|
18
|
-
description:
|
|
19
|
-
defaultValue: { summary:
|
|
16
|
+
options: ['success', 'warning', 'error'],
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
description: 'Type of loader',
|
|
19
|
+
defaultValue: { summary: 'Beem default loader' },
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
};
|
|
@@ -25,6 +25,6 @@ const MainLoader = (args) => <BmLoader {...args} />;
|
|
|
25
25
|
|
|
26
26
|
export const Loader = MainLoader.bind({});
|
|
27
27
|
Loader.args = {
|
|
28
|
-
type:
|
|
29
|
-
size:
|
|
30
|
-
};
|
|
28
|
+
type: 'success',
|
|
29
|
+
size: 'small',
|
|
30
|
+
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { text, select } from '@storybook/addon-knobs';
|
|
4
|
+
import BmCounter from './messageCounter';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmCounter,
|
|
8
|
-
title:
|
|
8
|
+
title: 'components/MessageCounter',
|
|
9
9
|
argTypes: {
|
|
10
10
|
size: {
|
|
11
|
-
options: [
|
|
12
|
-
control: { type:
|
|
13
|
-
description:
|
|
14
|
-
defaultValue: { summary:
|
|
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
15
|
},
|
|
16
16
|
children: {
|
|
17
|
-
description:
|
|
17
|
+
description: 'Counter Text',
|
|
18
18
|
defaultValue: { summary: undefined },
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const optionSize = {
|
|
24
|
-
small:
|
|
25
|
-
medium:
|
|
26
|
-
large:
|
|
24
|
+
small: 'small',
|
|
25
|
+
medium: 'medium',
|
|
26
|
+
large: 'large',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const MessageCounter = () => {
|
|
30
30
|
return (
|
|
31
|
-
<BmCounter size={select(
|
|
32
|
-
{text(
|
|
31
|
+
<BmCounter size={select('size', optionSize, 'large')}>
|
|
32
|
+
{text('children', '00')}
|
|
33
33
|
</BmCounter>
|
|
34
34
|
);
|
|
35
35
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import { BmPrimaryWhite, BmPrimaryBlue } from
|
|
4
|
-
import { h3, h4, p } from
|
|
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
5
|
|
|
6
6
|
const BmCounter = styled.div`
|
|
7
7
|
display: flex;
|
|
@@ -10,23 +10,23 @@ const BmCounter = styled.div`
|
|
|
10
10
|
text-align: center;
|
|
11
11
|
color: ${BmPrimaryWhite};
|
|
12
12
|
width: ${({ size }) => {
|
|
13
|
-
if (size ===
|
|
14
|
-
if (size ===
|
|
15
|
-
if (size ===
|
|
16
|
-
if (!size) return
|
|
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
17
|
return size;
|
|
18
18
|
}};
|
|
19
19
|
height: ${({ size }) => {
|
|
20
|
-
if (size ===
|
|
21
|
-
if (size ===
|
|
22
|
-
if (size ===
|
|
23
|
-
if (!size) return
|
|
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
24
|
return size;
|
|
25
25
|
}};
|
|
26
26
|
${({ size }) => {
|
|
27
|
-
if (size ===
|
|
28
|
-
if (size ===
|
|
29
|
-
if (size ===
|
|
27
|
+
if (size === 'large') return `${h3}`;
|
|
28
|
+
if (size === 'medium') return `${h4}`;
|
|
29
|
+
if (size === 'small') return `${p}`;
|
|
30
30
|
return `${p}`;
|
|
31
31
|
}}
|
|
32
32
|
border-radius: 50%;
|
|
@@ -39,4 +39,4 @@ BmCounter.propTypes = {
|
|
|
39
39
|
size: PropTypes.string,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export default BmCounter;
|
|
42
|
+
export default BmCounter;
|