beem-component 2.0.27 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/Dockerfile +4 -2
  2. package/Jenkinsfile +20 -5
  3. package/dist/components/Accordion/Accordion.js +55 -66
  4. package/dist/components/Accordion/Accordion.stories.js +5 -6
  5. package/dist/components/Avatars/avatars.js +33 -23
  6. package/dist/components/Avatars/avatars.stories.js +5 -10
  7. package/dist/components/BannerCard/bannerCard.stories.js +6 -7
  8. package/dist/components/BannerCard/bannerCards.js +38 -40
  9. package/dist/components/BmSelector/BmSelector.js +120 -0
  10. package/dist/components/BmSelector/BmSelector.stories.js +138 -0
  11. package/dist/components/ButtonGroup/buttonGroup.js +14 -15
  12. package/dist/components/ButtonGroup/buttonGroup.stories.js +11 -26
  13. package/dist/components/Buttons/Stories/basicbutton.stories.js +5 -10
  14. package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +4 -8
  15. package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +4 -8
  16. package/dist/components/Buttons/buttonAlertIcons.js +40 -58
  17. package/dist/components/Buttons/buttonDropdown copy.js +52 -35
  18. package/dist/components/Buttons/buttonDropdown.js +5 -3
  19. package/dist/components/Buttons/buttonIconsOnly.js +32 -25
  20. package/dist/components/Buttons/buttons.js +105 -72
  21. package/dist/components/Card_v2/Card.js +78 -0
  22. package/dist/components/Card_v2/Card.stories.js +60 -0
  23. package/dist/components/Cards/cards.js +3 -4
  24. package/dist/components/Cards/cards.stories.js +4 -5
  25. package/dist/components/ChatComponents/ChatBody/FeedPostComments.js +65 -39
  26. package/dist/components/ChatComponents/ChatBody/chatBody.js +224 -189
  27. package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +4 -5
  28. package/dist/components/ChatComponents/ChatBody/sessionDetails.js +11 -9
  29. package/dist/components/ChatComponents/ChatBody/sessionTimeline.js +12 -10
  30. package/dist/components/ChatComponents/ChatHeader/chatHeader.js +3 -4
  31. package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -4
  32. package/dist/components/ChatComponents/ColorPicker/colorPicker.js +3 -6
  33. package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -10
  34. package/dist/components/ChatComponents/ContactCards/contactCards.js +40 -31
  35. package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +3 -4
  36. package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +3 -4
  37. package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +3 -4
  38. package/dist/components/ChatComponents/InfoTab/infoTab.js +3 -5
  39. package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +3 -4
  40. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +3 -4
  41. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +3 -4
  42. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +3 -4
  43. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +3 -4
  44. package/dist/components/Chats/chat.js +56 -50
  45. package/dist/components/Chats/chatInput.js +9 -14
  46. package/dist/components/Chats/chatwrapper.js +8 -14
  47. package/dist/components/Checkbox/checkboxToggler.js +20 -20
  48. package/dist/components/Checkbox/checkboxToggler.stories.js +12 -35
  49. package/dist/components/InfoPanel/InfoPanel.js +141 -0
  50. package/dist/components/InfoPanel/InfoPanel.stories.js +200 -0
  51. package/dist/components/InputCounter/inputCounter.js +17 -18
  52. package/dist/components/Jumbotron/Jumbotron.js +8 -11
  53. package/dist/components/Jumbotron/Jumbotron.stories.js +3 -4
  54. package/dist/components/LabelWithIcon/LabelWithIcon.js +63 -0
  55. package/dist/components/LabelWithIcon/LabelWithIcon.stories.js +59 -0
  56. package/dist/components/Lists/listBox.js +21 -25
  57. package/dist/components/Lists/listBox.stories.js +7 -20
  58. package/dist/components/Lists/listHeader.stories.js +4 -8
  59. package/dist/components/Lists/listheader.js +17 -14
  60. package/dist/components/Lists/rowLabels.js +26 -24
  61. package/dist/components/Lists/rowLabels.stories.js +11 -18
  62. package/dist/components/Loader/loader.js +16 -14
  63. package/dist/components/Loader/loader.stories.js +4 -8
  64. package/dist/components/MainWrapper/index.js +3 -4
  65. package/dist/components/MessageCounter/MessageCounter.stories.js +4 -5
  66. package/dist/components/MessageCounter/messageCounter.js +15 -10
  67. package/dist/components/Modals/modal.js +57 -72
  68. package/dist/components/Modals/modals.stories.js +16 -45
  69. package/dist/components/MojaAccordion/MojaAccordion.js +49 -55
  70. package/dist/components/MultipleDateSelector/multipleDateSelector.js +14 -18
  71. package/dist/components/NoteBar/noteBar.js +22 -32
  72. package/dist/components/NoteBar/noteBar.stories.js +5 -10
  73. package/dist/components/PaymentBox/paymentBox.js +14 -11
  74. package/dist/components/PaymentBox/paymentBox.stories.js +3 -4
  75. package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +4 -8
  76. package/dist/components/PerformanceIndicator/performanceIndicator.js +17 -14
  77. package/dist/components/Pills/pills.js +30 -38
  78. package/dist/components/Pills/pills.stories.js +5 -10
  79. package/dist/components/ProfileIcon/ProfileIcon.js +26 -36
  80. package/dist/components/ProfileIcon/profileIcon.stories.js +6 -12
  81. package/dist/components/ProgressBar/progressbar.js +14 -12
  82. package/dist/components/ProgressBar/progressbar.stories.js +4 -8
  83. package/dist/components/ProgressIndicator/ProgressIndicator.js +121 -0
  84. package/dist/components/ProgressIndicator/ProgressIndicator.stories.js +99 -0
  85. package/dist/components/ProgressRing/progressRing.js +48 -50
  86. package/dist/components/ProgressRing/progressRing.stories.js +5 -10
  87. package/dist/components/RouteLink/link.js +3 -8
  88. package/dist/components/RouteLink/link.stories.js +3 -4
  89. package/dist/components/ScrollBar/scrollBar.js +18 -26
  90. package/dist/components/SelectionNotice/SelectionNotice.js +57 -0
  91. package/dist/components/SelectionNotice/SelectionNotice.stories.js +35 -0
  92. package/dist/components/Stepper/stepper.js +4 -11
  93. package/dist/components/SuperFluid/Content/index.js +3 -4
  94. package/dist/components/SuperFluid/ContentTitle.js/index.js +6 -10
  95. package/dist/components/SuperFluid/SegmentCard/index.js +11 -21
  96. package/dist/components/Tabs/tabs.js +32 -24
  97. package/dist/components/Tabs/tabs.stories.js +6 -12
  98. package/dist/components/Tags/tags.js +65 -63
  99. package/dist/components/Tags/tags.stories.js +6 -12
  100. package/dist/components/breakpoints.js +3 -5
  101. package/dist/components/chatHeader.js +7 -12
  102. package/dist/components/checkbox.js +30 -25
  103. package/dist/components/colors.js +31 -62
  104. package/dist/components/contacts.js +32 -35
  105. package/dist/components/dropdown.js +18 -39
  106. package/dist/components/dropdownButton.js +38 -28
  107. package/dist/components/dropdownItems.js +23 -26
  108. package/dist/components/examples/App.js +3 -4
  109. package/dist/components/examples/InfoAccordion.js +3 -4
  110. package/dist/components/examples/chatBodyExample.js +4 -7
  111. package/dist/components/examples/selectExample.js +12 -30
  112. package/dist/components/globalStyles.js +1 -2
  113. package/dist/components/iconStyles.js +69 -103
  114. package/dist/components/index-copy.js +197 -197
  115. package/dist/components/index.js +106 -66
  116. package/dist/components/input.js +36 -25
  117. package/dist/components/logo.js +10 -9
  118. package/dist/components/navbar.js +9 -16
  119. package/dist/components/search.js +18 -16
  120. package/dist/components/shadow.js +1 -2
  121. package/dist/components/text.js +9 -18
  122. package/dist/components/typography.js +14 -28
  123. package/dist/components/wrapper.js +4 -6
  124. package/nginx.conf +26 -12
  125. package/package.json +3 -1
  126. package/src/App.js +246 -3
  127. package/src/lib/components/BmSelector/BmSelector.js +154 -0
  128. package/src/lib/components/BmSelector/BmSelector.stories.jsx +125 -0
  129. package/src/lib/components/Buttons/buttons.js +12 -8
  130. package/src/lib/components/Card_v2/Card.js +127 -0
  131. package/src/lib/components/Card_v2/Card.stories.jsx +94 -0
  132. package/src/lib/components/InfoPanel/InfoPanel.js +221 -0
  133. package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +169 -0
  134. package/src/lib/components/LabelWithIcon/LabelWithIcon.js +61 -0
  135. package/src/lib/components/LabelWithIcon/LabelWithIcon.stories.jsx +59 -0
  136. package/src/lib/components/ProgressIndicator/ProgressIndicator.js +208 -0
  137. package/src/lib/components/ProgressIndicator/ProgressIndicator.stories.jsx +91 -0
  138. package/src/lib/components/SelectionNotice/SelectionNotice.js +65 -0
  139. package/src/lib/components/SelectionNotice/SelectionNotice.stories.jsx +40 -0
  140. package/src/lib/components/index.js +14 -0
  141. package/src/util/convertToRGBA.js +21 -0
  142. package/storybook-static/140.d6695a165d8dcc810b2e.manager.bundle.js +1 -0
  143. package/storybook-static/140.f87feb0b.iframe.bundle.js +1 -0
  144. package/storybook-static/149.7cc11ef8.iframe.bundle.js +2 -0
  145. package/storybook-static/149.7cc11ef8.iframe.bundle.js.LICENSE.txt +14 -0
  146. package/storybook-static/192.08b67b8c.iframe.bundle.js +1 -0
  147. package/storybook-static/246.9ad91c22.iframe.bundle.js +2 -0
  148. package/storybook-static/{vendors~main.7fe78cc2.iframe.bundle.js.LICENSE.txt → 246.9ad91c22.iframe.bundle.js.LICENSE.txt} +48 -16
  149. package/storybook-static/448.0ad0b2a9.iframe.bundle.js +2 -0
  150. package/storybook-static/448.0ad0b2a9.iframe.bundle.js.LICENSE.txt +8 -0
  151. package/storybook-static/448.502f738789de31a83e1c.manager.bundle.js +2 -0
  152. package/storybook-static/448.502f738789de31a83e1c.manager.bundle.js.LICENSE.txt +8 -0
  153. package/storybook-static/463.694cb3b0a2f8b0deba70.manager.bundle.js +2 -0
  154. package/storybook-static/463.694cb3b0a2f8b0deba70.manager.bundle.js.LICENSE.txt +31 -0
  155. package/storybook-static/463.7b3b5742.iframe.bundle.js +2 -0
  156. package/storybook-static/463.7b3b5742.iframe.bundle.js.LICENSE.txt +31 -0
  157. package/storybook-static/58.56a2198b.iframe.bundle.js +1 -0
  158. package/storybook-static/58.cd3f8ad06a1200571eab.manager.bundle.js +1 -0
  159. package/storybook-static/676.d74803c6ab12eac1cdb2.manager.bundle.js +2 -0
  160. package/storybook-static/{vendors~main.1750028c2d68e574fb1d.manager.bundle.js.LICENSE.txt → 676.d74803c6ab12eac1cdb2.manager.bundle.js.LICENSE.txt} +20 -30
  161. package/storybook-static/720.d729a720931e1312e597.manager.bundle.js +2 -0
  162. package/storybook-static/720.e12f6aa2.iframe.bundle.js +2 -0
  163. package/storybook-static/794.0543a68a8b5aa273273a.manager.bundle.js +1 -0
  164. package/storybook-static/929.5353bbe2.iframe.bundle.js +1 -0
  165. package/storybook-static/929.ed1807a8ea3e2353d440.manager.bundle.js +1 -0
  166. package/storybook-static/9b058fcb1416fea75e6c.png +0 -0
  167. package/storybook-static/f29af3502f15acc765a8.png +0 -0
  168. package/storybook-static/favicon.ico +0 -0
  169. package/storybook-static/iframe.html +22 -6
  170. package/storybook-static/index.html +66 -109
  171. package/storybook-static/main.1a29aa69.iframe.bundle.js +1 -0
  172. package/storybook-static/main.69bad789e0a3d801264b.manager.bundle.js +1 -0
  173. package/storybook-static/project.json +1 -0
  174. package/storybook-static/runtime~main.87eecef7.iframe.bundle.js +1 -0
  175. package/storybook-static/runtime~main.dd5308492057ff00c469.manager.bundle.js +1 -0
  176. package/storybook-static/static/css/main.08a2eb27.css +6 -0
  177. package/storybook-static/static/css/main.08a2eb27.css.map +1 -0
  178. package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js +0 -2
  179. package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js.LICENSE.txt +0 -8
  180. package/storybook-static/0.96c45dd8.iframe.bundle.js +0 -1
  181. package/storybook-static/1.dc6acfa9.iframe.bundle.js +0 -3
  182. package/storybook-static/1.dc6acfa9.iframe.bundle.js.LICENSE.txt +0 -8
  183. package/storybook-static/1.dc6acfa9.iframe.bundle.js.map +0 -1
  184. package/storybook-static/1.dc7dcdaec2def2f224fd.manager.bundle.js +0 -1
  185. package/storybook-static/2.24353ddc.iframe.bundle.js +0 -1
  186. package/storybook-static/3.8bb2173c.iframe.bundle.js +0 -1
  187. package/storybook-static/5.0779e3847d325dece216.manager.bundle.js +0 -1
  188. package/storybook-static/6.8bd405c2576206749a16.manager.bundle.js +0 -2
  189. package/storybook-static/7.9d4ba19cf58425e7ff0d.manager.bundle.js +0 -1
  190. package/storybook-static/7.f0cfc757.iframe.bundle.js +0 -1
  191. package/storybook-static/8.91de97de.iframe.bundle.js +0 -3
  192. package/storybook-static/8.91de97de.iframe.bundle.js.map +0 -1
  193. package/storybook-static/8.b4e9ec0ec7648e02a923.manager.bundle.js +0 -1
  194. package/storybook-static/9.40ec65d6.iframe.bundle.js +0 -1
  195. package/storybook-static/asset-manifest.json +0 -30
  196. package/storybook-static/main.3c8d8027.iframe.bundle.js +0 -1
  197. package/storybook-static/main.3e5804fe56d1f580b088.manager.bundle.js +0 -1
  198. package/storybook-static/runtime~main.d3a18d6a.iframe.bundle.js +0 -1
  199. package/storybook-static/runtime~main.ff106120648356c6069d.manager.bundle.js +0 -1
  200. package/storybook-static/static/css/main.b44a190d.chunk.css +0 -4
  201. package/storybook-static/static/css/main.b44a190d.chunk.css.map +0 -1
  202. package/storybook-static/vendors~main.1750028c2d68e574fb1d.manager.bundle.js +0 -2
  203. package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js +0 -3
  204. package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js.map +0 -1
  205. /package/storybook-static/{static/media/PoppinsMedium.0ba26f6c.woff → 0ba26f6cfe2f94ec2b43.woff} +0 -0
  206. /package/storybook-static/{static/media/PoppinsRegular.13b9af9c.eot → 13b9af9c8b2b4d656251.eot} +0 -0
  207. /package/storybook-static/{static/media/OpenSans-Regular.1b0809d5.ttf → 1b0809d519837cb7aad3.ttf} +0 -0
  208. /package/storybook-static/{static/media/PoppinsBold.1eae2d48.woff2 → 1eae2d48398534b6e1fe.woff2} +0 -0
  209. /package/storybook-static/{static/media/PoppinsRegular.43e9b50d.svg → 43e9b50d6f4141c6275f.svg} +0 -0
  210. /package/storybook-static/{static/media/PoppinsMedium.49b46ace.eot → 49b46acec5a811ce1edd.eot} +0 -0
  211. /package/storybook-static/{static/media/PoppinsRegular.4a4d5420.woff → 4a4d54208e3b43dcdd6e.woff} +0 -0
  212. /package/storybook-static/{static/media/PoppinsBold.53ff6749.eot → 53ff67494885a390867f.eot} +0 -0
  213. /package/storybook-static/{static/media/PoppinsBold.53ff971f.ttf → 53ff971f3c691d03daf6.ttf} +0 -0
  214. /package/storybook-static/{static/media/PoppinsSemiBold.5692c77f.ttf → 5692c77f2768f53db4fb.ttf} +0 -0
  215. /package/storybook-static/{static/media/PoppinsMedium.57a99fa8.woff2 → 57a99fa8569430db3aa1.woff2} +0 -0
  216. /package/storybook-static/{6.8bd405c2576206749a16.manager.bundle.js.LICENSE.txt → 720.d729a720931e1312e597.manager.bundle.js.LICENSE.txt} +0 -0
  217. /package/storybook-static/{8.91de97de.iframe.bundle.js.LICENSE.txt → 720.e12f6aa2.iframe.bundle.js.LICENSE.txt} +0 -0
  218. /package/storybook-static/{static/media/PoppinsSemiBold.80138c67.woff → 80138c67abf7843ea7e5.woff} +0 -0
  219. /package/storybook-static/{static/media/PoppinsBold.850fc4f3.svg → 850fc4f3768c0af34ea8.svg} +0 -0
  220. /package/storybook-static/{static/media/PoppinsRegular.9a7cc7ec.woff2 → 9a7cc7ec4e1eda4f7e6d.woff2} +0 -0
  221. /package/storybook-static/{static/media/PoppinsBold.b33c148b.woff → b33c148b95e9b282af64.woff} +0 -0
  222. /package/storybook-static/{static/media/PoppinsMedium.b7e43707.svg → b7e43707906d1445e127.svg} +0 -0
  223. /package/storybook-static/{static/media/PoppinsSemiBold.c442695a.eot → c442695a5fcf958609b8.eot} +0 -0
  224. /package/storybook-static/{static/media/PoppinsMedium.c98dddbd.ttf → c98dddbdc5b1e18988b9.ttf} +0 -0
  225. /package/storybook-static/{static/media/PoppinsSemiBold.e1948d56.svg → e1948d56fc87f569ef8d.svg} +0 -0
  226. /package/storybook-static/{static/media/PoppinsRegular.e1bc9021.ttf → e1bc9021c9d8ba86968b.ttf} +0 -0
  227. /package/storybook-static/{static/media/PoppinsSemiBold.f27050e2.woff2 → f27050e2684287d42c91.woff2} +0 -0
@@ -0,0 +1,154 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ const hexToRgba = (hex, opacity = 0.6) => {
5
+ try {
6
+ const normalizedHex = hex?.replace('#', '');
7
+ if (
8
+ !normalizedHex ||
9
+ normalizedHex.length !== 6 ||
10
+ !/^[0-9a-fA-F]{6}$/.test(normalizedHex)
11
+ ) {
12
+ throw new Error('Invalid hex');
13
+ }
14
+
15
+ const r = parseInt(normalizedHex.slice(0, 2), 16);
16
+ const g = parseInt(normalizedHex.slice(2, 4), 16);
17
+ const b = parseInt(normalizedHex.slice(4, 6), 16);
18
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
19
+ } catch (e) {
20
+ return `rgba(0, 0, 0, ${opacity})`;
21
+ }
22
+ };
23
+
24
+ const CustomRadio = styled.span`
25
+ display: inline-block;
26
+ width: 0.2143rem;
27
+ height: 0.2143rem;
28
+ border-radius: 714.2143rem;
29
+ transition: all 0.1s ease-in-out;
30
+ flex-shrink: 0;
31
+
32
+ ${({ selected, themeColor }) =>
33
+ selected
34
+ ? `
35
+ border: .1429rem solid ${themeColor || '#33B1BA'};
36
+ background-color: ${themeColor || '#33B1BA'};
37
+ `
38
+ : `
39
+ border: .1429rem solid transparent;
40
+ background-color: transparent;
41
+ `}
42
+
43
+ @media (max-width: 42.8571rem) {
44
+ width: 0.0714rem;
45
+ height: 0.0714rem;
46
+ }
47
+ `;
48
+
49
+ const RadioGroupWrapper = styled.div`
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: 0.75rem;
53
+
54
+ @media (max-width: 42.8571rem) {
55
+ gap: 0.5rem;
56
+ }
57
+ `;
58
+
59
+ const TimeSlotCard = styled.div`
60
+ display: flex;
61
+ align-items: center;
62
+ gap: 0.75rem;
63
+ border: 0.0714rem solid
64
+ ${({ selected, themeColor }) => (selected ? themeColor : `${themeColor}1A`)};
65
+ background-color: ${({ selected, themeColor }) =>
66
+ selected ? hexToRgba(themeColor, 0.08) : 'transparent'};
67
+ padding: 1rem 1rem;
68
+ border-radius: 0.5rem;
69
+ transition: border-color 0.2s ease;
70
+ cursor: pointer;
71
+
72
+ &:hover {
73
+ border-color: ${({ themeColor }) => themeColor};
74
+ }
75
+
76
+ @media (max-width: 42.8571rem) {
77
+ padding: 0.75rem 0.75rem;
78
+ gap: 0.5rem;
79
+ }
80
+ `;
81
+
82
+ const Label = styled.label`
83
+ display: flex;
84
+ align-items: center;
85
+ flex: 1;
86
+ font-size: 0.875rem;
87
+ font-weight: 500;
88
+ cursor: pointer;
89
+
90
+ svg {
91
+ font-size: 1.1rem;
92
+ margin-right: 0.4rem;
93
+ color: ${({ themeColor }) => themeColor || '#33B1BA'};
94
+
95
+ @media (max-width: 42.8571rem) {
96
+ font-size: 1rem;
97
+ }
98
+ }
99
+ `;
100
+
101
+ const TimeText = styled.span`
102
+ color: ${({ textColor }) => textColor || '#000'};
103
+ ${({ fontWeight }) => fontWeight && `font-weight: ${fontWeight};`}
104
+
105
+ @media (max-width: 42.8571rem) {
106
+ font-size: 0.85rem;
107
+ }
108
+ `;
109
+
110
+ const HiddenInput = styled.input.attrs({ type: 'radio' })`
111
+ display: none;
112
+ `;
113
+
114
+ const BmSelector = ({
115
+ data = [],
116
+ selectedDataId,
117
+ onChange,
118
+ icon: Icon,
119
+ themeColor,
120
+ textColor,
121
+ fontWeight,
122
+ name = 'selection',
123
+ }) => {
124
+ return (
125
+ <RadioGroupWrapper>
126
+ {data.map((item) => {
127
+ const isSelected = selectedDataId === item.id;
128
+
129
+ return (
130
+ <label key={item.id} htmlFor={item.id}>
131
+ <HiddenInput
132
+ id={item.id}
133
+ name={name}
134
+ value={item.id}
135
+ checked={isSelected}
136
+ onChange={() => onChange(item.id)}
137
+ />
138
+ <TimeSlotCard selected={isSelected} themeColor={themeColor}>
139
+ <CustomRadio selected={isSelected} themeColor={themeColor} />
140
+ <Label htmlFor={item.id} themeColor={themeColor}>
141
+ <Icon />
142
+ <TimeText fontWeight={fontWeight} textColor={textColor}>
143
+ {item.label}
144
+ </TimeText>
145
+ </Label>
146
+ </TimeSlotCard>
147
+ </label>
148
+ );
149
+ })}
150
+ </RadioGroupWrapper>
151
+ );
152
+ };
153
+
154
+ export default BmSelector;
@@ -0,0 +1,125 @@
1
+ import React, { useState } from 'react';
2
+ import AccessTimeIcon from '@mui/icons-material/AccessTime';
3
+ import EventIcon from '@mui/icons-material/Event';
4
+ import BmSelector from './BmSelector';
5
+
6
+ const icons = {
7
+ AccessTimeIcon,
8
+ EventIcon,
9
+ };
10
+ export default {
11
+ title: 'Components/BmSelector',
12
+ component: BmSelector,
13
+ argTypes: {
14
+ icon: {
15
+ name: 'Icon',
16
+ control: { type: 'select' },
17
+ options: Object.keys(icons),
18
+ defaultValue: 'AccessTimeIcon',
19
+ },
20
+ themeColor: {
21
+ control: 'color',
22
+ defaultValue: '#33B1BA',
23
+ },
24
+ textColor: {
25
+ control: 'color',
26
+ defaultValue: '#33B1BA',
27
+ },
28
+ fontWeight: {
29
+ control: 'text',
30
+ defaultValue: '',
31
+ },
32
+ data: {
33
+ control: 'object',
34
+ defaultValue: [
35
+ {
36
+ id: 'slot-1',
37
+ label: '08:00 AM - 08:30 AM',
38
+ value: { startDate: '08:00 AM', endDate: '08:30 AM' },
39
+ },
40
+ {
41
+ id: 'slot-2',
42
+ label: '09:00 AM - 09:30 AM',
43
+ value: { startDate: '09:00 AM', endDate: '09:30 AM' },
44
+ },
45
+ ],
46
+ },
47
+ },
48
+ };
49
+
50
+ const baseSlots = [
51
+ {
52
+ id: 'slot-1', // ⚠️ id is mandatory for tracking selection
53
+ label: '10:00 AM - 10:30 AM',
54
+ value: { startDate: '10:00 AM', endDate: '10:30 AM' },
55
+ },
56
+ {
57
+ id: 'slot-2',
58
+ label: '10:30 AM - 11:10 AM',
59
+ value: { startDate: '10:30 AM', endDate: '11:10 AM' },
60
+ },
61
+ ];
62
+
63
+ export const Default = (args) => {
64
+ const [selectedDataId, setSelectedDataId] = useState(
65
+ args.data?.[0]?.id ?? ''
66
+ );
67
+
68
+ return (
69
+ <BmSelector
70
+ {...args}
71
+ data={baseSlots}
72
+ selectedDataId={selectedDataId}
73
+ onChange={setSelectedDataId}
74
+ icon={icons[args.iconKey] || AccessTimeIcon}
75
+ />
76
+ );
77
+ };
78
+
79
+ Default.args = {
80
+ data: [
81
+ {
82
+ id: 'slot-1',
83
+ label: '08:00 AM - 08:30 AM',
84
+ value: { startDate: '08:00 AM', endDate: '08:30 AM' },
85
+ },
86
+ {
87
+ id: 'slot-2',
88
+ label: '09:00 AM - 09:30 AM',
89
+ value: { startDate: '09:00 AM', endDate: '09:30 AM' },
90
+ },
91
+ ],
92
+
93
+ themeColor: '#33B1BA',
94
+ textColor: '#33B1BA',
95
+ fontWeight: '',
96
+ icon: 'AccessTimeIcon',
97
+ };
98
+
99
+ export const Example = () => {
100
+ const slots = [
101
+ {
102
+ id: 'slot-1', // ⚠️ id is required
103
+ label: '10:00 AM - 10:30 AM',
104
+ value: { startDate: '10:00 AM', endDate: '10:30 AM' },
105
+ },
106
+ {
107
+ id: 'slot-2',
108
+ label: '10:30 AM - 11:10 AM',
109
+ value: { startDate: '10:30 AM', endDate: '11:10 AM' },
110
+ },
111
+ ];
112
+
113
+ const [selectedDataId, setSelectedDataId] = useState(null);
114
+ return (
115
+ <BmSelector
116
+ data={slots}
117
+ selectedDataId={selectedDataId}
118
+ onChange={setSelectedDataId}
119
+ icon={AccessTimeIcon}
120
+ themeColor="#33B1BA"
121
+ textColor="#33B1BA"
122
+ fontWeight="600"
123
+ />
124
+ );
125
+ };
@@ -80,15 +80,17 @@ const BeemButton = styled.button`
80
80
  }};
81
81
 
82
82
  border: 0.994px solid
83
- ${({ variant, disabled, color }) => {
83
+ ${({ variant, disabled, color, borderColor }) => {
84
84
  if (!disabled) {
85
- if (variant === 'primary') return `${color || BmPrimaryBlue}`;
86
- if (variant === 'secondary') return `${color || BmPrimaryBlue}`;
85
+ if (variant === 'primary')
86
+ return `${borderColor || color || BmPrimaryBlue}`;
87
+ if (variant === 'secondary')
88
+ return `${borderColor || color || BmPrimaryBlue}`;
87
89
  if (variant === 'tertiary') return 'transparent';
88
90
  if (variant === 'destructive') return `${BmSecondaryRed}`;
89
91
  if (variant === 'success') return `${BmSecondaryDarkGreen}`;
90
92
  if (variant === 'neutral') return `${BmGrey400}`;
91
- return `${color || BmPrimaryBlue}`;
93
+ return `${borderColor || color || BmPrimaryBlue}`;
92
94
  }
93
95
  if (variant === 'primary') return `${BmGrey100}`;
94
96
  if (variant === 'secondary') return `${BmGrey400}`;
@@ -109,10 +111,10 @@ const BeemButton = styled.button`
109
111
  }
110
112
  }};
111
113
  border: 0.994px solid
112
- ${({ variant, disabled, color }) => {
114
+ ${({ variant, disabled, color, borderColor }) => {
113
115
  if (!disabled) {
114
116
  if (variant === 'secondary')
115
- return `${darken(0.1, color || BmPrimaryBlue)}`;
117
+ return `${darken(0.1, borderColor || color || BmPrimaryBlue)}`;
116
118
  }
117
119
  return 'none';
118
120
  }};
@@ -144,10 +146,10 @@ const BeemButton = styled.button`
144
146
  }
145
147
  }};
146
148
  border: 0.071rem solid
147
- ${({ variant, disabled, color }) => {
149
+ ${({ variant, disabled, color, borderColor }) => {
148
150
  if (!disabled) {
149
151
  if (variant === 'secondary')
150
- return `${darken(0.1, color || BmPrimaryBlue)}`;
152
+ return `${darken(0.1, borderColor || color || BmPrimaryBlue)}`;
151
153
  }
152
154
  return 'none';
153
155
  }};
@@ -187,6 +189,7 @@ export const BmButton = (props) => {
187
189
  leadingIcon,
188
190
  trailingIcon,
189
191
  color,
192
+ borderColor,
190
193
  type,
191
194
  ...rest
192
195
  } = props;
@@ -196,6 +199,7 @@ export const BmButton = (props) => {
196
199
  variant={variant}
197
200
  disabled={disabled}
198
201
  color={color}
202
+ borderColor={borderColor}
199
203
  type={type}
200
204
  {...rest}
201
205
  >
@@ -0,0 +1,127 @@
1
+ /* eslint-disable func-style */
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+
5
+ const hexToRgba = (hex, opacity = 0.6) => {
6
+ try {
7
+ const normalizedHex = hex?.replace('#', '');
8
+ if (
9
+ !normalizedHex ||
10
+ normalizedHex.length !== 6 ||
11
+ !/^[0-9a-fA-F]{6}$/.test(normalizedHex)
12
+ ) {
13
+ throw new Error('Invalid hex');
14
+ }
15
+
16
+ const r = parseInt(normalizedHex.slice(0, 2), 16);
17
+ const g = parseInt(normalizedHex.slice(2, 4), 16);
18
+ const b = parseInt(normalizedHex.slice(4, 6), 16);
19
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
20
+ } catch (e) {
21
+ return `rgba(0, 0, 0, ${opacity})`;
22
+ }
23
+ };
24
+
25
+ const StyledCard = styled.div`
26
+ background-color: var(--card, #fff);
27
+ color: var(--card-foreground, #000);
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 1.5rem;
31
+ border-radius: 0.75rem;
32
+ border-style: solid;
33
+ border-color: ${({ borderColor }) => hexToRgba(borderColor || '#ccc', 0.1)};
34
+ border-width: ${({ borderWidth }) => borderWidth || '.0714rem'};
35
+ width: 100%;
36
+ `;
37
+
38
+ const Header = styled.div`
39
+ display: grid;
40
+ grid-template-columns: 1fr;
41
+ grid-auto-rows: auto;
42
+ gap: 0.375rem;
43
+ padding: 1.5rem 1.5rem 0 1.5rem;
44
+ `;
45
+
46
+ const Title = styled.h4`
47
+ line-height: 1;
48
+ margin: 0;
49
+ `;
50
+
51
+ const Description = styled.p`
52
+ color: var(--muted-foreground, #666);
53
+ margin: 0;
54
+ `;
55
+
56
+ const Content = styled.div`
57
+ padding: 0 1.5rem;
58
+ max-height: calc(100vh - 28.5714rem);
59
+ overflow-y: auto;
60
+
61
+ scrollbar-width: thin;
62
+ scrollbar-color: ${() => hexToRgba('#33b1ba', 0.2)} transparent;
63
+
64
+ &::-webkit-scrollbar-thumb {
65
+ background: ${() => hexToRgba('#33b1ba', 0.3)};
66
+ border-radius: 0.6429rem;
67
+ transition: background 0.2s ease;
68
+ }
69
+
70
+ &::-webkit-scrollbar-thumb:hover {
71
+ background: ${() => hexToRgba('#33b1ba', 0.3)};
72
+ }
73
+
74
+ &:last-child {
75
+ padding-bottom: 1.5rem;
76
+ }
77
+
78
+ @media (max-width: 54.8571rem) {
79
+ max-height: calc(100vh - 17.8572rem);
80
+ }
81
+ `;
82
+
83
+ const Footer = styled.div`
84
+ display: flex;
85
+ justify-content: space-between;
86
+ align-items: center;
87
+ padding: 0 1.5rem 1.5rem 1.5rem;
88
+ gap: 1rem;
89
+
90
+ @media (max-width: 42.8571rem) {
91
+ flex-direction: column;
92
+ align-items: stretch;
93
+
94
+ & > * {
95
+ width: 100%;
96
+ }
97
+ }
98
+ `;
99
+
100
+ function CardComponent({
101
+ className,
102
+ children,
103
+ borderColor,
104
+ borderWidth,
105
+ ...props
106
+ }) {
107
+ return (
108
+ <StyledCard
109
+ className={className}
110
+ borderColor={borderColor}
111
+ borderWidth={borderWidth}
112
+ {...props}
113
+ >
114
+ {children}
115
+ </StyledCard>
116
+ );
117
+ }
118
+
119
+ const BmCardv2 = Object.assign(CardComponent, {
120
+ Header,
121
+ Title,
122
+ Description,
123
+ Content,
124
+ Footer,
125
+ });
126
+
127
+ export { BmCardv2 };
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import { BmCardv2 } from './Card';
3
+ import { BmButton } from '../Buttons/buttons';
4
+
5
+ export default {
6
+ title: 'Components/BmCardv2',
7
+ component: BmCardv2,
8
+ argTypes: {
9
+ borderColor: {
10
+ control: 'color',
11
+ defaultValue: '#33B1BA',
12
+ },
13
+ borderWidth: {
14
+ control: 'text',
15
+ defaultValue: '1px',
16
+ },
17
+ },
18
+ };
19
+
20
+ const Template = ({ borderColor, borderWidth }) => {
21
+ return (
22
+ <div>
23
+ <BmCardv2 borderColor={borderColor} borderWidth={borderWidth}>
24
+ <BmCardv2.Header>
25
+ <BmCardv2.Title>Appointment Summary</BmCardv2.Title>
26
+ <BmCardv2.Description>
27
+ This BmCardv2 shows a quick overview of your booking.
28
+ </BmCardv2.Description>
29
+ </BmCardv2.Header>
30
+
31
+ <BmCardv2.Content>
32
+ <p>
33
+ <strong>Type:</strong> Consultation
34
+ </p>
35
+ <p>
36
+ <strong>Date:</strong> June 24, 2025
37
+ </p>
38
+ <p>
39
+ <strong>Doctor:</strong> Dr. Smith
40
+ </p>
41
+ </BmCardv2.Content>
42
+
43
+ <BmCardv2.Footer>
44
+ <BmButton variant="primary">Edit</BmButton>
45
+ <BmButton variant="secondary">Cancel</BmButton>
46
+ </BmCardv2.Footer>
47
+ </BmCardv2>
48
+ </div>
49
+ );
50
+ };
51
+
52
+ export const Default = Template.bind({});
53
+ Default.args = {
54
+ borderColor: '#33B1BA',
55
+ borderWidth: '1px',
56
+ };
57
+
58
+ export const Example = () => {
59
+ return (
60
+ <BmCardv2 borderColor="#d62a2af" borderWidth="1.5px">
61
+ <BmCardv2.Header>
62
+ <BmCardv2.Title>Appointment Summary</BmCardv2.Title>
63
+ <BmCardv2.Description>
64
+ This BmCardv2 shows a quick overview of your booking.
65
+ </BmCardv2.Description>
66
+ </BmCardv2.Header>
67
+ <BmCardv2.Content>
68
+ <p>
69
+ <strong>Type:</strong> Consultation
70
+ </p>
71
+ <p>
72
+ <strong>Date:</strong> June 24, 2025
73
+ </p>
74
+ <p>
75
+ <strong>Doctor:</strong> Dr. Smith
76
+ </p>
77
+ </BmCardv2.Content>
78
+ <BmCardv2.Footer>
79
+ <BmButton width="100%" size="medium" variant="primary">
80
+ Edit
81
+ </BmButton>
82
+ <BmButton
83
+ borderColor="#000000"
84
+ width="100%"
85
+ size="medium"
86
+ variant="secondary"
87
+ color="#000000"
88
+ >
89
+ Cancel
90
+ </BmButton>
91
+ </BmCardv2.Footer>
92
+ </BmCardv2>
93
+ );
94
+ };