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
package/.eslintrc
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"airbnb",
|
|
4
|
+
"plugin:react/recommended",
|
|
5
|
+
"plugin:jsdoc/recommended",
|
|
6
|
+
"plugin:prettier/recommended",
|
|
7
|
+
"plugin:jest/recommended",
|
|
8
|
+
"plugin:jest/style",
|
|
9
|
+
"prettier"
|
|
10
|
+
],
|
|
11
|
+
"plugins": [
|
|
12
|
+
"jest",
|
|
13
|
+
"jsdoc",
|
|
14
|
+
"prettier"
|
|
15
|
+
],
|
|
16
|
+
"parser": "babel-eslint",
|
|
17
|
+
"rules": {
|
|
18
|
+
"prettier/prettier": "error",
|
|
19
|
+
"react/jsx-filename-extension": [
|
|
20
|
+
1,
|
|
21
|
+
{
|
|
22
|
+
"extensions": [
|
|
23
|
+
".js",
|
|
24
|
+
".jsx"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"import/no-extraneous-dependencies": [
|
|
29
|
+
"error",
|
|
30
|
+
{
|
|
31
|
+
"devDependencies": [
|
|
32
|
+
"**/*.test.js",
|
|
33
|
+
"**/*.spec.js",
|
|
34
|
+
"**/**/.storybook/**",
|
|
35
|
+
"**/**/stories/**",
|
|
36
|
+
"**/*.stories.js"
|
|
37
|
+
],
|
|
38
|
+
"peerDependencies": true
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"func-style": [
|
|
42
|
+
"error",
|
|
43
|
+
"expression"
|
|
44
|
+
],
|
|
45
|
+
"jest/no-disabled-tests": "warn",
|
|
46
|
+
"jest/no-focused-tests": "error",
|
|
47
|
+
"jest/no-identical-title": "error",
|
|
48
|
+
"jest/prefer-to-have-length": "warn",
|
|
49
|
+
"jest/valid-expect": "error",
|
|
50
|
+
"object-curly-newline": "off",
|
|
51
|
+
"no-console": "off",
|
|
52
|
+
"react/jsx-props-no-spreading": "off",
|
|
53
|
+
"react/prop-types": 0,
|
|
54
|
+
"react/require-default-props": 0,
|
|
55
|
+
"consistent-return": 0,
|
|
56
|
+
"import/prefer-default-export": 0,
|
|
57
|
+
"react/forbid-prop-types": 0
|
|
58
|
+
},
|
|
59
|
+
"globals": {
|
|
60
|
+
"fetch": false
|
|
61
|
+
}
|
|
62
|
+
}
|
package/.prettierrc
ADDED
package/babel.config.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
module.exports = function (api) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
api.cache(true);
|
|
3
|
+
|
|
4
|
+
const presets = ['@babel/preset-env', '@babel/preset-react'];
|
|
5
|
+
const plugins = ['macros'];
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
7
|
+
return {
|
|
8
|
+
presets,
|
|
9
|
+
plugins,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -13,12 +13,12 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
16
|
+
var _icons = require("@material-ui/icons");
|
|
17
|
+
|
|
16
18
|
var _colors = require("../colors");
|
|
17
19
|
|
|
18
20
|
var _iconStyles = require("../iconStyles");
|
|
19
21
|
|
|
20
|
-
var _icons = require("@material-ui/icons");
|
|
21
|
-
|
|
22
22
|
var _excluded = ["children", "disabled", "expandIcon", "Open", "expandIconPosition"],
|
|
23
23
|
_excluded2 = ["children", "leadingIcon", "trailingIcon", "size"];
|
|
24
24
|
|
|
@@ -61,7 +61,7 @@ var _React$createContext = /*#__PURE__*/_react.default.createContext({}),
|
|
|
61
61
|
Consumer = _React$createContext.Consumer;
|
|
62
62
|
|
|
63
63
|
var Dropdown = function Dropdown(value, rest) {
|
|
64
|
-
if (value.expandIcon && value.expandIcon ===
|
|
64
|
+
if (value.expandIcon && value.expandIcon === 'none') {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -73,7 +73,7 @@ var Dropdown = function Dropdown(value, rest) {
|
|
|
73
73
|
}, rest));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (value.expandIcon && value.expandIcon !==
|
|
76
|
+
if (value.expandIcon && value.expandIcon !== 'none') {
|
|
77
77
|
return /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
78
78
|
icon: value.expandIcon
|
|
79
79
|
});
|
|
@@ -94,7 +94,7 @@ var BmAccordion = function BmAccordion(_ref) {
|
|
|
94
94
|
expandIconPosition = _ref.expandIconPosition,
|
|
95
95
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
96
96
|
|
|
97
|
-
var _useState = (0, _react.useState)(Open
|
|
97
|
+
var _useState = (0, _react.useState)(!!Open),
|
|
98
98
|
_useState2 = _slicedToArray(_useState, 2),
|
|
99
99
|
toggle = _useState2[0],
|
|
100
100
|
setToggle = _useState2[1];
|
|
@@ -122,13 +122,13 @@ BmAccordion.Title = function (_ref2) {
|
|
|
122
122
|
onClick: function onClick() {
|
|
123
123
|
return !value.disabled || value.disabled === false ? value.setToggle(!value.toggle) : value.setToggle(false);
|
|
124
124
|
}
|
|
125
|
-
}), value.expandIconPosition ===
|
|
125
|
+
}), value.expandIconPosition === 'left' || value.expandIconPosition === undefined && Dropdown(value, rest), leadingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
126
126
|
icon: leadingIcon,
|
|
127
127
|
size: size
|
|
128
128
|
}), /*#__PURE__*/_react.default.createElement(BmAccordionDetails, null, children), trailingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
129
129
|
icon: trailingIcon,
|
|
130
130
|
size: size
|
|
131
|
-
}), value.expandIconPosition ===
|
|
131
|
+
}), value.expandIconPosition === 'right' && Dropdown(value, rest));
|
|
132
132
|
});
|
|
133
133
|
};
|
|
134
134
|
|
|
@@ -7,50 +7,50 @@ exports.default = exports.Accordion = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
11
|
-
|
|
12
10
|
var _addonKnobs = require("@storybook/addon-knobs");
|
|
13
11
|
|
|
14
12
|
var _icons = require("@material-ui/icons");
|
|
15
13
|
|
|
14
|
+
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
15
|
+
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
18
|
/* eslint-disable import/no-anonymous-default-export */
|
|
19
19
|
var _default = {
|
|
20
20
|
component: _Accordion.default,
|
|
21
21
|
subcomponents: _Accordion.default.Title,
|
|
22
|
-
title:
|
|
22
|
+
title: 'components/Accordion',
|
|
23
23
|
argTypes: {
|
|
24
24
|
size: {
|
|
25
|
-
options: [
|
|
25
|
+
options: ['small', 'medium', 'large'],
|
|
26
26
|
control: {
|
|
27
|
-
type:
|
|
27
|
+
type: 'select'
|
|
28
28
|
},
|
|
29
|
-
description:
|
|
29
|
+
description: 'Size of the icons',
|
|
30
30
|
defaultValue: {
|
|
31
|
-
summary:
|
|
31
|
+
summary: 'large'
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
disabled: {
|
|
35
|
-
description:
|
|
35
|
+
description: 'Optional',
|
|
36
36
|
defaultValue: {
|
|
37
37
|
summary: false
|
|
38
38
|
},
|
|
39
39
|
control: {
|
|
40
|
-
type:
|
|
40
|
+
type: 'boolean'
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
Open: {
|
|
44
|
-
description:
|
|
44
|
+
description: 'Accordion body will be open initially',
|
|
45
45
|
defaultValue: {
|
|
46
46
|
summary: false
|
|
47
47
|
},
|
|
48
48
|
control: {
|
|
49
|
-
type:
|
|
49
|
+
type: 'boolean'
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
children: {
|
|
53
|
-
description:
|
|
53
|
+
description: 'Accordion Title Text',
|
|
54
54
|
defaultValue: {
|
|
55
55
|
summary: undefined
|
|
56
56
|
}
|
|
@@ -62,23 +62,23 @@ var _default = {
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
expandIconPosition: {
|
|
65
|
-
options: [
|
|
65
|
+
options: ['left', 'right'],
|
|
66
66
|
control: {
|
|
67
|
-
type:
|
|
67
|
+
type: 'select'
|
|
68
68
|
},
|
|
69
|
-
description:
|
|
69
|
+
description: 'Position of the expand Icon',
|
|
70
70
|
defaultValue: {
|
|
71
|
-
summary:
|
|
71
|
+
summary: 'left'
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
leadingIcon: {
|
|
75
|
-
description:
|
|
75
|
+
description: 'Material-UI icon(optional)',
|
|
76
76
|
defaultValue: {
|
|
77
77
|
summary: undefined
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
trailingIcon: {
|
|
81
|
-
description:
|
|
81
|
+
description: 'Material-UI icon(optional)',
|
|
82
82
|
defaultValue: {
|
|
83
83
|
summary: undefined
|
|
84
84
|
}
|
|
@@ -87,25 +87,25 @@ var _default = {
|
|
|
87
87
|
};
|
|
88
88
|
exports.default = _default;
|
|
89
89
|
var optionSize = {
|
|
90
|
-
small:
|
|
91
|
-
medium:
|
|
92
|
-
large:
|
|
90
|
+
small: 'small',
|
|
91
|
+
medium: 'medium',
|
|
92
|
+
large: 'large'
|
|
93
93
|
};
|
|
94
94
|
var optionExpandIcon = {
|
|
95
|
-
left:
|
|
96
|
-
right:
|
|
95
|
+
left: 'left',
|
|
96
|
+
right: 'medium'
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
var Accordion = function Accordion() {
|
|
100
100
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Accordion.default, {
|
|
101
|
-
disabled: (0, _addonKnobs.boolean)(
|
|
102
|
-
Open: (0, _addonKnobs.boolean)(
|
|
101
|
+
disabled: (0, _addonKnobs.boolean)('disabled', false),
|
|
102
|
+
Open: (0, _addonKnobs.boolean)('disabled', false)
|
|
103
103
|
}, /*#__PURE__*/_react.default.createElement(_Accordion.default.Title, {
|
|
104
104
|
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Home, null),
|
|
105
105
|
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
|
|
106
|
-
size: (0, _addonKnobs.select)(
|
|
107
|
-
expandIconPosition: (0, _addonKnobs.select)(
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement("h3", null, (0, _addonKnobs.text)(
|
|
106
|
+
size: (0, _addonKnobs.select)('size', optionSize, 'large'),
|
|
107
|
+
expandIconPosition: (0, _addonKnobs.select)('expandIconPosition', optionExpandIcon, 'left')
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("h3", null, (0, _addonKnobs.text)('children', 'Accordion'))), /*#__PURE__*/_react.default.createElement(_Accordion.default.Body, null, "Accordion Body")));
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
exports.Accordion = Accordion;
|
|
@@ -13,12 +13,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
15
|
|
|
16
|
+
var _SmartToy = _interopRequireDefault(require("@mui/icons-material/SmartToy"));
|
|
17
|
+
|
|
16
18
|
var _colors = require("../colors");
|
|
17
19
|
|
|
18
20
|
var _iconStyles = require("../iconStyles");
|
|
19
21
|
|
|
20
|
-
var _SmartToy = _interopRequireDefault(require("@mui/icons-material/SmartToy"));
|
|
21
|
-
|
|
22
22
|
var _excluded = ["user", "size", "color"];
|
|
23
23
|
|
|
24
24
|
var _templateObject;
|
|
@@ -35,34 +35,34 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
35
35
|
|
|
36
36
|
var BmAvatarWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n width: ", ";\n background: ", ";\n border-radius: ", ";\n border: 0.071rem solid\n ", ";\n"])), function (_ref) {
|
|
37
37
|
var size = _ref.size;
|
|
38
|
-
if (size ===
|
|
39
|
-
if (size ===
|
|
40
|
-
if (size ===
|
|
41
|
-
if (size ===
|
|
42
|
-
if (!size) return
|
|
38
|
+
if (size === 'large') return '3.429rem';
|
|
39
|
+
if (size === 'medium') return '2.286rem';
|
|
40
|
+
if (size === 'small') return '1.714rem';
|
|
41
|
+
if (size === 'xsmall') return '1.429rem';
|
|
42
|
+
if (!size) return '3.429rem';
|
|
43
43
|
return size;
|
|
44
44
|
}, function (_ref2) {
|
|
45
45
|
var size = _ref2.size;
|
|
46
|
-
if (size ===
|
|
47
|
-
if (size ===
|
|
48
|
-
if (size ===
|
|
49
|
-
if (size ===
|
|
50
|
-
if (!size) return
|
|
46
|
+
if (size === 'large') return '3.429rem';
|
|
47
|
+
if (size === 'medium') return '2.286rem';
|
|
48
|
+
if (size === 'small') return '1.714rem';
|
|
49
|
+
if (size === 'xsmall') return '1.429rem';
|
|
50
|
+
if (!size) return '3.429rem';
|
|
51
51
|
return size;
|
|
52
52
|
}, function (_ref3) {
|
|
53
53
|
var user = _ref3.user;
|
|
54
|
-
if (user ===
|
|
55
|
-
if (user ===
|
|
54
|
+
if (user === 'chatbot') return "".concat(_colors.BmPrimaryBlue);
|
|
55
|
+
if (user === 'employee') return "".concat(_colors.BmPrimaryBlue);
|
|
56
56
|
return "".concat(_colors.BmGrey100);
|
|
57
57
|
}, function (_ref4) {
|
|
58
58
|
var type = _ref4.type;
|
|
59
|
-
if (type ===
|
|
60
|
-
if (type ===
|
|
61
|
-
return
|
|
59
|
+
if (type === 'circle') return '7.143rem';
|
|
60
|
+
if (type === 'square') return '0.179rem';
|
|
61
|
+
return '7.143rem';
|
|
62
62
|
}, function (_ref5) {
|
|
63
63
|
var user = _ref5.user;
|
|
64
|
-
if (user ===
|
|
65
|
-
if (user ===
|
|
64
|
+
if (user === 'chatbot') return "".concat(_colors.BmPrimaryBlue);
|
|
65
|
+
if (user === 'employee') return "".concat(_colors.BmPrimaryBlue);
|
|
66
66
|
return "".concat(_colors.BmGrey100);
|
|
67
67
|
});
|
|
68
68
|
|
|
@@ -77,15 +77,15 @@ var BmAvatar = function BmAvatar(props) {
|
|
|
77
77
|
return /*#__PURE__*/_react.default.createElement(BmAvatarWrapper, _extends({
|
|
78
78
|
user: user,
|
|
79
79
|
size: size
|
|
80
|
-
}, rest), user ===
|
|
80
|
+
}, rest), user === 'employee' && /*#__PURE__*/_react.default.createElement(_iconStyles.BmAvatarIcon, _extends({
|
|
81
81
|
icon: /*#__PURE__*/_react.default.createElement(_icons.Person, null),
|
|
82
82
|
size: size,
|
|
83
83
|
color: color
|
|
84
|
-
}, rest)), user ===
|
|
84
|
+
}, rest)), user === 'chatbot' && /*#__PURE__*/_react.default.createElement(_iconStyles.BmAvatarIcon, _extends({
|
|
85
85
|
icon: /*#__PURE__*/_react.default.createElement(_SmartToy.default, null),
|
|
86
86
|
size: size,
|
|
87
87
|
color: color
|
|
88
|
-
}, rest)), user !==
|
|
88
|
+
}, rest)), user !== 'chatbot' && user !== 'employee' && user !== 'default' && /*#__PURE__*/_react.default.createElement(_iconStyles.BmAvatarIcon, _extends({
|
|
89
89
|
icon: user,
|
|
90
90
|
size: size,
|
|
91
91
|
color: color
|
|
@@ -7,35 +7,35 @@ exports.default = exports.CustomAvatar = exports.Avatar = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _avatars = _interopRequireDefault(require("./avatars"));
|
|
11
|
-
|
|
12
10
|
var _icons = require("@material-ui/icons");
|
|
13
11
|
|
|
12
|
+
var _avatars = _interopRequireDefault(require("./avatars"));
|
|
13
|
+
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
/* eslint-disable import/no-anonymous-default-export */
|
|
17
17
|
var _default = {
|
|
18
18
|
component: _avatars.default,
|
|
19
|
-
title:
|
|
19
|
+
title: 'components/Avatars',
|
|
20
20
|
argTypes: {
|
|
21
21
|
size: {
|
|
22
|
-
options: [
|
|
22
|
+
options: ['xsmall', 'small', 'medium', 'large'],
|
|
23
23
|
control: {
|
|
24
|
-
type:
|
|
24
|
+
type: 'select'
|
|
25
25
|
},
|
|
26
|
-
description:
|
|
26
|
+
description: 'Size of the Avatar',
|
|
27
27
|
defaultValue: {
|
|
28
|
-
summary:
|
|
28
|
+
summary: 'large'
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
type: {
|
|
32
|
-
options: [
|
|
32
|
+
options: ['circle', 'square'],
|
|
33
33
|
control: {
|
|
34
|
-
type:
|
|
34
|
+
type: 'select'
|
|
35
35
|
},
|
|
36
|
-
description:
|
|
36
|
+
description: 'Shape of the Avatar',
|
|
37
37
|
defaultValue: {
|
|
38
|
-
summary:
|
|
38
|
+
summary: 'circle'
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
user: {
|
|
@@ -55,15 +55,15 @@ var MainAvatar = function MainAvatar(args) {
|
|
|
55
55
|
var Avatar = MainAvatar.bind({});
|
|
56
56
|
exports.Avatar = Avatar;
|
|
57
57
|
Avatar.args = {
|
|
58
|
-
user:
|
|
59
|
-
size:
|
|
60
|
-
type:
|
|
58
|
+
user: 'chatbot',
|
|
59
|
+
size: 'large',
|
|
60
|
+
type: 'circle'
|
|
61
61
|
};
|
|
62
62
|
var CustomAvatar = MainAvatar.bind({});
|
|
63
63
|
exports.CustomAvatar = CustomAvatar;
|
|
64
64
|
CustomAvatar.args = {
|
|
65
65
|
user: /*#__PURE__*/_react.default.createElement(_icons.Home, null),
|
|
66
|
-
size:
|
|
67
|
-
type:
|
|
68
|
-
color:
|
|
66
|
+
size: 'large',
|
|
67
|
+
type: 'square',
|
|
68
|
+
color: '#000000'
|
|
69
69
|
};
|
|
@@ -18,27 +18,27 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
/* eslint-disable import/no-anonymous-default-export */
|
|
19
19
|
var _default = {
|
|
20
20
|
component: _bannerCards.default,
|
|
21
|
-
title:
|
|
21
|
+
title: 'components/Banner',
|
|
22
22
|
argTypes: {
|
|
23
23
|
border: {
|
|
24
|
-
options: [
|
|
24
|
+
options: ['dashed', 'solid'],
|
|
25
25
|
control: {
|
|
26
|
-
type:
|
|
26
|
+
type: 'select'
|
|
27
27
|
},
|
|
28
|
-
description:
|
|
28
|
+
description: 'Banner border',
|
|
29
29
|
defaultValue: {
|
|
30
|
-
summary:
|
|
30
|
+
summary: 'none'
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
bannerBg: {
|
|
34
34
|
description: "Banner Background Color, Can be set as 'default', or custom color"
|
|
35
35
|
},
|
|
36
36
|
content: {
|
|
37
|
-
options: [
|
|
37
|
+
options: ['left', 'center', 'right'],
|
|
38
38
|
control: {
|
|
39
|
-
type:
|
|
39
|
+
type: 'select'
|
|
40
40
|
},
|
|
41
|
-
description:
|
|
41
|
+
description: 'Aligning content of banner, will not work if closeButton is present'
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
};
|
|
@@ -62,11 +62,11 @@ var AnnouncementBanner = function AnnouncementBanner() {
|
|
|
62
62
|
closeButton: true
|
|
63
63
|
}, /*#__PURE__*/_react.default.createElement("h3", {
|
|
64
64
|
style: {
|
|
65
|
-
color:
|
|
65
|
+
color: 'white'
|
|
66
66
|
}
|
|
67
67
|
}, "Special Announcement Title"), /*#__PURE__*/_react.default.createElement("p", {
|
|
68
68
|
style: {
|
|
69
|
-
color:
|
|
69
|
+
color: 'white'
|
|
70
70
|
}
|
|
71
71
|
}, "Message Text"), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_.BmButton, {
|
|
72
72
|
variant: "neutral",
|
|
@@ -84,11 +84,11 @@ var FeatureBanner = function FeatureBanner() {
|
|
|
84
84
|
variant: "light"
|
|
85
85
|
}, /*#__PURE__*/_react.default.createElement("p", null, "New")), /*#__PURE__*/_react.default.createElement("h3", {
|
|
86
86
|
style: {
|
|
87
|
-
color:
|
|
87
|
+
color: 'white'
|
|
88
88
|
}
|
|
89
89
|
}, "New Feature Title"), /*#__PURE__*/_react.default.createElement("p", {
|
|
90
90
|
style: {
|
|
91
|
-
color:
|
|
91
|
+
color: 'white'
|
|
92
92
|
}
|
|
93
93
|
}, "Message Text"), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_.BmButton, {
|
|
94
94
|
size: "small"
|
|
@@ -13,7 +13,7 @@ var _icons = require("@material-ui/icons");
|
|
|
13
13
|
|
|
14
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _iconStyles = require("../iconStyles");
|
|
17
17
|
|
|
18
18
|
var _colors = require("../colors");
|
|
19
19
|
|
|
@@ -52,32 +52,32 @@ var BannerCardWrapper = _styledComponents.default.div(_templateObject || (_templ
|
|
|
52
52
|
show = _ref.show;
|
|
53
53
|
|
|
54
54
|
if (!closeButton) {
|
|
55
|
-
return
|
|
55
|
+
return 'flex';
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
return show ?
|
|
58
|
+
return show ? 'flex' : 'none';
|
|
59
59
|
}, function (_ref2) {
|
|
60
60
|
var border = _ref2.border;
|
|
61
|
-
if (border ===
|
|
62
|
-
if (border ===
|
|
63
|
-
return
|
|
61
|
+
if (border === 'dashed') return 'dashed';
|
|
62
|
+
if (border === 'solid') return 'solid';
|
|
63
|
+
return 'none';
|
|
64
64
|
}, function (_ref3) {
|
|
65
65
|
var color = _ref3.color;
|
|
66
|
-
return color
|
|
66
|
+
return color || _colors.BmPrimaryBlue;
|
|
67
67
|
}, function (_ref4) {
|
|
68
68
|
var content = _ref4.content,
|
|
69
69
|
closeButton = _ref4.closeButton;
|
|
70
70
|
|
|
71
71
|
if (!closeButton) {
|
|
72
|
-
if (content ===
|
|
73
|
-
if (content ===
|
|
74
|
-
if (content ===
|
|
75
|
-
return
|
|
72
|
+
if (content === 'center') return 'center';
|
|
73
|
+
if (content === 'left') return 'flex-start';
|
|
74
|
+
if (content === 'right') return 'flex-end';
|
|
75
|
+
return 'center';
|
|
76
76
|
}
|
|
77
77
|
}, function (_ref5) {
|
|
78
78
|
var bannerBg = _ref5.bannerBg;
|
|
79
|
-
if (bannerBg ===
|
|
80
|
-
if (!bannerBg) return
|
|
79
|
+
if (bannerBg === 'default') return "".concat(_colors.BmGrey50);
|
|
80
|
+
if (!bannerBg) return 'none';
|
|
81
81
|
return bannerBg;
|
|
82
82
|
});
|
|
83
83
|
|
|
@@ -97,7 +97,7 @@ var BmBanner = function BmBanner(_ref6) {
|
|
|
97
97
|
closeButton: closeButton
|
|
98
98
|
}, rest, {
|
|
99
99
|
show: show
|
|
100
|
-
}), closeButton && /*#__PURE__*/_react.default.createElement(BannerComponent, null, children[0],
|
|
100
|
+
}), closeButton && /*#__PURE__*/_react.default.createElement(BannerComponent, null, children[0], ' ', /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
101
101
|
icon: /*#__PURE__*/_react.default.createElement(_icons.Clear, null),
|
|
102
102
|
size: "small",
|
|
103
103
|
onClick: function onClick() {
|
|
@@ -7,49 +7,49 @@ exports.default = exports.ColoredButton = exports.BasicButton = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _buttons = require("../buttons");
|
|
11
|
-
|
|
12
10
|
var _icons = require("@material-ui/icons");
|
|
13
11
|
|
|
12
|
+
var _buttons = require("../buttons");
|
|
13
|
+
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
/* eslint-disable import/no-anonymous-default-export */
|
|
17
17
|
var _default = {
|
|
18
18
|
component: _buttons.BmButton,
|
|
19
|
-
title:
|
|
19
|
+
title: 'components/Buttons/Basic',
|
|
20
20
|
argTypes: {
|
|
21
21
|
size: {
|
|
22
|
-
options: [
|
|
22
|
+
options: ['small', 'medium', 'large'],
|
|
23
23
|
control: {
|
|
24
|
-
type:
|
|
24
|
+
type: 'select'
|
|
25
25
|
},
|
|
26
|
-
description:
|
|
26
|
+
description: 'Size',
|
|
27
27
|
defaultValue: {
|
|
28
|
-
summary:
|
|
28
|
+
summary: 'large'
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
variant: {
|
|
32
|
-
options: [
|
|
32
|
+
options: ['primary', 'secondary', 'tertiary', 'success', 'neutral', 'destructive'],
|
|
33
33
|
control: {
|
|
34
|
-
type:
|
|
34
|
+
type: 'select'
|
|
35
35
|
},
|
|
36
|
-
description:
|
|
36
|
+
description: 'Variant',
|
|
37
37
|
defaultValue: {
|
|
38
|
-
summary:
|
|
38
|
+
summary: 'primary'
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
leadingIcon: {
|
|
42
|
-
description:
|
|
42
|
+
description: 'Material UI Icons'
|
|
43
43
|
},
|
|
44
44
|
trailingIcon: {
|
|
45
|
-
description:
|
|
45
|
+
description: 'Material UI Icons'
|
|
46
46
|
},
|
|
47
47
|
color: {
|
|
48
|
-
description:
|
|
48
|
+
description: 'Color of the Button'
|
|
49
49
|
},
|
|
50
50
|
children: {
|
|
51
|
-
description:
|
|
52
|
-
default:
|
|
51
|
+
description: 'Text of the button',
|
|
52
|
+
default: 'Button'
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
};
|
|
@@ -62,19 +62,19 @@ var MainButton = function MainButton(args) {
|
|
|
62
62
|
var BasicButton = MainButton.bind({});
|
|
63
63
|
exports.BasicButton = BasicButton;
|
|
64
64
|
BasicButton.args = {
|
|
65
|
-
variant:
|
|
66
|
-
size:
|
|
67
|
-
children:
|
|
65
|
+
variant: 'primary',
|
|
66
|
+
size: 'large',
|
|
67
|
+
children: 'Button',
|
|
68
68
|
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Home, null),
|
|
69
69
|
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null)
|
|
70
70
|
};
|
|
71
71
|
var ColoredButton = MainButton.bind({});
|
|
72
72
|
exports.ColoredButton = ColoredButton;
|
|
73
73
|
ColoredButton.args = {
|
|
74
|
-
variant:
|
|
75
|
-
size:
|
|
76
|
-
children:
|
|
74
|
+
variant: 'primary',
|
|
75
|
+
size: 'large',
|
|
76
|
+
children: 'Button',
|
|
77
77
|
leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Home, null),
|
|
78
78
|
trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
|
|
79
|
-
color:
|
|
79
|
+
color: 'pink'
|
|
80
80
|
};
|