beem-component 1.5.8 → 1.6.1

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.
Files changed (155) hide show
  1. package/.eslintrc +62 -0
  2. package/.prettierrc +6 -0
  3. package/babel.config.js +9 -10
  4. package/dist/components/Accordion/Accordion.js +7 -7
  5. package/dist/components/Accordion/Accordion.stories.js +28 -28
  6. package/dist/components/Avatars/avatars.js +30 -22
  7. package/dist/components/Avatars/avatars.stories.js +17 -17
  8. package/dist/components/BannerCard/bannerCard.stories.js +12 -12
  9. package/dist/components/BannerCard/bannerCards.js +14 -14
  10. package/dist/components/Buttons/Stories/basicbutton.stories.js +23 -23
  11. package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +16 -16
  12. package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +16 -16
  13. package/dist/components/Buttons/buttonAlertIcons.js +16 -16
  14. package/dist/components/Buttons/buttonIconsOnly.js +22 -22
  15. package/dist/components/Buttons/buttons.js +56 -56
  16. package/dist/components/Cards/cards.js +1 -1
  17. package/dist/components/Cards/cards.stories.js +6 -6
  18. package/dist/components/ChatComponents/ChatBody/chatBody.js +43 -36
  19. package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +5 -5
  20. package/dist/components/ChatComponents/ChatHeader/chatHeader.js +1 -1
  21. package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +1 -1
  22. package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
  23. package/dist/components/ChatComponents/ContactCards/contactCards.js +1 -2
  24. package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +1 -1
  25. package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
  26. package/dist/components/ChatComponents/InfoTab/infoTab.js +1 -1
  27. package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +4 -4
  28. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
  29. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +14 -12
  30. package/dist/components/Checkbox/checkboxToggler.js +64 -0
  31. package/dist/components/Checkbox/checkboxToggler.stories.js +92 -0
  32. package/dist/components/Lists/listBox.js +5 -5
  33. package/dist/components/Lists/listBox.stories.js +5 -5
  34. package/dist/components/Lists/listHeader.stories.js +11 -11
  35. package/dist/components/Lists/listheader.js +4 -4
  36. package/dist/components/Lists/rowLabels.js +2 -2
  37. package/dist/components/Lists/rowLabels.stories.js +16 -16
  38. package/dist/components/Loader/loader.js +7 -7
  39. package/dist/components/Loader/loader.stories.js +11 -11
  40. package/dist/components/MessageCounter/MessageCounter.stories.js +13 -13
  41. package/dist/components/MessageCounter/messageCounter.js +11 -11
  42. package/dist/components/Modals/modal.js +6 -8
  43. package/dist/components/Modals/modals.stories.js +6 -6
  44. package/dist/components/NoteBar/noteBar.js +14 -14
  45. package/dist/components/NoteBar/noteBar.stories.js +15 -15
  46. package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +13 -13
  47. package/dist/components/PerformanceIndicator/performanceIndicator.js +14 -12
  48. package/dist/components/Pills/pills.js +10 -10
  49. package/dist/components/Pills/pills.stories.js +19 -21
  50. package/dist/components/ProfileIcon/ProfileIcon.js +14 -14
  51. package/dist/components/ProfileIcon/profileIcon.stories.js +16 -16
  52. package/dist/components/ProgressBar/progressbar.stories.js +6 -8
  53. package/dist/components/ProgressRing/progressRing.js +19 -19
  54. package/dist/components/ProgressRing/progressRing.stories.js +14 -14
  55. package/dist/components/RouteLink/link.js +3 -3
  56. package/dist/components/RouteLink/link.stories.js +1 -1
  57. package/dist/components/ScrollBar/scrollBar.js +9 -9
  58. package/dist/components/SuperFluid/SegmentCard/index.js +2 -2
  59. package/dist/components/Tabs/tabs.js +6 -6
  60. package/dist/components/Tabs/tabs.stories.js +17 -17
  61. package/dist/components/Tags/tags.js +21 -21
  62. package/dist/components/Tags/tags.stories.js +16 -16
  63. package/dist/components/breakpoints.js +3 -3
  64. package/dist/components/checkbox.js +4 -4
  65. package/dist/components/colors.js +32 -30
  66. package/dist/components/dropdownButton.js +35 -35
  67. package/dist/components/examples/InfoAccordion.js +0 -1
  68. package/dist/components/iconStyles.js +45 -45
  69. package/dist/components/index.js +24 -16
  70. package/dist/components/input.js +16 -16
  71. package/dist/components/typography.js +14 -14
  72. package/package.json +54 -31
  73. package/src/App.js +10 -7
  74. package/src/index.js +6 -8
  75. package/src/lib/components/Accordion/Accordion.js +32 -14
  76. package/src/lib/components/Accordion/Accordion.stories.js +31 -31
  77. package/src/lib/components/Avatars/avatars.js +44 -29
  78. package/src/lib/components/Avatars/avatars.stories.js +18 -18
  79. package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
  80. package/src/lib/components/BannerCard/bannerCards.js +18 -18
  81. package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
  82. package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  83. package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
  84. package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
  85. package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
  86. package/src/lib/components/Buttons/buttons.js +70 -73
  87. package/src/lib/components/Cards/cards.js +2 -3
  88. package/src/lib/components/Cards/cards.stories.js +10 -10
  89. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +49 -45
  90. package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
  91. package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
  92. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
  93. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
  94. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
  95. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
  96. package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
  97. package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
  98. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
  99. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
  100. package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
  101. package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
  102. package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
  103. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
  104. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
  105. package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
  106. package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
  107. package/src/lib/components/Lists/listBox.js +7 -7
  108. package/src/lib/components/Lists/listBox.stories.js +8 -11
  109. package/src/lib/components/Lists/listHeader.stories.js +13 -13
  110. package/src/lib/components/Lists/listheader.js +7 -7
  111. package/src/lib/components/Lists/rowLabels.js +6 -6
  112. package/src/lib/components/Lists/rowLabels.stories.js +18 -18
  113. package/src/lib/components/Loader/loader.js +13 -13
  114. package/src/lib/components/Loader/loader.stories.js +14 -14
  115. package/src/lib/components/MainWrapper/index.js +2 -2
  116. package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
  117. package/src/lib/components/MessageCounter/messageCounter.js +16 -16
  118. package/src/lib/components/Modals/modal.js +25 -23
  119. package/src/lib/components/Modals/modals.stories.js +9 -9
  120. package/src/lib/components/NoteBar/noteBar.js +20 -20
  121. package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
  122. package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  123. package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
  124. package/src/lib/components/Pills/pills.js +16 -16
  125. package/src/lib/components/Pills/pills.stories.js +22 -23
  126. package/src/lib/components/ProfileIcon/ProfileIcon.js +50 -52
  127. package/src/lib/components/ProfileIcon/profileIcon.stories.js +22 -22
  128. package/src/lib/components/ProgressBar/progressbar.js +4 -5
  129. package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
  130. package/src/lib/components/ProgressRing/progressRing.js +25 -24
  131. package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
  132. package/src/lib/components/RouteLink/link.js +10 -8
  133. package/src/lib/components/RouteLink/link.stories.js +4 -4
  134. package/src/lib/components/ScrollBar/scrollBar.js +15 -14
  135. package/src/lib/components/SuperFluid/Content/index.js +2 -2
  136. package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
  137. package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
  138. package/src/lib/components/Tabs/tabs.js +11 -11
  139. package/src/lib/components/Tabs/tabs.stories.js +20 -20
  140. package/src/lib/components/Tags/tags.js +26 -24
  141. package/src/lib/components/Tags/tags.stories.js +19 -19
  142. package/src/lib/components/breakpoints.js +3 -3
  143. package/src/lib/components/checkbox.js +7 -6
  144. package/src/lib/components/colors.js +30 -28
  145. package/src/lib/components/dropdownButton.js +36 -39
  146. package/src/lib/components/examples/InfoAccordion.js +1 -1
  147. package/src/lib/components/globalStyles.js +2 -2
  148. package/src/lib/components/iconStyles.js +45 -48
  149. package/src/lib/components/index.js +47 -46
  150. package/src/lib/components/input.js +20 -20
  151. package/src/lib/components/text.js +1 -1
  152. package/src/lib/components/typography.js +14 -14
  153. package/src/reportWebVitals.js +1 -1
  154. package/dist/components/checkboxToggler.js +0 -50
  155. package/src/lib/components/checkboxToggler.js +0 -19
package/package.json CHANGED
@@ -1,24 +1,35 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.5.8",
3
+ "version": "1.6.1",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
7
- "start": "PORT=3002 react-scripts start",
8
7
  "build": "react-scripts build",
9
- "test": "react-scripts test",
10
- "eject": "react-scripts eject",
8
+ "build-storybook": "build-storybook",
11
9
  "clean": "rimraf dist",
12
10
  "compile": "npm run clean && cross-env NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,stories.js,__snapshots__",
11
+ "eject": "react-scripts eject",
12
+ "start": "PORT=3002 react-scripts start",
13
13
  "storybook": "start-storybook -p 6006",
14
- "build-storybook": "build-storybook"
14
+ "test": "react-scripts test"
15
15
  },
16
- "peerDependencies": {
17
- "react": "^17.0.2",
18
- "react-dom": "^17.0.2",
19
- "react-scripts": "4.0.3",
20
- "web-vitals": "^1.1.2",
21
- "babel-loader": "8.1.0"
16
+ "browserslist": {
17
+ "production": [
18
+ ">0.2%",
19
+ "not dead",
20
+ "not op_mini all"
21
+ ],
22
+ "development": [
23
+ "last 1 chrome version",
24
+ "last 1 firefox version",
25
+ "last 1 safari version"
26
+ ]
27
+ },
28
+ "eslintConfig": {
29
+ "extends": [
30
+ "react-app",
31
+ "react-app/jest"
32
+ ]
22
33
  },
23
34
  "dependencies": {
24
35
  "@emotion/react": "^11.7.1",
@@ -30,6 +41,7 @@
30
41
  "js-file-download": "^0.4.12",
31
42
  "node-sass": "^6.0.1",
32
43
  "polished": "^4.1.3",
44
+ "prop-types": "^15.8.1",
33
45
  "react": "^17.0.2",
34
46
  "react-dom": "^17.0.2",
35
47
  "react-router-dom": "^5.3.0",
@@ -38,29 +50,14 @@
38
50
  "styled-components": "^5.3.0",
39
51
  "web-vitals": "^1.1.2"
40
52
  },
41
- "eslintConfig": {
42
- "extends": [
43
- "react-app",
44
- "react-app/jest"
45
- ]
46
- },
47
- "browserslist": {
48
- "production": [
49
- ">0.2%",
50
- "not dead",
51
- "not op_mini all"
52
- ],
53
- "development": [
54
- "last 1 chrome version",
55
- "last 1 firefox version",
56
- "last 1 safari version"
57
- ]
58
- },
59
53
  "devDependencies": {
60
- "@babel/cli": "^7.14.8",
54
+ "@babel/cli": "^7.16.0",
55
+ "@babel/core": "^7.16.0",
61
56
  "@babel/preset-env": "^7.14.8",
62
57
  "@babel/preset-react": "^7.14.5",
63
- "cross-env": "^7.0.3",
58
+ "@commitlint/cli": "^14.1.0",
59
+ "@commitlint/config-conventional": "^14.1.0",
60
+ "@commitlint/travis-cli": "^14.1.0",
64
61
  "@storybook/addon-actions": "^6.3.2",
65
62
  "@storybook/addon-controls": "^6.3.12",
66
63
  "@storybook/addon-docs": "^6.3.12",
@@ -72,6 +69,32 @@
72
69
  "@storybook/preset-create-react-app": "^3.2.0",
73
70
  "@storybook/react": "^6.3.2",
74
71
  "@storybook/theming": "^6.4.9",
72
+ "babel-eslint": "^10.1.0",
73
+ "babel-plugin-react-intl": "^5.1.18",
74
+ "babel-plugin-styled-components": "^1.13.3",
75
+ "babel-preset-react-app": "^10.0.0",
76
+ "commitizen": "^4.2.4",
77
+ "cross-env": "^7.0.3",
78
+ "cz-conventional-changelog": "^3.3.0",
79
+ "eslint-config-airbnb": "^18.2.1",
80
+ "eslint-config-prettier": "^8.3.0",
81
+ "eslint-plugin-import": "^2.25.2",
82
+ "eslint-plugin-jest": "^25.2.2",
83
+ "eslint-plugin-jsdoc": "^32.2.0",
84
+ "eslint-plugin-jsx-a11y": "^6.4.1",
85
+ "eslint-plugin-prettier": "^4.0.0",
86
+ "eslint-plugin-react": "^7.26.1",
87
+ "generate-changelog": "^1.8.0",
88
+ "husky": "^7.0.4",
89
+ "lint-staged": "^11.2.6",
90
+ "prettier": "^2.4.1",
75
91
  "storybook-addon-jsx": "^7.3.14"
92
+ },
93
+ "peerDependencies": {
94
+ "babel-loader": "8.1.0",
95
+ "react": "^17.0.2",
96
+ "react-dom": "^17.0.2",
97
+ "react-scripts": "4.0.3",
98
+ "web-vitals": "^1.1.2"
76
99
  }
77
100
  }
package/src/App.js CHANGED
@@ -1,11 +1,10 @@
1
- import React, { useState } from "react";
2
- import { BmModal, BmButton, GlobalStyle } from "./lib/components";
3
- import { BmProfileIcon } from "./lib/components/ProfileIcon/ProfileIcon";
4
- import beem from './lib/assets/beem.jpeg';
1
+ import React, { useState } from 'react';
2
+ import { GlobalStyle, BmModal, BmButton } from './lib/components';
3
+ import { BmCheckboxToggle } from './lib/components/Checkbox/checkboxToggler';
5
4
 
6
5
  const Chat = () => {
6
+ const [checked, setChecked] = useState(false);
7
7
  const [showModal, setShowModal] = useState(false);
8
-
9
8
  return (
10
9
  <>
11
10
  <GlobalStyle />
@@ -20,14 +19,18 @@ const Chat = () => {
20
19
  <h5>This modal has a sub heading</h5>
21
20
  </BmModal.SubHeader>
22
21
  <BmModal.Body>
23
- <BmProfileIcon img={beem} content={<h3>TV</h3>} channel="facebook" size="xsmall" />
22
+ <BmCheckboxToggle
23
+ checked={checked}
24
+ onChange={() => setChecked(!checked)}
25
+ disabled
26
+ label={<h3>Field Label</h3>}
27
+ />
24
28
  <p>This is a body</p>
25
29
  </BmModal.Body>
26
30
  <BmModal.Footer>
27
31
  <p>This is a footer</p>
28
32
  </BmModal.Footer>
29
33
  </BmModal>
30
- <BmProfileIcon img={beem} channel="instagram" />
31
34
  </>
32
35
  );
33
36
  };
package/src/index.js CHANGED
@@ -1,15 +1,13 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom";
3
- import App from "./App";
4
- import reportWebVitals from "./reportWebVitals";
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import App from './App';
4
+ import reportWebVitals from './reportWebVitals';
5
+
5
6
  ReactDOM.render(
6
7
  <React.StrictMode>
7
8
  <App />
8
9
  </React.StrictMode>,
9
- document.getElementById("root"),
10
+ document.getElementById('root')
10
11
  );
11
12
 
12
- // If you want to start measuring performance in your app, pass a function
13
- // to log results (for example: reportWebVitals(console.log))
14
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
15
13
  reportWebVitals();
@@ -1,14 +1,16 @@
1
- import React, { useState } from "react";
2
- import styled from "styled-components";
3
- import PropTypes from "prop-types";
4
- import { BmPrimaryWhite } from "../colors";
5
- import { BmIcons } from "../iconStyles";
6
- import { KeyboardArrowDown, KeyboardArrowUp } from "@material-ui/icons";
1
+ /* eslint-disable react/display-name */
2
+ /* eslint-disable react/destructuring-assignment */
3
+ import React, { useState } from 'react';
4
+ import styled from 'styled-components';
5
+ import PropTypes from 'prop-types';
6
+ import { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons';
7
+ import { BmPrimaryWhite } from '../colors';
8
+ import { BmIcons } from '../iconStyles';
7
9
 
8
10
  const { Provider, Consumer } = React.createContext({});
9
11
 
10
12
  const Dropdown = (value, rest) => {
11
- if (value.expandIcon && value.expandIcon === "none") {
13
+ if (value.expandIcon && value.expandIcon === 'none') {
12
14
  return;
13
15
  }
14
16
  if (!value.expandIcon) {
@@ -18,7 +20,7 @@ const Dropdown = (value, rest) => {
18
20
  <BmIcons icon={<KeyboardArrowDown />} {...rest} />
19
21
  );
20
22
  }
21
- if (value.expandIcon && value.expandIcon !== "none") {
23
+ if (value.expandIcon && value.expandIcon !== 'none') {
22
24
  return <BmIcons icon={value.expandIcon} />;
23
25
  }
24
26
  };
@@ -44,12 +46,28 @@ const BmAccordionWrapper = styled.div`
44
46
  flex-direction: column;
45
47
  `;
46
48
 
47
- const BmAccordion = ({ children, disabled, expandIcon, Open, expandIconPosition, ...rest }) => {
48
- const [toggle, setToggle] = useState(Open ? true : false);
49
+ const BmAccordion = ({
50
+ children,
51
+ disabled,
52
+ expandIcon,
53
+ Open,
54
+ expandIconPosition,
55
+ ...rest
56
+ }) => {
57
+ const [toggle, setToggle] = useState(!!Open);
49
58
 
50
59
  return (
51
60
  <BmAccordionWrapper>
52
- <Provider value={{ toggle, setToggle, disabled, expandIcon, expandIconPosition, ...rest }}>
61
+ <Provider
62
+ value={{
63
+ toggle,
64
+ setToggle,
65
+ disabled,
66
+ expandIcon,
67
+ expandIconPosition,
68
+ ...rest,
69
+ }}
70
+ >
53
71
  {children}
54
72
  </Provider>
55
73
  </BmAccordionWrapper>
@@ -74,12 +92,12 @@ BmAccordion.Title = ({
74
92
  : value.setToggle(false)
75
93
  }
76
94
  >
77
- {value.expandIconPosition === "left" ||
78
- (value.expandIconPosition === undefined && Dropdown(value, rest))}
95
+ {value.expandIconPosition === 'left' ||
96
+ (value.expandIconPosition === undefined && Dropdown(value, rest))}
79
97
  {leadingIcon && <BmIcons icon={leadingIcon} size={size} />}
80
98
  <BmAccordionDetails>{children}</BmAccordionDetails>
81
99
  {trailingIcon && <BmIcons icon={trailingIcon} size={size} />}
82
- {value.expandIconPosition === "right" && Dropdown(value, rest)}
100
+ {value.expandIconPosition === 'right' && Dropdown(value, rest)}
83
101
  </BmAccordionMenu>
84
102
  )}
85
103
  </Consumer>
@@ -1,32 +1,32 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import BmAccordion from "./Accordion";
4
- import { text, boolean, select } from "@storybook/addon-knobs";
5
- import { Favorite, Home } from "@material-ui/icons";
2
+ import React from 'react';
3
+ import { text, boolean, select } from '@storybook/addon-knobs';
4
+ import { Favorite, Home } from '@material-ui/icons';
5
+ import BmAccordion from './Accordion';
6
6
 
7
7
  export default {
8
8
  component: BmAccordion,
9
9
  subcomponents: BmAccordion.Title,
10
- title: "components/Accordion",
10
+ title: 'components/Accordion',
11
11
  argTypes: {
12
12
  size: {
13
- options: ["small", "medium", "large"],
14
- control: { type: "select" },
15
- description: "Size of the icons",
16
- defaultValue: { summary: "large" },
13
+ options: ['small', 'medium', 'large'],
14
+ control: { type: 'select' },
15
+ description: 'Size of the icons',
16
+ defaultValue: { summary: 'large' },
17
17
  },
18
18
  disabled: {
19
- description: "Optional",
19
+ description: 'Optional',
20
20
  defaultValue: { summary: false },
21
- control: { type: "boolean" },
21
+ control: { type: 'boolean' },
22
22
  },
23
23
  Open: {
24
- description: "Accordion body will be open initially",
24
+ description: 'Accordion body will be open initially',
25
25
  defaultValue: { summary: false },
26
- control: { type: "boolean" },
26
+ control: { type: 'boolean' },
27
27
  },
28
28
  children: {
29
- description: "Accordion Title Text",
29
+ description: 'Accordion Title Text',
30
30
  defaultValue: { summary: undefined },
31
31
  },
32
32
  expandIcon: {
@@ -34,51 +34,51 @@ export default {
34
34
  defaultValue: { summary: undefined },
35
35
  },
36
36
  expandIconPosition: {
37
- options: ["left", "right"],
38
- control: { type: "select" },
39
- description: "Position of the expand Icon",
40
- defaultValue: { summary: "left" },
37
+ options: ['left', 'right'],
38
+ control: { type: 'select' },
39
+ description: 'Position of the expand Icon',
40
+ defaultValue: { summary: 'left' },
41
41
  },
42
42
  leadingIcon: {
43
- description: "Material-UI icon(optional)",
43
+ description: 'Material-UI icon(optional)',
44
44
  defaultValue: { summary: undefined },
45
45
  },
46
46
  trailingIcon: {
47
- description: "Material-UI icon(optional)",
47
+ description: 'Material-UI icon(optional)',
48
48
  defaultValue: { summary: undefined },
49
49
  },
50
50
  },
51
51
  };
52
52
 
53
53
  const optionSize = {
54
- small: "small",
55
- medium: "medium",
56
- large: "large",
54
+ small: 'small',
55
+ medium: 'medium',
56
+ large: 'large',
57
57
  };
58
58
 
59
59
  const optionExpandIcon = {
60
- left: "left",
61
- right: "medium",
60
+ left: 'left',
61
+ right: 'medium',
62
62
  };
63
63
 
64
64
  export const Accordion = () => {
65
65
  return (
66
66
  <div>
67
67
  <BmAccordion
68
- disabled={boolean("disabled", false)}
69
- Open={boolean("disabled", false)}
68
+ disabled={boolean('disabled', false)}
69
+ Open={boolean('disabled', false)}
70
70
  >
71
71
  <BmAccordion.Title
72
72
  leadingIcon={<Home />}
73
73
  trailingIcon={<Favorite />}
74
- size={select("size", optionSize, "large")}
74
+ size={select('size', optionSize, 'large')}
75
75
  expandIconPosition={select(
76
- "expandIconPosition",
76
+ 'expandIconPosition',
77
77
  optionExpandIcon,
78
- "left",
78
+ 'left'
79
79
  )}
80
80
  >
81
- <h3>{text("children", "Accordion")}</h3>
81
+ <h3>{text('children', 'Accordion')}</h3>
82
82
  </BmAccordion.Title>
83
83
  <BmAccordion.Body>Accordion Body</BmAccordion.Body>
84
84
  </BmAccordion>
@@ -1,45 +1,49 @@
1
- import { Person } from "@material-ui/icons";
2
- import React from "react";
3
- import PropTypes from "prop-types";
4
- import styled from "styled-components";
5
- import { BmGrey100, BmPrimaryBlue } from "../colors";
6
- import { BmAvatarIcon } from "../iconStyles";
1
+ import { Person } from '@material-ui/icons';
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import styled from 'styled-components';
7
5
  import SmartToyIcon from '@mui/icons-material/SmartToy';
6
+ import ChatIcon from '@mui/icons-material/Chat';
7
+ import { BmGrey100, BmPrimaryBlue } from '../colors';
8
+ import { BmAvatarIcon } from '../iconStyles';
8
9
 
9
10
  export const BmAvatarWrapper = styled.div`
10
11
  display: flex;
11
12
  align-items: center;
12
13
  justify-content: center;
13
14
  height: ${({ size }) => {
14
- if (size === "large") return "3.429rem";
15
- if (size === "medium") return "2.286rem";
16
- if (size === "small") return "1.714rem";
17
- if (size === "xsmall") return "1.429rem";
18
- if (!size) return "3.429rem";
15
+ if (size === 'large') return '3.429rem';
16
+ if (size === 'medium') return '2.286rem';
17
+ if (size === 'small') return '1.714rem';
18
+ if (size === 'xsmall') return '1.429rem';
19
+ if (!size) return '3.429rem';
19
20
  return size;
20
21
  }};
21
22
  width: ${({ size }) => {
22
- if (size === "large") return "3.429rem";
23
- if (size === "medium") return "2.286rem";
24
- if (size === "small") return "1.714rem";
25
- if (size === "xsmall") return "1.429rem";
26
- if (!size) return "3.429rem";
23
+ if (size === 'large') return '3.429rem';
24
+ if (size === 'medium') return '2.286rem';
25
+ if (size === 'small') return '1.714rem';
26
+ if (size === 'xsmall') return '1.429rem';
27
+ if (!size) return '3.429rem';
27
28
  return size;
28
29
  }};
29
30
  background: ${({ user }) => {
30
- if (user === "chatbot") return `${BmPrimaryBlue}`;
31
- if (user === "employee") return `${BmPrimaryBlue}`;
31
+ if (user === 'chatbot') return `${BmPrimaryBlue}`;
32
+ if (user === 'employee') return `${BmPrimaryBlue}`;
33
+ if (user === 'sms') return `${BmPrimaryBlue}`;
32
34
  return `${BmGrey100}`;
33
35
  }};
34
36
  border-radius: ${({ type }) => {
35
- if (type === "circle") return "7.143rem";
36
- if (type === "square") return "0.179rem";
37
- return "7.143rem";
37
+ if (type === 'circle') return '7.143rem';
38
+ if (type === 'square') return '0.179rem';
39
+ return '7.143rem';
38
40
  }};
39
41
  border: 0.071rem solid
40
42
  ${({ user }) => {
41
- if (user === "chatbot") return `${BmPrimaryBlue}`;
42
- if (user === "employee") return `${BmPrimaryBlue}`;
43
+ if (user === 'chatbot') return `${BmPrimaryBlue}`;
44
+ if (user === 'employee') return `${BmPrimaryBlue}`;
45
+ if (user === 'sms') return `${BmPrimaryBlue}`;
46
+
43
47
  return `${BmGrey100}`;
44
48
  }};
45
49
  `;
@@ -48,15 +52,26 @@ const BmAvatar = (props) => {
48
52
  const { user, size, color, ...rest } = props;
49
53
  return (
50
54
  <BmAvatarWrapper user={user} size={size} {...rest}>
51
- {user === "employee" && (
55
+ {user === 'employee' && (
52
56
  <BmAvatarIcon icon={<Person />} size={size} color={color} {...rest} />
53
57
  )}
54
- {user === "chatbot" && (
55
- <BmAvatarIcon icon={<SmartToyIcon />} size={size} color={color} {...rest} />
58
+ {user === 'chatbot' && (
59
+ <BmAvatarIcon
60
+ icon={<SmartToyIcon />}
61
+ size={size}
62
+ color={color}
63
+ {...rest}
64
+ />
56
65
  )}
57
- {user !== "chatbot" && user !== "employee" && user !== "default" && (
58
- <BmAvatarIcon icon={user} size={size} color={color} {...rest} />
66
+ {user === 'sms' && (
67
+ <BmAvatarIcon icon={<ChatIcon />} size={size} color={color} {...rest} />
59
68
  )}
69
+ {user !== 'chatbot' &&
70
+ user !== 'employee' &&
71
+ user !== 'sms' &&
72
+ user !== 'default' && (
73
+ <BmAvatarIcon icon={user} size={size} color={color} {...rest} />
74
+ )}
60
75
  </BmAvatarWrapper>
61
76
  );
62
77
  };
@@ -68,4 +83,4 @@ BmAvatar.propTypes = {
68
83
  user: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
69
84
  };
70
85
 
71
- export default BmAvatar;
86
+ export default BmAvatar;
@@ -1,23 +1,23 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import BmAvatar from "./avatars";
4
- import { Home } from "@material-ui/icons";
2
+ import React from 'react';
3
+ import { Home } from '@material-ui/icons';
4
+ import BmAvatar from './avatars';
5
5
 
6
6
  export default {
7
7
  component: BmAvatar,
8
- title: "components/Avatars",
8
+ title: 'components/Avatars',
9
9
  argTypes: {
10
10
  size: {
11
- options: ["xsmall", "small", "medium", "large"],
12
- control: { type: "select" },
13
- description: "Size of the Avatar",
14
- defaultValue: { summary: "large" },
11
+ options: ['xsmall', 'small', 'medium', 'large'],
12
+ control: { type: 'select' },
13
+ description: 'Size of the Avatar',
14
+ defaultValue: { summary: 'large' },
15
15
  },
16
16
  type: {
17
- options: ["circle", "square"],
18
- control: { type: "select" },
19
- description: "Shape of the Avatar",
20
- defaultValue: { summary: "circle" },
17
+ options: ['circle', 'square'],
18
+ control: { type: 'select' },
19
+ description: 'Shape of the Avatar',
20
+ defaultValue: { summary: 'circle' },
21
21
  },
22
22
  user: {
23
23
  description:
@@ -31,15 +31,15 @@ const MainAvatar = (args) => <BmAvatar {...args} />;
31
31
 
32
32
  export const Avatar = MainAvatar.bind({});
33
33
  Avatar.args = {
34
- user: "chatbot",
35
- size: "large",
36
- type: "circle",
34
+ user: 'chatbot',
35
+ size: 'large',
36
+ type: 'circle',
37
37
  };
38
38
 
39
39
  export const CustomAvatar = MainAvatar.bind({});
40
40
  CustomAvatar.args = {
41
41
  user: <Home />,
42
- size: "large",
43
- type: "square",
44
- color: "#000000",
42
+ size: 'large',
43
+ type: 'square',
44
+ color: '#000000',
45
45
  };
@@ -1,28 +1,28 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import BmBanner from "./bannerCards";
4
- import { BmButton, BmTag } from "..";
5
- import { BmPrimaryBlue, BmSecondaryYellow } from "../colors";
2
+ import React from 'react';
3
+ import BmBanner from './bannerCards';
4
+ import { BmButton, BmTag } from '..';
5
+ import { BmPrimaryBlue, BmSecondaryYellow } from '../colors';
6
6
 
7
7
  export default {
8
8
  component: BmBanner,
9
- title: "components/Banner",
9
+ title: 'components/Banner',
10
10
  argTypes: {
11
11
  border: {
12
- options: ["dashed", "solid"],
13
- control: { type: "select" },
14
- description: "Banner border",
15
- defaultValue: { summary: "none" },
12
+ options: ['dashed', 'solid'],
13
+ control: { type: 'select' },
14
+ description: 'Banner border',
15
+ defaultValue: { summary: 'none' },
16
16
  },
17
17
  bannerBg: {
18
18
  description:
19
19
  "Banner Background Color, Can be set as 'default', or custom color",
20
20
  },
21
21
  content: {
22
- options: ["left", "center", "right"],
23
- control: { type: "select" },
22
+ options: ['left', 'center', 'right'],
23
+ control: { type: 'select' },
24
24
  description:
25
- "Aligning content of banner, will not work if closeButton is present",
25
+ 'Aligning content of banner, will not work if closeButton is present',
26
26
  },
27
27
  },
28
28
  };
@@ -42,8 +42,8 @@ export const SampleBanner = () => {
42
42
  export const AnnouncementBanner = () => {
43
43
  return (
44
44
  <BmBanner bannerBg={`${BmPrimaryBlue}`} closeButton>
45
- <h3 style={{ color: "white" }}>Special Announcement Title</h3>
46
- <p style={{ color: "white" }}>Message Text</p>
45
+ <h3 style={{ color: 'white' }}>Special Announcement Title</h3>
46
+ <p style={{ color: 'white' }}>Message Text</p>
47
47
  <div>
48
48
  <BmButton variant="neutral" size="small">
49
49
  Label
@@ -59,8 +59,8 @@ export const FeatureBanner = () => {
59
59
  <BmTag variant="light">
60
60
  <p>New</p>
61
61
  </BmTag>
62
- <h3 style={{ color: "white" }}>New Feature Title</h3>
63
- <p style={{ color: "white" }}>Message Text</p>
62
+ <h3 style={{ color: 'white' }}>New Feature Title</h3>
63
+ <p style={{ color: 'white' }}>Message Text</p>
64
64
  <div>
65
65
  <BmButton size="small">Label</BmButton>
66
66
  </div>
@@ -77,6 +77,5 @@ export const GenericBanner = () => {
77
77
  <BmButton size="small">Label</BmButton>
78
78
  </div>
79
79
  </BmBanner>
80
-
81
80
  );
82
81
  };