beem-component 2.1.7 → 2.1.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.
- package/dist/components/BmCustomCardTitle/CustomCardTitle.js +17 -17
- package/dist/components/DepartmentCard/DepartmentCard.js +99 -0
- package/dist/components/DepartmentCard/DepartmentCard.stories.js +53 -0
- package/dist/components/InfoPanel/InfoPanel.js +1 -1
- package/dist/components/ResourceCard/ResourceCard.js +132 -0
- package/dist/components/ResourceCard/ResourceCard.stories.js +94 -0
- package/dist/components/globalStyles.js +1 -1
- package/dist/components/index.js +14 -0
- package/dist/components/text.js +11 -10
- package/dist/components/typography.js +3 -2
- package/package.json +1 -1
- package/public/index.html +1 -0
- package/src/App.js +67 -8
- package/src/fonts/Inter-Black.woff2 +0 -0
- package/src/fonts/Inter-Bold.woff2 +0 -0
- package/src/fonts/Inter-ExtraBold.woff2 +0 -0
- package/src/fonts/Inter-ExtraLight.woff2 +0 -0
- package/src/fonts/Inter-Light.woff2 +0 -0
- package/src/fonts/Inter-Medium.woff2 +0 -0
- package/src/fonts/Inter-Regular.woff2 +0 -0
- package/src/fonts/Inter-SemiBold.woff2 +0 -0
- package/src/fonts/Inter-Thin.woff2 +0 -0
- package/src/fonts/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/src/fonts/InterDisplay-Black.woff2 +0 -0
- package/src/fonts/InterDisplay-Bold.woff2 +0 -0
- package/src/fonts/InterDisplay-ExtraBold.woff2 +0 -0
- package/src/fonts/InterDisplay-ExtraLight.woff2 +0 -0
- package/src/fonts/InterDisplay-Light.woff2 +0 -0
- package/src/fonts/InterDisplay-Medium.woff2 +0 -0
- package/src/fonts/InterDisplay-SemiBold.woff2 +0 -0
- package/src/fonts/InterDisplay-Thin.woff2 +0 -0
- package/src/fonts.scss +4 -1
- package/src/lib/components/BmCustomCardTitle/CustomCardTitle.js +1 -1
- package/src/lib/components/DepartmentCard/DepartmentCard.js +131 -0
- package/src/lib/components/DepartmentCard/DepartmentCard.stories.jsx +38 -0
- package/src/lib/components/InfoPanel/InfoPanel.js +1 -1
- package/src/lib/components/ResourceCard/ResourceCard.js +209 -0
- package/src/lib/components/ResourceCard/ResourceCard.stories.jsx +68 -0
- package/src/lib/components/globalStyles.js +2 -1
- package/src/lib/components/index.js +4 -0
- package/src/lib/components/text.js +17 -11
- package/src/lib/components/typography.js +1 -0
package/src/App.js
CHANGED
|
@@ -4,11 +4,14 @@
|
|
|
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
|
-
|
|
7
|
+
import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
|
|
8
8
|
import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
9
9
|
import PersonIcon from '@mui/icons-material/Person';
|
|
10
10
|
import CalendarTodayOutlinedIcon from '@mui/icons-material/CalendarTodayOutlined';
|
|
11
11
|
import CheckIcon from '@mui/icons-material/Check';
|
|
12
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
13
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
14
|
+
// import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
|
|
12
15
|
// import { Tooltip } from '@mui/material';
|
|
13
16
|
import PeopleIcon from '@mui/icons-material/People';
|
|
14
17
|
// import BusinessIcon from '@mui/icons-material/Business';
|
|
@@ -36,6 +39,8 @@ import {
|
|
|
36
39
|
BmSelectionNotice,
|
|
37
40
|
BmSelector,
|
|
38
41
|
BmCustomCardTitle,
|
|
42
|
+
BmDepartmentCard,
|
|
43
|
+
BmResourceCard,
|
|
39
44
|
} from './lib/components';
|
|
40
45
|
import AlertBox from './lib/components/Alert/Alert';
|
|
41
46
|
// import ProgressIndicator from './lib/components/newProgress';
|
|
@@ -1011,6 +1016,54 @@ const Chat = () => {
|
|
|
1011
1016
|
<>
|
|
1012
1017
|
<GlobalStyle />
|
|
1013
1018
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
|
|
1019
|
+
<div style={{ width: '100%', maxWidth: '900px', margin: '2rem auto' }}>
|
|
1020
|
+
<div style={{ maxWidth: 400, margin: '2rem auto' }}>
|
|
1021
|
+
<BmDepartmentCard
|
|
1022
|
+
borderTopColor="#3b82f6" // blue
|
|
1023
|
+
isActive="true"
|
|
1024
|
+
name="Radiology Department"
|
|
1025
|
+
description="Handles imaging and diagnostic scans"
|
|
1026
|
+
// resourcesCount={8}
|
|
1027
|
+
onEdit={() => alert('Edit department')}
|
|
1028
|
+
onDelete={() => alert('Delete department')}
|
|
1029
|
+
EditIcon={EditIcon}
|
|
1030
|
+
DeleteIcon={DeleteIcon}
|
|
1031
|
+
/>
|
|
1032
|
+
|
|
1033
|
+
<BmDepartmentCard
|
|
1034
|
+
borderTopColor="#f97316" // orange
|
|
1035
|
+
isActive={false}
|
|
1036
|
+
name="Cardiology Department"
|
|
1037
|
+
description="Heart and blood vessel treatments"
|
|
1038
|
+
resourcesCount={5}
|
|
1039
|
+
onEdit={() => alert('Edit department')}
|
|
1040
|
+
onDelete={() => alert('Delete department')}
|
|
1041
|
+
EditIcon={EditIcon}
|
|
1042
|
+
DeleteIcon={DeleteIcon}
|
|
1043
|
+
/>
|
|
1044
|
+
<BmResourceCard
|
|
1045
|
+
borderTopColor="#10b981"
|
|
1046
|
+
isActive="true"
|
|
1047
|
+
name="Dr. Jane Smith"
|
|
1048
|
+
type="staff"
|
|
1049
|
+
resourceBadges={[
|
|
1050
|
+
{
|
|
1051
|
+
label: 'Google Synced',
|
|
1052
|
+
color: '#10b981',
|
|
1053
|
+
icon: CalendarTodayIcon,
|
|
1054
|
+
},
|
|
1055
|
+
]}
|
|
1056
|
+
departmentName="Radiology"
|
|
1057
|
+
email="jane.smith@example.com"
|
|
1058
|
+
phone="+123456789"
|
|
1059
|
+
availability="Mon-Fri 9am-5pm"
|
|
1060
|
+
onEdit={() => alert('Edit resource')}
|
|
1061
|
+
onDelete={() => alert('Delete resource')}
|
|
1062
|
+
EditIcon={EditIcon}
|
|
1063
|
+
DeleteIcon={DeleteIcon}
|
|
1064
|
+
/>
|
|
1065
|
+
</div>
|
|
1066
|
+
</div>
|
|
1014
1067
|
<div>
|
|
1015
1068
|
<BmInfoPanel.SectionSummary
|
|
1016
1069
|
iconColor="#33B1BA"
|
|
@@ -1030,12 +1083,18 @@ const Chat = () => {
|
|
|
1030
1083
|
icon={CalendarTodayOutlinedIcon}
|
|
1031
1084
|
themeColor="#33B1BA"
|
|
1032
1085
|
title="Book Your Medical Appointment"
|
|
1033
|
-
description="Schedule a 30-minute consultation with our
|
|
1086
|
+
description="Schedule a 30-minute consultation with our healThcare specialists"
|
|
1034
1087
|
variant="booking"
|
|
1035
1088
|
withStripe
|
|
1036
1089
|
/>
|
|
1037
1090
|
</div>
|
|
1038
1091
|
<div>
|
|
1092
|
+
<BmInfoPanel.Section
|
|
1093
|
+
title="Appointment Details"
|
|
1094
|
+
icon={CalendarTodayOutlinedIcon}
|
|
1095
|
+
backgroundColor="#fcba03"
|
|
1096
|
+
iconColor="#fcba03"
|
|
1097
|
+
/>
|
|
1039
1098
|
<BmCustomCardTitle
|
|
1040
1099
|
icon={CheckIcon}
|
|
1041
1100
|
themeColor="#33B1BA"
|
|
@@ -1090,12 +1149,12 @@ const Chat = () => {
|
|
|
1090
1149
|
themeColor="#33B1BA"
|
|
1091
1150
|
/>
|
|
1092
1151
|
{/* <BmInfoPanel>
|
|
1093
|
-
<BmInfoPanel.Section
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
>
|
|
1152
|
+
// <BmInfoPanel.Section
|
|
1153
|
+
// title="Appointment Details"
|
|
1154
|
+
// icon={CalendarTodayIcon}
|
|
1155
|
+
// backgroundColor="#fcba03"
|
|
1156
|
+
// iconColor="#fcba03"
|
|
1157
|
+
// >
|
|
1099
1158
|
<BmInfoPanel.SectionSummary
|
|
1100
1159
|
iconColor="#33B1BA"
|
|
1101
1160
|
textColor="#fcba03"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/fonts.scss
CHANGED
|
@@ -52,7 +52,6 @@ const CardContainer = styled.div`
|
|
|
52
52
|
|
|
53
53
|
const IconWrapper = styled.div`
|
|
54
54
|
background-color: ${({ themeColor }) => hexToRgba(themeColor, 0.1)};
|
|
55
|
-
border: 2px solid ${({ themeColor }) => themeColor};
|
|
56
55
|
height: ${({ variant }) => (variant === 'confirmation' ? '3.5rem' : '4rem')};
|
|
57
56
|
width: ${({ variant }) => (variant === 'confirmation' ? '3.5rem' : '4rem')};
|
|
58
57
|
border-radius: 9999px;
|
|
@@ -88,6 +87,7 @@ const IconWrapper = styled.div`
|
|
|
88
87
|
const Title = styled.h2`
|
|
89
88
|
text-align: center;
|
|
90
89
|
font-size: 1.125rem;
|
|
90
|
+
color: ${({ themeColor }) => themeColor};
|
|
91
91
|
margin-bottom: ${({ variant }) =>
|
|
92
92
|
variant === 'confirmation' ? '0.25rem' : '0.5rem'};
|
|
93
93
|
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const CardWrapper = styled.div`
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
|
|
7
|
+
border-radius: 0.5rem;
|
|
8
|
+
border: 1px solid #e5e7eb;
|
|
9
|
+
border-top: 4px solid ${({ borderTopColor }) => borderTopColor || '#cccccc'};
|
|
10
|
+
|
|
11
|
+
background-color: #ffffff;
|
|
12
|
+
opacity: ${({ isActive }) => (isActive ? 1 : 0.5)};
|
|
13
|
+
transition: opacity 0.3s;
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const Header = styled.div`
|
|
17
|
+
padding: 1rem 1rem 0.5rem 1rem;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const TitleRow = styled.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const CardTitle = styled.h3`
|
|
27
|
+
font-size: 1.125rem;
|
|
28
|
+
margin: 0;
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const CardDescription = styled.p`
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
color: #6b7280;
|
|
34
|
+
margin-top: 0.25rem;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const Content = styled.div`
|
|
38
|
+
margin-top: 1rem;
|
|
39
|
+
padding: 0 1rem 0.5rem 1rem;
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
align-items: center;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const ResourceText = styled.span`
|
|
46
|
+
font-size: 0.875rem;
|
|
47
|
+
color: #6b7280;
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const StatusRow = styled.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
const StatusDot = styled.span`
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
width: 0.5rem;
|
|
58
|
+
height: 0.5rem;
|
|
59
|
+
margin-right: 0.5rem;
|
|
60
|
+
border-radius: 9999px;
|
|
61
|
+
background-color: ${({ isActive }) => (isActive ? '#22c55e' : '#9ca3af')};
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
const StatusText = styled.span`
|
|
65
|
+
font-size: 0.75rem;
|
|
66
|
+
color: #6b7280;
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const IconButtonsContainer = styled.div`
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: 0.25rem;
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
const IconButton = styled.button`
|
|
75
|
+
background: none;
|
|
76
|
+
border: none;
|
|
77
|
+
padding: 0;
|
|
78
|
+
height: 2rem;
|
|
79
|
+
width: 2rem;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
color: ${({ destructive }) => (destructive ? '#ef4444' : 'inherit')};
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
color: ${({ destructive }) => (destructive ? '#ef4444' : '#374151')};
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
const BmDepartmentCard = ({
|
|
92
|
+
borderTopColor = '#cccccc',
|
|
93
|
+
isActive = true,
|
|
94
|
+
name,
|
|
95
|
+
description,
|
|
96
|
+
resourcesCount,
|
|
97
|
+
onEdit,
|
|
98
|
+
onDelete,
|
|
99
|
+
EditIcon,
|
|
100
|
+
DeleteIcon,
|
|
101
|
+
}) => {
|
|
102
|
+
return (
|
|
103
|
+
<CardWrapper borderTopColor={borderTopColor} isActive={isActive}>
|
|
104
|
+
<Header>
|
|
105
|
+
<TitleRow>
|
|
106
|
+
<CardTitle>{name}</CardTitle>
|
|
107
|
+
<IconButtonsContainer>
|
|
108
|
+
<IconButton onClick={onEdit}>
|
|
109
|
+
{EditIcon && <EditIcon fontSize="small" />}
|
|
110
|
+
</IconButton>
|
|
111
|
+
<IconButton destructive onClick={onDelete}>
|
|
112
|
+
{DeleteIcon && <DeleteIcon fontSize="small" />}
|
|
113
|
+
</IconButton>
|
|
114
|
+
</IconButtonsContainer>
|
|
115
|
+
</TitleRow>
|
|
116
|
+
<CardDescription>{description}</CardDescription>
|
|
117
|
+
</Header>
|
|
118
|
+
<Content>
|
|
119
|
+
{resourcesCount && (
|
|
120
|
+
<ResourceText>{resourcesCount} Resources</ResourceText>
|
|
121
|
+
)}
|
|
122
|
+
<StatusRow>
|
|
123
|
+
<StatusDot isActive={isActive} />
|
|
124
|
+
<StatusText>{isActive ? 'Active' : 'Inactive'}</StatusText>
|
|
125
|
+
</StatusRow>
|
|
126
|
+
</Content>
|
|
127
|
+
</CardWrapper>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export default BmDepartmentCard;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
3
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
4
|
+
import BmDepartmentCard from './DepartmentCard';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/BmDepartmentCard',
|
|
8
|
+
component: BmDepartmentCard,
|
|
9
|
+
argTypes: {
|
|
10
|
+
borderTopColor: { control: 'color' },
|
|
11
|
+
isActive: { control: 'boolean' },
|
|
12
|
+
name: { control: 'text' },
|
|
13
|
+
description: { control: 'text' },
|
|
14
|
+
resourcesCount: { control: 'number' },
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const Template = (args) => (
|
|
19
|
+
<BmDepartmentCard {...args} EditIcon={EditIcon} DeleteIcon={DeleteIcon} />
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const Active = Template.bind({});
|
|
23
|
+
Active.args = {
|
|
24
|
+
borderTopColor: '#3b82f6',
|
|
25
|
+
isActive: true,
|
|
26
|
+
name: 'Radiology',
|
|
27
|
+
description: 'Handles imaging and scans for diagnosis',
|
|
28
|
+
resourcesCount: 5,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Inactive = Template.bind({});
|
|
32
|
+
Inactive.args = {
|
|
33
|
+
borderTopColor: '#ef4444',
|
|
34
|
+
isActive: false,
|
|
35
|
+
name: 'Cardiology',
|
|
36
|
+
description: 'Provides heart-related care and surgeries',
|
|
37
|
+
resourcesCount: 3,
|
|
38
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/* eslint-disable react/no-array-index-key */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
|
|
5
|
+
const CardWrapper = styled.div`
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
border: 1px solid #e5e7eb;
|
|
8
|
+
border-radius: 0.5rem;
|
|
9
|
+
border-top: 4px solid ${({ borderTopColor }) => borderTopColor || '#cccccc'};
|
|
10
|
+
background-color: #ffffff;
|
|
11
|
+
opacity: ${({ isActive }) => (isActive ? 1 : 0.5)};
|
|
12
|
+
transition: opacity 0.3s;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
const Header = styled.div`
|
|
16
|
+
padding: 1rem 1rem 0.5rem 1rem;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const TitleRow = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const TitleContainer = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const CardTitle = styled.h3`
|
|
31
|
+
font-size: 1.125rem;
|
|
32
|
+
margin: 0;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const BadgeRow = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: 0.5rem;
|
|
38
|
+
margin-top: 0.25rem;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const Badge = styled.span`
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
border: 1px solid #e5e7eb;
|
|
46
|
+
border-radius: 0.375rem;
|
|
47
|
+
padding: 0.125rem 0.5rem;
|
|
48
|
+
font-size: 0.75rem;
|
|
49
|
+
background-color: #f9fafb;
|
|
50
|
+
color: ${({ color }) => color || 'inherit'};
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const IconsContainer = styled.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 0.25rem;
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
const IconButton = styled.button`
|
|
59
|
+
background: none;
|
|
60
|
+
border: none;
|
|
61
|
+
padding: 0;
|
|
62
|
+
height: 2rem;
|
|
63
|
+
width: 2rem;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
color: ${({ destructive }) => (destructive ? '#ef4444' : 'inherit')};
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
color: ${({ destructive }) => (destructive ? '#ef4444' : '#374151')};
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const Content = styled.div`
|
|
76
|
+
padding: 0 1rem 0.5rem 1rem;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 0.5rem;
|
|
80
|
+
font-size: 0.875rem;
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
const InfoRow = styled.div`
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
gap: 0.25rem;
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
const Label = styled.span`
|
|
90
|
+
color: #6b7280;
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
const Value = styled.span`
|
|
94
|
+
color: #374151;
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
const Footer = styled.div`
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: flex-end;
|
|
100
|
+
align-items: center;
|
|
101
|
+
padding: 0 1rem 0.75rem 1rem;
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
const StatusDot = styled.span`
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
width: 0.5rem;
|
|
107
|
+
height: 0.5rem;
|
|
108
|
+
margin-right: 0.5rem;
|
|
109
|
+
border-radius: 9999px;
|
|
110
|
+
background-color: ${({ isActive }) => (isActive ? '#22c55e' : '#9ca3af')};
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
const StatusText = styled.span`
|
|
114
|
+
font-size: 0.75rem;
|
|
115
|
+
color: #6b7280;
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
const BmResourceCard = ({
|
|
119
|
+
borderTopColor = '#cccccc',
|
|
120
|
+
isActive = true,
|
|
121
|
+
name,
|
|
122
|
+
type,
|
|
123
|
+
resourceBadges = [],
|
|
124
|
+
departmentName,
|
|
125
|
+
email,
|
|
126
|
+
phone,
|
|
127
|
+
capacity,
|
|
128
|
+
features,
|
|
129
|
+
availability,
|
|
130
|
+
onEdit,
|
|
131
|
+
onDelete,
|
|
132
|
+
EditIcon,
|
|
133
|
+
DeleteIcon,
|
|
134
|
+
}) => {
|
|
135
|
+
return (
|
|
136
|
+
<CardWrapper borderTopColor={borderTopColor} isActive={isActive}>
|
|
137
|
+
<Header>
|
|
138
|
+
<TitleRow>
|
|
139
|
+
<TitleContainer>
|
|
140
|
+
<CardTitle>{name}</CardTitle>
|
|
141
|
+
<BadgeRow>
|
|
142
|
+
<Badge>{type}</Badge>
|
|
143
|
+
{resourceBadges.map((badge, index) => (
|
|
144
|
+
<Badge key={index} color={badge.color}>
|
|
145
|
+
{badge.icon && (
|
|
146
|
+
<badge.icon style={{ fontSize: 14, marginRight: 4 }} />
|
|
147
|
+
)}
|
|
148
|
+
{badge.label}
|
|
149
|
+
</Badge>
|
|
150
|
+
))}
|
|
151
|
+
</BadgeRow>
|
|
152
|
+
</TitleContainer>
|
|
153
|
+
<IconsContainer>
|
|
154
|
+
<IconButton onClick={onEdit}>
|
|
155
|
+
{EditIcon && <EditIcon fontSize="small" />}
|
|
156
|
+
</IconButton>
|
|
157
|
+
<IconButton destructive onClick={onDelete}>
|
|
158
|
+
{DeleteIcon && <DeleteIcon fontSize="small" />}
|
|
159
|
+
</IconButton>
|
|
160
|
+
</IconsContainer>
|
|
161
|
+
</TitleRow>
|
|
162
|
+
</Header>
|
|
163
|
+
<Content>
|
|
164
|
+
{departmentName && (
|
|
165
|
+
<InfoRow>
|
|
166
|
+
<Label>Department:</Label>
|
|
167
|
+
<Value>{departmentName}</Value>
|
|
168
|
+
</InfoRow>
|
|
169
|
+
)}
|
|
170
|
+
{type === 'staff' && email && (
|
|
171
|
+
<InfoRow>
|
|
172
|
+
<Label>Email:</Label>
|
|
173
|
+
<Value>{email}</Value>
|
|
174
|
+
</InfoRow>
|
|
175
|
+
)}
|
|
176
|
+
{type === 'staff' && phone && (
|
|
177
|
+
<InfoRow>
|
|
178
|
+
<Label>Phone:</Label>
|
|
179
|
+
<Value>{phone}</Value>
|
|
180
|
+
</InfoRow>
|
|
181
|
+
)}
|
|
182
|
+
{type === 'room' && capacity && (
|
|
183
|
+
<InfoRow>
|
|
184
|
+
<Label>Capacity:</Label>
|
|
185
|
+
<Value>{capacity}</Value>
|
|
186
|
+
</InfoRow>
|
|
187
|
+
)}
|
|
188
|
+
{type === 'room' && features && features.length > 0 && (
|
|
189
|
+
<InfoRow>
|
|
190
|
+
<Label>Features:</Label>
|
|
191
|
+
<Value>{features.join(', ')}</Value>
|
|
192
|
+
</InfoRow>
|
|
193
|
+
)}
|
|
194
|
+
{availability && (
|
|
195
|
+
<InfoRow>
|
|
196
|
+
<Label>Availability:</Label>
|
|
197
|
+
<Value>{availability}</Value>
|
|
198
|
+
</InfoRow>
|
|
199
|
+
)}
|
|
200
|
+
</Content>
|
|
201
|
+
<Footer>
|
|
202
|
+
<StatusDot isActive={isActive} />
|
|
203
|
+
<StatusText>{isActive ? 'Active' : 'Inactive'}</StatusText>
|
|
204
|
+
</Footer>
|
|
205
|
+
</CardWrapper>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export default BmResourceCard;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
3
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
4
|
+
import CalendarTodayIcon from '@mui/icons-material/CalendarToday';
|
|
5
|
+
import BmResourceCard from './ResourceCard';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/BmResourceCard',
|
|
9
|
+
component: BmResourceCard,
|
|
10
|
+
argTypes: {
|
|
11
|
+
borderTopColor: { control: 'color' },
|
|
12
|
+
isActive: { control: 'boolean' },
|
|
13
|
+
name: { control: 'text' },
|
|
14
|
+
type: { control: 'text' },
|
|
15
|
+
departmentName: { control: 'text' },
|
|
16
|
+
email: { control: 'text' },
|
|
17
|
+
phone: { control: 'text' },
|
|
18
|
+
capacity: { control: 'number' },
|
|
19
|
+
availability: { control: 'text' },
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Template = (args) => (
|
|
24
|
+
<BmResourceCard {...args} EditIcon={EditIcon} DeleteIcon={DeleteIcon} />
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const Default = Template.bind({});
|
|
28
|
+
Default.args = {
|
|
29
|
+
borderTopColor: '#3b82f6',
|
|
30
|
+
isActive: true,
|
|
31
|
+
name: 'Room 101',
|
|
32
|
+
type: 'room',
|
|
33
|
+
resourceBadges: [
|
|
34
|
+
{ label: 'Synced', icon: CalendarTodayIcon, color: '#10b981' },
|
|
35
|
+
],
|
|
36
|
+
departmentName: 'Radiology',
|
|
37
|
+
capacity: 12,
|
|
38
|
+
features: ['Projector', 'Whiteboard'],
|
|
39
|
+
availability: 'Weekdays 9am - 5pm',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const StaffExample = Template.bind({});
|
|
43
|
+
StaffExample.args = {
|
|
44
|
+
borderTopColor: '#10b981',
|
|
45
|
+
isActive: true,
|
|
46
|
+
name: 'Dr. Sarah Johnson',
|
|
47
|
+
type: 'staff',
|
|
48
|
+
resourceBadges: [
|
|
49
|
+
{ label: 'Google Synced', icon: CalendarTodayIcon, color: '#3b82f6' },
|
|
50
|
+
],
|
|
51
|
+
departmentName: 'Cardiology',
|
|
52
|
+
email: 'sarah.johnson@hospital.com',
|
|
53
|
+
phone: '+1 555 123 4567',
|
|
54
|
+
availability: 'Mon - Fri, 9am - 3pm',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const RoomExample = Template.bind({});
|
|
58
|
+
RoomExample.args = {
|
|
59
|
+
borderTopColor: '#f59e0b',
|
|
60
|
+
isActive: false,
|
|
61
|
+
name: 'Conference Room B',
|
|
62
|
+
type: 'room',
|
|
63
|
+
resourceBadges: [],
|
|
64
|
+
departmentName: 'Oncology',
|
|
65
|
+
capacity: 20,
|
|
66
|
+
features: ['Video Conferencing', 'AC', 'Whiteboard'],
|
|
67
|
+
availability: 'Available on demand',
|
|
68
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createGlobalStyle } from 'styled-components';
|
|
2
|
-
import { h1, h2, h3, h4, h5, h6, p, input, a } from './text';
|
|
2
|
+
import { h1, h2, h3, h4, h5, h6, p, input, a, span } from './text';
|
|
3
3
|
|
|
4
4
|
export const GlobalStyle = createGlobalStyle`
|
|
5
5
|
* { font-size: 14px; cursor: pointer}
|
|
@@ -12,4 +12,5 @@ export const GlobalStyle = createGlobalStyle`
|
|
|
12
12
|
p { ${p} }
|
|
13
13
|
input {${input}}
|
|
14
14
|
a {${a}}
|
|
15
|
+
span {${span}}
|
|
15
16
|
`;
|
|
@@ -83,6 +83,8 @@ import BmInfoPanel from './InfoPanel/InfoPanel';
|
|
|
83
83
|
import BmSelector from './BmSelector/BmSelector';
|
|
84
84
|
import BmCustomCardTitle from './BmCustomCardTitle/CustomCardTitle';
|
|
85
85
|
import BmAlertBox from './Alert/Alert';
|
|
86
|
+
import BmDepartmentCard from './DepartmentCard/DepartmentCard';
|
|
87
|
+
import BmResourceCard from './ResourceCard/ResourceCard';
|
|
86
88
|
|
|
87
89
|
export {
|
|
88
90
|
BmAccordion,
|
|
@@ -163,4 +165,6 @@ export {
|
|
|
163
165
|
BmSelector,
|
|
164
166
|
BmCustomCardTitle,
|
|
165
167
|
BmAlertBox,
|
|
168
|
+
BmDepartmentCard,
|
|
169
|
+
BmResourceCard,
|
|
166
170
|
};
|