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,57 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmProfileIcon } from './ProfileIcon';
|
|
4
|
+
import beem from '../../assets/beem.jpeg';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: BmProfileIcon,
|
|
8
|
+
title: 'components/ProfileIcon',
|
|
9
|
+
argTypes: {
|
|
10
|
+
size: {
|
|
11
|
+
options: ['xsmall', 'small', 'medium', 'large'],
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
description: 'Size of the profile',
|
|
14
|
+
defaultValue: { summary: 'large' },
|
|
15
|
+
},
|
|
16
|
+
img: {
|
|
17
|
+
description:
|
|
18
|
+
'Image to be displayed (will not be displayed if content is present)',
|
|
19
|
+
defaultValue: { summary: undefined },
|
|
20
|
+
},
|
|
21
|
+
content: {
|
|
22
|
+
description:
|
|
23
|
+
'Content to be displayed (will not be displayed if image is present)',
|
|
24
|
+
defaultValue: { summary: undefined },
|
|
25
|
+
},
|
|
26
|
+
channel: {
|
|
27
|
+
options: ['whatsapp', 'instagram', 'facebook'],
|
|
28
|
+
control: { type: 'select' },
|
|
29
|
+
description: 'Profile badge',
|
|
30
|
+
defaultValue: { summary: undefined },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const MainProfileIcon = (args) => <BmProfileIcon {...args} />;
|
|
36
|
+
|
|
37
|
+
export const Sample = MainProfileIcon.bind({});
|
|
38
|
+
Sample.args = {
|
|
39
|
+
channel: 'whatsapp',
|
|
40
|
+
size: 'large',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const ImageProfile = MainProfileIcon.bind({});
|
|
44
|
+
ImageProfile.args = {
|
|
45
|
+
channel: 'whatsapp',
|
|
46
|
+
size: 'large',
|
|
47
|
+
img: beem,
|
|
48
|
+
content: undefined,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const ContentProfile = MainProfileIcon.bind({});
|
|
52
|
+
ContentProfile.args = {
|
|
53
|
+
channel: 'whatsapp',
|
|
54
|
+
size: 'large',
|
|
55
|
+
content: <h4>BC</h4>,
|
|
56
|
+
img: undefined,
|
|
57
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
3
|
import Proptypes from 'prop-types';
|
|
4
|
-
import { BmGrey100, BmPrimaryBlue } from
|
|
4
|
+
import { BmGrey100, BmPrimaryBlue } from '../colors';
|
|
5
5
|
|
|
6
6
|
const Container = styled.div`
|
|
7
7
|
height: 0.75rem;
|
|
@@ -36,8 +36,7 @@ export const BmProgressBar = (props) => {
|
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
BmProgressBar.propTypes = {
|
|
41
40
|
value: Proptypes.string.isRequired,
|
|
42
41
|
color: Proptypes.string,
|
|
43
|
-
}
|
|
42
|
+
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BmProgressBar } from
|
|
4
|
-
import { Home } from "@material-ui/icons";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmProgressBar } from './progressbar';
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
component: BmProgressBar,
|
|
8
|
-
title:
|
|
7
|
+
title: 'components/ProgressBar',
|
|
9
8
|
argTypes: {
|
|
10
9
|
value: {
|
|
11
|
-
control: { type:
|
|
12
|
-
description:
|
|
10
|
+
control: { type: 'text' },
|
|
11
|
+
description: 'Progress value',
|
|
13
12
|
},
|
|
14
13
|
color: {
|
|
15
|
-
control: { type:
|
|
16
|
-
description:
|
|
14
|
+
control: { type: 'text' },
|
|
15
|
+
description: 'Color of the progress bar',
|
|
17
16
|
},
|
|
18
17
|
},
|
|
19
18
|
};
|
|
@@ -22,5 +21,5 @@ const MainProgressBar = (args) => <BmProgressBar {...args} />;
|
|
|
22
21
|
|
|
23
22
|
export const ProgressBar = MainProgressBar.bind({});
|
|
24
23
|
ProgressBar.args = {
|
|
25
|
-
value:
|
|
24
|
+
value: '50',
|
|
26
25
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
/* eslint-disable no-shadow */
|
|
2
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import styled from 'styled-components';
|
|
4
5
|
import {
|
|
5
6
|
BmGrey100,
|
|
6
7
|
BmPrimaryBlue,
|
|
7
8
|
BmSecondaryDarkGreen,
|
|
8
9
|
BmPrimaryGold,
|
|
9
10
|
BmSecondaryRed,
|
|
10
|
-
} from
|
|
11
|
+
} from '../colors';
|
|
11
12
|
|
|
12
13
|
const small = 1.429;
|
|
13
14
|
const medium = 1.714;
|
|
@@ -16,18 +17,18 @@ const large = 2.286;
|
|
|
16
17
|
let center;
|
|
17
18
|
let radius;
|
|
18
19
|
let circumference;
|
|
19
|
-
|
|
20
|
+
const strokeWidth = 5;
|
|
20
21
|
let initialSize;
|
|
21
22
|
|
|
22
23
|
const measurement = (size) => {
|
|
23
24
|
let initialSize = size || large * 14;
|
|
24
|
-
if (size ===
|
|
25
|
+
if (size === 'small') {
|
|
25
26
|
initialSize = small * 14;
|
|
26
27
|
}
|
|
27
|
-
if (size ===
|
|
28
|
+
if (size === 'medium') {
|
|
28
29
|
initialSize = medium * 14;
|
|
29
30
|
}
|
|
30
|
-
if (size ===
|
|
31
|
+
if (size === 'large') {
|
|
31
32
|
initialSize = large * 14;
|
|
32
33
|
}
|
|
33
34
|
center = initialSize / 2;
|
|
@@ -38,17 +39,17 @@ const measurement = (size) => {
|
|
|
38
39
|
const ProgressRingWrapper = styled.svg`
|
|
39
40
|
display: flex;
|
|
40
41
|
width: ${({ size }) => {
|
|
41
|
-
if (size ===
|
|
42
|
-
if (size ===
|
|
43
|
-
if (size ===
|
|
44
|
-
if (!size) return
|
|
42
|
+
if (size === 'small') return '1.429rem';
|
|
43
|
+
if (size === 'medium') return '1.714rem';
|
|
44
|
+
if (size === 'large') return '2.286rem';
|
|
45
|
+
if (!size) return '2.286rem';
|
|
45
46
|
return `${size}px`;
|
|
46
47
|
}};
|
|
47
48
|
height: ${({ size }) => {
|
|
48
|
-
if (size ===
|
|
49
|
-
if (size ===
|
|
50
|
-
if (size ===
|
|
51
|
-
if (!size) return
|
|
49
|
+
if (size === 'small') return '1.429rem';
|
|
50
|
+
if (size === 'medium') return '1.714rem';
|
|
51
|
+
if (size === 'large') return '2.286rem';
|
|
52
|
+
if (!size) return '2.286rem';
|
|
52
53
|
return `${size}px`;
|
|
53
54
|
}};
|
|
54
55
|
`;
|
|
@@ -61,10 +62,10 @@ const ProgressRingCircle2 = styled.circle`
|
|
|
61
62
|
fill: none;
|
|
62
63
|
stroke: ${({ variant, progress }) => {
|
|
63
64
|
if (progress) {
|
|
64
|
-
if (variant ===
|
|
65
|
-
if (variant ===
|
|
66
|
-
if (variant ===
|
|
67
|
-
if (variant ===
|
|
65
|
+
if (variant === 'primary') return `${BmPrimaryBlue}`;
|
|
66
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
67
|
+
if (variant === 'warning') return `${BmPrimaryGold}`;
|
|
68
|
+
if (variant === 'danger') return `${BmSecondaryRed}`;
|
|
68
69
|
if (!variant) return `${BmPrimaryBlue}`;
|
|
69
70
|
}
|
|
70
71
|
if (!progress) return `${BmGrey100}`;
|
|
@@ -74,12 +75,12 @@ const ProgressRingCircle2 = styled.circle`
|
|
|
74
75
|
const Text = styled.text`
|
|
75
76
|
font-size: ${() => {
|
|
76
77
|
if (initialSize >= 50 && initialSize < 100) {
|
|
77
|
-
return
|
|
78
|
+
return '1rem';
|
|
78
79
|
}
|
|
79
80
|
if (initialSize >= 100) {
|
|
80
|
-
return
|
|
81
|
+
return '2rem';
|
|
81
82
|
}
|
|
82
|
-
return
|
|
83
|
+
return '0.5rem';
|
|
83
84
|
}};
|
|
84
85
|
text-anchor: middle;
|
|
85
86
|
fill: black;
|
|
@@ -101,7 +102,7 @@ const BmProgressRing = (props) => {
|
|
|
101
102
|
const progressOffset = ((100 - progress) / 100) * circumference;
|
|
102
103
|
setOffset(progressOffset);
|
|
103
104
|
|
|
104
|
-
circleRef.current.style =
|
|
105
|
+
circleRef.current.style = 'transition: stroke-dashoffset 850ms ease-in-out';
|
|
105
106
|
}, [setOffset, progress, offset]);
|
|
106
107
|
|
|
107
108
|
return (
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import BmProgressRing from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import BmProgressRing from './progressRing';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
component: BmProgressRing,
|
|
7
|
-
title:
|
|
7
|
+
title: 'components/ProgressRing',
|
|
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 Progress Ring (Can also be predefined e.g. 50)',
|
|
13
|
+
defaultValue: { summary: 'large' },
|
|
14
14
|
},
|
|
15
15
|
progress: {
|
|
16
|
-
description:
|
|
16
|
+
description: 'Progress Indicator',
|
|
17
17
|
},
|
|
18
18
|
variant: {
|
|
19
|
-
options: [
|
|
20
|
-
control: { type:
|
|
21
|
-
description:
|
|
22
|
-
defaultValue: { summary:
|
|
19
|
+
options: ['primary', 'success', 'warning', 'danger'],
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
description: 'Color of the Progress Ring',
|
|
22
|
+
defaultValue: { summary: 'xsmall' },
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
};
|
|
@@ -28,14 +28,14 @@ const MainProgressRing = (args) => <BmProgressRing {...args} />;
|
|
|
28
28
|
|
|
29
29
|
export const BasicProgressRing = MainProgressRing.bind({});
|
|
30
30
|
BasicProgressRing.args = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
progress: 30,
|
|
32
|
+
variant: 'success',
|
|
33
|
+
size: 'xlarge',
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export const CustomProgressRing = MainProgressRing.bind({});
|
|
37
37
|
CustomProgressRing.args = {
|
|
38
38
|
progress: 50,
|
|
39
|
-
variant:
|
|
40
|
-
size:
|
|
41
|
-
|
|
39
|
+
variant: 'primary',
|
|
40
|
+
size: '40',
|
|
41
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { Link } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { darken } from 'polished';
|
|
4
|
+
import { BmPrimaryBlue } from '../colors';
|
|
5
|
+
import { p } from '../text';
|
|
6
6
|
|
|
7
|
-
//TODO: To be fixed for hover states
|
|
7
|
+
// TODO: To be fixed for hover states
|
|
8
8
|
export const BmRouteLink = styled(Link)`
|
|
9
9
|
${p}
|
|
10
|
-
color: ${(props) =>
|
|
10
|
+
color: ${(props) =>
|
|
11
|
+
props.color ? props.color : `${BmPrimaryBlue} `} !important;
|
|
11
12
|
text-decoration: none;
|
|
12
13
|
&:hover,
|
|
13
14
|
&:focus,
|
|
@@ -16,6 +17,7 @@ export const BmRouteLink = styled(Link)`
|
|
|
16
17
|
&:before {
|
|
17
18
|
font-weight: normal;
|
|
18
19
|
}
|
|
19
|
-
color: ${(props) =>
|
|
20
|
+
color: ${(props) =>
|
|
21
|
+
darken(0.1, props.color ? props.color : `${BmPrimaryBlue}`)} !important;
|
|
20
22
|
}
|
|
21
23
|
`;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BrowserRouter, Switch } from
|
|
4
|
-
import { BmRouteLink } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BrowserRouter, Switch } from 'react-router-dom';
|
|
4
|
+
import { BmRouteLink } from './link';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmRouteLink,
|
|
8
|
-
title:
|
|
8
|
+
title: 'components/RouteLink',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const SampleLink = () => {
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
export const ScrollbarWrapper = styled.div(() => ({
|
|
4
|
-
|
|
5
|
-
background:
|
|
6
|
-
maxHeight:
|
|
7
|
-
display:
|
|
8
|
-
width:
|
|
9
|
-
overflow:
|
|
10
|
-
height:
|
|
4
|
+
'::-webkit-scrollbar-thumb': {
|
|
5
|
+
background: 'blue',
|
|
6
|
+
maxHeight: '10px',
|
|
7
|
+
display: 'block',
|
|
8
|
+
width: '10em',
|
|
9
|
+
overflow: 'auto',
|
|
10
|
+
height: '2em',
|
|
11
11
|
},
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
export const Scrollbar = styled.div`
|
|
15
|
-
::-webkit-scrollbar {
|
|
15
|
+
::-webkit-scrollbar {
|
|
16
16
|
width: 0.714rem !important;
|
|
17
|
-
}
|
|
18
|
-
::-webkit-scrollbar-thumb {
|
|
19
|
-
background-color: #
|
|
20
|
-
}
|
|
17
|
+
}
|
|
18
|
+
::-webkit-scrollbar-thumb {
|
|
19
|
+
background-color: #e2e2e2;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
21
22
|
|
|
22
23
|
export const Content = styled.div(() => ({
|
|
23
|
-
direction:
|
|
24
|
+
direction: 'ltr', // if you want to show the scroll bar on the left
|
|
24
25
|
}));
|
|
25
26
|
|
|
26
27
|
export default ScrollbarWrapper;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
/* eslint-disable react/destructuring-assignment */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CheckCircle } from '@material-ui/icons';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { BmCheckbox } from '../../checkbox';
|
|
6
|
+
import { BmGrey400, BmPrimaryWhite, BmPrimaryBlue } from '../../colors';
|
|
7
|
+
import { BmIcons } from '../../iconStyles';
|
|
7
8
|
|
|
8
9
|
export const BmSegmentCard = styled.div`
|
|
9
10
|
display: flex;
|
|
@@ -27,7 +28,7 @@ export const BmSegmentSelector = styled.div`
|
|
|
27
28
|
border-left: none;
|
|
28
29
|
border-radius: 0rem 0.188rem 0.25rem 0rem;
|
|
29
30
|
margin: 0rem;
|
|
30
|
-
width: 80%;
|
|
31
|
+
width: 80%;
|
|
31
32
|
`;
|
|
32
33
|
|
|
33
34
|
export const BmSegment = styled.div`
|
|
@@ -86,7 +87,7 @@ export const BmSegmentCompleteIcon = (props) => {
|
|
|
86
87
|
<BmIcons
|
|
87
88
|
icon={<CheckCircle />}
|
|
88
89
|
color={props.color ? props.color : `${BmPrimaryBlue}`}
|
|
89
|
-
size={props.size ? props.size :
|
|
90
|
+
size={props.size ? props.size : '5rem'}
|
|
90
91
|
/>
|
|
91
92
|
);
|
|
92
93
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import { BmGrey400, BmPrimaryBlue, BmPrimaryWhite } from
|
|
5
|
-
import { BmIcons } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { BmGrey400, BmPrimaryBlue, BmPrimaryWhite } from '../colors';
|
|
5
|
+
import { BmIcons } from '../iconStyles';
|
|
6
6
|
|
|
7
7
|
const BmTabWrapper = styled.div`
|
|
8
8
|
display: flex;
|
|
@@ -12,10 +12,10 @@ const BmTabWrapper = styled.div`
|
|
|
12
12
|
padding: 1rem;
|
|
13
13
|
background: ${BmPrimaryWhite};
|
|
14
14
|
box-shadow: ${({ state, disabled, stateColor }) => {
|
|
15
|
-
if (state ===
|
|
16
|
-
return `inset 0px -3px 0px ${stateColor
|
|
15
|
+
if (state === 'active' && !disabled) {
|
|
16
|
+
return `inset 0px -3px 0px ${stateColor || BmPrimaryBlue}`;
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return 'none';
|
|
19
19
|
}};
|
|
20
20
|
> *:not(:last-child) {
|
|
21
21
|
margin-right: 0.5rem;
|
|
@@ -38,7 +38,7 @@ const BmTabWrapper = styled.div`
|
|
|
38
38
|
if (!disabled) {
|
|
39
39
|
return `inset 0px -3px 0px ${BmGrey400}`;
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return 'none';
|
|
42
42
|
}};
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
@@ -64,7 +64,7 @@ export const BmTab = ({
|
|
|
64
64
|
{leadingIcon && (
|
|
65
65
|
<BmIcons
|
|
66
66
|
icon={leadingIcon}
|
|
67
|
-
size={size ||
|
|
67
|
+
size={size || 'large'}
|
|
68
68
|
color={disabled ? `${BmGrey400}` : color}
|
|
69
69
|
/>
|
|
70
70
|
)}
|
|
@@ -72,7 +72,7 @@ export const BmTab = ({
|
|
|
72
72
|
{trailingIcon && (
|
|
73
73
|
<BmIcons
|
|
74
74
|
icon={trailingIcon}
|
|
75
|
-
size={size ||
|
|
75
|
+
size={size || 'large'}
|
|
76
76
|
color={disabled ? `${BmGrey400}` : color}
|
|
77
77
|
/>
|
|
78
78
|
)}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import { Favorite, KeyboardArrowDown } from
|
|
3
|
-
import React from
|
|
4
|
-
import { BmTab } from
|
|
2
|
+
import { Favorite, KeyboardArrowDown } from '@material-ui/icons';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { BmTab } from './tabs';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmTab,
|
|
8
|
-
title:
|
|
8
|
+
title: 'components/Tabs',
|
|
9
9
|
argTypes: {
|
|
10
10
|
color: {
|
|
11
|
-
control: { type:
|
|
12
|
-
description:
|
|
11
|
+
control: { type: 'text' },
|
|
12
|
+
description: 'Color of the Icons and Text',
|
|
13
13
|
},
|
|
14
14
|
state: {
|
|
15
|
-
options: [
|
|
16
|
-
control: { type:
|
|
17
|
-
description:
|
|
15
|
+
options: ['active'],
|
|
16
|
+
control: { type: 'select' },
|
|
17
|
+
description: 'State of the Tabs (optional)',
|
|
18
18
|
},
|
|
19
19
|
stateColor: {
|
|
20
|
-
control: { type:
|
|
21
|
-
description:
|
|
22
|
-
defaultValue: { summary:
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
description: 'Color of the active state',
|
|
22
|
+
defaultValue: { summary: 'primary blue' },
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
25
|
-
options: [
|
|
26
|
-
control: { type:
|
|
27
|
-
description:
|
|
28
|
-
defaultValue: { summary:
|
|
25
|
+
options: ['small', 'medium', 'large'],
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
description: 'Size of the icons',
|
|
28
|
+
defaultValue: { summary: 'large' },
|
|
29
29
|
},
|
|
30
30
|
disabled: {
|
|
31
|
-
description:
|
|
31
|
+
description: 'Disabled tab',
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
};
|
|
@@ -41,7 +41,7 @@ BasicTab.args = {
|
|
|
41
41
|
leadingIcon: <Favorite />,
|
|
42
42
|
trailingIcon: <KeyboardArrowDown />,
|
|
43
43
|
disabled: false,
|
|
44
|
-
state:
|
|
44
|
+
state: 'active',
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export const DisabledTab = MainTab.bind({});
|
|
@@ -58,6 +58,6 @@ ColoredTab.args = {
|
|
|
58
58
|
leadingIcon: <Favorite />,
|
|
59
59
|
trailingIcon: <KeyboardArrowDown />,
|
|
60
60
|
disabled: false,
|
|
61
|
-
state:
|
|
62
|
-
stateColor:
|
|
61
|
+
state: 'active',
|
|
62
|
+
stateColor: 'red',
|
|
63
63
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
/* eslint-disable react/no-children-prop */
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { Clear } from '@material-ui/icons';
|
|
7
|
+
import { BmIcons } from '../iconStyles';
|
|
5
8
|
import {
|
|
6
9
|
BmPrimaryWhite,
|
|
7
10
|
BmSecondaryDarkGreen,
|
|
@@ -10,11 +13,10 @@ import {
|
|
|
10
13
|
BmGrey100,
|
|
11
14
|
BmGrey400,
|
|
12
15
|
BmPrimaryGold,
|
|
13
|
-
} from
|
|
14
|
-
import { Clear } from "@material-ui/icons";
|
|
16
|
+
} from '../colors';
|
|
15
17
|
|
|
16
18
|
const Color = ({ variant, color }) => {
|
|
17
|
-
if (variant ===
|
|
19
|
+
if (variant === 'success' || variant === 'warning' || variant === 'danger') {
|
|
18
20
|
return `${BmPrimaryWhite}`;
|
|
19
21
|
}
|
|
20
22
|
if (!variant && color) {
|
|
@@ -24,12 +26,12 @@ const Color = ({ variant, color }) => {
|
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
const BeemTag = styled.button`
|
|
27
|
-
${
|
|
29
|
+
${'' /* display: flex; */}
|
|
28
30
|
display: ${({ closeButton, show }) => {
|
|
29
31
|
if (!closeButton) {
|
|
30
|
-
return
|
|
32
|
+
return 'flex';
|
|
31
33
|
}
|
|
32
|
-
return show ?
|
|
34
|
+
return show ? 'flex' : 'none';
|
|
33
35
|
}};
|
|
34
36
|
flex-direction: row;
|
|
35
37
|
justify-content: center;
|
|
@@ -37,20 +39,20 @@ const BeemTag = styled.button`
|
|
|
37
39
|
padding: 0.25rem 0.5rem;
|
|
38
40
|
border-radius: 0.25rem;
|
|
39
41
|
background: ${({ variant }) => {
|
|
40
|
-
if (variant ===
|
|
41
|
-
if (variant ===
|
|
42
|
-
if (variant ===
|
|
43
|
-
if (variant ===
|
|
44
|
-
if (variant ===
|
|
42
|
+
if (variant === 'neutral') return `${BmGrey100}`;
|
|
43
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
44
|
+
if (variant === 'warning') return `${BmPrimaryGold}`;
|
|
45
|
+
if (variant === 'danger') return `${BmSecondaryRed}`;
|
|
46
|
+
if (variant === 'light') return `${BmPrimaryWhite}`;
|
|
45
47
|
if (!variant) return `${BmGrey100}`;
|
|
46
48
|
}};
|
|
47
49
|
border: 0.071rem solid
|
|
48
50
|
${({ variant }) => {
|
|
49
|
-
if (variant ===
|
|
50
|
-
if (variant ===
|
|
51
|
-
if (variant ===
|
|
52
|
-
if (variant ===
|
|
53
|
-
if (variant ===
|
|
51
|
+
if (variant === 'neutral') return `${BmGrey100}`;
|
|
52
|
+
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
53
|
+
if (variant === 'warning') return `${BmPrimaryGold}`;
|
|
54
|
+
if (variant === 'danger') return `${BmSecondaryRed}`;
|
|
55
|
+
if (variant === 'light') return `${BmGrey400}`;
|
|
54
56
|
return `${BmGrey100}`;
|
|
55
57
|
}};
|
|
56
58
|
> * {
|
|
@@ -96,7 +98,7 @@ export const BmTag = (props) => {
|
|
|
96
98
|
icon={leadingIcon}
|
|
97
99
|
variant={variant}
|
|
98
100
|
color={Color({ color, variant })}
|
|
99
|
-
size={size ||
|
|
101
|
+
size={size || 'small'}
|
|
100
102
|
/>
|
|
101
103
|
)}
|
|
102
104
|
{children}
|
|
@@ -105,15 +107,15 @@ export const BmTag = (props) => {
|
|
|
105
107
|
icon={trailingIcon}
|
|
106
108
|
disabled={disabled}
|
|
107
109
|
color={Color({ color, variant })}
|
|
108
|
-
size={size ||
|
|
110
|
+
size={size || 'small'}
|
|
109
111
|
/>
|
|
110
112
|
)}
|
|
111
113
|
{closeButton && (
|
|
112
114
|
<BmIcons
|
|
113
115
|
icon={<Clear />}
|
|
114
116
|
color={Color({ color, variant })}
|
|
115
|
-
size={size
|
|
116
|
-
style={{ marginLeft:
|
|
117
|
+
size={size || 'small'}
|
|
118
|
+
style={{ marginLeft: 'auto' }}
|
|
117
119
|
onClick={() => onHide && onHide(setToggle(!toggle))}
|
|
118
120
|
/>
|
|
119
121
|
)}
|