beem-component 2.1.7 → 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 (29) 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 +20 -71
  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/index.js +0 -14
  11. package/nginx.conf +12 -26
  12. package/package.json +1 -1
  13. package/src/App.js +59 -116
  14. package/src/lib/components/BmSelector/BmSelector.js +2 -34
  15. package/src/lib/components/BmSelector/BmSelector.stories.jsx +0 -10
  16. package/src/lib/components/Card_v2/Card.js +1 -39
  17. package/src/lib/components/InfoPanel/InfoPanel.js +11 -54
  18. package/src/lib/components/InfoPanel/InfoPanel.stories.jsx +2 -42
  19. package/src/lib/components/ProgressIndicator/ProgressIndicator.js +1 -19
  20. package/src/lib/components/SelectionNotice/SelectionNotice.js +1 -19
  21. package/src/lib/components/index.js +0 -4
  22. package/dist/components/Alert/Alert.js +0 -83
  23. package/dist/components/Alert/Alert.stories.js +0 -66
  24. package/dist/components/BmCustomCardTitle/CustomCardTitle.js +0 -174
  25. package/dist/components/BmCustomCardTitle/CustomCardTitle.stories.js +0 -85
  26. package/src/lib/components/Alert/Alert.js +0 -111
  27. package/src/lib/components/Alert/Alert.stories.jsx +0 -66
  28. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +0 -142
  29. package/src/lib/components/BmCustomCardTitle/CustomCardTitle.stories.jsx +0 -83
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "2.1.7",
3
+ "version": "2.1.28",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
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,42 +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
- <BmCustomCardTitle
1040
- icon={CheckIcon}
1041
- themeColor="#33B1BA"
1042
- title="Appointment Confirmed!"
1043
- description="Your booking has been successfully scheduled"
1044
- variant="confirmation"
1045
- withStripe
1046
- />
1047
- </div>
1048
- </div>
959
+ <BmSelector
960
+ data={slots}
961
+ selectedDataId={selectedSlotId}
962
+ onChange={setSelectedSlotId}
963
+ icon={AccessTimeIcon}
964
+ themeColor="#33B1BA"
965
+ />
966
+
1049
967
  <div style={{ maxWidth: '600px', margin: '2rem auto' }}>
1050
968
  <div style={{ padding: '2rem' }}>
1051
969
  <h1>Progress Indicator Demo</h1>
@@ -1082,14 +1000,7 @@ const Chat = () => {
1082
1000
  </BmCardv2.Description>
1083
1001
  </BmCardv2.Header>
1084
1002
  <BmCardv2.Content>
1085
- <BmSelector
1086
- data={slots}
1087
- selectedDataId={selectedSlotId}
1088
- onChange={setSelectedSlotId}
1089
- icon={AccessTimeIcon}
1090
- themeColor="#33B1BA"
1091
- />
1092
- {/* <BmInfoPanel>
1003
+ <BmInfoPanel>
1093
1004
  <BmInfoPanel.Section
1094
1005
  title="Appointment Details"
1095
1006
  icon={CalendarTodayIcon}
@@ -1110,20 +1021,52 @@ const Chat = () => {
1110
1021
  subtitle="Department"
1111
1022
  />
1112
1023
  </BmInfoPanel.Section>
1113
- </BmInfoPanel> */}
1114
- <BmInfoPanel.Section
1115
- title="Personal Information"
1116
- icon={PersonIcon}
1117
- showDivider
1118
- dividerColor="#33b1ba"
1119
- dividerWitdh="2px"
1120
- dividerType="solid"
1121
- dividerOpacity="0.5"
1122
- >
1123
- <BmInfoPanel.Row label="Name" value={formData.name} />
1124
- <BmInfoPanel.Row label="Phone" value={formData.phone} />
1125
- <BmInfoPanel.Row label="Email" value={formData.email} />
1126
- </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>
1127
1070
  </BmCardv2.Content>
1128
1071
  <BmCardv2.Footer>
1129
1072
  <BmButton
@@ -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
  `;
@@ -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
 
@@ -31,16 +31,6 @@ export default {
31
31
  iconColor: { control: 'color' },
32
32
  textColor: { control: 'color' },
33
33
  iconBackgroundColor: { control: 'boolean' },
34
- dividerColor: { control: 'color' },
35
- dividerWidth: { control: { type: 'text' }, defaultValue: '3px' },
36
- dividerOpacity: { control: { type: 'text' }, defaultValue: '0.2' },
37
- dividerType: {
38
- control: { type: 'select' },
39
- options: ['dashed', 'solid'],
40
- defaultValue: 'dashed',
41
- },
42
- labelTextColor: { control: 'color' },
43
- valueTextColor: { control: 'color' },
44
34
  },
45
35
  };
46
36
 
@@ -51,12 +41,6 @@ const Template = ({
51
41
  iconColor,
52
42
  textColor,
53
43
  iconBackgroundColor,
54
- dividerColor,
55
- dividerOpacity,
56
- dividerType,
57
- dividerWidth,
58
- labelTextColor,
59
- valueTextColor,
60
44
  }) => {
61
45
  if (variant === 'summary') {
62
46
  return (
@@ -94,12 +78,7 @@ const Template = ({
94
78
  <BmInfoPanel.Row label="Resource" value="Dr. Smith" />
95
79
  <BmInfoPanel.Row label="Duration" value="30 minutes" />
96
80
  <BmInfoPanel.Row label="Date" value="Monday, June 24, 2025" />
97
- <BmInfoPanel.Row
98
- labelTextColor={labelTextColor}
99
- valueTextColor={valueTextColor}
100
- label="Time"
101
- value="09:00 AM"
102
- />
81
+ <BmInfoPanel.Row label="Time" value="09:00 AM" />
103
82
  </BmInfoPanel.Section>
104
83
 
105
84
  <BmInfoPanel.Section
@@ -107,10 +86,6 @@ const Template = ({
107
86
  icon={PersonIcon}
108
87
  showDivider={showDivider}
109
88
  iconColor={iconColor}
110
- dividerColor={dividerColor}
111
- dividerType={dividerType}
112
- dividerOpacity={dividerOpacity}
113
- dividerWitdh={dividerWidth}
114
89
  >
115
90
  <BmInfoPanel.Row label="Name" value="John Doe" />
116
91
  <BmInfoPanel.Row label="Email" value="john@example.com" />
@@ -128,12 +103,6 @@ Default.args = {
128
103
  iconColor: '#33B1BA',
129
104
  textColor: '#000000',
130
105
  iconBackgroundColor: false,
131
- dividerColor: '#33b1ba',
132
- dividerType: 'dashed',
133
- dividerWidth: '1px',
134
- dividerOpacity: '0.2',
135
- labelTextColor: '#e46a8e',
136
- valueTextColor: '#235e92',
137
106
  };
138
107
 
139
108
  export const ExampleSummary = () => {
@@ -173,12 +142,7 @@ export const ExampleDetails = () => {
173
142
  <BmInfoPanel.Row label="Type" value={appointmentDetails.title} />
174
143
  <BmInfoPanel.Row label="Department" value={formData.departmentName} />
175
144
  <BmInfoPanel.Row label="Resource" value={formData.resourceName} />
176
- <BmInfoPanel.Row
177
- labelTextColor="#e46a8e"
178
- valueTextColor="#235e92"
179
- label="Duration"
180
- value={appointmentDetails.duration}
181
- />
145
+ <BmInfoPanel.Row label="Duration" value={appointmentDetails.duration} />
182
146
  <BmInfoPanel.Row label="Date" value={formData.date.toDateString()} />
183
147
  <BmInfoPanel.Row
184
148
  label="Time"
@@ -190,10 +154,6 @@ export const ExampleDetails = () => {
190
154
  title="Personal Information"
191
155
  icon={PersonIcon}
192
156
  showDivider
193
- dividerColor="#33b1ba"
194
- dividerType="dashed"
195
- dividerWitdh="1px"
196
- dividerOpacity="0.2"
197
157
  >
198
158
  <BmInfoPanel.Row label="Name" value={formData.name} />
199
159
  <BmInfoPanel.Row label="Phone" value={formData.phone} />
@@ -1,25 +1,7 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
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
- };
4
+ import hexToRgba from '../../../util/convertToRGBA';
23
5
 
24
6
  const Container = styled.div`
25
7
  margin-bottom: 1rem;
@@ -1,25 +1,7 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
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
- };
4
+ import hexToRgba from '../../../util/convertToRGBA';
23
5
 
24
6
  const Container = styled.div`
25
7
  background-color: ${({ color }) => hexToRgba(color || '#33B1BA', 0.05)};
@@ -81,8 +81,6 @@ import BmLabelWithIcon from './LabelWithIcon/LabelWithIcon';
81
81
  import { BmCardv2 } from './Card_v2/Card';
82
82
  import BmInfoPanel from './InfoPanel/InfoPanel';
83
83
  import BmSelector from './BmSelector/BmSelector';
84
- import BmCustomCardTitle from './BmCustomCardTitle/CustomCardTitle';
85
- import BmAlertBox from './Alert/Alert';
86
84
 
87
85
  export {
88
86
  BmAccordion,
@@ -161,6 +159,4 @@ export {
161
159
  BmInfoPanel,
162
160
  BmProgressIndicator,
163
161
  BmSelector,
164
- BmCustomCardTitle,
165
- BmAlertBox,
166
162
  };