beem-component 1.5.6 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/.babelrc +17 -0
  2. package/.eslintrc +62 -0
  3. package/.prettierrc +6 -0
  4. package/dist/assets/fb.png +0 -0
  5. package/dist/assets/insta.png +0 -0
  6. package/dist/assets/wa.png +0 -0
  7. package/dist/components/Accordion/Accordion.js +31 -64
  8. package/dist/components/Accordion/Accordion.stories.js +29 -29
  9. package/dist/components/Avatars/avatars.js +31 -46
  10. package/dist/components/Avatars/avatars.stories.js +18 -18
  11. package/dist/components/BannerCard/bannerCard.stories.js +14 -14
  12. package/dist/components/BannerCard/bannerCards.js +30 -48
  13. package/dist/components/Buttons/Stories/basicbutton.stories.js +24 -24
  14. package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  15. package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +17 -17
  16. package/dist/components/Buttons/buttonAlertIcons.js +28 -44
  17. package/dist/components/Buttons/buttonDropdown copy.js +15 -18
  18. package/dist/components/Buttons/buttonDropdown.js +2 -2
  19. package/dist/components/Buttons/buttonIconsOnly.js +35 -49
  20. package/dist/components/Buttons/buttons.js +75 -86
  21. package/dist/components/Cards/cards.js +15 -11
  22. package/dist/components/Cards/cards.stories.js +8 -8
  23. package/dist/components/ChatComponents/ChatBody/chatBody.js +80 -69
  24. package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +6 -6
  25. package/dist/components/ChatComponents/ChatBody/sessionDetails.js +9 -16
  26. package/dist/components/ChatComponents/ChatHeader/chatHeader.js +5 -7
  27. package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -3
  28. package/dist/components/ChatComponents/ColorPicker/colorPicker.js +5 -7
  29. package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
  30. package/dist/components/ChatComponents/ContactCards/contactCards.js +15 -12
  31. package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +4 -4
  32. package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +14 -10
  33. package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
  34. package/dist/components/ChatComponents/InfoTab/infoTab.js +11 -9
  35. package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +6 -6
  36. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +5 -7
  37. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
  38. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +11 -9
  39. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +15 -13
  40. package/dist/components/Chats/chat.js +41 -32
  41. package/dist/components/Chats/chatInput.js +18 -14
  42. package/dist/components/Chats/chatwrapper.js +20 -12
  43. package/dist/components/Checkbox/checkboxToggler.js +61 -0
  44. package/dist/components/Checkbox/checkboxToggler.stories.js +81 -0
  45. package/dist/components/Lists/listBox.js +14 -30
  46. package/dist/components/Lists/listBox.stories.js +12 -23
  47. package/dist/components/Lists/listHeader.stories.js +13 -13
  48. package/dist/components/Lists/listheader.js +12 -27
  49. package/dist/components/Lists/rowLabels.js +19 -30
  50. package/dist/components/Lists/rowLabels.stories.js +22 -25
  51. package/dist/components/Loader/loader.js +17 -31
  52. package/dist/components/Loader/loader.stories.js +13 -13
  53. package/dist/components/MainWrapper/index.js +5 -7
  54. package/dist/components/MessageCounter/MessageCounter.stories.js +14 -14
  55. package/dist/components/MessageCounter/messageCounter.js +16 -18
  56. package/dist/components/Modals/modal.js +38 -57
  57. package/dist/components/Modals/modals.stories.js +38 -29
  58. package/dist/components/NoteBar/noteBar.js +28 -57
  59. package/dist/components/NoteBar/noteBar.stories.js +17 -17
  60. package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  61. package/dist/components/PerformanceIndicator/performanceIndicator.js +21 -34
  62. package/dist/components/Pills/pills.js +24 -56
  63. package/dist/components/Pills/pills.stories.js +21 -23
  64. package/dist/components/ProfileIcon/ProfileIcon.js +96 -0
  65. package/dist/components/ProfileIcon/profileIcon.stories.js +82 -0
  66. package/dist/components/ProgressBar/progressbar.js +15 -17
  67. package/dist/components/ProgressBar/progressbar.stories.js +8 -10
  68. package/dist/components/ProgressRing/progressRing.js +38 -54
  69. package/dist/components/ProgressRing/progressRing.stories.js +16 -16
  70. package/dist/components/RouteLink/link.js +8 -10
  71. package/dist/components/RouteLink/link.stories.js +3 -3
  72. package/dist/components/ScrollBar/scrollBar.js +19 -17
  73. package/dist/components/SuperFluid/Content/index.js +5 -7
  74. package/dist/components/SuperFluid/ContentTitle.js/index.js +14 -10
  75. package/dist/components/SuperFluid/SegmentCard/index.js +22 -13
  76. package/dist/components/Tabs/tabs.js +16 -35
  77. package/dist/components/Tabs/tabs.stories.js +19 -19
  78. package/dist/components/Tags/tags.js +33 -65
  79. package/dist/components/Tags/tags.stories.js +18 -18
  80. package/dist/components/breakpoints.js +3 -3
  81. package/dist/components/chatHeader.js +17 -11
  82. package/dist/components/checkbox.js +27 -26
  83. package/dist/components/colors.js +32 -30
  84. package/dist/components/contacts.js +39 -25
  85. package/dist/components/dropdown.js +29 -35
  86. package/dist/components/dropdownButton.js +50 -53
  87. package/dist/components/dropdownItems.js +26 -19
  88. package/dist/components/examples/App.js +137 -0
  89. package/dist/components/examples/InfoAccordion.js +23 -0
  90. package/dist/components/examples/chatBodyExample.js +68 -0
  91. package/dist/components/examples/selectExample.js +63 -0
  92. package/dist/components/globalStyles.js +1 -5
  93. package/dist/components/iconStyles.js +56 -58
  94. package/dist/components/index.js +35 -23
  95. package/dist/components/input.js +33 -36
  96. package/dist/components/logo.js +9 -16
  97. package/dist/components/navbar.js +24 -13
  98. package/dist/components/search.js +20 -21
  99. package/dist/components/text.js +15 -6
  100. package/dist/components/typography.js +14 -14
  101. package/dist/components/wrapper.js +8 -8
  102. package/package.json +54 -30
  103. package/src/App.js +31 -175
  104. package/src/index.js +6 -8
  105. package/src/lib/assets/fb.png +0 -0
  106. package/src/lib/assets/insta.png +0 -0
  107. package/src/lib/assets/wa.png +0 -0
  108. package/src/lib/components/Accordion/Accordion.js +32 -14
  109. package/src/lib/components/Accordion/Accordion.stories.js +31 -31
  110. package/src/lib/components/Avatars/avatars.js +33 -28
  111. package/src/lib/components/Avatars/avatars.stories.js +18 -18
  112. package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
  113. package/src/lib/components/BannerCard/bannerCards.js +18 -18
  114. package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
  115. package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  116. package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
  117. package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
  118. package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
  119. package/src/lib/components/Buttons/buttons.js +70 -73
  120. package/src/lib/components/Cards/cards.js +2 -3
  121. package/src/lib/components/Cards/cards.stories.js +10 -10
  122. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +46 -45
  123. package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
  124. package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
  125. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
  126. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
  127. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
  128. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
  129. package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
  130. package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
  131. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
  132. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
  133. package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
  134. package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
  135. package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
  136. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
  137. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
  138. package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
  139. package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
  140. package/src/lib/components/Lists/listBox.js +7 -7
  141. package/src/lib/components/Lists/listBox.stories.js +8 -11
  142. package/src/lib/components/Lists/listHeader.stories.js +13 -13
  143. package/src/lib/components/Lists/listheader.js +7 -7
  144. package/src/lib/components/Lists/rowLabels.js +6 -6
  145. package/src/lib/components/Lists/rowLabels.stories.js +18 -18
  146. package/src/lib/components/Loader/loader.js +13 -13
  147. package/src/lib/components/Loader/loader.stories.js +14 -14
  148. package/src/lib/components/MainWrapper/index.js +2 -2
  149. package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
  150. package/src/lib/components/MessageCounter/messageCounter.js +16 -16
  151. package/src/lib/components/Modals/modal.js +33 -23
  152. package/src/lib/components/Modals/modals.stories.js +34 -9
  153. package/src/lib/components/NoteBar/noteBar.js +20 -20
  154. package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
  155. package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  156. package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
  157. package/src/lib/components/Pills/pills.js +16 -16
  158. package/src/lib/components/Pills/pills.stories.js +22 -23
  159. package/src/lib/components/ProfileIcon/ProfileIcon.js +76 -0
  160. package/src/lib/components/ProfileIcon/profileIcon.stories.js +57 -0
  161. package/src/lib/components/ProgressBar/progressbar.js +4 -5
  162. package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
  163. package/src/lib/components/ProgressRing/progressRing.js +25 -24
  164. package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
  165. package/src/lib/components/RouteLink/link.js +10 -8
  166. package/src/lib/components/RouteLink/link.stories.js +4 -4
  167. package/src/lib/components/ScrollBar/scrollBar.js +15 -14
  168. package/src/lib/components/SuperFluid/Content/index.js +2 -2
  169. package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
  170. package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
  171. package/src/lib/components/Tabs/tabs.js +11 -11
  172. package/src/lib/components/Tabs/tabs.stories.js +20 -20
  173. package/src/lib/components/Tags/tags.js +26 -24
  174. package/src/lib/components/Tags/tags.stories.js +19 -19
  175. package/src/lib/components/breakpoints.js +3 -3
  176. package/src/lib/components/checkbox.js +7 -6
  177. package/src/lib/components/colors.js +30 -28
  178. package/src/lib/components/dropdownButton.js +36 -39
  179. package/src/lib/components/examples/App.js +181 -0
  180. package/src/{InfoAccordion.js → lib/components/examples/InfoAccordion.js} +1 -1
  181. package/src/{App1.js → lib/components/examples/chatBodyExample.js} +2 -2
  182. package/src/{App copy.js → lib/components/examples/selectExample.js} +0 -0
  183. package/src/lib/components/globalStyles.js +4 -5
  184. package/src/lib/components/iconStyles.js +45 -48
  185. package/src/lib/components/index.js +48 -45
  186. package/src/lib/components/input.js +20 -20
  187. package/src/lib/components/text.js +17 -3
  188. package/src/lib/components/typography.js +14 -14
  189. package/src/reportWebVitals.js +1 -1
  190. package/babel.config.js +0 -12
  191. package/dist/components/checkboxToggler.js +0 -50
  192. package/dist/components/example.js +0 -47
  193. package/dist/components/sidebar.js +0 -32
  194. package/dist/components/tabs.js +0 -106
  195. package/dist/components/tags.js +0 -100
  196. package/dist/images/azam.png +0 -0
  197. package/dist/images/azam1.png +0 -0
  198. package/src/ChatHeader.js +0 -22
  199. package/src/CustomerInfo.js +0 -46
  200. package/src/MainChat.js +0 -41
  201. package/src/SideBar.js +0 -81
  202. package/src/lib/components/checkboxToggler.js +0 -19
  203. package/src/lib/components/example.js +0 -30
  204. package/src/lib/components/sidebar.js +0 -33
  205. package/src/lib/components/tabs.js +0 -123
  206. package/src/lib/components/tags.js +0 -101
  207. package/src/lib/images/azam.png +0 -0
  208. package/src/lib/images/azam1.png +0 -0
  209. package/src/list.scss +0 -4
@@ -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,45 @@
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 { BmGrey100, BmPrimaryBlue } from '../colors';
7
+ import { BmAvatarIcon } from '../iconStyles';
8
8
 
9
9
  export const BmAvatarWrapper = styled.div`
10
10
  display: flex;
11
11
  align-items: center;
12
12
  justify-content: center;
13
13
  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";
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';
19
19
  return size;
20
20
  }};
21
21
  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";
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';
27
27
  return size;
28
28
  }};
29
29
  background: ${({ user }) => {
30
- if (user === "chatbot") return `${BmPrimaryBlue}`;
31
- if (user === "employee") return `${BmPrimaryBlue}`;
30
+ if (user === 'chatbot') return `${BmPrimaryBlue}`;
31
+ if (user === 'employee') return `${BmPrimaryBlue}`;
32
32
  return `${BmGrey100}`;
33
33
  }};
34
34
  border-radius: ${({ type }) => {
35
- if (type === "circle") return "7.143rem";
36
- if (type === "square") return "0.179rem";
37
- return "7.143rem";
35
+ if (type === 'circle') return '7.143rem';
36
+ if (type === 'square') return '0.179rem';
37
+ return '7.143rem';
38
38
  }};
39
39
  border: 0.071rem solid
40
40
  ${({ user }) => {
41
- if (user === "chatbot") return `${BmPrimaryBlue}`;
42
- if (user === "employee") return `${BmPrimaryBlue}`;
41
+ if (user === 'chatbot') return `${BmPrimaryBlue}`;
42
+ if (user === 'employee') return `${BmPrimaryBlue}`;
43
43
  return `${BmGrey100}`;
44
44
  }};
45
45
  `;
@@ -48,13 +48,18 @@ const BmAvatar = (props) => {
48
48
  const { user, size, color, ...rest } = props;
49
49
  return (
50
50
  <BmAvatarWrapper user={user} size={size} {...rest}>
51
- {user === "employee" && (
51
+ {user === 'employee' && (
52
52
  <BmAvatarIcon icon={<Person />} size={size} color={color} {...rest} />
53
53
  )}
54
- {user === "chatbot" && (
55
- <BmAvatarIcon icon={<SmartToyIcon />} size={size} color={color} {...rest} />
54
+ {user === 'chatbot' && (
55
+ <BmAvatarIcon
56
+ icon={<SmartToyIcon />}
57
+ size={size}
58
+ color={color}
59
+ {...rest}
60
+ />
56
61
  )}
57
- {user !== "chatbot" && user !== "employee" && user !== "default" && (
62
+ {user !== 'chatbot' && user !== 'employee' && user !== 'default' && (
58
63
  <BmAvatarIcon icon={user} size={size} color={color} {...rest} />
59
64
  )}
60
65
  </BmAvatarWrapper>
@@ -68,4 +73,4 @@ BmAvatar.propTypes = {
68
73
  user: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
69
74
  };
70
75
 
71
- export default BmAvatar;
76
+ 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
  };
@@ -1,39 +1,39 @@
1
- import React, { useState } from "react";
2
- import { Clear } from "@material-ui/icons";
3
- import styled from "styled-components";
4
- import { BmIcons } from "..";
5
- import { BmGrey50, BmPrimaryBlue } from "../colors";
1
+ import React, { useState } from 'react';
2
+ import { Clear } from '@material-ui/icons';
3
+ import styled from 'styled-components';
4
+ import { BmIcons } from '../iconStyles';
5
+ import { BmGrey50, BmPrimaryBlue } from '../colors';
6
6
 
7
7
  const BannerCardWrapper = styled.div`
8
8
  display: ${({ closeButton, show }) => {
9
9
  if (!closeButton) {
10
- return "flex";
10
+ return 'flex';
11
11
  }
12
- return show ? "flex" : "none";
12
+ return show ? 'flex' : 'none';
13
13
  }};
14
14
  flex-direction: column;
15
15
  padding: 0.5rem;
16
16
  border: 0.071rem
17
17
  ${({ border }) => {
18
- if (border === "dashed") return "dashed";
19
- if (border === "solid") return "solid";
20
- return "none";
18
+ if (border === 'dashed') return 'dashed';
19
+ if (border === 'solid') return 'solid';
20
+ return 'none';
21
21
  }}
22
22
  ${({ color }) => {
23
- return color ? color : BmPrimaryBlue;
23
+ return color || BmPrimaryBlue;
24
24
  }};
25
25
  border-radius: 0.25rem;
26
26
  align-items: ${({ content, closeButton }) => {
27
27
  if (!closeButton) {
28
- if (content === "center") return "center";
29
- if (content === "left") return "flex-start";
30
- if (content === "right") return "flex-end";
31
- return "center";
28
+ if (content === 'center') return 'center';
29
+ if (content === 'left') return 'flex-start';
30
+ if (content === 'right') return 'flex-end';
31
+ return 'center';
32
32
  }
33
33
  }};
34
34
  background: ${({ bannerBg }) => {
35
- if (bannerBg === "default") return `${BmGrey50}`;
36
- if (!bannerBg) return "none";
35
+ if (bannerBg === 'default') return `${BmGrey50}`;
36
+ if (!bannerBg) return 'none';
37
37
  return bannerBg;
38
38
  }}};
39
39
  > *:not(:last-child) {
@@ -53,7 +53,7 @@ const BmBanner = ({ closeButton, children, ...rest }) => {
53
53
  <BannerCardWrapper closeButton={closeButton} {...rest} show={show}>
54
54
  {closeButton && (
55
55
  <BannerComponent>
56
- {children[0]}{" "}
56
+ {children[0]}{' '}
57
57
  <BmIcons
58
58
  icon={<Clear />}
59
59
  size="small"
@@ -1,43 +1,43 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import { BmButton } from "../buttons";
4
- import { Favorite, Home } from "@material-ui/icons";
2
+ import React from 'react';
3
+ import { Favorite, Home } from '@material-ui/icons';
4
+ import { BmButton } from '../buttons';
5
5
 
6
6
  export default {
7
7
  component: BmButton,
8
- title: "components/Buttons/Basic",
8
+ title: 'components/Buttons/Basic',
9
9
  argTypes: {
10
10
  size: {
11
- options: ["small", "medium", "large"],
12
- control: { type: "select" },
13
- description: "Size",
14
- defaultValue: { summary: "large" },
11
+ options: ['small', 'medium', 'large'],
12
+ control: { type: 'select' },
13
+ description: 'Size',
14
+ defaultValue: { summary: 'large' },
15
15
  },
16
16
  variant: {
17
17
  options: [
18
- "primary",
19
- "secondary",
20
- "tertiary",
21
- "success",
22
- "neutral",
23
- "destructive",
18
+ 'primary',
19
+ 'secondary',
20
+ 'tertiary',
21
+ 'success',
22
+ 'neutral',
23
+ 'destructive',
24
24
  ],
25
- control: { type: "select" },
26
- description: "Variant",
27
- defaultValue: { summary: "primary" },
25
+ control: { type: 'select' },
26
+ description: 'Variant',
27
+ defaultValue: { summary: 'primary' },
28
28
  },
29
29
  leadingIcon: {
30
- description: "Material UI Icons",
30
+ description: 'Material UI Icons',
31
31
  },
32
32
  trailingIcon: {
33
- description: "Material UI Icons",
33
+ description: 'Material UI Icons',
34
34
  },
35
35
  color: {
36
- description: "Color of the Button",
36
+ description: 'Color of the Button',
37
37
  },
38
38
  children: {
39
- description: "Text of the button",
40
- default: "Button",
39
+ description: 'Text of the button',
40
+ default: 'Button',
41
41
  },
42
42
  },
43
43
  };
@@ -46,19 +46,19 @@ const MainButton = (args) => <BmButton {...args} />;
46
46
 
47
47
  export const BasicButton = MainButton.bind({});
48
48
  BasicButton.args = {
49
- variant: "primary",
50
- size: "large",
51
- children: "Button",
49
+ variant: 'primary',
50
+ size: 'large',
51
+ children: 'Button',
52
52
  leadingIcon: <Home />,
53
53
  trailingIcon: <Favorite />,
54
54
  };
55
55
 
56
56
  export const ColoredButton = MainButton.bind({});
57
57
  ColoredButton.args = {
58
- variant: "primary",
59
- size: "large",
60
- children: "Button",
58
+ variant: 'primary',
59
+ size: 'large',
60
+ children: 'Button',
61
61
  leadingIcon: <Home />,
62
62
  trailingIcon: <Favorite />,
63
- color: "pink",
63
+ color: 'pink',
64
64
  };
@@ -1,31 +1,31 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import { BmAlertIcon } from "../buttonAlertIcons";
4
- import { AssignmentLateOutlined } from "@material-ui/icons";
2
+ import React from 'react';
3
+ import { AssignmentLateOutlined } from '@material-ui/icons';
4
+ import { BmAlertIcon } from '../buttonAlertIcons';
5
5
 
6
6
  export default {
7
7
  component: BmAlertIcon,
8
- title: "components/Buttons/AlertIcons",
8
+ title: 'components/Buttons/AlertIcons',
9
9
  argTypes: {
10
10
  size: {
11
- options: ["small", "medium", "large"],
12
- control: { type: "select" },
13
- description: "Size",
14
- defaultValue: { summary: "large" },
11
+ options: ['small', 'medium', 'large'],
12
+ control: { type: 'select' },
13
+ description: 'Size',
14
+ defaultValue: { summary: 'large' },
15
15
  },
16
16
  icon: {
17
- description: "Material UI Icons",
17
+ description: 'Material UI Icons',
18
18
  },
19
19
  color: {
20
- description: "Color of the icon",
21
- defaultValue: { summary: "#575757" },
20
+ description: 'Color of the icon',
21
+ defaultValue: { summary: '#575757' },
22
22
  },
23
23
  badgeContent: {
24
- description: "Badge Content",
24
+ description: 'Badge Content',
25
25
  },
26
26
  badgeColor: {
27
- description: "Color of the badge content",
28
- defaultValue: { summary: "#F62E48" },
27
+ description: 'Color of the badge content',
28
+ defaultValue: { summary: '#F62E48' },
29
29
  },
30
30
  },
31
31
  };
@@ -36,7 +36,7 @@ export const ButtonAlertIcon = MainButtonAlertIcon.bind({});
36
36
  ButtonAlertIcon.args = {
37
37
  icon: <AssignmentLateOutlined />,
38
38
  badgeContent: 4,
39
- badgeColor: "red",
40
- size: "large",
41
- color: "black",
39
+ badgeColor: 'red',
40
+ size: 'large',
41
+ color: 'black',
42
42
  };