beem-component 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +17 -0
- package/.eslintrc +62 -0
- package/.prettierrc +6 -0
- package/dist/components/Accordion/Accordion.js +31 -64
- package/dist/components/Accordion/Accordion.stories.js +29 -29
- package/dist/components/Avatars/avatars.js +31 -46
- package/dist/components/Avatars/avatars.stories.js +18 -18
- package/dist/components/BannerCard/bannerCard.stories.js +14 -14
- package/dist/components/BannerCard/bannerCards.js +30 -48
- package/dist/components/Buttons/Stories/basicbutton.stories.js +24 -24
- package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
- package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +17 -17
- package/dist/components/Buttons/buttonAlertIcons.js +28 -44
- package/dist/components/Buttons/buttonDropdown copy.js +15 -18
- package/dist/components/Buttons/buttonDropdown.js +2 -2
- package/dist/components/Buttons/buttonIconsOnly.js +35 -49
- package/dist/components/Buttons/buttons.js +75 -86
- package/dist/components/Cards/cards.js +15 -11
- package/dist/components/Cards/cards.stories.js +8 -8
- package/dist/components/ChatComponents/ChatBody/chatBody.js +80 -69
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +6 -6
- package/dist/components/ChatComponents/ChatBody/sessionDetails.js +9 -16
- package/dist/components/ChatComponents/ChatHeader/chatHeader.js +5 -7
- package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -3
- package/dist/components/ChatComponents/ColorPicker/colorPicker.js +5 -7
- package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
- package/dist/components/ChatComponents/ContactCards/contactCards.js +15 -12
- package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +3 -3
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +14 -10
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
- package/dist/components/ChatComponents/InfoTab/infoTab.js +11 -9
- package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +6 -6
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +5 -7
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +11 -9
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +15 -13
- package/dist/components/Chats/chat.js +41 -32
- package/dist/components/Chats/chatInput.js +18 -14
- package/dist/components/Chats/chatwrapper.js +20 -12
- package/dist/components/Checkbox/checkboxToggler.js +61 -0
- package/dist/components/Checkbox/checkboxToggler.stories.js +81 -0
- package/dist/components/Lists/listBox.js +14 -30
- package/dist/components/Lists/listBox.stories.js +12 -23
- package/dist/components/Lists/listHeader.stories.js +13 -13
- package/dist/components/Lists/listheader.js +12 -27
- package/dist/components/Lists/rowLabels.js +19 -30
- package/dist/components/Lists/rowLabels.stories.js +22 -25
- package/dist/components/Loader/loader.js +17 -31
- package/dist/components/Loader/loader.stories.js +13 -13
- package/dist/components/MainWrapper/index.js +5 -7
- package/dist/components/MessageCounter/MessageCounter.stories.js +14 -14
- package/dist/components/MessageCounter/messageCounter.js +16 -18
- package/dist/components/Modals/modal.js +37 -57
- package/dist/components/Modals/modals.stories.js +15 -28
- package/dist/components/NoteBar/noteBar.js +28 -57
- package/dist/components/NoteBar/noteBar.stories.js +17 -17
- package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
- package/dist/components/PerformanceIndicator/performanceIndicator.js +21 -34
- package/dist/components/Pills/pills.js +24 -56
- package/dist/components/Pills/pills.stories.js +21 -23
- package/dist/components/ProfileIcon/ProfileIcon.js +28 -29
- package/dist/components/ProfileIcon/profileIcon.stories.js +18 -18
- package/dist/components/ProgressBar/progressbar.js +15 -17
- package/dist/components/ProgressBar/progressbar.stories.js +8 -10
- package/dist/components/ProgressRing/progressRing.js +38 -54
- package/dist/components/ProgressRing/progressRing.stories.js +16 -16
- package/dist/components/RouteLink/link.js +8 -10
- package/dist/components/RouteLink/link.stories.js +3 -3
- package/dist/components/ScrollBar/scrollBar.js +19 -17
- package/dist/components/SuperFluid/Content/index.js +5 -7
- package/dist/components/SuperFluid/ContentTitle.js/index.js +14 -10
- package/dist/components/SuperFluid/SegmentCard/index.js +22 -13
- package/dist/components/Tabs/tabs.js +16 -35
- package/dist/components/Tabs/tabs.stories.js +19 -19
- package/dist/components/Tags/tags.js +33 -65
- package/dist/components/Tags/tags.stories.js +18 -18
- package/dist/components/breakpoints.js +3 -3
- package/dist/components/chatHeader.js +17 -11
- package/dist/components/checkbox.js +27 -26
- package/dist/components/colors.js +32 -30
- package/dist/components/contacts.js +39 -25
- package/dist/components/dropdown.js +29 -35
- package/dist/components/dropdownButton.js +50 -53
- package/dist/components/dropdownItems.js +26 -19
- package/dist/components/examples/App.js +2 -2
- package/dist/components/examples/InfoAccordion.js +2 -3
- package/dist/components/examples/chatBodyExample.js +1 -5
- package/dist/components/examples/selectExample.js +6 -20
- package/dist/components/globalStyles.js +1 -5
- package/dist/components/iconStyles.js +56 -58
- package/dist/components/index.js +27 -23
- package/dist/components/input.js +33 -36
- package/dist/components/logo.js +9 -16
- package/dist/components/navbar.js +24 -13
- package/dist/components/search.js +20 -21
- package/dist/components/typography.js +14 -14
- package/dist/components/wrapper.js +8 -8
- package/package.json +54 -31
- package/src/App.js +10 -7
- package/src/index.js +6 -8
- package/src/lib/components/Accordion/Accordion.js +32 -14
- package/src/lib/components/Accordion/Accordion.stories.js +31 -31
- package/src/lib/components/Avatars/avatars.js +33 -28
- package/src/lib/components/Avatars/avatars.stories.js +18 -18
- package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
- package/src/lib/components/BannerCard/bannerCards.js +18 -18
- package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
- package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
- package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
- package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
- package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
- package/src/lib/components/Buttons/buttons.js +70 -73
- package/src/lib/components/Cards/cards.js +2 -3
- package/src/lib/components/Cards/cards.stories.js +10 -10
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +46 -45
- package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
- package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
- package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
- package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
- package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
- package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
- package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
- package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
- package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
- package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
- package/src/lib/components/Lists/listBox.js +7 -7
- package/src/lib/components/Lists/listBox.stories.js +8 -11
- package/src/lib/components/Lists/listHeader.stories.js +13 -13
- package/src/lib/components/Lists/listheader.js +7 -7
- package/src/lib/components/Lists/rowLabels.js +6 -6
- package/src/lib/components/Lists/rowLabels.stories.js +18 -18
- package/src/lib/components/Loader/loader.js +13 -13
- package/src/lib/components/Loader/loader.stories.js +14 -14
- package/src/lib/components/MainWrapper/index.js +2 -2
- package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
- package/src/lib/components/MessageCounter/messageCounter.js +16 -16
- package/src/lib/components/Modals/modal.js +25 -23
- package/src/lib/components/Modals/modals.stories.js +9 -9
- package/src/lib/components/NoteBar/noteBar.js +20 -20
- package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
- package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
- package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
- package/src/lib/components/Pills/pills.js +16 -16
- package/src/lib/components/Pills/pills.stories.js +22 -23
- package/src/lib/components/ProfileIcon/ProfileIcon.js +50 -52
- package/src/lib/components/ProfileIcon/profileIcon.stories.js +22 -22
- package/src/lib/components/ProgressBar/progressbar.js +4 -5
- package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
- package/src/lib/components/ProgressRing/progressRing.js +25 -24
- package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
- package/src/lib/components/RouteLink/link.js +10 -8
- package/src/lib/components/RouteLink/link.stories.js +4 -4
- package/src/lib/components/ScrollBar/scrollBar.js +15 -14
- package/src/lib/components/SuperFluid/Content/index.js +2 -2
- package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
- package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
- package/src/lib/components/Tabs/tabs.js +11 -11
- package/src/lib/components/Tabs/tabs.stories.js +20 -20
- package/src/lib/components/Tags/tags.js +26 -24
- package/src/lib/components/Tags/tags.stories.js +19 -19
- package/src/lib/components/breakpoints.js +3 -3
- package/src/lib/components/checkbox.js +7 -6
- package/src/lib/components/colors.js +30 -28
- package/src/lib/components/dropdownButton.js +36 -39
- package/src/lib/components/examples/InfoAccordion.js +1 -1
- package/src/lib/components/globalStyles.js +2 -2
- package/src/lib/components/iconStyles.js +45 -48
- package/src/lib/components/index.js +47 -46
- package/src/lib/components/input.js +20 -20
- package/src/lib/components/text.js +1 -1
- package/src/lib/components/typography.js +14 -14
- package/src/reportWebVitals.js +1 -1
- package/babel.config.js +0 -12
- package/dist/components/checkboxToggler.js +0 -50
- package/src/lib/components/checkboxToggler.js +0 -19
|
@@ -1,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
|
)}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import { Favorite } from
|
|
3
|
-
import React from
|
|
4
|
-
import { BmTag } from
|
|
2
|
+
import { Favorite } from '@material-ui/icons';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { BmTag } from './tags';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmTag,
|
|
8
|
-
title:
|
|
8
|
+
title: 'components/Tags',
|
|
9
9
|
argTypes: {
|
|
10
10
|
color: {
|
|
11
|
-
control: { type:
|
|
11
|
+
control: { type: 'text' },
|
|
12
12
|
description:
|
|
13
|
-
|
|
13
|
+
'Color of the Icons and Text, will work only if variant is not present',
|
|
14
14
|
},
|
|
15
15
|
closeButton: {
|
|
16
|
-
control: { type:
|
|
17
|
-
description:
|
|
16
|
+
control: { type: 'boolean' },
|
|
17
|
+
description: 'Will display (x) - Optional',
|
|
18
18
|
},
|
|
19
19
|
onHide: {
|
|
20
20
|
description:
|
|
21
|
-
|
|
21
|
+
'Handles closing of tags, will only work if closeButton is present (Optional)',
|
|
22
22
|
},
|
|
23
23
|
size: {
|
|
24
|
-
options: [
|
|
25
|
-
control: { type:
|
|
26
|
-
description:
|
|
27
|
-
defaultValue: { summary:
|
|
24
|
+
options: ['xsmall', 'small', 'medium', 'large', 'xlarge'],
|
|
25
|
+
control: { type: 'select' },
|
|
26
|
+
description: 'Size of the icons',
|
|
27
|
+
defaultValue: { summary: 'small' },
|
|
28
28
|
},
|
|
29
29
|
variant: {
|
|
30
|
-
options: [
|
|
31
|
-
control: { type:
|
|
32
|
-
description:
|
|
33
|
-
defaultValue: { summary:
|
|
30
|
+
options: ['success', 'warning', 'danger', 'light', 'neutral', undefined],
|
|
31
|
+
control: { type: 'select' },
|
|
32
|
+
description: 'Type of tag',
|
|
33
|
+
defaultValue: { summary: 'neutral' },
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
};
|
|
@@ -42,12 +42,12 @@ Tags.args = {
|
|
|
42
42
|
children: <p>Tags</p>,
|
|
43
43
|
leadingIcon: <Favorite />,
|
|
44
44
|
trailingIcon: <Favorite />,
|
|
45
|
-
variant:
|
|
45
|
+
variant: 'success',
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export const TagsWithCloseButton = () => {
|
|
49
49
|
return (
|
|
50
|
-
<BmTag variant="light" closeButton onHide={() =>
|
|
50
|
+
<BmTag variant="light" closeButton onHide={() => alert('Hide Tag')}>
|
|
51
51
|
<p>TAG</p>
|
|
52
52
|
</BmTag>
|
|
53
53
|
);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/label-has-associated-control */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import styled from
|
|
3
|
-
import { BmGrey400, BmPrimaryBlack, BmPrimaryBlue, BmGrey100 } from
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { BmGrey400, BmPrimaryBlack, BmPrimaryBlue, BmGrey100 } from './colors';
|
|
4
5
|
|
|
5
|
-
const HiddenCheckbox = styled.input.attrs({ type:
|
|
6
|
+
const HiddenCheckbox = styled.input.attrs({ type: 'checkbox' })`
|
|
6
7
|
display: flex;
|
|
7
8
|
border: 0;
|
|
8
9
|
height: 0.071rem;
|
|
@@ -28,7 +29,7 @@ const StyledCheckbox = styled.div`
|
|
|
28
29
|
if (!disabled && checked) return `${BmPrimaryBlue}`;
|
|
29
30
|
if (disabled && !checked) return `${BmGrey100}`;
|
|
30
31
|
if (disabled && checked) return `${BmGrey100}`;
|
|
31
|
-
return
|
|
32
|
+
return '';
|
|
32
33
|
}};
|
|
33
34
|
border-radius: 0.143rem;
|
|
34
35
|
transition: all 150ms;
|
|
@@ -36,11 +37,11 @@ const StyledCheckbox = styled.div`
|
|
|
36
37
|
${({ checked, disabled }) => {
|
|
37
38
|
if (!disabled && checked) return `${BmPrimaryBlue}`;
|
|
38
39
|
if (disabled && !checked) return `${BmGrey400}`;
|
|
39
|
-
if (disabled && checked) return
|
|
40
|
+
if (disabled && checked) return 'none';
|
|
40
41
|
return `${BmGrey400}`;
|
|
41
42
|
}};
|
|
42
43
|
${Icon} {
|
|
43
|
-
visibility: ${(props) => (props.checked ?
|
|
44
|
+
visibility: ${(props) => (props.checked ? 'visible' : 'hidden')};
|
|
44
45
|
}
|
|
45
46
|
`;
|
|
46
47
|
|
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
// Primary Colors
|
|
2
|
-
export const BmPrimaryBlue =
|
|
2
|
+
export const BmPrimaryBlue = '#33B1BA';
|
|
3
3
|
|
|
4
|
-
export const BmPrimaryGold =
|
|
4
|
+
export const BmPrimaryGold = '#F3A929';
|
|
5
5
|
|
|
6
|
-
export const BmPrimaryWhite =
|
|
6
|
+
export const BmPrimaryWhite = '#FFFFFF';
|
|
7
7
|
|
|
8
|
-
export const BmPrimaryBlack =
|
|
8
|
+
export const BmPrimaryBlack = '#000000';
|
|
9
9
|
|
|
10
10
|
// Secondary Colors
|
|
11
|
-
export const BmSecondaryCyan =
|
|
11
|
+
export const BmSecondaryCyan = '#56C5CE';
|
|
12
12
|
|
|
13
|
-
export const BmSecondaryGrey =
|
|
13
|
+
export const BmSecondaryGrey = '#575757';
|
|
14
14
|
|
|
15
|
-
export const BmSecondaryRed =
|
|
15
|
+
export const BmSecondaryRed = '#F62E48';
|
|
16
16
|
|
|
17
|
-
export const BmSecondaryGreen =
|
|
17
|
+
export const BmSecondaryGreen = '#8CC63F';
|
|
18
18
|
|
|
19
|
-
export const BmSecondaryYellow =
|
|
19
|
+
export const BmSecondaryYellow = '#FFB822';
|
|
20
20
|
|
|
21
|
-
export const BmSecondaryPurple =
|
|
21
|
+
export const BmSecondaryPurple = '#7A3FC6';
|
|
22
22
|
|
|
23
|
-
export const BmSecondaryDarkGreen =
|
|
23
|
+
export const BmSecondaryDarkGreen = '#04844B';
|
|
24
24
|
|
|
25
|
-
export const BmSecondaryGreen8 =
|
|
25
|
+
export const BmSecondaryGreen8 = 'rgba(4, 132, 75, 0.8)';
|
|
26
26
|
|
|
27
|
-
export const BmSecondaryRed8 =
|
|
27
|
+
export const BmSecondaryRed8 = 'rgba(246, 46, 72, 0.8)';
|
|
28
28
|
|
|
29
|
-
export const BmSecondaryRed15 =
|
|
29
|
+
export const BmSecondaryRed15 = 'rgba(246, 46, 72, 0.15)';
|
|
30
30
|
|
|
31
|
-
export const BmSecondaryGreen15 =
|
|
31
|
+
export const BmSecondaryGreen15 = 'rgba(4, 132, 75, 0.15)';
|
|
32
32
|
|
|
33
|
-
export const BmSecondaryGold15 =
|
|
33
|
+
export const BmSecondaryGold15 = 'rgba(243, 169, 41, 0.15)';
|
|
34
34
|
|
|
35
35
|
// #33B1BA 12%
|
|
36
|
-
export const BmSecondaryBlue12=
|
|
36
|
+
export const BmSecondaryBlue12 = 'rgba(51, 177, 186, 0.12)';
|
|
37
37
|
|
|
38
38
|
// Background Colors
|
|
39
|
-
export const BmBgLightBlue =
|
|
39
|
+
export const BmBgLightBlue = '#E1EAFC';
|
|
40
40
|
|
|
41
|
-
export const BmBgGreyBlue =
|
|
41
|
+
export const BmBgGreyBlue = '#F5F6FA';
|
|
42
42
|
|
|
43
|
-
export const BmBgGrey45 =
|
|
43
|
+
export const BmBgGrey45 = 'rgba(0, 0, 0, 0.5)';
|
|
44
|
+
|
|
45
|
+
export const BmBgGrey38 = 'rgba(0, 0, 0, 0.38)';
|
|
44
46
|
|
|
45
47
|
// Grey Colors
|
|
46
|
-
export const BmGrey600 =
|
|
48
|
+
export const BmGrey600 = '#545454';
|
|
47
49
|
|
|
48
|
-
export const BmGrey500 =
|
|
50
|
+
export const BmGrey500 = '#757575';
|
|
49
51
|
|
|
50
|
-
export const BmGrey400 =
|
|
52
|
+
export const BmGrey400 = '#AFAFAF';
|
|
51
53
|
|
|
52
|
-
export const BmGrey200 =
|
|
54
|
+
export const BmGrey200 = '#E2E2E2';
|
|
53
55
|
|
|
54
|
-
export const BmGrey100 =
|
|
56
|
+
export const BmGrey100 = '#EEEEEE';
|
|
55
57
|
|
|
56
|
-
export const BmGrey50 =
|
|
58
|
+
export const BmGrey50 = '#F6F6F6';
|
|
57
59
|
|
|
58
60
|
// Pictogram Colors
|
|
59
|
-
export const BmPictogramBlue =
|
|
61
|
+
export const BmPictogramBlue = '#CCEAEB';
|
|
60
62
|
|
|
61
|
-
export const BmPictogramGold =
|
|
63
|
+
export const BmPictogramGold = '#F8D8A2';
|