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,39 +1,39 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import { BmBtnIcon } from "../buttonIconsOnly";
4
- import { Favorite } from "@material-ui/icons";
2
+ import React from 'react';
3
+ import { Favorite } from '@material-ui/icons';
4
+ import { BmBtnIcon } from '../buttonIconsOnly';
5
5
 
6
6
  export default {
7
7
  component: BmBtnIcon,
8
- title: "components/Buttons/IconsOnly",
8
+ title: 'components/Buttons/IconsOnly',
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",
24
- "active",
25
- "enabled",
18
+ 'primary',
19
+ 'secondary',
20
+ 'tertiary',
21
+ 'success',
22
+ 'neutral',
23
+ 'destructive',
24
+ 'active',
25
+ 'enabled',
26
26
  ],
27
- control: { type: "select" },
28
- description: "Variant",
29
- defaultValue: { summary: "primary" },
27
+ control: { type: 'select' },
28
+ description: 'Variant',
29
+ defaultValue: { summary: 'primary' },
30
30
  },
31
31
  icon: {
32
- description: "Material UI Icons",
32
+ description: 'Material UI Icons',
33
33
  },
34
34
  color: {
35
- description: "Color of the button",
36
- defaultValue: { summary: "primary color" },
35
+ description: 'Color of the button',
36
+ defaultValue: { summary: 'primary color' },
37
37
  },
38
38
  },
39
39
  };
@@ -43,7 +43,7 @@ const MainButtonIcon = (args) => <BmBtnIcon {...args} />;
43
43
  export const ButtonIcon = MainButtonIcon.bind({});
44
44
  ButtonIcon.args = {
45
45
  icon: <Favorite />,
46
- size: "large",
47
- variant: "primary",
46
+ size: 'large',
47
+ variant: 'primary',
48
48
  color: undefined,
49
49
  };
@@ -1,27 +1,24 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import PropTypes from "prop-types";
4
- import { withStyles } from "@material-ui/core/styles";
5
- import {
6
- BmSecondaryGrey,
7
- BmSecondaryRed,
8
- BmPrimaryWhite,
9
- } from "../colors";
10
- import Badge from "@material-ui/core/Badge";
11
- import { PoppinsMedium } from "../typography";
1
+ /* eslint-disable no-shadow */
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import PropTypes from 'prop-types';
5
+ import { withStyles } from '@material-ui/core/styles';
6
+ import Badge from '@material-ui/core/Badge';
7
+ import { BmSecondaryGrey, BmSecondaryRed, BmPrimaryWhite } from '../colors';
8
+ import { PoppinsMedium } from '../typography';
12
9
 
13
10
  const size = (props) => {
14
- if (props.size === "small") return "1.429rem";
15
- if (props.size === "medium") return "1.714rem";
16
- if (props.size === "large") return "2.286rem";
17
- return "2.286rem";
11
+ if (props.size === 'small') return '1.429rem';
12
+ if (props.size === 'medium') return '1.714rem';
13
+ if (props.size === 'large') return '2.286rem';
14
+ return '2.286rem';
18
15
  };
19
16
 
20
17
  const Badgesize = (props) => {
21
- if (props.size === "small") return "0.857rem";
22
- if (props.size === "medium") return "0.857rem";
23
- if (props.size === "large") return "0.857rem";
24
- return "0.857rem";
18
+ if (props.size === 'small') return '0.857rem';
19
+ if (props.size === 'medium') return '0.857rem';
20
+ if (props.size === 'large') return '0.857rem';
21
+ return '0.857rem';
25
22
  };
26
23
 
27
24
  const AlertIcon = {
@@ -40,13 +37,13 @@ const BadgeIcon = () => ({
40
37
  background: (props) => props.badgeColor || `${BmSecondaryRed}`,
41
38
  color: `${BmPrimaryWhite}`,
42
39
  fontFamily: `${PoppinsMedium}`,
43
- fontStyle: "normal",
40
+ fontStyle: 'normal',
44
41
  fontWeight: 500,
45
- fontSize: "0.643rem",
46
- display: "flex",
47
- alignItems: "center",
48
- textAlign: "center",
49
- letterSpacing: "-0.02em",
42
+ fontSize: '0.643rem',
43
+ display: 'flex',
44
+ alignItems: 'center',
45
+ textAlign: 'center',
46
+ letterSpacing: '-0.02em',
50
47
  },
51
48
  });
52
49
 
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import PropTypes from "prop-types";
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import PropTypes from 'prop-types';
4
4
 
5
5
  import {
6
6
  BmPrimaryWhite,
@@ -10,8 +10,8 @@ import {
10
10
  BmSecondaryRed,
11
11
  BmSecondaryDarkGreen,
12
12
  BmGrey400,
13
- } from "../colors";
14
- import { BmButtonIcon } from "../iconStyles";
13
+ } from '../colors';
14
+ import { BmButtonIcon } from '../iconStyles';
15
15
 
16
16
  const BeemButtonIcon = styled.button`
17
17
  display: flex;
@@ -20,34 +20,32 @@ const BeemButtonIcon = styled.button`
20
20
  justify-content: center;
21
21
  background: ${({ variant, disabled, color }) => {
22
22
  if (!disabled) {
23
- if (variant === "active") return `${BmPrimaryBlue}`;
24
- if (variant === "enabled") return `${BmGrey50}`;
25
- if (variant === "destructive") return `${BmSecondaryRed}`;
26
- if (variant === "success") return `${BmSecondaryDarkGreen}`;
27
- if (variant === "neutral") return `${BmPrimaryWhite}`;
28
- if (variant === "primary") return `${color ? color : BmPrimaryBlue}`;
29
- if (variant === "secondary") return `${BmPrimaryWhite}`;
30
- if (variant === "tertiary") return `${BmPrimaryWhite}`;
31
- return `${color ? color : BmPrimaryBlue}`;
32
- } else {
33
- return `${BmGrey100}`;
23
+ if (variant === 'active') return `${BmPrimaryBlue}`;
24
+ if (variant === 'enabled') return `${BmGrey50}`;
25
+ if (variant === 'destructive') return `${BmSecondaryRed}`;
26
+ if (variant === 'success') return `${BmSecondaryDarkGreen}`;
27
+ if (variant === 'neutral') return `${BmPrimaryWhite}`;
28
+ if (variant === 'primary') return `${color || BmPrimaryBlue}`;
29
+ if (variant === 'secondary') return `${BmPrimaryWhite}`;
30
+ if (variant === 'tertiary') return `${BmPrimaryWhite}`;
31
+ return `${color || BmPrimaryBlue}`;
34
32
  }
33
+ return `${BmGrey100}`;
35
34
  }};
36
35
  border: 0.071rem solid
37
36
  ${({ variant, disabled, color }) => {
38
37
  if (!disabled) {
39
- if (variant === "active") return `${BmPrimaryBlue}`;
40
- if (variant === "enabled") return `${BmGrey50}`;
41
- if (variant === "destructive") return `${BmSecondaryRed}`;
42
- if (variant === "success") return `${BmSecondaryDarkGreen}`;
43
- if (variant === "neutral") return `${BmGrey400}`;
44
- if (variant === "primary") return `${color ? color : BmPrimaryBlue}`;
45
- if (variant === "secondary") return `${color ? color : BmPrimaryBlue}`;
46
- if (variant === "tertiary") return `${BmPrimaryWhite}`;
47
- return `${color ? color : BmPrimaryBlue}`;
48
- } else {
49
- return `${BmGrey100}`;
38
+ if (variant === 'active') return `${BmPrimaryBlue}`;
39
+ if (variant === 'enabled') return `${BmGrey50}`;
40
+ if (variant === 'destructive') return `${BmSecondaryRed}`;
41
+ if (variant === 'success') return `${BmSecondaryDarkGreen}`;
42
+ if (variant === 'neutral') return `${BmGrey400}`;
43
+ if (variant === 'primary') return `${color || BmPrimaryBlue}`;
44
+ if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
45
+ if (variant === 'tertiary') return `${BmPrimaryWhite}`;
46
+ return `${color || BmPrimaryBlue}`;
50
47
  }
48
+ return `${BmGrey100}`;
51
49
  }};
52
50
  box-sizing: border-box;
53
51
  border-radius: 0.25rem;
@@ -62,7 +60,13 @@ export const BmBtnIcon = (props) => {
62
60
  const { variant, size, disabled, children, icon, color, ...rest } = props;
63
61
 
64
62
  return (
65
- <BeemButtonIcon color={color} size={size} variant={variant} disabled={disabled} {...rest}>
63
+ <BeemButtonIcon
64
+ color={color}
65
+ size={size}
66
+ variant={variant}
67
+ disabled={disabled}
68
+ {...rest}
69
+ >
66
70
  {icon && (
67
71
  <BmIconWrapper>
68
72
  <BmButtonIcon
@@ -1,9 +1,9 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import PropTypes from "prop-types";
4
- import { darken } from "polished";
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import PropTypes from 'prop-types';
4
+ import { darken } from 'polished';
5
5
 
6
- //TODO: Button Links Pending
6
+ // TODO: Button Links Pending
7
7
  import {
8
8
  BmPrimaryWhite,
9
9
  BmPrimaryBlue,
@@ -14,30 +14,29 @@ import {
14
14
  BmGrey50,
15
15
  BmSecondaryGreen8,
16
16
  BmSecondaryRed8,
17
- } from "../colors";
18
- import { BmButtonIcon } from "../iconStyles";
19
- import { h3, h4 } from "../text";
17
+ } from '../colors';
18
+ import { BmButtonIcon } from '../iconStyles';
19
+ import { h3, h4 } from '../text';
20
20
 
21
21
  const ButtonText = styled.div`
22
22
  ${({ size }) => {
23
- if (size === "large") return `${h3}`;
24
- if (size === "medium") return `${h3}`;
25
- if (size === "small") return `${h4}`;
23
+ if (size === 'large') return `${h3}`;
24
+ if (size === 'medium') return `${h3}`;
25
+ if (size === 'small') return `${h4}`;
26
26
  return `${h3}`;
27
27
  }}
28
28
  text-align: center;
29
29
  color: ${({ variant, disabled, color }) => {
30
30
  if (!disabled) {
31
- if (variant === "primary") return `${BmPrimaryWhite}`;
32
- if (variant === "secondary") return `${color ? color : BmPrimaryBlue}`
33
- if (variant === "tertiary") return `${color ? color : BmPrimaryBlue}`
34
- if (variant === "destructive") return `${BmPrimaryWhite}`;
35
- if (variant === "success") return `${BmPrimaryWhite}`;
36
- if (variant === "neutral") return `${color ? color : BmPrimaryBlue}`
31
+ if (variant === 'primary') return `${BmPrimaryWhite}`;
32
+ if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
33
+ if (variant === 'tertiary') return `${color || BmPrimaryBlue}`;
34
+ if (variant === 'destructive') return `${BmPrimaryWhite}`;
35
+ if (variant === 'success') return `${BmPrimaryWhite}`;
36
+ if (variant === 'neutral') return `${color || BmPrimaryBlue}`;
37
37
  return `${BmPrimaryWhite}`;
38
- } else {
39
- return `${BmGrey400}`;
40
38
  }
39
+ return `${BmGrey400}`;
41
40
  }};
42
41
  padding: 0rem;
43
42
  `;
@@ -49,116 +48,114 @@ const BeemButton = styled.button`
49
48
  align-items: center;
50
49
  border-radius: 0.25rem;
51
50
  padding: ${({ size }) => {
52
- if (size === "large") return "0.625rem 1.5rem";
53
- if (size === "medium") return "0.4375rem 1rem";
54
- if (size === "small") return "0.375rem 0.75rem";
55
- return "0.625rem 1.5rem";
51
+ if (size === 'large') return '0.625rem 1.5rem';
52
+ if (size === 'medium') return '0.4375rem 1rem';
53
+ if (size === 'small') return '0.375rem 0.75rem';
54
+ return '0.625rem 1.5rem';
56
55
  }};
57
56
  background: ${({ variant, disabled, color }) => {
58
57
  if (!disabled) {
59
- if (variant === "primary") return `${color ? color : BmPrimaryBlue}`;
60
- if (variant === "secondary") return "none";
61
- if (variant === "tertiary") return "none";
62
- if (variant === "destructive") return `${BmSecondaryRed}`;
63
- if (variant === "success") return `${BmSecondaryDarkGreen}`;
64
- if (variant === "neutral") return `${BmPrimaryWhite}`;
65
- return `${color ? color : BmPrimaryBlue}`;
66
- } else {
67
- if (variant === "primary") return `${BmGrey100}`;
68
- if (variant === "secondary") return "none";
69
- if (variant === "tertiary") return "none";
70
- return `${BmGrey100}`;
58
+ if (variant === 'primary') return `${color || BmPrimaryBlue}`;
59
+ if (variant === 'secondary') return 'none';
60
+ if (variant === 'tertiary') return 'none';
61
+ if (variant === 'destructive') return `${BmSecondaryRed}`;
62
+ if (variant === 'success') return `${BmSecondaryDarkGreen}`;
63
+ if (variant === 'neutral') return `${BmPrimaryWhite}`;
64
+ return `${color || BmPrimaryBlue}`;
71
65
  }
66
+ if (variant === 'primary') return `${BmGrey100}`;
67
+ if (variant === 'secondary') return 'none';
68
+ if (variant === 'tertiary') return 'none';
69
+ return `${BmGrey100}`;
72
70
  }};
73
71
 
74
72
  border: 0.071rem solid
75
73
  ${({ variant, disabled, color }) => {
76
74
  if (!disabled) {
77
- if (variant === "primary") return `${color ? color : BmPrimaryBlue}`;
78
- if (variant === "secondary") return `${color ? color : BmPrimaryBlue}`;
79
- if (variant === "tertiary") return "transparent";
80
- if (variant === "destructive") return `${BmSecondaryRed}`;
81
- if (variant === "success") return `${BmSecondaryDarkGreen}`;
82
- if (variant === "neutral") return `${BmGrey400}`;
83
- return `${color ? color : BmPrimaryBlue}`;
84
- } else {
85
- if (variant === "primary") return `${BmGrey100}`;
86
- if (variant === "secondary") return `${BmGrey400}`;
87
- if (variant === "tertiary") return "transparent";
75
+ if (variant === 'primary') return `${color || BmPrimaryBlue}`;
76
+ if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
77
+ if (variant === 'tertiary') return 'transparent';
78
+ if (variant === 'destructive') return `${BmSecondaryRed}`;
79
+ if (variant === 'success') return `${BmSecondaryDarkGreen}`;
80
+ if (variant === 'neutral') return `${BmGrey400}`;
81
+ return `${color || BmPrimaryBlue}`;
88
82
  }
83
+ if (variant === 'primary') return `${BmGrey100}`;
84
+ if (variant === 'secondary') return `${BmGrey400}`;
85
+ if (variant === 'tertiary') return 'transparent';
89
86
  }};
90
87
 
91
88
  &:hover {
92
89
  background: ${({ variant, disabled, color }) => {
93
90
  if (!disabled) {
94
- if (variant === "primary")
95
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
96
- if (variant === "neutral") return `${BmGrey50}`;
97
- if (variant === "success") return `${BmSecondaryGreen8}`;
98
- if (variant === "destructive") return `${BmSecondaryRed8}`;
91
+ if (variant === 'primary')
92
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
93
+ if (variant === 'neutral') return `${BmGrey50}`;
94
+ if (variant === 'success') return `${BmSecondaryGreen8}`;
95
+ if (variant === 'destructive') return `${BmSecondaryRed8}`;
99
96
  if (!variant) {
100
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
97
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
101
98
  }
102
99
  }
103
100
  }};
104
101
  border: 0.071rem solid
105
102
  ${({ variant, disabled, color }) => {
106
103
  if (!disabled) {
107
- if (variant === "secondary")
108
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
104
+ if (variant === 'secondary')
105
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
109
106
  }
110
- return "none";
107
+ return 'none';
111
108
  }};
112
109
  }
113
110
  &:active {
114
111
  background: ${({ variant, disabled, color }) => {
115
112
  if (!disabled) {
116
- if (variant === "primary")
117
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
118
- if (variant === "neutral") return `${BmGrey100}`;
119
- if (variant === "success") return `${BmSecondaryDarkGreen}`;
120
- if (variant === "destructive") return `${BmSecondaryRed}`;
113
+ if (variant === 'primary')
114
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
115
+ if (variant === 'neutral') return `${BmGrey100}`;
116
+ if (variant === 'success') return `${BmSecondaryDarkGreen}`;
117
+ if (variant === 'destructive') return `${BmSecondaryRed}`;
121
118
  if (!variant) {
122
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
119
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
123
120
  }
124
121
  }
125
122
  }};
126
123
  box-shadow: ${({ variant, disabled }) => {
127
124
  if (!disabled) {
128
125
  if (
129
- variant === "primary" ||
130
- variant === "success" ||
131
- variant === "destructive"
126
+ variant === 'primary' ||
127
+ variant === 'success' ||
128
+ variant === 'destructive'
132
129
  )
133
- return "inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)";
130
+ return 'inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)';
134
131
  if (!variant) {
135
- return "inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)";
132
+ return 'inset 0rem 0.125rem 0.25rem rgba(0, 0, 0, 0.25)';
136
133
  }
137
134
  }
138
135
  }};
139
136
  border: 0.071rem solid
140
137
  ${({ variant, disabled, color }) => {
141
138
  if (!disabled) {
142
- if (variant === "secondary")
143
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
139
+ if (variant === 'secondary')
140
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
144
141
  }
145
- return "none";
142
+ return 'none';
146
143
  }};
147
144
  }
148
145
 
149
146
  &:hover ${ButtonText} {
150
147
  color: ${({ variant, disabled, color }) => {
151
148
  if (!disabled) {
152
- if (variant === "secondary" || variant === "tertiary")
153
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
149
+ if (variant === 'secondary' || variant === 'tertiary')
150
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
154
151
  }
155
152
  }};
156
153
  }
157
154
  &:active ${ButtonText} {
158
155
  color: ${({ variant, disabled, color }) => {
159
156
  if (!disabled) {
160
- if (variant === "secondary" || variant === "tertiary")
161
- return `${darken(0.1, color ? color : BmPrimaryBlue)}`;
157
+ if (variant === 'secondary' || variant === 'tertiary')
158
+ return `${darken(0.1, color || BmPrimaryBlue)}`;
162
159
  }
163
160
  }};
164
161
  }
@@ -1,5 +1,5 @@
1
- import styled from "styled-components";
2
- import { BmGrey400, BmPrimaryWhite } from "../colors";
1
+ import styled from 'styled-components';
2
+ import { BmGrey400, BmPrimaryWhite } from '../colors';
3
3
 
4
4
  const BmCard = styled.div`
5
5
  display: flex;
@@ -14,7 +14,6 @@ const BmCard = styled.div`
14
14
  justify-content: space-between;
15
15
  margin-bottom: 0.5rem;
16
16
  }
17
-
18
17
  `;
19
18
 
20
19
  BmCard.Header = styled.div`
@@ -1,17 +1,17 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import React from "react";
3
- import BmCard from "./cards";
4
- import { text, boolean } from "@storybook/addon-knobs";
5
- import "../../../main.scss";
6
- import { BmButton } from "../Buttons/buttons";
7
- import Image from "../../assets/beem.jpeg";
2
+ import React from 'react';
3
+ import { text, boolean } from '@storybook/addon-knobs';
4
+ import BmCard from './cards';
5
+ import '../../../main.scss';
6
+ import { BmButton } from '../Buttons/buttons';
7
+ import Image from '../../assets/beem.jpeg';
8
8
 
9
9
  export default {
10
10
  component: BmCard,
11
- title: "components/Card",
11
+ title: 'components/Card',
12
12
  argTypes: {
13
13
  children: {
14
- description: "Accordion Title Text",
14
+ description: 'Accordion Title Text',
15
15
  defaultValue: { summary: undefined },
16
16
  },
17
17
  },
@@ -19,9 +19,9 @@ export default {
19
19
  export const BasicCardSample = () => {
20
20
  return (
21
21
  <div>
22
- <BmCard disabled={boolean("disabled", false)}>
22
+ <BmCard disabled={boolean('disabled', false)}>
23
23
  <BmCard.Header>
24
- <h3>{text("children", "Card Header")}</h3>
24
+ <h3>{text('children', 'Card Header')}</h3>
25
25
  </BmCard.Header>
26
26
  <BmCard.Body>Card Body</BmCard.Body>
27
27
  <BmCard.Footer>Card Footer</BmCard.Footer>