beem-component 1.5.8 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/.babelrc +17 -0
  2. package/.eslintrc +62 -0
  3. package/.prettierrc +6 -0
  4. package/dist/components/Accordion/Accordion.js +31 -64
  5. package/dist/components/Accordion/Accordion.stories.js +29 -29
  6. package/dist/components/Avatars/avatars.js +31 -46
  7. package/dist/components/Avatars/avatars.stories.js +18 -18
  8. package/dist/components/BannerCard/bannerCard.stories.js +14 -14
  9. package/dist/components/BannerCard/bannerCards.js +30 -48
  10. package/dist/components/Buttons/Stories/basicbutton.stories.js +24 -24
  11. package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  12. package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +17 -17
  13. package/dist/components/Buttons/buttonAlertIcons.js +28 -44
  14. package/dist/components/Buttons/buttonDropdown copy.js +15 -18
  15. package/dist/components/Buttons/buttonDropdown.js +2 -2
  16. package/dist/components/Buttons/buttonIconsOnly.js +35 -49
  17. package/dist/components/Buttons/buttons.js +75 -86
  18. package/dist/components/Cards/cards.js +15 -11
  19. package/dist/components/Cards/cards.stories.js +8 -8
  20. package/dist/components/ChatComponents/ChatBody/chatBody.js +80 -69
  21. package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +6 -6
  22. package/dist/components/ChatComponents/ChatBody/sessionDetails.js +9 -16
  23. package/dist/components/ChatComponents/ChatHeader/chatHeader.js +5 -7
  24. package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -3
  25. package/dist/components/ChatComponents/ColorPicker/colorPicker.js +5 -7
  26. package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
  27. package/dist/components/ChatComponents/ContactCards/contactCards.js +15 -12
  28. package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +3 -3
  29. package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +14 -10
  30. package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
  31. package/dist/components/ChatComponents/InfoTab/infoTab.js +11 -9
  32. package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +6 -6
  33. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +5 -7
  34. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
  35. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +11 -9
  36. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +15 -13
  37. package/dist/components/Chats/chat.js +41 -32
  38. package/dist/components/Chats/chatInput.js +18 -14
  39. package/dist/components/Chats/chatwrapper.js +20 -12
  40. package/dist/components/Checkbox/checkboxToggler.js +61 -0
  41. package/dist/components/Checkbox/checkboxToggler.stories.js +81 -0
  42. package/dist/components/Lists/listBox.js +14 -30
  43. package/dist/components/Lists/listBox.stories.js +12 -23
  44. package/dist/components/Lists/listHeader.stories.js +13 -13
  45. package/dist/components/Lists/listheader.js +12 -27
  46. package/dist/components/Lists/rowLabels.js +19 -30
  47. package/dist/components/Lists/rowLabels.stories.js +22 -25
  48. package/dist/components/Loader/loader.js +17 -31
  49. package/dist/components/Loader/loader.stories.js +13 -13
  50. package/dist/components/MainWrapper/index.js +5 -7
  51. package/dist/components/MessageCounter/MessageCounter.stories.js +14 -14
  52. package/dist/components/MessageCounter/messageCounter.js +16 -18
  53. package/dist/components/Modals/modal.js +37 -57
  54. package/dist/components/Modals/modals.stories.js +15 -28
  55. package/dist/components/NoteBar/noteBar.js +28 -57
  56. package/dist/components/NoteBar/noteBar.stories.js +17 -17
  57. package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  58. package/dist/components/PerformanceIndicator/performanceIndicator.js +21 -34
  59. package/dist/components/Pills/pills.js +24 -56
  60. package/dist/components/Pills/pills.stories.js +21 -23
  61. package/dist/components/ProfileIcon/ProfileIcon.js +28 -29
  62. package/dist/components/ProfileIcon/profileIcon.stories.js +18 -18
  63. package/dist/components/ProgressBar/progressbar.js +15 -17
  64. package/dist/components/ProgressBar/progressbar.stories.js +8 -10
  65. package/dist/components/ProgressRing/progressRing.js +38 -54
  66. package/dist/components/ProgressRing/progressRing.stories.js +16 -16
  67. package/dist/components/RouteLink/link.js +8 -10
  68. package/dist/components/RouteLink/link.stories.js +3 -3
  69. package/dist/components/ScrollBar/scrollBar.js +19 -17
  70. package/dist/components/SuperFluid/Content/index.js +5 -7
  71. package/dist/components/SuperFluid/ContentTitle.js/index.js +14 -10
  72. package/dist/components/SuperFluid/SegmentCard/index.js +22 -13
  73. package/dist/components/Tabs/tabs.js +16 -35
  74. package/dist/components/Tabs/tabs.stories.js +19 -19
  75. package/dist/components/Tags/tags.js +33 -65
  76. package/dist/components/Tags/tags.stories.js +18 -18
  77. package/dist/components/breakpoints.js +3 -3
  78. package/dist/components/chatHeader.js +17 -11
  79. package/dist/components/checkbox.js +27 -26
  80. package/dist/components/colors.js +32 -30
  81. package/dist/components/contacts.js +39 -25
  82. package/dist/components/dropdown.js +29 -35
  83. package/dist/components/dropdownButton.js +50 -53
  84. package/dist/components/dropdownItems.js +26 -19
  85. package/dist/components/examples/App.js +2 -2
  86. package/dist/components/examples/InfoAccordion.js +2 -3
  87. package/dist/components/examples/chatBodyExample.js +1 -5
  88. package/dist/components/examples/selectExample.js +6 -20
  89. package/dist/components/globalStyles.js +1 -5
  90. package/dist/components/iconStyles.js +56 -58
  91. package/dist/components/index.js +27 -23
  92. package/dist/components/input.js +33 -36
  93. package/dist/components/logo.js +9 -16
  94. package/dist/components/navbar.js +24 -13
  95. package/dist/components/search.js +20 -21
  96. package/dist/components/typography.js +14 -14
  97. package/dist/components/wrapper.js +8 -8
  98. package/package.json +54 -31
  99. package/src/App.js +10 -7
  100. package/src/index.js +6 -8
  101. package/src/lib/components/Accordion/Accordion.js +32 -14
  102. package/src/lib/components/Accordion/Accordion.stories.js +31 -31
  103. package/src/lib/components/Avatars/avatars.js +33 -28
  104. package/src/lib/components/Avatars/avatars.stories.js +18 -18
  105. package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
  106. package/src/lib/components/BannerCard/bannerCards.js +18 -18
  107. package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
  108. package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  109. package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
  110. package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
  111. package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
  112. package/src/lib/components/Buttons/buttons.js +70 -73
  113. package/src/lib/components/Cards/cards.js +2 -3
  114. package/src/lib/components/Cards/cards.stories.js +10 -10
  115. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +46 -45
  116. package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
  117. package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
  118. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
  119. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
  120. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
  121. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
  122. package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
  123. package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
  124. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
  125. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
  126. package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
  127. package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
  128. package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
  129. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
  130. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
  131. package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
  132. package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
  133. package/src/lib/components/Lists/listBox.js +7 -7
  134. package/src/lib/components/Lists/listBox.stories.js +8 -11
  135. package/src/lib/components/Lists/listHeader.stories.js +13 -13
  136. package/src/lib/components/Lists/listheader.js +7 -7
  137. package/src/lib/components/Lists/rowLabels.js +6 -6
  138. package/src/lib/components/Lists/rowLabels.stories.js +18 -18
  139. package/src/lib/components/Loader/loader.js +13 -13
  140. package/src/lib/components/Loader/loader.stories.js +14 -14
  141. package/src/lib/components/MainWrapper/index.js +2 -2
  142. package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
  143. package/src/lib/components/MessageCounter/messageCounter.js +16 -16
  144. package/src/lib/components/Modals/modal.js +25 -23
  145. package/src/lib/components/Modals/modals.stories.js +9 -9
  146. package/src/lib/components/NoteBar/noteBar.js +20 -20
  147. package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
  148. package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  149. package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
  150. package/src/lib/components/Pills/pills.js +16 -16
  151. package/src/lib/components/Pills/pills.stories.js +22 -23
  152. package/src/lib/components/ProfileIcon/ProfileIcon.js +50 -52
  153. package/src/lib/components/ProfileIcon/profileIcon.stories.js +22 -22
  154. package/src/lib/components/ProgressBar/progressbar.js +4 -5
  155. package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
  156. package/src/lib/components/ProgressRing/progressRing.js +25 -24
  157. package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
  158. package/src/lib/components/RouteLink/link.js +10 -8
  159. package/src/lib/components/RouteLink/link.stories.js +4 -4
  160. package/src/lib/components/ScrollBar/scrollBar.js +15 -14
  161. package/src/lib/components/SuperFluid/Content/index.js +2 -2
  162. package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
  163. package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
  164. package/src/lib/components/Tabs/tabs.js +11 -11
  165. package/src/lib/components/Tabs/tabs.stories.js +20 -20
  166. package/src/lib/components/Tags/tags.js +26 -24
  167. package/src/lib/components/Tags/tags.stories.js +19 -19
  168. package/src/lib/components/breakpoints.js +3 -3
  169. package/src/lib/components/checkbox.js +7 -6
  170. package/src/lib/components/colors.js +30 -28
  171. package/src/lib/components/dropdownButton.js +36 -39
  172. package/src/lib/components/examples/InfoAccordion.js +1 -1
  173. package/src/lib/components/globalStyles.js +2 -2
  174. package/src/lib/components/iconStyles.js +45 -48
  175. package/src/lib/components/index.js +47 -46
  176. package/src/lib/components/input.js +20 -20
  177. package/src/lib/components/text.js +1 -1
  178. package/src/lib/components/typography.js +14 -14
  179. package/src/reportWebVitals.js +1 -1
  180. package/babel.config.js +0 -12
  181. package/dist/components/checkboxToggler.js +0 -50
  182. package/src/lib/components/checkboxToggler.js +0 -19
@@ -1,9 +1,10 @@
1
- import styled from "styled-components";
2
- import Proptypes from "prop-types";
3
- import { BmGrey400 } from "../colors";
4
- import { BmIcons } from "../iconStyles";
5
- import ArrowCircleUpIcon from "@mui/icons-material/ArrowCircleUp";
6
- import ArrowCircleDownIcon from "@mui/icons-material/ArrowCircleDown";
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import Proptypes from 'prop-types';
4
+ import ArrowCircleUpIcon from '@mui/icons-material/ArrowCircleUp';
5
+ import ArrowCircleDownIcon from '@mui/icons-material/ArrowCircleDown';
6
+ import { BmGrey400 } from '../colors';
7
+ import { BmIcons } from '../iconStyles';
7
8
 
8
9
  export const BmPIWrapper = styled.div`
9
10
  display: flex;
@@ -29,17 +30,17 @@ export const BmPerformanceIndicator = ({
29
30
  }) => {
30
31
  return (
31
32
  <BmPIWrapper color={color} {...rest}>
32
- {type === "upwards" && (
33
+ {type === 'upwards' && (
33
34
  <BmIcons
34
35
  icon={<ArrowCircleUpIcon />}
35
- size={size || "xlarge"}
36
+ size={size || 'xlarge'}
36
37
  color={color || `${BmGrey400}`}
37
38
  />
38
39
  )}
39
- {type === "downwards" && (
40
+ {type === 'downwards' && (
40
41
  <BmIcons
41
42
  icon={<ArrowCircleDownIcon />}
42
- size={size || "xlarge"}
43
+ size={size || 'xlarge'}
43
44
  color={color || `${BmGrey400}`}
44
45
  />
45
46
  )}
@@ -1,19 +1,19 @@
1
- import React, { useState } from "react";
2
- import Proptypes from "prop-types";
1
+ import React, { useState } from 'react';
2
+ import Proptypes from 'prop-types';
3
3
  // eslint-disable-next-line no-unused-vars
4
- import { Clear, KeyboardArrowDown } from "@material-ui/icons";
5
- import styled from "styled-components";
6
- import { BmAvatar } from "../Avatars/avatars";
7
- import { BmGrey100 } from "../colors";
8
- import { BmIcons } from "../iconStyles";
9
- import { p } from "../text";
4
+ import { Clear, KeyboardArrowDown } from '@material-ui/icons';
5
+ import styled from 'styled-components';
6
+ import BmAvatar from '../Avatars/avatars';
7
+ import { BmGrey100 } from '../colors';
8
+ import { BmIcons } from '../iconStyles';
9
+ import { p } from '../text';
10
10
 
11
11
  export const BmPillWrapper = styled.div`
12
12
  display: ${({ clicked }) => {
13
13
  if (clicked) {
14
- return "flex";
14
+ return 'flex';
15
15
  }
16
- return "none";
16
+ return 'none';
17
17
  }};
18
18
  flex-direction: row;
19
19
  justify-content: center;
@@ -56,11 +56,11 @@ export const BmPill = ({
56
56
  clicked={clicked}
57
57
  {...rest}
58
58
  >
59
- {icon && <BmIcons size={size || "xsmall"} icon={icon} color={color} />}
59
+ {icon && <BmIcons size={size || 'xsmall'} icon={icon} color={color} />}
60
60
  {avatarIcon && (
61
61
  <BmAvatar
62
62
  user={avatarIcon}
63
- size={avatarSize || "xsmall"}
63
+ size={avatarSize || 'xsmall'}
64
64
  type="circle"
65
65
  color={color}
66
66
  />
@@ -68,10 +68,10 @@ export const BmPill = ({
68
68
  {label}
69
69
  {onDelete && (
70
70
  <BmIcons
71
- style={{ margin: "0rem 0rem 0rem 1rem" }}
72
- size={size || "xsmall"}
73
- icon={deleteIcon ? deleteIcon : <Clear />}
74
- color={color || "black"}
71
+ style={{ margin: '0rem 0rem 0rem 1rem' }}
72
+ size={size || 'xsmall'}
73
+ icon={deleteIcon || <Clear />}
74
+ color={color || 'black'}
75
75
  />
76
76
  )}
77
77
  </BmPillWrapper>
@@ -1,47 +1,46 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import { Delete, Favorite, Person } from "@material-ui/icons";
3
- import React from "react";
4
- import { BmPrimaryBlue } from "../colors";
5
- import { BmPill } from "./pills";
2
+ import { Delete, Favorite, Person } from '@material-ui/icons';
3
+ import React from 'react';
4
+ import { BmPill } from './pills';
6
5
 
7
6
  export default {
8
7
  component: BmPill,
9
- title: "components/Pills",
8
+ title: 'components/Pills',
10
9
  argTypes: {
11
10
  icon: {
12
- description: "Material-UI icon(optional)",
11
+ description: 'Material-UI icon(optional)',
13
12
  defaultValue: { summary: undefined },
14
13
  },
15
14
  avatarIcon: {
16
- description: "Material-UI icon(optional)",
15
+ description: 'Material-UI icon(optional)',
17
16
  defaultValue: { summary: undefined },
18
17
  },
19
18
  size: {
20
- options: ["xsmall", "small", "medium", "large", "xlarge"],
21
- control: { type: "select" },
22
- description: "Size of the Icon (Can also be predefined e.g. 10px)",
23
- defaultValue: { summary: "xsmall" },
19
+ options: ['xsmall', 'small', 'medium', 'large', 'xlarge'],
20
+ control: { type: 'select' },
21
+ description: 'Size of the Icon (Can also be predefined e.g. 10px)',
22
+ defaultValue: { summary: 'xsmall' },
24
23
  },
25
24
  avatarSize: {
26
- options: ["xsmall", "small", "medium", "large", "xlarge"],
27
- control: { type: "select" },
28
- description: "Size of the AvatarIcon (Can also be predefined e.g. 10px)",
29
- defaultValue: { summary: "xsmall" },
25
+ options: ['xsmall', 'small', 'medium', 'large', 'xlarge'],
26
+ control: { type: 'select' },
27
+ description: 'Size of the AvatarIcon (Can also be predefined e.g. 10px)',
28
+ defaultValue: { summary: 'xsmall' },
30
29
  },
31
30
  label: {
32
- description: "Pill label in uppercase",
33
- defaultValue: { summary: "undefined" },
31
+ description: 'Pill label in uppercase',
32
+ defaultValue: { summary: 'undefined' },
34
33
  },
35
34
  color: {
36
- description: "Color of Pill ",
37
- defaultValue: { summary: "black" },
35
+ description: 'Color of Pill ',
36
+ defaultValue: { summary: 'black' },
38
37
  },
39
38
  onDelete: {
40
- description: "Handles Deleting Pill",
39
+ description: 'Handles Deleting Pill',
41
40
  defaultValue: { summary: undefined },
42
41
  },
43
42
  deleteIcon: {
44
- description: "Material-UI icon (Used only when OnDelete is present)",
43
+ description: 'Material-UI icon (Used only when OnDelete is present)',
45
44
  defaultValue: { summary: undefined },
46
45
  },
47
46
  },
@@ -52,7 +51,7 @@ const MainPill = (args) => <BmPill {...args} />;
52
51
  export const BasicPill = MainPill.bind({});
53
52
  BasicPill.args = {
54
53
  icon: <Favorite />,
55
- label: "label",
54
+ label: 'label',
56
55
  color: undefined,
57
56
  onDelete: undefined,
58
57
  deleteIcon: undefined,
@@ -64,7 +63,7 @@ BasicPill.args = {
64
63
  export const CustomPill = MainPill.bind({});
65
64
  CustomPill.args = {
66
65
  icon: undefined,
67
- label: "label",
66
+ label: 'label',
68
67
  color: undefined,
69
68
  onDelete: true,
70
69
  deleteIcon: <Delete />,
@@ -5,74 +5,72 @@ import wa from '../../assets/wa.png';
5
5
  import fb from '../../assets/fb.png';
6
6
  import insta from '../../assets/insta.png';
7
7
 
8
-
9
8
  const handleSize = (size) => {
10
- if (size) {
11
- if (size === "large") return "3.429rem";
12
- if (size === "medium") return "2.286rem";
13
- if (size === "small") return "1.714rem";
14
- if (size === "xsmall") return "1.429rem";
15
- }
16
- return "3.429rem"
9
+ if (size) {
10
+ if (size === 'large') return '3.429rem';
11
+ if (size === 'medium') return '2.286rem';
12
+ if (size === 'small') return '1.714rem';
13
+ if (size === 'xsmall') return '1.429rem';
14
+ }
15
+ return '3.429rem';
17
16
  };
18
17
 
19
18
  const position = (size) => {
20
- if (size) {
21
- if (size === "large") return "2.286rem";
22
- if (size === "medium") return "1.5rem";
23
- if (size === "small") return "1rem";
24
- if (size === "xsmall") return "0.714rem";
25
- }
26
- return "2.286rem"
19
+ if (size) {
20
+ if (size === 'large') return '2.286rem';
21
+ if (size === 'medium') return '1.5rem';
22
+ if (size === 'small') return '1rem';
23
+ if (size === 'xsmall') return '0.714rem';
24
+ }
25
+ return '2.286rem';
27
26
  };
28
27
 
29
28
  const ProfileImg = styled.img`
30
- height: ${(props) => handleSize(props.size)};
31
- width: ${(props) => handleSize(props.size)};
32
- object-fit: contain;
33
- border-radius: 50%;
34
- display:flex;
29
+ height: ${(props) => handleSize(props.size)};
30
+ width: ${(props) => handleSize(props.size)};
31
+ object-fit: contain;
32
+ border-radius: 50%;
33
+ display: flex;
35
34
  `;
36
35
 
37
36
  const Profile = styled.div`
38
- height: ${(props) => handleSize(props.size)};
39
- width: ${(props) => handleSize(props.size)};
40
- border-radius: 50%;
41
- border: 1px solid ${BmBgLightBlue};
42
- display:flex;
43
- align-items:center;
44
- justify-content: center;
45
- position: relative;
46
- background: ${BmSecondaryBlue12};
37
+ height: ${(props) => handleSize(props.size)};
38
+ width: ${(props) => handleSize(props.size)};
39
+ border-radius: 50%;
40
+ border: 1px solid ${BmBgLightBlue};
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ position: relative;
45
+ background: ${BmSecondaryBlue12};
47
46
  `;
48
47
 
49
48
  const Content = styled.div`
50
- display:flex;
51
- align-items:center;
52
- justify-content: center;
53
- position: absolute;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ position: absolute;
54
53
  `;
55
54
 
56
-
57
55
  const Dot = styled.img`
58
- position: absolute;
59
- left: ${(props) => position(props.size)};
60
- bottom: 0rem;
61
- object-fit: contain;
62
- height: 1rem;
63
- width: 1rem;
56
+ position: absolute;
57
+ left: ${(props) => position(props.size)};
58
+ bottom: 0rem;
59
+ object-fit: contain;
60
+ height: 1rem;
61
+ width: 1rem;
64
62
  `;
65
63
 
66
64
  export const BmProfileIcon = ({ img, content, channel, size, ...rest }) => {
67
- return (
68
- <>
69
- <Profile size={size} {...rest}>
70
- {content && !img && <Content>{content}</Content>}
71
- {img && !content && <ProfileImg src={img} />}
72
- {channel && channel === 'whatsapp' && <Dot size={size} src={wa} />}
73
- {channel && channel === 'facebook' && <Dot size={size} src={fb} />}
74
- {channel && channel === 'instagram' && <Dot size={size} src={insta} />}
75
- </Profile>
76
- </>
77
- )
78
- }
65
+ return (
66
+ <>
67
+ <Profile size={size} {...rest}>
68
+ {content && !img && <Content>{content}</Content>}
69
+ {img && !content && <ProfileImg src={img} />}
70
+ {channel && channel === 'whatsapp' && <Dot size={size} src={wa} />}
71
+ {channel && channel === 'facebook' && <Dot size={size} src={fb} />}
72
+ {channel && channel === 'instagram' && <Dot size={size} src={insta} />}
73
+ </Profile>
74
+ </>
75
+ );
76
+ };
@@ -1,31 +1,32 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import { BmProfileIcon } from "./ProfileIcon";
2
+ import React from 'react';
3
+ import { BmProfileIcon } from './ProfileIcon';
4
4
  import beem from '../../assets/beem.jpeg';
5
5
 
6
-
7
6
  export default {
8
7
  component: BmProfileIcon,
9
- title: "components/ProfileIcon",
8
+ title: 'components/ProfileIcon',
10
9
  argTypes: {
11
10
  size: {
12
- options: ["xsmall", "small", "medium", "large"],
13
- control: { type: "select" },
14
- description: "Size of the profile",
15
- defaultValue: { summary: "large" },
11
+ options: ['xsmall', 'small', 'medium', 'large'],
12
+ control: { type: 'select' },
13
+ description: 'Size of the profile',
14
+ defaultValue: { summary: 'large' },
16
15
  },
17
16
  img: {
18
- description: "Image to be displayed (will not be displayed if content is present)",
17
+ description:
18
+ 'Image to be displayed (will not be displayed if content is present)',
19
19
  defaultValue: { summary: undefined },
20
20
  },
21
21
  content: {
22
- description: "Content to be displayed (will not be displayed if image is present)",
22
+ description:
23
+ 'Content to be displayed (will not be displayed if image is present)',
23
24
  defaultValue: { summary: undefined },
24
25
  },
25
26
  channel: {
26
- options: ["whatsapp", "instagram", "facebook"],
27
- control: { type: "select" },
28
- description: "Profile badge",
27
+ options: ['whatsapp', 'instagram', 'facebook'],
28
+ control: { type: 'select' },
29
+ description: 'Profile badge',
29
30
  defaultValue: { summary: undefined },
30
31
  },
31
32
  },
@@ -35,23 +36,22 @@ const MainProfileIcon = (args) => <BmProfileIcon {...args} />;
35
36
 
36
37
  export const Sample = MainProfileIcon.bind({});
37
38
  Sample.args = {
38
- channel: "whatsapp",
39
- size: "large",
39
+ channel: 'whatsapp',
40
+ size: 'large',
40
41
  };
41
42
 
42
43
  export const ImageProfile = MainProfileIcon.bind({});
43
44
  ImageProfile.args = {
44
- channel: "whatsapp",
45
- size: "large",
45
+ channel: 'whatsapp',
46
+ size: 'large',
46
47
  img: beem,
47
- content: undefined
48
+ content: undefined,
48
49
  };
49
50
 
50
51
  export const ContentProfile = MainProfileIcon.bind({});
51
52
  ContentProfile.args = {
52
- channel: "whatsapp",
53
- size: "large",
53
+ channel: 'whatsapp',
54
+ size: 'large',
54
55
  content: <h4>BC</h4>,
55
- img: undefined
56
+ img: undefined,
56
57
  };
57
-
@@ -1,7 +1,7 @@
1
- import React from "react";
2
- import styled from "styled-components";
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
3
  import Proptypes from 'prop-types';
4
- import { BmGrey100, BmPrimaryBlue } from "../colors";
4
+ import { BmGrey100, BmPrimaryBlue } from '../colors';
5
5
 
6
6
  const Container = styled.div`
7
7
  height: 0.75rem;
@@ -36,8 +36,7 @@ export const BmProgressBar = (props) => {
36
36
  );
37
37
  };
38
38
 
39
-
40
39
  BmProgressBar.propTypes = {
41
40
  value: Proptypes.string.isRequired,
42
41
  color: Proptypes.string,
43
- }
42
+ };
@@ -1,19 +1,18 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import { BmProgressBar } from "./progressbar";
4
- import { Home } from "@material-ui/icons";
2
+ import React from 'react';
3
+ import { BmProgressBar } from './progressbar';
5
4
 
6
5
  export default {
7
6
  component: BmProgressBar,
8
- title: "components/ProgressBar",
7
+ title: 'components/ProgressBar',
9
8
  argTypes: {
10
9
  value: {
11
- control: { type: "text" },
12
- description: "Progress value",
10
+ control: { type: 'text' },
11
+ description: 'Progress value',
13
12
  },
14
13
  color: {
15
- control: { type: "text" },
16
- description: "Color of the progress bar",
14
+ control: { type: 'text' },
15
+ description: 'Color of the progress bar',
17
16
  },
18
17
  },
19
18
  };
@@ -22,5 +21,5 @@ const MainProgressBar = (args) => <BmProgressBar {...args} />;
22
21
 
23
22
  export const ProgressBar = MainProgressBar.bind({});
24
23
  ProgressBar.args = {
25
- value: "50",
24
+ value: '50',
26
25
  };
@@ -1,13 +1,14 @@
1
- import React, { useEffect, useState, useRef } from "react";
2
- import PropTypes from "prop-types";
3
- import styled from "styled-components";
1
+ /* eslint-disable no-shadow */
2
+ import React, { useEffect, useState, useRef } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import styled from 'styled-components';
4
5
  import {
5
6
  BmGrey100,
6
7
  BmPrimaryBlue,
7
8
  BmSecondaryDarkGreen,
8
9
  BmPrimaryGold,
9
10
  BmSecondaryRed,
10
- } from "../colors";
11
+ } from '../colors';
11
12
 
12
13
  const small = 1.429;
13
14
  const medium = 1.714;
@@ -16,18 +17,18 @@ const large = 2.286;
16
17
  let center;
17
18
  let radius;
18
19
  let circumference;
19
- let strokeWidth = 5;
20
+ const strokeWidth = 5;
20
21
  let initialSize;
21
22
 
22
23
  const measurement = (size) => {
23
24
  let initialSize = size || large * 14;
24
- if (size === "small") {
25
+ if (size === 'small') {
25
26
  initialSize = small * 14;
26
27
  }
27
- if (size === "medium") {
28
+ if (size === 'medium') {
28
29
  initialSize = medium * 14;
29
30
  }
30
- if (size === "large") {
31
+ if (size === 'large') {
31
32
  initialSize = large * 14;
32
33
  }
33
34
  center = initialSize / 2;
@@ -38,17 +39,17 @@ const measurement = (size) => {
38
39
  const ProgressRingWrapper = styled.svg`
39
40
  display: flex;
40
41
  width: ${({ size }) => {
41
- if (size === "small") return "1.429rem";
42
- if (size === "medium") return "1.714rem";
43
- if (size === "large") return "2.286rem";
44
- if (!size) return "2.286rem";
42
+ if (size === 'small') return '1.429rem';
43
+ if (size === 'medium') return '1.714rem';
44
+ if (size === 'large') return '2.286rem';
45
+ if (!size) return '2.286rem';
45
46
  return `${size}px`;
46
47
  }};
47
48
  height: ${({ size }) => {
48
- if (size === "small") return "1.429rem";
49
- if (size === "medium") return "1.714rem";
50
- if (size === "large") return "2.286rem";
51
- if (!size) return "2.286rem";
49
+ if (size === 'small') return '1.429rem';
50
+ if (size === 'medium') return '1.714rem';
51
+ if (size === 'large') return '2.286rem';
52
+ if (!size) return '2.286rem';
52
53
  return `${size}px`;
53
54
  }};
54
55
  `;
@@ -61,10 +62,10 @@ const ProgressRingCircle2 = styled.circle`
61
62
  fill: none;
62
63
  stroke: ${({ variant, progress }) => {
63
64
  if (progress) {
64
- if (variant === "primary") return `${BmPrimaryBlue}`;
65
- if (variant === "success") return `${BmSecondaryDarkGreen}`;
66
- if (variant === "warning") return `${BmPrimaryGold}`;
67
- if (variant === "danger") return `${BmSecondaryRed}`;
65
+ if (variant === 'primary') return `${BmPrimaryBlue}`;
66
+ if (variant === 'success') return `${BmSecondaryDarkGreen}`;
67
+ if (variant === 'warning') return `${BmPrimaryGold}`;
68
+ if (variant === 'danger') return `${BmSecondaryRed}`;
68
69
  if (!variant) return `${BmPrimaryBlue}`;
69
70
  }
70
71
  if (!progress) return `${BmGrey100}`;
@@ -74,12 +75,12 @@ const ProgressRingCircle2 = styled.circle`
74
75
  const Text = styled.text`
75
76
  font-size: ${() => {
76
77
  if (initialSize >= 50 && initialSize < 100) {
77
- return "1rem";
78
+ return '1rem';
78
79
  }
79
80
  if (initialSize >= 100) {
80
- return "2rem";
81
+ return '2rem';
81
82
  }
82
- return "0.5rem";
83
+ return '0.5rem';
83
84
  }};
84
85
  text-anchor: middle;
85
86
  fill: black;
@@ -101,7 +102,7 @@ const BmProgressRing = (props) => {
101
102
  const progressOffset = ((100 - progress) / 100) * circumference;
102
103
  setOffset(progressOffset);
103
104
 
104
- circleRef.current.style = "transition: stroke-dashoffset 850ms ease-in-out";
105
+ circleRef.current.style = 'transition: stroke-dashoffset 850ms ease-in-out';
105
106
  }, [setOffset, progress, offset]);
106
107
 
107
108
  return (
@@ -1,25 +1,25 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import BmProgressRing from "./progressRing";
2
+ import React from 'react';
3
+ import BmProgressRing from './progressRing';
4
4
 
5
5
  export default {
6
6
  component: BmProgressRing,
7
- title: "components/ProgressRing",
7
+ title: 'components/ProgressRing',
8
8
  argTypes: {
9
9
  size: {
10
- options: ["small", "medium", "large"],
11
- control: { type: "select" },
12
- description: "Size of the Progress Ring (Can also be predefined e.g. 50)",
13
- defaultValue: { summary: "large" },
10
+ options: ['small', 'medium', 'large'],
11
+ control: { type: 'select' },
12
+ description: 'Size of the Progress Ring (Can also be predefined e.g. 50)',
13
+ defaultValue: { summary: 'large' },
14
14
  },
15
15
  progress: {
16
- description: "Progress Indicator",
16
+ description: 'Progress Indicator',
17
17
  },
18
18
  variant: {
19
- options: ["primary", "success", "warning", "danger"],
20
- control: { type: "select" },
21
- description: "Color of the Progress Ring",
22
- defaultValue: { summary: "xsmall" },
19
+ options: ['primary', 'success', 'warning', 'danger'],
20
+ control: { type: 'select' },
21
+ description: 'Color of the Progress Ring',
22
+ defaultValue: { summary: 'xsmall' },
23
23
  },
24
24
  },
25
25
  };
@@ -28,14 +28,14 @@ const MainProgressRing = (args) => <BmProgressRing {...args} />;
28
28
 
29
29
  export const BasicProgressRing = MainProgressRing.bind({});
30
30
  BasicProgressRing.args = {
31
- progress: 30,
32
- variant: "success",
33
- size: "xlarge"
31
+ progress: 30,
32
+ variant: 'success',
33
+ size: 'xlarge',
34
34
  };
35
35
 
36
36
  export const CustomProgressRing = MainProgressRing.bind({});
37
37
  CustomProgressRing.args = {
38
38
  progress: 50,
39
- variant: "primary",
40
- size: "40"
41
- };
39
+ variant: 'primary',
40
+ size: '40',
41
+ };
@@ -1,13 +1,14 @@
1
- import styled from "styled-components";
2
- import { Link } from "react-router-dom";
3
- import { BmPrimaryBlue } from "../colors";
4
- import { p } from "../text";
5
- import { darken } from "polished";
1
+ import styled from 'styled-components';
2
+ import { Link } from 'react-router-dom';
3
+ import { darken } from 'polished';
4
+ import { BmPrimaryBlue } from '../colors';
5
+ import { p } from '../text';
6
6
 
7
- //TODO: To be fixed for hover states
7
+ // TODO: To be fixed for hover states
8
8
  export const BmRouteLink = styled(Link)`
9
9
  ${p}
10
- color: ${(props) => (props.color ? props.color : `${BmPrimaryBlue} `)} !important;
10
+ color: ${(props) =>
11
+ props.color ? props.color : `${BmPrimaryBlue} `} !important;
11
12
  text-decoration: none;
12
13
  &:hover,
13
14
  &:focus,
@@ -16,6 +17,7 @@ export const BmRouteLink = styled(Link)`
16
17
  &:before {
17
18
  font-weight: normal;
18
19
  }
19
- color: ${(props) => darken(0.1, props.color ? props.color : `${BmPrimaryBlue}`)} !important;
20
+ color: ${(props) =>
21
+ darken(0.1, props.color ? props.color : `${BmPrimaryBlue}`)} !important;
20
22
  }
21
23
  `;