beem-component 2.1.8 → 2.1.28

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 (55) hide show
  1. package/Dockerfile +1 -3
  2. package/Jenkinsfile +5 -20
  3. package/dist/components/BmSelector/BmSelector.js +4 -31
  4. package/dist/components/BmSelector/BmSelector.stories.js +1 -14
  5. package/dist/components/Card_v2/Card.js +3 -17
  6. package/dist/components/InfoPanel/InfoPanel.js +21 -72
  7. package/dist/components/InfoPanel/InfoPanel.stories.js +4 -56
  8. package/dist/components/ProgressIndicator/ProgressIndicator.js +3 -17
  9. package/dist/components/SelectionNotice/SelectionNotice.js +3 -17
  10. package/dist/components/globalStyles.js +1 -1
  11. package/dist/components/index.js +0 -14
  12. package/dist/components/text.js +10 -11
  13. package/dist/components/typography.js +2 -3
  14. package/nginx.conf +12 -26
  15. package/package.json +1 -1
  16. package/public/index.html +0 -1
  17. package/src/App.js +65 -128
  18. package/src/fonts.scss +0 -6
  19. package/src/lib/components/BmSelector/BmSelector.js +2 -34
  20. package/src/lib/components/BmSelector/BmSelector.stories.jsx +0 -10
  21. package/src/lib/components/Card_v2/Card.js +1 -39
  22. package/src/lib/components/InfoPanel/InfoPanel.js +12 -55
  23. package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +2 -42
  24. package/src/lib/components/ProgressIndicator/ProgressIndicator.js +1 -19
  25. package/src/lib/components/SelectionNotice/SelectionNotice.js +1 -19
  26. package/src/lib/components/globalStyles.js +1 -2
  27. package/src/lib/components/index.js +0 -4
  28. package/src/lib/components/text.js +11 -17
  29. package/src/lib/components/typography.js +0 -1
  30. package/dist/components/Alert/Alert.js +0 -83
  31. package/dist/components/Alert/Alert.stories.js +0 -66
  32. package/dist/components/BmCustomCardTitle/CustomCardTitle.js +0 -174
  33. package/dist/components/BmCustomCardTitle/CustomCardTitle.stories.js +0 -85
  34. package/src/fonts/Inter-Black.woff2 +0 -0
  35. package/src/fonts/Inter-Bold.woff2 +0 -0
  36. package/src/fonts/Inter-ExtraBold.woff2 +0 -0
  37. package/src/fonts/Inter-ExtraLight.woff2 +0 -0
  38. package/src/fonts/Inter-Light.woff2 +0 -0
  39. package/src/fonts/Inter-Medium.woff2 +0 -0
  40. package/src/fonts/Inter-Regular.woff2 +0 -0
  41. package/src/fonts/Inter-SemiBold.woff2 +0 -0
  42. package/src/fonts/Inter-Thin.woff2 +0 -0
  43. package/src/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
  44. package/src/fonts/InterDisplay-Black.woff2 +0 -0
  45. package/src/fonts/InterDisplay-Bold.woff2 +0 -0
  46. package/src/fonts/InterDisplay-ExtraBold.woff2 +0 -0
  47. package/src/fonts/InterDisplay-ExtraLight.woff2 +0 -0
  48. package/src/fonts/InterDisplay-Light.woff2 +0 -0
  49. package/src/fonts/InterDisplay-Medium.woff2 +0 -0
  50. package/src/fonts/InterDisplay-SemiBold.woff2 +0 -0
  51. package/src/fonts/InterDisplay-Thin.woff2 +0 -0
  52. package/src/lib/components/Alert/Alert.js +0 -111
  53. package/src/lib/components/Alert/Alert.stories.jsx +0 -66
  54. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +0 -142
  55. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +0 -83
@@ -3,28 +3,27 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.span = exports.p = exports.input = exports.h6 = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.a = void 0;
6
+ exports.p = exports.input = exports.h6 = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.a = void 0;
7
7
  var _typography = require("./typography");
8
8
  // 32px
9
- const h1 = exports.h1 = "font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 2.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
9
+ const h1 = exports.h1 = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 2.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
10
10
 
11
11
  // 24px
12
- const h2 = exports.h2 = "font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.714rem;\nletter-spacing: -0.02em;\nmargin: 0rem;");
12
+ const h2 = exports.h2 = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.714rem;\nletter-spacing: -0.02em;\nmargin: 0rem;");
13
13
 
14
14
  // 18px
15
- const h3 = exports.h3 = "font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
15
+ const h3 = exports.h3 = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
16
16
 
17
17
  // 16px
18
- const h4 = exports.h4 = " font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.143rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
18
+ const h4 = exports.h4 = " font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.143rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
19
19
 
20
20
  // 14px
21
- const h5 = exports.h5 = " font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
21
+ const h5 = exports.h5 = " font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
22
22
 
23
23
  // 12px
24
- const h6 = exports.h6 = " font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: .857rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
24
+ const h6 = exports.h6 = " font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: .857rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
25
25
 
26
26
  // 14px
27
- const p = exports.p = "font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
28
- const input = exports.input = " font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
29
- const a = exports.a = "font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
30
- const span = exports.span = "font-family: ".concat(_typography.Inter, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
27
+ const p = exports.p = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
28
+ const input = exports.input = " font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
29
+ const a = exports.a = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.QuoteMark = exports.PullQuote = exports.PoppinsMedium = exports.Poppins = exports.P = exports.OpenSans = exports.Inter = exports.Hero = exports.H6 = exports.H5 = exports.H4 = exports.H3 = exports.H2 = exports.H1 = exports.Captions = void 0;
6
+ exports.QuoteMark = exports.PullQuote = exports.PoppinsMedium = exports.Poppins = exports.P = exports.OpenSans = exports.Hero = exports.H6 = exports.H5 = exports.H4 = exports.H3 = exports.H2 = exports.H1 = exports.Captions = void 0;
7
7
  const H1 = exports.H1 = '2.286rem';
8
8
  const H2 = exports.H2 = '1.714rem';
9
9
  const H3 = exports.H3 = '1.286rem';
@@ -17,5 +17,4 @@ const Captions = exports.Captions = '0.714rem';
17
17
  const Hero = exports.Hero = '1rem';
18
18
  const PoppinsMedium = exports.PoppinsMedium = 'PoppinsMedium';
19
19
  const Poppins = exports.Poppins = 'Poppins';
20
- const OpenSans = exports.OpenSans = 'OpenSans';
21
- const Inter = exports.Inter = 'Inter';
20
+ const OpenSans = exports.OpenSans = 'OpenSans';
package/nginx.conf CHANGED
@@ -1,31 +1,17 @@
1
- # server {
2
- # listen 8085;
3
- # root /usr/share/nginx/html;
1
+ server {
2
+ listen 8085;
3
+ root /usr/share/nginx/html;
4
4
 
5
- # index index.html index.htm;
5
+ index index.html index.htm;
6
6
 
7
- # include /etc/nginx/mime.types;
7
+ include /etc/nginx/mime.types;
8
8
 
9
- # gzip on;
10
- # gzip_min_length 1000;
11
- # gzip_proxied expired no-cache no-store private auth;
12
- # gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
9
+ gzip on;
10
+ gzip_min_length 1000;
11
+ gzip_proxied expired no-cache no-store private auth;
12
+ gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13
13
 
14
- # location / {
15
- # try_files $uri $uri/ /index.html;
16
- # }
17
- # }
18
-
19
-
20
- # nginx.conf
21
- server {
22
- listen 3000;
23
- server_name localhost;
24
-
25
- root /usr/share/nginx/html;
26
- index index.html;
27
-
28
- location / {
29
- try_files $uri $uri/ /index.html;
30
- }
14
+ location / {
15
+ try_files $uri $uri/ /index.html;
16
+ }
31
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "2.1.8",
3
+ "version": "2.1.28",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
package/public/index.html CHANGED
@@ -4,7 +4,6 @@
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
6
  <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400..700&display=swap" rel="stylesheet">
8
7
  <meta name="viewport" content="width=device-width, initial-scale=1" />
9
8
  <meta name="theme-color" content="#000000" />
10
9
  <meta name="description" content="Web site created using create-react-app" />
package/src/App.js CHANGED
@@ -4,14 +4,12 @@
4
4
  import React, { useState } from 'react';
5
5
  // import AbcIcon from '@mui/icons-material/Abc';
6
6
  // import LocalOfferOutlinedIcon from '@mui/icons-material/LocalOfferOutlined';
7
- // import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
7
+ import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
8
8
  import AccessTimeIcon from '@mui/icons-material/AccessTime';
9
- import PersonIcon from '@mui/icons-material/Person';
10
- import CalendarTodayOutlinedIcon from '@mui/icons-material/CalendarTodayOutlined';
11
- import CheckIcon from '@mui/icons-material/Check';
9
+ // import PersonIcon from '@mui/icons-material/Person';
12
10
  // import { Tooltip } from '@mui/material';
13
11
  import PeopleIcon from '@mui/icons-material/People';
14
- // import BusinessIcon from '@mui/icons-material/Business';
12
+ import BusinessIcon from '@mui/icons-material/Business';
15
13
 
16
14
  import {
17
15
  BmChat,
@@ -35,9 +33,7 @@ import {
35
33
  BmButton,
36
34
  BmSelectionNotice,
37
35
  BmSelector,
38
- BmCustomCardTitle,
39
36
  } from './lib/components';
40
- import AlertBox from './lib/components/Alert/Alert';
41
37
  // import ProgressIndicator from './lib/components/newProgress';
42
38
 
43
39
  // const datsa = JSON.stringify({
@@ -944,7 +940,7 @@ const Chat = () => {
944
940
  };
945
941
  const slots = [
946
942
  {
947
- id: 'slot-1', // ⚠️ id is required
943
+ id: 'slot-1',
948
944
  label: '10:00 AM - 10:30 AM',
949
945
  value: { startDate: '10:00 AM', endDate: '10:30 AM' },
950
946
  },
@@ -953,56 +949,6 @@ const Chat = () => {
953
949
  label: '10:30 AM - 11:10 AM',
954
950
  value: { startDate: '10:30 AM', endDate: '11:10 AM' },
955
951
  },
956
- {
957
- id: 'slot-3',
958
- label: '11:10 AM - 11:50 AM',
959
- value: { startDate: '11:10 AM', endDate: '11:50 AM' },
960
- },
961
- {
962
- id: 'slot-4',
963
- label: '11:50 AM - 12:30 PM',
964
- value: { startDate: '11:50 AM', endDate: '12:30 PM' },
965
- },
966
- {
967
- id: 'slot-5',
968
- label: '12:30 PM - 1:10 PM',
969
- value: { startDate: '12:30 PM', endDate: '1:10 PM' },
970
- },
971
- {
972
- id: 'slot-6',
973
- label: '1:10 PM - 1:50 PM',
974
- value: { startDate: '1:10 PM', endDate: '1:50 PM' },
975
- },
976
- {
977
- id: 'slot-7',
978
- label: '1:50 PM - 2:30 PM',
979
- value: { startDate: '1:50 PM', endDate: '2:30 PM' },
980
- },
981
- {
982
- id: 'slot-8',
983
- label: '2:30 PM - 3:10 PM',
984
- value: { startDate: '2:30 PM', endDate: '3:10 PM' },
985
- },
986
- {
987
- id: 'slot-9',
988
- label: '3:10 PM - 3:50 PM',
989
- value: { startDate: '3:10 PM', endDate: '3:50 PM' },
990
- },
991
- {
992
- id: 'slot-10',
993
- label: '3:50 PM - 4:30 PM',
994
- value: { startDate: '3:50 PM', endDate: '4:30 PM' },
995
- },
996
- {
997
- id: 'slot-11',
998
- label: '4:30 PM - 5:10 PM',
999
- value: { startDate: '4:30 PM', endDate: '5:10 PM' },
1000
- },
1001
- {
1002
- id: 'slot-12',
1003
- label: '5:10 PM - 5:50 PM',
1004
- value: { startDate: '5:10 PM', endDate: '5:50 PM' },
1005
- },
1006
952
  ];
1007
953
 
1008
954
  const [selectedSlotId, setSelectedSlotId] = useState(null);
@@ -1010,48 +956,14 @@ const Chat = () => {
1010
956
  return (
1011
957
  <>
1012
958
  <GlobalStyle />
1013
- <div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
1014
- <div>
1015
- <BmInfoPanel.SectionSummary
1016
- iconColor="#33B1BA"
1017
- textColor="#fcba03"
1018
- icon={CalendarTodayOutlinedIcon}
1019
- title={formData.departmentName}
1020
- subtitle="Department"
1021
- // iconBackgroundColor
1022
- />
1023
- <AlertBox
1024
- icon={AccessTimeIcon}
1025
- themeColor="#DC2626"
1026
- title="Payment Error"
1027
- description="We couldn't process your payment. Please try again later or contact support."
1028
- />
1029
- <BmCustomCardTitle
1030
- icon={CalendarTodayOutlinedIcon}
1031
- themeColor="#33B1BA"
1032
- title="Book Your Medical Appointment"
1033
- description="Schedule a 30-minute consultation with our healThcare specialists"
1034
- variant="booking"
1035
- withStripe
1036
- />
1037
- </div>
1038
- <div>
1039
- <BmInfoPanel.Section
1040
- title="Appointment Details"
1041
- icon={CalendarTodayOutlinedIcon}
1042
- backgroundColor="#fcba03"
1043
- iconColor="#fcba03"
1044
- />
1045
- <BmCustomCardTitle
1046
- icon={CheckIcon}
1047
- themeColor="#33B1BA"
1048
- title="Appointment Confirmed!"
1049
- description="Your booking has been successfully scheduled"
1050
- variant="confirmation"
1051
- withStripe
1052
- />
1053
- </div>
1054
- </div>
959
+ <BmSelector
960
+ data={slots}
961
+ selectedDataId={selectedSlotId}
962
+ onChange={setSelectedSlotId}
963
+ icon={AccessTimeIcon}
964
+ themeColor="#33B1BA"
965
+ />
966
+
1055
967
  <div style={{ maxWidth: '600px', margin: '2rem auto' }}>
1056
968
  <div style={{ padding: '2rem' }}>
1057
969
  <h1>Progress Indicator Demo</h1>
@@ -1088,20 +1000,13 @@ const Chat = () => {
1088
1000
  </BmCardv2.Description>
1089
1001
  </BmCardv2.Header>
1090
1002
  <BmCardv2.Content>
1091
- <BmSelector
1092
- data={slots}
1093
- selectedDataId={selectedSlotId}
1094
- onChange={setSelectedSlotId}
1095
- icon={AccessTimeIcon}
1096
- themeColor="#33B1BA"
1097
- />
1098
- {/* <BmInfoPanel>
1099
- // <BmInfoPanel.Section
1100
- // title="Appointment Details"
1101
- // icon={CalendarTodayIcon}
1102
- // backgroundColor="#fcba03"
1103
- // iconColor="#fcba03"
1104
- // >
1003
+ <BmInfoPanel>
1004
+ <BmInfoPanel.Section
1005
+ title="Appointment Details"
1006
+ icon={CalendarTodayIcon}
1007
+ backgroundColor="#fcba03"
1008
+ iconColor="#fcba03"
1009
+ >
1105
1010
  <BmInfoPanel.SectionSummary
1106
1011
  iconColor="#33B1BA"
1107
1012
  textColor="#fcba03"
@@ -1116,20 +1021,52 @@ const Chat = () => {
1116
1021
  subtitle="Department"
1117
1022
  />
1118
1023
  </BmInfoPanel.Section>
1119
- </BmInfoPanel> */}
1120
- <BmInfoPanel.Section
1121
- title="Personal Information"
1122
- icon={PersonIcon}
1123
- showDivider
1124
- dividerColor="#33b1ba"
1125
- dividerWitdh="2px"
1126
- dividerType="solid"
1127
- dividerOpacity="0.5"
1128
- >
1129
- <BmInfoPanel.Row label="Name" value={formData.name} />
1130
- <BmInfoPanel.Row label="Phone" value={formData.phone} />
1131
- <BmInfoPanel.Row label="Email" value={formData.email} />
1132
- </BmInfoPanel.Section>
1024
+ </BmInfoPanel>
1025
+ <BmInfoPanel>
1026
+ {/* <BmInfoPanel.Section
1027
+ title="Appointment Details"
1028
+ icon={CalendarTodayIcon}
1029
+ background_color="rgba(51, 177, 186, 0.05)"
1030
+ >
1031
+ <BmInfoPanel.Row label="Type" value={appointmentDetails.title} />
1032
+ <BmInfoPanel.Row
1033
+ label="Department"
1034
+ value={formData.departmentName}
1035
+ />
1036
+ <BmInfoPanel.Row label="Resource" value={formData.resourceName} />
1037
+ <BmInfoPanel.Row
1038
+ label="Duration"
1039
+ value={appointmentDetails.duration}
1040
+ />
1041
+ <BmInfoPanel.Row
1042
+ label="Date"
1043
+ value={formData.date.toDateString()}
1044
+ />
1045
+ <BmInfoPanel.Row
1046
+ label="Time"
1047
+ value={formData.timeSlot.split(' - ')[1]}
1048
+ />
1049
+ </BmInfoPanel.Section> */}
1050
+
1051
+ {/* <BmInfoPanel.Section
1052
+ title="Personal Information"
1053
+ icon={PersonIcon}
1054
+ showDivider
1055
+ >
1056
+ <BmInfoPanel.Row label="Name" value={formData.name} />
1057
+ <BmInfoPanel.Row label="Phone" value={formData.phone} />
1058
+ <BmInfoPanel.Row label="Email" value={formData.email} />
1059
+ </BmInfoPanel.Section>
1060
+ <BmInfoPanel.Section
1061
+ title="Personal Information"
1062
+ icon={PersonIcon}
1063
+ showDivider
1064
+ >
1065
+ <BmInfoPanel.Row label="Name" value={formData.name} />
1066
+ <BmInfoPanel.Row label="Phone" value={formData.phone} />
1067
+ <BmInfoPanel.Row label="Email" value={formData.email} />
1068
+ </BmInfoPanel.Section> */}
1069
+ </BmInfoPanel>
1133
1070
  </BmCardv2.Content>
1134
1071
  <BmCardv2.Footer>
1135
1072
  <BmButton
package/src/fonts.scss CHANGED
@@ -25,10 +25,4 @@
25
25
  @font-face {
26
26
  font-family: 'OpenSans';
27
27
  src: url('../src/fonts/OpenSans-Regular.ttf');
28
- }
29
-
30
-
31
- @font-face {
32
- font-family: 'Inter';
33
- src: url('../src/fonts/Inter-regular.woff2')format('woff2'),url('../src/fonts/Inter-Bold.woff2')format('woff2'),url('../src/fonts/Inter-ExtraBold.woff2')format('woff2'),url('../src/fonts/Inter-ExtraLight.woff2')format('woff2'),url('../src/fonts/Inter-medium.woff2')format('woff2'),url('../src/fonts/Inter-SemiBold.woff2')format('woff2');
34
28
  }
@@ -1,25 +1,6 @@
1
1
  import React from 'react';
2
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
- };
3
+ import hexToRgba from '../../../util/convertToRGBA';
23
4
 
24
5
  const CustomRadio = styled.span`
25
6
  display: inline-block;
@@ -120,24 +101,11 @@ const BmSelector = ({
120
101
  textColor,
121
102
  fontWeight,
122
103
  name = 'selection',
123
- useFormik = false,
124
104
  }) => {
125
105
  return (
126
106
  <RadioGroupWrapper>
127
107
  {data.map((item) => {
128
108
  const isSelected = selectedDataId === item.id;
129
- const handleChange = () => {
130
- if (useFormik) {
131
- onChange({
132
- target: {
133
- name,
134
- value: item.id,
135
- },
136
- });
137
- } else {
138
- onChange(item.id);
139
- }
140
- };
141
109
 
142
110
  return (
143
111
  <label key={item.id} htmlFor={item.id}>
@@ -146,7 +114,7 @@ const BmSelector = ({
146
114
  name={name}
147
115
  value={item.id}
148
116
  checked={isSelected}
149
- onChange={handleChange}
117
+ onChange={() => onChange(item.id)}
150
118
  />
151
119
  <TimeSlotCard selected={isSelected} themeColor={themeColor}>
152
120
  <CustomRadio selected={isSelected} themeColor={themeColor} />
@@ -44,10 +44,6 @@ export default {
44
44
  },
45
45
  ],
46
46
  },
47
- useFormik: {
48
- control: { type: 'boolean' },
49
- defaultValue: false,
50
- },
51
47
  },
52
48
  };
53
49
 
@@ -93,7 +89,6 @@ Default.args = {
93
89
  value: { startDate: '09:00 AM', endDate: '09:30 AM' },
94
90
  },
95
91
  ],
96
- useFormik: false,
97
92
 
98
93
  themeColor: '#33B1BA',
99
94
  textColor: '#33B1BA',
@@ -115,13 +110,9 @@ export const Example = () => {
115
110
  },
116
111
  ];
117
112
 
118
- // When you use useFormik as true then you need to pass handleChange func and the name [name="time"].
119
- // so that is works accordingly
120
-
121
113
  const [selectedDataId, setSelectedDataId] = useState(null);
122
114
  return (
123
115
  <BmSelector
124
- name="time"
125
116
  data={slots}
126
117
  selectedDataId={selectedDataId}
127
118
  onChange={setSelectedDataId}
@@ -129,7 +120,6 @@ export const Example = () => {
129
120
  themeColor="#33B1BA"
130
121
  textColor="#33B1BA"
131
122
  fontWeight="600"
132
- useFormik="false"
133
123
  />
134
124
  );
135
125
  };
@@ -2,25 +2,7 @@
2
2
  import React from 'react';
3
3
  import styled from 'styled-components';
4
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
- };
5
+ import hexToRgba from '../../../util/convertToRGBA';
24
6
 
25
7
  const StyledCard = styled.div`
26
8
  background-color: var(--card, #fff);
@@ -54,31 +36,11 @@ const Description = styled.p`
54
36
  `;
55
37
 
56
38
  const Content = styled.div`
57
- min-height: 180px;
58
39
  padding: 0 1.5rem;
59
- max-height: calc(100vh - 28.5714rem);
60
- overflow-y: auto;
61
-
62
- scrollbar-width: thin;
63
- scrollbar-color: ${() => hexToRgba('#33b1ba', 0.2)} transparent;
64
-
65
- &::-webkit-scrollbar-thumb {
66
- background: ${() => hexToRgba('#33b1ba', 0.3)};
67
- border-radius: 0.6429rem;
68
- transition: background 0.2s ease;
69
- }
70
-
71
- &::-webkit-scrollbar-thumb:hover {
72
- background: ${() => hexToRgba('#33b1ba', 0.3)};
73
- }
74
40
 
75
41
  &:last-child {
76
42
  padding-bottom: 1.5rem;
77
43
  }
78
-
79
- @media (max-width: 54.8571rem) {
80
- max-height: calc(100vh - 17.8572rem);
81
- }
82
44
  `;
83
45
 
84
46
  const Footer = styled.div`
@@ -1,25 +1,6 @@
1
1
  import React from 'react';
2
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
- };
3
+ import hexToRgba from '../../../util/convertToRGBA';
23
4
 
24
5
  const Panel = styled.div`
25
6
  border: 0.0714rem solid rgba(51, 177, 186, 0.1);
@@ -53,8 +34,8 @@ const IconBox = styled.div`
53
34
  color: ${({ iconColor }) => iconColor || '#00000'};
54
35
 
55
36
  @media (min-width: 45.7143rem) {
56
- height: 1.4rem;
57
- width: 1.4rem;
37
+ height: 1.5rem;
38
+ width: 1.5rem;
58
39
  }
59
40
  }
60
41
  `;
@@ -81,7 +62,7 @@ const SummarySubtitle = styled.p`
81
62
  `;
82
63
 
83
64
  const SectionContainer = styled.div`
84
- padding: 0.6rem 1rem;
65
+ padding: 0.75rem 1rem;
85
66
  display: flex;
86
67
  align-items: center;
87
68
  gap: 0.5rem;
@@ -134,7 +115,8 @@ const RowContainer = styled.div`
134
115
  `;
135
116
 
136
117
  const Label = styled.span`
137
- color: ${({ labelTextColor }) => hexToRgba(labelTextColor || '#000000', 0.6)};
118
+ color: rgba(0, 0, 0, 0.6);
119
+
138
120
  @media (max-width: 42.8571rem) {
139
121
  font-size: 0.75rem;
140
122
  }
@@ -142,7 +124,7 @@ const Label = styled.span`
142
124
 
143
125
  const Value = styled.span`
144
126
  font-weight: 500;
145
- color: ${({ valueTextColor }) => hexToRgba(valueTextColor || '#000000', 1)};
127
+
146
128
  @media (max-width: 42.8571rem) {
147
129
  font-size: 0.75rem;
148
130
  }
@@ -150,20 +132,7 @@ const Value = styled.span`
150
132
 
151
133
  const Divider = styled.hr`
152
134
  border: none;
153
- border-top: ${({
154
- showDivider,
155
- dividerColor = '#33b1ba',
156
- dividerType = 'dashed',
157
- dividerWitdh = '1px',
158
- dividerOpacity = '0.2',
159
- }) => {
160
- if (showDivider) {
161
- return `${dividerWitdh} ${dividerType} ${hexToRgba(
162
- dividerColor,
163
- dividerOpacity
164
- )}`;
165
- }
166
- }};
135
+ border-top: 0.0714rem dashed rgba(51, 177, 186, 0.2);
167
136
  margin: 1rem auto;
168
137
  max-width: 97%;
169
138
  @media (max-width: 42.8571rem) {
@@ -201,21 +170,9 @@ const Section = ({
201
170
  backgroundColor,
202
171
  iconColor,
203
172
  iconBackgroundColor,
204
- dividerColor,
205
- dividerWitdh,
206
- dividerType,
207
- dividerOpacity,
208
173
  }) => (
209
174
  <>
210
- {showDivider && (
211
- <Divider
212
- dividerColor={dividerColor}
213
- showDivider={showDivider}
214
- dividerWitdh={dividerWitdh}
215
- dividerType={dividerType}
216
- dividerOpacity={dividerOpacity}
217
- />
218
- )}
175
+ {showDivider && <Divider />}
219
176
  <SectionContainer backgroundColor={backgroundColor}>
220
177
  {Icon && (
221
178
  <IconBox
@@ -231,10 +188,10 @@ const Section = ({
231
188
  </>
232
189
  );
233
190
 
234
- const Row = ({ label, value, labelTextColor, valueTextColor }) => (
191
+ const Row = ({ label, value }) => (
235
192
  <RowContainer>
236
- <Label labelTextColor={labelTextColor}>{label}:</Label>
237
- <Value valueTextColor={valueTextColor}>{value}</Value>
193
+ <Label>{label}:</Label>
194
+ <Value>{value}</Value>
238
195
  </RowContainer>
239
196
  );
240
197