beem-component 1.5.7 → 1.6.0
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/.eslintrc +62 -0
- package/.prettierrc +6 -0
- package/babel.config.js +9 -10
- package/dist/components/Accordion/Accordion.js +7 -7
- package/dist/components/Accordion/Accordion.stories.js +28 -28
- package/dist/components/Avatars/avatars.js +22 -22
- package/dist/components/Avatars/avatars.stories.js +17 -17
- package/dist/components/BannerCard/bannerCard.stories.js +12 -12
- package/dist/components/BannerCard/bannerCards.js +14 -14
- package/dist/components/Buttons/Stories/basicbutton.stories.js +23 -23
- package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +16 -16
- package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +16 -16
- package/dist/components/Buttons/buttonAlertIcons.js +16 -16
- package/dist/components/Buttons/buttonIconsOnly.js +22 -22
- package/dist/components/Buttons/buttons.js +56 -56
- package/dist/components/Cards/cards.js +1 -1
- package/dist/components/Cards/cards.stories.js +6 -6
- package/dist/components/ChatComponents/ChatBody/chatBody.js +36 -36
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +4 -4
- package/dist/components/ChatComponents/ChatHeader/chatHeader.js +1 -1
- package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +1 -1
- package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
- package/dist/components/ChatComponents/ContactCards/contactCards.js +1 -2
- package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +1 -1
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
- package/dist/components/ChatComponents/InfoTab/infoTab.js +1 -1
- package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +4 -4
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +14 -12
- package/dist/components/Checkbox/checkboxToggler.js +64 -0
- package/dist/components/Checkbox/checkboxToggler.stories.js +92 -0
- package/dist/components/Lists/listBox.js +5 -5
- package/dist/components/Lists/listBox.stories.js +5 -5
- package/dist/components/Lists/listHeader.stories.js +11 -11
- package/dist/components/Lists/listheader.js +4 -4
- package/dist/components/Lists/rowLabels.js +2 -2
- package/dist/components/Lists/rowLabels.stories.js +16 -16
- package/dist/components/Loader/loader.js +7 -7
- package/dist/components/Loader/loader.stories.js +11 -11
- package/dist/components/MessageCounter/MessageCounter.stories.js +13 -13
- package/dist/components/MessageCounter/messageCounter.js +11 -11
- package/dist/components/Modals/modal.js +6 -8
- package/dist/components/Modals/modals.stories.js +6 -6
- package/dist/components/NoteBar/noteBar.js +14 -14
- package/dist/components/NoteBar/noteBar.stories.js +15 -15
- package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +13 -13
- package/dist/components/PerformanceIndicator/performanceIndicator.js +14 -12
- package/dist/components/Pills/pills.js +10 -10
- package/dist/components/Pills/pills.stories.js +19 -21
- package/dist/components/ProfileIcon/ProfileIcon.js +14 -14
- package/dist/components/ProfileIcon/profileIcon.stories.js +16 -16
- package/dist/components/ProgressBar/progressbar.stories.js +6 -8
- package/dist/components/ProgressRing/progressRing.js +19 -19
- package/dist/components/ProgressRing/progressRing.stories.js +14 -14
- package/dist/components/RouteLink/link.js +3 -3
- package/dist/components/RouteLink/link.stories.js +1 -1
- package/dist/components/ScrollBar/scrollBar.js +9 -9
- package/dist/components/SuperFluid/SegmentCard/index.js +2 -2
- package/dist/components/Tabs/tabs.js +6 -6
- package/dist/components/Tabs/tabs.stories.js +17 -17
- package/dist/components/Tags/tags.js +21 -21
- package/dist/components/Tags/tags.stories.js +16 -16
- package/dist/components/breakpoints.js +3 -3
- package/dist/components/checkbox.js +4 -4
- package/dist/components/colors.js +32 -30
- package/dist/components/dropdownButton.js +35 -35
- package/dist/components/examples/InfoAccordion.js +0 -1
- package/dist/components/iconStyles.js +45 -45
- package/dist/components/index.js +32 -16
- package/dist/components/input.js +16 -16
- package/dist/components/typography.js +14 -14
- 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 +48 -45
- 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/dist/components/checkboxToggler.js +0 -50
- package/src/lib/components/checkboxToggler.js +0 -19
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BmButton } from
|
|
4
|
-
import { BmChatHeader } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmButton } from '../../Buttons/buttons';
|
|
4
|
+
import { BmChatHeader } from './chatHeader';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmChatHeader,
|
|
8
|
-
title:
|
|
8
|
+
title: 'components/Chat/MainChat/ChatHeader',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const ChatHeader = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
export const BmColorPicker = styled.div`
|
|
4
4
|
width: 1.429rem;
|
|
@@ -8,4 +8,4 @@ export const BmColorPicker = styled.div`
|
|
|
8
8
|
> *:not(:last-child) {
|
|
9
9
|
margin-right: 0.5rem;
|
|
10
10
|
}
|
|
11
|
-
`;
|
|
11
|
+
`;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BmColorPicker } from './colorPicker';
|
|
2
3
|
|
|
3
4
|
// eslint-disable-next-line import/no-anonymous-default-export
|
|
4
5
|
export default {
|
|
5
6
|
component: BmColorPicker,
|
|
6
|
-
title:
|
|
7
|
+
title: 'components/Chat/Components/ColorPicker',
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export const ColorPicker = () => {
|
|
10
11
|
return (
|
|
11
12
|
<>
|
|
12
|
-
{[
|
|
13
|
+
{['#33b1ba', '#000000', '#F62E48', '#8CC63F'].map((color) => (
|
|
13
14
|
<BmColorPicker key={color} color={color} />
|
|
14
15
|
))}
|
|
15
16
|
</>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { BmSecondaryBlue12 } from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { BmSecondaryBlue12 } from '../../colors';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const BmContactCard = styled.div`
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: row;
|
|
7
7
|
justify-content: space-between;
|
|
@@ -51,9 +51,11 @@ BmContactCard.SubDetails = styled.div`
|
|
|
51
51
|
align-items: flex-start;
|
|
52
52
|
}
|
|
53
53
|
${'' /* TODO */}
|
|
54
|
-
${
|
|
54
|
+
${
|
|
55
|
+
'' /* > :last-child {
|
|
55
56
|
margin-left: auto;
|
|
56
|
-
} */
|
|
57
|
+
} */
|
|
58
|
+
}
|
|
57
59
|
`;
|
|
58
60
|
|
|
59
61
|
export default BmContactCard;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import BmContactCard from
|
|
4
|
-
import BmAvatar from
|
|
5
|
-
import BmCounter from
|
|
6
|
-
import { BmTag } from
|
|
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/tags';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
component: { BmContactCard, BmAvatar, BmTag, BmCounter },
|
|
10
|
-
title:
|
|
10
|
+
title: 'components/Chat/Components/ContactCard',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const ContactCard = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
const BmChatForm = styled.div`
|
|
4
4
|
display: flex;
|
|
@@ -23,7 +23,7 @@ BmChatForm.Label = styled.div`
|
|
|
23
23
|
width: 50%;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
text-overflow: ellipsis;
|
|
26
|
-
|
|
26
|
+
`;
|
|
27
27
|
|
|
28
28
|
BmChatForm.Input = styled.input`
|
|
29
29
|
text-align: right;
|
|
@@ -39,6 +39,6 @@ BmChatForm.Input = styled.input`
|
|
|
39
39
|
text-decoration: none;
|
|
40
40
|
}
|
|
41
41
|
background: transparent;
|
|
42
|
-
|
|
42
|
+
`;
|
|
43
43
|
|
|
44
44
|
export default BmChatForm;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BmAccordion, BmChatForm } from '../..';
|
|
2
3
|
|
|
3
4
|
// eslint-disable-next-line import/no-anonymous-default-export
|
|
4
5
|
export default {
|
|
5
6
|
component: BmChatForm,
|
|
6
|
-
title:
|
|
7
|
+
title: 'components/Chat/Components/FormAccordion',
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export const FormAccordion = () => {
|
|
10
11
|
return (
|
|
11
12
|
<>
|
|
12
|
-
<div style={{ width:
|
|
13
|
+
<div style={{ width: '30%' }}>
|
|
13
14
|
<BmAccordion>
|
|
14
15
|
<BmAccordion.Title>
|
|
15
16
|
<h3>Information</h3>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
const BmInfoTab = styled.div`
|
|
4
4
|
display: flex;
|
|
@@ -19,7 +19,7 @@ BmInfoTab.Content = styled.div`
|
|
|
19
19
|
BmInfoTab.Tabs = styled.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
|
-
|
|
22
|
+
> *:not(:first-child) {
|
|
23
23
|
margin-top: 0.5rem;
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { BmIcons } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MoreVert, Phone } from '@material-ui/icons';
|
|
4
|
+
import BmInfoTab from './infoTab';
|
|
5
|
+
import { BmBtnIcon } from '../../Buttons/buttonIconsOnly';
|
|
6
|
+
import { BmIcons } from '../../iconStyles';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
component: BmInfoTab,
|
|
10
|
-
title:
|
|
10
|
+
title: 'components/Chat/Components/InfoTab',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const InfoTab = () => {
|
|
14
14
|
return (
|
|
15
|
-
<div style={{ maxWidth:
|
|
15
|
+
<div style={{ maxWidth: '30%' }}>
|
|
16
16
|
<BmInfoTab>
|
|
17
17
|
<BmInfoTab.Content>
|
|
18
18
|
<h2>Contact Name</h2>
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmAccordion, BmChatLabels, BmTag } from '../..';
|
|
2
4
|
|
|
3
5
|
// eslint-disable-next-line import/no-anonymous-default-export
|
|
4
6
|
export default {
|
|
5
7
|
component: BmChatLabels,
|
|
6
|
-
title:
|
|
8
|
+
title: 'components/Chat/Components/LabelAccordion',
|
|
7
9
|
};
|
|
8
10
|
|
|
9
11
|
export const LabelAccordion = () => {
|
|
10
12
|
return (
|
|
11
13
|
<>
|
|
12
|
-
<div style={{ width:
|
|
14
|
+
<div style={{ width: '30%' }}>
|
|
13
15
|
<BmAccordion>
|
|
14
16
|
<BmAccordion.Title>
|
|
15
17
|
<h3>Labels</h3>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ContentCopyIcon from
|
|
3
|
-
import { Delete, Edit } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
3
|
+
import { Delete, Edit } from '@material-ui/icons';
|
|
4
|
+
import { BmAccordion, BmChatLabels, BmChatNotes, BmIcons } from '../..';
|
|
4
5
|
|
|
5
6
|
// eslint-disable-next-line import/no-anonymous-default-export
|
|
6
7
|
export default {
|
|
7
8
|
component: BmChatLabels,
|
|
8
|
-
title:
|
|
9
|
+
title: 'components/Chat/Components/NoteAccordion',
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export const NoteAccordion = () => {
|
|
12
13
|
return (
|
|
13
14
|
<>
|
|
14
|
-
<div style={{ width:
|
|
15
|
+
<div style={{ width: '30%' }}>
|
|
15
16
|
<BmAccordion>
|
|
16
17
|
<BmAccordion.Title>
|
|
17
18
|
<h3>Notes</h3>
|
|
@@ -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
|
+
};
|